@robbeverhelst/do 1.293.0 → 1.294.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 +116 -14
- package/package.json +1 -1
package/dist/do.js
CHANGED
|
@@ -4750,6 +4750,7 @@ var moneyTransactions = pgTable("money_transactions", {
|
|
|
4750
4750
|
onDelete: "set null"
|
|
4751
4751
|
}),
|
|
4752
4752
|
note: text("note"),
|
|
4753
|
+
orderItem: text("order_item"),
|
|
4753
4754
|
businessShare: smallint("business_share").notNull().default(0),
|
|
4754
4755
|
businessStatus: moneyBusinessStatus("business_status").notNull().default("none"),
|
|
4755
4756
|
businessNote: text("business_note"),
|
|
@@ -21324,7 +21325,11 @@ var houseAssetLinkSchema = object({
|
|
|
21324
21325
|
title: string2(),
|
|
21325
21326
|
type: string2(),
|
|
21326
21327
|
kind: string2(),
|
|
21327
|
-
direction: _enum2(["in", "out"])
|
|
21328
|
+
direction: _enum2(["in", "out"]),
|
|
21329
|
+
label: string2().nullable().default(null),
|
|
21330
|
+
context: string2().nullable().default(null),
|
|
21331
|
+
at: exports_coerce.date().nullable().default(null),
|
|
21332
|
+
timed: boolean3().default(false)
|
|
21328
21333
|
});
|
|
21329
21334
|
var houseAssetSchema = object({
|
|
21330
21335
|
item: collectionItemDetailSchema,
|
|
@@ -21657,13 +21662,30 @@ var postRunSchema = object({
|
|
|
21657
21662
|
});
|
|
21658
21663
|
var POST_RECEIPT_ABOUT_VALUES = ["red_flags", "saved", "vet_visit"];
|
|
21659
21664
|
var POST_RECEIPT_SOURCE_MAX = 80;
|
|
21660
|
-
var
|
|
21665
|
+
var postNodeReceiptInputSchema = object({
|
|
21661
21666
|
nodeId: ulidSchema,
|
|
21662
21667
|
parts: array(ulidSchema).min(1).max(10).optional(),
|
|
21663
21668
|
about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional(),
|
|
21664
21669
|
source: string2().trim().min(1).max(POST_RECEIPT_SOURCE_MAX).optional(),
|
|
21665
21670
|
personNotes: array(ulidSchema).min(1).max(10).optional()
|
|
21666
21671
|
}).strict();
|
|
21672
|
+
var POST_MONEY_RECEIPT_ABOUT_VALUES = ["ask", "bill"];
|
|
21673
|
+
var webUrlSchema = string2().url().max(2000).refine((url) => /^https?:\/\//i.test(url), "must be an http(s) link");
|
|
21674
|
+
var postMoneyReceiptInputSchema = object({
|
|
21675
|
+
transactionId: ulidSchema,
|
|
21676
|
+
about: _enum2(POST_MONEY_RECEIPT_ABOUT_VALUES),
|
|
21677
|
+
odoo: object({
|
|
21678
|
+
openUrl: webUrlSchema,
|
|
21679
|
+
account: string2().trim().min(1).max(120).nullish()
|
|
21680
|
+
}).strict().optional(),
|
|
21681
|
+
undo: object({
|
|
21682
|
+
items: array(object({ id: ulidSchema }).passthrough()).min(1).max(200)
|
|
21683
|
+
}).optional()
|
|
21684
|
+
}).strict();
|
|
21685
|
+
var postReceiptInputSchema = union([
|
|
21686
|
+
postNodeReceiptInputSchema,
|
|
21687
|
+
postMoneyReceiptInputSchema
|
|
21688
|
+
]);
|
|
21667
21689
|
var postReceiptPartSchema = object({
|
|
21668
21690
|
id: string2(),
|
|
21669
21691
|
type: string2(),
|
|
@@ -21674,8 +21696,10 @@ var postReceiptSchema = object({
|
|
|
21674
21696
|
nodeType: string2(),
|
|
21675
21697
|
parts: array(string2()).optional(),
|
|
21676
21698
|
partNodes: array(postReceiptPartSchema).optional(),
|
|
21677
|
-
about: _enum2(POST_RECEIPT_ABOUT_VALUES).optional(),
|
|
21678
|
-
source: string2().optional()
|
|
21699
|
+
about: _enum2([...POST_RECEIPT_ABOUT_VALUES, ...POST_MONEY_RECEIPT_ABOUT_VALUES]).optional(),
|
|
21700
|
+
source: string2().optional(),
|
|
21701
|
+
odoo: object({ openUrl: string2(), account: string2().nullish() }).optional(),
|
|
21702
|
+
undo: object({ items: array(object({ id: string2() }).passthrough()) }).optional()
|
|
21679
21703
|
});
|
|
21680
21704
|
var POST_TITLE_MAX = 200;
|
|
21681
21705
|
var postTitleSchema = string2().trim().min(1).max(POST_TITLE_MAX);
|
|
@@ -23641,6 +23665,7 @@ var createMealLogInputSchema = object({
|
|
|
23641
23665
|
photoFileId: ulidSchema.nullish(),
|
|
23642
23666
|
items: array(mealLogItemInputSchema).min(1).max(40)
|
|
23643
23667
|
}).strict();
|
|
23668
|
+
var logUsualMealInputSchema = object({ mealType: mealLogTypeSchema }).strict();
|
|
23644
23669
|
var correctMealLogInputSchema = object({
|
|
23645
23670
|
title: string2().trim().min(1).max(200).optional(),
|
|
23646
23671
|
eatenAt: exports_coerce.date().optional(),
|
|
@@ -23846,7 +23871,10 @@ var FOOD_PATTERN_QUESTION_VALUES = [
|
|
|
23846
23871
|
"flagged_meal_symptom",
|
|
23847
23872
|
"coffee_sleep",
|
|
23848
23873
|
"kcal_rating",
|
|
23849
|
-
"weekly_kcal_weight"
|
|
23874
|
+
"weekly_kcal_weight",
|
|
23875
|
+
"fried_next_day",
|
|
23876
|
+
"skipped_breakfast_lunch",
|
|
23877
|
+
"big_dinner_sleep"
|
|
23850
23878
|
];
|
|
23851
23879
|
var foodPatternQuestionSchema = _enum2(FOOD_PATTERN_QUESTION_VALUES);
|
|
23852
23880
|
var foodPatternSideSchema = object({
|
|
@@ -23861,6 +23889,12 @@ var foodPatternWeekSchema = object({
|
|
|
23861
23889
|
averageKcal: number2().nullable(),
|
|
23862
23890
|
weightChange: number2().nullable()
|
|
23863
23891
|
});
|
|
23892
|
+
var foodPatternDaySchema = object({
|
|
23893
|
+
day: civilDate,
|
|
23894
|
+
with: boolean3(),
|
|
23895
|
+
hit: boolean3().nullable(),
|
|
23896
|
+
value: number2().nullable()
|
|
23897
|
+
});
|
|
23864
23898
|
var foodPatternAnswerSchema = object({
|
|
23865
23899
|
question: foodPatternQuestionSchema,
|
|
23866
23900
|
title: string2(),
|
|
@@ -23874,7 +23908,9 @@ var foodPatternAnswerSchema = object({
|
|
|
23874
23908
|
neededDays: number2().int().nonnegative(),
|
|
23875
23909
|
progress: object({ have: number2().int(), need: number2().int() }),
|
|
23876
23910
|
examples: array(string2()),
|
|
23877
|
-
weeks: array(foodPatternWeekSchema)
|
|
23911
|
+
weeks: array(foodPatternWeekSchema),
|
|
23912
|
+
unit: _enum2(["days", "nights", "weeks"]),
|
|
23913
|
+
behind: array(foodPatternDaySchema)
|
|
23878
23914
|
});
|
|
23879
23915
|
var FOOD_TRIAL_NOTE_MAX = 1000;
|
|
23880
23916
|
var proposeFoodTrialInputSchema = object({
|
|
@@ -24694,7 +24730,8 @@ var sortMoneyTransactionInputSchema = object({
|
|
|
24694
24730
|
businessShare: moneyBusinessShareSchema.optional(),
|
|
24695
24731
|
businessStatus: moneySortBusinessStatusSchema.optional(),
|
|
24696
24732
|
businessNote: moneyBusinessNoteSchema.nullish(),
|
|
24697
|
-
taxTag: moneyTaxTagSchema.nullish()
|
|
24733
|
+
taxTag: moneyTaxTagSchema.nullish(),
|
|
24734
|
+
orderItem: string2().trim().min(1).max(200).nullish()
|
|
24698
24735
|
}).strict();
|
|
24699
24736
|
var createMoneyRuleInputSchema = object({
|
|
24700
24737
|
id: ulidSchema,
|
|
@@ -25724,8 +25761,9 @@ var runAchievementsSchema = object({
|
|
|
25724
25761
|
source: _enum2(["steam", "xbox", "psn", "manual"]).default("manual"),
|
|
25725
25762
|
total: number2().int().min(0).max(5000).nullish(),
|
|
25726
25763
|
enabled: boolean3().default(true),
|
|
25727
|
-
unlocked: array(object({ name, on: isoDate.nullish(), hint: shortText.nullish() }).strict()).max(5000),
|
|
25728
|
-
locked: array(object({ name, hint: shortText.nullish() }).strict()).max(5000).optional()
|
|
25764
|
+
unlocked: array(object({ name, on: isoDate.nullish(), hint: shortText.nullish(), key: ref.nullish() }).strict()).max(5000),
|
|
25765
|
+
locked: array(object({ name, hint: shortText.nullish(), key: ref.nullish() }).strict()).max(5000).optional(),
|
|
25766
|
+
syncedAt: string2().datetime({ offset: true }).nullish()
|
|
25729
25767
|
}).strict();
|
|
25730
25768
|
var runRareFindsSchema = object({
|
|
25731
25769
|
place: shortText.nullish(),
|
|
@@ -25944,6 +25982,39 @@ var runsQuerySchema = object({
|
|
|
25944
25982
|
theme: runThemeSchema.optional()
|
|
25945
25983
|
}).strict();
|
|
25946
25984
|
|
|
25985
|
+
// ../../packages/schema/src/contracts/runs-steam.ts
|
|
25986
|
+
var steamIdSchema = string2().trim().regex(/^7656119\d{10}$/, "must be a SteamID64 (17 digits, starting 7656119)");
|
|
25987
|
+
var steamApiKeySchema = string2().trim().regex(/^[0-9A-Fa-f]{32}$/, "must be a Steam Web API key (32 letters and digits)");
|
|
25988
|
+
var steamAccountInputSchema = object({ steamId: steamIdSchema, apiKey: steamApiKeySchema }).strict();
|
|
25989
|
+
var steamAccountStatusSchema = object({
|
|
25990
|
+
connected: boolean3(),
|
|
25991
|
+
games: number2().int().nonnegative(),
|
|
25992
|
+
lastSyncedAt: string2().nullable()
|
|
25993
|
+
});
|
|
25994
|
+
var steamSyncInputSchema = object({ gameId: string2().trim().min(1).max(64).optional() }).strict();
|
|
25995
|
+
var steamSyncErrorValues = [
|
|
25996
|
+
"unauthorized",
|
|
25997
|
+
"private",
|
|
25998
|
+
"no_stats",
|
|
25999
|
+
"unavailable",
|
|
26000
|
+
"bad_response"
|
|
26001
|
+
];
|
|
26002
|
+
var steamSyncErrorSchema = _enum2(steamSyncErrorValues);
|
|
26003
|
+
var steamGameSyncSchema = object({
|
|
26004
|
+
gameId: string2(),
|
|
26005
|
+
gameTitle: string2(),
|
|
26006
|
+
appId: number2().int(),
|
|
26007
|
+
outcome: _enum2(["ok", "failed"]),
|
|
26008
|
+
runs: number2().int().nonnegative(),
|
|
26009
|
+
unlocked: number2().int().nonnegative(),
|
|
26010
|
+
total: number2().int().nonnegative(),
|
|
26011
|
+
error: steamSyncErrorSchema.nullable()
|
|
26012
|
+
});
|
|
26013
|
+
var steamSyncResultSchema = object({
|
|
26014
|
+
syncedAt: string2(),
|
|
26015
|
+
games: array(steamGameSyncSchema)
|
|
26016
|
+
});
|
|
26017
|
+
|
|
25947
26018
|
// ../../packages/schema/src/contracts/animals.ts
|
|
25948
26019
|
var animalFormSchema = _enum2(animalForm.enumValues);
|
|
25949
26020
|
var animalStatusSchema = _enum2(animalStatus.enumValues);
|
|
@@ -26436,7 +26507,7 @@ var animalsOverviewSchema = object({
|
|
|
26436
26507
|
supplies: array(animalSupplySchema),
|
|
26437
26508
|
habits: array(animalHabitSchema)
|
|
26438
26509
|
}),
|
|
26439
|
-
comingUp: array(keyDateViewSchema),
|
|
26510
|
+
comingUp: array(keyDateViewSchema.extend({ vet: string2().nullable() })),
|
|
26440
26511
|
periods: array(periodViewSchema)
|
|
26441
26512
|
});
|
|
26442
26513
|
var animalHolidayModeSchema = object({
|
|
@@ -26617,7 +26688,8 @@ var moneyTaxEvidenceSchema = object({
|
|
|
26617
26688
|
}))
|
|
26618
26689
|
});
|
|
26619
26690
|
var moneyOdooPushInputSchema = object({
|
|
26620
|
-
note: string2().trim().min(1).max(500).optional()
|
|
26691
|
+
note: string2().trim().min(1).max(500).optional(),
|
|
26692
|
+
account: string2().trim().min(1).max(120).optional()
|
|
26621
26693
|
}).strict();
|
|
26622
26694
|
var moneyOdooReceiptSchema = object({
|
|
26623
26695
|
transactionId: ulidSchema,
|
|
@@ -26627,7 +26699,8 @@ var moneyOdooReceiptSchema = object({
|
|
|
26627
26699
|
amount: string2(),
|
|
26628
26700
|
share: moneyBusinessShareSchema,
|
|
26629
26701
|
attachments: number2().int().nonnegative(),
|
|
26630
|
-
alreadyThere: boolean3()
|
|
26702
|
+
alreadyThere: boolean3(),
|
|
26703
|
+
account: string2().nullable().default(null)
|
|
26631
26704
|
});
|
|
26632
26705
|
var moneyOdooUndoResultSchema = object({
|
|
26633
26706
|
transactionId: ulidSchema,
|
|
@@ -28332,7 +28405,8 @@ var gameFacetSchema = object({
|
|
|
28332
28405
|
platform: string2().min(1).max(120).nullish(),
|
|
28333
28406
|
coverUrl,
|
|
28334
28407
|
coverSources: coverSourcesSchema.nullish(),
|
|
28335
|
-
completion: number2().int().min(0).max(100).nullish()
|
|
28408
|
+
completion: number2().int().min(0).max(100).nullish(),
|
|
28409
|
+
steamAppId: number2().int().positive().max(99999999).nullish()
|
|
28336
28410
|
}).strict();
|
|
28337
28411
|
var musicFacetSchema = object({
|
|
28338
28412
|
artist: string2().min(1).max(200).nullish(),
|
|
@@ -28807,7 +28881,7 @@ function parseCapture2(input, now) {
|
|
|
28807
28881
|
|
|
28808
28882
|
// src/meta.ts
|
|
28809
28883
|
var CLI_NAME = "do";
|
|
28810
|
-
var VERSION = "1.
|
|
28884
|
+
var VERSION = "1.294.0";
|
|
28811
28885
|
var API_PREFIX = "/api/v1";
|
|
28812
28886
|
var DEFAULT_API_URL = "http://localhost:3001";
|
|
28813
28887
|
|
|
@@ -33977,6 +34051,24 @@ var COMMAND_SPECS = [
|
|
|
33977
34051
|
returns: "RunChangesResult",
|
|
33978
34052
|
notes: "POST /api/v1/runs/{id}/checklists/{key}/tick. `do runs dex tick <run> 495 496 497`, `do runs dex tick <run> --bulk caught.txt` (up to 5000 ids). A dex the run doesn't have yet is made from the Pok\xE9mon pack's national dex."
|
|
33979
34053
|
},
|
|
34054
|
+
{
|
|
34055
|
+
path: ["runs", "steam", "status"],
|
|
34056
|
+
summary: "Whether you've linked Steam, how many games have a Steam app id, and the last sync.",
|
|
34057
|
+
args: [],
|
|
34058
|
+
flags: [],
|
|
34059
|
+
scopes: ["collections:read"],
|
|
34060
|
+
returns: "SteamAccountStatus",
|
|
34061
|
+
notes: "GET /api/v1/runs/steam. Steam is linked in the app's Settings; the Steam ID and Web API key are never returned. A game takes part once its `steamAppId` is set."
|
|
34062
|
+
},
|
|
34063
|
+
{
|
|
34064
|
+
path: ["runs", "steam", "sync"],
|
|
34065
|
+
summary: "Sync your Steam achievements into your runs now, as the daily sync does.",
|
|
34066
|
+
args: [],
|
|
34067
|
+
flags: [{ name: "game", type: "string", description: "Only this game item ULID." }],
|
|
34068
|
+
scopes: ["collections:write"],
|
|
34069
|
+
returns: "SteamSyncResult",
|
|
34070
|
+
notes: "POST /api/v1/runs/steam/sync. Writes into each run whose achievements come from Steam or aren't kept yet; runs kept by hand are left alone. Per game: outcome, runs, unlocked, total and the error (unauthorized, private, no_stats, unavailable, bad_response). 409 before Steam is linked."
|
|
34071
|
+
},
|
|
33980
34072
|
{
|
|
33981
34073
|
path: ["runs", "sessions", "list"],
|
|
33982
34074
|
summary: "A run's sessions, newest first, with recaps and change batches.",
|
|
@@ -39073,6 +39165,16 @@ var HANDLERS = {
|
|
|
39073
39165
|
render: renderRecord
|
|
39074
39166
|
};
|
|
39075
39167
|
},
|
|
39168
|
+
"runs steam status": async ({ requireClient }) => ({
|
|
39169
|
+
data: await requireClient().get("/runs/steam"),
|
|
39170
|
+
render: renderRecord
|
|
39171
|
+
}),
|
|
39172
|
+
"runs steam sync": async ({ flags, requireClient }) => {
|
|
39173
|
+
const body = parseInput(steamSyncInputSchema, {
|
|
39174
|
+
...typeof flags.game === "string" ? { gameId: flags.game } : {}
|
|
39175
|
+
});
|
|
39176
|
+
return { data: await requireClient().post("/runs/steam/sync", body), render: renderRecord };
|
|
39177
|
+
},
|
|
39076
39178
|
"runs sessions list": async ({ args, requireClient }) => {
|
|
39077
39179
|
const id = requireArg(args, 0, "run id");
|
|
39078
39180
|
return { data: await requireClient().get(`/runs/${id}/sessions`), render: renderList };
|
package/package.json
CHANGED