@hapl/api-queries 0.2.13 → 0.2.14--canary.134.eee23e4.0
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/CHANGELOG.md +0 -12
- package/dist/api-queries.cjs.development.js +3352 -1636
- package/dist/api-queries.cjs.development.js.map +1 -1
- package/dist/api-queries.cjs.production.min.js +1 -1
- package/dist/api-queries.cjs.production.min.js.map +1 -1
- package/dist/api-queries.esm.js +3352 -1636
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/buyer/closeBuyer/index.d.ts +37 -0
- package/dist/clients/v1/api/buyer/findBuyerById/index.d.ts +33 -0
- package/dist/clients/v1/api/buyer/findBuyerStatuses/index.d.ts +36 -0
- package/dist/clients/v1/api/buyer/findBuyerUniquePhones/index.d.ts +23 -0
- package/dist/clients/v1/api/buyer/findBuyers/index.d.ts +15 -2
- package/dist/clients/v1/api/buyer/resetBuyerStatusTimer/index.d.ts +29 -0
- package/dist/clients/v1/api/buyer/shareBuyer/index.d.ts +33 -0
- package/dist/clients/v1/api/buyer/updateBuyer/index.d.ts +38 -0
- package/dist/clients/v1/api/call/createCallComment/index.d.ts +33 -0
- package/dist/clients/v1/api/call/findCallById/index.d.ts +29 -0
- package/dist/clients/v1/api/callTask/callCallTask.d.ts +29 -0
- package/dist/clients/v1/api/callTask/closeCallTask.d.ts +35 -0
- package/dist/clients/v1/api/callTask/findCallQualityAssessors.d.ts +35 -0
- package/dist/clients/v1/api/callTask/findCallTaskById.d.ts +29 -0
- package/dist/clients/v1/api/callTask/findCallTasks.d.ts +9 -3
- package/dist/clients/v1/api/callTask/updateCallTask.d.ts +24 -0
- package/dist/clients/v1/api/comment/findComments/index.d.ts +41 -0
- package/dist/clients/v1/api/deal/findDealExpertStatistics/index.d.ts +39 -0
- package/dist/clients/v1/api/index.d.ts +34 -7
- package/dist/clients/v1/api/messenger/findMessengerInviteLinks/index.d.ts +31 -0
- package/dist/clients/v1/api/motivationCalculator/createMotivationCalculatorRequest/index.d.ts +37 -0
- package/dist/clients/v1/api/motivationGlossary/findMotivationStatus/index.d.ts +29 -0
- package/dist/clients/v1/api/motivationStatus/findMotivationStatus/index.d.ts +35 -0
- package/dist/clients/v1/api/payslip/findPayslipById.d.ts +29 -0
- package/dist/clients/v1/api/payslip/findPayslips.d.ts +56 -0
- package/dist/clients/v1/api/payslip/updatePayslip.d.ts +35 -0
- package/dist/clients/v1/api/realty/findRealtyPriceHistory/index.d.ts +39 -0
- package/dist/clients/v1/api/serviceRequest/buyer/findBuyerRejectionReasonStatistic/index.d.ts +36 -0
- package/dist/clients/v1/api/serviceRequest/buyer/findBuyerStatusStatistic/index.d.ts +40 -0
- package/dist/clients/v1/api/serviceRequest/createServiceRequestSellerReport/index.d.ts +31 -0
- package/dist/clients/v1/api/serviceRequest/findServiceRequestCategoryById/index.d.ts +44 -0
- package/dist/clients/v1/dictionaries/CallTask.d.ts +4 -0
- package/dist/clients/v1/index.d.ts +27 -0
- package/dist/clients/v1/types/Buyer.d.ts +6 -0
- package/dist/clients/v1/types/BuyerStatusHistory.d.ts +11 -0
- package/dist/clients/v1/types/Call.d.ts +2 -2
- package/dist/clients/v1/types/CallTask.d.ts +5 -0
- package/dist/clients/v1/types/Comment.d.ts +11 -0
- package/dist/clients/v1/types/Motivation.d.ts +58 -0
- package/dist/clients/v1/types/Payslip.d.ts +61 -0
- package/dist/clients/v1/types/PriceHistory.d.ts +9 -0
- package/dist/clients/v1/types/index.d.ts +6 -1
- package/package.json +1 -1
- package/src/clients/v1/api/buyer/closeBuyer/index.ts +47 -0
- package/src/clients/v1/api/buyer/findBuyerById/index.ts +48 -0
- package/src/clients/v1/api/buyer/findBuyerStatuses/index.ts +61 -0
- package/src/clients/v1/api/buyer/findBuyerUniquePhones/index.ts +51 -0
- package/src/clients/v1/api/buyer/findBuyers/index.ts +17 -2
- package/src/clients/v1/api/buyer/resetBuyerStatusTimer/index.ts +42 -0
- package/src/clients/v1/api/buyer/shareBuyer/index.ts +40 -0
- package/src/clients/v1/api/buyer/updateBuyer/index.ts +48 -0
- package/src/clients/v1/api/call/createCallComment/index.ts +41 -0
- package/src/clients/v1/api/call/findCallById/index.ts +39 -0
- package/src/clients/v1/api/callTask/callCallTask.ts +46 -0
- package/src/clients/v1/api/callTask/closeCallTask.ts +45 -0
- package/src/clients/v1/api/callTask/findCallQualityAssessors.ts +59 -0
- package/src/clients/v1/api/callTask/findCallTaskById.ts +39 -0
- package/src/clients/v1/api/callTask/findCallTasks.ts +6 -3
- package/src/clients/v1/api/callTask/updateCallTask.ts +49 -0
- package/src/clients/v1/api/comment/findComments/index.ts +54 -0
- package/src/clients/v1/api/deal/findDealExpertStatistics/index.ts +43 -0
- package/src/clients/v1/api/index.ts +37 -7
- package/src/clients/v1/api/messenger/findMessengerInviteLinks/index.ts +40 -0
- package/src/clients/v1/api/motivationCalculator/createMotivationCalculatorRequest/index.ts +48 -0
- package/src/clients/v1/api/motivationGlossary/findMotivationStatus/index.ts +38 -0
- package/src/clients/v1/api/motivationStatus/findMotivationStatus/index.ts +47 -0
- package/src/clients/v1/api/payslip/findPayslipById.ts +39 -0
- package/src/clients/v1/api/payslip/findPayslips.ts +53 -0
- package/src/clients/v1/api/payslip/updatePayslip.ts +45 -0
- package/src/clients/v1/api/realty/findRealtyPriceHistory/index.ts +43 -0
- package/src/clients/v1/api/serviceRequest/buyer/findBuyerRejectionReasonStatistic/index.ts +44 -0
- package/src/clients/v1/api/serviceRequest/buyer/findBuyerStatusStatistic/index.ts +48 -0
- package/src/clients/v1/api/serviceRequest/createServiceRequestSellerReport/index.ts +42 -0
- package/src/clients/v1/api/serviceRequest/findServiceRequestCategoryById/index.ts +48 -0
- package/src/clients/v1/dictionaries/CallTask.ts +4 -0
- package/src/clients/v1/index.ts +223 -5
- package/src/clients/v1/types/Buyer.ts +7 -0
- package/src/clients/v1/types/BuyerStatusHistory.ts +12 -0
- package/src/clients/v1/types/Call.ts +2 -2
- package/src/clients/v1/types/CallTask.ts +5 -0
- package/src/clients/v1/types/Comment.ts +10 -0
- package/src/clients/v1/types/Motivation.ts +64 -0
- package/src/clients/v1/types/Payslip.ts +62 -0
- package/src/clients/v1/types/PriceHistory.ts +7 -0
- package/src/clients/v1/types/index.ts +6 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
|
|
3
|
+
type SuccessData = { success: true; data: null };
|
|
4
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
5
|
+
|
|
6
|
+
type ResultData = SuccessData['data'];
|
|
7
|
+
type ResultError = ErrorData['data']['error'];
|
|
8
|
+
|
|
9
|
+
export type ShareBuyerUrlParams = { id: number };
|
|
10
|
+
export type ShareBuyerHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type ShareBuyerBody = { serviceRequestId: number; comment?: string };
|
|
12
|
+
export type ShareBuyerData = AxiosResponse<ResultData>;
|
|
13
|
+
export type ShareBuyerError = AxiosError<ResultError>;
|
|
14
|
+
export type ShareBuyerConfig = {
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
urlParams: ShareBuyerUrlParams;
|
|
17
|
+
headers: ShareBuyerHeaders;
|
|
18
|
+
body: ShareBuyerBody;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function shareBuyerRequest({
|
|
22
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
23
|
+
urlParams,
|
|
24
|
+
body,
|
|
25
|
+
headers,
|
|
26
|
+
}: ShareBuyerConfig) {
|
|
27
|
+
return axios
|
|
28
|
+
.put(`/api/buyer/${urlParams.id}/share`, body, {
|
|
29
|
+
baseURL,
|
|
30
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
31
|
+
transformResponse: [
|
|
32
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
33
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? null : data.data.error),
|
|
34
|
+
],
|
|
35
|
+
})
|
|
36
|
+
.then((res: ShareBuyerData) => res)
|
|
37
|
+
.catch((err: ShareBuyerError) => {
|
|
38
|
+
throw err;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Buyer, BuyerStatus } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Buyer };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type UpdateBuyerUrlParams = { id: number };
|
|
11
|
+
export type UpdateBuyerHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type UpdateBuyerData = AxiosResponse<ResultData>;
|
|
13
|
+
export type UpdateBuyerError = AxiosError<ResultError>;
|
|
14
|
+
export type UpdateBuyerBody = {
|
|
15
|
+
name?: string;
|
|
16
|
+
status?: BuyerStatus;
|
|
17
|
+
comment?: string;
|
|
18
|
+
realtyShow?: {
|
|
19
|
+
scheduledAt: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type UpdateBuyerConfig = {
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
urlParams: UpdateBuyerUrlParams;
|
|
25
|
+
headers: UpdateBuyerHeaders;
|
|
26
|
+
body: UpdateBuyerBody;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function updateBuyerRequest({
|
|
30
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
31
|
+
body,
|
|
32
|
+
urlParams,
|
|
33
|
+
headers,
|
|
34
|
+
}: UpdateBuyerConfig) {
|
|
35
|
+
return axios
|
|
36
|
+
.put(`/api/buyer/${urlParams.id}`, body, {
|
|
37
|
+
baseURL,
|
|
38
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
39
|
+
transformResponse: [
|
|
40
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
41
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
42
|
+
],
|
|
43
|
+
})
|
|
44
|
+
.then((res: UpdateBuyerData) => res)
|
|
45
|
+
.catch((err: UpdateBuyerError) => {
|
|
46
|
+
throw err;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Call } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Call };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CreateCallCommentHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type CreateCallCommentUrlParams = { id: number };
|
|
12
|
+
export type CreateCallCommentBody = { comment: string };
|
|
13
|
+
export type CreateCallCommentData = AxiosResponse<ResultData>;
|
|
14
|
+
export type CreateCallCommentError = AxiosError<ResultError>;
|
|
15
|
+
export type CreateCallCommentConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
headers: CreateCallCommentHeaders;
|
|
18
|
+
body: CreateCallCommentBody;
|
|
19
|
+
urlParams: CreateCallCommentUrlParams;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function createCallCommentRequest({
|
|
23
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
+
body,
|
|
25
|
+
headers,
|
|
26
|
+
urlParams,
|
|
27
|
+
}: CreateCallCommentConfig) {
|
|
28
|
+
return axios
|
|
29
|
+
.post(`/api/call/${urlParams.id}/comment`, body, {
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
32
|
+
transformResponse: [
|
|
33
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
34
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data?.data : data.data?.error),
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
.then((res: CreateCallCommentData) => res)
|
|
38
|
+
.catch((err: CreateCallCommentError) => {
|
|
39
|
+
throw err;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Call } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Call };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type FindCallByIdUrlParams = { id: number };
|
|
11
|
+
export type FindCallByIdHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type FindCallByIdData = AxiosResponse<ResultData>;
|
|
13
|
+
export type FindCallByIdError = AxiosError<ResultError>;
|
|
14
|
+
|
|
15
|
+
export type FindCallByIdConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
urlParams: FindCallByIdUrlParams;
|
|
18
|
+
headers: FindCallByIdHeaders;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function findCallByIdRequest({
|
|
22
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
23
|
+
urlParams,
|
|
24
|
+
headers,
|
|
25
|
+
}: FindCallByIdConfig) {
|
|
26
|
+
return axios
|
|
27
|
+
.get(`/api/calls/${urlParams.id}`, {
|
|
28
|
+
baseURL,
|
|
29
|
+
headers: { Accept: 'application/json', ...headers },
|
|
30
|
+
transformResponse: [
|
|
31
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
32
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
.then((res: FindCallByIdData) => res)
|
|
36
|
+
.catch((err: FindCallByIdError) => {
|
|
37
|
+
throw err;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Call } from '../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Call };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CallCallTaskHeaders = { 'x-auth-hc'?: string };
|
|
11
|
+
export type CallCallTaskUrlParams = { id: number };
|
|
12
|
+
export type CallCallTaskData = AxiosResponse<ResultData>;
|
|
13
|
+
export type CallCallTaskError = AxiosError<ResultError>;
|
|
14
|
+
export type CallCallTaskConfig = {
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
headers?: CallCallTaskHeaders;
|
|
17
|
+
urlParams: CallCallTaskUrlParams;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function callCallTaskRequest({
|
|
21
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
22
|
+
urlParams,
|
|
23
|
+
headers,
|
|
24
|
+
}: CallCallTaskConfig) {
|
|
25
|
+
return axios
|
|
26
|
+
.post(
|
|
27
|
+
`/api/calls/task/callback/${urlParams.id}`,
|
|
28
|
+
{},
|
|
29
|
+
{
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
32
|
+
transformResponse: [
|
|
33
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
34
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
35
|
+
if (data.success) return data.data;
|
|
36
|
+
|
|
37
|
+
return data.data.error;
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
.then((res: CallCallTaskData) => res)
|
|
43
|
+
.catch((err: CallCallTaskError) => {
|
|
44
|
+
throw err;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { CallTask } from '../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: CallTask };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type CloseCallTaskHeaders = { 'x-auth-hc'?: string };
|
|
11
|
+
export type CloseCallTaskUrlParams = { id: number };
|
|
12
|
+
export type CloseCallTaskBody = { tags?: string[]; closingReason?: string; comment?: string };
|
|
13
|
+
export type CloseCallTaskData = AxiosResponse<ResultData>;
|
|
14
|
+
export type CloseCallTaskError = AxiosError<ResultError>;
|
|
15
|
+
export type CloseCallTaskConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
headers?: CloseCallTaskHeaders;
|
|
18
|
+
urlParams: CloseCallTaskUrlParams;
|
|
19
|
+
body: CloseCallTaskBody;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function closeCallTaskRequest({
|
|
23
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
+
urlParams,
|
|
25
|
+
headers,
|
|
26
|
+
body,
|
|
27
|
+
}: CloseCallTaskConfig) {
|
|
28
|
+
return axios
|
|
29
|
+
.put(`/api/calls/task/close/${urlParams.id}`, body, {
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
32
|
+
transformResponse: [
|
|
33
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
34
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
35
|
+
if (data.success) return data.data;
|
|
36
|
+
|
|
37
|
+
return data.data.error;
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
})
|
|
41
|
+
.then((res: CloseCallTaskData) => res)
|
|
42
|
+
.catch((err: CloseCallTaskError) => {
|
|
43
|
+
throw err;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { Call } from '../../types';
|
|
4
|
+
|
|
5
|
+
type SuccessData = { success: true; data: Call[]; pageParams: { page: number; length: number } };
|
|
6
|
+
type ErrorData = { success: false; data: Record<'error' | 'message', string> };
|
|
7
|
+
|
|
8
|
+
type ResultData = { ids: number[]; byId: Record<string, Call>; meta: { total: number } };
|
|
9
|
+
type ResultError = string;
|
|
10
|
+
|
|
11
|
+
export type FindCallQualityAssessorsHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type FindCallQualityAssessorsParams = {
|
|
13
|
+
filter?: { 'to.number'?: string };
|
|
14
|
+
limits?: { page?: number; count: number | 'all' };
|
|
15
|
+
sorting?: { direction: 'asc' | 'desc'; type: 'createdAt' };
|
|
16
|
+
};
|
|
17
|
+
export type FindCallQualityAssessorsData = AxiosResponse<ResultData>;
|
|
18
|
+
export type FindCallQualityAssessorsError = AxiosError<ResultError>;
|
|
19
|
+
export type FindCallQualityAssessorsConfig = {
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
headers: FindCallQualityAssessorsHeaders;
|
|
22
|
+
params: FindCallQualityAssessorsParams;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function findCallQualityAssessorsRequest({
|
|
26
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
27
|
+
headers,
|
|
28
|
+
params,
|
|
29
|
+
}: FindCallQualityAssessorsConfig) {
|
|
30
|
+
return axios
|
|
31
|
+
.get('/api/calls/quality-assessor', {
|
|
32
|
+
baseURL,
|
|
33
|
+
params,
|
|
34
|
+
paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
|
|
35
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
36
|
+
transformResponse: [
|
|
37
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
38
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
39
|
+
if (data.success) {
|
|
40
|
+
const ids: ResultData['ids'] = [];
|
|
41
|
+
const byId: ResultData['byId'] = {};
|
|
42
|
+
|
|
43
|
+
data.data.forEach(entity => {
|
|
44
|
+
byId[entity.id] = entity;
|
|
45
|
+
ids.push(entity.id);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return { ids, byId, meta: { total: data.pageParams.length } };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return data.data.error || data.data.message;
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
})
|
|
55
|
+
.then((res: FindCallQualityAssessorsData) => res)
|
|
56
|
+
.catch((err: FindCallQualityAssessorsError) => {
|
|
57
|
+
throw err;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { CallTask } from '../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: CallTask };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type FindCallTaskByIdUrlParams = { id: number };
|
|
11
|
+
export type FindCallTaskByIdHeaders = { 'x-auth-hc': string };
|
|
12
|
+
export type FindCallTaskByIdData = AxiosResponse<ResultData>;
|
|
13
|
+
export type FindCallTaskByIdError = AxiosError<ResultError>;
|
|
14
|
+
|
|
15
|
+
export type FindCallTaskByIdConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
urlParams: FindCallTaskByIdUrlParams;
|
|
18
|
+
headers: FindCallTaskByIdHeaders;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function findCallTaskByIdRequest({
|
|
22
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
23
|
+
urlParams,
|
|
24
|
+
headers,
|
|
25
|
+
}: FindCallTaskByIdConfig) {
|
|
26
|
+
return axios
|
|
27
|
+
.get(`/api/calls/task/${urlParams.id}`, {
|
|
28
|
+
baseURL,
|
|
29
|
+
headers: { Accept: 'application/json', ...headers },
|
|
30
|
+
transformResponse: [
|
|
31
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
32
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
.then((res: FindCallTaskByIdData) => res)
|
|
36
|
+
.catch((err: FindCallTaskByIdError) => {
|
|
37
|
+
throw err;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
2
|
import qs from 'qs';
|
|
3
|
-
import { CallTask, CallTaskStatus } from '../../types';
|
|
3
|
+
import { CallTask, CallTaskStatus, CallTaskTriggeredByEvent } from '../../types';
|
|
4
4
|
|
|
5
5
|
type Data = Partial<CallTask> & Required<Pick<CallTask, 'id' | 'status' | 'createdAt'>>;
|
|
6
6
|
|
|
@@ -13,11 +13,14 @@ type ResultError = string;
|
|
|
13
13
|
export type FindCallTasksHeaders = { 'x-auth-hc': string };
|
|
14
14
|
export type FindCallTasksParams = {
|
|
15
15
|
filter?: {
|
|
16
|
-
'serviceRequest.
|
|
17
|
-
|
|
16
|
+
'serviceRequest.id'?: string;
|
|
17
|
+
createdAt?: string | { from: string; to: string };
|
|
18
|
+
hasAccessTags?: string[];
|
|
19
|
+
hasNoAccessTags?: string[];
|
|
18
20
|
id?: number | number[];
|
|
19
21
|
qualityAssurance?: boolean;
|
|
20
22
|
status?: CallTaskStatus | CallTaskStatus[];
|
|
23
|
+
triggeredByEvent?: CallTaskTriggeredByEvent;
|
|
21
24
|
};
|
|
22
25
|
limits?: { page?: number; count: number | 'all' };
|
|
23
26
|
sorting?: { direction: 'asc' | 'desc'; type: 'createdAt' | 'id' };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { CallTask } from '../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: CallTask };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = CallTask;
|
|
8
|
+
type ResultError = string;
|
|
9
|
+
|
|
10
|
+
export type UpdateCallTaskHeaders = { 'x-auth-hc'?: string };
|
|
11
|
+
export type UpdateCallTaskUrlParams = { id: number };
|
|
12
|
+
export type UpdateCallTaskBody = Partial<CallTask> & {
|
|
13
|
+
comment?: string;
|
|
14
|
+
actualAt?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type UpdateCallTaskData = AxiosResponse<ResultData>;
|
|
18
|
+
export type UpdateCallTaskError = AxiosError<ResultError>;
|
|
19
|
+
export type UpdateCallTaskConfig = {
|
|
20
|
+
baseURL?: string;
|
|
21
|
+
headers?: UpdateCallTaskHeaders;
|
|
22
|
+
body: UpdateCallTaskBody;
|
|
23
|
+
urlParams: UpdateCallTaskUrlParams;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function updateCallTaskRequest({
|
|
27
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
28
|
+
urlParams,
|
|
29
|
+
body,
|
|
30
|
+
headers,
|
|
31
|
+
}: UpdateCallTaskConfig) {
|
|
32
|
+
return axios
|
|
33
|
+
.put(`/api/calls/task/${urlParams.id}`, body, {
|
|
34
|
+
baseURL,
|
|
35
|
+
headers: { Accept: 'application/json', 'Content-Type': 'application/json', ...headers },
|
|
36
|
+
transformResponse: [
|
|
37
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
38
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
39
|
+
if (data.success) return data.data;
|
|
40
|
+
|
|
41
|
+
return data.data.error;
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
})
|
|
45
|
+
.then((res: UpdateCallTaskData) => res)
|
|
46
|
+
.catch((err: UpdateCallTaskError) => {
|
|
47
|
+
throw err;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { Comment } from '../../../types';
|
|
4
|
+
|
|
5
|
+
type SuccessData = { success: true; data: Comment[]; pageParams: { page: number; length: number } };
|
|
6
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
7
|
+
|
|
8
|
+
type ResultData = { ids: number[]; byId: Record<string, Comment>; meta: { total: number } };
|
|
9
|
+
type ResultError = ErrorData['data']['error'];
|
|
10
|
+
|
|
11
|
+
export type FindCommentsParams = {
|
|
12
|
+
filter?: { 'call.id'?: string };
|
|
13
|
+
sorting?: { type: 'createdAt'; direction: 'asc' | 'desc' };
|
|
14
|
+
limits?: { page?: number; count?: number | 'all' };
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type FindCommentsHeaders = { 'x-auth-hc': string };
|
|
18
|
+
export type FindCommentsData = AxiosResponse<ResultData>;
|
|
19
|
+
export type FindCommentsError = AxiosError<ResultError>;
|
|
20
|
+
export type FindCommentsConfig = {
|
|
21
|
+
baseURL?: string;
|
|
22
|
+
params: FindCommentsParams;
|
|
23
|
+
headers: FindCommentsHeaders;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function findCommentsRequest({ baseURL = 'https://clients.homeapp.ru', headers, params }: FindCommentsConfig) {
|
|
27
|
+
return axios
|
|
28
|
+
.get('/api/comment', {
|
|
29
|
+
baseURL,
|
|
30
|
+
params,
|
|
31
|
+
paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
|
|
32
|
+
headers: { Accept: 'application/json', ...headers },
|
|
33
|
+
transformResponse: [
|
|
34
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
35
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => {
|
|
36
|
+
if (!data.success) return data.data.error;
|
|
37
|
+
|
|
38
|
+
const ids: ResultData['ids'] = [];
|
|
39
|
+
const byId: ResultData['byId'] = {};
|
|
40
|
+
|
|
41
|
+
data.data.forEach(entity => {
|
|
42
|
+
byId[entity.id] = entity;
|
|
43
|
+
ids.push(entity.id);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return { ids, byId, meta: { total: data.pageParams.length } };
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
})
|
|
50
|
+
.then((res: FindCommentsData) => res)
|
|
51
|
+
.catch((err: FindCommentsError) => {
|
|
52
|
+
throw err;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: { month: string; count: number; commission: number }[] };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type FindDealExpertStatisticsParams = { filter?: { from: string; to: string } };
|
|
11
|
+
export type FindDealExpertStatisticsUrlParams = { id: number };
|
|
12
|
+
export type FindDealExpertStatisticsHeaders = { 'x-auth-hc': string };
|
|
13
|
+
export type FindDealExpertStatisticsData = AxiosResponse<ResultData>;
|
|
14
|
+
export type FindDealExpertStatisticsError = AxiosError<ResultError>;
|
|
15
|
+
export type FindDealExpertStatisticsConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
headers: FindDealExpertStatisticsHeaders;
|
|
18
|
+
params: FindDealExpertStatisticsParams;
|
|
19
|
+
urlParams: FindDealExpertStatisticsUrlParams;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function findDealExpertStatisticsRequest({
|
|
23
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
+
headers,
|
|
25
|
+
params,
|
|
26
|
+
urlParams,
|
|
27
|
+
}: FindDealExpertStatisticsConfig) {
|
|
28
|
+
return axios
|
|
29
|
+
.get(`/api/deal/${urlParams.id}/expert-statistic`, {
|
|
30
|
+
baseURL,
|
|
31
|
+
params,
|
|
32
|
+
paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
|
|
33
|
+
headers: { Accept: 'application/json', ...headers },
|
|
34
|
+
transformResponse: [
|
|
35
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
36
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
37
|
+
],
|
|
38
|
+
})
|
|
39
|
+
.then((res: FindDealExpertStatisticsData) => res)
|
|
40
|
+
.catch((err: FindDealExpertStatisticsError) => {
|
|
41
|
+
throw err;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
@@ -11,11 +11,20 @@ export * from './bill/createBill';
|
|
|
11
11
|
export * from './bill/findBills';
|
|
12
12
|
|
|
13
13
|
export * from './buyer/callbackBuyer';
|
|
14
|
+
export * from './buyer/closeBuyer';
|
|
14
15
|
export * from './buyer/countBuyers';
|
|
15
16
|
export * from './buyer/createBuyer';
|
|
16
17
|
export * from './buyer/findBuyerClosingReason';
|
|
18
|
+
export * from './buyer/findBuyerStatuses';
|
|
19
|
+
export * from './buyer/findBuyerUniquePhones';
|
|
17
20
|
export * from './buyer/findBuyers';
|
|
21
|
+
export * from './buyer/findBuyerById';
|
|
22
|
+
export * from './buyer/resetBuyerStatusTimer';
|
|
23
|
+
export * from './buyer/shareBuyer';
|
|
24
|
+
export * from './buyer/updateBuyer';
|
|
18
25
|
|
|
26
|
+
export * from './call/createCallComment';
|
|
27
|
+
export * from './call/findCallById';
|
|
19
28
|
export * from './call/findCalls';
|
|
20
29
|
export * from './call/findFirstSuccessOutgoingCalls';
|
|
21
30
|
export * from './call/markupCall';
|
|
@@ -26,8 +35,15 @@ export * from './callCenter/finishOperatorWork';
|
|
|
26
35
|
export * from './callCenter/getOperatorStatus';
|
|
27
36
|
export * from './callCenter/startOperatorWork';
|
|
28
37
|
|
|
38
|
+
export * from './callTask/callCallTask';
|
|
39
|
+
export * from './callTask/closeCallTask';
|
|
29
40
|
export * from './callTask/createCallTask';
|
|
41
|
+
export * from './callTask/findCallQualityAssessors';
|
|
42
|
+
export * from './callTask/findCallTaskById';
|
|
30
43
|
export * from './callTask/findCallTasks';
|
|
44
|
+
export * from './callTask/updateCallTask';
|
|
45
|
+
|
|
46
|
+
export * from './comment/findComments';
|
|
31
47
|
|
|
32
48
|
export * from './contract/approveContract';
|
|
33
49
|
export * from './contract/createContract';
|
|
@@ -51,6 +67,7 @@ export * from './deal/createDealCategorizedFile';
|
|
|
51
67
|
export * from './deal/createDealInvestPrepayment';
|
|
52
68
|
export * from './deal/deleteDealCategorizedFile';
|
|
53
69
|
export * from './deal/findDealCategorizedFiles';
|
|
70
|
+
export * from './deal/findDealExpertStatistics';
|
|
54
71
|
export * from './deal/findDeals';
|
|
55
72
|
export * from './deal/setDealDoneState';
|
|
56
73
|
export * from './deal/setDealPrepaymentState';
|
|
@@ -90,6 +107,14 @@ export * from './internalCrossSale/findInternalCrossSaleInfo';
|
|
|
90
107
|
export * from './internalCrossSale/findInternalCrossSales';
|
|
91
108
|
export * from './internalCrossSale/updateInternalCrossSale';
|
|
92
109
|
|
|
110
|
+
export * from './messenger/findMessengerInviteLinks';
|
|
111
|
+
export * from './motivationCalculator/createMotivationCalculatorRequest';
|
|
112
|
+
export * from './motivationStatus/findMotivationStatus';
|
|
113
|
+
|
|
114
|
+
export * from './payslip/findPayslips';
|
|
115
|
+
export * from './payslip/findPayslipById';
|
|
116
|
+
export * from './payslip/updatePayslip';
|
|
117
|
+
|
|
93
118
|
export * from './phoneBookContact/createPhoneBookContact';
|
|
94
119
|
export * from './phoneBookContact/deletePhoneBookContact';
|
|
95
120
|
export * from './phoneBookContact/findPhoneBookContacts';
|
|
@@ -100,40 +125,45 @@ export * from './photoOrder/findPhotoOrders';
|
|
|
100
125
|
export * from './photoOrder/sendPhotoOrderFeedback';
|
|
101
126
|
export * from './photoOrder/terminatePhotoOrder';
|
|
102
127
|
|
|
128
|
+
export * from './realty/findRealtyPriceHistory';
|
|
103
129
|
export * from './realty/findSimilarRealtyIdsById';
|
|
104
130
|
export * from './realty/subscribeToRealtyUpdates';
|
|
105
131
|
|
|
106
132
|
export * from './serviceRequest/approveCloseServiceRequest';
|
|
133
|
+
export * from './serviceRequest/buyer/findBuyerRejectionReasonStatistic';
|
|
134
|
+
export * from './serviceRequest/buyer/findBuyerStatusStatistic';
|
|
107
135
|
export * from './serviceRequest/callbackServiceRequest';
|
|
108
136
|
export * from './serviceRequest/closeServiceRequest';
|
|
109
137
|
export * from './serviceRequest/completeServiceRequestModeration';
|
|
110
138
|
export * from './serviceRequest/createInvestSellServiceRequest';
|
|
111
139
|
export * from './serviceRequest/createServiceRequest';
|
|
112
|
-
export * from './serviceRequest/createServiceRequestByCrossSaleId';
|
|
113
140
|
export * from './serviceRequest/createServiceRequestActivity';
|
|
141
|
+
export * from './serviceRequest/createServiceRequestByCrossSaleId';
|
|
114
142
|
export * from './serviceRequest/createServiceRequestCategorizedFile';
|
|
143
|
+
export * from './serviceRequest/createServiceRequestSellerReport';
|
|
115
144
|
export * from './serviceRequest/deferServiceRequest';
|
|
116
145
|
export * from './serviceRequest/deleteServiceRequestCategorizedFile';
|
|
117
146
|
export * from './serviceRequest/deleteServiceRequestReportForSeller';
|
|
147
|
+
export * from './serviceRequest/depublishServiceRequest';
|
|
118
148
|
export * from './serviceRequest/disapproveCloseServiceRequest';
|
|
149
|
+
export * from './serviceRequest/findPriceHistoryAnalyticsById';
|
|
119
150
|
export * from './serviceRequest/findServiceRequestActivities';
|
|
120
151
|
export * from './serviceRequest/findServiceRequestById';
|
|
152
|
+
export * from './serviceRequest/findServiceRequestCategorizedFileCreatedDate';
|
|
153
|
+
export * from './serviceRequest/findServiceRequestCategorizedFiles';
|
|
154
|
+
export * from './serviceRequest/findServiceRequestCategoryById';
|
|
121
155
|
export * from './serviceRequest/findServiceRequestDuplicates';
|
|
122
|
-
export * from './serviceRequest/findServiceRequests';
|
|
123
156
|
export * from './serviceRequest/findServiceRequestSellerReports';
|
|
124
157
|
export * from './serviceRequest/findServiceRequestShortInfo';
|
|
125
158
|
export * from './serviceRequest/findServiceRequestShortInfoByDealId';
|
|
126
159
|
export * from './serviceRequest/findServiceRequestShortInfoById';
|
|
127
160
|
export * from './serviceRequest/findServiceRequestStatisticsById';
|
|
128
|
-
export * from './serviceRequest/
|
|
129
|
-
export * from './serviceRequest/
|
|
130
|
-
export * from './serviceRequest/findPriceHistoryAnalyticsById';
|
|
161
|
+
export * from './serviceRequest/findServiceRequests';
|
|
162
|
+
export * from './serviceRequest/publishServiceRequest';
|
|
131
163
|
export * from './serviceRequest/returnDeferredServiceRequest';
|
|
132
164
|
export * from './serviceRequest/sendServiceRequestToModeration';
|
|
133
165
|
export * from './serviceRequest/startServiceRequestModeration';
|
|
134
166
|
export * from './serviceRequest/startServiceRequestModerationForOldRealty';
|
|
135
|
-
export * from './serviceRequest/publishServiceRequest';
|
|
136
|
-
export * from './serviceRequest/depublishServiceRequest';
|
|
137
167
|
export * from './serviceRequest/transferServiceRequest';
|
|
138
168
|
export * from './serviceRequest/updateServiceRequest';
|
|
139
169
|
|