@shipstatic/ship 2.0.0-beta.14 → 2.0.0-beta.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,1531 +1,7 @@
1
- /**
2
- * @file Shared TypeScript types, constants, and utilities for the ShipStatic platform.
3
- * This package is the single source of truth for all shared data structures.
4
- */
5
- /**
6
- * Deployment status constants
7
- */
8
- declare const DeploymentStatus: {
9
- readonly PENDING: "pending";
10
- readonly SUCCESS: "success";
11
- readonly FAILED: "failed";
12
- readonly DELETING: "deleting";
13
- };
14
- type DeploymentStatusType = (typeof DeploymentStatus)[keyof typeof DeploymentStatus];
15
- /**
16
- * Core deployment object - used in both API responses and SDK
17
- */
18
- interface Deployment {
19
- /** The deployment hostname (e.g., 'happy-cat-abc1234.shipstatic.com') */
20
- readonly deployment: string;
21
- /** Full URL to the deployment (e.g., 'https://happy-cat-abc1234.shipstatic.com') */
22
- readonly url: string;
23
- /** Number of files in this deployment */
24
- readonly files: number;
25
- /** Total size of all files in bytes */
26
- readonly size: number;
27
- /** Current deployment status */
28
- status: DeploymentStatusType;
29
- /** Whether deployment has a ship.json config */
30
- readonly config: boolean;
31
- /** Whether deployment has a password set */
32
- readonly password: boolean;
33
- /** Labels for categorization and filtering (lowercase, alphanumeric with separators). Always present, empty array when none. */
34
- labels: string[];
35
- /** The client/tool used to create this deployment (e.g., 'web', 'sdk', 'cli'), null if unknown */
36
- readonly via: string | null;
37
- /** Unix timestamp (seconds) when deployment was created */
38
- readonly created: number;
39
- /** Unix timestamp (seconds) when deployment expires, null if never */
40
- expires: number | null;
41
- /** Full URL to the deployment screenshot (e.g., 'https://screenshots.shipstatic.com/happy-cat-abc1234/a3f2c1b4d5e6f789') */
42
- readonly screenshot: string;
43
- }
44
- /**
45
- * Response from deployment creation. Extends Deployment with one-time fields
46
- * only present on creation (not on subsequent GET requests).
47
- */
48
- interface DeploymentCreateResponse extends Deployment {
49
- /** Claim URL for public deployments. Present when deployed without credentials. */
50
- readonly claim?: string;
51
- }
52
- /**
53
- * Every path the public API answers on, declared once.
54
- *
55
- * The URL surface was written out in four places — the API's mounts, the
56
- * SDK's client, the dashboard's client, and the post-deploy smoke — so a
57
- * rename meant finding all four. The first three now read this table.
58
- *
59
- * The smoke (`cloudflare/api/smoke.mjs`) deliberately still spells its own:
60
- * five of its nine paths are `/admin/*`, which this table excludes by
61
- * design, and splitting one list between a registry and literals reads worse
62
- * than keeping it uniform.
63
- *
64
- * **What this guarantees, exactly.** Collection paths are mounted from here,
65
- * so producer and consumer cannot diverge. Item paths are declared here and
66
- * consumed by clients, but the API spells them relative to their mount
67
- * (`/:deployment/config`), so the table does not *generate* them — it is
68
- * held to them by `api/tests/architecture/api-paths.test.ts`, which fails if
69
- * any entry names a path no route answers. Some entries have no client yet
70
- * (`DEPLOYMENT_CONFIG`, `DOMAIN_PROPAGATION` — endpoints the SDK
71
- * deliberately does not reach); the fence is what keeps those honest rather
72
- * than merely asserted.
73
- *
74
- * **The operator surface is deliberately absent.** `/admin/*` paths belong
75
- * to `web/my`, for the same reason its row types do: this package is
76
- * published, and the operator surface is not public (see `CLAUDE.md`, "Admin
77
- * types"). A path here is a promise to every npm consumer; `/admin` is a
78
- * promise to one dashboard.
79
- *
80
- * Item paths are functions rather than templates so the key is interpolated
81
- * in one place, encoded the same way by every caller.
82
- */
83
- declare const API_PATHS: {
84
- readonly DEPLOYMENTS: "/deployments";
85
- readonly DEPLOYMENT: (deployment: string) => string;
86
- readonly DEPLOYMENT_CONFIG: (deployment: string) => string;
87
- readonly DOMAINS: "/domains";
88
- readonly DOMAIN: (domain: string) => string;
89
- readonly DOMAIN_VERIFY: (domain: string) => string;
90
- readonly DOMAIN_DNS: (domain: string) => string;
91
- readonly DOMAIN_RECORDS: (domain: string) => string;
92
- readonly DOMAIN_SHARE: (domain: string) => string;
93
- readonly DOMAIN_PROPAGATION: (domain: string) => string;
94
- readonly DOMAINS_VALIDATE: "/domains/validate";
95
- readonly TOKENS: "/tokens";
96
- readonly TOKEN: (token: string) => string;
97
- readonly ACCOUNT: "/account";
98
- readonly ACCOUNT_KEY: "/account/key";
99
- readonly ACCOUNT_CLAIM: "/account/claim";
100
- readonly ACTIVITIES: "/activities";
101
- readonly LABELS: "/labels";
102
- readonly LIMITS: "/limits";
103
- readonly PING: "/ping";
104
- readonly SETUP: "/setup";
105
- readonly SPA_CHECK: "/spa-check";
106
- readonly UPLOAD: "/upload";
107
- };
108
- /**
109
- * The half of a list response that is identical on every list.
110
- *
111
- * `GET /<collection>` answers exactly two fields — the collection under its
112
- * own plural noun, and this cursor — so the cursor is declared once here and
113
- * each response below adds only its noun. `cursor: null` means last page and
114
- * is the ENTIRE has-more signal, which is why there is no `has_more`.
115
- *
116
- * There is deliberately no `total`. A count is an aggregate over a
117
- * collection, not a property of a page; producing one would cost a COUNT
118
- * beside every page read, which is precisely what keyset pagination exists
119
- * to avoid. Counts live on the resource that summarises the collection —
120
- * `GET /account`'s `usage` for one caller, `GET /admin/stats` platform-wide.
121
- */
122
- interface ListResponse {
123
- /** Opaque cursor from this page; `null` on the last page. */
124
- cursor: string | null;
125
- }
126
- /**
127
- * Response for listing deployments
128
- */
129
- interface DeploymentListResponse extends ListResponse {
130
- /** Array of deployments */
131
- deployments: Deployment[];
132
- }
133
- /**
134
- * Acknowledgement of `DELETE /deployments/:deployment` — and the shape every
135
- * mutation with no entity left to return follows.
136
- *
137
- * **The law:** a mutation answers with the resource it affected. If the
138
- * resource still exists, that means the entity itself (`Deployment`,
139
- * `Domain`, …). Otherwise it means this: the resource noun carrying the
140
- * item's canonical key, plus the resource's own state field — and ONLY when
141
- * the resource survived in a transitional state, as an async deletion's does.
142
- * Where the resource is simply gone, the key alone is the whole answer
143
- * ({@link DomainDeleteResponse}, {@link TokenDeleteResponse}).
144
- *
145
- * Put positively: **an acknowledgement is a projection of the resource** —
146
- * its key, plus its own state field where the state changed. That is the
147
- * test to apply, and it is sharper than "no constant", which this shape
148
- * would fail on its own terms: `status` here is the literal `'deleting'` on
149
- * every success, exactly as fixed as a `changed: true` would be.
150
- *
151
- * The difference is not how predictable the value is, it is what the field
152
- * IS. `status` is the deployment's own field — the same one `GET
153
- * /deployments/:deployment` returns — so this response is `Deployment`
154
- * narrowed to two members, and a client renders it with the code it already
155
- * has. `changed: true`, `queued: true` and `success: true` are not fields of
156
- * any entity; they exist only to assert that the call worked, which the
157
- * status code already said. Sync versus accepted is likewise the status
158
- * code's job — 200 versus 202 — not a boolean's.
159
- *
160
- * No prose either (`message`): an acknowledgement is data, and each surface
161
- * composes its own copy.
162
- */
163
- interface DeploymentDeleteResponse {
164
- /** The deployment hostname that was marked for removal */
165
- readonly deployment: string;
166
- /** The state the deployment is in while background cleanup runs */
167
- readonly status: DeploymentStatusType;
168
- }
169
- /**
170
- * Domain status constants
171
- *
172
- * - PENDING: DNS not configured
173
- * - PARTIAL: DNS partially configured
174
- * - SUCCESS: DNS fully verified
175
- * - PAUSED: Domain paused due to plan enforcement (billing)
176
- */
177
- declare const DomainStatus: {
178
- readonly PENDING: "pending";
179
- readonly PARTIAL: "partial";
180
- readonly SUCCESS: "success";
181
- readonly PAUSED: "paused";
182
- };
183
- type DomainStatusType = (typeof DomainStatus)[keyof typeof DomainStatus];
184
- /**
185
- * Core domain object - used in both API responses and SDK
186
- */
187
- interface Domain {
188
- /** The domain name */
189
- readonly domain: string;
190
- /** Full URL to the domain (e.g., 'https://www.example.com') */
191
- readonly url: string;
192
- /** The deployment hostname this domain points to (null = domain added but not yet linked) */
193
- deployment: string | null;
194
- /** Current domain status */
195
- status: DomainStatusType;
196
- /** Labels for categorization and filtering (lowercase, alphanumeric with separators). Always present, empty array when none. */
197
- labels: string[];
198
- /** Unix timestamp (seconds) when domain was created */
199
- readonly created: number;
200
- /** Unix timestamp (seconds) when deployment was last linked, null if never linked */
201
- linked: number | null;
202
- /** Total deployment links */
203
- links: number;
204
- }
205
- /**
206
- * Return shape of `domains.set()` — `Domain` plus an SDK-derived flag indicating
207
- * whether the underlying `PUT /domains/:name` created the record (HTTP 201) or
208
- * updated an existing one (HTTP 200).
209
- *
210
- * `isCreate` is not part of the wire format — the API returns a plain `Domain`
211
- * body. The SDK derives the flag from the HTTP status code so callers (notably
212
- * the CLI) can format different output for the create vs repoint paths without
213
- * a second round-trip.
214
- */
215
- interface DomainSetResult extends Domain {
216
- /** `true` when this call created a new domain; `false` when it updated an existing one. */
217
- isCreate: boolean;
218
- }
219
- /**
220
- * Response for listing domains
221
- */
222
- interface DomainListResponse extends ListResponse {
223
- /** Array of domains */
224
- domains: Domain[];
225
- }
226
- /**
227
- * Acknowledgement of `DELETE /domains/:domain`. The row is gone, so there is
228
- * no state to state — the canonical domain name is the whole answer. See
229
- * {@link DeploymentDeleteResponse} for the law.
230
- */
231
- interface DomainDeleteResponse {
232
- /** The domain name that was removed, normalized */
233
- readonly domain: string;
234
- }
235
- /**
236
- * Acknowledgement of `POST /domains/:domain/verify` (202). The DNS check is
237
- * queued, not performed — the accepted status code says so, and the domain's
238
- * own status is unchanged until the check runs, which is why none is stated
239
- * here. See {@link DeploymentDeleteResponse} for the law.
240
- */
241
- interface DomainVerifyResponse {
242
- /** The domain whose DNS verification was queued, normalized */
243
- readonly domain: string;
244
- }
245
- /**
246
- * DNS record types supported for domain configuration
247
- */
248
- type DnsRecordType = 'A' | 'CNAME';
249
- /**
250
- * DNS record required for domain configuration
251
- */
252
- interface DnsRecord {
253
- /** Record type (A for apex, CNAME for subdomains) */
254
- type: DnsRecordType;
255
- /** The DNS name to configure */
256
- name: string;
257
- /** The value to set (IP for A, hostname for CNAME) */
258
- value: string;
259
- }
260
- /**
261
- * DNS provider information for a domain
262
- */
263
- interface DnsProvider {
264
- /** Provider name (e.g., "Cloudflare", "GoDaddy"), null if unknown */
265
- name: string | null;
266
- }
267
- /**
268
- * Response for domain DNS provider lookup
269
- */
270
- /**
271
- * What a DNS lookup found for a domain. An envelope rather than a bare
272
- * {@link DnsProvider} because a lookup can succeed and learn more than the
273
- * provider later; the shape is named so a consumer can hold one.
274
- */
275
- interface DnsLookup {
276
- /** The provider serving this domain's DNS, absent when unidentified */
277
- provider?: DnsProvider;
278
- }
279
- /**
280
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
281
- * "A report answers a question").
282
- */
283
- interface DomainDnsResponse {
284
- /** The domain name */
285
- domain: string;
286
- /** DNS provider information, null if not yet looked up */
287
- dns: DnsLookup | null;
288
- }
289
- /**
290
- * Response for `GET /domains/:domain/share` — the domain plus the salted
291
- * hash that lets someone else complete its DNS setup without an account.
292
- *
293
- * `/admin/domains/:domain/share` answers the same shape, which is the admin
294
- * law working: the operator surface is the public grammar with a prefix.
295
- *
296
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
297
- * "A report answers a question").
298
- */
299
- interface DomainShareResponse {
300
- /** The domain the setup link is for */
301
- readonly domain: string;
302
- /** The salted setup hash that authorizes the share */
303
- readonly hash: string;
304
- }
305
- /**
306
- * Response for domain DNS records
307
- *
308
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
309
- * "A report answers a question").
310
- */
311
- interface DomainRecordsResponse {
312
- /** The domain name */
313
- domain: string;
314
- /** The apex (registered) domain where DNS records are managed */
315
- apex: string;
316
- /** Required DNS records for configuration */
317
- records: DnsRecord[];
318
- }
319
- /**
320
- * The envelope an `Idempotency-Key` must fit, and how long a replay lasts.
321
- *
322
- * Format lives here rather than on the server alone by the format-vs-policy
323
- * rule: a client can decide offline whether a key is well-formed, and the
324
- * API would reject the same value the same way.
325
- */
326
- declare const IDEMPOTENCY_KEY_CONSTRAINTS: {
327
- readonly MAX_LENGTH: 256;
328
- /** How long a stored 201 stays replayable. */
329
- readonly WINDOW_SECONDS: number;
330
- };
331
- /**
332
- * Validate an idempotency key, returning the trimmed value or `undefined`
333
- * when none was supplied. Throws {@link ShipError.validation} when the value
334
- * cannot be sent — the same verdict the API would reach, reached earlier.
335
- */
336
- declare function validateIdempotencyKey(value: unknown): string | undefined;
337
- /**
338
- * Response for `GET /labels` — every label in use across the caller's
339
- * deployments, domains and tokens, grouped and ordered by last use.
340
- *
341
- * The one plural noun outside the list contract, deliberately: labels have
342
- * no identity, no row and no `created`, so there is nothing for a keyset
343
- * cursor to resume after, and its consumer is an autocomplete that wants the
344
- * whole set. Bounded by `PAGINATION.GLOBAL_LIMIT` rather than paginated.
345
- *
346
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
347
- * "A report answers a question").
348
- */
349
- interface LabelsResponse {
350
- readonly labels: string[];
351
- }
352
- /**
353
- * Response for `POST /setup` — the DNS instructions for one domain, written
354
- * for a human to follow at their registrar.
355
- *
356
- * `custom` is the provider-specific walkthrough when the provider is known;
357
- * `generic` always answers, so a caller never has nothing to show.
358
- *
359
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
360
- * "A report answers a question").
361
- */
362
- interface SetupInstructionsResponse {
363
- /** The domain the instructions are for — a report names its subject */
364
- readonly domain: string;
365
- /** One-line summary of what to do */
366
- readonly tldr: string;
367
- /** Provider-specific instructions, null when the provider is unknown */
368
- readonly custom: string | null;
369
- /** Provider-agnostic instructions — always present */
370
- readonly generic: string;
371
- /** The identified DNS provider, null when unknown */
372
- readonly provider: string | null;
373
- }
374
- /**
375
- * `POST /domains/validate` — a report answering "is this name usable, and if
376
- * not, why".
377
- *
378
- * An unusable name is a legitimate ANSWER, not a failure, so this is a 200 and
379
- * the verdict rides the body. `reason` was named `error` until 2026-07-29,
380
- * which collided with {@link ErrorResponse}'s reserved key — there `error` is
381
- * an `ErrorType` a client branches on, here it is prose a client displays, and
382
- * one key cannot mean both. See {@link DeploymentDeleteResponse} for the law.
383
- */
384
- interface DomainValidateResponse {
385
- /** Whether the domain is valid */
386
- valid: boolean;
387
- /** Normalized domain name, null when invalid */
388
- normalized: string | null;
389
- /** Whether the domain is available, null when invalid */
390
- available: boolean | null;
391
- /** Why the name is unusable, null when valid — displayed verbatim. */
392
- reason: string | null;
393
- }
394
- /**
395
- * Core deploy token object - used in both API responses and SDK.
396
- *
397
- * The secret is never here: it is shown once at creation
398
- * ({@link TokenCreateResponse.secret}) and never again, so an entity read
399
- * carries only the management identifier and lifecycle metadata.
400
- */
401
- interface Token {
402
- /** 7-char management identifier (e.g., "a1b2c3d") */
403
- readonly token: string;
404
- /** Labels for categorization and filtering. Always present, empty array when none. */
405
- labels: string[];
406
- /** Unix timestamp (seconds) when token was created */
407
- readonly created: number;
408
- /** Unix timestamp (seconds) when token expires, null for never */
409
- readonly expires: number | null;
410
- /** Unix timestamp (seconds) of the last request authenticated with this token, null if never used */
411
- readonly used: number | null;
412
- }
413
- /**
414
- * Response for listing tokens
415
- */
416
- interface TokenListResponse extends ListResponse {
417
- /** Array of tokens (the secret is never among them) */
418
- tokens: Token[];
419
- }
420
- /**
421
- * Response from token creation. Extends Token with the one field that
422
- * exists only on creation — the same shape as
423
- * {@link DeploymentCreateResponse}, because a 201 returns the resource it
424
- * created plus whatever is knowable only once.
425
- */
426
- interface TokenCreateResponse extends Token {
427
- /** The raw credential value (shown once at creation, then never again) */
428
- readonly secret: string;
429
- }
430
- /**
431
- * Acknowledgement of `DELETE /tokens/:token`. The credential is revoked and
432
- * its row is gone, so the management identifier is the whole answer. See
433
- * {@link DeploymentDeleteResponse} for the law.
434
- */
435
- interface TokenDeleteResponse {
436
- /** The 7-char management identifier that was revoked */
437
- readonly token: string;
438
- }
439
- /**
440
- * Account plan constants
441
- */
442
- declare const AccountPlan: {
443
- readonly FREE: "free";
444
- readonly STANDARD: "standard";
445
- readonly SPONSORED: "sponsored";
446
- readonly ENTERPRISE: "enterprise";
447
- readonly SUSPENDED: "suspended";
448
- readonly TERMINATING: "terminating";
449
- readonly TERMINATED: "terminated";
450
- };
451
- type AccountPlanType = (typeof AccountPlan)[keyof typeof AccountPlan];
452
- /**
453
- * Account usage metrics — always available regardless of billing provider.
454
- *
455
- * This is where a caller's own totals live. Lists answer pages and carry no
456
- * `total` (see {@link ListOptions}); a count is an aggregate over a
457
- * collection, so it belongs to the summary resource that owns the
458
- * collection. `GET /account` is that resource for one caller, `GET
459
- * /admin/stats` for the platform.
460
- *
461
- * The counted dimensions are the ones the plan caps — deployments and
462
- * domains (`PlatformLimits`) — plus the billable custom-domain subset, so a
463
- * surface can render "3 of 10" without a second request.
464
- */
465
- interface AccountUsage {
466
- /** Number of active custom domains (excludes paused) */
467
- customDomains: number;
468
- /**
469
- * Deployments counted against the plan's deployment cap — every row
470
- * whatever its status, because that is what the cap counts, so a surface
471
- * renders "3 of 10" against the denominator the 403 divides by. (`GET
472
- * /deployments` lists successful ones only; that is a different question
473
- * asked of a different resource.) Optional by the additive-evolution law:
474
- * an API predating this field omits it.
475
- */
476
- deployments?: number;
477
- /**
478
- * Domains counted against the plan's domain cap — every domain, platform
479
- * and custom alike, unlike `customDomains`. Optional for the same reason.
480
- */
481
- domains?: number;
482
- }
483
- /**
484
- * Core account object - used in both API responses and SDK
485
- * All fields are readonly to prevent accidental mutations
486
- */
487
- interface Account {
488
- /** User email address */
489
- readonly email: string;
490
- /** User display name, null if not set */
491
- readonly name: string | null;
492
- /** User profile picture URL, null if not set */
493
- readonly picture: string | null;
494
- /** Account plan status */
495
- readonly plan: AccountPlanType;
496
- /** Account usage metrics (custom domains, etc.) */
497
- readonly usage: AccountUsage;
498
- /** Unix timestamp (seconds) when account was created */
499
- readonly created: number;
500
- /** Unix timestamp (seconds) when account was activated (first deployment), null if not yet activated */
501
- readonly activated: number | null;
502
- /** Last 4 characters of the API key for identification, null when no key generated */
503
- readonly hint: string | null;
504
- /**
505
- * Unix timestamp (seconds) of the API key's last use, null when never
506
- * used or no key generated. Optional on the type by the additive-evolution
507
- * law: published SDK versions may predate the field, so consumers read it
508
- * when present rather than forcing a lockstep SDK release.
509
- */
510
- readonly used?: number | null;
511
- /** Grace period expiration (unix seconds), null if no grace period active */
512
- readonly grace: number | null;
513
- }
514
- /**
515
- * Account as returned by `GET /account` — the entity plus how the request
516
- * was authorized, so `whoami` can answer "what credential am I holding?".
517
- * Request-scoped fields live on the response type, never on the entity
518
- * (the `DeploymentCreateResponse` pattern).
519
- */
520
- interface AccountGetResponse extends Account {
521
- /** How the request that produced this response was authorized. */
522
- readonly authMethod: AuthMethodType;
523
- /** Present (and true) only when the caller is an operator acting as themselves. */
524
- readonly isAdmin?: true;
525
- /** Present only during read-only admin impersonation: the operator's account id. */
526
- readonly impersonatedBy?: string;
527
- }
528
- /**
529
- * Acknowledgement of `DELETE /account` (202). Termination is asynchronous —
530
- * a cleanup consumer finishes the job — so the account survives long enough
531
- * to state the plan it is transitioning through. `plan` is the account's
532
- * state field, the way `status` is a deployment's. See
533
- * {@link DeploymentDeleteResponse} for the law.
534
- */
535
- interface AccountDeleteResponse {
536
- /** The account that was marked for termination */
537
- readonly account: string;
538
- /** The plan the account is in while cleanup runs */
539
- readonly plan: AccountPlanType;
540
- }
541
- /**
542
- * Response from `PUT /account/key` — the account's single API key, minted in
543
- * place of whatever was there before.
544
- *
545
- * There is no entity to return: only the key's last-4 `hint` is durable
546
- * (`Account.hint`), and the plaintext exists exactly once, in this response.
547
- * The raw credential is `secret` on every surface that mints one — the same
548
- * field `TokenCreateResponse` carries — because one concept gets one name.
549
- *
550
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
551
- * "A report answers a question").
552
- */
553
- interface AccountKeyResponse {
554
- /** The raw API key (shown once at mint, then never again) */
555
- readonly secret: string;
556
- }
557
- /**
558
- * Account-specific configuration overrides
559
- * Allows per-account customization of limits without changing plan
560
- */
561
- interface AccountOverrides {
562
- /** Override for maximum number of domains */
563
- domains?: number;
564
- /** Override for maximum number of deployments */
565
- deployments?: number;
566
- /** Override for maximum individual file size in bytes */
567
- fileSize?: number;
568
- /** Override for maximum number of files per deployment */
569
- filesCount?: number;
570
- /** Override for maximum total deployment size in bytes */
571
- totalSize?: number;
572
- }
573
- /**
574
- * All possible error types in the ShipStatic platform.
575
- *
576
- * Developer-friendly key names map to stable wire-format string values.
577
- * Both the value and the type are exported under the same name so callers
578
- * can use `ErrorType.Validation` (value comparison) and `: ErrorType` (type
579
- * annotation) without ceremony — matching the pattern other status objects
580
- * (`DeploymentStatus`, `DomainStatus`, `AccountPlan`, `AuthMethod`) follow.
581
- */
582
- declare const ErrorType: {
583
- /**
584
- * Validation failed. Input shape is wrong.
585
- *
586
- * Carries 400 when an API judged it — including a client-side pre-check of a
587
- * rule the server enforces too, which keeps the error identical wherever it
588
- * was caught. **Statusless** when a client rejects something no API judges,
589
- * such as a CLI's own command grammar: `status` is documented "(API
590
- * contexts)" on `ErrorResponse`, so there is none to report.
591
- */
592
- readonly Validation: "validation_failed";
593
- /** Resource not found (404). */
594
- readonly NotFound: "not_found";
595
- /** Authenticated but not allowed (403). User lacks permission for this action. */
596
- readonly Forbidden: "forbidden";
597
- /** Rate limit exceeded (429). */
598
- readonly RateLimit: "rate_limit_exceeded";
599
- /** Authentication required or failed (401). Missing/invalid credentials. */
600
- readonly Authentication: "authentication_failed";
601
- /** Business rule violation. Catch-all for 4xx state-rule errors that aren't more specific. */
602
- readonly Business: "business_logic_error";
603
- /** API server error (500). Generic server-side fault. */
604
- readonly Api: "internal_server_error";
605
- /** Network/connection error. Client-side only — set by HTTP clients on fetch failure; never produced server-side. */
606
- readonly Network: "network_error";
607
- /** Operation was cancelled. Client-side only — set on `AbortSignal` abort; never produced server-side. */
608
- readonly Cancelled: "operation_cancelled";
609
- /** File operation error. Client-side only — set by SDK during local file processing; never produced server-side. */
610
- readonly File: "file_error";
611
- /** Configuration error. Client-side only — set by SDK during config parsing/validation; never produced server-side. */
612
- readonly Config: "config_error";
613
- };
614
- type ErrorType = (typeof ErrorType)[keyof typeof ErrorType];
615
- /**
616
- * Standard error response format used everywhere
617
- */
618
- interface ErrorResponse {
619
- /** Error type identifier */
620
- error: ErrorType;
621
- /** Human-readable error message */
622
- message: string;
623
- /** HTTP status code (API contexts) */
624
- status?: number;
625
- /** Optional additional error details. Untyped by design — narrow at the read site. */
626
- details?: unknown;
627
- }
628
- /**
629
- * Simple unified error class for both API and SDK
630
- */
631
- declare class ShipError extends Error {
632
- readonly type: ErrorType;
633
- readonly status?: number | undefined;
634
- readonly details?: unknown | undefined;
635
- constructor(type: ErrorType, message: string, status?: number | undefined, details?: unknown | undefined);
636
- /** Convert to wire format */
637
- toResponse(): ErrorResponse;
638
- /**
639
- * Construct a `ShipError` from an HTTP error response.
640
- *
641
- * Best-effort body parse for `{ message, error?, details? }`. Message
642
- * resolution: `body.message` → `body.error` → `"<operationName> failed with
643
- * status <N>"`.
644
- *
645
- * Type resolution: trusts `body.error` when it's a known server-producible
646
- * `ErrorType` (preserves the wire's intent — server's
647
- * `ShipError.validation(...)` round-trips back to `ErrorType.Validation`
648
- * on the client). Falls back to status-derived (401 → Authentication,
649
- * 403 → Forbidden, 429 → RateLimit, else → Api) for non-API responses
650
- * (CDN errors, intermediaries) or malformed bodies. Client-only types
651
- * (`Network`, `Cancelled`, `File`, `Config`) are filtered out of the
652
- * trusted set — a misbehaving server claiming one of those is ignored.
653
- *
654
- * `operationName` (e.g. `"Get account"`) is used to compose the fallback
655
- * message. Defaults to `"Request"`. Same convention as `fromFetchError`.
656
- *
657
- * Async because it reads the response body. Returns rather than throws so
658
- * callers can compose; most will `throw await ShipError.fromHttpResponse(...)`.
659
- */
660
- static fromHttpResponse(response: Response, operationName?: string): Promise<ShipError>;
661
- /**
662
- * Construct a `ShipError` from an error caught around a `fetch()` call.
663
- *
664
- * The mirror of `fromHttpResponse` for the *other* side of the HTTP error
665
- * story — the network layer failing (offline, CORS, abort) rather than the
666
- * server returning a non-OK response.
667
- *
668
- * Routing:
669
- * - Already a `ShipError` → returned as-is (caller's intent preserved)
670
- * - `AbortError` → `ShipError.cancelled(...)`
671
- * - `TypeError` whose message mentions "fetch" → `ShipError.network(...)`
672
- * - Any other `Error` → `ShipError(Api, ...)` (no HTTP status — fetch never reached the server)
673
- * - Anything else (string, undefined, etc.) → `ShipError(Api, ...)`
674
- *
675
- * The optional `operationName` is composed into the message for context:
676
- * `"Get account was cancelled"`, `"Get account failed: ..."`. Defaults to
677
- * `"Request"` when omitted.
678
- */
679
- static fromFetchError(cause: unknown, operationName?: string): ShipError;
680
- static validation(message: string, details?: unknown): ShipError;
681
- static notFound(resource: string, id?: string): ShipError;
682
- static forbidden(message: string, details?: unknown): ShipError;
683
- static rateLimit(message?: string, details?: unknown): ShipError;
684
- /**
685
- * Construct an Authentication (401) error.
686
- *
687
- * **Telemetry pattern — `details: { internal: '<tag>' }`.** When the
688
- * server creates an auth error with an `internal` key in `details`
689
- * (e.g. `{ internal: 'session_invalid' }`), `toResponse()` strips the
690
- * entire `details` object before serialization. This keeps the wire
691
- * response a clean "Authentication failed" while preserving granular
692
- * server-side telemetry (which strategy/check failed) for logs and tests.
693
- *
694
- * Use this pattern in API auth code; do not put client-visible info under
695
- * `internal`. Other `details` keys round-trip normally.
696
- */
697
- static authentication(message?: string, details?: unknown): ShipError;
698
- static business(message: string, status?: number, details?: unknown): ShipError;
699
- static network(message: string, details?: unknown): ShipError;
700
- static cancelled(message: string, details?: unknown): ShipError;
701
- static file(message: string, details?: unknown): ShipError;
702
- static config(message: string, details?: unknown): ShipError;
703
- static api(message: string, status?: number, details?: unknown): ShipError;
704
- /**
705
- * The caller is at fault — by HTTP's own definition of a 4xx, or by a type
706
- * that is client-attributable without ever having a status (`Config`,
707
- * `File`, raised locally by the SDK).
708
- *
709
- * Both arms are load-bearing, because type and status are independent
710
- * axes. `fromHttpResponse` trusts `body.error` only when it names a
711
- * server-producible type; a non-OK response without one is status-derived,
712
- * so a CDN 404 or any intermediary error arrives as `Api` — a server-fault
713
- * *type* carrying a client *status*. Judging by type alone would report it
714
- * as a platform failure and bury the server's own message.
715
- */
716
- isClientError(): boolean;
717
- isNetworkError(): boolean;
718
- isAuthError(): boolean;
719
- isType(errorType: ErrorType): boolean;
720
- }
721
- /**
722
- * Type guard to check if an unknown value is a ShipError.
723
- *
724
- * Uses structural checking instead of instanceof to handle module duplication
725
- * in bundled applications where multiple copies of the ShipError class may exist.
726
- *
727
- * @example
728
- * if (isShipError(error)) {
729
- * console.log(error.status, error.message);
730
- * }
731
- */
732
- declare function isShipError(error: unknown): error is ShipError;
733
- /**
734
- * Plan-based platform limits returned by the `/limits` endpoint.
735
- *
736
- * The SDK fetches these once on first API call to drive client-side
737
- * file-size / file-count / total-size validation that mirrors what the API
738
- * would enforce server-side. Limits vary by account plan.
739
- *
740
- * These are the *platform's* posted caps for the current account — server
741
- * truth delivered at runtime, never hard-coded on the client.
742
- *
743
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
744
- * "A report answers a question").
745
- */
746
- interface PlatformLimits {
747
- /** Maximum size in bytes for a single file. */
748
- maxFileSize: number;
749
- /** Maximum number of files in a single deployment. */
750
- maxFilesCount: number;
751
- /** Maximum total size in bytes across all files in a deployment. */
752
- maxTotalSize: number;
753
- }
754
- /**
755
- * Blocked file extensions — files that cannot be uploaded.
756
- *
757
- * We accept any file type by default and derive Content-Type from the
758
- * extension at serve time (via mime-db in the API worker). Unknown extensions
759
- * are served as `application/octet-stream` with `X-Content-Type-Options: nosniff`.
760
- *
761
- * The blocklist targets file types that pose direct security risks when hosted:
762
- * executables, disk images, malware vectors, dangerous scripts, and shortcuts.
763
- */
764
- declare const BLOCKED_EXTENSIONS: ReadonlySet<string>;
765
- /**
766
- * Check if a filename has a blocked extension.
767
- * Extracts the extension from the filename and checks against the blocklist.
768
- * Case-insensitive. Returns false for files without extensions.
769
- *
770
- * @example
771
- * isBlockedExtension('virus.exe') // true
772
- * isBlockedExtension('app.dmg') // true
773
- * isBlockedExtension('style.css') // false
774
- * isBlockedExtension('data.custom') // false
775
- * isBlockedExtension('README') // false
776
- */
777
- declare function isBlockedExtension(filename: string): boolean;
778
- /**
779
- * Characters that are unsafe in filenames for static hosting.
780
- *
781
- * Blocks only characters that genuinely break the upload→serve round-trip:
782
- * - # ? % URL round-trip breakers (fragment, query, encoding ambiguity)
783
- * - \ Path separator confusion (upload splits on backslash)
784
- * - < > " XSS vectors with zero legitimate use in filenames
785
- * - \x00-\x1f \x7f Control characters (header injection, display corruption)
786
- *
787
- * Everything else is allowed — browser percent-encodes, Worker decodes, R2 matches.
788
- */
789
- declare const UNSAFE_FILENAME_CHARS: RegExp;
790
- /**
791
- * Check if a filename contains unsafe characters.
792
- *
793
- * @example
794
- * hasUnsafeChars('saved_resource(1).html') // false — parentheses are safe
795
- * hasUnsafeChars('page[slug].js') // false — brackets are safe
796
- * hasUnsafeChars('file#anchor.html') // true — # breaks URL resolution
797
- * hasUnsafeChars('file<tag>.html') // true — < is an XSS vector
798
- */
799
- declare function hasUnsafeChars(filename: string): boolean;
800
- /**
801
- * Path segment names that indicate an unbuilt project was uploaded instead of build output.
802
- * Used for early detection in CLI, browser, and server validation.
803
- */
804
- declare const UNBUILT_PROJECT_MARKERS: ReadonlySet<string>;
805
- /**
806
- * Check if a file path contains an unbuilt project marker.
807
- *
808
- * @example
809
- * hasUnbuiltMarker('node_modules/react/index.js') // true
810
- * hasUnbuiltMarker('package.json') // true
811
- * hasUnbuiltMarker('dist/index.html') // false
812
- */
813
- declare function hasUnbuiltMarker(filePath: string): boolean;
814
- /**
815
- * `GET /ping` — a report of the server clock.
816
- *
817
- * Liveness is the STATUS CODE's answer, not a field's: a 200 means reachable,
818
- * and any other outcome throws before a body is read. So the body carries the
819
- * one thing a status code cannot — the server's own clock, which is what lets a
820
- * client detect skew against a token expiry. It read `{ success: true,
821
- * timestamp? }` until 2026-07-29, where `success` was a literal constant in the
822
- * route (zero bits, and the platform's own named anti-pattern) while the field
823
- * that IS the payload was optional. See {@link DeploymentDeleteResponse} for
824
- * the law, and `tests/response-shapes.test.ts` for the fence that holds it.
825
- */
826
- interface PingResponse {
827
- /** Server time in unix seconds — the one wire unit for timestamps. */
828
- readonly timestamp: number;
829
- }
830
- /**
831
- * Where human identity is mounted on the API host. The API mounts Better
832
- * Auth at this path (sign-in, sign-out, session reads, admin impersonation)
833
- * and the web console's auth client posts to it — shared here so the two
834
- * halves of the auth pair agree by construction, the same way both sides
835
- * already share the credential prefixes below.
836
- */
837
- declare const AUTH_BASE_PATH = "/auth";
838
- /**
839
- * How a request (or recorded activity) was authorized.
840
- *
841
- * Client populations: `SESSION` (first-party cookie), `API_KEY` (`ship-`
842
- * key), `TOKEN` (`deploy-` deploy token), `AGENT` (anonymous public deploy —
843
- * no credential; the platform grants the public-account identity per
844
- * request), `OAUTH` (delegated access token). Server populations: `WEBHOOK`
845
- * (signed webhook processing), `SYSTEM` (scheduled/background jobs).
846
- */
847
- declare const AuthMethod: {
848
- readonly SESSION: "session";
849
- readonly API_KEY: "apiKey";
850
- readonly TOKEN: "token";
851
- readonly AGENT: "agent";
852
- readonly OAUTH: "oauth";
853
- readonly WEBHOOK: "webhook";
854
- readonly SYSTEM: "system";
855
- };
856
- type AuthMethodType = (typeof AuthMethod)[keyof typeof AuthMethod];
857
- /**
858
- * Shape constants for API keys (`ship-{64 hex chars}`).
859
- * Single source of truth used by validation utilities and auth middleware.
860
- */
861
- declare const API_KEY: {
862
- /** Prefix that identifies an API key. */
863
- readonly PREFIX: "ship-";
864
- /** Number of hex characters following the prefix. */
865
- readonly HEX_LENGTH: 64;
866
- /** Total length of an API key including prefix (`PREFIX.length + HEX_LENGTH = 69`). */
867
- readonly TOTAL_LENGTH: 69;
868
- /** Number of trailing characters used to display a redacted hint (e.g. last 4). */
869
- readonly HINT_LENGTH: 4;
870
- };
871
- /**
872
- * Shape constants for deploy tokens (`deploy-{64 hex chars}`).
873
- * Single source of truth used by validation utilities and auth middleware.
874
- */
875
- declare const DEPLOY_TOKEN: {
876
- /** Prefix that identifies a deploy token. */
877
- readonly PREFIX: "deploy-";
878
- /** Number of hex characters following the prefix. */
879
- readonly HEX_LENGTH: 64;
880
- /** Total length of a deploy token including prefix (`PREFIX.length + HEX_LENGTH = 71`). */
881
- readonly TOTAL_LENGTH: 71;
882
- };
883
- /**
884
- * Shape constants for caller identifiers (the `X-Caller` instance-identity
885
- * header — rate-limit bucketing for multi-tenant orchestrators). The API
886
- * normalizes case and silently ignores malformed values (the header is
887
- * unauthenticated); clients validate at the boundary via `validateCaller`,
888
- * so a value the server would drop fails fast instead.
889
- */
890
- declare const CALLER: {
891
- /** HTTP header name. */
892
- readonly HEADER: "X-Caller";
893
- /** Maximum identifier length. */
894
- readonly MAX_LENGTH: 128;
895
- /** Allowed characters: alphanumeric, dot, underscore, hyphen. */
896
- readonly PATTERN: RegExp;
897
- };
898
- /**
899
- * Token populations distinguishable by shape. The platform carries every
900
- * client token in one wire slot (`Authorization: Bearer <value>`) and
901
- * classifies by value, never by a side channel — this is the classifier.
902
- *
903
- * `API_KEY` and `DEPLOY_TOKEN` *are* `AuthMethod.API_KEY` and
904
- * `AuthMethod.TOKEN` — the equality is structural, so a classification flows
905
- * straight into an auth method and the pair can never drift. `OPAQUE` is any
906
- * other value — shape says nothing about it, so only a lookup can. Today the
907
- * server refuses every opaque bearer; the OAuth access-token population
908
- * resolves there when the authorization server ships.
909
- */
910
- declare const TokenKind: {
911
- readonly API_KEY: "apiKey";
912
- readonly DEPLOY_TOKEN: "token";
913
- readonly OPAQUE: "opaque";
914
- };
915
- type TokenKindType = (typeof TokenKind)[keyof typeof TokenKind];
916
- /**
917
- * Classify a client token by shape. The single dispatch used by both sides
918
- * of the wire: API auth middleware (which population is this credential?)
919
- * and SDK validation (which format rules apply before sending?). Sharing it
920
- * is what guarantees client and server can never disagree on dispatch.
921
- */
922
- declare function classifyToken(token: string): TokenKindType;
923
- /**
924
- * OAuth scope vocabulary for delegated third-party access tokens.
925
- * Single source of truth used by the authorization server (advertised in
926
- * `scopes_supported`), the API's scope-enforcement middleware, and consent UI
927
- * copy. The standard `offline_access` scope (refresh tokens) is not platform
928
- * vocabulary and is deliberately absent — the middleware never checks it.
929
- *
930
- * Deliberately absent by design: any `tokens:*` scope, `account:write`, or
931
- * admin scope — a delegated app must never mint credentials, delete the
932
- * account, or act as admin.
933
- */
934
- declare const OAuthScope: {
935
- readonly ACCOUNT_READ: "account:read";
936
- readonly DEPLOYMENTS_READ: "deployments:read";
937
- readonly DEPLOYMENTS_WRITE: "deployments:write";
938
- readonly DOMAINS_READ: "domains:read";
939
- readonly DOMAINS_WRITE: "domains:write";
940
- };
941
- type OAuthScopeType = (typeof OAuthScope)[keyof typeof OAuthScope];
942
- declare const DEPLOYMENT_CONFIG_FILENAME = "ship.json";
943
- /** Default ship.json config for SPA routing. Single source of truth — used by both API and SDK. */
944
- declare const SPA_DEFAULT_CONFIG: {
945
- readonly rewrites: readonly [{
946
- readonly source: "/(.*)";
947
- readonly destination: "/index.html";
948
- }];
949
- };
950
- /**
951
- * Assert that a ship.json file is *syntactically* loadable. Syntax only —
952
- * never schema.
953
- *
954
- * ship.json is validated and compiled on the server, deliberately: the schema
955
- * and the compiler evolve, and a client that judged them would reject configs
956
- * a newer platform accepts. That reasoning bounds what a client may check to
957
- * the properties which are true of *every* past and future schema:
958
- *
959
- * 1. it parses as JSON — JSON syntax is frozen (RFC 8259), so text that
960
- * does not parse can never be a valid config;
961
- * 2. its top level is an object — ship.json is `{ ... }` in every version.
962
- *
963
- * Both are monotonic: neither can ever reject something the server would
964
- * accept. Everything beyond them (field names, types, rule semantics, which
965
- * keys are permitted) stays server-side, where it can change.
966
- *
967
- * The payoff is the common case. Hand-edited JSON fails on a trailing comma,
968
- * a `//` comment, single quotes, unquoted keys, or smart quotes pasted from
969
- * documentation — mistakes that otherwise cost a full upload round-trip to
970
- * discover. A UTF-8 BOM (Windows editors, PowerShell redirects) is stripped
971
- * before parsing rather than rejected, because the server accepts it too;
972
- * diverging there would reintroduce exactly the false rejection this
973
- * function exists to avoid.
974
- *
975
- * @throws {ShipError} `ErrorType.Config` — the same type the server's own
976
- * config rejection carries, so the error contract is identical wherever the
977
- * failure is detected.
978
- */
979
- declare function assertShipJsonSyntax(text: string): void;
980
- /**
981
- * Validate API key format
982
- */
983
- declare function validateApiKey(apiKey: string): void;
984
- /**
985
- * Validate deploy token format
986
- */
987
- declare function validateDeployToken(deployToken: string): void;
988
- /**
989
- * Validate a client token of any population. Classifies by shape and applies
990
- * the matching format rules: `ship-` keys and `deploy-` deploy tokens are
991
- * validated strictly; opaque tokens (OAuth access tokens, future populations)
992
- * only need to be non-empty — their validity is the server's to decide.
993
- */
994
- declare function validateToken(token: string): void;
995
- /**
996
- * Validate a caller identifier against the `CALLER` shape. The server
997
- * silently ignores malformed values (the header is unauthenticated); clients
998
- * call this at configuration time so the drop never silently happens.
999
- */
1000
- declare function validateCaller(caller: string): void;
1001
- /**
1002
- * Validate API URL format
1003
- */
1004
- declare function validateApiUrl(apiUrl: string): void;
1005
- /**
1006
- * Check if a string matches the deployment identifier pattern (word-word-alphanumeric7).
1007
- * Example: "happy-cat-abc1234.shipstatic.com"
1008
- */
1009
- declare function isDeployment(input: string): boolean;
1010
- /**
1011
- * Request payload for SPA check endpoint
1012
- */
1013
- interface SPACheckRequest {
1014
- /** Array of file paths */
1015
- files: string[];
1016
- /** HTML content of index.html file */
1017
- index: string;
1018
- }
1019
- /**
1020
- * Response from SPA check endpoint
1021
- */
1022
- /**
1023
- * Which of the classifier's tiers reached the verdict, and why. Named rather
1024
- * than inline so the API's own `checkSPA` can return `SPACheckResponse`
1025
- * instead of restating its shape.
1026
- */
1027
- interface SPACheckDebug {
1028
- /** Which tier made the detection */
1029
- tier: 'exclusions' | 'inclusions' | 'scoring' | 'ai' | 'fallback';
1030
- /** The reason for the detection result */
1031
- reason: string;
1032
- }
1033
- /**
1034
- * A report: it answers a question and carries only the answer (`CLAUDE.md`,
1035
- * "A report answers a question").
1036
- */
1037
- interface SPACheckResponse {
1038
- /** Whether the project is detected as a Single Page Application */
1039
- isSPA: boolean;
1040
- /** Debugging information about detection */
1041
- debug: SPACheckDebug;
1042
- }
1043
- /**
1044
- * Represents a file that has been processed and is ready for deploy.
1045
- * Used across the platform (API, SDK, CLI) for file operations.
1046
- */
1047
- interface StaticFile {
1048
- /**
1049
- * The content of the file.
1050
- * In Node.js, this is typically a `Buffer`.
1051
- * In the browser, this is typically a `File` or `Blob` object.
1052
- */
1053
- content: File | Buffer | Blob;
1054
- /**
1055
- * The desired path for the file on the server, relative to the deployment root.
1056
- * Should include the filename, e.g., `images/photo.jpg`.
1057
- */
1058
- path: string;
1059
- /**
1060
- * The original absolute file system path (primarily used in Node.js environments).
1061
- * This helps in debugging or associating the server path back to its source.
1062
- */
1063
- filePath?: string;
1064
- /**
1065
- * The MD5 hash (checksum) of the file's content.
1066
- * This is calculated by the SDK before deploy if not provided.
1067
- */
1068
- md5?: string;
1069
- /** The size of the file in bytes. */
1070
- size: number;
1071
- }
1072
- /** Default API URL if not otherwise configured. */
1073
- declare const DEFAULT_API = "https://api.shipstatic.com";
1074
- /**
1075
- * Universal deploy input — the union of every shape the SDK accepts.
1076
- *
1077
- * - **Browser**: `File[]` (typically from `<input type="file">` or drag-and-drop)
1078
- * - **Node**: `string | string[]` (file or directory path(s) on disk; directories are walked)
1079
- *
1080
- * Each platform's SDK narrows its `deploy()` signature to the relevant shape
1081
- * and rejects anything else at runtime. Use the structural types directly
1082
- * (`File[]`, `string | string[]`) when writing platform-specific code.
1083
- */
1084
- type DeployInput = File[] | string | string[];
1085
- /**
1086
- * Options for deployment creation at the API contract level.
1087
- * SDK implementations may extend with additional options (timeout, signal, callbacks, etc.).
1088
- */
1089
- interface DeploymentUploadOptions {
1090
- /** Optional labels for categorization and filtering */
1091
- labels?: string[];
1092
- /** Client identifier (e.g., 'cli', 'sdk', 'web') */
1093
- via?: string;
1094
- /**
1095
- * Optional password that protects this deployment.
1096
- *
1097
- * Length: {@link PASSWORD_CONSTRAINTS.MIN_LENGTH} to
1098
- * {@link PASSWORD_CONSTRAINTS.MAX_LENGTH} characters. Leading and trailing
1099
- * whitespace is trimmed before validation; internal whitespace is
1100
- * significant. Visitors are prompted to enter the password before they can
1101
- * view the deployment — including on any custom domains pointing at it.
1102
- * To remove protection, redeploy without a password.
1103
- */
1104
- password?: string;
1105
- /** @internal Trigger server-side build. Only available via /upload endpoint. */
1106
- build?: boolean;
1107
- /** @internal Trigger server-side prerender. Only available via /upload endpoint. */
1108
- prerender?: boolean;
1109
- /** @internal Trigger server-side SPA detection. Only available via /upload endpoint. */
1110
- spa?: boolean;
1111
- /** @internal reCAPTCHA proof for the anonymous human deploy channel. Only available via /upload endpoint. */
1112
- captcha?: string;
1113
- /**
1114
- * Makes this deploy replayable instead of repeatable.
1115
- *
1116
- * A deploy is not naturally idempotent: a client-side timeout on a slow
1117
- * one leaves the caller unable to tell "it never landed" from "it landed
1118
- * and the response was lost", and retrying produces a second deployment.
1119
- * Send the same key on the retry and the platform replays the original
1120
- * 201 verbatim rather than creating anything
1121
- * ({@link IDEMPOTENCY_KEY_CONSTRAINTS.WINDOW_SECONDS}).
1122
- *
1123
- * **Agents are the audience.** A human notices a duplicate; an automated
1124
- * retry does not. Pick a key that identifies the ATTEMPT — a run id, a
1125
- * commit sha, a uuid minted before the first try — never one that varies
1126
- * per attempt, which would defeat the point.
1127
- *
1128
- * The replay is per-caller, and it stores successes only: a failed deploy
1129
- * retries fresh under the same key.
1130
- */
1131
- idempotencyKey?: string;
1132
- }
1133
- /**
1134
- * Pagination options for every list endpoint. The response's `cursor` feeds
1135
- * the next request; a `null` cursor means the last page. Omitting both
1136
- * returns the server's default first page.
1137
- *
1138
- * A list answers `{ <collection>, cursor }` and nothing else — `cursor`
1139
- * carries the entire has-more signal, so no redundant boolean, and no
1140
- * `total`. **A count is an aggregate over a collection, not a property of a
1141
- * page:** including one makes every read pay for a full scan it did not ask
1142
- * for, which is precisely the cost keyset pagination exists to avoid.
1143
- *
1144
- * Counts therefore live on the summary resource that owns them —
1145
- * `GET /account` (`usage`) for a caller's own totals, `GET /admin/stats` for
1146
- * platform-wide ones. Ask for a count when you want a count; ask for a page
1147
- * when you want a page.
1148
- */
1149
- interface ListOptions {
1150
- /** Maximum number of items to return in one page. */
1151
- limit?: number;
1152
- /** Opaque cursor from the previous page's response. */
1153
- cursor?: string;
1154
- }
1155
- /**
1156
- * What a caller may change on an existing deployment.
1157
- *
1158
- * Labels and nothing else: a deployment's content is immutable by design, so
1159
- * this is the whole mutable surface rather than a subset someone chose.
1160
- */
1161
- interface DeploymentSetOptions {
1162
- labels: string[];
1163
- }
1164
- /**
1165
- * What `domains.set()` may create or change. Every field is optional because
1166
- * the call is a natural-key upsert: omitting `deployment` reserves the
1167
- * domain, naming one links or re-points it, and labels travel either way.
1168
- *
1169
- * `deployment` is deliberately not nullable — unlinking is refused (400).
1170
- * See `npm/ship/CLAUDE.md`, "Domain Write Semantics".
1171
- */
1172
- interface DomainSetOptions {
1173
- deployment?: string;
1174
- labels?: string[];
1175
- }
1176
- /** What a caller may set when minting a deploy token. */
1177
- interface TokenCreateOptions {
1178
- /** Seconds until expiry; omit for a token that never expires. */
1179
- ttl?: number;
1180
- labels?: string[];
1181
- }
1182
- /**
1183
- * Deployment resource interface - the contract all implementations must follow.
1184
- *
1185
- * The interface defines the minimal wire contract; SDK implementations may
1186
- * extend the upload options with runtime concerns (timeout, signal, progress
1187
- * callbacks) by parameterizing: `DeploymentResource<MyUploadOptions>`. The
1188
- * default keeps plain `DeploymentResource` valid for wire-only consumers.
1189
- */
1190
- interface DeploymentResource<UploadOptions extends DeploymentUploadOptions = DeploymentUploadOptions> {
1191
- upload: (input: DeployInput, options?: UploadOptions) => Promise<DeploymentCreateResponse>;
1192
- list: (options?: ListOptions) => Promise<DeploymentListResponse>;
1193
- get: (id: string) => Promise<Deployment>;
1194
- set: (id: string, options: DeploymentSetOptions) => Promise<Deployment>;
1195
- delete: (id: string) => Promise<DeploymentDeleteResponse>;
1196
- }
1197
- /**
1198
- * Domain resource interface - the contract all implementations must follow
1199
- */
1200
- interface DomainResource {
1201
- set: (name: string, options?: DomainSetOptions) => Promise<DomainSetResult>;
1202
- list: (options?: ListOptions) => Promise<DomainListResponse>;
1203
- get: (name: string) => Promise<Domain>;
1204
- delete: (name: string) => Promise<DomainDeleteResponse>;
1205
- verify: (name: string) => Promise<DomainVerifyResponse>;
1206
- validate: (name: string) => Promise<DomainValidateResponse>;
1207
- dns: (name: string) => Promise<DomainDnsResponse>;
1208
- records: (name: string) => Promise<DomainRecordsResponse>;
1209
- share: (name: string) => Promise<DomainShareResponse>;
1210
- }
1211
- /**
1212
- * Account resource interface - the contract all implementations must follow
1213
- */
1214
- interface AccountResource {
1215
- get: () => Promise<AccountGetResponse>;
1216
- }
1217
- /**
1218
- * Token resource interface - the contract all implementations must follow
1219
- */
1220
- interface TokenResource {
1221
- create: (options?: TokenCreateOptions) => Promise<TokenCreateResponse>;
1222
- list: (options?: ListOptions) => Promise<TokenListResponse>;
1223
- get: (token: string) => Promise<Token>;
1224
- delete: (token: string) => Promise<TokenDeleteResponse>;
1225
- }
1226
- /**
1227
- * Billing status response from GET /billing/status
1228
- *
1229
- * Note: The user's `plan` comes from Account, not here.
1230
- * This endpoint only returns billing-specific data (usage, portal, etc.)
1231
- *
1232
- * If `billing` is null, the user has no active billing.
1233
- */
1234
- interface BillingStatus {
1235
- /** Creem billing ID, or null if no active billing */
1236
- billing: string | null;
1237
- /** Number of billing units (1 unit = 1 custom domain), null if no billing */
1238
- units: number | null;
1239
- /** Billing status from Creem (active, trialing, canceled, etc.), null if no billing */
1240
- status: string | null;
1241
- /** Link to Creem customer portal for billing management, null if unavailable */
1242
- portal: string | null;
1243
- }
1244
- /**
1245
- * Acknowledgement of `POST /billing/cancel`.
1246
- *
1247
- * Cancelling leaves no billing entity to return, so it answers with the
1248
- * account and the one field of the account the call changed — the plan it
1249
- * landed on. See {@link DeploymentDeleteResponse} for the law.
1250
- *
1251
- * This read `{ success: true, message: 'Subscription canceled successfully…' }`
1252
- * until 2026-07-29, an anonymous shape that `web/my` redeclared inline and
1253
- * whose prose no surface ever displayed: both callers await the promise and
1254
- * discard the body, then compose their own toast. The message was written,
1255
- * serialized, and thrown away on every cancellation.
1256
- */
1257
- interface BillingCancelResponse {
1258
- /** The account whose subscription was cancelled */
1259
- readonly account: string;
1260
- /** The plan the account now holds — `free` on a successful cancellation */
1261
- readonly plan: AccountPlanType;
1262
- }
1263
- /**
1264
- * Checkout session response from POST /billing/checkout
1265
- */
1266
- interface CheckoutSession {
1267
- /** URL to redirect user to Creem checkout page */
1268
- url: string;
1269
- }
1270
- /**
1271
- * All activity event types logged in the system.
1272
- * Uses dot notation consistently: {resource}.{action}
1273
- */
1274
- type ActivityEvent = 'account.create' | 'account.update' | 'account.delete' | 'account.key.generate' | 'account.plan.paid' | 'account.plan.transition' | 'account.suspended' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'deployment.flagged' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume' | 'token.delete' | 'admin.account.plan.update' | 'admin.account.ref.update' | 'admin.account.billing.update' | 'admin.account.labels.update' | 'admin.deployment.delete' | 'admin.domain.delete' | 'admin.billing.sync' | 'admin.billing.terminated' | 'admin.impersonate' | 'billing.active' | 'billing.canceled' | 'billing.paused' | 'billing.expired' | 'billing.paid' | 'billing.trialing' | 'billing.scheduled_cancel' | 'billing.unpaid' | 'billing.update' | 'billing.past_due' | 'refund.created' | 'dispute.created' | 'billing.sync' | 'billing.stale' | 'billing.race';
1275
- /**
1276
- * Activity events visible to users in the dashboard
1277
- */
1278
- type UserVisibleActivityEvent = 'account.create' | 'account.update' | 'account.delete' | 'account.key.generate' | 'account.plan.transition' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume' | 'token.delete';
1279
- /**
1280
- * Activity record returned from the API
1281
- */
1282
- interface Activity {
1283
- /** The event type */
1284
- event: ActivityEvent;
1285
- /** Unix timestamp (seconds) when the activity occurred */
1286
- created: number;
1287
- /** Associated deployment ID (if applicable) */
1288
- deployment?: string;
1289
- /** Associated domain name (if applicable) */
1290
- domain?: string;
1291
- /** JSON-encoded metadata (parse with JSON.parse) */
1292
- meta?: string;
1293
- }
1294
- /**
1295
- * Parsed activity metadata.
1296
- * Different events populate different fields.
1297
- *
1298
- * Naming convention: meta booleans are event-scoped predicates and carry
1299
- * their prefix (`isUpdate`, `wasVerified`, `hasConfig`, `hasPassword`),
1300
- * while entity booleans are bare nouns (`Deployment.config`,
1301
- * `Deployment.password`). Two vocabularies, each internally consistent —
1302
- * deliberate, not drift.
1303
- */
1304
- interface ActivityMeta {
1305
- /** Number of files in deployment */
1306
- files?: number;
1307
- /** Total size in bytes */
1308
- size?: number;
1309
- /** Whether deployment has a ship.json config */
1310
- hasConfig?: boolean;
1311
- /** Whether deployment has a password set */
1312
- hasPassword?: boolean;
1313
- /** Whether this was an update (vs create) */
1314
- isUpdate?: boolean;
1315
- /** Whether domain was already verified */
1316
- wasVerified?: boolean;
1317
- /** Previous deployment ID before relinking */
1318
- previousDeployment?: string;
1319
- /** Labels that were set/updated */
1320
- labels?: string[];
1321
- /** OAuth provider name */
1322
- provider?: string;
1323
- /** Account email */
1324
- email?: string;
1325
- /** Account display name */
1326
- name?: string;
1327
- /** Previous plan */
1328
- from?: string;
1329
- /** New plan */
1330
- to?: string;
1331
- /** Allow additional fields for future use */
1332
- [key: string]: unknown;
1333
- }
1334
- /**
1335
- * Response from GET /activities endpoint
1336
- */
1337
- interface ActivityListResponse extends ListResponse {
1338
- /** Array of activities */
1339
- activities: Activity[];
1340
- }
1341
- /**
1342
- * File status constants for validation state tracking
1343
- */
1344
- declare const FileValidationStatus: {
1345
- /** File is pending validation */
1346
- readonly PENDING: "pending";
1347
- /** File failed during processing (before validation) */
1348
- readonly PROCESSING_ERROR: "processing_error";
1349
- /** File was excluded by validation warning (not an error) */
1350
- readonly EXCLUDED: "excluded";
1351
- /** File failed validation (blocks deployment) */
1352
- readonly VALIDATION_FAILED: "validation_failed";
1353
- /** File passed validation and is ready for deployment */
1354
- readonly READY: "ready";
1355
- };
1356
- type FileValidationStatusType = (typeof FileValidationStatus)[keyof typeof FileValidationStatus];
1357
- /**
1358
- * A validation issue with a display-ready message
1359
- *
1360
- * Issues are either errors (in errors[] array) or warnings (in warnings[] array).
1361
- * The array position determines severity - no need to duplicate it in the object.
1362
- */
1363
- interface ValidationIssue {
1364
- /** File path that triggered this issue */
1365
- file: string;
1366
- /** Display-ready message explaining the issue */
1367
- message: string;
1368
- }
1369
- /**
1370
- * Minimal file interface required for validation
1371
- */
1372
- interface ValidatableFile {
1373
- name: string;
1374
- size: number;
1375
- status?: FileValidationStatusType;
1376
- statusMessage?: string;
1377
- }
1378
- /**
1379
- * File validation result with severity-based issue reporting
1380
- *
1381
- * Validation checks files against constraints and categorizes issues by severity:
1382
- * - **Errors**: Block deployment (file too large, invalid type, etc.)
1383
- * - **Warnings**: Exclude files but allow deployment (empty files, etc.)
1384
- *
1385
- * @example
1386
- * ```typescript
1387
- * const result = validateFiles(files, config);
1388
- *
1389
- * if (!result.canDeploy) {
1390
- * // Has errors - must fix before deploying
1391
- * console.error('Deployment blocked:', result.errors);
1392
- * } else if (result.warnings.length > 0) {
1393
- * // Has warnings - deployment proceeds, some files excluded
1394
- * console.warn('Files excluded:', result.warnings);
1395
- * deploy(result.validFiles);
1396
- * } else {
1397
- * // All files valid
1398
- * deploy(result.validFiles);
1399
- * }
1400
- * ```
1401
- */
1402
- interface FileValidationResult<T extends ValidatableFile> {
1403
- /** All files with updated status */
1404
- files: T[];
1405
- /** Files ready for deployment (status: 'ready') */
1406
- validFiles: T[];
1407
- /** Blocking errors that prevent deployment */
1408
- errors: ValidationIssue[];
1409
- /** Non-blocking warnings (files excluded but deployment allowed) */
1410
- warnings: ValidationIssue[];
1411
- /** Whether deployment can proceed (true if errors.length === 0) */
1412
- canDeploy: boolean;
1413
- }
1414
- /**
1415
- * Represents a file that has been uploaded and stored
1416
- */
1417
- interface UploadedFile {
1418
- key: string;
1419
- etag: string;
1420
- size: number;
1421
- validated?: boolean;
1422
- }
1423
- /**
1424
- * Check if a domain is a platform domain (subdomain of our platform).
1425
- * Platform domains are free and don't require DNS verification.
1426
- *
1427
- * @example isPlatformDomain("www.shipstatic.com", "shipstatic.com") → true
1428
- * @example isPlatformDomain("example.com", "shipstatic.com") → false
1429
- */
1430
- declare function isPlatformDomain(domain: string, platformDomain: string): boolean;
1431
- /**
1432
- * Check if a domain is a custom domain (not a platform subdomain).
1433
- * Custom domains are billable and require DNS verification.
1434
- *
1435
- * @example isCustomDomain("example.com", "shipstatic.com") → true
1436
- * @example isCustomDomain("www.shipstatic.com", "shipstatic.com") → false
1437
- */
1438
- declare function isCustomDomain(domain: string, platformDomain: string): boolean;
1439
- /**
1440
- * Extract subdomain from a platform domain.
1441
- * Returns null if not a platform domain.
1442
- *
1443
- * @example extractSubdomain("www.shipstatic.com", "shipstatic.com") → "www"
1444
- * @example extractSubdomain("example.com", "shipstatic.com") → null
1445
- */
1446
- declare function extractSubdomain(domain: string, platformDomain: string): string | null;
1447
- /**
1448
- * Generate HTTPS URL for a deployment hostname.
1449
- */
1450
- declare function generateDeploymentUrl(deployment: string): string;
1451
- /**
1452
- * Generate HTTPS URL for a domain.
1453
- */
1454
- declare function generateDomainUrl(domain: string): string;
1455
- /**
1456
- * Label validation constraints shared across UI and API.
1457
- * These rules define the single source of truth for label validation.
1458
- */
1459
- declare const LABEL_CONSTRAINTS: {
1460
- /** Minimum label length in characters */
1461
- readonly MIN_LENGTH: 3;
1462
- /** Maximum label length in characters (concise labels, matches Stack Overflow's original limit) */
1463
- readonly MAX_LENGTH: 25;
1464
- /** Maximum number of labels allowed per resource */
1465
- readonly MAX_COUNT: 10;
1466
- /** Allowed separator characters between label segments */
1467
- readonly SEPARATORS: "._-";
1468
- };
1469
- /**
1470
- * Label validation pattern.
1471
- * Must start and end with alphanumeric (a-z, 0-9).
1472
- * Can contain separators (. _ -) between segments, but not consecutive.
1473
- *
1474
- * Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
1475
- * Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
1476
- */
1477
- declare const LABEL_PATTERN: RegExp;
1478
- /**
1479
- * Serialize labels array to JSON string for database storage.
1480
- * Returns null for empty or undefined arrays.
1481
- *
1482
- * @example serializeLabels(['web', 'production']) → '["web","production"]'
1483
- * @example serializeLabels([]) → null
1484
- * @example serializeLabels(undefined) → null
1485
- */
1486
- declare function serializeLabels(labels: string[] | undefined): string | null;
1487
- /**
1488
- * Deserialize labels from JSON string to array.
1489
- * Always returns an array — empty array for null/empty/invalid input.
1490
- *
1491
- * @example deserializeLabels('["web","production"]') → ['web', 'production']
1492
- * @example deserializeLabels(null) → []
1493
- * @example deserializeLabels('') → []
1494
- */
1495
- declare function deserializeLabels(labelsJson: string | null): string[];
1496
- /**
1497
- * Length constraints for the optional deployment password
1498
- * (`DeploymentUploadOptions.password`). Single source of truth shared across
1499
- * platform consumers.
1500
- */
1501
- declare const PASSWORD_CONSTRAINTS: {
1502
- /** Minimum password length in characters */
1503
- readonly MIN_LENGTH: 6;
1504
- /** Maximum password length in characters */
1505
- readonly MAX_LENGTH: 128;
1506
- };
1507
- /**
1508
- * Validate an optional deployment password and return it normalized.
1509
- *
1510
- * Absent (`undefined` / `null`) → returns `undefined`. Present → trim
1511
- * leading/trailing whitespace, then validate against `PASSWORD_CONSTRAINTS`
1512
- * length bounds (internal whitespace is significant and counts toward
1513
- * length). Throws `ShipError.validation` on breach; returns the trimmed
1514
- * value.
1515
- *
1516
- * The trim is canonical: at upload, the API hashes the trimmed value; at
1517
- * unlock, the router trims submissions before hashing. Submission and storage
1518
- * agree byte-for-byte. Length validation runs on the trimmed value because
1519
- * that's the user's actual intent — and it disarms a class of invisible
1520
- * foot-guns (trailing newlines from copy/paste, mobile auto-spacing,
1521
- * password-manager artifacts).
1522
- *
1523
- * Single source of truth shared by SDK (client-side validation, return
1524
- * ignored) and API (server-side enforcement, return threaded into config).
1525
- * Length is part of the wire-format contract; strength rules, if added later,
1526
- * stay server-side. See `CLAUDE.md` "Validation: format vs policy".
1527
- */
1528
- declare function validatePassword(value: unknown): string | undefined;
1
+ import * as _shipstatic_types from '@shipstatic/types';
2
+ import { DeploymentUploadOptions, StaticFile, DeploymentViaType, DeploymentCreateResponse, ListOptions, DeploymentListResponse, Deployment, DeploymentDeleteResponse, DomainSetResult, DomainListResponse, Domain, DomainDeleteResponse, DomainVerifyResponse, DomainDnsResponse, DomainRecordsResponse, DomainShareResponse, DomainValidateResponse, TokenCreateResponse, TokenListResponse, TokenDeleteResponse, Token, AccountGetResponse, PlatformLimits, PingResponse, DeployInput, AccountResource, DeploymentResource, DomainResource, TokenResource, ValidatableFile, FileValidationResult } from '@shipstatic/types';
3
+ export * from '@shipstatic/types';
4
+ export { Account, AccountResource, DEFAULT_API, DeployInput, Deployment, DeploymentResource, Domain, DomainResource, ErrorType, FileValidationStatus as FILE_VALIDATION_STATUS, PingResponse, ShipError, StaticFile, TokenResource, ValidatableFile } from '@shipstatic/types';
1529
5
 
