new(all): Facebook workplace support.
This commit is contained in:
parent
e9dd4acaf7
commit
43a8fe530f
7 changed files with 39 additions and 18 deletions
|
@ -108,3 +108,11 @@ ALTER TABLE dbo.GuaribasInstance ADD
|
|||
googlePrivateKey nvarchar(4000) NULL,
|
||||
googleProjectId nvarchar(255) NULL
|
||||
GO
|
||||
|
||||
# 2.0.119
|
||||
|
||||
ALTER TABLE dbo.GuaribasInstance ADD
|
||||
facebookWorkplaceVerifyToken nvarchar(255) NULL,
|
||||
facebookWorkplaceAppSecret nvarchar(255) NULL,
|
||||
facebookWorkplaceAccessToken nvarchar(512) NULL
|
||||
GO
|
||||
|
|
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "botserver",
|
||||
"version": "2.0.121",
|
||||
"version": "2.0.126",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -5179,9 +5179,9 @@
|
|||
}
|
||||
},
|
||||
"botlib": {
|
||||
"version": "1.8.3",
|
||||
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.8.3.tgz",
|
||||
"integrity": "sha512-NWVeSgavucALMJ6yZT7ld0v01mL3964+3OLCW8oW2nuFxG4eBEpNztsg5HKJWBKb9nbeNWU70ynstC43kMQ+uw==",
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.9.2.tgz",
|
||||
"integrity": "sha512-um7oVLrh3xHruQu0N6K4FBYHEidhAdCtgG4U6IadYMIt8j2hjeC5d9mwhElXhu/Darx7TWwoV42TNMVWuTuhxw==",
|
||||
"requires": {
|
||||
"async": "3.2.0",
|
||||
"botbuilder": "4.13.5",
|
||||
|
|
|
@ -68,11 +68,11 @@
|
|||
"bluebird": "3.7.2",
|
||||
"body-parser": "1.19.0",
|
||||
"botbuilder": "4.13.5",
|
||||
"botbuilder-adapter-facebook": "^1.0.11",
|
||||
"botbuilder-adapter-facebook": "1.0.11",
|
||||
"botbuilder-ai": "4.13.5",
|
||||
"botbuilder-dialogs": "4.13.5",
|
||||
"botframework-connector": "4.13.5",
|
||||
"botlib": "1.8.3",
|
||||
"botlib": "1.9.2",
|
||||
"cli-spinner": "0.2.10",
|
||||
"core-js": "3.14.0",
|
||||
"dotenv-extended": "2.9.0",
|
||||
|
|
|
@ -246,7 +246,7 @@ export class GBVMService extends GBService {
|
|||
|
||||
code = code.replace(/(\w+)\s*\=\s*get\s(.*)/gi, ($0, $1, $2) => {
|
||||
if ($2.indexOf('http') !== -1) {
|
||||
return `let ${$1} = sys().httpGet (${$2})`;
|
||||
return `let ${$1} = sys().getByHttp (${$2})`;
|
||||
} else {
|
||||
return `let ${$1} = sys().get (${$2})`;
|
||||
}
|
||||
|
|
|
@ -77,11 +77,12 @@ export class SystemKeywords {
|
|||
/**
|
||||
* Retrives the content of a given URL.
|
||||
*/
|
||||
public async getFileContents(url) {
|
||||
public async getFileContents(url, headers) {
|
||||
const options = {
|
||||
url: url,
|
||||
method: 'GET',
|
||||
encoding: 'binary'
|
||||
encoding: 'binary',
|
||||
headers: headers
|
||||
};
|
||||
return await request(options); // TODO: Check this.
|
||||
}
|
||||
|
@ -638,9 +639,10 @@ export class SystemKeywords {
|
|||
* @example user = get "http://server/users/1"
|
||||
*
|
||||
*/
|
||||
public async getByHttp(url: string) {
|
||||
public async getByHttp(url: string, headers: any) {
|
||||
const options = {
|
||||
uri: url
|
||||
uri: url,
|
||||
headers: headers
|
||||
};
|
||||
|
||||
let result = await request.get(options);
|
||||
|
|
|
@ -151,6 +151,15 @@ export class GuaribasInstance extends Model<GuaribasInstance>
|
|||
@Column
|
||||
public googleProjectId: string;
|
||||
|
||||
@Column({ type: DataType.STRING(255) })
|
||||
facebookWorkplaceVerifyToken: string;
|
||||
|
||||
@Column({ type: DataType.STRING(255) })
|
||||
facebookWorkplaceAppSecret: string;
|
||||
|
||||
@Column({ type: DataType.STRING(512) })
|
||||
facebookWorkplaceAccessToken: string;
|
||||
|
||||
@Column
|
||||
public whatsappBotKey: string;
|
||||
|
||||
|
|
|
@ -639,11 +639,11 @@ export class GBMinService {
|
|||
GBServer.globals.minBoot = min;
|
||||
}
|
||||
|
||||
if (process.env.FACEBOOK_VERIFY_TOKEN) {
|
||||
if (min.instance.facebookWorkplaceVerifyToken) {
|
||||
min['fbAdapter'] = new FacebookAdapter({
|
||||
verify_token: process.env.FACEBOOK_VERIFY_TOKEN,
|
||||
app_secret: process.env.FACEBOOK_APP_SECRET,
|
||||
access_token: process.env.FACEBOOK_ACCESS_TOKEN
|
||||
verify_token: min.instance.facebookWorkplaceVerifyToken,
|
||||
app_secret: min.instance.facebookWorkplaceAppSecret,
|
||||
access_token: min.instance.facebookWorkplaceAccessToken
|
||||
});
|
||||
}
|
||||
// TODO: min.appPackages = core.getPackagesByInstanceId(min.instance.instanceId);
|
||||
|
@ -869,6 +869,8 @@ export class GBMinService {
|
|||
user.welcomed = true;
|
||||
GBLog.info(`Auto start (teams) dialog is now being called: ${startDialog} for ${min.instance.botId}...`);
|
||||
await GBVMService.callVM(startDialog.toLowerCase(), min, step, this.deployer);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue