@pocketprep/types 1.8.7 → 1.8.9

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.
package/CMS/Class.d.ts CHANGED
@@ -207,12 +207,14 @@ export interface S3Manifest {
207
207
  }[]
208
208
  }
209
209
 
210
- export type QuestionHistory = Parse.Object<Study.Class.ExamData['attributes'] & {
210
+ export type QuestionStats = {
211
211
  answeredCorrectlyCount: number
212
212
  answeredIncorrectlyCount: number
213
213
  percentCorrect: number
214
214
  choiceStats: Partial<Record<Study.Cloud.TChoiceKey, number>>
215
- }>
215
+ }
216
+
217
+ export type QuestionHistory = Parse.Object<Study.Class.ExamData['attributes'] & QuestionStats>
216
218
 
217
219
  export type QuestionHistoryJSON = ReturnType<QuestionHistory['toJSON']>
218
220
 
package/CMS/Cloud.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { QuestionDraftJSON, IAllowedQuestionTypes, S3Manifest, QuestionHistoryJSON, MockExamDraft } from './Class'
1
+ import { QuestionDraftJSON, IAllowedQuestionTypes, S3Manifest, QuestionHistoryJSON, QuestionStats } from './Class'
2
2
  import {
3
3
  GlobalQuestionMetricJSON,
4
4
  Bundle,
@@ -7,6 +7,7 @@ import {
7
7
  ExamDataJSON,
8
8
  ExamData,
9
9
  MockExam,
10
+ QuestionJSON,
10
11
  } from '../Study/Class'
11
12
 
12
13
  export interface JobWithMetrics {
@@ -178,6 +179,30 @@ export type searchQuestions<T = ExamDataJSON> = (params: {
178
179
  totalCount: number
179
180
  }
180
181
 
182
+ export type searchQuestionsV2<T = QuestionJSON> = (params: {
183
+ perPage?: number
184
+ page?: number
185
+ orderBy?: keyof T
186
+ order?: 'ascending' | 'descending'
187
+ equalTo?: { [key in keyof T]?: T[key] extends string | undefined
188
+ ? string
189
+ : T[key] | Parse.Pointer
190
+ }
191
+ notEqualTo?: { [key in keyof T]?: T[key] extends string | undefined ? string : T[key] }
192
+ contains?: { [key in keyof T]?: string }
193
+ containsAll?: { [key in keyof T]?: string[] }
194
+ exists?: (keyof T)[]
195
+ doesNotExist?: (keyof T)[]
196
+ searchAll?: {
197
+ keys: (keyof T)[]
198
+ value: string
199
+ }
200
+ caseSensitive?: boolean
201
+ }) => {
202
+ results: (QuestionJSON & QuestionStats)[]
203
+ totalCount: number
204
+ }
205
+
181
206
  export type disableUser = (params: { userId: string }) => Parse.User
182
207
 
183
208
  export type sendAdminEditorFlaggedEmail = (params: {
package/Study/Class.d.ts CHANGED
@@ -280,6 +280,8 @@ export type Subject = Parse.Object<{
280
280
  examMetadata: ExamMetadata | Parse.Pointer
281
281
  }>
282
282
 
283
+ export type SubjectJSON = ReturnType<Subject['toJSON']>
284
+
283
285
  export type Question = Parse.Object<{
284
286
  prompt: string
285
287
  subject: Subject | Parse.Pointer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/types",
3
- "version": "1.8.7",
3
+ "version": "1.8.9",
4
4
  "description": "Pocket Prep type declarations",
5
5
  "repository": {
6
6
  "type": "git",