wowok 2.2.7 → 2.2.9
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/NOTICE +4 -4
- package/README.md +32 -1
- package/THIRD_PARTY_LICENSES/MIT_LICENSE.txt +2 -2
- package/dist/cjs/w/call/allocation.js +1 -1
- package/dist/cjs/w/call/arbitration.js +1 -1
- package/dist/cjs/w/call/contact.js +1 -1
- package/dist/cjs/w/call/demand.js +1 -1
- package/dist/cjs/w/call/machine.js +1 -1
- package/dist/cjs/w/call/order.js +1 -1
- package/dist/cjs/w/call/permission.js +1 -1
- package/dist/cjs/w/call/repository.js +1 -1
- package/dist/cjs/w/call/reward.js +1 -1
- package/dist/cjs/w/call/service.js +1 -1
- package/dist/cjs/w/call/treasury.js +1 -1
- package/dist/cjs/w/local/storage.d.ts +1 -1
- package/dist/cjs/w/local/storage.js +1 -1
- package/dist/cjs/w/messenger/pq/store-adapter.d.ts +1 -1
- package/dist/cjs/w/messenger/storage.d.ts +1 -1
- package/dist/cjs/w/messenger/storage.js +1 -1
- package/dist/cjs/w/query/event.d.ts +2 -1
- package/dist/cjs/w/query/event.js +1 -1
- package/dist/cjs/w/query/object.d.ts +11 -0
- package/dist/cjs/w/query/object.js +1 -1
- package/dist/cjs/w/query/received.d.ts +3 -1
- package/dist/cjs/w/query/received.js +1 -1
- package/dist/esm/w/call/allocation.js +1 -1
- package/dist/esm/w/call/arbitration.js +1 -1
- package/dist/esm/w/call/contact.js +1 -1
- package/dist/esm/w/call/demand.js +1 -1
- package/dist/esm/w/call/machine.js +1 -1
- package/dist/esm/w/call/order.js +1 -1
- package/dist/esm/w/call/permission.js +1 -1
- package/dist/esm/w/call/repository.js +1 -1
- package/dist/esm/w/call/reward.js +1 -1
- package/dist/esm/w/call/service.js +1 -1
- package/dist/esm/w/call/treasury.js +1 -1
- package/dist/esm/w/local/storage.d.ts +1 -1
- package/dist/esm/w/local/storage.js +1 -1
- package/dist/esm/w/messenger/pq/store-adapter.d.ts +1 -1
- package/dist/esm/w/messenger/storage.d.ts +1 -1
- package/dist/esm/w/messenger/storage.js +1 -1
- package/dist/esm/w/query/event.d.ts +2 -1
- package/dist/esm/w/query/event.js +1 -1
- package/dist/esm/w/query/object.d.ts +11 -0
- package/dist/esm/w/query/object.js +1 -1
- package/dist/esm/w/query/received.d.ts +3 -1
- package/dist/esm/w/query/received.js +1 -1
- package/package.json +2 -15
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-darwin-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-darwin-x64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-linux-arm.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-linux-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-linux-x64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-win32-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v115-win32-x64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-darwin-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-darwin-x64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-linux-arm.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-linux-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-linux-x64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-win32-arm64.node +0 -0
- package/prebuilds/better-sqlite3-v12.9.0-node-v127-win32-x64.node +0 -0
- package/scripts/download-prebuilds.js +0 -252
- package/scripts/install-better-sqlite3.js +0 -377
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "wowok <build@wowok.net>",
|
|
4
4
|
"description": "Wowok Blockchain TypeScript API",
|
|
5
5
|
"homepage": "https://wowok.net",
|
|
6
|
-
"version": "2.2.
|
|
6
|
+
"version": "2.2.9",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
@@ -295,30 +295,18 @@
|
|
|
295
295
|
"eslint:fix": "pnpm run eslint:check --fix",
|
|
296
296
|
"lint": "pnpm run eslint:check && pnpm run prettier:check",
|
|
297
297
|
"lint:fix": "pnpm run eslint:fix && pnpm run prettier:fix",
|
|
298
|
-
"postinstall": "node scripts/install-better-sqlite3.js",
|
|
299
298
|
"prebuilds:download": "node scripts/download-prebuilds.js"
|
|
300
299
|
},
|
|
301
300
|
"devDependencies": {
|
|
302
|
-
"@0no-co/graphqlsp": "^1.15.4",
|
|
303
|
-
"@graphql-codegen/add": "^7.0.0",
|
|
304
|
-
"@graphql-codegen/cli": "^7.0.0",
|
|
305
|
-
"@graphql-codegen/typed-document-node": "^7.0.0",
|
|
306
|
-
"@graphql-codegen/typescript": "^6.0.1",
|
|
307
|
-
"@graphql-codegen/typescript-operations": "^6.0.2",
|
|
308
|
-
"@graphql-typed-document-node/core": "^3.2.0",
|
|
309
301
|
"@parcel/watcher": "^2.5.1",
|
|
310
302
|
"@protobuf-ts/plugin": "^2.11.1",
|
|
311
|
-
"@sudocode-ai/better-sqlite3-win32-x64": "^11.10.0",
|
|
312
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
313
303
|
"@types/node": "^24.10.1",
|
|
314
304
|
"@types/tmp": "^0.2.6",
|
|
315
305
|
"@types/ws": "^8.18.1",
|
|
316
306
|
"cross-env": "^10.1.0",
|
|
317
307
|
"gql.tada": "^1.8.0",
|
|
318
308
|
"javascript-obfuscator": "^4.1.1",
|
|
319
|
-
"moc-better-sqlite3": "^7.1.1",
|
|
320
309
|
"msw": "^2.12.3",
|
|
321
|
-
"prebuild-install": "^7.1.3",
|
|
322
310
|
"tmp": "^0.2.5",
|
|
323
311
|
"ts-retry-promise": "^0.8.1",
|
|
324
312
|
"typescript": "^5.9.3",
|
|
@@ -336,12 +324,11 @@
|
|
|
336
324
|
"@protobuf-ts/runtime": "^2.11.1",
|
|
337
325
|
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
|
338
326
|
"@scure/base": "^1.2.6",
|
|
339
|
-
"@scure/bip32": "^1.7.0",
|
|
340
327
|
"@scure/bip39": "^1.6.0",
|
|
341
328
|
"@types/lodash": "^4.17.21",
|
|
342
329
|
"@zip.js/zip.js": "^2.7.57",
|
|
343
|
-
"better-sqlite3": "^12.6.2",
|
|
344
330
|
"graphql": "^16.12.0",
|
|
331
|
+
"libsql": "^0.5.29",
|
|
345
332
|
"lodash": "^4.17.21",
|
|
346
333
|
"valibot": "^1.2.0"
|
|
347
334
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Download prebuilt binaries for common platforms
|
|
5
|
-
*
|
|
6
|
-
* Run this script before publishing to include prebuilt binaries for all common platforms
|
|
7
|
-
* Users can then use local prebuilt binaries directly (Option B)
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { execSync } from "child_process";
|
|
11
|
-
import fs from "fs";
|
|
12
|
-
import path from "path";
|
|
13
|
-
import { fileURLToPath } from "url";
|
|
14
|
-
|
|
15
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const __dirname = path.dirname(__filename);
|
|
17
|
-
|
|
18
|
-
const GREEN = "\x1b[32m";
|
|
19
|
-
const YELLOW = "\x1b[33m";
|
|
20
|
-
const RED = "\x1b[31m";
|
|
21
|
-
const BLUE = "\x1b[34m";
|
|
22
|
-
const NC = "\x1b[0m";
|
|
23
|
-
|
|
24
|
-
function log(message) {
|
|
25
|
-
console.log(message);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function logInfo(message) {
|
|
29
|
-
console.log(`${BLUE}${message}${NC}`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function logSuccess(message) {
|
|
33
|
-
console.log(`${GREEN}${message}${NC}`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function logWarning(message) {
|
|
37
|
-
console.log(`${YELLOW}${message}${NC}`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function logError(message) {
|
|
41
|
-
console.log(`${RED}${message}${NC}`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Platform list to download (extensive coverage)
|
|
45
|
-
// Node ABI versions: 127=Node 22, 120=Node 21, 115=Node 20, 108=Node 18, 93=Node 16
|
|
46
|
-
const TARGET_PLATFORMS = [
|
|
47
|
-
// ==================== Linux ====================
|
|
48
|
-
// Linux x64 (most common)
|
|
49
|
-
{ platform: "linux", arch: "x64", nodeAbi: "127" }, // Node 22
|
|
50
|
-
{ platform: "linux", arch: "x64", nodeAbi: "120" }, // Node 21
|
|
51
|
-
{ platform: "linux", arch: "x64", nodeAbi: "115" }, // Node 20
|
|
52
|
-
{ platform: "linux", arch: "x64", nodeAbi: "108" }, // Node 18
|
|
53
|
-
// Linux arm64 (ARM servers/Raspberry Pi)
|
|
54
|
-
{ platform: "linux", arch: "arm64", nodeAbi: "127" },
|
|
55
|
-
{ platform: "linux", arch: "arm64", nodeAbi: "120" },
|
|
56
|
-
{ platform: "linux", arch: "arm64", nodeAbi: "115" },
|
|
57
|
-
// Linux arm (32-bit ARM)
|
|
58
|
-
{ platform: "linux", arch: "arm", nodeAbi: "127" },
|
|
59
|
-
{ platform: "linux", arch: "arm", nodeAbi: "115" },
|
|
60
|
-
|
|
61
|
-
// ==================== macOS ====================
|
|
62
|
-
// macOS x64 (Intel Mac)
|
|
63
|
-
{ platform: "darwin", arch: "x64", nodeAbi: "127" },
|
|
64
|
-
{ platform: "darwin", arch: "x64", nodeAbi: "120" },
|
|
65
|
-
{ platform: "darwin", arch: "x64", nodeAbi: "115" },
|
|
66
|
-
{ platform: "darwin", arch: "x64", nodeAbi: "108" },
|
|
67
|
-
// macOS arm64 (Apple Silicon M1/M2/M3)
|
|
68
|
-
{ platform: "darwin", arch: "arm64", nodeAbi: "127" },
|
|
69
|
-
{ platform: "darwin", arch: "arm64", nodeAbi: "120" },
|
|
70
|
-
{ platform: "darwin", arch: "arm64", nodeAbi: "115" },
|
|
71
|
-
{ platform: "darwin", arch: "arm64", nodeAbi: "108" },
|
|
72
|
-
|
|
73
|
-
// ==================== Windows ====================
|
|
74
|
-
// Windows x64 (most common)
|
|
75
|
-
{ platform: "win32", arch: "x64", nodeAbi: "127" },
|
|
76
|
-
{ platform: "win32", arch: "x64", nodeAbi: "120" },
|
|
77
|
-
{ platform: "win32", arch: "x64", nodeAbi: "115" },
|
|
78
|
-
{ platform: "win32", arch: "x64", nodeAbi: "108" },
|
|
79
|
-
// Windows ia32 (32-bit Windows)
|
|
80
|
-
{ platform: "win32", arch: "ia32", nodeAbi: "127" },
|
|
81
|
-
{ platform: "win32", arch: "ia32", nodeAbi: "115" },
|
|
82
|
-
// Windows arm64 (Windows on ARM)
|
|
83
|
-
{ platform: "win32", arch: "arm64", nodeAbi: "127" },
|
|
84
|
-
{ platform: "win32", arch: "arm64", nodeAbi: "115" },
|
|
85
|
-
|
|
86
|
-
// ==================== FreeBSD ====================
|
|
87
|
-
{ platform: "freebsd", arch: "x64", nodeAbi: "127" },
|
|
88
|
-
{ platform: "freebsd", arch: "x64", nodeAbi: "115" },
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
function getBetterSqlite3Version() {
|
|
92
|
-
const packageJsonPath = path.join(
|
|
93
|
-
process.cwd(),
|
|
94
|
-
"node_modules",
|
|
95
|
-
"better-sqlite3",
|
|
96
|
-
"package.json",
|
|
97
|
-
);
|
|
98
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
99
|
-
throw new Error(
|
|
100
|
-
"better-sqlite3 not installed, please run npm install first",
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
104
|
-
return packageJson.version;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function downloadPrebuilt(version, platformInfo, prebuildsDir) {
|
|
108
|
-
const fullKey = `node-v${platformInfo.nodeAbi}-${platformInfo.platform}-${platformInfo.arch}`;
|
|
109
|
-
const downloadUrl = `https://github.com/WiseLibs/better-sqlite3/releases/download/v${version}/better-sqlite3-v${version}-${fullKey}.tar.gz`;
|
|
110
|
-
|
|
111
|
-
const tempFile = path.join(prebuildsDir, `.temp-${fullKey}.tar.gz`);
|
|
112
|
-
|
|
113
|
-
try {
|
|
114
|
-
// Download
|
|
115
|
-
if (process.platform === "win32") {
|
|
116
|
-
execSync(
|
|
117
|
-
`powershell -Command "Invoke-WebRequest -Uri '${downloadUrl}' -OutFile '${tempFile}'"`,
|
|
118
|
-
{
|
|
119
|
-
stdio: "pipe",
|
|
120
|
-
},
|
|
121
|
-
);
|
|
122
|
-
} else {
|
|
123
|
-
execSync(`curl -L -o "${tempFile}" "${downloadUrl}"`, {
|
|
124
|
-
stdio: "pipe",
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Extract
|
|
129
|
-
const extractDir = path.join(prebuildsDir, `.temp-${fullKey}`);
|
|
130
|
-
fs.mkdirSync(extractDir, { recursive: true });
|
|
131
|
-
execSync(`tar -xzf "${tempFile}" -C "${extractDir}"`, {
|
|
132
|
-
stdio: "pipe",
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
// Find extracted .node file
|
|
136
|
-
const files = fs.readdirSync(extractDir);
|
|
137
|
-
const nodeFile = files.find((f) => f.endsWith(".node"));
|
|
138
|
-
|
|
139
|
-
if (!nodeFile) {
|
|
140
|
-
throw new Error(".node file not found");
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Rename to standard format
|
|
144
|
-
const sourcePath = path.join(extractDir, nodeFile);
|
|
145
|
-
const targetName = `better-sqlite3-v${version}-${fullKey}.node`;
|
|
146
|
-
const targetPath = path.join(prebuildsDir, targetName);
|
|
147
|
-
|
|
148
|
-
fs.copyFileSync(sourcePath, targetPath);
|
|
149
|
-
|
|
150
|
-
// Cleanup temp files
|
|
151
|
-
fs.rmSync(extractDir, { recursive: true, force: true });
|
|
152
|
-
fs.unlinkSync(tempFile);
|
|
153
|
-
|
|
154
|
-
return targetName;
|
|
155
|
-
} catch (error) {
|
|
156
|
-
// Cleanup temp files
|
|
157
|
-
if (fs.existsSync(tempFile)) {
|
|
158
|
-
fs.unlinkSync(tempFile);
|
|
159
|
-
}
|
|
160
|
-
const tempDir = path.join(prebuildsDir, `.temp-${fullKey}`);
|
|
161
|
-
if (fs.existsSync(tempDir)) {
|
|
162
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
163
|
-
}
|
|
164
|
-
throw error;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function main() {
|
|
169
|
-
log(`${BLUE}=== Download better-sqlite3 Prebuilt Binaries ===${NC}`);
|
|
170
|
-
|
|
171
|
-
// Check if better-sqlite3 is installed
|
|
172
|
-
const betterSqlite3Path = path.join(
|
|
173
|
-
process.cwd(),
|
|
174
|
-
"node_modules",
|
|
175
|
-
"better-sqlite3",
|
|
176
|
-
);
|
|
177
|
-
if (!fs.existsSync(betterSqlite3Path)) {
|
|
178
|
-
logError("better-sqlite3 not installed, please run npm install first");
|
|
179
|
-
process.exit(1);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Get better-sqlite3 version
|
|
183
|
-
let version;
|
|
184
|
-
try {
|
|
185
|
-
version = getBetterSqlite3Version();
|
|
186
|
-
logInfo(`better-sqlite3 version: ${version}`);
|
|
187
|
-
} catch (error) {
|
|
188
|
-
logError(error.message);
|
|
189
|
-
process.exit(1);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// Create prebuilds directory
|
|
193
|
-
const prebuildsDir = path.join(process.cwd(), "prebuilds");
|
|
194
|
-
fs.mkdirSync(prebuildsDir, { recursive: true });
|
|
195
|
-
|
|
196
|
-
logInfo(`Prebuilt binaries will be saved to: ${prebuildsDir}`);
|
|
197
|
-
logInfo(`Target platforms: ${TARGET_PLATFORMS.length}`);
|
|
198
|
-
log("");
|
|
199
|
-
|
|
200
|
-
// Download prebuilt binaries for each platform
|
|
201
|
-
let successCount = 0;
|
|
202
|
-
let failCount = 0;
|
|
203
|
-
|
|
204
|
-
for (const platformInfo of TARGET_PLATFORMS) {
|
|
205
|
-
const fullKey = `node-v${platformInfo.nodeAbi}-${platformInfo.platform}-${platformInfo.arch}`;
|
|
206
|
-
const targetName = `better-sqlite3-v${version}-${fullKey}.node`;
|
|
207
|
-
const targetPath = path.join(prebuildsDir, targetName);
|
|
208
|
-
|
|
209
|
-
// Check if already exists
|
|
210
|
-
if (fs.existsSync(targetPath)) {
|
|
211
|
-
logSuccess(`✓ ${fullKey}: already exists`);
|
|
212
|
-
successCount++;
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
process.stdout.write(` Downloading ${fullKey}... `);
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
downloadPrebuilt(version, platformInfo, prebuildsDir);
|
|
220
|
-
logSuccess("success");
|
|
221
|
-
successCount++;
|
|
222
|
-
} catch (error) {
|
|
223
|
-
logWarning("failed");
|
|
224
|
-
failCount++;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
log("");
|
|
229
|
-
logSuccess(`========================================`);
|
|
230
|
-
logSuccess(
|
|
231
|
-
`Download complete: ${successCount} success, ${failCount} failed`,
|
|
232
|
-
);
|
|
233
|
-
logSuccess(`========================================`);
|
|
234
|
-
log("");
|
|
235
|
-
|
|
236
|
-
// List downloaded files
|
|
237
|
-
const files = fs
|
|
238
|
-
.readdirSync(prebuildsDir)
|
|
239
|
-
.filter((f) => f.endsWith(".node"));
|
|
240
|
-
logInfo("Downloaded prebuilt binaries:");
|
|
241
|
-
for (const file of files.sort()) {
|
|
242
|
-
const stats = fs.statSync(path.join(prebuildsDir, file));
|
|
243
|
-
const size = (stats.size / 1024 / 1024).toFixed(2);
|
|
244
|
-
log(` - ${file} (${size} MB)`);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
log("");
|
|
248
|
-
logInfo("Tip: These prebuilt binaries will be included in the npm package");
|
|
249
|
-
logInfo(" Users can install without network or compilation tools");
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
main();
|