@camstack/system 1.2.485 → 1.2.487
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/dist/{agent-https-DBP7P-ee.js → agent-https-0EEnqeUL.js} +1 -1
- package/dist/{agent-https-_EXvi6F8.mjs → agent-https-C24nO-la.mjs} +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/actuator-dispatch.d.ts +13 -0
- package/dist/builtins/composer/actuator-groups.d.ts +54 -0
- package/dist/builtins/composer/actuator-invoke.d.ts +11 -0
- package/dist/builtins/composer/composed-device.d.ts +13 -24
- package/dist/builtins/composer/composer.addon.js +464 -18
- package/dist/builtins/composer/composer.addon.mjs +464 -18
- package/dist/builtins/composer/composer.d.ts +11 -1
- package/dist/builtins/composer/composition-runtime.d.ts +2 -0
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/composition-sources.d.ts +3 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +53 -28
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +53 -28
- package/dist/builtins/device-history/device-history.addon.js +2 -2
- package/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BnZpIA8u.mjs → composition-sources-BA2e5vh_.mjs} +4 -2
- package/dist/{composition-sources-BSQneZV9.js → composition-sources-BulDAgW2.js} +4 -2
- package/dist/{constants-CQfTeCnB.js → constants-BntdWx4k.js} +1 -1
- package/dist/{constants-7D7xjw0h.mjs → constants-DZKo4kM2.mjs} +1 -1
- package/dist/{device-ca-D_4dI5gv.js → device-ca-BuRg4V4x.js} +1 -1
- package/dist/{device-ca-Bzd6UO_c.mjs → device-ca-DXm8IH3p.mjs} +1 -1
- package/dist/{dist-xCNJAQMh.js → dist-CrsVjBbk.js} +1127 -26
- package/dist/{dist-Df6c0RX_.mjs → dist-Dfwxsc_Y.mjs} +1062 -27
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-D7GMnEz0.mjs → hub-mdns-ciao-BbI8MNtQ.mjs} +2 -2
- package/dist/{hub-mdns-ciao-DRfmLR_Z.js → hub-mdns-ciao-CLroVKhP.js} +2 -2
- package/dist/index.js +7 -7
- package/dist/index.mjs +7 -7
- package/dist/{restore-archive-Co70oRya.mjs → restore-archive-BB5QxUIe.mjs} +82 -82
- package/dist/{restore-archive-DA7N6ZZA.js → restore-archive-CPoja7N3.js} +1 -1
- package/dist/{retention-DNDOPW7Z.js → retention-DgA4qLBj.js} +1 -1
- package/dist/{retention-DfCW-dZS.mjs → retention-Dz5t6cWO.mjs} +1 -1
- package/dist/{wal-maintenance-71-j48Ci.mjs → wal-maintenance-BJi3_DBN.mjs} +0 -0
- package/dist/{wal-maintenance-CA0L6WZ9.js → wal-maintenance-CL9hrbnn.js} +0 -0
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as DataStoreDatabaseSchema, aa as defineRecordKinds, x as DATABASE_SNAPSHOT_SUFFIX } from "./dist-Dfwxsc_Y.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createCipheriv, createDecipheriv, createHash, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from "node:crypto";
|
|
4
4
|
import { Buffer as Buffer$1 } from "buffer";
|
|
5
5
|
import * as fsp from "node:fs/promises";
|
|
6
6
|
import jn from "node:fs/promises";
|
|
7
|
-
import * as path$
|
|
7
|
+
import * as path$2 from "node:path";
|
|
8
8
|
import path, { basename, join, posix, win32 } from "node:path";
|
|
9
|
-
import * as fs$
|
|
9
|
+
import * as fs$3 from "node:fs";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import { EventEmitter } from "node:events";
|
|
12
|
-
import
|
|
12
|
+
import Pe, { Transform } from "node:stream";
|
|
13
13
|
import { StringDecoder } from "node:string_decoder";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import fs$1 from "fs";
|
|
15
|
+
import path$1, { dirname as dirname$1, parse } from "path";
|
|
16
16
|
import * as Ms from "zlib";
|
|
17
17
|
import Jr from "zlib";
|
|
18
18
|
import Pi from "assert";
|
|
@@ -459,7 +459,7 @@ async function readBackupEncryptionHeader(file) {
|
|
|
459
459
|
async function decryptBackupFile(input, output, secretKey) {
|
|
460
460
|
const decrypt = createBackupDecryptStream(secretKey);
|
|
461
461
|
try {
|
|
462
|
-
await pipeline(fs$
|
|
462
|
+
await pipeline(fs$3.createReadStream(input), decrypt, fs$3.createWriteStream(output, { mode: 384 }));
|
|
463
463
|
} catch (err) {
|
|
464
464
|
await fsp.rm(output, { force: true }).catch(() => void 0);
|
|
465
465
|
throw err;
|
|
@@ -477,7 +477,7 @@ var Br = (s, t) => {
|
|
|
477
477
|
var xs = typeof process == "object" && process ? process : {
|
|
478
478
|
stdout: null,
|
|
479
479
|
stderr: null
|
|
480
|
-
}, zr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof
|
|
480
|
+
}, zr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof Pe || Ur(s) || Hr(s)), Ur = (s) => !!s && typeof s == "object" && s instanceof EventEmitter && typeof s.pipe == "function" && s.pipe !== Pe.Writable.prototype.pipe, Hr = (s) => !!s && typeof s == "object" && s instanceof EventEmitter && typeof s.write == "function" && typeof s.end == "function", q = Symbol("EOF"), Q = Symbol("maybeEmitEnd"), rt = Symbol("emittedEnd"), Le = Symbol("emittingEnd"), qt = Symbol("emittedError"), Ne = Symbol("closed"), Ls = Symbol("read"), De = Symbol("flush"), Ns = Symbol("flushChunk"), z$1 = Symbol("encoding"), Mt = Symbol("decoder"), g = Symbol("flowing"), Qt = Symbol("paused"), Bt = Symbol("resume"), b = Symbol("buffer"), D = Symbol("pipes"), _ = Symbol("bufferLength"), gi = Symbol("bufferPush"), Ae = Symbol("bufferShift"), L = Symbol("objectMode"), w = Symbol("destroyed"), bi = Symbol("error"), _i = Symbol("emitData"), Ds = Symbol("emitEnd"), Oi = Symbol("emitEnd2"), Z = Symbol("async"), Ti = Symbol("abort"), Ie = Symbol("aborted"), Jt = Symbol("signal"), Rt = Symbol("dataListeners"), F = Symbol("discarded"), jt = (s) => Promise.resolve().then(s), Wr = (s) => s(), Gr = (s) => s === "end" || s === "finish" || s === "prefinish", Zr = (s) => s instanceof ArrayBuffer || !!s && typeof s == "object" && s.constructor && s.constructor.name === "ArrayBuffer" && s.byteLength >= 0, Yr = (s) => !Buffer.isBuffer(s) && ArrayBuffer.isView(s), Fe = class {
|
|
481
481
|
src;
|
|
482
482
|
dest;
|
|
483
483
|
opts;
|
|
@@ -797,7 +797,7 @@ while (this[Ns](this[Ae]()) && this[b].length);
|
|
|
797
797
|
return zr;
|
|
798
798
|
}
|
|
799
799
|
};
|
|
800
|
-
var Xr =
|
|
800
|
+
var Xr = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol("_ended"), m = Symbol("_fd"), Ni = Symbol("_finished"), j = Symbol("_flags"), Di = Symbol("_flush"), Ci = Symbol("_handleChunk"), ki = Symbol("_makeBuf"), ie = Symbol("_mode"), Ce = Symbol("_needDrain"), Ut = Symbol("_onerror"), Ht = Symbol("_onopen"), Ai = Symbol("_onread"), Pt = Symbol("_onwrite"), ht = Symbol("_open"), U = Symbol("_path"), nt = Symbol("_pos"), Y = Symbol("_queue"), zt = Symbol("_read"), Ii = Symbol("_readSize"), J = Symbol("_reading"), ee = Symbol("_remain"), Fi = Symbol("_size"), ke = Symbol("_write"), gt = Symbol("_writing"), ve = Symbol("_defaultFlag"), bt = Symbol("_errored"), _t = class extends A {
|
|
801
801
|
[bt] = !1;
|
|
802
802
|
[m];
|
|
803
803
|
[U];
|
|
@@ -823,7 +823,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
823
823
|
throw new TypeError("this is a readable stream");
|
|
824
824
|
}
|
|
825
825
|
[ht]() {
|
|
826
|
-
|
|
826
|
+
fs$1.open(this[U], "r", (t, e) => this[Ht](t, e));
|
|
827
827
|
}
|
|
828
828
|
[Ht](t, e) {
|
|
829
829
|
t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[zt]());
|
|
@@ -836,7 +836,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
836
836
|
this[J] = !0;
|
|
837
837
|
let t = this[ki]();
|
|
838
838
|
if (t.length === 0) return process.nextTick(() => this[Ai](null, 0, t));
|
|
839
|
-
|
|
839
|
+
fs$1.read(this[m], t, 0, t.length, null, (e, i, r) => this[Ai](e, i, r));
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
[Ai](t, e, i) {
|
|
@@ -845,7 +845,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
845
845
|
[H]() {
|
|
846
846
|
if (this[ot] && typeof this[m] == "number") {
|
|
847
847
|
let t = this[m];
|
|
848
|
-
this[m] = void 0,
|
|
848
|
+
this[m] = void 0, fs$1.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
[Ut](t) {
|
|
@@ -868,7 +868,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
868
868
|
[ht]() {
|
|
869
869
|
let t = !0;
|
|
870
870
|
try {
|
|
871
|
-
this[Ht](null,
|
|
871
|
+
this[Ht](null, fs$1.openSync(this[U], "r")), t = !1;
|
|
872
872
|
} finally {
|
|
873
873
|
t && this[H]();
|
|
874
874
|
}
|
|
@@ -879,7 +879,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
879
879
|
if (!this[J]) {
|
|
880
880
|
this[J] = !0;
|
|
881
881
|
do {
|
|
882
|
-
let e = this[ki](), i = e.length === 0 ? 0 :
|
|
882
|
+
let e = this[ki](), i = e.length === 0 ? 0 : fs$1.readSync(this[m], e, 0, e.length, null);
|
|
883
883
|
if (!this[Ci](i, e)) break;
|
|
884
884
|
} while (!0);
|
|
885
885
|
this[J] = !1;
|
|
@@ -892,7 +892,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
892
892
|
[H]() {
|
|
893
893
|
if (this[ot] && typeof this[m] == "number") {
|
|
894
894
|
let t = this[m];
|
|
895
|
-
this[m] = void 0,
|
|
895
|
+
this[m] = void 0, fs$1.closeSync(t), this.emit("close");
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
}, tt = class extends $r {
|
|
@@ -933,7 +933,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
933
933
|
this[H](), this[gt] = !0, this.emit("error", t);
|
|
934
934
|
}
|
|
935
935
|
[ht]() {
|
|
936
|
-
|
|
936
|
+
fs$1.open(this[U], this[j], this[ie], (t, e) => this[Ht](t, e));
|
|
937
937
|
}
|
|
938
938
|
[Ht](t, e) {
|
|
939
939
|
this[ve] && this[j] === "r+" && t && t.code === "ENOENT" ? (this[j] = "w", this[ht]()) : t ? this[Ut](t) : (this[m] = e, this.emit("open", e), this[gt] || this[Di]());
|
|
@@ -945,7 +945,7 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
945
945
|
return typeof t == "string" && (t = Buffer.from(t, e)), this[te] ? (this.emit("error", /* @__PURE__ */ new Error("write() after end()")), !1) : this[m] === void 0 || this[gt] || this[Y].length ? (this[Y].push(t), this[Ce] = !0, !1) : (this[gt] = !0, this[ke](t), !0);
|
|
946
946
|
}
|
|
947
947
|
[ke](t) {
|
|
948
|
-
|
|
948
|
+
fs$1.write(this[m], t, 0, t.length, this[nt], (e, i) => this[Pt](e, i));
|
|
949
949
|
}
|
|
950
950
|
[Pt](t, e) {
|
|
951
951
|
t ? this[Ut](t) : (this[nt] !== void 0 && typeof e == "number" && (this[nt] += e), this[Y].length ? this[Di]() : (this[gt] = !1, this[te] && !this[Ni] ? (this[Ni] = !0, this[H](), this.emit("finish")) : this[Ce] && (this[Ce] = !1, this.emit("drain"))));
|
|
@@ -961,31 +961,31 @@ var Xr = I.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symbol(
|
|
|
961
961
|
[H]() {
|
|
962
962
|
if (this[ot] && typeof this[m] == "number") {
|
|
963
963
|
let t = this[m];
|
|
964
|
-
this[m] = void 0,
|
|
964
|
+
this[m] = void 0, fs$1.close(t, (e) => e ? this.emit("error", e) : this.emit("close"));
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
}, Wt = class extends tt {
|
|
968
968
|
[ht]() {
|
|
969
969
|
let t;
|
|
970
970
|
if (this[ve] && this[j] === "r+") try {
|
|
971
|
-
t =
|
|
971
|
+
t = fs$1.openSync(this[U], this[j], this[ie]);
|
|
972
972
|
} catch (e) {
|
|
973
973
|
if (e?.code === "ENOENT") return this[j] = "w", this[ht]();
|
|
974
974
|
throw e;
|
|
975
975
|
}
|
|
976
|
-
else t =
|
|
976
|
+
else t = fs$1.openSync(this[U], this[j], this[ie]);
|
|
977
977
|
this[Ht](null, t);
|
|
978
978
|
}
|
|
979
979
|
[H]() {
|
|
980
980
|
if (this[ot] && typeof this[m] == "number") {
|
|
981
981
|
let t = this[m];
|
|
982
|
-
this[m] = void 0,
|
|
982
|
+
this[m] = void 0, fs$1.closeSync(t), this.emit("close");
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
[ke](t) {
|
|
986
986
|
let e = !0;
|
|
987
987
|
try {
|
|
988
|
-
this[Pt](null,
|
|
988
|
+
this[Pt](null, fs$1.writeSync(this[m], t, 0, t.length, this[nt])), e = !1;
|
|
989
989
|
} finally {
|
|
990
990
|
if (e) try {
|
|
991
991
|
this[H]();
|
|
@@ -1268,7 +1268,7 @@ var tn = Buffer$1.concat, Bs = Object.getOwnPropertyDescriptor(Buffer$1, "concat
|
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
1270
|
};
|
|
1271
|
-
var Pe = class extends Be {
|
|
1271
|
+
var Pe$1 = class extends Be {
|
|
1272
1272
|
#t;
|
|
1273
1273
|
constructor(t) {
|
|
1274
1274
|
super(t, "Gzip"), this.#t = t && !!t.portable;
|
|
@@ -1945,7 +1945,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1945
1945
|
let [o, a] = le(this.path);
|
|
1946
1946
|
o && typeof a == "string" && (this.path = a, r = o);
|
|
1947
1947
|
}
|
|
1948
|
-
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = $s(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute ||
|
|
1948
|
+
this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = $s(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || path$1.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
|
|
1949
1949
|
entry: this,
|
|
1950
1950
|
path: r + this.path
|
|
1951
1951
|
});
|
|
@@ -1959,7 +1959,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
1959
1959
|
return t === "error" && (this.#t = !0), super.emit(t, ...e);
|
|
1960
1960
|
}
|
|
1961
1961
|
[es]() {
|
|
1962
|
-
|
|
1962
|
+
fs$1.lstat(this.absolute, (t, e) => {
|
|
1963
1963
|
if (t) return this.emit("error", t);
|
|
1964
1964
|
this[ii](e);
|
|
1965
1965
|
});
|
|
@@ -2018,7 +2018,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2018
2018
|
this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[ce](), this.end();
|
|
2019
2019
|
}
|
|
2020
2020
|
[ts]() {
|
|
2021
|
-
|
|
2021
|
+
fs$1.readlink(this.absolute, (t, e) => {
|
|
2022
2022
|
if (t) return this.emit("error", t);
|
|
2023
2023
|
this[ss](e);
|
|
2024
2024
|
});
|
|
@@ -2028,7 +2028,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2028
2028
|
}
|
|
2029
2029
|
[tr](t) {
|
|
2030
2030
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
2031
|
-
this.type = "Link", this.linkpath = f(
|
|
2031
|
+
this.type = "Link", this.linkpath = f(path$1.relative(this.cwd, t)), this.stat.size = 0, this[ce](), this.end();
|
|
2032
2032
|
}
|
|
2033
2033
|
[Js]() {
|
|
2034
2034
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -2041,7 +2041,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2041
2041
|
this[rs]();
|
|
2042
2042
|
}
|
|
2043
2043
|
[rs]() {
|
|
2044
|
-
|
|
2044
|
+
fs$1.open(this.absolute, "r", (t, e) => {
|
|
2045
2045
|
if (t) return this.emit("error", t);
|
|
2046
2046
|
this[ns](e);
|
|
2047
2047
|
});
|
|
@@ -2056,13 +2056,13 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2056
2056
|
[ei]() {
|
|
2057
2057
|
let { fd: t, buf: e, offset: i, length: r, pos: n } = this;
|
|
2058
2058
|
if (t === void 0 || e === void 0) throw new Error("cannot read file without first opening");
|
|
2059
|
-
|
|
2059
|
+
fs$1.read(t, e, i, r, n, (o, a) => {
|
|
2060
2060
|
if (o) return this[pt](() => this.emit("error", o));
|
|
2061
2061
|
this[is](a);
|
|
2062
2062
|
});
|
|
2063
2063
|
}
|
|
2064
2064
|
[pt](t = () => {}) {
|
|
2065
|
-
this.fd !== void 0 &&
|
|
2065
|
+
this.fd !== void 0 && fs$1.close(this.fd, t);
|
|
2066
2066
|
}
|
|
2067
2067
|
[is](t) {
|
|
2068
2068
|
if (t <= 0 && this.remain > 0) {
|
|
@@ -2104,20 +2104,20 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2104
2104
|
}, ri = class extends fe {
|
|
2105
2105
|
sync = !0;
|
|
2106
2106
|
[es]() {
|
|
2107
|
-
this[ii](
|
|
2107
|
+
this[ii](fs$1.lstatSync(this.absolute));
|
|
2108
2108
|
}
|
|
2109
2109
|
[ts]() {
|
|
2110
|
-
this[ss](
|
|
2110
|
+
this[ss](fs$1.readlinkSync(this.absolute));
|
|
2111
2111
|
}
|
|
2112
2112
|
[rs]() {
|
|
2113
|
-
this[ns](
|
|
2113
|
+
this[ns](fs$1.openSync(this.absolute, "r"));
|
|
2114
2114
|
}
|
|
2115
2115
|
[ei]() {
|
|
2116
2116
|
let t = !0;
|
|
2117
2117
|
try {
|
|
2118
2118
|
let { fd: e, buf: i, offset: r, length: n, pos: o } = this;
|
|
2119
2119
|
if (e === void 0 || i === void 0) throw new Error("fd and buf must be set in READ method");
|
|
2120
|
-
let a =
|
|
2120
|
+
let a = fs$1.readSync(e, i, r, n, o);
|
|
2121
2121
|
this[is](a), t = !1;
|
|
2122
2122
|
} finally {
|
|
2123
2123
|
if (t) try {
|
|
@@ -2129,7 +2129,7 @@ var er = (s, t) => t ? (s = f(s).replace(/^\.(\/|$)/, ""), mt(t) + "/" + s) : f(
|
|
|
2129
2129
|
t();
|
|
2130
2130
|
}
|
|
2131
2131
|
[pt](t = () => {}) {
|
|
2132
|
-
this.fd !== void 0 &&
|
|
2132
|
+
this.fd !== void 0 && fs$1.closeSync(this.fd), t();
|
|
2133
2133
|
}
|
|
2134
2134
|
}, ni = class extends A {
|
|
2135
2135
|
blockLen = 0;
|
|
@@ -2397,7 +2397,7 @@ var mi = class {
|
|
|
2397
2397
|
constructor(t, e) {
|
|
2398
2398
|
this.path = t || "./", this.absolute = e;
|
|
2399
2399
|
}
|
|
2400
|
-
}, ir = Buffer.alloc(1024), ai = Symbol("onStat"), ue = Symbol("ended"), W = Symbol("queue"), me = Symbol("pendingLinks"), Et = Symbol("current"), Ct = Symbol("process"), pe = Symbol("processing"), hi = Symbol("processJob"), G = Symbol("jobs"), hs = Symbol("jobDone"), li = Symbol("addFSEntry"), sr = Symbol("addTarEntry"), cs = Symbol("stat"), fs$
|
|
2400
|
+
}, ir = Buffer.alloc(1024), ai = Symbol("onStat"), ue = Symbol("ended"), W = Symbol("queue"), me = Symbol("pendingLinks"), Et = Symbol("current"), Ct = Symbol("process"), pe = Symbol("processing"), hi = Symbol("processJob"), G = Symbol("jobs"), hs = Symbol("jobDone"), li = Symbol("addFSEntry"), sr = Symbol("addTarEntry"), cs = Symbol("stat"), fs$2 = Symbol("readdir"), ci = Symbol("onreaddir"), fi = Symbol("pipe"), rr = Symbol("entry"), as = Symbol("entryOpt"), di = Symbol("writeEntryClass"), or = Symbol("write"), ls = Symbol("ondrain"), wt = class extends A {
|
|
2401
2401
|
sync = !1;
|
|
2402
2402
|
opt;
|
|
2403
2403
|
cwd;
|
|
@@ -2428,7 +2428,7 @@ var mi = class {
|
|
|
2428
2428
|
constructor(t = {}) {
|
|
2429
2429
|
if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[di] = fe, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
|
|
2430
2430
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
2431
|
-
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new Pe(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new He(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ze(t.zstd)), !this.zip) throw new Error("impossible");
|
|
2431
|
+
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new Pe$1(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new He(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ze(t.zstd)), !this.zip) throw new Error("impossible");
|
|
2432
2432
|
let e = this.zip;
|
|
2433
2433
|
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[ls]()), this.on("resume", () => e.resume());
|
|
2434
2434
|
} else this.on("drain", this[ls]);
|
|
@@ -2448,7 +2448,7 @@ var mi = class {
|
|
|
2448
2448
|
return typeof t == "string" ? this[li](t) : this[sr](t), this.flowing;
|
|
2449
2449
|
}
|
|
2450
2450
|
[sr](t) {
|
|
2451
|
-
let e = f(
|
|
2451
|
+
let e = f(path$1.resolve(this.cwd, t.path));
|
|
2452
2452
|
if (!this.filter(t.path, t)) t.resume();
|
|
2453
2453
|
else {
|
|
2454
2454
|
let i = new mi(t.path, e);
|
|
@@ -2457,12 +2457,12 @@ var mi = class {
|
|
|
2457
2457
|
this[Ct]();
|
|
2458
2458
|
}
|
|
2459
2459
|
[li](t) {
|
|
2460
|
-
let e = f(
|
|
2460
|
+
let e = f(path$1.resolve(this.cwd, t));
|
|
2461
2461
|
this[W].push(new mi(t, e)), this[Ct]();
|
|
2462
2462
|
}
|
|
2463
2463
|
[cs](t) {
|
|
2464
2464
|
t.pending = !0, this[G] += 1;
|
|
2465
|
-
|
|
2465
|
+
fs$1[this.follow ? "stat" : "lstat"](t.absolute, (i, r) => {
|
|
2466
2466
|
t.pending = !1, this[G] -= 1, i ? this.emit("error", i) : this[ai](t, r);
|
|
2467
2467
|
});
|
|
2468
2468
|
}
|
|
@@ -2475,8 +2475,8 @@ var mi = class {
|
|
|
2475
2475
|
}
|
|
2476
2476
|
this[Ct]();
|
|
2477
2477
|
}
|
|
2478
|
-
[fs$
|
|
2479
|
-
t.pending = !0, this[G] += 1,
|
|
2478
|
+
[fs$2](t) {
|
|
2479
|
+
t.pending = !0, this[G] += 1, fs$1.readdir(t.absolute, (e, i) => {
|
|
2480
2480
|
if (t.pending = !1, this[G] -= 1, e) return this.emit("error", e);
|
|
2481
2481
|
this[ci](t, i);
|
|
2482
2482
|
});
|
|
@@ -2522,7 +2522,7 @@ var mi = class {
|
|
|
2522
2522
|
if (t.stat && !t.ignore) {
|
|
2523
2523
|
if (!this.noDirRecurse && t.stat.isDirectory() && !t.readdir) {
|
|
2524
2524
|
let e = this.readdirCache.get(t.absolute);
|
|
2525
|
-
if (e ? this[ci](t, e) : this[fs$
|
|
2525
|
+
if (e ? this[ci](t, e) : this[fs$2](t), !t.readdir) return;
|
|
2526
2526
|
}
|
|
2527
2527
|
if (t.entry = this[rr](t), !t.entry) {
|
|
2528
2528
|
t.ignore = !0;
|
|
@@ -2589,10 +2589,10 @@ var mi = class {
|
|
|
2589
2589
|
resume() {}
|
|
2590
2590
|
[cs](t) {
|
|
2591
2591
|
let e = this.follow ? "statSync" : "lstatSync";
|
|
2592
|
-
this[ai](t,
|
|
2592
|
+
this[ai](t, fs$1[e](t.absolute));
|
|
2593
2593
|
}
|
|
2594
|
-
[fs$
|
|
2595
|
-
this[ci](t,
|
|
2594
|
+
[fs$2](t) {
|
|
2595
|
+
this[ci](t, fs$1.readdirSync(t.absolute));
|
|
2596
2596
|
}
|
|
2597
2597
|
[fi](t) {
|
|
2598
2598
|
let e = t.entry, i = this.zip;
|
|
@@ -2644,7 +2644,7 @@ var Wn = (s, t) => {
|
|
|
2644
2644
|
}, Kn = K(Wn, Gn, Zn, Yn, (s, t) => {
|
|
2645
2645
|
if (!t?.length) throw new TypeError("no paths specified to add to archive");
|
|
2646
2646
|
});
|
|
2647
|
-
var ur = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", { O_CREAT: mr, O_NOFOLLOW: cr, O_TRUNC: pr, O_WRONLY: Er } =
|
|
2647
|
+
var ur = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", { O_CREAT: mr, O_NOFOLLOW: cr, O_TRUNC: pr, O_WRONLY: Er } = fs$1.constants, wr = Number(process.env.__FAKE_FS_O_FILENAME__) || fs$1.constants.UV_FS_O_FILEMAP || 0, $n = ur && !!wr, Xn = 512 * 1024, qn = wr | pr | mr | Er, fr = !ur && typeof cr == "number" ? cr | pr | mr | Er : null, ds = fr !== null ? () => fr : $n ? (s) => s < Xn ? qn : "w" : () => "w";
|
|
2648
2648
|
var us = (s, t, e) => {
|
|
2649
2649
|
try {
|
|
2650
2650
|
return fs.lchownSync(s, t, e);
|
|
@@ -3630,8 +3630,8 @@ var SystemBackupService = class {
|
|
|
3630
3630
|
return value;
|
|
3631
3631
|
}
|
|
3632
3632
|
async statLocation(loc) {
|
|
3633
|
-
const abs = path$
|
|
3634
|
-
if (!fs$
|
|
3633
|
+
const abs = path$2.isAbsolute(loc) ? loc : path$2.join(this.dataDir, loc);
|
|
3634
|
+
if (!fs$3.existsSync(abs)) return {
|
|
3635
3635
|
name: loc,
|
|
3636
3636
|
sizeBytes: 0,
|
|
3637
3637
|
fileCount: 0,
|
|
@@ -3677,19 +3677,19 @@ var SystemBackupService = class {
|
|
|
3677
3677
|
if (!selection.has("settings")) return this.createSnapshotsOnlyArchive(opts, selection, recipient);
|
|
3678
3678
|
const present = [];
|
|
3679
3679
|
for (const loc of requested) {
|
|
3680
|
-
const abs = path$
|
|
3681
|
-
if (fs$
|
|
3680
|
+
const abs = path$2.isAbsolute(loc) ? loc : path$2.join(this.dataDir, loc);
|
|
3681
|
+
if (fs$3.existsSync(abs)) present.push(loc);
|
|
3682
3682
|
else this.logger.debug("createArchive: skipping missing location", { meta: { location: loc } });
|
|
3683
3683
|
}
|
|
3684
3684
|
if (present.length === 0) throw new Error(`createArchive: no locations from {${requested.join(", ")}} exist under ${this.dataDir}`);
|
|
3685
|
-
fs$
|
|
3685
|
+
fs$3.mkdirSync(path$2.dirname(opts.archivePath), { recursive: true });
|
|
3686
3686
|
const walked = [];
|
|
3687
3687
|
for (const loc of present) {
|
|
3688
3688
|
throwIfCancelled(opts.signal);
|
|
3689
|
-
const abs = path$
|
|
3689
|
+
const abs = path$2.join(this.dataDir, loc);
|
|
3690
3690
|
const stat = await fsp.stat(abs);
|
|
3691
3691
|
if (stat.isDirectory()) for (const e of await walkAbs(abs, this.dataDir, this.exclusionPredicate(), opts.signal)) walked.push(e);
|
|
3692
|
-
else if (!isExcludedFromBackup(path$
|
|
3692
|
+
else if (!isExcludedFromBackup(path$2.relative(this.dataDir, abs))) walked.push(toArchiveEntry(abs, this.dataDir, stat));
|
|
3693
3693
|
}
|
|
3694
3694
|
const walkedPaths = new Set(walked.map((e) => e.path));
|
|
3695
3695
|
const ownedById = walked.some((e) => isSqlitePath(e.path)) ? await this.ownedDatabasesInScope(opts.owner, walkedPaths) : /* @__PURE__ */ new Map();
|
|
@@ -3766,7 +3766,7 @@ var SystemBackupService = class {
|
|
|
3766
3766
|
*/
|
|
3767
3767
|
async createSnapshotsOnlyArchive(opts, selection, recipient) {
|
|
3768
3768
|
if (opts.owner === void 0) throw new BackupSnapshotRefusedError("a snapshots-only archive needs the database owner, and none was given");
|
|
3769
|
-
fs$
|
|
3769
|
+
fs$3.mkdirSync(path$2.dirname(opts.archivePath), { recursive: true });
|
|
3770
3770
|
const ownedById = await this.ownedDatabasesInScope(opts.owner, null);
|
|
3771
3771
|
const selected = /* @__PURE__ */ new Map();
|
|
3772
3772
|
for (const [rel, databaseId] of ownedById) if (selection.has(databaseId)) selected.set(rel, databaseId);
|
|
@@ -3820,7 +3820,7 @@ var SystemBackupService = class {
|
|
|
3820
3820
|
async writeArchive(opts) {
|
|
3821
3821
|
const { present, manifest } = opts;
|
|
3822
3822
|
const manifestStagePath = `${opts.archivePath}.${process.pid}.manifest.json`;
|
|
3823
|
-
fs$
|
|
3823
|
+
fs$3.writeFileSync(manifestStagePath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
3824
3824
|
this.logger.info("createArchive: tarring", { meta: {
|
|
3825
3825
|
archivePath: opts.archivePath,
|
|
3826
3826
|
locations: [...present],
|
|
@@ -3828,10 +3828,10 @@ var SystemBackupService = class {
|
|
|
3828
3828
|
totalBytes: manifest.totalBytes
|
|
3829
3829
|
} });
|
|
3830
3830
|
try {
|
|
3831
|
-
const stagedInDataDir = path$
|
|
3832
|
-
fs$
|
|
3833
|
-
const stagingRel = path$
|
|
3834
|
-
const excludePrefix = stagingRel && !stagingRel.startsWith("..") && !path$
|
|
3831
|
+
const stagedInDataDir = path$2.join(this.dataDir, ARCHIVE_MANIFEST_NAME);
|
|
3832
|
+
fs$3.copyFileSync(manifestStagePath, stagedInDataDir);
|
|
3833
|
+
const stagingRel = path$2.relative(this.dataDir, path$2.dirname(opts.archivePath));
|
|
3834
|
+
const excludePrefix = stagingRel && !stagingRel.startsWith("..") && !path$2.isAbsolute(stagingRel) ? stagingRel : null;
|
|
3835
3835
|
try {
|
|
3836
3836
|
const pack = Kn({
|
|
3837
3837
|
gzip: true,
|
|
@@ -3845,29 +3845,29 @@ var SystemBackupService = class {
|
|
|
3845
3845
|
return norm !== excludePrefix && !norm.startsWith(`${excludePrefix}/`);
|
|
3846
3846
|
}
|
|
3847
3847
|
}, [ARCHIVE_MANIFEST_NAME, ...opts.tarRoots ?? present]);
|
|
3848
|
-
const sink = fs$
|
|
3848
|
+
const sink = fs$3.createWriteStream(opts.archivePath, { mode: 384 });
|
|
3849
3849
|
try {
|
|
3850
3850
|
const streamOpts = opts.signal ? { signal: opts.signal } : {};
|
|
3851
3851
|
if (opts.encryptTo !== void 0) await pipeline(pack, createBackupEncryptStream(opts.encryptTo), byteCountingPassthrough(opts.onArchiveBytes), sink, streamOpts);
|
|
3852
3852
|
else await pipeline(pack, byteCountingPassthrough(opts.onArchiveBytes), sink, streamOpts);
|
|
3853
3853
|
} catch (err) {
|
|
3854
3854
|
try {
|
|
3855
|
-
fs$
|
|
3855
|
+
fs$3.rmSync(opts.archivePath, { force: true });
|
|
3856
3856
|
} catch {}
|
|
3857
3857
|
if (opts.signal?.aborted) throw new BackupCancelledError();
|
|
3858
3858
|
throw err;
|
|
3859
3859
|
}
|
|
3860
3860
|
} finally {
|
|
3861
3861
|
try {
|
|
3862
|
-
fs$
|
|
3862
|
+
fs$3.rmSync(stagedInDataDir, { force: true });
|
|
3863
3863
|
} catch {}
|
|
3864
3864
|
}
|
|
3865
3865
|
} finally {
|
|
3866
3866
|
try {
|
|
3867
|
-
fs$
|
|
3867
|
+
fs$3.rmSync(manifestStagePath, { force: true });
|
|
3868
3868
|
} catch {}
|
|
3869
3869
|
}
|
|
3870
|
-
const sizeBytes = fs$
|
|
3870
|
+
const sizeBytes = fs$3.statSync(opts.archivePath).size;
|
|
3871
3871
|
return {
|
|
3872
3872
|
archivePath: opts.archivePath,
|
|
3873
3873
|
includedLocations: [...present],
|
|
@@ -3880,7 +3880,7 @@ var SystemBackupService = class {
|
|
|
3880
3880
|
* one entry we care about, then aborts.
|
|
3881
3881
|
*/
|
|
3882
3882
|
async readArchiveManifest(archivePath) {
|
|
3883
|
-
if (!fs$
|
|
3883
|
+
if (!fs$3.existsSync(archivePath)) throw new Error(`readArchiveManifest: ${archivePath} does not exist`);
|
|
3884
3884
|
return new Promise((resolve, reject) => {
|
|
3885
3885
|
const chunks = [];
|
|
3886
3886
|
let found = false;
|
|
@@ -3912,7 +3912,7 @@ var SystemBackupService = class {
|
|
|
3912
3912
|
reject(err);
|
|
3913
3913
|
}
|
|
3914
3914
|
});
|
|
3915
|
-
const reader = fs$
|
|
3915
|
+
const reader = fs$3.createReadStream(archivePath);
|
|
3916
3916
|
reader.on("error", (err) => {
|
|
3917
3917
|
if (!resolved) {
|
|
3918
3918
|
resolved = true;
|
|
@@ -3930,7 +3930,7 @@ var SystemBackupService = class {
|
|
|
3930
3930
|
* restart.
|
|
3931
3931
|
*/
|
|
3932
3932
|
scheduleRestoreMarker(opts) {
|
|
3933
|
-
if (!fs$
|
|
3933
|
+
if (!fs$3.existsSync(opts.archivePath)) throw new Error(`scheduleRestoreMarker: ${opts.archivePath} missing`);
|
|
3934
3934
|
const markerPath = this.getRestoreMarkerPath();
|
|
3935
3935
|
const marker = {
|
|
3936
3936
|
archivePath: opts.archivePath,
|
|
@@ -3938,16 +3938,16 @@ var SystemBackupService = class {
|
|
|
3938
3938
|
source: opts.source,
|
|
3939
3939
|
...opts.locations ? { locations: [...opts.locations] } : {}
|
|
3940
3940
|
};
|
|
3941
|
-
fs$
|
|
3942
|
-
fs$
|
|
3941
|
+
fs$3.mkdirSync(path$2.dirname(markerPath), { recursive: true });
|
|
3942
|
+
fs$3.writeFileSync(markerPath, JSON.stringify(marker, null, 2), { mode: 384 });
|
|
3943
3943
|
return markerPath;
|
|
3944
3944
|
}
|
|
3945
3945
|
/** Read the pending-restore marker if one is present. */
|
|
3946
3946
|
readPendingMarker() {
|
|
3947
3947
|
const markerPath = this.getRestoreMarkerPath();
|
|
3948
|
-
if (!fs$
|
|
3948
|
+
if (!fs$3.existsSync(markerPath)) return null;
|
|
3949
3949
|
try {
|
|
3950
|
-
const raw = fs$
|
|
3950
|
+
const raw = fs$3.readFileSync(markerPath, "utf-8");
|
|
3951
3951
|
const parsed = JSON.parse(raw);
|
|
3952
3952
|
if (typeof parsed === "object" && parsed != null && typeof parsed.archivePath === "string") return parsed;
|
|
3953
3953
|
} catch (err) {
|
|
@@ -3958,7 +3958,7 @@ var SystemBackupService = class {
|
|
|
3958
3958
|
/** Drop the marker after a successful boot-time restore. */
|
|
3959
3959
|
clearPendingMarker() {
|
|
3960
3960
|
const markerPath = this.getRestoreMarkerPath();
|
|
3961
|
-
if (fs$
|
|
3961
|
+
if (fs$3.existsSync(markerPath)) fs$3.rmSync(markerPath, { force: true });
|
|
3962
3962
|
}
|
|
3963
3963
|
/**
|
|
3964
3964
|
* The databases the owner declares, archive-relative, that this walk found,
|
|
@@ -4002,7 +4002,7 @@ var SystemBackupService = class {
|
|
|
4002
4002
|
*/
|
|
4003
4003
|
async takeOwnerSnapshots(owner, selected, signal) {
|
|
4004
4004
|
const removeOwnedSnapshots = async () => {
|
|
4005
|
-
for (const db of selected.keys()) await this.removeSnapshot(path$
|
|
4005
|
+
for (const db of selected.keys()) await this.removeSnapshot(path$2.join(this.dataDir, db + DATABASE_SNAPSHOT_SUFFIX));
|
|
4006
4006
|
};
|
|
4007
4007
|
const taken = [];
|
|
4008
4008
|
try {
|
|
@@ -4047,7 +4047,7 @@ var SystemBackupService = class {
|
|
|
4047
4047
|
}
|
|
4048
4048
|
if (snapshotPath !== livePath + ".backup-snapshot") throw new BackupSnapshotRefusedError(`snapshot ${snapshotPath} does not sit beside the database ${livePath} it copies`);
|
|
4049
4049
|
if (livePath !== expectedLive || result.databaseId !== databaseId) throw new BackupSnapshotRefusedError(`snapshot copies ${livePath} (${result.databaseId}), but ${databaseId} (${expectedLive}) was asked for`);
|
|
4050
|
-
const absPath = path$
|
|
4050
|
+
const absPath = path$2.join(this.dataDir, snapshotPath);
|
|
4051
4051
|
const stat = await fsp.stat(absPath);
|
|
4052
4052
|
this.logger.info("createArchive: carrying the owner snapshot in place of the live database", { meta: {
|
|
4053
4053
|
database: livePath,
|
|
@@ -4080,12 +4080,12 @@ var SystemBackupService = class {
|
|
|
4080
4080
|
}
|
|
4081
4081
|
/** `abs` relative to the data root, or null when it lies outside it. */
|
|
4082
4082
|
archiveRelative(abs) {
|
|
4083
|
-
const rel = path$
|
|
4084
|
-
if (rel.length === 0 || rel.startsWith("..") || path$
|
|
4083
|
+
const rel = path$2.relative(path$2.resolve(this.dataDir), path$2.resolve(abs));
|
|
4084
|
+
if (rel.length === 0 || rel.startsWith("..") || path$2.isAbsolute(rel)) return null;
|
|
4085
4085
|
return normalizeArchivePath(rel);
|
|
4086
4086
|
}
|
|
4087
4087
|
getRestoreMarkerPath() {
|
|
4088
|
-
return path$
|
|
4088
|
+
return path$2.join(this.dataDir, ".pending-restore.json");
|
|
4089
4089
|
}
|
|
4090
4090
|
/**
|
|
4091
4091
|
* Absolute-path form of {@link isExcludedFromBackup}, anchored on
|
|
@@ -4093,7 +4093,7 @@ var SystemBackupService = class {
|
|
|
4093
4093
|
* stats so both agree with the tar filter about what a backup contains.
|
|
4094
4094
|
*/
|
|
4095
4095
|
exclusionPredicate() {
|
|
4096
|
-
return (abs) => isExcludedFromBackup(path$
|
|
4096
|
+
return (abs) => isExcludedFromBackup(path$2.relative(this.dataDir, abs));
|
|
4097
4097
|
}
|
|
4098
4098
|
};
|
|
4099
4099
|
/**
|
|
@@ -4124,7 +4124,7 @@ async function walkRec(abs, dataDir, out, shouldSkip, signal) {
|
|
|
4124
4124
|
} catch {
|
|
4125
4125
|
return;
|
|
4126
4126
|
}
|
|
4127
|
-
for (const child of children) await walkRec(path$
|
|
4127
|
+
for (const child of children) await walkRec(path$2.join(abs, child), dataDir, out, shouldSkip, signal);
|
|
4128
4128
|
}
|
|
4129
4129
|
}
|
|
4130
4130
|
/**
|
|
@@ -4141,10 +4141,10 @@ function byteCountingPassthrough(onBytes) {
|
|
|
4141
4141
|
} });
|
|
4142
4142
|
}
|
|
4143
4143
|
function toArchiveEntry(abs, dataDir, stat) {
|
|
4144
|
-
const rel = path$
|
|
4144
|
+
const rel = path$2.relative(dataDir, abs).replace(/\\/g, "/");
|
|
4145
4145
|
const kind = stat.isDirectory() ? "dir" : stat.isSymbolicLink() ? "symlink" : "file";
|
|
4146
4146
|
return {
|
|
4147
|
-
path: rel || path$
|
|
4147
|
+
path: rel || path$2.basename(abs),
|
|
4148
4148
|
kind,
|
|
4149
4149
|
sizeBytes: kind === "file" ? stat.size : 0,
|
|
4150
4150
|
mtime: stat.mtimeMs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-CrsVjBbk.js");
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Si as HISTORY_DEFAULT_MIN_INTERVAL_MS, di as DeviceType, ua as historyItemFieldPath } from "./dist-Dfwxsc_Y.mjs";
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
Binary file
|
|
Binary file
|