@whatcha/cli 0.4.0 → 0.6.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 +82 -2
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/entry.js +367 -0
- package/dist/commands/entry.js.map +1 -0
- package/dist/commands/profiles.js +51 -24
- package/dist/commands/profiles.js.map +1 -1
- package/dist/commands/shared-diary.js +5 -3
- package/dist/commands/shared-diary.js.map +1 -1
- package/dist/commands/whoami.js +12 -2
- package/dist/commands/whoami.js.map +1 -1
- package/dist/commands/write.js +98 -2
- package/dist/commands/write.js.map +1 -1
- package/dist/lib/append-entry.js +161 -52
- package/dist/lib/append-entry.js.map +1 -1
- package/dist/lib/entry-date.js +2 -2
- package/dist/lib/entry-date.js.map +1 -1
- package/dist/lib/entry-edit.js +75 -0
- package/dist/lib/entry-edit.js.map +1 -0
- package/dist/lib/profile-family.js +14 -0
- package/dist/lib/profile-family.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -190,7 +190,8 @@ the diary's settings may do this. `--json` prints `diaryId` and
|
|
|
190
190
|
|
|
191
191
|
```
|
|
192
192
|
whatcha write <diary> (--text "..." | --text-file <path|->) [--title "..."] [--tag <tag>]...
|
|
193
|
-
[--image <file>]... [--cover <file>] [--
|
|
193
|
+
[--image <file>]... [--cover <file>] [--mood <mood>] [--location "..."]
|
|
194
|
+
[--lat <deg> --lng <deg>] [--time HH:MM [--end HH:MM]] [--date YYYY-MM-DD] [--json]
|
|
194
195
|
```
|
|
195
196
|
|
|
196
197
|
`--text-file <path>` (#54) reads the text from a file, or from standard
|
|
@@ -215,6 +216,29 @@ existing one is kept, reported as `titleKept: true` and a note on stderr),
|
|
|
215
216
|
and `--tag` (repeat it for several) only adds to the entry's tags --
|
|
216
217
|
trimmed, exact duplicates dropped, at most 32 in all, 64 characters each.
|
|
217
218
|
|
|
219
|
+
`--mood`, `--location`, `--lat`/`--lng` and `--end` (#57) fill the rest of
|
|
220
|
+
the entry's header, the fields the app's entry screen shows:
|
|
221
|
+
|
|
222
|
+
- `--mood <mood>` -- the app offers 😊 🥰 😆 😌 😐 😢 😠 😴; any other text
|
|
223
|
+
of at most 64 characters is a custom mood, as in the app.
|
|
224
|
+
- `--location "<place>"` -- the place's name, at most 200 characters.
|
|
225
|
+
- `--lat <deg> --lng <deg>` -- the point on the map (#1520), in decimal
|
|
226
|
+
degrees (-90..90, -180..180), always both. A negative value may follow
|
|
227
|
+
the flag as it is (`--lng -122.42`).
|
|
228
|
+
- `--end HH:MM` -- with `--time` as its start, the entry's time range
|
|
229
|
+
(24h, later than `--time` on the same day). `--end` needs `--time`;
|
|
230
|
+
`--time` alone still only sets when the entry happened, as before.
|
|
231
|
+
`content` on `/entries` has no field for a range, so it is saved with the
|
|
232
|
+
app calendar's own call, `PATCH /diaries/{diaryId}/entries/{entryId}`
|
|
233
|
+
(a details-only commit: the text, header and images are carried over).
|
|
234
|
+
|
|
235
|
+
On a day that already has an entry, each follows the `--title` rule: it
|
|
236
|
+
fills a field the entry does not have yet and never replaces one somebody
|
|
237
|
+
set. What was kept is reported as `moodKept`, `locationKept`,
|
|
238
|
+
`coordinatesKept` and `rangeKept` (plus a note on stderr) and `--json`
|
|
239
|
+
prints the range the entry ends up with as `start`/`end`. An existing range
|
|
240
|
+
is saved again after the append, which would otherwise clear it.
|
|
241
|
+
|
|
218
242
|
`<diary>` is a diary id or its exact name (case-insensitive; an ambiguous
|
|
219
243
|
name lists the matches and asks for the id instead). `--date`/`--time`
|
|
220
244
|
default to today/now in **the diary's own timezone**, not the machine's --
|
|
@@ -253,6 +277,55 @@ no `?date=` filter, so this pages through the diary's entries
|
|
|
253
277
|
newest-first (`src/lib/entry-find.ts`) until it finds that day or passes it
|
|
254
278
|
-- exact, not fuzzy, but not O(1) for a very old date on a very active diary.
|
|
255
279
|
|
|
280
|
+
### `whatcha entry update` / `whatcha entry delete`
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
whatcha entry update <entry-id> [--text "..." | --text-file <path|->] [--mine | --all] [--title "..."] [--tag <tag>]...
|
|
284
|
+
[--image <file>]... [--remove-image <media-id>]... [--cover <file>] [--mood <mood>]
|
|
285
|
+
[--location "..."] [--lat <deg> --lng <deg>] [--message "..."] [--json]
|
|
286
|
+
whatcha entry delete <entry-id> [--yes] [--all] [--json]
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Change or take back an entry that is already there (#117), by its id --
|
|
290
|
+
`whatcha write` prints it as `entryId`, and so does `whatcha read --json`.
|
|
291
|
+
Both use the app's own calls: `PATCH /entries/{id}` (a new version on top of
|
|
292
|
+
the one just read, so a save that lands in between is refused, never
|
|
293
|
+
overwritten -- run the command again) and `DELETE /entries/{id}`. Who may do
|
|
294
|
+
either is the diary's call; a refusal is the API's own error. Neither needs
|
|
295
|
+
a terminal, so both run from a server or a scheduled job.
|
|
296
|
+
|
|
297
|
+
`update` changes only what you give it; everything else the entry has is
|
|
298
|
+
saved again as it was, including its time range:
|
|
299
|
+
|
|
300
|
+
- `--text` / `--text-file <path|->` -- the new text, read the way `write`
|
|
301
|
+
reads it (a file, or standard input for `-`; BOM dropped, CRLF to LF).
|
|
302
|
+
If somebody else wrote any of the entry's text, replacing all of it
|
|
303
|
+
needs a choice: **`--mine`** replaces only the lines you wrote -- your
|
|
304
|
+
part, from your first line to your last, as the app's blame shows it --
|
|
305
|
+
and leaves everyone else's exactly where it was; `--all` replaces the
|
|
306
|
+
whole text, theirs included. With `--mine`, an empty text removes your
|
|
307
|
+
part. `--mine` refuses when your lines and somebody else's are mixed
|
|
308
|
+
together; edit those in the app.
|
|
309
|
+
- `--title`, `--mood`, `--location`, `--lat`/`--lng` -- replace the field
|
|
310
|
+
(same limits as `write`). `--tag` (repeat it) -- the entry's tags become
|
|
311
|
+
exactly these.
|
|
312
|
+
- `--image <file>` -- adds an image after the entry's own; `--remove-image
|
|
313
|
+
<media-id>` -- takes one off (`read --json` lists them as `images`);
|
|
314
|
+
`--cover <file>` -- uploads an image and makes it the cover.
|
|
315
|
+
- `--message` -- a note on the new version, shown in the entry's history.
|
|
316
|
+
|
|
317
|
+
`--json` prints `entryId`, `headCommitId`, `text` (`mine`, `all` or
|
|
318
|
+
`unchanged`), `title`, `tags`, `images` and `coverMediaAssetId`.
|
|
319
|
+
|
|
320
|
+
`delete` asks before deleting when there is a terminal to ask at; `--yes`
|
|
321
|
+
skips the question. With no terminal (a pipe, a server, an agent) and no
|
|
322
|
+
`--yes`, it deletes nothing and fails -- a script has to say `--yes`. An
|
|
323
|
+
entry somebody else also wrote in is not deleted without `--all`, since
|
|
324
|
+
that would delete their writing too; take back only your part with
|
|
325
|
+
`whatcha entry update <id> --mine --text ""` instead. `--json` prints
|
|
326
|
+
`entryId`, `diaryId` and `deleted`. A declined question exits with
|
|
327
|
+
status 1 and deletes nothing.
|
|
328
|
+
|
|
256
329
|
### `whatcha profiles` / `whatcha switch` / `whatcha profile-add` / `whatcha profile-rm`
|
|
257
330
|
|
|
258
331
|
```
|
|
@@ -272,6 +345,13 @@ them knows the feature exists. The saved session simply is that profile.
|
|
|
272
345
|
`profiles` marks the current one with `*` and labels the account; `--json`
|
|
273
346
|
adds `remaining`, how many more the plan allows.
|
|
274
347
|
|
|
348
|
+
Which profile is "current" is always the server's answer (`GET /me` with
|
|
349
|
+
the saved credential), never an id remembered in the credential store
|
|
350
|
+
(#58): `switch` says "Already writing as" only when the server agrees,
|
|
351
|
+
`switch --account` signs the account's credential back in on the spot and
|
|
352
|
+
records who it is, and `whoami` repairs a saved session whose remembered id
|
|
353
|
+
had drifted from its credential (as 0.4.0's `switch --account` left it).
|
|
354
|
+
|
|
275
355
|
`profile-add` (#1699) creates one (`POST /me/profiles`, as the app's "Add a
|
|
276
356
|
profile" does): a `@handle` of 3-30 letters, digits, `_` or `-` starting
|
|
277
357
|
with a letter or digit, and a `--name` of at most 80 characters. A taken
|
|
@@ -354,7 +434,7 @@ it; `--json` adds `media` (`id`, `url`, `mimeType`, `altText`),
|
|
|
354
434
|
Every command accepts `--json`. On success it prints exactly one JSON
|
|
355
435
|
object to stdout: `{"ok": true, ...}`, with the fields documented per
|
|
356
436
|
command above (`diaries`, `entryId`/`mode`/`verified`/`title`/`tags`/`titleKept`
|
|
357
|
-
for `write`, `body`/`title`/`tags`/... for `read`, `pages` / `body` /
|
|
437
|
+
for `write`, `body`/`title`/`tags`/... for `read`, `entryId`/`text`/`deleted` for `entry`, `pages` / `body` /
|
|
358
438
|
`mode`/`concurrentEdit` for `wiki`, `profile`/`avatarError` for
|
|
359
439
|
`profile-add`, `diary`/`members` for `diary-new`, `url`/`isPublic` for
|
|
360
440
|
`publish`). On failure it prints
|
package/dist/cli.js
CHANGED
|
@@ -12,6 +12,7 @@ const publish_1 = require("./commands/publish");
|
|
|
12
12
|
const diary_cover_1 = require("./commands/diary-cover");
|
|
13
13
|
const whoami_1 = require("./commands/whoami");
|
|
14
14
|
const wiki_1 = require("./commands/wiki");
|
|
15
|
+
const entry_1 = require("./commands/entry");
|
|
15
16
|
const output_1 = require("./lib/output");
|
|
16
17
|
const USAGE = `whatcha -- command-line client for what-are-you-do-ing
|
|
17
18
|
|
|
@@ -26,8 +27,13 @@ Usage:
|
|
|
26
27
|
whatcha publish <diary> [--off] [--json]
|
|
27
28
|
whatcha diary-cover <diary> <file> | --clear [--json]
|
|
28
29
|
whatcha write <diary> (--text "..." | --text-file <path|->) [--title "..."] [--tag <tag>]...
|
|
29
|
-
[--image <file>]... [--cover <file>] [--
|
|
30
|
+
[--image <file>]... [--cover <file>] [--mood <mood>] [--location "..."] [--lat <deg> --lng <deg>]
|
|
31
|
+
[--time HH:MM [--end HH:MM]] [--date YYYY-MM-DD] [--json]
|
|
30
32
|
whatcha read <diary> [--date YYYY-MM-DD] [--json]
|
|
33
|
+
whatcha entry update <entry-id> [--text "..." | --text-file <path|->] [--mine | --all] [--title "..."] [--tag <tag>]...
|
|
34
|
+
[--image <file>]... [--remove-image <media-id>]... [--cover <file>] [--mood <mood>] [--location "..."]
|
|
35
|
+
[--lat <deg> --lng <deg>] [--message "..."] [--json]
|
|
36
|
+
whatcha entry delete <entry-id> [--yes] [--all] [--json]
|
|
31
37
|
whatcha profiles [--json]
|
|
32
38
|
whatcha switch <@handle> [--json]
|
|
33
39
|
whatcha switch --account [--json]
|
|
@@ -88,6 +94,9 @@ async function run(argv) {
|
|
|
88
94
|
return (await (0, write_1.runWrite)((0, write_1.parseWriteArgs)(rest))).exitCode;
|
|
89
95
|
case "read":
|
|
90
96
|
return (await (0, read_1.runRead)((0, read_1.parseReadArgs)(rest))).exitCode;
|
|
97
|
+
// Changing or taking back an entry that is already there (#117), by its id.
|
|
98
|
+
case "entry":
|
|
99
|
+
return (await (0, entry_1.runEntry)((0, entry_1.parseEntryArgs)(rest))).exitCode;
|
|
91
100
|
case "whoami":
|
|
92
101
|
return (await (0, whoami_1.runWhoami)((0, whoami_1.parseWhoamiArgs)(rest))).exitCode;
|
|
93
102
|
// Experience Wiki (#1664). Public Square's pages, or a group's with
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;AAuEA,kBAiEC;AAxID,qCAAmD;AACnD,4CAA4D;AAC5D,gDAAkE;AAClE,4CAA4D;AAC5D,0CAAyD;AACzD,kDAW6B;AAC7B,0DAAqG;AACrG,gDAAkE;AAClE,wDAA4E;AAC5E,8CAA+D;AAC/D,0CAAyD;AACzD,4CAA4D;AAC5D,yCAAyD;AAEzD,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCb,CAAC;AAEF;;;;;GAKG;AACI,KAAK,UAAU,GAAG,CAAC,IAAc;IACtC,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAA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YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,IAAI,SAAS;QAAE,IAAA,kBAAS,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;;QACzE,IAAA,uBAAc,EAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;IAC3D,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.parseEntryArgs = parseEntryArgs;
|
|
7
|
+
exports.runEntry = runEntry;
|
|
8
|
+
const node_readline_1 = __importDefault(require("node:readline"));
|
|
9
|
+
const node_util_1 = require("node:util");
|
|
10
|
+
const session_1 = require("../auth/session");
|
|
11
|
+
const errors_1 = require("../errors");
|
|
12
|
+
const append_entry_1 = require("../lib/append-entry");
|
|
13
|
+
const entry_edit_1 = require("../lib/entry-edit");
|
|
14
|
+
const entry_get_1 = require("../lib/entry-get");
|
|
15
|
+
const image_upload_1 = require("../lib/image-upload");
|
|
16
|
+
const output_1 = require("../lib/output");
|
|
17
|
+
const profile_family_1 = require("../lib/profile-family");
|
|
18
|
+
const write_1 = require("./write");
|
|
19
|
+
/**
|
|
20
|
+
* `whatcha entry update | delete` -- change or take back an entry that is
|
|
21
|
+
* already there (#117), by its id (`whatcha write` and `whatcha read
|
|
22
|
+
* --json` print it as `entryId`). The app's own calls:
|
|
23
|
+
*
|
|
24
|
+
* update PATCH /entries/{id}, optimistic-locked on the head commit
|
|
25
|
+
* delete DELETE /entries/{id} (a soft delete)
|
|
26
|
+
*
|
|
27
|
+
* Who may do either is the API's call -- the diary's `entry` update/delete
|
|
28
|
+
* permission, printed as the API's own error when refused. What this file
|
|
29
|
+
* adds is the CLI's one promise, nothing somebody else wrote is removed:
|
|
30
|
+
* replacing the text of an entry other people wrote in, or deleting it,
|
|
31
|
+
* needs `--all`, and `--mine` replaces only your own lines (lib/entry-edit.ts).
|
|
32
|
+
*
|
|
33
|
+
* Both run with no terminal at all: everything is a flag, and `delete`
|
|
34
|
+
* without `--yes` asks only when there is a terminal to ask at.
|
|
35
|
+
*/
|
|
36
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
37
|
+
const MAX_MESSAGE = 500;
|
|
38
|
+
const MAX_MEDIA = 50;
|
|
39
|
+
const UPDATE_USAGE = 'whatcha entry update <entry-id> [--text "..." | --text-file <path|->] [--mine | --all] [--title "..."] [--tag <tag>]... ' +
|
|
40
|
+
'[--image <file>]... [--remove-image <media-id>]... [--cover <file>] [--mood <mood>] [--location "..."] ' +
|
|
41
|
+
'[--lat <deg> --lng <deg>] [--message "..."] [--json]';
|
|
42
|
+
const DELETE_USAGE = "whatcha entry delete <entry-id> [--yes] [--all] [--json]";
|
|
43
|
+
const USAGE = `Usage:\n ${UPDATE_USAGE}\n ${DELETE_USAGE}`;
|
|
44
|
+
const UPDATE_ONLY = ["text", "text-file", "mine", "title", "tag", "image", "remove-image", "cover", "mood", "location", "lat", "lng", "message"];
|
|
45
|
+
function parseEntryArgs(argv) {
|
|
46
|
+
const [action, ...rest] = argv;
|
|
47
|
+
let values, positionals;
|
|
48
|
+
try {
|
|
49
|
+
({ values, positionals } = (0, node_util_1.parseArgs)({
|
|
50
|
+
args: (0, write_1.negativeDegrees)(rest),
|
|
51
|
+
options: {
|
|
52
|
+
json: { type: "boolean", default: false },
|
|
53
|
+
text: { type: "string" },
|
|
54
|
+
"text-file": { type: "string" },
|
|
55
|
+
mine: { type: "boolean", default: false },
|
|
56
|
+
all: { type: "boolean", default: false },
|
|
57
|
+
title: { type: "string" },
|
|
58
|
+
tag: { type: "string", multiple: true },
|
|
59
|
+
image: { type: "string", multiple: true },
|
|
60
|
+
"remove-image": { type: "string", multiple: true },
|
|
61
|
+
cover: { type: "string" },
|
|
62
|
+
mood: { type: "string" },
|
|
63
|
+
location: { type: "string" },
|
|
64
|
+
lat: { type: "string" },
|
|
65
|
+
lng: { type: "string" },
|
|
66
|
+
message: { type: "string" },
|
|
67
|
+
yes: { type: "boolean", short: "y", default: false },
|
|
68
|
+
},
|
|
69
|
+
allowPositionals: true,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
throw new errors_1.CliUsageError(err.message);
|
|
74
|
+
}
|
|
75
|
+
const json = values.json;
|
|
76
|
+
const entryId = () => {
|
|
77
|
+
if (positionals.length === 0)
|
|
78
|
+
throw new errors_1.CliUsageError(`Which entry? Give its id (\`whatcha read --json\` prints it as entryId).\n${USAGE}`);
|
|
79
|
+
if (positionals.length > 1)
|
|
80
|
+
throw new errors_1.CliUsageError(`Unexpected extra argument: "${positionals[1]}"`);
|
|
81
|
+
if (!UUID_RE.test(positionals[0])) {
|
|
82
|
+
throw new errors_1.CliUsageError(`An entry id is a UUID (\`whatcha read --json\` prints it as entryId), got "${positionals[0]}".`);
|
|
83
|
+
}
|
|
84
|
+
return positionals[0].toLowerCase();
|
|
85
|
+
};
|
|
86
|
+
switch (action) {
|
|
87
|
+
case "update":
|
|
88
|
+
if (values.yes)
|
|
89
|
+
throw new errors_1.CliUsageError(`--yes does not apply to \`whatcha entry update\`.\nUsage: ${UPDATE_USAGE}`);
|
|
90
|
+
return parseUpdate(values, entryId(), json);
|
|
91
|
+
case "delete":
|
|
92
|
+
for (const name of UPDATE_ONLY) {
|
|
93
|
+
const v = values[name];
|
|
94
|
+
if (v !== undefined && v !== false)
|
|
95
|
+
throw new errors_1.CliUsageError(`--${name} does not apply to \`whatcha entry delete\`.\nUsage: ${DELETE_USAGE}`);
|
|
96
|
+
}
|
|
97
|
+
return { action, json, entryId: entryId(), yes: values.yes, all: values.all };
|
|
98
|
+
default:
|
|
99
|
+
throw new errors_1.CliUsageError(action ? `Unknown entry action "${action}".\n${USAGE}` : USAGE);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function parseUpdate(values, entryId, json) {
|
|
103
|
+
const textFile = values["text-file"];
|
|
104
|
+
const text = values.text;
|
|
105
|
+
if (text !== undefined && textFile !== undefined)
|
|
106
|
+
throw new errors_1.CliUsageError("Give --text or --text-file, not both.");
|
|
107
|
+
if (textFile !== undefined && !textFile.trim())
|
|
108
|
+
throw new errors_1.CliUsageError("--text-file takes a path, or - for standard input.");
|
|
109
|
+
const mine = values.mine;
|
|
110
|
+
const all = values.all;
|
|
111
|
+
const hasText = text !== undefined || textFile !== undefined;
|
|
112
|
+
if (mine && all)
|
|
113
|
+
throw new errors_1.CliUsageError("Give --mine or --all, not both.");
|
|
114
|
+
if ((mine || all) && !hasText)
|
|
115
|
+
throw new errors_1.CliUsageError(`${mine ? "--mine" : "--all"} says which text to replace; give the new text with --text or --text-file.`);
|
|
116
|
+
// Empty text is only "remove my part" -- an entry's whole text is never blanked by accident.
|
|
117
|
+
if (text !== undefined && !text.trim() && !mine) {
|
|
118
|
+
throw new errors_1.CliUsageError("--text must not be empty (with --mine, an empty --text removes your part).");
|
|
119
|
+
}
|
|
120
|
+
const title = values.title?.trim();
|
|
121
|
+
if (title !== undefined) {
|
|
122
|
+
if (!title)
|
|
123
|
+
throw new errors_1.CliUsageError("--title must not be empty.");
|
|
124
|
+
if (title.length > append_entry_1.MAX_TITLE_LENGTH)
|
|
125
|
+
throw new errors_1.CliUsageError(`--title is at most ${append_entry_1.MAX_TITLE_LENGTH} characters.`);
|
|
126
|
+
}
|
|
127
|
+
const rawTags = values.tag;
|
|
128
|
+
for (const t of rawTags ?? []) {
|
|
129
|
+
if (!t.trim())
|
|
130
|
+
throw new errors_1.CliUsageError("--tag must not be empty.");
|
|
131
|
+
if (t.trim().length > append_entry_1.MAX_TAG_LENGTH)
|
|
132
|
+
throw new errors_1.CliUsageError(`A --tag is at most ${append_entry_1.MAX_TAG_LENGTH} characters: "${t}".`);
|
|
133
|
+
}
|
|
134
|
+
const tags = rawTags ? (0, append_entry_1.normalizeTags)(rawTags) : undefined;
|
|
135
|
+
if (tags && tags.length > append_entry_1.MAX_TAGS)
|
|
136
|
+
throw new errors_1.CliUsageError(`At most ${append_entry_1.MAX_TAGS} tags per entry.`);
|
|
137
|
+
const mood = values.mood?.trim();
|
|
138
|
+
if (mood !== undefined) {
|
|
139
|
+
if (!mood)
|
|
140
|
+
throw new errors_1.CliUsageError(`--mood must not be empty (the app's are ${write_1.APP_MOODS.join(" ")}).`);
|
|
141
|
+
if (mood.length > append_entry_1.MAX_MOOD_LENGTH)
|
|
142
|
+
throw new errors_1.CliUsageError(`--mood is at most ${append_entry_1.MAX_MOOD_LENGTH} characters.`);
|
|
143
|
+
}
|
|
144
|
+
const location = values.location?.trim();
|
|
145
|
+
if (location !== undefined) {
|
|
146
|
+
if (!location)
|
|
147
|
+
throw new errors_1.CliUsageError("--location must not be empty.");
|
|
148
|
+
if (location.length > append_entry_1.MAX_LOCATION_LENGTH)
|
|
149
|
+
throw new errors_1.CliUsageError(`--location is at most ${append_entry_1.MAX_LOCATION_LENGTH} characters.`);
|
|
150
|
+
}
|
|
151
|
+
const rawLat = values.lat;
|
|
152
|
+
const rawLng = values.lng;
|
|
153
|
+
if ((rawLat === undefined) !== (rawLng === undefined))
|
|
154
|
+
throw new errors_1.CliUsageError("Give --lat and --lng together: a point needs both.");
|
|
155
|
+
const coordinates = rawLat !== undefined && rawLng !== undefined ? { lat: (0, write_1.degrees)(rawLat, "--lat", 90), lng: (0, write_1.degrees)(rawLng, "--lng", 180) } : undefined;
|
|
156
|
+
const images = values.image ?? [];
|
|
157
|
+
if (images.some((f) => !f.trim()))
|
|
158
|
+
throw new errors_1.CliUsageError("--image takes a file path.");
|
|
159
|
+
const removeImages = (values["remove-image"] ?? []).map((id) => id.trim().toLowerCase());
|
|
160
|
+
for (const id of removeImages) {
|
|
161
|
+
if (!UUID_RE.test(id))
|
|
162
|
+
throw new errors_1.CliUsageError(`--remove-image takes an image's id (\`whatcha read --json\` lists them as images), got "${id}".`);
|
|
163
|
+
}
|
|
164
|
+
const cover = values.cover;
|
|
165
|
+
if (cover !== undefined && !cover.trim())
|
|
166
|
+
throw new errors_1.CliUsageError("--cover takes a file path.");
|
|
167
|
+
const message = values.message?.trim();
|
|
168
|
+
if (message !== undefined && message.length > MAX_MESSAGE)
|
|
169
|
+
throw new errors_1.CliUsageError(`--message is at most ${MAX_MESSAGE} characters.`);
|
|
170
|
+
const changesSomething = hasText || title !== undefined || tags !== undefined || mood !== undefined || location !== undefined ||
|
|
171
|
+
coordinates !== undefined || images.length > 0 || removeImages.length > 0 || cover !== undefined;
|
|
172
|
+
if (!changesSomething)
|
|
173
|
+
throw new errors_1.CliUsageError(`Nothing to update -- give the text or a field to change.\nUsage: ${UPDATE_USAGE}`);
|
|
174
|
+
return {
|
|
175
|
+
action: "update",
|
|
176
|
+
json,
|
|
177
|
+
entryId,
|
|
178
|
+
...(text !== undefined ? { text } : {}),
|
|
179
|
+
...(textFile !== undefined ? { textFile } : {}),
|
|
180
|
+
mine,
|
|
181
|
+
all,
|
|
182
|
+
...(title !== undefined ? { title } : {}),
|
|
183
|
+
...(tags !== undefined ? { tags } : {}),
|
|
184
|
+
...(mood !== undefined ? { mood } : {}),
|
|
185
|
+
...(location !== undefined ? { location } : {}),
|
|
186
|
+
...(coordinates ? { coordinates } : {}),
|
|
187
|
+
images,
|
|
188
|
+
removeImages,
|
|
189
|
+
...(cover !== undefined ? { cover } : {}),
|
|
190
|
+
...(message ? { message } : {}),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
async function runEntry(opts, deps = {}) {
|
|
194
|
+
return opts.action === "update" ? runUpdate(opts, deps) : runDelete(opts, deps);
|
|
195
|
+
}
|
|
196
|
+
function concurrentSave(err) {
|
|
197
|
+
return new errors_1.CliUsageError("Someone else saved to this entry while whatcha was updating it. Nothing was overwritten -- " +
|
|
198
|
+
`run the same command again to retry. (${err.message})`);
|
|
199
|
+
}
|
|
200
|
+
async function readableEntry(client, entryId) {
|
|
201
|
+
try {
|
|
202
|
+
return await (0, entry_get_1.getEntry)(client, entryId);
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
if (err instanceof errors_1.ApiError && err.status === 404) {
|
|
206
|
+
throw new errors_1.CliUsageError(`No entry with id ${entryId} (it was deleted, or is not visible to you).`);
|
|
207
|
+
}
|
|
208
|
+
throw err;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function runUpdate(opts, deps) {
|
|
212
|
+
// Every local file is read and checked before anything is sent, so a wrong path changes nothing.
|
|
213
|
+
let text = opts.text;
|
|
214
|
+
if (opts.textFile !== undefined) {
|
|
215
|
+
text = await (0, write_1.readTextFile)(opts.textFile, deps.stdin);
|
|
216
|
+
if (!text.trim() && !opts.mine) {
|
|
217
|
+
throw new errors_1.CliUsageError(`${opts.textFile === "-" ? "Standard input" : opts.textFile} has no text.`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const images = [];
|
|
221
|
+
for (const path of opts.images)
|
|
222
|
+
images.push(await (0, image_upload_1.readImageFile)(path));
|
|
223
|
+
const coverFile = opts.cover !== undefined ? await (0, image_upload_1.readImageFile)(opts.cover) : undefined;
|
|
224
|
+
const client = deps.client ?? (await (0, session_1.authenticatedClient)()).client;
|
|
225
|
+
const entry = await readableEntry(client, opts.entryId);
|
|
226
|
+
if (entry.isLocked)
|
|
227
|
+
throw new errors_1.CliUsageError("This entry is locked (Time Capsule) and cannot be changed until it opens.");
|
|
228
|
+
let body = entry.body;
|
|
229
|
+
let textMode = null;
|
|
230
|
+
if (text !== undefined) {
|
|
231
|
+
const me = await (0, profile_family_1.currentProfile)(client);
|
|
232
|
+
const blame = await (0, entry_edit_1.getBlame)(client, entry.id, entry.headCommitId);
|
|
233
|
+
if (opts.mine) {
|
|
234
|
+
if (!(0, entry_edit_1.blameMatches)(blame, entry.body)) {
|
|
235
|
+
throw new errors_1.CliUsageError("This entry changed while whatcha was reading it. Nothing was changed -- run the command again.");
|
|
236
|
+
}
|
|
237
|
+
body = (0, entry_edit_1.replaceMyPart)(blame, me.id, text);
|
|
238
|
+
textMode = "mine";
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
const others = (0, entry_edit_1.otherWriters)(blame, me.id);
|
|
242
|
+
if (others.length > 0 && !opts.all) {
|
|
243
|
+
throw new errors_1.CliUsageError(`${others.join(", ")} also wrote in this entry. Nothing was changed. Use --mine to replace only ` +
|
|
244
|
+
"the part you wrote, or --all to replace the whole text, theirs included.");
|
|
245
|
+
}
|
|
246
|
+
body = text;
|
|
247
|
+
textMode = "all";
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Images: the entry's own, minus the ones taken off, then the new ones.
|
|
251
|
+
const current = (0, entry_get_1.entryMedia)(entry);
|
|
252
|
+
const missing = opts.removeImages.filter((id) => !current.some((m) => m.mediaAssetId.toLowerCase() === id));
|
|
253
|
+
if (missing.length > 0) {
|
|
254
|
+
throw new errors_1.CliUsageError(`This entry has no image ${missing.join(", ")} (\`whatcha read --json\` lists its images). Nothing was changed.`);
|
|
255
|
+
}
|
|
256
|
+
const kept = current.filter((m) => !opts.removeImages.includes(m.mediaAssetId.toLowerCase()));
|
|
257
|
+
if (kept.length + images.length > MAX_MEDIA)
|
|
258
|
+
throw new errors_1.CliUsageError(`An entry holds at most ${MAX_MEDIA} images. Nothing was changed.`);
|
|
259
|
+
// Into the diary's own group: an entry can only show media of its group.
|
|
260
|
+
const imageIds = [];
|
|
261
|
+
let coverId;
|
|
262
|
+
if (images.length > 0 || coverFile) {
|
|
263
|
+
const diary = await client.get(`/diaries/${entry.diaryId}`);
|
|
264
|
+
for (const image of images)
|
|
265
|
+
imageIds.push(await (0, image_upload_1.uploadImage)(client, diary.groupId, image));
|
|
266
|
+
if (coverFile)
|
|
267
|
+
coverId = await (0, image_upload_1.uploadImage)(client, diary.groupId, coverFile);
|
|
268
|
+
}
|
|
269
|
+
let header = (0, append_entry_1.headerOf)(entry);
|
|
270
|
+
if (opts.title !== undefined)
|
|
271
|
+
header = { ...header, title: opts.title };
|
|
272
|
+
if (opts.tags !== undefined)
|
|
273
|
+
header = { ...header, tags: opts.tags };
|
|
274
|
+
if (opts.mood !== undefined)
|
|
275
|
+
header = { ...header, mood: opts.mood };
|
|
276
|
+
if (opts.location !== undefined)
|
|
277
|
+
header = { ...header, location: opts.location };
|
|
278
|
+
if (opts.coordinates)
|
|
279
|
+
header = { ...header, locationLat: opts.coordinates.lat, locationLng: opts.coordinates.lng };
|
|
280
|
+
if (coverId)
|
|
281
|
+
header = { ...header, coverMediaAssetId: coverId };
|
|
282
|
+
const changesMedia = opts.removeImages.length > 0 || imageIds.length > 0;
|
|
283
|
+
const media = [...kept, ...imageIds.map((mediaAssetId) => ({ mediaAssetId }))];
|
|
284
|
+
// A `PATCH /entries` save writes the header from `content`, which has no
|
|
285
|
+
// field for the time range, so a range the entry has is saved again after.
|
|
286
|
+
const range = await (0, append_entry_1.readRange)(client, entry.diaryId, entry.id);
|
|
287
|
+
let headCommitId;
|
|
288
|
+
try {
|
|
289
|
+
const saved = await client.patch(`/entries/${entry.id}`, {
|
|
290
|
+
content: { body, ...header },
|
|
291
|
+
...(changesMedia ? { media } : {}),
|
|
292
|
+
expectedHeadCommitId: entry.headCommitId,
|
|
293
|
+
...(opts.message ? { commitMessage: opts.message } : {}),
|
|
294
|
+
});
|
|
295
|
+
headCommitId = saved.headCommitId;
|
|
296
|
+
}
|
|
297
|
+
catch (err) {
|
|
298
|
+
if (err instanceof errors_1.ApiError && err.status === 409)
|
|
299
|
+
throw concurrentSave(err);
|
|
300
|
+
throw err;
|
|
301
|
+
}
|
|
302
|
+
if (range)
|
|
303
|
+
headCommitId = await (0, append_entry_1.saveRange)(client, entry.diaryId, entry.id, range, headCommitId);
|
|
304
|
+
if (opts.json) {
|
|
305
|
+
(0, output_1.printJson)({
|
|
306
|
+
ok: true,
|
|
307
|
+
entryId: entry.id,
|
|
308
|
+
diaryId: entry.diaryId,
|
|
309
|
+
headCommitId,
|
|
310
|
+
text: textMode ?? "unchanged",
|
|
311
|
+
title: header.title,
|
|
312
|
+
tags: header.tags,
|
|
313
|
+
images: media.map((m) => m.mediaAssetId),
|
|
314
|
+
coverMediaAssetId: header.coverMediaAssetId ?? null,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
const what = textMode === "mine" ? "your part of the text" : textMode === "all" ? "the text" : "the entry";
|
|
319
|
+
(0, output_1.printLine)(`Updated ${what}${imageIds.length > 0 ? ` (+${imageIds.length} image${imageIds.length === 1 ? "" : "s"})` : ""}. entryId=${entry.id}`);
|
|
320
|
+
}
|
|
321
|
+
return { exitCode: 0 };
|
|
322
|
+
}
|
|
323
|
+
function askOnTerminal(question) {
|
|
324
|
+
return new Promise((resolve) => {
|
|
325
|
+
// On stderr, so `--json` stdout stays the one object it promises.
|
|
326
|
+
const rl = node_readline_1.default.createInterface({ input: process.stdin, output: process.stderr });
|
|
327
|
+
rl.question(question, (answer) => {
|
|
328
|
+
rl.close();
|
|
329
|
+
resolve(answer);
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
async function runDelete(opts, deps) {
|
|
334
|
+
const client = deps.client ?? (await (0, session_1.authenticatedClient)()).client;
|
|
335
|
+
const entry = await readableEntry(client, opts.entryId);
|
|
336
|
+
if (!opts.all) {
|
|
337
|
+
const me = await (0, profile_family_1.currentProfile)(client);
|
|
338
|
+
const others = (0, entry_edit_1.otherWriters)(await (0, entry_edit_1.getBlame)(client, entry.id, entry.headCommitId), me.id);
|
|
339
|
+
if (others.length > 0) {
|
|
340
|
+
throw new errors_1.CliUsageError(`${others.join(", ")} also wrote in this entry, so deleting it deletes their writing too. Nothing was deleted. ` +
|
|
341
|
+
`To take back only your part: whatcha entry update ${entry.id} --mine --text "". ` +
|
|
342
|
+
"To delete the whole entry anyway: add --all.");
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (!opts.yes) {
|
|
346
|
+
const isTTY = deps.isTTY ?? Boolean(process.stdin.isTTY && process.stderr.isTTY);
|
|
347
|
+
if (!isTTY) {
|
|
348
|
+
throw new errors_1.CliUsageError("Not deleting: there is no terminal to confirm at. Add --yes to delete without asking.");
|
|
349
|
+
}
|
|
350
|
+
const label = `${entry.occurredAt.slice(0, 10)}${entry.title ? ` "${entry.title}"` : ""}`;
|
|
351
|
+
const answer = await (deps.confirm ?? askOnTerminal)(`Delete the entry ${label} (${entry.id})? [y/N] `);
|
|
352
|
+
if (!/^y(es)?$/i.test(answer.trim())) {
|
|
353
|
+
if (opts.json)
|
|
354
|
+
(0, output_1.printJson)({ ok: true, entryId: entry.id, deleted: false });
|
|
355
|
+
else
|
|
356
|
+
(0, output_1.printErrorLine)("Not deleted.");
|
|
357
|
+
return { exitCode: 1 };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
await client.delete(`/entries/${entry.id}`);
|
|
361
|
+
if (opts.json)
|
|
362
|
+
(0, output_1.printJson)({ ok: true, entryId: entry.id, diaryId: entry.diaryId, deleted: true });
|
|
363
|
+
else
|
|
364
|
+
(0, output_1.printLine)(`Deleted the entry ${entry.id}.`);
|
|
365
|
+
return { exitCode: 0 };
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/commands/entry.ts"],"names":[],"mappings":";;;;;AA2FA,wCAoDC;AA0FD,4BAEC;AA3OD,kEAAqC;AACrC,yCAAsC;AACtC,6CAAsD;AACtD,sCAAoD;AAEpD,sDAU6B;AAC7B,kDAAwF;AACxF,gDAAwD;AACxD,sDAAkF;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