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:
parent
7efd30de62
commit
d80e3a7ed2
7 changed files with 0 additions and 28 deletions
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue