@robbeverhelst/do 1.291.0 → 1.293.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.
Files changed (2) hide show
  1. package/dist/do.js +60 -3
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -3976,7 +3976,9 @@ var notificationType = pgEnum("notification_type", [
3976
3976
  "bank_link",
3977
3977
  "import_failed",
3978
3978
  "animal_ask",
3979
- "life_block"
3979
+ "life_block",
3980
+ "animal_alert",
3981
+ "health_checkin"
3980
3982
  ]);
3981
3983
  var notificationDomain = pgEnum("notification_domain", [
3982
3984
  "task",
@@ -4094,6 +4096,37 @@ var notificationReceipts = pgTable("notification_receipts", {
4094
4096
  undoneAt: timestamp("undone_at", { withTimezone: true }),
4095
4097
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
4096
4098
  }, (t) => [unique("notification_receipts_action_uniq").on(t.notificationId, t.actionIndex)]);
4099
+ var telegramLinks = pgTable("telegram_links", {
4100
+ id: text("id").primaryKey(),
4101
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
4102
+ userId: text("user_id").notNull().references(() => users.id),
4103
+ code: text("code"),
4104
+ codeExpiresAt: timestamp("code_expires_at", { withTimezone: true }),
4105
+ chatId: text("chat_id"),
4106
+ threadId: integer("thread_id"),
4107
+ chatTitle: text("chat_title"),
4108
+ telegramUserId: text("telegram_user_id"),
4109
+ linkedAt: timestamp("linked_at", { withTimezone: true }),
4110
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow()
4111
+ }, (t) => [
4112
+ unique("telegram_links_member_uniq").on(t.tenantId, t.userId),
4113
+ unique("telegram_links_code_uniq").on(t.code)
4114
+ ]);
4115
+ var telegramMessages = pgTable("telegram_messages", {
4116
+ id: text("id").primaryKey(),
4117
+ tenantId: text("tenant_id").notNull().references(() => tenants.id),
4118
+ userId: text("user_id").notNull().references(() => users.id),
4119
+ notificationId: text("notification_id").notNull().references(() => notifications.id, { onDelete: "cascade" }),
4120
+ kind: text("kind").$type().notNull(),
4121
+ chatId: text("chat_id").notNull(),
4122
+ messageId: bigint("message_id", { mode: "number" }),
4123
+ buttons: jsonb("buttons").$type().notNull().default([]),
4124
+ receiptId: text("receipt_id"),
4125
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
4126
+ editedAt: timestamp("edited_at", { withTimezone: true })
4127
+ }, (t) => [
4128
+ uniqueIndex("telegram_messages_notification_uniq").on(t.notificationId).where(sql`${t.kind} <> 'receipt'`)
4129
+ ]);
4097
4130
 
4098
4131
  // ../../packages/schema/src/db/foods.ts
4099
4132
  var foodSource = pgEnum("food_source", ["nevo", "usda", "off", "nubel"]);
@@ -24683,7 +24716,13 @@ var moneyTransactionViewSchema = moneyTransactionSchema.omit({ dedupHash: true }
24683
24716
  title: string2(),
24684
24717
  type: string2()
24685
24718
  })).default([]),
24686
- recurring: string2().nullable().default(null)
24719
+ recurring: string2().nullable().default(null),
24720
+ contact: object({ id: ulidSchema, name: string2(), payments: number2().int().nonnegative() }).nullable().default(null),
24721
+ split: object({
24722
+ parts: number2().int().positive(),
24723
+ even: boolean3(),
24724
+ owed: array(object({ name: string2(), amount: amount3 }))
24725
+ }).nullable().default(null)
24687
24726
  });
24688
24727
  var moneyTransactionsQuerySchema = object({
24689
24728
  accountId: ulidSchema.optional(),
@@ -24776,6 +24815,11 @@ var moneyRuleProposalSchema = object({
24776
24815
  createdFromTransactionId: ulidSchema,
24777
24816
  count: number2().int().positive()
24778
24817
  });
24818
+ var moneyRuleSuggestionSchema = moneyRuleProposalSchema.extend({
24819
+ payee: string2(),
24820
+ categoryName: string2(),
24821
+ goal: object({ nodeId: ulidSchema, title: string2() }).nullable()
24822
+ });
24779
24823
  var moneySortReceiptSchema = object({
24780
24824
  items: array(object({
24781
24825
  id: ulidSchema,
@@ -28763,7 +28807,7 @@ function parseCapture2(input, now) {
28763
28807
 
28764
28808
  // src/meta.ts
28765
28809
  var CLI_NAME = "do";
28766
- var VERSION = "1.291.0";
28810
+ var VERSION = "1.293.0";
28767
28811
  var API_PREFIX = "/api/v1";
28768
28812
  var DEFAULT_API_URL = "http://localhost:3001";
28769
28813
 
@@ -33450,6 +33494,15 @@ var COMMAND_SPECS = [
33450
33494
  returns: "MoneyRuleView[]",
33451
33495
  notes: "GET /api/v1/money/rules."
33452
33496
  },
33497
+ {
33498
+ path: ["money", "rule-suggestions"],
33499
+ summary: "The rules worth making now: payees sorted the same way by hand, with their goal.",
33500
+ args: [],
33501
+ flags: [],
33502
+ scopes: ["finance:read"],
33503
+ returns: "MoneyRuleSuggestion[]",
33504
+ notes: "GET /api/v1/money/rules/suggestions. Accept one with `do money rule-add --data` (its name, conditions and actions; add actions.link to its goal to count the next ones there)."
33505
+ },
33453
33506
  {
33454
33507
  path: ["money", "rule"],
33455
33508
  summary: "Show one sorting rule.",
@@ -38680,6 +38733,10 @@ var HANDLERS = {
38680
38733
  data: await requireClient().get("/money/rules"),
38681
38734
  render: renderList
38682
38735
  }),
38736
+ "money rule-suggestions": async ({ requireClient }) => ({
38737
+ data: await requireClient().get("/money/rules/suggestions"),
38738
+ render: renderList
38739
+ }),
38683
38740
  "money rule": async ({ args, requireClient }) => {
38684
38741
  const id = requireArg(args, 0, "rule id");
38685
38742
  return { data: await requireClient().get(`/money/rules/${id}`), render: renderRecord };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.291.0",
3
+ "version": "1.293.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "homepage": "https://github.com/robbeverhelst/do/tree/main/apps/cli",