@hapl/api-queries 0.1.118 → 0.1.121

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 (51) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/api-queries.cjs.development.js +324 -30
  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 +324 -30
  7. package/dist/api-queries.esm.js.map +1 -1
  8. package/dist/clients/v1/api/buyer/countBuyers/index.d.ts +21 -0
  9. package/dist/clients/v1/api/index.d.ts +2 -1
  10. package/dist/clients/v1/api/serviceRequest/findServiceRequestSellerReports/index.d.ts +42 -0
  11. package/dist/clients/v1/index.d.ts +2 -1
  12. package/dist/publisher/v1/api/findActualEventsRow/index.d.ts +20 -15
  13. package/dist/registry/v1/api/{complexes → complex}/findComplexIds/index.d.ts +0 -0
  14. package/dist/registry/v1/api/index.d.ts +2 -1
  15. package/dist/registry/v1/api/realty/findRealties/index.d.ts +34 -0
  16. package/dist/registry/v1/dictionaries/AddressBTIParams.d.ts +24 -0
  17. package/dist/registry/v1/dictionaries/Realty.d.ts +71 -0
  18. package/dist/registry/v1/dictionaries/Shape.d.ts +11 -0
  19. package/dist/registry/v1/dictionaries/index.d.ts +3 -0
  20. package/dist/registry/v1/index.d.ts +3 -0
  21. package/dist/registry/v1/types/Address.d.ts +31 -0
  22. package/dist/registry/v1/types/AddressBTIParams.d.ts +39 -0
  23. package/dist/registry/v1/types/AddressMetroDistance.d.ts +9 -0
  24. package/dist/registry/v1/types/Image.d.ts +15 -0
  25. package/dist/registry/v1/types/Realty.d.ts +116 -0
  26. package/dist/registry/v1/types/RealtyOffer.d.ts +6 -0
  27. package/dist/registry/v1/types/Shape.d.ts +24 -0
  28. package/dist/registry/v1/types/index.d.ts +7 -0
  29. package/package.json +2 -1
  30. package/src/clients/v1/api/buyer/countBuyers/index.ts +47 -0
  31. package/src/clients/v1/api/index.ts +3 -1
  32. package/src/clients/v1/api/serviceRequest/{findServiceRequestSellerReport → findServiceRequestSellerReports}/index.ts +13 -13
  33. package/src/clients/v1/index.ts +11 -5
  34. package/src/publisher/v1/api/findActualEventsRow/index.ts +34 -33
  35. package/src/registry/v1/api/{complexes → complex}/findComplexIds/index.ts +0 -0
  36. package/src/registry/v1/api/index.ts +3 -1
  37. package/src/registry/v1/api/realty/findRealties/index.ts +54 -0
  38. package/src/registry/v1/dictionaries/AddressBTIParams.ts +25 -0
  39. package/src/registry/v1/dictionaries/Realty.ts +84 -0
  40. package/src/registry/v1/dictionaries/Shape.ts +12 -0
  41. package/src/registry/v1/dictionaries/index.ts +3 -0
  42. package/src/registry/v1/index.ts +10 -0
  43. package/src/registry/v1/types/Address.ts +29 -0
  44. package/src/registry/v1/types/AddressBTIParams.ts +42 -0
  45. package/src/registry/v1/types/AddressMetroDistance.ts +9 -0
  46. package/src/registry/v1/types/Image.ts +13 -0
  47. package/src/registry/v1/types/Realty.ts +123 -0
  48. package/src/registry/v1/types/RealtyOffer.ts +6 -0
  49. package/src/registry/v1/types/Shape.ts +24 -0
  50. package/src/registry/v1/types/index.ts +7 -0
  51. package/dist/clients/v1/api/serviceRequest/findServiceRequestSellerReport/index.d.ts +0 -42
@@ -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
  }
@@ -39,6 +39,12 @@ export class Api {
39
39
  return api.deleteAvailableFundsRequest({ urlParams, headers, baseURL: this.baseURL });
40
40
  };
41
41
 
42
+ // buyer
43
+
44
+ countBuyers = (params: api.CountBuyersParams, headers: api.CountBuyersHeaders) => {
45
+ return api.countBuyersRequest({ params, headers, baseURL: this.baseURL });
46
+ };
47
+
42
48
  // call
43
49
 
