Skip to content

feat: add Capawesome Cloud Node.js SDK#1

Merged
robingenz merged 4 commits into
mainfrom
feat/initial-sdk
Jun 2, 2026
Merged

feat: add Capawesome Cloud Node.js SDK#1
robingenz merged 4 commits into
mainfrom
feat/initial-sdk

Conversation

@robingenz

Copy link
Copy Markdown
Member

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

  • ClientCapawesomeCloud with an API token stored at construction and an optional baseUrl override. Built on native fetch with zero runtime dependencies (ESM-only, Node 20+).
  • Resources — full coverage of the published OpenAPI spec, organized to mirror the API's path hierarchy. App-scoped resources are nested under client.apps.* (e.g. client.apps.channels, client.apps.builds.artifacts, client.apps.environments.secrets); top-level client.jobs is exposed directly.
    • apps, channels, deployments, builds (+ artifacts), buildSources, certificates, destinations, environments (+ secrets, variables), automations, devices, webhooks, jobs
  • Types — response interfaces intentionally expose only the most relevant properties to limit breaking changes while the API is still evolving.
  • Errors — non-2xx responses throw a CapawesomeCloudError carrying status, statusText, and the parsed body.
  • Binary downloads — artifacts and build sources return a ReadableStream so large files can be streamed without buffering.
  • Certificate upload — multipart upload via native FormData.

Tooling

  • Build with tsdown (ESM), type-checking via tsc.
  • Tests with Vitest (fetch mocked).
  • ESLint + Prettier, with Husky + lint-staged pre-commit formatting.
  • GitHub Actions CI (build, test, lint + typecheck) on Node 24.
  • Releases via commit-and-tag-version.

Documentation

README.md covers installation, usage examples per resource group, the full resource list, error handling, and a Development section (setup, testing, publishing).

Copilot AI review requested due to automatic review settings June 1, 2026 13:25
@robingenz robingenz self-assigned this Jun 1, 2026
@robingenz robingenz added the feature Feature label Jun 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CapawesomeCloud client, 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.

Comment thread src/http-client.ts
Comment thread src/resources/certificates.ts
robingenz and others added 3 commits June 2, 2026 08:13
- 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>
@robingenz robingenz merged commit d615ee4 into main Jun 2, 2026
3 checks passed
@robingenz robingenz deleted the feat/initial-sdk branch June 2, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants