@quesmed/types 2.6.151 → 2.6.153

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.
@@ -2,4 +2,5 @@ export * from './algoliaSync';
2
2
  export * from './content';
3
3
  export * from './database';
4
4
  export * from './notification';
5
+ export * from './question';
5
6
  export * from './token';
@@ -18,4 +18,5 @@ __exportStar(require("./algoliaSync"), exports);
18
18
  __exportStar(require("./content"), exports);
19
19
  __exportStar(require("./database"), exports);
20
20
  __exportStar(require("./notification"), exports);
21
+ __exportStar(require("./question"), exports);
21
22
  __exportStar(require("./token"), exports);
@@ -0,0 +1,31 @@
1
+ import { EEntitlementType, IQuestion, IQuestionCase, IQuestionChoice, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const UPDATE_QUESTION: import("@apollo/client").DocumentNode;
4
+ export interface IUpdateQuestionVar {
5
+ id: Id;
6
+ public?: boolean;
7
+ question?: string;
8
+ conceptId?: number;
9
+ difficulty?: number;
10
+ typeId?: number;
11
+ answer?: string;
12
+ choices?: Partial<IQuestionChoice>[];
13
+ cases?: Partial<IQuestionCase>[];
14
+ explanation?: string;
15
+ learningPoint?: string;
16
+ entitlements?: EEntitlementType[];
17
+ createRevision?: boolean;
18
+ }
19
+ export type IUpdateQuestionData = AdminData<graphqlNormalize & IQuestion, 'updateQuestion'>;
20
+ export declare const RESET_QUESTION: import("@apollo/client").DocumentNode;
21
+ export interface IResetQuestionVar {
22
+ ids: Id[];
23
+ operation: 'likes' | 'dislikes' | 'votes';
24
+ }
25
+ export type IResetQuestionData = AdminData<graphqlNormalize & boolean, 'resetQuestion'>;
26
+ export declare const MANAGE_QUESTION_COMMENT: import("@apollo/client").DocumentNode;
27
+ export interface IManageQuestionCommentVar {
28
+ id: Id;
29
+ operation: 'hide' | 'delete';
30
+ }
31
+ export type IManageQuestionCommentData = AdminData<graphqlNormalize & boolean, 'manageQuestionComment'>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MANAGE_QUESTION_COMMENT = exports.RESET_QUESTION = exports.UPDATE_QUESTION = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ exports.UPDATE_QUESTION = (0, client_1.gql) `
6
+ mutation updateQuestion($input: UpdateQuestionInput!) {
7
+ admin {
8
+ updateQuestion(input: $input) {
9
+ id
10
+ }
11
+ }
12
+ }
13
+ `;
14
+ exports.RESET_QUESTION = (0, client_1.gql) `
15
+ mutation ResetQuestion($ids: [ID!]!, $operation: String!) {
16
+ admin {
17
+ resetQuestion(ids: $ids, operation: $operation)
18
+ }
19
+ }
20
+ `;
21
+ exports.MANAGE_QUESTION_COMMENT = (0, client_1.gql) `
22
+ mutation ManageQuestionComment($id: ID!, $operation: String!) {
23
+ admin {
24
+ manageQuestionComment(id: $id, operation: $operation)
25
+ }
26
+ }
27
+ `;
@@ -1,3 +1,4 @@
1
1
  export * from './dashboard';
2
2
  export * from './database';
3
3
  export * from './getUserToken';
4
+ export * from './question';
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dashboard"), exports);
18
18
  __exportStar(require("./database"), exports);
19
19
  __exportStar(require("./getUserToken"), exports);
20
+ __exportStar(require("./question"), exports);
@@ -0,0 +1,7 @@
1
+ import { IQuestion, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const ADMIN_QUESTION: import("@apollo/client").DocumentNode;
4
+ export interface IAdminQuestionVar {
5
+ id: Id;
6
+ }
7
+ export type IAdminQuestionData = AdminData<graphqlNormalize & IQuestion, 'question'>;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ADMIN_QUESTION = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const fragments_1 = require("../../fragments");
6
+ exports.ADMIN_QUESTION = (0, client_1.gql) `
7
+ ${fragments_1.QUESTION_COMMENT_FIELDS}
8
+ ${fragments_1.PICTURE_FIELDS}
9
+ query QuestionData($id: Int!) {
10
+ admin {
11
+ question(id: $id) {
12
+ ... on QuestionEMQ {
13
+ cases {
14
+ id
15
+ questionId
16
+ case
17
+ explanation
18
+ label
19
+ }
20
+ }
21
+ id
22
+ public
23
+ conceptId
24
+ difficulty
25
+ question
26
+ learningPoint
27
+ explanation
28
+ createdAt
29
+ updatedAt
30
+ typeId
31
+ likes
32
+ dislikes
33
+ totalVotes
34
+ entitlements {
35
+ id
36
+ entitlementId
37
+ questionId
38
+ }
39
+ pictures {
40
+ ...PictureFields
41
+ }
42
+ comments {
43
+ ...QuestionCommentFields
44
+ }
45
+ revisions {
46
+ id
47
+ questionId
48
+ createdAt
49
+ updatedAt
50
+ conceptId
51
+ difficulty
52
+ typeId
53
+ question
54
+ explanation
55
+ learningPoint
56
+ answer
57
+ choices {
58
+ id
59
+ name
60
+ explanation
61
+ label
62
+ answer
63
+ votes
64
+ updatedAt
65
+ }
66
+ cases {
67
+ id
68
+ questionId
69
+ case
70
+ explanation
71
+ label
72
+ updatedAt
73
+ }
74
+ }
75
+ choices {
76
+ id
77
+ name
78
+ explanation
79
+ label
80
+ answer
81
+ votes
82
+ updatedAt
83
+ }
84
+ topic {
85
+ id
86
+ name
87
+ }
88
+ concept {
89
+ id
90
+ name
91
+ topicId
92
+ }
93
+ }
94
+ }
95
+ }
96
+ `;
@@ -1,9 +1,7 @@
1
1
  import { Id, IQuestion } from '../../../models';
2
- import { AdminData, graphqlNormalize, RestrictedData } from '../../types';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
3
  export interface IQuestionVar {
4
4
  id: Id;
5
5
  }
6
6
  export type IQuestionData = RestrictedData<graphqlNormalize & IQuestion, 'question'>;
7
7
  export declare const QUESTION: import("@apollo/client").DocumentNode;
8
- export declare const ADMIN_QUESTION: import("@apollo/client").DocumentNode;
9
- export type IAdminQuestionData = AdminData<graphqlNormalize & IQuestion, 'question'>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ADMIN_QUESTION = exports.QUESTION = void 0;
3
+ exports.QUESTION = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const fragments_1 = require("../../fragments");
6
6
  exports.QUESTION = (0, client_1.gql) `
@@ -13,89 +13,3 @@ exports.QUESTION = (0, client_1.gql) `
13
13
  }
14
14
  }
