@dotdev/harmony-sdk 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -30
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -28,9 +28,9 @@ pnpm add @dotapparel/harmony-sdk
|
|
|
28
28
|
Here's a basic example of how to use the Harmony SDK:
|
|
29
29
|
|
|
30
30
|
```typescript
|
|
31
|
-
import { HarmonyAPI, AuthenticationToken } from
|
|
31
|
+
import { HarmonyAPI, AuthenticationToken } from "@dotapparel/harmony-sdk";
|
|
32
32
|
|
|
33
|
-
const api = new HarmonyAPI(
|
|
33
|
+
const api = new HarmonyAPI("https://your-harmony-api-url.com");
|
|
34
34
|
|
|
35
35
|
async function main() {
|
|
36
36
|
const authToken: AuthenticationToken = {
|
|
@@ -39,19 +39,18 @@ async function main() {
|
|
|
39
39
|
|
|
40
40
|
try {
|
|
41
41
|
const sessionId = await api.authenticate(authToken);
|
|
42
|
-
console.log(
|
|
42
|
+
console.log("Authenticated successfully. Session ID:", sessionId);
|
|
43
43
|
|
|
44
44
|
// Example: Perform a stock lookup
|
|
45
45
|
const stockLookupParams = {
|
|
46
46
|
// Fill in your stock lookup parameters
|
|
47
47
|
};
|
|
48
48
|
const stockResults = await api.stockLookup(stockLookupParams, sessionId);
|
|
49
|
-
console.log(
|
|
49
|
+
console.log("Stock lookup results:", stockResults);
|
|
50
50
|
|
|
51
51
|
// Use other methods as needed...
|
|
52
|
-
|
|
53
52
|
} catch (error) {
|
|
54
|
-
console.error(
|
|
53
|
+
console.error("Error:", error);
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -63,22 +62,26 @@ main();
|
|
|
63
62
|
To set up the development environment:
|
|
64
63
|
|
|
65
64
|
1. Clone the repository:
|
|
65
|
+
|
|
66
66
|
```bash
|
|
67
67
|
git clone https://github.com/your-repo/harmony-sdk.git
|
|
68
68
|
cd harmony-sdk
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
2. Install dependencies:
|
|
72
|
+
|
|
72
73
|
```bash
|
|
73
74
|
pnpm install
|
|
74
75
|
```
|
|
75
76
|
|
|
76
77
|
3. Build the project:
|
|
78
|
+
|
|
77
79
|
```bash
|
|
78
80
|
pnpm run build
|
|
79
81
|
```
|
|
80
82
|
|
|
81
83
|
4. Run tests:
|
|
84
|
+
|
|
82
85
|
```bash
|
|
83
86
|
pnpm test
|
|
84
87
|
```
|
|
@@ -93,40 +96,46 @@ To set up the development environment:
|
|
|
93
96
|
The Harmony SDK implements the following endpoints:
|
|
94
97
|
|
|
95
98
|
1. Authentication
|
|
96
|
-
|
|
99
|
+
|
|
100
|
+
- `authenticate(authToken: AuthenticationToken): Promise<string>`
|
|
97
101
|
|
|
98
102
|
2. Stock Lookup Module
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
|
|
104
|
+
- `stockLookup(params: StockLookupRequestParams, sessionId: string): Promise<Stock[]>`
|
|
105
|
+
- `stockCategoryLookup(sessionId: string): Promise<StockCategory[]>`
|
|
106
|
+
- `stockBarcodeLookup(params: StockLookupRequestParams, sessionId: string): Promise<StockBarcode[]>`
|
|
107
|
+
- `stockColorLookup(sessionId: string): Promise<StockColor[]>`
|
|
108
|
+
- `sizeGridLookup(sessionId: string): Promise<SizeGrid[]>`
|
|
109
|
+
- `stockClassificationLookup(sessionId: string, searchType?: StockClassificationType): Promise<StockClassification[]>`
|
|
105
110
|
|
|
106
111
|
3. Stock Level Lookup Module
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
|
|
113
|
+
- `warehouseLookup(sessionId: string): Promise<Warehouse[]>`
|
|
114
|
+
- `stockLevelLookup(params: StockLevelLookupQueryParams, sessionId: string): Promise<StockLevel[]>`
|
|
115
|
+
- `stockLevelLookupByWarehouseQuickView(params: StockLevelLookupQueryParams, sessionId: string): Promise<StockLevel[]>`
|
|
110
116
|
|
|
111
117
|
4. Point of Sale Module
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
|
|
119
|
+
- `processSalesOrder(params: ProcessSaleOrderQueryParams, sessionId: string): Promise<boolean>`
|
|
120
|
+
- `processReturns(params: ProcessSaleOrderQueryParams, sessionId: string): Promise<boolean>`
|
|
121
|
+
- `modifyExistingSalesOrder(params: ProcessSaleOrderQueryParams, sessionId: string): Promise<boolean>`
|
|
122
|
+
- `cancelExistingSalesOrder(params: ProcessSaleOrderQueryParams, sessionId: string): Promise<boolean>`
|
|
116
123
|
|
|
117
124
|
5. Carrier Module
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
|
|
126
|
+
- `getCarrier(sessionId: string): Promise<Carrier[]>`
|
|
127
|
+
- `getCarrierShipmentByOrderNo(orderNo: string, sessionId: string): Promise<CarrierShipment[]>`
|
|
128
|
+
- `getCarrierBySysTime(params: GetCarrierShipmentByTimeQueryParams, sessionId: string): Promise<CarrierShipment[]>`
|
|
121
129
|
|
|
122
130
|
6. Diary Module
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
|
|
132
|
+
- `getDiaryBy(params: GetDiaryQueryParams, sessionId: string): Promise<Diary[]>`
|
|
133
|
+
- `createDiary(params: CreateDiaryQueryParams, sessionId: string): Promise<boolean>`
|
|
125
134
|
|
|
126
135
|
7. Gift Voucher Module
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
- `giftVoucherLookup(params: GiftVoucherLookupQueryParams, sessionId: string): Promise<GiftVoucher[]>`
|
|
137
|
+
- `giftVoucherVerificationKey(params: GiftVoucherVerificationKeyQueryParams, sessionId: string): Promise<string>`
|
|
138
|
+
- `giftVoucherReservation(params: GiftVoucherReservationQueryParams, sessionId: string): Promise<string>`
|
|
139
|
+
- `giftVoucherUsed(params: GiftVoucherUsedQueryParams, sessionId: string): Promise<number>`
|
|
131
140
|
|
|
132
|
-
For detailed information on each endpoint and its parameters, please refer to the source code and type definitions.
|
|
141
|
+
For detailed information on each endpoint and its parameters, please refer to the source code and type definitions.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotdev/harmony-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Harmony API SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@types/node": "^16.3.1",
|
|
20
20
|
"@types/xml2js": "^0.4.14",
|
|
21
21
|
"jest": "^29.7.0",
|
|
22
|
+
"prettier": "^3.3.3",
|
|
22
23
|
"standard-version": "^9.5.0",
|
|
23
24
|
"ts-jest": "^29.1.2",
|
|
24
25
|
"ts-node": "^10.2.1",
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"build": "tsc",
|
|
35
36
|
"watch": "tsc -w",
|
|
36
37
|
"test": "jest",
|
|
37
|
-
"release": "./release.sh"
|
|
38
|
+
"release": "./release.sh",
|
|
39
|
+
"prettier": "prettier --write ."
|
|
38
40
|
}
|
|
39
41
|
}
|