@quesmed/types 2.2.37 → 2.2.40

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.
@@ -117,6 +117,50 @@ export interface IModifyMarksheetInfo {
117
117
  input: IQbankInfoInput;
118
118
  }
119
119
  export declare type IModifyMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'modifyMarksheetInfo'>;
120
+ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: number, builderConfig: IBuildConfigData, client?: ApolloClient<any> | undefined) => {
121
+ restricted: {
122
+ __typename: string;
123
+ modifyMarksheetInfo: {
124
+ builderConfig: {
125
+ numberOfQuestions?: number | undefined;
126
+ difficulty?: number[] | undefined;
127
+ unseen?: boolean | undefined;
128
+ seenIncorrect?: boolean | undefined;
129
+ seenCorrect?: boolean | undefined;
130
+ secondsPerQuestion?: number | undefined;
131
+ isTest?: boolean | undefined;
132
+ };
133
+ __typename?: string | undefined;
134
+ id: number;
135
+ createdAt: number | Date;
136
+ updatedAt: number | Date;
137
+ deletedAt: number | Date;
138
+ startedAt: number | Date;
139
+ type: import("../../../models").EMarksheetType;
140
+ endedAt: number | Date;
141
+ topicIds: number[];
142
+ topicNames?: string[] | undefined;
143
+ source: string;
144
+ userId: number;
145
+ user?: IUser | undefined;
146
+ marks: import("../../../models").IMarksheetMark[];
147
+ mockTestId: number | null;
148
+ correct?: number | undefined;
149
+ incorrect?: number | undefined;
150
+ totalQuestions?: number | undefined;
151
+ isTestMarksheet?: boolean | undefined;
152
+ solo: boolean;
153
+ agoraId: string;
154
+ users: IUser[];
155
+ state: EMarksheetState;
156
+ completed: boolean;
157
+ timeTaken: number;
158
+ currentMarkId?: number | undefined;
159
+ topicConceptData?: string | undefined;
160
+ preBuildData?: IPreBuildMarksheet | undefined;
161
+ };
162
+ };
163
+ };
120
164
  export declare const MODIFY_MARKSHEET_INFO: import("@apollo/client").DocumentNode;
