recess-cli 3.57.0 → 3.59.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/args.js +1 -0
- package/dist/commands/changelog.js +17 -1
- package/dist/commands/tuition.js +41 -2
- package/dist/help.js +4 -4
- package/package.json +3 -3
package/dist/args.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fs } from "../in-app.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { unwrap } from "../api.js";
|
|
4
|
-
import { flagString } from "../args.js";
|
|
4
|
+
import { flagString, hasFlag } from "../args.js";
|
|
5
5
|
import { CliError } from "../errors.js";
|
|
6
6
|
import { assertChoice, positional } from "./shared.js";
|
|
7
7
|
async function readSend(parsed) {
|
|
@@ -33,6 +33,22 @@ export async function runChangelogCommand({ parsed, api, writeCommand, }) {
|
|
|
33
33
|
throw new CliError("invalid_arguments", "Use changelog preview|test|send|history|show.");
|
|
34
34
|
}
|
|
35
35
|
const send = await readSend(parsed);
|
|
36
|
+
if (action === "send" && hasFlag(parsed, "top-up")) {
|
|
37
|
+
const slug = send.slug;
|
|
38
|
+
const { added } = unwrap(await api.client.POST("/admin/changelog-sends/top-up/", {
|
|
39
|
+
body: { slug, preview: true },
|
|
40
|
+
}));
|
|
41
|
+
if (added === 0)
|
|
42
|
+
return { slug, added, queued: false };
|
|
43
|
+
return writeCommand(parsed, {
|
|
44
|
+
action: `email and text the ${added} people the "${slug}" send missed, with its original copy. The feed and Slack posts don't repeat.`,
|
|
45
|
+
target: { slug },
|
|
46
|
+
request: { slug },
|
|
47
|
+
details: { added },
|
|
48
|
+
}, async () => unwrap(await api.client.POST("/admin/changelog-sends/top-up/", {
|
|
49
|
+
body: { slug },
|
|
50
|
+
})));
|
|
51
|
+
}
|
|
36
52
|
if (action === "test") {
|
|
37
53
|
const audience = assertChoice(flagString(parsed, "audience", { required: true }), ["kids", "parents", "tutors"], "--audience");
|
|
38
54
|
return unwrap(await api.client.POST("/admin/changelog-sends/test/", {
|
package/dist/commands/tuition.js
CHANGED
|
@@ -329,6 +329,9 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
|
|
|
329
329
|
};
|
|
330
330
|
});
|
|
331
331
|
const note = textFlag(parsed, "note");
|
|
332
|
+
const annualCents = centsFlag(parsed, "annual");
|
|
333
|
+
const startDate = dateFlag(parsed, "start");
|
|
334
|
+
const endDate = dateFlag(parsed, "end");
|
|
332
335
|
const body = {
|
|
333
336
|
kidUserId,
|
|
334
337
|
institutionSlug: textFlag(parsed, "school") ?? "recess-academy",
|
|
@@ -339,6 +342,9 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
|
|
|
339
342
|
defaultCollection,
|
|
340
343
|
installments,
|
|
341
344
|
...(note ? { note } : {}),
|
|
345
|
+
...(annualCents !== undefined ? { annualTuitionCents: annualCents } : {}),
|
|
346
|
+
...(startDate ? { startDate } : {}),
|
|
347
|
+
...(endDate ? { endDate } : {}),
|
|
342
348
|
};
|
|
343
349
|
const { preview } = unwrap(await api.client.POST("/admin/tuition-billing/", {
|
|
344
350
|
body: { ...body, dryRun: true },
|
|
@@ -435,6 +441,28 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
|
|
|
435
441
|
on: "on",
|
|
436
442
|
off: "off",
|
|
437
443
|
});
|
|
444
|
+
const enrollmentType = choiceFlag(parsed, "enrollment", {
|
|
445
|
+
direct: "DIRECT",
|
|
446
|
+
"partner-school": "PARTNER_SCHOOL",
|
|
447
|
+
program: "PROGRAM",
|
|
448
|
+
});
|
|
449
|
+
const partnerSlug = textFlag(parsed, "partner-school");
|
|
450
|
+
const annualCents = centsFlag(parsed, "annual");
|
|
451
|
+
const startDate = dateFlag(parsed, "start");
|
|
452
|
+
const endRaw = flagString(parsed, "end")?.trim();
|
|
453
|
+
const endDate = endRaw === "none" ? null : dateFlag(parsed, "end");
|
|
454
|
+
const term = annualCents !== undefined || startDate || endRaw !== undefined
|
|
455
|
+
? {
|
|
456
|
+
...(annualCents !== undefined
|
|
457
|
+
? { annualTuitionCents: annualCents }
|
|
458
|
+
: {}),
|
|
459
|
+
...(startDate ? { startDate } : {}),
|
|
460
|
+
...(endRaw !== undefined ? { endDate } : {}),
|
|
461
|
+
}
|
|
462
|
+
: null;
|
|
463
|
+
if (enrollmentType === "PARTNER_SCHOOL" && !partnerSlug) {
|
|
464
|
+
throw new CliError("invalid_arguments", "--enrollment partner-school needs --partner-school <slug>.");
|
|
465
|
+
}
|
|
438
466
|
const body = verb === "pause"
|
|
439
467
|
? { paused: true, ...(note ? { pausedNote: note } : {}) }
|
|
440
468
|
: verb === "resume"
|
|
@@ -443,16 +471,27 @@ export async function runTuitionCommand({ parsed, api, writeCommand, }) {
|
|
|
443
471
|
...(payer ? { payer } : {}),
|
|
444
472
|
...(defaultCollection ? { defaultCollection } : {}),
|
|
445
473
|
...(auto ? { autoInvoice: auto === "on" } : {}),
|
|
474
|
+
...(term ? { term } : {}),
|
|
475
|
+
...(enrollmentType
|
|
476
|
+
? {
|
|
477
|
+
enrollment: {
|
|
478
|
+
type: enrollmentType,
|
|
479
|
+
...(enrollmentType === "PARTNER_SCHOOL"
|
|
480
|
+
? { partnerSchoolSlug: partnerSlug }
|
|
481
|
+
: {}),
|
|
482
|
+
},
|
|
483
|
+
}
|
|
484
|
+
: {}),
|
|
446
485
|
};
|
|
447
486
|
if (Object.keys(body).length === 0) {
|
|
448
|
-
throw new CliError("invalid_arguments", "Nothing to change. Use --payer family|az-esa|fl-scholarship|partner-school, --collection invoice|auto-charge|out-of-band,
|
|
487
|
+
throw new CliError("invalid_arguments", "Nothing to change. Use --payer family|az-esa|fl-scholarship|partner-school, --collection invoice|auto-charge|out-of-band, --auto-invoice on|off, --enrollment direct|partner-school|program, or --annual/--start/--end.");
|
|
449
488
|
}
|
|
450
489
|
return writeCommand(parsed, {
|
|
451
490
|
action: verb === "pause"
|
|
452
491
|
? `pause tuition schedule ${scheduleId}: nothing on it is drafted or sent while paused`
|
|
453
492
|
: verb === "resume"
|
|
454
493
|
? `resume tuition schedule ${scheduleId}`
|
|
455
|
-
: `change tuition schedule ${scheduleId}'s settings${"autoInvoice" in body ? ` (automatic invoicing ${body.autoInvoice ? "ON: the daily run drafts, sends and chases its invoices" : "OFF"})` : ""}`,
|
|
494
|
+
: `change tuition schedule ${scheduleId}'s settings${"autoInvoice" in body ? ` (automatic invoicing ${body.autoInvoice ? "ON: the daily run drafts, sends and chases its invoices" : "OFF"})` : ""}${"enrollment" in body && body.enrollment ? ` (enrollment → ${body.enrollment.type}${body.enrollment.type === "PARTNER_SCHOOL" ? ` ${partnerSlug}` : ""})` : ""}`,
|
|
456
495
|
target: { scheduleId },
|
|
457
496
|
request: body,
|
|
458
497
|
}, async () => shown(unwrap(await api.client.PATCH("/admin/tuition-billing/{scheduleId}", {
|
package/dist/help.js
CHANGED
|
@@ -394,7 +394,7 @@ Usage:
|
|
|
394
394
|
recess [--json] tuition list [--status NEEDS_REVIEW|SCHEDULED|DRAFTED|SENT|PAID|PAID_OUT_OF_BAND|VOID] [--family <family-id>] [--packet <packet-id>] [--q TEXT] [--limit N]
|
|
395
395
|
recess [--json] tuition show <schedule-id>
|
|
396
396
|
recess [--json] tuition edit <installment-id> [--amount DOLLARS] [--invoice-date YYYY-MM-DD] [--due-date YYYY-MM-DD] [--label TEXT] [--collection invoice|auto-charge|out-of-band|default] [--note TEXT] [--ask-family [--family-note TEXT]] [--confirm]
|
|
397
|
-
recess [--json] tuition create --student <kid-id> --state XX --enrollment direct|partner-school|program [--partner-school <slug>] [--school <institution-slug>] [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] --installment "LABEL|DOLLARS|INVOICE-DATE|DUE-DATE[|SERVICE-START|SERVICE-END]"... [--note TEXT] [--confirm]
|
|
397
|
+
recess [--json] tuition create --student <kid-id> --state XX --enrollment direct|partner-school|program [--partner-school <slug>] [--school <institution-slug>] [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] --installment "LABEL|DOLLARS|INVOICE-DATE|DUE-DATE[|SERVICE-START|SERVICE-END]"... [--annual DOLLARS] [--start YYYY-MM-DD] [--end YYYY-MM-DD] [--note TEXT] [--confirm]
|
|
398
398
|
recess [--json] tuition add <schedule-id> --label TEXT --amount DOLLARS --invoice-date YYYY-MM-DD --due-date YYYY-MM-DD [--collection invoice|auto-charge|out-of-band] [--note TEXT] [--ask-family [--family-note TEXT]] [--confirm]
|
|
399
399
|
recess [--json] tuition release <installment-id> [--note TEXT] [--confirm]
|
|
400
400
|
recess [--json] tuition void <installment-id> --reason TEXT [--ask-family [--family-note TEXT]] [--confirm]
|
|
@@ -411,7 +411,7 @@ Usage:
|
|
|
411
411
|
recess [--json] tuition auto-invoice on|off (<schedule-id>... | --all) [--confirm]
|
|
412
412
|
recess [--json] tuition pause <schedule-id> [--note TEXT] [--confirm]
|
|
413
413
|
recess [--json] tuition resume <schedule-id> [--confirm]
|
|
414
|
-
recess [--json] tuition set <schedule-id> [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] [--auto-invoice on|off] [--confirm]
|
|
414
|
+
recess [--json] tuition set <schedule-id> [--payer family|az-esa|fl-scholarship|partner-school] [--collection invoice|auto-charge|out-of-band] [--auto-invoice on|off] [--enrollment direct|partner-school|program [--partner-school <slug>]] [--annual DOLLARS] [--start YYYY-MM-DD] [--end YYYY-MM-DD|none] [--confirm]
|
|
415
415
|
recess [--json] admissions create --school <institution-slug> --enrollment direct|partner-school|program
|
|
416
416
|
[--partner-school <slug|id>] --parent "First Last" --email EMAIL [--phone TEXT] --state XX
|
|
417
417
|
--kid "First Last:YYYY-MM-DD[:grade]" (repeat per child) [--existing-kid USER_ID[:grade]]...
|
|
@@ -463,7 +463,7 @@ Usage:
|
|
|
463
463
|
recess [--json] feed post --users <id,id,...> --text TEXT [--send-email] [--confirm]
|
|
464
464
|
recess [--json] changelog preview --file <send.json> [--html-dir <dir>]
|
|
465
465
|
recess [--json] changelog test --file <send.json> --audience kids|parents|tutors
|
|
466
|
-
recess [--json] changelog send --file <send.json> [--confirm]
|
|
466
|
+
recess [--json] changelog send --file <send.json> [--top-up] [--confirm]
|
|
467
467
|
recess [--json] changelog history
|
|
468
468
|
recess [--json] changelog show <slug>
|
|
469
469
|
recess [--json] dms send --users <id,id,...> --text TEXT [--confirm]
|
|
@@ -1645,7 +1645,7 @@ export const COMMAND_SUMMARIES = {
|
|
|
1645
1645
|
"feed post": "Post a message to users' feeds (optionally email).",
|
|
1646
1646
|
"changelog preview": "Render a changelog blast and count who it reaches, sending nothing.",
|
|
1647
1647
|
"changelog test": "Send yourself one audience's email and text.",
|
|
1648
|
-
"changelog send": "Send a live changelog post to its audience, once.",
|
|
1648
|
+
"changelog send": "Send a live changelog post to its audience, once. --top-up reaches whoever its audience now covers but it missed.",
|
|
1649
1649
|
"changelog history": "List every changelog send.",
|
|
1650
1650
|
"changelog show": "One changelog send and its exact copy.",
|
|
1651
1651
|
"dms send": "Send a Recess chat DM as yourself to each user (1:1).",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recess-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.59.0",
|
|
4
4
|
"description": "Safe Recess administration and family AI tools from the command line.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"oxlint-tsgolint": "^0.6.0",
|
|
47
47
|
"typescript": "^5.9.2",
|
|
48
48
|
"vitest": "^1.6.0",
|
|
49
|
-
"@tryrecess/
|
|
50
|
-
"@tryrecess/
|
|
49
|
+
"@tryrecess/typescript-config": "0.0.0",
|
|
50
|
+
"@tryrecess/api-types": "0.0.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "node node_modules/@tryrecess/typescript-config/bin/tsc-fast.mjs",
|