diff --git a/boot.mjs b/boot.mjs index 7de03978..14e77d9b 100644 --- a/boot.mjs +++ b/boot.mjs @@ -9,16 +9,15 @@ import pjson from './package.json' assert { type: 'json' }; console.log(``); console.log(``); -console.log(` █████ █████ ██ █ █████ █████ ████ ██ ████ █████ █████ ███ ® `); -console.log(`██ █ ███ █ █ ██ ██ ██ ██ ██ ██ █ ██ ██ █ █ `); -console.log(`██ ███ ████ █ ██ █ ████ █████ ██████ ██ ████ █ █ █ ██ `); -console.log(`██ ██ █ █ ██ █ █ ██ ██ ██ ██ ██ ██ █ ██ ██ █ █ `); -console.log(` █████ █████ █ ███ █████ ██ ██ ██ ██ ██████ ████ █████ █ ███ 3.1`); -process.stdout.write(` botserver@${pjson.version}, botlib@${pjson.dependencies.botlib}, botbuilder@${pjson.dependencies.botbuilder}, node@${process.version.replace('v', '')}, ${process.platform} ${process.arch} `); - -var now = () => { - return new Date().toISOString().replace(/T/, ' ').replace(/\..+/, '') + ' UTC'; -}; +console.log(``); +console.log(``); +console.log(``); +console.log(`General Bots Open-core Server 3.1 is initializing...`); +console.log(`Visit: https://github.com/generalbots.`); +console.log(``); +process.stdout.write(`Enviroment: botserver@${pjson.version}, botlib@${pjson.dependencies.botlib}, botbuilder@${pjson.dependencies.botbuilder}, node@${process.version.replace('v', '')}, ${process.platform} ${process.arch} `); +console.log(``); +console.log(``); var __dirname = process.env.PWD || process.cwd(); try { var run = () => { diff --git a/packages/core.gbapp/services/GBCoreService.ts b/packages/core.gbapp/services/GBCoreService.ts index 040cff54..bf4f52c2 100644 --- a/packages/core.gbapp/services/GBCoreService.ts +++ b/packages/core.gbapp/services/GBCoreService.ts @@ -60,6 +60,7 @@ import open from 'open'; import ngrok from 'ngrok'; import Path from 'path'; import { file } from 'googleapis/build/src/apis/file/index.js'; +import { GBUtil } from '../../../src/util.js'; /** * GBCoreService contains main logic for handling storage services related @@ -675,26 +676,32 @@ ENDPOINT_UPDATE=true */ public getParam(instance: IGBInstance, name: string, defaultValue?: T): any { let value = null; + let params; + name = name.trim(); + if (instance.params) { - const params = typeof (instance.params) === 'object' ? instance.params: JSON.parse(instance.params); + params = typeof (instance.params) === 'object' ? instance.params: JSON.parse(instance.params); + params = GBUtil.caseInsensitive(params); value = params ? params[name] : defaultValue; } - if (typeof defaultValue === 'boolean') { + if (value && typeof defaultValue === 'boolean') { return new Boolean(value ? value.toString().toLowerCase() === 'true' : defaultValue).valueOf(); } - if (typeof defaultValue === 'string') { + if (value && typeof defaultValue === 'string') { return value ? value : defaultValue; } - if (typeof defaultValue === 'number') { + if (value && typeof defaultValue === 'number') { return new Number(value ? value : defaultValue ? defaultValue : 0).valueOf(); } - if (instance['dataValues'] && !value) { + params = GBUtil.caseInsensitive(instance['dataValues']); + if (params && !value) { value = instance['dataValues'][name]; if (value === null) { const minBoot = GBServer.globals.minBoot as any; - value = minBoot.instance[name]; + params = GBUtil.caseInsensitive(minBoot.instance); + value = params[name]; } } if (value === undefined) {