@crossworks/client-types 0.300.17 → 0.300.21

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.17",
3
+ "version": "0.300.21",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/dto/grants.ts CHANGED
@@ -10,8 +10,9 @@
10
10
  * panel. Every refusal is `{ error, code }` with 400, 403, 404 or 409; an
11
11
  * item or workspace the caller may not see answers 404, never 403.
12
12
  *
13
- * Pure: no imports.
13
+ * Pure: types only (a workspace chip's look comes from ./workspaces).
14
14
  */
15
+ import type { WorkspaceLook } from './workspaces';
15
16
 
16
17
  /** A workspace as the panel names it. */
17
18
  export type GrantWorkspaceRef = { wsId: string; name: string };
@@ -189,8 +190,9 @@ export type GrantError = { error: string; code: GrantErrorCode };
189
190
 
190
191
  // ── Lists (W5b2 contract changes 5 and 14) ───────────────────────────────────
191
192
 
192
- /** A workspace chip on a list row. */
193
- export type ListWorkspace = { id: string; name: string };
193
+ /** A workspace chip on a list row, with the workspace's look (its colour
194
+ * and icon, WorkspaceLook) from a brain that has one. */
195
+ export type ListWorkspace = WorkspaceLook & { id: string; name: string };
194
196
 
195
197
  /**
196
198
  * What the caller may do with an item, and what the item is (W6b fix round
@@ -7,6 +7,7 @@
7
7
  * Every refusal is `{ error, code }` with 400, 403, 404 or 409. A workspace
8
8
  * or login the caller may not see answers 404, never 403.
9
9
  */
10
+ import type { AppTint } from '../app-nav';
10
11
 
11
12
  /** The Admin areas (plan 1.4). An Admin workspace user has all of them
12
13
  * unless a per-user switch turns one off (none can be switched off yet). */
@@ -20,8 +21,26 @@ export const WORKSPACE_AREAS: readonly WorkspaceArea[] = [
20
21
  'keys',
21
22
  ];
22
23
 
24
+ /** What a workspace is, for its default icon: the Admin workspace, the
25
+ * Team workspace, a login's private workspace, or any other. */
26
+ export type WorkspaceKind = 'admin' | 'team' | 'private' | 'other';
27
+
28
+ /**
29
+ * A workspace's look (task 5edc9149): on every workspace the brain lists
30
+ * (this list and screen, /api/shell's switcher list, and the chips of the
31
+ * lists and the tree). `color` is a tint key of the folder palette, `icon`
32
+ * an emoji or `lucide:<name>`, the folder vocabulary; null = the default:
33
+ * the neutral colour, and the client's default icon for `kind`. Absent from
34
+ * an older brain (read it as null and 'other').
35
+ */
36
+ export type WorkspaceLook = {
37
+ color?: AppTint | null;
38
+ icon?: string | null;
39
+ kind?: WorkspaceKind;
40
+ };
41
+
23
42
  /** One workspace as a list row and as the head of its screen. */
24
- export type Workspace = {
43
+ export type Workspace = WorkspaceLook & {
25
44
  id: string;
26
45
  name: string;
27
46
  description: string;
@@ -112,15 +131,21 @@ export type WorkspaceLandingApp = {
112
131
  ready: boolean;
113
132
  };
114
133
 
115
- /** PATCH /api/workspaces/:id. Name and description: a Moderator or an Admin
116
- * user. Contact and assistant: an Admin user (assistant: area
117
- * 'assistants'). The landing page (`landingAppId`): a Moderator of this
134
+ /** PATCH /api/workspaces/:id. Name, description, colour and icon: a
135
+ * Moderator or an Admin user (one rule: whoever may rename it sets its
136
+ * look; the built-in workspaces keep their names but take a look). `color`
137
+ * is a tint key (APP_TINTS), `icon` an emoji or `lucide:<name>` (400
138
+ * `invalid` otherwise). null clears either; '' clears the icon too (the
139
+ * folder field's rule), never the colour. Contact and assistant: an Admin
140
+ * user (assistant: area 'assistants'). The landing page (`landingAppId`): a Moderator of this
118
141
  * workspace only, to an app the workspace holds with a green published
119
142
  * build (409 `landing_app_not_held` or `landing_app_not_ready`). `null`
120
143
  * clears (the Built-in home). Answers the updated Workspace. */
121
144
  export type WorkspacePatchBody = {
122
145
  name?: string;
123
146
  description?: string;
147
+ color?: AppTint | null;
148
+ icon?: string | null;
124
149
  contactNodeId?: string | null;
125
150
  assistantId?: string | null;
126
151
  landingAppId?: string | null;
@@ -169,7 +194,7 @@ export type WorkspaceResourcePatchBody = { write: boolean };
169
194
 
170
195
  /** What /api/shell adds for the signed-in login: its live workspaces (for
171
196
  * the switcher) and its Admin areas ([] when it is not an Admin user). */
172
- export type ShellWorkspace = {
197
+ export type ShellWorkspace = WorkspaceLook & {
173
198
  id: string;
174
199
  name: string;
175
200
  isAdmin: boolean;
package/src/index.ts CHANGED
@@ -193,8 +193,10 @@ export type {
193
193
  WorkspaceDetailResponse,
194
194
  WorkspaceError,
195
195
  WorkspaceErrorCode,
196
+ WorkspaceKind,
196
197
  WorkspaceLandingApp,
197
198
  WorkspaceListResponse,
199
+ WorkspaceLook,
198
200
  WorkspacePatchBody,
199
201
  WorkspaceResource,
200
202
  WorkspaceResourceAddBody,