@quesmed/types 1.3.18 → 1.3.20

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 (223) hide show
  1. package/gql_input_output_types/User.js +2 -1
  2. package/gql_input_output_types/User.mjs +1 -0
  3. package/gql_input_output_types/index.d.ts +1 -0
  4. package/gql_input_output_types/index.js +2 -1
  5. package/gql_input_output_types/index.mjs +1 -0
  6. package/index.js +7 -4
  7. package/{index.cjs → index.mjs} +4 -7
  8. package/models/Author.js +2 -1
  9. package/models/Author.mjs +1 -0
  10. package/models/Book.js +2 -1
  11. package/models/Book.mjs +1 -0
  12. package/models/Card.js +2 -1
  13. package/models/Card.mjs +1 -0
  14. package/models/Chapter.js +2 -1
  15. package/models/Chapter.mjs +1 -0
  16. package/models/Concept.js +2 -1
  17. package/models/Concept.mjs +1 -0
  18. package/models/Difficulty.js +5 -2
  19. package/models/{Difficulty.cjs → Difficulty.mjs} +2 -5
  20. package/models/Feedback.js +2 -1
  21. package/models/Feedback.mjs +1 -0
  22. package/models/File.js +2 -1
  23. package/models/File.mjs +1 -0
  24. package/models/Marksheet.js +5 -2
  25. package/models/Marksheet.mjs +6 -0
  26. package/models/MockTest.js +2 -1
  27. package/models/MockTest.mjs +1 -0
  28. package/models/OsceMarksheet.js +7 -4
  29. package/models/{OsceMarksheet.cjs → OsceMarksheet.mjs} +4 -7
  30. package/models/OsceStation.js +6 -3
  31. package/models/{OsceStation.cjs → OsceStation.mjs} +3 -6
  32. package/models/Picture.js +2 -1
  33. package/models/Picture.mjs +5 -0
  34. package/models/Promo.js +2 -1
  35. package/models/Promo.mjs +1 -0
  36. package/models/Question.js +15 -8
  37. package/models/{Question.cjs → Question.mjs} +8 -15
  38. package/models/Subscription.js +5 -2
  39. package/models/{Subscription.cjs → Subscription.mjs} +2 -5
  40. package/models/Todo.js +2 -1
  41. package/models/Todo.mjs +1 -0
  42. package/models/Token.js +2 -1
  43. package/models/Token.mjs +1 -0
  44. package/models/Topic.js +5 -2
  45. package/models/{Topic.cjs → Topic.mjs} +2 -5
  46. package/models/Type.js +2 -1
  47. package/models/Type.mjs +1 -0
  48. package/models/University.js +2 -1
  49. package/models/University.mjs +1 -0
  50. package/models/User.js +2 -1
  51. package/models/User.mjs +1 -0
  52. package/models/Video.js +2 -1
  53. package/models/Video.mjs +1 -0
  54. package/models/index.js +35 -23
  55. package/models/index.mjs +23 -0
  56. package/package.json +3 -3
  57. package/resolvers/apollo.js +2 -1
  58. package/resolvers/apollo.mjs +1 -0
  59. package/resolvers/mutation/admin/algoliaSync.js +2 -1
  60. package/resolvers/mutation/admin/algoliaSync.mjs +1 -0
  61. package/resolvers/mutation/admin/index.js +14 -2
  62. package/resolvers/mutation/admin/index.mjs +2 -0
  63. package/resolvers/mutation/admin/token.js +2 -1
  64. package/resolvers/mutation/admin/token.mjs +1 -0
  65. package/resolvers/mutation/index.js +14 -2
  66. package/resolvers/mutation/index.mjs +2 -0
  67. package/resolvers/mutation/restricted/agora.js +2 -1
  68. package/resolvers/mutation/restricted/agora.mjs +1 -0
  69. package/resolvers/mutation/restricted/contactUs.js +2 -1
  70. package/resolvers/mutation/restricted/contactUs.mjs +1 -0
  71. package/resolvers/mutation/restricted/index.js +22 -10
  72. package/resolvers/mutation/restricted/index.mjs +10 -0
  73. package/resolvers/mutation/restricted/marksheet.js +2 -1
  74. package/resolvers/mutation/restricted/marksheet.mjs +1 -0
  75. package/resolvers/mutation/restricted/mockTest.js +2 -1
  76. package/resolvers/mutation/restricted/mockTest.mjs +1 -0
  77. package/resolvers/mutation/restricted/osce.js +2 -1
  78. package/resolvers/mutation/restricted/osce.mjs +1 -0
  79. package/resolvers/mutation/restricted/questionDiscussion.js +2 -1
  80. package/resolvers/mutation/restricted/questionDiscussion.mjs +1 -0
  81. package/resolvers/mutation/restricted/todo.js +7 -3
  82. package/resolvers/mutation/restricted/{todo.cjs → todo.mjs} +3 -7
  83. package/resolvers/mutation/restricted/token.js +2 -1
  84. package/resolvers/mutation/restricted/token.mjs +1 -0
  85. package/resolvers/mutation/restricted/users.js +2 -1
  86. package/resolvers/mutation/restricted/users.mjs +1 -0
  87. package/resolvers/mutation/restricted/video.js +2 -1
  88. package/resolvers/mutation/restricted/video.mjs +1 -0
  89. package/resolvers/mutation/stripe.js +2 -1
  90. package/resolvers/mutation/stripe.mjs +1 -0
  91. package/resolvers/mutation/users.js +2 -1
  92. package/resolvers/mutation/users.mjs +1 -0
  93. package/resolvers/mutation/validUserToken/index.js +13 -1
  94. package/resolvers/mutation/validUserToken/index.mjs +1 -0
  95. package/resolvers/mutation/validUserToken/user.js +2 -1
  96. package/resolvers/mutation/validUserToken/user.mjs +1 -0
  97. package/resolvers/query/admin/getUserToken.js +2 -1
  98. package/resolvers/query/admin/getUserToken.mjs +1 -0
  99. package/resolvers/query/admin/index.js +13 -1
  100. package/resolvers/query/admin/index.mjs +1 -0
  101. package/resolvers/query/author.js +2 -1
  102. package/resolvers/query/author.mjs +1 -0
  103. package/resolvers/query/book.js +2 -1
  104. package/resolvers/query/book.mjs +1 -0
  105. package/resolvers/query/feedback.js +2 -1
  106. package/resolvers/query/feedback.mjs +1 -0
  107. package/resolvers/query/index.js +21 -9
  108. package/resolvers/query/index.mjs +9 -0
  109. package/resolvers/query/restricted/anatomy.js +2 -1
  110. package/resolvers/query/restricted/anatomy.mjs +1 -0
  111. package/resolvers/query/restricted/index.js +22 -10
  112. package/resolvers/query/restricted/index.mjs +10 -0
  113. package/resolvers/query/restricted/marksheet.js +2 -1
  114. package/resolvers/query/restricted/marksheet.mjs +1 -0
  115. package/resolvers/query/restricted/mockTests.js +2 -1
  116. package/resolvers/query/restricted/mockTests.mjs +1 -0
  117. package/resolvers/query/restricted/osce.js +2 -1
  118. package/resolvers/query/restricted/osce.mjs +1 -0
  119. package/resolvers/query/restricted/quesBook.js +2 -1
  120. package/resolvers/query/restricted/quesBook.mjs +1 -0
  121. package/resolvers/query/restricted/todos.js +2 -1
  122. package/resolvers/query/restricted/todos.mjs +1 -0
  123. package/resolvers/query/restricted/topics.js +2 -1
  124. package/resolvers/query/restricted/topics.mjs +1 -0
  125. package/resolvers/query/restricted/university.js +2 -1
  126. package/resolvers/query/restricted/university.mjs +1 -0
  127. package/resolvers/query/restricted/user.js +2 -1
  128. package/resolvers/query/restricted/user.mjs +1 -0
  129. package/resolvers/query/restricted/video.js +2 -1
  130. package/resolvers/query/restricted/video.mjs +1 -0
  131. package/resolvers/query/sampleCards.js +2 -1
  132. package/resolvers/query/sampleCards.mjs +1 -0
  133. package/resolvers/query/sampleQuestions.js +2 -1
  134. package/resolvers/query/sampleQuestions.mjs +1 -0
  135. package/resolvers/query/subscription.js +2 -1
  136. package/resolvers/query/subscription.mjs +1 -0
  137. package/resolvers/query/university.js +2 -1
  138. package/resolvers/query/university.mjs +1 -0
  139. package/resolvers/query/user.js +2 -1
  140. package/resolvers/query/user.mjs +1 -0
  141. package/resolvers/query/video.js +2 -1
  142. package/resolvers/query/video.mjs +1 -0
  143. package/resolvers/subscription/index.js +13 -1
  144. package/resolvers/subscription/index.mjs +1 -0
  145. package/resolvers/subscription/osce.js +14 -10
  146. package/resolvers/subscription/osce.mjs +39 -0
  147. package/utils/commonFunctions.js +17 -11
  148. package/utils/{commonFunctions.cjs → commonFunctions.mjs} +11 -17
  149. package/utils/index.js +17 -5
  150. package/utils/index.mjs +5 -0
  151. package/utils/lightgallery.js +5 -1
  152. package/utils/{lightgallery.cjs → lightgallery.mjs} +1 -5
  153. package/utils/offlineLink.js +16 -9
  154. package/utils/{offlineLink.cjs → offlineLink.mjs} +9 -16
  155. package/utils/uuid4.js +3 -1
  156. package/utils/{uuid4.cjs → uuid4.mjs} +1 -3
  157. package/utils/wordsToNumber.js +5 -1
  158. package/utils/{wordsToNumber.cjs → wordsToNumber.mjs} +1 -5
  159. package/gql_input_output_types/User.cjs +0 -2
  160. package/gql_input_output_types/index.cjs +0 -2
  161. package/models/Author.cjs +0 -2
  162. package/models/Book.cjs +0 -2
  163. package/models/Card.cjs +0 -2
  164. package/models/Chapter.cjs +0 -2
  165. package/models/Concept.cjs +0 -2
  166. package/models/Feedback.cjs +0 -2
  167. package/models/File.cjs +0 -2
  168. package/models/Marksheet.cjs +0 -9
  169. package/models/MockTest.cjs +0 -2
  170. package/models/Picture.cjs +0 -6
  171. package/models/Promo.cjs +0 -2
  172. package/models/Todo.cjs +0 -2
  173. package/models/Token.cjs +0 -2
  174. package/models/Type.cjs +0 -2
  175. package/models/University.cjs +0 -2
  176. package/models/User.cjs +0 -2
  177. package/models/Video.cjs +0 -2
  178. package/models/index.cjs +0 -35
  179. package/resolvers/apollo.cjs +0 -2
  180. package/resolvers/mutation/admin/algoliaSync.cjs +0 -2
  181. package/resolvers/mutation/admin/index.cjs +0 -14
  182. package/resolvers/mutation/admin/token.cjs +0 -2
  183. package/resolvers/mutation/index.cjs +0 -14
  184. package/resolvers/mutation/restricted/agora.cjs +0 -2
  185. package/resolvers/mutation/restricted/contactUs.cjs +0 -2
  186. package/resolvers/mutation/restricted/index.cjs +0 -22
  187. package/resolvers/mutation/restricted/marksheet.cjs +0 -2
  188. package/resolvers/mutation/restricted/mockTest.cjs +0 -2
  189. package/resolvers/mutation/restricted/osce.cjs +0 -2
  190. package/resolvers/mutation/restricted/questionDiscussion.cjs +0 -2
  191. package/resolvers/mutation/restricted/token.cjs +0 -2
  192. package/resolvers/mutation/restricted/users.cjs +0 -2
  193. package/resolvers/mutation/restricted/video.cjs +0 -2
  194. package/resolvers/mutation/stripe.cjs +0 -2
  195. package/resolvers/mutation/users.cjs +0 -2
  196. package/resolvers/mutation/validUserToken/index.cjs +0 -13
  197. package/resolvers/mutation/validUserToken/user.cjs +0 -2
  198. package/resolvers/query/admin/getUserToken.cjs +0 -2
  199. package/resolvers/query/admin/index.cjs +0 -13
  200. package/resolvers/query/author.cjs +0 -2
  201. package/resolvers/query/book.cjs +0 -2
  202. package/resolvers/query/feedback.cjs +0 -2
  203. package/resolvers/query/index.cjs +0 -21
  204. package/resolvers/query/restricted/anatomy.cjs +0 -2
  205. package/resolvers/query/restricted/index.cjs +0 -22
  206. package/resolvers/query/restricted/marksheet.cjs +0 -2
  207. package/resolvers/query/restricted/mockTests.cjs +0 -2
  208. package/resolvers/query/restricted/osce.cjs +0 -2
  209. package/resolvers/query/restricted/quesBook.cjs +0 -2
  210. package/resolvers/query/restricted/todos.cjs +0 -2
  211. package/resolvers/query/restricted/topics.cjs +0 -2
  212. package/resolvers/query/restricted/university.cjs +0 -2
  213. package/resolvers/query/restricted/user.cjs +0 -2
  214. package/resolvers/query/restricted/video.cjs +0 -2
  215. package/resolvers/query/sampleCards.cjs +0 -2
  216. package/resolvers/query/sampleQuestions.cjs +0 -2
  217. package/resolvers/query/subscription.cjs +0 -2
  218. package/resolvers/query/university.cjs +0 -2
  219. package/resolvers/query/user.cjs +0 -2
  220. package/resolvers/query/video.cjs +0 -2
  221. package/resolvers/subscription/index.cjs +0 -13
  222. package/resolvers/subscription/osce.cjs +0 -43
  223. package/utils/index.cjs +0 -17
