core-3nweb-client-lib 0.41.0 → 0.41.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/build/core/app-files.js
CHANGED
|
@@ -27,7 +27,8 @@ function userIdToFolderName(userId) {
|
|
|
27
27
|
return buffer_utils_1.base64urlSafe.pack(buffer_utils_1.utf8.pack(userId));
|
|
28
28
|
}
|
|
29
29
|
function folderNameToUserId(folderName) {
|
|
30
|
-
|
|
30
|
+
const str = buffer_utils_1.utf8.open(buffer_utils_1.base64urlSafe.open(folderName));
|
|
31
|
+
return (str.includes('@') ? str : undefined);
|
|
31
32
|
}
|
|
32
33
|
exports.UTIL_DIR = 'util';
|
|
33
34
|
const INBOX_DIR = 'inbox';
|
|
@@ -70,7 +71,10 @@ function appDirs(appDir) {
|
|
|
70
71
|
continue;
|
|
71
72
|
}
|
|
72
73
|
try {
|
|
73
|
-
|
|
74
|
+
const userId = folderNameToUserId(entry.name);
|
|
75
|
+
if (userId) {
|
|
76
|
+
users.push(userId);
|
|
77
|
+
}
|
|
74
78
|
}
|
|
75
79
|
catch (e) {
|
|
76
80
|
continue;
|
|
@@ -462,6 +462,9 @@ class FolderNode extends node_in_fs_1.NodeInFS {
|
|
|
462
462
|
return { node, key };
|
|
463
463
|
}
|
|
464
464
|
create(type, name, exclusive, changes, linkParams) {
|
|
465
|
+
if ((typeof name !== 'string') || (name.length === 0)) {
|
|
466
|
+
throw (0, file_1.makeFileException)('badFnCallArguments', name, `Given name is invalid for making ${type} node`);
|
|
467
|
+
}
|
|
465
468
|
return this.doChange(true, async () => {
|
|
466
469
|
// do check for concurrent creation of a node
|
|
467
470
|
if (this.getNodeInfo(name, true)) {
|