@quesmed/types 2.6.266 → 2.6.268

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.
Files changed (29) hide show
  1. package/dist/cjs/models/Circuit.d.ts +15 -1
  2. package/dist/cjs/models/Circuit.js +12 -0
  3. package/dist/cjs/resolvers/fragments/circuit.js +2 -1
  4. package/dist/cjs/resolvers/mutation/restricted/asset.d.ts +20 -0
  5. package/dist/cjs/resolvers/mutation/restricted/asset.js +22 -0
  6. package/dist/cjs/resolvers/mutation/restricted/index.d.ts +2 -0
  7. package/dist/cjs/resolvers/mutation/restricted/index.js +2 -0
  8. package/dist/cjs/resolvers/mutation/restricted/station.d.ts +81 -0
  9. package/dist/cjs/resolvers/mutation/restricted/station.js +90 -0
  10. package/dist/cjs/resolvers/query/restricted/circuit.js +4 -2
  11. package/dist/cjs/resolvers/query/restricted/index.d.ts +1 -0
  12. package/dist/cjs/resolvers/query/restricted/index.js +1 -0
  13. package/dist/cjs/resolvers/query/restricted/station.d.ts +35 -0
  14. package/dist/cjs/resolvers/query/restricted/station.js +40 -0
  15. package/dist/mjs/models/Circuit.d.ts +15 -1
  16. package/dist/mjs/models/Circuit.js +11 -1
  17. package/dist/mjs/resolvers/fragments/circuit.js +2 -1
  18. package/dist/mjs/resolvers/mutation/restricted/asset.d.ts +20 -0
  19. package/dist/mjs/resolvers/mutation/restricted/asset.js +19 -0
  20. package/dist/mjs/resolvers/mutation/restricted/index.d.ts +2 -0
  21. package/dist/mjs/resolvers/mutation/restricted/index.js +2 -0
  22. package/dist/mjs/resolvers/mutation/restricted/station.d.ts +81 -0
  23. package/dist/mjs/resolvers/mutation/restricted/station.js +85 -0
  24. package/dist/mjs/resolvers/query/restricted/circuit.js +4 -2
  25. package/dist/mjs/resolvers/query/restricted/index.d.ts +1 -0
  26. package/dist/mjs/resolvers/query/restricted/index.js +1 -0
  27. package/dist/mjs/resolvers/query/restricted/station.d.ts +35 -0
  28. package/dist/mjs/resolvers/query/restricted/station.js +37 -0
  29. package/package.json +1 -1
@@ -1,16 +1,29 @@
1
1
  import { IOsceMarksheet } from './OsceMarksheet';
2
2
  import { IOsceStation } from './OsceStation';
3
3
  import { Id } from './Type';
4
+ export declare enum ECircuitVisibility {
5
+ PRIVATE = 0,
6
+ PUBLIC = 1
7
+ }
8
+ export declare enum ECircuitType {
9
+ MOCK = 0,
10
+ BODY_SYSTEM = 1,
11
+ CUSTOM = 2
12
+ }
4
13
  export interface ICircuitStationInput {
5
14
  osceStationId: number;
6
15
  sortOrder: number;
7
16
  }
8
17
  export interface ICreateCircuitInput {
9
18
  name: string;
19
+ description?: string;
20
+ visibility?: ECircuitVisibility;
10
21
  stations: ICircuitStationInput[];
11
22
  }
12
23
  export interface IEditCircuitInput {
13
24
  name?: string;
25
+ description?: string;
26
+ visibility?: ECircuitVisibility;
14
27
  stations?: ICircuitStationInput[];
15
28
  }
