@quesmed/types 2.5.88 → 2.5.90

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.
@@ -1,6 +1,10 @@
1
1
  import { ETopicType, ITopic } from './Topic';
2
2
  import { Id } from './Type';
3
3
  import { IUniversity } from './University';
4
+ export declare enum EPresetType {
5
+ PRE_DEFINED = 0,
6
+ CUSTOM = 1
7
+ }
4
8
  export interface IPreset {
5
9
  id: Id;
6
10
  createdAt: number | Date;
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPresetType = void 0;
4
+ var EPresetType;
5
+ (function (EPresetType) {
6
+ EPresetType[EPresetType["PRE_DEFINED"] = 0] = "PRE_DEFINED";
7
+ EPresetType[EPresetType["CUSTOM"] = 1] = "CUSTOM";
8
+ })(EPresetType = exports.EPresetType || (exports.EPresetType = {}));
@@ -2,11 +2,12 @@ export * from './agora';
2
2
  export * from './contactUs';
3
3
  export * from './marksheet';
4
4
  export * from './mockTest';
5
+ export * from './notification';
5
6
  export * from './osce';
6
7
  export * from './preset';
7
8
  export * from './questionDiscussion';
9
+ export * from './stripe';
8
10
  export * from './todo';
9
11
  export * from './token';
10
12
  export * from './users';
11
13
  export * from './video';
12
- export * from './notification';
@@ -18,11 +18,12 @@ __exportStar(require("./agora"), exports);
18
18
  __exportStar(require("./contactUs"), exports);
19
19
  __exportStar(require("./marksheet"), exports);
20
20
  __exportStar(require("./mockTest"), exports);
21
+ __exportStar(require("./notification"), exports);
21
22
  __exportStar(require("./osce"), exports);
22
23
  __exportStar(require("./preset"), exports);
23
24
  __exportStar(require("./questionDiscussion"), exports);
25
+ __exportStar(require("./stripe"), exports);
24
26
  __exportStar(require("./todo"), exports);
25
27
  __exportStar(require("./token"), exports);
26
28
  __exportStar(require("./users"), exports);
27
29
  __exportStar(require("./video"), exports);
28
- __exportStar(require("./notification"), exports);
@@ -8,13 +8,13 @@ export type IDeletePresetData = RestrictedData<boolean, 'deletePreset'>;
8
8
  export interface IDeletePresetVar {
9
9
  presetId: number;
10
10
  }
11
- export declare const updateCacheOnDeletePrest: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeletePresetData>, options: ApolloUpdateOptions) => void;
11
+ export declare const updateCacheOnDeletePrest: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeletePresetData>, options: ApolloUpdateOptions) => void;
12
12
  export declare const DUPLICATE_PRESET: import("@apollo/client").DocumentNode;
13
13
  export type IDuplicatePresetData = RestrictedData<IPreset, 'duplicatePreset'>;
14
14
  export interface IDuplicatePresetVar {
15
15
  presetId: number;
16
16
  }
17
- export declare const updateCacheOnDuplicatePreset: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDuplicatePresetData>) => void;
17
+ export declare const updateCacheOnDuplicatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDuplicatePresetData>) => void;
18
18
  export declare const EDIT_PRESET: import("@apollo/client").DocumentNode;
19
19
  export type IEditPresetData = RestrictedData<IPreset, 'editPreset'>;
20
20
  export interface IEditPresetVar {
@@ -34,4 +34,4 @@ export interface ICreatePresetVar {
34
34
  conceptIds: Id[];
35
35
  };
36
36
  }
37
- export declare const updateCacheOnCreatePreset: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
37
+ export declare const updateCacheOnCreatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
@@ -11,13 +11,13 @@ exports.DELETE_PRESET = (0, client_1.gql) `
11
11
  }
12
12
  }
13
13
  `;
