Package Exports
- @rytass/logistics-adapter-tcat
- @rytass/logistics-adapter-tcat/index.cjs.js
- @rytass/logistics-adapter-tcat/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@rytass/logistics-adapter-tcat) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Rytass Utils - Logistics (TCat)
Features
- Trace single logistics
- Trace multiple logistics
Quick Start
// use default setting
import { TCatLogisticsService, TCatLogistics } from '@rytass/logistics-adapter-tcat'
const logistics = new TCatLogisticsService(TCatLogistics)
logistics.trace('800978442950')
logistics.trace(['800978442950', '903404283301'])Customization
import { TCatLogisticsService, TCatLogisticsInterface } from '@rytass/logistics-adapter-tcat'
type customStatus = 'DELIVERED' | 'DELIVERING' | 'SHELVED' | 'CUSTOM_STATUS'
const customLogistics: TCatLogisticsInterface<customStatus> = {
ignoreNotFound: false,
url: 'https://www.t-cat.com.tw/Inquire/TraceDetail.aspx',
statusMap(reference: string, id: string) => {
// implement logic of status mapping with context in reference argument
}
}
const logistics = new TCatLogisticsService(customLogistics)
logistics.trace('800978442950')
logistics.trace(['800978442950', '903404283301'])