16
29
  export interface ICircuit {
@@ -20,7 +33,8 @@ export interface ICircuit {
20
33
  userId: number;
21
34
  description: string;
22
35
  name: string;
23
- preDefined: boolean;
36
+ visibility: ECircuitVisibility;
37
+ type: ECircuitType;
24
38
  stations?: IOsceStation[];
25
39
  circuitSession?: ICircuitSession | null;
26
40
  }
@@ -1,2 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ECircuitType = exports.ECircuitVisibility = void 0;
4
+ var ECircuitVisibility;
5
+ (function (ECircuitVisibility) {
6
+ ECircuitVisibility[ECircuitVisibility["PRIVATE"] = 0] = "PRIVATE";
7
+ ECircuitVisibility[ECircuitVisibility["PUBLIC"] = 1] = "PUBLIC";
8
+ })(ECircuitVisibility = exports.ECircuitVisibility || (exports.ECircuitVisibility = {}));
9
+ var ECircuitType;
10
+ (function (ECircuitType) {
11
+ ECircuitType[ECircuitType["MOCK"] = 0] = "MOCK";
12
+ ECircuitType[ECircuitType["BODY_SYSTEM"] = 1] = "BODY_SYSTEM";
13
+ ECircuitType[ECircuitType["CUSTOM"] = 2] = "CUSTOM";
14
+ })(ECircuitType = exports.ECircuitType || (exports.ECircuitType = {}));
@@ -13,7 +13,8 @@ ${picture_1.PICTURE_FIELDS}
13
13
  userId
14
14
  name
15
15
  description
16
- preDefined
16
+ visibility
17
+ typeId
17
18
  stations {
18
19
  id
19
20
  name
@@ -0,0 +1,20 @@
1
+ import { FileData, IPicture, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export interface IAssetInput {
4
+ file: File | FileData;
5
+ caption?: string | null;
6
+ name: string;
7
+ topicId?: Id;
8
+ sensitive: boolean;
9
+ overlay?: boolean;
10
+ }
11
+ export declare const CREATE_ASSETS: import("@apollo/client").DocumentNode;
12
+ export type ICreateAssetsVar = {
13
+ inputs: IAssetInput[];
14
+ };
15
+ export type ICreateAssetsData = AdminData<(IPicture & graphqlNormalize)[], 'createAssets'>;
16
+ export declare const REMOVE_ASSETS: import("@apollo/client").DocumentNode;
17
+ export type IRemoveAssetsVar = {
18
+ ids: Id[];
19
+ };
20
+ export type IRemoveAssetsData = AdminData<boolean, 'removeAssets'>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REMOVE_ASSETS = exports.CREATE_ASSETS = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const fragments_1 = require("../../fragments");
6
+ exports.CREATE_ASSETS = (0, client_1.gql) `
7
+ ${fragments_1.PICTURE_FIELDS}
8
+ mutation CreateAssets($inputs: [CreateAssetsInput!]!) {
9
+ restricted {
10
+ createAssets(inputs: $inputs) {
11
+ ...PictureFields
12
+ }
13
+ }
14
+ }
15
+ `;
16
+ exports.REMOVE_ASSETS = (0, client_1.gql) `
17
+ mutation RemoveAssets($ids: [ID!]!) {
18
+ restricted {
19
+ removeAssets(ids: $ids)
20
+ }
21
+ }
22
+ `;
@@ -1,4 +1,5 @@
1
1
  export * from './agora';
2
+ export * from './asset';
2
3
  export * from './circuit';
3
4
  export * from './book';
4
5
  export * from './chapter';
@@ -9,6 +10,7 @@ export * from './notification';
9
10
  export * from './osce';
10
11
  export * from './preset';
11
12
  export * from './questionDiscussion';
13
+ export * from './station';
12
14
  export * from './stripe';
13
15
  export * from './todo';
14
16
  export * from './token';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./agora"), exports);
18
+ __exportStar(require("./asset"), exports);
18
19
  __exportStar(require("./circuit"), exports);
19
20
  __exportStar(require("./book"), exports);
20
21
  __exportStar(require("./chapter"), exports);
@@ -25,6 +26,7 @@ __exportStar(require("./notification"), exports);
25
26
  __exportStar(require("./osce"), exports);
26
27
  __exportStar(require("./preset"), exports);
27
28
  __exportStar(require("./questionDiscussion"), exports);
29
+ __exportStar(require("./station"), exports);
28
30
  __exportStar(require("./stripe"), exports);
29
31
  __exportStar(require("./todo"), exports);
30
32
  __exportStar(require("./token"), exports);
@@ -0,0 +1,81 @@
1
+ import { ApolloCache } from '@apollo/client';
2
+ import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../..';
3
+ import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IStationExaminerQuestion } from '../../../models';
4
+ import { IAssetBinding } from '../../../models/Picture';
5
+ import { graphqlNormalize, RestrictedData } from '../../types';
6
+ import { EOsceType } from '../../../models';
7
+ export interface IJobStationMarkInput {
8
+ header?: string;
9
+ name?: string;
10
+ index?: number;
11
+ excludeFromAi?: boolean;
12
+ weight?: number;
13
+ }
14
+ export declare const CREATE_STATION: import("@apollo/client").DocumentNode;
15
+ export type ICreateStationData = RestrictedData<graphqlNormalize & IOsceStation, 'createStation'>;
16
+ export interface ICreateStationVar {
17
+ input: {
18
+ name: string;
19
+ hiddenName?: string;
20
+ osceTypeId?: number;
21
+ enabled?: number;
22
+ visibility?: number;
23
+ entitlementIds?: number[];
24
+ difficulty?: number;
25
+ pictureId?: number;
26
+ candidateBrief?: string;
27
+ examinerBrief?: string;
28
+ actorBrief?: string;
29
+ llmActorBrief?: string;
30
+ explanation?: string;
31
+ aiEnabled?: boolean;
32
+ aiConfig?: Record<string, unknown>;
33
+ phaseTimers?: IOsceStationPhaseTimer;
34
+ clinicalData?: IClinicalDataModule[];
35
+ topicIds?: number[];
36
+ marks?: IJobStationMarkInput[];
37
+ examinerQuestions?: IStationExaminerQuestion[];
38
+ assets?: IAssetBinding[];
39
+ };
40
+ }
41
+ export declare const updateCacheOnCreateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreateStationData>, options: ApolloUpdateOptions<ICreateStationVar>) => void;
42
+ export declare const UPDATE_STATION: import("@apollo/client").DocumentNode;
43
+ export type IUpdateStationData = RestrictedData<graphqlNormalize & IOsceStation, 'updateStation'>;
44
+ export interface IUpdateStationVar {
45
+ input: {
46
+ id: Id;
47
+ name?: string;
48
+ enabled?: number;
49
+ visibility?: number;
50
+ osceTypeId?: number;
51
+ hiddenName?: string;
52
+ entitlementIds?: number[];
53
+ difficulty?: number;
54
+ pictureId?: number;
55
+ candidateBrief?: string;
56
+ examinerBrief?: string;
57
+ actorBrief?: string;
58
+ llmActorBrief?: string;
59
+ explanation?: string;
60
+ aiEnabled?: boolean;
61
+ aiConfig?: Record<string, unknown>;
62
+ phaseTimers?: IOsceStationPhaseTimer;
63
+ clinicalData?: IClinicalDataModule[];
64
+ topicIds?: number[];
65
+ marks?: IJobStationMarkInput[];
66
+ assets?: IAssetBinding[];
67
+ examinerQuestions?: IStationExaminerQuestion[];
68
+ };
69
+ }
70
+ export declare const updateCacheOnUpdateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateStationData>, options: ApolloUpdateOptions<IUpdateStationVar>) => void;
71
+ export interface IGenerateStationSession {
72
+ sessionId: string;
73
+ }
74
+ export type IGenerateStationData = RestrictedData<graphqlNormalize & IGenerateStationSession, 'generateStation'>;
75
+ export interface IGenerateStationVar {
76
+ input: {
77
+ prompt: string;
78
+ osceTypeId: EOsceType;
79
+ };
80
+ }
81
+ export declare const GENERATE_STATION: import("@apollo/client").DocumentNode;
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GENERATE_STATION = exports.updateCacheOnUpdateStation = exports.UPDATE_STATION = exports.updateCacheOnCreateStation = exports.CREATE_STATION = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const osce_1 = require("../../fragments/osce");
6
+ const restricted_1 = require("../../query/restricted");
7
+ exports.CREATE_STATION = (0, client_1.gql) `
8
+ ${osce_1.OSCE_STATION_FIELDS}
9
+ mutation CreateStation($input: CreateStationInput!) {
10
+ restricted {
11
+ createStation(input: $input) {
12
+ ...OsceStationFields
13
+ }
14
+ }
15
+ }
16
+ `;
17
+ const updateCacheOnCreateStation = (cache, result, options) => {
18
+ const { createStation } = result?.data?.restricted || {};
19
+ const { variables } = options || {};
20
+ if (!createStation || !variables) {
21
+ return;
22
+ }
23
+ const prevData = cache.readQuery({
24
+ variables: { solo: false },
25
+ query: restricted_1.OSCE_STATIONS,
26
+ });
27
+ if (prevData) {
28
+ const { osceStations } = prevData.restricted || {};
29
+ cache.writeQuery({
30
+ query: restricted_1.OSCE_STATIONS,
31
+ variables: { solo: false },
32
+ data: {
33
+ ...prevData,
34
+ restricted: {
35
+ ...prevData.restricted,
36
+ osceStations: [{ ...createStation }, ...osceStations],
37
+ },
38
+ },
39
+ });
40
+ }
41
+ else {
42
+ cache.writeQuery({
43
+ query: restricted_1.OSCE_STATIONS,
44
+ variables: { solo: false },
45
+ data: {
46
+ restricted: {
47
+ __typename: 'RestrictedQuery',
48
+ osceStations: [{ ...createStation }],
49
+ },
50
+ },
51
+ });
52
+ }
53
+ };
54
+ exports.updateCacheOnCreateStation = updateCacheOnCreateStation;
55
+ exports.UPDATE_STATION = (0, client_1.gql) `
56
+ ${osce_1.OSCE_STATION_FIELDS}
57
+ mutation UpdateStation($input: UpdateStationInput!) {
58
+ restricted {
59
+ updateStation(input: $input) {
60
+ ...OsceStationFields
61
+ }
62
+ }
63
+ }
64
+ `;
65
+ const updateCacheOnUpdateStation = (cache, result, options) => {
66
+ const { updateStation } = result?.data?.restricted || {};
67
+ const { variables } = options || {};
68
+ if (!updateStation || !variables) {
69
+ return;
70
+ }
71
+ cache.writeFragment({
72
+ id: cache.identify({
73
+ id: variables.input.id,
74
+ __typename: 'OsceStation',
75
+ }),
76
+ data: { ...updateStation },
77
+ fragment: osce_1.OSCE_STATION_FIELDS,
78
+ fragmentName: 'OsceStationFields',
79
+ });
80
+ };
81
+ exports.updateCacheOnUpdateStation = updateCacheOnUpdateStation;
82
+ exports.GENERATE_STATION = (0, client_1.gql) `
83
+ mutation GenerateStation($input: GenerateStationInput!) {
84
+ restricted {
85
+ generateStation(input: $input) {
86
+ sessionId
87
+ }
88
+ }
89
+ }
90
+ `;
@@ -59,7 +59,8 @@ exports.CIRCUIT_SESSION = (0, client_1.gql) `
59
59
  circuit {
60
60
  id
61
61
  name
62
- preDefined
62
+ visibility
63
+ typeId
63
64
  }
64
65
  }
65
66
  }
@@ -74,7 +75,8 @@ exports.CIRCUIT_SESSIONS = (0, client_1.gql) `
74
75
  circuit {
75
76
  id
76
77
  name
77
- preDefined
78
+ visibility
79
+ typeId
78
80
  }
