Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release merge #474

Merged
merged 47 commits into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c0c5389
fix(bug) fixed system microservices (HAL, bluetooth) launch (EWC-413)…
Railag Dec 12, 2018
45f07d6
fix(bug) added registry email validation (EWC-418)
epankou Dec 13, 2018
c0c2b19
test(core) unit tests for iofog-controller (EWC-382) (#426)
Railag Dec 13, 2018
6f488b5
test(core) unit tests for flow & diagnostics controllers, updated pos…
Railag Dec 13, 2018
a11cf4b
bug(fix) CLI diagnostics: Incorrect error message is displayed when u…
alexandershpak Dec 13, 2018
8075b4d
test(core) unit tests for catalog, controller and agent controllers (…
Railag Dec 14, 2018
076f96b
bug(fix) CLI diagnostics ftp: Incorrect error message is displayed wh…
alexandershpak Dec 14, 2018
a94fba7
Merge branch 'master' into develop
dbusel Dec 14, 2018
20212a1
Merge branch 'master' into develop
Dec 14, 2018
fc18405
Merge branch 'master' into develop
Dec 14, 2018
e1eeea5
Update package.json
dbusel Dec 14, 2018
3933a0a
remove automated release
dbusel Dec 17, 2018
146c10f
bug(fix) strace feature bug (EWC-421)
epankou Dec 17, 2018
6d352f1
bug(fix) fixed deprecation warnings (EWC-422) (#438)
Railag Dec 17, 2018
c67e4fc
bug(fix) CLI diagnostics ftp: invalid microservice uuid
alexandershpak Dec 17, 2018
2156553
bug(fix) CLI diagnostics ftp: invalid microservice id (update) (#440)
alexandershpak Dec 17, 2018
f5ecca1
bug(fix) iofog agent API: core network containers are returned when f…
epankou Dec 19, 2018
9e808bf
test(core) unit tests progress for agent & access-token services (EWC…
Railag Dec 19, 2018
a515d9b
feat(npm-scripts): npm scripts improvements (EWC-358 EWC-430)
mchepelev Dec 19, 2018
e7cc6a2
bug(fix): microservices are shown after deleting user, new error message
alexandershpak Dec 19, 2018
569eb84
feat(microservice): update change tracking on delete port mapping (#445)
mchepelev Dec 20, 2018
c941360
version 1.0.31
Railag Dec 20, 2018
90fc143
Merge branch 'release' into develop
dbusel Dec 20, 2018
4acf22b
1.0.31 Release (#448)
Railag Dec 20, 2018
484c4c2
Merge branch 'release' into develop
dbusel Dec 20, 2018
30b9796
Epankou/bug network containers not removed ewc 424 (#450)
epankou Dec 20, 2018
f2d4d91
test(core) unit tests for agent service progress (EWC-383) (#452)
Railag Dec 21, 2018
8c0c354
fix(cli): fix bug with generating access token for user in cli (#453)
mchepelev Dec 21, 2018
b033d9f
Merge branch 'release' into develop
dbusel Dec 21, 2018
63186d1
test(core) unit tests for agent-service (EWC-383) (#455)
Railag Dec 22, 2018
a304b99
bug(fix) fixed deprecated warning about Buffer constructor (EWC-422)
Railag Dec 22, 2018
5dad1a1
test(core) unit tests for catalog service (EWC-383) (#458)
Railag Dec 26, 2018
9ab8218
Maksimchepelev/bugs (#457)
mchepelev Dec 26, 2018
8274ead
Maksimchepelev/bugs (#459)
mchepelev Dec 27, 2018
d51abc5
test(core) unit tests for change-tracking service (EWC-383) (#460)
Railag Dec 27, 2018
8ce03d2
version 1.0.32 (#461)
Railag Dec 27, 2018
daf6824
Merge branch 'release' into develop
dbusel Dec 27, 2018
c236f1c
fix(iofog): add validation for version command (#463)
mchepelev Dec 27, 2018
68b1209
test(core) unit tests for connector & controller services (EWC-383) (…
Railag Dec 27, 2018
415801f
test(core) unit tests for diagnostic service (EWC-383) (#465)
Railag Dec 28, 2018
10ab049
Epankou/bug route removal ewc 374 (#466)
epankou Dec 29, 2018
613f73d
test(core) unit tests for email activation service (EWC-383) (#468)
Railag Dec 29, 2018
54b5e1d
test(core) unit tests for flow service (EWC-383) (#469)
Railag Dec 29, 2018
0864cc9
test(core) unit tests for iofog service (EWC-383) (#470)
Railag Jan 2, 2019
adc97b3
Epankou/bug hal usb cli ewc 449 (#471)
epankou Jan 3, 2019
0c56262
version 1.0.33 (#472)
Railag Jan 3, 2019
e49325c
Merge branch 'release' into develop
dbusel Jan 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iofogcontroller",
"version": "1.0.31",
"version": "1.0.33",
"description": "ioFog Controller project for Eclipse IoFog @ iofog.org \\nCopyright (c) 2018 Edgeworx, Inc.",
"main": "./src/main.js",
"author": "Saeid Baghbidi",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class Catalog extends BaseCLIHandler {
group: [constants.CMD]
},
{
name: 'file', alias: 'f', type: String, description: 'Catalog item settings JSON file',
name: 'file', alias: 'f', type: String, description: 'Path to catalog item settings JSON file',
group: [constants.CMD_ADD, constants.CMD_UPDATE]
},
{
name: 'item-id', alias: 'i', type: String, description: 'Catalog item ID',
name: 'item-id', alias: 'i', type: Number, description: 'Catalog item ID',
group: [constants.CMD_UPDATE, constants.CMD_REMOVE, constants.CMD_INFO]
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/cli/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class Flow extends BaseCLIHandler {
},
{
name: 'file', alias: 'f', type: String,
description: 'Application flow settings JSON file',
description: 'Path to application flow settings JSON file',
group: [constants.CMD_ADD, constants.CMD_UPDATE]
},
{
name: 'flow-id', alias: 'i', type: String,
name: 'flow-id', alias: 'i', type: Number,
description: 'Application flow ID',
group: [constants.CMD_UPDATE, constants.CMD_REMOVE, constants.CMD_INFO]
},
Expand Down
18 changes: 12 additions & 6 deletions src/cli/iofog.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class IOFog extends BaseCLIHandler {
group: [constants.CMD]},
{
name: 'file', alias: 'f', type: String,
description: 'ioFog settings JSON file',
description: 'Path to ioFog settings JSON file',
group: [constants.CMD_ADD, constants.CMD_UPDATE]
},
{
Expand Down Expand Up @@ -314,7 +314,7 @@ async function _deleteFog(obj, user) {
}

async function _getFogList(obj, user) {
const emptyFilters = []
const emptyFilters = [];
const list = await FogService.getFogList(emptyFilters, user, true);
logger.info(JSON.stringify(list, null, 2));
logger.info('Fog list has been gotten successfully.');
Expand Down Expand Up @@ -359,8 +359,11 @@ async function _getHalHardwareInfo(obj) {

logger.info("Parameters" + JSON.stringify(uuidObj));

const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
logger.info(JSON.stringify(info, null, 2));
const data = await FogService.getHalHardwareInfo(uuidObj, {}, true);
if (data.info) {
data.info = JSON.parse(data.info);
}
logger.info(JSON.stringify(data, null, 2));
logger.info('Hardware info has been retrieved successfully.')
}

Expand All @@ -371,8 +374,11 @@ async function _getHalUsbInfo(obj) {

logger.info("Parameters" + JSON.stringify(uuidObj));

const info = await FogService.getHalHardwareInfo(uuidObj, {}, true);
logger.info(JSON.stringify(info, null, 2));
const data = await FogService.getHalUsbInfo(uuidObj, {}, true);
if (data.info) {
data.info = JSON.parse(data.info);
}
logger.info(JSON.stringify(data, null, 2));
logger.info('Usb info has been retrieved successfully.')
}

Expand Down
2 changes: 1 addition & 1 deletion src/cli/microservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Microservice extends BaseCLIHandler {
group: [constants.CMD]
},
{
name: 'file', alias: 'f', type: String, description: 'Microservice settings JSON file',
name: 'file', alias: 'f', type: String, description: 'Path to microservice settings JSON file',
group: [constants.CMD_ADD, constants.CMD_UPDATE]
},
{
Expand Down
3 changes: 1 addition & 2 deletions src/config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@
"Diagnostics": {
"DiagnosticDir": "diagnostic"
}
}

}
2 changes: 1 addition & 1 deletion src/helpers/app-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
const crypto = require('crypto');
const Errors = require('./errors');

const logger = require('../logger');
const fs = require('fs');
const Config = require('../config');
const path = require('path');
Expand Down Expand Up @@ -278,7 +279,6 @@ function isEmpty(obj) {
return true;
}


module.exports = {
encryptText,
decryptText,
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,7 @@ module.exports = {
INVALID_INTERNAL_PORT: 'Internal parsing error. Please provide valid internal port.',
INVALID_ROUTE: 'Route parsing error. Please provide valid route.'
},
CONNECTOR_IS_IN_USE: 'You can\'t delete connector, because it is used for routing now.'
CONNECTOR_IS_IN_USE: 'You can\'t delete connector, because it is used for routing now.',
INVALID_VERSION_COMMAND_UPGRADE: 'Can\'t upgrade version now. Latest is already installed',
INVALID_VERSION_COMMAND_ROLLBACK: 'Can\'t rollback version now. There are no backups on agent'
};
8 changes: 4 additions & 4 deletions src/sequelize/managers/iofog-provision-key-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
*
*/

const BaseManager = require('../managers/base-manager')
const BaseManager = require('../managers/base-manager');
const models = require('./../models');
const FogProvisionKey = models.FogProvisionKey
const FogProvisionKey = models.FogProvisionKey;

class FogProvisionKeyManager extends BaseManager {
getEntity() {
return FogProvisionKey
}
}

const instance = new FogProvisionKeyManager()
module.exports = instance
const instance = new FogProvisionKeyManager();
module.exports = instance;
8 changes: 4 additions & 4 deletions src/sequelize/managers/iofog-version-command-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
*
*/

const BaseManager = require('../managers/base-manager')
const BaseManager = require('../managers/base-manager');
const models = require('./../models');
const FogVersionCommand = models.FogVersionCommand
const FogVersionCommand = models.FogVersionCommand;

class FogVersionCommandManager extends BaseManager {
getEntity() {
return FogVersionCommand
}
}

const instance = new FogVersionCommandManager()
module.exports = instance
const instance = new FogVersionCommandManager();
module.exports = instance;
18 changes: 17 additions & 1 deletion src/sequelize/managers/microservice-public-mode-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,28 @@

const BaseManager = require('../managers/base-manager')
const models = require('./../models');
const MicroservicePublicMode = models.MicroservicePublicMode
const MicroservicePublicMode = models.MicroservicePublicMode;
const ConnectorPort = models.ConnectorPort;

class MicroservicePublicModeManager extends BaseManager {
getEntity() {
return MicroservicePublicMode
}

findAllMicroservicePublicModesByConnectorId(connectorId, transaction) {
return MicroservicePublicMode.findAll({
include: [
{
model: ConnectorPort,
as: 'connectorPort',
required: true
}
],
where: {
'$connectorPort.connector_id$': connectorId
}
}, {transaction: transaction})
}
}

const instance = new MicroservicePublicModeManager()
Expand Down
16 changes: 16 additions & 0 deletions src/sequelize/managers/routing-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@
const BaseManager = require('./base-manager');
const models = require('./../models');
const Routing = models.Routing;
const ConnectorPort = models.ConnectorPort;

class RoutingManager extends BaseManager {
getEntity() {
return Routing;
}

findAllRoutesByConnectorId(connectorId, transaction) {
return Routing.findAll({
include: [
{
model: ConnectorPort,
as: 'connectorPort',
required: true
}
],
where: {
'$connectorPort.connector_id$': connectorId
}
}, {transaction: transaction})
}
}

const instance = new RoutingManager();
Expand Down
10 changes: 6 additions & 4 deletions src/services/agent-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ const formidable = require('formidable');
const Sequelize = require('sequelize');
const Op = Sequelize.Op;

const IncomingForm = formidable.IncomingForm;

const agentProvision = async function (provisionData, transaction) {

await Validator.validate(provisionData, Validator.schemas.agentProvision);
Expand Down Expand Up @@ -129,7 +131,7 @@ const updateAgentConfig = async function (updateData, fog, transaction) {

const getAgentConfigChanges = async function (fog, transaction) {

const changeTracking = await ChangeTrackingService.getByFogId(fog.uuid, transaction);
const changeTracking = await ChangeTrackingService.getByIoFogUuid(fog.uuid, transaction);
if (!changeTracking) {
throw new Errors.NotFoundError(ErrorMessages.INVALID_NODE_ID)
}
Expand Down Expand Up @@ -398,16 +400,16 @@ const putImageSnapshot = async function (req, fog, transaction) {
throw new Errors.ValidationError(ErrorMessages.INVALID_CONTENT_TYPE);
}

const form = new formidable.IncomingForm(opts);
const form = new IncomingForm(opts);
form.uploadDir = path.join(appRoot, '../') + 'data';
if (!fs.existsSync(form.uploadDir)) {
fs.mkdirSync(form.uploadDir);
}
await saveSnapShot(req, form,fog, transaction);
await _saveSnapShot(req, form, fog, transaction);
return {};
};

const saveSnapShot = function (req, form, fog, transaction) {
const _saveSnapShot = function (req, form, fog, transaction) {
return new Promise((resolve, reject) => {
form.parse(req, async function (error, fields, files) {
const file = files['upstream'];
Expand Down
Loading