@bringg/dashboard-sdk 9.96.0-pre.5 → 10.0.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.
Files changed (53) hide show
  1. package/dist/BringgDashboardSDK.d.ts +1 -13
  2. package/dist/BringgDashboardSDK.js +2 -13
  3. package/dist/BringgDashboardSDK.js.map +1 -1
  4. package/dist/ConfigurationProfiles/ConfigurationProfiles.d.ts +7 -0
  5. package/dist/ConfigurationProfiles/ConfigurationProfiles.js +9 -0
  6. package/dist/ConfigurationProfiles/ConfigurationProfiles.js.map +1 -1
  7. package/dist/ConfigurationProfiles/Service/ConfigurationProfilesService.d.ts +2 -0
  8. package/dist/ConfigurationProfiles/Service/ConfigurationProfilesService.js +8 -0
  9. package/dist/ConfigurationProfiles/Service/ConfigurationProfilesService.js.map +1 -1
  10. package/dist/Crew/Crew.d.ts +3 -3
  11. package/dist/Crew/Crew.js +3 -3
  12. package/dist/Crew/Crew.js.map +1 -1
  13. package/dist/TaskConfiguration/Entity/TaskConfigurationEntity.d.ts +1 -2
  14. package/dist/TaskConfiguration/Entity/TaskConfigurationEntity.js +0 -3
  15. package/dist/TaskConfiguration/Entity/TaskConfigurationEntity.js.map +1 -1
  16. package/dist/TaskConfiguration/TaskConfiguration.consts.d.ts +0 -4
  17. package/dist/TaskConfiguration/TaskConfiguration.d.ts +4 -6
  18. package/dist/TaskConfiguration/TaskConfiguration.js +0 -51
  19. package/dist/TaskConfiguration/TaskConfiguration.js.map +1 -1
  20. package/dist/User/User.consts.d.ts +4 -42
  21. package/dist/User/User.consts.js +1 -7
  22. package/dist/User/User.consts.js.map +1 -1
  23. package/dist/User/v2/users-api.d.ts +1 -2
  24. package/dist/User/v2/users-api.js.map +1 -1
  25. package/dist/User/v2/users-service.d.ts +1 -2
  26. package/dist/User/v2/users-service.js.map +1 -1
  27. package/dist/bringg-dashboard-sdk-cjs2.js +191 -2656
  28. package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
  29. package/dist/bringg-dashboard-sdk.js +15 -225
  30. package/dist/bringg-dashboard-sdk.min.js +1 -1
  31. package/dist/bringg-dashboard-sdk.min.js.map +1 -1
  32. package/dist/index.d.ts +1 -3
  33. package/dist/index.js +1 -3
  34. package/dist/index.js.map +1 -1
  35. package/package.json +2 -2
  36. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-api.d.ts +0 -25
  37. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-api.js +0 -109
  38. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-api.js.map +0 -1
  39. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-service.d.ts +0 -15
  40. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-service.js +0 -140
  41. package/dist/CheckinDistanceReason/v2/checkin-distance-reasons-service.js.map +0 -1
  42. package/dist/Services/PubSubService.d.ts +0 -10
  43. package/dist/Services/PubSubService.js +0 -44
  44. package/dist/Services/PubSubService.js.map +0 -1
  45. package/dist/User/Service/UsersService.d.ts +0 -48
  46. package/dist/User/Service/UsersService.js +0 -550
  47. package/dist/User/Service/UsersService.js.map +0 -1
  48. package/dist/User/Store/UsersStore.d.ts +0 -60
  49. package/dist/User/Store/UsersStore.js +0 -715
  50. package/dist/User/Store/UsersStore.js.map +0 -1
  51. package/dist/User/Users.d.ts +0 -55
  52. package/dist/User/Users.js +0 -310
  53. package/dist/User/Users.js.map +0 -1
