{"_id":"@anujsingh95/postmind-db","name":"@anujsingh95/postmind-db","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@anujsingh95/postmind-db","version":"1.0.0","description":"Shared database operations package for Postmind CLI and Web","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","prepublish":"npm run build","db:generate":"prisma generate","db:push":"prisma db push","db:migrate":"prisma migrate dev","db:studio":"prisma studio"},"keywords":["postmind","database","prisma","shared"],"author":"","license":"MIT","dependencies":{},"devDependencies":{"@types/node":"^20.10.0","prisma":"^5.22.0","typescript":"^5.3.0"},"peerDependencies":{"@prisma/client":"^5.22.0"},"peerDependenciesMeta":{"@prisma/client":{"optional":false}},"engines":{"node":">=18.0.0"},"gitHead":"ca3ef782d6c4dee052336668bed5e9962b7fcaad","_id":"@anujsingh95/postmind-db@1.0.0","_nodeVersion":"22.19.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-8v2olqqhs06/3GLplpvqZo2zJSSaeT75hdVoGAXJiu3k47tWUnnDl2nNHehzoCEBQr6vuLjwUiFZAM5zbVeO8Q==","shasum":"1760ab1ebd58983a1469b7b9fee0482d1faccf7e","tarball":"https://registry.npmjs.org/@anujsingh95/postmind-db/-/postmind-db-1.0.0.tgz","fileCount":47,"unpackedSize":115533,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDefxS+W3Y2oY8KIMpAWgnGZMW81ZgKBUby2PrqeRwDYwIhAN4XV9WbHteYWdsQZJJhFMXNn4Er5wRyo8in231OqXR8"}]},"_npmUser":{"name":"anujsingh95","email":"anujsinghjee1@gmail.com"},"directories":{},"maintainers":[{"name":"anujsingh95","email":"anujsinghjee1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postmind-db_1.0.0_1763619151154_0.965541690143005"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-20T06:12:31.082Z","1.0.0":"2025-11-20T06:12:31.347Z","modified":"2025-11-20T06:12:31.641Z"},"maintainers":[{"name":"anujsingh95","email":"anujsinghjee1@gmail.com"}],"description":"Shared database operations package for Postmind CLI and Web","keywords":["postmind","database","prisma","shared"],"license":"MIT","readme":"# @postmind/db\r\n\r\nShared database operations package for Postmind CLI and Web applications.\r\n\r\n## Overview\r\n\r\nThis package provides a unified interface for database operations, ensuring consistency between the CLI and Web applications. It abstracts Prisma operations into service layers that can be used by both applications.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @postmind/db\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Setup\r\n\r\n```typescript\r\nimport { prisma } from '@postmind/db';\r\nimport { CollectionService } from '@postmind/db/services/collections';\r\n\r\n// Use the shared Prisma client\r\nconst collections = await prisma.collection.findMany();\r\n\r\n// Or use the service layer\r\nconst collectionService = new CollectionService(prisma);\r\nconst allCollections = await collectionService.getCollections(userId, workspaceId);\r\n```\r\n\r\n### For CLI (with custom database URL)\r\n\r\n```typescript\r\nimport { initializePrisma } from '@postmind/db';\r\nimport { CollectionService } from '@postmind/db/services/collections';\r\n\r\nconst dbUrl = process.env.DATABASE_URL;\r\nconst prisma = initializePrisma(dbUrl);\r\nconst collectionService = new CollectionService(prisma);\r\n```\r\n\r\n## Services\r\n\r\n- `CollectionService` - Collection CRUD operations\r\n- `RequestService` - Request CRUD operations\r\n- `EnvironmentService` - Environment CRUD operations\r\n- `WorkspaceService` - Workspace CRUD operations\r\n- `HistoryService` - API history operations\r\n- `MockServerService` - Mock server operations\r\n\r\n## Development\r\n\r\n```bash\r\n# Generate Prisma client\r\nnpm run db:generate\r\n\r\n# Run migrations\r\nnpm run db:migrate\r\n\r\n# Build the package\r\nnpm run build\r\n```\r\n\r\n","readmeFilename":"README.md","_rev":"1-cc549af792e6a3b5e5bfa48d8e8bd3d6"}