diff --git a/src/api/list_dns_records_option.ts b/src/api/api_request_options.ts similarity index 84% rename from src/api/list_dns_records_option.ts rename to src/api/api_request_options.ts index 1fa63fb..e5d46a3 100644 --- a/src/api/list_dns_records_option.ts +++ b/src/api/api_request_options.ts @@ -1,7 +1,7 @@ /** * This interface represents options for the API fetch. */ -export interface ListDnsRecordsOption { +export interface ApiRequestOptions { /** API URL endpoint. */ apiEndpoint : string, /** Token to access the API. */ diff --git a/src/api/list_dns_records.ts b/src/api/list_dns_records.ts index 82e75a6..9be3029 100644 --- a/src/api/list_dns_records.ts +++ b/src/api/list_dns_records.ts @@ -2,7 +2,7 @@ import ApiRequestError from '../error/api_request_error.ts'; import FetchRequestError from '../error/fetch_request_error.ts'; import { DnsRecord } from '../record/dns_record.ts'; import supportedDnsRecordTypes from '../record/dns_record_type.ts'; -import { ListDnsRecordsOption } from './list_dns_records_option.ts'; +import { ApiRequestOptions } from './api_request_options.ts'; /** * This function gets all DNS records, filtered by the DNS record types. @@ -10,7 +10,7 @@ import { ListDnsRecordsOption } from './list_dns_records_option.ts'; * @param options Options for the API fetch * @returns List of all DNS records found. */ -export default function listDnsRecordsFromApi(options: ListDnsRecordsOption) : Promise { +export default function listDnsRecordsFromApi(options: ApiRequestOptions) : Promise { return fetch( `${options.apiEndpoint}zones/${options.zoneId}/dns_records?type=${supportedDnsRecordTypes.join(',')}`, { diff --git a/src/api/update_dns_record.ts b/src/api/update_dns_record.ts index 30f6792..ea7c9cf 100644 --- a/src/api/update_dns_record.ts +++ b/src/api/update_dns_record.ts @@ -1,5 +1,6 @@ import { DnsRecord } from '../record/dns_record.ts'; +import { ApiRequestOptions } from './api_request_options.ts'; -export default function updateDnsRecord(record : DnsRecord) { - +export default function updateDnsRecord(record : DnsRecord, options : ApiRequestOptions) : void { + }