Skip to content

Commit

Permalink
feat(santai): add types
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Dec 9, 2023
1 parent cc8707f commit 3813cfb
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/orange-waves-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cn-international-express-sdk/santai': major
---

feat: add santai express types
2 changes: 1 addition & 1 deletion packages/santai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cn-international-express-sdk/santai",
"version": "2.0.0",
"version": "2.0.1",
"types": "./dist/types/index.d.ts",
"main": "./dist/lib/index.js",
"module": "./dist/es/index.js",
Expand Down
7 changes: 2 additions & 5 deletions packages/santai/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { Recordable, promiseSoap } from '@cn-international-express-sdk/utils';
import { SanTaiConfig } from './state';

export interface SanTaiConfig {
app_key: string;
app_token: string;
user_id: string;
}
export * from './state';

export class SanTai {
public config: SanTaiConfig;
Expand Down
54 changes: 54 additions & 0 deletions packages/santai/src/state.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* eslint-disable @typescript-eslint/no-namespace */

export interface SanTaiConfig {
app_key: string;
app_token: string;
user_id: string;
}

export namespace SanTaiTypes {
export interface GetShipTypesRes {
shiptypes: {
attributes: {
cn_name: string;
method_code: string;
};
}[];
}

export interface ReqOrderTracknumberRes {
orderInfo: {
trackNumber?: string;
trackNumberUsps?: string;
};
}

export interface ReqGetFeeRes {
totalFee: string;
baseFee: string;
feeWeight: number;
regFee: string;
chargebackTime: string;
otherFee:
| {
fee: string;
}
| {
fee: string;
}[];
}

export interface GoodDetailItem {
detailDescription: string;
detailDescriptionCN: string;
detailQuantity: number;
detailWorth: number;
hsCode: string;
detailCustomLabel: string;
}

export interface AddOrderRes {
orderCode: string;
note: string;
}
}

0 comments on commit 3813cfb

Please sign in to comment.