@bringg/dashboard-sdk 9.36.1-pre → 9.37.1107-pre

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.
@@ -2685,6 +2685,7 @@ var parking_spot_api_1 = __importDefault(__webpack_require__(58319));
2685
2685
  var Photo_1 = __importDefault(__webpack_require__(71760));
2686
2686
  var planned_delivery_windows_api_1 = __importDefault(__webpack_require__(44524));
2687
2687
  var PlannedRoutesApi_1 = __importDefault(__webpack_require__(44229));
2688
+ var planned_routes_api_1 = __importDefault(__webpack_require__(19978));
2688
2689
  var preset_views_api_1 = __importDefault(__webpack_require__(37915));
2689
2690
  var PrivilegesApi_1 = __importDefault(__webpack_require__(77632));
2690
2691
  var PushNotificationRegistration_1 = __importDefault(__webpack_require__(49075));
@@ -3054,7 +3055,8 @@ function init(session) {
3054
3055
  userPresetViews: new user_preset_views_api_1.UserPresetViewsApi(session),
3055
3056
  tasksExplorer: new tasks_explorer_api_1.default(session),
3056
3057
  vehiclesTypesApi: new vehicle_types_api_1.default(session),
3057
- parkingSpotApi: new parking_spot_api_1.default(session)
3058
+ parkingSpotApi: new parking_spot_api_1.default(session),
3059
+ plannedRoutes: new planned_routes_api_1.default(session)
3058
3060
  };
3059
3061
  bringg.application = new ApplicationApi_1.default(session);
3060
3062
  bringg.chat = new ChatConversationApi_1.default(session);