121
165
  /**
122
166
  * leaveMarksheet
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.END_MARKSHEET = exports.LEAVE_MARKSHEET = exports.MODIFY_MARKSHEET_INFO = exports.START_OR_JOIN_MARKSHEET = exports.REMOVE_FLAGGED_QUESTION = exports.ADD_FLAGGED_QUESTION = exports.optimisticSaveMarksheets = exports.updateMarksheets = exports.SAVE_MARKSHEET = exports.RE_BUILD_MARKSHEET = exports.BUILD_MARKSHEET = void 0;
3
+ exports.END_MARKSHEET = exports.LEAVE_MARKSHEET = exports.MODIFY_MARKSHEET_INFO = exports.optimisticModifyMarksheetBuilderConfig = exports.START_OR_JOIN_MARKSHEET = exports.REMOVE_FLAGGED_QUESTION = exports.ADD_FLAGGED_QUESTION = exports.optimisticSaveMarksheets = exports.updateMarksheets = exports.SAVE_MARKSHEET = exports.RE_BUILD_MARKSHEET = exports.BUILD_MARKSHEET = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const restricted_1 = require("../../query/restricted");
6
6
  exports.BUILD_MARKSHEET = (0, client_1.gql) `
@@ -1137,6 +1137,7 @@ exports.SAVE_MARKSHEET = (0, client_1.gql) `
1137
1137
  state
1138
1138
  endedAt
1139
1139
  marks {
1140
+ isAnswered
1140
1141
  id
1141
1142
  marksheetId
1142
1143
  questionChoiceId
@@ -1800,6 +1801,25 @@ exports.START_OR_JOIN_MARKSHEET = (0, client_1.gql) `
1800
1801
  }
1801
1802
  }
1802
1803
  `;
1804
+ const optimisticModifyMarksheetBuilderConfig = (marksheetId, builderConfig, client) => {
1805
+ const data = client?.readQuery({
1806
+ variables: { id: Number(marksheetId) },
1807
+ query: restricted_1.MARKSHEET,
1808
+ });
1809
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1810
+ const { marksheet } = data.restricted;
1811
+ const newBuilderConfig = { ...marksheet.builderConfig, ...builderConfig };
1812
+ return {
1813
+ restricted: {
1814
+ __typename: 'RestrictedMutation',
1815
+ modifyMarksheetInfo: {
1816
+ ...marksheet,
1817
+ builderConfig: newBuilderConfig,
1818
+ },
1819
+ },
1820
+ };
1821
+ };
1822
+ exports.optimisticModifyMarksheetBuilderConfig = optimisticModifyMarksheetBuilderConfig;
1803
1823
  exports.MODIFY_MARKSHEET_INFO = (0, client_1.gql) `
1804
1824
  mutation ModifyMarksheetInfo($input: ModifyMarksheetInfoInput) {
1805
1825
  restricted {
@@ -573,6 +573,10 @@ exports.MARKSHEETS = (0, client_1.gql) `
573
573
  solo
574
574
  completed
575
575
  updatedAt
576
+ users {
577
+ id
578
+ displayName
579
+ }
576
580
  }
577
581
  total
578
582
  score
@@ -117,6 +117,50 @@ export interface IModifyMarksheetInfo {
117
117
  input: IQbankInfoInput;
118
118
  }
119
119
  export declare type IModifyMarksheetData = RestrictedData<graphqlNormalize & IMarksheet, 'modifyMarksheetInfo'>;
120
+ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: number, builderConfig: IBuildConfigData, client?: ApolloClient<any> | undefined) => {
121
+ restricted: {
122
+ __typename: string;
123
+ modifyMarksheetInfo: {
124
+ builderConfig: {
125
+ numberOfQuestions?: number | undefined;
126
+ difficulty?: number[] | undefined;
127
+ unseen?: boolean | undefined;
128
+ seenIncorrect?: boolean | undefined;
129
+ seenCorrect?: boolean | undefined;
130
+ secondsPerQuestion?: number | undefined;
131
+ isTest?: boolean | undefined;
132
+ };
133
+ __typename?: string | undefined;
134
+ id: number;
135
+ createdAt: number | Date;
136
+ updatedAt: number | Date;
137
+ deletedAt: number | Date;
138
+ startedAt: number | Date;
139
+ type: import("../../../models").EMarksheetType;
140
+ endedAt: number | Date;
141
+ topicIds: number[];
142
+ topicNames?: string[] | undefined;
143
+ source: string;
144
+ userId: number;
145
+ user?: IUser | undefined;
146
+ marks: import("../../../models").IMarksheetMark[];
147
+ mockTestId: number | null;
148
+ correct?: number | undefined;
149
+ incorrect?: number | undefined;
150
+ totalQuestions?: number | undefined;
151
+ isTestMarksheet?: boolean | undefined;
152
+ solo: boolean;
153
+ agoraId: string;
154
+ users: IUser[];
155
+ state: EMarksheetState;
156
+ completed: boolean;
157
+ timeTaken: number;
158
+ currentMarkId?: number | undefined;
159
+ topicConceptData?: string | undefined;
160
+ preBuildData?: IPreBuildMarksheet | undefined;
161
+ };
162
+ };
163
+ };
120
164
  export declare const MODIFY_MARKSHEET_INFO: import("@apollo/client").DocumentNode;
121
165
  /**
122
166
  * leaveMarksheet
@@ -1134,6 +1134,7 @@ export const SAVE_MARKSHEET = gql `
1134
1134
  state
1135
1135
  endedAt
1136
1136
  marks {
1137
+ isAnswered
1137
1138
  id
1138
1139
  marksheetId
1139
1140
  questionChoiceId
@@ -1795,6 +1796,24 @@ export const START_OR_JOIN_MARKSHEET = gql `
1795
1796
  }
1796
1797
  }
1797
1798
  `;
1799
+ export const optimisticModifyMarksheetBuilderConfig = (marksheetId, builderConfig, client) => {
1800
+ const data = client?.readQuery({
1801
+ variables: { id: Number(marksheetId) },
1802
+ query: MARKSHEET,
1803
+ });
1804
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1805
+ const { marksheet } = data.restricted;
1806
+ const newBuilderConfig = { ...marksheet.builderConfig, ...builderConfig };
1807
+ return {
1808
+ restricted: {
1809
+ __typename: 'RestrictedMutation',
1810
+ modifyMarksheetInfo: {
1811
+ ...marksheet,
1812
+ builderConfig: newBuilderConfig,
1813
+ },
1814
+ },
1815
+ };
1816
+ };
1798
1817
  export const MODIFY_MARKSHEET_INFO = gql `
1799
1818
  mutation ModifyMarksheetInfo($input: ModifyMarksheetInfoInput) {
1800
1819
  restricted {
@@ -570,6 +570,10 @@ export const MARKSHEETS = gql `
570
570
  solo
571
571
  completed
572
572
  updatedAt
573
+ users {
574
+ id
575
+ displayName
576
+ }
573
577
  }
574
578
  total
575
579
  score
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.2.37",
3
+ "version": "2.2.40",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",