@quesmed/types 2.0.14 → 2.1.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 (205) hide show
  1. package/dist/cjs/gql_input_output_types/index.d.ts +2 -2
  2. package/dist/cjs/models/Notification.d.ts +39 -0
  3. package/dist/cjs/models/Notification.js +2 -0
  4. package/dist/cjs/models/OsceMarksheet.js +3 -4
  5. package/dist/cjs/models/Question.d.ts +3 -0
  6. package/dist/cjs/models/Type.d.ts +1 -0
  7. package/dist/cjs/models/User.d.ts +7 -5
  8. package/dist/cjs/models/index.d.ts +1 -0
  9. package/dist/cjs/models/index.js +1 -0
  10. package/dist/cjs/resolvers/apollo.d.ts +1 -3
  11. package/dist/cjs/resolvers/fragments/chapter.js +14 -3
  12. package/dist/cjs/resolvers/fragments/index.d.ts +2 -0
  13. package/dist/cjs/resolvers/fragments/index.js +2 -0
  14. package/dist/cjs/resolvers/fragments/marksheet.d.ts +1 -0
  15. package/dist/cjs/resolvers/fragments/marksheet.js +109 -0
  16. package/dist/cjs/resolvers/fragments/mockTest.d.ts +1 -0
  17. package/dist/cjs/resolvers/fragments/mockTest.js +16 -0
  18. package/dist/cjs/resolvers/fragments/osce.js +1 -0
  19. package/dist/cjs/resolvers/fragments/topic.d.ts +1 -0
  20. package/dist/cjs/resolvers/fragments/topic.js +18 -0
  21. package/dist/cjs/resolvers/fragments/user.js +3 -3
  22. package/dist/cjs/resolvers/mutation/admin/algoliaSync.d.ts +4 -0
  23. package/dist/cjs/resolvers/mutation/admin/algoliaSync.js +30 -0
  24. package/dist/cjs/resolvers/mutation/admin/index.d.ts +1 -0
  25. package/dist/cjs/resolvers/mutation/admin/index.js +1 -0
  26. package/dist/cjs/resolvers/mutation/admin/notification.d.ts +15 -0
  27. package/dist/cjs/resolvers/mutation/admin/notification.js +2 -0
  28. package/dist/cjs/resolvers/mutation/admin/token.d.ts +2 -0
  29. package/dist/cjs/resolvers/mutation/admin/token.js +16 -0
  30. package/dist/cjs/resolvers/mutation/restricted/contactUs.d.ts +1 -0
  31. package/dist/cjs/resolvers/mutation/restricted/contactUs.js +13 -0
  32. package/dist/cjs/resolvers/mutation/restricted/index.d.ts +1 -0
  33. package/dist/cjs/resolvers/mutation/restricted/index.js +1 -0
  34. package/dist/cjs/resolvers/mutation/restricted/marksheet.d.ts +5 -0
  35. package/dist/cjs/resolvers/mutation/restricted/marksheet.js +92 -0
  36. package/dist/cjs/resolvers/mutation/restricted/mockTest.d.ts +3 -0
  37. package/dist/cjs/resolvers/mutation/restricted/mockTest.js +29 -0
  38. package/dist/cjs/resolvers/mutation/restricted/notification.d.ts +28 -0
  39. package/dist/cjs/resolvers/mutation/restricted/notification.js +2 -0
  40. package/dist/cjs/resolvers/mutation/restricted/questionDiscussion.d.ts +5 -1
  41. package/dist/cjs/resolvers/mutation/restricted/questionDiscussion.js +152 -0
  42. package/dist/cjs/resolvers/mutation/restricted/todo.d.ts +8 -0
  43. package/dist/cjs/resolvers/mutation/restricted/todo.js +150 -0
  44. package/dist/cjs/resolvers/mutation/restricted/token.d.ts +2 -0
  45. package/dist/cjs/resolvers/mutation/restricted/token.js +19 -0
  46. package/dist/cjs/resolvers/mutation/restricted/users.d.ts +3 -0
  47. package/dist/cjs/resolvers/mutation/restricted/users.js +24 -1
  48. package/dist/cjs/resolvers/mutation/restricted/video.d.ts +1 -0
  49. package/dist/cjs/resolvers/mutation/restricted/video.js +13 -0
  50. package/dist/cjs/resolvers/mutation/stripe.d.ts +2 -0
  51. package/dist/cjs/resolvers/mutation/stripe.js +12 -0
  52. package/dist/cjs/resolvers/mutation/users.d.ts +4 -0
  53. package/dist/cjs/resolvers/mutation/users.js +22 -0
  54. package/dist/cjs/resolvers/mutation/validUserToken/user.d.ts +2 -0
  55. package/dist/cjs/resolvers/mutation/validUserToken/user.js +16 -0
  56. package/dist/cjs/resolvers/query/admin/getUserToken.d.ts +1 -0
  57. package/dist/cjs/resolvers/query/admin/getUserToken.js +9 -0
  58. package/dist/cjs/resolvers/query/author.d.ts +1 -0
  59. package/dist/cjs/resolvers/query/author.js +16 -0
  60. package/dist/cjs/resolvers/query/book.d.ts +3 -1
  61. package/dist/cjs/resolvers/query/book.js +42 -0
  62. package/dist/cjs/resolvers/query/feedback.d.ts +2 -0
  63. package/dist/cjs/resolvers/query/feedback.js +12 -0
  64. package/dist/cjs/resolvers/query/restricted/global.d.ts +2 -0
  65. package/dist/cjs/resolvers/query/restricted/global.js +16 -0
  66. package/dist/cjs/resolvers/query/restricted/index.d.ts +2 -0
  67. package/dist/cjs/resolvers/query/restricted/index.js +2 -0
  68. package/dist/cjs/resolvers/query/restricted/marksheet.d.ts +6 -0
  69. package/dist/cjs/resolvers/query/restricted/marksheet.js +996 -0
  70. package/dist/cjs/resolvers/query/restricted/mockTests.d.ts +2 -0
  71. package/dist/cjs/resolvers/query/restricted/mockTests.js +23 -0
  72. package/dist/cjs/resolvers/query/restricted/notification.d.ts +9 -0
  73. package/dist/cjs/resolvers/query/restricted/notification.js +2 -0
  74. package/dist/cjs/resolvers/query/restricted/osce.js +2 -2
  75. package/dist/cjs/resolvers/query/restricted/qBank.d.ts +18 -0
  76. package/dist/cjs/resolvers/query/restricted/qBank.js +77 -0
  77. package/dist/cjs/resolvers/query/restricted/quesBook.d.ts +2 -1
  78. package/dist/cjs/resolvers/query/restricted/quesBook.js +39 -1
  79. package/dist/cjs/resolvers/query/restricted/replication.d.ts +2 -3
  80. package/dist/cjs/resolvers/query/restricted/todos.d.ts +3 -1
  81. package/dist/cjs/resolvers/query/restricted/todos.js +63 -0
  82. package/dist/cjs/resolvers/query/restricted/topics.d.ts +2 -0
  83. package/dist/cjs/resolvers/query/restricted/topics.js +38 -0
  84. package/dist/cjs/resolvers/query/restricted/university.d.ts +1 -0
  85. package/dist/cjs/resolvers/query/restricted/university.js +23 -0
  86. package/dist/cjs/resolvers/query/restricted/user.d.ts +2 -2
  87. package/dist/cjs/resolvers/query/restricted/user.js +24 -0
  88. package/dist/cjs/resolvers/query/restricted/video.d.ts +5 -3
  89. package/dist/cjs/resolvers/query/restricted/video.js +98 -0
  90. package/dist/cjs/resolvers/query/sample.js +4 -0
  91. package/dist/cjs/resolvers/query/subscription.d.ts +1 -0
  92. package/dist/cjs/resolvers/query/subscription.js +18 -0
  93. package/dist/cjs/resolvers/query/university.d.ts +1 -0
  94. package/dist/cjs/resolvers/query/university.js +10 -0
  95. package/dist/cjs/resolvers/query/user.d.ts +2 -0
  96. package/dist/cjs/resolvers/query/user.js +12 -0
  97. package/dist/cjs/resolvers/query/video.d.ts +4 -1
  98. package/dist/cjs/resolvers/query/video.js +99 -0
  99. package/dist/cjs/resolvers/subscription/index.d.ts +1 -0
  100. package/dist/cjs/resolvers/subscription/index.js +1 -0
  101. package/dist/cjs/resolvers/subscription/notification.d.ts +11 -0
  102. package/dist/cjs/resolvers/subscription/notification.js +4 -0
  103. package/dist/mjs/gql_input_output_types/index.d.ts +2 -2
  104. package/dist/mjs/models/Notification.d.ts +39 -0
  105. package/dist/mjs/models/Notification.js +1 -0
  106. package/dist/mjs/models/OsceMarksheet.js +3 -4
  107. package/dist/mjs/models/Question.d.ts +3 -0
  108. package/dist/mjs/models/Type.d.ts +1 -0
  109. package/dist/mjs/models/User.d.ts +7 -5
  110. package/dist/mjs/models/index.d.ts +1 -0
  111. package/dist/mjs/models/index.js +1 -0
  112. package/dist/mjs/resolvers/apollo.d.ts +1 -3
  113. package/dist/mjs/resolvers/fragments/chapter.js +14 -3
  114. package/dist/mjs/resolvers/fragments/index.d.ts +2 -0
  115. package/dist/mjs/resolvers/fragments/index.js +2 -0
  116. package/dist/mjs/resolvers/fragments/marksheet.d.ts +1 -0
  117. package/dist/mjs/resolvers/fragments/marksheet.js +106 -0
  118. package/dist/mjs/resolvers/fragments/mockTest.d.ts +1 -0
  119. package/dist/mjs/resolvers/fragments/mockTest.js +13 -0
  120. package/dist/mjs/resolvers/fragments/osce.js +1 -0
  121. package/dist/mjs/resolvers/fragments/topic.d.ts +1 -0
  122. package/dist/mjs/resolvers/fragments/topic.js +15 -0
  123. package/dist/mjs/resolvers/fragments/user.js +3 -3
  124. package/dist/mjs/resolvers/mutation/admin/algoliaSync.d.ts +4 -0
  125. package/dist/mjs/resolvers/mutation/admin/algoliaSync.js +29 -1
  126. package/dist/mjs/resolvers/mutation/admin/index.d.ts +1 -0
  127. package/dist/mjs/resolvers/mutation/admin/index.js +1 -0
  128. package/dist/mjs/resolvers/mutation/admin/notification.d.ts +15 -0
  129. package/dist/mjs/resolvers/mutation/admin/notification.js +1 -0
  130. package/dist/mjs/resolvers/mutation/admin/token.d.ts +2 -0
  131. package/dist/mjs/resolvers/mutation/admin/token.js +15 -1
  132. package/dist/mjs/resolvers/mutation/restricted/contactUs.d.ts +1 -0
  133. package/dist/mjs/resolvers/mutation/restricted/contactUs.js +12 -1
  134. package/dist/mjs/resolvers/mutation/restricted/index.d.ts +1 -0
  135. package/dist/mjs/resolvers/mutation/restricted/index.js +1 -0
  136. package/dist/mjs/resolvers/mutation/restricted/marksheet.d.ts +5 -0
  137. package/dist/mjs/resolvers/mutation/restricted/marksheet.js +91 -1
  138. package/dist/mjs/resolvers/mutation/restricted/mockTest.d.ts +3 -0
  139. package/dist/mjs/resolvers/mutation/restricted/mockTest.js +28 -1
  140. package/dist/mjs/resolvers/mutation/restricted/notification.d.ts +28 -0
  141. package/dist/mjs/resolvers/mutation/restricted/notification.js +1 -0
  142. package/dist/mjs/resolvers/mutation/restricted/questionDiscussion.d.ts +5 -1
  143. package/dist/mjs/resolvers/mutation/restricted/questionDiscussion.js +151 -1
  144. package/dist/mjs/resolvers/mutation/restricted/todo.d.ts +8 -0
  145. package/dist/mjs/resolvers/mutation/restricted/todo.js +148 -1
  146. package/dist/mjs/resolvers/mutation/restricted/token.d.ts +2 -0
  147. package/dist/mjs/resolvers/mutation/restricted/token.js +18 -1
  148. package/dist/mjs/resolvers/mutation/restricted/users.d.ts +3 -0
  149. package/dist/mjs/resolvers/mutation/restricted/users.js +23 -0
  150. package/dist/mjs/resolvers/mutation/restricted/video.d.ts +1 -0
  151. package/dist/mjs/resolvers/mutation/restricted/video.js +12 -1
  152. package/dist/mjs/resolvers/mutation/stripe.d.ts +2 -0
  153. package/dist/mjs/resolvers/mutation/stripe.js +11 -1
  154. package/dist/mjs/resolvers/mutation/users.d.ts +4 -0
  155. package/dist/mjs/resolvers/mutation/users.js +21 -1
  156. package/dist/mjs/resolvers/mutation/validUserToken/user.d.ts +2 -0
  157. package/dist/mjs/resolvers/mutation/validUserToken/user.js +15 -1
  158. package/dist/mjs/resolvers/query/admin/getUserToken.d.ts +1 -0
  159. package/dist/mjs/resolvers/query/admin/getUserToken.js +8 -1
  160. package/dist/mjs/resolvers/query/author.d.ts +1 -0
  161. package/dist/mjs/resolvers/query/author.js +15 -1
  162. package/dist/mjs/resolvers/query/book.d.ts +3 -1
  163. package/dist/mjs/resolvers/query/book.js +41 -1
  164. package/dist/mjs/resolvers/query/feedback.d.ts +2 -0
  165. package/dist/mjs/resolvers/query/feedback.js +11 -1
  166. package/dist/mjs/resolvers/query/restricted/global.d.ts +2 -0
  167. package/dist/mjs/resolvers/query/restricted/global.js +15 -1
  168. package/dist/mjs/resolvers/query/restricted/index.d.ts +2 -0
  169. package/dist/mjs/resolvers/query/restricted/index.js +2 -0
  170. package/dist/mjs/resolvers/query/restricted/marksheet.d.ts +6 -0
  171. package/dist/mjs/resolvers/query/restricted/marksheet.js +995 -1
  172. package/dist/mjs/resolvers/query/restricted/mockTests.d.ts +2 -0
  173. package/dist/mjs/resolvers/query/restricted/mockTests.js +22 -1
  174. package/dist/mjs/resolvers/query/restricted/notification.d.ts +9 -0
  175. package/dist/mjs/resolvers/query/restricted/notification.js +1 -0
  176. package/dist/mjs/resolvers/query/restricted/osce.js +2 -2
  177. package/dist/mjs/resolvers/query/restricted/qBank.d.ts +18 -0
  178. package/dist/mjs/resolvers/query/restricted/qBank.js +74 -0
  179. package/dist/mjs/resolvers/query/restricted/quesBook.d.ts +2 -1
  180. package/dist/mjs/resolvers/query/restricted/quesBook.js +38 -0
  181. package/dist/mjs/resolvers/query/restricted/replication.d.ts +2 -3
  182. package/dist/mjs/resolvers/query/restricted/todos.d.ts +3 -1
  183. package/dist/mjs/resolvers/query/restricted/todos.js +62 -1
  184. package/dist/mjs/resolvers/query/restricted/topics.d.ts +2 -0
  185. package/dist/mjs/resolvers/query/restricted/topics.js +37 -1
  186. package/dist/mjs/resolvers/query/restricted/university.d.ts +1 -0
  187. package/dist/mjs/resolvers/query/restricted/university.js +22 -1
  188. package/dist/mjs/resolvers/query/restricted/user.d.ts +2 -2
  189. package/dist/mjs/resolvers/query/restricted/user.js +23 -1
  190. package/dist/mjs/resolvers/query/restricted/video.d.ts +5 -3
  191. package/dist/mjs/resolvers/query/restricted/video.js +97 -1
  192. package/dist/mjs/resolvers/query/sample.js +4 -0
  193. package/dist/mjs/resolvers/query/subscription.d.ts +1 -0
  194. package/dist/mjs/resolvers/query/subscription.js +17 -1
  195. package/dist/mjs/resolvers/query/university.d.ts +1 -0
  196. package/dist/mjs/resolvers/query/university.js +9 -1
  197. package/dist/mjs/resolvers/query/user.d.ts +2 -0
  198. package/dist/mjs/resolvers/query/user.js +11 -1
  199. package/dist/mjs/resolvers/query/video.d.ts +4 -1
  200. package/dist/mjs/resolvers/query/video.js +98 -1
  201. package/dist/mjs/resolvers/subscription/index.d.ts +1 -0
  202. package/dist/mjs/resolvers/subscription/index.js +1 -0
  203. package/dist/mjs/resolvers/subscription/notification.d.ts +11 -0
  204. package/dist/mjs/resolvers/subscription/notification.js +1 -0
  205. package/package.json +4 -4
