UNPKG

@sap/adp-abap

Version:

abap service for all yeoman generators

87 lines (86 loc) 3.16 kB
import type { AbapProvider } from "./AbapProvider"; export declare const S4HANA_APPS_PARAMS: { "sap.app/type": string; "sap.fiori/cloudDevAdaptationStatus": string; fileType: string; fields: string; }; export declare const ABAP_APPS_PARAMS: { fields: string; "sap.ui/technology": string; "sap.app/type": string; fileType: string; }; export declare const ABAP_VARIANT_APPS_PARAMS: { fields: string; "sap.ui/technology": string; "sap.app/type": string; fileType: string; originLayer: string; }; export interface Application { id: string; title: string; ach: string; registrationIds: string[]; fileType: string; bspUrl: string; bspName: string; } interface App extends Record<string, unknown> { "sap.app/id": string; "sap.app/title": string; "sap.fiori/registrationIds": string[]; url: string; } /** * Compares two applications for sorting, using the title and falling back to the ID if titles are missing or equal. * This function ensures that applications are sorted alphabetically by their title or ID in a case-insensitive manner. * * @param {Application} appA - The first application to compare. * @param {Application} appB - The second application to compare. * @returns {number} A number indicating the sort order. */ export declare const filterApps: (appA: Application, appB: Application) => number; /** * Transforms raw application data into a structured Application object. * This function maps properties from a loosely typed app data structure to a strongly typed Application object. * * @param {Partial<App>} app - The raw application data, possibly incomplete. * @returns {Application} A structured application object with defined properties, even if some may be empty. */ export declare const mapApps: (app: Partial<App>) => Application; /** * Provides services related to managing and loading applications from an ABAP provider. */ export declare class ApplicationManager { private provider; private isCustomerBase; private applications; /** * Constructs an instance of ApplicationManager. * * @param {AbapProvider} provider - The ABAP provider service. * @param {boolean} isCustomerBase - Indicates if the current base is a customer base, which affects how applications are loaded. */ constructor(provider: AbapProvider, isCustomerBase: boolean); /** * Clears the stored list of applications. */ resetApps(): void; /** * Retrieves the currently loaded list of applications. * * @returns {Application[]} An array of applications. */ getApps(): Application[]; /** * Loads applications based on system type and user parameters, merging results from different app sources as needed. * * @param {boolean} isCloudSystem - Determines if the system is a cloud system, affecting which parameters to use for app searching. * @returns {Application[]} list of applications. * @throws {Error} Throws an error if the app data cannot be loaded. */ loadApps(isCloudSystem: boolean): Promise<Application[]>; } export {};