@quesmed/types-rn 2.6.8 → 2.6.10

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/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare const ERRORS: {
7
7
  TOKEN_EXPIRED: string;
8
8
  SUBSCRIPTION_EXPIRED: string;
9
9
  PERMISSION_INVALID: string;
10
+ SESSION_MISSING: string;
10
11
  };
11
12
  export declare enum AlgoliaIndex {
12
13
  Questions = "questions",
package/index.js CHANGED
@@ -37,6 +37,7 @@ exports.ERRORS = {
37
37
  TOKEN_EXPIRED: 'Expired token.',
38
38
  SUBSCRIPTION_EXPIRED: 'Expired subscription.',
39
39
  PERMISSION_INVALID: 'Invalid permission.',
40
+ SESSION_MISSING: 'No Session Found, Please login again',
40
41
  };
41
42
  var AlgoliaIndex;
42
43
  (function (AlgoliaIndex) {
@@ -11,6 +11,14 @@ export declare enum EMarksheetState {
11
11
  STATION = 3,
12
12
  RESULT = 4
13
13
  }
14
+ export declare enum MARKSHEET_SOURCE {
15
+ QUIZ = "Quiz",
16
+ QUICK_BUILD_QUIZ = "Quick build quiz",
17
+ UKMLA_QUIZ = "UKMLA Quiz",
18
+ GROUP_STUDY = "Qbank group study",
19
+ FLAGGED_QUESTIONS_REVIEW = "Flagged Questions Review",
20
+ FLAGGED_QUESTIONS_QUIZ = "Flagged Questions Quiz"
21
+ }
14
22
  export declare enum EStudyAction {
15
23
  START = 0,
16
24
  JOIN = 1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EMarksheetAction = exports.EMarksheetType = exports.EStudyAction = exports.EMarksheetState = void 0;
3
+ exports.EMarksheetAction = exports.EMarksheetType = exports.EStudyAction = exports.MARKSHEET_SOURCE = exports.EMarksheetState = void 0;
4
4
  var EMarksheetState;
5
5
  (function (EMarksheetState) {
6
6
  EMarksheetState[EMarksheetState["LOBBY"] = 0] = "LOBBY";
@@ -9,6 +9,15 @@ var EMarksheetState;
9
9
  EMarksheetState[EMarksheetState["STATION"] = 3] = "STATION";
10
10
  EMarksheetState[EMarksheetState["RESULT"] = 4] = "RESULT";
11
11
  })(EMarksheetState = exports.EMarksheetState || (exports.EMarksheetState = {}));
12
+ var MARKSHEET_SOURCE;
13
+ (function (MARKSHEET_SOURCE) {
14
+ MARKSHEET_SOURCE["QUIZ"] = "Quiz";
15
+ MARKSHEET_SOURCE["QUICK_BUILD_QUIZ"] = "Quick build quiz";
16
+ MARKSHEET_SOURCE["UKMLA_QUIZ"] = "UKMLA Quiz";
17
+ MARKSHEET_SOURCE["GROUP_STUDY"] = "Qbank group study";
18
+ MARKSHEET_SOURCE["FLAGGED_QUESTIONS_REVIEW"] = "Flagged Questions Review";
19
+ MARKSHEET_SOURCE["FLAGGED_QUESTIONS_QUIZ"] = "Flagged Questions Quiz";
20
+ })(MARKSHEET_SOURCE = exports.MARKSHEET_SOURCE || (exports.MARKSHEET_SOURCE = {}));
12
21
  var EStudyAction;
13
22
  (function (EStudyAction) {
14
23
  EStudyAction[EStudyAction["START"] = 0] = "START";
@@ -1,6 +1,6 @@
1
- import { ETopicType, ITopic } from './Topic';
1
+ import { IConcept } from './Concept';
2
+ import { ETopicType } from './Topic';
2
3
  import { Id } from './Type';
3
- import { IUniversity } from './University';
4
4
  export declare enum EPresetType {
5
5
  PRE_DEFINED = 0,
6
6
  CUSTOM = 1
@@ -22,8 +22,7 @@ export interface IPreset {
22
22
  redCards: number;
23
23
  completedCards: number;
24
24
  totalCards: number;
25
- university: IUniversity;
26
- topics: ITopic[];
25
+ concepts: IConcept[];
27
26
  }
28
27
  export interface IPresetConcepts {
29
28
  id: Id;
@@ -0,0 +1,24 @@
1
+ import { Id } from "./Type";
2
+ export declare enum ESessionStatus {
3
+ INVALID = 0,
4
+ VALID = 1,
5
+ STRIPE_SUB_CHANGE = 2,
6
+ REVENUECAT_SUB_CHANGE = 3,
7
+ PASSWORD_CHANGE = 4
8
+ }
9
+ export interface ISession {
10
+ id: Id;
11
+ createdAt: number | Date;
12
+ updatedAt: number | Date;
13
+ userId: Id;
14
+ sessionId: string;
15
+ ip: string;
16
+ status: ESessionStatus;
17
+ meta: {
18
+ 'accept-language': string;
19
+ 'user-agent': string;
20
+ 'sec-ch-ua-platform': string;
21
+ 'sec-ch-ua': string;
22
+ 'sec-ch-ua-mobile': string;
23
+ };
24
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ESessionStatus = void 0;
4
+ var ESessionStatus;
5
+ (function (ESessionStatus) {
6
+ ESessionStatus[ESessionStatus["INVALID"] = 0] = "INVALID";
7
+ ESessionStatus[ESessionStatus["VALID"] = 1] = "VALID";
8
+ ESessionStatus[ESessionStatus["STRIPE_SUB_CHANGE"] = 2] = "STRIPE_SUB_CHANGE";
9
+ ESessionStatus[ESessionStatus["REVENUECAT_SUB_CHANGE"] = 3] = "REVENUECAT_SUB_CHANGE";
10
+ ESessionStatus[ESessionStatus["PASSWORD_CHANGE"] = 4] = "PASSWORD_CHANGE";
11
+ })(ESessionStatus = exports.ESessionStatus || (exports.ESessionStatus = {}));
package/models/Video.d.ts CHANGED
@@ -33,6 +33,7 @@ export interface IVideo {
33
33
  sent24hrPushAt: number | Date | null;
34
34
  viewsToday?: number | null;
35
35
  status?: EUserLearningStatus | null;
36
+ userViewed?: boolean;
36
37
  }
37
38
  export interface IVideoOsceStation {
38
39
  id: Id;
@@ -49,6 +50,7 @@ export interface IVideoConcept {
49
50
  export interface IVideoViews {
50
51
  id: Id;
51
52
  videoId: number;
52
- date: number | Date;
53
- views: number;
53
+ userId: Id;
54
+ createdAt: number | Date;
55
+ lastViewedAt: number | Date;
54
56
  }
package/models/index.d.ts CHANGED
@@ -29,4 +29,5 @@ export * from './Type';
29
29
  export * from './UkmlaTopic';
30
30
  export * from './University';
31
31
  export * from './User';
32
+ export * from './UserSession';
32
33
  export * from './Video';
package/models/index.js CHANGED
@@ -45,4 +45,5 @@ __exportStar(require("./Type"), exports);
45
45
  __exportStar(require("./UkmlaTopic"), exports);
46
46
  __exportStar(require("./University"), exports);
47
47
  __exportStar(require("./User"), exports);
48
+ __exportStar(require("./UserSession"), exports);
48
49
  __exportStar(require("./Video"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.8",
3
+ "version": "2.6.10",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -25,6 +25,7 @@ exports.USER_FIELDS = (0, client_1.gql) `
25
25
  id
26
26
  productId
27
27
  periodEndAt
28
+ endedAt
28
29
  product {
29
30
  id
30
31
  name
@@ -64,18 +64,10 @@ exports.DUPLICATE_PRESET = (0, client_1.gql) `
64
64
  completedCards
65
65
  totalCards
66
66
  userId
67
- university {
67
+ concepts {
68
68
  id
69
69
  name
70
- country
71
- }
72
- topics {
73
- id
74
- name
75
- concepts {
76
- id
77
- name
78
- }
70
+ topicId
79
71
  }
80
72
  }
81
73
  }
@@ -125,18 +117,10 @@ exports.EDIT_PRESET = (0, client_1.gql) `
125
117
  completedCards
126
118
  totalCards
127
119
  userId
128
- university {
120
+ concepts {
129
121
  id
130
122
  name
131
- country
132
- }
133
- topics {
134
- id
135
- name
136
- concepts {
137
- id
138
- name
139
- }
123
+ topicId
140
124
  }
141
125
  }
142
126
  }
@@ -162,18 +146,10 @@ exports.CREATE_PRESET = (0, client_1.gql) `
162
146
  completedCards
163
147
  totalCards
164
148
  userId
165
- university {
166
- id
167
- name
168
- country
169
- }
170
- topics {
149
+ concepts {
171
150
  id
172
151
  name
173
- concepts {
174
- id
175
- name
176
- }
152
+ topicId
177
153
  }
178
154
  }
179
155
  }
@@ -2,6 +2,11 @@ import { ApolloCache } from '@apollo/client';
2
2
  import { EUserLearningStatus, IUser, IUserConceptStatus, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
3
3
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
4
4
  import { RestrictedData, graphqlNormalize } from '../../types';
5
+ export declare const LOGOUT_USER: import("@apollo/client").DocumentNode;
6
+ export interface ILogoutUserVar {
7
+ all: boolean;
8
+ }
9
+ export type ILogoutUserData = RestrictedData<graphqlNormalize & boolean, 'logoutUser'>;
5
10
  export declare const RESET_PROGRESS: import("@apollo/client").DocumentNode;
6
11
  export interface IResetProgressVar {
7
12
  questions?: boolean;
@@ -1,8 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = void 0;
3
+ exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const models_1 = require("../../../models");
6
+ exports.LOGOUT_USER = (0, client_1.gql) `
7
+ mutation LogoutUser($all: Boolean!) {
8
+ restricted {
9
+ logoutUser(all: $all)
10
+ }
11
+ }
12
+ `;
6
13
  exports.RESET_PROGRESS = (0, client_1.gql) `
7
14
  mutation ResetProgress($questions: Boolean, $cards: Boolean) {
8
15
  restricted {
@@ -34,18 +34,10 @@ exports.PRESETS = (0, client_1.gql) `
34
34
  completedCards
35
35
  totalCards
36
36
  userId
37
- university {
37
+ concepts {
38
38
  id
39
39
  name
40
- country
41
- }
42
- topics {
43
- id
44
- name
45
- concepts {
46
- id
47
- name
48
- }
40
+ topicId
49
41
  }
50
42
  }
51
43
  }
@@ -71,18 +63,10 @@ exports.PRE_DEFINED_PRESETS = (0, client_1.gql) `
71
63
  completedCards
72
64
  totalCards
73
65
  userId
74
- university {
66
+ concepts {
75
67
  id
76
68
  name
77
- country
78
- }
79
- topics {
80
- id
81
- name
82
- concepts {
83
- id
84
- name
85
- }
69
+ topicId
86
70
  }
87
71
  }
88
72
  }
@@ -108,18 +92,10 @@ exports.PRESET = (0, client_1.gql) `
108
92
  completedCards
109
93
  totalCards
110
94
  userId
111
- university {
112
- id
113
- name
114
- country
115
- }
116
- topics {
95
+ concepts {
117
96
  id
118
97
  name
119
- concepts {
120
- id
121
- name
122
- }
98
+ topicId
123
99
  }
124
100
  }
125
101
  }
@@ -22,6 +22,7 @@ exports.GET_USER_SUBSCRIPTIONS = (0, client_1.gql) `
22
22
  id
23
23
  productId
24
24
  periodEndAt
25
+ endedAt
25
26
  product {
26
27
  id
27
28
  name
@@ -11,10 +11,12 @@ exports.VIDEO = (0, client_1.gql) `
11
11
  museId
12
12
  viewsToday
13
13
  views
14
+ userViewed
14
15
  thumbnail
15
16
  concepts {
16
17
  id
17
18
  name
19
+ status
18
20
  topic {
19
21
  id
20
22
  name
@@ -21,6 +21,7 @@ exports.SAMPLE_VIDEOS = (0, client_1.gql) `
21
21
  thumbnail
22
22
  viewsToday
23
23
  views
24
+ userViewed
24
25
  live
25
26
  description
26
27
  duration
@@ -69,6 +70,7 @@ exports.SAMPLE_VIDEO = (0, client_1.gql) `
69
70
  museId
70
71
  viewsToday
71
72
  views
73
+ userViewed
72
74
  thumbnail
73
75
  concepts {
74
76
  id