@p2pmodels/connect-round-robin
Advanced tools
Comparing version 1.0.0-beta.16 to 1.0.0-beta.17
@@ -9,4 +9,5 @@ import { IRoundRobinConnector, UserData, TaskData } from '../types'; | ||
readonly allocatedTasks: TaskData[]; | ||
readonly acceptedTasks: TaskData[]; | ||
constructor(data: UserData, connector: IRoundRobinConnector); | ||
} | ||
//# sourceMappingURL=User.d.ts.map |
@@ -12,3 +12,2 @@ "use strict"; | ||
class User { | ||
// readonly acceptedTasks: TaskData[] | ||
// readonly rejectedTasks: TaskData[] | ||
@@ -23,3 +22,3 @@ constructor(data, connector) { | ||
this.allocatedTasks = data.allocatedTasks; | ||
// this.acceptedTasks = data.acceptedTasks | ||
this.acceptedTasks = data.acceptedTasks; | ||
// this.rejectedTasks = data.rejectedTasks | ||
@@ -26,0 +25,0 @@ } |
@@ -9,2 +9,3 @@ "use strict"; | ||
const User_1 = __importDefault(require("../../models/User")); | ||
const types_1 = require("../../types"); | ||
function parseUser(result, connector) { | ||
@@ -15,6 +16,9 @@ var _a; | ||
throw new errors_1.ErrorUnexpectedResult('Unable to parse user.'); | ||
const allocatedTasks = (_a = user.allocatedTasks) === null || _a === void 0 ? void 0 : _a.map((t) => t); | ||
const tasks = (_a = user.allocatedTasks) === null || _a === void 0 ? void 0 : _a.map((t) => t); | ||
const allocatedTasks = tasks.filter((t) => t.status === types_1.ASSIGNED_STATUS); | ||
const acceptedTasks = tasks.filter((t) => t.status === types_1.ACCEPTED_STATUS); | ||
const data = { | ||
...user, | ||
allocatedTasks, | ||
acceptedTasks, | ||
}; | ||
@@ -21,0 +25,0 @@ return user ? new User_1.default(data, connector) : null; |
@@ -10,2 +10,4 @@ import Config from './models/Config'; | ||
export declare const ALL_TASK_STATUSES: number[]; | ||
export declare const ASSIGNED_STATUS = "Assigned"; | ||
export declare const ACCEPTED_STATUS = "Accepted"; | ||
export interface ConfigData { | ||
@@ -12,0 +14,0 @@ id: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ALL_TASK_STATUSES = void 0; | ||
exports.ACCEPTED_STATUS = exports.ASSIGNED_STATUS = exports.ALL_TASK_STATUSES = void 0; | ||
exports.ALL_TASK_STATUSES = [0, 1, 2, 3, 4, 5]; | ||
exports.ASSIGNED_STATUS = 'Assigned'; | ||
exports.ACCEPTED_STATUS = 'Accepted'; | ||
//# sourceMappingURL=types.js.map |
@@ -9,4 +9,5 @@ import { IRoundRobinConnector, UserData, TaskData } from '../types'; | ||
readonly allocatedTasks: TaskData[]; | ||
readonly acceptedTasks: TaskData[]; | ||
constructor(data: UserData, connector: IRoundRobinConnector); | ||
} | ||
//# sourceMappingURL=User.d.ts.map |
@@ -12,3 +12,2 @@ "use strict"; | ||
class User { | ||
// readonly acceptedTasks: TaskData[] | ||
// readonly rejectedTasks: TaskData[] | ||
@@ -23,3 +22,3 @@ constructor(data, connector) { | ||
this.allocatedTasks = data.allocatedTasks; | ||
// this.acceptedTasks = data.acceptedTasks | ||
this.acceptedTasks = data.acceptedTasks; | ||
// this.rejectedTasks = data.rejectedTasks | ||
@@ -26,0 +25,0 @@ } |
@@ -9,2 +9,3 @@ "use strict"; | ||
const User_1 = __importDefault(require("../../models/User")); | ||
const types_1 = require("../../types"); | ||
function parseUser(result, connector) { | ||
@@ -15,6 +16,9 @@ var _a; | ||
throw new errors_1.ErrorUnexpectedResult('Unable to parse user.'); | ||
const allocatedTasks = (_a = user.allocatedTasks) === null || _a === void 0 ? void 0 : _a.map((t) => t); | ||
const tasks = (_a = user.allocatedTasks) === null || _a === void 0 ? void 0 : _a.map((t) => t); | ||
const allocatedTasks = tasks.filter((t) => t.status === types_1.ASSIGNED_STATUS); | ||
const acceptedTasks = tasks.filter((t) => t.status === types_1.ACCEPTED_STATUS); | ||
const data = { | ||
...user, | ||
allocatedTasks, | ||
acceptedTasks, | ||
}; | ||
@@ -21,0 +25,0 @@ return user ? new User_1.default(data, connector) : null; |
@@ -10,2 +10,4 @@ import Config from './models/Config'; | ||
export declare const ALL_TASK_STATUSES: number[]; | ||
export declare const ASSIGNED_STATUS = "Assigned"; | ||
export declare const ACCEPTED_STATUS = "Accepted"; | ||
export interface ConfigData { | ||
@@ -12,0 +14,0 @@ id: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ALL_TASK_STATUSES = void 0; | ||
exports.ACCEPTED_STATUS = exports.ASSIGNED_STATUS = exports.ALL_TASK_STATUSES = void 0; | ||
exports.ALL_TASK_STATUSES = [0, 1, 2, 3, 4, 5]; | ||
exports.ASSIGNED_STATUS = 'Assigned'; | ||
exports.ACCEPTED_STATUS = 'Accepted'; | ||
//# sourceMappingURL=types.js.map |
{ | ||
"name": "@p2pmodels/connect-round-robin", | ||
"version": "1.0.0-beta.16", | ||
"version": "1.0.0-beta.17", | ||
"license": "LGPL-3.0-or-later", | ||
@@ -5,0 +5,0 @@ "description": "Aragon connector to access and interact with Round Robin task allocation app", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
636097
1470