@quesmed/types 2.6.80 → 2.6.81

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.
@@ -19,6 +19,10 @@ export declare enum IAccessLevel {
19
19
  DEMO = "demo",
20
20
  EXPIRED = "expired"
21
21
  }
22
+ export declare enum ETheme {
23
+ LIGHT = 0,
24
+ DARK = 1
25
+ }
22
26
  export type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
23
27
  export declare const classYears: IClassYear[];
24
28
  export declare const subscriptionDates: IUserSubsriptionDates[];
@@ -92,6 +96,25 @@ export interface IUserProgressData {
92
96
  daysInPreviousStreak: number;
93
97
  daysInLongestStreak: number;
94
98
  }
99
+ export interface IUserSettings {
100
+ id: Id;
101
+ userId: Id;
102
+ updatedAt: number | Date;
103
+ globalSettings: {
104
+ dailyFeedResetTime: number;
105
+ dailyFeedMax: number;
106
+ theme: ETheme;
107
+ disabledColors: boolean;
108
+ expandedReading: boolean;
109
+ readingTextScale: number;
110
+ addToDailyFlashcards: boolean;
111
+ };
112
+ productSettings: {
113
+ examDate: number | Date | null;
114
+ nextFeedbackDate: number | Date;
115
+ feedback: string | null;
116
+ };
117
+ }
95
118
  export interface IUser {
96
119
  id: Id;
97
120
  createdAt: number | Date;
@@ -101,8 +124,6 @@ export interface IUser {
101
124
  firstName: string;
102
125
  lastName: string;
103
126
  tocAccepted: boolean;
104
- dailyFeedResetTime: number;
105
- dailyFeedMax: number;
106
127
  stripeCustomerId: string;
107
128
  stripeLastSyncAt: number | Date | null;
108
129
  referralCount: number;
@@ -110,7 +131,6 @@ export interface IUser {
110
131
  graduationYear: number;
111
132
  universityId: Id;
112
133
  university: IUniversity;
113
- examDate: number | Date | null;
114
134
  accessLevel: IAccessLevel;
115
135
  elo: number;
116
136
  marksheets: IMarksheet[];
@@ -145,6 +165,7 @@ export interface IUser {
145
165
  radiologyInterviewSubscriptionEndDate: number | Date | null;
146
166
  plab1SubscriptionEndDate: number | Date | null;
147
167
  plab2SubscriptionEndDate: number | Date | null;
168
+ settings: IUserSettings;
148
169
  }
149
170
  export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear, compareUnix?: number): IClassYear;
150
171
  export declare function currentClassGroup(createdAtUnix: number, classYear: IClassYear): EClassYearGroup;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.currentClassGroup = exports.currentClassYear = exports.EPracticeIntensity = exports.classYearGroup = exports.EUserLearningPoint = exports.EUserLearningStatus = exports.EClassYearGroup = exports.dateProductMapping = exports.subscriptionDates = exports.classYears = exports.IAccessLevel = void 0;
3
+ exports.currentClassGroup = exports.currentClassYear = exports.EPracticeIntensity = exports.classYearGroup = exports.EUserLearningPoint = exports.EUserLearningStatus = exports.EClassYearGroup = exports.dateProductMapping = exports.subscriptionDates = exports.classYears = exports.ETheme = exports.IAccessLevel = void 0;
4
4
  const luxon_1 = require("luxon");
5
5
  const Product_1 = require("./Product");
6
6
  var IAccessLevel;
@@ -11,6 +11,11 @@ var IAccessLevel;
11
11
  IAccessLevel["DEMO"] = "demo";
12
12
  IAccessLevel["EXPIRED"] = "expired";
13
13
  })(IAccessLevel = exports.IAccessLevel || (exports.IAccessLevel = {}));
