@quesmed/types 2.6.195 → 2.6.197

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.
Files changed (37) hide show
  1. package/dist/cjs/models/Job.d.ts +9 -1
  2. package/dist/cjs/models/Job.js +1 -1
  3. package/dist/cjs/resolvers/fragments/job.js +5 -0
  4. package/dist/cjs/resolvers/fragments/record.js +3 -1
  5. package/dist/cjs/resolvers/mutation/admin/assets.d.ts +19 -1
  6. package/dist/cjs/resolvers/mutation/admin/assets.js +18 -1
  7. package/dist/cjs/resolvers/mutation/admin/chapter.d.ts +16 -0
  8. package/dist/cjs/resolvers/mutation/admin/chapter.js +15 -0
  9. package/dist/cjs/resolvers/mutation/admin/index.d.ts +1 -0
  10. package/dist/cjs/resolvers/mutation/admin/index.js +1 -0
  11. package/dist/cjs/resolvers/mutation/admin/question.d.ts +5 -0
  12. package/dist/cjs/resolvers/mutation/admin/question.js +8 -1
  13. package/dist/cjs/resolvers/query/admin/chapter.d.ts +7 -0
  14. package/dist/cjs/resolvers/query/admin/chapter.js +22 -0
  15. package/dist/cjs/resolvers/query/admin/index.d.ts +1 -0
  16. package/dist/cjs/resolvers/query/admin/index.js +1 -0
  17. package/dist/cjs/resolvers/query/restricted/chapter.d.ts +1 -1
  18. package/dist/cjs/resolvers/query/restricted/chapter.js +3 -0
  19. package/dist/mjs/models/Job.d.ts +9 -1
  20. package/dist/mjs/models/Job.js +1 -1
  21. package/dist/mjs/resolvers/fragments/job.js +5 -0
  22. package/dist/mjs/resolvers/fragments/record.js +3 -1
  23. package/dist/mjs/resolvers/mutation/admin/assets.d.ts +19 -1
  24. package/dist/mjs/resolvers/mutation/admin/assets.js +18 -1
  25. package/dist/mjs/resolvers/mutation/admin/chapter.d.ts +16 -0
  26. package/dist/mjs/resolvers/mutation/admin/chapter.js +12 -0
  27. package/dist/mjs/resolvers/mutation/admin/index.d.ts +1 -0
  28. package/dist/mjs/resolvers/mutation/admin/index.js +1 -0
  29. package/dist/mjs/resolvers/mutation/admin/question.d.ts +5 -0
  30. package/dist/mjs/resolvers/mutation/admin/question.js +7 -0
  31. package/dist/mjs/resolvers/query/admin/chapter.d.ts +7 -0
  32. package/dist/mjs/resolvers/query/admin/chapter.js +19 -0
  33. package/dist/mjs/resolvers/query/admin/index.d.ts +1 -0
  34. package/dist/mjs/resolvers/query/admin/index.js +1 -0
  35. package/dist/mjs/resolvers/query/restricted/chapter.d.ts +1 -1
  36. package/dist/mjs/resolvers/query/restricted/chapter.js +3 -0
  37. package/package.json +1 -1
@@ -133,9 +133,12 @@ export interface IJobRecordQuestion {
133
133
  irtParameters?: IRTParameters | null;
134
134
  }
135
135
  export interface IJobRecordChapter {
136
- title: string;
136
+ topic: string;
137
137
  concept: string;
138
138
  explanation: string;
139
+ summary: string;
140
+ entitlementIds?: EEntitlementType[] | null;
141
+ topicTypeId?: number | null;
139
142
  }
140
143
  export interface IJobRecordStation {
141
144
  station: string;
@@ -217,6 +220,11 @@ export interface IJobMetaData {
217
220
  conceptId: number | null;
218
221
  entitlementIds: EEntitlementType[] | null;
219
222
  } | null;
223
+ chapter?: {
224
+ topicId: number | null;
225
+ conceptId: number | null;
226
+ entitlementIds: EEntitlementType[] | null;
227
+ } | null;
220
228
  }
