diff --git a/back/models/image.js b/back/models/image.js index 78d159940..a35018814 100644 --- a/back/models/image.js +++ b/back/models/image.js @@ -1,11 +1,51 @@ const fs = require('fs-extra'); const sharp = require('sharp'); const path = require('path'); +const readChunk = require('read-chunk'); +const imageType = require('image-type'); +const bmp = require('bmp-js'); module.exports = Self => { require('../methods/image/download')(Self); require('../methods/image/upload')(Self); + // Function extracted from jimp package (utils) + function scan(image, x, y, w, h, f) { + // round input + x = Math.round(x); + y = Math.round(y); + w = Math.round(w); + h = Math.round(h); + + for (let _y = y; _y < y + h; _y++) { + for (let _x = x; _x < x + w; _x++) { + const idx = (image.bitmap.width * _y + _x) << 2; + f.call(image, _x, _y, idx); + } + } + + return image; + } + + // Function extracted from jimp package (type-bmp) + function fromAGBR(bitmap) { + return scan({bitmap}, 0, 0, bitmap.width, bitmap.height, function( + x, + y, + index + ) { + const alpha = this.bitmap.data[index + 0]; + const blue = this.bitmap.data[index + 1]; + const green = this.bitmap.data[index + 2]; + const red = this.bitmap.data[index + 3]; + + this.bitmap.data[index + 0] = red; + this.bitmap.data[index + 1] = green; + this.bitmap.data[index + 2] = blue; + this.bitmap.data[index + 3] = bitmap.is_with_alpha ? alpha : 0xff; + }).bitmap; + } + Self.registerImage = async(collectionName, srcFilePath, fileName, entityId) => { const models = Self.app.models; const tx = await Self.beginTransaction({}); @@ -48,13 +88,31 @@ module.exports = Self => { const dstDir = path.join(collectionDir, 'full'); const dstFile = path.join(dstDir, file); + const buffer = readChunk.sync(srcFilePath, 0, 12); + const type = imageType(buffer); + + let sharpOptions; + let imgSrc = srcFilePath; + if (type.mime == 'image/bmp') { + const bmpBuffer = fs.readFileSync(srcFilePath); + const bmpData = fromAGBR(bmp.decode(bmpBuffer)); + imgSrc = bmpData.data; + sharpOptions = { + raw: { + width: bmpData.width, + height: bmpData.height, + channels: 4 + } + }; + } + const resizeOpts = { withoutEnlargement: true, fit: 'inside' }; await fs.mkdir(dstDir, {recursive: true}); - await sharp(srcFilePath, {failOnError: false}) + await sharp(imgSrc, sharpOptions) .resize(collection.maxWidth, collection.maxHeight, resizeOpts) .png() .toFile(dstFile); @@ -69,7 +127,7 @@ module.exports = Self => { }; await fs.mkdir(dstDir, {recursive: true}); - await sharp(srcFilePath, {failOnError: false}) + await sharp(imgSrc, sharpOptions) .resize(size.width, size.height, resizeOpts) .png() .toFile(dstFile); diff --git a/front/core/components/table/style.scss b/front/core/components/table/style.scss index 7d90d4db6..a3c339b5f 100644 --- a/front/core/components/table/style.scss +++ b/front/core/components/table/style.scss @@ -174,4 +174,9 @@ vn-table { .vn-check { margin: 0; } + .empty-rows { + color: $color-font-secondary; + font-size: 1.375rem; + text-align: center; + } } \ No newline at end of file diff --git a/modules/client/back/methods/client/lastActiveTickets.js b/modules/client/back/methods/client/lastActiveTickets.js index c69c860c9..7444dff45 100644 --- a/modules/client/back/methods/client/lastActiveTickets.js +++ b/modules/client/back/methods/client/lastActiveTickets.js @@ -26,15 +26,25 @@ module.exports = Self => { Self.lastActiveTickets = async(id, ticketId) => { const ticket = await Self.app.models.Ticket.findById(ticketId); const query = ` - SELECT t.id, t.shipped, a.name AS agencyName, w.name AS warehouseName, ad.city AS address - FROM vn.ticket t - JOIN vn.ticketState ts ON t.id = ts.ticketFk - JOIN vn.agencyMode a ON t.agencyModeFk = a.id - JOIN vn.warehouse w ON t.warehouseFk = w.id - JOIN vn.address ad ON t.addressFk = ad.id - WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 - AND t.id <> ? AND t.warehouseFk = ? - ORDER BY t.shipped + SELECT + t.id, + t.shipped, + a.name AS agencyName, + w.name AS warehouseName, + ad.nickname AS nickname, + ad.city AS city, + ad.postalCode AS postalCode, + ad.street AS street, + pr.name AS name + FROM ticket t + JOIN vn.ticketState ts ON t.id = ts.ticketFk + JOIN vn.agencyMode a ON t.agencyModeFk = a.id + JOIN vn.warehouse w ON t.warehouseFk = w.id + JOIN vn.address ad ON t.addressFk = ad.id + JOIN vn.province pr ON ad.provinceFk = pr.id + WHERE t.shipped >= CURDATE() AND t.clientFk = ? AND ts.alertLevel = 0 + AND t.id <> ? AND t.warehouseFk = ? + ORDER BY t.shipped LIMIT 10`; return Self.rawSql(query, [id, ticketId, ticket.warehouseFk]); diff --git a/modules/client/back/methods/client/specs/lastActiveTickets.spec.js b/modules/client/back/methods/client/specs/lastActiveTickets.spec.js new file mode 100644 index 000000000..8d06e0584 --- /dev/null +++ b/modules/client/back/methods/client/specs/lastActiveTickets.spec.js @@ -0,0 +1,18 @@ +const app = require('vn-loopback/server/server'); + +describe('Client last active tickets', () => { + it('should receive an array of last active tickets of Bruce Wayne', async() => { + const ticketId = 22; + const clientId = 109; + const warehouseId = 5; + const result = await app.models.Client.lastActiveTickets(clientId, ticketId, warehouseId); + + const length = result.length; + const anyResult = result[Math.floor(Math.random() * Math.floor(length))]; + + const properties = Object.keys(anyResult); + + expect(properties.length).toEqual(9); + expect(result.length).toEqual(3); + }); +}); diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index 10c41dd92..5d0c513df 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -78,6 +78,8 @@ module.exports = Self => { return {'ic.id': value}; case 'salesPersonFk': return {'it.workerFk': value}; + case 'code': + return {'it.code': value}; case 'typeFk': return {'i.typeFk': value}; case 'active': @@ -103,6 +105,7 @@ module.exports = Self => { i.id AS itemFk, i.size, i.density, + it.code, i.typeFk, i.family, i.isActive, diff --git a/modules/entry/front/latest-buys/index.html b/modules/entry/front/latest-buys/index.html index 6c4802816..34f6464fc 100644 --- a/modules/entry/front/latest-buys/index.html +++ b/modules/entry/front/latest-buys/index.html @@ -37,8 +37,8 @@ Quantity Description Size - Tags - Type + Tags + Type Intrastat Origin Density @@ -109,7 +109,7 @@ - {{::buy.type}} + {{::buy.code}} {{::buy.intrastat}} diff --git a/modules/item/back/methods/item-image-queue/downloadImages.js b/modules/item/back/methods/item-image-queue/downloadImages.js index e3412d6a8..2d2e8af91 100644 --- a/modules/item/back/methods/item-image-queue/downloadImages.js +++ b/modules/item/back/methods/item-image-queue/downloadImages.js @@ -46,13 +46,8 @@ module.exports = Self => { if (!image) return; - const srcFile = image.url.split('/').pop(); - const dotIndex = srcFile.lastIndexOf('.'); - - let fileName = srcFile.substring(0, dotIndex); - if (dotIndex == -1) - fileName = srcFile; - + const srcFile = image.url; + const fileName = srcFile.replace(/\.|\/|:|\?|\\|=|%/g, ''); const file = `${fileName}.png`; const filePath = path.join(tempPath, file); diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index f392dba87..eba0b0f91 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -44,6 +44,10 @@ module.exports = Self => { arg: 'description', type: 'String', description: 'The item description', + }, { + arg: 'stemMultiplier', + type: 'Integer', + description: 'The item multiplier', } ], returns: { @@ -80,16 +84,22 @@ module.exports = Self => { : {or: [{'i.name': {like: `%${value}%`}}, codeWhere]}; case 'id': return {'i.id': value}; - case 'description': - return {'i.description': {like: `%${value}%`}}; - case 'categoryFk': - return {'ic.id': value}; - case 'salesPersonFk': - return {'t.workerFk': value}; - case 'typeFk': - return {'i.typeFk': value}; case 'isActive': return {'i.isActive': value}; + case 'multiplier': + return {'i.stemMultiplier': value}; + case 'typeFk': + return {'i.typeFk': value}; + case 'category': + return {'ic.name': value}; + case 'salesPersonFk': + return {'it.workerFk': value}; + case 'origin': + return {'ori.code': value}; + case 'niche': + return {'ip.code': value}; + case 'intrastat': + return {'intr.description': value}; } }); filter = mergeFilters(filter, {where}); @@ -98,7 +108,8 @@ module.exports = Self => { let stmt; stmt = new ParameterizedSQL( - `SELECT i.id, + `SELECT + i.id, i.image, i.name, i.description, @@ -111,29 +122,30 @@ module.exports = Self => { i.tag10, i.value10, i.subName, i.isActive, - t.name type, - t.workerFk buyerFk, - u.name userName, - intr.description AS intrastat, i.stems, - ori.code AS origin, - ic.name AS category, i.density, i.stemMultiplier, + i.typeFk, + it.name AS typeName, + it.workerFk AS buyerFk, + u.name AS userName, + ori.code AS origin, + ic.name AS category, + intr.description AS intrastat, b.grouping, b.packing, - itn.code AS niche, @visibleCalc + ip.code AS niche, @visibleCalc FROM item i - LEFT JOIN itemType t ON t.id = i.typeFk - LEFT JOIN itemCategory ic ON ic.id = t.categoryFk - LEFT JOIN worker w ON w.id = t.workerFk + LEFT JOIN itemType it ON it.id = i.typeFk + LEFT JOIN itemCategory ic ON ic.id = it.categoryFk + LEFT JOIN worker w ON w.id = it.workerFk LEFT JOIN account.user u ON u.id = w.userFk LEFT JOIN intrastat intr ON intr.id = i.intrastatFk LEFT JOIN producer pr ON pr.id = i.producerFk LEFT JOIN origin ori ON ori.id = i.originFk - LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = t.warehouseFk + LEFT JOIN cache.last_buy lb ON lb.item_id = i.id AND lb.warehouse_id = it.warehouseFk LEFT JOIN vn.buy b ON b.id = lb.buy_id - LEFT JOIN itemPlacement itn ON itn.itemFk = i.id AND itn.warehouseFk = t.warehouseFk` + LEFT JOIN itemPlacement ip ON ip.itemFk = i.id AND ip.warehouseFk = it.warehouseFk` ); if (ctx.args.tags) { diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 3f049675c..cec7a063f 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -113,6 +113,12 @@ ng-model="$ctrl.item.stems" rule> + + - - - - - Id - Grouping - Packing - Description - Stems - Size - Niche - Type - Category - Intrastat - Origin - Buyer - Density - Multiplier - Active - - - - - - - - - - - {{::item.id}} - - - {{::item.grouping | dashIfEmpty}} - {{::item.packing | dashIfEmpty}} - - {{::item.name}} - -

{{::item.subName}}

-
- - -
- {{::item.stems}} - {{::item.size}} - {{::item.niche}} - - {{::item.type}} - - - {{::item.category}} - - - {{::item.intrastat}} - - {{::item.origin}} - - - {{::item.userName}} - - - {{::item.density}} - {{::item.stemMultiplier}} - - - - - - - - - - - - -
-
-
+ + + + + Id + Grouping + Packing + Description + Stems + Size + Niche + Type + Category + Intrastat + Origin + Buyer + Density + Multiplier + Active + + + + + + + + + + + {{::item.id}} + + + {{::item.grouping | dashIfEmpty}} + {{::item.packing | dashIfEmpty}} + + {{::item.name}} + +

{{::item.subName}}

+
+ + +
+ {{::item.stems}} + {{::item.size}} + {{::item.niche}} + + {{::item.typeName}} + + + {{::item.category}} + + + {{::item.intrastat}} + + {{::item.origin}} + + + {{::item.userName}} + + + {{::item.density}} + {{::item.stemMultiplier}} + + + + + + + + + + + + +
+
+
@@ -127,4 +127,31 @@ - \ No newline at end of file + + + + + Filter by selection + + + Exclude selection + + + Remove filter + + + Remove all filters + + + \ No newline at end of file diff --git a/modules/item/front/index/index.js b/modules/item/front/index/index.js index cafa3e475..175beb88a 100644 --- a/modules/item/front/index/index.js +++ b/modules/item/front/index/index.js @@ -11,6 +11,36 @@ class Controller extends Section { }; } + exprBuilder(param, value) { + switch (param) { + case 'category': + return {'ic.name': value}; + case 'salesPersonFk': + return {'it.workerFk': value}; + case 'grouping': + return {'b.grouping': value}; + case 'packing': + return {'b.packing': value}; + case 'origin': + return {'ori.code': value}; + case 'niche': + return {'ip.code': value}; + case 'typeFk': + return {'i.typeFk': value}; + case 'intrastat': + return {'intr.description': value}; + case 'id': + case 'size': + case 'name': + case 'subname': + case 'isActive': + case 'density': + case 'stemMultiplier': + case 'stems': + return {[`i.${param}`]: value}; + } + } + onCloneAccept(itemFk) { return this.$http.post(`Items/${itemFk}/clone`) .then(res => { diff --git a/modules/item/front/request-search-panel/index.html b/modules/item/front/request-search-panel/index.html index 10d5f9762..7d3a9f1a5 100644 --- a/modules/item/front/request-search-panel/index.html +++ b/modules/item/front/request-search-panel/index.html @@ -1,6 +1,6 @@
-
- + + - + {{nickname}} - + - +
+ + ng-model="filter.from" + on-change="$ctrl.from = value"> + ng-model="filter.to" + on-change="$ctrl.to = value"> + Or + + + + - +
+ {{name}} - + diff --git a/modules/item/front/request-search-panel/index.js b/modules/item/front/request-search-panel/index.js index 823346e30..556bdd874 100644 --- a/modules/item/front/request-search-panel/index.js +++ b/modules/item/front/request-search-panel/index.js @@ -11,6 +11,35 @@ class Controller extends SearchPanel { {code: 'denied', name: this.$t('Denied')} ]; } + + get from() { + return this._from; + } + + set from(value) { + this._from = value; + this.filter.scopeDays = null; + } + + get to() { + return this._to; + } + + set to(value) { + this._to = value; + this.filter.scopeDays = null; + } + + get scopeDays() { + return this._scopeDays; + } + + set scopeDays(value) { + this._scopeDays = value; + + this.filter.from = null; + this.filter.to = null; + } } ngModule.vnComponent('vnRequestSearchPanel', { diff --git a/modules/item/front/request-search-panel/index.spec.js b/modules/item/front/request-search-panel/index.spec.js new file mode 100644 index 000000000..2fb339209 --- /dev/null +++ b/modules/item/front/request-search-panel/index.spec.js @@ -0,0 +1,48 @@ +import './index'; + +describe(' Component vnRequestSearchPanel', () => { + let controller; + + beforeEach(ngModule('item')); + + beforeEach(inject($componentController => { + controller = $componentController('vnRequestSearchPanel', {$element: null}); + controller.$t = () => {}; + controller.filter = {}; + })); + + describe('from() setter', () => { + it('should clear the scope days when setting the from property', () => { + controller.filter.scopeDays = 1; + + controller.from = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.from).toBeDefined(); + }); + }); + + describe('to() setter', () => { + it('should clear the scope days when setting the to property', () => { + controller.filter.scopeDays = 1; + + controller.to = new Date(); + + expect(controller.filter.scopeDays).toBeNull(); + expect(controller.to).toBeDefined(); + }); + }); + + describe('scopeDays() setter', () => { + it('should clear the date range when setting the scopeDays property', () => { + controller.filter.from = new Date(); + controller.filter.to = new Date(); + + controller.scopeDays = 1; + + expect(controller.filter.from).toBeNull(); + expect(controller.filter.to).toBeNull(); + expect(controller.scopeDays).toBeDefined(); + }); + }); +}); diff --git a/modules/item/front/request/index.html b/modules/item/front/request/index.html index 9b129a017..ffbe9a712 100644 --- a/modules/item/front/request/index.html +++ b/modules/item/front/request/index.html @@ -10,9 +10,10 @@ diff --git a/modules/item/front/request/index.js b/modules/item/front/request/index.js index 231d5eda7..2fe08ada6 100644 --- a/modules/item/front/request/index.js +++ b/modules/item/front/request/index.js @@ -15,7 +15,6 @@ export default class Controller extends Section { nextWeek.setDate(nextWeek.getDate() + 7); this.filterParams = { - mine: true, from: today, to: nextWeek, state: 'pending' @@ -23,6 +22,24 @@ export default class Controller extends Section { } } + fetchParams($params) { + if (!Object.entries($params).length) + $params.scopeDays = 1; + + if (typeof $params.scopeDays === 'number') { + const from = new Date(); + from.setHours(0, 0, 0, 0); + + const to = new Date(from.getTime()); + to.setDate(to.getDate() + $params.scopeDays); + to.setHours(23, 59, 59, 999); + + Object.assign($params, {from, to}); + } + + return $params; + } + getState(isOk) { if (isOk === null) return 'Pending'; diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 59ceaebbe..67d3bf3c6 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -55,6 +55,9 @@ + +
- \ No newline at end of file + + + \ No newline at end of file diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index d7dfa802c..585feb063 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -326,31 +326,49 @@ icon="info">
- - - - Id - Shipped - Agency - Warehouse - Address - - - - - - + + + Id + Shipped + Agency + Address + + + + - {{::ticket.id}} - {{::ticket.shipped | date: 'dd/MM/yyyy'}} - {{::ticket.agencyName}} - {{::ticket.warehouseName}} - {{::ticket.address}} - - - + {{::ticket.id}} + {{::ticket.shipped | date: 'dd/MM/yyyy'}} + {{::ticket.agencyName}} + {{::ticket.address}} + + {{::ticket.nickname}} + {{::ticket.name}} + {{::ticket.street}} + {{::ticket.postalCode}} + {{::ticket.city}} + + + + + + No results + + + +
{ Self.remoteMethod('getAverageDays', { description: 'Returns the average days duration and the two warehouses of the travel.', @@ -8,7 +9,7 @@ module.exports = Self => { required: true }], returns: { - type: 'number', + type: 'object', root: true }, http: { @@ -18,15 +19,48 @@ module.exports = Self => { }); Self.getAverageDays = async agencyModeFk => { - const query = ` - SELECT t.id, t.warehouseInFk, t.warehouseOutFk, - (SELECT ROUND(AVG(DATEDIFF(t.landed, t.shipped ))) - FROM travel t - WHERE t.agencyFk = ? LIMIT 50) AS dayDuration - FROM travel t - WHERE t.agencyFk = ? ORDER BY t.id DESC LIMIT 1;`; + const conn = Self.dataSource.connector; + let stmts = []; + + stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.travel'); + + stmt = new ParameterizedSQL(` + CREATE TEMPORARY TABLE tmp.travel ( + SELECT + t.id, + t.warehouseInFk, + t.warehouseOutFk, + t.landed, + t.shipped, + t.agencyFk + FROM travel t + WHERE t.agencyFk = ? LIMIT 50)`, [agencyModeFk]); + stmts.push(stmt); + + stmt = new ParameterizedSQL(` + SELECT + t.id, + t.warehouseInFk, + t.warehouseOutFk, + (SELECT ROUND(AVG(DATEDIFF(t.landed, t.shipped ))) + FROM tmp.travel t + WHERE t.agencyFk + ORDER BY id DESC LIMIT 50) AS dayDuration + FROM tmp.travel t + WHERE t.agencyFk + ORDER BY t.id DESC LIMIT 1`); + + const avgDaysIndex = stmts.push(stmt) - 1; + + stmts.push( + `DROP TEMPORARY TABLE + tmp.travel`); + + const sql = ParameterizedSQL.join(stmts, ';'); + const result = await conn.executeStmt(sql); + + const [avgDays] = result[avgDaysIndex]; - const [avgDays] = await Self.rawSql(query, [agencyModeFk, agencyModeFk]); return avgDays; }; }; diff --git a/modules/travel/front/create/index.js b/modules/travel/front/create/index.js index cf0b2f382..a85917ca8 100644 --- a/modules/travel/front/create/index.js +++ b/modules/travel/front/create/index.js @@ -22,6 +22,9 @@ class Controller extends Section { agencyModeFk: this.travel.agencyModeFk }; this.$http.get(query, {params}).then(res => { + if (!res.data) + return; + const landed = new Date(value); const futureDate = landed.getDate() + res.data.dayDuration; landed.setDate(futureDate); diff --git a/modules/travel/front/create/index.spec.js b/modules/travel/front/create/index.spec.js index b59530604..e3f85d9ae 100644 --- a/modules/travel/front/create/index.spec.js +++ b/modules/travel/front/create/index.spec.js @@ -51,14 +51,29 @@ describe('Travel Component vnTravelCreate', () => { expect(controller.travel.warehouseOutFk).toBeUndefined(); }); + it(`should do nothing if there's no response data.`, () => { + controller.travel = {agencyModeFk: 4}; + const tomorrow = new Date(); + + const query = `travels/getAverageDays?agencyModeFk=${controller.travel.agencyModeFk}`; + $httpBackend.expectGET(query).respond(undefined); + controller.onShippedChange(tomorrow); + $httpBackend.flush(); + + expect(controller.travel.warehouseInFk).toBeUndefined(); + expect(controller.travel.warehouseOutFk).toBeUndefined(); + expect(controller.travel.dayDuration).toBeUndefined(); + }); + it(`should fill the fields when it's selected a date and agency.`, () => { controller.travel = {agencyModeFk: 1}; const tomorrow = new Date(); - tomorrow.setDate(tomorrow.getDate() + 1); + tomorrow.setDate(tomorrow.getDate() + 9); const expectedResponse = { - dayDuration: 2, - warehouseInFk: 1, - warehouseOutFk: 2 + id: 8, + dayDuration: 9, + warehouseInFk: 5, + warehouseOutFk: 1 }; const query = `travels/getAverageDays?agencyModeFk=${controller.travel.agencyModeFk}`; diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 45eee23bf..cad38ac3b 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -42,6 +42,11 @@ "model": "Account", "foreignKey": "userFk" }, + "boss": { + "type": "belongsTo", + "model": "Account", + "foreignKey": "bossFk" + }, "client": { "type": "belongsTo", "model": "Client", diff --git a/modules/worker/front/basic-data/index.html b/modules/worker/front/basic-data/index.html index a2cbbc637..a767eccc4 100644 --- a/modules/worker/front/basic-data/index.html +++ b/modules/worker/front/basic-data/index.html @@ -29,6 +29,15 @@ ng-model="$ctrl.worker.phone" rule> + + diff --git a/modules/worker/front/locale/es.yml b/modules/worker/front/locale/es.yml index 63570ddf0..1414d089b 100644 --- a/modules/worker/front/locale/es.yml +++ b/modules/worker/front/locale/es.yml @@ -7,6 +7,7 @@ Extension: Extensión Fiscal identifier: NIF Go to client: Ir al cliente Last name: Apellidos +Boss: Jefe Log: Historial Private Branch Exchange: Centralita Role: Rol diff --git a/modules/worker/front/summary/index.html b/modules/worker/front/summary/index.html index 0a99959e4..d2a7e750b 100644 --- a/modules/worker/front/summary/index.html +++ b/modules/worker/front/summary/index.html @@ -30,6 +30,14 @@ + + + {{::worker.boss.nickname}} + + @@ -50,4 +58,7 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/modules/worker/front/summary/index.js b/modules/worker/front/summary/index.js index 6a4d87007..3cdb2c36f 100644 --- a/modules/worker/front/summary/index.js +++ b/modules/worker/front/summary/index.js @@ -11,8 +11,8 @@ class Controller extends Summary { this.$.worker = null; if (!value) return; - let query = `Workers/${value.id}`; - let filter = { + const query = `Workers/${value.id}`; + const filter = { include: [ { relation: 'user', @@ -31,13 +31,20 @@ class Controller extends Summary { } }] } - }, { + }, + { relation: 'client', scope: {fields: ['fi']} - }, { + }, + { + relation: 'boss', + scope: {fields: ['id', 'nickname']} + }, + { relation: 'sip', scope: {fields: ['extension']} - }, { + }, + { relation: 'department', scope: { include: { diff --git a/package-lock.json b/package-lock.json index 1cf4395af..d6381fb83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,8 @@ { "name": "salix-back", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { "": { "name": "salix-back", "version": "1.0.0", @@ -32268,8 +32267,6 @@ } }, "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, @@ -37725,6 +37722,15 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "abab": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", @@ -39250,6 +39256,11 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" }, + "bmp-js": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz", + "integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=" + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -42288,6 +42299,11 @@ } } }, + "file-type": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-10.11.0.tgz", + "integrity": "sha512-uzk64HRpUZyTGZtVuvrjP0FYxzQrBf4rojot6J65YMEbwBLB0CWm0CLojVpwpmFmxcE/lkvYICgfcGozbBq6rw==" + }, "filed-mimefix": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/filed-mimefix/-/filed-mimefix-0.1.3.tgz", @@ -42625,32 +42641,24 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "bundled": true, "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "bundled": true, "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "bundled": true, "dev": true, "optional": true, @@ -42661,16 +42669,12 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "bundled": true, "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "bundled": true, "dev": true, "optional": true, @@ -42681,48 +42685,36 @@ }, "chownr": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "bundled": true, "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "bundled": true, "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "bundled": true, "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "bundled": true, "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "bundled": true, "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "bundled": true, "dev": true, "optional": true, @@ -42732,32 +42724,24 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "bundled": true, "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "bundled": true, "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "bundled": true, "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "bundled": true, "dev": true, "optional": true, @@ -42767,16 +42751,12 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "bundled": true, "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "bundled": true, "dev": true, "optional": true, @@ -42793,8 +42773,6 @@ }, "glob": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "bundled": true, "dev": true, "optional": true, @@ -42809,16 +42787,12 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "bundled": true, "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "bundled": true, "dev": true, "optional": true, @@ -42828,8 +42802,6 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "bundled": true, "dev": true, "optional": true, @@ -42839,8 +42811,6 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "bundled": true, "dev": true, "optional": true, @@ -42851,24 +42821,18 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "bundled": true, "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "bundled": true, "dev": true, "optional": true, @@ -42878,16 +42842,12 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "bundled": true, "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "bundled": true, "dev": true, "optional": true, @@ -42897,16 +42857,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "bundled": true, "dev": true, "optional": true }, "minipass": { "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "bundled": true, "dev": true, "optional": true, @@ -42917,8 +42873,6 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "bundled": true, "dev": true, "optional": true, @@ -42928,8 +42882,6 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "bundled": true, "dev": true, "optional": true, @@ -42939,16 +42891,12 @@ }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "bundled": true, "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", - "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "bundled": true, "dev": true, "optional": true, @@ -42960,8 +42908,6 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "bundled": true, "dev": true, "optional": true, @@ -42980,8 +42926,6 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "bundled": true, "dev": true, "optional": true, @@ -42992,16 +42936,12 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", - "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "bundled": true, "dev": true, "optional": true, @@ -43012,8 +42952,6 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "bundled": true, "dev": true, "optional": true, @@ -43026,24 +42964,18 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "bundled": true, "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "bundled": true, "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "bundled": true, "dev": true, "optional": true, @@ -43053,24 +42985,18 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "bundled": true, "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "bundled": true, "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "bundled": true, "dev": true, "optional": true, @@ -43081,24 +43007,18 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "bundled": true, "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "bundled": true, "dev": true, "optional": true, @@ -43111,8 +43031,6 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "bundled": true, "dev": true, "optional": true @@ -43121,8 +43039,6 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "bundled": true, "dev": true, "optional": true, @@ -43138,8 +43054,6 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "bundled": true, "dev": true, "optional": true, @@ -43149,67 +43063,42 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "bundled": true, "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "bundled": true, "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "bundled": true, "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "bundled": true, "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "bundled": true, "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "bundled": true, "dev": true, "optional": true }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "bundled": true, "dev": true, "optional": true, @@ -43219,10 +43108,17 @@ "strip-ansi": "^3.0.0" } }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "bundled": true, "dev": true, "optional": true, @@ -43232,16 +43128,12 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "bundled": true, "dev": true, "optional": true }, "tar": { "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "bundled": true, "dev": true, "optional": true, @@ -43257,16 +43149,12 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "bundled": true, "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "bundled": true, "dev": true, "optional": true, @@ -43276,16 +43164,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "bundled": true, "dev": true, "optional": true }, "yallist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "bundled": true, "dev": true, "optional": true @@ -45355,6 +45239,14 @@ "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", "dev": true }, + "image-type": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/image-type/-/image-type-4.1.0.tgz", + "integrity": "sha512-CFJMJ8QK8lJvRlTCEgarL4ro6hfDQKif2HjSvYCdQZESaIPV4v9imrf7BQHK+sQeTeNeMpWciR9hyC/g8ybXEg==", + "requires": { + "file-type": "^10.10.0" + } + }, "imap": { "version": "0.8.19", "resolved": "https://registry.npmjs.org/imap/-/imap-0.8.19.tgz", @@ -46108,11 +46000,11 @@ "integrity": "sha512-2GejcQnEV35KYTXoBvzALIDdO/1oyEIoJHBnaJFhJhcurv0x2JqUXQW6xlDUhcNOpN9t+d2w+JGA6vOphb+5mg==", "requires": { "@types/node": "^10.3.5", + "JSONStream": "^1.3.1", "commander": "^2.12.2", "es6-promisify": "^5.0.0", "eyes": "^0.1.8", "json-stringify-safe": "^5.0.1", - "JSONStream": "^1.3.1", "lodash": "^4.17.11", "uuid": "^3.2.1" } @@ -50924,15 +50816,6 @@ "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -54475,6 +54358,15 @@ "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==", "dev": true }, + "read-chunk": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/read-chunk/-/read-chunk-3.2.0.tgz", + "integrity": "sha512-CEjy9LCzhmD7nUpJ1oVOE6s/hBkejlcJEgLQHVnQznOSilOPb+kpKktlLfFDK3/WP43+F80xkUTM2VOkYoSYvQ==", + "requires": { + "pify": "^4.0.1", + "with-open-file": "^0.1.6" + } + }, "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", @@ -56232,14 +56124,6 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, "string-length": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", @@ -56276,6 +56160,14 @@ "strip-ansi": "^4.0.0" } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -58975,6 +58867,16 @@ "string-width": "^2.1.1" } }, + "with-open-file": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz", + "integrity": "sha512-ecJS2/oHtESJ1t3ZfMI3B7KIDKyfN0O16miWxdn30zdh66Yd3LsRFebXZXq6GU4xfxLf6nVxp9kIqElb5fqczA==", + "requires": { + "p-finally": "^1.0.0", + "p-try": "^2.1.0", + "pify": "^4.0.1" + } + }, "word-count": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/word-count/-/word-count-0.2.2.tgz", diff --git a/package.json b/package.json index 2158ae8c0..cf5f7ac01 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "node": ">=12" }, "dependencies": { + "bmp-js": "^0.1.0", "compression": "^1.7.3", "fs-extra": "^5.0.0", "helmet": "^3.21.2", "i18n": "^0.8.4", + "image-type": "^4.1.0", "imap": "^0.8.19", "ldapjs": "^2.2.0", "loopback": "^3.26.0", @@ -31,6 +33,7 @@ "object-diff": "0.0.4", "object.pick": "^1.3.0", "puppeteer": "^7.1.0", + "read-chunk": "^3.2.0", "request": "^2.88.0", "request-promise-native": "^1.0.8", "require-yaml": "0.0.1",