Skip to content

Commit

Permalink
fix(all): Create bot working again.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Jul 19, 2023
1 parent fc28eb9 commit ed74c5b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions packages/admin.gbapp/services/GBAdminService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class GBAdminService implements IGBAdminService {
}

public static async getADALCredentialsFromUsername(username: string, password: string) {

return await msRestAzure.loginWithUsernamePassword(username, password);
}

Expand All @@ -113,14 +113,14 @@ export class GBAdminService implements IGBAdminService {

public static getNumberIdentifier(digits: number = 14): string {

if (digits <= 0) {
throw new Error('Number of digits should be greater than 0.');
}
const min = 10 ** (digits - 1);
const max = 10 ** digits - 1;
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNumber.toString();
if (digits <= 0) {
throw new Error('Number of digits should be greater than 0.');
}

const min = 10 ** (digits - 1);
const max = 10 ** digits - 1;
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNumber.toString();
}

/**
Expand All @@ -140,7 +140,7 @@ export class GBAdminService implements IGBAdminService {
}

public static async undeployPackageCommand(text: string, min: GBMinInstance) {

const packageName = text.split(' ')[1];
const importer = new GBImporter(min.core);
const deployer = new GBDeployer(min.core, importer);
Expand All @@ -162,16 +162,16 @@ export class GBAdminService implements IGBAdminService {
}
await deployer['deployPackage2'](min, user, urlJoin(additionalPath, packageName));
} else {
const folderName = text.split(' ')[2];
const folderName = text.split(' ')[2];
const packageType = Path.extname(folderName).substr(1);
const gbaiPath = DialogKeywords.getGBAIPath(min.instance.botId, packageType, null);
const localFolder = Path.join('work', gbaiPath);

// .gbot packages are handled using storage API, so no download
// of local resources is required.
const gbai = DialogKeywords.getGBAIPath(min.instance.botId);
await deployer ['downloadFolder'](min,
Path.join('work', `${gbai}`),
const gbai = DialogKeywords.getGBAIPath(min.instance.botId);
await deployer['downloadFolder'](min,
Path.join('work', `${gbai}`),
Path.basename(localFolder));
await deployer['deployPackage2'](min, user, localFolder);
}
Expand Down Expand Up @@ -226,7 +226,7 @@ export class GBAdminService implements IGBAdminService {

public async acquireElevatedToken(instanceId: number, root: boolean = false): Promise<string> {

if (root){
if (root) {
const minBoot = GBServer.globals.minBoot;
instanceId = minBoot.instance.instanceId;
}
Expand Down

0 comments on commit ed74c5b

Please sign in to comment.