14
+ var ETheme;
15
+ (function (ETheme) {
16
+ ETheme[ETheme["LIGHT"] = 0] = "LIGHT";
17
+ ETheme[ETheme["DARK"] = 1] = "DARK";
18
+ })(ETheme = exports.ETheme || (exports.ETheme = {}));
14
19
  exports.classYears = [
15
20
  'Year 1',
16
21
  'Year 2',
@@ -1,2 +1,4 @@
1
- export declare const USER_FIELDS: import("@apollo/client").DocumentNode;
2
1
  export declare const COMPLETED_CARDS: import("@apollo/client").DocumentNode;
2
+ export declare const USER_SETTINGS_FIELDS: import("@apollo/client").DocumentNode;
3
+ export declare const USER_FIELDS: import("@apollo/client").DocumentNode;
4
+ export declare const UPDATE_USER_SETTINGS_FRAGMENT: import("@apollo/client").DocumentNode;
@@ -1,8 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPLETED_CARDS = exports.USER_FIELDS = void 0;
3
+ exports.UPDATE_USER_SETTINGS_FRAGMENT = exports.USER_FIELDS = exports.USER_SETTINGS_FIELDS = exports.COMPLETED_CARDS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
+ exports.COMPLETED_CARDS = (0, client_1.gql) `
6
+ fragment UserCompletedCards on User {
7
+ completedCards {
8
+ id
9
+ createdAt
10
+ updatedAt
11
+ concept {
12
+ id
13
+ name
14
+ }
15
+ lastSeen
16
+ reviewDate
17
+ score
18
+ iteration
19
+ optimalFactor
20
+ cardId
21
+ card {
22
+ id
23
+ conceptId
24
+ concept {
25
+ id
26
+ name
27
+ }
28
+ topic {
29
+ id
30
+ name
31
+ }
32
+ question
33
+ explanation
34
+ pictures {
35
+ id
36
+ createdAt
37
+ updatedAt
38
+ name
39
+ caption
40
+ index
41
+ path
42
+ path512
43
+ path256
44
+ thumbhash
45
+ topicId
46
+ topic {
47
+ id
48
+ name
49
+ typeId
50
+ }
51
+ }
52
+ }
53
+ }
54
+ completedCardsCount
55
+ }
56
+ `;
57
+ exports.USER_SETTINGS_FIELDS = (0, client_1.gql) `
58
+ fragment UserSettingsFields on UserSettings {
59
+ id
60
+ userId
61
+ updatedAt
62
+ globalSettings {
63
+ dailyFeedMax
64
+ dailyFeedResetTime
65
+ theme
66
+ expandedReading
67
+ disabledColors
68
+ readingTextScale
69
+ addToDailyFlashcards
70
+ }
71
+ productSettings {
72
+ feedback
73
+ examDate
74
+ nextFeedbackDate
75
+ }
76
+ }
77
+ `;
5
78
  exports.USER_FIELDS = (0, client_1.gql) `
79
+ ${exports.USER_SETTINGS_FIELDS}
6
80
  fragment UserFields on User {
7
81
  id
8
82
  accessLevel
@@ -15,9 +89,9 @@ exports.USER_FIELDS = (0, client_1.gql) `
15
89
  classYear
16
90
  graduationYear
17
91
  universityId
18
- examDate
19
- dailyFeedResetTime
20
- dailyFeedMax
92
+ settings {
93
+ ...UserSettingsFields
94
+ }
21
95
  stripeCustomerId
22
96
  tocAccepted
23
97
 
@@ -76,55 +150,12 @@ exports.USER_FIELDS = (0, client_1.gql) `
76
150
  # completedRedCardsCount
77
151
  }
78
152
  `;
79
- exports.COMPLETED_CARDS = (0, client_1.gql) `
80
- fragment UserCompletedCards on User {
81
- completedCards {
82
- id
83
- createdAt
84
- updatedAt
85
- concept {
86
- id
87
- name
88
- }
89
- lastSeen
90
- reviewDate
91
- score
92
- iteration
93
- optimalFactor
94
- cardId
95
- card {
96
- id
97
- conceptId
98
- concept {
99
- id
100
- name
101
- }
102
- topic {
103
- id
104
- name
105
- }
106
- question
107
- explanation
108
- pictures {
109
- id
110
- createdAt
111
- updatedAt
112
- name
113
- caption
114
- index
115
- path
116
- path512
117
- path256
118
- thumbhash
119
- topicId
120
- topic {
121
- id
122
- name
123
- typeId
124
- }
125
- }
126
- }
153
+ // used in cache updator
154
+ exports.UPDATE_USER_SETTINGS_FRAGMENT = (0, client_1.gql) `
155
+ ${exports.USER_SETTINGS_FIELDS}
156
+ fragment UpdateUserSettingsFragment on User {
157
+ settings {
158
+ ...UserSettingsFields
127
159
  }
128
- completedCardsCount
129
160
  }
130
161
  `;
@@ -1,5 +1,5 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
- import { EUserLearningStatus, IUser, IUserConceptStatus, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
2
+ import { EUserLearningStatus, IUser, IUserConceptStatus, IUserSettings, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
3
3
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
4
4
  import { RestrictedData, graphqlNormalize } from '../../types';
5
5
  export declare const LOGOUT_USER: import("@apollo/client").DocumentNode;
@@ -31,9 +31,6 @@ export interface IUserInput {
31
31
  graduationYear?: number;
32
32
  password?: string;
33
33
  oldPassword?: string;
34
- examDate?: number | Date;
35
- dailyFeedResetTime?: number;
36
- dailyFeedMax?: number;
37
34
  referral?: string;
38
35
  universityId?: number;
39
36
  }
@@ -46,6 +43,12 @@ export type IUpdateUserData = RestrictedData<{
46
43
  jwt: string;
47
44
  user: IUser & graphqlNormalize;
48
45
  }, 'updateUser'>;
46
+ export declare const UPDATE_USER_SETTINGS: import("@apollo/client").DocumentNode;
47
+ export interface IUpdateUserSettingsVar {
48
+ input: Omit<IUserSettings, 'id' | 'userId' | 'updatedAt'>;
49
+ }
50
+ export type IUpdateUserSettingsData = RestrictedData<IUserSettings & graphqlNormalize, 'updateUserSettings'>;
51
+ export declare const updateCacheOnUpdateUserSettings: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateUserSettingsData>, options: ApolloUpdateOptions<IUpdateUserSettingsVar>) => void;
49
52
  export declare const RENEW_TOKEN: import("@apollo/client").DocumentNode;
50
53
  export type IRenewTokenVar = null;
51
54
  export type IRenewTokenData = RestrictedData<string, 'renewToken'>;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
3
+ exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.updateCacheOnUpdateUserSettings = exports.UPDATE_USER_SETTINGS = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const models_1 = require("../../../models");
6
+ const fragments_1 = require("../../fragments");
6
7
  exports.LOGOUT_USER = (0, client_1.gql) `
7
8
  mutation LogoutUser($all: Boolean!) {
8
9
  restricted {
@@ -55,15 +56,40 @@ exports.UPDATE_USER = (0, client_1.gql) `
55
56
  classYear
56
57
  graduationYear
57
58
  universityId
58
- examDate
59
- dailyFeedMax
60
- dailyFeedResetTime
61
59
  tocAccepted
62
60
  }
63
61
  }
64
62
  }
65
63
  }
66
64
  `;
65
+ exports.UPDATE_USER_SETTINGS = (0, client_1.gql) `
66
+ ${fragments_1.USER_SETTINGS_FIELDS}
67
+ mutation UpdateUserSettings($input: UserSettingsInput!) {
68
+ restricted {
69
+ updateUserSettings(input: $input) {
70
+ ...UserSettingsFields
71
+ }
72
+ }
73
+ }
74
+ `;
75
+ const updateCacheOnUpdateUserSettings = (cache, result, options) => {
76
+ const { updateUserSettings } = result?.data?.restricted || {};
77
+ const { variables } = options || {};
78
+ if (!variables || !updateUserSettings) {
79
+ return;
80
+ }
81
+ cache.writeFragment({
82
+ id: cache.identify({
83
+ id: updateUserSettings.userId,
84
+ __typename: 'User',
85
+ }),
86
+ data: {
87
+ settings: updateUserSettings,
88
+ },
89
+ fragment: fragments_1.UPDATE_USER_SETTINGS_FRAGMENT,
90
+ });
91
+ };
92
+ exports.updateCacheOnUpdateUserSettings = updateCacheOnUpdateUserSettings;
67
93
  exports.RENEW_TOKEN = (0, client_1.gql) `
68
94
  mutation RenewToken {
69
95
  restricted {
@@ -41,7 +41,13 @@ exports.DASHBOARD_OSCE = (0, client_1.gql) `
41
41
  total
42
42
  }
43
43
  user {
44
- examDate
44
+ settings {
45
+ productSettings {
46
+ examDate
47
+ feedback
48
+ nextFeedbackDate
49
+ }
50
+ }
45
51
  userProgress {
46
52
  marksheetCount
47
53
  stationsCount
@@ -11,7 +11,13 @@ exports.DASHBOARD_QBANK = (0, client_1.gql) `
11
11
  latestSessionId
12
12
  user {
13
13
  id
14
- examDate
14
+ settings {
15
+ productSettings {
16
+ examDate
17
+ feedback
18
+ nextFeedbackDate
19
+ }
20
+ }
15
21
  completedQuestionsCount
16
22
  completedCorrectQuestionsCount
17
23
  completedIncorrectQuestionsCount
@@ -136,7 +142,13 @@ exports.DASHBOARD = (0, client_1.gql) `
136
142
  latestSessionId
137
143
  user {
138
144
  id
139
- examDate
145
+ settings {
146
+ productSettings {
147
+ examDate
148
+ feedback
149
+ nextFeedbackDate
150
+ }
151
+ }
140
152
  universityId
141
153
  classYear
142
154
  completedQuestionsCount
@@ -144,6 +144,13 @@ exports.PACE_KNOWLEDGE_LIBRARY = (0, client_1.gql) `
144
144
  demo
145
145
  status
146
146
  typeId
147
+ userNote {
148
+ id
149
+ userId
150
+ conceptId
151
+ note
152
+ updatedAt
153
+ }
147
154
  entitlement {
148
155
  id
149
156
  name
@@ -19,6 +19,10 @@ export declare enum IAccessLevel {
19
19
  DEMO = "demo",
20
20
  EXPIRED = "expired"
21
21
  }
22
+ export declare enum ETheme {
23
+ LIGHT = 0,
24
+ DARK = 1
25
+ }
22
26
  export type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
23
27
  export declare const classYears: IClassYear[];
24
28
  export declare const subscriptionDates: IUserSubsriptionDates[];
@@ -92,6 +96,25 @@ export interface IUserProgressData {
92
96
  daysInPreviousStreak: number;
93
97
  daysInLongestStreak: number;
94
98
  }
99
+ export interface IUserSettings {
100
+ id: Id;
101
+ userId: Id;
102
+ updatedAt: number | Date;
103
+ globalSettings: {
104
+ dailyFeedResetTime: number;
105
+ dailyFeedMax: number;
106
+ theme: ETheme;
107
+ disabledColors: boolean;
108
+ expandedReading: boolean;
109
+ readingTextScale: number;
110
+ addToDailyFlashcards: boolean;
111
+ };
112
+ productSettings: {
113
+ examDate: number | Date | null;
114
+ nextFeedbackDate: number | Date;
115
+ feedback: string | null;
116
+ };
117
+ }
95
118
  export interface IUser {
96
119
  id: Id;
97
120
  createdAt: number | Date;
@@ -101,8 +124,6 @@ export interface IUser {
101
124
  firstName: string;
102
125
  lastName: string;
103
126
  tocAccepted: boolean;
104
- dailyFeedResetTime: number;
105
- dailyFeedMax: number;
106
127
  stripeCustomerId: string;
107
128
  stripeLastSyncAt: number | Date | null;
108
129
  referralCount: number;
@@ -110,7 +131,6 @@ export interface IUser {
110
131
  graduationYear: number;
111
132
  universityId: Id;
112
133
  university: IUniversity;
113
- examDate: number | Date | null;
114
134
  accessLevel: IAccessLevel;
115
135
  elo: number;
116
136
  marksheets: IMarksheet[];
@@ -145,6 +165,7 @@ export interface IUser {
145
165
  radiologyInterviewSubscriptionEndDate: number | Date | null;
146
166
  plab1SubscriptionEndDate: number | Date | null;
147
167
  plab2SubscriptionEndDate: number | Date | null;
168
+ settings: IUserSettings;
148
169
  }
149
170
  export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear, compareUnix?: number): IClassYear;
150
171
  export declare function currentClassGroup(createdAtUnix: number, classYear: IClassYear): EClassYearGroup;
@@ -8,6 +8,11 @@ export var IAccessLevel;
8
8
  IAccessLevel["DEMO"] = "demo";
9
9
  IAccessLevel["EXPIRED"] = "expired";
10
10
  })(IAccessLevel || (IAccessLevel = {}));
11
+ export var ETheme;
12
+ (function (ETheme) {
13
+ ETheme[ETheme["LIGHT"] = 0] = "LIGHT";
14
+ ETheme[ETheme["DARK"] = 1] = "DARK";
15
+ })(ETheme || (ETheme = {}));
11
16
  export const classYears = [
12
17
  'Year 1',
13
18
  'Year 2',
@@ -1,2 +1,4 @@
1
- export declare const USER_FIELDS: import("@apollo/client").DocumentNode;
2
1
  export declare const COMPLETED_CARDS: import("@apollo/client").DocumentNode;
2
+ export declare const USER_SETTINGS_FIELDS: import("@apollo/client").DocumentNode;
3
+ export declare const USER_FIELDS: import("@apollo/client").DocumentNode;
4
+ export declare const UPDATE_USER_SETTINGS_FRAGMENT: import("@apollo/client").DocumentNode;
@@ -1,5 +1,79 @@
1
1
  import { gql } from '@apollo/client';
2
+ export const COMPLETED_CARDS = gql `
3
+ fragment UserCompletedCards on User {
4
+ completedCards {
5
+ id
6
+ createdAt
7
+ updatedAt
8
+ concept {
9
+ id
10
+ name
11
+ }
12
+ lastSeen
13
+ reviewDate
14
+ score
15
+ iteration
16
+ optimalFactor
17
+ cardId
18
+ card {
19
+ id
20
+ conceptId
21
+ concept {
22
+ id
23
+ name
24
+ }
25
+ topic {
26
+ id
27
+ name
28
+ }
29
+ question
30
+ explanation
31
+ pictures {
32
+ id
33
+ createdAt
34
+ updatedAt
35
+ name
36
+ caption
37
+ index
38
+ path
39
+ path512
40
+ path256
41
+ thumbhash
42
+ topicId
43
+ topic {
44
+ id
45
+ name
46
+ typeId
47
+ }
48
+ }
49
+ }
50
+ }
51
+ completedCardsCount
52
+ }
53
+ `;
54
+ export const USER_SETTINGS_FIELDS = gql `
55
+ fragment UserSettingsFields on UserSettings {
56
+ id
57
+ userId
58
+ updatedAt
59
+ globalSettings {
60
+ dailyFeedMax
61
+ dailyFeedResetTime
62
+ theme
63
+ expandedReading
64
+ disabledColors
65
+ readingTextScale
66
+ addToDailyFlashcards
67
+ }
68
+ productSettings {
69
+ feedback
70
+ examDate
71
+ nextFeedbackDate
72
+ }
73
+ }
74
+ `;
2
75
  export const USER_FIELDS = gql `
76
+ ${USER_SETTINGS_FIELDS}
3
77
  fragment UserFields on User {
4
78
  id
5
79
  accessLevel
@@ -12,9 +86,9 @@ export const USER_FIELDS = gql `
12
86
  classYear
13
87
  graduationYear
14
88
  universityId
15
- examDate
16
- dailyFeedResetTime
17
- dailyFeedMax
89
+ settings {
90
+ ...UserSettingsFields
91
+ }
18
92
  stripeCustomerId
19
93
  tocAccepted
20
94
 
@@ -73,55 +147,12 @@ export const USER_FIELDS = gql `
73
147
  # completedRedCardsCount
74
148
  }
75
149
  `;
76
- export const COMPLETED_CARDS = gql `
77
- fragment UserCompletedCards on User {
78
- completedCards {
79
- id
80
- createdAt
81
- updatedAt
82
- concept {
83
- id
84
- name
85
- }
86
- lastSeen
87
- reviewDate
88
- score
89
- iteration
90
- optimalFactor
91
- cardId
92
- card {
93
- id
94
- conceptId
95
- concept {
96
- id
97
- name
98
- }
99
- topic {
100
- id
101
- name
102
- }
103
- question
104
- explanation
105
- pictures {
106
- id
107
- createdAt
108
- updatedAt
109
- name
110
- caption
111
- index
112
- path
113
- path512
114
- path256
115
- thumbhash
116
- topicId
117
- topic {
118
- id
119
- name
120
- typeId
121
- }
122
- }
123
- }
150
+ // used in cache updator
151
+ export const UPDATE_USER_SETTINGS_FRAGMENT = gql `
152
+ ${USER_SETTINGS_FIELDS}
153
+ fragment UpdateUserSettingsFragment on User {
154
+ settings {
155
+ ...UserSettingsFields
124
156
  }
125
- completedCardsCount
126
157
  }
127
158
  `;
@@ -1,5 +1,5 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
- import { EUserLearningStatus, IUser, IUserConceptStatus, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
2
+ import { EUserLearningStatus, IUser, IUserConceptStatus, IUserSettings, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
3
3
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
4
4
  import { RestrictedData, graphqlNormalize } from '../../types';
5
5
  export declare const LOGOUT_USER: import("@apollo/client").DocumentNode;
@@ -31,9 +31,6 @@ export interface IUserInput {
31
31
  graduationYear?: number;
32
32
  password?: string;
33
33
  oldPassword?: string;
34
- examDate?: number | Date;
35
- dailyFeedResetTime?: number;
36
- dailyFeedMax?: number;
37
34
  referral?: string;
38
35
  universityId?: number;
39
36
  }
@@ -46,6 +43,12 @@ export type IUpdateUserData = RestrictedData<{
46
43
  jwt: string;
47
44
  user: IUser & graphqlNormalize;
48
45
  }, 'updateUser'>;
46
+ export declare const UPDATE_USER_SETTINGS: import("@apollo/client").DocumentNode;
47
+ export interface IUpdateUserSettingsVar {
48
+ input: Omit<IUserSettings, 'id' | 'userId' | 'updatedAt'>;
49
+ }
50
+ export type IUpdateUserSettingsData = RestrictedData<IUserSettings & graphqlNormalize, 'updateUserSettings'>;
51
+ export declare const updateCacheOnUpdateUserSettings: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateUserSettingsData>, options: ApolloUpdateOptions<IUpdateUserSettingsVar>) => void;
49
52
  export declare const RENEW_TOKEN: import("@apollo/client").DocumentNode;
50
53
  export type IRenewTokenVar = null;
51
54
  export type IRenewTokenData = RestrictedData<string, 'renewToken'>;
@@ -1,5 +1,6 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { EUserLearningStatus, } from '../../../models';
3
+ import { UPDATE_USER_SETTINGS_FRAGMENT, USER_SETTINGS_FIELDS, } from '../../fragments';
3
4
  export const LOGOUT_USER = gql `
4
5
  mutation LogoutUser($all: Boolean!) {
5
6
  restricted {
@@ -52,15 +53,39 @@ export const UPDATE_USER = gql `
52
53
  classYear
53
54
  graduationYear
54
55
  universityId
55
- examDate
56
- dailyFeedMax
57
- dailyFeedResetTime
58
56
  tocAccepted
59
57
  }
60
58
  }
61
59
  }
62
60
  }
63
61
  `;
62
+ export const UPDATE_USER_SETTINGS = gql `
63
+ ${USER_SETTINGS_FIELDS}
64
+ mutation UpdateUserSettings($input: UserSettingsInput!) {
65
+ restricted {
66
+ updateUserSettings(input: $input) {
67
+ ...UserSettingsFields
68
+ }
69
+ }
70
+ }
71
+ `;
72
+ export const updateCacheOnUpdateUserSettings = (cache, result, options) => {
73
+ const { updateUserSettings } = result?.data?.restricted || {};
74
+ const { variables } = options || {};
75
+ if (!variables || !updateUserSettings) {
76
+ return;
77
+ }
78
+ cache.writeFragment({
79
+ id: cache.identify({
80
+ id: updateUserSettings.userId,
81
+ __typename: 'User',
82
+ }),
83
+ data: {
84
+ settings: updateUserSettings,
85
+ },
86
+ fragment: UPDATE_USER_SETTINGS_FRAGMENT,
87
+ });
88
+ };
64
89
  export const RENEW_TOKEN = gql `
65
90
  mutation RenewToken {
66
91
  restricted {
@@ -38,7 +38,13 @@ export const DASHBOARD_OSCE = gql `
38
38
  total
39
39
  }
40
40
  user {
41
- examDate
41
+ settings {
42
+ productSettings {
43
+ examDate
44
+ feedback
45
+ nextFeedbackDate
46
+ }
47
+ }
42
48
  userProgress {
43
49
  marksheetCount
44
50
  stationsCount
@@ -8,7 +8,13 @@ export const DASHBOARD_QBANK = gql `
8
8
  latestSessionId
9
9
  user {
10
10
  id
11
- examDate
11
+ settings {
12
+ productSettings {
13
+ examDate
14
+ feedback
15
+ nextFeedbackDate
16
+ }
17
+ }
12
18
  completedQuestionsCount
13
19
  completedCorrectQuestionsCount
14
20
  completedIncorrectQuestionsCount
@@ -133,7 +139,13 @@ export const DASHBOARD = gql `
133
139
  latestSessionId
134
140
  user {
135
141
  id
136
- examDate
142
+ settings {
143
+ productSettings {
144
+ examDate
145
+ feedback
146
+ nextFeedbackDate
147
+ }
148
+ }
137
149
  universityId
138
150
  classYear
139
151
  completedQuestionsCount
@@ -141,6 +141,13 @@ export const PACE_KNOWLEDGE_LIBRARY = gql `
141
141
  demo
142
142
  status
143
143
  typeId
144
+ userNote {
145
+ id
146
+ userId
147
+ conceptId
148
+ note
149
+ updatedAt
150
+ }
144
151
  entitlement {
145
152
  id
146
153
  name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.80",
3
+ "version": "2.6.81",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",