79
81
  }
80
82
  }
@@ -15,6 +15,7 @@ export * from './qBank';
15
15
  export * from './quesBook';
16
16
  export * from './question';
17
17
  export * from './replication';
18
+ export * from './station';
18
19
  export * from './todos';
19
20
  export * from './topics';
20
21
  export * from './ukmlaTopics';
@@ -31,6 +31,7 @@ __exportStar(require("./qBank"), exports);
31
31
  __exportStar(require("./quesBook"), exports);
32
32
  __exportStar(require("./question"), exports);
33
33
  __exportStar(require("./replication"), exports);
34
+ __exportStar(require("./station"), exports);
34
35
  __exportStar(require("./todos"), exports);
35
36
  __exportStar(require("./topics"), exports);
36
37
  __exportStar(require("./ukmlaTopics"), exports);
@@ -0,0 +1,35 @@
1
+ import { EOsceType, IStationExaminerQuestion } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare enum EGenerateStationStatus {
4
+ PENDING = "PENDING",
5
+ READY = "READY",
6
+ FAILED = "FAILED"
7
+ }
8
+ export interface IGeneratedStationMark {
9
+ header?: string;
10
+ name?: string;
11
+ index?: number;
12
+ weight?: number;
13
+ excludeFromAi?: boolean;
14
+ }
15
+ export interface IGeneratedStation {
16
+ name?: string;
17
+ osceTypeId?: EOsceType;
18
+ difficulty?: number;
19
+ candidateBrief?: string;
20
+ examinerBrief?: string;
21
+ actorBrief?: string;
22
+ explanation?: string;
23
+ examinerQuestions?: IStationExaminerQuestion[];
24
+ marks?: IGeneratedStationMark[];
25
+ }
26
+ export interface IGenerateStationResult {
27
+ status: EGenerateStationStatus;
28
+ station?: IGeneratedStation;
29
+ error?: string;
30
+ }
31
+ export type IGenerateStationStatusData = RestrictedData<graphqlNormalize & IGenerateStationResult, 'generateStationStatus'>;
32
+ export interface IGenerateStationStatusVar {
33
+ sessionId: string;
34
+ }
35
+ export declare const GENERATE_STATION_STATUS: import("@apollo/client").DocumentNode;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GENERATE_STATION_STATUS = exports.EGenerateStationStatus = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ var EGenerateStationStatus;
6
+ (function (EGenerateStationStatus) {
7
+ EGenerateStationStatus["PENDING"] = "PENDING";
8
+ EGenerateStationStatus["READY"] = "READY";
9
+ EGenerateStationStatus["FAILED"] = "FAILED";
10
+ })(EGenerateStationStatus = exports.EGenerateStationStatus || (exports.EGenerateStationStatus = {}));
11
+ exports.GENERATE_STATION_STATUS = (0, client_1.gql) `
12
+ query GenerateStationStatus($sessionId: String!) {
13
+ restricted {
14
+ generateStationStatus(sessionId: $sessionId) {
15
+ status
16
+ error
17
+ station {
18
+ name
19
+ osceTypeId
20
+ difficulty
21
+ candidateBrief
22
+ examinerBrief
23
+ actorBrief
24
+ explanation
25
+ examinerQuestions {
26
+ index
27
+ question
28
+ }
29
+ marks {
30
+ header
31
+ name
32
+ index
33
+ weight
34
+ excludeFromAi
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ `;
@@ -1,16 +1,29 @@
1
1
  import { IOsceMarksheet } from './OsceMarksheet';
