dataclasses

Methods

(static) Target(target) → {Target}

Source:
Create a new target
Parameters:
Name Type Description
target object target
target_id string unique id for this target
label string label that will be displayed for this target
type_id string the type_id name this target has
Returns:
Type
Target

(static) Operator(operator) → {Operator}

Source:
Create a new operator
Parameters:
Name Type Description
operator object operator
operator_id string unique id for this operator
argumentType_id string the argumentType associated with the operator. For example to define a "is" operator and associate it with two targets "article publishing date" and "article title" then we would have to define 2 operators because ["article publishing date" "is"] and ["article title" "is"] do NOT have the same kind of arguments (one is a date the other is a string) and associated UI components (one is a date picker the other is a text input)
label string label that will be displayed for this operator
Returns:
Type
Operator

(static) Type(type) → {Type}

Source:
Create a new type
Parameters:
Name Type Description
type Object type
type_id string type_id
operator_ids Array.<string> array of operator_id
Returns:
Type
Type

(static) LogicalType(logicalType) → {object}

Source:
Create a new type logical type Logical types or used in CompoundPredicates
Parameters:
Name Type Description
logicalType Object The predicate logic
logicalType_id string logicalType_id
label string label
Returns:
logicalType object
Type
object

(static) ArgumentType(argumentType) → {object}

Source:
Create a new argument type
Parameters:
Name Type Description
argumentType Object argumentType
type.argumentType_id string argumentType_id
type.component * this attribute will be used by the UI Framework adapter
Returns:
ArgumentType
Type
object

(static) CompoundPredicate(logic, predicates) → {Promise.<dataclasses.CompoundPredicate>}

Source:
A specialized predicate that evaluates logical combinations of other predicates.
Parameters:
Name Type Description
logic dataclasses.LogicalType The predicate logic
predicates Array.<dataclasses.Predicate> predicates predicates
Returns:
Type
Promise.<dataclasses.CompoundPredicate>

(static) CompoundPredicate.reduce(compoundPredicate, f, acc, [parents]) → {T}

Source:
Reduce through the predicates tree
Parameters:
Name Type Attributes Default Description
compoundPredicate dataclasses.CompoundPredicate starter node
f function accumulation function, f(acc, predicate, parents)
acc T accumulator
parents Array
optional
[] path to the node, array of parents
Returns:
yield the accumulator
Type
T

(static) CompoundPredicate.forEach(compoundPredicate, f(predicate)) → {undefined}

Source:
Walk through the predicates tree
Parameters:
Name Type Description
compoundPredicate dataclasses.CompoundPredicate starter node
f(predicate) function iterator function
Returns:
Type
undefined

(static) CompoundPredicate.is(predicate) → {Boolean}

Source:
Yield true if `predicate` is a CompoundPredicate
Parameters:
Name Type Description
predicate dataclasses.Predicate predicate
Returns:
true if `predicate` is a CompoundPredicate
Type
Boolean

Type Definitions

Predicate

Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
  • object

ComparisonPredicate

Source:
Abstract Predicate type, a Predicate is the union type of CompoundPredicate | ComparisonPredicate
Type:
  • object