44
50
  findCalls = (params: api.FindCallsParams, headers: api.FindCallsHeaders) => {
@@ -347,12 +353,12 @@ export class Api {
347
353
  return api.startServiceRequestModerationForOldRealtyRequest({ urlParams, headers, baseURL: this.baseURL });
348
354
  };
349
355
 
350
- findServiceRequestSellerReport = (
351
- urlParams: api.FindServiceRequestSellerReportUrlParams,
352
- params: api.FindServiceRequestSellerReportParams,
353
- headers: api.FindServiceRequestSellerReportHeaders
356
+ findServiceRequestSellerReports = (
357
+ urlParams: api.FindServiceRequestSellerReportsUrlParams,
358
+ params: api.FindServiceRequestSellerReportsParams,
359
+ headers: api.FindServiceRequestSellerReportsHeaders
354
360
  ) => {
355
- return api.findServiceRequestSellerReportRequest({ urlParams, params, headers, baseURL: this.baseURL });
361
+ return api.findServiceRequestSellerReportsRequest({ urlParams, params, headers, baseURL: this.baseURL });
356
362
  };
357
363
 
358
364
  // sold
@@ -1,24 +1,24 @@
1
- import axios, { AxiosResponse, AxiosError } from 'axios';
1
+ import axios, { AxiosResponse, AxiosError, AxiosTransformer } from 'axios';
2
+ import { nanoid } from 'nanoid';
2
3
  import qs from 'qs';
3
4
  import { ActualEventsRow } from '../../types';
4
5
 
5
6
  type SuccessData = { success: true; data: ActualEventsRow[]; pageParams: { page: number; length: number } };
6
-
7
7
  type ErrorData = { success?: false; data?: { error: string }; message?: string };
8
8
 
9
- export type FindActualEventsRowHeaders = { 'x-auth-hc': string };
9
+ type ResultData = { ids: string[]; byId: Record<string, ActualEventsRow & { _id: string }>; meta: { total: number } };
10
+ type ResultError = string;
10
11
 
12
+ export type FindActualEventsRowHeaders = { 'x-auth-hc': string };
11
13
  export type FindActualEventsRowParams = {
12
- filter?: { 'apartment.id'?: number };
13
- limits?: { page: number; count: number };
14
- };
15
-
16
- export type FindActualEventsRowData = {
17
- data: { ids: number[]; byId: Record<string, ActualEventsRow> };
18
- meta: { total: number };
14
+ filter?: {
15
+ 'realty.id'?: number;
16
+ createdAt?: { from?: string; to?: string };
17
+ };
18
+ limits?: { page: number; count: number | 'all' };
19
19
  };
20
-
21
- export type FindActualEventsRowError = { status: number; data: string };
20
+ export type FindActualEventsRowData = AxiosResponse<ResultData>;
21
+ export type FindActualEventsRowError = AxiosError<ResultError>;
22
22
 
23
23
  export type FindActualEventsRowConfig = {
24
24
  baseURL?: string;
@@ -37,27 +37,28 @@ export function findActualEventsRowRequest({
37
37
  params,
38
38
  paramsSerializer: params => qs.stringify(params, { arrayFormat: 'brackets' }),
39
39
  headers: { Accept: 'application/json', ...headers },
40
+ transformResponse: [
41
+ ...(axios.defaults.transformResponse as AxiosTransformer[]),
42
+ (data: SuccessData | ErrorData): ResultData | ResultError => {
43
+ if (data.success) {
44
+ const ids: ResultData['ids'] = [];
45
+ const byId: ResultData['byId'] = {};
46
+
47
+ data.data.forEach(entity => {
48
+ const _id = nanoid();
49
+ byId[_id] = { ...entity, _id };
50
+ ids.push(_id);
51
+ });
52
+
53
+ return { ids, byId, meta: { total: data.pageParams.length } };
54
+ }
55
+
56
+ return data.data?.error ?? data.message ?? 'Unknown Error';
57
+ },
58
+ ],
40
59
  })
41
- .then(
42
- (res: AxiosResponse<SuccessData>): FindActualEventsRowData => {
43
- const data: FindActualEventsRowData = {
44
- data: { byId: {}, ids: [] },
45
- meta: { total: res.data.pageParams.length },
46
- };
47
-
48
- res.data.data.forEach(entity => {
49
- data.data.byId[entity.apartmentId] = entity;
50
- data.data.ids.push(entity.apartmentId);
51
- });
52
-
53
- return data;
54
- }
55
- )
56
- .catch((err: AxiosError<ErrorData>) => {
57
- const error: Error & Partial<FindActualEventsRowError> = new Error(err.message);
58
- error.status = err.response?.status ?? 520;
59
- error.data = err.response?.data.message ?? err.response?.data.data?.error ?? 'Unknown Error';
60
-
61
- throw error;
60
+ .then((res: FindActualEventsRowData) => res)
61
+ .catch((err: FindActualEventsRowError) => {
62
+ throw err;
62
63
  });
63
64
  }
@@ -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
+ };
@@ -0,0 +1,123 @@
1
+ import { Address } from './Address';
2
+ import { Image } from './Image';
3
+ import { RealtyOffer } from './RealtyOffer';
4
+
5
+ export enum RealtyType {
6
+ Flat = 'flat',
7
+ House = 'house',
8
+ }
9
+
10
+ export enum RealtyRenovationType {
11
+ None = 'none',
12
+ Author = 'author',
13
+ Cosmetic = 'cosmetic',
14
+ Euro = 'euro',
15
+ FineFinishing = 'fine_finishing',
16
+ RoughFinishing = 'rough_finishing',
17
+ }
18
+
19
+ export enum RealtyGas {
20
+ None = 'none',
21
+ Connected = 'connected',
22
+ Border = 'border',
23
+ Possible = 'possible',
24
+ Autonomous = 'autonomous',
25
+ }
26
+
27
+ export enum RealtyHouseType {
28
+ Townhouse = 'townhouse',
29
+ House = 'house',
30
+ Cottage = 'cottage',
31
+ Part = 'part',
32
+ Duplex = 'duplex',
33
+ }
34
+
35
+ export enum RealtyLandShape {
36
+ Regular = 'regular',
37
+ Irregular = 'irregular',
38
+ }
39
+
40
+ export enum RealtyLandUsageType {
41
+ IGS = 'igs',
42
+ LPH = 'lph',
43
+ DNP = 'dnp',
44
+ SNT = 'snt',
45
+ Farm = 'farm',
46
+ Garden = 'garden',
47
+ Investproject = 'investproject',
48
+ }
49
+
50
+ export enum RealtyRelief {
51
+ Flat = 'flat',
52
+ Elevations = 'elevations',
53
+ Slope = 'slope',
54
+ Hills = 'hills',
55
+ }
56
+
57
+ export enum RealtyElectricity {
58
+ None = 'none',
59
+ Connected = 'connected',
60
+ Possible = 'possible',
61
+ Autonomous = 'autonomous',
62
+ }
63
+
64
+ export enum RealtyFurniture {
65
+ None = 'none',
66
+ Full = 'full',
67
+ Part = 'part',
68
+ }
69
+
70
+ export enum RealtySewerage {
71
+ None = 'none',
72
+ Cesspool = 'cesspool',
73
+ Septic = 'septic',
74
+ Bio = 'bio',
75
+ Central = 'central',
76
+ }
77
+
78
+ export enum RealtyWindowView {
79
+ Street = 'street',
80
+ Yard = 'yard',
81
+ Both = 'both',
82
+ }
83
+
84
+ export type Realty = {
85
+ address: Partial<Address> & { id: number };
86
+ addressId: number;
87
+ area: number;
88
+ createdAt: string;
89
+ floor: number;
90
+ id: number;
91
+ images: Array<Partial<Image> & { id: number }>;
92
+ price: number;
93
+ realtyType: RealtyType;
94
+ renovationType: RealtyRenovationType;
95
+ roomsNumber: number;
96
+
97
+ balconyCount?: number;
98
+ burden?: boolean;
99
+ ceilingHeight?: number;
100
+ chambers?: string;
101
+ cityDistance?: number;
102
+ communityName?: string;
103
+ documentationUrl?: number;
104
+ electricity?: RealtyElectricity;
105
+ features?: string[];
106
+ floorsNumber?: number;
107
+ furniture?: RealtyFurniture;
108
+ gas?: RealtyGas;
109
+ houseType?: RealtyHouseType;
110
+ isDevelopersOffer?: boolean;
111
+ kitchenArea?: number;
112
+ landArea?: number;
113
+ landShape?: RealtyLandShape;
114
+ landUsageType?: RealtyLandUsageType;
115
+ livingArea?: number;
116
+ mainOffer?: Partial<RealtyOffer> & { id: number };
117
+ number?: number;
118
+ relief?: RealtyRelief;
119
+ separatedRoomsNumber?: number;
120
+ sewerage?: RealtySewerage;
121
+ soldAt?: string;
122
+ windowView?: RealtyWindowView;
123
+ };
@@ -0,0 +1,6 @@
1
+ export type RealtyOffer = {
2
+ extId: string;
3
+ id: number;
4
+ source: string;
5
+ url: string;
6
+ };
@@ -0,0 +1,24 @@
1
+ type Coordinates = number[];
2
+
3
+ type Polygon = { type: 'Polygon'; coordinates: Array<Coordinates> };
4
+
5
+ type MultiPolygon = {
6
+ type: 'MultiPolygon';
7
+ coordinates: Array<Array<Coordinates>>;
8
+ };
9
+
10
+ export enum ShapeType {
11
+ AdministrativeDistrict = 'administrative_district',
12
+ Block = 'block',
13
+ Complex = 'complex',
14
+ District = 'district',
15
+ House = 'house',
16
+ Microdistrict = 'microdistrict',
17
+ }
18
+
19
+ export type Shape = {
20
+ geometry: Polygon | MultiPolygon;
21
+ id: number;
22
+ name: string;
23
+ type: ShapeType;
24
+ };
@@ -0,0 +1,7 @@
1
+ export * from './Address';
2
+ export * from './AddressBTIParams';
3
+ export * from './AddressMetroDistance';
4
+ export * from './Image';
5
+ export * from './Realty';
6
+ export * from './RealtyOffer';
7
+ export * from './Shape';