@sap-ux/store
Version:
NPM module for storing persistent data
22 lines • 903 B
JavaScript
import { SystemType } from '../types.js';
/**
* Determines the backend system type based on the authentication type and service keys (defaults to OnPrem).
*
* @param system - the backend system to determine the type for.
* @returns - the system type or undefined if it cannot be determined.
*/
export function getBackendSystemType(system) {
let backendSystemType;
if (system.authenticationType === 'reentranceTicket') {
backendSystemType = SystemType.AbapCloud;
}
else if (system.serviceKeys) {
/** @deprecated Basing the system type on the auth method is no longer supported since service key support removal */
backendSystemType = SystemType.AbapCloud;
}
else if (system.authenticationType === 'basic' || system.username) {
backendSystemType = SystemType.AbapOnPrem;
}
return backendSystemType;
}
//# sourceMappingURL=backend.js.map