feat: add Capawesome Cloud Node.js SDK#1
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces the initial Capawesome Cloud Node.js SDK: a typed, promise-based ESM client (Node 20+) built on native fetch, with resource classes mirroring the API hierarchy, plus tooling/docs/tests to build and validate the package.
Changes:
- Added
CapawesomeCloudclient,HttpClient, error type, shared types, and a full set of resource wrappers for the API. - Added Vitest-based tests (mocking
fetch) to validate request construction, error handling, and a few representative resources. - Added project tooling/configuration (tsdown build, TypeScript config, ESLint/Prettier/Husky, CI workflow) and expanded README documentation.
Reviewed changes
Copilot reviewed 34 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Adds Vitest configuration for running Node-based tests. |
| tsdown.config.ts | Adds tsdown build configuration (ESM, Node 20 target, d.ts). |
| tsconfig.json | Adds strict TypeScript compiler configuration for SDK source. |
| test/resources.test.ts | Tests representative resource behaviors (nested paths, multipart, streaming). |
| test/http-client.test.ts | Tests auth header/baseUrl, query serialization, and error mapping. |
| test/helpers.ts | Adds fetch mocking helper for tests. |
| src/types.ts | Defines shared SDK types (platforms, build types, pagination). |
| src/resources/webhooks.ts | Adds Webhooks resource wrapper and types. |
| src/resources/jobs.ts | Adds Jobs top-level resource wrapper and types. |
| src/resources/environments.ts | Adds Environments resource wrapper and secrets/variables sub-resources wiring. |
| src/resources/environment-variables.ts | Adds Environment Variables resource wrapper and types. |
| src/resources/environment-secrets.ts | Adds Environment Secrets resource wrapper and types. |
| src/resources/devices.ts | Adds Devices resource wrapper and types. |
| src/resources/destinations.ts | Adds Destinations resource wrapper and types. |
| src/resources/deployments.ts | Adds Deployments resource wrapper and types. |
| src/resources/channels.ts | Adds Channels resource wrapper including pause/resume operations. |
| src/resources/certificates.ts | Adds Certificates resource wrapper including multipart upload. |
| src/resources/builds.ts | Adds Builds resource wrapper and artifacts sub-resource wiring. |
| src/resources/build-sources.ts | Adds Build Sources resource wrapper including stream download. |
| src/resources/build-artifacts.ts | Adds Build Artifacts resource wrapper including stream download and signed URL. |
| src/resources/base.ts | Adds shared BaseResource for resource classes. |
| src/resources/automations.ts | Adds Automations resource wrapper and types. |
| src/resources/apps.ts | Adds Apps resource wrapper and nests app-scoped sub-resources. |
| src/index.ts | Exposes public SDK entrypoint exports. |
| src/http-client.ts | Implements authenticated fetch wrapper, query/body serialization, and error mapping. |
| src/errors.ts | Adds CapawesomeCloudError with status/statusText/body and message extraction. |
| src/client.ts | Implements CapawesomeCloud client and resource composition. |
| README.md | Adds full SDK documentation (install, usage, resources, errors, development). |
| package.json | Adds package metadata, exports, scripts, engines, and dev dependencies. |
| LICENSE | Adds MIT license file. |
| eslint.config.js | Adds ESLint config with TypeScript rules. |
| .prettierrc.json | Adds Prettier config (single quotes, trailing commas, import organization). |
| .npmrc | Configures npm to save exact dependency versions. |
| .husky/pre-commit | Adds pre-commit hook to run lint-staged. |
| .gitignore | Adds standard ignores for node_modules/dist/coverage/logs. |
| .github/workflows/ci.yml | Adds CI workflow for build/test/lint/typecheck on Node 24. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- HTTP client: configurable request timeout and retry-with-backoff for network errors, 429 (with Retry-After), and 5xx on idempotent requests; trim the API token - Errors: extract messages from validation and array response body shapes - Require organizationId on apps.list and jobs.list - Add example scripts and an examples tsconfig - Upgrade vitest to v4 and add tsx for running examples Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds the initial implementation of the Capawesome Cloud Node.js SDK — a fully typed, promise-based client for the Capawesome Cloud API.
What's included
CapawesomeCloudwith an API token stored at construction and an optionalbaseUrloverride. Built on nativefetchwith zero runtime dependencies (ESM-only, Node 20+).client.apps.*(e.g.client.apps.channels,client.apps.builds.artifacts,client.apps.environments.secrets); top-levelclient.jobsis exposed directly.apps,channels,deployments,builds(+artifacts),buildSources,certificates,destinations,environments(+secrets,variables),automations,devices,webhooks,jobsCapawesomeCloudErrorcarryingstatus,statusText, and the parsedbody.ReadableStreamso large files can be streamed without buffering.FormData.Tooling
tsc.fetchmocked).commit-and-tag-version.Documentation
README.mdcovers installation, usage examples per resource group, the full resource list, error handling, and a Development section (setup, testing, publishing).