2022-03-04 17:29:51 +01:00
|
|
|
export type Operator =
|
|
|
|
| 'NOT_IN'
|
|
|
|
| 'IN'
|
|
|
|
| 'STR_ENDS_WITH'
|
|
|
|
| 'STR_STARTS_WITH'
|
|
|
|
| 'STR_CONTAINS'
|
|
|
|
| 'NUM_EQ'
|
|
|
|
| 'NUM_GT'
|
|
|
|
| 'NUM_GTE'
|
|
|
|
| 'NUM_LT'
|
|
|
|
| 'NUM_LTE'
|
|
|
|
| 'DATE_AFTER'
|
|
|
|
| 'DATE_BEFORE'
|
|
|
|
| 'SEMVER_EQ'
|
|
|
|
| 'SEMVER_GT'
|
|
|
|
| 'SEMVER_LT';
|
|
|
|
|
|
|
|
export const NOT_IN = 'NOT_IN';
|
|
|
|
export const IN = 'IN';
|
|
|
|
export const STR_ENDS_WITH = 'STR_ENDS_WITH';
|
|
|
|
export const STR_STARTS_WITH = 'STR_STARTS_WITH';
|
|
|
|
export const STR_CONTAINS = 'STR_CONTAINS';
|
|
|
|
export const NUM_EQ = 'NUM_EQ';
|
|
|
|
export const NUM_GT = 'NUM_GT';
|
|
|
|
export const NUM_GTE = 'NUM_GTE';
|
|
|
|
export const NUM_LT = 'NUM_LT';
|
|
|
|
export const NUM_LTE = 'NUM_LTE';
|
|
|
|
export const DATE_AFTER = 'DATE_AFTER';
|
|
|
|
export const DATE_BEFORE = 'DATE_BEFORE';
|
|
|
|
export const SEMVER_EQ = 'SEMVER_EQ';
|
|
|
|
export const SEMVER_GT = 'SEMVER_GT';
|
|
|
|
export const SEMVER_LT = 'SEMVER_LT';
|
|
|
|
|
|
|
|
export const allOperators: Operator[] = [
|
|
|
|
IN,
|
2022-04-07 10:31:06 +02:00
|
|
|
NOT_IN,
|
2022-03-04 17:29:51 +01:00
|
|
|
STR_CONTAINS,
|
2022-04-07 10:31:06 +02:00
|
|
|
STR_STARTS_WITH,
|
|
|
|
STR_ENDS_WITH,
|
2022-03-04 17:29:51 +01:00
|
|
|
NUM_EQ,
|
|
|
|
NUM_GT,
|
|
|
|
NUM_GTE,
|
|
|
|
NUM_LT,
|
|
|
|
NUM_LTE,
|
|
|
|
DATE_BEFORE,
|
2022-04-07 10:31:06 +02:00
|
|
|
DATE_AFTER,
|
2022-03-04 17:29:51 +01:00
|
|
|
SEMVER_EQ,
|
|
|
|
SEMVER_GT,
|
|
|
|
SEMVER_LT,
|
|
|
|
];
|
|
|
|
|
|
|
|
export const stringOperators: Operator[] = [
|
|
|
|
STR_CONTAINS,
|
2022-04-07 10:31:06 +02:00
|
|
|
STR_STARTS_WITH,
|
|
|
|
STR_ENDS_WITH,
|
2022-03-04 17:29:51 +01:00
|
|
|
];
|
2022-04-07 10:31:06 +02:00
|
|
|
|
2022-03-04 17:29:51 +01:00
|
|
|
export const inOperators: Operator[] = [IN, NOT_IN];
|
2022-04-07 10:31:06 +02:00
|
|
|
|
2022-03-04 17:29:51 +01:00
|
|
|
export const numOperators: Operator[] = [
|
|
|
|
NUM_EQ,
|
|
|
|
NUM_GT,
|
|
|
|
NUM_GTE,
|
|
|
|
NUM_LT,
|
|
|
|
NUM_LTE,
|
|
|
|
];
|
2022-04-07 10:31:06 +02:00
|
|
|
|
|
|
|
export const dateOperators: Operator[] = [DATE_BEFORE, DATE_AFTER];
|
|
|
|
|
2022-03-04 17:29:51 +01:00
|
|
|
export const semVerOperators: Operator[] = [SEMVER_EQ, SEMVER_GT, SEMVER_LT];
|
|
|
|
|
|
|
|
export const singleValueOperators: Operator[] = [
|
|
|
|
...semVerOperators,
|
|
|
|
...dateOperators,
|
|
|
|
...numOperators,
|
|
|
|
];
|
|
|
|
|
|
|
|
export const multipleValueOperators: Operator[] = [
|
|
|
|
...stringOperators,
|
|
|
|
...inOperators,
|
|
|
|
];
|
2022-03-16 10:27:23 +01:00
|
|
|
|
|
|
|
export const newOperators: Operator[] = [
|
|
|
|
...stringOperators,
|
|
|
|
...dateOperators,
|
|
|
|
...singleValueOperators,
|
|
|
|
];
|