@abtnode/core 1.8.65-beta-bfcc12ce → 1.8.65-beta-b8810d3f

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.
@@ -1475,6 +1475,7 @@ class BlockletManager extends BaseBlockletManager {
1475
1475
  id: did,
1476
1476
  oldBlocklet: { ...oldBlocklet },
1477
1477
  blocklet: { ...newBlocklet },
1478
+ selectedComponentDids: selectedComponentDids || [],
1478
1479
  version,
1479
1480
  context,
1480
1481
  postAction: action,
@@ -1784,13 +1785,23 @@ class BlockletManager extends BaseBlockletManager {
1784
1785
  * context: {},
1785
1786
  * postAction: 'install' | 'upgrade' | 'downgrade',
1786
1787
  * oldBlocklet: {},
1787
- * throwOnError: Error
1788
+ * throwOnError: Error,
1789
+ * skipCheckStatusBeforeDownload: boolean,
1790
+ * selectedComponentDids: Array<did>,
1788
1791
  * }} params
1789
1792
  * @return {*}
1790
1793
  * @memberof BlockletManager
1791
1794
  */
1792
1795
  async downloadAndInstall(params) {
1793
- const { blocklet, context, postAction, oldBlocklet, throwOnError, skipCheckStatusBeforeDownload } = params;
1796
+ const {
1797
+ blocklet,
1798
+ context,
1799
+ postAction,
1800
+ oldBlocklet,
1801
+ throwOnError,
1802
+ skipCheckStatusBeforeDownload,
1803
+ selectedComponentDids,
1804
+ } = params;
1794
1805
  const { meta } = blocklet;
1795
1806
  const { name, did, version } = meta;
1796
1807
 
@@ -1822,7 +1833,16 @@ class BlockletManager extends BaseBlockletManager {
1822
1833
 
1823
1834
  // download bundle
1824
1835
  try {
1825
- const { isCancelled } = await this._downloadBlocklet(blocklet, context);
1836
+ const blockletForDownload = {
1837
+ ...blocklet,
1838
+ children: (blocklet.children || []).filter((x) => {
1839
+ if (selectedComponentDids?.length) {
1840
+ return selectedComponentDids.includes(x.meta.did);
1841
+ }
1842
+ return x;
1843
+ }),
1844
+ };
1845
+ const { isCancelled } = await this._downloadBlocklet(blockletForDownload, context);
1826
1846
 
1827
1847
  if (isCancelled) {
1828
1848
  logger.info('Download was canceled', { name, did, version });
@@ -2283,6 +2303,7 @@ class BlockletManager extends BaseBlockletManager {
2283
2303
  did: rootDid,
2284
2304
  children: [...blocklet.children, newChild],
2285
2305
  oldBlocklet: blocklet,
2306
+ selectedComponents: [newChild.meta.did],
2286
2307
  },
2287
2308
  context
2288
2309
  );
@@ -2570,6 +2591,7 @@ class BlockletManager extends BaseBlockletManager {
2570
2591
  throwOnError: true,
2571
2592
  postAction: action,
2572
2593
  skipCheckStatusBeforeDownload: true,
2594
+ selectedComponentDids: [newChild.meta.did],
2573
2595
  });
2574
2596
  return this.getBlocklet(newBlocklet.meta.did);
2575
2597
  }
@@ -61,9 +61,6 @@ class BlockletExtrasRestore extends BaseRestore {
61
61
  * @memberof BlockletExtrasRestore
62
62
  */
63
63
  useBlockletDecryptConfigs(configs) {
64
- // eslint-disable-next-line no-console
65
- console.log('debug', configs, !configs || !isArray(configs));
66
-
67
64
  if (!configs || !isArray(configs)) {
68
65
  return;
69
66
  }
@@ -370,6 +370,10 @@ const ensureBlockletCache = async (sites = [], blocklets) => {
370
370
  )
371
371
  .forEach((rule) => {
372
372
  const component = findComponentById(blocklet, rule.to.componentId);
373
+ if (!component) {
374
+ return;
375
+ }
376
+
373
377
  if (component.mode !== BLOCKLET_MODES.PRODUCTION) {
374
378
  return;
375
379
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.8.65-beta-bfcc12ce",
6
+ "version": "1.8.65-beta-b8810d3f",
7
7
  "description": "",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -19,18 +19,18 @@
19
19
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@abtnode/auth": "1.8.65-beta-bfcc12ce",
23
- "@abtnode/certificate-manager": "1.8.65-beta-bfcc12ce",
24
- "@abtnode/constant": "1.8.65-beta-bfcc12ce",
25
- "@abtnode/cron": "1.8.65-beta-bfcc12ce",
26
- "@abtnode/db": "1.8.65-beta-bfcc12ce",
27
- "@abtnode/logger": "1.8.65-beta-bfcc12ce",
28
- "@abtnode/queue": "1.8.65-beta-bfcc12ce",
29
- "@abtnode/rbac": "1.8.65-beta-bfcc12ce",
30
- "@abtnode/router-provider": "1.8.65-beta-bfcc12ce",
31
- "@abtnode/static-server": "1.8.65-beta-bfcc12ce",
32
- "@abtnode/timemachine": "1.8.65-beta-bfcc12ce",
33
- "@abtnode/util": "1.8.65-beta-bfcc12ce",
22
+ "@abtnode/auth": "1.8.65-beta-b8810d3f",
23
+ "@abtnode/certificate-manager": "1.8.65-beta-b8810d3f",
24
+ "@abtnode/constant": "1.8.65-beta-b8810d3f",
25
+ "@abtnode/cron": "1.8.65-beta-b8810d3f",
26
+ "@abtnode/db": "1.8.65-beta-b8810d3f",
27
+ "@abtnode/logger": "1.8.65-beta-b8810d3f",
28
+ "@abtnode/queue": "1.8.65-beta-b8810d3f",
29
+ "@abtnode/rbac": "1.8.65-beta-b8810d3f",
30
+ "@abtnode/router-provider": "1.8.65-beta-b8810d3f",
31
+ "@abtnode/static-server": "1.8.65-beta-b8810d3f",
32
+ "@abtnode/timemachine": "1.8.65-beta-b8810d3f",
33
+ "@abtnode/util": "1.8.65-beta-b8810d3f",
34
34
  "@arcblock/did": "1.18.42",
35
35
  "@arcblock/did-motif": "^1.1.10",
36
36
  "@arcblock/did-util": "1.18.42",
@@ -38,9 +38,9 @@
38
38
  "@arcblock/jwt": "^1.18.42",
39
39
  "@arcblock/pm2-events": "^0.0.5",
40
40
  "@arcblock/vc": "1.18.42",
41
- "@blocklet/constant": "1.8.65-beta-bfcc12ce",
42
- "@blocklet/meta": "1.8.65-beta-bfcc12ce",
43
- "@blocklet/sdk": "1.8.65-beta-bfcc12ce",
41
+ "@blocklet/constant": "1.8.65-beta-b8810d3f",
42
+ "@blocklet/meta": "1.8.65-beta-b8810d3f",
43
+ "@blocklet/sdk": "1.8.65-beta-b8810d3f",
44
44
  "@did-space/client": "^0.1.66",
45
45
  "@fidm/x509": "^1.2.1",
46
46
  "@ocap/mcrypto": "1.18.42",
@@ -90,5 +90,5 @@
90
90
  "express": "^4.18.2",
91
91
  "jest": "^27.5.1"
92
92
  },
93
- "gitHead": "f6a56512275a55feecf2f3953542ea98777a08f2"
93
+ "gitHead": "a09db09103a4815026376a4af4c07acc2a7040e3"
94
94
  }