@crossworks/client-types 0.232.317 → 0.232.319
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 +87 -2
- package/src/dto/logins.ts +21 -0
- package/src/dto/rows.ts +9 -0
- package/src/index.ts +7 -0
package/package.json
CHANGED
package/src/dto/access.ts
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* The Access control's wire shapes (`/api/access/nodes/:id`). One level
|
|
3
3
|
* system: admin > team > client > public. A caller sees what is at or below
|
|
4
4
|
* its level. The level is the truth and the item's share link follows it:
|
|
5
|
-
* none at admin or team (members read team items with their own logins)
|
|
6
|
-
* open link at
|
|
5
|
+
* none at admin or team (members read team items with their own logins) or
|
|
6
|
+
* client (signed-in clients, client logins C1), an open link at public. See
|
|
7
|
+
* docs/access-levels.md.
|
|
7
8
|
*/
|
|
8
9
|
import type { ShareMode } from './rows';
|
|
9
10
|
|
|
@@ -92,3 +93,87 @@ export type AccessNodeUpdate = {
|
|
|
92
93
|
stillBelow?: AccessItemView[];
|
|
93
94
|
share: AccessLinkView | null;
|
|
94
95
|
};
|
|
96
|
+
|
|
97
|
+
// ── "What clients see" (client logins C1) ────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
/** A brain item a client-level item names but a client may not read: a
|
|
100
|
+
* mention chip, a link or an embed pointing at a team or admin item (or at
|
|
101
|
+
* something that is not the brain's). Its title reaches the client page as
|
|
102
|
+
* a label unless the client view hides it. */
|
|
103
|
+
export type ClientReportRef = {
|
|
104
|
+
id: string;
|
|
105
|
+
/** Null when the id names nothing the brain holds any more. */
|
|
106
|
+
type: string | null;
|
|
107
|
+
title: string | null;
|
|
108
|
+
/** The item's level; null when it is not a brain item (a personal item,
|
|
109
|
+
* or gone). */
|
|
110
|
+
audience: AccessLevel | null;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** One item at client level, as the report lists it. */
|
|
114
|
+
export type ClientReportItem = {
|
|
115
|
+
id: string;
|
|
116
|
+
type: string;
|
|
117
|
+
title: string;
|
|
118
|
+
updatedAt: string;
|
|
119
|
+
/** Its live open link, made when client meant "anyone with the link":
|
|
120
|
+
* still live until the old client links are retired. Null: none. */
|
|
121
|
+
link: {
|
|
122
|
+
id: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
viewCount: number;
|
|
125
|
+
lastViewedAt: string | null;
|
|
126
|
+
expiresAt: string | null;
|
|
127
|
+
} | null;
|
|
128
|
+
/** Addresses a page was emailed to with the page tool (invite hints). */
|
|
129
|
+
emailedTo: string[];
|
|
130
|
+
/** What it names that a client may not read (see ClientReportRef). */
|
|
131
|
+
refsAbove: ClientReportRef[];
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** The newest acknowledgement of the report. */
|
|
135
|
+
export type ClientReportAck = {
|
|
136
|
+
ackedAt: string;
|
|
137
|
+
/** The admin who acknowledged it (null: that login is gone). */
|
|
138
|
+
ackedBy: { id: string; name: string } | null;
|
|
139
|
+
/** How many client-level items the admin saw. */
|
|
140
|
+
itemCount: number;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
/** GET /api/access/client-report: every item at client level, what each
|
|
144
|
+
* carries, and whether an admin has acknowledged the list. Adding a client
|
|
145
|
+
* login stays disabled until `acknowledged` (client logins C2). */
|
|
146
|
+
export type ClientReport = {
|
|
147
|
+
items: ClientReportItem[];
|
|
148
|
+
/** All client-level items (the list stops at 2000). */
|
|
149
|
+
total: number;
|
|
150
|
+
acknowledgement: ClientReportAck | null;
|
|
151
|
+
/** An admin acknowledged the report and nothing has gone to client since. */
|
|
152
|
+
acknowledged: boolean;
|
|
153
|
+
/** Client-level items the newest acknowledgement did not include. */
|
|
154
|
+
newSinceAck: string[];
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/** POST /api/access/client-report/ack { itemIds } -> the acknowledgement.
|
|
158
|
+
* `itemIds`: the client-level items the admin saw on the report. */
|
|
159
|
+
export type ClientReportAckResponse = { acknowledgement: ClientReportAck; acknowledged: boolean };
|
|
160
|
+
|
|
161
|
+
/** GET /api/shares/all -> { shares: SharedLinkRow[] }: every live link,
|
|
162
|
+
* newest first. */
|
|
163
|
+
export type SharedLinkRow = {
|
|
164
|
+
id: string;
|
|
165
|
+
/** Server-relative: `/s/<token>`. */
|
|
166
|
+
path: string;
|
|
167
|
+
nodeId: string;
|
|
168
|
+
nodeType: string;
|
|
169
|
+
title: string;
|
|
170
|
+
icon: string | null;
|
|
171
|
+
mode: ShareMode;
|
|
172
|
+
cascade: boolean;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
viewCount: number;
|
|
175
|
+
lastViewedAt: string | null;
|
|
176
|
+
/** The item's level (client logins C1): `client` marks an old link, from
|
|
177
|
+
* when client meant an open link. Absent from brains before C1. */
|
|
178
|
+
level?: AccessLevel;
|
|
179
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Login roles on the wire (client logins, Phase C0). Three roles: an admin,
|
|
3
|
+
* a member (the team) and a client (a person at the brain's one client
|
|
4
|
+
* company). A route that is not for the caller's role answers 403 with one
|
|
5
|
+
* of the reasons below; a client never falls through to an admin answer.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** Who a login is. The brain reads it from the login row on every request. */
|
|
9
|
+
export type LoginKind = 'admin' | 'member' | 'client';
|
|
10
|
+
|
|
11
|
+
/** The `reason` of a 403 a gate answers a login of the wrong role with:
|
|
12
|
+
* `member-login` from an admin route, `admin-login` from a member route,
|
|
13
|
+
* `client-login` from any route that is not a client route. */
|
|
14
|
+
export type LoginRefusedReason = 'member-login' | 'admin-login' | 'client-login';
|
|
15
|
+
|
|
16
|
+
/** The body of that 403. */
|
|
17
|
+
export type LoginRefused = {
|
|
18
|
+
error: 'forbidden';
|
|
19
|
+
reason: LoginRefusedReason;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
package/src/dto/rows.ts
CHANGED
|
@@ -815,6 +815,15 @@ export interface OnboardingModelChoices {
|
|
|
815
815
|
*/
|
|
816
816
|
export type ShareMode = 'public';
|
|
817
817
|
|
|
818
|
+
/**
|
|
819
|
+
* Why a link was refused (the `reason` of a 400 from the share routes):
|
|
820
|
+
* `team-links-retired` for a team link (member logins Phase 6), and
|
|
821
|
+
* `client-links-retired` for any link on an item at client level (client
|
|
822
|
+
* logins C1): client means signed-in clients, and public is the only level
|
|
823
|
+
* with an open link.
|
|
824
|
+
*/
|
|
825
|
+
export type ShareRetiredReason = 'team-links-retired' | 'client-links-retired';
|
|
826
|
+
|
|
818
827
|
export type TeamVisibleShare = {
|
|
819
828
|
/** Share token — the workspace opens /s/<token>. */
|
|
820
829
|
token: string;
|
package/src/index.ts
CHANGED
|
@@ -40,7 +40,13 @@ export type {
|
|
|
40
40
|
AccessLoweredView,
|
|
41
41
|
AccessNodeUpdate,
|
|
42
42
|
AccessNodeView,
|
|
43
|
+
ClientReport,
|
|
44
|
+
ClientReportAck,
|
|
45
|
+
ClientReportAckResponse,
|
|
46
|
+
ClientReportItem,
|
|
47
|
+
ClientReportRef,
|
|
43
48
|
MemberItemAuthor,
|
|
49
|
+
SharedLinkRow,
|
|
44
50
|
} from './dto/access';
|
|
45
51
|
export type {
|
|
46
52
|
AdminSpaceItem,
|
|
@@ -89,6 +95,7 @@ export type {
|
|
|
89
95
|
MemberInviteState,
|
|
90
96
|
} from './dto/member-invites';
|
|
91
97
|
export type { MemberItemKind } from './member-kinds';
|
|
98
|
+
export type { LoginKind, LoginRefused, LoginRefusedReason } from './dto/logins';
|
|
92
99
|
|
|
93
100
|
// Types only at the root; the runtime constants (APP_TINTS, limits) are the
|
|
94
101
|
// `@mantle/client-types/app-nav` subpath.
|