@hapl/api-queries 0.1.128 → 0.1.131

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.
@@ -497,6 +497,49 @@ function createCallTaskRequest(_ref) {
497
497
  });
498
498
  }
499
499
 
500
+ function findCallTasksRequest(_ref) {
501
+ var _ref$baseURL = _ref.baseURL,
502
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
503
+ headers = _ref.headers,
504
+ params = _ref.params;
505
+ return axios.get('/api/calls/task', {
506
+ baseURL: baseURL,
507
+ params: params,
508
+ paramsSerializer: function paramsSerializer(params) {
509
+ return qs.stringify(params, {
510
+ arrayFormat: 'brackets'
511
+ });
512
+ },
513
+ headers: _extends({
514
+ Accept: 'application/json',
515
+ 'Content-Type': 'application/json'
516
+ }, headers),
517
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
518
+ if (data.success) {
519
+ var ids = [];
520
+ var byId = {};
521
+ data.data.forEach(function (entity) {
522
+ byId[entity.id] = entity;
523
+ ids.push(entity.id);
524
+ });
525
+ return {
526
+ ids: ids,
527
+ byId: byId,
528
+ meta: {
529
+ total: data.pageParams.length
530
+ }
531
+ };
532
+ }
533
+
534
+ return data.data.error || data.data.message;
535
+ }])
536
+ }).then(function (res) {
537
+ return res;
538
+ })["catch"](function (err) {
539
+ throw err;
540
+ });
541
+ }
542
+
500
543
  function approveContractRequest(_ref) {
501
544
  var _ref$baseURL = _ref.baseURL,
502
545
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -1618,7 +1661,7 @@ function publishServiceRequest(_ref) {
1618
1661
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
1619
1662
  urlParams = _ref.urlParams,
1620
1663
  headers = _ref.headers;
1621
- return axios.patch("/api/service-request/publish/" + urlParams.id, {}, {
1664
+ return axios.post("/api/service-request/publish/" + urlParams.id, {}, {
1622
1665
  baseURL: baseURL,
1623
1666
  headers: _extends({
1624
1667
  Accept: 'application/json',
@@ -1642,7 +1685,7 @@ function depublishServiceRequest(_ref) {
1642
1685
  urlParams = _ref.urlParams,
1643
1686
  body = _ref.body,
1644
1687
  headers = _ref.headers;
1645
- return axios.patch("/api/service-request/depublish/" + urlParams.id, body, {
1688
+ return axios.post("/api/service-request/depublish/" + urlParams.id, body, {
1646
1689
  baseURL: baseURL,
1647
1690
  headers: _extends({
1648
1691
  Accept: 'application/json',
@@ -2971,6 +3014,14 @@ var Api = function Api(baseURL) {
2971
3014
  headers: headers,
2972
3015
  baseURL: _this.baseURL
2973
3016
  });
3017
+ };
3018
+
3019
+ this.findCallTasks = function (params, headers) {
3020
+ return findCallTasksRequest({
3021
+ params: params,
3022
+ headers: headers,
3023
+ baseURL: _this.baseURL
3024
+ });
2974
3025
  }; // contract
2975
3026
 
2976
3027
 
@@ -3442,6 +3493,7 @@ var index = {
3442
3493
  getOperatorStatusRequest: getOperatorStatusRequest,
3443
3494
  startOperatorWorkRequest: startOperatorWorkRequest,
3444
3495
  createCallTaskRequest: createCallTaskRequest,
3496
+ findCallTasksRequest: findCallTasksRequest,
3445
3497
  approveContractRequest: approveContractRequest,
3446
3498
  declineContractRequest: declineContractRequest,
3447
3499
  findContractsRequest: findContractsRequest,