Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
await apigw.remove({
created: curState.created,
environment: curState.environment,
serviceId: curState.serviceId,
apiList: curState.apiList,
customDomains: curState.customDomains
})
}
}
removeHandlers.push(handler())
}
await Promise.all(removeHandlers)
if (this.state.cns) {
const cns = new Cns(credentials)
for (let i = 0; i < this.state.cns.length; i++) {
await cns.remove({ deleteList: this.state.cns[i].records })
}
}
this.state = {}
}
}
async tryToAddDnsRecord(credentials, customDomains) {
try {
const cns = new Cns(credentials)
for (let i = 0; i < customDomains.length; i++) {
const item = customDomains[i]
if (item.domainPrefix) {
await cns.deploy({
domain: item.subDomain.replace(`${item.domainPrefix}.`, ''),
records: [
{
subDomain: item.domainPrefix,
recordType: 'CNAME',
recordLine: '默认',
value: item.cname,
ttl: 600,
mx: 10,
status: 'enable'
}
]