@shipstatic/ship 0.4.8 → 0.4.10
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 +2 -2
- package/dist/browser.d.ts +7 -22
- package/dist/browser.js +13 -13
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +13 -13
- 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 +7 -22
- package/dist/index.d.ts +7 -22
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -179,12 +179,12 @@ ship.on('error', (error, url) => console.error(error));
|
|
|
179
179
|
### Error Handling
|
|
180
180
|
|
|
181
181
|
```javascript
|
|
182
|
-
import {
|
|
182
|
+
import { isShipError } from '@shipstatic/types';
|
|
183
183
|
|
|
184
184
|
try {
|
|
185
185
|
await ship.deployments.create('./dist');
|
|
186
186
|
} catch (error) {
|
|
187
|
-
if (error
|
|
187
|
+
if (isShipError(error)) {
|
|
188
188
|
if (error.isAuthError()) { /* ... */ }
|
|
189
189
|
if (error.isValidationError()) { /* ... */ }
|
|
190
190
|
if (error.isNetworkError()) { /* ... */ }
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _shipstatic_types from '@shipstatic/types';
|
|
2
|
-
import { ProgressInfo, StaticFile, Deployment, DeploymentListResponse, Domain, DomainListResponse, DomainDnsResponse, DomainRecordsResponse, TokenCreateResponse, TokenListResponse, Account, ConfigResponse, PingResponse, PlatformConfig, ResolvedConfig, DeployInput, AccountResource, DeploymentResource, DomainResource, TokenResource, ValidatableFile, FileValidationResult
|
|
2
|
+
import { ProgressInfo, StaticFile, Deployment, DeploymentListResponse, Domain, DomainListResponse, DomainDnsResponse, DomainRecordsResponse, TokenCreateResponse, TokenListResponse, Account, ConfigResponse, PingResponse, PlatformConfig, ResolvedConfig, DeployInput, AccountResource, DeploymentResource, DomainResource, TokenResource, ValidatableFile, FileValidationResult } from '@shipstatic/types';
|
|
3
3
|
export * from '@shipstatic/types';
|
|
4
4
|
export { Account, AccountResource, DEFAULT_API, DeployInput, Deployment, DeploymentResource, Domain, DomainResource, ErrorType, FileValidationStatus as FILE_VALIDATION_STATUS, PingResponse, ResolvedConfig, ShipError, StaticFile, TokenResource } from '@shipstatic/types';
|
|
5
5
|
|
|
@@ -208,6 +208,11 @@ declare class ApiHttp extends SimpleEvents {
|
|
|
208
208
|
domain: string;
|
|
209
209
|
hash: string;
|
|
210
210
|
}>;
|
|
211
|
+
validateDomain(name: string): Promise<{
|
|
212
|
+
valid: boolean;
|
|
213
|
+
normalized?: string;
|
|
214
|
+
error?: string;
|
|
215
|
+
}>;
|
|
211
216
|
createToken(ttl?: number, tags?: string[]): Promise<TokenCreateResponse>;
|
|
212
217
|
listTokens(): Promise<TokenListResponse>;
|
|
213
218
|
removeToken(token: string): Promise<void>;
|
|
@@ -565,26 +570,6 @@ declare function getValidFiles<T extends ValidatableFile>(files: T[]): T[];
|
|
|
565
570
|
*/
|
|
566
571
|
declare function allValidFilesReady<T extends ValidatableFile>(files: T[]): boolean;
|
|
567
572
|
|
|
568
|
-
/**
|
|
569
|
-
* @file Error utilities for consistent error handling across SDK consumers.
|
|
570
|
-
*/
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Ensure any error is wrapped as a ShipError.
|
|
574
|
-
* Useful for catch blocks where the error type is unknown.
|
|
575
|
-
*
|
|
576
|
-
* @example
|
|
577
|
-
* ```ts
|
|
578
|
-
* try {
|
|
579
|
-
* await someOperation();
|
|
580
|
-
* } catch (err) {
|
|
581
|
-
* const shipError = ensureShipError(err);
|
|
582
|
-
* // Now you can safely use shipError.message, shipError.type, etc.
|
|
583
|
-
* }
|
|
584
|
-
* ```
|
|
585
|
-
*/
|
|
586
|
-
declare function ensureShipError(err: unknown): ShipError;
|
|
587
|
-
|
|
588
573
|
/**
|
|
589
574
|
* @file Platform configuration management for the Ship SDK.
|
|
590
575
|
* Implements fail-fast dynamic configuration with mandatory API fetch.
|
|
@@ -649,4 +634,4 @@ declare class Ship extends Ship$1 {
|
|
|
649
634
|
protected getDeployBodyCreator(): DeployBodyCreator;
|
|
650
635
|
}
|
|
651
636
|
|
|
652
|
-
export { type ApiDeployOptions, ApiHttp, type ApiHttpOptions, type DeployBody, type DeployBodyCreator, type DeployFile, type DeploymentOptions, type DeploymentResourceContext, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ResourceContext, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, allValidFilesReady, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default,
|
|
637
|
+
export { type ApiDeployOptions, ApiHttp, type ApiHttpOptions, type DeployBody, type DeployBodyCreator, type DeployFile, type DeploymentOptions, type DeploymentResourceContext, type ExecutionEnvironment, JUNK_DIRECTORIES, type MD5Result, type ResourceContext, Ship, type ShipClientOptions, type ShipEvents, __setTestEnvironment, allValidFilesReady, calculateMD5, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, filterJunk, formatFileSize, getCurrentConfig, getENV, getValidFiles, loadConfig, mergeDeployOptions, optimizeDeployPaths, pluralize, processFilesForBrowser, resolveConfig, setConfig as setPlatformConfig, validateFiles };
|