@trebired/logger 2.0.0 → 2.1.1

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 (98) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +15 -2
  3. package/dist/core/create_log.d.ts.map +1 -1
  4. package/dist/core/create_log.js +16 -0
  5. package/dist/core/create_log.js.map +1 -1
  6. package/dist/format/console.d.ts.map +1 -1
  7. package/dist/format/console.js +38 -4
  8. package/dist/format/console.js.map +1 -1
  9. package/dist/index.d.ts +2 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/storage/backend/index.d.ts +6 -0
  14. package/dist/storage/backend/index.d.ts.map +1 -0
  15. package/dist/storage/backend/index.js +19 -0
  16. package/dist/storage/backend/index.js.map +1 -0
  17. package/dist/storage/backend/js.d.ts +4 -0
  18. package/dist/storage/backend/js.d.ts.map +1 -0
  19. package/dist/storage/backend/js.js +179 -0
  20. package/dist/storage/backend/js.js.map +1 -0
  21. package/dist/storage/backend/native.d.ts +6 -0
  22. package/dist/storage/backend/native.d.ts.map +1 -0
  23. package/dist/storage/backend/native.js +89 -0
  24. package/dist/storage/backend/native.js.map +1 -0
  25. package/dist/storage/backend/types.d.ts +57 -0
  26. package/dist/storage/backend/types.d.ts.map +1 -0
  27. package/dist/storage/backend/types.js +2 -0
  28. package/dist/storage/backend/types.js.map +1 -0
  29. package/dist/storage/export.d.ts +5 -0
  30. package/dist/storage/export.d.ts.map +1 -0
  31. package/dist/storage/export.js +124 -0
  32. package/dist/storage/export.js.map +1 -0
  33. package/dist/storage/partitions/delete.d.ts +5 -0
  34. package/dist/storage/partitions/delete.d.ts.map +1 -0
  35. package/dist/storage/partitions/delete.js +121 -0
  36. package/dist/storage/partitions/delete.js.map +1 -0
  37. package/dist/storage/partitions/files.d.ts +12 -0
  38. package/dist/storage/partitions/files.d.ts.map +1 -0
  39. package/dist/storage/partitions/files.js +142 -0
  40. package/dist/storage/partitions/files.js.map +1 -0
  41. package/dist/storage/partitions/internal.d.ts +47 -0
  42. package/dist/storage/partitions/internal.d.ts.map +1 -0
  43. package/dist/storage/partitions/internal.js +35 -0
  44. package/dist/storage/partitions/internal.js.map +1 -0
  45. package/dist/storage/partitions/markers.d.ts +8 -0
  46. package/dist/storage/partitions/markers.d.ts.map +1 -0
  47. package/dist/storage/partitions/markers.js +88 -0
  48. package/dist/storage/partitions/markers.js.map +1 -0
  49. package/dist/storage/partitions/public.d.ts +11 -0
  50. package/dist/storage/partitions/public.d.ts.map +1 -0
  51. package/dist/storage/partitions/public.js +79 -0
  52. package/dist/storage/partitions/public.js.map +1 -0
  53. package/dist/storage/partitions/records.d.ts +9 -0
  54. package/dist/storage/partitions/records.d.ts.map +1 -0
  55. package/dist/storage/partitions/records.js +73 -0
  56. package/dist/storage/partitions/records.js.map +1 -0
  57. package/dist/storage/partitions/transforms.d.ts +6 -0
  58. package/dist/storage/partitions/transforms.d.ts.map +1 -0
  59. package/dist/storage/partitions/transforms.js +59 -0
  60. package/dist/storage/partitions/transforms.js.map +1 -0
  61. package/dist/storage/partitions.d.ts +3 -29
  62. package/dist/storage/partitions.d.ts.map +1 -1
  63. package/dist/storage/partitions.js +3 -563
  64. package/dist/storage/partitions.js.map +1 -1
  65. package/dist/types/browser.d.ts +54 -0
  66. package/dist/types/browser.d.ts.map +1 -0
  67. package/dist/types/browser.js +2 -0
  68. package/dist/types/browser.js.map +1 -0
  69. package/dist/types/common.d.ts +73 -0
  70. package/dist/types/common.d.ts.map +1 -0
  71. package/dist/types/common.js +2 -0
  72. package/dist/types/common.js.map +1 -0
  73. package/dist/types/export.d.ts +53 -0
  74. package/dist/types/export.d.ts.map +1 -0
  75. package/dist/types/export.js +2 -0
  76. package/dist/types/export.js.map +1 -0
  77. package/dist/types/index.d.ts +7 -0
  78. package/dist/types/index.d.ts.map +1 -0
  79. package/dist/types/index.js +2 -0
  80. package/dist/types/index.js.map +1 -0
  81. package/dist/types/partitions.d.ts +92 -0
  82. package/dist/types/partitions.d.ts.map +1 -0
  83. package/dist/types/partitions.js +2 -0
  84. package/dist/types/partitions.js.map +1 -0
  85. package/dist/types/query.d.ts +49 -0
  86. package/dist/types/query.d.ts.map +1 -0
  87. package/dist/types/query.js +2 -0
  88. package/dist/types/query.js.map +1 -0
  89. package/dist/types/server.d.ts +79 -0
  90. package/dist/types/server.d.ts.map +1 -0
  91. package/dist/types/server.js +2 -0
  92. package/dist/types/server.js.map +1 -0
  93. package/dist/types.d.ts +1 -326
  94. package/dist/types.d.ts.map +1 -1
  95. package/native/darwin-arm64.node +0 -0
  96. package/native/darwin-x64.node +0 -0
  97. package/native/linux-x64-gnu.node +0 -0
  98. package/package.json +16 -7
