@quesmed/types 1.3.21 → 1.4.3
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 +3 -2
- package/resolvers/fragments/chapter.d.ts +2 -0
- package/resolvers/fragments/chapter.js +31 -0
- package/resolvers/fragments/chapter.mjs +28 -0
- package/resolvers/fragments/concept.d.ts +3 -0
- package/resolvers/fragments/concept.js +79 -0
- package/resolvers/fragments/concept.mjs +76 -0
- package/resolvers/fragments/osce.d.ts +10 -0
- package/resolvers/fragments/osce.js +171 -0
- package/resolvers/fragments/osce.mjs +168 -0
- package/resolvers/fragments/picture.d.ts +3 -0
- package/resolvers/fragments/picture.js +44 -0
- package/resolvers/fragments/picture.mjs +41 -0
- package/resolvers/fragments/user.d.ts +1 -0
- package/resolvers/fragments/user.js +26 -0
- package/resolvers/fragments/user.mjs +23 -0
- package/resolvers/fragments/video.d.ts +2 -0
- package/resolvers/fragments/video.js +49 -0
- package/resolvers/fragments/video.mjs +46 -0
- package/resolvers/mutation/restricted/agora.d.ts +3 -1
- package/resolvers/mutation/restricted/agora.js +9 -0
- package/resolvers/mutation/restricted/agora.mjs +8 -1
- package/resolvers/mutation/restricted/osce.d.ts +34 -23
- package/resolvers/mutation/restricted/osce.js +200 -0
- package/resolvers/mutation/restricted/osce.mjs +198 -1
- package/resolvers/query/restricted/index.d.ts +1 -0
- package/resolvers/query/restricted/index.js +1 -0
- package/resolvers/query/restricted/index.mjs +1 -0
- package/resolvers/query/restricted/osce.d.ts +26 -21
- package/resolvers/query/restricted/osce.js +103 -0
- package/resolvers/query/restricted/osce.mjs +102 -1
- package/resolvers/query/restricted/quesBook.d.ts +3 -1
- package/resolvers/query/restricted/quesBook.js +13 -0
- package/resolvers/query/restricted/quesBook.mjs +12 -1
- package/resolvers/query/restricted/replication.d.ts +33 -0
- package/resolvers/query/restricted/replication.js +184 -0
- package/resolvers/query/restricted/replication.mjs +178 -0
- package/resolvers/subscription/osce.d.ts +18 -11
- package/resolvers/subscription/osce.js +36 -5
- package/resolvers/subscription/osce.mjs +35 -4
- package/resolvers/types.d.ts +10 -0
- package/resolvers/types.js +2 -0
- package/resolvers/types.mjs +1 -0
|
@@ -1,40 +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';
|
|
4
|
+
export declare const DASHBOARD_OSCE: import("@apollo/client").DocumentNode;
|
|
3
5
|
export interface IDashboardOsceVar {
|
|
4
6
|
solo: boolean;
|
|
5
7
|
}
|
|
6
|
-
export
|
|
8
|
+
export declare type IDashboardOsceData = RestrictedData<graphqlNormalize & IDashboardOsce, 'dashboardOsce'>;
|
|
9
|
+
export declare const OSCE_MARKSHEETS: import("@apollo/client").DocumentNode;
|
|
10
|
+
export interface IOsceMarksheetsVar {
|
|
11
|
+
solo: boolean;
|
|
7
12
|
}
|
|
13
|
+
export declare type IOsceMarksheetsData = RestrictedData<(graphqlNormalize & IOsceMarksheet)[], 'osceMarksheets'>;
|
|
14
|
+
export declare const OSCE_MARKSHEET: import("@apollo/client").DocumentNode;
|
|
8
15
|
export interface IOsceMarksheetVar {
|
|
9
16
|
id: number;
|
|
10
17
|
}
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export interface IOsceStationVar {
|
|
14
|
-
id: Id;
|
|
15
|
-
}
|
|
16
|
-
export interface IOsceStationData extends IOsceStation {
|
|
17
|
-
}
|
|
18
|
-
export interface IOsceMarksheetsVar {
|
|
19
|
-
solo: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare type IOsceMarksheetsData = IOsceMarksheet[];
|
|
18
|
+
export declare type IOsceMarksheetData = RestrictedData<graphqlNormalize & IOsceMarksheet, 'osceMarksheet'>;
|
|
19
|
+
export declare const OSCE_STATIONS: import("@apollo/client").DocumentNode;
|
|
22
20
|
export interface IOsceStationsVar {
|
|
23
21
|
osceTypeId?: Id;
|
|
24
22
|
solo: boolean;
|
|
25
|
-
attempted
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
attempted?: boolean;
|
|
24
|
+
difficulty?: EDifficultyType[];
|
|
25
|
+
topicIds?: Id[];
|
|
26
|
+
}
|
|
27
|
+
export declare type IOsceStationsData = RestrictedData<(graphqlNormalize & IOsceStationItem)[], 'osceStations'>;
|
|
28
|
+
export declare const OSCE_STATION: import("@apollo/client").DocumentNode;
|
|
29
|
+
export interface IOsceStationVar {
|
|
30
|
+
id: Id;
|
|
28
31
|
}
|
|
29
|
-
export declare type
|
|
32
|
+
export declare type IOsceStationData = RestrictedData<graphqlNormalize & IOsceStation, 'osceStation'>;
|
|
33
|
+
export declare const OSCE_TOPICS: import("@apollo/client").DocumentNode;
|
|
34
|
+
export declare type IOsceTopicsVar = null;
|
|
35
|
+
export declare type IOsceTopicsData = RestrictedData<graphqlNormalize & ITopic, 'osceTopics'>;
|
|
36
|
+
export declare const SEARCH_OSCE_STATIONS: import("@apollo/client").DocumentNode;
|
|
30
37
|
export interface ISearchOsceStationsVar {
|
|
31
38
|
search: string;
|
|
32
39
|
}
|
|
33
|
-
export declare type ISearchOsceStationsData = IOsceStationItem[]
|
|
40
|
+
export declare type ISearchOsceStationsData = RestrictedData<(graphqlNormalize & IOsceStationItem)[], 'searchOsceStations'>;
|
|
41
|
+
export declare const HEARTBEAT: import("@apollo/client").DocumentNode;
|
|
34
42
|
export interface IHeartbeatVar {
|
|
35
43
|
agoraId: string;
|
|
36
44
|
}
|
|
37
|
-
export declare type IHeartBeatData = boolean
|
|
38
|
-
export declare type IOsceTopicsVar = null;
|
|
39
|
-
export interface IOsceTopicsData extends ITopic {
|
|
40
|
-
}
|
|
45
|
+
export declare type IHeartBeatData = RestrictedData<boolean, 'heartbeat'>;
|
|
@@ -1,2 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HEARTBEAT = exports.SEARCH_OSCE_STATIONS = exports.OSCE_TOPICS = exports.OSCE_STATION = exports.OSCE_STATIONS = exports.OSCE_MARKSHEET = exports.OSCE_MARKSHEETS = exports.DASHBOARD_OSCE = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const osce_1 = require("../../fragments/osce");
|
|
6
|
+
const osce_2 = require("./../../fragments/osce");
|
|
7
|
+
exports.DASHBOARD_OSCE = (0, client_1.gql) `
|
|
8
|
+
${osce_1.OSCE_TYPE_FIELDS}
|
|
9
|
+
query DashboardOsce($solo: Boolean!) {
|
|
10
|
+
restricted {
|
|
11
|
+
dashboardOsce(solo: $solo) {
|
|
12
|
+
lastAgoraId
|
|
13
|
+
types {
|
|
14
|
+
...OsceTypeFields
|
|
15
|
+
# user-specific
|
|
16
|
+
completed
|
|
17
|
+
total
|
|
18
|
+
avgScore
|
|
19
|
+
}
|
|
20
|
+
avgScore
|
|
21
|
+
completed
|
|
22
|
+
total
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
exports.OSCE_MARKSHEETS = (0, client_1.gql) `
|
|
28
|
+
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
29
|
+
query OsceMarksheets($solo: Boolean!) {
|
|
30
|
+
restricted {
|
|
31
|
+
osceMarksheets(solo: $solo) {
|
|
32
|
+
...OsceMarksheetFields
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
exports.OSCE_MARKSHEET = (0, client_1.gql) `
|
|
38
|
+
${osce_1.OSCE_MARKSHEET_FIELDS}
|
|
39
|
+
query OsceMarksheet($id: Int!) {
|
|
40
|
+
restricted {
|
|
41
|
+
osceMarksheet(id: $id) {
|
|
42
|
+
...OsceMarksheetFields
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
exports.OSCE_STATIONS = (0, client_1.gql) `
|
|
48
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
49
|
+
query OsceStations(
|
|
50
|
+
$osceTypeId: Int
|
|
51
|
+
$solo: Boolean!
|
|
52
|
+
$attempted: Boolean
|
|
53
|
+
$difficulty: [Int!]
|
|
54
|
+
$topicIds: [Int!]
|
|
55
|
+
) {
|
|
56
|
+
restricted {
|
|
57
|
+
osceStations(
|
|
58
|
+
osceTypeId: $osceTypeId
|
|
59
|
+
solo: $solo
|
|
60
|
+
attempted: $attempted
|
|
61
|
+
difficulty: $difficulty
|
|
62
|
+
topicIds: $topicIds
|
|
63
|
+
) {
|
|
64
|
+
...OsceStationFields
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
exports.OSCE_STATION = (0, client_1.gql) `
|
|
70
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
71
|
+
query OsceStation($id: Int!) {
|
|
72
|
+
restricted {
|
|
73
|
+
osceStation(id: $id) {
|
|
74
|
+
...OsceStationFields
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
exports.OSCE_TOPICS = (0, client_1.gql) `
|
|
80
|
+
${osce_1.OSCE_STATION_TOPIC_FIELDS}
|
|
81
|
+
query OsceTopics {
|
|
82
|
+
restricted {
|
|
83
|
+
osceTopics {
|
|
84
|
+
...OsceStationTopicFields
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
exports.SEARCH_OSCE_STATIONS = (0, client_1.gql) `
|
|
90
|
+
${osce_2.OSCE_STATION_FIELDS}
|
|
91
|
+
query SearchOsceStations($search: String!) {
|
|
92
|
+
restricted {
|
|
93
|
+
searchOsceStations(search: $search) {
|
|
94
|
+
...OsceStationFields
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
exports.HEARTBEAT = (0, client_1.gql) `
|
|
100
|
+
query Heartbeat($agoraId: String!) {
|
|
101
|
+
restricted {
|
|
102
|
+
heartbeat(agoraId: $agoraId)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
@@ -1 +1,102 @@
|
|
|
1
|
-
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { OSCE_MARKSHEET_FIELDS, OSCE_STATION_TOPIC_FIELDS, OSCE_TYPE_FIELDS, } from '../../fragments/osce';
|
|
3
|
+
import { OSCE_STATION_FIELDS } from './../../fragments/osce';
|
|
4
|
+
export const DASHBOARD_OSCE = gql `
|
|
5
|
+
${OSCE_TYPE_FIELDS}
|
|
6
|
+
query DashboardOsce($solo: Boolean!) {
|
|
7
|
+
restricted {
|
|
8
|
+
dashboardOsce(solo: $solo) {
|
|
9
|
+
lastAgoraId
|
|
10
|
+
types {
|
|
11
|
+
...OsceTypeFields
|
|
12
|
+
# user-specific
|
|
13
|
+
completed
|
|
14
|
+
total
|
|
15
|
+
avgScore
|
|
16
|
+
}
|
|
17
|
+
avgScore
|
|
18
|
+
completed
|
|
19
|
+
total
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
export const OSCE_MARKSHEETS = gql `
|
|
25
|
+
${OSCE_MARKSHEET_FIELDS}
|
|
26
|
+
query OsceMarksheets($solo: Boolean!) {
|
|
27
|
+
restricted {
|
|
28
|
+
osceMarksheets(solo: $solo) {
|
|
29
|
+
...OsceMarksheetFields
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export const OSCE_MARKSHEET = gql `
|
|
35
|
+
${OSCE_MARKSHEET_FIELDS}
|
|
36
|
+
query OsceMarksheet($id: Int!) {
|
|
37
|
+
restricted {
|
|
38
|
+
osceMarksheet(id: $id) {
|
|
39
|
+
...OsceMarksheetFields
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
export const OSCE_STATIONS = gql `
|
|
45
|
+
${OSCE_STATION_FIELDS}
|
|
46
|
+
query OsceStations(
|
|
47
|
+
$osceTypeId: Int
|
|
48
|
+
$solo: Boolean!
|
|
49
|
+
$attempted: Boolean
|
|
50
|
+
$difficulty: [Int!]
|
|
51
|
+
$topicIds: [Int!]
|
|
52
|
+
) {
|
|
53
|
+
restricted {
|
|
54
|
+
osceStations(
|
|
55
|
+
osceTypeId: $osceTypeId
|
|
56
|
+
solo: $solo
|
|
57
|
+
attempted: $attempted
|
|
58
|
+
difficulty: $difficulty
|
|
59
|
+
topicIds: $topicIds
|
|
60
|
+
) {
|
|
61
|
+
...OsceStationFields
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export const OSCE_STATION = gql `
|
|
67
|
+
${OSCE_STATION_FIELDS}
|
|
68
|
+
query OsceStation($id: Int!) {
|
|
69
|
+
restricted {
|
|
70
|
+
osceStation(id: $id) {
|
|
71
|
+
...OsceStationFields
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
export const OSCE_TOPICS = gql `
|
|
77
|
+
${OSCE_STATION_TOPIC_FIELDS}
|
|
78
|
+
query OsceTopics {
|
|
79
|
+
restricted {
|
|
80
|
+
osceTopics {
|
|
81
|
+
...OsceStationTopicFields
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
export const SEARCH_OSCE_STATIONS = gql `
|
|
87
|
+
${OSCE_STATION_FIELDS}
|
|
88
|
+
query SearchOsceStations($search: String!) {
|
|
89
|
+
restricted {
|
|
90
|
+
searchOsceStations(search: $search) {
|
|
91
|
+
...OsceStationFields
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
export const HEARTBEAT = gql `
|
|
97
|
+
query Heartbeat($agoraId: String!) {
|
|
98
|
+
restricted {
|
|
99
|
+
heartbeat(agoraId: $agoraId)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
@@ -1,5 +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[];
|
|
5
|
+
export declare const OSCE_BOOK: import("@apollo/client").DocumentNode;
|
|
4
6
|
export declare type IOsceBookVar = null;
|
|
5
|
-
export declare type IOsceBookData = IOsceStation[]
|
|
7
|
+
export declare type IOsceBookData = RestrictedData<(graphqlNormalize & IOsceStation)[], 'osceBook'>;
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OSCE_BOOK = void 0;
|
|
4
|
+
const client_1 = require("@apollo/client");
|
|
5
|
+
const osce_1 = require("./../../fragments/osce");
|
|
6
|
+
exports.OSCE_BOOK = (0, client_1.gql) `
|
|
7
|
+
${osce_1.OSCE_STATION_FIELDS}
|
|
8
|
+
query OsceBook {
|
|
9
|
+
restricted {
|
|
10
|
+
osceBook {
|
|
11
|
+
...OsceStationFields
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { OSCE_STATION_FIELDS } from './../../fragments/osce';
|
|
3
|
+
export const OSCE_BOOK = gql `
|
|
4
|
+
${OSCE_STATION_FIELDS}
|
|
5
|
+
query OsceBook {
|
|
6
|
+
restricted {
|
|
7
|
+
osceBook {
|
|
8
|
+
...OsceStationFields
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IOsceStation, IQuestion } from './../../../models';
|
|
2
|
+
import { ITopicInfo } from './topics';
|
|
3
|
+
interface IQueryBuilder {
|
|
4
|
+
query: string;
|
|
5
|
+
variables: IReplicationVar;
|
|
6
|
+
}
|
|
7
|
+
interface IReplicationVar {
|
|
8
|
+
lastId: string;
|
|
9
|
+
minUpdatedAt: number;
|
|
10
|
+
limit: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ITopicReplicationVar extends IReplicationVar {
|
|
13
|
+
}
|
|
14
|
+
export interface ITopicReplicationData extends ITopicInfo {
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
deleted: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const pullTopicQueryBuilder: (doc: Partial<ITopicReplicationData>) => IQueryBuilder;
|
|
19
|
+
export interface IQuestionReplicationVar extends IReplicationVar {
|
|
20
|
+
}
|
|
21
|
+
export interface IQuestionReplicationData extends IQuestion {
|
|
22
|
+
updatedAt: number;
|
|
23
|
+
deleted: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const pullQuestionQueryBuilder: (doc: Partial<IQuestionReplicationData>) => IQueryBuilder;
|
|
26
|
+
export interface IOsceStationReplicationVar extends IReplicationVar {
|
|
27
|
+
}
|
|
28
|
+
export interface IOsceStationReplicationData extends Omit<IOsceStation, 'updatedAt'> {
|
|
29
|
+
updatedAt: number;
|
|
30
|
+
deleted: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const pullOsceStationQueryBuilder: (doc: Partial<IOsceStationReplicationData>) => IQueryBuilder;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pullOsceStationQueryBuilder = exports.pullQuestionQueryBuilder = exports.pullTopicQueryBuilder = void 0;
|
|
4
|
+
const REPLICATION_LIMIT = 5;
|
|
5
|
+
const topicReplicationQuery = `query TopicReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
6
|
+
topicReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
7
|
+
id
|
|
8
|
+
updatedAt
|
|
9
|
+
name
|
|
10
|
+
totalQuestions
|
|
11
|
+
correctQuestions
|
|
12
|
+
incorrectQuestions
|
|
13
|
+
totalCards
|
|
14
|
+
ConfidentCards
|
|
15
|
+
ReviewCards
|
|
16
|
+
LearnCards
|
|
17
|
+
deleted
|
|
18
|
+
}
|
|
19
|
+
}`;
|
|
20
|
+
const pullTopicQueryBuilder = (doc) => {
|
|
21
|
+
return {
|
|
22
|
+
query: topicReplicationQuery,
|
|
23
|
+
variables: {
|
|
24
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
25
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
26
|
+
limit: REPLICATION_LIMIT,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
exports.pullTopicQueryBuilder = pullTopicQueryBuilder;
|
|
31
|
+
const questionReplicationQuery = `query QuestionReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
32
|
+
questionReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
33
|
+
id
|
|
34
|
+
__typename
|
|
35
|
+
createdAt
|
|
36
|
+
updatedAt
|
|
37
|
+
typeId
|
|
38
|
+
topic {
|
|
39
|
+
id
|
|
40
|
+
__typename
|
|
41
|
+
name
|
|
42
|
+
typeId
|
|
43
|
+
}
|
|
44
|
+
conceptId
|
|
45
|
+
concept {
|
|
46
|
+
id
|
|
47
|
+
__typename
|
|
48
|
+
createdAt
|
|
49
|
+
updatedAt
|
|
50
|
+
name
|
|
51
|
+
chapterId
|
|
52
|
+
topicId
|
|
53
|
+
}
|
|
54
|
+
question
|
|
55
|
+
explanation
|
|
56
|
+
totalVotes
|
|
57
|
+
choices {
|
|
58
|
+
id
|
|
59
|
+
__typename
|
|
60
|
+
questionId
|
|
61
|
+
name
|
|
62
|
+
explanation
|
|
63
|
+
label
|
|
64
|
+
answer
|
|
65
|
+
votes
|
|
66
|
+
}
|
|
67
|
+
pictures {
|
|
68
|
+
id
|
|
69
|
+
__typename
|
|
70
|
+
pictureId
|
|
71
|
+
questionId
|
|
72
|
+
choiceId
|
|
73
|
+
picture {
|
|
74
|
+
id
|
|
75
|
+
__typename
|
|
76
|
+
createdAt
|
|
77
|
+
updatedAt
|
|
78
|
+
name
|
|
79
|
+
caption
|
|
80
|
+
path
|
|
81
|
+
path512
|
|
82
|
+
topicId
|
|
83
|
+
path256
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
difficulty
|
|
87
|
+
elo
|
|
88
|
+
psaSectionId
|
|
89
|
+
}
|
|
90
|
+
}`;
|
|
91
|
+
const pullQuestionQueryBuilder = (doc) => {
|
|
92
|
+
return {
|
|
93
|
+
query: questionReplicationQuery,
|
|
94
|
+
variables: {
|
|
95
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
96
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
97
|
+
limit: REPLICATION_LIMIT,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
exports.pullQuestionQueryBuilder = pullQuestionQueryBuilder;
|
|
102
|
+
const osceStationReplicationQuery = `query OsceStationReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
103
|
+
topicReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
104
|
+
id
|
|
105
|
+
updatedAt
|
|
106
|
+
deleted
|
|
107
|
+
name
|
|
108
|
+
osceType {
|
|
109
|
+
id
|
|
110
|
+
name
|
|
111
|
+
# user-specific keys
|
|
112
|
+
# completed
|
|
113
|
+
# total
|
|
114
|
+
# avgScore
|
|
115
|
+
}
|
|
116
|
+
difficulty
|
|
117
|
+
candidateBrief
|
|
118
|
+
examinerBrief
|
|
119
|
+
actorBrief
|
|
120
|
+
explanation
|
|
121
|
+
marks {
|
|
122
|
+
id
|
|
123
|
+
index
|
|
124
|
+
osceStationId
|
|
125
|
+
header
|
|
126
|
+
name
|
|
127
|
+
}
|
|
128
|
+
topics {
|
|
129
|
+
...TopicFields
|
|
130
|
+
}
|
|
131
|
+
candidatePictures {
|
|
132
|
+
...PictureFields
|
|
133
|
+
}
|
|
134
|
+
actorPictures {
|
|
135
|
+
...PictureFields
|
|
136
|
+
}
|
|
137
|
+
exmainerPictures {
|
|
138
|
+
...PictureFields
|
|
139
|
+
}
|
|
140
|
+
walkthroughPictures{
|
|
141
|
+
...PictureFields
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
# user-specific keys
|
|
145
|
+
# attempted
|
|
146
|
+
# score
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
fragment PictureFields on OscePicture {
|
|
150
|
+
id
|
|
151
|
+
osceStationId
|
|
152
|
+
pictureId
|
|
153
|
+
picture {
|
|
154
|
+
id
|
|
155
|
+
createdAt
|
|
156
|
+
updatedAt
|
|
157
|
+
name
|
|
158
|
+
caption
|
|
159
|
+
path
|
|
160
|
+
path512
|
|
161
|
+
path256
|
|
162
|
+
topicId
|
|
163
|
+
topic {
|
|
164
|
+
...TopicFields
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
fragment TopicFields on Topic {
|
|
169
|
+
id
|
|
170
|
+
name
|
|
171
|
+
typeId
|
|
172
|
+
}
|
|
173
|
+
}`;
|
|
174
|
+
const pullOsceStationQueryBuilder = (doc) => {
|
|
175
|
+
return {
|
|
176
|
+
query: osceStationReplicationQuery,
|
|
177
|
+
variables: {
|
|
178
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
179
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
180
|
+
limit: REPLICATION_LIMIT,
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
exports.pullOsceStationQueryBuilder = pullOsceStationQueryBuilder;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const REPLICATION_LIMIT = 5;
|
|
2
|
+
const topicReplicationQuery = `query TopicReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
3
|
+
topicReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
4
|
+
id
|
|
5
|
+
updatedAt
|
|
6
|
+
name
|
|
7
|
+
totalQuestions
|
|
8
|
+
correctQuestions
|
|
9
|
+
incorrectQuestions
|
|
10
|
+
totalCards
|
|
11
|
+
ConfidentCards
|
|
12
|
+
ReviewCards
|
|
13
|
+
LearnCards
|
|
14
|
+
deleted
|
|
15
|
+
}
|
|
16
|
+
}`;
|
|
17
|
+
export const pullTopicQueryBuilder = (doc) => {
|
|
18
|
+
return {
|
|
19
|
+
query: topicReplicationQuery,
|
|
20
|
+
variables: {
|
|
21
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
22
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
23
|
+
limit: REPLICATION_LIMIT,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const questionReplicationQuery = `query QuestionReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
28
|
+
questionReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
29
|
+
id
|
|
30
|
+
__typename
|
|
31
|
+
createdAt
|
|
32
|
+
updatedAt
|
|
33
|
+
typeId
|
|
34
|
+
topic {
|
|
35
|
+
id
|
|
36
|
+
__typename
|
|
37
|
+
name
|
|
38
|
+
typeId
|
|
39
|
+
}
|
|
40
|
+
conceptId
|
|
41
|
+
concept {
|
|
42
|
+
id
|
|
43
|
+
__typename
|
|
44
|
+
createdAt
|
|
45
|
+
updatedAt
|
|
46
|
+
name
|
|
47
|
+
chapterId
|
|
48
|
+
topicId
|
|
49
|
+
}
|
|
50
|
+
question
|
|
51
|
+
explanation
|
|
52
|
+
totalVotes
|
|
53
|
+
choices {
|
|
54
|
+
id
|
|
55
|
+
__typename
|
|
56
|
+
questionId
|
|
57
|
+
name
|
|
58
|
+
explanation
|
|
59
|
+
label
|
|
60
|
+
answer
|
|
61
|
+
votes
|
|
62
|
+
}
|
|
63
|
+
pictures {
|
|
64
|
+
id
|
|
65
|
+
__typename
|
|
66
|
+
pictureId
|
|
67
|
+
questionId
|
|
68
|
+
choiceId
|
|
69
|
+
picture {
|
|
70
|
+
id
|
|
71
|
+
__typename
|
|
72
|
+
createdAt
|
|
73
|
+
updatedAt
|
|
74
|
+
name
|
|
75
|
+
caption
|
|
76
|
+
path
|
|
77
|
+
path512
|
|
78
|
+
topicId
|
|
79
|
+
path256
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
difficulty
|
|
83
|
+
elo
|
|
84
|
+
psaSectionId
|
|
85
|
+
}
|
|
86
|
+
}`;
|
|
87
|
+
export const pullQuestionQueryBuilder = (doc) => {
|
|
88
|
+
return {
|
|
89
|
+
query: questionReplicationQuery,
|
|
90
|
+
variables: {
|
|
91
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
92
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
93
|
+
limit: REPLICATION_LIMIT,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
const osceStationReplicationQuery = `query OsceStationReplication($lastId: String!, $minUpdatedAt: Int!, $limit: Int!){
|
|
98
|
+
topicReplication(lastId: $lastId, minUpdatedAt: $minUpdatedAt, limit: $limit) {
|
|
99
|
+
id
|
|
100
|
+
updatedAt
|
|
101
|
+
deleted
|
|
102
|
+
name
|
|
103
|
+
osceType {
|
|
104
|
+
id
|
|
105
|
+
name
|
|
106
|
+
# user-specific keys
|
|
107
|
+
# completed
|
|
108
|
+
# total
|
|
109
|
+
# avgScore
|
|
110
|
+
}
|
|
111
|
+
difficulty
|
|
112
|
+
candidateBrief
|
|
113
|
+
examinerBrief
|
|
114
|
+
actorBrief
|
|
115
|
+
explanation
|
|
116
|
+
marks {
|
|
117
|
+
id
|
|
118
|
+
index
|
|
119
|
+
osceStationId
|
|
120
|
+
header
|
|
121
|
+
name
|
|
122
|
+
}
|
|
123
|
+
topics {
|
|
124
|
+
...TopicFields
|
|
125
|
+
}
|
|
126
|
+
candidatePictures {
|
|
127
|
+
...PictureFields
|
|
128
|
+
}
|
|
129
|
+
actorPictures {
|
|
130
|
+
...PictureFields
|
|
131
|
+
}
|
|
132
|
+
exmainerPictures {
|
|
133
|
+
...PictureFields
|
|
134
|
+
}
|
|
135
|
+
walkthroughPictures{
|
|
136
|
+
...PictureFields
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
# user-specific keys
|
|
140
|
+
# attempted
|
|
141
|
+
# score
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
fragment PictureFields on OscePicture {
|
|
145
|
+
id
|
|
146
|
+
osceStationId
|
|
147
|
+
pictureId
|
|
148
|
+
picture {
|
|
149
|
+
id
|
|
150
|
+
createdAt
|
|
151
|
+
updatedAt
|
|
152
|
+
name
|
|
153
|
+
caption
|
|
154
|
+
path
|
|
155
|
+
path512
|
|
156
|
+
path256
|
|
157
|
+
topicId
|
|
158
|
+
topic {
|
|
159
|
+
...TopicFields
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
fragment TopicFields on Topic {
|
|
164
|
+
id
|
|
165
|
+
name
|
|
166
|
+
typeId
|
|
167
|
+
}
|
|
168
|
+
}`;
|
|
169
|
+
export const pullOsceStationQueryBuilder = (doc) => {
|
|
170
|
+
return {
|
|
171
|
+
query: osceStationReplicationQuery,
|
|
172
|
+
variables: {
|
|
173
|
+
lastId: (doc === null || doc === void 0 ? void 0 : doc.id) ? doc.id.toString() : '0',
|
|
174
|
+
minUpdatedAt: (doc === null || doc === void 0 ? void 0 : doc.updatedAt) ? doc.updatedAt : 0,
|
|
175
|
+
limit: REPLICATION_LIMIT,
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
};
|