{"_id":"@cesco_valle/identity-auth-sdk","_rev":"2-4b48112435e3f57a4dbc86e2500406bd","name":"@cesco_valle/identity-auth-sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@cesco_valle/identity-auth-sdk","version":"0.1.0","license":"MIT","_id":"@cesco_valle/identity-auth-sdk@0.1.0","maintainers":[{"name":"cesco_valle","email":"cescovalledev@gmail.com"}],"dist":{"shasum":"ac3263c183f2976da020aa8ca16a158d788ac54f","tarball":"https://registry.npmjs.org/@cesco_valle/identity-auth-sdk/-/identity-auth-sdk-0.1.0.tgz","fileCount":8,"integrity":"sha512-X7J3lAj/18PkqikN4x4nRcxRW36+2gK4JW4aunxhpXB8WEvdekFRqlAEFqJJrea168LgJTnveHapDZtksl0UrA==","signatures":[{"sig":"MEUCIQDHKqcRetLsvM6IbfepLS+z2lgFbnd9icvDbNNzhEvadQIgJhqzgK+KE5tNIP/HkiX/4WcarKUYUWWvqil/Cb2oPRk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2942},"type":"module","_from":"file:cesco_valle-identity-auth-sdk-0.1.0.tgz","engines":{"node":">=18"},"exports":{"./user":{"types":"./dist/user.d.ts","import":"./dist/user.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"scripts":{"test":"vitest run --passWithNoTests","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"cesco_valle","email":"cescovalledev@gmail.com"},"_resolved":"C:\\Users\\frank\\AppData\\Local\\Temp\\7336f8ac892ef8d795346c702edb7af2\\cesco_valle-identity-auth-sdk-0.1.0.tgz","_integrity":"sha512-X7J3lAj/18PkqikN4x4nRcxRW36+2gK4JW4aunxhpXB8WEvdekFRqlAEFqJJrea168LgJTnveHapDZtksl0UrA==","_npmVersion":"11.16.0","description":"Typed HTTP clients for the portfolio identity service: user (cookie) and admin (service-principal) surfaces.","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"zod":"^4.1.12","@cesco_valle/identity-contracts":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^4.0.13","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/identity-auth-sdk_0.1.0_1780900210289_0.5775638882284686","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cesco_valle/identity-auth-sdk","version":"0.2.0","description":"Typed HTTP clients for the portfolio identity service: user (cookie) and admin (service-principal) surfaces.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/C3SC0-V4113/Identity-Packages.git","directory":"packages/identity-auth-sdk"},"homepage":"https://github.com/C3SC0-V4113/Identity-Packages/tree/main/packages/identity-auth-sdk","type":"module","engines":{"node":">=18"},"sideEffects":false,"exports":{"./user":{"types":"./dist/user.d.ts","import":"./dist/user.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"publishConfig":{"access":"public"},"dependencies":{"@cesco_valle/identity-contracts":"0.2.0"},"devDependencies":{"tsup":"^8.5.0","typescript":"^5.9.3","vitest":"^4.0.13"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","test":"vitest run --passWithNoTests"},"_id":"@cesco_valle/identity-auth-sdk@0.2.0","bugs":{"url":"https://github.com/C3SC0-V4113/Identity-Packages/issues"},"_integrity":"sha512-g4sUf8pxity4khJOZwfRLxnL0YQC9LuLmLAONFg3ERWowUKBwkq0/rP6TcVyDfTBRnEematmAjJhKhF15ZBjvA==","_resolved":"/tmp/3c2d19bca018dab61610858842e1b036/cesco_valle-identity-auth-sdk-0.2.0.tgz","_from":"file:cesco_valle-identity-auth-sdk-0.2.0.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-g4sUf8pxity4khJOZwfRLxnL0YQC9LuLmLAONFg3ERWowUKBwkq0/rP6TcVyDfTBRnEematmAjJhKhF15ZBjvA==","shasum":"4ff5e2acaafadb947f4a82267dbf059db34fbbcc","tarball":"https://registry.npmjs.org/@cesco_valle/identity-auth-sdk/-/identity-auth-sdk-0.2.0.tgz","fileCount":11,"unpackedSize":42157,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@cesco_valle%2fidentity-auth-sdk@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH6tBluf1us6Pfht8v0Gm4kq23K5l7FBWAmwSmhS0dHGAiBo1xPETe2/NySb4w5h5lCVjuSjw78VNVBuwrjqjroc3A=="}]},"_npmUser":{"name":"cesco_valle","email":"cescovalledev@gmail.com"},"directories":{},"maintainers":[{"name":"cesco_valle","email":"cescovalledev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/identity-auth-sdk_0.2.0_1781067566409_0.7984450230668714"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-08T06:30:10.117Z","modified":"2026-06-10T04:59:27.031Z","0.1.0":"2026-06-08T06:30:10.428Z","0.2.0":"2026-06-10T04:59:26.546Z"},"license":"MIT","description":"Typed HTTP clients for the portfolio identity service: user (cookie) and admin (service-principal) surfaces.","maintainers":[{"name":"cesco_valle","email":"cescovalledev@gmail.com"}],"readme":"# @cesco_valle/identity-auth-sdk\n\nTyped HTTP clients for the portfolio identity service, built on\n`@cesco_valle/identity-contracts`. Two **separate, server-safe entrypoints**:\n\n- `@cesco_valle/identity-auth-sdk/user` — cookie/session surface for end-user apps\n  (browser + Next.js server/edge).\n- `@cesco_valle/identity-auth-sdk/admin` — service-principal (bearer) surface for\n  `mcp-server` and operators. **Server-only**; never import it in a browser/edge\n  bundle.\n\nESM-only. The user client uses only global `fetch` / web APIs (edge-safe).\n\n## Install\n\n```bash\nnpm install @cesco_valle/identity-auth-sdk\n```\n\n## User client\n\n```ts\nimport { createUserAuthClient } from '@cesco_valle/identity-auth-sdk/user';\n\nconst auth = createUserAuthClient({ baseUrl: process.env.IDENTITY_URL! });\n\n// Browser: the cookie is handled automatically (credentials are included).\nconst { data } = await auth.login('other-gpt', { email, password });\n\n// Server (Next.js): forward the incoming cookie, relay the returned Set-Cookie.\nconst valid = await auth.hasValidSession('other-gpt', { cookie });\nconst me = await auth.getMe('other-gpt', { cookie });\n```\n\n`login` / `register` / `logout` return `{ data, setCookie }`. On the server, apply\n`setCookie` to the response (Route Handler) or via `toCookieEntries(setCookie)` to\nthe Next.js cookie store (Server Action). `hasValidSession` returns a boolean;\nother methods throw a typed `ApiError` on non-2xx.\n\n## Admin client (server-only)\n\n```ts\nimport { createAdminClient } from '@cesco_valle/identity-auth-sdk/admin';\n\nconst admin = createAdminClient({ baseUrl: process.env.IDENTITY_URL!, token: process.env.SP_TOKEN! });\n\nconst res = await admin.banUser({\n  targetProjectId,\n  reason: 'abuse',\n  channel: 'mcp',\n  operatorUserId: 'op-1',\n  payload: { userId },\n});\n// res.status is 'completed' | 'pending_approval' | 'denied' | 'failed' (not thrown).\nif (res.status === 'pending_approval') {\n  await admin.decideApproval(res.approvalId!, { decision: 'approve', operatorUserId: 'op-1' });\n}\n```\n\n`idempotencyKey` is auto-generated when omitted; pass `correlationId` to thread a\ntrace. Mutations return the response envelope (inspect `status`); only\ntransport-level failures (`401/403/404/409/400`) throw `ApiError`.\n","readmeFilename":"README.md","homepage":"https://github.com/C3SC0-V4113/Identity-Packages/tree/main/packages/identity-auth-sdk","repository":{"type":"git","url":"git+https://github.com/C3SC0-V4113/Identity-Packages.git","directory":"packages/identity-auth-sdk"},"bugs":{"url":"https://github.com/C3SC0-V4113/Identity-Packages/issues"}}