@@ -1,564 +1,4 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import zlib from "node:zlib";
4
- import { PARTITION_MARKER_FILE } from "../constants.js";
5
- import { normGroup } from "../groups.js";
6
- import { toString } from "../utils/values.js";
7
- import { makeLogFileName, sanitizePartitionName, walkedFileFromPath } from "./names.js";
8
- function resolveDir(input) {
9
- const raw = toString(input).trim();
10
- return raw ? path.resolve(raw) : "";
11
- }
12
- function partitionRootPath(dir, partition) {
13
- return path.join(dir, partition);
14
- }
15
- function isValidMarker(value, expectedName) {
16
- if (!value || typeof value !== "object")
17
- return false;
18
- const marker = value;
19
- if (toString(marker.name) !== (expectedName || toString(marker.name)))
20
- return false;
21
- if (typeof marker.temporary !== "boolean")
22
- return false;
23
- if (!toString(marker.created_at))
24
- return false;
25
- if (!toString(marker.updated_at))
26
- return false;
27
- return true;
28
- }
29
- function markerPath(rootDir) {
30
- return path.join(rootDir, PARTITION_MARKER_FILE);
31
- }
32
- async function readPartitionMarkerFromRoot(rootDir, expectedName) {
33
- try {
34
- const text = await fs.promises.readFile(markerPath(rootDir), "utf8");
35
- const parsed = JSON.parse(text);
36
- return isValidMarker(parsed, expectedName) ? parsed : null;
37
- }
38
- catch {
39
- return null;
40
- }
41
- }
42
- function readPartitionMarkerFromRootSync(rootDir, expectedName) {
43
- try {
44
- const text = fs.readFileSync(markerPath(rootDir), "utf8");
45
- const parsed = JSON.parse(text);
46
- return isValidMarker(parsed, expectedName) ? parsed : null;
47
- }
48
- catch {
49
- return null;
50
- }
51
- }
52
- function nextMarker(existing, name, options = {}) {
53
- const now = options.updatedAt || new Date().toISOString();
54
- const created_at = options.createdAt
55
- || ((options.preserveCreatedAt !== false && existing?.created_at) ? existing.created_at : now);
56
- const temporary = typeof options.temporary === "boolean"
57
- ? options.temporary
58
- : (options.preserveTemporary !== false && existing ? existing.temporary : false);
59
- return {
60
- name,
61
- temporary,
62
- created_at,
63
- updated_at: now,
64
- };
65
- }
66
- async function writePartitionMarker(rootDir, marker) {
67
- await fs.promises.mkdir(rootDir, { recursive: true });
68
- await fs.promises.writeFile(markerPath(rootDir), `${JSON.stringify(marker)}\n`, "utf8");
69
- }
70
- function writePartitionMarkerSync(rootDir, marker) {
71
- fs.mkdirSync(rootDir, { recursive: true });
72
- fs.writeFileSync(markerPath(rootDir), `${JSON.stringify(marker)}\n`, "utf8");
73
- }
74
- async function touchPartitionMarker(dir, partition, options = {}) {
75
- const baseDir = resolveDir(dir);
76
- if (!baseDir)
77
- throw new Error("missing-log-dir");
78
- const name = sanitizePartitionName(partition);
79
- const rootDir = partitionRootPath(baseDir, name);
80
- const existing = await readPartitionMarkerFromRoot(rootDir, name);
81
- const marker = nextMarker(existing, name, options);
82
- await writePartitionMarker(rootDir, marker);
83
- return marker;
84
- }
85
- function touchPartitionMarkerSync(dir, partition, options = {}) {
86
- const baseDir = resolveDir(dir);
87
- if (!baseDir)
88
- throw new Error("missing-log-dir");
89
- const name = sanitizePartitionName(partition);
90
- const rootDir = partitionRootPath(baseDir, name);
91
- const existing = readPartitionMarkerFromRootSync(rootDir, name);
92
- const marker = nextMarker(existing, name, options);
93
- writePartitionMarkerSync(rootDir, marker);
94
- return marker;
95
- }
96
- async function pathExists(targetPath) {
97
- try {
98
- await fs.promises.access(targetPath);
99
- return true;
100
- }
101
- catch {
102
- return false;
103
- }
104
- }
105
- async function collectPartitionRecords(dir) {
106
- const baseDir = resolveDir(dir);
107
- if (!baseDir)
108
- return [];
109
- let entries = [];
110
- try {
111
- entries = await fs.promises.readdir(baseDir, { withFileTypes: true });
112
- }
113
- catch {
114
- return [];
115
- }
116
- const out = [];
117
- for (const entry of entries) {
118
- if (!entry.isDirectory())
119
- continue;
120
- const name = entry.name;
121
- const rootDir = path.join(baseDir, name);
122
- const marker = await readPartitionMarkerFromRoot(rootDir, name);
123
- if (!marker)
124
- continue;
125
- out.push({ dir: baseDir, name, path: rootDir, marker });
126
- }
127
- out.sort((a, b) => a.name.localeCompare(b.name));
128
- return out;
129
- }
130
- async function getPartitionRecord(dir, partition) {
131
- const baseDir = resolveDir(dir);
132
- if (!baseDir)
133
- return null;
134
- const name = sanitizePartitionName(partition);
135
- const rootDir = partitionRootPath(baseDir, name);
136
- const marker = await readPartitionMarkerFromRoot(rootDir, name);
137
- if (!marker)
138
- return null;
139
- return { dir: baseDir, name, path: rootDir, marker };
140
- }
141
- async function requirePartitionRecord(dir, partition) {
142
- const record = await getPartitionRecord(dir, partition);
143
- if (!record)
144
- throw new Error(`partition-not-found: ${partition}`);
145
- return record;
146
- }
147
- async function readLogRows(filePath, compressed) {
148
- try {
149
- const data = await fs.promises.readFile(filePath);
150
- const text = compressed ? zlib.gunzipSync(data).toString("utf8") : data.toString("utf8");
151
- if (!text.trim())
152
- return [];
153
- const rows = [];
154
- for (const line of text.trim().split("\n")) {
155
- try {
156
- const parsed = JSON.parse(line);
157
- if (parsed && typeof parsed === "object")
158
- rows.push(parsed);
159
- }
160
- catch { }
161
- }
162
- return rows;
163
- }
164
- catch {
165
- return [];
166
- }
167
- }
168
- async function writeLogRows(filePath, rows, compressed) {
169
- const payload = rows.length ? `${rows.map((row) => JSON.stringify(row)).join("\n")}\n` : "";
170
- if (compressed) {
171
- const zipped = zlib.gzipSync(Buffer.from(payload, "utf8"));
172
- await fs.promises.writeFile(filePath, zipped);
173
- return;
174
- }
175
- await fs.promises.writeFile(filePath, payload, "utf8");
176
- }
177
- async function collectPartitionFiles(record) {
178
- const out = [];
179
- const stack = [record.path];
180
- while (stack.length) {
181
- const current = stack.pop() || "";
182
- let entries = [];
183
- try {
184
- entries = await fs.promises.readdir(current, { withFileTypes: true });
185
- }
186
- catch {
187
- continue;
188
- }
189
- for (const entry of entries) {
190
- const absPath = path.join(current, entry.name);
191
- if (entry.isDirectory()) {
192
- stack.push(absPath);
193
- continue;
194
- }
195
- if (!entry.isFile() || entry.name === PARTITION_MARKER_FILE)
196
- continue;
197
- const walked = walkedFileFromPath(record.path, absPath, record.name, record.path);
198
- if (walked)
199
- out.push(walked);
200
- }
201
- }
202
- out.sort((a, b) => a.absPath.localeCompare(b.absPath));
203
- return out;
204
- }
205
- async function partitionInfoFromRecord(record) {
206
- const files = await collectPartitionFiles(record);
207
- const dirs = new Set();
208
- let bytes = 0;
209
- let logs = 0;
210
- let lastActivityMs = 0;
211
- for (const file of files) {
212
- try {
213
- const stat = await fs.promises.stat(file.absPath);
214
- bytes += stat.size;
215
- if (stat.mtimeMs > lastActivityMs)
216
- lastActivityMs = stat.mtimeMs;
217
- }
218
- catch { }
219
- dirs.add(file.relDir || ".");
220
- logs += (await readLogRows(file.absPath, file.compressed)).length;
221
- }
222
- return {
223
- name: record.name,
224
- path: record.path,
225
- temporary: record.marker.temporary,
226
- created_at: record.marker.created_at,
227
- updated_at: record.marker.updated_at,
228
- last_activity_at: lastActivityMs > 0 ? new Date(lastActivityMs).toISOString() : null,
229
- total: {
230
- logs,
231
- dirs: dirs.size,
232
- files: files.length,
233
- bytes,
234
- },
235
- };
236
- }
237
- function fileStamp(file) {
238
- return `${file.day}-${file.hour}`;
239
- }
240
- async function findAvailableTargetPath(dir, file) {
241
- let sequence = file.sequence;
242
- for (;;) {
243
- const fileName = makeLogFileName(fileStamp(file), sequence, file.level);
244
- const plainTarget = path.join(dir, fileName);
245
- const gzipTarget = path.join(dir, `${fileName}.gz`);
246
- if (!(await pathExists(plainTarget)) && !(await pathExists(gzipTarget))) {
247
- return file.compressed ? gzipTarget : plainTarget;
248
- }
249
- sequence += 1;
250
- }
251
- }
252
- async function writePartitionFiles(source, targetRoot, targetName, merge) {
253
- const files = await collectPartitionFiles(source);
254
- for (const file of files) {
255
- const rows = await readLogRows(file.absPath, file.compressed);
256
- const nextRows = rows.map((row) => ({ ...row, partition: targetName }));
257
- const targetDir = file.groupDir ? path.join(targetRoot, file.groupDir) : targetRoot;
258
- await fs.promises.mkdir(targetDir, { recursive: true });
259
- const targetPath = merge
260
- ? await findAvailableTargetPath(targetDir, file)
261
- : path.join(targetDir, path.basename(file.absPath));
262
- await writeLogRows(targetPath, nextRows, file.compressed);
263
- }
264
- }
265
- async function transformPartition(options) {
266
- const targetDir = resolveDir(options.targetDir);
267
- if (!targetDir)
268
- throw new Error("missing-log-dir");
269
- const targetName = sanitizePartitionName(options.targetName);
270
- const targetRoot = partitionRootPath(targetDir, targetName);
271
- if (options.source.path === targetRoot) {
272
- await touchPartitionMarker(targetDir, targetName, {
273
- temporary: options.targetTemporary,
274
- createdAt: options.source.marker.created_at,
275
- preserveCreatedAt: false,
276
- });
277
- return (await getPartitionInfo(targetDir, targetName));
278
- }
279
- if (await pathExists(targetRoot))
280
- throw new Error(`partition-already-exists: ${targetName}`);
281
- const tempRoot = path.join(targetDir, `.trebired-partition-build-${Date.now()}-${Math.random().toString(16).slice(2)}`);
282
- try {
283
- await fs.promises.mkdir(targetDir, { recursive: true });
284
- await writePartitionFiles(options.source, tempRoot, targetName, false);
285
- await writePartitionMarker(tempRoot, {
286
- name: targetName,
287
- temporary: options.targetTemporary,
288
- created_at: options.preserveSourceCreatedAt ? options.source.marker.created_at : new Date().toISOString(),
289
- updated_at: new Date().toISOString(),
290
- });
291
- await fs.promises.rename(tempRoot, targetRoot);
292
- if (options.deleteSource)
293
- await fs.promises.rm(options.source.path, { recursive: true, force: true });
294
- return (await getPartitionInfo(targetDir, targetName));
295
- }
296
- catch (error) {
297
- await fs.promises.rm(tempRoot, { recursive: true, force: true }).catch(() => { });
298
- throw error;
299
- }
300
- }
301
- async function mergePartitionRecord(source, target, temporary) {
302
- if (source.path === target.path)
303
- throw new Error(`partition-merge-target-same-as-source: ${source.name}`);
304
- await writePartitionFiles(source, target.path, target.name, true);
305
- await writePartitionMarker(target.path, {
306
- name: target.name,
307
- temporary,
308
- created_at: target.marker.created_at,
309
- updated_at: new Date().toISOString(),
310
- });
311
- await fs.promises.rm(source.path, { recursive: true, force: true });
312
- return (await getPartitionInfo(target.dir, target.name));
313
- }
314
- function sortPartitionCandidates(items) {
315
- return items.sort((a, b) => a.info.name.localeCompare(b.info.name));
316
- }
317
- function partitionAgeReferenceMs(info) {
318
- const reference = info.last_activity_at || info.updated_at || info.created_at;
319
- const parsed = Date.parse(reference);
320
- return Number.isFinite(parsed) ? parsed : 0;
321
- }
322
- function cutoffMsForDays(days) {
323
- const value = Number(days);
324
- if (!Number.isFinite(value) || value <= 0)
325
- return null;
326
- return Date.now() - value * 24 * 60 * 60 * 1000;
327
- }
328
- async function collectPartitionDeleteCandidates(dir, options = {}) {
329
- const wanted = new Set((options.partitions || []).map((item) => sanitizePartitionName(item)));
330
- const cutoff = cutoffMsForDays(options.olderThanDays);
331
- const records = await collectPartitionRecords(dir);
332
- const items = await Promise.all(records.map(async (record) => ({
333
- record,
334
- info: await partitionInfoFromRecord(record),
335
- })));
336
- return sortPartitionCandidates(items.filter(({ info }) => {
337
- if (wanted.size && !wanted.has(info.name))
338
- return false;
339
- if (options.temporaryOnly === true && info.temporary !== true)
340
- return false;
341
- if (cutoff != null && partitionAgeReferenceMs(info) >= cutoff)
342
- return false;
343
- return true;
344
- }));
345
- }
346
- async function partitionMarkerMap(dir) {
347
- const records = await collectPartitionRecords(dir);
348
- return new Map(records.map((record) => [record.name, record.marker]));
349
- }
350
- function fileMatchesDeleteFilters(file, options) {
351
- const level = toString(options.level || "all").toLowerCase() || "all";
352
- const groupKey = toString(options.groupKey || "all") || "all";
353
- const day = toString(options.day);
354
- const hour = toString(options.hour);
355
- if (day && file.day !== day)
356
- return false;
357
- if (hour && file.hour !== hour)
358
- return false;
359
- if (groupKey !== "all" && file.groupKey !== normGroup(groupKey).key)
360
- return false;
361
- if (level !== "all" && file.level !== level)
362
- return false;
363
- return true;
364
- }
365
- async function listTopLevelFiles(baseDir) {
366
- const out = [];
367
- const stack = [{ dir: baseDir, rootDir: baseDir, partition: null }];
368
- const markers = await partitionMarkerMap(baseDir);
369
- while (stack.length) {
370
- const current = stack.pop();
371
- let entries = [];
372
- try {
373
- entries = await fs.promises.readdir(current.dir, { withFileTypes: true });
374
- }
375
- catch {
376
- continue;
377
- }
378
- for (const entry of entries) {
379
- const absPath = path.join(current.dir, entry.name);
380
- if (entry.isDirectory()) {
381
- if (current.partition == null && markers.has(entry.name)) {
382
- stack.push({ dir: absPath, rootDir: absPath, partition: entry.name });
383
- continue;
384
- }
385
- stack.push({ dir: absPath, rootDir: current.rootDir, partition: current.partition });
386
- continue;
387
- }
388
- if (!entry.isFile() || entry.name === PARTITION_MARKER_FILE)
389
- continue;
390
- const walked = walkedFileFromPath(current.rootDir, absPath, current.partition, current.rootDir);
391
- if (walked)
392
- out.push(walked);
393
- }
394
- }
395
- out.sort((a, b) => a.absPath.localeCompare(b.absPath));
396
- return out;
397
- }
398
- async function fileDeleteCandidates(dir, options = {}) {
399
- const baseDir = resolveDir(dir);
400
- if (!baseDir)
401
- return [];
402
- const markers = await partitionMarkerMap(baseDir);
403
- const files = await listTopLevelFiles(baseDir);
404
- const cutoff = cutoffMsForDays(options.olderThanDays);
405
- const hasExplicitPartition = Object.prototype.hasOwnProperty.call(options, "partition");
406
- const explicitPartition = hasExplicitPartition && options.partition != null ? sanitizePartitionName(options.partition) : options.partition;
407
- const acrossPartitions = options.acrossPartitions === true || !hasExplicitPartition;
408
- const out = [];
409
- for (const file of files) {
410
- if (!fileMatchesDeleteFilters(file, options))
411
- continue;
412
- if (!acrossPartitions) {
413
- if (explicitPartition == null) {
414
- if (file.partition != null)
415
- continue;
416
- }
417
- else if (file.partition !== explicitPartition)
418
- continue;
419
- }
420
- else if (hasExplicitPartition) {
421
- if (explicitPartition == null) {
422
- if (file.partition != null)
423
- continue;
424
- }
425
- else if (file.partition !== explicitPartition)
426
- continue;
427
- }
428
- if (options.temporaryOnly === true) {
429
- if (!file.partition)
430
- continue;
431
- if (markers.get(file.partition)?.temporary !== true)
432
- continue;
433
- }
434
- let stat;
435
- try {
436
- stat = await fs.promises.stat(file.absPath);
437
- }
438
- catch {
439
- continue;
440
- }
441
- if (cutoff != null && stat.mtimeMs >= cutoff)
442
- continue;
443
- out.push({
444
- file,
445
- bytes: stat.size,
446
- logs: (await readLogRows(file.absPath, file.compressed)).length,
447
- });
448
- }
449
- return out;
450
- }
451
- async function createPartition(dir, partition, options = {}) {
452
- const baseDir = resolveDir(dir);
453
- if (!baseDir)
454
- throw new Error("missing-log-dir");
455
- const name = sanitizePartitionName(partition);
456
- const rootDir = partitionRootPath(baseDir, name);
457
- if (await pathExists(rootDir))
458
- throw new Error(`partition-already-exists: ${name}`);
459
- await writePartitionMarker(rootDir, {
460
- name,
461
- temporary: options.temporary === true,
462
- created_at: new Date().toISOString(),
463
- updated_at: new Date().toISOString(),
464
- });
465
- return (await getPartitionInfo(baseDir, name));
466
- }
467
- async function listPartitions(dir) {
468
- const records = await collectPartitionRecords(dir);
469
- const items = await Promise.all(records.map((record) => partitionInfoFromRecord(record)));
470
- return items.sort((a, b) => a.name.localeCompare(b.name));
471
- }
472
- async function getPartitionInfo(dir, partition) {
473
- const record = await getPartitionRecord(dir, partition);
474
- return record ? partitionInfoFromRecord(record) : null;
475
- }
476
- async function renamePartition(dir, options) {
477
- const source = await requirePartitionRecord(dir, options.from);
478
- const targetName = sanitizePartitionName(options.to);
479
- return transformPartition({
480
- source,
481
- targetDir: source.dir,
482
- targetName,
483
- deleteSource: true,
484
- targetTemporary: source.marker.temporary,
485
- preserveSourceCreatedAt: true,
486
- });
487
- }
488
- async function movePartition(options) {
489
- const source = await requirePartitionRecord(options.fromDir, options.from);
490
- const targetName = sanitizePartitionName(options.to || source.name);
491
- return transformPartition({
492
- source,
493
- targetDir: resolveDir(options.toDir),
494
- targetName,
495
- deleteSource: true,
496
- targetTemporary: source.marker.temporary,
497
- preserveSourceCreatedAt: true,
498
- });
499
- }
500
- async function copyPartition(options) {
501
- const source = await requirePartitionRecord(options.fromDir, options.from);
502
- const targetDir = resolveDir(options.toDir);
503
- const targetName = sanitizePartitionName(options.to || source.name);
504
- if (source.dir === targetDir && source.name === targetName)
505
- throw new Error(`partition-already-exists: ${targetName}`);
506
- return transformPartition({
507
- source,
508
- targetDir,
509
- targetName,
510
- deleteSource: false,
511
- targetTemporary: source.marker.temporary,
512
- preserveSourceCreatedAt: false,
513
- });
514
- }
515
- async function mergePartition(dir, options) {
516
- const source = await requirePartitionRecord(dir, options.from);
517
- const target = await requirePartitionRecord(dir, options.to);
518
- return mergePartitionRecord(source, target, target.marker.temporary);
519
- }
520
- async function deletePartition(dir, partition) {
521
- return deletePartitions(dir, { partitions: [partition] });
522
- }
523
- async function deletePartitions(dir, options = {}) {
524
- const candidates = await collectPartitionDeleteCandidates(dir, options);
525
- let files = 0;
526
- let logs = 0;
527
- let bytes = 0;
528
- for (const item of candidates) {
529
- files += item.info.total.files;
530
- logs += item.info.total.logs;
531
- bytes += item.info.total.bytes;
532
- await fs.promises.rm(item.record.path, { recursive: true, force: true });
533
- }
534
- return {
535
- partitions: candidates.length,
536
- files,
537
- logs,
538
- bytes,
539
- items: candidates.map((item) => item.info.name),
540
- };
541
- }
542
- async function deleteLogs(dir, options = {}) {
543
- const candidates = await fileDeleteCandidates(dir, options);
544
- const partitions = new Set();
545
- for (const item of candidates) {
546
- if (item.file.partition)
547
- partitions.add(item.file.partition);
548
- await fs.promises.rm(item.file.absPath, { force: true });
549
- }
550
- return {
551
- partitions: partitions.size,
552
- files: candidates.length,
553
- logs: candidates.reduce((sum, item) => sum + item.logs, 0),
554
- bytes: candidates.reduce((sum, item) => sum + item.bytes, 0),
555
- items: candidates.map((item) => ({
556
- path: item.file.absPath,
557
- partition: item.file.partition,
558
- logs: item.logs,
559
- bytes: item.bytes,
560
- })),
561
- };
562
- }
563
- export { createPartition, copyPartition, deleteLogs, deletePartition, deletePartitions, getPartitionInfo, listPartitions, mergePartition, movePartition, readPartitionMarkerFromRoot, readPartitionMarkerFromRootSync, renamePartition, touchPartitionMarker, touchPartitionMarkerSync, };
1
+ export { deleteLogs, deletePartitions } from "./partitions/delete.js";
2
+ export { copyPartition, createPartition, deletePartition, getPartitionInfo, listPartitions, mergePartition, movePartition, renamePartition, } from "./partitions/public.js";
3
+ export { readPartitionMarkerFromRoot, readPartitionMarkerFromRootSync, touchPartitionMarker, touchPartitionMarkerSync, } from "./partitions/markers.js";
564
4
  //# sourceMappingURL=partitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"partitions.js","sourceRoot":"","sources":["../../src/storage/partitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAczC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAC;AA4C5G,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,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itions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { BrowserTransportContext, ConsoleOptions, LogEntry, LogLevelConfig, RedactOptions } from "./common.js";