1530
6
  /**
1531
7
  * @file SDK-specific type definitions
@@ -1569,8 +45,13 @@ interface DeployBodyContext {
1569
45
  * `LABEL_CONSTRAINTS` (length and pattern, lowercased+trimmed).
1570
46
  */
1571
47
  labels?: string[];
1572
- /** Client identifier (`cli`, `sdk`, `web`). */
1573
- via?: string;
48
+ /**
49
+ * Which client is deploying — the same closed vocabulary the public option
50
+ * carries, not a second `string`. This context receives an already-narrowed
51
+ * value and passed it on widened, which made the narrowing stop one seam
52
+ * short of the wire.
53
+ */
54
+ via?: DeploymentViaType;
1574
55
  /**
1575
56
  * Optional plaintext password to protect the deployment.
1576
57
  * Length: `PASSWORD_CONSTRAINTS.MIN_LENGTH` to `PASSWORD_CONSTRAINTS.MAX_LENGTH`
@@ -1887,7 +368,7 @@ declare abstract class Ship$1 {
1887
368
  /**
1888
369
  * Get current account information (convenience shortcut to `ship.account.get()`).
1889
370
  */
1890
- whoami(): Promise<AccountGetResponse>;
371
+ whoami(): Promise<_shipstatic_types.AccountGetResponse>;
1891
372
  /**
1892
373
  * Get platform limits (max file size, file count, total size).
1893
374
  * Reuses the response fetched during initialization. Per-instance state —
@@ -2239,4 +720,4 @@ declare class Ship extends Ship$1 {
2239
720
  protected getDeployBodyCreator(): DeployBodyCreator;
2240
721
  }
2241
722
 
2242
- export { API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountDeleteResponse, type AccountGetResponse, type AccountKeyResponse, type AccountOverrides, AccountPlan, type AccountPlanType, type AccountResource, type AccountUsage, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, BLOCKED_EXTENSIONS, type BillingCancelResponse, type BillingStatus, CALLER, type CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_TOKEN, type DeployBody, type DeployBodyContext, type DeployBodyCreator, type DeployFile, type DeployInput, type Deployment, type DeploymentCreateResponse, type DeploymentDeleteResponse, type DeploymentListResponse, type DeploymentOptions, type DeploymentResource, type DeploymentResourceContext, type DeploymentSetOptions, DeploymentStatus, type DeploymentStatusType, type DeploymentUploadOptions, type DnsLookup, type DnsProvider, type DnsRecord, type DnsRecordType, type Domain, type DomainDeleteResponse, type DomainDnsResponse, type DomainListResponse, type DomainRecordsResponse, type DomainResource, type DomainSetOptions, type DomainSetResult, type DomainShareResponse, DomainStatus, type DomainStatusType, type DomainValidateResponse, type DomainVerifyResponse, type ErrorResponse, ErrorType, type ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, type Fetch, type FileValidationResult, FileValidationStatus, type FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, type LabelsResponse, type ListOptions, type ListResponse, type MD5Result, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, type PingResponse, type PlatformLimits, type ResourceContext, type SPACheckDebug, type SPACheckRequest, type SPACheckResponse, SPA_DEFAULT_CONFIG, type SetupInstructionsResponse, Ship, type ShipClientOptions, ShipError, type ShipEvents, type StaticFile, type Token, type TokenCreateOptions, type TokenCreateResponse, type TokenDeleteResponse, TokenKind, type TokenKindType, type TokenListResponse, type TokenProvider, type TokenResource, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, type UploadedFile, type UserVisibleActivityEvent, type ValidatableFile, type ValidationIssue, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, deserializeLabels, extractSubdomain, filterJunk, formatFileSize, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isCustomDomain, isDeployment, isPlatformDomain, isShipError, optimizeDeployPaths, pluralize, processFilesForNode, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validatePassword, validateToken };
723
+ export { type ApiDeployOptions, ApiHttp, type ApiHttpOptions, type DeployBody, type DeployBodyContext, type DeployBodyCreator, type DeployFile, type DeploymentOptions, type DeploymentResourceContext, type ExecutionEnvironment, type Fetch, JUNK_DIRECTORIES, type MD5Result, type ResourceContext, Ship, type ShipClientOptions, type ShipEvents, type TokenProvider, __setTestEnvironment, allValidFilesReady, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, formatFileSize, getENV, getValidFiles, optimizeDeployPaths, pluralize, processFilesForNode, validateDeployFile, validateDeployPath, validateFileName, validateFiles };