@@ -8,6 +8,7 @@ export interface IPreBuildMarksheet {
8
8
  seenIncorrect: number;
9
9
  buildRef: number;
10
10
  }
11
+ export declare const BUILD_MARKSHEET: import("@apollo/client").DocumentNode;
11
12
  export interface IBuildMarksheetInput extends IPreBuildMarksheet {
12
13
  isTest: boolean;
13
14
  }
@@ -15,6 +16,7 @@ export interface IBuildMarksheetVar {
15
16
  buildMarksheet: IBuildMarksheetInput;
16
17
  }
17
18
  export declare type IBuildMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'buildMarksheet'>;
19
+ export declare const RE_BUILD_MARKSHEET: import("@apollo/client").DocumentNode;
18
20
  export interface IReBuildMarksheetVar {
19
21
  marksheetId: number;
20
22
  }
@@ -26,15 +28,18 @@ export interface IMarksheetInput {
26
28
  mark?: string;
27
29
  timeTaken: number;
28
30
  }
31
+ export declare const SAVE_MARKSHEET: import("@apollo/client").DocumentNode;
29
32
  export interface ISaveMarksheetsVar {
30
33
  marksheetInput: IMarksheetInput[];
31
34
  }
32
35
  export declare type ISaveMarksheetsData = RestrictedData<(graphqlNormalize & IMarksheet)[], 'saveMarksheets'>;
