@quesmed/types-rn 2.6.88 → 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.
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.88",
3
+ "version": "2.6.89",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -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: {