@hapl/api-queries 0.1.176 → 0.1.178
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 +24 -0
- package/dist/api-queries.cjs.development.js +110 -1
- 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 +110 -1
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/index.d.ts +3 -0
- package/dist/clients/v1/api/valuation/actualizeValuation/index.d.ts +29 -0
- package/dist/clients/v1/api/valuation/findValuationNewsByServiceRequestId/index.d.ts +29 -0
- package/dist/clients/v1/api/valuation/updateValuationNewsStatus/index.d.ts +29 -0
- package/dist/clients/v1/index.d.ts +3 -0
- package/dist/clients/v1/types/ValuationNews.d.ts +22 -0
- package/dist/clients/v1/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/clients/v1/api/index.ts +3 -0
- package/src/clients/v1/api/valuation/actualizeValuation/index.ts +38 -0
- package/src/clients/v1/api/valuation/findValuationNewsByServiceRequestId/index.ts +39 -0
- package/src/clients/v1/api/valuation/updateValuationNewsStatus/index.ts +41 -0
- package/src/clients/v1/index.ts +19 -0
- package/src/clients/v1/types/ValuationNews.ts +22 -0
- package/src/clients/v1/types/index.ts +1 -0
|
@@ -106,6 +106,9 @@ export * from './task/createTask';
|
|
|
106
106
|
export * from './task/findTasks';
|
|
107
107
|
export * from './task/findTaskById';
|
|
108
108
|
export * from './task/updateTask';
|
|
109
|
+
export * from './valuation/actualizeValuation';
|
|
109
110
|
export * from './valuation/createValuation';
|
|
110
111
|
export * from './valuation/createValuationRealtyComment';
|
|
111
112
|
export * from './valuation/findValuationByServiceRequestId';
|
|
113
|
+
export * from './valuation/findValuationNewsByServiceRequestId';
|
|
114
|
+
export * from './valuation/updateValuationNewsStatus';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { Valuation } from '../../../types';
|
|
3
|
+
declare type SuccessData = {
|
|
4
|
+
success: true;
|
|
5
|
+
data: Valuation;
|
|
6
|
+
};
|
|
7
|
+
declare type ErrorData = {
|
|
8
|
+
success: false;
|
|
9
|
+
data: {
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare type ResultData = SuccessData['data'];
|
|
14
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
15
|
+
export declare type ActualizeValuationHeaders = {
|
|
16
|
+
'x-auth-hc': string;
|
|
17
|
+
};
|
|
18
|
+
export declare type ActualizeValuationUrlParams = {
|
|
19
|
+
serviceRequestId: number;
|
|
20
|
+
};
|
|
21
|
+
export declare type ActualizeValuationData = AxiosResponse<ResultData>;
|
|
22
|
+
export declare type ActualizeValuationError = AxiosError<ResultError>;
|
|
23
|
+
export declare type ActualizeValuationConfig = {
|
|
24
|
+
baseURL?: string;
|
|
25
|
+
urlParams: ActualizeValuationUrlParams;
|
|
26
|
+
headers: ActualizeValuationHeaders;
|
|
27
|
+
};
|
|
28
|
+
export declare function actualizeValuationRequest({ baseURL, urlParams, headers, }: ActualizeValuationConfig): Promise<ActualizeValuationData>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { ValuationNews } from '../../../types';
|
|
3
|
+
declare type SuccessData = {
|
|
4
|
+
success: true;
|
|
5
|
+
data: ValuationNews[];
|
|
6
|
+
};
|
|
7
|
+
declare type ErrorData = {
|
|
8
|
+
success: false;
|
|
9
|
+
data: {
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare type ResultData = SuccessData['data'];
|
|
14
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
15
|
+
export declare type FindValuationNewsByServiceRequestIdHeaders = {
|
|
16
|
+
'x-auth-hc': string;
|
|
17
|
+
};
|
|
18
|
+
export declare type FindValuationNewsByServiceRequestIdUrlParams = {
|
|
19
|
+
serviceRequestId: number;
|
|
20
|
+
};
|
|
21
|
+
export declare type FindValuationNewsByServiceRequestIdData = AxiosResponse<ResultData>;
|
|
22
|
+
export declare type FindValuationNewsByServiceRequestIdError = AxiosError<ResultError>;
|
|
23
|
+
export declare type FindValuationNewsByServiceRequestIdConfig = {
|
|
24
|
+
baseURL?: string;
|
|
25
|
+
urlParams: FindValuationNewsByServiceRequestIdUrlParams;
|
|
26
|
+
headers: FindValuationNewsByServiceRequestIdHeaders;
|
|
27
|
+
};
|
|
28
|
+
export declare function findValuationNewsByServiceRequestIdRequest({ baseURL, urlParams, headers, }: FindValuationNewsByServiceRequestIdConfig): Promise<FindValuationNewsByServiceRequestIdData>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
|
+
import { ValuationNewsStatus } from '../../../types';
|
|
3
|
+
declare type ErrorData = {
|
|
4
|
+
success: false;
|
|
5
|
+
data: {
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare type ResultData = null;
|
|
10
|
+
declare type ResultError = ErrorData['data']['error'];
|
|
11
|
+
export declare type UpdateValuationNewsStatusHeaders = {
|
|
12
|
+
'x-auth-hc': string;
|
|
13
|
+
};
|
|
14
|
+
export declare type UpdateValuationNewsStatusUrlParams = {
|
|
15
|
+
status: ValuationNewsStatus.Ignored | ValuationNewsStatus.Accepted;
|
|
16
|
+
};
|
|
17
|
+
export declare type UpdateValuationNewsStatusBody = {
|
|
18
|
+
id: number[];
|
|
19
|
+
};
|
|
20
|
+
export declare type UpdateValuationNewsStatusData = AxiosResponse<ResultData>;
|
|
21
|
+
export declare type UpdateValuationNewsStatusError = AxiosError<ResultError>;
|
|
22
|
+
export declare type UpdateValuationNewsStatusConfig = {
|
|
23
|
+
baseURL?: string;
|
|
24
|
+
urlParams: UpdateValuationNewsStatusUrlParams;
|
|
25
|
+
body: UpdateValuationNewsStatusBody;
|
|
26
|
+
headers: UpdateValuationNewsStatusHeaders;
|
|
27
|
+
};
|
|
28
|
+
export declare function updateValuationNewsStatusRequest({ baseURL, urlParams, body, headers, }: UpdateValuationNewsStatusConfig): Promise<UpdateValuationNewsStatusData>;
|
|
29
|
+
export {};
|
|
@@ -110,9 +110,12 @@ export declare class Api {
|
|
|
110
110
|
updateUser: (urlParams: api.UpdateUserUrlParams, body: api.UpdateUserBody, headers: api.UpdateUserHeaders) => Promise<api.UpdateUserData>;
|
|
111
111
|
fireUser: (urlParams: api.FireUserUrlParams, body: api.FireUserBody, headers: api.FireUserHeaders) => Promise<api.FireUserData>;
|
|
112
112
|
assignSubordinateUsers: (urlParams: api.AssignSubordinateUsersUrlParams, body: api.AssignSubordinateUsersBody, headers: api.AssignSubordinateUsersHeaders) => Promise<api.AssignSubordinateUsersData>;
|
|
113
|
+
actualizeValuation: (urlParams: api.ActualizeValuationUrlParams, headers: api.ActualizeValuationHeaders) => Promise<api.ActualizeValuationData>;
|
|
113
114
|
createValuation: (body: api.CreateValuationBody, headers: api.CreateValuationHeaders) => Promise<api.CreateValuationData>;
|
|
114
115
|
createValuationRealtyComment: (urlParams: api.CreateValuationRealtyCommentUrlParams, body: api.CreateValuationRealtyCommentBody, headers: api.CreateValuationRealtyCommentHeaders) => Promise<api.CreateValuationRealtyCommentData>;
|
|
115
116
|
findValuationByServiceRequestId: (urlParams: api.FindValuationByServiceRequestIdUrlParams, params?: api.FindValuationByServiceRequestIdParams | undefined, headers?: api.FindValuationByServiceRequestIdHeaders | undefined) => Promise<api.FindValuationByServiceRequestIdData>;
|
|
117
|
+
findValuationNewsByServiceRequestId: (urlParams: api.FindValuationNewsByServiceRequestIdUrlParams, headers: api.FindValuationNewsByServiceRequestIdHeaders) => Promise<api.FindValuationNewsByServiceRequestIdData>;
|
|
118
|
+
updateValuationNewsStatus: (urlParams: api.UpdateValuationNewsStatusUrlParams, body: api.UpdateValuationNewsStatusBody, headers: api.UpdateValuationNewsStatusHeaders) => Promise<api.UpdateValuationNewsStatusData>;
|
|
116
119
|
}
|
|
117
120
|
export * from './api';
|
|
118
121
|
export * from './dictionaries';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum ValuationNewsActionType {
|
|
2
|
+
NewRealty = "new_realty",
|
|
3
|
+
RealtySold = "realty_sold",
|
|
4
|
+
RealtyExpired = "realty_expired"
|
|
5
|
+
}
|
|
6
|
+
export declare enum ValuationNewsStatus {
|
|
7
|
+
New = "new",
|
|
8
|
+
NewOutdated = "new_outdated",
|
|
9
|
+
Ignored = "ignored",
|
|
10
|
+
Accepted = "accepted",
|
|
11
|
+
Outdated = "outdated"
|
|
12
|
+
}
|
|
13
|
+
export declare type ValuationNews = {
|
|
14
|
+
actionType: ValuationNewsActionType;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
id: number;
|
|
17
|
+
realtyExtId: number;
|
|
18
|
+
serviceRequest: {
|
|
19
|
+
id: number;
|
|
20
|
+
};
|
|
21
|
+
status: ValuationNewsStatus;
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -124,6 +124,9 @@ export * from './task/findTasks';
|
|
|
124
124
|
export * from './task/findTaskById';
|
|
125
125
|
export * from './task/updateTask';
|
|
126
126
|
|
|
127
|
+
export * from './valuation/actualizeValuation';
|
|
127
128
|
export * from './valuation/createValuation';
|
|
128
129
|
export * from './valuation/createValuationRealtyComment';
|
|
129
130
|
export * from './valuation/findValuationByServiceRequestId';
|
|
131
|
+
export * from './valuation/findValuationNewsByServiceRequestId';
|
|
132
|
+
export * from './valuation/updateValuationNewsStatus';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { Valuation } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: Valuation };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type ActualizeValuationHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type ActualizeValuationUrlParams = { serviceRequestId: number };
|
|
12
|
+
export type ActualizeValuationData = AxiosResponse<ResultData>;
|
|
13
|
+
export type ActualizeValuationError = AxiosError<ResultError>;
|
|
14
|
+
export type ActualizeValuationConfig = {
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
urlParams: ActualizeValuationUrlParams;
|
|
17
|
+
headers: ActualizeValuationHeaders;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export function actualizeValuationRequest({
|
|
21
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
22
|
+
urlParams,
|
|
23
|
+
headers,
|
|
24
|
+
}: ActualizeValuationConfig) {
|
|
25
|
+
return axios
|
|
26
|
+
.patch(`/api/valuation/${urlParams.serviceRequestId}/actualize`, null, {
|
|
27
|
+
baseURL,
|
|
28
|
+
headers: { Accept: 'application/json', ...headers },
|
|
29
|
+
transformResponse: [
|
|
30
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
31
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
32
|
+
],
|
|
33
|
+
})
|
|
34
|
+
.then((res: ActualizeValuationData) => res)
|
|
35
|
+
.catch((err: ActualizeValuationError) => {
|
|
36
|
+
throw err;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { ValuationNews } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true; data: ValuationNews[] };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = SuccessData['data'];
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type FindValuationNewsByServiceRequestIdHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type FindValuationNewsByServiceRequestIdUrlParams = { serviceRequestId: number };
|
|
12
|
+
export type FindValuationNewsByServiceRequestIdData = AxiosResponse<ResultData>;
|
|
13
|
+
export type FindValuationNewsByServiceRequestIdError = AxiosError<ResultError>;
|
|
14
|
+
|
|
15
|
+
export type FindValuationNewsByServiceRequestIdConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
urlParams: FindValuationNewsByServiceRequestIdUrlParams;
|
|
18
|
+
headers: FindValuationNewsByServiceRequestIdHeaders;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function findValuationNewsByServiceRequestIdRequest({
|
|
22
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
23
|
+
urlParams,
|
|
24
|
+
headers,
|
|
25
|
+
}: FindValuationNewsByServiceRequestIdConfig) {
|
|
26
|
+
return axios
|
|
27
|
+
.get(`/api/valuation/${urlParams.serviceRequestId}/news`, {
|
|
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: FindValuationNewsByServiceRequestIdData) => res)
|
|
36
|
+
.catch((err: FindValuationNewsByServiceRequestIdError) => {
|
|
37
|
+
throw err;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
+
import { ValuationNewsStatus } from '../../../types';
|
|
3
|
+
|
|
4
|
+
type SuccessData = { success: true };
|
|
5
|
+
type ErrorData = { success: false; data: { error: string } };
|
|
6
|
+
|
|
7
|
+
type ResultData = null;
|
|
8
|
+
type ResultError = ErrorData['data']['error'];
|
|
9
|
+
|
|
10
|
+
export type UpdateValuationNewsStatusHeaders = { 'x-auth-hc': string };
|
|
11
|
+
export type UpdateValuationNewsStatusUrlParams = { status: ValuationNewsStatus.Ignored | ValuationNewsStatus.Accepted };
|
|
12
|
+
export type UpdateValuationNewsStatusBody = { id: number[] };
|
|
13
|
+
export type UpdateValuationNewsStatusData = AxiosResponse<ResultData>;
|
|
14
|
+
export type UpdateValuationNewsStatusError = AxiosError<ResultError>;
|
|
15
|
+
export type UpdateValuationNewsStatusConfig = {
|
|
16
|
+
baseURL?: string;
|
|
17
|
+
urlParams: UpdateValuationNewsStatusUrlParams;
|
|
18
|
+
body: UpdateValuationNewsStatusBody;
|
|
19
|
+
headers: UpdateValuationNewsStatusHeaders;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function updateValuationNewsStatusRequest({
|
|
23
|
+
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
+
urlParams,
|
|
25
|
+
body,
|
|
26
|
+
headers,
|
|
27
|
+
}: UpdateValuationNewsStatusConfig) {
|
|
28
|
+
return axios
|
|
29
|
+
.patch(`/api/valuation/news/${urlParams.status}`, body, {
|
|
30
|
+
baseURL,
|
|
31
|
+
headers: { Accept: 'application/json', ...headers },
|
|
32
|
+
transformResponse: [
|
|
33
|
+
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
34
|
+
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? null : data.data.error),
|
|
35
|
+
],
|
|
36
|
+
})
|
|
37
|
+
.then((res: UpdateValuationNewsStatusData) => res)
|
|
38
|
+
.catch((err: UpdateValuationNewsStatusError) => {
|
|
39
|
+
throw err;
|
|
40
|
+
});
|
|
41
|
+
}
|
package/src/clients/v1/index.ts
CHANGED
|
@@ -663,6 +663,10 @@ export class Api {
|
|
|
663
663
|
|
|
664
664
|
// valuation
|
|
665
665
|
|
|
666
|
+
actualizeValuation = (urlParams: api.ActualizeValuationUrlParams, headers: api.ActualizeValuationHeaders) => {
|
|
667
|
+
return api.actualizeValuationRequest({ urlParams, headers, baseURL: this.baseURL });
|
|
668
|
+
};
|
|
669
|
+
|
|
666
670
|
createValuation = (body: api.CreateValuationBody, headers: api.CreateValuationHeaders) => {
|
|
667
671
|
return api.createValuationRequest({ body, headers, baseURL: this.baseURL });
|
|
668
672
|
};
|
|
@@ -682,6 +686,21 @@ export class Api {
|
|
|
682
686
|
) => {
|
|
683
687
|
return api.findValuationByServiceRequestIdRequest({ urlParams, params, headers, baseURL: this.baseURL });
|
|
684
688
|
};
|
|
689
|
+
|
|
690
|
+
findValuationNewsByServiceRequestId = (
|
|
691
|
+
urlParams: api.FindValuationNewsByServiceRequestIdUrlParams,
|
|
692
|
+
headers: api.FindValuationNewsByServiceRequestIdHeaders
|
|
693
|
+
) => {
|
|
694
|
+
return api.findValuationNewsByServiceRequestIdRequest({ urlParams, headers, baseURL: this.baseURL });
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
updateValuationNewsStatus = (
|
|
698
|
+
urlParams: api.UpdateValuationNewsStatusUrlParams,
|
|
699
|
+
body: api.UpdateValuationNewsStatusBody,
|
|
700
|
+
headers: api.UpdateValuationNewsStatusHeaders
|
|
701
|
+
) => {
|
|
702
|
+
return api.updateValuationNewsStatusRequest({ urlParams, body, headers, baseURL: this.baseURL });
|
|
703
|
+
};
|
|
685
704
|
}
|
|
686
705
|
|
|
687
706
|
export * from './api';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export enum ValuationNewsActionType {
|
|
2
|
+
NewRealty = 'new_realty',
|
|
3
|
+
RealtySold = 'realty_sold',
|
|
4
|
+
RealtyExpired = 'realty_expired',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum ValuationNewsStatus {
|
|
8
|
+
New = 'new',
|
|
9
|
+
NewOutdated = 'new_outdated',
|
|
10
|
+
Ignored = 'ignored',
|
|
11
|
+
Accepted = 'accepted',
|
|
12
|
+
Outdated = 'outdated',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ValuationNews = {
|
|
16
|
+
actionType: ValuationNewsActionType;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
id: number;
|
|
19
|
+
realtyExtId: number;
|
|
20
|
+
serviceRequest: { id: number };
|
|
21
|
+
status: ValuationNewsStatus;
|
|
22
|
+
};
|