@quesmed/types-rn 2.6.33 → 2.6.34
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/models/User.d.ts +5 -0
- package/models/User.js +34 -1
- package/package.json +1 -1
- package/resolvers/constants.d.ts +2 -7
- package/resolvers/constants.js +4 -19
- package/resolvers/fragments/marksheet.d.ts +1 -1
- package/resolvers/fragments/marksheet.js +7 -2
- package/resolvers/fragments/mockTest.js +1 -0
- package/resolvers/mutation/restricted/marksheet.d.ts +1 -1
- package/resolvers/mutation/restricted/marksheet.js +7 -1
- package/resolvers/mutation/restricted/mockTest.js +2 -0
- package/resolvers/mutation/restricted/stripe.js +1 -1
- package/resolvers/types.d.ts +7 -0
package/models/User.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import { ExtractKeysWithPattern } from '../resolvers/types';
|
|
1
2
|
import { ICard } from './Card';
|
|
2
3
|
import { IConcept } from './Concept';
|
|
3
4
|
import { IMarksheet } from './Marksheet';
|
|
4
5
|
import { INotification } from './Notification';
|
|
5
6
|
import { IOsceStation } from './OsceStation';
|
|
7
|
+
import { EProductType } from './Product';
|
|
6
8
|
import { IQuestion, IQuestionHighlights } from './Question';
|
|
7
9
|
import { ISubscription } from './Subscription';
|
|
8
10
|
import { ITodo } from './Todo';
|
|
9
11
|
import { Id } from './Type';
|
|
10
12
|
import { IUniversity } from './University';
|
|
11
13
|
import { IVideo } from './Video';
|
|
14
|
+
export type IUserSubsriptionDates = keyof ExtractKeysWithPattern<IPayload, 'EndDate'>;
|
|
12
15
|
export declare enum IAccessLevel {
|
|
13
16
|
SUBSCRIBER = "subscriber",
|
|
14
17
|
ADMINISTRATOR = "administrator",
|
|
@@ -18,6 +21,8 @@ export declare enum IAccessLevel {
|
|
|
18
21
|
}
|
|
19
22
|
export type IClassYear = 'Year 1' | 'Year 2' | 'Year 3' | 'Year 4' | 'Year 5' | 'Graduated' | 'PhD' | 'BSc' | 'MSc' | 'Beta Tester';
|
|
20
23
|
export declare const classYears: IClassYear[];
|
|
24
|
+
export declare const subscriptionDates: IUserSubsriptionDates[];
|
|
25
|
+
export declare const dateProductMapping: Record<IUserSubsriptionDates, EProductType>;
|
|
21
26
|
export declare enum EClassYearGroup {
|
|
22
27
|
PRECLINICAL = 0,
|
|
23
28
|
CLINICAL = 1
|
package/models/User.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.currentClassGroup = exports.currentClassYear = exports.EPracticeIntensity = exports.classYearGroup = exports.EUserLearningStatus = exports.EClassYearGroup = exports.classYears = exports.IAccessLevel = void 0;
|
|
3
|
+
exports.currentClassGroup = exports.currentClassYear = exports.EPracticeIntensity = exports.classYearGroup = exports.EUserLearningStatus = exports.EClassYearGroup = exports.dateProductMapping = exports.subscriptionDates = exports.classYears = exports.IAccessLevel = void 0;
|
|
4
4
|
const luxon_1 = require("luxon");
|
|
5
|
+
const Product_1 = require("./Product");
|
|
5
6
|
var IAccessLevel;
|
|
6
7
|
(function (IAccessLevel) {
|
|
7
8
|
IAccessLevel["SUBSCRIBER"] = "subscriber";
|
|
@@ -18,6 +19,38 @@ exports.classYears = [
|
|
|
18
19
|
'Year 5',
|
|
19
20
|
'Graduated',
|
|
20
21
|
];
|
|
22
|
+
exports.subscriptionDates = [
|
|
23
|
+
'qbankSubscriptionEndDate',
|
|
24
|
+
'osceSubscriptionEndDate',
|
|
25
|
+
'bundleSubscriptionEndDate',
|
|
26
|
+
'anatomySubscriptionEndDate',
|
|
27
|
+
'medicalSciencesSubscriptionEndDate',
|
|
28
|
+
'anatomyBundleSubscriptionEndDate',
|
|
29
|
+
'mrcpPart1SubscriptionEndDate',
|
|
30
|
+
'mrcpPart2SubscriptionEndDate',
|
|
31
|
+
'pacesSubscriptionEndDate',
|
|
32
|
+
'msraSubscriptionEndDate',
|
|
33
|
+
'anaestheticsInterviewSubscriptionEndDate',
|
|
34
|
+
'cstInterviewSubscriptionEndDate',
|
|
35
|
+
'imtInterviewSubscriptionEndDate',
|
|
36
|
+
'radiologyInterviewSubscriptionEndDate',
|
|
37
|
+
];
|
|
38
|
+
exports.dateProductMapping = {
|
|
39
|
+
qbankSubscriptionEndDate: Product_1.EProductType.QBANK,
|
|
40
|
+
osceSubscriptionEndDate: Product_1.EProductType.OSCE,
|
|
41
|
+
bundleSubscriptionEndDate: Product_1.EProductType.BUNDLE,
|
|
42
|
+
anatomySubscriptionEndDate: Product_1.EProductType.ANATOMY,
|
|
43
|
+
medicalSciencesSubscriptionEndDate: Product_1.EProductType.MEDICAL_SCIENCES,
|
|
44
|
+
anatomyBundleSubscriptionEndDate: Product_1.EProductType.ANATOMY_BUNDLE,
|
|
45
|
+
mrcpPart1SubscriptionEndDate: Product_1.EProductType.MRCP_PART1,
|
|
46
|
+
mrcpPart2SubscriptionEndDate: Product_1.EProductType.MRCP_PART2,
|
|
47
|
+
pacesSubscriptionEndDate: Product_1.EProductType.PACES,
|
|
48
|
+
msraSubscriptionEndDate: Product_1.EProductType.MSRA,
|
|
49
|
+
anaestheticsInterviewSubscriptionEndDate: Product_1.EProductType.INTERVIEW_ANAESTHETICS,
|
|
50
|
+
cstInterviewSubscriptionEndDate: Product_1.EProductType.INTERVIEW_IMT,
|
|
51
|
+
imtInterviewSubscriptionEndDate: Product_1.EProductType.QBANK,
|
|
52
|
+
radiologyInterviewSubscriptionEndDate: Product_1.EProductType.INTERVIEW_RADIOLOGY,
|
|
53
|
+
};
|
|
21
54
|
var EClassYearGroup;
|
|
22
55
|
(function (EClassYearGroup) {
|
|
23
56
|
EClassYearGroup[EClassYearGroup["PRECLINICAL"] = 0] = "PRECLINICAL";
|
package/package.json
CHANGED
package/resolvers/constants.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { EMockTestType, EProductType, ETopicType } from
|
|
2
|
-
import { DB_TYPE } from
|
|
3
|
-
/**
|
|
4
|
-
* TODO:: move this config in database so that we can swap things in-out more easily
|
|
5
|
-
* can be part of entitlement table or another
|
|
6
|
-
*/
|
|
1
|
+
import { EMockTestType, EProductType, ETopicType } from '../models';
|
|
2
|
+
import { DB_TYPE } from './enums';
|
|
7
3
|
export declare const productMapping: Partial<Record<EProductType, {
|
|
8
4
|
db: DB_TYPE;
|
|
9
|
-
builderTopicType: ETopicType[];
|
|
10
5
|
topicType: ETopicType[];
|
|
11
6
|
mockType: EMockTestType[];
|
|
12
7
|
}>>;
|
package/resolvers/constants.js
CHANGED
|
@@ -17,93 +17,78 @@ const ALL_MOCKS_WITHOUT_ANATOMY = [
|
|
|
17
17
|
models_1.EMockTestType.UKMLA,
|
|
18
18
|
];
|
|
19
19
|
const ALL_MOCKS = [models_1.EMockTestType.ANATOMY_SPOTTER, ...ALL_MOCKS_WITHOUT_ANATOMY];
|
|
20
|
-
/**
|
|
21
|
-
* TODO:: move this config in database so that we can swap things in-out more easily
|
|
22
|
-
* can be part of entitlement table or another
|
|
23
|
-
*/
|
|
24
20
|
exports.productMapping = {
|
|
25
21
|
[models_1.EProductType.QBANK]: {
|
|
26
22
|
db: enums_1.DB_TYPE.FINALS,
|
|
27
23
|
topicType: ALL_TOPIC_TYPE_WITHOUT_ANATOMY,
|
|
28
|
-
builderTopicType: ALL_TOPIC_TYPE_WITHOUT_ANATOMY,
|
|
29
24
|
mockType: ALL_MOCKS_WITHOUT_ANATOMY,
|
|
30
25
|
},
|
|
31
26
|
[models_1.EProductType.OSCE]: {
|
|
32
27
|
db: enums_1.DB_TYPE.FINALS,
|
|
33
28
|
topicType: ALL_TOPIC_TYPE,
|
|
34
|
-
builderTopicType: ALL_TOPIC_TYPE,
|
|
35
29
|
mockType: ALL_MOCKS,
|
|
36
30
|
},
|
|
37
31
|
[models_1.EProductType.BUNDLE]: {
|
|
38
32
|
db: enums_1.DB_TYPE.FINALS,
|
|
39
33
|
topicType: ALL_TOPIC_TYPE_WITHOUT_ANATOMY,
|
|
40
|
-
builderTopicType: ALL_TOPIC_TYPE_WITHOUT_ANATOMY,
|
|
41
34
|
mockType: ALL_MOCKS_WITHOUT_ANATOMY,
|
|
42
35
|
},
|
|
43
36
|
[models_1.EProductType.ANATOMY]: {
|
|
44
37
|
db: enums_1.DB_TYPE.FINALS,
|
|
45
38
|
topicType: [models_1.ETopicType.ANATOMY],
|
|
46
|
-
builderTopicType: [models_1.ETopicType.ANATOMY],
|
|
47
39
|
mockType: [models_1.EMockTestType.ANATOMY_SPOTTER],
|
|
48
40
|
},
|
|
49
41
|
[models_1.EProductType.MEDICAL_SCIENCES]: {
|
|
50
42
|
db: enums_1.DB_TYPE.FINALS,
|
|
51
|
-
builderTopicType: [models_1.ETopicType.PRE_CLINICAL],
|
|
52
43
|
topicType: [models_1.ETopicType.PRE_CLINICAL],
|
|
53
44
|
mockType: [models_1.EMockTestType.UNIVERSITY_SPECIFIC],
|
|
54
45
|
},
|
|
55
46
|
[models_1.EProductType.ANATOMY_BUNDLE]: {
|
|
56
47
|
db: enums_1.DB_TYPE.FINALS,
|
|
57
48
|
topicType: [models_1.ETopicType.ANATOMY, models_1.ETopicType.PRE_CLINICAL],
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
mockType: [
|
|
50
|
+
models_1.EMockTestType.ANATOMY_SPOTTER,
|
|
51
|
+
models_1.EMockTestType.UNIVERSITY_SPECIFIC,
|
|
52
|
+
],
|
|
60
53
|
},
|
|
61
54
|
[models_1.EProductType.MRCP_PART1]: {
|
|
62
55
|
db: enums_1.DB_TYPE.MRCP,
|
|
63
56
|
topicType: [models_1.ETopicType.CLINICAL],
|
|
64
|
-
builderTopicType: [models_1.ETopicType.CLINICAL],
|
|
65
57
|
mockType: [models_1.EMockTestType.MRCP],
|
|
66
58
|
},
|
|
67
59
|
[models_1.EProductType.MRCP_PART2]: {
|
|
68
60
|
db: enums_1.DB_TYPE.MRCP,
|
|
69
61
|
topicType: [models_1.ETopicType.CLINICAL],
|
|
70
|
-
builderTopicType: [models_1.ETopicType.CLINICAL],
|
|
71
62
|
mockType: [models_1.EMockTestType.MRCP],
|
|
72
63
|
},
|
|
73
64
|
[models_1.EProductType.PACES]: {
|
|
74
65
|
db: enums_1.DB_TYPE.MRCP,
|
|
75
66
|
topicType: [models_1.ETopicType.OSCE],
|
|
76
|
-
builderTopicType: [models_1.ETopicType.OSCE],
|
|
77
67
|
mockType: ALL_MOCKS,
|
|
78
68
|
},
|
|
79
69
|
[models_1.EProductType.MSRA]: {
|
|
80
70
|
db: enums_1.DB_TYPE.FINALS,
|
|
81
71
|
topicType: [models_1.ETopicType.CLINICAL],
|
|
82
|
-
builderTopicType: [models_1.ETopicType.CLINICAL, models_1.ETopicType.SJT],
|
|
83
72
|
mockType: ALL_MOCKS,
|
|
84
73
|
},
|
|
85
74
|
[models_1.EProductType.INTERVIEW_ANAESTHETICS]: {
|
|
86
75
|
db: enums_1.DB_TYPE.FINALS,
|
|
87
76
|
topicType: [models_1.ETopicType.INTERVIEW_ANAESTHETICS],
|
|
88
|
-
builderTopicType: [models_1.ETopicType.INTERVIEW_ANAESTHETICS],
|
|
89
77
|
mockType: ALL_MOCKS,
|
|
90
78
|
},
|
|
91
79
|
[models_1.EProductType.INTERVIEW_CST]: {
|
|
92
80
|
db: enums_1.DB_TYPE.FINALS,
|
|
93
81
|
topicType: [models_1.ETopicType.INTERVIEW_CST],
|
|
94
|
-
builderTopicType: [models_1.ETopicType.INTERVIEW_CST],
|
|
95
82
|
mockType: ALL_MOCKS,
|
|
96
83
|
},
|
|
97
84
|
[models_1.EProductType.INTERVIEW_IMT]: {
|
|
98
85
|
db: enums_1.DB_TYPE.FINALS,
|
|
99
86
|
topicType: [models_1.ETopicType.INTERVIEW_IMT],
|
|
100
|
-
builderTopicType: [models_1.ETopicType.INTERVIEW_IMT],
|
|
101
87
|
mockType: ALL_MOCKS,
|
|
102
88
|
},
|
|
103
89
|
[models_1.EProductType.INTERVIEW_RADIOLOGY]: {
|
|
104
90
|
db: enums_1.DB_TYPE.FINALS,
|
|
105
91
|
topicType: [models_1.ETopicType.INTERVIEW_RADIOLOGY],
|
|
106
|
-
builderTopicType: [models_1.ETopicType.INTERVIEW_RADIOLOGY],
|
|
107
92
|
mockType: ALL_MOCKS,
|
|
108
93
|
},
|
|
109
94
|
};
|
|
@@ -11,5 +11,5 @@ export declare const MODIFY_MARKSHEET_STATE_FRAGMENT: import("@apollo/client").D
|
|
|
11
11
|
export declare const MODIFY_TOPIC_SELECTION_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
12
12
|
export declare const MODIFY_CURRENT_MARK_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
13
13
|
export declare const MARK_FLAGGED_FIELD: import("@apollo/client").DocumentNode;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const MODIFY_MARKSHEET_COMPLETED_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
15
15
|
export declare const NEW_MARK_FIELDS: import("@apollo/client").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NEW_MARK_FIELDS = exports.
|
|
3
|
+
exports.NEW_MARK_FIELDS = exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = exports.MARK_FLAGGED_FIELD = exports.MODIFY_CURRENT_MARK_FRAGMENT = exports.MODIFY_TOPIC_SELECTION_FRAGMENT = exports.MODIFY_MARKSHEET_STATE_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_STRIKED_FRAGMENT = exports.MODIFY_MARKSHEET_MARK_QUESTIONCHOICEID_FRAGMENT = exports.MODIFY_CURRENT_MARKSHEET_MARK_FRAGMENT = exports.MARKSHEET_FIELDS = exports.BUILDER_CONFIG_FIELDS = exports.MARKSHEET_MARK_FIELDS = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const question_1 = require("./question");
|
|
6
6
|
exports.MARKSHEET_MARK_FIELDS = (0, client_1.gql) `
|
|
@@ -128,9 +128,14 @@ exports.MARK_FLAGGED_FIELD = (0, client_1.gql) `
|
|
|
128
128
|
flagged
|
|
129
129
|
}
|
|
130
130
|
`;
|
|
131
|
-
exports.
|
|
131
|
+
exports.MODIFY_MARKSHEET_COMPLETED_FRAGMENT = (0, client_1.gql) `
|
|
132
132
|
fragment MarksheetCompleted on Marksheet {
|
|
133
|
+
timeTaken
|
|
133
134
|
completed
|
|
135
|
+
correct
|
|
136
|
+
incorrect
|
|
137
|
+
duration
|
|
138
|
+
endedAt
|
|
134
139
|
}
|
|
135
140
|
`;
|
|
136
141
|
exports.NEW_MARK_FIELDS = (0, client_1.gql) `
|
|
@@ -242,7 +242,7 @@ export interface IEndMarksheetVar {
|
|
|
242
242
|
}
|
|
243
243
|
export type IEndMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'endMarksheet'>;
|
|
244
244
|
export declare const END_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
245
|
-
export declare const updateCacheOnEndMarksheet: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IEndMarksheetData>, options: ApolloUpdateOptions) => void;
|
|
245
|
+
export declare const updateCacheOnEndMarksheet: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IEndMarksheetData>, options: ApolloUpdateOptions<IEndMarksheetVar>) => void;
|
|
246
246
|
export declare const optimisticEndMarksheet: (marksheet: IMarksheet) => {
|
|
247
247
|
restricted: {
|
|
248
248
|
__typename: string;
|
|
@@ -389,6 +389,7 @@ exports.END_MARKSHEET = (0, client_1.gql) `
|
|
|
389
389
|
endMarksheet(marksheetId: $marksheetId) {
|
|
390
390
|
id
|
|
391
391
|
timeTaken
|
|
392
|
+
startedAt
|
|
392
393
|
endedAt
|
|
393
394
|
completed
|
|
394
395
|
passingMark
|
|
@@ -411,8 +412,13 @@ const updateCacheOnEndMarksheet = (cache, result, options) => {
|
|
|
411
412
|
id: cache.identify({ id, __typename: 'Marksheet' }),
|
|
412
413
|
data: {
|
|
413
414
|
completed: true,
|
|
415
|
+
timeTaken: endMarksheet.timeTaken,
|
|
416
|
+
correct: endMarksheet.correct,
|
|
417
|
+
incorrect: endMarksheet.incorrect,
|
|
418
|
+
duration: endMarksheet.duration,
|
|
419
|
+
endedAt: endMarksheet.endedAt,
|
|
414
420
|
},
|
|
415
|
-
fragment: marksheet_1.
|
|
421
|
+
fragment: marksheet_1.MODIFY_MARKSHEET_COMPLETED_FRAGMENT,
|
|
416
422
|
});
|
|
417
423
|
};
|
|
418
424
|
exports.updateCacheOnEndMarksheet = updateCacheOnEndMarksheet;
|
|
@@ -60,6 +60,7 @@ exports.END_MOCK_TEST = (0, client_1.gql) `
|
|
|
60
60
|
restricted {
|
|
61
61
|
endMockTest(marksheetId: $marksheetId) {
|
|
62
62
|
id
|
|
63
|
+
timeTaken
|
|
63
64
|
startedAt
|
|
64
65
|
endedAt
|
|
65
66
|
mockTestId
|
|
@@ -83,6 +84,7 @@ const updateCacheOnEndMockTest = (cache, result, options) => {
|
|
|
83
84
|
id: cache.identify({ id, __typename: 'Marksheet' }),
|
|
84
85
|
data: {
|
|
85
86
|
completed: true,
|
|
87
|
+
timeTaken: endMockTest.timeTaken,
|
|
86
88
|
correct: endMockTest.correct,
|
|
87
89
|
incorrect: endMockTest.incorrect,
|
|
88
90
|
duration: endMockTest.duration,
|
|
@@ -4,7 +4,7 @@ exports.updateSubscriptionOnCancelOrRenew = exports.CANCEL_SUBSCRIPTION = void 0
|
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const restricted_1 = require("../../query/restricted");
|
|
6
6
|
exports.CANCEL_SUBSCRIPTION = (0, client_1.gql) `
|
|
7
|
-
mutation
|
|
7
|
+
mutation CancelSubscription($subscriptionId: Int!) {
|
|
8
8
|
restricted {
|
|
9
9
|
cancelSubscription(subscriptionId: $subscriptionId) {
|
|
10
10
|
id
|
package/resolvers/types.d.ts
CHANGED
|
@@ -9,3 +9,10 @@ export type AdminData<T, K extends keyof any> = {
|
|
|
9
9
|
};
|
|
10
10
|
export type RootData<T, K extends keyof any> = Record<K, T>;
|
|
11
11
|
export type Nullable<T> = T | null;
|
|
12
|
+
export type ExtractKeysWithPattern<U, V extends string> = {
|
|
13
|
+
[K in keyof U as K extends `${infer Prefix}${V}` ? K : never]: U[K];
|
|
14
|
+
};
|
|
15
|
+
export type DotPrefix<T extends string> = T extends '' ? '' : `.${T}`;
|
|
16
|
+
export type WithRequired<T, K extends keyof T> = T & {
|
|
17
|
+
[P in K]-?: T[P];
|
|
18
|
+
};
|