The server Activity and notifications
Activity and notifications
On this page
What is kept
Made, uploaded, a new version, renamed, moved, put in the trash and back, deleted, shared and no longer, a link made and taken back, a colour given; who, and when.
The details of a file have its Activity, and of a folder what was done right inside it too (GET /entries/:id/activity, client.activity); an assistant reads it with get_activity.
In code
import { activityOf } from '@rebofiles/core';
activityOf(before, after, 'ana', new Date().toISOString());
// [{ action: 'renamed', name: 'final.docx', was: 'draft.docx', by: 'ana', at, entry, parent }]Telling people
Beside Shared with me the drive counts what is new. To tell the person yourself, give the server onShare.
createDriveHandler({
...options,
// Once the share is kept; a failure here is not the request's.
onShare: async ({ entry, with: who, role, by, first }) => {
if (first) await mail(who, `${by.id} shared “${entry.name}” with you as ${role}`);
},
});Told in the drive
What is shared with a person, or with a group they are in, and a comment that names them: in the bell over the drive, how many are new beside it, each opening where it is.
const { notifications, unseen } = await client.notifications();
// [{ kind: 'shared', entry, name: 'Budget', by: 'ana', role: 'editor', at }, { kind: 'mentioned', text, … }]
await client.sawNotifications(); // none is new any moreKept for each person and each group (inbox:<who>), the last two hundred; looked at, none is new (POST /notifications/seen). What one did oneself is not told. A mail is still yours to send, with onShare and onComment.
The whole drive
For who may configure the drive, Settings → People: the files, folders and space of each person and of the whole drive, and the latest activity anywhere in it.
// For who may 'configure': what each keeps, and what was done anywhere.
const { people, total, quota } = await client.adminUsage(); // GET /admin/usage
const latest = await client.adminActivity(100); // GET /admin/activityThe space of each is reckoned from the whole drive, read once each time it is asked: for who looks after it, now and then, not for every page.
What to know
A change is kept without its line if the store fails to write the activity: the change is the drive, the line is beside it.