Skip to content

feat: add organization, user and Git repository resources - #5

Merged
robingenz merged 8 commits into
mainfrom
feat/mcp-server-support
Aug 17, 2026
Merged

feat: add organization, user and Git repository resources#5
robingenz merged 8 commits into
mainfrom
feat/mcp-server-support

Conversation

@robingenz

@robingenz robingenz commented Aug 16, 2026

Copy link
Copy Markdown
Member

What

Extends the SDK with the resources and options required by the upcoming Capawesome MCP server.

Client configuration

  • New fetch option (fetch?: typeof fetch), used for all requests and defaulting to globalThis.fetch. This lets consumers plug in their own fetch implementation. The package stays dependency-free.

New resources

  • client.organizationslist(), get(), create(), update()
    • .memberslist(), delete()
    • .invitationslist(), create(), delete()
    • .licenseKeyslist(), get(), create(), update(), delete(), rotate()
    • .teamslist(), get(), create(), update(), delete() plus .apps and .members (list()/create()/delete())
    • .gitConnectionslist(), get(), create(), update(), delete(), listRepositories(), listNamespaces()
  • client.apps.configurationslist(), get(), create(), update(), delete()
  • client.apps.repositoryget(), set(), delete()
  • client.usersme()
  • client.jobs — added getFailureSummary() and cancel()

Other additions to existing resources

  • Exact name filters on apps.list(), organizations.teams.list(), apps.environments.list() and apps.automations.list().
  • apps.builds.create() gains appConfigurationId/appConfigurationName; apps.automations create/update gain appConfigurationId and the app*Name reference alternatives; jobs.list() accepts multiple status values.
  • delete() by name (in addition to id) for apps.channels, apps.destinations, apps.configurations, apps.environments and apps.certificates; certificate/destination name-deletes take platform (and type) discriminators so exactly one row is targeted.

Response types follow the existing convention of exposing only the most relevant properties. Credentials accepted by the API (Git tokens/passwords, invitation tokens) are request-only and are not part of any response type.

Notes

  • client.organizations.get() and client.organizations.licenseKeys.get() target GET /v1/organizations/:organizationId and GET /v1/organizations/:organizationId/license-keys/:licenseKeyId, which are being added in a parallel API pull request. They are the only methods here without a released endpoint yet.
  • teams.update() resolves to void because the endpoint responds with 204 No Content.
  • Relations are exposed as boolean options (includeApps, includeMembers, includePackages) instead of raw relation strings.
  • Versioning: this pull request contains only additive, non-breaking changes (verified against the published 0.1.2 type declarations: no removed/renamed exports, no dropped or retyped params, no changed return types — only additions and widenings such as required → optional and single → union). It is therefore released as a patch, 0.1.3, under the repository's bump-patch-for-minor-pre-major Release Please convention. The branch carries no version bump and no Release-As override, so Release Please derives 0.1.3 organically from the feat/fix commits. Nothing is published from this pull request.

Testing

  • npm run lint, npm run typecheck, npm run build — pass
  • npm test — 39 tests pass

Part of capawesome-team/roadmap#57

🤖 Generated with Claude Code

Add the resources and options needed to manage organizations from the SDK:

- `fetch` option on the client configuration to use a custom `fetch`
  implementation for all requests
- `organizations` (list/create/update) with `members`, `invitations`,
  `licenseKeys`, `teams` (incl. apps and members) and `gitConnections`
  (incl. repository and namespace browsing)
- `apps.configurations` and `apps.repository`
- `users.me()`
- `jobs.getFailureSummary()` and `jobs.cancel()`

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 13:01

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

Extends the Capawesome Cloud Node.js SDK with organization-, user-, and Git repository-related resources needed for the upcoming MCP server, and adds a configurable fetch implementation at the HTTP client level.

