@abtnode/core 1.16.13-beta-2eb54cbc → 1.16.13-beta-286a5279

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.
@@ -25,6 +25,7 @@ const { BaseRestore } = require('./base');
25
25
  const { BlockletExtrasRestore } = require('./blocklet-extras');
26
26
  const { BlockletRestore } = require('./blocklet');
27
27
  const { BlockletsRestore } = require('./blocklets');
28
+ const states = require('../../../states');
28
29
 
29
30
  class SpacesRestore extends BaseRestore {
30
31
  /**
@@ -105,6 +106,11 @@ class SpacesRestore extends BaseRestore {
105
106
 
106
107
  async syncFromSpaces() {
107
108
  const { endpoint, wallet, delegation } = this.input;
109
+ /**
110
+ * @type {import('@abtnode/client').NodeState}
111
+ */
112
+ const node = await states.node.read();
113
+ const serverDid = node.did;
108
114
 
109
115
  const spaceClient = new SpaceClient({
110
116
  endpoint,
@@ -131,6 +137,7 @@ class SpacesRestore extends BaseRestore {
131
137
 
132
138
  userDid: this.input.userDid,
133
139
  referrer: this.input.referrer,
140
+ serverDid,
134
141
  })
135
142
  );
136
143
 
@@ -63,7 +63,9 @@ async function getSpaceNameByEndpoint(endpoint, defaultValue = '') {
63
63
  timeout: 3000,
64
64
  });
65
65
 
66
- return headers['x-space-name'] ?? defaultValue;
66
+ const spaceName = headers['x-space-name'];
67
+
68
+ return spaceName ? decodeURIComponent(spaceName) : defaultValue;
67
69
  } catch (error) {
68
70
  console.error(error);
69
71
  return defaultValue;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.13-beta-2eb54cbc",
6
+ "version": "1.16.13-beta-286a5279",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,19 +19,19 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "Apache-2.0",
21
21
  "dependencies": {
22
- "@abtnode/analytics": "1.16.13-beta-2eb54cbc",
23
- "@abtnode/auth": "1.16.13-beta-2eb54cbc",
24
- "@abtnode/certificate-manager": "1.16.13-beta-2eb54cbc",
25
- "@abtnode/constant": "1.16.13-beta-2eb54cbc",
26
- "@abtnode/cron": "1.16.13-beta-2eb54cbc",
27
- "@abtnode/logger": "1.16.13-beta-2eb54cbc",
28
- "@abtnode/models": "1.16.13-beta-2eb54cbc",
29
- "@abtnode/queue": "1.16.13-beta-2eb54cbc",
30
- "@abtnode/rbac": "1.16.13-beta-2eb54cbc",
31
- "@abtnode/router-provider": "1.16.13-beta-2eb54cbc",
32
- "@abtnode/static-server": "1.16.13-beta-2eb54cbc",
33
- "@abtnode/timemachine": "1.16.13-beta-2eb54cbc",
34
- "@abtnode/util": "1.16.13-beta-2eb54cbc",
22
+ "@abtnode/analytics": "1.16.13-beta-286a5279",
23
+ "@abtnode/auth": "1.16.13-beta-286a5279",
24
+ "@abtnode/certificate-manager": "1.16.13-beta-286a5279",
25
+ "@abtnode/constant": "1.16.13-beta-286a5279",
26
+ "@abtnode/cron": "1.16.13-beta-286a5279",
27
+ "@abtnode/logger": "1.16.13-beta-286a5279",
28
+ "@abtnode/models": "1.16.13-beta-286a5279",
29
+ "@abtnode/queue": "1.16.13-beta-286a5279",
30
+ "@abtnode/rbac": "1.16.13-beta-286a5279",
31
+ "@abtnode/router-provider": "1.16.13-beta-286a5279",
32
+ "@abtnode/static-server": "1.16.13-beta-286a5279",
33
+ "@abtnode/timemachine": "1.16.13-beta-286a5279",
34
+ "@abtnode/util": "1.16.13-beta-286a5279",
35
35
  "@arcblock/did": "1.18.84",
36
36
  "@arcblock/did-auth": "1.18.84",
37
37
  "@arcblock/did-ext": "^1.18.84",
@@ -42,11 +42,11 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.84",
44
44
  "@arcblock/vc": "1.18.84",
45
- "@blocklet/constant": "1.16.13-beta-2eb54cbc",
46
- "@blocklet/meta": "1.16.13-beta-2eb54cbc",
47
- "@blocklet/resolver": "1.16.13-beta-2eb54cbc",
48
- "@blocklet/sdk": "1.16.13-beta-2eb54cbc",
49
- "@did-space/client": "^0.2.117",
45
+ "@blocklet/constant": "1.16.13-beta-286a5279",
46
+ "@blocklet/meta": "1.16.13-beta-286a5279",
47
+ "@blocklet/resolver": "1.16.13-beta-286a5279",
48
+ "@blocklet/sdk": "1.16.13-beta-286a5279",
49
+ "@did-space/client": "^0.2.124",
50
50
  "@fidm/x509": "^1.2.1",
51
51
  "@ocap/mcrypto": "1.18.84",
52
52
  "@ocap/util": "1.18.84",
@@ -96,5 +96,5 @@
96
96
  "express": "^4.18.2",
97
97
  "jest": "^27.5.1"
98
98
  },
99
- "gitHead": "7adf96c2eb31762d8eb14b8121fce9865d6a458c"
99
+ "gitHead": "ec55ab36a39e60fa7afc0773c79eb3bae0b93847"
100
100
  }