@quesmed/types 1.4.4 → 1.4.8

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.
@@ -1,8 +1,8 @@
1
1
  import { Id } from './Type';
2
2
  export interface IAuthor {
3
3
  id: Id;
4
- createdAt: string | Date;
5
- updatedAt: string | Date;
4
+ createdAt: number | Date;
5
+ updatedAt: number | Date;
6
6
  name: string;
7
7
  qualifications: string | null;
8
8
  title: string;
package/models/Book.d.ts CHANGED
@@ -2,11 +2,11 @@ import { IAuthor } from './Author';
2
2
  import { Id } from './Type';
3
3
  export interface IBook {
4
4
  id: Id;
5
- createdAt: string | Date;
6
- updatedAt: string | Date;
5
+ createdAt: number | Date;
6
+ updatedAt: number | Date;
7
7
  name: string;
8
8
  publisher: string;
9
- publishDate: string | Date;
9
+ publishDate: number | Date;
10
10
  pages: number;
11
11
  format: string;
12
12
  language: string;
package/models/Card.d.ts CHANGED
@@ -4,8 +4,8 @@ import { ITopic } from './Topic';
4
4
  import { Id } from './Type';
5
5
  export interface ICard {
6
6
  id: Id;
7
- createdAt: Date | string;
8
- updatedAt: Date | string;
7
+ createdAt: number | Date;
8
+ updatedAt: number | Date;
9
9
  topic: ITopic;
10
10
  conceptId: Id;
11
11
  concept: IConcept;
@@ -4,8 +4,8 @@ import { ETopicType } from './Topic';
4
4
  import { Id } from './Type';
5
5
  export interface IChapter {
6
6
  id: Id;
7
- createdAt: string | Date;
8
- updatedAt: string | Date;
7
+ createdAt: number | Date;
8
+ updatedAt: number | Date;
9
9
  explanation: string | null;
10
10
  typeId: ETopicType | null;
11
11
  pictures: IChapterPicture[];
@@ -4,8 +4,8 @@ import { Id } from './Type';
4
4
  import { IVideo } from './Video';
5
5
  export interface IConcept {
6
6
  id: Id;
7
- createdAt: string | Date;
8
- updatedAt: string | Date;
7
+ createdAt: number | Date;
8
+ updatedAt: number | Date;
9
9
  name: string;
10
10
  chapterId: Id;
11
11
  chapter: IChapter;
@@ -1,7 +1,7 @@
1
1
  import { Id } from './Type';
2
2
  export interface IFeedback {
3
3
  id: Id;
4
- createdAt: string | Date;
4
+ createdAt: number | Date;
5
5
  name: string;
6
6
  feedback: string;
7
7
  university: string;
package/models/File.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Id } from './Type';
2
2
  export interface IFile {
3
3
  id: Id;
4
- createdAt: string | Date;
5
- updatedAt: string | Date;
4
+ createdAt: number | Date;
5
+ updatedAt: number | Date;
6
6
  title: string;
7
7
  url: string;
8
8
  videoId?: number;
@@ -2,8 +2,8 @@ import { IPrescribeMark, IQuestion, IQuestionQAAnswer } from './Question';
2
2
  import { Id } from './Type';
3
3
  export interface IMarksheet {
4
4
  id: Id;
5
- createdAt: Date | string;
6
- endedAt: Date | string;
5
+ createdAt: number | Date;
6
+ endedAt: number | Date;
7
7
  source: string;
8
8
  marks: IMarksheetMark[];
9
9
  mockTestId: number | null;
@@ -32,7 +32,7 @@ export interface IMarksheetMark {
32
32
  export interface IDiscussion {
33
33
  username: string;
34
34
  userId: Id;
35
- createdAt: Date | string;
35
+ createdAt: number | Date;
36
36
  comment: string;
37
37
  like: number;
38
38
  dislike: number;
@@ -16,6 +16,6 @@ export interface IUserMockTest {
16
16
  incorrect: number;
17
17
  totalQuestions: number;
18
18
  lastMarksheetId?: Id;
19
- lastMarksheetStartedAt?: Date | string;
20
- lastMarksheetEndedAt?: Date | string;
19
+ lastMarksheetStartedAt?: number | Date;
20
+ lastMarksheetEndedAt?: number | Date;
21
21
  }
@@ -3,7 +3,7 @@ import { Id } from './Type';
3
3
  import { IUser } from './User';
4
4
  export interface IOsceMarksheetUser {
5
5
  id: Id | null;
6
- createdAt: Date | string | null;
6
+ createdAt: number | Date | null;
7
7
  osceMarksheetId: Id;
8
8
  userId: Id | null;
9
9
  user: IUser | null;
@@ -38,8 +38,8 @@ export declare enum EOsceMarksheetAction {
38
38
  }
39
39
  export interface IOsceMarksheet {
40
40
  id: Id;
41
- createdAt: Date | string;
42
- updatedAt: Date | string;
41
+ createdAt: number | Date;
42
+ updatedAt: number | Date;
43
43
  timeTaken: number;
44
44
  osceStationId: Id;
45
45
  osceStation?: IOsceStation;
@@ -53,8 +53,8 @@ export interface IOsceMarksheet {
53
53
  readingTime: number;
54
54
  stationTime: number;
55
55
  feedbackTime: number;
56
- startedAt: Date | string;
57
- endedAt: Date | string;
56
+ startedAt: number | Date;
57
+ endedAt: number | Date;
58
58
  timeRemaining: number;
59
59
  marks: IOsceMarksheetMark[];
60
60
  users: IOsceMarksheetUser[];
@@ -24,8 +24,8 @@ export declare enum EOsceType {
24
24
  }
25
25
  export interface IOsceStation {
26
26
  id: Id;
27
- createdAt: Date | string;
28
- updatedAt: Date | string;
27
+ createdAt: number | Date;
28
+ updatedAt: number | Date;
29
29
  name: string;
30
30
  osceTypeId: Id;
31
31
  osceType?: IOsceType;
@@ -2,8 +2,8 @@ import { ITopic } from './Topic';
2
2
  import { Id } from './Type';
3
3
  export interface IPicture {
4
4
  id: Id;
5
- createdAt: string | Date;
6
- updatedAt: string | Date;
5
+ createdAt: number | Date;
6
+ updatedAt: number | Date;
7
7
  name: string;
8
8
  caption: string;
9
9
  path: string;
package/models/Picture.js CHANGED
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
4
- ;
5
- ;
6
- ;
@@ -1,5 +1 @@
1
- ;
2
- ;
3
- ;
4
- ;
5
1
  export {};
package/models/Promo.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { Id } from './Type';
2
2
  export interface ICoupon {
3
3
  id: Id;
4
- createdAt: string | Date;
4
+ createdAt: number | Date;
5
5
  name: string;
6
6
  affiliateId: Id;
7
7
  }
8
8
  export interface IPromoReport {
9
9
  id: Id;
10
- date: string | Date;
10
+ date: number | Date;
11
11
  couponId: Id;
12
12
  userId: Id;
13
13
  subscriptionId: Id;
@@ -1,7 +1,7 @@
1
1
  import { Id } from './Type';
2
2
  export interface ISubscription {
3
3
  id: Id;
4
- createdAt: string | Date;
4
+ createdAt: number | Date;
5
5
  name: string;
6
6
  description: string | null;
7
7
  price: number;
package/models/Todo.d.ts CHANGED
@@ -2,8 +2,8 @@ import { ICard } from './Card';
2
2
  import { Id } from './Type';
3
3
  export interface ITodo {
4
4
  id: Id;
5
- createdAt: Date | string;
6
- updatedAt: Date | string;
5
+ createdAt: number | Date;
6
+ updatedAt: number | Date;
7
7
  userId: Id;
8
8
  dailyTask: boolean;
9
9
  marks: ITodoMark[];
package/models/User.d.ts CHANGED
@@ -26,26 +26,26 @@ export interface IUser {
26
26
  classYear: IClassYear;
27
27
  graduationYear: number;
28
28
  universityId: number;
29
- examDate: Date | string | null;
29
+ examDate: number | Date | null;
30
30
  stripeCustomerId: string;
31
31
  qBankSubscriptionId: Id | null;
32
32
  qBankSubscription: ISubscription | null;
33
- stripeQBankSubscriptionEndDate: Date | string | null;
33
+ stripeQBankSubscriptionEndDate: number | Date | null;
34
34
  osceSubscriptionId: Id | null;
35
35
  osceSubscription: ISubscription | null;
36
- stripeOsceSubscriptionEndDate: Date | string | null;
36
+ stripeOsceSubscriptionEndDate: number | Date | null;
37
37
  bundleSubscriptionId: Id | null;
38
38
  bundleSubscription: ISubscription | null;
39
- stripeBundleSubscriptionEndDate: Date | string | null;
39
+ stripeBundleSubscriptionEndDate: number | Date | null;
40
40
  subscriptionId: Id | null;
41
41
  subscription?: ISubscription | null;
42
- stripeSubscriptionEndDate: Date | string | null;
42
+ stripeSubscriptionEndDate: number | Date | null;
43
43
  stripePriceNickname: string | null;
44
44
  }
45
45
  export interface IUserCompletedQuestions {
46
46
  id: Id;
47
- createdAt: Date | string;
48
- updatedAt: Date | string;
47
+ createdAt: number | Date;
48
+ updatedAt: number | Date;
49
49
  questionId: Id;
50
50
  userId: Id;
51
51
  correct: boolean;
@@ -55,22 +55,22 @@ export interface IUserCompletedQuestions {
55
55
  }
56
56
  export interface IUserCompletedCards {
57
57
  id: Id;
58
- createdAt: Date | string;
59
- updatedAt: Date | string;
58
+ createdAt: number | Date;
59
+ updatedAt: number | Date;
60
60
  cardId: Id;
61
61
  card: ICard;
62
62
  userId: Id;
63
63
  topic: ITopic;
64
64
  concept: IConcept;
65
- lastSeen: Date | string;
65
+ lastSeen: number | Date;
66
66
  score: number;
67
67
  iteration: number;
68
68
  optimalFactor: number;
69
69
  }
70
70
  export interface IUserFlaggedQuestions {
71
71
  id: Id;
72
- createdAt: Date | string;
73
- updatedAt: Date | string;
72
+ createdAt: number | Date;
73
+ updatedAt: number | Date;
74
74
  questionId: Id;
75
75
  question: IQuestion;
76
76
  userId: Id;
@@ -79,7 +79,7 @@ export interface IUserFlaggedQuestions {
79
79
  }
80
80
  export interface IUserProgress {
81
81
  id: Id;
82
- date: Date | string;
82
+ date: number | Date;
83
83
  userId: Id;
84
84
  topicId: Id;
85
85
  count: number;
package/models/Video.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { IConcept } from "./Concept";
2
- import { IFile } from "./File";
3
- import { Id } from "./Type";
1
+ import { IConcept } from './Concept';
2
+ import { IFile } from './File';
3
+ import { Id } from './Type';
4
4
  export interface IVideo {
5
5
  id: Id;
6
- createdAt: string | Date;
7
- updatedAt: string | Date;
8
- startTime: string | Date;
9
- endTime: string | Date;
6
+ createdAt: number | Date;
7
+ updatedAt: number | Date;
8
+ startTime: number | Date;
9
+ endTime: number | Date;
10
10
  title: string;
11
11
  museId: string;
12
12
  thumbnail: string;
@@ -16,8 +16,8 @@ export interface IVideo {
16
16
  duration: number;
17
17
  concepts: IConcept[];
18
18
  files: IFile[];
19
- send1hrPushAt: string | Date | null;
20
- sent1hrPushAt: string | Date | null;
21
- send24hrPushAt: string | Date | null;
22
- sent24hrPushAt: string | Date | null;
19
+ send1hrPushAt: number | Date | null;
20
+ sent1hrPushAt: number | Date | null;
21
+ send24hrPushAt: number | Date | null;
22
+ sent24hrPushAt: number | Date | null;
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.4.4",
3
+ "version": "1.4.8",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -75,7 +75,7 @@ exports.OSCE_STATION_FIELDS = (0, client_1.gql) `
75
75
  exports.OSCE_MARKSHEET_USER_FIELDS = (0, client_1.gql) `
76
76
  ${user_1.USER_FIELDS}
77
77
  fragment OsceMarksheetUserFields on OsceMarksheetUser {
78
- id
78
+ # id - do not pass otherwise all unassigned roles = candidate
79
79
  osceMarksheetId
80
80
  userId
81
81
  user {
@@ -72,7 +72,7 @@ export const OSCE_STATION_FIELDS = gql `
72
72
  export const OSCE_MARKSHEET_USER_FIELDS = gql `
73
73
  ${USER_FIELDS}
74
74
  fragment OsceMarksheetUserFields on OsceMarksheetUser {
75
- id
75
+ # id - do not pass otherwise all unassigned roles = candidate
76
76
  osceMarksheetId
77
77
  userId
78
78
  user {
@@ -1,3 +1,4 @@
1
+ import { ApolloClient } from '@apollo/client';
1
2
  import { EOsceMarksheetAction, EOsceRoles, Id, IOsceMarksheet, IOsceMarksheetMark } from '../../../models';
2
3
  import { IOsceMatchmakingAction } from '../../subscription/osce';
3
4
  import { graphqlNormalize, RestrictedData } from '../../types';
@@ -38,7 +39,7 @@ export interface IMarkOsceMarksheetMarkVar {
38
39
  mark: boolean;
39
40
  }
40
41
  export declare type IMarkOsceMarksheetMarkData = RestrictedData<graphqlNormalize & Partial<IOsceMarksheetMark>, 'markOsceMarksheetMark'>;
41
- export declare const optimisticMarkOsceMarksheetMark: (variables: IMarkOsceMarksheetMarkVar) => IMarkOsceMarksheetMarkData;
42
+ export declare const optimisticMarkOsceMarksheetMark: (client: ApolloClient<any>, variables: IMarkOsceMarksheetMarkVar) => IMarkOsceMarksheetMarkData;
42
43
  export declare const SELECT_OSCE_STATION: import("@apollo/client").DocumentNode;
43
44
  export interface ISelectOsceMarksheetStationVar {
44
45
  osceMarksheetId: Id;
@@ -75,14 +75,16 @@ exports.MARK_OSCE_MARKSHEET_MARK = (0, client_1.gql) `
75
75
  }
76
76
  }
77
77
  `;
78
- const optimisticMarkOsceMarksheetMark = (variables) => {
78
+ const optimisticMarkOsceMarksheetMark = (client, variables) => {
79
+ const __typename = 'OsceMarksheetMark';
80
+ const markOsceMarksheetMark = client.readFragment({
81
+ id: `${__typename}:${variables.osceStationMarkId}`,
82
+ fragment: osce_1.OSCE_MARKSHEET_MARK_FIELDS,
83
+ fragmentName: 'OsceMarksheetMarkFields',
84
+ });
79
85
  return {
80
86
  restricted: {
81
- markOsceMarksheetMark: {
82
- id: variables.osceStationMarkId,
83
- mark: variables.mark,
84
- __typename: 'OsceMarksheetMark',
85
- },
87
+ markOsceMarksheetMark: Object.assign(Object.assign({}, markOsceMarksheetMark), { mark: variables.mark, __typename }),
86
88
  },
87
89
  };
88
90
  };
@@ -72,14 +72,16 @@ export const MARK_OSCE_MARKSHEET_MARK = gql `
72
72
  }
73
73
  }
74
74
  `;
75
- export const optimisticMarkOsceMarksheetMark = (variables) => {
75
+ export const optimisticMarkOsceMarksheetMark = (client, variables) => {
76
+ const __typename = 'OsceMarksheetMark';
77
+ const markOsceMarksheetMark = client.readFragment({
78
+ id: `${__typename}:${variables.osceStationMarkId}`,
79
+ fragment: OSCE_MARKSHEET_MARK_FIELDS,
80
+ fragmentName: 'OsceMarksheetMarkFields',
81
+ });
76
82
  return {
77
83
  restricted: {
78
- markOsceMarksheetMark: {
79
- id: variables.osceStationMarkId,
80
- mark: variables.mark,
81
- __typename: 'OsceMarksheetMark',
82
- },
84
+ markOsceMarksheetMark: Object.assign(Object.assign({}, markOsceMarksheetMark), { mark: variables.mark, __typename }),
83
85
  },
84
86
  };
85
87
  };
@@ -12,7 +12,7 @@ export interface IUserInput {
12
12
  graduationYear?: number;
13
13
  password?: string;
14
14
  oldPassword?: string;
15
- examDate?: Date | string;
15
+ examDate?: number | Date;
16
16
  }
17
17
  export interface IUpdateUserVar {
18
18
  id?: number;
@@ -31,8 +31,8 @@ export interface IDashboardPastQuizzesInfoRes {
31
31
  totalQuestions: number;
32
32
  totalMarksheet: number;
33
33
  isTestMarksheet: boolean;
34
- startedAt: Date | string;
35
- endedAt: Date | string;
34
+ startedAt: number | Date;
35
+ endedAt: number | Date;
36
36
  }
37
37
  export declare type IDashboardPastQuizzesInfoData = IDashboardPastQuizzesInfoRes[];
38
38
  export declare type ILatestPastMarksheetIdVar = null;
@@ -32,7 +32,7 @@ export interface IOsceStationVar {
32
32
  export declare type IOsceStationData = RestrictedData<graphqlNormalize & IOsceStation, 'osceStation'>;
33
33
  export declare const OSCE_TOPICS: import("@apollo/client").DocumentNode;
34
34
  export declare type IOsceTopicsVar = null;
35
- export declare type IOsceTopicsData = RestrictedData<graphqlNormalize & ITopic, 'osceTopics'>;
35
+ export declare type IOsceTopicsData = RestrictedData<(graphqlNormalize & ITopic)[], 'osceTopics'>;
36
36
  export declare const SEARCH_OSCE_STATIONS: import("@apollo/client").DocumentNode;
37
37
  export interface ISearchOsceStationsVar {
38
38
  search: string;
@@ -7,7 +7,7 @@ export interface IUniversitiesRankSpeciality {
7
7
  rank: number;
8
8
  }
9
9
  export interface IUniversityLeaderboard {
10
- updatedAt: Date | string | null;
10
+ updatedAt: number | Date | null;
11
11
  month: IUniversitiesRankSpeciality[];
12
12
  quarter: IUniversitiesRankSpeciality[];
13
13
  }
@@ -1,7 +1,7 @@
1
1
  import { ISubscription, IUser } from '../../../models';
2
2
  export declare type IDashboardUserVar = null;
3
3
  export interface IDashboardUserData {
4
- examDate: Date | string;
4
+ examDate: number | Date;
5
5
  totalQuestions: number;
6
6
  completedQuestionsCount: number;
7
7
  completedCorrectQuestionsCount: number;