@oblax/workflows 0.0.0-stage → 2.0.0
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/dist/blueprints.d.ts +33 -0
- package/dist/blueprints.d.ts.map +1 -0
- package/dist/blueprints.js +43 -0
- package/dist/blueprints.js.map +1 -0
- package/dist/buckets.d.ts +51 -0
- package/dist/buckets.d.ts.map +1 -0
- package/dist/buckets.js +62 -0
- package/dist/buckets.js.map +1 -0
- package/dist/flows.d.ts +49 -0
- package/dist/flows.d.ts.map +1 -0
- package/dist/flows.js +75 -0
- package/dist/flows.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/item-types.d.ts +37 -0
- package/dist/item-types.d.ts.map +1 -0
- package/dist/item-types.js +53 -0
- package/dist/item-types.js.map +1 -0
- package/dist/items.d.ts +84 -0
- package/dist/items.d.ts.map +1 -0
- package/dist/items.js +190 -0
- package/dist/items.js.map +1 -0
- package/dist/permissions.d.ts +52 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +100 -0
- package/dist/permissions.js.map +1 -0
- package/dist/terms.d.ts +34 -0
- package/dist/terms.d.ts.map +1 -0
- package/dist/terms.js +69 -0
- package/dist/terms.js.map +1 -0
- package/dist/types.d.ts +1036 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/views.d.ts +29 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +51 -0
- package/dist/views.js.map +1 -0
- package/dist/vocabularies.d.ts +31 -0
- package/dist/vocabularies.d.ts.map +1 -0
- package/dist/vocabularies.js +47 -0
- package/dist/vocabularies.js.map +1 -0
- package/dist/workflows-module.d.ts +46 -0
- package/dist/workflows-module.d.ts.map +1 -0
- package/dist/workflows-module.js +45 -0
- package/dist/workflows-module.js.map +1 -0
- package/dist/workspaces.d.ts +42 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +72 -0
- package/dist/workspaces.js.map +1 -0
- package/package.json +49 -3
- package/README.md +0 -3
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1036 @@
|
|
|
1
|
+
import type { FilterOp, ListFilter, ListQuery } from '@oblax/core';
|
|
2
|
+
export type { FilterOp, ListFilter, ListQuery };
|
|
3
|
+
export interface WorkflowsConfig {
|
|
4
|
+
}
|
|
5
|
+
/** Fields every stored record carries. Timestamps are RFC 3339 strings. */
|
|
6
|
+
export interface WorkflowsRecord {
|
|
7
|
+
id: string;
|
|
8
|
+
_created?: string;
|
|
9
|
+
_modified?: string;
|
|
10
|
+
}
|
|
11
|
+
/** A list response: the items and how many there are (in total, for paged lists). */
|
|
12
|
+
export interface WorkflowsList<T> {
|
|
13
|
+
data: T[];
|
|
14
|
+
count: number;
|
|
15
|
+
}
|
|
16
|
+
/** Free-form JSON document. */
|
|
17
|
+
export type JsonObject = Record<string, unknown>;
|
|
18
|
+
/** Text by locale: `{ en: 'Bug', de: 'Fehler' }`. */
|
|
19
|
+
export type Localized = Record<string, string>;
|
|
20
|
+
/** A problem the server reports without refusing the request. */
|
|
21
|
+
export interface Warning {
|
|
22
|
+
field: string;
|
|
23
|
+
validation_check: string;
|
|
24
|
+
value: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** A custom-field rule (item fields, status fields, term fields). */
|
|
27
|
+
export interface FieldRule {
|
|
28
|
+
path: string;
|
|
29
|
+
type: 'string' | 'text' | 'int' | 'number' | 'bool' | 'date' | 'datetime' | 'duration' | 'list' | 'map' | 'object' | 'ref';
|
|
30
|
+
required?: boolean;
|
|
31
|
+
nullable?: boolean;
|
|
32
|
+
rules?: string;
|
|
33
|
+
/** What a `ref` points at, e.g. `filemanager.file`. */
|
|
34
|
+
target?: string;
|
|
35
|
+
}
|
|
36
|
+
export type Category = 'triage' | 'backlog' | 'todo' | 'active' | 'done' | 'cancelled';
|
|
37
|
+
/** How much of a capability a holder has. */
|
|
38
|
+
export type Scope = 'none' | 'own' | 'all' | 'authenticated' | string;
|
|
39
|
+
/** Capability codes to scopes: `{ 'items.edit': 'all', 'items.delete': 'own' }`. */
|
|
40
|
+
export type CapabilitySet = Record<string, Scope>;
|
|
41
|
+
/** `"all"`, or the paths that must be set. */
|
|
42
|
+
export type FieldsRequirement = 'all' | string[] | null;
|
|
43
|
+
export interface IdParams {
|
|
44
|
+
id: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CodeParams {
|
|
47
|
+
code: string;
|
|
48
|
+
}
|
|
49
|
+
/** A short-lived download link. */
|
|
50
|
+
export interface FileLink {
|
|
51
|
+
url: string;
|
|
52
|
+
/** Unix timestamp (seconds). */
|
|
53
|
+
expiration_time: number;
|
|
54
|
+
}
|
|
55
|
+
/** The workflows module's copy of an identity person. */
|
|
56
|
+
export interface Person extends WorkflowsRecord {
|
|
57
|
+
first_name: string;
|
|
58
|
+
last_name: string;
|
|
59
|
+
avatar?: string;
|
|
60
|
+
/** On the assignee picker: the scope the person holds the capability at. */
|
|
61
|
+
scope?: Scope;
|
|
62
|
+
}
|
|
63
|
+
export interface Organization extends WorkflowsRecord {
|
|
64
|
+
name: string;
|
|
65
|
+
}
|
|
66
|
+
export interface Workspace extends WorkflowsRecord {
|
|
67
|
+
code: string;
|
|
68
|
+
name: string;
|
|
69
|
+
description: string;
|
|
70
|
+
settings: JsonObject;
|
|
71
|
+
/** What the caller holds on the workspace. */
|
|
72
|
+
capabilities: CapabilitySet;
|
|
73
|
+
/** Whether the caller is the workspace's team. */
|
|
74
|
+
team: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface CreateWorkspaceParams {
|
|
77
|
+
code: string;
|
|
78
|
+
name: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
settings?: JsonObject;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Replaces the name, description and settings whole, so all three are
|
|
84
|
+
* required: one left out would be cleared. The code can't change.
|
|
85
|
+
*/
|
|
86
|
+
export interface UpdateWorkspaceParams {
|
|
87
|
+
id: string;
|
|
88
|
+
name: string;
|
|
89
|
+
description: string;
|
|
90
|
+
settings: JsonObject;
|
|
91
|
+
}
|
|
92
|
+
export interface ListWorkspacesParams extends ListQuery {
|
|
93
|
+
}
|
|
94
|
+
export interface WorkspacePeopleParams extends ListQuery {
|
|
95
|
+
/** The workspace's id. */
|
|
96
|
+
id: string;
|
|
97
|
+
/** `items.view`, `create`, `edit`, `move`, `assign` or `delete`; `items.move` when left out. */
|
|
98
|
+
capability?: string;
|
|
99
|
+
}
|
|
100
|
+
/** The assignee picker's page. */
|
|
101
|
+
export interface PeoplePage {
|
|
102
|
+
data: Person[];
|
|
103
|
+
count: number;
|
|
104
|
+
/** The scope every signed-in person holds the capability at (through `authenticated` grants). */
|
|
105
|
+
authenticated: Scope;
|
|
106
|
+
}
|
|
107
|
+
export interface Capability {
|
|
108
|
+
code: string;
|
|
109
|
+
/** The container kind it's held on. */
|
|
110
|
+
container: string;
|
|
111
|
+
/** Whether it can be held on own records only. */
|
|
112
|
+
scoped: boolean;
|
|
113
|
+
/** Never given to anonymous visitors. */
|
|
114
|
+
never_public: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface Profile extends WorkflowsRecord {
|
|
117
|
+
code: string;
|
|
118
|
+
name: string;
|
|
119
|
+
description: string;
|
|
120
|
+
capabilities: CapabilitySet;
|
|
121
|
+
builtin: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface CapabilityCatalog {
|
|
124
|
+
module: string;
|
|
125
|
+
capabilities: Capability[];
|
|
126
|
+
container_kinds: string[];
|
|
127
|
+
profiles: Profile[];
|
|
128
|
+
}
|
|
129
|
+
export interface CreateProfileParams {
|
|
130
|
+
code: string;
|
|
131
|
+
name: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
capabilities: CapabilitySet;
|
|
134
|
+
}
|
|
135
|
+
/** Replaces a custom profile's name, description and capabilities. */
|
|
136
|
+
export interface UpdateProfileParams {
|
|
137
|
+
code: string;
|
|
138
|
+
name: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
capabilities: CapabilitySet;
|
|
141
|
+
}
|
|
142
|
+
export type GrantSubjectKind = 'person' | 'role' | 'authenticated' | 'anonymous';
|
|
143
|
+
export interface Grant extends WorkflowsRecord {
|
|
144
|
+
subject: {
|
|
145
|
+
kind: GrantSubjectKind;
|
|
146
|
+
id: string;
|
|
147
|
+
name?: string;
|
|
148
|
+
realm?: string;
|
|
149
|
+
};
|
|
150
|
+
/** Empty for a module-wide grant. */
|
|
151
|
+
container: {
|
|
152
|
+
kind: string;
|
|
153
|
+
id: string;
|
|
154
|
+
};
|
|
155
|
+
/** The profile's code. */
|
|
156
|
+
profile: string;
|
|
157
|
+
}
|
|
158
|
+
export interface ListGrantsParams extends ListQuery {
|
|
159
|
+
/** With `containerId`: one container's grants. */
|
|
160
|
+
containerKind?: string;
|
|
161
|
+
containerId?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface CreateGrantParams {
|
|
164
|
+
subject: {
|
|
165
|
+
kind: GrantSubjectKind;
|
|
166
|
+
id?: string;
|
|
167
|
+
};
|
|
168
|
+
/** Left out for a module-wide grant. */
|
|
169
|
+
container?: {
|
|
170
|
+
kind: string;
|
|
171
|
+
id: string;
|
|
172
|
+
};
|
|
173
|
+
profile: string;
|
|
174
|
+
}
|
|
175
|
+
/** Changes a grant's profile; its subject and container can't change. */
|
|
176
|
+
export interface UpdateGrantParams {
|
|
177
|
+
id: string;
|
|
178
|
+
profile: string;
|
|
179
|
+
}
|
|
180
|
+
export interface ContainerParams {
|
|
181
|
+
containerKind?: string;
|
|
182
|
+
containerId?: string;
|
|
183
|
+
}
|
|
184
|
+
/** What the caller holds. */
|
|
185
|
+
export interface MyPermissions {
|
|
186
|
+
/** The caller's subject kind, e.g. `person` or `anonymous` for a visitor. */
|
|
187
|
+
kind: string;
|
|
188
|
+
person_id: string;
|
|
189
|
+
role: string;
|
|
190
|
+
realm: string;
|
|
191
|
+
caller: string;
|
|
192
|
+
admin: boolean;
|
|
193
|
+
/** Whether the caller is the container's team. */
|
|
194
|
+
team: boolean;
|
|
195
|
+
module: CapabilitySet;
|
|
196
|
+
/** On the container asked about. */
|
|
197
|
+
container: CapabilitySet;
|
|
198
|
+
}
|
|
199
|
+
export interface HoldersParams extends ContainerParams {
|
|
200
|
+
capability: string;
|
|
201
|
+
}
|
|
202
|
+
export interface Holders {
|
|
203
|
+
grants: Array<{
|
|
204
|
+
grant: Grant;
|
|
205
|
+
scope: Scope;
|
|
206
|
+
}>;
|
|
207
|
+
/** Roles of type admin, which hold everything. */
|
|
208
|
+
admin_roles: Array<{
|
|
209
|
+
name: string;
|
|
210
|
+
type: string;
|
|
211
|
+
realm_id: string;
|
|
212
|
+
realm_name: string;
|
|
213
|
+
}>;
|
|
214
|
+
}
|
|
215
|
+
export interface StatusEntry {
|
|
216
|
+
/** Profiles or roles that may move items in; empty is anyone with `items.move`. */
|
|
217
|
+
who?: string[];
|
|
218
|
+
require_fields?: FieldsRequirement;
|
|
219
|
+
require_note?: boolean;
|
|
220
|
+
require_assignee?: boolean;
|
|
221
|
+
/** Who an item is assigned to on entry. */
|
|
222
|
+
assign_on_entry?: string;
|
|
223
|
+
}
|
|
224
|
+
export interface Status {
|
|
225
|
+
id?: string;
|
|
226
|
+
code: string;
|
|
227
|
+
name: string;
|
|
228
|
+
description?: string;
|
|
229
|
+
color?: string;
|
|
230
|
+
category: Category;
|
|
231
|
+
position?: number;
|
|
232
|
+
/** Most items in the status; 0 is no limit. */
|
|
233
|
+
wip_limit?: number;
|
|
234
|
+
wip?: 'warn' | 'refuse';
|
|
235
|
+
/** Pause SLA clocks while items are here. */
|
|
236
|
+
sla_pause?: boolean;
|
|
237
|
+
fields?: JsonObject | null;
|
|
238
|
+
entry?: StatusEntry;
|
|
239
|
+
/** Move items on after a while: `{ to: 'closed', after: '72h' }`. */
|
|
240
|
+
timed_move?: {
|
|
241
|
+
to: string;
|
|
242
|
+
after: string;
|
|
243
|
+
} | null;
|
|
244
|
+
}
|
|
245
|
+
export interface Transition {
|
|
246
|
+
code: string;
|
|
247
|
+
name: string;
|
|
248
|
+
from: string[];
|
|
249
|
+
to: string;
|
|
250
|
+
require_fields?: FieldsRequirement;
|
|
251
|
+
require_note?: boolean;
|
|
252
|
+
who?: string[];
|
|
253
|
+
}
|
|
254
|
+
/** A flow's editable document. */
|
|
255
|
+
export interface FlowDocument {
|
|
256
|
+
code: string;
|
|
257
|
+
name: string;
|
|
258
|
+
description?: string;
|
|
259
|
+
/** `free`: any status to any; `defined`: only through `transitions`. */
|
|
260
|
+
moves?: 'free' | 'defined';
|
|
261
|
+
transitions?: Transition[];
|
|
262
|
+
status_fields?: FieldRule[];
|
|
263
|
+
statuses: Status[];
|
|
264
|
+
}
|
|
265
|
+
export interface Flow extends WorkflowsRecord, FlowDocument {
|
|
266
|
+
workspace_id: string;
|
|
267
|
+
description: string;
|
|
268
|
+
moves: 'free' | 'defined';
|
|
269
|
+
transitions: Transition[];
|
|
270
|
+
status_fields: FieldRule[];
|
|
271
|
+
/** Send it back as `expect` on save. */
|
|
272
|
+
version: number;
|
|
273
|
+
}
|
|
274
|
+
export interface CreateFlowParams extends FlowDocument {
|
|
275
|
+
workspaceId: string;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Replaces the flow whole: send the full document (statuses included), as
|
|
279
|
+
* read from `get()`. Anything left out is cleared. The workspace and code
|
|
280
|
+
* can't change; `code` may be left out.
|
|
281
|
+
*/
|
|
282
|
+
export interface UpdateFlowParams extends Omit<FlowDocument, 'code'> {
|
|
283
|
+
code?: string;
|
|
284
|
+
id: string;
|
|
285
|
+
/** The `version` the editor loaded; a stale one fails with 409. */
|
|
286
|
+
expect: number;
|
|
287
|
+
/** For deleted statuses: old status code to the code its items move to. */
|
|
288
|
+
statusMap?: Record<string, string>;
|
|
289
|
+
}
|
|
290
|
+
export interface CopyFlowParams {
|
|
291
|
+
id: string;
|
|
292
|
+
/** Each left out keeps the source's. */
|
|
293
|
+
workspaceId?: string;
|
|
294
|
+
code?: string;
|
|
295
|
+
name?: string;
|
|
296
|
+
}
|
|
297
|
+
export interface FlowVersion extends WorkflowsRecord {
|
|
298
|
+
flow_id: string;
|
|
299
|
+
version: number;
|
|
300
|
+
/** The flow as saved; left out of lists. */
|
|
301
|
+
content?: FlowDocument;
|
|
302
|
+
author_id: string;
|
|
303
|
+
note: string;
|
|
304
|
+
}
|
|
305
|
+
export interface ListFlowVersionsParams {
|
|
306
|
+
id: string;
|
|
307
|
+
/** 1 to 20; 20 when left out. */
|
|
308
|
+
limit?: number;
|
|
309
|
+
}
|
|
310
|
+
export interface FlowVersionParams {
|
|
311
|
+
id: string;
|
|
312
|
+
version: number;
|
|
313
|
+
}
|
|
314
|
+
export interface WorkspaceScopedParams {
|
|
315
|
+
workspaceId: string;
|
|
316
|
+
}
|
|
317
|
+
/** How a vocabulary is used by a type's items. */
|
|
318
|
+
export interface VocabularyUsage {
|
|
319
|
+
required?: boolean;
|
|
320
|
+
min?: number;
|
|
321
|
+
max?: number;
|
|
322
|
+
shared?: boolean;
|
|
323
|
+
}
|
|
324
|
+
/** An item type's editable document. */
|
|
325
|
+
export interface ItemTypeDocument {
|
|
326
|
+
code: string;
|
|
327
|
+
name: string;
|
|
328
|
+
description?: string;
|
|
329
|
+
flow_id: string;
|
|
330
|
+
/** Status code new items start in. */
|
|
331
|
+
initial_status?: string;
|
|
332
|
+
/** Status code for items made by callers without `items.move`. */
|
|
333
|
+
intake_status?: string;
|
|
334
|
+
fields?: FieldRule[];
|
|
335
|
+
/** By status code. */
|
|
336
|
+
status_rules?: Record<string, {
|
|
337
|
+
require_fields?: FieldsRequirement;
|
|
338
|
+
}>;
|
|
339
|
+
/** By vocabulary code. */
|
|
340
|
+
vocabularies?: Record<string, VocabularyUsage>;
|
|
341
|
+
/** Type codes allowed as children. */
|
|
342
|
+
children?: string[];
|
|
343
|
+
/** Close an item when its children are all closed. */
|
|
344
|
+
auto_close?: boolean;
|
|
345
|
+
/** Duration, e.g. `24h`. */
|
|
346
|
+
auto_close_after?: string;
|
|
347
|
+
/** What happens when a child starts under a parent that hasn't. */
|
|
348
|
+
child_start?: 'allow' | 'start_parent' | 'refuse';
|
|
349
|
+
/** How long a closed item may be reopened, e.g. `168h`. */
|
|
350
|
+
reopen_window?: string;
|
|
351
|
+
/** Types items convert into, and the done status the original moves to. */
|
|
352
|
+
converts_to?: Array<{
|
|
353
|
+
type: string;
|
|
354
|
+
status: string;
|
|
355
|
+
}>;
|
|
356
|
+
/** Comment type code for the items' discussions. */
|
|
357
|
+
comment_type?: string;
|
|
358
|
+
visible_to: 'everyone' | 'team';
|
|
359
|
+
/** Duration before `due_at` to remind, e.g. `24h`. */
|
|
360
|
+
due_reminder?: string;
|
|
361
|
+
/** SLA targets: target code to duration, e.g. `{ first_response: '4h' }`. */
|
|
362
|
+
sla?: Record<string, string>;
|
|
363
|
+
/**
|
|
364
|
+
* Makes the type a bucket type (a sprint, a release): its items are
|
|
365
|
+
* buckets other items join. `null` or left out for a plain type.
|
|
366
|
+
*/
|
|
367
|
+
bucket?: BucketSection | null;
|
|
368
|
+
}
|
|
369
|
+
/** Who may change a bucket's members while it's in a status. */
|
|
370
|
+
export type BucketMembershipRule = 'open' | 'owner' | 'locked';
|
|
371
|
+
/**
|
|
372
|
+
* A bucket type's number summed over its members: a capacity (`limit`, with
|
|
373
|
+
* `over`) or a target (`goal`), not both.
|
|
374
|
+
*/
|
|
375
|
+
export interface BucketMeasureRule {
|
|
376
|
+
/** A `number` or `int` field every member type has. */
|
|
377
|
+
field: string;
|
|
378
|
+
limit?: number;
|
|
379
|
+
/** What a join past `limit` does; `warn` when left out. */
|
|
380
|
+
over?: 'warn' | 'refuse';
|
|
381
|
+
goal?: number;
|
|
382
|
+
}
|
|
383
|
+
/** The `bucket` section of a bucket type. */
|
|
384
|
+
export interface BucketSection {
|
|
385
|
+
/** Codes of the types whose items can join, 1 to 50, none a bucket type. */
|
|
386
|
+
members: string[];
|
|
387
|
+
/** How many of the type's buckets may be active at once in the workspace; 0 for no cap. */
|
|
388
|
+
active_limit?: number;
|
|
389
|
+
/** What a close does with unfinished members; `release` when left out. */
|
|
390
|
+
on_close?: 'carry' | 'release' | 'refuse';
|
|
391
|
+
/** By open status code; open statuses left out are `open`, closed ones always `locked`. */
|
|
392
|
+
membership?: Record<string, BucketMembershipRule>;
|
|
393
|
+
measure?: BucketMeasureRule | null;
|
|
394
|
+
/** How a close makes the next bucket: `{ title: 'Sprint {n}', every: '14d' }`. */
|
|
395
|
+
next?: {
|
|
396
|
+
title: string;
|
|
397
|
+
every: string;
|
|
398
|
+
} | null;
|
|
399
|
+
}
|
|
400
|
+
export interface ItemType extends WorkflowsRecord, ItemTypeDocument {
|
|
401
|
+
workspace_id: string;
|
|
402
|
+
version: number;
|
|
403
|
+
}
|
|
404
|
+
export interface CreateItemTypeParams extends ItemTypeDocument {
|
|
405
|
+
workspaceId: string;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Replaces the type whole: send the full document, as read from `get()`.
|
|
409
|
+
* Anything left out is cleared. The workspace and code can't change; `code`
|
|
410
|
+
* may be left out.
|
|
411
|
+
*/
|
|
412
|
+
export interface UpdateItemTypeParams extends Omit<ItemTypeDocument, 'code'> {
|
|
413
|
+
code?: string;
|
|
414
|
+
id: string;
|
|
415
|
+
/** The `version` the editor loaded. */
|
|
416
|
+
expect: number;
|
|
417
|
+
/** When pointing the type at another flow: old status codes to the new flow's. */
|
|
418
|
+
statusMap?: Record<string, string>;
|
|
419
|
+
}
|
|
420
|
+
export interface SlaState {
|
|
421
|
+
target: string;
|
|
422
|
+
within: number;
|
|
423
|
+
elapsed: number;
|
|
424
|
+
state: string;
|
|
425
|
+
due_at: string | null;
|
|
426
|
+
}
|
|
427
|
+
export interface ItemFile extends WorkflowsRecord {
|
|
428
|
+
name: string;
|
|
429
|
+
type: string;
|
|
430
|
+
size: number;
|
|
431
|
+
public: boolean;
|
|
432
|
+
path?: string;
|
|
433
|
+
width: number;
|
|
434
|
+
height: number;
|
|
435
|
+
}
|
|
436
|
+
/** A status the item can move to, with what the move needs. */
|
|
437
|
+
export interface MoveOption {
|
|
438
|
+
to: string;
|
|
439
|
+
name: string;
|
|
440
|
+
category: Category;
|
|
441
|
+
transition?: string;
|
|
442
|
+
allowed: boolean;
|
|
443
|
+
/** Fields the move needs that the item lacks. */
|
|
444
|
+
missing?: string[];
|
|
445
|
+
note?: boolean;
|
|
446
|
+
assignee?: boolean;
|
|
447
|
+
reason?: string;
|
|
448
|
+
}
|
|
449
|
+
export interface ItemSummary {
|
|
450
|
+
id: string;
|
|
451
|
+
key?: string;
|
|
452
|
+
title?: string;
|
|
453
|
+
status_category?: Category;
|
|
454
|
+
closed_at?: string;
|
|
455
|
+
/** The caller can't see it. */
|
|
456
|
+
hidden?: boolean;
|
|
457
|
+
}
|
|
458
|
+
export interface SubtreeCounts {
|
|
459
|
+
count: number;
|
|
460
|
+
open: number;
|
|
461
|
+
triage: number;
|
|
462
|
+
backlog: number;
|
|
463
|
+
todo: number;
|
|
464
|
+
active: number;
|
|
465
|
+
done: number;
|
|
466
|
+
cancelled: number;
|
|
467
|
+
}
|
|
468
|
+
export interface Item extends WorkflowsRecord {
|
|
469
|
+
workspace_id: string;
|
|
470
|
+
type_id: string;
|
|
471
|
+
/** The type's code. */
|
|
472
|
+
type: string;
|
|
473
|
+
number: number;
|
|
474
|
+
/** `CRM-42`; routes take it in place of the id. */
|
|
475
|
+
key: string;
|
|
476
|
+
title: string;
|
|
477
|
+
body: string;
|
|
478
|
+
body_format: string;
|
|
479
|
+
status_id: string;
|
|
480
|
+
/** The status's code. */
|
|
481
|
+
status: string;
|
|
482
|
+
status_category: Category;
|
|
483
|
+
rank: string;
|
|
484
|
+
reporter_id: string;
|
|
485
|
+
assignee_id: string;
|
|
486
|
+
watcher_ids: string[];
|
|
487
|
+
due_at: string | null;
|
|
488
|
+
fields: JsonObject | null;
|
|
489
|
+
terms: Record<string, string[]> | null;
|
|
490
|
+
subject_type: string;
|
|
491
|
+
subject_id: string;
|
|
492
|
+
subject: JsonObject | null;
|
|
493
|
+
dedupe_key: string;
|
|
494
|
+
origin_id: string;
|
|
495
|
+
origin: string;
|
|
496
|
+
parent_id: string;
|
|
497
|
+
root_id: string;
|
|
498
|
+
depth: number;
|
|
499
|
+
child_count: number;
|
|
500
|
+
child_open: number;
|
|
501
|
+
child_done: number;
|
|
502
|
+
child_cancelled: number;
|
|
503
|
+
triaged_at: string | null;
|
|
504
|
+
started_at: string | null;
|
|
505
|
+
closed_at: string | null;
|
|
506
|
+
auto_close_at: string | null;
|
|
507
|
+
/** Send it back as `expect` on save. */
|
|
508
|
+
version: number;
|
|
509
|
+
parent: ItemSummary | null;
|
|
510
|
+
/** For follow-ups and conversions: the item it came from. */
|
|
511
|
+
original: ItemSummary | null;
|
|
512
|
+
people: Person[];
|
|
513
|
+
organizations: Organization[];
|
|
514
|
+
/** What the caller may do on the item. */
|
|
515
|
+
can: Record<string, boolean>;
|
|
516
|
+
/** With `include: ['moves']`. */
|
|
517
|
+
moves?: MoveOption[];
|
|
518
|
+
/** With `include: ['subtree']`. */
|
|
519
|
+
subtree?: SubtreeCounts;
|
|
520
|
+
warnings?: Warning[];
|
|
521
|
+
files: ItemFile[];
|
|
522
|
+
timed_move_at: string | null;
|
|
523
|
+
sla: SlaState[];
|
|
524
|
+
/** The buckets the item is in now, one per bucket type; `[]` for none. */
|
|
525
|
+
buckets: BucketSummary[];
|
|
526
|
+
/** A bucket's own numbers; `null` on items that aren't buckets. */
|
|
527
|
+
bucket: BucketStats | null;
|
|
528
|
+
}
|
|
529
|
+
export interface ListItemsParams extends ListQuery {
|
|
530
|
+
/** Add each item's moves (at most 100 items a page). */
|
|
531
|
+
includeMoves?: boolean;
|
|
532
|
+
}
|
|
533
|
+
export interface GetItemParams {
|
|
534
|
+
/** The item's id or key. */
|
|
535
|
+
id: string;
|
|
536
|
+
include?: Array<'moves' | 'subtree'>;
|
|
537
|
+
}
|
|
538
|
+
/** Item content as sent on create, ensure and update. */
|
|
539
|
+
export interface ItemInput {
|
|
540
|
+
title?: string;
|
|
541
|
+
body?: string;
|
|
542
|
+
bodyFormat?: string;
|
|
543
|
+
fields?: JsonObject;
|
|
544
|
+
/** Term ids by vocabulary code. */
|
|
545
|
+
terms?: Record<string, Array<string | {
|
|
546
|
+
name: string;
|
|
547
|
+
}>>;
|
|
548
|
+
dueAt?: string | null;
|
|
549
|
+
assigneeId?: string | null;
|
|
550
|
+
parentId?: string | null;
|
|
551
|
+
}
|
|
552
|
+
export interface CreateItemParams extends ItemInput {
|
|
553
|
+
workspaceId: string;
|
|
554
|
+
/** The type's code; or give `typeId`. */
|
|
555
|
+
type?: string;
|
|
556
|
+
typeId?: string;
|
|
557
|
+
title: string;
|
|
558
|
+
watcherIds?: string[];
|
|
559
|
+
/** A status code of a starting category; needs `items.move`. */
|
|
560
|
+
status?: string;
|
|
561
|
+
statusId?: string;
|
|
562
|
+
subjectType?: string;
|
|
563
|
+
subjectId?: string;
|
|
564
|
+
/** Snapshot of the subject (name, URL, ...). */
|
|
565
|
+
subject?: JsonObject;
|
|
566
|
+
dedupeKey?: string;
|
|
567
|
+
}
|
|
568
|
+
/** Returns the item a subject has in a type, or makes one. The subject is required. */
|
|
569
|
+
export interface EnsureItemParams extends CreateItemParams {
|
|
570
|
+
subjectType: string;
|
|
571
|
+
subjectId: string;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Changes the keys given and keeps the others; `null` clears one. Status
|
|
575
|
+
* changes go through `move()`, watchers through `watch()`.
|
|
576
|
+
*/
|
|
577
|
+
export interface UpdateItemParams extends ItemInput {
|
|
578
|
+
id: string;
|
|
579
|
+
/** The `version` the editor loaded. */
|
|
580
|
+
expect: number;
|
|
581
|
+
reporterId?: string;
|
|
582
|
+
}
|
|
583
|
+
export interface DeleteItemParams {
|
|
584
|
+
id: string;
|
|
585
|
+
/** Delete the whole subtree too. */
|
|
586
|
+
cascade?: boolean;
|
|
587
|
+
}
|
|
588
|
+
export interface MoveItemParams {
|
|
589
|
+
id: string;
|
|
590
|
+
/** The status code to move to. */
|
|
591
|
+
to: string;
|
|
592
|
+
/** The status code the caller saw; a stale one fails with 409. */
|
|
593
|
+
expect?: string;
|
|
594
|
+
note?: string;
|
|
595
|
+
/** Merged into the item's fields; `null` removes a key. */
|
|
596
|
+
fields?: JsonObject;
|
|
597
|
+
/** An id, `''` to unassign; left out, the status's `assign_on_entry` picks. */
|
|
598
|
+
assigneeId?: string;
|
|
599
|
+
/** Place it after this item in the status (id or key); left out, the top. */
|
|
600
|
+
afterId?: string;
|
|
601
|
+
/** On a move into a cancelled status: the item this one duplicates. */
|
|
602
|
+
duplicateOf?: string;
|
|
603
|
+
/**
|
|
604
|
+
* When closing a bucket: where its open members go. A bucket's id or key,
|
|
605
|
+
* `new` (a bucket made from the type's `next`) or `none` (released). Left
|
|
606
|
+
* out, the type's `on_close` decides.
|
|
607
|
+
*/
|
|
608
|
+
carryTo?: string;
|
|
609
|
+
}
|
|
610
|
+
export interface RankItemParams {
|
|
611
|
+
id: string;
|
|
612
|
+
/** Left out, the top of the status. */
|
|
613
|
+
afterId?: string;
|
|
614
|
+
}
|
|
615
|
+
export interface ItemHistoryParams extends ListQuery {
|
|
616
|
+
id: string;
|
|
617
|
+
}
|
|
618
|
+
export type HistoryKind = 'created' | 'updated' | 'moved' | 'assigned' | 'deleted' | 'parent_changed' | 'converted' | 'retyped' | 'linked' | 'unlinked' | 'move_refused' | 'bucket_joined' | 'bucket_left';
|
|
619
|
+
export interface HistoryEntry extends WorkflowsRecord {
|
|
620
|
+
workspace_id: string;
|
|
621
|
+
item_id: string;
|
|
622
|
+
kind: HistoryKind;
|
|
623
|
+
from_status_id: string;
|
|
624
|
+
from_status: string;
|
|
625
|
+
from_category: string;
|
|
626
|
+
to_status_id: string;
|
|
627
|
+
to_status: string;
|
|
628
|
+
to_category: string;
|
|
629
|
+
transition: string;
|
|
630
|
+
note: string;
|
|
631
|
+
changes: Array<{
|
|
632
|
+
path: string;
|
|
633
|
+
from?: unknown;
|
|
634
|
+
to?: unknown;
|
|
635
|
+
}> | null;
|
|
636
|
+
warnings: Warning[] | null;
|
|
637
|
+
actor_kind: string;
|
|
638
|
+
actor_id: string;
|
|
639
|
+
}
|
|
640
|
+
export interface HistoryPage {
|
|
641
|
+
data: HistoryEntry[];
|
|
642
|
+
count: number;
|
|
643
|
+
/** The people the page names. */
|
|
644
|
+
people: Person[];
|
|
645
|
+
}
|
|
646
|
+
export interface WatchParams {
|
|
647
|
+
id: string;
|
|
648
|
+
/** Left out, the caller. */
|
|
649
|
+
personId?: string;
|
|
650
|
+
}
|
|
651
|
+
export interface FollowUpParams {
|
|
652
|
+
/** The closed item's id or key. */
|
|
653
|
+
id: string;
|
|
654
|
+
title?: string;
|
|
655
|
+
body?: string;
|
|
656
|
+
bodyFormat?: string;
|
|
657
|
+
fields?: JsonObject;
|
|
658
|
+
terms?: ItemInput['terms'];
|
|
659
|
+
parentId?: string;
|
|
660
|
+
}
|
|
661
|
+
export interface ConvertItemParams {
|
|
662
|
+
id: string;
|
|
663
|
+
/** A type code the item's type lists in `converts_to`. */
|
|
664
|
+
type: string;
|
|
665
|
+
title?: string;
|
|
666
|
+
fields?: JsonObject;
|
|
667
|
+
terms?: ItemInput['terms'];
|
|
668
|
+
/** The status code the caller saw. */
|
|
669
|
+
expect?: string;
|
|
670
|
+
note?: string;
|
|
671
|
+
}
|
|
672
|
+
export interface RetypeItemParams {
|
|
673
|
+
id: string;
|
|
674
|
+
/** A type sharing the item's flow. */
|
|
675
|
+
type: string;
|
|
676
|
+
/** The `version` the editor loaded. */
|
|
677
|
+
expect: number;
|
|
678
|
+
/** `null` drops a path the new type doesn't have. */
|
|
679
|
+
fields?: JsonObject;
|
|
680
|
+
terms?: ItemInput['terms'];
|
|
681
|
+
}
|
|
682
|
+
/** What `resend()` sent. */
|
|
683
|
+
export interface Resent {
|
|
684
|
+
item_id: string;
|
|
685
|
+
events: string[];
|
|
686
|
+
history_id: string;
|
|
687
|
+
moved_at: string | null;
|
|
688
|
+
from: string;
|
|
689
|
+
to: string;
|
|
690
|
+
}
|
|
691
|
+
export type LinkKind = 'blocks' | 'blocked_by' | 'relates' | 'duplicates' | 'duplicated_by';
|
|
692
|
+
export interface ItemLink {
|
|
693
|
+
id: string;
|
|
694
|
+
_created?: string;
|
|
695
|
+
workspace_id: string;
|
|
696
|
+
/** Read from the item's side. */
|
|
697
|
+
kind: LinkKind;
|
|
698
|
+
from_id: string;
|
|
699
|
+
to_id: string;
|
|
700
|
+
/** The item at the other end. */
|
|
701
|
+
item: {
|
|
702
|
+
id: string;
|
|
703
|
+
key: string;
|
|
704
|
+
title: string;
|
|
705
|
+
type_id: string;
|
|
706
|
+
type: string;
|
|
707
|
+
status_id: string;
|
|
708
|
+
status: string;
|
|
709
|
+
status_category: Category;
|
|
710
|
+
closed_at: string | null;
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
export interface LinkParams {
|
|
714
|
+
/** The item's id or key. */
|
|
715
|
+
id: string;
|
|
716
|
+
kind: LinkKind;
|
|
717
|
+
/** The other item's id or key. */
|
|
718
|
+
itemId: string;
|
|
719
|
+
}
|
|
720
|
+
export interface ItemFileParams {
|
|
721
|
+
id: string;
|
|
722
|
+
fileId: string;
|
|
723
|
+
}
|
|
724
|
+
/** A bucket as an item's `buckets` shows it. */
|
|
725
|
+
export interface BucketSummary {
|
|
726
|
+
id: string;
|
|
727
|
+
key?: string;
|
|
728
|
+
title?: string;
|
|
729
|
+
/** The bucket type's code. */
|
|
730
|
+
type?: string;
|
|
731
|
+
status_category?: Category;
|
|
732
|
+
/** The caller can't see it; only `id` is set. */
|
|
733
|
+
hidden?: boolean;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* A bucket's own numbers (its item's `bucket`). Counts and sums include
|
|
737
|
+
* members the caller can't see.
|
|
738
|
+
*/
|
|
739
|
+
export interface BucketStats {
|
|
740
|
+
/** Its number among its type's buckets in the workspace: the `{n}` of `next.title`. */
|
|
741
|
+
seq: number;
|
|
742
|
+
/** The current members by category. */
|
|
743
|
+
members: {
|
|
744
|
+
count: number;
|
|
745
|
+
open: number;
|
|
746
|
+
done: number;
|
|
747
|
+
cancelled: number;
|
|
748
|
+
};
|
|
749
|
+
/** `null` until the bucket first starts; then how many it committed to. */
|
|
750
|
+
committed: number | null;
|
|
751
|
+
/** `null` until the first start; then how many joined after it. */
|
|
752
|
+
added: number | null;
|
|
753
|
+
/** `null` until the first start; then how many were taken out or moved away after it. */
|
|
754
|
+
removed: number | null;
|
|
755
|
+
/** `null` without a measure. */
|
|
756
|
+
measure: {
|
|
757
|
+
field: string;
|
|
758
|
+
/** The current members but the cancelled ones. */
|
|
759
|
+
total: number;
|
|
760
|
+
done: number;
|
|
761
|
+
/** The values recorded at the first start; `null` before it. */
|
|
762
|
+
committed: number | null;
|
|
763
|
+
limit?: number;
|
|
764
|
+
goal?: number;
|
|
765
|
+
/** `total` is past `limit`. */
|
|
766
|
+
over: boolean;
|
|
767
|
+
} | null;
|
|
768
|
+
/** A close is being settled; every move of the bucket is refused meanwhile. */
|
|
769
|
+
closing: boolean;
|
|
770
|
+
}
|
|
771
|
+
/** Why a membership row ended; `null` while it's current. */
|
|
772
|
+
export type BucketOutcome = 'removed' | 'moved' | 'done' | 'cancelled' | 'carried' | 'released';
|
|
773
|
+
/**
|
|
774
|
+
* One stay of an item in a bucket. Moving an item from Sprint 15 to Sprint 16
|
|
775
|
+
* ends one row and starts another.
|
|
776
|
+
*/
|
|
777
|
+
export interface BucketMember {
|
|
778
|
+
id: string;
|
|
779
|
+
workspace_id: string;
|
|
780
|
+
bucket_id: string;
|
|
781
|
+
bucket_type_id: string;
|
|
782
|
+
item_id: string;
|
|
783
|
+
joined_at: string | null;
|
|
784
|
+
left_at: string | null;
|
|
785
|
+
/** In the bucket when it first started. */
|
|
786
|
+
committed: boolean;
|
|
787
|
+
/** The measure's value at the first start. */
|
|
788
|
+
committed_value: number | null;
|
|
789
|
+
/** The measure's value when the row ended. */
|
|
790
|
+
final_value: number | null;
|
|
791
|
+
outcome: BucketOutcome | null;
|
|
792
|
+
/** For `moved` and `carried`: the bucket it went to. */
|
|
793
|
+
next_bucket_id: string | null;
|
|
794
|
+
/** In a bucket's member list: the member. */
|
|
795
|
+
item?: {
|
|
796
|
+
id: string;
|
|
797
|
+
key: string;
|
|
798
|
+
title: string;
|
|
799
|
+
type_id: string;
|
|
800
|
+
type: string;
|
|
801
|
+
status_id: string;
|
|
802
|
+
status: string;
|
|
803
|
+
status_category: Category;
|
|
804
|
+
closed_at: string | null;
|
|
805
|
+
};
|
|
806
|
+
/** In an item's bucket list: the bucket. */
|
|
807
|
+
bucket?: BucketSummary;
|
|
808
|
+
}
|
|
809
|
+
/** What `add()` answers: the row, with the measure's warnings (`[]` for none). */
|
|
810
|
+
export interface BucketJoin extends BucketMember {
|
|
811
|
+
warnings: Warning[];
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* A page of membership rows. Filter on `current` (`true` for what's in it
|
|
815
|
+
* now; without it the list holds every row), `outcome`, and `item_id` (a
|
|
816
|
+
* bucket's members) or `bucket_type_id` (an item's buckets); order by
|
|
817
|
+
* `joined_at` or `left_at`. `limit` is 100 by default, 500 at most.
|
|
818
|
+
*/
|
|
819
|
+
export interface ListBucketMembersParams extends ListQuery {
|
|
820
|
+
/** The bucket's id or key. */
|
|
821
|
+
id: string;
|
|
822
|
+
}
|
|
823
|
+
export interface ListItemBucketsParams extends ListQuery {
|
|
824
|
+
/** The item's id or key. */
|
|
825
|
+
id: string;
|
|
826
|
+
}
|
|
827
|
+
export interface AddBucketMemberParams {
|
|
828
|
+
/** The bucket's id or key. */
|
|
829
|
+
id: string;
|
|
830
|
+
/** The item's id or key. */
|
|
831
|
+
itemId: string;
|
|
832
|
+
/** For a move between buckets of one type: the bucket the item leaves (id or key). */
|
|
833
|
+
from?: string;
|
|
834
|
+
}
|
|
835
|
+
export interface RemoveBucketMemberParams {
|
|
836
|
+
/** The bucket's id or key. */
|
|
837
|
+
id: string;
|
|
838
|
+
/** The item's id or key. */
|
|
839
|
+
itemId: string;
|
|
840
|
+
}
|
|
841
|
+
export interface BoardParams {
|
|
842
|
+
/** The workspace's id. */
|
|
843
|
+
id: string;
|
|
844
|
+
/** A type's code or id; left out, every type the caller sees. */
|
|
845
|
+
type?: string;
|
|
846
|
+
/** A column per status (default) or per category. */
|
|
847
|
+
group?: 'status' | 'category';
|
|
848
|
+
/** `todo`, `active`, `done`, `cancelled` when left out. */
|
|
849
|
+
categories?: Category[];
|
|
850
|
+
/** Items a column, 1 to 100 (20 by default). */
|
|
851
|
+
limit?: number;
|
|
852
|
+
/** The item list's filters, applied to every column. */
|
|
853
|
+
filters?: ListFilter[];
|
|
854
|
+
}
|
|
855
|
+
export interface BoardColumn {
|
|
856
|
+
key: string;
|
|
857
|
+
name: string;
|
|
858
|
+
category: Category;
|
|
859
|
+
status_ids: string[];
|
|
860
|
+
wip_limit: number;
|
|
861
|
+
wip?: 'warn' | 'refuse';
|
|
862
|
+
full: boolean;
|
|
863
|
+
/** Items the caller sees in the column. */
|
|
864
|
+
count: number;
|
|
865
|
+
items: Item[];
|
|
866
|
+
}
|
|
867
|
+
export interface Board {
|
|
868
|
+
workspace_id: string;
|
|
869
|
+
group: 'status' | 'category';
|
|
870
|
+
type_id: string;
|
|
871
|
+
type: string;
|
|
872
|
+
columns: BoardColumn[];
|
|
873
|
+
}
|
|
874
|
+
export interface ViewFilter {
|
|
875
|
+
field: string;
|
|
876
|
+
op: string;
|
|
877
|
+
value: string;
|
|
878
|
+
}
|
|
879
|
+
export interface View extends WorkflowsRecord {
|
|
880
|
+
workspace_id: string;
|
|
881
|
+
name: string;
|
|
882
|
+
shared: boolean;
|
|
883
|
+
owner_id: string;
|
|
884
|
+
filters: ViewFilter[];
|
|
885
|
+
group_by: string;
|
|
886
|
+
sort: {
|
|
887
|
+
field: string;
|
|
888
|
+
dir: 'asc' | 'desc';
|
|
889
|
+
} | null;
|
|
890
|
+
/** The item list's query string the view stands for. */
|
|
891
|
+
query: string;
|
|
892
|
+
/** What the view names that's gone since it was saved. */
|
|
893
|
+
warnings?: Warning[];
|
|
894
|
+
}
|
|
895
|
+
export interface CreateViewParams {
|
|
896
|
+
workspaceId: string;
|
|
897
|
+
name: string;
|
|
898
|
+
/** Shared views need `workspace.manage`; personal ones are the caller's. */
|
|
899
|
+
shared?: boolean;
|
|
900
|
+
filters?: ViewFilter[];
|
|
901
|
+
groupBy?: string;
|
|
902
|
+
sort?: {
|
|
903
|
+
field: string;
|
|
904
|
+
dir: 'asc' | 'desc';
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
/** Changes the keys given. The workspace and `shared` can't change. */
|
|
908
|
+
export interface UpdateViewParams {
|
|
909
|
+
id: string;
|
|
910
|
+
name?: string;
|
|
911
|
+
filters?: ViewFilter[];
|
|
912
|
+
groupBy?: string;
|
|
913
|
+
/** `null` removes the sort. */
|
|
914
|
+
sort?: {
|
|
915
|
+
field: string;
|
|
916
|
+
dir: 'asc' | 'desc';
|
|
917
|
+
} | null;
|
|
918
|
+
}
|
|
919
|
+
export interface VocabularySettings {
|
|
920
|
+
max_depth: number;
|
|
921
|
+
open: boolean;
|
|
922
|
+
pattern: string;
|
|
923
|
+
term_fields: FieldRule[];
|
|
924
|
+
manage_roles: string[];
|
|
925
|
+
create_roles: string[];
|
|
926
|
+
}
|
|
927
|
+
export interface Vocabulary extends WorkflowsRecord {
|
|
928
|
+
code: string;
|
|
929
|
+
name: Localized;
|
|
930
|
+
shape: 'flat' | 'tree';
|
|
931
|
+
settings: VocabularySettings;
|
|
932
|
+
/** Empty for a module-wide vocabulary. */
|
|
933
|
+
workspace_id: string;
|
|
934
|
+
}
|
|
935
|
+
/** A workspace's vocabulary when `workspaceId` is given, else a module-wide one. */
|
|
936
|
+
export interface VocabularyScope {
|
|
937
|
+
workspaceId?: string;
|
|
938
|
+
}
|
|
939
|
+
export interface ListVocabulariesParams extends VocabularyScope {
|
|
940
|
+
}
|
|
941
|
+
export interface VocabularyCodeParams extends VocabularyScope {
|
|
942
|
+
code: string;
|
|
943
|
+
}
|
|
944
|
+
export interface CreateVocabularyParams extends VocabularyScope {
|
|
945
|
+
code: string;
|
|
946
|
+
name?: Localized;
|
|
947
|
+
shape?: 'flat' | 'tree';
|
|
948
|
+
/** Settings left out are off or empty. A tree needs `max_depth` (1 or more). */
|
|
949
|
+
settings?: Partial<VocabularySettings>;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Names given replace the old ones whole. Settings, when given, replace the
|
|
953
|
+
* old ones whole too, so send them all (as `get()` returned them): one left
|
|
954
|
+
* out would be cleared.
|
|
955
|
+
*/
|
|
956
|
+
export interface UpdateVocabularyParams extends VocabularyScope {
|
|
957
|
+
code: string;
|
|
958
|
+
name?: Localized;
|
|
959
|
+
shape?: 'flat' | 'tree';
|
|
960
|
+
settings?: VocabularySettings;
|
|
961
|
+
}
|
|
962
|
+
export interface TermLabel {
|
|
963
|
+
name: string;
|
|
964
|
+
slug?: string;
|
|
965
|
+
description?: string;
|
|
966
|
+
}
|
|
967
|
+
export interface Term extends WorkflowsRecord {
|
|
968
|
+
vocabulary_id: string;
|
|
969
|
+
vocabulary: string;
|
|
970
|
+
parent_id: string;
|
|
971
|
+
depth: number;
|
|
972
|
+
tree_path: string;
|
|
973
|
+
position: number;
|
|
974
|
+
fields: JsonObject | null;
|
|
975
|
+
merged_into?: string;
|
|
976
|
+
labels: Record<string, TermLabel>;
|
|
977
|
+
workspace_id: string;
|
|
978
|
+
}
|
|
979
|
+
/** A page of terms; pass `next` as `after` for the next page. */
|
|
980
|
+
export interface TermPage {
|
|
981
|
+
data: Term[];
|
|
982
|
+
next?: string;
|
|
983
|
+
}
|
|
984
|
+
export interface ListTermsParams extends VocabularyScope {
|
|
985
|
+
/** The vocabulary's code. */
|
|
986
|
+
vocabulary: string;
|
|
987
|
+
q?: string;
|
|
988
|
+
locale?: string;
|
|
989
|
+
parent?: string;
|
|
990
|
+
unused?: boolean;
|
|
991
|
+
limit?: number;
|
|
992
|
+
after?: string;
|
|
993
|
+
}
|
|
994
|
+
export interface CreateTermParams extends VocabularyScope {
|
|
995
|
+
vocabulary: string;
|
|
996
|
+
labels: Record<string, TermLabel>;
|
|
997
|
+
parentId?: string;
|
|
998
|
+
position?: number;
|
|
999
|
+
fields?: JsonObject;
|
|
1000
|
+
}
|
|
1001
|
+
export interface UpdateTermParams {
|
|
1002
|
+
id: string;
|
|
1003
|
+
labels?: Record<string, TermLabel>;
|
|
1004
|
+
position?: number;
|
|
1005
|
+
fields?: JsonObject;
|
|
1006
|
+
}
|
|
1007
|
+
export interface MoveTermParams {
|
|
1008
|
+
id: string;
|
|
1009
|
+
parentId?: string;
|
|
1010
|
+
position: number;
|
|
1011
|
+
}
|
|
1012
|
+
export interface MergeTermParams {
|
|
1013
|
+
id: string;
|
|
1014
|
+
into: string;
|
|
1015
|
+
}
|
|
1016
|
+
/** A ready-made workspace setup (e.g. `crm`): vocabularies, flows, types and views. */
|
|
1017
|
+
export interface Blueprint {
|
|
1018
|
+
name: string;
|
|
1019
|
+
title: string;
|
|
1020
|
+
description: string;
|
|
1021
|
+
vocabularies: JsonObject[];
|
|
1022
|
+
flows: JsonObject[];
|
|
1023
|
+
types: JsonObject[];
|
|
1024
|
+
views: JsonObject[];
|
|
1025
|
+
}
|
|
1026
|
+
export interface BlueprintNameParams {
|
|
1027
|
+
name: string;
|
|
1028
|
+
}
|
|
1029
|
+
export interface ApplyBlueprintParams {
|
|
1030
|
+
/** A shipped blueprint's name, or a whole blueprint document. */
|
|
1031
|
+
blueprint: string | Blueprint;
|
|
1032
|
+
/** The new workspace's code and name. */
|
|
1033
|
+
code: string;
|
|
1034
|
+
name: string;
|
|
1035
|
+
}
|
|
1036
|
+
//# sourceMappingURL=types.d.ts.map
|