@tachybase/plugin-auth-dingtalk 1.6.0 → 1.6.1

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.
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.6.0",
4
- "@ant-design/icons": "5.6.1",
3
+ "@tachybase/client": "1.6.1",
4
+ "@ant-design/icons": "6.1.0",
5
5
  "antd": "5.22.5",
6
6
  "react-router-dom": "6.28.1",
7
- "@tachybase/module-auth": "1.6.0",
8
- "@tego/server": "1.3.52"
7
+ "@tachybase/module-auth": "1.6.1",
8
+ "@tego/server": "1.6.0-alpha.9"
9
9
  };
@@ -1 +1 @@
1
- {"name":"@alicloud/dingtalk","version":"2.2.27","description":"","main":"dist/index.js","scripts":{"test":"mocha --reporter spec --timeout 3000 test/*.test.js","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Alibaba Cloud SDK","license":"Apache-2.0","devDependencies":{"@types/node":"^16.0.0","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^10.0.0","typescript":"^5"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/openapi-client":"^0.4.14","@alicloud/tea-util":"^1.4.9","@alicloud/openapi-util":"^0.3.2","@alicloud/endpoint-util":"^0.0.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/gateway-dingtalk":"^1.0.2"},"files":["dist","src","*.js"],"_lastModified":"2025-11-20T08:12:13.894Z"}
1
+ {"name":"@alicloud/dingtalk","version":"2.2.27","description":"","main":"dist/index.js","scripts":{"test":"mocha --reporter spec --timeout 3000 test/*.test.js","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Alibaba Cloud SDK","license":"Apache-2.0","devDependencies":{"@types/node":"^16.0.0","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^10.0.0","typescript":"^5"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/openapi-client":"^0.4.14","@alicloud/tea-util":"^1.4.9","@alicloud/openapi-util":"^0.3.2","@alicloud/endpoint-util":"^0.0.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/gateway-dingtalk":"^1.0.2"},"files":["dist","src","*.js"],"_lastModified":"2025-12-05T07:13:25.853Z"}
@@ -1 +1 @@
1
- {"name":"@alicloud/openapi-client","version":"0.4.15","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts --timeout=10000","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"","license":"ISC","devDependencies":{"@types/mocha":"^5.2.7","mocha":"^6.2.0","@types/node":"^18.0.0","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^10.0.0","typescript":"^5.6.0","@alicloud/gateway-pop":"0.0.6"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"1.4.9","@alicloud/credentials":"^2.4.2","@alicloud/openapi-util":"^0.3.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/tea-xml":"0.0.3"},"files":["dist","src"],"repository":"git@github.com:aliyun/darabonba-openapi.git","_lastModified":"2025-11-20T08:12:15.431Z"}
1
+ {"name":"@alicloud/openapi-client","version":"0.4.15","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts --timeout=10000","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"","license":"ISC","devDependencies":{"@types/mocha":"^5.2.7","mocha":"^6.2.0","@types/node":"^18.0.0","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^10.0.0","typescript":"^5.6.0","@alicloud/gateway-pop":"0.0.6"},"dependencies":{"@alicloud/tea-typescript":"^1.7.1","@alicloud/tea-util":"1.4.9","@alicloud/credentials":"^2.4.2","@alicloud/openapi-util":"^0.3.2","@alicloud/gateway-spi":"^0.0.8","@alicloud/tea-xml":"0.0.3"},"files":["dist","src"],"repository":"git@github.com:aliyun/darabonba-openapi.git","_lastModified":"2025-12-05T07:13:27.843Z"}
@@ -1 +1 @@
1
- {"name":"@alicloud/tea-util","version":"1.4.10","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Jackson Tian","license":"Apache-2.0","devDependencies":{"@types/mocha":"^7.0.1","@types/node":"^12.12.26","mocha":"^7.0.1","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.1","@darabonba/typescript":"^1.0.0","kitx":"^2.0.0"},"files":["dist","src"],"repository":"git@github.com:aliyun/tea-util.git","_lastModified":"2025-11-20T08:12:17.037Z"}
1
+ {"name":"@alicloud/tea-util","version":"1.4.10","description":"","main":"dist/client.js","scripts":{"test":"mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts","test-cov":"nyc -e .ts -r=html -r=text -r=lcov npm run test","build":"tsc","prepublishOnly":"tsc"},"author":"Jackson Tian","license":"Apache-2.0","devDependencies":{"@types/mocha":"^7.0.1","@types/node":"^12.12.26","mocha":"^7.0.1","nyc":"^15.0.0","source-map-support":"^0.5.16","ts-node":"^8.6.2","typescript":"^3.7.5"},"dependencies":{"@alicloud/tea-typescript":"^1.5.1","@darabonba/typescript":"^1.0.0","kitx":"^2.0.0"},"files":["dist","src"],"repository":"git@github.com:aliyun/tea-util.git","_lastModified":"2025-12-05T07:13:28.886Z"}
@@ -41,7 +41,7 @@ const redirect = async (ctx, next) => {
41
41
  prefix += `apps/${appName}`;
42
42
  }
43
43
  }
44
- const auth = await ctx.app.authManager.get(authenticator, ctx);
44
+ const auth = await ctx.tego.authManager.get(authenticator, ctx);
45
45
  if (prefix.endsWith("/")) {
46
46
  prefix = prefix.slice(0, -1);
47
47
  }
File without changes
@@ -40,8 +40,7 @@ class DingtalkAuth extends import_server.BaseAuth {
40
40
  }
41
41
  const dingtalkClient = new import_dingtalk_client.DingtalkClient({
42
42
  clientId: (_b = (_a = this.options) == null ? void 0 : _a.dingtalk) == null ? void 0 : _b.clientId,
43
- clientSecret: (_c = this.options) == null ? void 0 : _c.clientSecret,
44
- ctx: this.ctx
43
+ clientSecret: (_c = this.options) == null ? void 0 : _c.clientSecret
45
44
  });
46
45
  const accessToken = await dingtalkClient.getAccessToken(authCode);
47
46
  if (!accessToken) {
@@ -81,7 +80,7 @@ class DingtalkAuth extends import_server.BaseAuth {
81
80
  async getAuthUrl(redirect) {
82
81
  var _a, _b;
83
82
  const clientId = (_b = (_a = this.options) == null ? void 0 : _a.dingtalk) == null ? void 0 : _b.clientId;
84
- const app = this.ctx.app.name;
83
+ const app = this.ctx.tego.name;
85
84
  const redirectUrl = encodeURIComponent(
86
85
  `${this.ctx.protocol}://${this.ctx.host}${process.env.API_BASE_PATH}dingtalk:redirect`
87
86
  );
@@ -1,7 +1,9 @@
1
+ import { Context } from '@tego/server';
2
+ import { Config } from '@alicloud/openapi-client';
1
3
  export declare class DingtalkClient {
2
- config: any;
3
- ctx: any;
4
- constructor(config: any);
4
+ config: Config;
5
+ ctx: Context;
6
+ constructor(config: Config);
5
7
  createAuthClient(): any;
6
8
  createContactClient(): any;
7
9
  getAccessToken(code: any): Promise<any>;
@@ -37,7 +37,7 @@ var import_tea_util = __toESM(require("@alicloud/tea-util"));
37
37
  class DingtalkClient {
38
38
  constructor(config) {
39
39
  this.config = config;
40
- this.ctx = config == null ? void 0 : config.ctx;
40
+ this.ctx = config.ctx;
41
41
  }
42
42
  createAuthClient() {
43
43
  const config = new import_openapi_client.Config({});
@@ -52,7 +52,7 @@ class DingtalkClient {
52
52
  return new import_contact_1_0.default(config);
53
53
  }
54
54
  async getAccessToken(code) {
55
- var _a, _b;
55
+ var _a;
56
56
  const client = this.createAuthClient();
57
57
  const getUserTokenRequest = new import_oauth2_1_0.GetUserTokenRequest({
58
58
  clientId: this.config.clientId,
@@ -65,13 +65,12 @@ class DingtalkClient {
65
65
  return ((_a = response == null ? void 0 : response.body) == null ? void 0 : _a.accessToken) || "";
66
66
  } catch (err) {
67
67
  if (!import_tea_util.default.empty(err.code) && !import_tea_util.default.empty(err.message)) {
68
- (_b = this.ctx) == null ? void 0 : _b.log.debug(`DingTalk get accessToken error code:${err.code}, message:${err.message}`);
68
+ this.ctx.logger.warn(`DingTalk get accessToken error code:${err.code}, message:${err.message}`);
69
69
  }
70
70
  return "";
71
71
  }
72
72
  }
73
73
  async getUserInfo(accessToken) {
74
- var _a;
75
74
  const client = this.createContactClient();
76
75
  const getUserHeaders = new import_contact_1_0.GetUserHeaders({});
77
76
  getUserHeaders.xAcsDingtalkAccessToken = accessToken;
@@ -80,7 +79,7 @@ class DingtalkClient {
80
79
  return (response == null ? void 0 : response.body) || {};
81
80
  } catch (err) {
82
81
  if (!import_tea_util.default.empty(err.code) && !import_tea_util.default.empty(err.message)) {
83
- (_a = this.ctx) == null ? void 0 : _a.log.debug(`DingTalk get userInfo error code:${err.code}, message:${err.message}`);
82
+ this.ctx.logger.warn(`DingTalk get userInfo error code:${err.code}, message:${err.message}`);
84
83
  }
85
84
  return {};
86
85
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-auth-dingtalk",
3
3
  "displayName": "Auth: Ding Talk",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "description": "dingding authentication.",
6
6
  "keywords": [
7
7
  "Authentication"
@@ -12,14 +12,14 @@
12
12
  "@alicloud/dingtalk": "^2.2.27",
13
13
  "@alicloud/openapi-client": "0.4.15",
14
14
  "@alicloud/tea-util": "1.4.10",
15
- "@ant-design/icons": "^5.6.1",
16
- "@tachybase/test": "1.3.52",
17
- "@tego/client": "1.3.52",
18
- "@tego/server": "1.3.52",
15
+ "@ant-design/icons": "^6.1.0",
16
+ "@tachybase/test": "1.6.0-alpha.9",
17
+ "@tego/client": "1.6.0-alpha.9",
18
+ "@tego/server": "1.6.0-alpha.9",
19
19
  "antd": "5.22.5",
20
20
  "react-router-dom": "6.28.1",
21
- "@tachybase/client": "1.6.0",
22
- "@tachybase/module-auth": "1.6.0"
21
+ "@tachybase/client": "1.6.1",
22
+ "@tachybase/module-auth": "1.6.1"
23
23
  },
24
24
  "description.zh-CN": "认证:钉钉",
25
25
  "displayName.zh-CN": "认证:钉钉",