@@ -1,16 +1,19 @@
1
- import { EOsceRoles, } from '../../models';
2
- export const ROLE_CHANGED = 'ROLE_CHANGED';
3
- export const OSCE_MARKSHEET_ACTION = 'OSCE_MARKSHEET_ACTION';
4
- export const OSCE_MATCHMAKING = 'OSCE_MATCHMAKING';
5
- export const OSCE_MATCHMAKING_USERS = 'OSCE_MATCHMAKING_USERS';
6
- export const OsceGroupInit = (osceMarksheetId) => [
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OsceGroupInit = exports.OSCE_MATCHMAKING_USERS = exports.OSCE_MATCHMAKING = exports.OSCE_MARKSHEET_ACTION = exports.ROLE_CHANGED = void 0;
4
+ const models_1 = require("../../models");
5
+ exports.ROLE_CHANGED = 'ROLE_CHANGED';
6
+ exports.OSCE_MARKSHEET_ACTION = 'OSCE_MARKSHEET_ACTION';
7
+ exports.OSCE_MATCHMAKING = 'OSCE_MATCHMAKING';
8
+ exports.OSCE_MATCHMAKING_USERS = 'OSCE_MATCHMAKING_USERS';
9
+ const OsceGroupInit = (osceMarksheetId) => [
7
10
  {
8
11
  id: null,
9
12
  createdAt: null,
10
13
  osceMarksheetId,
11
14
  userId: null,
12
15
  user: null,
13
- role: EOsceRoles.CANDIDATE,
16
+ role: models_1.EOsceRoles.CANDIDATE,
14
17
  },
15
18
  {
16
19
  id: null,
@@ -18,7 +21,7 @@ export const OsceGroupInit = (osceMarksheetId) => [
18
21
  osceMarksheetId,
19
22
  userId: null,
20
23
  user: null,
21
- role: EOsceRoles.EXAMINER,
24
+ role: models_1.EOsceRoles.EXAMINER,
22
25
  },
23
26
  {
24
27
  id: null,
@@ -26,7 +29,7 @@ export const OsceGroupInit = (osceMarksheetId) => [
26
29
  osceMarksheetId,
27
30
  userId: null,
28
31
  user: null,
29
- role: EOsceRoles.ACTOR,
32
+ role: models_1.EOsceRoles.ACTOR,
30
33
  },
31
34
  {
32
35
  id: null,
@@ -34,6 +37,7 @@ export const OsceGroupInit = (osceMarksheetId) => [
34
37
  osceMarksheetId,
35
38
  userId: null,
36
39
  user: null,
37
- role: EOsceRoles.OBSERVER,
40
+ role: models_1.EOsceRoles.OBSERVER,
38
41
  },
39
42
  ];
43
+ exports.OsceGroupInit = OsceGroupInit;
@@ -0,0 +1,39 @@
1
+ import { EOsceRoles, } from '../../models';
2
+ export const ROLE_CHANGED = 'ROLE_CHANGED';
3
+ export const OSCE_MARKSHEET_ACTION = 'OSCE_MARKSHEET_ACTION';
4
+ export const OSCE_MATCHMAKING = 'OSCE_MATCHMAKING';
5
+ export const OSCE_MATCHMAKING_USERS = 'OSCE_MATCHMAKING_USERS';
6
+ export const OsceGroupInit = (osceMarksheetId) => [
7
+ {
8
+ id: null,
9
+ createdAt: null,
10
+ osceMarksheetId,
11
+ userId: null,
12
+ user: null,
13
+ role: EOsceRoles.CANDIDATE,
14
+ },
15
+ {
16
+ id: null,
17
+ createdAt: null,
18
+ osceMarksheetId,
19
+ userId: null,
20
+ user: null,
21
+ role: EOsceRoles.EXAMINER,
22
+ },
23
+ {
24
+ id: null,
25
+ createdAt: null,
26
+ osceMarksheetId,
27
+ userId: null,
28
+ user: null,
29
+ role: EOsceRoles.ACTOR,
30
+ },
31
+ {
32
+ id: null,
33
+ createdAt: null,
34
+ osceMarksheetId,
35
+ userId: null,
36
+ user: null,
37
+ role: EOsceRoles.OBSERVER,
38
+ },
39
+ ];
@@ -1,8 +1,11 @@
1
- import { EQuestionType, } from '../models';
2
- import { wordsToNumber } from './wordsToNumber';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.correctMark = exports.formatPrescribeAnswer = exports.mapPrescribeMarkToAnswer = void 0;
4
+ const models_1 = require("../models");
5
+ const wordsToNumber_1 = require("./wordsToNumber");
3
6
  const floatRegex = /([0-9]*[.])?[0-9]+/gm;
4
7
  const ACCEPTED_FREQ = ['stat', 'od', 'bd', 'tds', 'qds'];
5
- export function mapPrescribeMarkToAnswer(obj) {
8
+ function mapPrescribeMarkToAnswer(obj) {
6
9
  return {
7
10
  drug: {
8
11
  value: obj.drug,
@@ -30,7 +33,8 @@ export function mapPrescribeMarkToAnswer(obj) {
30
33
  },
31
34
  };
32
35
  }
33
- export function formatPrescribeAnswer(obj) {
36
+ exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
37
+ function formatPrescribeAnswer(obj) {
34
38
  obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
35
39
  obj.route.value = obj.route.value.toLowerCase().replace(/\s/g, '');
36
40
  if (obj.route.value === 'oral') {
@@ -75,7 +79,7 @@ export function formatPrescribeAnswer(obj) {
75
79
  }
76
80
  m.forEach((match) => durationMatches.add(match));
77
81
  }
78
- const durationWords = wordsToNumber(obj.duration.value, false);
82
+ const durationWords = (0, wordsToNumber_1.wordsToNumber)(obj.duration.value, false);
79
83
  if (durationWords !== 0) {
80
84
  durationMatches.add(durationWords.toString());
81
85
  }
@@ -104,12 +108,13 @@ export function formatPrescribeAnswer(obj) {
104
108
  obj.frequency.value = 'qds';
105
109
  }
106
110
  else if (!ACCEPTED_FREQ.includes(obj.frequency.value)) {
107
- obj.frequency.value = wordsToNumber(orgFrequencyValue, true).toString();
111
+ obj.frequency.value = (0, wordsToNumber_1.wordsToNumber)(orgFrequencyValue, true).toString();
108
112
  }
109
113
  return obj;
110
114
  }
115
+ exports.formatPrescribeAnswer = formatPrescribeAnswer;
111
116
  const answerRegex = /answer/gi;
112
- export function correctMark(mark) {
117
+ function correctMark(mark) {
113
118
  const data = {
114
119
  correct: false,
115
120
  incorrect: false,
@@ -124,7 +129,7 @@ export function correctMark(mark) {
124
129
  const answer = mark.question[answerKey];
125
130
  const flatAnswer = answer[0];
126
131
  const flatAttempt = mark.mark[0];
127
- if (EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
132
+ if (models_1.EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
128
133
  const answer = flatAnswer;
129
134
  const attempt = flatAttempt;
130
135
  if (answer === attempt) {
@@ -134,7 +139,7 @@ export function correctMark(mark) {
134
139
  data.incorrect = true;
135
140
  }
136
141
  }
137
- else if (EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
142
+ else if (models_1.EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
138
143
  const answer = flatAnswer.dose.toLowerCase().replace(/\s/g, '');
139
144
  let attempt = '';
140
145
  if (flatAttempt) {
@@ -147,7 +152,7 @@ export function correctMark(mark) {
147
152
  data.incorrect = true;
148
153
  }
149
154
  }
150
- else if (EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
155
+ else if (models_1.EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
151
156
  const [answerA, answerB] = answer.map((x) => x.sort());
152
157
  let [attemptA, attemptB] = [[], []];
153
158
  if (Array.isArray(mark.mark) &&
@@ -167,7 +172,7 @@ export function correctMark(mark) {
167
172
  data.incorrect = true;
168
173
  }
169
174
  }
170
- else if (EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
175
+ else if (models_1.EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
171
176
  const answers = answer.map(formatPrescribeAnswer);
172
177
  let attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer({
173
178
  drug: '',
@@ -215,3 +220,4 @@ export function correctMark(mark) {
215
220
  }
216
221
  return data;
217
222
  }
223
+ exports.correctMark = correctMark;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.correctMark = exports.formatPrescribeAnswer = exports.mapPrescribeMarkToAnswer = void 0;
4
- const models_1 = require("../models");
5
- const wordsToNumber_1 = require("./wordsToNumber");
1
+ import { EQuestionType, } from '../models';
2
+ import { wordsToNumber } from './wordsToNumber';
6
3
  const floatRegex = /([0-9]*[.])?[0-9]+/gm;
7
4
  const ACCEPTED_FREQ = ['stat', 'od', 'bd', 'tds', 'qds'];
8
- function mapPrescribeMarkToAnswer(obj) {
5
+ export function mapPrescribeMarkToAnswer(obj) {
9
6
  return {
10
7
  drug: {
11
8
  value: obj.drug,
@@ -33,8 +30,7 @@ function mapPrescribeMarkToAnswer(obj) {
33
30
  },
34
31
  };
35
32
  }
36
- exports.mapPrescribeMarkToAnswer = mapPrescribeMarkToAnswer;
37
- function formatPrescribeAnswer(obj) {
33
+ export function formatPrescribeAnswer(obj) {
38
34
  obj.drug.value = obj.drug.value.toLowerCase().replace(/\s/g, '');
39
35
  obj.route.value = obj.route.value.toLowerCase().replace(/\s/g, '');
40
36
  if (obj.route.value === 'oral') {
@@ -79,7 +75,7 @@ function formatPrescribeAnswer(obj) {
79
75
  }
80
76
  m.forEach((match) => durationMatches.add(match));
81
77
  }
82
- const durationWords = (0, wordsToNumber_1.wordsToNumber)(obj.duration.value, false);
78
+ const durationWords = wordsToNumber(obj.duration.value, false);
83
79
  if (durationWords !== 0) {
84
80
  durationMatches.add(durationWords.toString());
85
81
  }
@@ -108,13 +104,12 @@ function formatPrescribeAnswer(obj) {
108
104
  obj.frequency.value = 'qds';
109
105
  }
110
106
  else if (!ACCEPTED_FREQ.includes(obj.frequency.value)) {
111
- obj.frequency.value = (0, wordsToNumber_1.wordsToNumber)(orgFrequencyValue, true).toString();
107
+ obj.frequency.value = wordsToNumber(orgFrequencyValue, true).toString();
112
108
  }
113
109
  return obj;
114
110
  }
115
- exports.formatPrescribeAnswer = formatPrescribeAnswer;
116
111
  const answerRegex = /answer/gi;
117
- function correctMark(mark) {
112
+ export function correctMark(mark) {
118
113
  const data = {
119
114
  correct: false,
120
115
  incorrect: false,
@@ -129,7 +124,7 @@ function correctMark(mark) {
129
124
  const answer = mark.question[answerKey];
130
125
  const flatAnswer = answer[0];
131
126
  const flatAttempt = mark.mark[0];
132
- if (models_1.EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
127
+ if (EQuestionType.SINGLE_BEST_ANSWER === mark.question.typeId) {
133
128
  const answer = flatAnswer;
134
129
  const attempt = flatAttempt;
135
130
  if (answer === attempt) {
@@ -139,7 +134,7 @@ function correctMark(mark) {
139
134
  data.incorrect = true;
140
135
  }
141
136
  }
142
- else if (models_1.EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
137
+ else if (EQuestionType.QUESTION_ANSWER === mark.question.typeId) {
143
138
  const answer = flatAnswer.dose.toLowerCase().replace(/\s/g, '');
144
139
  let attempt = '';
145
140
  if (flatAttempt) {
@@ -152,7 +147,7 @@ function correctMark(mark) {
152
147
  data.incorrect = true;
153
148
  }
154
149
  }
155
- else if (models_1.EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
150
+ else if (EQuestionType.MULTIPLE_ANSWERS === mark.question.typeId) {
156
151
  const [answerA, answerB] = answer.map((x) => x.sort());
157
152
  let [attemptA, attemptB] = [[], []];
158
153
  if (Array.isArray(mark.mark) &&
@@ -172,7 +167,7 @@ function correctMark(mark) {
172
167
  data.incorrect = true;
173
168
  }
174
169
  }
175
- else if (models_1.EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
170
+ else if (EQuestionType.PRESCRIPTION_ANSWER === mark.question.typeId) {
176
171
  const answers = answer.map(formatPrescribeAnswer);
177
172
  let attempt = formatPrescribeAnswer(mapPrescribeMarkToAnswer({
178
173
  drug: '',
@@ -220,4 +215,3 @@ function correctMark(mark) {
220
215
  }
221
216
  return data;
222
217
  }
223
- exports.correctMark = correctMark;
package/utils/index.js CHANGED
@@ -1,5 +1,17 @@
1
- export * from './commonFunctions';
2
- export * from './lightgallery';
3
- export * from './offlineLink';
4
- export * from './uuid4';
5
- export * from './wordsToNumber';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./commonFunctions"), exports);
14
+ __exportStar(require("./lightgallery"), exports);
15
+ __exportStar(require("./offlineLink"), exports);
16
+ __exportStar(require("./uuid4"), exports);
17
+ __exportStar(require("./wordsToNumber"), exports);
@@ -0,0 +1,5 @@
1
+ export * from './commonFunctions';
2
+ export * from './lightgallery';
3
+ export * from './offlineLink';
4
+ export * from './uuid4';
5
+ export * from './wordsToNumber';
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,11 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.lightgalleryOsceResolve = void 0;
10
13
  const lightgalleryRegex = /\[lightgallery\]/;
11
14
  function isOsceMarksheet(data) {
12
15
  return 'osceStationId' in data;
13
16
  }
14
- export function lightgalleryOsceResolve(data, cache) {
17
+ function lightgalleryOsceResolve(data, cache) {
15
18
  return __awaiter(this, void 0, void 0, function* () {
16
19
  let station;
17
20
  if (isOsceMarksheet(data)) {
@@ -49,6 +52,7 @@ export function lightgalleryOsceResolve(data, cache) {
49
52
  }
50
53
  });
51
54
  }
55
+ exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
52
56
  const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
53
57
  var _a;
54
58
  if (pictures.length === 0) {
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,13 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.lightgalleryOsceResolve = void 0;
13
10
  const lightgalleryRegex = /\[lightgallery\]/;
14
11
  function isOsceMarksheet(data) {
15
12
  return 'osceStationId' in data;
16
13
  }
17
- function lightgalleryOsceResolve(data, cache) {
14
+ export function lightgalleryOsceResolve(data, cache) {
18
15
  return __awaiter(this, void 0, void 0, function* () {
19
16
  let station;
20
17
  if (isOsceMarksheet(data)) {
@@ -52,7 +49,6 @@ function lightgalleryOsceResolve(data, cache) {
52
49
  }
53
50
  });
54
51
  }
55
- exports.lightgalleryOsceResolve = lightgalleryOsceResolve;
56
52
  const lightgalleryMutation = (text, pictures, cache) => __awaiter(void 0, void 0, void 0, function* () {
57
53
  var _a;
58
54
  if (pictures.length === 0) {
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -7,9 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
9
  });
9
10
  };
10
- import { ApolloLink, Observable, } from '@apollo/client';
11
- import uuid from './uuid4';
12
- export class OfflineLink extends ApolloLink {
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OfflineLink = void 0;
16
+ const client_1 = require("@apollo/client");
17
+ const uuid4_1 = __importDefault(require("./uuid4"));
18
+ class OfflineLink extends client_1.ApolloLink {
13
19
  /**
14
20
  * storage
15
21
  * Provider that will persist the mutation queue. This can be any AsyncStorage compatible storage instance.
@@ -42,18 +48,18 @@ export class OfflineLink extends ApolloLink {
42
48
  // If the mutation does not have an optimisticResponse then we can't defer it
43
49
  return forward(operation);
44
50
  }
45
- return new Observable((observer) => {
46
- const mutationId = uuid.asBase64();
51
+ return new client_1.Observable((observer) => {
52
+ const mutationId = uuid4_1.default.asBase64();
47
53
  this.add({
48
54
  mutation: query,
49
55
  variables,
50
56
  optimisticResponse: context.optimisticResponse,
51
57
  }, mutationId);
52
58
  const subscription = forward(operation).subscribe({
53
- next: (result) => __awaiter(this, void 0, void 0, function* () {
54
- yield this.remove(mutationId);
59
+ next: (result) => {
60
+ this.remove(mutationId);
55
61
  observer.next(result);
56
- }),
62
+ },
57
63
  error: () => {
58
64
  // Mutation failed so we try again after a certain amount of time.
59
65
  this.delayedSync();
@@ -124,7 +130,7 @@ export class OfflineLink extends ApolloLink {
124
130
  return __awaiter(this, void 0, void 0, function* () {
125
131
  // We give the mutation attempt a random id so that it is easy to remove when needed (in sync loop)
126
132
  if (!mutationId) {
127
- mutationId = uuid.asBase64();
133
+ mutationId = uuid4_1.default.asBase64();
128
134
  }
129
135
  this.queue.set(mutationId, item);
130
136
  yield this.saveQueue(mutationId, item);
@@ -228,3 +234,4 @@ export class OfflineLink extends ApolloLink {
228
234
  });
229
235
  }
230
236
  }
237
+ exports.OfflineLink = OfflineLink;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.OfflineLink = void 0;
16
- const client_1 = require("@apollo/client");
17
- const uuid4_1 = __importDefault(require("./uuid4"));
18
- class OfflineLink extends client_1.ApolloLink {
10
+ import { ApolloLink, Observable, } from '@apollo/client';
11
+ import uuid from './uuid4';
12
+ export class OfflineLink extends ApolloLink {
19
13
  /**
20
14
  * storage
21
15
  * Provider that will persist the mutation queue. This can be any AsyncStorage compatible storage instance.
@@ -48,18 +42,18 @@ class OfflineLink extends client_1.ApolloLink {
48
42
  // If the mutation does not have an optimisticResponse then we can't defer it
49
43
  return forward(operation);
50
44
  }
51
- return new client_1.Observable((observer) => {
52
- const mutationId = uuid4_1.default.asBase64();
45
+ return new Observable((observer) => {
46
+ const mutationId = uuid.asBase64();
53
47
  this.add({
54
48
  mutation: query,
55
49
  variables,
56
50
  optimisticResponse: context.optimisticResponse,
57
51
  }, mutationId);
58
52
  const subscription = forward(operation).subscribe({
59
- next: (result) => __awaiter(this, void 0, void 0, function* () {
60
- yield this.remove(mutationId);
53
+ next: (result) => {
54
+ this.remove(mutationId);
61
55
  observer.next(result);
62
- }),
56
+ },
63
57
  error: () => {
64
58
  // Mutation failed so we try again after a certain amount of time.
65
59
  this.delayedSync();
@@ -130,7 +124,7 @@ class OfflineLink extends client_1.ApolloLink {
130
124
  return __awaiter(this, void 0, void 0, function* () {
131
125
  // We give the mutation attempt a random id so that it is easy to remove when needed (in sync loop)
132
126
  if (!mutationId) {
133
- mutationId = uuid4_1.default.asBase64();
127
+ mutationId = uuid.asBase64();
134
128
  }
135
129
  this.queue.set(mutationId, item);
136
130
  yield this.saveQueue(mutationId, item);
@@ -234,4 +228,3 @@ class OfflineLink extends client_1.ApolloLink {
234
228
  });
235
229
  }
236
230
  }
237
- exports.OfflineLink = OfflineLink;
package/utils/uuid4.js CHANGED
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  class Uuid4 {
2
4
  /**
3
5
  * Generate a custom base 64 encoded UUID v4 (random).
@@ -282,4 +284,4 @@ Uuid4._base64 = {
282
284
  '111110': '-',
283
285
  '111111': '_',
284
286
  };
285
- export default Uuid4;
287
+ exports.default = Uuid4;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  class Uuid4 {
4
2
  /**
5
3
  * Generate a custom base 64 encoded UUID v4 (random).
@@ -284,4 +282,4 @@ Uuid4._base64 = {
284
282
  '111110': '-',
285
283
  '111111': '_',
286
284
  };
287
- exports.default = Uuid4;
285
+ export default Uuid4;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wordsToNumber = void 0;
1
4
  const Small = {
2
5
  zero: 0,
3
6
  one: 1,
@@ -28,7 +31,7 @@ const Small = {
28
31
  eighty: 80,
29
32
  ninety: 90,
30
33
  };
31
- export function wordsToNumber(s, checkForDigits = false) {
34
+ function wordsToNumber(s, checkForDigits = false) {
32
35
  const words = s.toString().split(/[\s-]+/);
33
36
  let total = 0;
34
37
  words.forEach((word) => {
@@ -42,3 +45,4 @@ export function wordsToNumber(s, checkForDigits = false) {
42
45
  });
43
46
  return total;
44
47
  }
48
+ exports.wordsToNumber = wordsToNumber;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wordsToNumber = void 0;
4
1
  const Small = {
5
2
  zero: 0,
6
3
  one: 1,
@@ -31,7 +28,7 @@ const Small = {
31
28
  eighty: 80,
32
29
  ninety: 90,
33
30
  };
34
- function wordsToNumber(s, checkForDigits = false) {
31
+ export function wordsToNumber(s, checkForDigits = false) {
35
32
  const words = s.toString().split(/[\s-]+/);
36
33
  let total = 0;
37
34
  words.forEach((word) => {
@@ -45,4 +42,3 @@ function wordsToNumber(s, checkForDigits = false) {
45
42
  });
46
43
  return total;
47
44
  }
48
- exports.wordsToNumber = wordsToNumber;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Author.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Book.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Card.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/File.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EQuestionLike = void 0;
4
- var EQuestionLike;
5
- (function (EQuestionLike) {
6
- EQuestionLike[EQuestionLike["NONE"] = 0] = "NONE";
7
- EQuestionLike[EQuestionLike["LIKE"] = 1] = "LIKE";
8
- EQuestionLike[EQuestionLike["DISLIKE"] = 2] = "DISLIKE";
9
- })(EQuestionLike = exports.EQuestionLike || (exports.EQuestionLike = {}));
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
4
- ;
5
- ;
6
- ;
package/models/Promo.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Todo.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Token.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Type.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/User.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/models/Video.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });