Repository navigation
Release 1.0.0-alpha.7: what a browser app consumer asked for - #59
Merged
Merged
Conversation
Nothing breaks. Added:
- attachments.list / page take a `select`; the extra values come back
under `selected`, translated and typed by what was selected.
- attachments.get(id, { inline: true }) reads metadata and bytes in one
query.v1 request (Content as Base64 beside the row) for a small file.
- normalizeQuery: a query in rest-1's spellings (sel, a textual where,
comma-joined lists, a "size,start" page) as a QueryBody.
- @versionone/agility-sdk/testing with FakeAgilityClient: the real client
over a transport that answers what a test scripted, in the model's
shape; an unscripted read throws rather than reading as empty.
- apiErrorFromResponse(status, data): the fetch transport's error for a
refused response, for a custom Transport to throw the same.
- @versionone/agility-sdk/wire: the wire modules under their own import
path; the root keeps exporting them for this alpha.
The three entries are built with shared chunks in both formats, so a
class is one class whichever path imported it (the CommonJS test proves
it). Spec 000 gains section 5a for the entries and the fake.
Docs: Page.more as the pager's signal when total is null; kind "usage"
means nothing was sent; what baseUrl is for with a custom Transport;
client.query's stale notes on retries and details. README's stale
"extend" and "no registry package" sections and CONTRIBUTING's pull
request target now describe the repository as it is.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
… guarded send keeps its request id FakeAgilityClient, from a chat-bot consumer's trial of the branch: - resolve.numbers / resolve.ref find a number among every scripted row, so a test names no number root (which roots exist is the SDK's business and changes between releases); - a query from the alias of a create in the same batch answers the scripted row of that type under the created OID; - localize answers onLocalize labels and echoes any other tag, as loc-2 does for a tag it does not know; - an unscripted meta.v1 type read answers 404, so a client the code under test builds on fake.transport reads rows as scripted. Outcome.requestId after sendGuarded and batch.run was always null: the outcome is merged from the guard's passes, and a merge dropped the id even when there was one pass. One send now keeps its id (a CLI consumer). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
The attachments service was the one place the SDK renamed meta.v1's attributes (oid, name, filename, contentType, createdBy), against spec 000 section 3. list, page, info, get and add now answer a row under the attribute names (_oid, Name, Filename, ContentType, Description, CreateDate, "CreatedBy.Name") plus `id`, the number attachment.img addresses. A `select` on list / page therefore adds its keys to the row itself, typed by what was selected, and the `selected` bag introduced earlier on this branch never ships. get answers the served type as `servedContentType` beside the recorded `ContentType`. Breaking for attachments only; the changelog has the migration field by field. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…sports - AttachmentInfo no longer extends Asset: it has `_oid`, `id`, the six metadata keys and whatever a `select` named, and nothing else, so a read the migration missed (row.filename, row.FileName, an unselected custom attribute) is a compile error. Type tests pin it, here and against the packed tarball for ESM and CommonJS. - FakeAgilityClient: a read-back through a create's alias answers the scalar values the create sent over the scripted row (which stands in for what the server adds, a Number); a doc example for telling two queries of one type apart. - Docs, from a browser app consumer with its own Transport: a 304 on an `acceptNotModified` request resolves undefined after onResponse (a duty alpha.5 added without listing it as breaking); `retries` and `timeoutMs` configure the built-in transport only; `client.meta` answers the model's Metamodel, not meta.v1's document. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
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.
One breaking change, to attachments; everything else is additive.
CHANGELOG.mdhas an entry and a migration line for each change.Breaking
_oid,Name,Filename,ContentType,Description,CreateDate,"CreatedBy.Name"), plusid. It was the one place the SDK had a vocabulary of its own (oid,name,filename, …), against spec 000 §3. Applies toclient.attachments.list,page,info,get,addandAttachmentUploadError.attachment.getanswers the served type asservedContentTypebeside the recordedContentType. The changelog has the migration field by field.Added
client.attachments.list/pagetake aselect. The extra keys land on the row itself, as selected, translated and typed by what was selected.client.attachments.get(id, { inline: true }): metadata and bytes in one query.v1 request (the Attachment'sContentas Base64 beside its row) where the default is two. For small files.normalizeQuery(query): a query written with rest-1's spellings (sel, a textualwhere, comma-joined lists, a"size,start"page) becomes aQueryBody.QueryBodyitself gains no alias. Saying one thing twice, or asking fordeleted, is aUsageError.@versionone/agility-sdk/testingwithFakeAgilityClient: the real client over a transport that sends nothing and answers what a test scripted, in the model's shape (onQuery,onSend,onLocalize,onRequest;asked,sent,requests). A read nothing was scripted for throws instead of reading as empty.resolve.numbersanswers from the scripted rows, a query from a create's alias reads the created asset back, andfake.transportcan serve a client the code under test builds itself.apiErrorFromResponse(status, data): the error the fetch transport throws for a refused response, exported for a customTransport.@versionone/agility-sdk/wire: the wire modules under their own import path. The root keeps exporting them for this alpha.Fixed
Outcome.requestIdafterassets.sendGuardedandbatch.runwas always null; a batch sent in one request now keeps the server's id.Documented
Page.moreis the pager's signal whentotalis null.kind: "usage"means nothing was sent.baseUrlis for with a customTransport.client.queryonretriesanddetails; README's "extend" and "no registry package" sections; the pull request target inCONTRIBUTING.md; CI's push branches.Things a reviewer should know
tsupnow buildsindex,wireandtestingwithsplitting: truein both formats, sodist/holds chunk files (all in one directory) and a class is one class whichever path imported it.test/unit/cjs.test.tsproves it for CommonJS.batch.run: their request sequence is internal and changes in the next alpha.getrather than a second method;normalizeQuerykeeps keys it does not know;add's options keep their camelCase names.Verification
npm run verify: typecheck, build, 197 unit tests in 27 files, all passing.selectonlistandpage, and a normalised rest-1 query reading the same rows as itsQueryBody, with an expect-zero control.nodenextfor both an ESM and a CommonJS consumer (checked on the first commit of this branch).After merge
Tag
v1.0.0-alpha.7to stage the publish.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm