@codecks/fetch 1.0.0 → 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.
Files changed (120) hide show
  1. package/README.md +79 -32
  2. package/dist/_exploration/api-requester.d.ts +3 -4
  3. package/dist/_exploration/api-requester.js +2 -2
  4. package/dist/_exploration/create-hooks.d.ts +4313 -13097
  5. package/dist/_exploration/create-hooks.js +1 -1
  6. package/dist/_exploration/loader.d.ts +2 -2
  7. package/dist/_exploration/loader.js +1 -1
  8. package/dist/_exploration/store.d.ts +5 -4
  9. package/dist/_exploration/store.js +1 -1
  10. package/dist/{collection-utils-T3bx0BS1.js → collection-utils-Ia_ahcpI.js} +4 -2
  11. package/dist/index-g5c30upI.d.ts +39 -0
  12. package/dist/index.d.ts +4 -19
  13. package/dist/index.js +26 -15
  14. package/dist/{loader-types-fd5tV0FD.d.ts → loader-types-D2Pf8qzH.d.ts} +1 -1
  15. package/dist/loader-utils-BZWanWDZ.d.ts +2218 -0
  16. package/dist/query-helpers-DndWBcMF.js +1203 -0
  17. package/dist/{query-type-BqQ9oX_U.d.ts → query-type-DPNcQFpZ.d.ts} +27 -13
  18. package/dist/store-ztk8y6Pm.d.ts +1203 -0
  19. package/package.json +2 -1
  20. package/schema/actions.md +789 -0
  21. package/schema/models/account.md +57 -90
  22. package/schema/models/attachment.md +15 -11
  23. package/schema/models/card.md +91 -65
  24. package/schema/models/cardHistory.md +15 -9
  25. package/schema/models/deck.md +41 -36
  26. package/schema/models/file.md +13 -15
  27. package/schema/models/handCard.md +8 -5
  28. package/schema/models/milestone.md +27 -22
  29. package/schema/models/milestoneProgress.md +9 -3
  30. package/schema/models/milestoneProject.md +6 -4
  31. package/schema/models/project.md +15 -39
  32. package/schema/models/projectTag.md +12 -7
  33. package/schema/models/queueEntry.md +12 -8
  34. package/schema/models/release.md +8 -6
  35. package/schema/models/resolvable.md +19 -15
  36. package/schema/models/resolvableEntry.md +16 -13
  37. package/schema/models/resolvableEntryReaction.md +16 -12
  38. package/schema/models/sprint.md +35 -25
  39. package/schema/models/sprintConfig.md +24 -20
  40. package/schema/models/sprintConfigProgress.md +9 -3
  41. package/schema/models/sprintProgress.md +9 -3
  42. package/schema/models/sprintProject.md +7 -5
  43. package/schema/models/user.md +15 -56
  44. package/schema/models/workflowItem.md +47 -31
  45. package/schema/overview.md +40 -93
  46. package/schema/query-syntax.md +1 -1
  47. package/schema/types.md +103 -0
  48. package/dist/_root-BW9uzB79.d.ts +0 -34
  49. package/dist/index-k-KPWV9R.d.ts +0 -2680
  50. package/dist/loader-utils-hvdC-xsQ.d.ts +0 -42
  51. package/dist/query-helpers-iX1fiqLv.js +0 -3062
  52. package/dist/store-BvEJzUVp.d.ts +0 -2667
  53. package/schema/models/accountOnboarding.md +0 -15
  54. package/schema/models/accountOnboardingStep.md +0 -14
  55. package/schema/models/accountRole.md +0 -19
  56. package/schema/models/accountUserAchievement.md +0 -17
  57. package/schema/models/accountUserSetting.md +0 -20
  58. package/schema/models/activeTimeTracker.md +0 -19
  59. package/schema/models/activity.md +0 -30
  60. package/schema/models/affiliateCode.md +0 -30
  61. package/schema/models/affiliateCodeStat.md +0 -19
  62. package/schema/models/app.md +0 -10
  63. package/schema/models/appInstallation.md +0 -19
  64. package/schema/models/assigneeAssignment.md +0 -18
  65. package/schema/models/assigneeDeckAssignment.md +0 -20
  66. package/schema/models/autoFinishedTimeTrackingSegment.md +0 -20
  67. package/schema/models/cardDiffNotification.md +0 -22
  68. package/schema/models/cardOrder.md +0 -17
  69. package/schema/models/cardOrderInDeck.md +0 -18
  70. package/schema/models/cardPreset.md +0 -19
  71. package/schema/models/cardSubscription.md +0 -19
  72. package/schema/models/cardUpvote.md +0 -21
  73. package/schema/models/cardsEffortHistory.md +0 -9
  74. package/schema/models/cardsFinishedHistory.md +0 -16
  75. package/schema/models/cardsStatusHistory.md +0 -9
  76. package/schema/models/cardsTimeToFinished.md +0 -18
  77. package/schema/models/dailyDiscordGuildVoteMembership.md +0 -15
  78. package/schema/models/dailyPublicProjectMembership.md +0 -15
  79. package/schema/models/deckAssignment.md +0 -18
  80. package/schema/models/deckGuardian.md +0 -17
  81. package/schema/models/deckSubscription.md +0 -18
  82. package/schema/models/discordGuild.md +0 -30
  83. package/schema/models/discordMember.md +0 -21
  84. package/schema/models/discordProjectNotification.md +0 -19
  85. package/schema/models/discordSlashCommand.md +0 -28
  86. package/schema/models/dueCard.md +0 -18
  87. package/schema/models/integration.md +0 -23
  88. package/schema/models/invoice.md +0 -21
  89. package/schema/models/lastSeenCardUpvote.md +0 -17
  90. package/schema/models/pinnedMilestone.md +0 -22
  91. package/schema/models/projectOrder.md +0 -18
  92. package/schema/models/projectSelection.md +0 -18
  93. package/schema/models/projectUser.md +0 -18
  94. package/schema/models/projectUserSetting.md +0 -15
  95. package/schema/models/publicProjectInfo.md +0 -20
  96. package/schema/models/publicProjectMembership.md +0 -17
  97. package/schema/models/publicProjectVisit.md +0 -16
  98. package/schema/models/queueSelection.md +0 -19
  99. package/schema/models/resolvableEntryHistory.md +0 -20
  100. package/schema/models/resolvableNotification.md +0 -30
  101. package/schema/models/resolvableParticipant.md +0 -25
  102. package/schema/models/resolvableParticipantHistory.md +0 -23
  103. package/schema/models/savedSearch.md +0 -18
  104. package/schema/models/stripeAccountSync.md +0 -29
  105. package/schema/models/timeTrackingSegment.md +0 -24
  106. package/schema/models/timeTrackingSum.md +0 -18
  107. package/schema/models/userDismissedHint.md +0 -16
  108. package/schema/models/userEmail.md +0 -18
  109. package/schema/models/userInvitation.md +0 -20
  110. package/schema/models/userInviteCode.md +0 -23
  111. package/schema/models/userOnboarding.md +0 -14
  112. package/schema/models/userProjectAccess.md +0 -17
  113. package/schema/models/userReportEmail.md +0 -19
  114. package/schema/models/userReportSetting.md +0 -23
  115. package/schema/models/userReportToken.md +0 -18
  116. package/schema/models/userTag.md +0 -18
  117. package/schema/models/visionBoard.md +0 -21
  118. package/schema/models/visionBoardQuery.md +0 -22
  119. package/schema/models/wizard.md +0 -19
  120. package/schema/models/workflowItemHistory.md +0 -18
