@crossworks/client-types 0.239.94 → 0.239.96

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.239.94",
3
+ "version": "0.239.96",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/dto/grants.ts CHANGED
@@ -192,9 +192,33 @@ export type GrantError = { error: string; code: GrantErrorCode };
192
192
  /** A workspace chip on a list row. */
193
193
  export type ListWorkspace = { id: string; name: string };
194
194
 
195
+ /**
196
+ * What the caller may do with an item, and what the item is (W6b fix round
197
+ * 1): on every list row and item response of pages, notes, drawings,
198
+ * tables, files and apps, on the tree's items and folders, and on GET
199
+ * /api/nodes/:id. Set by the server on each of those; optional in the type
200
+ * only so older shapes still parse.
201
+ */
202
+ export type ItemCaps = {
203
+ /** The caller may change it (a Moderator of its home, or a grant with
204
+ * Write on, in the caller's own workspaces); never for a read-only copy. */
205
+ mayEdit?: boolean;
206
+ /** The caller may delete or move it (a Moderator of its home). */
207
+ mayManage?: boolean;
208
+ /** A read-only snapshot copy of an accepted item (data.snapshot_of):
209
+ * nobody edits it, moves it out of its private workspace or shares it;
210
+ * its author may delete it. Absent on every other item. */
211
+ readOnly?: true;
212
+ /** The brain item a read-only copy copies (the accepted item). */
213
+ snapshotOf?: string;
214
+ /** A member app that was in its author's trash when the spaces were
215
+ * folded (W6b): show it as "was in your trash" with Delete. */
216
+ trashedBeforeFold?: true;
217
+ };
218
+
195
219
  /** What every row of GET /api/pages and /api/notes, and every item and
196
220
  * folder of GET /api/tree/:kind (its search and marks too), carries. */
197
- export type ListChips = {
221
+ export type ListChips = ItemCaps & {
198
222
  /** The workspaces that read the item (its read_ws) and that the caller is
199
223
  * a user of; all of them for an Admin user. Live workspaces only, by
200
224
  * name. */
package/src/dto/rows.ts CHANGED
@@ -140,6 +140,11 @@ export type PageRow = {
140
140
  width: PageWidth;
141
141
  /** Access level (admin > team > client > public); the owner UI's badge. */
142
142
  audience: AccessLevel;
143
+ /** A read-only snapshot copy of an accepted item (data.snapshot_of,
144
+ * workspaces W6b fix round 1): nobody edits it, moves it out of its
145
+ * private workspace or shares it; its author may delete it. Absent on
146
+ * every other item. */
147
+ readOnly?: true;
143
148
  createdAt: string;
144
149
  updatedAt: string;
145
150
  };
package/src/dto/shell.ts CHANGED
@@ -19,6 +19,10 @@ export type Shell = {
19
19
  role: ShellRole;
20
20
  /** The login at the keyboard (the actor), never the anchor account. */
21
21
  loginId: string;
22
+ /** Whether this login is the brain's owner (its anchor login): only the
23
+ * owner's app deletes are purged after 30 days; anyone else's stay in the
24
+ * trash until the owner deletes them for good (W6b fix round 2). */
25
+ isOwner: boolean;
22
26
  /** Always true for a member or a client: onboarding is an admin's. */
23
27
  onboarded: boolean;
24
28
  features: ShellFeatures;
@@ -147,7 +147,15 @@ export type WorkspaceResourcePatchBody = { write: boolean };
147
147
 
148
148
  /** What /api/shell adds for the signed-in login: its live workspaces (for
149
149
  * the switcher) and its Admin areas ([] when it is not an Admin user). */
150
- export type ShellWorkspace = { id: string; name: string; isAdmin: boolean; moderator: boolean };
150
+ export type ShellWorkspace = {
151
+ id: string;
152
+ name: string;
153
+ isAdmin: boolean;
154
+ moderator: boolean;
155
+ /** The login's own private workspace ("<name> (only you)", W6b): match
156
+ * on this, never on the name (W6b fix round 1). Absent on any other. */
157
+ private?: true;
158
+ };
151
159
  export type ShellWorkspaces = { workspaces: ShellWorkspace[]; areas: WorkspaceArea[] };
152
160
 
153
161
  /** Every `code` a /api/workspaces refusal carries. */
package/src/index.ts CHANGED
@@ -226,6 +226,7 @@ export type {
226
226
  GrantsResponse,
227
227
  GrantsWriteResponse,
228
228
  ListChips,
229
+ ItemCaps,
229
230
  ListWorkspace,
230
231
  ListWsEcho,
231
232
  } from './dto/grants';