@quesmed/types-rn 2.6.52 → 2.6.53

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.
@@ -91,7 +91,7 @@ export interface IMarksheet {
91
91
  topicConceptData?: string;
92
92
  preBuildData?: IPreBuildMarksheet;
93
93
  builderConfig?: IBuildConfigData;
94
- productId: EProductType;
94
+ entitlementId: EProductType;
95
95
  }
96
96
  export type IMarksheetMarkJSONB = string | [string] | [IQuestionQAAnswer] | [string[], string[]] | [IPrescribeMark] | null;
97
97
  export interface IMarksheetMark {
@@ -85,7 +85,7 @@ export interface IOsceMarksheet {
85
85
  members: IOsceMarksheetMember[];
86
86
  state: EOsceMarksheetState;
87
87
  completed: boolean;
88
- productId: EProductType;
88
+ entitlementId: EProductType;
89
89
  isTimed: boolean;
90
90
  }
91
91
  export interface IDashboardOsce {
@@ -78,9 +78,9 @@ export interface IOsceStationTopic {
78
78
  concept?: IConcept;
79
79
  osceStation?: IOsceStation;
80
80
  }
81
- export interface IOsceStationProduct {
81
+ export interface IOsceStationEntitlement {
82
82
  id: Id;
83
- productId: Id;
83
+ entitlementId: Id;
84
84
  stationId: Id;
85
85
  }
86
86
  export declare const OSCE_GLOBAL_RATING: {
@@ -49,7 +49,7 @@ export interface IProduct {
49
49
  typeId: EProductType;
50
50
  subscription: boolean;
51
51
  }
52
- export interface IProductType {
52
+ export interface IEntitlementType {
53
53
  id: Id;
54
54
  name: string;
55
55
  }
@@ -153,9 +153,9 @@ export interface IPSAQuestionType {
153
153
  id: Id;
154
154
  name: string;
155
155
  }
156
- export interface IProductsQuestion {
156
+ export interface IQuestionEntitlement {
157
157
  id: Id;
158
- productId: Id;
158
+ entitlementId: Id;
159
159
  questionId: Id;
160
160
  }
161
161
  export declare function isQuestionSBA(data: IQuestionAll): data is IQuestionSBA;
package/models/Topic.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IConcept } from './Concept';
2
- import { EProductType, IEntitlement } from './Product';
2
+ import { IEntitlement } from './Product';
3
3
  import { Id } from './Type';
4
4
  export declare enum ETopicType {
5
5
  ALL = 0,
@@ -38,7 +38,6 @@ export interface ITopic {
38
38
  demo?: boolean;
39
39
  entitlement: IEntitlement;
40
40
  typeId: ETopicType | null;
41
- productId: EProductType | null;
42
41
  type?: ITopicType | null;
43
42
  concepts?: IConcept[];
44
43
  totalQuestions?: number | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.52",
3
+ "version": "2.6.53",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -1 +1,2 @@
1
1
  export declare const CHAPTER_FIELDS: import("@apollo/client").DocumentNode;
2
+ export declare const UPSERT_CHAPTER_NOTE_FRAGMENT: import("@apollo/client").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHAPTER_FIELDS = void 0;
3
+ exports.UPSERT_CHAPTER_NOTE_FRAGMENT = exports.CHAPTER_FIELDS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const picture_1 = require("./picture");
6
6
  exports.CHAPTER_FIELDS = (0, client_1.gql) `
@@ -28,3 +28,14 @@ exports.CHAPTER_FIELDS = (0, client_1.gql) `
28
28
  }
29
29
  }
30
30
  `;
31
+ exports.UPSERT_CHAPTER_NOTE_FRAGMENT = (0, client_1.gql) `
32
+ fragment UpsertChapterNoteFragment on Chapter {
33
+ userNote {
34
+ userId
35
+ chapterId
36
+ note
37
+ createdAt
38
+ updatedAt
39
+ }
40
+ }
41
+ `;
@@ -1,4 +1,6 @@
1
+ import { ApolloCache } from '@apollo/client';
1
2
  import { IUserChapterNote } from '../../../models';
3
+ import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
2
4
  import { RestrictedData } from '../../types';
3
5
  export declare const UPSERT_CHAPTER_NOTE: import("@apollo/client").DocumentNode;
4
6
  export interface IUpsertChapterNoteVar {
@@ -6,3 +8,18 @@ export interface IUpsertChapterNoteVar {
6
8
  note: string;
7
9
  }
8
10
  export type IUpsertChapterNoteData = RestrictedData<IUserChapterNote, 'upsertChapterNote'>;
11
+ export declare const updateCacheOnUpsertChapterNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertChapterNoteData>, options: ApolloUpdateOptions<IUpsertChapterNoteVar>) => void;
12
+ export declare const optimisticUpsertChapterNote: (data: IUpsertChapterNoteVar & {
13
+ userId: number;
14
+ }) => {
15
+ restricted: {
16
+ upsertChapterNote: {
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ chapterId: number;
20
+ note: string;
21
+ userId: number;
22
+ __typename: string;
23
+ };
24
+ };
25
+ };
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UPSERT_CHAPTER_NOTE = void 0;
3
+ exports.optimisticUpsertChapterNote = exports.updateCacheOnUpsertChapterNote = exports.UPSERT_CHAPTER_NOTE = void 0;
4
4
  const client_1 = require("@apollo/client");
5
+ const fragments_1 = require("../../fragments");
5
6
  exports.UPSERT_CHAPTER_NOTE = (0, client_1.gql) `
6
7
  mutation UpsertChapterNote($chapterId: Int!, $note: String!) {
7
8
  restricted {
@@ -16,3 +17,32 @@ exports.UPSERT_CHAPTER_NOTE = (0, client_1.gql) `
16
17
  }
17
18
  }
18
19
  `;
20
+ const updateCacheOnUpsertChapterNote = (cache, result, options) => {
21
+ const { upsertChapterNote } = result?.data?.restricted || {};
22
+ const { variables } = options || {};
23
+ if (!variables || !upsertChapterNote) {
24
+ return;
25
+ }
26
+ const { id, ...updatedData } = upsertChapterNote;
27
+ cache.writeFragment({
28
+ id: cache.identify({ id, __typename: 'UserChapterNote' }),
29
+ data: {
30
+ ...updatedData,
31
+ },
32
+ fragment: fragments_1.UPSERT_CHAPTER_NOTE_FRAGMENT,
33
+ });
34
+ };
35
+ exports.updateCacheOnUpsertChapterNote = updateCacheOnUpsertChapterNote;
36
+ const optimisticUpsertChapterNote = (data) => {
37
+ return {
38
+ restricted: {
39
+ upsertChapterNote: {
40
+ __typename: 'UserChapterNote',
41
+ ...data,
42
+ createdAt: new Date(),
43
+ updatedAt: new Date(),
44
+ },
45
+ },
46
+ };
47
+ };
48
+ exports.optimisticUpsertChapterNote = optimisticUpsertChapterNote;
@@ -188,7 +188,7 @@ export declare const optimisticModifyMarksheetBuilderConfig: (marksheetId: numbe
188
188
  currentMarkId?: number | undefined;
189
189
  topicConceptData?: string | undefined;
190
190
  preBuildData?: IPreBuildMarksheet | undefined;
191
- productId: import("../../../models").EProductType;
191
+ entitlementId: import("../../../models").EProductType;
192
192
  };
193
193
  };
194
194
  };
@@ -281,7 +281,7 @@ export declare const optimisticEndMarksheet: (marksheet: IMarksheet) => {
281
281
  topicConceptData?: string | undefined;
282
282
  preBuildData?: IPreBuildMarksheet | undefined;
283
283
  builderConfig?: IBuildConfigData | undefined;
284
- productId: import("../../../models").EProductType;
284
+ entitlementId: import("../../../models").EProductType;
285
285
  __typename: string;
286
286
  };
287
287
  };
@@ -78,7 +78,7 @@ export declare const optimisticEndMockTest: (marksheet: IMarksheet) => {
78
78
  topicConceptData?: string | undefined;
79
79
  preBuildData?: import("./marksheet").IPreBuildMarksheet | undefined;
80
80
  builderConfig?: import("./marksheet").IBuildConfigData | undefined;
81
- productId: import("../../../models").EProductType;
81
+ entitlementId: import("../../../models").EProductType;
82
82
  __typename: string;
83
83
  };
84
84
  };
@@ -129,7 +129,7 @@ export declare const optimisticEndOsceMarksheet: (marksheet: IOsceMarksheet) =>
129
129
  activeUsers?: import("../../../models").IUser[] | undefined;
130
130
  members: import("../../../models").IOsceMarksheetMember[];
131
131
  state: EOsceMarksheetState;
132
- productId: EProductType;
132
+ entitlementId: EProductType;
133
133
  isTimed: boolean;
134
134
  __typename: string;
135
135
  };