2
+ type BrowserBatchOptions = {
3
+ size?: number;
4
+ delayMs?: number;
5
+ maxQueue?: number;
6
+ overflow?: "drop-newest" | "drop-oldest" | "throw";
7
+ };
8
+ type BrowserTransport = {
9
+ name: string;
10
+ available?: () => boolean;
11
+ write(entries: LogEntry[], context: BrowserTransportContext): void | Promise<void>;
12
+ flush?(): void | Promise<void>;
13
+ close?(): void | Promise<void>;
14
+ };
15
+ type BrowserConsoleTransportOptions = {
16
+ console?: boolean | ConsoleOptions;
17
+ timeZone?: string;
18
+ levels?: Record<string, LogLevelConfig>;
19
+ };
20
+ type BrowserLogOptions = {
21
+ console?: boolean | ConsoleOptions;
22
+ quiet?: boolean;
23
+ timeZone?: string;
24
+ source?: string;
25
+ group?: string;
26
+ metadata?: Record<string, unknown>;
27
+ levels?: Record<string, LogLevelConfig>;
28
+ minLevel?: string | number;
29
+ redact?: RedactOptions;
30
+ serializers?: Record<string, (value: unknown) => unknown>;
31
+ sample?: number | ((entry: LogEntry) => boolean);
32
+ transports?: Array<"console" | BrowserTransport>;
33
+ batch?: BrowserBatchOptions;
34
+ };
35
+ type BrowserLogStats = {
36
+ queued: number;
37
+ written: number;
38
+ dropped: number;
39
+ failed: number;
40
+ queueLength: number;
41
+ closed: boolean;
42
+ transports: string[];
43
+ };
44
+ type BrowserLogInstance = Record<string, any> & {
45
+ group(groupName?: string): Record<string, any>;
46
+ withScope(source?: string | null, groupName?: string, instance?: string | number | null): Record<string, any>;
47
+ setEnabled(flag: boolean): void;
48
+ logError(error: unknown, metadata?: Record<string, unknown>, source?: string): void;
49
+ flush(): Promise<void>;
50
+ close(): Promise<void>;
51
+ getStats(): BrowserLogStats;
52
+ };
53
+ export type { BrowserBatchOptions, BrowserConsoleTransportOptions, BrowserLogInstance, BrowserLogOptions, BrowserLogStats, BrowserTransport, };
54
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/types/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEpH,KAAK,mBAAmB,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC;CACpD,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;IAC1B,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,uBAAuB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,KAAK,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAA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