36
+ export declare const ADD_FLAGGED_QUESTION: import("@apollo/client").DocumentNode;
33
37
  export interface IAddFlaggedQuestionVar {
34
38
  markId: number;
35
39
  questionId: number;
36
40
  }
37
41
  export declare type IAddFlaggedQuestionData = RestrictedData<graphqlNormalize & IUserFlaggedQuestion, 'addFlaggedQuestion'>;
42
+ export declare const REMOVE_FLAGGED_QUESTION: import("@apollo/client").DocumentNode;
38
43
  export interface IRemoveFlaggedQuestionVar {
39
44
  id: Id;
40
45
  }
@@ -1 +1,91 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ import { MARKSHEET_MARK_FIELDS } from '../../fragments/marksheet';
3
+ export const BUILD_MARKSHEET = gql `
4
+ mutation BuildMarksheet($buildMarksheet: BuildMarksheetInput) {
5
+ restricted {
6
+ buildMarksheet(buildMarksheet: $buildMarksheet) {
7
+ id
8
+ }
9
+ }
10
+ }
11
+ `;
12
+ export const RE_BUILD_MARKSHEET = gql `
13
+ ${MARKSHEET_MARK_FIELDS}
14
+ mutation ReBuildMarksheet($marksheetId: Int!) {
15
+ restricted {
16
+ reBuildMarksheet(marksheetId: $marksheetId) {
17
+ id
18
+ createdAt
19
+ startedAt
20
+ endedAt
21
+ topicIds
22
+ topicNames
23
+ source
24
+ userId
25
+ user {
26
+ displayName
27
+ id
28
+ }
29
+ marks {
30
+ ...MarksheetMarkFields
31
+ }
32
+ mockTestId
33
+ correct
34
+ incorrect
35
+ totalQuestions
36
+ isTestMarksheet
37
+ }
38
+ }
39
+ }
40
+ `;
41
+ export const SAVE_MARKSHEET = gql `
42
+ mutation SaveMarksheet($marksheetInput: [MarksheetInput!]!) {
43
+ restricted {
44
+ saveMarksheets(marksheetInput: $marksheetInput) {
45
+ id
46
+ createdAt
47
+ startedAt
48
+ endedAt
49
+ topicIds
50
+ topicNames
51
+ source
52
+ userId
53
+ user {
54
+ displayName
55
+ id
56
+ }
57
+ marks {
58
+ id
59
+ marksheetId
60
+ questionChoiceId
61
+ timeTaken
62
+ flagged
63
+ mark
64
+ }
65
+ mockTestId
66
+ correct
67
+ incorrect
68
+ totalQuestions
69
+ isTestMarksheet
70
+ }
71
+ }
72
+ }
73
+ `;
74
+ export const ADD_FLAGGED_QUESTION = gql `
75
+ mutation AddFlaggedQuestion($markId: Int!, $questionId: Int!) {
76
+ restricted {
77
+ addFlaggedQuestion(markId: $markId, questionId: $questionId) {
78
+ id
79
+ }
80
+ }
81
+ }
82
+ `;
83
+ export const REMOVE_FLAGGED_QUESTION = gql `
84
+ mutation RemoveFlaggedQuestion($id: Int!) {
85
+ restricted {
86
+ removeFlaggedQuestion(id: $id) {
87
+ id
88
+ }
89
+ }
90
+ }
91
+ `;
@@ -1,15 +1,18 @@
1
1
  import { Id, IMarksheet, IMarksheetMark } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare const BUILD_MOCK_TEST_MARKSHEET: import("@apollo/client").DocumentNode;
