@shipstatic/types 2.5.0-beta.2 → 2.5.0-beta.20
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/README.md +16 -6
- package/dist/index.d.ts +577 -77
- package/dist/index.js +416 -7
- package/package.json +4 -4
- package/src/index.ts +815 -70
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,28 @@ export declare const DeploymentStatus: {
|
|
|
12
12
|
readonly DELETING: "deleting";
|
|
13
13
|
};
|
|
14
14
|
export type DeploymentStatusType = (typeof DeploymentStatus)[keyof typeof DeploymentStatus];
|
|
15
|
+
/**
|
|
16
|
+
* Which client made a deployment — the origin-tracking vocabulary.
|
|
17
|
+
*
|
|
18
|
+
* A closed set with many authors: the CLI, the SDK, the dashboard, both MCP
|
|
19
|
+
* transports, the GitHub Action, the n8n node and the VS Code extension each
|
|
20
|
+
* name themselves here. It lived in the API's config until 2026-08-06, where
|
|
21
|
+
* being server-side made it unenforceable in the one direction that matters —
|
|
22
|
+
* every client wrote a bare string, and a value outside the set was **silently
|
|
23
|
+
* dropped** by the server, so a typo did not fail anywhere. It stopped
|
|
24
|
+
* recording where deploys came from and said nothing.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DeploymentVia: {
|
|
27
|
+
readonly WEB: "web";
|
|
28
|
+
readonly SDK: "sdk";
|
|
29
|
+
readonly CLI: "cli";
|
|
30
|
+
readonly MCP: "mcp";
|
|
31
|
+
readonly GIT: "git";
|
|
32
|
+
readonly N8N: "n8n";
|
|
33
|
+
readonly GPT: "gpt";
|
|
34
|
+
readonly VSC: "vsc";
|
|
35
|
+
};
|
|
36
|
+
export type DeploymentViaType = (typeof DeploymentVia)[keyof typeof DeploymentVia];
|
|
15
37
|
/**
|
|
16
38
|
* Core deployment object - used in both API responses and SDK
|
|
17
39
|
*/
|
|
@@ -32,7 +54,15 @@ export interface Deployment {
|
|
|
32
54
|
readonly password: boolean;
|
|
33
55
|
/** Labels for categorization and filtering (lowercase, alphanumeric with separators). Always present, empty array when none. */
|
|
34
56
|
labels: string[];
|
|
35
|
-
/**
|
|
57
|
+
/**
|
|
58
|
+
* The client/tool that created this deployment, null if unknown.
|
|
59
|
+
*
|
|
60
|
+
* Deliberately wider than {@link DeploymentViaType}: this is stored data,
|
|
61
|
+
* and rows predate the vocabulary being closed. Narrowing the ENTITY would
|
|
62
|
+
* be a claim about every row already in the database; narrowing the
|
|
63
|
+
* REQUEST option ({@link DeploymentUploadOptions.via}) is a claim about
|
|
64
|
+
* what a client may send, which is ours to make.
|
|
65
|
+
*/
|
|
36
66
|
readonly via: string | null;
|
|
37
67
|
/** Unix timestamp (seconds) when deployment was created */
|
|
38
68
|
readonly created: number;
|
|
@@ -49,16 +79,122 @@ export interface DeploymentCreateResponse extends Deployment {
|
|
|
49
79
|
/** Claim URL for public deployments. Present when deployed without credentials. */
|
|
50
80
|
readonly claim?: string;
|
|
51
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Every path the public API answers on, declared once.
|
|
84
|
+
*
|
|
85
|
+
* The URL surface was written out in four places — the API's mounts, the
|
|
86
|
+
* SDK's client, the dashboard's client, and the post-deploy smoke — so a
|
|
87
|
+
* rename meant finding all four. The first three now read this table.
|
|
88
|
+
*
|
|
89
|
+
* The smoke (`cloudflare/api/smoke.mjs`) deliberately still spells its own:
|
|
90
|
+
* five of its nine paths are `/admin/*`, which this table excludes by
|
|
91
|
+
* design, and splitting one list between a registry and literals reads worse
|
|
92
|
+
* than keeping it uniform.
|
|
93
|
+
*
|
|
94
|
+
* **What this guarantees, exactly.** Collection paths are mounted from here,
|
|
95
|
+
* so producer and consumer cannot diverge. Item paths are declared here and
|
|
96
|
+
* consumed by clients, but the API spells them relative to their mount
|
|
97
|
+
* (`/:deployment/config`), so the table does not *generate* them — it is
|
|
98
|
+
* held to them by `api/tests/architecture/api-paths.test.ts`, which fails if
|
|
99
|
+
* any entry names a path no route answers. Some entries have no client yet
|
|
100
|
+
* (`DEPLOYMENT_CONFIG`, `DOMAIN_PROPAGATION` — endpoints the SDK
|
|
101
|
+
* deliberately does not reach); the fence is what keeps those honest rather
|
|
102
|
+
* than merely asserted.
|
|
103
|
+
*
|
|
104
|
+
* **The operator surface is deliberately absent.** `/admin/*` paths belong
|
|
105
|
+
* to `web/my`, for the same reason its row types do: this package is
|
|
106
|
+
* published, and the operator surface is not public (see `CLAUDE.md`, "Admin
|
|
107
|
+
* types"). A path here is a promise to every npm consumer; `/admin` is a
|
|
108
|
+
* promise to one dashboard.
|
|
109
|
+
*
|
|
110
|
+
* Item paths are functions rather than templates so the key is interpolated
|
|
111
|
+
* in one place, encoded the same way by every caller.
|
|
112
|
+
*/
|
|
113
|
+
export declare const API_PATHS: {
|
|
114
|
+
readonly DEPLOYMENTS: "/deployments";
|
|
115
|
+
readonly DEPLOYMENT: (deployment: string) => string;
|
|
116
|
+
readonly DEPLOYMENT_CONFIG: (deployment: string) => string;
|
|
117
|
+
readonly DOMAINS: "/domains";
|
|
118
|
+
readonly DOMAIN: (domain: string) => string;
|
|
119
|
+
readonly DOMAIN_VERIFY: (domain: string) => string;
|
|
120
|
+
readonly DOMAIN_DNS: (domain: string) => string;
|
|
121
|
+
readonly DOMAIN_RECORDS: (domain: string) => string;
|
|
122
|
+
readonly DOMAIN_SHARE: (domain: string) => string;
|
|
123
|
+
readonly DOMAIN_PROPAGATION: (domain: string) => string;
|
|
124
|
+
readonly DOMAINS_VALIDATE: "/domains/validate";
|
|
125
|
+
readonly TOKENS: "/tokens";
|
|
126
|
+
readonly TOKEN: (token: string) => string;
|
|
127
|
+
readonly ACCOUNT: "/account";
|
|
128
|
+
readonly ACCOUNT_KEY: "/account/key";
|
|
129
|
+
readonly ACCOUNT_CLAIM: "/account/claim";
|
|
130
|
+
readonly ACTIVITIES: "/activities";
|
|
131
|
+
readonly LABELS: "/labels";
|
|
132
|
+
readonly LIMITS: "/limits";
|
|
133
|
+
readonly PING: "/ping";
|
|
134
|
+
readonly SETUP: "/setup";
|
|
135
|
+
readonly SPA_CHECK: "/spa-check";
|
|
136
|
+
readonly UPLOAD: "/upload";
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The half of a list response that is identical on every list.
|
|
140
|
+
*
|
|
141
|
+
* `GET /<collection>` answers exactly two fields — the collection under its
|
|
142
|
+
* own plural noun, and this cursor — so the cursor is declared once here and
|
|
143
|
+
* each response below adds only its noun. `cursor: null` means last page and
|
|
144
|
+
* is the ENTIRE has-more signal, which is why there is no `has_more`.
|
|
145
|
+
*
|
|
146
|
+
* There is deliberately no `total`. A count is an aggregate over a
|
|
147
|
+
* collection, not a property of a page; producing one would cost a COUNT
|
|
148
|
+
* beside every page read, which is precisely what keyset pagination exists
|
|
149
|
+
* to avoid. Counts live on the resource that summarises the collection —
|
|
150
|
+
* `GET /account`'s `usage` for one caller, `GET /admin/stats` platform-wide.
|
|
151
|
+
*/
|
|
152
|
+
export interface ListResponse {
|
|
153
|
+
/** Opaque cursor from this page; `null` on the last page. */
|
|
154
|
+
cursor: string | null;
|
|
155
|
+
}
|
|
52
156
|
/**
|
|
53
157
|
* Response for listing deployments
|
|
54
158
|
*/
|
|
55
|
-
export interface DeploymentListResponse {
|
|
159
|
+
export interface DeploymentListResponse extends ListResponse {
|
|
56
160
|
/** Array of deployments */
|
|
57
161
|
deployments: Deployment[];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Acknowledgement of `DELETE /deployments/:deployment` — and the shape every
|
|
165
|
+
* mutation with no entity left to return follows.
|
|
166
|
+
*
|
|
167
|
+
* **The law:** a mutation answers with the resource it affected. If the
|
|
168
|
+
* resource still exists, that means the entity itself (`Deployment`,
|
|
169
|
+
* `Domain`, …). Otherwise it means this: the resource noun carrying the
|
|
170
|
+
* item's canonical key, plus the resource's own state field — and ONLY when
|
|
171
|
+
* the resource survived in a transitional state, as an async deletion's does.
|
|
172
|
+
* Where the resource is simply gone, the key alone is the whole answer
|
|
173
|
+
* ({@link DomainDeleteResponse}, {@link TokenDeleteResponse}).
|
|
174
|
+
*
|
|
175
|
+
* Put positively: **an acknowledgement is a projection of the resource** —
|
|
176
|
+
* its key, plus its own state field where the state changed. That is the
|
|
177
|
+
* test to apply, and it is sharper than "no constant", which this shape
|
|
178
|
+
* would fail on its own terms: `status` here is the literal `'deleting'` on
|
|
179
|
+
* every success, exactly as fixed as a `changed: true` would be.
|
|
180
|
+
*
|
|
181
|
+
* The difference is not how predictable the value is, it is what the field
|
|
182
|
+
* IS. `status` is the deployment's own field — the same one `GET
|
|
183
|
+
* /deployments/:deployment` returns — so this response is `Deployment`
|
|
184
|
+
* narrowed to two members, and a client renders it with the code it already
|
|
185
|
+
* has. `changed: true`, `queued: true` and `success: true` are not fields of
|
|
186
|
+
* any entity; they exist only to assert that the call worked, which the
|
|
187
|
+
* status code already said. Sync versus accepted is likewise the status
|
|
188
|
+
* code's job — 200 versus 202 — not a boolean's.
|
|
189
|
+
*
|
|
190
|
+
* No prose either (`message`): an acknowledgement is data, and each surface
|
|
191
|
+
* composes its own copy.
|
|
192
|
+
*/
|
|
193
|
+
export interface DeploymentDeleteResponse {
|
|
194
|
+
/** The deployment hostname that was marked for removal */
|
|
195
|
+
readonly deployment: string;
|
|
196
|
+
/** The state the deployment is in while background cleanup runs */
|
|
197
|
+
readonly status: DeploymentStatusType;
|
|
62
198
|
}
|
|
63
199
|
/**
|
|
64
200
|
* Domain status constants
|
|
@@ -91,7 +227,7 @@ export interface Domain {
|
|
|
91
227
|
labels: string[];
|
|
92
228
|
/** Unix timestamp (seconds) when domain was created */
|
|
93
229
|
readonly created: number;
|
|
94
|
-
/**
|
|
230
|
+
/** Unix timestamp (seconds) when deployment was last linked, null if never linked */
|
|
95
231
|
linked: number | null;
|
|
96
232
|
/** Total deployment links */
|
|
97
233
|
links: number;
|
|
@@ -113,13 +249,28 @@ export interface DomainSetResult extends Domain {
|
|
|
113
249
|
/**
|
|
114
250
|
* Response for listing domains
|
|
115
251
|
*/
|
|
116
|
-
export interface DomainListResponse {
|
|
252
|
+
export interface DomainListResponse extends ListResponse {
|
|
117
253
|
/** Array of domains */
|
|
118
254
|
domains: Domain[];
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Acknowledgement of `DELETE /domains/:domain`. The row is gone, so there is
|
|
258
|
+
* no state to state — the canonical domain name is the whole answer. See
|
|
259
|
+
* {@link DeploymentDeleteResponse} for the law.
|
|
260
|
+
*/
|
|
261
|
+
export interface DomainDeleteResponse {
|
|
262
|
+
/** The domain name that was removed, normalized */
|
|
263
|
+
readonly domain: string;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Acknowledgement of `POST /domains/:domain/verify` (202). The DNS check is
|
|
267
|
+
* queued, not performed — the accepted status code says so, and the domain's
|
|
268
|
+
* own status is unchanged until the check runs, which is why none is stated
|
|
269
|
+
* here. See {@link DeploymentDeleteResponse} for the law.
|
|
270
|
+
*/
|
|
271
|
+
export interface DomainVerifyResponse {
|
|
272
|
+
/** The domain whose DNS verification was queued, normalized */
|
|
273
|
+
readonly domain: string;
|
|
123
274
|
}
|
|
124
275
|
/**
|
|
125
276
|
* DNS record types supported for domain configuration
|
|
@@ -146,16 +297,46 @@ export interface DnsProvider {
|
|
|
146
297
|
/**
|
|
147
298
|
* Response for domain DNS provider lookup
|
|
148
299
|
*/
|
|
300
|
+
/**
|
|
301
|
+
* What a DNS lookup found for a domain. An envelope rather than a bare
|
|
302
|
+
* {@link DnsProvider} because a lookup can succeed and learn more than the
|
|
303
|
+
* provider later; the shape is named so a consumer can hold one.
|
|
304
|
+
*/
|
|
305
|
+
export interface DnsLookup {
|
|
306
|
+
/** The provider serving this domain's DNS, absent when unidentified */
|
|
307
|
+
provider?: DnsProvider;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
311
|
+
* "A report answers a question").
|
|
312
|
+
*/
|
|
149
313
|
export interface DomainDnsResponse {
|
|
150
314
|
/** The domain name */
|
|
151
315
|
domain: string;
|
|
152
316
|
/** DNS provider information, null if not yet looked up */
|
|
153
|
-
dns:
|
|
154
|
-
|
|
155
|
-
|
|
317
|
+
dns: DnsLookup | null;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Response for `GET /domains/:domain/share` — the domain plus the salted
|
|
321
|
+
* hash that lets someone else complete its DNS setup without an account.
|
|
322
|
+
*
|
|
323
|
+
* `/admin/domains/:domain/share` answers the same shape, which is the admin
|
|
324
|
+
* law working: the operator surface is the public grammar with a prefix.
|
|
325
|
+
*
|
|
326
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
327
|
+
* "A report answers a question").
|
|
328
|
+
*/
|
|
329
|
+
export interface DomainShareResponse {
|
|
330
|
+
/** The domain the setup link is for */
|
|
331
|
+
readonly domain: string;
|
|
332
|
+
/** The salted setup hash that authorizes the share */
|
|
333
|
+
readonly hash: string;
|
|
156
334
|
}
|
|
157
335
|
/**
|
|
158
336
|
* Response for domain DNS records
|
|
337
|
+
*
|
|
338
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
339
|
+
* "A report answers a question").
|
|
159
340
|
*/
|
|
160
341
|
export interface DomainRecordsResponse {
|
|
161
342
|
/** The domain name */
|
|
@@ -166,7 +347,92 @@ export interface DomainRecordsResponse {
|
|
|
166
347
|
records: DnsRecord[];
|
|
167
348
|
}
|
|
168
349
|
/**
|
|
169
|
-
*
|
|
350
|
+
* The envelope an `Idempotency-Key` must fit, and how long a replay lasts.
|
|
351
|
+
*
|
|
352
|
+
* Format lives here rather than on the server alone by the format-vs-policy
|
|
353
|
+
* rule: a client can decide offline whether a key is well-formed, and the
|
|
354
|
+
* API would reject the same value the same way.
|
|
355
|
+
*/
|
|
356
|
+
export declare const IDEMPOTENCY_KEY_CONSTRAINTS: {
|
|
357
|
+
/**
|
|
358
|
+
* HTTP header name. Here for the same reason {@link CALLER.HEADER} is: a
|
|
359
|
+
* wire header has two ends, and the package that owns the value's format
|
|
360
|
+
* is the only place both ends can read its name from.
|
|
361
|
+
*/
|
|
362
|
+
readonly HEADER: "Idempotency-Key";
|
|
363
|
+
readonly MAX_LENGTH: 256;
|
|
364
|
+
/** How long a stored 201 stays replayable. */
|
|
365
|
+
readonly WINDOW_SECONDS: number;
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* Normalize a `via` value from any transport — trimmed, lowercased, and a
|
|
369
|
+
* member of {@link DeploymentVia}, or `undefined`.
|
|
370
|
+
*
|
|
371
|
+
* A format rule by this package's own test: a client can decide offline
|
|
372
|
+
* whether a value is well-formed, and the API reaches the same verdict on the
|
|
373
|
+
* same input. It lived server-side until 2026-08-06, which meant clients could
|
|
374
|
+
* only learn their label was unusable by noticing analytics had gone quiet.
|
|
375
|
+
*
|
|
376
|
+
* **Not knowing your `via` is not an error** — an unrecognized value yields
|
|
377
|
+
* `undefined` rather than throwing, because origin tracking is telemetry and a
|
|
378
|
+
* deploy must never fail over it. A caller that has an honest default should
|
|
379
|
+
* prefer it (`normalizeVia(process.env.SHIP_VIA) ?? DeploymentVia.CLI`): the
|
|
380
|
+
* deploy really did come from the CLI, so recording that beats recording
|
|
381
|
+
* nothing.
|
|
382
|
+
*/
|
|
383
|
+
export declare function normalizeVia(value: unknown): DeploymentViaType | undefined;
|
|
384
|
+
/**
|
|
385
|
+
* Validate an idempotency key, returning the trimmed value or `undefined`
|
|
386
|
+
* when none was supplied. Throws {@link ShipError.validation} when the value
|
|
387
|
+
* cannot be sent — the same verdict the API would reach, reached earlier.
|
|
388
|
+
*/
|
|
389
|
+
export declare function validateIdempotencyKey(value: unknown): string | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Response for `GET /labels` — every label in use across the caller's
|
|
392
|
+
* deployments, domains and tokens, grouped and ordered by last use.
|
|
393
|
+
*
|
|
394
|
+
* The one plural noun outside the list contract, deliberately: labels have
|
|
395
|
+
* no identity, no row and no `created`, so there is nothing for a keyset
|
|
396
|
+
* cursor to resume after, and its consumer is an autocomplete that wants the
|
|
397
|
+
* whole set. Bounded by `PAGINATION.GLOBAL_LIMIT` rather than paginated.
|
|
398
|
+
*
|
|
399
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
400
|
+
* "A report answers a question").
|
|
401
|
+
*/
|
|
402
|
+
export interface LabelsResponse {
|
|
403
|
+
readonly labels: string[];
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Response for `POST /setup` — the DNS instructions for one domain, written
|
|
407
|
+
* for a human to follow at their registrar.
|
|
408
|
+
*
|
|
409
|
+
* `custom` is the provider-specific walkthrough when the provider is known;
|
|
410
|
+
* `generic` always answers, so a caller never has nothing to show.
|
|
411
|
+
*
|
|
412
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
413
|
+
* "A report answers a question").
|
|
414
|
+
*/
|
|
415
|
+
export interface SetupInstructionsResponse {
|
|
416
|
+
/** The domain the instructions are for — a report names its subject */
|
|
417
|
+
readonly domain: string;
|
|
418
|
+
/** One-line summary of what to do */
|
|
419
|
+
readonly tldr: string;
|
|
420
|
+
/** Provider-specific instructions, null when the provider is unknown */
|
|
421
|
+
readonly custom: string | null;
|
|
422
|
+
/** Provider-agnostic instructions — always present */
|
|
423
|
+
readonly generic: string;
|
|
424
|
+
/** The identified DNS provider, null when unknown */
|
|
425
|
+
readonly provider: string | null;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* `POST /domains/validate` — a report answering "is this name usable, and if
|
|
429
|
+
* not, why".
|
|
430
|
+
*
|
|
431
|
+
* An unusable name is a legitimate ANSWER, not a failure, so this is a 200 and
|
|
432
|
+
* the verdict rides the body. `reason` was named `error` until 2026-07-29,
|
|
433
|
+
* which collided with {@link ErrorResponse}'s reserved key — there `error` is
|
|
434
|
+
* an `ErrorType` a client branches on, here it is prose a client displays, and
|
|
435
|
+
* one key cannot mean both. See {@link DeploymentDeleteResponse} for the law.
|
|
170
436
|
*/
|
|
171
437
|
export interface DomainValidateResponse {
|
|
172
438
|
/** Whether the domain is valid */
|
|
@@ -175,15 +441,17 @@ export interface DomainValidateResponse {
|
|
|
175
441
|
normalized: string | null;
|
|
176
442
|
/** Whether the domain is available, null when invalid */
|
|
177
443
|
available: boolean | null;
|
|
178
|
-
/**
|
|
179
|
-
|
|
444
|
+
/** Why the name is unusable, null when valid — displayed verbatim. */
|
|
445
|
+
reason: string | null;
|
|
180
446
|
}
|
|
181
447
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
448
|
+
* Core deploy token object - used in both API responses and SDK.
|
|
449
|
+
*
|
|
450
|
+
* The secret is never here: it is shown once at creation
|
|
451
|
+
* ({@link TokenCreateResponse.secret}) and never again, so an entity read
|
|
452
|
+
* carries only the management identifier and lifecycle metadata.
|
|
185
453
|
*/
|
|
186
|
-
export interface
|
|
454
|
+
export interface Token {
|
|
187
455
|
/** 7-char management identifier (e.g., "a1b2c3d") */
|
|
188
456
|
readonly token: string;
|
|
189
457
|
/** Labels for categorization and filtering. Always present, empty array when none. */
|
|
@@ -198,24 +466,28 @@ export interface TokenListItem {
|
|
|
198
466
|
/**
|
|
199
467
|
* Response for listing tokens
|
|
200
468
|
*/
|
|
201
|
-
export interface TokenListResponse {
|
|
202
|
-
/** Array of tokens (
|
|
203
|
-
tokens:
|
|
204
|
-
/** Total number of tokens */
|
|
205
|
-
total: number;
|
|
469
|
+
export interface TokenListResponse extends ListResponse {
|
|
470
|
+
/** Array of tokens (the secret is never among them) */
|
|
471
|
+
tokens: Token[];
|
|
206
472
|
}
|
|
207
473
|
/**
|
|
208
|
-
* Response
|
|
474
|
+
* Response from token creation. Extends Token with the one field that
|
|
475
|
+
* exists only on creation — the same shape as
|
|
476
|
+
* {@link DeploymentCreateResponse}, because a 201 returns the resource it
|
|
477
|
+
* created plus whatever is knowable only once.
|
|
209
478
|
*/
|
|
210
|
-
export interface TokenCreateResponse {
|
|
211
|
-
/** 7-char management identifier */
|
|
212
|
-
token: string;
|
|
479
|
+
export interface TokenCreateResponse extends Token {
|
|
213
480
|
/** The raw credential value (shown once at creation, then never again) */
|
|
214
|
-
secret: string;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
481
|
+
readonly secret: string;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Acknowledgement of `DELETE /tokens/:token`. The credential is revoked and
|
|
485
|
+
* its row is gone, so the management identifier is the whole answer. See
|
|
486
|
+
* {@link DeploymentDeleteResponse} for the law.
|
|
487
|
+
*/
|
|
488
|
+
export interface TokenDeleteResponse {
|
|
489
|
+
/** The 7-char management identifier that was revoked */
|
|
490
|
+
readonly token: string;
|
|
219
491
|
}
|
|
220
492
|
/**
|
|
221
493
|
* Account plan constants
|
|
@@ -232,10 +504,34 @@ export declare const AccountPlan: {
|
|
|
232
504
|
export type AccountPlanType = (typeof AccountPlan)[keyof typeof AccountPlan];
|
|
233
505
|
/**
|
|
234
506
|
* Account usage metrics — always available regardless of billing provider.
|
|
507
|
+
*
|
|
508
|
+
* This is where a caller's own totals live. Lists answer pages and carry no
|
|
509
|
+
* `total` (see {@link ListOptions}); a count is an aggregate over a
|
|
510
|
+
* collection, so it belongs to the summary resource that owns the
|
|
511
|
+
* collection. `GET /account` is that resource for one caller, `GET
|
|
512
|
+
* /admin/stats` for the platform.
|
|
513
|
+
*
|
|
514
|
+
* The counted dimensions are the ones the plan caps — deployments and
|
|
515
|
+
* domains (`PlatformLimits`) — plus the billable custom-domain subset, so a
|
|
516
|
+
* surface can render "3 of 10" without a second request.
|
|
235
517
|
*/
|
|
236
518
|
export interface AccountUsage {
|
|
237
519
|
/** Number of active custom domains (excludes paused) */
|
|
238
520
|
customDomains: number;
|
|
521
|
+
/**
|
|
522
|
+
* Deployments counted against the plan's deployment cap — every row
|
|
523
|
+
* whatever its status, because that is what the cap counts, so a surface
|
|
524
|
+
* renders "3 of 10" against the denominator the 403 divides by. (`GET
|
|
525
|
+
* /deployments` lists successful ones only; that is a different question
|
|
526
|
+
* asked of a different resource.) Optional by the additive-evolution law:
|
|
527
|
+
* an API predating this field omits it.
|
|
528
|
+
*/
|
|
529
|
+
deployments?: number;
|
|
530
|
+
/**
|
|
531
|
+
* Domains counted against the plan's domain cap — every domain, platform
|
|
532
|
+
* and custom alike, unlike `customDomains`. Optional for the same reason.
|
|
533
|
+
*/
|
|
534
|
+
domains?: number;
|
|
239
535
|
}
|
|
240
536
|
/**
|
|
241
537
|
* Core account object - used in both API responses and SDK
|
|
@@ -282,6 +578,35 @@ export interface AccountGetResponse extends Account {
|
|
|
282
578
|
/** Present only during read-only admin impersonation: the operator's account id. */
|
|
283
579
|
readonly impersonatedBy?: string;
|
|
284
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* Acknowledgement of `DELETE /account` (202). Termination is asynchronous —
|
|
583
|
+
* a cleanup consumer finishes the job — so the account survives long enough
|
|
584
|
+
* to state the plan it is transitioning through. `plan` is the account's
|
|
585
|
+
* state field, the way `status` is a deployment's. See
|
|
586
|
+
* {@link DeploymentDeleteResponse} for the law.
|
|
587
|
+
*/
|
|
588
|
+
export interface AccountDeleteResponse {
|
|
589
|
+
/** The account that was marked for termination */
|
|
590
|
+
readonly account: string;
|
|
591
|
+
/** The plan the account is in while cleanup runs */
|
|
592
|
+
readonly plan: AccountPlanType;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Response from `PUT /account/key` — the account's single API key, minted in
|
|
596
|
+
* place of whatever was there before.
|
|
597
|
+
*
|
|
598
|
+
* There is no entity to return: only the key's last-4 `hint` is durable
|
|
599
|
+
* (`Account.hint`), and the plaintext exists exactly once, in this response.
|
|
600
|
+
* The raw credential is `secret` on every surface that mints one — the same
|
|
601
|
+
* field `TokenCreateResponse` carries — because one concept gets one name.
|
|
602
|
+
*
|
|
603
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
604
|
+
* "A report answers a question").
|
|
605
|
+
*/
|
|
606
|
+
export interface AccountKeyResponse {
|
|
607
|
+
/** The raw API key (shown once at mint, then never again) */
|
|
608
|
+
readonly secret: string;
|
|
609
|
+
}
|
|
285
610
|
/**
|
|
286
611
|
* Account-specific configuration overrides
|
|
287
612
|
* Allows per-account customization of limits without changing plan
|
|
@@ -308,7 +633,15 @@ export interface AccountOverrides {
|
|
|
308
633
|
* (`DeploymentStatus`, `DomainStatus`, `AccountPlan`, `AuthMethod`) follow.
|
|
309
634
|
*/
|
|
310
635
|
export declare const ErrorType: {
|
|
311
|
-
/**
|
|
636
|
+
/**
|
|
637
|
+
* Validation failed. Input shape is wrong.
|
|
638
|
+
*
|
|
639
|
+
* Carries 400 when an API judged it — including a client-side pre-check of a
|
|
640
|
+
* rule the server enforces too, which keeps the error identical wherever it
|
|
641
|
+
* was caught. **Statusless** when a client rejects something no API judges,
|
|
642
|
+
* such as a CLI's own command grammar: `status` is documented "(API
|
|
643
|
+
* contexts)" on `ErrorResponse`, so there is none to report.
|
|
644
|
+
*/
|
|
312
645
|
readonly Validation: "validation_failed";
|
|
313
646
|
/** Resource not found (404). */
|
|
314
647
|
readonly NotFound: "not_found";
|
|
@@ -388,7 +721,8 @@ export declare class ShipError extends Error {
|
|
|
388
721
|
* Routing:
|
|
389
722
|
* - Already a `ShipError` → returned as-is (caller's intent preserved)
|
|
390
723
|
* - `AbortError` → `ShipError.cancelled(...)`
|
|
391
|
-
* -
|
|
724
|
+
* - A transport failure → `ShipError.network(...)` — see `isTransportFailure`
|
|
725
|
+
* for what each runtime offers as evidence
|
|
392
726
|
* - Any other `Error` → `ShipError(Api, ...)` (no HTTP status — fetch never reached the server)
|
|
393
727
|
* - Anything else (string, undefined, etc.) → `ShipError(Api, ...)`
|
|
394
728
|
*
|
|
@@ -421,6 +755,18 @@ export declare class ShipError extends Error {
|
|
|
421
755
|
static file(message: string, details?: unknown): ShipError;
|
|
422
756
|
static config(message: string, details?: unknown): ShipError;
|
|
423
757
|
static api(message: string, status?: number, details?: unknown): ShipError;
|
|
758
|
+
/**
|
|
759
|
+
* The caller is at fault — by HTTP's own definition of a 4xx, or by a type
|
|
760
|
+
* that is client-attributable without ever having a status (`Config`,
|
|
761
|
+
* `File`, raised locally by the SDK).
|
|
762
|
+
*
|
|
763
|
+
* Both arms are load-bearing, because type and status are independent
|
|
764
|
+
* axes. `fromHttpResponse` trusts `body.error` only when it names a
|
|
765
|
+
* server-producible type; a non-OK response without one is status-derived,
|
|
766
|
+
* so a CDN 404 or any intermediary error arrives as `Api` — a server-fault
|
|
767
|
+
* *type* carrying a client *status*. Judging by type alone would report it
|
|
768
|
+
* as a platform failure and bury the server's own message.
|
|
769
|
+
*/
|
|
424
770
|
isClientError(): boolean;
|
|
425
771
|
isNetworkError(): boolean;
|
|
426
772
|
isAuthError(): boolean;
|
|
@@ -447,6 +793,9 @@ export declare function isShipError(error: unknown): error is ShipError;
|
|
|
447
793
|
*
|
|
448
794
|
* These are the *platform's* posted caps for the current account — server
|
|
449
795
|
* truth delivered at runtime, never hard-coded on the client.
|
|
796
|
+
*
|
|
797
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
798
|
+
* "A report answers a question").
|
|
450
799
|
*/
|
|
451
800
|
export interface PlatformLimits {
|
|
452
801
|
/** Maximum size in bytes for a single file. */
|
|
@@ -480,6 +829,28 @@ export declare const BLOCKED_EXTENSIONS: ReadonlySet<string>;
|
|
|
480
829
|
* isBlockedExtension('README') // false
|
|
481
830
|
*/
|
|
482
831
|
export declare function isBlockedExtension(filename: string): boolean;
|
|
832
|
+
/**
|
|
833
|
+
* The `accept` attribute value for a browser file picker offering web files.
|
|
834
|
+
*
|
|
835
|
+
* **This is a hint, never a rule.** `BLOCKED_EXTENSIONS` is the platform's
|
|
836
|
+
* gate and the only thing that decides what may be hosted; this constant
|
|
837
|
+
* decides what a *file dialog* shows first. The two are not two halves of one
|
|
838
|
+
* policy, and this one must never be consulted to accept or reject a file.
|
|
839
|
+
*
|
|
840
|
+
* The distinction is structural, not stylistic. `accept` can express only an
|
|
841
|
+
* allowlist, while the platform's rule is a blocklist — so this list is
|
|
842
|
+
* necessarily *narrower* than what the platform hosts, and reading it as
|
|
843
|
+
* authority would reject files the platform serves happily. It is also not
|
|
844
|
+
* enforcement in the browser's own terms: every file dialog offers an
|
|
845
|
+
* all-files escape, and **drag-and-drop ignores `accept` entirely**. The
|
|
846
|
+
* dropzone and the picker must reach the same verdict on the same files, and
|
|
847
|
+
* they do — because the verdict is `validateFiles`, downstream of both.
|
|
848
|
+
*
|
|
849
|
+
* Kept beside `BLOCKED_EXTENSIONS` so one file holds both, which is what lets
|
|
850
|
+
* `tests/validation-constants.test.ts` fence the invariant that matters: the
|
|
851
|
+
* picker must never offer a file the platform will refuse.
|
|
852
|
+
*/
|
|
853
|
+
export declare const WEB_FILE_ACCEPT: string;
|
|
483
854
|
/**
|
|
484
855
|
* Characters that are unsafe in filenames for static hosting.
|
|
485
856
|
*
|
|
@@ -517,13 +888,20 @@ export declare const UNBUILT_PROJECT_MARKERS: ReadonlySet<string>;
|
|
|
517
888
|
*/
|
|
518
889
|
export declare function hasUnbuiltMarker(filePath: string): boolean;
|
|
519
890
|
/**
|
|
520
|
-
*
|
|
891
|
+
* `GET /ping` — a report of the server clock.
|
|
892
|
+
*
|
|
893
|
+
* Liveness is the STATUS CODE's answer, not a field's: a 200 means reachable,
|
|
894
|
+
* and any other outcome throws before a body is read. So the body carries the
|
|
895
|
+
* one thing a status code cannot — the server's own clock, which is what lets a
|
|
896
|
+
* client detect skew against a token expiry. It read `{ success: true,
|
|
897
|
+
* timestamp? }` until 2026-07-29, where `success` was a literal constant in the
|
|
898
|
+
* route (zero bits, and the platform's own named anti-pattern) while the field
|
|
899
|
+
* that IS the payload was optional. See {@link DeploymentDeleteResponse} for
|
|
900
|
+
* the law, and `tests/response-shapes.test.ts` for the fence that holds it.
|
|
521
901
|
*/
|
|
522
902
|
export interface PingResponse {
|
|
523
|
-
/** Always true if service is healthy */
|
|
524
|
-
success: boolean;
|
|
525
903
|
/** Server time in unix seconds — the one wire unit for timestamps. */
|
|
526
|
-
timestamp
|
|
904
|
+
readonly timestamp: number;
|
|
527
905
|
}
|
|
528
906
|
/**
|
|
529
907
|
* Where human identity is mounted on the API host. The API mounts Better
|
|
@@ -645,6 +1023,36 @@ export declare const SPA_DEFAULT_CONFIG: {
|
|
|
645
1023
|
readonly destination: "/index.html";
|
|
646
1024
|
}];
|
|
647
1025
|
};
|
|
1026
|
+
/**
|
|
1027
|
+
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
1028
|
+
* never schema.
|
|
1029
|
+
*
|
|
1030
|
+
* ship.json is validated and compiled on the server, deliberately: the schema
|
|
1031
|
+
* and the compiler evolve, and a client that judged them would reject configs
|
|
1032
|
+
* a newer platform accepts. That reasoning bounds what a client may check to
|
|
1033
|
+
* the properties which are true of *every* past and future schema:
|
|
1034
|
+
*
|
|
1035
|
+
* 1. it parses as JSON — JSON syntax is frozen (RFC 8259), so text that
|
|
1036
|
+
* does not parse can never be a valid config;
|
|
1037
|
+
* 2. its top level is an object — ship.json is `{ ... }` in every version.
|
|
1038
|
+
*
|
|
1039
|
+
* Both are monotonic: neither can ever reject something the server would
|
|
1040
|
+
* accept. Everything beyond them (field names, types, rule semantics, which
|
|
1041
|
+
* keys are permitted) stays server-side, where it can change.
|
|
1042
|
+
*
|
|
1043
|
+
* The payoff is the common case. Hand-edited JSON fails on a trailing comma,
|
|
1044
|
+
* a `//` comment, single quotes, unquoted keys, or smart quotes pasted from
|
|
1045
|
+
* documentation — mistakes that otherwise cost a full upload round-trip to
|
|
1046
|
+
* discover. A UTF-8 BOM (Windows editors, PowerShell redirects) is stripped
|
|
1047
|
+
* before parsing rather than rejected, because the server accepts it too;
|
|
1048
|
+
* diverging there would reintroduce exactly the false rejection this
|
|
1049
|
+
* function exists to avoid.
|
|
1050
|
+
*
|
|
1051
|
+
* @throws {ShipError} `ErrorType.Config` — the same type the server's own
|
|
1052
|
+
* config rejection carries, so the error contract is identical wherever the
|
|
1053
|
+
* failure is detected.
|
|
1054
|
+
*/
|
|
1055
|
+
export declare function assertShipJsonSyntax(text: string): void;
|
|
648
1056
|
/**
|
|
649
1057
|
* Validate API key format
|
|
650
1058
|
*/
|
|
@@ -687,16 +1095,26 @@ export interface SPACheckRequest {
|
|
|
687
1095
|
/**
|
|
688
1096
|
* Response from SPA check endpoint
|
|
689
1097
|
*/
|
|
1098
|
+
/**
|
|
1099
|
+
* Which of the classifier's tiers reached the verdict, and why. Named rather
|
|
1100
|
+
* than inline so the API's own `checkSPA` can return `SPACheckResponse`
|
|
1101
|
+
* instead of restating its shape.
|
|
1102
|
+
*/
|
|
1103
|
+
export interface SPACheckDebug {
|
|
1104
|
+
/** Which tier made the detection */
|
|
1105
|
+
tier: 'exclusions' | 'inclusions' | 'scoring' | 'ai' | 'fallback';
|
|
1106
|
+
/** The reason for the detection result */
|
|
1107
|
+
reason: string;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* A report: it answers a question and carries only the answer (`CLAUDE.md`,
|
|
1111
|
+
* "A report answers a question").
|
|
1112
|
+
*/
|
|
690
1113
|
export interface SPACheckResponse {
|
|
691
1114
|
/** Whether the project is detected as a Single Page Application */
|
|
692
1115
|
isSPA: boolean;
|
|
693
1116
|
/** Debugging information about detection */
|
|
694
|
-
debug:
|
|
695
|
-
/** Which tier made the detection: 'exclusions', 'inclusions', 'scoring', 'ai', or 'fallback' */
|
|
696
|
-
tier: 'exclusions' | 'inclusions' | 'scoring' | 'ai' | 'fallback';
|
|
697
|
-
/** The reason for the detection result */
|
|
698
|
-
reason: string;
|
|
699
|
-
};
|
|
1117
|
+
debug: SPACheckDebug;
|
|
700
1118
|
}
|
|
701
1119
|
/**
|
|
702
1120
|
* Represents a file that has been processed and is ready for deploy.
|
|
@@ -729,6 +1147,21 @@ export interface StaticFile {
|
|
|
729
1147
|
}
|
|
730
1148
|
/** Default API URL if not otherwise configured. */
|
|
731
1149
|
export declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
1150
|
+
/**
|
|
1151
|
+
* How long an anonymous deployment lives before it expires.
|
|
1152
|
+
*
|
|
1153
|
+
* The lifetime of the public tier, and one fact with several readers. The API
|
|
1154
|
+
* stamps a deployment's `expires` from it and gives a claim code exactly the
|
|
1155
|
+
* same window — a live site with a dead claim link is a coherence bug, so the
|
|
1156
|
+
* two are one constant rather than two that agree. Both MCP transports quote
|
|
1157
|
+
* the duration in prose an agent reads, and derive it from here rather than
|
|
1158
|
+
* writing it out, which they did in eight places until this export existed.
|
|
1159
|
+
*
|
|
1160
|
+
* Seconds, spelled in the name: this platform has both second- and
|
|
1161
|
+
* millisecond-valued durations, and the pair is only safe when each says which
|
|
1162
|
+
* it is.
|
|
1163
|
+
*/
|
|
1164
|
+
export declare const PUBLIC_DEPLOYMENT_TTL_SECONDS: number;
|
|
732
1165
|
/**
|
|
733
1166
|
* Universal deploy input — the union of every shape the SDK accepts.
|
|
734
1167
|
*
|
|
@@ -747,8 +1180,12 @@ export type DeployInput = File[] | string | string[];
|
|
|
747
1180
|
export interface DeploymentUploadOptions {
|
|
748
1181
|
/** Optional labels for categorization and filtering */
|
|
749
1182
|
labels?: string[];
|
|
750
|
-
/**
|
|
751
|
-
|
|
1183
|
+
/**
|
|
1184
|
+
* Which client is making this deploy. Closed, because the server silently
|
|
1185
|
+
* ignores anything outside the set — so an unchecked string turned a typo
|
|
1186
|
+
* into missing analytics rather than an error. See {@link DeploymentVia}.
|
|
1187
|
+
*/
|
|
1188
|
+
via?: DeploymentViaType;
|
|
752
1189
|
/**
|
|
753
1190
|
* Optional password that protects this deployment.
|
|
754
1191
|
*
|
|
@@ -768,12 +1205,41 @@ export interface DeploymentUploadOptions {
|
|
|
768
1205
|
spa?: boolean;
|
|
769
1206
|
/** @internal reCAPTCHA proof for the anonymous human deploy channel. Only available via /upload endpoint. */
|
|
770
1207
|
captcha?: string;
|
|
1208
|
+
/**
|
|
1209
|
+
* Makes this deploy replayable instead of repeatable.
|
|
1210
|
+
*
|
|
1211
|
+
* A deploy is not naturally idempotent: a client-side timeout on a slow
|
|
1212
|
+
* one leaves the caller unable to tell "it never landed" from "it landed
|
|
1213
|
+
* and the response was lost", and retrying produces a second deployment.
|
|
1214
|
+
* Send the same key on the retry and the platform replays the original
|
|
1215
|
+
* 201 verbatim rather than creating anything
|
|
1216
|
+
* ({@link IDEMPOTENCY_KEY_CONSTRAINTS.WINDOW_SECONDS}).
|
|
1217
|
+
*
|
|
1218
|
+
* **Agents are the audience.** A human notices a duplicate; an automated
|
|
1219
|
+
* retry does not. Pick a key that identifies the ATTEMPT — a run id, a
|
|
1220
|
+
* commit sha, a uuid minted before the first try — never one minted fresh
|
|
1221
|
+
* on each retry, which would defeat the point.
|
|
1222
|
+
*
|
|
1223
|
+
* The replay is per-caller, and it stores successes only: a failed deploy
|
|
1224
|
+
* retries fresh under the same key.
|
|
1225
|
+
*/
|
|
1226
|
+
idempotencyKey?: string;
|
|
771
1227
|
}
|
|
772
1228
|
/**
|
|
773
|
-
* Pagination options for
|
|
774
|
-
*
|
|
775
|
-
*
|
|
776
|
-
*
|
|
1229
|
+
* Pagination options for every list endpoint. The response's `cursor` feeds
|
|
1230
|
+
* the next request; a `null` cursor means the last page. Omitting both
|
|
1231
|
+
* returns the server's default first page.
|
|
1232
|
+
*
|
|
1233
|
+
* A list answers `{ <collection>, cursor }` and nothing else — `cursor`
|
|
1234
|
+
* carries the entire has-more signal, so no redundant boolean, and no
|
|
1235
|
+
* `total`. **A count is an aggregate over a collection, not a property of a
|
|
1236
|
+
* page:** including one makes every read pay for a full scan it did not ask
|
|
1237
|
+
* for, which is precisely the cost keyset pagination exists to avoid.
|
|
1238
|
+
*
|
|
1239
|
+
* Counts therefore live on the summary resource that owns them —
|
|
1240
|
+
* `GET /account` (`usage`) for a caller's own totals, `GET /admin/stats` for
|
|
1241
|
+
* platform-wide ones. Ask for a count when you want a count; ask for a page
|
|
1242
|
+
* when you want a page.
|
|
777
1243
|
*/
|
|
778
1244
|
export interface ListOptions {
|
|
779
1245
|
/** Maximum number of items to return in one page. */
|
|
@@ -781,6 +1247,33 @@ export interface ListOptions {
|
|
|
781
1247
|
/** Opaque cursor from the previous page's response. */
|
|
782
1248
|
cursor?: string;
|
|
783
1249
|
}
|
|
1250
|
+
/**
|
|
1251
|
+
* What a caller may change on an existing deployment.
|
|
1252
|
+
*
|
|
1253
|
+
* Labels and nothing else: a deployment's content is immutable by design, so
|
|
1254
|
+
* this is the whole mutable surface rather than a subset someone chose.
|
|
1255
|
+
*/
|
|
1256
|
+
export interface DeploymentSetOptions {
|
|
1257
|
+
labels: string[];
|
|
1258
|
+
}
|
|
1259
|
+
/**
|
|
1260
|
+
* What `domains.set()` may create or change. Every field is optional because
|
|
1261
|
+
* the call is a natural-key upsert: omitting `deployment` reserves the
|
|
1262
|
+
* domain, naming one links or re-points it, and labels travel either way.
|
|
1263
|
+
*
|
|
1264
|
+
* `deployment` is deliberately not nullable — unlinking is refused (400).
|
|
1265
|
+
* See `npm/ship/CLAUDE.md`, "Domain Write Semantics".
|
|
1266
|
+
*/
|
|
1267
|
+
export interface DomainSetOptions {
|
|
1268
|
+
deployment?: string;
|
|
1269
|
+
labels?: string[];
|
|
1270
|
+
}
|
|
1271
|
+
/** What a caller may set when minting a deploy token. */
|
|
1272
|
+
export interface TokenCreateOptions {
|
|
1273
|
+
/** Seconds until expiry; omit for a token that never expires. */
|
|
1274
|
+
ttl?: number;
|
|
1275
|
+
labels?: string[];
|
|
1276
|
+
}
|
|
784
1277
|
/**
|
|
785
1278
|
* Deployment resource interface - the contract all implementations must follow.
|
|
786
1279
|
*
|
|
@@ -793,32 +1286,22 @@ export interface DeploymentResource<UploadOptions extends DeploymentUploadOption
|
|
|
793
1286
|
upload: (input: DeployInput, options?: UploadOptions) => Promise<DeploymentCreateResponse>;
|
|
794
1287
|
list: (options?: ListOptions) => Promise<DeploymentListResponse>;
|
|
795
1288
|
get: (id: string) => Promise<Deployment>;
|
|
796
|
-
set: (id: string, options:
|
|
797
|
-
|
|
798
|
-
}) => Promise<Deployment>;
|
|
799
|
-
remove: (id: string) => Promise<void>;
|
|
1289
|
+
set: (id: string, options: DeploymentSetOptions) => Promise<Deployment>;
|
|
1290
|
+
delete: (id: string) => Promise<DeploymentDeleteResponse>;
|
|
800
1291
|
}
|
|
801
1292
|
/**
|
|
802
1293
|
* Domain resource interface - the contract all implementations must follow
|
|
803
1294
|
*/
|
|
804
1295
|
export interface DomainResource {
|
|
805
|
-
set: (name: string, options?:
|
|
806
|
-
deployment?: string;
|
|
807
|
-
labels?: string[];
|
|
808
|
-
}) => Promise<DomainSetResult>;
|
|
1296
|
+
set: (name: string, options?: DomainSetOptions) => Promise<DomainSetResult>;
|
|
809
1297
|
list: (options?: ListOptions) => Promise<DomainListResponse>;
|
|
810
1298
|
get: (name: string) => Promise<Domain>;
|
|
811
|
-
|
|
812
|
-
verify: (name: string) => Promise<
|
|
813
|
-
message: string;
|
|
814
|
-
}>;
|
|
1299
|
+
delete: (name: string) => Promise<DomainDeleteResponse>;
|
|
1300
|
+
verify: (name: string) => Promise<DomainVerifyResponse>;
|
|
815
1301
|
validate: (name: string) => Promise<DomainValidateResponse>;
|
|
816
1302
|
dns: (name: string) => Promise<DomainDnsResponse>;
|
|
817
1303
|
records: (name: string) => Promise<DomainRecordsResponse>;
|
|
818
|
-
share: (name: string) => Promise<
|
|
819
|
-
domain: string;
|
|
820
|
-
hash: string;
|
|
821
|
-
}>;
|
|
1304
|
+
share: (name: string) => Promise<DomainShareResponse>;
|
|
822
1305
|
}
|
|
823
1306
|
/**
|
|
824
1307
|
* Account resource interface - the contract all implementations must follow
|
|
@@ -830,12 +1313,10 @@ export interface AccountResource {
|
|
|
830
1313
|
* Token resource interface - the contract all implementations must follow
|
|
831
1314
|
*/
|
|
832
1315
|
export interface TokenResource {
|
|
833
|
-
create: (options?:
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
list: () => Promise<TokenListResponse>;
|
|
838
|
-
remove: (token: string) => Promise<void>;
|
|
1316
|
+
create: (options?: TokenCreateOptions) => Promise<TokenCreateResponse>;
|
|
1317
|
+
list: (options?: ListOptions) => Promise<TokenListResponse>;
|
|
1318
|
+
get: (token: string) => Promise<Token>;
|
|
1319
|
+
delete: (token: string) => Promise<TokenDeleteResponse>;
|
|
839
1320
|
}
|
|
840
1321
|
/**
|
|
841
1322
|
* Billing status response from GET /billing/status
|
|
@@ -855,6 +1336,25 @@ export interface BillingStatus {
|
|
|
855
1336
|
/** Link to Creem customer portal for billing management, null if unavailable */
|
|
856
1337
|
portal: string | null;
|
|
857
1338
|
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Acknowledgement of `POST /billing/cancel`.
|
|
1341
|
+
*
|
|
1342
|
+
* Cancelling leaves no billing entity to return, so it answers with the
|
|
1343
|
+
* account and the one field of the account the call changed — the plan it
|
|
1344
|
+
* landed on. See {@link DeploymentDeleteResponse} for the law.
|
|
1345
|
+
*
|
|
1346
|
+
* This read `{ success: true, message: 'Subscription canceled successfully…' }`
|
|
1347
|
+
* until 2026-07-29, an anonymous shape that `web/my` redeclared inline and
|
|
1348
|
+
* whose prose no surface ever displayed: both callers await the promise and
|
|
1349
|
+
* discard the body, then compose their own toast. The message was written,
|
|
1350
|
+
* serialized, and thrown away on every cancellation.
|
|
1351
|
+
*/
|
|
1352
|
+
export interface BillingCancelResponse {
|
|
1353
|
+
/** The account whose subscription was cancelled */
|
|
1354
|
+
readonly account: string;
|
|
1355
|
+
/** The plan the account now holds — `free` on a successful cancellation */
|
|
1356
|
+
readonly plan: AccountPlanType;
|
|
1357
|
+
}
|
|
858
1358
|
/**
|
|
859
1359
|
* Checkout session response from POST /billing/checkout
|
|
860
1360
|
*/
|
|
@@ -929,7 +1429,7 @@ export interface ActivityMeta {
|
|
|
929
1429
|
/**
|
|
930
1430
|
* Response from GET /activities endpoint
|
|
931
1431
|
*/
|
|
932
|
-
export interface ActivityListResponse {
|
|
1432
|
+
export interface ActivityListResponse extends ListResponse {
|
|
933
1433
|
/** Array of activities */
|
|
934
1434
|
activities: Activity[];
|
|
935
1435
|
}
|