15
15
  `;
16
- exports.ADMIN_QUESTION = (0, client_1.gql) `
17
- ${fragments_1.QUESTION_COMMENT_FIELDS}
18
- ${fragments_1.PICTURE_FIELDS}
19
- query QuestionData($id: Int!) {
20
- admin {
21
- question(id: $id) {
22
- ... on QuestionEMQ {
23
- cases {
24
- id
25
- questionId
26
- case
27
- explanation
28
- label
29
- }
30
- }
31
- id
32
- public
33
- conceptId
34
- difficulty
35
- question
36
- learningPoint
37
- explanation
38
- createdAt
39
- updatedAt
40
- typeId
41
- entitlements {
42
- id
43
- entitlementId
44
- questionId
45
- }
46
- pictures {
47
- ...PictureFields
48
- }
49
- comments {
50
- ...QuestionCommentFields
51
- }
52
- revisions {
53
- id
54
- questionId
55
- createdAt
56
- updatedAt
57
- conceptId
58
- difficulty
59
- typeId
60
- question
61
- explanation
62
- learningPoint
63
- answer
64
- choices {
65
- id
66
- name
67
- explanation
68
- label
69
- answer
70
- votes
71
- updatedAt
72
- }
73
- cases {
74
- id
75
- questionId
76
- case
77
- explanation
78
- label
79
- updatedAt
80
- }
81
- }
82
- choices {
83
- id
84
- name
85
- explanation
86
- label
87
- answer
88
- }
89
- topic {
90
- id
91
- name
92
- }
93
- concept {
94
- id
95
- name
96
- topicId
97
- }
98
- }
99
- }
100
- }
101
- `;
@@ -2,4 +2,5 @@ export * from './algoliaSync';
2
2
  export * from './content';
3
3
  export * from './database';
4
4
  export * from './notification';
5
+ export * from './question';
5
6
  export * from './token';
@@ -2,4 +2,5 @@ export * from './algoliaSync';
2
2
  export * from './content';
3
3
  export * from './database';
4
4
  export * from './notification';
5
+ export * from './question';
5
6
  export * from './token';
@@ -0,0 +1,31 @@
1
+ import { EEntitlementType, IQuestion, IQuestionCase, IQuestionChoice, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const UPDATE_QUESTION: import("@apollo/client").DocumentNode;
4
+ export interface IUpdateQuestionVar {
5
+ id: Id;
6
+ public?: boolean;
7
+ question?: string;
8
+ conceptId?: number;
9
+ difficulty?: number;
10
+ typeId?: number;
11
+ answer?: string;
12
+ choices?: Partial<IQuestionChoice>[];
13
+ cases?: Partial<IQuestionCase>[];
14
+ explanation?: string;
15
+ learningPoint?: string;
16
+ entitlements?: EEntitlementType[];
17
+ createRevision?: boolean;
18
+ }
19
+ export type IUpdateQuestionData = AdminData<graphqlNormalize & IQuestion, 'updateQuestion'>;
20
+ export declare const RESET_QUESTION: import("@apollo/client").DocumentNode;
21
+ export interface IResetQuestionVar {
22
+ ids: Id[];
23
+ operation: 'likes' | 'dislikes' | 'votes';
24
+ }
25
+ export type IResetQuestionData = AdminData<graphqlNormalize & boolean, 'resetQuestion'>;
26
+ export declare const MANAGE_QUESTION_COMMENT: import("@apollo/client").DocumentNode;
27
+ export interface IManageQuestionCommentVar {
28
+ id: Id;
29
+ operation: 'hide' | 'delete';
30
+ }
31
+ export type IManageQuestionCommentData = AdminData<graphqlNormalize & boolean, 'manageQuestionComment'>;
@@ -0,0 +1,24 @@
1
+ import { gql } from '@apollo/client';
2
+ export const UPDATE_QUESTION = gql `
3
+ mutation updateQuestion($input: UpdateQuestionInput!) {
4
+ admin {
5
+ updateQuestion(input: $input) {
6
+ id
7
+ }
8
+ }
9
+ }
10
+ `;
11
+ export const RESET_QUESTION = gql `
12
+ mutation ResetQuestion($ids: [ID!]!, $operation: String!) {
13
+ admin {
14
+ resetQuestion(ids: $ids, operation: $operation)
15
+ }
16
+ }
17
+ `;
18
+ export const MANAGE_QUESTION_COMMENT = gql `
19
+ mutation ManageQuestionComment($id: ID!, $operation: String!) {
20
+ admin {
21
+ manageQuestionComment(id: $id, operation: $operation)
22
+ }
23
+ }
24
+ `;
@@ -1,3 +1,4 @@
1
1
  export * from './dashboard';
2
2
  export * from './database';
3
3
  export * from './getUserToken';
4
+ export * from './question';
@@ -1,3 +1,4 @@
1
1
  export * from './dashboard';
2
2
  export * from './database';
3
3
  export * from './getUserToken';
4
+ export * from './question';
@@ -0,0 +1,7 @@
1
+ import { IQuestion, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const ADMIN_QUESTION: import("@apollo/client").DocumentNode;
4
+ export interface IAdminQuestionVar {
5
+ id: Id;
6
+ }
7
+ export type IAdminQuestionData = AdminData<graphqlNormalize & IQuestion, 'question'>;
@@ -0,0 +1,93 @@
1
+ import { gql } from '@apollo/client';
2
+ import { PICTURE_FIELDS, QUESTION_COMMENT_FIELDS } from '../../fragments';
3
+ export const ADMIN_QUESTION = gql `
4
+ ${QUESTION_COMMENT_FIELDS}
5
+ ${PICTURE_FIELDS}
6
+ query QuestionData($id: Int!) {
7
+ admin {
8
+ question(id: $id) {
9
+ ... on QuestionEMQ {
10
+ cases {
11
+ id
12
+ questionId
13
+ case
14
+ explanation
15
+ label
16
+ }
17
+ }
18
+ id
19
+ public
20
+ conceptId
21
+ difficulty
22
+ question
23
+ learningPoint
24
+ explanation
25
+ createdAt
26
+ updatedAt
27
+ typeId
28
+ likes
29
+ dislikes
30
+ totalVotes
31
+ entitlements {
32
+ id
33
+ entitlementId
34
+ questionId
35
+ }
36
+ pictures {
37
+ ...PictureFields
38
+ }
39
+ comments {
40
+ ...QuestionCommentFields
41
+ }
42
+ revisions {
43
+ id
44
+ questionId
45
+ createdAt
46
+ updatedAt
47
+ conceptId
48
+ difficulty
49
+ typeId
50
+ question
51
+ explanation
52
+ learningPoint
53
+ answer
54
+ choices {
55
+ id
56
+ name
57
+ explanation
58
+ label
59
+ answer
60
+ votes
61
+ updatedAt
62
+ }
63
+ cases {
64
+ id
65
+ questionId
66
+ case
67
+ explanation
68
+ label
69
+ updatedAt
70
+ }
71
+ }
72
+ choices {
73
+ id
74
+ name
75
+ explanation
76
+ label
77
+ answer
78
+ votes
79
+ updatedAt
80
+ }
81
+ topic {
82
+ id
83
+ name
84
+ }
85
+ concept {
86
+ id
87
+ name
88
+ topicId
89
+ }
90
+ }
91
+ }
92
+ }
93
+ `;
@@ -1,9 +1,7 @@
1
1
  import { Id, IQuestion } from '../../../models';
2
- import { AdminData, graphqlNormalize, RestrictedData } from '../../types';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
3
  export interface IQuestionVar {
4
4
  id: Id;
5
5
  }
6
6
  export type IQuestionData = RestrictedData<graphqlNormalize & IQuestion, 'question'>;
7
7
  export declare const QUESTION: import("@apollo/client").DocumentNode;
8
- export declare const ADMIN_QUESTION: import("@apollo/client").DocumentNode;
9
- export type IAdminQuestionData = AdminData<graphqlNormalize & IQuestion, 'question'>;
@@ -1,5 +1,5 @@
1
1
  import { gql } from '@apollo/client';
2
- import { PICTURE_FIELDS, QUESTION_COMMENT_FIELDS, QUESTION_FIELDS, } from '../../fragments';
2
+ import { QUESTION_FIELDS } from '../../fragments';
3
3
  export const QUESTION = gql `
