UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

76 lines 3.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createPingResource = createPingResource; exports.createPingDataResource = createPingDataResource; const schemas_1 = require("../schemas"); /** * Creates the ping resource methods * OpenAPI Path: /ping → ping.* * @description Ping endpoint for connectivity test */ function createPingResource(executeRequest) { return { /** * Ping the logistics service for basic connectivity testing * * @fullPath api.logistics.ping.get * @service logistics * @domain system-connectivity * @dataMethod pingData.get * @discoverable true * @searchTerms ["ping", "pong", "connectivity", "test", "network", "response", "logistics"] * @relatedEndpoints ["api.logistics.healthCheck.get", "api.logistics.speedship.freight.get", "api.commerce.ping.get"] * @commonPatterns ["Ping test", "Network connectivity", "Service response test", "Basic connectivity check"] * @workflow ["connectivity-testing", "network-diagnostics", "service-verification", "latency-measurement"] * @prerequisites ["Service is running", "Valid authentication token", "x-site-id header", "Network connectivity"] * @nextSteps ["Measure response time", "Verify network stability", "Test full service endpoints"] * @businessRules ["Returns pong response", "Requires standard authentication", "Minimal response format"] * @functionalArea "system-monitoring" * @caching "No caching - real-time connectivity test required" * @performance "Extremely fast response, use for latency testing and connectivity verification" * * @returns Promise<PingResponse> Pong response confirming connectivity * * @example * ```typescript * // Test logistics service connectivity * const response = await client.ping.get(); * console.log(response.data); // "pong" response * console.log(response.status); // HTTP status code * * // Get just the ping response * const pong = await client.pingData.get(); * console.log(pong); // Direct pong string * * // Measure response time * const start = Date.now(); * await client.ping.get(); * const responseTime = Date.now() - start; * console.log(`Logistics service response time: ${responseTime}ms`); * ``` */ get: async () => { return executeRequest({ method: 'GET', path: '/ping', responseSchema: schemas_1.PingResponseSchema, }, undefined); }, }; } /** * Creates the pingData resource methods (data-only versions) */ function createPingDataResource(ping) { return { /** * Get ping response data only * @returns Promise<string> Pong response string */ get: async () => { const response = await ping.get(); return response.data; }, }; } //# sourceMappingURL=ping.js.map