datafolder 1.0.44 → 1.0.45

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/QyFile.js CHANGED
@@ -1,35 +1,34 @@
1
1
  import {
2
2
  Flag_CExpireChecked as t,
3
3
  Flag_Created as i,
4
- Flag_FileContentLoaded as n,
4
+ Flag_FExpireChecked as n,
5
+ Flag_FileContentLoaded as r,
5
6
  QyItem as e
6
7
  } from "./QyItem.js";
7
8
 
8
9
  import {
9
- SpecialFilePaths as r,
10
- getContentKey as o,
10
+ IndexPropPathsFileName as o,
11
+ getContentKey as s,
11
12
  isNotNullObj as l,
12
- isSimpleType as h,
13
- isEmptyObj as s,
14
- getNowTime as a,
15
- isArray as u
13
+ isSimpleType as f,
14
+ isEmptyObj as a,
15
+ getNowTime as d,
16
+ isArray as C
16
17
  } from "./QyUtils.js";
17
18
 
18
19
  import {
19
- getValByNamePath as d
20
+ getValByNamePath as h
20
21
  } from "./QyFileContentUtils.js";
21
22
 
22
23
  import {
23
- QyIndexPropTree as f
24
+ QyIndexPropTree as u
24
25
  } from "./QyIndexPropTree.js";
25
26
 
26
27
  import {
27
- handleExpiredProps as C
28
- } from "./QyExpire.js";
28
+ handleExpiredProps as p
29
+ } from "./QyExpireMonitor.js";
29
30
 
