diff --git a/DATABASE-CHANGES.md b/DATABASE-CHANGES.md index 4a8eef93..55108766 100644 --- a/DATABASE-CHANGES.md +++ b/DATABASE-CHANGES.md @@ -73,3 +73,10 @@ ALTER TABLE dbo.GuaribasConversation ADD instanceId int, feedback nvarchar(512) NULL GO + + +ALTER TABLE [dbo].[GuaribasInstance] DROP COLUMN [translatorendpoint] +GO +ALTER TABLE dbo.GuaribasInstance ADD + translatorEndpoint nvarchar(128) NULL +GO diff --git a/packages/admin.gbapp/services/GBAdminService.ts b/packages/admin.gbapp/services/GBAdminService.ts index 20da41ef..a429b77d 100644 --- a/packages/admin.gbapp/services/GBAdminService.ts +++ b/packages/admin.gbapp/services/GBAdminService.ts @@ -261,6 +261,7 @@ export class GBAdminService implements IGBAdminService { const refreshToken = await this.getValue(instanceId, 'refreshToken'); const resource = 'https://graph.microsoft.com'; const authenticationContext = new AuthenticationContext(authorizationUrl); + authenticationContext.acquireTokenWithRefreshToken( refreshToken, instance.marketplaceId, diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index f23fecb6..d3efe8b1 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -81,7 +81,7 @@ export class SystemKeywords { } }); const baseUrl = `https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}`; - return [client, baseUrl]; + return [baseUrl, client]; } /** @@ -259,6 +259,7 @@ export class SystemKeywords { let document = await this.internalGetDocument(client, baseUrl, path, file); // Creates workbook session that will be discarded. + let sheets = await client .api(`${baseUrl}/drive/items/${document.id}/workbook/worksheets`) .get(); diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index adb9279f..f179d1a6 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -371,9 +371,9 @@ export class GBDeployer implements IGBDeployer { const libraryId = process.env.STORAGE_LIBRARY; GBLog.info(`Connecting to Config.xslx (siteId: ${siteId}, libraryId: ${libraryId})...`); - + // Connects to MSFT storage. - + const token = await min.adminService.acquireElevatedToken(min.instance.instanceId); const client = MicrosoftGraph.Client.init({ authProvider: done => { @@ -381,19 +381,19 @@ export class GBDeployer implements IGBDeployer { } }); - - // Retrives all files in .bot folder. + // Retrieves all files in .bot folder. const botId = min.instance.botId; const path = `/${botId}.gbai/${botId}.gbot`; - GBLog.info(`Loading .gbot from ${path}.`); + let url = `https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/root:${path}:/children`; + GBLog.info(`Loading .gbot from Excel: ${url}`); const res = await client - .api(`https://graph.microsoft.com/v1.0/sites/${siteId}/lists/${libraryId}/drive/root:${path}:/children`) - .get(); - + .api(url) + .get(); + // Finds Config.xlsx. - + const document = res.value.filter(m => { return m.name === 'Config.xlsx'; });