@quesmed/types-rn 2.6.84 → 2.6.86

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-rn",
3
- "version": "2.6.84",
3
+ "version": "2.6.86",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -48,6 +48,7 @@ export interface IUpdateUserSettingsVar {
48
48
  input: Omit<DeepPartial<IUserSettings>, 'id' | 'userId' | 'updatedAt'>;
49
49
  }
50
50
  export type IUpdateUserSettingsData = RestrictedData<IUserSettings & graphqlNormalize, 'updateUserSettings'>;
51
+ export declare const optimisticUpdateUserSettings: (settings: Omit<IUserSettings, 'updatedAt'>) => ({ input }: IUpdateUserSettingsVar) => IUpdateUserSettingsData;
51
52
  export declare const updateCacheOnUpdateUserSettings: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpdateUserSettingsData>, options: ApolloUpdateOptions<IUpdateUserSettingsVar>) => void;
52
53
  export declare const RENEW_TOKEN: import("@apollo/client").DocumentNode;
53
54
  export type IRenewTokenVar = null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.updateCacheOnUpdateUserSettings = exports.UPDATE_USER_SETTINGS = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
3
+ exports.optimisticVideoLearningStatus = exports.updateCacheOnVideoLearningStatusUpdate = exports.UPSERT_USER_VIDEO_STATUS = exports.optimisticStationLearningStatus = exports.updateCacheOnStationLearningStatusUpdate = exports.UPSERT_USER_STATION_STATUS = exports.optimisticConceptLearningStatus = exports.updateCacheOnConceptLearningStatusUpdate = exports.UPSERT_USER_CONCEPT_STATUS = exports.TOC_ACCEPT = exports.RENEW_TOKEN = exports.updateCacheOnUpdateUserSettings = exports.optimisticUpdateUserSettings = exports.UPDATE_USER_SETTINGS = exports.UPDATE_USER = exports.DELETE_USER = exports.RESET_CATEGORY_PROGRESS = exports.RESET_PROGRESS = exports.LOGOUT_USER = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const models_1 = require("../../../models");
6
6
  const fragments_1 = require("../../fragments");
@@ -72,6 +72,24 @@ exports.UPDATE_USER_SETTINGS = (0, client_1.gql) `
72
72
  }
73
73
  }
74
74
  `;
75
+ const optimisticUpdateUserSettings = (settings) => ({ input }) => ({
76
+ restricted: {
77
+ updateUserSettings: {
78
+ __typename: 'UserSettings',
79
+ ...settings,
80
+ updatedAt: new Date(),
81
+ globalSettings: {
82
+ ...settings.globalSettings,
83
+ ...input.globalSettings,
84
+ },
85
+ productSettings: {
86
+ ...settings.productSettings,
87
+ ...input.productSettings,
88
+ },
89
+ },
90
+ },
91
+ });
92
+ exports.optimisticUpdateUserSettings = optimisticUpdateUserSettings;
75
93
  const updateCacheOnUpdateUserSettings = (cache, result, options) => {
76
94
  const { updateUserSettings } = result?.data?.restricted || {};
77
95
  const { variables } = options || {};
@@ -87,6 +105,7 @@ const updateCacheOnUpdateUserSettings = (cache, result, options) => {
87
105
  settings: updateUserSettings,
88
106
  },
89
107
  fragment: fragments_1.UPDATE_USER_SETTINGS_FRAGMENT,
108
+ fragmentName: 'UpdateUserSettingsFragment',
90
109
  });
91
110
  };
92
111
  exports.updateCacheOnUpdateUserSettings = updateCacheOnUpdateUserSettings;
@@ -0,0 +1,7 @@
1
+ import { graphqlNormalize, RestrictedData } from '../../types';
2
+ import { IChapter } from '../../../models';
3
+ export interface IChapterVar {
4
+ id: number;
5
+ }
6
+ export type IChapterData = RestrictedData<graphqlNormalize & IChapter, 'chapter'>;
7
+ export declare const CHAPTER: import("@apollo/client").DocumentNode;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAPTER = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.CHAPTER = (0, client_1.gql) `
6
+ query chapter($id: Int!) {
7
+ restricted {
8
+ chapter(id: $id) {
9
+ id
10
+ explanation
11
+ }
12
+ }
13
+ }
14
+ `;
@@ -1,4 +1,4 @@
1
- export * from './conceptExplanation';
1
+ export * from './chapter';
2
2
  export * from './concepts';
3
3
  export * from './global';
4
4
  export * from './marksheet';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./conceptExplanation"), exports);
17
+ __exportStar(require("./chapter"), exports);
18
18
  __exportStar(require("./concepts"), exports);
19
19
  __exportStar(require("./global"), exports);
20
20
  __exportStar(require("./marksheet"), exports);
@@ -1,12 +0,0 @@
1
- import { graphqlNormalize, RestrictedData } from '../../types';
2
- export interface IQuesBookDict {
3
- topicId: number;
4
- conceptId: number;
5
- chapterId: number;
6
- explanation: string;
7
- }
8
- export interface IConceptExplanationVar {
9
- chapterId: number;
10
- }
11
- export type IConceptExplanationData = RestrictedData<graphqlNormalize & string, 'conceptExplanation'>;
12
- export declare const CONCEPT_EXPLANATION: import("@apollo/client").DocumentNode;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONCEPT_EXPLANATION = void 0;
4
- const client_1 = require("@apollo/client");
5
- exports.CONCEPT_EXPLANATION = (0, client_1.gql) `
6
- query conceptExplanation($chapterId: Int!) {
7
- restricted {
8
- conceptExplanation(chapterId: $chapterId)
9
- }
10
- }
11
- `;