3
4
  export interface IBuildMockTestMarksheetVar {
4
5
  mockTestId: Id;
5
6
  duration: number;
6
7
  }
7
8
  export declare type IBuildMockTestMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'buildMockTestMarksheet'>;
9
+ export declare const TOGGLE_FLAGGED_MARK: import("@apollo/client").DocumentNode;
8
10
  export interface IToggleFlaggedMarkVar {
9
11
  markId: Id;
10
12
  isFlagged: boolean;
11
13
  }
12
14
  export declare type IToggleFlaggedMarkData = RestrictedData<graphqlNormalize & IMarksheetMark, 'toggleFlaggedMark'>;
15
+ export declare const END_MOCK_TEST: import("@apollo/client").DocumentNode;
13
16
  export interface IEndMockTestVar {
14
17
  marksheetId: Id;
15
18
  }
@@ -1 +1,28 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const BUILD_MOCK_TEST_MARKSHEET = gql `
3
+ mutation BuildMockTestMarksheet($mockTestId: Int!, $duration: Int!) {
4
+ restricted {
5
+ buildMockTestMarksheet(mockTestId: $mockTestId, duration: $duration) {
6
+ id
7
+ }
8
+ }
9
+ }
10
+ `;
11
+ export const TOGGLE_FLAGGED_MARK = gql `
12
+ mutation ToggleFlaggedMark($markId: Int!, $isFlagged: Boolean!) {
13
+ restricted {
14
+ toggleFlaggedMark(markId: $markId, isFlagged: $isFlagged) {
15
+ id
16
+ }
17
+ }
18
+ }
19
+ `;
20
+ export const END_MOCK_TEST = gql `
21
+ mutation EndMockTest($marksheetId: Int!) {
22
+ restricted {
23
+ endMockTest(marksheetId: $marksheetId) {
24
+ id
25
+ }
26
+ }
27
+ }
28
+ `;
@@ -0,0 +1,28 @@
1
+ import { ENotificationActionType, ENotificationType, Id, INotification } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export interface IAddNotificationInput {
4
+ parentId: Id | null;
5
+ userId: Id | null;
6
+ commentId: Id | null;
7
+ conceptId: Id | null;
8
+ description: string;
9
+ actionType: ENotificationActionType;
10
+ type: ENotificationType;
11
+ _global: boolean;
12
+ _read: boolean;
13
+ _deleted: boolean;
14
+ }
15
+ export declare type IAddNotificationVar = {
16
+ data: IAddNotificationInput;
17
+ };
18
+ export declare type IAddNotificationData = RestrictedData<graphqlNormalize & INotification, 'addNotification'>;
19
+ export declare type IAddNotificationsVar = {
20
+ data: IAddNotificationInput[];
21
+ };
22
+ export declare type IAddNotificationsData = RestrictedData<graphqlNormalize & INotification[], 'addNotifications'>;
23
+ export declare type IMarkNotificationAsReadVar = {
24
+ id: Id;
25
+ };
26
+ export declare type IMarkNotificationAsReadData = RestrictedData<graphqlNormalize & INotification, 'markNotificationAsRead'>;
27
+ export declare type IMarkAllNotificationsAsReadVar = null;
28
+ export declare type IMarkAllNotificationsAsReadData = RestrictedData<graphqlNormalize & INotification[], 'markAllNotificationsAsRead'>;
@@ -1,21 +1,25 @@
1
1
  import { EQuestionLike, Id, IQuestion, IQuestionComment } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare const QUESTION_LIKE: import("@apollo/client").DocumentNode;
3
4
  export interface IQuestionLikeVar {
4
5
  questionId: Id;
5
6
  like: EQuestionLike;
6
7
  }
7
8
  export declare type IQuestionLikeData = RestrictedData<graphqlNormalize & IQuestion, 'questionLike'>;
9
+ export declare const QUESTION_COMMENTS: import("@apollo/client").DocumentNode;
8
10
  export interface IQuestionCommentsVar {
9
11
  questionId: Id;
10
- parentId: Id;
12
+ parentId?: Id;
11
13
  comment: string;
12
14
  }
13
15
  export declare type IQuestionCommentsData = RestrictedData<graphqlNormalize & IQuestionComment, 'questionComments'>;
16
+ export declare const QUESTION_COMMENT_LIKE: import("@apollo/client").DocumentNode;
14
17
  export interface IQuestionCommentsLikeVar {
15
18
  commentId: Id;
16
19
  like: EQuestionLike;
17
20
  }
18
21
  export declare type IQuestionCommentsLikeData = RestrictedData<graphqlNormalize & IQuestionComment, 'questionCommentLike'>;
22
+ export declare const QUESTION_COMMENT_REMOVE: import("@apollo/client").DocumentNode;
19
23
  export interface IQuestionCommentRemoveVar {
20
24
  commentId: Id;
21
25
  }
