Repository navigation
chore(forge): pin forge at 7a7bdee, a tool for every body - #372
Merged
Merged
Conversation
Forge now gives every method a tool whatever its body's media type, and sends the body as fetch would: a content-type header argument picks the media type, or else the value does (a string as text, an object as JSON or multipart), and file parts take a filename and type. 26 tools are added, such as KV and R2 writes and Worker uploads.
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.
This pins forge at
7a7bdeeon cloudflare/forge#71 and regenerates the forge tools (?codemode=false&experimentalForge=true) from the same spec release. Every method now gets a tool whatever its body's media type, so 26 are added, such askv_keys_put,r2_objects_put,workers_legacy_scripts_updateandanalyticsEngine_sql_query.A body is sent as fetch would send it.
headers["content-type"]picks the media type when the body has several, or else the value does: a string goes as text, an object as JSON ormultipart/form-data. A file part takes{ content, filename?, contentType? }. Header names are lower case, and a declaredContent-Typeheader now wins over the default, so R2 objects keep their type.Blind agents on a local server, calling the real API, did KV with metadata, an R2 text object, an ES module Worker upload and an Analytics Engine query with no failed calls. A new worker test covers text and multipart KV writes.
npm run checkran.