Changes:

  • Add client.organizations (with members, invitations, teams, license keys, git connections), client.users.me(), and new app sub-resources (apps.configurations, apps.repository).
  • Add HttpClientOptions.fetch to allow consumers to supply a custom fetch implementation (defaulting to globalThis.fetch).
  • Update README to document new resources/options and bump package version to 0.2.0 (incl. lockfile).

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/resources.test.ts Adds request-shape/path tests for nested organization/team endpoints, license key relations, repository linking, and job cancel.
test/http-client.test.ts Adds coverage ensuring custom fetch is used instead of the global one.
src/types.ts Introduces shared enums/types for organization roles and Git providers.
src/resources/users.ts Adds UsersResource.me() and User response type.
src/resources/teams.ts Adds TeamsResource with relation-inclusion options and nested .apps / .members.
src/resources/team-members.ts Adds TeamMembersResource for team member assignments (list/create/delete).
src/resources/team-apps.ts Adds TeamAppsResource for team app assignments (list/create/delete).
src/resources/repository.ts Adds RepositoryResource for linking/unlinking an app’s Git repository.
src/resources/organizations.ts Adds OrganizationsResource and wires organization sub-resources.
src/resources/members.ts Adds MembersResource for organization members (list/delete).
src/resources/license-keys.ts Adds LicenseKeysResource including relation expansion for packages.
src/resources/jobs.ts Adds JobsResource.getFailureSummary() and JobsResource.cancel().
src/resources/invitations.ts Adds InvitationsResource for org invitations (list/create/delete).
src/resources/git-connections.ts Adds GitConnectionsResource for connections plus repository/namespace listing.
src/resources/configurations.ts Adds ConfigurationsResource for app configurations CRUD.
src/resources/apps.ts Wires new app sub-resources (configurations, repository).
src/index.ts Exports new resources and new shared types.
src/http-client.ts Adds optional fetch override and routes all requests through it.
src/client.ts Exposes client.organizations and client.users on the SDK client.
README.md Documents the new resources and the fetch option; expands examples/resource list.
package.json Bumps SDK version to 0.2.0.
package-lock.json Updates lockfile version fields to 0.2.0.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/http-client.ts
Robin Genz and others added 7 commits August 17, 2026 09:49
Add `organizations.get()` for the new single organization endpoint and
support including the assigned packages in `licenseKeys.get()`, matching
the behavior of `licenseKeys.list()`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add `appConfigurationId` and `appConfigurationName` to the build creation
options and allow filtering jobs by multiple statuses, which the API
expects as a comma-separated list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolve the `fetch` implementation before the first request and fail with
a message naming the `fetch` option and the minimum runtime, instead of a
`TypeError` from calling `undefined`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add the name-based alternatives the API already accepts so resources can
be referenced by name instead of id:

- `environments.list()` and `automations.list()` gain a `name` filter
- automation create and update gain `appConfigurationId` and the name
  references `appCertificateName`, `appChannelName`, `appConfigurationName`,
  `appDestinationName` and `appEnvironmentName`

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a name alternative to the delete methods of channels, destinations,
configurations, environments and certificates, whose collection endpoints
accept a `name` query parameter. The id form is kept and takes precedence
when both are provided. Also adds the previously missing environment
delete method.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add an optional exact `name` filter to `apps.list()` and
`organizations.teams.list()`, alongside the existing fuzzy `query` filter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Certificate names are unique per platform and type, and destination names
per platform. When deleting by name, forward these discriminators so the
delete targets exactly one row:

- `certificates.delete` gains `platform` and `type`
- `destinations.delete` gains `platform`

The id form is unchanged and still takes precedence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@robingenz
robingenz force-pushed the feat/mcp-server-support branch from b2909ec to 2375a47 Compare August 17, 2026 07:52
@robingenz robingenz added the feature Feature label Aug 17, 2026
@robingenz robingenz self-assigned this Aug 17, 2026
@robingenz
robingenz merged commit fbcbef1 into main Aug 17, 2026
3 checks passed
@robingenz
robingenz deleted the feat/mcp-server-support branch August 17, 2026 13:44
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