# rules-wrapper

> Auth0 rules-wrapper to allow calling Rules inside Actions

Latest version **0.1.11** (published 2024-02-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install rules-wrapper
pnpm add rules-wrapper
yarn add rules-wrapper
bun add rules-wrapper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2024-02-19 |
| First published | 2024-01-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 22.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Amin Abbaspour |
| Maintainers | abbaspour |

## Links

- npm: https://www.npmjs.com/package/rules-wrapper
- npm.io page: https://npm.io/package/rules-wrapper

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^3.2.5
- [auth0](https://npm.io/package/auth0.md) 3.5.0

## Recent versions

- 0.1.11 (latest) — 2024-02-19
- 0.1.10 — 2024-02-19
- 0.1.9 — 2024-02-02
- 0.1.8 — 2024-01-25
- 0.1.7 — 2024-01-24
- 0.1.6 — 2024-01-22
- 0.1.5 — 2024-01-22
- 0.1.4 — 2024-01-18
- 0.1.3 — 2024-01-18
- 0.1.2 — 2024-01-18
- 0.1.1 — 2024-01-17
- 0.1.0 — 2024-01-17

## README

# Auth0 Rules Wrapper

```js
const wrapper = require('@auth0/rules-wrapper');

function rule01(u, ctx, cb) { }
function rule02(u, ctx, cb) { }

exports.onExecutePostLogin = async (event, api) => {
    await wrapper.execute([rule01, rule02], {event, api});
}

exports.onContinuePostLogin = async (event, api) => {
    await wrapper.execute([rule01, rule02], {event, api, onContinue: true});
}
```


Actions based wrapper function to run Rules without any modifications to source code.

# Mapping Table
see [mapping.md](mapping.md)

# Compatibility
* [x] access_token claims
* [x] access_token scopes
* [x] id_token claims
* [x] setting primaryUserId
* [x] SAML response mapping
* [x] `global` object simple
* [x] pre & post redirect 
* [x] MFA
* [x] `auth0` object user and app metadata for current user
* [x] `auth0` object accessToken
* [x] configuration object populated from secrets 
* [x] global_client_id

# Not supported
* [ ] SAML mapping for [issuer, logout and binding](https://auth0team.atlassian.net/servicedesk/customer/portal/34/ESD-33960) 
* [ ] context fields `sessionID`, `auth0SessionId`, `sso` and `jwtConfiguration`
* [ ] [upstream IdP access_token](https://auth0.com/docs/customize/actions/limitations) 

# Out of scope
* [x] `auth0` object user and app metadata for other users

# Todo
* [ ] log level param

---
_Source: https://npm.io/package/rules-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
