1.2.0 • Published 3 months ago

@akamaistro/rules v1.2.0

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

akamaistro-rules

Generate npm packages of Typescript interfaces for Akamai rule behaviors and criteria.

Package usage

  • Install package

npm i akamaistro-rules

  • Import rule items from specific rule format like v2017-06-19 or latest (recommended)
  • Use type annotations and satisfies operator inline to enforce types
import { Rule, Path, ModifyOutgoingRequestHeader } from 'akamaistro/latest';

const rule: Rule = {
  name: 'Add header on some-path',
  criteria: [
    {
      name: 'path',
      options: { matchOperator: 'MATCHES_ONE_OF', values: '/some-path*' },
    } satisfies Path,
  ],
  behaviors: [
    {
      name: 'modifyOutgoingRequestHeader',
      options: {
        action: 'ADD',
        customHeaderName: 'x-header-name',
        headerValue: 'some-value',
      },
    } satisfies ModifyOutgoingRequestHeader,
  ],
};