fix(core.gbapp): Clean-up of system code
This commit is contained in:
parent
27dcdfcaa1
commit
9311943998
6 changed files with 19 additions and 22 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "botserver",
|
"name": "botserver",
|
||||||
"version": "1.7.2",
|
"version": "1.7.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -38,10 +38,10 @@
|
||||||
|
|
||||||
import { GBDialogStep, GBLog, GBMinInstance, IGBCoreService, IGBPackage } from 'botlib';
|
import { GBDialogStep, GBLog, GBMinInstance, IGBCoreService, IGBPackage } from 'botlib';
|
||||||
import { Sequelize } from 'sequelize-typescript';
|
import { Sequelize } from 'sequelize-typescript';
|
||||||
|
import { SwitchBotDialog } from './dialogs/SwitchBot';
|
||||||
import { WelcomeDialog } from './dialogs/WelcomeDialog';
|
import { WelcomeDialog } from './dialogs/WelcomeDialog';
|
||||||
import { WhoAmIDialog } from './dialogs/WhoAmIDialog';
|
import { WhoAmIDialog } from './dialogs/WhoAmIDialog';
|
||||||
import { GuaribasChannel, GuaribasException, GuaribasInstance, GuaribasPackage } from './models/GBModel';
|
import { GuaribasChannel, GuaribasException, GuaribasInstance, GuaribasPackage } from './models/GBModel';
|
||||||
import { SwitchBotDialog } from './dialogs/SwitchBot';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Package for core.gbapp.
|
* Package for core.gbapp.
|
||||||
|
|
0
packages/default.gbapp.gbignore/.gitkeep
Normal file
0
packages/default.gbapp.gbignore/.gitkeep
Normal file
|
@ -46,7 +46,6 @@ import { WhatsappDirectLine } from './services/WhatsappDirectLine';
|
||||||
export class GBWhatsappPackage implements IGBPackage {
|
export class GBWhatsappPackage implements IGBPackage {
|
||||||
public sysPackages: IGBPackage[];
|
public sysPackages: IGBPackage[];
|
||||||
|
|
||||||
|
|
||||||
public loadBot(min: GBMinInstance): void {
|
public loadBot(min: GBMinInstance): void {
|
||||||
// Only loads engine if it is defined on services.json.
|
// Only loads engine if it is defined on services.json.
|
||||||
|
|
||||||
|
@ -61,7 +60,6 @@ export class GBWhatsappPackage implements IGBPackage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public getDialogs(min: GBMinInstance) {
|
public getDialogs(min: GBMinInstance) {
|
||||||
GBLog.verbose(`getDialogs called.`);
|
GBLog.verbose(`getDialogs called.`);
|
||||||
}
|
}
|
||||||
|
|
25
src/app.ts
25
src/app.ts
|
@ -39,10 +39,10 @@
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const bodyParser = require('body-parser');
|
const bodyParser = require('body-parser');
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
var mkdirp = require('mkdirp');
|
let mkdirp = require('mkdirp');
|
||||||
var Path = require('path');
|
let Path = require('path');
|
||||||
|
|
||||||
import { GBLog, IGBCoreService, IGBInstance, IGBPackage, GBMinInstance } from 'botlib';
|
import { GBLog, GBMinInstance, IGBCoreService, IGBInstance, IGBPackage } from 'botlib';
|
||||||
import { GBAdminService } from '../packages/admin.gbapp/services/GBAdminService';
|
import { GBAdminService } from '../packages/admin.gbapp/services/GBAdminService';
|
||||||
import { AzureDeployerService } from '../packages/azuredeployer.gbapp/services/AzureDeployerService';
|
import { AzureDeployerService } from '../packages/azuredeployer.gbapp/services/AzureDeployerService';
|
||||||
import { GBConfigService } from '../packages/core.gbapp/services/GBConfigService';
|
import { GBConfigService } from '../packages/core.gbapp/services/GBConfigService';
|
||||||
|
@ -56,14 +56,14 @@ import { GBMinService } from '../packages/core.gbapp/services/GBMinService';
|
||||||
* Global shared server data;
|
* Global shared server data;
|
||||||
*/
|
*/
|
||||||
export class RootData {
|
export class RootData {
|
||||||
public publicAddress: string;
|
public publicAddress: string; // URI for BotServer
|
||||||
public server: any;
|
public server: any; // Express reference
|
||||||
public sysPackages: any[];
|
public sysPackages: any[]; // Loaded system package list
|
||||||
public appPackages: any[];
|
public appPackages: any[]; // Loaded .gbapp package list
|
||||||
minService: GBMinService;
|
public minService: GBMinService; // Minimalist service core
|
||||||
bootInstance: IGBInstance;
|
public bootInstance: IGBInstance; // General Bot Interface Instance
|
||||||
public minInstances: any[];
|
public minInstances: any[]; //
|
||||||
minBoot: GBMinInstance;
|
public minBoot: GBMinInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,8 +116,7 @@ export class GBServer {
|
||||||
const proxy = GBConfigService.get('REVERSE_PROXY');
|
const proxy = GBConfigService.get('REVERSE_PROXY');
|
||||||
if (proxy !== undefined) {
|
if (proxy !== undefined) {
|
||||||
GBServer.globals.publicAddress = proxy;
|
GBServer.globals.publicAddress = proxy;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Ensure that local development proxy is setup.
|
// Ensure that local development proxy is setup.
|
||||||
|
|
||||||
GBLog.info(`Establishing a development local proxy (ngrok)...`);
|
GBLog.info(`Establishing a development local proxy (ngrok)...`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue