@hapl/api-queries 0.1.180 → 0.1.182--canary.109.b01b5f5.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,3 +1,15 @@
1
+ # v0.1.181 (Tue Aug 09 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - FE-1363: для ручки запроса юзеров исправлено обязательность заголовков запроса [#108](https://github.com/homeappcorporate/api-queries/pull/108) ([@abd2561024](https://github.com/abd2561024))
6
+
7
+ #### Authors: 1
8
+
9
+ - Andrey Romashin ([@abd2561024](https://github.com/abd2561024))
10
+
11
+ ---
12
+
1
13
  # v0.1.180 (Tue Aug 09 2022)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -1323,77 +1323,45 @@ function updateDealRequest(_ref) {
1323
1323
  });
1324
1324
  }
1325
1325
 
1326
- function findExpertsRequest(_ref) {
1326
+ function createExpertCaseRequest(_ref) {
1327
1327
  var _ref$baseURL = _ref.baseURL,
1328
1328
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1329
- params = _ref.params;
1330
- return axios.get('/api/experts', {
1329
+ headers = _ref.headers,
1330
+ body = _ref.body;
1331
+ return axios.post('/api/expert/case', body, {
1331
1332
  baseURL: baseURL,
1332
- params: params,
1333
- paramsSerializer: function paramsSerializer(params) {
1334
- return qs.stringify(params, {
1335
- arrayFormat: 'brackets'
1336
- });
1337
- },
1338
- headers: {
1339
- Accept: 'application/json'
1340
- },
1341
- transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1342
- if (!data.success) return data.data.error;
1343
- var ids = [];
1344
- var byId = {};
1345
- data.data.forEach(function (entity) {
1346
- byId[entity.id] = entity;
1347
- ids.push(entity.id);
1348
- });
1349
- return {
1350
- ids: ids,
1351
- byId: byId,
1352
- meta: {
1353
- total: data.pageParams.length
1354
- }
1355
- };
1356
- }])
1333
+ headers: _extends({
1334
+ Accept: 'application/json',
1335
+ 'Content-Type': 'application/json'
1336
+ }, headers)
1357
1337
  }).then(function (res) {
1358
- return res;
1338
+ return {
1339
+ data: res.data.data
1340
+ };
1359
1341
  })["catch"](function (err) {
1360
- throw err;
1342
+ var _err$response$status, _err$response, _err$response$data$da, _err$response2;
1343
+
1344
+ var error = new Error(err.message);
1345
+ error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
1346
+ 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';
1347
+ throw error;
1361
1348
  });
1362
1349
  }
1363
1350
 