@@ -6671,7 +6673,7 @@ var customers_service_1 = __importDefault(__webpack_require__(52639));
6671
6673
  var CustomersApi = /** @class */ (function () {
6672
6674
  function CustomersApi(session) {
6673
6675
  var _this = this;
6674
- this.customersStore = new data_store_1.default(undefined, { shallow: true });
6676
+ this.customersStore = new data_store_1.default();
6675
6677
  this.customersService = new customers_service_1.default(session);
6676
6678
  this.storableDataService = new storable_data_service_1.default(this.customersStore, function (customer) {
6677
6679
  return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.customersStore, customer);
@@ -16333,6 +16335,289 @@ exports["default"] = PlannedRoutes;
16333
16335
 
16334
16336
  /***/ }),
16335
16337
 
16338
+ /***/ 19978:
16339
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
16340
+
16341
+ "use strict";
16342
+
16343
+ var __assign = (this && this.__assign) || function () {
16344
+ __assign = Object.assign || function(t) {
16345
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
16346
+ s = arguments[i];
16347
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
16348
+ t[p] = s[p];
16349
+ }
16350
+ return t;
16351
+ };
16352
+ return __assign.apply(this, arguments);
16353
+ };
16354
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16355
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16356
+ return new (P || (P = Promise))(function (resolve, reject) {
16357
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16358
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16359
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16360
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
16361
+ });
16362
+ };
16363
+ var __generator = (this && this.__generator) || function (thisArg, body) {
16364
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
16365
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
16366
+ function verb(n) { return function (v) { return step([n, v]); }; }
16367
+ function step(op) {
16368
+ if (f) throw new TypeError("Generator is already executing.");
16369
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
16370
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
16371
+ if (y = 0, t) op = [op[0] & 2, t.value];
16372
+ switch (op[0]) {
16373
+ case 0: case 1: t = op; break;
16374
+ case 4: _.label++; return { value: op[1], done: false };
16375
+ case 5: _.label++; y = op[1]; op = [0]; continue;
16376
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
16377
+ default:
16378
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
16379
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
16380
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
16381
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
16382
+ if (t[2]) _.ops.pop();
16383
+ _.trys.pop(); continue;
16384
+ }
16385
+ op = body.call(thisArg, _);
16386
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
16387
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
16388
+ }
16389
+ };
16390
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16391
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16392
+ };
16393
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
16394
+ exports.PlanedRoutesGroupTypes = void 0;
16395
+ var data_entity_1 = __webpack_require__(91083);
16396
+ var data_store_1 = __importDefault(__webpack_require__(73135));
16397
+ var storable_data_service_1 = __importDefault(__webpack_require__(45297));
16398
+ var planned_routes_service_1 = __webpack_require__(88581);
16399
+ var PlanedRoutesGroupTypes;
16400
+ (function (PlanedRoutesGroupTypes) {
16401
+ PlanedRoutesGroupTypes["Team"] = "Team";
16402
+ })(PlanedRoutesGroupTypes = exports.PlanedRoutesGroupTypes || (exports.PlanedRoutesGroupTypes = {}));
16403
+ var PlanedRoutesApiV2 = /** @class */ (function () {
16404
+ function PlanedRoutesApiV2(session) {
16405
+ this.plannedServiceApiStore = new data_store_1.default([
16406
+ {
16407
+ groupType: PlanedRoutesGroupTypes.Team,
16408
+ keyFunc: function (plannedRoute) { return plannedRoute.team_id; }
16409
+ }
16410
+ ]);
16411
+ this.plannedService = new planned_routes_service_1.PlannedRoutesService(session);
16412
+ this.storableDataService = new storable_data_service_1.default(this.plannedServiceApiStore);
16413
+ }
16414
+ PlanedRoutesApiV2.prototype.loadAll = function (options) {
16415
+ return __awaiter(this, void 0, void 0, function () {
16416
+ var _this = this;
16417
+ return __generator(this, function (_a) {
16418
+ switch (_a.label) {
16419
+ case 0: return [4 /*yield*/, this.storableDataService.loadAll('loadAll', function () { return _this.plannedService.loadAll(); }, options)];
16420
+ case 1: return [2 /*return*/, _a.sent()];
16421
+ }
16422
+ });
16423
+ });
16424
+ };
16425
+ PlanedRoutesApiV2.prototype.loadAllByTeam = function (teamId, options) {
16426
+ return __awaiter(this, void 0, void 0, function () {
16427
+ var response;
16428
+ var _this = this;
16429
+ return __generator(this, function (_a) {
16430
+ switch (_a.label) {
16431
+ case 0: return [4 /*yield*/, this.storableDataService.loadAll('loadAllByTeam', function () { return _this.plannedService.loadAllByTeam(teamId); }, __assign(__assign({}, options), { groupType: PlanedRoutesGroupTypes.Team, groupValue: teamId }))];
16432
+ case 1:
16433
+ response = _a.sent();
16434
+ return [2 /*return*/, response];
16435
+ }
16436
+ });
16437
+ });
16438
+ };
16439
+ PlanedRoutesApiV2.prototype.getBatch = function (idsToLoad, options) {
16440
+ if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
16441
+ return __awaiter(this, void 0, void 0, function () {
16442
+ var _this = this;
16443
+ return __generator(this, function (_a) {
16444
+ return [2 /*return*/, this.storableDataService.loadMany('getBatch', function (idsToLoad) { return _this.plannedService.getBatch(idsToLoad, options); }, idsToLoad, __assign({}, options))];
16445
+ });
16446
+ });
16447
+ };
16448
+ PlanedRoutesApiV2.prototype.getBatchByTeamIds = function (teamIdsToLoad, options) {
16449
+ if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
16450
+ return __awaiter(this, void 0, void 0, function () {
16451
+ var _this = this;
16452
+ return __generator(this, function (_a) {
16453
+ return [2 /*return*/, this.storableDataService.loadMany('getBatch', function (teamIdsToLoad) { return _this.plannedService.getBatchByTeamIds(teamIdsToLoad, options); }, teamIdsToLoad, __assign({}, options))];
16454
+ });
16455
+ });
16456
+ };
16457
+ PlanedRoutesApiV2.prototype.getConflictPlannedRouteIds = function (runId) {
16458
+ return __awaiter(this, void 0, void 0, function () {
16459
+ return __generator(this, function (_a) {
16460
+ return [2 /*return*/, this.plannedService.conflictPlannedRouteIds(runId)];
16461
+ });
16462
+ });
16463
+ };
16464
+ PlanedRoutesApiV2.prototype.get = function (id) {
16465
+ return this.plannedServiceApiStore.get(id);
16466
+ };
16467
+ PlanedRoutesApiV2.prototype.getAll = function () {
16468
+ return this.plannedServiceApiStore.getAll();
16469
+ };
16470
+ return PlanedRoutesApiV2;
16471
+ }());
16472
+ exports["default"] = PlanedRoutesApiV2;
16473
+ //# sourceMappingURL=planned-routes-api.js.map
16474
+
16475
+ /***/ }),
16476
+
16477
+ /***/ 88581:
16478
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
16479
+
16480
+ "use strict";
16481
+
16482
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16483
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16484
+ return new (P || (P = Promise))(function (resolve, reject) {
16485
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16486
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16487
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
16488
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
16489
+ });
16490
+ };
16491
+ var __generator = (this && this.__generator) || function (thisArg, body) {
16492
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
16493
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
16494
+ function verb(n) { return function (v) { return step([n, v]); }; }
16495
+ function step(op) {
16496
+ if (f) throw new TypeError("Generator is already executing.");
16497
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
16498
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
16499
+ if (y = 0, t) op = [op[0] & 2, t.value];
16500
+ switch (op[0]) {
16501
+ case 0: case 1: t = op; break;
16502
+ case 4: _.label++; return { value: op[1], done: false };
16503
+ case 5: _.label++; y = op[1]; op = [0]; continue;
16504
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
16505
+ default:
16506
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
16507
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
16508
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
16509
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
16510
+ if (t[2]) _.ops.pop();
16511
+ _.trys.pop(); continue;
16512
+ }
16513
+ op = body.call(thisArg, _);
16514
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
16515
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
16516
+ }
16517
+ };
16518
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16519
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16520
+ };
16521
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
16522
+ exports.PlannedRoutesService = void 0;
16523
+ var CrudService_1 = __importDefault(__webpack_require__(14809));
16524
+ var entityName = 'planned_routes';
16525
+ var Routes = {
16526
+ GET_PLANNED_ROUTES_BY_TEAM: '/teams/{:teamId}/planned_routes',
16527
+ GET_BATCH_BY_TEAM_IDS: "/".concat(entityName, "/batch_get"),
16528
+ GET_BATCH: "/".concat(entityName, "/batch_get_by_ids"),
16529
+ POST_CONFLICT_PLANNED_ROUTES: '/data-query-service/conflicting-planned-routes'
16530
+ };
16531
+ var PlannedRoutesService = /** @class */ (function () {
16532
+ function PlannedRoutesService(session) {
16533
+ this.service = new CrudService_1.default(session, entityName);
16534
+ }
16535
+ PlannedRoutesService.prototype.loadAll = function () {
16536
+ return __awaiter(this, void 0, void 0, function () {
16537
+ var result;
16538
+ return __generator(this, function (_a) {
16539
+ switch (_a.label) {
16540
+ case 0: return [4 /*yield*/, this.service.getAll()];
16541
+ case 1:
16542
+ result = _a.sent();
16543
+ return [2 /*return*/, result.planned_routes];
16544
+ }
16545
+ });
16546
+ });
16547
+ };
16548
+ PlannedRoutesService.prototype.loadAllByTeam = function (teamId, commonOptions) {
16549
+ return __awaiter(this, void 0, void 0, function () {
16550
+ var result;
16551
+ return __generator(this, function (_a) {
16552
+ switch (_a.label) {
16553
+ case 0: return [4 /*yield*/, this.service.routeGenerator
16554
+ .get(Routes.GET_PLANNED_ROUTES_BY_TEAM)
16555
+ .withCommonOptions(commonOptions)
16556
+ .setException("Could not fetch planned routes of the team #".concat(teamId))
16557
+ .withRouteParams({ teamId: teamId })
16558
+ .invoke()];
16559
+ case 1:
16560
+ result = _a.sent();
16561
+ return [2 /*return*/, result.planned_routes];
16562
+ }
16563
+ });
16564
+ });
16565
+ };
16566
+ PlannedRoutesService.prototype.getBatch = function (ids, commonOptions) {
16567
+ return __awaiter(this, void 0, void 0, function () {
16568
+ var result;
16569
+ return __generator(this, function (_a) {
16570
+ switch (_a.label) {
16571
+ case 0: return [4 /*yield*/, this.service.routeGenerator
16572
+ .get(Routes.GET_BATCH)
16573
+ .withCommonOptions(commonOptions)
16574
+ .setException("Could not fetch planned routes with ids ".concat(ids.toString()))
16575
+ .withQueryString({ ids: ids })
16576
+ .invoke()];
16577
+ case 1:
16578
+ result = _a.sent();
16579
+ return [2 /*return*/, result.planned_routes];
16580
+ }
16581
+ });
16582
+ });
16583
+ };
16584
+ PlannedRoutesService.prototype.getBatchByTeamIds = function (team_ids, commonOptions) {
16585
+ if (commonOptions === void 0) { commonOptions = {}; }
16586
+ return __awaiter(this, void 0, void 0, function () {
16587
+ var result;
16588
+ return __generator(this, function (_a) {
16589
+ switch (_a.label) {
16590
+ case 0: return [4 /*yield*/, this.service.routeGenerator
16591
+ .get(Routes.GET_BATCH_BY_TEAM_IDS)
16592
+ .withCommonOptions(commonOptions)
16593
+ .setException("Could not fetch planned routes for the teams ".concat(team_ids.toString()))
16594
+ .withQueryString({ team_ids: team_ids })
16595
+ .invoke()];
16596
+ case 1:
16597
+ result = _a.sent();
16598
+ return [2 /*return*/, result.planned_routes];
16599
+ }
16600
+ });
16601
+ });
16602
+ };
16603
+ PlannedRoutesService.prototype.conflictPlannedRouteIds = function (run_id) {
16604
+ return __awaiter(this, void 0, void 0, function () {
16605
+ return __generator(this, function (_a) {
16606
+ return [2 /*return*/, this.service.routeGenerator
16607
+ .post(Routes.POST_CONFLICT_PLANNED_ROUTES)
16608
+ .withPayload({ run_id: run_id })
16609
+ .setException("Could not fetch planned routes for run ".concat(run_id))
16610
+ .invoke()];
16611
+ });
16612
+ });
16613
+ };
16614
+ return PlannedRoutesService;
16615
+ }());
16616
+ exports.PlannedRoutesService = PlannedRoutesService;
16617
+ //# sourceMappingURL=planned-routes-service.js.map
16618
+
16619
+ /***/ }),
16620
+
16336
16621
  /***/ 37915:
