@azteam/express 1.2.405 → 1.2.407
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_synchronized', 'priority', 'is_indexing']);
|
|
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', 'status', 'message']);
|
|
211
211
|
}
|
|
212
212
|
if (resType === RES_TYPE.DOCS) {
|
|
213
213
|
guardData.docs = (0, _util.omitArrayItem)(data.docs, responseGuard, responseAllows);
|
|
@@ -249,6 +249,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
249
249
|
delete res.cache;
|
|
250
250
|
var origin = req.get('Origin');
|
|
251
251
|
req.rootOrigin = origin ? _psl["default"].parse(origin.replace(/(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*\/\//, '')).domain : null;
|
|
252
|
+
req.domain = req.hostname ? _psl["default"].parse(req.hostname).domain : null;
|
|
252
253
|
req.trackDevice = {
|
|
253
254
|
ip: req.ip,
|
|
254
255
|
forward_ip: req.headers['X-Forwarded-For'],
|
|
@@ -314,6 +315,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
314
315
|
case 0:
|
|
315
316
|
return _context3.abrupt("return", res.success(_objectSpread(_objectSpread({}, req.trackDevice), {}, {
|
|
316
317
|
host: req.hostname,
|
|
318
|
+
domain: req.domain,
|
|
317
319
|
origin: req.rootOrigin
|
|
318
320
|
})));
|
|
319
321
|
case 1:
|
|
@@ -36,7 +36,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
36
36
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
37
37
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
38
38
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
39
|
-
var ALLOW_FIELDS = ['created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'priority', 'is_synchronized', 'is_indexing'];
|
|
39
|
+
var ALLOW_FIELDS = ['created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'priority', 'is_synchronized', 'is_indexing', 'status', 'message'];
|
|
40
40
|
var AdminController = /*#__PURE__*/function (_Controller) {
|
|
41
41
|
_inherits(AdminController, _Controller);
|
|
42
42
|
var _super = _createSuper(AdminController);
|
package/package.json
CHANGED
package/src/Server.js
CHANGED
|
@@ -186,6 +186,8 @@ class Server {
|
|
|
186
186
|
'priority',
|
|
187
187
|
|
|
188
188
|
'is_indexing',
|
|
189
|
+
'status',
|
|
190
|
+
'message',
|
|
189
191
|
];
|
|
190
192
|
}
|
|
191
193
|
if (resType === RES_TYPE.DOCS) {
|
|
@@ -234,6 +236,7 @@ class Server {
|
|
|
234
236
|
|
|
235
237
|
const origin = req.get('Origin');
|
|
236
238
|
req.rootOrigin = origin ? psl.parse(origin.replace(/.*\/\//u, '')).domain : null;
|
|
239
|
+
req.domain = req.hostname ? psl.parse(req.hostname).domain : null;
|
|
237
240
|
|
|
238
241
|
req.trackDevice = {
|
|
239
242
|
ip: req.ip,
|
|
@@ -287,6 +290,7 @@ class Server {
|
|
|
287
290
|
return res.success({
|
|
288
291
|
...req.trackDevice,
|
|
289
292
|
host: req.hostname,
|
|
293
|
+
domain: req.domain,
|
|
290
294
|
origin: req.rootOrigin,
|
|
291
295
|
});
|
|
292
296
|
});
|