@zuplo/cli 6.70.29 → 6.70.31
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/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/fetch/index.d.ts +7 -7
- package/node_modules/@protobufjs/fetch/index.js +4 -7
- package/node_modules/@protobufjs/fetch/package.json +7 -5
- package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
- package/node_modules/@protobufjs/fetch/tests/index.js +150 -8
- package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
- package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
- package/node_modules/@protobufjs/inquire/index.d.ts +1 -0
- package/node_modules/@protobufjs/inquire/index.js +1 -0
- package/node_modules/@protobufjs/inquire/package.json +1 -1
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts +21 -17
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js +65 -35
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js +1 -2
- package/node_modules/@zuplo/editor/node_modules/lru-cache/dist/esm/perf.js.map +1 -1
- package/node_modules/@zuplo/editor/node_modules/lru-cache/package.json +8 -8
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +1 -1
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +21 -21
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js.map +1 -1
- package/node_modules/@zuplo/runtime/out/types/mcp-gateway/index.d.ts +2 -1
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -1
- package/node_modules/pg-protocol/dist/serializer.d.ts +1 -0
- package/node_modules/pg-protocol/package.json +4 -4
- package/node_modules/pg-protocol/src/buffer-reader.ts +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +187 -153
- package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.js +14 -5
- package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.js +207 -173
- package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
- package/node_modules/protobufjs/package.json +6 -3
- package/node_modules/protobufjs/src/util/fs.js +11 -0
- package/node_modules/protobufjs/src/util/minimal.js +10 -2
- package/node_modules/protobufjs/src/util.js +1 -1
- package/node_modules/qs/CHANGELOG.md +10 -0
- package/node_modules/qs/README.md +1 -1
- package/node_modules/qs/dist/qs.js +15 -15
- package/node_modules/qs/eslint.config.mjs +1 -0
- package/node_modules/qs/lib/parse.js +52 -22
- package/node_modules/qs/lib/stringify.js +11 -4
- package/node_modules/qs/package.json +2 -2
- package/node_modules/qs/test/parse.js +49 -0
- package/node_modules/qs/test/stringify.js +129 -0
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts +21 -17
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js +65 -35
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/index.min.js.map +3 -3
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js +1 -2
- package/node_modules/rimraf/node_modules/lru-cache/dist/esm/perf.js.map +1 -1
- package/node_modules/rimraf/node_modules/lru-cache/package.json +8 -8
- package/node_modules/toad-cache/dist/toad-cache.cjs +185 -185
- package/node_modules/toad-cache/dist/toad-cache.mjs +181 -181
- package/node_modules/toad-cache/package.json +33 -31
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* toad-cache
|
|
3
3
|
*
|
|
4
|
-
* @copyright
|
|
4
|
+
* @copyright 2026 Igor Savin <kibertoad@gmail.com>
|
|
5
5
|
* @license MIT
|
|
6
6
|
* @version 3.7.0
|
|
7
7
|
*/
|
|
@@ -144,6 +144,186 @@ class FifoMap {
|
|
|
144
144
|
|
|
145
145
|
this.last = item;
|
|
146
146
|
}
|
|
147
|
+
}class FifoObject {
|
|
148
|
+
constructor(max = 1000, ttlInMsecs = 0) {
|
|
149
|
+
if (isNaN(max) || max < 0) {
|
|
150
|
+
throw new Error('Invalid max value')
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (isNaN(ttlInMsecs) || ttlInMsecs < 0) {
|
|
154
|
+
throw new Error('Invalid ttl value')
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
this.first = null;
|
|
158
|
+
this.items = Object.create(null);
|
|
159
|
+
this.last = null;
|
|
160
|
+
this.size = 0;
|
|
161
|
+
this.max = max;
|
|
162
|
+
this.ttl = ttlInMsecs;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
clear() {
|
|
166
|
+
this.items = Object.create(null);
|
|
167
|
+
this.first = null;
|
|
168
|
+
this.last = null;
|
|
169
|
+
this.size = 0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
delete(key) {
|
|
173
|
+
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
174
|
+
const deletedItem = this.items[key];
|
|
175
|
+
|
|
176
|
+
delete this.items[key];
|
|
177
|
+
this.size--;
|
|
178
|
+
|
|
179
|
+
if (deletedItem.prev !== null) {
|
|
180
|
+
deletedItem.prev.next = deletedItem.next;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (deletedItem.next !== null) {
|
|
184
|
+
deletedItem.next.prev = deletedItem.prev;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (this.first === deletedItem) {
|
|
188
|
+
this.first = deletedItem.next;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if (this.last === deletedItem) {
|
|
192
|
+
this.last = deletedItem.prev;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
deleteMany(keys) {
|
|
198
|
+
for (var i = 0; i < keys.length; i++) {
|
|
199
|
+
this.delete(keys[i]);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
evict() {
|
|
204
|
+
if (this.size > 0) {
|
|
205
|
+
const item = this.first;
|
|
206
|
+
|
|
207
|
+
delete this.items[item.key];
|
|
208
|
+
|
|
209
|
+
if (--this.size === 0) {
|
|
210
|
+
this.first = null;
|
|
211
|
+
this.last = null;
|
|
212
|
+
} else {
|
|
213
|
+
this.first = item.next;
|
|
214
|
+
this.first.prev = null;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
expiresAt(key) {
|
|
220
|
+
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
221
|
+
return this.items[key].expiry
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
get(key) {
|
|
226
|
+
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
227
|
+
const item = this.items[key];
|
|
228
|
+
|
|
229
|
+
if (this.ttl > 0 && item.expiry <= Date.now()) {
|
|
230
|
+
this.delete(key);
|
|
231
|
+
return
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return item.value
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
getMany(keys) {
|
|
239
|
+
const result = [];
|
|
240
|
+
|
|
241
|
+
for (var i = 0; i < keys.length; i++) {
|
|
242
|
+
result.push(this.get(keys[i]));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return result
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
keys() {
|
|
249
|
+
return Object.keys(this.items)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
set(key, value) {
|
|
253
|
+
// Replace existing item
|
|
254
|
+
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
255
|
+
const item = this.items[key];
|
|
256
|
+
item.value = value;
|
|
257
|
+
|
|
258
|
+
item.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl;
|
|
259
|
+
|
|
260
|
+
return
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// Add new item
|
|
264
|
+
if (this.max > 0 && this.size === this.max) {
|
|
265
|
+
this.evict();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const item = {
|
|
269
|
+
expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,
|
|
270
|
+
key: key,
|
|
271
|
+
prev: this.last,
|
|
272
|
+
next: null,
|
|
273
|
+
value,
|
|
274
|
+
};
|
|
275
|
+
this.items[key] = item;
|
|
276
|
+
|
|
277
|
+
if (++this.size === 1) {
|
|
278
|
+
this.first = item;
|
|
279
|
+
} else {
|
|
280
|
+
this.last.next = item;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
this.last = item;
|
|
284
|
+
}
|
|
285
|
+
}class HitStatisticsRecord {
|
|
286
|
+
constructor() {
|
|
287
|
+
this.records = {};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
initForCache(cacheId, currentTimeStamp) {
|
|
291
|
+
this.records[cacheId] = {
|
|
292
|
+
[currentTimeStamp]: {
|
|
293
|
+
cacheSize: 0,
|
|
294
|
+
hits: 0,
|
|
295
|
+
falsyHits: 0,
|
|
296
|
+
emptyHits: 0,
|
|
297
|
+
misses: 0,
|
|
298
|
+
expirations: 0,
|
|
299
|
+
evictions: 0,
|
|
300
|
+
invalidateOne: 0,
|
|
301
|
+
invalidateAll: 0,
|
|
302
|
+
sets: 0,
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
resetForCache(cacheId) {
|
|
308
|
+
for (let key of Object.keys(this.records[cacheId])) {
|
|
309
|
+
this.records[cacheId][key] = {
|
|
310
|
+
cacheSize: 0,
|
|
311
|
+
hits: 0,
|
|
312
|
+
falsyHits: 0,
|
|
313
|
+
emptyHits: 0,
|
|
314
|
+
misses: 0,
|
|
315
|
+
expirations: 0,
|
|
316
|
+
evictions: 0,
|
|
317
|
+
invalidateOne: 0,
|
|
318
|
+
invalidateAll: 0,
|
|
319
|
+
sets: 0,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
getStatistics() {
|
|
325
|
+
return this.records
|
|
326
|
+
}
|
|
147
327
|
}class LruMap {
|
|
148
328
|
constructor(max = 1000, ttlInMsecs = 0) {
|
|
149
329
|
if (isNaN(max) || max < 0) {
|
|
@@ -491,48 +671,6 @@ class FifoMap {
|
|
|
491
671
|
|
|
492
672
|
this.last = item;
|
|
493
673
|
}
|
|
494
|
-
}class HitStatisticsRecord {
|
|
495
|
-
constructor() {
|
|
496
|
-
this.records = {};
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
initForCache(cacheId, currentTimeStamp) {
|
|
500
|
-
this.records[cacheId] = {
|
|
501
|
-
[currentTimeStamp]: {
|
|
502
|
-
cacheSize: 0,
|
|
503
|
-
hits: 0,
|
|
504
|
-
falsyHits: 0,
|
|
505
|
-
emptyHits: 0,
|
|
506
|
-
misses: 0,
|
|
507
|
-
expirations: 0,
|
|
508
|
-
evictions: 0,
|
|
509
|
-
invalidateOne: 0,
|
|
510
|
-
invalidateAll: 0,
|
|
511
|
-
sets: 0,
|
|
512
|
-
},
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
resetForCache(cacheId) {
|
|
517
|
-
for (let key of Object.keys(this.records[cacheId])) {
|
|
518
|
-
this.records[cacheId][key] = {
|
|
519
|
-
cacheSize: 0,
|
|
520
|
-
hits: 0,
|
|
521
|
-
falsyHits: 0,
|
|
522
|
-
emptyHits: 0,
|
|
523
|
-
misses: 0,
|
|
524
|
-
expirations: 0,
|
|
525
|
-
evictions: 0,
|
|
526
|
-
invalidateOne: 0,
|
|
527
|
-
invalidateAll: 0,
|
|
528
|
-
sets: 0,
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
getStatistics() {
|
|
534
|
-
return this.records
|
|
535
|
-
}
|
|
536
674
|
}/**
|
|
537
675
|
*
|
|
538
676
|
* @param {Date} date
|
|
@@ -711,142 +849,4 @@ function getTimestamp(date) {
|
|
|
711
849
|
}
|
|
712
850
|
this.hitStatistics.addMiss();
|
|
713
851
|
}
|
|
714
|
-
}class FifoObject {
|
|
715
|
-
constructor(max = 1000, ttlInMsecs = 0) {
|
|
716
|
-
if (isNaN(max) || max < 0) {
|
|
717
|
-
throw new Error('Invalid max value')
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
if (isNaN(ttlInMsecs) || ttlInMsecs < 0) {
|
|
721
|
-
throw new Error('Invalid ttl value')
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
this.first = null;
|
|
725
|
-
this.items = Object.create(null);
|
|
726
|
-
this.last = null;
|
|
727
|
-
this.size = 0;
|
|
728
|
-
this.max = max;
|
|
729
|
-
this.ttl = ttlInMsecs;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
clear() {
|
|
733
|
-
this.items = Object.create(null);
|
|
734
|
-
this.first = null;
|
|
735
|
-
this.last = null;
|
|
736
|
-
this.size = 0;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
delete(key) {
|
|
740
|
-
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
741
|
-
const deletedItem = this.items[key];
|
|
742
|
-
|
|
743
|
-
delete this.items[key];
|
|
744
|
-
this.size--;
|
|
745
|
-
|
|
746
|
-
if (deletedItem.prev !== null) {
|
|
747
|
-
deletedItem.prev.next = deletedItem.next;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
if (deletedItem.next !== null) {
|
|
751
|
-
deletedItem.next.prev = deletedItem.prev;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
if (this.first === deletedItem) {
|
|
755
|
-
this.first = deletedItem.next;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
if (this.last === deletedItem) {
|
|
759
|
-
this.last = deletedItem.prev;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
deleteMany(keys) {
|
|
765
|
-
for (var i = 0; i < keys.length; i++) {
|
|
766
|
-
this.delete(keys[i]);
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
evict() {
|
|
771
|
-
if (this.size > 0) {
|
|
772
|
-
const item = this.first;
|
|
773
|
-
|
|
774
|
-
delete this.items[item.key];
|
|
775
|
-
|
|
776
|
-
if (--this.size === 0) {
|
|
777
|
-
this.first = null;
|
|
778
|
-
this.last = null;
|
|
779
|
-
} else {
|
|
780
|
-
this.first = item.next;
|
|
781
|
-
this.first.prev = null;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
expiresAt(key) {
|
|
787
|
-
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
788
|
-
return this.items[key].expiry
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
get(key) {
|
|
793
|
-
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
794
|
-
const item = this.items[key];
|
|
795
|
-
|
|
796
|
-
if (this.ttl > 0 && item.expiry <= Date.now()) {
|
|
797
|
-
this.delete(key);
|
|
798
|
-
return
|
|
799
|
-
}
|
|
800
|
-
|
|
801
|
-
return item.value
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
getMany(keys) {
|
|
806
|
-
const result = [];
|
|
807
|
-
|
|
808
|
-
for (var i = 0; i < keys.length; i++) {
|
|
809
|
-
result.push(this.get(keys[i]));
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
return result
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
keys() {
|
|
816
|
-
return Object.keys(this.items)
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
set(key, value) {
|
|
820
|
-
// Replace existing item
|
|
821
|
-
if (Object.prototype.hasOwnProperty.call(this.items, key)) {
|
|
822
|
-
const item = this.items[key];
|
|
823
|
-
item.value = value;
|
|
824
|
-
|
|
825
|
-
item.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl;
|
|
826
|
-
|
|
827
|
-
return
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
// Add new item
|
|
831
|
-
if (this.max > 0 && this.size === this.max) {
|
|
832
|
-
this.evict();
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
const item = {
|
|
836
|
-
expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl,
|
|
837
|
-
key: key,
|
|
838
|
-
prev: this.last,
|
|
839
|
-
next: null,
|
|
840
|
-
value,
|
|
841
|
-
};
|
|
842
|
-
this.items[key] = item;
|
|
843
|
-
|
|
844
|
-
if (++this.size === 1) {
|
|
845
|
-
this.first = item;
|
|
846
|
-
} else {
|
|
847
|
-
this.last.next = item;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
this.last = item;
|
|
851
|
-
}
|
|
852
852
|
}export{FifoObject as Fifo,FifoMap,FifoObject,HitStatisticsRecord,LruObject as Lru,LruObjectHitStatistics as LruHitStatistics,LruMap,LruObject,LruObjectHitStatistics};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toad-cache",
|
|
3
3
|
"description": "LRU and FIFO caches for Client or Server",
|
|
4
|
-
"version": "3.7.
|
|
4
|
+
"version": "3.7.1",
|
|
5
5
|
"homepage": "https://github.com/kibertoad/toad-cache",
|
|
6
6
|
"author": "Igor Savin <kibertoad@gmail.com>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git://github.com/kibertoad/toad-cache.git"
|
|
9
|
+
"url": "git+https://github.com/kibertoad/toad-cache.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/kibertoad/toad-cache/issues"
|
|
@@ -35,37 +35,26 @@
|
|
|
35
35
|
"type": "module",
|
|
36
36
|
"sourceType": "module",
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
38
|
+
"node": ">=20"
|
|
39
39
|
},
|
|
40
40
|
"engineStrict": true,
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"rollup": "rollup --config",
|
|
48
|
-
"test": "vitest",
|
|
49
|
-
"test:coverage": "npm run rollup && npm run test -- --coverage",
|
|
50
|
-
"test:ci": "npm run lint && npm run test:coverage && npm run test:typescript",
|
|
51
|
-
"test:typescript": "tsd",
|
|
52
|
-
"types:generate": "npx -p typescript tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir .",
|
|
53
|
-
"prepublishOnly": "npm run build"
|
|
41
|
+
"devEngines": {
|
|
42
|
+
"runtime": {
|
|
43
|
+
"name": "node",
|
|
44
|
+
"version": ">=20",
|
|
45
|
+
"onFail": "error"
|
|
46
|
+
}
|
|
54
47
|
},
|
|
55
48
|
"devDependencies": {
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"auto-changelog": "^2.
|
|
59
|
-
"del-cli": "^
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"rollup": "^4.6.0",
|
|
66
|
-
"vitest": "^1.1.3",
|
|
67
|
-
"tsd": "^0.30.0",
|
|
68
|
-
"typescript": "^5.3.2"
|
|
49
|
+
"@biomejs/biome": "^2.4.15",
|
|
50
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
51
|
+
"auto-changelog": "^2.5.0",
|
|
52
|
+
"del-cli": "^7.0.0",
|
|
53
|
+
"precise": "^5.0.1",
|
|
54
|
+
"rollup": "^4.60.4",
|
|
55
|
+
"tsd": "^0.33.0",
|
|
56
|
+
"typescript": "~6.0.3",
|
|
57
|
+
"vitest": "^4.1.6"
|
|
69
58
|
},
|
|
70
59
|
"keywords": [
|
|
71
60
|
"LRU",
|
|
@@ -78,5 +67,18 @@
|
|
|
78
67
|
"used",
|
|
79
68
|
"first",
|
|
80
69
|
"browser"
|
|
81
|
-
]
|
|
82
|
-
|
|
70
|
+
],
|
|
71
|
+
"scripts": {
|
|
72
|
+
"build": "del-cli dist && del-cli coverage && pnpm run rollup",
|
|
73
|
+
"benchmark": "pnpm run build && node benchmark.js",
|
|
74
|
+
"changelog": "auto-changelog -p",
|
|
75
|
+
"lint": "biome lint index.js benchmark.js src test biome.json",
|
|
76
|
+
"lint:fix": "biome check --apply index.js benchmark.js src test biome.json",
|
|
77
|
+
"rollup": "rollup --config",
|
|
78
|
+
"test": "vitest",
|
|
79
|
+
"test:coverage": "pnpm run rollup && pnpm run test -- --coverage",
|
|
80
|
+
"test:ci": "pnpm run lint && pnpm run test:coverage && pnpm run test:typescript",
|
|
81
|
+
"test:typescript": "tsd",
|
|
82
|
+
"types:generate": "pnpm exec tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir ."
|
|
83
|
+
}
|
|
84
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuplo/cli",
|
|
3
|
-
"version": "6.70.
|
|
3
|
+
"version": "6.70.31",
|
|
4
4
|
"repository": "https://github.com/zuplo/zuplo",
|
|
5
5
|
"author": "Zuplo, Inc.",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@opentelemetry/api": "1.9.0",
|
|
30
30
|
"@sentry/node": "9.22.0",
|
|
31
31
|
"@swc/core": "1.10.18",
|
|
32
|
-
"@zuplo/core": "6.70.
|
|
32
|
+
"@zuplo/core": "6.70.31",
|
|
33
33
|
"@zuplo/editor": "1.0.20821740935",
|
|
34
|
-
"@zuplo/openapi-tools": "6.70.
|
|
35
|
-
"@zuplo/runtime": "6.70.
|
|
34
|
+
"@zuplo/openapi-tools": "6.70.31",
|
|
35
|
+
"@zuplo/runtime": "6.70.31",
|
|
36
36
|
"chalk": "5.4.1",
|
|
37
37
|
"chokidar": "3.5.3",
|
|
38
38
|
"cookie": "1.0.2",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"workerd": "1.20241230.0",
|
|
67
67
|
"yargs": "17.7.2",
|
|
68
68
|
"zod": "3.25.76",
|
|
69
|
-
"@zuplo/graphql": "6.70.
|
|
70
|
-
"@zuplo/otel": "6.70.
|
|
69
|
+
"@zuplo/graphql": "6.70.31",
|
|
70
|
+
"@zuplo/otel": "6.70.31"
|
|
71
71
|
},
|
|
72
72
|
"bundleDependencies": [
|
|
73
73
|
"@fastify/cors",
|