zen-fs-config 0.7.21 → 0.7.22
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/index.js +5 -4
- package/dist/index.mjs +5 -4
- package/dist/zen-fs-config.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2906,6 +2906,9 @@ var LEGACY_CONFIG_SYNC_GROUP_FILE = `${META_DIR}/config-sync-group.json`;
|
|
|
2906
2906
|
var GROUP_NAME_MAX_LENGTH = 40;
|
|
2907
2907
|
var NODES_DIR = "/nodes";
|
|
2908
2908
|
var SHARED_DIR = "/shared";
|
|
2909
|
+
function isDeletableLegacyMetaPath(path) {
|
|
2910
|
+
return path === LEGACY_TOMBSTONES_DIR || path.startsWith(`${LEGACY_TOMBSTONES_DIR}/`) || path === LEGACY_CONFLICTS_DIR || path.startsWith(`${LEGACY_CONFLICTS_DIR}/`);
|
|
2911
|
+
}
|
|
2909
2912
|
var CONFIG_GROUP_ID = "config";
|
|
2910
2913
|
var CONFIG_GROUP_FEATURES = {
|
|
2911
2914
|
tombstones: true,
|
|
@@ -6083,10 +6086,8 @@ var AppDataGroupImpl = class {
|
|
|
6083
6086
|
hiddenPrefixes: [CONFIG_DIR],
|
|
6084
6087
|
readOnlyPrefixes: [
|
|
6085
6088
|
TOMBSTONES_DIR,
|
|
6086
|
-
LEGACY_TOMBSTONES_DIR,
|
|
6087
6089
|
VERSIONS_DIR,
|
|
6088
|
-
CONFLICTS_DIR
|
|
6089
|
-
LEGACY_CONFLICTS_DIR
|
|
6090
|
+
CONFLICTS_DIR
|
|
6090
6091
|
],
|
|
6091
6092
|
confirmPrefixes: [GROUP_DESCRIPTOR_FILE3],
|
|
6092
6093
|
onWrite: async (path, data) => {
|
|
@@ -6331,7 +6332,7 @@ var AppDataGroupImpl = class {
|
|
|
6331
6332
|
async deleteFile(path) {
|
|
6332
6333
|
if (this.disposed) throw new Error("DataSyncGroup has been disposed");
|
|
6333
6334
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
6334
|
-
if (normalized ===
|
|
6335
|
+
if (normalized === CONFIG_DIR || normalized.startsWith(`${CONFIG_DIR}/`) || (normalized === META_DIR || normalized.startsWith(`${META_DIR}/`)) && !isDeletableLegacyMetaPath(normalized)) {
|
|
6335
6336
|
throw new Error(`Cannot delete metadata path "${normalized}"`);
|
|
6336
6337
|
}
|
|
6337
6338
|
if (await isDirectoryPath(this.localFS, normalized)) {
|
package/dist/index.mjs
CHANGED
|
@@ -2147,6 +2147,9 @@ var LEGACY_CONFIG_SYNC_GROUP_FILE = `${META_DIR}/config-sync-group.json`;
|
|
|
2147
2147
|
var GROUP_NAME_MAX_LENGTH = 40;
|
|
2148
2148
|
var NODES_DIR = "/nodes";
|
|
2149
2149
|
var SHARED_DIR = "/shared";
|
|
2150
|
+
function isDeletableLegacyMetaPath(path) {
|
|
2151
|
+
return path === LEGACY_TOMBSTONES_DIR || path.startsWith(`${LEGACY_TOMBSTONES_DIR}/`) || path === LEGACY_CONFLICTS_DIR || path.startsWith(`${LEGACY_CONFLICTS_DIR}/`);
|
|
2152
|
+
}
|
|
2150
2153
|
var CONFIG_GROUP_ID = "config";
|
|
2151
2154
|
var CONFIG_GROUP_FEATURES = {
|
|
2152
2155
|
tombstones: true,
|
|
@@ -5324,10 +5327,8 @@ var AppDataGroupImpl = class {
|
|
|
5324
5327
|
hiddenPrefixes: [CONFIG_DIR],
|
|
5325
5328
|
readOnlyPrefixes: [
|
|
5326
5329
|
TOMBSTONES_DIR,
|
|
5327
|
-
LEGACY_TOMBSTONES_DIR,
|
|
5328
5330
|
VERSIONS_DIR,
|
|
5329
|
-
CONFLICTS_DIR
|
|
5330
|
-
LEGACY_CONFLICTS_DIR
|
|
5331
|
+
CONFLICTS_DIR
|
|
5331
5332
|
],
|
|
5332
5333
|
confirmPrefixes: [GROUP_DESCRIPTOR_FILE3],
|
|
5333
5334
|
onWrite: async (path, data) => {
|
|
@@ -5572,7 +5573,7 @@ var AppDataGroupImpl = class {
|
|
|
5572
5573
|
async deleteFile(path) {
|
|
5573
5574
|
if (this.disposed) throw new Error("DataSyncGroup has been disposed");
|
|
5574
5575
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
5575
|
-
if (normalized ===
|
|
5576
|
+
if (normalized === CONFIG_DIR || normalized.startsWith(`${CONFIG_DIR}/`) || (normalized === META_DIR || normalized.startsWith(`${META_DIR}/`)) && !isDeletableLegacyMetaPath(normalized)) {
|
|
5576
5577
|
throw new Error(`Cannot delete metadata path "${normalized}"`);
|
|
5577
5578
|
}
|
|
5578
5579
|
if (await isDirectoryPath(this.localFS, normalized)) {
|
package/dist/zen-fs-config.js
CHANGED
|
@@ -28863,6 +28863,9 @@ var ZenFSConfig = (() => {
|
|
|
28863
28863
|
var GROUP_NAME_MAX_LENGTH = 40;
|
|
28864
28864
|
var NODES_DIR = "/nodes";
|
|
28865
28865
|
var SHARED_DIR = "/shared";
|
|
28866
|
+
function isDeletableLegacyMetaPath(path) {
|
|
28867
|
+
return path === LEGACY_TOMBSTONES_DIR || path.startsWith(`${LEGACY_TOMBSTONES_DIR}/`) || path === LEGACY_CONFLICTS_DIR || path.startsWith(`${LEGACY_CONFLICTS_DIR}/`);
|
|
28868
|
+
}
|
|
28866
28869
|
var CONFIG_GROUP_ID = "config";
|
|
28867
28870
|
var CONFIG_GROUP_FEATURES = {
|
|
28868
28871
|
tombstones: true,
|
|
@@ -32040,10 +32043,8 @@ var ZenFSConfig = (() => {
|
|
|
32040
32043
|
hiddenPrefixes: [CONFIG_DIR],
|
|
32041
32044
|
readOnlyPrefixes: [
|
|
32042
32045
|
TOMBSTONES_DIR,
|
|
32043
|
-
LEGACY_TOMBSTONES_DIR,
|
|
32044
32046
|
VERSIONS_DIR,
|
|
32045
|
-
CONFLICTS_DIR
|
|
32046
|
-
LEGACY_CONFLICTS_DIR
|
|
32047
|
+
CONFLICTS_DIR
|
|
32047
32048
|
],
|
|
32048
32049
|
confirmPrefixes: [GROUP_DESCRIPTOR_FILE3],
|
|
32049
32050
|
onWrite: async (path, data) => {
|
|
@@ -32288,7 +32289,7 @@ var ZenFSConfig = (() => {
|
|
|
32288
32289
|
async deleteFile(path) {
|
|
32289
32290
|
if (this.disposed) throw new Error("DataSyncGroup has been disposed");
|
|
32290
32291
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
32291
|
-
if (normalized ===
|
|
32292
|
+
if (normalized === CONFIG_DIR || normalized.startsWith(`${CONFIG_DIR}/`) || (normalized === META_DIR || normalized.startsWith(`${META_DIR}/`)) && !isDeletableLegacyMetaPath(normalized)) {
|
|
32292
32293
|
throw new Error(`Cannot delete metadata path "${normalized}"`);
|
|
32293
32294
|
}
|
|
32294
32295
|
if (await isDirectoryPath(this.localFS, normalized)) {
|