@quesmed/types 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;
@@ -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;
@@ -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: {
@@ -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;
@@ -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;
@@ -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;
@@ -34,6 +34,28 @@ export const QUESTION_COMMENT_FIELDS = gql `
34
34
  }
35
35
  }
36
36
  `;
37
+ export const QUESTION_UKMLA_FIELDS = gql `
38
+ fragment QuestionUkmlaFields on Question {
39
+ presentations {
40
+ id
41
+ name
42
+ topicId
43
+ topic {
44
+ id
45
+ name
46
+ }
47
+ }
48
+ conditions {
49
+ id
50
+ name
51
+ topicId
52
+ topic {
53
+ id
54
+ name
55
+ }
56
+ }
57
+ }
58
+ `;
37
59
  export const QUESTION_CATEGORY_FIELDS = gql `
38
60
  fragment QuestionCategoryFields on Question {
39
61
  ... on QuestionSBA {
@@ -96,6 +118,7 @@ export const QUESTION_CATEGORY_FIELDS = gql `
96
118
  }
97
119
  `;
98
120
  export const QUESTION_FIELDS = gql `
121
+ ${QUESTION_UKMLA_FIELDS}
99
122
  ${HIGHLIGHT_FIELDS}
100
123
  ${QUESTION_CATEGORY_FIELDS}
101
124
  ${QUESTION_COMMENT_FIELDS}
@@ -140,6 +163,7 @@ export const QUESTION_FIELDS = gql `
140
163
  pictures {
141
164
  ...PictureFields
142
165
  }
166
+ ...QuestionUkmlaFields
143
167
  ...QuestionCategoryFields
144
168
  }
145
169
  `;
@@ -66,8 +66,6 @@ export const USER_SETTINGS_FIELDS = gql `
66
66
  addToDailyFlashcards
67
67
  }
68
68
  productSettings {
69
- feedback
70
- rating
71
69
  examDate
72
70
  nextFeedbackDate
73
71
  }
@@ -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,5 +1,6 @@
1
1
  import { gql } from '@apollo/client';
2
2
  import { EUserLearningStatus, } from '../../../models';
3
+ import { randomInt } from '../../../utils';
3
4
  import { UPDATE_USER_SETTINGS_FRAGMENT, USER_SETTINGS_FIELDS, } from '../../fragments';
4
5
  export const LOGOUT_USER = gql `
5
6
  mutation LogoutUser($all: Boolean!) {
@@ -69,6 +70,31 @@ export const UPDATE_USER_SETTINGS = gql `
69
70
  }
70
71
  }
71
72
  `;
73
+ export const ADD_PRODUCT_FEEDBACK = gql `
74
+ mutation AddProductFeedback($rating: Int!, $feedback: String!) {
75
+ restricted {
76
+ addProductFeedback(rating: $rating, feedback: $feedback) {
77
+ id
78
+ userId
79
+ createdAt
80
+ rating
81
+ feedback
82
+ productId
83
+ }
84
+ }
85
+ }
86
+ `;
87
+ export const optimisticAddProductFeedback = (input) => ({
88
+ restricted: {
89
+ addProductFeedback: {
90
+ ...input,
91
+ createdAt: new Date(),
92
+ userId: 1,
93
+ productId: 1,
94
+ id: randomInt(),
95
+ },
96
+ },
97
+ });
72
98
  export const optimisticUpdateUserSettings = (settings) => ({ input }) => ({
73
99
  restricted: {
74
100
  updateUserSettings: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.87",
3
+ "version": "2.6.89",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",