import type { ServiceProvider } from '@sap-ux/axios-extension'; import { ODataVersion } from '@sap-ux/axios-extension'; import { type HostEnvironmentId } from '@sap-ux/fiori-generator-shared'; import { OdataVersion } from '@sap-ux/odata-service-writer'; import type { ListChoiceOptions } from 'inquirer'; import { PromptState } from './prompt-state.js'; import type { ConvertedMetadata } from '@sap-ux/vocabularies-types'; import type { BackendSystem } from '@sap-ux/store'; /** * Determine if the current prompting environment is cli or a hosted extension (app studio or vscode). * * @returns the platform name and technical name */ export declare function getPromptHostEnvironment(): { name: string; technical: HostEnvironmentId; }; /** * Validate xml and parse the odata version from the metadata xml. * * @param metadata a metadata string * @returns the odata version of the specified metadata, along with the converted metadata in case further processing may be required to avoid re-parsing. * Throws an error if the metadata or odata version is invalid. */ export declare function parseOdataVersion(metadata: string): { odataVersion: OdataVersion; convertedMetadata: ConvertedMetadata; }; /** * Convert specified xml string to JSON. * * @param xml - the schema to parse * @returns parsed object representation of passed XML */ export declare function xmlToJson(xml: string): any; /** * Replaces the origin in the metadata URIs with a relative path. * The path will be tested for '/sap/opu/odata/' and if found, the origin will be replaced with './'. * This is to ensure that the SAP internal backend URIs are relative and that other non-SAP URIs are not affected. * * @param metadata a metadata string containing URIs which include origin (protocol, host, port) * @returns the metadata string with URIs replaced with relative paths */ export declare function originToRelative(metadata: string): string; /** * Convert the odata version type from the prompt (odata-service-writer) type to the axios-extension type. * * @param odataVersion The odata version to convert * @returns The converted odata version */ export declare function convertODataVersionType(odataVersion?: OdataVersion): ODataVersion | undefined; /** * Gets the default index for a list of items, used to default list prompts to the first item if only one item is available. * If list is undefined or has more than one, returns undefined which will default to the 'please select' message. * * @param list the list of choices * @returns the default index if only one item is available, otherwise undefined */ export declare function getDefaultChoiceIndex(list: ListChoiceOptions[]): number | undefined; /** * Remove circular dependencies from within the service provider winston logger, causing issues with serialization in Yeoman generators. * * @param serviceProvider - instance of the service provider * @returns the service provider with the circular dependencies removed */ export declare function removeCircularFromServiceProvider(serviceProvider: ServiceProvider): ServiceProvider; /** * Checks if the specified backend systems contain a match for the specified url and client. * * @param backendSystems backend systems to search for a matching key * @param url the url component of the backend system key * @param client the client component of of the backend system key * @returns the backend system if found or undefined */ export declare function isBackendSystemKeyExisting(backendSystems: BackendSystem[], url: string, client?: string): BackendSystem | undefined; /** * Compare 2 string arrays without considering ordering. * * @param array1 * @param array2 */ export declare function areArraysEquivalent(array1: Array | undefined, array2: Array | undefined): boolean; export { PromptState }; //# sourceMappingURL=index.d.ts.map