fix(ci): Update CI workflows, repository URL, and apply minor code formatting fixes
This commit is contained in:
@@ -22,7 +22,9 @@ export class CloudflareRecord {
|
||||
* @param apiObject Cloudflare DNS record API object
|
||||
* @returns CloudflareRecord instance
|
||||
*/
|
||||
public static createFromApiObject(apiObject: plugins.ICloudflareTypes['Record']): CloudflareRecord {
|
||||
public static createFromApiObject(
|
||||
apiObject: plugins.ICloudflareTypes['Record'],
|
||||
): CloudflareRecord {
|
||||
const record = new CloudflareRecord();
|
||||
Object.assign(record, apiObject);
|
||||
return record;
|
||||
@@ -52,28 +54,28 @@ export class CloudflareRecord {
|
||||
public async update(
|
||||
cloudflareAccount: any,
|
||||
newContent: string,
|
||||
ttl?: number
|
||||
ttl?: number,
|
||||
): Promise<CloudflareRecord> {
|
||||
logger.log('info', `Updating record ${this.name} (${this.type}) with new content`);
|
||||
|
||||
|
||||
const updatedRecord = await cloudflareAccount.apiAccount.dns.records.edit(this.id, {
|
||||
zone_id: this.zone_id,
|
||||
type: this.type as any,
|
||||
name: this.name,
|
||||
content: newContent,
|
||||
ttl: ttl || this.ttl,
|
||||
proxied: this.proxied
|
||||
proxied: this.proxied,
|
||||
});
|
||||
|
||||
|
||||
// Update this instance
|
||||
this.content = newContent;
|
||||
if (ttl) {
|
||||
this.ttl = ttl;
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete this record
|
||||
* @param cloudflareAccount The Cloudflare account to use
|
||||
@@ -82,15 +84,15 @@ export class CloudflareRecord {
|
||||
public async delete(cloudflareAccount: any): Promise<boolean> {
|
||||
try {
|
||||
logger.log('info', `Deleting record ${this.name} (${this.type})`);
|
||||
|
||||
|
||||
await cloudflareAccount.apiAccount.dns.records.delete(this.id, {
|
||||
zone_id: this.zone_id
|
||||
zone_id: this.zone_id,
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
logger.log('error', `Failed to delete record: ${error.message}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user