@vapi-network/core 0.15.1 → 0.15.2
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/README.md +1 -1
- package/dist/agent-link.js +73 -7
- package/dist/agent-link.js.map +1 -1
- package/dist/atomic-file.d.ts +1 -0
- package/dist/atomic-file.d.ts.map +1 -1
- package/dist/backup.js +6 -4
- package/dist/backup.js.map +1 -1
- package/dist/cloud-backup.js +79 -11
- package/dist/cloud-backup.js.map +2 -2
- package/dist/index.js +82 -12
- package/dist/index.js.map +2 -2
- package/dist/net-guard.d.ts +17 -0
- package/dist/net-guard.d.ts.map +1 -1
- package/dist/router-client.js +80 -12
- package/dist/router-client.js.map +2 -2
- package/dist/secrets.js +19 -8
- package/dist/secrets.js.map +1 -1
- package/dist/support-report.d.ts +1 -1
- package/dist/tasks.js +77 -9
- package/dist/tasks.js.map +2 -2
- package/package.json +1 -1
package/dist/secrets.js
CHANGED
|
@@ -46650,12 +46650,12 @@ async function removeStaleLock(path) {
|
|
|
46650
46650
|
const pid = lockOwnerPid(owner);
|
|
46651
46651
|
if (pid !== void 0 && processIsAlive(pid)) return;
|
|
46652
46652
|
await atomicFileTestHooks?.beforeStaleLockBreak?.(path);
|
|
46653
|
-
await removeOwnedLock(path, [owner]);
|
|
46653
|
+
await removeOwnedLock(path, [owner], true);
|
|
46654
46654
|
} catch (error61) {
|
|
46655
46655
|
if (!hasCode(error61, "ENOENT")) throw error61;
|
|
46656
46656
|
}
|
|
46657
46657
|
}
|
|
46658
|
-
async function removeOwnedLock(path, owners) {
|
|
46658
|
+
async function removeOwnedLock(path, owners, staleDeadOwner = false) {
|
|
46659
46659
|
const tombPath = `${path}.stale.${randomBytes2(16).toString("hex")}`;
|
|
46660
46660
|
try {
|
|
46661
46661
|
await rename(path, tombPath);
|
|
@@ -46664,7 +46664,7 @@ async function removeOwnedLock(path, owners) {
|
|
|
46664
46664
|
await removeOwnedTombs(path, owners);
|
|
46665
46665
|
const currentOwner = await readFile(path, "utf8").catch(() => void 0);
|
|
46666
46666
|
if (currentOwner !== void 0 && owners.includes(currentOwner)) {
|
|
46667
|
-
await removeOwnedLock(path, owners);
|
|
46667
|
+
await removeOwnedLock(path, owners, staleDeadOwner);
|
|
46668
46668
|
}
|
|
46669
46669
|
return;
|
|
46670
46670
|
}
|
|
@@ -46673,6 +46673,7 @@ async function removeOwnedLock(path, owners) {
|
|
|
46673
46673
|
let pendingError;
|
|
46674
46674
|
let renamedOwner;
|
|
46675
46675
|
try {
|
|
46676
|
+
await atomicFileTestHooks?.afterLockRename?.(tombPath);
|
|
46676
46677
|
renamedOwner = await readFile(tombPath, "utf8");
|
|
46677
46678
|
if (!owners.includes(renamedOwner) && !lockOwnerReleased(renamedOwner)) {
|
|
46678
46679
|
await atomicFileTestHooks?.afterMismatchedLockRename?.(path);
|
|
@@ -46681,6 +46682,7 @@ async function removeOwnedLock(path, owners) {
|
|
|
46681
46682
|
await atomicFileTestHooks?.afterMismatchedLockRestore?.(path);
|
|
46682
46683
|
}
|
|
46683
46684
|
} catch (error61) {
|
|
46685
|
+
if (hasCode(error61, "ENOENT")) return;
|
|
46684
46686
|
pendingError = error61;
|
|
46685
46687
|
}
|
|
46686
46688
|
try {
|
|
@@ -46689,7 +46691,7 @@ async function removeOwnedLock(path, owners) {
|
|
|
46689
46691
|
} catch (error61) {
|
|
46690
46692
|
if (!tombUnlinkTolerated(
|
|
46691
46693
|
error61,
|
|
46692
|
-
renamedOwner !== void 0 && lockOwnerReleased(renamedOwner) && owners.includes(renamedOwner)
|
|
46694
|
+
renamedOwner !== void 0 && (lockOwnerReleased(renamedOwner) || staleDeadOwner) && owners.includes(renamedOwner)
|
|
46693
46695
|
) && pendingError === void 0) {
|
|
46694
46696
|
pendingError = error61;
|
|
46695
46697
|
}
|
|
@@ -46870,7 +46872,7 @@ async function assertPublicUrl(url2, options) {
|
|
|
46870
46872
|
options.timeoutMs ?? 5e3
|
|
46871
46873
|
);
|
|
46872
46874
|
} catch {
|
|
46873
|
-
throw guardError(url2);
|
|
46875
|
+
throw guardError(url2, "unresolved");
|
|
46874
46876
|
}
|
|
46875
46877
|
if (addresses.length === 0 || addresses.some(isNonPublicAddress)) {
|
|
46876
46878
|
throw guardError(url2);
|
|
@@ -47025,9 +47027,18 @@ function isNonPublicIpv6(hextets) {
|
|
|
47025
47027
|
const isDocumentation = first === 8193 && hextets[1] === 3512;
|
|
47026
47028
|
return isUnspecified || isLoopback || isUniqueLocal || isLinkLocal || isSiteLocal || isMulticast || isDocumentation;
|
|
47027
47029
|
}
|
|
47028
|
-
|
|
47029
|
-
|
|
47030
|
-
|
|
47030
|
+
var NetworkGuardError = class extends Error {
|
|
47031
|
+
constructor(message, reason) {
|
|
47032
|
+
super(message);
|
|
47033
|
+
this.reason = reason;
|
|
47034
|
+
this.name = "NetworkGuardError";
|
|
47035
|
+
}
|
|
47036
|
+
reason;
|
|
47037
|
+
};
|
|
47038
|
+
function guardError(url2, reason = "blocked") {
|
|
47039
|
+
return new NetworkGuardError(
|
|
47040
|
+
`URL hostname ${JSON.stringify(url2.hostname)} is not allowed; private or internal destinations require allowPrivateNetwork true in the vAPI config.`,
|
|
47041
|
+
reason
|
|
47031
47042
|
);
|
|
47032
47043
|
}
|
|
47033
47044
|
|