prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey

Merge pull request #2 from tylersayshi/create-ts-app-move

move to create-typescript-app

authored by tyler and committed by GitHub aa53a594 a222b791

+5871 -3493
+131
.github/CODE_OF_CONDUCT.md
··· 1 + # Contributor Covenant Code of Conduct 2 + 3 + ## Our Pledge 4 + 5 + We as members, contributors, and leaders pledge to make participation in our 6 + community a harassment-free experience for everyone, regardless of age, body 7 + size, visible or invisible disability, ethnicity, sex characteristics, gender 8 + identity and expression, level of experience, education, socio-economic status, 9 + nationality, personal appearance, race, caste, color, religion, or sexual 10 + identity and orientation. 11 + 12 + We pledge to act and interact in ways that contribute to an open, welcoming, 13 + diverse, inclusive, and healthy community. 14 + 15 + ## Our Standards 16 + 17 + Examples of behavior that contributes to a positive environment for our 18 + community include: 19 + 20 + - Demonstrating empathy and kindness toward other people 21 + - Being respectful of differing opinions, viewpoints, and experiences 22 + - Giving and gracefully accepting constructive feedback 23 + - Accepting responsibility and apologizing to those affected by our mistakes, 24 + and learning from the experience 25 + - Focusing on what is best not just for us as individuals, but for the overall 26 + community 27 + 28 + Examples of unacceptable behavior include: 29 + 30 + - The use of sexualized language or imagery, and sexual attention or advances of 31 + any kind 32 + - Trolling, insulting or derogatory comments, and personal or political attacks 33 + - Public or private harassment 34 + - Publishing others' private information, such as a physical or email address, 35 + without their explicit permission 36 + - Other conduct which could reasonably be considered inappropriate in a 37 + professional setting 38 + 39 + ## Enforcement Responsibilities 40 + 41 + Community leaders are responsible for clarifying and enforcing our standards of 42 + acceptable behavior and will take appropriate and fair corrective action in 43 + response to any behavior that they deem inappropriate, threatening, offensive, 44 + or harmful. 45 + 46 + Community leaders have the right and responsibility to remove, edit, or reject 47 + comments, commits, code, wiki edits, issues, and other contributions that are 48 + not aligned to this Code of Conduct, and will communicate reasons for moderation 49 + decisions when appropriate. 50 + 51 + ## Scope 52 + 53 + This Code of Conduct applies within all community spaces, and also applies when 54 + an individual is officially representing the community in public spaces. 55 + Examples of representing our community include using an official e-mail address, 56 + posting via an official social media account, or acting as an appointed 57 + representative at an online or offline event. 58 + 59 + ## Enforcement 60 + 61 + Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 + reported to the community leaders responsible for enforcement at hi@tylur.dev. 63 + All complaints will be reviewed and investigated promptly and fairly. 64 + 65 + All community leaders are obligated to respect the privacy and security of the 66 + reporter of any incident. 67 + 68 + ## Enforcement Guidelines 69 + 70 + Community leaders will follow these Community Impact Guidelines in determining 71 + the consequences for any action they deem in violation of this Code of Conduct: 72 + 73 + ### 1. Correction 74 + 75 + **Community Impact**: Use of inappropriate language or other behavior deemed 76 + unprofessional or unwelcome in the community. 77 + 78 + **Consequence**: A private, written warning from community leaders, providing 79 + clarity around the nature of the violation and an explanation of why the 80 + behavior was inappropriate. A public apology may be requested. 81 + 82 + ### 2. Warning 83 + 84 + **Community Impact**: A violation through a single incident or series of 85 + actions. 86 + 87 + **Consequence**: A warning with consequences for continued behavior. No 88 + interaction with the people involved, including unsolicited interaction with 89 + those enforcing the Code of Conduct, for a specified period of time. This 90 + includes avoiding interactions in community spaces as well as external channels 91 + like social media. Violating these terms may lead to a temporary or permanent 92 + ban. 93 + 94 + ### 3. Temporary Ban 95 + 96 + **Community Impact**: A serious violation of community standards, including 97 + sustained inappropriate behavior. 98 + 99 + **Consequence**: A temporary ban from any sort of interaction or public 100 + communication with the community for a specified period of time. No public or 101 + private interaction with the people involved, including unsolicited interaction 102 + with those enforcing the Code of Conduct, is allowed during this period. 103 + Violating these terms may lead to a permanent ban. 104 + 105 + ### 4. Permanent Ban 106 + 107 + **Community Impact**: Demonstrating a pattern of violation of community 108 + standards, including sustained inappropriate behavior, harassment of an 109 + individual, or aggression toward or disparagement of classes of individuals. 110 + 111 + **Consequence**: A permanent ban from any sort of public interaction within the 112 + community. 113 + 114 + ## Attribution 115 + 116 + This Code of Conduct is adapted from the [Contributor Covenant][homepage], 117 + version 2.1, available at 118 + [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. 119 + 120 + Community Impact Guidelines were inspired by 121 + [Mozilla's code of conduct enforcement ladder][mozilla coc]. 122 + 123 + For answers to common questions about this code of conduct, see the FAQ at 124 + [https://www.contributor-covenant.org/faq][faq]. Translations are available at 125 + [https://www.contributor-covenant.org/translations][translations]. 126 + 127 + [homepage]: https://www.contributor-covenant.org 128 + [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html 129 + [mozilla coc]: https://github.com/mozilla/diversity 130 + [faq]: https://www.contributor-covenant.org/faq 131 + [translations]: https://www.contributor-covenant.org/translations
+97
.github/CONTRIBUTING.md
··· 1 + # Contributing 2 + 3 + Thanks for your interest in contributing to `prototypey`! 💖 4 + 5 + > After this page, see [DEVELOPMENT.md](./DEVELOPMENT.md) for local development instructions. 6 + 7 + ## Code of Conduct 8 + 9 + This project contains a [Contributor Covenant code of conduct](./CODE_OF_CONDUCT.md) all contributors are expected to follow. 10 + 11 + ## Reporting Issues 12 + 13 + Please do [report an issue on the issue tracker](https://github.com/tylersayshi/prototypey/issues/new/choose) if there's any bugfix, documentation improvement, or general enhancement you'd like to see in the repository! Please fully fill out all required fields in the most appropriate issue form. 14 + 15 + ## Sending Contributions 16 + 17 + Sending your own changes as contribution is always appreciated! 18 + There are two steps involved: 19 + 20 + 1. [Finding an Issue](#finding-an-issue) 21 + 2. [Sending a Pull Request](#sending-a-pull-request) 22 + 23 + ### Finding an Issue 24 + 25 + With the exception of very small typos, all changes to this repository generally need to correspond to an [unassigned open issue marked as `status: accepting prs` on the issue tracker](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue+is%3Aopen+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+). 26 + If this is your first time contributing, consider searching for [unassigned issues that also have the `good first issue` label](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3A%22status%3A+accepting+prs%22+no%3Aassignee+). 27 + If the issue you'd like to fix isn't found on the issue, see [Reporting Issues](#reporting-issues) for filing your own (please do!). 28 + 29 + #### Issue Claiming 30 + 31 + We don't use any kind of issue claiming system. 32 + We've found in the past that they result in accidental ["licked cookie"](https://devblogs.microsoft.com/oldnewthing/20091201-00/?p=15843) situations where contributors claim an issue but run out of time or energy trying before sending a PR. 33 + 34 + If an unassigned issue has been marked as `status: accepting prs` and an open PR does not exist, feel free to send a PR. 35 + Please don't post comments asking for permission or stating you will work on an issue. 36 + 37 + ### Sending a Pull Request 38 + 39 + Once you've identified an open issue accepting PRs that doesn't yet have a PR sent, you're free to send a pull request. 40 + Be sure to fill out the pull request template's requested information -- otherwise your PR will likely be closed. 41 + 42 + PRs are also expected to have a title that adheres to [conventional commits](https://www.conventionalcommits.org/en/v1.0.0). 43 + Only PR titles need to be in that format, not individual commits. 44 + Don't worry if you get this wrong: you can always change the PR title after sending it. 45 + Check [previously merged PRs](https://github.com/tylersayshi/prototypey/pulls?q=is%3Apr+is%3Amerged+-label%3Adependencies+) for reference. 46 + 47 + #### Draft PRs 48 + 49 + If you don't think your PR is ready for review, [set it as a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft). 50 + Draft PRs won't be reviewed. 51 + 52 + #### Granular PRs 53 + 54 + Please keep pull requests single-purpose: in other words, don't attempt to solve multiple unrelated problems in one pull request. 55 + Send one PR per area of concern. 56 + Multi-purpose pull requests are harder and slower to review, block all changes from being merged until the whole pull request is reviewed, and are difficult to name well with semantic PR titles. 57 + 58 + #### Pull Request Reviews 59 + 60 + When a PR is not in draft, it's considered ready for review. 61 + Please don't manually `@` tag anybody to request review. 62 + A maintainer will look at it when they're next able to. 63 + 64 + PRs should have passing [GitHub status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) before review is requested (unless there are explicit questions asked in the PR about any failures). 65 + 66 + #### Asking Questions 67 + 68 + If you need help and/or have a question, posting a comment in the PR is a great way to do so. 69 + There's no need to tag anybody individually. 70 + One of us will drop by and help when we can. 71 + 72 + Please post comments as [line comments](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request) when possible, so that they can be threaded. 73 + You can [resolve conversations](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request#resolving-conversations) on your own when you feel they're resolved - no need to comment explicitly and/or wait for a maintainer. 74 + 75 + #### Requested Changes 76 + 77 + After a maintainer reviews your PR, they may request changes on it. 78 + Once you've made those changes, [re-request review on GitHub](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review). 79 + 80 + Please try not to force-push commits to PRs that have already been reviewed. 81 + Doing so makes it harder to review the changes. 82 + We squash merge all commits so there's no need to try to preserve Git history within a PR branch. 83 + 84 + Once you've addressed all our feedback by making code changes and/or started a followup discussion, [re-request review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review) from each maintainer whose feedback you addressed. 85 + 86 + Once all feedback is addressed and the PR is approved, we'll ensure the branch is up to date with `main` and merge it for you. 87 + 88 + #### Post-Merge Recognition 89 + 90 + Once your PR is merged, if you haven't yet been added to the [_Contributors_ table in the README.md](../README.md#contributors) for its [type of contribution](https://allcontributors.org/docs/en/emoji-key "Allcontributors emoji key"), you should be soon. 91 + Please do ping the maintainer who merged your PR if that doesn't happen within 24 hours - it was likely an oversight on our end! 92 + 93 + ## Emojis & Appreciation 94 + 95 + If you made it all the way to the end, bravo dear user, we love you. 96 + Please include an emoji in the bottom of your issues and PRs to signal to us that you did in fact read this file and are trying to conform to it as best as possible. 97 + 💖 is a good starter if you're not sure which to use.
+67
.github/DEVELOPMENT.md
··· 1 + # Development 2 + 3 + After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing pnpm](https://pnpm.io/installation): 4 + 5 + ```shell 6 + git clone https://github.com/(your-name-here)/prototypey 7 + cd prototypey 8 + pnpm install 9 + ``` 10 + 11 + ## Building 12 + 13 + Run [**tsdown**](https://tsdown.dev) locally to build source files from `src/` into output files in `lib/`: 14 + 15 + ```shell 16 + pnpm build 17 + ``` 18 + 19 + Add `--watch` to run the builder in a watch mode that continuously cleans and recreates `lib/` as you save files: 20 + 21 + ```shell 22 + pnpm build --watch 23 + ``` 24 + 25 + ## Formatting 26 + 27 + [Prettier](https://prettier.io) is used to format code. 28 + It should be applied automatically when you save files in VS Code or make a Git commit. 29 + 30 + To manually reformat all files, you can run: 31 + 32 + ```shell 33 + pnpm format --write 34 + ``` 35 + 36 + ## Linting 37 + 38 + This package includes several forms of linting to enforce consistent code quality and styling. 39 + Each should be shown in VS Code, and can be run manually on the command-line: 40 + 41 + - `pnpm lint` ([ESLint](https://eslint.org) with [typescript-eslint](https://typescript-eslint.io)): Lints JavaScript and TypeScript source files 42 + 43 + Read the individual documentation for each linter to understand how it can be configured and used best. 44 + 45 + For example, ESLint can be run with `--fix` to auto-fix some lint rule complaints: 46 + 47 + ```shell 48 + pnpm run lint --fix 49 + ``` 50 + 51 + Note that you'll need to run `pnpm build` before `pnpm lint` so that lint rules which check the file system can pick up on any built files. 52 + 53 + ## Type Checking 54 + 55 + You should be able to see suggestions from [TypeScript](https://typescriptlang.org) in your editor for all open files. 56 + 57 + However, it can be useful to run the TypeScript command-line (`tsc`) to type check all files in `src/`: 58 + 59 + ```shell 60 + pnpm tsc 61 + ``` 62 + 63 + Add `--watch` to keep the type checker running in a watch mode that updates the display as you save files: 64 + 65 + ```shell 66 + pnpm tsc --watch 67 + ```
+9
.github/ISSUE_TEMPLATE.md
··· 1 + <!-- Note: Please must use one of our issue templates to file an issue! 🛑 --> 2 + <!-- 👉 https://github.com/tylersayshi/prototypey/issues/new/choose 👈 --> 3 + <!-- **Issues that should have been filed with a template will be closed without action, and we will ask you to use a template.** --> 4 + 5 + <!-- This blank issue template is only for issues that don't fit any of the templates. --> 6 + 7 + ## Overview 8 + 9 + ...
+37
.github/ISSUE_TEMPLATE/01-bug.yml
··· 1 + body: 2 + - attributes: 3 + description: If any of these required steps are not taken, we may not be able to review your issue. Help us to help you! 4 + label: Bug Report Checklist 5 + options: 6 + - label: I have tried restarting my IDE and the issue persists. 7 + required: true 8 + - label: I have pulled the latest `main` branch of the repository. 9 + required: true 10 + - label: I have [searched for related issues](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue) and found none that matched my issue. 11 + required: true 12 + type: checkboxes 13 + - attributes: 14 + description: What did you expect to happen? 15 + label: Expected 16 + type: textarea 17 + validations: 18 + required: true 19 + - attributes: 20 + description: What happened instead? 21 + label: Actual 22 + type: textarea 23 + validations: 24 + required: true 25 + - attributes: 26 + description: Any additional info you'd like to provide. 27 + label: Additional Info 28 + type: textarea 29 + 30 + description: Report a bug trying to run the code 31 + 32 + labels: 33 + - "type: bug" 34 + 35 + name: 🐛 Bug 36 + 37 + title: "🐛 Bug: <short description of the bug>"
+29
.github/ISSUE_TEMPLATE/02-documentation.yml
··· 1 + body: 2 + - attributes: 3 + description: If any of these required steps are not taken, we may not be able to review your issue. Help us to help you! 4 + label: Documentation Report Checklist 5 + options: 6 + - label: I have pulled the latest `main` branch of the repository. 7 + required: true 8 + - label: I have [searched for related issues](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue) and found none that matched my issue. 9 + required: true 10 + type: checkboxes 11 + - attributes: 12 + description: What would you like to report? 13 + label: Overview 14 + type: textarea 15 + validations: 16 + required: true 17 + - attributes: 18 + description: Any additional info you'd like to provide. 19 + label: Additional Info 20 + type: textarea 21 + 22 + description: Report a typo or missing area of documentation 23 + 24 + labels: 25 + - "area: documentation" 26 + 27 + name: 📝 Documentation 28 + 29 + title: "📝 Documentation: <short description of the request>"
+29
.github/ISSUE_TEMPLATE/03-feature.yml
··· 1 + body: 2 + - attributes: 3 + description: If any of these required steps are not taken, we may not be able to review your issue. Help us to help you! 4 + label: Feature Request Checklist 5 + options: 6 + - label: I have pulled the latest `main` branch of the repository. 7 + required: true 8 + - label: I have [searched for related issues](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue) and found none that matched my issue. 9 + required: true 10 + type: checkboxes 11 + - attributes: 12 + description: What did you expect to be able to do? 13 + label: Overview 14 + type: textarea 15 + validations: 16 + required: true 17 + - attributes: 18 + description: Any additional info you'd like to provide. 19 + label: Additional Info 20 + type: textarea 21 + 22 + description: Request that a new feature be added or an existing feature improved 23 + 24 + labels: 25 + - "type: feature" 26 + 27 + name: 🚀 Feature 28 + 29 + title: "🚀 Feature: <short description of the feature>"
+31
.github/ISSUE_TEMPLATE/04-tooling.yml
··· 1 + body: 2 + - attributes: 3 + description: If any of these required steps are not taken, we may not be able to review your issue. Help us to help you! 4 + label: Tooling Report Checklist 5 + options: 6 + - label: I have tried restarting my IDE and the issue persists. 7 + required: true 8 + - label: I have pulled the latest `main` branch of the repository. 9 + required: true 10 + - label: I have [searched for related issues](https://github.com/tylersayshi/prototypey/issues?q=is%3Aissue) and found none that matched my issue. 11 + required: true 12 + type: checkboxes 13 + - attributes: 14 + description: What did you expect to be able to do? 15 + label: Overview 16 + type: textarea 17 + validations: 18 + required: true 19 + - attributes: 20 + description: Any additional info you'd like to provide. 21 + label: Additional Info 22 + type: textarea 23 + 24 + description: Report a bug or request an enhancement in repository tooling 25 + 26 + labels: 27 + - "area: tooling" 28 + 29 + name: 🛠 Tooling 30 + 31 + title: "🛠 Tooling: <short description of the change>"
+13
.github/PULL_REQUEST_TEMPLATE.md
··· 1 + <!-- 👋 Hi, thanks for sending a PR to prototypey! 💖 2 + Please fill out all fields below and make sure each item is true and [x] checked. 3 + Otherwise we may not be able to review your PR. --> 4 + 5 + ## PR Checklist 6 + 7 + - [ ] Addresses an existing open issue: fixes #000 8 + - [ ] That issue was marked as [`status: accepting prs`](https://github.com/tylersayshi/prototypey/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) 9 + - [ ] Steps in [CONTRIBUTING.md](https://github.com/tylersayshi/prototypey/blob/main/.github/CONTRIBUTING.md) were taken 10 + 11 + ## Overview 12 + 13 + <!-- Description of what is changed and how the code change does that. -->
+9
.github/SECURITY.md
··· 1 + # Security Policy 2 + 3 + We take all security vulnerabilities seriously. 4 + If you have a vulnerability or other security issues to disclose: 5 + 6 + - Thank you very much, please do! 7 + - Please send them to us by emailing `hi@tylur.dev` 8 + 9 + We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions.
+14
.github/actions/prepare/action.yml
··· 1 + description: Prepares the repo for a typical CI job 2 + 3 + name: Prepare 4 + 5 + runs: 6 + steps: 7 + - uses: pnpm/action-setup@v4 8 + - uses: actions/setup-node@v4 9 + with: 10 + cache: pnpm 11 + node-version: 24.3.0 12 + - run: pnpm install --frozen-lockfile 13 + shell: bash 14 + using: composite
+45
.github/workflows/ci.yml
··· 1 + jobs: 2 + build: 3 + name: Build 4 + runs-on: ubuntu-latest 5 + steps: 6 + - uses: actions/checkout@v4 7 + - uses: ./.github/actions/prepare 8 + - run: pnpm build 9 + - run: node lib/index.js 10 + lint: 11 + name: Lint 12 + runs-on: ubuntu-latest 13 + steps: 14 + - uses: actions/checkout@v4 15 + - uses: ./.github/actions/prepare 16 + - run: pnpm lint 17 + prettier: 18 + name: Prettier 19 + runs-on: ubuntu-latest 20 + steps: 21 + - uses: actions/checkout@v4 22 + - uses: ./.github/actions/prepare 23 + - run: pnpm format --list-different 24 + type_check: 25 + name: Type Check 26 + runs-on: ubuntu-latest 27 + steps: 28 + - uses: actions/checkout@v4 29 + - uses: ./.github/actions/prepare 30 + - run: pnpm tsc 31 + test: 32 + name: Test 33 + runs-on: ubuntu-latest 34 + steps: 35 + - uses: actions/checkout@v4 36 + - uses: ./.github/actions/prepare 37 + - run: pnpm test 38 + 39 + name: CI 40 + 41 + on: 42 + pull_request: ~ 43 + push: 44 + branches: 45 + - main
-43
.github/workflows/deno.yml
··· 1 - # This workflow uses actions that are not certified by GitHub. 2 - # They are provided by a third-party and are governed by 3 - # separate terms of service, privacy policy, and support 4 - # documentation. 5 - 6 - # This workflow will install Deno then run `deno lint` and `deno test`. 7 - # For more information see: https://github.com/denoland/setup-deno 8 - 9 - name: Deno 10 - 11 - on: 12 - push: 13 - branches: ["main"] 14 - pull_request: 15 - branches: ["main"] 16 - 17 - permissions: 18 - contents: read 19 - 20 - jobs: 21 - test: 22 - runs-on: ubuntu-latest 23 - 24 - steps: 25 - - name: Setup repo 26 - uses: actions/checkout@v4 27 - 28 - - name: Setup Deno 29 - uses: denoland/setup-deno@v1 30 - with: 31 - deno-version: v2.x 32 - 33 - - name: Verify formatting 34 - run: deno fmt --check 35 - 36 - - name: Run linter 37 - run: deno lint 38 - 39 - - name: Run type checker 40 - run: deno check 41 - 42 - - name: Run tests 43 - run: deno test -A
+21
.github/workflows/pr-review-requested.yml
··· 1 + jobs: 2 + pr_review_requested: 3 + runs-on: ubuntu-latest 4 + steps: 5 + - uses: actions-ecosystem/action-remove-labels@v1 6 + with: 7 + labels: "status: waiting for author" 8 + - if: failure() 9 + run: | 10 + echo "Don't worry if the previous step failed." 11 + echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221." 12 + 13 + name: PR Review Requested 14 + 15 + on: 16 + pull_request_target: 17 + types: 18 + - review_requested 19 + 20 + permissions: 21 + pull-requests: write
+2
.gitignore
··· 1 + /lib 2 + /node_modules
+1
.husky/.gitignore
··· 1 + _
+1
.husky/pre-commit
··· 1 + npx lint-staged
+3
.prettierignore
··· 1 + /.husky 2 + /lib 3 + /pnpm-lock.yaml
+1
.prettierrc.json
··· 1 + { "$schema": "http://json.schemastore.org/prettierrc", "useTabs": true }
+1 -2
.vscode/settings.json
··· 1 1 { 2 - "editor.defaultFormatter": "denoland.vscode-deno", 3 - "prettier.enable": false 2 + "editor.defaultFormatter": "esbenp.prettier-vscode" 4 3 }
+20
LICENSE.md
··· 1 + # MIT License 2 + 3 + Permission is hereby granted, free of charge, to any person obtaining 4 + a copy of this software and associated documentation files (the 5 + 'Software'), to deal in the Software without restriction, including 6 + without limitation the rights to use, copy, modify, merge, publish, 7 + distribute, sublicense, and/or sell copies of the Software, and to 8 + permit persons to whom the Software is furnished to do so, subject to 9 + the following conditions: 10 + 11 + The above copyright notice and this permission notice shall be 12 + included in all copies or substantial portions of the Software. 13 + 14 + THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 15 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 18 + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 20 + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+53 -30
README.md
··· 30 30 31 31 ```typescript 32 32 const profileNamespace = lx.namespace("app.bsky.actor.profile", { 33 - main: lx.record({ 34 - key: "self", 35 - record: lx.object({ 36 - displayName: lx.string({ maxLength: 64, maxGraphemes: 64 }), 37 - description: lx.string({ maxLength: 256, maxGraphemes: 256 }), 38 - }), 39 - }), 33 + main: lx.record({ 34 + key: "self", 35 + record: lx.object({ 36 + displayName: lx.string({ maxLength: 64, maxGraphemes: 64 }), 37 + description: lx.string({ maxLength: 256, maxGraphemes: 256 }), 38 + }), 39 + }), 40 40 }); 41 41 ``` 42 42 ··· 44 44 45 45 ```json 46 46 { 47 - "lexicon": 1, 48 - "id": "app.bsky.actor.profile", 49 - "defs": { 50 - "main": { 51 - "type": "record", 52 - "key": "self", 53 - "record": { 54 - "type": "object", 55 - "properties": { 56 - "displayName": { 57 - "type": "string", 58 - "maxLength": 64, 59 - "maxGraphemes": 64 60 - }, 61 - "description": { 62 - "type": "string", 63 - "maxLength": 256, 64 - "maxGraphemes": 256 65 - } 66 - } 67 - } 68 - } 69 - } 47 + "lexicon": 1, 48 + "id": "app.bsky.actor.profile", 49 + "defs": { 50 + "main": { 51 + "type": "record", 52 + "key": "self", 53 + "record": { 54 + "type": "object", 55 + "properties": { 56 + "displayName": { 57 + "type": "string", 58 + "maxLength": 64, 59 + "maxGraphemes": 64 60 + }, 61 + "description": { 62 + "type": "string", 63 + "maxLength": 256, 64 + "maxGraphemes": 256 65 + } 66 + } 67 + } 68 + } 69 + } 70 70 } 71 71 ``` 72 + 73 + --- 74 + 75 + <p align="center"> 76 + <a href="https://github.com/tylersayshi/prototypey/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="🤝 Code of Conduct: Kept" src="https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42" /></a> 77 + <a href="https://github.com/tylersayshi/prototypey/blob/main/LICENSE.md" target="_blank"><img alt="📝 License: MIT" src="https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg" /></a> 78 + <img alt="💪 TypeScript: Strict" src="https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg" /> 79 + </p> 80 + 81 + ## Usage 82 + 83 + tbd 84 + 85 + ## Development 86 + 87 + See [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md), then 88 + [`.github/DEVELOPMENT.md`](./.github/DEVELOPMENT.md). Thanks! 💖 89 + 90 + <!-- You can remove this notice if you don't want it 🙂 no worries! --> 91 + 92 + > 💝 This package was templated with 93 + > [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app) 94 + > using the [Bingo framework](https://create.bingo).
-11
deno.json
··· 1 - { 2 - "tasks": { 3 - "dev": "deno run --watch main.ts" 4 - }, 5 - "imports": { 6 - "@std/assert": "jsr:@std/assert@1" 7 - }, 8 - "compilerOptions": { 9 - "exactOptionalPropertyTypes": true 10 - } 11 - }
-23
deno.lock
··· 1 - { 2 - "version": "5", 3 - "specifiers": { 4 - "jsr:@std/assert@1": "1.0.14", 5 - "jsr:@std/internal@^1.0.10": "1.0.10" 6 - }, 7 - "jsr": { 8 - "@std/assert@1.0.14": { 9 - "integrity": "68d0d4a43b365abc927f45a9b85c639ea18a9fab96ad92281e493e4ed84abaa4", 10 - "dependencies": [ 11 - "jsr:@std/internal" 12 - ] 13 - }, 14 - "@std/internal@1.0.10": { 15 - "integrity": "e3be62ce42cab0e177c27698e5d9800122f67b766a0bea6ca4867886cbde8cf7" 16 - } 17 - }, 18 - "workspace": { 19 - "dependencies": [ 20 - "jsr:@std/assert@1" 21 - ] 22 - } 23 - }
+26
eslint.config.js
··· 1 + import eslint from "@eslint/js"; 2 + import tseslint from "typescript-eslint"; 3 + 4 + export default tseslint.config( 5 + { ignores: ["lib", "node_modules", "pnpm-lock.yaml"] }, 6 + { linterOptions: { reportUnusedDisableDirectives: "error" } }, 7 + eslint.configs.recommended, 8 + { 9 + extends: [ 10 + tseslint.configs.strictTypeChecked, 11 + tseslint.configs.stylisticTypeChecked, 12 + ], 13 + files: ["**/*.{js,ts}"], 14 + languageOptions: { 15 + parserOptions: { 16 + projectService: { allowDefaultProject: ["*.config.*s"] }, 17 + }, 18 + }, 19 + }, 20 + { 21 + files: ["**/*.test.ts"], 22 + rules: { 23 + "@typescript-eslint/no-floating-promises": "off", 24 + }, 25 + }, 26 + );
+48
package.json
··· 1 + { 2 + "name": "prototypey", 3 + "version": "0.0.0", 4 + "description": "A very lovely package. Hooray!", 5 + "repository": { 6 + "type": "git", 7 + "url": "git+https://github.com/tylersayshi/prototypey.git" 8 + }, 9 + "license": "MIT", 10 + "author": { 11 + "name": "tylersayshi", 12 + "email": "hi@tylur.dev" 13 + }, 14 + "type": "module", 15 + "main": "lib/index.js", 16 + "files": [ 17 + "LICENSE.md", 18 + "README.md", 19 + "lib/", 20 + "package.json" 21 + ], 22 + "scripts": { 23 + "build": "tsdown", 24 + "format": "prettier .", 25 + "lint": "eslint . --max-warnings 0", 26 + "test": "node --test", 27 + "prepare": "husky", 28 + "tsc": "tsc" 29 + }, 30 + "lint-staged": { 31 + "*": "prettier --ignore-unknown --write" 32 + }, 33 + "devDependencies": { 34 + "@eslint/js": "9.29.0", 35 + "@types/node": "24.0.4", 36 + "eslint": "9.29.0", 37 + "husky": "9.1.7", 38 + "lint-staged": "16.1.2", 39 + "prettier": "3.6.1", 40 + "tsdown": "0.12.7", 41 + "typescript": "5.8.3", 42 + "typescript-eslint": "8.35.0" 43 + }, 44 + "packageManager": "pnpm@10.4.0", 45 + "engines": { 46 + "node": ">=20.19.0" 47 + } 48 + }
+1807
pnpm-lock.yaml
··· 1 + lockfileVersion: '9.0' 2 + 3 + settings: 4 + autoInstallPeers: true 5 + excludeLinksFromLockfile: false 6 + 7 + importers: 8 + 9 + .: 10 + devDependencies: 11 + '@eslint/js': 12 + specifier: 9.29.0 13 + version: 9.29.0 14 + '@types/node': 15 + specifier: 24.0.4 16 + version: 24.0.4 17 + eslint: 18 + specifier: 9.29.0 19 + version: 9.29.0(jiti@2.6.1) 20 + husky: 21 + specifier: 9.1.7 22 + version: 9.1.7 23 + lint-staged: 24 + specifier: 16.1.2 25 + version: 16.1.2 26 + prettier: 27 + specifier: 3.6.1 28 + version: 3.6.1 29 + tsdown: 30 + specifier: 0.12.7 31 + version: 0.12.7(typescript@5.8.3) 32 + typescript: 33 + specifier: 5.8.3 34 + version: 5.8.3 35 + typescript-eslint: 36 + specifier: 8.35.0 37 + version: 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 38 + 39 + packages: 40 + 41 + '@babel/generator@7.28.3': 42 + resolution: {integrity: sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==} 43 + engines: {node: '>=6.9.0'} 44 + 45 + '@babel/helper-string-parser@7.27.1': 46 + resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} 47 + engines: {node: '>=6.9.0'} 48 + 49 + '@babel/helper-validator-identifier@7.27.1': 50 + resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} 51 + engines: {node: '>=6.9.0'} 52 + 53 + '@babel/parser@7.28.4': 54 + resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==} 55 + engines: {node: '>=6.0.0'} 56 + hasBin: true 57 + 58 + '@babel/types@7.28.4': 59 + resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} 60 + engines: {node: '>=6.9.0'} 61 + 62 + '@emnapi/core@1.5.0': 63 + resolution: {integrity: sha512-sbP8GzB1WDzacS8fgNPpHlp6C9VZe+SJP3F90W9rLemaQj2PzIuTEl1qDOYQf58YIpyjViI24y9aPWCjEzY2cg==} 64 + 65 + '@emnapi/runtime@1.5.0': 66 + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} 67 + 68 + '@emnapi/wasi-threads@1.1.0': 69 + resolution: {integrity: sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==} 70 + 71 + '@eslint-community/eslint-utils@4.9.0': 72 + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} 73 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 74 + peerDependencies: 75 + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 76 + 77 + '@eslint-community/regexpp@4.12.1': 78 + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} 79 + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} 80 + 81 + '@eslint/config-array@0.20.1': 82 + resolution: {integrity: sha512-OL0RJzC/CBzli0DrrR31qzj6d6i6Mm3HByuhflhl4LOBiWxN+3i6/t/ZQQNii4tjksXi8r2CRW1wMpWA2ULUEw==} 83 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 84 + 85 + '@eslint/config-helpers@0.2.3': 86 + resolution: {integrity: sha512-u180qk2Um1le4yf0ruXH3PYFeEZeYC3p/4wCTKrr2U1CmGdzGi3KtY0nuPDH48UJxlKCC5RDzbcbh4X0XlqgHg==} 87 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 88 + 89 + '@eslint/core@0.14.0': 90 + resolution: {integrity: sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==} 91 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 92 + 93 + '@eslint/core@0.15.2': 94 + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} 95 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 96 + 97 + '@eslint/eslintrc@3.3.1': 98 + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} 99 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 100 + 101 + '@eslint/js@9.29.0': 102 + resolution: {integrity: sha512-3PIF4cBw/y+1u2EazflInpV+lYsSG0aByVIQzAgb1m1MhHFSbqTyNqtBKHgWf/9Ykud+DhILS9EGkmekVhbKoQ==} 103 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 104 + 105 + '@eslint/object-schema@2.1.6': 106 + resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} 107 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 108 + 109 + '@eslint/plugin-kit@0.3.5': 110 + resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} 111 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 112 + 113 + '@humanfs/core@0.19.1': 114 + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} 115 + engines: {node: '>=18.18.0'} 116 + 117 + '@humanfs/node@0.16.7': 118 + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} 119 + engines: {node: '>=18.18.0'} 120 + 121 + '@humanwhocodes/module-importer@1.0.1': 122 + resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} 123 + engines: {node: '>=12.22'} 124 + 125 + '@humanwhocodes/retry@0.4.3': 126 + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} 127 + engines: {node: '>=18.18'} 128 + 129 + '@jridgewell/gen-mapping@0.3.13': 130 + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} 131 + 132 + '@jridgewell/resolve-uri@3.1.2': 133 + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} 134 + engines: {node: '>=6.0.0'} 135 + 136 + '@jridgewell/sourcemap-codec@1.5.5': 137 + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} 138 + 139 + '@jridgewell/trace-mapping@0.3.31': 140 + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} 141 + 142 + '@napi-rs/wasm-runtime@0.2.12': 143 + resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} 144 + 145 + '@nodelib/fs.scandir@2.1.5': 146 + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} 147 + engines: {node: '>= 8'} 148 + 149 + '@nodelib/fs.stat@2.0.5': 150 + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} 151 + engines: {node: '>= 8'} 152 + 153 + '@nodelib/fs.walk@1.2.8': 154 + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} 155 + engines: {node: '>= 8'} 156 + 157 + '@oxc-project/runtime@0.72.2': 158 + resolution: {integrity: sha512-J2lsPDen2mFs3cOA1gIBd0wsHEhum2vTnuKIRwmj3HJJcIz/XgeNdzvgSOioIXOJgURIpcDaK05jwaDG1rhDwg==} 159 + engines: {node: '>=6.9.0'} 160 + 161 + '@oxc-project/types@0.72.2': 162 + resolution: {integrity: sha512-il5RF8AP85XC0CMjHF4cnVT9nT/v/ocm6qlZQpSiAR9qBbQMGkFKloBZwm7PcnOdiUX97yHgsKM7uDCCWCu3tg==} 163 + 164 + '@quansync/fs@0.1.5': 165 + resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==} 166 + 167 + '@rolldown/binding-darwin-arm64@1.0.0-beta.11-commit.f051675': 168 + resolution: {integrity: sha512-Hlt/h+lOJ+ksC2wED2M9Hku/9CA2Hr17ENK82gNMmi3OqwcZLdZFqJDpASTli65wIOeT4p9rIUMdkfshCoJpYA==} 169 + cpu: [arm64] 170 + os: [darwin] 171 + 172 + '@rolldown/binding-darwin-x64@1.0.0-beta.11-commit.f051675': 173 + resolution: {integrity: sha512-Bnst+HBwhW2YrNybEiNf9TJkI1myDgXmiPBVIOS0apzrLCmByzei6PilTClOpTpNFYB+UviL3Ox2gKUmcgUjGw==} 174 + cpu: [x64] 175 + os: [darwin] 176 + 177 + '@rolldown/binding-freebsd-x64@1.0.0-beta.11-commit.f051675': 178 + resolution: {integrity: sha512-3jAxVmYDPc8vMZZOfZI1aokGB9cP6VNeU9XNCx0UJ6ShlSPK3qkAa0sWgueMhaQkgBVf8MOfGpjo47ohGd7QrA==} 179 + cpu: [x64] 180 + os: [freebsd] 181 + 182 + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.11-commit.f051675': 183 + resolution: {integrity: sha512-TpUltUdvcsAf2WvXXD8AVc3BozvhgazJ2gJLXp4DVV2V82m26QelI373Bzx8d/4hB167EEIg4wWW/7GXB/ltoQ==} 184 + cpu: [arm] 185 + os: [linux] 186 + 187 + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.11-commit.f051675': 188 + resolution: {integrity: sha512-eGvHnYQSdbdhsTdjdp/+83LrN81/7X9HD6y3jg7mEmdsicxEMEIt6CsP7tvYS/jn4489jgO/6mLxW/7Vg+B8pw==} 189 + cpu: [arm64] 190 + os: [linux] 191 + 192 + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.11-commit.f051675': 193 + resolution: {integrity: sha512-0NJZWXJls83FpBRzkTbGBsXXstaQLsfodnyeOghxbnNdsjn+B4dcNPpMK5V3QDsjC0pNjDLaDdzB2jWKlZbP/Q==} 194 + cpu: [arm64] 195 + os: [linux] 196 + 197 + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.11-commit.f051675': 198 + resolution: {integrity: sha512-9vXnu27r4zgS/BHP6RCLBOrJoV2xxtLYHT68IVpSOdCkBHGpf1oOJt6blv1y5NRRJBEfAFCvj5NmwSMhETF96w==} 199 + cpu: [x64] 200 + os: [linux] 201 + 202 + '@rolldown/binding-linux-x64-musl@1.0.0-beta.11-commit.f051675': 203 + resolution: {integrity: sha512-e6tvsZbtHt4kzl82oCajOUxwIN8uMfjhuQ0qxIVRzPekRRjKEzyH9agYPW6toN0cnHpkhPsu51tyZKJOdUl7jg==} 204 + cpu: [x64] 205 + os: [linux] 206 + 207 + '@rolldown/binding-wasm32-wasi@1.0.0-beta.11-commit.f051675': 208 + resolution: {integrity: sha512-nBQVizPoUQiViANhWrOyihXNf2booP2iq3S396bI1tmHftdgUXWKa6yAoleJBgP0oF0idXpTPU82ciaROUcjpg==} 209 + engines: {node: '>=14.21.3'} 210 + cpu: [wasm32] 211 + 212 + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.11-commit.f051675': 213 + resolution: {integrity: sha512-Rey/ECXKI/UEykrKfJX3oVAPXDH2k1p2BKzYGza0z3S2X5I3sTDOeBn2I0IQgyyf7U3+DCBhYjkDFnmSePrU/A==} 214 + cpu: [arm64] 215 + os: [win32] 216 + 217 + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.11-commit.f051675': 218 + resolution: {integrity: sha512-LtuMKJe6iFH4iV55dy+gDwZ9v23Tfxx5cd7ZAxvhYFGoVNSvarxAgl844BvFGReERCnLTGRvo85FUR6fDHQX+A==} 219 + cpu: [ia32] 220 + os: [win32] 221 + 222 + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.11-commit.f051675': 223 + resolution: {integrity: sha512-YY8UYfBm4dbWa4psgEPPD9T9X0nAvlYu0BOsQC5vDfCwzzU7IHT4jAfetvlQq+4+M6qWHSTr6v+/WX5EmlM1WA==} 224 + cpu: [x64] 225 + os: [win32] 226 + 227 + '@rolldown/pluginutils@1.0.0-beta.11-commit.f051675': 228 + resolution: {integrity: sha512-TAqMYehvpauLKz7v4TZOTUQNjxa5bUQWw2+51/+Zk3ItclBxgoSWhnZ31sXjdoX6le6OXdK2vZfV3KoyW/O/GA==} 229 + 230 + '@tybys/wasm-util@0.10.1': 231 + resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} 232 + 233 + '@types/estree@1.0.8': 234 + resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} 235 + 236 + '@types/json-schema@7.0.15': 237 + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} 238 + 239 + '@types/node@24.0.4': 240 + resolution: {integrity: sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA==} 241 + 242 + '@typescript-eslint/eslint-plugin@8.35.0': 243 + resolution: {integrity: sha512-ijItUYaiWuce0N1SoSMrEd0b6b6lYkYt99pqCPfybd+HKVXtEvYhICfLdwp42MhiI5mp0oq7PKEL+g1cNiz/Eg==} 244 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 245 + peerDependencies: 246 + '@typescript-eslint/parser': ^8.35.0 247 + eslint: ^8.57.0 || ^9.0.0 248 + typescript: '>=4.8.4 <5.9.0' 249 + 250 + '@typescript-eslint/parser@8.35.0': 251 + resolution: {integrity: sha512-6sMvZePQrnZH2/cJkwRpkT7DxoAWh+g6+GFRK6bV3YQo7ogi3SX5rgF6099r5Q53Ma5qeT7LGmOmuIutF4t3lA==} 252 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 253 + peerDependencies: 254 + eslint: ^8.57.0 || ^9.0.0 255 + typescript: '>=4.8.4 <5.9.0' 256 + 257 + '@typescript-eslint/project-service@8.35.0': 258 + resolution: {integrity: sha512-41xatqRwWZuhUMF/aZm2fcUsOFKNcG28xqRSS6ZVr9BVJtGExosLAm5A1OxTjRMagx8nJqva+P5zNIGt8RIgbQ==} 259 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 260 + peerDependencies: 261 + typescript: '>=4.8.4 <5.9.0' 262 + 263 + '@typescript-eslint/scope-manager@8.35.0': 264 + resolution: {integrity: sha512-+AgL5+mcoLxl1vGjwNfiWq5fLDZM1TmTPYs2UkyHfFhgERxBbqHlNjRzhThJqz+ktBqTChRYY6zwbMwy0591AA==} 265 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 266 + 267 + '@typescript-eslint/tsconfig-utils@8.35.0': 268 + resolution: {integrity: sha512-04k/7247kZzFraweuEirmvUj+W3bJLI9fX6fbo1Qm2YykuBvEhRTPl8tcxlYO8kZZW+HIXfkZNoasVb8EV4jpA==} 269 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 270 + peerDependencies: 271 + typescript: '>=4.8.4 <5.9.0' 272 + 273 + '@typescript-eslint/type-utils@8.35.0': 274 + resolution: {integrity: sha512-ceNNttjfmSEoM9PW87bWLDEIaLAyR+E6BoYJQ5PfaDau37UGca9Nyq3lBk8Bw2ad0AKvYabz6wxc7DMTO2jnNA==} 275 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 276 + peerDependencies: 277 + eslint: ^8.57.0 || ^9.0.0 278 + typescript: '>=4.8.4 <5.9.0' 279 + 280 + '@typescript-eslint/types@8.35.0': 281 + resolution: {integrity: sha512-0mYH3emanku0vHw2aRLNGqe7EXh9WHEhi7kZzscrMDf6IIRUQ5Jk4wp1QrledE/36KtdZrVfKnE32eZCf/vaVQ==} 282 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 283 + 284 + '@typescript-eslint/typescript-estree@8.35.0': 285 + resolution: {integrity: sha512-F+BhnaBemgu1Qf8oHrxyw14wq6vbL8xwWKKMwTMwYIRmFFY/1n/9T/jpbobZL8vp7QyEUcC6xGrnAO4ua8Kp7w==} 286 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 287 + peerDependencies: 288 + typescript: '>=4.8.4 <5.9.0' 289 + 290 + '@typescript-eslint/utils@8.35.0': 291 + resolution: {integrity: sha512-nqoMu7WWM7ki5tPgLVsmPM8CkqtoPUG6xXGeefM5t4x3XumOEKMoUZPdi+7F+/EotukN4R9OWdmDxN80fqoZeg==} 292 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 293 + peerDependencies: 294 + eslint: ^8.57.0 || ^9.0.0 295 + typescript: '>=4.8.4 <5.9.0' 296 + 297 + '@typescript-eslint/visitor-keys@8.35.0': 298 + resolution: {integrity: sha512-zTh2+1Y8ZpmeQaQVIc/ZZxsx8UzgKJyNg1PTvjzC7WMhPSVS8bfDX34k1SrwOf016qd5RU3az2UxUNue3IfQ5g==} 299 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 300 + 301 + acorn-jsx@5.3.2: 302 + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} 303 + peerDependencies: 304 + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 305 + 306 + acorn@8.15.0: 307 + resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} 308 + engines: {node: '>=0.4.0'} 309 + hasBin: true 310 + 311 + ajv@6.12.6: 312 + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} 313 + 314 + ansi-escapes@7.1.1: 315 + resolution: {integrity: sha512-Zhl0ErHcSRUaVfGUeUdDuLgpkEo8KIFjB4Y9uAc46ScOpdDiU1Dbyplh7qWJeJ/ZHpbyMSM26+X3BySgnIz40Q==} 316 + engines: {node: '>=18'} 317 + 318 + ansi-regex@6.2.2: 319 + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} 320 + engines: {node: '>=12'} 321 + 322 + ansi-styles@4.3.0: 323 + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 324 + engines: {node: '>=8'} 325 + 326 + ansi-styles@6.2.3: 327 + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} 328 + engines: {node: '>=12'} 329 + 330 + ansis@4.2.0: 331 + resolution: {integrity: sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==} 332 + engines: {node: '>=14'} 333 + 334 + argparse@2.0.1: 335 + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} 336 + 337 + ast-kit@2.1.3: 338 + resolution: {integrity: sha512-TH+b3Lv6pUjy/Nu0m6A2JULtdzLpmqF9x1Dhj00ZoEiML8qvVA9j1flkzTKNYgdEhWrjDwtWNpyyCUbfQe514g==} 339 + engines: {node: '>=20.19.0'} 340 + 341 + balanced-match@1.0.2: 342 + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 343 + 344 + birpc@2.6.1: 345 + resolution: {integrity: sha512-LPnFhlDpdSH6FJhJyn4M0kFO7vtQ5iPw24FnG0y21q09xC7e8+1LeR31S1MAIrDAHp4m7aas4bEkTDTvMAtebQ==} 346 + 347 + brace-expansion@1.1.12: 348 + resolution: {integrity: sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==} 349 + 350 + brace-expansion@2.0.2: 351 + resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==} 352 + 353 + braces@3.0.3: 354 + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 355 + engines: {node: '>=8'} 356 + 357 + cac@6.7.14: 358 + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} 359 + engines: {node: '>=8'} 360 + 361 + callsites@3.1.0: 362 + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} 363 + engines: {node: '>=6'} 364 + 365 + chalk@4.1.2: 366 + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} 367 + engines: {node: '>=10'} 368 + 369 + chalk@5.6.2: 370 + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} 371 + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} 372 + 373 + chokidar@4.0.3: 374 + resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} 375 + engines: {node: '>= 14.16.0'} 376 + 377 + cli-cursor@5.0.0: 378 + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} 379 + engines: {node: '>=18'} 380 + 381 + cli-truncate@4.0.0: 382 + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} 383 + engines: {node: '>=18'} 384 + 385 + color-convert@2.0.1: 386 + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 387 + engines: {node: '>=7.0.0'} 388 + 389 + color-name@1.1.4: 390 + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} 391 + 392 + colorette@2.0.20: 393 + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} 394 + 395 + commander@14.0.1: 396 + resolution: {integrity: sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==} 397 + engines: {node: '>=20'} 398 + 399 + concat-map@0.0.1: 400 + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} 401 + 402 + cross-spawn@7.0.6: 403 + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} 404 + engines: {node: '>= 8'} 405 + 406 + debug@4.4.3: 407 + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} 408 + engines: {node: '>=6.0'} 409 + peerDependencies: 410 + supports-color: '*' 411 + peerDependenciesMeta: 412 + supports-color: 413 + optional: true 414 + 415 + deep-is@0.1.4: 416 + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} 417 + 418 + defu@6.1.4: 419 + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} 420 + 421 + diff@8.0.2: 422 + resolution: {integrity: sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg==} 423 + engines: {node: '>=0.3.1'} 424 + 425 + dts-resolver@2.1.2: 426 + resolution: {integrity: sha512-xeXHBQkn2ISSXxbJWD828PFjtyg+/UrMDo7W4Ffcs7+YWCquxU8YjV1KoxuiL+eJ5pg3ll+bC6flVv61L3LKZg==} 427 + engines: {node: '>=20.18.0'} 428 + peerDependencies: 429 + oxc-resolver: '>=11.0.0' 430 + peerDependenciesMeta: 431 + oxc-resolver: 432 + optional: true 433 + 434 + emoji-regex@10.5.0: 435 + resolution: {integrity: sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg==} 436 + 437 + empathic@1.1.0: 438 + resolution: {integrity: sha512-rsPft6CK3eHtrlp9Y5ALBb+hfK+DWnA4WFebbazxjWyx8vSm3rZeoM3z9irsjcqO3PYRzlfv27XIB4tz2DV7RA==} 439 + engines: {node: '>=14'} 440 + 441 + environment@1.1.0: 442 + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} 443 + engines: {node: '>=18'} 444 + 445 + escape-string-regexp@4.0.0: 446 + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} 447 + engines: {node: '>=10'} 448 + 449 + eslint-scope@8.4.0: 450 + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} 451 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 452 + 453 + eslint-visitor-keys@3.4.3: 454 + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} 455 + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} 456 + 457 + eslint-visitor-keys@4.2.1: 458 + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} 459 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 460 + 461 + eslint@9.29.0: 462 + resolution: {integrity: sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ==} 463 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 464 + hasBin: true 465 + peerDependencies: 466 + jiti: '*' 467 + peerDependenciesMeta: 468 + jiti: 469 + optional: true 470 + 471 + espree@10.4.0: 472 + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} 473 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 474 + 475 + esquery@1.6.0: 476 + resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} 477 + engines: {node: '>=0.10'} 478 + 479 + esrecurse@4.3.0: 480 + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} 481 + engines: {node: '>=4.0'} 482 + 483 + estraverse@5.3.0: 484 + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} 485 + engines: {node: '>=4.0'} 486 + 487 + esutils@2.0.3: 488 + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 489 + engines: {node: '>=0.10.0'} 490 + 491 + eventemitter3@5.0.1: 492 + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} 493 + 494 + fast-deep-equal@3.1.3: 495 + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} 496 + 497 + fast-glob@3.3.3: 498 + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} 499 + engines: {node: '>=8.6.0'} 500 + 501 + fast-json-stable-stringify@2.1.0: 502 + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} 503 + 504 + fast-levenshtein@2.0.6: 505 + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} 506 + 507 + fastq@1.19.1: 508 + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} 509 + 510 + fdir@6.5.0: 511 + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} 512 + engines: {node: '>=12.0.0'} 513 + peerDependencies: 514 + picomatch: ^3 || ^4 515 + peerDependenciesMeta: 516 + picomatch: 517 + optional: true 518 + 519 + file-entry-cache@8.0.0: 520 + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} 521 + engines: {node: '>=16.0.0'} 522 + 523 + fill-range@7.1.1: 524 + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} 525 + engines: {node: '>=8'} 526 + 527 + find-up@5.0.0: 528 + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} 529 + engines: {node: '>=10'} 530 + 531 + flat-cache@4.0.1: 532 + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} 533 + engines: {node: '>=16'} 534 + 535 + flatted@3.3.3: 536 + resolution: {integrity: sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==} 537 + 538 + get-east-asian-width@1.4.0: 539 + resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} 540 + engines: {node: '>=18'} 541 + 542 + get-tsconfig@4.12.0: 543 + resolution: {integrity: sha512-LScr2aNr2FbjAjZh2C6X6BxRx1/x+aTDExct/xyq2XKbYOiG5c0aK7pMsSuyc0brz3ibr/lbQiHD9jzt4lccJw==} 544 + 545 + glob-parent@5.1.2: 546 + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 547 + engines: {node: '>= 6'} 548 + 549 + glob-parent@6.0.2: 550 + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} 551 + engines: {node: '>=10.13.0'} 552 + 553 + globals@14.0.0: 554 + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} 555 + engines: {node: '>=18'} 556 + 557 + graphemer@1.4.0: 558 + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} 559 + 560 + has-flag@4.0.0: 561 + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} 562 + engines: {node: '>=8'} 563 + 564 + hookable@5.5.3: 565 + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} 566 + 567 + husky@9.1.7: 568 + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} 569 + engines: {node: '>=18'} 570 + hasBin: true 571 + 572 + ignore@5.3.2: 573 + resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} 574 + engines: {node: '>= 4'} 575 + 576 + ignore@7.0.5: 577 + resolution: {integrity: sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==} 578 + engines: {node: '>= 4'} 579 + 580 + import-fresh@3.3.1: 581 + resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==} 582 + engines: {node: '>=6'} 583 + 584 + imurmurhash@0.1.4: 585 + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} 586 + engines: {node: '>=0.8.19'} 587 + 588 + is-extglob@2.1.1: 589 + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 590 + engines: {node: '>=0.10.0'} 591 + 592 + is-fullwidth-code-point@4.0.0: 593 + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} 594 + engines: {node: '>=12'} 595 + 596 + is-fullwidth-code-point@5.1.0: 597 + resolution: {integrity: sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==} 598 + engines: {node: '>=18'} 599 + 600 + is-glob@4.0.3: 601 + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 602 + engines: {node: '>=0.10.0'} 603 + 604 + is-number@7.0.0: 605 + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 606 + engines: {node: '>=0.12.0'} 607 + 608 + isexe@2.0.0: 609 + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} 610 + 611 + jiti@2.6.1: 612 + resolution: {integrity: sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==} 613 + hasBin: true 614 + 615 + js-yaml@4.1.0: 616 + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} 617 + hasBin: true 618 + 619 + jsesc@3.1.0: 620 + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} 621 + engines: {node: '>=6'} 622 + hasBin: true 623 + 624 + json-buffer@3.0.1: 625 + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} 626 + 627 + json-schema-traverse@0.4.1: 628 + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} 629 + 630 + json-stable-stringify-without-jsonify@1.0.1: 631 + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} 632 + 633 + keyv@4.5.4: 634 + resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} 635 + 636 + levn@0.4.1: 637 + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} 638 + engines: {node: '>= 0.8.0'} 639 + 640 + lilconfig@3.1.3: 641 + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} 642 + engines: {node: '>=14'} 643 + 644 + lint-staged@16.1.2: 645 + resolution: {integrity: sha512-sQKw2Si2g9KUZNY3XNvRuDq4UJqpHwF0/FQzZR2M7I5MvtpWvibikCjUVJzZdGE0ByurEl3KQNvsGetd1ty1/Q==} 646 + engines: {node: '>=20.17'} 647 + hasBin: true 648 + 649 + listr2@8.3.3: 650 + resolution: {integrity: sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==} 651 + engines: {node: '>=18.0.0'} 652 + 653 + locate-path@6.0.0: 654 + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} 655 + engines: {node: '>=10'} 656 + 657 + lodash.merge@4.6.2: 658 + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} 659 + 660 + log-update@6.1.0: 661 + resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} 662 + engines: {node: '>=18'} 663 + 664 + merge2@1.4.1: 665 + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} 666 + engines: {node: '>= 8'} 667 + 668 + micromatch@4.0.8: 669 + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} 670 + engines: {node: '>=8.6'} 671 + 672 + mimic-function@5.0.1: 673 + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} 674 + engines: {node: '>=18'} 675 + 676 + minimatch@3.1.2: 677 + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} 678 + 679 + minimatch@9.0.5: 680 + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} 681 + engines: {node: '>=16 || 14 >=14.17'} 682 + 683 + ms@2.1.3: 684 + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} 685 + 686 + nano-spawn@1.0.3: 687 + resolution: {integrity: sha512-jtpsQDetTnvS2Ts1fiRdci5rx0VYws5jGyC+4IYOTnIQ/wwdf6JdomlHBwqC3bJYOvaKu0C2GSZ1A60anrYpaA==} 688 + engines: {node: '>=20.17'} 689 + 690 + natural-compare@1.4.0: 691 + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} 692 + 693 + onetime@7.0.0: 694 + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} 695 + engines: {node: '>=18'} 696 + 697 + optionator@0.9.4: 698 + resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} 699 + engines: {node: '>= 0.8.0'} 700 + 701 + p-limit@3.1.0: 702 + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} 703 + engines: {node: '>=10'} 704 + 705 + p-locate@5.0.0: 706 + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} 707 + engines: {node: '>=10'} 708 + 709 + parent-module@1.0.1: 710 + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} 711 + engines: {node: '>=6'} 712 + 713 + path-exists@4.0.0: 714 + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} 715 + engines: {node: '>=8'} 716 + 717 + path-key@3.1.1: 718 + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} 719 + engines: {node: '>=8'} 720 + 721 + pathe@2.0.3: 722 + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} 723 + 724 + picomatch@2.3.1: 725 + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 726 + engines: {node: '>=8.6'} 727 + 728 + picomatch@4.0.3: 729 + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} 730 + engines: {node: '>=12'} 731 + 732 + pidtree@0.6.0: 733 + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} 734 + engines: {node: '>=0.10'} 735 + hasBin: true 736 + 737 + prelude-ls@1.2.1: 738 + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} 739 + engines: {node: '>= 0.8.0'} 740 + 741 + prettier@3.6.1: 742 + resolution: {integrity: sha512-5xGWRa90Sp2+x1dQtNpIpeOQpTDBs9cZDmA/qs2vDNN2i18PdapqY7CmBeyLlMuGqXJRIOPaCaVZTLNQRWUH/A==} 743 + engines: {node: '>=14'} 744 + hasBin: true 745 + 746 + punycode@2.3.1: 747 + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} 748 + engines: {node: '>=6'} 749 + 750 + quansync@0.2.11: 751 + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} 752 + 753 + queue-microtask@1.2.3: 754 + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 755 + 756 + readdirp@4.1.2: 757 + resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} 758 + engines: {node: '>= 14.18.0'} 759 + 760 + resolve-from@4.0.0: 761 + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} 762 + engines: {node: '>=4'} 763 + 764 + resolve-pkg-maps@1.0.0: 765 + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} 766 + 767 + restore-cursor@5.1.0: 768 + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} 769 + engines: {node: '>=18'} 770 + 771 + reusify@1.1.0: 772 + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} 773 + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} 774 + 775 + rfdc@1.4.1: 776 + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} 777 + 778 + rolldown-plugin-dts@0.13.14: 779 + resolution: {integrity: sha512-wjNhHZz9dlN6PTIXyizB6u/mAg1wEFMW9yw7imEVe3CxHSRnNHVyycIX0yDEOVJfDNISLPbkCIPEpFpizy5+PQ==} 780 + engines: {node: '>=20.18.0'} 781 + peerDependencies: 782 + '@typescript/native-preview': '>=7.0.0-dev.20250601.1' 783 + rolldown: ^1.0.0-beta.9 784 + typescript: ^5.0.0 785 + vue-tsc: ^2.2.0 || ^3.0.0 786 + peerDependenciesMeta: 787 + '@typescript/native-preview': 788 + optional: true 789 + typescript: 790 + optional: true 791 + vue-tsc: 792 + optional: true 793 + 794 + rolldown@1.0.0-beta.11-commit.f051675: 795 + resolution: {integrity: sha512-g8MCVkvg2GnrrG+j+WplOTx1nAmjSwYOMSOQI0qfxf8D4NmYZqJuG3f85yWK64XXQv6pKcXZsfMkOPs9B6B52A==} 796 + hasBin: true 797 + 798 + run-parallel@1.2.0: 799 + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 800 + 801 + semver@7.7.3: 802 + resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} 803 + engines: {node: '>=10'} 804 + hasBin: true 805 + 806 + shebang-command@2.0.0: 807 + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} 808 + engines: {node: '>=8'} 809 + 810 + shebang-regex@3.0.0: 811 + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} 812 + engines: {node: '>=8'} 813 + 814 + signal-exit@4.1.0: 815 + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} 816 + engines: {node: '>=14'} 817 + 818 + slice-ansi@5.0.0: 819 + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} 820 + engines: {node: '>=12'} 821 + 822 + slice-ansi@7.1.2: 823 + resolution: {integrity: sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==} 824 + engines: {node: '>=18'} 825 + 826 + string-argv@0.3.2: 827 + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} 828 + engines: {node: '>=0.6.19'} 829 + 830 + string-width@7.2.0: 831 + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} 832 + engines: {node: '>=18'} 833 + 834 + strip-ansi@7.1.2: 835 + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} 836 + engines: {node: '>=12'} 837 + 838 + strip-json-comments@3.1.1: 839 + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} 840 + engines: {node: '>=8'} 841 + 842 + supports-color@7.2.0: 843 + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 844 + engines: {node: '>=8'} 845 + 846 + tinyexec@1.0.1: 847 + resolution: {integrity: sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==} 848 + 849 + tinyglobby@0.2.15: 850 + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} 851 + engines: {node: '>=12.0.0'} 852 + 853 + to-regex-range@5.0.1: 854 + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 855 + engines: {node: '>=8.0'} 856 + 857 + ts-api-utils@2.1.0: 858 + resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} 859 + engines: {node: '>=18.12'} 860 + peerDependencies: 861 + typescript: '>=4.8.4' 862 + 863 + tsdown@0.12.7: 864 + resolution: {integrity: sha512-VJjVaqJfIQuQwtOoeuEJMOJUf3MPDrfX0X7OUNx3nq5pQeuIl3h58tmdbM1IZcu8Dn2j8NQjLh+5TXa0yPb9zg==} 865 + engines: {node: '>=18.0.0'} 866 + hasBin: true 867 + peerDependencies: 868 + '@arethetypeswrong/core': ^0.18.1 869 + publint: ^0.3.0 870 + typescript: ^5.0.0 871 + unplugin-lightningcss: ^0.4.0 872 + unplugin-unused: ^0.5.0 873 + peerDependenciesMeta: 874 + '@arethetypeswrong/core': 875 + optional: true 876 + publint: 877 + optional: true 878 + typescript: 879 + optional: true 880 + unplugin-lightningcss: 881 + optional: true 882 + unplugin-unused: 883 + optional: true 884 + 885 + tslib@2.8.1: 886 + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} 887 + 888 + type-check@0.4.0: 889 + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} 890 + engines: {node: '>= 0.8.0'} 891 + 892 + typescript-eslint@8.35.0: 893 + resolution: {integrity: sha512-uEnz70b7kBz6eg/j0Czy6K5NivaYopgxRjsnAJ2Fx5oTLo3wefTHIbL7AkQr1+7tJCRVpTs/wiM8JR/11Loq9A==} 894 + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 895 + peerDependencies: 896 + eslint: ^8.57.0 || ^9.0.0 897 + typescript: '>=4.8.4 <5.9.0' 898 + 899 + typescript@5.8.3: 900 + resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} 901 + engines: {node: '>=14.17'} 902 + hasBin: true 903 + 904 + unconfig@7.3.3: 905 + resolution: {integrity: sha512-QCkQoOnJF8L107gxfHL0uavn7WD9b3dpBcFX6HtfQYmjw2YzWxGuFQ0N0J6tE9oguCBJn9KOvfqYDCMPHIZrBA==} 906 + 907 + undici-types@7.8.0: 908 + resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==} 909 + 910 + uri-js@4.4.1: 911 + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} 912 + 913 + which@2.0.2: 914 + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} 915 + engines: {node: '>= 8'} 916 + hasBin: true 917 + 918 + word-wrap@1.2.5: 919 + resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} 920 + engines: {node: '>=0.10.0'} 921 + 922 + wrap-ansi@9.0.2: 923 + resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} 924 + engines: {node: '>=18'} 925 + 926 + yaml@2.8.1: 927 + resolution: {integrity: sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==} 928 + engines: {node: '>= 14.6'} 929 + hasBin: true 930 + 931 + yocto-queue@0.1.0: 932 + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 933 + engines: {node: '>=10'} 934 + 935 + snapshots: 936 + 937 + '@babel/generator@7.28.3': 938 + dependencies: 939 + '@babel/parser': 7.28.4 940 + '@babel/types': 7.28.4 941 + '@jridgewell/gen-mapping': 0.3.13 942 + '@jridgewell/trace-mapping': 0.3.31 943 + jsesc: 3.1.0 944 + 945 + '@babel/helper-string-parser@7.27.1': {} 946 + 947 + '@babel/helper-validator-identifier@7.27.1': {} 948 + 949 + '@babel/parser@7.28.4': 950 + dependencies: 951 + '@babel/types': 7.28.4 952 + 953 + '@babel/types@7.28.4': 954 + dependencies: 955 + '@babel/helper-string-parser': 7.27.1 956 + '@babel/helper-validator-identifier': 7.27.1 957 + 958 + '@emnapi/core@1.5.0': 959 + dependencies: 960 + '@emnapi/wasi-threads': 1.1.0 961 + tslib: 2.8.1 962 + optional: true 963 + 964 + '@emnapi/runtime@1.5.0': 965 + dependencies: 966 + tslib: 2.8.1 967 + optional: true 968 + 969 + '@emnapi/wasi-threads@1.1.0': 970 + dependencies: 971 + tslib: 2.8.1 972 + optional: true 973 + 974 + '@eslint-community/eslint-utils@4.9.0(eslint@9.29.0(jiti@2.6.1))': 975 + dependencies: 976 + eslint: 9.29.0(jiti@2.6.1) 977 + eslint-visitor-keys: 3.4.3 978 + 979 + '@eslint-community/regexpp@4.12.1': {} 980 + 981 + '@eslint/config-array@0.20.1': 982 + dependencies: 983 + '@eslint/object-schema': 2.1.6 984 + debug: 4.4.3 985 + minimatch: 3.1.2 986 + transitivePeerDependencies: 987 + - supports-color 988 + 989 + '@eslint/config-helpers@0.2.3': {} 990 + 991 + '@eslint/core@0.14.0': 992 + dependencies: 993 + '@types/json-schema': 7.0.15 994 + 995 + '@eslint/core@0.15.2': 996 + dependencies: 997 + '@types/json-schema': 7.0.15 998 + 999 + '@eslint/eslintrc@3.3.1': 1000 + dependencies: 1001 + ajv: 6.12.6 1002 + debug: 4.4.3 1003 + espree: 10.4.0 1004 + globals: 14.0.0 1005 + ignore: 5.3.2 1006 + import-fresh: 3.3.1 1007 + js-yaml: 4.1.0 1008 + minimatch: 3.1.2 1009 + strip-json-comments: 3.1.1 1010 + transitivePeerDependencies: 1011 + - supports-color 1012 + 1013 + '@eslint/js@9.29.0': {} 1014 + 1015 + '@eslint/object-schema@2.1.6': {} 1016 + 1017 + '@eslint/plugin-kit@0.3.5': 1018 + dependencies: 1019 + '@eslint/core': 0.15.2 1020 + levn: 0.4.1 1021 + 1022 + '@humanfs/core@0.19.1': {} 1023 + 1024 + '@humanfs/node@0.16.7': 1025 + dependencies: 1026 + '@humanfs/core': 0.19.1 1027 + '@humanwhocodes/retry': 0.4.3 1028 + 1029 + '@humanwhocodes/module-importer@1.0.1': {} 1030 + 1031 + '@humanwhocodes/retry@0.4.3': {} 1032 + 1033 + '@jridgewell/gen-mapping@0.3.13': 1034 + dependencies: 1035 + '@jridgewell/sourcemap-codec': 1.5.5 1036 + '@jridgewell/trace-mapping': 0.3.31 1037 + 1038 + '@jridgewell/resolve-uri@3.1.2': {} 1039 + 1040 + '@jridgewell/sourcemap-codec@1.5.5': {} 1041 + 1042 + '@jridgewell/trace-mapping@0.3.31': 1043 + dependencies: 1044 + '@jridgewell/resolve-uri': 3.1.2 1045 + '@jridgewell/sourcemap-codec': 1.5.5 1046 + 1047 + '@napi-rs/wasm-runtime@0.2.12': 1048 + dependencies: 1049 + '@emnapi/core': 1.5.0 1050 + '@emnapi/runtime': 1.5.0 1051 + '@tybys/wasm-util': 0.10.1 1052 + optional: true 1053 + 1054 + '@nodelib/fs.scandir@2.1.5': 1055 + dependencies: 1056 + '@nodelib/fs.stat': 2.0.5 1057 + run-parallel: 1.2.0 1058 + 1059 + '@nodelib/fs.stat@2.0.5': {} 1060 + 1061 + '@nodelib/fs.walk@1.2.8': 1062 + dependencies: 1063 + '@nodelib/fs.scandir': 2.1.5 1064 + fastq: 1.19.1 1065 + 1066 + '@oxc-project/runtime@0.72.2': {} 1067 + 1068 + '@oxc-project/types@0.72.2': {} 1069 + 1070 + '@quansync/fs@0.1.5': 1071 + dependencies: 1072 + quansync: 0.2.11 1073 + 1074 + '@rolldown/binding-darwin-arm64@1.0.0-beta.11-commit.f051675': 1075 + optional: true 1076 + 1077 + '@rolldown/binding-darwin-x64@1.0.0-beta.11-commit.f051675': 1078 + optional: true 1079 + 1080 + '@rolldown/binding-freebsd-x64@1.0.0-beta.11-commit.f051675': 1081 + optional: true 1082 + 1083 + '@rolldown/binding-linux-arm-gnueabihf@1.0.0-beta.11-commit.f051675': 1084 + optional: true 1085 + 1086 + '@rolldown/binding-linux-arm64-gnu@1.0.0-beta.11-commit.f051675': 1087 + optional: true 1088 + 1089 + '@rolldown/binding-linux-arm64-musl@1.0.0-beta.11-commit.f051675': 1090 + optional: true 1091 + 1092 + '@rolldown/binding-linux-x64-gnu@1.0.0-beta.11-commit.f051675': 1093 + optional: true 1094 + 1095 + '@rolldown/binding-linux-x64-musl@1.0.0-beta.11-commit.f051675': 1096 + optional: true 1097 + 1098 + '@rolldown/binding-wasm32-wasi@1.0.0-beta.11-commit.f051675': 1099 + dependencies: 1100 + '@napi-rs/wasm-runtime': 0.2.12 1101 + optional: true 1102 + 1103 + '@rolldown/binding-win32-arm64-msvc@1.0.0-beta.11-commit.f051675': 1104 + optional: true 1105 + 1106 + '@rolldown/binding-win32-ia32-msvc@1.0.0-beta.11-commit.f051675': 1107 + optional: true 1108 + 1109 + '@rolldown/binding-win32-x64-msvc@1.0.0-beta.11-commit.f051675': 1110 + optional: true 1111 + 1112 + '@rolldown/pluginutils@1.0.0-beta.11-commit.f051675': {} 1113 + 1114 + '@tybys/wasm-util@0.10.1': 1115 + dependencies: 1116 + tslib: 2.8.1 1117 + optional: true 1118 + 1119 + '@types/estree@1.0.8': {} 1120 + 1121 + '@types/json-schema@7.0.15': {} 1122 + 1123 + '@types/node@24.0.4': 1124 + dependencies: 1125 + undici-types: 7.8.0 1126 + 1127 + '@typescript-eslint/eslint-plugin@8.35.0(@typescript-eslint/parser@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3)': 1128 + dependencies: 1129 + '@eslint-community/regexpp': 4.12.1 1130 + '@typescript-eslint/parser': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1131 + '@typescript-eslint/scope-manager': 8.35.0 1132 + '@typescript-eslint/type-utils': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1133 + '@typescript-eslint/utils': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1134 + '@typescript-eslint/visitor-keys': 8.35.0 1135 + eslint: 9.29.0(jiti@2.6.1) 1136 + graphemer: 1.4.0 1137 + ignore: 7.0.5 1138 + natural-compare: 1.4.0 1139 + ts-api-utils: 2.1.0(typescript@5.8.3) 1140 + typescript: 5.8.3 1141 + transitivePeerDependencies: 1142 + - supports-color 1143 + 1144 + '@typescript-eslint/parser@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3)': 1145 + dependencies: 1146 + '@typescript-eslint/scope-manager': 8.35.0 1147 + '@typescript-eslint/types': 8.35.0 1148 + '@typescript-eslint/typescript-estree': 8.35.0(typescript@5.8.3) 1149 + '@typescript-eslint/visitor-keys': 8.35.0 1150 + debug: 4.4.3 1151 + eslint: 9.29.0(jiti@2.6.1) 1152 + typescript: 5.8.3 1153 + transitivePeerDependencies: 1154 + - supports-color 1155 + 1156 + '@typescript-eslint/project-service@8.35.0(typescript@5.8.3)': 1157 + dependencies: 1158 + '@typescript-eslint/tsconfig-utils': 8.35.0(typescript@5.8.3) 1159 + '@typescript-eslint/types': 8.35.0 1160 + debug: 4.4.3 1161 + typescript: 5.8.3 1162 + transitivePeerDependencies: 1163 + - supports-color 1164 + 1165 + '@typescript-eslint/scope-manager@8.35.0': 1166 + dependencies: 1167 + '@typescript-eslint/types': 8.35.0 1168 + '@typescript-eslint/visitor-keys': 8.35.0 1169 + 1170 + '@typescript-eslint/tsconfig-utils@8.35.0(typescript@5.8.3)': 1171 + dependencies: 1172 + typescript: 5.8.3 1173 + 1174 + '@typescript-eslint/type-utils@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3)': 1175 + dependencies: 1176 + '@typescript-eslint/typescript-estree': 8.35.0(typescript@5.8.3) 1177 + '@typescript-eslint/utils': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1178 + debug: 4.4.3 1179 + eslint: 9.29.0(jiti@2.6.1) 1180 + ts-api-utils: 2.1.0(typescript@5.8.3) 1181 + typescript: 5.8.3 1182 + transitivePeerDependencies: 1183 + - supports-color 1184 + 1185 + '@typescript-eslint/types@8.35.0': {} 1186 + 1187 + '@typescript-eslint/typescript-estree@8.35.0(typescript@5.8.3)': 1188 + dependencies: 1189 + '@typescript-eslint/project-service': 8.35.0(typescript@5.8.3) 1190 + '@typescript-eslint/tsconfig-utils': 8.35.0(typescript@5.8.3) 1191 + '@typescript-eslint/types': 8.35.0 1192 + '@typescript-eslint/visitor-keys': 8.35.0 1193 + debug: 4.4.3 1194 + fast-glob: 3.3.3 1195 + is-glob: 4.0.3 1196 + minimatch: 9.0.5 1197 + semver: 7.7.3 1198 + ts-api-utils: 2.1.0(typescript@5.8.3) 1199 + typescript: 5.8.3 1200 + transitivePeerDependencies: 1201 + - supports-color 1202 + 1203 + '@typescript-eslint/utils@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3)': 1204 + dependencies: 1205 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.29.0(jiti@2.6.1)) 1206 + '@typescript-eslint/scope-manager': 8.35.0 1207 + '@typescript-eslint/types': 8.35.0 1208 + '@typescript-eslint/typescript-estree': 8.35.0(typescript@5.8.3) 1209 + eslint: 9.29.0(jiti@2.6.1) 1210 + typescript: 5.8.3 1211 + transitivePeerDependencies: 1212 + - supports-color 1213 + 1214 + '@typescript-eslint/visitor-keys@8.35.0': 1215 + dependencies: 1216 + '@typescript-eslint/types': 8.35.0 1217 + eslint-visitor-keys: 4.2.1 1218 + 1219 + acorn-jsx@5.3.2(acorn@8.15.0): 1220 + dependencies: 1221 + acorn: 8.15.0 1222 + 1223 + acorn@8.15.0: {} 1224 + 1225 + ajv@6.12.6: 1226 + dependencies: 1227 + fast-deep-equal: 3.1.3 1228 + fast-json-stable-stringify: 2.1.0 1229 + json-schema-traverse: 0.4.1 1230 + uri-js: 4.4.1 1231 + 1232 + ansi-escapes@7.1.1: 1233 + dependencies: 1234 + environment: 1.1.0 1235 + 1236 + ansi-regex@6.2.2: {} 1237 + 1238 + ansi-styles@4.3.0: 1239 + dependencies: 1240 + color-convert: 2.0.1 1241 + 1242 + ansi-styles@6.2.3: {} 1243 + 1244 + ansis@4.2.0: {} 1245 + 1246 + argparse@2.0.1: {} 1247 + 1248 + ast-kit@2.1.3: 1249 + dependencies: 1250 + '@babel/parser': 7.28.4 1251 + pathe: 2.0.3 1252 + 1253 + balanced-match@1.0.2: {} 1254 + 1255 + birpc@2.6.1: {} 1256 + 1257 + brace-expansion@1.1.12: 1258 + dependencies: 1259 + balanced-match: 1.0.2 1260 + concat-map: 0.0.1 1261 + 1262 + brace-expansion@2.0.2: 1263 + dependencies: 1264 + balanced-match: 1.0.2 1265 + 1266 + braces@3.0.3: 1267 + dependencies: 1268 + fill-range: 7.1.1 1269 + 1270 + cac@6.7.14: {} 1271 + 1272 + callsites@3.1.0: {} 1273 + 1274 + chalk@4.1.2: 1275 + dependencies: 1276 + ansi-styles: 4.3.0 1277 + supports-color: 7.2.0 1278 + 1279 + chalk@5.6.2: {} 1280 + 1281 + chokidar@4.0.3: 1282 + dependencies: 1283 + readdirp: 4.1.2 1284 + 1285 + cli-cursor@5.0.0: 1286 + dependencies: 1287 + restore-cursor: 5.1.0 1288 + 1289 + cli-truncate@4.0.0: 1290 + dependencies: 1291 + slice-ansi: 5.0.0 1292 + string-width: 7.2.0 1293 + 1294 + color-convert@2.0.1: 1295 + dependencies: 1296 + color-name: 1.1.4 1297 + 1298 + color-name@1.1.4: {} 1299 + 1300 + colorette@2.0.20: {} 1301 + 1302 + commander@14.0.1: {} 1303 + 1304 + concat-map@0.0.1: {} 1305 + 1306 + cross-spawn@7.0.6: 1307 + dependencies: 1308 + path-key: 3.1.1 1309 + shebang-command: 2.0.0 1310 + which: 2.0.2 1311 + 1312 + debug@4.4.3: 1313 + dependencies: 1314 + ms: 2.1.3 1315 + 1316 + deep-is@0.1.4: {} 1317 + 1318 + defu@6.1.4: {} 1319 + 1320 + diff@8.0.2: {} 1321 + 1322 + dts-resolver@2.1.2: {} 1323 + 1324 + emoji-regex@10.5.0: {} 1325 + 1326 + empathic@1.1.0: {} 1327 + 1328 + environment@1.1.0: {} 1329 + 1330 + escape-string-regexp@4.0.0: {} 1331 + 1332 + eslint-scope@8.4.0: 1333 + dependencies: 1334 + esrecurse: 4.3.0 1335 + estraverse: 5.3.0 1336 + 1337 + eslint-visitor-keys@3.4.3: {} 1338 + 1339 + eslint-visitor-keys@4.2.1: {} 1340 + 1341 + eslint@9.29.0(jiti@2.6.1): 1342 + dependencies: 1343 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.29.0(jiti@2.6.1)) 1344 + '@eslint-community/regexpp': 4.12.1 1345 + '@eslint/config-array': 0.20.1 1346 + '@eslint/config-helpers': 0.2.3 1347 + '@eslint/core': 0.14.0 1348 + '@eslint/eslintrc': 3.3.1 1349 + '@eslint/js': 9.29.0 1350 + '@eslint/plugin-kit': 0.3.5 1351 + '@humanfs/node': 0.16.7 1352 + '@humanwhocodes/module-importer': 1.0.1 1353 + '@humanwhocodes/retry': 0.4.3 1354 + '@types/estree': 1.0.8 1355 + '@types/json-schema': 7.0.15 1356 + ajv: 6.12.6 1357 + chalk: 4.1.2 1358 + cross-spawn: 7.0.6 1359 + debug: 4.4.3 1360 + escape-string-regexp: 4.0.0 1361 + eslint-scope: 8.4.0 1362 + eslint-visitor-keys: 4.2.1 1363 + espree: 10.4.0 1364 + esquery: 1.6.0 1365 + esutils: 2.0.3 1366 + fast-deep-equal: 3.1.3 1367 + file-entry-cache: 8.0.0 1368 + find-up: 5.0.0 1369 + glob-parent: 6.0.2 1370 + ignore: 5.3.2 1371 + imurmurhash: 0.1.4 1372 + is-glob: 4.0.3 1373 + json-stable-stringify-without-jsonify: 1.0.1 1374 + lodash.merge: 4.6.2 1375 + minimatch: 3.1.2 1376 + natural-compare: 1.4.0 1377 + optionator: 0.9.4 1378 + optionalDependencies: 1379 + jiti: 2.6.1 1380 + transitivePeerDependencies: 1381 + - supports-color 1382 + 1383 + espree@10.4.0: 1384 + dependencies: 1385 + acorn: 8.15.0 1386 + acorn-jsx: 5.3.2(acorn@8.15.0) 1387 + eslint-visitor-keys: 4.2.1 1388 + 1389 + esquery@1.6.0: 1390 + dependencies: 1391 + estraverse: 5.3.0 1392 + 1393 + esrecurse@4.3.0: 1394 + dependencies: 1395 + estraverse: 5.3.0 1396 + 1397 + estraverse@5.3.0: {} 1398 + 1399 + esutils@2.0.3: {} 1400 + 1401 + eventemitter3@5.0.1: {} 1402 + 1403 + fast-deep-equal@3.1.3: {} 1404 + 1405 + fast-glob@3.3.3: 1406 + dependencies: 1407 + '@nodelib/fs.stat': 2.0.5 1408 + '@nodelib/fs.walk': 1.2.8 1409 + glob-parent: 5.1.2 1410 + merge2: 1.4.1 1411 + micromatch: 4.0.8 1412 + 1413 + fast-json-stable-stringify@2.1.0: {} 1414 + 1415 + fast-levenshtein@2.0.6: {} 1416 + 1417 + fastq@1.19.1: 1418 + dependencies: 1419 + reusify: 1.1.0 1420 + 1421 + fdir@6.5.0(picomatch@4.0.3): 1422 + optionalDependencies: 1423 + picomatch: 4.0.3 1424 + 1425 + file-entry-cache@8.0.0: 1426 + dependencies: 1427 + flat-cache: 4.0.1 1428 + 1429 + fill-range@7.1.1: 1430 + dependencies: 1431 + to-regex-range: 5.0.1 1432 + 1433 + find-up@5.0.0: 1434 + dependencies: 1435 + locate-path: 6.0.0 1436 + path-exists: 4.0.0 1437 + 1438 + flat-cache@4.0.1: 1439 + dependencies: 1440 + flatted: 3.3.3 1441 + keyv: 4.5.4 1442 + 1443 + flatted@3.3.3: {} 1444 + 1445 + get-east-asian-width@1.4.0: {} 1446 + 1447 + get-tsconfig@4.12.0: 1448 + dependencies: 1449 + resolve-pkg-maps: 1.0.0 1450 + 1451 + glob-parent@5.1.2: 1452 + dependencies: 1453 + is-glob: 4.0.3 1454 + 1455 + glob-parent@6.0.2: 1456 + dependencies: 1457 + is-glob: 4.0.3 1458 + 1459 + globals@14.0.0: {} 1460 + 1461 + graphemer@1.4.0: {} 1462 + 1463 + has-flag@4.0.0: {} 1464 + 1465 + hookable@5.5.3: {} 1466 + 1467 + husky@9.1.7: {} 1468 + 1469 + ignore@5.3.2: {} 1470 + 1471 + ignore@7.0.5: {} 1472 + 1473 + import-fresh@3.3.1: 1474 + dependencies: 1475 + parent-module: 1.0.1 1476 + resolve-from: 4.0.0 1477 + 1478 + imurmurhash@0.1.4: {} 1479 + 1480 + is-extglob@2.1.1: {} 1481 + 1482 + is-fullwidth-code-point@4.0.0: {} 1483 + 1484 + is-fullwidth-code-point@5.1.0: 1485 + dependencies: 1486 + get-east-asian-width: 1.4.0 1487 + 1488 + is-glob@4.0.3: 1489 + dependencies: 1490 + is-extglob: 2.1.1 1491 + 1492 + is-number@7.0.0: {} 1493 + 1494 + isexe@2.0.0: {} 1495 + 1496 + jiti@2.6.1: {} 1497 + 1498 + js-yaml@4.1.0: 1499 + dependencies: 1500 + argparse: 2.0.1 1501 + 1502 + jsesc@3.1.0: {} 1503 + 1504 + json-buffer@3.0.1: {} 1505 + 1506 + json-schema-traverse@0.4.1: {} 1507 + 1508 + json-stable-stringify-without-jsonify@1.0.1: {} 1509 + 1510 + keyv@4.5.4: 1511 + dependencies: 1512 + json-buffer: 3.0.1 1513 + 1514 + levn@0.4.1: 1515 + dependencies: 1516 + prelude-ls: 1.2.1 1517 + type-check: 0.4.0 1518 + 1519 + lilconfig@3.1.3: {} 1520 + 1521 + lint-staged@16.1.2: 1522 + dependencies: 1523 + chalk: 5.6.2 1524 + commander: 14.0.1 1525 + debug: 4.4.3 1526 + lilconfig: 3.1.3 1527 + listr2: 8.3.3 1528 + micromatch: 4.0.8 1529 + nano-spawn: 1.0.3 1530 + pidtree: 0.6.0 1531 + string-argv: 0.3.2 1532 + yaml: 2.8.1 1533 + transitivePeerDependencies: 1534 + - supports-color 1535 + 1536 + listr2@8.3.3: 1537 + dependencies: 1538 + cli-truncate: 4.0.0 1539 + colorette: 2.0.20 1540 + eventemitter3: 5.0.1 1541 + log-update: 6.1.0 1542 + rfdc: 1.4.1 1543 + wrap-ansi: 9.0.2 1544 + 1545 + locate-path@6.0.0: 1546 + dependencies: 1547 + p-locate: 5.0.0 1548 + 1549 + lodash.merge@4.6.2: {} 1550 + 1551 + log-update@6.1.0: 1552 + dependencies: 1553 + ansi-escapes: 7.1.1 1554 + cli-cursor: 5.0.0 1555 + slice-ansi: 7.1.2 1556 + strip-ansi: 7.1.2 1557 + wrap-ansi: 9.0.2 1558 + 1559 + merge2@1.4.1: {} 1560 + 1561 + micromatch@4.0.8: 1562 + dependencies: 1563 + braces: 3.0.3 1564 + picomatch: 2.3.1 1565 + 1566 + mimic-function@5.0.1: {} 1567 + 1568 + minimatch@3.1.2: 1569 + dependencies: 1570 + brace-expansion: 1.1.12 1571 + 1572 + minimatch@9.0.5: 1573 + dependencies: 1574 + brace-expansion: 2.0.2 1575 + 1576 + ms@2.1.3: {} 1577 + 1578 + nano-spawn@1.0.3: {} 1579 + 1580 + natural-compare@1.4.0: {} 1581 + 1582 + onetime@7.0.0: 1583 + dependencies: 1584 + mimic-function: 5.0.1 1585 + 1586 + optionator@0.9.4: 1587 + dependencies: 1588 + deep-is: 0.1.4 1589 + fast-levenshtein: 2.0.6 1590 + levn: 0.4.1 1591 + prelude-ls: 1.2.1 1592 + type-check: 0.4.0 1593 + word-wrap: 1.2.5 1594 + 1595 + p-limit@3.1.0: 1596 + dependencies: 1597 + yocto-queue: 0.1.0 1598 + 1599 + p-locate@5.0.0: 1600 + dependencies: 1601 + p-limit: 3.1.0 1602 + 1603 + parent-module@1.0.1: 1604 + dependencies: 1605 + callsites: 3.1.0 1606 + 1607 + path-exists@4.0.0: {} 1608 + 1609 + path-key@3.1.1: {} 1610 + 1611 + pathe@2.0.3: {} 1612 + 1613 + picomatch@2.3.1: {} 1614 + 1615 + picomatch@4.0.3: {} 1616 + 1617 + pidtree@0.6.0: {} 1618 + 1619 + prelude-ls@1.2.1: {} 1620 + 1621 + prettier@3.6.1: {} 1622 + 1623 + punycode@2.3.1: {} 1624 + 1625 + quansync@0.2.11: {} 1626 + 1627 + queue-microtask@1.2.3: {} 1628 + 1629 + readdirp@4.1.2: {} 1630 + 1631 + resolve-from@4.0.0: {} 1632 + 1633 + resolve-pkg-maps@1.0.0: {} 1634 + 1635 + restore-cursor@5.1.0: 1636 + dependencies: 1637 + onetime: 7.0.0 1638 + signal-exit: 4.1.0 1639 + 1640 + reusify@1.1.0: {} 1641 + 1642 + rfdc@1.4.1: {} 1643 + 1644 + rolldown-plugin-dts@0.13.14(rolldown@1.0.0-beta.11-commit.f051675)(typescript@5.8.3): 1645 + dependencies: 1646 + '@babel/generator': 7.28.3 1647 + '@babel/parser': 7.28.4 1648 + '@babel/types': 7.28.4 1649 + ast-kit: 2.1.3 1650 + birpc: 2.6.1 1651 + debug: 4.4.3 1652 + dts-resolver: 2.1.2 1653 + get-tsconfig: 4.12.0 1654 + rolldown: 1.0.0-beta.11-commit.f051675 1655 + optionalDependencies: 1656 + typescript: 5.8.3 1657 + transitivePeerDependencies: 1658 + - oxc-resolver 1659 + - supports-color 1660 + 1661 + rolldown@1.0.0-beta.11-commit.f051675: 1662 + dependencies: 1663 + '@oxc-project/runtime': 0.72.2 1664 + '@oxc-project/types': 0.72.2 1665 + '@rolldown/pluginutils': 1.0.0-beta.11-commit.f051675 1666 + ansis: 4.2.0 1667 + optionalDependencies: 1668 + '@rolldown/binding-darwin-arm64': 1.0.0-beta.11-commit.f051675 1669 + '@rolldown/binding-darwin-x64': 1.0.0-beta.11-commit.f051675 1670 + '@rolldown/binding-freebsd-x64': 1.0.0-beta.11-commit.f051675 1671 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0-beta.11-commit.f051675 1672 + '@rolldown/binding-linux-arm64-gnu': 1.0.0-beta.11-commit.f051675 1673 + '@rolldown/binding-linux-arm64-musl': 1.0.0-beta.11-commit.f051675 1674 + '@rolldown/binding-linux-x64-gnu': 1.0.0-beta.11-commit.f051675 1675 + '@rolldown/binding-linux-x64-musl': 1.0.0-beta.11-commit.f051675 1676 + '@rolldown/binding-wasm32-wasi': 1.0.0-beta.11-commit.f051675 1677 + '@rolldown/binding-win32-arm64-msvc': 1.0.0-beta.11-commit.f051675 1678 + '@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.11-commit.f051675 1679 + '@rolldown/binding-win32-x64-msvc': 1.0.0-beta.11-commit.f051675 1680 + 1681 + run-parallel@1.2.0: 1682 + dependencies: 1683 + queue-microtask: 1.2.3 1684 + 1685 + semver@7.7.3: {} 1686 + 1687 + shebang-command@2.0.0: 1688 + dependencies: 1689 + shebang-regex: 3.0.0 1690 + 1691 + shebang-regex@3.0.0: {} 1692 + 1693 + signal-exit@4.1.0: {} 1694 + 1695 + slice-ansi@5.0.0: 1696 + dependencies: 1697 + ansi-styles: 6.2.3 1698 + is-fullwidth-code-point: 4.0.0 1699 + 1700 + slice-ansi@7.1.2: 1701 + dependencies: 1702 + ansi-styles: 6.2.3 1703 + is-fullwidth-code-point: 5.1.0 1704 + 1705 + string-argv@0.3.2: {} 1706 + 1707 + string-width@7.2.0: 1708 + dependencies: 1709 + emoji-regex: 10.5.0 1710 + get-east-asian-width: 1.4.0 1711 + strip-ansi: 7.1.2 1712 + 1713 + strip-ansi@7.1.2: 1714 + dependencies: 1715 + ansi-regex: 6.2.2 1716 + 1717 + strip-json-comments@3.1.1: {} 1718 + 1719 + supports-color@7.2.0: 1720 + dependencies: 1721 + has-flag: 4.0.0 1722 + 1723 + tinyexec@1.0.1: {} 1724 + 1725 + tinyglobby@0.2.15: 1726 + dependencies: 1727 + fdir: 6.5.0(picomatch@4.0.3) 1728 + picomatch: 4.0.3 1729 + 1730 + to-regex-range@5.0.1: 1731 + dependencies: 1732 + is-number: 7.0.0 1733 + 1734 + ts-api-utils@2.1.0(typescript@5.8.3): 1735 + dependencies: 1736 + typescript: 5.8.3 1737 + 1738 + tsdown@0.12.7(typescript@5.8.3): 1739 + dependencies: 1740 + ansis: 4.2.0 1741 + cac: 6.7.14 1742 + chokidar: 4.0.3 1743 + debug: 4.4.3 1744 + diff: 8.0.2 1745 + empathic: 1.1.0 1746 + hookable: 5.5.3 1747 + rolldown: 1.0.0-beta.11-commit.f051675 1748 + rolldown-plugin-dts: 0.13.14(rolldown@1.0.0-beta.11-commit.f051675)(typescript@5.8.3) 1749 + semver: 7.7.3 1750 + tinyexec: 1.0.1 1751 + tinyglobby: 0.2.15 1752 + unconfig: 7.3.3 1753 + optionalDependencies: 1754 + typescript: 5.8.3 1755 + transitivePeerDependencies: 1756 + - '@typescript/native-preview' 1757 + - oxc-resolver 1758 + - supports-color 1759 + - vue-tsc 1760 + 1761 + tslib@2.8.1: 1762 + optional: true 1763 + 1764 + type-check@0.4.0: 1765 + dependencies: 1766 + prelude-ls: 1.2.1 1767 + 1768 + typescript-eslint@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3): 1769 + dependencies: 1770 + '@typescript-eslint/eslint-plugin': 8.35.0(@typescript-eslint/parser@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3))(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1771 + '@typescript-eslint/parser': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1772 + '@typescript-eslint/utils': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@5.8.3) 1773 + eslint: 9.29.0(jiti@2.6.1) 1774 + typescript: 5.8.3 1775 + transitivePeerDependencies: 1776 + - supports-color 1777 + 1778 + typescript@5.8.3: {} 1779 + 1780 + unconfig@7.3.3: 1781 + dependencies: 1782 + '@quansync/fs': 0.1.5 1783 + defu: 6.1.4 1784 + jiti: 2.6.1 1785 + quansync: 0.2.11 1786 + 1787 + undici-types@7.8.0: {} 1788 + 1789 + uri-js@4.4.1: 1790 + dependencies: 1791 + punycode: 2.3.1 1792 + 1793 + which@2.0.2: 1794 + dependencies: 1795 + isexe: 2.0.0 1796 + 1797 + word-wrap@1.2.5: {} 1798 + 1799 + wrap-ansi@9.0.2: 1800 + dependencies: 1801 + ansi-styles: 6.2.3 1802 + string-width: 7.2.0 1803 + strip-ansi: 7.1.2 1804 + 1805 + yaml@2.8.1: {} 1806 + 1807 + yocto-queue@0.1.0: {}
+98 -101
samples/actor-namespace.json
··· 1 1 { 2 - "lexicon": 1, 3 - "id": "app.bsky.actor.defs", 4 - "defs": { 5 - "profileViewBasic": { 6 - "type": "object", 7 - "properties": { 8 - "did": { 9 - "type": "string", 10 - "required": true, 11 - "format": "did" 12 - }, 13 - "handle": { 14 - "type": "string", 15 - "required": true, 16 - "format": "handle" 17 - }, 18 - "displayName": { 19 - "type": "string", 20 - "maxGraphemes": 64, 21 - "maxLength": 640 22 - }, 23 - "pronouns": { 24 - "type": "string" 25 - }, 26 - "avatar": { 27 - "type": "string", 28 - "format": "uri" 29 - }, 30 - "associated": { 31 - "type": "ref", 32 - "ref": "#profileAssociated" 33 - }, 34 - "viewer": { 35 - "type": "ref", 36 - "ref": "#viewerState" 37 - }, 38 - "labels": { 39 - "type": "array", 40 - "items": { 41 - "type": "ref", 42 - "ref": "com.atproto.label.defs#label" 43 - } 44 - }, 45 - "createdAt": { 46 - "type": "string", 47 - "format": "datetime" 48 - }, 49 - "verification": { 50 - "type": "ref", 51 - "ref": "#verificationState" 52 - }, 53 - "status": { 54 - "type": "ref", 55 - "ref": "#statusView" 56 - } 57 - }, 58 - "required": [ 59 - "did", 60 - "handle" 61 - ] 62 - }, 63 - "viewerState": { 64 - "type": "object", 65 - "properties": { 66 - "muted": { 67 - "type": "boolean" 68 - }, 69 - "mutedByList": { 70 - "type": "ref", 71 - "ref": "app.bsky.graph.defs#listViewBasic" 72 - }, 73 - "blockedBy": { 74 - "type": "boolean" 75 - }, 76 - "blocking": { 77 - "type": "string", 78 - "format": "at-uri" 79 - }, 80 - "blockingByList": { 81 - "type": "ref", 82 - "ref": "app.bsky.graph.defs#listViewBasic" 83 - }, 84 - "following": { 85 - "type": "string", 86 - "format": "at-uri" 87 - }, 88 - "followedBy": { 89 - "type": "string", 90 - "format": "at-uri" 91 - }, 92 - "knownFollowers": { 93 - "type": "ref", 94 - "ref": "#knownFollowers" 95 - }, 96 - "activitySubscription": { 97 - "type": "ref", 98 - "ref": "app.bsky.notification.defs#activitySubscription" 99 - } 100 - } 101 - } 102 - } 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.defs", 4 + "defs": { 5 + "profileViewBasic": { 6 + "type": "object", 7 + "properties": { 8 + "did": { 9 + "type": "string", 10 + "required": true, 11 + "format": "did" 12 + }, 13 + "handle": { 14 + "type": "string", 15 + "required": true, 16 + "format": "handle" 17 + }, 18 + "displayName": { 19 + "type": "string", 20 + "maxGraphemes": 64, 21 + "maxLength": 640 22 + }, 23 + "pronouns": { 24 + "type": "string" 25 + }, 26 + "avatar": { 27 + "type": "string", 28 + "format": "uri" 29 + }, 30 + "associated": { 31 + "type": "ref", 32 + "ref": "#profileAssociated" 33 + }, 34 + "viewer": { 35 + "type": "ref", 36 + "ref": "#viewerState" 37 + }, 38 + "labels": { 39 + "type": "array", 40 + "items": { 41 + "type": "ref", 42 + "ref": "com.atproto.label.defs#label" 43 + } 44 + }, 45 + "createdAt": { 46 + "type": "string", 47 + "format": "datetime" 48 + }, 49 + "verification": { 50 + "type": "ref", 51 + "ref": "#verificationState" 52 + }, 53 + "status": { 54 + "type": "ref", 55 + "ref": "#statusView" 56 + } 57 + }, 58 + "required": ["did", "handle"] 59 + }, 60 + "viewerState": { 61 + "type": "object", 62 + "properties": { 63 + "muted": { 64 + "type": "boolean" 65 + }, 66 + "mutedByList": { 67 + "type": "ref", 68 + "ref": "app.bsky.graph.defs#listViewBasic" 69 + }, 70 + "blockedBy": { 71 + "type": "boolean" 72 + }, 73 + "blocking": { 74 + "type": "string", 75 + "format": "at-uri" 76 + }, 77 + "blockingByList": { 78 + "type": "ref", 79 + "ref": "app.bsky.graph.defs#listViewBasic" 80 + }, 81 + "following": { 82 + "type": "string", 83 + "format": "at-uri" 84 + }, 85 + "followedBy": { 86 + "type": "string", 87 + "format": "at-uri" 88 + }, 89 + "knownFollowers": { 90 + "type": "ref", 91 + "ref": "#knownFollowers" 92 + }, 93 + "activitySubscription": { 94 + "type": "ref", 95 + "ref": "app.bsky.notification.defs#activitySubscription" 96 + } 97 + } 98 + } 99 + } 103 100 }
+25
samples/demo.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "key": "self", 8 + "record": { 9 + "type": "object", 10 + "properties": { 11 + "displayName": { 12 + "type": "string", 13 + "maxLength": 64, 14 + "maxGraphemes": 64 15 + }, 16 + "description": { 17 + "type": "string", 18 + "maxLength": 256, 19 + "maxGraphemes": 256 20 + } 21 + } 22 + } 23 + } 24 + } 25 + }
+74 -81
samples/generator-view.json
··· 1 1 { 2 - "type": "object", 3 - "properties": { 4 - "uri": { 5 - "type": "string", 6 - "required": true, 7 - "format": "at-uri" 8 - }, 9 - "cid": { 10 - "type": "string", 11 - "required": true, 12 - "format": "cid" 13 - }, 14 - "did": { 15 - "type": "string", 16 - "required": true, 17 - "format": "did" 18 - }, 19 - "creator": { 20 - "type": "ref", 21 - "ref": "app.bsky.actor.defs#profileView", 22 - "required": true 23 - }, 24 - "displayName": { 25 - "type": "string", 26 - "required": true 27 - }, 28 - "description": { 29 - "type": "string", 30 - "maxGraphemes": 300, 31 - "maxLength": 3000 32 - }, 33 - "descriptionFacets": { 34 - "type": "array", 35 - "items": { 36 - "type": "ref", 37 - "ref": "app.bsky.richtext.facet" 38 - } 39 - }, 40 - "avatar": { 41 - "type": "string", 42 - "format": "uri" 43 - }, 44 - "likeCount": { 45 - "type": "integer", 46 - "minimum": 0 47 - }, 48 - "acceptsInteractions": { 49 - "type": "boolean" 50 - }, 51 - "labels": { 52 - "type": "array", 53 - "items": { 54 - "type": "ref", 55 - "ref": "com.atproto.label.defs#label" 56 - } 57 - }, 58 - "viewer": { 59 - "type": "ref", 60 - "ref": "#generatorViewerState" 61 - }, 62 - "contentMode": { 63 - "type": "string", 64 - "knownValues": [ 65 - "app.bsky.feed.defs#contentModeUnspecified", 66 - "app.bsky.feed.defs#contentModeVideo" 67 - ] 68 - }, 69 - "indexedAt": { 70 - "type": "string", 71 - "required": true, 72 - "format": "datetime" 73 - } 74 - }, 75 - "required": [ 76 - "uri", 77 - "cid", 78 - "did", 79 - "creator", 80 - "displayName", 81 - "indexedAt" 82 - ] 2 + "type": "object", 3 + "properties": { 4 + "uri": { 5 + "type": "string", 6 + "required": true, 7 + "format": "at-uri" 8 + }, 9 + "cid": { 10 + "type": "string", 11 + "required": true, 12 + "format": "cid" 13 + }, 14 + "did": { 15 + "type": "string", 16 + "required": true, 17 + "format": "did" 18 + }, 19 + "creator": { 20 + "type": "ref", 21 + "ref": "app.bsky.actor.defs#profileView", 22 + "required": true 23 + }, 24 + "displayName": { 25 + "type": "string", 26 + "required": true 27 + }, 28 + "description": { 29 + "type": "string", 30 + "maxGraphemes": 300, 31 + "maxLength": 3000 32 + }, 33 + "descriptionFacets": { 34 + "type": "array", 35 + "items": { 36 + "type": "ref", 37 + "ref": "app.bsky.richtext.facet" 38 + } 39 + }, 40 + "avatar": { 41 + "type": "string", 42 + "format": "uri" 43 + }, 44 + "likeCount": { 45 + "type": "integer", 46 + "minimum": 0 47 + }, 48 + "acceptsInteractions": { 49 + "type": "boolean" 50 + }, 51 + "labels": { 52 + "type": "array", 53 + "items": { 54 + "type": "ref", 55 + "ref": "com.atproto.label.defs#label" 56 + } 57 + }, 58 + "viewer": { 59 + "type": "ref", 60 + "ref": "#generatorViewerState" 61 + }, 62 + "contentMode": { 63 + "type": "string", 64 + "knownValues": [ 65 + "app.bsky.feed.defs#contentModeUnspecified", 66 + "app.bsky.feed.defs#contentModeVideo" 67 + ] 68 + }, 69 + "indexedAt": { 70 + "type": "string", 71 + "required": true, 72 + "format": "datetime" 73 + } 74 + }, 75 + "required": ["uri", "cid", "did", "creator", "displayName", "indexedAt"] 83 76 }
+68 -74
samples/post-view.json
··· 1 1 { 2 - "type": "object", 3 - "properties": { 4 - "uri": { 5 - "type": "string", 6 - "required": true, 7 - "format": "at-uri" 8 - }, 9 - "cid": { 10 - "type": "string", 11 - "required": true, 12 - "format": "cid" 13 - }, 14 - "author": { 15 - "type": "ref", 16 - "ref": "app.bsky.actor.defs#profileViewBasic", 17 - "required": true 18 - }, 19 - "record": { 20 - "type": "unknown", 21 - "required": true 22 - }, 23 - "embed": { 24 - "type": "union", 25 - "refs": [ 26 - "app.bsky.embed.images#view", 27 - "app.bsky.embed.video#view", 28 - "app.bsky.embed.external#view", 29 - "app.bsky.embed.record#view", 30 - "app.bsky.embed.recordWithMedia#view" 31 - ] 32 - }, 33 - "bookmarkCount": { 34 - "type": "integer" 35 - }, 36 - "replyCount": { 37 - "type": "integer" 38 - }, 39 - "repostCount": { 40 - "type": "integer" 41 - }, 42 - "likeCount": { 43 - "type": "integer" 44 - }, 45 - "quoteCount": { 46 - "type": "integer" 47 - }, 48 - "indexedAt": { 49 - "type": "string", 50 - "required": true, 51 - "format": "datetime" 52 - }, 53 - "viewer": { 54 - "type": "ref", 55 - "ref": "#viewerState" 56 - }, 57 - "labels": { 58 - "type": "array", 59 - "items": { 60 - "type": "ref", 61 - "ref": "com.atproto.label.defs#label" 62 - } 63 - }, 64 - "threadgate": { 65 - "type": "ref", 66 - "ref": "#threadgateView" 67 - } 68 - }, 69 - "required": [ 70 - "uri", 71 - "cid", 72 - "author", 73 - "record", 74 - "indexedAt" 75 - ] 2 + "type": "object", 3 + "properties": { 4 + "uri": { 5 + "type": "string", 6 + "required": true, 7 + "format": "at-uri" 8 + }, 9 + "cid": { 10 + "type": "string", 11 + "required": true, 12 + "format": "cid" 13 + }, 14 + "author": { 15 + "type": "ref", 16 + "ref": "app.bsky.actor.defs#profileViewBasic", 17 + "required": true 18 + }, 19 + "record": { 20 + "type": "unknown", 21 + "required": true 22 + }, 23 + "embed": { 24 + "type": "union", 25 + "refs": [ 26 + "app.bsky.embed.images#view", 27 + "app.bsky.embed.video#view", 28 + "app.bsky.embed.external#view", 29 + "app.bsky.embed.record#view", 30 + "app.bsky.embed.recordWithMedia#view" 31 + ] 32 + }, 33 + "bookmarkCount": { 34 + "type": "integer" 35 + }, 36 + "replyCount": { 37 + "type": "integer" 38 + }, 39 + "repostCount": { 40 + "type": "integer" 41 + }, 42 + "likeCount": { 43 + "type": "integer" 44 + }, 45 + "quoteCount": { 46 + "type": "integer" 47 + }, 48 + "indexedAt": { 49 + "type": "string", 50 + "required": true, 51 + "format": "datetime" 52 + }, 53 + "viewer": { 54 + "type": "ref", 55 + "ref": "#viewerState" 56 + }, 57 + "labels": { 58 + "type": "array", 59 + "items": { 60 + "type": "ref", 61 + "ref": "com.atproto.label.defs#label" 62 + } 63 + }, 64 + "threadgate": { 65 + "type": "ref", 66 + "ref": "#threadgateView" 67 + } 68 + }, 69 + "required": ["uri", "cid", "author", "record", "indexedAt"] 76 70 }
+7 -7
samples/primitives-array.json
··· 1 1 { 2 - "type": "array", 3 - "items": { 4 - "type": "string" 5 - }, 6 - "minLength": 1, 7 - "maxLength": 10, 8 - "required": true 2 + "type": "array", 3 + "items": { 4 + "type": "string" 5 + }, 6 + "minLength": 1, 7 + "maxLength": 10, 8 + "required": true 9 9 }
+3 -6
samples/primitives-blob.json
··· 1 1 { 2 - "type": "blob", 3 - "accept": [ 4 - "image/png", 5 - "image/jpeg" 6 - ], 7 - "maxSize": 5000000 2 + "type": "blob", 3 + "accept": ["image/png", "image/jpeg"], 4 + "maxSize": 5000000 8 5 }
+2 -2
samples/primitives-token.json
··· 1 1 { 2 - "type": "token", 3 - "description": "Request that less content like the given feed item be shown in the feed" 2 + "type": "token", 3 + "description": "Request that less content like the given feed item be shown in the feed" 4 4 }
+52 -59
samples/procedure-create-post.json
··· 1 1 { 2 - "type": "procedure", 3 - "description": "Create a post", 4 - "input": { 5 - "encoding": "application/json", 6 - "schema": { 7 - "type": "object", 8 - "properties": { 9 - "repo": { 10 - "type": "string", 11 - "required": true 12 - }, 13 - "collection": { 14 - "type": "string", 15 - "required": true 16 - }, 17 - "record": { 18 - "type": "unknown", 19 - "required": true 20 - }, 21 - "validate": { 22 - "type": "boolean", 23 - "default": true 24 - } 25 - }, 26 - "required": [ 27 - "repo", 28 - "collection", 29 - "record" 30 - ] 31 - } 32 - }, 33 - "output": { 34 - "encoding": "application/json", 35 - "schema": { 36 - "type": "object", 37 - "properties": { 38 - "uri": { 39 - "type": "string", 40 - "required": true 41 - }, 42 - "cid": { 43 - "type": "string", 44 - "required": true 45 - } 46 - }, 47 - "required": [ 48 - "uri", 49 - "cid" 50 - ] 51 - } 52 - }, 53 - "errors": [ 54 - { 55 - "name": "InvalidSwap" 56 - }, 57 - { 58 - "name": "InvalidRecord" 59 - } 60 - ] 2 + "type": "procedure", 3 + "description": "Create a post", 4 + "input": { 5 + "encoding": "application/json", 6 + "schema": { 7 + "type": "object", 8 + "properties": { 9 + "repo": { 10 + "type": "string", 11 + "required": true 12 + }, 13 + "collection": { 14 + "type": "string", 15 + "required": true 16 + }, 17 + "record": { 18 + "type": "unknown", 19 + "required": true 20 + }, 21 + "validate": { 22 + "type": "boolean", 23 + "default": true 24 + } 25 + }, 26 + "required": ["repo", "collection", "record"] 27 + } 28 + }, 29 + "output": { 30 + "encoding": "application/json", 31 + "schema": { 32 + "type": "object", 33 + "properties": { 34 + "uri": { 35 + "type": "string", 36 + "required": true 37 + }, 38 + "cid": { 39 + "type": "string", 40 + "required": true 41 + } 42 + }, 43 + "required": ["uri", "cid"] 44 + } 45 + }, 46 + "errors": [ 47 + { 48 + "name": "InvalidSwap" 49 + }, 50 + { 51 + "name": "InvalidRecord" 52 + } 53 + ] 61 54 }
+23 -23
samples/profile-namespace.json
··· 1 1 { 2 - "lexicon": 1, 3 - "id": "app.bsky.actor.profile", 4 - "defs": { 5 - "main": { 6 - "type": "record", 7 - "key": "self", 8 - "record": { 9 - "type": "object", 10 - "properties": { 11 - "displayName": { 12 - "type": "string", 13 - "maxLength": 64, 14 - "maxGraphemes": 64 15 - }, 16 - "description": { 17 - "type": "string", 18 - "maxLength": 256, 19 - "maxGraphemes": 256 20 - } 21 - } 22 - } 23 - } 24 - } 2 + "lexicon": 1, 3 + "id": "app.bsky.actor.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "key": "self", 8 + "record": { 9 + "type": "object", 10 + "properties": { 11 + "displayName": { 12 + "type": "string", 13 + "maxLength": 64, 14 + "maxGraphemes": 64 15 + }, 16 + "description": { 17 + "type": "string", 18 + "maxLength": 256, 19 + "maxGraphemes": 256 20 + } 21 + } 22 + } 23 + } 24 + } 25 25 }
+53 -56
samples/profile-view-basic.json
··· 1 1 { 2 - "type": "object", 3 - "properties": { 4 - "did": { 5 - "type": "string", 6 - "required": true, 7 - "format": "did" 8 - }, 9 - "handle": { 10 - "type": "string", 11 - "required": true, 12 - "format": "handle" 13 - }, 14 - "displayName": { 15 - "type": "string", 16 - "maxGraphemes": 64, 17 - "maxLength": 640 18 - }, 19 - "pronouns": { 20 - "type": "string" 21 - }, 22 - "avatar": { 23 - "type": "string", 24 - "format": "uri" 25 - }, 26 - "associated": { 27 - "type": "ref", 28 - "ref": "#profileAssociated" 29 - }, 30 - "viewer": { 31 - "type": "ref", 32 - "ref": "#viewerState" 33 - }, 34 - "labels": { 35 - "type": "array", 36 - "items": { 37 - "type": "ref", 38 - "ref": "com.atproto.label.defs#label" 39 - } 40 - }, 41 - "createdAt": { 42 - "type": "string", 43 - "format": "datetime" 44 - }, 45 - "verification": { 46 - "type": "ref", 47 - "ref": "#verificationState" 48 - }, 49 - "status": { 50 - "type": "ref", 51 - "ref": "#statusView" 52 - } 53 - }, 54 - "required": [ 55 - "did", 56 - "handle" 57 - ] 2 + "type": "object", 3 + "properties": { 4 + "did": { 5 + "type": "string", 6 + "required": true, 7 + "format": "did" 8 + }, 9 + "handle": { 10 + "type": "string", 11 + "required": true, 12 + "format": "handle" 13 + }, 14 + "displayName": { 15 + "type": "string", 16 + "maxGraphemes": 64, 17 + "maxLength": 640 18 + }, 19 + "pronouns": { 20 + "type": "string" 21 + }, 22 + "avatar": { 23 + "type": "string", 24 + "format": "uri" 25 + }, 26 + "associated": { 27 + "type": "ref", 28 + "ref": "#profileAssociated" 29 + }, 30 + "viewer": { 31 + "type": "ref", 32 + "ref": "#viewerState" 33 + }, 34 + "labels": { 35 + "type": "array", 36 + "items": { 37 + "type": "ref", 38 + "ref": "com.atproto.label.defs#label" 39 + } 40 + }, 41 + "createdAt": { 42 + "type": "string", 43 + "format": "datetime" 44 + }, 45 + "verification": { 46 + "type": "ref", 47 + "ref": "#verificationState" 48 + }, 49 + "status": { 50 + "type": "ref", 51 + "ref": "#statusView" 52 + } 53 + }, 54 + "required": ["did", "handle"] 58 55 }
+54 -61
samples/query-search-posts.json
··· 1 1 { 2 - "type": "query", 3 - "description": "Find posts matching search criteria", 4 - "parameters": { 5 - "type": "params", 6 - "properties": { 7 - "q": { 8 - "type": "string", 9 - "required": true 10 - }, 11 - "sort": { 12 - "type": "string", 13 - "enum": [ 14 - "top", 15 - "latest" 16 - ], 17 - "default": "latest" 18 - }, 19 - "limit": { 20 - "type": "integer", 21 - "minimum": 1, 22 - "maximum": 100, 23 - "default": 25 24 - }, 25 - "cursor": { 26 - "type": "string" 27 - } 28 - }, 29 - "required": [ 30 - "q" 31 - ] 32 - }, 33 - "output": { 34 - "encoding": "application/json", 35 - "schema": { 36 - "type": "object", 37 - "properties": { 38 - "cursor": { 39 - "type": "string" 40 - }, 41 - "hitsTotal": { 42 - "type": "integer" 43 - }, 44 - "posts": { 45 - "type": "array", 46 - "items": { 47 - "type": "ref", 48 - "ref": "app.bsky.feed.defs#postView" 49 - }, 50 - "required": true 51 - } 52 - }, 53 - "required": [ 54 - "posts" 55 - ] 56 - } 57 - }, 58 - "errors": [ 59 - { 60 - "name": "BadQueryString" 61 - } 62 - ] 2 + "type": "query", 3 + "description": "Find posts matching search criteria", 4 + "parameters": { 5 + "type": "params", 6 + "properties": { 7 + "q": { 8 + "type": "string", 9 + "required": true 10 + }, 11 + "sort": { 12 + "type": "string", 13 + "enum": ["top", "latest"], 14 + "default": "latest" 15 + }, 16 + "limit": { 17 + "type": "integer", 18 + "minimum": 1, 19 + "maximum": 100, 20 + "default": 25 21 + }, 22 + "cursor": { 23 + "type": "string" 24 + } 25 + }, 26 + "required": ["q"] 27 + }, 28 + "output": { 29 + "encoding": "application/json", 30 + "schema": { 31 + "type": "object", 32 + "properties": { 33 + "cursor": { 34 + "type": "string" 35 + }, 36 + "hitsTotal": { 37 + "type": "integer" 38 + }, 39 + "posts": { 40 + "type": "array", 41 + "items": { 42 + "type": "ref", 43 + "ref": "app.bsky.feed.defs#postView" 44 + }, 45 + "required": true 46 + } 47 + }, 48 + "required": ["posts"] 49 + } 50 + }, 51 + "errors": [ 52 + { 53 + "name": "BadQueryString" 54 + } 55 + ] 63 56 }
+33 -33
samples/subscription-repos.json
··· 1 1 { 2 - "type": "subscription", 3 - "description": "Repository event stream, aka Firehose endpoint", 4 - "parameters": { 5 - "type": "params", 6 - "properties": { 7 - "cursor": { 8 - "type": "integer" 9 - } 10 - } 11 - }, 12 - "message": { 13 - "description": "Represents an update of repository state", 14 - "schema": { 15 - "type": "union", 16 - "refs": [ 17 - "#commit", 18 - "#identity", 19 - "#account", 20 - "#handle", 21 - "#migrate", 22 - "#tombstone", 23 - "#info" 24 - ] 25 - } 26 - }, 27 - "errors": [ 28 - { 29 - "name": "FutureCursor" 30 - }, 31 - { 32 - "name": "ConsumerTooSlow" 33 - } 34 - ] 2 + "type": "subscription", 3 + "description": "Repository event stream, aka Firehose endpoint", 4 + "parameters": { 5 + "type": "params", 6 + "properties": { 7 + "cursor": { 8 + "type": "integer" 9 + } 10 + } 11 + }, 12 + "message": { 13 + "description": "Represents an update of repository state", 14 + "schema": { 15 + "type": "union", 16 + "refs": [ 17 + "#commit", 18 + "#identity", 19 + "#account", 20 + "#handle", 21 + "#migrate", 22 + "#tombstone", 23 + "#info" 24 + ] 25 + } 26 + }, 27 + "errors": [ 28 + { 29 + "name": "FutureCursor" 30 + }, 31 + { 32 + "name": "ConsumerTooSlow" 33 + } 34 + ] 35 35 }
+1
src/index.ts
··· 1 + export * from "./lib.ts";
+82 -111
src/infer.ts
··· 1 - // deno-lint-ignore-file ban-types 2 - type InferType<T> = T extends { type: "record" } ? InferRecord<T> 3 - : T extends { type: "object" } ? InferObject<T> 4 - : T extends { type: "array" } ? InferArray<T> 5 - : T extends { type: "params" } ? InferParams<T> 6 - : T extends { type: "union" } ? InferUnion<T> 7 - : T extends { type: "token" } ? InferToken<T> 8 - : T extends { type: "ref" } ? InferRef<T> 9 - : T extends { type: "unknown" } ? unknown 10 - : T extends { type: "null" } ? null 11 - : T extends { type: "boolean" } ? boolean 12 - : T extends { type: "integer" } ? number 13 - : T extends { type: "string" } ? string 14 - : T extends { type: "bytes" } ? Uint8Array 15 - : T extends { type: "cid-link" } ? string 16 - : T extends { type: "blob" } ? Blob 17 - : never; 1 + /* eslint-disable @typescript-eslint/no-empty-object-type */ 2 + type InferType<T> = T extends { type: "record" } 3 + ? InferRecord<T> 4 + : T extends { type: "object" } 5 + ? InferObject<T> 6 + : T extends { type: "array" } 7 + ? InferArray<T> 8 + : T extends { type: "params" } 9 + ? InferParams<T> 10 + : T extends { type: "union" } 11 + ? InferUnion<T> 12 + : T extends { type: "token" } 13 + ? InferToken<T> 14 + : T extends { type: "ref" } 15 + ? InferRef<T> 16 + : T extends { type: "unknown" } 17 + ? unknown 18 + : T extends { type: "null" } 19 + ? null 20 + : T extends { type: "boolean" } 21 + ? boolean 22 + : T extends { type: "integer" } 23 + ? number 24 + : T extends { type: "string" } 25 + ? string 26 + : T extends { type: "bytes" } 27 + ? Uint8Array 28 + : T extends { type: "cid-link" } 29 + ? string 30 + : T extends { type: "blob" } 31 + ? Blob 32 + : never; 18 33 19 34 type InferToken<T> = T extends { enum: readonly (infer U)[] } ? U : string; 20 35 ··· 22 37 type GetNullable<T> = T extends { nullable: readonly (infer N)[] } ? N : never; 23 38 24 39 type InferObject< 25 - T, 26 - Nullable extends string = GetNullable<T> & string, 27 - Required extends string = GetRequired<T> & string, 28 - NullableAndRequired extends string = Required & Nullable & string, 29 - Normal extends string = "properties" extends keyof T 30 - ? Exclude<keyof T["properties"], Required | Nullable> & string 31 - : never, 40 + T, 41 + Nullable extends string = GetNullable<T> & string, 42 + Required extends string = GetRequired<T> & string, 43 + NullableAndRequired extends string = Required & Nullable & string, 44 + Normal extends string = "properties" extends keyof T 45 + ? Exclude<keyof T["properties"], Required | Nullable> & string 46 + : never, 32 47 > = Prettify< 33 - T extends { properties: infer P } ? 34 - & { 35 - -readonly [ 36 - K in Normal 37 - ]?: InferType< 38 - P[K & keyof P] 39 - >; 40 - } 41 - & ({ 42 - -readonly [K in Exclude<Required, NullableAndRequired>]-?: InferType< 43 - P[K & keyof P] 44 - >; 45 - }) 46 - & ({ 47 - -readonly [K in Exclude<Nullable, NullableAndRequired>]?: 48 - | InferType< 49 - P[K & keyof P] 50 - > 51 - | null; 52 - }) 53 - & ({ 54 - -readonly [K in NullableAndRequired]: 55 - | InferType< 56 - P[K & keyof P] 57 - > 58 - | null; 59 - }) 60 - : {} 48 + T extends { properties: infer P } 49 + ? { 50 + -readonly [K in Normal]?: InferType<P[K & keyof P]>; 51 + } & { 52 + -readonly [K in Exclude<Required, NullableAndRequired>]-?: InferType< 53 + P[K & keyof P] 54 + >; 55 + } & { 56 + -readonly [K in Exclude<Nullable, NullableAndRequired>]?: InferType< 57 + P[K & keyof P] 58 + > | null; 59 + } & { 60 + -readonly [K in NullableAndRequired]: InferType<P[K & keyof P]> | null; 61 + } 62 + : {} 61 63 >; 62 64 63 - type InferArray<T> = T extends { items: infer Items } ? InferType<Items>[] 64 - : never[]; 65 + type InferArray<T> = T extends { items: infer Items } 66 + ? InferType<Items>[] 67 + : never[]; 65 68 66 69 type InferUnion<T> = T extends { refs: readonly (infer R)[] } 67 - ? R extends string ? { $type: R; [key: string]: unknown } : never 68 - : never; 70 + ? R extends string 71 + ? { $type: R; [key: string]: unknown } 72 + : never 73 + : never; 69 74 70 75 type InferRef<T> = T extends { ref: infer R } 71 - ? R extends string ? { $type: R; [key: string]: unknown } : unknown 72 - : unknown; 76 + ? R extends string 77 + ? { $type: R; [key: string]: unknown } 78 + : unknown 79 + : unknown; 73 80 74 - type InferParams<T> = T extends { properties: infer P } ? InferObject<T> 75 - : never; 81 + type InferParams<T> = T extends { properties: infer P } 82 + ? InferObject<P> 83 + : never; 76 84 77 85 type InferRecord<T> = T extends { record: infer R } 78 - ? R extends { type: "object" } ? InferObject<R> 79 - : R extends { type: "union" } ? InferUnion<R> 80 - : unknown 81 - : unknown; 82 - 83 - type Prettify<T> = 84 - & { 85 - [K in keyof T]: T[K]; 86 - } 87 - & {}; 88 - 89 - export type InferDefs<T extends Record<string, unknown>> = Prettify< 90 - { 91 - -readonly [K in keyof T]: InferType<T[K]>; 92 - } 93 - >; 94 - 95 - type InferNS<T extends { id: string; defs: Record<string, unknown> }> = 96 - InferDefs<T["defs"]>; 97 - 98 - const schema = { 99 - "lexicon": 1, 100 - "id": "app.bsky.actor.profile", 101 - "defs": { 102 - "main": { 103 - "type": "record", 104 - "key": "self", 105 - "record": { 106 - "type": "object", 107 - "properties": { 108 - "displayName": { 109 - "type": "string", 110 - "maxLength": 64, 111 - "maxGraphemes": 64, 112 - }, 113 - "description": { 114 - "type": "string", 115 - "maxLength": 256, 116 - "maxGraphemes": 256, 117 - }, 118 - }, 119 - }, 120 - }, 121 - }, 122 - } as const; 86 + ? R extends { type: "object" } 87 + ? InferObject<R> 88 + : R extends { type: "union" } 89 + ? InferUnion<R> 90 + : unknown 91 + : unknown; 123 92 124 - type Schema = InferNS<typeof schema>; 93 + type Prettify<T> = { 94 + [K in keyof T]: T[K]; 95 + } & {}; 125 96 126 - const main: Schema["main"] = { 127 - displayName: "blob", 128 - description: "I am a blob dude", 129 - }; 97 + export type InferDefs<T extends Record<string, unknown>> = Prettify<{ 98 + -readonly [K in keyof T]: InferType<T[K]>; 99 + }>; 130 100 131 - console.log(`hi ${main.displayName}`); 101 + export type InferNS<T extends { id: string; defs: Record<string, unknown> }> = 102 + InferDefs<T["defs"]>;
+393 -399
src/lib.ts
··· 1 1 // deno-lint-ignore-file ban-types 2 2 /** @see https://atproto.com/specs/lexicon#overview-of-types */ 3 3 type LexiconType = 4 - // Concrete types 5 - | "null" 6 - | "boolean" 7 - | "integer" 8 - | "string" 9 - | "bytes" 10 - | "cid-link" 11 - | "blob" 12 - // Container types 13 - | "array" 14 - | "object" 15 - | "params" 16 - // Meta types 17 - | "token" 18 - | "ref" 19 - | "union" 20 - | "unknown" 21 - // Primary types 22 - | "record" 23 - | "query" 24 - | "procedure" 25 - | "subscription"; 4 + // Concrete types 5 + | "null" 6 + | "boolean" 7 + | "integer" 8 + | "string" 9 + | "bytes" 10 + | "cid-link" 11 + | "blob" 12 + // Container types 13 + | "array" 14 + | "object" 15 + | "params" 16 + // Meta types 17 + | "token" 18 + | "ref" 19 + | "union" 20 + | "unknown" 21 + // Primary types 22 + | "record" 23 + | "query" 24 + | "procedure" 25 + | "subscription"; 26 26 27 27 /** 28 28 * Common options available for lexicon items. 29 29 * @see https://atproto.com/specs/lexicon#string-formats 30 30 */ 31 31 interface LexiconItemCommonOptions { 32 - /** Indicates this field must be provided */ 33 - required?: boolean; 34 - /** Indicates this field can be explicitly set to null */ 35 - nullable?: boolean; 32 + /** Indicates this field must be provided */ 33 + required?: boolean; 34 + /** Indicates this field can be explicitly set to null */ 35 + nullable?: boolean; 36 36 } 37 37 38 38 /** ··· 40 40 * @see https://atproto.com/specs/lexicon#overview-of-types 41 41 */ 42 42 interface LexiconItem extends LexiconItemCommonOptions { 43 - type: LexiconType; 43 + type: LexiconType; 44 44 } 45 45 46 46 /** 47 47 * Definition in a lexicon namespace. 48 48 * @see https://atproto.com/specs/lexicon#lexicon-document 49 49 */ 50 - type Def = { 51 - type: LexiconType; 52 - }; 50 + interface Def { 51 + type: LexiconType; 52 + } 53 53 54 54 /** 55 55 * Lexicon namespace document structure. 56 56 * @see https://atproto.com/specs/lexicon#lexicon-document 57 57 */ 58 58 interface LexiconNamespace { 59 - /** Namespaced identifier (NSID) for this lexicon */ 60 - id: string; 61 - /** Named definitions within this namespace */ 62 - defs: { 63 - [name: string]: Def; 64 - }; 59 + /** Namespaced identifier (NSID) for this lexicon */ 60 + id: string; 61 + /** Named definitions within this namespace */ 62 + defs: Record<string, Def>; 65 63 } 66 64 67 65 /** ··· 69 67 * @see https://atproto.com/specs/lexicon#string 70 68 */ 71 69 interface StringOptions extends LexiconItemCommonOptions { 72 - /** 73 - * Semantic string format constraint. 74 - * @see https://atproto.com/specs/lexicon#string-formats 75 - */ 76 - format?: 77 - | "at-identifier" // Handle or DID 78 - | "at-uri" // AT Protocol URI 79 - | "cid" // Content Identifier 80 - | "datetime" // Timestamp (UTC, ISO 8601) 81 - | "did" // Decentralized Identifier 82 - | "handle" // User handle identifier 83 - | "nsid" // Namespaced Identifier 84 - | "tid" // Timestamp Identifier 85 - | "record-key" // Repository record key 86 - | "uri" // Generic URI 87 - | "language"; // IETF BCP 47 language tag 88 - /** Maximum string length in bytes */ 89 - maxLength?: number; 90 - /** Minimum string length in bytes */ 91 - minLength?: number; 92 - /** Maximum string length in Unicode graphemes */ 93 - maxGraphemes?: number; 94 - /** Minimum string length in Unicode graphemes */ 95 - minGraphemes?: number; 96 - /** Hints at expected values, not enforced */ 97 - knownValues?: string[]; 98 - /** Restricts to an exact set of string values */ 99 - enum?: string[]; 100 - /** Default value if not provided */ 101 - default?: string; 102 - /** Fixed, unchangeable value */ 103 - const?: string; 70 + /** 71 + * Semantic string format constraint. 72 + * @see https://atproto.com/specs/lexicon#string-formats 73 + */ 74 + format?: 75 + | "at-identifier" // Handle or DID 76 + | "at-uri" // AT Protocol URI 77 + | "cid" // Content Identifier 78 + | "datetime" // Timestamp (UTC, ISO 8601) 79 + | "did" // Decentralized Identifier 80 + | "handle" // User handle identifier 81 + | "nsid" // Namespaced Identifier 82 + | "tid" // Timestamp Identifier 83 + | "record-key" // Repository record key 84 + | "uri" // Generic URI 85 + | "language"; // IETF BCP 47 language tag 86 + /** Maximum string length in bytes */ 87 + maxLength?: number; 88 + /** Minimum string length in bytes */ 89 + minLength?: number; 90 + /** Maximum string length in Unicode graphemes */ 91 + maxGraphemes?: number; 92 + /** Minimum string length in Unicode graphemes */ 93 + minGraphemes?: number; 94 + /** Hints at expected values, not enforced */ 95 + knownValues?: string[]; 96 + /** Restricts to an exact set of string values */ 97 + enum?: string[]; 98 + /** Default value if not provided */ 99 + default?: string; 100 + /** Fixed, unchangeable value */ 101 + const?: string; 104 102 } 105 103 106 104 /** ··· 108 106 * @see https://atproto.com/specs/lexicon#boolean 109 107 */ 110 108 interface BooleanOptions extends LexiconItemCommonOptions { 111 - /** Default value if not provided */ 112 - default?: boolean; 113 - /** Fixed, unchangeable value */ 114 - const?: boolean; 109 + /** Default value if not provided */ 110 + default?: boolean; 111 + /** Fixed, unchangeable value */ 112 + const?: boolean; 115 113 } 116 114 117 115 /** ··· 119 117 * @see https://atproto.com/specs/lexicon#integer 120 118 */ 121 119 interface IntegerOptions extends LexiconItemCommonOptions { 122 - /** Minimum allowed value (inclusive) */ 123 - minimum?: number; 124 - /** Maximum allowed value (inclusive) */ 125 - maximum?: number; 126 - /** Restricts to an exact set of integer values */ 127 - enum?: number[]; 128 - /** Default value if not provided */ 129 - default?: number; 130 - /** Fixed, unchangeable value */ 131 - const?: number; 120 + /** Minimum allowed value (inclusive) */ 121 + minimum?: number; 122 + /** Maximum allowed value (inclusive) */ 123 + maximum?: number; 124 + /** Restricts to an exact set of integer values */ 125 + enum?: number[]; 126 + /** Default value if not provided */ 127 + default?: number; 128 + /** Fixed, unchangeable value */ 129 + const?: number; 132 130 } 133 131 134 132 /** ··· 136 134 * @see https://atproto.com/specs/lexicon#bytes 137 135 */ 138 136 interface BytesOptions extends LexiconItemCommonOptions { 139 - /** Minimum byte array length */ 140 - minLength?: number; 141 - /** Maximum byte array length */ 142 - maxLength?: number; 137 + /** Minimum byte array length */ 138 + minLength?: number; 139 + /** Maximum byte array length */ 140 + maxLength?: number; 143 141 } 144 142 145 143 /** ··· 147 145 * @see https://atproto.com/specs/lexicon#blob 148 146 */ 149 147 interface BlobOptions extends LexiconItemCommonOptions { 150 - /** Allowed MIME types (e.g., ["image/png", "image/jpeg"]) */ 151 - accept?: string[]; 152 - /** Maximum blob size in bytes */ 153 - maxSize?: number; 148 + /** Allowed MIME types (e.g., ["image/png", "image/jpeg"]) */ 149 + accept?: string[]; 150 + /** Maximum blob size in bytes */ 151 + maxSize?: number; 154 152 } 155 153 156 154 /** ··· 158 156 * @see https://atproto.com/specs/lexicon#array 159 157 */ 160 158 interface ArrayOptions extends LexiconItemCommonOptions { 161 - /** Minimum array length */ 162 - minLength?: number; 163 - /** Maximum array length */ 164 - maxLength?: number; 159 + /** Minimum array length */ 160 + minLength?: number; 161 + /** Maximum array length */ 162 + maxLength?: number; 165 163 } 166 164 167 165 /** ··· 169 167 * @see https://atproto.com/specs/lexicon#record 170 168 */ 171 169 interface RecordOptions { 172 - /** Record key strategy: "self" for self-describing or "tid" for timestamp IDs */ 173 - key: "self" | "tid"; 174 - /** Object schema defining the record structure */ 175 - record: { type: "object" }; 176 - /** Human-readable description */ 177 - description?: string; 170 + /** Record key strategy: "self" for self-describing or "tid" for timestamp IDs */ 171 + key: "self" | "tid"; 172 + /** Object schema defining the record structure */ 173 + record: { type: "object" }; 174 + /** Human-readable description */ 175 + description?: string; 178 176 } 179 177 180 178 /** ··· 182 180 * @see https://atproto.com/specs/lexicon#union 183 181 */ 184 182 interface UnionOptions extends LexiconItemCommonOptions { 185 - /** If true, only listed refs are allowed; if false, additional types may be added */ 186 - closed?: boolean; 183 + /** If true, only listed refs are allowed; if false, additional types may be added */ 184 + closed?: boolean; 187 185 } 188 186 189 187 /** 190 188 * Map of property names to their lexicon item definitions. 191 189 * @see https://atproto.com/specs/lexicon#object 192 190 */ 193 - interface ObjectProperties { 194 - [key: string]: LexiconItem; 195 - } 191 + type ObjectProperties = Record<string, LexiconItem>; 196 192 197 193 /** 198 194 * Resulting object schema with required and nullable fields extracted. 199 195 * @see https://atproto.com/specs/lexicon#object 200 196 */ 201 197 interface ObjectResult<T extends ObjectProperties> { 202 - type: "object"; 203 - /** Property definitions */ 204 - properties: T; 205 - /** List of required property names */ 206 - required?: string[]; 207 - /** List of nullable property names */ 208 - nullable?: string[]; 198 + type: "object"; 199 + /** Property definitions */ 200 + properties: T; 201 + /** List of required property names */ 202 + required?: string[]; 203 + /** List of nullable property names */ 204 + nullable?: string[]; 209 205 } 210 206 211 207 /** 212 208 * Map of parameter names to their lexicon item definitions. 213 209 * @see https://atproto.com/specs/lexicon#params 214 210 */ 215 - interface ParamsProperties { 216 - [key: string]: LexiconItem; 217 - } 211 + type ParamsProperties = Record<string, LexiconItem>; 218 212 219 213 /** 220 214 * Resulting params schema with required fields extracted. 221 215 * @see https://atproto.com/specs/lexicon#params 222 216 */ 223 217 interface ParamsResult<T extends ParamsProperties> { 224 - type: "params"; 225 - /** Parameter definitions */ 226 - properties: T; 227 - /** List of required parameter names */ 228 - required?: string[]; 218 + type: "params"; 219 + /** Parameter definitions */ 220 + properties: T; 221 + /** List of required parameter names */ 222 + required?: string[]; 229 223 } 230 224 231 225 /** ··· 233 227 * @see https://atproto.com/specs/lexicon#http-endpoints 234 228 */ 235 229 interface BodySchema { 236 - /** MIME type encoding (typically "application/json") */ 237 - encoding: "application/json" | (string & {}); 238 - /** Human-readable description */ 239 - description?: string; 240 - /** Object schema defining the body structure */ 241 - schema?: ObjectResult<ObjectProperties>; 230 + /** MIME type encoding (typically "application/json") */ 231 + encoding: "application/json" | (string & {}); 232 + /** Human-readable description */ 233 + description?: string; 234 + /** Object schema defining the body structure */ 235 + schema?: ObjectResult<ObjectProperties>; 242 236 } 243 237 244 238 /** ··· 246 240 * @see https://atproto.com/specs/lexicon#http-endpoints 247 241 */ 248 242 interface ErrorDef { 249 - /** Error name/code */ 250 - name: string; 251 - /** Human-readable error description */ 252 - description?: string; 243 + /** Error name/code */ 244 + name: string; 245 + /** Human-readable error description */ 246 + description?: string; 253 247 } 254 248 255 249 /** ··· 257 251 * @see https://atproto.com/specs/lexicon#query 258 252 */ 259 253 interface QueryOptions { 260 - /** Human-readable description */ 261 - description?: string; 262 - /** Query string parameters */ 263 - parameters?: ParamsResult<ParamsProperties>; 264 - /** Response body schema */ 265 - output?: BodySchema; 266 - /** Possible error responses */ 267 - errors?: ErrorDef[]; 254 + /** Human-readable description */ 255 + description?: string; 256 + /** Query string parameters */ 257 + parameters?: ParamsResult<ParamsProperties>; 258 + /** Response body schema */ 259 + output?: BodySchema; 260 + /** Possible error responses */ 261 + errors?: ErrorDef[]; 268 262 } 269 263 270 264 /** ··· 272 266 * @see https://atproto.com/specs/lexicon#procedure 273 267 */ 274 268 interface ProcedureOptions { 275 - /** Human-readable description */ 276 - description?: string; 277 - /** Query string parameters */ 278 - parameters?: ParamsResult<ParamsProperties>; 279 - /** Request body schema */ 280 - input?: BodySchema; 281 - /** Response body schema */ 282 - output?: BodySchema; 283 - /** Possible error responses */ 284 - errors?: ErrorDef[]; 269 + /** Human-readable description */ 270 + description?: string; 271 + /** Query string parameters */ 272 + parameters?: ParamsResult<ParamsProperties>; 273 + /** Request body schema */ 274 + input?: BodySchema; 275 + /** Response body schema */ 276 + output?: BodySchema; 277 + /** Possible error responses */ 278 + errors?: ErrorDef[]; 285 279 } 286 280 287 281 /** ··· 289 283 * @see https://atproto.com/specs/lexicon#subscription 290 284 */ 291 285 interface MessageSchema { 292 - /** Human-readable description */ 293 - description?: string; 294 - /** Union of possible message types */ 295 - schema: { type: "union"; refs: readonly string[] }; 286 + /** Human-readable description */ 287 + description?: string; 288 + /** Union of possible message types */ 289 + schema: { type: "union"; refs: readonly string[] }; 296 290 } 297 291 298 292 /** ··· 300 294 * @see https://atproto.com/specs/lexicon#subscription 301 295 */ 302 296 interface SubscriptionOptions { 303 - /** Human-readable description */ 304 - description?: string; 305 - /** Query string parameters */ 306 - parameters?: ParamsResult<ParamsProperties>; 307 - /** Message schema for events */ 308 - message?: MessageSchema; 309 - /** Possible error responses */ 310 - errors?: ErrorDef[]; 297 + /** Human-readable description */ 298 + description?: string; 299 + /** Query string parameters */ 300 + parameters?: ParamsResult<ParamsProperties>; 301 + /** Message schema for events */ 302 + message?: MessageSchema; 303 + /** Possible error responses */ 304 + errors?: ErrorDef[]; 311 305 } 312 306 313 307 /** ··· 315 309 * @see https://atproto.com/specs/lexicon 316 310 */ 317 311 export const lx = { 318 - /** 319 - * Creates a null type. 320 - * @see https://atproto.com/specs/lexicon#null 321 - */ 322 - null( 323 - options?: LexiconItemCommonOptions, 324 - ): { type: "null" } & LexiconItemCommonOptions { 325 - return { 326 - type: "null", 327 - ...options, 328 - }; 329 - }, 330 - /** 331 - * Creates a boolean type with optional constraints. 332 - * @see https://atproto.com/specs/lexicon#boolean 333 - */ 334 - boolean<T extends BooleanOptions>(options?: T): T & { type: "boolean" } { 335 - return { 336 - type: "boolean", 337 - ...options, 338 - } as T & { type: "boolean" }; 339 - }, 340 - /** 341 - * Creates an integer type with optional min/max and enum constraints. 342 - * @see https://atproto.com/specs/lexicon#integer 343 - */ 344 - integer<T extends IntegerOptions>(options?: T): T & { type: "integer" } { 345 - return { 346 - type: "integer", 347 - ...options, 348 - } as T & { type: "integer" }; 349 - }, 350 - /** 351 - * Creates a string type with optional format, length, and value constraints. 352 - * @see https://atproto.com/specs/lexicon#string 353 - */ 354 - string<T extends StringOptions>(options?: T): T & { type: "string" } { 355 - return { 356 - type: "string", 357 - ...options, 358 - } as T & { type: "string" }; 359 - }, 360 - /** 361 - * Creates an unknown type for flexible, unvalidated objects. 362 - * @see https://atproto.com/specs/lexicon#unknown 363 - */ 364 - unknown( 365 - options?: LexiconItemCommonOptions, 366 - ): { type: "unknown" } & LexiconItemCommonOptions { 367 - return { 368 - type: "unknown", 369 - ...options, 370 - }; 371 - }, 372 - /** 373 - * Creates a bytes type for arbitrary byte arrays. 374 - * @see https://atproto.com/specs/lexicon#bytes 375 - */ 376 - bytes<T extends BytesOptions>(options?: T): T & { type: "bytes" } { 377 - return { 378 - type: "bytes", 379 - ...options, 380 - } as T & { type: "bytes" }; 381 - }, 382 - /** 383 - * Creates a CID link reference to content-addressed data. 384 - * @see https://atproto.com/specs/lexicon#cid-link 385 - */ 386 - cidLink<Link extends string>(link: Link): { type: "cid-link"; $link: Link } { 387 - return { 388 - type: "cid-link", 389 - $link: link, 390 - }; 391 - }, 392 - /** 393 - * Creates a blob type for binary data with MIME type constraints. 394 - * @see https://atproto.com/specs/lexicon#blob 395 - */ 396 - blob<T extends BlobOptions>(options?: T): T & { type: "blob" } { 397 - return { 398 - type: "blob", 399 - ...options, 400 - } as T & { type: "blob" }; 401 - }, 402 - /** 403 - * Creates an array type with item schema and length constraints. 404 - * @see https://atproto.com/specs/lexicon#array 405 - */ 406 - array<Items extends LexiconItem, Options extends ArrayOptions>( 407 - items: Items, 408 - options?: Options, 409 - ): Options & { type: "array"; items: Items } { 410 - return { 411 - type: "array", 412 - items, 413 - ...options, 414 - } as Options & { type: "array"; items: Items }; 415 - }, 416 - /** 417 - * Creates a token type for symbolic values in unions. 418 - * @see https://atproto.com/specs/lexicon#token 419 - */ 420 - token<Description extends string>( 421 - description: Description, 422 - ): { type: "token"; description: Description } { 423 - return { type: "token", description }; 424 - }, 425 - /** 426 - * Creates a reference to another schema definition. 427 - * @see https://atproto.com/specs/lexicon#ref 428 - */ 429 - ref<Ref extends string>( 430 - ref: Ref, 431 - options?: LexiconItemCommonOptions, 432 - ): LexiconItemCommonOptions & { type: "ref"; ref: Ref } { 433 - return { 434 - type: "ref", 435 - ref, 436 - ...options, 437 - } as LexiconItemCommonOptions & { type: "ref"; ref: Ref }; 438 - }, 439 - /** 440 - * Creates a union type for multiple possible type variants. 441 - * @see https://atproto.com/specs/lexicon#union 442 - */ 443 - union<const Refs extends readonly string[], Options extends UnionOptions>( 444 - refs: Refs, 445 - options?: Options, 446 - ): Options & { type: "union"; refs: Refs } { 447 - return { 448 - type: "union", 449 - refs, 450 - ...options, 451 - } as Options & { type: "union"; refs: Refs }; 452 - }, 453 - /** 454 - * Creates a record type for repository records. 455 - * @see https://atproto.com/specs/lexicon#record 456 - */ 457 - record<T extends RecordOptions>(options: T): T & { type: "record" } { 458 - return { 459 - type: "record", 460 - ...options, 461 - }; 462 - }, 463 - /** 464 - * Creates an object type with defined properties. 465 - * @see https://atproto.com/specs/lexicon#object 466 - */ 467 - object<T extends ObjectProperties>(options: T): ObjectResult<T> { 468 - const required = Object.keys(options).filter( 469 - (key) => options[key].required, 470 - ); 471 - const nullable = Object.keys(options).filter( 472 - (key) => options[key].nullable, 473 - ); 474 - const result: ObjectResult<T> = { 475 - type: "object", 476 - properties: options, 477 - }; 478 - if (required.length > 0) { 479 - result.required = required; 480 - } 481 - if (nullable.length > 0) { 482 - result.nullable = nullable; 483 - } 484 - return result; 485 - }, 486 - /** 487 - * Creates a params type for query string parameters. 488 - * @see https://atproto.com/specs/lexicon#params 489 - */ 490 - params<Properties extends ParamsProperties>( 491 - properties: Properties, 492 - ): ParamsResult<Properties> { 493 - const required = Object.keys(properties).filter( 494 - (key) => properties[key].required, 495 - ); 496 - const result: { 497 - type: "params"; 498 - properties: Properties; 499 - required?: string[]; 500 - } = { 501 - type: "params", 502 - properties, 503 - }; 504 - if (required.length > 0) { 505 - result.required = required; 506 - } 507 - return result; 508 - }, 509 - /** 510 - * Creates a query endpoint definition (HTTP GET). 511 - * @see https://atproto.com/specs/lexicon#query 512 - */ 513 - query<T extends QueryOptions>(options?: T): T & { type: "query" } { 514 - return { 515 - type: "query", 516 - ...options, 517 - } as T & { type: "query" }; 518 - }, 519 - /** 520 - * Creates a procedure endpoint definition (HTTP POST). 521 - * @see https://atproto.com/specs/lexicon#procedure 522 - */ 523 - procedure<T extends ProcedureOptions>( 524 - options?: T, 525 - ): T & { type: "procedure" } { 526 - return { 527 - type: "procedure", 528 - ...options, 529 - } as T & { type: "procedure" }; 530 - }, 531 - /** 532 - * Creates a subscription endpoint definition (WebSocket). 533 - * @see https://atproto.com/specs/lexicon#subscription 534 - */ 535 - subscription<T extends SubscriptionOptions>( 536 - options?: T, 537 - ): T & { type: "subscription" } { 538 - return { 539 - type: "subscription", 540 - ...options, 541 - } as T & { type: "subscription" }; 542 - }, 543 - /** 544 - * Creates a lexicon namespace document. 545 - * @see https://atproto.com/specs/lexicon#lexicon-document 546 - */ 547 - namespace<ID extends string, D extends LexiconNamespace["defs"]>( 548 - id: ID, 549 - defs: D, 550 - ): { lexicon: 1; id: ID; defs: D } { 551 - return { 552 - lexicon: 1, 553 - id, 554 - defs, 555 - }; 556 - }, 312 + /** 313 + * Creates a null type. 314 + * @see https://atproto.com/specs/lexicon#null 315 + */ 316 + null( 317 + options?: LexiconItemCommonOptions, 318 + ): { type: "null" } & LexiconItemCommonOptions { 319 + return { 320 + type: "null", 321 + ...options, 322 + }; 323 + }, 324 + /** 325 + * Creates a boolean type with optional constraints. 326 + * @see https://atproto.com/specs/lexicon#boolean 327 + */ 328 + boolean<T extends BooleanOptions>(options?: T): T & { type: "boolean" } { 329 + return { 330 + type: "boolean", 331 + ...options, 332 + } as T & { type: "boolean" }; 333 + }, 334 + /** 335 + * Creates an integer type with optional min/max and enum constraints. 336 + * @see https://atproto.com/specs/lexicon#integer 337 + */ 338 + integer<T extends IntegerOptions>(options?: T): T & { type: "integer" } { 339 + return { 340 + type: "integer", 341 + ...options, 342 + } as T & { type: "integer" }; 343 + }, 344 + /** 345 + * Creates a string type with optional format, length, and value constraints. 346 + * @see https://atproto.com/specs/lexicon#string 347 + */ 348 + string<T extends StringOptions>(options?: T): T & { type: "string" } { 349 + return { 350 + type: "string", 351 + ...options, 352 + } as T & { type: "string" }; 353 + }, 354 + /** 355 + * Creates an unknown type for flexible, unvalidated objects. 356 + * @see https://atproto.com/specs/lexicon#unknown 357 + */ 358 + unknown( 359 + options?: LexiconItemCommonOptions, 360 + ): { type: "unknown" } & LexiconItemCommonOptions { 361 + return { 362 + type: "unknown", 363 + ...options, 364 + }; 365 + }, 366 + /** 367 + * Creates a bytes type for arbitrary byte arrays. 368 + * @see https://atproto.com/specs/lexicon#bytes 369 + */ 370 + bytes<T extends BytesOptions>(options?: T): T & { type: "bytes" } { 371 + return { 372 + type: "bytes", 373 + ...options, 374 + } as T & { type: "bytes" }; 375 + }, 376 + /** 377 + * Creates a CID link reference to content-addressed data. 378 + * @see https://atproto.com/specs/lexicon#cid-link 379 + */ 380 + cidLink<Link extends string>(link: Link): { type: "cid-link"; $link: Link } { 381 + return { 382 + type: "cid-link", 383 + $link: link, 384 + }; 385 + }, 386 + /** 387 + * Creates a blob type for binary data with MIME type constraints. 388 + * @see https://atproto.com/specs/lexicon#blob 389 + */ 390 + blob<T extends BlobOptions>(options?: T): T & { type: "blob" } { 391 + return { 392 + type: "blob", 393 + ...options, 394 + } as T & { type: "blob" }; 395 + }, 396 + /** 397 + * Creates an array type with item schema and length constraints. 398 + * @see https://atproto.com/specs/lexicon#array 399 + */ 400 + array<Items extends LexiconItem, Options extends ArrayOptions>( 401 + items: Items, 402 + options?: Options, 403 + ): Options & { type: "array"; items: Items } { 404 + return { 405 + type: "array", 406 + items, 407 + ...options, 408 + } as Options & { type: "array"; items: Items }; 409 + }, 410 + /** 411 + * Creates a token type for symbolic values in unions. 412 + * @see https://atproto.com/specs/lexicon#token 413 + */ 414 + token<Description extends string>( 415 + description: Description, 416 + ): { type: "token"; description: Description } { 417 + return { type: "token", description }; 418 + }, 419 + /** 420 + * Creates a reference to another schema definition. 421 + * @see https://atproto.com/specs/lexicon#ref 422 + */ 423 + ref<Ref extends string>( 424 + ref: Ref, 425 + options?: LexiconItemCommonOptions, 426 + ): LexiconItemCommonOptions & { type: "ref"; ref: Ref } { 427 + return { 428 + type: "ref", 429 + ref, 430 + ...options, 431 + } as LexiconItemCommonOptions & { type: "ref"; ref: Ref }; 432 + }, 433 + /** 434 + * Creates a union type for multiple possible type variants. 435 + * @see https://atproto.com/specs/lexicon#union 436 + */ 437 + union<const Refs extends readonly string[], Options extends UnionOptions>( 438 + refs: Refs, 439 + options?: Options, 440 + ): Options & { type: "union"; refs: Refs } { 441 + return { 442 + type: "union", 443 + refs, 444 + ...options, 445 + } as Options & { type: "union"; refs: Refs }; 446 + }, 447 + /** 448 + * Creates a record type for repository records. 449 + * @see https://atproto.com/specs/lexicon#record 450 + */ 451 + record<T extends RecordOptions>(options: T): T & { type: "record" } { 452 + return { 453 + type: "record", 454 + ...options, 455 + }; 456 + }, 457 + /** 458 + * Creates an object type with defined properties. 459 + * @see https://atproto.com/specs/lexicon#object 460 + */ 461 + object<T extends ObjectProperties>(options: T): ObjectResult<T> { 462 + const required = Object.keys(options).filter( 463 + (key) => options[key].required, 464 + ); 465 + const nullable = Object.keys(options).filter( 466 + (key) => options[key].nullable, 467 + ); 468 + const result: ObjectResult<T> = { 469 + type: "object", 470 + properties: options, 471 + }; 472 + if (required.length > 0) { 473 + result.required = required; 474 + } 475 + if (nullable.length > 0) { 476 + result.nullable = nullable; 477 + } 478 + return result; 479 + }, 480 + /** 481 + * Creates a params type for query string parameters. 482 + * @see https://atproto.com/specs/lexicon#params 483 + */ 484 + params<Properties extends ParamsProperties>( 485 + properties: Properties, 486 + ): ParamsResult<Properties> { 487 + const required = Object.keys(properties).filter( 488 + (key) => properties[key].required, 489 + ); 490 + const result: { 491 + type: "params"; 492 + properties: Properties; 493 + required?: string[]; 494 + } = { 495 + type: "params", 496 + properties, 497 + }; 498 + if (required.length > 0) { 499 + result.required = required; 500 + } 501 + return result; 502 + }, 503 + /** 504 + * Creates a query endpoint definition (HTTP GET). 505 + * @see https://atproto.com/specs/lexicon#query 506 + */ 507 + query<T extends QueryOptions>(options?: T): T & { type: "query" } { 508 + return { 509 + type: "query", 510 + ...options, 511 + } as T & { type: "query" }; 512 + }, 513 + /** 514 + * Creates a procedure endpoint definition (HTTP POST). 515 + * @see https://atproto.com/specs/lexicon#procedure 516 + */ 517 + procedure<T extends ProcedureOptions>( 518 + options?: T, 519 + ): T & { type: "procedure" } { 520 + return { 521 + type: "procedure", 522 + ...options, 523 + } as T & { type: "procedure" }; 524 + }, 525 + /** 526 + * Creates a subscription endpoint definition (WebSocket). 527 + * @see https://atproto.com/specs/lexicon#subscription 528 + */ 529 + subscription<T extends SubscriptionOptions>( 530 + options?: T, 531 + ): T & { type: "subscription" } { 532 + return { 533 + type: "subscription", 534 + ...options, 535 + } as T & { type: "subscription" }; 536 + }, 537 + /** 538 + * Creates a lexicon namespace document. 539 + * @see https://atproto.com/specs/lexicon#lexicon-document 540 + */ 541 + namespace<ID extends string, D extends LexiconNamespace["defs"]>( 542 + id: ID, 543 + defs: D, 544 + ): { lexicon: 1; id: ID; defs: D } { 545 + return { 546 + lexicon: 1, 547 + id, 548 + defs, 549 + }; 550 + }, 557 551 };
+3
src/test.ts
··· 1 + import type schema from "../samples/demo.json"; 2 + import type { InferNS } from "./infer.ts"; 3 + export type Schema = InferNS<typeof schema>;
+41
src/tests/base-case.test.ts
··· 1 + import { strict as assert } from "node:assert"; 2 + import { test } from "node:test"; 3 + import { lx } from "../lib.ts"; 4 + 5 + test("app.bsky.actor.profile", () => { 6 + const profileNamespace = lx.namespace("app.bsky.actor.profile", { 7 + main: lx.record({ 8 + key: "self", 9 + record: lx.object({ 10 + displayName: lx.string({ maxLength: 64, maxGraphemes: 64 }), 11 + description: lx.string({ maxLength: 256, maxGraphemes: 256 }), 12 + }), 13 + }), 14 + }); 15 + 16 + assert.deepEqual(profileNamespace, { 17 + lexicon: 1, 18 + id: "app.bsky.actor.profile", 19 + defs: { 20 + main: { 21 + type: "record", 22 + key: "self", 23 + record: { 24 + type: "object", 25 + properties: { 26 + displayName: { 27 + type: "string", 28 + maxLength: 64, 29 + maxGraphemes: 64, 30 + }, 31 + description: { 32 + type: "string", 33 + maxLength: 256, 34 + maxGraphemes: 256, 35 + }, 36 + }, 37 + }, 38 + }, 39 + }, 40 + }); 41 + });
+868
src/tests/bsky-actor.test.ts
··· 1 + import { strict as assert } from "node:assert"; 2 + import { test } from "node:test"; 3 + import { lx } from "../lib.ts"; 4 + 5 + test("app.bsky.actor.defs - profileViewBasic", () => { 6 + const profileViewBasic = lx.object({ 7 + did: lx.string({ required: true, format: "did" }), 8 + handle: lx.string({ required: true, format: "handle" }), 9 + displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 10 + pronouns: lx.string(), 11 + avatar: lx.string({ format: "uri" }), 12 + associated: lx.ref("#profileAssociated"), 13 + viewer: lx.ref("#viewerState"), 14 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 15 + createdAt: lx.string({ format: "datetime" }), 16 + verification: lx.ref("#verificationState"), 17 + status: lx.ref("#statusView"), 18 + }); 19 + 20 + assert.deepEqual(profileViewBasic, { 21 + type: "object", 22 + properties: { 23 + did: { type: "string", required: true, format: "did" }, 24 + handle: { type: "string", required: true, format: "handle" }, 25 + displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 26 + pronouns: { type: "string" }, 27 + avatar: { type: "string", format: "uri" }, 28 + associated: { type: "ref", ref: "#profileAssociated" }, 29 + viewer: { type: "ref", ref: "#viewerState" }, 30 + labels: { 31 + type: "array", 32 + items: { type: "ref", ref: "com.atproto.label.defs#label" }, 33 + }, 34 + createdAt: { type: "string", format: "datetime" }, 35 + verification: { type: "ref", ref: "#verificationState" }, 36 + status: { type: "ref", ref: "#statusView" }, 37 + }, 38 + required: ["did", "handle"], 39 + }); 40 + }); 41 + 42 + test("app.bsky.actor.defs - profileView", () => { 43 + const profileView = lx.object({ 44 + did: lx.string({ required: true, format: "did" }), 45 + handle: lx.string({ required: true, format: "handle" }), 46 + displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 47 + pronouns: lx.string(), 48 + description: lx.string({ maxGraphemes: 256, maxLength: 2560 }), 49 + avatar: lx.string({ format: "uri" }), 50 + associated: lx.ref("#profileAssociated"), 51 + indexedAt: lx.string({ format: "datetime" }), 52 + createdAt: lx.string({ format: "datetime" }), 53 + viewer: lx.ref("#viewerState"), 54 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 55 + verification: lx.ref("#verificationState"), 56 + status: lx.ref("#statusView"), 57 + }); 58 + 59 + assert.deepEqual(profileView, { 60 + type: "object", 61 + properties: { 62 + did: { type: "string", required: true, format: "did" }, 63 + handle: { type: "string", required: true, format: "handle" }, 64 + displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 65 + pronouns: { type: "string" }, 66 + description: { type: "string", maxGraphemes: 256, maxLength: 2560 }, 67 + avatar: { type: "string", format: "uri" }, 68 + associated: { type: "ref", ref: "#profileAssociated" }, 69 + indexedAt: { type: "string", format: "datetime" }, 70 + createdAt: { type: "string", format: "datetime" }, 71 + viewer: { type: "ref", ref: "#viewerState" }, 72 + labels: { 73 + type: "array", 74 + items: { type: "ref", ref: "com.atproto.label.defs#label" }, 75 + }, 76 + verification: { type: "ref", ref: "#verificationState" }, 77 + status: { type: "ref", ref: "#statusView" }, 78 + }, 79 + required: ["did", "handle"], 80 + }); 81 + }); 82 + 83 + test("app.bsky.actor.defs - profileViewDetailed", () => { 84 + const profileViewDetailed = lx.object({ 85 + did: lx.string({ required: true, format: "did" }), 86 + handle: lx.string({ required: true, format: "handle" }), 87 + displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 88 + description: lx.string({ maxGraphemes: 256, maxLength: 2560 }), 89 + pronouns: lx.string(), 90 + website: lx.string({ format: "uri" }), 91 + avatar: lx.string({ format: "uri" }), 92 + banner: lx.string({ format: "uri" }), 93 + followersCount: lx.integer(), 94 + followsCount: lx.integer(), 95 + postsCount: lx.integer(), 96 + associated: lx.ref("#profileAssociated"), 97 + joinedViaStarterPack: lx.ref("app.bsky.graph.defs#starterPackViewBasic"), 98 + indexedAt: lx.string({ format: "datetime" }), 99 + createdAt: lx.string({ format: "datetime" }), 100 + viewer: lx.ref("#viewerState"), 101 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 102 + pinnedPost: lx.ref("com.atproto.repo.strongRef"), 103 + verification: lx.ref("#verificationState"), 104 + status: lx.ref("#statusView"), 105 + }); 106 + 107 + assert.deepEqual(profileViewDetailed, { 108 + type: "object", 109 + properties: { 110 + did: { type: "string", required: true, format: "did" }, 111 + handle: { type: "string", required: true, format: "handle" }, 112 + displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 113 + description: { type: "string", maxGraphemes: 256, maxLength: 2560 }, 114 + pronouns: { type: "string" }, 115 + website: { type: "string", format: "uri" }, 116 + avatar: { type: "string", format: "uri" }, 117 + banner: { type: "string", format: "uri" }, 118 + followersCount: { type: "integer" }, 119 + followsCount: { type: "integer" }, 120 + postsCount: { type: "integer" }, 121 + associated: { type: "ref", ref: "#profileAssociated" }, 122 + joinedViaStarterPack: { 123 + type: "ref", 124 + ref: "app.bsky.graph.defs#starterPackViewBasic", 125 + }, 126 + indexedAt: { type: "string", format: "datetime" }, 127 + createdAt: { type: "string", format: "datetime" }, 128 + viewer: { type: "ref", ref: "#viewerState" }, 129 + labels: { 130 + type: "array", 131 + items: { type: "ref", ref: "com.atproto.label.defs#label" }, 132 + }, 133 + pinnedPost: { type: "ref", ref: "com.atproto.repo.strongRef" }, 134 + verification: { type: "ref", ref: "#verificationState" }, 135 + status: { type: "ref", ref: "#statusView" }, 136 + }, 137 + required: ["did", "handle"], 138 + }); 139 + }); 140 + 141 + test("app.bsky.actor.defs - profileAssociated", () => { 142 + const profileAssociated = lx.object({ 143 + lists: lx.integer(), 144 + feedgens: lx.integer(), 145 + starterPacks: lx.integer(), 146 + labeler: lx.boolean(), 147 + chat: lx.ref("#profileAssociatedChat"), 148 + activitySubscription: lx.ref("#profileAssociatedActivitySubscription"), 149 + }); 150 + 151 + assert.deepEqual(profileAssociated, { 152 + type: "object", 153 + properties: { 154 + lists: { type: "integer" }, 155 + feedgens: { type: "integer" }, 156 + starterPacks: { type: "integer" }, 157 + labeler: { type: "boolean" }, 158 + chat: { type: "ref", ref: "#profileAssociatedChat" }, 159 + activitySubscription: { 160 + type: "ref", 161 + ref: "#profileAssociatedActivitySubscription", 162 + }, 163 + }, 164 + }); 165 + }); 166 + 167 + test("app.bsky.actor.defs - profileAssociatedChat", () => { 168 + const profileAssociatedChat = lx.object({ 169 + allowIncoming: lx.string({ 170 + required: true, 171 + knownValues: ["all", "none", "following"], 172 + }), 173 + }); 174 + 175 + assert.deepEqual(profileAssociatedChat, { 176 + type: "object", 177 + properties: { 178 + allowIncoming: { 179 + type: "string", 180 + required: true, 181 + knownValues: ["all", "none", "following"], 182 + }, 183 + }, 184 + required: ["allowIncoming"], 185 + }); 186 + }); 187 + 188 + test("app.bsky.actor.defs - profileAssociatedActivitySubscription", () => { 189 + const profileAssociatedActivitySubscription = lx.object({ 190 + allowSubscriptions: lx.string({ 191 + required: true, 192 + knownValues: ["followers", "mutuals", "none"], 193 + }), 194 + }); 195 + 196 + assert.deepEqual(profileAssociatedActivitySubscription, { 197 + type: "object", 198 + properties: { 199 + allowSubscriptions: { 200 + type: "string", 201 + required: true, 202 + knownValues: ["followers", "mutuals", "none"], 203 + }, 204 + }, 205 + required: ["allowSubscriptions"], 206 + }); 207 + }); 208 + 209 + test("app.bsky.actor.defs - viewerState", () => { 210 + const viewerState = lx.object({ 211 + muted: lx.boolean(), 212 + mutedByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 213 + blockedBy: lx.boolean(), 214 + blocking: lx.string({ format: "at-uri" }), 215 + blockingByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 216 + following: lx.string({ format: "at-uri" }), 217 + followedBy: lx.string({ format: "at-uri" }), 218 + knownFollowers: lx.ref("#knownFollowers"), 219 + activitySubscription: lx.ref( 220 + "app.bsky.notification.defs#activitySubscription", 221 + ), 222 + }); 223 + 224 + assert.deepEqual(viewerState, { 225 + type: "object", 226 + properties: { 227 + muted: { type: "boolean" }, 228 + mutedByList: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 229 + blockedBy: { type: "boolean" }, 230 + blocking: { type: "string", format: "at-uri" }, 231 + blockingByList: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 232 + following: { type: "string", format: "at-uri" }, 233 + followedBy: { type: "string", format: "at-uri" }, 234 + knownFollowers: { type: "ref", ref: "#knownFollowers" }, 235 + activitySubscription: { 236 + type: "ref", 237 + ref: "app.bsky.notification.defs#activitySubscription", 238 + }, 239 + }, 240 + }); 241 + }); 242 + 243 + test("app.bsky.actor.defs - knownFollowers", () => { 244 + const knownFollowers = lx.object({ 245 + count: lx.integer({ required: true }), 246 + followers: lx.array(lx.ref("#profileViewBasic"), { 247 + required: true, 248 + minLength: 0, 249 + maxLength: 5, 250 + }), 251 + }); 252 + 253 + assert.deepEqual(knownFollowers, { 254 + type: "object", 255 + properties: { 256 + count: { type: "integer", required: true }, 257 + followers: { 258 + type: "array", 259 + items: { type: "ref", ref: "#profileViewBasic" }, 260 + required: true, 261 + minLength: 0, 262 + maxLength: 5, 263 + }, 264 + }, 265 + required: ["count", "followers"], 266 + }); 267 + }); 268 + 269 + test("app.bsky.actor.defs - verificationState", () => { 270 + const verificationState = lx.object({ 271 + verifications: lx.array(lx.ref("#verificationView"), { required: true }), 272 + verifiedStatus: lx.string({ 273 + required: true, 274 + knownValues: ["valid", "invalid", "none"], 275 + }), 276 + trustedVerifierStatus: lx.string({ 277 + required: true, 278 + knownValues: ["valid", "invalid", "none"], 279 + }), 280 + }); 281 + 282 + assert.deepEqual(verificationState, { 283 + type: "object", 284 + properties: { 285 + verifications: { 286 + type: "array", 287 + items: { type: "ref", ref: "#verificationView" }, 288 + required: true, 289 + }, 290 + verifiedStatus: { 291 + type: "string", 292 + required: true, 293 + knownValues: ["valid", "invalid", "none"], 294 + }, 295 + trustedVerifierStatus: { 296 + type: "string", 297 + required: true, 298 + knownValues: ["valid", "invalid", "none"], 299 + }, 300 + }, 301 + required: ["verifications", "verifiedStatus", "trustedVerifierStatus"], 302 + }); 303 + }); 304 + 305 + test("app.bsky.actor.defs - verificationView", () => { 306 + const verificationView = lx.object({ 307 + issuer: lx.string({ required: true, format: "did" }), 308 + uri: lx.string({ required: true, format: "at-uri" }), 309 + isValid: lx.boolean({ required: true }), 310 + createdAt: lx.string({ required: true, format: "datetime" }), 311 + }); 312 + 313 + assert.deepEqual(verificationView, { 314 + type: "object", 315 + properties: { 316 + issuer: { type: "string", required: true, format: "did" }, 317 + uri: { type: "string", required: true, format: "at-uri" }, 318 + isValid: { type: "boolean", required: true }, 319 + createdAt: { type: "string", required: true, format: "datetime" }, 320 + }, 321 + required: ["issuer", "uri", "isValid", "createdAt"], 322 + }); 323 + }); 324 + 325 + test("app.bsky.actor.defs - preferences", () => { 326 + const preferences = lx.array( 327 + lx.union([ 328 + "#adultContentPref", 329 + "#contentLabelPref", 330 + "#savedFeedsPref", 331 + "#savedFeedsPrefV2", 332 + "#personalDetailsPref", 333 + "#feedViewPref", 334 + "#threadViewPref", 335 + "#interestsPref", 336 + "#mutedWordsPref", 337 + "#hiddenPostsPref", 338 + "#bskyAppStatePref", 339 + "#labelersPref", 340 + "#postInteractionSettingsPref", 341 + "#verificationPrefs", 342 + ]), 343 + ); 344 + 345 + assert.deepEqual(preferences, { 346 + type: "array", 347 + items: { 348 + type: "union", 349 + refs: [ 350 + "#adultContentPref", 351 + "#contentLabelPref", 352 + "#savedFeedsPref", 353 + "#savedFeedsPrefV2", 354 + "#personalDetailsPref", 355 + "#feedViewPref", 356 + "#threadViewPref", 357 + "#interestsPref", 358 + "#mutedWordsPref", 359 + "#hiddenPostsPref", 360 + "#bskyAppStatePref", 361 + "#labelersPref", 362 + "#postInteractionSettingsPref", 363 + "#verificationPrefs", 364 + ], 365 + }, 366 + }); 367 + }); 368 + 369 + test("app.bsky.actor.defs - adultContentPref", () => { 370 + const adultContentPref = lx.object({ 371 + enabled: lx.boolean({ required: true, default: false }), 372 + }); 373 + 374 + assert.deepEqual(adultContentPref, { 375 + type: "object", 376 + properties: { 377 + enabled: { type: "boolean", required: true, default: false }, 378 + }, 379 + required: ["enabled"], 380 + }); 381 + }); 382 + 383 + test("app.bsky.actor.defs - contentLabelPref", () => { 384 + const contentLabelPref = lx.object({ 385 + labelerDid: lx.string({ format: "did" }), 386 + label: lx.string({ required: true }), 387 + visibility: lx.string({ 388 + required: true, 389 + knownValues: ["ignore", "show", "warn", "hide"], 390 + }), 391 + }); 392 + 393 + assert.deepEqual(contentLabelPref, { 394 + type: "object", 395 + properties: { 396 + labelerDid: { type: "string", format: "did" }, 397 + label: { type: "string", required: true }, 398 + visibility: { 399 + type: "string", 400 + required: true, 401 + knownValues: ["ignore", "show", "warn", "hide"], 402 + }, 403 + }, 404 + required: ["label", "visibility"], 405 + }); 406 + }); 407 + 408 + test("app.bsky.actor.defs - savedFeed", () => { 409 + const savedFeed = lx.object({ 410 + id: lx.string({ required: true }), 411 + type: lx.string({ 412 + required: true, 413 + knownValues: ["feed", "list", "timeline"], 414 + }), 415 + value: lx.string({ required: true }), 416 + pinned: lx.boolean({ required: true }), 417 + }); 418 + 419 + assert.deepEqual(savedFeed, { 420 + type: "object", 421 + properties: { 422 + id: { type: "string", required: true }, 423 + type: { 424 + type: "string", 425 + required: true, 426 + knownValues: ["feed", "list", "timeline"], 427 + }, 428 + value: { type: "string", required: true }, 429 + pinned: { type: "boolean", required: true }, 430 + }, 431 + required: ["id", "type", "value", "pinned"], 432 + }); 433 + }); 434 + 435 + test("app.bsky.actor.defs - savedFeedsPrefV2", () => { 436 + const savedFeedsPrefV2 = lx.object({ 437 + items: lx.array(lx.ref("app.bsky.actor.defs#savedFeed"), { 438 + required: true, 439 + }), 440 + }); 441 + 442 + assert.deepEqual(savedFeedsPrefV2, { 443 + type: "object", 444 + properties: { 445 + items: { 446 + type: "array", 447 + items: { type: "ref", ref: "app.bsky.actor.defs#savedFeed" }, 448 + required: true, 449 + }, 450 + }, 451 + required: ["items"], 452 + }); 453 + }); 454 + 455 + test("app.bsky.actor.defs - savedFeedsPref", () => { 456 + const savedFeedsPref = lx.object({ 457 + pinned: lx.array(lx.string({ format: "at-uri" }), { required: true }), 458 + saved: lx.array(lx.string({ format: "at-uri" }), { required: true }), 459 + timelineIndex: lx.integer(), 460 + }); 461 + 462 + assert.deepEqual(savedFeedsPref, { 463 + type: "object", 464 + properties: { 465 + pinned: { 466 + type: "array", 467 + items: { type: "string", format: "at-uri" }, 468 + required: true, 469 + }, 470 + saved: { 471 + type: "array", 472 + items: { type: "string", format: "at-uri" }, 473 + required: true, 474 + }, 475 + timelineIndex: { type: "integer" }, 476 + }, 477 + required: ["pinned", "saved"], 478 + }); 479 + }); 480 + 481 + test("app.bsky.actor.defs - personalDetailsPref", () => { 482 + const personalDetailsPref = lx.object({ 483 + birthDate: lx.string({ format: "datetime" }), 484 + }); 485 + 486 + assert.deepEqual(personalDetailsPref, { 487 + type: "object", 488 + properties: { 489 + birthDate: { type: "string", format: "datetime" }, 490 + }, 491 + }); 492 + }); 493 + 494 + test("app.bsky.actor.defs - feedViewPref", () => { 495 + const feedViewPref = lx.object({ 496 + feed: lx.string({ required: true }), 497 + hideReplies: lx.boolean(), 498 + hideRepliesByUnfollowed: lx.boolean({ default: true }), 499 + hideRepliesByLikeCount: lx.integer(), 500 + hideReposts: lx.boolean(), 501 + hideQuotePosts: lx.boolean(), 502 + }); 503 + 504 + assert.deepEqual(feedViewPref, { 505 + type: "object", 506 + properties: { 507 + feed: { type: "string", required: true }, 508 + hideReplies: { type: "boolean" }, 509 + hideRepliesByUnfollowed: { type: "boolean", default: true }, 510 + hideRepliesByLikeCount: { type: "integer" }, 511 + hideReposts: { type: "boolean" }, 512 + hideQuotePosts: { type: "boolean" }, 513 + }, 514 + required: ["feed"], 515 + }); 516 + }); 517 + 518 + test("app.bsky.actor.defs - threadViewPref", () => { 519 + const threadViewPref = lx.object({ 520 + sort: lx.string({ 521 + knownValues: ["oldest", "newest", "most-likes", "random", "hotness"], 522 + }), 523 + prioritizeFollowedUsers: lx.boolean(), 524 + }); 525 + 526 + assert.deepEqual(threadViewPref, { 527 + type: "object", 528 + properties: { 529 + sort: { 530 + type: "string", 531 + knownValues: ["oldest", "newest", "most-likes", "random", "hotness"], 532 + }, 533 + prioritizeFollowedUsers: { type: "boolean" }, 534 + }, 535 + }); 536 + }); 537 + 538 + test("app.bsky.actor.defs - interestsPref", () => { 539 + const interestsPref = lx.object({ 540 + tags: lx.array(lx.string({ maxLength: 640, maxGraphemes: 64 }), { 541 + required: true, 542 + maxLength: 100, 543 + }), 544 + }); 545 + 546 + assert.deepEqual(interestsPref, { 547 + type: "object", 548 + properties: { 549 + tags: { 550 + type: "array", 551 + items: { type: "string", maxLength: 640, maxGraphemes: 64 }, 552 + required: true, 553 + maxLength: 100, 554 + }, 555 + }, 556 + required: ["tags"], 557 + }); 558 + }); 559 + 560 + test("app.bsky.actor.defs - mutedWordTarget", () => { 561 + const mutedWordTarget = lx.string({ 562 + knownValues: ["content", "tag"], 563 + maxLength: 640, 564 + maxGraphemes: 64, 565 + }); 566 + 567 + assert.deepEqual(mutedWordTarget, { 568 + type: "string", 569 + knownValues: ["content", "tag"], 570 + maxLength: 640, 571 + maxGraphemes: 64, 572 + }); 573 + }); 574 + 575 + test("app.bsky.actor.defs - mutedWord", () => { 576 + const mutedWord = lx.object({ 577 + id: lx.string(), 578 + value: lx.string({ required: true, maxLength: 10000, maxGraphemes: 1000 }), 579 + targets: lx.array(lx.ref("app.bsky.actor.defs#mutedWordTarget"), { 580 + required: true, 581 + }), 582 + actorTarget: lx.string({ 583 + knownValues: ["all", "exclude-following"], 584 + default: "all", 585 + }), 586 + expiresAt: lx.string({ format: "datetime" }), 587 + }); 588 + 589 + assert.deepEqual(mutedWord, { 590 + type: "object", 591 + properties: { 592 + id: { type: "string" }, 593 + value: { 594 + type: "string", 595 + required: true, 596 + maxLength: 10000, 597 + maxGraphemes: 1000, 598 + }, 599 + targets: { 600 + type: "array", 601 + items: { type: "ref", ref: "app.bsky.actor.defs#mutedWordTarget" }, 602 + required: true, 603 + }, 604 + actorTarget: { 605 + type: "string", 606 + knownValues: ["all", "exclude-following"], 607 + default: "all", 608 + }, 609 + expiresAt: { type: "string", format: "datetime" }, 610 + }, 611 + required: ["value", "targets"], 612 + }); 613 + }); 614 + 615 + test("app.bsky.actor.defs - mutedWordsPref", () => { 616 + const mutedWordsPref = lx.object({ 617 + items: lx.array(lx.ref("app.bsky.actor.defs#mutedWord"), { 618 + required: true, 619 + }), 620 + }); 621 + 622 + assert.deepEqual(mutedWordsPref, { 623 + type: "object", 624 + properties: { 625 + items: { 626 + type: "array", 627 + items: { type: "ref", ref: "app.bsky.actor.defs#mutedWord" }, 628 + required: true, 629 + }, 630 + }, 631 + required: ["items"], 632 + }); 633 + }); 634 + 635 + test("app.bsky.actor.defs - hiddenPostsPref", () => { 636 + const hiddenPostsPref = lx.object({ 637 + items: lx.array(lx.string({ format: "at-uri" }), { required: true }), 638 + }); 639 + 640 + assert.deepEqual(hiddenPostsPref, { 641 + type: "object", 642 + properties: { 643 + items: { 644 + type: "array", 645 + items: { type: "string", format: "at-uri" }, 646 + required: true, 647 + }, 648 + }, 649 + required: ["items"], 650 + }); 651 + }); 652 + 653 + test("app.bsky.actor.defs - labelersPref", () => { 654 + const labelersPref = lx.object({ 655 + labelers: lx.array(lx.ref("#labelerPrefItem"), { required: true }), 656 + }); 657 + 658 + assert.deepEqual(labelersPref, { 659 + type: "object", 660 + properties: { 661 + labelers: { 662 + type: "array", 663 + items: { type: "ref", ref: "#labelerPrefItem" }, 664 + required: true, 665 + }, 666 + }, 667 + required: ["labelers"], 668 + }); 669 + }); 670 + 671 + test("app.bsky.actor.defs - labelerPrefItem", () => { 672 + const labelerPrefItem = lx.object({ 673 + did: lx.string({ required: true, format: "did" }), 674 + }); 675 + 676 + assert.deepEqual(labelerPrefItem, { 677 + type: "object", 678 + properties: { 679 + did: { type: "string", required: true, format: "did" }, 680 + }, 681 + required: ["did"], 682 + }); 683 + }); 684 + 685 + test("app.bsky.actor.defs - bskyAppStatePref", () => { 686 + const bskyAppStatePref = lx.object({ 687 + activeProgressGuide: lx.ref("#bskyAppProgressGuide"), 688 + queuedNudges: lx.array(lx.string({ maxLength: 100 }), { maxLength: 1000 }), 689 + nuxs: lx.array(lx.ref("app.bsky.actor.defs#nux"), { maxLength: 100 }), 690 + }); 691 + 692 + assert.deepEqual(bskyAppStatePref, { 693 + type: "object", 694 + properties: { 695 + activeProgressGuide: { type: "ref", ref: "#bskyAppProgressGuide" }, 696 + queuedNudges: { 697 + type: "array", 698 + items: { type: "string", maxLength: 100 }, 699 + maxLength: 1000, 700 + }, 701 + nuxs: { 702 + type: "array", 703 + items: { type: "ref", ref: "app.bsky.actor.defs#nux" }, 704 + maxLength: 100, 705 + }, 706 + }, 707 + }); 708 + }); 709 + 710 + test("app.bsky.actor.defs - bskyAppProgressGuide", () => { 711 + const bskyAppProgressGuide = lx.object({ 712 + guide: lx.string({ required: true, maxLength: 100 }), 713 + }); 714 + 715 + assert.deepEqual(bskyAppProgressGuide, { 716 + type: "object", 717 + properties: { 718 + guide: { type: "string", required: true, maxLength: 100 }, 719 + }, 720 + required: ["guide"], 721 + }); 722 + }); 723 + 724 + test("app.bsky.actor.defs - nux", () => { 725 + const nux = lx.object({ 726 + id: lx.string({ required: true, maxLength: 100 }), 727 + completed: lx.boolean({ required: true, default: false }), 728 + data: lx.string({ maxLength: 3000, maxGraphemes: 300 }), 729 + expiresAt: lx.string({ format: "datetime" }), 730 + }); 731 + 732 + assert.deepEqual(nux, { 733 + type: "object", 734 + properties: { 735 + id: { type: "string", required: true, maxLength: 100 }, 736 + completed: { type: "boolean", required: true, default: false }, 737 + data: { type: "string", maxLength: 3000, maxGraphemes: 300 }, 738 + expiresAt: { type: "string", format: "datetime" }, 739 + }, 740 + required: ["id", "completed"], 741 + }); 742 + }); 743 + 744 + test("app.bsky.actor.defs - verificationPrefs", () => { 745 + const verificationPrefs = lx.object({ 746 + hideBadges: lx.boolean({ default: false }), 747 + }); 748 + 749 + assert.deepEqual(verificationPrefs, { 750 + type: "object", 751 + properties: { 752 + hideBadges: { type: "boolean", default: false }, 753 + }, 754 + }); 755 + }); 756 + 757 + test("app.bsky.actor.defs - postInteractionSettingsPref", () => { 758 + const postInteractionSettingsPref = lx.object({ 759 + threadgateAllowRules: lx.array( 760 + lx.union([ 761 + "app.bsky.feed.threadgate#mentionRule", 762 + "app.bsky.feed.threadgate#followerRule", 763 + "app.bsky.feed.threadgate#followingRule", 764 + "app.bsky.feed.threadgate#listRule", 765 + ]), 766 + { maxLength: 5 }, 767 + ), 768 + postgateEmbeddingRules: lx.array( 769 + lx.union(["app.bsky.feed.postgate#disableRule"]), 770 + { maxLength: 5 }, 771 + ), 772 + }); 773 + 774 + assert.deepEqual(postInteractionSettingsPref, { 775 + type: "object", 776 + properties: { 777 + threadgateAllowRules: { 778 + type: "array", 779 + items: { 780 + type: "union", 781 + refs: [ 782 + "app.bsky.feed.threadgate#mentionRule", 783 + "app.bsky.feed.threadgate#followerRule", 784 + "app.bsky.feed.threadgate#followingRule", 785 + "app.bsky.feed.threadgate#listRule", 786 + ], 787 + }, 788 + maxLength: 5, 789 + }, 790 + postgateEmbeddingRules: { 791 + type: "array", 792 + items: { 793 + type: "union", 794 + refs: ["app.bsky.feed.postgate#disableRule"], 795 + }, 796 + maxLength: 5, 797 + }, 798 + }, 799 + }); 800 + }); 801 + 802 + test("app.bsky.actor.defs - statusView", () => { 803 + const statusView = lx.object({ 804 + status: lx.string({ 805 + required: true, 806 + knownValues: ["app.bsky.actor.status#live"], 807 + }), 808 + record: lx.unknown({ required: true }), 809 + embed: lx.union(["app.bsky.embed.external#view"]), 810 + expiresAt: lx.string({ format: "datetime" }), 811 + isActive: lx.boolean(), 812 + }); 813 + 814 + assert.deepEqual(statusView, { 815 + type: "object", 816 + properties: { 817 + status: { 818 + type: "string", 819 + required: true, 820 + knownValues: ["app.bsky.actor.status#live"], 821 + }, 822 + record: { type: "unknown", required: true }, 823 + embed: { 824 + type: "union", 825 + refs: ["app.bsky.embed.external#view"], 826 + }, 827 + expiresAt: { type: "string", format: "datetime" }, 828 + isActive: { type: "boolean" }, 829 + }, 830 + required: ["status", "record"], 831 + }); 832 + }); 833 + 834 + test("app.bsky.actor.defs - full namespace", () => { 835 + const actorDefs = lx.namespace("app.bsky.actor.defs", { 836 + profileViewBasic: lx.object({ 837 + did: lx.string({ required: true, format: "did" }), 838 + handle: lx.string({ required: true, format: "handle" }), 839 + displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 840 + pronouns: lx.string(), 841 + avatar: lx.string({ format: "uri" }), 842 + associated: lx.ref("#profileAssociated"), 843 + viewer: lx.ref("#viewerState"), 844 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 845 + createdAt: lx.string({ format: "datetime" }), 846 + verification: lx.ref("#verificationState"), 847 + status: lx.ref("#statusView"), 848 + }), 849 + viewerState: lx.object({ 850 + muted: lx.boolean(), 851 + mutedByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 852 + blockedBy: lx.boolean(), 853 + blocking: lx.string({ format: "at-uri" }), 854 + blockingByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 855 + following: lx.string({ format: "at-uri" }), 856 + followedBy: lx.string({ format: "at-uri" }), 857 + knownFollowers: lx.ref("#knownFollowers"), 858 + activitySubscription: lx.ref( 859 + "app.bsky.notification.defs#activitySubscription", 860 + ), 861 + }), 862 + }); 863 + 864 + assert.deepEqual(actorDefs.lexicon, 1); 865 + assert.deepEqual(actorDefs.id, "app.bsky.actor.defs"); 866 + assert.deepEqual(actorDefs.defs.profileViewBasic.type, "object"); 867 + assert.deepEqual(actorDefs.defs.viewerState.type, "object"); 868 + });
+682
src/tests/bsky-feed.test.ts
··· 1 + import { strict as assert } from "node:assert"; 2 + import { test } from "node:test"; 3 + import { lx } from "../lib.ts"; 4 + 5 + test("app.bsky.feed.defs - postView", () => { 6 + const postView = lx.object({ 7 + uri: lx.string({ required: true, format: "at-uri" }), 8 + cid: lx.string({ required: true, format: "cid" }), 9 + author: lx.ref("app.bsky.actor.defs#profileViewBasic", { required: true }), 10 + record: lx.unknown({ required: true }), 11 + embed: lx.union([ 12 + "app.bsky.embed.images#view", 13 + "app.bsky.embed.video#view", 14 + "app.bsky.embed.external#view", 15 + "app.bsky.embed.record#view", 16 + "app.bsky.embed.recordWithMedia#view", 17 + ]), 18 + bookmarkCount: lx.integer(), 19 + replyCount: lx.integer(), 20 + repostCount: lx.integer(), 21 + likeCount: lx.integer(), 22 + quoteCount: lx.integer(), 23 + indexedAt: lx.string({ required: true, format: "datetime" }), 24 + viewer: lx.ref("#viewerState"), 25 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 26 + threadgate: lx.ref("#threadgateView"), 27 + }); 28 + 29 + assert.deepEqual(postView, { 30 + type: "object", 31 + properties: { 32 + uri: { type: "string", required: true, format: "at-uri" }, 33 + cid: { type: "string", required: true, format: "cid" }, 34 + author: { 35 + type: "ref", 36 + ref: "app.bsky.actor.defs#profileViewBasic", 37 + required: true, 38 + }, 39 + record: { type: "unknown", required: true }, 40 + embed: { 41 + type: "union", 42 + refs: [ 43 + "app.bsky.embed.images#view", 44 + "app.bsky.embed.video#view", 45 + "app.bsky.embed.external#view", 46 + "app.bsky.embed.record#view", 47 + "app.bsky.embed.recordWithMedia#view", 48 + ], 49 + }, 50 + bookmarkCount: { type: "integer" }, 51 + replyCount: { type: "integer" }, 52 + repostCount: { type: "integer" }, 53 + likeCount: { type: "integer" }, 54 + quoteCount: { type: "integer" }, 55 + indexedAt: { type: "string", required: true, format: "datetime" }, 56 + viewer: { type: "ref", ref: "#viewerState" }, 57 + labels: { 58 + type: "array", 59 + items: { type: "ref", ref: "com.atproto.label.defs#label" }, 60 + }, 61 + threadgate: { type: "ref", ref: "#threadgateView" }, 62 + }, 63 + required: ["uri", "cid", "author", "record", "indexedAt"], 64 + }); 65 + }); 66 + 67 + test("app.bsky.feed.defs - viewerState", () => { 68 + const viewerState = lx.object({ 69 + repost: lx.string({ format: "at-uri" }), 70 + like: lx.string({ format: "at-uri" }), 71 + bookmarked: lx.boolean(), 72 + threadMuted: lx.boolean(), 73 + replyDisabled: lx.boolean(), 74 + embeddingDisabled: lx.boolean(), 75 + pinned: lx.boolean(), 76 + }); 77 + 78 + assert.deepEqual(viewerState, { 79 + type: "object", 80 + properties: { 81 + repost: { type: "string", format: "at-uri" }, 82 + like: { type: "string", format: "at-uri" }, 83 + bookmarked: { type: "boolean" }, 84 + threadMuted: { type: "boolean" }, 85 + replyDisabled: { type: "boolean" }, 86 + embeddingDisabled: { type: "boolean" }, 87 + pinned: { type: "boolean" }, 88 + }, 89 + }); 90 + }); 91 + 92 + test("app.bsky.feed.defs - threadContext", () => { 93 + const threadContext = lx.object({ 94 + rootAuthorLike: lx.string({ format: "at-uri" }), 95 + }); 96 + 97 + assert.deepEqual(threadContext, { 98 + type: "object", 99 + properties: { 100 + rootAuthorLike: { type: "string", format: "at-uri" }, 101 + }, 102 + }); 103 + }); 104 + 105 + test("app.bsky.feed.defs - feedViewPost", () => { 106 + const feedViewPost = lx.object({ 107 + post: lx.ref("#postView", { required: true }), 108 + reply: lx.ref("#replyRef"), 109 + reason: lx.union(["#reasonRepost", "#reasonPin"]), 110 + feedContext: lx.string({ maxLength: 2000 }), 111 + reqId: lx.string({ maxLength: 100 }), 112 + }); 113 + 114 + assert.deepEqual(feedViewPost, { 115 + type: "object", 116 + properties: { 117 + post: { type: "ref", ref: "#postView", required: true }, 118 + reply: { type: "ref", ref: "#replyRef" }, 119 + reason: { 120 + type: "union", 121 + refs: ["#reasonRepost", "#reasonPin"], 122 + }, 123 + feedContext: { type: "string", maxLength: 2000 }, 124 + reqId: { type: "string", maxLength: 100 }, 125 + }, 126 + required: ["post"], 127 + }); 128 + }); 129 + 130 + test("app.bsky.feed.defs - replyRef", () => { 131 + const replyRef = lx.object({ 132 + root: lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 133 + required: true, 134 + }), 135 + parent: lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 136 + required: true, 137 + }), 138 + grandparentAuthor: lx.ref("app.bsky.actor.defs#profileViewBasic"), 139 + }); 140 + 141 + assert.deepEqual(replyRef, { 142 + type: "object", 143 + properties: { 144 + root: { 145 + type: "union", 146 + refs: ["#postView", "#notFoundPost", "#blockedPost"], 147 + required: true, 148 + }, 149 + parent: { 150 + type: "union", 151 + refs: ["#postView", "#notFoundPost", "#blockedPost"], 152 + required: true, 153 + }, 154 + grandparentAuthor: { 155 + type: "ref", 156 + ref: "app.bsky.actor.defs#profileViewBasic", 157 + }, 158 + }, 159 + required: ["root", "parent"], 160 + }); 161 + }); 162 + 163 + test("app.bsky.feed.defs - reasonRepost", () => { 164 + const reasonRepost = lx.object({ 165 + by: lx.ref("app.bsky.actor.defs#profileViewBasic", { required: true }), 166 + uri: lx.string({ format: "at-uri" }), 167 + cid: lx.string({ format: "cid" }), 168 + indexedAt: lx.string({ required: true, format: "datetime" }), 169 + }); 170 + 171 + assert.deepEqual(reasonRepost, { 172 + type: "object", 173 + properties: { 174 + by: { 175 + type: "ref", 176 + ref: "app.bsky.actor.defs#profileViewBasic", 177 + required: true, 178 + }, 179 + uri: { type: "string", format: "at-uri" }, 180 + cid: { type: "string", format: "cid" }, 181 + indexedAt: { type: "string", required: true, format: "datetime" }, 182 + }, 183 + required: ["by", "indexedAt"], 184 + }); 185 + }); 186 + 187 + test("app.bsky.feed.defs - reasonPin", () => { 188 + const reasonPin = lx.object({}); 189 + 190 + assert.deepEqual(reasonPin, { 191 + type: "object", 192 + properties: {}, 193 + }); 194 + }); 195 + 196 + test("app.bsky.feed.defs - threadViewPost", () => { 197 + const threadViewPost = lx.object({ 198 + post: lx.ref("#postView", { required: true }), 199 + parent: lx.union(["#threadViewPost", "#notFoundPost", "#blockedPost"]), 200 + replies: lx.array( 201 + lx.union(["#threadViewPost", "#notFoundPost", "#blockedPost"]), 202 + ), 203 + threadContext: lx.ref("#threadContext"), 204 + }); 205 + 206 + assert.deepEqual(threadViewPost, { 207 + type: "object", 208 + properties: { 209 + post: { type: "ref", ref: "#postView", required: true }, 210 + parent: { 211 + type: "union", 212 + refs: ["#threadViewPost", "#notFoundPost", "#blockedPost"], 213 + }, 214 + replies: { 215 + type: "array", 216 + items: { 217 + type: "union", 218 + refs: ["#threadViewPost", "#notFoundPost", "#blockedPost"], 219 + }, 220 + }, 221 + threadContext: { type: "ref", ref: "#threadContext" }, 222 + }, 223 + required: ["post"], 224 + }); 225 + }); 226 + 227 + test("app.bsky.feed.defs - notFoundPost", () => { 228 + const notFoundPost = lx.object({ 229 + uri: lx.string({ required: true, format: "at-uri" }), 230 + notFound: lx.boolean({ required: true, const: true }), 231 + }); 232 + 233 + assert.deepEqual(notFoundPost, { 234 + type: "object", 235 + properties: { 236 + uri: { type: "string", required: true, format: "at-uri" }, 237 + notFound: { type: "boolean", required: true, const: true }, 238 + }, 239 + required: ["uri", "notFound"], 240 + }); 241 + }); 242 + 243 + test("app.bsky.feed.defs - blockedPost", () => { 244 + const blockedPost = lx.object({ 245 + uri: lx.string({ required: true, format: "at-uri" }), 246 + blocked: lx.boolean({ required: true, const: true }), 247 + author: lx.ref("#blockedAuthor", { required: true }), 248 + }); 249 + 250 + assert.deepEqual(blockedPost, { 251 + type: "object", 252 + properties: { 253 + uri: { type: "string", required: true, format: "at-uri" }, 254 + blocked: { type: "boolean", required: true, const: true }, 255 + author: { type: "ref", ref: "#blockedAuthor", required: true }, 256 + }, 257 + required: ["uri", "blocked", "author"], 258 + }); 259 + }); 260 + 261 + test("app.bsky.feed.defs - blockedAuthor", () => { 262 + const blockedAuthor = lx.object({ 263 + did: lx.string({ required: true, format: "did" }), 264 + viewer: lx.ref("app.bsky.actor.defs#viewerState"), 265 + }); 266 + 267 + assert.deepEqual(blockedAuthor, { 268 + type: "object", 269 + properties: { 270 + did: { type: "string", required: true, format: "did" }, 271 + viewer: { type: "ref", ref: "app.bsky.actor.defs#viewerState" }, 272 + }, 273 + required: ["did"], 274 + }); 275 + }); 276 + 277 + test("app.bsky.feed.defs - generatorView", () => { 278 + const generatorView = lx.object({ 279 + uri: lx.string({ required: true, format: "at-uri" }), 280 + cid: lx.string({ required: true, format: "cid" }), 281 + did: lx.string({ required: true, format: "did" }), 282 + creator: lx.ref("app.bsky.actor.defs#profileView", { required: true }), 283 + displayName: lx.string({ required: true }), 284 + description: lx.string({ maxGraphemes: 300, maxLength: 3000 }), 285 + descriptionFacets: lx.array(lx.ref("app.bsky.richtext.facet")), 286 + avatar: lx.string({ format: "uri" }), 287 + likeCount: lx.integer({ minimum: 0 }), 288 + acceptsInteractions: lx.boolean(), 289 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 290 + viewer: lx.ref("#generatorViewerState"), 291 + contentMode: lx.string({ 292 + knownValues: [ 293 + "app.bsky.feed.defs#contentModeUnspecified", 294 + "app.bsky.feed.defs#contentModeVideo", 295 + ], 296 + }), 297 + indexedAt: lx.string({ required: true, format: "datetime" }), 298 + }); 299 + 300 + assert.deepEqual(generatorView, { 301 + type: "object", 302 + properties: { 303 + uri: { type: "string", required: true, format: "at-uri" }, 304 + cid: { type: "string", required: true, format: "cid" }, 305 + did: { type: "string", required: true, format: "did" }, 306 + creator: { 307 + type: "ref", 308 + ref: "app.bsky.actor.defs#profileView", 309 + required: true, 310 + }, 311 + displayName: { type: "string", required: true }, 312 + description: { type: "string", maxGraphemes: 300, maxLength: 3000 }, 313 + descriptionFacets: { 314 + type: "array", 315 + items: { type: "ref", ref: "app.bsky.richtext.facet" }, 316 + }, 317 + avatar: { type: "string", format: "uri" }, 318 + likeCount: { type: "integer", minimum: 0 }, 319 + acceptsInteractions: { type: "boolean" }, 320 + labels: { 321 + type: "array", 322 + items: { type: "ref", ref: "com.atproto.label.defs#label" }, 323 + }, 324 + viewer: { type: "ref", ref: "#generatorViewerState" }, 325 + contentMode: { 326 + type: "string", 327 + knownValues: [ 328 + "app.bsky.feed.defs#contentModeUnspecified", 329 + "app.bsky.feed.defs#contentModeVideo", 330 + ], 331 + }, 332 + indexedAt: { type: "string", required: true, format: "datetime" }, 333 + }, 334 + required: ["uri", "cid", "did", "creator", "displayName", "indexedAt"], 335 + }); 336 + }); 337 + 338 + test("app.bsky.feed.defs - generatorViewerState", () => { 339 + const generatorViewerState = lx.object({ 340 + like: lx.string({ format: "at-uri" }), 341 + }); 342 + 343 + assert.deepEqual(generatorViewerState, { 344 + type: "object", 345 + properties: { 346 + like: { type: "string", format: "at-uri" }, 347 + }, 348 + }); 349 + }); 350 + 351 + test("app.bsky.feed.defs - skeletonFeedPost", () => { 352 + const skeletonFeedPost = lx.object({ 353 + post: lx.string({ required: true, format: "at-uri" }), 354 + reason: lx.union(["#skeletonReasonRepost", "#skeletonReasonPin"]), 355 + feedContext: lx.string({ maxLength: 2000 }), 356 + }); 357 + 358 + assert.deepEqual(skeletonFeedPost, { 359 + type: "object", 360 + properties: { 361 + post: { type: "string", required: true, format: "at-uri" }, 362 + reason: { 363 + type: "union", 364 + refs: ["#skeletonReasonRepost", "#skeletonReasonPin"], 365 + }, 366 + feedContext: { type: "string", maxLength: 2000 }, 367 + }, 368 + required: ["post"], 369 + }); 370 + }); 371 + 372 + test("app.bsky.feed.defs - skeletonReasonRepost", () => { 373 + const skeletonReasonRepost = lx.object({ 374 + repost: lx.string({ required: true, format: "at-uri" }), 375 + }); 376 + 377 + assert.deepEqual(skeletonReasonRepost, { 378 + type: "object", 379 + properties: { 380 + repost: { type: "string", required: true, format: "at-uri" }, 381 + }, 382 + required: ["repost"], 383 + }); 384 + }); 385 + 386 + test("app.bsky.feed.defs - skeletonReasonPin", () => { 387 + const skeletonReasonPin = lx.object({}); 388 + 389 + assert.deepEqual(skeletonReasonPin, { 390 + type: "object", 391 + properties: {}, 392 + }); 393 + }); 394 + 395 + test("app.bsky.feed.defs - threadgateView", () => { 396 + const threadgateView = lx.object({ 397 + uri: lx.string({ format: "at-uri" }), 398 + cid: lx.string({ format: "cid" }), 399 + record: lx.unknown(), 400 + lists: lx.array(lx.ref("app.bsky.graph.defs#listViewBasic")), 401 + }); 402 + 403 + assert.deepEqual(threadgateView, { 404 + type: "object", 405 + properties: { 406 + uri: { type: "string", format: "at-uri" }, 407 + cid: { type: "string", format: "cid" }, 408 + record: { type: "unknown" }, 409 + lists: { 410 + type: "array", 411 + items: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 412 + }, 413 + }, 414 + }); 415 + }); 416 + 417 + test("app.bsky.feed.defs - interaction", () => { 418 + const interaction = lx.object({ 419 + item: lx.string({ format: "at-uri" }), 420 + event: lx.string({ 421 + knownValues: [ 422 + "app.bsky.feed.defs#requestLess", 423 + "app.bsky.feed.defs#requestMore", 424 + "app.bsky.feed.defs#clickthroughItem", 425 + "app.bsky.feed.defs#clickthroughAuthor", 426 + "app.bsky.feed.defs#clickthroughReposter", 427 + "app.bsky.feed.defs#clickthroughEmbed", 428 + "app.bsky.feed.defs#interactionSeen", 429 + "app.bsky.feed.defs#interactionLike", 430 + "app.bsky.feed.defs#interactionRepost", 431 + "app.bsky.feed.defs#interactionReply", 432 + "app.bsky.feed.defs#interactionQuote", 433 + "app.bsky.feed.defs#interactionShare", 434 + ], 435 + }), 436 + feedContext: lx.string({ maxLength: 2000 }), 437 + reqId: lx.string({ maxLength: 100 }), 438 + }); 439 + 440 + assert.deepEqual(interaction, { 441 + type: "object", 442 + properties: { 443 + item: { type: "string", format: "at-uri" }, 444 + event: { 445 + type: "string", 446 + knownValues: [ 447 + "app.bsky.feed.defs#requestLess", 448 + "app.bsky.feed.defs#requestMore", 449 + "app.bsky.feed.defs#clickthroughItem", 450 + "app.bsky.feed.defs#clickthroughAuthor", 451 + "app.bsky.feed.defs#clickthroughReposter", 452 + "app.bsky.feed.defs#clickthroughEmbed", 453 + "app.bsky.feed.defs#interactionSeen", 454 + "app.bsky.feed.defs#interactionLike", 455 + "app.bsky.feed.defs#interactionRepost", 456 + "app.bsky.feed.defs#interactionReply", 457 + "app.bsky.feed.defs#interactionQuote", 458 + "app.bsky.feed.defs#interactionShare", 459 + ], 460 + }, 461 + feedContext: { type: "string", maxLength: 2000 }, 462 + reqId: { type: "string", maxLength: 100 }, 463 + }, 464 + }); 465 + }); 466 + 467 + test("app.bsky.feed.defs - requestLess token", () => { 468 + const requestLess = lx.token( 469 + "Request that less content like the given feed item be shown in the feed", 470 + ); 471 + 472 + assert.deepEqual(requestLess, { 473 + type: "token", 474 + description: 475 + "Request that less content like the given feed item be shown in the feed", 476 + }); 477 + }); 478 + 479 + test("app.bsky.feed.defs - requestMore token", () => { 480 + const requestMore = lx.token( 481 + "Request that more content like the given feed item be shown in the feed", 482 + ); 483 + 484 + assert.deepEqual(requestMore, { 485 + type: "token", 486 + description: 487 + "Request that more content like the given feed item be shown in the feed", 488 + }); 489 + }); 490 + 491 + test("app.bsky.feed.defs - clickthroughItem token", () => { 492 + const clickthroughItem = lx.token("User clicked through to the feed item"); 493 + 494 + assert.deepEqual(clickthroughItem, { 495 + type: "token", 496 + description: "User clicked through to the feed item", 497 + }); 498 + }); 499 + 500 + test("app.bsky.feed.defs - clickthroughAuthor token", () => { 501 + const clickthroughAuthor = lx.token( 502 + "User clicked through to the author of the feed item", 503 + ); 504 + 505 + assert.deepEqual(clickthroughAuthor, { 506 + type: "token", 507 + description: "User clicked through to the author of the feed item", 508 + }); 509 + }); 510 + 511 + test("app.bsky.feed.defs - clickthroughReposter token", () => { 512 + const clickthroughReposter = lx.token( 513 + "User clicked through to the reposter of the feed item", 514 + ); 515 + 516 + assert.deepEqual(clickthroughReposter, { 517 + type: "token", 518 + description: "User clicked through to the reposter of the feed item", 519 + }); 520 + }); 521 + 522 + test("app.bsky.feed.defs - clickthroughEmbed token", () => { 523 + const clickthroughEmbed = lx.token( 524 + "User clicked through to the embedded content of the feed item", 525 + ); 526 + 527 + assert.deepEqual(clickthroughEmbed, { 528 + type: "token", 529 + description: 530 + "User clicked through to the embedded content of the feed item", 531 + }); 532 + }); 533 + 534 + test("app.bsky.feed.defs - contentModeUnspecified token", () => { 535 + const contentModeUnspecified = lx.token( 536 + "Declares the feed generator returns any types of posts.", 537 + ); 538 + 539 + assert.deepEqual(contentModeUnspecified, { 540 + type: "token", 541 + description: "Declares the feed generator returns any types of posts.", 542 + }); 543 + }); 544 + 545 + test("app.bsky.feed.defs - contentModeVideo token", () => { 546 + const contentModeVideo = lx.token( 547 + "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 548 + ); 549 + 550 + assert.deepEqual(contentModeVideo, { 551 + type: "token", 552 + description: 553 + "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 554 + }); 555 + }); 556 + 557 + test("app.bsky.feed.defs - interactionSeen token", () => { 558 + const interactionSeen = lx.token("Feed item was seen by user"); 559 + 560 + assert.deepEqual(interactionSeen, { 561 + type: "token", 562 + description: "Feed item was seen by user", 563 + }); 564 + }); 565 + 566 + test("app.bsky.feed.defs - interactionLike token", () => { 567 + const interactionLike = lx.token("User liked the feed item"); 568 + 569 + assert.deepEqual(interactionLike, { 570 + type: "token", 571 + description: "User liked the feed item", 572 + }); 573 + }); 574 + 575 + test("app.bsky.feed.defs - interactionRepost token", () => { 576 + const interactionRepost = lx.token("User reposted the feed item"); 577 + 578 + assert.deepEqual(interactionRepost, { 579 + type: "token", 580 + description: "User reposted the feed item", 581 + }); 582 + }); 583 + 584 + test("app.bsky.feed.defs - interactionReply token", () => { 585 + const interactionReply = lx.token("User replied to the feed item"); 586 + 587 + assert.deepEqual(interactionReply, { 588 + type: "token", 589 + description: "User replied to the feed item", 590 + }); 591 + }); 592 + 593 + test("app.bsky.feed.defs - interactionQuote token", () => { 594 + const interactionQuote = lx.token("User quoted the feed item"); 595 + 596 + assert.deepEqual(interactionQuote, { 597 + type: "token", 598 + description: "User quoted the feed item", 599 + }); 600 + }); 601 + 602 + test("app.bsky.feed.defs - interactionShare token", () => { 603 + const interactionShare = lx.token("User shared the feed item"); 604 + 605 + assert.deepEqual(interactionShare, { 606 + type: "token", 607 + description: "User shared the feed item", 608 + }); 609 + }); 610 + 611 + test("app.bsky.feed.defs - full namespace", () => { 612 + const feedDefs = lx.namespace("app.bsky.feed.defs", { 613 + postView: lx.object({ 614 + uri: lx.string({ required: true, format: "at-uri" }), 615 + cid: lx.string({ required: true, format: "cid" }), 616 + author: lx.ref("app.bsky.actor.defs#profileViewBasic", { 617 + required: true, 618 + }), 619 + record: lx.unknown({ required: true }), 620 + embed: lx.union([ 621 + "app.bsky.embed.images#view", 622 + "app.bsky.embed.video#view", 623 + "app.bsky.embed.external#view", 624 + "app.bsky.embed.record#view", 625 + "app.bsky.embed.recordWithMedia#view", 626 + ]), 627 + bookmarkCount: lx.integer(), 628 + replyCount: lx.integer(), 629 + repostCount: lx.integer(), 630 + likeCount: lx.integer(), 631 + quoteCount: lx.integer(), 632 + indexedAt: lx.string({ required: true, format: "datetime" }), 633 + viewer: lx.ref("#viewerState"), 634 + labels: lx.array(lx.ref("com.atproto.label.defs#label")), 635 + threadgate: lx.ref("#threadgateView"), 636 + }), 637 + viewerState: lx.object({ 638 + repost: lx.string({ format: "at-uri" }), 639 + like: lx.string({ format: "at-uri" }), 640 + bookmarked: lx.boolean(), 641 + threadMuted: lx.boolean(), 642 + replyDisabled: lx.boolean(), 643 + embeddingDisabled: lx.boolean(), 644 + pinned: lx.boolean(), 645 + }), 646 + requestLess: lx.token( 647 + "Request that less content like the given feed item be shown in the feed", 648 + ), 649 + requestMore: lx.token( 650 + "Request that more content like the given feed item be shown in the feed", 651 + ), 652 + clickthroughItem: lx.token("User clicked through to the feed item"), 653 + clickthroughAuthor: lx.token( 654 + "User clicked through to the author of the feed item", 655 + ), 656 + clickthroughReposter: lx.token( 657 + "User clicked through to the reposter of the feed item", 658 + ), 659 + clickthroughEmbed: lx.token( 660 + "User clicked through to the embedded content of the feed item", 661 + ), 662 + contentModeUnspecified: lx.token( 663 + "Declares the feed generator returns any types of posts.", 664 + ), 665 + contentModeVideo: lx.token( 666 + "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 667 + ), 668 + interactionSeen: lx.token("Feed item was seen by user"), 669 + interactionLike: lx.token("User liked the feed item"), 670 + interactionRepost: lx.token("User reposted the feed item"), 671 + interactionReply: lx.token("User replied to the feed item"), 672 + interactionQuote: lx.token("User quoted the feed item"), 673 + interactionShare: lx.token("User shared the feed item"), 674 + }); 675 + 676 + assert.deepEqual(feedDefs.lexicon, 1); 677 + assert.deepEqual(feedDefs.id, "app.bsky.feed.defs"); 678 + assert.deepEqual(feedDefs.defs.postView.type, "object"); 679 + assert.deepEqual(feedDefs.defs.viewerState.type, "object"); 680 + assert.deepEqual(feedDefs.defs.requestLess.type, "token"); 681 + assert.deepEqual(feedDefs.defs.contentModeVideo.type, "token"); 682 + });
+790
src/tests/primitives.test.ts
··· 1 + import { strict as assert } from "node:assert"; 2 + import { lx } from "../lib.ts"; 3 + import { test } from "node:test"; 4 + 5 + test("lx.null()", () => { 6 + const result = lx.null(); 7 + assert.deepEqual(result, { type: "null" }); 8 + }); 9 + 10 + test("lx.boolean()", () => { 11 + const result = lx.boolean(); 12 + assert.deepEqual(result, { type: "boolean" }); 13 + }); 14 + 15 + test("lx.boolean() with default", () => { 16 + const result = lx.boolean({ default: true }); 17 + assert.deepEqual(result, { type: "boolean", default: true }); 18 + }); 19 + 20 + test("lx.boolean() with const", () => { 21 + const result = lx.boolean({ const: false }); 22 + assert.deepEqual(result, { type: "boolean", const: false }); 23 + }); 24 + 25 + test("lx.integer()", () => { 26 + const result = lx.integer(); 27 + assert.deepEqual(result, { type: "integer" }); 28 + }); 29 + 30 + test("lx.integer() with minimum", () => { 31 + const result = lx.integer({ minimum: 0 }); 32 + assert.deepEqual(result, { type: "integer", minimum: 0 }); 33 + }); 34 + 35 + test("lx.integer() with maximum", () => { 36 + const result = lx.integer({ maximum: 100 }); 37 + assert.deepEqual(result, { type: "integer", maximum: 100 }); 38 + }); 39 + 40 + test("lx.integer() with minimum and maximum", () => { 41 + const result = lx.integer({ minimum: 0, maximum: 100 }); 42 + assert.deepEqual(result, { type: "integer", minimum: 0, maximum: 100 }); 43 + }); 44 + 45 + test("lx.integer() with enum", () => { 46 + const result = lx.integer({ enum: [1, 2, 3, 5, 8, 13] }); 47 + assert.deepEqual(result, { type: "integer", enum: [1, 2, 3, 5, 8, 13] }); 48 + }); 49 + 50 + test("lx.integer() with default", () => { 51 + const result = lx.integer({ default: 42 }); 52 + assert.deepEqual(result, { type: "integer", default: 42 }); 53 + }); 54 + 55 + test("lx.integer() with const", () => { 56 + const result = lx.integer({ const: 7 }); 57 + assert.deepEqual(result, { type: "integer", const: 7 }); 58 + }); 59 + 60 + test("lx.string()", () => { 61 + const result = lx.string(); 62 + assert.deepEqual(result, { type: "string" }); 63 + }); 64 + 65 + test("lx.string() with maxLength", () => { 66 + const result = lx.string({ maxLength: 64 }); 67 + assert.deepEqual(result, { type: "string", maxLength: 64 }); 68 + }); 69 + 70 + test("lx.string() with enum", () => { 71 + const result = lx.string({ enum: ["light", "dark", "auto"] }); 72 + assert.deepEqual(result, { type: "string", enum: ["light", "dark", "auto"] }); 73 + }); 74 + 75 + test("lx.unknown()", () => { 76 + const result = lx.unknown(); 77 + assert.deepEqual(result, { type: "unknown" }); 78 + }); 79 + 80 + test("lx.bytes()", () => { 81 + const result = lx.bytes(); 82 + assert.deepEqual(result, { type: "bytes" }); 83 + }); 84 + 85 + test("lx.bytes() with minLength", () => { 86 + const result = lx.bytes({ minLength: 1 }); 87 + assert.deepEqual(result, { type: "bytes", minLength: 1 }); 88 + }); 89 + 90 + test("lx.bytes() with maxLength", () => { 91 + const result = lx.bytes({ maxLength: 1024 }); 92 + assert.deepEqual(result, { type: "bytes", maxLength: 1024 }); 93 + }); 94 + 95 + test("lx.bytes() with minLength and maxLength", () => { 96 + const result = lx.bytes({ minLength: 1, maxLength: 1024 }); 97 + assert.deepEqual(result, { type: "bytes", minLength: 1, maxLength: 1024 }); 98 + }); 99 + 100 + test("lx.cidLink()", () => { 101 + const result = lx.cidLink( 102 + "bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a", 103 + ); 104 + assert.deepEqual(result, { 105 + type: "cid-link", 106 + $link: "bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a", 107 + }); 108 + }); 109 + 110 + test("lx.blob()", () => { 111 + const result = lx.blob(); 112 + assert.deepEqual(result, { type: "blob" }); 113 + }); 114 + 115 + test("lx.blob() with accept", () => { 116 + const result = lx.blob({ accept: ["image/png", "image/jpeg"] }); 117 + assert.deepEqual(result, { 118 + type: "blob", 119 + accept: ["image/png", "image/jpeg"], 120 + }); 121 + }); 122 + 123 + test("lx.blob() with maxSize", () => { 124 + const result = lx.blob({ maxSize: 1000000 }); 125 + assert.deepEqual(result, { type: "blob", maxSize: 1000000 }); 126 + }); 127 + 128 + test("lx.blob() with accept and maxSize", () => { 129 + const result = lx.blob({ 130 + accept: ["image/png", "image/jpeg"], 131 + maxSize: 5000000, 132 + }); 133 + assert.deepEqual(result, { 134 + type: "blob", 135 + accept: ["image/png", "image/jpeg"], 136 + maxSize: 5000000, 137 + }); 138 + }); 139 + 140 + test("lx.array() with string items", () => { 141 + const result = lx.array(lx.string()); 142 + assert.deepEqual(result, { type: "array", items: { type: "string" } }); 143 + }); 144 + 145 + test("lx.array() with integer items", () => { 146 + const result = lx.array(lx.integer()); 147 + assert.deepEqual(result, { type: "array", items: { type: "integer" } }); 148 + }); 149 + 150 + test("lx.array() with minLength", () => { 151 + const result = lx.array(lx.string(), { minLength: 1 }); 152 + assert.deepEqual(result, { 153 + type: "array", 154 + items: { type: "string" }, 155 + minLength: 1, 156 + }); 157 + }); 158 + 159 + test("lx.array() with maxLength", () => { 160 + const result = lx.array(lx.string(), { maxLength: 10 }); 161 + assert.deepEqual(result, { 162 + type: "array", 163 + items: { type: "string" }, 164 + maxLength: 10, 165 + }); 166 + }); 167 + 168 + test("lx.array() with minLength and maxLength", () => { 169 + const result = lx.array(lx.string(), { minLength: 1, maxLength: 10 }); 170 + assert.deepEqual(result, { 171 + type: "array", 172 + items: { type: "string" }, 173 + minLength: 1, 174 + maxLength: 10, 175 + }); 176 + }); 177 + 178 + test("lx.array() with required", () => { 179 + const result = lx.array(lx.string(), { required: true }); 180 + assert.deepEqual(result, { 181 + type: "array", 182 + items: { type: "string" }, 183 + required: true, 184 + }); 185 + }); 186 + 187 + test("lx.token() with interaction event", () => { 188 + const result = lx.token( 189 + "Request that less content like the given feed item be shown in the feed", 190 + ); 191 + assert.deepEqual(result, { 192 + type: "token", 193 + description: 194 + "Request that less content like the given feed item be shown in the feed", 195 + }); 196 + }); 197 + 198 + test("lx.token() with content mode", () => { 199 + const result = lx.token( 200 + "Declares the feed generator returns posts containing app.bsky.embed.video embeds", 201 + ); 202 + assert.deepEqual(result, { 203 + type: "token", 204 + description: 205 + "Declares the feed generator returns posts containing app.bsky.embed.video embeds", 206 + }); 207 + }); 208 + 209 + test("lx.ref() with local definition", () => { 210 + const result = lx.ref("#profileAssociated"); 211 + assert.deepEqual(result, { 212 + type: "ref", 213 + ref: "#profileAssociated", 214 + }); 215 + }); 216 + 217 + test("lx.ref() with external schema", () => { 218 + const result = lx.ref("com.atproto.label.defs#label"); 219 + assert.deepEqual(result, { 220 + type: "ref", 221 + ref: "com.atproto.label.defs#label", 222 + }); 223 + }); 224 + 225 + test("lx.ref() with required option", () => { 226 + const result = lx.ref("#profileView", { required: true }); 227 + assert.deepEqual(result, { 228 + type: "ref", 229 + ref: "#profileView", 230 + required: true, 231 + }); 232 + }); 233 + 234 + test("lx.ref() with nullable option", () => { 235 + const result = lx.ref("#profileView", { nullable: true }); 236 + assert.deepEqual(result, { 237 + type: "ref", 238 + ref: "#profileView", 239 + nullable: true, 240 + }); 241 + }); 242 + 243 + test("lx.ref() with both required and nullable", () => { 244 + const result = lx.ref("app.bsky.actor.defs#profileView", { 245 + required: true, 246 + nullable: true, 247 + }); 248 + assert.deepEqual(result, { 249 + type: "ref", 250 + ref: "app.bsky.actor.defs#profileView", 251 + required: true, 252 + nullable: true, 253 + }); 254 + }); 255 + 256 + test("lx.union() with local refs", () => { 257 + const result = lx.union(["#reasonRepost", "#reasonPin"]); 258 + assert.deepEqual(result, { 259 + type: "union", 260 + refs: ["#reasonRepost", "#reasonPin"], 261 + }); 262 + }); 263 + 264 + test("lx.union() with external refs", () => { 265 + const result = lx.union([ 266 + "app.bsky.embed.images#view", 267 + "app.bsky.embed.video#view", 268 + "app.bsky.embed.external#view", 269 + "app.bsky.embed.record#view", 270 + "app.bsky.embed.recordWithMedia#view", 271 + ]); 272 + assert.deepEqual(result, { 273 + type: "union", 274 + refs: [ 275 + "app.bsky.embed.images#view", 276 + "app.bsky.embed.video#view", 277 + "app.bsky.embed.external#view", 278 + "app.bsky.embed.record#view", 279 + "app.bsky.embed.recordWithMedia#view", 280 + ], 281 + }); 282 + }); 283 + 284 + test("lx.union() with closed option", () => { 285 + const result = lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 286 + closed: true, 287 + }); 288 + assert.deepEqual(result, { 289 + type: "union", 290 + refs: ["#postView", "#notFoundPost", "#blockedPost"], 291 + closed: true, 292 + }); 293 + }); 294 + 295 + test("lx.union() with closed: false (open union)", () => { 296 + const result = lx.union(["#threadViewPost", "#notFoundPost"], { 297 + closed: false, 298 + }); 299 + assert.deepEqual(result, { 300 + type: "union", 301 + refs: ["#threadViewPost", "#notFoundPost"], 302 + closed: false, 303 + }); 304 + }); 305 + 306 + test("lx.params() with basic properties", () => { 307 + const result = lx.params({ 308 + q: lx.string(), 309 + limit: lx.integer(), 310 + }); 311 + assert.deepEqual(result, { 312 + type: "params", 313 + properties: { 314 + q: { type: "string" }, 315 + limit: { type: "integer" }, 316 + }, 317 + }); 318 + }); 319 + 320 + test("lx.params() with required properties", () => { 321 + const result = lx.params({ 322 + q: lx.string({ required: true }), 323 + limit: lx.integer(), 324 + }); 325 + assert.deepEqual(result, { 326 + type: "params", 327 + properties: { 328 + q: { type: "string", required: true }, 329 + limit: { type: "integer" }, 330 + }, 331 + required: ["q"], 332 + }); 333 + }); 334 + 335 + test("lx.params() with property options", () => { 336 + const result = lx.params({ 337 + q: lx.string(), 338 + limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 339 + cursor: lx.string(), 340 + }); 341 + assert.deepEqual(result, { 342 + type: "params", 343 + properties: { 344 + q: { type: "string" }, 345 + limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 346 + cursor: { type: "string" }, 347 + }, 348 + }); 349 + }); 350 + 351 + test("lx.params() with array properties", () => { 352 + const result = lx.params({ 353 + tags: lx.array(lx.string()), 354 + ids: lx.array(lx.integer()), 355 + }); 356 + assert.deepEqual(result, { 357 + type: "params", 358 + properties: { 359 + tags: { type: "array", items: { type: "string" } }, 360 + ids: { type: "array", items: { type: "integer" } }, 361 + }, 362 + }); 363 + }); 364 + 365 + test("lx.params() real-world example from searchActors", () => { 366 + const result = lx.params({ 367 + q: lx.string({ required: true }), 368 + limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 369 + cursor: lx.string(), 370 + }); 371 + assert.deepEqual(result, { 372 + type: "params", 373 + properties: { 374 + q: { type: "string", required: true }, 375 + limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 376 + cursor: { type: "string" }, 377 + }, 378 + required: ["q"], 379 + }); 380 + }); 381 + 382 + test("lx.query() basic", () => { 383 + const result = lx.query(); 384 + assert.deepEqual(result, { type: "query" }); 385 + }); 386 + 387 + test("lx.query() with description", () => { 388 + const result = lx.query({ description: "Search for actors" }); 389 + assert.deepEqual(result, { type: "query", description: "Search for actors" }); 390 + }); 391 + 392 + test("lx.query() with parameters", () => { 393 + const result = lx.query({ 394 + parameters: lx.params({ 395 + q: lx.string({ required: true }), 396 + limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 397 + }), 398 + }); 399 + assert.deepEqual(result, { 400 + type: "query", 401 + parameters: { 402 + type: "params", 403 + properties: { 404 + q: { type: "string", required: true }, 405 + limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 406 + }, 407 + required: ["q"], 408 + }, 409 + }); 410 + }); 411 + 412 + test("lx.query() with output", () => { 413 + const result = lx.query({ 414 + output: { 415 + encoding: "application/json", 416 + schema: lx.object({ 417 + posts: lx.array(lx.ref("app.bsky.feed.defs#postView"), { 418 + required: true, 419 + }), 420 + cursor: lx.string(), 421 + }), 422 + }, 423 + }); 424 + assert.deepEqual(result, { 425 + type: "query", 426 + output: { 427 + encoding: "application/json", 428 + schema: { 429 + type: "object", 430 + properties: { 431 + posts: { 432 + type: "array", 433 + items: { type: "ref", ref: "app.bsky.feed.defs#postView" }, 434 + required: true, 435 + }, 436 + cursor: { type: "string" }, 437 + }, 438 + required: ["posts"], 439 + }, 440 + }, 441 + }); 442 + }); 443 + 444 + test("lx.query() with errors", () => { 445 + const result = lx.query({ 446 + errors: [{ name: "BadQueryString" }], 447 + }); 448 + assert.deepEqual(result, { 449 + type: "query", 450 + errors: [{ name: "BadQueryString" }], 451 + }); 452 + }); 453 + 454 + test("lx.query() real-world example: searchPosts", () => { 455 + const result = lx.query({ 456 + description: "Find posts matching search criteria", 457 + parameters: lx.params({ 458 + q: lx.string({ required: true }), 459 + sort: lx.string({ enum: ["top", "latest"], default: "latest" }), 460 + limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 461 + cursor: lx.string(), 462 + }), 463 + output: { 464 + encoding: "application/json", 465 + schema: lx.object({ 466 + cursor: lx.string(), 467 + hitsTotal: lx.integer(), 468 + posts: lx.array(lx.ref("app.bsky.feed.defs#postView"), { 469 + required: true, 470 + }), 471 + }), 472 + }, 473 + errors: [{ name: "BadQueryString" }], 474 + }); 475 + assert.deepEqual(result, { 476 + type: "query", 477 + description: "Find posts matching search criteria", 478 + parameters: { 479 + type: "params", 480 + properties: { 481 + q: { type: "string", required: true }, 482 + sort: { type: "string", enum: ["top", "latest"], default: "latest" }, 483 + limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 484 + cursor: { type: "string" }, 485 + }, 486 + required: ["q"], 487 + }, 488 + output: { 489 + encoding: "application/json", 490 + schema: { 491 + type: "object", 492 + properties: { 493 + cursor: { type: "string" }, 494 + hitsTotal: { type: "integer" }, 495 + posts: { 496 + type: "array", 497 + items: { type: "ref", ref: "app.bsky.feed.defs#postView" }, 498 + required: true, 499 + }, 500 + }, 501 + required: ["posts"], 502 + }, 503 + }, 504 + errors: [{ name: "BadQueryString" }], 505 + }); 506 + }); 507 + 508 + test("lx.procedure() basic", () => { 509 + const result = lx.procedure(); 510 + assert.deepEqual(result, { type: "procedure" }); 511 + }); 512 + 513 + test("lx.procedure() with description", () => { 514 + const result = lx.procedure({ description: "Create a new post" }); 515 + assert.deepEqual(result, { 516 + type: "procedure", 517 + description: "Create a new post", 518 + }); 519 + }); 520 + 521 + test("lx.procedure() with parameters", () => { 522 + const result = lx.procedure({ 523 + parameters: lx.params({ 524 + validate: lx.boolean({ default: true }), 525 + }), 526 + }); 527 + assert.deepEqual(result, { 528 + type: "procedure", 529 + parameters: { 530 + type: "params", 531 + properties: { 532 + validate: { type: "boolean", default: true }, 533 + }, 534 + }, 535 + }); 536 + }); 537 + 538 + test("lx.procedure() with input", () => { 539 + const result = lx.procedure({ 540 + input: { 541 + encoding: "application/json", 542 + schema: lx.object({ 543 + text: lx.string({ required: true, maxGraphemes: 300 }), 544 + createdAt: lx.string({ format: "datetime" }), 545 + }), 546 + }, 547 + }); 548 + assert.deepEqual(result, { 549 + type: "procedure", 550 + input: { 551 + encoding: "application/json", 552 + schema: { 553 + type: "object", 554 + properties: { 555 + text: { type: "string", required: true, maxGraphemes: 300 }, 556 + createdAt: { type: "string", format: "datetime" }, 557 + }, 558 + required: ["text"], 559 + }, 560 + }, 561 + }); 562 + }); 563 + 564 + test("lx.procedure() with output", () => { 565 + const result = lx.procedure({ 566 + output: { 567 + encoding: "application/json", 568 + schema: lx.object({ 569 + uri: lx.string({ required: true }), 570 + cid: lx.string({ required: true }), 571 + }), 572 + }, 573 + }); 574 + assert.deepEqual(result, { 575 + type: "procedure", 576 + output: { 577 + encoding: "application/json", 578 + schema: { 579 + type: "object", 580 + properties: { 581 + uri: { type: "string", required: true }, 582 + cid: { type: "string", required: true }, 583 + }, 584 + required: ["uri", "cid"], 585 + }, 586 + }, 587 + }); 588 + }); 589 + 590 + test("lx.procedure() with errors", () => { 591 + const result = lx.procedure({ 592 + errors: [ 593 + { name: "InvalidRequest" }, 594 + { name: "RateLimitExceeded", description: "Too many requests" }, 595 + ], 596 + }); 597 + assert.deepEqual(result, { 598 + type: "procedure", 599 + errors: [ 600 + { name: "InvalidRequest" }, 601 + { name: "RateLimitExceeded", description: "Too many requests" }, 602 + ], 603 + }); 604 + }); 605 + 606 + test("lx.procedure() real-world example: createPost", () => { 607 + const result = lx.procedure({ 608 + description: "Create a post", 609 + input: { 610 + encoding: "application/json", 611 + schema: lx.object({ 612 + repo: lx.string({ required: true }), 613 + collection: lx.string({ required: true }), 614 + record: lx.unknown({ required: true }), 615 + validate: lx.boolean({ default: true }), 616 + }), 617 + }, 618 + output: { 619 + encoding: "application/json", 620 + schema: lx.object({ 621 + uri: lx.string({ required: true }), 622 + cid: lx.string({ required: true }), 623 + }), 624 + }, 625 + errors: [{ name: "InvalidSwap" }, { name: "InvalidRecord" }], 626 + }); 627 + assert.deepEqual(result, { 628 + type: "procedure", 629 + description: "Create a post", 630 + input: { 631 + encoding: "application/json", 632 + schema: { 633 + type: "object", 634 + properties: { 635 + repo: { type: "string", required: true }, 636 + collection: { type: "string", required: true }, 637 + record: { type: "unknown", required: true }, 638 + validate: { type: "boolean", default: true }, 639 + }, 640 + required: ["repo", "collection", "record"], 641 + }, 642 + }, 643 + output: { 644 + encoding: "application/json", 645 + schema: { 646 + type: "object", 647 + properties: { 648 + uri: { type: "string", required: true }, 649 + cid: { type: "string", required: true }, 650 + }, 651 + required: ["uri", "cid"], 652 + }, 653 + }, 654 + errors: [{ name: "InvalidSwap" }, { name: "InvalidRecord" }], 655 + }); 656 + }); 657 + 658 + test("lx.subscription() basic", () => { 659 + const result = lx.subscription(); 660 + assert.deepEqual(result, { type: "subscription" }); 661 + }); 662 + 663 + test("lx.subscription() with description", () => { 664 + const result = lx.subscription({ 665 + description: "Repository event stream", 666 + }); 667 + assert.deepEqual(result, { 668 + type: "subscription", 669 + description: "Repository event stream", 670 + }); 671 + }); 672 + 673 + test("lx.subscription() with parameters", () => { 674 + const result = lx.subscription({ 675 + parameters: lx.params({ 676 + cursor: lx.integer(), 677 + }), 678 + }); 679 + assert.deepEqual(result, { 680 + type: "subscription", 681 + parameters: { 682 + type: "params", 683 + properties: { 684 + cursor: { type: "integer" }, 685 + }, 686 + }, 687 + }); 688 + }); 689 + 690 + test("lx.subscription() with message", () => { 691 + const result = lx.subscription({ 692 + message: { 693 + schema: lx.union(["#commit", "#identity", "#account"]), 694 + }, 695 + }); 696 + assert.deepEqual(result, { 697 + type: "subscription", 698 + message: { 699 + schema: { 700 + type: "union", 701 + refs: ["#commit", "#identity", "#account"], 702 + }, 703 + }, 704 + }); 705 + }); 706 + 707 + test("lx.subscription() with message description", () => { 708 + const result = lx.subscription({ 709 + message: { 710 + description: "Event message types", 711 + schema: lx.union(["#commit", "#handle", "#migrate"]), 712 + }, 713 + }); 714 + assert.deepEqual(result, { 715 + type: "subscription", 716 + message: { 717 + description: "Event message types", 718 + schema: { 719 + type: "union", 720 + refs: ["#commit", "#handle", "#migrate"], 721 + }, 722 + }, 723 + }); 724 + }); 725 + 726 + test("lx.subscription() with errors", () => { 727 + const result = lx.subscription({ 728 + errors: [ 729 + { name: "FutureCursor" }, 730 + { name: "ConsumerTooSlow", description: "Consumer is too slow" }, 731 + ], 732 + }); 733 + assert.deepEqual(result, { 734 + type: "subscription", 735 + errors: [ 736 + { name: "FutureCursor" }, 737 + { name: "ConsumerTooSlow", description: "Consumer is too slow" }, 738 + ], 739 + }); 740 + }); 741 + 742 + test("lx.subscription() real-world example: subscribeRepos", () => { 743 + const result = lx.subscription({ 744 + description: "Repository event stream, aka Firehose endpoint", 745 + parameters: lx.params({ 746 + cursor: lx.integer(), 747 + }), 748 + message: { 749 + description: "Represents an update of repository state", 750 + schema: lx.union([ 751 + "#commit", 752 + "#identity", 753 + "#account", 754 + "#handle", 755 + "#migrate", 756 + "#tombstone", 757 + "#info", 758 + ]), 759 + }, 760 + errors: [{ name: "FutureCursor" }, { name: "ConsumerTooSlow" }], 761 + }); 762 + assert.deepEqual(result, { 763 + type: "subscription", 764 + description: "Repository event stream, aka Firehose endpoint", 765 + parameters: { 766 + type: "params", 767 + properties: { 768 + cursor: { 769 + type: "integer", 770 + }, 771 + }, 772 + }, 773 + message: { 774 + description: "Represents an update of repository state", 775 + schema: { 776 + type: "union", 777 + refs: [ 778 + "#commit", 779 + "#identity", 780 + "#account", 781 + "#handle", 782 + "#migrate", 783 + "#tombstone", 784 + "#info", 785 + ], 786 + }, 787 + }, 788 + errors: [{ name: "FutureCursor" }, { name: "ConsumerTooSlow" }], 789 + }); 790 + });
-40
tests/base-case.test.ts
··· 1 - import { assertEquals } from "@std/assert"; 2 - import { lx } from "../src/lib.ts"; 3 - 4 - Deno.test("app.bsky.actor.profile", () => { 5 - const profileNamespace = lx.namespace("app.bsky.actor.profile", { 6 - main: lx.record({ 7 - key: "self", 8 - record: lx.object({ 9 - displayName: lx.string({ maxLength: 64, maxGraphemes: 64 }), 10 - description: lx.string({ maxLength: 256, maxGraphemes: 256 }), 11 - }), 12 - }), 13 - }); 14 - 15 - assertEquals(profileNamespace, { 16 - lexicon: 1, 17 - id: "app.bsky.actor.profile", 18 - defs: { 19 - main: { 20 - type: "record", 21 - key: "self", 22 - record: { 23 - type: "object", 24 - properties: { 25 - displayName: { 26 - type: "string", 27 - maxLength: 64, 28 - maxGraphemes: 64, 29 - }, 30 - description: { 31 - type: "string", 32 - maxLength: 256, 33 - maxGraphemes: 256, 34 - }, 35 - }, 36 - }, 37 - }, 38 - }, 39 - }); 40 - });
-867
tests/bsky-actor.test.ts
··· 1 - import { assertEquals } from "@std/assert"; 2 - import { lx } from "../src/lib.ts"; 3 - 4 - Deno.test("app.bsky.actor.defs - profileViewBasic", () => { 5 - const profileViewBasic = lx.object({ 6 - did: lx.string({ required: true, format: "did" }), 7 - handle: lx.string({ required: true, format: "handle" }), 8 - displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 9 - pronouns: lx.string(), 10 - avatar: lx.string({ format: "uri" }), 11 - associated: lx.ref("#profileAssociated"), 12 - viewer: lx.ref("#viewerState"), 13 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 14 - createdAt: lx.string({ format: "datetime" }), 15 - verification: lx.ref("#verificationState"), 16 - status: lx.ref("#statusView"), 17 - }); 18 - 19 - assertEquals(profileViewBasic, { 20 - type: "object", 21 - properties: { 22 - did: { type: "string", required: true, format: "did" }, 23 - handle: { type: "string", required: true, format: "handle" }, 24 - displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 25 - pronouns: { type: "string" }, 26 - avatar: { type: "string", format: "uri" }, 27 - associated: { type: "ref", ref: "#profileAssociated" }, 28 - viewer: { type: "ref", ref: "#viewerState" }, 29 - labels: { 30 - type: "array", 31 - items: { type: "ref", ref: "com.atproto.label.defs#label" }, 32 - }, 33 - createdAt: { type: "string", format: "datetime" }, 34 - verification: { type: "ref", ref: "#verificationState" }, 35 - status: { type: "ref", ref: "#statusView" }, 36 - }, 37 - required: ["did", "handle"], 38 - }); 39 - }); 40 - 41 - Deno.test("app.bsky.actor.defs - profileView", () => { 42 - const profileView = lx.object({ 43 - did: lx.string({ required: true, format: "did" }), 44 - handle: lx.string({ required: true, format: "handle" }), 45 - displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 46 - pronouns: lx.string(), 47 - description: lx.string({ maxGraphemes: 256, maxLength: 2560 }), 48 - avatar: lx.string({ format: "uri" }), 49 - associated: lx.ref("#profileAssociated"), 50 - indexedAt: lx.string({ format: "datetime" }), 51 - createdAt: lx.string({ format: "datetime" }), 52 - viewer: lx.ref("#viewerState"), 53 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 54 - verification: lx.ref("#verificationState"), 55 - status: lx.ref("#statusView"), 56 - }); 57 - 58 - assertEquals(profileView, { 59 - type: "object", 60 - properties: { 61 - did: { type: "string", required: true, format: "did" }, 62 - handle: { type: "string", required: true, format: "handle" }, 63 - displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 64 - pronouns: { type: "string" }, 65 - description: { type: "string", maxGraphemes: 256, maxLength: 2560 }, 66 - avatar: { type: "string", format: "uri" }, 67 - associated: { type: "ref", ref: "#profileAssociated" }, 68 - indexedAt: { type: "string", format: "datetime" }, 69 - createdAt: { type: "string", format: "datetime" }, 70 - viewer: { type: "ref", ref: "#viewerState" }, 71 - labels: { 72 - type: "array", 73 - items: { type: "ref", ref: "com.atproto.label.defs#label" }, 74 - }, 75 - verification: { type: "ref", ref: "#verificationState" }, 76 - status: { type: "ref", ref: "#statusView" }, 77 - }, 78 - required: ["did", "handle"], 79 - }); 80 - }); 81 - 82 - Deno.test("app.bsky.actor.defs - profileViewDetailed", () => { 83 - const profileViewDetailed = lx.object({ 84 - did: lx.string({ required: true, format: "did" }), 85 - handle: lx.string({ required: true, format: "handle" }), 86 - displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 87 - description: lx.string({ maxGraphemes: 256, maxLength: 2560 }), 88 - pronouns: lx.string(), 89 - website: lx.string({ format: "uri" }), 90 - avatar: lx.string({ format: "uri" }), 91 - banner: lx.string({ format: "uri" }), 92 - followersCount: lx.integer(), 93 - followsCount: lx.integer(), 94 - postsCount: lx.integer(), 95 - associated: lx.ref("#profileAssociated"), 96 - joinedViaStarterPack: lx.ref("app.bsky.graph.defs#starterPackViewBasic"), 97 - indexedAt: lx.string({ format: "datetime" }), 98 - createdAt: lx.string({ format: "datetime" }), 99 - viewer: lx.ref("#viewerState"), 100 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 101 - pinnedPost: lx.ref("com.atproto.repo.strongRef"), 102 - verification: lx.ref("#verificationState"), 103 - status: lx.ref("#statusView"), 104 - }); 105 - 106 - assertEquals(profileViewDetailed, { 107 - type: "object", 108 - properties: { 109 - did: { type: "string", required: true, format: "did" }, 110 - handle: { type: "string", required: true, format: "handle" }, 111 - displayName: { type: "string", maxGraphemes: 64, maxLength: 640 }, 112 - description: { type: "string", maxGraphemes: 256, maxLength: 2560 }, 113 - pronouns: { type: "string" }, 114 - website: { type: "string", format: "uri" }, 115 - avatar: { type: "string", format: "uri" }, 116 - banner: { type: "string", format: "uri" }, 117 - followersCount: { type: "integer" }, 118 - followsCount: { type: "integer" }, 119 - postsCount: { type: "integer" }, 120 - associated: { type: "ref", ref: "#profileAssociated" }, 121 - joinedViaStarterPack: { 122 - type: "ref", 123 - ref: "app.bsky.graph.defs#starterPackViewBasic", 124 - }, 125 - indexedAt: { type: "string", format: "datetime" }, 126 - createdAt: { type: "string", format: "datetime" }, 127 - viewer: { type: "ref", ref: "#viewerState" }, 128 - labels: { 129 - type: "array", 130 - items: { type: "ref", ref: "com.atproto.label.defs#label" }, 131 - }, 132 - pinnedPost: { type: "ref", ref: "com.atproto.repo.strongRef" }, 133 - verification: { type: "ref", ref: "#verificationState" }, 134 - status: { type: "ref", ref: "#statusView" }, 135 - }, 136 - required: ["did", "handle"], 137 - }); 138 - }); 139 - 140 - Deno.test("app.bsky.actor.defs - profileAssociated", () => { 141 - const profileAssociated = lx.object({ 142 - lists: lx.integer(), 143 - feedgens: lx.integer(), 144 - starterPacks: lx.integer(), 145 - labeler: lx.boolean(), 146 - chat: lx.ref("#profileAssociatedChat"), 147 - activitySubscription: lx.ref("#profileAssociatedActivitySubscription"), 148 - }); 149 - 150 - assertEquals(profileAssociated, { 151 - type: "object", 152 - properties: { 153 - lists: { type: "integer" }, 154 - feedgens: { type: "integer" }, 155 - starterPacks: { type: "integer" }, 156 - labeler: { type: "boolean" }, 157 - chat: { type: "ref", ref: "#profileAssociatedChat" }, 158 - activitySubscription: { 159 - type: "ref", 160 - ref: "#profileAssociatedActivitySubscription", 161 - }, 162 - }, 163 - }); 164 - }); 165 - 166 - Deno.test("app.bsky.actor.defs - profileAssociatedChat", () => { 167 - const profileAssociatedChat = lx.object({ 168 - allowIncoming: lx.string({ 169 - required: true, 170 - knownValues: ["all", "none", "following"], 171 - }), 172 - }); 173 - 174 - assertEquals(profileAssociatedChat, { 175 - type: "object", 176 - properties: { 177 - allowIncoming: { 178 - type: "string", 179 - required: true, 180 - knownValues: ["all", "none", "following"], 181 - }, 182 - }, 183 - required: ["allowIncoming"], 184 - }); 185 - }); 186 - 187 - Deno.test("app.bsky.actor.defs - profileAssociatedActivitySubscription", () => { 188 - const profileAssociatedActivitySubscription = lx.object({ 189 - allowSubscriptions: lx.string({ 190 - required: true, 191 - knownValues: ["followers", "mutuals", "none"], 192 - }), 193 - }); 194 - 195 - assertEquals(profileAssociatedActivitySubscription, { 196 - type: "object", 197 - properties: { 198 - allowSubscriptions: { 199 - type: "string", 200 - required: true, 201 - knownValues: ["followers", "mutuals", "none"], 202 - }, 203 - }, 204 - required: ["allowSubscriptions"], 205 - }); 206 - }); 207 - 208 - Deno.test("app.bsky.actor.defs - viewerState", () => { 209 - const viewerState = lx.object({ 210 - muted: lx.boolean(), 211 - mutedByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 212 - blockedBy: lx.boolean(), 213 - blocking: lx.string({ format: "at-uri" }), 214 - blockingByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 215 - following: lx.string({ format: "at-uri" }), 216 - followedBy: lx.string({ format: "at-uri" }), 217 - knownFollowers: lx.ref("#knownFollowers"), 218 - activitySubscription: lx.ref( 219 - "app.bsky.notification.defs#activitySubscription", 220 - ), 221 - }); 222 - 223 - assertEquals(viewerState, { 224 - type: "object", 225 - properties: { 226 - muted: { type: "boolean" }, 227 - mutedByList: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 228 - blockedBy: { type: "boolean" }, 229 - blocking: { type: "string", format: "at-uri" }, 230 - blockingByList: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 231 - following: { type: "string", format: "at-uri" }, 232 - followedBy: { type: "string", format: "at-uri" }, 233 - knownFollowers: { type: "ref", ref: "#knownFollowers" }, 234 - activitySubscription: { 235 - type: "ref", 236 - ref: "app.bsky.notification.defs#activitySubscription", 237 - }, 238 - }, 239 - }); 240 - }); 241 - 242 - Deno.test("app.bsky.actor.defs - knownFollowers", () => { 243 - const knownFollowers = lx.object({ 244 - count: lx.integer({ required: true }), 245 - followers: lx.array(lx.ref("#profileViewBasic"), { 246 - required: true, 247 - minLength: 0, 248 - maxLength: 5, 249 - }), 250 - }); 251 - 252 - assertEquals(knownFollowers, { 253 - type: "object", 254 - properties: { 255 - count: { type: "integer", required: true }, 256 - followers: { 257 - type: "array", 258 - items: { type: "ref", ref: "#profileViewBasic" }, 259 - required: true, 260 - minLength: 0, 261 - maxLength: 5, 262 - }, 263 - }, 264 - required: ["count", "followers"], 265 - }); 266 - }); 267 - 268 - Deno.test("app.bsky.actor.defs - verificationState", () => { 269 - const verificationState = lx.object({ 270 - verifications: lx.array(lx.ref("#verificationView"), { required: true }), 271 - verifiedStatus: lx.string({ 272 - required: true, 273 - knownValues: ["valid", "invalid", "none"], 274 - }), 275 - trustedVerifierStatus: lx.string({ 276 - required: true, 277 - knownValues: ["valid", "invalid", "none"], 278 - }), 279 - }); 280 - 281 - assertEquals(verificationState, { 282 - type: "object", 283 - properties: { 284 - verifications: { 285 - type: "array", 286 - items: { type: "ref", ref: "#verificationView" }, 287 - required: true, 288 - }, 289 - verifiedStatus: { 290 - type: "string", 291 - required: true, 292 - knownValues: ["valid", "invalid", "none"], 293 - }, 294 - trustedVerifierStatus: { 295 - type: "string", 296 - required: true, 297 - knownValues: ["valid", "invalid", "none"], 298 - }, 299 - }, 300 - required: ["verifications", "verifiedStatus", "trustedVerifierStatus"], 301 - }); 302 - }); 303 - 304 - Deno.test("app.bsky.actor.defs - verificationView", () => { 305 - const verificationView = lx.object({ 306 - issuer: lx.string({ required: true, format: "did" }), 307 - uri: lx.string({ required: true, format: "at-uri" }), 308 - isValid: lx.boolean({ required: true }), 309 - createdAt: lx.string({ required: true, format: "datetime" }), 310 - }); 311 - 312 - assertEquals(verificationView, { 313 - type: "object", 314 - properties: { 315 - issuer: { type: "string", required: true, format: "did" }, 316 - uri: { type: "string", required: true, format: "at-uri" }, 317 - isValid: { type: "boolean", required: true }, 318 - createdAt: { type: "string", required: true, format: "datetime" }, 319 - }, 320 - required: ["issuer", "uri", "isValid", "createdAt"], 321 - }); 322 - }); 323 - 324 - Deno.test("app.bsky.actor.defs - preferences", () => { 325 - const preferences = lx.array( 326 - lx.union([ 327 - "#adultContentPref", 328 - "#contentLabelPref", 329 - "#savedFeedsPref", 330 - "#savedFeedsPrefV2", 331 - "#personalDetailsPref", 332 - "#feedViewPref", 333 - "#threadViewPref", 334 - "#interestsPref", 335 - "#mutedWordsPref", 336 - "#hiddenPostsPref", 337 - "#bskyAppStatePref", 338 - "#labelersPref", 339 - "#postInteractionSettingsPref", 340 - "#verificationPrefs", 341 - ]), 342 - ); 343 - 344 - assertEquals(preferences, { 345 - type: "array", 346 - items: { 347 - type: "union", 348 - refs: [ 349 - "#adultContentPref", 350 - "#contentLabelPref", 351 - "#savedFeedsPref", 352 - "#savedFeedsPrefV2", 353 - "#personalDetailsPref", 354 - "#feedViewPref", 355 - "#threadViewPref", 356 - "#interestsPref", 357 - "#mutedWordsPref", 358 - "#hiddenPostsPref", 359 - "#bskyAppStatePref", 360 - "#labelersPref", 361 - "#postInteractionSettingsPref", 362 - "#verificationPrefs", 363 - ], 364 - }, 365 - }); 366 - }); 367 - 368 - Deno.test("app.bsky.actor.defs - adultContentPref", () => { 369 - const adultContentPref = lx.object({ 370 - enabled: lx.boolean({ required: true, default: false }), 371 - }); 372 - 373 - assertEquals(adultContentPref, { 374 - type: "object", 375 - properties: { 376 - enabled: { type: "boolean", required: true, default: false }, 377 - }, 378 - required: ["enabled"], 379 - }); 380 - }); 381 - 382 - Deno.test("app.bsky.actor.defs - contentLabelPref", () => { 383 - const contentLabelPref = lx.object({ 384 - labelerDid: lx.string({ format: "did" }), 385 - label: lx.string({ required: true }), 386 - visibility: lx.string({ 387 - required: true, 388 - knownValues: ["ignore", "show", "warn", "hide"], 389 - }), 390 - }); 391 - 392 - assertEquals(contentLabelPref, { 393 - type: "object", 394 - properties: { 395 - labelerDid: { type: "string", format: "did" }, 396 - label: { type: "string", required: true }, 397 - visibility: { 398 - type: "string", 399 - required: true, 400 - knownValues: ["ignore", "show", "warn", "hide"], 401 - }, 402 - }, 403 - required: ["label", "visibility"], 404 - }); 405 - }); 406 - 407 - Deno.test("app.bsky.actor.defs - savedFeed", () => { 408 - const savedFeed = lx.object({ 409 - id: lx.string({ required: true }), 410 - type: lx.string({ 411 - required: true, 412 - knownValues: ["feed", "list", "timeline"], 413 - }), 414 - value: lx.string({ required: true }), 415 - pinned: lx.boolean({ required: true }), 416 - }); 417 - 418 - assertEquals(savedFeed, { 419 - type: "object", 420 - properties: { 421 - id: { type: "string", required: true }, 422 - type: { 423 - type: "string", 424 - required: true, 425 - knownValues: ["feed", "list", "timeline"], 426 - }, 427 - value: { type: "string", required: true }, 428 - pinned: { type: "boolean", required: true }, 429 - }, 430 - required: ["id", "type", "value", "pinned"], 431 - }); 432 - }); 433 - 434 - Deno.test("app.bsky.actor.defs - savedFeedsPrefV2", () => { 435 - const savedFeedsPrefV2 = lx.object({ 436 - items: lx.array(lx.ref("app.bsky.actor.defs#savedFeed"), { 437 - required: true, 438 - }), 439 - }); 440 - 441 - assertEquals(savedFeedsPrefV2, { 442 - type: "object", 443 - properties: { 444 - items: { 445 - type: "array", 446 - items: { type: "ref", ref: "app.bsky.actor.defs#savedFeed" }, 447 - required: true, 448 - }, 449 - }, 450 - required: ["items"], 451 - }); 452 - }); 453 - 454 - Deno.test("app.bsky.actor.defs - savedFeedsPref", () => { 455 - const savedFeedsPref = lx.object({ 456 - pinned: lx.array(lx.string({ format: "at-uri" }), { required: true }), 457 - saved: lx.array(lx.string({ format: "at-uri" }), { required: true }), 458 - timelineIndex: lx.integer(), 459 - }); 460 - 461 - assertEquals(savedFeedsPref, { 462 - type: "object", 463 - properties: { 464 - pinned: { 465 - type: "array", 466 - items: { type: "string", format: "at-uri" }, 467 - required: true, 468 - }, 469 - saved: { 470 - type: "array", 471 - items: { type: "string", format: "at-uri" }, 472 - required: true, 473 - }, 474 - timelineIndex: { type: "integer" }, 475 - }, 476 - required: ["pinned", "saved"], 477 - }); 478 - }); 479 - 480 - Deno.test("app.bsky.actor.defs - personalDetailsPref", () => { 481 - const personalDetailsPref = lx.object({ 482 - birthDate: lx.string({ format: "datetime" }), 483 - }); 484 - 485 - assertEquals(personalDetailsPref, { 486 - type: "object", 487 - properties: { 488 - birthDate: { type: "string", format: "datetime" }, 489 - }, 490 - }); 491 - }); 492 - 493 - Deno.test("app.bsky.actor.defs - feedViewPref", () => { 494 - const feedViewPref = lx.object({ 495 - feed: lx.string({ required: true }), 496 - hideReplies: lx.boolean(), 497 - hideRepliesByUnfollowed: lx.boolean({ default: true }), 498 - hideRepliesByLikeCount: lx.integer(), 499 - hideReposts: lx.boolean(), 500 - hideQuotePosts: lx.boolean(), 501 - }); 502 - 503 - assertEquals(feedViewPref, { 504 - type: "object", 505 - properties: { 506 - feed: { type: "string", required: true }, 507 - hideReplies: { type: "boolean" }, 508 - hideRepliesByUnfollowed: { type: "boolean", default: true }, 509 - hideRepliesByLikeCount: { type: "integer" }, 510 - hideReposts: { type: "boolean" }, 511 - hideQuotePosts: { type: "boolean" }, 512 - }, 513 - required: ["feed"], 514 - }); 515 - }); 516 - 517 - Deno.test("app.bsky.actor.defs - threadViewPref", () => { 518 - const threadViewPref = lx.object({ 519 - sort: lx.string({ 520 - knownValues: ["oldest", "newest", "most-likes", "random", "hotness"], 521 - }), 522 - prioritizeFollowedUsers: lx.boolean(), 523 - }); 524 - 525 - assertEquals(threadViewPref, { 526 - type: "object", 527 - properties: { 528 - sort: { 529 - type: "string", 530 - knownValues: ["oldest", "newest", "most-likes", "random", "hotness"], 531 - }, 532 - prioritizeFollowedUsers: { type: "boolean" }, 533 - }, 534 - }); 535 - }); 536 - 537 - Deno.test("app.bsky.actor.defs - interestsPref", () => { 538 - const interestsPref = lx.object({ 539 - tags: lx.array(lx.string({ maxLength: 640, maxGraphemes: 64 }), { 540 - required: true, 541 - maxLength: 100, 542 - }), 543 - }); 544 - 545 - assertEquals(interestsPref, { 546 - type: "object", 547 - properties: { 548 - tags: { 549 - type: "array", 550 - items: { type: "string", maxLength: 640, maxGraphemes: 64 }, 551 - required: true, 552 - maxLength: 100, 553 - }, 554 - }, 555 - required: ["tags"], 556 - }); 557 - }); 558 - 559 - Deno.test("app.bsky.actor.defs - mutedWordTarget", () => { 560 - const mutedWordTarget = lx.string({ 561 - knownValues: ["content", "tag"], 562 - maxLength: 640, 563 - maxGraphemes: 64, 564 - }); 565 - 566 - assertEquals(mutedWordTarget, { 567 - type: "string", 568 - knownValues: ["content", "tag"], 569 - maxLength: 640, 570 - maxGraphemes: 64, 571 - }); 572 - }); 573 - 574 - Deno.test("app.bsky.actor.defs - mutedWord", () => { 575 - const mutedWord = lx.object({ 576 - id: lx.string(), 577 - value: lx.string({ required: true, maxLength: 10000, maxGraphemes: 1000 }), 578 - targets: lx.array(lx.ref("app.bsky.actor.defs#mutedWordTarget"), { 579 - required: true, 580 - }), 581 - actorTarget: lx.string({ 582 - knownValues: ["all", "exclude-following"], 583 - default: "all", 584 - }), 585 - expiresAt: lx.string({ format: "datetime" }), 586 - }); 587 - 588 - assertEquals(mutedWord, { 589 - type: "object", 590 - properties: { 591 - id: { type: "string" }, 592 - value: { 593 - type: "string", 594 - required: true, 595 - maxLength: 10000, 596 - maxGraphemes: 1000, 597 - }, 598 - targets: { 599 - type: "array", 600 - items: { type: "ref", ref: "app.bsky.actor.defs#mutedWordTarget" }, 601 - required: true, 602 - }, 603 - actorTarget: { 604 - type: "string", 605 - knownValues: ["all", "exclude-following"], 606 - default: "all", 607 - }, 608 - expiresAt: { type: "string", format: "datetime" }, 609 - }, 610 - required: ["value", "targets"], 611 - }); 612 - }); 613 - 614 - Deno.test("app.bsky.actor.defs - mutedWordsPref", () => { 615 - const mutedWordsPref = lx.object({ 616 - items: lx.array(lx.ref("app.bsky.actor.defs#mutedWord"), { 617 - required: true, 618 - }), 619 - }); 620 - 621 - assertEquals(mutedWordsPref, { 622 - type: "object", 623 - properties: { 624 - items: { 625 - type: "array", 626 - items: { type: "ref", ref: "app.bsky.actor.defs#mutedWord" }, 627 - required: true, 628 - }, 629 - }, 630 - required: ["items"], 631 - }); 632 - }); 633 - 634 - Deno.test("app.bsky.actor.defs - hiddenPostsPref", () => { 635 - const hiddenPostsPref = lx.object({ 636 - items: lx.array(lx.string({ format: "at-uri" }), { required: true }), 637 - }); 638 - 639 - assertEquals(hiddenPostsPref, { 640 - type: "object", 641 - properties: { 642 - items: { 643 - type: "array", 644 - items: { type: "string", format: "at-uri" }, 645 - required: true, 646 - }, 647 - }, 648 - required: ["items"], 649 - }); 650 - }); 651 - 652 - Deno.test("app.bsky.actor.defs - labelersPref", () => { 653 - const labelersPref = lx.object({ 654 - labelers: lx.array(lx.ref("#labelerPrefItem"), { required: true }), 655 - }); 656 - 657 - assertEquals(labelersPref, { 658 - type: "object", 659 - properties: { 660 - labelers: { 661 - type: "array", 662 - items: { type: "ref", ref: "#labelerPrefItem" }, 663 - required: true, 664 - }, 665 - }, 666 - required: ["labelers"], 667 - }); 668 - }); 669 - 670 - Deno.test("app.bsky.actor.defs - labelerPrefItem", () => { 671 - const labelerPrefItem = lx.object({ 672 - did: lx.string({ required: true, format: "did" }), 673 - }); 674 - 675 - assertEquals(labelerPrefItem, { 676 - type: "object", 677 - properties: { 678 - did: { type: "string", required: true, format: "did" }, 679 - }, 680 - required: ["did"], 681 - }); 682 - }); 683 - 684 - Deno.test("app.bsky.actor.defs - bskyAppStatePref", () => { 685 - const bskyAppStatePref = lx.object({ 686 - activeProgressGuide: lx.ref("#bskyAppProgressGuide"), 687 - queuedNudges: lx.array(lx.string({ maxLength: 100 }), { maxLength: 1000 }), 688 - nuxs: lx.array(lx.ref("app.bsky.actor.defs#nux"), { maxLength: 100 }), 689 - }); 690 - 691 - assertEquals(bskyAppStatePref, { 692 - type: "object", 693 - properties: { 694 - activeProgressGuide: { type: "ref", ref: "#bskyAppProgressGuide" }, 695 - queuedNudges: { 696 - type: "array", 697 - items: { type: "string", maxLength: 100 }, 698 - maxLength: 1000, 699 - }, 700 - nuxs: { 701 - type: "array", 702 - items: { type: "ref", ref: "app.bsky.actor.defs#nux" }, 703 - maxLength: 100, 704 - }, 705 - }, 706 - }); 707 - }); 708 - 709 - Deno.test("app.bsky.actor.defs - bskyAppProgressGuide", () => { 710 - const bskyAppProgressGuide = lx.object({ 711 - guide: lx.string({ required: true, maxLength: 100 }), 712 - }); 713 - 714 - assertEquals(bskyAppProgressGuide, { 715 - type: "object", 716 - properties: { 717 - guide: { type: "string", required: true, maxLength: 100 }, 718 - }, 719 - required: ["guide"], 720 - }); 721 - }); 722 - 723 - Deno.test("app.bsky.actor.defs - nux", () => { 724 - const nux = lx.object({ 725 - id: lx.string({ required: true, maxLength: 100 }), 726 - completed: lx.boolean({ required: true, default: false }), 727 - data: lx.string({ maxLength: 3000, maxGraphemes: 300 }), 728 - expiresAt: lx.string({ format: "datetime" }), 729 - }); 730 - 731 - assertEquals(nux, { 732 - type: "object", 733 - properties: { 734 - id: { type: "string", required: true, maxLength: 100 }, 735 - completed: { type: "boolean", required: true, default: false }, 736 - data: { type: "string", maxLength: 3000, maxGraphemes: 300 }, 737 - expiresAt: { type: "string", format: "datetime" }, 738 - }, 739 - required: ["id", "completed"], 740 - }); 741 - }); 742 - 743 - Deno.test("app.bsky.actor.defs - verificationPrefs", () => { 744 - const verificationPrefs = lx.object({ 745 - hideBadges: lx.boolean({ default: false }), 746 - }); 747 - 748 - assertEquals(verificationPrefs, { 749 - type: "object", 750 - properties: { 751 - hideBadges: { type: "boolean", default: false }, 752 - }, 753 - }); 754 - }); 755 - 756 - Deno.test("app.bsky.actor.defs - postInteractionSettingsPref", () => { 757 - const postInteractionSettingsPref = lx.object({ 758 - threadgateAllowRules: lx.array( 759 - lx.union([ 760 - "app.bsky.feed.threadgate#mentionRule", 761 - "app.bsky.feed.threadgate#followerRule", 762 - "app.bsky.feed.threadgate#followingRule", 763 - "app.bsky.feed.threadgate#listRule", 764 - ]), 765 - { maxLength: 5 }, 766 - ), 767 - postgateEmbeddingRules: lx.array( 768 - lx.union(["app.bsky.feed.postgate#disableRule"]), 769 - { maxLength: 5 }, 770 - ), 771 - }); 772 - 773 - assertEquals(postInteractionSettingsPref, { 774 - type: "object", 775 - properties: { 776 - threadgateAllowRules: { 777 - type: "array", 778 - items: { 779 - type: "union", 780 - refs: [ 781 - "app.bsky.feed.threadgate#mentionRule", 782 - "app.bsky.feed.threadgate#followerRule", 783 - "app.bsky.feed.threadgate#followingRule", 784 - "app.bsky.feed.threadgate#listRule", 785 - ], 786 - }, 787 - maxLength: 5, 788 - }, 789 - postgateEmbeddingRules: { 790 - type: "array", 791 - items: { 792 - type: "union", 793 - refs: ["app.bsky.feed.postgate#disableRule"], 794 - }, 795 - maxLength: 5, 796 - }, 797 - }, 798 - }); 799 - }); 800 - 801 - Deno.test("app.bsky.actor.defs - statusView", () => { 802 - const statusView = lx.object({ 803 - status: lx.string({ 804 - required: true, 805 - knownValues: ["app.bsky.actor.status#live"], 806 - }), 807 - record: lx.unknown({ required: true }), 808 - embed: lx.union(["app.bsky.embed.external#view"]), 809 - expiresAt: lx.string({ format: "datetime" }), 810 - isActive: lx.boolean(), 811 - }); 812 - 813 - assertEquals(statusView, { 814 - type: "object", 815 - properties: { 816 - status: { 817 - type: "string", 818 - required: true, 819 - knownValues: ["app.bsky.actor.status#live"], 820 - }, 821 - record: { type: "unknown", required: true }, 822 - embed: { 823 - type: "union", 824 - refs: ["app.bsky.embed.external#view"], 825 - }, 826 - expiresAt: { type: "string", format: "datetime" }, 827 - isActive: { type: "boolean" }, 828 - }, 829 - required: ["status", "record"], 830 - }); 831 - }); 832 - 833 - Deno.test("app.bsky.actor.defs - full namespace", () => { 834 - const actorDefs = lx.namespace("app.bsky.actor.defs", { 835 - profileViewBasic: lx.object({ 836 - did: lx.string({ required: true, format: "did" }), 837 - handle: lx.string({ required: true, format: "handle" }), 838 - displayName: lx.string({ maxGraphemes: 64, maxLength: 640 }), 839 - pronouns: lx.string(), 840 - avatar: lx.string({ format: "uri" }), 841 - associated: lx.ref("#profileAssociated"), 842 - viewer: lx.ref("#viewerState"), 843 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 844 - createdAt: lx.string({ format: "datetime" }), 845 - verification: lx.ref("#verificationState"), 846 - status: lx.ref("#statusView"), 847 - }), 848 - viewerState: lx.object({ 849 - muted: lx.boolean(), 850 - mutedByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 851 - blockedBy: lx.boolean(), 852 - blocking: lx.string({ format: "at-uri" }), 853 - blockingByList: lx.ref("app.bsky.graph.defs#listViewBasic"), 854 - following: lx.string({ format: "at-uri" }), 855 - followedBy: lx.string({ format: "at-uri" }), 856 - knownFollowers: lx.ref("#knownFollowers"), 857 - activitySubscription: lx.ref( 858 - "app.bsky.notification.defs#activitySubscription", 859 - ), 860 - }), 861 - }); 862 - 863 - assertEquals(actorDefs.lexicon, 1); 864 - assertEquals(actorDefs.id, "app.bsky.actor.defs"); 865 - assertEquals(actorDefs.defs.profileViewBasic.type, "object"); 866 - assertEquals(actorDefs.defs.viewerState.type, "object"); 867 - });
-681
tests/bsky-feed.test.ts
··· 1 - import { assertEquals } from "@std/assert"; 2 - import { lx } from "../src/lib.ts"; 3 - 4 - Deno.test("app.bsky.feed.defs - postView", () => { 5 - const postView = lx.object({ 6 - uri: lx.string({ required: true, format: "at-uri" }), 7 - cid: lx.string({ required: true, format: "cid" }), 8 - author: lx.ref("app.bsky.actor.defs#profileViewBasic", { required: true }), 9 - record: lx.unknown({ required: true }), 10 - embed: lx.union([ 11 - "app.bsky.embed.images#view", 12 - "app.bsky.embed.video#view", 13 - "app.bsky.embed.external#view", 14 - "app.bsky.embed.record#view", 15 - "app.bsky.embed.recordWithMedia#view", 16 - ]), 17 - bookmarkCount: lx.integer(), 18 - replyCount: lx.integer(), 19 - repostCount: lx.integer(), 20 - likeCount: lx.integer(), 21 - quoteCount: lx.integer(), 22 - indexedAt: lx.string({ required: true, format: "datetime" }), 23 - viewer: lx.ref("#viewerState"), 24 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 25 - threadgate: lx.ref("#threadgateView"), 26 - }); 27 - 28 - assertEquals(postView, { 29 - type: "object", 30 - properties: { 31 - uri: { type: "string", required: true, format: "at-uri" }, 32 - cid: { type: "string", required: true, format: "cid" }, 33 - author: { 34 - type: "ref", 35 - ref: "app.bsky.actor.defs#profileViewBasic", 36 - required: true, 37 - }, 38 - record: { type: "unknown", required: true }, 39 - embed: { 40 - type: "union", 41 - refs: [ 42 - "app.bsky.embed.images#view", 43 - "app.bsky.embed.video#view", 44 - "app.bsky.embed.external#view", 45 - "app.bsky.embed.record#view", 46 - "app.bsky.embed.recordWithMedia#view", 47 - ], 48 - }, 49 - bookmarkCount: { type: "integer" }, 50 - replyCount: { type: "integer" }, 51 - repostCount: { type: "integer" }, 52 - likeCount: { type: "integer" }, 53 - quoteCount: { type: "integer" }, 54 - indexedAt: { type: "string", required: true, format: "datetime" }, 55 - viewer: { type: "ref", ref: "#viewerState" }, 56 - labels: { 57 - type: "array", 58 - items: { type: "ref", ref: "com.atproto.label.defs#label" }, 59 - }, 60 - threadgate: { type: "ref", ref: "#threadgateView" }, 61 - }, 62 - required: ["uri", "cid", "author", "record", "indexedAt"], 63 - }); 64 - }); 65 - 66 - Deno.test("app.bsky.feed.defs - viewerState", () => { 67 - const viewerState = lx.object({ 68 - repost: lx.string({ format: "at-uri" }), 69 - like: lx.string({ format: "at-uri" }), 70 - bookmarked: lx.boolean(), 71 - threadMuted: lx.boolean(), 72 - replyDisabled: lx.boolean(), 73 - embeddingDisabled: lx.boolean(), 74 - pinned: lx.boolean(), 75 - }); 76 - 77 - assertEquals(viewerState, { 78 - type: "object", 79 - properties: { 80 - repost: { type: "string", format: "at-uri" }, 81 - like: { type: "string", format: "at-uri" }, 82 - bookmarked: { type: "boolean" }, 83 - threadMuted: { type: "boolean" }, 84 - replyDisabled: { type: "boolean" }, 85 - embeddingDisabled: { type: "boolean" }, 86 - pinned: { type: "boolean" }, 87 - }, 88 - }); 89 - }); 90 - 91 - Deno.test("app.bsky.feed.defs - threadContext", () => { 92 - const threadContext = lx.object({ 93 - rootAuthorLike: lx.string({ format: "at-uri" }), 94 - }); 95 - 96 - assertEquals(threadContext, { 97 - type: "object", 98 - properties: { 99 - rootAuthorLike: { type: "string", format: "at-uri" }, 100 - }, 101 - }); 102 - }); 103 - 104 - Deno.test("app.bsky.feed.defs - feedViewPost", () => { 105 - const feedViewPost = lx.object({ 106 - post: lx.ref("#postView", { required: true }), 107 - reply: lx.ref("#replyRef"), 108 - reason: lx.union(["#reasonRepost", "#reasonPin"]), 109 - feedContext: lx.string({ maxLength: 2000 }), 110 - reqId: lx.string({ maxLength: 100 }), 111 - }); 112 - 113 - assertEquals(feedViewPost, { 114 - type: "object", 115 - properties: { 116 - post: { type: "ref", ref: "#postView", required: true }, 117 - reply: { type: "ref", ref: "#replyRef" }, 118 - reason: { 119 - type: "union", 120 - refs: ["#reasonRepost", "#reasonPin"], 121 - }, 122 - feedContext: { type: "string", maxLength: 2000 }, 123 - reqId: { type: "string", maxLength: 100 }, 124 - }, 125 - required: ["post"], 126 - }); 127 - }); 128 - 129 - Deno.test("app.bsky.feed.defs - replyRef", () => { 130 - const replyRef = lx.object({ 131 - root: lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 132 - required: true, 133 - }), 134 - parent: lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 135 - required: true, 136 - }), 137 - grandparentAuthor: lx.ref("app.bsky.actor.defs#profileViewBasic"), 138 - }); 139 - 140 - assertEquals(replyRef, { 141 - type: "object", 142 - properties: { 143 - root: { 144 - type: "union", 145 - refs: ["#postView", "#notFoundPost", "#blockedPost"], 146 - required: true, 147 - }, 148 - parent: { 149 - type: "union", 150 - refs: ["#postView", "#notFoundPost", "#blockedPost"], 151 - required: true, 152 - }, 153 - grandparentAuthor: { 154 - type: "ref", 155 - ref: "app.bsky.actor.defs#profileViewBasic", 156 - }, 157 - }, 158 - required: ["root", "parent"], 159 - }); 160 - }); 161 - 162 - Deno.test("app.bsky.feed.defs - reasonRepost", () => { 163 - const reasonRepost = lx.object({ 164 - by: lx.ref("app.bsky.actor.defs#profileViewBasic", { required: true }), 165 - uri: lx.string({ format: "at-uri" }), 166 - cid: lx.string({ format: "cid" }), 167 - indexedAt: lx.string({ required: true, format: "datetime" }), 168 - }); 169 - 170 - assertEquals(reasonRepost, { 171 - type: "object", 172 - properties: { 173 - by: { 174 - type: "ref", 175 - ref: "app.bsky.actor.defs#profileViewBasic", 176 - required: true, 177 - }, 178 - uri: { type: "string", format: "at-uri" }, 179 - cid: { type: "string", format: "cid" }, 180 - indexedAt: { type: "string", required: true, format: "datetime" }, 181 - }, 182 - required: ["by", "indexedAt"], 183 - }); 184 - }); 185 - 186 - Deno.test("app.bsky.feed.defs - reasonPin", () => { 187 - const reasonPin = lx.object({}); 188 - 189 - assertEquals(reasonPin, { 190 - type: "object", 191 - properties: {}, 192 - }); 193 - }); 194 - 195 - Deno.test("app.bsky.feed.defs - threadViewPost", () => { 196 - const threadViewPost = lx.object({ 197 - post: lx.ref("#postView", { required: true }), 198 - parent: lx.union(["#threadViewPost", "#notFoundPost", "#blockedPost"]), 199 - replies: lx.array( 200 - lx.union(["#threadViewPost", "#notFoundPost", "#blockedPost"]), 201 - ), 202 - threadContext: lx.ref("#threadContext"), 203 - }); 204 - 205 - assertEquals(threadViewPost, { 206 - type: "object", 207 - properties: { 208 - post: { type: "ref", ref: "#postView", required: true }, 209 - parent: { 210 - type: "union", 211 - refs: ["#threadViewPost", "#notFoundPost", "#blockedPost"], 212 - }, 213 - replies: { 214 - type: "array", 215 - items: { 216 - type: "union", 217 - refs: ["#threadViewPost", "#notFoundPost", "#blockedPost"], 218 - }, 219 - }, 220 - threadContext: { type: "ref", ref: "#threadContext" }, 221 - }, 222 - required: ["post"], 223 - }); 224 - }); 225 - 226 - Deno.test("app.bsky.feed.defs - notFoundPost", () => { 227 - const notFoundPost = lx.object({ 228 - uri: lx.string({ required: true, format: "at-uri" }), 229 - notFound: lx.boolean({ required: true, const: true }), 230 - }); 231 - 232 - assertEquals(notFoundPost, { 233 - type: "object", 234 - properties: { 235 - uri: { type: "string", required: true, format: "at-uri" }, 236 - notFound: { type: "boolean", required: true, const: true }, 237 - }, 238 - required: ["uri", "notFound"], 239 - }); 240 - }); 241 - 242 - Deno.test("app.bsky.feed.defs - blockedPost", () => { 243 - const blockedPost = lx.object({ 244 - uri: lx.string({ required: true, format: "at-uri" }), 245 - blocked: lx.boolean({ required: true, const: true }), 246 - author: lx.ref("#blockedAuthor", { required: true }), 247 - }); 248 - 249 - assertEquals(blockedPost, { 250 - type: "object", 251 - properties: { 252 - uri: { type: "string", required: true, format: "at-uri" }, 253 - blocked: { type: "boolean", required: true, const: true }, 254 - author: { type: "ref", ref: "#blockedAuthor", required: true }, 255 - }, 256 - required: ["uri", "blocked", "author"], 257 - }); 258 - }); 259 - 260 - Deno.test("app.bsky.feed.defs - blockedAuthor", () => { 261 - const blockedAuthor = lx.object({ 262 - did: lx.string({ required: true, format: "did" }), 263 - viewer: lx.ref("app.bsky.actor.defs#viewerState"), 264 - }); 265 - 266 - assertEquals(blockedAuthor, { 267 - type: "object", 268 - properties: { 269 - did: { type: "string", required: true, format: "did" }, 270 - viewer: { type: "ref", ref: "app.bsky.actor.defs#viewerState" }, 271 - }, 272 - required: ["did"], 273 - }); 274 - }); 275 - 276 - Deno.test("app.bsky.feed.defs - generatorView", () => { 277 - const generatorView = lx.object({ 278 - uri: lx.string({ required: true, format: "at-uri" }), 279 - cid: lx.string({ required: true, format: "cid" }), 280 - did: lx.string({ required: true, format: "did" }), 281 - creator: lx.ref("app.bsky.actor.defs#profileView", { required: true }), 282 - displayName: lx.string({ required: true }), 283 - description: lx.string({ maxGraphemes: 300, maxLength: 3000 }), 284 - descriptionFacets: lx.array(lx.ref("app.bsky.richtext.facet")), 285 - avatar: lx.string({ format: "uri" }), 286 - likeCount: lx.integer({ minimum: 0 }), 287 - acceptsInteractions: lx.boolean(), 288 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 289 - viewer: lx.ref("#generatorViewerState"), 290 - contentMode: lx.string({ 291 - knownValues: [ 292 - "app.bsky.feed.defs#contentModeUnspecified", 293 - "app.bsky.feed.defs#contentModeVideo", 294 - ], 295 - }), 296 - indexedAt: lx.string({ required: true, format: "datetime" }), 297 - }); 298 - 299 - assertEquals(generatorView, { 300 - type: "object", 301 - properties: { 302 - uri: { type: "string", required: true, format: "at-uri" }, 303 - cid: { type: "string", required: true, format: "cid" }, 304 - did: { type: "string", required: true, format: "did" }, 305 - creator: { 306 - type: "ref", 307 - ref: "app.bsky.actor.defs#profileView", 308 - required: true, 309 - }, 310 - displayName: { type: "string", required: true }, 311 - description: { type: "string", maxGraphemes: 300, maxLength: 3000 }, 312 - descriptionFacets: { 313 - type: "array", 314 - items: { type: "ref", ref: "app.bsky.richtext.facet" }, 315 - }, 316 - avatar: { type: "string", format: "uri" }, 317 - likeCount: { type: "integer", minimum: 0 }, 318 - acceptsInteractions: { type: "boolean" }, 319 - labels: { 320 - type: "array", 321 - items: { type: "ref", ref: "com.atproto.label.defs#label" }, 322 - }, 323 - viewer: { type: "ref", ref: "#generatorViewerState" }, 324 - contentMode: { 325 - type: "string", 326 - knownValues: [ 327 - "app.bsky.feed.defs#contentModeUnspecified", 328 - "app.bsky.feed.defs#contentModeVideo", 329 - ], 330 - }, 331 - indexedAt: { type: "string", required: true, format: "datetime" }, 332 - }, 333 - required: ["uri", "cid", "did", "creator", "displayName", "indexedAt"], 334 - }); 335 - }); 336 - 337 - Deno.test("app.bsky.feed.defs - generatorViewerState", () => { 338 - const generatorViewerState = lx.object({ 339 - like: lx.string({ format: "at-uri" }), 340 - }); 341 - 342 - assertEquals(generatorViewerState, { 343 - type: "object", 344 - properties: { 345 - like: { type: "string", format: "at-uri" }, 346 - }, 347 - }); 348 - }); 349 - 350 - Deno.test("app.bsky.feed.defs - skeletonFeedPost", () => { 351 - const skeletonFeedPost = lx.object({ 352 - post: lx.string({ required: true, format: "at-uri" }), 353 - reason: lx.union(["#skeletonReasonRepost", "#skeletonReasonPin"]), 354 - feedContext: lx.string({ maxLength: 2000 }), 355 - }); 356 - 357 - assertEquals(skeletonFeedPost, { 358 - type: "object", 359 - properties: { 360 - post: { type: "string", required: true, format: "at-uri" }, 361 - reason: { 362 - type: "union", 363 - refs: ["#skeletonReasonRepost", "#skeletonReasonPin"], 364 - }, 365 - feedContext: { type: "string", maxLength: 2000 }, 366 - }, 367 - required: ["post"], 368 - }); 369 - }); 370 - 371 - Deno.test("app.bsky.feed.defs - skeletonReasonRepost", () => { 372 - const skeletonReasonRepost = lx.object({ 373 - repost: lx.string({ required: true, format: "at-uri" }), 374 - }); 375 - 376 - assertEquals(skeletonReasonRepost, { 377 - type: "object", 378 - properties: { 379 - repost: { type: "string", required: true, format: "at-uri" }, 380 - }, 381 - required: ["repost"], 382 - }); 383 - }); 384 - 385 - Deno.test("app.bsky.feed.defs - skeletonReasonPin", () => { 386 - const skeletonReasonPin = lx.object({}); 387 - 388 - assertEquals(skeletonReasonPin, { 389 - type: "object", 390 - properties: {}, 391 - }); 392 - }); 393 - 394 - Deno.test("app.bsky.feed.defs - threadgateView", () => { 395 - const threadgateView = lx.object({ 396 - uri: lx.string({ format: "at-uri" }), 397 - cid: lx.string({ format: "cid" }), 398 - record: lx.unknown(), 399 - lists: lx.array(lx.ref("app.bsky.graph.defs#listViewBasic")), 400 - }); 401 - 402 - assertEquals(threadgateView, { 403 - type: "object", 404 - properties: { 405 - uri: { type: "string", format: "at-uri" }, 406 - cid: { type: "string", format: "cid" }, 407 - record: { type: "unknown" }, 408 - lists: { 409 - type: "array", 410 - items: { type: "ref", ref: "app.bsky.graph.defs#listViewBasic" }, 411 - }, 412 - }, 413 - }); 414 - }); 415 - 416 - Deno.test("app.bsky.feed.defs - interaction", () => { 417 - const interaction = lx.object({ 418 - item: lx.string({ format: "at-uri" }), 419 - event: lx.string({ 420 - knownValues: [ 421 - "app.bsky.feed.defs#requestLess", 422 - "app.bsky.feed.defs#requestMore", 423 - "app.bsky.feed.defs#clickthroughItem", 424 - "app.bsky.feed.defs#clickthroughAuthor", 425 - "app.bsky.feed.defs#clickthroughReposter", 426 - "app.bsky.feed.defs#clickthroughEmbed", 427 - "app.bsky.feed.defs#interactionSeen", 428 - "app.bsky.feed.defs#interactionLike", 429 - "app.bsky.feed.defs#interactionRepost", 430 - "app.bsky.feed.defs#interactionReply", 431 - "app.bsky.feed.defs#interactionQuote", 432 - "app.bsky.feed.defs#interactionShare", 433 - ], 434 - }), 435 - feedContext: lx.string({ maxLength: 2000 }), 436 - reqId: lx.string({ maxLength: 100 }), 437 - }); 438 - 439 - assertEquals(interaction, { 440 - type: "object", 441 - properties: { 442 - item: { type: "string", format: "at-uri" }, 443 - event: { 444 - type: "string", 445 - knownValues: [ 446 - "app.bsky.feed.defs#requestLess", 447 - "app.bsky.feed.defs#requestMore", 448 - "app.bsky.feed.defs#clickthroughItem", 449 - "app.bsky.feed.defs#clickthroughAuthor", 450 - "app.bsky.feed.defs#clickthroughReposter", 451 - "app.bsky.feed.defs#clickthroughEmbed", 452 - "app.bsky.feed.defs#interactionSeen", 453 - "app.bsky.feed.defs#interactionLike", 454 - "app.bsky.feed.defs#interactionRepost", 455 - "app.bsky.feed.defs#interactionReply", 456 - "app.bsky.feed.defs#interactionQuote", 457 - "app.bsky.feed.defs#interactionShare", 458 - ], 459 - }, 460 - feedContext: { type: "string", maxLength: 2000 }, 461 - reqId: { type: "string", maxLength: 100 }, 462 - }, 463 - }); 464 - }); 465 - 466 - Deno.test("app.bsky.feed.defs - requestLess token", () => { 467 - const requestLess = lx.token( 468 - "Request that less content like the given feed item be shown in the feed", 469 - ); 470 - 471 - assertEquals(requestLess, { 472 - type: "token", 473 - description: 474 - "Request that less content like the given feed item be shown in the feed", 475 - }); 476 - }); 477 - 478 - Deno.test("app.bsky.feed.defs - requestMore token", () => { 479 - const requestMore = lx.token( 480 - "Request that more content like the given feed item be shown in the feed", 481 - ); 482 - 483 - assertEquals(requestMore, { 484 - type: "token", 485 - description: 486 - "Request that more content like the given feed item be shown in the feed", 487 - }); 488 - }); 489 - 490 - Deno.test("app.bsky.feed.defs - clickthroughItem token", () => { 491 - const clickthroughItem = lx.token("User clicked through to the feed item"); 492 - 493 - assertEquals(clickthroughItem, { 494 - type: "token", 495 - description: "User clicked through to the feed item", 496 - }); 497 - }); 498 - 499 - Deno.test("app.bsky.feed.defs - clickthroughAuthor token", () => { 500 - const clickthroughAuthor = lx.token( 501 - "User clicked through to the author of the feed item", 502 - ); 503 - 504 - assertEquals(clickthroughAuthor, { 505 - type: "token", 506 - description: "User clicked through to the author of the feed item", 507 - }); 508 - }); 509 - 510 - Deno.test("app.bsky.feed.defs - clickthroughReposter token", () => { 511 - const clickthroughReposter = lx.token( 512 - "User clicked through to the reposter of the feed item", 513 - ); 514 - 515 - assertEquals(clickthroughReposter, { 516 - type: "token", 517 - description: "User clicked through to the reposter of the feed item", 518 - }); 519 - }); 520 - 521 - Deno.test("app.bsky.feed.defs - clickthroughEmbed token", () => { 522 - const clickthroughEmbed = lx.token( 523 - "User clicked through to the embedded content of the feed item", 524 - ); 525 - 526 - assertEquals(clickthroughEmbed, { 527 - type: "token", 528 - description: 529 - "User clicked through to the embedded content of the feed item", 530 - }); 531 - }); 532 - 533 - Deno.test("app.bsky.feed.defs - contentModeUnspecified token", () => { 534 - const contentModeUnspecified = lx.token( 535 - "Declares the feed generator returns any types of posts.", 536 - ); 537 - 538 - assertEquals(contentModeUnspecified, { 539 - type: "token", 540 - description: "Declares the feed generator returns any types of posts.", 541 - }); 542 - }); 543 - 544 - Deno.test("app.bsky.feed.defs - contentModeVideo token", () => { 545 - const contentModeVideo = lx.token( 546 - "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 547 - ); 548 - 549 - assertEquals(contentModeVideo, { 550 - type: "token", 551 - description: 552 - "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 553 - }); 554 - }); 555 - 556 - Deno.test("app.bsky.feed.defs - interactionSeen token", () => { 557 - const interactionSeen = lx.token("Feed item was seen by user"); 558 - 559 - assertEquals(interactionSeen, { 560 - type: "token", 561 - description: "Feed item was seen by user", 562 - }); 563 - }); 564 - 565 - Deno.test("app.bsky.feed.defs - interactionLike token", () => { 566 - const interactionLike = lx.token("User liked the feed item"); 567 - 568 - assertEquals(interactionLike, { 569 - type: "token", 570 - description: "User liked the feed item", 571 - }); 572 - }); 573 - 574 - Deno.test("app.bsky.feed.defs - interactionRepost token", () => { 575 - const interactionRepost = lx.token("User reposted the feed item"); 576 - 577 - assertEquals(interactionRepost, { 578 - type: "token", 579 - description: "User reposted the feed item", 580 - }); 581 - }); 582 - 583 - Deno.test("app.bsky.feed.defs - interactionReply token", () => { 584 - const interactionReply = lx.token("User replied to the feed item"); 585 - 586 - assertEquals(interactionReply, { 587 - type: "token", 588 - description: "User replied to the feed item", 589 - }); 590 - }); 591 - 592 - Deno.test("app.bsky.feed.defs - interactionQuote token", () => { 593 - const interactionQuote = lx.token("User quoted the feed item"); 594 - 595 - assertEquals(interactionQuote, { 596 - type: "token", 597 - description: "User quoted the feed item", 598 - }); 599 - }); 600 - 601 - Deno.test("app.bsky.feed.defs - interactionShare token", () => { 602 - const interactionShare = lx.token("User shared the feed item"); 603 - 604 - assertEquals(interactionShare, { 605 - type: "token", 606 - description: "User shared the feed item", 607 - }); 608 - }); 609 - 610 - Deno.test("app.bsky.feed.defs - full namespace", () => { 611 - const feedDefs = lx.namespace("app.bsky.feed.defs", { 612 - postView: lx.object({ 613 - uri: lx.string({ required: true, format: "at-uri" }), 614 - cid: lx.string({ required: true, format: "cid" }), 615 - author: lx.ref("app.bsky.actor.defs#profileViewBasic", { 616 - required: true, 617 - }), 618 - record: lx.unknown({ required: true }), 619 - embed: lx.union([ 620 - "app.bsky.embed.images#view", 621 - "app.bsky.embed.video#view", 622 - "app.bsky.embed.external#view", 623 - "app.bsky.embed.record#view", 624 - "app.bsky.embed.recordWithMedia#view", 625 - ]), 626 - bookmarkCount: lx.integer(), 627 - replyCount: lx.integer(), 628 - repostCount: lx.integer(), 629 - likeCount: lx.integer(), 630 - quoteCount: lx.integer(), 631 - indexedAt: lx.string({ required: true, format: "datetime" }), 632 - viewer: lx.ref("#viewerState"), 633 - labels: lx.array(lx.ref("com.atproto.label.defs#label")), 634 - threadgate: lx.ref("#threadgateView"), 635 - }), 636 - viewerState: lx.object({ 637 - repost: lx.string({ format: "at-uri" }), 638 - like: lx.string({ format: "at-uri" }), 639 - bookmarked: lx.boolean(), 640 - threadMuted: lx.boolean(), 641 - replyDisabled: lx.boolean(), 642 - embeddingDisabled: lx.boolean(), 643 - pinned: lx.boolean(), 644 - }), 645 - requestLess: lx.token( 646 - "Request that less content like the given feed item be shown in the feed", 647 - ), 648 - requestMore: lx.token( 649 - "Request that more content like the given feed item be shown in the feed", 650 - ), 651 - clickthroughItem: lx.token("User clicked through to the feed item"), 652 - clickthroughAuthor: lx.token( 653 - "User clicked through to the author of the feed item", 654 - ), 655 - clickthroughReposter: lx.token( 656 - "User clicked through to the reposter of the feed item", 657 - ), 658 - clickthroughEmbed: lx.token( 659 - "User clicked through to the embedded content of the feed item", 660 - ), 661 - contentModeUnspecified: lx.token( 662 - "Declares the feed generator returns any types of posts.", 663 - ), 664 - contentModeVideo: lx.token( 665 - "Declares the feed generator returns posts containing app.bsky.embed.video embeds.", 666 - ), 667 - interactionSeen: lx.token("Feed item was seen by user"), 668 - interactionLike: lx.token("User liked the feed item"), 669 - interactionRepost: lx.token("User reposted the feed item"), 670 - interactionReply: lx.token("User replied to the feed item"), 671 - interactionQuote: lx.token("User quoted the feed item"), 672 - interactionShare: lx.token("User shared the feed item"), 673 - }); 674 - 675 - assertEquals(feedDefs.lexicon, 1); 676 - assertEquals(feedDefs.id, "app.bsky.feed.defs"); 677 - assertEquals(feedDefs.defs.postView.type, "object"); 678 - assertEquals(feedDefs.defs.viewerState.type, "object"); 679 - assertEquals(feedDefs.defs.requestLess.type, "token"); 680 - assertEquals(feedDefs.defs.contentModeVideo.type, "token"); 681 - });
-783
tests/primitives.test.ts
··· 1 - import { assertEquals } from "@std/assert"; 2 - import { lx } from "../src/lib.ts"; 3 - 4 - Deno.test("lx.null()", () => { 5 - const result = lx.null(); 6 - assertEquals(result, { type: "null" }); 7 - }); 8 - 9 - Deno.test("lx.boolean()", () => { 10 - const result = lx.boolean(); 11 - assertEquals(result, { type: "boolean" }); 12 - }); 13 - 14 - Deno.test("lx.boolean() with default", () => { 15 - const result = lx.boolean({ default: true }); 16 - assertEquals(result, { type: "boolean", default: true }); 17 - }); 18 - 19 - Deno.test("lx.boolean() with const", () => { 20 - const result = lx.boolean({ const: false }); 21 - assertEquals(result, { type: "boolean", const: false }); 22 - }); 23 - 24 - Deno.test("lx.integer()", () => { 25 - const result = lx.integer(); 26 - assertEquals(result, { type: "integer" }); 27 - }); 28 - 29 - Deno.test("lx.integer() with minimum", () => { 30 - const result = lx.integer({ minimum: 0 }); 31 - assertEquals(result, { type: "integer", minimum: 0 }); 32 - }); 33 - 34 - Deno.test("lx.integer() with maximum", () => { 35 - const result = lx.integer({ maximum: 100 }); 36 - assertEquals(result, { type: "integer", maximum: 100 }); 37 - }); 38 - 39 - Deno.test("lx.integer() with minimum and maximum", () => { 40 - const result = lx.integer({ minimum: 0, maximum: 100 }); 41 - assertEquals(result, { type: "integer", minimum: 0, maximum: 100 }); 42 - }); 43 - 44 - Deno.test("lx.integer() with enum", () => { 45 - const result = lx.integer({ enum: [1, 2, 3, 5, 8, 13] }); 46 - assertEquals(result, { type: "integer", enum: [1, 2, 3, 5, 8, 13] }); 47 - }); 48 - 49 - Deno.test("lx.integer() with default", () => { 50 - const result = lx.integer({ default: 42 }); 51 - assertEquals(result, { type: "integer", default: 42 }); 52 - }); 53 - 54 - Deno.test("lx.integer() with const", () => { 55 - const result = lx.integer({ const: 7 }); 56 - assertEquals(result, { type: "integer", const: 7 }); 57 - }); 58 - 59 - Deno.test("lx.string()", () => { 60 - const result = lx.string(); 61 - assertEquals(result, { type: "string" }); 62 - }); 63 - 64 - Deno.test("lx.string() with maxLength", () => { 65 - const result = lx.string({ maxLength: 64 }); 66 - assertEquals(result, { type: "string", maxLength: 64 }); 67 - }); 68 - 69 - Deno.test("lx.string() with enum", () => { 70 - const result = lx.string({ enum: ["light", "dark", "auto"] }); 71 - assertEquals(result, { type: "string", enum: ["light", "dark", "auto"] }); 72 - }); 73 - 74 - Deno.test("lx.unknown()", () => { 75 - const result = lx.unknown(); 76 - assertEquals(result, { type: "unknown" }); 77 - }); 78 - 79 - Deno.test("lx.bytes()", () => { 80 - const result = lx.bytes(); 81 - assertEquals(result, { type: "bytes" }); 82 - }); 83 - 84 - Deno.test("lx.bytes() with minLength", () => { 85 - const result = lx.bytes({ minLength: 1 }); 86 - assertEquals(result, { type: "bytes", minLength: 1 }); 87 - }); 88 - 89 - Deno.test("lx.bytes() with maxLength", () => { 90 - const result = lx.bytes({ maxLength: 1024 }); 91 - assertEquals(result, { type: "bytes", maxLength: 1024 }); 92 - }); 93 - 94 - Deno.test("lx.bytes() with minLength and maxLength", () => { 95 - const result = lx.bytes({ minLength: 1, maxLength: 1024 }); 96 - assertEquals(result, { type: "bytes", minLength: 1, maxLength: 1024 }); 97 - }); 98 - 99 - Deno.test("lx.cidLink()", () => { 100 - const result = lx.cidLink( 101 - "bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a", 102 - ); 103 - assertEquals(result, { 104 - type: "cid-link", 105 - $link: "bafyreidfayvfuwqa7qlnopdjiqrxzs6blmoeu4rujcjtnci5beludirz2a", 106 - }); 107 - }); 108 - 109 - Deno.test("lx.blob()", () => { 110 - const result = lx.blob(); 111 - assertEquals(result, { type: "blob" }); 112 - }); 113 - 114 - Deno.test("lx.blob() with accept", () => { 115 - const result = lx.blob({ accept: ["image/png", "image/jpeg"] }); 116 - assertEquals(result, { type: "blob", accept: ["image/png", "image/jpeg"] }); 117 - }); 118 - 119 - Deno.test("lx.blob() with maxSize", () => { 120 - const result = lx.blob({ maxSize: 1000000 }); 121 - assertEquals(result, { type: "blob", maxSize: 1000000 }); 122 - }); 123 - 124 - Deno.test("lx.blob() with accept and maxSize", () => { 125 - const result = lx.blob({ 126 - accept: ["image/png", "image/jpeg"], 127 - maxSize: 5000000, 128 - }); 129 - assertEquals(result, { 130 - type: "blob", 131 - accept: ["image/png", "image/jpeg"], 132 - maxSize: 5000000, 133 - }); 134 - }); 135 - 136 - Deno.test("lx.array() with string items", () => { 137 - const result = lx.array(lx.string()); 138 - assertEquals(result, { type: "array", items: { type: "string" } }); 139 - }); 140 - 141 - Deno.test("lx.array() with integer items", () => { 142 - const result = lx.array(lx.integer()); 143 - assertEquals(result, { type: "array", items: { type: "integer" } }); 144 - }); 145 - 146 - Deno.test("lx.array() with minLength", () => { 147 - const result = lx.array(lx.string(), { minLength: 1 }); 148 - assertEquals(result, { 149 - type: "array", 150 - items: { type: "string" }, 151 - minLength: 1, 152 - }); 153 - }); 154 - 155 - Deno.test("lx.array() with maxLength", () => { 156 - const result = lx.array(lx.string(), { maxLength: 10 }); 157 - assertEquals(result, { 158 - type: "array", 159 - items: { type: "string" }, 160 - maxLength: 10, 161 - }); 162 - }); 163 - 164 - Deno.test("lx.array() with minLength and maxLength", () => { 165 - const result = lx.array(lx.string(), { minLength: 1, maxLength: 10 }); 166 - assertEquals(result, { 167 - type: "array", 168 - items: { type: "string" }, 169 - minLength: 1, 170 - maxLength: 10, 171 - }); 172 - }); 173 - 174 - Deno.test("lx.array() with required", () => { 175 - const result = lx.array(lx.string(), { required: true }); 176 - assertEquals(result, { 177 - type: "array", 178 - items: { type: "string" }, 179 - required: true, 180 - }); 181 - }); 182 - 183 - Deno.test("lx.token() with interaction event", () => { 184 - const result = lx.token( 185 - "Request that less content like the given feed item be shown in the feed", 186 - ); 187 - assertEquals(result, { 188 - type: "token", 189 - description: 190 - "Request that less content like the given feed item be shown in the feed", 191 - }); 192 - }); 193 - 194 - Deno.test("lx.token() with content mode", () => { 195 - const result = lx.token( 196 - "Declares the feed generator returns posts containing app.bsky.embed.video embeds", 197 - ); 198 - assertEquals(result, { 199 - type: "token", 200 - description: 201 - "Declares the feed generator returns posts containing app.bsky.embed.video embeds", 202 - }); 203 - }); 204 - 205 - Deno.test("lx.ref() with local definition", () => { 206 - const result = lx.ref("#profileAssociated"); 207 - assertEquals(result, { 208 - type: "ref", 209 - ref: "#profileAssociated", 210 - }); 211 - }); 212 - 213 - Deno.test("lx.ref() with external schema", () => { 214 - const result = lx.ref("com.atproto.label.defs#label"); 215 - assertEquals(result, { 216 - type: "ref", 217 - ref: "com.atproto.label.defs#label", 218 - }); 219 - }); 220 - 221 - Deno.test("lx.ref() with required option", () => { 222 - const result = lx.ref("#profileView", { required: true }); 223 - assertEquals(result, { 224 - type: "ref", 225 - ref: "#profileView", 226 - required: true, 227 - }); 228 - }); 229 - 230 - Deno.test("lx.ref() with nullable option", () => { 231 - const result = lx.ref("#profileView", { nullable: true }); 232 - assertEquals(result, { 233 - type: "ref", 234 - ref: "#profileView", 235 - nullable: true, 236 - }); 237 - }); 238 - 239 - Deno.test("lx.ref() with both required and nullable", () => { 240 - const result = lx.ref("app.bsky.actor.defs#profileView", { 241 - required: true, 242 - nullable: true, 243 - }); 244 - assertEquals(result, { 245 - type: "ref", 246 - ref: "app.bsky.actor.defs#profileView", 247 - required: true, 248 - nullable: true, 249 - }); 250 - }); 251 - 252 - Deno.test("lx.union() with local refs", () => { 253 - const result = lx.union(["#reasonRepost", "#reasonPin"]); 254 - assertEquals(result, { 255 - type: "union", 256 - refs: ["#reasonRepost", "#reasonPin"], 257 - }); 258 - }); 259 - 260 - Deno.test("lx.union() with external refs", () => { 261 - const result = lx.union([ 262 - "app.bsky.embed.images#view", 263 - "app.bsky.embed.video#view", 264 - "app.bsky.embed.external#view", 265 - "app.bsky.embed.record#view", 266 - "app.bsky.embed.recordWithMedia#view", 267 - ]); 268 - assertEquals(result, { 269 - type: "union", 270 - refs: [ 271 - "app.bsky.embed.images#view", 272 - "app.bsky.embed.video#view", 273 - "app.bsky.embed.external#view", 274 - "app.bsky.embed.record#view", 275 - "app.bsky.embed.recordWithMedia#view", 276 - ], 277 - }); 278 - }); 279 - 280 - Deno.test("lx.union() with closed option", () => { 281 - const result = lx.union(["#postView", "#notFoundPost", "#blockedPost"], { 282 - closed: true, 283 - }); 284 - assertEquals(result, { 285 - type: "union", 286 - refs: ["#postView", "#notFoundPost", "#blockedPost"], 287 - closed: true, 288 - }); 289 - }); 290 - 291 - Deno.test("lx.union() with closed: false (open union)", () => { 292 - const result = lx.union(["#threadViewPost", "#notFoundPost"], { 293 - closed: false, 294 - }); 295 - assertEquals(result, { 296 - type: "union", 297 - refs: ["#threadViewPost", "#notFoundPost"], 298 - closed: false, 299 - }); 300 - }); 301 - 302 - Deno.test("lx.params() with basic properties", () => { 303 - const result = lx.params({ 304 - q: lx.string(), 305 - limit: lx.integer(), 306 - }); 307 - assertEquals(result, { 308 - type: "params", 309 - properties: { 310 - q: { type: "string" }, 311 - limit: { type: "integer" }, 312 - }, 313 - }); 314 - }); 315 - 316 - Deno.test("lx.params() with required properties", () => { 317 - const result = lx.params({ 318 - q: lx.string({ required: true }), 319 - limit: lx.integer(), 320 - }); 321 - assertEquals(result, { 322 - type: "params", 323 - properties: { 324 - q: { type: "string", required: true }, 325 - limit: { type: "integer" }, 326 - }, 327 - required: ["q"], 328 - }); 329 - }); 330 - 331 - Deno.test("lx.params() with property options", () => { 332 - const result = lx.params({ 333 - q: lx.string(), 334 - limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 335 - cursor: lx.string(), 336 - }); 337 - assertEquals(result, { 338 - type: "params", 339 - properties: { 340 - q: { type: "string" }, 341 - limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 342 - cursor: { type: "string" }, 343 - }, 344 - }); 345 - }); 346 - 347 - Deno.test("lx.params() with array properties", () => { 348 - const result = lx.params({ 349 - tags: lx.array(lx.string()), 350 - ids: lx.array(lx.integer()), 351 - }); 352 - assertEquals(result, { 353 - type: "params", 354 - properties: { 355 - tags: { type: "array", items: { type: "string" } }, 356 - ids: { type: "array", items: { type: "integer" } }, 357 - }, 358 - }); 359 - }); 360 - 361 - Deno.test("lx.params() real-world example from searchActors", () => { 362 - const result = lx.params({ 363 - q: lx.string({ required: true }), 364 - limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 365 - cursor: lx.string(), 366 - }); 367 - assertEquals(result, { 368 - type: "params", 369 - properties: { 370 - q: { type: "string", required: true }, 371 - limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 372 - cursor: { type: "string" }, 373 - }, 374 - required: ["q"], 375 - }); 376 - }); 377 - 378 - Deno.test("lx.query() basic", () => { 379 - const result = lx.query(); 380 - assertEquals(result, { type: "query" }); 381 - }); 382 - 383 - Deno.test("lx.query() with description", () => { 384 - const result = lx.query({ description: "Search for actors" }); 385 - assertEquals(result, { type: "query", description: "Search for actors" }); 386 - }); 387 - 388 - Deno.test("lx.query() with parameters", () => { 389 - const result = lx.query({ 390 - parameters: lx.params({ 391 - q: lx.string({ required: true }), 392 - limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 393 - }), 394 - }); 395 - assertEquals(result, { 396 - type: "query", 397 - parameters: { 398 - type: "params", 399 - properties: { 400 - q: { type: "string", required: true }, 401 - limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 402 - }, 403 - required: ["q"], 404 - }, 405 - }); 406 - }); 407 - 408 - Deno.test("lx.query() with output", () => { 409 - const result = lx.query({ 410 - output: { 411 - encoding: "application/json", 412 - schema: lx.object({ 413 - posts: lx.array(lx.ref("app.bsky.feed.defs#postView"), { 414 - required: true, 415 - }), 416 - cursor: lx.string(), 417 - }), 418 - }, 419 - }); 420 - assertEquals(result, { 421 - type: "query", 422 - output: { 423 - encoding: "application/json", 424 - schema: { 425 - type: "object", 426 - properties: { 427 - posts: { 428 - type: "array", 429 - items: { type: "ref", ref: "app.bsky.feed.defs#postView" }, 430 - required: true, 431 - }, 432 - cursor: { type: "string" }, 433 - }, 434 - required: ["posts"], 435 - }, 436 - }, 437 - }); 438 - }); 439 - 440 - Deno.test("lx.query() with errors", () => { 441 - const result = lx.query({ 442 - errors: [{ name: "BadQueryString" }], 443 - }); 444 - assertEquals(result, { 445 - type: "query", 446 - errors: [{ name: "BadQueryString" }], 447 - }); 448 - }); 449 - 450 - Deno.test("lx.query() real-world example: searchPosts", () => { 451 - const result = lx.query({ 452 - description: "Find posts matching search criteria", 453 - parameters: lx.params({ 454 - q: lx.string({ required: true }), 455 - sort: lx.string({ enum: ["top", "latest"], default: "latest" }), 456 - limit: lx.integer({ minimum: 1, maximum: 100, default: 25 }), 457 - cursor: lx.string(), 458 - }), 459 - output: { 460 - encoding: "application/json", 461 - schema: lx.object({ 462 - cursor: lx.string(), 463 - hitsTotal: lx.integer(), 464 - posts: lx.array(lx.ref("app.bsky.feed.defs#postView"), { 465 - required: true, 466 - }), 467 - }), 468 - }, 469 - errors: [{ name: "BadQueryString" }], 470 - }); 471 - assertEquals(result, { 472 - type: "query", 473 - description: "Find posts matching search criteria", 474 - parameters: { 475 - type: "params", 476 - properties: { 477 - q: { type: "string", required: true }, 478 - sort: { type: "string", enum: ["top", "latest"], default: "latest" }, 479 - limit: { type: "integer", minimum: 1, maximum: 100, default: 25 }, 480 - cursor: { type: "string" }, 481 - }, 482 - required: ["q"], 483 - }, 484 - output: { 485 - encoding: "application/json", 486 - schema: { 487 - type: "object", 488 - properties: { 489 - cursor: { type: "string" }, 490 - hitsTotal: { type: "integer" }, 491 - posts: { 492 - type: "array", 493 - items: { type: "ref", ref: "app.bsky.feed.defs#postView" }, 494 - required: true, 495 - }, 496 - }, 497 - required: ["posts"], 498 - }, 499 - }, 500 - errors: [{ name: "BadQueryString" }], 501 - }); 502 - }); 503 - 504 - Deno.test("lx.procedure() basic", () => { 505 - const result = lx.procedure(); 506 - assertEquals(result, { type: "procedure" }); 507 - }); 508 - 509 - Deno.test("lx.procedure() with description", () => { 510 - const result = lx.procedure({ description: "Create a new post" }); 511 - assertEquals(result, { type: "procedure", description: "Create a new post" }); 512 - }); 513 - 514 - Deno.test("lx.procedure() with parameters", () => { 515 - const result = lx.procedure({ 516 - parameters: lx.params({ 517 - validate: lx.boolean({ default: true }), 518 - }), 519 - }); 520 - assertEquals(result, { 521 - type: "procedure", 522 - parameters: { 523 - type: "params", 524 - properties: { 525 - validate: { type: "boolean", default: true }, 526 - }, 527 - }, 528 - }); 529 - }); 530 - 531 - Deno.test("lx.procedure() with input", () => { 532 - const result = lx.procedure({ 533 - input: { 534 - encoding: "application/json", 535 - schema: lx.object({ 536 - text: lx.string({ required: true, maxGraphemes: 300 }), 537 - createdAt: lx.string({ format: "datetime" }), 538 - }), 539 - }, 540 - }); 541 - assertEquals(result, { 542 - type: "procedure", 543 - input: { 544 - encoding: "application/json", 545 - schema: { 546 - type: "object", 547 - properties: { 548 - text: { type: "string", required: true, maxGraphemes: 300 }, 549 - createdAt: { type: "string", format: "datetime" }, 550 - }, 551 - required: ["text"], 552 - }, 553 - }, 554 - }); 555 - }); 556 - 557 - Deno.test("lx.procedure() with output", () => { 558 - const result = lx.procedure({ 559 - output: { 560 - encoding: "application/json", 561 - schema: lx.object({ 562 - uri: lx.string({ required: true }), 563 - cid: lx.string({ required: true }), 564 - }), 565 - }, 566 - }); 567 - assertEquals(result, { 568 - type: "procedure", 569 - output: { 570 - encoding: "application/json", 571 - schema: { 572 - type: "object", 573 - properties: { 574 - uri: { type: "string", required: true }, 575 - cid: { type: "string", required: true }, 576 - }, 577 - required: ["uri", "cid"], 578 - }, 579 - }, 580 - }); 581 - }); 582 - 583 - Deno.test("lx.procedure() with errors", () => { 584 - const result = lx.procedure({ 585 - errors: [ 586 - { name: "InvalidRequest" }, 587 - { name: "RateLimitExceeded", description: "Too many requests" }, 588 - ], 589 - }); 590 - assertEquals(result, { 591 - type: "procedure", 592 - errors: [ 593 - { name: "InvalidRequest" }, 594 - { name: "RateLimitExceeded", description: "Too many requests" }, 595 - ], 596 - }); 597 - }); 598 - 599 - Deno.test("lx.procedure() real-world example: createPost", () => { 600 - const result = lx.procedure({ 601 - description: "Create a post", 602 - input: { 603 - encoding: "application/json", 604 - schema: lx.object({ 605 - repo: lx.string({ required: true }), 606 - collection: lx.string({ required: true }), 607 - record: lx.unknown({ required: true }), 608 - validate: lx.boolean({ default: true }), 609 - }), 610 - }, 611 - output: { 612 - encoding: "application/json", 613 - schema: lx.object({ 614 - uri: lx.string({ required: true }), 615 - cid: lx.string({ required: true }), 616 - }), 617 - }, 618 - errors: [{ name: "InvalidSwap" }, { name: "InvalidRecord" }], 619 - }); 620 - assertEquals(result, { 621 - type: "procedure", 622 - description: "Create a post", 623 - input: { 624 - encoding: "application/json", 625 - schema: { 626 - type: "object", 627 - properties: { 628 - repo: { type: "string", required: true }, 629 - collection: { type: "string", required: true }, 630 - record: { type: "unknown", required: true }, 631 - validate: { type: "boolean", default: true }, 632 - }, 633 - required: ["repo", "collection", "record"], 634 - }, 635 - }, 636 - output: { 637 - encoding: "application/json", 638 - schema: { 639 - type: "object", 640 - properties: { 641 - uri: { type: "string", required: true }, 642 - cid: { type: "string", required: true }, 643 - }, 644 - required: ["uri", "cid"], 645 - }, 646 - }, 647 - errors: [{ name: "InvalidSwap" }, { name: "InvalidRecord" }], 648 - }); 649 - }); 650 - 651 - Deno.test("lx.subscription() basic", () => { 652 - const result = lx.subscription(); 653 - assertEquals(result, { type: "subscription" }); 654 - }); 655 - 656 - Deno.test("lx.subscription() with description", () => { 657 - const result = lx.subscription({ 658 - description: "Repository event stream", 659 - }); 660 - assertEquals(result, { 661 - type: "subscription", 662 - description: "Repository event stream", 663 - }); 664 - }); 665 - 666 - Deno.test("lx.subscription() with parameters", () => { 667 - const result = lx.subscription({ 668 - parameters: lx.params({ 669 - cursor: lx.integer(), 670 - }), 671 - }); 672 - assertEquals(result, { 673 - type: "subscription", 674 - parameters: { 675 - type: "params", 676 - properties: { 677 - cursor: { type: "integer" }, 678 - }, 679 - }, 680 - }); 681 - }); 682 - 683 - Deno.test("lx.subscription() with message", () => { 684 - const result = lx.subscription({ 685 - message: { 686 - schema: lx.union(["#commit", "#identity", "#account"]), 687 - }, 688 - }); 689 - assertEquals(result, { 690 - type: "subscription", 691 - message: { 692 - schema: { 693 - type: "union", 694 - refs: ["#commit", "#identity", "#account"], 695 - }, 696 - }, 697 - }); 698 - }); 699 - 700 - Deno.test("lx.subscription() with message description", () => { 701 - const result = lx.subscription({ 702 - message: { 703 - description: "Event message types", 704 - schema: lx.union(["#commit", "#handle", "#migrate"]), 705 - }, 706 - }); 707 - assertEquals(result, { 708 - type: "subscription", 709 - message: { 710 - description: "Event message types", 711 - schema: { 712 - type: "union", 713 - refs: ["#commit", "#handle", "#migrate"], 714 - }, 715 - }, 716 - }); 717 - }); 718 - 719 - Deno.test("lx.subscription() with errors", () => { 720 - const result = lx.subscription({ 721 - errors: [ 722 - { name: "FutureCursor" }, 723 - { name: "ConsumerTooSlow", description: "Consumer is too slow" }, 724 - ], 725 - }); 726 - assertEquals(result, { 727 - type: "subscription", 728 - errors: [ 729 - { name: "FutureCursor" }, 730 - { name: "ConsumerTooSlow", description: "Consumer is too slow" }, 731 - ], 732 - }); 733 - }); 734 - 735 - Deno.test("lx.subscription() real-world example: subscribeRepos", () => { 736 - const result = lx.subscription({ 737 - description: "Repository event stream, aka Firehose endpoint", 738 - parameters: lx.params({ 739 - cursor: lx.integer(), 740 - }), 741 - message: { 742 - description: "Represents an update of repository state", 743 - schema: lx.union([ 744 - "#commit", 745 - "#identity", 746 - "#account", 747 - "#handle", 748 - "#migrate", 749 - "#tombstone", 750 - "#info", 751 - ]), 752 - }, 753 - errors: [{ name: "FutureCursor" }, { name: "ConsumerTooSlow" }], 754 - }); 755 - assertEquals(result, { 756 - type: "subscription", 757 - description: "Repository event stream, aka Firehose endpoint", 758 - parameters: { 759 - type: "params", 760 - properties: { 761 - cursor: { 762 - type: "integer", 763 - }, 764 - }, 765 - }, 766 - message: { 767 - description: "Represents an update of repository state", 768 - schema: { 769 - type: "union", 770 - refs: [ 771 - "#commit", 772 - "#identity", 773 - "#account", 774 - "#handle", 775 - "#migrate", 776 - "#tombstone", 777 - "#info", 778 - ], 779 - }, 780 - }, 781 - errors: [{ name: "FutureCursor" }, { name: "ConsumerTooSlow" }], 782 - }); 783 - });
+16
tsconfig.json
··· 1 + { 2 + "compilerOptions": { 3 + "declaration": true, 4 + "declarationMap": true, 5 + "esModuleInterop": true, 6 + "module": "NodeNext", 7 + "moduleResolution": "NodeNext", 8 + "noEmit": true, 9 + "resolveJsonModule": true, 10 + "skipLibCheck": true, 11 + "strict": true, 12 + "target": "ES2022", 13 + "allowImportingTsExtensions": true 14 + }, 15 + "include": ["src"] 16 + }
+8
tsdown.config.ts
··· 1 + import { defineConfig } from "tsdown"; 2 + 3 + export default defineConfig({ 4 + dts: true, 5 + entry: ["src/**/*.ts"], 6 + outDir: "lib", 7 + unbundle: true, 8 + });