@crossworks/client-types 0.232.342 → 0.232.344

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.342",
3
+ "version": "0.232.344",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/dto/client.ts CHANGED
@@ -312,7 +312,12 @@ export type ClientItemsPage = {
312
312
  * reviewers (and members read it as a client request). Refusals (the 409
313
313
  * `reason`): the member ones, plus `quota` for the client caps: 20 MB a file,
314
314
  * 200 MB a client, 50 MB uploaded a day, 500 items, 10 submissions a day, 50
315
- * waiting for review, and one total for all client uploads of the brain.
315
+ * waiting for review, and one total for all client spaces of the brain. The
316
+ * 200 MB and the total count page and note text too (C5 audit). A page
317
+ * document over 500 KB serialized (draft or Save version), or a note over
318
+ * 50,000 characters, is a 400 `too-large`. The comment caps:
319
+ * ClientCommentRefusedReason. Any JSON body over the route's ceiling (8 MB)
320
+ * is a 413 `body-too-large`.
316
321
  */
317
322
  export type ClientSpaceRefusedReason =
318
323
  | 'not-found'
@@ -363,4 +368,81 @@ export type ClientAcceptedBase = {
363
368
  * item: the review talk with the reviewers, open while it is submitted. A
364
369
  * reviewer's comment shows the brand name, never a staff name.
365
370
  */
366
- export type ClientCommentThread = { comments: NodeComment[] };
371
+ export type ClientCommentThread = {
372
+ comments: NodeComment[];
373
+ /**
374
+ * Older comments exist (client logins C5 audit): a thread answers its
375
+ * NEWEST 100 comments, oldest first; `?before=<createdAt of the oldest
376
+ * shown>` answers the 100 before them. The same paging and `hasMore` on
377
+ * GET /api/member/library/:id/comments, /api/member/space/:id/comments,
378
+ * /api/team-admin/submissions/:id/comments and /api/nodes/:id/comments.
379
+ * Absent on an older brain (the whole thread).
380
+ */
381
+ hasMore?: boolean;
382
+ };
383
+
384
+ /**
385
+ * Why a comment was refused (the 4xx `reason`, client logins C5 audit): 429
386
+ * `comment-cap` (a client login writes at most 100 comments a day across
387
+ * every thread, the review talk and client threads; deleting one does not
388
+ * give it back), 409 `thread-full` (one thread holds at most 1000
389
+ * comments).
390
+ */
391
+ export type ClientCommentRefusedReason = 'comment-cap' | 'thread-full';
392
+
393
+ // ── Team admin > Clients: storage and client threads (C5 audit) ────────────
394
+
395
+ /**
396
+ * GET /api/team-admin/clients/storage (admin only): what the client spaces
397
+ * hold against the client limits. A client space counts files, page
398
+ * documents (saved, draft and plain text) and note text, as stored.
399
+ * `limits.totalBytes` is the brain-wide total for ALL client spaces (5 GB
400
+ * unless the box sets MANTLE_CLIENT_SPACES_TOTAL_BYTES). A `former` row is a
401
+ * deleted client's space: it still counts until its 30-day purge, and its
402
+ * `loginId` is the space's id (the login row is gone).
403
+ */
404
+ export type ClientStorageUsage = {
405
+ limits: {
406
+ fileMaxBytes: number;
407
+ perClientBytes: number;
408
+ dailyUploadBytes: number;
409
+ itemLimit: number;
410
+ totalBytes: number;
411
+ submitsPerDay: number;
412
+ openSubmissions: number;
413
+ };
414
+ totalUsedBytes: number;
415
+ rows: {
416
+ loginId: string;
417
+ name: string;
418
+ usedBytes: number;
419
+ uploadedTodayBytes: number;
420
+ items: number;
421
+ openSubmissions: number;
422
+ former: boolean;
423
+ }[];
424
+ /** Quota refusals in the last 7 days, newest first, at most 50. */
425
+ refusals: { at: string; loginId: string | null; reason: string }[];
426
+ };
427
+
428
+ /**
429
+ * GET /api/team-admin/clients/comments?days=7 (admin only, 1 to 90 days):
430
+ * the client-level items whose client thread had a comment by a CLIENT in
431
+ * the window, newest first, at most 100. `clientComments` counts the
432
+ * clients' comments in the window; `lastClientName` is the newest one's
433
+ * author. Open the thread on /api/nodes/:id/comments.
434
+ */
435
+ export type ClientThreadActivity = {
436
+ rows: {
437
+ nodeId: string;
438
+ title: string;
439
+ type: string;
440
+ lastCommentAt: string;
441
+ clientComments: number;
442
+ lastClientName: string;
443
+ }[];
444
+ };
445
+
446
+ /** DELETE /api/team-admin/clients/:id/comments (admin only): every comment
447
+ * that client login wrote (client threads and review talk) is removed. */
448
+ export type ClientCommentsDeleted = { deleted: number };
package/src/index.ts CHANGED
@@ -151,6 +151,10 @@ export type {
151
151
  ClientAcceptedItem,
152
152
  ClientAcceptedBase,
153
153
  ClientCommentThread,
154
+ ClientCommentRefusedReason,
155
+ ClientStorageUsage,
156
+ ClientThreadActivity,
157
+ ClientCommentsDeleted,
154
158
  } from './dto/client';
155
159
 
156
160
  // Types only at the root; the runtime constants (APP_TINTS, limits) are the