besper-frontend-site-dev-main
Version:
Professional B-esper Frontend Site - Site-wide integration toolkit for full website bot deployment
53 lines (43 loc) • 1.53 kB
JavaScript
// API service utilities for B-esper package
// This file is maintained for backward compatibility
// All new implementations should use centralizedApi.js
import {
getBotOperationsEndpoint,
getBotManagementEndpoint,
getRootApiEndpoint as getCentralizedRootApiEndpoint,
apiCall as centralizedApiCall,
managementApiCall,
operationsApiCall,
} from './centralizedApi.js';
// Legacy endpoint constants for backward compatibility
// Now uses dynamic endpoint from build-time configuration
export const API_ENDPOINTS = {
dev: getBotOperationsEndpoint(),
int: getBotOperationsEndpoint(),
prod: getBotOperationsEndpoint(),
};
export const MANAGEMENT_ENDPOINTS = {
dev: getBotManagementEndpoint(),
int: getBotManagementEndpoint(),
prod: getBotManagementEndpoint(),
};
export const ROOT_API_ENDPOINTS = {
dev: getCentralizedRootApiEndpoint(),
int: getCentralizedRootApiEndpoint(),
prod: getCentralizedRootApiEndpoint(),
};
// Legacy functions for backward compatibility
// Note: environment parameter is kept for API compatibility but ignored
export function getApiEndpoint(_environment) {
return getBotOperationsEndpoint();
}
export function getManagementEndpoint(_environment) {
return getBotManagementEndpoint();
}
export function getRootApiEndpoint(_environment) {
return getCentralizedRootApiEndpoint();
}
// Use the centralized API call function
export const apiCall = centralizedApiCall;
// Export the new specialized API call functions
export { managementApiCall, operationsApiCall };