@quesmed/types-rn 2.6.61 → 2.6.63

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.
@@ -63,7 +63,12 @@ export declare enum EEntitlementType {
63
63
  ANATOMY = 36,
64
64
  PRE_CLINICAL = 37,
65
65
  MRCP_PART_1 = 38,
66
- MRCP_PART_2 = 39
66
+ MRCP_PART_2 = 39,
67
+ INTERVIEW_ANAESTHETICS = 40,
68
+ INTERVIEW_CST = 41,
69
+ INTERVIEW_IMT = 42,
70
+ INTERVIEW_RADIOLOGY = 43,
71
+ PLAB_1 = 44
67
72
  }
68
73
  export interface IProduct {
69
74
  id: Id;
package/models/Product.js CHANGED
@@ -68,6 +68,11 @@ var EEntitlementType;
68
68
  EEntitlementType[EEntitlementType["PRE_CLINICAL"] = 37] = "PRE_CLINICAL";
69
69
  EEntitlementType[EEntitlementType["MRCP_PART_1"] = 38] = "MRCP_PART_1";
70
70
  EEntitlementType[EEntitlementType["MRCP_PART_2"] = 39] = "MRCP_PART_2";
71
+ EEntitlementType[EEntitlementType["INTERVIEW_ANAESTHETICS"] = 40] = "INTERVIEW_ANAESTHETICS";
72
+ EEntitlementType[EEntitlementType["INTERVIEW_CST"] = 41] = "INTERVIEW_CST";
73
+ EEntitlementType[EEntitlementType["INTERVIEW_IMT"] = 42] = "INTERVIEW_IMT";
74
+ EEntitlementType[EEntitlementType["INTERVIEW_RADIOLOGY"] = 43] = "INTERVIEW_RADIOLOGY";
75
+ EEntitlementType[EEntitlementType["PLAB_1"] = 44] = "PLAB_1";
71
76
  })(EEntitlementType = exports.EEntitlementType || (exports.EEntitlementType = {}));
72
77
  var EAppType;
