@quesmed/types 2.0.16 → 2.1.2

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 (167) hide show
  1. package/dist/cjs/gql_input_output_types/index.d.ts +2 -2
  2. package/dist/cjs/models/OsceMarksheet.d.ts +0 -1
  3. package/dist/cjs/models/Question.d.ts +3 -0
  4. package/dist/cjs/models/Type.d.ts +1 -0
  5. package/dist/cjs/resolvers/apollo.d.ts +1 -3
  6. package/dist/cjs/resolvers/fragments/chapter.js +14 -3
  7. package/dist/cjs/resolvers/fragments/index.d.ts +2 -0
  8. package/dist/cjs/resolvers/fragments/index.js +2 -0
  9. package/dist/cjs/resolvers/fragments/marksheet.d.ts +1 -0
  10. package/dist/cjs/resolvers/fragments/marksheet.js +109 -0
  11. package/dist/cjs/resolvers/fragments/mockTest.d.ts +1 -0
  12. package/dist/cjs/resolvers/fragments/mockTest.js +16 -0
  13. package/dist/cjs/resolvers/fragments/osce.js +1 -1
  14. package/dist/cjs/resolvers/fragments/topic.d.ts +1 -0
  15. package/dist/cjs/resolvers/fragments/topic.js +18 -0
  16. package/dist/cjs/resolvers/fragments/user.js +3 -3
  17. package/dist/cjs/resolvers/mutation/admin/algoliaSync.d.ts +4 -0
  18. package/dist/cjs/resolvers/mutation/admin/algoliaSync.js +30 -0
  19. package/dist/cjs/resolvers/mutation/admin/token.d.ts +2 -0
  20. package/dist/cjs/resolvers/mutation/admin/token.js +16 -0
  21. package/dist/cjs/resolvers/mutation/restricted/contactUs.d.ts +1 -0
  22. package/dist/cjs/resolvers/mutation/restricted/contactUs.js +13 -0
  23. package/dist/cjs/resolvers/mutation/restricted/marksheet.d.ts +5 -0
  24. package/dist/cjs/resolvers/mutation/restricted/marksheet.js +92 -0
  25. package/dist/cjs/resolvers/mutation/restricted/mockTest.d.ts +3 -0
  26. package/dist/cjs/resolvers/mutation/restricted/mockTest.js +29 -0
  27. package/dist/cjs/resolvers/mutation/restricted/questionDiscussion.d.ts +5 -1
  28. package/dist/cjs/resolvers/mutation/restricted/questionDiscussion.js +152 -0
  29. package/dist/cjs/resolvers/mutation/restricted/todo.d.ts +8 -0
  30. package/dist/cjs/resolvers/mutation/restricted/todo.js +150 -0
  31. package/dist/cjs/resolvers/mutation/restricted/token.d.ts +2 -0
  32. package/dist/cjs/resolvers/mutation/restricted/token.js +19 -0
  33. package/dist/cjs/resolvers/mutation/restricted/users.d.ts +3 -0
  34. package/dist/cjs/resolvers/mutation/restricted/users.js +24 -1
  35. package/dist/cjs/resolvers/mutation/restricted/video.d.ts +1 -0
  36. package/dist/cjs/resolvers/mutation/restricted/video.js +13 -0
  37. package/dist/cjs/resolvers/mutation/stripe.d.ts +2 -0
  38. package/dist/cjs/resolvers/mutation/stripe.js +12 -0
  39. package/dist/cjs/resolvers/mutation/users.d.ts +4 -0
  40. package/dist/cjs/resolvers/mutation/users.js +22 -0
  41. package/dist/cjs/resolvers/mutation/validUserToken/user.d.ts +2 -0
  42. package/dist/cjs/resolvers/mutation/validUserToken/user.js +16 -0
  43. package/dist/cjs/resolvers/query/admin/getUserToken.d.ts +1 -0
  44. package/dist/cjs/resolvers/query/admin/getUserToken.js +9 -0
  45. package/dist/cjs/resolvers/query/author.d.ts +1 -0
  46. package/dist/cjs/resolvers/query/author.js +16 -0
  47. package/dist/cjs/resolvers/query/book.d.ts +3 -1
  48. package/dist/cjs/resolvers/query/book.js +42 -0
  49. package/dist/cjs/resolvers/query/feedback.d.ts +2 -0
  50. package/dist/cjs/resolvers/query/feedback.js +12 -0
  51. package/dist/cjs/resolvers/query/restricted/global.d.ts +2 -0
  52. package/dist/cjs/resolvers/query/restricted/global.js +16 -0
  53. package/dist/cjs/resolvers/query/restricted/index.d.ts +1 -0
  54. package/dist/cjs/resolvers/query/restricted/index.js +1 -0
  55. package/dist/cjs/resolvers/query/restricted/marksheet.d.ts +6 -0
  56. package/dist/cjs/resolvers/query/restricted/marksheet.js +996 -0
  57. package/dist/cjs/resolvers/query/restricted/mockTests.d.ts +2 -0
  58. package/dist/cjs/resolvers/query/restricted/mockTests.js +23 -0
  59. package/dist/cjs/resolvers/query/restricted/osce.js +2 -2
  60. package/dist/cjs/resolvers/query/restricted/qBank.d.ts +18 -0
  61. package/dist/cjs/resolvers/query/restricted/qBank.js +77 -0
  62. package/dist/cjs/resolvers/query/restricted/quesBook.d.ts +2 -1
  63. package/dist/cjs/resolvers/query/restricted/quesBook.js +39 -1
  64. package/dist/cjs/resolvers/query/restricted/replication.d.ts +2 -3
  65. package/dist/cjs/resolvers/query/restricted/todos.d.ts +2 -0
  66. package/dist/cjs/resolvers/query/restricted/todos.js +63 -0
  67. package/dist/cjs/resolvers/query/restricted/topics.d.ts +2 -0
  68. package/dist/cjs/resolvers/query/restricted/topics.js +38 -0
  69. package/dist/cjs/resolvers/query/restricted/university.d.ts +1 -0
  70. package/dist/cjs/resolvers/query/restricted/university.js +23 -0
  71. package/dist/cjs/resolvers/query/restricted/user.d.ts +2 -2
  72. package/dist/cjs/resolvers/query/restricted/user.js +24 -0
  73. package/dist/cjs/resolvers/query/restricted/video.d.ts +5 -3
  74. package/dist/cjs/resolvers/query/restricted/video.js +98 -0
  75. package/dist/cjs/resolvers/query/sample.js +4 -0
  76. package/dist/cjs/resolvers/query/subscription.d.ts +1 -0
  77. package/dist/cjs/resolvers/query/subscription.js +18 -0
  78. package/dist/cjs/resolvers/query/university.d.ts +1 -0
  79. package/dist/cjs/resolvers/query/university.js +10 -0
  80. package/dist/cjs/resolvers/query/user.d.ts +2 -0
  81. package/dist/cjs/resolvers/query/user.js +12 -0
  82. package/dist/cjs/resolvers/query/video.d.ts +4 -1
  83. package/dist/cjs/resolvers/query/video.js +99 -0
  84. package/dist/mjs/gql_input_output_types/index.d.ts +2 -2
  85. package/dist/mjs/models/OsceMarksheet.d.ts +0 -1
  86. package/dist/mjs/models/Question.d.ts +3 -0
  87. package/dist/mjs/models/Type.d.ts +1 -0
  88. package/dist/mjs/resolvers/apollo.d.ts +1 -3
  89. package/dist/mjs/resolvers/fragments/chapter.js +14 -3
  90. package/dist/mjs/resolvers/fragments/index.d.ts +2 -0
  91. package/dist/mjs/resolvers/fragments/index.js +2 -0
  92. package/dist/mjs/resolvers/fragments/marksheet.d.ts +1 -0
  93. package/dist/mjs/resolvers/fragments/marksheet.js +106 -0
  94. package/dist/mjs/resolvers/fragments/mockTest.d.ts +1 -0
  95. package/dist/mjs/resolvers/fragments/mockTest.js +13 -0
  96. package/dist/mjs/resolvers/fragments/osce.js +1 -1
  97. package/dist/mjs/resolvers/fragments/topic.d.ts +1 -0
  98. package/dist/mjs/resolvers/fragments/topic.js +15 -0
  99. package/dist/mjs/resolvers/fragments/user.js +3 -3
  100. package/dist/mjs/resolvers/mutation/admin/algoliaSync.d.ts +4 -0
  101. package/dist/mjs/resolvers/mutation/admin/algoliaSync.js +29 -1
  102. package/dist/mjs/resolvers/mutation/admin/token.d.ts +2 -0
  103. package/dist/mjs/resolvers/mutation/admin/token.js +15 -1
  104. package/dist/mjs/resolvers/mutation/restricted/contactUs.d.ts +1 -0
  105. package/dist/mjs/resolvers/mutation/restricted/contactUs.js +12 -1
  106. package/dist/mjs/resolvers/mutation/restricted/marksheet.d.ts +5 -0
  107. package/dist/mjs/resolvers/mutation/restricted/marksheet.js +91 -1
  108. package/dist/mjs/resolvers/mutation/restricted/mockTest.d.ts +3 -0
  109. package/dist/mjs/resolvers/mutation/restricted/mockTest.js +28 -1
  110. package/dist/mjs/resolvers/mutation/restricted/questionDiscussion.d.ts +5 -1
  111. package/dist/mjs/resolvers/mutation/restricted/questionDiscussion.js +151 -1
  112. package/dist/mjs/resolvers/mutation/restricted/todo.d.ts +8 -0
  113. package/dist/mjs/resolvers/mutation/restricted/todo.js +148 -1
  114. package/dist/mjs/resolvers/mutation/restricted/token.d.ts +2 -0
  115. package/dist/mjs/resolvers/mutation/restricted/token.js +18 -1
  116. package/dist/mjs/resolvers/mutation/restricted/users.d.ts +3 -0
  117. package/dist/mjs/resolvers/mutation/restricted/users.js +23 -0
  118. package/dist/mjs/resolvers/mutation/restricted/video.d.ts +1 -0
  119. package/dist/mjs/resolvers/mutation/restricted/video.js +12 -1
  120. package/dist/mjs/resolvers/mutation/stripe.d.ts +2 -0
  121. package/dist/mjs/resolvers/mutation/stripe.js +11 -1
  122. package/dist/mjs/resolvers/mutation/users.d.ts +4 -0
  123. package/dist/mjs/resolvers/mutation/users.js +21 -1
  124. package/dist/mjs/resolvers/mutation/validUserToken/user.d.ts +2 -0
  125. package/dist/mjs/resolvers/mutation/validUserToken/user.js +15 -1
  126. package/dist/mjs/resolvers/query/admin/getUserToken.d.ts +1 -0
  127. package/dist/mjs/resolvers/query/admin/getUserToken.js +8 -1
  128. package/dist/mjs/resolvers/query/author.d.ts +1 -0
  129. package/dist/mjs/resolvers/query/author.js +15 -1
  130. package/dist/mjs/resolvers/query/book.d.ts +3 -1
  131. package/dist/mjs/resolvers/query/book.js +41 -1
  132. package/dist/mjs/resolvers/query/feedback.d.ts +2 -0
  133. package/dist/mjs/resolvers/query/feedback.js +11 -1
  134. package/dist/mjs/resolvers/query/restricted/global.d.ts +2 -0
  135. package/dist/mjs/resolvers/query/restricted/global.js +15 -1
  136. package/dist/mjs/resolvers/query/restricted/index.d.ts +1 -0
  137. package/dist/mjs/resolvers/query/restricted/index.js +1 -0
  138. package/dist/mjs/resolvers/query/restricted/marksheet.d.ts +6 -0
  139. package/dist/mjs/resolvers/query/restricted/marksheet.js +995 -1
  140. package/dist/mjs/resolvers/query/restricted/mockTests.d.ts +2 -0
  141. package/dist/mjs/resolvers/query/restricted/mockTests.js +22 -1
  142. package/dist/mjs/resolvers/query/restricted/osce.js +2 -2
  143. package/dist/mjs/resolvers/query/restricted/qBank.d.ts +18 -0
  144. package/dist/mjs/resolvers/query/restricted/qBank.js +74 -0
  145. package/dist/mjs/resolvers/query/restricted/quesBook.d.ts +2 -1
  146. package/dist/mjs/resolvers/query/restricted/quesBook.js +38 -0
  147. package/dist/mjs/resolvers/query/restricted/replication.d.ts +2 -3
  148. package/dist/mjs/resolvers/query/restricted/todos.d.ts +2 -0
  149. package/dist/mjs/resolvers/query/restricted/todos.js +62 -1
  150. package/dist/mjs/resolvers/query/restricted/topics.d.ts +2 -0
  151. package/dist/mjs/resolvers/query/restricted/topics.js +37 -1
  152. package/dist/mjs/resolvers/query/restricted/university.d.ts +1 -0
  153. package/dist/mjs/resolvers/query/restricted/university.js +22 -1
  154. package/dist/mjs/resolvers/query/restricted/user.d.ts +2 -2
  155. package/dist/mjs/resolvers/query/restricted/user.js +23 -1
  156. package/dist/mjs/resolvers/query/restricted/video.d.ts +5 -3
  157. package/dist/mjs/resolvers/query/restricted/video.js +97 -1
  158. package/dist/mjs/resolvers/query/sample.js +4 -0
  159. package/dist/mjs/resolvers/query/subscription.d.ts +1 -0
  160. package/dist/mjs/resolvers/query/subscription.js +17 -1
  161. package/dist/mjs/resolvers/query/university.d.ts +1 -0
  162. package/dist/mjs/resolvers/query/university.js +9 -1
  163. package/dist/mjs/resolvers/query/user.d.ts +2 -0
  164. package/dist/mjs/resolvers/query/user.js +11 -1
  165. package/dist/mjs/resolvers/query/video.d.ts +4 -1
  166. package/dist/mjs/resolvers/query/video.js +98 -1
  167. package/package.json +4 -4
