@profullstack/tleehealth 0.1.0 → 0.2.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/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +3 -2
- package/src/tui.js +2 -2
package/README.md
CHANGED
|
@@ -8,4 +8,4 @@ tleehealth schedule --date today
|
|
|
8
8
|
tleehealth tui
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
`TLEEHEALTH_API_KEY` and `TLEEHEALTH_URL` override the saved config.
|
|
11
|
+
`TLEEHEALTH_API_KEY` and `TLEEHEALTH_URL` override the saved config. Create an API key in the app under Settings, then `tleehealth login th_live_...` or set `TLEEHEALTH_API_KEY`.
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -37,10 +37,11 @@ export function parse(argv) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export function formatDay(day) {
|
|
40
|
-
const lines = [`${day.
|
|
40
|
+
const lines = [`${day.org?.name ? `${day.org.name} ` : ''}${day.date}`];
|
|
41
|
+
if (!day.appointments.length) lines.push(' nothing booked');
|
|
41
42
|
for (const a of day.appointments)
|
|
42
43
|
lines.push(
|
|
43
|
-
`${a.time} ${a.location.padEnd(11)} ${a.provider.padEnd(11)} ${a.patient.padEnd(11)} ${a.type.padEnd(14)} ${a.mode.padEnd(9)} ${a.
|
|
44
|
+
`${a.time} ${a.location.padEnd(11)} ${a.provider.padEnd(11)} ${a.patient.padEnd(11)} ${a.type.padEnd(14)} ${a.mode.padEnd(9)} ${a.status}`,
|
|
44
45
|
);
|
|
45
46
|
return lines.join('\n');
|
|
46
47
|
}
|
package/src/tui.js
CHANGED
|
@@ -19,7 +19,7 @@ export async function runTui(auth, date) {
|
|
|
19
19
|
try {
|
|
20
20
|
state.day = await schedule(auth, state.date);
|
|
21
21
|
state.selected = 0;
|
|
22
|
-
state.status = `${state.day.appointments.length} appointments${state.day.
|
|
22
|
+
state.status = `${state.day.appointments.length} appointments${state.day.org?.name ? ` · ${state.day.org.name}` : ''}`;
|
|
23
23
|
} catch (err) {
|
|
24
24
|
state.day = null;
|
|
25
25
|
state.status = err.message;
|
|
@@ -54,7 +54,7 @@ export async function runTui(auth, date) {
|
|
|
54
54
|
const i = rows.indexOf(a);
|
|
55
55
|
const mark = i === state.selected ? '›' : ' ';
|
|
56
56
|
panel.text(
|
|
57
|
-
`${mark} ${a.time} ${a.provider.padEnd(11)} ${a.patient.padEnd(11)} ${a.type.padEnd(14)} ${a.mode.padEnd(9)}
|
|
57
|
+
`${mark} ${a.time} ${a.provider.padEnd(11)} ${a.patient.padEnd(11)} ${a.type.padEnd(14)} ${a.mode.padEnd(9)} ${a.status}`,
|
|
58
58
|
{ fg: i === state.selected ? theme.accent : undefined },
|
|
59
59
|
);
|
|
60
60
|
}
|