Commit Graph

94 Commits

Author SHA1 Message Date
github-actions[bot] ff9f84e11a Version packages (#4851)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-15 10:06:49 +02:00
Matthieu Sieben 26d793af95 Improve AtUriString type an utilities (#4806)
* Improve `AtUriString` type an utilities

* review comments

* tidy

* tidy

* tidy

* tidy

* Apply suggestion from @matthieusieben

* Apply suggestion from @matthieusieben

* review comments
2026-04-14 18:57:10 +02:00
Matthieu Sieben 61e75af39e Improve error reporting (#4816)
* Improve error reporting from fetchHandler() in NodeJS

* Use request logger instead of global one when performing service proxying
2026-04-14 17:05:13 +02:00
Matthieu Sieben 952354c1dd Improve performances of lexParseJsonBytes function (#4836)
* Improve performances of `lexParseJsonBytes` function

* tidy

* tidy

* Add test for repeated keys; fix import order in bench file

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/3cb30e99-4d11-4396-82a3-79c2eb5ca6cf

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Fix `lexParseJsonBytes` strict mode to match `lexParse` behavior (#4843)

* Initial plan

* Fix lexParseJsonBytes strict mode to match lexParse behavior

- Fix parseNull/parseTrue/parseFalse to throw SyntaxError with 'Unexpected token' (matching JSON.parse)
- Fix parseNumber to compute full value before validating, throw TypeError('Invalid non-integer number: ${value}') in strict mode (matching lexParse)
- Fix parseObject to throw TypeError (not SyntaxError) for invalid $bytes, $link, and blob objects
- Use parseTypedBlobRef instead of isBlobRef for blob validation
- Add $type empty string check and improve $type error messages
- Update incorrect test: 1e10 is a safe integer and should not throw in strict mode
- Add comprehensive strict vs non-strict mode parity tests for lexParseJsonBytes vs lexParse

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/c72e3862-277f-4f61-b4eb-b5a334e42647

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* Improve code comment in parseNumber

Agent-Logs-Url: https://github.com/bluesky-social/atproto/sessions/c72e3862-277f-4f61-b4eb-b5a334e42647

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* tidy

* tidy

* tests

* tidy

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>
2026-04-14 17:04:14 +02:00
github-actions[bot] 83b7246439 Version packages (#4833)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-09 10:24:41 -05:00
Matthieu Sieben b6b231f9c0 Fix typing of delete options to omit body instead of params. (#4839) 2026-04-08 16:22:21 +02:00
Matthieu Sieben f6f100c337 Avoid alteration of record data (#4835) 2026-04-08 16:11:08 +02:00
Matthieu Sieben c62651dd69 Fix support for legacy blobs in lex SDK (#4828)
* Allow validation of legacy blobs (in 'validate' mode)

* tidy

* tidy

* tidy

* changeset

* tidy

* review comments

* update skills

* tidy

* Add `TypedBlobRef`

* fix style

* review comments

* lint
2026-04-07 20:11:46 +02:00
github-actions[bot] 2203d825e8 Version packages (#4776)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-26 09:17:15 -03:00
Matthieu Sieben ac6bd18f1d Disable strict mode parsing of records (#4796) 2026-03-24 13:38:11 +01:00
Matthieu Sieben c5c6c7dac3 Allow any encoding to match payload with no encoding specified in schema (#4799)
* Allow any encoding to match paylaod that don't expect any particular encoding

* Explicitly cancel request body when it does not get consumed

* tidy
2026-03-24 13:36:57 +01:00
Matthieu Sieben fac213dfdc Fix error stating that the lex build folder could not be cleared (#4800) 2026-03-24 13:30:48 +01:00
Matthieu Sieben a99dd58b5f Allow payload from XRPC endpoints with no output in their schema (#4788)
* Allow XRPC endpoints with no `output` specified in their schema to output anything.

* tidy

* fix tests
2026-03-24 11:33:39 +01:00
Matthieu Sieben c4df84cd78 Optimize counting of graphemes when validating strings (#4787) 2026-03-23 18:06:58 +01:00
Matthieu Sieben e5e5bcf85f Show invalid values in issue description (#4784)
* Show invalid values in issue description (when stringifiable in reasonably small string)

* tidy

* tidy
2026-03-23 13:52:09 +01:00
Matthieu Sieben 527f5d4c5d Various lex SDK improvements (#4779)
* Various lex SDK improvements

* tidy

* Improve performances of error instantiation

* Improve clarity of params validation errors (and add "cause" for improved debugging)

* update error handling

* tidy

* tidy

* review comments

* tidy
2026-03-23 11:47:23 +01:00
github-actions[bot] 8445e8a9aa Version packages (#4770)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-19 15:53:07 +01:00
Matthieu Sieben 737c046e95 Fix infinitely deep declaration (#4774) 2026-03-19 15:45:38 +01:00
Matthieu Sieben df8328c3c2 Fix xrpc options (#4773)
* Fix xrpc options

* tidy

* changeset

* tidy

* tidy

* fix
2026-03-19 15:25:45 +01:00
Matthieu Sieben b2baf8d660 Fix Client.call options for XRPC queries (#4772) 2026-03-19 14:10:34 +01:00
Matthieu Sieben 6a88461c5a Allow processing of invalid lex data (#4761)
* Allow processing of responses with invalid lex data

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* add tests

* tidy

* Add non-strict validation mode to lex SDK (#4766)

* non-strict validation mode

* apply strict option to client responses

* update readme

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Allow `-1` BlobRef size in non-strict mode

* review comments

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* tidy

* tidy

* tidy

* tidy

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-19 13:50:11 +01:00
github-actions[bot] 13b2aad9b6 Version packages (#4720)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-18 16:47:57 -05:00
Matthieu Sieben cbbc03b6e4 Revert "non-strict validation mode"
This reverts commit 3d60e1af7c.
2026-03-18 15:13:36 +01:00
Matthieu Sieben 3d60e1af7c non-strict validation mode 2026-03-18 15:12:48 +01:00
Matthieu Sieben 112b159ec2 Export more string format type assertion utilities from @atproto/lex 2026-03-16 08:45:33 +01:00
Matthieu Sieben 3dc3791543 Add Standard Schema compatibility (#4734)
* Add [Standard Schema](https://standardschema.dev/) compatibility

* tidy

* tidy

* rename `StandardSchemaValidator` to `StandardSchemaAdapter`

* `LexValidationError` class now implements `ResultFailure`

* review comments

* add readme

* fix tests

* Add tests for StandardSchemaAdapter (`schema['~standard']`) (#4735)

* Initial plan

* Add StandardSchemaAdapter tests

Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>

* changeset

* return `message` in `toJSON`

* review comments

* tidy

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: matthieusieben <813661+matthieusieben@users.noreply.github.com>
2026-03-10 16:39:39 +01:00
Matthieu Sieben 5a2f8847ef Improve lex-client error reporting (#4714)
* Improve lex-client error reporting

* tidy

* Enhance XrpcFetchError handling and improve error messages

* fix test

* add tests

* improve test coverage

* fix lint
2026-03-05 12:14:44 +01:00
github-actions[bot] 88326d2833 Version packages (#4703)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-03 15:45:46 +01:00
Matthieu Sieben f7c26103a6 Increase type strictness in @atproto/syntax (#4689)
* Increase type strictness in `@atproto/syntax`

* review comments

* wip

* make `rkey` and `collection` AtUri getters actually safe

* tidy

* tidy

* tidy

* changeset

* tidy

* tidy

* fix ci
2026-03-03 15:10:29 +01:00
Matthieu Sieben e8969b6b3d Add Lex SDK support to @atproto/xrpc-server (#4691)
* Lex SDK error handling improvements

* Add support for method defined through `@atproto/lex` in addition to `@atproto/lexicon` "codegen"

* review comments

* tidy
2026-03-03 11:28:09 +01:00
Matthieu Sieben 52834aba18 Lex SDK error handling improvements (#4688)
* Lex SDK error handling improvements

* Allow `WWWAuthenticate` to have multiple challenges for the same scheme

* tidy

* add tests

* tests

* review comments

* tidy

* tidy

* tidy

* tidy
2026-03-02 15:37:00 +01:00
github-actions[bot] cb5f9bfc0c Version packages (#4674)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 09:37:01 +01:00
Matthieu Sieben 38852f0ddf QoL improvements for lex SDK (#4672)
* Allow calling `xrpc` and `xrpcSafe` functions with a service URL

* tidy

* tidy

* fix test

* Improve app password based session management

* lex lex jsdoc

* Add easy login for app password based bots

* Shorten readme intro
2026-02-20 20:26:43 +01:00
github-actions[bot] 8603be629a Version packages (#4668)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-20 10:50:49 +01:00
Matthieu Sieben 66b72950e8 Fix lex-cbor warnin: import with (#4667)
Use import `with` instead of deprecated import `assert` (fixing build warning)
2026-02-20 09:30:43 +01:00
github-actions[bot] caad88223f Version packages (#4653)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-20 09:05:35 +01:00
Matthieu Sieben ea5df64db9 Various Lex SDK improvements (#4660)
* Various Lex SDK improvements

* changeset

* Improve typeing of `string()` schemas

* fix tests

* improve backwards compatibility
2026-02-19 13:52:24 +01:00
Matthieu Sieben 39dea03c41 Lex SDK fixes and improvements (#4654)
* minor tests fix

* Properly support "enum" and "const" schemas in params

* tidy

* Add support for `knownValues` in string schemas

* tidy

* tests

* tidy

* tidy

* tidy

* fix types

* fix tests

* add suggested tests

* merge conflicts
2026-02-19 13:17:54 +01:00
Matthieu Sieben cd9deb6f21 Fix conflicting identifier for generated type utilities (#4659)
Add a `$` in front of the method type utilities to prevent name conflicts with local definitions
2026-02-19 13:04:40 +01:00
Matthieu Sieben 009c4afd36 Add test cases for knownValues strings (#4639) 2026-02-18 13:05:59 +01:00
github-actions[bot] 6ae3cf6131 Version packages (#4637)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-13 15:11:24 +01:00
dan 619068fb81 Expose LexDefBuilder and allow passing moduleSpecifier (#4610)
* Expose LexDefBuilder and allow passing moduleSpecifier

* Changeset
2026-02-13 15:07:10 +01:00
github-actions[bot] 27cdeb4e86 Version packages (#4604)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-06 15:12:15 +01:00
Matthieu Sieben ed61c62f31 Add docs in lex SDK packages (#4601)
* Fix `exports` field in package.json

* tidy

* AT Protocol
2026-02-06 14:40:54 +01:00
Matthieu Sieben 7b9a98a763 Improve type inference of XRPC methods (#4603)
* Improve type inference of XRPC methods

* tidy

* tidy

* tidy

* tidy
2026-02-03 14:29:22 +01:00
github-actions[bot] 915f9065d3 Version packages (#4584)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-30 14:20:33 -03:00
Matthieu Sieben 369bb02b9f @atproto/lex-client error typing improvements (#4589) 2026-01-30 14:01:17 +01:00
Matthieu Sieben 8a725a9d69 Change workspace version selector from workspace:* to workspace:^ 2026-01-28 16:42:44 +01:00
github-actions[bot] 143a5f2251 Version packages (#4578)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-28 16:31:59 +01:00
Matthieu Sieben d54d7077eb DID document validation (#4580)
* DID document validation

* relax `import/no-deprecated` lint rule
2026-01-27 08:25:13 +01:00