221
229
  export interface IJobChat {
222
230
  id: string;
@@ -121,7 +121,7 @@ const IsJobRecordStation = (record) => {
121
121
  };
122
122
  exports.IsJobRecordStation = IsJobRecordStation;
123
123
  const IsJobRecordChapter = (record) => {
124
- return !!record && typeof record === 'object' && 'chapter' in record;
124
+ return !!record && typeof record === 'object' && 'summary' in record;
125
125
  };
126
126
  exports.IsJobRecordChapter = IsJobRecordChapter;
127
127
  const IsJobRecordQuestionByType = (type, record) => {
@@ -22,6 +22,11 @@ exports.JOB_META_DATA_FRAGMENT = (0, client_1.gql) `
22
22
  title
23
23
  passingMark
24
24
  }
25
+ chapter {
26
+ topicId
27
+ entitlementIds
28
+ # topicTypeId
29
+ }
25
30
  }
26
31
  `;
27
32
  exports.JOB_FIELDS_FRAGMENT = (0, client_1.gql) `
@@ -123,7 +123,9 @@ exports.JOB_RECORD_CHAPTER_FRAGMENT = (0, client_1.gql) `
123
123
  fragment JobRecordChapter on JobRecordChapter {
124
124
  topic
125
125
  concept
126
- chapter
126
+ explanation
127
+ summary
128
+ entitlementIds
127
129
  }
128
130
  `;
129
131
  exports.JOB_RECORD_STATION_FRAGMENT = (0, client_1.gql) `
@@ -1,4 +1,4 @@
1
- import { ELightGalleryType, FileData, IJob, IJobAsset, IJobRecord, Id } from '../../../models';
1
+ import { ELightGalleryType, FileData, IJob, IJobAsset, IJobRecord, IPicture, Id } from '../../../models';
2
2
  import { AdminData, graphqlNormalize } from '../../types';
3
3
  export declare const REMOVE_JOB_ASSETS: import("@apollo/client").DocumentNode;
4
4
  export type IRemoveJobAssetsVar = {
@@ -24,3 +24,21 @@ export type ICreateJobAssetsVar = {
24
24
  inputs: IJobAssetInput[];
25
25
  };
26
26
  export type ICreateJobAssetsData = AdminData<(IJobAsset & graphqlNormalize)[], 'createJobAssets'>;
27
+ export interface IAssetInput {
28
+ file: File | FileData;
29
+ caption?: string | null;
30
+ name: string;
31
+ topicId?: Id;
32
+ sensitive: boolean;
33
+ overlay?: boolean;
34
+ }
35
+ export declare const CREATE_ASSETS: import("@apollo/client").DocumentNode;
36
+ export type ICreateAssetsVar = {
37
+ inputs: IAssetInput[];
38
+ };
39
+ export type ICreateAssetsData = AdminData<(IPicture & graphqlNormalize)[], 'createAssets'>;
40
+ export declare const REMOVE_ASSETS: import("@apollo/client").DocumentNode;
41
+ export type IRemoveAssetsVar = {
42
+ ids: Id[];
43
+ };
44
+ export type IRemoveAssetsData = AdminData<boolean, 'removeAssets'>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_JOB_ASSETS = exports.REMOVE_JOB_ASSETS = void 0;
3
+ exports.REMOVE_ASSETS = exports.CREATE_ASSETS = exports.CREATE_JOB_ASSETS = exports.REMOVE_JOB_ASSETS = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  const fragments_1 = require("../../fragments");
6
6
  exports.REMOVE_JOB_ASSETS = (0, client_1.gql) `
@@ -20,3 +20,20 @@ exports.CREATE_JOB_ASSETS = (0, client_1.gql) `
20
20
  }
21
21
  }
22
22
  `;
23
+ exports.CREATE_ASSETS = (0, client_1.gql) `
24
+ ${fragments_1.PICTURE_FIELDS}
25
+ mutation CreateAssets($inputs: [CreateAssetsInput!]!) {
26
+ admin {
27
+ createAssets(inputs: $inputs) {
28
+ ...PictureFields
29
+ }
30
+ }
31
+ }
32
+ `;
33
+ exports.REMOVE_ASSETS = (0, client_1.gql) `
34
+ mutation RemoveAssets($ids: [ID!]!) {
35
+ admin {
36
+ removeAssets(ids: $ids)
37
+ }
38
+ }
39
+ `;
@@ -0,0 +1,16 @@
1
+ import { IChapter, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const UPDATE_CHAPTER: import("@apollo/client").DocumentNode;
4
+ export interface IAssetBinding {
5
+ id: Id;
6
+ index: number;
7
+ questionChoiceId?: Id;
8
+ deleted: boolean;
9
+ }
10
+ export interface IUpdateChapterVar {
11
+ id: Id;
12
+ explanation?: string;
13
+ summary?: string;
14
+ assets?: IAssetBinding[];
15
+ }
16
+ export type IUpdateChapterData = AdminData<graphqlNormalize & IChapter, 'updateChapter'>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UPDATE_CHAPTER = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const fragments_1 = require("../../fragments");
6
+ exports.UPDATE_CHAPTER = (0, client_1.gql) `
7
+ ${fragments_1.CHAPTER_FIELDS}
8
+ mutation updateChapter($input: UpdateChapterInput!) {
9
+ admin {
10
+ updateChapter(input: $input) {
11
+ ...ChapterFields
12
+ }
13
+ }
14
+ }
15
+ `;
@@ -1,6 +1,7 @@
1
1
  export * from './ai';
2
2
  export * from './algoliaSync';
3
3
  export * from './assets';
4
+ export * from './chapter';
4
5
  export * from './content';
5
6
  export * from './database';
6
7
  export * from './job';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ai"), exports);
18
18
  __exportStar(require("./algoliaSync"), exports);
19
19
  __exportStar(require("./assets"), exports);
20
+ __exportStar(require("./chapter"), exports);
20
21
  __exportStar(require("./content"), exports);
21
22
  __exportStar(require("./database"), exports);
22
23
  __exportStar(require("./job"), exports);
@@ -31,3 +31,8 @@ export interface IManageQuestionCommentVar {
31
31
  operation: 'hide' | 'delete';
32
32
  }
33
33
  export type IManageQuestionCommentData = AdminData<graphqlNormalize & boolean, 'manageQuestionComment'>;
34
+ export declare const DELETE_QUESTIONS: import("@apollo/client").DocumentNode;
35
+ export interface IDeleteQuestionsVar {
36
+ ids: Id[];
37
+ }
38
+ export type IDeleteQuestionsData = AdminData<graphqlNormalize & boolean, 'deleteQuestions'>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MANAGE_QUESTION_COMMENT = exports.RESET_QUESTION = exports.UPDATE_QUESTION = void 0;
3
+ exports.DELETE_QUESTIONS = exports.MANAGE_QUESTION_COMMENT = exports.RESET_QUESTION = exports.UPDATE_QUESTION = void 0;
4
4
  const client_1 = require("@apollo/client");
5
5
  exports.UPDATE_QUESTION = (0, client_1.gql) `
6
6
  mutation updateQuestion($input: UpdateQuestionInput!) {
@@ -25,3 +25,10 @@ exports.MANAGE_QUESTION_COMMENT = (0, client_1.gql) `
25
25
  }
26
26
  }
27
27
  `;
28
+ exports.DELETE_QUESTIONS = (0, client_1.gql) `
29
+ mutation DeleteQuestions($ids: [ID!]!) {
30
+ admin {
31
+ deleteQuestions(ids: $ids)
32
+ }
33
+ }
34
+ `;
@@ -0,0 +1,7 @@
1
+ import { IChapter } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export interface IAdminChapterVar {
4
+ id: number;
5
+ }
6
+ export type IAdminChapterData = AdminData<graphqlNormalize & IChapter, 'chapter'>;
7
+ export declare const ADMIN_CHAPTER: import("@apollo/client").DocumentNode;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ADMIN_CHAPTER = void 0;
4
+ const client_1 = require("@apollo/client");
5
+ const fragments_1 = require("../../fragments");
6
+ exports.ADMIN_CHAPTER = (0, client_1.gql) `
7
+ ${fragments_1.PICTURE_FIELDS}
8
+ query AdminChapter($id: Int!) {
9
+ admin {
10
+ chapter(id: $id) {
11
+ id
12
+ explanation
13
+ summary
14
+ createdAt
15
+ updatedAt
16
+ pictures {
17
+ ...PictureFields
18
+ }
19
+ }
20
+ }
21
+ }
22
+ `;
@@ -1,3 +1,4 @@
1
+ export * from './chapter';
1
2
  export * from './dashboard';
2
3
  export * from './database';
3
4
  export * from './getUserToken';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./chapter"), exports);
17
18
  __exportStar(require("./dashboard"), exports);
18
19
  __exportStar(require("./database"), exports);
19
20
  __exportStar(require("./getUserToken"), exports);
@@ -1,5 +1,5 @@
1
- import { graphqlNormalize, RestrictedData } from '../../types';
2
1
  import { IChapter } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
3
  export interface IChapterVar {
4
4
  id: number;
5
5
  }
@@ -8,6 +8,9 @@ exports.CHAPTER = (0, client_1.gql) `
8
8
  chapter(id: $id) {
9
9
  id
10
10
  explanation
11
+ summary
12
+ createdAt
13
+ updatedAt
11
14
  }
12
15
  }
13
16
  }
@@ -133,9 +133,12 @@ export interface IJobRecordQuestion {
133
133
  irtParameters?: IRTParameters | null;
134
134
  }
135
135
  export interface IJobRecordChapter {
136
- title: string;
136
+ topic: string;
137
137
  concept: string;
138
138
  explanation: string;
139
+ summary: string;
140
+ entitlementIds?: EEntitlementType[] | null;
141
+ topicTypeId?: number | null;
139
142
  }
140
143
  export interface IJobRecordStation {
141
144
  station: string;
@@ -217,6 +220,11 @@ export interface IJobMetaData {
217
220
  conceptId: number | null;
218
221
  entitlementIds: EEntitlementType[] | null;
219
222
  } | null;
223
+ chapter?: {
224
+ topicId: number | null;
225
+ conceptId: number | null;
226
+ entitlementIds: EEntitlementType[] | null;
227
+ } | null;
220
228
  }
221
229
  export interface IJobChat {
222
230
  id: string;
@@ -115,7 +115,7 @@ export const IsJobRecordStation = (record) => {
115
115
  return !!record && typeof record === 'object' && 'question' in record;
116
116
  };
117
117
  export const IsJobRecordChapter = (record) => {
118
- return !!record && typeof record === 'object' && 'chapter' in record;
118
+ return !!record && typeof record === 'object' && 'summary' in record;
119
119
  };
120
120
  export const IsJobRecordQuestionByType = (type, record) => {
121
121
  return type === EJobType.QUESTION;
@@ -19,6 +19,11 @@ export const JOB_META_DATA_FRAGMENT = gql `
19
19
  title
20
20
  passingMark
21
21
  }
22
+ chapter {
23
+ topicId
24
+ entitlementIds
25
+ # topicTypeId
26
+ }
22
27
  }
