@hapl/api-queries 0.1.116 → 0.1.119

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/api-queries.cjs.development.js +309 -10
  3. package/dist/api-queries.cjs.development.js.map +1 -1
  4. package/dist/api-queries.cjs.production.min.js +1 -1
  5. package/dist/api-queries.cjs.production.min.js.map +1 -1
  6. package/dist/api-queries.esm.js +309 -10
  7. package/dist/api-queries.esm.js.map +1 -1
  8. package/dist/clients/v1/api/index.d.ts +2 -1
  9. package/dist/clients/v1/api/serviceRequest/findServiceRequestSellerReports/index.d.ts +42 -0
  10. package/dist/clients/v1/api/serviceRequest/findServiceRequests/index.d.ts +12 -10
  11. package/dist/clients/v1/api/valuation/findValuationByServiceRequestId/index.d.ts +29 -0
  12. package/dist/clients/v1/dictionaries/Valuation.d.ts +10 -0
  13. package/dist/clients/v1/dictionaries/index.d.ts +1 -0
  14. package/dist/clients/v1/index.d.ts +2 -1
  15. package/dist/clients/v1/types/Valuation.d.ts +69 -0
  16. package/dist/clients/v1/types/index.d.ts +1 -0
  17. package/dist/registry/v1/api/{complexes → complex}/findComplexIds/index.d.ts +0 -0
  18. package/dist/registry/v1/api/index.d.ts +2 -1
  19. package/dist/registry/v1/api/realty/findRealties/index.d.ts +34 -0
  20. package/dist/registry/v1/dictionaries/AddressBTIParams.d.ts +24 -0
  21. package/dist/registry/v1/dictionaries/Realty.d.ts +71 -0
  22. package/dist/registry/v1/dictionaries/Shape.d.ts +11 -0
  23. package/dist/registry/v1/dictionaries/index.d.ts +3 -0
  24. package/dist/registry/v1/index.d.ts +3 -0
  25. package/dist/registry/v1/types/Address.d.ts +31 -0
  26. package/dist/registry/v1/types/AddressBTIParams.d.ts +39 -0
  27. package/dist/registry/v1/types/AddressMetroDistance.d.ts +9 -0
  28. package/dist/registry/v1/types/Image.d.ts +15 -0
  29. package/dist/registry/v1/types/Realty.d.ts +116 -0
  30. package/dist/registry/v1/types/RealtyOffer.d.ts +6 -0
  31. package/dist/registry/v1/types/Shape.d.ts +24 -0
  32. package/dist/registry/v1/types/index.d.ts +7 -0
  33. package/package.json +1 -1
  34. package/src/clients/v1/api/index.ts +3 -1
  35. package/src/clients/v1/api/serviceRequest/{findServiceRequestSellerReport → findServiceRequestSellerReports}/index.ts +13 -13
  36. package/src/clients/v1/api/serviceRequest/findServiceRequests/index.ts +9 -7
  37. package/src/clients/v1/api/valuation/findValuationByServiceRequestId/index.ts +42 -0
  38. package/src/clients/v1/dictionaries/Valuation.ts +11 -0
  39. package/src/clients/v1/dictionaries/index.ts +1 -0
  40. package/src/clients/v1/index.ts +14 -5
  41. package/src/clients/v1/types/Valuation.ts +57 -0
  42. package/src/clients/v1/types/index.ts +1 -0
  43. package/src/registry/v1/api/{complexes → complex}/findComplexIds/index.ts +0 -0
  44. package/src/registry/v1/api/index.ts +3 -1
  45. package/src/registry/v1/api/realty/findRealties/index.ts +54 -0
  46. package/src/registry/v1/dictionaries/AddressBTIParams.ts +25 -0
  47. package/src/registry/v1/dictionaries/Realty.ts +84 -0
  48. package/src/registry/v1/dictionaries/Shape.ts +12 -0
  49. package/src/registry/v1/dictionaries/index.ts +3 -0
  50. package/src/registry/v1/index.ts +10 -0
  51. package/src/registry/v1/types/Address.ts +29 -0
  52. package/src/registry/v1/types/AddressBTIParams.ts +42 -0
  53. package/src/registry/v1/types/AddressMetroDistance.ts +9 -0
  54. package/src/registry/v1/types/Image.ts +13 -0
  55. package/src/registry/v1/types/Realty.ts +123 -0
  56. package/src/registry/v1/types/RealtyOffer.ts +6 -0
  57. package/src/registry/v1/types/Shape.ts +24 -0
  58. package/src/registry/v1/types/index.ts +7 -0
  59. package/dist/clients/v1/api/serviceRequest/findServiceRequestSellerReport/index.d.ts +0 -42
