@quesmed/types-rn 2.0.13 → 2.0.16

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,39 @@
1
+ import { IConcept } from './Concept';
2
+ import { IQuestionComment } from './Question';
3
+ import { Id } from './Type';
4
+ import { IUser } from './User';
5
+ export declare const enum ENotificationType {
6
+ COMMENT = "COMMENT",
7
+ ANNOUNCEMENT = "ANNOUNCEMENT",
8
+ FRIEND_REQUEST = "FRIEND_REQUEST"
9
+ }
10
+ export declare const enum ENotificationActionType {
11
+ REPLY = "REPLY",
12
+ UP_VOTE = "UP_VOTE",
13
+ DOWN_VOTE = "DOWN_VOTE",
14
+ LIKE = "LIKE",
15
+ DISLIKE = "DISLIKE",
16
+ FEATURE = "FEATURE",
17
+ WARNING = "WARNING",
18
+ REQUESTED = "REQUESTED",
19
+ ACCEPTED = "ACCEPTED"
20
+ }
21
+ export interface INotification {
22
+ id: Id;
23
+ createdAt: number | Date;
24
+ updatedAt: number | Date;
25
+ userId: Id | null;
26
+ user?: IUser;
27
+ parentId: Id | null;
28
+ parentUser?: IUser;
29
+ commentId: Id | null;
30
+ comment?: IQuestionComment;
31
+ conceptId: Id | null;
32
+ concept?: IConcept;
33
+ description: string;
34
+ actionType: ENotificationActionType;
35
+ type: ENotificationType;
36
+ _global: boolean;
37
+ _read: boolean;
38
+ _deleted: boolean;
39
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -50,8 +50,7 @@ function createTimerPayload(osceMarksheet) {
50
50
  stage: EOsceStage.READING,
51
51
  state: EOsceTimerState.PAUSE,
52
52
  };
53
- if (!osceMarksheet.startedAt ||
54
- !osceMarksheet.endedAt ||
53
+ if (!osceMarksheet.endedAt ||
55
54
  !osceMarksheet.readingTime ||
56
55
  !osceMarksheet.stationTime ||
57
56
  !osceMarksheet.feedbackTime) {
@@ -66,7 +65,7 @@ function createTimerPayload(osceMarksheet) {
66
65
  endedAt = osceMarksheet.endedAt;
67
66
  }
68
67
  else {
69
- endedAt = Math.floor(osceMarksheet.endedAt.getTime() / 1000);
68
+ endedAt = Math.floor(new Date(osceMarksheet.endedAt).getTime() / 1000);
70
69
  }
71
70
  // calculate duration from pause timestamp or from current time
72
71
  let timeRemainingDuration = endedAt - Math.floor(Date.now() / 1000);
@@ -79,7 +78,7 @@ function createTimerPayload(osceMarksheet) {
79
78
  pausedAt = osceMarksheet.pausedAt;
80
79
  }
81
80
  else {
82
- pausedAt = Math.floor(osceMarksheet.pausedAt.getTime() / 1000);
81
+ pausedAt = Math.floor(new Date(osceMarksheet.pausedAt).getTime() / 1000);
83
82
  }
84
83
  timeRemainingDuration = endedAt - pausedAt;
85
84
  payload.state = EOsceTimerState.PAUSE;
package/models/User.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ICard } from './Card';
2
2
  import { IConcept } from './Concept';
3
3
  import { IMarksheet, IMarksheetMark } from './Marksheet';
4
+ import { INotification } from './Notification';
4
5
  import { IQuestion } from './Question';
5
6
  import { ISubscription } from './Subscription';
6
7
  import { ITodo } from './Todo';
@@ -29,6 +30,11 @@ export interface IPayload {
29
30
  stripeOsceSubscriptionEndDate: number | null;
30
31
  stripeBundleSubscriptionEndDate: number | null;
31
32
  }
33
+ export interface IDailyProgressInfo {
34
+ totalCount: number;
35
+ totalCorrect: number;
36
+ dateString: string;
37
+ }
32
38
  export interface IUser {
33
39
  id: Id;
34
40
  createdAt: number | Date;
@@ -75,11 +81,7 @@ export interface IUser {
75
81
  completedRedCardsCount?: number | null;
76
82
  dailyFeed: ITodo;
77
83
  dailyProgress: IDailyProgressInfo[];
78
- }
79
- export interface IDailyProgressInfo {
80
- totalCount: number;
81
- totalCorrect: number;
82
- dateString: string;
84
+ notifications: INotification[];
83
85
  }
84
86
  export declare function currentClassYear(createdAtUnix: number, classYear: IClassYear): IClassYear;
85
87
  export declare function currentClassGroup(createdAtUnix: number, classYear: IClassYear): EClassYearGroup;
package/models/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export * from './Feedback';
9
9
  export * from './File';
10
10
  export * from './Marksheet';
11
11
  export * from './MockTest';
12
+ export * from './Notification';
12
13
  export * from './OsceMarksheet';
13
14
  export * from './OsceStation';
14
15
  export * from './Picture';
package/models/index.js CHANGED
@@ -21,6 +21,7 @@ __exportStar(require("./Feedback"), exports);
21
21
  __exportStar(require("./File"), exports);
22
22
  __exportStar(require("./Marksheet"), exports);
23
23
  __exportStar(require("./MockTest"), exports);
24
+ __exportStar(require("./Notification"), exports);
24
25
  __exportStar(require("./OsceMarksheet"), exports);
25
26
  __exportStar(require("./OsceStation"), exports);
26
27
  __exportStar(require("./Picture"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -1,2 +1,3 @@
1
1
  export * from './algoliaSync';
2
2
  export * from './token';
3
+ export * from './notification';
@@ -12,3 +12,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./algoliaSync"), exports);
14
14
  __exportStar(require("./token"), exports);
15
+ __exportStar(require("./notification"), exports);
@@ -0,0 +1,15 @@
1
+ import { ENotificationActionType, ENotificationType, INotification } from '../../../models';
2
+ import { AdminData } from '../../types';
3
+ export interface IAdminAddNotificationInput {
4
+ description: string;
5
+ actionType: ENotificationActionType;
6
+ type: ENotificationType;
7
+ }
8
+ export declare type IAdminAddNotificationVar = {
9
+ data: IAdminAddNotificationInput;
10
+ };
11
+ export declare type IAdminAddNotificationData = AdminData<INotification, 'addNotification'>;
12
+ export declare type IAdminAddNotificationsVar = {
13
+ data: IAdminAddNotificationInput[];
14
+ };
15
+ export declare type IAdminAddNotificationsData = AdminData<INotification[], 'addNotifications'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,3 +8,4 @@ export * from './todo';
8
8
  export * from './token';
9
9
  export * from './users';
10
10
  export * from './video';
11
+ export * from './notification';
@@ -20,3 +20,4 @@ __exportStar(require("./todo"), exports);
20
20
  __exportStar(require("./token"), exports);
21
21
  __exportStar(require("./users"), exports);
22
22
  __exportStar(require("./video"), exports);
23
+ __exportStar(require("./notification"), exports);
@@ -0,0 +1,28 @@
1
+ import { ENotificationActionType, ENotificationType, Id, INotification } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export interface IAddNotificationInput {
4
+ parentId: Id | null;
5
+ userId: Id | null;
6
+ commentId: Id | null;
7
+ conceptId: Id | null;
8
+ description: string;
9
+ actionType: ENotificationActionType;
10
+ type: ENotificationType;
11
+ _global: boolean;
12
+ _read: boolean;
13
+ _deleted: boolean;
14
+ }
15
+ export declare type IAddNotificationVar = {
16
+ data: IAddNotificationInput;
17
+ };
18
+ export declare type IAddNotificationData = RestrictedData<graphqlNormalize & INotification, 'addNotification'>;
19
+ export declare type IAddNotificationsVar = {
20
+ data: IAddNotificationInput[];
21
+ };
22
+ export declare type IAddNotificationsData = RestrictedData<graphqlNormalize & INotification[], 'addNotifications'>;
23
+ export declare type IMarkNotificationAsReadVar = {
24
+ id: Id;
25
+ };
26
+ export declare type IMarkNotificationAsReadData = RestrictedData<graphqlNormalize & INotification, 'markNotificationAsRead'>;
27
+ export declare type IMarkAllNotificationsAsReadVar = null;
28
+ export declare type IMarkAllNotificationsAsReadData = RestrictedData<graphqlNormalize & INotification[], 'markAllNotificationsAsRead'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  export * from './global';
2
2
  export * from './marksheet';
3
3
  export * from './mockTests';
4
+ export * from './notification';
4
5
  export * from './osce';
5
6
  export * from './quesBook';
6
7
  export * from './replication';
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./global"), exports);
14
14
  __exportStar(require("./marksheet"), exports);
15
15
  __exportStar(require("./mockTests"), exports);
16
+ __exportStar(require("./notification"), exports);
16
17
  __exportStar(require("./osce"), exports);
17
18
  __exportStar(require("./quesBook"), exports);
18
19
  __exportStar(require("./replication"), exports);
@@ -0,0 +1,9 @@
1
+ import { INotification } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export interface INotificationsVar {
4
+ filter?: {
5
+ limit: number;
6
+ offset?: number;
7
+ };
8
+ }
9
+ export declare type INotificationsData = RestrictedData<graphqlNormalize & INotification[], 'notifications'>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from './osce';
2
+ export * from './notification';
@@ -11,3 +11,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./osce"), exports);
14
+ __exportStar(require("./notification"), exports);
@@ -0,0 +1,11 @@
1
+ import { Id, INotification } from '../../models';
2
+ import { RootData } from '../types';
3
+ export interface IOnNotificationAriseVar {
4
+ userId: Id;
5
+ }
6
+ export interface INewNotification {
7
+ userId: Id;
8
+ notification: INotification[];
9
+ }
10
+ export declare type IOnNotificationAriseData = RootData<INewNotification, 'payload'>;
11
+ export declare const ON_NOTIFICATION_ARISE = "ON_NOTIFICATION_ARISE";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ON_NOTIFICATION_ARISE = void 0;
4
+ exports.ON_NOTIFICATION_ARISE = 'ON_NOTIFICATION_ARISE';