2
2
  import { IOsceStation } from './OsceStation';
3
3
  import { Id } from './Type';
4
+ export declare enum ECircuitVisibility {
5
+ PRIVATE = 0,
6
+ PUBLIC = 1
7
+ }
8
+ export declare enum ECircuitType {
9
+ MOCK = 0,
10
+ BODY_SYSTEM = 1,
11
+ CUSTOM = 2
12
+ }
4
13
  export interface ICircuitStationInput {
5
14
  osceStationId: number;
6
15
  sortOrder: number;
7
16
  }
8
17
  export interface ICreateCircuitInput {
9
18
  name: string;
19
+ description?: string;
20
+ visibility?: ECircuitVisibility;
10
21
  stations: ICircuitStationInput[];
11
22
  }
12
23
  export interface IEditCircuitInput {
13
24
  name?: string;
25
+ description?: string;
26
+ visibility?: ECircuitVisibility;
14
27
  stations?: ICircuitStationInput[];
15
28
  }
16
29
  export interface ICircuit {
@@ -20,7 +33,8 @@ export interface ICircuit {
20
33
  userId: number;
21
34
  description: string;
22
35
  name: string;
23
- preDefined: boolean;
36
+ visibility: ECircuitVisibility;
37
+ type: ECircuitType;
24
38
  stations?: IOsceStation[];
25
39
  circuitSession?: ICircuitSession | null;
26
40
  }
@@ -1 +1,11 @@
1
- export {};
1
+ export var ECircuitVisibility;
2
+ (function (ECircuitVisibility) {
3
+ ECircuitVisibility[ECircuitVisibility["PRIVATE"] = 0] = "PRIVATE";
4
+ ECircuitVisibility[ECircuitVisibility["PUBLIC"] = 1] = "PUBLIC";
5
+ })(ECircuitVisibility || (ECircuitVisibility = {}));
6
+ export var ECircuitType;
7
+ (function (ECircuitType) {
8
+ ECircuitType[ECircuitType["MOCK"] = 0] = "MOCK";
9
+ ECircuitType[ECircuitType["BODY_SYSTEM"] = 1] = "BODY_SYSTEM";
10
+ ECircuitType[ECircuitType["CUSTOM"] = 2] = "CUSTOM";
11
+ })(ECircuitType || (ECircuitType = {}));
@@ -10,7 +10,8 @@ ${PICTURE_FIELDS}
10
10
  userId
11
11
  name
12
12
  description
13
- preDefined
13
+ visibility
14
+ typeId
14
15
  stations {
15
16
  id
16
17
  name
@@ -0,0 +1,20 @@
1
+ import { FileData, IPicture, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export interface IAssetInput {
4
+ file: File | FileData;
5
+ caption?: string | null;
6
+ name: string;
7
+ topicId?: Id;
8
+ sensitive: boolean;
9
+ overlay?: boolean;
10
+ }
11
+ export declare const CREATE_ASSETS: import("@apollo/client").DocumentNode;
12
+ export type ICreateAssetsVar = {
13
+ inputs: IAssetInput[];
14
+ };
15
+ export type ICreateAssetsData = AdminData<(IPicture & graphqlNormalize)[], 'createAssets'>;
16
+ export declare const REMOVE_ASSETS: import("@apollo/client").DocumentNode;
17
+ export type IRemoveAssetsVar = {
18
+ ids: Id[];
19
+ };
20
+ export type IRemoveAssetsData = AdminData<boolean, 'removeAssets'>;
@@ -0,0 +1,19 @@
1
+ import { gql } from '@apollo/client';
2
+ import { PICTURE_FIELDS } from '../../fragments';
3
+ export const CREATE_ASSETS = gql `
4
+ ${PICTURE_FIELDS}
5
+ mutation CreateAssets($inputs: [CreateAssetsInput!]!) {
6
+ restricted {
7
+ createAssets(inputs: $inputs) {
8
+ ...PictureFields
9
+ }
10
+ }
11
+ }
12
+ `;
13
+ export const REMOVE_ASSETS = gql `
14
+ mutation RemoveAssets($ids: [ID!]!) {
15
+ restricted {
16
+ removeAssets(ids: $ids)
17
+ }
18
+ }
19
+ `;
@@ -1,4 +1,5 @@
1
1
  export * from './agora';
2
+ export * from './asset';
2
3
  export * from './circuit';
3
4
  export * from './book';
4
5
  export * from './chapter';
@@ -9,6 +10,7 @@ export * from './notification';
9
10
  export * from './osce';
10
11
  export * from './preset';
11
12
  export * from './questionDiscussion';
13
+ export * from './station';
12
14
  export * from './stripe';
13
15
  export * from './todo';
14
16
  export * from './token';
@@ -1,4 +1,5 @@
1
1
  export * from './agora';
2
+ export * from './asset';
2
3
  export * from './circuit';
3
4
  export * from './book';
4
5
  export * from './chapter';
@@ -9,6 +10,7 @@ export * from './notification';
9
10
  export * from './osce';
10
11
  export * from './preset';
11
12
  export * from './questionDiscussion';
13
+ export * from './station';
12
14
  export * from './stripe';
13
15
  export * from './todo';
14
16
  export * from './token';
@@ -0,0 +1,81 @@
1
+ import { ApolloCache } from '@apollo/client';
2
+ import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../..';
3
+ import { IClinicalDataModule, Id, IOsceStation, IOsceStationPhaseTimer, IStationExaminerQuestion } from '../../../models';
4
+ import { IAssetBinding } from '../../../models/Picture';
5
+ import { graphqlNormalize, RestrictedData } from '../../types';
6
+ import { EOsceType } from '../../../models';
7
+ export interface IJobStationMarkInput {
8
+ header?: string;
9
+ name?: string;
10
+ index?: number;
11
+ excludeFromAi?: boolean;
12
+ weight?: number;
13
+ }
14
+ export declare const CREATE_STATION: import("@apollo/client").DocumentNode;
15
+ export type ICreateStationData = RestrictedData<graphqlNormalize & IOsceStation, 'createStation'>;
16
+ export interface ICreateStationVar {
17
+ input: {
18
+ name: string;
19
+ hiddenName?: string;
20
+ osceTypeId?: number;
21
+ enabled?: number;
22
+ visibility?: number;
23
+ entitlementIds?: number[];
24
+ difficulty?: number;
25
+ pictureId?: number;
26
+ candidateBrief?: string;
27
+ examinerBrief?: string;
28
+ actorBrief?: string;
29
+ llmActorBrief?: string;
30
+ explanation?: string;
31
+ aiEnabled?: boolean;
32
+ aiConfig?: Record<string, unknown>;
33
+ phaseTimers?: IOsceStationPhaseTimer;
34
+ clinicalData?: IClinicalDataModule[];
35
+ topicIds?: number[];
36
+ marks?: IJobStationMarkInput[];
37
+ examinerQuestions?: IStationExaminerQuestion[];
38
+ assets?: IAssetBinding[];
39
+ };
40
+ }
41
+ export declare const updateCacheOnCreateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreateStationData>, options: ApolloUpdateOptions<ICreateStationVar>) => void;
42
+ export declare const UPDATE_STATION: import("@apollo/client").DocumentNode;
43
+ export type IUpdateStationData = RestrictedData<graphqlNormalize & IOsceStation, 'updateStation'>;
44
+ export interface IUpdateStationVar {
45
+ input: {
46
+ id: Id;
47
+ name?: string;
48
+ enabled?: number;
49
+ visibility?: number;
50
+ osceTypeId?: number;
51
+ hiddenName?: string;
52
+ entitlementIds?: number[];
53
+ difficulty?: number;
54
+ pictureId?: number;
55
+ candidateBrief?: string;
56
+ examinerBrief?: string;
57
+ actorBrief?: string;
58
+ llmActorBrief?: string;
59
+ explanation?: string;
60
+ aiEnabled?: boolean;
61
+ aiConfig?: Record<string, unknown>;
62
+ phaseTimers?: IOsceStationPhaseTimer;
63
+ clinicalData?: IClinicalDataModule[];
64
+ topicIds?: number[];
65
+ marks?: IJobStationMarkInput[];
66
+ assets?: IAssetBinding[];
67
+ examinerQuestions?: IStationExaminerQuestion[];
68
+ };
69
+ }
70
+ export declare const updateCacheOnUpdateStation: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateStationData>, options: ApolloUpdateOptions<IUpdateStationVar>) => void;
71
+ export interface IGenerateStationSession {
72
+ sessionId: string;
73
+ }
74
+ export type IGenerateStationData = RestrictedData<graphqlNormalize & IGenerateStationSession, 'generateStation'>;
75
+ export interface IGenerateStationVar {
76
+ input: {
77
+ prompt: string;
78
+ osceTypeId: EOsceType;
79
+ };
80
+ }
81
+ export declare const GENERATE_STATION: import("@apollo/client").DocumentNode;
@@ -0,0 +1,85 @@
1
+ import { gql } from '@apollo/client';
2
+ import { OSCE_STATION_FIELDS } from '../../fragments/osce';
3
+ import { OSCE_STATIONS, } from '../../query/restricted';
4
+ export const CREATE_STATION = gql `
5
+ ${OSCE_STATION_FIELDS}
6
+ mutation CreateStation($input: CreateStationInput!) {
7
+ restricted {
8
+ createStation(input: $input) {
9
+ ...OsceStationFields
10
+ }
11
+ }
12
+ }
13
+ `;
14
+ export const updateCacheOnCreateStation = (cache, result, options) => {
15
+ const { createStation } = result?.data?.restricted || {};
16
+ const { variables } = options || {};
17
+ if (!createStation || !variables) {
18
+ return;
19
+ }
20
+ const prevData = cache.readQuery({
21
+ variables: { solo: false },
22
+ query: OSCE_STATIONS,
23
+ });
24
+ if (prevData) {
25
+ const { osceStations } = prevData.restricted || {};
26
+ cache.writeQuery({
27
+ query: OSCE_STATIONS,
28
+ variables: { solo: false },
29
+ data: {
30
+ ...prevData,
31
+ restricted: {
32
+ ...prevData.restricted,
33
+ osceStations: [{ ...createStation }, ...osceStations],
34
+ },
35
+ },
36
+ });
37
+ }
38
+ else {
39
+ cache.writeQuery({
40
+ query: OSCE_STATIONS,
41
+ variables: { solo: false },
42
+ data: {
43
+ restricted: {
44
+ __typename: 'RestrictedQuery',
45
+ osceStations: [{ ...createStation }],
46
+ },
47
+ },
48
+ });
49
+ }
50
+ };
51
+ export const UPDATE_STATION = gql `
52
+ ${OSCE_STATION_FIELDS}
53
+ mutation UpdateStation($input: UpdateStationInput!) {
54
+ restricted {
55
+ updateStation(input: $input) {
56
+ ...OsceStationFields
57
+ }
58
+ }
59
+ }
60
+ `;
61
+ export const updateCacheOnUpdateStation = (cache, result, options) => {
62
+ const { updateStation } = result?.data?.restricted || {};
63
+ const { variables } = options || {};
64
+ if (!updateStation || !variables) {
65
+ return;
66
+ }
67
+ cache.writeFragment({
68
+ id: cache.identify({
69
+ id: variables.input.id,
70
+ __typename: 'OsceStation',
71
+ }),
72
+ data: { ...updateStation },
73
+ fragment: OSCE_STATION_FIELDS,
74
+ fragmentName: 'OsceStationFields',
75
+ });
76
+ };
77
+ export const GENERATE_STATION = gql `
78
+ mutation GenerateStation($input: GenerateStationInput!) {
79
+ restricted {
80
+ generateStation(input: $input) {
81
+ sessionId
82
+ }
83
+ }
84
+ }
85
+ `;
@@ -56,7 +56,8 @@ export const CIRCUIT_SESSION = gql `
56
56
  circuit {
57
57
  id
58
58
  name
59
- preDefined
59
+ visibility
60
+ typeId
60
61
  }
61
62
  }
62
63
  }
@@ -71,7 +72,8 @@ export const CIRCUIT_SESSIONS = gql `
71
72
  circuit {
72
73
  id
73
74
  name
74
- preDefined
75
+ visibility
76
+ typeId
75
77
  }
76
78
  }
