fix (core.gbapp): Download folder on server azure.

This commit is contained in:
Rodrigo Rodriguez 2024-09-16 18:42:18 -03:00
parent 52d766667a
commit b76c5ae227
5 changed files with 24 additions and 28 deletions

View file

@ -500,6 +500,9 @@ export class GBDeployer implements IGBDeployer {
fs.mkdir(pathBase);
}
let packagePath = GBUtil.getGBAIPath(min.botId);
packagePath = urlJoin(packagePath, remotePath);
await CollectionUtil.asyncForEach(parts, async item => {
pathBase = packagePath.join(pathBase, item);
if (!(await GBUtil.exists(pathBase))) {
@ -508,9 +511,7 @@ export class GBDeployer implements IGBDeployer {
});
// Retrieves all files in remote folder.
let packagePath = GBUtil.getGBAIPath(min.botId);
packagePath = urlJoin(packagePath, remotePath);
let url = `${baseUrl}/drive/root:/${packagePath}:/children`;
GBLogEx.info(min, `Downloading: ${url}`);

View file

@ -1015,8 +1015,8 @@ export class GBMinService {
// Unifies channel detection. Unmarshalls group information.
req.body.channelId = req.body.from.channelIdEx === 'whatsapp' ? 'omnichannel' : req.body.channelId;
req.body.group = req.body.from.group;
req.body.channelId = req.body?.from.channelIdEx === 'whatsapp' ? 'omnichannel' : req.body.channelId;
req.body.group = req.body?.from.group;
// Default activity processing and handler.

View file

@ -48,8 +48,7 @@ export const getRouter = (
console.log('Created conversation with conversationId: ' + conversationId);
const activity = createConversationUpdateActivity
(serviceUrl, conversationId, req.query?.userSystemId,
req.query?.userName, req.query.pid
(serviceUrl, conversationId
);
fetch(botUrl, {
method: 'POST',
@ -334,7 +333,7 @@ const createMessageActivity = (
return obj;
};
const createConversationUpdateActivity = (serviceUrl: string, conversationId: string, userSystemId, userName, pid): IConversationUpdateActivity => {
const createConversationUpdateActivity = (serviceUrl: string, conversationId: string): IConversationUpdateActivity => {
const activity: IConversationUpdateActivity = {
type: 'conversationUpdate',
channelId: 'api',
@ -343,9 +342,9 @@ const createConversationUpdateActivity = (serviceUrl: string, conversationId: st
id: uuidv4.v4(),
membersAdded: [],
membersRemoved: [],
from: { id: userSystemId, name: userName }
from: {id: "bot", name: "bot"}
};
activity['pid'] = pid;
return activity;
};

View file

@ -168,18 +168,17 @@ class GBUIApp extends React.Component {
let _this_ = this;
window['botchatDebug'] = true;
const line = instanceClient.webchatToken ?
new DirectLine({
token: instanceClient.webchatToken
}):
new DirectLine({
domain: instanceClient.domain,
secret: null,
token: null,
webSocket: false // defaults to true
});
;
const line = instanceClient.webchatToken
? new DirectLine({
token: instanceClient.webchatToken
})
: new DirectLine({
domain: instanceClient.domain,
secret: null,
token: null,
webSocket: false // defaults to true
});
_this_.setState({ line: line });
line.connectionStatus$.subscribe(connectionStatus => {
@ -322,9 +321,9 @@ class GBUIApp extends React.Component {
gbCss = <GBCss instance={this.state.instanceClient} />;
seo = <SEO instance={this.state.instanceClient} />;
const token = this.state.instanceClient.speechToken;
document.body.style.setProperty('background-color', this.state.instanceClient.color2, 'important');
chat = (
<ReactWebChat
ref={chat => {
@ -350,12 +349,10 @@ class GBUIApp extends React.Component {
<SidebarMenu chat={this.chat} instance={this.state.instanceClient} />
</div>
);
}
}
return (
<StaticContent>
{seo}
<div>
{gbCss}

View file

@ -35,8 +35,7 @@ class ChatPane extends React.Component {
render() {
return (
<Chat
<Chat
ref={(chat) => { this.chat = chat; }}
botConnection={this.props.botConnection}
user={{ id: "webUser@gb", name: "You" }}