@bringg/dashboard-sdk 9.36.1-pre → 9.37.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.
@@ -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,288 @@ 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
+ ], { shallow: true });
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.loadBatch = 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('loadBatch', function (idsToLoad) { return _this.plannedService.loadBatch(idsToLoad, options); }, idsToLoad, __assign({}, options))];
16445
+ });
16446
+ });
16447
+ };
16448
+ PlanedRoutesApiV2.prototype.loadBatchByTeamIds = 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('loadBatch', function (teamIdsToLoad) { return _this.plannedService.loadBatchByTeamIds(teamIdsToLoad, options); }, teamIdsToLoad, __assign({}, options))];
16454
+ });
16455
+ });
16456
+ };
16457
+ PlanedRoutesApiV2.prototype.loadConflictPlannedRouteIds = 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 extractor = function (response) {
16532
+ return response.planned_routes;
16533
+ };
16534
+ var PlannedRoutesService = /** @class */ (function () {
16535
+ function PlannedRoutesService(session) {
16536
+ this.service = new CrudService_1.default(session, entityName);
16537
+ }
16538
+ PlannedRoutesService.prototype.loadAll = function () {
16539
+ return __awaiter(this, void 0, void 0, function () {
16540
+ var result;
16541
+ return __generator(this, function (_a) {
16542
+ switch (_a.label) {
16543
+ case 0: return [4 /*yield*/, this.service.getAll()];
16544
+ case 1:
16545
+ result = _a.sent();
16546
+ return [2 /*return*/, result.planned_routes];
16547
+ }
16548
+ });
16549
+ });
16550
+ };
16551
+ PlannedRoutesService.prototype.loadAllByTeam = function (teamId, commonOptions) {
16552
+ return __awaiter(this, void 0, void 0, function () {
16553
+ var result;
16554
+ return __generator(this, function (_a) {
16555
+ switch (_a.label) {
16556
+ case 0: return [4 /*yield*/, this.service.routeGenerator
16557
+ .get(Routes.GET_PLANNED_ROUTES_BY_TEAM)
16558
+ .withCommonOptions(commonOptions)
16559
+ .setException("Could not fetch planned routes of the team #".concat(teamId))
16560
+ .withRouteParams({ teamId: teamId })
16561
+ .invoke()];
16562
+ case 1:
16563
+ result = _a.sent();
16564
+ return [2 /*return*/, result.planned_routes];
16565
+ }
16566
+ });
16567
+ });
16568
+ };
16569
+ PlannedRoutesService.prototype.loadBatch = function (ids, commonOptions) {
16570
+ return __awaiter(this, void 0, void 0, function () {
16571
+ return __generator(this, function (_a) {
16572
+ switch (_a.label) {
16573
+ case 0: return [4 /*yield*/, this.service.routeGenerator
16574
+ .get(Routes.GET_BATCH)
16575
+ .withCommonOptions(commonOptions)
16576
+ .withExtractor(extractor)
16577
+ .setException("Could not fetch planned routes with ids ".concat(ids.toString()))
16578
+ .withQueryString({ ids: ids })
16579
+ .invoke()];
16580
+ case 1: return [2 /*return*/, _a.sent()];
16581
+ }
16582
+ });
16583
+ });
16584
+ };
16585
+ PlannedRoutesService.prototype.loadBatchByTeamIds = function (team_ids, commonOptions) {
16586
+ if (commonOptions === void 0) { commonOptions = {}; }
16587
+ return __awaiter(this, void 0, void 0, function () {
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
+ .withExtractor(extractor)
16594
+ .setException("Could not fetch planned routes for the teams ".concat(team_ids.toString()))
16595
+ .withQueryString({ team_ids: team_ids })
16596
+ .invoke()];
16597
+ case 1: return [2 /*return*/, _a.sent()];
16598
+ }
16599
+ });
16600
+ });
16601
+ };
16602
+ PlannedRoutesService.prototype.conflictPlannedRouteIds = function (run_id) {
16603
+ return __awaiter(this, void 0, void 0, function () {
16604
+ return __generator(this, function (_a) {
16605
+ return [2 /*return*/, this.service.routeGenerator
16606
+ .post(Routes.POST_CONFLICT_PLANNED_ROUTES)
16607
+ .withPayload({ run_id: run_id })
16608
+ .setException("Could not fetch planned routes for run ".concat(run_id))
16609
+ .invoke()];
16610
+ });
16611
+ });
16612
+ };
16613
+ return PlannedRoutesService;
16614
+ }());
16615
+ exports.PlannedRoutesService = PlannedRoutesService;
16616
+ //# sourceMappingURL=planned-routes-service.js.map
16617
+
16618
+ /***/ }),
16619
+
16336
16620
  /***/ 37915:
16337
16621
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
16338
16622
 
@@ -22380,7 +22664,7 @@ var lodash_1 = __webpack_require__(96486);
22380
22664
  var BringgException_1 = __webpack_require__(43605);
22381
22665
  var Logger_1 = __importDefault(__webpack_require__(55860));
22382
22666
  var abort_1 = __webpack_require__(34179);
22383
- var version = '9.36.1-pre';
22667
+ var version = '9.37.0';
22384
22668
  function logErrorResponse(response) {
22385
22669
  var data = response.data, status = response.status;
22386
22670
  try {
@@ -35722,6 +36006,7 @@ __exportStar(__webpack_require__(12772), exports);
35722
36006
  __exportStar(__webpack_require__(89792), exports);
35723
36007
  __exportStar(__webpack_require__(29414), exports);
35724
36008
  __exportStar(__webpack_require__(72615), exports);
36009
+ __exportStar(__webpack_require__(52539), exports);
35725
36010
  //# sourceMappingURL=index.js.map
35726
36011
 
35727
36012
  /***/ }),
@@ -35884,6 +36169,16 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
35884
36169
 
35885
36170
  /***/ }),
35886
36171
 
36172
+ /***/ 52539:
36173
+ /***/ ((__unused_webpack_module, exports) => {
36174
+
36175
+ "use strict";
36176
+
36177
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
36178
+ //# sourceMappingURL=tasks.js.map
36179
+
36180
+ /***/ }),
36181
+
35887
36182
  /***/ 21434:
35888
36183
  /***/ ((__unused_webpack_module, exports) => {
35889
36184