77
79
  }
@@ -15,6 +15,7 @@ export * from './qBank';
15
15
  export * from './quesBook';
16
16
  export * from './question';
17
17
  export * from './replication';
18
+ export * from './station';
18
19
  export * from './todos';
19
20
  export * from './topics';
20
21
  export * from './ukmlaTopics';
@@ -15,6 +15,7 @@ export * from './qBank';
15
15
  export * from './quesBook';
16
16
  export * from './question';
17
17
  export * from './replication';
18
+ export * from './station';
18
19
  export * from './todos';
19
20
  export * from './topics';
20
21
  export * from './ukmlaTopics';
@@ -0,0 +1,35 @@
1
+ import { EOsceType, IStationExaminerQuestion } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
+ export declare enum EGenerateStationStatus {
4
+ PENDING = "PENDING",
5
+ READY = "READY",
6
+ FAILED = "FAILED"
7
+ }
8
+ export interface IGeneratedStationMark {
9
+ header?: string;
10
+ name?: string;
11
+ index?: number;
12
+ weight?: number;
13
+ excludeFromAi?: boolean;
14
+ }
15
+ export interface IGeneratedStation {
16
+ name?: string;
17
+ osceTypeId?: EOsceType;
18
+ difficulty?: number;
19
+ candidateBrief?: string;
20
+ examinerBrief?: string;
21
+ actorBrief?: string;
22
+ explanation?: string;
23
+ examinerQuestions?: IStationExaminerQuestion[];
24
+ marks?: IGeneratedStationMark[];
25
+ }
26
+ export interface IGenerateStationResult {
27
+ status: EGenerateStationStatus;
28
+ station?: IGeneratedStation;
29
+ error?: string;
30
+ }
31
+ export type IGenerateStationStatusData = RestrictedData<graphqlNormalize & IGenerateStationResult, 'generateStationStatus'>;
32
+ export interface IGenerateStationStatusVar {
33
+ sessionId: string;
34
+ }
35
+ export declare const GENERATE_STATION_STATUS: import("@apollo/client").DocumentNode;
@@ -0,0 +1,37 @@
1
+ import { gql } from '@apollo/client';
2
+ export var EGenerateStationStatus;
3
+ (function (EGenerateStationStatus) {
4
+ EGenerateStationStatus["PENDING"] = "PENDING";
5
+ EGenerateStationStatus["READY"] = "READY";
6
+ EGenerateStationStatus["FAILED"] = "FAILED";
7
+ })(EGenerateStationStatus || (EGenerateStationStatus = {}));
8
+ export const GENERATE_STATION_STATUS = gql `
9
+ query GenerateStationStatus($sessionId: String!) {
10
+ restricted {
11
+ generateStationStatus(sessionId: $sessionId) {
12
+ status
13
+ error
14
+ station {
15
+ name
16
+ osceTypeId
17
+ difficulty
18
+ candidateBrief
19
+ examinerBrief
20
+ actorBrief
21
+ explanation
22
+ examinerQuestions {
23
+ index
24
+ question
25
+ }
26
+ marks {
27
+ header
28
+ name
29
+ index
30
+ weight
31
+ excludeFromAi
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.266",
3
+ "version": "2.6.268",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",