@@ -51,7 +51,7 @@ export * from './serviceRequest/findServiceRequestActivities';
51
51
  export * from './serviceRequest/findServiceRequestById';
52
52
  export * from './serviceRequest/findServiceRequestDuplicates';
53
53
  export * from './serviceRequest/findServiceRequests';
54
- export * from './serviceRequest/findServiceRequestSellerReport';
54
+ export * from './serviceRequest/findServiceRequestSellerReports';
55
55
  export * from './serviceRequest/findServiceRequestShortInfo';
56
56
  export * from './serviceRequest/findServiceRequestShortInfoById';
57
57
  export * from './serviceRequest/findServiceRequestShortInfoByDealId';
@@ -72,3 +72,5 @@ export * from './users/fireUser';
72
72
  export * from './users/assignSubordinateUsers';
73
73
 
74
74
  export * from './task/findTasks';
75
+
76
+ export * from './valuation/findValuationByServiceRequestId';
@@ -8,30 +8,30 @@ type ErrorData = { success: false; data: { error: string } };
8
8
  type ResultData = { ids: string[]; byId: Record<string, ServiceRequestSellerReport>; meta: { total: number } };
9
9
  type ResultError = ErrorData['data']['error'];
10
10
 
11
- export type FindServiceRequestSellerReportParams = {
11
+ export type FindServiceRequestSellerReportsParams = {
12
12
  sorting?: {
13
13
  type: 'createdAt';
14
14
  direction: 'asc' | 'desc';
15
15
  };
16
16
  limits?: { page?: number; count?: number | 'all' };
17
17
  };
18
- export type FindServiceRequestSellerReportUrlParams = { id: number };
19
- export type FindServiceRequestSellerReportHeaders = { 'x-auth-hc': string };
20
- export type FindServiceRequestSellerReportData = AxiosResponse<ResultData>;
21
- export type FindServiceRequestSellerReportError = AxiosError<ResultError>;
22
- export type FindServiceRequestSellerReportConfig = {
18
+ export type FindServiceRequestSellerReportsUrlParams = { id: number };
19
+ export type FindServiceRequestSellerReportsHeaders = { 'x-auth-hc': string };
20
+ export type FindServiceRequestSellerReportsData = AxiosResponse<ResultData>;
21
+ export type FindServiceRequestSellerReportsError = AxiosError<ResultError>;
22
+ export type FindServiceRequestSellerReportsConfig = {
23
23
  baseURL?: string;
24
- urlParams: FindServiceRequestSellerReportUrlParams;
25
- params: FindServiceRequestSellerReportParams;
26
- headers?: FindServiceRequestSellerReportHeaders;
24
+ urlParams: FindServiceRequestSellerReportsUrlParams;
25
+ params: FindServiceRequestSellerReportsParams;
26
+ headers?: FindServiceRequestSellerReportsHeaders;
27
27
  };
28
28
 
29
- export function findServiceRequestSellerReportRequest({
29
+ export function findServiceRequestSellerReportsRequest({
30
30
  baseURL = 'https://clients.homeapp.ru',
31
31
  urlParams,
32
32
  headers,
33
33
  params,
34
- }: FindServiceRequestSellerReportConfig) {
34
+ }: FindServiceRequestSellerReportsConfig) {
35
35
  return axios
36
36
  .get(`/api/service-request/${urlParams.id}/report-for-seller`, {
37
37
  baseURL,
@@ -55,8 +55,8 @@ export function findServiceRequestSellerReportRequest({
55
55
  },
56
56
  ],
57
57
  })
58
- .then((res: FindServiceRequestSellerReportData) => res)
59
- .catch((err: FindServiceRequestSellerReportError) => {
58
+ .then((res: FindServiceRequestSellerReportsData) => res)
59
+ .catch((err: FindServiceRequestSellerReportsError) => {
60
60
  throw err;
61
61
  });
62
62
  }
@@ -10,28 +10,30 @@ type ResultError = ErrorData['data']['error'];
10
10
 
11
11
  export type FindServiceRequestsParams = {
12
12
  filter?: {
13
- address?: string;
14
- category?: ServiceRequestCategory | ServiceRequestCategory[];
15
- createdAt?: string;
16
- 'contract.id'?: number;
17
13
  'contract.formalId'?: string;
14
+ 'contract.id'?: number;
18
15
  'contract.isSigned'?: boolean;
19
16
  'curator.id'?: number;
20
17
  'curator.supervisor'?: number;
21
- hasValuation?: boolean;
18
+ 'realty.price'?: number | { from?: number; to?: number };
19
+ 'user.id'?: number;
20
+ 'user.phones.phone.number'?: string;
21
+ address?: string;
22
+ category?: ServiceRequestCategory | ServiceRequestCategory[];
23
+ createdAt?: string;
22
24
  hasPublishedValuations?: boolean;
25
+ hasValuation?: boolean;
23
26
  id?: number | number[];
24
27
  idOrFormalId?: string;
25
28
  isDeferred?: boolean;
26
29
  isPublished?: boolean;
27
30
  realtyExtId?: number;
28
- 'realty.price'?: number | { from?: number; to?: number };
29
31
  showTrainees?: boolean;
30
32
  source?: string;
31
33
  status?: ServiceRequestStatus | ServiceRequestStatus[];
32
34
  statusDate?: string | { from?: string; to?: string };
33
35
  type?: ServiceRequestType | ServiceRequestType[];
34
- 'user.phones.phone.number'?: string;
36
+ withRealty?: boolean;
35
37
  };
36
38
  limits?: { page: number; count: number };
37
39
  };
@@ -0,0 +1,42 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
2
+ import qs from 'qs';
3
+ import { Valuation } from '../../../types';
4
+
5
+ type SuccessData = { success: true; data: Valuation };
6
+ type ErrorData = { success: false; data: { error: string } };
7
+
8
+ type ResultData = SuccessData['data'];
9
+ type ResultError = ErrorData['data']['error'];
10
+
11
+ export type FindValuationByServiceRequestIdUrlParams = { id: number };
12
+ export type FindValuationByServiceRequestIdParams = { withDrafts?: boolean };
13
+ export type FindValuationByServiceRequestIdData = AxiosResponse<ResultData>;
14
+ export type FindValuationByServiceRequestIdError = AxiosError<ResultError>;
15
+
16
+ export type FindValuationByServiceRequestIdConfig = {
17
+ baseURL?: string;
18
+ urlParams: FindValuationByServiceRequestIdUrlParams;
19
+ params?: FindValuationByServiceRequestIdParams;
20
+ };
21
+
22
+ export function findValuationByServiceRequestIdRequest({
23
+ baseURL = 'https://clients.homeapp.ru',
24
+ urlParams,
25
+ params,
26
+ }: FindValuationByServiceRequestIdConfig) {
27
+ return axios
28
+ .get(`/api/valuation/${urlParams.id}`, {
29
+ baseURL,
30
+ params,
31
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
32
+ headers: { Accept: 'application/json' },
33
+ transformResponse: [
34
+ ...(axios.defaults.transformResponse as AxiosTransformer[]),
35
+ (data: SuccessData | ErrorData): ResultData | ResultError => (data.success ? data.data : data.data.error),
36
+ ],
37
+ })
38
+ .then((res: FindValuationByServiceRequestIdData) => res)
39
+ .catch((err: FindValuationByServiceRequestIdError) => {
40
+ throw err;
41
+ });
42
+ }
@@ -0,0 +1,11 @@
1
+ import { ValuationConcurrency } from '../types';
2
+
3
+ export const ValuationDictionary = {
4
+ Concurrency: {
5
+ [ValuationConcurrency.Low]: 'Не высокий',
6
+ [ValuationConcurrency.Medium]: 'Средний',
7
+ [ValuationConcurrency.MediumHigh]: 'Выше среднего',
8
+ [ValuationConcurrency.High]: 'Высокий',
9
+ [ValuationConcurrency.VeryHigh]: 'Очень высокий',
10
+ },
11
+ };
@@ -16,3 +16,4 @@ export * from './ServiceRequestCategorizedFile';
16
16
  export * from './Shape';
17
17
  export * from './Task';
18
18
  export * from './User';
19
+ export * from './Valuation';
@@ -347,12 +347,12 @@ export class Api {
347
347
  return api.startServiceRequestModerationForOldRealtyRequest({ urlParams, headers, baseURL: this.baseURL });
348
348
  };
349
349
 
350
- findServiceRequestSellerReport = (
351
- urlParams: api.FindServiceRequestSellerReportUrlParams,
352
- params: api.FindServiceRequestSellerReportParams,
353
- headers: api.FindServiceRequestSellerReportHeaders
350
+ findServiceRequestSellerReports = (
351
+ urlParams: api.FindServiceRequestSellerReportsUrlParams,
352
+ params: api.FindServiceRequestSellerReportsParams,
353
+ headers: api.FindServiceRequestSellerReportsHeaders
354
354
  ) => {
355
- return api.findServiceRequestSellerReportRequest({ urlParams, params, headers, baseURL: this.baseURL });
355
+ return api.findServiceRequestSellerReportsRequest({ urlParams, params, headers, baseURL: this.baseURL });
356
356
  };
357
357
 
358
358
  // sold
@@ -396,6 +396,15 @@ export class Api {
396
396
  ) => {
397
397
  return api.assignSubordinateUsersRequest({ urlParams, body, headers, baseURL: this.baseURL });
398
398
  };
399
+
400
+ // valuation
401
+
402
+ findValuationByServiceRequestId = (
403
+ urlParams: api.FindValuationByServiceRequestIdUrlParams,
404
+ params?: api.FindValuationByServiceRequestIdParams
405
+ ) => {
406
+ return api.findValuationByServiceRequestIdRequest({ urlParams, params, baseURL: this.baseURL });
407
+ };
399
408
  }
400
409
 
401
410
  export * from './api';
@@ -0,0 +1,57 @@
1
+ import { ServiceRequest } from './ServiceRequest';
2
+
3
+ export enum ValuationConcurrency {
4
+ Low = 'low',
5
+ Medium = 'medium',
6
+ MediumHigh = 'medium-high',
7
+ High = 'high',
8
+ VeryHigh = 'very-high',
9
+ }
10
+
11
+ type ValueRange = { max: number; min: number; p10: number; p50: number; p90: number };
12
+
13
+ type Stats = {
14
+ count: number;
15
+ outOfRange: number;
16
+ area?: ValueRange;
17
+ price?: ValueRange;
18
+ realtyIds?: number[];
19
+ };
20
+
21
+ export type Valuation = {
22
+ addresses: number[];
23
+ comments: Array<{ comment: string; realtyId: number }>;
24
+ createdAt: string;
25
+ id: number;
26
+ isDraft: boolean;
27
+ isOnlyInMarketRangeShown: boolean;
28
+ realties: number[];
29
+ realtyParams:
30
+ | any[]
31
+ | {
32
+ address?: string;
33
+ area?: number;
34
+ floor?: number;
35
+ lat?: number;
36
+ lng?: number;
37
+ price?: number;
38
+ roomsNumber?: number;
39
+ };
40
+ serviceRequest: Partial<ServiceRequest> & Required<Pick<ServiceRequest, 'id'>>;
41
+
42
+ calculationData?: {
43
+ active: Stats;
44
+ concurrencyLevel: ValuationConcurrency;
45
+ inventoryPerBuyer: number;
46
+ sold: Stats;
47
+ };
48
+ comment?: string;
49
+ filter?: {
50
+ address?: string;
51
+ area?: { from?: number; to?: number };
52
+ floor?: { from?: number; to?: number };
53
+ floorsNumber?: { from: number; to: number };
54
+ isShortDateRange?: boolean;
55
+ roomsNumber?: number[];
56
+ };
57
+ };
@@ -27,3 +27,4 @@ export * from './Task';
27
27
  export * from './User';
28
28
  export * from './UserCase';
29
29
  export * from './UserPhone';
30
+ export * from './Valuation';
@@ -1 +1,3 @@
1
- export * from './complexes/findComplexIds';
1
+ export * from './complex/findComplexIds';
2
+
3
+ export * from './realty/findRealties';
@@ -0,0 +1,54 @@
1
+ import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
2
+ import qs from 'qs';
3
+ import { Realty } from '../../../types';
4
+
5
+ type SuccessData = { success: true; data: Realty[]; pageParams: { page: number; length: number } };
6
+ type ErrorData = { success: false; data: Record<'error' | 'message', string> };
7
+
8
+ type ResultData = { ids: number[]; byId: Record<string, Realty>; meta: { total: number } };
9
+ type ResultError = string;
10
+
11
+ export type FindRealtiesHeaders = { 'x-auth-hc': string };
12
+ export type FindRealtiesParams = {
13
+ filter?: { id?: number | number[] };
14
+ limits?: { page?: number; count?: number | 'all' };
15
+ sorting?: { direction: 'asc' | 'desc'; type: 'createdAt' | 'id' };
16
+ };
17
+ export type FindRealtiesData = AxiosResponse<ResultData>;
18
+ export type FindRealtiesError = AxiosError<ResultError>;
19
+ export type FindRealtiesConfig = {
20
+ baseURL?: string;
21
+ params: FindRealtiesParams;
22
+ };
23
+
24
+ export function findRealtiesRequest({ baseURL = 'https://clients.homeapp.ru', params }: FindRealtiesConfig) {
25
+ return axios
26
+ .get('/api/realty', {
27
+ baseURL,
28
+ params,
29
+ paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
30
+ headers: { Accept: 'application/json' },
31
+ transformResponse: [
32
+ ...(axios.defaults.transformResponse as AxiosTransformer[]),
33
+ (data: SuccessData | ErrorData): ResultData | ResultError => {
34
+ if (!data.success) {
35
+ return data.data.error || data.data.message;
36
+ }
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: FindRealtiesData) => res)
51
+ .catch((err: FindRealtiesError) => {
52
+ throw err;
53
+ });
54
+ }
@@ -0,0 +1,25 @@
1
+ import { AddressBTIParamsParking, AddressBTIParamsWallsMaterial, AddressBTIParamsHeatingType } from '../types';
2
+
3
+ export const AddressBTIParamsDictionary = {
4
+ Parking: {
5
+ [AddressBTIParamsParking.Ground]: 'Наземная',
6
+ [AddressBTIParamsParking.Multilevel]: 'Многоуровневая',
7
+ [AddressBTIParamsParking.Underground]: 'Подземная',
8
+ },
9
+ WallsMaterial: {
10
+ [AddressBTIParamsWallsMaterial.Brick]: 'Кирпичный',
11
+ [AddressBTIParamsWallsMaterial.Monolith]: 'Монолитный',
12
+ [AddressBTIParamsWallsMaterial.Monobrick]: 'Монолитно-кирпичный',
13
+ [AddressBTIParamsWallsMaterial.Timber]: 'Деревянный',
14
+ [AddressBTIParamsWallsMaterial.Panel]: 'Панельный',
15
+ [AddressBTIParamsWallsMaterial.Block]: 'Блочный',
16
+ },
17
+ HeatingType: {
18
+ [AddressBTIParamsHeatingType.None]: 'Нет',
19
+ [AddressBTIParamsHeatingType.Central]: 'Центральное',
20
+ [AddressBTIParamsHeatingType.Local]: 'Отдельное',
21
+ [AddressBTIParamsHeatingType.Gas]: 'Газовое',
22
+ [AddressBTIParamsHeatingType.Electricity]: 'Электрическое',
23
+ [AddressBTIParamsHeatingType.Liquid]: 'Жидкое топливо',
24
+ },
25
+ };
@@ -0,0 +1,84 @@
1
+ import {
2
+ RealtyType,
3
+ RealtyRenovationType,
4
+ RealtyGas,
5
+ RealtyHouseType,
6
+ RealtyLandShape,
7
+ RealtyLandUsageType,
8
+ RealtyRelief,
9
+ RealtyElectricity,
10
+ RealtyFurniture,
11
+ RealtySewerage,
12
+ RealtyWindowView,
13
+ } from '../types';
14
+
15
+ export const RealtyDictionary = {
16
+ Type: {
17
+ [RealtyType.Flat]: 'Квартира',
18
+ [RealtyType.House]: 'Дом',
19
+ },
20
+ RenovationType: {
21
+ [RealtyRenovationType.None]: 'Без ремонта',
22
+ [RealtyRenovationType.Author]: 'Авторский',
23
+ [RealtyRenovationType.Cosmetic]: 'Косметический',
24
+ [RealtyRenovationType.Euro]: 'Евро',
25
+ [RealtyRenovationType.FineFinishing]: 'Чистовая отделка',
26
+ [RealtyRenovationType.RoughFinishing]: 'Черновая отделка',
27
+ },
28
+ Gas: {
29
+ [RealtyGas.None]: 'Нет',
30
+ [RealtyGas.Connected]: 'Подключено',
31
+ [RealtyGas.Border]: 'По границе',
32
+ [RealtyGas.Possible]: 'Возможно',
33
+ [RealtyGas.Autonomous]: 'Автономное',
34
+ },
35
+ HouseType: {
36
+ [RealtyHouseType.Townhouse]: 'Таунхаус',
37
+ [RealtyHouseType.House]: 'Дом',
38
+ [RealtyHouseType.Cottage]: 'Коттедж',
39
+ [RealtyHouseType.Part]: 'Часть дома',
40
+ [RealtyHouseType.Duplex]: 'Дуплекс',
41
+ },
42
+ LandShape: {
43
+ [RealtyLandShape.Regular]: 'Правильная',
44
+ [RealtyLandShape.Irregular]: 'Неправильная',
45
+ },
46
+ LandUsageType: {
47
+ [RealtyLandUsageType.IGS]: 'ИЖС',
48
+ [RealtyLandUsageType.LPH]: 'ЛПХ (личное подсобное хозяйство)',
49
+ [RealtyLandUsageType.DNP]: 'ДНП (дачное некоммерческое партнероство)',
50
+ [RealtyLandUsageType.SNT]: 'СНТ (садоводческое некоммерческое товарищество)',
51
+ [RealtyLandUsageType.Farm]: 'Фермерское хозяйство',
52
+ [RealtyLandUsageType.Garden]: 'Садоводство',
53
+ [RealtyLandUsageType.Investproject]: 'Инвестпроект',
54
+ },
55
+ Relief: {
56
+ [RealtyRelief.Flat]: 'Ровный',
57
+ [RealtyRelief.Elevations]: 'Значительные перепады высот',
58
+ [RealtyRelief.Slope]: 'Склон',
59
+ [RealtyRelief.Hills]: 'Холмы',
60
+ },
61
+ Electricity: {
62
+ [RealtyElectricity.None]: 'Нет',
63
+ [RealtyElectricity.Connected]: 'Подключено',
64
+ [RealtyElectricity.Possible]: 'Возможно',
65
+ [RealtyElectricity.Autonomous]: 'Автономное',
66
+ },
67
+ Furniture: {
68
+ [RealtyFurniture.None]: 'Отсутствует',
69
+ [RealtyFurniture.Full]: 'Полностью мебелирован',
70
+ [RealtyFurniture.Part]: 'Частично мебелирован',
71
+ },
72
+ Sewerage: {
73
+ [RealtySewerage.None]: 'Нет',
74
+ [RealtySewerage.Cesspool]: 'Выгребная яма',
75
+ [RealtySewerage.Septic]: 'Септик',
76
+ [RealtySewerage.Bio]: 'Устройства биологической очистки',
77
+ [RealtySewerage.Central]: 'Центральная',
78
+ },
79
+ WindowView: {
80
+ [RealtyWindowView.Street]: 'На улицу',
81
+ [RealtyWindowView.Yard]: 'Во двор',
82
+ [RealtyWindowView.Both]: 'В обе стороны',
83
+ },
84
+ };
@@ -0,0 +1,12 @@
1
+ import { ShapeType } from '../types';
2
+
3
+ export const ShapeDictionary = {
4
+ Type: {
5
+ [ShapeType.AdministrativeDistrict]: 'Административный округ',
6
+ [ShapeType.Block]: 'Квартал',
7
+ [ShapeType.Complex]: 'Новостройка',
8
+ [ShapeType.District]: 'Район',
9
+ [ShapeType.House]: 'Здание',
10
+ [ShapeType.Microdistrict]: 'Микрорайон',
11
+ },
12
+ };
@@ -0,0 +1,3 @@
1
+ export * from './AddressBTIParams';
2
+ export * from './Realty';
3
+ export * from './Shape';
@@ -3,9 +3,19 @@ import * as api from './api';
3
3
  export class Api {
4
4
  constructor(private baseURL: string | undefined) {}
5
5
 
6
+ // complex
7
+
6
8
  findComplexIds = (params: api.FindComplexIdsParams) => {
7
9
  return api.findComplexIdsRequest({ params, baseURL: this.baseURL });
8
10
  };
11
+
12
+ // realty
13
+
14
+ findRealties = (params: api.FindRealtiesParams) => {
15
+ return api.findRealtiesRequest({ params, baseURL: this.baseURL });
16
+ };
9
17
  }
10
18
 
11
19
  export * from './api';
20
+ export * from './dictionaries';
21
+ export * from './types';
@@ -0,0 +1,29 @@
1
+ import { AddressBTIParams } from './AddressBTIParams';
2
+ import { AddressMetroDistance } from './AddressMetroDistance';
3
+ import { Shape } from './Shape';
4
+
5
+ export type Address = {
6
+ btiParams: Partial<AddressBTIParams>;
7
+ country: string;
8
+ fullAddress: string;
9
+ id: number;
10
+ isManual: boolean;
11
+ lat: number;
12
+ lng: number;
13
+ metroDistances: Array<Partial<AddressMetroDistance> & { id: number }>;
14
+ shapes: Array<Partial<Shape> & { id: number }>;
15
+
16
+ city?: string;
17
+ cityArea?: string;
18
+ district?: string;
19
+ draftName?: string;
20
+ fiasCode?: number;
21
+ house?: string;
22
+ kladrCode?: number;
23
+ medianPrice?: number;
24
+ medianSqmPrice?: number;
25
+ postalCode?: number;
26
+ realtyIds?: number[];
27
+ region?: string;
28
+ street?: string;
29
+ };
@@ -0,0 +1,42 @@
1
+ export enum AddressBTIParamsParking {
2
+ Ground = 'ground',
3
+ Multilevel = 'multilevel',
4
+ Underground = 'underground',
5
+ }
6
+
7
+ export enum AddressBTIParamsWallsMaterial {
8
+ Brick = 'brick',
9
+ Monolith = 'monolith',
10
+ Monobrick = 'monobrick',
11
+ Timber = 'timber',
12
+ Panel = 'panel',
13
+ Block = 'block',
14
+ }
15
+
16
+ export enum AddressBTIParamsHeatingType {
17
+ None = 'none',
18
+ Central = 'central',
19
+ Local = 'local',
20
+ Gas = 'gas',
21
+ Electricity = 'electricity',
22
+ Liquid = 'liquid',
23
+ }
24
+
25
+ export type AddressBTIParams = {
26
+ buildYear?: number;
27
+ cargoLifts?: number;
28
+ ceilingHeight?: number;
29
+ deliveryQuarter?: number;
30
+ deliveryYear?: number;
31
+ emergency?: boolean;
32
+ floors?: number;
33
+ garbageChute?: boolean;
34
+ heatingType?: AddressBTIParamsHeatingType;
35
+ id?: number;
36
+ isDelivered?: boolean;
37
+ isUpToDate?: boolean;
38
+ parking?: AddressBTIParamsParking;
39
+ passengerLifts?: number;
40
+ series?: string;
41
+ wallsMaterial?: AddressBTIParamsWallsMaterial;
42
+ };
@@ -0,0 +1,9 @@
1
+ export type AddressMetroDistance = {
2
+ distance: number;
3
+ id: number;
4
+ metroLine: string;
5
+ metroLineColor: string;
6
+ metroStation: string;
7
+ timeCar: number;
8
+ timeFoot: number;
9
+ };
@@ -0,0 +1,13 @@
1
+ export enum ImageType {
2
+ Complex = 'complex',
3
+ Apartment = 'apartment',
4
+ Layout = 'layout',
5
+ }
6
+
7
+ export type Image = {
8
+ id: number;
9
+ properties: { oldId?: number; maxSize?: string };
10
+ storagePath: string;
11
+ thumbnailPath: string;
12
+ type: string | ImageType;
13
+ };