@shipstatic/ship 2.0.0-beta.4 → 2.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +367 -81
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +27 -27
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +367 -81
- package/dist/index.d.ts +367 -81
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser.d.ts
CHANGED
|
@@ -49,16 +49,122 @@ interface DeploymentCreateResponse extends Deployment {
|
|
|
49
49
|
/** Claim URL for public deployments. Present when deployed without credentials. */
|
|
50
50
|
readonly claim?: string;
|
|
51
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
|
+
}
|
|
52
126
|
/**
|
|
53
127
|
* Response for listing deployments
|
|
54
128
|
*/
|
|
55
|
-
interface DeploymentListResponse {
|
|
129
|
+
interface DeploymentListResponse extends ListResponse {
|
|
56
130
|
/** Array of deployments */
|
|
57
131
|
deployments: Deployment[];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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;
|
|
62
168
|
}
|
|
63
169
|
/**
|
|
64
170
|
* Domain status constants
|
|
@@ -91,7 +197,7 @@ interface Domain {
|
|
|
91
197
|
labels: string[];
|
|
92
198
|
/** Unix timestamp (seconds) when domain was created */
|
|
93
199
|
readonly created: number;
|
|
94
|
-
/**
|
|
200
|
+
/** Unix timestamp (seconds) when deployment was last linked, null if never linked */
|
|
95
201
|
linked: number | null;
|
|
96
202
|
/** Total deployment links */
|
|
97
203
|
links: number;
|
|
@@ -113,13 +219,28 @@ interface DomainSetResult extends Domain {
|
|
|
113
219
|
/**
|
|
114
220
|
* Response for listing domains
|
|
115
221
|
*/
|
|
116
|
-
interface DomainListResponse {
|
|
222
|
+
interface DomainListResponse extends ListResponse {
|
|
117
223
|
/** Array of domains */
|
|
118
224
|
domains: Domain[];
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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;
|
|
123
244
|
}
|
|
124
245
|
/**
|
|
125
246
|
* DNS record types supported for domain configuration
|
|
@@ -146,13 +267,33 @@ interface DnsProvider {
|
|
|
146
267
|
/**
|
|
147
268
|
* Response for domain DNS provider lookup
|
|
148
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
|
+
}
|
|
149
279
|
interface DomainDnsResponse {
|
|
150
280
|
/** The domain name */
|
|
151
281
|
domain: string;
|
|
152
282
|
/** DNS provider information, null if not yet looked up */
|
|
153
|
-
dns:
|
|
154
|
-
|
|
155
|
-
|
|
283
|
+
dns: DnsLookup | null;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Response for `GET /domains/:domain/share` — the domain plus the salted
|
|
287
|
+
* hash that lets someone else complete its DNS setup without an account.
|
|
288
|
+
*
|
|
289
|
+
* `/admin/domains/:domain/share` answers the same shape, which is the admin
|
|
290
|
+
* law working: the operator surface is the public grammar with a prefix.
|
|
291
|
+
*/
|
|
292
|
+
interface DomainShareResponse {
|
|
293
|
+
/** The domain the setup link is for */
|
|
294
|
+
readonly domain: string;
|
|
295
|
+
/** The salted setup hash that authorizes the share */
|
|
296
|
+
readonly hash: string;
|
|
156
297
|
}
|
|
157
298
|
/**
|
|
158
299
|
* Response for domain DNS records
|
|
@@ -165,6 +306,53 @@ interface DomainRecordsResponse {
|
|
|
165
306
|
/** Required DNS records for configuration */
|
|
166
307
|
records: DnsRecord[];
|
|
167
308
|
}
|
|
309
|
+
/**
|
|
310
|
+
* The envelope an `Idempotency-Key` must fit, and how long a replay lasts.
|
|
311
|
+
*
|
|
312
|
+
* Format lives here rather than on the server alone by the format-vs-policy
|
|
313
|
+
* rule: a client can decide offline whether a key is well-formed, and the
|
|
314
|
+
* API would reject the same value the same way.
|
|
315
|
+
*/
|
|
316
|
+
declare const IDEMPOTENCY_KEY_CONSTRAINTS: {
|
|
317
|
+
readonly MAX_LENGTH: 256;
|
|
318
|
+
/** How long a stored 201 stays replayable. */
|
|
319
|
+
readonly WINDOW_SECONDS: number;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Validate an idempotency key, returning the trimmed value or `undefined`
|
|
323
|
+
* when none was supplied. Throws {@link ShipError.validation} when the value
|
|
324
|
+
* cannot be sent — the same verdict the API would reach, reached earlier.
|
|
325
|
+
*/
|
|
326
|
+
declare function validateIdempotencyKey(value: unknown): string | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* Response for `GET /labels` — every label in use across the caller's
|
|
329
|
+
* deployments, domains and tokens, grouped and ordered by last use.
|
|
330
|
+
*
|
|
331
|
+
* The one plural noun outside the list contract, deliberately: labels have
|
|
332
|
+
* no identity, no row and no `created`, so there is nothing for a keyset
|
|
333
|
+
* cursor to resume after, and its consumer is an autocomplete that wants the
|
|
334
|
+
* whole set. Bounded by `PAGINATION.GLOBAL_LIMIT` rather than paginated.
|
|
335
|
+
*/
|
|
336
|
+
interface LabelsResponse {
|
|
337
|
+
readonly labels: string[];
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Response for `POST /setup` — the DNS instructions for one domain, written
|
|
341
|
+
* for a human to follow at their registrar.
|
|
342
|
+
*
|
|
343
|
+
* `custom` is the provider-specific walkthrough when the provider is known;
|
|
344
|
+
* `generic` always answers, so a caller never has nothing to show.
|
|
345
|
+
*/
|
|
346
|
+
interface SetupInstructionsResponse {
|
|
347
|
+
/** One-line summary of what to do */
|
|
348
|
+
readonly tldr: string;
|
|
349
|
+
/** Provider-specific instructions, null when the provider is unknown */
|
|
350
|
+
readonly custom: string | null;
|
|
351
|
+
/** Provider-agnostic instructions — always present */
|
|
352
|
+
readonly generic: string;
|
|
353
|
+
/** The identified DNS provider, null when unknown */
|
|
354
|
+
readonly provider: string | null;
|
|
355
|
+
}
|
|
168
356
|
/**
|
|
169
357
|
* Response for domain validation
|
|
170
358
|
*/
|
|
@@ -179,11 +367,13 @@ interface DomainValidateResponse {
|
|
|
179
367
|
error: string | null;
|
|
180
368
|
}
|
|
181
369
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
370
|
+
* Core deploy token object - used in both API responses and SDK.
|
|
371
|
+
*
|
|
372
|
+
* The secret is never here: it is shown once at creation
|
|
373
|
+
* ({@link TokenCreateResponse.secret}) and never again, so an entity read
|
|
374
|
+
* carries only the management identifier and lifecycle metadata.
|
|
185
375
|
*/
|
|
186
|
-
interface
|
|
376
|
+
interface Token {
|
|
187
377
|
/** 7-char management identifier (e.g., "a1b2c3d") */
|
|
188
378
|
readonly token: string;
|
|
189
379
|
/** Labels for categorization and filtering. Always present, empty array when none. */
|
|
@@ -198,26 +388,28 @@ interface TokenListItem {
|
|
|
198
388
|
/**
|
|
199
389
|
* Response for listing tokens
|
|
200
390
|
*/
|
|
201
|
-
interface TokenListResponse {
|
|
202
|
-
/** Array of tokens (
|
|
203
|
-
tokens:
|
|
204
|
-
/** Cursor for pagination, null if no more pages */
|
|
205
|
-
cursor: string | null;
|
|
206
|
-
/** Total number of tokens */
|
|
207
|
-
total: number;
|
|
391
|
+
interface TokenListResponse extends ListResponse {
|
|
392
|
+
/** Array of tokens (the secret is never among them) */
|
|
393
|
+
tokens: Token[];
|
|
208
394
|
}
|
|
209
395
|
/**
|
|
210
|
-
* Response
|
|
396
|
+
* Response from token creation. Extends Token with the one field that
|
|
397
|
+
* exists only on creation — the same shape as
|
|
398
|
+
* {@link DeploymentCreateResponse}, because a 201 returns the resource it
|
|
399
|
+
* created plus whatever is knowable only once.
|
|
211
400
|
*/
|
|
212
|
-
interface TokenCreateResponse {
|
|
213
|
-
/** 7-char management identifier */
|
|
214
|
-
token: string;
|
|
401
|
+
interface TokenCreateResponse extends Token {
|
|
215
402
|
/** The raw credential value (shown once at creation, then never again) */
|
|
216
|
-
secret: string;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
403
|
+
readonly secret: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Acknowledgement of `DELETE /tokens/:token`. The credential is revoked and
|
|
407
|
+
* its row is gone, so the management identifier is the whole answer. See
|
|
408
|
+
* {@link DeploymentDeleteResponse} for the law.
|
|
409
|
+
*/
|
|
410
|
+
interface TokenDeleteResponse {
|
|
411
|
+
/** The 7-char management identifier that was revoked */
|
|
412
|
+
readonly token: string;
|
|
221
413
|
}
|
|
222
414
|
/**
|
|
223
415
|
* Account plan constants
|
|
@@ -234,10 +426,34 @@ declare const AccountPlan: {
|
|
|
234
426
|
type AccountPlanType = (typeof AccountPlan)[keyof typeof AccountPlan];
|
|
235
427
|
/**
|
|
236
428
|
* Account usage metrics — always available regardless of billing provider.
|
|
429
|
+
*
|
|
430
|
+
* This is where a caller's own totals live. Lists answer pages and carry no
|
|
431
|
+
* `total` (see {@link ListOptions}); a count is an aggregate over a
|
|
432
|
+
* collection, so it belongs to the summary resource that owns the
|
|
433
|
+
* collection. `GET /account` is that resource for one caller, `GET
|
|
434
|
+
* /admin/stats` for the platform.
|
|
435
|
+
*
|
|
436
|
+
* The counted dimensions are the ones the plan caps — deployments and
|
|
437
|
+
* domains (`PlatformLimits`) — plus the billable custom-domain subset, so a
|
|
438
|
+
* surface can render "3 of 10" without a second request.
|
|
237
439
|
*/
|
|
238
440
|
interface AccountUsage {
|
|
239
441
|
/** Number of active custom domains (excludes paused) */
|
|
240
442
|
customDomains: number;
|
|
443
|
+
/**
|
|
444
|
+
* Deployments counted against the plan's deployment cap — every row
|
|
445
|
+
* whatever its status, because that is what the cap counts, so a surface
|
|
446
|
+
* renders "3 of 10" against the denominator the 403 divides by. (`GET
|
|
447
|
+
* /deployments` lists successful ones only; that is a different question
|
|
448
|
+
* asked of a different resource.) Optional by the additive-evolution law:
|
|
449
|
+
* an API predating this field omits it.
|
|
450
|
+
*/
|
|
451
|
+
deployments?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Domains counted against the plan's domain cap — every domain, platform
|
|
454
|
+
* and custom alike, unlike `customDomains`. Optional for the same reason.
|
|
455
|
+
*/
|
|
456
|
+
domains?: number;
|
|
241
457
|
}
|
|
242
458
|
/**
|
|
243
459
|
* Core account object - used in both API responses and SDK
|
|
@@ -284,6 +500,32 @@ interface AccountGetResponse extends Account {
|
|
|
284
500
|
/** Present only during read-only admin impersonation: the operator's account id. */
|
|
285
501
|
readonly impersonatedBy?: string;
|
|
286
502
|
}
|
|
503
|
+
/**
|
|
504
|
+
* Acknowledgement of `DELETE /account` (202). Termination is asynchronous —
|
|
505
|
+
* a cleanup consumer finishes the job — so the account survives long enough
|
|
506
|
+
* to state the plan it is transitioning through. `plan` is the account's
|
|
507
|
+
* state field, the way `status` is a deployment's. See
|
|
508
|
+
* {@link DeploymentDeleteResponse} for the law.
|
|
509
|
+
*/
|
|
510
|
+
interface AccountDeleteResponse {
|
|
511
|
+
/** The account that was marked for termination */
|
|
512
|
+
readonly account: string;
|
|
513
|
+
/** The plan the account is in while cleanup runs */
|
|
514
|
+
readonly plan: AccountPlanType;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Response from `PUT /account/key` — the account's single API key, minted in
|
|
518
|
+
* place of whatever was there before.
|
|
519
|
+
*
|
|
520
|
+
* There is no entity to return: only the key's last-4 `hint` is durable
|
|
521
|
+
* (`Account.hint`), and the plaintext exists exactly once, in this response.
|
|
522
|
+
* The raw credential is `secret` on every surface that mints one — the same
|
|
523
|
+
* field `TokenCreateResponse` carries — because one concept gets one name.
|
|
524
|
+
*/
|
|
525
|
+
interface AccountKeyResponse {
|
|
526
|
+
/** The raw API key (shown once at mint, then never again) */
|
|
527
|
+
readonly secret: string;
|
|
528
|
+
}
|
|
287
529
|
/**
|
|
288
530
|
* Account-specific configuration overrides
|
|
289
531
|
* Allows per-account customization of limits without changing plan
|
|
@@ -731,16 +973,22 @@ interface SPACheckRequest {
|
|
|
731
973
|
/**
|
|
732
974
|
* Response from SPA check endpoint
|
|
733
975
|
*/
|
|
976
|
+
/**
|
|
977
|
+
* Which of the classifier's tiers reached the verdict, and why. Named rather
|
|
978
|
+
* than inline so the API's own `checkSPA` can return `SPACheckResponse`
|
|
979
|
+
* instead of restating its shape.
|
|
980
|
+
*/
|
|
981
|
+
interface SPACheckDebug {
|
|
982
|
+
/** Which tier made the detection */
|
|
983
|
+
tier: 'exclusions' | 'inclusions' | 'scoring' | 'ai' | 'fallback';
|
|
984
|
+
/** The reason for the detection result */
|
|
985
|
+
reason: string;
|
|
986
|
+
}
|
|
734
987
|
interface SPACheckResponse {
|
|
735
988
|
/** Whether the project is detected as a Single Page Application */
|
|
736
989
|
isSPA: boolean;
|
|
737
990
|
/** Debugging information about detection */
|
|
738
|
-
debug:
|
|
739
|
-
/** Which tier made the detection: 'exclusions', 'inclusions', 'scoring', 'ai', or 'fallback' */
|
|
740
|
-
tier: 'exclusions' | 'inclusions' | 'scoring' | 'ai' | 'fallback';
|
|
741
|
-
/** The reason for the detection result */
|
|
742
|
-
reason: string;
|
|
743
|
-
};
|
|
991
|
+
debug: SPACheckDebug;
|
|
744
992
|
}
|
|
745
993
|
/**
|
|
746
994
|
* Represents a file that has been processed and is ready for deploy.
|
|
@@ -812,12 +1060,41 @@ interface DeploymentUploadOptions {
|
|
|
812
1060
|
spa?: boolean;
|
|
813
1061
|
/** @internal reCAPTCHA proof for the anonymous human deploy channel. Only available via /upload endpoint. */
|
|
814
1062
|
captcha?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* Makes this deploy replayable instead of repeatable.
|
|
1065
|
+
*
|
|
1066
|
+
* A deploy is not naturally idempotent: a client-side timeout on a slow
|
|
1067
|
+
* one leaves the caller unable to tell "it never landed" from "it landed
|
|
1068
|
+
* and the response was lost", and retrying produces a second deployment.
|
|
1069
|
+
* Send the same key on the retry and the platform replays the original
|
|
1070
|
+
* 201 verbatim rather than creating anything
|
|
1071
|
+
* ({@link IDEMPOTENCY_KEY_CONSTRAINTS.WINDOW_SECONDS}).
|
|
1072
|
+
*
|
|
1073
|
+
* **Agents are the audience.** A human notices a duplicate; an automated
|
|
1074
|
+
* retry does not. Pick a key that identifies the ATTEMPT — a run id, a
|
|
1075
|
+
* commit sha, a uuid minted before the first try — never one that varies
|
|
1076
|
+
* per attempt, which would defeat the point.
|
|
1077
|
+
*
|
|
1078
|
+
* The replay is per-caller, and it stores successes only: a failed deploy
|
|
1079
|
+
* retries fresh under the same key.
|
|
1080
|
+
*/
|
|
1081
|
+
idempotencyKey?: string;
|
|
815
1082
|
}
|
|
816
1083
|
/**
|
|
817
|
-
* Pagination options for
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
*
|
|
1084
|
+
* Pagination options for every list endpoint. The response's `cursor` feeds
|
|
1085
|
+
* the next request; a `null` cursor means the last page. Omitting both
|
|
1086
|
+
* returns the server's default first page.
|
|
1087
|
+
*
|
|
1088
|
+
* A list answers `{ <collection>, cursor }` and nothing else — `cursor`
|
|
1089
|
+
* carries the entire has-more signal, so no redundant boolean, and no
|
|
1090
|
+
* `total`. **A count is an aggregate over a collection, not a property of a
|
|
1091
|
+
* page:** including one makes every read pay for a full scan it did not ask
|
|
1092
|
+
* for, which is precisely the cost keyset pagination exists to avoid.
|
|
1093
|
+
*
|
|
1094
|
+
* Counts therefore live on the summary resource that owns them —
|
|
1095
|
+
* `GET /account` (`usage`) for a caller's own totals, `GET /admin/stats` for
|
|
1096
|
+
* platform-wide ones. Ask for a count when you want a count; ask for a page
|
|
1097
|
+
* when you want a page.
|
|
821
1098
|
*/
|
|
822
1099
|
interface ListOptions {
|
|
823
1100
|
/** Maximum number of items to return in one page. */
|
|
@@ -825,6 +1102,33 @@ interface ListOptions {
|
|
|
825
1102
|
/** Opaque cursor from the previous page's response. */
|
|
826
1103
|
cursor?: string;
|
|
827
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* What a caller may change on an existing deployment.
|
|
1107
|
+
*
|
|
1108
|
+
* Labels and nothing else: a deployment's content is immutable by design, so
|
|
1109
|
+
* this is the whole mutable surface rather than a subset someone chose.
|
|
1110
|
+
*/
|
|
1111
|
+
interface DeploymentSetOptions {
|
|
1112
|
+
labels: string[];
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* What `domains.set()` may create or change. Every field is optional because
|
|
1116
|
+
* the call is a natural-key upsert: omitting `deployment` reserves the
|
|
1117
|
+
* domain, naming one links or re-points it, and labels travel either way.
|
|
1118
|
+
*
|
|
1119
|
+
* `deployment` is deliberately not nullable — unlinking is refused (400).
|
|
1120
|
+
* See `npm/ship/CLAUDE.md`, "Domain Write Semantics".
|
|
1121
|
+
*/
|
|
1122
|
+
interface DomainSetOptions {
|
|
1123
|
+
deployment?: string;
|
|
1124
|
+
labels?: string[];
|
|
1125
|
+
}
|
|
1126
|
+
/** What a caller may set when minting a deploy token. */
|
|
1127
|
+
interface TokenCreateOptions {
|
|
1128
|
+
/** Seconds until expiry; omit for a token that never expires. */
|
|
1129
|
+
ttl?: number;
|
|
1130
|
+
labels?: string[];
|
|
1131
|
+
}
|
|
828
1132
|
/**
|
|
829
1133
|
* Deployment resource interface - the contract all implementations must follow.
|
|
830
1134
|
*
|
|
@@ -837,32 +1141,22 @@ interface DeploymentResource<UploadOptions extends DeploymentUploadOptions = Dep
|
|
|
837
1141
|
upload: (input: DeployInput, options?: UploadOptions) => Promise<DeploymentCreateResponse>;
|
|
838
1142
|
list: (options?: ListOptions) => Promise<DeploymentListResponse>;
|
|
839
1143
|
get: (id: string) => Promise<Deployment>;
|
|
840
|
-
set: (id: string, options:
|
|
841
|
-
|
|
842
|
-
}) => Promise<Deployment>;
|
|
843
|
-
remove: (id: string) => Promise<void>;
|
|
1144
|
+
set: (id: string, options: DeploymentSetOptions) => Promise<Deployment>;
|
|
1145
|
+
remove: (id: string) => Promise<DeploymentDeleteResponse>;
|
|
844
1146
|
}
|
|
845
1147
|
/**
|
|
846
1148
|
* Domain resource interface - the contract all implementations must follow
|
|
847
1149
|
*/
|
|
848
1150
|
interface DomainResource {
|
|
849
|
-
set: (name: string, options?:
|
|
850
|
-
deployment?: string;
|
|
851
|
-
labels?: string[];
|
|
852
|
-
}) => Promise<DomainSetResult>;
|
|
1151
|
+
set: (name: string, options?: DomainSetOptions) => Promise<DomainSetResult>;
|
|
853
1152
|
list: (options?: ListOptions) => Promise<DomainListResponse>;
|
|
854
1153
|
get: (name: string) => Promise<Domain>;
|
|
855
|
-
remove: (name: string) => Promise<
|
|
856
|
-
verify: (name: string) => Promise<
|
|
857
|
-
message: string;
|
|
858
|
-
}>;
|
|
1154
|
+
remove: (name: string) => Promise<DomainDeleteResponse>;
|
|
1155
|
+
verify: (name: string) => Promise<DomainVerifyResponse>;
|
|
859
1156
|
validate: (name: string) => Promise<DomainValidateResponse>;
|
|
860
1157
|
dns: (name: string) => Promise<DomainDnsResponse>;
|
|
861
1158
|
records: (name: string) => Promise<DomainRecordsResponse>;
|
|
862
|
-
share: (name: string) => Promise<
|
|
863
|
-
domain: string;
|
|
864
|
-
hash: string;
|
|
865
|
-
}>;
|
|
1159
|
+
share: (name: string) => Promise<DomainShareResponse>;
|
|
866
1160
|
}
|
|
867
1161
|
/**
|
|
868
1162
|
* Account resource interface - the contract all implementations must follow
|
|
@@ -874,12 +1168,10 @@ interface AccountResource {
|
|
|
874
1168
|
* Token resource interface - the contract all implementations must follow
|
|
875
1169
|
*/
|
|
876
1170
|
interface TokenResource {
|
|
877
|
-
create: (options?:
|
|
878
|
-
ttl?: number;
|
|
879
|
-
labels?: string[];
|
|
880
|
-
}) => Promise<TokenCreateResponse>;
|
|
1171
|
+
create: (options?: TokenCreateOptions) => Promise<TokenCreateResponse>;
|
|
881
1172
|
list: (options?: ListOptions) => Promise<TokenListResponse>;
|
|
882
|
-
|
|
1173
|
+
get: (token: string) => Promise<Token>;
|
|
1174
|
+
remove: (token: string) => Promise<TokenDeleteResponse>;
|
|
883
1175
|
}
|
|
884
1176
|
/**
|
|
885
1177
|
* Billing status response from GET /billing/status
|
|
@@ -973,13 +1265,9 @@ interface ActivityMeta {
|
|
|
973
1265
|
/**
|
|
974
1266
|
* Response from GET /activities endpoint
|
|
975
1267
|
*/
|
|
976
|
-
interface ActivityListResponse {
|
|
1268
|
+
interface ActivityListResponse extends ListResponse {
|
|
977
1269
|
/** Array of activities */
|
|
978
1270
|
activities: Activity[];
|
|
979
|
-
/** Cursor for pagination, null if no more pages */
|
|
980
|
-
cursor: string | null;
|
|
981
|
-
/** Total number of activities */
|
|
982
|
-
total: number;
|
|
983
1271
|
}
|
|
984
1272
|
/**
|
|
985
1273
|
* File status constants for validation state tracking
|
|
@@ -1395,6 +1683,8 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
1395
1683
|
private readonly session;
|
|
1396
1684
|
private readonly caller;
|
|
1397
1685
|
private readonly timeout;
|
|
1686
|
+
private readonly deployTimeout;
|
|
1687
|
+
private readonly deployBuildTimeout;
|
|
1398
1688
|
private readonly fetch;
|
|
1399
1689
|
private readonly createDeployBody;
|
|
1400
1690
|
private readonly deployEndpoint;
|
|
@@ -1425,24 +1715,20 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
1425
1715
|
listDeployments(options?: ListOptions): Promise<DeploymentListResponse>;
|
|
1426
1716
|
getDeployment(id: string): Promise<Deployment>;
|
|
1427
1717
|
updateDeploymentLabels(id: string, labels: string[]): Promise<Deployment>;
|
|
1428
|
-
removeDeployment(id: string): Promise<
|
|
1718
|
+
removeDeployment(id: string): Promise<DeploymentDeleteResponse>;
|
|
1429
1719
|
setDomain(name: string, deployment?: string, labels?: string[]): Promise<DomainSetResult>;
|
|
1430
1720
|
listDomains(options?: ListOptions): Promise<DomainListResponse>;
|
|
1431
1721
|
getDomain(name: string): Promise<Domain>;
|
|
1432
|
-
removeDomain(name: string): Promise<
|
|
1433
|
-
verifyDomain(name: string): Promise<
|
|
1434
|
-
message: string;
|
|
1435
|
-
}>;
|
|
1722
|
+
removeDomain(name: string): Promise<DomainDeleteResponse>;
|
|
1723
|
+
verifyDomain(name: string): Promise<DomainVerifyResponse>;
|
|
1436
1724
|
getDomainDns(name: string): Promise<DomainDnsResponse>;
|
|
1437
1725
|
getDomainRecords(name: string): Promise<DomainRecordsResponse>;
|
|
1438
|
-
getDomainShare(name: string): Promise<
|
|
1439
|
-
domain: string;
|
|
1440
|
-
hash: string;
|
|
1441
|
-
}>;
|
|
1726
|
+
getDomainShare(name: string): Promise<DomainShareResponse>;
|
|
1442
1727
|
validateDomain(name: string): Promise<DomainValidateResponse>;
|
|
1443
1728
|
createToken(ttl?: number, labels?: string[]): Promise<TokenCreateResponse>;
|
|
1444
1729
|
listTokens(options?: ListOptions): Promise<TokenListResponse>;
|
|
1445
|
-
removeToken(token: string): Promise<
|
|
1730
|
+
removeToken(token: string): Promise<TokenDeleteResponse>;
|
|
1731
|
+
getToken(token: string): Promise<Token>;
|
|
1446
1732
|
getAccount(): Promise<AccountGetResponse>;
|
|
1447
1733
|
getLimits(): Promise<PlatformLimits>;
|
|
1448
1734
|
ping(): Promise<boolean>;
|
|
@@ -1876,4 +2162,4 @@ declare class Ship extends Ship$1 {
|
|
|
1876
2162
|
protected getDeployBodyCreator(): DeployBodyCreator;
|
|
1877
2163
|
}
|
|
1878
2164
|
|
|
1879
|
-
export { API_KEY, AUTH_BASE_PATH, type Account, type AccountGetResponse, 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 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 DeploymentListResponse, type DeploymentOptions, type DeploymentResource, type DeploymentResourceContext, DeploymentStatus, type DeploymentStatusType, type DeploymentUploadOptions, type DnsProvider, type DnsRecord, type DnsRecordType, type Domain, type DomainDnsResponse, type DomainListResponse, type DomainRecordsResponse, type DomainResource, type DomainSetResult, DomainStatus, type DomainStatusType, type DomainValidateResponse, type ErrorResponse, ErrorType, type ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, type Fetch, type FileValidationResult, FileValidationStatus, type FileValidationStatusType, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, type ListOptions, type MD5Result, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, type PingResponse, type PlatformLimits, type ResourceContext, type SPACheckRequest, type SPACheckResponse, SPA_DEFAULT_CONFIG, Ship, type ShipClientOptions, ShipError, type ShipEvents, type StaticFile, type
|
|
2165
|
+
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 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, processFilesForBrowser, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validatePassword, validateToken };
|