16337
16622
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
16338
16623
 
@@ -22380,7 +22665,7 @@ var lodash_1 = __webpack_require__(96486);
22380
22665
  var BringgException_1 = __webpack_require__(43605);
22381
22666
  var Logger_1 = __importDefault(__webpack_require__(55860));
22382
22667
  var abort_1 = __webpack_require__(34179);
22383
- var version = '9.36.1-pre';
22668
+ var version = '9.37.1107-pre';
22384
22669
  function logErrorResponse(response) {
22385
22670
  var data = response.data, status = response.status;
22386
22671
  try {
@@ -35722,6 +36007,7 @@ __exportStar(__webpack_require__(12772), exports);
35722
36007
  __exportStar(__webpack_require__(89792), exports);
35723
36008
  __exportStar(__webpack_require__(29414), exports);
35724
36009
  __exportStar(__webpack_require__(72615), exports);
36010
+ __exportStar(__webpack_require__(52539), exports);
35725
36011
  //# sourceMappingURL=index.js.map
35726
36012
 
35727
36013
  /***/ }),
@@ -35884,6 +36170,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
35884
36170
 
35885
36171
  /***/ }),
35886
36172
 
36173
+ /***/ 52539:
36174
+ /***/ ((__unused_webpack_module, exports) => {
36175
+
36176
+ "use strict";
36177
+
36178
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
36179
+ //# sourceMappingURL=tasks.js.map
36180
+
36181
+ /***/ }),
36182
+
35887
36183
  /***/ 21434:
35888
36184
  /***/ ((__unused_webpack_module, exports) => {
35889
36185