@@ -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
  }
@@ -1 +1,11 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const CUSTOMER_PORTAL = gql `
3
+ mutation CustomerPortal {
4
+ customerPortal
5
+ }
6
+ `;
7
+ export const STRIPE_HOMEPAGE_CHECKOUT_SESSION = gql `
8
+ mutation StripeHomepageCheckoutSession($lineItems: [LineItemInput!]!) {
9
+ stripeHomepageCheckoutSession(lineItems: $lineItems)
10
+ }
11
+ `;
@@ -1,10 +1,12 @@
1
1
  import { RootData } from '../types';
2
+ export declare const LOGIN_USER: import("@apollo/client").DocumentNode;
2
3
  export interface ILoginUserVar {
3
4
  username: string;
4
5
  password: string;
5
6
  days: number;
6
7
  }
7
8
  export declare type ILoginUserData = RootData<string, 'loginUser'>;
9
+ export declare const REGISTER_USER: import("@apollo/client").DocumentNode;
8
10
  export interface RegisterUserInput {
9
11
  displayName: string;
10
12
  username: string;
@@ -21,10 +23,12 @@ export interface IRegisterUserVar {
21
23
  userData: RegisterUserInput;
22
24
  }
23
25
  export declare type IRegisterUserData = RootData<string, 'registerUser'>;
26
+ export declare const RESET_PASSWORD_PREP: import("@apollo/client").DocumentNode;
24
27
  export interface IResetPasswordPrepVar {
25
28
  username: string;
26
29
  }
27
30
  export declare type IResetPasswordPrepData = RootData<string, 'resetPasswordPrep'>;
31
+ export declare const RESET_PASSWORD: import("@apollo/client").DocumentNode;
28
32
  export interface IResetPasswordVar {
29
33
  token: string;
30
34
  password: string;
@@ -1 +1,21 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const LOGIN_USER = gql `
3
+ mutation LoginUser($username: String!, $password: String!, $days: Int!) {
4
+ loginUser(username: $username, password: $password, days: $days)
5
+ }
6
+ `;
7
+ export const REGISTER_USER = gql `
8
+ mutation RegisterUser($userData: RegisterUser!) {
9
+ registerUser(userData: $userData)
10
+ }
11
+ `;
12
+ export const RESET_PASSWORD_PREP = gql `
13
+ mutation ResetPasswordPrep($username: String!) {
14
+ resetPasswordPrep(username: $username)
15
+ }
16
+ `;
17
+ export const RESET_PASSWORD = gql `
18
+ mutation ResetPassword($password: String!, $token: String!) {
19
+ resetPassword(password: $password, token: $token)
20
+ }
21
+ `;
@@ -1,3 +1,4 @@
1
+ export declare const CREATE_NEW_SUBSCRIPTION_CHECKOUT_SESSION: import("@apollo/client").DocumentNode;
1
2
  export interface ICreateNewSubscriptionCheckoutSessionVar {
2
3
  priceId: string;
3
4
  }
@@ -12,3 +13,4 @@ export declare type IRenewTokenData = {
12
13
  renewToken: string;
13
14
  };
14
15
  };
16
+ export declare const VALID_USER_TOKEN: import("@apollo/client").DocumentNode;
@@ -1 +1,15 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const CREATE_NEW_SUBSCRIPTION_CHECKOUT_SESSION = gql `
3
+ mutation CreateNewSubscriptionCheckoutSession($priceId: String!) {
4
+ validUserToken {
5
+ createNewSubscriptionCheckoutSession(priceId: $priceId)
6
+ }
7
+ }
8
+ `;
9
+ export const VALID_USER_TOKEN = gql `
10
+ mutation ValidUserToken {
11
+ validUserToken {
12
+ renewToken
13
+ }
14
+ }
15
+ `;
@@ -3,3 +3,4 @@ export interface IGetUserTokenVar {
3
3
  username: string;
4
4
  }
5
5
  export declare type IGetUserTokenData = AdminData<string, 'getUserToken'>;
6
+ export declare const GET_USER_TOKEN: import("@apollo/client").DocumentNode;
@@ -1 +1,8 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const GET_USER_TOKEN = gql `
3
+ query getUserToken($username: String!) {
4
+ admin {
5
+ getUserToken(username: $username)
6
+ }
7
+ }
8
+ `;
@@ -1,3 +1,4 @@
1
1
  import { IAuthor } from '../../models';
2
2
  import { graphqlNormalize, RootData } from '../types';
3
3
  export declare type IAuthorsData = RootData<(graphqlNormalize & IAuthor)[], 'authors'>;
4
+ export declare const AUTHORS: import("@apollo/client").DocumentNode;
@@ -1 +1,15 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const AUTHORS = gql `
3
+ query Authors {
4
+ authors {
5
+ id
6
+ name
7
+ qualifications
8
+ title
9
+ description
10
+ avatar
11
+ linkedIn
12
+ twitter
13
+ }
14
+ }
15
+ `;
@@ -1,8 +1,10 @@
1
1
  import { IBook } from '../../models';
2
2
  import { graphqlNormalize, RootData } from './../types';
3
- export declare type IBooksData = RootData<(graphqlNormalize & IBook)[], 'book'>;
3
+ export declare type IBooksData = RootData<(graphqlNormalize & IBook)[], 'books'>;
4
4
  export declare type IBooksVar = null;
5
+ export declare const BOOKS: import("@apollo/client").DocumentNode;
5
6
  export declare type IBookData = RootData<graphqlNormalize & IBook, 'book'>;
6
7
  export interface IBookVar {
7
8
  id: number;
8
9
  }
10
+ export declare const BOOK: import("@apollo/client").DocumentNode;
@@ -1 +1,41 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const BOOKS = gql `
3
+ query Books {
4
+ books {
5
+ id
6
+ name
7
+ avatar
8
+ }
9
+ }
10
+ `;
11
+ export const BOOK = gql `
12
+ query Book($bookId: Int!) {
13
+ book(id: $bookId) {
14
+ id
15
+ name
16
+ publishDate
17
+ publisher
18
+ pages
19
+ language
20
+ format
21
+ avatar
22
+ price
23
+ ISBN
24
+ type
25
+ description
26
+ heroImg
27
+ chapters
28
+ stripePriceId
29
+ authors {
30
+ id
31
+ name
32
+ linkedIn
33
+ avatar
34
+ description
35
+ title
36
+ qualifications
37
+ twitter
38
+ }
39
+ }
40
+ }
41
+ `;
@@ -1,3 +1,5 @@
1
1
  import { IFeedback } from '../../models';
2
2
  import { graphqlNormalize, RootData } from '../types';
3
3
  export declare type IFeedbackData = RootData<(graphqlNormalize & IFeedback)[], 'feedback'>;
4
+ export declare type IFeedbackVar = null;
5
+ export declare const FEEDBACK: import("@apollo/client").DocumentNode;