@quesmed/types 1.4.0 → 1.4.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "1.4.0",
3
+ "version": "1.4.4",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "main": "index.js",
6
6
  "module": "index.mjs",
@@ -1,8 +1,10 @@
1
1
  import { EPlatformId } from '../../..';
2
2
  import { Id } from '../../../models';
3
+ import { RestrictedData } from '../../types';
4
+ export declare const AGORA_TOKEN: import("@apollo/client").DocumentNode;
3
5
  export interface IAgoraTokenVar {
4
6
  platformId: EPlatformId;
5
7
  channel: string;
6
8
  uid: Id;
7
9
  }
8
- export declare type IAgoraTokenData = string;
10
+ export declare type IAgoraTokenData = RestrictedData<string, 'agoraToken'>;
@@ -1,2 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AGORA_TOKEN = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.AGORA_TOKEN = (0, client_1.gql) `
6
+ mutation AgoraToken($platformId: Int!, $channel: String!, $uid: Int!) {
7
+ restricted {
8
+ agoraToken(platformId: $platformId, channel: $channel, uid: $uid)
9
+ }
10
+ }
11
+ `;
@@ -1 +1,8 @@
1
- export {};
1
+ import { gql } from '@apollo/client';
2
+ export const AGORA_TOKEN = gql `
3
+ mutation AgoraToken($platformId: Int!, $channel: String!, $uid: Int!) {
4
+ restricted {
5
+ agoraToken(platformId: $platformId, channel: $channel, uid: $uid)
6
+ }
7
+ }
8
+ `;
@@ -1,68 +1,55 @@
1
1
  import { EOsceMarksheetAction, EOsceRoles, Id, IOsceMarksheet, IOsceMarksheetMark } from '../../../models';
2
2
  import { IOsceMatchmakingAction } from '../../subscription/osce';
3
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
4
  export declare const START_OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
4
5
  export interface IStartOsceMatchmakingVar {
5
6
  agoraId: string;
6
7
  }
7
- export declare type IStartOsceMatchmakingData = boolean;
8
+ export declare type IStartOsceMatchmakingData = RestrictedData<boolean, 'startOsceMatchmaking'>;
8
9
  export declare const ACCEPT_OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
9
10
  export interface IAcceptOsceMatchmakingVar {
10
11
  agoraId: string;
11
12
  }
12
- export declare type IAcceptOsceMatchmakingData = boolean;
13
+ export declare type IAcceptOsceMatchmakingData = RestrictedData<boolean, 'acceptOsceMatchmaking'>;
13
14
  export declare const CHECK_OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
14
15
  export declare type ICheckOsceMatchmakingVar = null;
15
- export interface ICheckOsceMatchmakingData extends IOsceMatchmakingAction {
16
- }
16
+ export declare type ICheckOsceMatchmakingData = RestrictedData<graphqlNormalize & IOsceMatchmakingAction, 'checkOsceMatchmaking'>;
17
17
  export declare const CANCEL_OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
18
18
  export interface ICancelOsceMatchmakingVar {
19
19
  agoraId: string;
20
20
  }
21
- export declare type ICancelOsceMatchmakingData = boolean;
21
+ export declare type ICancelOsceMatchmakingData = RestrictedData<boolean, 'cancelOsceMatchmaking'>;
22
22
  export declare const BUILD_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
23
23
  export interface IBuildOsceMarksheetVar {
24
24
  osceStationId?: Id;
25
25
  agoraId?: string;
26
26
  solo?: boolean;
27
27
  }
28
- export interface IBuildOsceMarksheetData extends IOsceMarksheet {
29
- }
28
+ export declare type IBuildOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'buildOsceMarksheet'>;
30
29
  export declare const CHANGE_OSCE_ROLE: import("@apollo/client").DocumentNode;
31
30
  export interface IChangeOsceRoleVar {
32
31
  osceMarksheetId: Id;
33
32
  role: EOsceRoles;
34
33
  }
