@pocketprep/types 1.17.0 → 1.18.1

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.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Common base for every API response resource.
3
+ *
4
+ * Responses are Parse-free and use ISO-8601 timestamp strings. Pointer
5
+ * fields hold raw id strings (or string arrays); the Nest repository layer
6
+ * translates Mongo storage shape into this contract at the boundary.
7
+ */
8
+ export interface BaseResource {
9
+ id: string
10
+ createdAt: string
11
+ updatedAt: string
12
+ }
@@ -0,0 +1,82 @@
1
+ import { BaseResource } from './BaseResource'
2
+
3
+ export interface MockExam extends BaseResource {
4
+ name: string
5
+ description?: string
6
+ enabled: boolean
7
+ durationSeconds: number
8
+ questionSerials: string[]
9
+ }
10
+
11
+ export interface ExamMetadata extends BaseResource {
12
+ hideReferences: boolean
13
+ examGuid: string
14
+ archivedCount: number
15
+ freeCount?: number
16
+ totalCount?: number
17
+ nativeAppName: string
18
+ releaseInfo?: {
19
+ name: string
20
+ description: string
21
+ message: string
22
+ }
23
+ descriptiveName: string
24
+ version: string
25
+ compositeKey: string
26
+ description?: string
27
+ isFree: boolean
28
+ /** Ids of the MockExams associated with this exam. */
29
+ mockExams: string[]
30
+ sunsetAt?: string
31
+ minorVersionMessaging?: {
32
+ type: 'newQuestions' | 'newMockExams'
33
+ count: number
34
+ }
35
+ appId?: string
36
+ knowledgeAreas?: {
37
+ [key: string]: {
38
+ name: string
39
+ count: number
40
+ specialCount: number
41
+ }
42
+ }
43
+ itemCount?: number
44
+ classicQuestions?: number
45
+ specialQuestions?: number
46
+ }
47
+
48
+ export interface Bundle extends BaseResource {
49
+ name: string
50
+ /** Ids of the ExamMetadata records in this bundle. */
51
+ exams: string[]
52
+ ios?: {
53
+ currentVersion: string
54
+ minVersion: string
55
+ appStoreId: string
56
+ appStoreURI: string
57
+ appStoreIds: string[]
58
+ }
59
+ android?: {
60
+ currentVersion: string
61
+ minVersion: string
62
+ appStoreId: string
63
+ appStoreURI: string
64
+ appStoreIds: string[]
65
+ }
66
+ isDisabled: boolean
67
+ seatPricingModel?: {
68
+ costPerSeat: number
69
+ customExamPrices?: { [examGuid: string]: number }
70
+ }
71
+ }
72
+
73
+ export interface FetchBundlesParams {
74
+ platform?: 'iOS' | 'Android'
75
+ appStoreId?: string
76
+ }
77
+
78
+ export interface FetchBundlesResponse {
79
+ bundles: Bundle[]
80
+ exams: ExamMetadata[]
81
+ mockExams: MockExam[]
82
+ }
@@ -0,0 +1,18 @@
1
+ import { BaseResource } from './BaseResource'
2
+
3
+ export interface KeywordDefinition extends BaseResource {
4
+ keyword: string
5
+ definition: string
6
+ serial: string
7
+ /** ExamMetadata id (pointer flattened). */
8
+ examMetadata?: string
9
+ }
10
+
11
+ export interface SearchKeywordDefinitionsParams {
12
+ examMetadataId: string
13
+ serials: string[]
14
+ }
15
+
16
+ export interface SearchKeywordDefinitionsResponse {
17
+ keywords: KeywordDefinition[]
18
+ }
@@ -0,0 +1,7 @@
1
+ export interface CheckLevelUpEligibilityParams {
2
+ examGuid: string
3
+ }
4
+
5
+ export interface CheckLevelUpEligibilityResponse {
6
+ eligible: boolean
7
+ }
@@ -0,0 +1,74 @@
1
+ import { BloomTaxonomyLevel, Subtopic } from '../Study/Class'
2
+ import { IMatrixLabels, TPassageLabel } from '../CMS/Class'
3
+
4
+ import { BaseResource } from './BaseResource'
5
+
6
+ /** Shape of an individual choice on a Question. Matches Parse's stored shape. */
7
+ export interface QuestionChoice {
8
+ text?: string
9
+ isCorrect: boolean
10
+ id: string
11
+ labelIndex?: number
12
+ }
13
+
14
+ /** Image-with-alt structure used by passage and explanation. */
15
+ export interface QuestionImage {
16
+ url: string
17
+ altText: string
18
+ longAltText?: string
19
+ }
20
+
21
+ export interface Question extends BaseResource {
22
+ prompt: string
23
+ /** Subject id (pointer flattened). */
24
+ subject: string
25
+ subtopicId?: string
26
+ bloomTaxonomyLevel?: BloomTaxonomyLevel
27
+ choices: QuestionChoice[]
28
+ passage?: string
29
+ passageImage?: QuestionImage
30
+ explanation?: string
31
+ explanationImage?: QuestionImage
32
+ references?: string[]
33
+ serial: string
34
+ /** ExamMetadata id (pointer flattened). */
35
+ examMetadata: string
36
+ compositeKey: string
37
+ type:
38
+ | 'Multiple Choice'
39
+ | 'Multiple Correct Response'
40
+ | 'True/False'
41
+ | 'Matrix Checkbox'
42
+ | 'Matrix Radio Button'
43
+ | 'Multi-Part Multiple Choice'
44
+ | 'Build List'
45
+ addedDate: string
46
+ isArchived: boolean
47
+ isFree: boolean
48
+ isMockQuestion: boolean
49
+ /** QuestionScenario id (pointer flattened, optional). */
50
+ questionScenario?: string
51
+ matrixLabels?: IMatrixLabels
52
+ matrixChoiceLayout?: string[][]
53
+ passageLabel?: TPassageLabel
54
+ mpmcLabels?: string[]
55
+ }
56
+
57
+ export interface Subject extends BaseResource {
58
+ name: string
59
+ isArchived: boolean
60
+ /** ExamMetadata id (pointer flattened). */
61
+ examMetadata: string
62
+ questionCount?: number
63
+ subtopics?: Subtopic[]
64
+ }
65
+
66
+ export interface FetchQotdParams {
67
+ daysSinceEpoch: number
68
+ count?: number
69
+ }
70
+
71
+ export interface FetchQotdResponse {
72
+ questions: Question[]
73
+ subjects: Subject[]
74
+ }
@@ -0,0 +1,9 @@
1
+ import { BaseResource } from './BaseResource'
2
+
3
+ export interface Session extends BaseResource {
4
+ sessionToken: string
5
+ expiresAt: string
6
+ /** User id (pointer flattened). */
7
+ user: string
8
+ createdWith?: { action: string; authProvider: string }
9
+ }
package/API/User.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { BaseResource } from './BaseResource'
2
+
3
+ export interface QuizSettings {
4
+ showCheckAnswerButton?: boolean
5
+ showAnswersAtEnd?: boolean
6
+ enableKeyboardShortcuts?: boolean
7
+ }
8
+
9
+ /**
10
+ * User response shape. Sensitive columns (`password`, `_hashed_password`,
11
+ * `stripeCustomerId`) are stripped at the flatten boundary so they never
12
+ * reach this contract.
13
+ */
14
+ export interface User extends BaseResource {
15
+ email: string
16
+ firstName?: string
17
+ lastName?: string
18
+ username?: string
19
+ company?: string
20
+ currentApp?: string
21
+ currentExamGuid?: string
22
+ /** UserExamMetadata id (pointer flattened — UEM itself is no longer hydrated). */
23
+ currentUserExamMetadata?: string
24
+ lastActiveAt?: string
25
+ onboardingCompleted?: boolean
26
+ quizSettings?: QuizSettings
27
+ title?: string
28
+ version?: string
29
+ webConfig?: Record<string, unknown>
30
+ }
package/API/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './BaseResource'
2
+ export * from './Bundle'
3
+ export * from './Question'
4
+ export * from './KeywordDefinition'
5
+ export * from './Session'
6
+ export * from './User'
7
+ export * from './LevelUp'
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import * as CMS from './CMS'
4
4
  import * as Teach from './Teach'
5
5
  import * as Support from './Support'
6
6
  import * as AI from './AI'
7
+ import * as API from './API'
7
8
 
8
9
  export {
9
10
  Study,
@@ -11,6 +12,7 @@ export {
11
12
  Teach,
12
13
  Support,
13
14
  AI,
15
+ API,
14
16
  }
15
17
 
16
18
  export type Payload<T extends Parse.Object> = T extends Parse.Object<infer R>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/types",
3
- "version": "1.17.0",
3
+ "version": "1.18.1",
4
4
  "description": "Pocket Prep type declarations",
5
5
  "repository": {
6
6
  "type": "git",