datafolder 1.0.41 → 1.0.43

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.
Files changed (56) hide show
  1. package/ChangeLog.md +4 -0
  2. package/package.json +1 -1
  3. package/scripts/airbnb_queries.js +1 -1
  4. package/src/QyAcl.js +78 -83
  5. package/src/QyAclSaver.js +11 -9
  6. package/src/QyAclSaver_Worker.d.ts +3 -3
  7. package/src/QyAclSaver_Worker.js +8 -8
  8. package/src/QyCache.d.ts +1 -1
  9. package/src/QyCache.js +69 -71
  10. package/src/QyDir.d.ts +3 -3
  11. package/src/QyDir.js +134 -129
  12. package/src/QyEmbeddings.d.ts +3 -2
  13. package/src/QyEmbeddings.js +56 -47
  14. package/src/QyExpire.d.ts +9 -5
  15. package/src/QyExpire.js +39 -32
  16. package/src/QyExpireProcessor.d.ts +4 -0
  17. package/src/QyExpireProcessor.js +22 -0
  18. package/src/QyExpireProcessor_Worker.d.ts +19 -0
  19. package/src/QyExpireProcessor_Worker.js +111 -0
  20. package/src/QyExpire_Worker.d.ts +5 -5
  21. package/src/QyExpire_Worker.js +21 -21
  22. package/src/QyFileLogger.d.ts +1 -1
  23. package/src/QyFileLogger.js +14 -14
  24. package/src/QyIndexPropTree.d.ts +0 -1
  25. package/src/QyIndexPropTree.js +45 -47
  26. package/src/QyIntersectNode.d.ts +1 -1
  27. package/src/QyIntersectNode.js +2 -2
  28. package/src/QyKVData.d.ts +2 -2
  29. package/src/QyKVData.js +81 -77
  30. package/src/QyKVDataCleaner.js +13 -11
  31. package/src/QyKVDataCleaner_Worker.d.ts +4 -0
  32. package/src/QyKVDataCleaner_Worker.js +55 -43
  33. package/src/QyKVDataSaver.js +14 -12
  34. package/src/QyKVDataSaver_Worker.d.ts +4 -4
  35. package/src/QyKVDataSaver_Worker.js +12 -12
  36. package/src/QyLogFileSaver.js +10 -12
  37. package/src/QyLogFileSaver_Worker.d.ts +2 -0
  38. package/src/QyLogFileSaver_Worker.js +12 -6
  39. package/src/QyMessageWorker.js +21 -28
  40. package/src/QyMessager.d.ts +2 -2
  41. package/src/QyMessager.js +59 -59
  42. package/src/QySnapshotCompactor.js +13 -15
  43. package/src/QySnapshotCompactor_Worker.d.ts +2 -0
  44. package/src/QySnapshotCompactor_Worker.js +10 -3
  45. package/src/QySnapshotSaver.js +12 -14
  46. package/src/QySnapshotSaver_Worker.d.ts +3 -3
  47. package/src/QySnapshotSaver_Worker.js +23 -23
  48. package/src/QySnapshots.js +170 -162
  49. package/src/QyTrigger.d.ts +2 -2
  50. package/src/QyTrigger.js +58 -64
  51. package/src/QyUnionNode.d.ts +7 -5
  52. package/src/QyUnionNode.js +52 -53
  53. package/src/QyUtils.d.ts +2 -1
  54. package/src/QyUtils.js +45 -27
  55. package/static/codemirror.bundle/editor.bundle.js +12 -3
  56. package/test/testQyGraphQL.js +7 -5
@@ -11,6 +11,8 @@ export default class QySnapshotCompactor_Worker extends QyMessageWorker {
11
11
  kvFolder: any;
12
12
  options: any;
13
13
  });
14
+ cast_compactSnapshots(pMCompactSnapshotList: any, vLCompactSnapshotList: any, combiningSnapshotList: any): void;
15
+ cast_saveSnapshotInfos(): void;
14
16
  _op_start(): void;
15
17
  _op_stop(): Promise<void>;
16
18
  _op_compactSnapshots(pMCompactSnapshotList: any, vLCompactSnapshotList: any, combiningSnapshotList: any): Promise<void>;
@@ -48,6 +48,12 @@ export default class extends a {
48
48
  this.kvFolder = a, this.snapshotFolder = o, this.qySnapshots = new n(o, s),
49
49
  this.qyKVDataCleaner = new p(this, a, s);
50
50
  }
51
+ cast_compactSnapshots(a, s, o) {
52
+ this.compactSnapshots(a, s, o);
53
+ }
54
+ cast_saveSnapshotInfos() {
55
+ this.saveSnapshotInfos();
56
+ }
51
57
  _op_start() {
52
58
  this.qyKVDataCleaner.start();
53
59
  }