@@ -3139,7 +3139,6 @@ var CarrierCancellationReasonMappingsApi_1 = __importDefault(__webpack_require__
3139
3139
  var CarrierCancellationReasonsApi_1 = __importDefault(__webpack_require__(73116));
3140
3140
  var Chat_1 = __importDefault(__webpack_require__(17629));
3141
3141
  var ChatConversationApi_1 = __importDefault(__webpack_require__(74617));
3142
- var checkin_distance_reasons_api_1 = __importDefault(__webpack_require__(16754));
3143
3142
  var Company_1 = __importDefault(__webpack_require__(97275));
3144
3143
  var ConfigurationProfiles_1 = __importDefault(__webpack_require__(65624));
3145
3144
  var ConfigurationProvider_1 = __webpack_require__(44858);
@@ -3234,7 +3233,6 @@ var TeamConfigurationApi_1 = __importDefault(__webpack_require__(37565));
3234
3233
  var TeamServiceAreaApi_1 = __importDefault(__webpack_require__(2847));
3235
3234
  var TemplatesApi_1 = __importDefault(__webpack_require__(92921));
3236
3235
  var upload_api_1 = __importDefault(__webpack_require__(61488));
3237
- var Users_1 = __importDefault(__webpack_require__(32474));
3238
3236
  var users_api_1 = __importDefault(__webpack_require__(89549));
3239
3237
  var UserAnalyticsApi_1 = __importDefault(__webpack_require__(98129));
3240
3238
  var UserConfiguration_1 = __importDefault(__webpack_require__(74112));
@@ -3299,7 +3297,6 @@ var BringgDashboardSDK = /** @class */ (function () {
3299
3297
  this.teams = null;
3300
3298
  this.resourceUploads = null;
3301
3299
  this.userConfigurations = null;
3302
- this.users = null;
3303
3300
  this.vehicleCategories = null;
3304
3301
  this.vehicleTypes = null;
3305
3302
  this.vehicles = null;
@@ -3537,7 +3534,7 @@ var BringgDashboardSDK = /** @class */ (function () {
3537
3534
  exports.BringgDashboardSDK = BringgDashboardSDK;
3538
3535
  function init(session) {
3539
3536
  return __awaiter(this, void 0, void 0, function () {
3540
- var bringg, customersApi, workflows, taskRejectReasons, checkinDistanceReasons;
3537
+ var bringg, customersApi, workflows, taskRejectReasons;
3541
3538
  return __generator(this, function (_a) {
3542
3539
  switch (_a.label) {
3543
3540
  case 0:
@@ -3569,13 +3566,6 @@ function init(session) {
3569
3566
  taskRejectReasons: function () {
3570
3567
  return taskRejectReasons;
3571
3568
  },
3572
- createCheckinDistanceReasons: function (mapper) {
3573
- checkinDistanceReasons = new checkin_distance_reasons_api_1.default(session, mapper);
3574
- return checkinDistanceReasons;
3575
- },
3576
- checkinDistanceReasons: function () {
3577
- return checkinDistanceReasons;
3578
- },
3579
3569
  runs: new runs_api_1.default(session, function () { return bringg; }),
3580
3570
  uploads: new upload_api_1.default(session),
3581
3571
  floatingInventories: new floating_inventories_api_1.FloatingInventoriesApi(session),
@@ -3640,7 +3630,6 @@ function init(session) {
3640
3630
  bringg.resourceUploads = new ResourceUploadApi_1.default(session);
3641
3631
  bringg.userConfigurations = new UserConfiguration_1.default(session);
3642
3632
  bringg.userTypes = new UserTypeApi_1.default(session);
3643
- bringg.users = new Users_1.default(session);
3644
3633
  bringg.vehicleCategories = new VehicleCategoryApi_1.default(session);
3645
3634
  bringg.vehicleTypes = new VehicleTypeApi_1.default(session);
3646
3635
  bringg.vehicles = new VehicleApi_1.default(session);
@@ -3683,7 +3672,7 @@ function init(session) {
3683
3672
  bringg.capacityInsights = new CapacityInsightsApi_1.default(session);
3684
3673
  bringg.resourceUtilization = new ResourceUtilizationApi_1.default(session);
3685
3674
  // dependent
3686
- bringg.crews = new Crew_1.default(session, bringg.users);
3675
+ bringg.crews = new Crew_1.default(session, bringg.v2.users);
3687
3676
  bringg.applicationMerchantConfiguration = new ApplicationMerchantConfigurationApi_1.default(session, bringg.merchantConfiguration);
3688
3677
  bringg.applicationTeamConfiguration = new ApplicationTeamConfigurationApi_1.default(session);
3689
3678
  return [4 /*yield*/, initSessionConfiguration(bringg)];
@@ -5189,269 +5178,6 @@ exports["default"] = ChatMessage;
5189
5178
 
5190
5179
  /***/ }),
5191
5180
 
5192
- /***/ 16754:
5193
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5194
-
5195
- "use strict";
5196
-
5197
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5198
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5199
- return new (P || (P = Promise))(function (resolve, reject) {
5200
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5201
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5202
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5203
- step((generator = generator.apply(thisArg, _arguments || [])).next());
5204
- });
5205
- };
5206
- var __generator = (this && this.__generator) || function (thisArg, body) {
5207
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
5208
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5209
- function verb(n) { return function (v) { return step([n, v]); }; }
5210
- function step(op) {
5211
- if (f) throw new TypeError("Generator is already executing.");
5212
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
5213
- 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;
5214
- if (y = 0, t) op = [op[0] & 2, t.value];
5215
- switch (op[0]) {
5216
- case 0: case 1: t = op; break;
5217
- case 4: _.label++; return { value: op[1], done: false };
5218
- case 5: _.label++; y = op[1]; op = [0]; continue;
5219
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
5220
- default:
5221
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
5222
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
5223
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
5224
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
5225
- if (t[2]) _.ops.pop();
5226
- _.trys.pop(); continue;
5227
- }
5228
- op = body.call(thisArg, _);
5229
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
5230
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
5231
- }
5232
- };
5233
- var __importDefault = (this && this.__importDefault) || function (mod) {
5234
- return (mod && mod.__esModule) ? mod : { "default": mod };
5235
- };
5236
- Object.defineProperty(exports, "__esModule", ({ value: true }));
5237
- var data_store_1 = __importDefault(__webpack_require__(73135));
5238
- var storable_data_service_1 = __importDefault(__webpack_require__(45297));
5239
- var checkin_distance_reasons_service_1 = __importDefault(__webpack_require__(85743));
5240
- var CheckinDistanceReasonsApi = /** @class */ (function () {
5241
- function CheckinDistanceReasonsApi(session, mapper) {
5242
- this.checkinDistanceReasonsStore = new data_store_1.default();
5243
- this.checkinDistanceReasonsService = new checkin_distance_reasons_service_1.default(session);
5244
- this.storableDataService = new storable_data_service_1.default(this.checkinDistanceReasonsStore, mapper);
5245
- }
5246
- CheckinDistanceReasonsApi.prototype.loadAll = function (options) {
5247
- var _this = this;
5248
- return this.storableDataService.loadAll('loadAll', function () { return _this.checkinDistanceReasonsService.loadAll(options); }, options);
5249
- };
5250
- CheckinDistanceReasonsApi.prototype.delete = function (id, commonOption) {
5251
- return __awaiter(this, void 0, void 0, function () {
5252
- var _this = this;
5253
- return __generator(this, function (_a) {
5254
- switch (_a.label) {
5255
- case 0: return [4 /*yield*/, this.storableDataService.delete('delete', function () { return _this.checkinDistanceReasonsService.delete(id, commonOption); }, id)];
5256
- case 1:
5257
- _a.sent();
5258
- return [2 /*return*/];
5259
- }
5260
- });
5261
- });
5262
- };
5263
- CheckinDistanceReasonsApi.prototype.update = function (id, checkinDistanceReason, commonOption) {
5264
- var _this = this;
5265
- return this.storableDataService.modify('update', function () {
5266
- return _this.checkinDistanceReasonsService.update(id, checkinDistanceReason, commonOption);
5267
- });
5268
- };
5269
- CheckinDistanceReasonsApi.prototype.patch = function (id, checkinDistanceReason, commonOption) {
5270
- var _this = this;
5271
- return this.storableDataService.modify('patch', function () {
5272
- return _this.checkinDistanceReasonsService.patch(id, checkinDistanceReason, commonOption);
5273
- });
5274
- };
5275
- CheckinDistanceReasonsApi.prototype.create = function (checkinDistanceReason, commonOption) {
5276
- var _this = this;
5277
- return this.storableDataService.modify('create', function () {
5278
- return _this.checkinDistanceReasonsService.create(checkinDistanceReason, commonOption);
5279
- });
5280
- };
5281
- /**
5282
- * Saves a new order. ids: every non-deleted reason id of the merchant, in the new order.
5283
- * The server rejects any other list and changes nothing; the store keeps the old order then.
5284
- */
5285
- CheckinDistanceReasonsApi.prototype.reorder = function (ids, commonOption) {
5286
- var _this = this;
5287
- return this.storableDataService.modifyMany('reorder', function () {
5288
- return _this.checkinDistanceReasonsService.reorder(ids, commonOption);
5289
- });
5290
- };
5291
- CheckinDistanceReasonsApi.prototype.get = function (id) {
5292
- return this.checkinDistanceReasonsStore.get(id);
5293
- };
5294
- /** Returns the loaded reasons by position, then id: the order the server and the driver app use. */
5295
- CheckinDistanceReasonsApi.prototype.getAll = function () {
5296
- return this.checkinDistanceReasonsStore.getAll().sort(function (a, b) { return a.position - b.position || a.id - b.id; });
5297
- };
5298
- CheckinDistanceReasonsApi.prototype.removeAll = function () {
5299
- this.checkinDistanceReasonsStore.removeAll();
5300
- };
5301
- return CheckinDistanceReasonsApi;
5302
- }());
5303
- exports["default"] = CheckinDistanceReasonsApi;
5304
- //# sourceMappingURL=checkin-distance-reasons-api.js.map
5305
-
5306
- /***/ }),
5307
-
5308
- /***/ 85743:
5309
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5310
-
5311
- "use strict";
5312
-
5313
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5314
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5315
- return new (P || (P = Promise))(function (resolve, reject) {
5316
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5317
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5318
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
5319
- step((generator = generator.apply(thisArg, _arguments || [])).next());
5320
- });
5321
- };
5322
- var __generator = (this && this.__generator) || function (thisArg, body) {
5323
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
5324
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
5325
- function verb(n) { return function (v) { return step([n, v]); }; }
5326
- function step(op) {
5327
- if (f) throw new TypeError("Generator is already executing.");
5328
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
5329
- 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;
5330
- if (y = 0, t) op = [op[0] & 2, t.value];
5331
- switch (op[0]) {
5332
- case 0: case 1: t = op; break;
5333
- case 4: _.label++; return { value: op[1], done: false };
5334
- case 5: _.label++; y = op[1]; op = [0]; continue;
5335
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
5336
- default:
5337
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
5338
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
5339
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
5340
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
5341
- if (t[2]) _.ops.pop();
5342
- _.trys.pop(); continue;
5343
- }
5344
- op = body.call(thisArg, _);
5345
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
5346
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
5347
- }
5348
- };
5349
- var __importDefault = (this && this.__importDefault) || function (mod) {
5350
- return (mod && mod.__esModule) ? mod : { "default": mod };
5351
- };
5352
- Object.defineProperty(exports, "__esModule", ({ value: true }));
5353
- var CrudService_1 = __importDefault(__webpack_require__(14809));
5354
- var entityName = 'checkin_distance_reasons';
5355
- var Routes = {
5356
- REORDER: "/".concat(entityName, "/reorder")
5357
- };
5358
- var CheckinDistanceReasonsService = /** @class */ (function () {
5359
- function CheckinDistanceReasonsService(session) {
5360
- this.service = new CrudService_1.default(session, entityName);
5361
- }
5362
- CheckinDistanceReasonsService.prototype.loadAll = function (commonOptions) {
5363
- if (commonOptions === void 0) { commonOptions = {}; }
5364
- return __awaiter(this, void 0, void 0, function () {
5365
- var response;
5366
- return __generator(this, function (_a) {
5367
- switch (_a.label) {
5368
- case 0: return [4 /*yield*/, this.service.getAll(undefined, commonOptions)];
5369
- case 1:
5370
- response = _a.sent();
5371
- return [2 /*return*/, response.checkin_distance_reasons];
5372
- }
5373
- });
5374
- });
5375
- };
5376
- CheckinDistanceReasonsService.prototype.delete = function (id, commonOptions) {
5377
- if (commonOptions === void 0) { commonOptions = {}; }
5378
- return __awaiter(this, void 0, void 0, function () {
5379
- return __generator(this, function (_a) {
5380
- return [2 /*return*/, this.service.delete(id, undefined, commonOptions)];
5381
- });
5382
- });
5383
- };
5384
- CheckinDistanceReasonsService.prototype.update = function (id, checkinDistanceReason, commonOptions) {
5385
- if (commonOptions === void 0) { commonOptions = {}; }
5386
- return __awaiter(this, void 0, void 0, function () {
5387
- var response;
5388
- return __generator(this, function (_a) {
5389
- switch (_a.label) {
5390
- case 0: return [4 /*yield*/, this.service.update(id, checkinDistanceReason, commonOptions)];
5391
- case 1:
5392
- response = _a.sent();
5393
- return [2 /*return*/, response.checkin_distance_reason];
5394
- }
5395
- });
5396
- });
5397
- };
5398
- CheckinDistanceReasonsService.prototype.patch = function (id, checkinDistanceReason, commonOptions) {
5399
- if (commonOptions === void 0) { commonOptions = {}; }
5400
- return __awaiter(this, void 0, void 0, function () {
5401
- var response;
5402
- return __generator(this, function (_a) {
5403
- switch (_a.label) {
5404
- case 0: return [4 /*yield*/, this.service.patch(id, checkinDistanceReason, commonOptions)];
5405
- case 1:
5406
- response = _a.sent();
5407
- return [2 /*return*/, response.checkin_distance_reason];
5408
- }
5409
- });
5410
- });
5411
- };
5412
- /** ids: every non-deleted reason id of the merchant, in the new order. Returns the reasons in that order. */
5413
- CheckinDistanceReasonsService.prototype.reorder = function (ids, commonOptions) {
5414
- if (commonOptions === void 0) { commonOptions = {}; }
5415
- return __awaiter(this, void 0, void 0, function () {
5416
- var payload, response;
5417
- return __generator(this, function (_a) {
5418
- switch (_a.label) {
5419
- case 0:
5420
- payload = { ids: ids };
5421
- return [4 /*yield*/, this.service.routeGenerator
5422
- .patch(Routes.REORDER)
5423
- .withPayload(payload)
5424
- .setException("Failed to reorder ".concat(entityName))
5425
- .withCommonOptions(commonOptions)
5426
- .invoke()];
5427
- case 1:
5428
- response = _a.sent();
5429
- return [2 /*return*/, response.checkin_distance_reasons];
5430
- }
5431
- });
5432
- });
5433
- };
5434
- CheckinDistanceReasonsService.prototype.create = function (checkinDistanceReason, commonOptions) {
5435
- if (commonOptions === void 0) { commonOptions = {}; }
5436
- return __awaiter(this, void 0, void 0, function () {
5437
- var response;
5438
- return __generator(this, function (_a) {
5439
- switch (_a.label) {
5440
- case 0: return [4 /*yield*/, this.service.create(checkinDistanceReason, commonOptions)];
5441
- case 1:
5442
- response = _a.sent();
5443
- return [2 /*return*/, response.checkin_distance_reason];
5444
- }
5445
- });
5446
- });
5447
- };
5448
- return CheckinDistanceReasonsService;
5449
- }());
5450
- exports["default"] = CheckinDistanceReasonsService;
5451
- //# sourceMappingURL=checkin-distance-reasons-service.js.map
5452
-
5453
- /***/ }),
5454
-
5455
5181
  /***/ 97275:
5456
5182
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5457
5183
 
@@ -5572,6 +5298,15 @@ var ConfigurationProfiles = /** @class */ (function () {
5572
5298
  ConfigurationProfiles.prototype.getAll = function (applicationUuid) {
5573
5299
  return this.configurationProfilesService.list(applicationUuid);
5574
5300
  };
5301
+ /**
5302
+ * Fetches the schema defaults of the application's configuration, in the shape of a profile's `configuration`
5303
+ * (e.g. `{ configs: { max_shift_hours: 13 } }`). Keys without a default are left out; no defaults gives `{}`.
5304
+ * @param applicationUuid - Application whose configuration schema is read
5305
+ * @returns The default configuration values
5306
+ */
5307
+ ConfigurationProfiles.prototype.getDefaults = function (applicationUuid) {
5308
+ return this.configurationProfilesService.getDefaults(applicationUuid);
5309
+ };
5575
5310
  ConfigurationProfiles.prototype.create = function (applicationUuid, payload) {
5576
5311
  return this.configurationProfilesService.create(applicationUuid, payload);
5577
5312
  };
@@ -5656,6 +5391,7 @@ var BaseService_1 = __importDefault(__webpack_require__(41992));
5656
5391
  var SERVICE_NAME = 'settings-service';
5657
5392
  exports.Routes = {
5658
5393
  LIST: "/".concat(SERVICE_NAME, "/applications/{:application_uuid}/configuration-profiles"),
5394
+ DEFAULTS: "/".concat(SERVICE_NAME, "/applications/{:application_uuid}/configuration-profiles/defaults"),
5659
5395
  CREATE: "/".concat(SERVICE_NAME, "/applications/{:application_uuid}/configuration-profiles"),
5660
5396
  UPDATE: "/".concat(SERVICE_NAME, "/applications/{:application_uuid}/configuration-profiles/{:id}"),
5661
5397
  SET_DEFAULT: "/".concat(SERVICE_NAME, "/applications/{:application_uuid}/configuration-profiles/{:id}/make-default"),
@@ -5673,6 +5409,13 @@ var ConfigurationProfilesService = /** @class */ (function (_super) {
5673
5409
  });
5674
5410
  });
5675
5411
  };
5412
+ ConfigurationProfilesService.prototype.getDefaults = function (applicationUuid) {
5413
+ return __awaiter(this, void 0, void 0, function () {
5414
+ return __generator(this, function (_a) {
5415
+ return [2 /*return*/, this.routeGenerator.get(exports.Routes.DEFAULTS).withRouteParams({ application_uuid: applicationUuid }).invoke()];
5416
+ });
5417
+ });
5418
+ };
5676
5419
  ConfigurationProfilesService.prototype.create = function (applicationUuid, payload) {
5677
5420
  return __awaiter(this, void 0, void 0, function () {
5678
5421
  return __generator(this, function (_a) {
@@ -7507,9 +7250,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7507
7250
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7508
7251
  var CrewStore_1 = __importDefault(__webpack_require__(99295));
7509
7252
  var Crew = /** @class */ (function () {
7510
- function Crew(session, usersStore) {
7253
+ function Crew(session, usersApi) {
7511
7254
  this.crewStore = new CrewStore_1.default(session);
7512
- this.usersStore = usersStore;
7255
+ this.usersApi = usersApi;
7513
7256
  this.onListUpdate = this.crewStore.onListUpdate;
7514
7257
  this.onItemUpdate = this.crewStore.onItemUpdate;
7515
7258
  this.onItemRemoved = this.crewStore.onItemRemoved;
@@ -7522,7 +7265,7 @@ var Crew = /** @class */ (function () {
7522
7265
  switch (_a.label) {
7523
7266
  case 0:
7524
7267
  assignedDrivers = this.crewStore.driverCurrentlyAssigned.get(teamId) || [];
7525
- return [4 /*yield*/, this.usersStore.getDriversByTeam(teamId)];
7268
+ return [4 /*yield*/, this.usersApi.loadAllByTeam(teamId, { useCache: false })];
7526
7269
  case 1:
7527
7270
  allTeamDrivers = _a.sent();
7528
7271
  availableDrivers = allTeamDrivers.filter(function (driver) { return !assignedDrivers.includes(driver.id); });
@@ -24966,57 +24709,6 @@ exports.ZIP_CODES_UPLOAD_DONE = new PubSubEvent('team zip codes import done');
24966
24709
 
24967
24710
  /***/ }),
24968
24711
 
24969
- /***/ 27467:
24970
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
24971
-
24972
- "use strict";
24973
-
24974
- var __extends = (this && this.__extends) || (function () {
24975
- var extendStatics = function (d, b) {
24976
- extendStatics = Object.setPrototypeOf ||
24977
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
24978
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
24979
- return extendStatics(d, b);
24980
- };
24981
- return function (d, b) {
24982
- if (typeof b !== "function" && b !== null)
24983
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
24984
- extendStatics(d, b);
24985
- function __() { this.constructor = d; }
24986
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24987
- };
24988
- })();
24989
- var __importDefault = (this && this.__importDefault) || function (mod) {
24990
- return (mod && mod.__esModule) ? mod : { "default": mod };
24991
- };
24992
- Object.defineProperty(exports, "__esModule", ({ value: true }));
24993
- exports.PubSubService = void 0;
24994
- var Logger_1 = __importDefault(__webpack_require__(55860));
24995
- var SessionBasedService_1 = __webpack_require__(27826);
24996
- var PubSubService = /** @class */ (function (_super) {
24997
- __extends(PubSubService, _super);
24998
- function PubSubService(endpoint, session) {
24999
- var _this = _super.call(this, endpoint, session) || this;
25000
- Logger_1.default.info('Attaching subscriptions to persistent connection..');
25001
- if (_this.session.persistentConnection) {
25002
- _this.attachSubscriptions();
25003
- Logger_1.default.info('Persistent connection established successfully!');
25004
- }
25005
- return _this;
25006
- }
25007
- PubSubService.prototype.publish = function (ev, ackCallback) {
25008
- this.session.persistentConnection.publish(ev, ackCallback.bind(this));
25009
- };
25010
- PubSubService.prototype.subscribeToEvent = function (eventType, handler) {
25011
- this.session.persistentConnection.subscribe(eventType, handler.bind(this));
25012
- };
25013
- return PubSubService;
25014
- }(SessionBasedService_1.SessionBasedService));
25015
- exports.PubSubService = PubSubService;
25016
- //# sourceMappingURL=PubSubService.js.map
25017
-
25018
- /***/ }),
25019
-
25020
24712
  /***/ 52944:
25021
24713
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
25022
24714
 
@@ -25314,7 +25006,7 @@ var BringgException_1 = __webpack_require__(43605);
25314
25006
  var client_page_1 = __webpack_require__(16573);
25315
25007
  var Logger_1 = __importDefault(__webpack_require__(55860));
25316
25008
  var abort_1 = __webpack_require__(34179);
25317
- var version = '9.96.0-pre.5';
25009
+ var version = '10.0.0';
25318
25010
  function logErrorResponse(response) {
25319
25011
  var data = response.data, status = response.status;
25320
25012
  try {
@@ -29133,9 +28825,6 @@ var TaskConfigurationEntity = /** @class */ (function (_super) {
29133
28825
  routes: [Entity_1.BaseRoutes.Create, Entity_1.BaseRoutes.Update]
29134
28826
  }) || this;
29135
28827
  }
29136
- TaskConfigurationEntity.prototype.getAll = function () {
29137
- return this.service.routeGenerator.get('/merchant/task_configurations').invoke();
29138
- };
29139
28828
  TaskConfigurationEntity.prototype.getAllActionData = function () {
29140
28829
  return this.service.routeGenerator.get('/merchant/task_configurations/get_all_action_data').invoke();
29141
28830
  };
@@ -29151,102 +28840,51 @@ exports["default"] = TaskConfigurationEntity;
29151
28840
 
29152
28841
  "use strict";
29153
28842
 
29154
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29155
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29156
- return new (P || (P = Promise))(function (resolve, reject) {
29157
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29158
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
29159
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29160
- step((generator = generator.apply(thisArg, _arguments || [])).next());
29161
- });
29162
- };
29163
- var __generator = (this && this.__generator) || function (thisArg, body) {
29164
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
29165
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29166
- function verb(n) { return function (v) { return step([n, v]); }; }
29167
- function step(op) {
29168
- if (f) throw new TypeError("Generator is already executing.");
29169
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29170
- 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;
29171
- if (y = 0, t) op = [op[0] & 2, t.value];
29172
- switch (op[0]) {
29173
- case 0: case 1: t = op; break;
29174
- case 4: _.label++; return { value: op[1], done: false };
29175
- case 5: _.label++; y = op[1]; op = [0]; continue;
29176
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
29177
- default:
29178
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
29179
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29180
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29181
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29182
- if (t[2]) _.ops.pop();
29183
- _.trys.pop(); continue;
29184
- }
29185
- op = body.call(thisArg, _);
29186
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
29187
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
29188
- }
29189
- };
29190
- var __importDefault = (this && this.__importDefault) || function (mod) {
29191
- return (mod && mod.__esModule) ? mod : { "default": mod };
29192
- };
29193
- Object.defineProperty(exports, "__esModule", ({ value: true }));
29194
- var TaskConfigurationEntity_1 = __importDefault(__webpack_require__(47345));
29195
- var TaskConfiguration = /** @class */ (function () {
29196
- function TaskConfiguration(session) {
29197
- this.TaskConfigurationEntity = new TaskConfigurationEntity_1.default(session);
29198
- }
29199
- /** Every task configuration of the merchant, with or without actions (id, title, checkin_distance_enforcement). */
29200
- TaskConfiguration.prototype.getAll = function () {
29201
- return __awaiter(this, void 0, void 0, function () {
29202
- var response;
29203
- return __generator(this, function (_a) {
29204
- switch (_a.label) {
29205
- case 0: return [4 /*yield*/, this.TaskConfigurationEntity.getAll()];
29206
- case 1:
29207
- response = _a.sent();
29208
- return [2 /*return*/, response.task_configurations];
29209
- }
29210
- });
29211
- });
29212
- };
29213
- /** Only the task configurations that have actions. */
29214
- TaskConfiguration.prototype.getAllActionData = function () {
29215
- return this.TaskConfigurationEntity.getAllActionData();
29216
- };
29217
- TaskConfiguration.prototype.create = function (taskConfiguration) {
29218
- return this.TaskConfigurationEntity.service.create(taskConfiguration);
29219
- };
29220
- TaskConfiguration.prototype.update = function (id, taskConfiguration) {
29221
- return this.TaskConfigurationEntity.service.update(id, taskConfiguration);
29222
- };
29223
- return TaskConfiguration;
29224
- }());
29225
- exports["default"] = TaskConfiguration;
29226
- //# sourceMappingURL=TaskConfiguration.js.map
29227
-
29228
- /***/ }),
29229
-
29230
- /***/ 93507:
29231
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
29232
-
29233
- "use strict";
29234
-
29235
- var __extends = (this && this.__extends) || (function () {
29236
- var extendStatics = function (d, b) {
29237
- extendStatics = Object.setPrototypeOf ||
29238
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
29239
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
29240
- return extendStatics(d, b);
29241
- };
29242
- return function (d, b) {
29243
- if (typeof b !== "function" && b !== null)
29244
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
29245
- extendStatics(d, b);
29246
- function __() { this.constructor = d; }
29247
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
29248
- };
29249
- })();
28843
+ var __importDefault = (this && this.__importDefault) || function (mod) {
28844
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28845
+ };
28846
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
28847
+ var TaskConfigurationEntity_1 = __importDefault(__webpack_require__(47345));
28848
+ var TaskConfiguration = /** @class */ (function () {
28849
+ function TaskConfiguration(session) {
28850
+ this.TaskConfigurationEntity = new TaskConfigurationEntity_1.default(session);
28851
+ }
28852
+ TaskConfiguration.prototype.getAllActionData = function () {
28853
+ return this.TaskConfigurationEntity.getAllActionData();
28854
+ };
28855
+ TaskConfiguration.prototype.create = function (taskConfiguration) {
28856
+ return this.TaskConfigurationEntity.service.create(taskConfiguration);
28857
+ };
28858
+ TaskConfiguration.prototype.update = function (id, taskConfiguration) {
28859
+ return this.TaskConfigurationEntity.service.update(id, taskConfiguration);
28860
+ };
28861
+ return TaskConfiguration;
28862
+ }());
28863
+ exports["default"] = TaskConfiguration;
28864
+ //# sourceMappingURL=TaskConfiguration.js.map
28865
+
28866
+ /***/ }),
28867
+
28868
+ /***/ 93507:
28869
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
28870
+
28871
+ "use strict";
28872
+
28873
+ var __extends = (this && this.__extends) || (function () {
28874
+ var extendStatics = function (d, b) {
28875
+ extendStatics = Object.setPrototypeOf ||
28876
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28877
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
28878
+ return extendStatics(d, b);
28879
+ };
28880
+ return function (d, b) {
28881
+ if (typeof b !== "function" && b !== null)
28882
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
28883
+ extendStatics(d, b);
28884
+ function __() { this.constructor = d; }
28885
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28886
+ };
28887
+ })();
29250
28888
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29251
28889
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29252
28890
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -31634,1433 +31272,148 @@ exports.RETRYABLE_UPLOAD_ERRORS = Object.freeze([
31634
31272
 
31635
31273
  /***/ }),
31636
31274
 
31637
- /***/ 95401:
31275
+ /***/ 38894:
31638
31276
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
31639
31277
 
31640
31278
  "use strict";
31641
31279
 
31642
- var __extends = (this && this.__extends) || (function () {
31643
- var extendStatics = function (d, b) {
31644
- extendStatics = Object.setPrototypeOf ||
31645
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
31646
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
31647
- return extendStatics(d, b);
31648
- };
31649
- return function (d, b) {
31650
- if (typeof b !== "function" && b !== null)
31651
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31652
- extendStatics(d, b);
31653
- function __() { this.constructor = d; }
31654
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
31655
- };
31656
- })();
31657
- var __assign = (this && this.__assign) || function () {
31658
- __assign = Object.assign || function(t) {
31659
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31660
- s = arguments[i];
31661
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
31662
- t[p] = s[p];
31280
+ var __values = (this && this.__values) || function(o) {
31281
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
31282
+ if (m) return m.call(o);
31283
+ if (o && typeof o.length === "number") return {
31284
+ next: function () {
31285
+ if (o && i >= o.length) o = void 0;
31286
+ return { value: o && o[i++], done: !o };
31663
31287
  }
31664
- return t;
31665
31288
  };
31666
- return __assign.apply(this, arguments);
31289
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
31667
31290
  };
31668
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31669
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
31670
- return new (P || (P = Promise))(function (resolve, reject) {
31671
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31672
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31673
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31674
- step((generator = generator.apply(thisArg, _arguments || [])).next());
31675
- });
31291
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
31292
+ exports.RealtimeEvents = exports.userToGroupsMapper = exports.groupFilter = exports.GROUP_VALUES = exports.UserGroupTypes = exports.UserEvents = exports.ROUTES = exports.ENABLE_USER_GROUPS_CACHE_FEATURE_FLAG = exports.baseRoute = exports.successExtractor = exports.defaultExtractor = exports.UsersScopes = void 0;
31293
+ var UserHelpers_1 = __webpack_require__(2450);
31294
+ var UsersScopes;
31295
+ (function (UsersScopes) {
31296
+ UsersScopes["DRIVERS"] = "drivers";
31297
+ UsersScopes["DISPATCHERS"] = "dispatchers";
31298
+ UsersScopes["ADMINS"] = "admins";
31299
+ UsersScopes["CUSTOMERS"] = "customers";
31300
+ UsersScopes["MARKED_AS_ONLINE"] = "marked_as_online";
31301
+ })(UsersScopes = exports.UsersScopes || (exports.UsersScopes = {}));
31302
+ var defaultExtractor = function (response) { return response; };
31303
+ exports.defaultExtractor = defaultExtractor;
31304
+ var successExtractor = function (response) { return response.success; };
31305
+ exports.successExtractor = successExtractor;
31306
+ exports.baseRoute = '/users';
31307
+ exports.ENABLE_USER_GROUPS_CACHE_FEATURE_FLAG = 'enable_user_groups_cache';
31308
+ exports.ROUTES = {
31309
+ GET_ALL: exports.baseRoute,
31310
+ GET_DRIVERS_BY_TEAM: '/teams/{:teamId}/users',
31311
+ UNLOCK: "".concat(exports.baseRoute, "/{:userId}/unlock"),
31312
+ MESSAGE_DRIVER: '/announcement/user/{:userId}',
31313
+ VALIDATE_PHONE: '/api/user/validate_phone',
31314
+ DELETE_MANY: '/users/batch_delete',
31315
+ DRIVER_COST: '/users/{:userId}/driver_cost',
31316
+ GET_USERS_WITH_USER_TYPE: '/user_types/{:userTypeId}/users',
31317
+ INVITE: '/users/{:userId}/reinvite',
31318
+ INVITE_VIA_EMAIL: '/users/{:userId}/reinvite_via_email',
31319
+ CLOSED_TASKS: '/users/{:userId}/tasks/closed_tasks',
31320
+ TOTAL_TASKS: '/users/{:userId}/tasks/count',
31321
+ GOT_HOME: "".concat(exports.baseRoute, "/{:userId}/got_home"),
31322
+ LEFT_HOME: "".concat(exports.baseRoute, "/{:userId}/left_home"),
31323
+ DRIVER_QR_TOKEN: '/tokens/gen_driver_qr_code'
31676
31324
  };
31677
- var __generator = (this && this.__generator) || function (thisArg, body) {
31678
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
31679
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
31680
- function verb(n) { return function (v) { return step([n, v]); }; }
31681
- function step(op) {
31682
- if (f) throw new TypeError("Generator is already executing.");
31683
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
31684
- 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;
31685
- if (y = 0, t) op = [op[0] & 2, t.value];
31686
- switch (op[0]) {
31687
- case 0: case 1: t = op; break;
31688
- case 4: _.label++; return { value: op[1], done: false };
31689
- case 5: _.label++; y = op[1]; op = [0]; continue;
31690
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
31691
- default:
31692
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
31693
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
31694
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
31695
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31696
- if (t[2]) _.ops.pop();
31697
- _.trys.pop(); continue;
31325
+ var UserEvents;
31326
+ (function (UserEvents) {
31327
+ UserEvents["CURRENT_USER_UPDATED"] = "currentUserUpdated";
31328
+ })(UserEvents = exports.UserEvents || (exports.UserEvents = {}));
31329
+ var UserGroupTypes;
31330
+ (function (UserGroupTypes) {
31331
+ UserGroupTypes["Main"] = "main";
31332
+ })(UserGroupTypes = exports.UserGroupTypes || (exports.UserGroupTypes = {}));
31333
+ var GROUP_VALUES;
31334
+ (function (GROUP_VALUES) {
31335
+ GROUP_VALUES["OfflineDrivers"] = "OfflineDrivers";
31336
+ GROUP_VALUES["OnlineDrivers"] = "OnlineDrivers";
31337
+ GROUP_VALUES["OnShiftDrivers"] = "OnShiftDrivers";
31338
+ GROUP_VALUES["Customers"] = "Customers";
31339
+ GROUP_VALUES["Admins"] = "Admins";
31340
+ GROUP_VALUES["Dispatchers"] = "Dispatchers";
31341
+ GROUP_VALUES["Drivers"] = "Drivers";
31342
+ })(GROUP_VALUES = exports.GROUP_VALUES || (exports.GROUP_VALUES = {}));
31343
+ exports.groupFilter = new Map([
31344
+ [GROUP_VALUES.OfflineDrivers, UserHelpers_1.UserHelpers.isOfflineDriver],
31345
+ [GROUP_VALUES.OnlineDrivers, UserHelpers_1.UserHelpers.isOnlineDriver],
31346
+ [GROUP_VALUES.OnShiftDrivers, UserHelpers_1.UserHelpers.isOnShiftDriver],
31347
+ [GROUP_VALUES.Customers, UserHelpers_1.UserHelpers.isCustomer],
31348
+ [GROUP_VALUES.Admins, UserHelpers_1.UserHelpers.isAdmin],
31349
+ [GROUP_VALUES.Dispatchers, UserHelpers_1.UserHelpers.isDispatcher],
31350
+ [GROUP_VALUES.Drivers, UserHelpers_1.UserHelpers.isDriver]
31351
+ ]);
31352
+ var groupKeys = Array.from(exports.groupFilter.keys());
31353
+ var userToGroupsMapper = function (user) {
31354
+ var e_1, _a;
31355
+ var groups = [];
31356
+ try {
31357
+ for (var groupKeys_1 = __values(groupKeys), groupKeys_1_1 = groupKeys_1.next(); !groupKeys_1_1.done; groupKeys_1_1 = groupKeys_1.next()) {
31358
+ var groupKey = groupKeys_1_1.value;
31359
+ var filterFn = exports.groupFilter.get(groupKey);
31360
+ if (filterFn(user) === true) {
31361
+ groups.push(groupKey);
31698
31362
  }
31699
- op = body.call(thisArg, _);
31700
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
31701
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
31363
+ }
31364
+ }
31365
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
31366
+ finally {
31367
+ try {
31368
+ if (groupKeys_1_1 && !groupKeys_1_1.done && (_a = groupKeys_1.return)) _a.call(groupKeys_1);
31369
+ }
31370
+ finally { if (e_1) throw e_1.error; }
31702
31371
  }
31372
+ return groups;
31703
31373
  };
31374
+ exports.userToGroupsMapper = userToGroupsMapper;
31375
+ var RealtimeEvents;
31376
+ (function (RealtimeEvents) {
31377
+ RealtimeEvents["Update"] = "employee update";
31378
+ RealtimeEvents["Create"] = "new employee";
31379
+ RealtimeEvents["Delete"] = "delete employee";
31380
+ })(RealtimeEvents = exports.RealtimeEvents || (exports.RealtimeEvents = {}));
31381
+ //# sourceMappingURL=User.consts.js.map
31382
+
31383
+ /***/ }),
31384
+
31385
+ /***/ 2450:
31386
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
31387
+
31388
+ "use strict";
31389
+
31704
31390
  Object.defineProperty(exports, "__esModule", ({ value: true }));
31391
+ exports.UserHelpers = void 0;
31392
+ var types_1 = __webpack_require__(63127);
31705
31393
  var lodash_1 = __webpack_require__(96486);
31706
- var BringgException_1 = __webpack_require__(43605);
31707
- var RouteGenerator_1 = __webpack_require__(84075);
31708
- var PubSubEvents_1 = __webpack_require__(74102);
31709
- var PubSubService_1 = __webpack_require__(27467);
31710
- var Route_1 = __webpack_require__(92641);
31711
- var keyset_pagination_consts_1 = __webpack_require__(92400);
31712
- var User_consts_1 = __webpack_require__(38894);
31713
- var ROUTES = {
31714
- GET: new Route_1.Route('/users/{:userId}', 0 /* HttpMethod.GET */),
31715
- GET_ALL: new Route_1.Route('/users/', 0 /* HttpMethod.GET */),
31716
- GET_ALL_DRIVERS: new Route_1.Route('/users/drivers', 0 /* HttpMethod.GET */),
31717
- GET_USERS_WITH_USER_TYPE: new Route_1.Route('/user_types/{:userTypeId}/users', 0 /* HttpMethod.GET */),
31718
- GET_DRIVERS_BY_TEAM: new Route_1.Route('/teams/{:teamId}/users', 0 /* HttpMethod.GET */),
31719
- MAKE_ADMIN: new Route_1.Route('/users/{:userId}/admin', 1 /* HttpMethod.POST */),
31720
- CREATE_USER: new Route_1.Route('/users/', 1 /* HttpMethod.POST */),
31721
- INVITE: new Route_1.Route('/users/{:userId}/reinvite', 1 /* HttpMethod.POST */),
31722
- TOTAL_TASKS: new Route_1.Route('/users/{:userId}/tasks/count', 0 /* HttpMethod.GET */),
31723
- TOTAL_EMPLOYEES: new Route_1.Route('/users/count', 0 /* HttpMethod.GET */),
31724
- TOTAL_DRIVERS: new Route_1.Route('/users/drivers/count', 0 /* HttpMethod.GET */),
31725
- UNLOCK: new Route_1.Route('/users/{:userId}/unlock', 1 /* HttpMethod.POST */),
31726
- INVITE_VIA_EMAIL: new Route_1.Route('/users/{:userId}/reinvite_via_email', 1 /* HttpMethod.POST */),
31727
- VALIDATE_PHONE: new Route_1.Route('/api/user/validate_phone', 0 /* HttpMethod.GET */),
31728
- CLOSED_TASKS: new Route_1.Route('/users/{:userId}/tasks/closed_tasks', 0 /* HttpMethod.GET */),
31729
- UPDATE: new Route_1.Route('/users/{:id}', 3 /* HttpMethod.PATCH */),
31730
- DELETE: new Route_1.Route('/users/{:id}', 4 /* HttpMethod.DELETE */),
31731
- GET_PROFILE_IMAGE: new Route_1.Route('/users/{:userId}/profile_image', 0 /* HttpMethod.GET */),
31732
- MESSAGE_DRIVER: new Route_1.Route('/announcement/user/{:userId}', 2 /* HttpMethod.PUT */),
31733
- DRIVER_COST: new Route_1.Route('/users/{:userId}/driver_cost', 0 /* HttpMethod.GET */),
31734
- GENERATE_RESET_PASSWORD_TOKEN: new Route_1.Route('/users/generate_reset_password_token', 1 /* HttpMethod.POST */)
31735
- };
31736
- var UsersService = /** @class */ (function (_super) {
31737
- __extends(UsersService, _super);
31738
- function UsersService(session, store) {
31739
- var _this = _super.call(this, session.config.getApiEndpoint(), session) || this;
31740
- _this.store = store;
31741
- return _this;
31394
+ var UserHelpers = /** @class */ (function () {
31395
+ function UserHelpers() {
31742
31396
  }
31743
- UsersService.prototype.create = function (user) {
31744
- return __awaiter(this, void 0, void 0, function () {
31745
- return __generator(this, function (_a) {
31746
- switch (_a.label) {
31747
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31748
- route: ROUTES.CREATE_USER,
31749
- extractor: User_consts_1.userExtractor,
31750
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not create user'),
31751
- payload: user
31752
- })];
31753
- case 1: return [2 /*return*/, _a.sent()];
31754
- }
31755
- });
31756
- });
31757
- };
31758
- UsersService.prototype.getDriversByTeam = function (teamId) {
31759
- return __awaiter(this, void 0, void 0, function () {
31760
- return __generator(this, function (_a) {
31761
- switch (_a.label) {
31762
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31763
- route: ROUTES.GET_DRIVERS_BY_TEAM,
31764
- extractor: User_consts_1.defaultExtractor,
31765
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),
31766
- routeParams: { teamId: teamId }
31767
- })];
31768
- case 1: return [2 /*return*/, _a.sent()];
31769
- }
31770
- });
31771
- });
31772
- };
31773
- UsersService.prototype.get = function (userId) {
31774
- return __awaiter(this, void 0, void 0, function () {
31775
- return __generator(this, function (_a) {
31776
- switch (_a.label) {
31777
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31778
- route: ROUTES.GET,
31779
- extractor: User_consts_1.defaultExtractor,
31780
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not get user ".concat(userId); }),
31781
- routeParams: { userId: userId }
31782
- })];
31783
- case 1: return [2 /*return*/, _a.sent()];
31784
- }
31785
- });
31786
- });
31787
- };
31788
- UsersService.prototype.getMany = function (_a, commonOptions) {
31789
- var usersIds = _a.usersIds, _b = _a.page, page = _b === void 0 ? 1 : _b, _c = _a.limit, limit = _c === void 0 ? 50 : _c;
31790
- return __awaiter(this, void 0, void 0, function () {
31791
- return __generator(this, function (_d) {
31792
- return [2 /*return*/, new RouteGenerator_1.Request(this, ROUTES.GET_ALL)
31793
- .withQueryString({ ids: usersIds, page: page, limit: limit })
31794
- .withExtractor(function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); })
31795
- .setException('Could not get users by ids')
31796
- .withCommonOptions(commonOptions)
31797
- .invoke()];
31798
- });
31799
- });
31800
- };
31801
- UsersService.prototype.getAll = function (page, limit) {
31802
- if (page === void 0) { page = 1; }
31803
- if (limit === void 0) { limit = 50; }
31804
- return __awaiter(this, void 0, void 0, function () {
31805
- var response;
31806
- return __generator(this, function (_a) {
31807
- switch (_a.label) {
31808
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31809
- route: ROUTES.GET_ALL,
31810
- extractor: function (response) { return ({ has_next_page: response.has_next_page, users: response.users }); },
31811
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),
31812
- queryString: { page: page, limit: limit }
31813
- })];
31814
- case 1:
31815
- response = _a.sent();
31816
- return [2 /*return*/, response];
31817
- }
31818
- });
31819
- });
31820
- };
31821
- UsersService.prototype.getAllKeysetPagination = function (request) {
31822
- return __awaiter(this, void 0, void 0, function () {
31823
- var limit, page_action, cursor, response;
31824
- return __generator(this, function (_a) {
31825
- switch (_a.label) {
31826
- case 0:
31827
- limit = request.limit, page_action = request.page_action, cursor = request.cursor;
31828
- return [4 /*yield*/, this.handleAuthorizedRequest({
31829
- route: ROUTES.GET_ALL,
31830
- extractor: function (response) { return ({
31831
- next_page_cursor: response.next_page_cursor,
31832
- previous_page_cursor: response.previous_page_cursor,
31833
- users: response.users
31834
- }); },
31835
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),
31836
- queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, limit: limit, page_action: page_action, cursor: cursor }
31837
- })];
31838
- case 1:
31839
- response = _a.sent();
31840
- return [2 /*return*/, response];
31841
- }
31842
- });
31843
- });
31844
- };
31845
- UsersService.prototype.invite = function (userId) {
31846
- return __awaiter(this, void 0, void 0, function () {
31847
- return __generator(this, function (_a) {
31848
- switch (_a.label) {
31849
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31850
- route: ROUTES.INVITE,
31851
- extractor: User_consts_1.userExtractor,
31852
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not invite user with id: ".concat(userId); }),
31853
- routeParams: { userId: userId }
31854
- })];
31855
- case 1: return [2 /*return*/, _a.sent()];
31856
- }
31857
- });
31858
- });
31859
- };
31860
- UsersService.prototype.unlock = function (userId) {
31861
- return __awaiter(this, void 0, void 0, function () {
31862
- return __generator(this, function (_a) {
31863
- switch (_a.label) {
31864
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31865
- route: ROUTES.UNLOCK,
31866
- extractor: User_consts_1.successExtractor,
31867
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not unlock user with id: ".concat(userId); }),
31868
- routeParams: { userId: userId }
31869
- })];
31870
- case 1: return [2 /*return*/, _a.sent()];
31871
- }
31872
- });
31873
- });
31874
- };
31875
- UsersService.prototype.assignedTasksCount = function (userId) {
31876
- return __awaiter(this, void 0, void 0, function () {
31877
- return __generator(this, function (_a) {
31878
- switch (_a.label) {
31879
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31880
- route: ROUTES.TOTAL_TASKS,
31881
- extractor: User_consts_1.countExtractor,
31882
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not get task count for user with id: ".concat(userId); }),
31883
- routeParams: { userId: userId }
31884
- })];
31885
- case 1: return [2 /*return*/, _a.sent()];
31886
- }
31887
- });
31888
- });
31889
- };
31890
- UsersService.prototype.totalEmployeesCount = function () {
31891
- return __awaiter(this, void 0, void 0, function () {
31892
- return __generator(this, function (_a) {
31893
- switch (_a.label) {
31894
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31895
- route: ROUTES.TOTAL_EMPLOYEES,
31896
- extractor: User_consts_1.countExtractor,
31897
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return 'Could not get total employee count'; })
31898
- })];
31899
- case 1: return [2 /*return*/, _a.sent()];
31900
- }
31901
- });
31902
- });
31903
- };
31904
- UsersService.prototype.totalDriversCount = function () {
31905
- return __awaiter(this, void 0, void 0, function () {
31906
- return __generator(this, function (_a) {
31907
- switch (_a.label) {
31908
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31909
- route: ROUTES.TOTAL_DRIVERS,
31910
- extractor: User_consts_1.countExtractor,
31911
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return 'Could not get total drivers count'; })
31912
- })];
31913
- case 1: return [2 /*return*/, _a.sent()];
31914
- }
31915
- });
31916
- });
31917
- };
31918
- UsersService.prototype.inviteByEmail = function (userId) {
31919
- return __awaiter(this, void 0, void 0, function () {
31920
- return __generator(this, function (_a) {
31921
- switch (_a.label) {
31922
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31923
- route: ROUTES.INVITE_VIA_EMAIL,
31924
- extractor: User_consts_1.userExtractor,
31925
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not invite user with id: ".concat(userId); }),
31926
- routeParams: { userId: userId }
31927
- })];
31928
- case 1: return [2 /*return*/, _a.sent()];
31929
- }
31930
- });
31931
- });
31932
- };
31933
- UsersService.prototype.validatePhone = function (phone) {
31934
- return __awaiter(this, void 0, void 0, function () {
31935
- return __generator(this, function (_a) {
31936
- switch (_a.label) {
31937
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31938
- route: ROUTES.VALIDATE_PHONE,
31939
- extractor: function (response) { return response.phone_valid; },
31940
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Phone is not valid: ".concat(phone); }),
31941
- queryString: { phone: phone }
31942
- })];
31943
- case 1: return [2 /*return*/, _a.sent()];
31944
- }
31945
- });
31946
- });
31947
- };
31948
- UsersService.prototype.closedTasks = function (userId, page) {
31949
- if (page === void 0) { page = 0; }
31950
- return __awaiter(this, void 0, void 0, function () {
31951
- return __generator(this, function (_a) {
31952
- switch (_a.label) {
31953
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31954
- route: ROUTES.CLOSED_TASKS,
31955
- extractor: User_consts_1.defaultExtractor,
31956
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not get tasks for user: ".concat(userId); }),
31957
- routeParams: { userId: userId },
31958
- queryString: { page: page }
31959
- })];
31960
- case 1: return [2 /*return*/, _a.sent()];
31961
- }
31962
- });
31963
- });
31964
- };
31965
- UsersService.prototype.update = function (id, userDelta) {
31966
- return __awaiter(this, void 0, void 0, function () {
31967
- return __generator(this, function (_a) {
31968
- switch (_a.label) {
31969
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
31970
- route: ROUTES.UPDATE,
31971
- extractor: User_consts_1.userExtractor,
31972
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not update user: ".concat(id); }),
31973
- payload: __assign({ id: id }, userDelta),
31974
- routeParams: { id: id }
31975
- })];
31976
- case 1: return [2 /*return*/, _a.sent()];
31977
- }
31978
- });
31979
- });
31397
+ UserHelpers.isOfflineDriver = function (user) {
31398
+ return user.driver === true && user.status === types_1.Connection.Offline;
31980
31399
  };
