@pocketprep/types 1.19.41 → 1.19.43
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/API/Billing.d.ts +83 -0
- package/API/index.d.ts +1 -0
- package/Study/Cloud.d.ts +29 -12
- package/package.json +2 -2
package/API/Billing.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Stripe from 'stripe'
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* The price contracts clients read from nest's `GET /billing/prices`. Prices
|
|
5
|
+
* are Stripe's own objects passed through unchanged, as Parse returns them, so
|
|
6
|
+
* any field the server dropped would fail at runtime rather than at compile
|
|
7
|
+
* time. Additions are safe; removals are not.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* How often a recurring price bills, derived from its Stripe interval.
|
|
12
|
+
*
|
|
13
|
+
* Not `cadence`: `Study.Class.RecommendationConfig.cadence` already spends
|
|
14
|
+
* that word on a quiz count throttling how often a recommendation reappears.
|
|
15
|
+
*/
|
|
16
|
+
export type BillingInterval = 'monthly' | 'quarterly' | 'yearly'
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A Stripe Price, plus a server-derived {@link BillingPrice.billingInterval}.
|
|
20
|
+
*
|
|
21
|
+
* It saves clients from parsing `nickname`, which is free text edited in the
|
|
22
|
+
* Stripe dashboard.
|
|
23
|
+
*/
|
|
24
|
+
export interface BillingPrice extends Stripe.Price {
|
|
25
|
+
/**
|
|
26
|
+
* Billing interval derived from `recurring`. Absent for one-time prices and
|
|
27
|
+
* for any interval that is not monthly, quarterly, or yearly.
|
|
28
|
+
*
|
|
29
|
+
* Named apart from Stripe's own `recurring.interval` (`month` / `year`),
|
|
30
|
+
* which this is derived from but does not restate.
|
|
31
|
+
*/
|
|
32
|
+
billingInterval?: BillingInterval
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Which client a member's plans are for. Each bundle sells the same plans at
|
|
37
|
+
* two sets of prices: `_mobile` lookup keys for members who arrive from the
|
|
38
|
+
* app, and the rest for members who start on web.
|
|
39
|
+
*/
|
|
40
|
+
export type PricePlatform = 'web' | 'mobile'
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The Amplitude price test that chose a member's plans, and their variant in
|
|
44
|
+
* it. When the member actually sees the plans, the client records a
|
|
45
|
+
* `$exposure` event whose `flag_key`, `variant` and `experiment_key`
|
|
46
|
+
* properties are these three fields.
|
|
47
|
+
*/
|
|
48
|
+
export interface PriceTest {
|
|
49
|
+
/** The test's key in Amplitude, `pricing-test-<lowercased bundle id>[-<test name>]`. */
|
|
50
|
+
flagKey: string
|
|
51
|
+
/** The member's variant key, `control` included. */
|
|
52
|
+
variant: string
|
|
53
|
+
/**
|
|
54
|
+
* Which run of the experiment assigned the variant (`exp-1`, `exp-2` after
|
|
55
|
+
* a restart), so the exposure counts toward the right run. Absent when
|
|
56
|
+
* Amplitude names none.
|
|
57
|
+
*/
|
|
58
|
+
experimentKey?: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Narrows the price list to the plans a signed-in member sees for one bundle
|
|
63
|
+
* on one platform. Both or neither: a bundle without a platform can't choose
|
|
64
|
+
* between its web and `_mobile` prices, and a platform alone names no plans.
|
|
65
|
+
*/
|
|
66
|
+
export interface FetchBillingPricesParams {
|
|
67
|
+
bundleId?: string
|
|
68
|
+
platform?: PricePlatform
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface FetchBillingPricesResponse {
|
|
72
|
+
/**
|
|
73
|
+
* Every active price; or, when a signed-in member asks for one bundle on
|
|
74
|
+
* one platform, the monthly, quarterly and yearly plans they see there, in
|
|
75
|
+
* that order.
|
|
76
|
+
*/
|
|
77
|
+
prices: BillingPrice[]
|
|
78
|
+
/**
|
|
79
|
+
* The price test that chose `prices`, control included. Absent when no
|
|
80
|
+
* test applies to the member, so there is no exposure to record.
|
|
81
|
+
*/
|
|
82
|
+
priceTest?: PriceTest
|
|
83
|
+
}
|
package/API/index.d.ts
CHANGED
package/Study/Cloud.d.ts
CHANGED
|
@@ -433,7 +433,7 @@ export type fetchSerialQuestionInfoLib = (params: { compositeKey: string }) => {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
export type fetchSerialQuestionInfoLibV2 = (params: {
|
|
436
|
+
export type fetchSerialQuestionInfoLibV2 = (params: {
|
|
437
437
|
compositeKey?: string
|
|
438
438
|
examMetadataId?: string
|
|
439
439
|
}) => {
|
|
@@ -543,7 +543,7 @@ export type resetUserExamProgress = (params: { appId: string }) => (
|
|
|
543
543
|
UserExamMetadata | TEUserAppMetadata | undefined
|
|
544
544
|
)
|
|
545
545
|
|
|
546
|
-
export type resetQuizProgress = (params: {
|
|
546
|
+
export type resetQuizProgress = (params: {
|
|
547
547
|
examGuid: string
|
|
548
548
|
examMetadataId?: string
|
|
549
549
|
}) => UserExamMetadata | undefined
|
|
@@ -691,14 +691,14 @@ export type fetchMockExams = () => MockExam[]
|
|
|
691
691
|
|
|
692
692
|
export type fetchMockExamQuestions = (params: { mockExamId: string }) => ExamData[]
|
|
693
693
|
|
|
694
|
-
export type fetchMockExamQuestionsV2 = (params: {
|
|
694
|
+
export type fetchMockExamQuestionsV2 = (params: {
|
|
695
695
|
mockExamId: string
|
|
696
696
|
includeMatrixQuestions?: boolean
|
|
697
697
|
includeMPMCQuestions?: boolean
|
|
698
698
|
includeBuildListQuestions?: boolean
|
|
699
699
|
}) => Question[]
|
|
700
700
|
|
|
701
|
-
export type fetchMockExamQuestionsV3 = (params: {
|
|
701
|
+
export type fetchMockExamQuestionsV3 = (params: {
|
|
702
702
|
mockExamId: string
|
|
703
703
|
includeMatrixQuestions?: boolean
|
|
704
704
|
includeMPMCQuestions?: boolean
|
|
@@ -792,7 +792,7 @@ export type fetchReferralInfo = (params: { bundleId: string }) => {
|
|
|
792
792
|
code: string
|
|
793
793
|
}
|
|
794
794
|
|
|
795
|
-
export type fetchPrebuiltQuizQuestions = (params: {
|
|
795
|
+
export type fetchPrebuiltQuizQuestions = (params: {
|
|
796
796
|
prebuiltQuizId: string
|
|
797
797
|
includeMPMCQuestions?: boolean
|
|
798
798
|
includeBuildListQuestions?: boolean
|
|
@@ -864,7 +864,7 @@ export type fetchUserExamMetadata = () => Promise<UserExamMetadataJSON[]>
|
|
|
864
864
|
|
|
865
865
|
export type deleteUserExamData = (params: { examGuid: string }) => Promise<void>
|
|
866
866
|
|
|
867
|
-
export type fetchRecallQuizQuestions = (params: {
|
|
867
|
+
export type fetchRecallQuizQuestions = (params: {
|
|
868
868
|
examMetadataId: string
|
|
869
869
|
includeMPMCQuestions?: boolean
|
|
870
870
|
includeBuildListQuestions?: boolean
|
|
@@ -878,19 +878,36 @@ export type upsertUserExamBackground = (params: {
|
|
|
878
878
|
hasTakenExam?: boolean
|
|
879
879
|
}) => UserExamBackgroundJSON
|
|
880
880
|
|
|
881
|
-
export type fetchConceptQuizQuestions = (params: {
|
|
881
|
+
export type fetchConceptQuizQuestions = (params: {
|
|
882
882
|
conceptQuizId: string
|
|
883
883
|
questionCount: number
|
|
884
884
|
}) => QuestionJSON[]
|
|
885
885
|
|
|
886
|
+
export type TSelectableConcept = {
|
|
887
|
+
conceptQuizId: string
|
|
888
|
+
concept: string
|
|
889
|
+
serials: string[]
|
|
890
|
+
}
|
|
891
|
+
|
|
886
892
|
export type fetchBYOConcepts = (params: {
|
|
887
893
|
examMetadataId: string
|
|
888
894
|
}) => {
|
|
889
|
-
concepts:
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
895
|
+
concepts: TSelectableConcept[]
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export type TWeakestConcept = {
|
|
899
|
+
conceptQuizId: string
|
|
900
|
+
concept: string
|
|
901
|
+
totalAnswersCount: number
|
|
902
|
+
totalCorrectAnswersCount: number
|
|
903
|
+
averageScore: number
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
export type fetchWeakestConcepts = (params: {
|
|
907
|
+
examMetadataId: string
|
|
908
|
+
}) => {
|
|
909
|
+
examHasConcepts: boolean
|
|
910
|
+
weakestConcepts: TWeakestConcept[]
|
|
894
911
|
}
|
|
895
912
|
|
|
896
913
|
export type fetchReadinessReportDetails = (params: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pocketprep/types",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.43",
|
|
4
4
|
"description": "Pocket Prep type declarations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"homepage": "https://github.com/Pocket-Prep/types#readme",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@types/parse": "3.0.9",
|
|
26
|
-
"stripe": "
|
|
26
|
+
"stripe": "19.3.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@stylistic/eslint-plugin": "2.8.0",
|