@robbeverhelst/do 1.71.0 → 1.74.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 +55 -52
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -4987,6 +4987,7 @@ var automationRuns = pgTable("automation_runs", {
|
|
|
4987
4987
|
]);
|
|
4988
4988
|
// ../../packages/schema/src/db/challenges.ts
|
|
4989
4989
|
var challengeSource = pgEnum("challenge_source", ["self", "system"]);
|
|
4990
|
+
var challengeSubjectType = pgEnum("challenge_subject_type", ["habit", "area", "tag"]);
|
|
4990
4991
|
var challenges = pgTable("challenges", {
|
|
4991
4992
|
id: text("id").primaryKey(),
|
|
4992
4993
|
tenantId: text("tenant_id").notNull().references(() => tenants.id, { onDelete: "cascade" }),
|
|
@@ -4994,6 +4995,8 @@ var challenges = pgTable("challenges", {
|
|
|
4994
4995
|
description: text("description"),
|
|
4995
4996
|
source: challengeSource("source").notNull().default("self"),
|
|
4996
4997
|
metric: text("metric").notNull(),
|
|
4998
|
+
subjectType: challengeSubjectType("subject_type"),
|
|
4999
|
+
subjectId: text("subject_id"),
|
|
4997
5000
|
target: integer("target").notNull(),
|
|
4998
5001
|
startAt: timestamp("start_at", { withTimezone: true }).notNull(),
|
|
4999
5002
|
endAt: timestamp("end_at", { withTimezone: true }).notNull(),
|
|
@@ -5002,7 +5005,9 @@ var challenges = pgTable("challenges", {
|
|
|
5002
5005
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
5003
5006
|
}, (t) => [
|
|
5004
5007
|
index("challenges_tenant_idx").on(t.tenantId),
|
|
5005
|
-
index("challenges_tenant_window_idx").on(t.tenantId, t.startAt, t.endAt)
|
|
5008
|
+
index("challenges_tenant_window_idx").on(t.tenantId, t.startAt, t.endAt),
|
|
5009
|
+
index("challenges_tenant_subject_idx").on(t.tenantId, t.subjectType, t.subjectId),
|
|
5010
|
+
check("challenges_subject_pair_chk", sql`(${t.subjectType} IS NULL) = (${t.subjectId} IS NULL)`)
|
|
5006
5011
|
]);
|
|
5007
5012
|
var challengeParticipants = pgTable("challenge_participants", {
|
|
5008
5013
|
id: text("id").primaryKey(),
|
|
@@ -5015,13 +5020,6 @@ var challengeParticipants = pgTable("challenge_participants", {
|
|
|
5015
5020
|
index("challenge_participants_tenant_idx").on(t.tenantId),
|
|
5016
5021
|
index("challenge_participants_user_idx").on(t.tenantId, t.userId)
|
|
5017
5022
|
]);
|
|
5018
|
-
var leaderboardOptins = pgTable("leaderboard_optins", {
|
|
5019
|
-
id: text("id").primaryKey(),
|
|
5020
|
-
tenantId: text("tenant_id").notNull().references(() => tenants.id, { onDelete: "cascade" }),
|
|
5021
|
-
userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
|
|
5022
|
-
optedIn: boolean("opted_in").notNull().default(false),
|
|
5023
|
-
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
5024
|
-
}, (t) => [unique("leaderboard_optins_tenant_user_uniq").on(t.tenantId, t.userId)]);
|
|
5025
5023
|
// ../../packages/schema/src/db/gamification.ts
|
|
5026
5024
|
var gamificationProfiles = pgTable("gamification_profiles", {
|
|
5027
5025
|
id: text("id").primaryKey(),
|
|
@@ -19740,6 +19738,7 @@ var connectionStatusSchema = exports_external.enum(connectionStatus.enumValues);
|
|
|
19740
19738
|
var importantDateKindSchema = exports_external.enum(importantDateKind.enumValues);
|
|
19741
19739
|
var mealTypeSchema = exports_external.enum(mealType.enumValues);
|
|
19742
19740
|
var challengeSourceSchema = exports_external.enum(challengeSource.enumValues);
|
|
19741
|
+
var challengeSubjectTypeSchema = exports_external.enum(challengeSubjectType.enumValues);
|
|
19743
19742
|
var automationRunStatusSchema = exports_external.enum(automationRunStatus.enumValues);
|
|
19744
19743
|
var notificationTypeSchema = exports_external.enum(notificationType.enumValues);
|
|
19745
19744
|
// ../../packages/schema/src/contracts/barcode.ts
|
|
@@ -20108,6 +20107,33 @@ var projectDetailSchema = projectViewSchema.extend({
|
|
|
20108
20107
|
tasks: exports_external.array(taskViewSchema)
|
|
20109
20108
|
});
|
|
20110
20109
|
var attachTaskInputSchema = exports_external.object({ taskId: ulidSchema });
|
|
20110
|
+
// ../../packages/schema/src/contracts/notes.ts
|
|
20111
|
+
var noteSchema = createSelectSchema(notes);
|
|
20112
|
+
var createNoteInputSchema = createInsertSchema(notes, {
|
|
20113
|
+
id: ulidSchema,
|
|
20114
|
+
areaId: ulidSchema.nullish(),
|
|
20115
|
+
body: exports_external.string().nullish(),
|
|
20116
|
+
tags: exports_external.array(exports_external.string()).optional()
|
|
20117
|
+
}).omit({ tenantId: true }).extend({
|
|
20118
|
+
title: exports_external.string().min(1),
|
|
20119
|
+
parentId: ulidSchema.nullish()
|
|
20120
|
+
});
|
|
20121
|
+
var updateNoteInputSchema = createUpdateSchema(notes, {
|
|
20122
|
+
areaId: ulidSchema.nullish(),
|
|
20123
|
+
body: exports_external.string().nullish(),
|
|
20124
|
+
tags: exports_external.array(exports_external.string()).optional()
|
|
20125
|
+
}).omit({ id: true, tenantId: true }).extend({
|
|
20126
|
+
title: exports_external.string().min(1).optional(),
|
|
20127
|
+
parentId: ulidSchema.nullish()
|
|
20128
|
+
}).strict();
|
|
20129
|
+
var noteViewSchema = noteSchema.extend({
|
|
20130
|
+
title: exports_external.string(),
|
|
20131
|
+
parentId: ulidSchema.nullable(),
|
|
20132
|
+
createdAt: exports_external.coerce.date(),
|
|
20133
|
+
updatedAt: exports_external.coerce.date(),
|
|
20134
|
+
deletedAt: exports_external.coerce.date().nullable()
|
|
20135
|
+
});
|
|
20136
|
+
|
|
20111
20137
|
// ../../packages/schema/src/contracts/areas.ts
|
|
20112
20138
|
var areaSchema = createSelectSchema(areas);
|
|
20113
20139
|
var areaIconSchema = exports_external.string().trim().min(1).max(64);
|
|
@@ -20132,7 +20158,8 @@ var areaDetailSchema = areaViewSchema.extend({
|
|
|
20132
20158
|
projects: exports_external.array(projectViewSchema),
|
|
20133
20159
|
habits: exports_external.array(habitSummarySchema),
|
|
20134
20160
|
routines: exports_external.array(routineViewSchema),
|
|
20135
|
-
tasks: exports_external.array(taskViewSchema)
|
|
20161
|
+
tasks: exports_external.array(taskViewSchema),
|
|
20162
|
+
notes: exports_external.array(noteViewSchema)
|
|
20136
20163
|
});
|
|
20137
20164
|
// ../../packages/schema/src/contracts/modules.ts
|
|
20138
20165
|
var MODULE_KEYS = [
|
|
@@ -20797,32 +20824,6 @@ var mealPlanCookResultSchema = exports_external.object({
|
|
|
20797
20824
|
consumedCount: exports_external.number().int().min(0),
|
|
20798
20825
|
ingredients: exports_external.array(cookedIngredientSchema)
|
|
20799
20826
|
});
|
|
20800
|
-
// ../../packages/schema/src/contracts/notes.ts
|
|
20801
|
-
var noteSchema = createSelectSchema(notes);
|
|
20802
|
-
var createNoteInputSchema = createInsertSchema(notes, {
|
|
20803
|
-
id: ulidSchema,
|
|
20804
|
-
areaId: ulidSchema.nullish(),
|
|
20805
|
-
body: exports_external.string().nullish(),
|
|
20806
|
-
tags: exports_external.array(exports_external.string()).optional()
|
|
20807
|
-
}).omit({ tenantId: true }).extend({
|
|
20808
|
-
title: exports_external.string().min(1),
|
|
20809
|
-
parentId: ulidSchema.nullish()
|
|
20810
|
-
});
|
|
20811
|
-
var updateNoteInputSchema = createUpdateSchema(notes, {
|
|
20812
|
-
areaId: ulidSchema.nullish(),
|
|
20813
|
-
body: exports_external.string().nullish(),
|
|
20814
|
-
tags: exports_external.array(exports_external.string()).optional()
|
|
20815
|
-
}).omit({ id: true, tenantId: true }).extend({
|
|
20816
|
-
title: exports_external.string().min(1).optional(),
|
|
20817
|
-
parentId: ulidSchema.nullish()
|
|
20818
|
-
}).strict();
|
|
20819
|
-
var noteViewSchema = noteSchema.extend({
|
|
20820
|
-
title: exports_external.string(),
|
|
20821
|
-
parentId: ulidSchema.nullable(),
|
|
20822
|
-
createdAt: exports_external.coerce.date(),
|
|
20823
|
-
updatedAt: exports_external.coerce.date(),
|
|
20824
|
-
deletedAt: exports_external.coerce.date().nullable()
|
|
20825
|
-
});
|
|
20826
20827
|
// ../../packages/schema/src/contracts/node-links.ts
|
|
20827
20828
|
var nodeLinkSchema = createSelectSchema(nodeLinks);
|
|
20828
20829
|
var nodeLinkKindSchema = exports_external.enum(["ref", "embed"]);
|
|
@@ -21741,10 +21742,15 @@ var createChallengeInputSchema = createInsertSchema(challenges, {
|
|
|
21741
21742
|
metric: exports_external.string().min(1),
|
|
21742
21743
|
target: exports_external.number().int().positive(),
|
|
21743
21744
|
startAt: exports_external.coerce.date(),
|
|
21744
|
-
endAt: exports_external.coerce.date()
|
|
21745
|
+
endAt: exports_external.coerce.date(),
|
|
21746
|
+
subjectType: challengeSubjectTypeSchema.nullish(),
|
|
21747
|
+
subjectId: exports_external.string().min(1).nullish()
|
|
21745
21748
|
}).omit({ tenantId: true, source: true, createdBy: true, createdAt: true, updatedAt: true }).strict().refine((v) => v.endAt > v.startAt, {
|
|
21746
21749
|
message: "endAt must be after startAt",
|
|
21747
21750
|
path: ["endAt"]
|
|
21751
|
+
}).refine((v) => v.subjectType == null === (v.subjectId == null), {
|
|
21752
|
+
message: "subjectType and subjectId must be set together",
|
|
21753
|
+
path: ["subjectId"]
|
|
21748
21754
|
});
|
|
21749
21755
|
var joinChallengeInputSchema = exports_external.object({ id: ulidSchema }).strict();
|
|
21750
21756
|
var challengeViewSchema = challengeSchema.extend({
|
|
@@ -21752,7 +21758,8 @@ var challengeViewSchema = challengeSchema.extend({
|
|
|
21752
21758
|
joined: exports_external.boolean(),
|
|
21753
21759
|
progress: exports_external.number().int().nonnegative(),
|
|
21754
21760
|
status: challengeStatusSchema,
|
|
21755
|
-
completed: exports_external.boolean()
|
|
21761
|
+
completed: exports_external.boolean(),
|
|
21762
|
+
subjectTitle: exports_external.string().nullable()
|
|
21756
21763
|
});
|
|
21757
21764
|
var challengeLeaderboardEntrySchema = exports_external.object({
|
|
21758
21765
|
userId: ulidSchema,
|
|
@@ -21761,21 +21768,17 @@ var challengeLeaderboardEntrySchema = exports_external.object({
|
|
|
21761
21768
|
rank: exports_external.number().int().positive(),
|
|
21762
21769
|
completed: exports_external.boolean()
|
|
21763
21770
|
});
|
|
21764
|
-
var
|
|
21765
|
-
|
|
21766
|
-
|
|
21767
|
-
|
|
21768
|
-
|
|
21769
|
-
|
|
21770
|
-
|
|
21771
|
-
email: exports_external.string(),
|
|
21772
|
-
score: exports_external.number().int().nonnegative(),
|
|
21773
|
-
rank: exports_external.number().int().positive()
|
|
21771
|
+
var selfComparisonMetricSchema = exports_external.object({
|
|
21772
|
+
metric: exports_external.string(),
|
|
21773
|
+
thisWeek: exports_external.number().int().nonnegative(),
|
|
21774
|
+
fourWeekAverage: exports_external.number().nonnegative(),
|
|
21775
|
+
deltaPct: exports_external.number().nullable(),
|
|
21776
|
+
personalBest: exports_external.number().int().nonnegative(),
|
|
21777
|
+
isPersonalBest: exports_external.boolean()
|
|
21774
21778
|
});
|
|
21775
|
-
var
|
|
21776
|
-
|
|
21777
|
-
|
|
21778
|
-
entries: exports_external.array(leaderboardEntrySchema)
|
|
21779
|
+
var selfComparisonSchema = exports_external.object({
|
|
21780
|
+
weekStart: exports_external.coerce.date(),
|
|
21781
|
+
metrics: exports_external.array(selfComparisonMetricSchema)
|
|
21779
21782
|
});
|
|
21780
21783
|
// ../../packages/schema/src/contracts/gamification.ts
|
|
21781
21784
|
var gamificationProfileSchema = createSelectSchema(gamificationProfiles, {
|
|
@@ -24367,7 +24370,7 @@ function parseCapture2(input, now) {
|
|
|
24367
24370
|
|
|
24368
24371
|
// src/meta.ts
|
|
24369
24372
|
var CLI_NAME = "do";
|
|
24370
|
-
var VERSION = "1.
|
|
24373
|
+
var VERSION = "1.74.0";
|
|
24371
24374
|
var API_PREFIX = "/api/v1";
|
|
24372
24375
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
24373
24376
|
|