35
- export interface IChangeOsceRoleData extends IOsceMarksheet {
36
- }
34
+ export declare type IChangeOsceRoleData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'changeOsceRole'>;
37
35
  export declare const MARK_OSCE_MARKSHEET_MARK: import("@apollo/client").DocumentNode;
38
36
  export interface IMarkOsceMarksheetMarkVar {
39
37
  osceStationMarkId: Id;
40
38
  mark: boolean;
41
39
  }
42
- export interface IMarkOsceMarksheetMarkData extends IOsceMarksheetMark {
43
- }
44
- export declare const optimisticMarkOsceMarksheetMark: (variables: IMarkOsceMarksheetMarkVar) => {
45
- restricted: {
46
- markOsceMarksheetMark: {
47
- id: number;
48
- mark: boolean;
49
- __typename: string;
50
- };
51
- };
52
- };
40
+ export declare type IMarkOsceMarksheetMarkData = RestrictedData<graphqlNormalize & Partial<IOsceMarksheetMark>, 'markOsceMarksheetMark'>;
41
+ export declare const optimisticMarkOsceMarksheetMark: (variables: IMarkOsceMarksheetMarkVar) => IMarkOsceMarksheetMarkData;
53
42
  export declare const SELECT_OSCE_STATION: import("@apollo/client").DocumentNode;
54
43
  export interface ISelectOsceMarksheetStationVar {
55
44
  osceMarksheetId: Id;
56
45
  osceStationId: Id;
57
46
  }
58
- export interface ISelectOsceMarksheetStationData extends IOsceMarksheet {
59
- }
47
+ export declare type ISelectOsceMarksheetStationData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'selectOsceMarksheetStation'>;
60
48
  export declare const START_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
61
49
  export interface IStartOsceMarksheetVar {
62
50
  osceMarksheetId: Id;
63
51
  }
64
- export interface IStartOsceMarksheetData extends IOsceMarksheet {
65
- }
52
+ export declare type IStartOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'startOsceMarksheet'>;
66
53
  export declare const PRESTART_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
