merchi_sdk_js 0.0.64 → 0.0.66
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/package.json +1 -1
- package/src/merchi.js +9 -2
package/package.json
CHANGED
package/src/merchi.js
CHANGED
@@ -125,7 +125,7 @@ export function merchi(backendUri, websocketUri) {
|
|
125
125
|
}
|
126
126
|
|
127
127
|
function getSocket() {
|
128
|
-
if (socket === null) {
|
128
|
+
if (socket === null && websocketUri) {
|
129
129
|
socket = io.connect(websocketUri);
|
130
130
|
socket.on('update', handleUpdate);
|
131
131
|
}
|
@@ -133,7 +133,10 @@ export function merchi(backendUri, websocketUri) {
|
|
133
133
|
}
|
134
134
|
|
135
135
|
function emit(name, data) {
|
136
|
-
getSocket()
|
136
|
+
var socket = getSocket();
|
137
|
+
if (socket) {
|
138
|
+
socket.emit(name, data);
|
139
|
+
}
|
137
140
|
}
|
138
141
|
|
139
142
|
this.subscribe = function (eventTypes, uri, method, onUpdate) {
|
@@ -240,6 +243,10 @@ export function merchi(backendUri, websocketUri) {
|
|
240
243
|
shipmentCompanies.add(10, 'realtime express');
|
241
244
|
shipmentCompanies.add(11, 'Uber');
|
242
245
|
shipmentCompanies.add(12, 'Civic Transport Couriers');
|
246
|
+
shipmentCompanies.add(13, 'NZ Post');
|
247
|
+
shipmentCompanies.add(14, 'Sendle');
|
248
|
+
shipmentCompanies.add(15, 'USPS');
|
249
|
+
shipmentCompanies.add(16, 'Fusion Freight');
|
243
250
|
|
244
251
|
inventoryStatuses.add("DEDUCTED", 0)
|
245
252
|
inventoryStatuses.add("CAN_DEDUCT", 1)
|