@azteam/express 1.2.352 → 1.2.354
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/lib/Server.js +1 -1
- package/lib/controller/AdminController.js +12 -5
- package/package.json +1 -1
- package/src/Server.js +2 -1
- package/src/controller/AdminController.js +24 -12
package/lib/Server.js
CHANGED
|
@@ -207,7 +207,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
207
207
|
var responseGuard = guard;
|
|
208
208
|
var responseAllows = allow;
|
|
209
209
|
if (_lodash["default"].isArray(guard)) {
|
|
210
|
-
responseGuard = [].concat(_toConsumableArray(guard), ['__v', '_id', 'created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', '
|
|
210
|
+
responseGuard = [].concat(_toConsumableArray(guard), ['__v', '_id', 'created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'is_synchronized', 'priority', 'is_indexing']);
|
|
211
211
|
}
|
|
212
212
|
if (resType === RES_TYPE.DOCS) {
|
|
213
213
|
guardData.docs = (0, _util.omitArrayItem)(data.docs, responseGuard, responseAllows);
|
|
@@ -34,7 +34,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
34
34
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
35
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
36
36
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
|
-
var ALLOW_FIELDS = ['created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'priority', '
|
|
37
|
+
var ALLOW_FIELDS = ['created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'priority', 'is_synchronized', 'is_indexing'];
|
|
38
38
|
var AdminController = /*#__PURE__*/function (_Controller) {
|
|
39
39
|
_inherits(AdminController, _Controller);
|
|
40
40
|
var _super = _createSuper(AdminController);
|
|
@@ -303,13 +303,20 @@ var AdminController = /*#__PURE__*/function (_Controller) {
|
|
|
303
303
|
EXPORT: null
|
|
304
304
|
}, options.roles);
|
|
305
305
|
_this.secretKey = options.secretKey || process.env.SECRET_KEY;
|
|
306
|
-
_this.paginateOptions = options.paginateOptions || {
|
|
306
|
+
_this.paginateOptions = options.paginateOptions || {
|
|
307
|
+
autocompleteField: null,
|
|
308
|
+
allowSearchFields: [],
|
|
309
|
+
allowSortFields: []
|
|
310
|
+
};
|
|
307
311
|
_this.guardResponse = options.guardResponse || [];
|
|
308
312
|
_this.allowResponse = options.allowResponse ? [].concat(_toConsumableArray(options.allowResponse), ALLOW_FIELDS) : ALLOW_FIELDS;
|
|
309
|
-
if (
|
|
310
|
-
_this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['
|
|
311
|
-
_this.paginateOptions.allowSortFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSortFields), ['created_at', 'modified_at', 'status']);
|
|
313
|
+
if (options.indexing) {
|
|
314
|
+
_this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['is_indexing']);
|
|
312
315
|
}
|
|
316
|
+
_this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['status', 'created_at_start', 'created_at_end', 'modified_at_start', 'modified_at_end']);
|
|
317
|
+
_this.paginateOptions.allowSortFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSortFields), ['created_at', 'modified_at', 'status'
|
|
318
|
+
//
|
|
319
|
+
]);
|
|
313
320
|
return _this;
|
|
314
321
|
}
|
|
315
322
|
_createClass(AdminController, [{
|
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -17,8 +17,8 @@ const ALLOW_FIELDS = [
|
|
|
17
17
|
'restored_id',
|
|
18
18
|
'resource',
|
|
19
19
|
'priority',
|
|
20
|
-
'is_processing',
|
|
21
20
|
'is_synchronized',
|
|
21
|
+
'is_indexing',
|
|
22
22
|
];
|
|
23
23
|
|
|
24
24
|
class AdminController extends Controller {
|
|
@@ -40,21 +40,33 @@ class AdminController extends Controller {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
this.secretKey = options.secretKey || process.env.SECRET_KEY;
|
|
43
|
-
this.paginateOptions = options.paginateOptions || {
|
|
43
|
+
this.paginateOptions = options.paginateOptions || {
|
|
44
|
+
autocompleteField: null,
|
|
45
|
+
allowSearchFields: [],
|
|
46
|
+
allowSortFields: [],
|
|
47
|
+
};
|
|
44
48
|
this.guardResponse = options.guardResponse || [];
|
|
45
49
|
this.allowResponse = options.allowResponse ? [...options.allowResponse, ...ALLOW_FIELDS] : ALLOW_FIELDS;
|
|
46
50
|
|
|
47
|
-
if (
|
|
48
|
-
this.paginateOptions.allowSearchFields = [
|
|
49
|
-
...this.paginateOptions.allowSearchFields,
|
|
50
|
-
'status',
|
|
51
|
-
'created_at_start',
|
|
52
|
-
'created_at_end',
|
|
53
|
-
'modified_at_start',
|
|
54
|
-
'modified_at_end',
|
|
55
|
-
];
|
|
56
|
-
this.paginateOptions.allowSortFields = [...this.paginateOptions.allowSortFields, 'created_at', 'modified_at', 'status'];
|
|
51
|
+
if (options.indexing) {
|
|
52
|
+
this.paginateOptions.allowSearchFields = [...this.paginateOptions.allowSearchFields, 'is_indexing'];
|
|
57
53
|
}
|
|
54
|
+
|
|
55
|
+
this.paginateOptions.allowSearchFields = [
|
|
56
|
+
...this.paginateOptions.allowSearchFields,
|
|
57
|
+
'status',
|
|
58
|
+
'created_at_start',
|
|
59
|
+
'created_at_end',
|
|
60
|
+
'modified_at_start',
|
|
61
|
+
'modified_at_end',
|
|
62
|
+
];
|
|
63
|
+
this.paginateOptions.allowSortFields = [
|
|
64
|
+
...this.paginateOptions.allowSortFields,
|
|
65
|
+
'created_at',
|
|
66
|
+
'modified_at',
|
|
67
|
+
'status',
|
|
68
|
+
//
|
|
69
|
+
];
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
methodGetPaginate = async (req, res) => {
|