31981
- UsersService.prototype.getAllAdminsAndDispatchers = function (request) {
31982
- return __awaiter(this, void 0, void 0, function () {
31983
- var limit, page_action, cursor, scopes, response;
31984
- return __generator(this, function (_a) {
31985
- switch (_a.label) {
31986
- case 0:
31987
- limit = request.limit, page_action = request.page_action, cursor = request.cursor;
31988
- scopes = [User_consts_1.UsersScopes.DISPATCHERS, User_consts_1.UsersScopes.ADMINS];
31989
- return [4 /*yield*/, this.handleAuthorizedRequest({
31990
- route: ROUTES.GET_ALL,
31991
- extractor: function (response) { return ({
31992
- next_page_cursor: response.next_page_cursor,
31993
- previous_page_cursor: response.previous_page_cursor,
31994
- users: response.users
31995
- }); },
31996
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get admins and dispatchers'),
31997
- queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }
31998
- })];
31999
- case 1:
32000
- response = _a.sent();
32001
- return [2 /*return*/, response];
32002
- }
32003
- });
32004
- });
31400
+ UserHelpers.isOnlineDriver = function (user) {
31401
+ return user.driver === true && user.status === types_1.Connection.Online;
32005
31402
  };
32006
- UsersService.prototype.getAllDrivers = function (request) {
32007
- return __awaiter(this, void 0, void 0, function () {
32008
- var limit, page_action, cursor, options, scopes;
32009
- return __generator(this, function (_a) {
32010
- switch (_a.label) {
32011
- case 0:
32012
- limit = request.limit, page_action = request.page_action, cursor = request.cursor, options = request.options;
32013
- scopes = [];
32014
- if ((0, lodash_1.get)(options, 'onlyCustomers')) {
32015
- scopes.push(User_consts_1.UsersScopes.CUSTOMERS);
32016
- }
32017
- else {
32018
- scopes.push(User_consts_1.UsersScopes.DRIVERS);
32019
- }
32020
- if (options.onlyOnlineDriver) {
32021
- scopes.push(User_consts_1.UsersScopes.MARKED_AS_ONLINE);
32022
- }
32023
- return [4 /*yield*/, this.handleAuthorizedRequest({
32024
- route: ROUTES.GET_ALL,
32025
- extractor: function (response) { return ({
32026
- next_page_cursor: response.next_page_cursor,
32027
- previous_page_cursor: response.previous_page_cursor,
32028
- users: response.users
32029
- }); },
32030
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get drivers'),
32031
- queryString: { pgver: keyset_pagination_consts_1.KEYSET_PAGINATION_VER, scopes: scopes, limit: limit, page_action: page_action, cursor: cursor }
32032
- })];
32033
- case 1: return [2 /*return*/, _a.sent()];
32034
- }
32035
- });
32036
- });
31403
+ UserHelpers.isOnShiftDriver = function (user) {
31404
+ return user.driver === true && !(0, lodash_1.isNil)(user.active_shift_id);
32037
31405
  };
32038
- UsersService.prototype.delete = function (id) {
32039
- return __awaiter(this, void 0, void 0, function () {
32040
- var result;
32041
- return __generator(this, function (_a) {
32042
- switch (_a.label) {
32043
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32044
- route: ROUTES.DELETE,
32045
- extractor: User_consts_1.successExtractor,
32046
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not delete user: ".concat(id); }),
32047
- routeParams: { id: id }
32048
- })];
32049
- case 1:
32050
- result = _a.sent();
32051
- return [2 /*return*/, result];
32052
- }
32053
- });
32054
- });
31406
+ UserHelpers.isCustomer = function (user) {
31407
+ return user.customer === true;
32055
31408
  };
