@codecks/fetch 1.0.1 → 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-KmtGUuXm.js → collection-utils-Ia_ahcpI.js} +2 -1
  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
@@ -1,3062 +0,0 @@
1
- //#region src/models/_desc.ts
2
- const makeModel = (opts) => {
3
- return opts;
4
- };
5
- const relation = (relName, options) => {
6
- return {
7
- relName,
8
- options
9
- };
10
- };
11
-
12
- //#endregion
13
- //#region src/models/_root.ts
14
- const _rootDesc = makeModel({
15
- name: "_root",
16
- fields: {},
17
- relations: {
18
- releases: relation("release", { type: "hasMany" }),
19
- accountOnboardingSteps: relation("accountOnboardingStep", { type: "hasMany" }),
20
- apps: relation("app", { type: "hasMany" }),
21
- account: relation("account", { type: "hasOne" }),
22
- loggedInUser: relation("user", { type: "hasOne" }),
23
- cardsStatusHistory: relation("cardsStatusHistory", { type: "hasMany" }),
24
- cardsEffortHistory: relation("cardsEffortHistory", { type: "hasMany" }),
25
- cardsFinishedHistory: relation("cardsFinishedHistory", { type: "hasMany" }),
26
- cardsTimeToFinished: relation("cardsTimeToFinished", { type: "hasMany" })
27
- },
28
- keys: []
29
- });
30
-
31
- //#endregion
32
- //#region src/models/_fields.ts
33
- const id = () => {
34
- return { type: "id" };
35
- };
36
- const withOpts = (type, opts) => opts.optional ? {
37
- type,
38
- optional: true
39
- } : { type };
40
- const string = (opts) => {
41
- return withOpts("string", opts);
42
- };
43
- const int = (opts) => {
44
- return withOpts("int", opts);
45
- };
46
- const bigint = (opts) => {
47
- return withOpts("bigint", opts);
48
- };
49
- const bool = (opts) => {
50
- return withOpts("bool", opts);
51
- };
52
- const date = (opts) => {
53
- return withOpts("date", opts);
54
- };
55
- const day = (opts) => {
56
- return withOpts("day", opts);
57
- };
58
- const object = (opts) => {
59
- return withOpts("obj", opts);
60
- };
61
- const array = (opts) => {
62
- return withOpts("array", opts);
63
- };
64
- const belongsTo = (opts) => {
65
- return { type: () => {
66
- return withOpts("belongsTo", opts);
67
- } };
68
- };
69
-
70
- //#endregion
71
- //#region src/models/AccountOnboardingStep.ts
72
- const accountOnboardingStepDesc = makeModel({
73
- name: "accountOnboardingStep",
74
- fields: {
75
- key: id(),
76
- title: string({}),
77
- description: string({}),
78
- chapter: string({}),
79
- sortValue: string({}),
80
- variants: array({}),
81
- xp: int({}),
82
- milestone: string({})
83
- },
84
- relations: {},
85
- keys: ["key"]
86
- });
87
-
88
- //#endregion
89
- //#region src/models/File.ts
90
- const fileDesc = makeModel({
91
- name: "file",
92
- fields: {
93
- id: id(),
94
- name: string({}),
95
- url: string({}),
96
- size: string({}),
97
- isDeleted: string({}),
98
- meta: object({}),
99
- createdAt: date({}),
100
- deletedAt: date({}),
101
- selfHosted: string({}),
102
- accountId: belongsTo({}).type(),
103
- uploaderId: belongsTo({}).type(),
104
- deletedById: belongsTo({}).type()
105
- },
106
- relations: {
107
- account: relation("account", {
108
- type: "belongsTo",
109
- fk: "accountId"
110
- }),
111
- uploader: relation("user", {
112
- type: "belongsTo",
113
- fk: "uploaderId"
114
- }),
115
- deletedBy: relation("user", {
116
- type: "belongsTo",
117
- fk: "deletedById"
118
- })
119
- },
120
- keys: ["id"]
121
- });
122
-
123
- //#endregion
124
- //#region src/models/Release.ts
125
- const releaseDesc = makeModel({
126
- name: "release",
127
- fields: {
128
- id: id(),
129
- version: string({}),
130
- isLive: string({}),
131
- content: string({}),
132
- title: string({}),
133
- createdAt: date({})
134
- },
135
- relations: {},
136
- keys: ["id"]
137
- });
138
-
139
- //#endregion
140
- //#region src/models/User.ts
141
- const userDesc = makeModel({
142
- name: "user",
143
- fields: {
144
- id: id(),
145
- name: string({}),
146
- fullName: string({ optional: true }),
147
- timezone: string({ optional: true }),
148
- createdAt: date({}),
149
- hasPassword: bool({}),
150
- showCardIdInTimer: bool({}),
151
- disableMovingImages: bool({}),
152
- autoMeFilterCardLimit: int({ optional: true }),
153
- isIntegration: bool({}),
154
- statusColorPalette: string({}),
155
- wantsNewsletter: bool({ optional: true }),
156
- wantsDailyDigestMail: bool({ optional: true }),
157
- wantsConvoDigestMail: bool({ optional: true }),
158
- disableAnimations: bool({}),
159
- enableClickToEditCards: bool({}),
160
- cdxRole: string({}),
161
- profileImageId: belongsTo({ optional: true }).type(),
162
- lastSeenReleaseId: belongsTo({}).type()
163
- },
164
- relations: {
165
- profileImage: relation("file", {
166
- type: "belongsTo",
167
- fk: "profileImageId"
168
- }),
169
- lastSeenRelease: relation("release", {
170
- type: "belongsTo",
171
- fk: "lastSeenReleaseId"
172
- }),
173
- projectOrders: relation("projectOrder", { type: "hasMany" }),
174
- projectSelections: relation("projectSelection", { type: "hasMany" }),
175
- queueSelections: relation("queueSelection", { type: "hasMany" }),
176
- accountRoles: relation("accountRole", { type: "hasMany" }),
177
- cardDiffNotifications: relation("cardDiffNotification", { type: "hasMany" }),
178
- resolvableNotifications: relation("resolvableNotification", { type: "hasMany" }),
179
- publicProjectMembership: relation("publicProjectMembership", { type: "hasMany" }),
180
- lastSeenCardUpvotes: relation("lastSeenCardUpvote", { type: "hasMany" }),
181
- dueCards: relation("dueCard", { type: "hasMany" }),
182
- assigneeDeckAssignments: relation("assigneeDeckAssignment", { type: "hasMany" }),
183
- autoFinishedTimeTrackingSegments: relation("autoFinishedTimeTrackingSegment", { type: "hasMany" }),
184
- savedSearches: relation("savedSearch", { type: "hasMany" }),
185
- activities: relation("activity", { type: "hasMany" }),
186
- emails: relation("userEmail", { type: "hasMany" }),
187
- tags: relation("userTag", { type: "hasMany" }),
188
- unverifiedEmails: relation("userEmail", { type: "hasMany" }),
189
- primaryEmail: relation("userEmail", { type: "hasOne" }),
190
- pinnedMilestoneNext: relation("pinnedMilestone", { type: "hasOne" }),
191
- projectAccess: relation("projectUser", { type: "hasMany" }),
192
- explicitProjectAccess: relation("projectUser", { type: "hasMany" }),
193
- withProjectAccess: relation("userProjectAccess", { type: "hasMany" }),
194
- projectSettings: relation("projectUserSetting", { type: "hasMany" }),
195
- accountSettings: relation("accountUserSetting", { type: "hasMany" }),
196
- dismissedHints: relation("userDismissedHint", { type: "hasMany" }),
197
- slackIntegrations: relation("integration", { type: "hasMany" }),
198
- activeTimeTracker: relation("activeTimeTracker", { type: "hasOne" }),
199
- participations: relation("resolvableParticipant", { type: "hasMany" }),
200
- upvotes: relation("cardUpvote", { type: "hasMany" }),
201
- userOnboarding: relation("userOnboarding", { type: "hasOne" })
202
- },
203
- keys: ["id"]
204
- });
205
-
206
- //#endregion
207
- //#region src/models/Account.ts
208
- const accountDesc = makeModel({
209
- name: "account",
210
- fields: {
211
- id: id(),
212
- subdomain: string({}),
213
- name: string({}),
214
- billingName: string({ optional: true }),
215
- billingLine1: string({ optional: true }),
216
- billingLine2: string({ optional: true }),
217
- billingZip: string({ optional: true }),
218
- billingCity: string({ optional: true }),
219
- billingCountryCode: string({ optional: true }),
220
- billingEmail: string({ optional: true }),
221
- netGiftAmount: int({}),
222
- persona: string({ optional: true }),
223
- createdAt: date({}),
224
- disabledAt: date({ optional: true }),
225
- totalMediaByteUsage: bigint({}),
226
- isDisabled: string({}),
227
- milestonesEnabled: string({}),
228
- sprintsEnabled: string({}),
229
- priorityLabels: object({}),
230
- effortScale: object({}),
231
- statusChangeDurations: object({}),
232
- activeFeatureFlags: object({}),
233
- timeTrackingMode: string({}),
234
- maxTimeTrackingSegmentMsDuration: int({}),
235
- timeTrackingSwimLaneInfo: bool({}),
236
- workdays: string({}),
237
- workflowMode: string({}),
238
- isLearning: bool({}),
239
- isNonProfit: bool({}),
240
- dependenciesEnabled: bool({}),
241
- maxHandSlotCount: int({}),
242
- seats: int({}),
243
- activeProjectCount: int({}),
244
- billingType: string({}),
245
- allowInheritHeroCover: bool({}),
246
- attachmentCoverMode: string({}),
247
- staffPermission: string({}),
248
- offeringTrial: bool({}),
249
- coupon: object({ optional: true }),
250
- hideCompletedCardCountForDecks: bool({}),
251
- visionBoardEnabled: bool({}),
252
- fallbackEffort: int({}),
253
- timelineScaleType: string({}),
254
- startWeekday: string({}),
255
- disabledById: belongsTo({ optional: true }).type()
256
- },
257
- relations: {
258
- disabledBy: relation("user", {
259
- type: "belongsTo",
260
- fk: "disabledById"
261
- }),
262
- cards: relation("card", { type: "hasMany" }),
263
- invoices: relation("invoice", { type: "hasMany" }),
264
- cardPresets: relation("cardPreset", { type: "hasMany" }),
265
- attachments: relation("attachment", { type: "hasMany" }),
266
- discordGuilds: relation("discordGuild", { type: "hasMany" }),
267
- timeTrackingSegments: relation("timeTrackingSegment", { type: "hasMany" }),
268
- workflowItems: relation("workflowItem", { type: "hasMany" }),
269
- deckAssignments: relation("deckAssignment", { type: "hasMany" }),
270
- assigneeAssignments: relation("assigneeAssignment", { type: "hasMany" }),
271
- assigneeDeckAssignments: relation("assigneeDeckAssignment", { type: "hasMany" }),
272
- wizards: relation("wizard", { type: "hasMany" }),
273
- milestones: relation("milestone", { type: "hasMany" }),
274
- sprints: relation("sprint", { type: "hasMany" }),
275
- sprintConfigs: relation("sprintConfig", { type: "hasMany" }),
276
- handCards: relation("handCard", { type: "hasMany" }),
277
- resolvables: relation("resolvable", { type: "hasMany" }),
278
- cardUpvotes: relation("cardUpvote", { type: "hasMany" }),
279
- resolvableParticipants: relation("resolvableParticipant", { type: "hasMany" }),
280
- userReportSettings: relation("userReportSetting", { type: "hasMany" }),
281
- cardOrders: relation("cardOrder", { type: "hasMany" }),
282
- accountUserAchievements: relation("accountUserAchievement", { type: "hasMany" }),
283
- userInviteCodes: relation("userInviteCode", { type: "hasMany" }),
284
- visionBoards: relation("visionBoard", { type: "hasMany" }),
285
- deckSubscriptions: relation("deckSubscription", { type: "hasMany" }),
286
- appInstallations: relation("appInstallation", { type: "hasMany" }),
287
- files: relation("file", { type: "hasMany" }),
288
- decks: relation("deck", { type: "hasMany" }),
289
- queueEntries: relation("queueEntry", { type: "hasMany" }),
290
- visionBoardQueries: relation("visionBoardQuery", { type: "hasMany" }),
291
- anyDecks: relation("deck", { type: "hasMany" }),
292
- projects: relation("project", { type: "hasMany" }),
293
- archivedProjects: relation("project", { type: "hasMany" }),
294
- anyProjects: relation("project", { type: "hasMany" }),
295
- roles: relation("accountRole", { type: "hasMany" }),
296
- invitations: relation("userInvitation", { type: "hasMany" }),
297
- githubIntegration: relation("integration", { type: "hasOne" }),
298
- slackIntegration: relation("integration", { type: "hasOne" }),
299
- affiliateCodes: relation("affiliateCode", { type: "hasMany" }),
300
- activities: relation("activity", { type: "hasMany" }),
301
- stripeAccountSync: relation("stripeAccountSync", { type: "hasOne" }),
302
- accountOnboarding: relation("accountOnboarding", { type: "hasOne" })
303
- },
304
- keys: ["id"]
305
- });
306
-
307
- //#endregion
308
- //#region src/models/AccountOnboarding.ts
309
- const accountOnboardingDesc = makeModel({
310
- name: "accountOnboarding",
311
- fields: {
312
- variants: array({}),
313
- steps: object({}),
314
- accountId: belongsTo({}).type()
315
- },
316
- relations: { account: relation("account", {
317
- type: "belongsTo",
318
- fk: "accountId"
319
- }) },
320
- keys: ["accountId"]
321
- });
322
-
323
- //#endregion
324
- //#region src/models/AccountRole.ts
325
- const accountRoleDesc = makeModel({
326
- name: "accountRole",
327
- fields: {
328
- role: string({}),
329
- createdAt: date({}),
330
- lastChangedAt: date({}),
331
- roleAsPrio: int({}),
332
- userId: belongsTo({}).type(),
333
- accountId: belongsTo({}).type()
334
- },
335
- relations: {
336
- user: relation("user", {
337
- type: "belongsTo",
338
- fk: "userId"
339
- }),
340
- account: relation("account", {
341
- type: "belongsTo",
342
- fk: "accountId"
343
- })
344
- },
345
- keys: ["accountId", "userId"]
346
- });
347
-
348
- //#endregion
349
- //#region src/models/AccountUserAchievement.ts
350
- const accountUserAchievementDesc = makeModel({
351
- name: "accountUserAchievement",
352
- fields: {
353
- value: object({}),
354
- context: object({}),
355
- accountId: belongsTo({}).type(),
356
- userId: belongsTo({}).type()
357
- },
358
- relations: {
359
- account: relation("account", {
360
- type: "belongsTo",
361
- fk: "accountId"
362
- }),
363
- user: relation("user", {
364
- type: "belongsTo",
365
- fk: "userId"
366
- })
367
- },
368
- keys: [
369
- "accountId",
370
- "userId",
371
- "key"
372
- ]
373
- });
374
-
375
- //#endregion
376
- //#region src/models/Project.ts
377
- const projectDesc = makeModel({
378
- name: "project",
379
- fields: {
380
- id: id(),
381
- name: string({}),
382
- visibility: string({}),
383
- defaultUserAccess: string({}),
384
- createdAt: date({}),
385
- accountSeq: int({}),
386
- allowUpvotes: string({}),
387
- isPublic: string({}),
388
- commentsArePublic: string({}),
389
- publicRegistryAgreement: string({ optional: true }),
390
- publicLayoutVersion: string({}),
391
- publicIsExplicit: string({}),
392
- markerColor: string({ optional: true }),
393
- effortIcon: string({ optional: true }),
394
- spaces: string({}),
395
- publicPath: string({ optional: true }),
396
- publicMessage: string({ optional: true }),
397
- publicHeading: string({ optional: true }),
398
- publicBackgroundColor: string({ optional: true }),
399
- accountId: belongsTo({}).type(),
400
- coverFileId: belongsTo({ optional: true }).type(),
401
- publicBannerFileId: belongsTo({ optional: true }).type(),
402
- publicTileFileId: belongsTo({ optional: true }).type(),
403
- publicBackgroundImageId: belongsTo({ optional: true }).type()
404
- },
405
- relations: {
406
- account: relation("account", {
407
- type: "belongsTo",
408
- fk: "accountId"
409
- }),
410
- coverFile: relation("file", {
411
- type: "belongsTo",
412
- fk: "coverFileId"
413
- }),
414
- publicBannerFile: relation("file", {
415
- type: "belongsTo",
416
- fk: "publicBannerFileId"
417
- }),
418
- publicTileFile: relation("file", {
419
- type: "belongsTo",
420
- fk: "publicTileFileId"
421
- }),
422
- publicBackgroundImage: relation("file", {
423
- type: "belongsTo",
424
- fk: "publicBackgroundImageId"
425
- }),
426
- decks: relation("deck", { type: "hasMany" }),
427
- milestoneProjects: relation("milestoneProject", { type: "hasMany" }),
428
- sprintProjects: relation("sprintProject", { type: "hasMany" }),
429
- publicProjectVisits: relation("publicProjectVisit", { type: "hasMany" }),
430
- dailyPublicProjectMembership: relation("dailyPublicProjectMembership", { type: "hasMany" }),
431
- publicProjectMemberships: relation("publicProjectMembership", { type: "hasMany" }),
432
- cardUpvotes: relation("cardUpvote", { type: "hasMany" }),
433
- tags: relation("projectTag", { type: "hasMany" }),
434
- activities: relation("activity", { type: "hasMany" }),
435
- explicitProjectUsers: relation("projectUser", { type: "hasMany" }),
436
- access: relation("userProjectAccess", { type: "hasMany" }),
437
- publicProjectInfo: relation("publicProjectInfo", { type: "hasOne" })
438
- },
439
- keys: ["id"]
440
- });
441
-
442
- //#endregion
443
- //#region src/models/Milestone.ts
444
- const milestoneDesc = makeModel({
445
- name: "milestone",
446
- fields: {
447
- id: id(),
448
- name: string({}),
449
- color: string({}),
450
- date: day({}),
451
- startDate: day({ optional: true }),
452
- createdAt: date({}),
453
- accountSeq: int({}),
454
- description: string({ optional: true }),
455
- isGlobal: string({}),
456
- handSyncEnabled: string({}),
457
- manualOrderLabels: string({}),
458
- stats: object({}),
459
- userCapacities: object({}),
460
- isDeleted: bool({}),
461
- preferredOrder: string({ optional: true }),
462
- accountId: belongsTo({}).type(),
463
- creatorId: belongsTo({}).type(),
464
- coverFileId: belongsTo({ optional: true }).type()
465
- },
466
- relations: {
467
- account: relation("account", {
468
- type: "belongsTo",
469
- fk: "accountId"
470
- }),
471
- creator: relation("user", {
472
- type: "belongsTo",
473
- fk: "creatorId"
474
- }),
475
- coverFile: relation("file", {
476
- type: "belongsTo",
477
- fk: "coverFileId"
478
- }),
479
- milestoneProjects: relation("milestoneProject", { type: "hasMany" }),
480
- cards: relation("card", { type: "hasMany" }),
481
- activities: relation("activity", { type: "hasMany" }),
482
- progress: relation("milestoneProgress", { type: "hasMany" })
483
- },
484
- keys: ["id"]
485
- });
486
-
487
- //#endregion
488
- //#region src/models/ProjectTag.ts
489
- const projectTagDesc = makeModel({
490
- name: "projectTag",
491
- fields: {
492
- id: id(),
493
- tag: string({}),
494
- color: string({ optional: true }),
495
- emoji: string({ optional: true }),
496
- description: string({ optional: true }),
497
- createdAt: date({}),
498
- projectId: belongsTo({}).type()
499
- },
500
- relations: { project: relation("project", {
501
- type: "belongsTo",
502
- fk: "projectId"
503
- }) },
504
- keys: ["id"]
505
- });
506
-
507
- //#endregion
508
- //#region src/models/Deck.ts
509
- const deckDesc = makeModel({
510
- name: "deck",
511
- fields: {
512
- id: id(),
513
- content: string({}),
514
- description: string({}),
515
- title: string({}),
516
- sortValue: string({}),
517
- preferredOrder: string({ optional: true }),
518
- coverColor: string({ optional: true }),
519
- isDeleted: string({}),
520
- accountSeq: int({}),
521
- spaceId: int({ optional: true }),
522
- defaultCard: object({}),
523
- isOnboardingDeck: bool({}),
524
- handSyncEnabled: string({}),
525
- stickyDefaultProjectTag: string({}),
526
- manualOrderLabels: string({}),
527
- workflowItemOrderLabels: string({}),
528
- createdAt: date({}),
529
- stats: object({}),
530
- hasGuardians: string({}),
531
- allowedCardTypes: string({}),
532
- projectId: belongsTo({}).type(),
533
- accountId: belongsTo({}).type(),
534
- milestoneId: belongsTo({ optional: true }).type(),
535
- creatorId: belongsTo({}).type(),
536
- coverFileId: belongsTo({ optional: true }).type(),
537
- descriptionCoverFileId: belongsTo({ optional: true }).type(),
538
- defaultProjectTagId: belongsTo({ optional: true }).type()
539
- },
540
- relations: {
541
- project: relation("project", {
542
- type: "belongsTo",
543
- fk: "projectId"
544
- }),
545
- account: relation("account", {
546
- type: "belongsTo",
547
- fk: "accountId"
548
- }),
549
- milestone: relation("milestone", {
550
- type: "belongsTo",
551
- fk: "milestoneId"
552
- }),
553
- creator: relation("user", {
554
- type: "belongsTo",
555
- fk: "creatorId"
556
- }),
557
- coverFile: relation("file", {
558
- type: "belongsTo",
559
- fk: "coverFileId"
560
- }),
561
- descriptionCoverFile: relation("file", {
562
- type: "belongsTo",
563
- fk: "descriptionCoverFileId"
564
- }),
565
- defaultProjectTag: relation("projectTag", {
566
- type: "belongsTo",
567
- fk: "defaultProjectTagId"
568
- }),
569
- cards: relation("card", { type: "hasMany" }),
570
- workflowItems: relation("workflowItem", { type: "hasMany" }),
571
- cardOrderInDecks: relation("cardOrderInDeck", { type: "hasMany" }),
572
- activities: relation("activity", { type: "hasMany" }),
573
- guardians: relation("deckGuardian", { type: "hasMany" })
574
- },
575
- keys: ["id"]
576
- });
577
-
578
- //#endregion
579
- //#region src/models/AccountUserSetting.ts
580
- const accountUserSettingDesc = makeModel({
581
- name: "accountUserSetting",
582
- fields: {
583
- wantsWeeklyDigestMail: bool({}),
584
- timelineScaleTypeOverwrite: string({}),
585
- startWeekdayOverwrite: string({}),
586
- accountId: belongsTo({}).type(),
587
- userId: belongsTo({}).type(),
588
- inboxDeckId: belongsTo({}).type()
589
- },
590
- relations: {
591
- account: relation("account", {
592
- type: "belongsTo",
593
- fk: "accountId"
594
- }),
595
- user: relation("user", {
596
- type: "belongsTo",
597
- fk: "userId"
598
- }),
599
- inboxDeck: relation("deck", {
600
- type: "belongsTo",
601
- fk: "inboxDeckId"
602
- })
603
- },
604
- keys: ["accountId", "userId"]
605
- });
606
-
607
- //#endregion
608
- //#region src/models/SprintConfig.ts
609
- const sprintConfigDesc = makeModel({
610
- name: "sprintConfig",
611
- fields: {
612
- id: id(),
613
- name: string({}),
614
- color: string({}),
615
- stopOn: day({ optional: true }),
616
- isGlobal: string({}),
617
- upcomingSprints: int({}),
618
- sprintDurationWeeks: int({}),
619
- sprintStartWeekday: int({}),
620
- endHour: int({}),
621
- endHourTimezone: string({}),
622
- createdAt: date({}),
623
- preferredOrder: string({ optional: true }),
624
- moveOnFinish: string({}),
625
- autoBeastModeDurationHours: int({ optional: true }),
626
- autoAssignStartedCard: bool({}),
627
- autoAssignNewCard: bool({}),
628
- beastGracePeriodHours: int({}),
629
- accountId: belongsTo({}).type(),
630
- creatorId: belongsTo({}).type()
631
- },
632
- relations: {
633
- account: relation("account", {
634
- type: "belongsTo",
635
- fk: "accountId"
636
- }),
637
- creator: relation("user", {
638
- type: "belongsTo",
639
- fk: "creatorId"
640
- }),
641
- sprintProjects: relation("sprintProject", { type: "hasMany" }),
642
- sprints: relation("sprint", { type: "hasMany" }),
643
- progress: relation("sprintConfigProgress", { type: "hasMany" })
644
- },
645
- keys: ["id"]
646
- });
647
-
648
- //#endregion
649
- //#region src/models/Sprint.ts
650
- const sprintDesc = makeModel({
651
- name: "sprint",
652
- fields: {
653
- id: id(),
654
- description: string({}),
655
- name: string({ optional: true }),
656
- accountSeq: int({}),
657
- index: int({}),
658
- startDate: day({}),
659
- endDate: day({}),
660
- stats: object({}),
661
- manualOrderLabels: string({}),
662
- userCapacities: object({}),
663
- handSyncEnabled: string({}),
664
- createdAt: date({}),
665
- isDeleted: bool({}),
666
- completedAt: date({ optional: true }),
667
- lockedAt: date({ optional: true }),
668
- accountId: belongsTo({}).type(),
669
- sprintConfigId: belongsTo({}).type(),
670
- creatorId: belongsTo({}).type(),
671
- coverFileId: belongsTo({ optional: true }).type(),
672
- autoMilestoneId: belongsTo({ optional: true }).type()
673
- },
674
- relations: {
675
- account: relation("account", {
676
- type: "belongsTo",
677
- fk: "accountId"
678
- }),
679
- sprintConfig: relation("sprintConfig", {
680
- type: "belongsTo",
681
- fk: "sprintConfigId"
682
- }),
683
- creator: relation("user", {
684
- type: "belongsTo",
685
- fk: "creatorId"
686
- }),
687
- coverFile: relation("file", {
688
- type: "belongsTo",
689
- fk: "coverFileId"
690
- }),
691
- autoMilestone: relation("milestone", {
692
- type: "belongsTo",
693
- fk: "autoMilestoneId"
694
- }),
695
- cards: relation("card", { type: "hasMany" }),
696
- progress: relation("sprintProgress", { type: "hasMany" }),
697
- activities: relation("activity", { type: "hasMany" })
698
- },
699
- keys: ["id"]
700
- });
701
-
702
- //#endregion
703
- //#region src/models/WorkflowItem.ts
704
- const workflowItemDesc = makeModel({
705
- name: "workflowItem",
706
- fields: {
707
- itemId: id(),
708
- version: string({}),
709
- sortOrder: string({}),
710
- sortValue: string({}),
711
- priority: string({ optional: true }),
712
- content: string({}),
713
- createdAt: date({}),
714
- lastUpdatedAt: date({}),
715
- tags: array({}),
716
- masterTags: array({}),
717
- mentionedUsers: array({}),
718
- title: string({}),
719
- effort: int({ optional: true }),
720
- label: string({ optional: true }),
721
- checkboxStats: object({}),
722
- accountSeq: int({}),
723
- checkboxInfo: array({}),
724
- visibility: string({}),
725
- accountId: belongsTo({}).type(),
726
- deckId: belongsTo({}).type(),
727
- targetDeckId: belongsTo({ optional: true }).type(),
728
- assigneeId: belongsTo({ optional: true }).type(),
729
- creatorId: belongsTo({}).type()
730
- },
731
- relations: {
732
- account: relation("account", {
733
- type: "belongsTo",
734
- fk: "accountId"
735
- }),
736
- deck: relation("deck", {
737
- type: "belongsTo",
738
- fk: "deckId"
739
- }),
740
- targetDeck: relation("deck", {
741
- type: "belongsTo",
742
- fk: "targetDeckId"
743
- }),
744
- assignee: relation("user", {
745
- type: "belongsTo",
746
- fk: "assigneeId"
747
- }),
748
- creator: relation("user", {
749
- type: "belongsTo",
750
- fk: "creatorId"
751
- }),
752
- diffs: relation("workflowItemHistory", { type: "hasMany" }),
753
- inDeps: relation("workflowItem", {
754
- type: "hasMany",
755
- fkAsArray: true
756
- }),
757
- outDeps: relation("workflowItem", {
758
- type: "hasMany",
759
- fkAsArray: true
760
- })
761
- },
762
- keys: ["itemId"]
763
- });
764
-
765
- //#endregion
766
- //#region src/models/DiscordGuild.ts
767
- const discordGuildDesc = makeModel({
768
- name: "discordGuild",
769
- fields: {
770
- id: id(),
771
- discordGuildId: string({}),
772
- guildName: string({}),
773
- guildIconId: string({}),
774
- scope: string({}),
775
- karmaRoleThresholds: object({}),
776
- removeCommandEnabled: string({}),
777
- removeCommandEmoji: string({}),
778
- removeCommandRoleId: string({}),
779
- createdAt: date({}),
780
- accountId: belongsTo({}).type()
781
- },
782
- relations: {
783
- account: relation("account", {
784
- type: "belongsTo",
785
- fk: "accountId"
786
- }),
787
- slashCommands: relation("discordSlashCommand", { type: "hasMany" }),
788
- projectNotifications: relation("discordProjectNotification", { type: "hasMany" }),
789
- dailyDiscordGuildVoteMemberships: relation("dailyDiscordGuildVoteMembership", { type: "hasMany" }),
790
- members: relation("discordMember", { type: "hasMany" })
791
- },
792
- keys: ["id"]
793
- });
794
-
795
- //#endregion
796
- //#region src/models/VisionBoard.ts
797
- const visionBoardDesc = makeModel({
798
- name: "visionBoard",
799
- fields: {
800
- id: id(),
801
- accountSeq: int({}),
802
- createdAt: date({}),
803
- isDeleted: bool({}),
804
- cardId: belongsTo({}).type(),
805
- accountId: belongsTo({}).type(),
806
- creatorId: belongsTo({}).type()
807
- },
808
- relations: {
809
- card: relation("card", {
810
- type: "belongsTo",
811
- fk: "cardId"
812
- }),
813
- account: relation("account", {
814
- type: "belongsTo",
815
- fk: "accountId"
816
- }),
817
- creator: relation("user", {
818
- type: "belongsTo",
819
- fk: "creatorId"
820
- })
821
- },
822
- keys: ["id"]
823
- });
824
-
825
- //#endregion
826
- //#region src/models/Card.ts
827
- const cardDesc = makeModel({
828
- name: "card",
829
- fields: {
830
- cardId: id(),
831
- version: int({}),
832
- accountSeq: int({}),
833
- content: string({}),
834
- status: string({}),
835
- derivedStatus: string({}),
836
- createdAt: date({}),
837
- lastUpdatedAt: date({}),
838
- tags: array({}),
839
- masterTags: array({}),
840
- mentionedUsers: array({}),
841
- title: string({}),
842
- priority: string({ optional: true }),
843
- effort: int({ optional: true }),
844
- checkboxStats: object({}),
845
- checkboxInfo: array({}),
846
- visibility: string({}),
847
- legacyProjectSeq: int({ optional: true }),
848
- meta: object({}),
849
- embeds: object({}),
850
- isPublic: bool({}),
851
- hasBlockingDeps: bool({}),
852
- dueDate: day({ optional: true }),
853
- isDoc: bool({ optional: true }),
854
- childCardInfo: string({}),
855
- accountId: belongsTo({}).type(),
856
- deckId: belongsTo({ optional: true }).type(),
857
- assigneeId: belongsTo({ optional: true }).type(),
858
- creatorId: belongsTo({ optional: true }).type(),
859
- milestoneId: belongsTo({ optional: true }).type(),
860
- sprintId: belongsTo({ optional: true }).type(),
861
- legacyProjectId: belongsTo({ optional: true }).type(),
862
- coverFileId: belongsTo({ optional: true }).type(),
863
- parentCardId: belongsTo({ optional: true }).type(),
864
- sourceWorkflowItemId: belongsTo({ optional: true }).type(),
865
- discordGuildId: belongsTo({}).type(),
866
- visionBoardId: belongsTo({ optional: true }).type()
867
- },
868
- relations: {
869
- account: relation("account", {
870
- type: "belongsTo",
871
- fk: "accountId"
872
- }),
873
- deck: relation("deck", {
874
- type: "belongsTo",
875
- fk: "deckId"
876
- }),
877
- assignee: relation("user", {
878
- type: "belongsTo",
879
- fk: "assigneeId"
880
- }),
881
- creator: relation("user", {
882
- type: "belongsTo",
883
- fk: "creatorId"
884
- }),
885
- milestone: relation("milestone", {
886
- type: "belongsTo",
887
- fk: "milestoneId"
888
- }),
889
- sprint: relation("sprint", {
890
- type: "belongsTo",
891
- fk: "sprintId"
892
- }),
893
- legacyProject: relation("project", {
894
- type: "belongsTo",
895
- fk: "legacyProjectId"
896
- }),
897
- coverFile: relation("file", {
898
- type: "belongsTo",
899
- fk: "coverFileId"
900
- }),
901
- parentCard: relation("card", {
902
- type: "belongsTo",
903
- fk: "parentCardId"
904
- }),
905
- sourceWorkflowItem: relation("workflowItem", {
906
- type: "belongsTo",
907
- fk: "sourceWorkflowItemId"
908
- }),
909
- discordGuild: relation("discordGuild", {
910
- type: "belongsTo",
911
- fk: "discordGuildId"
912
- }),
913
- visionBoard: relation("visionBoard", {
914
- type: "belongsTo",
915
- fk: "visionBoardId"
916
- }),
917
- resolvables: relation("resolvable", { type: "hasMany" }),
918
- handCards: relation("handCard", { type: "hasMany" }),
919
- timeTrackingSegments: relation("timeTrackingSegment", { type: "hasMany" }),
920
- cardSubscriptions: relation("cardSubscription", { type: "hasMany" }),
921
- cardOrders: relation("cardOrder", { type: "hasMany" }),
922
- resolvableEntries: relation("resolvableEntry", { type: "hasMany" }),
923
- queueEntries: relation("queueEntry", { type: "hasMany" }),
924
- attachments: relation("attachment", {
925
- type: "hasMany",
926
- fkAsArray: true
927
- }),
928
- diffs: relation("cardHistory", { type: "hasMany" }),
929
- totalTimeTrackingSums: relation("timeTrackingSum", { type: "hasOne" }),
930
- userTimeTrackingSums: relation("timeTrackingSum", { type: "hasMany" }),
931
- childCards: relation("card", {
932
- type: "hasMany",
933
- fkAsArray: true
934
- }),
935
- inDeps: relation("card", {
936
- type: "hasMany",
937
- fkAsArray: true
938
- }),
939
- outDeps: relation("card", {
940
- type: "hasMany",
941
- fkAsArray: true
942
- }),
943
- cardReferences: relation("card", {
944
- type: "hasMany",
945
- fkAsArray: true
946
- }),
947
- upvotes: relation("cardUpvote", { type: "hasMany" })
948
- },
949
- keys: ["cardId"]
950
- });
951
-
952
- //#endregion
953
- //#region src/models/ActiveTimeTracker.ts
954
- const activeTimeTrackerDesc = makeModel({
955
- name: "activeTimeTracker",
956
- fields: {
957
- id: id(),
958
- createdAt: date({}),
959
- cardId: belongsTo({}).type(),
960
- userId: belongsTo({}).type(),
961
- accountId: belongsTo({}).type()
962
- },
963
- relations: {
964
- card: relation("card", {
965
- type: "belongsTo",
966
- fk: "cardId"
967
- }),
968
- user: relation("user", {
969
- type: "belongsTo",
970
- fk: "userId"
971
- }),
972
- account: relation("account", {
973
- type: "belongsTo",
974
- fk: "accountId"
975
- })
976
- },
977
- keys: ["id"]
978
- });
979
-
980
- //#endregion
981
- //#region src/models/Activity.ts
982
- const activityDesc = makeModel({
983
- name: "activity",
984
- fields: {
985
- id: id(),
986
- type: string({}),
987
- data: object({}),
988
- isRemovedFromDeckEntry: bool({}),
989
- isRemovedFromMilestoneEntry: bool({}),
990
- isRemovedFromSprintEntry: bool({}),
991
- createdAt: date({}),
992
- cardId: belongsTo({}).type(),
993
- deckId: belongsTo({}).type(),
994
- projectId: belongsTo({}).type(),
995
- milestoneId: belongsTo({}).type(),
996
- sprintId: belongsTo({}).type(),
997
- changerId: belongsTo({}).type()
998
- },
999
- relations: {
1000
- card: relation("card", {
1001
- type: "belongsTo",
1002
- fk: "cardId"
1003
- }),
1004
- deck: relation("deck", {
1005
- type: "belongsTo",
1006
- fk: "deckId"
1007
- }),
1008
- project: relation("project", {
1009
- type: "belongsTo",
1010
- fk: "projectId"
1011
- }),
1012
- milestone: relation("milestone", {
1013
- type: "belongsTo",
1014
- fk: "milestoneId"
1015
- }),
1016
- sprint: relation("sprint", {
1017
- type: "belongsTo",
1018
- fk: "sprintId"
1019
- }),
1020
- changer: relation("user", {
1021
- type: "belongsTo",
1022
- fk: "changerId"
1023
- })
1024
- },
1025
- keys: ["id"]
1026
- });
1027
-
1028
- //#endregion
1029
- //#region src/models/AffiliateCode.ts
1030
- const affiliateCodeDesc = makeModel({
1031
- name: "affiliateCode",
1032
- fields: {
1033
- id: id(),
1034
- code: string({}),
1035
- vanityUrl: string({}),
1036
- message: string({}),
1037
- label: string({}),
1038
- isDisabled: string({}),
1039
- isDeleted: string({}),
1040
- validUntil: string({}),
1041
- remainingRedemptions: string({}),
1042
- reward: object({}),
1043
- createdAt: date({}),
1044
- accountId: belongsTo({}).type(),
1045
- creatorId: belongsTo({}).type()
1046
- },
1047
- relations: {
1048
- account: relation("account", {
1049
- type: "belongsTo",
1050
- fk: "accountId"
1051
- }),
1052
- creator: relation("user", {
1053
- type: "belongsTo",
1054
- fk: "creatorId"
1055
- }),
1056
- stats: relation("affiliateCodeStat", { type: "hasMany" })
1057
- },
1058
- keys: ["id"]
1059
- });
1060
-
1061
- //#endregion
1062
- //#region src/models/AffiliateCodeStat.ts
1063
- const affiliateCodeStatDesc = makeModel({
1064
- name: "affiliateCodeStat",
1065
- fields: {
1066
- month: int({}),
1067
- year: int({}),
1068
- visits: int({}),
1069
- newVisitors: int({}),
1070
- signups: int({}),
1071
- revenue: int({}),
1072
- affiliateCodeId: belongsTo({}).type()
1073
- },
1074
- relations: { affiliateCode: relation("affiliateCode", {
1075
- type: "belongsTo",
1076
- fk: "affiliateCodeId"
1077
- }) },
1078
- keys: ["affiliateCodeId", "month"]
1079
- });
1080
-
1081
- //#endregion
1082
- //#region src/models/App.ts
1083
- const appDesc = makeModel({
1084
- name: "app",
1085
- fields: {
1086
- id: id(),
1087
- name: string({}),
1088
- createdAt: date({}),
1089
- payload: object({})
1090
- },
1091
- relations: {},
1092
- keys: ["id"]
1093
- });
1094
-
1095
- //#endregion
1096
- //#region src/models/AppInstallation.ts
1097
- const appInstallationDesc = makeModel({
1098
- name: "appInstallation",
1099
- fields: {
1100
- id: id(),
1101
- createdAt: date({}),
1102
- accountId: belongsTo({}).type(),
1103
- appId: belongsTo({}).type(),
1104
- installerId: belongsTo({}).type()
1105
- },
1106
- relations: {
1107
- account: relation("account", {
1108
- type: "belongsTo",
1109
- fk: "accountId"
1110
- }),
1111
- app: relation("app", {
1112
- type: "belongsTo",
1113
- fk: "appId"
1114
- }),
1115
- installer: relation("user", {
1116
- type: "belongsTo",
1117
- fk: "installerId"
1118
- })
1119
- },
1120
- keys: ["id"]
1121
- });
1122
-
1123
- //#endregion
1124
- //#region src/models/AssigneeAssignment.ts
1125
- const assigneeAssignmentDesc = makeModel({
1126
- name: "assigneeAssignment",
1127
- fields: {
1128
- lastAssignedAt: date({}),
1129
- accountId: belongsTo({}).type(),
1130
- assigneeId: belongsTo({}).type(),
1131
- assignedById: belongsTo({}).type()
1132
- },
1133
- relations: {
1134
- account: relation("account", {
1135
- type: "belongsTo",
1136
- fk: "accountId"
1137
- }),
1138
- assignee: relation("user", {
1139
- type: "belongsTo",
1140
- fk: "assigneeId"
1141
- }),
1142
- assignedBy: relation("user", {
1143
- type: "belongsTo",
1144
- fk: "assignedById"
1145
- })
1146
- },
1147
- keys: ["assigneeId", "assignedById"]
1148
- });
1149
-
1150
- //#endregion
1151
- //#region src/models/AssigneeDeckAssignment.ts
1152
- const assigneeDeckAssignmentDesc = makeModel({
1153
- name: "assigneeDeckAssignment",
1154
- fields: {
1155
- lastAssignedAt: date({}),
1156
- accountId: belongsTo({}).type(),
1157
- deckId: belongsTo({}).type(),
1158
- assigneeId: belongsTo({}).type(),
1159
- assignedById: belongsTo({}).type()
1160
- },
1161
- relations: {
1162
- account: relation("account", {
1163
- type: "belongsTo",
1164
- fk: "accountId"
1165
- }),
1166
- deck: relation("deck", {
1167
- type: "belongsTo",
1168
- fk: "deckId"
1169
- }),
1170
- assignee: relation("user", {
1171
- type: "belongsTo",
1172
- fk: "assigneeId"
1173
- }),
1174
- assignedBy: relation("user", {
1175
- type: "belongsTo",
1176
- fk: "assignedById"
1177
- })
1178
- },
1179
- keys: [
1180
- "assigneeId",
1181
- "assignedById",
1182
- "deckId"
1183
- ]
1184
- });
1185
-
1186
- //#endregion
1187
- //#region src/models/Attachment.ts
1188
- const attachmentDesc = makeModel({
1189
- name: "attachment",
1190
- fields: {
1191
- id: id(),
1192
- content: string({}),
1193
- title: string({}),
1194
- createdAt: date({}),
1195
- fileId: belongsTo({}).type(),
1196
- cardId: belongsTo({}).type(),
1197
- accountId: belongsTo({}).type(),
1198
- creatorId: belongsTo({}).type()
1199
- },
1200
- relations: {
1201
- file: relation("file", {
1202
- type: "belongsTo",
1203
- fk: "fileId"
1204
- }),
1205
- card: relation("card", {
1206
- type: "belongsTo",
1207
- fk: "cardId"
1208
- }),
1209
- account: relation("account", {
1210
- type: "belongsTo",
1211
- fk: "accountId"
1212
- }),
1213
- creator: relation("user", {
1214
- type: "belongsTo",
1215
- fk: "creatorId"
1216
- })
1217
- },
1218
- keys: ["id"]
1219
- });
1220
-
1221
- //#endregion
1222
- //#region src/models/TimeTrackingSegment.ts
1223
- const timeTrackingSegmentDesc = makeModel({
1224
- name: "timeTrackingSegment",
1225
- fields: {
1226
- id: id(),
1227
- createdAt: date({}),
1228
- finishedAt: date({ optional: true }),
1229
- startedAt: date({}),
1230
- modifyDurationMsBy: int({}),
1231
- addedManually: string({}),
1232
- autoFinishedState: string({}),
1233
- cardId: belongsTo({}).type(),
1234
- userId: belongsTo({}).type(),
1235
- accountId: belongsTo({}).type()
1236
- },
1237
- relations: {
1238
- card: relation("card", {
1239
- type: "belongsTo",
1240
- fk: "cardId"
1241
- }),
1242
- user: relation("user", {
1243
- type: "belongsTo",
1244
- fk: "userId"
1245
- }),
1246
- account: relation("account", {
1247
- type: "belongsTo",
1248
- fk: "accountId"
1249
- })
1250
- },
1251
- keys: ["id"]
1252
- });
1253
-
1254
- //#endregion
1255
- //#region src/models/AutoFinishedTimeTrackingSegment.ts
1256
- const autoFinishedTimeTrackingSegmentDesc = makeModel({
1257
- name: "autoFinishedTimeTrackingSegment",
1258
- fields: {
1259
- createdAt: date({}),
1260
- userId: belongsTo({}).type(),
1261
- accountId: belongsTo({}).type(),
1262
- cardId: belongsTo({}).type(),
1263
- timeTrackingSegmentId: belongsTo({}).type()
1264
- },
1265
- relations: {
1266
- user: relation("user", {
1267
- type: "belongsTo",
1268
- fk: "userId"
1269
- }),
1270
- account: relation("account", {
1271
- type: "belongsTo",
1272
- fk: "accountId"
1273
- }),
1274
- card: relation("card", {
1275
- type: "belongsTo",
1276
- fk: "cardId"
1277
- }),
1278
- timeTrackingSegment: relation("timeTrackingSegment", {
1279
- type: "belongsTo",
1280
- fk: "timeTrackingSegmentId"
1281
- })
1282
- },
1283
- keys: ["userId", "accountId"]
1284
- });
1285
-
1286
- //#endregion
1287
- //#region src/models/CardDiffNotification.ts
1288
- const cardDiffNotificationDesc = makeModel({
1289
- name: "cardDiffNotification",
1290
- fields: {
1291
- changes: object({}),
1292
- asOwner: bool({}),
1293
- changers: array({}),
1294
- lastUpdatedAt: date({}),
1295
- createdAt: date({}),
1296
- userId: belongsTo({}).type(),
1297
- cardId: belongsTo({}).type(),
1298
- accountId: belongsTo({}).type()
1299
- },
1300
- relations: {
1301
- user: relation("user", {
1302
- type: "belongsTo",
1303
- fk: "userId"
1304
- }),
1305
- card: relation("card", {
1306
- type: "belongsTo",
1307
- fk: "cardId"
1308
- }),
1309
- account: relation("account", {
1310
- type: "belongsTo",
1311
- fk: "accountId"
1312
- })
1313
- },
1314
- keys: ["userId", "cardId"]
1315
- });
1316
-
1317
- //#endregion
1318
- //#region src/models/CardHistory.ts
1319
- const cardHistoryDesc = makeModel({
1320
- name: "cardHistory",
1321
- fields: {
1322
- diff: object({}),
1323
- versionCreatedAt: date({}),
1324
- version: int({}),
1325
- accountId: belongsTo({}).type(),
1326
- cardId: belongsTo({}).type(),
1327
- changerId: belongsTo({}).type()
1328
- },
1329
- relations: {
1330
- account: relation("account", {
1331
- type: "belongsTo",
1332
- fk: "accountId"
1333
- }),
1334
- card: relation("card", {
1335
- type: "belongsTo",
1336
- fk: "cardId"
1337
- }),
1338
- changer: relation("user", {
1339
- type: "belongsTo",
1340
- fk: "changerId"
1341
- })
1342
- },
1343
- keys: ["cardId", "version"]
1344
- });
1345
-
1346
- //#endregion
1347
- //#region src/models/CardOrderInDeck.ts
1348
- const cardOrderInDeckDesc = makeModel({
1349
- name: "cardOrderInDeck",
1350
- fields: {
1351
- sortIndex: string({}),
1352
- cardId: belongsTo({}).type(),
1353
- deckId: belongsTo({}).type(),
1354
- changerId: belongsTo({}).type()
1355
- },
1356
- relations: {
1357
- card: relation("card", {
1358
- type: "belongsTo",
1359
- fk: "cardId"
1360
- }),
1361
- deck: relation("deck", {
1362
- type: "belongsTo",
1363
- fk: "deckId"
1364
- }),
1365
- changer: relation("user", {
1366
- type: "belongsTo",
1367
- fk: "changerId"
1368
- })
1369
- },
1370
- keys: ["cardId", "deckId"]
1371
- });
1372
-
1373
- //#endregion
1374
- //#region src/models/CardOrder.ts
1375
- const cardOrderDesc = makeModel({
1376
- name: "cardOrder",
1377
- fields: {
1378
- sortValue: string({}),
1379
- label: string({}),
1380
- cardId: belongsTo({}).type(),
1381
- accountId: belongsTo({}).type()
1382
- },
1383
- relations: {
1384
- card: relation("card", {
1385
- type: "belongsTo",
1386
- fk: "cardId"
1387
- }),
1388
- account: relation("account", {
1389
- type: "belongsTo",
1390
- fk: "accountId"
1391
- })
1392
- },
1393
- keys: ["context", "cardId"]
1394
- });
1395
-
1396
- //#endregion
1397
- //#region src/models/CardPreset.ts
1398
- const cardPresetDesc = makeModel({
1399
- name: "cardPreset",
1400
- fields: {
1401
- id: id(),
1402
- name: string({}),
1403
- data: object({}),
1404
- createdAt: date({}),
1405
- accountId: belongsTo({}).type(),
1406
- creatorId: belongsTo({}).type()
1407
- },
1408
- relations: {
1409
- account: relation("account", {
1410
- type: "belongsTo",
1411
- fk: "accountId"
1412
- }),
1413
- creator: relation("user", {
1414
- type: "belongsTo",
1415
- fk: "creatorId"
1416
- })
1417
- },
1418
- keys: ["id"]
1419
- });
1420
-
1421
- //#endregion
1422
- //#region src/models/CardSubscription.ts
1423
- const cardSubscriptionDesc = makeModel({
1424
- name: "cardSubscription",
1425
- fields: {
1426
- id: id(),
1427
- createdAt: date({}),
1428
- userId: belongsTo({}).type(),
1429
- cardId: belongsTo({}).type(),
1430
- accountId: belongsTo({}).type()
1431
- },
1432
- relations: {
1433
- user: relation("user", {
1434
- type: "belongsTo",
1435
- fk: "userId"
1436
- }),
1437
- card: relation("card", {
1438
- type: "belongsTo",
1439
- fk: "cardId"
1440
- }),
1441
- account: relation("account", {
1442
- type: "belongsTo",
1443
- fk: "accountId"
1444
- })
1445
- },
1446
- keys: ["id"]
1447
- });
1448
-
1449
- //#endregion
1450
- //#region src/models/CardUpvote.ts
1451
- const cardUpvoteDesc = makeModel({
1452
- name: "cardUpvote",
1453
- fields: {
1454
- id: id(),
1455
- type: string({}),
1456
- createdAt: date({}),
1457
- discordUserInfo: object({}),
1458
- userId: belongsTo({}).type(),
1459
- accountId: belongsTo({}).type(),
1460
- cardId: belongsTo({}).type()
1461
- },
1462
- relations: {
1463
- user: relation("user", {
1464
- type: "belongsTo",
1465
- fk: "userId"
1466
- }),
1467
- account: relation("account", {
1468
- type: "belongsTo",
1469
- fk: "accountId"
1470
- }),
1471
- card: relation("card", {
1472
- type: "belongsTo",
1473
- fk: "cardId"
1474
- })
1475
- },
1476
- keys: ["id"]
1477
- });
1478
-
1479
- //#endregion
1480
- //#region src/models/CardsEffortHistory.ts
1481
- const cardsEffortHistoryDesc = makeModel({
1482
- name: "cardsEffortHistory",
1483
- fields: {
1484
- effortSum: bigint({}),
1485
- cardCount: bigint({}),
1486
- date: day({})
1487
- },
1488
- relations: {},
1489
- keys: [
1490
- "date",
1491
- "effortSum",
1492
- "cardCount"
1493
- ]
1494
- });
1495
-
1496
- //#endregion
1497
- //#region src/models/CardsFinishedHistory.ts
1498
- const cardsFinishedHistoryDesc = makeModel({
1499
- name: "cardsFinishedHistory",
1500
- fields: {
1501
- effortSum: bigint({}),
1502
- cardCount: bigint({}),
1503
- date: day({}),
1504
- assigneeId: belongsTo({}).type()
1505
- },
1506
- relations: { assignee: relation("user", {
1507
- type: "belongsTo",
1508
- fk: "assigneeId"
1509
- }) },
1510
- keys: [
1511
- "date",
1512
- "effortSum",
1513
- "cardCount",
1514
- "assigneeId"
1515
- ]
1516
- });
1517
-
1518
- //#endregion
1519
- //#region src/models/CardsStatusHistory.ts
1520
- const cardsStatusHistoryDesc = makeModel({
1521
- name: "cardsStatusHistory",
1522
- fields: {
1523
- status: string({}),
1524
- count: int({}),
1525
- date: day({})
1526
- },
1527
- relations: {},
1528
- keys: [
1529
- "date",
1530
- "status",
1531
- "count"
1532
- ]
1533
- });
1534
-
1535
- //#endregion
1536
- //#region src/models/CardsTimeToFinished.ts
1537
- const cardsTimeToFinishedDesc = makeModel({
1538
- name: "cardsTimeToFinished",
1539
- fields: {
1540
- effort: int({}),
1541
- startedAt: date({}),
1542
- doneAt: date({}),
1543
- cardId: belongsTo({}).type(),
1544
- assigneeId: belongsTo({}).type()
1545
- },
1546
- relations: {
1547
- card: relation("card", {
1548
- type: "belongsTo",
1549
- fk: "cardId"
1550
- }),
1551
- assignee: relation("user", {
1552
- type: "belongsTo",
1553
- fk: "assigneeId"
1554
- })
1555
- },
1556
- keys: [
1557
- "cardId",
1558
- "startedAt",
1559
- "doneAt",
1560
- "effort",
1561
- "assigneeId"
1562
- ]
1563
- });
1564
-
1565
- //#endregion
1566
- //#region src/models/DailyDiscordGuildVoteMembership.ts
1567
- const dailyDiscordGuildVoteMembershipDesc = makeModel({
1568
- name: "dailyDiscordGuildVoteMembership",
1569
- fields: {
1570
- t: date({}),
1571
- membershipCount: int({}),
1572
- discordGuildId: belongsTo({}).type()
1573
- },
1574
- relations: { discordGuild: relation("discordGuild", {
1575
- type: "belongsTo",
1576
- fk: "discordGuildId"
1577
- }) },
1578
- keys: ["t", "guildId"]
1579
- });
1580
-
1581
- //#endregion
1582
- //#region src/models/DailyPublicProjectMembership.ts
1583
- const dailyPublicProjectMembershipDesc = makeModel({
1584
- name: "dailyPublicProjectMembership",
1585
- fields: {
1586
- t: date({}),
1587
- membershipCount: int({}),
1588
- projectId: belongsTo({}).type()
1589
- },
1590
- relations: { project: relation("project", {
1591
- type: "belongsTo",
1592
- fk: "projectId"
1593
- }) },
1594
- keys: ["t", "projectId"]
1595
- });
1596
-
1597
- //#endregion
1598
- //#region src/models/PublicProjectVisit.ts
1599
- const publicProjectVisitDesc = makeModel({
1600
- name: "publicProjectVisit",
1601
- fields: {
1602
- t: date({}),
1603
- topReferrers: object({}),
1604
- visitCounts: int({}),
1605
- projectId: belongsTo({}).type()
1606
- },
1607
- relations: { project: relation("project", {
1608
- type: "belongsTo",
1609
- fk: "projectId"
1610
- }) },
1611
- keys: ["t", "projectId"]
1612
- });
1613
-
1614
- //#endregion
1615
- //#region src/models/DeckAssignment.ts
1616
- const deckAssignmentDesc = makeModel({
1617
- name: "deckAssignment",
1618
- fields: {
1619
- lastAssignedAt: date({}),
1620
- deckId: belongsTo({}).type(),
1621
- userId: belongsTo({}).type(),
1622
- accountId: belongsTo({}).type()
1623
- },
1624
- relations: {
1625
- deck: relation("deck", {
1626
- type: "belongsTo",
1627
- fk: "deckId"
1628
- }),
1629
- user: relation("user", {
1630
- type: "belongsTo",
1631
- fk: "userId"
1632
- }),
1633
- account: relation("account", {
1634
- type: "belongsTo",
1635
- fk: "accountId"
1636
- })
1637
- },
1638
- keys: ["userId", "deckId"]
1639
- });
1640
-
1641
- //#endregion
1642
- //#region src/models/DeckGuardian.ts
1643
- const deckGuardianDesc = makeModel({
1644
- name: "deckGuardian",
1645
- fields: {
1646
- userId: belongsTo({}).type(),
1647
- accountId: belongsTo({}).type(),
1648
- deckId: belongsTo({}).type()
1649
- },
1650
- relations: {
1651
- user: relation("user", {
1652
- type: "belongsTo",
1653
- fk: "userId"
1654
- }),
1655
- account: relation("account", {
1656
- type: "belongsTo",
1657
- fk: "accountId"
1658
- }),
1659
- deck: relation("deck", {
1660
- type: "belongsTo",
1661
- fk: "deckId"
1662
- })
1663
- },
1664
- keys: ["deckId", "userId"]
1665
- });
1666
-
1667
- //#endregion
1668
- //#region src/models/DeckSubscription.ts
1669
- const deckSubscriptionDesc = makeModel({
1670
- name: "deckSubscription",
1671
- fields: {
1672
- id: id(),
1673
- userId: belongsTo({}).type(),
1674
- deckId: belongsTo({}).type(),
1675
- accountId: belongsTo({}).type()
1676
- },
1677
- relations: {
1678
- user: relation("user", {
1679
- type: "belongsTo",
1680
- fk: "userId"
1681
- }),
1682
- deck: relation("deck", {
1683
- type: "belongsTo",
1684
- fk: "deckId"
1685
- }),
1686
- account: relation("account", {
1687
- type: "belongsTo",
1688
- fk: "accountId"
1689
- })
1690
- },
1691
- keys: ["id"]
1692
- });
1693
-
1694
- //#endregion
1695
- //#region src/models/DiscordMember.ts
1696
- const discordMemberDesc = makeModel({
1697
- name: "discordMember",
1698
- fields: {
1699
- id: id(),
1700
- discordUserId: string({}),
1701
- name: string({}),
1702
- nick: string({}),
1703
- avatar: string({}),
1704
- discriminator: string({}),
1705
- createdAt: date({}),
1706
- deckyScore: int({}),
1707
- discordGuildId: belongsTo({}).type()
1708
- },
1709
- relations: { discordGuild: relation("discordGuild", {
1710
- type: "belongsTo",
1711
- fk: "discordGuildId"
1712
- }) },
1713
- keys: ["id"]
1714
- });
1715
-
1716
- //#endregion
1717
- //#region src/models/DiscordProjectNotification.ts
1718
- const discordProjectNotificationDesc = makeModel({
1719
- name: "discordProjectNotification",
1720
- fields: {
1721
- id: id(),
1722
- discordChannelId: string({}),
1723
- disabledTypes: object({}),
1724
- createdAt: date({}),
1725
- projectId: belongsTo({}).type(),
1726
- discordGuildId: belongsTo({}).type()
1727
- },
1728
- relations: {
1729
- project: relation("project", {
1730
- type: "belongsTo",
1731
- fk: "projectId"
1732
- }),
1733
- discordGuild: relation("discordGuild", {
1734
- type: "belongsTo",
1735
- fk: "discordGuildId"
1736
- })
1737
- },
1738
- keys: ["id"]
1739
- });
1740
-
1741
- //#endregion
1742
- //#region src/models/DiscordSlashCommand.ts
1743
- const discordSlashCommandDesc = makeModel({
1744
- name: "discordSlashCommand",
1745
- fields: {
1746
- id: id(),
1747
- channelId: string({}),
1748
- statusTargetChannelId: string({}),
1749
- reaction: string({}),
1750
- name: string({}),
1751
- description: string({}),
1752
- autoAddRoleToThread: string({}),
1753
- leaderboard: object({}),
1754
- reactionThreshold: int({}),
1755
- karmaForCompletion: int({}),
1756
- maxFileSizeInBytes: int({}),
1757
- statusMessages: object({}),
1758
- permissions: object({}),
1759
- deckId: belongsTo({}).type(),
1760
- discordGuildId: belongsTo({}).type()
1761
- },
1762
- relations: {
1763
- deck: relation("deck", {
1764
- type: "belongsTo",
1765
- fk: "deckId"
1766
- }),
1767
- discordGuild: relation("discordGuild", {
1768
- type: "belongsTo",
1769
- fk: "discordGuildId"
1770
- })
1771
- },
1772
- keys: ["id"]
1773
- });
1774
-
1775
- //#endregion
1776
- //#region src/models/DueCard.ts
1777
- const dueCardDesc = makeModel({
1778
- name: "dueCard",
1779
- fields: {
1780
- createdAt: date({}),
1781
- userId: belongsTo({}).type(),
1782
- accountId: belongsTo({}).type(),
1783
- cardId: belongsTo({}).type()
1784
- },
1785
- relations: {
1786
- user: relation("user", {
1787
- type: "belongsTo",
1788
- fk: "userId"
1789
- }),
1790
- account: relation("account", {
1791
- type: "belongsTo",
1792
- fk: "accountId"
1793
- }),
1794
- card: relation("card", {
1795
- type: "belongsTo",
1796
- fk: "cardId"
1797
- })
1798
- },
1799
- keys: ["userId", "cardId"]
1800
- });
1801
-
1802
- //#endregion
1803
- //#region src/models/HandCard.ts
1804
- const handCardDesc = makeModel({
1805
- name: "handCard",
1806
- fields: {
1807
- sortIndex: int({}),
1808
- userId: belongsTo({}).type(),
1809
- accountId: belongsTo({}).type(),
1810
- cardId: belongsTo({}).type()
1811
- },
1812
- relations: {
1813
- user: relation("user", {
1814
- type: "belongsTo",
1815
- fk: "userId"
1816
- }),
1817
- account: relation("account", {
1818
- type: "belongsTo",
1819
- fk: "accountId"
1820
- }),
1821
- card: relation("card", {
1822
- type: "belongsTo",
1823
- fk: "cardId"
1824
- })
1825
- },
1826
- keys: [
1827
- "cardId",
1828
- "userId",
1829
- "accountId"
1830
- ]
1831
- });
1832
-
1833
- //#endregion
1834
- //#region src/models/Integration.ts
1835
- const integrationDesc = makeModel({
1836
- name: "integration",
1837
- fields: {
1838
- id: id(),
1839
- type: string({}),
1840
- disabled: string({}),
1841
- userData: object({}),
1842
- createdAt: date({}),
1843
- version: int({}),
1844
- accountId: belongsTo({}).type(),
1845
- userId: belongsTo({}).type(),
1846
- creatorId: belongsTo({}).type()
1847
- },
1848
- relations: {
1849
- account: relation("account", {
1850
- type: "belongsTo",
1851
- fk: "accountId"
1852
- }),
1853
- user: relation("user", {
1854
- type: "belongsTo",
1855
- fk: "userId"
1856
- }),
1857
- creator: relation("user", {
1858
- type: "belongsTo",
1859
- fk: "creatorId"
1860
- })
1861
- },
1862
- keys: ["id"]
1863
- });
1864
-
1865
- //#endregion
1866
- //#region src/models/Invoice.ts
1867
- const invoiceDesc = makeModel({
1868
- name: "invoice",
1869
- fields: {
1870
- id: id(),
1871
- invoiceNumber: string({}),
1872
- url: string({}),
1873
- createdAt: date({}),
1874
- total: int({}),
1875
- subtotal: int({}),
1876
- charged: int({}),
1877
- chargeData: object({}),
1878
- accountId: belongsTo({}).type()
1879
- },
1880
- relations: { account: relation("account", {
1881
- type: "belongsTo",
1882
- fk: "accountId"
1883
- }) },
1884
- keys: ["id"]
1885
- });
1886
-
1887
- //#endregion
1888
- //#region src/models/LastSeenCardUpvote.ts
1889
- const lastSeenCardUpvoteDesc = makeModel({
1890
- name: "lastSeenCardUpvote",
1891
- fields: {
1892
- lastSeenAt: date({}),
1893
- createdAt: date({}),
1894
- userId: belongsTo({}).type(),
1895
- accountId: belongsTo({}).type()
1896
- },
1897
- relations: {
1898
- user: relation("user", {
1899
- type: "belongsTo",
1900
- fk: "userId"
1901
- }),
1902
- account: relation("account", {
1903
- type: "belongsTo",
1904
- fk: "accountId"
1905
- })
1906
- },
1907
- keys: ["userId", "accountId"]
1908
- });
1909
-
1910
- //#endregion
1911
- //#region src/models/MilestoneProgress.ts
1912
- const milestoneProgressDesc = makeModel({
1913
- name: "milestoneProgress",
1914
- fields: {
1915
- progress: object({}),
1916
- milestoneId: belongsTo({}).type()
1917
- },
1918
- relations: { milestone: relation("milestone", {
1919
- type: "belongsTo",
1920
- fk: "milestoneId"
1921
- }) },
1922
- keys: ["milestoneId", "date"]
1923
- });
1924
-
1925
- //#endregion
1926
- //#region src/models/MilestoneProject.ts
1927
- const milestoneProjectDesc = makeModel({
1928
- name: "milestoneProject",
1929
- fields: {
1930
- milestoneId: belongsTo({}).type(),
1931
- projectId: belongsTo({}).type(),
1932
- accountId: belongsTo({}).type()
1933
- },
1934
- relations: {
1935
- milestone: relation("milestone", {
1936
- type: "belongsTo",
1937
- fk: "milestoneId"
1938
- }),
1939
- project: relation("project", {
1940
- type: "belongsTo",
1941
- fk: "projectId"
1942
- }),
1943
- account: relation("account", {
1944
- type: "belongsTo",
1945
- fk: "accountId"
1946
- })
1947
- },
1948
- keys: ["milestoneId", "projectId"]
1949
- });
1950
-
1951
- //#endregion
1952
- //#region src/models/PinnedMilestone.ts
1953
- const pinnedMilestoneDesc = makeModel({
1954
- name: "pinnedMilestone",
1955
- fields: {
1956
- id: id(),
1957
- autoAssignStartedCard: bool({}),
1958
- autoAssignNewCard: bool({}),
1959
- userId: belongsTo({}).type(),
1960
- accountId: belongsTo({}).type(),
1961
- sprintId: belongsTo({}).type(),
1962
- milestoneId: belongsTo({}).type()
1963
- },
1964
- relations: {
1965
- user: relation("user", {
1966
- type: "belongsTo",
1967
- fk: "userId"
1968
- }),
1969
- account: relation("account", {
1970
- type: "belongsTo",
1971
- fk: "accountId"
1972
- }),
1973
- sprint: relation("sprint", {
1974
- type: "belongsTo",
1975
- fk: "sprintId"
1976
- }),
1977
- milestone: relation("milestone", {
1978
- type: "belongsTo",
1979
- fk: "milestoneId"
1980
- })
1981
- },
1982
- keys: ["id"]
1983
- });
1984
-
1985
- //#endregion
1986
- //#region src/models/ProjectOrder.ts
1987
- const projectOrderDesc = makeModel({
1988
- name: "projectOrder",
1989
- fields: {
1990
- sortIndex: int({}),
1991
- userId: belongsTo({}).type(),
1992
- accountId: belongsTo({}).type(),
1993
- projectId: belongsTo({}).type()
1994
- },
1995
- relations: {
1996
- user: relation("user", {
1997
- type: "belongsTo",
1998
- fk: "userId"
1999
- }),
2000
- account: relation("account", {
2001
- type: "belongsTo",
2002
- fk: "accountId"
2003
- }),
2004
- project: relation("project", {
2005
- type: "belongsTo",
2006
- fk: "projectId"
2007
- })
2008
- },
2009
- keys: [
2010
- "projectId",
2011
- "userId",
2012
- "accountId"
2013
- ]
2014
- });
2015
-
2016
- //#endregion
2017
- //#region src/models/ProjectSelection.ts
2018
- const projectSelectionDesc = makeModel({
2019
- name: "projectSelection",
2020
- fields: {
2021
- id: id(),
2022
- userId: belongsTo({}).type(),
2023
- accountId: belongsTo({}).type(),
2024
- projectId: belongsTo({}).type()
2025
- },
2026
- relations: {
2027
- user: relation("user", {
2028
- type: "belongsTo",
2029
- fk: "userId"
2030
- }),
2031
- account: relation("account", {
2032
- type: "belongsTo",
2033
- fk: "accountId"
2034
- }),
2035
- project: relation("project", {
2036
- type: "belongsTo",
2037
- fk: "projectId"
2038
- })
2039
- },
2040
- keys: ["id"]
2041
- });
2042
-
2043
- //#endregion
2044
- //#region src/models/ProjectUserSetting.ts
2045
- const projectUserSettingDesc = makeModel({
2046
- name: "projectUserSetting",
2047
- fields: {
2048
- projectId: belongsTo({}).type(),
2049
- userId: belongsTo({}).type()
2050
- },
2051
- relations: {
2052
- project: relation("project", {
2053
- type: "belongsTo",
2054
- fk: "projectId"
2055
- }),
2056
- user: relation("user", {
2057
- type: "belongsTo",
2058
- fk: "userId"
2059
- })
2060
- },
2061
- keys: ["projectId", "userId"]
2062
- });
2063
-
2064
- //#endregion
2065
- //#region src/models/ProjectUser.ts
2066
- const projectUserDesc = makeModel({
2067
- name: "projectUser",
2068
- fields: {
2069
- projectRole: string({}),
2070
- userId: belongsTo({}).type(),
2071
- projectId: belongsTo({}).type(),
2072
- accountId: belongsTo({}).type()
2073
- },
2074
- relations: {
2075
- user: relation("user", {
2076
- type: "belongsTo",
2077
- fk: "userId"
2078
- }),
2079
- project: relation("project", {
2080
- type: "belongsTo",
2081
- fk: "projectId"
2082
- }),
2083
- account: relation("account", {
2084
- type: "belongsTo",
2085
- fk: "accountId"
2086
- })
2087
- },
2088
- keys: ["projectId", "userId"]
2089
- });
2090
-
2091
- //#endregion
2092
- //#region src/models/PublicProjectInfo.ts
2093
- const publicProjectInfoDesc = makeModel({
2094
- name: "publicProjectInfo",
2095
- fields: {
2096
- lastActivityAt: string({}),
2097
- activities7d: string({}),
2098
- cardCount: string({}),
2099
- visits7d: string({}),
2100
- cardDoneStreak: string({}),
2101
- projectId: belongsTo({}).type(),
2102
- accountId: belongsTo({}).type()
2103
- },
2104
- relations: {
2105
- project: relation("project", {
2106
- type: "belongsTo",
2107
- fk: "projectId"
2108
- }),
2109
- account: relation("account", {
2110
- type: "belongsTo",
2111
- fk: "accountId"
2112
- })
2113
- },
2114
- keys: ["projectId"]
2115
- });
2116
-
2117
- //#endregion
2118
- //#region src/models/PublicProjectMembership.ts
2119
- const publicProjectMembershipDesc = makeModel({
2120
- name: "publicProjectMembership",
2121
- fields: {
2122
- digestFrequencyInDays: int({}),
2123
- createdAt: date({}),
2124
- userId: belongsTo({}).type(),
2125
- projectId: belongsTo({}).type()
2126
- },
2127
- relations: {
2128
- user: relation("user", {
2129
- type: "belongsTo",
2130
- fk: "userId"
2131
- }),
2132
- project: relation("project", {
2133
- type: "belongsTo",
2134
- fk: "projectId"
2135
- })
2136
- },
2137
- keys: ["userId", "projectId"]
2138
- });
2139
-
2140
- //#endregion
2141
- //#region src/models/QueueEntry.ts
2142
- const queueEntryDesc = makeModel({
2143
- name: "queueEntry",
2144
- fields: {
2145
- id: id(),
2146
- sortIndex: int({}),
2147
- cardDoneAt: date({}),
2148
- createdAt: date({}),
2149
- accountId: belongsTo({}).type(),
2150
- userId: belongsTo({}).type(),
2151
- cardId: belongsTo({}).type()
2152
- },
2153
- relations: {
2154
- account: relation("account", {
2155
- type: "belongsTo",
2156
- fk: "accountId"
2157
- }),
2158
- user: relation("user", {
2159
- type: "belongsTo",
2160
- fk: "userId"
2161
- }),
2162
- card: relation("card", {
2163
- type: "belongsTo",
2164
- fk: "cardId"
2165
- })
2166
- },
2167
- keys: ["id"]
2168
- });
2169
-
2170
- //#endregion
2171
- //#region src/models/QueueSelection.ts
2172
- const queueSelectionDesc = makeModel({
2173
- name: "queueSelection",
2174
- fields: {
2175
- id: id(),
2176
- sortIndex: int({}),
2177
- userId: belongsTo({}).type(),
2178
- accountId: belongsTo({}).type(),
2179
- queueUserId: belongsTo({}).type()
2180
- },
2181
- relations: {
2182
- user: relation("user", {
2183
- type: "belongsTo",
2184
- fk: "userId"
2185
- }),
2186
- account: relation("account", {
2187
- type: "belongsTo",
2188
- fk: "accountId"
2189
- }),
2190
- queueUser: relation("user", {
2191
- type: "belongsTo",
2192
- fk: "queueUserId"
2193
- })
2194
- },
2195
- keys: ["id"]
2196
- });
2197
-
2198
- //#endregion
2199
- //#region src/models/Resolvable.ts
2200
- const resolvableDesc = makeModel({
2201
- name: "resolvable",
2202
- fields: {
2203
- id: id(),
2204
- context: string({}),
2205
- contextAsPrio: int({}),
2206
- isClosed: bool({}),
2207
- closedAt: date({ optional: true }),
2208
- createdAt: date({}),
2209
- isPublic: bool({}),
2210
- cardId: belongsTo({}).type(),
2211
- accountId: belongsTo({}).type(),
2212
- creatorId: belongsTo({}).type(),
2213
- closedById: belongsTo({ optional: true }).type()
2214
- },
2215
- relations: {
2216
- card: relation("card", {
2217
- type: "belongsTo",
2218
- fk: "cardId"
2219
- }),
2220
- account: relation("account", {
2221
- type: "belongsTo",
2222
- fk: "accountId"
2223
- }),
2224
- creator: relation("user", {
2225
- type: "belongsTo",
2226
- fk: "creatorId"
2227
- }),
2228
- closedBy: relation("user", {
2229
- type: "belongsTo",
2230
- fk: "closedById"
2231
- }),
2232
- participants: relation("resolvableParticipant", { type: "hasMany" }),
2233
- participantHistories: relation("resolvableParticipantHistory", { type: "hasMany" }),
2234
- entries: relation("resolvableEntry", { type: "hasMany" })
2235
- },
2236
- keys: ["id"]
2237
- });
2238
-
2239
- //#endregion
2240
- //#region src/models/ResolvableEntry.ts
2241
- const resolvableEntryDesc = makeModel({
2242
- name: "resolvableEntry",
2243
- fields: {
2244
- entryId: id(),
2245
- content: string({}),
2246
- lastChangedAt: date({}),
2247
- createdAt: date({}),
2248
- version: int({}),
2249
- meta: object({}),
2250
- resolvableId: belongsTo({}).type(),
2251
- cardId: belongsTo({}).type(),
2252
- authorId: belongsTo({}).type()
2253
- },
2254
- relations: {
2255
- resolvable: relation("resolvable", {
2256
- type: "belongsTo",
2257
- fk: "resolvableId"
2258
- }),
2259
- card: relation("card", {
2260
- type: "belongsTo",
2261
- fk: "cardId"
2262
- }),
2263
- author: relation("user", {
2264
- type: "belongsTo",
2265
- fk: "authorId"
2266
- }),
2267
- reactions: relation("resolvableEntryReaction", { type: "hasMany" }),
2268
- histories: relation("resolvableEntryHistory", { type: "hasMany" })
2269
- },
2270
- keys: ["entryId"]
2271
- });
2272
-
2273
- //#endregion
2274
- //#region src/models/ResolvableEntryHistory.ts
2275
- const resolvableEntryHistoryDesc = makeModel({
2276
- name: "resolvableEntryHistory",
2277
- fields: {
2278
- content: string({}),
2279
- lastChangedAt: date({}),
2280
- version: int({}),
2281
- resolvableId: belongsTo({}).type(),
2282
- authorId: belongsTo({}).type(),
2283
- entryId: belongsTo({}).type()
2284
- },
2285
- relations: {
2286
- resolvable: relation("resolvable", {
2287
- type: "belongsTo",
2288
- fk: "resolvableId"
2289
- }),
2290
- author: relation("user", {
2291
- type: "belongsTo",
2292
- fk: "authorId"
2293
- }),
2294
- entry: relation("resolvableEntry", {
2295
- type: "belongsTo",
2296
- fk: "entryId"
2297
- })
2298
- },
2299
- keys: ["entryId", "version"]
2300
- });
2301
-
2302
- //#endregion
2303
- //#region src/models/ResolvableEntryReaction.ts
2304
- const resolvableEntryReactionDesc = makeModel({
2305
- name: "resolvableEntryReaction",
2306
- fields: {
2307
- id: id(),
2308
- value: object({}),
2309
- createdAt: date({}),
2310
- isPublic: bool({}),
2311
- resolvableEntryId: belongsTo({}).type(),
2312
- accountId: belongsTo({}).type(),
2313
- userId: belongsTo({}).type(),
2314
- resolvableId: belongsTo({}).type()
2315
- },
2316
- relations: {
2317
- resolvableEntry: relation("resolvableEntry", {
2318
- type: "belongsTo",
2319
- fk: "resolvableEntryId"
2320
- }),
2321
- account: relation("account", {
2322
- type: "belongsTo",
2323
- fk: "accountId"
2324
- }),
2325
- user: relation("user", {
2326
- type: "belongsTo",
2327
- fk: "userId"
2328
- }),
2329
- resolvable: relation("resolvable", {
2330
- type: "belongsTo",
2331
- fk: "resolvableId"
2332
- })
2333
- },
2334
- keys: ["id"]
2335
- });
2336
-
2337
- //#endregion
2338
- //#region src/models/ResolvableNotification.ts
2339
- const resolvableNotificationDesc = makeModel({
2340
- name: "resolvableNotification",
2341
- fields: {
2342
- isParticipating: bool({}),
2343
- isSnoozing: bool({}),
2344
- unseenEntryCount: int({}),
2345
- unseenAuthors: array({}),
2346
- isLastParticipant: bool({}),
2347
- lastUpdatedAt: date({}),
2348
- snoozeUntil: date({ optional: true }),
2349
- remindMeOn: date({ optional: true }),
2350
- createdAt: date({}),
2351
- userId: belongsTo({}).type(),
2352
- resolvableId: belongsTo({}).type(),
2353
- accountId: belongsTo({}).type(),
2354
- latestEntryId: belongsTo({}).type(),
2355
- latestSeenEntryId: belongsTo({}).type()
2356
- },
2357
- relations: {
2358
- user: relation("user", {
2359
- type: "belongsTo",
2360
- fk: "userId"
2361
- }),
2362
- resolvable: relation("resolvable", {
2363
- type: "belongsTo",
2364
- fk: "resolvableId"
2365
- }),
2366
- account: relation("account", {
2367
- type: "belongsTo",
2368
- fk: "accountId"
2369
- }),
2370
- latestEntry: relation("resolvableEntry", {
2371
- type: "belongsTo",
2372
- fk: "latestEntryId"
2373
- }),
2374
- latestSeenEntry: relation("resolvableEntry", {
2375
- type: "belongsTo",
2376
- fk: "latestSeenEntryId"
2377
- })
2378
- },
2379
- keys: ["userId", "resolvableId"]
2380
- });
2381
-
2382
- //#endregion
2383
- //#region src/models/ResolvableParticipantHistory.ts
2384
- const resolvableParticipantHistoryDesc = makeModel({
2385
- name: "resolvableParticipantHistory",
2386
- fields: {
2387
- firstJoinedAt: string({}),
2388
- done: string({}),
2389
- status: string({}),
2390
- lastChangedAt: date({}),
2391
- version: int({}),
2392
- reaction: string({}),
2393
- resolvableId: belongsTo({}).type(),
2394
- userId: belongsTo({}).type(),
2395
- addedById: belongsTo({}).type()
2396
- },
2397
- relations: {
2398
- resolvable: relation("resolvable", {
2399
- type: "belongsTo",
2400
- fk: "resolvableId"
2401
- }),
2402
- user: relation("user", {
2403
- type: "belongsTo",
2404
- fk: "userId"
2405
- }),
2406
- addedBy: relation("user", {
2407
- type: "belongsTo",
2408
- fk: "addedById"
2409
- })
2410
- },
2411
- keys: [
2412
- "participantId",
2413
- "resolvableId",
2414
- "version"
2415
- ]
2416
- });
2417
-
2418
- //#endregion
2419
- //#region src/models/ResolvableParticipant.ts
2420
- const resolvableParticipantDesc = makeModel({
2421
- name: "resolvableParticipant",
2422
- fields: {
2423
- firstJoinedAt: date({}),
2424
- lastChangedAt: date({}),
2425
- done: bool({}),
2426
- status: string({}),
2427
- discordUserId: string({}),
2428
- resolvableIsClosed: bool({}),
2429
- resolvableId: belongsTo({}).type(),
2430
- accountId: belongsTo({}).type(),
2431
- userId: belongsTo({}).type(),
2432
- addedById: belongsTo({}).type()
2433
- },
2434
- relations: {
2435
- resolvable: relation("resolvable", {
2436
- type: "belongsTo",
2437
- fk: "resolvableId"
2438
- }),
2439
- account: relation("account", {
2440
- type: "belongsTo",
2441
- fk: "accountId"
2442
- }),
2443
- user: relation("user", {
2444
- type: "belongsTo",
2445
- fk: "userId"
2446
- }),
2447
- addedBy: relation("user", {
2448
- type: "belongsTo",
2449
- fk: "addedById"
2450
- })
2451
- },
2452
- keys: ["participantId", "resolvableId"]
2453
- });
2454
-
2455
- //#endregion
2456
- //#region src/models/SavedSearch.ts
2457
- const savedSearchDesc = makeModel({
2458
- name: "savedSearch",
2459
- fields: {
2460
- id: id(),
2461
- tokens: array({}),
2462
- forceOr: bool({}),
2463
- accountId: belongsTo({}).type(),
2464
- ownerId: belongsTo({}).type()
2465
- },
2466
- relations: {
2467
- account: relation("account", {
2468
- type: "belongsTo",
2469
- fk: "accountId"
2470
- }),
2471
- owner: relation("user", {
2472
- type: "belongsTo",
2473
- fk: "ownerId"
2474
- })
2475
- },
2476
- keys: ["id"]
2477
- });
2478
-
2479
- //#endregion
2480
- //#region src/models/SprintConfigProgress.ts
2481
- const sprintConfigProgressDesc = makeModel({
2482
- name: "sprintConfigProgress",
2483
- fields: {
2484
- progress: object({}),
2485
- sprintConfigId: belongsTo({}).type()
2486
- },
2487
- relations: { sprintConfig: relation("sprintConfig", {
2488
- type: "belongsTo",
2489
- fk: "sprintConfigId"
2490
- }) },
2491
- keys: ["sprintConfigId", "date"]
2492
- });
2493
-
2494
- //#endregion
2495
- //#region src/models/SprintProgress.ts
2496
- const sprintProgressDesc = makeModel({
2497
- name: "sprintProgress",
2498
- fields: {
2499
- progress: object({}),
2500
- sprintId: belongsTo({}).type()
2501
- },
2502
- relations: { sprint: relation("sprint", {
2503
- type: "belongsTo",
2504
- fk: "sprintId"
2505
- }) },
2506
- keys: ["sprintId", "date"]
2507
- });
2508
-
2509
- //#endregion
2510
- //#region src/models/SprintProject.ts
2511
- const sprintProjectDesc = makeModel({
2512
- name: "sprintProject",
2513
- fields: {
2514
- sprintConfigId: belongsTo({}).type(),
2515
- projectId: belongsTo({}).type(),
2516
- accountId: belongsTo({}).type()
2517
- },
2518
- relations: {
2519
- sprintConfig: relation("sprintConfig", {
2520
- type: "belongsTo",
2521
- fk: "sprintConfigId"
2522
- }),
2523
- project: relation("project", {
2524
- type: "belongsTo",
2525
- fk: "projectId"
2526
- }),
2527
- account: relation("account", {
2528
- type: "belongsTo",
2529
- fk: "accountId"
2530
- })
2531
- },
2532
- keys: ["sprintConfigId", "projectId"]
2533
- });
2534
-
2535
- //#endregion
2536
- //#region src/models/StripeAccountSync.ts
2537
- const stripeAccountSyncDesc = makeModel({
2538
- name: "stripeAccountSync",
2539
- fields: {
2540
- status: string({}),
2541
- euVatIdData: object({}),
2542
- vatCountryCode: string({}),
2543
- vatTaxPercentage: int({}),
2544
- centsPerSeat: int({}),
2545
- billingCycleStart: date({}),
2546
- billingCycleEnd: date({}),
2547
- grossActualBalance: int({}),
2548
- grossBonusBalance: int({}),
2549
- netGiftBalance: int({}),
2550
- paymentMethod: object({}),
2551
- hasBeenCancelledAt: date({}),
2552
- planType: string({}),
2553
- planName: string({}),
2554
- pendingPlanType: string({}),
2555
- repeatingCoupon: object({}),
2556
- accountId: belongsTo({}).type()
2557
- },
2558
- relations: { account: relation("account", {
2559
- type: "belongsTo",
2560
- fk: "accountId"
2561
- }) },
2562
- keys: ["accountId"]
2563
- });
2564
-
2565
- //#endregion
2566
- //#region src/models/TimeTrackingSum.ts
2567
- const timeTrackingSumDesc = makeModel({
2568
- name: "timeTrackingSum",
2569
- fields: {
2570
- sumMs: int({}),
2571
- runningStartedAt: date({}),
2572
- runningModifyDurationMsBy: int({}),
2573
- cardId: belongsTo({}).type(),
2574
- userId: belongsTo({}).type()
2575
- },
2576
- relations: {
2577
- card: relation("card", {
2578
- type: "belongsTo",
2579
- fk: "cardId"
2580
- }),
2581
- user: relation("user", {
2582
- type: "belongsTo",
2583
- fk: "userId"
2584
- })
2585
- },
2586
- keys: ["cardId", "userId"]
2587
- });
2588
-
2589
- //#endregion
2590
- //#region src/models/UserDismissedHint.ts
2591
- const userDismissedHintDesc = makeModel({
2592
- name: "userDismissedHint",
2593
- fields: {
2594
- hintKey: string({}),
2595
- createdAt: date({}),
2596
- returnAt: date({}),
2597
- userId: belongsTo({}).type()
2598
- },
2599
- relations: { user: relation("user", {
2600
- type: "belongsTo",
2601
- fk: "userId"
2602
- }) },
2603
- keys: ["userId", "hintKey"]
2604
- });
2605
-
2606
- //#endregion
2607
- //#region src/models/UserEmail.ts
2608
- const userEmailDesc = makeModel({
2609
- name: "userEmail",
2610
- fields: {
2611
- id: id(),
2612
- email: string({}),
2613
- createdAt: date({}),
2614
- isPrimary: bool({}),
2615
- isVerified: bool({}),
2616
- userId: belongsTo({}).type()
2617
- },
2618
- relations: { user: relation("user", {
2619
- type: "belongsTo",
2620
- fk: "userId"
2621
- }) },
2622
- keys: ["id"]
2623
- });
2624
-
2625
- //#endregion
2626
- //#region src/models/UserInvitation.ts
2627
- const userInvitationDesc = makeModel({
2628
- name: "userInvitation",
2629
- fields: {
2630
- id: id(),
2631
- email: string({}),
2632
- role: string({}),
2633
- accessToProjectIds: array({}),
2634
- createdAt: date({}),
2635
- accountId: belongsTo({}).type(),
2636
- inviterId: belongsTo({}).type()
2637
- },
2638
- relations: {
2639
- account: relation("account", {
2640
- type: "belongsTo",
2641
- fk: "accountId"
2642
- }),
2643
- inviter: relation("user", {
2644
- type: "belongsTo",
2645
- fk: "inviterId"
2646
- })
2647
- },
2648
- keys: ["id"]
2649
- });
2650
-
2651
- //#endregion
2652
- //#region src/models/UserInviteCode.ts
2653
- const userInviteCodeDesc = makeModel({
2654
- name: "userInviteCode",
2655
- fields: {
2656
- id: id(),
2657
- token: string({}),
2658
- role: string({}),
2659
- useCount: string({}),
2660
- isActive: string({}),
2661
- accessToProjectIds: array({}),
2662
- validUntil: date({}),
2663
- createdAt: date({}),
2664
- accountId: belongsTo({}).type(),
2665
- creatorId: belongsTo({}).type()
2666
- },
2667
- relations: {
2668
- account: relation("account", {
2669
- type: "belongsTo",
2670
- fk: "accountId"
2671
- }),
2672
- creator: relation("user", {
2673
- type: "belongsTo",
2674
- fk: "creatorId"
2675
- })
2676
- },
2677
- keys: ["id"]
2678
- });
2679
-
2680
- //#endregion
2681
- //#region src/models/UserOnboarding.ts
2682
- const userOnboardingDesc = makeModel({
2683
- name: "userOnboarding",
2684
- fields: {
2685
- steps: object({}),
2686
- userId: belongsTo({}).type()
2687
- },
2688
- relations: { user: relation("user", {
2689
- type: "belongsTo",
2690
- fk: "userId"
2691
- }) },
2692
- keys: ["userId"]
2693
- });
2694
-
2695
- //#endregion
2696
- //#region src/models/UserProjectAccess.ts
2697
- const userProjectAccessDesc = makeModel({
2698
- name: "userProjectAccess",
2699
- fields: {
2700
- role: string({}),
2701
- projectRole: string({}),
2702
- userId: belongsTo({}).type(),
2703
- projectId: belongsTo({}).type()
2704
- },
2705
- relations: {
2706
- user: relation("user", {
2707
- type: "belongsTo",
2708
- fk: "userId"
2709
- }),
2710
- project: relation("project", {
2711
- type: "belongsTo",
2712
- fk: "projectId"
2713
- })
2714
- },
2715
- keys: ["projectId", "userId"]
2716
- });
2717
-
2718
- //#endregion
2719
- //#region src/models/UserTag.ts
2720
- const userTagDesc = makeModel({
2721
- name: "userTag",
2722
- fields: {
2723
- id: id(),
2724
- tag: string({}),
2725
- createdAt: date({}),
2726
- userId: belongsTo({}).type(),
2727
- accountId: belongsTo({}).type()
2728
- },
2729
- relations: {
2730
- user: relation("user", {
2731
- type: "belongsTo",
2732
- fk: "userId"
2733
- }),
2734
- account: relation("account", {
2735
- type: "belongsTo",
2736
- fk: "accountId"
2737
- })
2738
- },
2739
- keys: ["id"]
2740
- });
2741
-
2742
- //#endregion
2743
- //#region src/models/UserReportSetting.ts
2744
- const userReportSettingDesc = makeModel({
2745
- name: "userReportSetting",
2746
- fields: {
2747
- id: id(),
2748
- name: string({}),
2749
- fileSizeBytesLimit: bigint({}),
2750
- createdAt: date({}),
2751
- deckMapping: object({}),
2752
- prioMapping: object({}),
2753
- accountId: belongsTo({}).type()
2754
- },
2755
- relations: {
2756
- account: relation("account", {
2757
- type: "belongsTo",
2758
- fk: "accountId"
2759
- }),
2760
- reportTokens: relation("userReportToken", { type: "hasMany" })
2761
- },
2762
- keys: ["id"]
2763
- });
2764
-
2765
- //#endregion
2766
- //#region src/models/UserReportEmail.ts
2767
- const userReportEmailDesc = makeModel({
2768
- name: "userReportEmail",
2769
- fields: {
2770
- id: id(),
2771
- email: string({}),
2772
- createdAt: date({}),
2773
- enabled: string({}),
2774
- userReportSettingId: belongsTo({}).type(),
2775
- accountId: belongsTo({}).type()
2776
- },
2777
- relations: {
2778
- userReportSetting: relation("userReportSetting", {
2779
- type: "belongsTo",
2780
- fk: "userReportSettingId"
2781
- }),
2782
- account: relation("account", {
2783
- type: "belongsTo",
2784
- fk: "accountId"
2785
- })
2786
- },
2787
- keys: ["id"]
2788
- });
2789
-
2790
- //#endregion
2791
- //#region src/models/UserReportToken.ts
2792
- const userReportTokenDesc = makeModel({
2793
- name: "userReportToken",
2794
- fields: {
2795
- token: id(),
2796
- label: string({}),
2797
- reportCount: int({}),
2798
- createdAt: date({}),
2799
- enabled: string({}),
2800
- userReportSettingId: belongsTo({}).type()
2801
- },
2802
- relations: { userReportSetting: relation("userReportSetting", {
2803
- type: "belongsTo",
2804
- fk: "userReportSettingId"
2805
- }) },
2806
- keys: ["token"]
2807
- });
2808
-
2809
- //#endregion
2810
- //#region src/models/VisionBoardQuery.ts
2811
- const visionBoardQueryDesc = makeModel({
2812
- name: "visionBoardQuery",
2813
- fields: {
2814
- id: id(),
2815
- query: object({}),
2816
- lastUsedAt: date({}),
2817
- isStale: bool({}),
2818
- type: string({}),
2819
- payload: object({}),
2820
- createdAt: date({}),
2821
- cardId: belongsTo({}).type(),
2822
- accountId: belongsTo({}).type()
2823
- },
2824
- relations: {
2825
- card: relation("card", {
2826
- type: "belongsTo",
2827
- fk: "cardId"
2828
- }),
2829
- account: relation("account", {
2830
- type: "belongsTo",
2831
- fk: "accountId"
2832
- })
2833
- },
2834
- keys: ["id"]
2835
- });
2836
-
2837
- //#endregion
2838
- //#region src/models/Wizard.ts
2839
- const wizardDesc = makeModel({
2840
- name: "wizard",
2841
- fields: {
2842
- id: id(),
2843
- name: string({}),
2844
- currentStep: string({}),
2845
- data: object({}),
2846
- createdAt: date({}),
2847
- finishedAt: date({}),
2848
- accountId: belongsTo({}).type()
2849
- },
2850
- relations: { account: relation("account", {
2851
- type: "belongsTo",
2852
- fk: "accountId"
2853
- }) },
2854
- keys: ["id"]
2855
- });
2856
-
2857
- //#endregion
2858
- //#region src/models/WorkflowItemHistory.ts
2859
- const workflowItemHistoryDesc = makeModel({
2860
- name: "workflowItemHistory",
2861
- fields: {
2862
- diff: object({}),
2863
- versionCreatedAt: date({}),
2864
- version: int({}),
2865
- accountId: belongsTo({}).type(),
2866
- changerId: belongsTo({}).type()
2867
- },
2868
- relations: {
2869
- account: relation("account", {
2870
- type: "belongsTo",
2871
- fk: "accountId"
2872
- }),
2873
- changer: relation("user", {
2874
- type: "belongsTo",
2875
- fk: "changerId"
2876
- })
2877
- },
2878
- keys: ["itemId", "version"]
2879
- });
2880
-
2881
- //#endregion
2882
- //#region src/models/index.ts
2883
- const modelMap = {
2884
- _root: _rootDesc,
2885
- accountOnboardingStep: accountOnboardingStepDesc,
2886
- accountOnboarding: accountOnboardingDesc,
2887
- accountRole: accountRoleDesc,
2888
- accountUserAchievement: accountUserAchievementDesc,
2889
- accountUserSetting: accountUserSettingDesc,
2890
- account: accountDesc,
2891
- activeTimeTracker: activeTimeTrackerDesc,
2892
- activity: activityDesc,
2893
- affiliateCodeStat: affiliateCodeStatDesc,
2894
- affiliateCode: affiliateCodeDesc,
2895
- appInstallation: appInstallationDesc,
2896
- app: appDesc,
2897
- assigneeAssignment: assigneeAssignmentDesc,
2898
- assigneeDeckAssignment: assigneeDeckAssignmentDesc,
2899
- attachment: attachmentDesc,
2900
- autoFinishedTimeTrackingSegment: autoFinishedTimeTrackingSegmentDesc,
2901
- cardDiffNotification: cardDiffNotificationDesc,
2902
- cardHistory: cardHistoryDesc,
2903
- cardOrderInDeck: cardOrderInDeckDesc,
2904
- cardOrder: cardOrderDesc,
2905
- cardPreset: cardPresetDesc,
2906
- cardSubscription: cardSubscriptionDesc,
2907
- cardUpvote: cardUpvoteDesc,
2908
- card: cardDesc,
2909
- cardsEffortHistory: cardsEffortHistoryDesc,
2910
- cardsFinishedHistory: cardsFinishedHistoryDesc,
2911
- cardsStatusHistory: cardsStatusHistoryDesc,
2912
- cardsTimeToFinished: cardsTimeToFinishedDesc,
2913
- dailyDiscordGuildVoteMembership: dailyDiscordGuildVoteMembershipDesc,
2914
- dailyPublicProjectMembership: dailyPublicProjectMembershipDesc,
2915
- publicProjectVisit: publicProjectVisitDesc,
2916
- deckAssignment: deckAssignmentDesc,
2917
- deckGuardian: deckGuardianDesc,
2918
- deckSubscription: deckSubscriptionDesc,
2919
- deck: deckDesc,
2920
- discordGuild: discordGuildDesc,
2921
- discordMember: discordMemberDesc,
2922
- discordProjectNotification: discordProjectNotificationDesc,
2923
- discordSlashCommand: discordSlashCommandDesc,
2924
- dueCard: dueCardDesc,
2925
- file: fileDesc,
2926
- handCard: handCardDesc,
2927
- integration: integrationDesc,
2928
- invoice: invoiceDesc,
2929
- lastSeenCardUpvote: lastSeenCardUpvoteDesc,
2930
- milestoneProgress: milestoneProgressDesc,
2931
- milestoneProject: milestoneProjectDesc,
2932
- milestone: milestoneDesc,
2933
- pinnedMilestone: pinnedMilestoneDesc,
2934
- projectOrder: projectOrderDesc,
2935
- projectSelection: projectSelectionDesc,
2936
- projectTag: projectTagDesc,
2937
- projectUserSetting: projectUserSettingDesc,
2938
- projectUser: projectUserDesc,
2939
- project: projectDesc,
2940
- publicProjectInfo: publicProjectInfoDesc,
2941
- publicProjectMembership: publicProjectMembershipDesc,
2942
- queueEntry: queueEntryDesc,
2943
- queueSelection: queueSelectionDesc,
2944
- release: releaseDesc,
2945
- resolvableEntryHistory: resolvableEntryHistoryDesc,
2946
- resolvableEntryReaction: resolvableEntryReactionDesc,
2947
- resolvableEntry: resolvableEntryDesc,
2948
- resolvableNotification: resolvableNotificationDesc,
2949
- resolvableParticipantHistory: resolvableParticipantHistoryDesc,
2950
- resolvableParticipant: resolvableParticipantDesc,
2951
- resolvable: resolvableDesc,
2952
- savedSearch: savedSearchDesc,
2953
- sprintConfigProgress: sprintConfigProgressDesc,
2954
- sprintConfig: sprintConfigDesc,
2955
- sprintProgress: sprintProgressDesc,
2956
- sprintProject: sprintProjectDesc,
2957
- sprint: sprintDesc,
2958
- stripeAccountSync: stripeAccountSyncDesc,
2959
- timeTrackingSegment: timeTrackingSegmentDesc,
2960
- timeTrackingSum: timeTrackingSumDesc,
2961
- userDismissedHint: userDismissedHintDesc,
2962
- userEmail: userEmailDesc,
2963
- userInvitation: userInvitationDesc,
2964
- userInviteCode: userInviteCodeDesc,
2965
- userOnboarding: userOnboardingDesc,
2966
- userProjectAccess: userProjectAccessDesc,
2967
- userTag: userTagDesc,
2968
- user: userDesc,
2969
- userReportEmail: userReportEmailDesc,
2970
- userReportSetting: userReportSettingDesc,
2971
- userReportToken: userReportTokenDesc,
2972
- visionBoardQuery: visionBoardQueryDesc,
2973
- visionBoard: visionBoardDesc,
2974
- wizard: wizardDesc,
2975
- workflowItemHistory: workflowItemHistoryDesc,
2976
- workflowItem: workflowItemDesc
2977
- };
2978
-
2979
- //#endregion
2980
- //#region src/query-helpers.ts
2981
- const normalizeQuery = (q) => {
2982
- return JSON.stringify(q);
2983
- };
2984
- const queryToKey = normalizeQuery;
2985
- const getRelKey = (r, k) => {
2986
- const getSuffix = () => {
2987
- if (r.type === "exists") return `exists:`;
2988
- if (r.type === "count") return `count:`;
2989
- return "";
2990
- };
2991
- const suffix = getSuffix();
2992
- const isPlainKey = () => {
2993
- if (r.type === "first") return false;
2994
- if (r.filter && Object.keys(r.filter).length > 0) return false;
2995
- if (r.type === "query" || r.type === void 0) {
2996
- if (r.limit || r.orderBy || r.offset) return false;
2997
- }
2998
- return true;
2999
- };
3000
- if (isPlainKey()) return `${suffix}${k}`;
3001
- const q = { ...r.filter };
3002
- if (r.type === "first") {
3003
- q.$first = true;
3004
- q.$order = r.orderBy;
3005
- }
3006
- if (r.type === "query" || r.type === void 0) {
3007
- if (r.limit) q.$limit = r.limit;
3008
- if (r.offset) q.$offset = r.offset;
3009
- if (r.orderBy) q.$order = r.orderBy;
3010
- }
3011
- return `${suffix}${k}(${normalizeQuery(q)})`;
3012
- };
3013
- const processRelations = (rels) => {
3014
- const result = {};
3015
- for (const [key, relq] of Object.entries(rels)) {
3016
- const asArray = Array.isArray(relq) ? relq : [relq];
3017
- for (const rel of asArray) {
3018
- if (!rel) continue;
3019
- result[getRelKey(rel, key)] = makeRelQuerySerializable(rel);
3020
- }
3021
- }
3022
- return result;
3023
- };
3024
- const makeModelQuerySerializable = (q) => {
3025
- if (!q.relations) return q;
3026
- return {
3027
- ...q,
3028
- relations: processRelations(q.relations)
3029
- };
3030
- };
3031
- const makeRelQuerySerializable = (r) => {
3032
- if (r.type === "exists" || r.type === "count") return { asField: true };
3033
- return {
3034
- asField: false,
3035
- fields: r.fields,
3036
- relations: r.relations ? processRelations(r.relations) : void 0
3037
- };
3038
- };
3039
- const serializeModel = (q) => {
3040
- const list = q.fields ? [...q.fields] : [];
3041
- if (!q.relations) return list;
3042
- const relObj = {};
3043
- Object.entries(q.relations).forEach(([k, r]) => {
3044
- if (r.asField) list.push(k);
3045
- else relObj[k] = serializeModel(r);
3046
- });
3047
- if (Object.keys(relObj).length) list.push(relObj);
3048
- return list;
3049
- };
3050
- const serializeInstanceQuery = (q, instances) => {
3051
- return Object.fromEntries(instances.map((instance) => {
3052
- const name = instance["~model"];
3053
- const getKey = () => {
3054
- if (name === "_root") return "_root";
3055
- return `${name}(${instance["~key"]})`;
3056
- };
3057
- return [getKey(), serializeModel(q)];
3058
- }));
3059
- };
3060
-
3061
- //#endregion
3062
- export { _rootDesc, getRelKey, makeModelQuerySerializable, makeRelQuerySerializable, modelMap, queryToKey, serializeInstanceQuery, serializeModel };