@crossworks/client-types 0.232.321 → 0.232.323
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/package.json +1 -1
- package/src/dto/access.ts +36 -3
- package/src/dto/logins.ts +9 -0
- package/src/dto/review.ts +55 -0
- package/src/index.ts +14 -1
package/package.json
CHANGED
package/src/dto/access.ts
CHANGED
|
@@ -60,6 +60,13 @@ export type AccessNodeView = {
|
|
|
60
60
|
/** Set when a member wrote it and an admin accepted it into the brain (the
|
|
61
61
|
* member-authored badge). Absent from brains before 0.232.285. */
|
|
62
62
|
author?: MemberItemAuthor | null;
|
|
63
|
+
/** Levels at which this brain makes a NEW open link (client logins C1:
|
|
64
|
+
* ['public']). Absent on brains before C1: the client then uses the old
|
|
65
|
+
* copy (Client = open link). */
|
|
66
|
+
openLinkLevels?: AccessLevel[];
|
|
67
|
+
/** Old live links above this item (see ClientOldLinkAbove); only for an
|
|
68
|
+
* item at client. */
|
|
69
|
+
oldLinksAbove?: ClientOldLinkAbove[];
|
|
63
70
|
};
|
|
64
71
|
|
|
65
72
|
/** One item that went down with the item that embeds it. */
|
|
@@ -96,13 +103,27 @@ export type AccessNodeUpdate = {
|
|
|
96
103
|
|
|
97
104
|
// ── "What clients see" (client logins C1) ────────────────────────────────────
|
|
98
105
|
|
|
106
|
+
/** A live open link on something ABOVE a client-level item (a folder that
|
|
107
|
+
* holds it, or a client page that embeds it): made when client meant
|
|
108
|
+
* "anyone with the link", still live until old client links retire.
|
|
109
|
+
* Anyone with that link can open this item. */
|
|
110
|
+
export type ClientOldLinkAbove = {
|
|
111
|
+
shareId: string;
|
|
112
|
+
/** The folder or page that carries the link. */
|
|
113
|
+
nodeId: string;
|
|
114
|
+
title: string;
|
|
115
|
+
type: string;
|
|
116
|
+
via: 'folder' | 'page';
|
|
117
|
+
};
|
|
118
|
+
|
|
99
119
|
/** A brain item a client-level item names but a client may not read: a
|
|
100
120
|
* mention chip, a link or an embed pointing at a team or admin item (or at
|
|
101
121
|
* something that is not the brain's). Its title reaches the client page as
|
|
102
122
|
* a label unless the client view hides it. */
|
|
103
123
|
export type ClientReportRef = {
|
|
104
124
|
id: string;
|
|
105
|
-
/** Null when the id names nothing the brain holds
|
|
125
|
+
/** Null when the id names nothing the brain holds: gone, or an item that
|
|
126
|
+
* is not the brain's (a personal item), whose title is never shown. */
|
|
106
127
|
type: string | null;
|
|
107
128
|
title: string | null;
|
|
108
129
|
/** The item's level; null when it is not a brain item (a personal item,
|
|
@@ -129,6 +150,10 @@ export type ClientReportItem = {
|
|
|
129
150
|
emailedTo: string[];
|
|
130
151
|
/** What it names that a client may not read (see ClientReportRef). */
|
|
131
152
|
refsAbove: ClientReportRef[];
|
|
153
|
+
/** Live old links on a folder that holds it or a client page that embeds
|
|
154
|
+
* it: anyone with one of those links can open this item. Absent from
|
|
155
|
+
* brains before the audit fixes. */
|
|
156
|
+
oldLinksAbove?: ClientOldLinkAbove[];
|
|
132
157
|
};
|
|
133
158
|
|
|
134
159
|
/** The newest acknowledgement of the report. */
|
|
@@ -152,10 +177,18 @@ export type ClientReport = {
|
|
|
152
177
|
acknowledged: boolean;
|
|
153
178
|
/** Client-level items the newest acknowledgement did not include. */
|
|
154
179
|
newSinceAck: string[];
|
|
180
|
+
/** sha256 hex of every current client-level item id (sorted, joined by
|
|
181
|
+
* ','), the WHOLE set, not the 2000 shown. Send it back to acknowledge.
|
|
182
|
+
* Absent from brains before the audit fixes. */
|
|
183
|
+
fingerprint?: string;
|
|
155
184
|
};
|
|
156
185
|
|
|
157
|
-
/** POST /api/access/client-report/ack {
|
|
158
|
-
*
|
|
186
|
+
/** POST /api/access/client-report/ack { fingerprint } (preferred) or
|
|
187
|
+
* { itemIds } (old) -> the acknowledgement. With a fingerprint the server
|
|
188
|
+
* recomputes it: equal records every current client-level item, different
|
|
189
|
+
* answers 409 { error: 'conflict', reason: 'report-changed', message } and
|
|
190
|
+
* the client reloads the report. `itemIds`: the client-level items the
|
|
191
|
+
* admin saw on the report. */
|
|
159
192
|
export type ClientReportAckResponse = { acknowledgement: ClientReportAck; acknowledged: boolean };
|
|
160
193
|
|
|
161
194
|
/** GET /api/shares/all -> { shares: SharedLinkRow[] }: every live link,
|
package/src/dto/logins.ts
CHANGED
|
@@ -19,3 +19,12 @@ export type LoginRefused = {
|
|
|
19
19
|
reason: LoginRefusedReason;
|
|
20
20
|
message: string;
|
|
21
21
|
};
|
|
22
|
+
|
|
23
|
+
/** The 400 POST /api/users/:id/password answers when the target does not sign
|
|
24
|
+
* in with a password: a client (a link or a code) or a role this brain does
|
|
25
|
+
* not know. An admin's or a member's password can be reset. */
|
|
26
|
+
export type PasswordResetRefused = {
|
|
27
|
+
error: string;
|
|
28
|
+
reason: 'not-a-password-login';
|
|
29
|
+
message: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Member review, the admin side (`/api/team-admin/submissions/*` and the
|
|
3
|
+
* admin's own Accept, `/api/admin/space/:id/accept`): the fields client
|
|
4
|
+
* logins added (C1, audit A28). Additive only: every field is optional on
|
|
5
|
+
* the wire, so an older brain or an older client keeps working.
|
|
6
|
+
*/
|
|
7
|
+
import type { AccessItemView, AccessLevel } from './access';
|
|
8
|
+
|
|
9
|
+
/** Who wrote a reviewable item: a member or a client login. */
|
|
10
|
+
export type ReviewAuthorRole = 'member' | 'client';
|
|
11
|
+
|
|
12
|
+
/** GET /api/team-admin/submissions: a queue row's `author`. */
|
|
13
|
+
export type ReviewAuthorView = {
|
|
14
|
+
loginId: string | null;
|
|
15
|
+
name: string;
|
|
16
|
+
email: string | null;
|
|
17
|
+
/** Deactivated, or the login is gone. */
|
|
18
|
+
inactive: boolean;
|
|
19
|
+
/** Member or client; null when the login is gone. Absent on brains
|
|
20
|
+
* before client logins C1. */
|
|
21
|
+
role?: ReviewAuthorRole | null;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** GET /api/team-admin/submissions/:id/bundle: what Accept would move. */
|
|
25
|
+
export type AcceptPreview = {
|
|
26
|
+
items: { id: string; type: string; title: string }[];
|
|
27
|
+
linksStayingBehind: number;
|
|
28
|
+
/** Brain items in the embed closure of what Accept moves in, with their
|
|
29
|
+
* CURRENT level. The client shows the ones above the chosen level: they
|
|
30
|
+
* go DOWN with it and need a tick. */
|
|
31
|
+
closure?: AccessItemView[];
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** POST /api/team-admin/submissions/:id/accept and
|
|
35
|
+
* POST /api/admin/space/:id/accept. */
|
|
36
|
+
export type AcceptRequest = {
|
|
37
|
+
audience?: AccessLevel;
|
|
38
|
+
parentPageId?: string | null;
|
|
39
|
+
folderPath?: string | null;
|
|
40
|
+
/** A client's item at client or public: the admin confirmed the level. */
|
|
41
|
+
lowerConfirmed?: boolean;
|
|
42
|
+
/** Ids of closure items the admin ticked (with `lowerConfirmed: true`).
|
|
43
|
+
* For a client's item at client or public every closure item that goes
|
|
44
|
+
* down must be here. */
|
|
45
|
+
confirmedIds?: string[];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** 409 from either Accept: a client's item at client or public without the
|
|
49
|
+
* confirmation, or with a closure item that goes down not ticked. */
|
|
50
|
+
export type AcceptConfirmLevelRefusal = {
|
|
51
|
+
error: string;
|
|
52
|
+
reason: 'confirm-level';
|
|
53
|
+
/** The brain items that would go down with it (tick each one). */
|
|
54
|
+
goingDown?: AccessItemView[];
|
|
55
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export type {
|
|
|
40
40
|
AccessLoweredView,
|
|
41
41
|
AccessNodeUpdate,
|
|
42
42
|
AccessNodeView,
|
|
43
|
+
ClientOldLinkAbove,
|
|
43
44
|
ClientReport,
|
|
44
45
|
ClientReportAck,
|
|
45
46
|
ClientReportAckResponse,
|
|
@@ -48,6 +49,13 @@ export type {
|
|
|
48
49
|
MemberItemAuthor,
|
|
49
50
|
SharedLinkRow,
|
|
50
51
|
} from './dto/access';
|
|
52
|
+
export type {
|
|
53
|
+
AcceptConfirmLevelRefusal,
|
|
54
|
+
AcceptPreview,
|
|
55
|
+
AcceptRequest,
|
|
56
|
+
ReviewAuthorRole,
|
|
57
|
+
ReviewAuthorView,
|
|
58
|
+
} from './dto/review';
|
|
51
59
|
export type {
|
|
52
60
|
AdminSpaceItem,
|
|
53
61
|
AdminSpaceItemRow,
|
|
@@ -95,7 +103,12 @@ export type {
|
|
|
95
103
|
MemberInviteState,
|
|
96
104
|
} from './dto/member-invites';
|
|
97
105
|
export type { MemberItemKind } from './member-kinds';
|
|
98
|
-
export type {
|
|
106
|
+
export type {
|
|
107
|
+
LoginKind,
|
|
108
|
+
LoginRefused,
|
|
109
|
+
LoginRefusedReason,
|
|
110
|
+
PasswordResetRefused,
|
|
111
|
+
} from './dto/logins';
|
|
99
112
|
export type {
|
|
100
113
|
ClientAdminRefusedReason,
|
|
101
114
|
ClientLinkSignIn,
|