diff --git a/packages/basic.gblib/services/DialogKeywords.ts b/packages/basic.gblib/services/DialogKeywords.ts index e5acba7c..7ac0a574 100644 --- a/packages/basic.gblib/services/DialogKeywords.ts +++ b/packages/basic.gblib/services/DialogKeywords.ts @@ -783,7 +783,7 @@ export class DialogKeywords { let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min); const botId = min.instance.botId; - const path = urljoin(`${botId}.gbai`, `${botId}.gbdata`); + const path = DialogKeywords.getGBDataPath(botId); let url = `${baseUrl}/drive/root:/${path}:/children`; GBLog.info(`Loading HEAR AS .xlsx options from Sheet: ${url}`); @@ -1028,6 +1028,12 @@ export class DialogKeywords { GBLog.error(`BASIC RUNTIME ERR HEAR ${error.message ? error.message : error}\n Stack:${error.stack}`); } } + static getGBDataPath(botId) { + + return GBConfigService.get('GBDIALOG_GBDATABOT')? + GBConfigService.get('GBDIALOG_GBDATABOT'): + urljoin(`${botId}.gbai`, `${botId}.gbdata`); + } /** * Prepares the next dialog to be shown to the specified user. diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index 39cd3bdc..7b01c2c5 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -489,7 +489,7 @@ export class SystemKeywords { let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min); const botId = min.instance.botId; - const path = `/${botId}.gbai/${botId}.gbdata`; + const path = DialogKeywords.getGBDataPath(botId); address = address.indexOf(':') !== -1 ? address : address + ':' + address; @@ -569,7 +569,7 @@ export class SystemKeywords { GBLog.info(`BASIC: Saving '${file}' (SAVE). Args: ${args.join(',')}.`); let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min); const botId = min.instance.botId; - const path = `/${botId}.gbai/${botId}.gbdata`; + const path = DialogKeywords.getGBDataPath(botId); let document = await this.internalGetDocument(client, baseUrl, path, file); let sheets = await client.api(`${baseUrl}/drive/items/${document.id}/workbook/worksheets`).get(); @@ -623,7 +623,7 @@ export class SystemKeywords { GBLog.info(`BASIC: GET '${addressOrHeaders}' in '${file}'.`); let { baseUrl, client } = await GBDeployer.internalGetDriveClient(min); const botId = min.instance.botId; - const path = `/${botId}.gbai/${botId}.gbdata`; + const path = DialogKeywords.getGBDataPath(botId); let document = await this.internalGetDocument(client, baseUrl, path, file); @@ -695,7 +695,7 @@ export class SystemKeywords { args.shift(); const botId = min.instance.botId; - const path = `/${botId}.gbai/${botId}.gbdata`; + const path = DialogKeywords.getGBDataPath(botId); // MAX LINES property. @@ -1188,9 +1188,9 @@ export class SystemKeywords { // Determines full path at source and destination. - const root = urlJoin(`/${botId}.gbai/${botId}.gbdata`); + const root = DialogKeywords.getGBDataPath(botId); const srcPath = urlJoin(root, src); - const dstPath = urlJoin(`/${botId}.gbai/${botId}.gbdata`, dest); + const dstPath = urlJoin(root, dest); // Checks if the destination contains subfolders that // need to be created. @@ -1599,7 +1599,7 @@ export class SystemKeywords { const { min, user, params } = await DialogKeywords.getProcessInfo(pid); const botId = min.instance.botId; - const path = `/${botId}.gbai/${botId}.gbdata`; + const path = DialogKeywords.getGBDataPath(botId); // MAX LINES property. diff --git a/packages/core.gbapp/services/GBDeployer.ts b/packages/core.gbapp/services/GBDeployer.ts index 42506cc7..972d2e41 100644 --- a/packages/core.gbapp/services/GBDeployer.ts +++ b/packages/core.gbapp/services/GBDeployer.ts @@ -845,7 +845,7 @@ export class GBDeployer implements IGBDeployer { ); GBServer.globals.server.use(`/${botId}/cache`, express.static(urlJoin('work', gbaiName, 'cache'))); GBServer.globals.server.use( - `/${gbaiName}/${botId}.gbdata/public`, + `/${gbaiName}/${botId}.gbdrive/public`, express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public')) );