@quesmed/types 2.6.85 → 2.6.87
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/dist/cjs/models/MockTest.d.ts +2 -0
- package/dist/cjs/resolvers/fragments/mockTest.js +1 -0
- package/dist/cjs/resolvers/mutation/restricted/users.d.ts +1 -0
- package/dist/cjs/resolvers/mutation/restricted/users.js +20 -1
- package/dist/mjs/models/MockTest.d.ts +2 -0
- package/dist/mjs/resolvers/fragments/mockTest.js +1 -0
- package/dist/mjs/resolvers/mutation/restricted/users.d.ts +1 -0
- package/dist/mjs/resolvers/mutation/restricted/users.js +18 -0
- package/package.json +1 -1
|
@@ -20,6 +20,7 @@ export interface IMockTest {
|
|
|
20
20
|
demo: boolean;
|
|
21
21
|
createdAt: number | Date;
|
|
22
22
|
title: string;
|
|
23
|
+
intro: string;
|
|
23
24
|
topicIds: number[];
|
|
24
25
|
typeId: EMockTestType | null;
|
|
25
26
|
passingMark: number;
|
|
@@ -30,6 +31,7 @@ export interface IMockTest {
|
|
|
30
31
|
export interface IUserMockTest {
|
|
31
32
|
id: Id;
|
|
32
33
|
title: string;
|
|
34
|
+
intro: string;
|
|
33
35
|
passingMark: number;
|
|
34
36
|
typeId: EMockTestType | null;
|
|
35
37
|
correct: number;
|
|
@@ -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;
|
|
@@ -20,6 +20,7 @@ export interface IMockTest {
|
|
|
20
20
|
demo: boolean;
|
|
21
21
|
createdAt: number | Date;
|
|
22
22
|
title: string;
|
|
23
|
+
intro: string;
|
|
23
24
|
topicIds: number[];
|
|
24
25
|
typeId: EMockTestType | null;
|
|
25
26
|
passingMark: number;
|
|
@@ -30,6 +31,7 @@ export interface IMockTest {
|
|
|
30
31
|
export interface IUserMockTest {
|
|
31
32
|
id: Id;
|
|
32
33
|
title: string;
|
|
34
|
+
intro: string;
|
|
33
35
|
passingMark: number;
|
|
34
36
|
typeId: EMockTestType | null;
|
|
35
37
|
correct: number;
|
|
@@ -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;
|
|
@@ -69,6 +69,23 @@ export const UPDATE_USER_SETTINGS = gql `
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
`;
|
|
72
|
+
export const optimisticUpdateUserSettings = (settings) => ({ input }) => ({
|
|
73
|
+
restricted: {
|
|
74
|
+
updateUserSettings: {
|
|
75
|
+
__typename: 'UserSettings',
|
|
76
|
+
...settings,
|
|
77
|
+
updatedAt: new Date(),
|
|
78
|
+
globalSettings: {
|
|
79
|
+
...settings.globalSettings,
|
|
80
|
+
...input.globalSettings,
|
|
81
|
+
},
|
|
82
|
+
productSettings: {
|
|
83
|
+
...settings.productSettings,
|
|
84
|
+
...input.productSettings,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
});
|
|
72
89
|
export const updateCacheOnUpdateUserSettings = (cache, result, options) => {
|
|
73
90
|
const { updateUserSettings } = result?.data?.restricted || {};
|
|
74
91
|
const { variables } = options || {};
|
|
@@ -84,6 +101,7 @@ export const updateCacheOnUpdateUserSettings = (cache, result, options) => {
|
|
|
84
101
|
settings: updateUserSettings,
|
|
85
102
|
},
|
|
86
103
|
fragment: UPDATE_USER_SETTINGS_FRAGMENT,
|
|
104
|
+
fragmentName: 'UpdateUserSettingsFragment',
|
|
87
105
|
});
|
|
88
106
|
};
|
|
89
107
|
export const RENEW_TOKEN = gql `
|