@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
66 lines • 2.97 kB
JavaScript
import { HealthCheckResponseSchema } from '../schemas';
/**
* Creates the healthCheck resource methods
* OpenAPI Path: /health-check → healthCheck.*
* @description Health check endpoint for Brand Folder service
*/
export function createHealthCheckResource(executeRequest) {
return {
/**
* Check service health and availability
*
* @fullPath api.brandFolder.healthCheck.get
* @service brand-folder
* @domain system-health
* @dataMethod healthCheckData.get - returns only the health status data without metadata
* @discoverable true
* @searchTerms ["health", "status", "availability", "ping", "check", "brand service", "monitoring"]
* @relatedEndpoints ["api.brandFolder.categories.focus.create", "api.avalara.healthCheck.get", "api.agrWork.healthCheck.get", "api.agrInfo.healthCheck.get", "api.items.healthCheck.get"]
* @commonPatterns ["Health check", "Service status", "Brand service availability", "System monitoring"]
* @workflow ["system-monitoring", "health-checks", "service-discovery", "brand-service-verification"]
* @prerequisites ["Service is running", "Valid authentication token", "x-site-id header"]
* @nextSteps ["Use brand management endpoints if healthy", "Verify brand service connectivity", "Monitor service metrics"]
* @businessRules ["Returns service status and basic info", "Requires standard authentication", "Standard health check format"]
* @functionalArea "system-monitoring"
* @caching "No caching - real-time status required"
* @performance "Fast response, minimal processing, use for brand service monitoring"
*
* @returns Promise<HealthCheckResponse> Service health status
*
* @example
* ```typescript
* // Check if brand service is healthy
* const response = await client.healthCheck.get();
* console.log(response.data); // Health status string
* console.log(response.status); // HTTP status code
*
* // Get just the health status
* const status = await client.healthCheckData.get();
* console.log(status); // Direct string access
* ```
*/
get: async () => {
return executeRequest({
method: 'GET',
path: '/health-check',
responseSchema: HealthCheckResponseSchema,
}, undefined);
},
};
}
/**
* Creates the healthCheckData resource methods (data-only versions)
*/
export function createHealthCheckDataResource(healthCheck) {
return {
/**
* Get health check status data only
* @returns Promise<string> Health status string
*/
get: async () => {
const response = await healthCheck.get();
return response.data;
},
};
}
//# sourceMappingURL=health-check.js.map