commits
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Replaces the browser's `Blob` type with the correct type for Blob references over atproto.
I've defined a local `BlobRef` type (`{ $type, ref, mimeType, size }`) which mirrors the type from `@atproto/api`/`@atproto/lex-data`, without
adding either as a dependency.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* add type level and runtime error for nested objects
and recommend use of lx.ref instead
resolves #89
* changeset
* formatting
* fix tests
* link to atproto docs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add enum & knownValues type hints
Adds type hints for enum values & knownValues on strings.
* Add changeset for enum & knownValues hints
* Add const type param to lx.string for automatic literal inference
Callers no longer need `as const` on enum/knownValues arrays to get
type-level autocomplete suggestions. Adds snapshot tests for both features.
* Fix formatting
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* move away from relying on including required and nullable in output
* support nullable and required objects and update the type benchmarks
* changeset
* new bench for just object with required/nullable
* format
* fix lint
`gen-emit` now writes schemas into a nested directory structure based on the NSID (e.g. `com/atproto/repo/strongRef.json` instead of `com.atproto.repo.strongRef.json`).
This is the layout expected by goat, lex, lpm, and others.
This type function lets us carry the JSDoc across from the options to entry definitions, and simplifies our maintenance too 💪
Allows easy grouping of translations with their default, for clarity.
Adds support for permission-set lexicons with `lx.permissionSet()` and permission entry builders:
- `lx.repoPermission()`
- `lx.rpcPermission()`
- `lx.blobPermission()`
- `lx.accountPermission()`
- `lx.identityPermission()`
Collections and endpoints accept both lexicon schema objects and plain NSID strings.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Add enum & knownValues type hints
Adds type hints for enum values & knownValues on strings.
* Add changeset for enum & knownValues hints
* Add const type param to lx.string for automatic literal inference
Callers no longer need `as const` on enum/knownValues arrays to get
type-level autocomplete suggestions. Adds snapshot tests for both features.
* Fix formatting
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Adds support for permission-set lexicons with `lx.permissionSet()` and permission entry builders:
- `lx.repoPermission()`
- `lx.rpcPermission()`
- `lx.blobPermission()`
- `lx.accountPermission()`
- `lx.identityPermission()`
Collections and endpoints accept both lexicon schema objects and plain NSID strings.