{"_id":"@bpmn-sdk/profiles","_rev":"5-9e5c4f3962fc02fb3509e9c05bbfce71","name":"@bpmn-sdk/profiles","dist-tags":{"latest":"0.0.5"},"versions":{"0.0.1":{"name":"@bpmn-sdk/profiles","version":"0.0.1","_id":"@bpmn-sdk/profiles@0.0.1","maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"homepage":"https://github.com/bpmn-sdk/monorepo#readme","bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"dist":{"shasum":"2bba570bbb966bcc8bad5931275a042e91ecd628","tarball":"https://registry.npmjs.org/@bpmn-sdk/profiles/-/profiles-0.0.1.tgz","fileCount":9,"integrity":"sha512-/2+vewL/jEOXfob66OX/YBmwnDtdMGfs2LTIndgoqKHRuTf5GJ0xb9XiaiM9ZW92JliD+TPjFR+QhG9SBTYFpQ==","signatures":[{"sig":"MEQCIGGLZg/4IZTe9C8BR6XjBrVcBcIm/BLIDM1yc3QFdsXIAiBtVyUFXKmuQKgZ05pJfRu9gW4ofQNCgQpPFTltliczNA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9246},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0f1e84e3b1dd1d97177473249f1e887665ce7272","scripts":{"build":"tsc","check":"biome check .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"urbanisierung","email":"adam.urban@gmail.com"},"repository":{"url":"git+https://github.com/bpmn-sdk/monorepo.git","type":"git"},"_npmVersion":"11.6.1","description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","directories":{},"_nodeVersion":"24.11.0","dependencies":{"@bpmn-sdk/api":"workspace:*"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/profiles_0.0.1_1773170376581_0.7536660945088995","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bpmn-sdk/profiles","version":"0.0.2","keywords":["bpmn","camunda","profiles","authentication","oauth2","cli","typescript"],"_id":"@bpmn-sdk/profiles@0.0.2","maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"homepage":"https://github.com/bpmn-sdk/monorepo#readme","bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"dist":{"shasum":"ce56ad269fef8d2aa503cf455551f4cb06a552fe","tarball":"https://registry.npmjs.org/@bpmn-sdk/profiles/-/profiles-0.0.2.tgz","fileCount":11,"integrity":"sha512-8GEmH5uOgPLPECBbaz+VBcQaVL8dqzAx29JyxYe5DFRhKh/5j3dE+fXvqdxGMM1QpRoOFT5i9Di5uZfw/HYVag==","signatures":[{"sig":"MEUCIG5NuwnFQ/9pT4gzMFTTxrnRXN95MBwhuKiNABnL2zi6AiEAzDTCEEg0q3Vi34U8SFoUPmGBBlymTnBfrqV8x8KVcKk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bpmn-sdk%2fprofiles@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16107},"main":"./dist/index.js","type":"module","_from":"file:bpmn-sdk-profiles-0.0.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","check":"biome check .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:81d65498-9f4f-4124-a225-eeed02344e6a"}},"_resolved":"/tmp/1b73e3d6bf2c3cdb7879135cdd32b137/bpmn-sdk-profiles-0.0.2.tgz","_integrity":"sha512-8GEmH5uOgPLPECBbaz+VBcQaVL8dqzAx29JyxYe5DFRhKh/5j3dE+fXvqdxGMM1QpRoOFT5i9Di5uZfw/HYVag==","repository":{"url":"git+https://github.com/bpmn-sdk/monorepo.git","type":"git"},"_npmVersion":"11.9.0","description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@bpmn-sdk/api":"0.0.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/profiles_0.0.2_1773173862146_0.37444235577287976","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@bpmn-sdk/profiles","version":"0.0.3","keywords":["bpmn","camunda","profiles","authentication","oauth2","cli","typescript"],"_id":"@bpmn-sdk/profiles@0.0.3","maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"homepage":"https://github.com/bpmn-sdk/monorepo#readme","bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"dist":{"shasum":"4105f89e473a6e469e8285e76ca032696b39a970","tarball":"https://registry.npmjs.org/@bpmn-sdk/profiles/-/profiles-0.0.3.tgz","fileCount":11,"integrity":"sha512-z03QCVon36LTPV4F9BVXk0rBg8K22U7S71kHDvQgAQAOw0E7+toxJoC/FxRCDnQKxDyd4GhOHtPVMmzTF5pl+g==","signatures":[{"sig":"MEUCIEdJbC6Kef0gWYqVCMj/TPPk8IEyzyEQY/ZqxD93oMhXAiEAtv1dgkIyJN1V7u06knoLw0UZ7ZZS2q+ECKpj0U/0Whc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bpmn-sdk%2fprofiles@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16107},"main":"./dist/index.js","type":"module","_from":"file:bpmn-sdk-profiles-0.0.3.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","check":"biome check .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:81d65498-9f4f-4124-a225-eeed02344e6a"}},"_resolved":"/tmp/0ed461ccaacfca32e0a1f92628f71c60/bpmn-sdk-profiles-0.0.3.tgz","_integrity":"sha512-z03QCVon36LTPV4F9BVXk0rBg8K22U7S71kHDvQgAQAOw0E7+toxJoC/FxRCDnQKxDyd4GhOHtPVMmzTF5pl+g==","repository":{"url":"git+https://github.com/bpmn-sdk/monorepo.git","type":"git"},"_npmVersion":"11.9.0","description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@bpmn-sdk/api":"0.0.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/profiles_0.0.3_1773258781759_0.9280979031658128","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@bpmn-sdk/profiles","version":"0.0.4","keywords":["bpmn","camunda","profiles","authentication","oauth2","cli","typescript"],"_id":"@bpmn-sdk/profiles@0.0.4","maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"homepage":"https://github.com/bpmn-sdk/monorepo#readme","bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"dist":{"shasum":"5f01de933eaa58e4c793883977b6a15e75b7df2c","tarball":"https://registry.npmjs.org/@bpmn-sdk/profiles/-/profiles-0.0.4.tgz","fileCount":13,"integrity":"sha512-skc32f33LFz8FrHQvlInwGWd4robgF0z+k3rC9N5aCXmWXmAohK9x1ME1r1HMD/xZkdvBeFqTC38ALRUK2IaJw==","signatures":[{"sig":"MEQCIF/d3FmRn9xbWOAOKjith6RUXB+U57tZ1mPOKWOHT1z8AiBYx1GJpwTy1mv2pwUhzxng3TID2jbozm6F+6Xyksp5AQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bpmn-sdk%2fprofiles@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20768},"main":"./dist/index.js","type":"module","_from":"file:bpmn-sdk-profiles-0.0.4.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","check":"biome check .","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:81d65498-9f4f-4124-a225-eeed02344e6a"}},"_resolved":"/tmp/cd97d65695a988a09204c9019170aef2/bpmn-sdk-profiles-0.0.4.tgz","_integrity":"sha512-skc32f33LFz8FrHQvlInwGWd4robgF0z+k3rC9N5aCXmWXmAohK9x1ME1r1HMD/xZkdvBeFqTC38ALRUK2IaJw==","repository":{"url":"git+https://github.com/bpmn-sdk/monorepo.git","type":"git"},"_npmVersion":"11.9.0","description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@bpmn-sdk/api":"0.0.7"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/profiles_0.0.4_1773341682599_0.11872387321508726","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@bpmn-sdk/profiles","version":"0.0.5","description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"engines":{"node":">=20"},"dependencies":{"@bpmn-sdk/api":"0.0.8"},"keywords":["bpmn","camunda","profiles","authentication","oauth2","cli","typescript"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/bpmn-sdk/monorepo.git"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","check":"biome check ."},"_id":"@bpmn-sdk/profiles@0.0.5","bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"homepage":"https://github.com/bpmn-sdk/monorepo#readme","_integrity":"sha512-+FIBtPAktyKn4CScKBasiMHQlGZEhLP2ghUcYFxoJcwAJIB5k1W7a6LJs7CSzKTNdjRT17Ym3djQpV5P79Ohkg==","_resolved":"/tmp/9450a8e0e4575ba854f954cbe2d9662f/bpmn-sdk-profiles-0.0.5.tgz","_from":"file:bpmn-sdk-profiles-0.0.5.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-+FIBtPAktyKn4CScKBasiMHQlGZEhLP2ghUcYFxoJcwAJIB5k1W7a6LJs7CSzKTNdjRT17Ym3djQpV5P79Ohkg==","shasum":"05d0e4b8bb8cc88bfac81bac8ffc22cdd00774ad","tarball":"https://registry.npmjs.org/@bpmn-sdk/profiles/-/profiles-0.0.5.tgz","fileCount":13,"unpackedSize":20768,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bpmn-sdk%2fprofiles@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCtzXQcxsse2SIDVzaV2KKv2CASPWW+D59HOEjpxxYkWgIgKYcGBvs466XmvusW3F5CpdgmNLU5R2wIxYgn1RpVLOY="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:81d65498-9f4f-4124-a225-eeed02344e6a"}},"directories":{},"maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/profiles_0.0.5_1773428388446_0.7593737710235617"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-10T19:19:36.515Z","modified":"2026-03-13T18:59:48.901Z","0.0.1":"2026-03-10T19:19:36.726Z","0.0.2":"2026-03-10T20:17:42.340Z","0.0.3":"2026-03-11T19:53:01.901Z","0.0.4":"2026-03-12T18:54:42.736Z","0.0.5":"2026-03-13T18:59:48.601Z"},"bugs":{"url":"https://github.com/bpmn-sdk/monorepo/issues"},"homepage":"https://github.com/bpmn-sdk/monorepo#readme","keywords":["bpmn","camunda","profiles","authentication","oauth2","cli","typescript"],"repository":{"type":"git","url":"git+https://github.com/bpmn-sdk/monorepo.git"},"description":"Shared profile storage and auth client factory for @bpmn-sdk CLI and proxy server","maintainers":[{"name":"urbanisierung","email":"adam.urban@gmail.com"}],"readme":"<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/bpmn-sdk/monorepo/main/doc/logos/logo-2-gateway.svg\" width=\"72\" height=\"72\" alt=\"BPMN SDK logo\">\n  <h1>@bpmn-sdk/profiles</h1>\n  <p>Shared auth, profile storage, and client factories for the BPMN SDK CLI and proxy server</p>\n\n  [![npm](https://img.shields.io/npm/v/@bpmn-sdk/profiles?style=flat-square&color=6244d7)](https://www.npmjs.com/package/@bpmn-sdk/profiles)\n  [![license](https://img.shields.io/npm/l/@bpmn-sdk/profiles?style=flat-square)](https://github.com/bpmn-sdk/monorepo/blob/main/LICENSE)\n  [![typescript](https://img.shields.io/badge/TypeScript-strict-6244d7?style=flat-square&logo=typescript&logoColor=white)](https://github.com/bpmn-sdk/monorepo)\n\n  [Documentation](https://bpmn-sdk-docs.pages.dev) · [GitHub](https://github.com/bpmn-sdk/monorepo) · [Changelog](https://github.com/bpmn-sdk/monorepo/blob/main/packages/profiles/CHANGELOG.md)\n</div>\n\n---\n\n## Overview\n\n`@bpmn-sdk/profiles` is the shared layer that connects the `casen` CLI with the local proxy server. It handles profile CRUD (read/write to `~/.config/casen/config.json`), creates typed `CamundaClient` instances from stored profiles, and resolves Authorization headers for any supported auth type.\n\nYou do not need this package if you are connecting directly to Camunda using `@bpmn-sdk/api`. It is intended for tooling that needs to share authentication state with the CLI.\n\n## Features\n\n- **Profile CRUD** — list, get, save, delete, and activate named profiles stored in `~/.config/casen/config.json`\n- **Client factory** — `createClientFromProfile(name?)` creates a ready-to-use `CamundaClient` from the active or named profile\n- **Auth header resolution** — `getAuthHeader(config)` returns the correct `Authorization` header string for Bearer, Basic, and OAuth2 auth types\n- **OAuth2 token caching** — tokens are cached in memory and refreshed 60 seconds before expiry; no extra files written\n- **XDG-aware** — profile file path resolves to the correct platform directory (Linux XDG, macOS, Windows AppData)\n- **Zero UI dependencies** — no TUI or CLI dependencies; plain Node.js\n\n## Installation\n\n```sh\nnpm install @bpmn-sdk/profiles\n```\n\n## Quick Start\n\n### Create a `CamundaClient` from the active profile\n\n```typescript\nimport { createClientFromProfile } from \"@bpmn-sdk/profiles\"\n\n// Uses the currently active profile from ~/.config/casen/config.json\nconst client = createClientFromProfile()\n\nconst instances = await client.processInstance.searchProcessInstances({})\nconsole.log(instances.page.totalItems)\n```\n\n### Use a named profile\n\n```typescript\nconst client = createClientFromProfile(\"production\")\n```\n\n### Resolve an auth header directly\n\n```typescript\nimport { getActiveProfile, getAuthHeader } from \"@bpmn-sdk/profiles\"\n\nconst profile = getActiveProfile()\nif (profile) {\n  const header = await getAuthHeader(profile.config)\n  // \"Bearer eyJ...\" or \"Basic dXNlcjpwYXNz\" or \"\"\n}\n```\n\n### Manage profiles programmatically\n\n```typescript\nimport { listProfiles, saveProfile, useProfile, deleteProfile } from \"@bpmn-sdk/profiles\"\n\n// List all profiles\nconst profiles = listProfiles()\n\n// Save a new profile\nsaveProfile({\n  name: \"local\",\n  apiType: \"self-managed\",\n  config: {\n    baseUrl: \"http://localhost:8080/v2\",\n    auth: { type: \"basic\", username: \"admin\", password: \"admin\" },\n  },\n})\n\n// Activate a profile\nuseProfile(\"local\")\n\n// Delete a profile\ndeleteProfile(\"old-profile\")\n```\n\n## API Reference\n\n### Profile Management\n\n| Export | Description |\n|--------|-------------|\n| `listProfiles()` | Returns all stored profiles |\n| `getProfile(name)` | Returns a profile by name, or `undefined` |\n| `getActiveProfile()` | Returns the currently active profile |\n| `getActiveName()` | Returns the active profile name |\n| `saveProfile(profile)` | Create or update a profile |\n| `deleteProfile(name)` | Remove a profile |\n| `useProfile(name)` | Set the active profile |\n| `getConfigFilePath()` | Returns the full path to the config file |\n\n### Client Factories\n\n| Export | Description |\n|--------|-------------|\n| `createClientFromProfile(name?)` | `CamundaClient` from the active or named profile |\n| `createAdminClientFromProfile(name?)` | `AdminApiClient` from the active or named profile |\n\n### Auth\n\n| Export | Description |\n|--------|-------------|\n| `getAuthHeader(config)` | Resolves an `Authorization` header string for any auth type |\n\n---\n\n## Related Packages\n\n| Package | Description |\n|---------|-------------|\n| [`@bpmn-sdk/core`](https://www.npmjs.com/package/@bpmn-sdk/core) | BPMN/DMN/Form parser, builder, layout engine |\n| [`@bpmn-sdk/canvas`](https://www.npmjs.com/package/@bpmn-sdk/canvas) | Zero-dependency SVG BPMN viewer |\n| [`@bpmn-sdk/editor`](https://www.npmjs.com/package/@bpmn-sdk/editor) | Full-featured interactive BPMN editor |\n| [`@bpmn-sdk/engine`](https://www.npmjs.com/package/@bpmn-sdk/engine) | Lightweight BPMN process execution engine |\n| [`@bpmn-sdk/feel`](https://www.npmjs.com/package/@bpmn-sdk/feel) | FEEL expression language parser & evaluator |\n| [`@bpmn-sdk/plugins`](https://www.npmjs.com/package/@bpmn-sdk/plugins) | 22 composable canvas plugins |\n| [`@bpmn-sdk/api`](https://www.npmjs.com/package/@bpmn-sdk/api) | Camunda 8 REST API TypeScript client |\n| [`@bpmn-sdk/ascii`](https://www.npmjs.com/package/@bpmn-sdk/ascii) | Render BPMN diagrams as Unicode ASCII art |\n| [`@bpmn-sdk/operate`](https://www.npmjs.com/package/@bpmn-sdk/operate) | Monitoring & operations frontend for Camunda clusters |\n\n## License\n\n[MIT](https://github.com/bpmn-sdk/monorepo/blob/main/LICENSE) © bpmn-sdk\n","readmeFilename":"README.md"}