@@ -0,0 +1,2218 @@
1
+ import { InferModelQuery, ModelDesc, ModelQuery, Nominal, RelationEntry, TypedField } from "./query-type-DPNcQFpZ.js";
2
+
3
+ //#region src/models/File.d.ts
4
+
5
+ type FileId = Nominal<string, "file">;
6
+ /** An uploaded file, like a card attachment or a cover image. */
7
+ //#endregion
8
+ //#region src/models/User.d.ts
9
+ type UserId = Nominal<string, "user">;
10
+ /**
11
+ * A person, or an integration or API token that acts in an organization. `kind` tells them apart.
12
+ */
13
+ //#endregion
14
+ //#region src/models/definitions.d.ts
15
+ type CardVisibility = "default" | "archived" | "deleted" | (string & {});
16
+ type Checkbox = {
17
+ label: string;
18
+ checked: boolean;
19
+ };
20
+ type CheckboxStats = {
21
+ total: number;
22
+ checked: number;
23
+ };
24
+ type DefaultCard = {
25
+ content?: string;
26
+ assigneeId?: UserId | null;
27
+ priority?: Priority | null;
28
+ effort?: number | null;
29
+ masterTags?: string[];
30
+ };
31
+ type DerivedStatus = "deleted" | "archived" | "archivedDone" | "archivedHeroDone" | "doc" | "blocked" | "review" | "hero" | "heroDone" | "heroDoc" | "assigned" | "unassigned" | "started" | "done" | "snoozing" | "archivedHero" | (string & {});
32
+ type MilestoneColor = "gray" | "brown" | "yellow" | "red" | "pink" | "blue" | "green" | (string & {});
33
+ type Priority = "a" | "b" | "c" | (string & {});
34
+ type StartWeekday = "monday" | "saturday" | "sunday" | (string & {});
35
+ type TimeTrackingMode = "none" | "manual" | "strict" | (string & {});
36
+ type TimelineScaleType = "day" | "week" | (string & {});
37
+ type Workdays = {
38
+ monday: boolean;
39
+ tuesday: boolean;
40
+ wednesday: boolean;
41
+ thursday: boolean;
42
+ friday: boolean;
43
+ saturday: boolean;
44
+ sunday: boolean;
45
+ };
46
+ type WorkflowMode = "none" | "only_parent_cards" | "journeys" | (string & {});
47
+ //#endregion
48
+ //#region src/models/Account.d.ts
49
+ type AccountId = Nominal<string, "account">;
50
+ /** An organization and its settings. */
51
+
52
+ //#endregion
53
+ //#region src/models/Milestone.d.ts
54
+ type MilestoneId = Nominal<string, "milestone">;
55
+ /**
56
+ * A date that cards are planned towards. It belongs to a list of projects, or with `isGlobal` to
57
+ * all projects of the organization.
58
+ */
59
+ //#endregion
60
+ //#region src/models/Project.d.ts
61
+ type ProjectId = Nominal<string, "project">;
62
+ /** Groups decks. A card belongs to the project of its deck. */
63
+ //#endregion
64
+ //#region src/models/ProjectTag.d.ts
65
+ type ProjectTagId = Nominal<string, "projectTag">;
66
+ /** A tag in a project's tag list. A card in the project with this tag lists it in `masterTags`. */
67
+
68
+ //#endregion
69
+ //#region src/models/Deck.d.ts
70
+ type DeckId = Nominal<string, "deck">;
71
+ /** A list of cards within a project. `deckType` says which kind of cards it is meant for. */
72
+ //#endregion
73
+ //#region src/models/SprintConfig.d.ts
74
+ type SprintConfigId = Nominal<string, "sprintConfig">;
75
+ /**
76
+ * A Run Config. It creates runs of the same length one after the other, like sprints, for its
77
+ * projects.
78
+ */
79
+ //#endregion
80
+ //#region src/models/Sprint.d.ts
81
+ type SprintId = Nominal<string, "sprint">;
82
+ /**
83
+ * A run: one time box of a Run Config, from `startDate` to `endDate`. Codecks creates the upcoming
84
+ * runs ahead of time and completes a run when it ends.
85
+ */
86
+ //#endregion
87
+ //#region src/models/WorkflowItem.d.ts
88
+ type WorkflowItemId = Nominal<string, "workflowItem">;
89
+ /**
90
+ * A Journey Step: a template for a sub card. Starting a deck's journey on a card creates a sub card
91
+ * from each of its steps.
92
+ * @experimental `preview` in the Codecks API: may change in any release.
93
+ */
94
+ //#endregion
95
+ //#region src/models/Card.d.ts
96
+ type CardId = Nominal<string, "card">;
97
+ /**
98
+ * A task or a document card when `isDoc` is set or a hero card if it contains sub cards.
99
+ The card's
100
+ * color is derived from `status`, `visibility`, `isDoc` and whether it has sub cards or open block
101
+ * or review conversations.
102
+ */
103
+ //#endregion
104
+ //#region src/models/Attachment.d.ts
105
+ type AttachmentId = Nominal<string, "attachment">;
106
+ /** A file attached to a card. */
107
+ //#endregion
108
+ //#region src/models/QueueEntry.d.ts
109
+ type QueueEntryId = Nominal<string, "queueEntry">;
110
+ /**
111
+ * A card in a user's Hand. When a card is done, its owner gets an entry in their Hand's done pile,
112
+ * even if the card wasn't in their Hand.
113
+ */
114
+ //#endregion
115
+ //#region src/models/Release.d.ts
116
+ type ReleaseId = Nominal<string, "release">;
117
+ /** An entry in the Codecks changelog. It's the same for every organization. */
118
+
119
+ //#endregion
120
+ //#region src/models/Resolvable.d.ts
121
+ type ResolvableId = Nominal<string, "resolvable">;
122
+ /**
123
+ * A comment thread on a card. Its `context` says if it's a plain conversation or if it marks the
124
+ * card as blocked or in review.
125
+ */
126
+ //#endregion
127
+ //#region src/models/ResolvableEntry.d.ts
128
+ type ResolvableEntryId = Nominal<string, "resolvableEntry">;
129
+ /** A comment in a comment thread. */
130
+ //#endregion
131
+ //#region src/models/ResolvableEntryReaction.d.ts
132
+ type ResolvableEntryReactionId = Nominal<string, "resolvableEntryReaction">;
133
+ /**
134
+ * An emoji reaction to a comment. A user can add each emoji only once per comment.
135
+ * @experimental `preview` in the Codecks API: may change in any release.
136
+ */
137
+ //#endregion
138
+ //#region src/models/index.d.ts
139
+ declare const modelMap: {
140
+ /** The starting point of every query. */
141
+ _root: ModelDesc<"_root", {}, {
142
+ account: RelationEntry<"account", {
143
+ readonly type: "hasOne";
144
+ }>;
145
+ loggedInUser: RelationEntry<"user", {
146
+ readonly type: "hasOne";
147
+ }>;
148
+ releases: RelationEntry<"release", {
149
+ readonly type: "hasMany";
150
+ }>;
151
+ }, []>;
152
+ /** An organization and its settings. */
153
+ account: ModelDesc<"account", {
154
+ allowInheritHeroCover: TypedField<"bool", boolean, {
155
+ readonly stability: "preview";
156
+ }>;
157
+ attachmentCoverMode: TypedField<"typed", (string & {}) | "none" | "first" | "last", {
158
+ readonly stability: "preview";
159
+ }>;
160
+ createdAt: TypedField<"date", Date, {}>;
161
+ dependenciesEnabled: TypedField<"bool", boolean, {}>;
162
+ dueDateEnabled: TypedField<"bool", boolean, {}>;
163
+ effortScale: TypedField<"typed", number[], {}>;
164
+ fallbackEffort: TypedField<"int", number, {
165
+ readonly stability: "preview";
166
+ }>;
167
+ hideCompletedCardCountForDecks: TypedField<"bool", boolean, {
168
+ readonly stability: "preview";
169
+ }>;
170
+ id: TypedField<"id", AccountId, {}>;
171
+ maxHandSlotCount: TypedField<"int", number, {
172
+ readonly stability: "preview";
173
+ }>;
174
+ milestonesEnabled: TypedField<"bool", boolean, {}>;
175
+ name: TypedField<"string", string, {}>;
176
+ priorityLabels: TypedField<"typed", {
177
+ a: string;
178
+ b: string;
179
+ c: string;
180
+ }, {}>;
181
+ sprintsEnabled: TypedField<"bool", boolean, {}>;
182
+ startWeekday: TypedField<"typed", StartWeekday, {}>;
183
+ statusChangeDurations: TypedField<"typed", {
184
+ snooze: number;
185
+ archive: number | null;
186
+ }, {
187
+ readonly stability: "preview";
188
+ }>;
189
+ subdomain: TypedField<"string", string, {}>;
190
+ timeTrackingMode: TypedField<"typed", TimeTrackingMode, {
191
+ readonly stability: "preview";
192
+ }>;
193
+ timelineScaleType: TypedField<"typed", TimelineScaleType, {
194
+ readonly stability: "preview";
195
+ }>;
196
+ visionBoardEnabled: TypedField<"bool", boolean, {
197
+ readonly stability: "preview";
198
+ }>;
199
+ workdays: TypedField<"typed", Workdays, {}>;
200
+ workflowMode: TypedField<"typed", WorkflowMode, {
201
+ readonly stability: "preview";
202
+ }>;
203
+ }, {
204
+ archivedProjects: RelationEntry<"project", {
205
+ readonly type: "hasMany";
206
+ }>;
207
+ attachments: RelationEntry<"attachment", {
208
+ readonly type: "hasMany";
209
+ }>;
210
+ cards: RelationEntry<"card", {
211
+ readonly type: "hasMany";
212
+ }>;
213
+ decks: RelationEntry<"deck", {
214
+ readonly type: "hasMany";
215
+ }>;
216
+ files: RelationEntry<"file", {
217
+ readonly type: "hasMany";
218
+ }>;
219
+ handCards: RelationEntry<"handCard", {
220
+ readonly type: "hasMany";
221
+ }>;
222
+ milestones: RelationEntry<"milestone", {
223
+ readonly type: "hasMany";
224
+ }>;
225
+ projects: RelationEntry<"project", {
226
+ readonly type: "hasMany";
227
+ }>;
228
+ queueEntries: RelationEntry<"queueEntry", {
229
+ readonly type: "hasMany";
230
+ }>;
231
+ resolvables: RelationEntry<"resolvable", {
232
+ readonly type: "hasMany";
233
+ }>;
234
+ sprintConfigs: RelationEntry<"sprintConfig", {
235
+ readonly type: "hasMany";
236
+ }>;
237
+ sprints: RelationEntry<"sprint", {
238
+ readonly type: "hasMany";
239
+ }>;
240
+ workflowItems: RelationEntry<"workflowItem", {
241
+ readonly type: "hasMany";
242
+ readonly stability: "preview";
243
+ }>;
244
+ }, ["id"]>;
245
+ /** A file attached to a card. */
246
+ attachment: ModelDesc<"attachment", {
247
+ accountId: TypedField<"belongsTo", AccountId, {}>;
248
+ cardId: TypedField<"belongsTo", CardId, {}>;
249
+ content: TypedField<"string", string, {}>;
250
+ createdAt: TypedField<"date", Date, {}>;
251
+ creatorId: TypedField<"belongsTo", UserId, {
252
+ readonly optional: true;
253
+ }>;
254
+ fileId: TypedField<"belongsTo", FileId, {}>;
255
+ id: TypedField<"id", AttachmentId, {}>;
256
+ title: TypedField<"string", string, {}>;
257
+ }, {
258
+ account: RelationEntry<"account", {
259
+ readonly type: "belongsTo";
260
+ readonly fk: "accountId";
261
+ }>;
262
+ card: RelationEntry<"card", {
263
+ readonly type: "belongsTo";
264
+ readonly fk: "cardId";
265
+ }>;
266
+ creator: RelationEntry<"user", {
267
+ readonly type: "belongsTo";
268
+ readonly fk: "creatorId";
269
+ readonly optional: true;
270
+ }>;
271
+ file: RelationEntry<"file", {
272
+ readonly type: "belongsTo";
273
+ readonly fk: "fileId";
274
+ }>;
275
+ }, ["id"]>;
276
+ /**
277
+ * A task or a document card when `isDoc` is set or a hero card if it contains sub cards.
278
+ The
279
+ * card's color is derived from `status`, `visibility`, `isDoc` and whether it has sub cards or
280
+ * open block or review conversations.
281
+ */
282
+ card: ModelDesc<"card", {
283
+ accountId: TypedField<"belongsTo", AccountId, {}>;
284
+ accountSeq: TypedField<"int", number, {}>;
285
+ assigneeId: TypedField<"belongsTo", UserId, {
286
+ readonly optional: true;
287
+ }>;
288
+ cardId: TypedField<"id", CardId, {}>;
289
+ checkboxInfo: TypedField<"typed", Checkbox[], {
290
+ readonly stability: "preview";
291
+ }>;
292
+ checkboxStats: TypedField<"typed", CheckboxStats, {}>;
293
+ content: TypedField<"string", string, {}>;
294
+ coverFileId: TypedField<"belongsTo", FileId, {
295
+ readonly optional: true;
296
+ }>;
297
+ createdAt: TypedField<"date", Date, {}>;
298
+ creatorId: TypedField<"belongsTo", UserId, {
299
+ readonly optional: true;
300
+ }>;
301
+ deckId: TypedField<"belongsTo", DeckId, {
302
+ readonly optional: true;
303
+ }>;
304
+ derivedStatus: TypedField<"typed", DerivedStatus, {
305
+ readonly stability: "preview";
306
+ }>;
307
+ dueDate: TypedField<"day", {
308
+ day: number;
309
+ month: number;
310
+ year: number;
311
+ }, {
312
+ readonly optional: true;
313
+ }>;
314
+ effort: TypedField<"int", number, {
315
+ readonly optional: true;
316
+ }>;
317
+ hasBlockingDeps: TypedField<"bool", boolean, {
318
+ readonly stability: "preview";
319
+ }>;
320
+ isBlockingDep: TypedField<"bool", boolean, {
321
+ readonly stability: "preview";
322
+ }>;
323
+ isDoc: TypedField<"bool", boolean, {
324
+ readonly optional: true;
325
+ }>;
326
+ lastUpdatedAt: TypedField<"date", Date, {}>;
327
+ masterTags: TypedField<"typed", string[], {}>;
328
+ mentionedUsers: TypedField<"typed", UserId[], {
329
+ readonly stability: "preview";
330
+ }>;
331
+ milestoneId: TypedField<"belongsTo", MilestoneId, {
332
+ readonly optional: true;
333
+ }>;
334
+ parentCardId: TypedField<"belongsTo", CardId, {
335
+ readonly optional: true;
336
+ }>;
337
+ priority: TypedField<"typed", Priority, {
338
+ readonly optional: true;
339
+ }>;
340
+ sourceWorkflowItemId: TypedField<"belongsTo", WorkflowItemId, {
341
+ readonly optional: true;
342
+ readonly stability: "preview";
343
+ }>;
344
+ sprintId: TypedField<"belongsTo", SprintId, {
345
+ readonly optional: true;
346
+ }>;
347
+ status: TypedField<"typed", (string & {}) | "started" | "done" | "snoozing" | "not_started", {}>;
348
+ tags: TypedField<"typed", string[], {}>;
349
+ title: TypedField<"string", string, {}>;
350
+ version: TypedField<"int", number, {}>;
351
+ visibility: TypedField<"typed", CardVisibility, {}>;
352
+ }, {
353
+ account: RelationEntry<"account", {
354
+ readonly type: "belongsTo";
355
+ readonly fk: "accountId";
356
+ }>;
357
+ assignee: RelationEntry<"user", {
358
+ readonly type: "belongsTo";
359
+ readonly fk: "assigneeId";
360
+ readonly optional: true;
361
+ }>;
362
+ attachments: RelationEntry<"attachment", {
363
+ readonly type: "hasMany";
364
+ readonly fkAsArray: true;
365
+ }>;
366
+ cardReferences: RelationEntry<"card", {
367
+ readonly type: "hasMany";
368
+ readonly fkAsArray: true;
369
+ readonly stability: "preview";
370
+ }>;
371
+ childCards: RelationEntry<"card", {
372
+ readonly type: "hasMany";
373
+ readonly fkAsArray: true;
374
+ }>;
375
+ coverFile: RelationEntry<"file", {
376
+ readonly type: "belongsTo";
377
+ readonly fk: "coverFileId";
378
+ readonly optional: true;
379
+ }>;
380
+ creator: RelationEntry<"user", {
381
+ readonly type: "belongsTo";
382
+ readonly fk: "creatorId";
383
+ readonly optional: true;
384
+ }>;
385
+ deck: RelationEntry<"deck", {
386
+ readonly type: "belongsTo";
387
+ readonly fk: "deckId";
388
+ readonly optional: true;
389
+ }>;
390
+ diffs: RelationEntry<"cardHistory", {
391
+ readonly type: "hasMany";
392
+ readonly stability: "preview";
393
+ }>;
394
+ handCards: RelationEntry<"handCard", {
395
+ readonly type: "hasMany";
396
+ }>;
397
+ inDeps: RelationEntry<"card", {
398
+ readonly type: "hasMany";
399
+ readonly fkAsArray: true;
400
+ readonly stability: "preview";
401
+ }>;
402
+ milestone: RelationEntry<"milestone", {
403
+ readonly type: "belongsTo";
404
+ readonly fk: "milestoneId";
405
+ readonly optional: true;
406
+ }>;
407
+ outDeps: RelationEntry<"card", {
408
+ readonly type: "hasMany";
409
+ readonly fkAsArray: true;
410
+ readonly stability: "preview";
411
+ }>;
412
+ parentCard: RelationEntry<"card", {
413
+ readonly type: "belongsTo";
414
+ readonly fk: "parentCardId";
415
+ readonly optional: true;
416
+ }>;
417
+ queueEntries: RelationEntry<"queueEntry", {
418
+ readonly type: "hasMany";
419
+ }>;
420
+ resolvableEntries: RelationEntry<"resolvableEntry", {
421
+ readonly type: "hasMany";
422
+ }>;
423
+ resolvables: RelationEntry<"resolvable", {
424
+ readonly type: "hasMany";
425
+ }>;
426
+ sourceWorkflowItem: RelationEntry<"workflowItem", {
427
+ readonly type: "belongsTo";
428
+ readonly fk: "sourceWorkflowItemId";
429
+ readonly optional: true;
430
+ readonly stability: "preview";
431
+ }>;
432
+ sprint: RelationEntry<"sprint", {
433
+ readonly type: "belongsTo";
434
+ readonly fk: "sprintId";
435
+ readonly optional: true;
436
+ }>;
437
+ }, ["cardId"]>;
438
+ /**
439
+ * One version of a card and what changed in it. The web app shows these in the card's history.
440
+ * @experimental `preview` in the Codecks API: may change in any release.
441
+ */
442
+ cardHistory: ModelDesc<"cardHistory", {
443
+ accountId: TypedField<"belongsTo", AccountId, {
444
+ readonly stability: "preview";
445
+ }>;
446
+ cardId: TypedField<"belongsTo", CardId, {
447
+ readonly stability: "preview";
448
+ }>;
449
+ changerId: TypedField<"belongsTo", UserId, {
450
+ readonly optional: true;
451
+ readonly stability: "preview";
452
+ }>;
453
+ diff: TypedField<"typed", {
454
+ [key: string]: unknown;
455
+ }, {
456
+ readonly stability: "preview";
457
+ }>;
458
+ version: TypedField<"int", number, {
459
+ readonly stability: "preview";
460
+ }>;
461
+ versionCreatedAt: TypedField<"date", Date, {
462
+ readonly stability: "preview";
463
+ }>;
464
+ }, {
465
+ account: RelationEntry<"account", {
466
+ readonly type: "belongsTo";
467
+ readonly fk: "accountId";
468
+ readonly stability: "preview";
469
+ }>;
470
+ card: RelationEntry<"card", {
471
+ readonly type: "belongsTo";
472
+ readonly fk: "cardId";
473
+ readonly stability: "preview";
474
+ }>;
475
+ changer: RelationEntry<"user", {
476
+ readonly type: "belongsTo";
477
+ readonly fk: "changerId";
478
+ readonly optional: true;
479
+ readonly stability: "preview";
480
+ }>;
481
+ }, ["cardId", "version"]>;
482
+ /** A list of cards within a project. `deckType` says which kind of cards it is meant for. */
483
+ deck: ModelDesc<"deck", {
484
+ accountId: TypedField<"belongsTo", AccountId, {}>;
485
+ accountSeq: TypedField<"int", number, {}>;
486
+ coverColor: TypedField<"string", string, {
487
+ readonly optional: true;
488
+ readonly stability: "preview";
489
+ }>;
490
+ coverFileId: TypedField<"belongsTo", FileId, {
491
+ readonly optional: true;
492
+ readonly stability: "preview";
493
+ }>;
494
+ createdAt: TypedField<"date", Date, {}>;
495
+ creatorId: TypedField<"belongsTo", UserId, {}>;
496
+ deckType: TypedField<"typed", (string & {}) | "doc" | "hero" | "task" | "mixed", {}>;
497
+ defaultCard: TypedField<"typed", DefaultCard, {
498
+ readonly stability: "preview";
499
+ }>;
500
+ defaultProjectTagId: TypedField<"belongsTo", ProjectTagId, {
501
+ readonly optional: true;
502
+ }>;
503
+ description: TypedField<"string", string, {}>;
504
+ handSyncEnabled: TypedField<"bool", boolean, {
505
+ readonly stability: "preview";
506
+ }>;
507
+ hasGuardians: TypedField<"bool", boolean, {
508
+ readonly stability: "preview";
509
+ }>;
510
+ id: TypedField<"id", DeckId, {}>;
511
+ isDeleted: TypedField<"bool", boolean, {}>;
512
+ manualOrderLabels: TypedField<"typed", (string | null)[], {
513
+ readonly stability: "preview";
514
+ }>;
515
+ milestoneId: TypedField<"belongsTo", MilestoneId, {
516
+ readonly optional: true;
517
+ }>;
518
+ projectId: TypedField<"belongsTo", ProjectId, {}>;
519
+ sortValue: TypedField<"string", string, {
520
+ readonly stability: "preview";
521
+ }>;
522
+ spaceId: TypedField<"int", number, {
523
+ readonly optional: true;
524
+ readonly stability: "preview";
525
+ }>;
526
+ title: TypedField<"string", string, {}>;
527
+ }, {
528
+ account: RelationEntry<"account", {
529
+ readonly type: "belongsTo";
530
+ readonly fk: "accountId";
531
+ }>;
532
+ cards: RelationEntry<"card", {
533
+ readonly type: "hasMany";
534
+ }>;
535
+ coverFile: RelationEntry<"file", {
536
+ readonly type: "belongsTo";
537
+ readonly fk: "coverFileId";
538
+ readonly optional: true;
539
+ readonly stability: "preview";
540
+ }>;
541
+ creator: RelationEntry<"user", {
542
+ readonly type: "belongsTo";
543
+ readonly fk: "creatorId";
544
+ }>;
545
+ defaultProjectTag: RelationEntry<"projectTag", {
546
+ readonly type: "belongsTo";
547
+ readonly fk: "defaultProjectTagId";
548
+ readonly optional: true;
549
+ }>;
550
+ milestone: RelationEntry<"milestone", {
551
+ readonly type: "belongsTo";
552
+ readonly fk: "milestoneId";
553
+ readonly optional: true;
554
+ }>;
555
+ project: RelationEntry<"project", {
556
+ readonly type: "belongsTo";
557
+ readonly fk: "projectId";
558
+ }>;
559
+ workflowItems: RelationEntry<"workflowItem", {
560
+ readonly type: "hasMany";
561
+ readonly stability: "preview";
562
+ }>;
563
+ }, ["id"]>;
564
+ /** An uploaded file, like a card attachment or a cover image. */
565
+ file: ModelDesc<"file", {
566
+ accountId: TypedField<"belongsTo", AccountId, {
567
+ readonly optional: true;
568
+ }>;
569
+ createdAt: TypedField<"date", Date, {}>;
570
+ id: TypedField<"id", FileId, {}>;
571
+ name: TypedField<"string", string, {}>;
572
+ size: TypedField<"int", number, {}>;
573
+ uploaderId: TypedField<"belongsTo", UserId, {
574
+ readonly optional: true;
575
+ }>;
576
+ url: TypedField<"string", string, {}>;
577
+ }, {
578
+ account: RelationEntry<"account", {
579
+ readonly type: "belongsTo";
580
+ readonly fk: "accountId";
581
+ readonly optional: true;
582
+ }>;
583
+ uploader: RelationEntry<"user", {
584
+ readonly type: "belongsTo";
585
+ readonly fk: "uploaderId";
586
+ readonly optional: true;
587
+ }>;
588
+ }, ["id"]>;
589
+ /** A card a user bookmarked. Deleting the card removes its bookmarks. */
590
+ handCard: ModelDesc<"handCard", {
591
+ accountId: TypedField<"belongsTo", AccountId, {}>;
592
+ cardId: TypedField<"belongsTo", CardId, {}>;
593
+ sortIndex: TypedField<"int", number, {}>;
594
+ userId: TypedField<"belongsTo", UserId, {}>;
595
+ }, {
596
+ account: RelationEntry<"account", {
597
+ readonly type: "belongsTo";
598
+ readonly fk: "accountId";
599
+ }>;
600
+ card: RelationEntry<"card", {
601
+ readonly type: "belongsTo";
602
+ readonly fk: "cardId";
603
+ }>;
604
+ user: RelationEntry<"user", {
605
+ readonly type: "belongsTo";
606
+ readonly fk: "userId";
607
+ }>;
608
+ }, ["cardId", "userId", "accountId"]>;
609
+ /**
610
+ * A date that cards are planned towards. It belongs to a list of projects, or with `isGlobal` to
611
+ * all projects of the organization.
612
+ */
613
+ milestone: ModelDesc<"milestone", {
614
+ accountId: TypedField<"belongsTo", AccountId, {}>;
615
+ accountSeq: TypedField<"int", number, {}>;
616
+ color: TypedField<"typed", MilestoneColor, {}>;
617
+ coverFileId: TypedField<"belongsTo", FileId, {
618
+ readonly optional: true;
619
+ readonly stability: "preview";
620
+ }>;
621
+ createdAt: TypedField<"date", Date, {}>;
622
+ creatorId: TypedField<"belongsTo", UserId, {}>;
623
+ date: TypedField<"day", {
624
+ day: number;
625
+ month: number;
626
+ year: number;
627
+ }, {}>;
628
+ description: TypedField<"string", string, {
629
+ readonly optional: true;
630
+ }>;
631
+ handSyncEnabled: TypedField<"bool", boolean, {
632
+ readonly stability: "preview";
633
+ }>;
634
+ id: TypedField<"id", MilestoneId, {}>;
635
+ isDeleted: TypedField<"bool", boolean, {}>;
636
+ isGlobal: TypedField<"bool", boolean, {}>;
637
+ manualOrderLabels: TypedField<"typed", (string | null)[], {
638
+ readonly stability: "preview";
639
+ }>;
640
+ name: TypedField<"string", string, {}>;
641
+ startDate: TypedField<"day", {
642
+ day: number;
643
+ month: number;
644
+ year: number;
645
+ }, {
646
+ readonly optional: true;
647
+ }>;
648
+ userCapacities: TypedField<"typed", {
649
+ [userId: UserId]: number;
650
+ }, {
651
+ readonly stability: "preview";
652
+ }>;
653
+ }, {
654
+ account: RelationEntry<"account", {
655
+ readonly type: "belongsTo";
656
+ readonly fk: "accountId";
657
+ }>;
658
+ cards: RelationEntry<"card", {
659
+ readonly type: "hasMany";
660
+ }>;
661
+ coverFile: RelationEntry<"file", {
662
+ readonly type: "belongsTo";
663
+ readonly fk: "coverFileId";
664
+ readonly optional: true;
665
+ readonly stability: "preview";
666
+ }>;
667
+ creator: RelationEntry<"user", {
668
+ readonly type: "belongsTo";
669
+ readonly fk: "creatorId";
670
+ }>;
671
+ milestoneProjects: RelationEntry<"milestoneProject", {
672
+ readonly type: "hasMany";
673
+ }>;
674
+ progress: RelationEntry<"milestoneProgress", {
675
+ readonly type: "hasMany";
676
+ readonly stability: "preview";
677
+ }>;
678
+ }, ["id"]>;
679
+ /**
680
+ * The state of a milestone's cards on a day (UTC). A row is only written on days when the numbers
681
+ * change, so a day without a row has the numbers of the row before it.
682
+ * @experimental `preview` in the Codecks API: may change in any release.
683
+ */
684
+ milestoneProgress: ModelDesc<"milestoneProgress", {
685
+ date: TypedField<"string", string, {
686
+ readonly stability: "preview";
687
+ }>;
688
+ milestoneId: TypedField<"belongsTo", MilestoneId, {
689
+ readonly stability: "preview";
690
+ }>;
691
+ progress: TypedField<"typed", unknown, {
692
+ readonly stability: "preview";
693
+ }>;
694
+ }, {
695
+ milestone: RelationEntry<"milestone", {
696
+ readonly type: "belongsTo";
697
+ readonly fk: "milestoneId";
698
+ readonly stability: "preview";
699
+ }>;
700
+ }, ["milestoneId", "date"]>;
701
+ /**
702
+ * Links a milestone to a project whose cards and decks can use it. A milestone with `isGlobal` is
703
+ * linked to every project.
704
+ */
705
+ milestoneProject: ModelDesc<"milestoneProject", {
706
+ accountId: TypedField<"belongsTo", AccountId, {}>;
707
+ milestoneId: TypedField<"belongsTo", MilestoneId, {}>;
708
+ projectId: TypedField<"belongsTo", ProjectId, {}>;
709
+ }, {
710
+ account: RelationEntry<"account", {
711
+ readonly type: "belongsTo";
712
+ readonly fk: "accountId";
713
+ }>;
714
+ milestone: RelationEntry<"milestone", {
715
+ readonly type: "belongsTo";
716
+ readonly fk: "milestoneId";
717
+ }>;
718
+ project: RelationEntry<"project", {
719
+ readonly type: "belongsTo";
720
+ readonly fk: "projectId";
721
+ }>;
722
+ }, ["milestoneId", "projectId"]>;
723
+ /** Groups decks. A card belongs to the project of its deck. */
724
+ project: ModelDesc<"project", {
725
+ accountId: TypedField<"belongsTo", AccountId, {}>;
726
+ coverFileId: TypedField<"belongsTo", FileId, {
727
+ readonly optional: true;
728
+ }>;
729
+ createdAt: TypedField<"date", Date, {}>;
730
+ id: TypedField<"id", ProjectId, {}>;
731
+ name: TypedField<"string", string, {}>;
732
+ spaces: TypedField<"typed", unknown, {
733
+ readonly stability: "preview";
734
+ }>;
735
+ visibility: TypedField<"typed", (string & {}) | "deleted" | "archived" | "default", {}>;
736
+ }, {
737
+ account: RelationEntry<"account", {
738
+ readonly type: "belongsTo";
739
+ readonly fk: "accountId";
740
+ }>;
741
+ coverFile: RelationEntry<"file", {
742
+ readonly type: "belongsTo";
743
+ readonly fk: "coverFileId";
744
+ readonly optional: true;
745
+ }>;
746
+ decks: RelationEntry<"deck", {
747
+ readonly type: "hasMany";
748
+ }>;
749
+ milestoneProjects: RelationEntry<"milestoneProject", {
750
+ readonly type: "hasMany";
751
+ }>;
752
+ sprintProjects: RelationEntry<"sprintProject", {
753
+ readonly type: "hasMany";
754
+ }>;
755
+ tags: RelationEntry<"projectTag", {
756
+ readonly type: "hasMany";
757
+ }>;
758
+ }, ["id"]>;
759
+ /**
760
+ * A tag in a project's tag list. A card in the project with this tag lists it in `masterTags`.
761
+ */
762
+ projectTag: ModelDesc<"projectTag", {
763
+ color: TypedField<"string", string, {
764
+ readonly optional: true;
765
+ }>;
766
+ createdAt: TypedField<"date", Date, {}>;
767
+ description: TypedField<"string", string, {
768
+ readonly optional: true;
769
+ }>;
770
+ emoji: TypedField<"string", string, {
771
+ readonly optional: true;
772
+ }>;
773
+ id: TypedField<"id", ProjectTagId, {}>;
774
+ projectId: TypedField<"belongsTo", ProjectId, {}>;
775
+ tag: TypedField<"string", string, {}>;
776
+ }, {
777
+ project: RelationEntry<"project", {
778
+ readonly type: "belongsTo";
779
+ readonly fk: "projectId";
780
+ }>;
781
+ }, ["id"]>;
782
+ /**
783
+ * A card in a user's Hand. When a card is done, its owner gets an entry in their Hand's done
784
+ * pile, even if the card wasn't in their Hand.
785
+ */
786
+ queueEntry: ModelDesc<"queueEntry", {
787
+ accountId: TypedField<"belongsTo", AccountId, {}>;
788
+ cardDoneAt: TypedField<"date", Date, {
789
+ readonly optional: true;
790
+ }>;
791
+ cardId: TypedField<"belongsTo", CardId, {}>;
792
+ createdAt: TypedField<"date", Date, {}>;
793
+ id: TypedField<"id", QueueEntryId, {}>;
794
+ sortIndex: TypedField<"int", number, {
795
+ readonly optional: true;
796
+ }>;
797
+ userId: TypedField<"belongsTo", UserId, {}>;
798
+ }, {
799
+ account: RelationEntry<"account", {
800
+ readonly type: "belongsTo";
801
+ readonly fk: "accountId";
802
+ }>;
803
+ card: RelationEntry<"card", {
804
+ readonly type: "belongsTo";
805
+ readonly fk: "cardId";
806
+ }>;
807
+ user: RelationEntry<"user", {
808
+ readonly type: "belongsTo";
809
+ readonly fk: "userId";
810
+ }>;
811
+ }, ["id"]>;
812
+ /** An entry in the Codecks changelog. It's the same for every organization. */
813
+ release: ModelDesc<"release", {
814
+ content: TypedField<"string", string, {}>;
815
+ createdAt: TypedField<"date", Date, {}>;
816
+ id: TypedField<"id", ReleaseId, {}>;
817
+ title: TypedField<"string", string, {}>;
818
+ version: TypedField<"string", string, {}>;
819
+ }, {}, ["id"]>;
820
+ /**
821
+ * A comment thread on a card. Its `context` says if it's a plain conversation or if it marks the
822
+ * card as blocked or in review.
823
+ */
824
+ resolvable: ModelDesc<"resolvable", {
825
+ accountId: TypedField<"belongsTo", AccountId, {}>;
826
+ cardId: TypedField<"belongsTo", CardId, {}>;
827
+ closedAt: TypedField<"date", Date, {
828
+ readonly optional: true;
829
+ }>;
830
+ context: TypedField<"typed", (string & {}) | "review" | "block" | "comment", {}>;
831
+ createdAt: TypedField<"date", Date, {}>;
832
+ creatorId: TypedField<"belongsTo", UserId, {}>;
833
+ id: TypedField<"id", ResolvableId, {}>;
834
+ isClosed: TypedField<"bool", boolean, {}>;
835
+ reopenedAt: TypedField<"date", Date, {
836
+ readonly optional: true;
837
+ }>;
838
+ }, {
839
+ account: RelationEntry<"account", {
840
+ readonly type: "belongsTo";
841
+ readonly fk: "accountId";
842
+ }>;
843
+ card: RelationEntry<"card", {
844
+ readonly type: "belongsTo";
845
+ readonly fk: "cardId";
846
+ }>;
847
+ closedBy: RelationEntry<"user", {
848
+ readonly type: "belongsTo";
849
+ readonly optional: true;
850
+ }>;
851
+ creator: RelationEntry<"user", {
852
+ readonly type: "belongsTo";
853
+ readonly fk: "creatorId";
854
+ }>;
855
+ entries: RelationEntry<"resolvableEntry", {
856
+ readonly type: "hasMany";
857
+ }>;
858
+ reopenedBy: RelationEntry<"user", {
859
+ readonly type: "belongsTo";
860
+ readonly optional: true;
861
+ }>;
862
+ }, ["id"]>;
863
+ /** A comment in a comment thread. */
864
+ resolvableEntry: ModelDesc<"resolvableEntry", {
865
+ authorId: TypedField<"belongsTo", UserId, {}>;
866
+ cardId: TypedField<"belongsTo", CardId, {}>;
867
+ content: TypedField<"string", string, {}>;
868
+ createdAt: TypedField<"date", Date, {}>;
869
+ entryId: TypedField<"id", ResolvableEntryId, {}>;
870
+ lastChangedAt: TypedField<"date", Date, {}>;
871
+ resolvableId: TypedField<"belongsTo", ResolvableId, {}>;
872
+ version: TypedField<"int", number, {
873
+ readonly stability: "preview";
874
+ }>;
875
+ }, {
876
+ author: RelationEntry<"user", {
877
+ readonly type: "belongsTo";
878
+ readonly fk: "authorId";
879
+ }>;
880
+ card: RelationEntry<"card", {
881
+ readonly type: "belongsTo";
882
+ readonly fk: "cardId";
883
+ }>;
884
+ reactions: RelationEntry<"resolvableEntryReaction", {
885
+ readonly type: "hasMany";
886
+ readonly stability: "preview";
887
+ }>;
888
+ resolvable: RelationEntry<"resolvable", {
889
+ readonly type: "belongsTo";
890
+ readonly fk: "resolvableId";
891
+ }>;
892
+ }, ["entryId"]>;
893
+ /**
894
+ * An emoji reaction to a comment. A user can add each emoji only once per comment.
895
+ * @experimental `preview` in the Codecks API: may change in any release.
896
+ */
897
+ resolvableEntryReaction: ModelDesc<"resolvableEntryReaction", {
898
+ accountId: TypedField<"belongsTo", AccountId, {
899
+ readonly stability: "preview";
900
+ }>;
901
+ createdAt: TypedField<"date", Date, {
902
+ readonly stability: "preview";
903
+ }>;
904
+ entryId: TypedField<"belongsTo", ResolvableEntryId, {
905
+ readonly stability: "preview";
906
+ }>;
907
+ id: TypedField<"id", ResolvableEntryReactionId, {}>;
908
+ resolvableId: TypedField<"belongsTo", ResolvableId, {
909
+ readonly stability: "preview";
910
+ }>;
911
+ userId: TypedField<"belongsTo", UserId, {
912
+ readonly stability: "preview";
913
+ }>;
914
+ value: TypedField<"typed", {
915
+ type: "emoji" | (string & {});
916
+ value: string;
917
+ }, {
918
+ readonly stability: "preview";
919
+ }>;
920
+ }, {
921
+ account: RelationEntry<"account", {
922
+ readonly type: "belongsTo";
923
+ readonly fk: "accountId";
924
+ readonly stability: "preview";
925
+ }>;
926
+ resolvable: RelationEntry<"resolvable", {
927
+ readonly type: "belongsTo";
928
+ readonly fk: "resolvableId";
929
+ readonly stability: "preview";
930
+ }>;
931
+ resolvableEntry: RelationEntry<"resolvableEntry", {
932
+ readonly type: "belongsTo";
933
+ readonly fk: "entryId";
934
+ readonly stability: "preview";
935
+ }>;
936
+ user: RelationEntry<"user", {
937
+ readonly type: "belongsTo";
938
+ readonly fk: "userId";
939
+ readonly stability: "preview";
940
+ }>;
941
+ }, ["id"]>;
942
+ /**
943
+ * A run: one time box of a Run Config, from `startDate` to `endDate`. Codecks creates the
944
+ * upcoming runs ahead of time and completes a run when it ends.
945
+ */
946
+ sprint: ModelDesc<"sprint", {
947
+ accountId: TypedField<"belongsTo", AccountId, {}>;
948
+ accountSeq: TypedField<"int", number, {}>;
949
+ autoMilestoneId: TypedField<"belongsTo", MilestoneId, {
950
+ readonly optional: true;
951
+ readonly stability: "preview";
952
+ }>;
953
+ completedAt: TypedField<"date", Date, {
954
+ readonly optional: true;
955
+ }>;
956
+ coverFileId: TypedField<"belongsTo", FileId, {
957
+ readonly optional: true;
958
+ readonly stability: "preview";
959
+ }>;
960
+ createdAt: TypedField<"date", Date, {}>;
961
+ description: TypedField<"string", string, {
962
+ readonly optional: true;
963
+ }>;
964
+ endDate: TypedField<"day", {
965
+ day: number;
966
+ month: number;
967
+ year: number;
968
+ }, {}>;
969
+ handSyncEnabled: TypedField<"bool", boolean, {
970
+ readonly stability: "preview";
971
+ }>;
972
+ id: TypedField<"id", SprintId, {}>;
973
+ index: TypedField<"int", number, {}>;
974
+ isDeleted: TypedField<"bool", boolean, {}>;
975
+ lockedAt: TypedField<"date", Date, {
976
+ readonly optional: true;
977
+ readonly stability: "preview";
978
+ }>;
979
+ manualOrderLabels: TypedField<"typed", (string | null)[], {
980
+ readonly stability: "preview";
981
+ }>;
982
+ name: TypedField<"string", string, {
983
+ readonly optional: true;
984
+ }>;
985
+ sprintConfigId: TypedField<"belongsTo", SprintConfigId, {}>;
986
+ startDate: TypedField<"day", {
987
+ day: number;
988
+ month: number;
989
+ year: number;
990
+ }, {}>;
991
+ userCapacities: TypedField<"typed", {
992
+ [userId: UserId]: number;
993
+ }, {
994
+ readonly stability: "preview";
995
+ }>;
996
+ }, {
997
+ account: RelationEntry<"account", {
998
+ readonly type: "belongsTo";
999
+ readonly fk: "accountId";
1000
+ }>;
1001
+ autoMilestone: RelationEntry<"milestone", {
1002
+ readonly type: "belongsTo";
1003
+ readonly fk: "autoMilestoneId";
1004
+ readonly optional: true;
1005
+ readonly stability: "preview";
1006
+ }>;
1007
+ cards: RelationEntry<"card", {
1008
+ readonly type: "hasMany";
1009
+ }>;
1010
+ coverFile: RelationEntry<"file", {
1011
+ readonly type: "belongsTo";
1012
+ readonly fk: "coverFileId";
1013
+ readonly optional: true;
1014
+ readonly stability: "preview";
1015
+ }>;
1016
+ progress: RelationEntry<"sprintProgress", {
1017
+ readonly type: "hasMany";
1018
+ readonly stability: "preview";
1019
+ }>;
1020
+ sprintConfig: RelationEntry<"sprintConfig", {
1021
+ readonly type: "belongsTo";
1022
+ readonly fk: "sprintConfigId";
1023
+ }>;
1024
+ }, ["id"]>;
1025
+ /**
1026
+ * A Run Config. It creates runs of the same length one after the other, like sprints, for its
1027
+ * projects.
1028
+ */
1029
+ sprintConfig: ModelDesc<"sprintConfig", {
1030
+ accountId: TypedField<"belongsTo", AccountId, {}>;
1031
+ autoAssignNewCard: TypedField<"bool", boolean, {
1032
+ readonly stability: "preview";
1033
+ }>;
1034
+ autoAssignStartedCard: TypedField<"bool", boolean, {
1035
+ readonly stability: "preview";
1036
+ }>;
1037
+ autoBeastModeDurationHours: TypedField<"int", number, {
1038
+ readonly optional: true;
1039
+ readonly stability: "preview";
1040
+ }>;
1041
+ beastGracePeriodHours: TypedField<"int", number, {
1042
+ readonly stability: "preview";
1043
+ }>;
1044
+ color: TypedField<"typed", MilestoneColor, {}>;
1045
+ createdAt: TypedField<"date", Date, {}>;
1046
+ creatorId: TypedField<"belongsTo", UserId, {}>;
1047
+ id: TypedField<"id", SprintConfigId, {}>;
1048
+ isGlobal: TypedField<"bool", boolean, {}>;
1049
+ moveOnFinish: TypedField<"typed", ((string & {}) | "blocked" | "review" | "undone")[], {
1050
+ readonly stability: "preview";
1051
+ }>;
1052
+ name: TypedField<"string", string, {}>;
1053
+ runLabelTemplate: TypedField<"string", string, {
1054
+ readonly optional: true;
1055
+ readonly stability: "preview";
1056
+ }>;
1057
+ }, {
1058
+ account: RelationEntry<"account", {
1059
+ readonly type: "belongsTo";
1060
+ readonly fk: "accountId";
1061
+ }>;
1062
+ creator: RelationEntry<"user", {
1063
+ readonly type: "belongsTo";
1064
+ readonly fk: "creatorId";
1065
+ }>;
1066
+ progress: RelationEntry<"sprintConfigProgress", {
1067
+ readonly type: "hasMany";
1068
+ readonly stability: "preview";
1069
+ }>;
1070
+ sprintProjects: RelationEntry<"sprintProject", {
1071
+ readonly type: "hasMany";
1072
+ }>;
1073
+ sprints: RelationEntry<"sprint", {
1074
+ readonly type: "hasMany";
1075
+ }>;
1076
+ }, ["id"]>;
1077
+ /**
1078
+ * The done cards of all runs of a Run Config on a day (UTC). A row is only written on days when
1079
+ * the numbers change, so a day without a row has the numbers of the row before it.
1080
+ * @experimental `preview` in the Codecks API: may change in any release.
1081
+ */
1082
+ sprintConfigProgress: ModelDesc<"sprintConfigProgress", {
1083
+ date: TypedField<"string", string, {
1084
+ readonly stability: "preview";
1085
+ }>;
1086
+ progress: TypedField<"typed", unknown, {
1087
+ readonly stability: "preview";
1088
+ }>;
1089
+ sprintConfigId: TypedField<"belongsTo", SprintConfigId, {
1090
+ readonly stability: "preview";
1091
+ }>;
1092
+ }, {
1093
+ sprintConfig: RelationEntry<"sprintConfig", {
1094
+ readonly type: "belongsTo";
1095
+ readonly fk: "sprintConfigId";
1096
+ readonly stability: "preview";
1097
+ }>;
1098
+ }, ["sprintConfigId", "date"]>;
1099
+ /**
1100
+ * The state of a run's cards on a day (UTC). A row is only written on days when the numbers
1101
+ * change, so a day without a row has the numbers of the row before it.
1102
+ * @experimental `preview` in the Codecks API: may change in any release.
1103
+ */
1104
+ sprintProgress: ModelDesc<"sprintProgress", {
1105
+ date: TypedField<"string", string, {
1106
+ readonly stability: "preview";
1107
+ }>;
1108
+ progress: TypedField<"typed", unknown, {
1109
+ readonly stability: "preview";
1110
+ }>;
1111
+ sprintId: TypedField<"belongsTo", SprintId, {
1112
+ readonly stability: "preview";
1113
+ }>;
1114
+ }, {
1115
+ sprint: RelationEntry<"sprint", {
1116
+ readonly type: "belongsTo";
1117
+ readonly fk: "sprintId";
1118
+ readonly stability: "preview";
1119
+ }>;
1120
+ }, ["sprintId", "date"]>;
1121
+ /**
1122
+ * Links a run config to a project whose cards can be planned into its runs. A run config with
1123
+ * `isGlobal` is linked to every project.
1124
+ */
1125
+ sprintProject: ModelDesc<"sprintProject", {
1126
+ accountId: TypedField<"belongsTo", AccountId, {}>;
1127
+ projectId: TypedField<"belongsTo", ProjectId, {}>;
1128
+ sprintConfigId: TypedField<"belongsTo", SprintConfigId, {}>;
1129
+ }, {
1130
+ account: RelationEntry<"account", {
1131
+ readonly type: "belongsTo";
1132
+ readonly fk: "accountId";
1133
+ }>;
1134
+ project: RelationEntry<"project", {
1135
+ readonly type: "belongsTo";
1136
+ readonly fk: "projectId";
1137
+ }>;
1138
+ sprintConfig: RelationEntry<"sprintConfig", {
1139
+ readonly type: "belongsTo";
1140
+ readonly fk: "sprintConfigId";
1141
+ }>;
1142
+ }, ["sprintConfigId", "projectId"]>;
1143
+ /**
1144
+ * A person, or an integration or API token that acts in an organization. `kind` tells them apart.
1145
+ */
1146
+ user: ModelDesc<"user", {
1147
+ fullName: TypedField<"string", string, {
1148
+ readonly optional: true;
1149
+ }>;
1150
+ id: TypedField<"id", UserId, {}>;
1151
+ isIntegration: TypedField<"bool", boolean, {}>;
1152
+ kind: TypedField<"typed", (string & {}) | "human" | "integration" | "api_token", {}>;
1153
+ name: TypedField<"string", string, {}>;
1154
+ profileImageId: TypedField<"belongsTo", FileId, {
1155
+ readonly optional: true;
1156
+ }>;
1157
+ timezone: TypedField<"string", string, {
1158
+ readonly optional: true;
1159
+ readonly stability: "preview";
1160
+ }>;
1161
+ }, {
1162
+ profileImage: RelationEntry<"file", {
1163
+ readonly type: "belongsTo";
1164
+ readonly fk: "profileImageId";
1165
+ readonly optional: true;
1166
+ }>;
1167
+ }, ["id"]>;
1168
+ /**
1169
+ * A Journey Step: a template for a sub card. Starting a deck's journey on a card creates a sub
1170
+ * card from each of its steps.
1171
+ * @experimental `preview` in the Codecks API: may change in any release.
1172
+ */
1173
+ workflowItem: ModelDesc<"workflowItem", {
1174
+ accountId: TypedField<"belongsTo", AccountId, {
1175
+ readonly stability: "preview";
1176
+ }>;
1177
+ accountSeq: TypedField<"int", number, {
1178
+ readonly stability: "preview";
1179
+ }>;
1180
+ assigneeId: TypedField<"belongsTo", UserId, {
1181
+ readonly optional: true;
1182
+ readonly stability: "preview";
1183
+ }>;
1184
+ checkboxInfo: TypedField<"typed", Checkbox[], {
1185
+ readonly stability: "preview";
1186
+ }>;
1187
+ checkboxStats: TypedField<"typed", CheckboxStats, {
1188
+ readonly stability: "preview";
1189
+ }>;
1190
+ content: TypedField<"string", string, {
1191
+ readonly stability: "preview";
1192
+ }>;
1193
+ createdAt: TypedField<"date", Date, {
1194
+ readonly stability: "preview";
1195
+ }>;
1196
+ creatorId: TypedField<"belongsTo", UserId, {
1197
+ readonly stability: "preview";
1198
+ }>;
1199
+ deckId: TypedField<"belongsTo", DeckId, {
1200
+ readonly stability: "preview";
1201
+ }>;
1202
+ effort: TypedField<"int", number, {
1203
+ readonly optional: true;
1204
+ readonly stability: "preview";
1205
+ }>;
1206
+ itemId: TypedField<"id", WorkflowItemId, {}>;
1207
+ label: TypedField<"string", string, {
1208
+ readonly optional: true;
1209
+ readonly stability: "preview";
1210
+ }>;
1211
+ lastUpdatedAt: TypedField<"date", Date, {
1212
+ readonly stability: "preview";
1213
+ }>;
1214
+ masterTags: TypedField<"typed", string[], {
1215
+ readonly stability: "preview";
1216
+ }>;
1217
+ mentionedUsers: TypedField<"typed", UserId[], {
1218
+ readonly stability: "preview";
1219
+ }>;
1220
+ priority: TypedField<"typed", Priority, {
1221
+ readonly optional: true;
1222
+ readonly stability: "preview";
1223
+ }>;
1224
+ sortValue: TypedField<"string", string, {
1225
+ readonly stability: "preview";
1226
+ }>;
1227
+ tags: TypedField<"typed", string[], {
1228
+ readonly stability: "preview";
1229
+ }>;
1230
+ targetDeckId: TypedField<"belongsTo", DeckId, {
1231
+ readonly optional: true;
1232
+ readonly stability: "preview";
1233
+ }>;
1234
+ title: TypedField<"string", string, {
1235
+ readonly stability: "preview";
1236
+ }>;
1237
+ version: TypedField<"int", number, {
1238
+ readonly stability: "preview";
1239
+ }>;
1240
+ visibility: TypedField<"typed", CardVisibility, {
1241
+ readonly stability: "preview";
1242
+ }>;
1243
+ }, {
1244
+ account: RelationEntry<"account", {
1245
+ readonly type: "belongsTo";
1246
+ readonly fk: "accountId";
1247
+ readonly stability: "preview";
1248
+ }>;
1249
+ assignee: RelationEntry<"user", {
1250
+ readonly type: "belongsTo";
1251
+ readonly fk: "assigneeId";
1252
+ readonly optional: true;
1253
+ readonly stability: "preview";
1254
+ }>;
1255
+ creator: RelationEntry<"user", {
1256
+ readonly type: "belongsTo";
1257
+ readonly fk: "creatorId";
1258
+ readonly stability: "preview";
1259
+ }>;
1260
+ deck: RelationEntry<"deck", {
1261
+ readonly type: "belongsTo";
1262
+ readonly fk: "deckId";
1263
+ readonly stability: "preview";
1264
+ }>;
1265
+ inDeps: RelationEntry<"workflowItem", {
1266
+ readonly type: "hasMany";
1267
+ readonly fkAsArray: true;
1268
+ readonly stability: "preview";
1269
+ }>;
1270
+ outDeps: RelationEntry<"workflowItem", {
1271
+ readonly type: "hasMany";
1272
+ readonly fkAsArray: true;
1273
+ readonly stability: "preview";
1274
+ }>;
1275
+ targetDeck: RelationEntry<"deck", {
1276
+ readonly type: "belongsTo";
1277
+ readonly fk: "targetDeckId";
1278
+ readonly optional: true;
1279
+ readonly stability: "preview";
1280
+ }>;
1281
+ }, ["itemId"]>;
1282
+ };
1283
+ //#endregion
1284
+ //#region src/models/actions.d.ts
1285
+ /** Every action of the API, by the name it is dispatched as: `POST /dispatch/<name>`. */
1286
+ type ActionMap = {
1287
+ /**
1288
+ * Bookmarks cards for a user, at the end of their bookmarks. Cards that are already bookmarked
1289
+ * move to the end.
1290
+ * Requires `handCard:writeOwn` or `handCard:writeAny`, depending on the call.
1291
+ */
1292
+ "bookmarks/addCards": {
1293
+ params: {
1294
+ ids: CardId[];
1295
+ userId: UserId;
1296
+ };
1297
+ response: void;
1298
+ };
1299
+ /**
1300
+ * Removes cards from a user's bookmarks.
1301
+ * Requires `handCard:writeOwn` or `handCard:writeAny`, depending on the call.
1302
+ */
1303
+ "bookmarks/removeCards": {
1304
+ params: {
1305
+ ids: CardId[];
1306
+ userId: UserId;
1307
+ };
1308
+ response: void;
1309
+ };
1310
+ /**
1311
+ * Moves cards to the top of a user's bookmarks, in the given order. The other bookmarks follow in
1312
+ * their current order. Cards that aren't bookmarked yet get bookmarked.
1313
+ * Requires `handCard:writeOwn` or `handCard:writeAny`, depending on the call.
1314
+ */
1315
+ "bookmarks/setOrders": {
1316
+ params: {
1317
+ cardIds: CardId[];
1318
+ userId: UserId;
1319
+ };
1320
+ response: void;
1321
+ };
1322
+ /**
1323
+ * Puts cards into a manual order right after `targetId`, in the order of `cardIds`, and into the
1324
+ * zone `label`.
1325
+ * Requires `cardOrder:write`.
1326
+ * @experimental `preview` in the Codecks API: may change in any release.
1327
+ */
1328
+ "cardOrders/addAfter": {
1329
+ params: {
1330
+ /** `null` puts the cards at the end. */
1331
+ targetId: CardId | null;
1332
+ cardIds: CardId[];
1333
+ /**
1334
+ * Which manual order to change: the one of the cards' deck, milestone or run. A card has one
1335
+ * position in each.
1336
+ */
1337
+ context: "milestone" | "deck" | "sprint";
1338
+ /**
1339
+ * The zone, one of the `manualOrderLabels` of the deck, milestone or run. `null` is the zone
1340
+ * without a name.
1341
+ */
1342
+ label: string | null;
1343
+ };
1344
+ response: void;
1345
+ };
1346
+ /**
1347
+ * Puts cards into a manual order right before `targetId`, in the order of `cardIds`, and into the
1348
+ * zone `label`.
1349
+ * Requires `cardOrder:write`.
1350
+ * @experimental `preview` in the Codecks API: may change in any release.
1351
+ */
1352
+ "cardOrders/addBefore": {
1353
+ params: {
1354
+ /** `null` puts the cards at the start. */
1355
+ targetId: CardId | null;
1356
+ cardIds: CardId[];
1357
+ /**
1358
+ * Which manual order to change: the one of the cards' deck, milestone or run. A card has one
1359
+ * position in each.
1360
+ */
1361
+ context: "milestone" | "deck" | "sprint";
1362
+ /**
1363
+ * The zone, one of the `manualOrderLabels` of the deck, milestone or run. `null` is the zone
1364
+ * without a name.
1365
+ */
1366
+ label: string | null;
1367
+ };
1368
+ response: void;
1369
+ };
1370
+ /**
1371
+ * Moves cards into another zone of a manual order and keeps their position. Cards that have no
1372
+ * position in that order yet are skipped.
1373
+ * Requires `cardOrder:write`.
1374
+ * @experimental `preview` in the Codecks API: may change in any release.
1375
+ */
1376
+ "cardOrders/updateLabel": {
1377
+ params: {
1378
+ cardIds: CardId[];
1379
+ /**
1380
+ * Which manual order to change: the one of the cards' deck, milestone or run. A card has one
1381
+ * position in each.
1382
+ */
1383
+ context: "milestone" | "deck" | "sprint";
1384
+ /**
1385
+ * The zone, one of the `manualOrderLabels` of the deck, milestone or run. `null` is the zone
1386
+ * without a name.
1387
+ */
1388
+ label: string | null;
1389
+ };
1390
+ response: void;
1391
+ };
1392
+ /**
1393
+ * Sets the same values on every card in `ids`. Look at `cards/update` for the property details.
1394
+ * Requires `card:write`.
1395
+ */
1396
+ "cards/bulkUpdate": {
1397
+ params: {
1398
+ ids: CardId[];
1399
+ priority?: "a" | "b" | "c" | null;
1400
+ effort?: number | null;
1401
+ status?: "not_started" | "started" | "done";
1402
+ assigneeId?: UserId | null;
1403
+ deckId?: DeckId;
1404
+ visibility?: "default" | "archived" | "deleted";
1405
+ milestoneId?: MilestoneId | null;
1406
+ sprintId?: SprintId | null;
1407
+ /**
1408
+ * `YYYY-MM-DD`, or `null` to remove it. Fails unless the organization's plan includes due
1409
+ * dates.
1410
+ */
1411
+ dueDate?: string | null;
1412
+ isDoc?: boolean;
1413
+ /** Adds this tag to every card's `masterTags`. */
1414
+ addMasterTag?: string;
1415
+ /** Removes this tag from every card, ignoring case. */
1416
+ removeMasterTag?: string;
1417
+ parentCardId?: CardId | null;
1418
+ };
1419
+ response: void;
1420
+ };
1421
+ /**
1422
+ * Copies each card into a deck, as `not_started` and with the same `content`. A copied sub card
1423
+ * is added to its hero card right after the original.
1424
+ * Requires `card:write`.
1425
+ * @experimental `preview` in the Codecks API: may change in any release.
1426
+ */
1427
+ "cards/copy": {
1428
+ params: {
1429
+ ids: CardId[];
1430
+ /** The fields to copy besides `content`. */
1431
+ props: ("effort" | "priority" | "assigneeId" | "masterTags" | "attachments" | "milestoneId" | "sprintId")[];
1432
+ /** The id of the deck to copy into. */
1433
+ target: string;
1434
+ };
1435
+ response: void;
1436
+ };
1437
+ /**
1438
+ * Creates a card as `not_started`. The first line of `content` becomes its `title`. Everyone
1439
+ * mentioned in `content` is subscribed to the card.
1440
+ * Requires `card:write`.
1441
+ */
1442
+ "cards/create": {
1443
+ params: {
1444
+ /** Markdown. Its first line becomes the card's `title`. */
1445
+ content: string;
1446
+ priority?: "a" | "b" | "c" | null;
1447
+ effort?: number | null;
1448
+ assigneeId?: UserId | null;
1449
+ /** `null` creates a private card, and bookmarks it for you. */
1450
+ deckId: DeckId | null;
1451
+ /** Project tags, on top of those written as `#tag` in `content`. */
1452
+ masterTags?: string[];
1453
+ milestoneId?: MilestoneId | null;
1454
+ sprintId?: SprintId | null;
1455
+ /** Adds the card as the last sub card of this hero card. */
1456
+ parentCardId?: CardId | null;
1457
+ /** `YYYY-MM-DD`. Fails unless the organization's plan includes due dates. */
1458
+ dueDate?: string | null;
1459
+ isDoc?: boolean;
1460
+ /** Bookmarks the card for you. */
1461
+ addAsBookmark?: boolean;
1462
+ /**
1463
+ * Adds the card to its assignee's Hand, or to yours when it has none. Fails when that Hand
1464
+ * has no free slot (`account.maxHandSlotCount`).
1465
+ */
1466
+ putInQueue?: boolean;
1467
+ /** Subscribes you to the card, so you're notified about its changes and comments. */
1468
+ subscribeCreator?: boolean;
1469
+ };
1470
+ response: {
1471
+ id: CardId;
1472
+ /** The card's number, see `card.accountSeq`. */
1473
+ accountSeq: number;
1474
+ };
1475
+ };
1476
+ /**
1477
+ * Creates cards in one deck and returns their ids in the same order. Unlike `cards/create`, it
1478
+ * doesn't subscribe you to them.
1479
+ * Requires `card:write`.
1480
+ */
1481
+ "cards/createMany": {
1482
+ params: {
1483
+ /**
1484
+ * The first line of each `content` becomes the card's `title`. `status` defaults to
1485
+ * `not_started`, `visibility` to `default`.
1486
+ */
1487
+ cards: {
1488
+ content: string;
1489
+ priority?: "a" | "b" | "c" | null;
1490
+ effort?: number | null;
1491
+ assigneeId?: UserId | null;
1492
+ isDoc?: boolean;
1493
+ visibility?: "archived" | "default" | "deleted";
1494
+ status?: "not_started" | "started" | "done" | null;
1495
+ }[];
1496
+ deckId: DeckId;
1497
+ /** Adds the cards as the last sub cards of this hero card. */
1498
+ parentCardId?: CardId | null;
1499
+ };
1500
+ response: {
1501
+ cards: {
1502
+ id: CardId;
1503
+ accountSeq: number;
1504
+ }[];
1505
+ };
1506
+ };
1507
+ /**
1508
+ * Changes the given fields of a card. Some writes change other fields too: `content` sets `title`
1509
+ * and `tags`, and giving a started card another assignee sets it back to `not_started`.
1510
+ * Requires `card:write`.
1511
+ */
1512
+ "cards/update": {
1513
+ params: {
1514
+ id: CardId;
1515
+ /** Markdown. Its first line becomes the card's `title`. */
1516
+ content?: string;
1517
+ priority?: "a" | "b" | "c" | null;
1518
+ effort?: number | null;
1519
+ /** A Hero Card can't be started. */
1520
+ status?: "not_started" | "started" | "done";
1521
+ assigneeId?: UserId | null;
1522
+ deckId?: DeckId;
1523
+ /** Replaces the project tags. Those written as `#tag` in `content` stay. */
1524
+ masterTags?: string[];
1525
+ /**
1526
+ * Archiving or deleting a started card sets it back to `not_started`. Deleting also removes
1527
+ * its dependencies.
1528
+ */
1529
+ visibility?: "default" | "archived" | "deleted";
1530
+ milestoneId?: MilestoneId | null;
1531
+ sprintId?: SprintId | null;
1532
+ /** The hero card to make this card a sub card of. */
1533
+ parentCardId?: CardId | null;
1534
+ /**
1535
+ * A hero card's sub cards, in order.
1536
+ * @experimental `preview` in the Codecks API: may change in any release.
1537
+ */
1538
+ childCards?: CardId[] | null;
1539
+ /**
1540
+ * The cards that have to be done before this one. Fails when it would make a cycle.
1541
+ * @experimental `preview` in the Codecks API: may change in any release.
1542
+ */
1543
+ inDeps?: CardId[];
1544
+ /**
1545
+ * The cards that are blocked by this one.
1546
+ * @experimental `preview` in the Codecks API: may change in any release.
1547
+ */
1548
+ outDeps?: CardId[];
1549
+ /**
1550
+ * `YYYY-MM-DD`, or `null` to remove it. Fails unless the organization's plan includes due
1551
+ * dates.
1552
+ */
1553
+ dueDate?: string | null;
1554
+ isDoc?: boolean;
1555
+ };
1556
+ response: void;
1557
+ };
1558
+ /**
1559
+ * Updates several cards, each with its own values. Cards that don't exist or that you can't see
1560
+ * are skipped.
1561
+ * Requires `card:write`.
1562
+ */
1563
+ "cards/updateMany": {
1564
+ params: {
1565
+ /**
1566
+ * Each needs a `content` or a `title`. With both, the content becomes the title, an empty
1567
+ * line and `content`. A `title` alone replaces the first line of the current content. Project
1568
+ * tags in `masterTags` that the project doesn't have yet are created.
1569
+ */
1570
+ cards: {
1571
+ id: CardId;
1572
+ content?: string | null;
1573
+ title?: string | null;
1574
+ priority?: "a" | "b" | "c" | null;
1575
+ effort?: number | null;
1576
+ assigneeId?: UserId | null;
1577
+ isDoc?: boolean;
1578
+ visibility?: "archived" | "default" | "deleted";
1579
+ status?: "not_started" | "started" | "done" | null;
1580
+ masterTags?: string[];
1581
+ }[];
1582
+ };
1583
+ response: void;
1584
+ };
1585
+ /**
1586
+ * Moves decks into a project's space, right after `targetId` and in the order of `deckIds`. Decks
1587
+ * from another project move with their cards.
1588
+ * Requires `deck:write`.
1589
+ * @experimental `preview` in the Codecks API: may change in any release.
1590
+ */
1591
+ "decks/addToSpaceAfter": {
1592
+ params: {
1593
+ deckIds: DeckId[];
1594
+ /** `null` puts the decks at the end of the space. */
1595
+ targetId: DeckId | null;
1596
+ targetProjectId: ProjectId;
1597
+ /** One of the ids in `project.spaces`. */
1598
+ targetSpaceId: number;
1599
+ };
1600
+ response: void;
1601
+ };
1602
+ /**
1603
+ * Moves decks into a project's space, right before `targetId` and in the order of `deckIds`.
1604
+ * Decks from another project move with their cards.
1605
+ * Requires `deck:write`.
1606
+ * @experimental `preview` in the Codecks API: may change in any release.
1607
+ */
1608
+ "decks/addToSpaceBefore": {
1609
+ params: {
1610
+ deckIds: DeckId[];
1611
+ /** `null` puts the decks at the start of the space. */
1612
+ targetId: DeckId | null;
1613
+ targetProjectId: ProjectId;
1614
+ /** One of the ids in `project.spaces`. */
1615
+ targetSpaceId: number;
1616
+ };
1617
+ response: void;
1618
+ };
1619
+ /**
1620
+ * Creates a deck at the end of the project's first space. `deckType` defaults to that space's
1621
+ * `defaultDeckType`.
1622
+ * Requires `deck:write`.
1623
+ */
1624
+ "decks/create": {
1625
+ params: {
1626
+ title: string;
1627
+ projectId: ProjectId;
1628
+ /**
1629
+ * A hex color like `#ff8800`.
1630
+ * @experimental `preview` in the Codecks API: may change in any release.
1631
+ */
1632
+ coverColor?: string | null;
1633
+ deckType?: "task" | "hero" | "doc" | "mixed";
1634
+ };
1635
+ response: {
1636
+ id: DeckId;
1637
+ };
1638
+ };
1639
+ /**
1640
+ * Sets `isDeleted` on the deck and archives its cards, their sub cards in other decks, and the
1641
+ * journey steps that create cards in this deck.
1642
+ * Requires `deck:delete`.
1643
+ */
1644
+ "decks/delete": {
1645
+ params: {
1646
+ id: DeckId;
1647
+ };
1648
+ response: void;
1649
+ };
1650
+ /**
1651
+ * Renames a zone of the deck's manual order. The cards in that zone move to the new name with it,
1652
+ * including archived ones.
1653
+ * Requires `deck:write` and `cardOrder:write`.
1654
+ * @experimental `preview` in the Codecks API: may change in any release.
1655
+ */
1656
+ "decks/renameZone": {
1657
+ params: {
1658
+ id: DeckId;
1659
+ /** The zone to rename, one of `manualOrderLabels`. `null` is the zone without a name. */
1660
+ label: string | null;
1661
+ /** Trimmed. Fails if the deck already has a zone with that name. */
1662
+ newLabel: string;
1663
+ };
1664
+ response: void;
1665
+ };
1666
+ /** Requires `deck:write` or `project:write`, depending on the call. */
1667
+ "decks/update": {
1668
+ params: {
1669
+ id: DeckId;
1670
+ /**
1671
+ * Also puts the deck's cards that aren't archived or deleted into this milestone. `null` only
1672
+ * takes it from cards that were in the deck's old milestone.
1673
+ */
1674
+ milestoneId?: MilestoneId | null;
1675
+ title?: string;
1676
+ description?: string;
1677
+ /**
1678
+ * Turning it on adds the deck's assigned cards that aren't done to their assignee's Hand.
1679
+ * @experimental `preview` in the Codecks API: may change in any release.
1680
+ */
1681
+ handSyncEnabled?: boolean;
1682
+ /**
1683
+ * The deck's auto tag. Changing it removes the old tag from all of the deck's cards and adds
1684
+ * the new one.
1685
+ */
1686
+ defaultProjectTagId?: ProjectTagId | null;
1687
+ /**
1688
+ * The zone names are trimmed, and duplicates are dropped. Renaming a zone here leaves its
1689
+ * cards with the old name; use `decks/renameZone` instead.
1690
+ * @experimental `preview` in the Codecks API: may change in any release.
1691
+ */
1692
+ manualOrderLabels?: (string | null)[];
1693
+ /**
1694
+ * A hex color like `#ff8800`.
1695
+ * @experimental `preview` in the Codecks API: may change in any release.
1696
+ */
1697
+ coverColor?: string | null;
1698
+ /**
1699
+ * Switching to `hero` sets the deck's started cards back to `not_started`. Switching to
1700
+ * `hero` or `doc` fails while journey steps create their cards in this deck.
1701
+ */
1702
+ deckType?: "task" | "hero" | "doc" | "mixed";
1703
+ };
1704
+ response: void;
1705
+ };
1706
+ /**
1707
+ * Sets the deck's guardians to exactly `userIds` and updates `hasGuardians`. Fails unless the
1708
+ * organization's plan includes guardians or `userIds` is empty.
1709
+ * Requires `deckGuardian:write`.
1710
+ * @experimental `preview` in the Codecks API: may change in any release.
1711
+ */
1712
+ "decks/updateGuardians": {
1713
+ params: {
1714
+ id: DeckId;
1715
+ userIds: UserId[];
1716
+ };
1717
+ response: void;
1718
+ };
1719
+ /**
1720
+ * Adds cards to the end of a user's Hand. Cards that are done, deleted, archived or already in
1721
+ * that Hand are skipped. A card without an owner gets the user as owner. Fails when the Hand
1722
+ * doesn't have enough free slots (`account.maxHandSlotCount`).
1723
+ * Requires `queueEntry:write`.
1724
+ */
1725
+ "handQueue/addCardsToHand": {
1726
+ params: {
1727
+ cardIds: CardId[];
1728
+ userId: UserId;
1729
+ };
1730
+ response: {
1731
+ /** The new entries, one for each added card. */
1732
+ queueEntries: {
1733
+ id: QueueEntryId;
1734
+ cardId: CardId;
1735
+ }[];
1736
+ };
1737
+ };
1738
+ /**
1739
+ * Removes cards from a user's Hand, or from every Hand when `userId` is left out. This includes
1740
+ * entries in the done pile.
1741
+ * Requires `queueEntry:write`.
1742
+ */
1743
+ "handQueue/removeCards": {
1744
+ params: {
1745
+ cardIds: CardId[];
1746
+ userId?: UserId;
1747
+ };
1748
+ response: void;
1749
+ };
1750
+ /**
1751
+ * Sets the order of a user's Hand and can add cards to it. A card added this way that has no
1752
+ * owner gets the user as owner. Fails when the Hand doesn't have enough free slots for the added
1753
+ * cards (`account.maxHandSlotCount`).
1754
+ * Requires `queueEntry:write`.
1755
+ */
1756
+ "handQueue/setCardOrders": {
1757
+ params: {
1758
+ /**
1759
+ * The new order from the first card on. Cards of the Hand that are missing here follow in
1760
+ * their current order. Cards that are neither in the Hand nor in `draggedCardIds` are
1761
+ * ignored.
1762
+ */
1763
+ cardIds: CardId[];
1764
+ /**
1765
+ * The cards that moved, from within the Hand or from outside. Cards from outside are added.
1766
+ * Nothing changes if it is empty or none of them can be in a Hand, e.g. because they are
1767
+ * deleted.
1768
+ */
1769
+ draggedCardIds: CardId[];
1770
+ userId: UserId;
1771
+ };
1772
+ response: {
1773
+ /** The Hand's entries after the change. */
1774
+ queueEntries: {
1775
+ id: QueueEntryId;
1776
+ cardId: CardId;
1777
+ }[];
1778
+ };
1779
+ };
1780
+ /**
1781
+ * Creates a milestone for the projects in `projectIds`, or for all projects with `isGlobal`.
1782
+ * Requires `milestone:write`.
1783
+ */
1784
+ "milestones/create": {
1785
+ params: {
1786
+ accountId: AccountId;
1787
+ name: string;
1788
+ description?: string;
1789
+ color: "gray" | "brown" | "yellow" | "red" | "pink" | "blue" | "green";
1790
+ /** `YYYY-MM-DD`. */
1791
+ date: string;
1792
+ /** `YYYY-MM-DD`. */
1793
+ startDate?: string | null;
1794
+ isGlobal: boolean;
1795
+ /** Ignored when `isGlobal` is set. */
1796
+ projectIds: ProjectId[] | null;
1797
+ };
1798
+ response: {
1799
+ id: MilestoneId;
1800
+ /** The milestone's number, see `milestone.accountSeq`. */
1801
+ accountSeq: number;
1802
+ };
1803
+ };
1804
+ /**
1805
+ * Marks a milestone as deleted (`isDeleted`). It's removed from all its cards and decks, and
1806
+ * nobody has it pinned anymore.
1807
+ * Requires `milestone:write`.
1808
+ */
1809
+ "milestones/delete": {
1810
+ params: {
1811
+ id: MilestoneId;
1812
+ };
1813
+ response: void;
1814
+ };
1815
+ /**
1816
+ * Pins a milestone for a user. The web app shows it in the user's Hand. A user has one pinned
1817
+ * milestone per organization, so pinning another one replaces it.
1818
+ * Requires `pinnedMilestone:writeOwn` or `pinnedMilestone:writeAny`, depending on the call.
1819
+ * @experimental `preview` in the Codecks API: may change in any release.
1820
+ */
1821
+ "milestones/pin": {
1822
+ params: {
1823
+ /** `null` removes the user's pin. */
1824
+ milestoneId: MilestoneId | null;
1825
+ /** The token's own user. For a personal token, that's you. */
1826
+ userId: UserId;
1827
+ };
1828
+ response: void;
1829
+ };
1830
+ /**
1831
+ * Renames a zone of the milestone's manual order. The cards in that zone move to the new name
1832
+ * with it, including archived ones.
1833
+ * Requires `milestone:write` and `cardOrder:write`.
1834
+ * @experimental `preview` in the Codecks API: may change in any release.
1835
+ */
1836
+ "milestones/renameZone": {
1837
+ params: {
1838
+ id: MilestoneId;
1839
+ /** The zone to rename, one of `manualOrderLabels`. `null` is the zone without a name. */
1840
+ label: string | null;
1841
+ /** Trimmed. Fails if the milestone already has a zone with that name. */
1842
+ newLabel: string;
1843
+ };
1844
+ response: void;
1845
+ };
1846
+ /** Requires `milestone:write`. */
1847
+ "milestones/update": {
1848
+ params: {
1849
+ id: MilestoneId;
1850
+ name?: string;
1851
+ description?: string;
1852
+ color?: "gray" | "brown" | "yellow" | "red" | "pink" | "blue" | "green";
1853
+ /** `YYYY-MM-DD`. */
1854
+ date?: string;
1855
+ /** `YYYY-MM-DD`, or `null` to remove it. */
1856
+ startDate?: string | null;
1857
+ /**
1858
+ * Turning it on also adds the milestone's cards that are not done and have an assignee to the
1859
+ * assignee's Hand.
1860
+ * @experimental `preview` in the Codecks API: may change in any release.
1861
+ */
1862
+ handSyncEnabled?: boolean;
1863
+ /**
1864
+ * `true` links the milestone to all projects. `false` needs `projectIds` if the milestone is
1865
+ * global.
1866
+ */
1867
+ isGlobal?: boolean;
1868
+ /**
1869
+ * Replaces the milestone's projects and makes it non-global. Ignored with `isGlobal: true`.
1870
+ * Cards and decks of projects that are removed lose the milestone.
1871
+ */
1872
+ projectIds?: ProjectId[] | null;
1873
+ /**
1874
+ * Labels are trimmed, and duplicates are removed. Renaming a zone here leaves its cards with
1875
+ * the old name; use `milestones/renameZone` instead.
1876
+ * @experimental `preview` in the Codecks API: may change in any release.
1877
+ */
1878
+ manualOrderLabels?: (string | null)[];
1879
+ /**
1880
+ * Replaces all capacities. Fails with a value above 0 unless the organization's plan includes
1881
+ * capacity tracking.
1882
+ * @experimental `preview` in the Codecks API: may change in any release.
1883
+ */
1884
+ userCapacities?: {
1885
+ [key: string]: number;
1886
+ };
1887
+ };
1888
+ response: void;
1889
+ };
1890
+ /**
1891
+ * Adds your reaction to a comment. Fails if you already reacted with the same emoji.
1892
+ * Requires `resolvableEntryReaction:writeOwn`.
1893
+ * @experimental `preview` in the Codecks API: may change in any release.
1894
+ */
1895
+ "resolvables/addReaction": {
1896
+ params: {
1897
+ entryId: ResolvableEntryId;
1898
+ /** `value` is the emoji character itself, like `👍`. */
1899
+ value: {
1900
+ type: "emoji";
1901
+ value: string;
1902
+ };
1903
+ };
1904
+ response: {
1905
+ id: ResolvableEntryReactionId;
1906
+ };
1907
+ };
1908
+ /**
1909
+ * Closes a comment thread. Closing a `block` or `review` thread ends the card's blocked or in
1910
+ * review state. In a deck with guardians, only a guardian, a producer or an admin may close a
1911
+ * `review`, unless the guardians in it approved and you are the card's assignee.
1912
+ * Requires `resolvable:write` or `card:write`, depending on the call.
1913
+ */
1914
+ "resolvables/close": {
1915
+ params: {
1916
+ id: ResolvableId;
1917
+ /** Also sets the card's `status` to `done`. */
1918
+ markCardDone?: boolean;
1919
+ };
1920
+ response: {
1921
+ cardId: CardId;
1922
+ };
1923
+ };
1924
+ /**
1925
+ * Adds a comment to a thread. You and everyone mentioned in `content` join the thread, even if
1926
+ * you opted out before. The other participants who didn't opt out are notified.
1927
+ * Requires `resolvableEntry:writeOwn`.
1928
+ */
1929
+ "resolvables/comment": {
1930
+ params: {
1931
+ resolvableId: ResolvableId;
1932
+ /** Markdown. `@name` mentions of the organization's users are stored as `@[userId:<id>]`. */
1933
+ content: string;
1934
+ };
1935
+ response: {
1936
+ id: ResolvableEntryId;
1937
+ };
1938
+ };
1939
+ /**
1940
+ * Starts a comment thread on a card with its first comment. You, the card's assignee and everyone
1941
+ * mentioned in `content` join it, and everyone watching the card is notified.
1942
+ * Requires `resolvable:write` or `card:write`, depending on the call.
1943
+ */
1944
+ "resolvables/create": {
1945
+ params: {
1946
+ cardId: CardId;
1947
+ /**
1948
+ * `block` or `review` sets the card back to `not_started` and marks it as blocked or in
1949
+ * review until the thread is closed. A `review` thread also adds the deck's guardians.
1950
+ */
1951
+ context: "block" | "review" | "comment";
1952
+ /** Markdown. `@name` mentions of the organization's users are stored as `@[userId:<id>]`. */
1953
+ content: string;
1954
+ };
1955
+ response: {
1956
+ id: ResolvableId;
1957
+ };
1958
+ };
1959
+ /**
1960
+ * Requires `resolvableEntryReaction:writeOwn` or `resolvableEntryReaction:writeAny`, depending on
1961
+ * the call.
1962
+ * @experimental `preview` in the Codecks API: may change in any release.
1963
+ */
1964
+ "resolvables/removeReaction": {
1965
+ params: {
1966
+ reactionId: ResolvableEntryReactionId;
1967
+ };
1968
+ response: void;
1969
+ };
1970
+ /**
1971
+ * Opens a closed comment thread again. Reopening a `block` or `review` thread sets the card back
1972
+ * to `not_started`, and fails for doc cards, hero cards and cards that already have an open
1973
+ * `block` or `review` thread.
1974
+ * Requires `resolvable:write` or `card:write`, depending on the call.
1975
+ */
1976
+ "resolvables/reopen": {
1977
+ params: {
1978
+ id: ResolvableId;
1979
+ };
1980
+ response: void;
1981
+ };
1982
+ /**
1983
+ * Changes a comment's `content`. If the thread is open, users newly mentioned in it join the
1984
+ * thread.
1985
+ * Requires `resolvableEntry:writeOwn` or `resolvableEntry:writeAny`, depending on the call.
1986
+ */
1987
+ "resolvables/updateComment": {
1988
+ params: {
1989
+ entryId: ResolvableEntryId;
1990
+ /** Markdown. `@name` mentions of the organization's users are stored as `@[userId:<id>]`. */
1991
+ content: string;
1992
+ };
1993
+ response: void;
1994
+ };
1995
+ /**
1996
+ * Opts a participant out of a comment thread (`done: true`) or back in (`done: false`).
1997
+ * Participants who opted out aren't notified about new comments. The card's assignee can't opt
1998
+ * out.
1999
+ * Requires `resolvableParticipant:writeOwn` or `resolvableParticipant:writeAny`, depending on the
2000
+ * call.
2001
+ * @experimental `preview` in the Codecks API: may change in any release.
2002
+ */
2003
+ "resolvables/updateParticipantDone": {
2004
+ params: {
2005
+ resolvableId: ResolvableId;
2006
+ userId: UserId;
2007
+ done: boolean;
2008
+ /**
2009
+ * Defaults to `opt_out` with `done: true` and to `active` otherwise. A guardian uses
2010
+ * `approve` with `done: true` to approve a `review` thread.
2011
+ */
2012
+ status?: "active" | "opt_out" | "approve";
2013
+ };
2014
+ response: void;
2015
+ };
2016
+ /**
2017
+ * Renames a zone of the run's manual order. The cards in that zone move to the new name with it,
2018
+ * including archived ones.
2019
+ * Requires `sprint:write` and `cardOrder:write`.
2020
+ * @experimental `preview` in the Codecks API: may change in any release.
2021
+ */
2022
+ "sprints/renameZone": {
2023
+ params: {
2024
+ id: SprintId;
2025
+ /** The zone to rename, one of `manualOrderLabels`. `null` is the zone without a name. */
2026
+ label: string | null;
2027
+ /** Trimmed. Fails if the run already has a zone with that name. */
2028
+ newLabel: string;
2029
+ };
2030
+ response: void;
2031
+ };
2032
+ /**
2033
+ * Changes the given fields of a Run Config. A new `autoBeastModeDurationHours` starts Beast Mode
2034
+ * for the current run right away if that time has already passed.
2035
+ * Requires `sprintConfig:write`.
2036
+ */
2037
+ "sprints/updateConfig": {
2038
+ params: {
2039
+ id: SprintConfigId;
2040
+ name?: string;
2041
+ color?: "gray" | "brown" | "yellow" | "red" | "pink" | "blue" | "green";
2042
+ /**
2043
+ * `true` links the Run Config to all projects. `false` needs `projectIds` if the Run Config
2044
+ * is global.
2045
+ */
2046
+ isGlobal?: boolean;
2047
+ /**
2048
+ * Fails with a value above 0 unless the organization's plan includes Beast Mode.
2049
+ * @experimental `preview` in the Codecks API: may change in any release.
2050
+ */
2051
+ autoBeastModeDurationHours?: number | null;
2052
+ /**
2053
+ * Fails with a value above 0 unless the organization's plan includes Beast Mode.
2054
+ * @experimental `preview` in the Codecks API: may change in any release.
2055
+ */
2056
+ beastGracePeriodHours?: number;
2057
+ /**
2058
+ * Replaces the Run Config's projects and makes it non-global. Ignored with `isGlobal: true`.
2059
+ * Cards of projects that are removed are taken out of their run.
2060
+ */
2061
+ projectIds?: ProjectId[] | null;
2062
+ /** @experimental `preview` in the Codecks API: may change in any release. */
2063
+ moveOnFinish?: ("undone" | "review" | "blocked")[];
2064
+ /** @experimental `preview` in the Codecks API: may change in any release. */
2065
+ autoAssignStartedCard?: boolean;
2066
+ /** @experimental `preview` in the Codecks API: may change in any release. */
2067
+ autoAssignNewCard?: boolean;
2068
+ /**
2069
+ * Has to contain `%RUN_NR%` or `%CALENDAR_WEEK%`.
2070
+ * @experimental `preview` in the Codecks API: may change in any release.
2071
+ */
2072
+ runLabelTemplate?: string | null;
2073
+ };
2074
+ response: void;
2075
+ };
2076
+ /**
2077
+ * Changes the given fields of a run, and can start its Beast Mode or complete it.
2078
+ * Requires `sprint:write`.
2079
+ */
2080
+ "sprints/updateSprint": {
2081
+ params: {
2082
+ id: SprintId;
2083
+ /** `null` makes the web app show the label from the Run Config's `runLabelTemplate`. */
2084
+ name?: string | null;
2085
+ description?: string;
2086
+ /** @experimental `preview` in the Codecks API: may change in any release. */
2087
+ handSyncEnabled?: boolean;
2088
+ /**
2089
+ * Labels are trimmed, and duplicates are removed. Renaming a zone here leaves its cards with
2090
+ * the old name; use `sprints/renameZone` instead.
2091
+ * @experimental `preview` in the Codecks API: may change in any release.
2092
+ */
2093
+ manualOrderLabels?: (string | null)[];
2094
+ /**
2095
+ * Replaces all capacities. Fails with a value above 0 unless the organization's plan includes
2096
+ * capacity tracking.
2097
+ * @experimental `preview` in the Codecks API: may change in any release.
2098
+ */
2099
+ userCapacities?: {
2100
+ [key: string]: number;
2101
+ };
2102
+ /**
2103
+ * Also gives this milestone to the run's cards that have none.
2104
+ * @experimental `preview` in the Codecks API: may change in any release.
2105
+ */
2106
+ autoMilestoneId?: MilestoneId | null;
2107
+ /**
2108
+ * `true` starts Beast Mode for the run now and locks in all its cards. Fails if it's already
2109
+ * on, or unless the organization's plan includes Beast Mode.
2110
+ * @experimental `preview` in the Codecks API: may change in any release.
2111
+ */
2112
+ lockIn?: boolean;
2113
+ /**
2114
+ * `true` completes the run now, as if it ended. Cards move to the next run as set in the Run
2115
+ * Config's `moveOnFinish`. Fails if the run is already completed.
2116
+ */
2117
+ complete?: boolean;
2118
+ };
2119
+ response: void;
2120
+ };
2121
+ /**
2122
+ * Watches a card for you, so you're notified about its changes and new comment threads. Does
2123
+ * nothing if you already watch it.
2124
+ * Requires `cardSubscription:writeOwn`.
2125
+ * @experimental `preview` in the Codecks API: may change in any release.
2126
+ */
2127
+ "watchings/addCard": {
2128
+ params: {
2129
+ cardId: CardId;
2130
+ };
2131
+ response: {
2132
+ id: string;
2133
+ };
2134
+ };
2135
+ /**
2136
+ * Makes a user watch a deck. That's the same as watching every card in it, including cards added
2137
+ * later. Does nothing if the user already watches it.
2138
+ * Requires `deckSubscription:writeOwn` or `deckSubscription:writeAny`, depending on the call.
2139
+ * @experimental `preview` in the Codecks API: may change in any release.
2140
+ */
2141
+ "watchings/addDeck": {
2142
+ params: {
2143
+ deckId: DeckId;
2144
+ /** The token's own user. For a personal token, that's you. */
2145
+ userId: UserId;
2146
+ };
2147
+ response: {
2148
+ id: string;
2149
+ };
2150
+ };
2151
+ /**
2152
+ * Stops watching a card. You still get its notifications while you watch its deck.
2153
+ * Requires `cardSubscription:writeOwn`.
2154
+ * @experimental `preview` in the Codecks API: may change in any release.
2155
+ */
2156
+ "watchings/removeCard": {
2157
+ params: {
2158
+ cardId: CardId;
2159
+ };
2160
+ response: void;
2161
+ };
2162
+ /**
2163
+ * Stops a user from watching a deck. Cards the user watches on their own stay watched.
2164
+ * Requires `deckSubscription:writeOwn` or `deckSubscription:writeAny`, depending on the call.
2165
+ * @experimental `preview` in the Codecks API: may change in any release.
2166
+ */
2167
+ "watchings/removeDeck": {
2168
+ params: {
2169
+ deckId: DeckId;
2170
+ userId: UserId;
2171
+ };
2172
+ response: void;
2173
+ };
2174
+ };
2175
+ //#endregion
2176
+ //#region src/loaders/loader-utils.d.ts
2177
+ type ModelMap = typeof modelMap;
2178
+ type ActionName = keyof ActionMap;
2179
+ type ActionParams<N extends ActionName> = ActionMap[N]["params"];
2180
+ type ActionResponse<N extends ActionName> = ActionMap[N]["response"];
2181
+ type DataLoader = {
2182
+ fetchModel: <K extends keyof ModelMap, Id extends string, const Q extends ModelQuery<ModelMap[K], ModelMap>>(model: K, id: Id[], q: Q) => Promise<Record<Id, InferModelQuery<ModelMap[K], Q, ModelMap>>>;
2183
+ dispatch: <N extends ActionName>(name: N, params: ActionParams<N>) => Promise<ActionResponse<N>>;
2184
+ };
2185
+ type FetchFunction = (url: string, init?: RequestInit) => Promise<Response>;
2186
+ type BaseFetchOptions = {
2187
+ fetch?: FetchFunction;
2188
+ baseUrl?: string;
2189
+ headers?: Record<string, string>;
2190
+ /** in milliseconds */
2191
+ timeout?: number;
2192
+ };
2193
+ type FetchOptions = BaseFetchOptions & {
2194
+ /** an organization (`cdxat_…`) or personal (`cdxut_…`) API token */
2195
+ token: string;
2196
+ };
2197
+ /** @deprecated `X-Auth-Token` stops working on 2026-12-31. Use `FetchOptions` with an API token. */
2198
+ type LegacyFetchOptions = BaseFetchOptions & {
2199
+ /** sent as `X-Auth-Token` */
2200
+ accessToken?: string;
2201
+ /** sent as `X-Account` */
2202
+ subdomain?: string;
2203
+ };
2204
+ /** Fetch options with the auth headers already folded into `headers`. */
2205
+
2206
+ /** A non-2xx answer. `code`, `path` and the rest of the body follow the API's error format. */
2207
+ declare class CodecksApiError extends Error {
2208
+ readonly status: number;
2209
+ /** e.g. `invalid_token`, `token_expired`, `missing_scope`, `unknown_field`, `rate_limit` */
2210
+ readonly code: string | null;
2211
+ /** where in the query the error sits, e.g. `_root.account.cards.titel` */
2212
+ readonly path: string | null;
2213
+ /** the parsed JSON body, or the raw text if it wasn't JSON — holds `hint`, `requiredScope`, … */
2214
+ readonly body: unknown;
2215
+ constructor(status: number, body: unknown);
2216
+ }
2217
+ //#endregion
2218
+ export { AccountId, ActionMap, ActionName, ActionParams, ActionResponse, AttachmentId, CardId, CardVisibility, Checkbox, CheckboxStats, CodecksApiError as CodecksApiError$1, DataLoader, DeckId, DefaultCard, DerivedStatus, FetchOptions, FileId, LegacyFetchOptions, MilestoneColor, MilestoneId, Priority, ProjectId, ProjectTagId, QueueEntryId, ReleaseId, ResolvableEntryId, ResolvableEntryReactionId, ResolvableId, SprintConfigId, SprintId, StartWeekday, TimeTrackingMode, TimelineScaleType, UserId, Workdays, WorkflowItemId, WorkflowMode, modelMap as modelMap$1 };