feat(SzPlatformClient): Add debug mode functionality to SzPlatformClient and SzEmailConnector
This commit is contained in:
@@ -3,6 +3,7 @@ import { SzSmsConnector } from './email/classes.smsconnector.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export class SzPlatformClient {
|
||||
public debugMode = false;
|
||||
private authorizationString: string;
|
||||
public typedrouter = new plugins.typedrequest.TypedRouter();
|
||||
public typedsocket: plugins.typedsocket.TypedSocket;
|
||||
@@ -19,6 +20,10 @@ export class SzPlatformClient {
|
||||
if (authorizationStringArg) this.authorizationString = authorizationStringArg;
|
||||
if (!this.authorizationString) this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION;
|
||||
if (!this.authorizationString) throw new Error('authorizationString is required');
|
||||
if (authorizationStringArg === 'test') {
|
||||
this.debugMode = true;
|
||||
return;
|
||||
}
|
||||
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user