@hapl/api-queries 0.1.152 → 0.1.153--canary.80.033beeb.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 +28 -60
- 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 +28 -60
- package/dist/api-queries.esm.js.map +1 -1
- package/dist/clients/v1/api/crossSale/updateCrossSale/index.d.ts +3 -3
- package/dist/clients/v1/api/index.d.ts +1 -2
- package/dist/clients/v1/api/serviceRequest/findServiceRequests/index.d.ts +0 -3
- package/dist/clients/v1/dictionaries/ServiceRequest.d.ts +9 -9
- package/dist/clients/v1/index.d.ts +1 -2
- package/dist/clients/v1/types/CrossSale.d.ts +2 -2
- package/dist/clients/v2/api/realty/findRealties/index.d.ts +3 -3
- package/dist/clients/v2/api/realty/findRealtyById/index.d.ts +3 -3
- package/dist/clients/v2/types/ExternalLink.d.ts +7 -0
- package/dist/clients/v2/types/Realty.d.ts +16 -4
- package/dist/clients/v2/types/index.d.ts +1 -0
- package/dist/publisher/v1/api/findScoring/index.d.ts +13 -12
- package/dist/publisher/v1/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/clients/v1/api/crossSale/updateCrossSale/index.ts +3 -3
- package/src/clients/v1/api/index.ts +1 -2
- package/src/clients/v1/api/serviceRequest/findServiceRequests/index.ts +0 -3
- package/src/clients/v1/dictionaries/ServiceRequest.ts +9 -9
- package/src/clients/v1/index.ts +4 -11
- package/src/clients/v1/types/CrossSale.ts +2 -2
- package/src/clients/v2/api/realty/findRealties/index.ts +11 -2
- package/src/clients/v2/api/realty/findRealtyById/index.ts +11 -2
- package/src/clients/v2/types/ExternalLink.ts +7 -0
- package/src/clients/v2/types/Realty.ts +3 -1
- package/src/clients/v2/types/index.ts +1 -0
- package/src/publisher/v1/api/findScoring/index.ts +27 -32
- package/src/publisher/v1/index.ts +1 -1
- package/dist/clients/v1/api/serviceRequest/findServiceRequestStatisticsById/index.d.ts +0 -32
- package/src/clients/v1/api/serviceRequest/findServiceRequestStatisticsById/index.ts +0 -40
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
|
|
2
|
-
|
|
3
|
-
type SuccessData = {
|
|
4
|
-
success: true;
|
|
5
|
-
data: { expositionCount: number; markedCount: number; offerCount: number };
|
|
6
|
-
};
|
|
7
|
-
type ErrorData = { success: false; data: { error: string } };
|
|
8
|
-
|
|
9
|
-
type ResultData = SuccessData['data'];
|
|
10
|
-
type ResultError = ErrorData['data']['error'];
|
|
11
|
-
|
|
12
|
-
export type FindServiceRequestStatisticsByIdUrlParams = { id: number };
|
|
13
|
-
export type FindServiceRequestStatisticsByIdHeaders = { 'x-auth-hc'?: string };
|
|
14
|
-
export type FindServiceRequestStatisticsByIdData = AxiosResponse<ResultData>;
|
|
15
|
-
export type FindServiceRequestStatisticsByIdError = AxiosError<ResultError>;
|
|
16
|
-
export type FindServiceRequestStatisticsByIdConfig = {
|
|
17
|
-
baseURL?: string;
|
|
18
|
-
urlParams: FindServiceRequestStatisticsByIdUrlParams;
|
|
19
|
-
headers: FindServiceRequestStatisticsByIdHeaders;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export function findServiceRequestStatisticsByIdRequest({
|
|
23
|
-
baseURL = 'https://clients.homeapp.ru',
|
|
24
|
-
urlParams,
|
|
25
|
-
headers,
|
|
26
|
-
}: FindServiceRequestStatisticsByIdConfig) {
|
|
27
|
-
return axios
|
|
28
|
-
.get(`/api/service-request/statistics/${urlParams.id}`, {
|
|
29
|
-
baseURL,
|
|
30
|
-
headers: { Accept: 'application/json', ...headers },
|
|
31
|
-
transformResponse: [
|
|
32
|
-
...(axios.defaults.transformResponse as AxiosTransformer[]),
|
|
33
|
-
(data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
|
|
34
|
-
],
|
|
35
|
-
})
|
|
36
|
-
.then((res: FindServiceRequestStatisticsByIdData) => res)
|
|
37
|
-
.catch((err: FindServiceRequestStatisticsByIdError) => {
|
|
38
|
-
throw err;
|
|
39
|
-
});
|
|
40
|
-
}
|