@shipstatic/ship 0.2.8 → 0.3.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 +29 -29
- package/dist/browser.d.ts +25 -19
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +27 -27
- package/dist/cli.cjs.map +1 -1
- package/dist/completions/ship.bash +3 -3
- package/dist/completions/ship.fish +6 -6
- package/dist/completions/ship.zsh +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -19
- package/dist/index.d.ts +25 -19
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -99,13 +99,13 @@ ship list # List deployments
|
|
|
99
99
|
ship get abc123 # Get deployment details
|
|
100
100
|
ship remove abc123 # Remove deployment
|
|
101
101
|
|
|
102
|
-
# Manage
|
|
103
|
-
ship
|
|
104
|
-
ship
|
|
105
|
-
ship
|
|
106
|
-
ship
|
|
107
|
-
ship
|
|
108
|
-
ship
|
|
102
|
+
# Manage domains
|
|
103
|
+
ship domains list # List domains
|
|
104
|
+
ship domains set staging abc123 # Set domain to deployment
|
|
105
|
+
ship domains set prod abc123 --tag production # Set domain with tag
|
|
106
|
+
ship domains set prod abc123 --tag prod --tag v1 # Set domain with multiple tags
|
|
107
|
+
ship domains confirm www.example.com # Trigger DNS confirmation
|
|
108
|
+
ship domains remove staging # Remove domain
|
|
109
109
|
|
|
110
110
|
# Account
|
|
111
111
|
ship account # Get account details
|
|
@@ -157,7 +157,7 @@ interface ShipOptions {
|
|
|
157
157
|
|
|
158
158
|
- `ship.ping()` - Check API connectivity
|
|
159
159
|
- `ship.deployments` - Access deployment resource
|
|
160
|
-
- `ship.
|
|
160
|
+
- `ship.domains` - Access domain resource
|
|
161
161
|
- `ship.account` - Access account resource
|
|
162
162
|
- `ship.on(event, handler)` - Add event listener for API observability
|
|
163
163
|
- `ship.off(event, handler)` - Remove event listener
|
|
@@ -209,35 +209,35 @@ interface DeployOptions {
|
|
|
209
209
|
}
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
-
###
|
|
212
|
+
### Domains Resource
|
|
213
213
|
|
|
214
214
|
```typescript
|
|
215
|
-
// Set or update
|
|
216
|
-
await ship.
|
|
215
|
+
// Set or update a domain (with optional tags)
|
|
216
|
+
await ship.domains.set(domainName, deploymentId, tags?)
|
|
217
217
|
|
|
218
|
-
// Get
|
|
219
|
-
await ship.
|
|
218
|
+
// Get domain details
|
|
219
|
+
await ship.domains.get(domainName)
|
|
220
220
|
|
|
221
|
-
// List all
|
|
222
|
-
await ship.
|
|
221
|
+
// List all domains
|
|
222
|
+
await ship.domains.list()
|
|
223
223
|
|
|
224
|
-
// Remove
|
|
225
|
-
await ship.
|
|
224
|
+
// Remove domain
|
|
225
|
+
await ship.domains.remove(domainName)
|
|
226
226
|
|
|
227
|
-
// Trigger DNS confirmation for external
|
|
228
|
-
await ship.
|
|
227
|
+
// Trigger DNS confirmation for external domain
|
|
228
|
+
await ship.domains.confirm(domainName)
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
**Examples:**
|
|
232
232
|
```javascript
|
|
233
|
-
// Set
|
|
234
|
-
await ship.
|
|
233
|
+
// Set domain without tags
|
|
234
|
+
await ship.domains.set('staging', 'dep_abc123');
|
|
235
235
|
|
|
236
|
-
// Set
|
|
237
|
-
await ship.
|
|
236
|
+
// Set domain with tags
|
|
237
|
+
await ship.domains.set('production', 'dep_xyz789', ['prod', 'v1.0.0']);
|
|
238
238
|
|
|
239
|
-
// Confirm DNS for external
|
|
240
|
-
await ship.
|
|
239
|
+
// Confirm DNS for external domain
|
|
240
|
+
await ship.domains.confirm('www.example.com');
|
|
241
241
|
```
|
|
242
242
|
|
|
243
243
|
### Environment-Specific Examples
|
|
@@ -586,11 +586,11 @@ ship get abc123 # Get deployment details
|
|
|
586
586
|
ship remove abc123 # Remove deployment
|
|
587
587
|
```
|
|
588
588
|
|
|
589
|
-
###
|
|
589
|
+
### Domain Commands
|
|
590
590
|
|
|
591
591
|
```bash
|
|
592
|
-
ship
|
|
593
|
-
ship
|
|
592
|
+
ship domains # List domains
|
|
593
|
+
ship domains set staging abc123 # Set domain to deployment
|
|
594
594
|
```
|
|
595
595
|
|
|
596
596
|
### Account Commands
|
|
@@ -705,7 +705,7 @@ File Objects → Path Extraction → Junk Filtering → Content Processing → S
|
|
|
705
705
|
Ship SDK provides comprehensive deployment functionality:
|
|
706
706
|
|
|
707
707
|
- **Deployment Resource**: Complete operations (create, list, get, remove)
|
|
708
|
-
- **
|
|
708
|
+
- **Domain Resource**: Complete operations (set, get, list, remove)
|
|
709
709
|
- **Account Resource**: Account information retrieval
|
|
710
710
|
- **Event System**: Comprehensive observability with request, response, error events
|
|
711
711
|
- **Unified Error System**: Single `ShipError` class with factory methods
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _shipstatic_types from '@shipstatic/types';
|
|
2
|
-
import { PingResponse, ConfigResponse, StaticFile, Deployment, DeploymentListResponse,
|
|
2
|
+
import { PingResponse, ConfigResponse, StaticFile, Deployment, DeploymentListResponse, Domain, DomainListResponse, Account, TokenCreateResponse, TokenListResponse, DeployInput, DeploymentResource, DomainResource, AccountResource, TokenResource, PlatformConfig } from '@shipstatic/types';
|
|
3
3
|
export * from '@shipstatic/types';
|
|
4
|
-
export { Account,
|
|
4
|
+
export { Account, DEFAULT_API, DeployInput, Deployment, Domain, PingResponse, ShipError, ShipErrorType } from '@shipstatic/types';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @file SDK-specific type definitions
|
|
@@ -201,23 +201,23 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
201
201
|
listDeployments(): Promise<DeploymentListResponse>;
|
|
202
202
|
getDeployment(id: string): Promise<Deployment>;
|
|
203
203
|
removeDeployment(id: string): Promise<void>;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
setDomain(name: string, deployment: string, tags?: string[]): Promise<Domain>;
|
|
205
|
+
getDomain(name: string): Promise<Domain>;
|
|
206
|
+
listDomains(): Promise<DomainListResponse>;
|
|
207
|
+
removeDomain(name: string): Promise<void>;
|
|
208
|
+
confirmDomain(name: string): Promise<{
|
|
209
209
|
message: string;
|
|
210
210
|
}>;
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
getDomainDns(name: string): Promise<{
|
|
212
|
+
domain: string;
|
|
213
213
|
dns: any;
|
|
214
214
|
}>;
|
|
215
|
-
|
|
216
|
-
|
|
215
|
+
getDomainRecords(name: string): Promise<{
|
|
216
|
+
domain: string;
|
|
217
217
|
records: any[];
|
|
218
218
|
}>;
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
getDomainShare(name: string): Promise<{
|
|
220
|
+
domain: string;
|
|
221
221
|
hash: string;
|
|
222
222
|
}>;
|
|
223
223
|
getAccount(): Promise<Account>;
|
|
@@ -233,11 +233,11 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
|
-
* @file Ship SDK resource implementations for deployments,
|
|
236
|
+
* @file Ship SDK resource implementations for deployments, domains, and accounts.
|
|
237
237
|
*/
|
|
238
238
|
|
|
239
239
|
declare function createDeploymentResource(getApi: () => ApiHttp, clientDefaults?: ShipClientOptions, ensureInit?: () => Promise<void>, processInput?: (input: DeployInput, options: DeploymentOptions) => Promise<StaticFile[]>): DeploymentResource;
|
|
240
|
-
declare function
|
|
240
|
+
declare function createDomainResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): DomainResource;
|
|
241
241
|
declare function createAccountResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): AccountResource;
|
|
242
242
|
declare function createTokenResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): TokenResource;
|
|
243
243
|
|
|
@@ -251,8 +251,9 @@ declare abstract class Ship$1 {
|
|
|
251
251
|
protected http: ApiHttp;
|
|
252
252
|
protected readonly clientOptions: ShipClientOptions;
|
|
253
253
|
protected initPromise: Promise<void> | null;
|
|
254
|
+
protected _config: ConfigResponse | null;
|
|
254
255
|
protected _deployments: DeploymentResource;
|
|
255
|
-
protected
|
|
256
|
+
protected _domains: DomainResource;
|
|
256
257
|
protected _account: AccountResource;
|
|
257
258
|
protected _tokens: TokenResource;
|
|
258
259
|
constructor(options?: ShipClientOptions);
|
|
@@ -280,9 +281,9 @@ declare abstract class Ship$1 {
|
|
|
280
281
|
*/
|
|
281
282
|
get deployments(): DeploymentResource;
|
|
282
283
|
/**
|
|
283
|
-
* Get
|
|
284
|
+
* Get domains resource
|
|
284
285
|
*/
|
|
285
|
-
get
|
|
286
|
+
get domains(): DomainResource;
|
|
286
287
|
/**
|
|
287
288
|
* Get account resource
|
|
288
289
|
*/
|
|
@@ -291,6 +292,11 @@ declare abstract class Ship$1 {
|
|
|
291
292
|
* Get tokens resource
|
|
292
293
|
*/
|
|
293
294
|
get tokens(): TokenResource;
|
|
295
|
+
/**
|
|
296
|
+
* Get API configuration (file upload limits, etc.)
|
|
297
|
+
* Reuses platform config fetched during initialization, then caches the result
|
|
298
|
+
*/
|
|
299
|
+
getConfig(): Promise<ConfigResponse>;
|
|
294
300
|
/**
|
|
295
301
|
* Add event listener
|
|
296
302
|
* @param event - Event name
|
|
@@ -506,4 +512,4 @@ declare class Ship extends Ship$1 {
|
|
|
506
512
|
protected processInput(input: DeployInput, options: DeploymentOptions): Promise<StaticFile[]>;
|
|
507
513
|
}
|
|
508
514
|
|
|
509
|
-
export { type ApiDeployOptions, ApiHttp, type Config, type DeployFile, type DeploymentOptions, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ProgressStats, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, calculateMD5, createAccountResource,
|
|
515
|
+
export { type ApiDeployOptions, ApiHttp, type Config, type DeployFile, type DeploymentOptions, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ProgressStats, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, getCurrentConfig, getENV, loadConfig, mergeDeployOptions, optimizeDeployPaths, pluralize, processFilesForBrowser, resolveConfig, setConfig as setPlatformConfig };
|