MCPcopy Index your code
hub / github.com/CodelyTV/typescript-criteria

github.com/CodelyTV/typescript-criteria @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
95 symbols 191 edges 31 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

  <img alt="Codely logo" src="https://codely.com/logo/codely_logo.svg">

🎼 Criteria for JavaScript & TypeScript

<a href="https://github.com/CodelyTV"><img src="https://img.shields.io/badge/Codely-OS-green.svg?style=flat-square" alt="Codely Open Source projects"/></a>
<a href="https://pro.codely.com"><img src="https://img.shields.io/badge/Codely-Pro-black.svg?style=flat-square" alt="Codely Pro courses"/></a>

📥 Installation

To install the base criteria dependency, run the following command:

npm i @codelytv/criteria

Then, install the preferred criteria transformer. You can transform in two directions:

Create a Criteria from: - Next.js Request - URL

Convert a Criteria to: - Elasticsearch (and esql) - MySql

You can also create your custom transformer.

✅ Testing

To facilitate the testing of the criteria, you can use the provided object mothers:

npm i @codelytv/criteria-test-mother --save-dev

➕ Other implementations

We have another implementation in PHP with converters for Laravel and Symfony. 🙌

🚀 Release

  1. At the end of each Pull Request, execute pnpm changeset to add the changes to the changelog.
  2. Push the changes.
  3. When the Pull Request is merged, a new release will be triggered, affecting only the modified packages.

If you want to merge a code without a changeset (for example, a Readme or test modification) you should execute pnpm changeset --empty in your Pull Request before merging it.

Extension points exported contracts — how you extend this code

ElasticsearchMatchFilter (Interface)
(no doc)
packages/criteria-to-elasticsearch/src/CriteriaToElasticsearchConverter.ts
ElasticsearchContainsFilter (Interface)
(no doc)
packages/criteria-to-elasticsearch/src/CriteriaToElasticsearchConverter.ts
ElasticsearchMustNotFilter (Interface)
(no doc)
packages/criteria-to-elasticsearch/src/CriteriaToElasticsearchConverter.ts
ElasticsearchTermFilter (Interface)
(no doc)
packages/criteria-to-elasticsearch/src/CriteriaToElasticsearchConverter.ts

Core symbols most depended-on inside this repo

convert
called by 18
packages/criteria-to-elasticsearch/src/CriteriaToEsqlConverter.ts
withOneFilter
called by 18
packages/criteria-test-mother/src/CriteriaMother.ts
convert
called by 16
packages/criteria-to-mysql/src/CriteriaToMySqlConverter.ts
create
called by 12
packages/criteria-test-mother/src/OrderMother.ts
fromPrimitives
called by 9
packages/criteria/src/Order.ts
toCriteria
called by 4
packages/criteria-from-next-request/src/CriteriaFromNextRequestConverter.ts
toCriteria
called by 4
packages/criteria-from-url/src/CriteriaFromUrlConverter.ts
hasOrder
called by 3
packages/criteria/src/Criteria.ts

Shape

Method 51
Class 38
Interface 4
Enum 2

Languages

TypeScript100%

Modules by API surface

packages/criteria/src/FilterOperator.ts11 symbols
packages/criteria-to-elasticsearch/src/CriteriaToElasticsearchConverter.ts8 symbols
packages/criteria-test-mother/src/CriteriaMother.ts8 symbols
packages/criteria/src/Criteria.ts7 symbols
packages/criteria/src/Order.ts6 symbols
packages/criteria/src/Filters.ts6 symbols
packages/criteria/src/OrderType.ts5 symbols
packages/criteria/src/Filter.ts5 symbols
packages/criteria-from-url/src/CriteriaFromUrlConverter.ts5 symbols
packages/criteria-from-next-request/src/CriteriaFromNextRequestConverter.ts5 symbols
packages/criteria-to-mysql/src/CriteriaToMySqlConverter.ts4 symbols
packages/criteria-to-elasticsearch/src/CriteriaToEsqlConverter.ts4 symbols

For agents

$ claude mcp add typescript-criteria \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact