@burnsred/entity 0.6.4-dev.0 → 0.6.5
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.
- package/CHANGELOG.md +40 -0
- package/dist/development.js +1377 -0
- package/dist/development.js.map +1 -0
- package/dist/legacy.js +30 -0
- package/dist/production.min.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,1377 @@
|
|
|
1
|
+
import 'core-js/modules/es6.regexp.replace';
|
|
2
|
+
import _isString from 'lodash/isString';
|
|
3
|
+
import _isFunction from 'lodash/isFunction';
|
|
4
|
+
import { List, Map, fromJS, isImmutable } from 'immutable';
|
|
5
|
+
import 'core-js/modules/es6.regexp.flags';
|
|
6
|
+
import 'core-js/modules/es6.regexp.to-string';
|
|
7
|
+
import 'core-js/modules/es6.object.assign';
|
|
8
|
+
import 'core-js/modules/es6.function.name';
|
|
9
|
+
import moment from 'moment';
|
|
10
|
+
import 'core-js/modules/es6.array.find';
|
|
11
|
+
import 'core-js/modules/web.dom.iterable';
|
|
12
|
+
import 'core-js/modules/es6.array.iterator';
|
|
13
|
+
import 'core-js/modules/es7.object.values';
|
|
14
|
+
import _range from 'lodash/range';
|
|
15
|
+
import _keyBy from 'lodash/keyBy';
|
|
16
|
+
import _get from 'lodash/get';
|
|
17
|
+
import _sample from 'lodash/sample';
|
|
18
|
+
import _sampleSize from 'lodash/sampleSize';
|
|
19
|
+
import _mapValues from 'lodash/mapValues';
|
|
20
|
+
import _flowRight from 'lodash/flowRight';
|
|
21
|
+
import 'core-js/modules/es6.number.constructor';
|
|
22
|
+
import 'core-js/modules/es6.number.is-nan';
|
|
23
|
+
import queryString from 'query-string';
|
|
24
|
+
|
|
25
|
+
var removeMultiSpace = (function (value) {
|
|
26
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
27
|
+
if (!_isString(value)) throw new Error('cleaners.removeMultiSpace: value must be of type string');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return value.replace(/\s\s+/g, ' ');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var sliceToMaxLength = (function (value, _ref) {
|
|
34
|
+
var field = _ref.field;
|
|
35
|
+
|
|
36
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
37
|
+
if (!_isString(value)) throw new Error('cleaners.removeMultiSpace: value must be of type string');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return field.maxLength ? value.slice(0, field.maxLength) : value;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
46
|
+
removeMultiSpace: removeMultiSpace,
|
|
47
|
+
sliceToMaxLength: sliceToMaxLength
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
var allowBlank = (function () {
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
var entityValid = (function (value) {
|
|
55
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
56
|
+
var errors = options.field.entity.validate(value, options);
|
|
57
|
+
return !!errors && errors.size > 0 && errors;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
var isRequired = (function (value) {
|
|
61
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
62
|
+
|
|
63
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
64
|
+
if (!configs.field) throw new Error('validators.isRequired: "field" option is required');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return configs.field.isBlank(value, configs) && 'May not be blank';
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
function _classCallCheck(instance, Constructor) {
|
|
71
|
+
if (!(instance instanceof Constructor)) {
|
|
72
|
+
throw new TypeError("Cannot call a class as a function");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _defineProperties(target, props) {
|
|
77
|
+
for (var i = 0; i < props.length; i++) {
|
|
78
|
+
var descriptor = props[i];
|
|
79
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
80
|
+
descriptor.configurable = true;
|
|
81
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
82
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
87
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
88
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
89
|
+
return Constructor;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _defineProperty(obj, key, value) {
|
|
93
|
+
if (key in obj) {
|
|
94
|
+
Object.defineProperty(obj, key, {
|
|
95
|
+
value: value,
|
|
96
|
+
enumerable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
writable: true
|
|
99
|
+
});
|
|
100
|
+
} else {
|
|
101
|
+
obj[key] = value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return obj;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function _objectSpread(target) {
|
|
108
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
109
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
110
|
+
var ownKeys = Object.keys(source);
|
|
111
|
+
|
|
112
|
+
if (typeof Object.getOwnPropertySymbols === 'function') {
|
|
113
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
|
|
114
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
ownKeys.forEach(function (key) {
|
|
119
|
+
_defineProperty(target, key, source[key]);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return target;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function _inherits(subClass, superClass) {
|
|
127
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
128
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
132
|
+
constructor: {
|
|
133
|
+
value: subClass,
|
|
134
|
+
writable: true,
|
|
135
|
+
configurable: true
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function _getPrototypeOf(o) {
|
|
142
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
143
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
144
|
+
};
|
|
145
|
+
return _getPrototypeOf(o);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function _setPrototypeOf(o, p) {
|
|
149
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
150
|
+
o.__proto__ = p;
|
|
151
|
+
return o;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
return _setPrototypeOf(o, p);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function _assertThisInitialized(self) {
|
|
158
|
+
if (self === void 0) {
|
|
159
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return self;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function _possibleConstructorReturn(self, call) {
|
|
166
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
167
|
+
return call;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return _assertThisInitialized(self);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function _toConsumableArray(arr) {
|
|
174
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function _arrayWithoutHoles(arr) {
|
|
178
|
+
if (Array.isArray(arr)) {
|
|
179
|
+
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
180
|
+
|
|
181
|
+
return arr2;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function _iterableToArray(iter) {
|
|
186
|
+
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function _nonIterableSpread() {
|
|
190
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
var isRequiredIf = (function (predicate) {
|
|
194
|
+
return function (value, configs) {
|
|
195
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
196
|
+
if (!_isFunction(predicate)) throw new Error('validators.isRequiredIf: predicate argument must be of type function');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return predicate(_objectSpread({
|
|
200
|
+
value: value
|
|
201
|
+
}, configs)) && isRequired(value, configs);
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
var list = (function (validators) {
|
|
206
|
+
return function (values, configs) {
|
|
207
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
208
|
+
if (!List.isList(values)) throw new Error('validators.list: "values" must be a list');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var errors = values.map(function (value) {
|
|
212
|
+
return List(validators).map(function (validator) {
|
|
213
|
+
return validator(value, configs);
|
|
214
|
+
}).filter(function (error) {
|
|
215
|
+
return error;
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
return errors.some(function (error) {
|
|
219
|
+
return error.size > 0;
|
|
220
|
+
}) && Map({
|
|
221
|
+
errors: errors,
|
|
222
|
+
list: true,
|
|
223
|
+
message: 'Invalid list'
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
var mayNotBeBlank = (function (value) {
|
|
229
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
230
|
+
|
|
231
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
232
|
+
if (!configs.field) throw new Error('validator.mayNotBeBlank: "field" option is required');
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var validator = configs.flag && configs.field.flags[configs.flag];
|
|
236
|
+
var defaultError = !configs.field.blank && isRequired(value, configs);
|
|
237
|
+
if (!validator) return defaultError;
|
|
238
|
+
var flagError = validator(value, configs);
|
|
239
|
+
return defaultError ? flagError && defaultError : flagError && 'May not be blank';
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
245
|
+
allowBlank: allowBlank,
|
|
246
|
+
entityValid: entityValid,
|
|
247
|
+
isRequired: isRequired,
|
|
248
|
+
isRequiredIf: isRequiredIf,
|
|
249
|
+
list: list,
|
|
250
|
+
mayNotBeBlank: mayNotBeBlank
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
var Field =
|
|
254
|
+
/*#__PURE__*/
|
|
255
|
+
function () {
|
|
256
|
+
function Field() {
|
|
257
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
258
|
+
|
|
259
|
+
_classCallCheck(this, Field);
|
|
260
|
+
|
|
261
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
262
|
+
if (options.options && !List.isList(options.options)) throw new Error("Field.constructor (".concat(this.constructor.name, "): options.options must be a an immutable List"));
|
|
263
|
+
if (options.options && options.options.size !== options.options.toSet().size) throw new Error("Field.constructor (".concat(this.constructor.name, "): options.options must have unique items."));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
var defaults = {
|
|
267
|
+
blank: false,
|
|
268
|
+
cleaners: [],
|
|
269
|
+
many: false,
|
|
270
|
+
validators: options.blank ? [] : [isRequired]
|
|
271
|
+
};
|
|
272
|
+
Object.assign(this, defaults, options, {
|
|
273
|
+
validators: _isFunction(options.validators) ? options.validators(defaults.validators) : options.validators || defaults.validators
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
_createClass(Field, [{
|
|
278
|
+
key: "clean",
|
|
279
|
+
value: function clean(record) {
|
|
280
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
281
|
+
|
|
282
|
+
var newOptions = _objectSpread({}, configs, {
|
|
283
|
+
field: this
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
return this.cleaners.reduce(function (prev, cleaner) {
|
|
287
|
+
return cleaner(prev, newOptions);
|
|
288
|
+
}, record);
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "dataToValue",
|
|
292
|
+
value: function dataToValue(data) {
|
|
293
|
+
return fromJS(data);
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "default",
|
|
297
|
+
value: function _default() {
|
|
298
|
+
return this.many ? List() : null;
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "getErrors",
|
|
302
|
+
value: function getErrors(errors) {
|
|
303
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
304
|
+
|
|
305
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
306
|
+
if (configs.name) throw new Error("Field.getErrors (".concat(this.constructor.name, "): option \"name\" is not supported."));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return errors;
|
|
310
|
+
}
|
|
311
|
+
}, {
|
|
312
|
+
key: "getErrorsArray",
|
|
313
|
+
value: function getErrorsArray(errors) {
|
|
314
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
315
|
+
|
|
316
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
317
|
+
if (options.index === undefined) throw new Error("Field.getErrorsArray (".concat(this.constructor.name, "): option \"index\" is required."));
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return errors.filter(function (error) {
|
|
321
|
+
return Map.isMap(error) && error.get('list');
|
|
322
|
+
}).flatMap(function (error) {
|
|
323
|
+
return error.getIn(['errors', options.index]);
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}, {
|
|
327
|
+
key: "getField",
|
|
328
|
+
value: function getField() {
|
|
329
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
330
|
+
|
|
331
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
332
|
+
if (options.name) throw new Error("Field.getField (".concat(this.constructor.name, "): method with option name is not supported."));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return options.name ? null : this;
|
|
336
|
+
}
|
|
337
|
+
}, {
|
|
338
|
+
key: "getId",
|
|
339
|
+
value: function getId() {
|
|
340
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
341
|
+
throw new Error("Field.getId (".concat(this.constructor.name, "): method is not supported."));
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, {
|
|
345
|
+
key: "getKey",
|
|
346
|
+
value: function getKey(value) {
|
|
347
|
+
return this.toString(value);
|
|
348
|
+
}
|
|
349
|
+
}, {
|
|
350
|
+
key: "getOptions",
|
|
351
|
+
value: function getOptions() {
|
|
352
|
+
return this.options || List();
|
|
353
|
+
}
|
|
354
|
+
}, {
|
|
355
|
+
key: "getValue",
|
|
356
|
+
value: function getValue(value) {
|
|
357
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
358
|
+
|
|
359
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
360
|
+
if (options.name) throw new Error("Field.getValue (".concat(this.constructor.name, "): option \"name\" is not supported."));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return options.name ? null : value;
|
|
364
|
+
}
|
|
365
|
+
}, {
|
|
366
|
+
key: "isBlank",
|
|
367
|
+
value: function isBlank() {
|
|
368
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
369
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
370
|
+
|
|
371
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
372
|
+
if (options.name) throw new Error("Field.isBlank (".concat(this.constructor.name, "): method with option name is not supported."));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return value === null || (this.many ? value.size === 0 : value === '');
|
|
376
|
+
}
|
|
377
|
+
}, {
|
|
378
|
+
key: "toData",
|
|
379
|
+
value: function toData(value) {
|
|
380
|
+
return isImmutable(value) ? value.toJS() : value;
|
|
381
|
+
}
|
|
382
|
+
}, {
|
|
383
|
+
key: "toParams",
|
|
384
|
+
value: function toParams(value) {
|
|
385
|
+
return value && value.toString() || '';
|
|
386
|
+
}
|
|
387
|
+
}, {
|
|
388
|
+
key: "toString",
|
|
389
|
+
value: function toString() {
|
|
390
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
391
|
+
return value === null ? '' : value.toString();
|
|
392
|
+
}
|
|
393
|
+
}, {
|
|
394
|
+
key: "validate",
|
|
395
|
+
value: function validate(value) {
|
|
396
|
+
var _this = this;
|
|
397
|
+
|
|
398
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
399
|
+
|
|
400
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
401
|
+
if (this.many && !List.isList(value)) throw new Error("Field.validate (".concat(this.constructor.name, "-").concat(options.fieldName, "): \"value\" must be an \"Immutable List\" with field option \"many\""));
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
var validators = _isFunction(options.validators) ? options.validators(this.validators) : options.validators || this.validators;
|
|
405
|
+
return List(validators).map(function (validator) {
|
|
406
|
+
return validator(value, _objectSpread({}, options, {
|
|
407
|
+
field: _this
|
|
408
|
+
}));
|
|
409
|
+
}).filter(function (error) {
|
|
410
|
+
return error;
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}]);
|
|
414
|
+
|
|
415
|
+
return Field;
|
|
416
|
+
}();
|
|
417
|
+
|
|
418
|
+
var AnyField =
|
|
419
|
+
/*#__PURE__*/
|
|
420
|
+
function (_Field) {
|
|
421
|
+
_inherits(AnyField, _Field);
|
|
422
|
+
|
|
423
|
+
function AnyField() {
|
|
424
|
+
_classCallCheck(this, AnyField);
|
|
425
|
+
|
|
426
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(AnyField).apply(this, arguments));
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return AnyField;
|
|
430
|
+
}(Field);
|
|
431
|
+
|
|
432
|
+
var BooleanField =
|
|
433
|
+
/*#__PURE__*/
|
|
434
|
+
function (_AnyField) {
|
|
435
|
+
_inherits(BooleanField, _AnyField);
|
|
436
|
+
|
|
437
|
+
function BooleanField() {
|
|
438
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
439
|
+
|
|
440
|
+
_classCallCheck(this, BooleanField);
|
|
441
|
+
|
|
442
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(BooleanField).call(this, _objectSpread({
|
|
443
|
+
type: 'boolean'
|
|
444
|
+
}, configs)));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return BooleanField;
|
|
448
|
+
}(AnyField);
|
|
449
|
+
|
|
450
|
+
var CharField =
|
|
451
|
+
/*#__PURE__*/
|
|
452
|
+
function (_AnyField) {
|
|
453
|
+
_inherits(CharField, _AnyField);
|
|
454
|
+
|
|
455
|
+
function CharField() {
|
|
456
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
457
|
+
|
|
458
|
+
_classCallCheck(this, CharField);
|
|
459
|
+
|
|
460
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(CharField).call(this, _objectSpread({
|
|
461
|
+
type: 'char'
|
|
462
|
+
}, configs)));
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
_createClass(CharField, [{
|
|
466
|
+
key: "default",
|
|
467
|
+
value: function _default() {
|
|
468
|
+
return this.many ? List() : '';
|
|
469
|
+
}
|
|
470
|
+
}]);
|
|
471
|
+
|
|
472
|
+
return CharField;
|
|
473
|
+
}(AnyField);
|
|
474
|
+
|
|
475
|
+
var DateField =
|
|
476
|
+
/*#__PURE__*/
|
|
477
|
+
function (_AnyField) {
|
|
478
|
+
_inherits(DateField, _AnyField);
|
|
479
|
+
|
|
480
|
+
function DateField() {
|
|
481
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
482
|
+
|
|
483
|
+
_classCallCheck(this, DateField);
|
|
484
|
+
|
|
485
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(DateField).call(this, _objectSpread({
|
|
486
|
+
allowTime: false,
|
|
487
|
+
dateFormat: 'YYYY-MM-DD',
|
|
488
|
+
type: 'date'
|
|
489
|
+
}, configs)));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
_createClass(DateField, [{
|
|
493
|
+
key: "dataToValue",
|
|
494
|
+
value: function dataToValue(data) {
|
|
495
|
+
return data && moment(data);
|
|
496
|
+
}
|
|
497
|
+
}, {
|
|
498
|
+
key: "toData",
|
|
499
|
+
value: function toData(value) {
|
|
500
|
+
return value && value.format(this.dateFormat);
|
|
501
|
+
}
|
|
502
|
+
}, {
|
|
503
|
+
key: "toParams",
|
|
504
|
+
value: function toParams(value) {
|
|
505
|
+
return value && value.format(this.dateFormat) || '';
|
|
506
|
+
}
|
|
507
|
+
}, {
|
|
508
|
+
key: "toString",
|
|
509
|
+
value: function toString(value) {
|
|
510
|
+
return value && value.format(this.dateFormat) || '';
|
|
511
|
+
}
|
|
512
|
+
}]);
|
|
513
|
+
|
|
514
|
+
return DateField;
|
|
515
|
+
}(AnyField);
|
|
516
|
+
|
|
517
|
+
var DateTimeField =
|
|
518
|
+
/*#__PURE__*/
|
|
519
|
+
function (_DateField) {
|
|
520
|
+
_inherits(DateTimeField, _DateField);
|
|
521
|
+
|
|
522
|
+
function DateTimeField() {
|
|
523
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
524
|
+
|
|
525
|
+
_classCallCheck(this, DateTimeField);
|
|
526
|
+
|
|
527
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(DateTimeField).call(this, _objectSpread({
|
|
528
|
+
dateFormat: 'YYYY-MM-DD HH:mm',
|
|
529
|
+
allowTime: true
|
|
530
|
+
}, configs)));
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
return DateTimeField;
|
|
534
|
+
}(DateField);
|
|
535
|
+
|
|
536
|
+
var EntityField =
|
|
537
|
+
/*#__PURE__*/
|
|
538
|
+
function (_AnyField) {
|
|
539
|
+
_inherits(EntityField, _AnyField);
|
|
540
|
+
|
|
541
|
+
function EntityField() {
|
|
542
|
+
var _this;
|
|
543
|
+
|
|
544
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
545
|
+
|
|
546
|
+
_classCallCheck(this, EntityField);
|
|
547
|
+
|
|
548
|
+
var defaults = {
|
|
549
|
+
nested: true,
|
|
550
|
+
type: 'entity'
|
|
551
|
+
};
|
|
552
|
+
var entityValidators = configs.many ? [list([entityValid])] : [entityValid];
|
|
553
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(EntityField).call(this, Object.assign(defaults, configs, {
|
|
554
|
+
validators: function validators(defaultValidators) {
|
|
555
|
+
return _isFunction(configs.validators) ? configs.validators(defaultValidators.concat(entityValidators)) : configs.validators || defaultValidators.concat(entityValidators);
|
|
556
|
+
}
|
|
557
|
+
})));
|
|
558
|
+
|
|
559
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
560
|
+
if (!configs.entity) throw new Error("".concat(_this.constructor.name, ".constructor: \"entity\" option is required"));
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return _this;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
_createClass(EntityField, [{
|
|
567
|
+
key: "dataToValue",
|
|
568
|
+
value: function dataToValue(data) {
|
|
569
|
+
return this.entity.dataToRecord(data);
|
|
570
|
+
}
|
|
571
|
+
}, {
|
|
572
|
+
key: "default",
|
|
573
|
+
value: function _default() {
|
|
574
|
+
if (this.many) return List();
|
|
575
|
+
return this.blank ? null : this.entity.dataToRecord({});
|
|
576
|
+
}
|
|
577
|
+
}, {
|
|
578
|
+
key: "getErrors",
|
|
579
|
+
value: function getErrors(errors) {
|
|
580
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
581
|
+
|
|
582
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
583
|
+
if (configs.name && !_isString(configs.name)) throw new Error("EntityField.getErrors (".concat(this.entity.name, "): \"name\" option must be either a string or undefined"));
|
|
584
|
+
if (configs.name && !this.entity.fields[configs.name]) throw new Error("EntityField.getErrors (".concat(this.entity.name, "): field \"").concat(configs.name, "\" not found"));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
return configs.name ? errors.filter(function (error) {
|
|
588
|
+
return Map.isMap(error) && error.get('detail');
|
|
589
|
+
}).flatMap(function (error) {
|
|
590
|
+
return Map.isMap(error.getIn(['errors', configs.name])) ? List([error.getIn(['errors', configs.name])]) : error.getIn(['errors', configs.name]);
|
|
591
|
+
}).filter(function (error) {
|
|
592
|
+
return error;
|
|
593
|
+
}) : errors;
|
|
594
|
+
}
|
|
595
|
+
}, {
|
|
596
|
+
key: "getField",
|
|
597
|
+
value: function getField() {
|
|
598
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
599
|
+
|
|
600
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
601
|
+
if (configs.name && !_isString(configs.name)) throw new Error("EntityField.getField (".concat(this.entity.name, "): \"name\" option must be either a string or undefined"));
|
|
602
|
+
if (configs.name && !this.entity.fields[configs.name]) throw new Error("EntityField.getField (".concat(this.entity.name, "): field \"").concat(configs.name, "\" not found"));
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return configs.name ? this.entity.fields[configs.name] : this;
|
|
606
|
+
}
|
|
607
|
+
}, {
|
|
608
|
+
key: "getId",
|
|
609
|
+
value: function getId(value) {
|
|
610
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
611
|
+
|
|
612
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
613
|
+
if (configs.name && !_isString(configs.name)) throw new Error("EntityField.getId (".concat(this.entity.name, "): \"name\" option must be either a string or undefined"));
|
|
614
|
+
if (configs.name && !this.entity.fields[configs.name]) throw new Error("EntityField.getId (".concat(this.entity.name, "): field \"").concat(configs.name, "\" not found"));
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
return this.getField(_objectSpread({
|
|
618
|
+
value: value
|
|
619
|
+
}, configs)).entity.getId(this.getValue(value, configs));
|
|
620
|
+
}
|
|
621
|
+
}, {
|
|
622
|
+
key: "getKey",
|
|
623
|
+
value: function getKey(value) {
|
|
624
|
+
return this.getId(value);
|
|
625
|
+
}
|
|
626
|
+
}, {
|
|
627
|
+
key: "getOptions",
|
|
628
|
+
value: function getOptions() {
|
|
629
|
+
return this.options || this.entity.options || List();
|
|
630
|
+
}
|
|
631
|
+
}, {
|
|
632
|
+
key: "getValue",
|
|
633
|
+
value: function getValue(value) {
|
|
634
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
635
|
+
|
|
636
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
637
|
+
if (configs.name && !_isString(configs.name)) throw new Error("EntityField.getValue (".concat(this.entity.name, "): \"name\" option must be either a string or undefined"));
|
|
638
|
+
if (configs.name && !this.entity.fields[configs.name]) throw new Error("EntityField.getValue (".concat(this.entity.name, "): field \"").concat(configs.name, "\" not found"));
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
return configs.name && value ? value.get(configs.name) : value;
|
|
642
|
+
}
|
|
643
|
+
}, {
|
|
644
|
+
key: "isBlank",
|
|
645
|
+
value: function isBlank() {
|
|
646
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
647
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
648
|
+
|
|
649
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
650
|
+
if (configs.name && !_isString(configs.name)) throw new Error("EntityField.isBlank (".concat(this.entity.name, "): \"name\" option must be either a string or undefined"));
|
|
651
|
+
if (configs.name && !this.entity.fields[configs.name]) throw new Error("EntityField.isBlank (".concat(this.entity.name, "): field \"").concat(configs.name, "\" not found"));
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return value === null || (this.many ? value.size === 0 : value === '');
|
|
655
|
+
}
|
|
656
|
+
}, {
|
|
657
|
+
key: "toData",
|
|
658
|
+
value: function toData(value) {
|
|
659
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
660
|
+
return this.entity.toData(value, configs);
|
|
661
|
+
}
|
|
662
|
+
}, {
|
|
663
|
+
key: "valueToParam",
|
|
664
|
+
value: function valueToParam() {
|
|
665
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
666
|
+
return value === null ? undefined : value.get(this.entity.idField);
|
|
667
|
+
}
|
|
668
|
+
}, {
|
|
669
|
+
key: "toParams",
|
|
670
|
+
value: function toParams(value, configs) {
|
|
671
|
+
return this.getId(value, configs);
|
|
672
|
+
}
|
|
673
|
+
}, {
|
|
674
|
+
key: "toString",
|
|
675
|
+
value: function toString(value) {
|
|
676
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
677
|
+
return this.entity.toString(value, configs);
|
|
678
|
+
}
|
|
679
|
+
}]);
|
|
680
|
+
|
|
681
|
+
return EntityField;
|
|
682
|
+
}(AnyField);
|
|
683
|
+
|
|
684
|
+
var IdField =
|
|
685
|
+
/*#__PURE__*/
|
|
686
|
+
function (_AnyField) {
|
|
687
|
+
_inherits(IdField, _AnyField);
|
|
688
|
+
|
|
689
|
+
function IdField() {
|
|
690
|
+
var _this;
|
|
691
|
+
|
|
692
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
693
|
+
|
|
694
|
+
_classCallCheck(this, IdField);
|
|
695
|
+
|
|
696
|
+
_this = _possibleConstructorReturn(this, _getPrototypeOf(IdField).call(this, configs));
|
|
697
|
+
|
|
698
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
699
|
+
if (configs.many) throw new Error("".concat(_this.constructor.name, ".constructor: \"many\" option is not supported."));
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return _this;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
_createClass(IdField, [{
|
|
706
|
+
key: "dataToValue",
|
|
707
|
+
value: function dataToValue(data) {
|
|
708
|
+
var _ref;
|
|
709
|
+
|
|
710
|
+
return _isFunction((_ref = data) != null ? _ref.toString : _ref) ? data.toString() : data;
|
|
711
|
+
}
|
|
712
|
+
}, {
|
|
713
|
+
key: "default",
|
|
714
|
+
value: function _default() {
|
|
715
|
+
return undefined;
|
|
716
|
+
}
|
|
717
|
+
}]);
|
|
718
|
+
|
|
719
|
+
return IdField;
|
|
720
|
+
}(AnyField);
|
|
721
|
+
|
|
722
|
+
var Entity =
|
|
723
|
+
/*#__PURE__*/
|
|
724
|
+
function () {
|
|
725
|
+
function Entity() {
|
|
726
|
+
_classCallCheck(this, Entity);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
_createClass(Entity, null, [{
|
|
730
|
+
key: "actionArrayDeleteAtIndex",
|
|
731
|
+
value: function actionArrayDeleteAtIndex(records) {
|
|
732
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
733
|
+
_ref$index = _ref.index,
|
|
734
|
+
index = _ref$index === void 0 ? null : _ref$index;
|
|
735
|
+
|
|
736
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
737
|
+
if (!List.isList(records)) throw new Error("Entity.actionArrayDeleteAt (".concat(this.name, "): \"records\" must be an immutable List."));
|
|
738
|
+
if (index === null) throw new Error("Entity.actionArrayDeleteAt (".concat(this.name, "): \"index\" option must be set."));
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
return records.delete(index);
|
|
742
|
+
}
|
|
743
|
+
}, {
|
|
744
|
+
key: "actionArrayMoveAtIndex",
|
|
745
|
+
value: function actionArrayMoveAtIndex(records) {
|
|
746
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
747
|
+
_ref2$index = _ref2.index,
|
|
748
|
+
index = _ref2$index === void 0 ? null : _ref2$index,
|
|
749
|
+
_ref2$indexTo = _ref2.indexTo,
|
|
750
|
+
indexTo = _ref2$indexTo === void 0 ? null : _ref2$indexTo;
|
|
751
|
+
|
|
752
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
753
|
+
if (!List.isList(records)) throw new Error("Entity.actionArrayMoveAtIndex (".concat(this.name, "): \"records\" must be an immutable List."));
|
|
754
|
+
if (index === null) throw new Error("Entity.actionArrayMoveAtIndex (".concat(this.name, "): \"index\" option must be set."));
|
|
755
|
+
if (indexTo === null) throw new Error("Entity.actionArrayMoveAtIndex (".concat(this.name, "): \"indexTo\" option must be set."));
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
return records.delete(index).insert(indexTo, records.get(index));
|
|
759
|
+
}
|
|
760
|
+
}, {
|
|
761
|
+
key: "actionReset",
|
|
762
|
+
value: function actionReset(record) {
|
|
763
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
764
|
+
return configs.valueInitial || this.dataToRecord(_defineProperty({}, this.idField, record.get(this.idField)));
|
|
765
|
+
}
|
|
766
|
+
}, {
|
|
767
|
+
key: "clean",
|
|
768
|
+
value: function clean(record) {
|
|
769
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
770
|
+
|
|
771
|
+
var newOptions = _objectSpread({}, configs, {
|
|
772
|
+
entity: this
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
return this.cleaners.reduce(function (prev, cleaner) {
|
|
776
|
+
return cleaner(prev, newOptions);
|
|
777
|
+
}, record);
|
|
778
|
+
}
|
|
779
|
+
}, {
|
|
780
|
+
key: "dataToRecord",
|
|
781
|
+
value: function dataToRecord() {
|
|
782
|
+
var _this = this;
|
|
783
|
+
|
|
784
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
785
|
+
|
|
786
|
+
var fieldDataToValue = function fieldDataToValue(value, key) {
|
|
787
|
+
return List.isList(value) || Array.isArray(value) ? List(value).map(function (val) {
|
|
788
|
+
return _this.fields[key].dataToValue(val, {
|
|
789
|
+
data: data
|
|
790
|
+
});
|
|
791
|
+
}) : _this.fields[key].dataToValue(value, {
|
|
792
|
+
data: data
|
|
793
|
+
});
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
var getDefaultFromField = function getDefaultFromField(field) {
|
|
797
|
+
return _isFunction(field.default) ? field.default({
|
|
798
|
+
data: data
|
|
799
|
+
}) : field.default;
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
var values = Map(data).filter(function (value, key) {
|
|
803
|
+
return key in _this.fields;
|
|
804
|
+
}).filterNot(function (value) {
|
|
805
|
+
return value === undefined;
|
|
806
|
+
}).map(fieldDataToValue);
|
|
807
|
+
return data && Map(this.fields).filter(function (value, key) {
|
|
808
|
+
return data[key] === undefined;
|
|
809
|
+
}).map(getDefaultFromField).merge(values);
|
|
810
|
+
}
|
|
811
|
+
}, {
|
|
812
|
+
key: "getEntityField",
|
|
813
|
+
value: function getEntityField() {
|
|
814
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
815
|
+
return new EntityField(_objectSpread({
|
|
816
|
+
entity: this
|
|
817
|
+
}, configs));
|
|
818
|
+
}
|
|
819
|
+
}, {
|
|
820
|
+
key: "getId",
|
|
821
|
+
value: function getId() {
|
|
822
|
+
var record = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
823
|
+
return record === null ? undefined : record.get(this.idField);
|
|
824
|
+
}
|
|
825
|
+
}, {
|
|
826
|
+
key: "getPaths",
|
|
827
|
+
value: function getPaths() {
|
|
828
|
+
return this.paths;
|
|
829
|
+
}
|
|
830
|
+
}, {
|
|
831
|
+
key: "getSize",
|
|
832
|
+
value: function getSize() {
|
|
833
|
+
return 0;
|
|
834
|
+
}
|
|
835
|
+
}, {
|
|
836
|
+
key: "isEntity",
|
|
837
|
+
value: function isEntity(maybeEntity) {
|
|
838
|
+
return !!maybeEntity && maybeEntity.prototype instanceof Entity;
|
|
839
|
+
}
|
|
840
|
+
}, {
|
|
841
|
+
key: "isEntityDescendant",
|
|
842
|
+
value: function isEntityDescendant(maybeDescendant) {
|
|
843
|
+
return !!maybeDescendant && maybeDescendant.prototype instanceof this;
|
|
844
|
+
}
|
|
845
|
+
}, {
|
|
846
|
+
key: "isValid",
|
|
847
|
+
value: function isValid(record, configs) {
|
|
848
|
+
return this.validate(record, configs).size === 0;
|
|
849
|
+
}
|
|
850
|
+
}, {
|
|
851
|
+
key: "isValidFromErrors",
|
|
852
|
+
value: function isValidFromErrors(errors) {
|
|
853
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
854
|
+
return configs.name ? configs.name.some(function (n) {
|
|
855
|
+
return errors.filter(function (error) {
|
|
856
|
+
return Map.isMap(error) && error.get('detail');
|
|
857
|
+
}).flatMap(function (error) {
|
|
858
|
+
return error.getIn(['errors', n]);
|
|
859
|
+
}).filter(function (error) {
|
|
860
|
+
return error;
|
|
861
|
+
}).size > 0;
|
|
862
|
+
}) : !errors || errors.size === 0;
|
|
863
|
+
}
|
|
864
|
+
}, {
|
|
865
|
+
key: "mock",
|
|
866
|
+
value: function mock(faker, index, mockData) {
|
|
867
|
+
var _this2 = this;
|
|
868
|
+
|
|
869
|
+
return _flowRight([function (record) {
|
|
870
|
+
return _this2.toData(record);
|
|
871
|
+
}, function (data) {
|
|
872
|
+
return _this2.dataToRecord(data);
|
|
873
|
+
}, function (fields) {
|
|
874
|
+
return _objectSpread({}, _mapValues(fields, function (field) {
|
|
875
|
+
if (field instanceof EntityField && !field.blank && field.entity.store) {
|
|
876
|
+
return field.many ? _sampleSize(Object.values(field.entity.store)) : _sample(Object.values(field.entity.store));
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
return field.mock && (field.mock === 'index' ? index : _get(faker, field.mock).apply(void 0, _toConsumableArray(field.mockConfigs || [])));
|
|
880
|
+
}), mockData);
|
|
881
|
+
}])(this.fields);
|
|
882
|
+
}
|
|
883
|
+
}, {
|
|
884
|
+
key: "mockMany",
|
|
885
|
+
value: function mockMany(faker) {
|
|
886
|
+
var _this3 = this;
|
|
887
|
+
|
|
888
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
889
|
+
return _keyBy(_range(configs.size).map(function (index) {
|
|
890
|
+
return _this3.mock(faker, index);
|
|
891
|
+
}), this.idField);
|
|
892
|
+
}
|
|
893
|
+
}, {
|
|
894
|
+
key: "toData",
|
|
895
|
+
value: function toData(record) {
|
|
896
|
+
var _this4 = this;
|
|
897
|
+
|
|
898
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
899
|
+
if (record && !Map.isMap(record)) throw new Error("Entity.toData (".concat(this.name, "): record must be either a Map or null or undefined"));
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
var fieldValueToData = function fieldValueToData(value, key) {
|
|
903
|
+
return List.isList(value) ? value.map(function (val) {
|
|
904
|
+
return _this4.fields[key].toData(val, {
|
|
905
|
+
record: record
|
|
906
|
+
});
|
|
907
|
+
}).toArray() : _this4.fields[key].toData(value, {
|
|
908
|
+
record: record
|
|
909
|
+
});
|
|
910
|
+
};
|
|
911
|
+
|
|
912
|
+
return record && record.filter(function (value, key) {
|
|
913
|
+
return key in _this4.fields;
|
|
914
|
+
}).filterNot(function (value, key) {
|
|
915
|
+
return _this4.fields[key].local;
|
|
916
|
+
}).map(fieldValueToData).toObject();
|
|
917
|
+
}
|
|
918
|
+
}, {
|
|
919
|
+
key: "toString",
|
|
920
|
+
value: function toString(record) {
|
|
921
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
922
|
+
if (record && !Map.isMap(record)) throw new Error("Entity.toString (".concat(this.name, "): record must be either a Map or null or undefined"));
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
return record && record.get(this.idField) || '';
|
|
926
|
+
}
|
|
927
|
+
}, {
|
|
928
|
+
key: "validate",
|
|
929
|
+
value: function validate(record) {
|
|
930
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
931
|
+
if (!record) return record;
|
|
932
|
+
var detailErrors = Map(this.fields).filter(function (field, key) {
|
|
933
|
+
return !configs.fields || configs.fields[key];
|
|
934
|
+
}).map(function (field, key) {
|
|
935
|
+
return field.validate(record.get(key), _objectSpread({}, configs, {
|
|
936
|
+
fieldName: key,
|
|
937
|
+
record: record,
|
|
938
|
+
validators: configs.fields && configs.fields[key]
|
|
939
|
+
}));
|
|
940
|
+
}).filterNot(function (errors) {
|
|
941
|
+
return errors.size === 0;
|
|
942
|
+
});
|
|
943
|
+
return detailErrors.size === 0 ? null : Map({
|
|
944
|
+
detail: true,
|
|
945
|
+
message: 'Invalid Entity',
|
|
946
|
+
errors: detailErrors
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
}]);
|
|
950
|
+
|
|
951
|
+
return Entity;
|
|
952
|
+
}();
|
|
953
|
+
|
|
954
|
+
_defineProperty(Entity, "cleaners", []);
|
|
955
|
+
|
|
956
|
+
_defineProperty(Entity, "idField", 'uuid');
|
|
957
|
+
|
|
958
|
+
_defineProperty(Entity, "fields", {
|
|
959
|
+
uuid: new IdField({
|
|
960
|
+
blank: true,
|
|
961
|
+
mock: 'random.uuid'
|
|
962
|
+
})
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
_defineProperty(Entity, "paths", {});
|
|
966
|
+
|
|
967
|
+
var Locale =
|
|
968
|
+
/*#__PURE__*/
|
|
969
|
+
function (_Entity) {
|
|
970
|
+
_inherits(Locale, _Entity);
|
|
971
|
+
|
|
972
|
+
function Locale() {
|
|
973
|
+
_classCallCheck(this, Locale);
|
|
974
|
+
|
|
975
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(Locale).apply(this, arguments));
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
return Locale;
|
|
979
|
+
}(Entity);
|
|
980
|
+
|
|
981
|
+
_defineProperty(Locale, "fields", {
|
|
982
|
+
messages: new AnyField(),
|
|
983
|
+
defaultMessage: new CharField(),
|
|
984
|
+
description: new CharField(),
|
|
985
|
+
id: new CharField(),
|
|
986
|
+
uuid: new IdField({
|
|
987
|
+
mock: 'random.uuid'
|
|
988
|
+
})
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
var Enum =
|
|
992
|
+
/*#__PURE__*/
|
|
993
|
+
function (_Entity) {
|
|
994
|
+
_inherits(Enum, _Entity);
|
|
995
|
+
|
|
996
|
+
function Enum() {
|
|
997
|
+
_classCallCheck(this, Enum);
|
|
998
|
+
|
|
999
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(Enum).apply(this, arguments));
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
_createClass(Enum, null, [{
|
|
1003
|
+
key: "toString",
|
|
1004
|
+
value: function toString(record) {
|
|
1005
|
+
return record && record.get('label') || '';
|
|
1006
|
+
}
|
|
1007
|
+
}]);
|
|
1008
|
+
|
|
1009
|
+
return Enum;
|
|
1010
|
+
}(Entity);
|
|
1011
|
+
|
|
1012
|
+
_defineProperty(Enum, "idField", 'value');
|
|
1013
|
+
|
|
1014
|
+
_defineProperty(Enum, "fields", {
|
|
1015
|
+
disabled: new BooleanField({
|
|
1016
|
+
default: false
|
|
1017
|
+
}),
|
|
1018
|
+
hidden: new BooleanField({
|
|
1019
|
+
default: false
|
|
1020
|
+
}),
|
|
1021
|
+
label: new CharField(),
|
|
1022
|
+
locale: new EntityField({
|
|
1023
|
+
blank: true,
|
|
1024
|
+
entity: Locale
|
|
1025
|
+
}),
|
|
1026
|
+
value: new CharField()
|
|
1027
|
+
});
|
|
1028
|
+
|
|
1029
|
+
var EnumField =
|
|
1030
|
+
/*#__PURE__*/
|
|
1031
|
+
function (_EntityField) {
|
|
1032
|
+
_inherits(EnumField, _EntityField);
|
|
1033
|
+
|
|
1034
|
+
function EnumField() {
|
|
1035
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1036
|
+
|
|
1037
|
+
_classCallCheck(this, EnumField);
|
|
1038
|
+
|
|
1039
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(EnumField).call(this, _objectSpread({
|
|
1040
|
+
entity: Enum,
|
|
1041
|
+
type: 'enum'
|
|
1042
|
+
}, configs)));
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
_createClass(EnumField, [{
|
|
1046
|
+
key: "dataToValue",
|
|
1047
|
+
value: function dataToValue() {
|
|
1048
|
+
var _this = this;
|
|
1049
|
+
|
|
1050
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1051
|
+
return data && this.getOptions().find(function (option) {
|
|
1052
|
+
return _this.entity.getId(option) === data;
|
|
1053
|
+
});
|
|
1054
|
+
}
|
|
1055
|
+
}, {
|
|
1056
|
+
key: "default",
|
|
1057
|
+
value: function _default() {
|
|
1058
|
+
return this.many ? List() : null;
|
|
1059
|
+
}
|
|
1060
|
+
}, {
|
|
1061
|
+
key: "isEnumActive",
|
|
1062
|
+
value: function isEnumActive(value, _ref) {
|
|
1063
|
+
var name = _ref.name;
|
|
1064
|
+
return this.many ? value.some(function (v) {
|
|
1065
|
+
return v.get('value') === name;
|
|
1066
|
+
}) : !!value && value.get('value') === name;
|
|
1067
|
+
}
|
|
1068
|
+
}, {
|
|
1069
|
+
key: "valueToData",
|
|
1070
|
+
value: function valueToData() {
|
|
1071
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1072
|
+
return value && this.entity.getId(value);
|
|
1073
|
+
}
|
|
1074
|
+
}, {
|
|
1075
|
+
key: "valueToParam",
|
|
1076
|
+
value: function valueToParam() {
|
|
1077
|
+
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
1078
|
+
return value === null ? undefined : this.entity.getId(value);
|
|
1079
|
+
}
|
|
1080
|
+
}]);
|
|
1081
|
+
|
|
1082
|
+
return EnumField;
|
|
1083
|
+
}(EntityField);
|
|
1084
|
+
|
|
1085
|
+
var NumberField =
|
|
1086
|
+
/*#__PURE__*/
|
|
1087
|
+
function (_AnyField) {
|
|
1088
|
+
_inherits(NumberField, _AnyField);
|
|
1089
|
+
|
|
1090
|
+
function NumberField() {
|
|
1091
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1092
|
+
|
|
1093
|
+
_classCallCheck(this, NumberField);
|
|
1094
|
+
|
|
1095
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(NumberField).call(this, _objectSpread({
|
|
1096
|
+
type: 'number'
|
|
1097
|
+
}, options)));
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
return NumberField;
|
|
1101
|
+
}(AnyField);
|
|
1102
|
+
|
|
1103
|
+
var IntegerField =
|
|
1104
|
+
/*#__PURE__*/
|
|
1105
|
+
function (_NumberField) {
|
|
1106
|
+
_inherits(IntegerField, _NumberField);
|
|
1107
|
+
|
|
1108
|
+
function IntegerField() {
|
|
1109
|
+
_classCallCheck(this, IntegerField);
|
|
1110
|
+
|
|
1111
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(IntegerField).apply(this, arguments));
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
_createClass(IntegerField, [{
|
|
1115
|
+
key: "dataToValue",
|
|
1116
|
+
value: function dataToValue(data) {
|
|
1117
|
+
var value = parseInt(data, 10);
|
|
1118
|
+
return Number.isNaN(value) ? null : value;
|
|
1119
|
+
}
|
|
1120
|
+
}]);
|
|
1121
|
+
|
|
1122
|
+
return IntegerField;
|
|
1123
|
+
}(NumberField);
|
|
1124
|
+
|
|
1125
|
+
var TextField =
|
|
1126
|
+
/*#__PURE__*/
|
|
1127
|
+
function (_CharField) {
|
|
1128
|
+
_inherits(TextField, _CharField);
|
|
1129
|
+
|
|
1130
|
+
function TextField() {
|
|
1131
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1132
|
+
|
|
1133
|
+
_classCallCheck(this, TextField);
|
|
1134
|
+
|
|
1135
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(TextField).call(this, _objectSpread({
|
|
1136
|
+
type: 'text'
|
|
1137
|
+
}, configs)));
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
return TextField;
|
|
1141
|
+
}(CharField);
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
|
1146
|
+
Field: Field,
|
|
1147
|
+
AnyField: AnyField,
|
|
1148
|
+
BooleanField: BooleanField,
|
|
1149
|
+
CharField: CharField,
|
|
1150
|
+
DateField: DateField,
|
|
1151
|
+
DateTimeField: DateTimeField,
|
|
1152
|
+
EntityField: EntityField,
|
|
1153
|
+
EnumField: EnumField,
|
|
1154
|
+
IdField: IdField,
|
|
1155
|
+
IntegerField: IntegerField,
|
|
1156
|
+
NumberField: NumberField,
|
|
1157
|
+
TextField: TextField
|
|
1158
|
+
});
|
|
1159
|
+
|
|
1160
|
+
var Filter =
|
|
1161
|
+
/*#__PURE__*/
|
|
1162
|
+
function (_Entity) {
|
|
1163
|
+
_inherits(Filter, _Entity);
|
|
1164
|
+
|
|
1165
|
+
function Filter() {
|
|
1166
|
+
_classCallCheck(this, Filter);
|
|
1167
|
+
|
|
1168
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(Filter).apply(this, arguments));
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
_createClass(Filter, null, [{
|
|
1172
|
+
key: "toParams",
|
|
1173
|
+
// NOTE(thierry): returning a map from field.toParams will flatten the output
|
|
1174
|
+
value: function toParams(record) {
|
|
1175
|
+
var _this = this;
|
|
1176
|
+
|
|
1177
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1178
|
+
|
|
1179
|
+
var fieldValueToParams = function fieldValueToParams(value, key) {
|
|
1180
|
+
return List.isList(value) ? value.map(function (val) {
|
|
1181
|
+
return _this.fields[key].toParams(val, _objectSpread({
|
|
1182
|
+
record: record
|
|
1183
|
+
}, options));
|
|
1184
|
+
}).reduce(function (prev, param) {
|
|
1185
|
+
return prev.mergeWith(function (prevParam, nextParam) {
|
|
1186
|
+
return prevParam ? "".concat(prevParam, ",").concat(nextParam) : nextParam;
|
|
1187
|
+
}, Map.isMap(param) ? param : Map(_defineProperty({}, key, param)));
|
|
1188
|
+
}, Map()) : _this.fields[key].toParams(value, _objectSpread({
|
|
1189
|
+
record: record
|
|
1190
|
+
}, options));
|
|
1191
|
+
};
|
|
1192
|
+
|
|
1193
|
+
return record ? record.filter(function (_, key) {
|
|
1194
|
+
return key in _this.fields;
|
|
1195
|
+
}).filterNot(function (_, key) {
|
|
1196
|
+
return _this.fields[key].local;
|
|
1197
|
+
}).filterNot(function (value) {
|
|
1198
|
+
return value === undefined;
|
|
1199
|
+
}).map(fieldValueToParams).flatten() : Map();
|
|
1200
|
+
}
|
|
1201
|
+
}]);
|
|
1202
|
+
|
|
1203
|
+
return Filter;
|
|
1204
|
+
}(Entity);
|
|
1205
|
+
|
|
1206
|
+
_defineProperty(Filter, "fields", {
|
|
1207
|
+
page: new IntegerField({
|
|
1208
|
+
default: 1
|
|
1209
|
+
}),
|
|
1210
|
+
page_size: new IntegerField({
|
|
1211
|
+
default: 20
|
|
1212
|
+
}),
|
|
1213
|
+
uuid: new IdField({
|
|
1214
|
+
blank: true,
|
|
1215
|
+
mock: 'random.uuid'
|
|
1216
|
+
})
|
|
1217
|
+
});
|
|
1218
|
+
|
|
1219
|
+
var Title =
|
|
1220
|
+
/*#__PURE__*/
|
|
1221
|
+
function (_Entity) {
|
|
1222
|
+
_inherits(Title, _Entity);
|
|
1223
|
+
|
|
1224
|
+
function Title() {
|
|
1225
|
+
_classCallCheck(this, Title);
|
|
1226
|
+
|
|
1227
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(Title).apply(this, arguments));
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
_createClass(Title, null, [{
|
|
1231
|
+
key: "actionArchive",
|
|
1232
|
+
value: function actionArchive(record) {
|
|
1233
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1234
|
+
|
|
1235
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1236
|
+
var _ref2;
|
|
1237
|
+
|
|
1238
|
+
if (!((_ref2 = this) != null ? (_ref2 = _ref2.duck) != null ? (_ref2 = _ref2.actions) != null ? _ref2.save : _ref2 : _ref2 : _ref2)) throw new Error("EntityTitle.actionArchive (".concat(this.name, "): \"save\" action is required in duck"));
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
return this.duck.actions.save(record, _objectSpread({
|
|
1242
|
+
action: 'archive',
|
|
1243
|
+
method: 'post'
|
|
1244
|
+
}, configs));
|
|
1245
|
+
}
|
|
1246
|
+
}, {
|
|
1247
|
+
key: "actionArrayDeleteAtIndexOrdered",
|
|
1248
|
+
value: function actionArrayDeleteAtIndexOrdered(records, configs) {
|
|
1249
|
+
return this.actionArrayDeleteAtIndex(records, configs).map(function (record, i) {
|
|
1250
|
+
return record.set('order', i);
|
|
1251
|
+
});
|
|
1252
|
+
}
|
|
1253
|
+
}, {
|
|
1254
|
+
key: "actionArrayMoveAtIndexOrdered",
|
|
1255
|
+
value: function actionArrayMoveAtIndexOrdered(records, configs) {
|
|
1256
|
+
return this.actionArrayMoveAtIndex(records, configs).map(function (record, i) {
|
|
1257
|
+
return record.set('order', i);
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
}, {
|
|
1261
|
+
key: "actionSave",
|
|
1262
|
+
value: function actionSave(record) {
|
|
1263
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1264
|
+
|
|
1265
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1266
|
+
var _ref;
|
|
1267
|
+
|
|
1268
|
+
if (!((_ref = this) != null ? (_ref = _ref.duck) != null ? (_ref = _ref.actions) != null ? _ref.save : _ref : _ref : _ref)) throw new Error("EntityTitle.actionSave (".concat(this.name, "): \"save\" action is required in duck"));
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
return this.duck.actions.save(record, _objectSpread({
|
|
1272
|
+
invalidateList: true
|
|
1273
|
+
}, configs));
|
|
1274
|
+
}
|
|
1275
|
+
}, {
|
|
1276
|
+
key: "toLink",
|
|
1277
|
+
value: function toLink(record) {
|
|
1278
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1279
|
+
var computedParams = (configs.params || Map()).filterNot(function (param) {
|
|
1280
|
+
return param === undefined;
|
|
1281
|
+
});
|
|
1282
|
+
var path = this.getPaths(configs).urlBase;
|
|
1283
|
+
|
|
1284
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1285
|
+
if (!/^\/.*\/$/.test(path)) throw new Error("EntityTitle.toLink (".concat(this.name, "): \"urlBase\" property must start with a \"/\" and end with a \"/\""));
|
|
1286
|
+
if (computedParams.some(function (value) {
|
|
1287
|
+
return !_isString(value);
|
|
1288
|
+
})) throw new Error("EntityTitle.toLink (".concat(this.name, "): every params must be a string or undefined"));
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
return "".concat(path).concat(this.getId(record, configs), "/?").concat(queryString.stringify(computedParams.toJS()));
|
|
1292
|
+
}
|
|
1293
|
+
}, {
|
|
1294
|
+
key: "toString",
|
|
1295
|
+
value: function toString(record) {
|
|
1296
|
+
return record && record.get('title') || '';
|
|
1297
|
+
}
|
|
1298
|
+
}, {
|
|
1299
|
+
key: "toStringOrdered",
|
|
1300
|
+
value: function toStringOrdered(record) {
|
|
1301
|
+
return record ? "".concat(record.get('order') + 1, ". ").concat(this.toString(record)) : '';
|
|
1302
|
+
}
|
|
1303
|
+
}, {
|
|
1304
|
+
key: "toUrl",
|
|
1305
|
+
value: function toUrl(record) {
|
|
1306
|
+
var configs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1307
|
+
var computedParams = (configs.params || Map()).remove('page').remove('page_size').filterNot(function (param) {
|
|
1308
|
+
return param === undefined;
|
|
1309
|
+
});
|
|
1310
|
+
var path = this.getPaths(configs).urlBase;
|
|
1311
|
+
|
|
1312
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1313
|
+
if (!/^\/.*\/$/.test(path)) throw new Error("EntityTitle.toUrl (".concat(this.name, "): \"urlBase\" property must start with a \"/\" and end with a \"/\""));
|
|
1314
|
+
if (computedParams.some(function (param) {
|
|
1315
|
+
return !_isString(param);
|
|
1316
|
+
})) throw new Error("EntityTitle.toUrl (".concat(this.name, "): every params must be a string or undefined"));
|
|
1317
|
+
if (!(configs.settings && configs.settings.BASE_URL)) throw new Error("EntityTitle.toUrl (".concat(this.name, "): \"settings.BASE_URL\" must be set."));
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
return "".concat(configs.settings.BASE_URL).concat(path).concat(this.getId(record, configs), "/?").concat(queryString.stringify(computedParams.toJS()));
|
|
1321
|
+
}
|
|
1322
|
+
}, {
|
|
1323
|
+
key: "toUrlExport",
|
|
1324
|
+
value: function toUrlExport() {
|
|
1325
|
+
var configs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1326
|
+
var computedParams = configs.params ? configs.params.remove('page').remove('page_size').filterNot(function (param) {
|
|
1327
|
+
return param === undefined;
|
|
1328
|
+
}) : Map();
|
|
1329
|
+
var path = this.getPaths(configs).apiBase;
|
|
1330
|
+
|
|
1331
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1332
|
+
if (!/^\/.*\/$/.test(path)) throw new Error("EntityTitle.toUrlExport (".concat(this.name, "): \"apiBase\" property must start with a \"/\" and end with a \"/\""));
|
|
1333
|
+
if (computedParams.some(function (param) {
|
|
1334
|
+
return !_isString(param);
|
|
1335
|
+
})) throw new Error("EntityTitle.toUrlExport (".concat(this.name, "): every params must be a string or undefined"));
|
|
1336
|
+
if (!(configs.settings && configs.settings.BASE_API_URL)) throw new Error("EntityTitle.toUrlExport (".concat(this.name, "): \"settings.BASE_API_URL\" must be set."));
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
return "".concat(configs.settings.BASE_API_URL).concat(path, "?").concat(queryString.stringify(computedParams.toJS()), "&format=xlsx");
|
|
1340
|
+
}
|
|
1341
|
+
}]);
|
|
1342
|
+
|
|
1343
|
+
return Title;
|
|
1344
|
+
}(Entity);
|
|
1345
|
+
|
|
1346
|
+
_defineProperty(Title, "fields", {
|
|
1347
|
+
description: new TextField({
|
|
1348
|
+
blank: true
|
|
1349
|
+
}),
|
|
1350
|
+
is_archived: new BooleanField({
|
|
1351
|
+
default: false
|
|
1352
|
+
}),
|
|
1353
|
+
locale: new EntityField({
|
|
1354
|
+
blank: true,
|
|
1355
|
+
entity: Locale
|
|
1356
|
+
}),
|
|
1357
|
+
order: new IntegerField({
|
|
1358
|
+
mock: 'index'
|
|
1359
|
+
}),
|
|
1360
|
+
title: new CharField({
|
|
1361
|
+
mock: 'lorem.sentence'
|
|
1362
|
+
}),
|
|
1363
|
+
title_short: new CharField({
|
|
1364
|
+
blank: true
|
|
1365
|
+
}),
|
|
1366
|
+
uuid: new IdField({
|
|
1367
|
+
blank: true,
|
|
1368
|
+
mock: 'random.uuid'
|
|
1369
|
+
})
|
|
1370
|
+
});
|
|
1371
|
+
|
|
1372
|
+
_defineProperty(Title, "paths", {
|
|
1373
|
+
urlBase: ''
|
|
1374
|
+
});
|
|
1375
|
+
|
|
1376
|
+
export { index as cleaners, index$1 as validators, index$2 as Fields, Entity, Enum as EntityEnum, Filter as EntityFilter, Locale as EntityLocale, Title as EntityTitle };
|
|
1377
|
+
//# sourceMappingURL=development.js.map
|