@shipstatic/ship 2.0.0-beta.15 → 2.0.0-beta.17
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 +169 -8
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +38 -38
- 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 +169 -8
- package/dist/index.d.ts +169 -8
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -12,6 +12,28 @@ declare const DeploymentStatus: {
|
|
|
12
12
|
readonly DELETING: "deleting";
|
|
13
13
|
};
|
|
14
14
|
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
|
+
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
|
+
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 @@ 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;
|
|
@@ -105,6 +135,41 @@ declare const API_PATHS: {
|
|
|
105
135
|
readonly SPA_CHECK: "/spa-check";
|
|
106
136
|
readonly UPLOAD: "/upload";
|
|
107
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* The deploy request's multipart field names — the other half of the wire
|
|
140
|
+
* surface beside {@link API_PATHS}. `POST /deployments` (and the first-party
|
|
141
|
+
* `/upload`) is multipart/form-data, and these are the names the API reads.
|
|
142
|
+
*
|
|
143
|
+
* Declared once because the body has three independent WRITERS — the SDK's
|
|
144
|
+
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
145
|
+
* client (which cannot import this under n8n Cloud's zero-dependency rule,
|
|
146
|
+
* and fences its restated copy instead) — and until this export every writer
|
|
147
|
+
* restated the strings the API parses, with nothing comparing them.
|
|
148
|
+
*
|
|
149
|
+
* `FILES` carries one entry per file (the API reads it with `getAll`); every
|
|
150
|
+
* other field is single. The `@internal` flags are serialized as the literal
|
|
151
|
+
* string `'true'` and belong to first-party surfaces only.
|
|
152
|
+
*/
|
|
153
|
+
declare const DEPLOY_FIELDS: {
|
|
154
|
+
/** One entry per file — read with `getAll`. */
|
|
155
|
+
readonly FILES: "files[]";
|
|
156
|
+
/** JSON array of MD5 hex digests, index-aligned with `FILES`. */
|
|
157
|
+
readonly CHECKSUMS: "checksums";
|
|
158
|
+
/** JSON array of label strings. */
|
|
159
|
+
readonly LABELS: "labels";
|
|
160
|
+
/** The deploying surface's {@link DeploymentVia} member. */
|
|
161
|
+
readonly VIA: "via";
|
|
162
|
+
/** Plaintext password — the API hashes it server-side. */
|
|
163
|
+
readonly PASSWORD: "password";
|
|
164
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
165
|
+
readonly BUILD: "build";
|
|
166
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
167
|
+
readonly PRERENDER: "prerender";
|
|
168
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
169
|
+
readonly SPA: "spa";
|
|
170
|
+
/** @internal reCAPTCHA proof — `web/www`'s public uploader only. */
|
|
171
|
+
readonly CAPTCHA: "captcha";
|
|
172
|
+
};
|
|
108
173
|
/**
|
|
109
174
|
* The half of a list response that is identical on every list.
|
|
110
175
|
*
|
|
@@ -324,10 +389,33 @@ interface DomainRecordsResponse {
|
|
|
324
389
|
* API would reject the same value the same way.
|
|
325
390
|
*/
|
|
326
391
|
declare const IDEMPOTENCY_KEY_CONSTRAINTS: {
|
|
392
|
+
/**
|
|
393
|
+
* HTTP header name. Here for the same reason {@link CALLER.HEADER} is: a
|
|
394
|
+
* wire header has two ends, and the package that owns the value's format
|
|
395
|
+
* is the only place both ends can read its name from.
|
|
396
|
+
*/
|
|
397
|
+
readonly HEADER: "Idempotency-Key";
|
|
327
398
|
readonly MAX_LENGTH: 256;
|
|
328
399
|
/** How long a stored 201 stays replayable. */
|
|
329
400
|
readonly WINDOW_SECONDS: number;
|
|
330
401
|
};
|
|
402
|
+
/**
|
|
403
|
+
* Normalize a `via` value from any transport — trimmed, lowercased, and a
|
|
404
|
+
* member of {@link DeploymentVia}, or `undefined`.
|
|
405
|
+
*
|
|
406
|
+
* A format rule by this package's own test: a client can decide offline
|
|
407
|
+
* whether a value is well-formed, and the API reaches the same verdict on the
|
|
408
|
+
* same input. It lived server-side until 2026-08-06, which meant clients could
|
|
409
|
+
* only learn their label was unusable by noticing analytics had gone quiet.
|
|
410
|
+
*
|
|
411
|
+
* **Not knowing your `via` is not an error** — an unrecognized value yields
|
|
412
|
+
* `undefined` rather than throwing, because origin tracking is telemetry and a
|
|
413
|
+
* deploy must never fail over it. A caller that has an honest default should
|
|
414
|
+
* prefer it (`normalizeVia(process.env.SHIP_VIA) ?? DeploymentVia.CLI`): the
|
|
415
|
+
* deploy really did come from the CLI, so recording that beats recording
|
|
416
|
+
* nothing.
|
|
417
|
+
*/
|
|
418
|
+
declare function normalizeVia(value: unknown): DeploymentViaType | undefined;
|
|
331
419
|
/**
|
|
332
420
|
* Validate an idempotency key, returning the trimmed value or `undefined`
|
|
333
421
|
* when none was supplied. Throws {@link ShipError.validation} when the value
|
|
@@ -970,6 +1058,26 @@ declare const SPA_DEFAULT_CONFIG: {
|
|
|
970
1058
|
readonly destination: "/index.html";
|
|
971
1059
|
}];
|
|
972
1060
|
};
|
|
1061
|
+
/**
|
|
1062
|
+
* The `/spa-check` pre-flight's client-side envelope: which file is the
|
|
1063
|
+
* check's subject, and how large it may be before a client skips the call.
|
|
1064
|
+
*
|
|
1065
|
+
* One fact with three holders until this export — the API's config declared
|
|
1066
|
+
* the cap, the SDK's `checkSPA` hardcoded `100 * 1024`, and prose restated
|
|
1067
|
+
* "100KB". `INDEX_FILE` is the selection rule (the file whose content rides
|
|
1068
|
+
* `SPACheckRequest.index`), restated by every client that builds the request.
|
|
1069
|
+
*
|
|
1070
|
+
* Neither member is a validation boundary: a client over the cap simply
|
|
1071
|
+
* skips the pre-flight, because the server answers an oversized index
|
|
1072
|
+
* `isSPA: false` anyway. A consumer that cannot import this (n8n) needs no
|
|
1073
|
+
* size copy at all — outcome parity is the server's, not the client's.
|
|
1074
|
+
*/
|
|
1075
|
+
declare const SPA_CHECK_CONSTRAINTS: {
|
|
1076
|
+
/** The file whose content is the check's subject. */
|
|
1077
|
+
readonly INDEX_FILE: "index.html";
|
|
1078
|
+
/** Skip the pre-flight above this size — the server would answer false. */
|
|
1079
|
+
readonly MAX_INDEX_BYTES: number;
|
|
1080
|
+
};
|
|
973
1081
|
/**
|
|
974
1082
|
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
975
1083
|
* never schema.
|
|
@@ -1094,6 +1202,50 @@ interface StaticFile {
|
|
|
1094
1202
|
}
|
|
1095
1203
|
/** Default API URL if not otherwise configured. */
|
|
1096
1204
|
declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
1205
|
+
/**
|
|
1206
|
+
* The Node SDK's ambient configuration pair — the ONLY environment variables
|
|
1207
|
+
* the SDK reads, and therefore the COMPLETE list an embedding host must
|
|
1208
|
+
* scrub (per `npm/ship`'s strict-isolation contract, scrubbing is the host's
|
|
1209
|
+
* job, not the SDK's). A host that derives its scrub from this object's
|
|
1210
|
+
* values — as the VS Code extension's child-process env block does — picks
|
|
1211
|
+
* up a grown contract at the next pin bump instead of by remembered prose.
|
|
1212
|
+
*
|
|
1213
|
+
* Browser builds read no environment at all, and the CLI-only variables
|
|
1214
|
+
* (`SHIP_PASSWORD`, `SHIP_VIA`) are deliberately NOT here: they are the
|
|
1215
|
+
* CLI's operational levers, not the SDK's ambient contract — see
|
|
1216
|
+
* `npm/ship/CLAUDE.md`, "CLI-only env vars".
|
|
1217
|
+
*/
|
|
1218
|
+
declare const SHIP_ENV: {
|
|
1219
|
+
/** The one credential slot — any platform token. */
|
|
1220
|
+
readonly TOKEN: "SHIP_TOKEN";
|
|
1221
|
+
/** The API endpoint override. */
|
|
1222
|
+
readonly API_URL: "SHIP_API_URL";
|
|
1223
|
+
};
|
|
1224
|
+
/**
|
|
1225
|
+
* Where a human creates an API key — the console deep link quoted by every
|
|
1226
|
+
* surface that teaches authentication (the CLI's config wizard, the VS Code
|
|
1227
|
+
* and n8n listings, the n8n rate-limit hint and credential copy). Written
|
|
1228
|
+
* out in five files across three repos until this export.
|
|
1229
|
+
*
|
|
1230
|
+
* Production-branded by design: published artifacts name the product, never
|
|
1231
|
+
* an environment (root `CLAUDE.md`, "Environment-Aware URLs").
|
|
1232
|
+
*/
|
|
1233
|
+
declare const MY_API_KEY_URL = "https://my.shipstatic.com/api-key";
|
|
1234
|
+
/**
|
|
1235
|
+
* How long an anonymous deployment lives before it expires.
|
|
1236
|
+
*
|
|
1237
|
+
* The lifetime of the public tier, and one fact with several readers. The API
|
|
1238
|
+
* stamps a deployment's `expires` from it and gives a claim code exactly the
|
|
1239
|
+
* same window — a live site with a dead claim link is a coherence bug, so the
|
|
1240
|
+
* two are one constant rather than two that agree. Both MCP transports quote
|
|
1241
|
+
* the duration in prose an agent reads, and derive it from here rather than
|
|
1242
|
+
* writing it out, which they did in eight places until this export existed.
|
|
1243
|
+
*
|
|
1244
|
+
* Seconds, spelled in the name: this platform has both second- and
|
|
1245
|
+
* millisecond-valued durations, and the pair is only safe when each says which
|
|
1246
|
+
* it is.
|
|
1247
|
+
*/
|
|
1248
|
+
declare const PUBLIC_DEPLOYMENT_TTL_SECONDS: number;
|
|
1097
1249
|
/**
|
|
1098
1250
|
* Universal deploy input — the union of every shape the SDK accepts.
|
|
1099
1251
|
*
|
|
@@ -1112,8 +1264,12 @@ type DeployInput = File[] | string | string[];
|
|
|
1112
1264
|
interface DeploymentUploadOptions {
|
|
1113
1265
|
/** Optional labels for categorization and filtering */
|
|
1114
1266
|
labels?: string[];
|
|
1115
|
-
/**
|
|
1116
|
-
|
|
1267
|
+
/**
|
|
1268
|
+
* Which client is making this deploy. Closed, because the server silently
|
|
1269
|
+
* ignores anything outside the set — so an unchecked string turned a typo
|
|
1270
|
+
* into missing analytics rather than an error. See {@link DeploymentVia}.
|
|
1271
|
+
*/
|
|
1272
|
+
via?: DeploymentViaType;
|
|
1117
1273
|
/**
|
|
1118
1274
|
* Optional password that protects this deployment.
|
|
1119
1275
|
*
|
|
@@ -1145,8 +1301,8 @@ interface DeploymentUploadOptions {
|
|
|
1145
1301
|
*
|
|
1146
1302
|
* **Agents are the audience.** A human notices a duplicate; an automated
|
|
1147
1303
|
* retry does not. Pick a key that identifies the ATTEMPT — a run id, a
|
|
1148
|
-
* commit sha, a uuid minted before the first try — never one
|
|
1149
|
-
*
|
|
1304
|
+
* commit sha, a uuid minted before the first try — never one minted fresh
|
|
1305
|
+
* on each retry, which would defeat the point.
|
|
1150
1306
|
*
|
|
1151
1307
|
* The replay is per-caller, and it stores successes only: a failed deploy
|
|
1152
1308
|
* retries fresh under the same key.
|
|
@@ -1592,8 +1748,13 @@ interface DeployBodyContext {
|
|
|
1592
1748
|
* `LABEL_CONSTRAINTS` (length and pattern, lowercased+trimmed).
|
|
1593
1749
|
*/
|
|
1594
1750
|
labels?: string[];
|
|
1595
|
-
/**
|
|
1596
|
-
|
|
1751
|
+
/**
|
|
1752
|
+
* Which client is deploying — the same closed vocabulary the public option
|
|
1753
|
+
* carries, not a second `string`. This context receives an already-narrowed
|
|
1754
|
+
* value and passed it on widened, which made the narrowing stop one seam
|
|
1755
|
+
* short of the wire.
|
|
1756
|
+
*/
|
|
1757
|
+
via?: DeploymentViaType;
|
|
1597
1758
|
/**
|
|
1598
1759
|
* Optional plaintext password to protect the deployment.
|
|
1599
1760
|
* Length: `PASSWORD_CONSTRAINTS.MIN_LENGTH` to `PASSWORD_CONSTRAINTS.MAX_LENGTH`
|
|
@@ -2263,6 +2424,6 @@ declare class Ship extends Ship$1 {
|
|
|
2263
2424
|
}
|
|
2264
2425
|
|
|
2265
2426
|
declare namespace Ship {
|
|
2266
|
-
export { API_KEY, API_PATHS, AUTH_BASE_PATH, Account, AccountDeleteResponse, AccountGetResponse, AccountKeyResponse, AccountOverrides, AccountPlan, AccountPlanType, AccountResource, AccountUsage, Activity, ActivityEvent, ActivityListResponse, ActivityMeta, ApiDeployOptions, ApiHttp, ApiHttpOptions, AuthMethod, AuthMethodType, BLOCKED_EXTENSIONS, BillingCancelResponse, BillingStatus, CALLER, CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_TOKEN, DeployBody, DeployBodyContext, DeployBodyCreator, DeployFile, DeployInput, Deployment, DeploymentCreateResponse, DeploymentDeleteResponse, DeploymentListResponse, DeploymentOptions, DeploymentResource, DeploymentResourceContext, DeploymentSetOptions, DeploymentStatus, DeploymentStatusType, DeploymentUploadOptions, DnsLookup, DnsProvider, DnsRecord, DnsRecordType, Domain, DomainDeleteResponse, DomainDnsResponse, DomainListResponse, DomainRecordsResponse, DomainResource, DomainSetOptions, DomainSetResult, DomainShareResponse, DomainStatus, DomainStatusType, DomainValidateResponse, DomainVerifyResponse, ErrorResponse, ErrorType, ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, Fetch, FileValidationResult, FileValidationStatus, FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, LabelsResponse, ListOptions, ListResponse, MD5Result, OAuthScope, OAuthScopeType, PASSWORD_CONSTRAINTS, PingResponse, PlatformLimits, ResourceContext, SPACheckDebug, SPACheckRequest, SPACheckResponse, SPA_DEFAULT_CONFIG, SetupInstructionsResponse, ShipClientOptions, ShipError, ShipEvents, StaticFile, Token, TokenCreateOptions, TokenCreateResponse, TokenDeleteResponse, TokenKind, TokenKindType, TokenListResponse, TokenProvider, TokenResource, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, UploadedFile, UserVisibleActivityEvent, ValidatableFile, ValidationIssue, WEB_FILE_ACCEPT, __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, validateIdempotencyKey, validatePassword, validateToken };
|
|
2427
|
+
export { API_KEY, API_PATHS, AUTH_BASE_PATH, Account, AccountDeleteResponse, AccountGetResponse, AccountKeyResponse, AccountOverrides, AccountPlan, AccountPlanType, AccountResource, AccountUsage, Activity, ActivityEvent, ActivityListResponse, ActivityMeta, ApiDeployOptions, ApiHttp, ApiHttpOptions, AuthMethod, AuthMethodType, BLOCKED_EXTENSIONS, BillingCancelResponse, BillingStatus, CALLER, CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, DEPLOY_TOKEN, DeployBody, DeployBodyContext, DeployBodyCreator, DeployFile, DeployInput, Deployment, DeploymentCreateResponse, DeploymentDeleteResponse, DeploymentListResponse, DeploymentOptions, DeploymentResource, DeploymentResourceContext, DeploymentSetOptions, DeploymentStatus, DeploymentStatusType, DeploymentUploadOptions, DeploymentVia, DeploymentViaType, DnsLookup, DnsProvider, DnsRecord, DnsRecordType, Domain, DomainDeleteResponse, DomainDnsResponse, DomainListResponse, DomainRecordsResponse, DomainResource, DomainSetOptions, DomainSetResult, DomainShareResponse, DomainStatus, DomainStatusType, DomainValidateResponse, DomainVerifyResponse, ErrorResponse, ErrorType, ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, Fetch, FileValidationResult, FileValidationStatus, FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, LabelsResponse, ListOptions, ListResponse, MD5Result, MY_API_KEY_URL, OAuthScope, OAuthScopeType, PASSWORD_CONSTRAINTS, PUBLIC_DEPLOYMENT_TTL_SECONDS, PingResponse, PlatformLimits, ResourceContext, SHIP_ENV, SPACheckDebug, SPACheckRequest, SPACheckResponse, SPA_CHECK_CONSTRAINTS, SPA_DEFAULT_CONFIG, SetupInstructionsResponse, ShipClientOptions, ShipError, ShipEvents, StaticFile, Token, TokenCreateOptions, TokenCreateResponse, TokenDeleteResponse, TokenKind, TokenKindType, TokenListResponse, TokenProvider, TokenResource, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, UploadedFile, UserVisibleActivityEvent, ValidatableFile, ValidationIssue, WEB_FILE_ACCEPT, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, deserializeLabels, extractSubdomain, filterJunk, formatFileSize, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isCustomDomain, isDeployment, isPlatformDomain, isShipError, normalizeVia, optimizeDeployPaths, pluralize, processFilesForNode, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validatePassword, validateToken };
|
|
2267
2428
|
}
|
|
2268
2429
|
export = Ship;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,28 @@ declare const DeploymentStatus: {
|
|
|
12
12
|
readonly DELETING: "deleting";
|
|
13
13
|
};
|
|
14
14
|
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
|
+
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
|
+
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 @@ 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;
|
|
@@ -105,6 +135,41 @@ declare const API_PATHS: {
|
|
|
105
135
|
readonly SPA_CHECK: "/spa-check";
|
|
106
136
|
readonly UPLOAD: "/upload";
|
|
107
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* The deploy request's multipart field names — the other half of the wire
|
|
140
|
+
* surface beside {@link API_PATHS}. `POST /deployments` (and the first-party
|
|
141
|
+
* `/upload`) is multipart/form-data, and these are the names the API reads.
|
|
142
|
+
*
|
|
143
|
+
* Declared once because the body has three independent WRITERS — the SDK's
|
|
144
|
+
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
145
|
+
* client (which cannot import this under n8n Cloud's zero-dependency rule,
|
|
146
|
+
* and fences its restated copy instead) — and until this export every writer
|
|
147
|
+
* restated the strings the API parses, with nothing comparing them.
|
|
148
|
+
*
|
|
149
|
+
* `FILES` carries one entry per file (the API reads it with `getAll`); every
|
|
150
|
+
* other field is single. The `@internal` flags are serialized as the literal
|
|
151
|
+
* string `'true'` and belong to first-party surfaces only.
|
|
152
|
+
*/
|
|
153
|
+
declare const DEPLOY_FIELDS: {
|
|
154
|
+
/** One entry per file — read with `getAll`. */
|
|
155
|
+
readonly FILES: "files[]";
|
|
156
|
+
/** JSON array of MD5 hex digests, index-aligned with `FILES`. */
|
|
157
|
+
readonly CHECKSUMS: "checksums";
|
|
158
|
+
/** JSON array of label strings. */
|
|
159
|
+
readonly LABELS: "labels";
|
|
160
|
+
/** The deploying surface's {@link DeploymentVia} member. */
|
|
161
|
+
readonly VIA: "via";
|
|
162
|
+
/** Plaintext password — the API hashes it server-side. */
|
|
163
|
+
readonly PASSWORD: "password";
|
|
164
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
165
|
+
readonly BUILD: "build";
|
|
166
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
167
|
+
readonly PRERENDER: "prerender";
|
|
168
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
169
|
+
readonly SPA: "spa";
|
|
170
|
+
/** @internal reCAPTCHA proof — `web/www`'s public uploader only. */
|
|
171
|
+
readonly CAPTCHA: "captcha";
|
|
172
|
+
};
|
|
108
173
|
/**
|
|
109
174
|
* The half of a list response that is identical on every list.
|
|
110
175
|
*
|
|
@@ -324,10 +389,33 @@ interface DomainRecordsResponse {
|
|
|
324
389
|
* API would reject the same value the same way.
|
|
325
390
|
*/
|
|
326
391
|
declare const IDEMPOTENCY_KEY_CONSTRAINTS: {
|
|
392
|
+
/**
|
|
393
|
+
* HTTP header name. Here for the same reason {@link CALLER.HEADER} is: a
|
|
394
|
+
* wire header has two ends, and the package that owns the value's format
|
|
395
|
+
* is the only place both ends can read its name from.
|
|
396
|
+
*/
|
|
397
|
+
readonly HEADER: "Idempotency-Key";
|
|
327
398
|
readonly MAX_LENGTH: 256;
|
|
328
399
|
/** How long a stored 201 stays replayable. */
|
|
329
400
|
readonly WINDOW_SECONDS: number;
|
|
330
401
|
};
|
|
402
|
+
/**
|
|
403
|
+
* Normalize a `via` value from any transport — trimmed, lowercased, and a
|
|
404
|
+
* member of {@link DeploymentVia}, or `undefined`.
|
|
405
|
+
*
|
|
406
|
+
* A format rule by this package's own test: a client can decide offline
|
|
407
|
+
* whether a value is well-formed, and the API reaches the same verdict on the
|
|
408
|
+
* same input. It lived server-side until 2026-08-06, which meant clients could
|
|
409
|
+
* only learn their label was unusable by noticing analytics had gone quiet.
|
|
410
|
+
*
|
|
411
|
+
* **Not knowing your `via` is not an error** — an unrecognized value yields
|
|
412
|
+
* `undefined` rather than throwing, because origin tracking is telemetry and a
|
|
413
|
+
* deploy must never fail over it. A caller that has an honest default should
|
|
414
|
+
* prefer it (`normalizeVia(process.env.SHIP_VIA) ?? DeploymentVia.CLI`): the
|
|
415
|
+
* deploy really did come from the CLI, so recording that beats recording
|
|
416
|
+
* nothing.
|
|
417
|
+
*/
|
|
418
|
+
declare function normalizeVia(value: unknown): DeploymentViaType | undefined;
|
|
331
419
|
/**
|
|
332
420
|
* Validate an idempotency key, returning the trimmed value or `undefined`
|
|
333
421
|
* when none was supplied. Throws {@link ShipError.validation} when the value
|
|
@@ -970,6 +1058,26 @@ declare const SPA_DEFAULT_CONFIG: {
|
|
|
970
1058
|
readonly destination: "/index.html";
|
|
971
1059
|
}];
|
|
972
1060
|
};
|
|
1061
|
+
/**
|
|
1062
|
+
* The `/spa-check` pre-flight's client-side envelope: which file is the
|
|
1063
|
+
* check's subject, and how large it may be before a client skips the call.
|
|
1064
|
+
*
|
|
1065
|
+
* One fact with three holders until this export — the API's config declared
|
|
1066
|
+
* the cap, the SDK's `checkSPA` hardcoded `100 * 1024`, and prose restated
|
|
1067
|
+
* "100KB". `INDEX_FILE` is the selection rule (the file whose content rides
|
|
1068
|
+
* `SPACheckRequest.index`), restated by every client that builds the request.
|
|
1069
|
+
*
|
|
1070
|
+
* Neither member is a validation boundary: a client over the cap simply
|
|
1071
|
+
* skips the pre-flight, because the server answers an oversized index
|
|
1072
|
+
* `isSPA: false` anyway. A consumer that cannot import this (n8n) needs no
|
|
1073
|
+
* size copy at all — outcome parity is the server's, not the client's.
|
|
1074
|
+
*/
|
|
1075
|
+
declare const SPA_CHECK_CONSTRAINTS: {
|
|
1076
|
+
/** The file whose content is the check's subject. */
|
|
1077
|
+
readonly INDEX_FILE: "index.html";
|
|
1078
|
+
/** Skip the pre-flight above this size — the server would answer false. */
|
|
1079
|
+
readonly MAX_INDEX_BYTES: number;
|
|
1080
|
+
};
|
|
973
1081
|
/**
|
|
974
1082
|
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
975
1083
|
* never schema.
|
|
@@ -1094,6 +1202,50 @@ interface StaticFile {
|
|
|
1094
1202
|
}
|
|
1095
1203
|
/** Default API URL if not otherwise configured. */
|
|
1096
1204
|
declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
1205
|
+
/**
|
|
1206
|
+
* The Node SDK's ambient configuration pair — the ONLY environment variables
|
|
1207
|
+
* the SDK reads, and therefore the COMPLETE list an embedding host must
|
|
1208
|
+
* scrub (per `npm/ship`'s strict-isolation contract, scrubbing is the host's
|
|
1209
|
+
* job, not the SDK's). A host that derives its scrub from this object's
|
|
1210
|
+
* values — as the VS Code extension's child-process env block does — picks
|
|
1211
|
+
* up a grown contract at the next pin bump instead of by remembered prose.
|
|
1212
|
+
*
|
|
1213
|
+
* Browser builds read no environment at all, and the CLI-only variables
|
|
1214
|
+
* (`SHIP_PASSWORD`, `SHIP_VIA`) are deliberately NOT here: they are the
|
|
1215
|
+
* CLI's operational levers, not the SDK's ambient contract — see
|
|
1216
|
+
* `npm/ship/CLAUDE.md`, "CLI-only env vars".
|
|
1217
|
+
*/
|
|
1218
|
+
declare const SHIP_ENV: {
|
|
1219
|
+
/** The one credential slot — any platform token. */
|
|
1220
|
+
readonly TOKEN: "SHIP_TOKEN";
|
|
1221
|
+
/** The API endpoint override. */
|
|
1222
|
+
readonly API_URL: "SHIP_API_URL";
|
|
1223
|
+
};
|
|
1224
|
+
/**
|
|
1225
|
+
* Where a human creates an API key — the console deep link quoted by every
|
|
1226
|
+
* surface that teaches authentication (the CLI's config wizard, the VS Code
|
|
1227
|
+
* and n8n listings, the n8n rate-limit hint and credential copy). Written
|
|
1228
|
+
* out in five files across three repos until this export.
|
|
1229
|
+
*
|
|
1230
|
+
* Production-branded by design: published artifacts name the product, never
|
|
1231
|
+
* an environment (root `CLAUDE.md`, "Environment-Aware URLs").
|
|
1232
|
+
*/
|
|
1233
|
+
declare const MY_API_KEY_URL = "https://my.shipstatic.com/api-key";
|
|
1234
|
+
/**
|
|
1235
|
+
* How long an anonymous deployment lives before it expires.
|
|
1236
|
+
*
|
|
1237
|
+
* The lifetime of the public tier, and one fact with several readers. The API
|
|
1238
|
+
* stamps a deployment's `expires` from it and gives a claim code exactly the
|
|
1239
|
+
* same window — a live site with a dead claim link is a coherence bug, so the
|
|
1240
|
+
* two are one constant rather than two that agree. Both MCP transports quote
|
|
1241
|
+
* the duration in prose an agent reads, and derive it from here rather than
|
|
1242
|
+
* writing it out, which they did in eight places until this export existed.
|
|
1243
|
+
*
|
|
1244
|
+
* Seconds, spelled in the name: this platform has both second- and
|
|
1245
|
+
* millisecond-valued durations, and the pair is only safe when each says which
|
|
1246
|
+
* it is.
|
|
1247
|
+
*/
|
|
1248
|
+
declare const PUBLIC_DEPLOYMENT_TTL_SECONDS: number;
|
|
1097
1249
|
/**
|
|
1098
1250
|
* Universal deploy input — the union of every shape the SDK accepts.
|
|
1099
1251
|
*
|
|
@@ -1112,8 +1264,12 @@ type DeployInput = File[] | string | string[];
|
|
|
1112
1264
|
interface DeploymentUploadOptions {
|
|
1113
1265
|
/** Optional labels for categorization and filtering */
|
|
1114
1266
|
labels?: string[];
|
|
1115
|
-
/**
|
|
1116
|
-
|
|
1267
|
+
/**
|
|
1268
|
+
* Which client is making this deploy. Closed, because the server silently
|
|
1269
|
+
* ignores anything outside the set — so an unchecked string turned a typo
|
|
1270
|
+
* into missing analytics rather than an error. See {@link DeploymentVia}.
|
|
1271
|
+
*/
|
|
1272
|
+
via?: DeploymentViaType;
|
|
1117
1273
|
/**
|
|
1118
1274
|
* Optional password that protects this deployment.
|
|
1119
1275
|
*
|
|
@@ -1145,8 +1301,8 @@ interface DeploymentUploadOptions {
|
|
|
1145
1301
|
*
|
|
1146
1302
|
* **Agents are the audience.** A human notices a duplicate; an automated
|
|
1147
1303
|
* retry does not. Pick a key that identifies the ATTEMPT — a run id, a
|
|
1148
|
-
* commit sha, a uuid minted before the first try — never one
|
|
1149
|
-
*
|
|
1304
|
+
* commit sha, a uuid minted before the first try — never one minted fresh
|
|
1305
|
+
* on each retry, which would defeat the point.
|
|
1150
1306
|
*
|
|
1151
1307
|
* The replay is per-caller, and it stores successes only: a failed deploy
|
|
1152
1308
|
* retries fresh under the same key.
|
|
@@ -1592,8 +1748,13 @@ interface DeployBodyContext {
|
|
|
1592
1748
|
* `LABEL_CONSTRAINTS` (length and pattern, lowercased+trimmed).
|
|
1593
1749
|
*/
|
|
1594
1750
|
labels?: string[];
|
|
1595
|
-
/**
|
|
1596
|
-
|
|
1751
|
+
/**
|
|
1752
|
+
* Which client is deploying — the same closed vocabulary the public option
|
|
1753
|
+
* carries, not a second `string`. This context receives an already-narrowed
|
|
1754
|
+
* value and passed it on widened, which made the narrowing stop one seam
|
|
1755
|
+
* short of the wire.
|
|
1756
|
+
*/
|
|
1757
|
+
via?: DeploymentViaType;
|
|
1597
1758
|
/**
|
|
1598
1759
|
* Optional plaintext password to protect the deployment.
|
|
1599
1760
|
* Length: `PASSWORD_CONSTRAINTS.MIN_LENGTH` to `PASSWORD_CONSTRAINTS.MAX_LENGTH`
|
|
@@ -2262,4 +2423,4 @@ declare class Ship extends Ship$1 {
|
|
|
2262
2423
|
protected getDeployBodyCreator(): DeployBodyCreator;
|
|
2263
2424
|
}
|
|
2264
2425
|
|
|
2265
|
-
export { API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountDeleteResponse, type AccountGetResponse, type AccountKeyResponse, type AccountOverrides, AccountPlan, type AccountPlanType, type AccountResource, type AccountUsage, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, BLOCKED_EXTENSIONS, type BillingCancelResponse, type BillingStatus, CALLER, type CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_TOKEN, type DeployBody, type DeployBodyContext, type DeployBodyCreator, type DeployFile, type DeployInput, type Deployment, type DeploymentCreateResponse, type DeploymentDeleteResponse, type DeploymentListResponse, type DeploymentOptions, type DeploymentResource, type DeploymentResourceContext, type DeploymentSetOptions, DeploymentStatus, type DeploymentStatusType, type DeploymentUploadOptions, type DnsLookup, type DnsProvider, type DnsRecord, type DnsRecordType, type Domain, type DomainDeleteResponse, type DomainDnsResponse, type DomainListResponse, type DomainRecordsResponse, type DomainResource, type DomainSetOptions, type DomainSetResult, type DomainShareResponse, DomainStatus, type DomainStatusType, type DomainValidateResponse, type DomainVerifyResponse, type ErrorResponse, ErrorType, type ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, type Fetch, type FileValidationResult, FileValidationStatus, type FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, type LabelsResponse, type ListOptions, type ListResponse, type MD5Result, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, type PingResponse, type PlatformLimits, type ResourceContext, type SPACheckDebug, type SPACheckRequest, type SPACheckResponse, SPA_DEFAULT_CONFIG, type SetupInstructionsResponse, Ship, type ShipClientOptions, ShipError, type ShipEvents, type StaticFile, type Token, type TokenCreateOptions, type TokenCreateResponse, type TokenDeleteResponse, TokenKind, type TokenKindType, type TokenListResponse, type TokenProvider, type TokenResource, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, type UploadedFile, type UserVisibleActivityEvent, type ValidatableFile, type ValidationIssue, WEB_FILE_ACCEPT, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, deserializeLabels, extractSubdomain, filterJunk, formatFileSize, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isCustomDomain, isDeployment, isPlatformDomain, isShipError, optimizeDeployPaths, pluralize, processFilesForNode, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validatePassword, validateToken };
|
|
2426
|
+
export { API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountDeleteResponse, type AccountGetResponse, type AccountKeyResponse, type AccountOverrides, AccountPlan, type AccountPlanType, type AccountResource, type AccountUsage, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, BLOCKED_EXTENSIONS, type BillingCancelResponse, type BillingStatus, CALLER, type CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, 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, DeploymentVia, type DeploymentViaType, 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, MY_API_KEY_URL, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, PUBLIC_DEPLOYMENT_TTL_SECONDS, type PingResponse, type PlatformLimits, type ResourceContext, SHIP_ENV, type SPACheckDebug, type SPACheckRequest, type SPACheckResponse, SPA_CHECK_CONSTRAINTS, 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, WEB_FILE_ACCEPT, __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, normalizeVia, optimizeDeployPaths, pluralize, processFilesForNode, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validatePassword, validateToken };
|