@camstack/system 1.2.462 → 1.2.464
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/addon-utils.mjs +1 -1
- package/dist/{agent-https-CC7jpktS.mjs → agent-https-B9gbXoJI.mjs} +1 -1
- package/dist/{agent-https-C6M6apPV.js → agent-https-DhFIbEwN.js} +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 +4 -4
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- 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 +5 -5
- 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/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- 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 +5 -5
- 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 +10 -10
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +8 -8
- 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 +20 -20
- 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 +282 -282
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BlcYzFwY.mjs → composition-sources-CGtooHSL.mjs} +1 -1
- package/dist/{composition-sources-BPnpB9XG.js → composition-sources-oXvmbMHX.js} +1 -1
- package/dist/{constants-7ZMxWr8Z.js → constants-5mrGZxwS.js} +1 -1
- package/dist/{constants-CH5UXe_G.mjs → constants-CdutnpL9.mjs} +1 -1
- package/dist/{coral-accelerators-Qhn5TOYZ.mjs → coral-accelerators-D_S1Fo5h.mjs} +5 -5
- package/dist/{custom-action-registry-DZSCLBuT.mjs → custom-action-registry-BGYDjTqY.mjs} +37 -37
- package/dist/{device-ca-CUEx7sti.js → device-ca-B3xUzps7.js} +1 -1
- package/dist/{device-ca-BU_gnd-q.mjs → device-ca-DZHKlZlD.mjs} +1 -1
- package/dist/{dist-8tWIDoWp.mjs → dist-C2OBCa-A.mjs} +25 -25
- package/dist/{dist-Ct-4tTeX.js → dist-D9aw_d0G.js} +25 -25
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-Cuy7LUdz.mjs → hub-mdns-ciao-Bm09NrMS.mjs} +2 -2
- package/dist/{hub-mdns-ciao-DJ-Amqd7.js → hub-mdns-ciao-CFlhVKK6.js} +2 -2
- package/dist/index.js +7 -7
- package/dist/index.mjs +225 -225
- package/dist/{restore-archive-HwOA83v3.js → restore-archive-6zkRREHO.js} +1 -1
- package/dist/{restore-archive-BDua3jO6.mjs → restore-archive-D6sS7Gt2.mjs} +146 -146
- package/dist/{wal-maintenance-BvzVehem.mjs → wal-maintenance-Dg6IzSgz.mjs} +0 -0
- package/dist/{wal-maintenance-DBvuVU9s.js → wal-maintenance-jXcOxm2T.js} +0 -0
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { N as DataStoreDatabaseSchema, S as DATABASE_SNAPSHOT_SUFFIX, Ui as defineRecordKinds } from "./dist-
|
|
1
|
+
import { N as DataStoreDatabaseSchema, S as DATABASE_SNAPSHOT_SUFFIX, Ui as defineRecordKinds } from "./dist-C2OBCa-A.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$1 from "node:path";
|
|
8
8
|
import path, { basename, join, posix, win32 } from "node:path";
|
|
9
|
-
import * as fs$
|
|
10
|
-
import
|
|
9
|
+
import * as fs$1 from "node:fs";
|
|
10
|
+
import Kt from "node:fs";
|
|
11
11
|
import { EventEmitter } from "node:events";
|
|
12
12
|
import As, { Transform } from "node:stream";
|
|
13
13
|
import { StringDecoder } from "node:string_decoder";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import I from "fs";
|
|
15
|
+
import qs, { 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$1.createReadStream(input), decrypt, fs$1.createWriteStream(output, { mode: 384 }));
|
|
463
463
|
} catch (err) {
|
|
464
464
|
await fsp.rm(output, { force: true }).catch(() => void 0);
|
|
465
465
|
throw err;
|
|
@@ -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 = I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
823
823
|
throw new TypeError("this is a readable stream");
|
|
824
824
|
}
|
|
825
825
|
[ht]() {
|
|
826
|
-
|
|
826
|
+
I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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
|
+
I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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, I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
868
868
|
[ht]() {
|
|
869
869
|
let t = !0;
|
|
870
870
|
try {
|
|
871
|
-
this[Ht](null,
|
|
871
|
+
this[Ht](null, I.openSync(this[U], "r")), t = !1;
|
|
872
872
|
} finally {
|
|
873
873
|
t && this[H]();
|
|
874
874
|
}
|
|
@@ -879,7 +879,7 @@ var Xr = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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 : I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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, I.closeSync(t), this.emit("close");
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
898
|
}, tt = class extends $r {
|
|
@@ -933,7 +933,7 @@ var Xr = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
933
933
|
this[H](), this[gt] = !0, this.emit("error", t);
|
|
934
934
|
}
|
|
935
935
|
[ht]() {
|
|
936
|
-
|
|
936
|
+
I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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
|
+
I.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 = fs$1.writev, ot = Symbol("_autoClose"), H = Symbol("_close"), te = Symb
|
|
|
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, I.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 = I.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 = I.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, I.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, I.writeSync(this[m], t, 0, t.length, this[nt])), e = !1;
|
|
989
989
|
} finally {
|
|
990
990
|
if (e) try {
|
|
991
991
|
this[H]();
|
|
@@ -1854,15 +1854,15 @@ var An = (s) => {
|
|
|
1854
1854
|
}, In = (s) => {
|
|
1855
1855
|
let t = new st(s), e = s.file, i;
|
|
1856
1856
|
try {
|
|
1857
|
-
i =
|
|
1858
|
-
let r =
|
|
1857
|
+
i = Kt.openSync(e, "r");
|
|
1858
|
+
let r = Kt.fstatSync(i), n = s.maxReadSize || 16 * 1024 * 1024;
|
|
1859
1859
|
if (r.size < n) {
|
|
1860
|
-
let o = Buffer.allocUnsafe(r.size), a =
|
|
1860
|
+
let o = Buffer.allocUnsafe(r.size), a = Kt.readSync(i, o, 0, r.size, 0);
|
|
1861
1861
|
t.end(a === o.byteLength ? o : o.subarray(0, a));
|
|
1862
1862
|
} else {
|
|
1863
1863
|
let o = 0, a = Buffer.allocUnsafe(n);
|
|
1864
1864
|
for (; o < r.size;) {
|
|
1865
|
-
let h =
|
|
1865
|
+
let h = Kt.readSync(i, a, 0, n, o);
|
|
1866
1866
|
if (h === 0) break;
|
|
1867
1867
|
o += h, t.write(a.subarray(0, h));
|
|
1868
1868
|
}
|
|
@@ -1870,13 +1870,13 @@ var An = (s) => {
|
|
|
1870
1870
|
}
|
|
1871
1871
|
} finally {
|
|
1872
1872
|
if (typeof i == "number") try {
|
|
1873
|
-
|
|
1873
|
+
Kt.closeSync(i);
|
|
1874
1874
|
} catch {}
|
|
1875
1875
|
}
|
|
1876
1876
|
}, Fn = (s, t) => {
|
|
1877
1877
|
let e = new st(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
|
|
1878
1878
|
return new Promise((o, a) => {
|
|
1879
|
-
e.on("error", a), e.on("end", o),
|
|
1879
|
+
e.on("error", a), e.on("end", o), Kt.stat(r, (h, l) => {
|
|
1880
1880
|
if (h) a(h);
|
|
1881
1881
|
else {
|
|
1882
1882
|
let c = new _t(r, {
|
|
@@ -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 || qs.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
|
+
I.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
|
+
I.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(qs.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
|
+
I.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
|
+
I.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 && I.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](I.lstatSync(this.absolute));
|
|
2108
2108
|
}
|
|
2109
2109
|
[ts]() {
|
|
2110
|
-
this[ss](
|
|
2110
|
+
this[ss](I.readlinkSync(this.absolute));
|
|
2111
2111
|
}
|
|
2112
2112
|
[rs]() {
|
|
2113
|
-
this[ns](
|
|
2113
|
+
this[ns](I.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 = I.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 && I.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 = 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;
|
|
@@ -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(qs.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(qs.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
|
+
I[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](t) {
|
|
2479
|
+
t.pending = !0, this[G] += 1, I.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](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, I[e](t.absolute));
|
|
2593
2593
|
}
|
|
2594
|
-
[fs
|
|
2595
|
-
this[ci](t,
|
|
2594
|
+
[fs](t) {
|
|
2595
|
+
this[ci](t, I.readdirSync(t.absolute));
|
|
2596
2596
|
}
|
|
2597
2597
|
[fi](t) {
|
|
2598
2598
|
let e = t.entry, i = this.zip;
|
|
@@ -2644,15 +2644,15 @@ 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 } = I.constants, wr = Number(process.env.__FAKE_FS_O_FILENAME__) || I.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
|
-
return
|
|
2650
|
+
return Kt.lchownSync(s, t, e);
|
|
2651
2651
|
} catch (i) {
|
|
2652
2652
|
if (i?.code !== "ENOENT") throw i;
|
|
2653
2653
|
}
|
|
2654
2654
|
}, pi = (s, t, e, i) => {
|
|
2655
|
-
|
|
2655
|
+
Kt.lchown(s, t, e, (r) => {
|
|
2656
2656
|
i(r && r?.code !== "ENOENT" ? r : null);
|
|
2657
2657
|
});
|
|
2658
2658
|
}, Qn = (s, t, e, i, r) => {
|
|
@@ -2662,7 +2662,7 @@ var us = (s, t, e) => {
|
|
|
2662
2662
|
});
|
|
2663
2663
|
else pi(path.resolve(s, t.name), e, i, r);
|
|
2664
2664
|
}, ms = (s, t, e, i) => {
|
|
2665
|
-
|
|
2665
|
+
Kt.readdir(s, { withFileTypes: !0 }, (r, n) => {
|
|
2666
2666
|
if (r) {
|
|
2667
2667
|
if (r.code === "ENOENT") return i();
|
|
2668
2668
|
if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i(r);
|
|
@@ -2681,7 +2681,7 @@ var us = (s, t, e) => {
|
|
|
2681
2681
|
}, ps = (s, t, e) => {
|
|
2682
2682
|
let i;
|
|
2683
2683
|
try {
|
|
2684
|
-
i =
|
|
2684
|
+
i = Kt.readdirSync(s, { withFileTypes: !0 });
|
|
2685
2685
|
} catch (r) {
|
|
2686
2686
|
let n = r;
|
|
2687
2687
|
if (n?.code === "ENOENT") return;
|
|
@@ -2715,13 +2715,13 @@ var St = class extends Error {
|
|
|
2715
2715
|
}
|
|
2716
2716
|
};
|
|
2717
2717
|
var to = (s, t) => {
|
|
2718
|
-
|
|
2718
|
+
Kt.stat(s, (e, i) => {
|
|
2719
2719
|
(e || !i.isDirectory()) && (e = new we(s, e?.code || "ENOTDIR")), t(e);
|
|
2720
2720
|
});
|
|
2721
2721
|
}, Sr = (s, t, e) => {
|
|
2722
2722
|
s = f(s);
|
|
2723
2723
|
let i = t.umask ?? 18, r = t.mode | 448, n = (r & i) !== 0, o = t.uid, a = t.gid, h = typeof o == "number" && typeof a == "number" && (o !== t.processUid || a !== t.processGid), l = t.preserve, c = t.unlink, d = f(t.cwd), S = (E, x) => {
|
|
2724
|
-
E ? e(E) : x && h ? ms(x, o, a, (xe) => S(xe)) : n ?
|
|
2724
|
+
E ? e(E) : x && h ? ms(x, o, a, (xe) => S(xe)) : n ? Kt.chmod(s, r, e) : e();
|
|
2725
2725
|
};
|
|
2726
2726
|
if (s === d) return to(s, S);
|
|
2727
2727
|
if (l) return jn.mkdir(s, {
|
|
@@ -2732,14 +2732,14 @@ var to = (s, t) => {
|
|
|
2732
2732
|
}, Es = (s, t, e, i, r, n, o) => {
|
|
2733
2733
|
if (t.length === 0) return o(null, n);
|
|
2734
2734
|
let a = t.shift(), h = f(path.resolve(s + "/" + a));
|
|
2735
|
-
|
|
2735
|
+
Kt.mkdir(h, e, yr(h, t, e, i, r, n, o));
|
|
2736
2736
|
}, yr = (s, t, e, i, r, n, o) => (a) => {
|
|
2737
|
-
a ?
|
|
2737
|
+
a ? Kt.lstat(s, (h, l) => {
|
|
2738
2738
|
if (h) h.path = h.path && f(h.path), o(h);
|
|
2739
2739
|
else if (l.isDirectory()) Es(s, t, e, i, r, n, o);
|
|
2740
|
-
else if (i)
|
|
2740
|
+
else if (i) Kt.unlink(s, (c) => {
|
|
2741
2741
|
if (c) return o(c);
|
|
2742
|
-
|
|
2742
|
+
Kt.mkdir(s, e, yr(s, t, e, i, r, n, o));
|
|
2743
2743
|
});
|
|
2744
2744
|
else {
|
|
2745
2745
|
if (l.isSymbolicLink()) return o(new St(s, s + "/" + t.join("/")));
|
|
@@ -2749,7 +2749,7 @@ var to = (s, t) => {
|
|
|
2749
2749
|
}, eo = (s) => {
|
|
2750
2750
|
let t = !1, e;
|
|
2751
2751
|
try {
|
|
2752
|
-
t =
|
|
2752
|
+
t = Kt.statSync(s).isDirectory();
|
|
2753
2753
|
} catch (i) {
|
|
2754
2754
|
e = i?.code;
|
|
2755
2755
|
} finally {
|
|
@@ -2758,10 +2758,10 @@ var to = (s, t) => {
|
|
|
2758
2758
|
}, Rr = (s, t) => {
|
|
2759
2759
|
s = f(s);
|
|
2760
2760
|
let e = t.umask ?? 18, i = t.mode | 448, r = (i & e) !== 0, n = t.uid, o = t.gid, a = typeof n == "number" && typeof o == "number" && (n !== t.processUid || o !== t.processGid), h = t.preserve, l = t.unlink, c = f(t.cwd), d = (E) => {
|
|
2761
|
-
E && a && ps(E, n, o), r &&
|
|
2761
|
+
E && a && ps(E, n, o), r && Kt.chmodSync(s, i);
|
|
2762
2762
|
};
|
|
2763
2763
|
if (s === c) return eo(c), d();
|
|
2764
|
-
if (h) return d(
|
|
2764
|
+
if (h) return d(Kt.mkdirSync(s, {
|
|
2765
2765
|
mode: i,
|
|
2766
2766
|
recursive: !0
|
|
2767
2767
|
}) ?? void 0);
|
|
@@ -2769,12 +2769,12 @@ var to = (s, t) => {
|
|
|
2769
2769
|
for (let E = T.shift(), x = c; E && (x += "/" + E); E = T.shift()) {
|
|
2770
2770
|
x = f(path.resolve(x));
|
|
2771
2771
|
try {
|
|
2772
|
-
|
|
2772
|
+
Kt.mkdirSync(x, i), N = N || x;
|
|
2773
2773
|
} catch {
|
|
2774
|
-
let xe =
|
|
2774
|
+
let xe = Kt.lstatSync(x);
|
|
2775
2775
|
if (xe.isDirectory()) continue;
|
|
2776
2776
|
if (l) {
|
|
2777
|
-
|
|
2777
|
+
Kt.unlinkSync(x), Kt.mkdirSync(x, i), N = N || x;
|
|
2778
2778
|
continue;
|
|
2779
2779
|
} else if (xe.isSymbolicLink()) return new St(x, x + "/" + T.join("/"));
|
|
2780
2780
|
}
|
|
@@ -2864,16 +2864,16 @@ var so = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32"
|
|
|
2864
2864
|
};
|
|
2865
2865
|
var Or = () => process.umask();
|
|
2866
2866
|
var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs = Symbol("isReusable"), P = Symbol("makeFs"), _s = Symbol("file"), Os = Symbol("directory"), Ri = Symbol("link"), Lr = Symbol("symlink"), Nr = Symbol("hardlink"), ye = Symbol("ensureNoSymlink"), Dr = Symbol("unsupported"), Ar = Symbol("checkPath"), Ss = Symbol("stripAbsolutePath"), yt = Symbol("mkdir"), O = Symbol("onError"), yi = Symbol("pending"), Ir = Symbol("pend"), $t = Symbol("unpend"), ys = Symbol("ended"), Rs = Symbol("maybeClose"), Ts = Symbol("skip"), Re = Symbol("doChown"), ge = Symbol("uid"), be = Symbol("gid"), _e = Symbol("checkedCwd"), Oe = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32", ho = 1024, ao = (s, t) => {
|
|
2867
|
-
if (!Oe) return
|
|
2867
|
+
if (!Oe) return Kt.unlink(s, t);
|
|
2868
2868
|
let e = s + ".DELETE." + randomBytes(16).toString("hex");
|
|
2869
|
-
|
|
2869
|
+
Kt.rename(s, e, (i) => {
|
|
2870
2870
|
if (i) return t(i);
|
|
2871
|
-
|
|
2871
|
+
Kt.unlink(e, t);
|
|
2872
2872
|
});
|
|
2873
2873
|
}, lo = (s) => {
|
|
2874
|
-
if (!Oe) return
|
|
2874
|
+
if (!Oe) return Kt.unlinkSync(s);
|
|
2875
2875
|
let t = s + ".DELETE." + randomBytes(16).toString("hex");
|
|
2876
|
-
|
|
2876
|
+
Kt.renameSync(s, t), Kt.unlinkSync(t);
|
|
2877
2877
|
}, Fr = (s, t, e) => s !== void 0 && s === s >>> 0 ? s : t !== void 0 && t === t >>> 0 ? t : e, Xt = class extends st {
|
|
2878
2878
|
[ys] = !1;
|
|
2879
2879
|
[_e] = !1;
|
|
@@ -3017,14 +3017,14 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3017
3017
|
autoClose: !1
|
|
3018
3018
|
});
|
|
3019
3019
|
r.on("error", (h) => {
|
|
3020
|
-
r.fd &&
|
|
3020
|
+
r.fd && Kt.close(r.fd, () => {}), r.write = () => !0, this[O](h, t), e();
|
|
3021
3021
|
});
|
|
3022
3022
|
let n = 1, o = (h) => {
|
|
3023
3023
|
if (h) {
|
|
3024
|
-
r.fd &&
|
|
3024
|
+
r.fd && Kt.close(r.fd, () => {}), this[O](h, t), e();
|
|
3025
3025
|
return;
|
|
3026
3026
|
}
|
|
3027
|
-
--n === 0 && r.fd !== void 0 &&
|
|
3027
|
+
--n === 0 && r.fd !== void 0 && Kt.close(r.fd, (l) => {
|
|
3028
3028
|
l ? this[O](l, t) : this[$t](), e();
|
|
3029
3029
|
});
|
|
3030
3030
|
};
|
|
@@ -3033,12 +3033,12 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3033
3033
|
if (typeof l == "number" && t.mtime && !this.noMtime) {
|
|
3034
3034
|
n++;
|
|
3035
3035
|
let c = t.atime || /* @__PURE__ */ new Date(), d = t.mtime;
|
|
3036
|
-
|
|
3036
|
+
Kt.futimes(l, c, d, (S) => S ? Kt.utimes(h, c, d, (T) => o(T && S)) : o());
|
|
3037
3037
|
}
|
|
3038
3038
|
if (typeof l == "number" && this[Re](t)) {
|
|
3039
3039
|
n++;
|
|
3040
3040
|
let c = this[ge](t), d = this[be](t);
|
|
3041
|
-
typeof c == "number" && typeof d == "number" &&
|
|
3041
|
+
typeof c == "number" && typeof d == "number" && Kt.fchown(l, c, d, (S) => S ? Kt.chown(h, c, d, (T) => o(T && S)) : o());
|
|
3042
3042
|
}
|
|
3043
3043
|
o();
|
|
3044
3044
|
});
|
|
@@ -3057,7 +3057,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3057
3057
|
let n = 1, o = () => {
|
|
3058
3058
|
--n === 0 && (e(), this[$t](), t.resume());
|
|
3059
3059
|
};
|
|
3060
|
-
t.mtime && !this.noMtime && (n++,
|
|
3060
|
+
t.mtime && !this.noMtime && (n++, Kt.utimes(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime, o)), this[Re](t) && (n++, Kt.chown(String(t.absolute), Number(this[ge](t)), Number(this[be](t)), o)), o();
|
|
3061
3061
|
});
|
|
3062
3062
|
}
|
|
3063
3063
|
[Dr](t) {
|
|
@@ -3079,7 +3079,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3079
3079
|
let o = i.shift();
|
|
3080
3080
|
if (this.preservePaths || o === void 0) return r();
|
|
3081
3081
|
let a = path.resolve(e, o);
|
|
3082
|
-
|
|
3082
|
+
Kt.lstat(a, (h, l) => {
|
|
3083
3083
|
if (h) return r();
|
|
3084
3084
|
if (l?.isSymbolicLink()) return n(new St(a, path.resolve(a, i.join("/"))));
|
|
3085
3085
|
this[ye](t, a, i, r, n);
|
|
@@ -3126,7 +3126,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3126
3126
|
}
|
|
3127
3127
|
o();
|
|
3128
3128
|
}, o = () => {
|
|
3129
|
-
|
|
3129
|
+
Kt.lstat(String(t.absolute), (a, h) => {
|
|
3130
3130
|
if (h && (this.keep || this.newer && h.mtime > (t.mtime ?? h.mtime))) {
|
|
3131
3131
|
this[Ts](t), i();
|
|
3132
3132
|
return;
|
|
@@ -3135,9 +3135,9 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3135
3135
|
if (h.isDirectory()) {
|
|
3136
3136
|
if (t.type === "Directory") {
|
|
3137
3137
|
let l = this.chmod && t.mode && (h.mode & 4095) !== t.mode, c = (d) => this[P](d ?? null, t, i);
|
|
3138
|
-
return l ?
|
|
3138
|
+
return l ? Kt.chmod(String(t.absolute), Number(t.mode), c) : c();
|
|
3139
3139
|
}
|
|
3140
|
-
if (t.absolute !== this.cwd) return
|
|
3140
|
+
if (t.absolute !== this.cwd) return Kt.rmdir(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
3141
3141
|
}
|
|
3142
3142
|
if (t.absolute === this.cwd) return this[P](null, t, i);
|
|
3143
3143
|
ao(String(t.absolute), (l) => this[P](l ?? null, t, i));
|
|
@@ -3161,7 +3161,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
3163
|
[Ri](t, e, i, r) {
|
|
3164
|
-
|
|
3164
|
+
Kt[i](e, String(t.absolute), (n) => {
|
|
3165
3165
|
n ? this[O](n, t) : (this[$t](), t.resume()), r();
|
|
3166
3166
|
});
|
|
3167
3167
|
}
|
|
@@ -3189,17 +3189,17 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3189
3189
|
if (o) return this[O](o, t);
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
3192
|
-
let [e, i] = Se(() =>
|
|
3192
|
+
let [e, i] = Se(() => Kt.lstatSync(String(t.absolute)));
|
|
3193
3193
|
if (i && (this.keep || this.newer && i.mtime > (t.mtime ?? i.mtime))) return this[Ts](t);
|
|
3194
3194
|
if (e || this[bs](t, i)) return this[P](null, t);
|
|
3195
3195
|
if (i.isDirectory()) {
|
|
3196
3196
|
if (t.type === "Directory") {
|
|
3197
3197
|
let [a] = this.chmod && t.mode && (i.mode & 4095) !== t.mode ? Se(() => {
|
|
3198
|
-
|
|
3198
|
+
Kt.chmodSync(String(t.absolute), Number(t.mode));
|
|
3199
3199
|
}) : [];
|
|
3200
3200
|
return this[P](a, t);
|
|
3201
3201
|
}
|
|
3202
|
-
let [n] = Se(() =>
|
|
3202
|
+
let [n] = Se(() => Kt.rmdirSync(String(t.absolute)));
|
|
3203
3203
|
this[P](n, t);
|
|
3204
3204
|
}
|
|
3205
3205
|
let [r] = t.absolute === this.cwd ? [] : Se(() => lo(String(t.absolute)));
|
|
@@ -3209,21 +3209,21 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3209
3209
|
let i = typeof t.mode == "number" ? t.mode & 4095 : this.fmode, r = (a) => {
|
|
3210
3210
|
let h;
|
|
3211
3211
|
try {
|
|
3212
|
-
|
|
3212
|
+
Kt.closeSync(n);
|
|
3213
3213
|
} catch (l) {
|
|
3214
3214
|
h = l;
|
|
3215
3215
|
}
|
|
3216
3216
|
(a || h) && this[O](a || h, t), e();
|
|
3217
3217
|
}, n;
|
|
3218
3218
|
try {
|
|
3219
|
-
n =
|
|
3219
|
+
n = Kt.openSync(String(t.absolute), ds(t.size), i);
|
|
3220
3220
|
} catch (a) {
|
|
3221
3221
|
return r(a);
|
|
3222
3222
|
}
|
|
3223
3223
|
let o = this.transform && this.transform(t) || t;
|
|
3224
3224
|
o !== t && (o.on("error", (a) => this[O](a, t)), t.pipe(o)), o.on("data", (a) => {
|
|
3225
3225
|
try {
|
|
3226
|
-
|
|
3226
|
+
Kt.writeSync(n, a, 0, a.length);
|
|
3227
3227
|
} catch (h) {
|
|
3228
3228
|
r(h);
|
|
3229
3229
|
}
|
|
@@ -3232,10 +3232,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3232
3232
|
if (t.mtime && !this.noMtime) {
|
|
3233
3233
|
let h = t.atime || /* @__PURE__ */ new Date(), l = t.mtime;
|
|
3234
3234
|
try {
|
|
3235
|
-
|
|
3235
|
+
Kt.futimesSync(n, h, l);
|
|
3236
3236
|
} catch (c) {
|
|
3237
3237
|
try {
|
|
3238
|
-
|
|
3238
|
+
Kt.utimesSync(String(t.absolute), h, l);
|
|
3239
3239
|
} catch {
|
|
3240
3240
|
a = c;
|
|
3241
3241
|
}
|
|
@@ -3244,10 +3244,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3244
3244
|
if (this[Re](t)) {
|
|
3245
3245
|
let h = this[ge](t), l = this[be](t);
|
|
3246
3246
|
try {
|
|
3247
|
-
|
|
3247
|
+
Kt.fchownSync(n, Number(h), Number(l));
|
|
3248
3248
|
} catch (c) {
|
|
3249
3249
|
try {
|
|
3250
|
-
|
|
3250
|
+
Kt.chownSync(String(t.absolute), Number(h), Number(l));
|
|
3251
3251
|
} catch {
|
|
3252
3252
|
a = a || c;
|
|
3253
3253
|
}
|
|
@@ -3263,10 +3263,10 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3263
3263
|
return;
|
|
3264
3264
|
}
|
|
3265
3265
|
if (t.mtime && !this.noMtime) try {
|
|
3266
|
-
|
|
3266
|
+
Kt.utimesSync(String(t.absolute), t.atime || /* @__PURE__ */ new Date(), t.mtime);
|
|
3267
3267
|
} catch {}
|
|
3268
3268
|
if (this[Re](t)) try {
|
|
3269
|
-
|
|
3269
|
+
Kt.chownSync(String(t.absolute), Number(this[ge](t)), Number(this[be](t)));
|
|
3270
3270
|
} catch {}
|
|
3271
3271
|
e(), t.resume();
|
|
3272
3272
|
}
|
|
@@ -3292,7 +3292,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3292
3292
|
let o = e;
|
|
3293
3293
|
for (let a of i) {
|
|
3294
3294
|
o = path.resolve(o, a);
|
|
3295
|
-
let [h, l] = Se(() =>
|
|
3295
|
+
let [h, l] = Se(() => Kt.lstatSync(o));
|
|
3296
3296
|
if (h) return r();
|
|
3297
3297
|
if (l.isSymbolicLink()) return n(new St(o, path.resolve(e, i.join("/"))));
|
|
3298
3298
|
}
|
|
@@ -3301,13 +3301,13 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3301
3301
|
[Ri](t, e, i, r) {
|
|
3302
3302
|
let n = `${i}Sync`;
|
|
3303
3303
|
try {
|
|
3304
|
-
|
|
3304
|
+
Kt[n](e, String(t.absolute)), r(), t.resume();
|
|
3305
3305
|
} catch (o) {
|
|
3306
3306
|
return this[O](o, t);
|
|
3307
3307
|
}
|
|
3308
3308
|
}
|
|
3309
3309
|
}, co = (s) => {
|
|
3310
|
-
let t = new Te(s), e = s.file, i =
|
|
3310
|
+
let t = new Te(s), e = s.file, i = Kt.statSync(e);
|
|
3311
3311
|
new Me(e, {
|
|
3312
3312
|
readSize: s.maxReadSize || 16 * 1024 * 1024,
|
|
3313
3313
|
size: i.size
|
|
@@ -3315,7 +3315,7 @@ var Tr = Symbol("onEntry"), gs = Symbol("checkFs"), xr = Symbol("checkFs2"), bs
|
|
|
3315
3315
|
}, fo = (s, t) => {
|
|
3316
3316
|
let e = new Xt(s), i = s.maxReadSize || 16 * 1024 * 1024, r = s.file;
|
|
3317
3317
|
return new Promise((o, a) => {
|
|
3318
|
-
e.on("error", a), e.on("close", o),
|
|
3318
|
+
e.on("error", a), e.on("close", o), Kt.stat(r, (h, l) => {
|
|
3319
3319
|
if (h) a(h);
|
|
3320
3320
|
else {
|
|
3321
3321
|
let c = new _t(r, {
|
|
@@ -3334,15 +3334,15 @@ var mo = (s, t) => {
|
|
|
3334
3334
|
let e = new kt(s), i = !0, r, n;
|
|
3335
3335
|
try {
|
|
3336
3336
|
try {
|
|
3337
|
-
r =
|
|
3337
|
+
r = Kt.openSync(s.file, "r+");
|
|
3338
3338
|
} catch (h) {
|
|
3339
|
-
if (h?.code === "ENOENT") r =
|
|
3339
|
+
if (h?.code === "ENOENT") r = Kt.openSync(s.file, "w+");
|
|
3340
3340
|
else throw h;
|
|
3341
3341
|
}
|
|
3342
|
-
let o =
|
|
3342
|
+
let o = Kt.fstatSync(r), a = Buffer.alloc(512);
|
|
3343
3343
|
t: for (n = 0; n < o.size; n += 512) {
|
|
3344
3344
|
for (let c = 0, d = 0; c < 512; c += d) {
|
|
3345
|
-
if (d =
|
|
3345
|
+
if (d = Kt.readSync(r, a, c, a.length - c, n + c), n === 0 && a[0] === 31 && a[1] === 139) throw new Error("cannot append to compressed archives");
|
|
3346
3346
|
if (!d) break t;
|
|
3347
3347
|
}
|
|
3348
3348
|
let h = new C(a);
|
|
@@ -3354,7 +3354,7 @@ var mo = (s, t) => {
|
|
|
3354
3354
|
i = !1, po(s, e, n, r, t);
|
|
3355
3355
|
} finally {
|
|
3356
3356
|
if (i) try {
|
|
3357
|
-
|
|
3357
|
+
Kt.closeSync(r);
|
|
3358
3358
|
} catch {}
|
|
3359
3359
|
}
|
|
3360
3360
|
}, po = (s, t, e, i, r) => {
|
|
@@ -3367,29 +3367,29 @@ var mo = (s, t) => {
|
|
|
3367
3367
|
t = Array.from(t);
|
|
3368
3368
|
let e = new wt(s), i = (n, o, a) => {
|
|
3369
3369
|
let h = (T, N) => {
|
|
3370
|
-
T ?
|
|
3370
|
+
T ? Kt.close(n, (E) => a(T)) : a(null, N);
|
|
3371
3371
|
}, l = 0;
|
|
3372
3372
|
if (o === 0) return h(null, 0);
|
|
3373
3373
|
let c = 0, d = Buffer.alloc(512), S = (T, N) => {
|
|
3374
3374
|
if (T || N === void 0) return h(T);
|
|
3375
|
-
if (c += N, c < 512 && N) return
|
|
3375
|
+
if (c += N, c < 512 && N) return Kt.read(n, d, c, d.length - c, l + c, S);
|
|
3376
3376
|
if (l === 0 && d[0] === 31 && d[1] === 139) return h(/* @__PURE__ */ new Error("cannot append to compressed archives"));
|
|
3377
3377
|
if (c < 512) return h(null, l);
|
|
3378
3378
|
let E = new C(d);
|
|
3379
3379
|
if (!E.cksumValid) return h(null, l);
|
|
3380
3380
|
let x = 512 * Math.ceil((E.size ?? 0) / 512);
|
|
3381
3381
|
if (l + x + 512 > o || (l += x + 512, l >= o)) return h(null, l);
|
|
3382
|
-
s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0,
|
|
3382
|
+
s.mtimeCache && E.mtime && s.mtimeCache.set(String(E.path), E.mtime), c = 0, Kt.read(n, d, 0, 512, l, S);
|
|
3383
3383
|
};
|
|
3384
|
-
|
|
3384
|
+
Kt.read(n, d, 0, 512, l, S);
|
|
3385
3385
|
};
|
|
3386
3386
|
return new Promise((n, o) => {
|
|
3387
3387
|
e.on("error", o);
|
|
3388
3388
|
let a = "r+", h = (l, c) => {
|
|
3389
|
-
if (l && l.code === "ENOENT" && a === "r+") return a = "w+",
|
|
3389
|
+
if (l && l.code === "ENOENT" && a === "r+") return a = "w+", Kt.open(s.file, a, h);
|
|
3390
3390
|
if (l || !c) return o(l);
|
|
3391
|
-
|
|
3392
|
-
if (d) return
|
|
3391
|
+
Kt.fstat(c, (d, S) => {
|
|
3392
|
+
if (d) return Kt.close(c, () => o(d));
|
|
3393
3393
|
i(c, S.size, (T, N) => {
|
|
3394
3394
|
if (T) return o(T);
|
|
3395
3395
|
let E = new tt(s.file, {
|
|
@@ -3400,7 +3400,7 @@ var mo = (s, t) => {
|
|
|
3400
3400
|
});
|
|
3401
3401
|
});
|
|
3402
3402
|
};
|
|
3403
|
-
|
|
3403
|
+
Kt.open(s.file, a, h);
|
|
3404
3404
|
});
|
|
3405
3405
|
}, wo = (s, t) => {
|
|
3406
3406
|
t.forEach((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$1.isAbsolute(loc) ? loc : path$1.join(this.dataDir, loc);
|
|
3634
|
+
if (!fs$1.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$1.isAbsolute(loc) ? loc : path$1.join(this.dataDir, loc);
|
|
3681
|
+
if (fs$1.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$1.mkdirSync(path$1.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$1.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$1.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$1.mkdirSync(path$1.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$1.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$1.join(this.dataDir, ARCHIVE_MANIFEST_NAME);
|
|
3832
|
+
fs$1.copyFileSync(manifestStagePath, stagedInDataDir);
|
|
3833
|
+
const stagingRel = path$1.relative(this.dataDir, path$1.dirname(opts.archivePath));
|
|
3834
|
+
const excludePrefix = stagingRel && !stagingRel.startsWith("..") && !path$1.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$1.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$1.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$1.rmSync(stagedInDataDir, { force: true });
|
|
3863
3863
|
} catch {}
|
|
3864
3864
|
}
|
|
3865
3865
|
} finally {
|
|
3866
3866
|
try {
|
|
3867
|
-
fs$
|
|
3867
|
+
fs$1.rmSync(manifestStagePath, { force: true });
|
|
3868
3868
|
} catch {}
|
|
3869
3869
|
}
|
|
3870
|
-
const sizeBytes = fs$
|
|
3870
|
+
const sizeBytes = fs$1.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$1.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$1.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$1.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$1.mkdirSync(path$1.dirname(markerPath), { recursive: true });
|
|
3942
|
+
fs$1.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$1.existsSync(markerPath)) return null;
|
|
3949
3949
|
try {
|
|
3950
|
-
const raw = fs$
|
|
3950
|
+
const raw = fs$1.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$1.existsSync(markerPath)) fs$1.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$1.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$1.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$1.relative(path$1.resolve(this.dataDir), path$1.resolve(abs));
|
|
4084
|
+
if (rel.length === 0 || rel.startsWith("..") || path$1.isAbsolute(rel)) return null;
|
|
4085
4085
|
return normalizeArchivePath(rel);
|
|
4086
4086
|
}
|
|
4087
4087
|
getRestoreMarkerPath() {
|
|
4088
|
-
return path$
|
|
4088
|
+
return path$1.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$1.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$1.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$1.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$1.basename(abs),
|
|
4148
4148
|
kind,
|
|
4149
4149
|
sizeBytes: kind === "file" ? stat.size : 0,
|
|
4150
4150
|
mtime: stat.mtimeMs
|