@shipstatic/ship 0.4.7 → 0.4.9
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 +5 -23
- package/dist/browser.js +5 -5
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +17 -17
- 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 +3 -23
- package/dist/index.d.ts +3 -23
- 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
|
|
|
@@ -104,7 +104,7 @@ interface ShipClientOptions {
|
|
|
104
104
|
* Event map for Ship SDK events
|
|
105
105
|
* Core events for observability: request, response, error
|
|
106
106
|
*/
|
|
107
|
-
interface ShipEvents
|
|
107
|
+
interface ShipEvents {
|
|
108
108
|
/** Emitted before each API request */
|
|
109
109
|
request: [url: string, init: RequestInit];
|
|
110
110
|
/** Emitted after successful API response */
|
|
@@ -565,26 +565,6 @@ declare function getValidFiles<T extends ValidatableFile>(files: T[]): T[];
|
|
|
565
565
|
*/
|
|
566
566
|
declare function allValidFilesReady<T extends ValidatableFile>(files: T[]): boolean;
|
|
567
567
|
|
|
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
568
|
/**
|
|
589
569
|
* @file Platform configuration management for the Ship SDK.
|
|
590
570
|
* Implements fail-fast dynamic configuration with mandatory API fetch.
|
|
@@ -644,7 +624,9 @@ declare class Ship extends Ship$1 {
|
|
|
644
624
|
protected resolveInitialConfig(options: ShipClientOptions): ResolvedConfig;
|
|
645
625
|
protected loadFullConfig(): Promise<void>;
|
|
646
626
|
protected processInput(input: DeployInput, options: DeploymentOptions): Promise<StaticFile[]>;
|
|
627
|
+
/** Type guard that validates all elements are File objects */
|
|
628
|
+
private isFileArray;
|
|
647
629
|
protected getDeployBodyCreator(): DeployBodyCreator;
|
|
648
630
|
}
|
|
649
631
|
|
|
650
|
-
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,
|
|
632
|
+
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 };
|