fix(general): tslint being applied in all sources.

This commit is contained in:
Rodrigo Rodriguez 2019-04-07 12:23:27 -03:00
parent 25d14592b7
commit 77ccc3d319
9 changed files with 498 additions and 286 deletions

669
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -57,28 +57,28 @@
"azure-arm-search": "^1.3.0-preview",
"azure-arm-sql": "5.6.0",
"azure-arm-website": "5.7.0",
"bluebird": "^3.5.3",
"bluebird": "^3.5.4",
"body-parser": "1.18.3",
"botbuilder": "4.1.7",
"botbuilder-ai": "4.2.0",
"botbuilder-azure": "4.2.0",
"botbuilder": "4.3.4",
"botbuilder-ai": "4.3.4",
"botbuilder-azure": "4.3.4",
"botbuilder-choices": "4.0.0-preview1.2",
"botbuilder-dialogs": "4.2.0",
"botbuilder-dialogs": "4.3.4",
"botbuilder-prompts": "4.0.0-preview1.2",
"botlib": "^0.1.23",
"botlib": "0.1.24",
"chai": "4.2.0",
"child_process": "^1.0.2",
"chokidar": "2.1.2",
"chokidar": "2.1.5",
"cli-spinner": "^0.2.10",
"csv-parse": "4.3.3",
"csv-parse": "4.3.4",
"dotenv-extended": "2.4.0",
"express": "4.16.4",
"express-promise-router": "3.0.3",
"fs-extra": "7.0.1",
"ip": "^1.1.5",
"js-beautify": "^1.9.0",
"js-beautify": "^1.9.1",
"localize": "0.4.7",
"marked": "0.6.1",
"marked": "0.6.2",
"mocha": "6.0.2",
"mocha-typescript": "1.1.17",
"ms": "2.1.1",
@ -87,28 +87,28 @@
"nexmo": "2.4.1",
"ngrok": "3.1.1",
"nyc": "13.3.0",
"opn": "5.4.0",
"pragmatismo-io-framework": "1.0.19",
"opn": "6.0.0",
"pragmatismo-io-framework": "1.0.20",
"process-exists": "3.1.0",
"public-ip": "^3.0.0",
"reflect-metadata": "0.1.13",
"request-promise": "4.2.4",
"request-promise-native": "1.0.7",
"scanf": "^1.0.2",
"sequelize": "^4.43.0",
"sequelize-typescript": "0.6.7",
"sequelize": "^5.2.12",
"sequelize-typescript": "0.6.9",
"shx": "0.3.2",
"simple-git": "1.107.0",
"simple-git": "1.110.0",
"sqlite3": "4.0.6",
"strict-password-generator": "^1.1.2",
"swagger-client": "3.8.25",
"tedious": "5.0.3",
"tedious": "6.1.0",
"temperature-js": "^0.1.0",
"ts-node": "8.0.3",
"typedoc": "0.14.2",
"typedoc-plugin-external-module-name": "^2.0.0",
"typedoc-plugin-markdown": "^1.1.27",
"typescript": "3.3.3333",
"typescript": "3.4.1",
"url-join": "4.0.0",
"vbscript-to-typescript": "^1.0.8",
"wait-until": "0.0.2",
@ -124,7 +124,7 @@
"@semantic-release/release-notes-generator": "^7.1.4",
"@types/chai": "4.1.7",
"@types/mocha": "5.2.6",
"@types/sequelize": "4.27.39",
"@types/sequelize": "4.27.46",
"@types/url-join": "4.0.0",
"@types/winston": "2.4.4",
"ban-sensitive-files": "1.9.2",
@ -142,7 +142,7 @@
"standard": "12.0.1",
"travis-deploy-once": "5.0.11",
"ts-loader": "^5.3.3",
"tslint": "^5.13.1",
"tslint": "^5.15.0",
"tslint-microsoft-contrib": "^6.1.0"
},
"eslintConfig": {

View file

@ -65,7 +65,7 @@ export class AdminDialog extends IGBDialog {
if (!AdminDialog.isSharePointPath(packageName)) {
const additionalPath = GBConfigService.get('ADDITIONAL_DEPLOY_PATH');
if (additionalPath !== undefined) {
if (additionalPath === undefined) {
throw new Error('ADDITIONAL_DEPLOY_PATH is not set and deployPackage was called.');
}
await deployer.deployPackage(min, urlJoin(additionalPath, packageName));

View file

@ -36,12 +36,6 @@
'use strict';
import {
DataTypeDate,
DataTypeDecimal,
DataTypes,
DataTypeUUIDv4
} from 'sequelize';
import {
AutoIncrement,

View file

@ -218,7 +218,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
const query = `subscriptions/${subscriptionId}/resourceGroups/${group}/providers/${
this.provider
}/botServices/${botId}?api-version=${this.apiVersion}`;
}/botServices/${botId}?api-version=${this.apiVersion}`;
const url = urlJoin(baseUrl, query);
const req = AzureDeployerService.createRequestObject(url, accessToken, 'PATCH', JSON.stringify(parameters));
const res = await httpClient.sendRequest(req);
@ -313,7 +313,8 @@ export class AzureDeployerService implements IGBInstallationDeployer {
GBLog.info(`Deploying Text Analytics...`);
const textAnalytics = await this.createTextAnalytics(name, `${name}-textanalytics`, instance.cloudLocation);
keys = await this.cognitiveClient.accounts.listKeys(name, textAnalytics.name);
instance.textAnalyticsEndpoint = textAnalytics.endpoint;
instance.textAnalyticsEndpoint = textAnalytics.endpoint.replace(`/text/analytics/v2.0`, '');
instance.textAnalyticsKey = keys.key1;
GBLog.info(`Deploying NLP...`);
@ -460,7 +461,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
const httpClient = new ServiceClient();
let query = `subscriptions/${subscriptionId}/resourceGroups/${group}/providers/${
this.provider
}/botServices/${botId}?api-version=${this.apiVersion}`;
}/botServices/${botId}?api-version=${this.apiVersion}`;
let url = urlJoin(baseUrl, query);
let req = AzureDeployerService.createRequestObject(url, accessToken, 'PUT', JSON.stringify(parameters));
const res = await httpClient.sendRequest(req);
@ -475,7 +476,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
//tslint:disable-next-line:max-line-length
query = `subscriptions/${subscriptionId}/resourceGroups/${group}/providers/Microsoft.BotService/botServices/${botId}/channels/WebChatChannel/listChannelWithKeys?api-version=${
this.apiVersion
}`;
}`;
url = urlJoin(baseUrl, query);
req = AzureDeployerService.createRequestObject(url, accessToken, 'POST', JSON.stringify(parameters));
const resChannel = await httpClient.sendRequest(req);
@ -485,7 +486,7 @@ export class AzureDeployerService implements IGBInstallationDeployer {
} catch (error) {
reject(error);
}
}, 20000);
}, 20000);
});
}

View file

@ -121,8 +121,8 @@ export class GBCoreService implements IGBCoreService {
const logging: boolean | Function =
GBConfigService.get('STORAGE_LOGGING') === 'true'
? (str: string): void => {
GBLog.info(str);
}
GBLog.info(str);
}
: false;
const encrypt: boolean = GBConfigService.get('STORAGE_ENCRYPT') === 'true';
@ -137,9 +137,10 @@ export class GBCoreService implements IGBCoreService {
dialect: this.dialect,
storage: storage,
dialectOptions: {
encrypt: encrypt
},
pool: {
options: {
encrypt: encrypt
}
}, pool: {
max: 32,
min: 8,
idle: 40000,
@ -345,8 +346,8 @@ STORAGE_SYNC=true
GBCorePackage,
GBSecurityPackage,
GBKBPackage,
GBCustomerSatisfactionPackage,
GBWhatsappPackage
GBCustomerSatisfactionPackage
// GBWhatsappPackage
].forEach(e => {
GBLog.info(`Loading sys package: ${e.name}...`);
const p = Object.create(e.prototype) as IGBPackage;

View file

@ -140,7 +140,7 @@ export class GBMinService {
// Install default VBA module.
deployer.deployPackage(min, 'packages/default.gbdialog');
// DISABLED: deployer.deployPackage(min, 'packages/default.gbdialog');
// Call the loadBot context.activity for all packages.
@ -354,8 +354,8 @@ export class GBMinService {
GBAdminPackage,
GBKBPackage,
GBAnalyticsPackage,
GBCustomerSatisfactionPackage,
GBWhatsappPackage
GBCustomerSatisfactionPackage
// DISABLED: GBWhatsappPackage
].forEach(sysPackage => {
const p = Object.create(sysPackage.prototype) as IGBPackage;
p.loadBot(min);

View file

@ -210,25 +210,29 @@ export class KBService {
if (subjects) {
const where = {
from: from,
subject1: undefined,
subject2: undefined,
subject3: undefined,
subject4: undefined
// tslint:disable-next-line: no-null-keyword
subject1: null,
// tslint:disable-next-line: no-null-keyword
subject2: null,
// tslint:disable-next-line: no-null-keyword
subject3: null,
// tslint:disable-next-line: no-null-keyword
subject4: null
};
if (subjects[0]) {
if (subjects[0] && subjects[0].internalId) {
where.subject1 = subjects[0].internalId;
}
if (subjects[1]) {
if (subjects[1] && subjects[1].internalId) {
where.subject2 = subjects[1].internalId;
}
if (subjects[2]) {
if (subjects[2] && subjects[2].internalId) {
where.subject3 = subjects[2].internalId;
}
if (subjects[3]) {
if (subjects[3] && subjects[3].internalId) {
where.subject4 = subjects[3].internalId;
}
@ -329,7 +333,7 @@ export class KBService {
packageId: packageId
});
if (lastAnswer !== null && lastQuestionId !== 0) {
if (lastAnswer !== undefined && lastQuestionId !== 0) {
await lastAnswer.update({ nextId: lastQuestionId });
}
lastAnswer = answer1;

View file

@ -36,30 +36,17 @@
'use strict';
import {
DataTypeDate,
DataTypeDecimal,
DataTypes,
DataTypeUUIDv4
} from 'sequelize';
import {
AutoIncrement,
BelongsTo,
BelongsToMany,
Column,
CreatedAt,
DataType,
ForeignKey,
HasMany,
IsUUID,
Length,
Model,
PrimaryKey,
Sequelize,
Table,
UpdatedAt
} from 'sequelize-typescript';
Table} from 'sequelize-typescript';
import { GuaribasInstance } from '../../core.gbapp/models/GBModel';