diff --git a/src/url/build_url_with_filter.ts b/src/url/build_url_with_filter.ts deleted file mode 100644 index 2b624b3..0000000 --- a/src/url/build_url_with_filter.ts +++ /dev/null @@ -1,10 +0,0 @@ -export default function buildUrlWithFilter( - url : string, - filter? : Record -) : string { - if (filter) { - return `${url}/?${Object.entries(filter).map(([key, value]) => `${key}=${value}`).join('&')}` - } - - return url; -} diff --git a/src/url/parse_url_parameters.ts b/src/url/parse_url_parameters.ts deleted file mode 100644 index 6923f9e..0000000 --- a/src/url/parse_url_parameters.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { URLParameters } from './url_parameters.ts'; -import { DNSRecord } from '../record/dns_record.ts' - -export function parseUrlParameters(parameters : URLSearchParams) : URLParameters { - const token = parameters.get('token'); - const zoneId = parameters.get('zoneId'); - const records = parameters.get('records'); - - if (!token) { - throw new Error('Missing parameter: "token"') - } - if (!zoneId) { - throw new Error('Missing parameter: "zoneId"') - } - if (!records) { - throw new Error('Missing parameter: "records"') - } - - return { - token, - zoneId, - records: JSON.parse(records) as DNSRecord[] - } -} diff --git a/src/url/url_parameters.ts b/src/url/url_parameters.ts deleted file mode 100644 index 64794cc..0000000 --- a/src/url/url_parameters.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DNSRecord } from '../record/dns_record.ts'; - -export interface URLParameters { - token : string, - zoneId : string, - records : DNSRecord[] -}