@hapl/api-queries 0.1.179 → 0.1.180--canary.107.a795ccd.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.
@@ -2524,6 +2524,54 @@ function findSoldStatisticRequest(_ref) {
2524
2524
  });
2525
2525
  }
2526
2526
 
2527
+ function findPriceHistoryAnalyticsRequest(_ref) {
2528
+ var headers = _ref.headers,
2529
+ params = _ref.params;
2530
+ return axios.get('https://analytics.homeapp.team:8080/price_change', {
2531
+ // baseURL,
2532
+ params: params,
2533
+ paramsSerializer: function paramsSerializer(params) {
2534
+ return qs.stringify(params, {
2535
+ arrayFormat: 'brackets'
2536
+ });
2537
+ },
2538
+ headers: _extends({
2539
+ Accept: 'application/json',
2540
+ 'Content-Type': 'application/json'
2541
+ }, headers),
2542
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
2543
+ if (data.success) {
2544
+ var _data$pageParams$leng, _data$pageParams;
2545
+
2546
+ var ids = [];
2547
+ var byId = {};
2548
+ data.data.forEach(function (entity) {
2549
+ var _id = nonSecure.nanoid();
2550
+
2551
+ byId[_id] = _extends({}, entity, {
2552
+ _id: _id
2553
+ });
2554
+ ids.push(_id);
2555
+ }); // todo: поменять на clients прокси метод!!!
2556
+
2557
+ return {
2558
+ ids: ids,
2559
+ byId: byId,
2560
+ meta: {
2561
+ total: (_data$pageParams$leng = (_data$pageParams = data.pageParams) == null ? void 0 : _data$pageParams.length) != null ? _data$pageParams$leng : ids.length
2562
+ }
2563
+ };
2564
+ }
2565
+
2566
+ return data.data.error || data.data.message;
2567
+ }])
2568
+ }).then(function (res) {
2569
+ return res;
2570
+ })["catch"](function (err) {
2571
+ throw err;
2572
+ });
2573
+ }
2574
+
2527
2575
  function createUserRequest(_ref) {
2528
2576
  var _ref$baseURL = _ref.baseURL,
2529
2577
  baseURL = _ref$baseURL === void 0 ? 'https://clients.homeapp.ru' : _ref$baseURL,
@@ -4783,6 +4831,15 @@ var Api = function Api(baseURL) {
4783
4831
  headers: headers,
4784
4832
  baseURL: _this.baseURL
4785
4833
  });
4834
+ }; // price history analytics
4835
+
4836
+
4837
+ this.findPriceHistoryAnalytics = function (params, headers) {
4838
+ return findPriceHistoryAnalyticsRequest({
4839
+ params: params,
4840
+ headers: headers,
4841
+ baseURL: _this.baseURL
4842
+ });
4786
4843
  }; // task
4787
4844
 
4788
4845
 
@@ -5025,6 +5082,7 @@ var index = {
5025
5082
  depublishServiceRequest: depublishServiceRequest,
5026
5083
  transferServiceRequest: transferServiceRequest,
5027
5084
  findSoldStatisticRequest: findSoldStatisticRequest,
5085
+ findPriceHistoryAnalyticsRequest: findPriceHistoryAnalyticsRequest,
5028
5086
  createUserRequest: createUserRequest,
5029
5087
  findUsersRequest: findUsersRequest,
5030
5088
  findUserByIdRequest: findUserByIdRequest,