@shipstatic/ship 0.2.7-alpha.1 → 0.3.0
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 +28 -19
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +25 -20
- 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 +28 -19
- package/dist/index.d.ts +28 -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,26 +201,29 @@ 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>;
|
|
224
|
+
createToken(ttl?: number, tags?: string[]): Promise<TokenCreateResponse>;
|
|
225
|
+
listTokens(): Promise<TokenListResponse>;
|
|
226
|
+
removeToken(token: string): Promise<void>;
|
|
224
227
|
checkSPA(files: StaticFile[]): Promise<boolean>;
|
|
225
228
|
private validateFiles;
|
|
226
229
|
private prepareRequestPayload;
|
|
@@ -230,12 +233,13 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
230
233
|
}
|
|
231
234
|
|
|
232
235
|
/**
|
|
233
|
-
* @file Ship SDK resource implementations for deployments,
|
|
236
|
+
* @file Ship SDK resource implementations for deployments, domains, and accounts.
|
|
234
237
|
*/
|
|
235
238
|
|
|
236
239
|
declare function createDeploymentResource(getApi: () => ApiHttp, clientDefaults?: ShipClientOptions, ensureInit?: () => Promise<void>, processInput?: (input: DeployInput, options: DeploymentOptions) => Promise<StaticFile[]>): DeploymentResource;
|
|
237
|
-
declare function
|
|
240
|
+
declare function createDomainResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): DomainResource;
|
|
238
241
|
declare function createAccountResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): AccountResource;
|
|
242
|
+
declare function createTokenResource(getApi: () => ApiHttp, ensureInit?: () => Promise<void>): TokenResource;
|
|
239
243
|
|
|
240
244
|
/**
|
|
241
245
|
* Abstract base class for Ship SDK implementations.
|
|
@@ -248,8 +252,9 @@ declare abstract class Ship$1 {
|
|
|
248
252
|
protected readonly clientOptions: ShipClientOptions;
|
|
249
253
|
protected initPromise: Promise<void> | null;
|
|
250
254
|
protected _deployments: DeploymentResource;
|
|
251
|
-
protected
|
|
255
|
+
protected _domains: DomainResource;
|
|
252
256
|
protected _account: AccountResource;
|
|
257
|
+
protected _tokens: TokenResource;
|
|
253
258
|
constructor(options?: ShipClientOptions);
|
|
254
259
|
protected abstract resolveInitialConfig(options: ShipClientOptions): any;
|
|
255
260
|
protected abstract loadFullConfig(): Promise<void>;
|
|
@@ -275,13 +280,17 @@ declare abstract class Ship$1 {
|
|
|
275
280
|
*/
|
|
276
281
|
get deployments(): DeploymentResource;
|
|
277
282
|
/**
|
|
278
|
-
* Get
|
|
283
|
+
* Get domains resource
|
|
279
284
|
*/
|
|
280
|
-
get
|
|
285
|
+
get domains(): DomainResource;
|
|
281
286
|
/**
|
|
282
287
|
* Get account resource
|
|
283
288
|
*/
|
|
284
289
|
get account(): AccountResource;
|
|
290
|
+
/**
|
|
291
|
+
* Get tokens resource
|
|
292
|
+
*/
|
|
293
|
+
get tokens(): TokenResource;
|
|
285
294
|
/**
|
|
286
295
|
* Add event listener
|
|
287
296
|
* @param event - Event name
|
|
@@ -497,4 +506,4 @@ declare class Ship extends Ship$1 {
|
|
|
497
506
|
protected processInput(input: DeployInput, options: DeploymentOptions): Promise<StaticFile[]>;
|
|
498
507
|
}
|
|
499
508
|
|
|
500
|
-
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,
|
|
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, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, getCurrentConfig, getENV, loadConfig, mergeDeployOptions, optimizeDeployPaths, pluralize, processFilesForBrowser, resolveConfig, setConfig as setPlatformConfig };
|