@abtnode/core 1.16.29-beta-ec04c755 → 1.16.29-beta-87e06e1c

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.
Files changed (2) hide show
  1. package/lib/api/team.js +2 -28
  2. package/package.json +21 -21
package/lib/api/team.js CHANGED
@@ -2,9 +2,7 @@ const { EventEmitter } = require('events');
2
2
  const pick = require('lodash/pick');
3
3
  const defaults = require('lodash/defaults');
4
4
  const cloneDeep = require('lodash/cloneDeep');
5
- const { joinURL, withQuery, resolveURL, withoutTrailingSlash } = require('ufo');
6
- const axios = require('@abtnode/util/lib/axios');
7
- const pRetry = require('p-retry');
5
+ const { joinURL, withoutTrailingSlash } = require('ufo');
8
6
 
9
7
  const logger = require('@abtnode/logger')('@abtnode/core:api:team');
10
8
  const {
@@ -1331,31 +1329,7 @@ class TeamAPI extends EventEmitter {
1331
1329
  async addStore({ teamDid, url, scope = '' }, context) {
1332
1330
  logger.info('add store', { teamDid, url, scope });
1333
1331
 
1334
- const urlObj = new URL(url);
1335
- const jsonUrl = withQuery(resolveURL(url, '__blocklet__.js'), {
1336
- type: 'json',
1337
- });
1338
- let blockletJson;
1339
- try {
1340
- const blockletFetchResult = await pRetry(
1341
- () =>
1342
- axios.get(jsonUrl, {
1343
- headers: {
1344
- 'Content-Type': 'json',
1345
- },
1346
- }),
1347
- { retries: 3 }
1348
- );
1349
- blockletJson = blockletFetchResult?.data;
1350
- } catch (error) {
1351
- logger.error(`Failed to get Blockelt Store blockletMeta: ${url}`, { error });
1352
- console.error(error);
1353
- throw new Error(`Failed to get Blocklet Store blockletMeta, please check the url's validity: ${url}`);
1354
- }
1355
- const newUrl = withoutTrailingSlash(joinURL(urlObj.origin, blockletJson?.prefix || '/'));
1356
-
1357
- const sanitized = sanitizeUrl(newUrl);
1358
-
1332
+ const sanitized = withoutTrailingSlash(await StoreUtil.getStoreUrl(url));
1359
1333
  const storeList = await this.teamManager.getStoreList(teamDid);
1360
1334
  const did = context?.user?.did;
1361
1335
  const exist = storeList.find((x) => {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.29-beta-ec04c755",
6
+ "version": "1.16.29-beta-87e06e1c",
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.29-beta-ec04c755",
23
- "@abtnode/auth": "1.16.29-beta-ec04c755",
24
- "@abtnode/certificate-manager": "1.16.29-beta-ec04c755",
25
- "@abtnode/constant": "1.16.29-beta-ec04c755",
26
- "@abtnode/cron": "1.16.29-beta-ec04c755",
27
- "@abtnode/logger": "1.16.29-beta-ec04c755",
28
- "@abtnode/models": "1.16.29-beta-ec04c755",
29
- "@abtnode/queue": "1.16.29-beta-ec04c755",
30
- "@abtnode/rbac": "1.16.29-beta-ec04c755",
31
- "@abtnode/router-provider": "1.16.29-beta-ec04c755",
32
- "@abtnode/static-server": "1.16.29-beta-ec04c755",
33
- "@abtnode/timemachine": "1.16.29-beta-ec04c755",
34
- "@abtnode/util": "1.16.29-beta-ec04c755",
22
+ "@abtnode/analytics": "1.16.29-beta-87e06e1c",
23
+ "@abtnode/auth": "1.16.29-beta-87e06e1c",
24
+ "@abtnode/certificate-manager": "1.16.29-beta-87e06e1c",
25
+ "@abtnode/constant": "1.16.29-beta-87e06e1c",
26
+ "@abtnode/cron": "1.16.29-beta-87e06e1c",
27
+ "@abtnode/logger": "1.16.29-beta-87e06e1c",
28
+ "@abtnode/models": "1.16.29-beta-87e06e1c",
29
+ "@abtnode/queue": "1.16.29-beta-87e06e1c",
30
+ "@abtnode/rbac": "1.16.29-beta-87e06e1c",
31
+ "@abtnode/router-provider": "1.16.29-beta-87e06e1c",
32
+ "@abtnode/static-server": "1.16.29-beta-87e06e1c",
33
+ "@abtnode/timemachine": "1.16.29-beta-87e06e1c",
34
+ "@abtnode/util": "1.16.29-beta-87e06e1c",
35
35
  "@arcblock/did": "1.18.126",
36
36
  "@arcblock/did-auth": "1.18.126",
37
37
  "@arcblock/did-ext": "^1.18.126",
@@ -42,12 +42,12 @@
42
42
  "@arcblock/pm2-events": "^0.0.5",
43
43
  "@arcblock/validator": "^1.18.126",
44
44
  "@arcblock/vc": "1.18.126",
45
- "@blocklet/constant": "1.16.29-beta-ec04c755",
46
- "@blocklet/env": "1.16.29-beta-ec04c755",
47
- "@blocklet/meta": "1.16.29-beta-ec04c755",
48
- "@blocklet/resolver": "1.16.29-beta-ec04c755",
49
- "@blocklet/sdk": "1.16.29-beta-ec04c755",
50
- "@blocklet/store": "1.16.29-beta-ec04c755",
45
+ "@blocklet/constant": "1.16.29-beta-87e06e1c",
46
+ "@blocklet/env": "1.16.29-beta-87e06e1c",
47
+ "@blocklet/meta": "1.16.29-beta-87e06e1c",
48
+ "@blocklet/resolver": "1.16.29-beta-87e06e1c",
49
+ "@blocklet/sdk": "1.16.29-beta-87e06e1c",
50
+ "@blocklet/store": "1.16.29-beta-87e06e1c",
51
51
  "@did-space/client": "^0.5.4",
52
52
  "@fidm/x509": "^1.2.1",
53
53
  "@ocap/mcrypto": "1.18.126",
@@ -103,5 +103,5 @@
103
103
  "jest": "^29.7.0",
104
104
  "unzipper": "^0.10.11"
105
105
  },
106
- "gitHead": "8f3fcaf73830289f02dd86e8d22a2c86a79a34d8"
106
+ "gitHead": "e6a32801bc392566448d4df00c2ae68717f39822"
107
107
  }