@crossworks/client-types 0.232.288 → 0.232.289
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/member-apps.ts +83 -0
- package/src/index.ts +10 -0
package/package.json
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apps for members (member logins Phase 4b): what a MEMBER login's client
|
|
3
|
+
* reads from /api/member/apps and /api/member/home, plus the admin's view of
|
|
4
|
+
* member chats (/api/team-admin/member-chats). A member RUNS apps at team
|
|
5
|
+
* level or lower with a green published build; it never creates, edits or
|
|
6
|
+
* shares one.
|
|
7
|
+
*/
|
|
8
|
+
import type { AppTint } from '../app-nav';
|
|
9
|
+
import type { AccessLevel } from './access';
|
|
10
|
+
|
|
11
|
+
/** The app levels a member may run: team and below (never admin). */
|
|
12
|
+
export type MemberAppLevel = Exclude<AccessLevel, 'admin'>;
|
|
13
|
+
|
|
14
|
+
/** One launcher card (GET /api/member/apps). */
|
|
15
|
+
export type MemberAppCard = {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
icon: string | null;
|
|
19
|
+
color: AppTint | null;
|
|
20
|
+
description: string | null;
|
|
21
|
+
audience: MemberAppLevel;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** GET /api/member/apps: the apps a member may run, by title, and the
|
|
26
|
+
* brain's home app when a member may run it (else null). */
|
|
27
|
+
export type MemberAppList = { apps: MemberAppCard[]; homeAppId: string | null };
|
|
28
|
+
|
|
29
|
+
/** The brain's pinned home app, when a member may run it. */
|
|
30
|
+
export type MemberHomeApp = {
|
|
31
|
+
appId: string;
|
|
32
|
+
title: string;
|
|
33
|
+
icon: string | null;
|
|
34
|
+
color: AppTint | null;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* GET /api/member/home: the pinned home app (null = the built-in home, and
|
|
39
|
+
* then `hub` is null too) and what its `host.hub.get()` answers. A section's
|
|
40
|
+
* token is a page id; an app card's token is an app id.
|
|
41
|
+
*
|
|
42
|
+
* `THub` is the hub payload, `HubData` from
|
|
43
|
+
* `@mantle/share-ui/app-bridge-protocol`. The contract leaves it to the
|
|
44
|
+
* client (share-ui depends on this package, so it cannot be named here):
|
|
45
|
+
* write `MemberHomeData<HubData>`.
|
|
46
|
+
*/
|
|
47
|
+
export type MemberHomeData<THub = unknown> =
|
|
48
|
+
{ homeApp: MemberHomeApp; hub: THub } | { homeApp: null; hub: null };
|
|
49
|
+
|
|
50
|
+
// ── Admin: member chats ──────────────────────────────────────────────────
|
|
51
|
+
|
|
52
|
+
/** GET /api/team-admin/member-chats: one member login and its chat. */
|
|
53
|
+
export type MemberChatRow = {
|
|
54
|
+
loginId: string;
|
|
55
|
+
/** Display name, else the part of the email before the @. */
|
|
56
|
+
name: string;
|
|
57
|
+
email: string;
|
|
58
|
+
/** False when the login is disabled or no longer a member (its old
|
|
59
|
+
* thread still shows). */
|
|
60
|
+
active: boolean;
|
|
61
|
+
lastMessageAt: string | null;
|
|
62
|
+
lastMessageText: string | null;
|
|
63
|
+
lastMessageDirection: 'inbound' | 'outbound' | null;
|
|
64
|
+
messageCount: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** One message of a member's thread, as the admin reads it. */
|
|
68
|
+
export type MemberChatArchiveMessage = {
|
|
69
|
+
id: string;
|
|
70
|
+
direction: 'inbound' | 'outbound';
|
|
71
|
+
text: string;
|
|
72
|
+
status: 'pending' | 'complete' | 'failed';
|
|
73
|
+
error: string | null;
|
|
74
|
+
traceId: string | null;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/** GET /api/team-admin/member-chats?login=&before= : every member login, and
|
|
79
|
+
* a window of the selected login's thread (null when there is no login). */
|
|
80
|
+
export type MemberChatsResponse = {
|
|
81
|
+
members: MemberChatRow[];
|
|
82
|
+
selected: { loginId: string; thread: MemberChatArchiveMessage[]; windowSize: number } | null;
|
|
83
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -60,6 +60,16 @@ export type {
|
|
|
60
60
|
MemberSpaceList,
|
|
61
61
|
MemberSpaceSharing,
|
|
62
62
|
} from './dto/member';
|
|
63
|
+
export type {
|
|
64
|
+
MemberAppCard,
|
|
65
|
+
MemberAppLevel,
|
|
66
|
+
MemberAppList,
|
|
67
|
+
MemberChatArchiveMessage,
|
|
68
|
+
MemberChatRow,
|
|
69
|
+
MemberChatsResponse,
|
|
70
|
+
MemberHomeApp,
|
|
71
|
+
MemberHomeData,
|
|
72
|
+
} from './dto/member-apps';
|
|
63
73
|
export type { MemberItemKind } from './member-kinds';
|
|
64
74
|
|
|
65
75
|
// Types only at the root; the runtime constants (APP_TINTS, limits) are the
|