@quesmed/types-rn 2.6.87 → 2.6.89

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.
@@ -73,8 +73,8 @@ export interface IQuestion {
73
73
  conceptId: Id;
74
74
  public: boolean;
75
75
  concept?: IConcept;
76
- condition?: ICondition[];
77
- presentation?: IPresentation[];
76
+ conditions?: ICondition[];
77
+ presentations?: IPresentation[];
78
78
  question: string;
79
79
  explanation?: string;
80
80
  learningPoint?: string;
package/models/User.d.ts CHANGED
@@ -113,10 +113,16 @@ export interface IUserSettings {
113
113
  productSettings: {
114
114
  examDate: number | Date | null;
115
115
  nextFeedbackDate: number | Date;
116
- feedback: string | null;
117
- rating: number | null;
118
116
  };
119
117
  }
118
+ export interface IProductFeedback {
119
+ id: Id;
120
+ userId: Id;
121
+ productId: EProductType;
122
+ rating: number;
123
+ feedback: string;
124
+ createdAt: number | Date;
125
+ }
120
126
  export interface IUser {
121
127
  id: Id;
122
128
  createdAt: number | Date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.87",
3
+ "version": "2.6.89",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -1,4 +1,5 @@
1
1
  export declare const QUESTION_COMMENT_FIELDS: import("@apollo/client").DocumentNode;
2
+ export declare const QUESTION_UKMLA_FIELDS: import("@apollo/client").DocumentNode;
2
3
  export declare const QUESTION_CATEGORY_FIELDS: import("@apollo/client").DocumentNode;
3
4
  export declare const QUESTION_FIELDS: import("@apollo/client").DocumentNode;
4
5
  export declare const QUESTION_WITH_HIGHLIGHT_FIELDS: import("@apollo/client").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QUESTION_WITH_LEARNING_FIELDS = exports.QUESTION_WITH_COMMENT_FIELDS = exports.QUESTION_WITH_HIGHLIGHT_FIELDS = exports.QUESTION_FIELDS = exports.QUESTION_CATEGORY_FIELDS = exports.QUESTION_COMMENT_FIELDS = void 0;
3
+ exports.QUESTION_WITH_LEARNING_FIELDS = exports.QUESTION_WITH_COMMENT_FIELDS = exports.QUESTION_WITH_HIGHLIGHT_FIELDS = exports.QUESTION_FIELDS = exports.QUESTION_CATEGORY_FIELDS = exports.QUESTION_UKMLA_FIELDS = exports.QUESTION_COMMENT_FIELDS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const concept_1 = require("./concept");
6
6
  const highlight_1 = require("./highlight");
@@ -37,6 +37,28 @@ exports.QUESTION_COMMENT_FIELDS = (0, client_1.gql) `
37
37
  }
38
38
  }
39
39
  `;
40
+ exports.QUESTION_UKMLA_FIELDS = (0, client_1.gql) `
41
+ fragment QuestionUkmlaFields on Question {
42
+ presentations {
43
+ id
44
+ name
45
+ topicId
46
+ topic {
47
+ id
48
+ name
49
+ }
50
+ }
51
+ conditions {
52
+ id
53
+ name
54
+ topicId
55
+ topic {
56
+ id
57
+ name
58
+ }
59
+ }
60
+ }
61
+ `;
40
62
  exports.QUESTION_CATEGORY_FIELDS = (0, client_1.gql) `
41
63
  fragment QuestionCategoryFields on Question {
42
64
  ... on QuestionSBA {
@@ -99,6 +121,7 @@ exports.QUESTION_CATEGORY_FIELDS = (0, client_1.gql) `
99
121
  }
100
122
  `;
101
123
  exports.QUESTION_FIELDS = (0, client_1.gql) `
124
+ ${exports.QUESTION_UKMLA_FIELDS}
102
125
  ${highlight_1.HIGHLIGHT_FIELDS}
103
126
  ${exports.QUESTION_CATEGORY_FIELDS}
104
127
  ${exports.QUESTION_COMMENT_FIELDS}
@@ -143,6 +166,7 @@ exports.QUESTION_FIELDS = (0, client_1.gql) `
143
166
  pictures {
144
167
  ...PictureFields
145
168
  }
169
+ ...QuestionUkmlaFields
146
170
  ...QuestionCategoryFields
147
171
  }
148
172
  `;
@@ -69,8 +69,6 @@ exports.USER_SETTINGS_FIELDS = (0, client_1.gql) `
69
69
  addToDailyFlashcards
70
70
  }
71
71
  productSettings {
72
- feedback
73
- rating
74
72
  examDate
75
73
  nextFeedbackDate
76
74
  }
@@ -1,5 +1,5 @@
1
1
  import { ApolloCache } from '@apollo/client';
2
- import { EUserLearningStatus, IUser, IUserConceptStatus, IUserSettings, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
2
+ import { EUserLearningStatus, IProductFeedback, IUser, IUserConceptStatus, IUserSettings, IUserStationStatus, IUserVideoStatus, Id } from '../../../models';
3
3
  import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo';
4
4
  import { DeepPartial, RestrictedData, graphqlNormalize } from '../../types';
5
5
  export declare const LOGOUT_USER: import("@apollo/client").DocumentNode;
@@ -44,6 +44,13 @@ export type IUpdateUserData = RestrictedData<{
44
44
  user: IUser & graphqlNormalize;
45
45
  }, 'updateUser'>;
46
46
  export declare const UPDATE_USER_SETTINGS: import("@apollo/client").DocumentNode;
47
+ export interface IAddProductFeedbackVar {
48
+ rating: number;
49
+ feedback: string;
50
+ }
51
+ export type IAddProductFeedbackData = RestrictedData<IProductFeedback & graphqlNormalize, 'addProductFeedback'>;
52
+ export declare const ADD_PRODUCT_FEEDBACK: import("@apollo/client").DocumentNode;
53
+ export declare const optimisticAddProductFeedback: (input: IAddProductFeedbackVar) => IAddProductFeedbackData;
47
54
  export interface IUpdateUserSettingsVar {
48
55
  input: Omit<DeepPartial<IUserSettings>, 'id' | 'userId' | 'updatedAt'>;
49
56
  }
@@ -1,8 +1,9 @@
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.optimisticUpdateUserSettings = 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.optimisticAddProductFeedback = exports.ADD_PRODUCT_FEEDBACK = 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
+ const utils_1 = require("../../../utils");
6
7
  const fragments_1 = require("../../fragments");
7
8
  exports.LOGOUT_USER = (0, client_1.gql) `
8
9
  mutation LogoutUser($all: Boolean!) {
@@ -72,6 +73,32 @@ exports.UPDATE_USER_SETTINGS = (0, client_1.gql) `
72
73
  }
73
74
  }
74
75
  `;
76
+ exports.ADD_PRODUCT_FEEDBACK = (0, client_1.gql) `
77
+ mutation AddProductFeedback($rating: Int!, $feedback: String!) {
78
+ restricted {
79
+ addProductFeedback(rating: $rating, feedback: $feedback) {
80
+ id
81
+ userId
82
+ createdAt
83
+ rating
84
+ feedback
85
+ productId
86
+ }
87
+ }
88
+ }
89
+ `;
90
+ const optimisticAddProductFeedback = (input) => ({
91
+ restricted: {
92
+ addProductFeedback: {
93
+ ...input,
94
+ createdAt: new Date(),
95
+ userId: 1,
96
+ productId: 1,
97
+ id: (0, utils_1.randomInt)(),
98
+ },
99
+ },
100
+ });
101
+ exports.optimisticAddProductFeedback = optimisticAddProductFeedback;
75
102
  const optimisticUpdateUserSettings = (settings) => ({ input }) => ({
76
103
  restricted: {
77
104
  updateUserSettings: {