@hapl/api-queries 0.1.119 → 0.1.120--canary.56.370797d.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.
@@ -413,6 +413,45 @@ function declineContractRequest(_ref) {
413
413
  });
414
414
  }
415
415
 
416
+ function findContractsRequest(_ref) {
417
+ var _ref$baseURL = _ref.baseURL,
418
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
419
+ headers = _ref.headers,
420
+ params = _ref.params;
421
+ return axios.get('/api/contract', {
422
+ baseURL: baseURL,
423
+ params: params,
424
+ paramsSerializer: function paramsSerializer(params) {
425
+ return qs.stringify(params, {
426
+ arrayFormat: 'brackets'
427
+ });
428
+ },
429
+ headers: _extends({
430
+ Accept: 'application/json'
431
+ }, headers),
432
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
433
+ if (!data.success) return data.data.error || data.data.message;
434
+ var ids = [];
435
+ var byId = {};
436
+ data.data.forEach(function (entity) {
437
+ byId[entity.id] = entity;
438
+ ids.push(entity.id);
439
+ });
440
+ return {
441
+ ids: ids,
442
+ byId: byId,
443
+ meta: {
444
+ total: data.pageParams.length
445
+ }
446
+ };
447
+ }])
448
+ }).then(function (res) {
449
+ return res;
450
+ })["catch"](function (err) {
451
+ throw err;
452
+ });
453
+ }
454
+
416
455
  function terminateContractRequest(_ref) {
417
456
  var _ref$baseURL = _ref.baseURL,
418
457
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -2719,6 +2758,14 @@ var Api = function Api(baseURL) {
2719
2758
  });
2720
2759
  };
2721
2760
 
2761
+ this.findContracts = function (params, headers) {
2762
+ return findContractsRequest({
2763
+ params: params,
2764
+ headers: headers,
2765
+ baseURL: _this.baseURL
2766
+ });
2767
+ };
2768
+
2722
2769
  this.terminateContract = function (urlParams, body, headers) {
2723
2770
  return terminateContractRequest({
2724
2771
  urlParams: urlParams,
@@ -3142,6 +3189,7 @@ var index = {
3142
3189
  createCallTaskRequest: createCallTaskRequest,
3143
3190
  approveContractRequest: approveContractRequest,
3144
3191
  declineContractRequest: declineContractRequest,
3192
+ findContractsRequest: findContractsRequest,
3145
3193
  terminateContractRequest: terminateContractRequest,
3146
3194
  createDealCategorizedFileRequest: createDealCategorizedFileRequest,
3147
3195
  createDealInvestPrepaymentRequest: createDealInvestPrepaymentRequest,