@karmaniverous/jeeves-meta 0.2.0 → 0.2.2
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/dist/cli.js +14 -3
- package/dist/index.js +14 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
import { readFileSync, readdirSync, unlinkSync, mkdirSync, writeFileSync, existsSync, statSync } from 'node:fs';
|
|
4
3
|
import { dirname, join, relative, sep, resolve } from 'node:path';
|
|
5
4
|
import { z } from 'zod';
|
|
@@ -1566,8 +1565,20 @@ class HttpWatcherClient {
|
|
|
1566
1565
|
if (params.cursor !== undefined) {
|
|
1567
1566
|
body.cursor = params.cursor;
|
|
1568
1567
|
}
|
|
1569
|
-
const
|
|
1570
|
-
|
|
1568
|
+
const raw = (await this.post('/scan', body));
|
|
1569
|
+
// jeeves-watcher returns { points, cursor }; map to ScanResponse.
|
|
1570
|
+
const points = (raw.points ?? raw.files ?? []);
|
|
1571
|
+
const next = (raw.cursor ?? raw.next);
|
|
1572
|
+
const files = points.map((p) => {
|
|
1573
|
+
const payload = (p.payload ?? p);
|
|
1574
|
+
return {
|
|
1575
|
+
file_path: (payload.file_path ?? payload.path ?? ''),
|
|
1576
|
+
modified_at: (payload.modified_at ?? payload.mtime ?? 0),
|
|
1577
|
+
content_hash: (payload.content_hash ?? ''),
|
|
1578
|
+
...payload,
|
|
1579
|
+
};
|
|
1580
|
+
});
|
|
1581
|
+
return { files, next: next ?? undefined };
|
|
1571
1582
|
}
|
|
1572
1583
|
async registerRules(source, rules) {
|
|
1573
1584
|
await this.post('/rules/register', { source, rules });
|
package/dist/index.js
CHANGED
|
@@ -1585,8 +1585,20 @@ class HttpWatcherClient {
|
|
|
1585
1585
|
if (params.cursor !== undefined) {
|
|
1586
1586
|
body.cursor = params.cursor;
|
|
1587
1587
|
}
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1588
|
+
const raw = (await this.post('/scan', body));
|
|
1589
|
+
// jeeves-watcher returns { points, cursor }; map to ScanResponse.
|
|
1590
|
+
const points = (raw.points ?? raw.files ?? []);
|
|
1591
|
+
const next = (raw.cursor ?? raw.next);
|
|
1592
|
+
const files = points.map((p) => {
|
|
1593
|
+
const payload = (p.payload ?? p);
|
|
1594
|
+
return {
|
|
1595
|
+
file_path: (payload.file_path ?? payload.path ?? ''),
|
|
1596
|
+
modified_at: (payload.modified_at ?? payload.mtime ?? 0),
|
|
1597
|
+
content_hash: (payload.content_hash ?? ''),
|
|
1598
|
+
...payload,
|
|
1599
|
+
};
|
|
1600
|
+
});
|
|
1601
|
+
return { files, next: next ?? undefined };
|
|
1590
1602
|
}
|
|
1591
1603
|
async registerRules(source, rules) {
|
|
1592
1604
|
await this.post('/rules/register', { source, rules });
|