UNPKG

1.62 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.deprecation = exports.OPERATORS = exports.GENERATED_TIME_TYPES = exports.TYPE_ANY = exports.TYPES = exports.AGENT_ID_ALLOWED_REGEXP = exports.AGENT_ID_MAX_LENGTH = exports.IN_BROWSER = exports.DEFAULT_DECISION_TREE_VERSION = undefined;
7
8var _lodash = require('lodash');
9
10var _lodash2 = _interopRequireDefault(_lodash);
11
12function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
14var DEFAULT_DECISION_TREE_VERSION = exports.DEFAULT_DECISION_TREE_VERSION = '1';
15
16var IN_BROWSER = exports.IN_BROWSER = typeof window !== 'undefined';
17
18var AGENT_ID_MAX_LENGTH = exports.AGENT_ID_MAX_LENGTH = 36;
19var AGENT_ID_ALLOWED_REGEXP = exports.AGENT_ID_ALLOWED_REGEXP = /^([a-z0-9_-]){1,36}$/i;
20
21var TYPES = exports.TYPES = {
22 continuous: 'continuous',
23 enum: 'enum',
24 timezone: 'timezone',
25 time_of_day: 'time_of_day',
26 day_of_week: 'day_of_week',
27 day_of_month: 'day_of_month',
28 month_of_year: 'month_of_year'
29};
30
31var TYPE_ANY = exports.TYPE_ANY = 'any';
32
33var GENERATED_TIME_TYPES = exports.GENERATED_TIME_TYPES = [TYPES.time_of_day, TYPES.day_of_week, TYPES.day_of_month, TYPES.month_of_year];
34
35var OPERATORS = exports.OPERATORS = {
36 IS: 'is',
37 IN: '[in[',
38 GTE: '>=',
39 LT: '<'
40};
41
42var deprecation = exports.deprecation = _lodash2.default.memoize(function (oldFunction, newFunction) {
43 return console.warn('DEPRECATION WARNING: the \'' + oldFunction + '\' function of the craft ai client is deprecated. It will be removed in the future, \'' + newFunction + '\' should be used instead.');
44});
\No newline at end of file