@hapl/api-queries 0.1.162 → 0.1.163--canary.91.5e5d846.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 CHANGED
@@ -1,15 +1,3 @@
1
- # v0.1.162 (Mon May 23 2022)
2
-
3
- #### 🐛 Bug Fix
4
-
5
- - FE-1328: Добавлено поле `isNewFlat` для realty V1 [#90](https://github.com/homeappcorporate/api-queries/pull/90) ([@abd2561024](https://github.com/abd2561024))
6
-
7
- #### Authors: 1
8
-
9
- - Andrey Romashin ([@abd2561024](https://github.com/abd2561024))
10
-
11
- ---
12
-
13
1
  # v0.1.161 (Mon May 23 2022)
14
2
 
15
3
  #### 🐛 Bug Fix
@@ -3220,7 +3220,8 @@ var PhotoOrderRenovation;
3220
3220
  var RealtyType;
3221
3221
 
3222
3222
  (function (RealtyType) {
3223
- RealtyType["Flat"] = "flat";
3223
+ RealtyType["FlatSecondary"] = "flat_secondary";
3224
+ RealtyType["FlatNew"] = "flat_new";
3224
3225
  RealtyType["House"] = "house";
3225
3226
  })(RealtyType || (RealtyType = {}));
3226
3227
 
@@ -3719,7 +3720,7 @@ var PhotoOrderDictionary = {
3719
3720
 
3720
3721
  var _Type$7, _RenovationType, _Gas, _HouseType, _LandShape, _LandUsageType, _Relief, _Electricity, _Furniture, _Sewerage, _WindowView;
3721
3722
  var RealtyDictionary = {
3722
- Type: (_Type$7 = {}, _Type$7[RealtyType.Flat] = 'Квартира', _Type$7[RealtyType.House] = 'Дом', _Type$7),
3723
+ Type: (_Type$7 = {}, _Type$7[RealtyType.FlatSecondary] = 'Вторичка', _Type$7[RealtyType.FlatNew] = 'Новостройка', _Type$7[RealtyType.House] = 'Дом', _Type$7),
3723
3724
  RenovationType: (_RenovationType = {}, _RenovationType[RealtyRenovationType.None] = 'Без ремонта', _RenovationType[RealtyRenovationType.Author] = 'Авторский', _RenovationType[RealtyRenovationType.Cosmetic] = 'Косметический', _RenovationType[RealtyRenovationType.Euro] = 'Евро', _RenovationType[RealtyRenovationType.FineFinishing] = 'Чистовая отделка', _RenovationType[RealtyRenovationType.RoughFinishing] = 'Черновая отделка', _RenovationType),
3724
3725
  Gas: (_Gas = {}, _Gas[RealtyGas.None] = 'Нет', _Gas[RealtyGas.Connected] = 'Подключено', _Gas[RealtyGas.Border] = 'По границе', _Gas[RealtyGas.Possible] = 'Возможно', _Gas[RealtyGas.Autonomous] = 'Автономное', _Gas),
3725
3726
  HouseType: (_HouseType = {}, _HouseType[RealtyHouseType.Townhouse] = 'Таунхаус', _HouseType[RealtyHouseType.House] = 'Дом', _HouseType[RealtyHouseType.Cottage] = 'Коттедж', _HouseType[RealtyHouseType.Part] = 'Часть дома', _HouseType[RealtyHouseType.Duplex] = 'Дуплекс', _HouseType),
@@ -6980,6 +6981,51 @@ function findComplexIdsRequest(_ref) {
6980
6981
  });
6981
6982
  }
6982
6983
 
6984
+ function uploadImagesRequest(_ref) {
6985
+ var _ref$baseURL = _ref.baseURL,
6986
+ baseURL = _ref$baseURL === void 0 ? 'https://registry.homeapp.ru' : _ref$baseURL,
6987
+ body = _ref.body,
6988
+ headers = _ref.headers;
6989
+ var formData = new FormData();
6990
+
6991
+ if (body.length === 0) {
6992
+ throw new Error('Список изображений пуст');
6993
+ }
6994
+
6995
+ if (body.length > 1) {
6996
+ body.forEach(function (file, index) {
6997
+ formData.append("file" + index, file);
6998
+ });
6999
+ } else {
7000
+ formData.append('file', body[0]);
7001
+ }
7002
+
7003
+ return axios.post('/api/image/upload', formData, {
7004
+ baseURL: baseURL,
7005
+ headers: _extends({
7006
+ Accept: 'application/json',
7007
+ 'Content-Type': 'multipart/form-data'
7008
+ }, headers),
7009
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
7010
+ if (!data.success) return data.data.error || data.data.message;
7011
+ var ids = [];
7012
+ var byId = {};
7013
+ data.data.forEach(function (entity) {
7014
+ byId[entity.id] = entity;
7015
+ ids.push(entity.id);
7016
+ });
7017
+ return {
7018
+ ids: ids,
7019
+ byId: byId
7020
+ };
7021
+ }])
7022
+ }).then(function (res) {
7023
+ return res;
7024
+ })["catch"](function (err) {
7025
+ throw err;
7026
+ });
7027
+ }
7028
+
6983
7029
  function findRealtiesRequest$1(_ref) {
6984
7030
  var _ref$baseURL = _ref.baseURL,
6985
7031
  baseURL = _ref$baseURL === void 0 ? 'https://registry.homeapp.ru' : _ref$baseURL,
@@ -7245,15 +7291,7 @@ var ValuationDictionary = {
7245
7291
  var Api$3 = function Api(baseURL) {
7246
7292
  var _this = this;
7247
7293
 
7248
- this.baseURL = baseURL; // complex
7249
-
7250
- this.findComplexIds = function (params) {
7251
- return findComplexIdsRequest({
7252
- params: params,
7253
- baseURL: _this.baseURL
7254
- });
7255
- }; // address
7256
-
7294
+ this.baseURL = baseURL; // address
7257
7295
 
7258
7296
  this.createAddress = function (body, headers) {
7259
7297
  return createAddressRequest$1({
@@ -7269,6 +7307,23 @@ var Api$3 = function Api(baseURL) {
7269
7307
  headers: headers,
7270
7308
  baseURL: _this.baseURL
7271
7309
  });
7310
+ }; // complex
7311
+
7312
+
7313
+ this.findComplexIds = function (params) {
7314
+ return findComplexIdsRequest({
7315
+ params: params,
7316
+ baseURL: _this.baseURL
7317
+ });
7318
+ }; // image
7319
+
7320
+
7321
+ this.uploadImages = function (body, headers) {
7322
+ return uploadImagesRequest({
7323
+ body: body,
7324
+ headers: headers,
7325
+ baseURL: _this.baseURL
7326
+ });
7272
7327
  }; // realty
7273
7328
 
7274
7329
 
@@ -7286,7 +7341,7 @@ var Api$3 = function Api(baseURL) {
7286
7341
  headers: headers,
7287
7342
  baseURL: _this.baseURL
7288
7343
  });
7289
- }; // valuate
7344
+ }; // valuation
7290
7345
 
7291
7346
 
7292
7347
  this.calculateValuation = function (body, headers) {
@@ -7305,6 +7360,7 @@ var index$3 = {
7305
7360
  findAddressByIdRequest: findAddressByIdRequest,
7306
7361
  findAddressesByRealtyParamsRequest: findAddressesByRealtyParamsRequest,
7307
7362
  findComplexIdsRequest: findComplexIdsRequest,
7363
+ uploadImagesRequest: uploadImagesRequest,
7308
7364
  findRealtiesRequest: findRealtiesRequest$1,
7309
7365
  calculateValuationRequest: calculateValuationRequest,
7310
7366
  AddressBTIParamsDictionary: AddressBTIParamsDictionary$2,