32056
- UsersService.prototype.getProfileImage = function (userId) {
32057
- return __awaiter(this, void 0, void 0, function () {
32058
- return __generator(this, function (_a) {
32059
- switch (_a.label) {
32060
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32061
- route: ROUTES.GET_PROFILE_IMAGE,
32062
- extractor: function (response) { return response.profile_image; },
32063
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not get user's ".concat(userId, " profile image"); }),
32064
- routeParams: { userId: userId }
32065
- })];
32066
- case 1: return [2 /*return*/, _a.sent()];
32067
- }
32068
- });
32069
- });
31409
+ UserHelpers.isAdmin = function (user) {
31410
+ return user.admin === true;
32070
31411
  };
32071
- UsersService.prototype.messageDriver = function (userId, message) {
32072
- return __awaiter(this, void 0, void 0, function () {
32073
- return __generator(this, function (_a) {
32074
- switch (_a.label) {
32075
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32076
- route: ROUTES.MESSAGE_DRIVER,
32077
- extractor: function (response) { return response.announcement_id; },
32078
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not message to user ".concat(userId); }),
32079
- payload: { user_id: userId, message: message },
32080
- routeParams: { userId: userId }
32081
- })];
32082
- case 1: return [2 /*return*/, _a.sent()];
32083
- }
32084
- });
32085
- });
31412
+ UserHelpers.isDispatcher = function (user) {
31413
+ return user.dispatcher === true;
32086
31414
  };
