# @jambff/prisma-api

> Extends [@jambff/api](https://www.npmjs.com/package/@jambff/api) with additional helpers for APIs built using [Prisma](https://www.prisma.io/).

Latest version **2.12.3** (published 2023-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @jambff/prisma-api
pnpm add @jambff/prisma-api
yarn add @jambff/prisma-api
bun add @jambff/prisma-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.12.3 |
| Published | 2023-03-14 |
| First published | 2023-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 56.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Mendes |
| Maintainers | alexmendes |

## Links

- npm: https://www.npmjs.com/package/@jambff/prisma-api
- Repository: https://github.com/jambff/prisma-api
- Homepage: https://github.com/jambff/prisma-api#readme
- Issues: https://github.com/jambff/prisma-api/issues
- npm.io page: https://npm.io/package/@jambff/prisma-api

## Dependencies (2)

- [deepmerge](https://npm.io/package/deepmerge.md) ^4.3.0
- [dot-object](https://npm.io/package/dot-object.md) ^2.1.4

## Recent versions

- 2.12.3 (latest) — 2023-03-14
- 2.12.2 — 2023-03-13
- 2.12.1 — 2023-03-13
- 2.12.0 — 2023-03-11
- 2.11.0 — 2023-02-25
- 2.10.5 — 2023-02-10
- 2.10.4 — 2023-02-08
- 2.10.3 — 2023-02-08
- 2.10.2 — 2023-02-07
- 2.10.1 — 2023-02-07
- 2.10.0 — 2023-02-07
- 2.9.1 — 2023-02-05
- 2.9.0 — 2023-02-04
- 2.8.1 — 2023-02-03
- 2.8.0 — 2023-01-30
- … 23 more at https://npm.io/package/@jambff/prisma-api/versions

## README

# Jambff Prisma API

Extends [@jambff/api](https://www.npmjs.com/package/@jambff/api) with
additional helpers for APIs built using [Prisma](https://www.prisma.io/).

## Installation

Install with your favourite package manager:

```text
yarn add @jambff/prisma-api
```

You should also install all `peerDependencies`.

## Search query parser

Parses a query string to the format required for a Prisma where query. Supports
nested object queries via dot notation.

```js
import { parseFilterQuery, FilterType } from '@jambff/prisma-api';
import qs from 'qs';

const queryString = '?filter[published]=true&filter[imageId]=lte:10&filter[image]=title.contains:something';
const queryObject = qs.parse(queryString, { arrayFormat: 'brackets' });

const filterTypes = {
  published: FilterType.BOOLEAN,
  imageId: FilterType.NUMBER,
  image: {
    title: FilterType.STRING,
  },
};

const prismaQuery = parseFilterQuery(filterTypes, queryObject);
// [
//   { published: true },
//   { imageId: { lte: 10 },
//   { image: { title: { contains: "something" } },
// }
```

---
_Source: https://npm.io/package/@jambff/prisma-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
