@bringg/dashboard-sdk 9.39.1107-pre → 9.40.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/LookUp/lookup-api.d.ts +3 -2
- package/dist/LookUp/lookup-api.js +11 -0
- package/dist/LookUp/lookup-api.js.map +1 -1
- package/dist/LookUp/lookup-service.d.ts +3 -1
- package/dist/LookUp/lookup-service.js +13 -0
- package/dist/LookUp/lookup-service.js.map +1 -1
- package/dist/LookUp/lookup.consts.d.ts +18 -1
- package/dist/Services/Identity/AuthService.js +0 -9
- package/dist/Services/Identity/AuthService.js.map +1 -1
- package/dist/Services/ServiceRequest.js +1 -1
- package/dist/Task/Entity/TaskEntity.d.ts +2 -0
- package/dist/Task/Entity/TaskEntity.js +8 -0
- package/dist/Task/Entity/TaskEntity.js.map +1 -1
- package/dist/Task/TaskApi.d.ts +2 -0
- package/dist/Task/TaskApi.js +3 -0
- package/dist/Task/TaskApi.js.map +1 -1
- package/dist/Task/Tasks.consts.d.ts +7 -0
- package/dist/Task/Tasks.consts.js +5 -2
- package/dist/Task/Tasks.consts.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +41 -12
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +7 -7
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -11512,6 +11512,17 @@ var Lookup = /** @class */ (function () {
|
|
|
11512
11512
|
});
|
|
11513
11513
|
});
|
|
11514
11514
|
};
|
|
11515
|
+
Lookup.prototype.getParkingSpots = function (query, commonOptions) {
|
|
11516
|
+
if (commonOptions === void 0) { commonOptions = {}; }
|
|
11517
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11518
|
+
return __generator(this, function (_a) {
|
|
11519
|
+
switch (_a.label) {
|
|
11520
|
+
case 0: return [4 /*yield*/, this.lookUpEntity.getParkingSpots(query, commonOptions)];
|
|
11521
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
11522
|
+
}
|
|
11523
|
+
});
|
|
11524
|
+
});
|
|
11525
|
+
};
|
|
11515
11526
|
return Lookup;
|
|
11516
11527
|
}());
|
|
11517
11528
|
exports["default"] = Lookup;
|
|
@@ -11574,6 +11585,7 @@ exports.Routes = {
|
|
|
11574
11585
|
GET_TASKS_TITLES: "".concat(baseRoute, "/task/title"),
|
|
11575
11586
|
GET_PLANNED_ROUTES: "".concat(baseRoute, "/planned-route"),
|
|
11576
11587
|
GET_TEAMS: "".concat(baseRoute, "/team"),
|
|
11588
|
+
GET_PARKING_SPOTS: "".concat(baseRoute, "/parking-spot"),
|
|
11577
11589
|
GET_WAYPOINT_ZIPCODE: "".concat(baseRoute, "/waypoint/zipcode"),
|
|
11578
11590
|
GET_WAYPOINT_ADDRESS: "".concat(baseRoute, "/waypoint/address"),
|
|
11579
11591
|
GET_WAYPOINT_PHONE: "".concat(baseRoute, "/waypoint/phone"),
|
|
@@ -11731,6 +11743,18 @@ var LookupService = /** @class */ (function () {
|
|
|
11731
11743
|
});
|
|
11732
11744
|
});
|
|
11733
11745
|
};
|
|
11746
|
+
LookupService.prototype.getParkingSpots = function (query, commonOptions) {
|
|
11747
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
11748
|
+
return __generator(this, function (_a) {
|
|
11749
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
11750
|
+
.get(exports.Routes.GET_PARKING_SPOTS)
|
|
11751
|
+
.withQueryString(query)
|
|
11752
|
+
.setException('Failed to get parking spots from lookup service')
|
|
11753
|
+
.withCommonOptions(commonOptions)
|
|
11754
|
+
.invoke()];
|
|
11755
|
+
});
|
|
11756
|
+
});
|
|
11757
|
+
};
|
|
11734
11758
|
return LookupService;
|
|
11735
11759
|
}());
|
|
11736
11760
|
exports["default"] = LookupService;
|
|
@@ -21283,15 +21307,11 @@ var AuthService = /** @class */ (function () {
|
|
|
21283
21307
|
.handle(function (response) {
|
|
21284
21308
|
var message = response.message;
|
|
21285
21309
|
var _a = response, data = _a.data, status = _a.status;
|
|
21286
|
-
console.log('message = ', message);
|
|
21287
|
-
console.log('status = ', status);
|
|
21288
|
-
console.log('data = ', data);
|
|
21289
21310
|
if ((0, lodash_1.isUndefined)(status) ||
|
|
21290
21311
|
status === Enums_1.HttpStatusCode.NOT_FOUND ||
|
|
21291
21312
|
status === Enums_1.HttpStatusCode.INTERNAL_SERVER_ERROR) {
|
|
21292
21313
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(status), Enums_1.REGION_NOT_WORKING, new Error(message));
|
|
21293
21314
|
}
|
|
21294
|
-
console.log('well known errors');
|
|
21295
21315
|
//well known errors
|
|
21296
21316
|
if (status === Enums_1.HttpStatusCode.UNAUTHORIZED) {
|
|
21297
21317
|
(0, ServiceRequest_1.logErrorResponse)(response);
|
|
@@ -21300,28 +21320,23 @@ var AuthService = /** @class */ (function () {
|
|
|
21300
21320
|
}
|
|
21301
21321
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(status), 'Invalid user name or password');
|
|
21302
21322
|
}
|
|
21303
|
-
console.log('recaptcha');
|
|
21304
21323
|
//recaptcha
|
|
21305
21324
|
if (status === Enums_1.HttpStatusCode.LOCKED || AuthService.isRecaptchaNeeded(data)) {
|
|
21306
21325
|
(0, ServiceRequest_1.logErrorResponse)(response);
|
|
21307
21326
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(Enums_1.HttpStatusCode.LOCKED), 'Recaptcha validation needed', null, data.recaptcha_stoken);
|
|
21308
21327
|
}
|
|
21309
|
-
console.log('multiple merchants');
|
|
21310
21328
|
//multiple merchants
|
|
21311
21329
|
if (status === Enums_1.HttpStatusCode.FAILED_DEPENDENCY || AuthService.isRegionInformationNeeded(data)) {
|
|
21312
21330
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(Enums_1.HttpStatusCode.FAILED_DEPENDENCY), 'Merchant and region information needed', null, data.merchants_data);
|
|
21313
21331
|
}
|
|
21314
|
-
console.log('2FA required');
|
|
21315
21332
|
// 2FA required
|
|
21316
21333
|
if (status === Enums_1.HttpStatusCode.OK && data.otp_sent) {
|
|
21317
21334
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.OTP_REQUIRED, 'Two-factor Authentication is required. Please provide one time code', null, { expiration: data.expiration });
|
|
21318
21335
|
}
|
|
21319
|
-
console.log('success');
|
|
21320
21336
|
//success
|
|
21321
21337
|
if (status === Enums_1.HttpStatusCode.OK) {
|
|
21322
21338
|
return new User_1.default(data);
|
|
21323
21339
|
}
|
|
21324
|
-
console.log('unknown failure');
|
|
21325
21340
|
//unknown failure
|
|
21326
21341
|
(0, ServiceRequest_1.logErrorResponse)(response);
|
|
21327
21342
|
throw new BringgException_1.BringgException(ExceptionReason_1.ExceptionReason.fromHttpStatusCode(status), response.statusText);
|
|
@@ -22545,7 +22560,7 @@ var lodash_1 = __webpack_require__(96486);
|
|
|
22545
22560
|
var BringgException_1 = __webpack_require__(43605);
|
|
22546
22561
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
22547
22562
|
var abort_1 = __webpack_require__(34179);
|
|
22548
|
-
var version = '9.
|
|
22563
|
+
var version = '9.40.0';
|
|
22549
22564
|
function logErrorResponse(response) {
|
|
22550
22565
|
var data = response.data, status = response.status;
|
|
22551
22566
|
try {
|
|
@@ -24490,6 +24505,14 @@ var TaskEntity = /** @class */ (function (_super) {
|
|
|
24490
24505
|
.setException("failed to delete waypoint : task ".concat(taskId, ", waypoint ").concat(wayPointId))
|
|
24491
24506
|
.invoke();
|
|
24492
24507
|
};
|
|
24508
|
+
_this.getWayPointAnswers = function (taskId, wayPointId) {
|
|
24509
|
+
return _this.service.routeGenerator
|
|
24510
|
+
.get(Tasks_consts_1.Routes.GET_WAYPOINT_ANSWERS)
|
|
24511
|
+
.withRouteParams({ id: taskId, way_point_id: wayPointId })
|
|
24512
|
+
.setException("failed to get answers for task ".concat(taskId, " and waypoint ").concat(wayPointId))
|
|
24513
|
+
.withExtractor(Tasks_consts_1.answersExtractor)
|
|
24514
|
+
.invoke();
|
|
24515
|
+
};
|
|
24493
24516
|
// so we can past configuration in future
|
|
24494
24517
|
throttleTimeValue = throttleTimeValue || THROTTLE_TIME;
|
|
24495
24518
|
//group by and save ids | can add config to throttle through users( maybe increase if admin )
|
|
@@ -25032,6 +25055,9 @@ var Tasks = /** @class */ (function () {
|
|
|
25032
25055
|
Tasks.prototype.getInvalidTasksIds = function () {
|
|
25033
25056
|
return this.taskEntity.getInvalidTasksIds();
|
|
25034
25057
|
};
|
|
25058
|
+
Tasks.prototype.getWayPointAnswers = function (taskId, wayPointId) {
|
|
25059
|
+
return this.taskEntity.getWayPointAnswers(taskId, wayPointId);
|
|
25060
|
+
};
|
|
25035
25061
|
/**
|
|
25036
25062
|
* task methods
|
|
25037
25063
|
*/
|
|
@@ -25119,7 +25145,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
25119
25145
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
25120
25146
|
};
|
|
25121
25147
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
25122
|
-
exports.taskDefaultFields = exports.Routes = exports.baseRoute = exports.TaskRealTimeEvents = exports.quotesExtractor = exports.formExtractor = exports.taskIdsExtractor = exports.scanCodeExtractor = exports.locationExtractor = exports.childTasksExtractor = exports.tasksExtractor = exports.successExtractor = exports.taskExtractor = exports.defaultExtractor = exports.noteTypes = exports.taskToGroupMapper = exports.groupFilter = exports.TaskGroupTypes = exports.GROUP_VALUES = exports.DONE_TASK_STATUES = exports.OPEN_TASK_STATUES = void 0;
|
|
25148
|
+
exports.taskDefaultFields = exports.Routes = exports.baseRoute = exports.TaskRealTimeEvents = exports.answersExtractor = exports.quotesExtractor = exports.formExtractor = exports.taskIdsExtractor = exports.scanCodeExtractor = exports.locationExtractor = exports.childTasksExtractor = exports.tasksExtractor = exports.successExtractor = exports.taskExtractor = exports.defaultExtractor = exports.noteTypes = exports.taskToGroupMapper = exports.groupFilter = exports.TaskGroupTypes = exports.GROUP_VALUES = exports.DONE_TASK_STATUES = exports.OPEN_TASK_STATUES = void 0;
|
|
25123
25149
|
var types_1 = __webpack_require__(63127);
|
|
25124
25150
|
var TaskHelpers_1 = __webpack_require__(73119);
|
|
25125
25151
|
exports.OPEN_TASK_STATUES = [
|
|
@@ -25199,6 +25225,8 @@ var formExtractor = function (response) { return response.form; };
|
|
|
25199
25225
|
exports.formExtractor = formExtractor;
|
|
25200
25226
|
var quotesExtractor = function (response) { return response.quotes; };
|
|
25201
25227
|
exports.quotesExtractor = quotesExtractor;
|
|
25228
|
+
var answersExtractor = function (response) { return response.answers; };
|
|
25229
|
+
exports.answersExtractor = answersExtractor;
|
|
25202
25230
|
var TaskRealTimeEvents;
|
|
25203
25231
|
(function (TaskRealTimeEvents) {
|
|
25204
25232
|
TaskRealTimeEvents["TASK_UPDATE"] = "task update";
|
|
@@ -25249,7 +25277,8 @@ exports.Routes = {
|
|
|
25249
25277
|
IMPORT_TASKS_CSV: "".concat(exports.baseRoute, "/import_from_csv"),
|
|
25250
25278
|
BROADCAST_TO_DRIVERS: "".concat(exports.baseRoute, "/broadcast_to_drivers"),
|
|
25251
25279
|
CREATE_TASK_NOTE: "".concat(exports.baseRoute, "/{:id}/way_points/{:way_point_id}/task_notes"),
|
|
25252
|
-
DELETE_WAYPOINT: "".concat(exports.baseRoute, "/{:id}/way_points/{:way_point_id}")
|
|
25280
|
+
DELETE_WAYPOINT: "".concat(exports.baseRoute, "/{:id}/way_points/{:way_point_id}"),
|
|
25281
|
+
GET_WAYPOINT_ANSWERS: "".concat(exports.baseRoute, "/{:id}/way_points/{:way_point_id}/answers")
|
|
25253
25282
|
};
|
|
25254
25283
|
// keep this here in case we need, all this data is required by frontend currently
|
|
25255
25284
|
//const PLANNING_DEFAULT_PARAMS_REQUEST = "first_way_point_has_to_leave_by,active_way_point_id,status,id,way_points.all.position,group_leader_id,priority,late,customer_id,way_points.all.customer_id,way_points.all.id,payment_type_name,task_inventories.all.id,task_inventories.all.way_point_id,task_inventories.all.pending,task_inventories.all.inventory,task_inventories.all.original_quantity,ready_to_execute,virtual_task,done_planning,task_type_id,rogue_reasons,invalidated,automatically_assigned,external_id,title,tag_id,created_at,user_id,way_points.all.late,way_points.all.done,way_points.all.address,planning_done,scheduled_at,way_points.first.address,way_points.last.address,total_price,fleet_id,lat,lng,way_points.all.lat,way_points.all.lng,way_points.all.scheduled_at,team_ids,way_points.all.customer,way_points.all.eta,route_name,run,dispatcher_id,preparation_status,preparation_start_time_planned,preparation_end_time_planned,preparation_ready_for_pickup_time_planned,payment_method,preparation_external_id,fleet_delivery_external_id";
|