32087
- UsersService.prototype.getDriverCost = function (userId) {
32088
- return __awaiter(this, void 0, void 0, function () {
32089
- return __generator(this, function (_a) {
32090
- switch (_a.label) {
32091
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32092
- route: ROUTES.DRIVER_COST,
32093
- extractor: function (response) { return response; },
32094
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not get cost to user ".concat(userId); }),
32095
- routeParams: { userId: userId }
32096
- })];
32097
- case 1: return [2 /*return*/, _a.sent()];
32098
- }
32099
- });
32100
- });
32101
- };
32102
- UsersService.prototype.byUserType = function (userTypeId) {
32103
- return __awaiter(this, void 0, void 0, function () {
32104
- return __generator(this, function (_a) {
32105
- switch (_a.label) {
32106
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32107
- route: ROUTES.GET_USERS_WITH_USER_TYPE,
32108
- extractor: User_consts_1.usersExtractor,
32109
- exceptionProducer: BringgException_1.BringgException.serviceException('Could not get users'),
32110
- routeParams: { userTypeId: userTypeId }
32111
- })];
32112
- case 1: return [2 /*return*/, _a.sent()];
32113
- }
32114
- });
32115
- });
32116
- };
32117
- UsersService.prototype.makeAdmin = function (userId) {
32118
- return __awaiter(this, void 0, void 0, function () {
32119
- return __generator(this, function (_a) {
32120
- switch (_a.label) {
32121
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32122
- route: ROUTES.MAKE_ADMIN,
32123
- extractor: User_consts_1.userExtractor,
32124
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return "Could not set admin on userId: ".concat(userId); }),
32125
- routeParams: { userId: userId }
32126
- })];
32127
- case 1: return [2 /*return*/, _a.sent()];
32128
- }
32129
- });
32130
- });
32131
- };
32132
- UsersService.prototype.fetchAllPages = function (fn, options) {
32133
- var _a;
32134
- return __awaiter(this, void 0, void 0, function () {
32135
- var result, hasMore, cursor, _b, values, hasMoreInPage, nextCursor;
32136
- return __generator(this, function (_c) {
32137
- switch (_c.label) {
32138
- case 0:
32139
- result = [];
32140
- hasMore = true;
32141
- cursor = undefined;
32142
- _c.label = 1;
32143
- case 1:
32144
- if (!hasMore) return [3 /*break*/, 3];
32145
- if ((_a = options === null || options === void 0 ? void 0 : options.signal) === null || _a === void 0 ? void 0 : _a.aborted) {
32146
- throw new Error('Aborted');
32147
- }
32148
- return [4 /*yield*/, fn(cursor)];
32149
- case 2:
32150
- _b = _c.sent(), values = _b.values, hasMoreInPage = _b.hasMore, nextCursor = _b.nextCursor;
32151
- result = result.concat(values);
32152
- hasMore = hasMoreInPage;
32153
- cursor = nextCursor;
32154
- return [3 /*break*/, 1];
32155
- case 3: return [2 /*return*/, result];
32156
- }
32157
- });
32158
- });
32159
- };
32160
- UsersService.prototype.attachSubscriptions = function () {
32161
- var _this = this;
32162
- this.subscribeToEvent(PubSubEvents_1.DELETE_EMPLOYEE, function (user) {
32163
- _this.store.removeFromStore(user.user_id);
32164
- });
32165
- this.subscribeToEvent(PubSubEvents_1.EMPLOYEE_UPDATE_EVENT, function (user) {
32166
- _this.store.updateInStore(user);
32167
- });
32168
- this.subscribeToEvent(PubSubEvents_1.NEW_EMPLOYEE, function (user) {
32169
- _this.store.addToStore(user);
32170
- });
32171
- };
32172
- UsersService.prototype.generateResetPasswordToken = function (email) {
32173
- return __awaiter(this, void 0, void 0, function () {
32174
- return __generator(this, function (_a) {
32175
- switch (_a.label) {
32176
- case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
32177
- route: ROUTES.GENERATE_RESET_PASSWORD_TOKEN,
32178
- extractor: function (response) { return response.reset_password_token; },
32179
- payload: { email: email },
32180
- exceptionProducer: BringgException_1.BringgException.serviceException(function () { return 'Could not generate token'; })
32181
- })];
32182
- case 1: return [2 /*return*/, _a.sent()];
32183
- }
32184
- });
32185
- });
32186
- };
32187
- return UsersService;
32188
- }(PubSubService_1.PubSubService));
32189
- exports["default"] = UsersService;
32190
- //# sourceMappingURL=UsersService.js.map
32191
-
32192
- /***/ }),
32193
-
32194
- /***/ 68562:
32195
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
32196
-
32197
- "use strict";
32198
-
32199
- var __extends = (this && this.__extends) || (function () {
32200
- var extendStatics = function (d, b) {
32201
- extendStatics = Object.setPrototypeOf ||
32202
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
32203
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
32204
- return extendStatics(d, b);
32205
- };
32206
- return function (d, b) {
32207
- if (typeof b !== "function" && b !== null)
32208
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
32209
- extendStatics(d, b);
32210
- function __() { this.constructor = d; }
32211
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
32212
- };
32213
- })();
32214
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
32215
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32216
- return new (P || (P = Promise))(function (resolve, reject) {
32217
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32218
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32219
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32220
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32221
- });
32222
- };
32223
- var __generator = (this && this.__generator) || function (thisArg, body) {
32224
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32225
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
32226
- function verb(n) { return function (v) { return step([n, v]); }; }
32227
- function step(op) {
32228
- if (f) throw new TypeError("Generator is already executing.");
32229
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
32230
- 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;
32231
- if (y = 0, t) op = [op[0] & 2, t.value];
32232
- switch (op[0]) {
32233
- case 0: case 1: t = op; break;
32234
- case 4: _.label++; return { value: op[1], done: false };
32235
- case 5: _.label++; y = op[1]; op = [0]; continue;
32236
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
32237
- default:
32238
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
32239
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
32240
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
32241
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
32242
- if (t[2]) _.ops.pop();
32243
- _.trys.pop(); continue;
32244
- }
32245
- op = body.call(thisArg, _);
32246
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
32247
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
32248
- }
32249
- };
32250
- var __values = (this && this.__values) || function(o) {
32251
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
32252
- if (m) return m.call(o);
32253
- if (o && typeof o.length === "number") return {
32254
- next: function () {
32255
- if (o && i >= o.length) o = void 0;
32256
- return { value: o && o[i++], done: !o };
32257
- }
32258
- };
32259
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
32260
- };
32261
- var __read = (this && this.__read) || function (o, n) {
32262
- var m = typeof Symbol === "function" && o[Symbol.iterator];
32263
- if (!m) return o;
32264
- var i = m.call(o), r, ar = [], e;
32265
- try {
32266
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
32267
- }
32268
- catch (error) { e = { error: error }; }
32269
- finally {
32270
- try {
32271
- if (r && !r.done && (m = i["return"])) m.call(i);
32272
- }
32273
- finally { if (e) throw e.error; }
32274
- }
32275
- return ar;
32276
- };
32277
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
32278
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
32279
- if (ar || !(i in from)) {
32280
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
32281
- ar[i] = from[i];
32282
- }
32283
- }
32284
- return to.concat(ar || Array.prototype.slice.call(from));
32285
- };
32286
- var __importDefault = (this && this.__importDefault) || function (mod) {
32287
- return (mod && mod.__esModule) ? mod : { "default": mod };
32288
- };
32289
- Object.defineProperty(exports, "__esModule", ({ value: true }));
32290
- exports.MAX_CONCURRENT_CHUNKED_REQUESTS = exports.DEFAULT_CHUNK_SIZE = void 0;
32291
- var types_1 = __webpack_require__(63127);
32292
- var chunk_1 = __importDefault(__webpack_require__(8400));
32293
- var forEach_1 = __importDefault(__webpack_require__(84486));
32294
- var last_1 = __importDefault(__webpack_require__(10928));
32295
- var rxjs_1 = __webpack_require__(34143);
32296
- var operators_1 = __webpack_require__(11717);
32297
- var BaseStore_1 = __importDefault(__webpack_require__(14436));
32298
- var UsersService_1 = __importDefault(__webpack_require__(95401));
32299
- var User_consts_1 = __webpack_require__(38894);
32300
- var UserHelpers_1 = __webpack_require__(2450);
32301
- var THROTTLE_TIME = 500;
32302
- var MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS = 300;
32303
- exports.DEFAULT_CHUNK_SIZE = 50;
32304
- exports.MAX_CONCURRENT_CHUNKED_REQUESTS = 4;
32305
- var UsersStore = /** @class */ (function (_super) {
32306
- __extends(UsersStore, _super);
32307
- function UsersStore(session, throttleTimeValue) {
32308
- var e_1, _a;
32309
- var _this = _super.call(this, {
32310
- realTime: {
32311
- addItemsWhenHandlingUpdate: false
32312
- }
32313
- }) || this;
32314
- _this.groupUpdateEvents = [];
32315
- _this.groupedValues = new Map();
32316
- _this.drivers = [];
32317
- _this.fetchedStatus = {
32318
- drivers: false,
32319
- customers: false,
32320
- adminsAndDispatchers: false
32321
- };
32322
- _this.usersService = new UsersService_1.default(session, _this);
32323
- _this.onlineDriversCounterByTeam = new Map();
32324
- try {
32325
- for (var _b = __values(Object.keys(User_consts_1.GROUP_VALUES)), _c = _b.next(); !_c.done; _c = _b.next()) {
32326
- var groupId = _c.value;
32327
- _this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], new Set());
32328
- }
32329
- }
32330
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
32331
- finally {
32332
- try {
32333
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
32334
- }
32335
- finally { if (e_1) throw e_1.error; }
32336
- }
32337
- throttleTimeValue = throttleTimeValue || THROTTLE_TIME;
32338
- _this.onItemRemoved(function (userId, user) {
32339
- var e_2, _a;
32340
- var isDriverOnline = (user === null || user === void 0 ? void 0 : user.status) === types_1.Connection.Online;
32341
- if (isDriverOnline && user.team_ids) {
32342
- try {
32343
- for (var _b = __values(user.team_ids), _c = _b.next(); !_c.done; _c = _b.next()) {
32344
- var teamId = _c.value;
32345
- _this.onlineDriversCounterByTeam.set(teamId, Math.max(_this.onlineDriversCounterByTeam.get(teamId) - 1, 0));
32346
- }
32347
- }
32348
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
32349
- finally {
32350
- try {
32351
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
32352
- }
32353
- finally { if (e_2) throw e_2.error; }
32354
- }
32355
- }
32356
- });
32357
- //group by and save ids | can add config to throttle through users( maybe increase if admin )
32358
- _this.state$
32359
- .pipe((0, operators_1.throttleTime)(throttleTimeValue, rxjs_1.asyncScheduler, { trailing: true, leading: false }))
32360
- .subscribe(function (users) {
32361
- _this.initGroups(users.values());
32362
- _this.emitGroupEvents();
32363
- });
32364
- return _this;
32365
- }
32366
- UsersStore.prototype.getRelevantDrivers = function (groupsToInit) {
32367
- if (groupsToInit.length === Object.keys(User_consts_1.GROUP_VALUES).length) {
32368
- return [];
32369
- }
32370
- else {
32371
- return this.drivers.filter(function (driver) {
32372
- return !((UserHelpers_1.UserHelpers.isOnlineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnlineDrivers)) ||
32373
- (UserHelpers_1.UserHelpers.isOfflineDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OfflineDrivers)) ||
32374
- (UserHelpers_1.UserHelpers.isOnShiftDriver(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.OnShiftDrivers)) ||
32375
- (UserHelpers_1.UserHelpers.isAdmin(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Admins)) ||
32376
- (UserHelpers_1.UserHelpers.isDispatcher(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Dispatchers)) ||
32377
- (UserHelpers_1.UserHelpers.isCustomer(driver) && groupsToInit.includes(User_consts_1.GROUP_VALUES.Customers)));
32378
- });
32379
- }
32380
- };
32381
- UsersStore.prototype.initGroups = function (users, groupsToInit) {
32382
- var e_3, _a, _b, e_4, _c, e_5, _d, e_6, _e, e_7, _f;
32383
- if (groupsToInit === void 0) { groupsToInit = Object.keys(User_consts_1.GROUP_VALUES); }
32384
- var groups = {};
32385
- try {
32386
- for (var groupsToInit_1 = __values(groupsToInit), groupsToInit_1_1 = groupsToInit_1.next(); !groupsToInit_1_1.done; groupsToInit_1_1 = groupsToInit_1.next()) {
32387
- var groupId = groupsToInit_1_1.value;
32388
- groups[groupId] = new Set();
32389
- }
32390
- }
32391
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
32392
- finally {
32393
- try {
32394
- if (groupsToInit_1_1 && !groupsToInit_1_1.done && (_a = groupsToInit_1.return)) _a.call(groupsToInit_1);
32395
- }
32396
- finally { if (e_3) throw e_3.error; }
32397
- }
32398
- var relevantDrivers = this.getRelevantDrivers(groupsToInit);
32399
- this.drivers.length = 0; // do not change drivers ref - manu pointer rely on it on their state on bringg-web
32400
- (_b = this.drivers).push.apply(_b, __spreadArray([], __read(relevantDrivers), false));
32401
- this.onlineDriversCounterByTeam = new Map();
32402
- try {
32403
- for (var users_1 = __values(users), users_1_1 = users_1.next(); !users_1_1.done; users_1_1 = users_1.next()) {
32404
- var user = users_1_1.value;
32405
- if (user.driver) {
32406
- this.drivers.push(user);
32407
- var isDriverOnline = user.status === types_1.Connection.Online;
32408
- if (isDriverOnline && user.team_ids) {
32409
- try {
32410
- for (var _g = (e_5 = void 0, __values(user.team_ids)), _h = _g.next(); !_h.done; _h = _g.next()) {
32411
- var teamId = _h.value;
32412
- this.onlineDriversCounterByTeam.set(teamId, this.onlineDriversCounterByTeam.has(teamId)
32413
- ? this.onlineDriversCounterByTeam.get(teamId) + 1
32414
- : 1);
32415
- }
32416
- }
32417
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
32418
- finally {
32419
- try {
32420
- if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
32421
- }
32422
- finally { if (e_5) throw e_5.error; }
32423
- }
32424
- }
32425
- }
32426
- var groupIds = (0, User_consts_1.userToGroupsMapper)(user);
32427
- try {
32428
- for (var groupIds_1 = (e_6 = void 0, __values(groupIds)), groupIds_1_1 = groupIds_1.next(); !groupIds_1_1.done; groupIds_1_1 = groupIds_1.next()) {
32429
- var groupId = groupIds_1_1.value;
32430
- if (groups[groupId]) {
32431
- groups[groupId].add(user);
32432
- }
32433
- }
32434
- }
32435
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
32436
- finally {
32437
- try {
32438
- if (groupIds_1_1 && !groupIds_1_1.done && (_e = groupIds_1.return)) _e.call(groupIds_1);
32439
- }
32440
- finally { if (e_6) throw e_6.error; }
32441
- }
32442
- }
32443
- }
32444
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
32445
- finally {
32446
- try {
32447
- if (users_1_1 && !users_1_1.done && (_c = users_1.return)) _c.call(users_1);
32448
- }
32449
- finally { if (e_4) throw e_4.error; }
32450
- }
32451
- try {
32452
- for (var groupsToInit_2 = __values(groupsToInit), groupsToInit_2_1 = groupsToInit_2.next(); !groupsToInit_2_1.done; groupsToInit_2_1 = groupsToInit_2.next()) {
32453
- var groupId = groupsToInit_2_1.value;
32454
- this.groupedValues.set(User_consts_1.GROUP_VALUES[groupId], groups[groupId] || new Set());
32455
- }
32456
- }
32457
- catch (e_7_1) { e_7 = { error: e_7_1 }; }
32458
- finally {
32459
- try {
32460
- if (groupsToInit_2_1 && !groupsToInit_2_1.done && (_f = groupsToInit_2.return)) _f.call(groupsToInit_2);
32461
- }
32462
- finally { if (e_7) throw e_7.error; }
32463
- }
32464
- };
32465
- UsersStore.prototype.create = function (user) {
32466
- return __awaiter(this, void 0, void 0, function () {
32467
- var newUser;
32468
- return __generator(this, function (_a) {
32469
- switch (_a.label) {
32470
- case 0: return [4 /*yield*/, this.usersService.create(user)];
32471
- case 1:
32472
- newUser = _a.sent();
32473
- this.addToStore(newUser);
32474
- return [2 /*return*/, newUser];
32475
- }
32476
- });
32477
- });
32478
- };
32479
- UsersStore.prototype.getDriversByTeam = function (teamId) {
32480
- return __awaiter(this, void 0, void 0, function () {
32481
- var users;
32482
- var _this = this;
32483
- return __generator(this, function (_a) {
32484
- switch (_a.label) {
32485
- case 0: return [4 /*yield*/, this.usersService.getDriversByTeam(teamId)];
32486
- case 1:
32487
- users = _a.sent();
32488
- users.forEach(function (user) { return _this.addToStore(user); });
32489
- return [2 /*return*/, users];
32490
- }
32491
- });
32492
- });
32493
- };
32494
- UsersStore.prototype.getAll = function (page, limit) {
32495
- if (page === void 0) { page = 1; }
32496
- if (limit === void 0) { limit = 50; }
32497
- return __awaiter(this, void 0, void 0, function () {
32498
- var response;
32499
- var _this = this;
32500
- return __generator(this, function (_a) {
32501
- switch (_a.label) {
32502
- case 0: return [4 /*yield*/, this.usersService.getAll(page, limit)];
32503
- case 1:
32504
- response = _a.sent();
32505
- (0, forEach_1.default)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });
32506
- return [2 /*return*/, response];
32507
- }
32508
- });
32509
- });
32510
- };
32511
- UsersStore.prototype.getAllKeysetPagination = function (request) {
32512
- return __awaiter(this, void 0, void 0, function () {
32513
- var response;
32514
- var _this = this;
32515
- return __generator(this, function (_a) {
32516
- switch (_a.label) {
32517
- case 0: return [4 /*yield*/, this.usersService.getAllKeysetPagination(request)];
32518
- case 1:
32519
- response = _a.sent();
32520
- (0, forEach_1.default)(response.users, function (user) { return (_this.getItem(user.id) ? _this.updateInStore(user) : _this.addToStore(user)); });
32521
- this.initGroups(this.getItems());
32522
- return [2 /*return*/, response];
32523
- }
32524
- });
32525
- });
32526
- };
32527
- UsersStore.prototype.invite = function (userId) {
32528
- return __awaiter(this, void 0, void 0, function () {
32529
- var user;
32530
- return __generator(this, function (_a) {
32531
- switch (_a.label) {
32532
- case 0: return [4 /*yield*/, this.usersService.invite(userId)];
32533
- case 1:
32534
- user = _a.sent();
32535
- this.updateInStore(user);
32536
- return [2 /*return*/, user];
32537
- }
32538
- });
32539
- });
32540
- };
32541
- UsersStore.prototype.inviteByEmail = function (userId) {
32542
- return __awaiter(this, void 0, void 0, function () {
32543
- var user;
32544
- return __generator(this, function (_a) {
32545
- switch (_a.label) {
32546
- case 0: return [4 /*yield*/, this.usersService.inviteByEmail(userId)];
32547
- case 1:
32548
- user = _a.sent();
32549
- this.updateInStore(user);
32550
- return [2 /*return*/, user];
32551
- }
32552
- });
32553
- });
32554
- };
32555
- UsersStore.prototype.getAllAdminsAndDispatchers = function (request) {
32556
- return __awaiter(this, void 0, void 0, function () {
32557
- var _this = this;
32558
- return __generator(this, function (_a) {
32559
- return [2 /*return*/, this.getOrFetchUsers(request, this.fetchedStatus.adminsAndDispatchers, function (isAllAdminsAndDispatchersFetched) {
32560
- return (_this.fetchedStatus.adminsAndDispatchers = isAllAdminsAndDispatchersFetched);
32561
- }, function () {
32562
- var _a;
32563
- var args = [];
32564
- for (var _i = 0; _i < arguments.length; _i++) {
32565
- args[_i] = arguments[_i];
32566
- }
32567
- return (_a = _this.usersService).getAllAdminsAndDispatchers.apply(_a, __spreadArray([], __read(args), false));
32568
- }, function () { return _this.getAllLocalAdminsAndDispatchers(); })];
32569
- });
32570
- });
32571
- };
32572
- UsersStore.prototype.getAllDrivers = function (request) {
32573
- return __awaiter(this, void 0, void 0, function () {
32574
- var options, response, isOnlyCustomer, isOnlyOnlineDrivers, groups;
32575
- var _this = this;
32576
- return __generator(this, function (_a) {
32577
- switch (_a.label) {
32578
- case 0:
32579
- options = request.options;
32580
- isOnlyCustomer = options === null || options === void 0 ? void 0 : options.onlyCustomers;
32581
- isOnlyOnlineDrivers = options === null || options === void 0 ? void 0 : options.onlyOnlineDriver;
32582
- if (!isOnlyCustomer) return [3 /*break*/, 2];
32583
- return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.customers, function (isAllCustomersFetched) { return (_this.fetchedStatus.customers = isAllCustomersFetched); }, this.usersService.getAllDrivers, function () { return _this.getCustomers(); })];
32584
- case 1:
32585
- response = _a.sent();
32586
- return [3 /*break*/, 4];
32587
- case 2: return [4 /*yield*/, this.getOrFetchUsers(request, this.fetchedStatus.drivers, function (isAllDriversFetched) { return (_this.fetchedStatus.drivers = isAllDriversFetched); }, function () {
32588
- var _a;
32589
- var args = [];
32590
- for (var _i = 0; _i < arguments.length; _i++) {
32591
- args[_i] = arguments[_i];
32592
- }
32593
- return (_a = _this.usersService).getAllDrivers.apply(_a, __spreadArray([], __read(args), false));
32594
- }, function () { return (isOnlyOnlineDrivers ? __spreadArray([], __read(_this.getOnlineDrivers()), false) : __spreadArray([], __read(_this.getAllLocalDrivers()), false)); })];
32595
- case 3:
32596
- response = _a.sent();
32597
- _a.label = 4;
32598
- case 4:
32599
- groups = isOnlyCustomer
32600
- ? [User_consts_1.GROUP_VALUES.Customers]
32601
- : isOnlyOnlineDrivers
32602
- ? [User_consts_1.GROUP_VALUES.OnlineDrivers]
32603
- : [User_consts_1.GROUP_VALUES.OfflineDrivers, User_consts_1.GROUP_VALUES.OnlineDrivers, User_consts_1.GROUP_VALUES.OnShiftDrivers];
32604
- this.initGroups(response.users, groups);
32605
- return [2 /*return*/, response];
32606
- }
32607
- });
32608
- });
32609
- };
32610
- UsersStore.prototype.getOrFetchUsers = function (request, isFetchedFlag, setIsFetchedFlag, fetchUsers, getLocalUsers) {
32611
- return __awaiter(this, void 0, void 0, function () {
32612
- var response;
32613
- var _this = this;
32614
- return __generator(this, function (_a) {
32615
- switch (_a.label) {
32616
- case 0:
32617
- if (!!isFetchedFlag) return [3 /*break*/, 2];
32618
- return [4 /*yield*/, fetchUsers(request)];
32619
- case 1:
32620
- response = _a.sent();
32621
- response.users.forEach(function (driver) { return _this.addToStore(driver); });
32622
- if (!response.next_page_cursor && !response.previous_page_cursor) {
32623
- setIsFetchedFlag(true);
32624
- }
32625
- return [2 /*return*/, response];
32626
- case 2: return [2 /*return*/, {
32627
- next_page_cursor: null,
32628
- previous_page_cursor: null,
32629
- users: getLocalUsers()
32630
- }];
32631
- }
32632
- });
32633
- });
32634
- };
32635
- UsersStore.prototype.byUserType = function (userTypeId) {
32636
- return __awaiter(this, void 0, void 0, function () {
32637
- var users;
32638
- var _this = this;
32639
- return __generator(this, function (_a) {
32640
- switch (_a.label) {
32641
- case 0: return [4 /*yield*/, this.usersService.byUserType(userTypeId)];
32642
- case 1:
32643
- users = _a.sent();
32644
- users.forEach(function (user) { return _this.addToStore(user); });
32645
- return [2 /*return*/, users];
32646
- }
32647
- });
32648
- });
32649
- };
32650
- UsersStore.prototype.makeAdmin = function (userId) {
32651
- return __awaiter(this, void 0, void 0, function () {
32652
- var user;
32653
- return __generator(this, function (_a) {
32654
- switch (_a.label) {
32655
- case 0: return [4 /*yield*/, this.usersService.makeAdmin(userId)];
32656
- case 1:
32657
- user = _a.sent();
32658
- this.updateInStore(user);
32659
- return [2 /*return*/, user];
32660
- }
32661
- });
32662
- });
32663
- };
32664
- UsersStore.prototype.update = function (userId, userDelta) {
32665
- return __awaiter(this, void 0, void 0, function () {
32666
- var user;
32667
- return __generator(this, function (_a) {
32668
- switch (_a.label) {
32669
- case 0: return [4 /*yield*/, this.usersService.update(userId, userDelta)];
32670
- case 1:
32671
- user = _a.sent();
32672
- this.updateInStore(user);
32673
- return [2 /*return*/, user];
32674
- }
32675
- });
32676
- });
32677
- };
32678
- UsersStore.prototype.delete = function (userId) {
32679
- return __awaiter(this, void 0, void 0, function () {
32680
- var success;
32681
- return __generator(this, function (_a) {
32682
- switch (_a.label) {
32683
- case 0: return [4 /*yield*/, this.usersService.delete(userId)];
32684
- case 1:
32685
- success = _a.sent();
32686
- if (success) {
32687
- this.removeFromStore(userId);
32688
- }
32689
- return [2 /*return*/, success];
32690
- }
32691
- });
32692
- });
32693
- };
32694
- UsersStore.prototype.get = function (id) {
32695
- return __awaiter(this, void 0, void 0, function () {
32696
- var _a;
32697
- return __generator(this, function (_b) {
32698
- switch (_b.label) {
32699
- case 0:
32700
- _a = this.getItem(id);
32701
- if (_a) return [3 /*break*/, 2];
32702
- return [4 /*yield*/, this.usersService.get(id)];
32703
- case 1:
32704
- _a = (_b.sent());
32705
- _b.label = 2;
32706
- case 2: return [2 /*return*/, _a];
32707
- }
32708
- });
32709
- });
32710
- };
32711
- UsersStore.prototype.getMany = function (ids, commonOptions) {
32712
- return __awaiter(this, void 0, void 0, function () {
32713
- var idsSet, uniqIds, foundItems, missingIds, missingUsers, missingIdsChunks, concurrentChunks, concurrentChunks_1, concurrentChunks_1_1, concurrentChunk, promises, rejectReason, results, results_1, results_1_1, result, users, e_8_1;
32714
- var e_8, _a, e_9, _b;
32715
- var _this = this;
32716
- return __generator(this, function (_c) {
32717
- switch (_c.label) {
32718
- case 0:
32719
- idsSet = new Set(ids);
32720
- uniqIds = Array.from(idsSet);
32721
- foundItems = this.getItemsByIds(uniqIds);
32722
- if (foundItems.length === uniqIds.length) {
32723
- return [2 /*return*/, foundItems];
32724
- }
32725
- foundItems.forEach(function (user) { return idsSet.delete(user.id); });
32726
- missingIds = Array.from(idsSet);
32727
- missingUsers = [];
32728
- missingIdsChunks = (0, chunk_1.default)(missingIds, exports.DEFAULT_CHUNK_SIZE);
32729
- concurrentChunks = (0, chunk_1.default)(missingIdsChunks, exports.MAX_CONCURRENT_CHUNKED_REQUESTS);
32730
- _c.label = 1;
32731
- case 1:
32732
- _c.trys.push([1, 6, 7, 8]);
32733
- concurrentChunks_1 = __values(concurrentChunks), concurrentChunks_1_1 = concurrentChunks_1.next();
32734
- _c.label = 2;
32735
- case 2:
32736
- if (!!concurrentChunks_1_1.done) return [3 /*break*/, 5];
32737
- concurrentChunk = concurrentChunks_1_1.value;
32738
- promises = concurrentChunk.map(function (idsChunk) { return __awaiter(_this, void 0, void 0, function () {
32739
- var chunkResult;
32740
- return __generator(this, function (_a) {
32741
- switch (_a.label) {
32742
- case 0: return [4 /*yield*/, this.usersService.getMany({ usersIds: idsChunk }, commonOptions)];
32743
- case 1:
32744
- chunkResult = _a.sent();
32745
- return [2 /*return*/, chunkResult.users];
32746
- }
32747
- });
32748
- }); });
32749
- // Rate limit to one set of requests per MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS
32750
- if (concurrentChunk !== (0, last_1.default)(concurrentChunks)) {
32751
- promises.push(new Promise(function (resolve) { return setTimeout(function () { return resolve([]); }, MIN_INTERVAL_BETWEEN_CHUNKED_REQUESTS); }));
32752
- }
32753
- rejectReason = null;
32754
- return [4 /*yield*/, Promise.allSettled(promises)];
32755
- case 3:
32756
- results = _c.sent();
32757
- try {
32758
- for (results_1 = (e_9 = void 0, __values(results)), results_1_1 = results_1.next(); !results_1_1.done; results_1_1 = results_1.next()) {
32759
- result = results_1_1.value;
32760
- if (result.status === 'fulfilled') {
32761
- users = result.value;
32762
- missingUsers.push.apply(missingUsers, __spreadArray([], __read(users), false));
32763
- this.addItems(users);
32764
- }
32765
- else {
32766
- if (!rejectReason) {
32767
- rejectReason = result.reason;
32768
- }
32769
- }
32770
- }
32771
- }
32772
- catch (e_9_1) { e_9 = { error: e_9_1 }; }
32773
- finally {
32774
- try {
32775
- if (results_1_1 && !results_1_1.done && (_b = results_1.return)) _b.call(results_1);
32776
- }
32777
- finally { if (e_9) throw e_9.error; }
32778
- }
32779
- if (rejectReason) {
32780
- throw rejectReason;
32781
- }
32782
- _c.label = 4;
32783
- case 4:
32784
- concurrentChunks_1_1 = concurrentChunks_1.next();
32785
- return [3 /*break*/, 2];
32786
- case 5: return [3 /*break*/, 8];
32787
- case 6:
32788
- e_8_1 = _c.sent();
32789
- e_8 = { error: e_8_1 };
32790
- return [3 /*break*/, 8];
32791
- case 7:
32792
- try {
32793
- if (concurrentChunks_1_1 && !concurrentChunks_1_1.done && (_a = concurrentChunks_1.return)) _a.call(concurrentChunks_1);
32794
- }
32795
- finally { if (e_8) throw e_8.error; }
32796
- return [7 /*endfinally*/];
32797
- case 8: return [2 /*return*/, foundItems.concat(missingUsers)];
32798
- }
32799
- });
32800
- });
32801
- };
32802
- UsersStore.prototype.unlock = function (userId) {
32803
- return __awaiter(this, void 0, void 0, function () {
32804
- return __generator(this, function (_a) {
32805
- switch (_a.label) {
32806
- case 0: return [4 /*yield*/, this.usersService.unlock(userId)];
32807
- case 1: return [2 /*return*/, _a.sent()];
32808
- }
32809
- });
32810
- });
32811
- };
32812
- UsersStore.prototype.assignedTasksCount = function (userId) {
32813
- return __awaiter(this, void 0, void 0, function () {
32814
- return __generator(this, function (_a) {
32815
- switch (_a.label) {
32816
- case 0: return [4 /*yield*/, this.usersService.assignedTasksCount(userId)];
32817
- case 1: return [2 /*return*/, _a.sent()];
32818
- }
32819
- });
32820
- });
32821
- };
32822
- UsersStore.prototype.totalEmployeesCount = function () {
32823
- return __awaiter(this, void 0, void 0, function () {
32824
- return __generator(this, function (_a) {
32825
- switch (_a.label) {
32826
- case 0: return [4 /*yield*/, this.usersService.totalEmployeesCount()];
32827
- case 1: return [2 /*return*/, _a.sent()];
32828
- }
32829
- });
32830
- });
32831
- };
32832
- UsersStore.prototype.totalDriversCount = function () {
32833
- return __awaiter(this, void 0, void 0, function () {
32834
- return __generator(this, function (_a) {
32835
- switch (_a.label) {
32836
- case 0: return [4 /*yield*/, this.usersService.totalDriversCount()];
32837
- case 1: return [2 /*return*/, _a.sent()];
32838
- }
32839
- });
32840
- });
32841
- };
32842
- UsersStore.prototype.getProfileImage = function (userId) {
32843
- return __awaiter(this, void 0, void 0, function () {
32844
- return __generator(this, function (_a) {
32845
- switch (_a.label) {
32846
- case 0: return [4 /*yield*/, this.usersService.getProfileImage(userId)];
32847
- case 1: return [2 /*return*/, _a.sent()];
32848
- }
32849
- });
32850
- });
32851
- };
32852
- UsersStore.prototype.validatePhone = function (phone) {
32853
- return __awaiter(this, void 0, void 0, function () {
32854
- return __generator(this, function (_a) {
32855
- switch (_a.label) {
32856
- case 0: return [4 /*yield*/, this.usersService.validatePhone(phone)];
32857
- case 1: return [2 /*return*/, _a.sent()];
32858
- }
32859
- });
32860
- });
32861
- };
32862
- UsersStore.prototype.closedTasks = function (userId, page) {
32863
- return __awaiter(this, void 0, void 0, function () {
32864
- return __generator(this, function (_a) {
32865
- switch (_a.label) {
32866
- case 0: return [4 /*yield*/, this.usersService.closedTasks(userId, page)];
32867
- case 1: return [2 /*return*/, _a.sent()]; // in future - add this tasks to store :)
32868
- }
32869
- });
32870
- });
32871
- };
32872
- UsersStore.prototype.messageDriver = function (userId, message) {
32873
- return this.usersService.messageDriver(userId, message);
32874
- };
32875
- UsersStore.prototype.subscribeToGroupUpdates = function (fn) {
32876
- this.groupUpdateEvents.push(fn);
32877
- };
32878
- UsersStore.prototype.getOfflineDrivers = function () {
32879
- return this.groupedValues.get(User_consts_1.GROUP_VALUES.OfflineDrivers) || new Set();
32880
- };
32881
- UsersStore.prototype.getOnlineDrivers = function () {
32882
- return this.groupedValues.get(User_consts_1.GROUP_VALUES.OnlineDrivers) || new Set();
32883
- };
32884
- UsersStore.prototype.getOnShiftDrivers = function () {
32885
- return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.OnShiftDrivers) || []);
32886
- };
32887
- UsersStore.prototype.getCustomers = function () {
32888
- return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Customers) || []);
32889
- };
32890
- UsersStore.prototype.getAdmins = function () {
32891
- return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Admins) || []);
32892
- };
32893
- UsersStore.prototype.getDispatchers = function () {
32894
- return Array.from(this.groupedValues.get(User_consts_1.GROUP_VALUES.Dispatchers) || []);
32895
- };
32896
- UsersStore.prototype.emitGroupEvents = function () {
32897
- var _this = this;
32898
- this.groupUpdateEvents.forEach(function (fn) { return fn(_this.groupedValues); });
32899
- };
32900
- UsersStore.prototype.getAllLocalDrivers = function () {
32901
- return this.drivers;
32902
- };
32903
- UsersStore.prototype.getOnlineDriversCountByTeam = function (teamId) {
32904
- return this.onlineDriversCounterByTeam.get(teamId) || 0;
32905
- };
32906
- UsersStore.prototype.getAllLocalAdminsAndDispatchers = function () {
32907
- return __spreadArray([], __read(new Set(this.getAdmins().concat(this.getDispatchers()))), false);
32908
- };
32909
- return UsersStore;
32910
- }(BaseStore_1.default));
32911
- exports["default"] = UsersStore;
32912
- //# sourceMappingURL=UsersStore.js.map
32913
-
32914
- /***/ }),
32915
-
32916
- /***/ 38894:
32917
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
32918
-
32919
- "use strict";
32920
-
32921
- var __values = (this && this.__values) || function(o) {
32922
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
32923
- if (m) return m.call(o);
32924
- if (o && typeof o.length === "number") return {
32925
- next: function () {
32926
- if (o && i >= o.length) o = void 0;
32927
- return { value: o && o[i++], done: !o };
32928
- }
32929
- };
32930
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
32931
- };
32932
- Object.defineProperty(exports, "__esModule", ({ value: true }));
32933
- exports.RealtimeEvents = exports.userToGroupsMapper = exports.groupFilter = exports.GROUP_VALUES = exports.UserGroupTypes = exports.UserEvents = exports.ROUTES = exports.ENABLE_USER_GROUPS_CACHE_FEATURE_FLAG = exports.baseRoute = exports.successExtractor = exports.countExtractor = exports.usersExtractor = exports.userExtractor = exports.defaultExtractor = exports.UsersScopes = void 0;
32934
- var UserHelpers_1 = __webpack_require__(2450);
32935
- var UsersScopes;
32936
- (function (UsersScopes) {
32937
- UsersScopes["DRIVERS"] = "drivers";
32938
- UsersScopes["DISPATCHERS"] = "dispatchers";
32939
- UsersScopes["ADMINS"] = "admins";
32940
- UsersScopes["CUSTOMERS"] = "customers";
32941
- UsersScopes["MARKED_AS_ONLINE"] = "marked_as_online";
32942
- })(UsersScopes = exports.UsersScopes || (exports.UsersScopes = {}));
32943
- var defaultExtractor = function (response) { return response; };
32944
- exports.defaultExtractor = defaultExtractor;
32945
- var userExtractor = function (response) { return response.user; };
32946
- exports.userExtractor = userExtractor;
32947
- var usersExtractor = function (response) { return response.users; };
32948
- exports.usersExtractor = usersExtractor;
32949
- var countExtractor = function (response) { return response.count; };
32950
- exports.countExtractor = countExtractor;
32951
- var successExtractor = function (response) { return response.success; };
32952
- exports.successExtractor = successExtractor;
32953
- exports.baseRoute = '/users';
32954
- exports.ENABLE_USER_GROUPS_CACHE_FEATURE_FLAG = 'enable_user_groups_cache';
32955
- exports.ROUTES = {
32956
- GET_ALL: exports.baseRoute,
32957
- GET_DRIVERS_BY_TEAM: '/teams/{:teamId}/users',
32958
- UNLOCK: "".concat(exports.baseRoute, "/{:userId}/unlock"),
32959
- MESSAGE_DRIVER: '/announcement/user/{:userId}',
32960
- VALIDATE_PHONE: '/api/user/validate_phone',
32961
- DELETE_MANY: '/users/batch_delete',
32962
- DRIVER_COST: '/users/{:userId}/driver_cost',
32963
- GET_USERS_WITH_USER_TYPE: '/user_types/{:userTypeId}/users',
32964
- INVITE: '/users/{:userId}/reinvite',
32965
- INVITE_VIA_EMAIL: '/users/{:userId}/reinvite_via_email',
32966
- CLOSED_TASKS: '/users/{:userId}/tasks/closed_tasks',
32967
- TOTAL_TASKS: '/users/{:userId}/tasks/count',
32968
- GOT_HOME: "".concat(exports.baseRoute, "/{:userId}/got_home"),
32969
- LEFT_HOME: "".concat(exports.baseRoute, "/{:userId}/left_home"),
32970
- DRIVER_QR_TOKEN: '/tokens/gen_driver_qr_code'
32971
- };
32972
- var UserEvents;
32973
- (function (UserEvents) {
32974
- UserEvents["CURRENT_USER_UPDATED"] = "currentUserUpdated";
32975
- })(UserEvents = exports.UserEvents || (exports.UserEvents = {}));
32976
- var UserGroupTypes;
32977
- (function (UserGroupTypes) {
32978
- UserGroupTypes["Main"] = "main";
32979
- })(UserGroupTypes = exports.UserGroupTypes || (exports.UserGroupTypes = {}));
32980
- var GROUP_VALUES;
32981
- (function (GROUP_VALUES) {
32982
- GROUP_VALUES["OfflineDrivers"] = "OfflineDrivers";
32983
- GROUP_VALUES["OnlineDrivers"] = "OnlineDrivers";
32984
- GROUP_VALUES["OnShiftDrivers"] = "OnShiftDrivers";
32985
- GROUP_VALUES["Customers"] = "Customers";
32986
- GROUP_VALUES["Admins"] = "Admins";
32987
- GROUP_VALUES["Dispatchers"] = "Dispatchers";
32988
- GROUP_VALUES["Drivers"] = "Drivers";
32989
- })(GROUP_VALUES = exports.GROUP_VALUES || (exports.GROUP_VALUES = {}));
32990
- exports.groupFilter = new Map([
32991
- [GROUP_VALUES.OfflineDrivers, UserHelpers_1.UserHelpers.isOfflineDriver],
32992
- [GROUP_VALUES.OnlineDrivers, UserHelpers_1.UserHelpers.isOnlineDriver],
32993
- [GROUP_VALUES.OnShiftDrivers, UserHelpers_1.UserHelpers.isOnShiftDriver],
32994
- [GROUP_VALUES.Customers, UserHelpers_1.UserHelpers.isCustomer],
32995
- [GROUP_VALUES.Admins, UserHelpers_1.UserHelpers.isAdmin],
32996
- [GROUP_VALUES.Dispatchers, UserHelpers_1.UserHelpers.isDispatcher],
32997
- [GROUP_VALUES.Drivers, UserHelpers_1.UserHelpers.isDriver]
32998
- ]);
32999
- var groupKeys = Array.from(exports.groupFilter.keys());
33000
- var userToGroupsMapper = function (user) {
33001
- var e_1, _a;
33002
- var groups = [];
33003
- try {
33004
- for (var groupKeys_1 = __values(groupKeys), groupKeys_1_1 = groupKeys_1.next(); !groupKeys_1_1.done; groupKeys_1_1 = groupKeys_1.next()) {
33005
- var groupKey = groupKeys_1_1.value;
33006
- var filterFn = exports.groupFilter.get(groupKey);
33007
- if (filterFn(user) === true) {
33008
- groups.push(groupKey);
33009
- }
33010
- }
33011
- }
33012
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
33013
- finally {
33014
- try {
33015
- if (groupKeys_1_1 && !groupKeys_1_1.done && (_a = groupKeys_1.return)) _a.call(groupKeys_1);
33016
- }
33017
- finally { if (e_1) throw e_1.error; }
33018
- }
33019
- return groups;
33020
- };
33021
- exports.userToGroupsMapper = userToGroupsMapper;
33022
- var RealtimeEvents;
33023
- (function (RealtimeEvents) {
33024
- RealtimeEvents["Update"] = "employee update";
33025
- RealtimeEvents["Create"] = "new employee";
33026
- RealtimeEvents["Delete"] = "delete employee";
33027
- })(RealtimeEvents = exports.RealtimeEvents || (exports.RealtimeEvents = {}));
33028
- //# sourceMappingURL=User.consts.js.map
33029
-
33030
- /***/ }),
33031
-
33032
- /***/ 2450:
33033
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
33034
-
33035
- "use strict";
33036
-
33037
- Object.defineProperty(exports, "__esModule", ({ value: true }));
33038
- exports.UserHelpers = void 0;
33039
- var types_1 = __webpack_require__(63127);
33040
- var lodash_1 = __webpack_require__(96486);
33041
- var UserHelpers = /** @class */ (function () {
33042
- function UserHelpers() {
33043
- }
33044
- UserHelpers.isOfflineDriver = function (user) {
33045
- return user.driver === true && user.status === types_1.Connection.Offline;
33046
- };
33047
- UserHelpers.isOnlineDriver = function (user) {
33048
- return user.driver === true && user.status === types_1.Connection.Online;
33049
- };
33050
- UserHelpers.isOnShiftDriver = function (user) {
33051
- return user.driver === true && !(0, lodash_1.isNil)(user.active_shift_id);
33052
- };
33053
- UserHelpers.isCustomer = function (user) {
33054
- return user.customer === true;
33055
- };
33056
- UserHelpers.isAdmin = function (user) {
33057
- return user.admin === true;
33058
- };
33059
- UserHelpers.isDispatcher = function (user) {
33060
- return user.dispatcher === true;
33061
- };
33062
- UserHelpers.isDriver = function (user) {
33063
- return user.driver === true;
31415
+ UserHelpers.isDriver = function (user) {
31416
+ return user.driver === true;
33064
31417
  };
33065
31418
  return UserHelpers;
33066
31419
  }());
@@ -33069,323 +31422,6 @@ exports.UserHelpers = UserHelpers;
33069
31422
 
33070
31423
  /***/ }),
