{"_id":"@almandeel/baileys-store","_rev":"2-d3862aba3a845ddcc346c20682ddd0a8","name":"@almandeel/baileys-store","dist-tags":{"latest":"1.0.0-beta.3"},"versions":{"1.0.0-beta.1":{"name":"@almandeel/baileys-store","version":"1.0.0-beta.1","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/Almandeel/baileys-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"license":"MIT","scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier . --write"},"devDependencies":{"@adiwajshing/baileys":"^5.0.0","@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":{"tiny-invariant":"^1.3.1"},"peerDependencies":{"@adiwajshing/baileys":"^5.0.0","@prisma/client":"^4.7.0"},"gitHead":"9ea3bff18f3652783edc7da88b092b49d48655a9","bugs":{"url":"https://github.com/Almandeel/baileys-store/issues"},"homepage":"https://github.com/Almandeel/baileys-store#readme","_id":"@almandeel/baileys-store@1.0.0-beta.1","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-xZYyrkl9XiIB+xtbxpjsyhpJ7E6ME/f5B/Ki1y1Y75uV8hxvWZG5EIpvCaMWSivEvgs/IAouP9I/08h6bXVmjQ==","shasum":"f7b5d1da73c58095faa1b30ead11dfb322f39f32","tarball":"https://registry.npmjs.org/@almandeel/baileys-store/-/baileys-store-1.0.0-beta.1.tgz","fileCount":25,"unpackedSize":29831,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH30XC/c0obZUPm77D+QDi5OmIe7P+FuRnumX0CqPpVBAiEApw5fPI+zvauQsylQV9eDZ6g6MX8rdCelBIC+siBOJFI="}]},"_npmUser":{"name":"almandeel","email":"moezsapry2022@gmail.com"},"directories":{},"maintainers":[{"name":"almandeel","email":"moezsapry2022@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baileys-store_1.0.0-beta.1_1686398769657_0.6582410167382595"},"_hasShrinkwrap":false},"1.0.0-beta.2":{"name":"@almandeel/baileys-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/Almandeel/baileys-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":{"@whiskeysockets/baileys":"^6.2.1","@prisma/client":"^4.7.0"},"gitHead":"b6cf2ebba7ca90938a69c4ac95f7cf5f47acefc1","bugs":{"url":"https://github.com/Almandeel/baileys-store/issues"},"homepage":"https://github.com/Almandeel/baileys-store#readme","_id":"@almandeel/baileys-store@1.0.0-beta.2","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-qtmo5VzeEGj/2iqY67n/mHYkf3iLCJAFrbLRyUoGPpplO15M4Qm2+SHN8S2AMsq4W6hIsMvKn4ufSyL2L9mDpg==","shasum":"8575d46cfe704c54fd9e9b8512350095df2d1352","tarball":"https://registry.npmjs.org/@almandeel/baileys-store/-/baileys-store-1.0.0-beta.2.tgz","fileCount":25,"unpackedSize":30121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeQHSY3+qy/YZm4pxZEcppk4LJA2oP4CpuPZnh6yANsgIgPbolr5fJnfNvnE6f9mJfqSqyB4KH5yaaQS1s+q5AKXI="}]},"_npmUser":{"name":"almandeel","email":"moezsapry2022@gmail.com"},"directories":{},"maintainers":[{"name":"almandeel","email":"moezsapry2022@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baileys-store_1.0.0-beta.2_1686400162379_0.453956505010664"},"_hasShrinkwrap":false},"1.0.0-beta.3":{"name":"@almandeel/baileys-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/Almandeel/baileys-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"license":"MIT","scripts":{"build":"tsc","typecheck":"tsc --noEmit","lint":"eslint .","format":"prettier . --write"},"devDependencies":{"@adiwajshing/baileys":"github:WhiskeySockets/Baileys","@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":{"tiny-invariant":"^1.3.1"},"peerDependencies":{"@adiwajshing/baileys":"github:WhiskeySockets/Baileys","@prisma/client":"^4.7.0"},"gitHead":"cb9a1e70f517dc605447807ce946f35eab457c2e","bugs":{"url":"https://github.com/Almandeel/baileys-store/issues"},"homepage":"https://github.com/Almandeel/baileys-store#readme","_id":"@almandeel/baileys-store@1.0.0-beta.3","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-sj4GOh5bQOcAiFkggInDTevHL3xMr/oKXFHgblLD7F0irhQY90PgIC0KBiyAxyrXa18NDERmIgEzeaGUIDZung==","shasum":"0fd5ce3d364152bc30c30410a8187b1f106ed2ba","tarball":"https://registry.npmjs.org/@almandeel/baileys-store/-/baileys-store-1.0.0-beta.3.tgz","fileCount":25,"unpackedSize":30161,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr1eJYXEdytTYt8gGPGXrpibgMaWfV0d8+8D779FVigQIhANzt+GUxZMEawP60TXaausmuPY5RJVzX+bmRnUzhvzg8"}]},"_npmUser":{"name":"almandeel","email":"moezsapry2022@gmail.com"},"directories":{},"maintainers":[{"name":"almandeel","email":"moezsapry2022@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/baileys-store_1.0.0-beta.3_1686441683127_0.4293701093134423"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-10T12:06:09.581Z","1.0.0-beta.1":"2023-06-10T12:06:09.826Z","modified":"2023-06-11T00:01:23.425Z","1.0.0-beta.2":"2023-06-10T12:29:22.586Z","1.0.0-beta.3":"2023-06-11T00:01:23.308Z"},"maintainers":[{"name":"almandeel","email":"moezsapry2022@gmail.com"}],"description":"Minimal Baileys data storage for your favorite DBMS built with Prisma","homepage":"https://github.com/Almandeel/baileys-store#readme","repository":{"type":"git","url":"git+https://github.com/Almandeel/baileys-store.git"},"author":{"name":"Royhan","url":"https://github.com/ookamiiixd"},"bugs":{"url":"https://github.com/Almandeel/baileys-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 '@adiwajshing/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"}