30
- let c = r.IndexPropPathsFileName;
31
-
32
- class p extends e {
31
+ class c extends e {
33
32
  _fileContentKey;
34
33
  _fileContent;
35
34
  cChangeId = 0;
@@ -45,7 +44,10 @@ class p extends e {
45
44
  void 0 !== t) && (t._fileCount += e ? 1 : -1, ++t.fileMapChangeCount);
46
45
  }
47
46
  get fileContentKey() {
48
- return this._fileContentKey || (this._fileContentKey = o(this.fullPathHash));
47
+ return this._fileContentKey || (this._fileContentKey = s(this.fullPathHash));
48
+ }
49
+ get expireHashKey() {
50
+ return this._expireHashKey || (this._expireHashKey = "f" + this.fullPathHash);
49
51
  }
50
52
  get fileContent() {
51
53
  return this.ensureLoaded(), this.visited = !0, this._fileContent;
@@ -58,13 +60,13 @@ class p extends e {
58
60
  created: e,
59
61
  name: t,
60
62
  fileContent: i,
61
- underHiddenFolder: n,
63
+ underHiddenDir: n,
62
64
  parentDir: r
63
65
  } = this;
64
- if (e && n && t === c) {
66
+ if (e && n && t === o) {
65
67
  let e = this._qyIndexPropTree;
66
- if (void 0 === e) for (var o in e = this._qyIndexPropTree = new f(r),
67
- i) e.insertPropPath(JSON.parse(o));
68
+ if (void 0 === e) for (var s in e = this._qyIndexPropTree = new u(r),
69
+ i) e.insertPropPath(JSON.parse(s));
68
70
  return e;
69
71
  }
70
72
  }
@@ -89,10 +91,10 @@ class p extends e {
89
91
  this._indexCount = 0 <= e ? e : 0;
90
92
  }
91
93
  get fileContentLoaded() {
92
- return 0 != (this.flagInt & n);
94
+ return 0 != (this.flagInt & r);
93
95
  }
94
96
  set fileContentLoaded(e) {
95
- e ? this.flagInt |= n : this.flagInt &= ~n;
97
+ e ? this.flagInt |= r : this.flagInt &= ~r;
96
98
  }
97
99
  get cExpireChecked() {
98
100
  return 0 != (this.flagInt & t);
@@ -100,34 +102,40 @@ class p extends e {
100
102
  set cExpireChecked(e) {
101
103
  e ? this.flagInt |= t : this.flagInt &= ~t;
102
104
  }
105
+ get fExpireChecked() {
106
+ return 0 != (this.flagInt & n);
107
+ }
108
+ set fExpireChecked(e) {
109
+ e ? this.flagInt |= n : this.flagInt &= ~n;
110
+ }
103
111
  view(e = "$clone", t = !0) {
104
112
  var i = this.fileContent;
105
- return void 0 === i || h(i) ? i : function t(i, n, r, o) {
113
+ return void 0 === i || f(i) ? i : function t(i, n, r, s) {
106
114
  if ("$raw" === r) return n;
107
115
  if (void 0 === r) return;
108
- if (h(r)) return r ? o ? n : structuredClone(n) : void 0;
116
+ if (f(r)) return r ? s ? n : structuredClone(n) : void 0;
109
117
  let e = r.$link;
110
- if (void 0 !== e) return g(i, n, e, r.$spec);
111
- if (h(n)) return n;
112
- u(r) && (r = Object.fromEntries(r.filter(e => e).map(e => [ e, 1 ])));
113
- let s = u(n) ? [] : {};
118
+ if (void 0 !== e) return v(i, n, e, r.$spec);
119
+ if (f(n)) return n;
120
+ C(r) && (r = Object.fromEntries(r.filter(e => e).map(e => [ e, 1 ])));
121
+ let o = C(n) ? [] : {};
114
122
  let {
115
123
  $all: a,
116
124
  "**": l
117
125
  } = r;
118
126
  if (void 0 !== a || void 0 !== l) for (var d in n) {
119
127
  let e = r[d] ?? a ?? l;
120
- e && (s[d] = t(i, n[d], e, o));
121
- } else for (var f in r) {
122
- let e = r[f];
123
- e && (s[f] = t(i, n[f], e, o));
128
+ e && (o[d] = t(i, n[d], e, s));
129
+ } else for (var h in r) {
130
+ let e = r[h];
131
+ e && (o[h] = t(i, n[h], e, s));
124
132
  }
125
- return s;
133
+ return o;
126
134
  }(this, i, e, t);
127
135
  }
128
136
  prop(e, t = "$clone", i) {
129
137
  var n;
130
- if (t) return e = d(this.fileContent, u(e) ? e : [ e ]), n = t.$link, void 0 !== n ? g(this, e, n, t.$spec, i) : i || "$raw" === t ? e : structuredClone(e);
138
+ if (t) return e = h(this.fileContent, C(e) ? e : [ e ]), n = t.$link, void 0 !== n ? v(this, e, n, t.$spec, i) : i || "$raw" === t ? e : structuredClone(e);
131
139
  }
132
140
  unloadFileContent() {
133
141
  this.created && this.fileContentLoaded && void 0 !== this._fileContent && (this._fileContent = void 0,
@@ -138,23 +146,29 @@ class p extends e {
138
146
  this.fileContentLoaded = !0;
139
147
  var e = this.qyCache;
140
148
  if (void 0 !== e && (this._fileContent = e.qyKVData.getValueSync(this.fileContentKey),
141
- !this.underHiddenFolder)) {
149
+ !this.underHiddenDir)) {
142
150
  var t, i, n = this;
143
- !n.cExpireChecked && (n.cExpireChecked = !0, t = e.getExpireInfoFile(n.fullPathHash, "c")) && ([ t, i ] = ((e, t = a()) => {
151
+ n.cExpireChecked || (n.cExpireChecked = !0, void 0 !== (t = e.getInfoFile(n)?.fileContent?.cExpire) && ([ t, i ] = ((e, t = d()) => {
144
152
  let i, n = {};
145
153
  for (var r in e) {
146
- var o = e[r];
147
- o <= t ? void 0 === i ? i = [ r ] : i.push(r) : n[r] = o;
154
+ var s = e[r];
155
+ s <= t ? void 0 === i ? i = [ r ] : i.push(r) : n[r] = s;
148
156
  }
149
157
  return [ i, n ];
150
- })(t.fileContent), t && C(e.qyDB, n, t), s(i) || e.monitorContentExpire(n, i));
158
+ })(t), t && p(e.qyDB, n, t), a(i) || e.monitorContentExpire(n, i)));
151
159
  }
152
160
  }
153
161
  return this;
154
162
  }
163
+ checkExpire() {
164
+ var e, t, i, n;
165
+ !this.created || this.underHiddenDir || this.fExpireChecked || (this.fExpireChecked = !0,
166
+ e = this.qyCache, void 0 !== (i = e.getInfoFile(this)?.fileContent) && (t = d(),
167
+ void 0 !== (i = i.fExpire)) && (n = e.qyDB, i <= t ? n.delFile(this) : e.monitorItemExpire(this, i)));
168
+ }
155
169
  }
156
170
 
157
- function v(e, t, i, n) {
171
+ function g(e, t, i, n) {
158
172
  if (void 0 !== e) {
159
173
  e = e.getFile(t);
160
174
  if (void 0 !== e) return e.view(i, n);
@@ -162,17 +176,17 @@ function v(e, t, i, n) {
162
176
  return t;
163
177
  }
164
178
 
165
- function g(e, t, i, n, r = !1) {
166
- let o = e.qyCache.getDir(i);
167
- if (u(t)) return t.map(e => v(o, e, n, r));
179
+ function v(e, t, i, n, r = !1) {
180
+ let s = e.qyCache.getDir(i);
181
+ if (C(t)) return t.map(e => g(s, e, n, r));
168
182
  if (l(t)) {
169
- var s, a = {};
170
- for (s in t) a[s] = v(o, s, n, r);
183
+ var o, a = {};
184
+ for (o in t) a[o] = g(s, o, n, r);
171
185
  return a;
172
186
  }
173
- return v(o, t, n, r);
187
+ return g(s, t, n, r);
174
188
  }
175
189
 
176
190
  export {
177
- p as QyFile
191
+ c as QyFile
178
192
  };
package/src/QyIndex.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import {
2
- pathSplit as a,
2
+ pathSplit as d,
3
3
  isSimpleType as s,
4
4
  isFunction as v,
5
5
  isString as u,
@@ -41,7 +41,7 @@ function F(e, r, i, t, o, f) {
41
41
  var n = e.$or;
42
42
  if (n) {
43
43
  for (var l of n) if (F(l, r, i, t, o, f), f?.isFull) return;
44
- } else for (var d of h(e = u(e) ? a(e) : e, r)) if (b(d, i, t, o, f), f?.isFull) return;
44
+ } else for (var a of h(e = u(e) ? d(e) : e, r)) if (b(a, i, t, o, f), f?.isFull) return;
45
45
  }
46
46
  }
47
47
 
@@ -49,11 +49,11 @@ function* h(e, r, i = 0) {
49
49
  i === e.length ? yield r : yield* function* r(i, t, o, f) {
50
50
  if (void 0 === t) return;
51
51
  if ("**" === t) {
52
- o.isHiddenFolder || (yield o);
52
+ o.isHiddenDir || (yield o);
53
53
  for (var e of o.allSubdirs()) yield e;
54
- } else if ("*" === t) for (var n of o.subdirList) yield* h(i, n, f + 1); else if (v(t)) for (var l of o.filterSubdirNames(t)) yield* h(i, l, f + 1); else if (c(t)) for (var d of t) yield* r(i, d, o, f); else {
54
+ } else if ("*" === t) for (var n of o.subdirList) yield* h(i, n, f + 1); else if (v(t)) for (var l of o.filterSubdirNames(t)) yield* h(i, l, f + 1); else if (c(t)) for (var a of t) yield* r(i, a, o, f); else {
55
55
  let e = t.$or || t.$in;
56
- if (c(e)) for (var a of e) yield* r(i, a, o, f); else if (N(t)) for (var u of j(o, t)) yield* h(i, u, f + 1); else {
56
+ if (c(e)) for (var d of e) yield* r(i, d, o, f); else if (N(t)) for (var u of j(o, t)) yield* h(i, u, f + 1); else {
57
57
  let e = o.getSubdir(t);
58
58
  e && (yield* h(i, e, f + 1));
59
59
  }
@@ -69,8 +69,8 @@ function b(r, i, t, o, f) {
69
69
  var l = r.getFile(t);
70
70
  void 0 !== l && f.countOne() && (o.push(l), ++e);
71
71
  } else {
72
- var d, l = r.qyCache, i = (i && l.qyDB.createIndexByQuery(r, t), l.getIndexDir(r));
73
- if (void 0 !== i) for (d of function i(t, e) {
72
+ var a, l = r.qyCache, i = (i && l.qyDB.createIndexByQuery(r, t), l.getIndexDir(r));
73
+ if (void 0 !== i) for (a of function i(t, e) {
74
74
  if (void 0 === e) return I;
75
75
  if (s(e)) return new p(t.getFile(e));
76
76
  if (v(e)) return S(t.filterFileNames(e));
@@ -88,20 +88,20 @@ function b(r, i, t, o, f) {
88
88
  return e;
89
89
  }
90
90
  let l = new y();
91
- if (c(e)) for (var r of e) l.addNode(i(t, r)); else for (var d in e) {
92
- let r = e[d];
93
- if ("$or" === d) if (c(r)) {
91
+ if (c(e)) for (var r of e) l.addNode(i(t, r)); else for (var a in e) {
92
+ let r = e[a];
93
+ if ("$or" === a) if (c(r)) {
94
94
  let e = new p();
95
- for (var a of r) e.addNode(i(t, a));
95
+ for (var d of r) e.addNode(i(t, d));
96
96
  l.addNode(e);
97
- } else l.addNode(i(t, r)); else if ("$and" === d) if (c(r)) for (var u of r) l.addNode(i(t, u)); else l.addNode(i(t, r)); else {
98
- let e = t.getSubdir(d);
97
+ } else l.addNode(i(t, r)); else if ("$and" === a) if (c(r)) for (var u of r) l.addNode(i(t, u)); else l.addNode(i(t, r)); else {
98
+ let e = t.getSubdir(a);
99
99
  if (void 0 === e) return I;
100
100
  l.addNode(i(e, r));
101
101
  }
102
102
  }
103
103
  return l;
104
- }(i, t).getFiles(f)) o.push(r.getFile(d)), ++e;
104
+ }(i, t).getFiles(f)) o.push(r.getFile(a)), ++e;
105
105
  }
106
106
  $.info(`Checking ${n} file${g(n)}, result: ${e} file` + g(e));
107
107
  }
@@ -158,7 +158,7 @@ function C(e, r, i, t) {
158
158
  if (s(t)) return C(i, f, t, n);
159
159
  if (c(t)) {
160
160
  for (var l of t) if (C(i, f, l, n)) return !0;
161
- } else for (var d in t) if (C(i, f, d, n)) return !0;
161
+ } else for (var a in t) if (C(i, f, a, n)) return !0;
162
162
  return !1;
163
163
  }
164
164
  if (s(t) || c(t)) return !1;
@@ -174,8 +174,8 @@ function Q(e, r, i, t) {
174
174
 
175
175
  function R(e, r, i, t, o = []) {
176
176
  if (null != e && "" !== e && void 0 !== i) if (s(e)) Q(e, i, t, o); else if (c(e)) for (var f of e) s(f) && Q(f, i, t, o); else if (r) for (var n of Object.values(e)) s(n) && Q(n, i, t, o); else for (var l in e) {
177
- var d = e[l], l = t ? i.getSubdir(l) : i.getOrCreateSubdir(l);
178
- void 0 !== l && R(d, !1, l, t, o);
177
+ var a = e[l], l = t ? i.getSubdir(l) : i.getOrCreateSubdir(l);
178
+ void 0 !== l && R(a, !1, l, t, o);
179
179
  }
180
180
  return o;
181
181
  }
package/src/QyItem.d.ts CHANGED
@@ -22,7 +22,7 @@ export declare class QyItem {
22
22
  get fullPath(): string;
23
23
  get fullPathHash(): string;
24
24
  get isItem(): boolean;
25
- get underHiddenFolder(): boolean;
25
+ get underHiddenDir(): boolean;
26
26
  get parentList(): QyDir[];
27
27
  get parentNamePath(): string[];
28
28
  get namePath(): string[];
package/src/QyItem.js CHANGED
@@ -1,26 +1,24 @@
1
1
  import {
2
- calHash as a,
3
- SpecialFilePaths as t
2
+ calHash as e,
3
+ HiddenDirName as i
4
4
  } from "./QyUtils.js";
5
5
 
6
- let i = t.HiddenFolderName;
6
+ var t = 1;
7
7
 
8
- var e = 1;
8
+ var a = 4, r = 8, s = 16;
9
9
 
10
- var r = 4, s = 8, n = 16;
10
+ var n = 64, h = 128, m = 256;
11
11
 
12
- var h = 64, l = 128, m = 256;
13
-
14
- class u {
12
+ class l {
15
13
  name;
16
14
  parentDir;
17
15
  flagInt = 0;
18
- constructor(t, e) {
19
- this.name = t.toString(), this.parentDir = e, t !== i && (void 0 === e || e.name !== i && !e.underHiddenFolder) || (this.flagInt |= 2);
16
+ constructor(t, a) {
17
+ this.name = t.toString(), this.parentDir = a, (t === i || void 0 !== a && a.underHiddenDir) && (this.flagInt |= 2);
20
18
  }
21
19
  get qyCache() {
22
20
  let t = this;
23
- for (var e; void 0 !== (e = t.parentDir); ) t = e;
21
+ for (var a; void 0 !== (a = t.parentDir); ) t = a;
24
22
  return t._qyCache;
25
23
  }
26
24
  get visited() {
@@ -36,37 +34,37 @@ class u {
36
34
  cmp({
37
35
  nameNum: t
38
36
  }) {
39
- var e = this.nameNum;
40
- return e < t ? -1 : t < e ? 1 : 0;
37
+ var a = this.nameNum;
38
+ return a < t ? -1 : t < a ? 1 : 0;
41
39
  }
42
40
  get fullPath() {
43
- var t, e;
41
+ var t, a;
44
42
  return void 0 === this._fullPath && ({
45
43
  parentDir: t,
46
- name: e
47
- } = this, this._fullPath = void 0 !== t ? t.fullPath + "/" + e : e), this._fullPath;
44
+ name: a
45
+ } = this, this._fullPath = void 0 !== t ? t.fullPath + "/" + a : a), this._fullPath;
48
46
  }
49
47
  get fullPathHash() {
50
- var t, e;
48
+ var t, a;
51
49
  return void 0 === this._fullPathHash && ({
52
50
  parentDir: t,
53
- name: e
54
- } = this, this._fullPathHash = a(void 0 !== t ? t.fullPathHash + e : e)),
51
+ name: a
52
+ } = this, this._fullPathHash = e(void 0 !== t ? t.fullPathHash + a : a)),
55
53
  this._fullPathHash;
56
54
  }
57
55
  get isItem() {
58
56
  return !0;
59
57
  }
60
- get underHiddenFolder() {
58
+ get underHiddenDir() {
61
59
  return 0 != (2 & this.flagInt);
62
60
  }
63
61
  get parentList() {
64
62
  if (void 0 === this._parentList) {
65
- var e = this._parentList = [];
63
+ var a = this._parentList = [];
66
64
  let t = this.parentDir;
67
65
  if (void 0 !== t) {
68
- for (;void 0 !== t.parentDir; ) e.push(t), t = t.parentDir;
69
- e.reverse();
66
+ for (;void 0 !== t.parentDir; ) a.push(t), t = t.parentDir;
67
+ a.reverse();
70
68
  }
71
69
  }
72
70
  return this._parentList;
@@ -78,20 +76,20 @@ class u {
78
76
  return this._namePath || (this._namePath = [ ...this.parentNamePath, this.name ]);
79
77
  }
80
78
  getRelativeNamePath(t = void 0) {
81
- var e = [ this.name ];
82
- let a = this.parentDir;
83
- for (;void 0 !== a && a !== t; ) e.push(a.name), a = a.parentDir;
84
- if (a === t) return e.reverse();
79
+ var a = [ this.name ];
80
+ let e = this.parentDir;
81
+ for (;void 0 !== e && e !== t; ) a.push(e.name), e = e.parentDir;
82
+ if (e === t) return a.reverse();
85
83
  }
86
84
  }
87
85
 
88
86
  export {
89
- e as Flag_Created,
90
- r as Flag_SubdirMapLoaded,
91
- s as Flag_FileMapLoaded,
92
- n as Flag_FileContentLoaded,
93
- h as Flag_DExpireChecked,
94
- l as Flag_FExpireChecked,
87
+ t as Flag_Created,
88
+ a as Flag_SubdirMapLoaded,
89
+ r as Flag_FileMapLoaded,
90
+ s as Flag_FileContentLoaded,
91
+ n as Flag_DExpireChecked,
92
+ h as Flag_FExpireChecked,
95
93
  m as Flag_CExpireChecked,
96
- u as QyItem
94
+ l as QyItem
97
95
  };
package/src/QyKVData.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { QyKVDataSaver } from "./QyKVDataSaver.ts";
2
2
  import { QySnapshotCompactor } from "./QySnapshotCompactor.ts";
3
3
  import { QyKVDataCleaner } from "./QyKVDataCleaner.ts";
4
- import { QyExpire } from "./QyExpire.ts";
4
+ import { QyExpireMonitor } from "./QyExpireMonitor.ts";
5
5
  import { type QySnapshots } from "./QySnapshots.ts";
6
6
  export declare class QyKVData {
7
7
  kvFolder: any;
@@ -22,7 +22,7 @@ export declare class QyKVData {
22
22
  qyKVDataSaver: QyKVDataSaver;
23
23
  qySnapshotCompactor: QySnapshotCompactor;
24
24
  qyKVDataCleaner: QyKVDataCleaner;
25
- qyExpire: QyExpire;
25
+ qyExpireMonitor: QyExpireMonitor;
26
26
  constructor(kvFolder: any, options?: any, qyCache?: any);
27
27
  start(maxChangeId: any, loadedMaxAclNum: any, qySnapshots: any, aclKeyValueMap: any): this;
28
28
  stop(): Promise<void>;
@@ -34,7 +34,7 @@ export declare class QyKVData {
34
34
  _on_snapshotSavedChangeId(snapshotSavedChangeId: any, pMOnlySnapshot: any): void;
35
35
  _on_compactUpdates(compactUpdates: any): void;
36
36
  monitorContentExpire(file: any, flattedAbsTimeObj: any): void;
37
- unmonitorContentExpire(file: any, flattedDelObj: any): void;
37
+ unmonitorContentExpire(file: any, propList: any): void;
38
38
  monitorItemExpire(item: any, expireTime: any): void;
39
39
  unmonitorItemExpire(item: any): void;
40
40
  }
package/src/QyKVData.js CHANGED
@@ -32,8 +32,8 @@ import {
32
32
  } from "./QyLogger.js";
33
33
 
34
34
  import {
35
- QyExpire as h
36
- } from "./QyExpire.js";
35
+ QyExpireMonitor as h
36
+ } from "./QyExpireMonitor.js";
37
37
 
38
38
  import "./QySnapshots.js";
39
39
 
@@ -56,7 +56,7 @@ class t {
56
56
  qyKVDataSaver;
57
57
  qySnapshotCompactor;
58
58
  qyKVDataCleaner;
59
- qyExpire;
59
+ qyExpireMonitor;
60
60
  constructor(t, a = void 0, o = void 0) {
61
61
  a = {
62
62
  ...n("QyKVData"),
@@ -65,7 +65,7 @@ class t {
65
65
  var e = s(t, "snapshot");
66
66
  this.qyCache = o, this.options = a, this.kvFolder = t, this.snapshotFolder = e,
67
67
  this.qyKVDataSaver = new r(this, t, a), this.qySnapshotCompactor = new i(this, t, a),
68
- this.qyKVDataCleaner = new p(this, t, a), this.qyExpire = new h(o, a);
68
+ this.qyKVDataCleaner = new p(this, t, a), this.qyExpireMonitor = new h(o, a);
69
69
  }
70
70
  start(t, a, o, e) {
71
71
  var {
@@ -73,7 +73,7 @@ class t {
73
73
  qyKVDataSaver: n,
74
74
  qySnapshotCompactor: r,
75
75
  qyKVDataCleaner: i,
76
- qyExpire: p
76
+ qyExpireMonitor: p
77
77
  } = this, {
78
78
  maxSnapshotNum: h,
79
79
  snapshotMaxChangeId: c
@@ -145,7 +145,7 @@ class t {
145
145
  compactInterval: e,
146
146
  unloadInterval: s,
147
147
  qyKVDataCleaner: n,
148
- qyExpire: r
148
+ qyExpireMonitor: r
149
149
  } = this;
150
150
  clearInterval(e), clearInterval(s), await r.stop(), c(this, await t.call_stop()),
151
151
  o && o.closeAllFDs(), await a.call_stop(), await n.call_stop();
@@ -244,16 +244,16 @@ class t {
244
244
  }
245
245
  }
246
246
  monitorContentExpire(t, a) {
247
- this.qyExpire.monitorContentExpire(t, a);
247
+ this.qyExpireMonitor.monitorContentExpire(t, a);
248
248
  }
249
249
  unmonitorContentExpire(t, a) {
250
- this.qyExpire.unmonitorContentExpire(t, a);
250
+ this.qyExpireMonitor.unmonitorContentExpire(t, a);
251
251
  }
252
252
  monitorItemExpire(t, a) {
253
- this.qyExpire.monitorItemExpire(t, a);
253
+ this.qyExpireMonitor.monitorItemExpire(t, a);
254
254
  }
255
255
  unmonitorItemExpire(t) {
256
- this.qyExpire.unmonitorItemExpire(t);
256
+ this.qyExpireMonitor.unmonitorItemExpire(t);
257
257
  }
258
258
  }
259
259
 
@@ -1,9 +1,9 @@
1
1
  import {
2
- join as c
2
+ join as h
3
3
  } from "node:path";
4
4
 
5
5
  import {
6
- rm as h,
6
+ rm as c,
7
7
  rename as r,
8
8
  readdir as m
9
9
  } from "node:fs/promises";
@@ -31,7 +31,7 @@ import {
31
31
  } from "./QyLogger.js";
32
32
 
33
33
  import {
34
- getInfoFileName as l
34
+ getSnapshotInfoFileName as l
35
35
  } from "./QySnapshots.js";
36
36
 
37
37
  export default class extends s {
@@ -49,9 +49,9 @@ export default class extends s {
49
49
  ...o("QyKVDataCleaner_Worker"),
50
50
  ...e
51
51
  });
52
- var e = c(s, "history"), a = c(s, "snapshot");
53
- this.kvFolder = s, this.snapshotFolder = a, this.snapshotInfoFolder = c(a, "info"),
54
- this.aclFolder = c(s, "acl"), this.historyAclFolder = c(e, "acl"), this.historySnapshotFolder = c(e, "snapshot");
52
+ var e = h(s, "history"), a = h(s, "snapshot");
53
+ this.kvFolder = s, this.snapshotFolder = a, this.snapshotInfoFolder = h(a, "info"),
54
+ this.aclFolder = h(s, "acl"), this.historyAclFolder = h(e, "acl"), this.historySnapshotFolder = h(e, "snapshot");
55
55
  }
56
56
  cast_cleanAclFiles(s) {
57
57
  this.cleanAclFiles(s);
@@ -94,8 +94,8 @@ export default class extends s {
94
94
  snapshotInfoFolder: o
95
95
  } = this;
96
96
  await Promise.all(s.map(async ([ e, s ]) => {
97
- await h(c(o, l(e, s))), await Promise.all([ "pM", "prefixPM", "vL" ].map(s => n(this, e, 1 / 0, s))),
98
- await h(c(a, "" + e), {
97
+ await c(h(o, l(e, s))), await Promise.all([ "pM", "prefixPM", "vL" ].map(s => n(this, e, 1 / 0, s))),
98
+ await c(h(a, "" + e), {
99
99
  recursive: !0
100
100
  });
101
101
  }));
@@ -103,7 +103,7 @@ export default class extends s {
103
103
  }
104
104
 
105
105
  function y(s, e, a, o) {
106
- a = c(a, e), o = c(o, e);
106
+ a = h(a, e), o = h(o, e);
107
107
  return s.options.compressRedundantFile ? t(a, o + i, {
108
108
  override: !0,
109
109
  removeSrcAfterSuccess: !0
@@ -114,15 +114,15 @@ async function n(e, a, o, r) {
114
114
  var {
115
115
  snapshotFolder: s,
116
116
  historySnapshotFolder: t
117
- } = e, i = c(s, "" + a);
117
+ } = e, i = h(s, "" + a);
118
118
  if (await F(i)) {
119
119
  let s;
120
120
  var l, n = [];
121
121
  for (l of await m(i)) {
122
122
  var p = new RegExp("^([0-9]+)_" + r).exec(l);
123
- null !== p && (p = parseInt(p[1])) < o && (1 === p ? (void 0 === s && (s = c(t, "" + a),
124
- await d(s)), n.push(y(e, l, i, s))) : (p = c(i, l), f.info("Removing " + p),
125
- n.push(h(p))));
123
+ null !== p && (p = parseInt(p[1])) < o && (1 === p ? (void 0 === s && (s = h(t, "" + a),
124
+ await d(s)), n.push(y(e, l, i, s))) : (p = h(i, l), f.info("Removing " + p),
125
+ n.push(c(p))));
126
126
  }
127
127
  0 < n.length && await Promise.allSettled(n);
128
128
  }
@@ -32,4 +32,4 @@ export declare class QySnapshots {
32
32
  }
33
33
  export declare function iterPMBuffer(buffer: any, fun: any): void;
34
34
  export declare function loadPrefixPMFile(prefixPMFilePath: any): Promise<Map<any, any>>;
35
- export declare function getInfoFileName(snapshotNum: any, version: any): string;
35
+ export declare function getSnapshotInfoFileName(snapshotNum: any, version: any): string;
@@ -389,5 +389,5 @@ export {
389
389
  t as QySnapshots,
390
390
  B as iterPMBuffer,
391
391
  k as loadPrefixPMFile,
392
- D as getInfoFileName
392
+ D as getSnapshotInfoFileName
393
393
  };
package/src/QyUtils.d.ts CHANGED
@@ -5,18 +5,11 @@ export declare const __dirname: string;
5
5
  export declare const SpecialOperators: {
6
6
  [k: string]: string;
7
7
  };
8
- export declare const SpecialFilePaths: {
9
- HiddenFolderName: string;
10
- TriggerDirPath: string[];
11
- RpcDirPath: string[];
12
- IndexDirPath: string[];
13
- ExpireDirPath: string[];
14
- HNSWDirPath: string[];
15
- InfoDirPath: string[];
16
- RecycleDirPath: string[];
17
- MetaFilePath: string[];
18
- IndexPropPathsFileName: string;
19
- };
8
+ export declare const HiddenDirName = "%";
9
+ export declare const IndexPropPathsFileName = "propPaths";
10
+ export declare const AboutFileName = "about";
11
+ export declare const HiddenTopDirNameList: string[];
12
+ export declare const HiddenDirNamePathList: string[][];
20
13
  export declare const emptyArray: never[];
21
14
  export declare function isMatchName(name: any): any;
22
15
  export declare function getMatchParam(name: any): any;