@theplato/tiro-cli 0.3.0 → 0.3.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.
- package/dist/bin/tiro.js +17 -2
- package/package.json +1 -1
package/dist/bin/tiro.js
CHANGED
|
@@ -1206,7 +1206,13 @@ function formatDuration(sec) {
|
|
|
1206
1206
|
|
|
1207
1207
|
// src/commands/notes/search.ts
|
|
1208
1208
|
import "commander";
|
|
1209
|
-
|
|
1209
|
+
import { z as z4 } from "zod";
|
|
1210
|
+
var SearchResponseSchema = z4.object({
|
|
1211
|
+
notes: z4.array(NoteSchema),
|
|
1212
|
+
nextCursor: z4.string().nullable(),
|
|
1213
|
+
degraded: z4.boolean().optional(),
|
|
1214
|
+
degradedReason: z4.string().nullable().optional()
|
|
1215
|
+
}).passthrough();
|
|
1210
1216
|
var DEFAULT_PAGE_SIZE2 = 100;
|
|
1211
1217
|
var MAX_PAGE_SIZE2 = 1e3;
|
|
1212
1218
|
var HELP_AFTER2 = `
|
|
@@ -1276,13 +1282,22 @@ function registerNotesSearch(parent) {
|
|
|
1276
1282
|
SearchResponseSchema,
|
|
1277
1283
|
body
|
|
1278
1284
|
);
|
|
1279
|
-
const visible = opts.includeUntitled === true ? res.
|
|
1285
|
+
const visible = opts.includeUntitled === true ? res.notes : res.notes.filter(isVisibleNote);
|
|
1280
1286
|
const mode = resolveOutputMode(globalOpts);
|
|
1281
1287
|
if (mode === "json") {
|
|
1282
1288
|
for (const note of visible) printNdjson(note);
|
|
1283
1289
|
if (res.nextCursor) printNdjson({ _cursor: res.nextCursor });
|
|
1290
|
+
if (res.degraded === true) {
|
|
1291
|
+
printNdjson({ _degraded: true, _degradedReason: res.degradedReason ?? null });
|
|
1292
|
+
}
|
|
1284
1293
|
} else {
|
|
1285
1294
|
printPretty2(visible, res.nextCursor, globalOpts);
|
|
1295
|
+
if (res.degraded === true && globalOpts.quiet !== true) {
|
|
1296
|
+
process.stderr.write(
|
|
1297
|
+
`${color("\u26A0", "yellow", globalOpts)} search results are partial${res.degradedReason ? ` (${res.degradedReason})` : ""}
|
|
1298
|
+
`
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1286
1301
|
}
|
|
1287
1302
|
});
|
|
1288
1303
|
}
|