@crossworks/client-types 0.232.258 → 0.232.259

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.232.258",
3
+ "version": "0.232.259",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The member API's wire shapes (member logins, Phase 1): what a MEMBER login's
3
+ * client reads from /api/member/*. A member reads team-level items only (the
4
+ * brain enforces it with row security) and chats with the team-level agent in
5
+ * its own thread.
6
+ */
7
+ import type { AccessLevel } from './access';
8
+
9
+ /** GET /api/member/shell */
10
+ export type MemberShell = {
11
+ role: 'member';
12
+ loginId: string;
13
+ displayName: string | null;
14
+ email: string;
15
+ avatar: { style: string; seed: string; parts: unknown } | null;
16
+ avatarPhotoVersion: string | null;
17
+ /** Append as `?at=` to /api/member/files/* and /api/member/draws/* srcs. */
18
+ assetToken: string;
19
+ siteName: string | null;
20
+ colorTheme: string | null;
21
+ fontLogo: string | null;
22
+ fontTitle: string | null;
23
+ fontUi: string | null;
24
+ fontProse: string | null;
25
+ fontSize: string | null;
26
+ fontLogoSize: string | null;
27
+ fontTitleSize: string | null;
28
+ fontProseSize: string | null;
29
+ logoVersion: string | null;
30
+ logoDarkVersion: string | null;
31
+ };
32
+
33
+ export type MemberLibraryKind = 'page' | 'note' | 'draw' | 'table' | 'file';
34
+
35
+ export type MemberLibraryRow = {
36
+ id: string;
37
+ type: MemberLibraryKind;
38
+ title: string;
39
+ icon: string | null;
40
+ summary: string | null;
41
+ audience: AccessLevel;
42
+ updatedAt: string;
43
+ };
44
+
45
+ /** GET /api/member/library?kind=&q=&page= */
46
+ export type MemberLibraryPage = {
47
+ items: MemberLibraryRow[];
48
+ total: number;
49
+ page: number;
50
+ pageSize: number;
51
+ };
52
+
53
+ /** GET /api/member/library/:id -> { item } */
54
+ export type MemberLibraryItem =
55
+ | (MemberLibraryRow & { type: 'page'; doc: unknown })
56
+ | (MemberLibraryRow & { type: 'note'; content: string })
57
+ | (MemberLibraryRow & { type: 'table'; table: unknown })
58
+ | (MemberLibraryRow & { type: 'draw' })
59
+ | (MemberLibraryRow & {
60
+ type: 'file';
61
+ filename: string;
62
+ mimeType: string | null;
63
+ sizeBytes: number | null;
64
+ });
65
+
66
+ export type MemberChatMessage = {
67
+ id: string;
68
+ direction: 'inbound' | 'outbound';
69
+ text: string;
70
+ status: 'pending' | 'complete' | 'failed';
71
+ failed: boolean;
72
+ createdAt: string;
73
+ };
74
+
75
+ /** GET /api/member/chat. `agent` null = chat not open yet (no team-level agent). */
76
+ export type MemberChatThread = {
77
+ agent: { slug: string; name: string } | null;
78
+ messages: MemberChatMessage[];
79
+ };
package/src/index.ts CHANGED
@@ -40,6 +40,15 @@ export type {
40
40
  AccessNodeUpdate,
41
41
  AccessNodeView,
42
42
  } from './dto/access';
43
+ export type {
44
+ MemberChatMessage,
45
+ MemberChatThread,
46
+ MemberLibraryItem,
47
+ MemberLibraryKind,
48
+ MemberLibraryPage,
49
+ MemberLibraryRow,
50
+ MemberShell,
51
+ } from './dto/member';
43
52
 
44
53
  // Types only at the root; the runtime constants (APP_TINTS, limits) are the
45
54
  // `@mantle/client-types/app-nav` subpath.