@abtnode/util 1.17.5-beta-20251211-104355-426d7eb6 → 1.17.5-beta-20251214-231110-497f8d27

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/blocklet.js +9 -3
  2. package/package.json +14 -14
package/lib/blocklet.js CHANGED
@@ -42,10 +42,16 @@ const getComponentApiKey = ({ serverSk, app, component } = {}) => {
42
42
  throw new Error('component.meta.did should not be empty');
43
43
  }
44
44
 
45
+ // Normalize installedAt to ISO string for consistent hashing
46
+ // This handles both Date objects and ISO strings
47
+ let installedAtStr = '';
48
+ if (component?.installedAt) {
49
+ installedAtStr =
50
+ component.installedAt instanceof Date ? component.installedAt.toISOString() : String(component.installedAt);
51
+ }
52
+
45
53
  const hash = createHash('sha256');
46
- const token = hash
47
- .update(`${serverSk}${app?.meta?.did}${component?.meta?.did}${component?.installedAt}`)
48
- .digest('base64');
54
+ const token = hash.update(`${serverSk}${app?.meta?.did}${component?.meta?.did}${installedAtStr}`).digest('base64');
49
55
  return token;
50
56
  };
51
57
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.17.5-beta-20251211-104355-426d7eb6",
6
+ "version": "1.17.5-beta-20251214-231110-497f8d27",
7
7
  "description": "ArcBlock's JavaScript utility",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,19 +18,19 @@
18
18
  "author": "polunzh <polunzh@gmail.com> (http://github.com/polunzh)",
19
19
  "license": "Apache-2.0",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.17.5-beta-20251211-104355-426d7eb6",
22
- "@abtnode/db-cache": "1.17.5-beta-20251211-104355-426d7eb6",
23
- "@arcblock/did": "^1.27.12",
24
- "@arcblock/event-hub": "^1.27.12",
21
+ "@abtnode/constant": "1.17.5-beta-20251214-231110-497f8d27",
22
+ "@abtnode/db-cache": "1.17.5-beta-20251214-231110-497f8d27",
23
+ "@arcblock/did": "^1.27.14",
24
+ "@arcblock/event-hub": "^1.27.14",
25
25
  "@arcblock/pm2": "^6.0.12",
26
- "@blocklet/constant": "1.17.5-beta-20251211-104355-426d7eb6",
27
- "@blocklet/error": "^0.3.3",
28
- "@blocklet/meta": "1.17.5-beta-20251211-104355-426d7eb6",
29
- "@blocklet/xss": "^0.3.10",
30
- "@ocap/client": "^1.27.12",
31
- "@ocap/mcrypto": "^1.27.12",
32
- "@ocap/util": "^1.27.12",
33
- "@ocap/wallet": "^1.27.12",
26
+ "@blocklet/constant": "1.17.5-beta-20251214-231110-497f8d27",
27
+ "@blocklet/error": "^0.3.4",
28
+ "@blocklet/meta": "1.17.5-beta-20251214-231110-497f8d27",
29
+ "@blocklet/xss": "^0.3.12",
30
+ "@ocap/client": "^1.27.14",
31
+ "@ocap/mcrypto": "^1.27.14",
32
+ "@ocap/util": "^1.27.14",
33
+ "@ocap/wallet": "^1.27.14",
34
34
  "archiver": "^7.0.1",
35
35
  "axios": "^1.7.9",
36
36
  "axios-mock-adapter": "^2.1.0",
@@ -90,5 +90,5 @@
90
90
  "express": "^4.18.2",
91
91
  "fs-extra": "^11.2.0"
92
92
  },
93
- "gitHead": "9ea2a8077a8edbf5021281e823719758eb9fe02c"
93
+ "gitHead": "aa782962d97ed5d9a994268621e9a652c995c783"
94
94
  }