0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-10 21:58:23 -05:00

refactor(connector): remove unnecessary assertions

This commit is contained in:
Darcy Ye 2022-08-19 02:35:06 +08:00
parent 7efd30de62
commit d80e3a7ed2
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610
7 changed files with 0 additions and 28 deletions

View file

@ -38,16 +38,12 @@ export default class AliyunDmConnector extends LogtoConnector<AliyunDmConfig> {
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -33,16 +33,12 @@ export default class AliyunSmsConnector extends LogtoConnector<AliyunSmsConfig>
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -34,16 +34,12 @@ export default class MockMailConnector extends LogtoConnector<MockMailConfig> {
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -34,16 +34,12 @@ export default class MockLogtoConnector extends LogtoConnector<MockSmsConfig> {
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -39,16 +39,12 @@ export default class SendGridMailConnector extends LogtoConnector<SendGridMailCo
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -33,16 +33,12 @@ export default class SmtpConnector extends LogtoConnector<SmtpConfig> {
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};

View file

@ -32,16 +32,12 @@ export default class TwilioSmsConnector extends LogtoConnector<TwilioSmsConfig>
const config = await this.getConfig(this.metadata.id);
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};
public sendTestMessage: SendMessageFunction = async ({ to, type, payload }, config) => {
this.validateConfig(config);
assert(this.sendMessageBy, new ConnectorError(ConnectorErrorCodes.NotImplemented));
return this.sendMessageBy({ to, type, payload }, config);
};