diff --git a/README.md b/README.md index 53e4737..82967c5 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,40 @@ import { PaginatorTypes } from '@nodeteam/nestjs-prisma-pagination'; # #Paginator ## Paginator options: -**page** - `page number` +`page` - number of page -**perPage** - `records per page` +`perPage` - number of records per page Options can be redefined -## Paginator Arguments: -**orderBy**, **where** +## Return type: + +```typescript +{ + data: T[], + meta: { + total: number, + lastPage: number, + currentPage: number, + perPage: number, + prev: number | null, + next: number | null, + }, +} +``` + +## Example: + +Create new paginator function with default options + +```typescript +const paginate: PaginatorTypes.PaginateFunction = paginator({ + page: 1, + perPage: 10, +}); +``` + +full example: ```typescript import PrismaService from '@providers/prisma/prisma.service'; @@ -57,15 +83,6 @@ export default class UserService { } ``` -#### Set options as default: - -```typescript -const paginate: PaginatorTypes.PaginateFunction = paginator({ - page: 1, - perPage: 10, -}); -``` - #### Redefine options: ```typescript paginate( @@ -94,23 +111,34 @@ https://exmaple.com/api/v1/user?page=1&where=Jake ## Search Paginator options: -**page** - `page number` +`page` - number of page -**perPage** - `records per page` +`perPage` - number of records per page -**skip** - `offset sql` +`skip` - number of records to skip -**searchColumns** - `colums where you want to find searchValue` +`searchColumns` - array of columns in db -**searchValue** - `string witch you whant to find` +`searchValue` - string to search Options can be redefined ## Search Paginator arguments: -**model*** - `prisma service` +`model` - `PrismaClient['modelName']` + +`modelName` - Name of model + +create new search paginator function with default options + +```typescript +const searchPaginate: PaginatorTypes.SearchPaginateFunction = searchPaginator({ + page: 1, + perPage: 10, +}); +``` -**modelName*** - `name of table in db` +full example: ```typescript import PrismaService from '@providers/prisma/prisma.service'; @@ -151,15 +179,6 @@ export default class UserService { } ``` -#### Set options as default: - -```typescript -const searchPaginate: PaginatorTypes.SearchPaginateFunction = searchPaginator({ - page: 1, - perPage: 10, -}); -``` - #### Redefine options: ```typescript searchPaginate( @@ -181,3 +200,5 @@ const searchPaginate: PaginatorTypes.SearchPaginateFunction = searchPaginator({ ``` https://example.com/api/v1/users/full-text/search?search=Lions&page=1 ``` + +Check useful npm packages from NodeTeam: https://www.npmjs.com/org/nodeteam diff --git a/dist/src/index.d.ts b/dist/src/index.d.ts deleted file mode 100644 index 1416ad6..0000000 --- a/dist/src/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { searchPaginator } from './prisma/search-paginator'; -import { paginator } from "./prisma/paginator"; -import { PaginatorTypes } from '../index'; -export { searchPaginator, paginator, PaginatorTypes, }; diff --git a/dist/src/prisma/paginator.d.ts b/dist/src/prisma/paginator.d.ts deleted file mode 100644 index a7776c0..0000000 --- a/dist/src/prisma/paginator.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { PaginatorTypes } from "../../index"; -export declare const paginator: (defaultOptions: PaginatorTypes.PaginateOptions) => PaginatorTypes.PaginateFunction; diff --git a/dist/src/prisma/search-paginator.d.ts b/dist/src/prisma/search-paginator.d.ts deleted file mode 100644 index c1b7727..0000000 --- a/dist/src/prisma/search-paginator.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { PaginatorTypes } from "../../index"; -export declare const searchPaginator: (defaultOptions: PaginatorTypes.SearchPaginateOptions) => PaginatorTypes.SearchPaginateFunction; diff --git a/dist/test/prisma/paginator.spec.d.ts b/dist/test/prisma/paginator.spec.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/test/prisma/paginator.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/test/prisma/paginator.spec.js b/dist/test/prisma/paginator.spec.js deleted file mode 100644 index f6411a3..0000000 --- a/dist/test/prisma/paginator.spec.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const src_1 = require("../../src"); -describe('Paginator', () => { - const paginate = (0, src_1.paginator)({ perPage: 10 }); - const prisma = { - count: jest.fn(() => 2), - findMany: jest.fn((args) => [ - { - id: 1, - name: 'string', - }, - { - id: 2, - name: 'string', - } - ]), - }; - it('Should return paginated response', async () => { - const args = { - where: { - description: 'string' - }, - }; - const options = { - page: 1, - }; - const expectedValue = { - data: [ - { - id: 1, - name: 'string', - }, - { - id: 2, - name: 'string', - } - ], - meta: { - total: 2, - lastPage: Math.ceil(2 / 10), - currentPage: options.page, - perPage: 10, - prev: options.page > 1 ? options.page - 1 : null, - next: options.page < Math.ceil(options.page / 10) ? options.page + 1 : null, - } - }; - const paginatedResponse = await paginate(prisma, args, options); - expect(paginatedResponse).toEqual(expectedValue); - }); - it('Should return paginated response (perPage: 1, page: 2)', async () => { - jest.spyOn(prisma, 'findMany').mockReturnValueOnce([{ - id: 2, - name: 'string', - }]); - const args = { - where: { - description: 'string' - }, - }; - const options = { - page: 2, - perPage: 1, - }; - const expectedValue = { - data: [ - { - id: 2, - name: 'string', - } - ], - meta: { - total: 2, - lastPage: Math.ceil(2 / options.perPage), - currentPage: options.page, - perPage: options.perPage, - prev: options.page > 1 ? options.page - 1 : null, - next: options.page < Math.ceil(options.page / options.perPage) ? options.page + 1 : null, - } - }; - const paginatedResponse = await paginate(prisma, args, options); - expect(paginatedResponse).toEqual(expectedValue); - }); - it('Should return empty data', async () => { - jest.spyOn(prisma, 'count').mockReturnValueOnce(0); - jest.spyOn(prisma, 'findMany').mockReturnValueOnce([]); - const expectedValue = { - data: [], - meta: { - total: 0, - lastPage: Math.ceil(0 / 10), - currentPage: 1, - perPage: 10, - prev: 1 > 1 ? 1 - 1 : null, - next: 1 < Math.ceil(1 / 10) ? 1 + 1 : null, - } - }; - const paginatedResponse = await paginate(prisma, {}, {}); - expect(paginatedResponse).toEqual(expectedValue); - }); -}); -//# sourceMappingURL=paginator.spec.js.map \ No newline at end of file diff --git a/dist/test/prisma/paginator.spec.js.map b/dist/test/prisma/paginator.spec.js.map deleted file mode 100644 index cf307bd..0000000 --- a/dist/test/prisma/paginator.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"paginator.spec.js","sourceRoot":"","sources":["../../../test/prisma/paginator.spec.ts"],"names":[],"mappings":";;AAAA,mCAAs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aAC3F;SACJ,CAAC;QACF,MAAM,iBAAiB,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAEhE,MAAM,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACtC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QACvD,MAAM,aAAa,GAAG;YAClB,IAAI,EAAE,EAAE;YACR,IAAI,EAAE;gBACF,KAAK,EAAE,CAAC;gBACR,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;gBAC3B,WAAW,EAAE,CAAC;gBACd,OAAO,EAAE,EAAE;gBACX,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;gBAC1B,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI;aAC7C;SACJ,CAAA;QACD,MAAM,iBAAiB,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzD,MAAM,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/test/prisma/search-paginator.spec.d.ts b/dist/test/prisma/search-paginator.spec.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/test/prisma/search-paginator.spec.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/test/prisma/search-paginator.spec.js b/dist/test/prisma/search-paginator.spec.js deleted file mode 100644 index 14822a2..0000000 --- a/dist/test/prisma/search-paginator.spec.js +++ /dev/null @@ -1,134 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const src_1 = require("../../src"); -describe('Search Paginator', () => { - const searchPaginate = (0, src_1.searchPaginator)({ perPage: 10 }); - const prisma = { - $queryRawUnsafe: jest.fn(async (query) => [ - { - id: 1, - name: 'string', - description: 'Red', - row_count: 2, - }, - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 2, - } - ]), - }; - it('Should return all records paginated with search response', async () => { - const modelName = 'Users'; - const searchColumns = ['name', 'description']; - const options = { - searchColumns, - }; - const expectedValue = { - data: [ - { - id: 1, - name: 'string', - description: 'Red', - row_count: 2, - }, - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 2, - } - ], - meta: { - total: 2, - lastPage: Math.ceil(2 / 10), - currentPage: 1, - perPage: 10, - prev: 1 > 1 ? 1 - 1 : null, - next: 1 < Math.ceil(1 / 10) ? 1 + 1 : null, - } - }; - const paginatedResult = await searchPaginate(prisma, modelName, options); - expect(paginatedResult).toEqual(expectedValue); - }); - it('Should return only one record from search paginator', async () => { - jest.spyOn(prisma, '$queryRawUnsafe').mockReturnValueOnce(new Promise((resolve) => { - resolve([ - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 1, - } - ]); - })); - const modelName = 'Users'; - const searchColumns = ['name', 'description']; - const options = { - searchValue: 'Blue', - searchColumns, - }; - const expectedValue = { - data: [ - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 1, - } - ], - meta: { - total: 1, - lastPage: Math.ceil(1 / 10), - currentPage: 1, - perPage: 10, - prev: 1 > 1 ? 1 - 1 : null, - next: 1 < Math.ceil(1 / 10) ? 1 + 1 : null, - } - }; - const paginatedResult = await searchPaginate(prisma, modelName, options); - expect(paginatedResult).toEqual(expectedValue); - }); - it('Should return paginated response (perPage: 1, page: 2)', async () => { - jest.spyOn(prisma, '$queryRawUnsafe').mockReturnValueOnce(new Promise((resolve) => { - resolve([ - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 2, - } - ]); - })); - const modelName = 'Users'; - const searchColumns = ['name', 'description']; - const options = { - searchValue: 'string', - page: 2, - perPage: 1, - searchColumns, - }; - const expectedValue = { - data: [ - { - id: 2, - name: 'string', - description: 'Blue', - row_count: 2, - } - ], - meta: { - total: 2, - lastPage: Math.ceil(2 / options.perPage), - currentPage: options.page, - perPage: options.perPage, - prev: options.page > 1 ? options.page - 1 : null, - next: options.page < Math.ceil(options.page / options.perPage) ? options.page + 1 : null, - } - }; - const paginatedResponse = await searchPaginate(prisma, modelName, options); - expect(paginatedResponse).toEqual(expectedValue); - }); -}); -//# sourceMappingURL=search-paginator.spec.js.map \ No newline at end of file diff --git a/dist/test/prisma/search-paginator.spec.js.map b/dist/test/prisma/search-paginator.spec.js.map deleted file mode 100644 index 254d5a9..0000000 --- a/dist/test/prisma/search-paginator.spec.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"search-paginator.spec.js","sourceRoot":"","sources":["../../../test/prisma/search-paginator.spec.ts"],"names":[],"mappings":";;AAAA,mCAA4C;AAE5C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,MAAM,cAAc,GAAG,IAAA,qBAAe,EAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG;QACX,eAAe,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,KAAa,EAAE,EAAE,CAAC;YAC9C;gBACI,EAAE,EAAE,CAAC;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,CAAC;aACf;YACD;gBACI,EAAE,EAAE,CAAC;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,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,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 71b5c52..56a2164 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nodeteam/nestjs-prisma-pagination", - "version": "1.0.0", + "version": "1.0.1", "description": "Paginators for Nest.JS app", "main": "dist/index.js", "scripts": { @@ -20,22 +20,22 @@ "bugs": { "url": "https://github.com/nodeteamdev/nestjs-prisma-pagination/issues" }, - "homepage": "https://github.com/nodeteamdev/nestjs-prisma-pagination#readme", + "homepage": "https://www.nodeteam.onix-systems.com/", "dependencies": { - "@nestjs/common": "^9.4.0", - "@nestjs/testing": "^9.4.0", - "jest": "^29.5.0", - "ts-jest": "^29.1.0", - "typescript": "^5.0.4" + "@nestjs/common": "9.4.0", + "@nestjs/testing": "9.4.0", + "jest": "29.5.0", + "ts-jest": "29.1.0", + "typescript": "5.0.4" }, "devDependencies": { - "@jest/globals": "^29.5.0", - "@types/jest": "^29.5.1", - "@types/node": "^18.16.1", - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", - "eslint": "^8.39.0", - "eslint-config-airbnb-base": "^15.0.0" + "@jest/globals": "29.5.0", + "@types/jest": "29.5.1", + "@types/node": "18.16.1", + "@typescript-eslint/eslint-plugin": "5.59.1", + "@typescript-eslint/parser": "5.59.1", + "eslint": "8.39.0", + "eslint-config-airbnb-base": "15.0.0" }, "config": { "commitizen": { @@ -51,7 +51,7 @@ "rootDir": "", "testRegex": ".*\\.spec\\.ts$", "transform": { - "^.+\\.(t|j)s$": "ts-jest" + ".+\\.(t|j)s$": "ts-jest" }, "collectCoverageFrom": [ "**/*.(t|j)s" diff --git a/tsconfig.json b/tsconfig.json index 964555e..b68d1bf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,8 @@ "incremental": true, "strict": true, "esModuleInterop": true, - "skipLibCheck": true, - } + "skipLibCheck": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "test"] }