33071
31424
 
33072
- /***/ 32474:
33073
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
33074
-
33075
- "use strict";
33076
-
33077
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
33078
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33079
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33080
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
33081
- return c > 3 && r && Object.defineProperty(target, key, r), r;
33082
- };
33083
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
33084
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33085
- return new (P || (P = Promise))(function (resolve, reject) {
33086
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
33087
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33088
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33089
- step((generator = generator.apply(thisArg, _arguments || [])).next());
33090
- });
33091
- };
33092
- var __generator = (this && this.__generator) || function (thisArg, body) {
33093
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
33094
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33095
- function verb(n) { return function (v) { return step([n, v]); }; }
33096
- function step(op) {
33097
- if (f) throw new TypeError("Generator is already executing.");
33098
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33099
- 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;
33100
- if (y = 0, t) op = [op[0] & 2, t.value];
33101
- switch (op[0]) {
33102
- case 0: case 1: t = op; break;
33103
- case 4: _.label++; return { value: op[1], done: false };
33104
- case 5: _.label++; y = op[1]; op = [0]; continue;
33105
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
33106
- default:
33107
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
33108
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
33109
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
33110
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
33111
- if (t[2]) _.ops.pop();
33112
- _.trys.pop(); continue;
33113
- }
33114
- op = body.call(thisArg, _);
33115
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
33116
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
33117
- }
33118
- };
33119
- var __importDefault = (this && this.__importDefault) || function (mod) {
33120
- return (mod && mod.__esModule) ? mod : { "default": mod };
33121
- };
33122
- Object.defineProperty(exports, "__esModule", ({ value: true }));
33123
- var lodash_1 = __webpack_require__(96486);
33124
- var BringgException_1 = __webpack_require__(43605);
33125
- var ExceptionReason_1 = __webpack_require__(73532);
33126
- var keyset_pagination_consts_1 = __webpack_require__(92400);
33127
- var UsersStore_1 = __importDefault(__webpack_require__(68562));
33128
- var User_consts_1 = __webpack_require__(38894);
33129
- var Users = /** @class */ (function () {
33130
- function Users(session) {
33131
- this.usersStore = new UsersStore_1.default(session);
33132
- //keep previous names for backward compatibility
33133
- this.onListUpdate = this.usersStore.onListUpdate;
33134
- this.onUpdate = this.usersStore.onItemUpdate;
33135
- this.onDelete = this.usersStore.onItemRemoved;
33136
- this.onCreate = this.usersStore.onItemCreated;
33137
- this.unsubscribe = this.usersStore.unsubscribe;
33138
- }
33139
- Users.prototype.create = function (user) {
33140
- if ((0, lodash_1.isNil)(user.email) && (0, lodash_1.isNil)(user.phone)) {
33141
- throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.INVALID_ARGUMENTS, 'Phone or Email is required');
33142
- }
33143
- return this.usersStore.create(user);
33144
- };
33145
- Users.prototype.getAllAdminsAndDispatchers = function (_a) {
33146
- var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;
33147
- return this.usersStore.getAllAdminsAndDispatchers({ limit: limit, page_action: page_action, cursor: cursor });
33148
- };
33149
- Users.prototype.getAllDrivers = function (_a) {
33150
- var _b = _a.limit, limit = _b === void 0 ? 25 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor, options = _a.options;
33151
- var optionsWithDefaults = (0, lodash_1.defaults)(options, { onlyOnlineDriver: false, onlyCustomers: false });
33152
- return this.usersStore.getAllDrivers({ limit: limit, page_action: page_action, cursor: cursor, options: optionsWithDefaults });
33153
- };
33154
- Users.prototype.byUserType = function (userTypeId) {
33155
- return this.usersStore.byUserType(userTypeId);
33156
- };
33157
- Users.prototype.makeAdmin = function (userId) {
33158
- return this.usersStore.makeAdmin(userId);
33159
- };
33160
- Users.prototype.totalEmployeesCount = function () {
33161
- return this.usersStore.totalEmployeesCount();
33162
- };
33163
- Users.prototype.totalDriversCount = function () {
33164
- return this.usersStore.totalDriversCount();
33165
- };
33166
- Users.prototype.getAdmin = function (adminId) {
33167
- return this.usersStore.get(adminId);
33168
- };
33169
- Users.prototype.getDriver = function (driverId) {
33170
- return this.usersStore.get(driverId);
33171
- };
33172
- Users.prototype.getDispatcher = function (dispatcherId) {
33173
- return this.usersStore.get(dispatcherId);
33174
- };
33175
- Users.prototype.getDriversByTeam = function (teamId) {
33176
- return this.usersStore.getDriversByTeam(teamId);
33177
- };
33178
- Users.prototype.getAll = function (page, limit) {
33179
- if (page === void 0) { page = 1; }
33180
- if (limit === void 0) { limit = 50; }
33181
- return __awaiter(this, void 0, void 0, function () {
33182
- return __generator(this, function (_a) {
33183
- switch (_a.label) {
33184
- case 0: return [4 /*yield*/, this.usersStore.getAll(page, limit)];
33185
- case 1: return [2 /*return*/, _a.sent()];
33186
- }
33187
- });
33188
- });
33189
- };
33190
- Users.prototype.getAllKeysetPagination = function (_a) {
33191
- var _b = _a.limit, limit = _b === void 0 ? 2500 : _b, _c = _a.page_action, page_action = _c === void 0 ? keyset_pagination_consts_1.KeysetPaginationPageAction.NEXT : _c, cursor = _a.cursor;
33192
- return this.usersStore.getAllKeysetPagination({ limit: limit, page_action: page_action, cursor: cursor });
33193
- };
33194
- Users.prototype.get = function (userId) {
33195
- return __awaiter(this, void 0, void 0, function () {
33196
- var user;
33197
- return __generator(this, function (_a) {
33198
- switch (_a.label) {
33199
- case 0: return [4 /*yield*/, this.usersStore.get(userId)];
33200
- case 1:
33201
- user = _a.sent();
33202
- this.usersStore.addToStore(user);
33203
- return [2 /*return*/, user];
33204
- }
33205
- });
33206
- });
33207
- };
33208
- Users.prototype.getMany = function (usersIds, commonOptions) {
33209
- return this.usersStore.getMany(usersIds, commonOptions);
33210
- };
33211
- Users.prototype.getLocal = function (userId) {
33212
- return this.usersStore.getItem(userId);
33213
- };
33214
- Users.prototype.invite = function (userId) {
33215
- return this.usersStore.invite(userId);
33216
- };
33217
- Users.prototype.unlock = function (userId) {
33218
- return this.usersStore.unlock(userId);
33219
- };
33220
- Users.prototype.assignedTasksCount = function (userId) {
33221
- return this.usersStore.assignedTasksCount(userId);
33222
- };
33223
- Users.prototype.inviteByEmail = function (userId) {
33224
- return this.usersStore.inviteByEmail(userId);
33225
- };
33226
- Users.prototype.validatePhone = function (phone) {
33227
- return this.usersStore.validatePhone(phone);
33228
- };
33229
- Users.prototype.closedTasks = function (userId, page) {
33230
- return this.usersStore.closedTasks(userId, page);
33231
- };
33232
- Users.prototype.update = function (userId, userDelta) {
33233
- var _this = this;
33234
- return this.usersStore.update(userId, userDelta).then(function (user) { return _this.updateCurrentUserIfNeeded(user); });
33235
- };
33236
- Users.prototype.updateCurrentUserIfNeeded = function (user) {
33237
- var currentUser = this.usersStore.usersService.session.user;
33238
- if (currentUser.id === user.id) {
33239
- this.usersStore.usersService.session.user = (0, lodash_1.merge)(currentUser, user);
33240
- this.usersStore.usersService.session.sendDataEvent(User_consts_1.UserEvents.CURRENT_USER_UPDATED, this.usersStore.usersService.session.user);
33241
- }
33242
- return user;
33243
- };
33244
- Users.prototype.delete = function (userId) {
33245
- return this.usersStore.delete(userId);
33246
- };
33247
- Users.prototype.getProfileImage = function (userId) {
33248
- return this.usersStore.getProfileImage(userId);
33249
- };
33250
- Users.prototype.subscribeToGroupUpdates = function (fn) {
33251
- this.usersStore.subscribeToGroupUpdates(fn);
33252
- };
33253
- Users.prototype.getOfflineDrivers = function () {
33254
- return this.usersStore.getOfflineDrivers();
33255
- };
33256
- Users.prototype.getOnlineDrivers = function () {
33257
- return this.usersStore.getOnlineDrivers();
33258
- };
33259
- Users.prototype.getAllLocalDrivers = function () {
33260
- return this.usersStore.getAllLocalDrivers();
33261
- };
33262
- Users.prototype.getOnShiftDrivers = function () {
33263
- return this.usersStore.getOnShiftDrivers();
33264
- };
33265
- Users.prototype.getAdmins = function () {
33266
- return this.usersStore.getAdmins();
33267
- };
33268
- Users.prototype.getDispatchers = function () {
33269
- return this.usersStore.getDispatchers();
33270
- };
33271
- Users.prototype.messageDriver = function (userId, message) {
33272
- return this.usersStore.messageDriver(userId, message);
33273
- };
33274
- Users.prototype.getDriverCost = function (userId) {
33275
- return this.usersStore.usersService.getDriverCost(userId);
33276
- };
33277
- Users.prototype.generateResetPasswordToken = function (email) {
33278
- return this.usersStore.usersService.generateResetPasswordToken(email);
33279
- };
33280
- __decorate([
33281
- BringgException_1.logOnException
33282
- ], Users.prototype, "create", null);
33283
- __decorate([
33284
- BringgException_1.logOnException
33285
- ], Users.prototype, "getAllAdminsAndDispatchers", null);
33286
- __decorate([
33287
- BringgException_1.logOnException
33288
- ], Users.prototype, "getAllDrivers", null);
33289
- __decorate([
33290
- BringgException_1.logOnException
33291
- ], Users.prototype, "byUserType", null);
33292
- __decorate([
33293
- BringgException_1.logOnException
33294
- ], Users.prototype, "makeAdmin", null);
33295
- __decorate([
33296
- BringgException_1.logOnException
33297
- ], Users.prototype, "totalEmployeesCount", null);
33298
- __decorate([
33299
- BringgException_1.logOnException
33300
- ], Users.prototype, "totalDriversCount", null);
33301
- __decorate([
33302
- BringgException_1.logOnException
33303
- ], Users.prototype, "getAdmin", null);
33304
- __decorate([
33305
- BringgException_1.logOnException
33306
- ], Users.prototype, "getDriver", null);
33307
- __decorate([
33308
- BringgException_1.logOnException
33309
- ], Users.prototype, "getDispatcher", null);
33310
- __decorate([
33311
- BringgException_1.logOnException
33312
- ], Users.prototype, "getDriversByTeam", null);
33313
- __decorate([
33314
- BringgException_1.logOnException
33315
- ], Users.prototype, "getAll", null);
33316
- __decorate([
33317
- BringgException_1.logOnException
33318
- ], Users.prototype, "getAllKeysetPagination", null);
33319
- __decorate([
33320
- BringgException_1.logOnException
33321
- ], Users.prototype, "get", null);
33322
- __decorate([
33323
- BringgException_1.logOnException
33324
- ], Users.prototype, "getMany", null);
33325
- __decorate([
33326
- BringgException_1.logOnException
33327
- ], Users.prototype, "invite", null);
33328
- __decorate([
33329
- BringgException_1.logOnException
33330
- ], Users.prototype, "unlock", null);
33331
- __decorate([
33332
- BringgException_1.logOnException
33333
- ], Users.prototype, "assignedTasksCount", null);
33334
- __decorate([
33335
- BringgException_1.logOnException
33336
- ], Users.prototype, "inviteByEmail", null);
33337
- __decorate([
33338
- BringgException_1.logOnException
33339
- ], Users.prototype, "validatePhone", null);
33340
- __decorate([
33341
- BringgException_1.logOnException
33342
- ], Users.prototype, "closedTasks", null);
33343
- __decorate([
33344
- BringgException_1.logOnException
33345
- ], Users.prototype, "update", null);
33346
- __decorate([
33347
- BringgException_1.logOnException
33348
- ], Users.prototype, "delete", null);
33349
- __decorate([
33350
- BringgException_1.logOnException
33351
- ], Users.prototype, "getProfileImage", null);
33352
- __decorate([
33353
- BringgException_1.logOnException
33354
- ], Users.prototype, "subscribeToGroupUpdates", null);
33355
- __decorate([
33356
- BringgException_1.logOnException
33357
- ], Users.prototype, "getOfflineDrivers", null);
33358
- __decorate([
33359
- BringgException_1.logOnException
33360
- ], Users.prototype, "getOnlineDrivers", null);
33361
- __decorate([
33362
- BringgException_1.logOnException
33363
- ], Users.prototype, "getAllLocalDrivers", null);
33364
- __decorate([
33365
- BringgException_1.logOnException
33366
- ], Users.prototype, "getOnShiftDrivers", null);
33367
- __decorate([
33368
- BringgException_1.logOnException
33369
- ], Users.prototype, "getAdmins", null);
33370
- __decorate([
33371
- BringgException_1.logOnException
33372
- ], Users.prototype, "getDispatchers", null);
33373
- __decorate([
33374
- BringgException_1.logOnException
33375
- ], Users.prototype, "messageDriver", null);
33376
- __decorate([
33377
- BringgException_1.logOnException
33378
- ], Users.prototype, "getDriverCost", null);
33379
- __decorate([
33380
- BringgException_1.logOnException
33381
- ], Users.prototype, "generateResetPasswordToken", null);
33382
- return Users;
33383
- }());
33384
- exports["default"] = Users;
33385
- //# sourceMappingURL=Users.js.map
33386
-
33387
- /***/ }),
33388
-
33389
31425
  /***/ 89549:
