@crossworks/client-types 0.300.81 → 0.300.83

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.300.81",
3
+ "version": "0.300.83",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,77 @@
1
+ /**
2
+ * A file delete's answers (F4 fix rounds 2 and 3; docs/actors.md, "F4 fix
3
+ * round 3", the bulk delete's contract): what jackdaw reads back from
4
+ * DELETE /api/files/files (bulk) and DELETE /api/files/files/:id?cascade=1.
5
+ *
6
+ * No name or id of an item the caller's scope does not read is ever in an
7
+ * answer: such an item is a count (`hiddenDrawings`, `kept`, `keptTotal`)
8
+ * or the `not_found` of an id no row has.
9
+ */
10
+
11
+ /** What a file produced, by user-facing bucket (the has_derived preview and
12
+ * the confirmed cascade's reap). Counts every derived item, ones the
13
+ * caller does not read included. */
14
+ export type FileDerivedCounts = {
15
+ images: number;
16
+ tables: number;
17
+ pages: number;
18
+ notes: number;
19
+ other: number;
20
+ total: number;
21
+ };
22
+
23
+ /**
24
+ * Why one id of a bulk delete was not deleted:
25
+ * - `not_found`: no file has the id, or one the caller's scope does not
26
+ * read (one answer: the two are never told apart);
27
+ * - `forbidden`: the caller reads the file but may not delete it (deleting
28
+ * is for a Moderator of its workspace);
29
+ * - `in_drawing`: a drawing places it on its canvas;
30
+ * - `attachment`: an email attachment (delete it from the email).
31
+ */
32
+ export type FileDeleteRefusalReason = 'not_found' | 'forbidden' | 'in_drawing' | 'attachment';
33
+
34
+ /** One id a bulk delete did not delete, and why (never a silent skip). */
35
+ export type BulkDeleteRefusal = {
36
+ fileId: string;
37
+ reason: FileDeleteRefusalReason;
38
+ /** On `in_drawing`: the drawings placing it that the caller reads. */
39
+ drawings?: Array<{ id: string; title: string }>;
40
+ /** On `in_drawing`: how many more place it that the caller does not read,
41
+ * when any. */
42
+ hiddenDrawings?: number;
43
+ };
44
+
45
+ /** DELETE /api/files/files `{ ids }` (no cascade): 200. */
46
+ export type BulkDeleteFilesResponse = {
47
+ deleted: number;
48
+ /** Files not deleted because ingest derived items from them: confirm,
49
+ * then send these ids again with `cascade: true`. */
50
+ hasDerived: Array<{ fileId: string; derived: FileDerivedCounts }>;
51
+ refused: BulkDeleteRefusal[];
52
+ };
53
+
54
+ /** DELETE /api/files/files `{ ids, cascade: true }`: 200. */
55
+ export type BulkDeleteCascadeResponse = {
56
+ deleted: number;
57
+ /** Always empty on a cascade. */
58
+ hasDerived: [];
59
+ /** Derived items reaped, over every file. */
60
+ reapedTotal: number;
61
+ /** Derived items kept because the caller may not delete them (in a
62
+ * workspace it does not manage, or one it does not read): left in place,
63
+ * over every file (F4 fix round 3). */
64
+ keptTotal: number;
65
+ refused: BulkDeleteRefusal[];
66
+ };
67
+
68
+ /** DELETE /api/files/files/:id?cascade=1: 200 once the file is deleted. */
69
+ export type FileCascadeDeleteResponse = {
70
+ ok: true;
71
+ reaped: FileDerivedCounts;
72
+ /** Derived items the reap could not delete (audit-visible). */
73
+ skipped: number;
74
+ /** Derived items kept because the caller may not delete them: a count,
75
+ * never a name (F4 fix round 3). */
76
+ kept: number;
77
+ };
package/src/index.ts CHANGED
@@ -105,6 +105,15 @@ export type {
105
105
  MemberInviteState,
106
106
  } from './dto/member-invites';
107
107
  export type { MemberMcpClient, MemberMcpConnector, MemberMcpView } from './dto/member-mcp';
108
+ export type {
109
+ BulkDeleteCascadeResponse,
110
+ BulkDeleteFilesResponse,
111
+ BulkDeleteRefusal,
112
+ FileCascadeDeleteResponse,
113
+ FileDeleteRefusalReason,
114
+ FileDerivedCounts,
115
+ } from './dto/file-deletes';
116
+
108
117
  export type { MemberItemKind, ClientItemKind, ClientItemFilter } from './member-kinds';
109
118
  export type {
110
119
  LoginKind,