0.1.2 • Published 7 months ago

@rytass/logistics-adapter-tcat v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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'])
0.1.2

7 months ago

0.1.0

12 months ago

0.1.1

11 months ago

0.0.10

1 year ago

0.0.9

2 years ago