import * as plugins from '../plugins.js';
import { Cloudly } from '../index.js';

/**
 * external api manager manages external api requests
 */
export class ExternalApiManager {
  public cloudlyRef: Cloudly;
  public typedRouter = new plugins.typedrequest.TypedRouter();

  constructor(cloudlyRef: Cloudly) {
    this.cloudlyRef = cloudlyRef;
    this.typedRouter.addTypedHandler<plugins.servezoneInterfaces.requests.network.IRequest_Any_Cloudly_GetNetworkNodes>(
      new plugins.typedrequest.TypedHandler('getNetworkNodes', async (requestData) => {
        const networkNodes = [];
        return {
          networkNodes,
        };
      }),
    );
  }
}