@monkeyscanjump/cloudflare-dyndns
Version:
A robust TypeScript application that automatically updates Cloudflare DNS records when your public IP address changes. Perfect for maintaining consistent domain names for home servers, WireGuard VPN, self-hosted services, or any system with a dynamic IP a
42 lines • 1.57 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloudflareApiConfig = void 0;
/**
* Centralized configuration for Cloudflare API endpoints and version information
* Provides URL builder functions for accessing different Cloudflare resources
*/
exports.CloudflareApiConfig = {
/** Base URL for Cloudflare API including the client path */
baseUrl: 'https://api.cloudflare.com/client',
/** Default API version to use */
version: 'v4',
/**
* API endpoint paths and functions
* Functions construct endpoint paths with required IDs
*/
endpoints: {
/** Get all zones (domains) for the authenticated account */
listZones: '/zones',
/**
* Get all DNS records for a specific zone
* @param zoneId The Cloudflare zone ID
* @returns Formatted endpoint path
*/
listRecords: (zoneId) => `/zones/${zoneId}/dns_records`,
/**
* Get a specific DNS record
* @param zoneId The Cloudflare zone ID
* @param recordId The DNS record ID
* @returns Formatted endpoint path
*/
getRecord: (zoneId, recordId) => `/zones/${zoneId}/dns_records/${recordId}`,
/**
* Update a specific DNS record
* @param zoneId The Cloudflare zone ID
* @param recordId The DNS record ID
* @returns Formatted endpoint path
*/
updateRecord: (zoneId, recordId) => `/zones/${zoneId}/dns_records/${recordId}`
}
};
//# sourceMappingURL=ApiConfig.js.map