mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(connector-aliyun-sms): fix config guard, remove unnecessary fields (#1229)
* fix(connector-aliyun-sms): fix config guard, remove unnecessary fields
This commit is contained in:
parent
96f5badc52
commit
4ee775273a
5 changed files with 10 additions and 25 deletions
|
@ -4,28 +4,19 @@
|
|||
"signName": "<sign-name>",
|
||||
"templates": [
|
||||
{
|
||||
"type": 0,
|
||||
"type": 2,
|
||||
"usageType": "SignIn",
|
||||
"code": "<temporary-passcode>",
|
||||
"name": "<sign-in-template-name>",
|
||||
"content": "<sign-in-template-content>",
|
||||
"remark": "<sign-in-template-remark>"
|
||||
"templateCode": "<template-code>"
|
||||
},
|
||||
{
|
||||
"type": 0,
|
||||
"type": 2,
|
||||
"usageType": "Register",
|
||||
"code": "<temporary-passcode>",
|
||||
"name": "<register-template-name>",
|
||||
"content": "<register-template-content>",
|
||||
"remark": "<register-template-remark>"
|
||||
"templateCode": "<template-code>"
|
||||
},
|
||||
{
|
||||
"type": 0,
|
||||
"type": 2,
|
||||
"usageType": "Test",
|
||||
"code": "<temporary-passcode>",
|
||||
"name": "<test-template-name>",
|
||||
"content": "<test-template-content>",
|
||||
"remark": "<test-template-remark>"
|
||||
"templateCode": "<template-code>"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ describe('sendMessage()', () => {
|
|||
AccessKeyId: mockedConnectorConfig.accessKeyId,
|
||||
PhoneNumbers: phoneTest,
|
||||
SignName: mockedConnectorConfig.signName,
|
||||
TemplateCode: 'code',
|
||||
TemplateCode: 'TemplateCode',
|
||||
TemplateParam: `{"code":"${codeTest}"}`,
|
||||
}),
|
||||
mockedConnectorConfig.accessKeySecret
|
||||
|
|
|
@ -43,7 +43,7 @@ export default class AliyunSmsConnector implements SmsConnector {
|
|||
AccessKeyId: accessKeyId,
|
||||
PhoneNumbers: phone,
|
||||
SignName: signName,
|
||||
TemplateCode: template.code,
|
||||
TemplateCode: template.templateCode,
|
||||
TemplateParam: JSON.stringify({ code }),
|
||||
},
|
||||
accessKeySecret
|
||||
|
|
|
@ -6,10 +6,7 @@ export const mockedConnectorConfig = {
|
|||
{
|
||||
type: 2,
|
||||
usageType: 'SignIn',
|
||||
code: 'code',
|
||||
name: 'name',
|
||||
content: 'content',
|
||||
remark: 'remark',
|
||||
templateCode: 'TemplateCode',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
@ -46,10 +46,7 @@ export type PublicParameters = {
|
|||
const templateGuard = z.object({
|
||||
type: z.nativeEnum(SmsTemplateType).default(2),
|
||||
usageType: z.string(),
|
||||
code: z.string(),
|
||||
name: z.string().min(1).max(30),
|
||||
content: z.string().min(1).max(500),
|
||||
remark: z.string(),
|
||||
templateCode: z.string(),
|
||||
});
|
||||
|
||||
export const aliyunSmsConfigGuard = z.object({
|
||||
|
|
Loading…
Reference in a new issue