@robbeverhelst/do 1.54.0 → 1.56.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 +54 -3
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -4617,11 +4617,26 @@ var notes = pgTable("notes", {
|
|
|
4617
4617
|
id: text("id").primaryKey().references(() => nodes.id),
|
|
4618
4618
|
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4619
4619
|
body: text("body"),
|
|
4620
|
+
areaId: text("area_id").references(() => areas.id),
|
|
4620
4621
|
isPinned: boolean("is_pinned").notNull().default(false),
|
|
4621
4622
|
isArchived: boolean("is_archived").notNull().default(false),
|
|
4622
4623
|
tags: text("tags").array().notNull().default([])
|
|
4623
4624
|
}, (t) => [
|
|
4624
|
-
index("notes_tenant_idx").on(t.tenantId)
|
|
4625
|
+
index("notes_tenant_idx").on(t.tenantId),
|
|
4626
|
+
index("notes_tenant_area_idx").on(t.tenantId, t.areaId)
|
|
4627
|
+
]);
|
|
4628
|
+
// ../../packages/schema/src/db/node-links.ts
|
|
4629
|
+
var nodeLinks = pgTable("node_links", {
|
|
4630
|
+
id: text("id").primaryKey(),
|
|
4631
|
+
tenantId: text("tenant_id").notNull().references(() => tenants.id),
|
|
4632
|
+
sourceNodeId: text("source_node_id").notNull().references(() => nodes.id),
|
|
4633
|
+
targetNodeId: text("target_node_id").notNull().references(() => nodes.id),
|
|
4634
|
+
kind: text("kind").notNull().default("ref"),
|
|
4635
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
|
|
4636
|
+
}, (t) => [
|
|
4637
|
+
index("node_links_tenant_source_idx").on(t.tenantId, t.sourceNodeId),
|
|
4638
|
+
index("node_links_tenant_target_idx").on(t.tenantId, t.targetNodeId),
|
|
4639
|
+
unique("node_links_edge_unique").on(t.tenantId, t.sourceNodeId, t.targetNodeId, t.kind)
|
|
4625
4640
|
]);
|
|
4626
4641
|
// ../../packages/schema/src/db/contacts.ts
|
|
4627
4642
|
var importantDateKind = pgEnum("important_date_kind", [
|
|
@@ -20676,6 +20691,7 @@ var createNoteInputSchema = exports_external.object({
|
|
|
20676
20691
|
id: ulidSchema,
|
|
20677
20692
|
title: exports_external.string().min(1),
|
|
20678
20693
|
parentId: ulidSchema.nullish(),
|
|
20694
|
+
areaId: ulidSchema.nullish(),
|
|
20679
20695
|
body: exports_external.string().nullish(),
|
|
20680
20696
|
isPinned: exports_external.boolean().optional(),
|
|
20681
20697
|
isArchived: exports_external.boolean().optional(),
|
|
@@ -20684,6 +20700,7 @@ var createNoteInputSchema = exports_external.object({
|
|
|
20684
20700
|
var updateNoteInputSchema = exports_external.object({
|
|
20685
20701
|
title: exports_external.string().min(1).optional(),
|
|
20686
20702
|
parentId: ulidSchema.nullish(),
|
|
20703
|
+
areaId: ulidSchema.nullish(),
|
|
20687
20704
|
body: exports_external.string().nullish(),
|
|
20688
20705
|
isPinned: exports_external.boolean().optional(),
|
|
20689
20706
|
isArchived: exports_external.boolean().optional(),
|
|
@@ -20696,6 +20713,20 @@ var noteViewSchema = noteSchema.extend({
|
|
|
20696
20713
|
updatedAt: exports_external.coerce.date(),
|
|
20697
20714
|
deletedAt: exports_external.coerce.date().nullable()
|
|
20698
20715
|
});
|
|
20716
|
+
// ../../packages/schema/src/contracts/node-links.ts
|
|
20717
|
+
var nodeLinkSchema = createSelectSchema(nodeLinks);
|
|
20718
|
+
var nodeLinkKindSchema = exports_external.enum(["ref", "embed"]);
|
|
20719
|
+
var createNodeLinkInputSchema = exports_external.object({
|
|
20720
|
+
sourceNodeId: ulidSchema,
|
|
20721
|
+
targetNodeId: ulidSchema,
|
|
20722
|
+
kind: nodeLinkKindSchema.default("ref")
|
|
20723
|
+
});
|
|
20724
|
+
var backlinkSchema = exports_external.object({
|
|
20725
|
+
sourceNodeId: ulidSchema,
|
|
20726
|
+
title: exports_external.string(),
|
|
20727
|
+
type: exports_external.string(),
|
|
20728
|
+
kind: exports_external.string()
|
|
20729
|
+
});
|
|
20699
20730
|
// ../../packages/schema/src/contracts/contacts.ts
|
|
20700
20731
|
var importantDateKindSchema = exports_external.enum(importantDateKind.enumValues);
|
|
20701
20732
|
var contactSchema = createSelectSchema(contacts, {
|
|
@@ -23724,7 +23755,7 @@ function parseCapture2(input) {
|
|
|
23724
23755
|
|
|
23725
23756
|
// src/meta.ts
|
|
23726
23757
|
var CLI_NAME = "do";
|
|
23727
|
-
var VERSION = "1.
|
|
23758
|
+
var VERSION = "1.56.0";
|
|
23728
23759
|
var API_PREFIX = "/api/v1";
|
|
23729
23760
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
23730
23761
|
|
|
@@ -23972,7 +24003,11 @@ var ENTITIES = [
|
|
|
23972
24003
|
readScope: "notes:read",
|
|
23973
24004
|
returns: "Note",
|
|
23974
24005
|
canGet: true,
|
|
23975
|
-
listFlags: [
|
|
24006
|
+
listFlags: [
|
|
24007
|
+
{ name: "q", description: "full-text search over the title and body", query: "q" },
|
|
24008
|
+
{ name: "area", description: "filter to notes filed under this area id", query: "areaId" },
|
|
24009
|
+
{ name: "tag", description: "filter to notes carrying this tag", query: "tag" }
|
|
24010
|
+
],
|
|
23976
24011
|
write: {
|
|
23977
24012
|
scope: "notes:write",
|
|
23978
24013
|
createSchema: createNoteInputSchema,
|
|
@@ -24283,6 +24318,15 @@ var COMMAND_SPECS = [
|
|
|
24283
24318
|
scopes: ["habits:write"],
|
|
24284
24319
|
returns: "HabitSummary"
|
|
24285
24320
|
},
|
|
24321
|
+
{
|
|
24322
|
+
path: ["notes", "backlinks"],
|
|
24323
|
+
summary: "List the notes/entities whose body [[wikilinks]] reference a note.",
|
|
24324
|
+
args: [{ name: "id", required: true, description: "Note (node) ULID." }],
|
|
24325
|
+
flags: [],
|
|
24326
|
+
scopes: ["notes:read"],
|
|
24327
|
+
returns: "Backlink",
|
|
24328
|
+
notes: "The reverse of the links a note's body declares; cross-entity."
|
|
24329
|
+
},
|
|
24286
24330
|
{
|
|
24287
24331
|
path: ["settings", "get"],
|
|
24288
24332
|
summary: "Show the caller's settings for the Space.",
|
|
@@ -25113,6 +25157,13 @@ var HANDLERS = {
|
|
|
25113
25157
|
render: renderToday
|
|
25114
25158
|
};
|
|
25115
25159
|
},
|
|
25160
|
+
"notes backlinks": async ({ args, requireClient }) => {
|
|
25161
|
+
const id = requireArg(args, 0, "note id");
|
|
25162
|
+
return {
|
|
25163
|
+
data: await requireClient().get(`/notes/${id}/backlinks`),
|
|
25164
|
+
render: renderList
|
|
25165
|
+
};
|
|
25166
|
+
},
|
|
25116
25167
|
"task done": async ({ args, requireClient }) => {
|
|
25117
25168
|
const id = requireArg(args, 0, "task id");
|
|
25118
25169
|
const client = requireClient();
|