{"_id":"@adobe/spacecat-shared-mac-giver-client","_rev":"6-eff6f85c4f93221819a910d786e438fc","name":"@adobe/spacecat-shared-mac-giver-client","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@adobe/spacecat-shared-mac-giver-client","version":"1.0.0","author":"","license":"Apache-2.0","_id":"@adobe/spacecat-shared-mac-giver-client@1.0.0","maintainers":[{"name":"marbec","email":"mabecker@adobe.com"},{"name":"tripod","email":"tripod@bocanegra.ch"},{"name":"garthdb","email":"garthdb@gmail.com"},{"name":"lazd","email":"lazdnet@gmail.com"},{"name":"adobe-admin","email":"grp-opensourceoffice@adobe.com"},{"name":"patrickfulton","email":"patrickfulton@gmail.com"},{"name":"trieloff","email":"lars@trieloff.net"},{"name":"shazron","email":"shazron@gmail.com"},{"name":"krisnye","email":"krisnye@gmail.com"},{"name":"dcpfsdk","email":"dcpfsdk@adobe.com"},{"name":"natebaldwin","email":"natebaldwindesign@gmail.com"},{"name":"devongovett","email":"devongovett@gmail.com"},{"name":"aspro83","email":"danniintheus@gmail.com"},{"name":"symanovi","email":"symanovi@adobe.com"},{"name":"dpfister","email":"dominique.pfister@gmail.com"},{"name":"stefan-guggisberg","email":"sg@adobe.com"},{"name":"rofe","email":"npm@rofe.com"},{"name":"kptdobe","email":"kptdobe@gmail.com"},{"name":"adobehalls","email":"halls@adobe.com"},{"name":"fullcolorcoder","email":"bradjohn@adobe.com"},{"name":"djaeggi","email":"djaeggi@adobe.com"},{"name":"dylandepass","email":"dylandepass@gmail.com"},{"name":"mhaack","email":"mhaack@adobe.com"},{"name":"amol-anand","email":"amol@adobe.com"},{"name":"stopp-adobe","email":"stopp@adobe.com"},{"name":"doten","email":"doten@adobe.com"},{"name":"duh_schmidt","email":"schmidt@adobe.com"},{"name":"asthabh23","email":"astha.bhargava23@gmail.com"},{"name":"zdahbi","email":"zouhir.dahbi@outlook.com"},{"name":"tuicu","email":"tuicu@adobe.com"},{"name":"fmeschbe","email":"fmeschbe@adobe.com"}],"homepage":"https://github.com/adobe/spacecat-shared/packages/spacecat-shared-mac-giver-client/#readme","bugs":{"url":"https://github.com/adobe/spacecat-shared/issues"},"dist":{"shasum":"b29a41375f8ed80b1defc911e6251719d9b048d5","tarball":"https://registry.npmjs.org/@adobe/spacecat-shared-mac-giver-client/-/spacecat-shared-mac-giver-client-1.0.0.tgz","fileCount":5,"integrity":"sha512-HfaxakQSTGeVlGRw9e1ugbTrx1+5Wqai6TKpAHx/SsEcOFSEAmNnbM3sCuf6two8mLaORCVBZCbFKKCergqo5A==","signatures":[{"sig":"MEYCIQC+RUpETxfEWhma4/hBoqWnD5HXoyl7w7Vy4vzLA+gEbAIhANqTNsCiRQfg7JHjHxFtJvJe13rgFbz1uyuudWNqZ+T/","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13723},"main":"src/index.js","type":"module","mocha":{"spec":"test/**/*.test.js","reporter":"mocha-multi-reporters","reporter-options":"configFile=.mocha-multi.json"},"engines":{"npm":">=10.9.0 <12.0.0","node":">=22.0.0 <25.0.0"},"gitHead":"b78901ae393a11e2cb284b96310ac6c8fcc8326c","scripts":{"lint":"eslint .","test":"c8 mocha","clean":"rm -rf package-lock.json node_modules","lint:fix":"eslint --fix ."},"_npmUser":{"name":"djaeggi","email":"djaeggi@adobe.com"},"repository":{"url":"git+https://github.com/adobe/spacecat-shared.git","type":"git"},"_npmVersion":"11.13.0","description":"Shared modules of the Spacecat Services - MacGiver Client","directories":{},"_nodeVersion":"24.11.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"chai":"6.2.2","nock":"14.0.11","sinon":"21.0.3","sinon-chai":"4.0.1","chai-as-promised":"8.0.2"},"_npmOperationalInternal":{"tmp":"tmp/spacecat-shared-mac-giver-client_1.0.0_1782278902767_0.46826913320725216","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-24T05:28:22.540Z","modified":"2026-10-01T01:34:33.579Z","1.0.0":"2026-06-24T05:28:22.902Z"},"bugs":{"url":"https://github.com/adobe/spacecat-shared/issues"},"license":"Apache-2.0","homepage":"https://github.com/adobe/spacecat-shared/packages/spacecat-shared-mac-giver-client/#readme","repository":{"url":"git+https://github.com/adobe/spacecat-shared.git","type":"git"},"description":"Shared modules of the Spacecat Services - MacGiver Client","maintainers":[{"email":"mabecker@adobe.com","name":"marbec"},{"email":"tripod@bocanegra.ch","name":"tripod"},{"email":"garthdb@gmail.com","name":"garthdb"},{"email":"lazdnet@gmail.com","name":"lazd"},{"email":"grp-opensourceoffice@adobe.com","name":"adobe-admin"},{"email":"patrickfulton@gmail.com","name":"patrickfulton"},{"email":"lars@trieloff.net","name":"trieloff"},{"email":"krisnye@gmail.com","name":"krisnye"},{"email":"dcpfsdk@adobe.com","name":"dcpfsdk"},{"email":"natebaldwindesign@gmail.com","name":"natebaldwin"},{"email":"devongovett@gmail.com","name":"devongovett"},{"email":"danniintheus@gmail.com","name":"aspro83"},{"email":"symanovi@adobe.com","name":"symanovi"},{"email":"dominique.pfister@gmail.com","name":"dpfister"},{"email":"sg@adobe.com","name":"stefan-guggisberg"},{"email":"npm@rofe.com","name":"rofe"},{"email":"kptdobe@gmail.com","name":"kptdobe"},{"email":"halls@adobe.com","name":"adobehalls"},{"email":"bradjohn@adobe.com","name":"fullcolorcoder"},{"email":"djaeggi@adobe.com","name":"djaeggi"},{"email":"dylandepass@gmail.com","name":"dylandepass"},{"email":"mhaack@adobe.com","name":"mhaack"},{"email":"amol@adobe.com","name":"amol-anand"},{"email":"stopp@adobe.com","name":"stopp-adobe"},{"email":"namarora@adobe.com","name":"namarora"},{"email":"doten@adobe.com","name":"doten"},{"email":"schmidt@adobe.com","name":"duh_schmidt"},{"email":"astha.bhargava23@gmail.com","name":"asthabh23"},{"email":"aljoseph@adobe.com","name":"aljoseph"},{"email":"zouhir.dahbi@outlook.com","name":"zdahbi"},{"email":"tuicu@adobe.com","name":"tuicu"},{"email":"fmeschbe@adobe.com","name":"fmeschbe"}],"readme":"# Spacecat Shared - MacGiver Client\n\nA thin client over the MacGiver FACS `/api/facs/permissions/check` endpoint for\nevaluating a single user's permissions within an IMS organization. Consumed by\n`spacecat-auth-service` at login to mint the `facs_permissions` JWT claim.\n\n## Installation\n\n```bash\nnpm install @adobe/spacecat-shared-mac-giver-client\n```\n\n## Usage\n\n### Create from a Universal context\n\nThe wrapper attaches the client to `context.macGiverClient` (place it after the\nIMS client wrapper, since it requires `context.imsClient`):\n\n```javascript\nimport { macGiverClientWrapper } from '@adobe/spacecat-shared-mac-giver-client';\n\nexport const main = wrap(run)\n  .with(macGiverClientWrapper);\n```\n\nOr construct directly:\n\n```javascript\nimport { MacGiverClient } from '@adobe/spacecat-shared-mac-giver-client';\n\nconst client = MacGiverClient.createFrom(context);\n```\n\n### Check an explicit list of permissions\n\nReturns the subset of the requested permissions that are allowed:\n\n```javascript\nconst allowed = await client.checkListOfPermission({\n  userId: '17837D23...@AdobeID',\n  imsOrgId: 'AAAA...CCCC@AdobeOrg',\n  permissions: ['llmo/can_view', 'llmo/can_manage_users'],\n});\n// → ['llmo/can_view']\n```\n\n### Check all permissions in a namespace\n\nEvaluates every permission defined in the given namespaces and returns the\nallowed subset:\n\n```javascript\nconst allowed = await client.checkAllPermission({\n  userId: '17837D23...@AdobeID',\n  imsOrgId: 'AAAA...CCCC@AdobeOrg',\n  namespaces: ['llmo'],\n});\n// → ['llmo/can_view', 'llmo/can_manage_users']\n```\n\n## Behavior\n\n- **Evaluated, none granted** — a `2xx` `SUCCESS` response with no `allowed: true`\n  entries (or a non-`SUCCESS` status) returns `[]`.\n- **Could not evaluate** — a non-`2xx` response or transport failure **throws**\n  (with a `tag: 'macgiver'` warning), so callers can fail-safe (e.g. omit the\n  `facs_permissions` claim) rather than confusing an outage with \"no permissions\".\n- The request is bounded by `AbortSignal.timeout` (default `5000` ms, tunable via\n  the `MACGIVER_TIMEOUT_MS` env var) since MacGiver sits on the login critical path.\n\n## Configuration\n\n| Env var | Default | Description |\n|---|---|---|\n| `MACGIVER_BASE_URL` | `http://localhost:8080` | MacGiver service base URL. |\n| `MACGIVER_TIMEOUT_MS` | `5000` | Per-request timeout in milliseconds. |\n","readmeFilename":"README.md"}