@@ -115,7 +121,7 @@ export default class extends a {
115
121
  combinedSnapshotNumVerList: p,
116
122
  posMap: n.posMap
117
123
  };
118
- })(this, s, t)), await Promise.all(e), this.postParent("onCompactUpdates", t);
124
+ })(this, s, t)), await Promise.all(e), this.postParent("_on_compactUpdates", t);
119
125
  }
120
126
  async _op_saveSnapshotInfos() {
121
127
  var a, s, {
@@ -135,9 +141,10 @@ export default class extends a {
135
141
  }
136
142
  for (h in e) {
137
143
  var M = e[h];
138
- f.push([ h, M.pMVersion ]), n.cleanVLFiles(h, M.vLVersion);
144
+ f.push([ h, M.pMVersion ]), n.cast_cleanVLFiles(h, M.vLVersion);
139
145
  }
140
- n.cleanPMFiles(f), 0 < p.length && (n.removeSnapshotsFiles(p), p.length = 0);
146
+ n.cast_cleanPMFiles(f), 0 < p.length && (n.cast_removeSnapshotsFiles(p),
147
+ p.length = 0);
141
148
  }
142
149
  }
143
150
 
@@ -3,25 +3,23 @@ import {
3
3
  } from "./QyMessager.js";
4
4
 
5
5
  import {
6
- getDefaultOptions as t
6
+ getDefaultOptions as e
7
7
  } from "./QyDefaultOptions.js";
8
8
 
9
- import {
10
- emptyArray as a
11
- } from "./QyUtils.js";
9
+ import t from "./QySnapshotSaver_Worker.js";
12
10
 
13
- class e extends s {
14
- constructor(s, e, r) {
15
- super("QySnapshotSaver_Worker", {
16
- kvFolder: e,
17
- options: r = {
18
- ...t("QySnapshotSaver"),
19
- ...r
20
- }
21
- }, r, a, [ "saveSnapshot", "castSave", "releaseSnapshot" ], s);
11
+ class o extends s {
12
+ constructor(s, o, r) {
13
+ r = {
14
+ ...e("QySnapshotSaver"),
15
+ ...r
16
+ }, super(t, {
17
+ kvFolder: o,
18
+ options: r
19
+ }, r, s);
22
20
  }
23
21
  }
24
22
 
25
23
  export {
26
- e as QySnapshotSaver
24
+ o as QySnapshotSaver
27
25
  };
@@ -13,10 +13,10 @@ export default class QySnapshotSaver_Worker extends QyMessageWorker {
13
13
  kvFolder: any;
14
14
  options: any;
15
15
  });
16
+ cast_save(changeId: any, cmdArgAsListArray: any, syncList: any): void;
17
+ cast_saveSnapshot(maxSnapshotNum: any): void;
18
+ cast_releaseSnapshot(snapshotNum: any): void;
16
19
  _op_start(maxChangeId: any, loadedMaxAclNum: any, aclKeyValueMap: any): void;
17
- castSave(changeId: any, cmdArgAsListArray: any, syncList: any): void;
18
- saveSnapshot(maxSnapshotNum: any): Promise<void>;
19
- releaseSnapshot(snapshotNum: any): void;
20
20
  _op_stop(): Promise<number>;
21
21
  _op_waitForSnapshotSaved([saveMaxSnapshotInfoPromise, outdates]: [any, any]): Promise<void>;
22
22
  }
@@ -19,7 +19,7 @@ import {
19
19
  } from "./QyKVDataCleaner.js";
20
20
 
21
21
  import {
22
- logger as y
22
+ logger as d
23
23
  } from "./QyLogger.js";
24
24
 
