@savecontext/dashboard 0.1.22 → 0.1.24
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/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/.next/standalone/dashboard/.next/app-path-routes-manifest.json +22 -22
- package/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/.next/standalone/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.html +17 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/checkpoints/[id]/items/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/context/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/create/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js +4 -4
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/subtasks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/issues/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/memory/save/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/create/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/delete/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/list/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/plans/update/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/stats/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/api/sessions/[id]/status/route_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/checkpoints/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/issues/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/memory/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/page.js +3 -3
- package/.next/standalone/dashboard/.next/server/app/dashboard/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js +2 -2
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/plans/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page.js.nft.json +1 -1
- package/.next/standalone/dashboard/.next/server/app/dashboard/sessions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/dashboard/.next/server/app-paths-manifest.json +22 -22
- package/.next/standalone/dashboard/.next/server/chunks/848.js +1 -1
- package/.next/standalone/dashboard/.next/server/pages/404.html +17 -1
- package/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/.next/standalone/dashboard/.next/static/chunks/{3358-27a1941db2941343.js → 3358-be1dcb412e5a5840.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/{5602-66df072f21a844c9.js → 5602-de6be5d495e39d30.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/{6736-41f13829c40765d8.js → 6736-2e5d92a3f8a9a938.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/checkpoints/{page-4b30b30c441a24c8.js → page-69c93b249f9f09f9.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-b176cdca78e8145d.js +1 -0
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/memory/{page-5b92aff45809fc6f.js → page-ffbe55f2b5b3a1a4.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/{page-8403ee5d448ed5a7.js → page-e7dfa69451ac3cf4.js} +2 -2
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/plans/{page-5203a84d31f5998c.js → page-aa014387d68c52ed.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/[id]/{page-094d2405b39c79d3.js → page-1acf5db28461761f.js} +1 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-bce106da597ef37a.js +1 -0
- package/.next/standalone/dashboard/package.json +8 -9
- package/.next/standalone/package.json +1 -1
- package/README.md +3 -5
- package/bin/savecontext-dashboard.js +6 -5
- package/package.json +8 -9
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/issues/page-8595961148b9e336.js +0 -1
- package/.next/standalone/dashboard/.next/static/chunks/app/dashboard/sessions/page-a6e839598a743003.js +0 -1
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/database.js +0 -90
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/index.js +0 -3
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/function.js +0 -31
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/table.js +0 -189
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/lib/util.js +0 -12
- package/.next/standalone/node_modules/.pnpm/better-sqlite3@12.5.0/node_modules/better-sqlite3/package.json +0 -59
- package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js +0 -221
- package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/package.json +0 -28
- package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js +0 -66
- package/.next/standalone/node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/package.json +0 -32
- package/.next/standalone/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/.next/standalone/node_modules/better-sqlite3/lib/database.js +0 -90
- package/.next/standalone/node_modules/better-sqlite3/lib/index.js +0 -3
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/aggregate.js +0 -43
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/backup.js +0 -67
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/function.js +0 -31
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/inspect.js +0 -7
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/pragma.js +0 -12
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/serialize.js +0 -16
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/table.js +0 -189
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/transaction.js +0 -78
- package/.next/standalone/node_modules/better-sqlite3/lib/methods/wrappers.js +0 -54
- package/.next/standalone/node_modules/better-sqlite3/lib/sqlite-error.js +0 -20
- package/.next/standalone/node_modules/better-sqlite3/lib/util.js +0 -12
- package/.next/standalone/node_modules/better-sqlite3/package.json +0 -59
- package/.next/standalone/node_modules/bindings/bindings.js +0 -221
- package/.next/standalone/node_modules/bindings/package.json +0 -28
- package/.next/standalone/node_modules/file-uri-to-path/index.js +0 -66
- package/.next/standalone/node_modules/file-uri-to-path/package.json +0 -32
- /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_buildManifest.js +0 -0
- /package/.next/standalone/dashboard/.next/static/{iXCD4qusgLaFdlD22YBUR → 00P-K7nRwpuQW1hq0VwZ5}/_ssgManifest.js +0 -0
package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Module dependencies.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
var fs = require('fs'),
|
|
6
|
-
path = require('path'),
|
|
7
|
-
fileURLToPath = require('file-uri-to-path'),
|
|
8
|
-
join = path.join,
|
|
9
|
-
dirname = path.dirname,
|
|
10
|
-
exists =
|
|
11
|
-
(fs.accessSync &&
|
|
12
|
-
function(path) {
|
|
13
|
-
try {
|
|
14
|
-
fs.accessSync(path);
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
return true;
|
|
19
|
-
}) ||
|
|
20
|
-
fs.existsSync ||
|
|
21
|
-
path.existsSync,
|
|
22
|
-
defaults = {
|
|
23
|
-
arrow: process.env.NODE_BINDINGS_ARROW || ' → ',
|
|
24
|
-
compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled',
|
|
25
|
-
platform: process.platform,
|
|
26
|
-
arch: process.arch,
|
|
27
|
-
nodePreGyp:
|
|
28
|
-
'node-v' +
|
|
29
|
-
process.versions.modules +
|
|
30
|
-
'-' +
|
|
31
|
-
process.platform +
|
|
32
|
-
'-' +
|
|
33
|
-
process.arch,
|
|
34
|
-
version: process.versions.node,
|
|
35
|
-
bindings: 'bindings.node',
|
|
36
|
-
try: [
|
|
37
|
-
// node-gyp's linked version in the "build" dir
|
|
38
|
-
['module_root', 'build', 'bindings'],
|
|
39
|
-
// node-waf and gyp_addon (a.k.a node-gyp)
|
|
40
|
-
['module_root', 'build', 'Debug', 'bindings'],
|
|
41
|
-
['module_root', 'build', 'Release', 'bindings'],
|
|
42
|
-
// Debug files, for development (legacy behavior, remove for node v0.9)
|
|
43
|
-
['module_root', 'out', 'Debug', 'bindings'],
|
|
44
|
-
['module_root', 'Debug', 'bindings'],
|
|
45
|
-
// Release files, but manually compiled (legacy behavior, remove for node v0.9)
|
|
46
|
-
['module_root', 'out', 'Release', 'bindings'],
|
|
47
|
-
['module_root', 'Release', 'bindings'],
|
|
48
|
-
// Legacy from node-waf, node <= 0.4.x
|
|
49
|
-
['module_root', 'build', 'default', 'bindings'],
|
|
50
|
-
// Production "Release" buildtype binary (meh...)
|
|
51
|
-
['module_root', 'compiled', 'version', 'platform', 'arch', 'bindings'],
|
|
52
|
-
// node-qbs builds
|
|
53
|
-
['module_root', 'addon-build', 'release', 'install-root', 'bindings'],
|
|
54
|
-
['module_root', 'addon-build', 'debug', 'install-root', 'bindings'],
|
|
55
|
-
['module_root', 'addon-build', 'default', 'install-root', 'bindings'],
|
|
56
|
-
// node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
|
|
57
|
-
['module_root', 'lib', 'binding', 'nodePreGyp', 'bindings']
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* The main `bindings()` function loads the compiled bindings for a given module.
|
|
63
|
-
* It uses V8's Error API to determine the parent filename that this function is
|
|
64
|
-
* being invoked from, which is then used to find the root directory.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
function bindings(opts) {
|
|
68
|
-
// Argument surgery
|
|
69
|
-
if (typeof opts == 'string') {
|
|
70
|
-
opts = { bindings: opts };
|
|
71
|
-
} else if (!opts) {
|
|
72
|
-
opts = {};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// maps `defaults` onto `opts` object
|
|
76
|
-
Object.keys(defaults).map(function(i) {
|
|
77
|
-
if (!(i in opts)) opts[i] = defaults[i];
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// Get the module root
|
|
81
|
-
if (!opts.module_root) {
|
|
82
|
-
opts.module_root = exports.getRoot(exports.getFileName());
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Ensure the given bindings name ends with .node
|
|
86
|
-
if (path.extname(opts.bindings) != '.node') {
|
|
87
|
-
opts.bindings += '.node';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// https://github.com/webpack/webpack/issues/4175#issuecomment-342931035
|
|
91
|
-
var requireFunc =
|
|
92
|
-
typeof __webpack_require__ === 'function'
|
|
93
|
-
? __non_webpack_require__
|
|
94
|
-
: require;
|
|
95
|
-
|
|
96
|
-
var tries = [],
|
|
97
|
-
i = 0,
|
|
98
|
-
l = opts.try.length,
|
|
99
|
-
n,
|
|
100
|
-
b,
|
|
101
|
-
err;
|
|
102
|
-
|
|
103
|
-
for (; i < l; i++) {
|
|
104
|
-
n = join.apply(
|
|
105
|
-
null,
|
|
106
|
-
opts.try[i].map(function(p) {
|
|
107
|
-
return opts[p] || p;
|
|
108
|
-
})
|
|
109
|
-
);
|
|
110
|
-
tries.push(n);
|
|
111
|
-
try {
|
|
112
|
-
b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
|
|
113
|
-
if (!opts.path) {
|
|
114
|
-
b.path = n;
|
|
115
|
-
}
|
|
116
|
-
return b;
|
|
117
|
-
} catch (e) {
|
|
118
|
-
if (e.code !== 'MODULE_NOT_FOUND' &&
|
|
119
|
-
e.code !== 'QUALIFIED_PATH_RESOLUTION_FAILED' &&
|
|
120
|
-
!/not find/i.test(e.message)) {
|
|
121
|
-
throw e;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
err = new Error(
|
|
127
|
-
'Could not locate the bindings file. Tried:\n' +
|
|
128
|
-
tries
|
|
129
|
-
.map(function(a) {
|
|
130
|
-
return opts.arrow + a;
|
|
131
|
-
})
|
|
132
|
-
.join('\n')
|
|
133
|
-
);
|
|
134
|
-
err.tries = tries;
|
|
135
|
-
throw err;
|
|
136
|
-
}
|
|
137
|
-
module.exports = exports = bindings;
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Gets the filename of the JavaScript file that invokes this function.
|
|
141
|
-
* Used to help find the root directory of a module.
|
|
142
|
-
* Optionally accepts an filename argument to skip when searching for the invoking filename
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
exports.getFileName = function getFileName(calling_file) {
|
|
146
|
-
var origPST = Error.prepareStackTrace,
|
|
147
|
-
origSTL = Error.stackTraceLimit,
|
|
148
|
-
dummy = {},
|
|
149
|
-
fileName;
|
|
150
|
-
|
|
151
|
-
Error.stackTraceLimit = 10;
|
|
152
|
-
|
|
153
|
-
Error.prepareStackTrace = function(e, st) {
|
|
154
|
-
for (var i = 0, l = st.length; i < l; i++) {
|
|
155
|
-
fileName = st[i].getFileName();
|
|
156
|
-
if (fileName !== __filename) {
|
|
157
|
-
if (calling_file) {
|
|
158
|
-
if (fileName !== calling_file) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
} else {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
// run the 'prepareStackTrace' function above
|
|
169
|
-
Error.captureStackTrace(dummy);
|
|
170
|
-
dummy.stack;
|
|
171
|
-
|
|
172
|
-
// cleanup
|
|
173
|
-
Error.prepareStackTrace = origPST;
|
|
174
|
-
Error.stackTraceLimit = origSTL;
|
|
175
|
-
|
|
176
|
-
// handle filename that starts with "file://"
|
|
177
|
-
var fileSchema = 'file://';
|
|
178
|
-
if (fileName.indexOf(fileSchema) === 0) {
|
|
179
|
-
fileName = fileURLToPath(fileName);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return fileName;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Gets the root directory of a module, given an arbitrary filename
|
|
187
|
-
* somewhere in the module tree. The "root directory" is the directory
|
|
188
|
-
* containing the `package.json` file.
|
|
189
|
-
*
|
|
190
|
-
* In: /home/nate/node-native-module/lib/index.js
|
|
191
|
-
* Out: /home/nate/node-native-module
|
|
192
|
-
*/
|
|
193
|
-
|
|
194
|
-
exports.getRoot = function getRoot(file) {
|
|
195
|
-
var dir = dirname(file),
|
|
196
|
-
prev;
|
|
197
|
-
while (true) {
|
|
198
|
-
if (dir === '.') {
|
|
199
|
-
// Avoids an infinite loop in rare cases, like the REPL
|
|
200
|
-
dir = process.cwd();
|
|
201
|
-
}
|
|
202
|
-
if (
|
|
203
|
-
exists(join(dir, 'package.json')) ||
|
|
204
|
-
exists(join(dir, 'node_modules'))
|
|
205
|
-
) {
|
|
206
|
-
// Found the 'package.json' file or 'node_modules' dir; we're done
|
|
207
|
-
return dir;
|
|
208
|
-
}
|
|
209
|
-
if (prev === dir) {
|
|
210
|
-
// Got to the top
|
|
211
|
-
throw new Error(
|
|
212
|
-
'Could not find module root given file: "' +
|
|
213
|
-
file +
|
|
214
|
-
'". Do you have a `package.json` file? '
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
// Try the parent dir next
|
|
218
|
-
prev = dir;
|
|
219
|
-
dir = join(dir, '..');
|
|
220
|
-
}
|
|
221
|
-
};
|
package/.next/standalone/node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/package.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "bindings",
|
|
3
|
-
"description": "Helper module for loading your native module's .node file",
|
|
4
|
-
"keywords": [
|
|
5
|
-
"native",
|
|
6
|
-
"addon",
|
|
7
|
-
"bindings",
|
|
8
|
-
"gyp",
|
|
9
|
-
"waf",
|
|
10
|
-
"c",
|
|
11
|
-
"c++"
|
|
12
|
-
],
|
|
13
|
-
"version": "1.5.0",
|
|
14
|
-
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git://github.com/TooTallNate/node-bindings.git"
|
|
18
|
-
},
|
|
19
|
-
"main": "./bindings.js",
|
|
20
|
-
"bugs": {
|
|
21
|
-
"url": "https://github.com/TooTallNate/node-bindings/issues"
|
|
22
|
-
},
|
|
23
|
-
"homepage": "https://github.com/TooTallNate/node-bindings",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"file-uri-to-path": "1.0.0"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Module dependencies.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
var sep = require('path').sep || '/';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Module exports.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
module.exports = fileUriToPath;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* File URI to Path function.
|
|
16
|
-
*
|
|
17
|
-
* @param {String} uri
|
|
18
|
-
* @return {String} path
|
|
19
|
-
* @api public
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
function fileUriToPath (uri) {
|
|
23
|
-
if ('string' != typeof uri ||
|
|
24
|
-
uri.length <= 7 ||
|
|
25
|
-
'file://' != uri.substring(0, 7)) {
|
|
26
|
-
throw new TypeError('must pass in a file:// URI to convert to a file path');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var rest = decodeURI(uri.substring(7));
|
|
30
|
-
var firstSlash = rest.indexOf('/');
|
|
31
|
-
var host = rest.substring(0, firstSlash);
|
|
32
|
-
var path = rest.substring(firstSlash + 1);
|
|
33
|
-
|
|
34
|
-
// 2. Scheme Definition
|
|
35
|
-
// As a special case, <host> can be the string "localhost" or the empty
|
|
36
|
-
// string; this is interpreted as "the machine from which the URL is
|
|
37
|
-
// being interpreted".
|
|
38
|
-
if ('localhost' == host) host = '';
|
|
39
|
-
|
|
40
|
-
if (host) {
|
|
41
|
-
host = sep + sep + host;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 3.2 Drives, drive letters, mount points, file system root
|
|
45
|
-
// Drive letters are mapped into the top of a file URI in various ways,
|
|
46
|
-
// depending on the implementation; some applications substitute
|
|
47
|
-
// vertical bar ("|") for the colon after the drive letter, yielding
|
|
48
|
-
// "file:///c|/tmp/test.txt". In some cases, the colon is left
|
|
49
|
-
// unchanged, as in "file:///c:/tmp/test.txt". In other cases, the
|
|
50
|
-
// colon is simply omitted, as in "file:///c/tmp/test.txt".
|
|
51
|
-
path = path.replace(/^(.+)\|/, '$1:');
|
|
52
|
-
|
|
53
|
-
// for Windows, we need to invert the path separators from what a URI uses
|
|
54
|
-
if (sep == '\\') {
|
|
55
|
-
path = path.replace(/\//g, '\\');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (/^.+\:/.test(path)) {
|
|
59
|
-
// has Windows drive at beginning of path
|
|
60
|
-
} else {
|
|
61
|
-
// unix path…
|
|
62
|
-
path = sep + path;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return host + path;
|
|
66
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "file-uri-to-path",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Convert a file: URI to a file path",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"directories": {
|
|
8
|
-
"test": "test"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "mocha --reporter spec"
|
|
12
|
-
},
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "git://github.com/TooTallNate/file-uri-to-path.git"
|
|
16
|
-
},
|
|
17
|
-
"keywords": [
|
|
18
|
-
"file",
|
|
19
|
-
"uri",
|
|
20
|
-
"convert",
|
|
21
|
-
"path"
|
|
22
|
-
],
|
|
23
|
-
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
|
24
|
-
"license": "MIT",
|
|
25
|
-
"bugs": {
|
|
26
|
-
"url": "https://github.com/TooTallNate/file-uri-to-path/issues"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://github.com/TooTallNate/file-uri-to-path",
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"mocha": "3"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
Binary file
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const util = require('./util');
|
|
5
|
-
const SqliteError = require('./sqlite-error');
|
|
6
|
-
|
|
7
|
-
let DEFAULT_ADDON;
|
|
8
|
-
|
|
9
|
-
function Database(filenameGiven, options) {
|
|
10
|
-
if (new.target == null) {
|
|
11
|
-
return new Database(filenameGiven, options);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Apply defaults
|
|
15
|
-
let buffer;
|
|
16
|
-
if (Buffer.isBuffer(filenameGiven)) {
|
|
17
|
-
buffer = filenameGiven;
|
|
18
|
-
filenameGiven = ':memory:';
|
|
19
|
-
}
|
|
20
|
-
if (filenameGiven == null) filenameGiven = '';
|
|
21
|
-
if (options == null) options = {};
|
|
22
|
-
|
|
23
|
-
// Validate arguments
|
|
24
|
-
if (typeof filenameGiven !== 'string') throw new TypeError('Expected first argument to be a string');
|
|
25
|
-
if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
|
|
26
|
-
if ('readOnly' in options) throw new TypeError('Misspelled option "readOnly" should be "readonly"');
|
|
27
|
-
if ('memory' in options) throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');
|
|
28
|
-
|
|
29
|
-
// Interpret options
|
|
30
|
-
const filename = filenameGiven.trim();
|
|
31
|
-
const anonymous = filename === '' || filename === ':memory:';
|
|
32
|
-
const readonly = util.getBooleanOption(options, 'readonly');
|
|
33
|
-
const fileMustExist = util.getBooleanOption(options, 'fileMustExist');
|
|
34
|
-
const timeout = 'timeout' in options ? options.timeout : 5000;
|
|
35
|
-
const verbose = 'verbose' in options ? options.verbose : null;
|
|
36
|
-
const nativeBinding = 'nativeBinding' in options ? options.nativeBinding : null;
|
|
37
|
-
|
|
38
|
-
// Validate interpreted options
|
|
39
|
-
if (readonly && anonymous && !buffer) throw new TypeError('In-memory/temporary databases cannot be readonly');
|
|
40
|
-
if (!Number.isInteger(timeout) || timeout < 0) throw new TypeError('Expected the "timeout" option to be a positive integer');
|
|
41
|
-
if (timeout > 0x7fffffff) throw new RangeError('Option "timeout" cannot be greater than 2147483647');
|
|
42
|
-
if (verbose != null && typeof verbose !== 'function') throw new TypeError('Expected the "verbose" option to be a function');
|
|
43
|
-
if (nativeBinding != null && typeof nativeBinding !== 'string' && typeof nativeBinding !== 'object') throw new TypeError('Expected the "nativeBinding" option to be a string or addon object');
|
|
44
|
-
|
|
45
|
-
// Load the native addon
|
|
46
|
-
let addon;
|
|
47
|
-
if (nativeBinding == null) {
|
|
48
|
-
addon = DEFAULT_ADDON || (DEFAULT_ADDON = require('bindings')('better_sqlite3.node'));
|
|
49
|
-
} else if (typeof nativeBinding === 'string') {
|
|
50
|
-
// See <https://webpack.js.org/api/module-variables/#__non_webpack_require__-webpack-specific>
|
|
51
|
-
const requireFunc = typeof __non_webpack_require__ === 'function' ? __non_webpack_require__ : require;
|
|
52
|
-
addon = requireFunc(path.resolve(nativeBinding).replace(/(\.node)?$/, '.node'));
|
|
53
|
-
} else {
|
|
54
|
-
// See <https://github.com/WiseLibs/better-sqlite3/issues/972>
|
|
55
|
-
addon = nativeBinding;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!addon.isInitialized) {
|
|
59
|
-
addon.setErrorConstructor(SqliteError);
|
|
60
|
-
addon.isInitialized = true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Make sure the specified directory exists
|
|
64
|
-
if (!anonymous && !filename.startsWith('file:') && !fs.existsSync(path.dirname(filename))) {
|
|
65
|
-
throw new TypeError('Cannot open database because the directory does not exist');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
Object.defineProperties(this, {
|
|
69
|
-
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
|
|
70
|
-
...wrappers.getters,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const wrappers = require('./methods/wrappers');
|
|
75
|
-
Database.prototype.prepare = wrappers.prepare;
|
|
76
|
-
Database.prototype.transaction = require('./methods/transaction');
|
|
77
|
-
Database.prototype.pragma = require('./methods/pragma');
|
|
78
|
-
Database.prototype.backup = require('./methods/backup');
|
|
79
|
-
Database.prototype.serialize = require('./methods/serialize');
|
|
80
|
-
Database.prototype.function = require('./methods/function');
|
|
81
|
-
Database.prototype.aggregate = require('./methods/aggregate');
|
|
82
|
-
Database.prototype.table = require('./methods/table');
|
|
83
|
-
Database.prototype.loadExtension = wrappers.loadExtension;
|
|
84
|
-
Database.prototype.exec = wrappers.exec;
|
|
85
|
-
Database.prototype.close = wrappers.close;
|
|
86
|
-
Database.prototype.defaultSafeIntegers = wrappers.defaultSafeIntegers;
|
|
87
|
-
Database.prototype.unsafeMode = wrappers.unsafeMode;
|
|
88
|
-
Database.prototype[util.inspect] = require('./methods/inspect');
|
|
89
|
-
|
|
90
|
-
module.exports = Database;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const { getBooleanOption, cppdb } = require('../util');
|
|
3
|
-
|
|
4
|
-
module.exports = function defineAggregate(name, options) {
|
|
5
|
-
// Validate arguments
|
|
6
|
-
if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
|
|
7
|
-
if (typeof options !== 'object' || options === null) throw new TypeError('Expected second argument to be an options object');
|
|
8
|
-
if (!name) throw new TypeError('User-defined function name cannot be an empty string');
|
|
9
|
-
|
|
10
|
-
// Interpret options
|
|
11
|
-
const start = 'start' in options ? options.start : null;
|
|
12
|
-
const step = getFunctionOption(options, 'step', true);
|
|
13
|
-
const inverse = getFunctionOption(options, 'inverse', false);
|
|
14
|
-
const result = getFunctionOption(options, 'result', false);
|
|
15
|
-
const safeIntegers = 'safeIntegers' in options ? +getBooleanOption(options, 'safeIntegers') : 2;
|
|
16
|
-
const deterministic = getBooleanOption(options, 'deterministic');
|
|
17
|
-
const directOnly = getBooleanOption(options, 'directOnly');
|
|
18
|
-
const varargs = getBooleanOption(options, 'varargs');
|
|
19
|
-
let argCount = -1;
|
|
20
|
-
|
|
21
|
-
// Determine argument count
|
|
22
|
-
if (!varargs) {
|
|
23
|
-
argCount = Math.max(getLength(step), inverse ? getLength(inverse) : 0);
|
|
24
|
-
if (argCount > 0) argCount -= 1;
|
|
25
|
-
if (argCount > 100) throw new RangeError('User-defined functions cannot have more than 100 arguments');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
this[cppdb].aggregate(start, step, inverse, result, name, argCount, safeIntegers, deterministic, directOnly);
|
|
29
|
-
return this;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const getFunctionOption = (options, key, required) => {
|
|
33
|
-
const value = key in options ? options[key] : null;
|
|
34
|
-
if (typeof value === 'function') return value;
|
|
35
|
-
if (value != null) throw new TypeError(`Expected the "${key}" option to be a function`);
|
|
36
|
-
if (required) throw new TypeError(`Missing required option "${key}"`);
|
|
37
|
-
return null;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const getLength = ({ length }) => {
|
|
41
|
-
if (Number.isInteger(length) && length >= 0) return length;
|
|
42
|
-
throw new TypeError('Expected function.length to be a positive integer');
|
|
43
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { promisify } = require('util');
|
|
5
|
-
const { cppdb } = require('../util');
|
|
6
|
-
const fsAccess = promisify(fs.access);
|
|
7
|
-
|
|
8
|
-
module.exports = async function backup(filename, options) {
|
|
9
|
-
if (options == null) options = {};
|
|
10
|
-
|
|
11
|
-
// Validate arguments
|
|
12
|
-
if (typeof filename !== 'string') throw new TypeError('Expected first argument to be a string');
|
|
13
|
-
if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
|
|
14
|
-
|
|
15
|
-
// Interpret options
|
|
16
|
-
filename = filename.trim();
|
|
17
|
-
const attachedName = 'attached' in options ? options.attached : 'main';
|
|
18
|
-
const handler = 'progress' in options ? options.progress : null;
|
|
19
|
-
|
|
20
|
-
// Validate interpreted options
|
|
21
|
-
if (!filename) throw new TypeError('Backup filename cannot be an empty string');
|
|
22
|
-
if (filename === ':memory:') throw new TypeError('Invalid backup filename ":memory:"');
|
|
23
|
-
if (typeof attachedName !== 'string') throw new TypeError('Expected the "attached" option to be a string');
|
|
24
|
-
if (!attachedName) throw new TypeError('The "attached" option cannot be an empty string');
|
|
25
|
-
if (handler != null && typeof handler !== 'function') throw new TypeError('Expected the "progress" option to be a function');
|
|
26
|
-
|
|
27
|
-
// Make sure the specified directory exists
|
|
28
|
-
await fsAccess(path.dirname(filename)).catch(() => {
|
|
29
|
-
throw new TypeError('Cannot save backup because the directory does not exist');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const isNewFile = await fsAccess(filename).then(() => false, () => true);
|
|
33
|
-
return runBackup(this[cppdb].backup(this, attachedName, filename, isNewFile), handler || null);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const runBackup = (backup, handler) => {
|
|
37
|
-
let rate = 0;
|
|
38
|
-
let useDefault = true;
|
|
39
|
-
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
setImmediate(function step() {
|
|
42
|
-
try {
|
|
43
|
-
const progress = backup.transfer(rate);
|
|
44
|
-
if (!progress.remainingPages) {
|
|
45
|
-
backup.close();
|
|
46
|
-
resolve(progress);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (useDefault) {
|
|
50
|
-
useDefault = false;
|
|
51
|
-
rate = 100;
|
|
52
|
-
}
|
|
53
|
-
if (handler) {
|
|
54
|
-
const ret = handler(progress);
|
|
55
|
-
if (ret !== undefined) {
|
|
56
|
-
if (typeof ret === 'number' && ret === ret) rate = Math.max(0, Math.min(0x7fffffff, Math.round(ret)));
|
|
57
|
-
else throw new TypeError('Expected progress callback to return a number or undefined');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
setImmediate(step);
|
|
61
|
-
} catch (err) {
|
|
62
|
-
backup.close();
|
|
63
|
-
reject(err);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const { getBooleanOption, cppdb } = require('../util');
|
|
3
|
-
|
|
4
|
-
module.exports = function defineFunction(name, options, fn) {
|
|
5
|
-
// Apply defaults
|
|
6
|
-
if (options == null) options = {};
|
|
7
|
-
if (typeof options === 'function') { fn = options; options = {}; }
|
|
8
|
-
|
|
9
|
-
// Validate arguments
|
|
10
|
-
if (typeof name !== 'string') throw new TypeError('Expected first argument to be a string');
|
|
11
|
-
if (typeof fn !== 'function') throw new TypeError('Expected last argument to be a function');
|
|
12
|
-
if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
|
|
13
|
-
if (!name) throw new TypeError('User-defined function name cannot be an empty string');
|
|
14
|
-
|
|
15
|
-
// Interpret options
|
|
16
|
-
const safeIntegers = 'safeIntegers' in options ? +getBooleanOption(options, 'safeIntegers') : 2;
|
|
17
|
-
const deterministic = getBooleanOption(options, 'deterministic');
|
|
18
|
-
const directOnly = getBooleanOption(options, 'directOnly');
|
|
19
|
-
const varargs = getBooleanOption(options, 'varargs');
|
|
20
|
-
let argCount = -1;
|
|
21
|
-
|
|
22
|
-
// Determine argument count
|
|
23
|
-
if (!varargs) {
|
|
24
|
-
argCount = fn.length;
|
|
25
|
-
if (!Number.isInteger(argCount) || argCount < 0) throw new TypeError('Expected function.length to be a positive integer');
|
|
26
|
-
if (argCount > 100) throw new RangeError('User-defined functions cannot have more than 100 arguments');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
this[cppdb].function(fn, name, argCount, safeIntegers, deterministic, directOnly);
|
|
30
|
-
return this;
|
|
31
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const { getBooleanOption, cppdb } = require('../util');
|
|
3
|
-
|
|
4
|
-
module.exports = function pragma(source, options) {
|
|
5
|
-
if (options == null) options = {};
|
|
6
|
-
if (typeof source !== 'string') throw new TypeError('Expected first argument to be a string');
|
|
7
|
-
if (typeof options !== 'object') throw new TypeError('Expected second argument to be an options object');
|
|
8
|
-
const simple = getBooleanOption(options, 'simple');
|
|
9
|
-
|
|
10
|
-
const stmt = this[cppdb].prepare(`PRAGMA ${source}`, this, true);
|
|
11
|
-
return simple ? stmt.pluck().get() : stmt.all();
|
|
12
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const { cppdb } = require('../util');
|
|
3
|
-
|
|
4
|
-
module.exports = function serialize(options) {
|
|
5
|
-
if (options == null) options = {};
|
|
6
|
-
|
|
7
|
-
// Validate arguments
|
|
8
|
-
if (typeof options !== 'object') throw new TypeError('Expected first argument to be an options object');
|
|
9
|
-
|
|
10
|
-
// Interpret and validate options
|
|
11
|
-
const attachedName = 'attached' in options ? options.attached : 'main';
|
|
12
|
-
if (typeof attachedName !== 'string') throw new TypeError('Expected the "attached" option to be a string');
|
|
13
|
-
if (!attachedName) throw new TypeError('The "attached" option cannot be an empty string');
|
|
14
|
-
|
|
15
|
-
return this[cppdb].serialize(attachedName);
|
|
16
|
-
};
|