clavarium 0.2.218-beta.1 → 0.2.219-beta.1
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/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/server/agenda.mjs +6 -0
- package/server/contactview.mjs +2 -1
- package/server/mailview.mjs +2 -1
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavarium",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.219-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "clavarium",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.219-beta.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@xterm/addon-fit": "^0.11.0",
|
package/package.json
CHANGED
package/server/agenda.mjs
CHANGED
|
@@ -78,6 +78,11 @@ export const NOTES_MAX = 2000;
|
|
|
78
78
|
const notesOf = (v) => String(v ?? '').replace(/[\u0000-\u0008\u000b-\u001f\u007f]/g, '').replace(/\n{3,}/g, '\n\n').trim().slice(0, NOTES_MAX);
|
|
79
79
|
const SHOW = { busy: 'busy', free: 'free', tentative: 'tentative', oof: 'away', away: 'away', workingelsewhere: 'elsewhere', elsewhere: 'elsewhere' };
|
|
80
80
|
|
|
81
|
+
/* WHAT TETHER HANDED AS DATA, where its keeper puts it: a person's read answers { ok, text, data: { size, ...the
|
|
82
|
+
connector's own fields } }, so a connector's `data` arrives one level down (data.data). Both are read (16-11: the
|
|
83
|
+
panels read only the top level, and fell back to the text lines: no invitation text, no link, no organizer). */
|
|
84
|
+
export const handed = (got) => (got?.data?.data && typeof got.data.data === 'object' && !Array.isArray(got.data.data) ? { ...got, data: got.data.data } : got);
|
|
85
|
+
|
|
81
86
|
/* One event Tether handed as data, kept to the fields the page shows. */
|
|
82
87
|
export function eventOf(e) {
|
|
83
88
|
const start = timeOf(e?.start);
|
|
@@ -122,6 +127,7 @@ export async function readAgenda(tethers, { target, from, to } = {}, { who, zone
|
|
|
122
127
|
finally { clearTimeout(timer); }
|
|
123
128
|
if (got === null) throw refused(504, 'late', `${t.title} did not answer in time. Try again.`);
|
|
124
129
|
if (!got?.ok) throw refused(502, 'unreachable', `${t.title} could not be read: ${line(got?.text, 300) || 'no answer'}.`);
|
|
130
|
+
got = handed(got);
|
|
125
131
|
const given = Array.isArray(got.data?.events);
|
|
126
132
|
const all = (given ? got.data.events.map(eventOf).filter(Boolean) : eventsOfText(got.text))
|
|
127
133
|
.sort((a, b) => a.start.localeCompare(b.start));
|
package/server/contactview.mjs
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* A Tether that hands its contacts as data (`data.contacts`, `data.contact`: the fields below) gives them all; one that
|
|
14
14
|
* gives only its text lines (0.1.0-next.69) gives name, emails and phones in one line, no company: `partial`. */
|
|
15
15
|
import { Refusal } from './conversations.mjs';
|
|
16
|
+
import { handed } from './agenda.mjs';
|
|
16
17
|
import { READ_MS } from './mailview.mjs';
|
|
17
18
|
|
|
18
19
|
export const CONTACTS_MAX = 200;
|
|
@@ -37,7 +38,7 @@ async function asked(tethers, t, verb, args, who, wait) {
|
|
|
37
38
|
finally { clearTimeout(timer); }
|
|
38
39
|
if (got === null) throw refused(504, 'late', `${t.title} did not answer in time. Try again.`);
|
|
39
40
|
if (!got?.ok) throw refused(/no such contact/.test(String(got?.text)) ? 404 : 502, 'unreachable', `${t.title} could not be read: ${line(got?.text, 300) || 'no answer'}.`);
|
|
40
|
-
return got;
|
|
41
|
+
return handed(got);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/* One contact Tether handed as data, kept to what the list shows. */
|
package/server/mailview.mjs
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* that gives only its text lines (0.1.0-next.69) gives who, subject, date, and no unread or attachment mark: the
|
|
22
22
|
* answer says `partial`. */
|
|
23
23
|
import { Refusal } from './conversations.mjs';
|
|
24
|
+
import { handed } from './agenda.mjs';
|
|
24
25
|
|
|
25
26
|
export const MESSAGES_MAX = 25;
|
|
26
27
|
export const READ_MS = 30_000;
|
|
@@ -129,7 +130,7 @@ async function asked(tethers, t, verb, args, who, wait) {
|
|
|
129
130
|
finally { clearTimeout(timer); }
|
|
130
131
|
if (got === null) throw refused(504, 'late', `${t.title} did not answer in time. Try again.`);
|
|
131
132
|
if (!got?.ok) throw refused(got?.code === 'gone' ? 404 : 502, got?.code === 'gone' ? 'gone' : 'unreachable', `${t.title} could not be read: ${line(got?.text, 300) || 'no answer'}.`);
|
|
132
|
-
return got;
|
|
133
|
+
return handed(got);
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
/* THE LATEST MESSAGES OF A MAILBOX TARGET, or those matching `text`, read now. `who`: { id, name }, said in Tether's
|