BREAKING CHANGE(core): Introduce RecordManager and ConvenientDnsProvider; rename list/get methods for consistent API and deprecate convenience namespace
This commit is contained in:
@@ -20,7 +20,7 @@ export class CloudflareWorker {
|
||||
): Promise<CloudflareWorker> {
|
||||
const newWorker = new CloudflareWorker(workerManager);
|
||||
Object.assign(newWorker, apiObject);
|
||||
await newWorker.getRoutes();
|
||||
await newWorker.listRoutes();
|
||||
return newWorker;
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ export class CloudflareWorker {
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all routes for a worker
|
||||
* Lists all routes for this worker
|
||||
*/
|
||||
public async getRoutes() {
|
||||
public async listRoutes() {
|
||||
try {
|
||||
this.routes = []; // Reset routes before fetching
|
||||
|
||||
@@ -102,7 +102,7 @@ export class CloudflareWorker {
|
||||
*/
|
||||
public async setRoutes(routeArray: IWorkerRouteDefinition[]) {
|
||||
// First get all existing routes to determine what we need to create/update
|
||||
await this.getRoutes();
|
||||
await this.listRoutes();
|
||||
|
||||
for (const newRoute of routeArray) {
|
||||
// Determine whether a route is new, needs an update, or is already up to date
|
||||
@@ -156,7 +156,7 @@ export class CloudflareWorker {
|
||||
}
|
||||
|
||||
// Refresh routes after all changes
|
||||
await this.getRoutes();
|
||||
await this.listRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user