@blocklet/sdk 1.6.27 → 1.6.28

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.
@@ -5,7 +5,7 @@ const { WsClient } = require('@arcblock/ws');
5
5
 
6
6
  const checkBlockletEnv = require('../util/check-blocklet-env');
7
7
  const sendNotification = require('../util/send-notification');
8
- const { AUTH_SERVICE_PREFIX } = require('../util/constants');
8
+ const { SERVICE_PREFIX } = require('../util/constants');
9
9
  const getWallet = require('../wallet');
10
10
 
11
11
  const sendToUser = async (receiver, notification) => {
@@ -28,7 +28,7 @@ const initClient = () => {
28
28
  if (!client) {
29
29
  const wallet = getWallet();
30
30
  const { address: did, publicKey: pk, secretKey: sk } = wallet;
31
- const url = `ws://127.0.0.1:${process.env.ABT_NODE_SERVICE_PORT}${AUTH_SERVICE_PREFIX}`;
31
+ const url = `ws://127.0.0.1:${process.env.ABT_NODE_SERVICE_PORT}${SERVICE_PREFIX}`;
32
32
  const token = Jwt.sign(did, sk, {});
33
33
 
34
34
  client = new WsClient(url, {
@@ -1,3 +1,3 @@
1
1
  module.exports = {
2
- AUTH_SERVICE_PREFIX: '/.service/@abtnode/auth-service',
2
+ SERVICE_PREFIX: '/.well-known/service',
3
3
  };
@@ -5,7 +5,7 @@ const JWT = require('@arcblock/jwt');
5
5
  const { NODE_MODES } = require('@abtnode/constant');
6
6
 
7
7
  const validators = require('../validators');
8
- const { AUTH_SERVICE_PREFIX } = require('./constants');
8
+ const { SERVICE_PREFIX } = require('./constants');
9
9
 
10
10
  const VERSION = require('../../package.json').version; // version of notification sdk
11
11
 
@@ -35,7 +35,7 @@ module.exports = async (
35
35
  const token = JWT.sign(appId, appSk);
36
36
 
37
37
  try {
38
- const { data: res } = await axios.post(`http://127.0.0.1:${port}${AUTH_SERVICE_PREFIX}/api/sendToUser`, {
38
+ const { data: res } = await axios.post(`http://127.0.0.1:${port}${SERVICE_PREFIX}/api/sendToUser`, {
39
39
  apiVersion: VERSION,
40
40
  data: {
41
41
  sender: { did, token, appDid: appId },
@@ -3,7 +3,7 @@ const { WalletAuthenticator: Authenticator } = require('@arcblock/did-auth');
3
3
 
4
4
  const getWallet = require('./wallet');
5
5
  const checkBlockletEnv = require('./util/check-blocklet-env');
6
- const { AUTH_SERVICE_PREFIX } = require('./util/constants');
6
+ const { SERVICE_PREFIX } = require('./util/constants');
7
7
 
8
8
  const env = require('./env');
9
9
 
@@ -43,9 +43,9 @@ class WalletAuthenticator extends Authenticator {
43
43
  description: process.env.BLOCKLET_APP_DESCRIPTION,
44
44
  ...(info || {}),
45
45
  link: appUrl,
46
- icon: joinUrl(baseUrl, AUTH_SERVICE_PREFIX, `/blocklet/logo/${blockletDid}`),
46
+ icon: joinUrl(baseUrl, SERVICE_PREFIX, `/blocklet/logo/${blockletDid}`),
47
47
  updateSubEndpoint: true,
48
- subscriptionEndpoint: joinUrl(groupPathPrefix, AUTH_SERVICE_PREFIX, 'websocket'),
48
+ subscriptionEndpoint: joinUrl(groupPathPrefix, SERVICE_PREFIX, 'websocket'),
49
49
  nodeDid: process.env.ABT_NODE_DID,
50
50
  };
51
51
  },
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.27",
6
+ "version": "1.6.28",
7
7
  "description": "graphql client to read/write data on abt node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,12 +19,12 @@
19
19
  "author": "linchen1987 <linchen.1987@foxmail.com> (http://github.com/linchen1987)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/client": "1.6.27",
23
- "@abtnode/constant": "1.6.27",
22
+ "@abtnode/client": "1.6.28",
23
+ "@abtnode/constant": "1.6.28",
24
24
  "@arcblock/did-auth": "^1.14.19",
25
25
  "@arcblock/jwt": "^1.14.19",
26
26
  "@arcblock/ws": "^1.14.19",
27
- "@blocklet/meta": "1.6.27",
27
+ "@blocklet/meta": "1.6.28",
28
28
  "@nedb/core": "^1.2.2",
29
29
  "@ocap/mcrypto": "^1.14.19",
30
30
  "@ocap/wallet": "^1.14.19",
@@ -39,5 +39,5 @@
39
39
  "detect-port": "^1.3.0",
40
40
  "jest": "^27.4.5"
41
41
  },
42
- "gitHead": "5ec2dbcfa7d9464c0430ea3112e4fe0fbab65414"
42
+ "gitHead": "acef8ea339bd8fc9c785312eb5a1a113ecbf0d4d"
43
43
  }