fix(core.gbapp): Just compile what has been changed.
This commit is contained in:
parent
55fdcbb9b5
commit
df6f146fd9
3 changed files with 28 additions and 10 deletions
|
@ -254,8 +254,9 @@ export class GBConversationalService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise<any> {
|
public async sendEvent(min: GBMinInstance, step: GBDialogStep, name: string, value: Object): Promise<any> {
|
||||||
if (step.context.activity.channelId === 'webchat') {
|
if (!this.userMobile(step)) {
|
||||||
GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) : value} to client...`);
|
GBLog.info(`Sending event ${name}:${typeof value === 'object' ? JSON.stringify(value) :
|
||||||
|
value?value:''} to client...`);
|
||||||
const msg = MessageFactory.text('');
|
const msg = MessageFactory.text('');
|
||||||
msg.value = value;
|
msg.value = value;
|
||||||
msg.type = 'event';
|
msg.type = 'event';
|
||||||
|
|
|
@ -500,11 +500,27 @@ export class GBDeployer implements IGBDeployer {
|
||||||
const nextFolder = urlJoin(remotePath, item.name);
|
const nextFolder = urlJoin(remotePath, item.name);
|
||||||
await this.downloadFolder(min, localPath, nextFolder);
|
await this.downloadFolder(min, localPath, nextFolder);
|
||||||
} else {
|
} else {
|
||||||
GBLog.info(`Downloading ${itemPath}...`);
|
let download = false;
|
||||||
const url = item['@microsoft.graph.downloadUrl'];
|
|
||||||
|
if (Fs.existsSync(itemPath)) {
|
||||||
const response = await request({ uri: url, encoding: null });
|
const dt = Fs.statSync(itemPath);
|
||||||
Fs.writeFileSync(itemPath, response, { encoding: null });
|
if (new Date(dt.mtime) < new Date(item.lastModifiedDateTime)) {
|
||||||
|
download = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (download) {
|
||||||
|
GBLog.info(`Downloading ${itemPath}...`);
|
||||||
|
const url = item['@microsoft.graph.downloadUrl'];
|
||||||
|
|
||||||
|
const response = await request({ uri: url, encoding: null });
|
||||||
|
Fs.writeFileSync(itemPath, response, { encoding: null });
|
||||||
|
Fs.utimesSync(itemPath,
|
||||||
|
new Date(), new Date(item.lastModifiedDateTime));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
GBLog.info(`Local is up to date: ${itemPath}...`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -811,7 +827,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
/**
|
/**
|
||||||
* Servers bot storage assets to be used by web, WhatsApp and other channels.
|
* Servers bot storage assets to be used by web, WhatsApp and other channels.
|
||||||
*/
|
*/
|
||||||
public static mountGBKBAssets(packageName: any, botId: string, filename: string) {
|
public static mountGBKBAssets(packageName: any, botId: string, filename: string) {
|
||||||
|
|
||||||
// Servers menu assets.
|
// Servers menu assets.
|
||||||
|
|
||||||
|
@ -833,7 +849,7 @@ export class GBDeployer implements IGBDeployer {
|
||||||
express.static(urlJoin('work', gbaiName, filename, 'videos')));
|
express.static(urlJoin('work', gbaiName, filename, 'videos')));
|
||||||
GBServer.globals.server.use(`/${botId}/cache`,
|
GBServer.globals.server.use(`/${botId}/cache`,
|
||||||
express.static(urlJoin('work', gbaiName, 'cache')));
|
express.static(urlJoin('work', gbaiName, 'cache')));
|
||||||
GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`,
|
GBServer.globals.server.use(`/${gbaiName}/${botId}.gbdata/public`,
|
||||||
express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public')));
|
express.static(urlJoin('work', gbaiName, `${botId}.gbdata`, 'public')));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
return; // Exit here.
|
return; // Exit here.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.chatName.charAt(0) !== '+') {
|
if (message.chatName.charAt(0) !== '+') {
|
||||||
group = message.chatName;
|
group = message.chatName;
|
||||||
|
|
||||||
let botGroupName = this.min.core.getParam<string>(this.min.instance, 'WhatsApp Group Name', null);
|
let botGroupName = this.min.core.getParam<string>(this.min.instance, 'WhatsApp Group Name', null);
|
||||||
|
@ -205,6 +205,7 @@ export class WhatsappDirectLine extends GBService {
|
||||||
botShortcuts.forEach(e2 => {
|
botShortcuts.forEach(e2 => {
|
||||||
if (e1 === e2 && !found) {
|
if (e1 === e2 && !found) {
|
||||||
found = true;
|
found = true;
|
||||||
|
text = text.replace (e2, '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue