datafolder 1.0.8 → 1.0.10
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 +4 -2
- package/SSD.md +60 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/sample.js +4 -4
- package/scripts/airbnb.js +1 -0
- package/scripts/airbnb2.js +1 -0
- package/scripts/convertBinFiles.js +1 -0
- package/scripts/express.js +2 -1
- package/scripts/fastify.js +3 -2
- package/scripts/flights.js +1 -0
- package/scripts/flights2.js +1 -0
- package/scripts/flights_queries.js +1 -0
- package/src/QyAcl.d.ts +3 -3
- package/src/QyAcl.js +7 -7
- package/src/QyAclSaver_Worker.d.ts +1 -0
- package/src/QyAclSaver_Worker.js +1 -0
- package/src/QyAclWriter.d.ts +2 -1
- package/src/QyAclWriter.js +7 -6
- package/src/QyBatch.d.ts +29 -22
- package/src/QyBatch.js +85 -72
- package/src/QyBinWriter.d.ts +9 -4
- package/src/QyBinWriter.js +83 -70
- package/src/QyCD.d.ts +19 -19
- package/src/QyCD.js +2 -2
- package/src/QyCache.d.ts +22 -23
- package/src/QyCache.js +47 -36
- package/src/QyCompressor_Worker.js +2 -2
- package/src/QyDB.d.ts +6 -9
- package/src/QyDB.js +1 -1
- package/src/QyFile.d.ts +2 -0
- package/src/QyFile.js +42 -40
- package/src/QyFileContentUtils.d.ts +1 -4
- package/src/QyFileLogger.d.ts +4 -0
- package/src/QyFileLogger.js +30 -26
- package/src/QyIndex.d.ts +2 -2
- package/src/QyIndex.js +84 -80
- package/src/QyIndexPropTree.d.ts +4 -0
- package/src/QyIndexPropTree.js +19 -10
- package/src/QyIntersectNode.d.ts +1 -0
- package/src/QyIntersectNode.js +1 -0
- package/src/QyJsonSaver.d.ts +2 -2
- package/src/QyJsonSaver.js +4 -4
- package/src/QyKVData.d.ts +18 -1
- package/src/QyKVData.js +98 -78
- package/src/QyKVDataCleaner_Worker.d.ts +7 -1
- package/src/QyKVDataCleaner_Worker.js +69 -55
- package/src/QyKVDataLoader.d.ts +10 -2
- package/src/QyKVDataLoader.js +27 -21
- package/src/QyKVDataSaver_Worker.d.ts +10 -0
- package/src/QyKVDataSaver_Worker.js +23 -9
- package/src/QyLogFileSaver_Worker.d.ts +1 -0
- package/src/QyLogFileSaver_Worker.js +7 -6
- package/src/QyLogger.d.ts +20 -10
- package/src/QyLogger.js +110 -67
- package/src/QyMessageWorker.d.ts +1 -1
- package/src/QyMessageWorker.js +5 -5
- package/src/QyMessager.d.ts +5 -1
- package/src/QyMessager.js +6 -1
- package/src/QyMod.js +9 -8
- package/src/QyOpRunner.d.ts +5 -1
- package/src/QyOpRunner.js +7 -7
- package/src/QyQueue.d.ts +5 -1
- package/src/QyQueue.js +6 -7
- package/src/QySaver.d.ts +3 -0
- package/src/QySaver.js +26 -15
- package/src/QySnapshotCompactor_Worker.d.ts +7 -0
- package/src/QySnapshotCompactor_Worker.js +37 -26
- package/src/QySnapshotSaver_Worker.d.ts +8 -1
- package/src/QySnapshotSaver_Worker.js +21 -14
- package/src/QySnapshots.d.ts +19 -7
- package/src/QySnapshots.js +195 -172
- package/src/QyTrigger.d.ts +5 -1
- package/src/QyTrigger.js +44 -34
- package/src/QyUnionNode.d.ts +10 -1
- package/src/QyUnionNode.js +34 -36
- package/src/QyUtils.d.ts +2 -2
- package/src/QyUtils.js +116 -111
- package/src/simulate.js +34 -31
- package/src/simulate2.js +49 -46
- package/src/soc_pokec.js +17 -11
- package/static/codemirror.bundle/editor.bundle.js +31 -18
package/src/QyCD.d.ts
CHANGED
|
@@ -2,36 +2,36 @@ import type { QyCache } from "./QyCache.ts";
|
|
|
2
2
|
import type { QyDir } from "./QyDir.ts";
|
|
3
3
|
import type { QyFile } from "./QyFile.ts";
|
|
4
4
|
export declare class QyCD {
|
|
5
|
-
qyCache:
|
|
6
|
-
currentDir:
|
|
5
|
+
qyCache: any;
|
|
6
|
+
currentDir: any;
|
|
7
7
|
constructor(qyCache?: QyCache);
|
|
8
|
-
cd(namePath: string | string[] | QyDir, parentDir?:
|
|
9
|
-
cdP(namePath: string | string[] | QyDir, parentDir?:
|
|
10
|
-
dir(namePath: string | string[], parentDir?:
|
|
11
|
-
dirP(namePath: string | string[], parentDir?:
|
|
12
|
-
indexDir(indexHostDirNamePath: string | string[] | QyDir, namePath: string | string[], parentDir?:
|
|
13
|
-
indexDirP(indexHostDirNamePath: string | string[] | QyDir, namePath: string | string[], parentDir?:
|
|
14
|
-
file(namePath: string | string[], parentDir?:
|
|
15
|
-
fileP(namePath: string | string[], parentDir?:
|
|
8
|
+
cd(namePath: string | string[] | QyDir, parentDir?: any): this;
|
|
9
|
+
cdP(namePath: string | string[] | QyDir, parentDir?: any): this;
|
|
10
|
+
dir(namePath: string | string[], parentDir?: any): QyDir | undefined;
|
|
11
|
+
dirP(namePath: string | string[], parentDir?: any): QyDir | undefined;
|
|
12
|
+
indexDir(indexHostDirNamePath: string | string[] | QyDir, namePath: string | string[], parentDir?: any): QyDir | undefined;
|
|
13
|
+
indexDirP(indexHostDirNamePath: string | string[] | QyDir, namePath: string | string[], parentDir?: any): QyDir | undefined;
|
|
14
|
+
file(namePath: string | string[], parentDir?: any): QyFile | undefined;
|
|
15
|
+
fileP(namePath: string | string[], parentDir?: any): QyFile | undefined;
|
|
16
16
|
triggerFile(triggerName: any): any;
|
|
17
17
|
get triggerFileList(): any;
|
|
18
18
|
rpcFile(rpcName: any): any;
|
|
19
19
|
get rpcFileList(): any;
|
|
20
|
-
view(namePath: any, spec
|
|
21
|
-
viewP(namePath: any, spec: any, parentDir?:
|
|
22
|
-
queryFiles(indexHostDirNamePath: any, queryObj: any, limit: any, cursor: any, parentDir?:
|
|
23
|
-
queryFilesMulti(indexHostDirNamePathMulti: any, limit: any, cursor: any, parentDir?:
|
|
24
|
-
queryTree(indexHostDirNamePath: any, queryObj: any, view: any, limit: any, cursor: any, parentDir?:
|
|
25
|
-
tree:
|
|
20
|
+
view(namePath: any, spec?: undefined, parentDir?: any): any;
|
|
21
|
+
viewP(namePath: any, spec: any, parentDir?: any): any;
|
|
22
|
+
queryFiles(indexHostDirNamePath: any, queryObj: any, limit: any, cursor: any, parentDir?: any): any;
|
|
23
|
+
queryFilesMulti(indexHostDirNamePathMulti: any, limit: any, cursor: any, parentDir?: any): any;
|
|
24
|
+
queryTree(indexHostDirNamePath: any, queryObj: any, view: any, limit: any, cursor: any, parentDir?: any): {
|
|
25
|
+
tree: any;
|
|
26
26
|
count: any;
|
|
27
27
|
};
|
|
28
|
-
queryTreeMulti(indexHostDirNamePathMulti: any, view: any, limit: any, cursor: any, parentDir?:
|
|
29
|
-
tree:
|
|
28
|
+
queryTreeMulti(indexHostDirNamePathMulti: any, view: any, limit: any, cursor: any, parentDir?: any): {
|
|
29
|
+
tree: any;
|
|
30
30
|
count: any;
|
|
31
31
|
};
|
|
32
32
|
resetCurrentDir(): void;
|
|
33
33
|
fileListToTree(fileList: any, view: any): {
|
|
34
|
-
tree:
|
|
34
|
+
tree: any;
|
|
35
35
|
count: any;
|
|
36
36
|
};
|
|
37
37
|
}
|
package/src/QyCD.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
|
|
6
6
|
class r {
|
|
7
7
|
qyCache;
|
|
8
|
-
currentDir
|
|
8
|
+
currentDir;
|
|
9
9
|
constructor(r) {
|
|
10
10
|
this.qyCache = r;
|
|
11
11
|
}
|
|
@@ -49,7 +49,7 @@ class r {
|
|
|
49
49
|
get rpcFileList() {
|
|
50
50
|
return this.qyCache.rpcFileList;
|
|
51
51
|
}
|
|
52
|
-
view(r, e, t = this.currentDir) {
|
|
52
|
+
view(r, e = void 0, t = this.currentDir) {
|
|
53
53
|
return i(r) && (r = s(r)), this.viewP(r, e, t);
|
|
54
54
|
}
|
|
55
55
|
viewP(r, e, t = this.currentDir) {
|
package/src/QyCache.d.ts
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import EventEmitter from "node:events";
|
|
2
2
|
import { QyDir } from "./QyDir.ts";
|
|
3
|
-
import { QyFileLogger } from "./QyFileLogger.ts";
|
|
4
|
-
import { QyKVData } from "./QyKVData.ts";
|
|
5
|
-
import type { QyDB } from "./QyDB.ts";
|
|
6
3
|
import type { QyFile } from "./QyFile.ts";
|
|
7
4
|
export declare class QyCache extends EventEmitter {
|
|
8
|
-
rootFolder:
|
|
9
|
-
options:
|
|
10
|
-
qyDB:
|
|
11
|
-
kvFolder:
|
|
12
|
-
rpcFolder:
|
|
13
|
-
rootDir:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
rootFolder: any;
|
|
6
|
+
options: any;
|
|
7
|
+
qyDB: any;
|
|
8
|
+
kvFolder: any;
|
|
9
|
+
rpcFolder: any;
|
|
10
|
+
rootDir: any;
|
|
11
|
+
triggerRootDir: any;
|
|
12
|
+
rpcRootDir: any;
|
|
13
|
+
indexRootDir: any;
|
|
14
|
+
exclusiveFilePath: any;
|
|
15
|
+
qyKVData: any;
|
|
16
|
+
qyFileLogger: any;
|
|
18
17
|
rpcFunMap: {};
|
|
19
|
-
constructor(rootFolder: string, options?:
|
|
18
|
+
constructor(rootFolder: string, options?: any, qyDB?: any);
|
|
20
19
|
start(): Promise<this>;
|
|
21
20
|
stop(): Promise<this>;
|
|
22
|
-
increaseChangeId():
|
|
21
|
+
increaseChangeId(): any;
|
|
23
22
|
decreaseChangeId(): void;
|
|
24
23
|
save(changeId: any, cmdArgAsListObj: any, logText: any, syncList: any, needPromise: any): any;
|
|
25
|
-
getFile(namePath: QyFile | string | string[], parentDir?:
|
|
26
|
-
getDir(namePath: QyDir | string | string[], parentDir?:
|
|
27
|
-
getOrCreateFile(namePath: QyFile | string | string[], parentDir?:
|
|
28
|
-
getOrCreateDir(namePath: QyDir | string | string[], parentDir?:
|
|
29
|
-
getIndexDir(indexHostDir: QyDir):
|
|
30
|
-
getOrCreateIndexDir(indexHostDir: any):
|
|
24
|
+
getFile(namePath: QyFile | string | string[], parentDir?: any): QyFile | undefined;
|
|
25
|
+
getDir(namePath: QyDir | string | string[], parentDir?: any): QyDir | undefined;
|
|
26
|
+
getOrCreateFile(namePath: QyFile | string | string[], parentDir?: any): QyFile;
|
|
27
|
+
getOrCreateDir(namePath: QyDir | string | string[], parentDir?: any): QyDir;
|
|
28
|
+
getIndexDir(indexHostDir: QyDir): any;
|
|
29
|
+
getOrCreateIndexDir(indexHostDir: any): any;
|
|
31
30
|
getTriggerFile(triggerName: any): any;
|
|
32
31
|
getOrCreateTriggerFile(triggerName: any): any;
|
|
33
32
|
get triggerFileList(): any;
|
|
@@ -38,7 +37,7 @@ export declare class QyCache extends EventEmitter {
|
|
|
38
37
|
removeTriggerFromTree(triggerName: any, fileNamePath: any): void;
|
|
39
38
|
insertRpc(rpcFunName: any, modCode: any): void;
|
|
40
39
|
removeRpc(rpcFunName: any): void;
|
|
41
|
-
queryFiles(indexHostDirNamePath: any, queryObj: any, limit: any, cursor: any, parentDir?:
|
|
42
|
-
queryFilesMulti(indexHostDirNamePathMulti: any, limit: any, cursor: any, parentDir?:
|
|
40
|
+
queryFiles(indexHostDirNamePath: any, queryObj: any, limit: any, cursor: any, parentDir?: any): never[];
|
|
41
|
+
queryFilesMulti(indexHostDirNamePathMulti: any, limit: any, cursor: any, parentDir?: any): never[];
|
|
43
42
|
callRpc(rpcFunName: any, args: any, body: any): Promise<any>;
|
|
44
43
|
}
|
package/src/QyCache.js
CHANGED
|
@@ -5,26 +5,26 @@ import {
|
|
|
5
5
|
import r from "node:events";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
QyDir as
|
|
8
|
+
QyDir as o
|
|
9
9
|
} from "./QyDir.js";
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
-
QyFileLogger as
|
|
12
|
+
QyFileLogger as a
|
|
13
13
|
} from "./QyFileLogger.js";
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
-
QyKVData as
|
|
16
|
+
QyKVData as s
|
|
17
17
|
} from "./QyKVData.js";
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
QyTriggerNode as f,
|
|
21
|
-
updateTriggerNodes as
|
|
21
|
+
updateTriggerNodes as g
|
|
22
22
|
} from "./QyTrigger.js";
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
isString as C,
|
|
26
26
|
lockExclusiveFilePath as q,
|
|
27
|
-
unlockExclusiveFilePath as
|
|
27
|
+
unlockExclusiveFilePath as i
|
|
28
28
|
} from "./QyUtils.js";
|
|
29
29
|
|
|
30
30
|
import {
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
} from "./QyUtils.js";
|
|
47
47
|
|
|
48
48
|
import {
|
|
49
|
-
QueryCounter as
|
|
49
|
+
QueryCounter as p
|
|
50
50
|
} from "./QyUnionNode.js";
|
|
51
51
|
|
|
52
52
|
import {
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
} from "./QyKVDataLoader.js";
|
|
55
55
|
|
|
56
56
|
import {
|
|
57
|
-
requireFromModCode as
|
|
57
|
+
requireFromModCode as u
|
|
58
58
|
} from "./QyMod.js";
|
|
59
59
|
|
|
60
60
|
import {
|
|
@@ -62,8 +62,8 @@ import {
|
|
|
62
62
|
} from "./QyLogger.js";
|
|
63
63
|
|
|
64
64
|
let {
|
|
65
|
-
IndexDirPath:
|
|
66
|
-
TriggerDirPath:
|
|
65
|
+
IndexDirPath: L,
|
|
66
|
+
TriggerDirPath: P,
|
|
67
67
|
RpcDirPath: O
|
|
68
68
|
} = e;
|
|
69
69
|
|
|
@@ -74,20 +74,30 @@ class t extends r {
|
|
|
74
74
|
kvFolder;
|
|
75
75
|
rpcFolder;
|
|
76
76
|
rootDir;
|
|
77
|
-
|
|
77
|
+
triggerRootDir;
|
|
78
|
+
rpcRootDir;
|
|
79
|
+
indexRootDir;
|
|
78
80
|
exclusiveFilePath;
|
|
79
81
|
qyKVData;
|
|
80
82
|
qyFileLogger;
|
|
81
83
|
rpcFunMap = {};
|
|
82
84
|
constructor(r, e, t) {
|
|
83
|
-
super(),
|
|
85
|
+
super(), e = {
|
|
84
86
|
...d("QyCache"),
|
|
85
87
|
...e
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
};
|
|
89
|
+
var i = v(r, "qykv");
|
|
90
|
+
Object.assign(this, {
|
|
91
|
+
rootFolder: r,
|
|
92
|
+
options: e,
|
|
93
|
+
qyDB: t,
|
|
94
|
+
kvFolder: i,
|
|
95
|
+
rpcFolder: v(r, "rpc"),
|
|
96
|
+
rootDir: new o("", !0, void 0, this),
|
|
97
|
+
exclusiveFilePath: v(r, ".opened"),
|
|
98
|
+
qyKVData: new s(i, e, this),
|
|
99
|
+
qyFileLogger: new a(v(r, "qylog"), e)
|
|
100
|
+
});
|
|
91
101
|
}
|
|
92
102
|
async start() {
|
|
93
103
|
var {
|
|
@@ -118,19 +128,19 @@ class t extends r {
|
|
|
118
128
|
fileMap: i
|
|
119
129
|
} = e;
|
|
120
130
|
for (var o of t) r(o);
|
|
121
|
-
}(s), this.indexRootDir = s.searchOrCreateSubdir(
|
|
122
|
-
var
|
|
123
|
-
e.triggerNodes = [ new f() ],
|
|
124
|
-
for (
|
|
131
|
+
}(s), this.indexRootDir = s.searchOrCreateSubdir(L);
|
|
132
|
+
var p = this, e = p.rootDir;
|
|
133
|
+
e.triggerNodes = [ new f() ], p.triggerRootDir = e.searchOrCreateSubdir(P);
|
|
134
|
+
for (u of p.triggerRootDir.fileList) {
|
|
125
135
|
var {
|
|
126
|
-
name:
|
|
127
|
-
fileContent:
|
|
128
|
-
} =
|
|
129
|
-
fileNamePath:
|
|
136
|
+
name: u,
|
|
137
|
+
fileContent: h
|
|
138
|
+
} = u, {
|
|
139
|
+
fileNamePath: h,
|
|
130
140
|
propNamePathList: c,
|
|
131
141
|
modCode: D
|
|
132
|
-
} =
|
|
133
|
-
|
|
142
|
+
} = h;
|
|
143
|
+
p.insertTriggerToTree(u, h, c, D);
|
|
134
144
|
}
|
|
135
145
|
var y = this;
|
|
136
146
|
y.rpcRootDir = y.rootDir.searchOrCreateSubdir(O);
|
|
@@ -151,7 +161,8 @@ class t extends r {
|
|
|
151
161
|
qyFileLogger: e,
|
|
152
162
|
exclusiveFilePath: t
|
|
153
163
|
} = this;
|
|
154
|
-
return await r.stop(), await e.stop(),
|
|
164
|
+
return await r.stop(), S.log("qyFileLogger stopped."), await e.stop(), i(t),
|
|
165
|
+
Object.assign(this, {
|
|
155
166
|
rootDir: void 0,
|
|
156
167
|
indexRootDir: void 0,
|
|
157
168
|
qyKVData: void 0,
|
|
@@ -215,30 +226,30 @@ class t extends r {
|
|
|
215
226
|
var {
|
|
216
227
|
rootDir: o,
|
|
217
228
|
qyDB: a
|
|
218
|
-
} = this, i =
|
|
219
|
-
o.triggerNodes[0].insertTrigger(r, e, t, i),
|
|
229
|
+
} = this, i = u("trigger", r, i, a);
|
|
230
|
+
o.triggerNodes[0].insertTrigger(r, e, t, i), g(o, e);
|
|
220
231
|
}
|
|
221
232
|
removeTriggerFromTree(r, e) {
|
|
222
233
|
var t = this.rootDir;
|
|
223
|
-
t.triggerNodes[0].removeTrigger(r, e) &&
|
|
234
|
+
t.triggerNodes[0].removeTrigger(r, e) && g(t, e);
|
|
224
235
|
}
|
|
225
236
|
insertRpc(r, e) {
|
|
226
237
|
var {
|
|
227
238
|
rpcFunMap: t,
|
|
228
239
|
qyDB: i
|
|
229
|
-
} = this, e =
|
|
240
|
+
} = this, e = u("rpc", r, e, i);
|
|
230
241
|
e && (t[r] = e);
|
|
231
242
|
}
|
|
232
243
|
removeRpc(r) {
|
|
233
244
|
delete this.rpcFunMap[r];
|
|
234
245
|
}
|
|
235
246
|
queryFiles(r, e, t, i, o = this.rootDir) {
|
|
236
|
-
var a = [], t = (C(e) && !t && (t = 1), new
|
|
237
|
-
return
|
|
247
|
+
var a = [], t = (C(e) && !t && (t = 1), new p(t, i)), i = this.options.queryAutoCreateIndex;
|
|
248
|
+
return h(r, e, a, t, o, i), a;
|
|
238
249
|
}
|
|
239
250
|
queryFilesMulti(r, e, t, i = this.rootDir) {
|
|
240
|
-
var o, a, s = [], g = new
|
|
241
|
-
for ([ o, a ] of r)
|
|
251
|
+
var o, a, s = [], g = new p(e, t), n = this.options.queryAutoCreateIndex;
|
|
252
|
+
for ([ o, a ] of r) h(o, a, s, g, i, n);
|
|
242
253
|
return s;
|
|
243
254
|
}
|
|
244
255
|
async callRpc(e, r, t) {
|
|
@@ -252,7 +263,7 @@ class t extends r {
|
|
|
252
263
|
}
|
|
253
264
|
}
|
|
254
265
|
|
|
255
|
-
function
|
|
266
|
+
function h(r, e, t, i, o, a) {
|
|
256
267
|
e && (a = a ? n(e) : void 0, l(r, o, a, e, t, i));
|
|
257
268
|
}
|
|
258
269
|
|
package/src/QyDB.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { QyFetch } from "./QyFetch.ts";
|
|
2
|
-
import { QyBatch } from "./QyBatch.ts";
|
|
3
|
-
import { QyCache } from "./QyCache.ts";
|
|
4
1
|
import { QyCD } from "./QyCD.ts";
|
|
5
2
|
import type { QyDir } from "./QyDir.ts";
|
|
6
3
|
import type { QyFile } from "./QyFile.ts";
|
|
7
4
|
export declare class QyDB extends QyCD {
|
|
8
5
|
rootFolder: string;
|
|
9
6
|
options: {};
|
|
10
|
-
fetch:
|
|
11
|
-
batch:
|
|
12
|
-
_immediate:
|
|
7
|
+
fetch: any;
|
|
8
|
+
batch: any;
|
|
9
|
+
_immediate: any;
|
|
13
10
|
constructor(rootFolder?: string, options?: {});
|
|
14
11
|
start(options?: {}): Promise<this>;
|
|
15
12
|
stop(): Promise<void>;
|
|
@@ -17,7 +14,7 @@ export declare class QyDB extends QyCD {
|
|
|
17
14
|
createDirP(namePath: string | string[]): QyDir;
|
|
18
15
|
createFile(namePath: string | string[]): QyFile;
|
|
19
16
|
createFileP(namePath: string | string[]): QyFile;
|
|
20
|
-
createIndex(indexHostDirNamePath: string | string[] | QyDir, indexPropPathList: string[][]): any;
|
|
17
|
+
createIndex(indexHostDirNamePath: string | string[] | QyDir, indexPropPathList: string[] | string[][]): any;
|
|
21
18
|
createIndexP(indexHostDirNamePath: string | string[] | QyDir, indexPropPathList: string[][]): any;
|
|
22
19
|
delIndex(indexHostDirNamePath: string | string[] | QyDir, indexPropPath: string | string[]): any;
|
|
23
20
|
delIndexP(indexHostDirNamePath: any, indexPropPath: any): any;
|
|
@@ -37,6 +34,6 @@ export declare class QyDB extends QyCD {
|
|
|
37
34
|
removeTrigger(triggerName: any): any;
|
|
38
35
|
insertRpc(rpcFunName: any, modCode: any): any;
|
|
39
36
|
removeRpc(rpcFunName: any): any;
|
|
40
|
-
on(eventName: any, listener: any):
|
|
41
|
-
callRpc(rpcFunName: any, args: any, body
|
|
37
|
+
on(eventName: any, listener: any): any;
|
|
38
|
+
callRpc(rpcFunName: any, args: any, body?: undefined): any;
|
|
42
39
|
}
|
package/src/QyDB.js
CHANGED
package/src/QyFile.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { QyItem } from "./QyItem.ts";
|
|
2
2
|
import type { QyDir } from "./QyDir.ts";
|
|
3
3
|
export declare class QyFile extends QyItem {
|
|
4
|
+
_fileContentKey: any;
|
|
5
|
+
_fileContent: any;
|
|
4
6
|
cChangeId: number;
|
|
5
7
|
constructor(name: string | number, created?: boolean, parentDir?: QyDir);
|
|
6
8
|
get created(): boolean;
|
package/src/QyFile.js
CHANGED
|
@@ -5,27 +5,29 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SpecialOperators as t,
|
|
7
7
|
SpecialFilePaths as n,
|
|
8
|
-
getContentKey as
|
|
8
|
+
getContentKey as i,
|
|
9
9
|
isNotNullObj as a,
|
|
10
10
|
isSimpleType as C,
|
|
11
|
-
fromSingleName as
|
|
11
|
+
fromSingleName as o
|
|
12
12
|
} from "./QyUtils.js";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
getValByNamePath as
|
|
15
|
+
getValByNamePath as r
|
|
16
16
|
} from "./QyFileContentUtils.js";
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
|
-
QyIndexPropTree as
|
|
19
|
+
QyIndexPropTree as s
|
|
20
20
|
} from "./QyIndexPropTree.js";
|
|
21
21
|
|
|
22
|
-
let d = Array.isArray,
|
|
22
|
+
let d = Array.isArray, f = n.IndexPropPathsFileName, {
|
|
23
23
|
$spec: h,
|
|
24
24
|
$raw: c,
|
|
25
25
|
$clone: l
|
|
26
26
|
} = t;
|
|
27
27
|
|
|
28
|
-
class
|
|
28
|
+
class u extends e {
|
|
29
|
+
_fileContentKey;
|
|
30
|
+
_fileContent;
|
|
29
31
|
cChangeId = 0;
|
|
30
32
|
constructor(e, t = !1, n) {
|
|
31
33
|
super(e, t, n), t && n && (++n._fileCount, ++n.fileMapChangeCount);
|
|
@@ -39,7 +41,7 @@ class o extends e {
|
|
|
39
41
|
++t.fileMapChangeCount);
|
|
40
42
|
}
|
|
41
43
|
get fileContentKey() {
|
|
42
|
-
return this._fileContentKey || (this._fileContentKey =
|
|
44
|
+
return this._fileContentKey || (this._fileContentKey = i(this.fullPathHash));
|
|
43
45
|
}
|
|
44
46
|
get fileContent() {
|
|
45
47
|
var e, t = this;
|
|
@@ -53,16 +55,16 @@ class o extends e {
|
|
|
53
55
|
get qyIndexPropTree() {
|
|
54
56
|
var {
|
|
55
57
|
created: e,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
fileContent: r,
|
|
58
|
+
name: t,
|
|
59
|
+
fileContent: n,
|
|
59
60
|
underHiddenFolder: i
|
|
60
61
|
} = this;
|
|
61
|
-
if (e && i &&
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
if (e && i && t == f) {
|
|
63
|
+
e = this._qyIndexPropTree;
|
|
64
|
+
if (e) return e;
|
|
65
|
+
var r, l = this._qyIndexPropTree = new s();
|
|
66
|
+
for (r in n) l.insert(o(r));
|
|
67
|
+
return l;
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
get isFile() {
|
|
@@ -80,32 +82,32 @@ class o extends e {
|
|
|
80
82
|
}
|
|
81
83
|
view(e = l, t) {
|
|
82
84
|
var n = this.fileContent;
|
|
83
|
-
return null == n || C(n) ? n : function t(n,
|
|
84
|
-
if (
|
|
85
|
-
if (null ==
|
|
86
|
-
if (C(
|
|
87
|
-
let e =
|
|
88
|
-
if (null != e) return y(n,
|
|
89
|
-
if (C(
|
|
90
|
-
d(
|
|
91
|
-
let o = d(
|
|
85
|
+
return null == n || C(n) ? n : function t(n, i, r, l) {
|
|
86
|
+
if (r === c) return i;
|
|
87
|
+
if (null == r) return;
|
|
88
|
+
if (C(r)) return r ? l ? i : structuredClone(i) : void 0;
|
|
89
|
+
let e = r.$link;
|
|
90
|
+
if (null != e) return y(n, i, e, r[h]);
|
|
91
|
+
if (C(i)) return i;
|
|
92
|
+
d(r) && (r = Object.fromEntries(r.filter(e => e).map(e => [ e, 1 ])));
|
|
93
|
+
let o = d(i) ? [] : {};
|
|
92
94
|
let {
|
|
93
95
|
$all: s,
|
|
94
96
|
"**": a
|
|
95
|
-
} =
|
|
96
|
-
if (s || a) for (var f in
|
|
97
|
-
let e =
|
|
98
|
-
e && (o[f] = t(n,
|
|
99
|
-
} else for (var u in
|
|
100
|
-
let e =
|
|
101
|
-
e && (o[u] = t(n,
|
|
97
|
+
} = r;
|
|
98
|
+
if (s || a) for (var f in i) {
|
|
99
|
+
let e = r[f] ?? s ?? a;
|
|
100
|
+
e && (o[f] = t(n, i[f], e, l));
|
|
101
|
+
} else for (var u in r) {
|
|
102
|
+
let e = r[u];
|
|
103
|
+
e && (o[u] = t(n, i[u], e, l));
|
|
102
104
|
}
|
|
103
105
|
return o;
|
|
104
106
|
}(this, n, e, t);
|
|
105
107
|
}
|
|
106
108
|
prop(e, t = l, n) {
|
|
107
|
-
var
|
|
108
|
-
if (t) return e =
|
|
109
|
+
var i;
|
|
110
|
+
if (t) return e = r(this.fileContent, d(e) ? e : [ e ]), i = t.$link, null != i ? y(this, e, i, t[h], n) : n || t === c ? e : structuredClone(e);
|
|
109
111
|
}
|
|
110
112
|
unloadFileContent() {
|
|
111
113
|
this.created && this.fileContentLoaded && null != this._fileContent && (this._fileContent = void 0,
|
|
@@ -113,25 +115,25 @@ class o extends e {
|
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
|
|
116
|
-
function p(e, t, n,
|
|
118
|
+
function p(e, t, n, i) {
|
|
117
119
|
if (e) {
|
|
118
120
|
e = e.getFile(t);
|
|
119
|
-
if (e) return e.view(n,
|
|
121
|
+
if (e) return e.view(n, i);
|
|
120
122
|
}
|
|
121
123
|
return t;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
|
-
function y(e, t, n,
|
|
126
|
+
function y(e, t, n, i, r = !1) {
|
|
125
127
|
let l = e.qyCache.getDir(n);
|
|
126
|
-
if (d(t)) return t.map(e => p(l, e,
|
|
128
|
+
if (d(t)) return t.map(e => p(l, e, i, r));
|
|
127
129
|
if (a(t)) {
|
|
128
130
|
var o, s = {};
|
|
129
|
-
for (o in t) s[o] = p(l, o,
|
|
131
|
+
for (o in t) s[o] = p(l, o, i, r);
|
|
130
132
|
return s;
|
|
131
133
|
}
|
|
132
|
-
return p(l, t,
|
|
134
|
+
return p(l, t, i, r);
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
export {
|
|
136
|
-
|
|
138
|
+
u as QyFile
|
|
137
139
|
};
|
|
@@ -2,10 +2,7 @@ export declare function mergeContent(oldContent: any, newContent: any): any;
|
|
|
2
2
|
export declare function mergeContentChanges(oldChanges: any, newChanges: any): any;
|
|
3
3
|
export declare function mergeContentAndGenDelta(oldContent: any, newContent: any): {
|
|
4
4
|
merged: any;
|
|
5
|
-
delta:
|
|
6
|
-
oldValue: {};
|
|
7
|
-
newValue: {};
|
|
8
|
-
};
|
|
5
|
+
delta: any;
|
|
9
6
|
};
|
|
10
7
|
export declare function setValByNamePath(rootObj: any, namePath: any, value: any): any;
|
|
11
8
|
export declare function getValByNamePath(obj: any, namePath: any): any;
|
package/src/QyFileLogger.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { QyOpRunner } from "./QyOpRunner.ts";
|
|
2
2
|
export declare class QyFileLogger extends QyOpRunner {
|
|
3
|
+
qyLogFileSaver: any;
|
|
4
|
+
logFileFolder: any;
|
|
5
|
+
dateDirPath: any;
|
|
6
|
+
timeoutRef: any;
|
|
3
7
|
constructor(logFileFolder: any, options: any);
|
|
4
8
|
save(changeId: any, data: any): any;
|
|
5
9
|
getDateDirPath(): any;
|