datafolder 1.0.17 → 1.0.18

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/src/QyCD.d.ts CHANGED
@@ -13,6 +13,9 @@ export declare class QyCD {
13
13
  indexDirP(indexHostDirNamePath: string | string[] | QyDir, namePath: string | string[], parentDir?: any): QyDir | undefined;
14
14
  file(namePath: string | string[], parentDir?: any): QyFile | undefined;
15
15
  fileP(namePath: string | string[], parentDir?: any): QyFile | undefined;
16
+ fileContent(namePath: string | string[], parentDir?: any): any;
17
+ embeddingFile(namePath: string | string[], parentDir?: any): any;
18
+ embedding(namePath: string | string[], parentDir?: any): any;
16
19
  triggerFile(triggerName: any): any;
17
20
  get triggerFileList(): any;
18
21
  rpcFile(rpcName: any): any;
package/src/QyCD.js CHANGED
@@ -1,107 +1,118 @@
1
1
  import {
2
2
  isString as t,
3
- pathSplit as s
3
+ pathSplit as n
4
4
  } from "./QyUtils.js";
5
5
 
6
- class r {
6
+ class e {
7
7
  qyCache;
8
8
  currentDir;
9
- constructor(r) {
10
- this.qyCache = r;
9
+ constructor(e) {
10
+ this.qyCache = e;
11
11
  }
12
- cd(r, e = this.currentDir) {
13
- return t(r) && (r = s(r)), this.cdP(r, e);
12
+ cd(e, r = this.currentDir) {
13
+ return t(e) && (e = n(e)), this.cdP(e, r);
14
14
  }
15
- cdP(r, e = this.currentDir) {
16
- return this.currentDir = this.qyCache?.getOrCreateDir(r, e), this;
15
+ cdP(e, r = this.currentDir) {
16
+ return this.currentDir = this.qyCache.getOrCreateDir(e, r), this;
17
17
  }
18
- dir(r, e = this.currentDir) {
19
- return t(r) && (r = s(r)), this.dirP(r, e);
18
+ dir(e, r = this.currentDir) {
19
+ return t(e) && (e = n(e)), this.dirP(e, r);
20
20
  }
21
- dirP(r, e = this.currentDir) {
22
- return this.qyCache?.getDir(r, e);
21
+ dirP(e, r = this.currentDir) {
22
+ return this.qyCache.getDir(e, r);
23
23
  }
24
- indexDir(r, e, i = this.currentDir) {
25
- return t(r) && (r = s(r)), t(e) && (e = s(e)), this.indexDirP(r, e, i);
24
+ indexDir(e, r, i = this.currentDir) {
25
+ return t(e) && (e = n(e)), t(r) && (r = n(r)), this.indexDirP(e, r, i);
26
26
  }
27
- indexDirP(r, e, i = this.currentDir) {
28
- var t = this.qyCache, r = t?.getDir(r, i);
29
- if (r) {
30
- i = t?.getIndexDir(r);
31
- if (i) return e && 0 != e.length ? t?.getDir(e, i) : i;
27
+ indexDirP(e, r, i = this.currentDir) {
28
+ var t = this.qyCache, e = t.getDir(e, i);
29
+ if (e) {
30
+ i = t.getIndexDir(e);
31
+ if (i) return r && 0 != r.length ? t.getDir(r, i) : i;
32
32
  }
33
33
  }
34
- file(r, e = this.currentDir) {
35
- return t(r) && (r = s(r)), this.fileP(r, e);
34
+ file(e, r = this.currentDir) {
35
+ return t(e) && (e = n(e)), this.fileP(e, r);
36
36
  }
37
- fileP(r, e = this.currentDir) {
38
- return this.qyCache?.getFile(r, e);
37
+ fileP(e, r = this.currentDir) {
38
+ return this.qyCache.getFile(e, r);
39
39
  }
40
- triggerFile(r) {
41
- return this.qyCache.getTriggerFile(r);
40
+ fileContent(e, r = this.currentDir) {
41
+ return this.file(e, r)?.fileContent;
42
+ }
43
+ embeddingFile(e, r = this.currentDir) {
44
+ t(e) && (e = n(e));
45
+ var i = this.qyCache;
46
+ return i.getEmbeddingFile(i.getOrCreateFile(e, r).fullPathHash);
47
+ }
48
+ embedding(e, r = this.currentDir) {
49
+ return this.embeddingFile(e, r)?.fileContent;
50
+ }
51
+ triggerFile(e) {
52
+ return this.qyCache.getTriggerFile(e);
42
53
  }
43
54
  get triggerFileList() {
44
55
  return this.qyCache.triggerFileList;
45
56
  }
46
- rpcFile(r) {
47
- return this.qyCache.getRpcFile(r);
57
+ rpcFile(e) {
58
+ return this.qyCache.getRpcFile(e);
48
59
  }
49
60
  get rpcFileList() {
50
61
  return this.qyCache.rpcFileList;
51
62
  }
52
- view(r, e = void 0, i = this.currentDir) {
53
- return t(r) && (r = s(r)), this.viewP(r, e, i);
63
+ view(e, r = void 0, i = this.currentDir) {
64
+ return t(e) && (e = n(e)), this.viewP(e, r, i);
54
65
  }
55
- viewP(r, e, i = this.currentDir) {
56
- return this.qyCache.getFile(r, i)?.view(e);
66
+ viewP(e, r, i = this.currentDir) {
67
+ return this.qyCache.getFile(e, i)?.view(r);
57
68
  }
58
- queryFiles(r, e, i = void 0, t = void 0, s = this.currentDir) {
59
- return this.qyCache.queryFiles(r, e, i, t, s);
69
+ queryFiles(e, r, i = void 0, t = void 0, n = this.currentDir) {
70
+ return this.qyCache.queryFiles(e, r, i, t, n);
60
71
  }
61
- queryFilesMulti(r, e, i, t = this.currentDir) {
62
- return this.qyCache.queryFilesMulti(r, e, i, t);
72
+ queryFilesMulti(e, r, i, t = this.currentDir) {
73
+ return this.qyCache.queryFilesMulti(e, r, i, t);
63
74
  }
64
- queryTree(r, e, i, t, s, h = this.currentDir) {
65
- return n(this.qyCache.queryFiles(r, e, t, s, h), i);
75
+ queryTree(e, r, i, t, n, s = this.currentDir) {
76
+ return h(this.qyCache.queryFiles(e, r, t, n, s), i);
66
77
  }
67
- queryTreeMulti(r, e, i, t, s = this.currentDir) {
68
- return n(this.qyCache.queryFilesMulti(r, i, t, s), e);
78
+ queryTreeMulti(e, r, i, t, n = this.currentDir) {
79
+ return h(this.qyCache.queryFilesMulti(e, i, t, n), r);
69
80
  }
70
81
  resetCurrentDir() {
71
82
  this.currentDir = void 0;
72
83
  }
73
- fileListToTree(r, e) {
74
- return n(r, e);
84
+ fileListToTree(e, r) {
85
+ return h(e, r);
75
86
  }
76
87
  }
77
88
 
78
- function n(r, i) {
79
- var t, s = {};
80
- for (t of r) {
81
- var h, n = t.parentList;
82
- let e = s;
83
- for (h of n) {
89
+ function h(e, i) {
90
+ var t, n = {};
91
+ for (t of e) {
92
+ var s, h = t.parentList;
93
+ let r = n;
94
+ for (s of h) {
84
95
  var {
85
96
  name: u,
86
- fullPathHash: c
87
- } = h;
88
- let r = e.subdirMap;
89
- r = r || (e.subdirMap = {}), e = (e = r[u]) || (r[u] = {
90
- fullPathHash: c
97
+ fullPathHash: l
98
+ } = s;
99
+ let e = r.subdirMap;
100
+ e = e || (r.subdirMap = {}), r = (r = e[u]) || (e[u] = {
101
+ fullPathHash: l
91
102
  });
92
103
  }
93
- let r = e.fileMap;
94
- (r = r || (e.fileMap = {}))[t.name] = {
104
+ let e = r.fileMap;
105
+ (e = e || (r.fileMap = {}))[t.name] = {
95
106
  fileContent: t.view(i, !0),
96
107
  fileContentKey: t.fileContentKey
97
108
  };
98
109
  }
99
110
  return {
100
- tree: s,
101
- count: r.length
111
+ tree: n,
112
+ count: e.length
102
113
  };
103
114
  }
104
115
 
105
116
  export {
106
- r as QyCD
117
+ e as QyCD
107
118
  };
package/src/QyCache.d.ts CHANGED
@@ -12,6 +12,8 @@ export declare class QyCache extends EventEmitter {
12
12
  rpcRootDir: any;
13
13
  indexRootDir: any;
14
14
  expireRootDir: any;
15
+ embeddingRootDir: any;
16
+ h2FRootDir: any;
15
17
  exclusiveFilePath: any;
16
18
  qyKVData: any;
17
19
  qyFileLogger: any;
@@ -32,6 +34,12 @@ export declare class QyCache extends EventEmitter {
32
34
  getOrCreateTriggerFile(triggerName: any): any;
33
35
  getExpireInfoFile(fullPathHash: any, type?: string): any;
34
36
  getOrCreateExpireInfoFile(fullPathHash: any, type?: string): any;
37
+ getH2FFile(fullPathHash: any): any;
38
+ getOrCreateH2FFile(fullPathHash: any): any;
39
+ h2F(fullPathHash: any): QyFile | undefined;
40
+ getEmbeddingFile(fullPathHash: any): any;
41
+ getOrCreateEmbeddingFile(fullPathHash: any): any;
42
+ getEmbedding(fullPathHash: any): any;
35
43
  get triggerFileList(): any;
36
44
  getRpcFile(rpcFunName: any): any;
37
45
  getOrCreateRpcFile(rpcFunName: any): any;
package/src/QyCache.js CHANGED
@@ -1,34 +1,34 @@
1
1
  import {
2
- join as v
2
+ join as f
3
3
  } from "node:path";
4
4
 
5
5
  import r from "node:events";
6
6
 
7
7
  import {
8
- QyDir as p
8
+ QyDir as D
9
9
  } from "./QyDir.js";
10
10
 
11
11
  import {
12
- QyFileLogger as u
12
+ QyFileLogger as c
13
13
  } from "./QyFileLogger.js";
14
14
 
15
15
  import {
16
- QyKVData as d
16
+ QyKVData as F
17
17
  } from "./QyKVData.js";
18
18
 
19
19
  import {
20
- QyTriggerNode as f,
20
+ QyTriggerNode as v,
21
21
  updateTriggerNodes as s
22
22
  } from "./QyTrigger.js";
23
23
 
24
24
  import {
25
- isString as x,
26
- lockExclusiveFilePath as C,
25
+ isString as C,
26
+ lockExclusiveFilePath as R,
27
27
  unlockExclusiveFilePath as i
28
28
  } from "./QyUtils.js";
29
29
 
30
30
  import {
31
- dumpStructure as q
31
+ dumpStructure as x
32
32
  } from "./QyStructure.js";
33
33
 
34
34
  import {
@@ -37,11 +37,11 @@ import {
37
37
  } from "./QyIndex.js";
38
38
 
39
39
  import {
40
- getDefaultOptions as h
40
+ getDefaultOptions as m
41
41
  } from "./QyDefaultOptions.js";
42
42
 
43
43
  import {
44
- ensureDir as R,
44
+ ensureDir as q,
45
45
  SpecialFilePaths as e
46
46
  } from "./QyUtils.js";
47
47
 
@@ -50,24 +50,26 @@ import {
50
50
  } from "./QyUnionNode.js";
51
51
 
52
52
  import {
53
- QyKVDataLoader as O
53
+ QyKVDataLoader as b
54
54
  } from "./QyKVDataLoader.js";
55
55
 
56
56
  import {
57
- requireFromModCode as c
57
+ requireFromModCode as d
58
58
  } from "./QyMod.js";
59
59
 
60
60
  import {
61
- logger as Q
61
+ logger as O
62
62
  } from "./QyLogger.js";
63
63
 
64
64
  let {
65
- HiddenFolderName: D,
66
- IndexDirPath: F,
67
- TriggerDirPath: P,
68
- RpcDirPath: S,
69
- ExpireDirPath: m,
70
- MetaFilePath: t
65
+ HiddenFolderName: y,
66
+ IndexDirPath: P,
67
+ TriggerDirPath: Q,
68
+ RpcDirPath: w,
69
+ ExpireDirPath: S,
70
+ MetaFilePath: t,
71
+ EmbeddingDirPath: L,
72
+ H2FDirPath: E
71
73
  } = e;
72
74
 
73
75
  class o extends r {
@@ -81,35 +83,42 @@ class o extends r {
81
83
  rpcRootDir;
82
84
  indexRootDir;
83
85
  expireRootDir;
86
+ embeddingRootDir;
87
+ h2FRootDir;
84
88
  exclusiveFilePath;
85
89
  qyKVData;
86
90
  qyFileLogger;
87
91
  rpcFunMap = {};
88
92
  constructor(r, e, t) {
89
93
  super(), e = {
90
- ...h("QyCache"),
94
+ ...m("QyCache"),
91
95
  ...e
92
- }, o = new p("", !0, void 0, i = this), a = m.at(-1), s = F.at(-1), l = new p(D, !0, o),
93
- n = new p(a, !0, l), g = new p(s, !0, l), o._subdirMap = {
94
- [D]: l
95
- }, l._subdirMap = {
96
- [a]: n,
97
- [s]: g
96
+ }, o = new D("", !0, void 0, i = this), a = S.at(-1), s = P.at(-1), n = L.at(-1),
97
+ g = E.at(-1), p = new D(y, !0, o), l = new D(a, !0, p), d = new D(s, !0, p),
98
+ h = new D(n, !0, p), u = new D(g, !0, p), o._subdirMap = {
99
+ [y]: p
100
+ }, p._subdirMap = {
101
+ [a]: l,
102
+ [s]: d,
103
+ [n]: h,
104
+ [g]: u
98
105
  }, Object.assign(i, {
99
106
  rootDir: o,
100
- expireRootDir: n,
101
- indexRootDir: g
107
+ expireRootDir: l,
108
+ indexRootDir: d,
109
+ embeddingRootDir: h,
110
+ h2FRootDir: u
102
111
  });
103
- var i, o, a, s, n, g, l = v(r, "qykv");
112
+ var i, o, a, s, n, g, l, d, h, u, p = f(r, "qykv");
104
113
  Object.assign(this, {
105
114
  rootFolder: r,
106
115
  options: e,
107
116
  qyDB: t,
108
- kvFolder: l,
109
- rpcFolder: v(r, "rpc"),
110
- exclusiveFilePath: v(r, ".opened"),
111
- qyKVData: new d(l, e, this),
112
- qyFileLogger: new u(v(r, "qylog"), e)
117
+ kvFolder: p,
118
+ rpcFolder: f(r, "rpc"),
119
+ exclusiveFilePath: f(r, ".opened"),
120
+ qyKVData: new F(p, e, this),
121
+ qyFileLogger: new c(f(r, "qylog"), e)
113
122
  });
114
123
  }
115
124
  async start() {
@@ -122,16 +131,16 @@ class o extends r {
122
131
  exclusiveFilePath: a,
123
132
  rootDir: s
124
133
  } = this;
125
- Q.log(`Starting at ${r}...`);
134
+ O.log(`Starting at ${r}...`);
126
135
  try {
127
- await R(e), o.start();
136
+ await q(e), o.start();
128
137
  var [ {
129
138
  maxChangeId: n,
130
139
  loadedMaxAclNum: g,
131
140
  qySnapshots: l,
132
- aclKeyValueMap: p
133
- } ] = await Promise.all([ ((r, e) => (r = new O(r, e)).load())(e, t), C(a) ]);
134
- i.start(n, g, l, p);
141
+ aclKeyValueMap: d
142
+ } ] = await Promise.all([ ((r, e) => (r = new b(r, e)).load())(e, t), R(a) ]);
143
+ i.start(n, g, l, d);
135
144
  } catch (r) {
136
145
  throw o.stop(), r;
137
146
  }
@@ -142,46 +151,48 @@ class o extends r {
142
151
  } = e;
143
152
  for (var o of t) r(o);
144
153
  }(s);
145
- var u = this, e = u.rootDir;
146
- e.triggerNodes = [ new f() ];
147
- for (d of (e = u.triggerRootDir = e.searchOrCreateSubdir(P)).fileList) {
154
+ var h = this, e = h.rootDir;
155
+ e.triggerNodes = [ new v() ];
156
+ for (u of (e = h.triggerRootDir = e.searchOrCreateSubdir(Q)).fileList) {
148
157
  var {
149
- name: d,
150
- fileContent: h
151
- } = d, [ h, c, D ] = h;
152
- u.insertTriggerToTree(d, h, c, D);
158
+ name: u,
159
+ fileContent: p
160
+ } = u, [ p, D, c ] = p;
161
+ h.insertTriggerToTree(u, p, D, c);
153
162
  }
154
163
  var F = this;
155
- F.rpcRootDir = F.rootDir.searchOrCreateSubdir(S);
164
+ F.rpcRootDir = F.rootDir.searchOrCreateSubdir(w);
156
165
  for (m of F.rpcRootDir.fileList) {
157
166
  var {
158
167
  name: m,
159
168
  fileContent: y
160
169
  } = m;
161
- x(y) && F.insertRpc(m, y);
170
+ C(y) && F.insertRpc(m, y);
162
171
  }
163
- return t.dumpStructureAtStart && await q(v(r, "qystruct"), s), Q.log("Started."),
172
+ return t.dumpStructureAtStart && await x(f(r, "qystruct"), s), O.log("Started."),
164
173
  this;
165
174
  }
166
175
  async stop() {
167
- Q.log("Stopping...");
176
+ O.log("Stopping...");
168
177
  var {
169
178
  qyKVData: r,
170
179
  qyFileLogger: e,
171
180
  exclusiveFilePath: t
172
181
  } = this;
173
- return await r.stop(), Q.log("QyFileLogger stopped."), await e.stop(), i(t),
182
+ return await r.stop(), O.log("QyFileLogger stopped."), await e.stop(), i(t),
174
183
  Object.assign(this, {
175
184
  rootDir: void 0,
176
185
  indexRootDir: void 0,
177
186
  expireRootDir: void 0,
178
187
  triggerRootDir: void 0,
179
188
  rpcRootDir: void 0,
189
+ embeddingRootDir: void 0,
190
+ h2FRootDir: void 0,
180
191
  qyKVData: void 0,
181
192
  rpcFunMap: void 0,
182
193
  qyDB: void 0,
183
194
  qyFileLogger: void 0
184
- }), Q.log("Stopped."), this;
195
+ }), O.log("Stopped."), this;
185
196
  }
186
197
  increaseChangeId() {
187
198
  return this.qyKVData.increaseChangeId();
@@ -197,22 +208,22 @@ class o extends r {
197
208
  return t && s.save(r, t), a.save(r, e, i, o);
198
209
  }
199
210
  getFile(r, e = this.rootDir) {
200
- return r.isFile ? r : x(r) ? e.getFile(r) : e.searchFile(r);
211
+ return r.isFile ? r : C(r) ? e.getFile(r) : e.searchFile(r);
201
212
  }
202
213
  getDir(r, e = this.rootDir) {
203
- return r.isDir ? r : x(r) ? e.getSubdir(r) : e.searchSubdir(r);
214
+ return r.isDir ? r : C(r) ? e.getSubdir(r) : e.searchSubdir(r);
204
215
  }
205
216
  getOrCreateFile(r, e = this.rootDir) {
206
- return r.isFile ? r : x(r) ? e.getOrCreateFile(r) : e.searchOrCreateFile(r);
217
+ return r.isFile ? r : C(r) ? e.getOrCreateFile(r) : e.searchOrCreateFile(r);
207
218
  }
208
219
  getOrCreateDir(r, e = this.rootDir) {
209
- return r.isDir ? r : x(r) ? e.getOrCreateSubdir(r) : e.searchOrCreateSubdir(r);
220
+ return r.isDir ? r : C(r) ? e.getOrCreateSubdir(r) : e.searchOrCreateSubdir(r);
210
221
  }
211
222
  getIndexDir(r) {
212
- return this.indexRootDir.searchSubdir(y(r.fullPathHash));
223
+ return this.indexRootDir.searchSubdir(p(r.fullPathHash));
213
224
  }
214
225
  getOrCreateIndexDir(r) {
215
- return this.indexRootDir.searchOrCreateSubdir(y(r.fullPathHash));
226
+ return this.indexRootDir.searchOrCreateSubdir(p(r.fullPathHash));
216
227
  }
217
228
  getTriggerFile(r) {
218
229
  return this.triggerRootDir.getFile(r);
@@ -221,10 +232,29 @@ class o extends r {
221
232
  return this.triggerRootDir.getOrCreateFile(r);
222
233
  }
223
234
  getExpireInfoFile(r, e = "c") {
224
- return this.expireRootDir.searchFile(a(r, e));
235
+ return this.expireRootDir.searchFile(u(r, e));
225
236
  }
226
237
  getOrCreateExpireInfoFile(r, e = "c") {
227
- return this.expireRootDir.searchOrCreateFile(a(r, e));
238
+ return this.expireRootDir.searchOrCreateFile(u(r, e));
239
+ }
240
+ getH2FFile(r) {
241
+ return this.h2FRootDir.searchFile(a(r));
242
+ }
243
+ getOrCreateH2FFile(r) {
244
+ return this.h2FRootDir.searchOrCreateFile(a(r));
245
+ }
246
+ h2F(r) {
247
+ r = this.getH2FFile(r);
248
+ if (r) return this.getOrCreateFile(r.fileContent);
249
+ }
250
+ getEmbeddingFile(r) {
251
+ return this.embeddingRootDir.searchFile(h(r));
252
+ }
253
+ getOrCreateEmbeddingFile(r) {
254
+ return this.embeddingRootDir.searchOrCreateFile(h(r));
255
+ }
256
+ getEmbedding(r) {
257
+ return this.embeddingRootDir.searchFile(h(r))?.fileContent;
228
258
  }
229
259
  get triggerFileList() {
230
260
  return this.triggerRootDir.fileList;
@@ -245,7 +275,7 @@ class o extends r {
245
275
  var {
246
276
  rootDir: o,
247
277
  qyDB: a
248
- } = this, i = c("trigger", r, i, a);
278
+ } = this, i = d("trigger", r, i, a);
249
279
  o.triggerNodes[0].insertTrigger(r, e, t, i), s(o, e);
250
280
  }
251
281
  removeTriggerFromTree(r, e) {
@@ -256,28 +286,28 @@ class o extends r {
256
286
  var {
257
287
  rpcFunMap: t,
258
288
  qyDB: i
259
- } = this, e = c("rpc", r, e, i);
289
+ } = this, e = d("rpc", r, e, i);
260
290
  e && (t[r] = e);
261
291
  }
262
292
  removeRpc(r) {
263
293
  delete this.rpcFunMap[r];
264
294
  }
265
295
  queryFiles(r, e, t, i, o = this.rootDir) {
266
- var a = [], t = (x(e) && !t && (t = 1), new l(t, i)), i = this.options.queryAutoCreateIndex;
267
- return w(r, e, a, t, o, i), a;
296
+ var a = [], t = (C(e) && !t && (t = 1), new l(t, i)), i = this.options.queryAutoCreateIndex;
297
+ return I(r, e, a, t, o, i), a;
268
298
  }
269
299
  queryFilesMulti(r, e, t, i = this.rootDir) {
270
300
  var o, a, s = [], n = new l(e, t), g = this.options.queryAutoCreateIndex;
271
- for ([ o, a ] of r) w(o, a, s, n, i, g);
301
+ for ([ o, a ] of r) I(o, a, s, n, i, g);
272
302
  return s;
273
303
  }
274
304
  async callRpc(e, r, t) {
275
305
  var i, o = this.rpcFunMap[e];
276
- if (!o) return Q.warn(i = `RPC ${e} not implemented.`), new Error(i);
306
+ if (!o) return O.warn(i = `RPC ${e} not implemented.`), new Error(i);
277
307
  try {
278
308
  return await o(r, t);
279
309
  } catch (r) {
280
- return Q.error(`Calling RPC ${e} failed:`, r), r;
310
+ return O.error(`Calling RPC ${e} failed:`, r), r;
281
311
  }
282
312
  }
283
313
  monitorItemExpire(r, e) {
@@ -294,15 +324,23 @@ class o extends r {
294
324
  }
295
325
  }
296
326
 
297
- function a(r, e) {
327
+ function a(r) {
328
+ return [ r.substring(0, 2), r ];
329
+ }
330
+
331
+ function h(r) {
332
+ return [ r.substring(0, 2), r ];
333
+ }
334
+
335
+ function u(r, e) {
298
336
  return [ e, r.substring(0, 2), r ];
299
337
  }
300
338
 
301
- function y(r) {
339
+ function p(r) {
302
340
  return [ r[0], r ];
303
341
  }
304
342
 
305
- function w(r, e, t, i, o, a) {
343
+ function I(r, e, t, i, o, a) {
306
344
  e && (a = a ? n(e) : void 0, g(r, o, a, e, t, i));
307
345
  }
308
346
 
package/src/QyDB.js CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  logger as m
34
34
  } from "./QyLogger.js";
35
35
 
36
- let p = e(n, "../data/sampleDataFolder");
36
+ let d = e(n, "../data/sampleDataFolder");
37
37
 
38
38
  class l extends t {
39
39
  rootFolder;
@@ -42,12 +42,12 @@ class l extends t {
42
42
  batch;
43
43
  _immediate;
44
44
  creationTime;
45
- constructor(e = p, t) {
46
- s(e) && (t = e, e = p), super(), this.options = {
45
+ constructor(e = d, t) {
46
+ s(e) && (t = e, e = d), super(), this.options = {
47
47
  ...o("QyDB"),
48
48
  ...t
49
49
  }, this.rootFolder = e;
50
- for (let i of [ "createIndex", "delIndex", "insert", "put", "remove", "delDir", "delFile", "delContent", "insertTrigger", "removeTrigger", "insertRpc", "removeRpc", "expireFile", "expireDir", "expireContent", "expireFileM", "expireDirM", "expireContentM", "removeFileExpire", "removeDirExpire", "removeContentExpire" ]) this[i] = (...e) => {
50
+ for (let i of [ "createIndex", "delIndex", "insert", "put", "remove", "delDir", "delFile", "delContent", "insertTrigger", "removeTrigger", "insertRpc", "removeRpc", "insertEmbedding", "delEmbedding", "expireFile", "expireDir", "expireContent", "expireFileM", "expireDirM", "expireContentM", "removeFileExpire", "removeDirExpire", "removeContentExpire" ]) this[i] = (...e) => {
51
51
  var t = this.currentBatch;
52
52
  return t[i].apply(t, e).run();
53
53
  };
package/src/QyFile.js CHANGED
@@ -10,7 +10,8 @@ import {
10
10
  isSimpleType as h,
11
11
  fromSingleName as s,
12
12
  isEmptyObj as r,
13
- getNowTime as l
13
+ getNowTime as l,
14
+ isArray as d
14
15
  } from "./QyUtils.js";
15
16
 
16
17
  import {
@@ -25,13 +26,13 @@ import {
25
26
  handleExpiredProps as u
26
27
  } from "./QyExpire.js";
27
28
 
28
- let d = Array.isArray, C = n.IndexPropPathsFileName, {
29
+ let C = n.IndexPropPathsFileName, {
29
30
  $spec: p,
30
31
  $raw: c,
31
- $clone: y
32
+ $clone: m
32
33
  } = t;
33
34
 
34
- class m extends e {
35
+ class y extends e {
35
36
  _fileContentKey;
36
37
  _fileContent;
37
38
  cChangeId = 0;
@@ -80,7 +81,7 @@ class m extends e {
80
81
  get clonedContent() {
81
82
  return structuredClone(this.fileContent);
82
83
  }
83
- view(e = y, t) {
84
+ view(e = m, t) {
84
85
  var n = this.fileContent;
85
86
  return null == n || h(n) ? n : function t(n, i, r, o) {
86
87
  if (r === c) return i;
@@ -105,7 +106,7 @@ class m extends e {
105
106
  return s;
106
107
  }(this, n, e, t);
107
108
  }
108
- prop(e, t = y, n) {
109
+ prop(e, t = m, n) {
109
110
  var i;
110
111
  if (t) return e = o(this.fileContent, d(e) ? e : [ e ]), i = t.$link, null != i ? v(this, e, i, t[p], n) : n || t === c ? e : structuredClone(e);
111
112
  }
@@ -161,5 +162,5 @@ function v(e, t, n, i, r = !1) {
161
162
  }
162
163
 
163
164
  export {
164
- m as QyFile
165
+ y as QyFile
165
166
  };
@@ -1,5 +1,4 @@
1
1
  export declare function mergeContent(oldContent: any, newContent: any): any;
2
- export declare function mergeChanges(oldChanges: any, newChanges: any): any;
3
2
  export declare function mergeContentAndGenDelta(oldContent: any, newContent: any): {
4
3
  merged: any;
5
4
  delta: any;