UNPKG

@sap/adp-common

Version:
73 lines (72 loc) 2.8 kB
import type { Endpoint } from "@sap-ux/environment-check"; import type { SystemDetails } from "../models"; /** * Service class to manage and retrieve information about system endpoints, * including their names, authentication requirements, and specific details. */ export declare class EndpointsManager { private static instance; private endpoints; /** * Creates an instance of EndpointsManager. */ private constructor(); /** * Creates an instance of EndpointsManager. * * @returns {EndpointsManager} instance of endpoints manager */ static getInstance(): Promise<EndpointsManager>; /** * Fetches endpoints from a predefined source and stores them in the service. * * @returns {Endpoint[]} Array of system endpoints. */ getEndpoints(): Endpoint[]; /** * Fetches endpoint names from a predefined source and stores them in the service. * * @returns {string[]} Array of endpoint names. */ getEndpointNames(): string[]; /** * Checks if there are set endpoints. * * @returns {boolean} true if there are set endpoints otherwise false. */ hasEndpoints(): boolean; /** * Fetches endpoints from a predefined source and stores them in the service. * * @returns {Promise<void>} A promise that resolves when endpoints are fetched and stored. */ private loadEndpoints; /** * Determines whether local system details should be retrieved based on the environment and installation status. * * @returns {boolean} True if the application is running in VS Code native and there are set systems, * indicating that it's appropriate to fetch local system details; otherwise, false. */ shouldGetLocalSystemDetails(): boolean; /** * Retrieves destination info by name. * * @param {string} system - The name of the system to check. * @returns {Endpoint | undefined} The destination info for the specific system. */ getDestinationInfoByName(system: string): Endpoint | undefined; /** * Determines whether a system requires authentication based on the environment of the application. * * @param {string} systemName The name of the system to check. * @returns {boolean} True if the system requires authentication, false otherwise. */ getSystemRequiresAuth(systemName: string): boolean; /** * Retrieves authentication details for a specified system if available. * * @param {string} system - The name or URL of the system to find. * @returns {SystemDetails | undefined} Authentication details if the system is found, undefined otherwise. */ getSystemDetails(system: string): Promise<SystemDetails | undefined>; }