{"_id":"@agabidullin/next-crud","_rev":"3-bdd0d4e8c9703c9c93d4d8188e5a9ac2","name":"@agabidullin/next-crud","dist-tags":{"latest":"4.0.1"},"versions":{"3.0.0":{"name":"@agabidullin/next-crud","version":"3.0.0","author":{"name":"Hugo FOYART","email":"hfoyart@premieroctet.com"},"license":"MIT","_id":"@agabidullin/next-crud@3.0.0","maintainers":[{"name":"agabidullin","email":"agabidullin@gmail.com"}],"homepage":"https://github.com/agabidullin/next-crud#readme","bugs":{"url":"https://github.com/agabidullin/next-crud/issues"},"dist":{"shasum":"9babe51422c857780f7f5cfb270ac7ad8e46a1d7","tarball":"https://registry.npmjs.org/@agabidullin/next-crud/-/next-crud-3.0.0.tgz","fileCount":45,"integrity":"sha512-hwRVyQyL3TeE/bLHu7LEofGZJhcfRw48cbClqUxgA+EXW8SlcCJnshNtNGhx5nk9VmGsdsX+6HUX31fKCMlzew==","signatures":[{"sig":"MEUCIQCAexvyiQWpGG8B+2RVRToOTUIp5EFhU7sVxwV+SIn/qgIgVfukIPMIOAwe1YgCTj5wPthPYwKmS8JC9vG/P1QRIEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91276},"main":"./dist/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"types":"./dist/index.d.ts","gitHead":"f5e57d9dcd636ec3cc17a4f38669b1ff13b9828f","private":false,"scripts":{"lint":"eslint ./src","test":"jest -i","build":"yarn clean && ./node_modules/.bin/tsc","clean":"rimraf dist","watch":"tsc --watch","test:prepare":"yarn add @prisma/client@^5 && cd __tests__/adapters/prisma && npx prisma@5 db push","prepublishOnly":"yarn lint && yarn build"},"_npmUser":{"name":"agabidullin","email":"agabidullin@gmail.com"},"repository":{"url":"git+https://github.com/agabidullin/next-crud.git","type":"git"},"_npmVersion":"10.1.0","description":"Next.js CRUD routes generation helper","directories":{},"lint-staged":{"./src/*.ts":"eslint --cache --fix"},"_nodeVersion":"20.7.0","dependencies":{"qs":"^6.9.4","pluralize":"^8.0.0","lodash.set":"^4.3.2","path-to-regexp":"^6.2.0","lodash.isobject":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","next":"^12.1.5","husky":">=4","eslint":"^7.14.0","rimraf":"^3.0.2","express":"^4.18.2","ts-jest":"^26.4.4","@types/qs":"^6.9.5","typescript":"^5.2.2","@types/jest":"^26.0.15","@types/node":"^14.14.9","lint-staged":">=10","@types/express":"^4.17.17","node-mocks-http":"^1.12.2","@types/pluralize":"^0.0.30","@types/lodash.set":"^4.3.6","@types/lodash.isobject":"^3.0.6","@typescript-eslint/parser":"^6.6.0","prisma-json-schema-generator":"^4.0.0","@typescript-eslint/eslint-plugin":"^6.6.0"},"optionalDependencies":{"@prisma/client":"^5","prisma-json-schema-generator":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/next-crud_3.0.0_1699551107968_0.6256394837726453","host":"s3://npm-registry-packages"}},"3.0.1":{"name":"@agabidullin/next-crud","version":"3.0.1","author":{"name":"Hugo FOYART","email":"hfoyart@premieroctet.com"},"license":"MIT","_id":"@agabidullin/next-crud@3.0.1","maintainers":[{"name":"agabidullin","email":"agabidullin@gmail.com"}],"homepage":"https://github.com/agabidullin/next-crud#readme","bugs":{"url":"https://github.com/agabidullin/next-crud/issues"},"dist":{"shasum":"b14eb35fa42d7d22b40ac11774b1fdd07d658a72","tarball":"https://registry.npmjs.org/@agabidullin/next-crud/-/next-crud-3.0.1.tgz","fileCount":46,"integrity":"sha512-JcaDJc/Mm3ywyZzyis9PH857/lO4ZseYBjQ3qJKO4ta1Aw8s3Ub6mSVg+XdRyfj3EbN3PU7Y+hCaOZMY7uKh0g==","signatures":[{"sig":"MEQCICQqD0n2F3uDnk2TVn+4BCOX+KleI5B6YWkcCRQIC+TQAiBKE2wSCQVFKSITLoA1rIGuLM/R2F/35jcrCPFhpnkACA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":110347},"main":"./dist/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"types":"./dist/index.d.ts","gitHead":"0ea8be4cbbd06e3e51a1cc51802ff4f2caf16147","private":false,"scripts":{"lint":"eslint ./src","test":"jest -i","build":"yarn clean && ./node_modules/.bin/tsc","clean":"rimraf dist","watch":"tsc --watch","test:prepare":"yarn add @prisma/client@^5 && cd __tests__/adapters/prisma && npx prisma@5 db push","prepublishOnly":"yarn lint && yarn build"},"_npmUser":{"name":"agabidullin","email":"agabidullin@gmail.com"},"repository":{"url":"git+https://github.com/agabidullin/next-crud.git","type":"git"},"_npmVersion":"10.1.0","description":"Next.js CRUD routes generation helper","directories":{},"lint-staged":{"./src/*.ts":"eslint --cache --fix"},"_nodeVersion":"20.7.0","dependencies":{"qs":"^6.9.4","pluralize":"^8.0.0","lodash.set":"^4.3.2","path-to-regexp":"^6.2.0","lodash.isobject":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","next":"^12.1.5","husky":">=4","eslint":"^7.14.0","rimraf":"^3.0.2","express":"^4.18.2","ts-jest":"^26.4.4","@types/qs":"^6.9.5","typescript":"^5.2.2","@types/jest":"^26.0.15","@types/node":"^14.14.9","lint-staged":">=10","@types/express":"^4.17.17","node-mocks-http":"^1.12.2","@types/pluralize":"^0.0.30","@types/lodash.set":"^4.3.6","@types/lodash.isobject":"^3.0.6","@typescript-eslint/parser":"^6.6.0","prisma-json-schema-generator":"^4.0.0","@typescript-eslint/eslint-plugin":"^6.6.0"},"optionalDependencies":{"@prisma/client":"^5","prisma-json-schema-generator":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/next-crud_3.0.1_1702030519475_0.8499626221126477","host":"s3://npm-registry-packages"}},"3.0.2":{"name":"@agabidullin/next-crud","version":"3.0.2","author":{"name":"Hugo FOYART","email":"hfoyart@premieroctet.com"},"license":"MIT","_id":"@agabidullin/next-crud@3.0.2","maintainers":[{"name":"agabidullin","email":"agabidullin@gmail.com"}],"homepage":"https://github.com/agabidullin/next-crud#readme","bugs":{"url":"https://github.com/agabidullin/next-crud/issues"},"dist":{"shasum":"d95096b4c8519b9d62a5a148935c0632c0aed54e","tarball":"https://registry.npmjs.org/@agabidullin/next-crud/-/next-crud-3.0.2.tgz","fileCount":45,"integrity":"sha512-6aBTyNdVnl8EAGBhW48KVjMt91z6i7/NrcgcCGZ4egvu/7WykEgw5KC3f64GRAlUBr+J6LXX2J+tIHSZIisuyg==","signatures":[{"sig":"MEUCIQDFErl8QsS8ls7sleAmSCuDV15RSXW3xOb8AKkHoWvrvQIgJad84pCT1VQ3EDWd0iIx+Je+q4cGKovJ/nfEHkJpYCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":91534},"main":"./dist/index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"types":"./dist/index.d.ts","gitHead":"ac2e8e1ff795c42cca60ed90a001dd95fa06df8b","private":false,"scripts":{"lint":"eslint ./src","test":"jest -i","build":"yarn clean && ./node_modules/.bin/tsc","clean":"rimraf dist","watch":"tsc --watch","test:prepare":"yarn add @prisma/client@^5 && cd __tests__/adapters/prisma && npx prisma@5 db push","prepublishOnly":"yarn lint && yarn build"},"_npmUser":{"name":"agabidullin","email":"agabidullin@gmail.com"},"repository":{"url":"git+https://github.com/agabidullin/next-crud.git","type":"git"},"_npmVersion":"10.1.0","description":"Next.js CRUD routes generation helper","directories":{},"lint-staged":{"./src/*.ts":"eslint --cache --fix"},"_nodeVersion":"20.7.0","dependencies":{"qs":"^6.9.4","pluralize":"^8.0.0","lodash.set":"^4.3.2","path-to-regexp":"^6.2.0","lodash.isobject":"^3.0.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","next":"^12.1.5","husky":">=4","eslint":"^7.14.0","rimraf":"^3.0.2","express":"^4.18.2","ts-jest":"^26.4.4","@types/qs":"^6.9.5","typescript":"^5.2.2","@types/jest":"^26.0.15","@types/node":"^14.14.9","lint-staged":">=10","@types/express":"^4.17.17","node-mocks-http":"^1.12.2","@types/pluralize":"^0.0.30","@types/lodash.set":"^4.3.6","@types/lodash.isobject":"^3.0.6","@typescript-eslint/parser":"^6.6.0","prisma-json-schema-generator":"^4.0.0","@typescript-eslint/eslint-plugin":"^6.6.0"},"optionalDependencies":{"@prisma/client":"^5","prisma-json-schema-generator":"^3.0.1"},"_npmOperationalInternal":{"tmp":"tmp/next-crud_3.0.2_1702039329937_0.6923609160710931","host":"s3://npm-registry-packages"}},"4.0.1":{"name":"@agabidullin/next-crud","version":"4.0.1","description":"Next.js CRUD routes generation helper","main":"./dist/index.js","types":"./dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/agabidullin/next-crud.git"},"author":{"name":"Hugo FOYART","email":"hfoyart@premieroctet.com"},"license":"MIT","private":false,"scripts":{"build":"yarn clean && ./node_modules/.bin/tsc","clean":"rimraf dist","lint":"eslint ./src","prepublishOnly":"yarn lint && yarn build","test":"jest -i","test:prepare":"yarn add @prisma/client@^5 && cd __tests__/adapters/prisma && npx prisma@5 db push","watch":"tsc --watch"},"devDependencies":{"@types/express":"^4.17.17","@types/jest":"^29.5.12","@types/lodash.isobject":"^3.0.6","@types/lodash.set":"^4.3.6","@types/node":"^20.11.30","@types/pluralize":"^0.0.30","@types/qs":"^6.9.5","@typescript-eslint/eslint-plugin":"^6.6.0","@typescript-eslint/parser":"^6.6.0","eslint":"^7.14.0","express":"^4.18.2","husky":">=4","jest":"^29.7.0","lint-staged":">=10","next":"^14.1.1","node-mocks-http":"^1.12.2","prisma-json-schema-generator":"^4.0.0","rimraf":"^3.0.2","ts-jest":"^29.1.2","typescript":"^5.2.2"},"optionalDependencies":{"@prisma/client":"^5","prisma-json-schema-generator":"^3.0.1"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"./src/*.ts":"eslint --cache --fix"},"dependencies":{"lodash.isobject":"^3.0.2","lodash.set":"^4.3.2","path-to-regexp":"^6.2.0","pluralize":"^8.0.0","qs":"^6.9.4"},"_id":"@agabidullin/next-crud@4.0.1","gitHead":"53d1c0973fc862f22a8993e99885ed650fef4024","bugs":{"url":"https://github.com/agabidullin/next-crud/issues"},"homepage":"https://github.com/agabidullin/next-crud#readme","_nodeVersion":"21.6.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-s3DTMmY3R8VsOQkcaHLRNSpLh4vFzLPvikSg43zwFaK+4/eenwE/QBkVbYTwRcZ076paNkDIoMsFrSDskpzbRg==","shasum":"57ce09c97d1035a33000bb50d07a892957a4a774","tarball":"https://registry.npmjs.org/@agabidullin/next-crud/-/next-crud-4.0.1.tgz","fileCount":45,"unpackedSize":93698,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5jNFIt0AbeZxlftOEJ6ASECwuEK0wv4n7pQYSpW4DIgIgb4rqDQmofIicO5nA8CxQdXFwzK96QQ1tJ4+IhulIgfs="}]},"_npmUser":{"name":"agabidullin","email":"agabidullin@gmail.com"},"directories":{},"maintainers":[{"name":"agabidullin","email":"agabidullin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/next-crud_4.0.1_1721652263239_0.3156398589995797"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-09T17:31:47.843Z","modified":"2024-07-22T12:44:23.565Z","3.0.0":"2023-11-09T17:31:48.331Z","3.0.1":"2023-12-08T10:15:19.715Z","3.0.2":"2023-12-08T12:42:10.115Z","4.0.1":"2024-07-22T12:44:23.391Z"},"bugs":{"url":"https://github.com/agabidullin/next-crud/issues"},"author":{"name":"Hugo FOYART","email":"hfoyart@premieroctet.com"},"license":"MIT","homepage":"https://github.com/agabidullin/next-crud#readme","repository":{"type":"git","url":"git+https://github.com/agabidullin/next-crud.git"},"description":"Next.js CRUD routes generation helper","maintainers":[{"name":"agabidullin","email":"agabidullin@gmail.com"}],"readme":"# Next Crud\n\n[![NPM Version](https://img.shields.io/npm/v/@premieroctet/next-crud/latest)](https://www.npmjs.com/package/@premieroctet/next-crud)\n[![NPM License](https://img.shields.io/npm/l/all-contributors.svg?style=flat)](https://github.com/premieroctet/next-crud/blob/master/LICENSE)\n[![Github Actions](https://github.com/premieroctet/next-crud/workflows/next-crud/badge.svg)](https://github.com/premieroctet/next-crud/actions?query=workflow%3Anext-crud)\n\n`next-crud` is a helper library that creates CRUD API routes with one simple function based on a Prisma model for Next.js.\n\n**Starting from version 3 of the lib, we only support Prisma v5 and above. Please install version 2 of the lib if you are using Prisma v4 or older.**\n\n# Documentation\n\nThe documentation is available [here](https://next-crud.js.org/)\n\n# Overview\n\n`yarn add @premieroctet/next-crud`\n\nGiven the following Prisma schema:\n\n```sql\nmodel User {\n  id              Int        @id @default(autoincrement())\n  name            String?\n  email           String?\n}\n```\n\nCreate the file `/pages/api/[...nextcrud].ts.` with:\n\n```javascript\nimport NextCrud, { PrismaAdapter } from '@premieroctet/next-crud'\nimport { NextApiRequest, NextApiResponse } from 'next'\n\nconst handler = async (req: NextApiRequest, res: NextApiResponse) => {\n  const nextCrudHandler = await NextCrud({\n    adapter: new PrismaAdapter({\n      prismaClient: myPrismaClientInstance,\n    }),\n  })\n\n  return nextCrudHandler(req, res)\n}\n\nexport default handler\n```\n\nAnd get your full featured CRUD routes!\n\n|              | Endpoint                | Description               |\n| ------------ | ----------------------- | ------------------------- |\n| List         | GET `/api/users`        | Get all the users         |\n| Get          | GET `/api/users/[id]`   | Get one user              |\n| Add          | POST `/api/users`       | Create one user           |\n| Edit         | PUT `/api/users/[id]`   | Update one user           |\n| Partial edit | PATCH `/api/users/[id]` | Update one user (partial) |\n| Delete       | DELETE`/api/users/[id]` | Delete one user           |\n\n# Example\n\n[![Open in CodeSandbox](https://img.shields.io/badge/Open%20in-CodeSandbox-blue?style=flat-square&logo=codesandbox)](https://codesandbox.io/s/next-crud-demo-qj3gn)\n\n# Contributing\n\nYou can run the example project to test your modifications. Make sure to run `yarn watch` in the root folder.\n\n# Sponsors\n\nThis project is being developed by [Premier Octet](https://www.premieroctet.com), a Web and mobile agency specializing in React and React Native developments.\n","readmeFilename":"README.md"}