@robbeverhelst/do 1.42.0 → 1.43.0
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/do.js +156 -1
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -23306,7 +23306,7 @@ function parseCapture2(input) {
|
|
|
23306
23306
|
|
|
23307
23307
|
// src/meta.ts
|
|
23308
23308
|
var CLI_NAME = "do";
|
|
23309
|
-
var VERSION = "1.
|
|
23309
|
+
var VERSION = "1.43.0";
|
|
23310
23310
|
var API_PREFIX = "/api/v1";
|
|
23311
23311
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
23312
23312
|
|
|
@@ -23596,6 +23596,102 @@ var ENTITIES = [
|
|
|
23596
23596
|
canDelete: true
|
|
23597
23597
|
}
|
|
23598
23598
|
},
|
|
23599
|
+
{
|
|
23600
|
+
name: "library",
|
|
23601
|
+
path: "/library",
|
|
23602
|
+
readScope: "collections:read",
|
|
23603
|
+
returns: "ShoppingList",
|
|
23604
|
+
canGet: true,
|
|
23605
|
+
listFlags: [],
|
|
23606
|
+
write: {
|
|
23607
|
+
scope: "collections:write",
|
|
23608
|
+
createSchema: createShoppingListInputSchema,
|
|
23609
|
+
createInput: "CreateShoppingListInput",
|
|
23610
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23611
|
+
updateInput: "UpdateShoppingListInput",
|
|
23612
|
+
canDelete: true
|
|
23613
|
+
}
|
|
23614
|
+
},
|
|
23615
|
+
{
|
|
23616
|
+
name: "watchlist",
|
|
23617
|
+
path: "/watchlist",
|
|
23618
|
+
readScope: "collections:read",
|
|
23619
|
+
returns: "ShoppingList",
|
|
23620
|
+
canGet: true,
|
|
23621
|
+
listFlags: [],
|
|
23622
|
+
write: {
|
|
23623
|
+
scope: "collections:write",
|
|
23624
|
+
createSchema: createShoppingListInputSchema,
|
|
23625
|
+
createInput: "CreateShoppingListInput",
|
|
23626
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23627
|
+
updateInput: "UpdateShoppingListInput",
|
|
23628
|
+
canDelete: true
|
|
23629
|
+
}
|
|
23630
|
+
},
|
|
23631
|
+
{
|
|
23632
|
+
name: "games",
|
|
23633
|
+
path: "/games",
|
|
23634
|
+
readScope: "collections:read",
|
|
23635
|
+
returns: "ShoppingList",
|
|
23636
|
+
canGet: true,
|
|
23637
|
+
listFlags: [],
|
|
23638
|
+
write: {
|
|
23639
|
+
scope: "collections:write",
|
|
23640
|
+
createSchema: createShoppingListInputSchema,
|
|
23641
|
+
createInput: "CreateShoppingListInput",
|
|
23642
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23643
|
+
updateInput: "UpdateShoppingListInput",
|
|
23644
|
+
canDelete: true
|
|
23645
|
+
}
|
|
23646
|
+
},
|
|
23647
|
+
{
|
|
23648
|
+
name: "cellar",
|
|
23649
|
+
path: "/cellar",
|
|
23650
|
+
readScope: "collections:read",
|
|
23651
|
+
returns: "ShoppingList",
|
|
23652
|
+
canGet: true,
|
|
23653
|
+
listFlags: [],
|
|
23654
|
+
write: {
|
|
23655
|
+
scope: "collections:write",
|
|
23656
|
+
createSchema: createShoppingListInputSchema,
|
|
23657
|
+
createInput: "CreateShoppingListInput",
|
|
23658
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23659
|
+
updateInput: "UpdateShoppingListInput",
|
|
23660
|
+
canDelete: true
|
|
23661
|
+
}
|
|
23662
|
+
},
|
|
23663
|
+
{
|
|
23664
|
+
name: "places",
|
|
23665
|
+
path: "/places",
|
|
23666
|
+
readScope: "collections:read",
|
|
23667
|
+
returns: "ShoppingList",
|
|
23668
|
+
canGet: true,
|
|
23669
|
+
listFlags: [],
|
|
23670
|
+
write: {
|
|
23671
|
+
scope: "collections:write",
|
|
23672
|
+
createSchema: createShoppingListInputSchema,
|
|
23673
|
+
createInput: "CreateShoppingListInput",
|
|
23674
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23675
|
+
updateInput: "UpdateShoppingListInput",
|
|
23676
|
+
canDelete: true
|
|
23677
|
+
}
|
|
23678
|
+
},
|
|
23679
|
+
{
|
|
23680
|
+
name: "music",
|
|
23681
|
+
path: "/music",
|
|
23682
|
+
readScope: "collections:read",
|
|
23683
|
+
returns: "ShoppingList",
|
|
23684
|
+
canGet: true,
|
|
23685
|
+
listFlags: [],
|
|
23686
|
+
write: {
|
|
23687
|
+
scope: "collections:write",
|
|
23688
|
+
createSchema: createShoppingListInputSchema,
|
|
23689
|
+
createInput: "CreateShoppingListInput",
|
|
23690
|
+
updateSchema: updateShoppingListInputSchema,
|
|
23691
|
+
updateInput: "UpdateShoppingListInput",
|
|
23692
|
+
canDelete: true
|
|
23693
|
+
}
|
|
23694
|
+
},
|
|
23599
23695
|
{
|
|
23600
23696
|
name: "inventory-items",
|
|
23601
23697
|
path: "/inventory-items",
|
|
@@ -23786,6 +23882,30 @@ var COMMAND_SPECS = [
|
|
|
23786
23882
|
scopes: ["settings:write"],
|
|
23787
23883
|
returns: "UserSettings"
|
|
23788
23884
|
},
|
|
23885
|
+
{
|
|
23886
|
+
path: ["presets", "list"],
|
|
23887
|
+
summary: "List the preset gallery (key \xB7 name \xB7 entity).",
|
|
23888
|
+
args: [],
|
|
23889
|
+
flags: [
|
|
23890
|
+
{
|
|
23891
|
+
name: "entity",
|
|
23892
|
+
type: "string",
|
|
23893
|
+
description: "Filter to one gallery facet (habit|list|library|watchlist|games|cellar|places|music|routine|area|project|recipe|contact|challenge|automation)."
|
|
23894
|
+
}
|
|
23895
|
+
],
|
|
23896
|
+
scopes: ["presets:read"],
|
|
23897
|
+
returns: "Preset",
|
|
23898
|
+
notes: "The catalog is code-defined; --entity filters it client-side."
|
|
23899
|
+
},
|
|
23900
|
+
{
|
|
23901
|
+
path: ["presets", "install"],
|
|
23902
|
+
summary: "Install a preset into the Space; prints the nodes it created.",
|
|
23903
|
+
args: [{ name: "key", required: true, description: "Preset catalog key (kebab-case)." }],
|
|
23904
|
+
flags: [],
|
|
23905
|
+
scopes: ["presets:install"],
|
|
23906
|
+
returns: "PresetInstallResult",
|
|
23907
|
+
notes: "Authors content as the caller, so it needs a key minted while logged in."
|
|
23908
|
+
},
|
|
23789
23909
|
{
|
|
23790
23910
|
path: ["invite", "create"],
|
|
23791
23911
|
summary: "Create a Space invite (email/link/guest).",
|
|
@@ -24249,6 +24369,27 @@ function idOf(row) {
|
|
|
24249
24369
|
}
|
|
24250
24370
|
return;
|
|
24251
24371
|
}
|
|
24372
|
+
function renderPresetList(data, mode) {
|
|
24373
|
+
if (!Array.isArray(data))
|
|
24374
|
+
return renderRecord(data, mode);
|
|
24375
|
+
if (data.length === 0)
|
|
24376
|
+
return paint(mode, "dim", "(no presets)");
|
|
24377
|
+
const lines = data.map((p) => {
|
|
24378
|
+
const key = paint(mode, "bold", p.key ?? "(no key)");
|
|
24379
|
+
const facet = p.entity ? paint(mode, "dim", ` [${p.entity}]`) : "";
|
|
24380
|
+
return ` ${key} ${p.name ?? ""}${facet}`;
|
|
24381
|
+
});
|
|
24382
|
+
return [`${data.length} preset(s):`, ...lines].join(`
|
|
24383
|
+
`);
|
|
24384
|
+
}
|
|
24385
|
+
function renderPresetInstall(data, mode) {
|
|
24386
|
+
const r = data;
|
|
24387
|
+
const header = `installed ${paint(mode, "bold", r.key ?? "(preset)")} \u2014 ${r.nodeCount ?? 0} node(s) created`;
|
|
24388
|
+
const facet = r.entity ? [` entity: ${r.entity}`] : [];
|
|
24389
|
+
const ids = (r.nodeIds ?? []).map((id) => ` ${paint(mode, "dim", id)}`);
|
|
24390
|
+
return [header, ...facet, ...ids].join(`
|
|
24391
|
+
`);
|
|
24392
|
+
}
|
|
24252
24393
|
function renderHelp(data, mode) {
|
|
24253
24394
|
const m = data;
|
|
24254
24395
|
const lines = [];
|
|
@@ -24492,6 +24633,20 @@ var HANDLERS = {
|
|
|
24492
24633
|
const body = parseInput(updateUserSettingsInputSchema, readDataFlag(flags));
|
|
24493
24634
|
return { data: await requireClient().patch("/settings", body), render: renderRecord };
|
|
24494
24635
|
},
|
|
24636
|
+
"presets list": async ({ flags, requireClient }) => {
|
|
24637
|
+
const entity = flagString(flags, "entity");
|
|
24638
|
+
if (entity !== undefined && !presetEntitySchema.safeParse(entity).success) {
|
|
24639
|
+
throw usageError(`--entity must be one of: ${presetEntitySchema.options.join(", ")}`);
|
|
24640
|
+
}
|
|
24641
|
+
const catalog2 = presetSchema.array().parse(await requireClient().get("/presets"));
|
|
24642
|
+
const presets2 = entity ? catalog2.filter((p) => p.entity === entity) : catalog2;
|
|
24643
|
+
return { data: presets2, render: renderPresetList };
|
|
24644
|
+
},
|
|
24645
|
+
"presets install": async ({ args, requireClient }) => {
|
|
24646
|
+
const key = requireArg(args, 0, "preset key");
|
|
24647
|
+
const result = presetInstallResultSchema.parse(await requireClient().post(`/presets/${encodeURIComponent(key)}/install`, undefined));
|
|
24648
|
+
return { data: result, render: renderPresetInstall };
|
|
24649
|
+
},
|
|
24495
24650
|
"invite create": async ({ flags, requireClient }) => {
|
|
24496
24651
|
const body = parseInput(createInviteInputSchema, { id: ulid3(), ...readDataFlag(flags) });
|
|
24497
24652
|
return { data: await requireClient().post("/invites", body), render: renderRecord };
|