fix (core.gbapp): Download folder on server azure.
This commit is contained in:
		
							parent
							
								
									52d766667a
								
							
						
					
					
						commit
						b76c5ae227
					
				
					 5 changed files with 24 additions and 28 deletions
				
			
		| 
						 | 
					@ -500,6 +500,9 @@ export class GBDeployer implements IGBDeployer {
 | 
				
			||||||
        fs.mkdir(pathBase);
 | 
					        fs.mkdir(pathBase);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      let packagePath = GBUtil.getGBAIPath(min.botId);
 | 
				
			||||||
 | 
					      packagePath = urlJoin(packagePath, remotePath);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      await CollectionUtil.asyncForEach(parts, async item => {
 | 
					      await CollectionUtil.asyncForEach(parts, async item => {
 | 
				
			||||||
        pathBase = packagePath.join(pathBase, item);
 | 
					        pathBase = packagePath.join(pathBase, item);
 | 
				
			||||||
        if (!(await GBUtil.exists(pathBase))) {
 | 
					        if (!(await GBUtil.exists(pathBase))) {
 | 
				
			||||||
| 
						 | 
					@ -508,9 +511,7 @@ export class GBDeployer implements IGBDeployer {
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Retrieves all files in remote folder.
 | 
					      // Retrieves all files in remote folder.
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
      let packagePath = GBUtil.getGBAIPath(min.botId);
 | 
					 | 
				
			||||||
      packagePath = urlJoin(packagePath, remotePath);
 | 
					 | 
				
			||||||
      let url = `${baseUrl}/drive/root:/${packagePath}:/children`;
 | 
					      let url = `${baseUrl}/drive/root:/${packagePath}:/children`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      GBLogEx.info(min, `Downloading: ${url}`);
 | 
					      GBLogEx.info(min, `Downloading: ${url}`);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1015,8 +1015,8 @@ export class GBMinService {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Unifies channel detection.  Unmarshalls group information.
 | 
					    // Unifies channel detection.  Unmarshalls group information.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    req.body.channelId = req.body.from.channelIdEx === 'whatsapp' ? 'omnichannel' : req.body.channelId;
 | 
					    req.body.channelId = req.body?.from.channelIdEx === 'whatsapp' ? 'omnichannel' : req.body.channelId;
 | 
				
			||||||
    req.body.group = req.body.from.group;
 | 
					    req.body.group = req.body?.from.group;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Default activity processing and handler.
 | 
					    // Default activity processing and handler.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,8 +48,7 @@ export const getRouter = (
 | 
				
			||||||
    console.log('Created conversation with conversationId: ' + conversationId);
 | 
					    console.log('Created conversation with conversationId: ' + conversationId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const activity = createConversationUpdateActivity
 | 
					    const activity = createConversationUpdateActivity
 | 
				
			||||||
      (serviceUrl, conversationId, req.query?.userSystemId,
 | 
					      (serviceUrl, conversationId
 | 
				
			||||||
        req.query?.userName, req.query.pid
 | 
					 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
    fetch(botUrl, {
 | 
					    fetch(botUrl, {
 | 
				
			||||||
      method: 'POST',
 | 
					      method: 'POST',
 | 
				
			||||||
| 
						 | 
					@ -334,7 +333,7 @@ const createMessageActivity = (
 | 
				
			||||||
  return obj;
 | 
					  return obj;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const createConversationUpdateActivity = (serviceUrl: string, conversationId: string, userSystemId, userName, pid): IConversationUpdateActivity => {
 | 
					const createConversationUpdateActivity = (serviceUrl: string, conversationId: string): IConversationUpdateActivity => {
 | 
				
			||||||
  const activity: IConversationUpdateActivity = {
 | 
					  const activity: IConversationUpdateActivity = {
 | 
				
			||||||
    type: 'conversationUpdate',
 | 
					    type: 'conversationUpdate',
 | 
				
			||||||
    channelId: 'api',
 | 
					    channelId: 'api',
 | 
				
			||||||
| 
						 | 
					@ -343,9 +342,9 @@ const createConversationUpdateActivity = (serviceUrl: string, conversationId: st
 | 
				
			||||||
    id: uuidv4.v4(),
 | 
					    id: uuidv4.v4(),
 | 
				
			||||||
    membersAdded: [],
 | 
					    membersAdded: [],
 | 
				
			||||||
    membersRemoved: [],
 | 
					    membersRemoved: [],
 | 
				
			||||||
    from: { id: userSystemId, name: userName }
 | 
					    from: {id: "bot", name: "bot"}
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
  activity['pid']  = pid;
 | 
					  
 | 
				
			||||||
  return activity;
 | 
					  return activity;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -168,18 +168,17 @@ class GBUIApp extends React.Component {
 | 
				
			||||||
    let _this_ = this;
 | 
					    let _this_ = this;
 | 
				
			||||||
    window['botchatDebug'] = true;
 | 
					    window['botchatDebug'] = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const line = instanceClient.webchatToken ?
 | 
					    const line = instanceClient.webchatToken
 | 
				
			||||||
    new DirectLine({
 | 
					      ? new DirectLine({
 | 
				
			||||||
      token: instanceClient.webchatToken
 | 
					          token: instanceClient.webchatToken
 | 
				
			||||||
    }):
 | 
					        })
 | 
				
			||||||
    new DirectLine({
 | 
					      : new DirectLine({
 | 
				
			||||||
      domain: instanceClient.domain,
 | 
					          domain: instanceClient.domain,
 | 
				
			||||||
      secret: null,
 | 
					          secret: null,
 | 
				
			||||||
      token: null,
 | 
					          token: null,
 | 
				
			||||||
      webSocket: false // defaults to true
 | 
					          webSocket: false // defaults to true
 | 
				
			||||||
    });   
 | 
					        });
 | 
				
			||||||
    
 | 
					
 | 
				
			||||||
    ;
 | 
					 | 
				
			||||||
    _this_.setState({ line: line });
 | 
					    _this_.setState({ line: line });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    line.connectionStatus$.subscribe(connectionStatus => {
 | 
					    line.connectionStatus$.subscribe(connectionStatus => {
 | 
				
			||||||
| 
						 | 
					@ -322,9 +321,9 @@ class GBUIApp extends React.Component {
 | 
				
			||||||
        gbCss = <GBCss instance={this.state.instanceClient} />;
 | 
					        gbCss = <GBCss instance={this.state.instanceClient} />;
 | 
				
			||||||
        seo = <SEO instance={this.state.instanceClient} />;
 | 
					        seo = <SEO instance={this.state.instanceClient} />;
 | 
				
			||||||
        const token = this.state.instanceClient.speechToken;
 | 
					        const token = this.state.instanceClient.speechToken;
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        document.body.style.setProperty('background-color', this.state.instanceClient.color2, 'important');
 | 
					        document.body.style.setProperty('background-color', this.state.instanceClient.color2, 'important');
 | 
				
			||||||
        
 | 
					
 | 
				
			||||||
        chat = (
 | 
					        chat = (
 | 
				
			||||||
          <ReactWebChat
 | 
					          <ReactWebChat
 | 
				
			||||||
            ref={chat => {
 | 
					            ref={chat => {
 | 
				
			||||||
| 
						 | 
					@ -350,12 +349,10 @@ class GBUIApp extends React.Component {
 | 
				
			||||||
            <SidebarMenu chat={this.chat} instance={this.state.instanceClient} />
 | 
					            <SidebarMenu chat={this.chat} instance={this.state.instanceClient} />
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
      <StaticContent>
 | 
					      <StaticContent>
 | 
				
			||||||
 | 
					 | 
				
			||||||
        {seo}
 | 
					        {seo}
 | 
				
			||||||
        <div>
 | 
					        <div>
 | 
				
			||||||
          {gbCss}
 | 
					          {gbCss}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,8 +35,7 @@ class ChatPane extends React.Component {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  render() {
 | 
					  render() {
 | 
				
			||||||
    return (
 | 
					    return (
 | 
				
			||||||
      <Chat
 | 
					      <Chat        
 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        ref={(chat) => { this.chat = chat; }}
 | 
					        ref={(chat) => { this.chat = chat; }}
 | 
				
			||||||
        botConnection={this.props.botConnection}
 | 
					        botConnection={this.props.botConnection}
 | 
				
			||||||
        user={{ id: "webUser@gb", name: "You" }}
 | 
					        user={{ id: "webUser@gb", name: "You" }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue