import type { AxiosResponse } from 'axios'; import { Axios } from 'axios'; import type { Logger } from '@sap-ux/logger'; import type { ManifestNamespace } from '@sap-ux/project-access'; import type { Service } from '../base/service-provider'; import type { TransportConfig } from './ui5-abap-repository-service'; export type Manifest = ManifestNamespace.SAPJSONSchemaForWebApplicationManifestFile & { [key: string]: unknown; }; /** * Object structure representing a namespace: containing an id (variant id) and a reference (base application id). */ export type NamespaceObject = { /** * variant id */ id: string; /** * base application id */ reference: string; }; /** * Type representing a namespace. It is either a string or an object. */ export type Namespace = NamespaceObject | string; /** * Required configuration to deploy an adaptation project. */ export interface AdaptationConfig extends TransportConfig { /** * Namespace either as string or object */ namespace: Namespace; /** * Optional layer (default: CUSTOMER_BASE) */ layer?: Layer; } /** * Resulting structure after merging an app descriptor variant with the original app descriptor. */ export interface MergedAppDescriptor { name: string; url: string; manifest: Manifest; asyncHints: { libs: { name: string; lazy?: boolean; url?: { url: string; final: boolean; }; }[]; components: { name: string; lazy?: boolean; url?: { url: string; final: boolean; }; }[]; requests?: unknown[]; }; } /** * Structure of the result message. */ export interface Message { severity: 'Success' | 'Warning' | 'Error'; text: string; details?: string[]; id: string; variables?: string[]; } /** * All available adaptation project types from system. */ export declare enum AdaptationProjectType { ON_PREMISE = "onPremise", CLOUD_READY = "cloudReady" } /** * Structure of the system info reponse data. */ export interface SystemInfo { /** * Supported adaptation project types from system. */ adaptationProjectTypes: AdaptationProjectType[]; activeLanguages: Language[]; /** * Inbound objects of the application. * * @since ABAP Platform Cloud 2505 */ inbounds?: Inbound[]; } export interface AdaptationDescriptor { id: string; type?: string; title?: string; contexts?: Record; createdBy?: string; createdAt?: string; changedBy?: string; changedAt?: string; } export interface AdaptationsResponse { adaptations: AdaptationDescriptor[]; } /** * Shape of a single text entry in the top-level `texts` object of a key-user change response. */ export interface TextTranslation { type?: string; values?: Record; } /** * Shape of the `texts` object in the key-user change response, which is a record of text IDs to their translations. */ export type KeyUserTextTranslations = Record; export interface KeyUserChangeContent { content: Record; texts?: KeyUserTextTranslations; } export interface KeyUserDataResponse { contents: KeyUserChangeContent[]; } export interface FlexVersion { versionId: string; isPublished: boolean; title: string; activatedAt: string; activatedBy: string; appdescrChangesHash: string; } export interface FlexVersionsResponse { versions: FlexVersion[]; } interface Language { sap: string; description: string; i18n: string; } export interface InboundContent { semanticObject: string; action: string; hideLauncher: boolean; icon: string; title: string; subTitle: string; indicatorDataSource?: { dataSource: string; path: string; /** * Represents refresh interval */ refresh?: number; [k: string]: unknown; }; deviceTypes?: ManifestNamespace.DeviceType; signature: ManifestNamespace.SignatureDef; } export interface Inbound { metadata: { name: string; deprecated: boolean; }; content: InboundContent; } /** * Technically supported layers, however, in practice only `CUSTOMER_BASE` is used */ type Layer = 'VENDOR' | 'CUSTOMER_BASE'; /** * A class representing the design time adaptation service allowing to deploy adaptation projects to an ABAP system. */ export declare class LayeredRepositoryService extends Axios implements Service { static readonly PATH = "/sap/bc/lrep"; log: Logger; /** * Simple request to fetch a CSRF token required for all writing operations. * * @returns the response */ getCsrfToken(): Promise>; /** * Merge a given app descriptor variant with the stord app descriptor. * * @param appDescriptorVariant zip file containing an app descriptor variant * @param workspacePath value for workspacePath URL parameter * @returns a promise with an object containing merged app descriptors with their id as keys. */ mergeAppDescriptorVariant(appDescriptorVariant: Buffer, workspacePath?: string): Promise<{ [key: string]: MergedAppDescriptor; }>; /** * Check whether a variant with the given namespace already exists. * * @param namespace either as string or as object * @param [layer] optional layer * @returns the Axios response object for further processing */ isExistingVariant(namespace: Namespace, layer?: Layer): Promise; /** * Deploy the given archive either by creating a new folder in the layered repository or updating an existing one. * * @param archive path to a zip archive or archive as buffer containing the adaptation project * @param config adataption project deployment configuration * @returns the Axios response object for futher processing */ deploy(archive: Buffer | string, config: AdaptationConfig): Promise; /** * Undeploy the archive identified by the configuration. * * @param config adaptation project deployment configuration * @returns the Axios response object for further processing */ undeploy(config: AdaptationConfig): Promise; /** * Lists context-based adaptations for the given application. * * @param {string} appId - Technical application id. * @param {string} [version] - Optional version id. If not provided, uses the hardcoded default version. * @returns {Promise} Adaptations sorted by priority. */ listAdaptations(appId: string, version?: string): Promise; /** * Retrieves key user changes for the given component and adaptation id. * * @param {string} componentId - Technical component id. * @param {string} adaptationId - Adaptation identifier (DEFAULT for default). * @returns {Promise} Key user change payload. */ getKeyUserData(componentId: string, adaptationId: string): Promise; /** * Retrieves versions for the given component. * * @param {string} componentId - Technical component id. * @param {number} [limit] - Optional limit for the number of versions to retrieve (default: 2). * @param {string} [language] - Optional language code (default: EN). * @returns {Promise} Flex versions response containing an array of versions. */ getFlexVersions(componentId: string, limit?: number, language?: string): Promise; /** * Get system info. * * @param language language code (default: EN) * @param cloudPackage name * @param appId application id (since ABAP Platform Cloud 2505) * @returns the system info object */ getSystemInfo(language?: string, cloudPackage?: string, appId?: string): Promise; /** * Try parsing the response and log the result. If the parsing fails and an alternative is provided, log it instead. * * @param response axios response from the LREP service * @param alternativeMessage optional alternative message if the response cannot be parsed */ private tryLogResponse; /** * Log a message from the backend. * * @param msg message to be logged */ private logMessage; } export {}; //# sourceMappingURL=lrep-service.d.ts.map