@crossworks/client-types 0.232.323 → 0.232.325
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/client.ts +40 -0
- package/src/dto/rows.ts +3 -0
- package/src/index.ts +6 -0
package/package.json
CHANGED
package/src/dto/client.ts
CHANGED
|
@@ -123,3 +123,43 @@ export type ClientAdminRefusedReason =
|
|
|
123
123
|
/** POST /api/auth/client-link { code, email } -> 200 { ok: true } and the
|
|
124
124
|
* session cookie (30 days), or one uniform 401 for every failure. */
|
|
125
125
|
export type ClientLinkSignIn = { ok: true };
|
|
126
|
+
|
|
127
|
+
// ── Email sign-in codes (C2b) ───────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
/** GET /api/auth/client-code: whether this brain sends sign-in codes (an
|
|
130
|
+
* admin chose a sign-in sender). Says nothing about any email. */
|
|
131
|
+
export type ClientCodeAvailability = { enabled: boolean };
|
|
132
|
+
|
|
133
|
+
/** POST /api/auth/client-code { email } -> always 200 { ok: true } and a
|
|
134
|
+
* fresh request cookie, whatever the email: the answer never tells whether
|
|
135
|
+
* it is a client. When it is an active client login, a code is mailed
|
|
136
|
+
* shortly after (8 digits, 10 minutes, one use, 5 tries, this browser). */
|
|
137
|
+
export type ClientCodeRequested = { ok: true };
|
|
138
|
+
|
|
139
|
+
/** POST /api/auth/client-code/verify { email, code } -> 200 { ok: true } and
|
|
140
|
+
* the session cookie (30 days), or one uniform 401 for every failure (a
|
|
141
|
+
* forwarded code without this browser's request cookie among them); 429
|
|
142
|
+
* when rate limited. */
|
|
143
|
+
export type ClientCodeSignIn = { ok: true };
|
|
144
|
+
|
|
145
|
+
/** An email account the brain can send sign-in codes from. */
|
|
146
|
+
export type ClientSigninSenderCandidate = { id: string; address: string };
|
|
147
|
+
|
|
148
|
+
/** GET /api/team-admin/clients/signin-sender, and the answer to PUT
|
|
149
|
+
* { accountId: string | null }. Codes are off while `sender` is null. When
|
|
150
|
+
* a sender is chosen, its sent-mail folders are left out of mail sync
|
|
151
|
+
* (`sentFoldersExcluded`), and every code mail carries a marker the sync
|
|
152
|
+
* skips anywhere, so a live code never enters the brain. `capReached`: the
|
|
153
|
+
* brain sent `dailyCap` codes in the last 24 hours; requests still answer
|
|
154
|
+
* 200, but nothing is sent until the window moves on. */
|
|
155
|
+
export type ClientSigninSender = {
|
|
156
|
+
sender: ClientSigninSenderCandidate | null;
|
|
157
|
+
candidates: ClientSigninSenderCandidate[];
|
|
158
|
+
sentFoldersExcluded: string[];
|
|
159
|
+
dailyCap: number;
|
|
160
|
+
sentLast24h: number;
|
|
161
|
+
capReached: boolean;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/** Why an admin's sender choice was refused (the 4xx `reason`). */
|
|
165
|
+
export type ClientSenderRefusedReason = 'account-not-found' | 'account-cannot-send';
|
package/src/dto/rows.ts
CHANGED
|
@@ -452,6 +452,9 @@ export type ProfilePreferences = {
|
|
|
452
452
|
* member home is the fallback. No share link is involved. Read via
|
|
453
453
|
* projectTeamHubAppId, never raw. */
|
|
454
454
|
teamHubAppId?: string;
|
|
455
|
+
/** The email account client sign-in codes are sent from (client logins
|
|
456
|
+
* C2b). A BRAIN key: one sender for the brain. Unset = codes are off. */
|
|
457
|
+
clientSigninSenderId?: string;
|
|
455
458
|
/** Tags the owner curates as Dashboard sections on the /team overview: each
|
|
456
459
|
* tag renders a section of up to 5 team-visible shared pages carrying it
|
|
457
460
|
* (newest-updated first, title + summary + /s link). Order here = section
|
package/src/index.ts
CHANGED
|
@@ -112,6 +112,12 @@ export type {
|
|
|
112
112
|
export type {
|
|
113
113
|
ClientAdminRefusedReason,
|
|
114
114
|
ClientLinkSignIn,
|
|
115
|
+
ClientCodeAvailability,
|
|
116
|
+
ClientCodeRequested,
|
|
117
|
+
ClientCodeSignIn,
|
|
118
|
+
ClientSigninSenderCandidate,
|
|
119
|
+
ClientSigninSender,
|
|
120
|
+
ClientSenderRefusedReason,
|
|
115
121
|
ClientLoginCreated,
|
|
116
122
|
ClientLoginList,
|
|
117
123
|
ClientLoginRow,
|