@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
102 lines • 5.19 kB
TypeScript
import type { SmartyStreetsClient } from '../client';
import type { HealthCheckParams } from '../schemas';
type ExecuteRequest = SmartyStreetsClient['executeRequest'];
/**
* Creates the healthCheck resource methods
* OpenAPI Path: /health-check → healthCheck.*
* @description Health check endpoint for SmartyStreets service
*/
export declare function createHealthCheckResource(executeRequest: ExecuteRequest): {
/**
* Check SmartyStreets service health and API connectivity
*
* @fullPath api.smartyStreets.healthCheck.get
* @service smarty-streets
* @domain system-health
* @dataMethod healthCheckData.get
* @discoverable true
* @searchTerms ["health", "status", "availability", "ping", "check", "address service", "smartystreets connectivity", "validation service"]
* @relatedEndpoints ["api.smartyStreets.ping.get", "api.smartyStreets.us.lookup.get", "api.customers.addresses.validate", "api.logistics.healthCheck.get", "api.shipping.healthCheck.get"]
* @commonPatterns ["Health check", "Service status", "Address service availability", "System monitoring", "API connectivity test"]
* @workflow ["system-monitoring", "health-checks", "service-discovery", "address-validation-setup", "api-status-verification"]
* @prerequisites ["Service is running", "Valid authentication token", "x-site-id header", "SmartyStreets API connectivity"]
* @nextSteps ["Use address validation endpoints if healthy", "Verify SmartyStreets API credits", "Monitor service metrics"]
* @businessRules ["Returns service and API status", "Requires standard authentication", "Standard health check format", "Reports API credit status"]
* @functionalArea "system-monitoring"
* @caching "No caching - real-time status required"
* @performance "Fast response, minimal processing, use for address service monitoring"
*
* @param params Health check parameters with site ID
* @returns Promise<HealthCheckResponse> Service health status with SmartyStreets API connectivity
*
* @example
* ```typescript
* // Check if SmartyStreets service is healthy
* const response = await client.healthCheck.get({ 'x-site-id': 'SITE123' });
* console.log(response.data.status); // 'healthy'
* console.log(response.data.service); // 'smarty-streets'
* console.log(response.data.smartystreets_connectivity); // true
* console.log(response.status); // HTTP status code
*
* // Get just the health status
* const status = await client.healthCheckData.get({ 'x-site-id': 'SITE123' });
* console.log(status); // Health data object
* ```
*/
get: (params: HealthCheckParams) => Promise<{
params: Record<string, unknown> | unknown[];
data: {
status: string;
service: string;
timestamp?: string | undefined;
version?: string | undefined;
smartystreets_connectivity?: boolean | undefined;
api_credits_remaining?: number | undefined;
};
options: Record<string, unknown> | unknown[];
status: number;
message: string;
count: number;
total: number;
totalResults: number;
}>;
};
/**
* Creates the healthCheckData resource methods (data-only versions)
*/
export declare function createHealthCheckDataResource(healthCheck: ReturnType<typeof createHealthCheckResource>): {
/**
* Get SmartyStreets service health data without full response metadata
*
* @fullPath api.smartyStreets.healthCheck.getData
* @service smarty-streets
* @domain system-health
* @dataMethod healthCheck.getData
* @discoverable true
* @searchTerms ["health data", "service status", "smartystreets availability", "api connectivity"]
* @relatedEndpoints ["api.smartyStreets.healthCheck.get", "api.smartyStreets.us.lookup.get"]
* @commonPatterns ["Get health status", "Check API connectivity", "Service monitoring"]
* @workflow ["system-monitoring", "health-checks", "service-verification"]
* @prerequisites ["Valid authentication token", "x-site-id header"]
* @nextSteps ["Use address validation endpoints if healthy", "Monitor service metrics"]
* @businessRules ["Returns only health data object", "No response metadata included"]
* @functionalArea "system-monitoring"
* @caching "No caching - real-time status required"
* @performance "Direct data access, faster for simple health checks"
*
* @param params Health check parameters with site ID
* @returns Promise<HealthCheckData> Direct health status data object
*/
get: (params: HealthCheckParams) => Promise<{
status: string;
service: string;
timestamp?: string | undefined;
version?: string | undefined;
smartystreets_connectivity?: boolean | undefined;
api_credits_remaining?: number | undefined;
}>;
};
export type HealthCheckResource = ReturnType<typeof createHealthCheckResource>;
export type HealthCheckDataResource = ReturnType<typeof createHealthCheckDataResource>;
export {};
//# sourceMappingURL=health-check.d.ts.map