diff --git a/back/methods/dms/uploadFile.js b/back/methods/dms/uploadFile.js
index 1604a6afa2..220f944d8b 100644
--- a/back/methods/dms/uploadFile.js
+++ b/back/methods/dms/uploadFile.js
@@ -5,40 +5,36 @@ module.exports = Self => {
Self.remoteMethodCtx('uploadFile', {
description: 'Uploads a file and inserts into dms model',
accessType: 'WRITE',
- accepts: [{
- arg: 'options',
- type: 'object'
- },
- {
- arg: 'warehouseId',
- type: 'Number',
- description: ''
- },
- {
- arg: 'companyId',
- type: 'Number',
- description: ''
- },
- {
- arg: 'dmsTypeId',
- type: 'Number',
- description: ''
- },
- {
- arg: 'reference',
- type: 'String',
- description: ''
- },
- {
- arg: 'description',
- type: 'String',
- description: ''
- },
- {
- arg: 'hasFile',
- type: 'Boolean',
- description: ''
- }],
+ accepts: [
+ {
+ arg: 'options',
+ type: 'object'
+ }, {
+ arg: 'warehouseId',
+ type: 'Number',
+ description: ''
+ }, {
+ arg: 'companyId',
+ type: 'Number',
+ description: ''
+ }, {
+ arg: 'dmsTypeId',
+ type: 'Number',
+ description: ''
+ }, {
+ arg: 'reference',
+ type: 'String',
+ description: ''
+ }, {
+ arg: 'description',
+ type: 'String',
+ description: ''
+ }, {
+ arg: 'hasFile',
+ type: 'Boolean',
+ description: ''
+ }
+ ],
returns: {
type: 'Object',
root: true
@@ -49,17 +45,24 @@ module.exports = Self => {
}
});
- Self.uploadFile = async(ctx, options = {}) => {
+ Self.uploadFile = async(ctx, options) => {
const models = Self.app.models;
const storageConnector = Self.app.dataSources.storage.connector;
const myUserId = ctx.req.accessToken.userId;
const myWorker = await models.Worker.findOne({where: {userFk: myUserId}});
const args = ctx.args;
const fileOptions = {};
- const hasParentTransaction = options && options.transaction;
- if (!options.transaction)
- options.transaction = await Self.beginTransaction({});
+ let tx;
+ let myOptions = {};
+
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ if (!myOptions.transaction) {
+ tx = await Self.beginTransaction({});
+ myOptions.transaction = tx;
+ }
try {
const hasWriteRole = await models.DmsType.hasWriteRole(ctx, args.dmsTypeId);
@@ -83,11 +86,11 @@ module.exports = Self => {
reference: args.reference,
description: args.description,
hasFile: args.hasFile
- }, options).then(newDms => {
+ }, myOptions).then(newDms => {
const extension = storageConnector.getFileExtension(file.name);
const fileName = `${newDms.id}.${extension}`;
- return newDms.updateAttribute('file', fileName, options);
+ return newDms.updateAttribute('file', fileName, myOptions);
}).then(dms => {
return models.Container.getContainer('temp').then(container => {
const originPath = `${container.client.root}/${container.name}/${file.name}`;
@@ -104,14 +107,10 @@ module.exports = Self => {
const resolvedPromise = await Promise.all(promises);
- if (!hasParentTransaction)
- await options.transaction.commit();
-
+ if (tx) await tx.commit();
return resolvedPromise;
} catch (e) {
- if (!hasParentTransaction)
- await options.transaction.rollback();
-
+ if (tx) await tx.rollback();
throw e;
}
};
diff --git a/back/model-config.json b/back/model-config.json
index a0c3d87409..b24226507b 100644
--- a/back/model-config.json
+++ b/back/model-config.json
@@ -11,6 +11,9 @@
"Company": {
"dataSource": "vn"
},
+ "Container": {
+ "dataSource": "storage"
+ },
"Delivery": {
"dataSource": "vn"
},
@@ -44,8 +47,11 @@
"DmsType": {
"dataSource": "vn"
},
- "Container": {
- "dataSource": "storage"
+ "Town": {
+ "dataSource": "vn"
+ },
+ "Postcode": {
+ "dataSource": "vn"
}
}
diff --git a/back/models/postcode.json b/back/models/postcode.json
new file mode 100644
index 0000000000..e28a77dc4d
--- /dev/null
+++ b/back/models/postcode.json
@@ -0,0 +1,50 @@
+{
+ "name": "Postcode",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "postCode"
+ }
+ },
+ "properties": {
+ "code": {
+ "id": true,
+ "type": "String"
+ }
+ },
+ "relations": {
+ "town": {
+ "type": "belongsTo",
+ "model": "Town",
+ "foreignKey": "townFk"
+ },
+ "geo": {
+ "type": "belongsTo",
+ "model": "ZoneGeo",
+ "foreignKey": "geoFk"
+ }
+ },
+ "acls": [{
+ "accessType": "READ",
+ "principalType": "ROLE",
+ "principalId": "$everyone",
+ "permission": "ALLOW"
+ }],
+ "scopes": {
+ "location": {
+ "include": {
+ "relation": "town",
+ "scope": {
+ "include": {
+ "relation": "province",
+ "scope": {
+ "include": {
+ "relation": "country"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/back/models/town.json b/back/models/town.json
new file mode 100644
index 0000000000..8ae252780b
--- /dev/null
+++ b/back/models/town.json
@@ -0,0 +1,56 @@
+{
+ "name": "Town",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "town"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "Number"
+ },
+ "name": {
+ "type": "String"
+ }
+ },
+ "relations": {
+ "province": {
+ "type": "belongsTo",
+ "model": "Province",
+ "foreignKey": "provinceFk"
+ },
+ "postcodes": {
+ "type": "hasMany",
+ "model": "Postcode",
+ "foreignKey": "townFk"
+ },
+ "geo": {
+ "type": "belongsTo",
+ "model": "ZoneGeo",
+ "foreignKey": "geoFk"
+ }
+ },
+ "acls": [{
+ "accessType": "READ",
+ "principalType": "ROLE",
+ "principalId": "$everyone",
+ "permission": "ALLOW"
+ }],
+ "scopes": {
+ "location": {
+ "include": [{
+ "relation": "province",
+ "scope": {
+ "include": {
+ "relation": "country"
+ }
+ }
+ },
+ {
+ "relation": "postcodes"
+ }]
+ }
+ }
+}
\ No newline at end of file
diff --git a/db/docker-boot.sh b/db/docker-boot.sh
index 0d9eb9f35f..6e04d3377c 100755
--- a/db/docker-boot.sh
+++ b/db/docker-boot.sh
@@ -5,7 +5,7 @@ export MYSQL_PWD=root
mysql_import() {
FILE=$1
echo "[INFO] -> Imported $FILE"
- mysql -u root --comments -f < "$FILE"
+ mysql -u root --default-character-set=utf8 --comments -f < "$FILE"
}
mysql_import dump/structure.sql
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index f8d680b502..ae1838ef37 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -147,6 +147,20 @@ INSERT INTO `vn`.`province`(`id`, `name`, `countryFk`, `warehouseFk`, `zoneFk`)
(4, 'Province four', 1, NULL, 2),
(5, 'Province five', 1, NULL, 1);
+INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`)
+ VALUES
+ (1, 'Valencia', 1),
+ (2, 'Silla', 1),
+ (3, 'Algemesi', 1),
+ (4, 'Alzira', 1);
+
+INSERT INTO `vn`.`postCode`(`code`, `townFk`)
+ VALUES
+ ('46000', 1),
+ ('46460', 2),
+ ('46680', 3),
+ ('46600', 4);
+
INSERT INTO `vn`.`clientType`(`id`, `code`, `type`)
VALUES
(1, 'normal', 'Normal'),
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index cffe03e756..e96f57714e 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -33,7 +33,10 @@ export default {
taxNumber: `${components.vnTextfield}[name="fi"]`,
socialName: `${components.vnTextfield}[name="socialName"]`,
street: `${components.vnTextfield}[name="street"]`,
- city: `${components.vnTextfield}[name="city"]`,
+ postcode: `vn-autocomplete[field="$ctrl.client.postcode"]`,
+ city: `vn-autocomplete[field="$ctrl.client.city"]`,
+ province: `vn-autocomplete[field="$ctrl.client.provinceFk"]`,
+ country: `vn-autocomplete[field="$ctrl.client.countryFk"]`,
userName: `${components.vnTextfield}[name="userName"]`,
email: `${components.vnTextfield}[name="email"]`,
salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`,
@@ -62,8 +65,8 @@ export default {
equalizationTaxCheckbox: 'vn-check[label="Is equalizated"] md-checkbox',
acceptPropagationButton: 'vn-client-fiscal-data > vn-confirm button[response=ACCEPT]',
addressInput: `${components.vnTextfield}[name="street"]`,
- cityInput: `${components.vnTextfield}[name="city"]`,
- postcodeInput: `${components.vnTextfield}[name="postcode"]`,
+ postcodeAutocomplete: `vn-autocomplete[field="$ctrl.client.postcode"]`,
+ cityAutocomplete: `vn-autocomplete[field="$ctrl.client.city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.client.provinceFk"]',
countryAutocomplete: 'vn-autocomplete[field="$ctrl.client.countryFk"]',
activeCheckbox: 'vn-check[label="Active"] md-checkbox',
@@ -97,8 +100,8 @@ export default {
defaultCheckboxInput: 'vn-check[label="Default"] md-checkbox',
consigneeInput: `${components.vnTextfield}[name="nickname"]`,
streetAddressInput: `${components.vnTextfield}[name="street"]`,
- postcodeInput: `${components.vnTextfield}[name="postalCode"]`,
- cityInput: `${components.vnTextfield}[name="city"]`,
+ postcodeAutocomplete: `vn-autocomplete[field="$ctrl.address.postalCode"]`,
+ cityAutocomplete: `vn-autocomplete[field="$ctrl.address.city"]`,
provinceAutocomplete: 'vn-autocomplete[field="$ctrl.address.provinceFk"]',
agencyAutocomplete: 'vn-autocomplete[field="$ctrl.address.agencyModeFk"]',
phoneInput: `${components.vnTextfield}[name="phone"]`,
diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client-module/01_create_client.spec.js
index 2d7b58b203..b9ea5e1129 100644
--- a/e2e/paths/02-client-module/01_create_client.spec.js
+++ b/e2e/paths/02-client-module/01_create_client.spec.js
@@ -53,7 +53,7 @@ describe('Client create path', () => {
.write(selectors.createClientView.name, 'Carol Danvers')
.write(selectors.createClientView.socialName, 'AVG tax')
.write(selectors.createClientView.street, 'Many places')
- .write(selectors.createClientView.city, 'Silla')
+ .autocompleteSearch(selectors.createClientView.postcode, '46000')
.clearInput(selectors.createClientView.email)
.write(selectors.createClientView.email, 'incorrect email format')
.waitToClick(selectors.createClientView.createButton)
@@ -62,6 +62,21 @@ describe('Client create path', () => {
expect(result).toEqual('Some fields are invalid');
});
+ it(`should check for autocompleted city, province and country`, async() => {
+ const clientCity = await nightmare
+ .waitToGetProperty(`${selectors.createClientView.city} input`, 'value');
+
+ const clientProvince = await nightmare
+ .waitToGetProperty(`${selectors.createClientView.province} input`, 'value');
+
+ const clientCountry = await nightmare
+ .waitToGetProperty(`${selectors.createClientView.country} input`, 'value');
+
+ expect(clientCity).toEqual('Valencia');
+ expect(clientProvince).toEqual('Province one');
+ expect(clientCountry).toEqual('España');
+ });
+
it(`should create a new user with all correct data`, async() => {
const result = await nightmare
.clearInput(selectors.createClientView.email)
diff --git a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
index d4d4ac4dc5..9ae1f6ae4d 100644
--- a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
+++ b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js
@@ -67,11 +67,7 @@ describe('Client Edit fiscalData path', () => {
.write(selectors.clientFiscalData.fiscalIdInput, 'INVALID!')
.clearInput(selectors.clientFiscalData.addressInput)
.write(selectors.clientFiscalData.addressInput, 'Somewhere edited')
- .clearInput(selectors.clientFiscalData.postcodeInput)
- .write(selectors.clientFiscalData.postcodeInput, '12345')
- .clearInput(selectors.clientFiscalData.cityInput)
- .write(selectors.clientFiscalData.cityInput, 'N/A')
- .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two')
+ .autocompleteSearch(selectors.clientFiscalData.postcodeAutocomplete, '46000')
.waitToClick(selectors.clientFiscalData.activeCheckbox)
.waitToClick(selectors.clientFiscalData.frozenCheckbox)
.waitToClick(selectors.clientFiscalData.hasToInvoiceCheckbox)
@@ -197,23 +193,31 @@ describe('Client Edit fiscalData path', () => {
it('should confirm the postcode have been edited', async() => {
const result = await nightmare
- .waitToGetProperty(selectors.clientFiscalData.postcodeInput, 'value');
+ .waitToGetProperty(`${selectors.clientFiscalData.postcodeAutocomplete} input`, 'value');
- expect(result).toEqual('12345');
+ expect(result).toContain('46000');
});
- it('should confirm the city have been edited', async() => {
+ it('should confirm the city have been autocompleted', async() => {
const result = await nightmare
- .waitToGetProperty(selectors.clientFiscalData.cityInput, 'value');
+ .waitToGetProperty(`${selectors.clientFiscalData.cityAutocomplete} input`, 'value');
- expect(result).toEqual('N/A');
+ expect(result).toEqual('Valencia');
});
- it(`should confirm the province have been selected`, async() => {
+
+ it(`should confirm the province have been autocompleted`, async() => {
const result = await nightmare
.waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value');
- expect(result).toEqual('Province two');
+ expect(result).toEqual('Province one');
+ });
+
+ it('should confirm the country have been autocompleted', async() => {
+ const result = await nightmare
+ .waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value');
+
+ expect(result).toEqual('España');
});
it('should confirm active checkbox is unchecked', async() => {
diff --git a/e2e/paths/02-client-module/05_add_address.spec.js b/e2e/paths/02-client-module/05_add_address.spec.js
index e082b6d8c9..5e21f87d8c 100644
--- a/e2e/paths/02-client-module/05_add_address.spec.js
+++ b/e2e/paths/02-client-module/05_add_address.spec.js
@@ -24,8 +24,7 @@ describe('Client Add address path', () => {
const result = await nightmare
.waitToClick(selectors.clientAddresses.defaultCheckboxInput)
.clearInput(selectors.clientAddresses.streetAddressInput)
- .write(selectors.clientAddresses.postcodeInput, '10022')
- .autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province four')
+ .autocompleteSearch(selectors.clientAddresses.postcodeAutocomplete, '46000')
.autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement')
.write(selectors.clientAddresses.phoneInput, '999887744')
.write(selectors.clientAddresses.mobileInput, '999887744')
@@ -35,11 +34,32 @@ describe('Client Add address path', () => {
expect(result).toEqual('Some fields are invalid');
});
+ it('should confirm the postcode have been edited', async() => {
+ const result = await nightmare
+ .waitToGetProperty(`${selectors.clientAddresses.postcodeAutocomplete} input`, 'value');
+
+ expect(result).toContain('46000');
+ });
+
+ it('should confirm the city have been autocompleted', async() => {
+ const result = await nightmare
+ .waitToGetProperty(`${selectors.clientAddresses.cityAutocomplete} input`, 'value');
+
+ expect(result).toEqual('Valencia');
+ });
+
+
+ it(`should confirm the province have been autocompleted`, async() => {
+ const result = await nightmare
+ .waitToGetProperty(`${selectors.clientAddresses.provinceAutocomplete} input`, 'value');
+
+ expect(result).toEqual('Province one');
+ });
+
it(`should create a new address with all it's data`, async() => {
const result = await nightmare
.write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner')
.write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York')
- .write(selectors.clientAddresses.cityInput, 'New York')
.waitToClick(selectors.clientAddresses.saveButton)
.waitForLastSnackbar();
diff --git a/front/core/components/autocomplete/autocomplete.html b/front/core/components/autocomplete/autocomplete.html
index 2cd9a244ae..ecb21fe2f1 100755
--- a/front/core/components/autocomplete/autocomplete.html
+++ b/front/core/components/autocomplete/autocomplete.html
@@ -19,6 +19,6 @@
\ No newline at end of file
diff --git a/front/core/components/autocomplete/autocomplete.js b/front/core/components/autocomplete/autocomplete.js
index f651fd7747..e9e2de374e 100755
--- a/front/core/components/autocomplete/autocomplete.js
+++ b/front/core/components/autocomplete/autocomplete.js
@@ -79,10 +79,10 @@ export default class Autocomplete extends Input {
}
set field(value) {
- if (angular.equals(value, this._field))
- return;
-
this._field = value;
+
+ if (!value) return;
+
this.refreshSelection();
this.emit('change', {value});
}
@@ -125,7 +125,9 @@ export default class Autocomplete extends Input {
|| this.selectionIsValid(this._selection))
return;
- this.selection = this.fetchSelection();
+ const selection = this.fetchSelection();
+ if (!this.selection)
+ this.selection = selection;
}
fetchSelection() {
@@ -217,7 +219,9 @@ export default class Autocomplete extends Input {
if (this.form) this.form.$setDirty();
}
- onDropDownSelect(value) {
+ onDropDownSelect(item) {
+ const value = item[this.valueField];
+ this.selection = item;
this.setValue(value);
this.field = value;
}
diff --git a/front/core/components/button-menu/button-menu.html b/front/core/components/button-menu/button-menu.html
index 80323a9d9b..5beeb12fbc 100644
--- a/front/core/components/button-menu/button-menu.html
+++ b/front/core/components/button-menu/button-menu.html
@@ -7,7 +7,7 @@
\ No newline at end of file
diff --git a/front/core/components/button-menu/button-menu.js b/front/core/components/button-menu/button-menu.js
index 41f26cfbe4..319ca3f6f0 100644
--- a/front/core/components/button-menu/button-menu.js
+++ b/front/core/components/button-menu/button-menu.js
@@ -53,7 +53,8 @@ export default class ButtonMenu extends Input {
event.preventDefault();
}
- onDropDownSelect(value) {
+ onDropDownSelect(item) {
+ const value = item[this.valueField];
this.field = value;
this.emit('change', {value});
}
diff --git a/front/core/components/button-menu/button-menu.spec.js b/front/core/components/button-menu/button-menu.spec.js
index d8654466fa..1e8c048ff6 100644
--- a/front/core/components/button-menu/button-menu.spec.js
+++ b/front/core/components/button-menu/button-menu.spec.js
@@ -7,6 +7,7 @@ describe('Component vnButtonMenu', () => {
beforeEach(inject(($compile, $rootScope) => {
$element = $compile(``)($rootScope);
controller = $element.controller('vnIconMenu');
+ controller.valueField = 'name';
}));
afterEach(() => {
@@ -31,10 +32,10 @@ describe('Component vnButtonMenu', () => {
describe('onDropDownSelect(value)', () => {
it(`should set field to the given value and emit the change event`, () => {
spyOn(controller, 'emit');
- controller.onDropDownSelect('mariano');
+ controller.onDropDownSelect({name: 'Item name'});
- expect(controller.field).toBe('mariano');
- expect(controller.emit).toHaveBeenCalledWith('change', {value: 'mariano'});
+ expect(controller.field).toBe('Item name');
+ expect(controller.emit).toHaveBeenCalledWith('change', {value: 'Item name'});
});
});
});
diff --git a/front/core/components/drop-down/drop-down.html b/front/core/components/drop-down/drop-down.html
index 9ec18044a4..5fef1dd5e2 100755
--- a/front/core/components/drop-down/drop-down.html
+++ b/front/core/components/drop-down/drop-down.html
@@ -8,7 +8,7 @@
model="$ctrl.search"
class="search"
ng-blur="$ctrl.onFocusOut()"
- label = "Search">
+ label="Search">
diff --git a/front/core/components/drop-down/drop-down.js b/front/core/components/drop-down/drop-down.js
index d1cc11601c..f027d1bf37 100755
--- a/front/core/components/drop-down/drop-down.js
+++ b/front/core/components/drop-down/drop-down.js
@@ -186,7 +186,7 @@ export default class DropDown extends Component {
this.field = value;
}
- this.emit('select', {value: value});
+ this.emit('select', {item});
}
if (!this.multiple)
diff --git a/front/core/components/icon-menu/icon-menu.html b/front/core/components/icon-menu/icon-menu.html
index f59f241258..93de718ff7 100644
--- a/front/core/components/icon-menu/icon-menu.html
+++ b/front/core/components/icon-menu/icon-menu.html
@@ -5,7 +5,7 @@
\ No newline at end of file
diff --git a/front/core/components/table/index.html b/front/core/components/table/index.html
index 14d4282618..a5abd1c66b 100644
--- a/front/core/components/table/index.html
+++ b/front/core/components/table/index.html
@@ -2,7 +2,10 @@
-
+
+ Enter a new search
+
+
No results
\ No newline at end of file
diff --git a/front/package-lock.json b/front/package-lock.json
index 2db5cf9f61..2fc1af6d2e 100644
--- a/front/package-lock.json
+++ b/front/package-lock.json
@@ -109,9 +109,9 @@
"integrity": "sha1-8tcgwiCS90Mih3XHXjYSYyUB8TE="
},
"js-yaml": {
- "version": "3.12.1",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz",
- "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
@@ -152,25 +152,25 @@
}
},
"npm": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/npm/-/npm-6.5.0.tgz",
- "integrity": "sha512-SPq8zG2Kto+Xrq55E97O14Jla13PmQT5kSnvwBj88BmJZ5Nvw++OmlWfhjkB67pcgP5UEXljEtnGFKZtOgt6MQ==",
+ "version": "6.9.0",
+ "resolved": "https://registry.npmjs.org/npm/-/npm-6.9.0.tgz",
+ "integrity": "sha512-91V+zB5hDxO+Jyp2sUKS7juHlIM95dGQxTeQtmZI1nAI/7kjWXFipPrtwwKjhyKmV4GsS2LzJhrxRjGWsU9z/w==",
"requires": {
- "JSONStream": "^1.3.4",
+ "JSONStream": "^1.3.5",
"abbrev": "~1.1.1",
"ansicolors": "~0.3.2",
"ansistyles": "~0.1.3",
- "aproba": "~1.2.0",
+ "aproba": "^2.0.0",
"archy": "~1.0.0",
"bin-links": "^1.1.2",
"bluebird": "^3.5.3",
- "byte-size": "^4.0.3",
- "cacache": "^11.2.0",
+ "byte-size": "^5.0.1",
+ "cacache": "^11.3.2",
"call-limit": "~1.1.0",
- "chownr": "~1.0.1",
- "ci-info": "^1.6.0",
+ "chownr": "^1.1.1",
+ "ci-info": "^2.0.0",
"cli-columns": "^3.1.2",
- "cli-table3": "^0.5.0",
+ "cli-table3": "^0.5.1",
"cmd-shim": "~2.0.2",
"columnify": "~1.5.4",
"config-chain": "^1.1.12",
@@ -194,13 +194,18 @@
"inherits": "~2.0.3",
"ini": "^1.3.5",
"init-package-json": "^1.10.3",
- "is-cidr": "^2.0.6",
+ "is-cidr": "^3.0.0",
"json-parse-better-errors": "^1.0.2",
"lazy-property": "~1.0.0",
- "libcipm": "^2.0.2",
- "libnpmhook": "^4.0.1",
+ "libcipm": "^3.0.3",
+ "libnpm": "^2.0.1",
+ "libnpmaccess": "*",
+ "libnpmhook": "^5.0.2",
+ "libnpmorg": "*",
+ "libnpmsearch": "*",
+ "libnpmteam": "*",
"libnpx": "^10.2.0",
- "lock-verify": "^2.0.2",
+ "lock-verify": "^2.1.0",
"lockfile": "^1.0.4",
"lodash._baseindexof": "*",
"lodash._baseuniq": "~4.6.0",
@@ -213,47 +218,46 @@
"lodash.union": "~4.6.0",
"lodash.uniq": "~4.5.0",
"lodash.without": "~4.4.0",
- "lru-cache": "^4.1.3",
+ "lru-cache": "^4.1.5",
"meant": "~1.0.1",
"mississippi": "^3.0.0",
"mkdirp": "~0.5.1",
"move-concurrently": "^1.0.1",
"node-gyp": "^3.8.0",
"nopt": "~4.0.1",
- "normalize-package-data": "~2.4.0",
- "npm-audit-report": "^1.3.1",
+ "normalize-package-data": "^2.5.0",
+ "npm-audit-report": "^1.3.2",
"npm-cache-filename": "~1.0.2",
"npm-install-checks": "~3.0.0",
"npm-lifecycle": "^2.1.0",
"npm-package-arg": "^6.1.0",
- "npm-packlist": "^1.1.12",
- "npm-pick-manifest": "^2.1.0",
- "npm-profile": "^3.0.2",
- "npm-registry-client": "^8.6.0",
- "npm-registry-fetch": "^1.1.0",
+ "npm-packlist": "^1.4.1",
+ "npm-pick-manifest": "^2.2.3",
+ "npm-profile": "*",
+ "npm-registry-fetch": "^3.9.0",
"npm-user-validate": "~1.0.0",
"npmlog": "~4.1.2",
"once": "~1.4.0",
"opener": "^1.5.1",
"osenv": "^0.1.5",
- "pacote": "^8.1.6",
+ "pacote": "^9.5.0",
"path-is-inside": "~1.0.2",
"promise-inflight": "~1.0.1",
"qrcode-terminal": "^0.12.0",
- "query-string": "^6.1.0",
+ "query-string": "^6.2.0",
"qw": "~1.0.1",
"read": "~1.0.7",
"read-cmd-shim": "~1.0.1",
"read-installed": "~4.0.3",
"read-package-json": "^2.0.13",
- "read-package-tree": "^5.2.1",
- "readable-stream": "^2.3.6",
+ "read-package-tree": "^5.2.2",
+ "readable-stream": "^3.1.1",
"readdir-scoped-modules": "*",
"request": "^2.88.0",
"retry": "^0.12.0",
- "rimraf": "~2.6.2",
+ "rimraf": "^2.6.3",
"safe-buffer": "^5.1.2",
- "semver": "^5.5.1",
+ "semver": "^5.6.0",
"sha": "~2.0.1",
"slide": "~1.1.6",
"sorted-object": "~2.0.1",
@@ -265,7 +269,7 @@
"tiny-relative-date": "^1.3.0",
"uid-number": "0.0.6",
"umask": "~1.1.0",
- "unique-filename": "~1.1.0",
+ "unique-filename": "^1.1.1",
"unpipe": "~1.0.0",
"update-notifier": "^2.5.0",
"uuid": "^3.3.2",
@@ -273,11 +277,11 @@
"validate-npm-package-name": "~3.0.0",
"which": "^1.3.1",
"worker-farm": "^1.6.0",
- "write-file-atomic": "^2.3.0"
+ "write-file-atomic": "^2.4.2"
},
"dependencies": {
"JSONStream": {
- "version": "1.3.4",
+ "version": "1.3.5",
"bundled": true,
"requires": {
"jsonparse": "^1.2.0",
@@ -289,7 +293,7 @@
"bundled": true
},
"agent-base": {
- "version": "4.2.0",
+ "version": "4.2.1",
"bundled": true,
"requires": {
"es6-promisify": "^5.0.0"
@@ -339,7 +343,7 @@
"bundled": true
},
"aproba": {
- "version": "1.2.0",
+ "version": "2.0.0",
"bundled": true
},
"archy": {
@@ -352,6 +356,28 @@
"requires": {
"delegates": "^1.0.0",
"readable-stream": "^2.0.6"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"asap": {
@@ -440,10 +466,6 @@
"version": "1.0.0",
"bundled": true
},
- "builtin-modules": {
- "version": "1.1.1",
- "bundled": true
- },
"builtins": {
"version": "1.0.3",
"bundled": true
@@ -453,27 +475,51 @@
"bundled": true
},
"byte-size": {
- "version": "4.0.3",
+ "version": "5.0.1",
"bundled": true
},
"cacache": {
- "version": "11.2.0",
+ "version": "11.3.2",
"bundled": true,
"requires": {
- "bluebird": "^3.5.1",
- "chownr": "^1.0.1",
- "figgy-pudding": "^3.1.0",
- "glob": "^7.1.2",
- "graceful-fs": "^4.1.11",
- "lru-cache": "^4.1.3",
+ "bluebird": "^3.5.3",
+ "chownr": "^1.1.1",
+ "figgy-pudding": "^3.5.1",
+ "glob": "^7.1.3",
+ "graceful-fs": "^4.1.15",
+ "lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
"rimraf": "^2.6.2",
- "ssri": "^6.0.0",
- "unique-filename": "^1.1.0",
+ "ssri": "^6.0.1",
+ "unique-filename": "^1.1.1",
"y18n": "^4.0.0"
+ },
+ "dependencies": {
+ "chownr": {
+ "version": "1.1.1",
+ "bundled": true
+ },
+ "lru-cache": {
+ "version": "5.1.1",
+ "bundled": true,
+ "requires": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "unique-filename": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "unique-slug": "^2.0.0"
+ }
+ },
+ "yallist": {
+ "version": "3.0.3",
+ "bundled": true
+ }
}
},
"call-limit": {
@@ -502,15 +548,15 @@
}
},
"chownr": {
- "version": "1.0.1",
+ "version": "1.1.1",
"bundled": true
},
"ci-info": {
- "version": "1.6.0",
+ "version": "2.0.0",
"bundled": true
},
"cidr-regex": {
- "version": "2.0.9",
+ "version": "2.0.10",
"bundled": true,
"requires": {
"ip-regex": "^2.1.0"
@@ -529,7 +575,7 @@
}
},
"cli-table3": {
- "version": "0.5.0",
+ "version": "0.5.1",
"bundled": true,
"requires": {
"colors": "^1.1.2",
@@ -591,7 +637,7 @@
"bundled": true
},
"colors": {
- "version": "1.1.2",
+ "version": "1.3.3",
"bundled": true,
"optional": true
},
@@ -622,6 +668,28 @@
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"config-chain": {
@@ -660,6 +728,10 @@
"run-queue": "^1.0.0"
},
"dependencies": {
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true
+ },
"iferr": {
"version": "0.1.5",
"bundled": true
@@ -784,6 +856,28 @@
"inherits": "^2.0.1",
"readable-stream": "^2.0.0",
"stream-shift": "^1.0.0"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"ecc-jsbn": {
@@ -825,7 +919,7 @@
}
},
"es6-promise": {
- "version": "4.2.4",
+ "version": "4.2.6",
"bundled": true
},
"es6-promisify": {
@@ -850,6 +944,12 @@
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "3.0.0",
+ "bundled": true
+ }
}
},
"extend": {
@@ -889,6 +989,28 @@
"requires": {
"inherits": "^2.0.1",
"readable-stream": "^2.0.4"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"forever-agent": {
@@ -910,6 +1032,28 @@
"requires": {
"inherits": "^2.0.1",
"readable-stream": "^2.0.0"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"fs-minipass": {
@@ -941,6 +1085,26 @@
"iferr": {
"version": "0.1.5",
"bundled": true
+ },
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
}
}
},
@@ -972,6 +1136,10 @@
"wide-align": "^1.1.0"
},
"dependencies": {
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true
+ },
"string-width": {
"version": "1.0.2",
"bundled": true,
@@ -984,7 +1152,7 @@
}
},
"genfun": {
- "version": "4.0.1",
+ "version": "5.0.0",
"bundled": true
},
"gentle-fs": {
@@ -1001,6 +1169,10 @@
"slide": "^1.1.6"
},
"dependencies": {
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true
+ },
"iferr": {
"version": "0.1.5",
"bundled": true
@@ -1012,8 +1184,11 @@
"bundled": true
},
"get-stream": {
- "version": "3.0.0",
- "bundled": true
+ "version": "4.1.0",
+ "bundled": true,
+ "requires": {
+ "pump": "^3.0.0"
+ }
},
"getpass": {
"version": "0.1.7",
@@ -1056,6 +1231,12 @@
"timed-out": "^4.0.0",
"unzip-response": "^2.0.1",
"url-parse-lax": "^1.0.0"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "3.0.0",
+ "bundled": true
+ }
}
},
"graceful-fs": {
@@ -1190,25 +1371,24 @@
"version": "2.1.0",
"bundled": true
},
- "is-builtin-module": {
- "version": "1.0.0",
- "bundled": true,
- "requires": {
- "builtin-modules": "^1.0.0"
- }
- },
"is-ci": {
"version": "1.1.0",
"bundled": true,
"requires": {
"ci-info": "^1.0.0"
+ },
+ "dependencies": {
+ "ci-info": {
+ "version": "1.6.0",
+ "bundled": true
+ }
}
},
"is-cidr": {
- "version": "2.0.6",
+ "version": "3.0.0",
"bundled": true,
"requires": {
- "cidr-regex": "^2.0.8"
+ "cidr-regex": "^2.0.10"
}
},
"is-fullwidth-code-point": {
@@ -1323,43 +1503,175 @@
}
},
"libcipm": {
- "version": "2.0.2",
+ "version": "3.0.3",
"bundled": true,
"requires": {
"bin-links": "^1.1.2",
"bluebird": "^3.5.1",
+ "figgy-pudding": "^3.5.1",
"find-npm-prefix": "^1.0.2",
"graceful-fs": "^4.1.11",
+ "ini": "^1.3.5",
"lock-verify": "^2.0.2",
"mkdirp": "^0.5.1",
"npm-lifecycle": "^2.0.3",
"npm-logical-tree": "^1.2.1",
"npm-package-arg": "^6.1.0",
- "pacote": "^8.1.6",
- "protoduck": "^5.0.0",
+ "pacote": "^9.1.0",
"read-package-json": "^2.0.13",
"rimraf": "^2.6.2",
"worker-farm": "^1.6.0"
}
},
- "libnpmhook": {
- "version": "4.0.1",
+ "libnpm": {
+ "version": "2.0.1",
"bundled": true,
"requires": {
- "figgy-pudding": "^3.1.0",
- "npm-registry-fetch": "^3.0.0"
+ "bin-links": "^1.1.2",
+ "bluebird": "^3.5.3",
+ "find-npm-prefix": "^1.0.2",
+ "libnpmaccess": "^3.0.1",
+ "libnpmconfig": "^1.2.1",
+ "libnpmhook": "^5.0.2",
+ "libnpmorg": "^1.0.0",
+ "libnpmpublish": "^1.1.0",
+ "libnpmsearch": "^2.0.0",
+ "libnpmteam": "^1.0.1",
+ "lock-verify": "^2.0.2",
+ "npm-lifecycle": "^2.1.0",
+ "npm-logical-tree": "^1.2.1",
+ "npm-package-arg": "^6.1.0",
+ "npm-profile": "^4.0.1",
+ "npm-registry-fetch": "^3.8.0",
+ "npmlog": "^4.1.2",
+ "pacote": "^9.2.3",
+ "read-package-json": "^2.0.13",
+ "stringify-package": "^1.0.0"
+ }
+ },
+ "libnpmaccess": {
+ "version": "3.0.1",
+ "bundled": true,
+ "requires": {
+ "aproba": "^2.0.0",
+ "get-stream": "^4.0.0",
+ "npm-package-arg": "^6.1.0",
+ "npm-registry-fetch": "^3.8.0"
},
"dependencies": {
- "npm-registry-fetch": {
- "version": "3.1.1",
+ "aproba": {
+ "version": "2.0.0",
+ "bundled": true
+ }
+ }
+ },
+ "libnpmconfig": {
+ "version": "1.2.1",
+ "bundled": true,
+ "requires": {
+ "figgy-pudding": "^3.5.1",
+ "find-up": "^3.0.0",
+ "ini": "^1.3.5"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "3.0.0",
"bundled": true,
"requires": {
- "bluebird": "^3.5.1",
- "figgy-pudding": "^3.1.0",
- "lru-cache": "^4.1.2",
- "make-fetch-happen": "^4.0.0",
- "npm-package-arg": "^6.0.0"
+ "locate-path": "^3.0.0"
}
+ },
+ "locate-path": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "p-locate": "^3.0.0",
+ "path-exists": "^3.0.0"
+ }
+ },
+ "p-limit": {
+ "version": "2.1.0",
+ "bundled": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "3.0.0",
+ "bundled": true,
+ "requires": {
+ "p-limit": "^2.0.0"
+ }
+ },
+ "p-try": {
+ "version": "2.0.0",
+ "bundled": true
+ }
+ }
+ },
+ "libnpmhook": {
+ "version": "5.0.2",
+ "bundled": true,
+ "requires": {
+ "aproba": "^2.0.0",
+ "figgy-pudding": "^3.4.1",
+ "get-stream": "^4.0.0",
+ "npm-registry-fetch": "^3.8.0"
+ }
+ },
+ "libnpmorg": {
+ "version": "1.0.0",
+ "bundled": true,
+ "requires": {
+ "aproba": "^2.0.0",
+ "figgy-pudding": "^3.4.1",
+ "get-stream": "^4.0.0",
+ "npm-registry-fetch": "^3.8.0"
+ },
+ "dependencies": {
+ "aproba": {
+ "version": "2.0.0",
+ "bundled": true
+ }
+ }
+ },
+ "libnpmpublish": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "aproba": "^2.0.0",
+ "figgy-pudding": "^3.5.1",
+ "get-stream": "^4.0.0",
+ "lodash.clonedeep": "^4.5.0",
+ "normalize-package-data": "^2.4.0",
+ "npm-package-arg": "^6.1.0",
+ "npm-registry-fetch": "^3.8.0",
+ "semver": "^5.5.1",
+ "ssri": "^6.0.1"
+ }
+ },
+ "libnpmsearch": {
+ "version": "2.0.0",
+ "bundled": true,
+ "requires": {
+ "figgy-pudding": "^3.5.1",
+ "get-stream": "^4.0.0",
+ "npm-registry-fetch": "^3.8.0"
+ }
+ },
+ "libnpmteam": {
+ "version": "1.0.1",
+ "bundled": true,
+ "requires": {
+ "aproba": "^2.0.0",
+ "figgy-pudding": "^3.4.1",
+ "get-stream": "^4.0.0",
+ "npm-registry-fetch": "^3.8.0"
+ },
+ "dependencies": {
+ "aproba": {
+ "version": "2.0.0",
+ "bundled": true
}
}
},
@@ -1386,10 +1698,10 @@
}
},
"lock-verify": {
- "version": "2.0.2",
+ "version": "2.1.0",
"bundled": true,
"requires": {
- "npm-package-arg": "^5.1.2 || 6",
+ "npm-package-arg": "^6.1.0",
"semver": "^5.4.1"
}
},
@@ -1464,7 +1776,7 @@
"bundled": true
},
"lru-cache": {
- "version": "4.1.3",
+ "version": "4.1.5",
"bundled": true,
"requires": {
"pseudomap": "^1.0.2",
@@ -1586,6 +1898,12 @@
"mkdirp": "^0.5.1",
"rimraf": "^2.5.4",
"run-queue": "^1.0.3"
+ },
+ "dependencies": {
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true
+ }
}
},
"ms": {
@@ -1654,17 +1972,26 @@
}
},
"normalize-package-data": {
- "version": "2.4.0",
+ "version": "2.5.0",
"bundled": true,
"requires": {
"hosted-git-info": "^2.1.4",
- "is-builtin-module": "^1.0.0",
+ "resolve": "^1.10.0",
"semver": "2 || 3 || 4 || 5",
"validate-npm-package-license": "^3.0.1"
+ },
+ "dependencies": {
+ "resolve": {
+ "version": "1.10.0",
+ "bundled": true,
+ "requires": {
+ "path-parse": "^1.0.6"
+ }
+ }
}
},
"npm-audit-report": {
- "version": "1.3.1",
+ "version": "1.3.2",
"bundled": true,
"requires": {
"cli-table3": "^0.5.0",
@@ -1672,7 +1999,7 @@
}
},
"npm-bundled": {
- "version": "1.0.5",
+ "version": "1.0.6",
"bundled": true
},
"npm-cache-filename": {
@@ -1715,7 +2042,7 @@
}
},
"npm-packlist": {
- "version": "1.1.12",
+ "version": "1.4.1",
"bundled": true,
"requires": {
"ignore-walk": "^3.0.1",
@@ -1723,157 +2050,33 @@
}
},
"npm-pick-manifest": {
- "version": "2.1.0",
+ "version": "2.2.3",
"bundled": true,
"requires": {
+ "figgy-pudding": "^3.5.1",
"npm-package-arg": "^6.0.0",
"semver": "^5.4.1"
}
},
"npm-profile": {
- "version": "3.0.2",
+ "version": "4.0.1",
"bundled": true,
"requires": {
"aproba": "^1.1.2 || 2",
- "make-fetch-happen": "^2.5.0 || 3 || 4"
- }
- },
- "npm-registry-client": {
- "version": "8.6.0",
- "bundled": true,
- "requires": {
- "concat-stream": "^1.5.2",
- "graceful-fs": "^4.1.6",
- "normalize-package-data": "~1.0.1 || ^2.0.0",
- "npm-package-arg": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0",
- "npmlog": "2 || ^3.1.0 || ^4.0.0",
- "once": "^1.3.3",
- "request": "^2.74.0",
- "retry": "^0.10.0",
- "safe-buffer": "^5.1.1",
- "semver": "2 >=2.2.1 || 3.x || 4 || 5",
- "slide": "^1.1.3",
- "ssri": "^5.2.4"
- },
- "dependencies": {
- "retry": {
- "version": "0.10.1",
- "bundled": true
- },
- "ssri": {
- "version": "5.3.0",
- "bundled": true,
- "requires": {
- "safe-buffer": "^5.1.1"
- }
- }
+ "figgy-pudding": "^3.4.1",
+ "npm-registry-fetch": "^3.8.0"
}
},
"npm-registry-fetch": {
- "version": "1.1.0",
+ "version": "3.9.0",
"bundled": true,
"requires": {
+ "JSONStream": "^1.3.4",
"bluebird": "^3.5.1",
- "figgy-pudding": "^2.0.1",
- "lru-cache": "^4.1.2",
- "make-fetch-happen": "^3.0.0",
- "npm-package-arg": "^6.0.0",
- "safe-buffer": "^5.1.1"
- },
- "dependencies": {
- "cacache": {
- "version": "10.0.4",
- "bundled": true,
- "requires": {
- "bluebird": "^3.5.1",
- "chownr": "^1.0.1",
- "glob": "^7.1.2",
- "graceful-fs": "^4.1.11",
- "lru-cache": "^4.1.1",
- "mississippi": "^2.0.0",
- "mkdirp": "^0.5.1",
- "move-concurrently": "^1.0.1",
- "promise-inflight": "^1.0.1",
- "rimraf": "^2.6.2",
- "ssri": "^5.2.4",
- "unique-filename": "^1.1.0",
- "y18n": "^4.0.0"
- },
- "dependencies": {
- "mississippi": {
- "version": "2.0.0",
- "bundled": true,
- "requires": {
- "concat-stream": "^1.5.0",
- "duplexify": "^3.4.2",
- "end-of-stream": "^1.1.0",
- "flush-write-stream": "^1.0.0",
- "from2": "^2.1.0",
- "parallel-transform": "^1.1.0",
- "pump": "^2.0.1",
- "pumpify": "^1.3.3",
- "stream-each": "^1.1.0",
- "through2": "^2.0.0"
- }
- }
- }
- },
- "figgy-pudding": {
- "version": "2.0.1",
- "bundled": true
- },
- "make-fetch-happen": {
- "version": "3.0.0",
- "bundled": true,
- "requires": {
- "agentkeepalive": "^3.4.1",
- "cacache": "^10.0.4",
- "http-cache-semantics": "^3.8.1",
- "http-proxy-agent": "^2.1.0",
- "https-proxy-agent": "^2.2.0",
- "lru-cache": "^4.1.2",
- "mississippi": "^3.0.0",
- "node-fetch-npm": "^2.0.2",
- "promise-retry": "^1.1.1",
- "socks-proxy-agent": "^3.0.1",
- "ssri": "^5.2.4"
- }
- },
- "pump": {
- "version": "2.0.1",
- "bundled": true,
- "requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "smart-buffer": {
- "version": "1.1.15",
- "bundled": true
- },
- "socks": {
- "version": "1.1.10",
- "bundled": true,
- "requires": {
- "ip": "^1.1.4",
- "smart-buffer": "^1.0.13"
- }
- },
- "socks-proxy-agent": {
- "version": "3.0.1",
- "bundled": true,
- "requires": {
- "agent-base": "^4.1.0",
- "socks": "^1.1.10"
- }
- },
- "ssri": {
- "version": "5.3.0",
- "bundled": true,
- "requires": {
- "safe-buffer": "^5.1.1"
- }
- }
+ "figgy-pudding": "^3.4.1",
+ "lru-cache": "^4.1.3",
+ "make-fetch-happen": "^4.0.1",
+ "npm-package-arg": "^6.1.0"
}
},
"npm-run-path": {
@@ -1978,34 +2181,57 @@
}
},
"pacote": {
- "version": "8.1.6",
+ "version": "9.5.0",
"bundled": true,
"requires": {
- "bluebird": "^3.5.1",
- "cacache": "^11.0.2",
- "get-stream": "^3.0.0",
- "glob": "^7.1.2",
- "lru-cache": "^4.1.3",
+ "bluebird": "^3.5.3",
+ "cacache": "^11.3.2",
+ "figgy-pudding": "^3.5.1",
+ "get-stream": "^4.1.0",
+ "glob": "^7.1.3",
+ "lru-cache": "^5.1.1",
"make-fetch-happen": "^4.0.1",
"minimatch": "^3.0.4",
- "minipass": "^2.3.3",
+ "minipass": "^2.3.5",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"normalize-package-data": "^2.4.0",
"npm-package-arg": "^6.1.0",
- "npm-packlist": "^1.1.10",
- "npm-pick-manifest": "^2.1.0",
+ "npm-packlist": "^1.1.12",
+ "npm-pick-manifest": "^2.2.3",
+ "npm-registry-fetch": "^3.8.0",
"osenv": "^0.1.5",
"promise-inflight": "^1.0.1",
"promise-retry": "^1.1.1",
- "protoduck": "^5.0.0",
+ "protoduck": "^5.0.1",
"rimraf": "^2.6.2",
"safe-buffer": "^5.1.2",
- "semver": "^5.5.0",
- "ssri": "^6.0.0",
- "tar": "^4.4.3",
- "unique-filename": "^1.1.0",
- "which": "^1.3.0"
+ "semver": "^5.6.0",
+ "ssri": "^6.0.1",
+ "tar": "^4.4.8",
+ "unique-filename": "^1.1.1",
+ "which": "^1.3.1"
+ },
+ "dependencies": {
+ "lru-cache": {
+ "version": "5.1.1",
+ "bundled": true,
+ "requires": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "minipass": {
+ "version": "2.3.5",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "^5.1.2",
+ "yallist": "^3.0.0"
+ }
+ },
+ "yallist": {
+ "version": "3.0.3",
+ "bundled": true
+ }
}
},
"parallel-transform": {
@@ -2015,6 +2241,28 @@
"cyclist": "~0.2.2",
"inherits": "^2.0.3",
"readable-stream": "^2.1.5"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"path-exists": {
@@ -2033,6 +2281,10 @@
"version": "2.0.1",
"bundled": true
},
+ "path-parse": {
+ "version": "1.0.6",
+ "bundled": true
+ },
"performance-now": {
"version": "2.1.0",
"bundled": true
@@ -2079,10 +2331,10 @@
"bundled": true
},
"protoduck": {
- "version": "5.0.0",
+ "version": "5.0.1",
"bundled": true,
"requires": {
- "genfun": "^4.0.1"
+ "genfun": "^5.0.0"
}
},
"prr": {
@@ -2137,7 +2389,7 @@
"bundled": true
},
"query-string": {
- "version": "6.1.0",
+ "version": "6.2.0",
"bundled": true,
"requires": {
"decode-uri-component": "^0.2.0",
@@ -2203,7 +2455,7 @@
}
},
"read-package-tree": {
- "version": "5.2.1",
+ "version": "5.2.2",
"bundled": true,
"requires": {
"debuglog": "^1.0.1",
@@ -2214,16 +2466,12 @@
}
},
"readable-stream": {
- "version": "2.3.6",
+ "version": "3.1.1",
"bundled": true,
"requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
}
},
"readdir-scoped-modules": {
@@ -2294,10 +2542,10 @@
"bundled": true
},
"rimraf": {
- "version": "2.6.2",
+ "version": "2.6.3",
"bundled": true,
"requires": {
- "glob": "^7.0.5"
+ "glob": "^7.1.3"
}
},
"run-queue": {
@@ -2305,6 +2553,12 @@
"bundled": true,
"requires": {
"aproba": "^1.1.1"
+ },
+ "dependencies": {
+ "aproba": {
+ "version": "1.2.0",
+ "bundled": true
+ }
}
},
"safe-buffer": {
@@ -2316,7 +2570,7 @@
"bundled": true
},
"semver": {
- "version": "5.5.1",
+ "version": "5.6.0",
"bundled": true
},
"semver-diff": {
@@ -2336,6 +2590,28 @@
"requires": {
"graceful-fs": "^4.1.2",
"readable-stream": "^2.0.2"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"shebang-command": {
@@ -2442,7 +2718,7 @@
}
},
"spdx-license-ids": {
- "version": "3.0.0",
+ "version": "3.0.3",
"bundled": true
},
"sshpk": {
@@ -2481,6 +2757,28 @@
"requires": {
"readable-stream": "^2.1.5",
"stream-shift": "^1.0.0"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"stream-shift": {
@@ -2517,7 +2815,7 @@
}
},
"string_decoder": {
- "version": "1.1.1",
+ "version": "1.2.0",
"bundled": true,
"requires": {
"safe-buffer": "~5.1.0"
@@ -2601,6 +2899,28 @@
"requires": {
"readable-stream": "^2.1.5",
"xtend": "~4.0.1"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.6",
+ "bundled": true,
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "bundled": true,
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ }
}
},
"timed-out": {
@@ -2644,7 +2964,7 @@
"bundled": true
},
"unique-filename": {
- "version": "1.1.0",
+ "version": "1.1.1",
"bundled": true,
"requires": {
"unique-slug": "^2.0.0"
@@ -2805,7 +3125,7 @@
"bundled": true
},
"write-file-atomic": {
- "version": "2.3.0",
+ "version": "2.4.2",
"bundled": true,
"requires": {
"graceful-fs": "^4.1.11",
@@ -2876,19 +3196,11 @@
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/require-yaml/-/require-yaml-0.0.1.tgz",
"integrity": "sha1-LhsY2RPDuqcqWk03O28Tjd0sMr0=",
- "requires": {
- "js-yaml": "^3.10.0"
- },
"dependencies": {
- "esprima": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
- "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw=="
- },
"js-yaml": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
- "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
"requires": {
"argparse": "^1.0.7",
"esprima": "^4.0.0"
diff --git a/front/package.json b/front/package.json
index 3ff4b12e0f..07ae364c2c 100644
--- a/front/package.json
+++ b/front/package.json
@@ -20,11 +20,11 @@
"angular-translate-loader-partial": "^2.18.1",
"flatpickr": "^4.5.2",
"fs-extra": "^5.0.0",
- "js-yaml": "^3.12.1",
+ "js-yaml": "^3.13.1",
"material-design-lite": "^1.3.0",
"mg-crud": "^1.1.2",
"moment-timezone": "^0.5.25",
- "npm": "^6.5.0",
+ "npm": "^6.9.0",
"oclazyload": "^0.6.3",
"require-yaml": "0.0.1",
"validator": "^6.3.0"
diff --git a/loopback/common/models/loggable.js b/loopback/common/models/loggable.js
index 32b5db4307..781509e92e 100644
--- a/loopback/common/models/loggable.js
+++ b/loopback/common/models/loggable.js
@@ -112,7 +112,7 @@ module.exports = function(Self) {
for (let key1 in ctx.Model.relations) {
let val1 = ctx.Model.relations[key1];
if (val1.keyFrom == key && key != 'id') {
- let recordSet = await ctx.Model.app.models[val1.modelTo.modelName].findById(val, options);
+ let recordSet = await ctx.Model.app.models[val1.modelTo.modelName].findById(val, null, options);
let showField = val1.modelTo && val1.modelTo.definition.settings.log && val1.modelTo.definition.settings.log.showField && recordSet && recordSet[val1.modelTo.definition.settings.log.showField];
if (!showField) {
diff --git a/loopback/common/models/vn-model.js b/loopback/common/models/vn-model.js
index 41287c2a7c..c2bf8463eb 100644
--- a/loopback/common/models/vn-model.js
+++ b/loopback/common/models/vn-model.js
@@ -11,6 +11,20 @@ module.exports = function(Self) {
setup() {
Self.super_.setup.call(this);
+ /**
+ * Setting a global transaction timeout to find out if the service
+ * is blocked because the connection pool is empty.
+ */
+ this.once('dataSourceAttached', () => {
+ let orgBeginTransaction = this.beginTransaction;
+ this.beginTransaction = function(options, cb) {
+ options = options || {};
+ if (!options.timeout)
+ options.timeout = 30000;
+ return orgBeginTransaction.call(this, options, cb);
+ };
+ });
+
// Register field ACL validation
/* this.beforeRemote('prototype.patchAttributes', ctx => this.checkUpdateAcls(ctx));
this.beforeRemote('updateAll', ctx => this.checkUpdateAcls(ctx));
@@ -41,10 +55,11 @@ module.exports = function(Self) {
},
async crud(deletes, updates, creates) {
- let transaction = await this.beginTransaction({});
- let options = {transaction};
+ let tx = await this.beginTransaction({});
try {
+ let options = {transaction: tx};
+
if (deletes) {
let promises = [];
for (let id of deletes)
@@ -65,9 +80,9 @@ module.exports = function(Self) {
}
}
- await transaction.commit();
+ await tx.commit();
} catch (error) {
- await transaction.rollback();
+ await tx.rollback();
throw error;
}
},
diff --git a/loopback/server/middleware.development.json b/loopback/server/middleware.development.json
index 071c11a30e..9cb38a2750 100644
--- a/loopback/server/middleware.development.json
+++ b/loopback/server/middleware.development.json
@@ -3,7 +3,7 @@
"strong-error-handler": {
"params": {
"debug": true,
- "log": true
+ "log": false
}
}
}
diff --git a/loopback/server/middleware.json b/loopback/server/middleware.json
index 5945458c7f..7fbd27250b 100644
--- a/loopback/server/middleware.json
+++ b/loopback/server/middleware.json
@@ -49,6 +49,10 @@
},
"final:after": {
"./middleware/error-handler": {},
- "strong-error-handler": {}
+ "strong-error-handler": {
+ "params": {
+ "log": false
+ }
+ }
}
}
diff --git a/loopback/server/middleware/error-handler.js b/loopback/server/middleware/error-handler.js
index 2ac11f608c..8772220de8 100644
--- a/loopback/server/middleware/error-handler.js
+++ b/loopback/server/middleware/error-handler.js
@@ -1,4 +1,5 @@
const UserError = require('../../util/user-error');
+const logToConsole = require('strong-error-handler/lib/logger');
module.exports = function() {
return function(err, req, res, next) {
@@ -23,6 +24,9 @@ module.exports = function() {
if (err.sqlState == '45000')
return next(new UserError(req.__(err.sqlMessage)));
+ if (!err.statusCode || err.statusCode >= 500)
+ logToConsole(req, err);
+
next(err);
};
};
diff --git a/modules/agency/back/methods/zone/clone.js b/modules/agency/back/methods/zone/clone.js
index 0f406c49ab..7924415edb 100644
--- a/modules/agency/back/methods/zone/clone.js
+++ b/modules/agency/back/methods/zone/clone.js
@@ -21,39 +21,40 @@ module.exports = Self => {
Self.clone = async id => {
const models = Self.app.models;
- const transaction = await Self.beginTransaction({});
- const options = {transaction};
-
- // Find original zone
- const zone = await models.Zone.findOne({
- fields: [
- 'name',
- 'hour',
- 'warehouseFk',
- 'agencyModeFk',
- 'travelingDays',
- 'price',
- 'bonus',
- 'isVolumetric'],
- where: {id}
- }, options);
-
- const hour = zone.hour;
- const offset = hour.getTimezoneOffset() * 60000;
- hour.setTime(hour.getTime() + offset);
-
- // Find all original included geolocations
- const includedGeo = await models.ZoneIncluded.find({
- fields: ['geoFk', 'isIncluded'],
- where: {zoneFk: id}
- }, options);
-
- // Find all original selected days
- const calendarDays = await models.ZoneCalendar.find({
- where: {zoneFk: id}
- }, options);
+ const tx = await Self.beginTransaction({});
try {
+ let options = {transaction: tx};
+
+ // Find original zone
+ const zone = await models.Zone.findOne({
+ fields: [
+ 'name',
+ 'hour',
+ 'warehouseFk',
+ 'agencyModeFk',
+ 'travelingDays',
+ 'price',
+ 'bonus',
+ 'isVolumetric'],
+ where: {id}
+ }, options);
+
+ const hour = zone.hour;
+ const offset = hour.getTimezoneOffset() * 60000;
+ hour.setTime(hour.getTime() + offset);
+
+ // Find all original included geolocations
+ const includedGeo = await models.ZoneIncluded.find({
+ fields: ['geoFk', 'isIncluded'],
+ where: {zoneFk: id}
+ }, options);
+
+ // Find all original selected days
+ const calendarDays = await models.ZoneCalendar.find({
+ where: {zoneFk: id}
+ }, options);
+
const newZone = await Self.create(zone, options);
const newIncludedGeo = includedGeo.map(included => {
included.zoneFk = newZone.id;
@@ -66,11 +67,11 @@ module.exports = Self => {
await models.ZoneIncluded.create(newIncludedGeo, options);
await models.ZoneCalendar.create(newCalendayDays, options);
- await transaction.commit();
+ await tx.commit();
return newZone;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/agency/front/create/locale/es.yml b/modules/agency/front/create/locale/es.yml
index 24b3f67844..8af004818c 100644
--- a/modules/agency/front/create/locale/es.yml
+++ b/modules/agency/front/create/locale/es.yml
@@ -1,3 +1,3 @@
Traveling days: Días de viaje
-Estimated hour (ETD): Hora estimada (ETD)
+Closure hour (ETD): Hora de cierre (ETD)
Bonus: Bonificación
\ No newline at end of file
diff --git a/modules/agency/front/descriptor/index.html b/modules/agency/front/descriptor/index.html
index 7f122bcf6c..8338090c46 100644
--- a/modules/agency/front/descriptor/index.html
+++ b/modules/agency/front/descriptor/index.html
@@ -30,7 +30,7 @@
-
Name
Agency
Warehouse
- Hour
+ Hour
Price
diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
index de07dd780a..379eec368c 100644
--- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
+++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js
@@ -19,7 +19,7 @@ module.exports = Self => {
}
});
- async function addSalesToTicket(salesToRefund, ticketFk, transaction) {
+ async function addSalesToTicket(salesToRefund, ticketFk, options) {
let formatedSales = [];
salesToRefund.forEach(sale => {
let formatedSale = {
@@ -35,10 +35,10 @@ module.exports = Self => {
};
formatedSales.push(formatedSale);
});
- return await Self.app.models.Sale.create(formatedSales, transaction);
+ return await Self.app.models.Sale.create(formatedSales, options);
}
- async function insertIntoClaimEnd(createdSales, claimId, workerId, transaction) {
+ async function insertIntoClaimEnd(createdSales, claimId, workerId, options) {
let formatedSales = [];
createdSales.forEach(sale => {
let formatedSale = {
@@ -48,17 +48,17 @@ module.exports = Self => {
};
formatedSales.push(formatedSale);
});
- return await Self.app.models.ClaimEnd.create(formatedSales, transaction);
+ return await Self.app.models.ClaimEnd.create(formatedSales, options);
}
- async function saveObservation(observation, transaction) {
+ async function saveObservation(observation, options) {
let query = `INSERT INTO vn.ticketObservation(ticketFk, observationTypeFk, description) VALUES(?, ?, ?)
ON DUPLICATE KEY UPDATE description = CONCAT(vn.ticketObservation.description, VALUES(description),' ')`;
await Self.rawSql(query, [
observation.ticketFk,
observation.observationTypeFk,
observation.description
- ], transaction);
+ ], options);
}
Self.importToNewRefundTicket = async(ctx, id) => {
@@ -109,37 +109,39 @@ module.exports = Self => {
]
};
- let transaction = await Self.beginTransaction({});
+ let tx = await Self.beginTransaction({});
try {
- let newRefundTicket = await models.Ticket.new(ctx, params, {transaction: transaction});
+ let options = {transaction: tx};
+
+ let newRefundTicket = await models.Ticket.new(ctx, params, options);
let observation = {
description: `Reclama ticket: ${claim.ticketFk}`,
ticketFk: newRefundTicket.id,
observationTypeFk: obsevationType.id
};
- await saveObservation(observation, {transaction: transaction});
+ await saveObservation(observation, options);
await models.TicketTracking.create({
ticketFk: newRefundTicket.id,
stateFk: state.id,
workerFk: worker.id
- }, {transaction: transaction});
+ }, options);
let salesToRefund = await models.ClaimBeginning.find(salesFilter);
- let createdSales = await addSalesToTicket(salesToRefund, newRefundTicket.id, {transaction: transaction});
- insertIntoClaimEnd(createdSales, id, worker.id, {transaction: transaction});
+ let createdSales = await addSalesToTicket(salesToRefund, newRefundTicket.id, options);
+ insertIntoClaimEnd(createdSales, id, worker.id, options);
await Self.rawSql('CALL vn.ticketCalculateClon(?, ?)', [
newRefundTicket.id, claim.ticketFk
- ], {transaction: transaction});
+ ], options);
- await transaction.commit();
+ await tx.commit();
return newRefundTicket;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/claim/back/methods/claim/createFromSales.js b/modules/claim/back/methods/claim/createFromSales.js
index f3f4171afb..0e4e34603e 100644
--- a/modules/claim/back/methods/claim/createFromSales.js
+++ b/modules/claim/back/methods/claim/createFromSales.js
@@ -26,27 +26,29 @@ module.exports = Self => {
Self.createFromSales = async(ctx, params) => {
let model = Self.app.models;
- let transaction = await Self.beginTransaction({});
+ let tx = await Self.beginTransaction({});
try {
+ let options = {transaction: tx};
+
let userId = ctx.req.accessToken.userId;
let worker = await Self.app.models.Worker.findOne({where: {userFk: userId}});
params.claim.workerFk = worker.id;
- let newClaim = await Self.create(params.claim, {transaction});
+ let newClaim = await Self.create(params.claim, options);
let promises = [];
for (let i = 0; i < params.sales.length; i++) {
- promises.push(model.ClaimBeginning.create(
- {saleFk: params.sales[i].id,
- claimFk: newClaim.id,
- quantity: params.sales[i].quantity},
- {transaction}));
+ promises.push(model.ClaimBeginning.create({
+ saleFk: params.sales[i].id,
+ claimFk: newClaim.id,
+ quantity: params.sales[i].quantity
+ }, options));
}
await Promise.all(promises);
- await transaction.commit();
+ await tx.commit();
return newClaim;
} catch (e) {
- transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/claim/back/methods/claim/regularizeClaim.js b/modules/claim/back/methods/claim/regularizeClaim.js
index 8ae47a3fa8..5c54a7a2f0 100644
--- a/modules/claim/back/methods/claim/regularizeClaim.js
+++ b/modules/claim/back/methods/claim/regularizeClaim.js
@@ -30,8 +30,10 @@ module.exports = Self => {
where: {claimFk: params.claimFk}
});
- let transaction = await Self.beginTransaction({});
+ let tx = await Self.beginTransaction({});
try {
+ let options = {transaction: tx};
+
for (let i = 0; i < claimEnds.length; i++) {
const claimEnd = claimEnds[i];
const destination = claimEnd.claimDestination();
@@ -45,7 +47,7 @@ module.exports = Self => {
addressFk: addressFk,
companyFk: sale.ticket().companyFk,
warehouseFk: sale.ticket().warehouseFk
- }, transaction);
+ }, options);
let address = await models.Address.findOne({
where: {id: addressFk}
@@ -58,7 +60,7 @@ module.exports = Self => {
warehouseFk: sale.ticket().warehouseFk,
companyFk: sale.ticket().companyFk,
userId: userId
- }, transaction);
+ }, options);
}
await models.Sale.create({
@@ -68,7 +70,7 @@ module.exports = Self => {
quantity: -sale.quantity,
price: sale.price,
discount: 100
- }, {transaction: transaction});
+ }, options);
if (sale.ticket().client().salesPerson()) {
await sendMessage(ctx, {
@@ -78,20 +80,20 @@ module.exports = Self => {
quantity: sale.quantity,
concept: sale.concept,
nickname: address.nickname
- }, transaction);
+ }, options);
}
}
let claim = await Self.findById(params.claimFk);
claim = await claim.updateAttributes({
claimStateFk: resolvedState
- }, {transaction: transaction});
+ }, options);
- await transaction.commit();
+ await tx.commit();
return claim;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
@@ -117,7 +119,7 @@ module.exports = Self => {
});
}
- async function getTicketId(params, transaction) {
+ async function getTicketId(params, options) {
const currentDate = new Date();
currentDate.setHours(null, null, null);
@@ -129,12 +131,12 @@ module.exports = Self => {
shipped: currentDate,
landed: currentDate
}
- }, {transaction: transaction});
+ }, options);
return ticket && ticket.id;
}
- async function createTicket(ctx, params, transaction) {
+ async function createTicket(ctx, params, options) {
let ticket = await Self.app.models.Ticket.new(ctx,
{
shipped: new Date(),
@@ -144,18 +146,18 @@ module.exports = Self => {
companyFk: params.companyFk,
addressFk: params.addressFk,
userId: params.userId
- }, {transaction: transaction});
+ }, options);
return ticket.id;
}
- async function sendMessage(ctx, params, transaction) {
+ async function sendMessage(ctx, params, options) {
const message = `Envio ${params.quantity} unidades de "${params.concept}" (#${params.itemFk}) a `
+ `"${params.nickname}" provenientes del ticket #${params.ticketFk}`;
await Self.app.models.Message.send(ctx, {
recipientFk: params.recipientFk,
message: message
- }, {transaction: transaction});
+ }, options);
}
};
diff --git a/modules/claim/front/descriptor/index.html b/modules/claim/front/descriptor/index.html
index 2c6af59652..d78bf465d2 100644
--- a/modules/claim/front/descriptor/index.html
+++ b/modules/claim/front/descriptor/index.html
@@ -74,4 +74,10 @@
on-response="$ctrl.sendPickupOrder(response)"
question="Send Pickup order"
message="Are you sure you want to send it?">
+
+
\ No newline at end of file
diff --git a/modules/claim/front/descriptor/index.js b/modules/claim/front/descriptor/index.js
index 266983c98d..8d05780192 100644
--- a/modules/claim/front/descriptor/index.js
+++ b/modules/claim/front/descriptor/index.js
@@ -1,15 +1,17 @@
import ngModule from '../module';
class Controller {
- constructor($scope, $state, $http, $translate, vnApp) {
+ constructor($scope, $state, $http, $translate, vnApp, aclService) {
this.$scope = $scope;
this.$state = $state;
this.$http = $http;
this.$translate = $translate;
this.vnApp = vnApp;
+ this.aclService = aclService;
this.moreOptions = [
{callback: this.showPickupOrder, name: 'Show Pickup order'},
- {callback: this.confirmPickupOrder, name: 'Send Pickup order'}
+ {callback: this.confirmPickupOrder, name: 'Send Pickup order'},
+ {callback: this.confirmDeleteClaim, name: 'Delete claim', acl: 'salesAssistant'}
];
}
@@ -57,6 +59,9 @@ class Controller {
this.$scope.confirmPickupOrder.show();
}
+ confirmDeleteClaim() {
+ this.$scope.confirmDeleteClaim.show();
+ }
sendPickupOrder(response) {
if (response === 'ACCEPT') {
this.$http.post(`/api/email/claim-pickup-order`, {claimFk: this.claim.id}).then(
@@ -64,9 +69,17 @@ class Controller {
);
}
}
+ deleteClaim(response) {
+ if (response === 'ACCEPT') {
+ this.$http.delete(`/claim/api/Claims/${this.claim.id}`).then(() => {
+ this.vnApp.showSuccess(this.$translate.instant('Claim deleted!'));
+ this.$state.go('claim.index');
+ });
+ }
+ }
}
-Controller.$inject = ['$scope', '$state', '$http', '$translate', 'vnApp'];
+Controller.$inject = ['$scope', '$state', '$http', '$translate', 'vnApp', 'aclService'];
ngModule.component('vnClaimDescriptor', {
template: require('./index.html'),
diff --git a/modules/claim/front/descriptor/index.spec.js b/modules/claim/front/descriptor/index.spec.js
index 97fa0f9c31..3e6987a1fd 100644
--- a/modules/claim/front/descriptor/index.spec.js
+++ b/modules/claim/front/descriptor/index.spec.js
@@ -48,5 +48,34 @@ describe('Item Component vnClaimDescriptor', () => {
expect(controller.vnApp.showMessage).toHaveBeenCalledWith('Notification sent!');
});
});
+
+ describe('confirmDeleteClaim()', () => {
+ it('should call confirmDeleteClaim.show()', () => {
+ controller.$scope.confirmDeleteClaim = {
+ show: jasmine.createSpy('show')
+ };
+ controller.claim = {id: 2};
+ controller.confirmDeleteClaim();
+
+ expect(controller.$scope.confirmDeleteClaim.show).toHaveBeenCalledWith();
+ });
+ });
+
+ describe('deleteClaime(response)', () => {
+ it('should perform a query and call showSuccess if the response is ACCEPT', () => {
+ let response = 'ACCEPT';
+ controller.claim = {id: 2};
+
+ spyOn(controller.vnApp, 'showSuccess');
+ spyOn(controller.$state, 'go');
+ $httpBackend.when('DELETE', `/claim/api/Claims/2`).respond(200);
+ $httpBackend.expect('DELETE', `/claim/api/Claims/2`);
+ controller.deleteClaim(response);
+ $httpBackend.flush();
+
+ expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Claim deleted!');
+ expect(controller.$state.go).toHaveBeenCalledWith('claim.index');
+ });
+ });
});
diff --git a/modules/claim/front/detail/index.html b/modules/claim/front/detail/index.html
index 456a2ac735..a7031e31ae 100644
--- a/modules/claim/front/detail/index.html
+++ b/modules/claim/front/detail/index.html
@@ -129,29 +129,28 @@
enable="true">
-
-
-
-
- €
-
-
-
-
New price
-
{{($ctrl.saleClaimed.quantity * $ctrl.saleClaimed.sale.price) -
- (($ctrl.newDiscount * ($ctrl.saleClaimed.quantity * $ctrl.saleClaimed.sale.price))/100)
- | currency: 'EUR':2}}
-
-
+
+
+
+
+ €
+
+
+
+
New price
+
{{($ctrl.saleClaimed.quantity * $ctrl.saleClaimed.sale.price) -
+ (($ctrl.newDiscount * ($ctrl.saleClaimed.quantity * $ctrl.saleClaimed.sale.price))/100)
+ | currency: 'EUR':2}}
+
+
-
\ No newline at end of file
diff --git a/modules/claim/front/locale/es.yml b/modules/claim/front/locale/es.yml
index 6c33a779fe..27a9eb9a98 100644
--- a/modules/claim/front/locale/es.yml
+++ b/modules/claim/front/locale/es.yml
@@ -3,6 +3,7 @@ Add sale: Añadir linea
Are you sure you want to send it?: ¿Seguro que quieres enviarlo?
Client Id: Id cliente
Claimed ticket: Ticket reclamado
+Delete claim: Eliminar reclamación
Observation: Observación
Responsible: Responsable
Remove sale: Borrar linea
@@ -11,4 +12,5 @@ Created: Creado
Send Pickup order: Enviar orden de recogida
Show Pickup order: Ver orden de recogida
Search claim by id or client name: Buscar reclamaciones por identificador o nombre de cliente
+Claim deleted!: Reclamación eliminada!
diff --git a/modules/client/back/methods/address/createDefaultAddress.js b/modules/client/back/methods/address/createDefaultAddress.js
index 46691717cb..c757f9f858 100644
--- a/modules/client/back/methods/address/createDefaultAddress.js
+++ b/modules/client/back/methods/address/createDefaultAddress.js
@@ -19,23 +19,25 @@ module.exports = function(Self) {
Self.createDefaultAddress = async data => {
const Address = Self.app.models.Address;
const Client = Self.app.models.Client;
- const transaction = await Address.beginTransaction({});
+ const tx = await Address.beginTransaction({});
try {
+ let options = {transaction: tx};
+
let address = data.address;
- let newAddress = await Address.create(address, {transaction});
- let client = await Client.findById(address.clientFk, {transaction});
+ let newAddress = await Address.create(address, options);
+ let client = await Client.findById(address.clientFk, options);
if (data.isDefaultAddress) {
await client.updateAttributes({
defaultAddressFk: newAddress.id
- }, {transaction});
+ }, options);
}
- await transaction.commit();
+ await tx.commit();
return newAddress;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/client/back/methods/client/confirmTransaction.js b/modules/client/back/methods/client/confirmTransaction.js
index 30a09c5a19..467a8627ba 100644
--- a/modules/client/back/methods/client/confirmTransaction.js
+++ b/modules/client/back/methods/client/confirmTransaction.js
@@ -19,15 +19,17 @@ module.exports = Self => {
});
Self.confirmTransaction = async(ctx, id) => {
- let transaction = await Self.beginTransaction({});
let userId = ctx.req.accessToken.userId;
+ let tx = await Self.beginTransaction({});
try {
- let oldTpvTransaction = await Self.app.models.TpvTransaction.findById(id, {options: transaction});
+ let options = {transaction: tx};
- let confirm = await Self.rawSql('CALL hedera.tpvTransactionConfirmById(?)', [id], {options: transaction});
+ let oldTpvTransaction = await Self.app.models.TpvTransaction.findById(id, null, options);
- let tpvTransaction = await Self.app.models.TpvTransaction.findById(id, {options: transaction});
+ let confirm = await Self.rawSql('CALL hedera.tpvTransaction_confirmById(?)', [id], options);
+
+ let tpvTransaction = await Self.app.models.TpvTransaction.findById(id, null, options);
let oldInstance = {status: oldTpvTransaction.status};
let newInstance = {status: tpvTransaction.status};
@@ -42,12 +44,12 @@ module.exports = Self => {
newInstance: newInstance
};
- await Self.app.models.ClientLog.create(logRecord, {options: transaction});
+ await Self.app.models.ClientLog.create(logRecord, options);
- await transaction.commit();
+ await tx.commit();
return confirm;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/client/back/methods/client/createWithUser.js b/modules/client/back/methods/client/createWithUser.js
index de18d4f4db..36ab284431 100644
--- a/modules/client/back/methods/client/createWithUser.js
+++ b/modules/client/back/methods/client/createWithUser.js
@@ -25,10 +25,12 @@ module.exports = function(Self) {
};
const Account = Self.app.models.Account;
const Address = Self.app.models.Address;
- const transaction = await Account.beginTransaction({});
+ const tx = await Account.beginTransaction({});
try {
- let account = await Account.create(user, {transaction});
+ let options = {transaction: tx};
+
+ let account = await Account.create(user, options);
let client = await Self.create({
id: account.id,
name: data.name,
@@ -42,7 +44,7 @@ module.exports = function(Self) {
provinceFk: data.provinceFk,
countryFk: data.countryFk,
isEqualizated: data.isEqualizated
- }, {transaction});
+ }, options);
let address = await Address.create({
@@ -54,16 +56,16 @@ module.exports = function(Self) {
provinceFk: client.provinceFk,
isEqualizated: client.isEqualizated,
isActive: true
- }, {transaction});
+ }, options);
await client.updateAttributes({
defaultAddressFk: address.id
- }, {transaction});
+ }, options);
- await transaction.commit();
+ await tx.commit();
return client;
} catch (e) {
- await transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/client/back/methods/client/specs/confirmTransaction.spec.js b/modules/client/back/methods/client/specs/confirmTransaction.spec.js
index 3b54102316..5fe638001b 100644
--- a/modules/client/back/methods/client/specs/confirmTransaction.spec.js
+++ b/modules/client/back/methods/client/specs/confirmTransaction.spec.js
@@ -5,7 +5,7 @@ describe('Client confirmTransaction', () => {
afterAll(async done => {
await app.models.Client.rawSql(`
- CALL hedera.tpvTransactionUndo(?)`, [transactionId]);
+ CALL hedera.tpvTransaction_undo(?)`, [transactionId]);
done();
});
diff --git a/modules/client/back/methods/client/uploadFile.js b/modules/client/back/methods/client/uploadFile.js
index 7187d684f2..6b7a494590 100644
--- a/modules/client/back/methods/client/uploadFile.js
+++ b/modules/client/back/methods/client/uploadFile.js
@@ -50,11 +50,12 @@ module.exports = Self => {
Self.uploadFile = async(ctx, id) => {
const models = Self.app.models;
- const transaction = await Self.beginTransaction({});
- const options = {transaction};
const promises = [];
+ const tx = await Self.beginTransaction({});
try {
+ const options = {transaction: tx};
+
const uploadedFiles = await models.Dms.uploadFile(ctx, options);
uploadedFiles.forEach(dms => {
const newClientDms = models.ClientDms.create({
@@ -66,11 +67,11 @@ module.exports = Self => {
});
const resolvedPromises = await Promise.all(promises);
- await transaction.commit();
+ await tx.commit();
return resolvedPromises;
} catch (err) {
- await transaction.rollback();
+ await tx.rollback();
throw err;
}
};
diff --git a/modules/client/back/methods/credit-classification/createWithInsurance.js b/modules/client/back/methods/credit-classification/createWithInsurance.js
index 66e11d2711..368e9a41a1 100644
--- a/modules/client/back/methods/credit-classification/createWithInsurance.js
+++ b/modules/client/back/methods/credit-classification/createWithInsurance.js
@@ -23,11 +23,13 @@ module.exports = Self => {
});
Self.createWithInsurance = async(data, ctx) => {
- let transaction = await Self.beginTransaction({});
+ let tx = await Self.beginTransaction({});
try {
+ let options = {transaction: tx};
+
let classificationSchema = {client: data.clientFk, started: data.started};
- let newClassification = await Self.create(classificationSchema, {transaction});
+ let newClassification = await Self.create(classificationSchema, options);
let CreditInsurance = Self.app.models.CreditInsurance;
let insuranceSchema = {
creditClassification: newClassification.id,
@@ -35,13 +37,13 @@ module.exports = Self => {
grade: data.grade
};
- let newCreditInsurance = await CreditInsurance.create(insuranceSchema, {transaction});
- await transaction.commit();
+ let newCreditInsurance = await CreditInsurance.create(insuranceSchema, options);
+ await tx.commit();
await CreditInsurance.messageSend(newCreditInsurance, ctx.req.accessToken);
return newClassification;
} catch (e) {
- transaction.rollback();
+ await tx.rollback();
throw e;
}
};
diff --git a/modules/client/front/address/create/index.html b/modules/client/front/address/create/index.html
index 344d56be75..58c5cf817f 100644
--- a/modules/client/front/address/create/index.html
+++ b/modules/client/front/address/create/index.html
@@ -6,6 +6,14 @@
save="post"
form="form">
+
+