@pocketprep/types 1.9.2 → 1.9.3

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/Study/Class.d.ts CHANGED
@@ -31,6 +31,31 @@ export type Quiz = Parse.Object<{
31
31
  export type QuizJSON = ReturnType<Quiz['toJSON']>
32
32
  export type QuizPayload = Payload<Quiz>
33
33
 
34
+ export type Platform = 'Android' | 'iOS' | 'Web'
35
+ export type UserConversion = Parse.Object<{
36
+ user: User | Parse.Pointer
37
+ mobileAppId?: string // eg com.pocketprep.app.ems
38
+ firstExamGuid?: string
39
+ firstBundleId?: string
40
+ signedUpOn?: Platform
41
+ onboardingResult?: 'Free' | 'Monthly' | 'Quarterly' | 'Yearly'
42
+ firstQuizSource?: Platform
43
+ firstSubscriptionSource?: ReceiptSource[keyof ReceiptSource]
44
+
45
+ // dates stored in case future metrics require new calculations
46
+ userCreatedAt: Date
47
+ onboardedAt?: Date
48
+ firstQuizAt?: Date
49
+ firstSubscriptionAt?: Date
50
+
51
+ // computed values included for ELK graphs
52
+ daysToOnboard?: number
53
+ daysToFirstQuiz?: number
54
+ daysToFirstSubscription?: number
55
+ daysFromQuizToSubscription?: number
56
+ }>
57
+ export type UserConversionPayload = Payload<UserConversion>
58
+
34
59
  export type UserExamMetadata = Parse.Object<{
35
60
  examGuid: string
36
61
  user: User | Parse.Pointer
package/Study/Cloud.d.ts CHANGED
@@ -23,6 +23,7 @@ import {
23
23
  Referral,
24
24
  QuestionJSON,
25
25
  Question,
26
+ Platform,
26
27
  } from './Class'
27
28
 
28
29
  // DEPRECATED - previously used answer package for a quiz or qotd
@@ -334,6 +335,14 @@ export type fetchUserDataV2 = (params: {
334
335
  userExamMetadata: UserExamMetadata | undefined
335
336
  }
336
337
 
338
+ export type onboardingCompleted = (params: {
339
+ firstExamGuid: string // examGuid of exam selected during onboarding
340
+ firstBundleId: string // Bundle.objectId of Bundle
341
+ signedUpOn: Platform // Android | iOS | Web
342
+ onboardingResult: string // Free | Monthly | Quarterly | Yearly
343
+ mobileAppId?: string // mobile app id, if applicable. eg com.pocketprep.app.ems
344
+ }) => void
345
+
337
346
  export type activateLicense = (params: { licenseKey: string }) => Subscription
338
347
 
339
348
  export type activateLicenseV2 = (params: { licenseKey: string }) => { license: License; subscription: Subscription }[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/types",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "Pocket Prep type declarations",
5
5
  "repository": {
6
6
  "type": "git",