@bringg/dashboard-sdk 9.46.1 → 9.48.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 +4 -0
- package/dist/BringgDashboardSDK.js +4 -0
- package/dist/BringgDashboardSDK.js.map +1 -1
- package/dist/CustomAttributes/CustomAttributesGroupApi.d.ts +10 -0
- package/dist/CustomAttributes/CustomAttributesGroupApi.js +79 -0
- package/dist/CustomAttributes/CustomAttributesGroupApi.js.map +1 -0
- package/dist/CustomAttributes/Entity/CustomAttributesGroupsEntity.d.ts +10 -0
- package/dist/CustomAttributes/Entity/CustomAttributesGroupsEntity.js +124 -0
- package/dist/CustomAttributes/Entity/CustomAttributesGroupsEntity.js.map +1 -0
- package/dist/Services/ServiceRequest.js +1 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-api.js +1 -18
- package/dist/TaskManagedAttributes/task-managed-attributes-api.js.map +1 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-realtime-subscriptions.d.ts +1 -1
- package/dist/TaskManagedAttributes/task-managed-attributes-realtime-subscriptions.js +8 -20
- package/dist/TaskManagedAttributes/task-managed-attributes-realtime-subscriptions.js.map +1 -1
- package/dist/User/User.consts.d.ts +12 -1
- package/dist/User/User.consts.js +14 -1
- package/dist/User/User.consts.js.map +1 -1
- package/dist/User/v2/users-api.d.ts +17 -0
- package/dist/User/v2/users-api.js +92 -0
- package/dist/User/v2/users-api.js.map +1 -0
- package/dist/User/v2/users-service.d.ts +9 -0
- package/dist/User/v2/users-service.js +73 -0
- package/dist/User/v2/users-service.js.map +1 -0
- package/dist/bringg-dashboard-sdk-cjs2.js +465 -42
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +55 -11
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var merge_mapper_1 = require("../../Data/merge-mapper");
|
|
43
|
+
var storable_realtime_subscriptions_1 = __importDefault(require("../../Data/storable-realtime-subscriptions"));
|
|
44
|
+
var data_store_1 = __importDefault(require("../../data-store"));
|
|
45
|
+
var storable_data_service_1 = __importDefault(require("../../storable-data-service"));
|
|
46
|
+
var User_consts_1 = require("../User.consts");
|
|
47
|
+
var users_service_1 = __importDefault(require("./users-service"));
|
|
48
|
+
var UsersApi = /** @class */ (function () {
|
|
49
|
+
function UsersApi(session) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
this.userStore = new data_store_1.default(undefined, { shallow: true });
|
|
52
|
+
this.usersService = new users_service_1.default(session);
|
|
53
|
+
this.storableDataService = new storable_data_service_1.default(this.userStore, function (user) {
|
|
54
|
+
return merge_mapper_1.mergeMapper.mergeIntoExisting(_this.userStore, user);
|
|
55
|
+
});
|
|
56
|
+
this.storableRealtimeSubscriptions = new storable_realtime_subscriptions_1.default(session, this.userStore, this.storableDataService);
|
|
57
|
+
this.storableRealtimeSubscriptions.updateStoreOnEvents([{ name: User_consts_1.RealtimeEvents.Update, isDelete: false }]);
|
|
58
|
+
}
|
|
59
|
+
UsersApi.prototype.loadAll = function (options) {
|
|
60
|
+
var _this = this;
|
|
61
|
+
return this.storableDataService.loadAll('loadAll', function () { return _this.usersService.loadAll(options); }, options);
|
|
62
|
+
};
|
|
63
|
+
UsersApi.prototype.getGroup = function (group) {
|
|
64
|
+
return this.userStore.getGroup(User_consts_1.UserGroupTypes.Main, group);
|
|
65
|
+
};
|
|
66
|
+
UsersApi.prototype.get = function (id) {
|
|
67
|
+
return this.userStore.get(id);
|
|
68
|
+
};
|
|
69
|
+
UsersApi.prototype.getMany = function (ids) {
|
|
70
|
+
return this.userStore.getMany(ids);
|
|
71
|
+
};
|
|
72
|
+
UsersApi.prototype.onUpdate = function (callback) {
|
|
73
|
+
return this.storableRealtimeSubscriptions.onEvent(User_consts_1.RealtimeEvents.Update, callback);
|
|
74
|
+
};
|
|
75
|
+
UsersApi.prototype.loadDriversByTeam = function (teamId) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
var users;
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
switch (_a.label) {
|
|
80
|
+
case 0: return [4 /*yield*/, this.usersService.loadAllByTeams(teamId)];
|
|
81
|
+
case 1:
|
|
82
|
+
users = _a.sent();
|
|
83
|
+
this.storableDataService.updateManyInStores(users);
|
|
84
|
+
return [2 /*return*/, users];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return UsersApi;
|
|
90
|
+
}());
|
|
91
|
+
exports.default = UsersApi;
|
|
92
|
+
//# sourceMappingURL=users-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users-api.js","sourceRoot":"","sources":["../../../src/User/v2/users-api.ts"],"names":[],"mappings":";;;;;;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AAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IAEM,0BAAO,GAAd,UAAe,GAAa;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,2BAAQ,GAAf,UAAgB,QAAkD;QACjE,OAAO,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC,4BAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACpF,CAAC;IAEY,oCAAiB,GAA9B,UAA+B,MAAc;;;;;4BAC9B,qBAAM,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,EAAA;;wBAAtD,KAAK,GAAG,SAA8C;wBAE5D,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;wBAEnD,sBAAO,KAAK,EAAC;;;;KACb;IACF,eAAC;AAAD,CAAC,AAlDD,IAkDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { User } from '@bringg/types';
|
|
2
|
+
import { CommonOptions } from '../../Core/RouteGenerator';
|
|
3
|
+
import Session from '../../Services/Identity/Session';
|
|
4
|
+
export default class UsersService {
|
|
5
|
+
private readonly service;
|
|
6
|
+
constructor(session: Session);
|
|
7
|
+
loadAll(commonOptions?: CommonOptions): Promise<User[]>;
|
|
8
|
+
loadAllByTeams(teamId: number, commonOptions?: CommonOptions): Promise<User[]>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var CrudService_1 = __importDefault(require("../../Core/CrudService"));
|
|
43
|
+
var User_consts_1 = require("../User.consts");
|
|
44
|
+
var UsersService = /** @class */ (function () {
|
|
45
|
+
function UsersService(session) {
|
|
46
|
+
this.service = new CrudService_1.default(session, 'users');
|
|
47
|
+
}
|
|
48
|
+
UsersService.prototype.loadAll = function (commonOptions) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
switch (_a.label) {
|
|
52
|
+
case 0: return [4 /*yield*/, this.service.getAll('', commonOptions)];
|
|
53
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
UsersService.prototype.loadAllByTeams = function (teamId, commonOptions) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
+
return __generator(this, function (_a) {
|
|
61
|
+
return [2 /*return*/, this.service.routeGenerator
|
|
62
|
+
.get(User_consts_1.Routes.GET_DRIVERS_BY_TEAM)
|
|
63
|
+
.withRouteParams({ teamId: teamId })
|
|
64
|
+
.setException("failed to get teams drivers for team ".concat(teamId))
|
|
65
|
+
.withCommonOptions(commonOptions)
|
|
66
|
+
.invoke()];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return UsersService;
|
|
71
|
+
}());
|
|
72
|
+
exports.default = UsersService;
|
|
73
|
+
//# sourceMappingURL=users-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users-service.js","sourceRoot":"","sources":["../../../src/User/v2/users-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uEAAiD;AAGjD,8CAAwC;AAExC;IAGC,sBAAY,OAAgB;QAC3B,IAAI,CAAC,OAAO,GAAG,IAAI,qBAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAEY,8BAAO,GAApB,UAAqB,aAA6B;;;;4BAC1C,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,aAAa,CAAC,EAAA;4BAAnD,sBAAO,SAA4C,EAAC;;;;KACpD;IAEY,qCAAc,GAA3B,UAA4B,MAAc,EAAE,aAA6B;;;gBACxE,sBAAO,IAAI,CAAC,OAAO,CAAC,cAAc;yBAChC,GAAG,CAAC,oBAAM,CAAC,mBAAmB,CAAC;yBAC/B,eAAe,CAAC,EAAE,MAAM,QAAA,EAAE,CAAC;yBAC3B,YAAY,CAAC,+CAAwC,MAAM,CAAE,CAAC;yBAC9D,iBAAiB,CAAC,aAAa,CAAC;yBAChC,MAAM,EAAE,EAAC;;;KACX;IACF,mBAAC;AAAD,CAAC,AAnBD,IAmBC"}
|