@c4a/core 0.4.12-alpha.2 → 0.4.12-alpha.3
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/index.js +41 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -7033,7 +7033,7 @@ var Perspective;
|
|
|
7033
7033
|
var DEFAULT_SERVER_CONFIG = {
|
|
7034
7034
|
server: {
|
|
7035
7035
|
port: 5100,
|
|
7036
|
-
host: "
|
|
7036
|
+
host: "::"
|
|
7037
7037
|
},
|
|
7038
7038
|
doc_db: {
|
|
7039
7039
|
provider: "sqlite",
|
|
@@ -7041,7 +7041,7 @@ var DEFAULT_SERVER_CONFIG = {
|
|
|
7041
7041
|
path: "./data/c4a.db"
|
|
7042
7042
|
},
|
|
7043
7043
|
mongodb: {
|
|
7044
|
-
uri: "mongodb://localhost:27017/c4a",
|
|
7044
|
+
uri: "mongodb://localhost:27017/c4a?directConnection=true",
|
|
7045
7045
|
database: "c4a"
|
|
7046
7046
|
}
|
|
7047
7047
|
},
|
|
@@ -11689,6 +11689,36 @@ var DEFAULT_CLOUD_LIBRARY_ID = "lib_cloud_default";
|
|
|
11689
11689
|
var DEFAULT_CLOUD_LIBRARY_NAME = "个人云";
|
|
11690
11690
|
var DAEMON_HEARTBEAT_INTERVAL = 30000;
|
|
11691
11691
|
var DAEMON_OFFLINE_THRESHOLD = 60000;
|
|
11692
|
+
// src/fileTypes.ts
|
|
11693
|
+
var INDEXABLE_CODE_EXTENSIONS = new Set([".ts", ".tsx"]);
|
|
11694
|
+
var INDEXABLE_DOC_EXTENSIONS = new Set([".md"]);
|
|
11695
|
+
var INDEXABLE_EXTENSIONS = new Set([
|
|
11696
|
+
...INDEXABLE_CODE_EXTENSIONS,
|
|
11697
|
+
...INDEXABLE_DOC_EXTENSIONS
|
|
11698
|
+
]);
|
|
11699
|
+
var UPLOAD_ALLOWED_EXTENSIONS = new Set([
|
|
11700
|
+
".md",
|
|
11701
|
+
".doc",
|
|
11702
|
+
".docx",
|
|
11703
|
+
".pdf",
|
|
11704
|
+
".ppt",
|
|
11705
|
+
".pptx",
|
|
11706
|
+
".txt"
|
|
11707
|
+
]);
|
|
11708
|
+
var TEXT_EXTENSIONS = new Set([".md", ".txt"]);
|
|
11709
|
+
var UPLOAD_MAX_FILE_SIZE = 5 * 1024 * 1024;
|
|
11710
|
+
var UPLOAD_MAX_FILES = 10;
|
|
11711
|
+
function getFileExtension(name) {
|
|
11712
|
+
const dot = name.lastIndexOf(".");
|
|
11713
|
+
return dot >= 0 ? name.slice(dot).toLowerCase() : "";
|
|
11714
|
+
}
|
|
11715
|
+
function isIndexableFile(fileName, manifestFiles) {
|
|
11716
|
+
const baseName = fileName.includes("/") ? fileName.split("/").pop() : fileName;
|
|
11717
|
+
if (manifestFiles.has(baseName.toLowerCase()))
|
|
11718
|
+
return true;
|
|
11719
|
+
const ext = getFileExtension(baseName);
|
|
11720
|
+
return INDEXABLE_EXTENSIONS.has(ext);
|
|
11721
|
+
}
|
|
11692
11722
|
// src/wsEvents.ts
|
|
11693
11723
|
var WS_SESSION_STATUS = "ws:session:status";
|
|
11694
11724
|
var WS_SESSION_PROGRESS = "ws:session:progress";
|
|
@@ -11725,6 +11755,8 @@ export {
|
|
|
11725
11755
|
kindSchema,
|
|
11726
11756
|
isValidManifest,
|
|
11727
11757
|
isPathSafe,
|
|
11758
|
+
isIndexableFile,
|
|
11759
|
+
getFileExtension,
|
|
11728
11760
|
generateUUID,
|
|
11729
11761
|
generateId,
|
|
11730
11762
|
eventAtomSchema,
|
|
@@ -11763,9 +11795,16 @@ export {
|
|
|
11763
11795
|
WS_DAEMON_HANDSHAKE_ACK,
|
|
11764
11796
|
WS_DAEMON_HANDSHAKE,
|
|
11765
11797
|
WS_DAEMON_CONNECTED,
|
|
11798
|
+
UPLOAD_MAX_FILE_SIZE,
|
|
11799
|
+
UPLOAD_MAX_FILES,
|
|
11800
|
+
UPLOAD_ALLOWED_EXTENSIONS,
|
|
11801
|
+
TEXT_EXTENSIONS,
|
|
11766
11802
|
RelationType,
|
|
11767
11803
|
Perspective,
|
|
11768
11804
|
Kind,
|
|
11805
|
+
INDEXABLE_EXTENSIONS,
|
|
11806
|
+
INDEXABLE_DOC_EXTENSIONS,
|
|
11807
|
+
INDEXABLE_CODE_EXTENSIONS,
|
|
11769
11808
|
ErrorCode,
|
|
11770
11809
|
EntityType,
|
|
11771
11810
|
DEFAULT_WORKSPACE_NAME,
|