new(all): New keyword SEE CAPTION and SEE TEXT of for CV.
This commit is contained in:
parent
47d553f8f0
commit
73db528f3b
9 changed files with 27204 additions and 587 deletions
27697
package-lock.json
generated
27697
package-lock.json
generated
File diff suppressed because it is too large
Load diff
23
package.json
23
package.json
|
@ -48,17 +48,18 @@
|
||||||
"commit": "git-cz"
|
"commit": "git-cz"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@azure/cognitiveservices-computervision": "8.1.0",
|
||||||
"@azure/ms-rest-js": "2.5.1",
|
"@azure/ms-rest-js": "2.5.1",
|
||||||
"@google-cloud/pubsub": "^2.13.0",
|
"@google-cloud/pubsub": "2.13.0",
|
||||||
"@google-cloud/translate": "^6.2.6",
|
"@google-cloud/translate": "6.2.6",
|
||||||
"@microsoft/microsoft-graph-client": "2.2.1",
|
"@microsoft/microsoft-graph-client": "2.2.1",
|
||||||
"@semantic-release/changelog": "5.0.1",
|
"@semantic-release/changelog": "5.0.1",
|
||||||
"@semantic-release/exec": "5.0.0",
|
"@semantic-release/exec": "5.0.0",
|
||||||
"@semantic-release/git": "9.0.0",
|
"@semantic-release/git": "9.0.0",
|
||||||
"@sendgrid/mail": "^7.4.4",
|
"@sendgrid/mail": "7.4.4",
|
||||||
"@types/validator": "13.1.4",
|
"@types/validator": "13.1.4",
|
||||||
"adal-node": "0.2.2",
|
"adal-node": "0.2.2",
|
||||||
"adm-zip": "^0.5.6",
|
"adm-zip": "0.5.6",
|
||||||
"any-shell-escape": "0.1.1",
|
"any-shell-escape": "0.1.1",
|
||||||
"async-promises": "0.2.3",
|
"async-promises": "0.2.3",
|
||||||
"azure-arm-cognitiveservices": "3.0.0",
|
"azure-arm-cognitiveservices": "3.0.0",
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
"botlib": "1.9.4",
|
"botlib": "1.9.4",
|
||||||
"cli-spinner": "0.2.10",
|
"cli-spinner": "0.2.10",
|
||||||
"core-js": "3.14.0",
|
"core-js": "3.14.0",
|
||||||
"date-diff": "^0.2.2",
|
"date-diff": "0.2.2",
|
||||||
"dotenv-extended": "2.9.0",
|
"dotenv-extended": "2.9.0",
|
||||||
"exceljs": "4.2.1",
|
"exceljs": "4.2.1",
|
||||||
"express": "4.17.1",
|
"express": "4.17.1",
|
||||||
|
@ -87,15 +88,15 @@
|
||||||
"googleapis": "75.0.0",
|
"googleapis": "75.0.0",
|
||||||
"ibm-watson": "6.1.1",
|
"ibm-watson": "6.1.1",
|
||||||
"js-beautify": "1.13.13",
|
"js-beautify": "1.13.13",
|
||||||
"luxon": "^2.0.2",
|
"luxon": "2.0.2",
|
||||||
"marked": "2.0.7",
|
"marked": "2.0.7",
|
||||||
"momentjs": "^2.0.0",
|
"momentjs": "2.0.0",
|
||||||
"ms-rest-azure": "3.0.0",
|
"ms-rest-azure": "3.0.0",
|
||||||
"nexmo": "2.9.1",
|
"nexmo": "2.9.1",
|
||||||
"node-cron": "3.0.0",
|
"node-cron": "3.0.0",
|
||||||
"npm": "7.21.0",
|
"npm": "7.21.0",
|
||||||
"opn": "6.0.0",
|
"opn": "6.0.0",
|
||||||
"pdf-extraction": "^1.0.2",
|
"pdf-extraction": "1.0.2",
|
||||||
"phone": "2.4.21",
|
"phone": "2.4.21",
|
||||||
"pragmatismo-io-framework": "1.0.20",
|
"pragmatismo-io-framework": "1.0.20",
|
||||||
"prism-media": "1.3.1",
|
"prism-media": "1.3.1",
|
||||||
|
@ -110,13 +111,13 @@
|
||||||
"sequelize": "5.21.5",
|
"sequelize": "5.21.5",
|
||||||
"sequelize-typescript": "1.1.0",
|
"sequelize-typescript": "1.1.0",
|
||||||
"simple-git": "2.39.1",
|
"simple-git": "2.39.1",
|
||||||
"speakingurl": "^14.0.1",
|
"speakingurl": "14.0.1",
|
||||||
"sppull": "2.7.0",
|
"sppull": "2.7.0",
|
||||||
"strict-password-generator": "1.1.2",
|
"strict-password-generator": "1.1.2",
|
||||||
"swagger-client": "2.1.18",
|
"swagger-client": "2.1.18",
|
||||||
"tedious": "9.2.1",
|
"tedious": "9.2.1",
|
||||||
"textract": "2.5.0",
|
"textract": "2.5.0",
|
||||||
"typescript": "3.6.4",
|
"typescript": "3.9.2",
|
||||||
"url-join": "4.0.1",
|
"url-join": "4.0.1",
|
||||||
"vbscript-to-typescript": "1.0.8",
|
"vbscript-to-typescript": "1.0.8",
|
||||||
"walk-promise": "0.2.0",
|
"walk-promise": "0.2.0",
|
||||||
|
@ -139,7 +140,7 @@
|
||||||
"travis-deploy-once": "5.0.11",
|
"travis-deploy-once": "5.0.11",
|
||||||
"ts-node": "10.0.0",
|
"ts-node": "10.0.0",
|
||||||
"tslint": "6.1.2",
|
"tslint": "6.1.2",
|
||||||
"tslint-microsoft-contrib": "^6.2.0",
|
"tslint-microsoft-contrib": "6.2.0",
|
||||||
"typedoc": "0.20.36"
|
"typedoc": "0.20.36"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|
|
@ -273,6 +273,14 @@ export class GBVMService extends GBService {
|
||||||
return `${$1} = sys().sortBy(${$2}, "${$3}")\n`;
|
return `${$1} = sys().sortBy(${$2}, "${$3}")\n`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
code = code.replace(/see\s*text\s*of\s*(\w+)\s*as\s*(\w+)\s*/gi, ($0, $1, $2, $3) => {
|
||||||
|
return `${$2} = sys().seeText(${$1})\n`;
|
||||||
|
});
|
||||||
|
|
||||||
|
code = code.replace(/see\s*caption\s*of\s*(\w+)\s*as(.*)/gi, ($0, $1, $2, $3) => {
|
||||||
|
return `${$2} = sys().seeCaption(${$1})\n`;
|
||||||
|
});
|
||||||
|
|
||||||
code = code.replace(/(wait)\s*(\d+)/gi, ($0, $1, $2) => {
|
code = code.replace(/(wait)\s*(\d+)/gi, ($0, $1, $2) => {
|
||||||
return `sys().wait(${$2})`;
|
return `sys().wait(${$2})`;
|
||||||
});
|
});
|
||||||
|
|
|
@ -37,11 +37,12 @@ import * as request from 'request-promise-native';
|
||||||
import urlJoin = require('url-join');
|
import urlJoin = require('url-join');
|
||||||
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
import { GBAdminService } from '../../admin.gbapp/services/GBAdminService';
|
||||||
import { GBDeployer } from '../../core.gbapp/services/GBDeployer';
|
import { GBDeployer } from '../../core.gbapp/services/GBDeployer';
|
||||||
import { SecService } from '../../security.gbapp/services/SecService';
|
|
||||||
import { DialogKeywords } from './DialogKeywords';
|
import { DialogKeywords } from './DialogKeywords';
|
||||||
const request = require('request-promise-native');
|
const request = require('request-promise-native');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const sgMail = require('@sendgrid/mail');
|
const sgMail = require('@sendgrid/mail');
|
||||||
|
const ComputerVisionClient = require('@azure/cognitiveservices-computervision').ComputerVisionClient;
|
||||||
|
const ApiKeyCredentials = require('@azure/ms-rest-js').ApiKeyCredentials;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fileoverview General Bots server core.
|
* @fileoverview General Bots server core.
|
||||||
|
@ -80,6 +81,39 @@ export class SystemKeywords {
|
||||||
return array.filter(function (item, pos) { return item; });
|
return array.filter(function (item, pos) { return item; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @example SEE CAPTION OF url AS variable
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public async seeCaption(url) {
|
||||||
|
const computerVisionClient = new ComputerVisionClient(
|
||||||
|
new ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': process.env.VISION_KEY } }),
|
||||||
|
process.env.VISION_ENDPOINT);
|
||||||
|
|
||||||
|
const caption = (await computerVisionClient.describeImage(url)).captions[0];
|
||||||
|
GBLog.info(`GBVision (caption): '${caption.text}' (Confidence: ${caption.confidence.toFixed(2)})`);
|
||||||
|
return caption.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @example SEE TEXT OF url AS variable
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public async seeText(url) {
|
||||||
|
const computerVisionClient = new ComputerVisionClient(
|
||||||
|
new ApiKeyCredentials({ inHeader: { 'Ocp-Apim-Subscription-Key': process.env.VISION_KEY } }),
|
||||||
|
process.env.VISION_ENDPOINT);
|
||||||
|
|
||||||
|
const result = (await computerVisionClient.recognizePrintedText(true, url));
|
||||||
|
const text = result.regions[0].lines[0].words[0].text;
|
||||||
|
// TODO: Create loop to get entire text.
|
||||||
|
GBLog.info(`GBVision (text): '${text}'`);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
public async sortBy(array, memberName) {
|
public async sortBy(array, memberName) {
|
||||||
memberName = memberName.trim();
|
memberName = memberName.trim();
|
||||||
const contentLocale = this.min.core.getParam<string>(
|
const contentLocale = this.min.core.getParam<string>(
|
||||||
|
|
|
@ -57,7 +57,6 @@ const { join } = require('path');
|
||||||
const shell = require('any-shell-escape');
|
const shell = require('any-shell-escape');
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
const prism = require('prism-media');
|
const prism = require('prism-media');
|
||||||
const uuidv4 = require('uuid/v4');
|
|
||||||
const request = require('request-promise-native');
|
const request = require('request-promise-native');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const SpeechToTextV1 = require('ibm-watson/speech-to-text/v1');
|
const SpeechToTextV1 = require('ibm-watson/speech-to-text/v1');
|
||||||
|
@ -800,7 +799,7 @@ export class GBConversationalService {
|
||||||
'Ocp-Apim-Subscription-Key': key,
|
'Ocp-Apim-Subscription-Key': key,
|
||||||
'Ocp-Apim-Subscription-Region': 'westeurope',
|
'Ocp-Apim-Subscription-Region': 'westeurope',
|
||||||
'Content-type': 'application/json',
|
'Content-type': 'application/json',
|
||||||
'X-ClientTraceId': uuidv4().toString()
|
'X-ClientTraceId': GBAdminService.generateUuid()
|
||||||
},
|
},
|
||||||
body: [
|
body: [
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,6 @@ const express = require('express');
|
||||||
const child_process = require('child_process');
|
const child_process = require('child_process');
|
||||||
const rimraf = require('rimraf');
|
const rimraf = require('rimraf');
|
||||||
const request = require('request-promise-native');
|
const request = require('request-promise-native');
|
||||||
const uuidv4 = require('uuid/v4');
|
|
||||||
import { GBError, GBLog, GBMinInstance, IGBCoreService, IGBDeployer, IGBInstance, IGBPackage } from 'botlib';
|
import { GBError, GBLog, GBMinInstance, IGBCoreService, IGBDeployer, IGBInstance, IGBPackage } from 'botlib';
|
||||||
import { AzureSearch } from 'pragmatismo-io-framework';
|
import { AzureSearch } from 'pragmatismo-io-framework';
|
||||||
import { CollectionUtil } from 'pragmatismo-io-framework';
|
import { CollectionUtil } from 'pragmatismo-io-framework';
|
||||||
|
@ -58,6 +57,7 @@ import { GBImporter } from './GBImporterService';
|
||||||
import { TeamsService } from '../../teams.gblib/services/TeamsService';
|
import { TeamsService } from '../../teams.gblib/services/TeamsService';
|
||||||
const MicrosoftGraph = require('@microsoft/microsoft-graph-client');
|
const MicrosoftGraph = require('@microsoft/microsoft-graph-client');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deployer service for bots, themes, ai and more.
|
* Deployer service for bots, themes, ai and more.
|
||||||
*/
|
*/
|
||||||
|
@ -363,7 +363,8 @@ export class GBDeployer implements IGBDeployer {
|
||||||
public async getBotManifest(instance: IGBInstance): Promise<Buffer> {
|
public async getBotManifest(instance: IGBInstance): Promise<Buffer> {
|
||||||
const s = new TeamsService();
|
const s = new TeamsService();
|
||||||
const manifest = await s.getManifest(instance.marketplaceId, instance.title, instance.description,
|
const manifest = await s.getManifest(instance.marketplaceId, instance.title, instance.description,
|
||||||
uuidv4().toString(), instance.botId, "General Bots");
|
GBAdminService.generateUuid(), instance.botId, "General Bots");
|
||||||
|
|
||||||
return await s.getAppFile(manifest);
|
return await s.getAppFile(manifest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,12 +212,13 @@ export class KBService implements IGBKBService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!question) {
|
if (!question) {
|
||||||
question = await GuaribasQuestion.findOne({
|
// TODO: Solve this compilation error.
|
||||||
where: {
|
// question = await GuaribasQuestion.findOne({
|
||||||
instanceId: instanceId,
|
// where: {
|
||||||
content: { [Op.eq]: `${text}` }
|
// instanceId: instanceId,
|
||||||
}
|
// content: { [Op.eq]: `${text}` }
|
||||||
});
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (question !== null) {
|
if (question !== null) {
|
||||||
|
|
|
@ -80,9 +80,11 @@ export class GBServer {
|
||||||
|
|
||||||
public static run() {
|
public static run() {
|
||||||
|
|
||||||
|
|
||||||
GBLog.info(`The Bot Server is in STARTING mode...`);
|
GBLog.info(`The Bot Server is in STARTING mode...`);
|
||||||
GBServer.globals = new RootData();
|
GBServer.globals = new RootData();
|
||||||
GBConfigService.init();
|
GBConfigService.init();
|
||||||
|
|
||||||
const port = GBConfigService.getServerPort();
|
const port = GBConfigService.getServerPort();
|
||||||
const server = express();
|
const server = express();
|
||||||
GBServer.globals.server = server;
|
GBServer.globals.server = server;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{
|
{
|
||||||
"defaultSeverity": "warning",
|
"defaultSeverity": "warning",
|
||||||
"extends": [
|
"extends": [
|
||||||
"tslint:recommended",
|
"tslint:recommended"
|
||||||
"tslint-microsoft-contrib"
|
|
||||||
],
|
],
|
||||||
"linterOptions": {
|
"linterOptions": {
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
@ -13,7 +12,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"rulesDirectory": [
|
"rulesDirectory": [
|
||||||
"node_modules/tslint-microsoft-contrib"
|
|
||||||
],
|
],
|
||||||
"jsRules": {},
|
"jsRules": {},
|
||||||
"rules": {
|
"rules": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue