@bringg/dashboard-sdk 8.30.1-pre.3 → 9.1.0-pre.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/OptimizationConfigurationV2/OptimizationConfigurationV2.d.ts +0 -1
- package/dist/OptimizationConfigurationV2/OptimizationConfigurationV2.js +0 -3
- package/dist/OptimizationConfigurationV2/OptimizationConfigurationV2.js.map +1 -1
- package/dist/OptimizationConfigurationV2/Service/OptimizationConfigurations.service.d.ts +0 -1
- package/dist/OptimizationConfigurationV2/Service/OptimizationConfigurations.service.js +0 -7
- package/dist/OptimizationConfigurationV2/Service/OptimizationConfigurations.service.js.map +1 -1
- 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 +760 -397
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +40 -40
- 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
|
|
|
@@ -14479,9 +14635,6 @@ var OptimizationConfigurationV2 = /** @class */ (function () {
|
|
|
14479
14635
|
OptimizationConfigurationV2.prototype.delete = function (id) {
|
|
14480
14636
|
return this.optimizationConfigurationService.delete(id);
|
|
14481
14637
|
};
|
|
14482
|
-
OptimizationConfigurationV2.prototype.getConfigurationAttributes = function () {
|
|
14483
|
-
return this.optimizationConfigurationService.getConfigurationAttributes();
|
|
14484
|
-
};
|
|
14485
14638
|
OptimizationConfigurationV2.prototype.batchDelete = function (configurationIds) {
|
|
14486
14639
|
return this.optimizationConfigurationService.batchDelete(configurationIds);
|
|
14487
14640
|
};
|
|
@@ -14612,13 +14765,6 @@ var OptimizationConfigurationsEntity = /** @class */ (function (_super) {
|
|
|
14612
14765
|
});
|
|
14613
14766
|
});
|
|
14614
14767
|
};
|
|
14615
|
-
OptimizationConfigurationsEntity.prototype.getConfigurationAttributes = function () {
|
|
14616
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
14617
|
-
return __generator(this, function (_a) {
|
|
14618
|
-
return [2 /*return*/, this.routeGenerator.get(Routes.GET_CONFIGURATION_ATTRIBUTES).invoke()];
|
|
14619
|
-
});
|
|
14620
|
-
});
|
|
14621
|
-
};
|
|
14622
14768
|
OptimizationConfigurationsEntity.prototype.batchDelete = function (configurationIds) {
|
|
14623
14769
|
return __awaiter(this, void 0, void 0, function () {
|
|
14624
14770
|
return __generator(this, function (_a) {
|
|
@@ -17704,21 +17850,6 @@ var OptimizationEvents;
|
|
|
17704
17850
|
|
|
17705
17851
|
"use strict";
|
|
17706
17852
|
|
|
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
17853
|
var __assign = (this && this.__assign) || function () {
|
|
17723
17854
|
__assign = Object.assign || function(t) {
|
|
17724
17855
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -17730,30 +17861,78 @@ var __assign = (this && this.__assign) || function () {
|
|
|
17730
17861
|
};
|
|
17731
17862
|
return __assign.apply(this, arguments);
|
|
17732
17863
|
};
|
|
17864
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17865
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17866
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17867
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17868
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17869
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17870
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17871
|
+
});
|
|
17872
|
+
};
|
|
17873
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
17874
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17875
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17876
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17877
|
+
function step(op) {
|
|
17878
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17879
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17880
|
+
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;
|
|
17881
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
17882
|
+
switch (op[0]) {
|
|
17883
|
+
case 0: case 1: t = op; break;
|
|
17884
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
17885
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
17886
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
17887
|
+
default:
|
|
17888
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
17889
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
17890
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
17891
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
17892
|
+
if (t[2]) _.ops.pop();
|
|
17893
|
+
_.trys.pop(); continue;
|
|
17894
|
+
}
|
|
17895
|
+
op = body.call(thisArg, _);
|
|
17896
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
17897
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
17898
|
+
}
|
|
17899
|
+
};
|
|
17900
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
17901
|
+
var t = {};
|
|
17902
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17903
|
+
t[p] = s[p];
|
|
17904
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17905
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17906
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17907
|
+
t[p[i]] = s[p[i]];
|
|
17908
|
+
}
|
|
17909
|
+
return t;
|
|
17910
|
+
};
|
|
17911
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17912
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17913
|
+
};
|
|
17733
17914
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17734
17915
|
var BringgException_1 = __webpack_require__(43605);
|
|
17916
|
+
var CrudService_1 = __importDefault(__webpack_require__(14809));
|
|
17735
17917
|
var RouteGenerator_1 = __webpack_require__(84075);
|
|
17736
17918
|
var Route_1 = __webpack_require__(92641);
|
|
17737
|
-
var
|
|
17738
|
-
var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
17739
|
-
__extends(RouteOptimizationApi, _super);
|
|
17919
|
+
var RouteOptimizationApi = /** @class */ (function () {
|
|
17740
17920
|
function RouteOptimizationApi(session) {
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17752
|
-
return _this;
|
|
17921
|
+
this.optimization = new Route_1.Route('/route_optimizations/optimize', 1 /* HttpMethod.POST */);
|
|
17922
|
+
this.optimization_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/optimize', 1 /* HttpMethod.POST */);
|
|
17923
|
+
this.get_optimization_result = new Route_1.Route('/route_optimizations/get_optimization_result/{:request_uuid}', 0 /* HttpMethod.GET */);
|
|
17924
|
+
this.get_optimization_result_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/get_optimization_result/{:request_uuid}', 0 /* HttpMethod.GET */);
|
|
17925
|
+
this.cancel_requests = new Route_1.Route('/route_optimizations/optimization', 4 /* HttpMethod.DELETE */);
|
|
17926
|
+
this.cancel_requests_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/optimization', 4 /* HttpMethod.DELETE */);
|
|
17927
|
+
this.assign_users_by_ids = new Route_1.Route('/route_optimizations/assign_users_by_ids', 1 /* HttpMethod.POST */);
|
|
17928
|
+
this.update_user_modified_data = new Route_1.Route('/route_optimizations/update_user_modified_data', 1 /* HttpMethod.POST */);
|
|
17929
|
+
this.update_user_modified_data_v2 = new Route_1.Route('/own-fleet-optimization-service/route_optimization/update_user_modified_data', 1 /* HttpMethod.POST */);
|
|
17930
|
+
this.assign_user_manual_optimization = new Route_1.Route('/route_optimizations/assign_user_manual_optimization', 1 /* HttpMethod.POST */);
|
|
17931
|
+
this.service = new CrudService_1.default(session, '');
|
|
17753
17932
|
}
|
|
17754
17933
|
RouteOptimizationApi.prototype.cancelRequests = function (requestUuids, v2) {
|
|
17755
17934
|
if (v2 === void 0) { v2 = false; }
|
|
17756
|
-
return this.handleAuthorizedRequest({
|
|
17935
|
+
return this.service.handleAuthorizedRequest({
|
|
17757
17936
|
route: v2 ? this.cancel_requests_v2 : this.cancel_requests,
|
|
17758
17937
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17759
17938
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to call cancel optimization requests'),
|
|
@@ -17762,7 +17941,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17762
17941
|
};
|
|
17763
17942
|
RouteOptimizationApi.prototype.optimize = function (optimizationProps, v2) {
|
|
17764
17943
|
if (v2 === void 0) { v2 = false; }
|
|
17765
|
-
return this.handleAuthorizedRequest({
|
|
17944
|
+
return this.service.handleAuthorizedRequest({
|
|
17766
17945
|
route: v2 ? this.optimization_v2 : this.optimization,
|
|
17767
17946
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17768
17947
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to call optimization requests'),
|
|
@@ -17771,7 +17950,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17771
17950
|
};
|
|
17772
17951
|
RouteOptimizationApi.prototype.optimizationResult = function (request_uuid, v2) {
|
|
17773
17952
|
if (v2 === void 0) { v2 = false; }
|
|
17774
|
-
return this.handleAuthorizedRequest({
|
|
17953
|
+
return this.service.handleAuthorizedRequest({
|
|
17775
17954
|
route: v2 ? this.get_optimization_result_v2 : this.get_optimization_result,
|
|
17776
17955
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17777
17956
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get optimization results'),
|
|
@@ -17779,7 +17958,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17779
17958
|
});
|
|
17780
17959
|
};
|
|
17781
17960
|
RouteOptimizationApi.prototype.assignUsersByIds = function (teams) {
|
|
17782
|
-
return this.handleAuthorizedRequest({
|
|
17961
|
+
return this.service.handleAuthorizedRequest({
|
|
17783
17962
|
route: this.assign_users_by_ids,
|
|
17784
17963
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17785
17964
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign users by id'),
|
|
@@ -17788,7 +17967,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17788
17967
|
};
|
|
17789
17968
|
RouteOptimizationApi.prototype.updateOptimizationModifiedData = function (updateData, v2) {
|
|
17790
17969
|
if (v2 === void 0) { v2 = false; }
|
|
17791
|
-
return this.handleAuthorizedRequest({
|
|
17970
|
+
return this.service.handleAuthorizedRequest({
|
|
17792
17971
|
route: v2 ? this.update_user_modified_data_v2 : this.update_user_modified_data,
|
|
17793
17972
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17794
17973
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to update optimization user data'),
|
|
@@ -17797,7 +17976,7 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17797
17976
|
};
|
|
17798
17977
|
RouteOptimizationApi.prototype.assignUserManualOptimization = function (updateData) {
|
|
17799
17978
|
var fiveMinutesInMs = 1000 * 60 * 5;
|
|
17800
|
-
return this.handleAuthorizedRequest({
|
|
17979
|
+
return this.service.handleAuthorizedRequest({
|
|
17801
17980
|
route: this.assign_user_manual_optimization,
|
|
17802
17981
|
extractor: RouteGenerator_1.defaultExtractor,
|
|
17803
17982
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign user manual optimization data'),
|
|
@@ -17805,8 +17984,40 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
17805
17984
|
timeout: fiveMinutesInMs
|
|
17806
17985
|
});
|
|
17807
17986
|
};
|
|
17987
|
+
RouteOptimizationApi.prototype.calculatePlannedEta = function (data, _a) {
|
|
17988
|
+
if (_a === void 0) { _a = {}; }
|
|
17989
|
+
var _b = _a.timeout, timeout = _b === void 0 ? 10000 : _b, options = __rest(_a, ["timeout"]);
|
|
17990
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17991
|
+
var payload, result, asyncResult;
|
|
17992
|
+
return __generator(this, function (_c) {
|
|
17993
|
+
switch (_c.label) {
|
|
17994
|
+
case 0:
|
|
17995
|
+
payload = {
|
|
17996
|
+
team_id: data.team_id,
|
|
17997
|
+
data: __assign(__assign({}, data), { deadline: Date.now() + timeout })
|
|
17998
|
+
};
|
|
17999
|
+
return [4 /*yield*/, this.service.routeGenerator
|
|
18000
|
+
.post('/own-fleet-optimization-service/route_optimization/calculate_planned_eta')
|
|
18001
|
+
.withPayload(payload)
|
|
18002
|
+
.setException('Failed to calculate planned eta')
|
|
18003
|
+
.withCommonOptions(options)
|
|
18004
|
+
.invoke()];
|
|
18005
|
+
case 1:
|
|
18006
|
+
result = _c.sent();
|
|
18007
|
+
return [4 /*yield*/, this.service.session.sdk.asyncOperationStatus.waitForResponse({
|
|
18008
|
+
requestId: result.uuid,
|
|
18009
|
+
timeoutInMs: timeout,
|
|
18010
|
+
signal: options.signal
|
|
18011
|
+
})];
|
|
18012
|
+
case 2:
|
|
18013
|
+
asyncResult = _c.sent();
|
|
18014
|
+
return [2 /*return*/, asyncResult.data];
|
|
18015
|
+
}
|
|
18016
|
+
});
|
|
18017
|
+
});
|
|
18018
|
+
};
|
|
17808
18019
|
return RouteOptimizationApi;
|
|
17809
|
-
}(
|
|
18020
|
+
}());
|
|
17810
18021
|
exports["default"] = RouteOptimizationApi;
|
|
17811
18022
|
//# sourceMappingURL=RouteOptimizationApi.js.map
|
|
17812
18023
|
|
|
@@ -18072,21 +18283,6 @@ exports["default"] = Rules;
|
|
|
18072
18283
|
|
|
18073
18284
|
"use strict";
|
|
18074
18285
|
|
|
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
18286
|
var __assign = (this && this.__assign) || function () {
|
|
18091
18287
|
__assign = Object.assign || function(t) {
|
|
18092
18288
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -18134,11 +18330,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
18134
18330
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
18135
18331
|
}
|
|
18136
18332
|
};
|
|
18333
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18334
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18335
|
+
};
|
|
18137
18336
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
18138
18337
|
exports.RunsService = exports.Routes = void 0;
|
|
18139
18338
|
var BringgException_1 = __webpack_require__(43605);
|
|
18339
|
+
var CrudService_1 = __importDefault(__webpack_require__(14809));
|
|
18140
18340
|
var Route_1 = __webpack_require__(92641);
|
|
18141
|
-
var SessionBasedService_1 = __webpack_require__(27826);
|
|
18142
18341
|
var array_utils_1 = __webpack_require__(43052);
|
|
18143
18342
|
var runs_consts_1 = __webpack_require__(4669);
|
|
18144
18343
|
exports.Routes = {
|
|
@@ -18157,27 +18356,23 @@ exports.Routes = {
|
|
|
18157
18356
|
ASSIGN_VEHICLES: new Route_1.Route('/runs/{:id}/vehicles_assignment', 3 /* HttpMethod.PATCH */),
|
|
18158
18357
|
UNASSIGN_VEHICLES: new Route_1.Route('/runs/{:id}/vehicles_assignment', 4 /* HttpMethod.DELETE */)
|
|
18159
18358
|
};
|
|
18160
|
-
var RunsService = /** @class */ (function (
|
|
18161
|
-
__extends(RunsService, _super);
|
|
18359
|
+
var RunsService = /** @class */ (function () {
|
|
18162
18360
|
function RunsService(session) {
|
|
18163
|
-
|
|
18361
|
+
this.service = new CrudService_1.default(session, 'runs');
|
|
18164
18362
|
}
|
|
18165
18363
|
RunsService.prototype.getAll = function (options, _a) {
|
|
18166
18364
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18167
18365
|
return __awaiter(this, void 0, void 0, function () {
|
|
18168
|
-
var runsResponse;
|
|
18169
18366
|
return __generator(this, function (_c) {
|
|
18170
18367
|
switch (_c.label) {
|
|
18171
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18368
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18172
18369
|
route: exports.Routes.GET_RUNS,
|
|
18173
18370
|
extractor: runs_consts_1.defaultExtractor,
|
|
18174
18371
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get Runs'),
|
|
18175
18372
|
queryString: options,
|
|
18176
18373
|
signal: signal
|
|
18177
18374
|
})];
|
|
18178
|
-
case 1:
|
|
18179
|
-
runsResponse = _c.sent();
|
|
18180
|
-
return [2 /*return*/, runsResponse];
|
|
18375
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
18181
18376
|
}
|
|
18182
18377
|
});
|
|
18183
18378
|
});
|
|
@@ -18187,7 +18382,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18187
18382
|
return __awaiter(this, void 0, void 0, function () {
|
|
18188
18383
|
return __generator(this, function (_c) {
|
|
18189
18384
|
switch (_c.label) {
|
|
18190
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18385
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18191
18386
|
route: exports.Routes.GET_RUN_DATA,
|
|
18192
18387
|
extractor: runs_consts_1.defaultExtractor,
|
|
18193
18388
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get routes data'),
|
|
@@ -18262,22 +18457,19 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18262
18457
|
});
|
|
18263
18458
|
});
|
|
18264
18459
|
};
|
|
18265
|
-
RunsService.prototype.
|
|
18460
|
+
RunsService.prototype.load = function (id, _a) {
|
|
18266
18461
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18267
18462
|
return __awaiter(this, void 0, void 0, function () {
|
|
18268
|
-
var run;
|
|
18269
18463
|
return __generator(this, function (_c) {
|
|
18270
18464
|
switch (_c.label) {
|
|
18271
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18465
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18272
18466
|
route: exports.Routes.GET_RUN,
|
|
18273
18467
|
extractor: runs_consts_1.runExtractor,
|
|
18274
18468
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get Run'),
|
|
18275
18469
|
routeParams: { id: id },
|
|
18276
18470
|
signal: signal
|
|
18277
18471
|
})];
|
|
18278
|
-
case 1:
|
|
18279
|
-
run = _c.sent();
|
|
18280
|
-
return [2 /*return*/, run];
|
|
18472
|
+
case 1: return [2 /*return*/, _c.sent()];
|
|
18281
18473
|
}
|
|
18282
18474
|
});
|
|
18283
18475
|
});
|
|
@@ -18285,9 +18477,10 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18285
18477
|
RunsService.prototype.update = function (id, options, _a) {
|
|
18286
18478
|
var _b = _a === void 0 ? {} : _a, signal = _b.signal;
|
|
18287
18479
|
return __awaiter(this, void 0, void 0, function () {
|
|
18480
|
+
var response;
|
|
18288
18481
|
return __generator(this, function (_c) {
|
|
18289
18482
|
switch (_c.label) {
|
|
18290
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18483
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18291
18484
|
route: exports.Routes.UPDATE_RUN,
|
|
18292
18485
|
extractor: runs_consts_1.defaultExtractor,
|
|
18293
18486
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to update Run'),
|
|
@@ -18295,7 +18488,9 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18295
18488
|
routeParams: { id: id },
|
|
18296
18489
|
signal: signal
|
|
18297
18490
|
})];
|
|
18298
|
-
case 1:
|
|
18491
|
+
case 1:
|
|
18492
|
+
response = _c.sent();
|
|
18493
|
+
return [2 /*return*/, response.run];
|
|
18299
18494
|
}
|
|
18300
18495
|
});
|
|
18301
18496
|
});
|
|
@@ -18306,7 +18501,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18306
18501
|
var runHistory;
|
|
18307
18502
|
return __generator(this, function (_c) {
|
|
18308
18503
|
switch (_c.label) {
|
|
18309
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18504
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18310
18505
|
route: exports.Routes.GET_RUN_HISTORY,
|
|
18311
18506
|
extractor: runs_consts_1.runsHistoryExtractor,
|
|
18312
18507
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run history'),
|
|
@@ -18326,7 +18521,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18326
18521
|
var runLocations;
|
|
18327
18522
|
return __generator(this, function (_c) {
|
|
18328
18523
|
switch (_c.label) {
|
|
18329
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18524
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18330
18525
|
route: exports.Routes.GET_RUN_LOCATIONS,
|
|
18331
18526
|
extractor: runs_consts_1.runsLocationsExtractor,
|
|
18332
18527
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run locations'),
|
|
@@ -18346,7 +18541,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18346
18541
|
var runLocations;
|
|
18347
18542
|
return __generator(this, function (_c) {
|
|
18348
18543
|
switch (_c.label) {
|
|
18349
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18544
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18350
18545
|
route: exports.Routes.GET_RUN_CASHOUT,
|
|
18351
18546
|
extractor: runs_consts_1.runCashoutExtractor,
|
|
18352
18547
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get run cashout'),
|
|
@@ -18366,7 +18561,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18366
18561
|
var response;
|
|
18367
18562
|
return __generator(this, function (_c) {
|
|
18368
18563
|
switch (_c.label) {
|
|
18369
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18564
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18370
18565
|
route: exports.Routes.ASSIGN_DRIVER,
|
|
18371
18566
|
extractor: runs_consts_1.defaultExtractor,
|
|
18372
18567
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign driver to run'),
|
|
@@ -18387,7 +18582,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18387
18582
|
var response;
|
|
18388
18583
|
return __generator(this, function (_c) {
|
|
18389
18584
|
switch (_c.label) {
|
|
18390
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18585
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18391
18586
|
route: exports.Routes.UNASSIGN_DRIVER,
|
|
18392
18587
|
extractor: runs_consts_1.defaultExtractor,
|
|
18393
18588
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign driver to run'),
|
|
@@ -18408,7 +18603,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18408
18603
|
var response;
|
|
18409
18604
|
return __generator(this, function (_c) {
|
|
18410
18605
|
switch (_c.label) {
|
|
18411
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18606
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18412
18607
|
route: exports.Routes.ASSIGN_VEHICLES,
|
|
18413
18608
|
extractor: runs_consts_1.defaultExtractor,
|
|
18414
18609
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to assign vehicles to run'),
|
|
@@ -18429,7 +18624,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18429
18624
|
var response;
|
|
18430
18625
|
return __generator(this, function (_c) {
|
|
18431
18626
|
switch (_c.label) {
|
|
18432
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18627
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18433
18628
|
route: exports.Routes.UNASSIGN_VEHICLES,
|
|
18434
18629
|
extractor: runs_consts_1.defaultExtractor,
|
|
18435
18630
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to unassign vehicles from run'),
|
|
@@ -18450,7 +18645,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18450
18645
|
var runBulkClose;
|
|
18451
18646
|
return __generator(this, function (_c) {
|
|
18452
18647
|
switch (_c.label) {
|
|
18453
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18648
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18454
18649
|
route: exports.Routes.BULK_CLOSE,
|
|
18455
18650
|
extractor: runs_consts_1.defaultExtractor,
|
|
18456
18651
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to bulk close runs'),
|
|
@@ -18470,7 +18665,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18470
18665
|
var markDonePlanning;
|
|
18471
18666
|
return __generator(this, function (_c) {
|
|
18472
18667
|
switch (_c.label) {
|
|
18473
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18668
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18474
18669
|
route: exports.Routes.MARK_DONE_PLANNING,
|
|
18475
18670
|
extractor: runs_consts_1.defaultExtractor,
|
|
18476
18671
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to mark done planning for runs'),
|
|
@@ -18490,7 +18685,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18490
18685
|
var actualBreaksByRunIdResponse;
|
|
18491
18686
|
return __generator(this, function (_c) {
|
|
18492
18687
|
switch (_c.label) {
|
|
18493
|
-
case 0: return [4 /*yield*/, this.handleAuthorizedRequest({
|
|
18688
|
+
case 0: return [4 /*yield*/, this.service.handleAuthorizedRequest({
|
|
18494
18689
|
route: exports.Routes.GET_ACTUAL_BREAKS,
|
|
18495
18690
|
extractor: runs_consts_1.defaultExtractor,
|
|
18496
18691
|
exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get actual breaks of runs'),
|
|
@@ -18507,7 +18702,7 @@ var RunsService = /** @class */ (function (_super) {
|
|
|
18507
18702
|
});
|
|
18508
18703
|
};
|
|
18509
18704
|
return RunsService;
|
|
18510
|
-
}(
|
|
18705
|
+
}());
|
|
18511
18706
|
exports.RunsService = RunsService;
|
|
18512
18707
|
//# sourceMappingURL=runs.service.js.map
|
|
18513
18708
|
|
|
@@ -18561,7 +18756,6 @@ var RunStore = /** @class */ (function (_super) {
|
|
|
18561
18756
|
_this.updateRun = function (payload) {
|
|
18562
18757
|
return _this.createOrUpdateRun(payload, _this.onUpdate.bind(_this));
|
|
18563
18758
|
};
|
|
18564
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
18565
18759
|
_this.createOrUpdateRun = function (payload, callback) {
|
|
18566
18760
|
var existingRunModel = _this.store.getItem(payload.run.id);
|
|
18567
18761
|
var updatedRunModel = { id: payload.run.id, run: payload.run, taskIds: undefined };
|
|
@@ -18697,7 +18891,7 @@ exports["default"] = RunStore;
|
|
|
18697
18891
|
"use strict";
|
|
18698
18892
|
|
|
18699
18893
|
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;
|
|
18894
|
+
exports.GetAllChunkSize = exports.defaultExtractor = exports.runCashoutExtractor = exports.runsLocationsExtractor = exports.runsHistoryExtractor = exports.runExtractor = exports.RunGroupTypes = exports.RunEvents = exports.RunStatus = void 0;
|
|
18701
18895
|
var RunStatus;
|
|
18702
18896
|
(function (RunStatus) {
|
|
18703
18897
|
RunStatus["ALL"] = "all";
|
|
@@ -18710,6 +18904,10 @@ var RunEvents;
|
|
|
18710
18904
|
RunEvents["DELETED"] = "run deleted";
|
|
18711
18905
|
RunEvents["CREATED"] = "run created";
|
|
18712
18906
|
})(RunEvents = exports.RunEvents || (exports.RunEvents = {}));
|
|
18907
|
+
var RunGroupTypes;
|
|
18908
|
+
(function (RunGroupTypes) {
|
|
18909
|
+
RunGroupTypes["TaskIds"] = "taskIds";
|
|
18910
|
+
})(RunGroupTypes = exports.RunGroupTypes || (exports.RunGroupTypes = {}));
|
|
18713
18911
|
var runExtractor = function (response) { return response.run; };
|
|
18714
18912
|
exports.runExtractor = runExtractor;
|
|
18715
18913
|
var runsHistoryExtractor = function (response) { return response; };
|
|
@@ -18860,7 +19058,7 @@ var Runs = /** @class */ (function () {
|
|
|
18860
19058
|
var run;
|
|
18861
19059
|
return __generator(this, function (_a) {
|
|
18862
19060
|
switch (_a.label) {
|
|
18863
|
-
case 0: return [4 /*yield*/, this.runsService.
|
|
19061
|
+
case 0: return [4 /*yield*/, this.runsService.load(id, commonOptions)];
|
|
18864
19062
|
case 1:
|
|
18865
19063
|
run = _a.sent();
|
|
18866
19064
|
return [2 /*return*/, this.runStore.set(run)];
|
|
@@ -18873,7 +19071,7 @@ var Runs = /** @class */ (function () {
|
|
|
18873
19071
|
return __awaiter(this, void 0, void 0, function () {
|
|
18874
19072
|
return __generator(this, function (_a) {
|
|
18875
19073
|
switch (_a.label) {
|
|
18876
|
-
case 0: return [4 /*yield*/, this.runsService.
|
|
19074
|
+
case 0: return [4 /*yield*/, this.runsService.load(id, commonOptions)];
|
|
18877
19075
|
case 1: return [2 /*return*/, _a.sent()];
|
|
18878
19076
|
}
|
|
18879
19077
|
});
|
|
@@ -19018,7 +19216,169 @@ exports["default"] = Runs;
|
|
|
19018
19216
|
|
|
19019
19217
|
/***/ }),
|
|
19020
19218
|
|
|
19021
|
-
/***/
|
|
19219
|
+
/***/ 30196:
|
|
19220
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
19221
|
+
|
|
19222
|
+
"use strict";
|
|
19223
|
+
|
|
19224
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
19225
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19226
|
+
if (!m) return o;
|
|
19227
|
+
var i = m.call(o), r, ar = [], e;
|
|
19228
|
+
try {
|
|
19229
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19230
|
+
}
|
|
19231
|
+
catch (error) { e = { error: error }; }
|
|
19232
|
+
finally {
|
|
19233
|
+
try {
|
|
19234
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
19235
|
+
}
|
|
19236
|
+
finally { if (e) throw e.error; }
|
|
19237
|
+
}
|
|
19238
|
+
return ar;
|
|
19239
|
+
};
|
|
19240
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19241
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19242
|
+
if (ar || !(i in from)) {
|
|
19243
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
19244
|
+
ar[i] = from[i];
|
|
19245
|
+
}
|
|
19246
|
+
}
|
|
19247
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
19248
|
+
};
|
|
19249
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19250
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19251
|
+
};
|
|
19252
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19253
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
19254
|
+
var Tasks_consts_1 = __webpack_require__(24976);
|
|
19255
|
+
var runs_consts_1 = __webpack_require__(4669);
|
|
19256
|
+
var RunRealtimeSubscriptions = /** @class */ (function () {
|
|
19257
|
+
function RunRealtimeSubscriptions(session, runsStore, storableDataService) {
|
|
19258
|
+
var _this = this;
|
|
19259
|
+
this.runsStore = runsStore;
|
|
19260
|
+
this.storableDataService = storableDataService;
|
|
19261
|
+
this.updateTaskIdsOnDelete = function (task) {
|
|
19262
|
+
var existingRun = _this.runsStore.get(task.run_id);
|
|
19263
|
+
if (!existingRun) {
|
|
19264
|
+
return;
|
|
19265
|
+
}
|
|
19266
|
+
var updatedTaskIds = new Set(existingRun.task_ids);
|
|
19267
|
+
updatedTaskIds.delete(task.id);
|
|
19268
|
+
_this.updateRunInStore(existingRun, updatedTaskIds);
|
|
19269
|
+
};
|
|
19270
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, runsStore, storableDataService);
|
|
19271
|
+
this.taskIdsWaitingForRun = new Map();
|
|
19272
|
+
}
|
|
19273
|
+
RunRealtimeSubscriptions.prototype.updateStoreOnEvents = function () {
|
|
19274
|
+
var runExtractor = function (_a) {
|
|
19275
|
+
var run = _a.run;
|
|
19276
|
+
return run;
|
|
19277
|
+
};
|
|
19278
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([
|
|
19279
|
+
{
|
|
19280
|
+
name: runs_consts_1.RunEvents.CREATED,
|
|
19281
|
+
isDelete: false,
|
|
19282
|
+
extraDataFunc: this.addTaskIdsOnCreateOrUpdate.bind(this),
|
|
19283
|
+
itemExtractor: runExtractor
|
|
19284
|
+
},
|
|
19285
|
+
{
|
|
19286
|
+
name: runs_consts_1.RunEvents.UPDATED,
|
|
19287
|
+
isDelete: false,
|
|
19288
|
+
extraDataFunc: this.addTaskIdsOnCreateOrUpdate.bind(this),
|
|
19289
|
+
itemExtractor: runExtractor
|
|
19290
|
+
},
|
|
19291
|
+
{ name: runs_consts_1.RunEvents.DELETED, isDelete: true }
|
|
19292
|
+
]);
|
|
19293
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, this.updateTaskIdsOnDelete.bind(this));
|
|
19294
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, this.updateTaskIds.bind(this));
|
|
19295
|
+
this.storableRealtimeSubscriptions.onAnyEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, this.updateTaskIds.bind(this));
|
|
19296
|
+
};
|
|
19297
|
+
RunRealtimeSubscriptions.prototype.onUpdate = function (callback) {
|
|
19298
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.UPDATED, callback);
|
|
19299
|
+
};
|
|
19300
|
+
RunRealtimeSubscriptions.prototype.onDelete = function (callback) {
|
|
19301
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.DELETED, callback);
|
|
19302
|
+
};
|
|
19303
|
+
RunRealtimeSubscriptions.prototype.onCreate = function (callback) {
|
|
19304
|
+
return this.storableRealtimeSubscriptions.onEvent(runs_consts_1.RunEvents.CREATED, callback);
|
|
19305
|
+
};
|
|
19306
|
+
RunRealtimeSubscriptions.prototype.addTaskIdsOnCreateOrUpdate = function (run) {
|
|
19307
|
+
if (run.task_ids || run.tasks) {
|
|
19308
|
+
return;
|
|
19309
|
+
}
|
|
19310
|
+
var existingRun = this.runsStore.get(run.id);
|
|
19311
|
+
var taskIdsWaitingForRun = this.taskIdsWaitingForRun.get(run.id) || new Set();
|
|
19312
|
+
var taskIds = existingRun
|
|
19313
|
+
? Array.from(new Set(__spreadArray(__spreadArray([], __read(existingRun.task_ids), false), __read(taskIdsWaitingForRun), false)))
|
|
19314
|
+
: Array.from(taskIdsWaitingForRun);
|
|
19315
|
+
this.taskIdsWaitingForRun.delete(run.id);
|
|
19316
|
+
return { params: { taskIds: taskIds } };
|
|
19317
|
+
};
|
|
19318
|
+
RunRealtimeSubscriptions.prototype.updateTaskIds = function (task) {
|
|
19319
|
+
var existingRun = this.runsStore.getGroup(runs_consts_1.RunGroupTypes.TaskIds, task.id)[0];
|
|
19320
|
+
if (task.run_id) {
|
|
19321
|
+
var newRun = this.runsStore.get(task.run_id);
|
|
19322
|
+
if (!newRun) {
|
|
19323
|
+
this.backupTasksUntilRunIsCreated(task);
|
|
19324
|
+
}
|
|
19325
|
+
else if (this.taskAddedToRun(task, newRun)) {
|
|
19326
|
+
var updatedTaskIds = new Set(newRun.task_ids);
|
|
19327
|
+
updatedTaskIds.add(task.id);
|
|
19328
|
+
this.updateRunInStore(newRun, updatedTaskIds);
|
|
19329
|
+
}
|
|
19330
|
+
}
|
|
19331
|
+
else if (this.taskRemovedFromRun(task, existingRun)) {
|
|
19332
|
+
var updatedTaskIds = new Set(existingRun.task_ids);
|
|
19333
|
+
updatedTaskIds.delete(task.id);
|
|
19334
|
+
this.updateRunInStore(existingRun, updatedTaskIds);
|
|
19335
|
+
}
|
|
19336
|
+
this.updatePreviousRun(task, existingRun === null || existingRun === void 0 ? void 0 : existingRun.id);
|
|
19337
|
+
};
|
|
19338
|
+
RunRealtimeSubscriptions.prototype.updatePreviousRun = function (task, previousRunId) {
|
|
19339
|
+
if (previousRunId && previousRunId != task.run_id) {
|
|
19340
|
+
if (this.taskIdsWaitingForRun.has(previousRunId)) {
|
|
19341
|
+
this.taskIdsWaitingForRun.get(previousRunId).delete(task.id);
|
|
19342
|
+
}
|
|
19343
|
+
var previousRunOfTask = this.runsStore.get(previousRunId);
|
|
19344
|
+
if (previousRunOfTask) {
|
|
19345
|
+
var updatedTaskIds = new Set(previousRunOfTask.task_ids);
|
|
19346
|
+
updatedTaskIds.delete(task.id);
|
|
19347
|
+
this.updateRunInStore(previousRunOfTask, updatedTaskIds);
|
|
19348
|
+
}
|
|
19349
|
+
}
|
|
19350
|
+
};
|
|
19351
|
+
RunRealtimeSubscriptions.prototype.updateRunInStore = function (newRun, taskIds) {
|
|
19352
|
+
var mappedItem = this.storableDataService.updateInStores(newRun, undefined, undefined, {
|
|
19353
|
+
taskIds: Array.from(taskIds)
|
|
19354
|
+
});
|
|
19355
|
+
this.storableRealtimeSubscriptions.runEventCallbacks(runs_consts_1.RunEvents.UPDATED, mappedItem);
|
|
19356
|
+
};
|
|
19357
|
+
RunRealtimeSubscriptions.prototype.taskRemovedFromRun = function (task, existingRun) {
|
|
19358
|
+
var _a;
|
|
19359
|
+
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));
|
|
19360
|
+
};
|
|
19361
|
+
RunRealtimeSubscriptions.prototype.taskAddedToRun = function (task, existingRun) {
|
|
19362
|
+
var _a;
|
|
19363
|
+
return task.run_id && !((_a = existingRun.task_ids) === null || _a === void 0 ? void 0 : _a.includes(task.id));
|
|
19364
|
+
};
|
|
19365
|
+
RunRealtimeSubscriptions.prototype.backupTasksUntilRunIsCreated = function (task) {
|
|
19366
|
+
if (!task.run_id) {
|
|
19367
|
+
return;
|
|
19368
|
+
}
|
|
19369
|
+
if (!this.taskIdsWaitingForRun.has(task.run_id)) {
|
|
19370
|
+
this.taskIdsWaitingForRun.set(task.run_id, new Set());
|
|
19371
|
+
}
|
|
19372
|
+
this.taskIdsWaitingForRun.get(task.run_id).add(task.id);
|
|
19373
|
+
};
|
|
19374
|
+
return RunRealtimeSubscriptions;
|
|
19375
|
+
}());
|
|
19376
|
+
exports["default"] = RunRealtimeSubscriptions;
|
|
19377
|
+
//# sourceMappingURL=run-realtime-subscriptions.js.map
|
|
19378
|
+
|
|
19379
|
+
/***/ }),
|
|
19380
|
+
|
|
19381
|
+
/***/ 83582:
|
|
19022
19382
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
19023
19383
|
|
|
19024
19384
|
"use strict";
|
|
@@ -19074,56 +19434,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19074
19434
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19075
19435
|
};
|
|
19076
19436
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
19437
|
+
var BringgDashboardSDK_1 = __webpack_require__(5655);
|
|
19438
|
+
var data_entity_1 = __webpack_require__(91083);
|
|
19077
19439
|
var data_store_1 = __importDefault(__webpack_require__(73135));
|
|
19078
|
-
var
|
|
19440
|
+
var storable_data_service_1 = __importDefault(__webpack_require__(45297));
|
|
19079
19441
|
var runs_consts_1 = __webpack_require__(4669);
|
|
19080
19442
|
var runs_service_1 = __webpack_require__(34075);
|
|
19443
|
+
var run_realtime_subscriptions_1 = __importDefault(__webpack_require__(30196));
|
|
19081
19444
|
var RunsApi = /** @class */ (function () {
|
|
19082
19445
|
function RunsApi(session) {
|
|
19083
19446
|
var _this = this;
|
|
19084
|
-
this.
|
|
19085
|
-
_this.
|
|
19447
|
+
this.onUpdate = function (callback) {
|
|
19448
|
+
return _this.realtimeSubscriptions.onUpdate(callback);
|
|
19449
|
+
};
|
|
19450
|
+
this.onDelete = function (callback) {
|
|
19451
|
+
return _this.realtimeSubscriptions.onDelete(callback);
|
|
19086
19452
|
};
|
|
19087
|
-
this.
|
|
19088
|
-
_this.
|
|
19453
|
+
this.onCreate = function (callback) {
|
|
19454
|
+
return _this.realtimeSubscriptions.onCreate(callback);
|
|
19089
19455
|
};
|
|
19090
|
-
this.runsStore = new data_store_1.default(
|
|
19456
|
+
this.runsStore = new data_store_1.default([
|
|
19457
|
+
{
|
|
19458
|
+
groupType: runs_consts_1.RunGroupTypes.TaskIds,
|
|
19459
|
+
keyFunc: function (runModel) { return runModel.task_ids; }
|
|
19460
|
+
}
|
|
19461
|
+
]);
|
|
19091
19462
|
this.runsService = new runs_service_1.RunsService(session);
|
|
19092
|
-
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19463
|
+
var mapper = function (run, params) {
|
|
19464
|
+
var existing = _this.runsStore.get(run.id);
|
|
19465
|
+
var taskIds;
|
|
19466
|
+
if (params.taskIds || run.task_ids || run.tasks) {
|
|
19467
|
+
taskIds = params.taskIds || run.task_ids || run.tasks.map(function (task) { return task.id; });
|
|
19468
|
+
}
|
|
19469
|
+
if (existing) {
|
|
19470
|
+
var previous = (0, BringgDashboardSDK_1.getGlobals)().mobx.toJS(existing);
|
|
19471
|
+
run.task_ids = taskIds || existing.task_ids;
|
|
19472
|
+
return { current: run, previous: previous };
|
|
19473
|
+
}
|
|
19474
|
+
else {
|
|
19475
|
+
run.task_ids = taskIds || [];
|
|
19476
|
+
return { current: run };
|
|
19477
|
+
}
|
|
19478
|
+
};
|
|
19479
|
+
this.storableDataService = new storable_data_service_1.default(this.runsStore, mapper);
|
|
19480
|
+
this.realtimeSubscriptions = new run_realtime_subscriptions_1.default(session, this.runsStore, this.storableDataService);
|
|
19096
19481
|
}
|
|
19482
|
+
RunsApi.prototype.updateStoreOnEvents = function () {
|
|
19483
|
+
this.realtimeSubscriptions.updateStoreOnEvents();
|
|
19484
|
+
};
|
|
19485
|
+
RunsApi.prototype.get = function (id) {
|
|
19486
|
+
return this.runsStore.get(id);
|
|
19487
|
+
};
|
|
19097
19488
|
RunsApi.prototype.getAll = function () {
|
|
19098
19489
|
return this.runsStore.getAll();
|
|
19099
19490
|
};
|
|
19491
|
+
RunsApi.prototype.getAllMap = function () {
|
|
19492
|
+
return this.runsStore.getAllById();
|
|
19493
|
+
};
|
|
19100
19494
|
RunsApi.prototype.getByIds = function (ids) {
|
|
19101
19495
|
var _this = this;
|
|
19102
|
-
return ids.map(function (runId) { return _this.runsStore.get(runId); });
|
|
19496
|
+
return ids.map(function (runId) { return _this.runsStore.get(runId); }).filter(Boolean);
|
|
19103
19497
|
};
|
|
19104
|
-
RunsApi.prototype.
|
|
19498
|
+
RunsApi.prototype.add = function (run) {
|
|
19499
|
+
return this.storableDataService.updateInStores(run);
|
|
19500
|
+
};
|
|
19501
|
+
RunsApi.prototype.remove = function (id) {
|
|
19502
|
+
return this.storableDataService.removeFromStores(id);
|
|
19503
|
+
};
|
|
19504
|
+
RunsApi.prototype.loadMany = function (queryParams, options, commonOptions) {
|
|
19505
|
+
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
19105
19506
|
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19106
19507
|
return __awaiter(this, void 0, void 0, function () {
|
|
19107
|
-
var idsToFetch, runs_1, runs;
|
|
19108
19508
|
var _this = this;
|
|
19109
19509
|
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
|
-
}
|
|
19510
|
+
return [2 /*return*/, this.storableDataService.loadMany('loadMany', function (idsToLoad) {
|
|
19511
|
+
return _this.runsService.loadAll(__assign(__assign({}, options), { ids: idsToLoad }), commonOptions);
|
|
19512
|
+
}, queryParams.ids, options)];
|
|
19127
19513
|
});
|
|
19128
19514
|
});
|
|
19129
19515
|
};
|
|
@@ -19138,6 +19524,130 @@ var RunsApi = /** @class */ (function () {
|
|
|
19138
19524
|
});
|
|
19139
19525
|
});
|
|
19140
19526
|
};
|
|
19527
|
+
RunsApi.prototype.load = function (id, options) {
|
|
19528
|
+
var _this = this;
|
|
19529
|
+
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
19530
|
+
return this.storableDataService.load('load', function () { return _this.runsService.load(id); }, id, options);
|
|
19531
|
+
};
|
|
19532
|
+
RunsApi.prototype.update = function (id, options, commonOptions) {
|
|
19533
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19534
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19535
|
+
var _this = this;
|
|
19536
|
+
return __generator(this, function (_a) {
|
|
19537
|
+
return [2 /*return*/, this.storableDataService.modify('update', function () { return _this.runsService.update(id, options, commonOptions); })];
|
|
19538
|
+
});
|
|
19539
|
+
});
|
|
19540
|
+
};
|
|
19541
|
+
RunsApi.prototype.getHistory = function (id, commonOptions) {
|
|
19542
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19543
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19544
|
+
return __generator(this, function (_a) {
|
|
19545
|
+
switch (_a.label) {
|
|
19546
|
+
case 0: return [4 /*yield*/, this.runsService.getHistory(id, commonOptions)];
|
|
19547
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19548
|
+
}
|
|
19549
|
+
});
|
|
19550
|
+
});
|
|
19551
|
+
};
|
|
19552
|
+
RunsApi.prototype.getLocations = function (id, commonOptions) {
|
|
19553
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19554
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19555
|
+
return __generator(this, function (_a) {
|
|
19556
|
+
switch (_a.label) {
|
|
19557
|
+
case 0: return [4 /*yield*/, this.runsService.getLocations(id, commonOptions)];
|
|
19558
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19559
|
+
}
|
|
19560
|
+
});
|
|
19561
|
+
});
|
|
19562
|
+
};
|
|
19563
|
+
RunsApi.prototype.getCashout = function (id, commonOptions) {
|
|
19564
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19565
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19566
|
+
return __generator(this, function (_a) {
|
|
19567
|
+
switch (_a.label) {
|
|
19568
|
+
case 0: return [4 /*yield*/, this.runsService.getCashout(id, commonOptions)];
|
|
19569
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19570
|
+
}
|
|
19571
|
+
});
|
|
19572
|
+
});
|
|
19573
|
+
};
|
|
19574
|
+
RunsApi.prototype.assignDriver = function (id, userId, targetRun, commonOptions) {
|
|
19575
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19576
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19577
|
+
return __generator(this, function (_a) {
|
|
19578
|
+
switch (_a.label) {
|
|
19579
|
+
case 0: return [4 /*yield*/, this.runsService.assignDriver(id, userId, targetRun, commonOptions)];
|
|
19580
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19581
|
+
}
|
|
19582
|
+
});
|
|
19583
|
+
});
|
|
19584
|
+
};
|
|
19585
|
+
RunsApi.prototype.unassignDriver = function (id, userId, commonOptions) {
|
|
19586
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19587
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19588
|
+
return __generator(this, function (_a) {
|
|
19589
|
+
switch (_a.label) {
|
|
19590
|
+
case 0: return [4 /*yield*/, this.runsService.unassignDriver(id, userId, commonOptions)];
|
|
19591
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19592
|
+
}
|
|
19593
|
+
});
|
|
19594
|
+
});
|
|
19595
|
+
};
|
|
19596
|
+
RunsApi.prototype.assignVehicles = function (id, vehicleId, tasks, commonOptions) {
|
|
19597
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19598
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19599
|
+
return __generator(this, function (_a) {
|
|
19600
|
+
switch (_a.label) {
|
|
19601
|
+
case 0: return [4 /*yield*/, this.runsService.assignVehicles(id, vehicleId, tasks, commonOptions)];
|
|
19602
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19603
|
+
}
|
|
19604
|
+
});
|
|
19605
|
+
});
|
|
19606
|
+
};
|
|
19607
|
+
RunsApi.prototype.unassignVehicles = function (id, commonOptions) {
|
|
19608
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19609
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19610
|
+
return __generator(this, function (_a) {
|
|
19611
|
+
switch (_a.label) {
|
|
19612
|
+
case 0: return [4 /*yield*/, this.runsService.unassignVehicles(id, commonOptions)];
|
|
19613
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19614
|
+
}
|
|
19615
|
+
});
|
|
19616
|
+
});
|
|
19617
|
+
};
|
|
19618
|
+
RunsApi.prototype.bulkClose = function (runIds, commonOptions) {
|
|
19619
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19620
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19621
|
+
return __generator(this, function (_a) {
|
|
19622
|
+
switch (_a.label) {
|
|
19623
|
+
case 0: return [4 /*yield*/, this.runsService.bulkClose(runIds, commonOptions)];
|
|
19624
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19625
|
+
}
|
|
19626
|
+
});
|
|
19627
|
+
});
|
|
19628
|
+
};
|
|
19629
|
+
RunsApi.prototype.markDonePlanning = function (runIds, commonOptions) {
|
|
19630
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19631
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19632
|
+
return __generator(this, function (_a) {
|
|
19633
|
+
switch (_a.label) {
|
|
19634
|
+
case 0: return [4 /*yield*/, this.runsService.markDonePlanning(runIds, commonOptions)];
|
|
19635
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19636
|
+
}
|
|
19637
|
+
});
|
|
19638
|
+
});
|
|
19639
|
+
};
|
|
19640
|
+
RunsApi.prototype.getActualBreaks = function (runIds, commonOptions) {
|
|
19641
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
19642
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
19643
|
+
return __generator(this, function (_a) {
|
|
19644
|
+
switch (_a.label) {
|
|
19645
|
+
case 0: return [4 /*yield*/, this.runsService.getActualBreaks(runIds, commonOptions)];
|
|
19646
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19647
|
+
}
|
|
19648
|
+
});
|
|
19649
|
+
});
|
|
19650
|
+
};
|
|
19141
19651
|
return RunsApi;
|
|
19142
19652
|
}());
|
|
19143
19653
|
exports["default"] = RunsApi;
|
|
@@ -21517,7 +22027,7 @@ var lodash_1 = __webpack_require__(96486);
|
|
|
21517
22027
|
var BringgException_1 = __webpack_require__(43605);
|
|
21518
22028
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
21519
22029
|
var abort_1 = __webpack_require__(34179);
|
|
21520
|
-
var version = '
|
|
22030
|
+
var version = '9.1.0-pre.0';
|
|
21521
22031
|
function logErrorResponse(response) {
|
|
21522
22032
|
var data = response.data, status = response.status;
|
|
21523
22033
|
try {
|
|
@@ -22366,101 +22876,6 @@ exports["default"] = SkillsApi;
|
|
|
22366
22876
|
|
|
22367
22877
|
/***/ }),
|
|
22368
22878
|
|
|
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
22879
|
/***/ 20040:
|
|
22465
22880
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
22466
22881
|
|
|
@@ -24024,150 +24439,89 @@ exports.Routes = {
|
|
|
24024
24439
|
|
|
24025
24440
|
"use strict";
|
|
24026
24441
|
|
|
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
24442
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
24039
24443
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24040
24444
|
};
|
|
24041
24445
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
24042
|
-
var
|
|
24043
|
-
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
24446
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
24044
24447
|
var Tasks_consts_1 = __webpack_require__(24976);
|
|
24045
24448
|
var TaskRealtimeSubscriptions = /** @class */ (function () {
|
|
24046
24449
|
function TaskRealtimeSubscriptions(session, tasksStore, storableDataService) {
|
|
24047
|
-
this.realtimeSubscriptions = new realtime_subscriptions_1.default(session);
|
|
24048
24450
|
this.tasksStore = tasksStore;
|
|
24049
|
-
this.
|
|
24050
|
-
this.eventCallbacks = {};
|
|
24451
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, tasksStore, storableDataService);
|
|
24051
24452
|
}
|
|
24052
24453
|
TaskRealtimeSubscriptions.prototype.updateStoreOnEvents = function () {
|
|
24053
24454
|
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);
|
|
24455
|
+
var events = [
|
|
24456
|
+
{
|
|
24457
|
+
name: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24458
|
+
isDelete: false,
|
|
24459
|
+
extraDataFunc: function (task) {
|
|
24460
|
+
var isPartialUpdate = !task.hasOwnProperty('status');
|
|
24461
|
+
return { ignore: isPartialUpdate && !_this.tasksStore.get(task.id) };
|
|
24083
24462
|
}
|
|
24084
|
-
}
|
|
24085
|
-
|
|
24463
|
+
},
|
|
24464
|
+
{ name: Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, isDelete: false },
|
|
24465
|
+
{ name: Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, isDelete: true }
|
|
24466
|
+
];
|
|
24467
|
+
var subEntityEvents = [
|
|
24468
|
+
{
|
|
24469
|
+
name: Tasks_consts_1.TaskRealTimeEvents.NEW_SCAN,
|
|
24470
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24471
|
+
parentField: 'task_id',
|
|
24472
|
+
field: 'scans',
|
|
24473
|
+
ignoreFields: ['way_points'],
|
|
24474
|
+
isDelete: false
|
|
24475
|
+
},
|
|
24476
|
+
{
|
|
24477
|
+
name: Tasks_consts_1.TaskRealTimeEvents.NEW_NOTE,
|
|
24478
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24479
|
+
parentField: 'task_id',
|
|
24480
|
+
field: 'task_notes',
|
|
24481
|
+
ignoreFields: ['way_points'],
|
|
24482
|
+
isDelete: false
|
|
24483
|
+
},
|
|
24484
|
+
{
|
|
24485
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_ADDED,
|
|
24486
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24487
|
+
parentField: 'task_id',
|
|
24488
|
+
field: 'way_points',
|
|
24489
|
+
ignoreFields: ['way_points'],
|
|
24490
|
+
isDelete: false
|
|
24491
|
+
},
|
|
24492
|
+
{
|
|
24493
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED,
|
|
24494
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24495
|
+
parentField: 'task_id',
|
|
24496
|
+
field: 'way_points',
|
|
24497
|
+
ignoreFields: ['way_points'],
|
|
24498
|
+
isDelete: false
|
|
24499
|
+
},
|
|
24500
|
+
{
|
|
24501
|
+
name: Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED,
|
|
24502
|
+
eventToRaise: Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE,
|
|
24503
|
+
parentField: 'task_id',
|
|
24504
|
+
field: 'way_points',
|
|
24505
|
+
ignoreFields: ['way_points'],
|
|
24506
|
+
isDelete: true
|
|
24507
|
+
}
|
|
24508
|
+
];
|
|
24509
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents(events, subEntityEvents);
|
|
24086
24510
|
};
|
|
24087
24511
|
TaskRealtimeSubscriptions.prototype.onCreate = function (callback) {
|
|
24088
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, callback);
|
|
24512
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.NEW_TASK, callback);
|
|
24089
24513
|
};
|
|
24090
24514
|
TaskRealtimeSubscriptions.prototype.onDelete = function (callback) {
|
|
24091
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, callback);
|
|
24515
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_DELETED, callback);
|
|
24092
24516
|
};
|
|
24093
24517
|
TaskRealtimeSubscriptions.prototype.onWayPointUpdate = function (callback) {
|
|
24094
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED, callback);
|
|
24518
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_UPDATED, callback);
|
|
24095
24519
|
};
|
|
24096
24520
|
TaskRealtimeSubscriptions.prototype.onWayPointDelete = function (callback) {
|
|
24097
|
-
return this.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED, callback);
|
|
24521
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.WAYPOINT_DELETED, callback);
|
|
24098
24522
|
};
|
|
24099
24523
|
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 ({}); });
|
|
24524
|
+
return this.storableRealtimeSubscriptions.onEvent(Tasks_consts_1.TaskRealTimeEvents.TASK_UPDATE, callback);
|
|
24171
24525
|
};
|
|
24172
24526
|
return TaskRealtimeSubscriptions;
|
|
24173
24527
|
}());
|
|
@@ -29135,11 +29489,11 @@ var UserPresetViewsApi = /** @class */ (function () {
|
|
|
29135
29489
|
this.loadAll = function () {
|
|
29136
29490
|
return _this.storableDataService.loadAll('loadAll', function () { return _this.userPresetViewsService.loadAll(); });
|
|
29137
29491
|
};
|
|
29138
|
-
this.update = function (
|
|
29492
|
+
this.update = function (body) { return __awaiter(_this, void 0, void 0, function () {
|
|
29139
29493
|
var result;
|
|
29140
29494
|
return __generator(this, function (_a) {
|
|
29141
29495
|
switch (_a.label) {
|
|
29142
|
-
case 0: return [4 /*yield*/, this.userPresetViewsService.update(
|
|
29496
|
+
case 0: return [4 /*yield*/, this.userPresetViewsService.update(body)];
|
|
29143
29497
|
case 1:
|
|
29144
29498
|
result = _a.sent();
|
|
29145
29499
|
this.userPresetViewsStore.set(result);
|
|
@@ -29162,7 +29516,8 @@ var UserPresetViewsApi = /** @class */ (function () {
|
|
|
29162
29516
|
keyFunc: function (userPresetView) { return userPresetView.view; }
|
|
29163
29517
|
}
|
|
29164
29518
|
];
|
|
29165
|
-
|
|
29519
|
+
// TODO: investigate how to turn items in DataStore in real observables
|
|
29520
|
+
this.userPresetViewsStore = new data_store_1.default(groupFilters);
|
|
29166
29521
|
this.userPresetViewsService = new user_preset_views_service_1.UserPresetViewsService(session);
|
|
29167
29522
|
this.storableDataService = new storable_data_service_1.default(this.userPresetViewsStore);
|
|
29168
29523
|
}
|
|
@@ -29288,11 +29643,15 @@ var UserPresetViewsService = /** @class */ (function () {
|
|
|
29288
29643
|
}
|
|
29289
29644
|
});
|
|
29290
29645
|
}); };
|
|
29291
|
-
this.update = function (
|
|
29646
|
+
this.update = function (body) { return __awaiter(_this, void 0, void 0, function () {
|
|
29292
29647
|
var result;
|
|
29293
29648
|
return __generator(this, function (_a) {
|
|
29294
29649
|
switch (_a.label) {
|
|
29295
|
-
case 0: return [4 /*yield*/, this.service.
|
|
29650
|
+
case 0: return [4 /*yield*/, this.service.routeGenerator
|
|
29651
|
+
.put("/".concat(this.service.entityName))
|
|
29652
|
+
.withPayload(body)
|
|
29653
|
+
.setException("Failed to update ".concat(this.service.entityName))
|
|
29654
|
+
.invoke()];
|
|
29296
29655
|
case 1:
|
|
29297
29656
|
result = _a.sent();
|
|
29298
29657
|
return [2 /*return*/, result];
|
|
@@ -29775,8 +30134,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
29775
30134
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29776
30135
|
};
|
|
29777
30136
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
30137
|
+
var storable_realtime_subscriptions_1 = __importDefault(__webpack_require__(1227));
|
|
29778
30138
|
var data_store_1 = __importDefault(__webpack_require__(73135));
|
|
29779
|
-
var realtime_subscriptions_1 = __importDefault(__webpack_require__(47985));
|
|
29780
30139
|
var storable_data_service_1 = __importDefault(__webpack_require__(45297));
|
|
29781
30140
|
var Vehicle_consts_1 = __webpack_require__(84010);
|
|
29782
30141
|
var vehicles_service_1 = __importDefault(__webpack_require__(87386));
|
|
@@ -29786,11 +30145,10 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29786
30145
|
{ groupType: Vehicle_consts_1.VehicleGroup.Team, keyFunc: function (vehicle) { return vehicle.team_id; } },
|
|
29787
30146
|
{ groupType: Vehicle_consts_1.VehicleGroup.IsTrailer, keyFunc: function (vehicle) { return !!vehicle.is_trailer; } }
|
|
29788
30147
|
];
|
|
29789
|
-
this.eventCallbacks = {};
|
|
29790
30148
|
this.vehiclesStore = new data_store_1.default(groupFilters);
|
|
29791
30149
|
this.vehiclesService = new vehicles_service_1.default(session);
|
|
29792
30150
|
this.storableDataService = new storable_data_service_1.default(this.vehiclesStore);
|
|
29793
|
-
this.
|
|
30151
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.vehiclesStore, this.storableDataService);
|
|
29794
30152
|
}
|
|
29795
30153
|
VehiclesApi.prototype.load = function (id, options) {
|
|
29796
30154
|
var _this = this;
|
|
@@ -29817,24 +30175,21 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29817
30175
|
return this.storableDataService.modify('create', function () { return _this.vehiclesService.create(vehicleData); });
|
|
29818
30176
|
};
|
|
29819
30177
|
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
|
-
});
|
|
30178
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([
|
|
30179
|
+
{ name: Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, isDelete: false },
|
|
30180
|
+
{ name: Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, isDelete: true }
|
|
30181
|
+
]);
|
|
29829
30182
|
};
|
|
29830
30183
|
VehiclesApi.prototype.onUpdate = function (callback) {
|
|
29831
|
-
return this.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, callback);
|
|
30184
|
+
return this.storableRealtimeSubscriptions.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UPDATE, function (item) { return callback(item.current); });
|
|
29832
30185
|
};
|
|
29833
30186
|
VehiclesApi.prototype.onDelete = function (callback) {
|
|
29834
|
-
return this.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, callback);
|
|
30187
|
+
return this.storableRealtimeSubscriptions.onEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_DELETE, function (item) { return callback(item.current); });
|
|
29835
30188
|
};
|
|
29836
30189
|
VehiclesApi.prototype.onUnassigned = function (callback) {
|
|
29837
|
-
return this.
|
|
30190
|
+
return this.storableRealtimeSubscriptions.onAnyEvent(Vehicle_consts_1.REAL_TIME_EVENTS.VEHICLE_UNASSIGNED, function (vehicle) {
|
|
30191
|
+
return callback(vehicle);
|
|
30192
|
+
});
|
|
29838
30193
|
};
|
|
29839
30194
|
VehiclesApi.prototype.get = function (id) {
|
|
29840
30195
|
return this.vehiclesStore.get(id);
|
|
@@ -29874,20 +30229,6 @@ var VehiclesApi = /** @class */ (function () {
|
|
|
29874
30229
|
});
|
|
29875
30230
|
});
|
|
29876
30231
|
};
|
|
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
30232
|
return VehiclesApi;
|
|
29892
30233
|
}());
|
|
29893
30234
|
exports["default"] = VehiclesApi;
|
|
@@ -31563,6 +31904,17 @@ exports["default"] = RealtimeSubscriptions;
|
|
|
31563
31904
|
|
|
31564
31905
|
"use strict";
|
|
31565
31906
|
|
|
31907
|
+
var __assign = (this && this.__assign) || function () {
|
|
31908
|
+
__assign = Object.assign || function(t) {
|
|
31909
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
31910
|
+
s = arguments[i];
|
|
31911
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
31912
|
+
t[p] = s[p];
|
|
31913
|
+
}
|
|
31914
|
+
return t;
|
|
31915
|
+
};
|
|
31916
|
+
return __assign.apply(this, arguments);
|
|
31917
|
+
};
|
|
31566
31918
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31567
31919
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
31568
31920
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -31637,7 +31989,7 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31637
31989
|
return [4 /*yield*/, loadFunc(loadFnIdsParams)];
|
|
31638
31990
|
case 1:
|
|
31639
31991
|
items = _a.sent();
|
|
31640
|
-
mappedItems_1 = items.map(function (item) { return _this.mapper(item, action); });
|
|
31992
|
+
mappedItems_1 = items.map(function (item) { return _this.mapper(item, { action: action }); });
|
|
31641
31993
|
if (options.groupType) {
|
|
31642
31994
|
this.dataStore.setGroup(options.groupType, groupValue, mappedItems_1);
|
|
31643
31995
|
}
|
|
@@ -31665,7 +32017,7 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31665
32017
|
return [4 /*yield*/, loadFunc(ids)];
|
|
31666
32018
|
case 1:
|
|
31667
32019
|
items = _a.sent();
|
|
31668
|
-
mappedItems_2 = items.map(function (item) { return _this.mapper(item, action); });
|
|
32020
|
+
mappedItems_2 = items.map(function (item) { return _this.mapper(item, { action: action }); });
|
|
31669
32021
|
this.dataStore.setMany(mappedItems_2);
|
|
31670
32022
|
this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(mappedItems_2, options.fields); });
|
|
31671
32023
|
return [2 /*return*/, mappedItems_2.map(function (mappedItems) { return mappedItems.current; })];
|
|
@@ -31762,13 +32114,13 @@ var StorableDataService = /** @class */ (function () {
|
|
|
31762
32114
|
});
|
|
31763
32115
|
});
|
|
31764
32116
|
};
|
|
31765
|
-
StorableDataService.prototype.updateInStores = function (item, action, fields) {
|
|
31766
|
-
return this.updateManyInStores([item], action, fields)[0];
|
|
32117
|
+
StorableDataService.prototype.updateInStores = function (item, action, fields, extraMapperParams) {
|
|
32118
|
+
return this.updateManyInStores([item], action, fields, extraMapperParams)[0];
|
|
31767
32119
|
};
|
|
31768
|
-
StorableDataService.prototype.updateManyInStores = function (items, action, fields) {
|
|
32120
|
+
StorableDataService.prototype.updateManyInStores = function (items, action, fields, extraMapperParams) {
|
|
31769
32121
|
var _this = this;
|
|
31770
32122
|
return (0, BringgDashboardSDK_1.getGlobals)().mobx.runInAction(function () {
|
|
31771
|
-
var clientItems = items.map(function (item) { return _this.mapper(item, action); });
|
|
32123
|
+
var clientItems = items.map(function (item) { return _this.mapper(item, __assign({ action: action }, extraMapperParams)); });
|
|
31772
32124
|
_this.dataStore.setMany(clientItems);
|
|
31773
32125
|
_this.extraDataStores.forEach(function (dataStore) { return dataStore.setMany(clientItems, fields); });
|
|
31774
32126
|
return clientItems;
|
|
@@ -34893,7 +35245,18 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
34893
35245
|
"use strict";
|
|
34894
35246
|
|
|
34895
35247
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
34896
|
-
exports.PlannedTasksFilterOptions = exports.UnassignedFilterOptions = exports.ReadyForPickupFilterOptions = void 0;
|
|
35248
|
+
exports.PlannedTasksFilterOptions = exports.UnassignedFilterOptions = exports.ReadyForPickupFilterOptions = exports.GroupMode = void 0;
|
|
35249
|
+
var GroupMode;
|
|
35250
|
+
(function (GroupMode) {
|
|
35251
|
+
GroupMode["Driver"] = "Driver";
|
|
35252
|
+
GroupMode["Fleet"] = "Fleet";
|
|
35253
|
+
GroupMode["FleetTeam"] = "FleetTeam";
|
|
35254
|
+
GroupMode["None"] = "None";
|
|
35255
|
+
GroupMode["Route"] = "Route";
|
|
35256
|
+
GroupMode["Team"] = "Team";
|
|
35257
|
+
GroupMode["TeamDriver"] = "TeamDriver";
|
|
35258
|
+
GroupMode["TeamRoute"] = "TeamRoute";
|
|
35259
|
+
})(GroupMode || (exports.GroupMode = GroupMode = {}));
|
|
34897
35260
|
var ReadyForPickupFilterOptions;
|
|
34898
35261
|
(function (ReadyForPickupFilterOptions) {
|
|
34899
35262
|
ReadyForPickupFilterOptions[ReadyForPickupFilterOptions["NOT_READY_FOR_PICKUP"] = 1] = "NOT_READY_FOR_PICKUP";
|