Skip to content

Commit

Permalink
♻️ Improve type
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenKn committed Jan 8, 2024
1 parent 7da9666 commit e70453c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/cloudflare-client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {ParseResultType, fromUrl, parseDomain} from 'parse-domain';
import Cloudflare from 'cloudflare';

import {Auth, DomainRecordList, Record, RecordData, ZoneData, ZoneMap} from '../types/index.js';
import {DomainRecordList, Record, RecordData, ZoneData, ZoneMap} from '../types/index.js';
import IPUtils from './ip-utils.js';

const ipv4Regex = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/u;
Expand All @@ -13,7 +13,7 @@ export default class CloudflareClient {

private zoneMap: ZoneMap = new Map();

constructor(auth: Auth) {
constructor(auth: Cloudflare.AuthObject) {
this.cloudflare = new Cloudflare(auth);

this.updateZoneMap();
Expand Down
8 changes: 3 additions & 5 deletions src/types/Auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export type Auth = {
email?: string;
key?: string;
token?: string;
};
import Cloudflare from 'cloudflare';

export type Auth = Cloudflare.AuthObject;

0 comments on commit e70453c

Please sign in to comment.