UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

73 lines 2.14 kB
import { HealthCheckResponseSchema, PingResponseSchema } from '../schemas'; /** * Creates the healthCheck resource methods * OpenAPI Path: /health-check → healthCheck.* * @description Health check endpoint for Payments service */ export function createHealthCheckResource(executeRequest) { return { /** * Comprehensive health check that validates site configuration and triggers seeding jobs * @fullPath api.payments.healthCheck.get * @service payments * @domain system-health * @dataMethod healthCheckData.get * @discoverable true */ 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: async () => { const response = await healthCheck.get(); return response.data; }, }; } /** * Creates the ping resource methods * OpenAPI Path: /api/ping → ping.* * @description Simple availability check endpoint */ export function createPingResource(executeRequest) { return { /** * Simple availability check endpoint * @fullPath api.payments.ping.get * @service payments * @domain system-health * @dataMethod pingData.get * @discoverable true */ get: async () => { return executeRequest({ method: 'GET', path: '/ping', responseSchema: PingResponseSchema, requiresAuth: false, }, undefined); }, }; } /** * Creates the pingData resource methods (data-only versions) */ export function createPingDataResource(ping) { return { get: async () => { const response = await ping.get(); return response.data; }, }; } //# sourceMappingURL=health-check.js.map