@shipstatic/ship 2.0.0-beta.2 → 2.0.0-beta.4
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 +10 -10
- package/dist/browser.d.ts +126 -81
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +29 -29
- package/dist/cli.cjs.map +1 -1
- package/dist/completions/ship.fish +1 -1
- package/dist/completions/ship.zsh +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -81
- package/dist/index.d.ts +126 -81
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +35 -29
package/dist/index.d.cts
CHANGED
|
@@ -201,6 +201,8 @@ interface TokenListItem {
|
|
|
201
201
|
interface TokenListResponse {
|
|
202
202
|
/** Array of tokens (security-redacted for list display) */
|
|
203
203
|
tokens: TokenListItem[];
|
|
204
|
+
/** Cursor for pagination, null if no more pages */
|
|
205
|
+
cursor: string | null;
|
|
204
206
|
/** Total number of tokens */
|
|
205
207
|
total: number;
|
|
206
208
|
}
|
|
@@ -258,6 +260,13 @@ interface Account {
|
|
|
258
260
|
readonly activated: number | null;
|
|
259
261
|
/** Last 4 characters of the API key for identification, null when no key generated */
|
|
260
262
|
readonly hint: string | null;
|
|
263
|
+
/**
|
|
264
|
+
* Unix timestamp (seconds) of the API key's last use, null when never
|
|
265
|
+
* used or no key generated. Optional on the type by the additive-evolution
|
|
266
|
+
* law: published SDK versions may predate the field, so consumers read it
|
|
267
|
+
* when present rather than forcing a lockstep SDK release.
|
|
268
|
+
*/
|
|
269
|
+
readonly used?: number | null;
|
|
261
270
|
/** Grace period expiration (unix seconds), null if no grace period active */
|
|
262
271
|
readonly grace: number | null;
|
|
263
272
|
}
|
|
@@ -414,6 +423,18 @@ declare class ShipError extends Error {
|
|
|
414
423
|
static file(message: string, details?: unknown): ShipError;
|
|
415
424
|
static config(message: string, details?: unknown): ShipError;
|
|
416
425
|
static api(message: string, status?: number, details?: unknown): ShipError;
|
|
426
|
+
/**
|
|
427
|
+
* The caller is at fault — by HTTP's own definition of a 4xx, or by a type
|
|
428
|
+
* that is client-attributable without ever having a status (`Config`,
|
|
429
|
+
* `File`, raised locally by the SDK).
|
|
430
|
+
*
|
|
431
|
+
* Both arms are load-bearing, because type and status are independent
|
|
432
|
+
* axes. `fromHttpResponse` trusts `body.error` only when it names a
|
|
433
|
+
* server-producible type; a non-OK response without one is status-derived,
|
|
434
|
+
* so a CDN 404 or any intermediary error arrives as `Api` — a server-fault
|
|
435
|
+
* *type* carrying a client *status*. Judging by type alone would report it
|
|
436
|
+
* as a platform failure and bury the server's own message.
|
|
437
|
+
*/
|
|
417
438
|
isClientError(): boolean;
|
|
418
439
|
isNetworkError(): boolean;
|
|
419
440
|
isAuthError(): boolean;
|
|
@@ -515,9 +536,17 @@ declare function hasUnbuiltMarker(filePath: string): boolean;
|
|
|
515
536
|
interface PingResponse {
|
|
516
537
|
/** Always true if service is healthy */
|
|
517
538
|
success: boolean;
|
|
518
|
-
/**
|
|
539
|
+
/** Server time in unix seconds — the one wire unit for timestamps. */
|
|
519
540
|
timestamp?: number;
|
|
520
541
|
}
|
|
542
|
+
/**
|
|
543
|
+
* Where human identity is mounted on the API host. The API mounts Better
|
|
544
|
+
* Auth at this path (sign-in, sign-out, session reads, admin impersonation)
|
|
545
|
+
* and the web console's auth client posts to it — shared here so the two
|
|
546
|
+
* halves of the auth pair agree by construction, the same way both sides
|
|
547
|
+
* already share the credential prefixes below.
|
|
548
|
+
*/
|
|
549
|
+
declare const AUTH_BASE_PATH = "/auth";
|
|
521
550
|
/**
|
|
522
551
|
* How a request (or recorded activity) was authorized.
|
|
523
552
|
*
|
|
@@ -630,6 +659,36 @@ declare const SPA_DEFAULT_CONFIG: {
|
|
|
630
659
|
readonly destination: "/index.html";
|
|
631
660
|
}];
|
|
632
661
|
};
|
|
662
|
+
/**
|
|
663
|
+
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
664
|
+
* never schema.
|
|
665
|
+
*
|
|
666
|
+
* ship.json is validated and compiled on the server, deliberately: the schema
|
|
667
|
+
* and the compiler evolve, and a client that judged them would reject configs
|
|
668
|
+
* a newer platform accepts. That reasoning bounds what a client may check to
|
|
669
|
+
* the properties which are true of *every* past and future schema:
|
|
670
|
+
*
|
|
671
|
+
* 1. it parses as JSON — JSON syntax is frozen (RFC 8259), so text that
|
|
672
|
+
* does not parse can never be a valid config;
|
|
673
|
+
* 2. its top level is an object — ship.json is `{ ... }` in every version.
|
|
674
|
+
*
|
|
675
|
+
* Both are monotonic: neither can ever reject something the server would
|
|
676
|
+
* accept. Everything beyond them (field names, types, rule semantics, which
|
|
677
|
+
* keys are permitted) stays server-side, where it can change.
|
|
678
|
+
*
|
|
679
|
+
* The payoff is the common case. Hand-edited JSON fails on a trailing comma,
|
|
680
|
+
* a `//` comment, single quotes, unquoted keys, or smart quotes pasted from
|
|
681
|
+
* documentation — mistakes that otherwise cost a full upload round-trip to
|
|
682
|
+
* discover. A UTF-8 BOM (Windows editors, PowerShell redirects) is stripped
|
|
683
|
+
* before parsing rather than rejected, because the server accepts it too;
|
|
684
|
+
* diverging there would reintroduce exactly the false rejection this
|
|
685
|
+
* function exists to avoid.
|
|
686
|
+
*
|
|
687
|
+
* @throws {ShipError} `ErrorType.Config` — the same type the server's own
|
|
688
|
+
* config rejection carries, so the error contract is identical wherever the
|
|
689
|
+
* failure is detected.
|
|
690
|
+
*/
|
|
691
|
+
declare function assertShipJsonSyntax(text: string): void;
|
|
633
692
|
/**
|
|
634
693
|
* Validate API key format
|
|
635
694
|
*/
|
|
@@ -712,20 +771,6 @@ interface StaticFile {
|
|
|
712
771
|
/** The size of the file in bytes. */
|
|
713
772
|
size: number;
|
|
714
773
|
}
|
|
715
|
-
/**
|
|
716
|
-
* Progress information for deploy/upload operations.
|
|
717
|
-
* Provides consistent percentage-based progress with byte-level details.
|
|
718
|
-
*/
|
|
719
|
-
interface ProgressInfo {
|
|
720
|
-
/** Progress percentage (0-100) */
|
|
721
|
-
percent: number;
|
|
722
|
-
/** Number of bytes loaded so far */
|
|
723
|
-
loaded: number;
|
|
724
|
-
/** Total number of bytes to load. May be 0 if unknown initially */
|
|
725
|
-
total: number;
|
|
726
|
-
/** Current file being processed (optional) */
|
|
727
|
-
file?: string;
|
|
728
|
-
}
|
|
729
774
|
/** Default API URL if not otherwise configured. */
|
|
730
775
|
declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
731
776
|
/**
|
|
@@ -769,11 +814,28 @@ interface DeploymentUploadOptions {
|
|
|
769
814
|
captcha?: string;
|
|
770
815
|
}
|
|
771
816
|
/**
|
|
772
|
-
*
|
|
817
|
+
* Pagination options for the paginated list endpoints (`GET /deployments`,
|
|
818
|
+
* `GET /domains`). The response's `cursor` feeds the next request; a `null`
|
|
819
|
+
* cursor on the response means the last page. Omitting both returns the
|
|
820
|
+
* server's default first page.
|
|
821
|
+
*/
|
|
822
|
+
interface ListOptions {
|
|
823
|
+
/** Maximum number of items to return in one page. */
|
|
824
|
+
limit?: number;
|
|
825
|
+
/** Opaque cursor from the previous page's response. */
|
|
826
|
+
cursor?: string;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Deployment resource interface - the contract all implementations must follow.
|
|
830
|
+
*
|
|
831
|
+
* The interface defines the minimal wire contract; SDK implementations may
|
|
832
|
+
* extend the upload options with runtime concerns (timeout, signal, progress
|
|
833
|
+
* callbacks) by parameterizing: `DeploymentResource<MyUploadOptions>`. The
|
|
834
|
+
* default keeps plain `DeploymentResource` valid for wire-only consumers.
|
|
773
835
|
*/
|
|
774
|
-
interface DeploymentResource {
|
|
775
|
-
upload: (input: DeployInput, options?:
|
|
776
|
-
list: () => Promise<DeploymentListResponse>;
|
|
836
|
+
interface DeploymentResource<UploadOptions extends DeploymentUploadOptions = DeploymentUploadOptions> {
|
|
837
|
+
upload: (input: DeployInput, options?: UploadOptions) => Promise<DeploymentCreateResponse>;
|
|
838
|
+
list: (options?: ListOptions) => Promise<DeploymentListResponse>;
|
|
777
839
|
get: (id: string) => Promise<Deployment>;
|
|
778
840
|
set: (id: string, options: {
|
|
779
841
|
labels: string[];
|
|
@@ -788,7 +850,7 @@ interface DomainResource {
|
|
|
788
850
|
deployment?: string;
|
|
789
851
|
labels?: string[];
|
|
790
852
|
}) => Promise<DomainSetResult>;
|
|
791
|
-
list: () => Promise<DomainListResponse>;
|
|
853
|
+
list: (options?: ListOptions) => Promise<DomainListResponse>;
|
|
792
854
|
get: (name: string) => Promise<Domain>;
|
|
793
855
|
remove: (name: string) => Promise<void>;
|
|
794
856
|
verify: (name: string) => Promise<{
|
|
@@ -816,7 +878,7 @@ interface TokenResource {
|
|
|
816
878
|
ttl?: number;
|
|
817
879
|
labels?: string[];
|
|
818
880
|
}) => Promise<TokenCreateResponse>;
|
|
819
|
-
list: () => Promise<TokenListResponse>;
|
|
881
|
+
list: (options?: ListOptions) => Promise<TokenListResponse>;
|
|
820
882
|
remove: (token: string) => Promise<void>;
|
|
821
883
|
}
|
|
822
884
|
/**
|
|
@@ -848,11 +910,11 @@ interface CheckoutSession {
|
|
|
848
910
|
* All activity event types logged in the system.
|
|
849
911
|
* Uses dot notation consistently: {resource}.{action}
|
|
850
912
|
*/
|
|
851
|
-
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' | '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';
|
|
913
|
+
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';
|
|
852
914
|
/**
|
|
853
915
|
* Activity events visible to users in the dashboard
|
|
854
916
|
*/
|
|
855
|
-
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';
|
|
917
|
+
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';
|
|
856
918
|
/**
|
|
857
919
|
* Activity record returned from the API
|
|
858
920
|
*/
|
|
@@ -871,6 +933,12 @@ interface Activity {
|
|
|
871
933
|
/**
|
|
872
934
|
* Parsed activity metadata.
|
|
873
935
|
* Different events populate different fields.
|
|
936
|
+
*
|
|
937
|
+
* Naming convention: meta booleans are event-scoped predicates and carry
|
|
938
|
+
* their prefix (`isUpdate`, `wasVerified`, `hasConfig`, `hasPassword`),
|
|
939
|
+
* while entity booleans are bare nouns (`Deployment.config`,
|
|
940
|
+
* `Deployment.password`). Two vocabularies, each internally consistent —
|
|
941
|
+
* deliberate, not drift.
|
|
874
942
|
*/
|
|
875
943
|
interface ActivityMeta {
|
|
876
944
|
/** Number of files in deployment */
|
|
@@ -908,6 +976,10 @@ interface ActivityMeta {
|
|
|
908
976
|
interface ActivityListResponse {
|
|
909
977
|
/** Array of activities */
|
|
910
978
|
activities: Activity[];
|
|
979
|
+
/** Cursor for pagination, null if no more pages */
|
|
980
|
+
cursor: string | null;
|
|
981
|
+
/** Total number of activities */
|
|
982
|
+
total: number;
|
|
911
983
|
}
|
|
912
984
|
/**
|
|
913
985
|
* File status constants for validation state tracking
|
|
@@ -1109,20 +1181,17 @@ declare function validatePassword(value: unknown): string | undefined;
|
|
|
1109
1181
|
* Extends the API contract (DeploymentUploadOptions) with SDK-specific options.
|
|
1110
1182
|
*/
|
|
1111
1183
|
interface DeploymentOptions extends DeploymentUploadOptions {
|
|
1112
|
-
/**
|
|
1184
|
+
/**
|
|
1185
|
+
* An AbortSignal to allow cancellation of the deploy operation. The one
|
|
1186
|
+
* cancellation mechanism — abort the signal and the request rejects with
|
|
1187
|
+
* a typed `Cancelled` error. Request timeouts are a client concern
|
|
1188
|
+
* (`ShipClientOptions.timeout`), not a per-deploy one.
|
|
1189
|
+
*/
|
|
1113
1190
|
signal?: AbortSignal;
|
|
1114
|
-
/** Callback invoked if the deploy is cancelled via the AbortSignal. */
|
|
1115
|
-
onCancel?: () => void;
|
|
1116
|
-
/** Maximum number of concurrent operations. */
|
|
1117
|
-
maxConcurrency?: number;
|
|
1118
|
-
/** Timeout in milliseconds for the deploy request. */
|
|
1119
|
-
timeout?: number;
|
|
1120
1191
|
/** Whether to auto-detect and optimize file paths by flattening common directories. Defaults to true. */
|
|
1121
1192
|
pathDetect?: boolean;
|
|
1122
1193
|
/** Whether to auto-detect SPAs and generate ship.json configuration. Defaults to true. */
|
|
1123
1194
|
spaDetect?: boolean;
|
|
1124
|
-
/** Callback for deploy progress with detailed statistics. */
|
|
1125
|
-
onProgress?: (info: ProgressInfo) => void;
|
|
1126
1195
|
}
|
|
1127
1196
|
type ApiDeployOptions = Omit<DeploymentOptions, 'pathDetect'>;
|
|
1128
1197
|
/**
|
|
@@ -1177,7 +1246,7 @@ type Fetch = typeof fetch;
|
|
|
1177
1246
|
type TokenProvider = () => string | Promise<string>;
|
|
1178
1247
|
/**
|
|
1179
1248
|
* Options for configuring a `Ship` instance.
|
|
1180
|
-
* Sets
|
|
1249
|
+
* Sets the API host, the client credential, the request timeout, and the transport.
|
|
1181
1250
|
*/
|
|
1182
1251
|
interface ShipClientOptions {
|
|
1183
1252
|
/** Default API URL for the client instance. */
|
|
@@ -1198,19 +1267,8 @@ interface ShipClientOptions {
|
|
|
1198
1267
|
*/
|
|
1199
1268
|
token?: string | TokenProvider | undefined;
|
|
1200
1269
|
/**
|
|
1201
|
-
*
|
|
1202
|
-
*
|
|
1203
|
-
*/
|
|
1204
|
-
onProgress?: ((info: ProgressInfo) => void) | undefined;
|
|
1205
|
-
/**
|
|
1206
|
-
* Default for maximum concurrent deploys.
|
|
1207
|
-
* Used if an deploy operation doesn't specify its own `maxConcurrency`.
|
|
1208
|
-
* Defaults to 4 if not set here or in the specific deploy call.
|
|
1209
|
-
*/
|
|
1210
|
-
maxConcurrency?: number | undefined;
|
|
1211
|
-
/**
|
|
1212
|
-
* Default timeout in milliseconds for API requests made by this client instance.
|
|
1213
|
-
* Used if an deploy operation doesn't specify its own timeout.
|
|
1270
|
+
* Timeout in milliseconds for every API request made by this client
|
|
1271
|
+
* instance. Defaults to 30 seconds.
|
|
1214
1272
|
*/
|
|
1215
1273
|
timeout?: number | undefined;
|
|
1216
1274
|
/**
|
|
@@ -1277,7 +1335,19 @@ interface ShipEvents {
|
|
|
1277
1335
|
request: [url: string, init: RequestInit];
|
|
1278
1336
|
/** Emitted after successful API response */
|
|
1279
1337
|
response: [response: Response, url: string];
|
|
1280
|
-
/**
|
|
1338
|
+
/**
|
|
1339
|
+
* Emitted when something fails. TWO populations arrive here, which is why
|
|
1340
|
+
* the type is `Error` and not `ShipError`:
|
|
1341
|
+
*
|
|
1342
|
+
* - a failed request — always a `ShipError` (`executeRequest` normalizes
|
|
1343
|
+
* every failure through `ShipError.fromFetchError` before emitting), so
|
|
1344
|
+
* `isShipError(error)` narrows and `.type` / `.status` are readable;
|
|
1345
|
+
* - a THROWING HANDLER of yours — `SimpleEvents.emit` evicts it and
|
|
1346
|
+
* re-emits the raw failure here, which is a plain `Error`.
|
|
1347
|
+
*
|
|
1348
|
+
* Narrowing this to `ShipError` was tried on 2026-07-27 and reverted: it
|
|
1349
|
+
* made the second population a lie.
|
|
1350
|
+
*/
|
|
1281
1351
|
error: [error: Error, url: string];
|
|
1282
1352
|
}
|
|
1283
1353
|
|
|
@@ -1352,12 +1422,12 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
1352
1422
|
private safeClone;
|
|
1353
1423
|
private parseResponse;
|
|
1354
1424
|
deploy(files: StaticFile[], options?: ApiDeployOptions): Promise<DeploymentCreateResponse>;
|
|
1355
|
-
listDeployments(): Promise<DeploymentListResponse>;
|
|
1425
|
+
listDeployments(options?: ListOptions): Promise<DeploymentListResponse>;
|
|
1356
1426
|
getDeployment(id: string): Promise<Deployment>;
|
|
1357
1427
|
updateDeploymentLabels(id: string, labels: string[]): Promise<Deployment>;
|
|
1358
1428
|
removeDeployment(id: string): Promise<void>;
|
|
1359
1429
|
setDomain(name: string, deployment?: string, labels?: string[]): Promise<DomainSetResult>;
|
|
1360
|
-
listDomains(): Promise<DomainListResponse>;
|
|
1430
|
+
listDomains(options?: ListOptions): Promise<DomainListResponse>;
|
|
1361
1431
|
getDomain(name: string): Promise<Domain>;
|
|
1362
1432
|
removeDomain(name: string): Promise<void>;
|
|
1363
1433
|
verifyDomain(name: string): Promise<{
|
|
@@ -1371,7 +1441,7 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
1371
1441
|
}>;
|
|
1372
1442
|
validateDomain(name: string): Promise<DomainValidateResponse>;
|
|
1373
1443
|
createToken(ttl?: number, labels?: string[]): Promise<TokenCreateResponse>;
|
|
1374
|
-
listTokens(): Promise<TokenListResponse>;
|
|
1444
|
+
listTokens(options?: ListOptions): Promise<TokenListResponse>;
|
|
1375
1445
|
removeToken(token: string): Promise<void>;
|
|
1376
1446
|
getAccount(): Promise<AccountGetResponse>;
|
|
1377
1447
|
getLimits(): Promise<PlatformLimits>;
|
|
@@ -1395,7 +1465,6 @@ interface ResourceContext {
|
|
|
1395
1465
|
*/
|
|
1396
1466
|
interface DeploymentResourceContext extends ResourceContext {
|
|
1397
1467
|
processInput: (input: DeployInput, options: DeploymentOptions) => Promise<StaticFile[]>;
|
|
1398
|
-
clientDefaults?: ShipClientOptions;
|
|
1399
1468
|
}
|
|
1400
1469
|
/**
|
|
1401
1470
|
* Upload deployment resource with all CRUD operations.
|
|
@@ -1405,7 +1474,7 @@ interface DeploymentResourceContext extends ResourceContext {
|
|
|
1405
1474
|
* public-account agent identity per request (claim URL + expiry on the
|
|
1406
1475
|
* response). The SDK stays a transparent pipe either way.
|
|
1407
1476
|
*/
|
|
1408
|
-
declare function createDeploymentResource(ctx: DeploymentResourceContext): DeploymentResource
|
|
1477
|
+
declare function createDeploymentResource(ctx: DeploymentResourceContext): DeploymentResource<DeploymentOptions>;
|
|
1409
1478
|
/**
|
|
1410
1479
|
* Create domain resource with all CRUD operations.
|
|
1411
1480
|
*
|
|
@@ -1427,7 +1496,7 @@ declare function createTokenResource(ctx: ResourceContext): TokenResource;
|
|
|
1427
1496
|
* Abstract base class for Ship SDK implementations.
|
|
1428
1497
|
*/
|
|
1429
1498
|
declare abstract class Ship$1 {
|
|
1430
|
-
readonly deployments: DeploymentResource
|
|
1499
|
+
readonly deployments: DeploymentResource<DeploymentOptions>;
|
|
1431
1500
|
readonly domains: DomainResource;
|
|
1432
1501
|
readonly account: AccountResource;
|
|
1433
1502
|
readonly tokens: TokenResource;
|
|
@@ -1452,7 +1521,7 @@ declare abstract class Ship$1 {
|
|
|
1452
1521
|
/**
|
|
1453
1522
|
* Deploy project (convenience shortcut to `ship.deployments.upload()`).
|
|
1454
1523
|
*/
|
|
1455
|
-
deploy(input: DeployInput, options?: DeploymentOptions): Promise<
|
|
1524
|
+
deploy(input: DeployInput, options?: DeploymentOptions): Promise<DeploymentCreateResponse>;
|
|
1456
1525
|
/**
|
|
1457
1526
|
* Get current account information (convenience shortcut to `ship.account.get()`).
|
|
1458
1527
|
*/
|
|
@@ -1494,30 +1563,6 @@ declare abstract class Ship$1 {
|
|
|
1494
1563
|
private getAuthHeaders;
|
|
1495
1564
|
}
|
|
1496
1565
|
|
|
1497
|
-
/**
|
|
1498
|
-
* @file Cross-platform configuration helpers.
|
|
1499
|
-
*
|
|
1500
|
-
* One pure helper used by the deployment resource:
|
|
1501
|
-
*
|
|
1502
|
-
* - `mergeDeployOptions(perCallOptions, clientDefaults)` — overlays
|
|
1503
|
-
* instance-level defaults under per-call overrides for a single deploy.
|
|
1504
|
-
*
|
|
1505
|
-
* Deploy options are pure deploy concerns (progress, timeout, concurrency).
|
|
1506
|
-
* Credentials, the API URL, and the caller identifier are client identity —
|
|
1507
|
-
* they live on the instance, never per call: one client is one principal
|
|
1508
|
-
* speaking for one end user against one API. Callers that need a different
|
|
1509
|
-
* identity construct another Ship.
|
|
1510
|
-
*/
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Overlay client-level defaults under per-call deploy options.
|
|
1514
|
-
*
|
|
1515
|
-
* Per-call options always win — they're the explicit override for a single
|
|
1516
|
-
* `deployments.upload()`. Defaults fill in only when the per-call option is
|
|
1517
|
-
* `undefined` (an explicit `null` / empty value passes through).
|
|
1518
|
-
*/
|
|
1519
|
-
declare function mergeDeployOptions(options: DeploymentOptions, clientDefaults: ShipClientOptions): DeploymentOptions;
|
|
1520
|
-
|
|
1521
1566
|
/**
|
|
1522
1567
|
* @file Deploy path optimization - the core logic that makes Ship deployments clean and intuitive.
|
|
1523
1568
|
* Automatically strips common parent directories to create clean deployment URLs.
|
|
@@ -1775,7 +1820,7 @@ declare function pluralize(count: number, singular: string, plural: string, incl
|
|
|
1775
1820
|
* @param paths - File or directory paths to scan and process.
|
|
1776
1821
|
* @param options - Processing options (pathDetect, etc.).
|
|
1777
1822
|
* @param platformLimits - Per-instance platform limits (file-size / count /
|
|
1778
|
-
* total-size caps) from the originating Ship's `GET /
|
|
1823
|
+
* total-size caps) from the originating Ship's `GET /limits` fetch. Passed
|
|
1779
1824
|
* in rather than read from a module global so concurrent Ships against
|
|
1780
1825
|
* different API URLs cannot clobber each other's caps.
|
|
1781
1826
|
* @returns Promise resolving to an array of StaticFile objects.
|
|
@@ -1827,9 +1872,12 @@ declare class Ship extends Ship$1 {
|
|
|
1827
1872
|
* intentional: the convenience shortcut narrows; the resource-layer
|
|
1828
1873
|
* contract stays platform-neutral.
|
|
1829
1874
|
*/
|
|
1830
|
-
deploy(input: string | string[], options?: DeploymentOptions): Promise<
|
|
1875
|
+
deploy(input: string | string[], options?: DeploymentOptions): Promise<DeploymentCreateResponse>;
|
|
1831
1876
|
protected processInput(input: DeployInput, options: DeploymentOptions): Promise<StaticFile[]>;
|
|
1832
1877
|
protected getDeployBodyCreator(): DeployBodyCreator;
|
|
1833
1878
|
}
|
|
1834
1879
|
|
|
1835
|
-
|
|
1880
|
+
declare namespace Ship {
|
|
1881
|
+
export { API_KEY, AUTH_BASE_PATH, Account, AccountGetResponse, AccountOverrides, AccountPlan, AccountPlanType, AccountResource, AccountUsage, Activity, ActivityEvent, ActivityListResponse, ActivityMeta, ApiDeployOptions, ApiHttp, ApiHttpOptions, AuthMethod, AuthMethodType, BLOCKED_EXTENSIONS, BillingStatus, CALLER, CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_TOKEN, DeployBody, DeployBodyContext, DeployBodyCreator, DeployFile, DeployInput, Deployment, DeploymentCreateResponse, DeploymentListResponse, DeploymentOptions, DeploymentResource, DeploymentResourceContext, DeploymentStatus, DeploymentStatusType, DeploymentUploadOptions, DnsProvider, DnsRecord, DnsRecordType, Domain, DomainDnsResponse, DomainListResponse, DomainRecordsResponse, DomainResource, DomainSetResult, DomainStatus, DomainStatusType, DomainValidateResponse, ErrorResponse, ErrorType, ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, Fetch, FileValidationResult, FileValidationStatus, FileValidationStatusType, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, ListOptions, MD5Result, OAuthScope, OAuthScopeType, PASSWORD_CONSTRAINTS, PingResponse, PlatformLimits, ResourceContext, SPACheckRequest, SPACheckResponse, SPA_DEFAULT_CONFIG, ShipClientOptions, ShipError, ShipEvents, StaticFile, TokenCreateResponse, TokenKind, TokenKindType, TokenListItem, TokenListResponse, TokenProvider, TokenResource, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, UploadedFile, UserVisibleActivityEvent, ValidatableFile, ValidationIssue, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, 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, validatePassword, validateToken };
|
|
1882
|
+
}
|
|
1883
|
+
export = Ship;
|