@azteam/express 1.2.404 → 1.2.406
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 -2
- package/lib/controller/AdminController.js +1 -1
- package/package.json +1 -1
- package/src/Server.js +3 -2
- package/src/controller/AdminController.js +2 -0
- package/template/sitemap/count.ejs +0 -9
- package/template/sitemap/home.ejs +0 -7
- package/template/sitemap/index.ejs +0 -13
- package/template/sitemap/list.ejs +0 -22
package/lib/Server.js
CHANGED
|
@@ -13,7 +13,6 @@ var _helmet = _interopRequireDefault(require("helmet"));
|
|
|
13
13
|
var _methodOverride = _interopRequireDefault(require("method-override"));
|
|
14
14
|
var _bodyParser = _interopRequireDefault(require("body-parser"));
|
|
15
15
|
var _cookieParser = _interopRequireDefault(require("cookie-parser"));
|
|
16
|
-
var _uaParserJs = _interopRequireDefault(require("ua-parser-js"));
|
|
17
16
|
var _morgan = _interopRequireDefault(require("morgan"));
|
|
18
17
|
var _cors = _interopRequireDefault(require("cors"));
|
|
19
18
|
var _psl = _interopRequireDefault(require("psl"));
|
|
@@ -208,7 +207,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
208
207
|
var responseGuard = guard;
|
|
209
208
|
var responseAllows = allow;
|
|
210
209
|
if (_lodash["default"].isArray(guard)) {
|
|
211
|
-
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']);
|
|
212
211
|
}
|
|
213
212
|
if (resType === RES_TYPE.DOCS) {
|
|
214
213
|
guardData.docs = (0, _util.omitArrayItem)(data.docs, responseGuard, responseAllows);
|
|
@@ -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
|
@@ -7,7 +7,6 @@ import helmet from 'helmet';
|
|
|
7
7
|
import methodOverride from 'method-override';
|
|
8
8
|
import bodyParser from 'body-parser';
|
|
9
9
|
import cookieParser from 'cookie-parser';
|
|
10
|
-
import UAParser from 'ua-parser-js';
|
|
11
10
|
import morgan from 'morgan';
|
|
12
11
|
import cors from 'cors';
|
|
13
12
|
import psl from 'psl';
|
|
@@ -15,7 +14,7 @@ import ejs from 'ejs';
|
|
|
15
14
|
import compression from 'compression';
|
|
16
15
|
import 'express-async-errors';
|
|
17
16
|
import {CORS, errorCatch, ErrorException, NOT_FOUND, UNKNOWN} from '@azteam/error';
|
|
18
|
-
import {
|
|
17
|
+
import {omitArrayItem, omitItem} from '@azteam/util';
|
|
19
18
|
|
|
20
19
|
const RES_TYPE = {
|
|
21
20
|
ARRAY: 'ARRAY',
|
|
@@ -187,6 +186,8 @@ class Server {
|
|
|
187
186
|
'priority',
|
|
188
187
|
|
|
189
188
|
'is_indexing',
|
|
189
|
+
'status',
|
|
190
|
+
'message',
|
|
190
191
|
];
|
|
191
192
|
}
|
|
192
193
|
if (resType === RES_TYPE.DOCS) {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
3
|
-
<% for(var i = 0; i < total; i++) { %>
|
|
4
|
-
<sitemap>
|
|
5
|
-
<loc><%= 'https://' + domain + '/sitemap-' + name + '-' + (i + 1) + '.xml'; %></loc>
|
|
6
|
-
<lastmod><%= new Date().toISOString().split('T')[0]; %></lastmod>
|
|
7
|
-
</sitemap>
|
|
8
|
-
<% } %>
|
|
9
|
-
</sitemapindex>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
3
|
-
<sitemap>
|
|
4
|
-
<loc><%= 'https://' + domain + '/sitemap-home.xml'; %></loc>
|
|
5
|
-
</sitemap>
|
|
6
|
-
|
|
7
|
-
<% listIndex.forEach(function (item) { %>
|
|
8
|
-
<sitemap>
|
|
9
|
-
<loc><%= 'https://' + domain + '/sitemap-' + item + '.xml'; %></loc>
|
|
10
|
-
<lastmod><%= new Date().toISOString().split('T')[0]; %></lastmod>
|
|
11
|
-
</sitemap>
|
|
12
|
-
<% }); %>
|
|
13
|
-
</sitemapindex>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
|
3
|
-
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
|
4
|
-
<% data.forEach(function (item) { %>
|
|
5
|
-
<% if (item) { %>
|
|
6
|
-
<url>
|
|
7
|
-
<loc><%= "https://" + domain + item.path; %></loc>
|
|
8
|
-
<% if (item.thumb) { %>
|
|
9
|
-
<image:image>
|
|
10
|
-
<image:loc><%= item.thumb %></image:loc>
|
|
11
|
-
</image:image>
|
|
12
|
-
<% } %>
|
|
13
|
-
|
|
14
|
-
<% if (item.modified_at) { %>
|
|
15
|
-
<lastmod><%= new Date(item.modified_at * 1000).toISOString().split('T')[0]; %></lastmod>
|
|
16
|
-
<% } else { %>
|
|
17
|
-
<lastmod><%= new Date().toISOString().split('T')[0]; %></lastmod>
|
|
18
|
-
<% } %>
|
|
19
|
-
</url>
|
|
20
|
-
<% } %>
|
|
21
|
-
<% }); %>
|
|
22
|
-
</urlset>
|