import { type AxiosResponse, type AxiosRequestConfig } from 'axios'; import { ODataService } from '../base/odata-service.js'; /** * Required configuration a transportable object. */ export interface TransportConfig { /** * Optional package for the ABAP development object */ package?: string; /** * Optional transport request to record the changes */ transport?: string; } /** * Required configuration for the BSP hosting an app. */ export interface BspConfig extends TransportConfig { /** * Name of the BSP, additionally, the last part of the exposed service path */ name: string; /** * Optional description of the ABAP development object representing the BSP */ description?: string; } /** * Configuration required for deploying an app. */ export interface DeployConfig { /** * archive zip archive containing the application files as buffer */ archive: Buffer; /** * app application configuration */ bsp: BspConfig; /** * if set to true, all requests will be sent, the service checks them, but no actual deployment will happen */ testMode?: boolean; /** * if set then the SafeMode url parameter will be set. SafeMode is by default active, to deactivate provide false */ safeMode?: boolean; } /** * Configuration required for undeploying an app. */ export interface UndeployConfig { bsp: Pick; testMode?: DeployConfig['testMode']; } /** * Application information object returned by the UI5 Repository service */ export interface AppInfo { Name: string; Package: string; Description?: string; Info?: string; ZipArchive?: string; } export declare const abapUrlReplaceMap: Map; /** * Extension of the generic OData client simplifying the consumption of the UI5 repository service */ export declare class Ui5AbapRepositoryService extends ODataService { static readonly PATH = "/sap/opu/odata/UI5/ABAP_REPOSITORY_SRV"; private readonly publicUrl; private readonly isDest; /** * Extension of the base constructor to set preferred response format if not provided by caller. * * @param config optional base configuration for Axios appended with optional fields */ constructor(config?: AxiosRequestConfig & { publicUrl?: string; }); /** * Get information about a deployed application. Returns undefined if the application cannot be found. * * @param app application id (BSP application name) * @returns application information or undefined */ getInfo(app: string): Promise; /** * * @param str string to check * @returns true if the string is base64 encoded, false otherwise */ private isBase64Encoded; /** * Get the application files as zip archive. This will only work on ABAP systems 2308 or newer. * * @param app application id (BSP application name) * @returns undefined if no app is found or downloading files is not supported, otherwise return the application files as a buffer. */ downloadFiles(app: string): Promise; /** * Deploy the given archive either by creating a new BSP or updating an existing one. * * @param config deployment config * @param config.archive zip archive containing the application files as buffer * @param config.bsp BSP configuration * @param config.testMode if set to true, all requests will be sent, the service checks them, but no actual deployment will happen * @param config.safeMode if set then the SafeMode url parameter will be set. SafeMode is by default active, to activate provide false * @returns the Axios response object for further processing */ deploy({ archive, bsp, testMode, safeMode }: DeployConfig): Promise; /** * Undeploy an existing app. * * @param config undeploy config * @param config.bsp BSP configuration * @param config.testMode if set to true, all requests will be sent, the service checks them, but no actual deployment will happen * @returns the Axios response object for further processing or undefined if no request is sent */ undeploy({ bsp, testMode }: UndeployConfig): Promise; /** * Translate the technical ABAP on BTP URL to the frontend URL. * * @returns url to be used in the browser. */ protected getAbapFrontendUrl(): string; /** * Internal helper method to generate a request configuration (headers, parameters). * * @param transport optional transport request id * @param testMode optional url parameter to enable test mode * @param safeMode optional url parameter to disable the safe model (safemode=false) * @returns the Axios response object for further processing */ protected createConfig(transport?: string, testMode?: boolean, safeMode?: boolean): AxiosRequestConfig; /** * Create the request payload for a deploy request. * * @param archive archive as buffer * @param name application name * @param description description for the deployed app * @param abapPackage ABAP package containing the app * @returns XML based request payload */ protected createPayload(archive: Buffer, name: string, description: string, abapPackage: string): string; /** * Send a request to the backed to create or update an application. * * @param isExisting app has already been deployed * @param appName application name * @param payload request payload * @param config additional request config * @param tryCount number of attempted deploys (sometimes a repo request fails with a known timeout issue, so we retry) * @returns the Axios response object for further processing */ protected updateRepoRequest(isExisting: boolean, appName: string, payload: string, config: AxiosRequestConfig, tryCount?: number): Promise; /** * Send a request to the backend to delete an application. * * @param appName application name * @param config additional request config * @param tryCount number of attempted deploys (sometimes a repo request fails with a known timeout issue, so we retry) * @returns the Axios response object for further processing */ protected deleteRepoRequest(appName: string, config: AxiosRequestConfig, tryCount?: number): Promise; } //# sourceMappingURL=ui5-abap-repository-service.d.ts.map