@abtnode/core 1.16.29-beta-e04c6f40 → 1.16.29-beta-db5c4ed6
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.
- package/lib/api/team.js +63 -27
- package/lib/blocklet/manager/disk.js +4 -4
- package/lib/blocklet/manager/helper/install-component-from-url.js +1 -1
- package/lib/blocklet/project/connect-by-studio.js +4 -0
- package/lib/blocklet/project/connect-to-store.js +5 -13
- package/lib/blocklet/project/disconnect-from-store.js +6 -4
- package/lib/blocklet/project/publish-to-store.js +2 -1
- package/lib/blocklet/project/util.js +7 -2
- package/lib/states/audit-log.js +7 -2
- package/lib/states/project.js +10 -4
- package/lib/util/get-meta-from-url.js +3 -6
- package/lib/util/store.js +30 -9
- package/package.json +34 -34
package/lib/api/team.js
CHANGED
|
@@ -2,7 +2,9 @@ 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 } = require('ufo');
|
|
5
|
+
const { joinURL, withQuery, resolveURL, withoutTrailingSlash } = require('ufo');
|
|
6
|
+
const axios = require('@abtnode/util/lib/axios');
|
|
7
|
+
const pRetry = require('p-retry');
|
|
6
8
|
|
|
7
9
|
const logger = require('@abtnode/logger')('@abtnode/core:api:team');
|
|
8
10
|
const {
|
|
@@ -12,7 +14,6 @@ const {
|
|
|
12
14
|
PASSPORT_STATUS,
|
|
13
15
|
WELLKNOWN_SERVICE_PATH_PREFIX,
|
|
14
16
|
MAX_USER_PAGE_SIZE,
|
|
15
|
-
STORE_DETAIL_PAGE_PATH_PREFIX,
|
|
16
17
|
MAIN_CHAIN_ENDPOINT,
|
|
17
18
|
USER_AVATAR_URL_PREFIX,
|
|
18
19
|
SESSION_TTL,
|
|
@@ -1331,56 +1332,91 @@ class TeamAPI extends EventEmitter {
|
|
|
1331
1332
|
logger.info('add store', { teamDid, url, scope });
|
|
1332
1333
|
|
|
1333
1334
|
const urlObj = new URL(url);
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
const
|
|
1340
|
-
|
|
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}`);
|
|
1341
1354
|
}
|
|
1355
|
+
const newUrl = withoutTrailingSlash(joinURL(urlObj.origin, blockletJson?.prefix || '/'));
|
|
1342
1356
|
|
|
1343
1357
|
const sanitized = sanitizeUrl(newUrl);
|
|
1344
1358
|
|
|
1345
1359
|
const storeList = await this.teamManager.getStoreList(teamDid);
|
|
1360
|
+
const did = context?.user?.did;
|
|
1361
|
+
const exist = storeList.find((x) => {
|
|
1362
|
+
if (x.url !== sanitized) {
|
|
1363
|
+
return false;
|
|
1364
|
+
}
|
|
1365
|
+
if (x.scope && x.scope === did) {
|
|
1366
|
+
return true;
|
|
1367
|
+
}
|
|
1368
|
+
if (!x.scope || x.scope === 'studio') {
|
|
1369
|
+
return true;
|
|
1370
|
+
}
|
|
1371
|
+
return x.scope === scope;
|
|
1372
|
+
});
|
|
1346
1373
|
|
|
1347
|
-
const exist = storeList.find((x) => x.url === sanitized);
|
|
1348
1374
|
if (exist) {
|
|
1349
|
-
throw new Error(`Blocklet
|
|
1375
|
+
throw new Error(`Blocklet Store already exist: ${sanitized}`);
|
|
1350
1376
|
}
|
|
1351
1377
|
|
|
1352
1378
|
const store = await StoreUtil.getStoreMeta(sanitized);
|
|
1353
1379
|
|
|
1354
|
-
const existById = storeList.find((x) => x.id === store.id);
|
|
1355
|
-
if (existById) {
|
|
1356
|
-
throw new Error(`Blocklet registry already exist: ${sanitized}`);
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
1380
|
storeList.push({ ...store, scope, url: sanitized, protected: false });
|
|
1360
1381
|
|
|
1361
1382
|
return this.teamManager.updateStoreList(teamDid, storeList);
|
|
1362
1383
|
}
|
|
1363
1384
|
|
|
1364
1385
|
// eslint-disable-next-line no-unused-vars
|
|
1365
|
-
async deleteStore({ teamDid, url, projectId }, context) {
|
|
1386
|
+
async deleteStore({ teamDid, url, projectId, scope }, context) {
|
|
1366
1387
|
logger.info('delete registry', { url });
|
|
1367
1388
|
const sanitized = sanitizeUrl(url);
|
|
1368
1389
|
|
|
1369
1390
|
const storeList = await this.teamManager.getStoreList(teamDid);
|
|
1370
|
-
|
|
1371
|
-
if (
|
|
1372
|
-
|
|
1391
|
+
let storeIndex;
|
|
1392
|
+
if (scope) {
|
|
1393
|
+
storeIndex = storeList.findIndex((x) => {
|
|
1394
|
+
if (x.protected) {
|
|
1395
|
+
return false;
|
|
1396
|
+
}
|
|
1397
|
+
return x.url === sanitized && x.scope === scope;
|
|
1398
|
+
});
|
|
1399
|
+
if (storeIndex === -1) {
|
|
1400
|
+
throw new Error(`No permission to delete the Store registry: ${sanitized}`);
|
|
1401
|
+
}
|
|
1402
|
+
} else {
|
|
1403
|
+
storeIndex = storeList.findIndex((x) => x.url === sanitized && !x.scope);
|
|
1404
|
+
if (storeIndex === -1) {
|
|
1405
|
+
throw new Error(`Store registry does not exist: ${sanitized}`);
|
|
1406
|
+
}
|
|
1373
1407
|
}
|
|
1374
1408
|
|
|
1375
|
-
if (projectId) {
|
|
1409
|
+
if (projectId && scope) {
|
|
1376
1410
|
const { projectState } = await this.teamManager.getProjectState(teamDid);
|
|
1377
|
-
await
|
|
1411
|
+
const store = await StoreUtil.getStoreMeta(sanitized);
|
|
1412
|
+
await projectState.deleteConnectedStore({
|
|
1413
|
+
projectId,
|
|
1414
|
+
storeId: store.id,
|
|
1415
|
+
createdBy: scope === 'studio' ? null : context?.user?.did,
|
|
1416
|
+
});
|
|
1378
1417
|
}
|
|
1379
|
-
|
|
1380
|
-
return this.teamManager.updateStoreList(
|
|
1381
|
-
teamDid,
|
|
1382
|
-
storeList.filter((x) => x.url !== sanitized)
|
|
1383
|
-
);
|
|
1418
|
+
storeList.splice(storeIndex, 1);
|
|
1419
|
+
return this.teamManager.updateStoreList(teamDid, storeList);
|
|
1384
1420
|
}
|
|
1385
1421
|
|
|
1386
1422
|
createNotification = (payload) => {
|
|
@@ -2400,12 +2400,12 @@ class DiskBlockletManager extends BaseBlockletManager {
|
|
|
2400
2400
|
return deleteRelease({ did, projectId, releaseId, context, manager: this });
|
|
2401
2401
|
}
|
|
2402
2402
|
|
|
2403
|
-
connectToStore(params) {
|
|
2404
|
-
return connectToStore({ ...params, manager: this });
|
|
2403
|
+
connectToStore(params, context) {
|
|
2404
|
+
return connectToStore({ ...params, context, manager: this });
|
|
2405
2405
|
}
|
|
2406
2406
|
|
|
2407
|
-
disconnectFromStore(params) {
|
|
2408
|
-
return disconnectFromStore({ ...params, manager: this });
|
|
2407
|
+
disconnectFromStore(params, context) {
|
|
2408
|
+
return disconnectFromStore({ ...params, context, manager: this });
|
|
2409
2409
|
}
|
|
2410
2410
|
|
|
2411
2411
|
connectByStudio(params, context) {
|
|
@@ -42,7 +42,7 @@ const installComponentFromUrl = async ({
|
|
|
42
42
|
|
|
43
43
|
checkStructVersion(blocklet);
|
|
44
44
|
|
|
45
|
-
const { inStore, registryUrl } = await StoreUtil.
|
|
45
|
+
const { inStore, registryUrl } = await StoreUtil.getStoreInfo(url);
|
|
46
46
|
|
|
47
47
|
const meta = await getBlockletMetaFromUrl(url);
|
|
48
48
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const validUrl = require('valid-url');
|
|
2
2
|
|
|
3
3
|
const { createConnect } = require('@blocklet/store');
|
|
4
|
+
const { getDisplayName } = require('@blocklet/meta/lib/util');
|
|
4
5
|
|
|
5
6
|
function sanitizeBlockletTitle(blockletTitle) {
|
|
6
7
|
let sanitizedTitle = blockletTitle.replace(/[^a-zA-Z0-9-_]/g, '');
|
|
@@ -38,10 +39,12 @@ const connectByStudio = ({
|
|
|
38
39
|
// eslint-disable-next-line no-async-promise-executor
|
|
39
40
|
return new Promise(async (resolve, reject) => {
|
|
40
41
|
try {
|
|
42
|
+
const blocklet = await manager.getBlocklet(did);
|
|
41
43
|
const fetchData = await createConnect({
|
|
42
44
|
connectUrl: storeUrl,
|
|
43
45
|
connectAction: 'connect-studio',
|
|
44
46
|
enableEncrypt: true,
|
|
47
|
+
source: `Blocklet Studio (${getDisplayName(blocklet)})`,
|
|
45
48
|
// monikers 必须满足一个规则, 而 blockletTitle 是更宽松的规则
|
|
46
49
|
monikers: sanitizeBlockletTitle(blockletTitle) || 'blocklet',
|
|
47
50
|
openPage: (pageUrl) => {
|
|
@@ -66,6 +69,7 @@ const connectByStudio = ({
|
|
|
66
69
|
developerDid,
|
|
67
70
|
developerName: name,
|
|
68
71
|
developerEmail: email,
|
|
72
|
+
createdBy: context?.user?.did,
|
|
69
73
|
};
|
|
70
74
|
await projectState.createProject({
|
|
71
75
|
blockletTitle,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const validUrl = require('valid-url');
|
|
2
2
|
|
|
3
3
|
const { createConnect } = require('@blocklet/store');
|
|
4
|
+
const { getDisplayName } = require('@blocklet/meta/lib/util');
|
|
4
5
|
|
|
5
|
-
const connectToStore = ({ did, projectId, storeName, storeId, storeUrl, manager }) => {
|
|
6
|
+
const connectToStore = ({ did, projectId, storeName, storeId, storeUrl, manager, context }) => {
|
|
6
7
|
if (!did) {
|
|
7
8
|
throw new Error('Invalid did');
|
|
8
9
|
}
|
|
@@ -14,21 +15,11 @@ const connectToStore = ({ did, projectId, storeName, storeId, storeUrl, manager
|
|
|
14
15
|
// eslint-disable-next-line no-async-promise-executor
|
|
15
16
|
return new Promise(async (resolve, reject) => {
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
-
// const fetchData = await createConnect({
|
|
19
|
-
// connectUrl: storeUrl,
|
|
20
|
-
// projectId,
|
|
21
|
-
// userDid,
|
|
22
|
-
// connectAction: 'connect-by-studio',
|
|
23
|
-
// enableEncrypt: true,
|
|
24
|
-
// openPage: (pageUrl) => {
|
|
25
|
-
// resolve(pageUrl);
|
|
26
|
-
// },
|
|
27
|
-
// });
|
|
28
|
-
|
|
18
|
+
const blocklet = await manager.getBlocklet(did);
|
|
29
19
|
const fetchData = await createConnect({
|
|
30
20
|
connectUrl: storeUrl,
|
|
31
21
|
connectAction: 'connect-cli',
|
|
22
|
+
source: `Blocklet Studio (${getDisplayName(blocklet)})`,
|
|
32
23
|
enableEncrypt: true,
|
|
33
24
|
openPage: (pageUrl) => {
|
|
34
25
|
resolve(pageUrl);
|
|
@@ -52,6 +43,7 @@ const connectToStore = ({ did, projectId, storeName, storeId, storeUrl, manager
|
|
|
52
43
|
developerDid,
|
|
53
44
|
developerName: name,
|
|
54
45
|
developerEmail: email,
|
|
46
|
+
createdBy: context?.user?.did,
|
|
55
47
|
};
|
|
56
48
|
|
|
57
49
|
const oldStore = project.connectedStores.find((x) => x.storeId === storeId);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
const disconnectFromStore = async ({ did, storeId, projectId, manager }) => {
|
|
1
|
+
const disconnectFromStore = async ({ did, storeId, projectId, manager, storeScope, context }) => {
|
|
2
2
|
if (!did) {
|
|
3
3
|
throw new Error('Invalid did');
|
|
4
4
|
}
|
|
5
5
|
const { projectState } = await manager._getProjectState(did);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
return projectState.deleteConnectedStore({
|
|
7
|
+
projectId,
|
|
8
|
+
storeId,
|
|
9
|
+
createdBy: storeScope === 'studio' ? null : context?.user?.did,
|
|
10
|
+
});
|
|
9
11
|
};
|
|
10
12
|
|
|
11
13
|
module.exports = disconnectFromStore;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const { PROJECT } = require('@blocklet/constant');
|
|
3
3
|
const { upload } = require('@blocklet/store');
|
|
4
|
+
const { getDisplayName } = require('@blocklet/meta/lib/util');
|
|
4
5
|
|
|
5
6
|
function ensureArray(value) {
|
|
6
7
|
if (!value) {
|
|
@@ -57,7 +58,7 @@ const publishToStore = async ({ did, projectId, releaseId, type, storeId, manage
|
|
|
57
58
|
storeUrl,
|
|
58
59
|
accessToken,
|
|
59
60
|
developerDid,
|
|
60
|
-
source:
|
|
61
|
+
source: `Blocklet Studio (${getDisplayName(blocklet)})`,
|
|
61
62
|
});
|
|
62
63
|
|
|
63
64
|
release.publishedStoreIds = ensureArray(release.publishedStoreIds);
|
|
@@ -161,10 +161,15 @@ const checkUploadExists = async (projectDir, action, releaseId, uploadedResource
|
|
|
161
161
|
}
|
|
162
162
|
fs.ensureDirSync(resourceDir);
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
try {
|
|
165
|
+
await expandBundle(uploadedFile, resourceDir);
|
|
166
|
+
} catch (err) {
|
|
167
|
+
throw new Error('Only zip or gz archives are supported as resources.');
|
|
168
|
+
}
|
|
169
|
+
|
|
165
170
|
const files = ['index.html', 'index.htm'];
|
|
166
171
|
if (files.every((file) => fs.existsSync(path.join(resourceDir, file)) === false)) {
|
|
167
|
-
throw new Error(
|
|
172
|
+
throw new Error('The uploaded resource does not contain an index.html file in the root directory of the archive');
|
|
168
173
|
}
|
|
169
174
|
};
|
|
170
175
|
|
package/lib/states/audit-log.js
CHANGED
|
@@ -27,9 +27,14 @@ const getComponentNames = (blocklet, componentDids, withVersion) =>
|
|
|
27
27
|
uniq(componentDids || [])
|
|
28
28
|
.map((x) => {
|
|
29
29
|
const component = blocklet.children.find((y) => y.meta.did === x);
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (component) {
|
|
31
|
+
const version = withVersion ? `@${component.meta.version}` : '';
|
|
32
|
+
return `${component.meta.title}${version}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return '';
|
|
32
36
|
})
|
|
37
|
+
.filter(Boolean)
|
|
33
38
|
.join(', ');
|
|
34
39
|
const getComponentNamesWithVersion = (blocklet, componentDids) => getComponentNames(blocklet, componentDids, true);
|
|
35
40
|
const componentOrApplicationInfo = (app, componentDids) =>
|
package/lib/states/project.js
CHANGED
|
@@ -87,13 +87,19 @@ class Project extends BaseState {
|
|
|
87
87
|
return updated;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async deleteConnectedStore(
|
|
91
|
-
const project = await this.findOne({ id });
|
|
90
|
+
async deleteConnectedStore({ projectId, storeId, createdBy }) {
|
|
91
|
+
const project = await this.findOne({ id: projectId });
|
|
92
92
|
if (!project) {
|
|
93
93
|
throw new Error('Project not found');
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
|
|
95
|
+
const index = (project.connectedStores || []).findIndex(
|
|
96
|
+
(x) => x.storeId === storeId && (createdBy ? x.createdBy === createdBy : true)
|
|
97
|
+
);
|
|
98
|
+
if (index === -1) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
project.connectedStores.splice(index, 1);
|
|
102
|
+
const [, [updated]] = await this.update({ id: projectId }, { $set: { connectedStores: project.connectedStores } });
|
|
97
103
|
|
|
98
104
|
return updated;
|
|
99
105
|
}
|
|
@@ -3,17 +3,16 @@ const { isFreeBlocklet } = require('@blocklet/meta/lib/util');
|
|
|
3
3
|
const logger = require('@abtnode/logger')('getMetaFromUrl');
|
|
4
4
|
|
|
5
5
|
const { getBlockletMetaFromUrl } = require('./blocklet');
|
|
6
|
-
const {
|
|
6
|
+
const { getStoreInfo } = require('./store');
|
|
7
7
|
const { getFactoryState } = require('./chain');
|
|
8
8
|
|
|
9
9
|
const getMetaFromUrl = async ({ url, checkPrice = false }) => {
|
|
10
10
|
const meta = await getBlockletMetaFromUrl(url);
|
|
11
11
|
let isFree = isFreeBlocklet(meta);
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const { inStore, registryUrl, registryMeta } = await getStoreInfo(url);
|
|
14
|
+
if (checkPrice && !isFree && meta.nftFactory && inStore && registryMeta) {
|
|
14
15
|
try {
|
|
15
|
-
const registryMeta = await getStoreMeta(new URL(url).origin);
|
|
16
|
-
|
|
17
16
|
if (registryMeta.chainHost) {
|
|
18
17
|
const state = await getFactoryState(registryMeta.chainHost, meta.nftFactory);
|
|
19
18
|
if (state) {
|
|
@@ -25,8 +24,6 @@ const getMetaFromUrl = async ({ url, checkPrice = false }) => {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
const { inStore, registryUrl } = await parseSourceUrl(url);
|
|
29
|
-
|
|
30
27
|
return { meta, isFree, inStore, registryUrl };
|
|
31
28
|
};
|
|
32
29
|
|
package/lib/util/store.js
CHANGED
|
@@ -2,7 +2,7 @@ const { joinURL, withQuery } = require('ufo');
|
|
|
2
2
|
const pick = require('lodash/pick');
|
|
3
3
|
const isBase64 = require('is-base64');
|
|
4
4
|
|
|
5
|
-
const { BLOCKLET_STORE_API_PREFIX, BLOCKLET_STORE_META_PATH } = require('@abtnode/constant');
|
|
5
|
+
const { BLOCKLET_STORE_API_PREFIX, BLOCKLET_STORE_META_PATH, BLOCKLET_STORE_DID } = require('@abtnode/constant');
|
|
6
6
|
const { validateMeta, fixAndValidateService } = require('@blocklet/meta/lib/validate');
|
|
7
7
|
const verifyMultiSig = require('@blocklet/meta/lib/verify-multi-sig');
|
|
8
8
|
const isRequirementsSatisfied = require('./requirement');
|
|
@@ -46,6 +46,7 @@ const fixAndVerifyMetaFromStore = (meta) => {
|
|
|
46
46
|
return fixAndValidateService(meta);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
// Note: registry should contain the store endpoint
|
|
49
50
|
const getStoreMeta = async (registry) => {
|
|
50
51
|
try {
|
|
51
52
|
const url = withQuery(joinURL(registry, BLOCKLET_STORE_META_PATH), {
|
|
@@ -81,18 +82,37 @@ const getStoreMeta = async (registry) => {
|
|
|
81
82
|
}
|
|
82
83
|
};
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
const { origin
|
|
85
|
+
async function getStoreUrl(url) {
|
|
86
|
+
const { origin } = new URL(url);
|
|
87
|
+
let mountPoint = '';
|
|
88
|
+
try {
|
|
89
|
+
const { data: meta } = await request.get(joinURL(origin, '__blocklet__.js?type=json&nocache=1'));
|
|
90
|
+
const component = meta.componentMountPoints?.find((item) => item.did === BLOCKLET_STORE_DID);
|
|
91
|
+
|
|
92
|
+
if (component) {
|
|
93
|
+
mountPoint = component.mountPoint;
|
|
94
|
+
}
|
|
95
|
+
} catch {
|
|
96
|
+
// Do nothing
|
|
97
|
+
}
|
|
86
98
|
|
|
87
|
-
|
|
99
|
+
return joinURL(origin, mountPoint);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function getStoreInfo(url) {
|
|
103
|
+
const { pathname } = new URL(url);
|
|
104
|
+
|
|
105
|
+
const match = pathname.match(/\/api\/blocklets\/(\w*)\/blocklet\.json$/);
|
|
88
106
|
if (match) {
|
|
89
107
|
try {
|
|
90
|
-
const
|
|
91
|
-
|
|
108
|
+
const registryUrl = await getStoreUrl(url);
|
|
109
|
+
const meta = await getStoreMeta(registryUrl);
|
|
110
|
+
if (meta && meta.id) {
|
|
92
111
|
return {
|
|
93
112
|
inStore: true,
|
|
94
|
-
registryUrl
|
|
113
|
+
registryUrl,
|
|
95
114
|
blockletDid: match[1],
|
|
115
|
+
registryMeta: meta,
|
|
96
116
|
};
|
|
97
117
|
}
|
|
98
118
|
} catch {
|
|
@@ -103,7 +123,7 @@ const parseSourceUrl = async (url) => {
|
|
|
103
123
|
return {
|
|
104
124
|
inStore: false,
|
|
105
125
|
};
|
|
106
|
-
}
|
|
126
|
+
}
|
|
107
127
|
|
|
108
128
|
const resolveTarballURL = ({ did, tarball = '', storeUrl = '' }) => {
|
|
109
129
|
if (!tarball) {
|
|
@@ -158,7 +178,8 @@ const getBlockletMeta = async ({ did, storeUrl }) => {
|
|
|
158
178
|
|
|
159
179
|
module.exports = {
|
|
160
180
|
getStoreMeta,
|
|
161
|
-
|
|
181
|
+
getStoreInfo,
|
|
182
|
+
getStoreUrl,
|
|
162
183
|
getBlockletMeta,
|
|
163
184
|
resolveTarballURL,
|
|
164
185
|
getBlockletMetaUrl,
|
package/package.json
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.29-beta-
|
|
6
|
+
"version": "1.16.29-beta-db5c4ed6",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
10
10
|
"lib"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"lint": "eslint tests lib",
|
|
13
|
+
"lint": "eslint tests lib --ignore-pattern 'tests/assets/*'",
|
|
14
14
|
"lint:fix": "eslint --fix tests lib",
|
|
15
15
|
"test": "node tools/jest.js",
|
|
16
16
|
"coverage": "npm run test -- --coverage"
|
|
@@ -19,40 +19,40 @@
|
|
|
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-
|
|
23
|
-
"@abtnode/auth": "1.16.29-beta-
|
|
24
|
-
"@abtnode/certificate-manager": "1.16.29-beta-
|
|
25
|
-
"@abtnode/constant": "1.16.29-beta-
|
|
26
|
-
"@abtnode/cron": "1.16.29-beta-
|
|
27
|
-
"@abtnode/logger": "1.16.29-beta-
|
|
28
|
-
"@abtnode/models": "1.16.29-beta-
|
|
29
|
-
"@abtnode/queue": "1.16.29-beta-
|
|
30
|
-
"@abtnode/rbac": "1.16.29-beta-
|
|
31
|
-
"@abtnode/router-provider": "1.16.29-beta-
|
|
32
|
-
"@abtnode/static-server": "1.16.29-beta-
|
|
33
|
-
"@abtnode/timemachine": "1.16.29-beta-
|
|
34
|
-
"@abtnode/util": "1.16.29-beta-
|
|
35
|
-
"@arcblock/did": "1.18.
|
|
36
|
-
"@arcblock/did-auth": "1.18.
|
|
37
|
-
"@arcblock/did-ext": "^1.18.
|
|
22
|
+
"@abtnode/analytics": "1.16.29-beta-db5c4ed6",
|
|
23
|
+
"@abtnode/auth": "1.16.29-beta-db5c4ed6",
|
|
24
|
+
"@abtnode/certificate-manager": "1.16.29-beta-db5c4ed6",
|
|
25
|
+
"@abtnode/constant": "1.16.29-beta-db5c4ed6",
|
|
26
|
+
"@abtnode/cron": "1.16.29-beta-db5c4ed6",
|
|
27
|
+
"@abtnode/logger": "1.16.29-beta-db5c4ed6",
|
|
28
|
+
"@abtnode/models": "1.16.29-beta-db5c4ed6",
|
|
29
|
+
"@abtnode/queue": "1.16.29-beta-db5c4ed6",
|
|
30
|
+
"@abtnode/rbac": "1.16.29-beta-db5c4ed6",
|
|
31
|
+
"@abtnode/router-provider": "1.16.29-beta-db5c4ed6",
|
|
32
|
+
"@abtnode/static-server": "1.16.29-beta-db5c4ed6",
|
|
33
|
+
"@abtnode/timemachine": "1.16.29-beta-db5c4ed6",
|
|
34
|
+
"@abtnode/util": "1.16.29-beta-db5c4ed6",
|
|
35
|
+
"@arcblock/did": "1.18.124",
|
|
36
|
+
"@arcblock/did-auth": "1.18.124",
|
|
37
|
+
"@arcblock/did-ext": "^1.18.124",
|
|
38
38
|
"@arcblock/did-motif": "^1.1.13",
|
|
39
|
-
"@arcblock/did-util": "1.18.
|
|
40
|
-
"@arcblock/event-hub": "1.18.
|
|
41
|
-
"@arcblock/jwt": "^1.18.
|
|
39
|
+
"@arcblock/did-util": "1.18.124",
|
|
40
|
+
"@arcblock/event-hub": "1.18.124",
|
|
41
|
+
"@arcblock/jwt": "^1.18.124",
|
|
42
42
|
"@arcblock/pm2-events": "^0.0.5",
|
|
43
|
-
"@arcblock/validator": "^1.18.
|
|
44
|
-
"@arcblock/vc": "1.18.
|
|
45
|
-
"@blocklet/constant": "1.16.29-beta-
|
|
46
|
-
"@blocklet/env": "1.16.29-beta-
|
|
47
|
-
"@blocklet/meta": "1.16.29-beta-
|
|
48
|
-
"@blocklet/resolver": "1.16.29-beta-
|
|
49
|
-
"@blocklet/sdk": "1.16.29-beta-
|
|
50
|
-
"@blocklet/store": "1.16.29-beta-
|
|
51
|
-
"@did-space/client": "^0.5.
|
|
43
|
+
"@arcblock/validator": "^1.18.124",
|
|
44
|
+
"@arcblock/vc": "1.18.124",
|
|
45
|
+
"@blocklet/constant": "1.16.29-beta-db5c4ed6",
|
|
46
|
+
"@blocklet/env": "1.16.29-beta-db5c4ed6",
|
|
47
|
+
"@blocklet/meta": "1.16.29-beta-db5c4ed6",
|
|
48
|
+
"@blocklet/resolver": "1.16.29-beta-db5c4ed6",
|
|
49
|
+
"@blocklet/sdk": "1.16.29-beta-db5c4ed6",
|
|
50
|
+
"@blocklet/store": "1.16.29-beta-db5c4ed6",
|
|
51
|
+
"@did-space/client": "^0.5.4",
|
|
52
52
|
"@fidm/x509": "^1.2.1",
|
|
53
|
-
"@ocap/mcrypto": "1.18.
|
|
54
|
-
"@ocap/util": "1.18.
|
|
55
|
-
"@ocap/wallet": "1.18.
|
|
53
|
+
"@ocap/mcrypto": "1.18.124",
|
|
54
|
+
"@ocap/util": "1.18.124",
|
|
55
|
+
"@ocap/wallet": "1.18.124",
|
|
56
56
|
"@slack/webhook": "^5.0.4",
|
|
57
57
|
"archiver": "^7.0.1",
|
|
58
58
|
"axios": "^1.7.2",
|
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"jest": "^29.7.0",
|
|
104
104
|
"unzipper": "^0.10.11"
|
|
105
105
|
},
|
|
106
|
-
"gitHead": "
|
|
106
|
+
"gitHead": "b15f6442fd30f217c08c7f892dce5d38e340ea28"
|
|
107
107
|
}
|