1364
- function findPublishedExpertsRequest(_ref) {
1351
+ function createExpertReviewRequest(_ref) {
1365
1352
  var _ref$baseURL = _ref.baseURL,
1366
1353
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1367
- params = _ref.params;
1368
- return axios.get('/api/experts/published', {
1354
+ urlParams = _ref.urlParams,
1355
+ body = _ref.body,
1356
+ headers = _ref.headers;
1357
+ return axios.post("/api/expert/" + urlParams.expertId + "/review", body, {
1369
1358
  baseURL: baseURL,
1370
- params: params,
1371
- paramsSerializer: function paramsSerializer(params) {
1372
- return qs.stringify(params, {
1373
- arrayFormat: 'brackets'
1374
- });
1375
- },
1376
- headers: {
1377
- Accept: 'application/json'
1378
- },
1359
+ headers: _extends({
1360
+ Accept: 'application/json',
1361
+ 'Content-Type': 'application/json'
1362
+ }, headers),
1379
1363
  transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1380
- if (data.success) {
1381
- var ids = [];
1382
- var byId = {};
1383
- data.data.forEach(function (entity) {
1384
- byId[entity.id] = entity;
1385
- ids.push(entity.id);
1386
- });
1387
- return {
1388
- ids: ids,
1389
- byId: byId,
1390
- meta: {
1391
- total: data.pageParams.length
1392
- }
1393
- };
1394
- }
1395
-
1396
- return data.data.error;
1364
+ return data.success ? data.data : data.data.error;
1397
1365
  }])
1398
1366
  }).then(function (res) {
1399
1367
  return res;
@@ -1426,16 +1394,15 @@ function findExpertByIdRequest(_ref) {
1426
1394
  });
1427
1395
  }
1428
1396
 
1429
- function createExpertCaseRequest(_ref) {
1397
+ function findExpertCaseByIdRequest(_ref) {
1430
1398
  var _ref$baseURL = _ref.baseURL,
1431
1399
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1432
- headers = _ref.headers,
1433
- body = _ref.body;
1434
- return axios.post('/api/expert/case', body, {
1400
+ urlParams = _ref.urlParams,
1401
+ headers = _ref.headers;
1402
+ return axios.get('/api/expert/case/' + urlParams.id, {
1435
1403
  baseURL: baseURL,
1436
1404
  headers: _extends({
1437
- Accept: 'application/json',
1438
- 'Content-Type': 'application/json'
1405
+ Accept: 'application/json'
1439
1406
  }, headers)
1440
1407
  }).then(function (res) {
1441
1408
  return {
@@ -1485,27 +1452,82 @@ function findExpertCasesRequest(_ref) {
1485
1452
  });
1486
1453
  }
1487
1454
 
1488
- function findExpertCaseByIdRequest(_ref) {
1455
+ function findExpertsRequest(_ref) {
1489
1456
  var _ref$baseURL = _ref.baseURL,
1490
1457
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1491
- urlParams = _ref.urlParams,
1492
- headers = _ref.headers;
1493
- return axios.get('/api/expert/case/' + urlParams.id, {
1458
+ params = _ref.params;
1459
+ return axios.get('/api/experts', {
1494
1460
  baseURL: baseURL,
1495
- headers: _extends({
1461
+ params: params,
1462
+ paramsSerializer: function paramsSerializer(params) {
1463
+ return qs.stringify(params, {
1464
+ arrayFormat: 'brackets'
1465
+ });
1466
+ },
1467
+ headers: {
1496
1468
  Accept: 'application/json'
1497
- }, headers)
1469
+ },
1470
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1471
+ if (!data.success) return data.data.error;
1472
+ var ids = [];
1473
+ var byId = {};
1474
+ data.data.forEach(function (entity) {
1475
+ byId[entity.id] = entity;
1476
+ ids.push(entity.id);
1477
+ });
1478
+ return {
1479
+ ids: ids,
1480
+ byId: byId,
1481
+ meta: {
1482
+ total: data.pageParams.length
1483
+ }
1484
+ };
1485
+ }])
1498
1486
  }).then(function (res) {
1499
- return {
1500
- data: res.data.data
1501
- };
1487
+ return res;
1502
1488
  })["catch"](function (err) {
1503
- var _err$response$status, _err$response, _err$response$data$da, _err$response2;
1489
+ throw err;
1490
+ });
1491
+ }
1504
1492
 
1505
- var error = new Error(err.message);
1506
- error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
1507
- 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';
1508
- throw error;
1493
+ function findPublishedExpertsRequest(_ref) {
1494
+ var _ref$baseURL = _ref.baseURL,
1495
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1496
+ params = _ref.params;
1497
+ return axios.get('/api/experts/published', {
1498
+ baseURL: baseURL,
1499
+ params: params,
1500
+ paramsSerializer: function paramsSerializer(params) {
1501
+ return qs.stringify(params, {
1502
+ arrayFormat: 'brackets'
1503
+ });
1504
+ },
1505
+ headers: {
1506
+ Accept: 'application/json'
1507
+ },
1508
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1509
+ if (data.success) {
1510
+ var ids = [];
1511
+ var byId = {};
1512
+ data.data.forEach(function (entity) {
1513
+ byId[entity.id] = entity;
1514
+ ids.push(entity.id);
1515
+ });
1516
+ return {
1517
+ ids: ids,
1518
+ byId: byId,
1519
+ meta: {
1520
+ total: data.pageParams.length
1521
+ }
1522
+ };
1523
+ }
1524
+
1525
+ return data.data.error;
1526
+ }])
1527
+ }).then(function (res) {
1528
+ return res;
1529
+ })["catch"](function (err) {
1530
+ throw err;
1509
1531
  });
1510
1532
  }
1511
1533
 
@@ -1515,7 +1537,7 @@ function updateExpertCaseRequest(_ref) {
1515
1537
  urlParams = _ref.urlParams,
1516
1538
  body = _ref.body,
1517
1539
  headers = _ref.headers;
1518
- return axios.patch('/api/user/' + urlParams.id, body, {
1540
+ return axios.patch("/api/user/" + urlParams.id, body, {
1519
1541
  baseURL: baseURL,
1520
1542
  headers: _extends({
1521
1543
  Accept: 'application/json',
@@ -1535,6 +1557,28 @@ function updateExpertCaseRequest(_ref) {
1535
1557
  });
1536
1558
  }
1537
1559
 
1560
+ function updateExpertReviewRequest(_ref) {
1561
+ var _ref$baseURL = _ref.baseURL,
1562
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1563
+ urlParams = _ref.urlParams,
1564
+ body = _ref.body,
1565
+ headers = _ref.headers;
1566
+ return axios.patch("/api/expert/" + urlParams.expertId + "/review", body, {
1567
+ baseURL: baseURL,
1568
+ headers: _extends({
1569
+ Accept: 'application/json',
1570
+ 'Content-Type': 'application/json'
1571
+ }, headers),
1572
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
1573
+ return data.success ? data.data : data.data.error;
1574
+ }])
1575
+ }).then(function (res) {
1576
+ return res;
1577
+ })["catch"](function (err) {
1578
+ throw err;
1579
+ });
1580
+ }
1581
+
1538
1582
  function createIncomeRequest(_ref) {
1539
1583
  var _ref$baseURL = _ref.baseURL,
1540
1584
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -2628,7 +2672,8 @@ function findUserByIdRequest(_ref) {
2628
2672
  var _ref$baseURL = _ref.baseURL,
2629
2673
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
2630
2674
  urlParams = _ref.urlParams,
2631
- headers = _ref.headers;
2675
+ _ref$headers = _ref.headers,
2676
+ headers = _ref$headers === void 0 ? {} : _ref$headers;
2632
2677
  return axios.get('/api/user/' + urlParams.id, {
2633
2678
  baseURL: baseURL,
2634
2679
  headers: _extends({
@@ -4439,16 +4484,19 @@ var Api = function Api(baseURL) {
4439
4484
  }; // expert
4440
4485
 
4441
4486
 
4442
- this.findExperts = function (params) {
4443
- return findExpertsRequest({
4444
- params: params,
4487
+ this.createExpertCase = function (body, headers) {
4488
+ return createExpertCaseRequest({
4489
+ body: body,
4490
+ headers: headers,
4445
4491
  baseURL: _this.baseURL
4446
4492
  });
4447
4493
  };
4448
4494
 
4449
- this.findPublishedExperts = function (params) {
4450
- return findPublishedExpertsRequest({
4451
- params: params,
4495
+ this.createExpertReview = function (urlParams, body, headers) {
4496
+ return createExpertReviewRequest({
4497
+ urlParams: urlParams,
4498
+ body: body,
4499
+ headers: headers,
4452
4500
  baseURL: _this.baseURL
4453
4501
  });
4454
4502
  };
@@ -4461,9 +4509,9 @@ var Api = function Api(baseURL) {
4461
4509
  });
4462
4510
  };
4463
4511
 
4464
- this.createExpertCase = function (body, headers) {
4465
- return createExpertCaseRequest({
4466
- body: body,
4512
+ this.findExpertCaseById = function (urlParams, headers) {
4513
+ return findExpertCaseByIdRequest({
4514
+ urlParams: urlParams,
4467
4515
  headers: headers,
4468
4516
  baseURL: _this.baseURL
4469
4517
  });
@@ -4476,10 +4524,16 @@ var Api = function Api(baseURL) {
4476
4524
  });
4477
4525
  };
4478
4526
 
4479
- this.findExpertCaseById = function (urlParams, headers) {
4480
- return findExpertCaseByIdRequest({
4481
- urlParams: urlParams,
4482
- headers: headers,
4527
+ this.findExperts = function (params) {
4528
+ return findExpertsRequest({
4529
+ params: params,
4530
+ baseURL: _this.baseURL
4531
+ });
4532
+ };
4533
+
4534
+ this.findPublishedExperts = function (params) {
4535
+ return findPublishedExpertsRequest({
4536
+ params: params,
4483
4537
  baseURL: _this.baseURL
4484
4538
  });
4485
4539
  };
@@ -4491,6 +4545,15 @@ var Api = function Api(baseURL) {
4491
4545
  headers: headers,
4492
4546
  baseURL: _this.baseURL
4493
4547
  });
4548
+ };
4549
+
4550
+ this.updateExpertReview = function (urlParams, body, headers) {
4551
+ return updateExpertReviewRequest({
4552
+ urlParams: urlParams,
4553
+ body: body,
4554
+ headers: headers,
4555
+ baseURL: _this.baseURL
4556
+ });
4494
4557
  }; // income
4495
4558
 
4496
4559
 
@@ -5026,13 +5089,15 @@ var index = {
5026
5089
  setDealSignedStateRequest: setDealSignedStateRequest,
5027
5090
  terminateDealRequest: terminateDealRequest,
5028
5091
  updateDealRequest: updateDealRequest,
5029
- findExpertsRequest: findExpertsRequest,
5030
- findPublishedExpertsRequest: findPublishedExpertsRequest,
5031
- findExpertByIdRequest: findExpertByIdRequest,
5032
5092
  createExpertCaseRequest: createExpertCaseRequest,
5033
- findExpertCasesRequest: findExpertCasesRequest,
5093
+ createExpertReviewRequest: createExpertReviewRequest,
5094
+ findExpertByIdRequest: findExpertByIdRequest,
5034
5095
  findExpertCaseByIdRequest: findExpertCaseByIdRequest,
5096
+ findExpertCasesRequest: findExpertCasesRequest,
5097
+ findExpertsRequest: findExpertsRequest,
5098
+ findPublishedExpertsRequest: findPublishedExpertsRequest,
5035
5099
  updateExpertCaseRequest: updateExpertCaseRequest,
5100
+ updateExpertReviewRequest: updateExpertReviewRequest,
5036
5101
  createIncomeRequest: createIncomeRequest,
5037
5102
  deleteIncomeRequest: deleteIncomeRequest,
5038
5103
  createPhoneBookContactRequest: createPhoneBookContactRequest,