@shiplohq/contracts
v0.1.1
Published
Shared API contracts, DTOs, and error codes for the Shiplo deploy platform
Readme
@shiplohq/contracts
Shared API contracts for the Shiplo deploy platform: the DTOs, error codes, and media-file helpers that the Shiplo API, worker, and MCP server all agree on — one source of truth so every client and service speaks the same types.
You normally don't install this directly — it ships as a dependency of @shiplohq/mcp. Install it on its own only when building your own client against the Shiplo API.
Install
npm install @shiplohq/contractsUsage
import { ApiErrorException, ErrorCode, isMediaFile, STORAGE_QUOTA_EXCEEDED } from '@shiplohq/contracts';
if (isMediaFile('hero.avif')) {
// media handling path
}
throw new ApiErrorException(
createApiError(ErrorCode.STORAGE_QUOTA_EXCEEDED, 'Site storage quota exceeded'),
402
);What's inside
errors—ErrorCodeenum, stable error-code constants (STORAGE_QUOTA_EXCEEDED,DAILY_BUILD_LIMIT, ...),ApiErrorshape,ApiErrorExceptiondto— request/response DTOs shared across the platform (plans, sites, deployments, bandwidth, showcase)ops— ops-token scopes and context typesmedia— media file classification helpers
License
MIT
