@bringg/dashboard-sdk 0.7.2 → 0.8.2
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/RouteOptimization/RouteOptimization.consts.d.ts +63 -0
- package/dist/RouteOptimization/RouteOptimizationApi.d.ts +6 -1
- package/dist/RouteOptimization/RouteOptimizationApi.js +8 -0
- package/dist/RouteOptimization/RouteOptimizationApi.js.map +1 -1
- package/dist/Services/ServiceRequest.js +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +9 -1
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +2 -2
- package/dist/bringg-dashboard-sdk.min.js +2 -2
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,66 @@
|
|
|
1
|
+
import { datetime, uuid } from '@bringg/types';
|
|
1
2
|
export declare type RouteOptimizationResponse = {
|
|
2
3
|
success: boolean;
|
|
3
4
|
};
|
|
5
|
+
export declare type RouteOptimizationRequest = {
|
|
6
|
+
optimize_for: string;
|
|
7
|
+
request_uuid: uuid;
|
|
8
|
+
task_ids: number[];
|
|
9
|
+
team_id: number[];
|
|
10
|
+
scheduled_date?: string;
|
|
11
|
+
custom_period?: {
|
|
12
|
+
start_hour: number;
|
|
13
|
+
end_hour: number;
|
|
14
|
+
};
|
|
15
|
+
driver_ids?: number[];
|
|
16
|
+
delivery_block_resource_ids?: number[];
|
|
17
|
+
scheduled_window?: {
|
|
18
|
+
start_time: datetime;
|
|
19
|
+
end_time: datetime;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare type OptimizationResponseSuccess = {
|
|
23
|
+
abilities: {
|
|
24
|
+
progress: boolean;
|
|
25
|
+
cancellable: boolean;
|
|
26
|
+
};
|
|
27
|
+
request_uuid: uuid;
|
|
28
|
+
success: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare type OptimizationResponseFailed = {
|
|
31
|
+
success: boolean;
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
export declare type OptimizationData = {
|
|
35
|
+
eta?: number;
|
|
36
|
+
etl?: number;
|
|
37
|
+
priority?: number;
|
|
38
|
+
route_idx: number;
|
|
39
|
+
task_id?: number;
|
|
40
|
+
type: string;
|
|
41
|
+
user_id?: number;
|
|
42
|
+
vehicle_id?: string;
|
|
43
|
+
way_point_id?: number;
|
|
44
|
+
depot_back_eta?: number;
|
|
45
|
+
depot_etl?: number;
|
|
46
|
+
power_unit_id?: string;
|
|
47
|
+
transport_distance?: number;
|
|
48
|
+
directions?: string[];
|
|
49
|
+
run_id?: number;
|
|
50
|
+
estimated_end_time?: number;
|
|
51
|
+
estimated_start_time?: number;
|
|
52
|
+
id?: string;
|
|
53
|
+
position?: number;
|
|
54
|
+
};
|
|
55
|
+
export declare type RouteOptimizationResult = {
|
|
56
|
+
merchant_id: number;
|
|
57
|
+
request_uuid: uuid;
|
|
58
|
+
team_id: number;
|
|
59
|
+
user_types: Bringg.UserType[];
|
|
60
|
+
data: OptimizationData[];
|
|
61
|
+
};
|
|
62
|
+
export declare type OptimizationResult = {
|
|
63
|
+
success: boolean;
|
|
64
|
+
message?: string;
|
|
65
|
+
route_optimization_result?: RouteOptimizationResult;
|
|
66
|
+
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { uuid } from '@bringg/types';
|
|
2
|
+
import { OptimizationResponseFailed, OptimizationResponseSuccess, OptimizationResult, RouteOptimizationRequest, RouteOptimizationResponse } from './RouteOptimization.consts';
|
|
2
3
|
import { SessionBasedService } from '../Services/SessionBasedService';
|
|
3
4
|
import Session from '../Services/Identity/Session';
|
|
4
5
|
export default class RouteOptimizationApi extends SessionBasedService {
|
|
6
|
+
private optimization;
|
|
7
|
+
private getOptimizationResult;
|
|
5
8
|
private cancel_requests;
|
|
6
9
|
constructor(session: Session);
|
|
7
10
|
cancelRequests(requestUuids: string[]): Promise<RouteOptimizationResponse>;
|
|
11
|
+
optimize(optimizationProps: RouteOptimizationRequest): Promise<OptimizationResponseSuccess | OptimizationResponseFailed>;
|
|
12
|
+
optimizationResult(request_uuid: uuid): Promise<OptimizationResult>;
|
|
8
13
|
}
|
|
@@ -23,12 +23,20 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
23
23
|
__extends(RouteOptimizationApi, _super);
|
|
24
24
|
function RouteOptimizationApi(session) {
|
|
25
25
|
var _this = _super.call(this, session.config.getApiEndpoint(), session) || this;
|
|
26
|
+
_this.optimization = new Route_1.Route('/route_optimizations/optimize', 1 /* POST */);
|
|
27
|
+
_this.getOptimizationResult = new Route_1.Route('/route_optimizations/get_optimization_result/{:request_uuid}', 0 /* GET */);
|
|
26
28
|
_this.cancel_requests = new Route_1.Route('/route_optimizations/optimization', 4 /* DELETE */);
|
|
27
29
|
return _this;
|
|
28
30
|
}
|
|
29
31
|
RouteOptimizationApi.prototype.cancelRequests = function (requestUuids) {
|
|
30
32
|
return this.handleAuthorizedRequest(this.cancel_requests, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to call cancel optimization requests'), { request_uuids: requestUuids });
|
|
31
33
|
};
|
|
34
|
+
RouteOptimizationApi.prototype.optimize = function (optimizationProps) {
|
|
35
|
+
return this.handleAuthorizedRequest(this.optimization, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to call optimization requests'), optimizationProps);
|
|
36
|
+
};
|
|
37
|
+
RouteOptimizationApi.prototype.optimizationResult = function (request_uuid) {
|
|
38
|
+
return this.handleAuthorizedRequest(this.getOptimizationResult, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get optimization results'), { request_uuid: request_uuid });
|
|
39
|
+
};
|
|
32
40
|
return RouteOptimizationApi;
|
|
33
41
|
}(SessionBasedService_1.SessionBasedService));
|
|
34
42
|
exports.default = RouteOptimizationApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteOptimizationApi.js","sourceRoot":"","sources":["../../src/RouteOptimization/RouteOptimizationApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RouteOptimizationApi.js","sourceRoot":"","sources":["../../src/RouteOptimization/RouteOptimizationApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAQA,yDAA0D;AAC1D,uEAAsE;AACtE,2DAA0D;AAC1D,2CAA0C;AAI1C;IAAkD,wCAAmB;IAQpE,8BAAY,OAAgB;QAA5B,YACC,kBAAM,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,OAAO,CAAC,SAC/C;QATO,kBAAY,GAAG,IAAI,aAAK,CAAC,+BAA+B,eAAkB,CAAC;QAC3E,2BAAqB,GAAG,IAAI,aAAK,CACxC,8DAA8D,cAE9D,CAAC;QACM,qBAAe,GAAG,IAAI,aAAK,CAAC,mCAAmC,iBAAoB,CAAC;;IAI5F,CAAC;IAEM,6CAAc,GAArB,UAAsB,YAAsB;QAC3C,OAAO,IAAI,CAAC,uBAAuB,CAClC,IAAI,CAAC,eAAe,EACpB,iCAAgB,EAChB,iCAAe,CAAC,gBAAgB,CAAC,6CAA6C,CAAC,EAC/E,EAAE,aAAa,EAAE,YAAY,EAAE,CAC/B,CAAC;IACH,CAAC;IAEM,uCAAQ,GAAf,UACC,iBAA2C;QAE3C,OAAO,IAAI,CAAC,uBAAuB,CAClC,IAAI,CAAC,YAAY,EACjB,iCAAgB,EAChB,iCAAe,CAAC,gBAAgB,CAAC,sCAAsC,CAAC,EACxE,iBAAiB,CACjB,CAAC;IACH,CAAC;IAEM,iDAAkB,GAAzB,UAA0B,YAAkB;QAC3C,OAAO,IAAI,CAAC,uBAAuB,CAClC,IAAI,CAAC,qBAAqB,EAC1B,iCAAgB,EAChB,iCAAe,CAAC,gBAAgB,CAAC,oCAAoC,CAAC,EACtE,EAAE,YAAY,cAAA,EAAE,CAChB,CAAC;IACH,CAAC;IACF,2BAAC;AAAD,CAAC,AAxCD,CAAkD,yCAAmB,GAwCpE"}
|
|
@@ -52,7 +52,7 @@ var axios_1 = require("axios");
|
|
|
52
52
|
var Logger_1 = require("../Core/Logger");
|
|
53
53
|
var lodash_1 = require("lodash");
|
|
54
54
|
var BringgException_1 = require("../Core/BringgException");
|
|
55
|
-
var version = '0.
|
|
55
|
+
var version = '0.8.2';
|
|
56
56
|
function logErrorResponse(response) {
|
|
57
57
|
var data = response.data, status = response.status;
|
|
58
58
|
try {
|
|
@@ -30508,7 +30508,7 @@ var axios_1 = __webpack_require__(146);
|
|
|
30508
30508
|
var Logger_1 = __webpack_require__(39);
|
|
30509
30509
|
var lodash_1 = __webpack_require__(11);
|
|
30510
30510
|
var BringgException_1 = __webpack_require__(15);
|
|
30511
|
-
var version = '0.
|
|
30511
|
+
var version = '0.8.2';
|
|
30512
30512
|
function logErrorResponse(response) {
|
|
30513
30513
|
var data = response.data, status = response.status;
|
|
30514
30514
|
try {
|
|
@@ -61252,12 +61252,20 @@ var RouteOptimizationApi = /** @class */ (function (_super) {
|
|
|
61252
61252
|
__extends(RouteOptimizationApi, _super);
|
|
61253
61253
|
function RouteOptimizationApi(session) {
|
|
61254
61254
|
var _this = _super.call(this, session.config.getApiEndpoint(), session) || this;
|
|
61255
|
+
_this.optimization = new Route_1.Route('/route_optimizations/optimize', 1 /* POST */);
|
|
61256
|
+
_this.getOptimizationResult = new Route_1.Route('/route_optimizations/get_optimization_result/{:request_uuid}', 0 /* GET */);
|
|
61255
61257
|
_this.cancel_requests = new Route_1.Route('/route_optimizations/optimization', 4 /* DELETE */);
|
|
61256
61258
|
return _this;
|
|
61257
61259
|
}
|
|
61258
61260
|
RouteOptimizationApi.prototype.cancelRequests = function (requestUuids) {
|
|
61259
61261
|
return this.handleAuthorizedRequest(this.cancel_requests, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to call cancel optimization requests'), { request_uuids: requestUuids });
|
|
61260
61262
|
};
|
|
61263
|
+
RouteOptimizationApi.prototype.optimize = function (optimizationProps) {
|
|
61264
|
+
return this.handleAuthorizedRequest(this.optimization, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to call optimization requests'), optimizationProps);
|
|
61265
|
+
};
|
|
61266
|
+
RouteOptimizationApi.prototype.optimizationResult = function (request_uuid) {
|
|
61267
|
+
return this.handleAuthorizedRequest(this.getOptimizationResult, RouteGenerator_1.defaultExtractor, BringgException_1.BringgException.serviceException('Failed to get optimization results'), { request_uuid: request_uuid });
|
|
61268
|
+
};
|
|
61261
61269
|
return RouteOptimizationApi;
|
|
61262
61270
|
}(SessionBasedService_1.SessionBasedService));
|
|
61263
61271
|
exports.default = RouteOptimizationApi;
|