14
- const updateCacheOnDeletePrest = (userId) => (cache, result, options) => {
14
+ const updateCacheOnDeletePrest = () => (cache, result, options) => {
15
15
  const { deletePreset } = result?.data?.restricted || {};
16
16
  const { variables } = options || {};
17
17
  const { presetId } = variables || {};
18
18
  if (deletePreset && presetId) {
19
19
  const prevData = cache.readQuery({
20
- variables: { userId: Number(userId), order: __1.ESortOrder.DESC },
20
+ variables: { order: __1.ESortOrder.DESC },
21
21
  query: restricted_1.PRESETS,
22
22
  });
23
23
  if (prevData) {
@@ -30,7 +30,7 @@ const updateCacheOnDeletePrest = (userId) => (cache, result, options) => {
30
30
  ];
31
31
  cache.writeQuery({
32
32
  query: restricted_1.PRESETS,
33
- variables: { userId: Number(userId), order: __1.ESortOrder.DESC },
33
+ variables: { order: __1.ESortOrder.DESC },
34
34
  data: {
35
35
  ...prevData,
36
36
  restricted: {
@@ -81,18 +81,18 @@ exports.DUPLICATE_PRESET = (0, client_1.gql) `
81
81
  }
82
82
  }
83
83
  `;
84
- const updateCacheOnDuplicatePreset = (userId) => (cache, result) => {
84
+ const updateCacheOnDuplicatePreset = () => (cache, result) => {
85
85
  const { duplicatePreset } = result?.data?.restricted || {};
86
86
  if (duplicatePreset) {
87
87
  const prevData = cache.readQuery({
88
- variables: { userId: Number(userId), order: __1.ESortOrder.DESC },
88
+ variables: { order: __1.ESortOrder.DESC },
89
89
  query: restricted_1.PRESETS,
90
90
  });
91
91
  if (prevData) {
92
92
  const { presets } = prevData.restricted || {};
93
93
  cache.writeQuery({
94
94
  query: restricted_1.PRESETS,
95
- variables: { userId: Number(userId), order: __1.ESortOrder.DESC },
95
+ variables: { order: __1.ESortOrder.DESC },
96
96
  data: {
97
97
  ...prevData,
98
98
  restricted: {
@@ -179,18 +179,18 @@ exports.CREATE_PRESET = (0, client_1.gql) `
179
179
  }
180
180
  }
181
181
  `;
182
- const updateCacheOnCreatePreset = (userId) => (cache, result) => {
182
+ const updateCacheOnCreatePreset = () => (cache, result) => {
183
183
  const { createPreset } = result?.data?.restricted || {};
184
184
  if (createPreset) {
185
185
  const prevData = cache.readQuery({
186
- variables: { userId },
186
+ variables: {},
187
187
  query: restricted_1.PRESETS,
188
188
  });
189
189
  if (prevData) {
190
190
  const { presets } = prevData.restricted || {};
191
191
  cache.writeQuery({
192
192
  query: restricted_1.PRESETS,
193
- variables: { userId: Number(userId) },
193
+ variables: {},
194
194
  data: {
195
195
  ...prevData,
196
196
  restricted: {
@@ -0,0 +1,6 @@
1
+ import { RootData } from '../../types';
2
+ export interface ICancelSubscriptionVar {
3
+ subscriptionId: number;
4
+ }
5
+ export type ICancelSubscriptionData = RootData<string, 'cancelSubscription'>;
6
+ export declare const CANCEL_SUBSCRIPTION: import("@apollo/client").DocumentNode;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CANCEL_SUBSCRIPTION = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.CANCEL_SUBSCRIPTION = (0, client_1.gql) `
6
+ mutation Mutation($subscriptionId: Int!) {
7
+ restricted {
8
+ cancelSubscription(subscriptionId: $subscriptionId)
9
+ }
10
+ }
11
+ `;
@@ -2,7 +2,6 @@ import { ETopicType, IPreset, Id } from '../../../models';
2
2
  import { ESortOrder } from '../../enums';
3
3
  import { RestrictedData } from '../../types';
4
4
  export interface IPresetsVar {
5
- userId?: Id;
6
5
  topicType?: ETopicType;
7
6
  search?: string;
8
7
  timestamp?: number;
@@ -11,6 +10,12 @@ export interface IPresetsVar {
11
10
  }
12
11
  export type IPresetsData = RestrictedData<IPreset[], 'presets'>;
13
12
  export declare const PRESETS: import("@apollo/client").DocumentNode;
13
+ export interface IPreDefinedPresetsVar {
14
+ search?: string;
15
+ order?: ESortOrder;
16
+ }
17
+ export type IPreDefinedPresetsData = RestrictedData<IPreset[], 'preDefinedPresets'>;
18
+ export declare const PRE_DEFINED_PRESETS: import("@apollo/client").DocumentNode;
14
19
  export interface IPresetVar {
15
20
  id: Id;
16
21
  }
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRESET = exports.PRESETS = void 0;
3
+ exports.PRESET = exports.PRE_DEFINED_PRESETS = exports.PRESETS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  exports.PRESETS = (0, client_1.gql) `
6
6
  query Presets(
7
- $userId: Int
8
7
  $topicType: Int
9
8
  $search: String
10
9
  $timestamp: Int
@@ -13,7 +12,6 @@ exports.PRESETS = (0, client_1.gql) `
13
12
  ) {
14
13
  restricted {
15
14
  presets(
16
- userId: $userId
17
15
  topicType: $topicType
18
16
  search: $search
19
17
  timestamp: $timestamp
@@ -53,6 +51,43 @@ exports.PRESETS = (0, client_1.gql) `
53
51
  }
54
52
  }
55
53
  `;
54
+ exports.PRE_DEFINED_PRESETS = (0, client_1.gql) `
55
+ query PreDefinedPresets($search: String, $order: Int) {
56
+ restricted {
57
+ preDefinedPresets(search: $search, order: $order) {
58
+ id
59
+ createdAt
60
+ updatedAt
61
+ name
62
+ likes
63
+ topicType
64
+ correctQuestions
65
+ incorrectQuestions
66
+ completedQuestions
67
+ totalQuestions
68
+ yellowCards
69
+ greenCards
70
+ redCards
71
+ completedCards
72
+ totalCards
73
+ userId
74
+ university {
75
+ id
76
+ name
77
+ country
78
+ }
79
+ topics {
80
+ id
81
+ name
82
+ concepts {
83
+ id
84
+ name
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ `;
56
91
  exports.PRESET = (0, client_1.gql) `
57
92
  query Preset($id: Int!) {
58
93
  restricted {
@@ -1,6 +1,10 @@
1
1
  import { ETopicType, ITopic } from './Topic';
2
2
  import { Id } from './Type';
3
3
  import { IUniversity } from './University';
4
+ export declare enum EPresetType {
5
+ PRE_DEFINED = 0,
6
+ CUSTOM = 1
7
+ }
4
8
  export interface IPreset {
5
9
  id: Id;
6
10
  createdAt: number | Date;
@@ -1 +1,5 @@
1
- export {};
1
+ export var EPresetType;
2
+ (function (EPresetType) {
3
+ EPresetType[EPresetType["PRE_DEFINED"] = 0] = "PRE_DEFINED";
4
+ EPresetType[EPresetType["CUSTOM"] = 1] = "CUSTOM";
5
+ })(EPresetType || (EPresetType = {}));
@@ -2,11 +2,12 @@ export * from './agora';
2
2
  export * from './contactUs';
3
3
  export * from './marksheet';
4
4
  export * from './mockTest';
5
+ export * from './notification';
5
6
  export * from './osce';
6
7
  export * from './preset';
7
8
  export * from './questionDiscussion';
9
+ export * from './stripe';
8
10
  export * from './todo';
9
11
  export * from './token';
10
12
  export * from './users';
11
13
  export * from './video';
12
- export * from './notification';
@@ -2,11 +2,12 @@ export * from './agora';
2
2
  export * from './contactUs';
3
3
  export * from './marksheet';
4
4
  export * from './mockTest';
5
+ export * from './notification';
5
6
  export * from './osce';
6
7
  export * from './preset';
7
8
  export * from './questionDiscussion';
9
+ export * from './stripe';
8
10
  export * from './todo';
9
11
  export * from './token';
10
12
  export * from './users';
11
13
  export * from './video';
12
- export * from './notification';
@@ -8,13 +8,13 @@ export type IDeletePresetData = RestrictedData<boolean, 'deletePreset'>;
8
8
  export interface IDeletePresetVar {
9
9
  presetId: number;
10
10
  }
11
- export declare const updateCacheOnDeletePrest: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeletePresetData>, options: ApolloUpdateOptions) => void;
11
+ export declare const updateCacheOnDeletePrest: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDeletePresetData>, options: ApolloUpdateOptions) => void;
12
12
  export declare const DUPLICATE_PRESET: import("@apollo/client").DocumentNode;
13
13
  export type IDuplicatePresetData = RestrictedData<IPreset, 'duplicatePreset'>;
14
14
  export interface IDuplicatePresetVar {
15
15
  presetId: number;
16
16
  }
17
- export declare const updateCacheOnDuplicatePreset: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDuplicatePresetData>) => void;
17
+ export declare const updateCacheOnDuplicatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<IDuplicatePresetData>) => void;
18
18
  export declare const EDIT_PRESET: import("@apollo/client").DocumentNode;
19
19
  export type IEditPresetData = RestrictedData<IPreset, 'editPreset'>;
20
20
  export interface IEditPresetVar {
@@ -34,4 +34,4 @@ export interface ICreatePresetVar {
34
34
  conceptIds: Id[];
35
35
  };
36
36
  }
37
- export declare const updateCacheOnCreatePreset: (userId: number) => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
37
+ export declare const updateCacheOnCreatePreset: () => (cache: ApolloCache<any>, result: ApolloUpdateResultRestricted<ICreatePresetData>) => void;
@@ -8,13 +8,13 @@ export const DELETE_PRESET = gql `
8
8
  }
9
9
  }
10
10
  `;
11
- export const updateCacheOnDeletePrest = (userId) => (cache, result, options) => {
11
+ export const updateCacheOnDeletePrest = () => (cache, result, options) => {
12
12
  const { deletePreset } = result?.data?.restricted || {};
13
13
  const { variables } = options || {};
14
14
  const { presetId } = variables || {};
15
15
  if (deletePreset && presetId) {
16
16
  const prevData = cache.readQuery({
17
- variables: { userId: Number(userId), order: ESortOrder.DESC },
17
+ variables: { order: ESortOrder.DESC },
18
18
  query: PRESETS,
19
19
  });
20
20
  if (prevData) {
@@ -27,7 +27,7 @@ export const updateCacheOnDeletePrest = (userId) => (cache, result, options) =>
27
27
  ];
28
28
  cache.writeQuery({
29
29
  query: PRESETS,
30
- variables: { userId: Number(userId), order: ESortOrder.DESC },
30
+ variables: { order: ESortOrder.DESC },
31
31
  data: {
32
32
  ...prevData,
33
33
  restricted: {
@@ -77,18 +77,18 @@ export const DUPLICATE_PRESET = gql `
77
77
  }
78
78
  }
79
79
  `;
80
- export const updateCacheOnDuplicatePreset = (userId) => (cache, result) => {
80
+ export const updateCacheOnDuplicatePreset = () => (cache, result) => {
81
81
  const { duplicatePreset } = result?.data?.restricted || {};
82
82
  if (duplicatePreset) {
83
83
  const prevData = cache.readQuery({
84
- variables: { userId: Number(userId), order: ESortOrder.DESC },
84
+ variables: { order: ESortOrder.DESC },
85
85
  query: PRESETS,
86
86
  });
87
87
  if (prevData) {
88
88
  const { presets } = prevData.restricted || {};
89
89
  cache.writeQuery({
90
90
  query: PRESETS,
91
- variables: { userId: Number(userId), order: ESortOrder.DESC },
91
+ variables: { order: ESortOrder.DESC },
92
92
  data: {
93
93
  ...prevData,
94
94
  restricted: {
@@ -174,18 +174,18 @@ export const CREATE_PRESET = gql `
174
174
  }
175
175
  }
176
176
  `;
177
- export const updateCacheOnCreatePreset = (userId) => (cache, result) => {
177
+ export const updateCacheOnCreatePreset = () => (cache, result) => {
178
178
  const { createPreset } = result?.data?.restricted || {};
179
179
  if (createPreset) {
180
180
  const prevData = cache.readQuery({
181
- variables: { userId },
181
+ variables: {},
182
182
  query: PRESETS,
183
183
  });
184
184
  if (prevData) {
185
185
  const { presets } = prevData.restricted || {};
186
186
  cache.writeQuery({
187
187
  query: PRESETS,
188
- variables: { userId: Number(userId) },
188
+ variables: {},
189
189
  data: {
190
190
  ...prevData,
191
191
  restricted: {
@@ -0,0 +1,6 @@
1
+ import { RootData } from '../../types';
2
+ export interface ICancelSubscriptionVar {
3
+ subscriptionId: number;
4
+ }
5
+ export type ICancelSubscriptionData = RootData<string, 'cancelSubscription'>;
6
+ export declare const CANCEL_SUBSCRIPTION: import("@apollo/client").DocumentNode;
@@ -0,0 +1,8 @@
1
+ import { gql } from '@apollo/client';
2
+ export const CANCEL_SUBSCRIPTION = gql `
3
+ mutation Mutation($subscriptionId: Int!) {
4
+ restricted {
5
+ cancelSubscription(subscriptionId: $subscriptionId)
6
+ }
7
+ }
8
+ `;
@@ -2,7 +2,6 @@ import { ETopicType, IPreset, Id } from '../../../models';
2
2
  import { ESortOrder } from '../../enums';
3
3
  import { RestrictedData } from '../../types';
4
4
  export interface IPresetsVar {
5
- userId?: Id;
6
5
  topicType?: ETopicType;
7
6
  search?: string;
8
7
  timestamp?: number;
@@ -11,6 +10,12 @@ export interface IPresetsVar {
11
10
  }
12
11
  export type IPresetsData = RestrictedData<IPreset[], 'presets'>;
13
12
  export declare const PRESETS: import("@apollo/client").DocumentNode;
13
+ export interface IPreDefinedPresetsVar {
14
+ search?: string;
15
+ order?: ESortOrder;
16
+ }
17
+ export type IPreDefinedPresetsData = RestrictedData<IPreset[], 'preDefinedPresets'>;
18
+ export declare const PRE_DEFINED_PRESETS: import("@apollo/client").DocumentNode;
14
19
  export interface IPresetVar {
15
20
  id: Id;
16
21
  }
@@ -1,7 +1,6 @@
1
1
  import { gql } from '@apollo/client';
2
2
  export const PRESETS = gql `
3
3
  query Presets(
4
- $userId: Int
5
4
  $topicType: Int
6
5
  $search: String
7
6
  $timestamp: Int
@@ -10,7 +9,6 @@ export const PRESETS = gql `
10
9
  ) {
11
10
  restricted {
12
11
  presets(
13
- userId: $userId
14
12
  topicType: $topicType
15
13
  search: $search
16
14
  timestamp: $timestamp
@@ -50,6 +48,43 @@ export const PRESETS = gql `
50
48
  }
51
49
  }
52
50
  `;
51
+ export const PRE_DEFINED_PRESETS = gql `
52
+ query PreDefinedPresets($search: String, $order: Int) {
53
+ restricted {
54
+ preDefinedPresets(search: $search, order: $order) {
55
+ id
56
+ createdAt
57
+ updatedAt
58
+ name
59
+ likes
60
+ topicType
61
+ correctQuestions
62
+ incorrectQuestions
63
+ completedQuestions
64
+ totalQuestions
65
+ yellowCards
66
+ greenCards
67
+ redCards
68
+ completedCards
69
+ totalCards
70
+ userId
71
+ university {
72
+ id
73
+ name
74
+ country
75
+ }
76
+ topics {
77
+ id
78
+ name
79
+ concepts {
80
+ id
81
+ name
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ `;
53
88
  export const PRESET = gql `
54
89
  query Preset($id: Int!) {
55
90
  restricted {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.5.88",
3
+ "version": "2.5.90",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",
@@ -136,5 +136,5 @@
136
136
  "files": [
137
137
  "dist/"
138
138
  ],
139
- "packageManager": "yarn@3.5.0"
139
+ "packageManager": "yarn@4.0.2"
140
140
  }