@bringg/dashboard-sdk 8.30.1-pre.3 → 9.1.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.
- package/dist/BringgDashboardSDK.d.ts +0 -2
- package/dist/BringgDashboardSDK.js +1 -3
- package/dist/BringgDashboardSDK.js.map +1 -1
- package/dist/Core/BaseStore.js +1 -1
- package/dist/Core/BaseStore.js.map +1 -1
- package/dist/Customer/v2/customers-api.d.ts +5 -4
- package/dist/Customer/v2/customers-api.js +12 -8
- package/dist/Customer/v2/customers-api.js.map +1 -1
- package/dist/Data/storable-realtime-subscriptions.d.ts +18 -0
- package/dist/Data/storable-realtime-subscriptions.js +147 -0
- package/dist/Data/storable-realtime-subscriptions.js.map +1 -0
- package/dist/Data/storable-types.d.ts +19 -0
- package/dist/Data/storable-types.js +3 -0
- package/dist/Data/storable-types.js.map +1 -0
- package/dist/RouteOptimization/RouteOptimization.consts.d.ts +5 -0
- package/dist/RouteOptimization/RouteOptimization.consts.js.map +1 -1
- package/dist/RouteOptimization/RouteOptimizationApi.d.ts +7 -4
- package/dist/RouteOptimization/RouteOptimizationApi.js +102 -37
- package/dist/RouteOptimization/RouteOptimizationApi.js.map +1 -1
- package/dist/Run/Service/runs.service.d.ts +5 -5
- package/dist/Run/Service/runs.service.js +28 -44
- package/dist/Run/Service/runs.service.js.map +1 -1
- package/dist/Run/Store/RunStore.js +0 -1
- package/dist/Run/Store/RunStore.js.map +1 -1
- package/dist/Run/runs.consts.d.ts +3 -0
- package/dist/Run/runs.consts.js +5 -1
- package/dist/Run/runs.consts.js.map +1 -1
- package/dist/Run/runs.d.ts +2 -2
- package/dist/Run/runs.js +2 -2
- package/dist/Run/runs.js.map +1 -1
- package/dist/Run/v2/run-realtime-subscriptions.d.ts +25 -0
- package/dist/Run/v2/run-realtime-subscriptions.js +155 -0
- package/dist/Run/v2/run-realtime-subscriptions.js.map +1 -0
- package/dist/Run/v2/runs-api.d.ts +28 -5
- package/dist/Run/v2/runs-api.js +180 -30
- package/dist/Run/v2/runs-api.js.map +1 -1
- package/dist/Services/Identity/Session.d.ts +2 -0
- package/dist/Services/Identity/Session.js.map +1 -1
- package/dist/Services/ServiceRequest.js +1 -1
- package/dist/Task/v2/task-realtime-subscriptions.d.ts +7 -13
- package/dist/Task/v2/task-realtime-subscriptions.js +61 -122
- package/dist/Task/v2/task-realtime-subscriptions.js.map +1 -1
- package/dist/Task/v2/tasks-api.d.ts +5 -5
- package/dist/UserPresetViews/user-preset-views-api.d.ts +1 -1
- package/dist/UserPresetViews/user-preset-views-api.js +4 -3
- package/dist/UserPresetViews/user-preset-views-api.js.map +1 -1
- package/dist/UserPresetViews/user-preset-views-service.d.ts +1 -1
- package/dist/UserPresetViews/user-preset-views-service.js +6 -2
- package/dist/UserPresetViews/user-preset-views-service.js.map +1 -1
- package/dist/Vehicle/v2/vehicles-api.d.ts +5 -7
- package/dist/Vehicle/v2/vehicles-api.js +11 -29
- package/dist/Vehicle/v2/vehicles-api.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +769 -396
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +38 -38
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/dist/data-entity.d.ts +1 -1
- package/dist/storable-data-service.d.ts +2 -2
- package/dist/storable-data-service.js +17 -6
- package/dist/storable-data-service.js.map +1 -1
- package/package.json +2 -2
- package/dist/SpeedFactor/Service/SpeedFactor.service.d.ts +0 -82
- package/dist/SpeedFactor/Service/SpeedFactor.service.js +0 -49
- package/dist/SpeedFactor/Service/SpeedFactor.service.js.map +0 -1
- package/dist/SpeedFactor/SpeedFactor.d.ts +0 -12
- package/dist/SpeedFactor/SpeedFactor.js +0 -32
- package/dist/SpeedFactor/SpeedFactor.js.map +0 -1
|
@@ -2673,7 +2673,6 @@ var Session_1 = __importDefault(__webpack_require__(44891));
|
|
|
2673
2673
|
var ShiftsApi_1 = __importDefault(__webpack_require__(10942));
|
|
2674
2674
|
var Signature_1 = __importDefault(__webpack_require__(59824));
|
|
2675
2675
|
var SkillsApi_1 = __importDefault(__webpack_require__(28855));
|
|
2676
|
-
var SpeedFactor_1 = __importDefault(__webpack_require__(89808));
|
|
2677
2676
|
var SupportTicketApi_1 = __importDefault(__webpack_require__(28002));
|
|
2678
2677
|
var Tag_1 = __importDefault(__webpack_require__(78847));
|
|
2679
2678
|
var TagCustomerConfiguration_1 = __importDefault(__webpack_require__(87798));
|
|
@@ -2742,7 +2741,6 @@ var BringgDashboardSDK = /** @class */ (function () {
|
|
|
2742
2741
|
this.runs = null;
|
|
2743
2742
|
this.rollouts = null;
|
|
2744
2743
|
this.skills = null;
|
|
2745
|
-
this.speedFactor = null;
|
|
2746
2744
|
this.taskConfigurations = null;
|
|
2747
2745
|
this.taskInventory = null;
|
|
2748
2746
|
this.inventory = null;
|
|
@@ -2756,6 +2754,7 @@ var BringgDashboardSDK = /** @class */ (function () {
|
|
|
2756
2754
|
this.vehicleTypes = null;
|
|
2757
2755
|
this.vehicles = null;
|
|
2758
2756
|
this.session = session;
|
|
2757
|
+
this.session.sdk = this;
|
|
2759
2758
|
}
|
|
2760
2759
|
BringgDashboardSDK.setConfigurations = function (apiEndpointURL, monitorEndpointURL, generalEnvApiEndpoint) {
|
|
2761
2760
|
configurationProvider.getApiEndpoint = function () { return apiEndpointURL; };
|
|
@@ -3014,7 +3013,6 @@ function init(session) {
|
|
|
3014
3013
|
bringg.service = new ServiceApi_1.default(session);
|
|
3015
3014
|
bringg.signatures = new Signature_1.default(session);
|
|
3016
3015
|
bringg.skills = new SkillsApi_1.default(session);
|
|
3017
|
-
bringg.speedFactor = new SpeedFactor_1.default(session);
|
|
3018
3016
|
bringg.tagCustomerConfigurations = new TagCustomerConfiguration_1.default(session);
|
|
3019
3017
|
bringg.tagMerchantConfigurations = new TagMerchantConfiguration_1.default(session);
|
|
3020
3018
|
bringg.tags = new Tag_1.default(session);
|
|
@@ -4094,7 +4092,7 @@ var BaseStore = /** @class */ (function () {
|
|
|
4094
4092
|
};
|
|
4095
4093
|
this.getItemsByIds = function (ids) {
|
|
4096
4094
|
var idsSet = new Set(ids);
|
|
4097
|
-
return _this.getItems().filter(function (
|
|
4095
|
+
return _this.getItems().filter(function (item) { return idsSet.has(item.id); });
|
|
4098
4096
|
};
|
|
4099
4097
|
this.getItemsMap = function () {
|
|
4100
4098
|
return _this._items;
|
|
@@ -6647,9 +6645,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6647
6645
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6648
6646
|
var _ = __webpack_require__(96486);
|
|
6649
6647
|
var merge_mapper_1 = __webpack_require__(59200);
|
|
6648
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
6650
6649
|
var data_entity_1 = __webpack_require__(91083);
|
|
6651
6650
|
var data_store_1 = __importDefault(__webpack_require__(73135));
|
|
6652
|
-
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
6653
6651
|
var storable_data_service_1 = __importDefault(__webpack_require__(45297));
|
|
6654
6652
|
var array_utils_1 = __webpack_require__(43052);
|
|
6655
6653
|
var Customer_consts_1 = __webpack_require__(85240);
|
|
@@ -6662,15 +6660,19 @@ var CustomersApi = /** @class */ (function () {
|
|
|
6662
6660
|
this.storableDataService = new storable_data_service_1.default(this.customersStore, function (customer) {
|
|
6663
6661
|
return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.customersStore, customer);
|
|
6664
6662
|
});
|
|
6665
|
-
this.
|
|
6666
|
-
this.
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6663
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.customersStore, this.storableDataService);
|
|
6664
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([
|
|
6665
|
+
{ name: Customer_consts_1.RealtimeEvents.Created, isDelete: false },
|
|
6666
|
+
{ name: Customer_consts_1.RealtimeEvents.Updated, isDelete: false },
|
|
6667
|
+
{
|
|
6668
|
+
name: Customer_consts_1.RealtimeEvents.Deleted,
|
|
6669
|
+
isDelete: true,
|
|
6670
|
+
itemExtractor: function (payload) { return ({ id: payload.customer_id }); }
|
|
6671
|
+
}
|
|
6672
|
+
]);
|
|
6671
6673
|
}
|
|
6672
6674
|
CustomersApi.prototype.onCreate = function (callback) {
|
|
6673
|
-
this.
|
|
6675
|
+
return this.storableRealtimeSubscriptions.onEvent(Customer_consts_1.RealtimeEvents.Created, function (item) { return callback(item.current); });
|
|
6674
6676
|
};
|
|
6675
6677
|
CustomersApi.prototype.add = function (customer) {
|
|
6676
6678
|
return this.storableDataService.updateInStores(customer);
|
|
@@ -7699,6 +7701,160 @@ exports.objectMerger = { deepMerge: deepMerge };
|
|
|
7699
7701
|
|
|
7700
7702
|
/***/ }),
|
|
7701
7703
|
|
|
7704
|
+
/***/ 1227:
|
|
7705
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
7706
|
+
|
|
7707
|
+
"use strict";
|
|
7708
|
+
|
|
7709
|
+
var __values = (this && this.__values) || function(o) {
|
|
7710
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
7711
|
+
if (m) return m.call(o);
|
|
7712
|
+
if (o && typeof o.length === "number") return {
|
|
7713
|
+
next: function () {
|
|
7714
|
+
if (o && i >= o.length) o = void 0;
|
|
7715
|
+
return { value: o && o[i++], done: !o };
|
|
7716
|
+
}
|
|
7717
|
+
};
|
|
7718
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
7719
|
+
};
|
|
7720
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7721
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7722
|
+
};
|
|
7723
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7724
|
+
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
7725
|
+
var object_merger_1 = __webpack_require__(7262);
|
|
7726
|
+
var StorableRealtimeSubscriptions = /** @class */ (function () {
|
|
7727
|
+
function StorableRealtimeSubscriptions(session, dataStore, storableDataService) {
|
|
7728
|
+
this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);
|
|
7729
|
+
this.dataStore = dataStore;
|
|
7730
|
+
this.storableDataService = storableDataService;
|
|
7731
|
+
this.eventCallbacks = {};
|
|
7732
|
+
}
|
|
7733
|
+
StorableRealtimeSubscriptions.prototype.updateStoreOnEvents = function (events, subEntityEvents) {
|
|
7734
|
+
var e_1, _a, e_2, _b;
|
|
7735
|
+
var _this = this;
|
|
7736
|
+
if (subEntityEvents === void 0) { subEntityEvents = []; }
|
|
7737
|
+
var _loop_1 = function (event_1) {
|
|
7738
|
+
this_1.realtimeSubscriptions.subscribe(event_1.name, function (item) {
|
|
7739
|
+
item = event_1.itemExtractor ? event_1.itemExtractor(item) : item;
|
|
7740
|
+
var data = event_1.extraDataFunc && event_1.extraDataFunc(item);
|
|
7741
|
+
if (data === null || data === void 0 ? void 0 : data.ignore) {
|
|
7742
|
+
return;
|
|
7743
|
+
}
|
|
7744
|
+
if (event_1.isDelete) {
|
|
7745
|
+
var deletedItem = _this.storableDataService.removeFromStores(item.id);
|
|
7746
|
+
_this.runEventCallbacks(event_1.name, { diff: deletedItem });
|
|
7747
|
+
}
|
|
7748
|
+
else {
|
|
7749
|
+
var mappedStorableItem = _this.storableDataService.updateInStores(item, undefined, undefined, data === null || data === void 0 ? void 0 : data.params);
|
|
7750
|
+
_this.runEventCallbacks(event_1.name, mappedStorableItem);
|
|
7751
|
+
}
|
|
7752
|
+
});
|
|
7753
|
+
};
|
|
7754
|
+
var this_1 = this;
|
|
7755
|
+
try {
|
|
7756
|
+
for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {
|
|
7757
|
+
var event_1 = events_1_1.value;
|
|
7758
|
+
_loop_1(event_1);
|
|
7759
|
+
}
|
|
7760
|
+
}
|
|
7761
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
7762
|
+
finally {
|
|
7763
|
+
try {
|
|
7764
|
+
if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
|
|
7765
|
+
}
|
|
7766
|
+
finally { if (e_1) throw e_1.error; }
|
|
7767
|
+
}
|
|
7768
|
+
var _loop_2 = function (subEntityEvent) {
|
|
7769
|
+
this_2.realtimeSubscriptions.subscribe(subEntityEvent.name, function (subEntity) {
|
|
7770
|
+
subEntityEvent.ignoreFields.forEach(function (field) { return delete subEntity[field]; });
|
|
7771
|
+
var eventChangeData = _this.changeSubEntity(subEntity, subEntityEvent.parentField, subEntityEvent.field, subEntityEvent.isDelete);
|
|
7772
|
+
if (eventChangeData.current) {
|
|
7773
|
+
_this.runEventCallbacks(subEntityEvent.eventToRaise, eventChangeData);
|
|
7774
|
+
}
|
|
7775
|
+
});
|
|
7776
|
+
};
|
|
7777
|
+
var this_2 = this;
|
|
7778
|
+
try {
|
|
7779
|
+
for (var subEntityEvents_1 = __values(subEntityEvents), subEntityEvents_1_1 = subEntityEvents_1.next(); !subEntityEvents_1_1.done; subEntityEvents_1_1 = subEntityEvents_1.next()) {
|
|
7780
|
+
var subEntityEvent = subEntityEvents_1_1.value;
|
|
7781
|
+
_loop_2(subEntityEvent);
|
|
7782
|
+
}
|
|
7783
|
+
}
|
|
7784
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
7785
|
+
finally {
|
|
7786
|
+
try {
|
|
7787
|
+
if (subEntityEvents_1_1 && !subEntityEvents_1_1.done && (_b = subEntityEvents_1.return)) _b.call(subEntityEvents_1);
|
|
7788
|
+
}
|
|
7789
|
+
finally { if (e_2) throw e_2.error; }
|
|
7790
|
+
}
|
|
7791
|
+
};
|
|
7792
|
+
StorableRealtimeSubscriptions.prototype.onAnyEvent = function (event, callback) {
|
|
7793
|
+
return this.realtimeSubscriptions.subscribe(event, callback);
|
|
7794
|
+
};
|
|
7795
|
+
StorableRealtimeSubscriptions.prototype.onEvent = function (event, callback) {
|
|
7796
|
+
var _this = this;
|
|
7797
|
+
if (!this.eventCallbacks[event]) {
|
|
7798
|
+
this.eventCallbacks[event] = [];
|
|
7799
|
+
}
|
|
7800
|
+
this.eventCallbacks[event].push(callback);
|
|
7801
|
+
return function () {
|
|
7802
|
+
var indexOfCallback = _this.eventCallbacks[event].indexOf(callback);
|
|
7803
|
+
_this.eventCallbacks[event].splice(indexOfCallback, 1);
|
|
7804
|
+
};
|
|
7805
|
+
};
|
|
7806
|
+
StorableRealtimeSubscriptions.prototype.runEventCallbacks = function (event, data) {
|
|
7807
|
+
(this.eventCallbacks[event] || []).forEach(function (callback) { return callback(data); });
|
|
7808
|
+
};
|
|
7809
|
+
StorableRealtimeSubscriptions.prototype.changeSubEntity = function (subEntity, parentField, containerField, isDelete) {
|
|
7810
|
+
var _a, _b, _c;
|
|
7811
|
+
var current = this.dataStore.get(subEntity[parentField]);
|
|
7812
|
+
var diff;
|
|
7813
|
+
if (current) {
|
|
7814
|
+
if (!current[containerField]) {
|
|
7815
|
+
current[containerField] = [];
|
|
7816
|
+
}
|
|
7817
|
+
var existingIndex = current[containerField].findIndex(function (taskSubEntity) { return taskSubEntity.id === subEntity.id; });
|
|
7818
|
+
if (existingIndex > -1) {
|
|
7819
|
+
if (isDelete) {
|
|
7820
|
+
diff = (_a = { id: current.id }, _a[containerField] = this.createArrayOfEmptyObjects(existingIndex), _a);
|
|
7821
|
+
for (var i = existingIndex + 1; i < current[containerField].length; i++) {
|
|
7822
|
+
diff[containerField].push(current[containerField][i]);
|
|
7823
|
+
}
|
|
7824
|
+
current[containerField].splice(existingIndex, 1);
|
|
7825
|
+
}
|
|
7826
|
+
else {
|
|
7827
|
+
var subEntityDiff = object_merger_1.objectMerger.deepMerge(current[containerField][existingIndex], subEntity);
|
|
7828
|
+
diff = (_b = {
|
|
7829
|
+
id: current.id
|
|
7830
|
+
},
|
|
7831
|
+
_b[containerField] = this.createArrayOfEmptyObjects(current[containerField].length),
|
|
7832
|
+
_b);
|
|
7833
|
+
diff[containerField][existingIndex] = subEntityDiff;
|
|
7834
|
+
}
|
|
7835
|
+
}
|
|
7836
|
+
else if (!isDelete) {
|
|
7837
|
+
diff = (_c = {
|
|
7838
|
+
id: current.id
|
|
7839
|
+
},
|
|
7840
|
+
_c[containerField] = this.createArrayOfEmptyObjects(current[containerField].length),
|
|
7841
|
+
_c);
|
|
7842
|
+
diff[containerField].push(subEntity);
|
|
7843
|
+
current[containerField].push(subEntity);
|
|
7844
|
+
}
|
|
7845
|
+
}
|
|
7846
|
+
return { current: current, diff: diff };
|
|
7847
|
+
};
|
|
7848
|
+
StorableRealtimeSubscriptions.prototype.createArrayOfEmptyObjects = function (length) {
|
|
7849
|
+
return Array.from({ length: length }, function () { return ({}); });
|
|
7850
|
+
};
|
|
7851
|
+
return StorableRealtimeSubscriptions;
|
|
7852
|
+
}());
|
|
7853
|
+
exports["default"] = StorableRealtimeSubscriptions;
|
|
7854
|
+
//# sourceMappingURL=storable-realtime-subscriptions.js.map
|
|
7855
|
+
|
|
7856
|
+
/***/ }),
|
|
7857
|
+
|
|
7702
7858
|
/***/ 27774:
|
|
7703
7859
|
/***/ ((__unused_webpack_module, exports) => {
|
|
7704
7860
|
|
|
@@ -17704,21 +17860,6 @@ var OptimizationEvents;
|
|
|
17704
17860
|
|
|
17705
17861
|
"use strict";
|
|
17706
17862
|
|
|
17707
|
-
var __extends = (this && this.__extends) || (function () {
|
|
17708
|
-
var extendStatics = function (d, b) {
|
|
17709
|
-
extendStatics = Object.setPrototypeOf ||
|
|
17710
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
17711
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
17712
|
-
return extendStatics(d, b);
|
|
17713
|
-
};
|
|
17714
|
-
return function (d, b) {
|
|
17715
|
-
if (typeof b !== "function" && b !== null)
|
|
17716
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17717
|
-
extendStatics(d, b);
|
|
17718
|
-
function __() { this.constructor = d; }
|
|
17719
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17720
|
-
};
|
|
17721
|
-
})();
|
|
17722
17863
|
var __assign = (this && this.__assign) || function () {
|
|
17723
17864
|
__assign = Object.assign || function(t) {
|
|
17724
17865
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -17730,30 +17871,78 @@ var __assign = (this && this.__assign) || function () {
|
|
|
17730
17871
|
};
|
|
17731
17872
|
return __assign.apply(this, arguments);
|
|
17732
17873
|
};
|
|
17874
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17875
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17876
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17877
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17878
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17879
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17880
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17881
|
+
});
|
|
17882
|
+
};
|
|
17883
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
17884
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17885
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17886
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17887
|
+
function step(op) {
|
|
17888
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17889
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17890
|
+
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;
|
|
17891
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
17892
|
+
switch (op[0]) {
|
|
17893
|
+
case 0: case 1: t = op; break;
|
|
17894
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
17895
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
17896
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
17897
|
+
default:
|
|
17898
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
17899
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
17900
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
17901
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
17902
|
+
if (t[2]) _.ops.pop();
|
|
17903
|
+
_.trys.pop(); continue;
|
|
17904
|
+
}
|
|
17905
|
+
op = body.call(thisArg, _);
|
|
17906
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
17907
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
17908
|
+
}
|
|
17909
|
+
};
|
|
17910
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17911
|
+
var t = {};
|
|
17912
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17913
|
+
t[p] = s[p];
|
|
17914
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17915
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17916
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17917
|
+
t[p[i]] = s[p[i]];
|
|
17918
|
+
}
|
|
17919
|
+
return t;
|
|
17920
|
+
};
|
|
17921
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17922
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17923
|
+
};
|
|
17733
17924
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17734
17925
|
var BringgException_1 = __webpack_require__(43605);
|
|
17926
|
+
var CrudService_1 = __importDefault(__webpack_require__(14809));
|
|
17735
17927
|
var RouteGenerator_1 = __webpack_require__(84075);
|
|
17736
17928
|
var Route_1 = __webpack_require__(92641);
|
|
17737
|
-
var
|
|
17738
|
-
var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
17739
|
-
__extends(RouteOptimizationApi, _super);
|
|
17929
|
+
var RouteOptimizationApi = /** @class */ (function () {
|
|
17740
17930
|
function RouteOptimizationApi(session) {
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
return _this;
|
|
17931
|
+
this.optimization = new Route_1.Route('/route_optimizations/optimize', 1 /* HttpMethod.POST */);
|
|
17932
|
+
this.optimization_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/optimize', 1 /* HttpMethod.POST */);
|
|
17933
|
+
this.get_optimization_result = new Route_1.Route('/route_optimizations/get_optimization_result/{:request_uuid}', 0 /* HttpMethod.GET */);
|
|
17934
|
+
this.get_optimization_result_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/get_optimization_result/{:request_uuid}', 0 /* HttpMethod.GET */);
|
|
17935
|
+
this.cancel_requests = new Route_1.Route('/route_optimizations/optimization', 4 /* HttpMethod.DELETE */);
|
|
17936
|
+
this.cancel_requests_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/optimization', 4 /* HttpMethod.DELETE */);
|
|
17937
|
+
this.assign_users_by_ids = new Route_1.Route('/route_optimizations/assign_users_by_ids', 1 /* HttpMethod.POST */);
|
|
17938
|
+
this.update_user_modified_data = new Route_1.Route('/route_optimizations/update_user_modified_data', 1 /* HttpMethod.POST */);
|
|
17939
|
+
this.update_user_modified_data_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/update_user_modified_data', 1 /* HttpMethod.POST */);
|
|
17940
|
+
this.assign_user_manual_optimization = new Route_1.Route('/route_optimizations/assign_user_manual_optimization', 1 /* HttpMethod.POST */);
|
|
17941
|
+
this.service = new CrudService_1.default(session, '');
|
|
17753
17942
|
}
|
|
17754
17943
|
RouteOptimizationApi.prototype.cancelRequests = function (requestUuids, v2) {
|
|
17755
17944
|
if (v2 === void 0) { v2 = false; }
|
|
17756
|
-
return this.handleAuthorizedRequest({
|
|
17945
|
+
return this.service.handleAuthorizedRequest({
|
|
17757
17946
|
route: v2 ? this.cancel_requests_v2 : this.cancel_requests,
|
|
17758
17947
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17759
17948
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to call cancel optimization requests'),
|
|
@@ -17762,7 +17951,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17762
17951
|
};
|
|
17763
17952
|
RouteOptimizationApi.prototype.optimize = function (optimizationProps, v2) {
|
|
17764
17953
|
if (v2 === void 0) { v2 = false; }
|
|
17765
|
-
return this.handleAuthorizedRequest({
|
|
17954
|
+
return this.service.handleAuthorizedRequest({
|
|
17766
17955
|
route: v2 ? this.optimization_v2 : this.optimization,
|
|
17767
17956
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17768
17957
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to call optimization requests'),
|
|
@@ -17771,7 +17960,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17771
17960
|
};
|
|
17772
17961
|
RouteOptimizationApi.prototype.optimizationResult = function (request_uuid, v2) {
|
|
17773
17962
|
if (v2 === void 0) { v2 = false; }
|
|
17774
|
-
return this.handleAuthorizedRequest({
|
|
17963
|
+
return this.service.handleAuthorizedRequest({
|
|
17775
17964
|
route: v2 ? this.get_optimization_result_v2 : this.get_optimization_result,
|
|
17776
17965
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17777
17966
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get optimization results'),
|
|
@@ -17779,7 +17968,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17779
17968
|
});
|
|
17780
17969
|
};
|
|
17781
17970
|
RouteOptimizationApi.prototype.assignUsersByIds = function (teams) {
|
|
17782
|
-
return this.handleAuthorizedRequest({
|
|
17971
|
+
return this.service.handleAuthorizedRequest({
|
|
17783
17972
|
route: this.assign_users_by_ids,
|
|
17784
17973
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17785
17974
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign users by id'),
|
|
@@ -17788,7 +17977,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17788
17977
|
};
|
|
17789
17978
|
RouteOptimizationApi.prototype.updateOptimizationModifiedData = function (updateData, v2) {
|
|
17790
17979
|
if (v2 === void 0) { v2 = false; }
|
|
17791
|
-
return this.handleAuthorizedRequest({
|
|
17980
|
+
return this.service.handleAuthorizedRequest({
|
|
17792
17981
|
route: v2 ? this.update_user_modified_data_v2 : this.update_user_modified_data,
|
|
17793
17982
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17794
17983
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to update optimization user data'),
|
|
@@ -17797,7 +17986,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17797
17986
|
};
|
|
17798
17987
|
RouteOptimizationApi.prototype.assignUserManualOptimization = function (updateData) {
|
|
17799
17988
|
var fiveMinutesInMs = 1000 * 60 * 5;
|
|
17800
|
-
return this.handleAuthorizedRequest({
|
|
17989
|
+
return this.service.handleAuthorizedRequest({
|
|
17801
17990
|
route: this.assign_user_manual_optimization,
|
|
17802
17991
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17803
17992
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign user manual optimization data'),
|
|
@@ -17805,8 +17994,40 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17805
17994
|
timeout: fiveMinutesInMs
|
|
17806
17995
|
});
|
|
17807
17996
|
};
|
|
17997
|
+
RouteOptimizationApi.prototype.calculatePlannedEta = function (data, _a) {
|
|
17998
|
+
if (_a === void 0) { _a = {}; }
|
|
17999
|
+
var _b = _a.timeout, timeout = _b === void 0 ? 10000 : _b, options = __rest(_a, ["timeout"]);
|
|
18000
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
18001
|
+
var payload, result, asyncResult;
|
|
18002
|
+
return __generator(this, function (_c) {
|
|
18003
|
+
switch (_c.label) {
|
|
18004
|
+
case 0:
|
|
18005
|
+
payload = {
|
|
18006
|
+
team_id: data.team_id,
|
|
18007
|
+
data: __assign(__assign({}, data), { deadline: Date.now() + timeout })
|
|
18008
|
+
};
|
|
18009
|
+
return [4 /*yield*/, this.service.routeGenerator
|
|
18010
|
+
.post('/own-fleet-optimization-service/route_optimization/calculate_planned_eta')
|
|
18011
|
+
.withPayload(payload)
|
|
18012
|
+
.setException('Failed to calculate planned eta')
|
|
18013
|
+
.withCommonOptions(options)
|
|
18014
|
+
.invoke()];
|
|
18015
|
+
case 1:
|
|
18016
|
+
result = _c.sent();
|
|
18017
|
+
return [4 /*yield*/, this.service.session.sdk.asyncOperationStatus.waitForResponse({
|
|
18018
|
+
requestId: result.uuid,
|
|
18019
|
+
timeoutInMs: timeout,
|
|
18020
|
+
signal: options.signal
|
|
18021
|
+
})];
|
|
18022
|
+
case 2:
|
|
18023
|
+
asyncResult = _c.sent();
|
|
18024
|
+
return [2 /*return*/, asyncResult.data];
|
|
18025
|
+
}
|
|
18026
|
+
});
|
|
18027
|
+
});
|
|
18028
|
+
};
|
|
17808
18029
|
return RouteOptimizationApi;
|
|
17809
|
-
}(
|
|
18030
|
+
}());
|
|
17810
18031
|
exports["default"] = RouteOptimizationApi;
|
|
17811
18032
|
//# sourceMappingURL=RouteOptimizationApi.js.map
|
|
17812
18033
|
|
|
@@ -18072,21 +18293,6 @@ exports["default"] = Rules;
|
|
|
18072
18293
|
|
|
18073
18294
|
"use strict";
|
|
18074
18295
|
|
|
18075
|
-
var __extends = (this && this.__extends) || (function () {
|
|
18076
|
-
var extendStatics = function (d, b) {
|
|
18077
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18078
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
18079
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
18080
|
-
return extendStatics(d, b);
|
|
18081
|
-
};
|
|
18082
|
-
return function (d, b) {
|
|
18083
|
-
if (typeof b !== "function" && b !== null)
|
|
18084
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
18085
|
-
extendStatics(d, b);
|
|
18086
|
-
function __() { this.constructor = d; }
|
|
18087
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18088
|
-
};
|
|
18089
|
-
})();
|
|
18090
18296
|
var __assign = (this && this.__assign) || function () {
|
|
18091
18297
|
__assign = Object.assign || function(t) {
|
|
18092
18298
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -18134,11 +18340,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
18134
18340
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
18135
18341
|
}
|
|
18136
18342
|
};
|
|
18343
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18344
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18345
|
+
};
|
|
18137
18346
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
18138
18347
|
exports.RunsService = exports.Routes = void 0;
|
|
18139
18348
|
var BringgException_1 = __webpack_require__(43605);
|
|
18349
|
+
var CrudService_1 = __importDefault(__webpack_require__(14809));
|
|
18140
18350
|
var Route_1 = __webpack_require__(92641);
|
|
18141
|
-
var SessionBasedService_1 = __webpack_require__(27826);
|
|
18142
18351
|
var array_utils_1 = __webpack_require__(43052);
|
|
18143
18352
|
var runs_consts_1 = __webpack_require__(4669);
|
|
18144
18353
|
exports.Routes = {
|
|
@@ -18157,27 +18366,23 @@ exports.Routes = {
|
|
|
18157
18366
|
ASSIGN_VEHICLES: new Route_1.Route('/runs/{:id}/vehicles_assignment', 3 /* HttpMethod.PATCH */),
|
|
18158
18367
|
UNASSIGN_VEHICLES: new Route_1.Route('/runs/{:id}/vehicles_assignment', 4 /* HttpMethod.DELETE */)
|
|
18159
18368
|
};
|
|
18160
|
-
var RunsService = /** @class */ (function (
|
|
18161
|
-
__extends(RunsService, _super);
|
|
18369
|
+
var RunsService = /** @class */ (function () {
|
|
18162
18370
|
function RunsService(session) {
|
|
18163
|
-
|
|
18371
|
+
this.service = new CrudService_1.default(session, 'runs');
|
|
18164
18372
|
}
|
|
18165
18373
|
RunsService.prototype.getAll = function (options, _a) {
|
|
18166
18374
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18167
18375
|
return __awaiter(this, void 0, void 0, function () {
|
|
18168
|
-
var runsResponse;
|
|
18169
18376
|
return __generator(this, function (_c) {
|
|
18170
18377
|
switch (_c.label) {
|
|
18171
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18378
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18172
18379
|
route: exports.Routes.GET_RUNS,
|
|
18173
18380
|
extractor: runs_consts_1.defaultExtractor,
|
|
18174
18381
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get Runs'),
|
|
18175
18382
|
queryString: options,
|
|
18176
18383
|
signal: signal
|
|
18177
18384
|
})];
|
|
18178
|
-
case 1:
|
|
18179
|
-
runsResponse = _c.sent();
|
|
18180
|
-
return [2 /*return*/, runsResponse];
|
|
18385
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
18181
18386
|
}
|
|
18182
18387
|
});
|
|
18183
18388
|
});
|
|
@@ -18187,7 +18392,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18187
18392
|
return __awaiter(this, void 0, void 0, function () {
|
|
18188
18393
|
return __generator(this, function (_c) {
|
|
18189
18394
|
switch (_c.label) {
|
|
18190
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18395
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18191
18396
|
route: exports.Routes.GET_RUN_DATA,
|
|
18192
18397
|
extractor: runs_consts_1.defaultExtractor,
|
|
18193
18398
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get routes data'),
|
|
@@ -18262,22 +18467,19 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18262
18467
|
});
|
|
18263
18468
|
});
|
|
18264
18469
|
};
|
|
18265
|
-
RunsService.prototype.
|
|
18470
|
+
RunsService.prototype.load = function (id, _a) {
|
|
18266
18471
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18267
18472
|
return __awaiter(this, void 0, void 0, function () {
|
|
18268
|
-
var run;
|
|
18269
18473
|
return __generator(this, function (_c) {
|
|
18270
18474
|
switch (_c.label) {
|
|
18271
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18475
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18272
18476
|
route: exports.Routes.GET_RUN,
|
|
18273
18477
|
extractor: runs_consts_1.runExtractor,
|
|
18274
18478
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get Run'),
|
|
18275
18479
|
routeParams: { id: id },
|
|
18276
18480
|
signal: signal
|
|
18277
18481
|
})];
|
|
18278
|
-
case 1:
|
|
18279
|
-
run = _c.sent();
|
|
18280
|
-
return [2 /*return*/, run];
|
|
18482
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
18281
18483
|
}
|
|
18282
18484
|
});
|
|
18283
18485
|
});
|
|
@@ -18285,9 +18487,10 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18285
18487
|
RunsService.prototype.update = function (id, options, _a) {
|
|
18286
18488
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18287
18489
|
return __awaiter(this, void 0, void 0, function () {
|
|
18490
|
+
var response;
|
|
18288
18491
|
return __generator(this, function (_c) {
|
|
18289
18492
|
switch (_c.label) {
|
|
18290
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18493
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18291
18494
|
route: exports.Routes.UPDATE_RUN,
|
|
18292
18495
|
extractor: runs_consts_1.defaultExtractor,
|
|
18293
18496
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to update Run'),
|
|
@@ -18295,7 +18498,9 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18295
18498
|
routeParams: { id: id },
|
|
18296
18499
|
signal: signal
|
|
18297
18500
|
})];
|
|
18298
|
-
case 1:
|
|
18501
|
+
case 1:
|
|
18502
|
+
response = _c.sent();
|
|
18503
|
+
return [2 /*return*/, response.run];
|
|
18299
18504
|
}
|
|
18300
18505
|
});
|
|
18301
18506
|
});
|
|
@@ -18306,7 +18511,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18306
18511
|
var runHistory;
|
|
18307
18512
|
return __generator(this, function (_c) {
|
|
18308
18513
|
switch (_c.label) {
|
|
18309
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18514
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18310
18515
|
route: exports.Routes.GET_RUN_HISTORY,
|
|
18311
18516
|
extractor: runs_consts_1.runsHistoryExtractor,
|
|
18312
18517
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run history'),
|
|
@@ -18326,7 +18531,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18326
18531
|
var runLocations;
|
|
18327
18532
|
return __generator(this, function (_c) {
|
|
18328
18533
|
switch (_c.label) {
|
|
18329
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18534
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18330
18535
|
route: exports.Routes.GET_RUN_LOCATIONS,
|
|
18331
18536
|
extractor: runs_consts_1.runsLocationsExtractor,
|
|
18332
18537
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run locations'),
|
|
@@ -18346,7 +18551,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18346
18551
|
var runLocations;
|
|
18347
18552
|
return __generator(this, function (_c) {
|
|
18348
18553
|
switch (_c.label) {
|
|
18349
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18554
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18350
18555
|
route: exports.Routes.GET_RUN_CASHOUT,
|
|
18351
18556
|
extractor: runs_consts_1.runCashoutExtractor,
|
|
18352
18557
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run cashout'),
|
|
@@ -18366,7 +18571,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18366
18571
|
var response;
|
|
18367
18572
|
return __generator(this, function (_c) {
|
|
18368
18573
|
switch (_c.label) {
|
|
18369
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18574
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18370
18575
|
route: exports.Routes.ASSIGN_DRIVER,
|
|
18371
18576
|
extractor: runs_consts_1.defaultExtractor,
|
|
18372
18577
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign driver to run'),
|
|
@@ -18387,7 +18592,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18387
18592
|
var response;
|
|
18388
18593
|
return __generator(this, function (_c) {
|
|
18389
18594
|
switch (_c.label) {
|
|
18390
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18595
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18391
18596
|
route: exports.Routes.UNASSIGN_DRIVER,
|
|
18392
18597
|
extractor: runs_consts_1.defaultExtractor,
|
|
18393
18598
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign driver to run'),
|
|
@@ -18408,7 +18613,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18408
18613
|
var response;
|
|
18409
18614
|
return __generator(this, function (_c) {
|
|
18410
18615
|
switch (_c.label) {
|
|
18411
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18616
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18412
18617
|
route: exports.Routes.ASSIGN_VEHICLES,
|
|
18413
18618
|
extractor: runs_consts_1.defaultExtractor,
|
|
18414
18619
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign vehicles to run'),
|
|
@@ -18429,7 +18634,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18429
18634
|
var response;
|
|
18430
18635
|
return __generator(this, function (_c) {
|
|
18431
18636
|
switch (_c.label) {
|
|
18432
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18637
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18433
18638
|
route: exports.Routes.UNASSIGN_VEHICLES,
|
|
18434
18639
|
extractor: runs_consts_1.defaultExtractor,
|
|
18435
18640
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to unassign vehicles from run'),
|
|
@@ -18450,7 +18655,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18450
18655
|
var runBulkClose;
|
|
18451
18656
|
return __generator(this, function (_c) {
|
|
18452
18657
|
switch (_c.label) {
|
|
18453
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18658
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18454
18659
|
route: exports.Routes.BULK_CLOSE,
|
|
18455
18660
|
extractor: runs_consts_1.defaultExtractor,
|
|
18456
18661
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to bulk close runs'),
|
|
@@ -18470,7 +18675,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18470
18675
|
var markDonePlanning;
|
|
18471
18676
|
return __generator(this, function (_c) {
|
|
18472
18677
|
switch (_c.label) {
|
|
18473
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18678
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18474
18679
|
route: exports.Routes.MARK_DONE_PLANNING,
|
|
18475
18680
|
extractor: runs_consts_1.defaultExtractor,
|
|
18476
18681
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to mark done planning for runs'),
|
|
@@ -18490,7 +18695,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18490
18695
|
var actualBreaksByRunIdResponse;
|
|
18491
18696
|
return __generator(this, function (_c) {
|
|
18492
18697
|
switch (_c.label) {
|
|
18493
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18698
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18494
18699
|
route: exports.Routes.GET_ACTUAL_BREAKS,
|
|
18495
18700
|
extractor: runs_consts_1.defaultExtractor,
|
|
18496
18701
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get actual breaks of runs'),
|
|
@@ -18507,7 +18712,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18507
18712
|
});
|
|
18508
18713
|
};
|
|
18509
18714
|
return RunsService;
|
|
18510
|
-
}(
|
|
18715
|
+
}());
|
|
18511
18716
|
exports.RunsService = RunsService;
|
|
18512
18717
|
//# sourceMappingURL=runs.service.js.map
|
|
18513
18718
|
|
|
@@ -18561,7 +18766,6 @@ var RunStore = /** @class */ (function (_super) {
|
|
|
18561
18766
|
_this.updateRun = function (payload) {
|
|
18562
18767
|
return _this.createOrUpdateRun(payload, _this.onUpdate.bind(_this));
|
|
18563
18768
|
};
|
|
18564
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
18565
18769
|
_this.createOrUpdateRun = function (payload, callback) {
|
|
18566
18770
|
var existingRunModel = _this.store.getItem(payload.run.id);
|
|
18567
18771
|
var updatedRunModel = { id: payload.run.id, run: payload.run, taskIds: undefined };
|
|
@@ -18697,7 +18901,7 @@ exports["default"] = RunStore;
|
|
|
18697
18901
|
"use strict";
|
|
18698
18902
|
|
|
18699
18903
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
18700
|
-
exports.GetAllChunkSize = exports.defaultExtractor = exports.runCashoutExtractor = exports.runsLocationsExtractor = exports.runsHistoryExtractor = exports.runExtractor = exports.RunEvents = exports.RunStatus = void 0;
|
|
18904
|
+
exports.GetAllChunkSize = exports.defaultExtractor = exports.runCashoutExtractor = exports.runsLocationsExtractor = exports.runsHistoryExtractor = exports.runExtractor = exports.RunGroupTypes = exports.RunEvents = exports.RunStatus = void 0;
|
|
18701
18905
|
var RunStatus;
|
|
18702
18906
|
(function (RunStatus) {
|
|
18703
18907
|
RunStatus["ALL"] = "all";
|
|
@@ -18710,6 +18914,10 @@ var RunEvents;
|
|
|
18710
18914
|
RunEvents["DELETED"] = "run deleted";
|
|
18711
18915
|
RunEvents["CREATED"] = "run created";
|
|
18712
18916
|
})(RunEvents = exports.RunEvents || (exports.RunEvents = {}));
|
|
18917
|
+
var RunGroupTypes;
|
|
18918
|
+
(function (RunGroupTypes) {
|
|
18919
|
+
RunGroupTypes["TaskIds"] = "taskIds";
|
|
18920
|
+
})(RunGroupTypes = exports.RunGroupTypes || (exports.RunGroupTypes = {}));
|
|
18713
18921
|
var runExtractor = function (response) { return response.run; };
|
|
18714
18922
|
exports.runExtractor = runExtractor;
|
|
18715
18923
|
var runsHistoryExtractor = function (response) { return response; };
|
|
@@ -18860,7 +19068,7 @@ var Runs = /** @class */ (function () {
|
|
|
18860
19068
|
var run;
|
|
18861
19069
|
return __generator(this, function (_a) {
|
|
18862
19070
|
switch (_a.label) {
|
|
18863
|
-
case 0: return [4 /*yield*/, this.runsService.
|
|
19071
|
+
case 0: return [4 /*yield*/, this.runsService.load(id, commonOptions)];
|
|
18864
19072
|
case 1:
|
|
18865
19073
|
run = _a.sent();
|
|
18866
19074
|
return [2 /*return*/, this.runStore.set(run)];
|
|
@@ -18873,7 +19081,7 @@ var Runs = /** @class */ (function () {
|
|
|
18873
19081
|
return __awaiter(this, void 0, void 0, function () {
|
|
18874
19082
|
return __generator(this, function (_a) {
|
|
18875
19083
|
switch (_a.label) {
|
|
18876
|
-
case 0: return [4 /*yield*/, this.runsService.
|
|
19084
|
+
case 0: return [4 /*yield*/, this.runsService.load(id, commonOptions)];
|
|
18877
19085
|
case 1: return [2 /*return*/, _a.sent()];
|
|
18878
19086
|
}
|
|
18879
19087
|
});
|
|
@@ -19018,20 +19226,182 @@ exports["default"] = Runs;
|
|
|
19018
19226
|
|
|
19019
19227
|
/***/ }),
|
|
19020
19228
|
|
|
19021
|
-
/***/
|
|
19229
|
+
/***/ 30196:
|
|
19022
19230
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
19023
19231
|
|
|
19024
19232
|
"use strict";
|
|
19025
19233
|
|
|
19026
|
-
var
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
19234
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
19235
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19236
|
+
if (!m) return o;
|
|
19237
|
+
var i = m.call(o), r, ar = [], e;
|
|
19238
|
+
try {
|
|
19239
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19240
|
+
}
|
|
19241
|
+
catch (error) { e = { error: error }; }
|
|
19242
|
+
finally {
|
|
19243
|
+
try {
|
|
19244
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
19245
|
+
}
|
|
19246
|
+
finally { if (e) throw e.error; }
|
|
19247
|
+
}
|
|
19248
|
+
return ar;
|
|
19249
|
+
};
|
|
19250
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19251
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19252
|
+
if (ar || !(i in from)) {
|
|
19253
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
19254
|
+
ar[i] = from[i];
|
|
19255
|
+
}
|
|
19256
|
+
}
|
|
19257
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
19258
|
+
};
|
|
19259
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19260
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19261
|
+
};
|
|
19262
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19263
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
19264
|
+
var Tasks_consts_1 = __webpack_require__(24976);
|
|
19265
|
+
var runs_consts_1 = __webpack_require__(4669);
|
|
19266
|
+
var RunRealtimeSubscriptions = /** @class */ (function () {
|
|
19267
|
+
function RunRealtimeSubscriptions(session, runsStore, storableDataService) {
|
|
19268
|
+
var _this = this;
|
|
19269
|
+
this.runsStore = runsStore;
|
|
19270
|
+
this.storableDataService = storableDataService;
|
|
19271
|
+
this.updateTaskIdsOnDelete = function (task) {
|
|
19272
|
+
var existingRun = _this.runsStore.get(task.run_id);
|
|
19273
|
+
if (!existingRun) {
|
|
19274
|
+
return;
|
|
19275
|
+
}
|
|
19276
|
+
var updatedTaskIds = new Set(existingRun.task_ids);
|
|
19277
|
+
updatedTaskIds.delete(task.id);
|
|
19278
|
+
_this.updateRunInStore(existingRun, updatedTaskIds);
|
|
19279
|
+
};
|
|
19280
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, runsStore, storableDataService);
|
|
19281
|
+
this.taskIdsWaitingForRun = new Map();
|
|
19282
|
+
}
|
|
19283
|
+
RunRealtimeSubscriptions.prototype.updateStoreOnEvents = function () {
|
|
19284
|
+
var runExtractor = function (_a) {
|
|
19285
|
+
var run = _a.run;
|
|
19286
|
+
return run;
|
|
19287
|
+
};
|
|
19288
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([
|
|
19289
|
+
{
|
|
19290
|
+
name: runs_consts_1.RunEvents.CREATED,
|
|
19291
|
+
isDelete: false,
|
|
19292
|
+
extraDataFunc: this.addTaskIdsOnCreateOrUpdate.bind(this),
|
|
19293
|
+
itemExtractor: runExtractor
|
|
19294
|
+
},
|
|
19295
|
+
{
|
|
19296
|
+
name: runs_consts_1.RunEvents.UPDATED,
|
|
19297
|
+
isDelete: false,
|
|
19298
|
+
extraDataFunc: this.addTaskIdsOnCreateOrUpdate.bind(this),
|
|
19299
|
+
itemExtractor: runExtractor
|
|
19300
|
+
},
|
|
19301
|
+
{ name: runs_consts_1.RunEvents.DELETED, isDelete: true }
|
|
19302
|
+
]);
|
|
19303
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, this.updateTaskIdsOnDelete.bind(this));
|
|
19304
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, this.updateTaskIds.bind(this));
|
|
19305
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, this.updateTaskIds.bind(this));
|
|
19306
|
+
};
|
|
19307
|
+
RunRealtimeSubscriptions.prototype.onUpdate = function (callback) {
|
|
19308
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.UPDATED, callback);
|
|
19309
|
+
};
|
|
19310
|
+
RunRealtimeSubscriptions.prototype.onDelete = function (callback) {
|
|
19311
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.DELETED, callback);
|
|
19312
|
+
};
|
|
19313
|
+
RunRealtimeSubscriptions.prototype.onCreate = function (callback) {
|
|
19314
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.CREATED, callback);
|
|
19315
|
+
};
|
|
19316
|
+
RunRealtimeSubscriptions.prototype.addTaskIdsOnCreateOrUpdate = function (run) {
|
|
19317
|
+
if (run.task_ids || run.tasks) {
|
|
19318
|
+
return;
|
|
19319
|
+
}
|
|
19320
|
+
var existingRun = this.runsStore.get(run.id);
|
|
19321
|
+
var taskIdsWaitingForRun = this.taskIdsWaitingForRun.get(run.id) || new Set();
|
|
19322
|
+
var taskIds = existingRun
|
|
19323
|
+
? Array.from(new Set(__spreadArray(__spreadArray([], __read(existingRun.task_ids), false), __read(taskIdsWaitingForRun), false)))
|
|
19324
|
+
: Array.from(taskIdsWaitingForRun);
|
|
19325
|
+
this.taskIdsWaitingForRun.delete(run.id);
|
|
19326
|
+
return { params: { taskIds: taskIds } };
|
|
19327
|
+
};
|
|
19328
|
+
RunRealtimeSubscriptions.prototype.updateTaskIds = function (task) {
|
|
19329
|
+
var existingRun = this.runsStore.getGroup(runs_consts_1.RunGroupTypes.TaskIds, task.id)[0];
|
|
19330
|
+
if (task.run_id) {
|
|
19331
|
+
var newRun = this.runsStore.get(task.run_id);
|
|
19332
|
+
if (!newRun) {
|
|
19333
|
+
this.backupTasksUntilRunIsCreated(task);
|
|
19334
|
+
}
|
|
19335
|
+
else if (this.taskAddedToRun(task, newRun)) {
|
|
19336
|
+
var updatedTaskIds = new Set(newRun.task_ids);
|
|
19337
|
+
updatedTaskIds.add(task.id);
|
|
19338
|
+
this.updateRunInStore(newRun, updatedTaskIds);
|
|
19339
|
+
}
|
|
19340
|
+
}
|
|
19341
|
+
else if (this.taskRemovedFromRun(task, existingRun)) {
|
|
19342
|
+
var updatedTaskIds = new Set(existingRun.task_ids);
|
|
19343
|
+
updatedTaskIds.delete(task.id);
|
|
19344
|
+
this.updateRunInStore(existingRun, updatedTaskIds);
|
|
19345
|
+
}
|
|
19346
|
+
this.updatePreviousRun(task, existingRun === null || existingRun === void 0 ? void 0 : existingRun.id);
|
|
19347
|
+
};
|
|
19348
|
+
RunRealtimeSubscriptions.prototype.updatePreviousRun = function (task, previousRunId) {
|
|
19349
|
+
if (previousRunId && previousRunId != task.run_id) {
|
|
19350
|
+
if (this.taskIdsWaitingForRun.has(previousRunId)) {
|
|
19351
|
+
this.taskIdsWaitingForRun.get(previousRunId).delete(task.id);
|
|
19352
|
+
}
|
|
19353
|
+
var previousRunOfTask = this.runsStore.get(previousRunId);
|
|
19354
|
+
if (previousRunOfTask) {
|
|
19355
|
+
var updatedTaskIds = new Set(previousRunOfTask.task_ids);
|
|
19356
|
+
updatedTaskIds.delete(task.id);
|
|
19357
|
+
this.updateRunInStore(previousRunOfTask, updatedTaskIds);
|
|
19358
|
+
}
|
|
19359
|
+
}
|
|
19360
|
+
};
|
|
19361
|
+
RunRealtimeSubscriptions.prototype.updateRunInStore = function (newRun, taskIds) {
|
|
19362
|
+
var mappedItem = this.storableDataService.updateInStores(newRun, undefined, undefined, {
|
|
19363
|
+
taskIds: Array.from(taskIds)
|
|
19364
|
+
});
|
|
19365
|
+
this.storableRealtimeSubscriptions.runEventCallbacks(runs_consts_1.RunEvents.UPDATED, mappedItem);
|
|
19366
|
+
};
|
|
19367
|
+
RunRealtimeSubscriptions.prototype.taskRemovedFromRun = function (task, existingRun) {
|
|
19368
|
+
var _a;
|
|
19369
|
+
return !task.run_id && ((_a = existingRun === null || existingRun === void 0 ? void 0 : existingRun.task_ids) === null || _a === void 0 ? void 0 : _a.includes(task.id));
|
|
19370
|
+
};
|
|
19371
|
+
RunRealtimeSubscriptions.prototype.taskAddedToRun = function (task, existingRun) {
|
|
19372
|
+
var _a;
|
|
19373
|
+
return task.run_id && !((_a = existingRun.task_ids) === null || _a === void 0 ? void 0 : _a.includes(task.id));
|
|
19374
|
+
};
|
|
19375
|
+
RunRealtimeSubscriptions.prototype.backupTasksUntilRunIsCreated = function (task) {
|
|
19376
|
+
if (!task.run_id) {
|
|
19377
|
+
return;
|
|
19378
|
+
}
|
|
19379
|
+
if (!this.taskIdsWaitingForRun.has(task.run_id)) {
|
|
19380
|
+
this.taskIdsWaitingForRun.set(task.run_id, new Set());
|
|
19381
|
+
}
|
|
19382
|
+
this.taskIdsWaitingForRun.get(task.run_id).add(task.id);
|
|
19383
|
+
};
|
|
19384
|
+
return RunRealtimeSubscriptions;
|
|
19385
|
+
}());
|
|
19386
|
+
exports["default"] = RunRealtimeSubscriptions;
|
|
19387
|
+
//# sourceMappingURL=run-realtime-subscriptions.js.map
|
|
19388
|
+
|
|
19389
|
+
/***/ }),
|
|
19390
|
+
|
|
19391
|
+
/***/ 83582:
|
|
19392
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
19393
|
+
|
|
19394
|
+
"use strict";
|
|
19395
|
+
|
|
19396
|
+
var __assign = (this && this.__assign) || function () {
|
|
19397
|
+
__assign = Object.assign || function(t) {
|
|
19398
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19399
|
+
s = arguments[i];
|
|
19400
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19401
|
+
t[p] = s[p];
|
|
19402
|
+
}
|
|
19403
|
+
return t;
|
|
19404
|
+
};
|
|
19035
19405
|
return __assign.apply(this, arguments);
|
|
19036
19406
|
};
|
|
19037
19407
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -19074,56 +19444,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19074
19444
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19075
19445
|
};
|
|
19076
19446
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19447
|
+
var BringgDashboardSDK_1 = __webpack_require__(5655);
|
|
19448
|
+
var data_entity_1 = __webpack_require__(91083);
|
|
19077
19449
|
var data_store_1 = __importDefault(__webpack_require__(73135));
|
|
19078
|
-
var
|
|
19450
|
+
var storable_data_service_1 = __importDefault(__webpack_require__(45297));
|
|
19079
19451
|
var runs_consts_1 = __webpack_require__(4669);
|
|
19080
19452
|
var runs_service_1 = __webpack_require__(34075);
|
|
19453
|
+
var run_realtime_subscriptions_1 = __importDefault(__webpack_require__(30196));
|
|
19081
19454
|
var RunsApi = /** @class */ (function () {
|
|
19082
19455
|
function RunsApi(session) {
|
|
19083
19456
|
var _this = this;
|
|
19084
|
-
this.
|
|
19085
|
-
_this.
|
|
19457
|
+
this.onUpdate = function (callback) {
|
|
19458
|
+
return _this.realtimeSubscriptions.onUpdate(callback);
|
|
19086
19459
|
};
|
|
19087
|
-
this.
|
|
19088
|
-
_this.
|
|
19460
|
+
this.onDelete = function (callback) {
|
|
19461
|
+
return _this.realtimeSubscriptions.onDelete(callback);
|
|
19462
|
+
};
|
|
19463
|
+
this.onCreate = function (callback) {
|
|
19464
|
+
return _this.realtimeSubscriptions.onCreate(callback);
|
|
19089
19465
|
};
|
|
19090
|
-
this.runsStore = new data_store_1.default(
|
|
19466
|
+
this.runsStore = new data_store_1.default([
|
|
19467
|
+
{
|
|
19468
|
+
groupType: runs_consts_1.RunGroupTypes.TaskIds,
|
|
19469
|
+
keyFunc: function (runModel) { return runModel.task_ids; }
|
|
19470
|
+
}
|
|
19471
|
+
]);
|
|
19091
19472
|
this.runsService = new runs_service_1.RunsService(session);
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19473
|
+
var mapper = function (run, params) {
|
|
19474
|
+
var existing = _this.runsStore.get(run.id);
|
|
19475
|
+
var taskIds;
|
|
19476
|
+
if (params.taskIds || run.task_ids || run.tasks) {
|
|
19477
|
+
taskIds = params.taskIds || run.task_ids || run.tasks.map(function (task) { return task.id; });
|
|
19478
|
+
}
|
|
19479
|
+
if (existing) {
|
|
19480
|
+
var previous = (0, BringgDashboardSDK_1.getGlobals)().mobx.toJS(existing);
|
|
19481
|
+
run.task_ids = taskIds || existing.task_ids;
|
|
19482
|
+
return { current: run, previous: previous };
|
|
19483
|
+
}
|
|
19484
|
+
else {
|
|
19485
|
+
run.task_ids = taskIds || [];
|
|
19486
|
+
return { current: run };
|
|
19487
|
+
}
|
|
19488
|
+
};
|
|
19489
|
+
this.storableDataService = new storable_data_service_1.default(this.runsStore, mapper);
|
|
19490
|
+
this.realtimeSubscriptions = new run_realtime_subscriptions_1.default(session, this.runsStore, this.storableDataService);
|
|
19096
19491
|
}
|
|
19492
|
+
RunsApi.prototype.updateStoreOnEvents = function () {
|
|
19493
|
+
this.realtimeSubscriptions.updateStoreOnEvents();
|
|
19494
|
+
};
|
|
19495
|
+
RunsApi.prototype.get = function (id) {
|
|
19496
|
+
return this.runsStore.get(id);
|
|
19497
|
+
};
|
|
19097
19498
|
RunsApi.prototype.getAll = function () {
|
|
19098
19499
|
return this.runsStore.getAll();
|
|
19099
19500
|
};
|
|
19501
|
+
RunsApi.prototype.getAllMap = function () {
|
|
19502
|
+
return this.runsStore.getAllById();
|
|
19503
|
+
};
|
|
19100
19504
|
RunsApi.prototype.getByIds = function (ids) {
|
|
19101
19505
|
var _this = this;
|
|
19102
|
-
return ids.map(function (runId) { return _this.runsStore.get(runId); });
|
|
19506
|
+
return ids.map(function (runId) { return _this.runsStore.get(runId); }).filter(Boolean);
|
|
19507
|
+
};
|
|
19508
|
+
RunsApi.prototype.add = function (run) {
|
|
19509
|
+
return this.storableDataService.updateInStores(run);
|
|
19510
|
+
};
|
|
19511
|
+
RunsApi.prototype.remove = function (id) {
|
|
19512
|
+
return this.storableDataService.removeFromStores(id);
|
|
19103
19513
|
};
|
|
19104
|
-
RunsApi.prototype.
|
|
19514
|
+
RunsApi.prototype.loadMany = function (queryParams, options, commonOptions) {
|
|
19515
|
+
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
19105
19516
|
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19106
19517
|
return __awaiter(this, void 0, void 0, function () {
|
|
19107
|
-
var idsToFetch, runs_1, runs;
|
|
19108
19518
|
var _this = this;
|
|
19109
19519
|
return __generator(this, function (_a) {
|
|
19110
|
-
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
idsToFetch = options.ids.filter(function (id) { return !_this.runsStore.get(id); });
|
|
19114
|
-
if (!idsToFetch.length) return [3 /*break*/, 2];
|
|
19115
|
-
return [4 /*yield*/, this.runsService.loadAll(__assign(__assign({}, options), { ids: idsToFetch }), commonOptions)];
|
|
19116
|
-
case 1:
|
|
19117
|
-
runs_1 = _a.sent();
|
|
19118
|
-
this.runsStore.setMany(runs_1.map(function (run) { return ({ current: run }); }));
|
|
19119
|
-
_a.label = 2;
|
|
19120
|
-
case 2: return [2 /*return*/, this.getByIds(options.ids)];
|
|
19121
|
-
case 3: return [4 /*yield*/, this.runsService.loadAll(options, commonOptions)];
|
|
19122
|
-
case 4:
|
|
19123
|
-
runs = _a.sent();
|
|
19124
|
-
this.runsStore.setAll(runs.map(function (run) { return ({ current: run }); }));
|
|
19125
|
-
return [2 /*return*/, runs];
|
|
19126
|
-
}
|
|
19520
|
+
return [2 /*return*/, this.storableDataService.loadMany('loadMany', function (idsToLoad) {
|
|
19521
|
+
return _this.runsService.loadAll(__assign(__assign({}, options), { ids: idsToLoad }), commonOptions);
|
|
19522
|
+
}, queryParams.ids, options)];
|
|
19127
19523
|
});
|
|
19128
19524
|
});
|
|
19129
19525
|
};
|
|
@@ -19138,6 +19534,130 @@ var RunsApi = /** @class */ (function () {
|
|
|
19138
19534
|
});
|
|
19139
19535
|
});
|
|
19140
19536
|
};
|
|
19537
|
+
RunsApi.prototype.load = function (id, options) {
|
|
19538
|
+
var _this = this;
|
|
19539
|
+
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
19540
|
+
return this.storableDataService.load('load', function () { return _this.runsService.load(id); }, id, options);
|
|
19541
|
+
};
|
|
19542
|
+
RunsApi.prototype.update = function (id, options, commonOptions) {
|
|
19543
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19544
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19545
|
+
var _this = this;
|
|
19546
|
+
return __generator(this, function (_a) {
|
|
19547
|
+
return [2 /*return*/, this.storableDataService.modify('update', function () { return _this.runsService.update(id, options, commonOptions); })];
|
|
19548
|
+
});
|
|
19549
|
+
});
|
|
19550
|
+
};
|
|
19551
|
+
RunsApi.prototype.getHistory = function (id, commonOptions) {
|
|
19552
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19553
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19554
|
+
return __generator(this, function (_a) {
|
|
19555
|
+
switch (_a.label) {
|
|
19556
|
+
case 0: return [4 /*yield*/, this.runsService.getHistory(id, commonOptions)];
|
|
19557
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19558
|
+
}
|
|
19559
|
+
});
|
|
19560
|
+
});
|
|
19561
|
+
};
|
|
19562
|
+
RunsApi.prototype.getLocations = function (id, commonOptions) {
|
|
19563
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19564
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19565
|
+
return __generator(this, function (_a) {
|
|
19566
|
+
switch (_a.label) {
|
|
19567
|
+
case 0: return [4 /*yield*/, this.runsService.getLocations(id, commonOptions)];
|
|
19568
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19569
|
+
}
|
|
19570
|
+
});
|
|
19571
|
+
});
|
|
19572
|
+
};
|
|
19573
|
+
RunsApi.prototype.getCashout = function (id, commonOptions) {
|
|
19574
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19575
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19576
|
+
return __generator(this, function (_a) {
|
|
19577
|
+
switch (_a.label) {
|
|
19578
|
+
case 0: return [4 /*yield*/, this.runsService.getCashout(id, commonOptions)];
|
|
19579
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19580
|
+
}
|
|
19581
|
+
});
|
|
19582
|
+
});
|
|
19583
|
+
};
|
|
19584
|
+
RunsApi.prototype.assignDriver = function (id, userId, targetRun, commonOptions) {
|
|
19585
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19586
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19587
|
+
return __generator(this, function (_a) {
|
|
19588
|
+
switch (_a.label) {
|
|
19589
|
+
case 0: return [4 /*yield*/, this.runsService.assignDriver(id, userId, targetRun, commonOptions)];
|
|
19590
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19591
|
+
}
|
|
19592
|
+
});
|
|
19593
|
+
});
|
|
19594
|
+
};
|
|
19595
|
+
RunsApi.prototype.unassignDriver = function (id, userId, commonOptions) {
|
|
19596
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19597
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19598
|
+
return __generator(this, function (_a) {
|
|
19599
|
+
switch (_a.label) {
|
|
19600
|
+
case 0: return [4 /*yield*/, this.runsService.unassignDriver(id, userId, commonOptions)];
|
|
19601
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19602
|
+
}
|
|
19603
|
+
});
|
|
19604
|
+
});
|
|
19605
|
+
};
|
|
19606
|
+
RunsApi.prototype.assignVehicles = function (id, vehicleId, tasks, commonOptions) {
|
|
19607
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19608
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19609
|
+
return __generator(this, function (_a) {
|
|
19610
|
+
switch (_a.label) {
|
|
19611
|
+
case 0: return [4 /*yield*/, this.runsService.assignVehicles(id, vehicleId, tasks, commonOptions)];
|
|
19612
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19613
|
+
}
|
|
19614
|
+
});
|
|
19615
|
+
});
|
|
19616
|
+
};
|
|
19617
|
+
RunsApi.prototype.unassignVehicles = function (id, commonOptions) {
|
|
19618
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19619
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19620
|
+
return __generator(this, function (_a) {
|
|
19621
|
+
switch (_a.label) {
|
|
19622
|
+
case 0: return [4 /*yield*/, this.runsService.unassignVehicles(id, commonOptions)];
|
|
19623
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19624
|
+
}
|
|
19625
|
+
});
|
|
19626
|
+
});
|
|
19627
|
+
};
|
|
19628
|
+
RunsApi.prototype.bulkClose = function (runIds, commonOptions) {
|
|
19629
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19630
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19631
|
+
return __generator(this, function (_a) {
|
|
19632
|
+
switch (_a.label) {
|
|
19633
|
+
case 0: return [4 /*yield*/, this.runsService.bulkClose(runIds, commonOptions)];
|
|
19634
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19635
|
+
}
|
|
19636
|
+
});
|
|
19637
|
+
});
|
|
19638
|
+
};
|
|
19639
|
+
RunsApi.prototype.markDonePlanning = function (runIds, commonOptions) {
|
|
19640
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19641
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19642
|
+
return __generator(this, function (_a) {
|
|
19643
|
+
switch (_a.label) {
|
|
19644
|
+
case 0: return [4 /*yield*/, this.runsService.markDonePlanning(runIds, commonOptions)];
|
|
19645
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19646
|
+
}
|
|
19647
|
+
});
|
|
19648
|
+
});
|
|
19649
|
+
};
|
|
19650
|
+
RunsApi.prototype.getActualBreaks = function (runIds, commonOptions) {
|
|
19651
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19652
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19653
|
+
return __generator(this, function (_a) {
|
|
19654
|
+
switch (_a.label) {
|
|
19655
|
+
case 0: return [4 /*yield*/, this.runsService.getActualBreaks(runIds, commonOptions)];
|
|
19656
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19657
|
+
}
|
|
19658
|
+
});
|
|
19659
|
+
});
|
|
19660
|
+
};
|
|
19141
19661
|
return RunsApi;
|
|
19142
19662
|
}());
|
|
19143
19663
|
exports["default"] = RunsApi;
|
|
@@ -21517,7 +22037,7 @@ var lodash_1 = __webpack_require__(96486);
|
|
|
21517
22037
|
var BringgException_1 = __webpack_require__(43605);
|
|
21518
22038
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
21519
22039
|
var abort_1 = __webpack_require__(34179);
|
|
21520
|
-
var version = '
|
|
22040
|
+
var version = '9.1.0';
|
|
21521
22041
|
function logErrorResponse(response) {
|
|
21522
22042
|
var data = response.data, status = response.status;
|
|
21523
22043
|
try {
|
|
@@ -22366,101 +22886,6 @@ exports["default"] = SkillsApi;
|
|
|
22366
22886
|
|
|
22367
22887
|
/***/ }),
|
|
22368
22888
|
|
|
22369
|
-
/***/ 38796:
|
|
22370
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22371
|
-
|
|
22372
|
-
"use strict";
|
|
22373
|
-
|
|
22374
|
-
var __extends = (this && this.__extends) || (function () {
|
|
22375
|
-
var extendStatics = function (d, b) {
|
|
22376
|
-
extendStatics = Object.setPrototypeOf ||
|
|
22377
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
22378
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
22379
|
-
return extendStatics(d, b);
|
|
22380
|
-
};
|
|
22381
|
-
return function (d, b) {
|
|
22382
|
-
if (typeof b !== "function" && b !== null)
|
|
22383
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
22384
|
-
extendStatics(d, b);
|
|
22385
|
-
function __() { this.constructor = d; }
|
|
22386
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
22387
|
-
};
|
|
22388
|
-
})();
|
|
22389
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22390
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22391
|
-
};
|
|
22392
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22393
|
-
var BaseService_1 = __importDefault(__webpack_require__(41992));
|
|
22394
|
-
var SERVICE_NAME = '/own-fleet-optimization-service/speed_factor';
|
|
22395
|
-
var SpeedFactorService = /** @class */ (function (_super) {
|
|
22396
|
-
__extends(SpeedFactorService, _super);
|
|
22397
|
-
function SpeedFactorService(session) {
|
|
22398
|
-
return _super.call(this, session, 'speedFactor') || this;
|
|
22399
|
-
}
|
|
22400
|
-
SpeedFactorService.prototype.create = function (payload) {
|
|
22401
|
-
return this.routeGenerator.post(SERVICE_NAME).withPayload(payload).invoke();
|
|
22402
|
-
};
|
|
22403
|
-
SpeedFactorService.prototype.list = function (serviceAreaId) {
|
|
22404
|
-
return this.routeGenerator.get("".concat(SERVICE_NAME, "/").concat(serviceAreaId)).invoke();
|
|
22405
|
-
};
|
|
22406
|
-
SpeedFactorService.prototype.update = function (payload) {
|
|
22407
|
-
return this.routeGenerator.put(SERVICE_NAME).withPayload(payload).invoke();
|
|
22408
|
-
};
|
|
22409
|
-
SpeedFactorService.prototype.updateSeries = function (payload) {
|
|
22410
|
-
return this.routeGenerator.put("".concat(SERVICE_NAME, "/series")).withPayload(payload).invoke();
|
|
22411
|
-
};
|
|
22412
|
-
SpeedFactorService.prototype.delete = function (dbId) {
|
|
22413
|
-
return this.routeGenerator.delete("".concat(SERVICE_NAME, "/db_id/").concat(dbId)).invoke();
|
|
22414
|
-
};
|
|
22415
|
-
SpeedFactorService.prototype.deleteSeries = function (originalUuid) {
|
|
22416
|
-
return this.routeGenerator.delete("".concat(SERVICE_NAME, "/series/").concat(originalUuid)).invoke();
|
|
22417
|
-
};
|
|
22418
|
-
return SpeedFactorService;
|
|
22419
|
-
}(BaseService_1.default));
|
|
22420
|
-
exports["default"] = SpeedFactorService;
|
|
22421
|
-
//# sourceMappingURL=SpeedFactor.service.js.map
|
|
22422
|
-
|
|
22423
|
-
/***/ }),
|
|
22424
|
-
|
|
22425
|
-
/***/ 89808:
|
|
22426
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22427
|
-
|
|
22428
|
-
"use strict";
|
|
22429
|
-
|
|
22430
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22431
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22432
|
-
};
|
|
22433
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
22434
|
-
var SpeedFactor_service_1 = __importDefault(__webpack_require__(38796));
|
|
22435
|
-
var SpeedFactor = /** @class */ (function () {
|
|
22436
|
-
function SpeedFactor(session) {
|
|
22437
|
-
this.speedFactorService = new SpeedFactor_service_1.default(session);
|
|
22438
|
-
}
|
|
22439
|
-
SpeedFactor.prototype.create = function (configuration) {
|
|
22440
|
-
return this.speedFactorService.create(configuration);
|
|
22441
|
-
};
|
|
22442
|
-
SpeedFactor.prototype.list = function (serviceAreaId) {
|
|
22443
|
-
return this.speedFactorService.list(serviceAreaId);
|
|
22444
|
-
};
|
|
22445
|
-
SpeedFactor.prototype.update = function (payload) {
|
|
22446
|
-
return this.speedFactorService.update(payload);
|
|
22447
|
-
};
|
|
22448
|
-
SpeedFactor.prototype.updateSeries = function (payload) {
|
|
22449
|
-
return this.speedFactorService.updateSeries(payload);
|
|
22450
|
-
};
|
|
22451
|
-
SpeedFactor.prototype.delete = function (dbId) {
|
|
22452
|
-
return this.speedFactorService.delete(dbId);
|
|
22453
|
-
};
|
|
22454
|
-
SpeedFactor.prototype.deleteSeries = function (originalUuid) {
|
|
22455
|
-
return this.speedFactorService.deleteSeries(originalUuid);
|
|
22456
|
-
};
|
|
22457
|
-
return SpeedFactor;
|
|
22458
|
-
}());
|
|
22459
|
-
exports["default"] = SpeedFactor;
|
|
22460
|
-
//# sourceMappingURL=SpeedFactor.js.map
|
|
22461
|
-
|
|
22462
|
-
/***/ }),
|
|
22463
|
-
|
|
22464
22889
|
/***/ 20040:
|
|
22465
22890
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22466
22891
|
|
|
@@ -24024,150 +24449,89 @@ exports.Routes = {
|
|
|
24024
24449
|
|
|
24025
24450
|
"use strict";
|
|
24026
24451
|
|
|
24027
|
-
var __values = (this && this.__values) || function(o) {
|
|
24028
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
24029
|
-
if (m) return m.call(o);
|
|
24030
|
-
if (o && typeof o.length === "number") return {
|
|
24031
|
-
next: function () {
|
|
24032
|
-
if (o && i >= o.length) o = void 0;
|
|
24033
|
-
return { value: o && o[i++], done: !o };
|
|
24034
|
-
}
|
|
24035
|
-
};
|
|
24036
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
24037
|
-
};
|
|
24038
24452
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24039
24453
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24040
24454
|
};
|
|
24041
24455
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
24042
|
-
var
|
|
24043
|
-
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
24456
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
24044
24457
|
var Tasks_consts_1 = __webpack_require__(24976);
|
|
24045
24458
|
var TaskRealtimeSubscriptions = /** @class */ (function () {
|
|
24046
24459
|
function TaskRealtimeSubscriptions(session, tasksStore, storableDataService) {
|
|
24047
|
-
this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);
|
|
24048
24460
|
this.tasksStore = tasksStore;
|
|
24049
|
-
this.
|
|
24050
|
-
this.eventCallbacks = {};
|
|
24461
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, tasksStore, storableDataService);
|
|
24051
24462
|
}
|
|
24052
24463
|
TaskRealtimeSubscriptions.prototype.updateStoreOnEvents = function () {
|
|
24053
24464
|
var _this = this;
|
|
24054
|
-
var
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
_this.runEventCallbacks(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, mappedStorableItem);
|
|
24062
|
-
});
|
|
24063
|
-
this.realtimeSubscriptions.subscribe(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, function (task) {
|
|
24064
|
-
var mappedStorableItem = _this.storableDataService.updateInStores(task);
|
|
24065
|
-
_this.runEventCallbacks(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, mappedStorableItem);
|
|
24066
|
-
});
|
|
24067
|
-
this.realtimeSubscriptions.subscribe(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, function (task) {
|
|
24068
|
-
var deletedTasks = _this.storableDataService.removeFromStores(task.id);
|
|
24069
|
-
_this.runEventCallbacks(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, { diff: deletedTasks });
|
|
24070
|
-
});
|
|
24071
|
-
[
|
|
24072
|
-
{ event: Tasks_consts_1.TaskRealTimeEvents.NEW_SCAN, field: 'scans', isDelete: false },
|
|
24073
|
-
{ event: Tasks_consts_1.TaskRealTimeEvents.NEW_NOTE, field: 'task_notes', isDelete: false },
|
|
24074
|
-
{ event: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_ADDED, field: 'way_points', isDelete: false },
|
|
24075
|
-
{ event: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED, field: 'way_points', isDelete: false },
|
|
24076
|
-
{ event: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED, field: 'way_points', isDelete: true }
|
|
24077
|
-
].forEach(function (eventData) {
|
|
24078
|
-
_this.realtimeSubscriptions.subscribe(eventData.event, function (subEntity) {
|
|
24079
|
-
ignoreFields.forEach(function (field) { return delete subEntity[field]; });
|
|
24080
|
-
var eventChangeData = _this.changeSubEntity(subEntity, eventData.field, eventData.isDelete);
|
|
24081
|
-
if (eventChangeData.current) {
|
|
24082
|
-
_this.runEventCallbacks(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, eventChangeData);
|
|
24465
|
+
var events = [
|
|
24466
|
+
{
|
|
24467
|
+
name: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24468
|
+
isDelete: false,
|
|
24469
|
+
extraDataFunc: function (task) {
|
|
24470
|
+
var isPartialUpdate = !task.hasOwnProperty('status');
|
|
24471
|
+
return { ignore: isPartialUpdate && !_this.tasksStore.get(task.id) };
|
|
24083
24472
|
}
|
|
24084
|
-
}
|
|
24085
|
-
|
|
24473
|
+
},
|
|
24474
|
+
{ name: Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, isDelete: false },
|
|
24475
|
+
{ name: Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, isDelete: true }
|
|
24476
|
+
];
|
|
24477
|
+
var subEntityEvents = [
|
|
24478
|
+
{
|
|
24479
|
+
name: Tasks_consts_1.TaskRealTimeEvents.NEW_SCAN,
|
|
24480
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24481
|
+
parentField: 'task_id',
|
|
24482
|
+
field: 'scans',
|
|
24483
|
+
ignoreFields: ['way_points'],
|
|
24484
|
+
isDelete: false
|
|
24485
|
+
},
|
|
24486
|
+
{
|
|
24487
|
+
name: Tasks_consts_1.TaskRealTimeEvents.NEW_NOTE,
|
|
24488
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24489
|
+
parentField: 'task_id',
|
|
24490
|
+
field: 'task_notes',
|
|
24491
|
+
ignoreFields: ['way_points'],
|
|
24492
|
+
isDelete: false
|
|
24493
|
+
},
|
|
24494
|
+
{
|
|
24495
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_ADDED,
|
|
24496
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24497
|
+
parentField: 'task_id',
|
|
24498
|
+
field: 'way_points',
|
|
24499
|
+
ignoreFields: ['way_points'],
|
|
24500
|
+
isDelete: false
|
|
24501
|
+
},
|
|
24502
|
+
{
|
|
24503
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED,
|
|
24504
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24505
|
+
parentField: 'task_id',
|
|
24506
|
+
field: 'way_points',
|
|
24507
|
+
ignoreFields: ['way_points'],
|
|
24508
|
+
isDelete: false
|
|
24509
|
+
},
|
|
24510
|
+
{
|
|
24511
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED,
|
|
24512
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24513
|
+
parentField: 'task_id',
|
|
24514
|
+
field: 'way_points',
|
|
24515
|
+
ignoreFields: ['way_points'],
|
|
24516
|
+
isDelete: true
|
|
24517
|
+
}
|
|
24518
|
+
];
|
|
24519
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents(events, subEntityEvents);
|
|
24086
24520
|
};
|
|
24087
24521
|
TaskRealtimeSubscriptions.prototype.onCreate = function (callback) {
|
|
24088
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, callback);
|
|
24522
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, callback);
|
|
24089
24523
|
};
|
|
24090
24524
|
TaskRealtimeSubscriptions.prototype.onDelete = function (callback) {
|
|
24091
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, callback);
|
|
24525
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, callback);
|
|
24092
24526
|
};
|
|
24093
24527
|
TaskRealtimeSubscriptions.prototype.onWayPointUpdate = function (callback) {
|
|
24094
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED, callback);
|
|
24528
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED, callback);
|
|
24095
24529
|
};
|
|
24096
24530
|
TaskRealtimeSubscriptions.prototype.onWayPointDelete = function (callback) {
|
|
24097
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED, callback);
|
|
24531
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED, callback);
|
|
24098
24532
|
};
|
|
24099
24533
|
TaskRealtimeSubscriptions.prototype.onUpdate = function (callback) {
|
|
24100
|
-
|
|
24101
|
-
subscriptions.push(this.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, callback));
|
|
24102
|
-
return function () {
|
|
24103
|
-
var e_1, _a;
|
|
24104
|
-
try {
|
|
24105
|
-
for (var subscriptions_1 = __values(subscriptions), subscriptions_1_1 = subscriptions_1.next(); !subscriptions_1_1.done; subscriptions_1_1 = subscriptions_1.next()) {
|
|
24106
|
-
var subscription = subscriptions_1_1.value;
|
|
24107
|
-
subscription();
|
|
24108
|
-
}
|
|
24109
|
-
}
|
|
24110
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
24111
|
-
finally {
|
|
24112
|
-
try {
|
|
24113
|
-
if (subscriptions_1_1 && !subscriptions_1_1.done && (_a = subscriptions_1.return)) _a.call(subscriptions_1);
|
|
24114
|
-
}
|
|
24115
|
-
finally { if (e_1) throw e_1.error; }
|
|
24116
|
-
}
|
|
24117
|
-
};
|
|
24118
|
-
};
|
|
24119
|
-
TaskRealtimeSubscriptions.prototype.onEvent = function (event, callback) {
|
|
24120
|
-
var _this = this;
|
|
24121
|
-
if (!this.eventCallbacks[event]) {
|
|
24122
|
-
this.eventCallbacks[event] = [];
|
|
24123
|
-
}
|
|
24124
|
-
this.eventCallbacks[event].push(callback);
|
|
24125
|
-
return function () {
|
|
24126
|
-
var indexOfCallback = _this.eventCallbacks[event].indexOf(callback);
|
|
24127
|
-
_this.eventCallbacks[event].splice(indexOfCallback, 1);
|
|
24128
|
-
};
|
|
24129
|
-
};
|
|
24130
|
-
TaskRealtimeSubscriptions.prototype.runEventCallbacks = function (event, data) {
|
|
24131
|
-
(this.eventCallbacks[event] || []).forEach(function (callback) { return callback(data); });
|
|
24132
|
-
};
|
|
24133
|
-
TaskRealtimeSubscriptions.prototype.changeSubEntity = function (subEntity, containerField, isDelete) {
|
|
24134
|
-
var _a, _b, _c;
|
|
24135
|
-
if (isDelete === void 0) { isDelete = false; }
|
|
24136
|
-
var task = this.tasksStore.get(subEntity.task_id);
|
|
24137
|
-
var diff;
|
|
24138
|
-
if (task) {
|
|
24139
|
-
if (!task[containerField]) {
|
|
24140
|
-
task[containerField] = [];
|
|
24141
|
-
}
|
|
24142
|
-
var existingIndex = task[containerField].findIndex(function (taskSubEntity) { return taskSubEntity.id === subEntity.id; });
|
|
24143
|
-
if (existingIndex > -1) {
|
|
24144
|
-
if (isDelete) {
|
|
24145
|
-
diff = (_a = { id: task.id }, _a[containerField] = this.createArrayOfEmptyObjects(existingIndex), _a);
|
|
24146
|
-
for (var i = existingIndex + 1; i < task[containerField].length; i++) {
|
|
24147
|
-
diff[containerField].push(task[containerField][i]);
|
|
24148
|
-
}
|
|
24149
|
-
task[containerField].splice(existingIndex, 1);
|
|
24150
|
-
}
|
|
24151
|
-
else {
|
|
24152
|
-
var subEntityDiff = object_merger_1.objectMerger.deepMerge(task[containerField][existingIndex], subEntity);
|
|
24153
|
-
diff = (_b = {
|
|
24154
|
-
id: task.id
|
|
24155
|
-
},
|
|
24156
|
-
_b[containerField] = this.createArrayOfEmptyObjects(task[containerField].length),
|
|
24157
|
-
_b);
|
|
24158
|
-
diff[containerField][existingIndex] = subEntityDiff;
|
|
24159
|
-
}
|
|
24160
|
-
}
|
|
24161
|
-
else if (!isDelete) {
|
|
24162
|
-
diff = (_c = { id: task.id }, _c[containerField] = this.createArrayOfEmptyObjects(task[containerField].length), _c);
|
|
24163
|
-
diff[containerField].push(subEntity);
|
|
24164
|
-
task[containerField].push(subEntity);
|
|
24165
|
-
}
|
|
24166
|
-
}
|
|
24167
|
-
return { current: task, diff: diff };
|
|
24168
|
-
};
|
|
24169
|
-
TaskRealtimeSubscriptions.prototype.createArrayOfEmptyObjects = function (length) {
|
|
24170
|
-
return Array.from({ length: length }, function () { return ({}); });
|
|
24534
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, callback);
|
|
24171
24535
|
};
|
|
24172
24536
|
return TaskRealtimeSubscriptions;
|
|
24173
24537
|
}());
|
|
@@ -29135,11 +29499,11 @@ var UserPresetViewsApi = /** @class */ (function () {
|
|
|
29135
29499
|
this.loadAll = function () {
|
|
29136
29500
|
return _this.storableDataService.loadAll('loadAll', function () { return _this.userPresetViewsService.loadAll(); });
|
|
29137
29501
|
};
|
|
29138
|
-
this.update = function (
|
|
29502
|
+
this.update = function (body) { return __awaiter(_this, void 0, void 0, function () {
|
|
29139
29503
|
var result;
|
|
29140
29504
|
return __generator(this, function (_a) {
|
|
29141
29505
|
switch (_a.label) {
|
|
29142
|
-
case 0: return [4 /*yield*/, this.userPresetViewsService.update(
|
|
29506
|
+
case 0: return [4 /*yield*/, this.userPresetViewsService.update(body)];
|
|
29143
29507
|
case 1:
|
|
29144
29508
|
result = _a.sent();
|
|
29145
29509
|
this.userPresetViewsStore.set(result);
|
|
@@ -29162,7 +29526,8 @@ var UserPresetViewsApi = /** @class */ (function () {
|
|
|
29162
29526
|
keyFunc: function (userPresetView) { return userPresetView.view; }
|
|
29163
29527
|
}
|
|
29164
29528
|
];
|
|
29165
|
-
|
|
29529
|
+
// TODO: investigate how to turn items in DataStore in real observables
|
|
29530
|
+
this.userPresetViewsStore = new data_store_1.default(groupFilters);
|
|
29166
29531
|
this.userPresetViewsService = new user_preset_views_service_1.UserPresetViewsService(session);
|
|
29167
29532
|
this.storableDataService = new storable_data_service_1.default(this.userPresetViewsStore);
|
|
29168
29533
|
}
|
|
@@ -29288,11 +29653,15 @@ var UserPresetViewsService = /** @class */ (function () {
|
|
|
29288
29653
|
}
|
|
29289
29654
|
});
|
|
29290
29655
|
}); };
|
|
29291
|
-
this.update = function (
|
|
29656
|
+
this.update = function (body) { return __awaiter(_this, void 0, void 0, function () {
|
|
29292
29657
|
var result;
|
|
29293
29658
|
return __generator(this, function (_a) {
|
|
29294
29659
|
switch (_a.label) {
|
|
29295
|
-
case 0: return [4 /*yield*/, this.service.
|
|
29660
|
+
case 0: return [4 /*yield*/, this.service.routeGenerator
|
|
29661
|
+
.put("/".concat(this.service.entityName))
|
|
29662
|
+
.withPayload(body)
|
|
29663
|
+
.setException("Failed to update ".concat(this.service.entityName))
|
|
29664
|
+
.invoke()];
|
|
29296
29665
|
case 1:
|
|
29297
29666
|
result = _a.sent();
|
|
29298
29667
|
return [2 /*return*/, result];
|
|
@@ -29775,8 +30144,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29775
30144
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29776
30145
|
};
|
|
29777
30146
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
30147
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
29778
30148
|
var data_store_1 = __importDefault(__webpack_require__(73135));
|
|
29779
|
-
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
29780
30149
|
var storable_data_service_1 = __importDefault(__webpack_require__(45297));
|
|
29781
30150
|
var Vehicle_consts_1 = __webpack_require__(84010);
|
|
29782
30151
|
var vehicles_service_1 = __importDefault(__webpack_require__(87386));
|
|
@@ -29786,11 +30155,10 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29786
30155
|
{ groupType: Vehicle_consts_1.VehicleGroup.Team, keyFunc: function (vehicle) { return vehicle.team_id; } },
|
|
29787
30156
|
{ groupType: Vehicle_consts_1.VehicleGroup.IsTrailer, keyFunc: function (vehicle) { return !!vehicle.is_trailer; } }
|
|
29788
30157
|
];
|
|
29789
|
-
this.eventCallbacks = {};
|
|
29790
30158
|
this.vehiclesStore = new data_store_1.default(groupFilters);
|
|
29791
30159
|
this.vehiclesService = new vehicles_service_1.default(session);
|
|
29792
30160
|
this.storableDataService = new storable_data_service_1.default(this.vehiclesStore);
|
|
29793
|
-
this.
|
|
30161
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.vehiclesStore, this.storableDataService);
|
|
29794
30162
|
}
|
|
29795
30163
|
VehiclesApi.prototype.load = function (id, options) {
|
|
29796
30164
|
var _this = this;
|
|
@@ -29817,24 +30185,21 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29817
30185
|
return this.storableDataService.modify('create', function () { return _this.vehiclesService.create(vehicleData); });
|
|
29818
30186
|
};
|
|
29819
30187
|
VehiclesApi.prototype.updateStoreOnEvents = function () {
|
|
29820
|
-
|
|
29821
|
-
|
|
29822
|
-
|
|
29823
|
-
|
|
29824
|
-
});
|
|
29825
|
-
this.realtimeSubscriptions.subscribe(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, function (vehicle) {
|
|
29826
|
-
_this.storableDataService.removeFromStores(vehicle.id);
|
|
29827
|
-
_this.runEventCallbacks(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, vehicle);
|
|
29828
|
-
});
|
|
30188
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([
|
|
30189
|
+
{ name: Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, isDelete: false },
|
|
30190
|
+
{ name: Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, isDelete: true }
|
|
30191
|
+
]);
|
|
29829
30192
|
};
|
|
29830
30193
|
VehiclesApi.prototype.onUpdate = function (callback) {
|
|
29831
|
-
return this.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, callback);
|
|
30194
|
+
return this.storableRealtimeSubscriptions.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, function (item) { return callback(item.current); });
|
|
29832
30195
|
};
|
|
29833
30196
|
VehiclesApi.prototype.onDelete = function (callback) {
|
|
29834
|
-
return this.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, callback);
|
|
30197
|
+
return this.storableRealtimeSubscriptions.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, function (item) { return callback(item.current); });
|
|
29835
30198
|
};
|
|
29836
30199
|
VehiclesApi.prototype.onUnassigned = function (callback) {
|
|
29837
|
-
return this.
|
|
30200
|
+
return this.storableRealtimeSubscriptions.onAnyEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UNASSIGNED, function (vehicle) {
|
|
30201
|
+
return callback(vehicle);
|
|
30202
|
+
});
|
|
29838
30203
|
};
|
|
29839
30204
|
VehiclesApi.prototype.get = function (id) {
|
|
29840
30205
|
return this.vehiclesStore.get(id);
|
|
@@ -29874,20 +30239,6 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29874
30239
|
});
|
|
29875
30240
|
});
|
|
29876
30241
|
};
|
|
29877
|
-
VehiclesApi.prototype.runEventCallbacks = function (event, data) {
|
|
29878
|
-
(this.eventCallbacks[event] || []).forEach(function (callback) { return callback(data); });
|
|
29879
|
-
};
|
|
29880
|
-
VehiclesApi.prototype.onEvent = function (event, callback) {
|
|
29881
|
-
var _this = this;
|
|
29882
|
-
if (!this.eventCallbacks[event]) {
|
|
29883
|
-
this.eventCallbacks[event] = [];
|
|
29884
|
-
}
|
|
29885
|
-
this.eventCallbacks[event].push(callback);
|
|
29886
|
-
return function () {
|
|
29887
|
-
var indexOfCallback = _this.eventCallbacks[event].indexOf(callback);
|
|
29888
|
-
_this.eventCallbacks[event].splice(indexOfCallback, 1);
|
|
29889
|
-
};
|
|
29890
|
-
};
|
|
29891
30242
|
return VehiclesApi;
|
|
29892
30243
|
}());
|
|
29893
30244
|
exports["default"] = VehiclesApi;
|
|
@@ -31563,6 +31914,17 @@ exports["default"] = RealtimeSubscriptions;
|
|
|
31563
31914
|
|
|
31564
31915
|
"use strict";
|
|
31565
31916
|
|
|
31917
|
+
var __assign = (this && this.__assign) || function () {
|
|
31918
|
+
__assign = Object.assign || function(t) {
|
|
31919
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31920
|
+
s = arguments[i];
|
|
31921
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
31922
|
+
t[p] = s[p];
|
|
31923
|
+
}
|
|
31924
|
+
return t;
|
|
31925
|
+
};
|
|
31926
|
+
return __assign.apply(this, arguments);
|
|
31927
|
+
};
|
|
31566
31928
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31567
31929
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
31568
31930
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -31637,7 +31999,7 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31637
31999
|
return [4 /*yield*/, loadFunc(loadFnIdsParams)];
|
|
31638
32000
|
case 1:
|
|
31639
32001
|
items = _a.sent();
|
|
31640
|
-
mappedItems_1 = items.map(function (item) { return _this.mapper(item, action); });
|
|
32002
|
+
mappedItems_1 = items.map(function (item) { return _this.mapper(item, { action: action }); });
|
|
31641
32003
|
if (options.groupType) {
|
|
31642
32004
|
this.dataStore.setGroup(options.groupType, groupValue, mappedItems_1);
|
|
31643
32005
|
}
|
|
@@ -31665,7 +32027,7 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31665
32027
|
return [4 /*yield*/, loadFunc(ids)];
|
|
31666
32028
|
case 1:
|
|
31667
32029
|
items = _a.sent();
|
|
31668
|
-
mappedItems_2 = items.map(function (item) { return _this.mapper(item, action); });
|
|
32030
|
+
mappedItems_2 = items.map(function (item) { return _this.mapper(item, { action: action }); });
|
|
31669
32031
|
this.dataStore.setMany(mappedItems_2);
|
|
31670
32032
|
this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(mappedItems_2, options.fields); });
|
|
31671
32033
|
return [2 /*return*/, mappedItems_2.map(function (mappedItems) { return mappedItems.current; })];
|
|
@@ -31762,13 +32124,13 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31762
32124
|
});
|
|
31763
32125
|
});
|
|
31764
32126
|
};
|
|
31765
|
-
StorableDataService.prototype.updateInStores = function (item, action, fields) {
|
|
31766
|
-
return this.updateManyInStores([item], action, fields)[0];
|
|
32127
|
+
StorableDataService.prototype.updateInStores = function (item, action, fields, extraMapperParams) {
|
|
32128
|
+
return this.updateManyInStores([item], action, fields, extraMapperParams)[0];
|
|
31767
32129
|
};
|
|
31768
|
-
StorableDataService.prototype.updateManyInStores = function (items, action, fields) {
|
|
32130
|
+
StorableDataService.prototype.updateManyInStores = function (items, action, fields, extraMapperParams) {
|
|
31769
32131
|
var _this = this;
|
|
31770
32132
|
return (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {
|
|
31771
|
-
var clientItems = items.map(function (item) { return _this.mapper(item, action); });
|
|
32133
|
+
var clientItems = items.map(function (item) { return _this.mapper(item, __assign({ action: action }, extraMapperParams)); });
|
|
31772
32134
|
_this.dataStore.setMany(clientItems);
|
|
31773
32135
|
_this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(clientItems, fields); });
|
|
31774
32136
|
return clientItems;
|
|
@@ -34893,7 +35255,18 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
34893
35255
|
"use strict";
|
|
34894
35256
|
|
|
34895
35257
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34896
|
-
exports.PlannedTasksFilterOptions = exports.UnassignedFilterOptions = exports.ReadyForPickupFilterOptions = void 0;
|
|
35258
|
+
exports.PlannedTasksFilterOptions = exports.UnassignedFilterOptions = exports.ReadyForPickupFilterOptions = exports.GroupMode = void 0;
|
|
35259
|
+
var GroupMode;
|
|
35260
|
+
(function (GroupMode) {
|
|
35261
|
+
GroupMode["Driver"] = "Driver";
|
|
35262
|
+
GroupMode["Fleet"] = "Fleet";
|
|
35263
|
+
GroupMode["FleetTeam"] = "FleetTeam";
|
|
35264
|
+
GroupMode["None"] = "None";
|
|
35265
|
+
GroupMode["Route"] = "Route";
|
|
35266
|
+
GroupMode["Team"] = "Team";
|
|
35267
|
+
GroupMode["TeamDriver"] = "TeamDriver";
|
|
35268
|
+
GroupMode["TeamRoute"] = "TeamRoute";
|
|
35269
|
+
})(GroupMode || (exports.GroupMode = GroupMode = {}));
|
|
34897
35270
|
var ReadyForPickupFilterOptions;
|
|
34898
35271
|
(function (ReadyForPickupFilterOptions) {
|
|
34899
35272
|
ReadyForPickupFilterOptions[ReadyForPickupFilterOptions["NOT_READY_FOR_PICKUP"] = 1] = "NOT_READY_FOR_PICKUP";
|