@digione/node-custom-api 0.2.0-beta10 → 0.2.0-beta11

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.
@@ -31,6 +31,7 @@ const verifyAccessToken = (req, res, next) => tslib_1.__awaiter(void 0, void 0,
31
31
  }
32
32
  res.locals.auth_id = data.id;
33
33
  let setting = JSON.parse(tokenData['setting']);
34
+ res.locals.setting = setting;
34
35
  res.locals.group_id = setting['group_id'];
35
36
  res.locals.related_id = setting['organ_id'];
36
37
  if (setting['b2b_group_id']) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digione/node-custom-api",
3
- "version": "0.2.0-beta10",
3
+ "version": "0.2.0-beta11",
4
4
  "description": "Typescript node digione-api",
5
5
  "author": "Monchai Jirayupong <monchai.j@seven.co.th>",
6
6
  "license": "MIT",
package/utils/auth.d.ts CHANGED
@@ -15,7 +15,9 @@ export declare class AuthUtil {
15
15
  success: number;
16
16
  token: any;
17
17
  }>;
18
- refreshAccessTokenByToken(token: any): Promise<{
18
+ refreshAccessTokenByToken(token: any, { attributes_include }?: {
19
+ attributes_include?: any[];
20
+ }): Promise<{
19
21
  access_token: string;
20
22
  }>;
21
23
  signNotificationTokenByToken(token: any, input?: any): Promise<{
package/utils/auth.js CHANGED
@@ -75,7 +75,7 @@ class AuthUtil {
75
75
  }
76
76
  });
77
77
  }
78
- refreshAccessTokenByToken(token) {
78
+ refreshAccessTokenByToken(token, { attributes_include = [] } = {}) {
79
79
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
80
  try {
81
81
  const tokenData = yield (0, helper_1.getTokenDataFromTokenBySecret)(token, (0, helper_1.getENV)('JWT_SECRET'));
@@ -84,7 +84,7 @@ class AuthUtil {
84
84
  yield access_token_1.AccessTokenModel.schema(this.ref, "_").destroy({
85
85
  where: { refresh_token_id: refreshTokenId }
86
86
  });
87
- let include_access = {}, attributes = (this.ref == 'core') ? ['group_id'] : ['organ_id', 'group_id', 'b2b_group_id', 'team_id'];
87
+ let include_access = {}, attributes = (this.ref == 'core') ? ['group_id'] : ['organ_id', 'group_id', 'b2b_group_id', 'team_id'].concat(attributes_include);
88
88
  let refresh = yield refresh_token_1.RefreshTokenModel.schema(this.ref, "_").findOne({
89
89
  where: { id: refreshTokenId }, attributes, raw: true
90
90
  });
package/utils/file.js CHANGED
@@ -595,6 +595,8 @@ class FileUtil {
595
595
  case "shtml":
596
596
  case "svg":
597
597
  case "rar":
598
+ case "kml":
599
+ case "shp":
598
600
  type = 'o';
599
601
  break;
600
602
  }