recess-cli 3.35.0 → 3.36.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/command-schema.js
CHANGED
|
@@ -119,6 +119,7 @@ export const FAMILY_REMOTE_WRITES = [
|
|
|
119
119
|
"kid set-goal-games",
|
|
120
120
|
"kid set-goal-note",
|
|
121
121
|
"kid set-goal-required",
|
|
122
|
+
"kid set-goal-coins",
|
|
122
123
|
"kid set-goal-days",
|
|
123
124
|
"kid set-profile",
|
|
124
125
|
"kid set-rooms",
|
|
@@ -301,6 +302,7 @@ const FAMILY_COMMANDS = new Set([
|
|
|
301
302
|
"kid set-goal-games",
|
|
302
303
|
"kid set-goal-note",
|
|
303
304
|
"kid set-goal-required",
|
|
305
|
+
"kid set-goal-coins",
|
|
304
306
|
"kid set-goal-days",
|
|
305
307
|
"kid set-profile",
|
|
306
308
|
"kid set-rooms",
|
|
@@ -456,6 +458,7 @@ const STAFF_COMMANDS = new Set([
|
|
|
456
458
|
"rooms transcripts search",
|
|
457
459
|
"cohorts schedule get",
|
|
458
460
|
"cohorts schedule set",
|
|
461
|
+
"cohorts schedule realign",
|
|
459
462
|
"cohorts schedule changes",
|
|
460
463
|
"cohorts schedule change",
|
|
461
464
|
"memories files",
|
package/dist/commands/family.js
CHANGED
|
@@ -1804,6 +1804,36 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
|
|
|
1804
1804
|
};
|
|
1805
1805
|
});
|
|
1806
1806
|
}
|
|
1807
|
+
if (verb === "set-goal-coins") {
|
|
1808
|
+
const goalId = flagUuid(parsed, "goal", { required: true });
|
|
1809
|
+
const raw = flagString(parsed, "value", { required: true })
|
|
1810
|
+
.trim()
|
|
1811
|
+
.toLowerCase();
|
|
1812
|
+
const coins = raw === "default" ? null : Number(raw);
|
|
1813
|
+
if (coins !== null &&
|
|
1814
|
+
!(Number.isInteger(coins) && coins >= 0 && coins <= 20))
|
|
1815
|
+
throw new CliError("invalid_arguments", "--value must be a whole number from 0 to 20, or default.");
|
|
1816
|
+
return writeNow(parsed, {
|
|
1817
|
+
action: coins === null
|
|
1818
|
+
? `put ${name}'s challenge ${goalId} back to the usual coins`
|
|
1819
|
+
: `make each to-do of ${name}'s challenge ${goalId} pay ${coins} coins`,
|
|
1820
|
+
target: { ...kidTarget(kid), goalId },
|
|
1821
|
+
request: { coins },
|
|
1822
|
+
details: {
|
|
1823
|
+
consequence: "Its open and future to-dos pay this (default: required 20, optional 5; undo: family undo).",
|
|
1824
|
+
},
|
|
1825
|
+
}, async () => {
|
|
1826
|
+
const result = unwrap(await api.client.PATCH("/parent-v2/kid/{kidId}/challenges/{goalId}/coins/", { params: { path: { kidId, goalId } }, body: { coins } }));
|
|
1827
|
+
return result.change
|
|
1828
|
+
? result
|
|
1829
|
+
: {
|
|
1830
|
+
status: "no_change",
|
|
1831
|
+
reason: `"${result.title}" already pays ${coins === null ? "the usual coins" : `${coins} coins`}.`,
|
|
1832
|
+
goalId,
|
|
1833
|
+
coins: result.coins,
|
|
1834
|
+
};
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1807
1837
|
if (verb === "set-goal-days") {
|
|
1808
1838
|
const goalId = flagUuid(parsed, "goal", { required: true });
|
|
1809
1839
|
const days = flagString(parsed, "days", { required: true }).trim();
|
|
@@ -2268,7 +2298,7 @@ export async function runKidCommand({ parsed, api, writeCommand, }) {
|
|
|
2268
2298
|
body,
|
|
2269
2299
|
})));
|
|
2270
2300
|
}
|
|
2271
|
-
throw new CliError("invalid_arguments", "Use kid today|goals|xp|map-scores|classes|profile|set-profile|texts|set-texts|set-rooms|feed-lock|set-feed-lock|logins|reveal-login|add-login|edit-login|remove-login|excuse|unexcuse-weekly|cowork|switch-cowork|friends|friend-parent|pair-device|goal-schedule|pause-goal|resume-goal|goal-note|set-goal-note|add-todo|todo|move-todo|end-session|remove-todo|edit-todo|repeat-todo|join-challenge|leave-challenge|complete-challenge|set-goal-games|set-goal-required|set-goal-days|set-todo-reward|help|help-done|excuse-days|excused-days|unexcuse-days|moments|config|set|progress|schedule|attendance|browse-challenges|sign-in-code|todos|goal|conversations|social|enrollments|math-progress|memory|observe|send-note.");
|
|
2301
|
+
throw new CliError("invalid_arguments", "Use kid today|goals|xp|map-scores|classes|profile|set-profile|texts|set-texts|set-rooms|feed-lock|set-feed-lock|logins|reveal-login|add-login|edit-login|remove-login|excuse|unexcuse-weekly|cowork|switch-cowork|friends|friend-parent|pair-device|goal-schedule|pause-goal|resume-goal|goal-note|set-goal-note|add-todo|todo|move-todo|end-session|remove-todo|edit-todo|repeat-todo|join-challenge|leave-challenge|complete-challenge|set-goal-games|set-goal-required|set-goal-coins|set-goal-days|set-todo-reward|help|help-done|excuse-days|excused-days|unexcuse-days|moments|config|set|progress|schedule|attendance|browse-challenges|sign-in-code|todos|goal|conversations|social|enrollments|math-progress|memory|observe|send-note.");
|
|
2272
2302
|
}
|
|
2273
2303
|
/**
|
|
2274
2304
|
* `me`: the caller's OWN to-dos and challenges (a parent learning too), over
|
|
@@ -46,8 +46,27 @@ export async function runScheduleCommand(ctx) {
|
|
|
46
46
|
return unwrap(await api.client.GET("/admin/cohorts/{id}/schedule/changes", {
|
|
47
47
|
params: { ...params, query: { cursor: flagString(parsed, "cursor") } },
|
|
48
48
|
}));
|
|
49
|
+
if (action === "realign") {
|
|
50
|
+
const preview = unwrap(await api.client.POST("/admin/cohorts/{id}/schedule/realign/preview", {
|
|
51
|
+
params,
|
|
52
|
+
}));
|
|
53
|
+
if (preview.aligned)
|
|
54
|
+
return preview;
|
|
55
|
+
return writeCommand(parsed, {
|
|
56
|
+
action: "realign a legacy cohort's class numbering",
|
|
57
|
+
target: { cohortId: id, apiOrigin: api.config.apiOrigin },
|
|
58
|
+
request: {
|
|
59
|
+
startsAt: preview.nextStartsAt,
|
|
60
|
+
eventCount: preview.nextEventCount,
|
|
61
|
+
},
|
|
62
|
+
details: preview,
|
|
63
|
+
}, async () => unwrap(await api.client.POST("/admin/cohorts/{id}/schedule/realign/apply", {
|
|
64
|
+
params,
|
|
65
|
+
body: { fingerprint: preview.fingerprint },
|
|
66
|
+
})));
|
|
67
|
+
}
|
|
49
68
|
if (action !== "set")
|
|
50
|
-
throw new CliError("invalid_arguments", "Use cohorts schedule get|set|changes|change.");
|
|
69
|
+
throw new CliError("invalid_arguments", "Use cohorts schedule get|set|realign|changes|change.");
|
|
51
70
|
const input = {
|
|
52
71
|
days: flagString(parsed, "days", { required: true })
|
|
53
72
|
.split(",")
|
package/dist/help.js
CHANGED
|
@@ -285,6 +285,7 @@ Usage:
|
|
|
285
285
|
recess [--json] kid leave-challenge --student <kid> --goal <goal-id> [--confirm]
|
|
286
286
|
recess [--json] kid set-goal-games --student <kid> --goal <goal-id> --value on|off [--confirm]
|
|
287
287
|
recess [--json] kid set-goal-required --student <kid> --goal <goal-id> --value on|off [--confirm]
|
|
288
|
+
recess [--json] kid set-goal-coins --student <kid> --goal <goal-id> --value 0-20|default [--confirm]
|
|
288
289
|
recess [--json] kid set-goal-days --student <kid> --goal <goal-id>
|
|
289
290
|
--days <"Tue, Thu"|Mon-Fri|weekdays|daily> [--confirm]
|
|
290
291
|
recess [--json] kid help --student <kid> [--date YYYY-MM-DD]
|
|
@@ -387,6 +388,7 @@ Usage:
|
|
|
387
388
|
recess [--json] cohorts get <cohort-id> [--events-tab ACTIVE|ENDED|CANCELED|ARCHIVED]
|
|
388
389
|
recess [--json] cohorts schedule get <cohort-id>
|
|
389
390
|
recess [--json] cohorts schedule set <cohort-id> --days <MO,WE> --time <09:30> [--timezone <zone>] --effective-date <YYYY-MM-DD> --notify none|parents [--confirm] [--approval-token <token>]
|
|
391
|
+
recess [--json] cohorts schedule realign <cohort-id> [--confirm]
|
|
390
392
|
recess [--json] cohorts schedule changes <cohort-id> [--cursor <cursor>]
|
|
391
393
|
recess [--json] cohorts schedule change <change-id>
|
|
392
394
|
recess [--json] cohorts parent-emails <cohort-id>
|
|
@@ -960,7 +962,7 @@ new device. Plan changes apply at once with no confirm step and are logged
|
|
|
960
962
|
(undo: family undo, or family undo --change ID): excuse, unexcuse-weekly,
|
|
961
963
|
goal-schedule, pause-goal, resume-goal, set-goal-note, add-todo, move-todo,
|
|
962
964
|
remove-todo, edit-todo, repeat-todo, join-challenge, set-goal-games,
|
|
963
|
-
set-goal-required, help-done, excuse-days, unexcuse-days, and "set" fields
|
|
965
|
+
set-goal-required, set-goal-coins, help-done, excuse-days, unexcuse-days, and "set" fields
|
|
964
966
|
that apply at once. --confirm on them changes nothing: a rerun with it returns
|
|
965
967
|
the first result (alreadyApplied) instead of applying twice. Every other write
|
|
966
968
|
previews first, then needs --confirm. Passwords are
|
|
@@ -1404,6 +1406,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1404
1406
|
"kid leave-challenge": "Take a kid off a challenge; progress is kept.",
|
|
1405
1407
|
"kid set-goal-games": "Practice games on/off after one challenge's lessons (at once).",
|
|
1406
1408
|
"kid set-goal-required": "Whether a kid may drop one challenge themselves (at once).",
|
|
1409
|
+
"kid set-goal-coins": "Coins each of one challenge's to-dos pays, 0-20 or default (at once).",
|
|
1407
1410
|
"kid help": "The day's ways to help (from the daily summary).",
|
|
1408
1411
|
"kid help-done": "Mark a help item done; the kid's Rocky hears (at once).",
|
|
1409
1412
|
"kid excuse-days": "Give a kid days off; their todos move (at once).",
|
|
@@ -1457,6 +1460,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1457
1460
|
"cohorts get": "Read a cohort and its events.",
|
|
1458
1461
|
"cohorts schedule get": "Read a cohort's recurring schedule.",
|
|
1459
1462
|
"cohorts schedule set": "Change a cohort's recurring schedule from a date.",
|
|
1463
|
+
"cohorts schedule realign": "Fix a legacy cohort whose class numbering blocks schedule changes.",
|
|
1460
1464
|
"cohorts schedule changes": "List a cohort's schedule changes.",
|
|
1461
1465
|
"cohorts schedule change": "Read one cohort schedule change.",
|
|
1462
1466
|
"cohorts parent-emails": "List parent emails for a cohort.",
|