fix(core): update
This commit is contained in:
26
ts/classes.platformclient.ts
Normal file
26
ts/classes.platformclient.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { SzEmailConnector } from './email/classes.emailconnector.js';
|
||||
import { SzSmsConnector } from './email/classes.smsconnector.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export class SzPlatformClient {
|
||||
private authorizationString: string;
|
||||
public typedrouter = new plugins.typedrequest.TypedRouter();
|
||||
public typedsocket: plugins.typedsocket.TypedSocket;
|
||||
private qenvInstance = new plugins.qenv.Qenv();
|
||||
|
||||
public emailConnector = new SzEmailConnector(this);
|
||||
public smsConnector = new SzSmsConnector(this);
|
||||
|
||||
constructor(authorizationStringArg: string) {
|
||||
this.authorizationString = authorizationStringArg;
|
||||
}
|
||||
|
||||
public async init() {
|
||||
this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress());
|
||||
}
|
||||
|
||||
private async getConnectionAddress() {
|
||||
const connectionAddress = await this.qenvInstance.getEnvVarOnDemand('SERVEZONE_API_DOMAIN');
|
||||
return connectionAddress;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user