25
25
  export default class extends a {
@@ -42,24 +42,21 @@ export default class extends a {
42
42
  this.kvFolder = a, this.snapshotFolder = e, this.qySnapshots = new n(e, s),
43
43
  this.qyKVDataCleaner = new p(this, a, s);
44
44
  }
45
- _op_start(a, s, e) {
46
- this.maxChangeId = a, this.qyKVDataCleaner.start(), s && this.waitForSnapshotSaved(h(this, s, a, e));
47
- }
48
- castSave(a, s, e) {
45
+ cast_save(a, s, e) {
49
46
  var {
50
47
  aclKeyValueMap: t,
51
48
  qySnapshots: o
52
49
  } = this;
53
50
  o.applyCmdObj(s, t, e), this.maxChangeId = a;
54
51
  }
55
- async saveSnapshot(a) {
52
+ cast_saveSnapshot(a) {
56
53
  var {
57
54
  maxChangeId: s,
58
55
  aclKeyValueMap: e
59
56
  } = this;
60
57
  this.aclKeyValueMap = {}, this.waitForSnapshotSaved(h(this, a, s, e));
61
58
  }
62
- releaseSnapshot(a) {
59
+ cast_releaseSnapshot(a) {
63
60
  var s, e = this.qySnapshots, {
64
61
  numToSnapshotMap: t,
65
62
  keyToSnapshotMap: o
@@ -67,6 +64,9 @@ export default class extends a {
67
64
  for (s in delete t.keyValueMap, a) delete o[s];
68
65
  e.delSnapshot(t), global.gc && global.gc();
69
66
  }
67
+ _op_start(a, s, e) {
68
+ this.maxChangeId = a, this.qyKVDataCleaner.start(), s && this.waitForSnapshotSaved(h(this, s, a, e));
69
+ }
70
70
  async _op_stop() {
71
71
  var {
72
72
  qySnapshots: a,
@@ -82,10 +82,10 @@ export default class extends a {
82
82
  qySnapshots: l,
83
83
  options: i
84
84
  } = this;
85
- for (e in r.cleanAclFiles(a), 0 < h.length && (await Promise.all(h), h.length = 0),
86
- p) h.push(l.saveSnapshotInfo(e, p[e]));
87
- 0 < h.length && (await Promise.all(h), h.length = 0), 0 < s.length && r.removeSnapshotsFiles(s),
88
- 0 < o.length && r.cleanPMFiles(o), 0 < n.length && r.cleanVLFiles(n[0], n[1]);
85
+ for (e in r.cast_cleanAclFiles(a), 0 < h.length && (await Promise.all(h),
86
+ h.length = 0), p) h.push(l.saveSnapshotInfo(e, p[e]));
87
+ 0 < h.length && (await Promise.all(h), h.length = 0), 0 < s.length && r.cast_removeSnapshotsFiles(s),
88
+ 0 < o.length && r.cast_cleanPMFiles(o), 0 < n.length && r.cast_cleanVLFiles(n[0], n[1]);
89
89
  let u;
90
90
  a = l.snapshotCount;
91
91
  0 < a && a >= i.maxInMemSnapshotCount && (delete (s = (a => {
@@ -97,8 +97,8 @@ export default class extends a {
97
97
  return e;
98
98
  })(this)).prefixPM, delete (u = {
99
99
  ...s
100
- }).keyValueMap, delete s.posMap, s.isOut = !0, y.info("Sending snapshot " + s.snapshotNum)),
101
- this.postParent("onSnapshotSavedChangeId", t, u);
100
+ }).keyValueMap, delete s.posMap, s.isOut = !0, d.info("Sending snapshot " + s.snapshotNum)),
101
+ this.postParent("_on_snapshotSavedChangeId", t, u);
102
102
  }
103
103
  }
104
104
 
@@ -114,23 +114,23 @@ function h(a, s, e, t) {
114
114
  ...i
115
115
  };
116
116
  }
117
- let u = a.length, y;
117
+ let u = a.length, d;
118
118
  if (0 < u) {
119
- var d, S = e.keyToSnapshotMap, {
119
+ var y, S = e.keyToSnapshotMap, {
120
120
  keyValueMap: v,
121
121
  info: o,
122
122
  snapshotNum: m
123
- } = y = e.getMaxCombinedSnapshot(a);
124
- for (d of a) if (y !== d) {
123
+ } = d = e.getMaxCombinedSnapshot(a);
124
+ for (y of a) if (d !== y) {
125
125
  var g, {
126
126
  keyValueMap: f,
127
127
  snapshotNum: M,
128
- info: V
129
- } = d;
130
- for (g in f) v[g] = f[g], S[g] = y;
131
- e.delSnapshot(d), t.push([ M, V.verList[0] ]);
128
+ info: c
129
+ } = y;
130
+ for (g in f) v[g] = f[g], S[g] = d;
131
+ e.delSnapshot(y), t.push([ M, c.verList[0] ]);
132
132
  }
133
- p.push(e.saveKeyValueMap(y)), h.push([ m, o.pMVersion ]), r.push(m, o.vLVersion),
133
+ p.push(e.saveKeyValueMap(d)), h.push([ m, o.pMVersion ]), r.push(m, o.vLVersion),
134
134
  n[m] = {
135
135
  ...o
136
136
  };
@@ -152,7 +152,7 @@ function h(a, s, e, t) {
152
152
  snapshotNum: s,
153
153
  info: e
154
154
  } = s;
155
- return await a.saveSnapshotInfo(s, e), y.log("Created snapshot " + s), [ s, e.maxChangeId ];
155
+ return await a.saveSnapshotInfo(s, e), d.log("Created snapshot " + s), [ s, e.maxChangeId ];
156
156
  })(a, s));
157
157
  return [ t, o ];
158
158
  }