Skip to content

Commit 4c66fed

Browse files
chore: Expose premiumStatus user field (#382)
Co-authored-by: Scott Lovegrove <[email protected]>
1 parent a27fce1 commit 4c66fed

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

src/custom-fetch-simple.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const MOCK_CURRENT_USER: CurrentUser = {
1515
avatarSmall: 'https://example.com/avatars/test_user_small.jpg',
1616
businessAccountId: null,
1717
isPremium: true,
18+
premiumStatus: 'current_personal_plan',
1819
dateFormat: 0,
1920
timeFormat: 0,
2021
weeklyGoal: 100,

src/obsidian-custom-fetch.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ describe('Obsidian Custom Fetch Integration', () => {
7777
avatarSmall: null,
7878
businessAccountId: null,
7979
isPremium: true,
80+
premiumStatus: 'current_personal_plan',
8081
dateFormat: 0,
8182
timeFormat: 0,
8283
weeklyGoal: 100,

src/todoist-api.user.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const DEFAULT_CURRENT_USER_RESPONSE: CurrentUser = {
1717
avatarSmall: 'https://example.com/avatars/test_user_small.jpg',
1818
businessAccountId: null,
1919
isPremium: true,
20+
premiumStatus: 'current_personal_plan',
2021
dateFormat: 0,
2122
timeFormat: 0,
2223
weeklyGoal: 100,

src/types/entities.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ export const CurrentUserSchema = z.object({
285285
avatarSmall: z.string().nullish(),
286286
businessAccountId: z.string().nullable(),
287287
isPremium: z.boolean(),
288+
premiumStatus: z.enum([
289+
'not_premium',
290+
'current_personal_plan',
291+
'legacy_personal_plan',
292+
'teams_business_member',
293+
]),
288294
dateFormat: z.number().int(),
289295
timeFormat: z.number().int(),
290296
weeklyGoal: z.number().int(),

0 commit comments

Comments
 (0)