4
4
  ${QUESTION_FIELDS}
5
5
  query Question($id: Int!) {
@@ -10,89 +10,3 @@ export const QUESTION = gql `
10
10
  }
11
11
  }
12
12
  `;
13
- export const ADMIN_QUESTION = gql `
14
- ${QUESTION_COMMENT_FIELDS}
15
- ${PICTURE_FIELDS}
16
- query QuestionData($id: Int!) {
17
- admin {
18
- question(id: $id) {
19
- ... on QuestionEMQ {
20
- cases {
21
- id
22
- questionId
23
- case
24
- explanation
25
- label
26
- }
27
- }
28
- id
29
- public
30
- conceptId
31
- difficulty
32
- question
33
- learningPoint
34
- explanation
35
- createdAt
36
- updatedAt
37
- typeId
38
- entitlements {
39
- id
40
- entitlementId
41
- questionId
42
- }
43
- pictures {
44
- ...PictureFields
45
- }
46
- comments {
47
- ...QuestionCommentFields
48
- }
49
- revisions {
50
- id
51
- questionId
52
- createdAt
53
- updatedAt
54
- conceptId
55
- difficulty
56
- typeId
57
- question
58
- explanation
59
- learningPoint
60
- answer
61
- choices {
62
- id
63
- name
64
- explanation
65
- label
66
- answer
67
- votes
68
- updatedAt
69
- }
70
- cases {
71
- id
72
- questionId
73
- case
74
- explanation
75
- label
76
- updatedAt
77
- }
78
- }
79
- choices {
80
- id
81
- name
82
- explanation
83
- label
84
- answer
85
- }
86
- topic {
87
- id
88
- name
89
- }
90
- concept {
91
- id
92
- name
93
- topicId
94
- }
95
- }
96
- }
97
- }
98
- `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.151",
3
+ "version": "2.6.153",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",