New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@byu-oit/ts-claims-engine-client

Package Overview
Dependencies
Maintainers
15
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byu-oit/ts-claims-engine-client

Claims engine client implementation in TypeScript

latest
Source
npmnpm
Version
4.0.3
Version published
Weekly downloads
18
-25%
Maintainers
15
Weekly downloads
 
Created
Source

Claims Adjudicator Client

CI Code Coverage GitHub package.json version code style: prettier


Installation

npm i @byu-oit/ts-claims-engine-client

Introduction

The purpose of the Claims Adjudicator Client is to facilitate the formation of claims requests using functional syntax.

Example

const { AdjudicatorClient: CEC } = require("@byu-oit/ts-claims-engine-client");
const client = new CEC();

client
  .subject("John")
  .mode("all")
  .claim(
    CEC.claim()
      .concept("subject-exists")
      .relationship("eq")
      .value("true")
      .qualify("age", 43)
  );

const valid = client.validate(); // True

console.log(JSON.stringify(client.assertion, null, 2));

:sparkles: Try it out with RunKit on NPM :sparkles:

API

Some of the parameters and return types are complex objects. Instead of listing them in the method definitions, they have been listed in the Appendix under API Reference.

AdjudicatorClient

Creates a new instance of the AdjudicatorClient.

AdjudicatorClient(options: AdjudicatorClientParams = {})

Public Data Members

id: string: The ID of the assertion object.

assertion: PartialAssertion: The assertion object for making a claims request.

Static Methods

AdjudicatorClient.validate: Provides programatic access to validate an assertion/claims object.

AdjudicatorClient.validate(assertion: any): boolean

AdjudicatorClient.claim: Provides programatic access to the ClaimClient class from the AdjudicatorClient.

AdjudicatorClient.claim(options?: ClaimClientParams): ClaimClient

AdjudicatorClient.join: Provides a method to join assertions together.

AdjudicatorClient.join(...assertions: AdjudicaatorClient): {[key: string]: PartialAssertion}

Public Methods

subject: Adds subject: [value] to the assertion object.

subject(value: string): this

mode: Adds mode: [value] to the assertion object.

mode(value: 'all' | 'any' | 'one'): this

claim: Adds claim: PartialClaim[] (a claim or list of claims) to the assertion object.

claim(...values: Array<ClaimClient | ClaimItem>): this

validate: Validates the current object schema.

validate(): boolean

Appendix

API Reference

interface AdjudicatorClientParams {
  id?: string;
  subject?: string;
  mode?: Mode;
  claims?: Array<ClaimClient | ClaimItem>;
}

interface ClaimClientParams {
  concept?: string;
  relationship?: Relationship;
  value?: string;
  qualifier?: Qualifiers;
}

interface ClaimItem {
  concept: string;
  relationship: Relationship;
  value: string;
  qualifier?: Qualifiers;
}

type Mode = "all" | "any" | "one";

interface PartialAssertion {
  [key: string]: {
    subject?: string;
    mode?: Mode;
    claims?: PartialClaim[];
  };
}

interface PartialClaim {
  concept?: string;
  relationship?: Relationship;
  value?: string;
  qualifier?: Qualifiers;
}

type Relationship = "gt" | "gt_or_eq" | "lt" | "lt_or_eq" | "eq" | "not_eq";

Keywords

claims

FAQs

Package last updated on 20 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts