fix(all): Libraries update.
This commit is contained in:
parent
9a82d2de01
commit
2dcde51c95
15 changed files with 176 additions and 233 deletions
210
package.json
210
package.json
|
@ -55,7 +55,7 @@
|
||||||
"jest": {
|
"jest": {
|
||||||
"workerIdleMemoryLimit": "4096MB",
|
"workerIdleMemoryLimit": "4096MB",
|
||||||
"transform": {
|
"transform": {
|
||||||
"^.+\\.tsx?$": "ts-jest"
|
".+\\.tsx?$": "ts-jest"
|
||||||
},
|
},
|
||||||
"moduleFileExtensions": [
|
"moduleFileExtensions": [
|
||||||
"ts",
|
"ts",
|
||||||
|
@ -66,180 +66,180 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@azure/arm-appservice": "13.0.3",
|
"@azure/arm-appservice": "14.1.0",
|
||||||
"@azure/arm-cognitiveservices": "7.3.1",
|
"@azure/arm-cognitiveservices": "7.5.0",
|
||||||
"@azure/arm-resources": "5.1.0",
|
"@azure/arm-resources": "5.2.0",
|
||||||
"@azure/arm-search": "3.0.1",
|
"@azure/arm-search": "3.2.0",
|
||||||
"@azure/arm-sql": "9.0.1",
|
"@azure/arm-sql": "10.0.0",
|
||||||
"@azure/arm-subscriptions": "5.1.0",
|
"@azure/arm-subscriptions": "5.1.0",
|
||||||
"@azure/cognitiveservices-computervision": "8.2.0",
|
"@azure/cognitiveservices-computervision": "8.2.0",
|
||||||
"@azure/keyvault-keys": "4.6.0",
|
"@azure/keyvault-keys": "4.8.0",
|
||||||
"@azure/ms-rest-js": "2.6.2",
|
"@azure/ms-rest-js": "2.7.0",
|
||||||
"@azure/msal-node": "1.14.3",
|
"@azure/msal-node": "2.8.1",
|
||||||
"@azure/search-documents": "12.0.0",
|
"@azure/search-documents": "12.0.0",
|
||||||
"@azure/storage-blob": "12.17.0",
|
"@azure/storage-blob": "12.18.0",
|
||||||
"@google-cloud/pubsub": "3.2.1",
|
"@google-cloud/pubsub": "4.4.0",
|
||||||
"@google-cloud/translate": "7.0.4",
|
"@google-cloud/translate": "8.3.0",
|
||||||
"@hubspot/api-client": "7.1.2",
|
"@hubspot/api-client": "11.1.0",
|
||||||
"@koa/cors": "4.0.0",
|
"@koa/cors": "5.0.0",
|
||||||
"@langchain/community": "0.0.36",
|
"@langchain/community": "0.2.2",
|
||||||
"@langchain/openai": "0.0.33",
|
"@langchain/openai": "0.0.33",
|
||||||
"@microsoft/microsoft-graph-client": "3.0.4",
|
"@microsoft/microsoft-graph-client": "3.0.7",
|
||||||
"@nlpjs/basic": "4.26.1",
|
"@nlpjs/basic": "4.27.0",
|
||||||
"@nosferatu500/textract": "3.1.2",
|
"@nosferatu500/textract": "3.1.3",
|
||||||
"@push-rpc/core": "1.8.2",
|
"@push-rpc/core": "1.9.0",
|
||||||
"@push-rpc/http": "1.8.2",
|
"@push-rpc/http": "1.9.0",
|
||||||
"@push-rpc/openapi": "^1.9.0",
|
"@push-rpc/openapi": "1.9.0",
|
||||||
"@push-rpc/websocket": "1.8.2",
|
"@push-rpc/websocket": "1.9.0",
|
||||||
"@semantic-release/changelog": "5.0.1",
|
"@semantic-release/changelog": "6.0.3",
|
||||||
"@semantic-release/exec": "5.0.0",
|
"@semantic-release/exec": "6.0.3",
|
||||||
"@semantic-release/git": "9.0.0",
|
"@semantic-release/git": "10.0.1",
|
||||||
"@sendgrid/mail": "7.7.0",
|
"@sendgrid/mail": "8.1.3",
|
||||||
"@sequelize/core": "7.0.0-alpha.29",
|
"@sequelize/core": "7.0.0-alpha.37",
|
||||||
"@types/node": "18.11.9",
|
"@types/node": "20.12.12",
|
||||||
"@types/validator": "13.7.10",
|
"@types/validator": "13.11.10",
|
||||||
"adm-zip": "0.5.9",
|
"adm-zip": "0.5.12",
|
||||||
"alasql": "2.1.6",
|
"alasql": "4.4.0",
|
||||||
"any-shell-escape": "0.1.1",
|
"any-shell-escape": "0.1.1",
|
||||||
"arraybuffer-to-buffer": "0.0.7",
|
"arraybuffer-to-buffer": "0.0.7",
|
||||||
"async-mutex": "0.4.0",
|
"async-mutex": "0.5.0",
|
||||||
"async-promises": "0.2.3",
|
"async-promises": "0.2.3",
|
||||||
"async-retry": "1.3.3",
|
"async-retry": "1.3.3",
|
||||||
"basic-auth": "2.0.1",
|
"basic-auth": "2.0.1",
|
||||||
"billboard.js": "3.6.3",
|
"billboard.js": "3.11.3",
|
||||||
"bluebird": "3.7.2",
|
"bluebird": "3.7.2",
|
||||||
"body-parser": "1.20.1",
|
"body-parser": "1.20.1",
|
||||||
"botbuilder": "4.18.0",
|
"botbuilder": "4.18.0",
|
||||||
"botbuilder-adapter-facebook": "1.0.12",
|
"botbuilder-adapter-facebook": "1.0.12",
|
||||||
"botbuilder-ai": "4.18.0",
|
"botbuilder-ai": "4.18.0",
|
||||||
"botbuilder-dialogs": "4.18.0",
|
"botbuilder-dialogs": "4.18.0",
|
||||||
"botframework-connector": "4.18.0",
|
"botframework-connector": "4.22.2",
|
||||||
"botlib": "3.0.11",
|
"botlib": "3.0.11",
|
||||||
"c3-chart-maker": "0.2.8",
|
"c3-chart-maker": "0.2.8",
|
||||||
"cd": "^0.3.3",
|
"cd": "0.3.3",
|
||||||
"chalk-animation": "^2.0.3",
|
"chalk-animation": "2.0.3",
|
||||||
"chatgpt": "2.4.2",
|
"chatgpt": "5.2.5",
|
||||||
"chrome-remote-interface": "0.31.3",
|
"chrome-remote-interface": "0.33.0",
|
||||||
"cli-progress": "3.11.2",
|
"cli-progress": "3.12.0",
|
||||||
"cli-spinner": "0.2.10",
|
"cli-spinner": "0.2.10",
|
||||||
"core-js": "3.26.1",
|
"core-js": "3.37.1",
|
||||||
"data-forge": "1.9.6",
|
"data-forge": "1.10.2",
|
||||||
"date-diff": "1.0.2",
|
"date-diff": "1.0.2",
|
||||||
"docximager": "0.0.4",
|
"docximager": "0.0.4",
|
||||||
"docxtemplater": "3.9.7",
|
"docxtemplater": "3.47.4",
|
||||||
"dotenv-extended": "2.9.0",
|
"dotenv-extended": "2.9.0",
|
||||||
"dynamics-web-api": "1.7.6",
|
"exceljs": "4.4.0",
|
||||||
"exceljs": "4.3.0",
|
"express": "4.19.2",
|
||||||
"express": "4.18.2",
|
|
||||||
"express-remove-route": "1.0.0",
|
"express-remove-route": "1.0.0",
|
||||||
"ffmpeg-static": "5.1.0",
|
"ffmpeg-static": "5.2.0",
|
||||||
"get-image-colors": "^4.0.1",
|
"get-image-colors": "4.0.1",
|
||||||
"google-libphonenumber": "3.2.31",
|
"google-libphonenumber": "3.2.34",
|
||||||
"googleapis": "126.0.1",
|
"googleapis": "126.0.1",
|
||||||
"hnswlib-node": "^1.4.2",
|
"hnswlib-node": "3.0.0",
|
||||||
"http-proxy": "1.18.1",
|
"http-proxy": "1.18.1",
|
||||||
"ibm-watson": "7.1.2",
|
"ibm-watson": "9.1.0",
|
||||||
"iso-639-1": "3.1.1",
|
"iso-639-1": "3.1.2",
|
||||||
"join-images-updated": "1.1.11",
|
"join-images-updated": "1.1.11",
|
||||||
"js-md5": "0.8.3",
|
"js-md5": "0.8.3",
|
||||||
"json-schema-to-zod": "^2.0.14",
|
"json-schema-to-zod": "2.1.0",
|
||||||
"just-indent": "0.0.1",
|
"just-indent": "0.0.1",
|
||||||
"keyv": "4.5.2",
|
"keyv": "4.5.4",
|
||||||
"koa": "2.13.4",
|
"koa": "2.15.3",
|
||||||
"koa-body": "6.0.1",
|
"koa-body": "6.0.1",
|
||||||
"koa-router": "12.0.0",
|
"koa-router": "12.0.1",
|
||||||
"langchain": "0.1.25",
|
"langchain": "0.2.2",
|
||||||
"language-tags": "^1.0.9",
|
"language-tags": "1.0.9",
|
||||||
"line-replace": "2.0.1",
|
"line-replace": "2.0.1",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
"lunary": "^0.6.16",
|
"luxon": "3.4.4",
|
||||||
"luxon": "3.1.0",
|
"mammoth": "1.7.2",
|
||||||
"mammoth": "1.7.0",
|
"mariadb": "3.3.0",
|
||||||
"mariadb": "3.2.2",
|
|
||||||
"mime-types": "2.1.35",
|
"mime-types": "2.1.35",
|
||||||
"moment": "1.3.0",
|
"moment": "2.30.1",
|
||||||
"ms-rest-azure": "3.0.0",
|
"ms-rest-azure": "3.0.2",
|
||||||
"nexmo": "2.9.1",
|
"nexmo": "2.9.1",
|
||||||
"ngrok": "5.0.0-beta.2",
|
"ngrok": "5.0.0-beta.2",
|
||||||
"node-cron": "3.0.2",
|
"node-cron": "3.0.3",
|
||||||
"node-html-parser": "6.1.5",
|
"node-html-parser": "6.1.13",
|
||||||
"node-nlp": "4.26.1",
|
"node-nlp": "4.27.0",
|
||||||
"node-tesseract-ocr": "2.2.1",
|
"node-tesseract-ocr": "2.2.1",
|
||||||
"npm": "9.6.1",
|
"npm": "10.8.0",
|
||||||
"open": "8.4.0",
|
"open": "10.1.0",
|
||||||
"open-docxtemplater-image-module": "1.0.3",
|
"open-docxtemplater-image-module": "1.0.3",
|
||||||
"openai": "4.6.0",
|
"openai": "4.47.1",
|
||||||
"pdf-extraction": "1.0.2",
|
"pdf-extraction": "1.0.2",
|
||||||
"pdf-parse": "1.1.1",
|
"pdf-parse": "1.1.1",
|
||||||
"pdf-to-png-converter": "3.2.0",
|
"pdf-to-png-converter": "3.2.0",
|
||||||
"pdfjs-dist": "4.0.379",
|
"pdfjs-dist": "4.2.67",
|
||||||
"pdfkit": "0.13.0",
|
"pdfkit": "0.15.0",
|
||||||
"phone": "3.1.30",
|
"phone": "3.1.44",
|
||||||
"pizzip": "3.1.3",
|
"pizzip": "3.1.7",
|
||||||
"pptxtemplater": "1.0.5",
|
"pptxtemplater": "1.0.5",
|
||||||
"pragmatismo-io-framework": "1.1.1",
|
"pragmatismo-io-framework": "1.1.1",
|
||||||
"prism-media": "1.3.4",
|
"prism-media": "1.3.5",
|
||||||
"public-ip": "6.0.1",
|
"public-ip": "6.0.2",
|
||||||
"punycode": "2.1.1",
|
"punycode": "2.3.1",
|
||||||
"puppeteer": "19.8.0",
|
"puppeteer": "19.7.2",
|
||||||
"puppeteer-extra": "3.3.4",
|
"puppeteer-extra": "3.3.6",
|
||||||
"puppeteer-extra-plugin-minmax": "1.1.2",
|
"puppeteer-extra-plugin-minmax": "1.1.2",
|
||||||
"puppeteer-extra-plugin-stealth": "2.11.1",
|
"puppeteer-extra-plugin-stealth": "2.11.2",
|
||||||
"qr-scanner": "1.4.2",
|
"qr-scanner": "1.4.2",
|
||||||
"qrcode": "1.5.1",
|
"qrcode": "1.5.3",
|
||||||
"qrcode-terminal": "0.12.0",
|
"qrcode-terminal": "0.12.0",
|
||||||
"readline": "1.3.0",
|
"readline": "1.3.0",
|
||||||
"reflect-metadata": "0.1.13",
|
"reflect-metadata": "0.2.2",
|
||||||
"rimraf": "3.0.2",
|
"rimraf": "5.0.7",
|
||||||
"safe-buffer": "5.2.1",
|
"safe-buffer": "5.2.1",
|
||||||
"scanf": "1.1.2",
|
"scanf": "1.2.0",
|
||||||
"sequelize": "6.28.2",
|
"sequelize": "6.28.2",
|
||||||
"sequelize-cli": "6.6.0",
|
"sequelize-cli": "6.6.0",
|
||||||
"sequelize-typescript": "2.1.5",
|
"sequelize-typescript": "2.1.5",
|
||||||
"sharp": "0.33.4",
|
"sharp": "0.33.4",
|
||||||
"simple-git": "3.16.0",
|
"simple-git": "3.24.0",
|
||||||
"speakingurl": "14.0.1",
|
"speakingurl": "14.0.1",
|
||||||
"ssr-for-bots": "1.0.1-c",
|
"ssr-for-bots": "1.0.1-c",
|
||||||
"strict-password-generator": "1.1.2",
|
"strict-password-generator": "1.1.2",
|
||||||
"swagger-client": "3.18.5",
|
"swagger-client": "3.28.1",
|
||||||
"swagger-ui-dist": "^5.11.0",
|
"swagger-ui-dist": "5.17.12",
|
||||||
"tabulator-tables": "5.4.2",
|
"tabulator-tables": "6.2.1",
|
||||||
"tedious": "15.1.2",
|
"tedious": "18.2.0",
|
||||||
"textract": "2.5.0",
|
"textract": "2.5.0",
|
||||||
"twilio": "^4.23.0",
|
"twilio": "5.1.0",
|
||||||
"twitter-api-v2": "1.12.9",
|
"twitter-api-v2": "1.17.0",
|
||||||
"typescript": "4.9.5",
|
"typescript": "5.4.5",
|
||||||
"url-join": "5.0.0",
|
"url-join": "5.0.0",
|
||||||
"vhost": "3.0.2",
|
"vhost": "3.0.2",
|
||||||
"vm2": "3.9.11",
|
"vm2": "3.9.11",
|
||||||
"vm2-process": "2.1.1",
|
"vm2-process": "2.1.5",
|
||||||
"walk-promise": "0.2.0",
|
"walk-promise": "0.2.0",
|
||||||
"washyourmouthoutwithsoap": "1.0.2",
|
"washyourmouthoutwithsoap": "1.0.2",
|
||||||
"whatsapp-cloud-api": "0.3.1",
|
"whatsapp-cloud-api": "0.3.1",
|
||||||
"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7",
|
"whatsapp-web.js": "https://github.com/Julzk/whatsapp-web.js/tarball/jkr_hotfix_7",
|
||||||
"winston": "3.8.2",
|
"winston": "3.13.0",
|
||||||
"ws": "8.14.2",
|
"ws": "8.17.0",
|
||||||
"yaml": "2.4.2",
|
"yaml": "2.4.2",
|
||||||
"yarn": "1.22.19",
|
"yarn": "1.22.22",
|
||||||
"zod-to-json-schema": "^3.22.4"
|
"zod-to-json-schema": "3.23.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/qrcode": "1.5.0",
|
"@types/qrcode": "1.5.5",
|
||||||
"@types/url-join": "4.0.1",
|
"@types/url-join": "4.0.3",
|
||||||
"ban-sensitive-files": "1.9.18",
|
"@typescript-eslint/eslint-plugin": "7.10.0",
|
||||||
"commitizen": "4.2.2",
|
"@typescript-eslint/parser": "7.10.0",
|
||||||
|
"ban-sensitive-files": "1.10.2",
|
||||||
|
"commitizen": "4.3.0",
|
||||||
"cz-conventional-changelog": "3.3.0",
|
"cz-conventional-changelog": "3.3.0",
|
||||||
"dependency-check": "4.1.0",
|
"dependency-check": "4.1.0",
|
||||||
"git-issues": "1.0.0",
|
"git-issues": "1.3.1",
|
||||||
"license-checker": "25.0.1",
|
"license-checker": "25.0.1",
|
||||||
"prettier-standard": "15.0.1",
|
"prettier-standard": "16.4.1",
|
||||||
"semantic-release": "17.2.4",
|
"semantic-release": "23.1.1",
|
||||||
"simple-commit-message": "4.0.13",
|
"simple-commit-message": "4.1.3",
|
||||||
"super-strong-password-generator": "2.0.2",
|
"super-strong-password-generator": "2.0.2",
|
||||||
"super-strong-password-generator-es": "2.0.2",
|
"super-strong-password-generator-es": "2.0.2",
|
||||||
"travis-deploy-once": "5.0.11",
|
"travis-deploy-once": "5.0.11",
|
||||||
"tslint": "6.1.3",
|
"tslint": "6.1.3",
|
||||||
"vitest": "^1.3.0"
|
"vitest": "1.6.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@img/sharp-linux-arm": "0.33.4",
|
"@img/sharp-linux-arm": "0.33.4",
|
||||||
|
|
|
@ -50,12 +50,12 @@ export function createKoaHttpServer(
|
||||||
getRemoteId: (ctx: Koa.Context) => string,
|
getRemoteId: (ctx: Koa.Context) => string,
|
||||||
opts:{}
|
opts:{}
|
||||||
): SocketServer {
|
): SocketServer {
|
||||||
const { onError, onConnection, middleware } =
|
const { onError, onConnection, middleware } =
|
||||||
createKoaHttpMiddleware(getRemoteId);
|
createKoaHttpMiddleware(getRemoteId);
|
||||||
|
|
||||||
const app = new Koa();
|
const app = new Koa();
|
||||||
app.use(cors({ origin: '*' }));
|
app.use(cors({ origin: '*' }));
|
||||||
app.use(koaBody.koaBody({jsonLimit:'1024mb',textLimit:'1024mb', formLimit:'1024mb',
|
app.use(koaBody.koaBody({jsonLimit:'1024mb',textLimit:'1024mb', formLimit:'1024mb',
|
||||||
multipart: true }));
|
multipart: true }));
|
||||||
app.use(middleware);
|
app.use(middleware);
|
||||||
const server = app.listen(port);
|
const server = app.listen(port);
|
||||||
|
|
|
@ -52,8 +52,6 @@ import _ from 'lodash';
|
||||||
import { pdfToPng, PngPageOutput } from 'pdf-to-png-converter';
|
import { pdfToPng, PngPageOutput } from 'pdf-to-png-converter';
|
||||||
import sharp from 'sharp';
|
import sharp from 'sharp';
|
||||||
import ImageModule from 'open-docxtemplater-image-module';
|
import ImageModule from 'open-docxtemplater-image-module';
|
||||||
import DynamicsWebApi from 'dynamics-web-api';
|
|
||||||
import * as MSAL from '@azure/msal-node';
|
|
||||||
import { GBConversationalService } from '../../core.gbapp/services/GBConversationalService.js';
|
import { GBConversationalService } from '../../core.gbapp/services/GBConversationalService.js';
|
||||||
import { WebAutomationServices } from './WebAutomationServices.js';
|
import { WebAutomationServices } from './WebAutomationServices.js';
|
||||||
import { KeywordsExpressions } from './KeywordsExpressions.js';
|
import { KeywordsExpressions } from './KeywordsExpressions.js';
|
||||||
|
@ -1906,59 +1904,6 @@ export class SystemKeywords {
|
||||||
return text.replace(/\D/gi, '');
|
return text.replace(/\D/gi, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
//Create a CREAT LEAD keyword
|
|
||||||
public async createLead({ pid, templateName, data }) {
|
|
||||||
//OAuth Token Endpoint (from your Azure App Registration)
|
|
||||||
const authorityUrl = 'https://login.microsoftonline.com/<COPY A GUID HERE>';
|
|
||||||
const msalConfig = {
|
|
||||||
auth: {
|
|
||||||
authority: authorityUrl,
|
|
||||||
clientId: process.env.DYNAMICS_CLIENTID,
|
|
||||||
clientSecret: process.env.DYNAMICS_CLIENTSECRET,
|
|
||||||
knownAuthorities: ['login.microsoftonline.com']
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const cca = new MSAL.ConfidentialClientApplication(msalConfig);
|
|
||||||
const serverUrl = ` `;
|
|
||||||
|
|
||||||
//function that acquires a token and passes it to DynamicsWebApi
|
|
||||||
const acquireToken = dynamicsWebApiCallback => {
|
|
||||||
cca
|
|
||||||
.acquireTokenByClientCredential({
|
|
||||||
scopes: [`${serverUrl}/.default`]
|
|
||||||
})
|
|
||||||
.then(response => {
|
|
||||||
//call DynamicsWebApi callback only when a token has been retrieved successfully
|
|
||||||
dynamicsWebApiCallback(response.accessToken);
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
console.log(JSON.stringify(error));
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
//create DynamicsWebApi
|
|
||||||
const dynamicsWebApi = new DynamicsWebApi({
|
|
||||||
webApiUrl: `${serverUrl}/api/data/v9.2/`,
|
|
||||||
onTokenRefresh: acquireToken
|
|
||||||
});
|
|
||||||
//initialize a CRM entity record object
|
|
||||||
var lead = {
|
|
||||||
subject: 'Test WebAPI',
|
|
||||||
firstname: 'Test',
|
|
||||||
lastname: 'WebAPI',
|
|
||||||
jobtitle: 'Title'
|
|
||||||
};
|
|
||||||
//call dynamicsWebApi.create function
|
|
||||||
dynamicsWebApi
|
|
||||||
.create(lead, 'leads')
|
|
||||||
.then(function (id) {
|
|
||||||
//do something with id here
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
//catch error here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Fills a .docx or .pptx with template data.
|
* Fills a .docx or .pptx with template data.
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
import Path from 'path';
|
import Path from 'path';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import child_process from 'child_process';
|
import child_process from 'child_process';
|
||||||
import rimraf from 'rimraf';
|
import { rimraf } from 'rimraf';
|
||||||
import urlJoin from 'url-join';
|
import urlJoin from 'url-join';
|
||||||
import Fs from 'fs';
|
import Fs from 'fs';
|
||||||
import { GBError, GBLog, GBMinInstance, IGBCoreService, IGBDeployer, IGBInstance, IGBPackage } from 'botlib';
|
import { GBError, GBLog, GBMinInstance, IGBCoreService, IGBDeployer, IGBInstance, IGBPackage } from 'botlib';
|
||||||
|
@ -96,7 +96,11 @@ export class GBDeployer implements IGBDeployer {
|
||||||
* use to database like the Indexer (Azure Search).
|
* use to database like the Indexer (Azure Search).
|
||||||
*/
|
*/
|
||||||
public static getConnectionStringFromInstance(instance: IGBInstance) {
|
public static getConnectionStringFromInstance(instance: IGBInstance) {
|
||||||
return `Server=tcp:${GBConfigService.get("STORAGE_SERVER")},1433;Database=${GBConfigService.get("STORAGE_NAME")};User ID=${GBConfigService.get("STORAGE_USERNAME")};Password=${GBConfigService.get("STORAGE_PASSWORD")};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;`;
|
return `Server=tcp:${GBConfigService.get('STORAGE_SERVER')},1433;Database=${GBConfigService.get(
|
||||||
|
'STORAGE_NAME'
|
||||||
|
)};User ID=${GBConfigService.get('STORAGE_USERNAME')};Password=${GBConfigService.get(
|
||||||
|
'STORAGE_PASSWORD'
|
||||||
|
)};Trusted_Connection=False;Encrypt=True;Connection Timeout=30;`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,25 +109,26 @@ export class GBDeployer implements IGBDeployer {
|
||||||
public static async internalGetDriveClient(min: GBMinInstance) {
|
public static async internalGetDriveClient(min: GBMinInstance) {
|
||||||
let token;
|
let token;
|
||||||
|
|
||||||
// Get token as root only if the bot does not have
|
// Get token as root only if the bot does not have
|
||||||
// an custom tenant for retrieving packages.
|
// an custom tenant for retrieving packages.
|
||||||
|
|
||||||
token = await (min.adminService as any)['acquireElevatedToken']
|
token = await (min.adminService as any)['acquireElevatedToken'](
|
||||||
(min.instance.instanceId, min.instance.authenticatorTenant ? false : true);
|
min.instance.instanceId,
|
||||||
|
min.instance.authenticatorTenant ? false : true
|
||||||
|
);
|
||||||
|
|
||||||
const siteId = process.env.STORAGE_SITE_ID;
|
const siteId = process.env.STORAGE_SITE_ID;
|
||||||
const libraryId = process.env.STORAGE_LIBRARY;
|
const libraryId = process.env.STORAGE_LIBRARY;
|
||||||
|
|
||||||
const client = MicrosoftGraph.Client.init({
|
const client = MicrosoftGraph.Client.init({
|
||||||
authProvider: done => {
|
authProvider: done => {
|
||||||
done(null, token);
|
done(null, token);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const baseUrl = `https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}`;
|
const baseUrl = `https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}`;
|
||||||
min['cacheToken'] = { baseUrl, client };
|
min['cacheToken'] = { baseUrl, client };
|
||||||
|
|
||||||
return { baseUrl, client };
|
|
||||||
|
|
||||||
|
return { baseUrl, client };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -233,7 +238,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
instance.marketplacePassword = await service.createApplicationSecret(accessToken, (application as any).id);
|
instance.marketplacePassword = await service.createApplicationSecret(accessToken, (application as any).id);
|
||||||
instance.adminPass = GBAdminService.getRndPassword();
|
instance.adminPass = GBAdminService.getRndPassword();
|
||||||
instance.title = botId;
|
instance.title = botId;
|
||||||
instance.activationCode = instance.botId.substring(0,15);
|
instance.activationCode = instance.botId.substring(0, 15);
|
||||||
instance.state = 'active';
|
instance.state = 'active';
|
||||||
instance.nlpScore = 0.8;
|
instance.nlpScore = 0.8;
|
||||||
instance.searchScore = 0.25;
|
instance.searchScore = 0.25;
|
||||||
|
@ -267,7 +272,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
const username = GBConfigService.get('CLOUD_USERNAME');
|
const username = GBConfigService.get('CLOUD_USERNAME');
|
||||||
const password = GBConfigService.get('CLOUD_PASSWORD');
|
const password = GBConfigService.get('CLOUD_PASSWORD');
|
||||||
const accessToken = await GBAdminService.getADALTokenFromUsername(username, password);
|
const accessToken = await GBAdminService.getADALTokenFromUsername(username, password);
|
||||||
const group = GBConfigService.get('CLOUD_GROUP')??GBConfigService.get('BOT_ID');
|
const group = GBConfigService.get('CLOUD_GROUP') ?? GBConfigService.get('BOT_ID');
|
||||||
const subscriptionId = GBConfigService.get('CLOUD_SUBSCRIPTIONID');
|
const subscriptionId = GBConfigService.get('CLOUD_SUBSCRIPTIONID');
|
||||||
|
|
||||||
// If the bot already exists, just update the endpoint.
|
// If the bot already exists, just update the endpoint.
|
||||||
|
@ -281,7 +286,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
`${publicAddress}/api/messages/${instance.botId}`
|
`${publicAddress}/api/messages/${instance.botId}`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Internally create resources on cloud provider.
|
// Internally create resources on cloud provider.
|
||||||
|
|
||||||
instance = await service.internalDeployBot(
|
instance = await service.internalDeployBot(
|
||||||
|
@ -313,36 +318,36 @@ export class GBDeployer implements IGBDeployer {
|
||||||
|
|
||||||
public async loadOrCreateEmptyVectorStore(min: GBMinInstance): Promise<HNSWLib> {
|
public async loadOrCreateEmptyVectorStore(min: GBMinInstance): Promise<HNSWLib> {
|
||||||
let vectorStore: HNSWLib;
|
let vectorStore: HNSWLib;
|
||||||
|
|
||||||
const azureOpenAIKey = await min.core.getParam(min.instance, 'Azure Open AI Key', null);
|
const azureOpenAIKey = await min.core.getParam(min.instance, 'Azure Open AI Key', null);
|
||||||
const azureOpenAIVersion = await min.core.getParam(min.instance, 'Azure Open AI Version', null);
|
const azureOpenAIVersion = await min.core.getParam(min.instance, 'Azure Open AI Version', null);
|
||||||
const azureOpenAIApiInstanceName = await min.core.getParam(min.instance, 'Azure Open AI Instance', null);
|
const azureOpenAIApiInstanceName = await min.core.getParam(min.instance, 'Azure Open AI Instance', null);
|
||||||
const azureOpenAIEmbeddingModel = await min.core.getParam(min.instance, 'Azure Open AI Embedding Model', null);
|
const azureOpenAIEmbeddingModel = await min.core.getParam(min.instance, 'Azure Open AI Embedding Model', null);
|
||||||
|
|
||||||
let embedding;
|
let embedding;
|
||||||
if (azureOpenAIKey) {
|
if (!azureOpenAIEmbeddingModel) {
|
||||||
embedding = new OpenAIEmbeddings({ maxConcurrency: 5,
|
|
||||||
azureOpenAIApiKey: azureOpenAIKey,
|
return;
|
||||||
azureOpenAIApiDeploymentName: azureOpenAIEmbeddingModel,
|
|
||||||
azureOpenAIApiVersion: azureOpenAIVersion,
|
|
||||||
azureOpenAIApiInstanceName: azureOpenAIApiInstanceName
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
embedding = new OpenAIEmbeddings({ maxConcurrency: 5 })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
embedding = new OpenAIEmbeddings({
|
||||||
|
maxConcurrency: 5,
|
||||||
|
azureOpenAIApiKey: azureOpenAIKey,
|
||||||
|
azureOpenAIApiDeploymentName: azureOpenAIEmbeddingModel,
|
||||||
|
azureOpenAIApiVersion: azureOpenAIVersion,
|
||||||
|
azureOpenAIApiInstanceName: azureOpenAIApiInstanceName
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
vectorStore = await HNSWLib.load(min['vectorStorePath'], embedding);
|
vectorStore = await HNSWLib.load(min['vectorStorePath'], embedding);
|
||||||
} catch {
|
} catch {
|
||||||
vectorStore = new HNSWLib(embedding, {
|
vectorStore = new HNSWLib(embedding, {
|
||||||
space: 'cosine',
|
space: 'cosine',
|
||||||
numDimensions: 1536,
|
numDimensions: 1536
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return vectorStore;
|
return vectorStore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the NLP publishing process on remote service.
|
* Performs the NLP publishing process on remote service.
|
||||||
|
@ -645,12 +650,12 @@ export class GBDeployer implements IGBDeployer {
|
||||||
const connectionName = t.replace(strFind, '');
|
const connectionName = t.replace(strFind, '');
|
||||||
let con = {};
|
let con = {};
|
||||||
con['name'] = connectionName;
|
con['name'] = connectionName;
|
||||||
con['storageServer'] = min.core.getParam<string>(min.instance, `${connectionName} Server`, null),
|
(con['storageServer'] = min.core.getParam<string>(min.instance, `${connectionName} Server`, null)),
|
||||||
con['storageName'] = min.core.getParam<string>(min.instance, `${connectionName} Name`, null),
|
(con['storageName'] = min.core.getParam<string>(min.instance, `${connectionName} Name`, null)),
|
||||||
con['storageUsername'] = min.core.getParam<string>(min.instance, `${connectionName} Username`, null),
|
(con['storageUsername'] = min.core.getParam<string>(min.instance, `${connectionName} Username`, null)),
|
||||||
con['storagePort'] = min.core.getParam<string>(min.instance, `${connectionName} Port`, null),
|
(con['storagePort'] = min.core.getParam<string>(min.instance, `${connectionName} Port`, null)),
|
||||||
con['storagePassword'] = min.core.getParam<string>(min.instance, `${connectionName} Password`, null),
|
(con['storagePassword'] = min.core.getParam<string>(min.instance, `${connectionName} Password`, null)),
|
||||||
con['storageDriver'] = min.core.getParam<string>(min.instance, `${connectionName} Driver`, null)
|
(con['storageDriver'] = min.core.getParam<string>(min.instance, `${connectionName} Driver`, null));
|
||||||
connections.push(con);
|
connections.push(con);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -707,8 +712,8 @@ export class GBDeployer implements IGBDeployer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the package local files from cache.
|
* Removes the package local files from cache.
|
||||||
*/
|
*/
|
||||||
public async cleanupPackage(instance: IGBInstance, packageName: string) {
|
public async cleanupPackage(instance: IGBInstance, packageName: string) {
|
||||||
const path = DialogKeywords.getGBAIPath(instance.botId, null, packageName);
|
const path = DialogKeywords.getGBAIPath(instance.botId, null, packageName);
|
||||||
const localFolder = Path.join('work', path);
|
const localFolder = Path.join('work', path);
|
||||||
|
@ -785,12 +790,10 @@ export class GBDeployer implements IGBDeployer {
|
||||||
* its index based on .gbkb structure.
|
* its index based on .gbkb structure.
|
||||||
*/
|
*/
|
||||||
public async rebuildIndex(instance: IGBInstance, searchSchema: any) {
|
public async rebuildIndex(instance: IGBInstance, searchSchema: any) {
|
||||||
|
const key = instance.searchKey ? instance.searchKey : GBServer.globals.minBoot.instance.searchKey;
|
||||||
const key = instance.searchKey ? instance.searchKey : GBServer.globals.minBoot.instance.searchKey;
|
|
||||||
GBLogEx.info(instance.instanceId, `rebuildIndex running...`);
|
GBLogEx.info(instance.instanceId, `rebuildIndex running...`);
|
||||||
|
|
||||||
if (!key){
|
if (!key) {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const searchIndex = instance.searchIndex ? instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
|
const searchIndex = instance.searchIndex ? instance.searchIndex : GBServer.globals.minBoot.instance.searchIndex;
|
||||||
|
@ -801,12 +804,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
|
|
||||||
// Prepares search.
|
// Prepares search.
|
||||||
|
|
||||||
const search = new AzureSearch(
|
const search = new AzureSearch(key, host, searchIndex, searchIndexer);
|
||||||
key,
|
|
||||||
host,
|
|
||||||
searchIndex,
|
|
||||||
searchIndexer
|
|
||||||
);
|
|
||||||
const connectionString = GBDeployer.getConnectionStringFromInstance(GBServer.globals.minBoot.instance);
|
const connectionString = GBDeployer.getConnectionStringFromInstance(GBServer.globals.minBoot.instance);
|
||||||
const dsName = 'gb';
|
const dsName = 'gb';
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,9 @@ export class GBGPTPackage implements IGBPackage {
|
||||||
public CurrentEngineName = 'guaribas-1.0.0';
|
public CurrentEngineName = 'guaribas-1.0.0';
|
||||||
|
|
||||||
public async loadPackage(core: IGBCoreService, sequelize: Sequelize): Promise<void> {
|
public async loadPackage(core: IGBCoreService, sequelize: Sequelize): Promise<void> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async getDialogs(min: GBMinInstance) {
|
public async getDialogs(min: GBMinInstance) {
|
||||||
GBLog.verbose(`getDialogs called.`);
|
GBLog.verbose(`getDialogs called.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,7 +286,7 @@ export class ChatServices {
|
||||||
let model;
|
let model;
|
||||||
|
|
||||||
const azureOpenAIKey = await min.core.getParam(min.instance, 'Azure Open AI Key', null);
|
const azureOpenAIKey = await min.core.getParam(min.instance, 'Azure Open AI Key', null);
|
||||||
const azureOpenAIGPTModel = await min.core.getParam(min.instance, 'Azure Open GPT Model', null);
|
const azureOpenAIGPTModel = await min.core.getParam(min.instance, 'Azure Open AI GPT Model', null);
|
||||||
const azureOpenAIVersion = await min.core.getParam(min.instance, 'Azure Open AI Version', null);
|
const azureOpenAIVersion = await min.core.getParam(min.instance, 'Azure Open AI Version', null);
|
||||||
const azureOpenAIApiInstanceName = await min.core.getParam(min.instance, 'Azure Open AI Instance', null);
|
const azureOpenAIApiInstanceName = await min.core.getParam(min.instance, 'Azure Open AI Instance', null);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export const Messages = {
|
export const Messages = {
|
||||||
'en-US': {
|
'en-US': {
|
||||||
|
|
||||||
choices: 'Please, select one:'
|
choices: 'Please, select one:'
|
||||||
},
|
},
|
||||||
'pt-BR': {
|
'pt-BR': {
|
||||||
|
|
|
@ -43,10 +43,10 @@ import getSlug from 'speakingurl';
|
||||||
import { GBServer } from '../../../src/app.js';
|
import { GBServer } from '../../../src/app.js';
|
||||||
import { JSONLoader } from 'langchain/document_loaders/fs/json';
|
import { JSONLoader } from 'langchain/document_loaders/fs/json';
|
||||||
import { TextLoader } from 'langchain/document_loaders/fs/text';
|
import { TextLoader } from 'langchain/document_loaders/fs/text';
|
||||||
import { PDFLoader } from 'langchain/document_loaders/fs/pdf';
|
import { PDFLoader } from '@langchain/community/document_loaders/fs/pdf';
|
||||||
import { DocxLoader } from 'langchain/document_loaders/fs/docx';
|
import { DocxLoader } from '@langchain/community/document_loaders/fs/docx';
|
||||||
import { EPubLoader } from 'langchain/document_loaders/fs/epub';
|
import { EPubLoader } from '@langchain/community/document_loaders/fs/epub';
|
||||||
import { CSVLoader } from 'langchain/document_loaders/fs/csv';
|
import { CSVLoader } from '@langchain/community/document_loaders/fs/csv';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import puppeteer, { Page } from 'puppeteer';
|
import puppeteer, { Page } from 'puppeteer';
|
||||||
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
|
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
|
||||||
|
|
|
@ -54,7 +54,7 @@ export class GBSecurityPackage implements IGBPackage {
|
||||||
ProfileDialog.getMobileConfirmDialog(min),
|
ProfileDialog.getMobileConfirmDialog(min),
|
||||||
SMSAuthDialog.getSMSAuthDialog(min)
|
SMSAuthDialog.getSMSAuthDialog(min)
|
||||||
];
|
];
|
||||||
|
|
||||||
if (process.env.ENABLE_AUTH) {
|
if (process.env.ENABLE_AUTH) {
|
||||||
out.push(OAuthDialog.getOAuthDialog(min));
|
out.push(OAuthDialog.getOAuthDialog(min));
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export const Messages = {
|
||||||
authenticated: 'You are now authenticated.',
|
authenticated: 'You are now authenticated.',
|
||||||
not_authorized: 'Wrong verification code. Not authenticated yet. Try again, please.',
|
not_authorized: 'Wrong verification code. Not authenticated yet. Try again, please.',
|
||||||
please_use_code:(code)=> `Please, answer the Bot with the code: ${code}.`
|
please_use_code:(code)=> `Please, answer the Bot with the code: ${code}.`
|
||||||
|
|
||||||
},
|
},
|
||||||
'pt-BR': {
|
'pt-BR': {
|
||||||
whats_name: 'Qual o seu nome?',
|
whats_name: 'Qual o seu nome?',
|
||||||
|
|
|
@ -10,5 +10,5 @@ export interface GBAPI
|
||||||
dialogKeywords: DialogKeywords;
|
dialogKeywords: DialogKeywords;
|
||||||
imageProcessing: ImageProcessingServices;
|
imageProcessing: ImageProcessingServices;
|
||||||
webAutomation: WebAutomationServices;
|
webAutomation: WebAutomationServices;
|
||||||
debuggerService: DebuggerService;
|
debuggerService: DebuggerService;
|
||||||
}
|
}
|
|
@ -106,8 +106,8 @@ export class GBServer {
|
||||||
server.use(bodyParser.json({ limit: '1mb' }));
|
server.use(bodyParser.json({ limit: '1mb' }));
|
||||||
server.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
|
server.use(bodyParser.urlencoded({ limit: '1mb', extended: true }));
|
||||||
server.use(function(req, res, next) {
|
server.use(function(req, res, next) {
|
||||||
for (var key in req.query)
|
for (const key in req.query)
|
||||||
{
|
{
|
||||||
req.query[key.toLowerCase()] = req.query[key];
|
req.query[key.toLowerCase()] = req.query[key];
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { GBUtil} from './util';
|
||||||
import { expect, test } from 'vitest'
|
import { expect, test } from 'vitest'
|
||||||
|
|
||||||
test('Default', () => {
|
test('Default', () => {
|
||||||
|
|
||||||
expect(null).toBe(null);
|
expect(null).toBe(null);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
export class GBUtil {
|
export class GBUtil {
|
||||||
|
|
||||||
public static repeat (chr, count) {
|
public static repeat (chr, count) {
|
||||||
var str = "";
|
let str = "";
|
||||||
for (var x = 0; x < count; x++) { str += chr };
|
for (let x = 0; x < count; x++) { str += chr };
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ export class GBUtil {
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
if (!pad) pad = " ";
|
if (!pad) pad = " ";
|
||||||
var length = width - value.length
|
const length = width - value.length
|
||||||
if (length < 1) return value.substr(0, width);
|
if (length < 1) return value.substr(0, width);
|
||||||
|
|
||||||
return (GBUtil.repeat(pad, length) + value).substr(0, width);
|
return (GBUtil.repeat(pad, length) + value).substr(0, width);
|
||||||
|
@ -58,7 +58,7 @@ export class GBUtil {
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
if (!pad) pad = " ";
|
if (!pad) pad = " ";
|
||||||
var length = width - value.length
|
const length = width - value.length
|
||||||
if (length < 1) value.substr(0, width);
|
if (length < 1) value.substr(0, width);
|
||||||
|
|
||||||
return (value + GBUtil.repeat(pad, length)).substr(0, width);
|
return (value + GBUtil.repeat(pad, length)).substr(0, width);
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"mapRoot": "./dist/",
|
"mapRoot": "./dist/",
|
||||||
"moduleResolution": "Node",
|
"moduleResolution": "Node",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": false,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue