@simpleapps-com/augur-api
Version:
TypeScript client library for Augur microservices API endpoints
64 lines • 3.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShippingClient = void 0;
const base_client_1 = require("../../core/base-client");
const resources_1 = require("./resources");
/**
* Shipping Service Client
*
* Provides access to comprehensive shipping rate calculation, carrier comparison,
* and shipping cost optimization across multiple carriers and service types.
* Supports domestic and international shipping with detailed rate analysis.
*
* @service shipping
* @domain shipping-and-logistics
* @discoverable true
* @searchTerms ["shipping", "carriers", "rates", "freight", "delivery", "logistics"]
* @relatedEndpoints ["api.logistics.speedship.freight.get", "api.commerce.cart.shipping.calculate", "api.orders.shipping.estimate"]
* @commonPatterns ["Shipping rate calculation", "Carrier comparison", "Freight quotes", "Delivery estimation"]
* @workflow ["e-commerce-checkout", "order-fulfillment", "shipping-estimation", "cost-analysis"]
* @functionalArea "shipping-and-logistics"
* @businessRules ["Requires valid bearer authentication", "Multi-carrier support", "Real-time rate calculation", "Address validation"]
* @performance "Optimized for multi-carrier rate comparison and shipping workflows"
* @example
* ```typescript
* import { HTTPClient } from '@augur/api-client/core';
* import { ShippingClient } from '@augur/api-client/services/shipping';
*
* const http = new HTTPClient('shipping', { siteId: 'your-site-id', bearerToken: 'your-token' });
* const shipping = new ShippingClient(http);
*
* // Check service health
* const health = await shipping.healthCheck.get({ siteId: 1 });
* const healthData = await shipping.healthCheckData.get({ siteId: 1 });
*
* // Get shipping rates
* const rates = await shipping.rates.create({
* origin: { zip: '10001', country: 'US' },
* destination: { zip: '90210', country: 'US' },
* packages: [{ weight: 5, length: 10, width: 8, height: 6, unit: 'lb' }]
* });
*
* // Get rates data only
* const ratesData = await shipping.ratesData.create({ ... });
* ```
*/
class ShippingClient extends base_client_1.BaseServiceClient {
constructor(http, baseUrl) {
super('shipping', http, baseUrl || 'https://shipping.augur-api.com');
// Bind executeRequest for resource factories
const boundExecuteRequest = (config, params, pathParams) => {
return this.executeRequest(config, params, pathParams);
};
// Initialize resources
this.healthCheck = (0, resources_1.createHealthCheckResource)(boundExecuteRequest);
this.healthCheckData = (0, resources_1.createHealthCheckDataResource)(this.healthCheck);
this.rates = (0, resources_1.createRatesResource)(boundExecuteRequest);
this.ratesData = (0, resources_1.createRatesDataResource)(this.rates);
}
getServiceDescription() {
return 'Comprehensive shipping rate calculation and carrier comparison service';
}
}
exports.ShippingClient = ShippingClient;
//# sourceMappingURL=client.js.map