{"_id":"@drizion/wabot-store","_rev":"1-d63a4ea34f4c7dcda5cbedca2203a6d3","name":"@drizion/wabot-store","dist-tags":{"latest":"1.0.0-beta.3"},"versions":{"1.0.0-beta.2":{"name":"@drizion/wabot-store","version":"1.0.0-beta.2","description":"Minimal Baileys data storage for your favorite DBMS built with Prisma","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/drizion/wabot-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"license":"MIT","scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier . --write"},"devDependencies":{"@prisma/client":"^4.7.1","@types/node":"^18.11.10","@typescript-eslint/eslint-plugin":"^5.45.0","@typescript-eslint/parser":"^5.45.0","eslint":"^8.29.0","eslint-config-prettier":"^8.5.0","prettier":"^2.8.0","prisma":"^4.7.1","ts-node":"^10.9.1","typescript":"^4.9.3"},"dependencies":{"@whiskeysockets/baileys":"^6.2.1","tiny-invariant":"^1.3.1"},"peerDependencies":{"@prisma/client":"^4.7.0"},"gitHead":"cfd8a370a1ec12644adb58b7e73595e172132546","bugs":{"url":"https://github.com/drizion/wabot-store/issues"},"homepage":"https://github.com/drizion/wabot-store#readme","_id":"@drizion/wabot-store@1.0.0-beta.2","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-WAqWBmyLF8RZKwRyRj7Yu2fGpfsAEGQRld5YzcVNu8VIE72lawwQ1YuWiJPYwpUDGFWMtiox2cFpkE2n/kAENw==","shasum":"fbdb9d4fba9d325708d617a92c869be153d7774e","tarball":"https://registry.npmjs.org/@drizion/wabot-store/-/wabot-store-1.0.0-beta.2.tgz","fileCount":25,"unpackedSize":39908,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNM03wri0HkIkxmCyquwgP5Ef7zh6LAbx7NRlNzjmLoAIgcCGLrVHKjKy8lVSVv1gg/XRIIQkfyq+/PNCQFmwMWQA="}]},"_npmUser":{"name":"drizion.dev","email":"gabrieldasilvadevargas@gmail.com"},"directories":{},"maintainers":[{"name":"drizion.dev","email":"gabrieldasilvadevargas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wabot-store_1.0.0-beta.2_1687035919937_0.05407060567635136"},"_hasShrinkwrap":false},"1.0.0-beta.3":{"name":"@drizion/wabot-store","version":"1.0.0-beta.3","description":"Minimal Baileys data storage for your favorite DBMS built with Prisma","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/drizion/wabot-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"license":"MIT","scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier . --write"},"devDependencies":{"@prisma/client":"^4.7.1","@types/node":"^18.11.10","@typescript-eslint/eslint-plugin":"^5.45.0","@typescript-eslint/parser":"^5.45.0","eslint":"^8.29.0","eslint-config-prettier":"^8.5.0","prettier":"^2.8.0","prisma":"^4.7.1","ts-node":"^10.9.1","typescript":"^4.9.3"},"dependencies":{"@whiskeysockets/baileys":"^6.2.1","tiny-invariant":"^1.3.1"},"peerDependencies":{"@prisma/client":"^4.7.0"},"gitHead":"056331acf2a73ebf7b414bc50284355c333bfbb0","bugs":{"url":"https://github.com/drizion/wabot-store/issues"},"homepage":"https://github.com/drizion/wabot-store#readme","_id":"@drizion/wabot-store@1.0.0-beta.3","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-DtzdiygxQK1o75LZIa65SMRumaToJK4vr0bPfIluiT79RCnYX8daorH6A2bi9dD6g+/zG/shQNW0CfjJk+sz3g==","shasum":"de82e8451f6246b24db59d601e1f0e2b5bc4c0fa","tarball":"https://registry.npmjs.org/@drizion/wabot-store/-/wabot-store-1.0.0-beta.3.tgz","fileCount":25,"unpackedSize":39313,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF/2RkH0CXaVZ9Sc1jsbY97FZxBnCt/iSH0NzUEX3m01AiEAsvsttKRelMzic7KoPW7LltPvbo3oAG2qHF7uSex9xRU="}]},"_npmUser":{"name":"drizion.dev","email":"gabrieldasilvadevargas@gmail.com"},"directories":{},"maintainers":[{"name":"drizion.dev","email":"gabrieldasilvadevargas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wabot-store_1.0.0-beta.3_1687040349683_0.24327372552803883"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-17T21:05:19.878Z","1.0.0-beta.2":"2023-06-17T21:05:20.124Z","modified":"2023-06-17T22:19:09.993Z","1.0.0-beta.3":"2023-06-17T22:19:09.876Z"},"maintainers":[{"name":"drizion.dev","email":"gabrieldasilvadevargas@gmail.com"}],"description":"Minimal Baileys data storage for your favorite DBMS built with Prisma","homepage":"https://github.com/drizion/wabot-store#readme","repository":{"type":"git","url":"git+https://github.com/drizion/wabot-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"bugs":{"url":"https://github.com/drizion/wabot-store/issues"},"license":"MIT","readme":"> 🚨 **NOTICE**: `@adiwajshing/baileys` which is this project relied on, has been discontinued. Thus, this project will be archived and stopped receiving updates anymore. Thanks everyone who's been part of this❤️\n\n---\n\n# Baileys Store\n\nMinimal Baileys data storage for your favorite DBMS built with Prisma. This library is a simple handler for Baileys event emitter that will listen and update your data in the database\n\n## Requirements\n\n- **Prisma** version **4.7.x** or higher\n- **Baileys** version **5.x.x** or higher\n\n## Supported Databases\n\n- MySQL and PostgreSQL database should support the default schema out of the box\n- For CockroachDB, you need to do this small change in the schema file\n\n```diff prisma\nmodel Session {\n  pkId      BigInt    @id @default(autoincrement())\n  sessionId String\n  id        String\n-  data      String @db.Text\n+  data      String\n\n  @@unique([sessionId, id], map: \"unique_id_per_session_id_session\")\n  @@index([sessionId])\n}\n```\n\n- For MongoDB, you need to follow [this convention](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference?query=getdmff&page=1#mongodb-10) and update the `pkId` field. Then follow the previous CockroachDB guide\n- SQLite and SQL Server database are not supported since they didn't support Prisma's `JSON` scalar type\n\n## Installation\n\n```bash\n# Using npm\nnpm i @ookamiiixd/baileys-store\n\n# Using yarn\nyarn add @ookamiiixd/baileys-store\n```\n\n## Setup\n\nBefore you can actually use this library, you have to setup your database first\n\n1. Copy the `.env.example` file from this repository or from the `node_modules` directory (should be located at `node_modules/@ookamiiixd/baileys-store/.env.example`). Rename it into `.env` and then update your [connection url](https://www.prisma.io/docs/reference/database-reference/connection-urls) in the `DATABASE_URL` field\n1. Copy the `prisma` directory from this repository or from the `node_modules` directory (should be located at `node_modules/@ookamiiixd/baileys-store/prisma/`). Additionaly, you may want to update your `provider` in the `schema.prisma` file if you're not using MySQL database\n1. Run your [migration](https://www.prisma.io/docs/reference/api-reference/command-reference#prisma-migrate)\n\n## Usage\n\n```ts\nimport pino from 'pino';\nimport makeWASocket from '@whiskeysockets/baileys';\nimport { PrismaClient } from '@prisma/client';\nimport { initStore, Store } from '@ookamiiixd/baileys-store';\n\nconst logger = pino();\nconst socket = makeWASocket();\nconst prisma = new PrismaClient();\n\n// You only need to run this once\ninitStore({\n  prisma, // Prisma client instance\n  logger, // Pino logger (Optional)\n});\n\n// Create a store and start listening to the events\nconst store = new Store('unique-session-id-here', socket.ev);\n\n// That's it, you can now query from the prisma client without having to worry about handling the events\nconst messages = prisma.message.findMany();\n```\n\n## Contributing\n\nPRs, issues, suggestions, etc are welcome. Please kindly open a new issue to discuss it\n","readmeFilename":"README.md"}