67
54
  export interface IPrestartOsceMarksheetVar {
68
55
  osceMarksheetId: Id;
@@ -70,8 +57,7 @@ export interface IPrestartOsceMarksheetVar {
70
57
  stationTime: number;
71
58
  feedbackTime: number;
72
59
  }
73
- export interface IPrestartOsceMarksheetData extends IOsceMarksheet {
74
- }
60
+ export declare type IPrestartOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'prestartOsceMarksheet'>;
75
61
  export declare const SAVE_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
76
62
  export interface ISaveOsceMarksheetVar {
77
63
  osceMarksheetId: Id;
@@ -79,8 +65,7 @@ export interface ISaveOsceMarksheetVar {
79
65
  timeTaken?: number;
80
66
  feedback?: string;
81
67
  }
82
- export interface ISaveOsceMarksheetData extends IOsceMarksheet {
83
- }
68
+ export declare type ISaveOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'saveOsceMarksheet'>;
84
69
  export declare const OSCE_MARKSHEET_ACTIONS: import("@apollo/client").DocumentNode;
85
70
  export interface IOsceMarksheetActionsVar {
86
71
  osceMarksheetId: Id;
@@ -88,15 +73,13 @@ export interface IOsceMarksheetActionsVar {
88
73
  timeRemaining?: number;
89
74
  action: EOsceMarksheetAction;
90
75
  }
91
- export declare type IOsceMarksheetActionsData = number;
76
+ export declare type IOsceMarksheetActionsData = RestrictedData<number, 'osceMarksheetActions'>;
92
77
  export declare const END_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
93
78
  export interface IEndOsceMarksheetVar extends ISaveOsceMarksheetVar {
94
79
  }
95
- export interface IEndOsceMarksheetData extends IOsceMarksheet {
96
- }
80
+ export declare type IEndOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'endOsceMarksheet'>;
97
81
  export declare const LEAVE_OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
98
82
  export interface ILeaveOsceMarksheetVar {
99
83
  osceMarksheetId: Id;
100
84
  }
101
- export interface ILeaveOsceMarksheetData extends IOsceMarksheet {
102
- }
85
+ export declare type ILeaveOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'leaveOsceMarksheet'>;
@@ -1,48 +1,45 @@
1
1
  import { EDifficultyType, Id, IDashboardOsce, IOsceMarksheet, IOsceStation, IOsceStationItem } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
2
3
  import { ITopic } from './../../../models/Topic';
3
4
  export declare const DASHBOARD_OSCE: import("@apollo/client").DocumentNode;
4
5
  export interface IDashboardOsceVar {
5
6
  solo: boolean;
6
7
  }
7
- export interface IDashboardOsceData extends IDashboardOsce {
8
- }
8
+ export declare type IDashboardOsceData = RestrictedData<graphqlNormalize & IDashboardOsce, 'dashboardOsce'>;
9
9
  export declare const OSCE_MARKSHEETS: import("@apollo/client").DocumentNode;
10
10
  export interface IOsceMarksheetsVar {
11
11
  solo: boolean;
12
12
  }
13
- export declare type IOsceMarksheetsData = IOsceMarksheet[];
13
+ export declare type IOsceMarksheetsData = RestrictedData<(graphqlNormalize & IOsceMarksheet)[], 'osceMarksheets'>;
14
14
  export declare const OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
15
15
  export interface IOsceMarksheetVar {
16
16
  id: number;
17
17
  }
18
- export interface IOsceMarksheetData extends IOsceMarksheet {
19
- }
18
+ export declare type IOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'osceMarksheet'>;
20
19
  export declare const OSCE_STATIONS: import("@apollo/client").DocumentNode;
21
20
  export interface IOsceStationsVar {
22
21
  osceTypeId?: Id;
23
22
  solo: boolean;
24
- attempted: boolean;
25
- topicIds: Id[];
26
- difficulty: EDifficultyType[];
23
+ attempted?: boolean;
24
+ difficulty?: EDifficultyType[];
25
+ topicIds?: Id[];
27
26
  }
28
- export declare type IOsceStationsData = IOsceStationItem[];
27
+ export declare type IOsceStationsData = RestrictedData<(graphqlNormalize & IOsceStationItem)[], 'osceStations'>;
29
28
  export declare const OSCE_STATION: import("@apollo/client").DocumentNode;
30
29
  export interface IOsceStationVar {
31
30
  id: Id;
32
31
  }
33
- export interface IOsceStationData extends IOsceStation {
34
- }
32
+ export declare type IOsceStationData = RestrictedData<graphqlNormalize & IOsceStation, 'osceStation'>;
35
33
  export declare const OSCE_TOPICS: import("@apollo/client").DocumentNode;
36
34
  export declare type IOsceTopicsVar = null;
37
- export interface IOsceTopicsData extends ITopic {
38
- }
35
+ export declare type IOsceTopicsData = RestrictedData<graphqlNormalize & ITopic, 'osceTopics'>;
39
36
  export declare const SEARCH_OSCE_STATIONS: import("@apollo/client").DocumentNode;
40
37
  export interface ISearchOsceStationsVar {
41
38
  search: string;
42
39
  }
43
- export declare type ISearchOsceStationsData = IOsceStationItem[];
40
+ export declare type ISearchOsceStationsData = RestrictedData<(graphqlNormalize & IOsceStationItem)[], 'searchOsceStations'>;
44
41
  export declare const HEARTBEAT: import("@apollo/client").DocumentNode;
45
42
  export interface IHeartbeatVar {
46
43
  agoraId: string;
47
44
  }
48
- export declare type IHeartBeatData = boolean;
45
+ export declare type IHeartBeatData = RestrictedData<boolean, 'heartbeat'>;
@@ -36,9 +36,9 @@ exports.OSCE_MARKSHEETS = (0, client_1.gql) `
36
36
  `;
37
37
  exports.OSCE_MARKSHEET = (0, client_1.gql) `
38
38
  ${osce_1.OSCE_MARKSHEET_FIELDS}
39
- query OsceMarksheet($osceMarksheetId: Int!) {
39
+ query OsceMarksheet($id: Int!) {
40
40
  restricted {
41
- osceMarksheet(id: $osceMarksheetId) {
41
+ osceMarksheet(id: $id) {
42
42
  ...OsceMarksheetFields
43
43
  }
44
44
  }
@@ -46,9 +46,21 @@ exports.OSCE_MARKSHEET = (0, client_1.gql) `
46
46
  `;
47
47
  exports.OSCE_STATIONS = (0, client_1.gql) `
48
48
  ${osce_2.OSCE_STATION_FIELDS}
49
- query OsceStations($solo: Boolean!) {
49
+ query OsceStations(
50
+ $osceTypeId: Int
51
+ $solo: Boolean!
52
+ $attempted: Boolean
53
+ $difficulty: [Int!]
54
+ $topicIds: [Int!]
55
+ ) {
50
56
  restricted {
51
- osceStations(solo: $solo) {
57
+ osceStations(
58
+ osceTypeId: $osceTypeId
59
+ solo: $solo
60
+ attempted: $attempted
61
+ difficulty: $difficulty
62
+ topicIds: $topicIds
63
+ ) {
52
64
  ...OsceStationFields
53
65
  }
54
66
  }
@@ -56,9 +68,9 @@ exports.OSCE_STATIONS = (0, client_1.gql) `
56
68
  `;
57
69
  exports.OSCE_STATION = (0, client_1.gql) `
58
70
  ${osce_2.OSCE_STATION_FIELDS}
59
- query OsceStation($osceStationId: Int!) {
71
+ query OsceStation($id: Int!) {
60
72
  restricted {
61
- osceStation(id: $osceStationId) {
73
+ osceStation(id: $id) {
62
74
  ...OsceStationFields
63
75
  }
64
76
  }
@@ -33,9 +33,9 @@ export const OSCE_MARKSHEETS = gql `
33
33
  `;
34
34
  export const OSCE_MARKSHEET = gql `
35
35
  ${OSCE_MARKSHEET_FIELDS}
36
- query OsceMarksheet($osceMarksheetId: Int!) {
36
+ query OsceMarksheet($id: Int!) {
37
37
  restricted {
38
- osceMarksheet(id: $osceMarksheetId) {
38
+ osceMarksheet(id: $id) {
39
39
  ...OsceMarksheetFields
40
40
  }
41
41
  }
@@ -43,9 +43,21 @@ export const OSCE_MARKSHEET = gql `
43
43
  `;
44
44
  export const OSCE_STATIONS = gql `
45
45
  ${OSCE_STATION_FIELDS}
46
- query OsceStations($solo: Boolean!) {
46
+ query OsceStations(
47
+ $osceTypeId: Int
48
+ $solo: Boolean!
49
+ $attempted: Boolean
50
+ $difficulty: [Int!]
51
+ $topicIds: [Int!]
52
+ ) {
47
53
  restricted {
48
- osceStations(solo: $solo) {
54
+ osceStations(
55
+ osceTypeId: $osceTypeId
56
+ solo: $solo
57
+ attempted: $attempted
58
+ difficulty: $difficulty
59
+ topicIds: $topicIds
60
+ ) {
49
61
  ...OsceStationFields
50
62
  }
51
63
  }
@@ -53,9 +65,9 @@ export const OSCE_STATIONS = gql `
53
65
  `;
54
66
  export const OSCE_STATION = gql `
55
67
  ${OSCE_STATION_FIELDS}
56
- query OsceStation($osceStationId: Int!) {
68
+ query OsceStation($id: Int!) {
57
69
  restricted {
58
- osceStation(id: $osceStationId) {
70
+ osceStation(id: $id) {
59
71
  ...OsceStationFields
60
72
  }
61
73
  }
@@ -1,6 +1,7 @@
1
1
  import { IOsceStation, ITopic } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
2
3
  export declare type IQuesBookVar = null;
3
4
  export declare type IQuesBookData = ITopic[];
4
5
  export declare const OSCE_BOOK: import("@apollo/client").DocumentNode;
5
6
  export declare type IOsceBookVar = null;
6
- export declare type IOsceBookData = IOsceStation[];
7
+ export declare type IOsceBookData = RestrictedData<(graphqlNormalize & IOsceStation)[], 'osceBook'>;
@@ -1,4 +1,5 @@
1
1
  import { EOsceMarksheetAction, EOsceRoles, IClassYear, Id, IOsceMarksheetUser, IUser } from '../../models';
2
+ import { RootData } from '../types';
2
3
  export declare const OSCE_ROLE_CHANGE_KEY = "OSCE_ROLE_CHANGE";
3
4
  export declare const OSCE_MARKSHEET_ACTION_KEY = "OSCE_MARKSHEET_ACTION";
4
5
  export declare const OSCE_MATCHMAKING_KEY = "OSCE_MATCHMAKING";
@@ -17,10 +18,9 @@ export declare const OSCE_ROLE_CHANGE: import("@apollo/client").DocumentNode;
17
18
  export interface IOsceRoleChangedVar {
18
19
  osceMarksheetId: Id;
19
20
  }
20
- export interface IOsceRoleChangedData extends IOsceGroup {
21
- }
21
+ export declare type IOsceRoleChangedData = RootData<IOsceGroup, 'osceRoleChange'>;
22
22
  export declare const OSCE_MARKSHEET_ACTION: import("@apollo/client").DocumentNode;
23
- export interface IOsceMarksheetActionsVar {
23
+ export interface IOsceMarksheetActionVar {
24
24
  osceMarksheetId: Id;
25
25
  }
26
26
  export interface IOsceMarksheetAction {
@@ -32,8 +32,7 @@ export interface IOsceMarksheetAction {
32
32
  endedAt: Date | null;
33
33
  action: EOsceMarksheetAction;
34
34
  }
35
- export interface IOsceMarksheetActionsData extends IOsceMarksheetAction {
36
- }
35
+ export declare type IOsceMarksheetActionData = RootData<IOsceMarksheetAction, 'osceMarksheetAction'>;
37
36
  export declare const OSCE_MATCHMAKING: import("@apollo/client").DocumentNode;
38
37
  export interface IOsceMatchmakingAction {
39
38
  osceMarksheetId: Id;
@@ -46,8 +45,10 @@ export interface IOsceMatchmakingAction {
46
45
  grouped: boolean;
47
46
  completed: boolean;
48
47
  }
49
- export interface IOsceMatchmakingData extends IOsceMatchmakingAction {
48
+ export declare type IOsceMatchmakingData = RootData<IOsceMatchmakingAction, 'osceMatchmaking'>;
49
+ export interface IOsceMatchmakingVar {
50
+ userId: Id;
50
51
  }
51
52
  export declare const OSCE_MATCHMAKING_USERS: import("@apollo/client").DocumentNode;
52
- export declare type IOsceMatchmakingUsersData = number;
53
+ export declare type IOsceMatchmakingUsersData = RootData<number, 'osceMatchmakingUsers'>;
53
54
  export declare type IOsceMatchmakingUsersVar = null;
@@ -0,0 +1,10 @@
1
+ export interface graphqlNormalize {
2
+ __typename?: string;
3
+ }
4
+ export declare type RestrictedData<T, K extends keyof any> = {
5
+ restricted: Record<K, T>;
6
+ };
7
+ export declare type AdminData<T, K extends keyof any> = {
8
+ admin: Record<K, T>;
9
+ };
10
+ export declare type RootData<T, K extends keyof any> = Record<K, T>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export {};