@azteam/express 1.2.352 → 1.2.353

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 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', 'is_processing', 'is_synchronized', 'priority']);
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', 'is_processing', 'is_synchronized'];
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 (_this.paginateOptions) {
310
- _this.paginateOptions.allowSearchFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSearchFields), ['status', 'created_at_start', 'created_at_end', 'modified_at_start', 'modified_at_end']);
311
- _this.paginateOptions.allowSortFields = [].concat(_toConsumableArray(_this.paginateOptions.allowSortFields), ['created_at', 'modified_at', 'status']);
313
+ if (options.isMetadata) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.352",
3
+ "version": "1.2.353",
4
4
  "license": "MIT",
5
5
  "author": "toda <sp.azsolution.net@gmail.com>",
6
6
  "main": "./lib/index.js",
package/src/Server.js CHANGED
@@ -190,9 +190,10 @@ class Server {
190
190
  'restored_id',
191
191
 
192
192
  'resource',
193
- 'is_processing',
194
193
  'is_synchronized',
195
194
  'priority',
195
+
196
+ 'is_indexing',
196
197
  ];
197
198
  }
198
199
  if (resType === RES_TYPE.DOCS) {
@@ -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,36 @@ 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 (this.paginateOptions) {
51
+ if (options.isMetadata) {
48
52
  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'];
53
+ ...this.paginateOptions.allowSearchFields,
54
+ 'is_indexing'
55
+ ]
57
56
  }
57
+
58
+ this.paginateOptions.allowSearchFields = [
59
+ ...this.paginateOptions.allowSearchFields,
60
+ 'status',
61
+ 'created_at_start',
62
+ 'created_at_end',
63
+ 'modified_at_start',
64
+ 'modified_at_end',
65
+ ];
66
+ this.paginateOptions.allowSortFields = [
67
+ ...this.paginateOptions.allowSortFields,
68
+ 'created_at',
69
+ 'modified_at',
70
+ 'status',
71
+ //
72
+ ];
58
73
  }
59
74
 
60
75
  methodGetPaginate = async (req, res) => {