@hapl/api-queries 0.1.177 → 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 +12 -0
- package/dist/api-queries.cjs.development.js +31 -0
- 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 +31 -0
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/index.d.ts +1 -0
- package/dist/clients/v1/api/valuation/updateValuationNewsStatus/index.d.ts +29 -0
- package/dist/clients/v1/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/clients/v1/api/index.ts +1 -0
- package/src/clients/v1/api/valuation/updateValuationNewsStatus/index.ts +41 -0
- package/src/clients/v1/index.ts +8 -0
|
@@ -111,3 +111,4 @@ export * from './valuation/createValuation';
|
|
|
111
111
|
export * from './valuation/createValuationRealtyComment';
|
|
112
112
|
export * from './valuation/findValuationByServiceRequestId';
|
|
113
113
|
export * from './valuation/findValuationNewsByServiceRequestId';
|
|
114
|
+
export * from './valuation/updateValuationNewsStatus';
|
|
@@ -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 {};
|
|
@@ -115,6 +115,7 @@ export declare class Api {
|
|
|
115
115
|
createValuationRealtyComment: (urlParams: api.CreateValuationRealtyCommentUrlParams, body: api.CreateValuationRealtyCommentBody, headers: api.CreateValuationRealtyCommentHeaders) => Promise<api.CreateValuationRealtyCommentData>;
|
|
116
116
|
findValuationByServiceRequestId: (urlParams: api.FindValuationByServiceRequestIdUrlParams, params?: api.FindValuationByServiceRequestIdParams | undefined, headers?: api.FindValuationByServiceRequestIdHeaders | undefined) => Promise<api.FindValuationByServiceRequestIdData>;
|
|
117
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>;
|
|
118
119
|
}
|
|
119
120
|
export * from './api';
|
|
120
121
|
export * from './dictionaries';
|
package/package.json
CHANGED
|
@@ -129,3 +129,4 @@ export * from './valuation/createValuation';
|
|
|
129
129
|
export * from './valuation/createValuationRealtyComment';
|
|
130
130
|
export * from './valuation/findValuationByServiceRequestId';
|
|
131
131
|
export * from './valuation/findValuationNewsByServiceRequestId';
|
|
132
|
+
export * from './valuation/updateValuationNewsStatus';
|
|
@@ -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
|
@@ -693,6 +693,14 @@ export class Api {
|
|
|
693
693
|
) => {
|
|
694
694
|
return api.findValuationNewsByServiceRequestIdRequest({ urlParams, headers, baseURL: this.baseURL });
|
|
695
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
|
+
};
|
|
696
704
|
}
|
|
697
705
|
|
|
698
706
|
export * from './api';
|