Repository navigation
✨ feat(keys): key metadata and renaming (LOC-4789) - #81
Merged
Merged
Conversation
## Features
- `keys.update` takes `addMetadata` (merged into the key's custom
metadata on the top level) and `removeMetadata`
- Add `keys.setMetadata` over `PUT /projects/{p}/keys/metadata`: up to
1000 keys, each with its own change; the response reports each key as
`updated`, `not_found` or `not_supported`
- `Key.metadata`, returned by `files.listKeys()` with `metadata: true`
## Tests
- Cover the metadata fields of `keys.update`, the body and response of
`keys.setMetadata`, and the rejection of a missing key list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
## Features
- Add `keys.rename` over `POST /projects/{p}/keys/rename`: up to 1000
keys, each with its new name as a list of segments; a renamed key keeps
its ID and translations, and the response reports each key as `renamed`
or `unchanged`
## Tests
- Cover the body and response of `keys.rename` and the rejection of a
missing key list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
## Documentation
- `Key.metadata` is absent only while the key's metadata was never
written; after any write, even a removal of a name the key didn't have,
`files.listKeys()` lists an object, `{}` once the last entry is removed
- The removal fields of `keys.update` and `keys.setMetadata`, and the
reference docs, say so
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
david-vaclavek
marked this pull request as ready for review
November 16, 2026 14:13
honzabubenik
approved these changes
Nov 16, 2026
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.
Client side of two public API features the Figma plugin needs (LOC-4789):
The plugin will use metadata to record on linked keys where a design uses them, without an import. It will use renaming for Edit key name and for applying a naming pattern to existing keys.
Changes
keys.updatetakesaddMetadataandremoveMetadata.addMetadatais merged into the key's custom metadata on the top level.keys.setMetadataoverPUT /projects/{p}/keys/metadata: up to 1000 keys, each with its own change. The response gives each key astate:updated,not_foundornot_supported.keys.renameoverPOST /projects/{p}/keys/rename: up to 1000 keys, each with its new name as a list of segments (['checkout', 'title']nested,['checkout.title']flat).state:renamedorunchanged, so a retry is safe.Key.metadata: the fieldfiles.listKeys()already returns withmetadata: true, now typed.{}once the last entry is removed. That includes a removal of a name the key didn't have, and writes from the web app or an import.{}tells that the metadata was edited at some point. The docs say to check entries, not presence.Tests
pnpm run checkpasses: format, lint, typecheck, build and 83 tests. New tests cover:keys.update;keys.setMetadataandkeys.rename;Also run against testing (
testing.localazy.com/pubapi, after #1132 was deployed there on 2026-11-16), with the built client and a real project. All 13 checks passed, and every key was put back afterwards:keys.updateadds and removes metadata, andfiles.listKeys({ metadata: true })lists it.keys.setMetadatareports the state of a Key object, an ID and a missing key, and rejects a duplicate ID.keys.renameworks on a nested key and on a flat iOS key containing a dot:unchanged;key_exists) and nothing is renamed;401, as the endpoint documents).Released before server-backend#1132 reaches production, on purpose: the Figma plugin work continues against testing, and nothing waits on these methods.
keys.setMetadataand the metadata fields ofkeys.updatework only on testing.keys.updateand the listing'smetadataare unaffected.keys.renamealready works everywhere.🤖 Generated with Claude Code