Skip to content

✨ feat: cover the new public API endpoints - #83

Merged
elisiondan merged 5 commits into
mainfrom
feat/public-api-endpoints
Nov 25, 2026
Merged

elisiondan merged 5 commits into
mainfrom
feat/public-api-endpoints

Conversation

@elisiondan

@elisiondan elisiondan commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Adds new public api endpoints.

New methods

Namespace Methods
projects create
organizations (new) getUsage, search, getCreditSummary, listCreditTransactions / listCreditTransactionsPage, listCreditTopups
files listPublished
keys getDetails, editSource, reviewTranslation
comments (new) list, create, update, delete
glossary createMany
languages (new) add, hide, enable, disable, delete, copy, replace, setFallback, listKeys / listKeysPage, listPlurals
branches (new) list, create, rename, delete, setMain, separate, analyzeMerge, merge, getOperation
links (new) list / listPage, create, delete
segmentation (new) getParent
tags, styleguides, cdn (new) list

Every method has types, tests and an entry in docs/api-client-reference.md.

Changes to existing types

  • File.productFlavors is string[] (was string), as the API sends it — separate fix commit, since code that treated it as a string needs updating.
  • Language gains tag, hidden, enabled, published and fallback; projects.list takes hidden_languages.
  • Project.organization and Project.languages are optional, since the API sends them only when requested — code that reads them needs an undefined check.
  • UserRole gains viewer, member and custom (with Project.customRole); developer is deprecated, as the API never returns it.
  • File gains library.

elisiondan and others added 3 commits November 24, 2026 12:58
## Bug fixes
- `File.productFlavors` is `string[]`, as the API sends it; the field is
  absent when the file has no flavors. Code that treated it as a string
  needs updating

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## Features
- Add `projects.create` and `files.listPublished`
- Add `organizations`: usage, search across projects, credit summary,
  credit transactions (all or one page) and credit top-ups
- Add `keys.getDetails`, `keys.editSource` and `keys.reviewTranslation`
- Add `comments` (list, create, update, delete) on the comments of a key
  in one language
- Add `glossary.createMany`, which merges duplicates of existing terms
- Add `languages`: add, hide, enable, disable, delete, copy, replace,
  setFallback, listKeys / listKeysPage and listPlurals
- Add `branches`: list, create, rename, delete, setMain, separate,
  analyzeMerge, merge and getOperation for the background operations
- Add `links` (list / listPage, create, delete), `segmentation.getParent`,
  `tags.list`, `styleguides.list` and `cdn.list`
- `Language` gains `tag`, `hidden`, `enabled`, `published` and `fallback`;
  `projects.list` takes `hidden_languages`

## Tests
- Cover the URL, method, body and response of every new method, and that
  the new methods keep the `params` of the request config

## Documentation
- Add every new method to the API client reference

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## Bug fixes
- `organizations.search` rejects an empty `projects` list, which the
  server reads as all projects
- Language parameters of the `languages` requests suggest locale codes
  again while still accepting any code or a numeric id
- `projects.create` takes a numeric `sourceLanguage`, such as
  `Project.sourceLanguage`
- Key details leave out `vid`, which `JSON.parse` rounds; address a
  version with `translation.review.versionId`

