@prismatic-io/spectral 7.4.1 → 7.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ import { ConditionalExpression } from "./types";
2
+ export declare type ValidationResult = [boolean] | [boolean, string];
3
+ export declare const validate: (expression: ConditionalExpression) => ValidationResult;
4
+ /** Convert stringified objects/values back to their native value, all other
5
+ * values just pass through unaltered. */
6
+ export declare const parseValue: (value: unknown) => any;
7
+ export declare const contains: (container: unknown, containee: unknown) => boolean;
8
+ export declare const parseDate: (value: unknown) => Date;
9
+ export declare const evaluate: (expression: ConditionalExpression) => boolean;
10
+ export * from "./types";
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.evaluate = exports.parseDate = exports.contains = exports.parseValue = exports.validate = void 0;
21
+ const types_1 = require("./types");
22
+ const date_fns_1 = require("date-fns");
23
+ const lodash_1 = __importDefault(require("lodash"));
24
+ const validate = (expression) => {
25
+ if (!(expression instanceof Array)) {
26
+ return [false, `Invalid expression syntax: '${expression}'`];
27
+ }
28
+ const [operator] = expression;
29
+ if (operator in types_1.BooleanOperator) {
30
+ if (operator === types_1.BooleanOperator.and || operator === types_1.BooleanOperator.or) {
31
+ const [, ...predicates] = expression;
32
+ return predicates.reduce((previous, current) => {
33
+ const [valid, error] = (0, exports.validate)(current);
34
+ if (!valid) {
35
+ return [valid, [previous[1], error].filter(Boolean).join(", ")];
36
+ }
37
+ return previous;
38
+ }, [true]);
39
+ }
40
+ return [false, `Invalid expression syntax: '${expression}'`];
41
+ }
42
+ else if (operator in types_1.UnaryOperator || operator in types_1.BinaryOperator) {
43
+ return [true];
44
+ }
45
+ return [false, `Invalid expression syntax: '${expression}'`];
46
+ };
47
+ exports.validate = validate;
48
+ /** Convert stringified objects/values back to their native value, all other
49
+ * values just pass through unaltered. */
50
+ const parseValue = (value) => {
51
+ try {
52
+ return typeof value === "string" ? JSON.parse(value) : value;
53
+ }
54
+ catch (_a) {
55
+ return value;
56
+ }
57
+ };
58
+ exports.parseValue = parseValue;
59
+ const contains = (container, containee) => {
60
+ if (typeof container === "string") {
61
+ // Substring check.
62
+ // NOTE: JS is real fast and loose with types here, happily returning true
63
+ // for things like "123".includes(1), but we have to lie to TS.
64
+ return container.includes(`${containee}`);
65
+ }
66
+ if (typeof container === "object" && container !== null) {
67
+ if (Array.isArray(container)) {
68
+ // Array member check.
69
+ return container.includes(containee);
70
+ }
71
+ // Object attribute check (set membership).
72
+ return Object.prototype.hasOwnProperty.call(container, `${containee}`);
73
+ }
74
+ throw new Error("Invalid arguments set to 'contains'.");
75
+ };
76
+ exports.contains = contains;
77
+ const parseDate = (value) => {
78
+ if (value instanceof Date && (0, date_fns_1.isValid)(value)) {
79
+ return value;
80
+ }
81
+ if (typeof value === "number") {
82
+ return new Date(value);
83
+ }
84
+ if (typeof value === "string") {
85
+ const dateFormats = ["yyyy", "yyyy-MM-dd"];
86
+ for (const format of dateFormats) {
87
+ const parsed = (0, date_fns_1.parse)(value, format, 0);
88
+ if ((0, date_fns_1.isValid)(parsed)) {
89
+ return parsed;
90
+ }
91
+ }
92
+ const isoParsed = (0, date_fns_1.parseISO)(value);
93
+ if ((0, date_fns_1.isValid)(isoParsed)) {
94
+ return isoParsed;
95
+ }
96
+ }
97
+ throw new Error("Invalid argument type");
98
+ };
99
+ exports.parseDate = parseDate;
100
+ const isEqual = (left, right) => left == right ||
101
+ lodash_1.default.isEqualWith(left, right, (objectA, objectB) => {
102
+ if (typeof objectA === "object" || typeof objectB === "object") {
103
+ /**
104
+ * `undefined` will fall back to the default isEqual behavior.
105
+ * @see -> (https://lodash.com/docs/4.17.15#isEqualWith)
106
+ */
107
+ return undefined;
108
+ }
109
+ return objectA == objectB;
110
+ });
111
+ const evaluate = (expression) => {
112
+ const [valid, message] = (0, exports.validate)(expression);
113
+ if (!valid) {
114
+ throw new Error(message);
115
+ }
116
+ const [operator] = expression;
117
+ if (operator in types_1.BooleanOperator) {
118
+ const predicates = expression.slice(1);
119
+ const results = predicates.map(exports.evaluate);
120
+ switch (operator) {
121
+ case types_1.BooleanOperator.and:
122
+ return results.reduce((previous, current) => previous && current, true);
123
+ case types_1.BooleanOperator.or:
124
+ return results.reduce((previous, current) => previous || current, false);
125
+ default:
126
+ throw new Error(`Invalid operator: '${operator}'`);
127
+ }
128
+ }
129
+ else if (operator in types_1.UnaryOperator) {
130
+ const [, leftTerm] = expression;
131
+ const left = (0, exports.parseValue)(leftTerm);
132
+ // attempt to compare
133
+ try {
134
+ switch (operator) {
135
+ case types_1.UnaryOperator.isTrue:
136
+ if (typeof left === "string") {
137
+ const lowerValue = left.toLowerCase();
138
+ if (["t", "true", "y", "yes"].includes(lowerValue)) {
139
+ return true;
140
+ }
141
+ else if (["f", "false", "n", "no"].includes(lowerValue)) {
142
+ return false;
143
+ }
144
+ }
145
+ return !!left;
146
+ case types_1.UnaryOperator.isFalse:
147
+ if (typeof left === "string") {
148
+ const lowerValue = left.toLowerCase();
149
+ if (["t", "true", "y", "yes"].includes(lowerValue)) {
150
+ return false;
151
+ }
152
+ else if (["f", "false", "n", "no"].includes(lowerValue)) {
153
+ return true;
154
+ }
155
+ }
156
+ return !left;
157
+ case types_1.UnaryOperator.doesNotExist:
158
+ return [undefined, null, 0, NaN, false, ""].includes(left);
159
+ case types_1.UnaryOperator.exists:
160
+ return ![undefined, null, 0, NaN, false, ""].includes(left);
161
+ case types_1.UnaryOperator.isEmpty:
162
+ if (Array.isArray(left)) {
163
+ return left.length === 0;
164
+ }
165
+ // leftTerm is used here, since "123" would be cast to 123 and would not be a string
166
+ if (typeof leftTerm === "string") {
167
+ return leftTerm.length === 0;
168
+ }
169
+ throw new Error("Please provide an array or string");
170
+ case types_1.UnaryOperator.isNotEmpty:
171
+ if (Array.isArray(left)) {
172
+ return left.length > 0;
173
+ }
174
+ if (typeof leftTerm === "string") {
175
+ return leftTerm.length > 0;
176
+ }
177
+ throw new Error("Please provide an array or string");
178
+ default:
179
+ throw new Error(`Invalid operator: '${operator}'`);
180
+ }
181
+ }
182
+ catch (error) {
183
+ throw new Error(`Incompatible comparison arguments, ${error}`);
184
+ }
185
+ }
186
+ else {
187
+ const [, leftTerm, rightTerm] = expression;
188
+ let left = null;
189
+ let right = null;
190
+ // attempt to convert numeric, array, or object strings as json to native objects,
191
+ // otherwise fall back to original value
192
+ if (operator in
193
+ [
194
+ types_1.BinaryOperator.dateTimeAfter,
195
+ types_1.BinaryOperator.dateTimeBefore,
196
+ types_1.BinaryOperator.dateTimeSame,
197
+ ]) {
198
+ left = (0, exports.parseDate)(leftTerm);
199
+ right = (0, exports.parseDate)(rightTerm);
200
+ }
201
+ else {
202
+ left = (0, exports.parseValue)(leftTerm);
203
+ right = (0, exports.parseValue)(rightTerm);
204
+ }
205
+ // attempt to compare
206
+ try {
207
+ switch (operator) {
208
+ case types_1.BinaryOperator.equal:
209
+ return isEqual(left, right);
210
+ case types_1.BinaryOperator.notEqual:
211
+ return !isEqual(left, right);
212
+ case types_1.BinaryOperator.greaterThan:
213
+ return left > right;
214
+ case types_1.BinaryOperator.greaterThanOrEqual:
215
+ return left >= right;
216
+ case types_1.BinaryOperator.lessThan:
217
+ return left < right;
218
+ case types_1.BinaryOperator.lessThanOrEqual:
219
+ return left <= right;
220
+ case types_1.BinaryOperator.in:
221
+ return (0, exports.contains)(right, left);
222
+ case types_1.BinaryOperator.notIn:
223
+ return !(0, exports.contains)(right, left);
224
+ case types_1.BinaryOperator.exactlyMatches:
225
+ return left === right || lodash_1.default.isEqual(left, right);
226
+ case types_1.BinaryOperator.doesNotExactlyMatch:
227
+ return !(left === right || lodash_1.default.isEqual(left, right));
228
+ case types_1.BinaryOperator.startsWith:
229
+ return `${right}`.startsWith(`${left}`);
230
+ case types_1.BinaryOperator.doesNotStartWith:
231
+ return !`${right}`.startsWith(`${left}`);
232
+ case types_1.BinaryOperator.endsWith:
233
+ return `${right}`.endsWith(`${left}`);
234
+ case types_1.BinaryOperator.doesNotEndWith:
235
+ return !`${right}`.endsWith(`${left}`);
236
+ case types_1.BinaryOperator.dateTimeAfter:
237
+ return (0, date_fns_1.isAfter)(left, right);
238
+ case types_1.BinaryOperator.dateTimeBefore:
239
+ return (0, date_fns_1.isBefore)(left, right);
240
+ case types_1.BinaryOperator.dateTimeSame:
241
+ return left == right;
242
+ default:
243
+ throw new Error(`Invalid operator: '${operator}'`);
244
+ }
245
+ }
246
+ catch (error) {
247
+ throw new Error(`Incompatible comparison arguments, ${error}`);
248
+ }
249
+ }
250
+ };
251
+ exports.evaluate = evaluate;
252
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,92 @@
1
+ export declare enum BooleanOperator {
2
+ and = "and",
3
+ or = "or"
4
+ }
5
+ export declare const BooleanOperatorPhrase: string[];
6
+ export declare enum UnaryOperator {
7
+ isTrue = "isTrue",
8
+ isFalse = "isFalse",
9
+ doesNotExist = "doesNotExist",
10
+ exists = "exists",
11
+ isEmpty = "isEmpty",
12
+ isNotEmpty = "isNotEmpty"
13
+ }
14
+ export declare const UnaryOperatorPhrase: {
15
+ isTrue: string;
16
+ isFalse: string;
17
+ doesNotExist: string;
18
+ exists: string;
19
+ isEmpty: string;
20
+ isNotEmpty: string;
21
+ };
22
+ export declare enum BinaryOperator {
23
+ equal = "equal",
24
+ notEqual = "notEqual",
25
+ greaterThan = "greaterThan",
26
+ greaterThanOrEqual = "greaterThanOrEqual",
27
+ lessThan = "lessThan",
28
+ lessThanOrEqual = "lessThanOrEqual",
29
+ in = "in",
30
+ notIn = "notIn",
31
+ exactlyMatches = "exactlyMatches",
32
+ doesNotExactlyMatch = "doesNotExactlyMatch",
33
+ startsWith = "startsWith",
34
+ doesNotStartWith = "doesNotStartWith",
35
+ endsWith = "endsWith",
36
+ doesNotEndWith = "doesNotEndWith",
37
+ dateTimeAfter = "dateTimeAfter",
38
+ dateTimeBefore = "dateTimeBefore",
39
+ dateTimeSame = "dateTimeSame"
40
+ }
41
+ export declare const BinaryOperatorPhrase: {
42
+ equal: string;
43
+ notEqual: string;
44
+ greaterThan: string;
45
+ greaterThanOrEqual: string;
46
+ lessThan: string;
47
+ lessThanOrEqual: string;
48
+ in: string;
49
+ notIn: string;
50
+ exactlyMatches: string;
51
+ doesNotExactlyMatch: string;
52
+ startsWith: string;
53
+ doesNotStartWith: string;
54
+ endsWith: string;
55
+ doesNotEndWith: string;
56
+ dateTimeAfter: string;
57
+ dateTimeBefore: string;
58
+ dateTimeSame: string;
59
+ };
60
+ export declare type TermOperator = UnaryOperator | BinaryOperator;
61
+ export declare const TermOperatorPhrase: {
62
+ equal: string;
63
+ notEqual: string;
64
+ greaterThan: string;
65
+ greaterThanOrEqual: string;
66
+ lessThan: string;
67
+ lessThanOrEqual: string;
68
+ in: string;
69
+ notIn: string;
70
+ exactlyMatches: string;
71
+ doesNotExactlyMatch: string;
72
+ startsWith: string;
73
+ doesNotStartWith: string;
74
+ endsWith: string;
75
+ doesNotEndWith: string;
76
+ dateTimeAfter: string;
77
+ dateTimeBefore: string;
78
+ dateTimeSame: string;
79
+ isTrue: string;
80
+ isFalse: string;
81
+ doesNotExist: string;
82
+ exists: string;
83
+ isEmpty: string;
84
+ isNotEmpty: string;
85
+ };
86
+ export declare type Term = unknown;
87
+ export declare type TermExpression = [TermOperator, Term, Term?];
88
+ export declare type BooleanExpression = [
89
+ BooleanOperator.and | BooleanOperator.or,
90
+ ...ConditionalExpression[]
91
+ ];
92
+ export declare type ConditionalExpression = TermExpression | BooleanExpression;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TermOperatorPhrase = exports.BinaryOperatorPhrase = exports.BinaryOperator = exports.UnaryOperatorPhrase = exports.UnaryOperator = exports.BooleanOperatorPhrase = exports.BooleanOperator = void 0;
4
+ // GraphQL-derived enums use the same name as the constant for the value,
5
+ // but depending on how things shake out, we may be able to combine with the phrases below.
6
+ var BooleanOperator;
7
+ (function (BooleanOperator) {
8
+ BooleanOperator["and"] = "and";
9
+ BooleanOperator["or"] = "or";
10
+ })(BooleanOperator = exports.BooleanOperator || (exports.BooleanOperator = {}));
11
+ exports.BooleanOperatorPhrase = Object.keys(BooleanOperator);
12
+ var UnaryOperator;
13
+ (function (UnaryOperator) {
14
+ UnaryOperator["isTrue"] = "isTrue";
15
+ UnaryOperator["isFalse"] = "isFalse";
16
+ UnaryOperator["doesNotExist"] = "doesNotExist";
17
+ UnaryOperator["exists"] = "exists";
18
+ UnaryOperator["isEmpty"] = "isEmpty";
19
+ UnaryOperator["isNotEmpty"] = "isNotEmpty";
20
+ })(UnaryOperator = exports.UnaryOperator || (exports.UnaryOperator = {}));
21
+ exports.UnaryOperatorPhrase = {
22
+ [UnaryOperator.isTrue]: "is true",
23
+ [UnaryOperator.isFalse]: "is false",
24
+ [UnaryOperator.doesNotExist]: "does not exist",
25
+ [UnaryOperator.exists]: "exists",
26
+ [UnaryOperator.isEmpty]: "is empty",
27
+ [UnaryOperator.isNotEmpty]: "is not empty",
28
+ };
29
+ var BinaryOperator;
30
+ (function (BinaryOperator) {
31
+ BinaryOperator["equal"] = "equal";
32
+ BinaryOperator["notEqual"] = "notEqual";
33
+ BinaryOperator["greaterThan"] = "greaterThan";
34
+ BinaryOperator["greaterThanOrEqual"] = "greaterThanOrEqual";
35
+ BinaryOperator["lessThan"] = "lessThan";
36
+ BinaryOperator["lessThanOrEqual"] = "lessThanOrEqual";
37
+ BinaryOperator["in"] = "in";
38
+ BinaryOperator["notIn"] = "notIn";
39
+ BinaryOperator["exactlyMatches"] = "exactlyMatches";
40
+ BinaryOperator["doesNotExactlyMatch"] = "doesNotExactlyMatch";
41
+ BinaryOperator["startsWith"] = "startsWith";
42
+ BinaryOperator["doesNotStartWith"] = "doesNotStartWith";
43
+ BinaryOperator["endsWith"] = "endsWith";
44
+ BinaryOperator["doesNotEndWith"] = "doesNotEndWith";
45
+ BinaryOperator["dateTimeAfter"] = "dateTimeAfter";
46
+ BinaryOperator["dateTimeBefore"] = "dateTimeBefore";
47
+ BinaryOperator["dateTimeSame"] = "dateTimeSame";
48
+ })(BinaryOperator = exports.BinaryOperator || (exports.BinaryOperator = {}));
49
+ exports.BinaryOperatorPhrase = {
50
+ [BinaryOperator.equal]: "equal",
51
+ [BinaryOperator.notEqual]: "does not equal",
52
+ [BinaryOperator.greaterThan]: "is greater than",
53
+ [BinaryOperator.greaterThanOrEqual]: "is greater than or equal to",
54
+ [BinaryOperator.lessThan]: "is less than",
55
+ [BinaryOperator.lessThanOrEqual]: "is less than or equal to",
56
+ [BinaryOperator.in]: "contained in",
57
+ [BinaryOperator.notIn]: "not contained in",
58
+ [BinaryOperator.exactlyMatches]: "exactly matches",
59
+ [BinaryOperator.doesNotExactlyMatch]: "does not exactly match",
60
+ [BinaryOperator.startsWith]: "starts with",
61
+ [BinaryOperator.doesNotStartWith]: "does not start with",
62
+ [BinaryOperator.endsWith]: "ends with",
63
+ [BinaryOperator.doesNotEndWith]: "does not end with",
64
+ [BinaryOperator.dateTimeAfter]: "is after (date/time)",
65
+ [BinaryOperator.dateTimeBefore]: "is before (date/time)",
66
+ [BinaryOperator.dateTimeSame]: "is the same (date/time)",
67
+ };
68
+ exports.TermOperatorPhrase = Object.assign(Object.assign({}, exports.UnaryOperatorPhrase), exports.BinaryOperatorPhrase);
@@ -146,7 +146,7 @@ export interface ConditionalInputField extends BaseInputField {
146
146
  /** Data type the InputField will collect. */
147
147
  type: "conditional";
148
148
  /** Collection type of the InputField */
149
- collection: Extract<InputFieldCollection, "valuelist">;
149
+ collection: InputFieldCollection;
150
150
  /** Default value for this field. */
151
151
  default?: ConditionalExpression;
152
152
  /** Clean function */
@@ -1,91 +1 @@
1
- /**
2
- * This file contains types to help define conditional logic for the Prismatic
3
- * branch component, https://prismatic.io/docs/components/branch/
4
- */
5
- /** @ignore */
6
- export declare enum BooleanOperator {
7
- and = "and",
8
- or = "or"
9
- }
10
- export declare const BooleanOperatorPhrase: string[];
11
- export declare enum UnaryOperator {
12
- isTrue = "isTrue",
13
- isFalse = "isFalse",
14
- doesNotExist = "doesNotExist",
15
- exists = "exists"
16
- }
17
- export declare const UnaryOperatorPhrase: {
18
- isTrue: string;
19
- isFalse: string;
20
- doesNotExist: string;
21
- exists: string;
22
- };
23
- export declare enum BinaryOperator {
24
- equal = "equal",
25
- notEqual = "notEqual",
26
- greaterThan = "greaterThan",
27
- greaterThanOrEqual = "greaterThanOrEqual",
28
- lessThan = "lessThan",
29
- lessThanOrEqual = "lessThanOrEqual",
30
- in = "in",
31
- notIn = "notIn",
32
- exactlyMatches = "exactlyMatches",
33
- doesNotExactlyMatch = "doesNotExactlyMatch",
34
- startsWith = "startsWith",
35
- doesNotStartWith = "doesNotStartWith",
36
- endsWith = "endsWith",
37
- doesNotEndWith = "doesNotEndWith",
38
- dateTimeAfter = "dateTimeAfter",
39
- dateTimeBefore = "dateTimeBefore",
40
- dateTimeSame = "dateTimeSame"
41
- }
42
- export declare const BinaryOperatorPhrase: {
43
- equal: string;
44
- notEqual: string;
45
- greaterThan: string;
46
- greaterThanOrEqual: string;
47
- lessThan: string;
48
- lessThanOrEqual: string;
49
- in: string;
50
- notIn: string;
51
- exactlyMatches: string;
52
- doesNotExactlyMatch: string;
53
- startsWith: string;
54
- doesNotStartWith: string;
55
- endsWith: string;
56
- doesNotEndWith: string;
57
- dateTimeAfter: string;
58
- dateTimeBefore: string;
59
- dateTimeSame: string;
60
- };
61
- export declare type TermOperator = UnaryOperator | BinaryOperator;
62
- export declare const TermOperatorPhrase: {
63
- equal: string;
64
- notEqual: string;
65
- greaterThan: string;
66
- greaterThanOrEqual: string;
67
- lessThan: string;
68
- lessThanOrEqual: string;
69
- in: string;
70
- notIn: string;
71
- exactlyMatches: string;
72
- doesNotExactlyMatch: string;
73
- startsWith: string;
74
- doesNotStartWith: string;
75
- endsWith: string;
76
- doesNotEndWith: string;
77
- dateTimeAfter: string;
78
- dateTimeBefore: string;
79
- dateTimeSame: string;
80
- isTrue: string;
81
- isFalse: string;
82
- doesNotExist: string;
83
- exists: string;
84
- };
85
- export declare type Term = unknown;
86
- export declare type TermExpression = [TermOperator, Term, Term?];
87
- export declare type BooleanExpression = [
88
- BooleanOperator.and | BooleanOperator.or,
89
- ...ConditionalExpression[]
90
- ];
91
- export declare type ConditionalExpression = TermExpression | BooleanExpression;
1
+ export * from "../conditionalLogic/types";
@@ -1,67 +1,17 @@
1
1
  "use strict";
2
- /**
3
- * This file contains types to help define conditional logic for the Prismatic
4
- * branch component, https://prismatic.io/docs/components/branch/
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TermOperatorPhrase = exports.BinaryOperatorPhrase = exports.BinaryOperator = exports.UnaryOperatorPhrase = exports.UnaryOperator = exports.BooleanOperatorPhrase = exports.BooleanOperator = void 0;
8
- /** @ignore */
9
- var BooleanOperator;
10
- (function (BooleanOperator) {
11
- BooleanOperator["and"] = "and";
12
- BooleanOperator["or"] = "or";
13
- })(BooleanOperator = exports.BooleanOperator || (exports.BooleanOperator = {}));
14
- exports.BooleanOperatorPhrase = Object.keys(BooleanOperator);
15
- var UnaryOperator;
16
- (function (UnaryOperator) {
17
- UnaryOperator["isTrue"] = "isTrue";
18
- UnaryOperator["isFalse"] = "isFalse";
19
- UnaryOperator["doesNotExist"] = "doesNotExist";
20
- UnaryOperator["exists"] = "exists";
21
- })(UnaryOperator = exports.UnaryOperator || (exports.UnaryOperator = {}));
22
- exports.UnaryOperatorPhrase = {
23
- [UnaryOperator.isTrue]: "is true",
24
- [UnaryOperator.isFalse]: "is false",
25
- [UnaryOperator.doesNotExist]: "does not exist",
26
- [UnaryOperator.exists]: "exists",
27
- };
28
- var BinaryOperator;
29
- (function (BinaryOperator) {
30
- BinaryOperator["equal"] = "equal";
31
- BinaryOperator["notEqual"] = "notEqual";
32
- BinaryOperator["greaterThan"] = "greaterThan";
33
- BinaryOperator["greaterThanOrEqual"] = "greaterThanOrEqual";
34
- BinaryOperator["lessThan"] = "lessThan";
35
- BinaryOperator["lessThanOrEqual"] = "lessThanOrEqual";
36
- BinaryOperator["in"] = "in";
37
- BinaryOperator["notIn"] = "notIn";
38
- BinaryOperator["exactlyMatches"] = "exactlyMatches";
39
- BinaryOperator["doesNotExactlyMatch"] = "doesNotExactlyMatch";
40
- BinaryOperator["startsWith"] = "startsWith";
41
- BinaryOperator["doesNotStartWith"] = "doesNotStartWith";
42
- BinaryOperator["endsWith"] = "endsWith";
43
- BinaryOperator["doesNotEndWith"] = "doesNotEndWith";
44
- BinaryOperator["dateTimeAfter"] = "dateTimeAfter";
45
- BinaryOperator["dateTimeBefore"] = "dateTimeBefore";
46
- BinaryOperator["dateTimeSame"] = "dateTimeSame";
47
- })(BinaryOperator = exports.BinaryOperator || (exports.BinaryOperator = {}));
48
- exports.BinaryOperatorPhrase = {
49
- [BinaryOperator.equal]: "equal",
50
- [BinaryOperator.notEqual]: "does not equal",
51
- [BinaryOperator.greaterThan]: "is greater than",
52
- [BinaryOperator.greaterThanOrEqual]: "is greater than or equal to",
53
- [BinaryOperator.lessThan]: "is less than",
54
- [BinaryOperator.lessThanOrEqual]: "is less than or equal to",
55
- [BinaryOperator.in]: "contained in",
56
- [BinaryOperator.notIn]: "not contained in",
57
- [BinaryOperator.exactlyMatches]: "exactly matches",
58
- [BinaryOperator.doesNotExactlyMatch]: "does not exactly match",
59
- [BinaryOperator.startsWith]: "starts with",
60
- [BinaryOperator.doesNotStartWith]: "does not start with",
61
- [BinaryOperator.endsWith]: "ends with",
62
- [BinaryOperator.doesNotEndWith]: "does not end with",
63
- [BinaryOperator.dateTimeAfter]: "is after (date/time)",
64
- [BinaryOperator.dateTimeBefore]: "is before (date/time)",
65
- [BinaryOperator.dateTimeSame]: "is the same (date/time)",
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
66
15
  };
67
- exports.TermOperatorPhrase = Object.assign(Object.assign({}, exports.UnaryOperatorPhrase), exports.BinaryOperatorPhrase);
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("../conditionalLogic/types"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "7.4.1",
3
+ "version": "7.5.1",
4
4
  "description": "Utility library for building Prismatic components",
5
5
  "keywords": [
6
6
  "prismatic"
@@ -40,7 +40,7 @@
40
40
  "@jsonforms/core": "3.0.0",
41
41
  "axios": "0.27.2",
42
42
  "axios-retry": "3.2.5",
43
- "date-fns": "2.28.0",
43
+ "date-fns": "2.29.3",
44
44
  "form-data": "4.0.0",
45
45
  "jest-mock": "27.0.3",
46
46
  "soap": "1.0.0",