@hapl/api-queries 0.1.114 → 0.1.115

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 (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/api-queries.cjs.development.js +111 -21
  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 +111 -21
  7. package/dist/api-queries.esm.js.map +1 -1
  8. package/dist/clients/v1/api/experts/findExperts/index.d.ts +22 -17
  9. package/dist/clients/v1/api/index.d.ts +2 -0
  10. package/dist/clients/v1/api/serviceRequest/findServiceRequestSellerReport/index.d.ts +42 -0
  11. package/dist/clients/v1/api/sold/findSoldStatistic/index.d.ts +25 -0
  12. package/dist/clients/v1/index.d.ts +2 -0
  13. package/dist/clients/v1/types/ServiceRequestSellerReport.d.ts +20 -0
  14. package/dist/clients/v1/types/SoldStatistic.d.ts +9 -0
  15. package/dist/clients/v1/types/User.d.ts +1 -0
  16. package/dist/clients/v1/types/index.d.ts +2 -0
  17. package/dist/clients/v2/api/realty/findRealtyById/index.d.ts +1 -0
  18. package/package.json +1 -1
  19. package/src/clients/v1/api/experts/findExperts/index.ts +33 -29
  20. package/src/clients/v1/api/index.ts +3 -0
  21. package/src/clients/v1/api/serviceRequest/findServiceRequestSellerReport/index.ts +62 -0
  22. package/src/clients/v1/api/sold/findSoldStatistic/index.ts +35 -0
  23. package/src/clients/v1/index.ts +14 -0
  24. package/src/clients/v1/types/ServiceRequestSellerReport.ts +20 -0
  25. package/src/clients/v1/types/SoldStatistic.ts +10 -0
  26. package/src/clients/v1/types/User.ts +1 -0
  27. package/src/clients/v1/types/index.ts +2 -0
  28. package/src/clients/v2/api/realty/findRealtyById/index.ts +1 -0
@@ -591,31 +591,34 @@ function findExpertsRequest(_ref) {
591
591
  return axios.get('/api/experts', {
592
592
  baseURL: baseURL,
593
593
  params: params,
594
+ paramsSerializer: function paramsSerializer(params) {
595
+ return qs.stringify(params, {
596
+ arrayFormat: 'brackets'
597
+ });
598
+ },
594
599
  headers: {
595
600
  Accept: 'application/json'
596
- }
601
+ },
602
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
603
+ if (!data.success) return data.data.error;
604
+ var ids = [];
605
+ var byId = {};
606
+ data.data.forEach(function (entity) {
607
+ byId[entity.id] = entity;
608
+ ids.push(entity.id);
609
+ });
610
+ return {
611
+ ids: ids,
612
+ byId: byId,
613
+ meta: {
614
+ total: data.pageParams.length
615
+ }
616
+ };
617
+ }])
597
618
  }).then(function (res) {
598
- var data = {
599
- data: {
600
- byId: {},
601
- ids: []
602
- },
603
- meta: {
604
- total: res.data.pageParams.length
605
- }
606
- };
607
- res.data.data.forEach(function (entity) {
608
- data.data.byId[entity.id] = entity;
609
- data.data.ids.push(entity.id);
610
- });
611
- return data;
619
+ return res;
612
620
  })["catch"](function (err) {
613
- var _err$response$status, _err$response, _err$response$data$da, _err$response2;
614
-
615
- var error = new Error(err.message);
616
- error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
617
- error.data = (_err$response$data$da = (_err$response2 = err.response) == null ? void 0 : _err$response2.data.data.error) != null ? _err$response$data$da : 'Unknown Error';
618
- throw error;
621
+ throw err;
619
622
  });
620
623
  }
621
624
 
@@ -1162,6 +1165,46 @@ function findServiceRequestsRequest(_ref) {
1162
1165
  });
1163
1166
  }
1164
1167
 
1168
+ function findServiceRequestSellerReportRequest(_ref) {
1169
+ var _ref$baseURL = _ref.baseURL,
1170
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1171
+ urlParams = _ref.urlParams,
1172
+ headers = _ref.headers,
1173
+ params = _ref.params;
1174
+ return axios.get("/api/service-request/" + urlParams.id + "/report-for-seller", {
1175
+ baseURL: baseURL,
1176
+ params: params,
1177
+ paramsSerializer: function paramsSerializer(params) {
1178
+ return qs.stringify(params, {
1179
+ arrayFormat: 'brackets'
1180
+ });
1181
+ },
1182
+ headers: _extends({
1183
+ Accept: 'application/json'
1184
+ }, headers),
1185
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1186
+ if (!data.success) return data.data.error;
1187
+ var ids = [];
1188
+ var byId = {};
1189
+ data.data.forEach(function (entity) {
1190
+ byId[entity.id] = entity;
1191
+ ids.push(entity.id);
1192
+ });
1193
+ return {
1194
+ ids: ids,
1195
+ byId: byId,
1196
+ meta: {
1197
+ total: data.pageParams.length
1198
+ }
1199
+ };
1200
+ }])
1201
+ }).then(function (res) {
1202
+ return res;
1203
+ })["catch"](function (err) {
1204
+ throw err;
1205
+ });
1206
+ }
1207
+
1165
1208
  function findServiceRequestShortInfoRequest(_ref) {
1166
1209
  var _ref$baseURL = _ref.baseURL,
1167
1210
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -1393,6 +1436,25 @@ function startServiceRequestModerationForOldRealtyRequest(_ref) {
1393
1436
  });