## Tests
- Cover the empty project list and the numeric source language

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 97.39% 598 / 614
🔵 Statements 97.28% 610 / 627
🔵 Functions 97.36% 148 / 152
🔵 Branches 86.11% 155 / 180
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/main.ts 0% 0% 0% 0%
src/api/api-client.ts 100% 100% 100% 100%
src/api/methods/api-branches.ts 97.72% 93.33% 100% 97.72% 221
src/api/methods/api-cdn.ts 100% 100% 100% 100%
src/api/methods/api-comments.ts 100% 100% 100% 100%
src/api/methods/api-files.ts 100% 86.66% 100% 100%
src/api/methods/api-glossary.ts 100% 62.5% 100% 100%
src/api/methods/api-keys.ts 83.33% 40% 85.71% 83.33% 62-81
src/api/methods/api-languages.ts 100% 100% 100% 100%
src/api/methods/api-links.ts 100% 100% 100% 100%
src/api/methods/api-organizations.ts 100% 100% 100% 100%
src/api/methods/api-projects.ts 83.33% 50% 100% 83.33% 37
src/api/methods/api-segmentation.ts 100% 100% 100% 100%
src/api/methods/api-styleguides.ts 100% 100% 100% 100%
src/api/methods/api-tags.ts 100% 100% 100% 100%
src/enums/user-role.ts 100% 100% 100% 100%
src/types/branch-analyze-merge-request.ts 0% 0% 0% 0%
src/types/branch-create-request.ts 0% 0% 0% 0%
src/types/branch-delete-request.ts 0% 0% 0% 0%
src/types/branch-get-operation-request.ts 0% 0% 0% 0%
src/types/branch-list-request.ts 0% 0% 0% 0%
src/types/branch-merge-analysis.ts 0% 0% 0% 0%
src/types/branch-merge-detail.ts 0% 0% 0% 0%
src/types/branch-merge-request.ts 0% 0% 0% 0%
src/types/branch-merge-strategy.ts 0% 0% 0% 0%
src/types/branch-operation-status.ts 0% 0% 0% 0%
src/types/branch-rename-request.ts 0% 0% 0% 0%
src/types/branch-separate-request.ts 0% 0% 0% 0%
src/types/branch-set-main-request.ts 0% 0% 0% 0%
src/types/branch.ts 0% 0% 0% 0%
src/types/cdn-list-request.ts 0% 0% 0% 0%
src/types/cdn-metadata.ts 0% 0% 0% 0%
src/types/comment-create-request.ts 0% 0% 0% 0%
src/types/comment-delete-request.ts 0% 0% 0% 0%
src/types/comment-list-request.ts 0% 0% 0% 0%
src/types/comment-update-request.ts 0% 0% 0% 0%
src/types/credit-balance.ts 0% 0% 0% 0%
src/types/credit-summary-request.ts 0% 0% 0% 0%
src/types/credit-summary-response.ts 0% 0% 0% 0%
src/types/credit-topups-list-request.ts 0% 0% 0% 0%
src/types/credit-topups-response.ts 0% 0% 0% 0%
src/types/credit-transactions-list-request.ts 0% 0% 0% 0%
src/types/credit-transactions-paginated.ts 0% 0% 0% 0%
src/types/credit-transactions.ts 0% 0% 0% 0%
src/types/file.ts 0% 0% 0% 0%
src/types/glossary-create-many-request.ts 0% 0% 0% 0%
src/types/glossary-create-many-response.ts 0% 0% 0% 0%
src/types/key-comment.ts 0% 0% 0% 0%
src/types/key-details-request.ts 0% 0% 0% 0%
src/types/key-details-response.ts 0% 0% 0% 0%
src/types/key-edit-source-request.ts 0% 0% 0% 0%
src/types/key-review-translation-request.ts 0% 0% 0% 0%
src/types/key-state.ts 0% 0% 0% 0%
src/types/key-update-request.ts 0% 0% 0% 0%
src/types/language-add-response.ts 0% 0% 0% 0%
src/types/language-batch-response.ts 0% 0% 0% 0%
src/types/language-copy-request.ts 0% 0% 0% 0%
src/types/language-copy-response.ts 0% 0% 0% 0%
src/types/language-delete-request.ts 0% 0% 0% 0%
src/types/language-disable-response.ts 0% 0% 0% 0%
src/types/language-enable-response.ts 0% 0% 0% 0%
src/types/language-hide-response.ts 0% 0% 0% 0%
src/types/language-key.ts 0% 0% 0% 0%
src/types/language-keys-paginated.ts 0% 0% 0% 0%
src/types/language-list-keys-request.ts 0% 0% 0% 0%
src/types/language-ref.ts 0% 0% 0% 0%
src/types/language-replace-request.ts 0% 0% 0% 0%
src/types/language-set-fallback-request.ts 0% 0% 0% 0%
src/types/language.ts 0% 0% 0% 0%
src/types/languages-batch-request.ts 0% 0% 0% 0%
src/types/link-create-request.ts 0% 0% 0% 0%
src/types/link-delete-request.ts 0% 0% 0% 0%
src/types/link-list-request.ts 0% 0% 0% 0%
src/types/link.ts 0% 0% 0% 0%
src/types/links-paginated.ts 0% 0% 0% 0%
src/types/organization-search-request.ts 0% 0% 0% 0%
src/types/organization-search-response.ts 0% 0% 0% 0%
src/types/organization-usage-request.ts 0% 0% 0% 0%
src/types/organization-usage.ts 0% 0% 0% 0%
src/types/plurals-list-request.ts 0% 0% 0% 0%
src/types/plurals.ts 0% 0% 0% 0%
src/types/project-create-request.ts 0% 0% 0% 0%
src/types/project-create-response.ts 0% 0% 0% 0%
src/types/project-custom-role.ts 0% 0% 0% 0%
src/types/project-tag-list-request.ts 0% 0% 0% 0%
src/types/project-tag.ts 0% 0% 0% 0%
src/types/project.ts 0% 0% 0% 0%
src/types/projects-list-request.ts 0% 0% 0% 0%
src/types/published-list-request.ts 0% 0% 0% 0%
src/types/published-record.ts 0% 0% 0% 0%
src/types/review-translation-response.ts 0% 0% 0% 0%
src/types/segmentation-get-parent-request.ts 0% 0% 0% 0%
src/types/segmentation-parent.ts 0% 0% 0% 0%
src/types/styleguides-list-request.ts 0% 0% 0% 0%
src/types/styleguides.ts 0% 0% 0% 0%
src/types/submit-translation-response.ts 0% 0% 0% 0%
tests/fixtures/full-project/languageKeys.json 100% 100% 100% 100%
tests/fixtures/full-project/languageKeysLastPage.json 100% 100% 100% 100%
tests/fixtures/full-project/projectsOrgsLangs.json 0% 0% 0% 0%
Generated in workflow #123 for commit 859c075 by the Vitest Coverage Report Action