23
28
  `;
24
29
  export const JOB_FIELDS_FRAGMENT = gql `
@@ -120,7 +120,9 @@ export const JOB_RECORD_CHAPTER_FRAGMENT = gql `
120
120
  fragment JobRecordChapter on JobRecordChapter {
121
121
  topic
122
122
  concept
123
- chapter
123
+ explanation
124
+ summary
125
+ entitlementIds
124
126
  }
125
127
  `;
126
128
  export const JOB_RECORD_STATION_FRAGMENT = gql `
@@ -1,4 +1,4 @@
1
- import { ELightGalleryType, FileData, IJob, IJobAsset, IJobRecord, Id } from '../../../models';
1
+ import { ELightGalleryType, FileData, IJob, IJobAsset, IJobRecord, IPicture, Id } from '../../../models';
2
2
  import { AdminData, graphqlNormalize } from '../../types';
3
3
  export declare const REMOVE_JOB_ASSETS: import("@apollo/client").DocumentNode;
4
4
  export type IRemoveJobAssetsVar = {
@@ -24,3 +24,21 @@ export type ICreateJobAssetsVar = {
24
24
  inputs: IJobAssetInput[];
25
25
  };
26
26
  export type ICreateJobAssetsData = AdminData<(IJobAsset & graphqlNormalize)[], 'createJobAssets'>;
27
+ export interface IAssetInput {
28
+ file: File | FileData;
29
+ caption?: string | null;
30
+ name: string;
31
+ topicId?: Id;
32
+ sensitive: boolean;
33
+ overlay?: boolean;
34
+ }
35
+ export declare const CREATE_ASSETS: import("@apollo/client").DocumentNode;
36
+ export type ICreateAssetsVar = {
37
+ inputs: IAssetInput[];
38
+ };
39
+ export type ICreateAssetsData = AdminData<(IPicture & graphqlNormalize)[], 'createAssets'>;
40
+ export declare const REMOVE_ASSETS: import("@apollo/client").DocumentNode;
41
+ export type IRemoveAssetsVar = {
42
+ ids: Id[];
43
+ };
44
+ export type IRemoveAssetsData = AdminData<boolean, 'removeAssets'>;
@@ -1,5 +1,5 @@
1
1
  import { gql } from '@apollo/client';
2
- import { JOB_ASSET_FRAGMENT } from '../../fragments';
2
+ import { JOB_ASSET_FRAGMENT, PICTURE_FIELDS } from '../../fragments';
3
3
  export const REMOVE_JOB_ASSETS = gql `
4
4
  mutation RemoveJobAssets($unlink: Boolean, $ids: [ID!]!) {
5
5
  admin {
@@ -17,3 +17,20 @@ export const CREATE_JOB_ASSETS = gql `
17
17
  }
18
18
  }
19
19
  `;
20
+ export const CREATE_ASSETS = gql `
21
+ ${PICTURE_FIELDS}
22
+ mutation CreateAssets($inputs: [CreateAssetsInput!]!) {
23
+ admin {
24
+ createAssets(inputs: $inputs) {
25
+ ...PictureFields
26
+ }
27
+ }
28
+ }
29
+ `;
30
+ export const REMOVE_ASSETS = gql `
31
+ mutation RemoveAssets($ids: [ID!]!) {
32
+ admin {
33
+ removeAssets(ids: $ids)
34
+ }
35
+ }
36
+ `;
@@ -0,0 +1,16 @@
1
+ import { IChapter, Id } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export declare const UPDATE_CHAPTER: import("@apollo/client").DocumentNode;
4
+ export interface IAssetBinding {
5
+ id: Id;
6
+ index: number;
7
+ questionChoiceId?: Id;
8
+ deleted: boolean;
9
+ }
10
+ export interface IUpdateChapterVar {
11
+ id: Id;
12
+ explanation?: string;
13
+ summary?: string;
14
+ assets?: IAssetBinding[];
15
+ }
16
+ export type IUpdateChapterData = AdminData<graphqlNormalize & IChapter, 'updateChapter'>;
@@ -0,0 +1,12 @@
1
+ import { gql } from '@apollo/client';
2
+ import { CHAPTER_FIELDS } from '../../fragments';
3
+ export const UPDATE_CHAPTER = gql `
4
+ ${CHAPTER_FIELDS}
5
+ mutation updateChapter($input: UpdateChapterInput!) {
6
+ admin {
7
+ updateChapter(input: $input) {
8
+ ...ChapterFields
9
+ }
10
+ }
11
+ }
12
+ `;
@@ -1,6 +1,7 @@
1
1
  export * from './ai';
2
2
  export * from './algoliaSync';
3
3
  export * from './assets';
4
+ export * from './chapter';
4
5
  export * from './content';
5
6
  export * from './database';
6
7
  export * from './job';
@@ -1,6 +1,7 @@
1
1
  export * from './ai';
2
2
  export * from './algoliaSync';
3
3
  export * from './assets';
4
+ export * from './chapter';
4
5
  export * from './content';
5
6
  export * from './database';
6
7
  export * from './job';
@@ -31,3 +31,8 @@ export interface IManageQuestionCommentVar {
31
31
  operation: 'hide' | 'delete';
32
32
  }
33
33
  export type IManageQuestionCommentData = AdminData<graphqlNormalize & boolean, 'manageQuestionComment'>;
34
+ export declare const DELETE_QUESTIONS: import("@apollo/client").DocumentNode;
35
+ export interface IDeleteQuestionsVar {
36
+ ids: Id[];
37
+ }
38
+ export type IDeleteQuestionsData = AdminData<graphqlNormalize & boolean, 'deleteQuestions'>;
@@ -22,3 +22,10 @@ export const MANAGE_QUESTION_COMMENT = gql `
22
22
  }
23
23
  }
24
24
  `;
25
+ export const DELETE_QUESTIONS = gql `
26
+ mutation DeleteQuestions($ids: [ID!]!) {
27
+ admin {
28
+ deleteQuestions(ids: $ids)
29
+ }
30
+ }
31
+ `;
@@ -0,0 +1,7 @@
1
+ import { IChapter } from '../../../models';
2
+ import { AdminData, graphqlNormalize } from '../../types';
3
+ export interface IAdminChapterVar {
4
+ id: number;
5
+ }
6
+ export type IAdminChapterData = AdminData<graphqlNormalize & IChapter, 'chapter'>;
7
+ export declare const ADMIN_CHAPTER: import("@apollo/client").DocumentNode;
@@ -0,0 +1,19 @@
1
+ import { gql } from '@apollo/client';
2
+ import { PICTURE_FIELDS } from '../../fragments';
3
+ export const ADMIN_CHAPTER = gql `
4
+ ${PICTURE_FIELDS}
5
+ query AdminChapter($id: Int!) {
6
+ admin {
7
+ chapter(id: $id) {
8
+ id
9
+ explanation
10
+ summary
11
+ createdAt
12
+ updatedAt
13
+ pictures {
14
+ ...PictureFields
15
+ }
16
+ }
17
+ }
18
+ }
19
+ `;
@@ -1,3 +1,4 @@
1
+ export * from './chapter';
1
2
  export * from './dashboard';
2
3
  export * from './database';
3
4
  export * from './getUserToken';
@@ -1,3 +1,4 @@
1
+ export * from './chapter';
1
2
  export * from './dashboard';
2
3
  export * from './database';
3
4
  export * from './getUserToken';
@@ -1,5 +1,5 @@
1
- import { graphqlNormalize, RestrictedData } from '../../types';
2
1
  import { IChapter } from '../../../models';
2
+ import { graphqlNormalize, RestrictedData } from '../../types';
3
3
  export interface IChapterVar {
4
4
  id: number;
5
5
  }
@@ -5,6 +5,9 @@ export const CHAPTER = gql `
5
5
  chapter(id: $id) {
6
6
  id
7
7
  explanation
8
+ summary
9
+ createdAt
10
+ updatedAt
8
11
  }
9
12
  }
10
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quesmed/types",
3
- "version": "2.6.195",
3
+ "version": "2.6.197",
4
4
  "description": "Typescript types for Quesmed",
5
5
  "keywords": [
6
6
  "quesmed",