@quesmed/types-rn 2.6.166 → 2.6.168
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 +14 -0
- package/models/Job.js +2 -5
- package/package.json +1 -1
- package/resolvers/fragments/job.d.ts +1 -0
- package/resolvers/fragments/job.js +15 -1
- package/resolvers/mutation/admin/job.d.ts +16 -1
- package/resolvers/mutation/admin/job.js +24 -1
- package/resolvers/mutation/users.d.ts +8 -0
- package/resolvers/mutation/users.js +16 -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
|
@@ -145,10 +145,12 @@ export interface IJobMetaData {
|
|
|
145
145
|
productId: EProductType;
|
|
146
146
|
mockTest?: {
|
|
147
147
|
mockTestId: number;
|
|
148
|
+
isNew: boolean;
|
|
148
149
|
} | {
|
|
149
150
|
typeId: EMockTestType;
|
|
150
151
|
title: string;
|
|
151
152
|
passingMark: number;
|
|
153
|
+
isNew: boolean;
|
|
152
154
|
} | null;
|
|
153
155
|
question?: {
|
|
154
156
|
typeId: EQuestionType | null;
|
|
@@ -156,6 +158,15 @@ export interface IJobMetaData {
|
|
|
156
158
|
entitlementIds: EEntitlementType[] | null;
|
|
157
159
|
} | null;
|
|
158
160
|
}
|
|
161
|
+
export interface IJobChat {
|
|
162
|
+
id: string;
|
|
163
|
+
jobId: IJob['id'];
|
|
164
|
+
userId: IUser['id'];
|
|
165
|
+
user: Pick<IUser, 'id' | 'firstName' | 'lastName' | 'username' | 'accessLevel'>;
|
|
166
|
+
message: string;
|
|
167
|
+
createdAt: Date | number;
|
|
168
|
+
updatedAt: Date | number;
|
|
169
|
+
}
|
|
159
170
|
export interface IJob {
|
|
160
171
|
id: string;
|
|
161
172
|
name: string;
|
|
@@ -179,6 +190,7 @@ export interface IJob {
|
|
|
179
190
|
members: IJobMember[];
|
|
180
191
|
assets: IJobAsset[];
|
|
181
192
|
records: IJobRecord[];
|
|
193
|
+
chats: IJobChat[];
|
|
182
194
|
createdByUser: Pick<IUser, 'id' | 'firstName' | 'lastName' | 'username'>;
|
|
183
195
|
}
|
|
184
196
|
export declare const IsJobRecordQuestion: (record: IJobRecord['data']) => record is IJobRecordQuestion;
|
|
@@ -191,9 +203,11 @@ export declare const IsJobRecordStationByType: (type: EJobType, record: IJobReco
|
|
|
191
203
|
export declare const IsJobRecordChapterByType: (type: EJobType, record: IJobRecord['data']) => record is IJobRecordChapter;
|
|
192
204
|
export declare const isExistingMockTestMeta: (metadata: IJobMetaData['mockTest']) => metadata is {
|
|
193
205
|
mockTestId: number;
|
|
206
|
+
isNew: false;
|
|
194
207
|
};
|
|
195
208
|
export declare const isNewMockTestMeta: (metadata: IJobMetaData['mockTest']) => metadata is {
|
|
196
209
|
typeId: EMockTestType;
|
|
197
210
|
title: string;
|
|
198
211
|
passingMark: number;
|
|
212
|
+
isNew: true;
|
|
199
213
|
};
|
package/models/Job.js
CHANGED
|
@@ -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 {
|
|
@@ -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
|
+
`;
|
|
@@ -6,6 +6,14 @@ export interface ILoginAdminVar {
|
|
|
6
6
|
days: number;
|
|
7
7
|
}
|
|
8
8
|
export type ILoginAdminData = RootData<string, 'loginAdmin'>;
|
|
9
|
+
export declare const REGISTER_ADMIN: import("@apollo/client").DocumentNode;
|
|
10
|
+
export interface IRegisterAdminVar {
|
|
11
|
+
username: string;
|
|
12
|
+
password: string;
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string;
|
|
15
|
+
}
|
|
16
|
+
export type IRegisterAdminData = RootData<boolean, 'registerAdmin'>;
|
|
9
17
|
export declare const LOGIN_USER: import("@apollo/client").DocumentNode;
|
|
10
18
|
export interface ILoginUserVar {
|
|
11
19
|
username: string;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RESET_PASSWORD = exports.RESET_PASSWORD_PREP = exports.REGISTER_USER = exports.LOGIN_USER = exports.LOGIN_ADMIN = void 0;
|
|
3
|
+
exports.RESET_PASSWORD = exports.RESET_PASSWORD_PREP = exports.REGISTER_USER = exports.LOGIN_USER = exports.REGISTER_ADMIN = exports.LOGIN_ADMIN = void 0;
|
|
4
4
|
const client_1 = require("@apollo/client");
|
|
5
5
|
exports.LOGIN_ADMIN = (0, client_1.gql) `
|
|
6
6
|
mutation LoginAdmin($username: String!, $password: String!, $days: Int!) {
|
|
7
7
|
loginAdmin(username: $username, password: $password, days: $days)
|
|
8
8
|
}
|
|
9
9
|
`;
|
|
10
|
+
exports.REGISTER_ADMIN = (0, client_1.gql) `
|
|
11
|
+
mutation RegisterAdmin(
|
|
12
|
+
$username: String!
|
|
13
|
+
$password: String!
|
|
14
|
+
$firstName: String!
|
|
15
|
+
$lastName: String!
|
|
16
|
+
) {
|
|
17
|
+
registerAdmin(
|
|
18
|
+
username: $username
|
|
19
|
+
password: $password
|
|
20
|
+
firstName: $firstName
|
|
21
|
+
lastName: $lastName
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
10
25
|
exports.LOGIN_USER = (0, client_1.gql) `
|
|
11
26
|
mutation LoginUser($username: String!, $password: String!, $days: Int!) {
|
|
12
27
|
loginUser(username: $username, password: $password, days: $days)
|
|
@@ -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
|
+
`;
|