@anchrd/colab-sdk 0.1.9 → 0.1.11

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.
@@ -2,59 +2,6 @@ import { z } from "zod";
2
2
  export declare const validationBoardId: "node_0000000000000000000000VA1D";
3
3
  export declare const ValidationBoardId: z.ZodLiteral<"node_0000000000000000000000VA1D">;
4
4
  export type ValidationBoardId = z.infer<typeof ValidationBoardId>;
5
- export declare const TicketColumn: z.ZodObject<{
6
- columnId: z.ZodTemplateLiteral<`column_${string}`>;
7
- name: z.ZodNullable<z.ZodString>;
8
- type: z.ZodNullable<z.ZodEnum<{
9
- backlog: "backlog";
10
- open: "open";
11
- progress: "progress";
12
- done: "done";
13
- discarded: "discarded";
14
- blocked: "blocked";
15
- archive: "archive";
16
- }>>;
17
- }, z.core.$strip>;
18
- export type TicketColumn = z.infer<typeof TicketColumn>;
19
- export declare const TicketMove: z.ZodObject<{
20
- from: z.ZodNullable<z.ZodObject<{
21
- columnId: z.ZodTemplateLiteral<`column_${string}`>;
22
- name: z.ZodNullable<z.ZodString>;
23
- type: z.ZodNullable<z.ZodEnum<{
24
- backlog: "backlog";
25
- open: "open";
26
- progress: "progress";
27
- done: "done";
28
- discarded: "discarded";
29
- blocked: "blocked";
30
- archive: "archive";
31
- }>>;
32
- }, z.core.$strip>>;
33
- to: z.ZodObject<{
34
- columnId: z.ZodTemplateLiteral<`column_${string}`>;
35
- name: z.ZodNullable<z.ZodString>;
36
- type: z.ZodNullable<z.ZodEnum<{
37
- backlog: "backlog";
38
- open: "open";
39
- progress: "progress";
40
- done: "done";
41
- discarded: "discarded";
42
- blocked: "blocked";
43
- archive: "archive";
44
- }>>;
45
- }, z.core.$strip>;
46
- movedBy: z.ZodObject<{
47
- userId: z.ZodString;
48
- name: z.ZodNullable<z.ZodString>;
49
- kind: z.ZodNullable<z.ZodEnum<{
50
- machine: "machine";
51
- human: "human";
52
- }>>;
53
- }, z.core.$strip>;
54
- movedAt: z.ZodISODateTime;
55
- comment: z.ZodNullable<z.ZodString>;
56
- }, z.core.$strip>;
57
- export type TicketMove = z.infer<typeof TicketMove>;
58
5
  export declare const TicketSubject: z.ZodObject<{
59
6
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
60
7
  kind: z.ZodEnum<{
@@ -64,7 +11,7 @@ export declare const TicketSubject: z.ZodObject<{
64
11
  table: "table";
65
12
  board: "board";
66
13
  task: "task";
67
- dashboard: "dashboard";
14
+ gadget: "gadget";
68
15
  }>;
69
16
  name: z.ZodString;
70
17
  path: z.ZodObject<{
@@ -89,7 +36,7 @@ export declare const TicketSubjectRef: z.ZodObject<{
89
36
  table: "table";
90
37
  board: "board";
91
38
  task: "task";
92
- dashboard: "dashboard";
39
+ gadget: "gadget";
93
40
  }>;
94
41
  path: z.ZodObject<{
95
42
  section: z.ZodEnum<{
@@ -1,8 +1,7 @@
1
1
  import { z } from "zod";
2
- import { ColumnId, ColumnType } from "../columns/columns.js";
3
- import { NodeId, NodeKind, NodePath, NodePerson } from "../nodes/nodes.js";
4
- // The validation (#47, Seiten › Validierung, E33, E48, E67): one board per Colab, a ticket per
5
- // document, table and file, and the history of every ticket. The board is a node with a fixed id
2
+ import { NodeId, NodeKind, NodePath } from "../nodes/nodes.js";
3
+ // The validation (#47, Seiten › Validierung, E33, E48, E67): one board per Colab and a ticket per
4
+ // document, table and file; a ticket's history stands in its versions (E117). The board is a node with a fixed id
6
5
  // that stands in no area of the tree; its tickets are tasks whose node is the one they validate. A
7
6
  // node's own status is `NodeValidation` in `nodes.ts`, beside the node it describes.
8
7
  // ⚠️ The board's fixed id: the same in every Colab, made on its first use (`ensureValidationBoard`
@@ -11,24 +10,6 @@ export const validationBoardId = "node_0000000000000000000000VA1D";
11
10
  export const ValidationBoardId = z
12
11
  .literal(validationBoardId)
13
12
  .describe("The validation board, the same id in every Colab.");
14
- // A column a ticket left or entered. Its name and type as they stand now; both null when the
15
- // company has removed the column since.
16
- export const TicketColumn = z.object({
17
- columnId: ColumnId,
18
- name: z.string().nullable(),
19
- type: ColumnType.nullable(),
20
- });
21
- // One line of a ticket's history ("Verlauf"): every move, by Colab's bookkeeping or by hand.
22
- export const TicketMove = z.object({
23
- // Null for the line that opened the ticket.
24
- from: TicketColumn.nullable(),
25
- to: TicketColumn,
26
- // Who moved it; for a move of the bookkeeping, whoever wrote the change that caused it.
27
- movedBy: NodePerson,
28
- movedAt: z.iso.datetime(),
29
- // What the mover wrote with it, null without a word.
30
- comment: z.string().nullable(),
31
- });
32
13
  // The node a ticket validates, as the caller can read it.
33
14
  export const TicketSubject = z.object({
34
15
  nodeId: NodeId,
@@ -1,7 +1,103 @@
1
1
  import { z } from "zod";
2
2
  export declare const VersionId: z.ZodTemplateLiteral<`version_${string}`>;
3
3
  export type VersionId = z.infer<typeof VersionId>;
4
- export declare const versionKinds: readonly ["document", "table", "file"];
4
+ export declare const versionKinds: readonly ["document", "table", "file", "task"];
5
+ export declare const MoveColumn: z.ZodObject<{
6
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
7
+ name: z.ZodNullable<z.ZodString>;
8
+ type: z.ZodNullable<z.ZodEnum<{
9
+ backlog: "backlog";
10
+ open: "open";
11
+ progress: "progress";
12
+ done: "done";
13
+ discarded: "discarded";
14
+ blocked: "blocked";
15
+ archive: "archive";
16
+ }>>;
17
+ }, z.core.$strip>;
18
+ export type MoveColumn = z.infer<typeof MoveColumn>;
19
+ export declare const VersionMove: z.ZodObject<{
20
+ from: z.ZodNullable<z.ZodObject<{
21
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
22
+ name: z.ZodNullable<z.ZodString>;
23
+ type: z.ZodNullable<z.ZodEnum<{
24
+ backlog: "backlog";
25
+ open: "open";
26
+ progress: "progress";
27
+ done: "done";
28
+ discarded: "discarded";
29
+ blocked: "blocked";
30
+ archive: "archive";
31
+ }>>;
32
+ }, z.core.$strip>>;
33
+ to: z.ZodObject<{
34
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
35
+ name: z.ZodNullable<z.ZodString>;
36
+ type: z.ZodNullable<z.ZodEnum<{
37
+ backlog: "backlog";
38
+ open: "open";
39
+ progress: "progress";
40
+ done: "done";
41
+ discarded: "discarded";
42
+ blocked: "blocked";
43
+ archive: "archive";
44
+ }>>;
45
+ }, z.core.$strip>;
46
+ comment: z.ZodNullable<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ export type VersionMove = z.infer<typeof VersionMove>;
49
+ export declare const taskVersionChanges: readonly ["title", "text", "assignee", "dates", "labels", "parent", "dependencies", "waiting", "fields"];
50
+ export declare const TaskVersionChange: z.ZodEnum<{
51
+ fields: "fields";
52
+ title: "title";
53
+ text: "text";
54
+ dates: "dates";
55
+ assignee: "assignee";
56
+ labels: "labels";
57
+ parent: "parent";
58
+ dependencies: "dependencies";
59
+ waiting: "waiting";
60
+ }>;
61
+ export type TaskVersionChange = z.infer<typeof TaskVersionChange>;
62
+ export declare const TaskMove: z.ZodObject<{
63
+ from: z.ZodNullable<z.ZodObject<{
64
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
65
+ name: z.ZodNullable<z.ZodString>;
66
+ type: z.ZodNullable<z.ZodEnum<{
67
+ backlog: "backlog";
68
+ open: "open";
69
+ progress: "progress";
70
+ done: "done";
71
+ discarded: "discarded";
72
+ blocked: "blocked";
73
+ archive: "archive";
74
+ }>>;
75
+ }, z.core.$strip>>;
76
+ to: z.ZodObject<{
77
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
78
+ name: z.ZodNullable<z.ZodString>;
79
+ type: z.ZodNullable<z.ZodEnum<{
80
+ backlog: "backlog";
81
+ open: "open";
82
+ progress: "progress";
83
+ done: "done";
84
+ discarded: "discarded";
85
+ blocked: "blocked";
86
+ archive: "archive";
87
+ }>>;
88
+ }, z.core.$strip>;
89
+ comment: z.ZodNullable<z.ZodString>;
90
+ movedBy: z.ZodObject<{
91
+ userId: z.ZodString;
92
+ name: z.ZodNullable<z.ZodString>;
93
+ kind: z.ZodNullable<z.ZodEnum<{
94
+ machine: "machine";
95
+ human: "human";
96
+ }>>;
97
+ }, z.core.$strip>;
98
+ movedAt: z.ZodISODateTime;
99
+ }, z.core.$strip>;
100
+ export type TaskMove = z.infer<typeof TaskMove>;
5
101
  export declare const NodeVersionListInput: z.ZodObject<{
6
102
  nodeId: z.ZodTemplateLiteral<`node_${string}`>;
7
103
  cursor: z.ZodOptional<z.ZodString>;
@@ -37,6 +133,46 @@ export declare const NodeVersion: z.ZodObject<{
37
133
  restoredFrom: z.ZodNullable<z.ZodNumber>;
38
134
  current: z.ZodBoolean;
39
135
  size: z.ZodNumber;
136
+ move: z.ZodNullable<z.ZodObject<{
137
+ from: z.ZodNullable<z.ZodObject<{
138
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
139
+ name: z.ZodNullable<z.ZodString>;
140
+ type: z.ZodNullable<z.ZodEnum<{
141
+ backlog: "backlog";
142
+ open: "open";
143
+ progress: "progress";
144
+ done: "done";
145
+ discarded: "discarded";
146
+ blocked: "blocked";
147
+ archive: "archive";
148
+ }>>;
149
+ }, z.core.$strip>>;
150
+ to: z.ZodObject<{
151
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
152
+ name: z.ZodNullable<z.ZodString>;
153
+ type: z.ZodNullable<z.ZodEnum<{
154
+ backlog: "backlog";
155
+ open: "open";
156
+ progress: "progress";
157
+ done: "done";
158
+ discarded: "discarded";
159
+ blocked: "blocked";
160
+ archive: "archive";
161
+ }>>;
162
+ }, z.core.$strip>;
163
+ comment: z.ZodNullable<z.ZodString>;
164
+ }, z.core.$strip>>;
165
+ changes: z.ZodNullable<z.ZodArray<z.ZodEnum<{
166
+ fields: "fields";
167
+ title: "title";
168
+ text: "text";
169
+ dates: "dates";
170
+ assignee: "assignee";
171
+ labels: "labels";
172
+ parent: "parent";
173
+ dependencies: "dependencies";
174
+ waiting: "waiting";
175
+ }>>>;
40
176
  }, z.core.$strip>;
41
177
  export type NodeVersion = z.infer<typeof NodeVersion>;
42
178
  export declare const NodeVersionList: z.ZodObject<{
@@ -58,6 +194,46 @@ export declare const NodeVersionList: z.ZodObject<{
58
194
  restoredFrom: z.ZodNullable<z.ZodNumber>;
59
195
  current: z.ZodBoolean;
60
196
  size: z.ZodNumber;
197
+ move: z.ZodNullable<z.ZodObject<{
198
+ from: z.ZodNullable<z.ZodObject<{
199
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
200
+ name: z.ZodNullable<z.ZodString>;
201
+ type: z.ZodNullable<z.ZodEnum<{
202
+ backlog: "backlog";
203
+ open: "open";
204
+ progress: "progress";
205
+ done: "done";
206
+ discarded: "discarded";
207
+ blocked: "blocked";
208
+ archive: "archive";
209
+ }>>;
210
+ }, z.core.$strip>>;
211
+ to: z.ZodObject<{
212
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
213
+ name: z.ZodNullable<z.ZodString>;
214
+ type: z.ZodNullable<z.ZodEnum<{
215
+ backlog: "backlog";
216
+ open: "open";
217
+ progress: "progress";
218
+ done: "done";
219
+ discarded: "discarded";
220
+ blocked: "blocked";
221
+ archive: "archive";
222
+ }>>;
223
+ }, z.core.$strip>;
224
+ comment: z.ZodNullable<z.ZodString>;
225
+ }, z.core.$strip>>;
226
+ changes: z.ZodNullable<z.ZodArray<z.ZodEnum<{
227
+ fields: "fields";
228
+ title: "title";
229
+ text: "text";
230
+ dates: "dates";
231
+ assignee: "assignee";
232
+ labels: "labels";
233
+ parent: "parent";
234
+ dependencies: "dependencies";
235
+ waiting: "waiting";
236
+ }>>>;
61
237
  }, z.core.$strip>>;
62
238
  nextCursor: z.ZodNullable<z.ZodString>;
63
239
  rev: z.ZodNumber;
@@ -81,6 +257,46 @@ export declare const NodeVersionDetail: z.ZodObject<{
81
257
  restoredFrom: z.ZodNullable<z.ZodNumber>;
82
258
  current: z.ZodBoolean;
83
259
  size: z.ZodNumber;
260
+ move: z.ZodNullable<z.ZodObject<{
261
+ from: z.ZodNullable<z.ZodObject<{
262
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
263
+ name: z.ZodNullable<z.ZodString>;
264
+ type: z.ZodNullable<z.ZodEnum<{
265
+ backlog: "backlog";
266
+ open: "open";
267
+ progress: "progress";
268
+ done: "done";
269
+ discarded: "discarded";
270
+ blocked: "blocked";
271
+ archive: "archive";
272
+ }>>;
273
+ }, z.core.$strip>>;
274
+ to: z.ZodObject<{
275
+ columnId: z.ZodTemplateLiteral<`column_${string}`>;
276
+ name: z.ZodNullable<z.ZodString>;
277
+ type: z.ZodNullable<z.ZodEnum<{
278
+ backlog: "backlog";
279
+ open: "open";
280
+ progress: "progress";
281
+ done: "done";
282
+ discarded: "discarded";
283
+ blocked: "blocked";
284
+ archive: "archive";
285
+ }>>;
286
+ }, z.core.$strip>;
287
+ comment: z.ZodNullable<z.ZodString>;
288
+ }, z.core.$strip>>;
289
+ changes: z.ZodNullable<z.ZodArray<z.ZodEnum<{
290
+ fields: "fields";
291
+ title: "title";
292
+ text: "text";
293
+ dates: "dates";
294
+ assignee: "assignee";
295
+ labels: "labels";
296
+ parent: "parent";
297
+ dependencies: "dependencies";
298
+ waiting: "waiting";
299
+ }>>>;
84
300
  secret: z.ZodOptional<z.ZodLiteral<true>>;
85
301
  locked: z.ZodOptional<z.ZodBoolean>;
86
302
  content: z.ZodNullable<z.ZodString>;
@@ -95,6 +311,22 @@ export declare const NodeVersionDetail: z.ZodObject<{
95
311
  chip: "chip";
96
312
  }>;
97
313
  }, z.core.$strict>>>;
314
+ fields: z.ZodNullable<z.ZodArray<z.ZodObject<{
315
+ name: z.ZodString;
316
+ type: z.ZodEnum<{
317
+ number: "number";
318
+ date: "date";
319
+ list: "list";
320
+ link: "link";
321
+ text: "text";
322
+ checklist: "checklist";
323
+ select: "select";
324
+ }>;
325
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodObject<{
326
+ text: z.ZodString;
327
+ done: z.ZodBoolean;
328
+ }, z.core.$strip>>]>;
329
+ }, z.core.$strip>>>;
98
330
  rev: z.ZodNumber;
99
331
  }, z.core.$strip>;
100
332
  export type NodeVersionDetail = z.infer<typeof NodeVersionDetail>;
@@ -1,19 +1,56 @@
1
1
  import { z } from "zod";
2
+ import { CardFieldType, CardFieldValue } from "../card-kinds/card-kinds.js";
3
+ import { ColumnId, ColumnType } from "../columns/columns.js";
2
4
  import { idSchema } from "../ids/ids.js";
3
5
  import { Limit as PageSize } from "../list-input.js";
4
6
  import { NodeId, NodePerson, SecretFields } from "../nodes/nodes.js";
5
7
  import { Rev } from "../primitives/primitives.js";
6
8
  import { TableColumn } from "../tables/tables.js";
7
- // Versions of documents, tables and files (#38, Funktionen › Freigeben und Versionen, E37, E70): the
8
- // inputs of `intelligence_node_version_list`, `_get` and `_create`, and their answers. Content is
9
- // written by the tools of its kind (#39, #40, #41); these three only read the history and restore.
9
+ // Versions of documents, tables, files and tasks (#38, #637, Funktionen › Freigeben und Versionen, E37,
10
+ // E70, E117): the inputs of `intelligence_node_version_list`, `_get` and `_create`, and their answers.
11
+ // Content is written by the tools of its kind (#39, #40, #41, #42); these three only read the history
12
+ // and restore. A task's versions are its history: every move to another column is one of its own.
10
13
  // Every answer carries the node's `rev`, the state the next save sends back (E70); people see the
11
14
  // version number, never the rev.
12
15
  export const VersionId = idSchema("version").describe("The version's id, `version_…`.");
13
- // The kinds that have versions (E37): the same three that are validated.
14
- export const versionKinds = ["document", "table", "file"];
16
+ // The kinds that have versions (E37, E117): the three that are validated, and tasks.
17
+ export const versionKinds = ["document", "table", "file", "task"];
18
+ // A column a task left or entered (E117): its name and type as they stand now; both null when the
19
+ // board's column has been removed since.
20
+ export const MoveColumn = z.object({
21
+ columnId: ColumnId,
22
+ name: z.string().nullable(),
23
+ type: ColumnType.nullable(),
24
+ });
25
+ // A task's move in one of its versions (E117): from where to where, and what the mover wrote with
26
+ // it. `from` is null for the version that made the task, in the column it was made in.
27
+ export const VersionMove = z.object({
28
+ from: MoveColumn.nullable(),
29
+ to: MoveColumn,
30
+ comment: z.string().nullable(),
31
+ });
32
+ // What a task's version changed besides a move (E117): the words the history names, in this order.
33
+ // The fields of a card kind (#638) come later as their own entries.
34
+ export const taskVersionChanges = [
35
+ "title",
36
+ "text",
37
+ "assignee",
38
+ "dates",
39
+ "labels",
40
+ "parent",
41
+ "dependencies",
42
+ "waiting",
43
+ "fields",
44
+ ];
45
+ export const TaskVersionChange = z.enum(taskVersionChanges);
46
+ // The last move of a task (E117): what the ticket of the validation shows in its bar ("Neu → Offen ·
47
+ // Operator · 3. Okt."), read from its versions.
48
+ export const TaskMove = VersionMove.extend({
49
+ movedBy: NodePerson,
50
+ movedAt: z.iso.datetime(),
51
+ });
15
52
  export const NodeVersionListInput = z.strictObject({
16
- nodeId: NodeId.describe("The document, table or file whose versions to list."),
53
+ nodeId: NodeId.describe("The document, table, file or task whose versions to list."),
17
54
  cursor: z
18
55
  .string()
19
56
  .max(100)
@@ -22,12 +59,12 @@ export const NodeVersionListInput = z.strictObject({
22
59
  limit: PageSize.optional().describe("How many versions one page holds, 1 to 100. Leaving it out gives 50."),
23
60
  });
24
61
  export const NodeVersionGetInput = z.strictObject({
25
- nodeId: NodeId.describe("The document, table or file the version belongs to."),
62
+ nodeId: NodeId.describe("The document, table, file or task the version belongs to."),
26
63
  versionId: VersionId.describe("The version to read, from intelligence_node_version_list. A version of another node answers not_found."),
27
64
  });
28
65
  export const NodeVersionCreateInput = z.strictObject({
29
- nodeId: NodeId.describe("The document, table or file to restore an earlier state of."),
30
- fromVersionId: VersionId.describe("The version whose content becomes the newest version again. Nothing is deleted: the versions after it stay, and the new one says which number it was restored from."),
66
+ nodeId: NodeId.describe("The document, table, file or task to restore an earlier state of."),
67
+ fromVersionId: VersionId.describe("The version whose content becomes the newest version again. Nothing is deleted: the versions after it stay, and the new one says which number it was restored from. For a task only its text comes back, never its column or assignee."),
31
68
  rev: Rev,
32
69
  });
33
70
  // One entry of the history.
@@ -48,6 +85,11 @@ export const NodeVersion = z.object({
48
85
  current: z.boolean(),
49
86
  // Bytes of the content (UTF-8 for text, the object for a file).
50
87
  size: z.number().int(),
88
+ // Only for a task (E117): the move this version is, null for a save that did not move it.
89
+ move: VersionMove.nullable(),
90
+ // Only for a task (E117): what else this version changed, an empty list for none; null for every
91
+ // other kind.
92
+ changes: z.array(TaskVersionChange).nullable(),
51
93
  });
52
94
  export const NodeVersionList = z.object({
53
95
  items: z.array(NodeVersion),
@@ -56,12 +98,17 @@ export const NodeVersionList = z.object({
56
98
  rev: z.number().int(),
57
99
  });
58
100
  export const NodeVersionDetail = NodeVersion.extend({
59
- // The text of a document (Markdown) or a table; null for a file, whose bytes come with #41.
101
+ // The text of a document or a task (Markdown) or a table; null for a file, whose bytes come with #41.
60
102
  content: z.string().nullable(),
61
103
  // Only for a file: its media type.
62
104
  mediaType: z.string().nullable(),
63
105
  // Only for a table: its columns with their types in this version (#40).
64
106
  columns: z.array(TableColumn).nullable(),
107
+ // Only for a task of a card kind (#638): the values of its fields in this version, by the field's
108
+ // name and type, a field removed since then included; null for every other version.
109
+ fields: z
110
+ .array(z.object({ name: z.string(), type: CardFieldType, value: CardFieldValue }))
111
+ .nullable(),
65
112
  // The node's revision now: after a restore the one the next save sends.
66
113
  rev: z.number().int(),
67
114
  // A version of a secret node (#357): `content` and `columns` are null while it is `locked` for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anchrd/colab-sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Types, Zod schemas and the service client of Colab, the contract between its UI, backends and outside services.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",