73
78
  (function (EAppType) {
@@ -1,6 +1,16 @@
1
1
  import { IProduct } from './Product';
2
2
  import { Id } from './Type';
3
3
  import { IClassYear, IUser } from './User';
4
+ export declare enum ECancelReasons {
5
+ CUSTOMER_SERVICE = "customer_service",
6
+ LOW_QUALITY = "low_quality",
7
+ MISSING_FEATURES = "missing_features",
8
+ OTHER = "other",
9
+ SWITCHED_SERVICE = "switched_service",
10
+ TOO_COMPLEX = "too_complex",
11
+ TOO_EXPENSIVE = "too_expensive",
12
+ UNUSED = "unused"
13
+ }
4
14
  export interface ISubscription {
5
15
  id: Id;
6
16
  createdAt: number | Date;
@@ -15,4 +25,6 @@ export interface ISubscription {
15
25
  product?: IProduct;
16
26
  classYear: IClassYear;
17
27
  invoiced: number;
28
+ feedback: ECancelReasons | null;
29
+ comment: string;
18
30
  }
@@ -1,2 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ECancelReasons = void 0;
4
+ // These options are only available for feedback in stripe, we cannot modify them
5
+ var ECancelReasons;
6
+ (function (ECancelReasons) {
7
+ ECancelReasons["CUSTOMER_SERVICE"] = "customer_service";
8
+ ECancelReasons["LOW_QUALITY"] = "low_quality";
9
+ ECancelReasons["MISSING_FEATURES"] = "missing_features";
10
+ ECancelReasons["OTHER"] = "other";
11
+ ECancelReasons["SWITCHED_SERVICE"] = "switched_service";
12
+ ECancelReasons["TOO_COMPLEX"] = "too_complex";
13
+ ECancelReasons["TOO_EXPENSIVE"] = "too_expensive";
14
+ ECancelReasons["UNUSED"] = "unused";
15
+ })(ECancelReasons = exports.ECancelReasons || (exports.ECancelReasons = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types-rn",
3
- "version": "2.6.61",
3
+ "version": "2.6.63",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -10,22 +10,11 @@ export interface IUpsertChapterNoteVar {
10
10
  chapterId: number;
11
11
  note: string;
12
12
  }
13
- export type IUpsertChapterNoteData = RestrictedData<IUserChapterNote, 'upsertChapterNote'>;
13
+ export type IUpsertChapterNoteData = RestrictedData<graphqlNormalize & Omit<IUserChapterNote, 'chapter'>, 'upsertChapterNote'>;
14
14
  export declare const updateCacheOnUpsertChapterNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertChapterNoteData>, options: ApolloUpdateOptions<IUpsertChapterNoteVar>) => void;
15
15
  export declare const optimisticUpsertChapterNote: (data: IUpsertChapterNoteVar & {
16
16
  userId: number;
17
- }) => {
18
- restricted: {
19
- upsertChapterNote: {
20
- createdAt: Date;
21
- updatedAt: Date;
22
- chapterId: number;
23
- note: string;
24
- userId: number;
25
- __typename: string;
26
- };
27
- };
28
- };
17
+ }) => IUpsertChapterNoteData;
29
18
  /**
30
19
  * addChapterHighlight
31
20
  */
@@ -39,16 +39,18 @@ const updateCacheOnUpsertChapterNote = (cache, result, options) => {
39
39
  };
40
40
  exports.updateCacheOnUpsertChapterNote = updateCacheOnUpsertChapterNote;
41
41
  const optimisticUpsertChapterNote = (data) => {
42
- return {
42
+ const payload = {
43
43
  restricted: {
44
44
  upsertChapterNote: {
45
45
  __typename: 'UserChapterNote',
46
46
  ...data,
47
+ id: Date.now(),
47
48
  createdAt: new Date(),
48
49
  updatedAt: new Date(),
49
50
  },
50
51
  },
51
52
  };
53
+ return payload;
52
54
  };
53
55
  exports.optimisticUpsertChapterNote = optimisticUpsertChapterNote;
54
56
  exports.ADD_CHAPTER_HIGHLIGHT = (0, client_1.gql) `
@@ -149,19 +149,8 @@ export interface IUpsertStationNoteVar {
149
149
  stationId: number;
150
150
  note: string;
151
151
  }
152
- export type IUpsertStationNoteData = RestrictedData<IUserStationNote, 'upsertStationNote'>;
152
+ export type IUpsertStationNoteData = RestrictedData<graphqlNormalize & Omit<IUserStationNote, 'station'>, 'upsertStationNote'>;
153
153
  export declare const updateCacheOnUpsertStationNote: (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IUpsertStationNoteData>, options: ApolloUpdateOptions<IUpsertStationNoteVar>) => void;
154
154
  export declare const optimisticUpsertStationNote: (data: IUpsertStationNoteVar & {
155
155
  userId: number;
156
- }) => {
157
- restricted: {
158
- upsertStationNote: {
159
- createdAt: Date;
160
- updatedAt: Date;
161
- stationId: number;
162
- note: string;
163
- userId: number;
164
- __typename: string;
165
- };
166
- };
167
- };
156
+ }) => IUpsertStationNoteData;
@@ -52,7 +52,11 @@ exports.CREATE_OR_JOIN_OSCE_MARKSHEET = (0, client_1.gql) `
52
52
  exports.BUILD_OSCE_MARKSHEET = (0, client_1.gql) `
53
53
  ${fragments_1.OSCE_STATION_FIELDS}
54
54
  ${fragments_1.OSCE_MARKSHEET_FIELDS}
55
- mutation BuildOsceMarksheet($osceStationId: Int!, $osceMarksheetId: Int, $entitlementId: Int) {
55
+ mutation BuildOsceMarksheet(
56
+ $osceStationId: Int!
57
+ $osceMarksheetId: Int
58
+ $entitlementId: Int
59
+ ) {
56
60
  restricted {
57
61
  buildOsceMarksheet(
58
62
  osceStationId: $osceStationId
@@ -332,15 +336,17 @@ const updateCacheOnUpsertStationNote = (cache, result, options) => {
332
336
  };
333
337
  exports.updateCacheOnUpsertStationNote = updateCacheOnUpsertStationNote;
334
338
  const optimisticUpsertStationNote = (data) => {
335
- return {
339
+ const payload = {
336
340
  restricted: {
337
341
  upsertStationNote: {
338
342
  __typename: 'UserStationNote',
339
343
  ...data,
344
+ id: Date.now(),
340
345
  createdAt: new Date(),
341
346
  updatedAt: new Date(),
342
347
  },
343
348
  },
344
349
  };
350
+ return payload;
345
351
  };
346
352
  exports.optimisticUpsertStationNote = optimisticUpsertStationNote;
@@ -4,6 +4,8 @@ import { ApolloUpdateOptions, ApolloUpdateResultRestricted } from '../../apollo'
4
4
  import { RestrictedData, graphqlNormalize } from '../../types';
5
5
  export interface ICancelSubscriptionVar {
6
6
  subscriptionId: number;
7
+ comment?: ISubscription['comment'];
8
+ feedback?: ISubscription['feedback'];
7
9
  }
8
10
  export type ICancelSubscriptionData = RestrictedData<graphqlNormalize & ISubscription, 'cancelSubscription'>;
9
11
  export declare const CANCEL_SUBSCRIPTION: import("@apollo/client").DocumentNode;
@@ -4,9 +4,17 @@ exports.updateSubscriptionOnCancelOrRenew = exports.CANCEL_SUBSCRIPTION = void 0
4
4
  const client_1 = require("@apollo/client");
5
5
  const restricted_1 = require("../../query/restricted");
6
6
  exports.CANCEL_SUBSCRIPTION = (0, client_1.gql) `
7
- mutation CancelSubscription($subscriptionId: Int!) {
7
+ mutation CancelSubscription(
8
+ $subscriptionId: Int!
9
+ $comment: String
10
+ $feedback: String
11
+ ) {
8
12
  restricted {
9
- cancelSubscription(subscriptionId: $subscriptionId) {
13
+ cancelSubscription(
14
+ subscriptionId: $subscriptionId
15
+ comment: $comment
16
+ feedback: $feedback
17
+ ) {
10
18
  id
11
19
  endedAt
12
20
  periodEndAt
package/utils/random.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export declare function getRandom<T>(arr: T[], n?: number): T[];
2
+ export declare function randomInt(min?: number, max?: number): number;
package/utils/random.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRandom = void 0;
3
+ exports.randomInt = exports.getRandom = void 0;
4
4
  function getRandom(arr, n) {
5
5
  if (n === undefined || n === null) {
6
6
  n = arr.length;
@@ -18,3 +18,7 @@ function getRandom(arr, n) {
18
18
  return result;
19
19
  }
20
20
  exports.getRandom = getRandom;
21
+ function randomInt(min = 1, max = 100) {
22
+ return Math.floor(Math.random() * (max - min + 1)) + min;
23
+ }
24
+ exports.randomInt = randomInt;