@crossworks/client-types 0.232.290 → 0.232.292

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.290",
3
+ "version": "0.232.292",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -75,9 +75,31 @@ export type MemberChatArchiveMessage = {
75
75
  createdAt: string;
76
76
  };
77
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). */
78
+ /** The selected login's OLD team portal chat (member logins Phase 6): the
79
+ * thread its contact had with the team code before the invite made it a
80
+ * login. History only, for the admin: never part of the member's live
81
+ * thread, never shown to the member, never in the agent's context. Show it
82
+ * apart from `thread`, labelled as the portal history. */
83
+ export type MemberChatPortalThread = {
84
+ /** The contact the login was invited from. */
85
+ contactId: string;
86
+ /** A window, ascending; `portalBefore` pages older. */
87
+ thread: MemberChatArchiveMessage[];
88
+ windowSize: number;
89
+ };
90
+
91
+ /** GET /api/team-admin/member-chats?login=&before=&portalBefore= : every
92
+ * member login, and a window of the selected login's thread (null when
93
+ * there is no login). */
80
94
  export type MemberChatsResponse = {
81
95
  members: MemberChatRow[];
82
- selected: { loginId: string; thread: MemberChatArchiveMessage[]; windowSize: number } | null;
96
+ selected: {
97
+ loginId: string;
98
+ thread: MemberChatArchiveMessage[];
99
+ windowSize: number;
100
+ /** The login's old portal chat, separate from `thread`. Null (or absent,
101
+ * from an older brain) when the login has no contact or the contact
102
+ * never chatted on the portal. */
103
+ portalThread?: MemberChatPortalThread | null;
104
+ } | null;
83
105
  };
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Member invites (member logins Phase 6): an admin invites a person, who
3
+ * opens the invite link, sets a password and becomes a MEMBER login.
4
+ *
5
+ * Admin: /api/team-admin/invites (create, list, revoke). Public, no session:
6
+ * /api/auth/invite/:code (preview) and /api/auth/invite/accept (redeem). The
7
+ * plaintext code is in the create response only, never in a list.
8
+ */
9
+
10
+ /** Where an invite stands. A revoked invite is not listed. */
11
+ export type MemberInviteState = 'open' | 'redeemed' | 'expired';
12
+
13
+ /** One invite in GET /api/team-admin/invites (no code). */
14
+ export type MemberInviteRow = {
15
+ id: string;
16
+ /** The contact it was made for; null for an email-only invite, or once
17
+ * the contact is deleted. */
18
+ contactId: string | null;
19
+ /** The contact's current name; null when there is no contact. */
20
+ contactName: string | null;
21
+ /** The email the member login is created with (lower-cased). */
22
+ email: string;
23
+ displayName: string | null;
24
+ state: MemberInviteState;
25
+ createdAt: string;
26
+ expiresAt: string;
27
+ redeemedAt: string | null;
28
+ /** The member login the invite created. */
29
+ redeemedLoginId: string | null;
30
+ /** The admin login that made it; null once that login is deleted. */
31
+ createdBy: string | null;
32
+ };
33
+
34
+ /** GET /api/team-admin/invites: newest first. */
35
+ export type MemberInviteList = { invites: MemberInviteRow[] };
36
+
37
+ /**
38
+ * POST /api/team-admin/invites (201). `code` and `linkPath` are shown ONCE:
39
+ * only the code's hash is stored. `linkPath` is a client-app path
40
+ * (`/invite?code=…`); prefix the client's origin to share it.
41
+ */
42
+ export type MemberInviteCreated = {
43
+ invite: MemberInviteRow;
44
+ code: string;
45
+ linkPath: string;
46
+ };
47
+
48
+ /** GET /api/auth/invite/:code (public): who the invite is for, so the page
49
+ * can greet them. Any code that cannot be redeemed is a uniform 404. */
50
+ export type MemberInvitePreview = {
51
+ email: string;
52
+ displayName: string | null;
53
+ siteName: string | null;
54
+ };
55
+
56
+ /** POST /api/auth/invite/accept (public) { code, password, email? }: the
57
+ * member login is created and the session cookie is set, as a login does.
58
+ * Any failure about the code is a uniform 401. */
59
+ export type MemberInviteAccepted = { ok: true; email: string };
package/src/index.ts CHANGED
@@ -65,11 +65,20 @@ export type {
65
65
  MemberAppLevel,
66
66
  MemberAppList,
67
67
  MemberChatArchiveMessage,
68
+ MemberChatPortalThread,
68
69
  MemberChatRow,
69
70
  MemberChatsResponse,
70
71
  MemberHomeApp,
71
72
  MemberHomeData,
72
73
  } from './dto/member-apps';
74
+ export type {
75
+ MemberInviteAccepted,
76
+ MemberInviteCreated,
77
+ MemberInviteList,
78
+ MemberInvitePreview,
79
+ MemberInviteRow,
80
+ MemberInviteState,
81
+ } from './dto/member-invites';
73
82
  export type { MemberItemKind } from './member-kinds';
74
83
 
75
84
  // Types only at the root; the runtime constants (APP_TINTS, limits) are the