neru-alpha
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -11,2 +11,3 @@ import { IBridge } from './neru.js'; | ||
debug: boolean; | ||
appUrl: string; | ||
assetUrl: string; | ||
@@ -13,0 +14,0 @@ namespace?: string; |
@@ -14,2 +14,3 @@ "use strict"; | ||
this.privateKey = bridge.getEnv('PRIVATE_KEY'); | ||
this.appUrl = `${bridge.getEnv('ENDPOINT_URL_SCHEME')}/${bridge.getEnv('INSTANCE_SERVICE_NAME')}`; | ||
this.debug = this.bridge.getEnv('DEBUG') && this.bridge.getEnv('DEBUG') === 'true'; | ||
@@ -16,0 +17,0 @@ this.assetUrl = 'http://openfaas.euw1.dev.nexmo.cloud/function/vonage-assets?get='; |
@@ -0,1 +1,2 @@ | ||
import { Config } from './config.js'; | ||
import { Session } from './session.js'; | ||
@@ -94,3 +95,3 @@ import { State } from './providers/state.js'; | ||
private jwt; | ||
constructor(bridge: IBridge); | ||
constructor(bridge: IBridge, config: Config); | ||
createSession(): Session; | ||
@@ -100,2 +101,3 @@ private createSessionWithId; | ||
Router(): any; | ||
getAppUrl(): string; | ||
getSessionFromRequest(req: Request): Session; | ||
@@ -102,0 +104,0 @@ getGlobalState(): State; |
@@ -104,5 +104,5 @@ "use strict"; | ||
class Neru { | ||
constructor(bridge) { | ||
constructor(bridge, config) { | ||
this.bridge = bridge; | ||
this.config = new config_js_1.Config(this.bridge); | ||
this.config = config; | ||
this.commandService = new commandService_js_1.CommandService(this.bridge); | ||
@@ -127,2 +127,5 @@ this.jwt = new jwt_js_1.JWT(this.bridge, this.config); | ||
} | ||
getAppUrl() { | ||
return this.config.appUrl; | ||
} | ||
getSessionFromRequest(req) { | ||
@@ -148,3 +151,5 @@ if (req == null) { | ||
exports.Neru = Neru; | ||
exports.neru = new Neru(new bridge_js_1.Bridge()); | ||
const bridge = new bridge_js_1.Bridge(); | ||
const config = new config_js_1.Config(bridge); | ||
exports.neru = new Neru(bridge, config); | ||
//# sourceMappingURL=neru.js.map |
@@ -11,2 +11,3 @@ import { IBridge } from './neru.js'; | ||
debug: boolean; | ||
appUrl: string; | ||
assetUrl: string; | ||
@@ -13,0 +14,0 @@ namespace?: string; |
@@ -11,2 +11,3 @@ var Config = /** @class */ (function () { | ||
this.privateKey = bridge.getEnv('PRIVATE_KEY'); | ||
this.appUrl = "".concat(bridge.getEnv('ENDPOINT_URL_SCHEME'), "/").concat(bridge.getEnv('INSTANCE_SERVICE_NAME')); | ||
this.debug = this.bridge.getEnv('DEBUG') && this.bridge.getEnv('DEBUG') === 'true'; | ||
@@ -13,0 +14,0 @@ this.assetUrl = 'http://openfaas.euw1.dev.nexmo.cloud/function/vonage-assets?get='; |
@@ -0,1 +1,2 @@ | ||
import { Config } from './config.js'; | ||
import { Session } from './session.js'; | ||
@@ -94,3 +95,3 @@ import { State } from './providers/state.js'; | ||
private jwt; | ||
constructor(bridge: IBridge); | ||
constructor(bridge: IBridge, config: Config); | ||
createSession(): Session; | ||
@@ -100,2 +101,3 @@ private createSessionWithId; | ||
Router(): any; | ||
getAppUrl(): string; | ||
getSessionFromRequest(req: Request): Session; | ||
@@ -102,0 +104,0 @@ getGlobalState(): State; |
@@ -107,5 +107,5 @@ import { Config } from './config.js'; | ||
var Neru = /** @class */ (function () { | ||
function Neru(bridge) { | ||
function Neru(bridge, config) { | ||
this.bridge = bridge; | ||
this.config = new Config(this.bridge); | ||
this.config = config; | ||
this.commandService = new CommandService(this.bridge); | ||
@@ -130,2 +130,5 @@ this.jwt = new JWT(this.bridge, this.config); | ||
}; | ||
Neru.prototype.getAppUrl = function () { | ||
return this.config.appUrl; | ||
}; | ||
Neru.prototype.getSessionFromRequest = function (req) { | ||
@@ -152,3 +155,5 @@ if (req == null) { | ||
export { Neru }; | ||
export var neru = new Neru(new Bridge()); | ||
var bridge = new Bridge(); | ||
var config = new Config(bridge); | ||
export var neru = new Neru(bridge, config); | ||
//# sourceMappingURL=neru.js.map |
{ | ||
"name": "neru-alpha", | ||
"type": "module", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "dist/cjs/neru.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
373236
5467
0