@quesmed/types-rn 2.6.167 → 2.6.169
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.
- package/models/Job.d.ts +17 -2
- package/models/Job.js +5 -8
- package/package.json +1 -1
- package/resolvers/fragments/job.d.ts +1 -0
- package/resolvers/fragments/job.js +16 -1
- package/resolvers/mutation/admin/job.d.ts +16 -1
- package/resolvers/mutation/admin/job.js +24 -1
- package/resolvers/query/admin/dashboard.d.ts +1 -0
- package/resolvers/query/admin/dashboard.js +2 -0
- package/resolvers/query/admin/job.d.ts +11 -1
- package/resolvers/query/admin/job.js +15 -1
package/models/Job.d.ts
CHANGED
|
@@ -16,8 +16,8 @@ export declare enum EJobStatus {
|
|
|
16
16
|
REJECTED = 4,
|
|
17
17
|
APPROVED = 5,
|
|
18
18
|
TESTING = 6,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
PARTIAL_TRIALING = 7,
|
|
20
|
+
PUBLISHED = 8,
|
|
21
21
|
CLOSED = 9
|
|
22
22
|
}
|
|
23
23
|
export declare enum EJobType {
|
|
@@ -93,6 +93,7 @@ export interface IJobAsset {
|
|
|
93
93
|
export interface IJobRecordQuestion {
|
|
94
94
|
question: string;
|
|
95
95
|
stem?: string | null;
|
|
96
|
+
stemFromRecordId?: IJobRecord['id'] | null;
|
|
96
97
|
conceptId?: number | null;
|
|
97
98
|
explanation?: string | null;
|
|
98
99
|
learningPoint?: string | null;
|
|
@@ -145,10 +146,12 @@ export interface IJobMetaData {
|
|
|
145
146
|
productId: EProductType;
|
|
146
147
|
mockTest?: {
|
|
147
148
|
mockTestId: number;
|
|
149
|
+
isNew: boolean;
|
|
148
150
|
} | {
|
|
149
151
|
typeId: EMockTestType;
|
|
150
152
|
title: string;
|
|
151
153
|
passingMark: number;
|
|
154
|
+
isNew: boolean;
|
|
152
155
|
} | null;
|
|
153
156
|
question?: {
|
|
154
157
|
typeId: EQuestionType | null;
|
|
@@ -156,6 +159,15 @@ export interface IJobMetaData {
|
|
|
156
159
|
entitlementIds: EEntitlementType[] | null;
|
|
157
160
|
} | null;
|
|
158
161
|
}
|
|
162
|
+
export interface IJobChat {
|
|
163
|
+
id: string;
|
|
164
|
+
jobId: IJob['id'];
|
|
165
|
+
userId: IUser['id'];
|
|
166
|
+
user: Pick<IUser, 'id' | 'firstName' | 'lastName' | 'username' | 'accessLevel'>;
|
|
167
|
+
message: string;
|
|
168
|
+
createdAt: Date | number;
|
|
169
|
+
updatedAt: Date | number;
|
|
170
|
+
}
|
|
159
171
|
export interface IJob {
|
|
160
172
|
id: string;
|
|
161
173
|
name: string;
|
|
@@ -179,6 +191,7 @@ export interface IJob {
|
|
|
179
191
|
members: IJobMember[];
|
|
180
192
|
assets: IJobAsset[];
|
|
181
193
|
records: IJobRecord[];
|
|
194
|
+
chats: IJobChat[];
|
|
182
195
|
createdByUser: Pick<IUser, 'id' | 'firstName' | 'lastName' | 'username'>;
|
|
183
196
|
}
|
|
184
197
|
export declare const IsJobRecordQuestion: (record: IJobRecord['data']) => record is IJobRecordQuestion;
|
|
@@ -191,9 +204,11 @@ export declare const IsJobRecordStationByType: (type: EJobType, record: IJobReco
|
|
|
191
204
|
export declare const IsJobRecordChapterByType: (type: EJobType, record: IJobRecord['data']) => record is IJobRecordChapter;
|
|
192
205
|
export declare const isExistingMockTestMeta: (metadata: IJobMetaData['mockTest']) => metadata is {
|
|
193
206
|
mockTestId: number;
|
|
207
|
+
isNew: false;
|
|
194
208
|
};
|
|
195
209
|
export declare const isNewMockTestMeta: (metadata: IJobMetaData['mockTest']) => metadata is {
|
|
196
210
|
typeId: EMockTestType;
|
|
197
211
|
title: string;
|
|
198
212
|
passingMark: number;
|
|
213
|
+
isNew: true;
|
|
199
214
|
};
|
package/models/Job.js
CHANGED
|
@@ -22,10 +22,10 @@ var EJobStatus;
|
|
|
22
22
|
EJobStatus[EJobStatus["APPROVED"] = 5] = "APPROVED";
|
|
23
23
|
//In QA, testing, or limited release
|
|
24
24
|
EJobStatus[EJobStatus["TESTING"] = 6] = "TESTING";
|
|
25
|
-
// Final version is live and visible
|
|
26
|
-
EJobStatus[EJobStatus["PUBLISHED"] = 7] = "PUBLISHED";
|
|
27
25
|
//Partial batch, some content is live
|
|
28
|
-
EJobStatus[EJobStatus["PARTIAL_TRIALING"] =
|
|
26
|
+
EJobStatus[EJobStatus["PARTIAL_TRIALING"] = 7] = "PARTIAL_TRIALING";
|
|
27
|
+
// Final version is live and visible
|
|
28
|
+
EJobStatus[EJobStatus["PUBLISHED"] = 8] = "PUBLISHED";
|
|
29
29
|
//Closed, revision not allowed
|
|
30
30
|
EJobStatus[EJobStatus["CLOSED"] = 9] = "CLOSED";
|
|
31
31
|
})(EJobStatus = exports.EJobStatus || (exports.EJobStatus = {}));
|
|
@@ -123,13 +123,10 @@ const IsJobRecordChapterByType = (type, record) => {
|
|
|
123
123
|
};
|
|
124
124
|
exports.IsJobRecordChapterByType = IsJobRecordChapterByType;
|
|
125
125
|
const isExistingMockTestMeta = (metadata) => {
|
|
126
|
-
return
|
|
127
|
-
typeof metadata === 'object' &&
|
|
128
|
-
'mockTestId' in metadata &&
|
|
129
|
-
metadata.mockTestId !== null);
|
|
126
|
+
return !!metadata && typeof metadata === 'object' && metadata.isNew === false;
|
|
130
127
|
};
|
|
131
128
|
exports.isExistingMockTestMeta = isExistingMockTestMeta;
|
|
132
129
|
const isNewMockTestMeta = (metadata) => {
|
|
133
|
-
return !!metadata && typeof metadata === 'object' &&
|
|
130
|
+
return !!metadata && typeof metadata === 'object' && metadata.isNew === true;
|
|
134
131
|
};
|
|
135
132
|
exports.isNewMockTestMeta = isNewMockTestMeta;
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ export declare const JOB_STATUS_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
|
2
2
|
export declare const JOB_META_DATA_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
3
3
|
export declare const JOB_FIELDS_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
4
4
|
export declare const JOB_USER_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
5
|
+
export declare const JOB_CHAT_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
5
6
|
export declare const JOB_REMARK_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
6
7
|
export declare const JOB_RECORD_QUESTION_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
7
8
|
export declare const JOB_RECORD_CHAPTER_FRAGMENT: import("@apollo/client").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FULL_JOB_FRAGMENT = exports.LIMITED_JOB_FRAGMENT = exports.LIST_JOB_FRAGMENT = exports.JOB_ASSETS_FRAGMENT = exports.JOB_MEMBER_FRAGMENT = exports.JOB_RECORD_FRAGMENT = exports.JOB_RECORD_STATUS_FRAGMENT = exports.JOB_RECORD_MOCK_TEST_FRAGMENT = exports.JOB_RECORD_STATION_FRAGMENT = exports.JOB_RECORD_CHAPTER_FRAGMENT = exports.JOB_RECORD_QUESTION_FRAGMENT = exports.JOB_REMARK_FRAGMENT = exports.JOB_USER_FRAGMENT = exports.JOB_FIELDS_FRAGMENT = exports.JOB_META_DATA_FRAGMENT = exports.JOB_STATUS_FRAGMENT = void 0;
|
|
3
|
+
exports.FULL_JOB_FRAGMENT = exports.LIMITED_JOB_FRAGMENT = exports.LIST_JOB_FRAGMENT = exports.JOB_ASSETS_FRAGMENT = exports.JOB_MEMBER_FRAGMENT = exports.JOB_RECORD_FRAGMENT = exports.JOB_RECORD_STATUS_FRAGMENT = exports.JOB_RECORD_MOCK_TEST_FRAGMENT = exports.JOB_RECORD_STATION_FRAGMENT = exports.JOB_RECORD_CHAPTER_FRAGMENT = exports.JOB_RECORD_QUESTION_FRAGMENT = exports.JOB_REMARK_FRAGMENT = exports.JOB_CHAT_FRAGMENT = exports.JOB_USER_FRAGMENT = exports.JOB_FIELDS_FRAGMENT = exports.JOB_META_DATA_FRAGMENT = exports.JOB_STATUS_FRAGMENT = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
exports.JOB_STATUS_FRAGMENT = (0, client_1.gql) `
|
|
6
6
|
fragment JobStatus on Job {
|
|
@@ -18,6 +18,7 @@ exports.JOB_META_DATA_FRAGMENT = (0, client_1.gql) `
|
|
|
18
18
|
mockTest {
|
|
19
19
|
mockTestId
|
|
20
20
|
typeId
|
|
21
|
+
isNew
|
|
21
22
|
title
|
|
22
23
|
passingMark
|
|
23
24
|
}
|
|
@@ -45,6 +46,19 @@ exports.JOB_USER_FRAGMENT = (0, client_1.gql) `
|
|
|
45
46
|
lastName
|
|
46
47
|
}
|
|
47
48
|
`;
|
|
49
|
+
exports.JOB_CHAT_FRAGMENT = (0, client_1.gql) `
|
|
50
|
+
${exports.JOB_USER_FRAGMENT}
|
|
51
|
+
fragment JobChat on JobChat {
|
|
52
|
+
id
|
|
53
|
+
jobId
|
|
54
|
+
message
|
|
55
|
+
createdAt
|
|
56
|
+
updatedAt
|
|
57
|
+
user {
|
|
58
|
+
...JobUser
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
48
62
|
exports.JOB_REMARK_FRAGMENT = (0, client_1.gql) `
|
|
49
63
|
${exports.JOB_USER_FRAGMENT}
|
|
50
64
|
fragment JobRemark on JobRemark {
|
|
@@ -67,6 +81,7 @@ exports.JOB_RECORD_QUESTION_FRAGMENT = (0, client_1.gql) `
|
|
|
67
81
|
fragment JobRecordQuestion on JobRecordQuestion {
|
|
68
82
|
question
|
|
69
83
|
stem
|
|
84
|
+
stemFromRecordId
|
|
70
85
|
conceptId
|
|
71
86
|
typeId
|
|
72
87
|
answer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IJob, IJobMember, IJobRecord, IJobRecordChapter, IJobRecordMockTest, IJobRecordQuestion, IJobRecordStation, IJobRemark } from '../../../models';
|
|
1
|
+
import { IJob, IJobChat, IJobMember, IJobRecord, IJobRecordChapter, IJobRecordMockTest, IJobRecordQuestion, IJobRecordStation, IJobRemark } from '../../../models';
|
|
2
2
|
import { AdminData } from '../../types';
|
|
3
3
|
export declare const CREATE_JOB: import("@apollo/client").DocumentNode;
|
|
4
4
|
export type ICreateJobInput = {
|
|
@@ -102,3 +102,18 @@ export type IUpdateJobRecordStatusVar = {
|
|
|
102
102
|
status: IJobRecord['status'];
|
|
103
103
|
};
|
|
104
104
|
export type IUpdateJobRecordStatusData = AdminData<IJobRecord[], 'updateJobRecordStatus'>;
|
|
105
|
+
export declare const CREATE_JOB_CHAT: import("@apollo/client").DocumentNode;
|
|
106
|
+
export type ICreateJobChatVar = {
|
|
107
|
+
input: Pick<IJobChat, 'jobId' | 'message' | 'userId'>;
|
|
108
|
+
};
|
|
109
|
+
export type ICreateJobChatData = AdminData<IJobChat, 'createJobChat'>;
|
|
110
|
+
export declare const DELETE_JOB_CHAT: import("@apollo/client").DocumentNode;
|
|
111
|
+
export type IDeleteJobChatVar = {
|
|
112
|
+
id: IJobChat['id'];
|
|
113
|
+
};
|
|
114
|
+
export type IDeleteJobChatData = AdminData<boolean, 'deleteJobChat'>;
|
|
115
|
+
export declare const DELETE_JOB_CHATS: import("@apollo/client").DocumentNode;
|
|
116
|
+
export type IDeleteJobChatsVar = {
|
|
117
|
+
jobId: IJobChat['jobId'];
|
|
118
|
+
};
|
|
119
|
+
export type IDeleteJobChatsData = AdminData<boolean, 'deleteJobChats'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UPDATE_JOB_RECORD_STATUS = exports.DUPLICATE_JOB_RECORD = exports.UPDATE_JOB_RECORD = exports.DELETE_JOB_RECORD = exports.CREATE_JOB_RECORD = exports.DELETE_JOB_REMARK = exports.UPDATE_JOB_REMARK = exports.CREATE_JOB_REMARK = exports.DELETE_JOB = exports.UPDATE_JOB_STATUS = exports.DUPLICATE_JOB = exports.UPDATE_JOB = exports.CREATE_JOB = void 0;
|
|
3
|
+
exports.DELETE_JOB_CHATS = exports.DELETE_JOB_CHAT = exports.CREATE_JOB_CHAT = exports.UPDATE_JOB_RECORD_STATUS = exports.DUPLICATE_JOB_RECORD = exports.UPDATE_JOB_RECORD = exports.DELETE_JOB_RECORD = exports.CREATE_JOB_RECORD = exports.DELETE_JOB_REMARK = exports.UPDATE_JOB_REMARK = exports.CREATE_JOB_REMARK = exports.DELETE_JOB = exports.UPDATE_JOB_STATUS = exports.DUPLICATE_JOB = exports.UPDATE_JOB = exports.CREATE_JOB = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const fragments_1 = require("../../fragments");
|
|
6
6
|
exports.CREATE_JOB = (0, client_1.gql) `
|
|
@@ -124,3 +124,26 @@ exports.UPDATE_JOB_RECORD_STATUS = (0, client_1.gql) `
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
`;
|
|
127
|
+
exports.CREATE_JOB_CHAT = (0, client_1.gql) `
|
|
128
|
+
mutation CreateJobChat($input: CreateJobChatInput!) {
|
|
129
|
+
admin {
|
|
130
|
+
createJobChat(input: $input) {
|
|
131
|
+
id
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
exports.DELETE_JOB_CHAT = (0, client_1.gql) `
|
|
137
|
+
mutation DeleteJobChat($id: ID!) {
|
|
138
|
+
admin {
|
|
139
|
+
deleteJobChat(id: $id)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
exports.DELETE_JOB_CHATS = (0, client_1.gql) `
|
|
144
|
+
mutation DeleteJobChats($jobId: ID!) {
|
|
145
|
+
admin {
|
|
146
|
+
deleteJobChats(jobId: $jobId)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
@@ -364,6 +364,7 @@ exports.DROPDOWN_OPTIONS = (0, client_1.gql) `
|
|
|
364
364
|
$force: Boolean!
|
|
365
365
|
$entitlementIds: [Int!]
|
|
366
366
|
$topicIds: [Int!]
|
|
367
|
+
$productId: Int
|
|
367
368
|
) {
|
|
368
369
|
admin {
|
|
369
370
|
dropdownOptions(
|
|
@@ -372,6 +373,7 @@ exports.DROPDOWN_OPTIONS = (0, client_1.gql) `
|
|
|
372
373
|
table: $table
|
|
373
374
|
entitlementIds: $entitlementIds
|
|
374
375
|
topicIds: $topicIds
|
|
376
|
+
productId: $productId
|
|
375
377
|
) {
|
|
376
378
|
key
|
|
377
379
|
value
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EJobStatus, IJob, IJobRecord, IJobRemark, Id } from '../../../models';
|
|
1
|
+
import { EJobStatus, IJob, IJobChat, IJobRecord, IJobRemark, Id } from '../../../models';
|
|
2
2
|
import { AdminData } from '../../types';
|
|
3
3
|
export declare const GET_JOB: import("@apollo/client").DocumentNode;
|
|
4
4
|
export type IGetJobVar = {
|
|
@@ -48,3 +48,13 @@ export type IGetIdDetailsData = AdminData<Array<{
|
|
|
48
48
|
name: string;
|
|
49
49
|
}>, 'getIdDetails'>;
|
|
50
50
|
export declare const GET_ID_DETAILS: import("@apollo/client").DocumentNode;
|
|
51
|
+
export declare const GET_JOB_CHATS: import("@apollo/client").DocumentNode;
|
|
52
|
+
export type IGetJobChatsVar = {
|
|
53
|
+
jobId: IJob['id'];
|
|
54
|
+
};
|
|
55
|
+
export type IJobChatList = {
|
|
56
|
+
chats: IJobChat[];
|
|
57
|
+
date: Date | number;
|
|
58
|
+
total: number;
|
|
59
|
+
};
|
|
60
|
+
export type IGetJobChatsData = AdminData<IJobChatList[], 'getJobChats'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_ID_DETAILS = exports.GET_JOB_RECORD = exports.GET_JOB_RECORDS = exports.GET_JOB_REMARKS = exports.GET_JOBS = exports.GET_JOB = void 0;
|
|
3
|
+
exports.GET_JOB_CHATS = exports.GET_ID_DETAILS = exports.GET_JOB_RECORD = exports.GET_JOB_RECORDS = exports.GET_JOB_REMARKS = exports.GET_JOBS = exports.GET_JOB = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
const fragments_1 = require("../../fragments");
|
|
6
6
|
exports.GET_JOB = (0, client_1.gql) `
|
|
@@ -70,3 +70,17 @@ exports.GET_ID_DETAILS = (0, client_1.gql) `
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
`;
|
|
73
|
+
exports.GET_JOB_CHATS = (0, client_1.gql) `
|
|
74
|
+
${fragments_1.JOB_CHAT_FRAGMENT}
|
|
75
|
+
query GetJobChats($jobId: ID!) {
|
|
76
|
+
admin {
|
|
77
|
+
getJobChats(jobId: $jobId) {
|
|
78
|
+
chats {
|
|
79
|
+
...JobChat
|
|
80
|
+
}
|
|
81
|
+
date
|
|
82
|
+
total
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`;
|