{"_id":"@croco/customer-health-drizzle","_rev":"2-ce2cca12316f27b50c6bee5b384c3178","name":"@croco/customer-health-drizzle","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@croco/customer-health-drizzle","version":"0.0.1","_id":"@croco/customer-health-drizzle@0.0.1","maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"dist":{"shasum":"69d07a6af575ed4eca1963704d5f8f5e4976c72c","tarball":"https://registry.npmjs.org/@croco/customer-health-drizzle/-/customer-health-drizzle-0.0.1.tgz","fileCount":6,"integrity":"sha512-Iq+R1wq5oOou5+TkEsn2EswuMlKNIRGC3CTcIxV5qWgGc2tv7U4+RQd0HYsb+ktDLvx6/LfcZhCOsM61bNMegQ==","signatures":[{"sig":"MEUCIDvR/Ga2hEUDWePlu15Ez7XCRlHVV3K/LfUnZWOhx3m5AiEA+yjvlGM04QiOoso9/nEShjgt7shNACDO5fmzFVLa0bY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31402},"main":"./dist/index.js","type":"commonjs","_from":"file:croco-customer-health-drizzle-0.0.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"lint":"oxlint .","test":"vitest run","build":"tsup src/index.ts --format esm,cjs --minify --clean --dts","deploy":"pnpm run build && pnpm publish --no-git-checks","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kang-heewon","email":"heewon.dev@gmail.com"},"_resolved":"/tmp/3ba692ec41db06140c7ba1b3d2cd9a5e/croco-customer-health-drizzle-0.0.1.tgz","_integrity":"sha512-Iq+R1wq5oOou5+TkEsn2EswuMlKNIRGC3CTcIxV5qWgGc2tv7U4+RQd0HYsb+ktDLvx6/LfcZhCOsM61bNMegQ==","_npmVersion":"10.9.7","description":"`@croco/customer-health-core`용 Drizzle 구현체입니다.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@croco/tx-drizzle":"0.0.1","@croco/framework-context":"0.0.1","@croco/customer-health-core":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"drizzle-orm":"^0.45.2"},"peerDependencies":{"drizzle-orm":"^0.45.2"},"_npmOperationalInternal":{"tmp":"tmp/customer-health-drizzle_0.0.1_1778834239934_0.6703587224475165","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@croco/customer-health-drizzle","version":"0.0.2","type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"dependencies":{"@croco/tx-drizzle":"0.0.2","@croco/framework-context":"0.0.2","@croco/customer-health-core":"0.0.2"},"devDependencies":{"drizzle-orm":"^0.45.2"},"peerDependencies":{"drizzle-orm":"^0.45.2"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --minify --clean --dts","deploy":"pnpm run build && pnpm publish --no-git-checks","lint":"oxlint .","test":"vitest run","typecheck":"tsc --noEmit"},"exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"_id":"@croco/customer-health-drizzle@0.0.2","description":"`@croco/customer-health-core`용 Drizzle 구현체입니다.","_integrity":"sha512-qWe8QA9tA35C6IWaBfI8BRZCfZY0dZKBn7QVIreDSRcNzWsEDQ25kEkiXoJlVmR1vC0BTZGM0gCctmXnUScCKA==","_resolved":"/private/var/folders/zp/px4pj6gs20q8c38hgmbym1080000gn/T/51a66e10cdfc09770b4330a694547a62/croco-customer-health-drizzle-0.0.2.tgz","_from":"file:croco-customer-health-drizzle-0.0.2.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-qWe8QA9tA35C6IWaBfI8BRZCfZY0dZKBn7QVIreDSRcNzWsEDQ25kEkiXoJlVmR1vC0BTZGM0gCctmXnUScCKA==","shasum":"0f4cdb7fef6ba7c3cc2cb44409fab0326a3f7ec5","tarball":"https://registry.npmjs.org/@croco/customer-health-drizzle/-/customer-health-drizzle-0.0.2.tgz","fileCount":6,"unpackedSize":31402,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCmYg+0hMit5U9C/SF2PQUcD9aZ+yGoKH+aiyEAu1CHvwIgCFeqr31We1avGeMln9NnYhJYwb4yIHhFIGNkrSMZ0vQ="}]},"_npmUser":{"name":"kang-heewon","email":"heewon.dev@gmail.com"},"directories":{},"maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/customer-health-drizzle_0.0.2_1780294872072_0.3701115245714519"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T08:37:19.871Z","modified":"2026-06-01T06:21:12.357Z","0.0.1":"2026-05-15T08:37:20.075Z","0.0.2":"2026-06-01T06:21:12.237Z"},"description":"`@croco/customer-health-core`용 Drizzle 구현체입니다.","maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"readme":"# @croco/customer-health-drizzle\n\n`@croco/customer-health-core`용 Drizzle 구현체입니다.\n\n## 설치\n\n```bash\npnpm add @croco/customer-health-drizzle @croco/customer-health-core drizzle-orm\n```\n\n## 사용법\n\n```typescript\nimport {\n  BillingSignalProvider,\n  DrizzleHealthScoreStore,\n  DrizzleHealthSignalRegistry,\n  MeteringSignalProvider,\n} from \"@croco/customer-health-drizzle\";\n\nconst scoreStore = new DrizzleHealthScoreStore(db);\nconst usageProvider = new MeteringSignalProvider(usageStorage);\nconst billingProvider = new BillingSignalProvider(subscriptionStorage);\nconst registry = new DrizzleHealthSignalRegistry(usageProvider, billingProvider);\n\nawait scoreStore.save({\n  tenantId: \"tenant-1\",\n  overallScore: 85,\n  status: \"healthy\",\n  categoryScores: { usage: 90, business: 80, engagement: 85 },\n  signals: [],\n  trend: \"stable\",\n  calculatedAt: new Date(),\n});\n\nconst latest = await scoreStore.findLatest(\"tenant-1\");\nconst providers = registry.getProviders();\n```\n\n## API 레퍼런스\n\n### `DrizzleHealthScoreStore`\n\n- `save(score)`, 건강 점수 스냅샷을 저장합니다.\n- `findLatest(tenantId)`, 최신 건강 점수를 조회합니다.\n- `findHistory(tenantId, limit)`, 최근 점수 이력을 조회합니다.\n- `findHistoryByPeriod(tenantId, period, startDate, endDate)`, 기간별 이력을 조회합니다.\n\n### 신호 제공자\n\n- `BillingSignalProvider`, 구독 상태를 business 신호로 변환합니다.\n- `MeteringSignalProvider`, 사용량 데이터를 usage 신호로 변환합니다.\n- `DrizzleHealthSignalRegistry`, 기본 신호 제공자 목록을 반환합니다.\n\n### 타입과 스키마\n\n- `SubscriptionStatus`, `SubscriptionData`, `SubscriptionStorage`, 구독 신호 타입입니다.\n- `UsageData`, `UsageStorage`, 사용량 신호 타입입니다.\n- `DRIZZLE_TOKEN`, 건강 점수 저장소용 DB 토큰입니다.\n- `SUBSCRIPTION_STORAGE_TOKEN`, `USAGE_STORAGE_TOKEN`, 보조 저장소 토큰입니다.\n- `tenantHealthScores`, 건강 점수 스키마입니다.\n","readmeFilename":"README.md"}