@codecks/fetch 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +317 -10
- package/dist/_exploration/api-requester.d.ts +4 -4
- package/dist/_exploration/api-requester.js +5 -4
- package/dist/_exploration/create-hooks.d.ts +5 -5
- package/dist/_exploration/create-hooks.js +193 -88
- package/dist/_exploration/loader.d.ts +2 -2
- package/dist/_exploration/loader.js +7 -2
- package/dist/_exploration/store.d.ts +4 -4
- package/dist/_exploration/store.js +76 -73
- package/dist/{_root-D1Faf8cg.d.ts → _root-rBEjvjCJ.d.ts} +1 -1
- package/dist/immediate-cache-DiH8tpJM.js +237 -0
- package/dist/{index-DUBsesYl.d.ts → index-obQtSRRg.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/{loader-types-Dp0CSVTf.d.ts → loader-types-Y0OHlOEK.d.ts} +4 -8
- package/dist/{loader-utils-Du-CTKH-.d.ts → loader-utils-rQFSDhwf.d.ts} +2 -2
- package/dist/{query-helpers-DsMMOtSO.js → query-helpers-DgC42MEH.js} +13 -9
- package/dist/{query-type-Dx5ZCv5N.d.ts → query-type-B0L3hwCo.d.ts} +2 -2
- package/dist/{store-B6JWZnAO.d.ts → store-LSWKTuHv.d.ts} +97 -6
- package/package.json +4 -3
- package/schema/models/account.md +104 -0
- package/schema/models/accountOnboarding.md +15 -0
- package/schema/models/accountOnboardingStep.md +14 -0
- package/schema/models/accountRole.md +19 -0
- package/schema/models/accountUserAchievement.md +17 -0
- package/schema/models/accountUserSetting.md +20 -0
- package/schema/models/activeTimeTracker.md +19 -0
- package/schema/models/activity.md +30 -0
- package/schema/models/affiliateCode.md +30 -0
- package/schema/models/affiliateCodeStat.md +19 -0
- package/schema/models/app.md +10 -0
- package/schema/models/appInstallation.md +19 -0
- package/schema/models/assigneeAssignment.md +18 -0
- package/schema/models/assigneeDeckAssignment.md +20 -0
- package/schema/models/attachment.md +23 -0
- package/schema/models/autoFinishedTimeTrackingSegment.md +20 -0
- package/schema/models/card.md +82 -0
- package/schema/models/cardDiffNotification.md +22 -0
- package/schema/models/cardHistory.md +20 -0
- package/schema/models/cardOrder.md +17 -0
- package/schema/models/cardOrderInDeck.md +18 -0
- package/schema/models/cardPreset.md +19 -0
- package/schema/models/cardSubscription.md +19 -0
- package/schema/models/cardUpvote.md +21 -0
- package/schema/models/cardsEffortHistory.md +9 -0
- package/schema/models/cardsFinishedHistory.md +16 -0
- package/schema/models/cardsStatusHistory.md +9 -0
- package/schema/models/cardsTimeToFinished.md +18 -0
- package/schema/models/dailyDiscordGuildVoteMembership.md +15 -0
- package/schema/models/dailyPublicProjectMembership.md +15 -0
- package/schema/models/deck.md +53 -0
- package/schema/models/deckAssignment.md +18 -0
- package/schema/models/deckGuardian.md +17 -0
- package/schema/models/deckSubscription.md +18 -0
- package/schema/models/discordGuild.md +30 -0
- package/schema/models/discordMember.md +21 -0
- package/schema/models/discordProjectNotification.md +19 -0
- package/schema/models/discordSlashCommand.md +28 -0
- package/schema/models/dueCard.md +18 -0
- package/schema/models/file.md +26 -0
- package/schema/models/handCard.md +18 -0
- package/schema/models/integration.md +23 -0
- package/schema/models/invoice.md +21 -0
- package/schema/models/lastSeenCardUpvote.md +17 -0
- package/schema/models/milestone.md +39 -0
- package/schema/models/milestoneProgress.md +14 -0
- package/schema/models/milestoneProject.md +17 -0
- package/schema/models/pinnedMilestone.md +22 -0
- package/schema/models/project.md +58 -0
- package/schema/models/projectOrder.md +18 -0
- package/schema/models/projectSelection.md +18 -0
- package/schema/models/projectTag.md +19 -0
- package/schema/models/projectUser.md +18 -0
- package/schema/models/projectUserSetting.md +15 -0
- package/schema/models/publicProjectInfo.md +20 -0
- package/schema/models/publicProjectMembership.md +17 -0
- package/schema/models/publicProjectVisit.md +16 -0
- package/schema/models/queueEntry.md +21 -0
- package/schema/models/queueSelection.md +19 -0
- package/schema/models/release.md +12 -0
- package/schema/models/resolvable.md +32 -0
- package/schema/models/resolvableEntry.md +28 -0
- package/schema/models/resolvableEntryHistory.md +20 -0
- package/schema/models/resolvableEntryReaction.md +23 -0
- package/schema/models/resolvableNotification.md +30 -0
- package/schema/models/resolvableParticipant.md +25 -0
- package/schema/models/resolvableParticipantHistory.md +23 -0
- package/schema/models/savedSearch.md +18 -0
- package/schema/models/sprint.md +42 -0
- package/schema/models/sprintConfig.md +38 -0
- package/schema/models/sprintConfigProgress.md +14 -0
- package/schema/models/sprintProgress.md +14 -0
- package/schema/models/sprintProject.md +17 -0
- package/schema/models/stripeAccountSync.md +29 -0
- package/schema/models/timeTrackingSegment.md +24 -0
- package/schema/models/timeTrackingSum.md +18 -0
- package/schema/models/user.md +67 -0
- package/schema/models/userDismissedHint.md +16 -0
- package/schema/models/userEmail.md +18 -0
- package/schema/models/userInvitation.md +20 -0
- package/schema/models/userInviteCode.md +23 -0
- package/schema/models/userOnboarding.md +14 -0
- package/schema/models/userProjectAccess.md +17 -0
- package/schema/models/userReportEmail.md +19 -0
- package/schema/models/userReportSetting.md +23 -0
- package/schema/models/userReportToken.md +18 -0
- package/schema/models/userTag.md +18 -0
- package/schema/models/visionBoard.md +21 -0
- package/schema/models/visionBoardQuery.md +22 -0
- package/schema/models/wizard.md +19 -0
- package/schema/models/workflowItem.md +45 -0
- package/schema/models/workflowItemHistory.md +18 -0
- package/schema/overview.md +110 -0
- package/schema/query-syntax.md +155 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# visionBoardQuery
|
|
2
|
+
|
|
3
|
+
Key: `id`
|
|
4
|
+
|
|
5
|
+
## Fields
|
|
6
|
+
|
|
7
|
+
- `id`: string
|
|
8
|
+
- `query`: object
|
|
9
|
+
- `lastUsedAt`: Date (ISO string)
|
|
10
|
+
- `isStale`: boolean
|
|
11
|
+
- `type`: string
|
|
12
|
+
- `payload`: object
|
|
13
|
+
- `createdAt`: Date (ISO string)
|
|
14
|
+
- `cardId`: string (foreign key ID) → card
|
|
15
|
+
- `accountId`: string (foreign key ID) → account
|
|
16
|
+
|
|
17
|
+
## Relations
|
|
18
|
+
|
|
19
|
+
### belongsTo
|
|
20
|
+
|
|
21
|
+
- `card` → [card](card.md) (via `cardId`)
|
|
22
|
+
- `account` → [account](account.md) (via `accountId`)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# wizard
|
|
2
|
+
|
|
3
|
+
Key: `id`
|
|
4
|
+
|
|
5
|
+
## Fields
|
|
6
|
+
|
|
7
|
+
- `id`: string
|
|
8
|
+
- `name`: string
|
|
9
|
+
- `currentStep`: string
|
|
10
|
+
- `data`: object
|
|
11
|
+
- `createdAt`: Date (ISO string)
|
|
12
|
+
- `finishedAt`: Date (ISO string)
|
|
13
|
+
- `accountId`: string (foreign key ID) → account
|
|
14
|
+
|
|
15
|
+
## Relations
|
|
16
|
+
|
|
17
|
+
### belongsTo
|
|
18
|
+
|
|
19
|
+
- `account` → [account](account.md) (via `accountId`)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# workflowItem
|
|
2
|
+
|
|
3
|
+
Key: `itemId`
|
|
4
|
+
|
|
5
|
+
## Fields
|
|
6
|
+
|
|
7
|
+
- `itemId`: string
|
|
8
|
+
- `version`: string
|
|
9
|
+
- `sortOrder`: string
|
|
10
|
+
- `sortValue`: string
|
|
11
|
+
- `priority`: string, optional
|
|
12
|
+
- `content`: string
|
|
13
|
+
- `createdAt`: Date (ISO string)
|
|
14
|
+
- `lastUpdatedAt`: Date (ISO string)
|
|
15
|
+
- `tags`: array
|
|
16
|
+
- `masterTags`: array
|
|
17
|
+
- `mentionedUsers`: array
|
|
18
|
+
- `title`: string
|
|
19
|
+
- `effort`: number, optional
|
|
20
|
+
- `label`: string, optional
|
|
21
|
+
- `checkboxStats`: object
|
|
22
|
+
- `accountSeq`: number
|
|
23
|
+
- `checkboxInfo`: array
|
|
24
|
+
- `visibility`: string
|
|
25
|
+
- `accountId`: string (foreign key ID) → account
|
|
26
|
+
- `deckId`: string (foreign key ID) → deck
|
|
27
|
+
- `targetDeckId`: string (foreign key ID) → deck, optional
|
|
28
|
+
- `assigneeId`: string (foreign key ID) → user, optional
|
|
29
|
+
- `creatorId`: string (foreign key ID) → user
|
|
30
|
+
|
|
31
|
+
## Relations
|
|
32
|
+
|
|
33
|
+
### belongsTo
|
|
34
|
+
|
|
35
|
+
- `account` → [account](account.md) (via `accountId`)
|
|
36
|
+
- `deck` → [deck](deck.md) (via `deckId`)
|
|
37
|
+
- `targetDeck` → [deck](deck.md) (via `targetDeckId`)
|
|
38
|
+
- `assignee` → [user](user.md) (via `assigneeId`)
|
|
39
|
+
- `creator` → [user](user.md) (via `creatorId`)
|
|
40
|
+
|
|
41
|
+
### hasMany
|
|
42
|
+
|
|
43
|
+
- `diffs` → [workflowItemHistory](workflowItemHistory.md)
|
|
44
|
+
- `inDeps` → [workflowItem](workflowItem.md)
|
|
45
|
+
- `outDeps` → [workflowItem](workflowItem.md)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# workflowItemHistory
|
|
2
|
+
|
|
3
|
+
Key: `itemId`, `version`
|
|
4
|
+
|
|
5
|
+
## Fields
|
|
6
|
+
|
|
7
|
+
- `diff`: object
|
|
8
|
+
- `versionCreatedAt`: Date (ISO string)
|
|
9
|
+
- `version`: number
|
|
10
|
+
- `accountId`: string (foreign key ID) → account
|
|
11
|
+
- `changerId`: string (foreign key ID) → user
|
|
12
|
+
|
|
13
|
+
## Relations
|
|
14
|
+
|
|
15
|
+
### belongsTo
|
|
16
|
+
|
|
17
|
+
- `account` → [account](account.md) (via `accountId`)
|
|
18
|
+
- `changer` → [user](user.md) (via `changerId`)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# @codecks/fetch Schema Overview
|
|
2
|
+
|
|
3
|
+
## Root Entry Points
|
|
4
|
+
|
|
5
|
+
These relations are available when using `fetchFromRoot`:
|
|
6
|
+
|
|
7
|
+
- `releases` (hasMany) → [release](models/release.md)
|
|
8
|
+
- `accountOnboardingSteps` (hasMany) → [accountOnboardingStep](models/accountOnboardingStep.md)
|
|
9
|
+
- `apps` (hasMany) → [app](models/app.md)
|
|
10
|
+
- `account` (hasOne) → [account](models/account.md)
|
|
11
|
+
- `loggedInUser` (hasOne) → [user](models/user.md)
|
|
12
|
+
- `cardsStatusHistory` (hasMany) → [cardsStatusHistory](models/cardsStatusHistory.md)
|
|
13
|
+
- `cardsEffortHistory` (hasMany) → [cardsEffortHistory](models/cardsEffortHistory.md)
|
|
14
|
+
- `cardsFinishedHistory` (hasMany) → [cardsFinishedHistory](models/cardsFinishedHistory.md)
|
|
15
|
+
- `cardsTimeToFinished` (hasMany) → [cardsTimeToFinished](models/cardsTimeToFinished.md)
|
|
16
|
+
|
|
17
|
+
## All Models
|
|
18
|
+
|
|
19
|
+
- [accountOnboardingStep](models/accountOnboardingStep.md) (key: key) — 8 fields, 0 relations
|
|
20
|
+
- [accountOnboarding](models/accountOnboarding.md) (key: accountId) — 3 fields, 1 relations
|
|
21
|
+
- [accountRole](models/accountRole.md) (key: accountId, userId) — 6 fields, 2 relations
|
|
22
|
+
- [accountUserAchievement](models/accountUserAchievement.md) (key: accountId, userId, key) — 4 fields, 2 relations
|
|
23
|
+
- [accountUserSetting](models/accountUserSetting.md) (key: accountId, userId) — 6 fields, 3 relations
|
|
24
|
+
- [account](models/account.md) (key: id) — 45 fields, 42 relations
|
|
25
|
+
- [activeTimeTracker](models/activeTimeTracker.md) (key: id) — 5 fields, 3 relations
|
|
26
|
+
- [activity](models/activity.md) (key: id) — 13 fields, 6 relations
|
|
27
|
+
- [affiliateCodeStat](models/affiliateCodeStat.md) (key: affiliateCodeId, month) — 7 fields, 1 relations
|
|
28
|
+
- [affiliateCode](models/affiliateCode.md) (key: id) — 13 fields, 3 relations
|
|
29
|
+
- [appInstallation](models/appInstallation.md) (key: id) — 5 fields, 3 relations
|
|
30
|
+
- [app](models/app.md) (key: id) — 4 fields, 0 relations
|
|
31
|
+
- [assigneeAssignment](models/assigneeAssignment.md) (key: assigneeId, assignedById) — 4 fields, 3 relations
|
|
32
|
+
- [assigneeDeckAssignment](models/assigneeDeckAssignment.md) (key: assigneeId, assignedById, deckId) — 5 fields, 4 relations
|
|
33
|
+
- [attachment](models/attachment.md) (key: id) — 8 fields, 4 relations
|
|
34
|
+
- [autoFinishedTimeTrackingSegment](models/autoFinishedTimeTrackingSegment.md) (key: userId, accountId) — 5 fields, 4 relations
|
|
35
|
+
- [cardDiffNotification](models/cardDiffNotification.md) (key: userId, cardId) — 8 fields, 3 relations
|
|
36
|
+
- [cardHistory](models/cardHistory.md) (key: cardId, version) — 6 fields, 3 relations
|
|
37
|
+
- [cardOrderInDeck](models/cardOrderInDeck.md) (key: cardId, deckId) — 4 fields, 3 relations
|
|
38
|
+
- [cardOrder](models/cardOrder.md) (key: context, cardId) — 4 fields, 2 relations
|
|
39
|
+
- [cardPreset](models/cardPreset.md) (key: id) — 6 fields, 2 relations
|
|
40
|
+
- [cardSubscription](models/cardSubscription.md) (key: id) — 5 fields, 3 relations
|
|
41
|
+
- [cardUpvote](models/cardUpvote.md) (key: id) — 7 fields, 3 relations
|
|
42
|
+
- [card](models/card.md) (key: cardId) — 37 fields, 28 relations
|
|
43
|
+
- [cardsEffortHistory](models/cardsEffortHistory.md) (key: date, effortSum, cardCount) — 3 fields, 0 relations
|
|
44
|
+
- [cardsFinishedHistory](models/cardsFinishedHistory.md) (key: date, effortSum, cardCount, assigneeId) — 4 fields, 1 relations
|
|
45
|
+
- [cardsStatusHistory](models/cardsStatusHistory.md) (key: date, status, count) — 3 fields, 0 relations
|
|
46
|
+
- [cardsTimeToFinished](models/cardsTimeToFinished.md) (key: cardId, startedAt, doneAt, effort, assigneeId) — 5 fields, 2 relations
|
|
47
|
+
- [dailyDiscordGuildVoteMembership](models/dailyDiscordGuildVoteMembership.md) (key: t, guildId) — 3 fields, 1 relations
|
|
48
|
+
- [dailyPublicProjectMembership](models/dailyPublicProjectMembership.md) (key: t, projectId) — 3 fields, 1 relations
|
|
49
|
+
- [publicProjectVisit](models/publicProjectVisit.md) (key: t, projectId) — 4 fields, 1 relations
|
|
50
|
+
- [deckAssignment](models/deckAssignment.md) (key: userId, deckId) — 4 fields, 3 relations
|
|
51
|
+
- [deckGuardian](models/deckGuardian.md) (key: deckId, userId) — 3 fields, 3 relations
|
|
52
|
+
- [deckSubscription](models/deckSubscription.md) (key: id) — 4 fields, 3 relations
|
|
53
|
+
- [deck](models/deck.md) (key: id) — 27 fields, 12 relations
|
|
54
|
+
- [discordGuild](models/discordGuild.md) (key: id) — 11 fields, 5 relations
|
|
55
|
+
- [discordMember](models/discordMember.md) (key: id) — 9 fields, 1 relations
|
|
56
|
+
- [discordProjectNotification](models/discordProjectNotification.md) (key: id) — 6 fields, 2 relations
|
|
57
|
+
- [discordSlashCommand](models/discordSlashCommand.md) (key: id) — 15 fields, 2 relations
|
|
58
|
+
- [dueCard](models/dueCard.md) (key: userId, cardId) — 4 fields, 3 relations
|
|
59
|
+
- [file](models/file.md) (key: id) — 12 fields, 3 relations
|
|
60
|
+
- [handCard](models/handCard.md) (key: cardId, userId, accountId) — 4 fields, 3 relations
|
|
61
|
+
- [integration](models/integration.md) (key: id) — 9 fields, 3 relations
|
|
62
|
+
- [invoice](models/invoice.md) (key: id) — 9 fields, 1 relations
|
|
63
|
+
- [lastSeenCardUpvote](models/lastSeenCardUpvote.md) (key: userId, accountId) — 4 fields, 2 relations
|
|
64
|
+
- [milestoneProgress](models/milestoneProgress.md) (key: milestoneId, date) — 2 fields, 1 relations
|
|
65
|
+
- [milestoneProject](models/milestoneProject.md) (key: milestoneId, projectId) — 3 fields, 3 relations
|
|
66
|
+
- [milestone](models/milestone.md) (key: id) — 18 fields, 7 relations
|
|
67
|
+
- [pinnedMilestone](models/pinnedMilestone.md) (key: id) — 7 fields, 4 relations
|
|
68
|
+
- [projectOrder](models/projectOrder.md) (key: projectId, userId, accountId) — 4 fields, 3 relations
|
|
69
|
+
- [projectSelection](models/projectSelection.md) (key: id) — 4 fields, 3 relations
|
|
70
|
+
- [projectTag](models/projectTag.md) (key: id) — 7 fields, 1 relations
|
|
71
|
+
- [projectUserSetting](models/projectUserSetting.md) (key: projectId, userId) — 2 fields, 2 relations
|
|
72
|
+
- [projectUser](models/projectUser.md) (key: projectId, userId) — 4 fields, 3 relations
|
|
73
|
+
- [project](models/project.md) (key: id) — 24 fields, 17 relations
|
|
74
|
+
- [publicProjectInfo](models/publicProjectInfo.md) (key: projectId) — 7 fields, 2 relations
|
|
75
|
+
- [publicProjectMembership](models/publicProjectMembership.md) (key: userId, projectId) — 4 fields, 2 relations
|
|
76
|
+
- [queueEntry](models/queueEntry.md) (key: id) — 7 fields, 3 relations
|
|
77
|
+
- [queueSelection](models/queueSelection.md) (key: id) — 5 fields, 3 relations
|
|
78
|
+
- [release](models/release.md) (key: id) — 6 fields, 0 relations
|
|
79
|
+
- [resolvableEntryHistory](models/resolvableEntryHistory.md) (key: entryId, version) — 6 fields, 3 relations
|
|
80
|
+
- [resolvableEntryReaction](models/resolvableEntryReaction.md) (key: id) — 8 fields, 4 relations
|
|
81
|
+
- [resolvableEntry](models/resolvableEntry.md) (key: entryId) — 9 fields, 5 relations
|
|
82
|
+
- [resolvableNotification](models/resolvableNotification.md) (key: userId, resolvableId) — 14 fields, 5 relations
|
|
83
|
+
- [resolvableParticipantHistory](models/resolvableParticipantHistory.md) (key: participantId, resolvableId, version) — 9 fields, 3 relations
|
|
84
|
+
- [resolvableParticipant](models/resolvableParticipant.md) (key: participantId, resolvableId) — 10 fields, 4 relations
|
|
85
|
+
- [resolvable](models/resolvable.md) (key: id) — 11 fields, 7 relations
|
|
86
|
+
- [savedSearch](models/savedSearch.md) (key: id) — 5 fields, 2 relations
|
|
87
|
+
- [sprintConfigProgress](models/sprintConfigProgress.md) (key: sprintConfigId, date) — 2 fields, 1 relations
|
|
88
|
+
- [sprintConfig](models/sprintConfig.md) (key: id) — 19 fields, 5 relations
|
|
89
|
+
- [sprintProgress](models/sprintProgress.md) (key: sprintId, date) — 2 fields, 1 relations
|
|
90
|
+
- [sprintProject](models/sprintProject.md) (key: sprintConfigId, projectId) — 3 fields, 3 relations
|
|
91
|
+
- [sprint](models/sprint.md) (key: id) — 20 fields, 8 relations
|
|
92
|
+
- [stripeAccountSync](models/stripeAccountSync.md) (key: accountId) — 17 fields, 1 relations
|
|
93
|
+
- [timeTrackingSegment](models/timeTrackingSegment.md) (key: id) — 10 fields, 3 relations
|
|
94
|
+
- [timeTrackingSum](models/timeTrackingSum.md) (key: cardId, userId) — 5 fields, 2 relations
|
|
95
|
+
- [userDismissedHint](models/userDismissedHint.md) (key: userId, hintKey) — 4 fields, 1 relations
|
|
96
|
+
- [userEmail](models/userEmail.md) (key: id) — 6 fields, 1 relations
|
|
97
|
+
- [userInvitation](models/userInvitation.md) (key: id) — 7 fields, 2 relations
|
|
98
|
+
- [userInviteCode](models/userInviteCode.md) (key: id) — 10 fields, 2 relations
|
|
99
|
+
- [userOnboarding](models/userOnboarding.md) (key: userId) — 2 fields, 1 relations
|
|
100
|
+
- [userProjectAccess](models/userProjectAccess.md) (key: projectId, userId) — 4 fields, 2 relations
|
|
101
|
+
- [userTag](models/userTag.md) (key: id) — 5 fields, 2 relations
|
|
102
|
+
- [user](models/user.md) (key: id) — 19 fields, 31 relations
|
|
103
|
+
- [userReportEmail](models/userReportEmail.md) (key: id) — 6 fields, 2 relations
|
|
104
|
+
- [userReportSetting](models/userReportSetting.md) (key: id) — 7 fields, 2 relations
|
|
105
|
+
- [userReportToken](models/userReportToken.md) (key: token) — 6 fields, 1 relations
|
|
106
|
+
- [visionBoardQuery](models/visionBoardQuery.md) (key: id) — 9 fields, 2 relations
|
|
107
|
+
- [visionBoard](models/visionBoard.md) (key: id) — 7 fields, 3 relations
|
|
108
|
+
- [wizard](models/wizard.md) (key: id) — 7 fields, 1 relations
|
|
109
|
+
- [workflowItemHistory](models/workflowItemHistory.md) (key: itemId, version) — 5 fields, 2 relations
|
|
110
|
+
- [workflowItem](models/workflowItem.md) (key: itemId) — 23 fields, 8 relations
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Query Syntax Reference
|
|
2
|
+
|
|
3
|
+
## Basic Query
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
const {fetchFromRoot, fetchInstance} = buildFetchersWithSimpleLoader({
|
|
7
|
+
token: "your-api-token",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
// Fetch from root entry points
|
|
11
|
+
const result = await fetchFromRoot({
|
|
12
|
+
account: {fields: ["name", "subdomain"]},
|
|
13
|
+
});
|
|
14
|
+
// result.account.name, result.account.subdomain
|
|
15
|
+
|
|
16
|
+
// Fetch a specific instance by model + ID
|
|
17
|
+
const card = await fetchInstance("card", cardId, {
|
|
18
|
+
fields: ["title", "status", "effort"],
|
|
19
|
+
});
|
|
20
|
+
// card.title, card.status, card.effort
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Field Selection
|
|
24
|
+
|
|
25
|
+
`fields` is an array of field names to include in the response.
|
|
26
|
+
Key fields (like `cardId` for card, `id` for most models) are always returned.
|
|
27
|
+
The meta fields `~model` and `~key` are always included.
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
{fields: ["title", "status", "createdAt"]}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Nested Relations
|
|
34
|
+
|
|
35
|
+
Use `relations` to traverse the object graph:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
const result = await fetchFromRoot({
|
|
39
|
+
account: {
|
|
40
|
+
fields: ["name"],
|
|
41
|
+
relations: {
|
|
42
|
+
cards: {
|
|
43
|
+
fields: ["title", "status"],
|
|
44
|
+
relations: {
|
|
45
|
+
assignee: {fields: ["name"]},
|
|
46
|
+
deck: {fields: ["title"]},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## hasMany Variants
|
|
55
|
+
|
|
56
|
+
hasMany relations support different query types:
|
|
57
|
+
|
|
58
|
+
### Default (array)
|
|
59
|
+
```ts
|
|
60
|
+
{cards: {fields: ["title", "status"]}}
|
|
61
|
+
// returns: cards: Array<{title, status, ...}>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### count
|
|
65
|
+
```ts
|
|
66
|
+
{cards: {type: "count", as: "cardCount"}}
|
|
67
|
+
// returns: cardCount: number
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### exists
|
|
71
|
+
```ts
|
|
72
|
+
{cards: {type: "exists", as: "hasCards"}}
|
|
73
|
+
// returns: hasCards: boolean
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### first
|
|
77
|
+
```ts
|
|
78
|
+
{cards: {type: "first", as: "latestCard", orderBy: "-createdAt", fields: ["title"]}}
|
|
79
|
+
// returns: latestCard: {title, ...} | null
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Multiple variants of the same relation
|
|
83
|
+
Pass an array of queries with `as` aliases:
|
|
84
|
+
```ts
|
|
85
|
+
{
|
|
86
|
+
cards: [
|
|
87
|
+
{as: "openCards", filter: {status: "started"}, fields: ["title"]},
|
|
88
|
+
{as: "cardCount", type: "count"},
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
// returns: openCards: Array<...>, cardCount: number
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Filtering (hasMany only)
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
{
|
|
98
|
+
cards: {
|
|
99
|
+
fields: ["title"],
|
|
100
|
+
filter: {
|
|
101
|
+
status: "started", // exact match
|
|
102
|
+
effort: {op: "gte", value: 3}, // comparison: lt, lte, gt, gte
|
|
103
|
+
assigneeId: {op: "eq", value: userId}, // equality: eq, neq (supports null)
|
|
104
|
+
tags: {op: "has", value: "bug"}, // array contains
|
|
105
|
+
title: {op: "contains", value: "search"}, // string contains
|
|
106
|
+
priority: {op: "in", value: ["high", "critical"]}, // in set
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Logical operators
|
|
113
|
+
```ts
|
|
114
|
+
{
|
|
115
|
+
cards: {
|
|
116
|
+
fields: ["title"],
|
|
117
|
+
filter: {
|
|
118
|
+
$or: [
|
|
119
|
+
{status: "started"},
|
|
120
|
+
{status: "done"},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Filter by relation
|
|
128
|
+
```ts
|
|
129
|
+
{
|
|
130
|
+
cards: {
|
|
131
|
+
fields: ["title"],
|
|
132
|
+
filter: {
|
|
133
|
+
assignee: {name: "Alice"}, // cards where assignee.name = "Alice"
|
|
134
|
+
"!deck": {isDeleted: "true"}, // negated: cards NOT in deleted decks
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Ordering (hasMany only)
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
// Simple: field name, prefix with - for descending
|
|
144
|
+
{cards: {fields: ["title"], orderBy: "createdAt"}}
|
|
145
|
+
{cards: {fields: ["title"], orderBy: "-createdAt"}}
|
|
146
|
+
|
|
147
|
+
// Multiple
|
|
148
|
+
{cards: {fields: ["title"], orderBy: ["status", "-createdAt"]}}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Pagination (hasMany only)
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
{cards: {fields: ["title"], limit: 10, offset: 20}}
|
|
155
|
+
```
|