@blocklet/sdk 1.16.34-beta-20241204-140321-4d75ca21 → 1.16.34-beta-20241205-145120-3a7aa096

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.
@@ -157,7 +157,7 @@ class AuthService {
157
157
  });
158
158
  this.login = async (data) => {
159
159
  try {
160
- const { data: resData } = await service_api_1.default.post('/user/login', data);
160
+ const { data: resData } = await service_api_1.default.post('/api/user/login', data);
161
161
  if (resData?.user) {
162
162
  fixAvatar(resData.user);
163
163
  }
@@ -1,2 +1,3 @@
1
- declare const componentApi: import("axios").AxiosInstance;
1
+ import axios from 'axios';
2
+ declare const componentApi: axios.AxiosInstance;
2
3
  export default componentApi;
@@ -2,5 +2,6 @@
2
2
  * 用于在 SDK 中向 blocklet-service 发起 http 请求
3
3
  * 该封装中,会在请求的 header 中增加签名信息,确保安全性(签名信息的验证由 blocklet-service 的接口去做验证)
4
4
  */
5
- declare const axios: import("axios").AxiosInstance;
5
+ import Axios from 'axios';
6
+ declare const axios: Axios.AxiosInstance;
6
7
  export default axios;
@@ -13,6 +13,8 @@ type SignType = 'component' | 'blocklet';
13
13
  declare const getVerifyData: (req: Request, type?: SignType) => {
14
14
  sig: string;
15
15
  data: object;
16
+ sigVersion: string;
17
+ sigPk: string;
16
18
  };
17
19
  type SignSeed = {
18
20
  body?: any;
@@ -27,7 +29,6 @@ declare const getSignData: ({ data, params, method, url, }: {
27
29
  params: object;
28
30
  method: string;
29
31
  url: string;
30
- raw?: SignSeed;
31
32
  }, signOptions?: object) => {
32
33
  sig: string;
33
34
  iat: number;
@@ -102,6 +102,7 @@ const getLegacyFn = ({ body, query, type = 'component' }) => {
102
102
  };
103
103
  const getVerifyData = (req, type = 'component') => {
104
104
  const sig = req.get(`x-${type}-sig`);
105
+ const sigPk = req.get(`x-${type}-sig-pk`);
105
106
  const sigVersion = req.get(`x-${type}-sig-version`) || constant_1.SIG_VERSION.V0;
106
107
  const iat = Number(req.get(`x-${type}-sig-iat`));
107
108
  const exp = Number(req.get(`x-${type}-sig-exp`));
@@ -111,7 +112,7 @@ const getVerifyData = (req, type = 'component') => {
111
112
  const data = semver_1.default.gt(semver_1.default.coerce(sigVersion), semver_1.default.coerce(constant_1.SIG_VERSION.V0))
112
113
  ? getLatestFn({ iat, exp, body, query, method, url })
113
114
  : getLegacyFn({ body, query, type });
114
- return { sig, data };
115
+ return { sig, data, sigVersion, sigPk };
115
116
  };
116
117
  exports.getVerifyData = getVerifyData;
117
118
  const getSignData = ({ data, params, method, url, }, signOptions) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.34-beta-20241204-140321-4d75ca21",
6
+ "version": "1.16.34-beta-20241205-145120-3a7aa096",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "typings": "lib/index.d.ts",
@@ -27,16 +27,16 @@
27
27
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@abtnode/client": "1.16.34-beta-20241204-140321-4d75ca21",
31
- "@abtnode/constant": "1.16.34-beta-20241204-140321-4d75ca21",
32
- "@abtnode/util": "1.16.34-beta-20241204-140321-4d75ca21",
30
+ "@abtnode/client": "1.16.34-beta-20241205-145120-3a7aa096",
31
+ "@abtnode/constant": "1.16.34-beta-20241205-145120-3a7aa096",
32
+ "@abtnode/util": "1.16.34-beta-20241205-145120-3a7aa096",
33
33
  "@arcblock/did": "1.18.153",
34
34
  "@arcblock/did-auth": "1.18.153",
35
35
  "@arcblock/jwt": "1.18.153",
36
36
  "@arcblock/ws": "1.18.153",
37
- "@blocklet/constant": "1.16.34-beta-20241204-140321-4d75ca21",
38
- "@blocklet/env": "1.16.34-beta-20241204-140321-4d75ca21",
39
- "@blocklet/meta": "1.16.34-beta-20241204-140321-4d75ca21",
37
+ "@blocklet/constant": "1.16.34-beta-20241205-145120-3a7aa096",
38
+ "@blocklet/env": "1.16.34-beta-20241205-145120-3a7aa096",
39
+ "@blocklet/meta": "1.16.34-beta-20241205-145120-3a7aa096",
40
40
  "@did-connect/authenticator": "^2.2.4",
41
41
  "@did-connect/handler": "^2.2.4",
42
42
  "@nedb/core": "^2.1.5",
@@ -80,5 +80,5 @@
80
80
  "ts-node": "^10.9.1",
81
81
  "typescript": "^5.6.3"
82
82
  },
83
- "gitHead": "85435dd99298c727eb7bb6c361f9dee6ef11cf08"
83
+ "gitHead": "1162a42e8d2c5ed0330a51724685b2d554c50160"
84
84
  }