elisiondan and others added 2 commits November 24, 2026 13:58
…rrors

## Bug fixes
- `projects.create`, `languages.listKeys` and `segmentation.getParent`
  take locale codes only: the server parses their language without
  resolving numeric ids
- Branch methods reject `.` and `..` as a branch name, which URL
  resolution would turn into a request to another endpoint
- Key details `review.value` and organization search `value` can be
  `null`; `LanguageKey.file` and `PluralRule.forms` match what the server
  sends

## Documentation
- The `409` of a merge or analysis covers the source branch too with the
  `target` and `time-bidi` strategies; `mergeDeprecations` with `keys`
  applies only to those keys
- Add the `project_not_found` and `invalid_id` rejections of links and
  segmentation
- Move `glossary.createMany` under Glossary in the reference

## Tests
- Cover the rejected branch names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## Bug fixes
- `UserRole` gains `viewer`, `member` and `custom`, which the API
  returns; `developer` is deprecated, as the API never returns it
- `Project.customRole` names the custom role when `role` is `custom`
- `Project.organization` and `Project.languages` are optional: the API
  sends them only when `projects.list` asks for them. Code that reads
  them needs a check for `undefined`
- `File.library`, which the API sends when the file has one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elisiondan
elisiondan merged commit 0f75546 into main Nov 25, 2026
3 checks passed
@elisiondan
elisiondan deleted the feat/public-api-endpoints branch November 25, 2026 14:24
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.

2 participants