@azteam/express 1.2.179 → 1.2.182
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.182",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 12.0.0",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"author": "toda <sp.azsolution.net@gmail.com>",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@azteam/crypto": "1.0.
|
|
12
|
+
"@azteam/crypto": "1.0.24",
|
|
13
13
|
"@azteam/error": "1.0.18",
|
|
14
14
|
"@azteam/http-client": "1.0.93",
|
|
15
15
|
"@grpc/grpc-js": "1.6.7",
|
package/src/AdminController.js
CHANGED
|
@@ -190,25 +190,25 @@ class AdminController extends Controller {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
methodPostImportGoogleSheet = async (req, res) => {
|
|
194
194
|
return res.success(true);
|
|
195
195
|
};
|
|
196
|
-
|
|
196
|
+
postImportGoogleSheet() {
|
|
197
197
|
return {
|
|
198
198
|
disabled: !this.roles.CREATE,
|
|
199
|
-
path: '/
|
|
200
|
-
method: [adminRoleMiddleware([this.roles.CREATE]), verifyGoogleAppMiddleware(), this.
|
|
199
|
+
path: '/import_google_sheet',
|
|
200
|
+
method: [adminRoleMiddleware([this.roles.CREATE]), verifyGoogleAppMiddleware(), this.methodPostImportGoogleSheet],
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
|
|
204
|
+
methodPostExportGoogleSheet = async (req, res) => {
|
|
205
205
|
return res.success(true);
|
|
206
206
|
};
|
|
207
|
-
|
|
207
|
+
postExportGoogleSheet() {
|
|
208
208
|
return {
|
|
209
209
|
disabled: !this.roles.READ,
|
|
210
|
-
path: '/
|
|
211
|
-
method: [adminRoleMiddleware([this.roles.READ]), verifyGoogleAppMiddleware(), this.
|
|
210
|
+
path: '/export_google_sheet',
|
|
211
|
+
method: [adminRoleMiddleware([this.roles.READ]), verifyGoogleAppMiddleware(), this.methodPostExportGoogleSheet],
|
|
212
212
|
};
|
|
213
213
|
}
|
|
214
214
|
}
|
|
@@ -3,10 +3,10 @@ import {ErrorException, USER_NOT_VERIFIED} from '@azteam/error';
|
|
|
3
3
|
|
|
4
4
|
export default function () {
|
|
5
5
|
return async function (req, res, next) {
|
|
6
|
-
if (!req.user.
|
|
6
|
+
if (!req.user.google_api_credential) {
|
|
7
7
|
return next(new ErrorException(USER_NOT_VERIFIED));
|
|
8
8
|
}
|
|
9
|
-
req.user.
|
|
9
|
+
req.user.google_api_credential = JSON.parse(decryptAES(req.user.google_api_credential, process.env.SECRET_KEY));
|
|
10
10
|
|
|
11
11
|
return next();
|
|
12
12
|
};
|