fc-landmark 1.0.0 → 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/dist/landmark.js +15 -13
- package/dist/landmark.js.map +1 -1
- package/dist/shipment.js +8 -8
- package/dist/shipment.js.map +1 -1
- package/dist/tracking.js +6 -3
- package/dist/tracking.js.map +1 -1
- package/package.json +1 -1
- package/src/landmark.ts +17 -13
- package/src/shipment.ts +8 -8
- package/src/tracking.ts +6 -3
- package/tests/shipment.js +405 -115
- package/tests/tracking.js +1 -1
package/dist/landmark.js
CHANGED
|
@@ -18,9 +18,11 @@ const tracking_1 = __importDefault(require("./tracking"));
|
|
|
18
18
|
const core_1 = require("./core");
|
|
19
19
|
const globals_1 = require("./globals");
|
|
20
20
|
class LandMark {
|
|
21
|
-
constructor(username, password, logger, flclerror, rootRequestId, requestId) {
|
|
21
|
+
constructor(username, password, clientId, test, logger, flclerror, rootRequestId, requestId) {
|
|
22
22
|
this.username = username;
|
|
23
23
|
this.password = password;
|
|
24
|
+
this.test = test;
|
|
25
|
+
this.clientId = clientId;
|
|
24
26
|
core_1.setRequredGlobals(logger, flclerror, rootRequestId, requestId);
|
|
25
27
|
}
|
|
26
28
|
createShipmet(args) {
|
|
@@ -28,9 +30,9 @@ class LandMark {
|
|
|
28
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
31
|
try {
|
|
30
32
|
let shipObj = new shipment_1.default();
|
|
31
|
-
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
32
|
-
let landmarkShipmentRequest = shipObj.buildShipmentRequest(args, this.username, this.password);
|
|
33
|
-
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
33
|
+
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentInput', propertyValue: args });
|
|
34
|
+
let landmarkShipmentRequest = shipObj.buildShipmentRequest(args, this.username, this.password, this.test, this.clientId);
|
|
35
|
+
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentRequest', propertyValue: landmarkShipmentRequest });
|
|
34
36
|
let landmarkShipmentRes = yield shipObj.createShipment(landmarkShipmentRequest);
|
|
35
37
|
if (landmarkShipmentRes.hasOwnProperty("ImportResponse") && landmarkShipmentRes['ImportResponse']['Errors']) {
|
|
36
38
|
throw new Error(landmarkShipmentRes['ImportResponse']['Errors']['Error']['ErrorMessage']['_text']);
|
|
@@ -40,7 +42,7 @@ class LandMark {
|
|
|
40
42
|
return response;
|
|
41
43
|
}
|
|
42
44
|
catch (e) {
|
|
43
|
-
(_d = globals_1.MyGlobal.logger) === null || _d === void 0 ? void 0 : _d.error(globals_1.MyGlobal.flclError.create({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
45
|
+
(_d = globals_1.MyGlobal.logger) === null || _d === void 0 ? void 0 : _d.error(globals_1.MyGlobal.flclError.create({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMark_ERROR', cause: e, message: 'Exception while creating shipment in Landmark' }));
|
|
44
46
|
throw e;
|
|
45
47
|
}
|
|
46
48
|
});
|
|
@@ -51,18 +53,18 @@ class LandMark {
|
|
|
51
53
|
try {
|
|
52
54
|
let trackObj = new tracking_1.default();
|
|
53
55
|
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'LandmarkInput', propertyValue: args });
|
|
54
|
-
let landmarkTrackRequest = trackObj.buildTrackingRequest(args, this.username, this.password);
|
|
55
|
-
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
58
|
-
throw new Error(
|
|
56
|
+
let landmarkTrackRequest = trackObj.buildTrackingRequest(args, this.username, this.password, this.test, this.clientId);
|
|
57
|
+
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'LandmarkTrackRequest', propertyValue: landmarkTrackRequest });
|
|
58
|
+
let landMarkTrackingRes = yield trackObj.trackInfo(landmarkTrackRequest);
|
|
59
|
+
if (landMarkTrackingRes.hasOwnProperty("TrackResponse") && landMarkTrackingRes['TrackResponse']['Errors']) {
|
|
60
|
+
throw new Error(landMarkTrackingRes['TrackResponse']['Errors']['Error']['ErrorMessage']['_text']);
|
|
59
61
|
}
|
|
60
|
-
let response = trackObj.buildResponse(
|
|
61
|
-
(_c = globals_1.MyGlobal.logger) === null || _c === void 0 ? void 0 : _c.info({ npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
62
|
+
let response = trackObj.buildResponse(landMarkTrackingRes, args);
|
|
63
|
+
(_c = globals_1.MyGlobal.logger) === null || _c === void 0 ? void 0 : _c.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'response', propertyValue: response });
|
|
62
64
|
return response;
|
|
63
65
|
}
|
|
64
66
|
catch (e) {
|
|
65
|
-
(_d = globals_1.MyGlobal.logger) === null || _d === void 0 ? void 0 : _d.error(globals_1.MyGlobal.flclError.create({ npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
67
|
+
(_d = globals_1.MyGlobal.logger) === null || _d === void 0 ? void 0 : _d.error(globals_1.MyGlobal.flclError.create({ npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'landMark_ERROR', cause: e, message: 'Exception while get trackinfo in Landmark' }));
|
|
66
68
|
throw e;
|
|
67
69
|
}
|
|
68
70
|
});
|
package/dist/landmark.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"landmark.js","sourceRoot":"","sources":["../src/landmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAkC;AAClC,0DAAkC;AAClC,iCAA2C;AAC3C,uCAA4C;AAG5C,MAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"landmark.js","sourceRoot":"","sources":["../src/landmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAkC;AAClC,0DAAkC;AAClC,iCAA2C;AAC3C,uCAA4C;AAG5C,MAAa,QAAQ;IAKjB,YAAY,QAAe,EAAC,QAAe,EAAC,QAAe,EAAC,IAAY,EAAE,MAAmB,EAAE,SAAqB,EAAE,aAAsB,EAAE,SAAkB;QAC5J,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,wBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAEK,aAAa,CAAC,IAAS;;;YACzB,IAAI;gBAEA,IAAI,OAAO,GAAG,IAAI,kBAAQ,EAAE,CAAC;gBAC7B,MAAA,kBAAG,CAAC,MAAM,0CAAE,IAAI,CAAC,EAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,uBAAuB,EAAE,aAAa,EAAE,IAAI,EAAC,EAAE;gBACvJ,IAAI,uBAAuB,GAAW,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,QAAQ,EAAC,IAAI,CAAC,IAAI,EAAC,IAAI,CAAC,QA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aACnB;YAAC,OAAM,CAAC,EAAE;gBACP,MAAA,kBAAG,CAAC,MAAM,0CAAE,KAAK,CAAC,kBAAG,CAAC,SAAU,CAAC,MAAM,CAAC,EAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,2CAA2C,EAAC,CAAC,EAAE;gBACrN,MAAM,CAAC,CAAC;aACX;;KACJ;CACJ;AApDD,4BAoDC"}
|
package/dist/shipment.js
CHANGED
|
@@ -49,21 +49,21 @@ class Shipment {
|
|
|
49
49
|
};
|
|
50
50
|
return shipper;
|
|
51
51
|
}
|
|
52
|
-
buildShipmentRequest(args, username, password) {
|
|
52
|
+
buildShipmentRequest(args, username, password, test, clientId) {
|
|
53
53
|
try {
|
|
54
54
|
let importRequest = {
|
|
55
55
|
"Login": {
|
|
56
56
|
"Username": username,
|
|
57
57
|
"Password": password
|
|
58
58
|
},
|
|
59
|
-
"Test":
|
|
60
|
-
"ClientID":
|
|
59
|
+
"Test": test,
|
|
60
|
+
"ClientID": clientId,
|
|
61
61
|
"Reference": args.reference,
|
|
62
62
|
"ShipTo": this.getConsignee(args),
|
|
63
63
|
"ShippingLane": {
|
|
64
64
|
"Region": "Landmark BUF"
|
|
65
65
|
},
|
|
66
|
-
"ShipMethod": args._carrierRateObj.
|
|
66
|
+
"ShipMethod": args._carrierRateObj.servicecode,
|
|
67
67
|
"OrderTotal": args.shipment_total_usd,
|
|
68
68
|
"ItemsCurrency": args.currency,
|
|
69
69
|
"ProduceLabel": true,
|
|
@@ -116,12 +116,12 @@ class Shipment {
|
|
|
116
116
|
};
|
|
117
117
|
let resp = yield globals_1.MyGlobal.axios.post(globals_1.MyGlobal.ship_url, ShipmentRequest, configs);
|
|
118
118
|
console.log(resp.data);
|
|
119
|
-
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: '
|
|
119
|
+
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'Landmark-RAW-RESPOSNE', propertyValue: resp.data });
|
|
120
120
|
let responsejson = xml_js_1.xml2json(resp.data, { compact: true, spaces: 4 });
|
|
121
121
|
return JSON.parse(responsejson);
|
|
122
122
|
}
|
|
123
123
|
catch (e) {
|
|
124
|
-
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: '
|
|
124
|
+
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'Landmark-RAW-RESPOSNE', data: { error: e } });
|
|
125
125
|
(_c = globals_1.MyGlobal.logger) === null || _c === void 0 ? void 0 : _c.error(globals_1.MyGlobal.flclError.create({ npm: 'fc-landmark', className: 'Shipment', methodName: 'createShipment', propertyName: 'CREDITS_ERROR', cause: e }));
|
|
126
126
|
throw e;
|
|
127
127
|
}
|
|
@@ -134,8 +134,8 @@ class Shipment {
|
|
|
134
134
|
carrier: 'Landmark',
|
|
135
135
|
tracking_number: resp['ImportResponse']['Result']['Packages']['Package']['TrackingNumber']['_text'],
|
|
136
136
|
provider_tracking_number: resp['ImportResponse']['Result']['Packages']['Package']['TrackingNumber']['_text'],
|
|
137
|
-
shipping_label: resp['ImportResponse']['Result']['ShipmentLabelLink']['_text'],
|
|
138
|
-
label_type: args.label_format,
|
|
137
|
+
shipping_label: args.label_format.toLowerCase() == "zpl" ? resp['ImportResponse']['Result']['Packages']['Package']['LabelImages']['LabelImage']['_text'] : resp['ImportResponse']['Result']['ShipmentLabelLink']['_text'],
|
|
138
|
+
label_type: args.label_format.toLowerCase() == "zpl" ? "zplenc" : "url",
|
|
139
139
|
gross_weight: args.total_weight,
|
|
140
140
|
gross_weight_unit: args.weight_unit,
|
|
141
141
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AAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC;YACzN,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YACvE,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,iBAAiB,EAAE,IAAI,CAAC,WAAW;YACnC,wBAAwB,EAAE,KAAK;SAClC,CAAC;QACF,OAAO,QAAQ,CAAC;IACpB,CAAC;CAEJ;AApID,2BAoIC"}
|
package/dist/tracking.js
CHANGED
|
@@ -14,15 +14,15 @@ const xml_js_1 = require("xml-js");
|
|
|
14
14
|
class Tracking {
|
|
15
15
|
constructor() {
|
|
16
16
|
}
|
|
17
|
-
buildTrackingRequest(args, username, password) {
|
|
17
|
+
buildTrackingRequest(args, username, password, test, clientId) {
|
|
18
18
|
try {
|
|
19
19
|
let trackRequest = {
|
|
20
20
|
"Login": {
|
|
21
21
|
"Username": username,
|
|
22
22
|
"Password": password
|
|
23
23
|
},
|
|
24
|
-
"Test":
|
|
25
|
-
"ClientID":
|
|
24
|
+
"Test": test,
|
|
25
|
+
"ClientID": clientId,
|
|
26
26
|
"TrackingNumber": args.tracking_number,
|
|
27
27
|
"RetrievalType": "Historical"
|
|
28
28
|
};
|
|
@@ -63,6 +63,9 @@ class Tracking {
|
|
|
63
63
|
tracking_number: args.tracking_number,
|
|
64
64
|
tracking_history: []
|
|
65
65
|
};
|
|
66
|
+
if (!Array.isArray(resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'])) {
|
|
67
|
+
resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'] = [resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event']];
|
|
68
|
+
}
|
|
66
69
|
for (let i = 0; i < resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'].length; i++) {
|
|
67
70
|
let history = {};
|
|
68
71
|
let code = resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'][i]['EventCode']['_text'];
|
package/dist/tracking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../src/tracking.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,uCAA4C;AAC5C,mCAA0C;AAE1C,MAAqB,QAAQ;IACzB;IAEA,CAAC;IAED,oBAAoB,CAAC,IAAS,EAAC,QAAgB,EAAC,QAAgB;
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../src/tracking.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,uCAA4C;AAC5C,mCAA0C;AAE1C,MAAqB,QAAQ;IACzB;IAEA,CAAC;IAED,oBAAoB,CAAC,IAAS,EAAC,QAAgB,EAAC,QAAgB,EAAE,IAAY,EAAC,QAAe;QAC1F,IAAI;YACA,IAAI,YAAY,GAAQ;gBACpB,OAAO,EAAE;oBACL,UAAU,EAAE,QAAQ;oBACpB,UAAU,EAAE,QAAQ;iBACvB;gBACD,MAAM,EAAE,IAAI;gBACZ,UAAU,EAAE,QAAQ;gBACpB,gBAAgB,EAAE,IAAI,CAAC,eAAe;gBACtC,eAAe,EAAC,YAAY;aAE/B,CAAC;YACF,IAAI,OAAO,GAAQ;gBACf,cAAc,EAAE,YAAY;aAC/B,CAAA;YACD,MAAM,OAAO,GAAG,eAAM,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;YACnF,OAAO,OAAO,CAAC;SAClB;QAAC,OAAM,CAAC,EAAE;YACP,MAAM,kBAAG,CAAC,S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ark {
|
|
8
8
|
private username : string;
|
|
9
9
|
private password : string;
|
|
10
|
-
|
|
10
|
+
private test : boolean;
|
|
11
|
+
private clientId : number;
|
|
12
|
+
constructor(username:string,password:string,clientId:number,test:boolean, logger?: FlclLogger, flclerror?: FlclError, rootRequestId?: string, requestId?: string) {
|
|
11
13
|
this.username = username;
|
|
12
14
|
this.password = password;
|
|
15
|
+
this.test = test;
|
|
16
|
+
this.clientId = clientId;
|
|
13
17
|
setRequredGlobals(logger, flclerror, rootRequestId, requestId);
|
|
14
18
|
}
|
|
15
19
|
|
|
@@ -17,9 +21,9 @@ export class LandMark {
|
|
|
17
21
|
try {
|
|
18
22
|
|
|
19
23
|
let shipObj = new Shipment();
|
|
20
|
-
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
21
|
-
let landmarkShipmentRequest: string = shipObj.buildShipmentRequest(args,this.username,this.password);
|
|
22
|
-
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
24
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentInput', propertyValue: args});
|
|
25
|
+
let landmarkShipmentRequest: string = shipObj.buildShipmentRequest(args,this.username,this.password,this.test,this.clientId);
|
|
26
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentRequest', propertyValue: landmarkShipmentRequest});
|
|
23
27
|
let landmarkShipmentRes: any = await shipObj.createShipment(landmarkShipmentRequest);
|
|
24
28
|
if(landmarkShipmentRes.hasOwnProperty("ImportResponse") && landmarkShipmentRes['ImportResponse']['Errors']){
|
|
25
29
|
throw new Error(landmarkShipmentRes['ImportResponse']['Errors']['Error']['ErrorMessage']['_text']) ;
|
|
@@ -28,7 +32,7 @@ export class LandMark {
|
|
|
28
32
|
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'response', propertyValue: response});
|
|
29
33
|
return response;
|
|
30
34
|
} catch(e) {
|
|
31
|
-
app.logger?.error(app.flclError!.create({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: '
|
|
35
|
+
app.logger?.error(app.flclError!.create({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMark_ERROR', cause: e, message: 'Exception while creating shipment in Landmark'}));
|
|
32
36
|
throw e;
|
|
33
37
|
}
|
|
34
38
|
}
|
|
@@ -38,17 +42,17 @@ export class LandMark {
|
|
|
38
42
|
|
|
39
43
|
let trackObj = new Tracking();
|
|
40
44
|
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'LandmarkInput', propertyValue: args});
|
|
41
|
-
let landmarkTrackRequest: string = trackObj.buildTrackingRequest(args,this.username,this.password);
|
|
42
|
-
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
43
|
-
let
|
|
44
|
-
if(
|
|
45
|
-
throw new Error(
|
|
45
|
+
let landmarkTrackRequest: string = trackObj.buildTrackingRequest(args,this.username,this.password,this.test,this.clientId);
|
|
46
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'LandmarkTrackRequest', propertyValue: landmarkTrackRequest});
|
|
47
|
+
let landMarkTrackingRes: any = await trackObj.trackInfo(landmarkTrackRequest);
|
|
48
|
+
if(landMarkTrackingRes.hasOwnProperty("TrackResponse") && landMarkTrackingRes['TrackResponse']['Errors']){
|
|
49
|
+
throw new Error(landMarkTrackingRes['TrackResponse']['Errors']['Error']['ErrorMessage']['_text']) ;
|
|
46
50
|
}
|
|
47
|
-
let response: FlavorcloudTrackingResponse = trackObj.buildResponse(
|
|
48
|
-
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
51
|
+
let response: FlavorcloudTrackingResponse = trackObj.buildResponse(landMarkTrackingRes, args);
|
|
52
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'response', propertyValue: response});
|
|
49
53
|
return response;
|
|
50
54
|
} catch(e) {
|
|
51
|
-
app.logger?.error(app.flclError!.create({npm: 'fc-landmark', className: 'Landmark', methodName: '
|
|
55
|
+
app.logger?.error(app.flclError!.create({npm: 'fc-landmark', className: 'Landmark', methodName: 'getTrackingInfo', propertyName: 'landMark_ERROR', cause: e, message: 'Exception while get trackinfo in Landmark'}));
|
|
52
56
|
throw e;
|
|
53
57
|
}
|
|
54
58
|
}
|
package/src/shipment.ts
CHANGED
|
@@ -43,21 +43,21 @@ export default class Shipment {
|
|
|
43
43
|
};
|
|
44
44
|
return shipper;
|
|
45
45
|
}
|
|
46
|
-
buildShipmentRequest(args: any,username:string,password:string): string{
|
|
46
|
+
buildShipmentRequest(args: any,username:string,password:string,test:boolean,clientId:number): string{
|
|
47
47
|
try {
|
|
48
48
|
let importRequest :any = {
|
|
49
49
|
"Login": {
|
|
50
50
|
"Username": username,
|
|
51
51
|
"Password": password
|
|
52
52
|
},
|
|
53
|
-
"Test":
|
|
54
|
-
"ClientID":
|
|
53
|
+
"Test": test,
|
|
54
|
+
"ClientID": clientId ,
|
|
55
55
|
"Reference": args.reference,
|
|
56
56
|
"ShipTo": this.getConsignee( args),
|
|
57
57
|
"ShippingLane": {
|
|
58
58
|
"Region" : "Landmark BUF"
|
|
59
59
|
},
|
|
60
|
-
"ShipMethod": args._carrierRateObj.
|
|
60
|
+
"ShipMethod": args._carrierRateObj.servicecode,
|
|
61
61
|
"OrderTotal": args.shipment_total_usd,
|
|
62
62
|
"ItemsCurrency": args.currency,
|
|
63
63
|
"ProduceLabel": true,
|
|
@@ -108,11 +108,11 @@ export default class Shipment {
|
|
|
108
108
|
};
|
|
109
109
|
let resp = await app.axios!.post(app.ship_url, ShipmentRequest, configs);
|
|
110
110
|
console.log(resp.data)
|
|
111
|
-
app.logger?.info({npm: 'fc-landmark', className: '
|
|
111
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'Landmark-RAW-RESPOSNE', propertyValue: resp.data});
|
|
112
112
|
let responsejson= xml2json(resp.data,{compact: true, spaces: 4}) ;
|
|
113
113
|
return JSON.parse(responsejson) ;
|
|
114
114
|
} catch(e) {
|
|
115
|
-
app.logger?.info({npm: 'fc-landmark', className: '
|
|
115
|
+
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'Landmark-RAW-RESPOSNE', data: {error: e}});
|
|
116
116
|
app.logger?.error(app.flclError!.create({npm: 'fc-landmark', className: 'Shipment', methodName: 'createShipment', propertyName: 'CREDITS_ERROR', cause: e}));
|
|
117
117
|
throw e;
|
|
118
118
|
}
|
|
@@ -125,8 +125,8 @@ export default class Shipment {
|
|
|
125
125
|
carrier : 'Landmark',
|
|
126
126
|
tracking_number: resp['ImportResponse']['Result']['Packages']['Package']['TrackingNumber']['_text'],
|
|
127
127
|
provider_tracking_number: resp['ImportResponse']['Result']['Packages']['Package']['TrackingNumber']['_text'],
|
|
128
|
-
shipping_label: resp['ImportResponse']['Result']['ShipmentLabelLink']['_text'],
|
|
129
|
-
label_type: args.label_format,
|
|
128
|
+
shipping_label: args.label_format.toLowerCase() == "zpl" ? resp['ImportResponse']['Result']['Packages']['Package']['LabelImages']['LabelImage']['_text'] : resp['ImportResponse']['Result']['ShipmentLabelLink']['_text'],
|
|
129
|
+
label_type: args.label_format.toLowerCase() == "zpl" ? "zplenc" : "url",
|
|
130
130
|
gross_weight: args.total_weight,
|
|
131
131
|
gross_weight_unit: args.weight_unit,
|
|
132
132
|
submitted_electronically: false
|
package/src/tracking.ts
CHANGED
|
@@ -7,15 +7,15 @@ export default class Tracking {
|
|
|
7
7
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
buildTrackingRequest(args: any,username: string,password: string): string{
|
|
10
|
+
buildTrackingRequest(args: any,username: string,password: string, test:boolean,clientId:number): string{
|
|
11
11
|
try {
|
|
12
12
|
let trackRequest :any = {
|
|
13
13
|
"Login": {
|
|
14
14
|
"Username": username,
|
|
15
15
|
"Password": password
|
|
16
16
|
},
|
|
17
|
-
"Test":
|
|
18
|
-
"ClientID":
|
|
17
|
+
"Test": test,
|
|
18
|
+
"ClientID": clientId ,
|
|
19
19
|
"TrackingNumber": args.tracking_number,
|
|
20
20
|
"RetrievalType":"Historical"
|
|
21
21
|
|
|
@@ -55,6 +55,9 @@ export default class Tracking {
|
|
|
55
55
|
tracking_number: args.tracking_number,
|
|
56
56
|
tracking_history : []
|
|
57
57
|
};
|
|
58
|
+
if(! Array.isArray(resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'])){
|
|
59
|
+
resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'] = [resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event']]
|
|
60
|
+
}
|
|
58
61
|
for(let i = 0; i < resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'].length; i++){
|
|
59
62
|
let history: any = {};
|
|
60
63
|
let code :any = resp['TrackResponse']['Result']['Packages']['Package']['Events']['Event'][i]['EventCode']['_text'] ;
|
package/tests/shipment.js
CHANGED
|
@@ -1,149 +1,439 @@
|
|
|
1
1
|
let LandMark = require("../dist/index").LandMark;
|
|
2
2
|
let request = {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"app_id": "70bfc230faedcb5fbf9f427d8d6f6f8a",
|
|
4
|
+
"rest_api_key": "06638bf8e741b1ac42afe7915444b2ac4e7e75ba",
|
|
5
|
+
"async": false,
|
|
6
|
+
"reference": 2023090103,
|
|
7
|
+
"service_code": "standard",
|
|
6
8
|
"label_format": "PDF",
|
|
7
|
-
"weight_unit": "
|
|
9
|
+
"weight_unit": "LB",
|
|
8
10
|
"currency": "USD",
|
|
9
|
-
"dimension_unit": "
|
|
11
|
+
"dimension_unit": "IN",
|
|
10
12
|
"insurance": "N",
|
|
11
13
|
"terms_of_trade": "ddu",
|
|
12
|
-
"_carrierRateObj": {
|
|
13
|
-
"carrier": "landmark",
|
|
14
|
-
"flclservicecode": "express",
|
|
15
|
-
"servicecode": "P",
|
|
16
|
-
"termsoftrade": "ddu",
|
|
17
|
-
"landedCostId": "",
|
|
18
|
-
"carrierrateid": 21513625
|
|
19
|
-
},
|
|
20
14
|
"shipfrom_address": {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
"name": "Wellbel",
|
|
16
|
+
"attention_name": "TEST",
|
|
17
|
+
"address_line_1": "300 South Pointe Dr apt 1705",
|
|
18
|
+
"address_line_2": "",
|
|
19
|
+
"address_line_3": "",
|
|
20
|
+
"city": "Miami Beach",
|
|
21
|
+
"state": "FL",
|
|
22
|
+
"country": "US",
|
|
23
|
+
"zip": 33139,
|
|
24
|
+
"phone": "+18000000000",
|
|
25
|
+
"email": "info@isotropic.co",
|
|
26
|
+
"federal_tax_id": "",
|
|
27
|
+
"state_tax_id": "",
|
|
28
|
+
"location_name": "Floarida"
|
|
35
29
|
},
|
|
36
30
|
"shipto_address": {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
"name": "TESTTE",
|
|
32
|
+
"attention_name": "TESTTE",
|
|
33
|
+
"address_line_1": "33 The Glade, Hampton Park VIC,",
|
|
34
|
+
"address_line_2": "Australia",
|
|
35
|
+
"address_line_3": "",
|
|
36
|
+
"city": "Toronto",
|
|
37
|
+
"state": "ON",
|
|
38
|
+
"country": "CA",
|
|
39
|
+
"zip": "M5J 0A9",
|
|
40
|
+
"phone": "+19876567898",
|
|
41
|
+
"email": "test_dec_27@flavorcloud.com",
|
|
42
|
+
"federal_tax_id": "",
|
|
43
|
+
"state_tax_id": "",
|
|
44
|
+
"firstName": "",
|
|
45
|
+
"lastName": "",
|
|
46
|
+
"addressLine1": "33 The Glade, Hampton Park VIC,",
|
|
47
|
+
"addressLine2": "Australia",
|
|
48
|
+
"addressLine3": ""
|
|
50
49
|
},
|
|
51
|
-
"pieces": [
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"material": "To The Person Reading This TShirt L",
|
|
61
|
-
"description": "To The Person Reading This TShirt L",
|
|
62
|
-
"sku": "761062883269",
|
|
63
|
-
"category": ["To The Person Reading This T-Shirt L"],
|
|
64
|
-
"line_item_id": "",
|
|
65
|
-
"product_id": "",
|
|
66
|
-
"variant_id": "",
|
|
67
|
-
"sale_price_usd": "26.99",
|
|
68
|
-
"hs_code_real": "621142",
|
|
69
|
-
"update": true,
|
|
70
|
-
"hs_code_10": "6211429000",
|
|
71
|
-
"origin_country_name": "United States"
|
|
72
|
-
}, {
|
|
73
|
-
"quantity": 1,
|
|
74
|
-
"weight": 0.4,
|
|
75
|
-
"length": 0,
|
|
76
|
-
"width": 5,
|
|
77
|
-
"height": 7.75,
|
|
78
|
-
"sale_price": 15,
|
|
79
|
-
"hs_code": "4901990000",
|
|
50
|
+
"pieces": [
|
|
51
|
+
{
|
|
52
|
+
"quantity": 3,
|
|
53
|
+
"weight": 0.24999949875999997,
|
|
54
|
+
"length": 2.3,
|
|
55
|
+
"width": 2.3,
|
|
56
|
+
"height": 3.9,
|
|
57
|
+
"sale_price": 50.86333333333334,
|
|
58
|
+
"hs_code": 2936900000,
|
|
80
59
|
"origin_country_code": "US",
|
|
81
|
-
"material": "
|
|
82
|
-
"description": "
|
|
83
|
-
"sku": "
|
|
84
|
-
"category": [
|
|
60
|
+
"material": "wellbel glamlab Single International",
|
|
61
|
+
"description": "wellbel glamlab Single International",
|
|
62
|
+
"sku": "SKU",
|
|
63
|
+
"category": [
|
|
64
|
+
"wellbel glamlab - Single - International"
|
|
65
|
+
],
|
|
85
66
|
"line_item_id": "",
|
|
86
67
|
"product_id": "",
|
|
87
68
|
"variant_id": "",
|
|
88
|
-
"sale_price_usd":
|
|
89
|
-
"hs_code_real":
|
|
69
|
+
"sale_price_usd": 50.86,
|
|
70
|
+
"hs_code_real": 293690,
|
|
90
71
|
"update": true,
|
|
91
|
-
"hs_code_10":
|
|
72
|
+
"hs_code_10": 2936900000,
|
|
92
73
|
"origin_country_name": "United States"
|
|
93
|
-
|
|
74
|
+
},
|
|
75
|
+
{
|
|
94
76
|
"quantity": 1,
|
|
95
|
-
"weight":
|
|
96
|
-
"length":
|
|
97
|
-
"width":
|
|
98
|
-
"height":
|
|
99
|
-
"sale_price":
|
|
100
|
-
"hs_code":
|
|
77
|
+
"weight": 0.24999949875999997,
|
|
78
|
+
"length": 2.3,
|
|
79
|
+
"width": 2.3,
|
|
80
|
+
"height": 3.9,
|
|
81
|
+
"sale_price": 50.86333333333334,
|
|
82
|
+
"hs_code": 2936800000,
|
|
101
83
|
"origin_country_code": "US",
|
|
102
|
-
"material": "
|
|
103
|
-
"description": "
|
|
104
|
-
"sku": "
|
|
105
|
-
"category": [
|
|
84
|
+
"material": "wellbel glamlab Single International",
|
|
85
|
+
"description": "wellbel glamlab Single International",
|
|
86
|
+
"sku": "SKU",
|
|
87
|
+
"category": [
|
|
88
|
+
"wellbel glamlab - Single - International"
|
|
89
|
+
],
|
|
106
90
|
"line_item_id": "",
|
|
107
91
|
"product_id": "",
|
|
108
92
|
"variant_id": "",
|
|
109
|
-
"sale_price_usd":
|
|
110
|
-
"hs_code_real":
|
|
93
|
+
"sale_price_usd": 50.86,
|
|
94
|
+
"hs_code_real": 293680,
|
|
111
95
|
"update": true,
|
|
112
|
-
"hs_code_10":
|
|
96
|
+
"hs_code_10": 2936800000,
|
|
113
97
|
"origin_country_name": "United States"
|
|
114
|
-
|
|
98
|
+
}
|
|
99
|
+
],
|
|
115
100
|
"package": {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"customer_surcharge_type": "",
|
|
122
|
-
"weight_correction_value": 0,
|
|
123
|
-
"defaultName": "International Shipments",
|
|
124
|
-
"defaultCompanyName": "Thought Catalog",
|
|
125
|
-
"defaultPhoneNumber": "405-919-0068",
|
|
126
|
-
"defaultEmail": "noelle@thoughtcatalog.com",
|
|
127
|
-
"defaultTermsOfTrade": "DDP",
|
|
128
|
-
"defaultServiceCode": "EXPRESS",
|
|
129
|
-
"labelFormat": "PDF",
|
|
130
|
-
"total_weight": null
|
|
101
|
+
"length": 8,
|
|
102
|
+
"width": 6,
|
|
103
|
+
"height": 4,
|
|
104
|
+
"weight": 0.5,
|
|
105
|
+
"total_weight": null
|
|
131
106
|
},
|
|
132
|
-
"shipment_total":
|
|
107
|
+
"shipment_total": 152.59,
|
|
133
108
|
"invoice_date": "2018-01-01 01:01:01",
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"
|
|
138
|
-
"
|
|
109
|
+
"carrier": "landmark",
|
|
110
|
+
"rate_hash_key": "47927ec2-cbb5-45b5-85f6-9b47d641f8be",
|
|
111
|
+
"duty_hash_key": "",
|
|
112
|
+
"reason_for_export": "merchandise",
|
|
113
|
+
"customer_key": "",
|
|
114
|
+
"itn_number": "",
|
|
115
|
+
"is_return": "N",
|
|
116
|
+
"parter_api": true,
|
|
117
|
+
"flcl_customer_type": 1,
|
|
118
|
+
"pickUpDate": "",
|
|
119
|
+
"metadata": {
|
|
120
|
+
"india_export_info": {}
|
|
121
|
+
},
|
|
122
|
+
"b2b": false,
|
|
123
|
+
"isNewShipment": false,
|
|
124
|
+
"requestId": "c5fcdfd0-459d-11ee-9038-13c1842eab0d",
|
|
125
|
+
"rootRequestId": "9de56156-1297-4db3-b6d6-fe7d85c34871",
|
|
126
|
+
"public_api": true,
|
|
127
|
+
"userId": 3847,
|
|
128
|
+
"customerId": 3278,
|
|
129
|
+
"_personId": 3278,
|
|
130
|
+
"isRequestFromBigcommerce": false,
|
|
131
|
+
"weight_correction_value": 6.61,
|
|
132
|
+
"fc_shipping_cost_surcharge": "",
|
|
133
|
+
"fc_shipping_cost_surcharge_type": "percentage",
|
|
134
|
+
"partner_shipping_cost_surcharge": 53.85,
|
|
135
|
+
"partner_shipping_cost_surcharge_type": "percentage",
|
|
136
|
+
"landed_cost_surcharge": 15,
|
|
137
|
+
"landed_cost_surcharge_type": "percentage",
|
|
138
|
+
"consumer_commission": "",
|
|
139
|
+
"consumer_commission_type": "",
|
|
140
|
+
"consumer_commission_on_shipping": "",
|
|
141
|
+
"consumer_commission_on_landedcost": "",
|
|
142
|
+
"MerchantHasCustomRateCard": 0,
|
|
143
|
+
"CustomerID": 0,
|
|
144
|
+
"_3PLCustomerID": 2405,
|
|
145
|
+
"TaxId": 0,
|
|
146
|
+
"orderDataPhoneNumber": "+19876567898",
|
|
147
|
+
"targetFromCountry": "",
|
|
148
|
+
"targetToCountry": "",
|
|
149
|
+
"OriginCountryID": 226,
|
|
150
|
+
"DestinationCountryID": 38,
|
|
151
|
+
"DDUVat": 0,
|
|
152
|
+
"CountryRule": {
|
|
153
|
+
"MinimumThresholds": {
|
|
154
|
+
"duty": {
|
|
155
|
+
"fob": "CAD150"
|
|
156
|
+
},
|
|
157
|
+
"vat": {
|
|
158
|
+
"fob": "CAD40"
|
|
159
|
+
},
|
|
160
|
+
"ait": {
|
|
161
|
+
"fob": " "
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"FobFlag": 1
|
|
165
|
+
},
|
|
166
|
+
"shipment_total_usd": 153,
|
|
167
|
+
"currency_usd": "USD",
|
|
168
|
+
"empty_package_weight": 0,
|
|
169
|
+
"scalled_weight": 0.3,
|
|
170
|
+
"rate_api_shiping_usd": 72.79,
|
|
171
|
+
"rate_api_shiping": 72.79,
|
|
172
|
+
"rate_api_duty_usd": 0,
|
|
173
|
+
"rate_api_duty": 0,
|
|
139
174
|
"service_code_flcl": "standard",
|
|
140
|
-
"
|
|
141
|
-
|
|
175
|
+
"carrier_exclusion": "Canada Post,Delhivery,Deutsche Post,DHLEcommerce,ECMS,FIMS,InXpress,SEKO,SFExpress,WIZMO,DHL,FedEx,FedExCB,UPS,UPSMI,USPS",
|
|
176
|
+
"previous_rate_hash_key": "no hash key",
|
|
177
|
+
"flclRateId": 10722694,
|
|
178
|
+
"landedCostId": "",
|
|
179
|
+
"flcl_order_id": 1444676,
|
|
180
|
+
"order_id": 1444676,
|
|
181
|
+
"currencyRate": 1,
|
|
182
|
+
"_routeRules": {
|
|
183
|
+
"carriers": {
|
|
184
|
+
"inXpress": {
|
|
185
|
+
"weightUnit": "LB",
|
|
186
|
+
"tradeFreeFlag": 0,
|
|
187
|
+
"isDutiable": "Y",
|
|
188
|
+
"dutyPaymentType": "S",
|
|
189
|
+
"shipmentPaymentAccountNumber": 971644351,
|
|
190
|
+
"dutyPaymentAccountNumber": 971644351,
|
|
191
|
+
"serviceCode": {
|
|
192
|
+
"express": {
|
|
193
|
+
"duty": "P",
|
|
194
|
+
"nonDuty": "U"
|
|
195
|
+
},
|
|
196
|
+
"standard": {
|
|
197
|
+
"duty": "P",
|
|
198
|
+
"nonDuty": "U"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"rules": {
|
|
202
|
+
"price": "",
|
|
203
|
+
"weight": "",
|
|
204
|
+
"serviceLevel": "",
|
|
205
|
+
"categories": {
|
|
206
|
+
"inclusion": [],
|
|
207
|
+
"exclusion": []
|
|
208
|
+
},
|
|
209
|
+
"hsCode": {
|
|
210
|
+
"inclusion": [],
|
|
211
|
+
"exclusion": []
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"ups": {
|
|
216
|
+
"weightUnit": "LBS",
|
|
217
|
+
"serviceCode": {
|
|
218
|
+
"express": "08",
|
|
219
|
+
"standard": 11,
|
|
220
|
+
"ground": "03"
|
|
221
|
+
},
|
|
222
|
+
"rules": {
|
|
223
|
+
"price": "",
|
|
224
|
+
"weight": "",
|
|
225
|
+
"serviceLevel": "",
|
|
226
|
+
"categories": {
|
|
227
|
+
"inclusion": [],
|
|
228
|
+
"exclusion": []
|
|
229
|
+
},
|
|
230
|
+
"hsCode": {
|
|
231
|
+
"inclusion": [
|
|
232
|
+
711319,
|
|
233
|
+
711311
|
|
234
|
+
],
|
|
235
|
+
"exclusion": []
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"upsmi": {
|
|
240
|
+
"weightUnit": "OZ",
|
|
241
|
+
"serviceCode": {
|
|
242
|
+
"standard": "M5"
|
|
243
|
+
},
|
|
244
|
+
"rules": {}
|
|
245
|
+
},
|
|
246
|
+
"wizmo": {
|
|
247
|
+
"weightUnit": "LB",
|
|
248
|
+
"rules": {}
|
|
249
|
+
},
|
|
250
|
+
"dhl": {
|
|
251
|
+
"weightUnit": "LB",
|
|
252
|
+
"tradeFreeFlag": 0,
|
|
253
|
+
"isDutiable": "Y",
|
|
254
|
+
"dutyPaymentType": "S",
|
|
255
|
+
"shipmentPaymentAccountNumber": 847143348,
|
|
256
|
+
"dutyPaymentAccountNumber": 847143348,
|
|
257
|
+
"serviceCode": {
|
|
258
|
+
"express": {
|
|
259
|
+
"duty": "P",
|
|
260
|
+
"nonDuty": "P"
|
|
261
|
+
},
|
|
262
|
+
"standard": {
|
|
263
|
+
"duty": "P",
|
|
264
|
+
"nonDuty": "P"
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"rules": {
|
|
268
|
+
"price": "",
|
|
269
|
+
"weight": "",
|
|
270
|
+
"serviceLevel": "",
|
|
271
|
+
"categories": {
|
|
272
|
+
"inclusion": [],
|
|
273
|
+
"exclusion": []
|
|
274
|
+
},
|
|
275
|
+
"hsCode": {
|
|
276
|
+
"inclusion": [],
|
|
277
|
+
"exclusion": []
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"easyPost": {
|
|
282
|
+
"serviceCode": {
|
|
283
|
+
"express": "express",
|
|
284
|
+
"standard": "standard"
|
|
285
|
+
},
|
|
286
|
+
"carriersExclusions": {
|
|
287
|
+
"ddu": [
|
|
288
|
+
"Canada Post",
|
|
289
|
+
" USPS",
|
|
290
|
+
" GlobegisticsCA",
|
|
291
|
+
" GlobegisticsUSA",
|
|
292
|
+
" Deutsche Post"
|
|
293
|
+
],
|
|
294
|
+
"ddp": [
|
|
295
|
+
"Canada Post",
|
|
296
|
+
" USPS",
|
|
297
|
+
" GlobegisticsCA",
|
|
298
|
+
" GlobegisticsUSA",
|
|
299
|
+
" Deutsche Post"
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
"apc lax": {
|
|
304
|
+
"serviceCode": {
|
|
305
|
+
"standard": "standard"
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
"landmark": {
|
|
309
|
+
"serviceCode": {
|
|
310
|
+
"standard": "standard"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"apc ord": {
|
|
314
|
+
"serviceCode": {
|
|
315
|
+
"standard": "standard"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"sfexpress": {
|
|
319
|
+
"serviceCode": {
|
|
320
|
+
"economy": "economy",
|
|
321
|
+
"standard": "STANDARD"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"dhlecommerce": {
|
|
325
|
+
"serviceCode": {
|
|
326
|
+
"express": "EXPRESS",
|
|
327
|
+
"standard": "STANDARD"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"fims": {
|
|
331
|
+
"serviceCode": {
|
|
332
|
+
"express": "express",
|
|
333
|
+
"standard": "standard",
|
|
334
|
+
"standard-economy": "STANDARD-ECONOMY",
|
|
335
|
+
"express-economy": "EXPRESS-ECONOMY",
|
|
336
|
+
"economy": "economy"
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
"ecourierz": {
|
|
340
|
+
"serviceCode": {
|
|
341
|
+
"express": "EXPRESS",
|
|
342
|
+
"standard": "STANDARD",
|
|
343
|
+
"economy": "ECONOMY"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"fedex": {
|
|
347
|
+
"serviceCode": {
|
|
348
|
+
"express": "EXPRESS",
|
|
349
|
+
"standard": "STANDARD",
|
|
350
|
+
"ground": "FEDEX_GROUND",
|
|
351
|
+
"economy": "economy"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"asendiaca": {
|
|
355
|
+
"serviceCode": {
|
|
356
|
+
"standard": "standard",
|
|
357
|
+
"express": "express"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"asendiausa": {
|
|
361
|
+
"serviceCode": {
|
|
362
|
+
"standard": "standard"
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"fedexcb": {
|
|
366
|
+
"serviceCode": {
|
|
367
|
+
"standard": "STANDARD"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"ecms": {
|
|
371
|
+
"serviceCode": {
|
|
372
|
+
"standard": "STANDARD"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"delhivery": {
|
|
376
|
+
"serviceCode": {
|
|
377
|
+
"express": "EXPORTS_EXPRESS"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
"termsOfTrade": "DDP,DDU",
|
|
382
|
+
"defaultETDSupportedCarriers": [
|
|
383
|
+
"APC LAX",
|
|
384
|
+
"APC Logistics",
|
|
385
|
+
"landmark",
|
|
386
|
+
"APC ORD"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
"shipment_total_gbp": 0,
|
|
390
|
+
"shipment_total_eur": 0,
|
|
391
|
+
"dim_weight": 1.381294964028777,
|
|
392
|
+
"total_weight": 7.35999849628,
|
|
393
|
+
"weight_without_dim": 7.35999849628,
|
|
394
|
+
"_rateHashKey": "47927ec2-cbb5-45b5-85f6-9b47d641f8be",
|
|
395
|
+
"_rateProviderObj": {
|
|
396
|
+
"Provider": "landmark",
|
|
397
|
+
"DeliveryDays": "",
|
|
398
|
+
"FlclRateID": 10722694
|
|
399
|
+
},
|
|
400
|
+
"_carrierRateObj": {
|
|
401
|
+
"carrierrateid": 21513581,
|
|
402
|
+
"flclRateID": 10722694,
|
|
403
|
+
"providerrateid": 9437685,
|
|
404
|
+
"hashkey": "ZpPGix",
|
|
405
|
+
"carrier": "landmark",
|
|
406
|
+
"servicecode": "APC.PRIUDC",
|
|
407
|
+
"flclservicecode": "standard",
|
|
408
|
+
"termsoftrade": "DDU",
|
|
409
|
+
"easypostreferenceid": "",
|
|
410
|
+
"easypostrateid": "",
|
|
411
|
+
"isreturnrate": 0,
|
|
412
|
+
"rate": 72.79,
|
|
413
|
+
"duty": null,
|
|
414
|
+
"rateselected": null,
|
|
415
|
+
"labelgenerated": 0,
|
|
416
|
+
"deliverydays": "",
|
|
417
|
+
"createddate": "2023-08-25T03:20:07.000Z",
|
|
418
|
+
"modifieddate": "2023-08-25T03:20:07.000Z",
|
|
419
|
+
"landedCostId": null,
|
|
420
|
+
"actualCarrierRate": 47.31,
|
|
421
|
+
"uuid": "47927ec2-cbb5-45b5-85f6-9b47d641f8be"
|
|
422
|
+
},
|
|
423
|
+
"CustomerCommission": {
|
|
424
|
+
"Type": "percentage",
|
|
425
|
+
"Value": 0,
|
|
426
|
+
"Floor": 0,
|
|
427
|
+
"Cap": 0
|
|
428
|
+
},
|
|
429
|
+
"_carrier": "landmark",
|
|
430
|
+
"_customerTaxId": 0
|
|
431
|
+
};
|
|
142
432
|
async function create(){
|
|
143
433
|
try{
|
|
144
434
|
console.log('sampel gift');
|
|
145
435
|
|
|
146
|
-
let landmark = new LandMark(
|
|
436
|
+
let landmark = new LandMark("demoapi","demo123",false,'','','','');
|
|
147
437
|
let res = await landmark.createShipmet(request);
|
|
148
438
|
console.log(res);
|
|
149
439
|
return res;
|
package/tests/tracking.js
CHANGED
|
@@ -9,7 +9,7 @@ async function create(){
|
|
|
9
9
|
try{
|
|
10
10
|
console.log('sampel gift');
|
|
11
11
|
|
|
12
|
-
let landmark = new LandMark('demoapi','demo123','','','','');
|
|
12
|
+
let landmark = new LandMark('demoapi','demo123',false,'','','','');
|
|
13
13
|
let res = await landmark.getTrackingInfo(request);
|
|
14
14
|
console.log(res);
|
|
15
15
|
return res;
|