fix(basic.gblib): Impersonated SET MAX LINES.

This commit is contained in:
Rodrigo Rodriguez 2022-08-28 18:38:02 -03:00
parent 7e7fb277d7
commit 8f373f3691
5 changed files with 33 additions and 20 deletions

26
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "botserver",
"version": "2.0.161",
"version": "2.0.167",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -284,9 +284,9 @@
}
},
"@azure/cosmos": {
"version": "3.16.4",
"resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.16.4.tgz",
"integrity": "sha512-jRHFQmF0Q5FUEcGXNrdvO2wHwOeBCkB7PpqeyZ8Mg7LP9LH7QQrD3IhUxQqmCMpSFWebdviH8aRXlm2lKyspzQ==",
"version": "3.17.0",
"resolved": "https://registry.npmjs.org/@azure/cosmos/-/cosmos-3.17.0.tgz",
"integrity": "sha512-kW3V00sKNkNN52uZDOS/tzTs76HaOkWrWz89IJWdiRbkPX/cPKNyFSRBvAziOL8qI06wiJAYicCWHyre+fd1Yw==",
"requires": {
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.2.0",
@ -6612,9 +6612,9 @@
}
},
"dayjs": {
"version": "1.11.4",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.4.tgz",
"integrity": "sha512-Zj/lPM5hOvQ1Bf7uAvewDaUcsJoI6JmNqmHhHl3nyumwe0XHwt8sWdOVAPACJzCebL8gQCi+K49w7iKWnGwX9g=="
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
},
"dom-serializer": {
"version": "1.4.1",
@ -7219,9 +7219,9 @@
}
},
"botlib": {
"version": "1.10.8",
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.10.8.tgz",
"integrity": "sha512-a6nZ1iCZz+YNEpzPdjryPXQMr9JPXO/Lay7FV/GIA5dab9zbXyVCsllUwWPKzjo4LcFwMOdr0Trw0yBl10kBaA==",
"version": "1.10.9",
"resolved": "https://registry.npmjs.org/botlib/-/botlib-1.10.9.tgz",
"integrity": "sha512-rLAc9DTGPPdrslQQdpOm2dMVfowrMnnYgbNCJBvN0nUdicAsJ1qr3kVBYvM1DE491jVAT3gw5tc+JJ3eUbXcmw==",
"requires": {
"async": "3.2.2",
"botbuilder": "4.11.0",
@ -8152,9 +8152,9 @@
},
"dependencies": {
"dayjs": {
"version": "1.11.4",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.4.tgz",
"integrity": "sha512-Zj/lPM5hOvQ1Bf7uAvewDaUcsJoI6JmNqmHhHl3nyumwe0XHwt8sWdOVAPACJzCebL8gQCi+K49w7iKWnGwX9g=="
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
}
}
},

View file

@ -80,7 +80,7 @@
"botbuilder-ai": "4.11.0",
"botbuilder-dialogs": "4.11.0",
"botframework-connector": "4.11.0",
"botlib": "1.10.8",
"botlib": "1.10.9",
"c3-chart-maker": "^0.2.8",
"cli-spinner": "0.2.10",
"core-js": "3.14.0",

View file

@ -87,6 +87,11 @@ export class DialogKeywords {
step: GBDialogStep;
/**
* SYSTEM account maxLines, when used with impersonated contexts (eg. running in SET SCHEDULE).
*/
maxLines: number = 2000;
public async getDeployer() {
return this.min.deployService;
}
@ -729,10 +734,15 @@ export class DialogKeywords {
*
*/
public async setMaxLines(step, count) {
const user = await this.min.userProfile.get(step.context, {});
user.basicOptions.maxLines = count;
await this.min.userProfile.set(step.context, user);
this.user = user;
if (step) {
const user = await this.min.userProfile.get(step.context, {});
user.basicOptions.maxLines = count;
await this.min.userProfile.set(step.context, user);
this.user = user;
}
else {
await this.maxLines = count;
}
}

View file

@ -678,12 +678,15 @@ export class SystemKeywords {
// MAX LINES property.
let maxLines = 1000;
let maxLines;
if (this.dk.user && this.dk.user.basicOptions && this.dk.user.basicOptions.maxLines) {
if (this.dk.user.basicOptions.maxLines.toString().toLowerCase() !== "default") {
maxLines = Number.parseInt(this.dk.user.basicOptions.maxLines).valueOf();
}
}
else {
maxLines = this.dk.maxLines;
}
// Choose data sources based on file type (HTML Table, data variable or sheet file)

View file

@ -202,7 +202,7 @@ export class GBDeployer implements IGBDeployer {
/**
* Deploys a new blank bot to the database, cognitive services and other services.
*/
public async deployBlankBot(botId: string, mobile: string = null, email: string = null) {
public async deployBlankBot(botId: string, mobile: string, email: string) {
// Creates a new row on the GuaribasInstance table.