@@ -1 +1,151 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const QUESTION_LIKE = gql `
3
+ mutation QuestionLike($questionId: Int!, $like: Int!) {
4
+ restricted {
5
+ questionLike(questionId: $questionId, like: $like) {
6
+ id
7
+ likes
8
+ dislikes
9
+ isLikedByMe
10
+ comments {
11
+ id
12
+ userId
13
+ createdAt
14
+ comment
15
+ likes
16
+ user {
17
+ id
18
+ displayName
19
+ }
20
+ dislikes
21
+ isLikedByMe
22
+ questionId
23
+ replies {
24
+ id
25
+ userId
26
+ createdAt
27
+ comment
28
+ user {
29
+ id
30
+ displayName
31
+ }
32
+ likes
33
+ dislikes
34
+ isLikedByMe
35
+ questionId
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ `;
42
+ export const QUESTION_COMMENTS = gql `
43
+ mutation QuestionComments(
44
+ $questionId: Int!
45
+ $parentId: Int
46
+ $comment: String!
47
+ ) {
48
+ restricted {
49
+ questionComments(
50
+ questionId: $questionId
51
+ parentId: $parentId
52
+ comment: $comment
53
+ ) {
54
+ id
55
+ userId
56
+ createdAt
57
+ comment
58
+ likes
59
+ user {
60
+ id
61
+ displayName
62
+ }
63
+ dislikes
64
+ isLikedByMe
65
+ questionId
66
+ replies {
67
+ id
68
+ userId
69
+ createdAt
70
+ comment
71
+ user {
72
+ id
73
+ displayName
74
+ }
75
+ likes
76
+ dislikes
77
+ isLikedByMe
78
+ questionId
79
+ }
80
+ }
81
+ }
82
+ }
83
+ `;
84
+ export const QUESTION_COMMENT_LIKE = gql `
85
+ mutation QuestionCommentLike($commentId: Int!, $like: Int!) {
86
+ restricted {
87
+ questionCommentLike(commentId: $commentId, like: $like) {
88
+ id
89
+ userId
90
+ createdAt
91
+ comment
92
+ likes
93
+ user {
94
+ id
95
+ displayName
96
+ }
97
+ dislikes
98
+ isLikedByMe
99
+ questionId
100
+ replies {
101
+ id
102
+ userId
103
+ createdAt
104
+ comment
105
+ user {
106
+ id
107
+ displayName
108
+ }
109
+ likes
110
+ dislikes
111
+ isLikedByMe
112
+ questionId
113
+ }
114
+ }
115
+ }
116
+ }
117
+ `;
118
+ export const QUESTION_COMMENT_REMOVE = gql `
119
+ mutation QuestionCommentRemove($commentId: Int!) {
120
+ restricted {
121
+ questionCommentRemove(commentId: $commentId) {
122
+ id
123
+ userId
124
+ createdAt
125
+ comment
126
+ likes
127
+ user {
128
+ id
129
+ displayName
130
+ }
131
+ dislikes
132
+ isLikedByMe
133
+ questionId
134
+ replies {
135
+ id
136
+ userId
137
+ createdAt
138
+ comment
139
+ user {
140
+ id
141
+ displayName
142
+ }
143
+ likes
144
+ dislikes
145
+ isLikedByMe
146
+ questionId
147
+ }
148
+ }
149
+ }
150
+ }
151
+ `;
@@ -1,5 +1,8 @@
1
+ import { ApolloCache } from '@apollo/client';
1
2
  import { Id, ITodo } from '../../../models';
3
+ import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
2
4
  import { graphqlNormalize, RestrictedData } from '../../types';
5
+ export declare const BUILD_TODO: import("@apollo/client").DocumentNode;
3
6
  export interface IBuildTodoInput {
4
7
  unseen: number;
5
8
  seen: number;
@@ -15,18 +18,23 @@ export interface ITodoInput {
15
18
  score: number;
16
19
  timeTaken: number;
17
20
  }
21
+ export declare const SAVE_TODO: import("@apollo/client").DocumentNode;
18
22
  export interface ISaveTodosVar {
19
23
  todos: ITodoInput[];
20
24
  }
21
25
  export declare type ISaveTodosData = RestrictedData<(graphqlNormalize & ITodo)[], 'saveTodos'>;
26
+ export declare function saveTodosCache(cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ISaveTodosData>, options: ApolloUpdateOptions): void;
27
+ export declare const ADD_TO_DAILY_STACK: import("@apollo/client").DocumentNode;
22
28
  export interface IAddToDailyStackVar {
23
29
  conceptIds: Id[];
24
30
  }
25
31
  export declare type IAddToDailyStackData = RestrictedData<graphqlNormalize & ITodo, 'addToDailyStack'>;
32
+ export declare const REMOVE_FROM_DAILY_STACK: import("@apollo/client").DocumentNode;
26
33
  export interface IRemoveFromDailyStackVar {
27
34
  cardId: Id;
28
35
  todoId: Id;
29
36
  }
30
37
  export declare type IRemoveFromDailyStackData = RestrictedData<graphqlNormalize & ITodo, 'removeFromDailyStack'>;
38
+ export declare const REFRESH_DAILY_TASK: import("@apollo/client").DocumentNode;
31
39
  export declare type IRefreshDailyTaskVar = null;
32
40
  export declare type IRefreshDailyTaskData = RestrictedData<graphqlNormalize & ITodo, 'refreshDailyTask'>;
@@ -1 +1,148 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ import { PICTURE_FIELDS } from '../../fragments';
3
+ export const BUILD_TODO = gql `
4
+ mutation BuildTodo($buildTodo: BuildTodoInput!) {
5
+ restricted {
6
+ buildTodo(buildTodo: $buildTodo) {
7
+ id
8
+ }
9
+ }
10
+ }
11
+ `;
12
+ export const SAVE_TODO = gql `
13
+ mutation SaveTodo($todos: [TodoInput!]!) {
14
+ restricted {
15
+ saveTodos(todos: $todos) {
16
+ id
17
+ dailyTask
18
+ source
19
+ marks {
20
+ id
21
+ cardId
22
+ score
23
+ timeTaken
24
+ card {
25
+ question
26
+ explanation
27
+ concept {
28
+ id
29
+ videos {
30
+ id
31
+ title
32
+ museId
33
+ thumbnail
34
+ concepts {
35
+ id
36
+ name
37
+ }
38
+ live
39
+ description
40
+ duration
41
+ }
42
+ }
43
+ pictures {
44
+ id
45
+ caption
46
+ path
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ `;
54
+ export function saveTodosCache(cache, result, options) {
55
+ const { saveTodos } = result?.data?.restricted || {};
56
+ if (!options.variables || !saveTodos) {
57
+ return;
58
+ }
59
+ for (let i = 0; i < saveTodos.length; i++) {
60
+ const todoMark = options.variables.todos[i];
61
+ const todoMarkId = saveTodos[i];
62
+ cache.writeFragment({
63
+ id: cache.identify({ id: todoMarkId, __typename: 'TodoMark' }),
64
+ data: {
65
+ score: todoMark.score,
66
+ timeTaken: todoMark.timeTaken || 0,
67
+ },
68
+ fragment: gql `
69
+ fragment NewTodoMark on TodoMark {
70
+ score
71
+ timeTaken
72
+ }
73
+ `,
74
+ });
75
+ }
76
+ }
77
+ export const ADD_TO_DAILY_STACK = gql `
78
+ ${PICTURE_FIELDS}
79
+ mutation AddToDailyStack($conceptIds: [Int!]!) {
80
+ restricted {
81
+ addToDailyStack(conceptIds: $conceptIds) {
82
+ id
83
+ dailyTask
84
+ marks {
85
+ id
86
+ cardId
87
+ card {
88
+ id
89
+ question
90
+ explanation
91
+ pictures {
92
+ ...PictureFields
93
+ }
94
+ }
95
+ score
96
+ timeTaken
97
+ }
98
+ source
99
+ }
100
+ }
101
+ }
102
+ `;
103
+ export const REMOVE_FROM_DAILY_STACK = gql `
104
+ mutation RemoveFromDailyStack($cardId: Int!, $todoId: Int!) {
105
+ restricted {
106
+ removeFromDailyStack(cardId: $cardId, todoId: $todoId) {
107
+ id
108
+ dailyTask
109
+ source
110
+ marks {
111
+ cardId
112
+ score
113
+ timeTaken
114
+ card {
115
+ question
116
+ explanation
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ `;
123
+ export const REFRESH_DAILY_TASK = gql `
124
+ ${PICTURE_FIELDS}
125
+ mutation RefreshDailyTask {
126
+ restricted {
127
+ refreshDailyTask {
128
+ id
129
+ dailyTask
130
+ marks {
131
+ id
132
+ cardId
133
+ card {
134
+ id
135
+ question
136
+ explanation
137
+ pictures {
138
+ ...PictureFields
139
+ }
140
+ }
141
+ score
142
+ timeTaken
143
+ }
144
+ source
145
+ }
146
+ }
147
+ }
148
+ `;
@@ -1,5 +1,6 @@
1
1
  import { IToken } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare const UPSERT_TOKEN: import("@apollo/client").DocumentNode;
3
4
  export interface IUpsertTokenVar {
4
5
  token: string;
5
6
  deviceId: string;
@@ -9,6 +10,7 @@ export interface IRemoveTokenVar {
9
10
  token: string;
10
11
  }
11
12
  export declare type IRemoveTokenData = RestrictedData<string, 'removeToken'>;
13
+ export declare const REMOVE_TOKEN: import("@apollo/client").DocumentNode;
12
14
  export interface ISubscribeFCMTopicVar {
13
15
  token: string;
14
16
  topic: string;
@@ -1 +1,18 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const UPSERT_TOKEN = gql `
3
+ mutation UpsertToken($token: String!, $deviceId: String!) {
4
+ restricted {
5
+ upsertToken(token: $token, deviceId: $deviceId) {
6
+ token
7
+ deviceId
8
+ }
9
+ }
10
+ }
11
+ `;
12
+ export const REMOVE_TOKEN = gql `
13
+ mutation RemoveToken($token: String!) {
14
+ restricted {
15
+ removeToken(token: $token)
16
+ }
17
+ }
18
+ `;
@@ -1,5 +1,6 @@
1
1
  import { IUser } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare const RESET_PROGRESS: import("@apollo/client").DocumentNode;
3
4
  export interface IResetProgressVar {
4
5
  questions?: boolean;
5
6
  cards?: boolean;
@@ -17,11 +18,13 @@ export interface IUserInput {
17
18
  dailyFeedResetTime?: number;
18
19
  dailyFeedMax?: number;
19
20
  }
21
+ export declare const UPDATE_USER: import("@apollo/client").DocumentNode;
20
22
  export interface IUpdateUserVar {
21
23
  id?: number;
22
24
  data: IUserInput;
23
25
  }
24
26
  export declare type IUpdateUserData = RestrictedData<string, 'updateUser'>;
27
+ export declare const RENEW_TOKEN: import("@apollo/client").DocumentNode;
25
28
  export declare type IRenewTokenVar = null;
26
29
  export declare type IRenewTokenData = RestrictedData<string, 'renewToken'>;
27
30
  export declare const TOC_ACCEPT: import("@apollo/client").DocumentNode;
@@ -1,4 +1,27 @@
1
1
  import { gql } from '@apollo/client';
2
+ export const RESET_PROGRESS = gql `
3
+ mutation ResetProgress($questions: Boolean, $cards: Boolean) {
4
+ restricted {
5
+ resetProgress(questions: $questions, cards: $cards) {
6
+ id
7
+ }
8
+ }
9
+ }
10
+ `;
11
+ export const UPDATE_USER = gql `
12
+ mutation UpdateUser($id: Int, $data: UserInput!) {
13
+ restricted {
14
+ updateUser(id: $id, data: $data)
15
+ }
16
+ }
17
+ `;
18
+ export const RENEW_TOKEN = gql `
19
+ mutation RenewToken {
20
+ restricted {
21
+ renewToken
22
+ }
23
+ }
24
+ `;
2
25
  export const TOC_ACCEPT = gql `
3
26
  mutation TocAccept {
4
27
  restricted {
@@ -1,5 +1,6 @@
1
1
  import { Id, IVideo } from '../../../models';
2
2
  import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare const VIDEO_WATCHED: import("@apollo/client").DocumentNode;
3
4
  export interface IVideoWatchedVar {
4
5
  id: Id;
5
6
  }
@@ -1 +1,12 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const VIDEO_WATCHED = gql `
3
+ mutation VideoWatched($id: Int!) {
4
+ restricted {
5
+ videoWatched(id: $id) {
6
+ id
7
+ views
8
+ viewsToday
9
+ }
10
+ }
11
+ }
12
+ `;
@@ -1,10 +1,12 @@
1
1
  import { RootData } from './../types';
2
+ export declare const CUSTOMER_PORTAL: import("@apollo/client").DocumentNode;
2
3
  export declare type ICustomerPortalVar = null;
3
4
  export declare type ICustomerPortalData = RootData<string, 'customerPortal'>;
4
5
  export interface IStripeLineItem {
5
6
  price: string;
6
7
  quantity: number;
7
8
  }
9
+ export declare const STRIPE_HOMEPAGE_CHECKOUT_SESSION: import("@apollo/client").DocumentNode;
8
10
  export interface IStripeHomepageCheckoutSessionVar {
9
11
  lineItems: IStripeLineItem[];
10
12
  }