Skip to content

refactor: Use v1 APIs#46

Merged
nealrichardson merged 7 commits intomainfrom
migrate-v1-apis
Jan 29, 2026
Merged

refactor: Use v1 APIs#46
nealrichardson merged 7 commits intomainfrom
migrate-v1-apis

Conversation

@nealrichardson
Copy link
Contributor

@nealrichardson nealrichardson commented Jan 20, 2026

Closes #43

@nealrichardson nealrichardson changed the base branch from main to with-connect January 20, 2026 20:53
@nealrichardson nealrichardson changed the base branch from with-connect to main January 20, 2026 20:57
resetMaxRecords = true
}

let n = 0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

v1/content is not paginated, that's the reason for this diff

Copy link

@marcosnav marcosnav left a comment

Choose a reason for hiding this comment

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

Looks good! one minor cleanup suggestion/question

src/Deployer.ts Outdated
import { Bundle } from './Bundle'
import { Bundler } from './Bundler'
import { Application, ClientTaskV0Response, ListApplicationsResponse } from './api-types'
import { Application, DeployV1Response, ListApplicationsResponse } from './api-types'

Choose a reason for hiding this comment

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

I think ClientTaskV0Response can be removed from the codebase now?

nealrichardson and others added 4 commits January 29, 2026 08:06
Replace undocumented/legacy application endpoints with stable v1 content APIs:
- createApp: POST applications → POST v1/content
- getApp: GET applications/${id} → GET v1/content/${guid}
- updateApp: POST applications/${id} → PATCH v1/content/${guid}
- uploadApp: POST applications/${id}/upload → POST v1/content/${guid}/bundles
- deployApp: POST applications/${id}/deploy → POST v1/content/${guid}/deploy
- listApplications: GET applications → GET v1/content (with v1 pagination)
- getBundle: GET bundles/${id} → GET v1/content/${guid}/bundles/${id}

Updates Deployer to pass GUIDs instead of numeric IDs, and ListApplicationsPager
to use page-based pagination (pageNumber/pageSize) instead of offset-based.

Closes #43

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- v1/content endpoint is not paginated, removed fake pagination params
- v1 deploy endpoint returns task_id (not id), added DeployV1Response type
- Simplified ListApplicationsPager to fetch all results at once

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename Application interface to Content with only fields actually used
- Add include=vanity_url query param to GET endpoints
- Update field types to match v1 API (id, bundleId as strings)
- Rename ListApplicationsPager to ListContentPager
- Rename APIClient methods to use Content terminology
- Update tests to match new names

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
nealrichardson and others added 3 commits January 29, 2026 09:12
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The `include=vanity_url` query param isn't supported on older Connect
versions. Instead, use GET /v1/content/{guid}/vanity to check if a
vanity URL exists before setting one.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nealrichardson nealrichardson merged commit 99fc135 into main Jan 29, 2026
5 checks passed
@nealrichardson nealrichardson deleted the migrate-v1-apis branch January 29, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use v1 APIs

3 participants