1394
1437
  }
1395
1438
 
1439
+ function findSoldStatisticRequest(_ref) {
1440
+ var _ref$baseURL = _ref.baseURL,
1441
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1442
+ headers = _ref.headers;
1443
+ return axios.get('/api/sold/statistic', {
1444
+ baseURL: baseURL,
1445
+ headers: _extends({
1446
+ Accept: 'application/json'
1447
+ }, headers),
1448
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1449
+ return data.success ? data.data : data.data.error;
1450
+ }])
1451
+ }).then(function (res) {
1452
+ return res;
1453
+ })["catch"](function (err) {
1454
+ throw err;
1455
+ });
1456
+ }
1457
+
1396
1458
  function createUserRequest(_ref) {
1397
1459
  var _ref$baseURL = _ref.baseURL,
1398
1460
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -2186,6 +2248,14 @@ var ShapeType;
2186
2248
  ShapeType["Microdistrict"] = "microdistrict";
2187
2249
  })(ShapeType || (ShapeType = {}));
2188
2250
 
2251
+ var SoldStatisticTypes;
2252
+
2253
+ (function (SoldStatisticTypes) {
2254
+ SoldStatisticTypes["House"] = "house";
2255
+ SoldStatisticTypes["FlatNew"] = "flat_new";
2256
+ SoldStatisticTypes["FlatSecondary"] = "flat_secondary";
2257
+ })(SoldStatisticTypes || (SoldStatisticTypes = {}));
2258
+
2189
2259
  var TaskStatus;
2190
2260
 
2191
2261
  (function (TaskStatus) {
@@ -2916,6 +2986,23 @@ var Api = function Api(baseURL) {
2916
2986
  headers: headers,
2917
2987
  baseURL: _this.baseURL
2918
2988
  });
2989
+ };
2990
+
2991
+ this.findServiceRequestSellerReport = function (urlParams, params, headers) {
2992
+ return findServiceRequestSellerReportRequest({
2993
+ urlParams: urlParams,
2994
+ params: params,
2995
+ headers: headers,
2996
+ baseURL: _this.baseURL
2997
+ });
2998
+ }; // sold
2999
+
3000
+
3001
+ this.findSoldStatistic = function (headers) {
3002
+ return findSoldStatisticRequest({
3003
+ headers: headers,
3004
+ baseURL: _this.baseURL
3005
+ });
2919
3006
  }; // task
2920
3007
 
2921
3008
 
@@ -3028,6 +3115,7 @@ var index = {
3028
3115
  findServiceRequestByIdRequest: findServiceRequestByIdRequest,
3029
3116
  findServiceRequestDuplicatesRequest: findServiceRequestDuplicatesRequest,
3030
3117
  findServiceRequestsRequest: findServiceRequestsRequest,
3118
+ findServiceRequestSellerReportRequest: findServiceRequestSellerReportRequest,
3031
3119
  findServiceRequestShortInfoRequest: findServiceRequestShortInfoRequest,
3032
3120
  findServiceRequestShortInfoByIdRequest: findServiceRequestShortInfoByIdRequest,
3033
3121
  findServiceRequestShortInfoByDealIdRequest: findServiceRequestShortInfoByDealIdRequest,
@@ -3037,6 +3125,7 @@ var index = {
3037
3125
  sendServiceRequestToModerationRequest: sendServiceRequestToModerationRequest,
3038
3126
  startServiceRequestModerationRequest: startServiceRequestModerationRequest,
3039
3127
  startServiceRequestModerationForOldRealtyRequest: startServiceRequestModerationForOldRealtyRequest,
3128
+ findSoldStatisticRequest: findSoldStatisticRequest,
3040
3129
  createUserRequest: createUserRequest,
3041
3130
  findUsersRequest: findUsersRequest,
3042
3131
  findUserByIdRequest: findUserByIdRequest,
@@ -3115,6 +3204,7 @@ var index = {
3115
3204
  get ServiceRequestActivityType () { return ServiceRequestActivityType; },
3116
3205
  get ServiceRequestCategorizedFileCategory () { return ServiceRequestCategorizedFileCategory; },
3117
3206
  get ShapeType () { return ShapeType; },
3207
+ get SoldStatisticTypes () { return SoldStatisticTypes; },
3118
3208
  get TaskStatus () { return TaskStatus; },
3119
3209
  get TaskImportance () { return TaskImportance; },
3120
3210
  get TaskNotificationType () { return TaskNotificationType; },