karin-plugin-qgroup-file2openlist 0.0.28 → 0.0.30
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/lib/apps/groupFiles.backup.js +3 -3
- package/lib/apps/groupFiles.js +3 -3
- package/lib/apps/groupSyncConfig.js +4 -4
- package/lib/apps/opCommands.js +2 -2
- package/lib/apps/ownerUi.js +2 -2
- package/lib/apps/scheduler.js +5 -5
- package/lib/{chunk-H2TAMQ7I.js → chunk-CE6KVBH4.js} +2 -2
- package/lib/{chunk-ZXZMBJN3.js → chunk-KB5N77CR.js} +2 -2
- package/lib/{chunk-HSFFULJR.js → chunk-NWUWEQLH.js} +66 -1
- package/lib/{chunk-GAVQ23XT.js → chunk-VVJJTF2N.js} +1 -1
- package/lib/{chunk-AAKFRFSO.js → chunk-YQPHJTEB.js} +1 -1
- package/package.json +1 -1
|
@@ -6,12 +6,12 @@ import "../chunk-PBBZ5KAD.js";
|
|
|
6
6
|
import "../chunk-QB3GSENE.js";
|
|
7
7
|
import {
|
|
8
8
|
handleGroupFileUploadedAutoBackup
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-KB5N77CR.js";
|
|
10
|
+
import "../chunk-YQPHJTEB.js";
|
|
11
11
|
import {
|
|
12
12
|
backupOpenListToOpenListCore,
|
|
13
13
|
formatErrorMessage
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-NWUWEQLH.js";
|
|
15
15
|
import {
|
|
16
16
|
config
|
|
17
17
|
} from "../chunk-DA4U55JC.js";
|
package/lib/apps/groupFiles.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
exportGroupFilesToDisk,
|
|
3
3
|
syncGroupFilesToOpenListCore
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-KB5N77CR.js";
|
|
5
|
+
import "../chunk-YQPHJTEB.js";
|
|
6
6
|
import {
|
|
7
7
|
formatErrorMessage,
|
|
8
8
|
normalizePosixPath
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-NWUWEQLH.js";
|
|
10
10
|
import {
|
|
11
11
|
config
|
|
12
12
|
} from "../chunk-DA4U55JC.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handleGroupSyncConfigCommand
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-CE6KVBH4.js";
|
|
4
|
+
import "../chunk-KB5N77CR.js";
|
|
5
|
+
import "../chunk-YQPHJTEB.js";
|
|
6
|
+
import "../chunk-NWUWEQLH.js";
|
|
7
7
|
import "../chunk-DA4U55JC.js";
|
|
8
8
|
import "../chunk-IZS467MR.js";
|
|
9
9
|
|
package/lib/apps/opCommands.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
resolveOpltMapping,
|
|
6
6
|
withOpltUser,
|
|
7
7
|
writeOpltData
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-VVJJTF2N.js";
|
|
9
9
|
import {
|
|
10
10
|
buildActionCard,
|
|
11
11
|
replyImages
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
normalizePosixPath,
|
|
21
21
|
readJsonSafe,
|
|
22
22
|
writeJsonSafe
|
|
23
|
-
} from "../chunk-
|
|
23
|
+
} from "../chunk-NWUWEQLH.js";
|
|
24
24
|
import {
|
|
25
25
|
config
|
|
26
26
|
} from "../chunk-DA4U55JC.js";
|
package/lib/apps/ownerUi.js
CHANGED
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import "../chunk-QB3GSENE.js";
|
|
5
5
|
import {
|
|
6
6
|
readGroupSyncState
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-YQPHJTEB.js";
|
|
8
8
|
import {
|
|
9
9
|
backupOpenListToOpenListCore,
|
|
10
10
|
formatErrorMessage,
|
|
11
11
|
normalizePosixPath,
|
|
12
12
|
readJsonSafe,
|
|
13
13
|
writeJsonSafe
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-NWUWEQLH.js";
|
|
15
15
|
import "../chunk-DA4U55JC.js";
|
|
16
16
|
import {
|
|
17
17
|
dir
|
package/lib/apps/scheduler.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runNightlyOpltBackup
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-VVJJTF2N.js";
|
|
4
4
|
import {
|
|
5
5
|
runNightlyGroupBackup
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-CE6KVBH4.js";
|
|
7
|
+
import "../chunk-KB5N77CR.js";
|
|
8
|
+
import "../chunk-YQPHJTEB.js";
|
|
9
|
+
import "../chunk-NWUWEQLH.js";
|
|
10
10
|
import {
|
|
11
11
|
config
|
|
12
12
|
} from "../chunk-DA4U55JC.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
syncGroupFilesToOpenListCore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KB5N77CR.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizePosixPath,
|
|
6
6
|
readJsonSafe,
|
|
7
7
|
writeJsonSafe
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NWUWEQLH.js";
|
|
9
9
|
import {
|
|
10
10
|
config
|
|
11
11
|
} from "./chunk-DA4U55JC.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
readGroupSyncState,
|
|
3
3
|
withGroupSyncLock,
|
|
4
4
|
writeGroupSyncState
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YQPHJTEB.js";
|
|
6
6
|
import {
|
|
7
7
|
buildOpenListAuthHeader,
|
|
8
8
|
buildOpenListDavBaseUrl,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
runWithConcurrency,
|
|
17
17
|
safePathSegment,
|
|
18
18
|
webdavHeadExists
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NWUWEQLH.js";
|
|
20
20
|
import {
|
|
21
21
|
config,
|
|
22
22
|
time
|
|
@@ -718,6 +718,7 @@ var isRetryableWebDavError = (error) => {
|
|
|
718
718
|
return /ECONNRESET|ETIMEDOUT|EAI_AGAIN|ENOTFOUND|ECONNREFUSED|UND_ERR|socket hang up/i.test(msg);
|
|
719
719
|
};
|
|
720
720
|
var webdavMkcolOk = (status) => status === 201 || status === 405;
|
|
721
|
+
var existsCheckModeByDavBaseUrl = /* @__PURE__ */ new Map();
|
|
721
722
|
var webdavPropfindListEntries = async (params) => {
|
|
722
723
|
const { davBaseUrl, auth, dirPath, timeoutMs } = params;
|
|
723
724
|
const controller = new AbortController();
|
|
@@ -787,15 +788,79 @@ var webdavHeadExists = async (params) => {
|
|
|
787
788
|
const { davBaseUrl, auth, filePath, timeoutMs } = params;
|
|
788
789
|
const controller = new AbortController();
|
|
789
790
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
791
|
+
const propfindExists = async () => {
|
|
792
|
+
const url = `${davBaseUrl}${encodePathForUrl(filePath)}`;
|
|
793
|
+
const body = `<?xml version="1.0" encoding="utf-8" ?>
|
|
794
|
+
<d:propfind xmlns:d="DAV:">
|
|
795
|
+
<d:prop>
|
|
796
|
+
<d:resourcetype />
|
|
797
|
+
</d:prop>
|
|
798
|
+
</d:propfind>`;
|
|
799
|
+
const res = await fetch(url, {
|
|
800
|
+
method: "PROPFIND",
|
|
801
|
+
headers: {
|
|
802
|
+
Authorization: auth,
|
|
803
|
+
Depth: "0",
|
|
804
|
+
"Content-Type": "application/xml; charset=utf-8"
|
|
805
|
+
},
|
|
806
|
+
body,
|
|
807
|
+
redirect: "follow",
|
|
808
|
+
signal: controller.signal
|
|
809
|
+
});
|
|
810
|
+
if (res.ok) {
|
|
811
|
+
try {
|
|
812
|
+
await res.body?.cancel();
|
|
813
|
+
} catch {
|
|
814
|
+
}
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
try {
|
|
818
|
+
await res.body?.cancel();
|
|
819
|
+
} catch {
|
|
820
|
+
}
|
|
821
|
+
return false;
|
|
822
|
+
};
|
|
823
|
+
const key = davBaseUrl;
|
|
824
|
+
const mode = existsCheckModeByDavBaseUrl.get(key) ?? "head";
|
|
790
825
|
try {
|
|
791
826
|
const url = `${davBaseUrl}${encodePathForUrl(filePath)}`;
|
|
827
|
+
if (mode === "propfind") {
|
|
828
|
+
return await propfindExists();
|
|
829
|
+
}
|
|
792
830
|
const res = await fetch(url, {
|
|
793
831
|
method: "HEAD",
|
|
794
832
|
headers: { Authorization: auth },
|
|
795
833
|
redirect: "follow",
|
|
796
834
|
signal: controller.signal
|
|
797
835
|
});
|
|
798
|
-
|
|
836
|
+
if (res.ok) {
|
|
837
|
+
try {
|
|
838
|
+
await res.body?.cancel();
|
|
839
|
+
} catch {
|
|
840
|
+
}
|
|
841
|
+
return true;
|
|
842
|
+
}
|
|
843
|
+
if (res.status === 404) {
|
|
844
|
+
try {
|
|
845
|
+
await res.body?.cancel();
|
|
846
|
+
} catch {
|
|
847
|
+
}
|
|
848
|
+
return false;
|
|
849
|
+
}
|
|
850
|
+
if (res.status === 403 || res.status === 405 || res.status === 501) {
|
|
851
|
+
try {
|
|
852
|
+
await res.body?.cancel();
|
|
853
|
+
} catch {
|
|
854
|
+
}
|
|
855
|
+
const ok = await propfindExists();
|
|
856
|
+
existsCheckModeByDavBaseUrl.set(key, "propfind");
|
|
857
|
+
return ok;
|
|
858
|
+
}
|
|
859
|
+
try {
|
|
860
|
+
await res.body?.cancel();
|
|
861
|
+
} catch {
|
|
862
|
+
}
|
|
863
|
+
return await propfindExists();
|
|
799
864
|
} catch {
|
|
800
865
|
return false;
|
|
801
866
|
} finally {
|