33390
31426
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
33391
31427
 
@@ -37389,14 +35425,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37389
35425
  return (mod && mod.__esModule) ? mod : { "default": mod };
37390
35426
  };
37391
35427
  Object.defineProperty(exports, "__esModule", ({ value: true }));
37392
- exports.WorkflowsApi = exports.VehicleTypeConsts = exports.VehicleCategoryConsts = exports.VehicleGroup = exports.VehiclesApi = exports.AbortUtils = exports.UsersApi = exports.UserGroupValues = exports.UserGroupTypes = exports.UploadApi = exports.UploadConsts = exports.TasksExplorerApi = exports.TaskRejectReasonsApi = exports.TaskInventoryConsts = exports.TasksApi = exports.TaskGroupValues = exports.TaskGroupTypes = exports.TagConsts = exports.ServiceAreaApi = exports.ServiceAreaFilterGroups = exports.ServicesSetupConsts = exports.RunsApi = exports.RunStatus = exports.RunConsts = exports.ResourceUploadType = exports.ReasonToChangeInventory = exports.PrivilegesConsts = exports.PlannedRoutesConsts = exports.PlannedDeliveryWindowsApi = exports.RecurrenceType = exports.PlannedDeliveryWindowsFilterGroups = exports.OptimizationResultApi = exports.NotificationTypesConsts = exports.NotificationTemplateConsts = exports.LookupConsts = exports.LanguageConsts = exports.ExclusionWindowApiV2 = exports.ExclusionWindowsFilterGroups = exports.DeliveryWindowsApi = exports.DeliveryBlockConsts = exports.CrewConsts = exports.Responses = exports.clientPageFromLocation = exports.CLIENT_PAGE_HEADER = exports.CheckinDistanceReasonsApi = exports.ChatMessageConsts = exports.ChatConversationConsts = void 0;
35428
+ exports.WorkflowsApi = exports.VehicleTypeConsts = exports.VehicleCategoryConsts = exports.VehicleGroup = exports.VehiclesApi = exports.AbortUtils = exports.UsersApi = exports.UserGroupValues = exports.UserGroupTypes = exports.UploadApi = exports.UploadConsts = exports.TasksExplorerApi = exports.TaskRejectReasonsApi = exports.TaskInventoryConsts = exports.TasksApi = exports.TaskGroupValues = exports.TaskGroupTypes = exports.TagConsts = exports.ServiceAreaApi = exports.ServiceAreaFilterGroups = exports.ServicesSetupConsts = exports.RunsApi = exports.RunStatus = exports.RunConsts = exports.ResourceUploadType = exports.ReasonToChangeInventory = exports.PrivilegesConsts = exports.PlannedRoutesConsts = exports.PlannedDeliveryWindowsApi = exports.RecurrenceType = exports.PlannedDeliveryWindowsFilterGroups = exports.OptimizationResultApi = exports.NotificationTypesConsts = exports.NotificationTemplateConsts = exports.LookupConsts = exports.LanguageConsts = exports.ExclusionWindowApiV2 = exports.ExclusionWindowsFilterGroups = exports.DeliveryWindowsApi = exports.DeliveryBlockConsts = exports.CrewConsts = exports.Responses = exports.clientPageFromLocation = exports.CLIENT_PAGE_HEADER = exports.ChatMessageConsts = exports.ChatConversationConsts = void 0;
37393
35429
  __exportStar(__webpack_require__(82661), exports);
37394
35430
  __exportStar(__webpack_require__(37360), exports);
37395
35431
  __exportStar(__webpack_require__(5655), exports);
37396
35432
  exports.ChatConversationConsts = __importStar(__webpack_require__(44448));
37397
35433
  exports.ChatMessageConsts = __importStar(__webpack_require__(39634));
37398
- var checkin_distance_reasons_api_1 = __webpack_require__(16754);
37399
- Object.defineProperty(exports, "CheckinDistanceReasonsApi", ({ enumerable: true, get: function () { return __importDefault(checkin_distance_reasons_api_1).default; } }));
37400
35434
  var client_page_1 = __webpack_require__(16573);
37401
35435
  Object.defineProperty(exports, "CLIENT_PAGE_HEADER", ({ enumerable: true, get: function () { return client_page_1.CLIENT_PAGE_HEADER; } }));
37402
35436
  Object.defineProperty(exports, "clientPageFromLocation", ({ enumerable: true, get: function () { return client_page_1.clientPageFromLocation; } }));
@@ -40420,8 +38454,6 @@ __exportStar(__webpack_require__(1555), exports);
40420
38454
  __exportStar(__webpack_require__(68734), exports);
40421
38455
  __exportStar(__webpack_require__(37443), exports);
40422
38456
  __exportStar(__webpack_require__(51837), exports);
40423
- __exportStar(__webpack_require__(34268), exports);
40424
- __exportStar(__webpack_require__(4593), exports);
40425
38457
  __exportStar(__webpack_require__(55936), exports);
40426
38458
  __exportStar(__webpack_require__(58466), exports);
40427
38459
  __exportStar(__webpack_require__(14570), exports);
@@ -40827,7 +38859,6 @@ var ALERT_TYPES;
40827
38859
  ALERT_TYPES[ALERT_TYPES["MULTIPLE_CONFLICTING_WINDOWS"] = 53] = "MULTIPLE_CONFLICTING_WINDOWS";
40828
38860
  ALERT_TYPES[ALERT_TYPES["WINDOW_OUTSIDE_WORKING_HOURS"] = 54] = "WINDOW_OUTSIDE_WORKING_HOURS";
40829
38861
  ALERT_TYPES[ALERT_TYPES["DO_NOT_ROUTE"] = 55] = "DO_NOT_ROUTE";
40830
- ALERT_TYPES[ALERT_TYPES["NOTE_CHANGED_WINDOW_LOCKED"] = 56] = "NOTE_CHANGED_WINDOW_LOCKED";
40831
38862
  ALERT_TYPES[ALERT_TYPES["TMP_DAY_AND_ROSS_ORDER_TOTAL_WEIGHT_CHANGED"] = 100] = "TMP_DAY_AND_ROSS_ORDER_TOTAL_WEIGHT_CHANGED";
40832
38863
  ALERT_TYPES[ALERT_TYPES["TMP_DAY_AND_ROSS_INVENTORY_SIZE_CHANGED"] = 101] = "TMP_DAY_AND_ROSS_INVENTORY_SIZE_CHANGED";
40833
38864
  ALERT_TYPES[ALERT_TYPES["TMP_DAY_AND_ROSS_PICKUP_ORDER_TIME_WINDOW_CHANGED"] = 102] = "TMP_DAY_AND_ROSS_PICKUP_ORDER_TIME_WINDOW_CHANGED";
@@ -42368,77 +40399,6 @@ var ChatMessageOrigin;
42368
40399
 
42369
40400
  /***/ }),
42370
40401
 
42371
- /***/ 13345:
42372
- /***/ ((__unused_webpack_module, exports) => {
42373
-
42374
- "use strict";
42375
-
42376
- Object.defineProperty(exports, "__esModule", ({ value: true }));
42377
- //# sourceMappingURL=checkin_distance_reason.js.map
42378
-
42379
- /***/ }),
42380
-
42381
- /***/ 11908:
42382
- /***/ ((__unused_webpack_module, exports) => {
42383
-
42384
- "use strict";
42385
-
42386
- Object.defineProperty(exports, "__esModule", ({ value: true }));
42387
- //# sourceMappingURL=checkin_distance_reasons_api_types.js.map
42388
-
42389
- /***/ }),
42390
-
42391
- /***/ 4593:
42392
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
42393
-
42394
- "use strict";
42395
-
42396
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
42397
- if (k2 === undefined) k2 = k;
42398
- var desc = Object.getOwnPropertyDescriptor(m, k);
42399
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
42400
- desc = { enumerable: true, get: function() { return m[k]; } };
42401
- }
42402
- Object.defineProperty(o, k2, desc);
42403
- }) : (function(o, m, k, k2) {
42404
- if (k2 === undefined) k2 = k;
42405
- o[k2] = m[k];
42406
- }));
42407
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
42408
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
42409
- };
42410
- Object.defineProperty(exports, "__esModule", ({ value: true }));
42411
- __exportStar(__webpack_require__(13345), exports);
42412
- __exportStar(__webpack_require__(11908), exports);
42413
- //# sourceMappingURL=index.js.map
42414
-
42415
- /***/ }),
42416
-
42417
- /***/ 34268:
42418
- /***/ ((__unused_webpack_module, exports) => {
42419
-
42420
- "use strict";
42421
-
42422
- Object.defineProperty(exports, "__esModule", ({ value: true }));
42423
- exports.CheckinDistanceEnforcementWayPointType = exports.CheckinDistanceEnforcementMode = void 0;
42424
- var CheckinDistanceEnforcementMode;
42425
- (function (CheckinDistanceEnforcementMode) {
42426
- CheckinDistanceEnforcementMode["Warn"] = "warn";
42427
- CheckinDistanceEnforcementMode["WarnReason"] = "warn_reason";
42428
- CheckinDistanceEnforcementMode["Block"] = "block";
42429
- })(CheckinDistanceEnforcementMode || (exports.CheckinDistanceEnforcementMode = CheckinDistanceEnforcementMode = {}));
42430
- var CheckinDistanceEnforcementWayPointType;
42431
- (function (CheckinDistanceEnforcementWayPointType) {
42432
- CheckinDistanceEnforcementWayPointType[CheckinDistanceEnforcementWayPointType["All"] = 1] = "All";
42433
- CheckinDistanceEnforcementWayPointType[CheckinDistanceEnforcementWayPointType["First"] = 2] = "First";
42434
- CheckinDistanceEnforcementWayPointType[CheckinDistanceEnforcementWayPointType["Last"] = 3] = "Last";
42435
- CheckinDistanceEnforcementWayPointType[CheckinDistanceEnforcementWayPointType["Customer"] = 4] = "Customer";
42436
- CheckinDistanceEnforcementWayPointType[CheckinDistanceEnforcementWayPointType["Warehouse"] = 5] = "Warehouse";
42437
- })(CheckinDistanceEnforcementWayPointType || (exports.CheckinDistanceEnforcementWayPointType = CheckinDistanceEnforcementWayPointType = {}));
42438
- //# sourceMappingURL=checkin_distance_enforcement.js.map
42439
-
42440
- /***/ }),
42441
-
42442
40402
  /***/ 55936:
42443
40403
  /***/ ((__unused_webpack_module, exports) => {
42444
40404
 
@@ -44372,7 +42332,6 @@ var OptimizationRequestErrorCodes;
44372
42332
  OptimizationRequestErrorCodes[OptimizationRequestErrorCodes["TasksOutsideTimeWindow"] = 406] = "TasksOutsideTimeWindow";
44373
42333
  OptimizationRequestErrorCodes[OptimizationRequestErrorCodes["NoDriversProvided"] = 407] = "NoDriversProvided";
44374
42334
  OptimizationRequestErrorCodes[OptimizationRequestErrorCodes["NoResourcesProvided"] = 408] = "NoResourcesProvided";
44375
- OptimizationRequestErrorCodes[OptimizationRequestErrorCodes["NoUserTypesProvided"] = 409] = "NoUserTypesProvided";
44376
42335
  })(OptimizationRequestErrorCodes || (exports.OptimizationRequestErrorCodes = OptimizationRequestErrorCodes = {}));
