@karmaniverous/jeeves-meta 0.2.1 → 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 -2
- package/dist/index.js +14 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1565,8 +1565,20 @@ class HttpWatcherClient {
|
|
|
1565
1565
|
if (params.cursor !== undefined) {
|
|
1566
1566
|
body.cursor = params.cursor;
|
|
1567
1567
|
}
|
|
1568
|
-
const
|
|
1569
|
-
|
|
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 };
|
|
1570
1582
|
}
|
|
1571
1583
|
async registerRules(source, rules) {
|
|
1572
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 });
|