@azteam/express 1.2.182 → 1.2.185
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azteam/express",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.185",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 12.0.0",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@azteam/crypto": "1.0.24",
|
|
13
|
-
"@azteam/error": "1.0.
|
|
13
|
+
"@azteam/error": "1.0.19",
|
|
14
14
|
"@azteam/http-client": "1.0.93",
|
|
15
15
|
"@grpc/grpc-js": "1.6.7",
|
|
16
16
|
"@grpc/proto-loader": "0.6.12",
|
package/src/AdminController.js
CHANGED
|
@@ -190,25 +190,27 @@ class AdminController extends Controller {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
methodPostImportSpreadsheet = async (req, res) => {
|
|
194
194
|
return res.success(true);
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
|
|
197
|
+
postImportSpreadsheet() {
|
|
197
198
|
return {
|
|
198
199
|
disabled: !this.roles.CREATE,
|
|
199
|
-
path: '/
|
|
200
|
-
method: [adminRoleMiddleware([this.roles.CREATE]), verifyGoogleAppMiddleware(), this.
|
|
200
|
+
path: '/import_spreadsheet',
|
|
201
|
+
method: [adminRoleMiddleware([this.roles.CREATE]), verifyGoogleAppMiddleware(), this.methodPostImportSpreadsheet],
|
|
201
202
|
};
|
|
202
203
|
}
|
|
203
204
|
|
|
204
|
-
|
|
205
|
+
methodPostExportSpreadsheet = async (req, res) => {
|
|
205
206
|
return res.success(true);
|
|
206
207
|
};
|
|
207
|
-
|
|
208
|
+
|
|
209
|
+
postExportSpreadsheet() {
|
|
208
210
|
return {
|
|
209
211
|
disabled: !this.roles.READ,
|
|
210
|
-
path: '/
|
|
211
|
-
method: [adminRoleMiddleware([this.roles.READ]), verifyGoogleAppMiddleware(), this.
|
|
212
|
+
path: '/export_spreadsheet',
|
|
213
|
+
method: [adminRoleMiddleware([this.roles.READ]), verifyGoogleAppMiddleware(), this.methodPostExportSpreadsheet],
|
|
212
214
|
};
|
|
213
215
|
}
|
|
214
216
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {decryptAES} from '@azteam/crypto';
|
|
2
|
-
import {ErrorException,
|
|
2
|
+
import {ErrorException, CREDENTIAL_FAILED} from '@azteam/error';
|
|
3
3
|
|
|
4
4
|
export default function () {
|
|
5
5
|
return async function (req, res, next) {
|
|
6
6
|
if (!req.user.google_api_credential) {
|
|
7
|
-
return next(new ErrorException(
|
|
7
|
+
return next(new ErrorException(CREDENTIAL_FAILED));
|
|
8
8
|
}
|
|
9
9
|
req.user.google_api_credential = JSON.parse(decryptAES(req.user.google_api_credential, process.env.SECRET_KEY));
|
|
10
|
-
|
|
11
10
|
return next();
|
|
12
11
|
};
|
|
13
12
|
}
|