3.1.1 • Published 11 months ago

@adobe/aep-rules-engine v3.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

AEP Rules Engine

Overview

A simple, generic, extensible Rules Engine in TypeScript.

Installation

Although written in TypeScript, the build produces JavaScript implementations that can be used anywhere JavaScript can be evaluated.

Install via npm.

npm install @adobe/aep-rules-engine

Usage

const RulesEngine = require("@adobe/aep-rules-engine");

const ruleset = RulesEngine({
  version: 1,
  rules: [
    {
      condition: {
        definition: {
          conditions: [
            {
              definition: {
                conditions: [
                  {
                    definition: {
                      key: "color",
                      matcher: "eq",
                      values: ["orange", "blue"],
                    },
                    type: "matcher",
                  },
                ],
                logic: "and",
              },
              type: "group",
            },
          ],
          logic: "and",
        },
        type: "group",
      },
      consequences: [
        {
          type: "item",
          detail: {
            hello: "world",
          },
          id: "abc123",
        },
      ],
    },
  ],
});

const consequences = ruleset.execute({ color: "orange" });

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

3.1.1

11 months ago

3.1.0

11 months ago

3.0.0

1 year ago

2.0.3

1 year ago

2.1.0

1 year ago

2.0.2

3 years ago

2.0.1

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0-rc.1

3 years ago

2.0.0

3 years ago

0.0.1

3 years ago

1.0.0

3 years ago