UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

79 lines 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createHealthCheckResource = createHealthCheckResource; exports.createHealthCheckDataResource = createHealthCheckDataResource; exports.createPingResource = createPingResource; exports.createPingDataResource = createPingDataResource; const schemas_1 = require("../schemas"); /** * Creates the healthCheck resource methods * OpenAPI Path: /health-check → healthCheck.* * @description Health check endpoint for Payments service */ 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: schemas_1.HealthCheckResponseSchema, }, undefined); }, }; } /** * Creates the healthCheckData resource methods (data-only versions) */ 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 */ 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: schemas_1.PingResponseSchema, requiresAuth: false, }, undefined); }, }; } /** * Creates the pingData resource methods (data-only versions) */ function createPingDataResource(ping) { return { get: async () => { const response = await ping.get(); return response.data; }, }; } //# sourceMappingURL=health-check.js.map