@hapl/api-queries 0.1.140 → 0.1.141

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.141 (Thu Feb 24 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - fix: исправлена неверная сортировка в ручке запроса списка buyer [#67](https://github.com/homeappcorporate/api-queries/pull/67) ([@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.140 (Tue Feb 22 2022)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -289,6 +289,27 @@ function countBuyersRequest(_ref) {
289
289
  });
290
290
  }
291
291
 
292
+ function callbackBuyerRequest(_ref) {
293
+ var _ref$baseURL = _ref.baseURL,
294
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
295
+ urlParams = _ref.urlParams,
296
+ headers = _ref.headers;
297
+ return axios.post("/api/buyer/callback/" + urlParams.id, {}, {
298
+ baseURL: baseURL,
299
+ headers: _extends({
300
+ Accept: 'application/json',
301
+ 'Content-Type': 'application/json'
302
+ }, headers),
303
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
304
+ return data.success ? data.data : data.data.error;
305
+ }])
306
+ }).then(function (res) {
307
+ return res;
308
+ })["catch"](function (err) {
309
+ throw err;
310
+ });
311
+ }
312
+
292
313
  function findBuyersRequest(_ref) {
293
314
  var _ref$baseURL = _ref.baseURL,
294
315
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -331,6 +352,41 @@ function findBuyersRequest(_ref) {
331
352
  });
332
353
  }
333
354
 
355
+ function findBuyerClosingReasonRequest(_ref) {
356
+ var _ref$baseURL = _ref.baseURL,
357
+ baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
358
+ headers = _ref.headers;
359
+ return axios.get('/api/buyer/closing-reason', {
360
+ baseURL: baseURL,
361
+ headers: _extends({
362
+ Accept: 'application/json'
363
+ }, headers),
364
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
365
+ if (data.success) {
366
+ var ids = [];
367
+ var byId = {};
368
+ data.data.forEach(function (entity) {
369
+ byId[entity.id] = entity;
370
+ ids.push(entity.id);
371
+ });
372
+ return {
373
+ ids: ids,
374
+ byId: byId,
375
+ meta: {
376
+ total: ids.length
377
+ }
378
+ };
379
+ }
380
+
381
+ return data.data.error;
382
+ }])
383
+ }).then(function (res) {
384
+ return res;
385
+ })["catch"](function (err) {
386
+ throw err;
387
+ });
388
+ }
389
+
334
390
  function findCallsRequest(_ref) {
335
391
  var _ref$baseURL = _ref.baseURL,
336
392
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -2355,6 +2411,13 @@ var BuyerRealtyShowStatus;
2355
2411
  BuyerRealtyShowStatus["Complete"] = "complete";
2356
2412
  })(BuyerRealtyShowStatus || (BuyerRealtyShowStatus = {}));
2357
2413
 
2414
+ var BuyerQuestionType;
2415
+
2416
+ (function (BuyerQuestionType) {
2417
+ BuyerQuestionType["RejectionReason"] = "rejection-reason";
2418
+ BuyerQuestionType["AdditionalServices"] = "additional-services";
2419
+ })(BuyerQuestionType || (BuyerQuestionType = {}));
2420
+
2358
2421
  var CallType;
2359
2422
 
2360
2423
  (function (CallType) {
@@ -3243,6 +3306,14 @@ var Api = function Api(baseURL) {
3243
3306
  }; // buyer
3244
3307
 
3245
3308
 
3309
+ this.callbackBuyer = function (urlParams, headers) {
3310
+ return callbackBuyerRequest({
3311
+ urlParams: urlParams,
3312
+ headers: headers,
3313
+ baseURL: _this.baseURL
3314
+ });
3315
+ };
3316
+
3246
3317
  this.countBuyers = function (params, headers) {
3247
3318
  return countBuyersRequest({
3248
3319
  params: params,
@@ -3257,6 +3328,13 @@ var Api = function Api(baseURL) {
3257
3328
  headers: headers,
3258
3329
  baseURL: _this.baseURL
3259
3330
  });
3331
+ };
3332
+
3333
+ this.findBuyerClosingReason = function (headers) {
3334
+ return findBuyerClosingReasonRequest({
3335
+ headers: headers,
3336
+ baseURL: _this.baseURL
3337
+ });
3260
3338
  }; // call
3261
3339
 
3262
3340
 
@@ -3903,7 +3981,9 @@ var index = {
3903
3981
  createBillRequest: createBillRequest,
3904
3982
  findBillsRequest: findBillsRequest,
3905
3983
  countBuyersRequest: countBuyersRequest,
3984
+ callbackBuyerRequest: callbackBuyerRequest,
3906
3985
  findBuyersRequest: findBuyersRequest,
3986
+ findBuyerClosingReasonRequest: findBuyerClosingReasonRequest,
3907
3987
  findCallsRequest: findCallsRequest,
3908
3988
  findFirstSuccessOutgoingCallsRequest: findFirstSuccessOutgoingCallsRequest,
3909
3989
  markupCallRequest: markupCallRequest,
@@ -4013,6 +4093,7 @@ var index = {
4013
4093
  get BillServiceUnit () { return BillServiceUnit; },
4014
4094
  get BuyerStatus () { return BuyerStatus; },
4015
4095
  get BuyerRealtyShowStatus () { return BuyerRealtyShowStatus; },
4096
+ get BuyerQuestionType () { return BuyerQuestionType; },
4016
4097
  get CallType () { return CallType; },
4017
4098
  get CallDefaultTelephony () { return CallDefaultTelephony; },
4018
4099
  get CallTaskPriority () { return CallTaskPriority; },