{"_id":"@camelburrito/cf-utils","name":"@camelburrito/cf-utils","dist-tags":{"latest":"0.3.2"},"versions":{"0.3.2":{"name":"@camelburrito/cf-utils","version":"0.3.2","description":"Agnostic Cloud Functions utilities: PII-redacting logger, writeWithAudit, rate limit, idempotency, validation, wrapHandler.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"vitest run","prepublishOnly":"npm run build && npm run test"},"publishConfig":{"registry":"https://npm.pkg.github.com","access":"restricted"},"repository":{"type":"git","url":"git+https://github.com/camelburrito/keel.git","directory":"packages/cf-utils"},"dependencies":{"redact-pii":"^3.2.0"},"peerDependencies":{"firebase-admin":"^12.0.0","firebase-functions":"^5.0.0"},"devDependencies":{"@types/node":"^20.0.0","firebase-admin":"^12.0.0","firebase-functions":"^5.0.0","typescript":"^5.6.0","vitest":"^2.0.0","@vitest/coverage-v8":"^2.0.0"},"engines":{"node":">=20"},"keywords":["firebase","cloud-functions","pii","logger","audit","keel"],"license":"MIT","private":false,"gitHead":"e14ed8c7e4213305ab0d1604552b9b117a3e5c1f","_id":"@camelburrito/cf-utils@0.3.2","bugs":{"url":"https://github.com/camelburrito/keel/issues"},"homepage":"https://github.com/camelburrito/keel#readme","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-jCftLRxut9LwxXvRcW+5JCt0nWRr1uocBLm1f4ZRgAWTpFrhH1P7joOPZlMpvOySLNTNbNg2AUeH5bewxvl+Wg==","shasum":"afaf8f517a6359e3911f80dbbcfa3bff71c46bdd","tarball":"https://registry.npmjs.org/@camelburrito/cf-utils/-/cf-utils-0.3.2.tgz","fileCount":35,"unpackedSize":73303,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCnux0B0SSomIL0BtDAEaDIPfYH1w5jRsub7FJOKAVtSgIhAP0ObbRoA9XV9t6tjox/34JVF5ZhFZHOEUVWKfA0Fp8P"}]},"_npmUser":{"name":"camelburrito","email":"sriramkrish85@gmail.com"},"directories":{},"maintainers":[{"name":"camelburrito","email":"sriramkrish85@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cf-utils_0.3.2_1782875938892_0.4793062023518604"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-01T03:18:58.763Z","0.3.2":"2026-07-01T03:18:59.015Z","modified":"2026-07-01T03:18:59.188Z"},"maintainers":[{"name":"camelburrito","email":"sriramkrish85@gmail.com"}],"description":"Agnostic Cloud Functions utilities: PII-redacting logger, writeWithAudit, rate limit, idempotency, validation, wrapHandler.","homepage":"https://github.com/camelburrito/keel#readme","keywords":["firebase","cloud-functions","pii","logger","audit","keel"],"repository":{"type":"git","url":"git+https://github.com/camelburrito/keel.git","directory":"packages/cf-utils"},"bugs":{"url":"https://github.com/camelburrito/keel/issues"},"license":"MIT","readme":"# @camelburrito/cf-utils\n\nAgnostic Cloud Functions utilities for the keel-derived projects.\n\n**Status:** implemented (v0.3.2). See [keel playbook 09-firebase-stack.md](../../docs/playbook/09-firebase-stack.md) and [05-observability-pii.md](../../docs/playbook/05-observability-pii.md).\n\n## What this package provides\n\n- `logger` — 7-layer PII redact pipeline (Gaxios scrubbing, domain-PII scrubber slot, email, phone, FCM token, Firestore-path embedded IDs, 28-char Firebase UID). Exports `BARE_FIREBASE_UID_RE` for downstream ratchets.\n- `instrument.wrapHandler` — Proxy-based unhandled-error catch routing thrown errors through the logger before rethrow. Exports `OAUTH_SECRET_FIELDS` + `scrubGaxiosError`.\n- `writeWithAudit` / `writeWithAuditBatch` — atomic mutation + audit doc in one transaction (the D-01 pattern).\n- `checkRateLimit` — per-CF per-caller quota with documented tier.\n- `claimIdempotency` — at-most-once semantics for retry-safe CFs.\n- `validateString` / `validateEmail` / `validateUrl` — input validation primitives with consistent HttpsError codes.\n- Generated `AUDIT_ACTIONS` literal-union (per-project codegen consumes from the project's audit catalog).\n\n## Installation\n\n```bash\nnpm install @camelburrito/cf-utils\n```\n\nRequires `.npmrc` with GitHub Packages auth — see [templates/.npmrc.template](../../templates/.npmrc.template).\n\n## Domain-PII scrubber slot\n\nThe 7-layer pipeline includes a slot for domain-specific PII scrubbing (e.g., calendar fields, contacts, health data). Wire your project's scrubber at logger init:\n\n```ts\nimport { configureLogger } from '@camelburrito/cf-utils';\nimport { scrubMyDomainFields } from './scrubbers';\n\nconfigureLogger({ domainScrubber: scrubMyDomainFields });\n```\n\n## Versioning\n\nSemver. Breaking changes require a major bump. See [CHANGELOG.md](CHANGELOG.md).\n\n## Publishing\n\nPublishes to GitHub Packages on tag push (`v*.*.*`) via `.github/workflows/publish.yml` in the keel repo.\n","readmeFilename":"README.md","_rev":"1-0a8d24f06af089c68274f3f8322d8074"}