@shipstatic/ship 0.4.25 → 0.5.1
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 +17 -20
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +13 -13
- package/dist/cli.cjs.map +1 -1
- package/dist/completions/ship.bash +31 -21
- package/dist/completions/ship.fish +20 -7
- package/dist/completions/ship.zsh +30 -21
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,26 +18,26 @@ npm install @shipstatic/ship
|
|
|
18
18
|
# Deploy a directory
|
|
19
19
|
ship ./dist
|
|
20
20
|
|
|
21
|
-
# Deploy with
|
|
22
|
-
ship ./dist --
|
|
21
|
+
# Deploy with labels
|
|
22
|
+
ship ./dist --label production --label v1.0.0
|
|
23
23
|
|
|
24
24
|
# Deployments
|
|
25
25
|
ship deployments list
|
|
26
26
|
ship deployments get <id>
|
|
27
|
-
ship deployments set <id> --
|
|
27
|
+
ship deployments set <id> --label production # Update labels
|
|
28
28
|
ship deployments remove <id>
|
|
29
29
|
|
|
30
30
|
# Domains
|
|
31
31
|
ship domains list
|
|
32
|
-
ship domains set staging <deployment-id>
|
|
33
|
-
ship domains set staging --
|
|
32
|
+
ship domains set staging <deployment-id> # Link domain to deployment
|
|
33
|
+
ship domains set staging --label production # Update domain labels
|
|
34
34
|
ship domains get staging
|
|
35
35
|
ship domains verify www.example.com
|
|
36
36
|
ship domains remove staging
|
|
37
37
|
|
|
38
38
|
# Tokens
|
|
39
39
|
ship tokens list
|
|
40
|
-
ship tokens create --ttl 3600 --
|
|
40
|
+
ship tokens create --ttl 3600 --label ci
|
|
41
41
|
ship tokens remove <token>
|
|
42
42
|
|
|
43
43
|
# Account
|
|
@@ -64,9 +64,9 @@ console.log(`Deployed: ${result.url}`);
|
|
|
64
64
|
await ship.domains.set('staging', { deployment: result.deployment });
|
|
65
65
|
await ship.domains.list();
|
|
66
66
|
|
|
67
|
-
// Update
|
|
68
|
-
await ship.deployments.set(result.deployment, {
|
|
69
|
-
await ship.domains.set('staging', {
|
|
67
|
+
// Update labels
|
|
68
|
+
await ship.deployments.set(result.deployment, { labels: ['production', 'v1.0'] });
|
|
69
|
+
await ship.domains.set('staging', { labels: ['live'] });
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## Browser Usage
|
|
@@ -123,18 +123,18 @@ SHIP_API_KEY=ship-your-api-key
|
|
|
123
123
|
ship.deployments.create(input, options?) // Create new deployment
|
|
124
124
|
ship.deployments.list() // List all deployments
|
|
125
125
|
ship.deployments.get(id) // Get deployment details
|
|
126
|
-
ship.deployments.set(id, {
|
|
126
|
+
ship.deployments.set(id, { labels }) // Update deployment labels
|
|
127
127
|
ship.deployments.remove(id) // Delete deployment
|
|
128
128
|
|
|
129
129
|
// Domains
|
|
130
|
-
ship.domains.set(name, { deployment?,
|
|
130
|
+
ship.domains.set(name, { deployment?, labels? }) // Create/update domain (see below)
|
|
131
131
|
ship.domains.get(name) // Get domain details
|
|
132
132
|
ship.domains.list() // List all domains
|
|
133
133
|
ship.domains.remove(name) // Delete domain
|
|
134
134
|
ship.domains.verify(name) // Trigger DNS verification
|
|
135
135
|
|
|
136
136
|
// Tokens
|
|
137
|
-
ship.tokens.create({ ttl?,
|
|
137
|
+
ship.tokens.create({ ttl?, labels? }) // Create deploy token
|
|
138
138
|
ship.tokens.list() // List all tokens
|
|
139
139
|
ship.tokens.remove(token) // Revoke token
|
|
140
140
|
|
|
@@ -148,17 +148,14 @@ ship.ping() // Check API connectivity
|
|
|
148
148
|
### domains.set() Behavior
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
|
-
//
|
|
151
|
+
// Link domain to deployment
|
|
152
152
|
ship.domains.set('staging', { deployment: 'abc123' });
|
|
153
153
|
|
|
154
|
-
//
|
|
155
|
-
ship.domains.set('staging', { deployment: 'abc123',
|
|
154
|
+
// Link domain to deployment with labels
|
|
155
|
+
ship.domains.set('staging', { deployment: 'abc123', labels: ['prod'] });
|
|
156
156
|
|
|
157
|
-
// Update
|
|
158
|
-
ship.domains.set('staging', {
|
|
159
|
-
|
|
160
|
-
// Error: must provide deployment or tags
|
|
161
|
-
ship.domains.set('staging', {}); // throws validation error
|
|
157
|
+
// Update labels only (domain must exist)
|
|
158
|
+
ship.domains.set('staging', { labels: ['prod', 'v2'] });
|
|
162
159
|
```
|
|
163
160
|
|
|
164
161
|
**Domain format:** Domain names are FQDNs (Fully Qualified Domain Names). The SDK accepts any format (case-insensitive, Unicode) - the API handles normalization.
|
package/dist/browser.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ interface DeploymentOptions {
|
|
|
33
33
|
pathDetect?: boolean;
|
|
34
34
|
/** Whether to auto-detect SPAs and generate ship.json configuration. Defaults to true. */
|
|
35
35
|
spaDetect?: boolean;
|
|
36
|
-
/** Optional array of
|
|
37
|
-
|
|
36
|
+
/** Optional array of labels for categorization and filtering (lowercase, alphanumeric with separators). */
|
|
37
|
+
labels?: string[];
|
|
38
38
|
/** Callback for deploy progress with detailed statistics. */
|
|
39
39
|
onProgress?: (info: ProgressInfo) => void;
|
|
40
40
|
/** Client/tool identifier for this deployment (e.g., 'sdk', 'cli', 'web'). Alphanumeric only. */
|
|
@@ -55,7 +55,7 @@ interface DeployBody {
|
|
|
55
55
|
* Function that creates a deploy request body from files.
|
|
56
56
|
* Implemented differently for Node.js and Browser.
|
|
57
57
|
*/
|
|
58
|
-
type DeployBodyCreator = (files: StaticFile[],
|
|
58
|
+
type DeployBodyCreator = (files: StaticFile[], labels?: string[], via?: string) => Promise<DeployBody>;
|
|
59
59
|
/**
|
|
60
60
|
* Options for configuring a `Ship` instance.
|
|
61
61
|
* Sets default API host, authentication credentials, progress callbacks, concurrency, and timeouts for the client.
|
|
@@ -192,12 +192,12 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
192
192
|
deploy(files: StaticFile[], options?: ApiDeployOptions): Promise<Deployment>;
|
|
193
193
|
listDeployments(): Promise<DeploymentListResponse>;
|
|
194
194
|
getDeployment(id: string): Promise<Deployment>;
|
|
195
|
-
|
|
195
|
+
updateDeploymentLabels(id: string, labels: string[]): Promise<Deployment>;
|
|
196
196
|
removeDeployment(id: string): Promise<void>;
|
|
197
|
-
setDomain(name: string, deployment?: string,
|
|
197
|
+
setDomain(name: string, deployment?: string, labels?: string[]): Promise<Domain>;
|
|
198
198
|
listDomains(): Promise<DomainListResponse>;
|
|
199
199
|
getDomain(name: string): Promise<Domain>;
|
|
200
|
-
|
|
200
|
+
updateDomainLabels(name: string, labels: string[]): Promise<Domain>;
|
|
201
201
|
removeDomain(name: string): Promise<void>;
|
|
202
202
|
verifyDomain(name: string): Promise<{
|
|
203
203
|
message: string;
|
|
@@ -209,7 +209,7 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
209
209
|
hash: string;
|
|
210
210
|
}>;
|
|
211
211
|
validateDomain(name: string): Promise<DomainValidateResponse>;
|
|
212
|
-
createToken(ttl?: number,
|
|
212
|
+
createToken(ttl?: number, labels?: string[]): Promise<TokenCreateResponse>;
|
|
213
213
|
listTokens(): Promise<TokenListResponse>;
|
|
214
214
|
removeToken(token: string): Promise<void>;
|
|
215
215
|
getAccount(): Promise<Account>;
|