44377
42336
  exports.OptimizationErrors = (_a = {},
44378
42337
  _a[OptimizationRequestErrorCodes.NoTasksFound] = {
@@ -44408,10 +42367,6 @@ exports.OptimizationErrors = (_a = {},
44408
42367
  message: 'No delivery block resource ids or drivers or vehicles provided',
44409
42368
  key: 'NO_RESOURCES_PROVIDED_ERROR'
44410
42369
  },
44411
- _a[OptimizationRequestErrorCodes.NoUserTypesProvided] = {
44412
- message: 'No user types provided',
44413
- key: 'NO_USER_TYPES_PROVIDED_ERROR'
44414
- },
44415
42370
  _a);
44416
42371
  var OptimizationItemType;
44417
42372
  (function (OptimizationItemType) {
@@ -44549,7 +42504,6 @@ var PresetViewSupportedView;
44549
42504
  PresetViewSupportedView[PresetViewSupportedView["DispatchRoutesMonitoring"] = 6] = "DispatchRoutesMonitoring";
44550
42505
  PresetViewSupportedView[PresetViewSupportedView["PlanningOrderExplorer"] = 7] = "PlanningOrderExplorer";
44551
42506
  PresetViewSupportedView[PresetViewSupportedView["PlanningRoutesMonitoring"] = 8] = "PlanningRoutesMonitoring";
44552
- PresetViewSupportedView[PresetViewSupportedView["Vehicles"] = 9] = "Vehicles";
44553
42507
  })(PresetViewSupportedView || (exports.PresetViewSupportedView = PresetViewSupportedView = {}));
44554
42508
  var PresetViewScope;
44555
42509
  (function (PresetViewScope) {
@@ -45229,7 +43183,6 @@ var UnassignedJobReason;
45229
43183
  UnassignedJobReason["no_driver_with_required_skills"] = "no_driver_with_required_skills";
45230
43184
  UnassignedJobReason["excluded_from_all_drivers"] = "no driver that can serve the job";
45231
43185
  UnassignedJobReason["driver_that_task_assign_to_not_found_in_optimization"] = "driver that task assigned to not found in optimization";
45232
- UnassignedJobReason["forced_driver_not_in_optimization"] = "forced driver not in optimization";
45233
43186
  UnassignedJobReason["active_task_not_assigned_to_driver"] = "active task not assigned to driver";
45234
43187
  UnassignedJobReason["illegal_coordinate"] = "illegal coordinate";
45235
43188
  UnassignedJobReason["task_assigned_to_driver_that_rejected_the_task"] = "task assigned to driver that rejected the task";
@@ -45260,7 +43213,6 @@ exports.UnassignedJobReasonForServer = {
45260
43213
  no_driver_with_required_skills: 'NO_DRIVER_WITH_REQUIRED_SKILLS',
45261
43214
  'no driver that can serve the job': 'EXCLUDED_FROM_ALL_DRIVERS',
45262
43215
  'driver that task assigned to not found in optimization': 'DRIVER_THAT_TASK_ASSIGN_TO_NOT_FOUND_IN_OPTIMIZATION',
45263
- 'forced driver not in optimization': 'FORCED_DRIVER_NOT_IN_OPTIMIZATION',
45264
43216
  'active task not assigned to driver': 'ACTIVE_TASK_NOT_ASSIGNED_TO_DRIVER',
45265
43217
  'illegal coordinate': 'ILLEGAL_COORDINATE',
45266
43218
  'task assigned to driver that rejected the task': 'TASK_ASSIGNED_TO_DRIVER_THAT_REJECTED_THE_TASK',
@@ -46928,17 +44880,6 @@ var FactType;
46928
44880
  var RuleRequestType;
46929
44881
  (function (RuleRequestType) {
46930
44882
  RuleRequestType["Evaluate"] = "rule:evaluate";
46931
- RuleRequestType["EvaluateByIds"] = "rule:evaluateByIds";
46932
- RuleRequestType["EvaluateByKeys"] = "rule:evaluateByKeys";
46933
- RuleRequestType["GetMany"] = "rule:getMany";
46934
- RuleRequestType["UnifiedCrud"] = "rule:unifiedCrud";
46935
- RuleRequestType["CreateMany"] = "rule:createMany";
46936
- RuleRequestType["UpdateMany"] = "rule:updateMany";
46937
- RuleRequestType["DeleteMany"] = "rule:deleteMany";
46938
- RuleRequestType["GetAttributeUsage"] = "rule:getAttributeUsage";
46939
- RuleRequestType["GetAttributesUsageMany"] = "rule:getAttributesUsageMany";
46940
- RuleRequestType["CustomAttributeCheckRecordUsage"] = "custom-attributes:check-record-usage";
46941
- RuleRequestType["SharedLocationTemplateCheckRecordUsage"] = "shared-location-template:check-record-usage";
46942
44883
  })(RuleRequestType || (exports.RuleRequestType = RuleRequestType = {}));
46943
44884
  var DisplayFact;
46944
44885
  (function (DisplayFact) {
@@ -52992,44 +50933,6 @@ var baseSetToString = !defineProperty ? identity : function(func, string) {
52992
50933
  module.exports = baseSetToString;
52993
50934
 
52994
50935
 
52995
- /***/ }),
52996
-
52997
- /***/ 14259:
52998
- /***/ ((module) => {
52999
-
53000
- /**
53001
- * The base implementation of `_.slice` without an iteratee call guard.
53002
- *
53003
- * @private
53004
- * @param {Array} array The array to slice.
53005
- * @param {number} [start=0] The start position.
53006
- * @param {number} [end=array.length] The end position.
53007
- * @returns {Array} Returns the slice of `array`.
53008
- */
53009
- function baseSlice(array, start, end) {
53010
- var index = -1,
53011
- length = array.length;
53012
-
53013
- if (start < 0) {
53014
- start = -start > length ? 0 : (length + start);
53015
- }
53016
- end = end > length ? length : end;
53017
- if (end < 0) {
53018
- end += length;
53019
- }
53020
- length = start > end ? 0 : ((end - start) >>> 0);
53021
- start >>>= 0;
53022
-
53023
- var result = Array(length);
53024
- while (++index < length) {
53025
- result[index] = array[index + start];
53026
- }
53027
- return result;
53028
- }
53029
-
53030
- module.exports = baseSlice;
53031
-
53032
-
53033
50936
  /***/ }),
53034
50937
 
53035
50938
  /***/ 22545:
@@ -53101,32 +51004,6 @@ function baseToString(value) {
53101
51004
  module.exports = baseToString;
53102
51005
 
53103
51006
 
53104
- /***/ }),
53105
-
53106
- /***/ 27561:
53107
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
53108
-
53109
- var trimmedEndIndex = __webpack_require__(67990);
53110
-
53111
- /** Used to match leading whitespace. */
53112
- var reTrimStart = /^\s+/;
53113
-
53114
- /**
53115
- * The base implementation of `_.trim`.
53116
- *
53117
- * @private
53118
- * @param {string} string The string to trim.
53119
- * @returns {string} Returns the trimmed string.
53120
- */
53121
- function baseTrim(string) {
53122
- return string
53123
- ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
53124
- : string;
53125
- }
53126
-
53127
- module.exports = baseTrim;
53128
-
53129
-
53130
51007
  /***/ }),
53131
51008
 
53132
51009
  /***/ 7518:
@@ -53194,27 +51071,6 @@ function cacheHas(cache, key) {
53194
51071
  module.exports = cacheHas;
53195
51072
 
53196
51073
 
53197
- /***/ }),
53198
-
53199
- /***/ 54290:
53200
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
53201
-
53202
- var identity = __webpack_require__(6557);
53203
-
53204
- /**
53205
- * Casts `value` to `identity` if it's not a function.
53206
- *
53207
- * @private
53208
- * @param {*} value The value to inspect.
53209
- * @returns {Function} Returns cast function.
53210
- */
53211
- function castFunction(value) {
53212
- return typeof value == 'function' ? value : identity;
53213
- }
53214
-
53215
- module.exports = castFunction;
53216
-
53217
-
53218
51074
  /***/ }),
53219
51075
 
53220
51076
  /***/ 71811:
@@ -55993,32 +53849,6 @@ function toSource(func) {
55993
53849
  module.exports = toSource;
55994
53850
 
55995
53851
 
55996
- /***/ }),
55997
-
55998
- /***/ 67990:
55999
- /***/ ((module) => {
56000
-
56001
- /** Used to match a single whitespace character. */
56002
- var reWhitespace = /\s/;
56003
-
56004
- /**
56005
- * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
56006
- * character of `string`.
56007
- *
56008
- * @private
56009
- * @param {string} string The string to inspect.
56010
- * @returns {number} Returns the index of the last non-whitespace character.
56011
- */
56012
- function trimmedEndIndex(string) {
56013
- var index = string.length;
56014
-
56015
- while (index-- && reWhitespace.test(string.charAt(index))) {}
56016
- return index;
56017
- }
56018
-
56019
- module.exports = trimmedEndIndex;
56020
-
56021
-
56022
53852
  /***/ }),
56023
53853
 
56024
53854
  /***/ 63706:
@@ -56105,63 +53935,6 @@ var attempt = baseRest(function(func, args) {
56105
53935
  module.exports = attempt;
56106
53936
 
56107
53937
 
56108
- /***/ }),
56109
-
56110
- /***/ 8400:
56111
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
56112
-
56113
- var baseSlice = __webpack_require__(14259),
56114
- isIterateeCall = __webpack_require__(16612),
56115
- toInteger = __webpack_require__(40554);
56116
-
56117
- /* Built-in method references for those with the same name as other `lodash` methods. */
56118
- var nativeCeil = Math.ceil,
56119
- nativeMax = Math.max;
56120
-
56121
- /**
56122
- * Creates an array of elements split into groups the length of `size`.
56123
- * If `array` can't be split evenly, the final chunk will be the remaining
56124
- * elements.
56125
- *
56126
- * @static
56127
- * @memberOf _
56128
- * @since 3.0.0
56129
- * @category Array
56130
- * @param {Array} array The array to process.
56131
- * @param {number} [size=1] The length of each chunk
56132
- * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
56133
- * @returns {Array} Returns the new array of chunks.
56134
- * @example
56135
- *
56136
- * _.chunk(['a', 'b', 'c', 'd'], 2);
56137
- * // => [['a', 'b'], ['c', 'd']]
56138
- *
56139
- * _.chunk(['a', 'b', 'c', 'd'], 3);
56140
- * // => [['a', 'b', 'c'], ['d']]
56141
- */
56142
- function chunk(array, size, guard) {
56143
- if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
56144
- size = 1;
56145
- } else {
56146
- size = nativeMax(toInteger(size), 0);
56147
- }
56148
- var length = array == null ? 0 : array.length;
56149
- if (!length || size < 1) {
56150
- return [];
56151
- }
56152
- var index = 0,
56153
- resIndex = 0,
56154
- result = Array(nativeCeil(length / size));
56155
-
56156
- while (index < length) {
56157
- result[resIndex++] = baseSlice(array, index, (index += size));
56158
- }
56159
- return result;
56160
- }
56161
-
56162
- module.exports = chunk;
56163
-
56164
-
56165
53938
  /***/ }),
56166
53939
 
56167
53940
  /***/ 50361:
@@ -56354,54 +54127,6 @@ function flatten(array) {
56354
54127
  module.exports = flatten;
56355
54128
 
56356
54129
 
56357
- /***/ }),
56358
-
56359
- /***/ 84486:
56360
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
56361
-
56362
- var arrayEach = __webpack_require__(77412),
56363
- baseEach = __webpack_require__(89881),
56364
- castFunction = __webpack_require__(54290),
56365
- isArray = __webpack_require__(1469);
56366
-
56367
- /**
56368
- * Iterates over elements of `collection` and invokes `iteratee` for each element.
56369
- * The iteratee is invoked with three arguments: (value, index|key, collection).
56370
- * Iteratee functions may exit iteration early by explicitly returning `false`.
56371
- *
56372
- * **Note:** As with other "Collections" methods, objects with a "length"
56373
- * property are iterated like arrays. To avoid this behavior use `_.forIn`
56374
- * or `_.forOwn` for object iteration.
56375
- *
56376
- * @static
56377
- * @memberOf _
56378
- * @since 0.1.0
56379
- * @alias each
56380
- * @category Collection
56381
- * @param {Array|Object} collection The collection to iterate over.
56382
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
56383
- * @returns {Array|Object} Returns `collection`.
56384
- * @see _.forEachRight
56385
- * @example
56386
- *
56387
- * _.forEach([1, 2], function(value) {
56388
- * console.log(value);
56389
- * });
56390
- * // => Logs `1` then `2`.
56391
- *
56392
- * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
56393
- * console.log(key);
56394
- * });
56395
- * // => Logs 'a' then 'b' (iteration order is not guaranteed).
56396
- */
56397
- function forEach(collection, iteratee) {
56398
- var func = isArray(collection) ? arrayEach : baseEach;
56399
- return func(collection, castFunction(iteratee));
56400
- }
56401
-
56402
- module.exports = forEach;
56403
-
56404
-
56405
54130
  /***/ }),
56406
54131
 
56407
54132
  /***/ 27361:
@@ -57291,33 +55016,6 @@ function keysIn(object) {
57291
55016
  module.exports = keysIn;
57292
55017
 
57293
55018
 
57294
- /***/ }),
57295
-
57296
- /***/ 10928:
57297
- /***/ ((module) => {
57298
-
57299
- /**
57300
- * Gets the last element of `array`.
57301
- *
57302
- * @static
57303
- * @memberOf _
57304
- * @since 0.1.0
57305
- * @category Array
57306
- * @param {Array} array The array to query.
57307
- * @returns {*} Returns the last element of `array`.
57308
- * @example
57309
- *
57310
- * _.last([1, 2, 3]);
57311
- * // => 3
57312
- */
57313
- function last(array) {
57314
- var length = array == null ? 0 : array.length;
57315
- return length ? array[length - 1] : undefined;
57316
- }
57317
-
57318
- module.exports = last;
57319
-
57320
-
57321
55019
  /***/ }),
57322
55020
 
57323
55021
  /***/ 96486:
@@ -75152,169 +72850,6 @@ var templateSettings = {
75152
72850
  module.exports = templateSettings;
75153
72851
 
75154
72852
 
75155
- /***/ }),
75156
-
75157
- /***/ 18601:
75158
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
75159
-
75160
- var toNumber = __webpack_require__(14841);
75161
-
75162
- /** Used as references for various `Number` constants. */
75163
- var INFINITY = 1 / 0,
75164
- MAX_INTEGER = 1.7976931348623157e+308;
75165
-
75166
- /**
75167
- * Converts `value` to a finite number.
75168
- *
75169
- * @static
75170
- * @memberOf _
75171
- * @since 4.12.0
75172
- * @category Lang
75173
- * @param {*} value The value to convert.
75174
- * @returns {number} Returns the converted number.
75175
- * @example
75176
- *
75177
- * _.toFinite(3.2);
75178
- * // => 3.2
75179
- *
75180
- * _.toFinite(Number.MIN_VALUE);
75181
- * // => 5e-324
75182
- *
75183
- * _.toFinite(Infinity);
75184
- * // => 1.7976931348623157e+308
75185
- *
75186
- * _.toFinite('3.2');
75187
- * // => 3.2
75188
- */
75189
- function toFinite(value) {
75190
- if (!value) {
75191
- return value === 0 ? value : 0;
75192
- }
75193
- value = toNumber(value);
75194
- if (value === INFINITY || value === -INFINITY) {
75195
- var sign = (value < 0 ? -1 : 1);
75196
- return sign * MAX_INTEGER;
75197
- }
75198
- return value === value ? value : 0;
75199
- }
75200
-
75201
- module.exports = toFinite;
75202
-
75203
-
75204
- /***/ }),
75205
-
75206
- /***/ 40554:
75207
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
75208
-
75209
- var toFinite = __webpack_require__(18601);
75210
-
75211
- /**
75212
- * Converts `value` to an integer.
75213
- *
75214
- * **Note:** This method is loosely based on
75215
- * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
75216
- *
75217
- * @static
75218
- * @memberOf _
75219
- * @since 4.0.0
75220
- * @category Lang
75221
- * @param {*} value The value to convert.
75222
- * @returns {number} Returns the converted integer.
75223
- * @example
75224
- *
75225
- * _.toInteger(3.2);
75226
- * // => 3
75227
- *
75228
- * _.toInteger(Number.MIN_VALUE);
75229
- * // => 0
75230
- *
75231
- * _.toInteger(Infinity);
75232
- * // => 1.7976931348623157e+308
75233
- *
75234
- * _.toInteger('3.2');
75235
- * // => 3
75236
- */
75237
- function toInteger(value) {
75238
- var result = toFinite(value),
75239
- remainder = result % 1;
75240
-
75241
- return result === result ? (remainder ? result - remainder : result) : 0;
75242
- }
75243
-
75244
- module.exports = toInteger;
75245
-
75246
-
75247
- /***/ }),
75248
-
75249
- /***/ 14841:
75250
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
75251
-
75252
- var baseTrim = __webpack_require__(27561),
75253
- isObject = __webpack_require__(13218),
75254
- isSymbol = __webpack_require__(33448);
75255
-
75256
- /** Used as references for various `Number` constants. */
75257
- var NAN = 0 / 0;
75258
-
75259
- /** Used to detect bad signed hexadecimal string values. */
75260
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
75261
-
75262
- /** Used to detect binary string values. */
75263
- var reIsBinary = /^0b[01]+$/i;
75264
-
75265
- /** Used to detect octal string values. */
75266
- var reIsOctal = /^0o[0-7]+$/i;
75267
-
75268
- /** Built-in method references without a dependency on `root`. */
75269
- var freeParseInt = parseInt;
75270
-
75271
- /**
75272
- * Converts `value` to a number.
75273
- *
75274
- * @static
75275
- * @memberOf _
75276
- * @since 4.0.0
75277
- * @category Lang
75278
- * @param {*} value The value to process.
75279
- * @returns {number} Returns the number.
75280
- * @example
75281
- *
75282
- * _.toNumber(3.2);
75283
- * // => 3.2
75284
- *
75285
- * _.toNumber(Number.MIN_VALUE);
75286
- * // => 5e-324
75287
- *
75288
- * _.toNumber(Infinity);
75289
- * // => Infinity
75290
- *
75291
- * _.toNumber('3.2');
75292
- * // => 3.2
75293
- */
75294
- function toNumber(value) {
75295
- if (typeof value == 'number') {
75296
- return value;
75297
- }
75298
- if (isSymbol(value)) {
75299
- return NAN;
75300
- }
75301
- if (isObject(value)) {
75302
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
75303
- value = isObject(other) ? (other + '') : other;
75304
- }
75305
- if (typeof value != 'string') {
75306
- return value === 0 ? value : +value;
75307
- }
75308
- value = baseTrim(value);
75309
- var isBinary = reIsBinary.test(value);
75310
- return (isBinary || reIsOctal.test(value))
75311
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
75312
- : (reIsBadHex.test(value) ? NAN : +value);
75313
- }
75314
-
75315
- module.exports = toNumber;
75316
-
75317
-
75318
72853
  /***/ }),
75319
72854
 
75320
72855
  /***/ 79833: