fc-landmark 1.0.2 → 1.0.4
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/core.js +2 -1
- package/dist/core.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/landmark.js +5 -3
- package/dist/landmark.js.map +1 -1
- package/dist/shipment.js +77 -36
- package/dist/shipment.js.map +1 -1
- package/dist/tracking.js +2 -2
- package/dist/tracking.js.map +1 -1
- package/package.json +31 -31
- package/src/landmark.ts +6 -2
- package/src/shipment.ts +77 -34
- package/src/tracking.ts +1 -1
package/dist/core.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.setRequredGlobals = void 0;
|
|
7
7
|
const globals_1 = require("./globals");
|
|
8
8
|
const axios_1 = __importDefault(require("./axios"));
|
|
9
|
-
|
|
9
|
+
const setRequredGlobals = (logger, flclerror, rootRequestId, requestId) => {
|
|
10
10
|
globals_1.MyGlobal.logger = logger || undefined;
|
|
11
11
|
globals_1.MyGlobal.flclError = flclerror || undefined;
|
|
12
12
|
globals_1.MyGlobal.rootRequestId = rootRequestId || '';
|
|
@@ -15,4 +15,5 @@ exports.setRequredGlobals = (logger, flclerror, rootRequestId, requestId) => {
|
|
|
15
15
|
globals_1.MyGlobal.ship_url = "https://api.landmarkglobal.com/v2/Import.php",
|
|
16
16
|
globals_1.MyGlobal.track_url = "https://api.landmarkglobal.com/v2/Track.php";
|
|
17
17
|
};
|
|
18
|
+
exports.setRequredGlobals = setRequredGlobals;
|
|
18
19
|
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAE5C,oDAAsC;
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAE5C,oDAAsC;AAC/B,MAAM,iBAAiB,GAAG,CAAC,MAAmB,EAAE,SAAqB,EAAE,aAAsB,EAAE,SAAkB,EAAE,EAAE;IACxH,kBAAG,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC;IACjC,kBAAG,CAAC,SAAS,GAAG,SAAS,IAAI,SAAS,CAAC;IACvC,kBAAG,CAAC,aAAa,GAAG,aAAa,IAAI,EAAE,CAAC;IACxC,kBAAG,CAAC,SAAS,GAAG,SAAS,IAAI,EAAE,CAAC;IAChC,kBAAG,CAAC,KAAK,GAAG,eAAe,CAAC;IAC5B,kBAAG,CAAC,QAAQ,GAAG,8CAA8C;QAC7D,kBAAG,CAAC,SAAS,GAAG,6CAA6C,CAAA;AACjE,CAAC,CAAA;AARY,QAAA,iBAAiB,qBAQ7B"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LandMark = void 0;
|
|
3
4
|
var landmark_1 = require("./landmark");
|
|
4
5
|
Object.defineProperty(exports, "LandMark", { enumerable: true, get: function () { return landmark_1.LandMark; } });
|
|
5
6
|
//export default ECMS;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AAA7B,oGAAA,QAAQ,OAAA;AAElB,sBAAsB"}
|
package/dist/landmark.js
CHANGED
|
@@ -18,12 +18,14 @@ 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, clientId, test, logger, flclerror, rootRequestId, requestId) {
|
|
21
|
+
constructor(username, password, clientId, test, vendorEORINumber, vendorIOSSNumber, logger, flclerror, rootRequestId, requestId) {
|
|
22
22
|
this.username = username;
|
|
23
23
|
this.password = password;
|
|
24
24
|
this.test = test;
|
|
25
25
|
this.clientId = clientId;
|
|
26
|
-
|
|
26
|
+
this.vendorEORINumber = vendorEORINumber;
|
|
27
|
+
this.vendorIOSSNumber = vendorIOSSNumber;
|
|
28
|
+
(0, core_1.setRequredGlobals)(logger, flclerror, rootRequestId, requestId);
|
|
27
29
|
}
|
|
28
30
|
createShipmet(args) {
|
|
29
31
|
var _a, _b, _c, _d;
|
|
@@ -31,7 +33,7 @@ class LandMark {
|
|
|
31
33
|
try {
|
|
32
34
|
let shipObj = new shipment_1.default();
|
|
33
35
|
(_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);
|
|
36
|
+
let landmarkShipmentRequest = shipObj.buildShipmentRequest(args, this.username, this.password, this.test, this.clientId, this.vendorEORINumber, this.vendorIOSSNumber);
|
|
35
37
|
(_b = globals_1.MyGlobal.logger) === null || _b === void 0 ? void 0 : _b.info({ npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentRequest', propertyValue: landmarkShipmentRequest });
|
|
36
38
|
let landmarkShipmentRes = yield shipObj.createShipment(landmarkShipmentRequest);
|
|
37
39
|
if (landmarkShipmentRes.hasOwnProperty("ImportResponse") && landmarkShipmentRes['ImportResponse']['Errors']) {
|
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;AA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O,QAAQ,CAAC;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,CAAC,CAAC;gBACrN,MAAM,CAAC,CAAC;aACX;;KACJ;CACJ;AAxDD,4BAwDC"}
|
package/dist/shipment.js
CHANGED
|
@@ -14,43 +14,73 @@ const xml_js_1 = require("xml-js");
|
|
|
14
14
|
class Shipment {
|
|
15
15
|
constructor() {
|
|
16
16
|
}
|
|
17
|
-
getConsignee(
|
|
18
|
-
const combinedAddress =
|
|
17
|
+
getConsignee(shipto_address, targetToCountry) {
|
|
18
|
+
const combinedAddress = shipto_address.address_line_1 + shipto_address.address_line_2 + shipto_address.address_line_3;
|
|
19
19
|
let consignee = {
|
|
20
|
-
"Name":
|
|
21
|
-
"Attention":
|
|
20
|
+
"Name": shipto_address.name.slice(0, 50),
|
|
21
|
+
"Attention": shipto_address.attention_name.slice(0, 50),
|
|
22
22
|
"Address1": combinedAddress.substring(0, 60),
|
|
23
23
|
"Address2": combinedAddress.substring(61, 120),
|
|
24
24
|
"Address3": combinedAddress.substring(121, 180),
|
|
25
|
-
"City":
|
|
26
|
-
"State":
|
|
27
|
-
"PostalCode":
|
|
28
|
-
"Country":
|
|
29
|
-
"Phone":
|
|
30
|
-
"Email":
|
|
31
|
-
"ConsigneeTaxID":
|
|
25
|
+
"City": shipto_address.city,
|
|
26
|
+
"State": shipto_address.state,
|
|
27
|
+
"PostalCode": shipto_address.zip,
|
|
28
|
+
"Country": targetToCountry ? targetToCountry : shipto_address.country,
|
|
29
|
+
"Phone": shipto_address.phone.toString(),
|
|
30
|
+
"Email": shipto_address.email,
|
|
31
|
+
"ConsigneeTaxID": shipto_address.federal_tax_id ? shipto_address.federal_tax_id : ""
|
|
32
32
|
};
|
|
33
33
|
return consignee;
|
|
34
34
|
}
|
|
35
|
-
getShipperInfo(
|
|
36
|
-
const combinedAddress =
|
|
35
|
+
getShipperInfo(shipfrom_address, targetFromCountry) {
|
|
36
|
+
const combinedAddress = shipfrom_address.address_line_1 + shipfrom_address.address_line_2 + shipfrom_address.address_line_3;
|
|
37
37
|
let shipper = {
|
|
38
|
-
"Name":
|
|
39
|
-
"Attention":
|
|
38
|
+
"Name": shipfrom_address.name.slice(0, 50),
|
|
39
|
+
"Attention": shipfrom_address.attention_name.slice(0, 50),
|
|
40
40
|
"Address1": combinedAddress.substring(0, 60),
|
|
41
41
|
"Address2": combinedAddress.substring(61, 120),
|
|
42
42
|
"Address3": combinedAddress.substring(121, 180),
|
|
43
|
-
"City":
|
|
44
|
-
"State":
|
|
45
|
-
"PostalCode":
|
|
46
|
-
"Country":
|
|
47
|
-
"Phone":
|
|
48
|
-
"Email":
|
|
43
|
+
"City": shipfrom_address.city,
|
|
44
|
+
"State": shipfrom_address.state,
|
|
45
|
+
"PostalCode": shipfrom_address.zip,
|
|
46
|
+
"Country": targetFromCountry ? targetFromCountry : shipfrom_address.country,
|
|
47
|
+
"Phone": shipfrom_address.phone.toString(),
|
|
48
|
+
"Email": shipfrom_address.email
|
|
49
49
|
};
|
|
50
50
|
return shipper;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
getVendorInfo(shipfrom_address, targetFromCountry, eroiNumber, iossNumber) {
|
|
53
|
+
const combinedAddress = shipfrom_address.address_line_1 + shipfrom_address.address_line_2 + shipfrom_address.address_line_3;
|
|
54
|
+
let shipper = {
|
|
55
|
+
"VendorName": shipfrom_address.name.slice(0, 50),
|
|
56
|
+
"Attention": shipfrom_address.attention_name.slice(0, 50),
|
|
57
|
+
"VendorAddress1": combinedAddress.substring(0, 60),
|
|
58
|
+
"VendorAddress2": combinedAddress.substring(61, 120),
|
|
59
|
+
"VendorAddress3": combinedAddress.substring(121, 180),
|
|
60
|
+
"VendorCity": shipfrom_address.city,
|
|
61
|
+
"VendorState": shipfrom_address.state,
|
|
62
|
+
"VendorPostalCode": shipfrom_address.zip,
|
|
63
|
+
"VendorCountry": targetFromCountry ? targetFromCountry : shipfrom_address.country,
|
|
64
|
+
"VendorPhone": shipfrom_address.phone.toString(),
|
|
65
|
+
"VendorEmail": shipfrom_address.email,
|
|
66
|
+
"VendorBusinessNumber": "",
|
|
67
|
+
"VendorRGRNumber": "",
|
|
68
|
+
"VendorIOSSNumber": iossNumber,
|
|
69
|
+
"VendorEORINumber": eroiNumber
|
|
70
|
+
};
|
|
71
|
+
return shipper;
|
|
72
|
+
}
|
|
73
|
+
buildShipmentRequest(args, username, password, test, clientId, vendorEORINumber, vendorIOSSNumber) {
|
|
53
74
|
try {
|
|
75
|
+
const EUCountries = ["BE", "BG", "CZ", "DK", "DE", "EE", "IE", "EL", "ES", "FR", "HR", "IT", "CY", "LV", "LT", "LU", "HU", "MT", "NL", "AT", "PL", "PT", "RO", "SI", "SK", "FI", "SE"];
|
|
76
|
+
let iossNumber = "";
|
|
77
|
+
if (EUCountries.indexOf(args.shipto_address.country.toUpperCase()) != -1 || EUCountries.indexOf(args.targetToCountry.toUpperCase()) != -1) {
|
|
78
|
+
iossNumber = vendorIOSSNumber;
|
|
79
|
+
}
|
|
80
|
+
let eroiNumber = "";
|
|
81
|
+
if (args.shipto_address.country.toUpperCase() == "GB" || args.shipto_address.country.toUpperCase() == "UK") {
|
|
82
|
+
eroiNumber = vendorEORINumber;
|
|
83
|
+
}
|
|
54
84
|
let importRequest = {
|
|
55
85
|
"Login": {
|
|
56
86
|
"Username": username,
|
|
@@ -59,7 +89,7 @@ class Shipment {
|
|
|
59
89
|
"Test": test,
|
|
60
90
|
"ClientID": clientId,
|
|
61
91
|
"Reference": args.reference,
|
|
62
|
-
"ShipTo": this.getConsignee(args),
|
|
92
|
+
"ShipTo": this.getConsignee(args.shipto_address, args.targetToCountry),
|
|
63
93
|
"ShippingLane": {
|
|
64
94
|
"Region": "Landmark BUF"
|
|
65
95
|
},
|
|
@@ -80,25 +110,36 @@ class Shipment {
|
|
|
80
110
|
"PackageReference": args.reference
|
|
81
111
|
}
|
|
82
112
|
},
|
|
83
|
-
"SendReturnToAddress": this.getShipperInfo(args),
|
|
113
|
+
"SendReturnToAddress": this.getShipperInfo(args.shipfrom_address, args.targetFromCountry),
|
|
114
|
+
"VendorInformation": this.getVendorInfo(args.shipfrom_address, args.targetFromCountry, eroiNumber, iossNumber),
|
|
84
115
|
"IsCommercialShipment": args.b2b ? 1 : 0,
|
|
85
116
|
};
|
|
117
|
+
// let items = args.pieces.map((item:any)=>{
|
|
118
|
+
// return {"Item":{
|
|
119
|
+
// "Sku": item.sku || 12345,
|
|
120
|
+
// "Description": item.description.substr(0,100),
|
|
121
|
+
// "Quantity": item.quantity,
|
|
122
|
+
// "UnitPrice": (item.sale_price == 0) ? 0.01 : item.sale_price,
|
|
123
|
+
// "HSCode": item.hs_code,
|
|
124
|
+
// "CountryOfOrigin": item.origin_country_code
|
|
125
|
+
// }
|
|
126
|
+
// }
|
|
127
|
+
// })
|
|
86
128
|
let items = args.pieces.map((item) => {
|
|
87
|
-
return {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
129
|
+
return {
|
|
130
|
+
"Sku": item.sku || 12345,
|
|
131
|
+
"Description": item.description.substr(0, 100),
|
|
132
|
+
"Quantity": item.quantity,
|
|
133
|
+
"UnitPrice": (item.sale_price == 0) ? 0.01 : item.sale_price,
|
|
134
|
+
"HSCode": item.hs_code,
|
|
135
|
+
"CountryOfOrigin": item.origin_country_code
|
|
95
136
|
};
|
|
96
137
|
});
|
|
97
|
-
importRequest["Items"] = items;
|
|
138
|
+
importRequest["Items"] = { "Item": items };
|
|
98
139
|
let request = {
|
|
99
140
|
"ImportRequest": importRequest
|
|
100
141
|
};
|
|
101
|
-
const xmlData = xml_js_1.js2xml(request, { compact: true, ignoreComment: true, spaces: 4 });
|
|
142
|
+
const xmlData = (0, xml_js_1.js2xml)(request, { compact: true, ignoreComment: true, spaces: 4 });
|
|
102
143
|
return xmlData;
|
|
103
144
|
}
|
|
104
145
|
catch (e) {
|
|
@@ -117,7 +158,7 @@ class Shipment {
|
|
|
117
158
|
let resp = yield globals_1.MyGlobal.axios.post(globals_1.MyGlobal.ship_url, ShipmentRequest, configs);
|
|
118
159
|
console.log(resp.data);
|
|
119
160
|
(_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
|
-
let responsejson = xml_js_1.xml2json(resp.data, { compact: true, spaces: 4 });
|
|
161
|
+
let responsejson = (0, xml_js_1.xml2json)(resp.data, { compact: true, spaces: 4 });
|
|
121
162
|
return JSON.parse(responsejson);
|
|
122
163
|
}
|
|
123
164
|
catch (e) {
|
|
@@ -138,7 +179,7 @@ class Shipment {
|
|
|
138
179
|
label_type: args.label_format.toLowerCase() == "zpl" ? "zplenc" : "url",
|
|
139
180
|
gross_weight: args.total_weight,
|
|
140
181
|
gross_weight_unit: args.weight_unit,
|
|
141
|
-
submitted_electronically:
|
|
182
|
+
submitted_electronically: true
|
|
142
183
|
};
|
|
143
184
|
return response;
|
|
144
185
|
}
|
package/dist/shipment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipment.js","sourceRoot":"","sources":["../src/shipment.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,uCAA4C;AAC5C,mCAA0C;AAE1C,MAAqB,QAAQ;IACzB;IAEA,CAAC;IACD,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"shipment.js","sourceRoot":"","sources":["../src/shipment.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,uCAA4C;AAC5C,m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AAO,QAAQ,CAAC;IACpB,CAAC;CAEJ;AA/KD,2BA+KC"}
|
package/dist/tracking.js
CHANGED
|
@@ -29,7 +29,7 @@ class Tracking {
|
|
|
29
29
|
let request = {
|
|
30
30
|
"TrackRequest": trackRequest
|
|
31
31
|
};
|
|
32
|
-
const xmlData = xml_js_1.js2xml(request, { compact: true, ignoreComment: true, spaces: 4 });
|
|
32
|
+
const xmlData = (0, xml_js_1.js2xml)(request, { compact: true, ignoreComment: true, spaces: 4 });
|
|
33
33
|
return xmlData;
|
|
34
34
|
}
|
|
35
35
|
catch (e) {
|
|
@@ -47,7 +47,7 @@ class Tracking {
|
|
|
47
47
|
};
|
|
48
48
|
let resp = yield globals_1.MyGlobal.axios.post(globals_1.MyGlobal.track_url, ShipmentRequest, configs);
|
|
49
49
|
(_a = globals_1.MyGlobal.logger) === null || _a === void 0 ? void 0 : _a.info({ npm: 'fc-landmark', className: 'Tracking', methodName: 'trackInfo', propertyName: 'landmark-RAW-RESPOSNE', propertyValue: resp.data });
|
|
50
|
-
let responsejson = xml_js_1.xml2json(resp.data, { compact: true, spaces: 4 });
|
|
50
|
+
let responsejson = (0, xml_js_1.xml2json)(resp.data, { compact: true, spaces: 4 });
|
|
51
51
|
return JSON.parse(responsejson);
|
|
52
52
|
}
|
|
53
53
|
catch (e) {
|
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,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;gBAC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C,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC;YACxH,IAAI,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAChD,OAAO,CAAC,UAAU,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC;YAC3C,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAG,EAAE,CAAC;YAC7H,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC3H,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;YACrB,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SAC3C;QACL,OAAO,QAAQ,CAAC;IAChB,CAAC;CACJ;AA9ED,2BA8EC"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fc-landmark",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "landmark Shipment and Tracking API.",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rm -rf ./dist && tsc",
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
-
},
|
|
10
|
-
"author": "Midhun",
|
|
11
|
-
"license": "ISC",
|
|
12
|
-
"dependencies": {
|
|
13
|
-
"@types/xml2js"
|
|
14
|
-
"@types/redis": "^2.8.25",
|
|
15
|
-
"@types/redlock": "^4.0.1",
|
|
16
|
-
"@types/uuid": "^8.3.0",
|
|
17
|
-
"app-root-path": "^3.0.0",
|
|
18
|
-
"axios": "^0.19.0",
|
|
19
|
-
"fc-logger": "^
|
|
20
|
-
"fs": "0.0.1-security",
|
|
21
|
-
"redis": "^3.0.2",
|
|
22
|
-
"redlock": "^4.1.0",
|
|
23
|
-
"request": "^2.88.2",
|
|
24
|
-
"uuid": "^8.3.0",
|
|
25
|
-
"xml-js"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@types/request": "^2.48.7",
|
|
29
|
-
"typescript": "^
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "fc-landmark",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "landmark Shipment and Tracking API.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rm -rf ./dist && tsc",
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"author": "Midhun",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@types/xml2js": "0.4.11",
|
|
14
|
+
"@types/redis": "^2.8.25",
|
|
15
|
+
"@types/redlock": "^4.0.1",
|
|
16
|
+
"@types/uuid": "^8.3.0",
|
|
17
|
+
"app-root-path": "^3.0.0",
|
|
18
|
+
"axios": "^0.19.0",
|
|
19
|
+
"fc-logger": "^4.2.0",
|
|
20
|
+
"fs": "0.0.1-security",
|
|
21
|
+
"redis": "^3.0.2",
|
|
22
|
+
"redlock": "^4.1.0",
|
|
23
|
+
"request": "^2.88.2",
|
|
24
|
+
"uuid": "^8.3.0",
|
|
25
|
+
"xml-js": "1.6.11"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/request": "^2.48.7",
|
|
29
|
+
"typescript": "^4.9.5"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/landmark.ts
CHANGED
|
@@ -9,11 +9,15 @@ export class LandMark {
|
|
|
9
9
|
private password : string;
|
|
10
10
|
private test : boolean;
|
|
11
11
|
private clientId : number;
|
|
12
|
-
|
|
12
|
+
private vendorEORINumber : string;
|
|
13
|
+
private vendorIOSSNumber : string;
|
|
14
|
+
constructor(username:string,password:string,clientId:number,test:boolean,vendorEORINumber:string,vendorIOSSNumber:string, logger?: FlclLogger, flclerror?: FlclError, rootRequestId?: string, requestId?: string) {
|
|
13
15
|
this.username = username;
|
|
14
16
|
this.password = password;
|
|
15
17
|
this.test = test;
|
|
16
18
|
this.clientId = clientId;
|
|
19
|
+
this.vendorEORINumber = vendorEORINumber;
|
|
20
|
+
this.vendorIOSSNumber = vendorIOSSNumber;
|
|
17
21
|
setRequredGlobals(logger, flclerror, rootRequestId, requestId);
|
|
18
22
|
}
|
|
19
23
|
|
|
@@ -22,7 +26,7 @@ export class LandMark {
|
|
|
22
26
|
|
|
23
27
|
let shipObj = new Shipment();
|
|
24
28
|
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);
|
|
29
|
+
let landmarkShipmentRequest: string = shipObj.buildShipmentRequest(args,this.username,this.password,this.test,this.clientId,this.vendorEORINumber,this.vendorIOSSNumber);
|
|
26
30
|
app.logger?.info({npm: 'fc-landmark', className: 'Landmark', methodName: 'createShipmet', propertyName: 'landMarkShipmentRequest', propertyValue: landmarkShipmentRequest});
|
|
27
31
|
let landmarkShipmentRes: any = await shipObj.createShipment(landmarkShipmentRequest);
|
|
28
32
|
if(landmarkShipmentRes.hasOwnProperty("ImportResponse") && landmarkShipmentRes['ImportResponse']['Errors']){
|
package/src/shipment.ts
CHANGED
|
@@ -6,45 +6,77 @@ export default class Shipment {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
|
|
8
8
|
}
|
|
9
|
-
getConsignee(
|
|
9
|
+
getConsignee(shipto_address: any,targetToCountry:any): any {
|
|
10
10
|
|
|
11
|
-
const combinedAddress =
|
|
11
|
+
const combinedAddress = shipto_address.address_line_1 + shipto_address.address_line_2 + shipto_address.address_line_3;
|
|
12
12
|
let consignee: any = {
|
|
13
|
-
"Name":
|
|
14
|
-
"Attention":
|
|
13
|
+
"Name": shipto_address.name.slice(0, 50) ,
|
|
14
|
+
"Attention": shipto_address.attention_name.slice(0, 50) ,
|
|
15
15
|
"Address1": combinedAddress.substring(0,60),
|
|
16
16
|
"Address2": combinedAddress.substring(61,120),
|
|
17
17
|
"Address3": combinedAddress.substring(121,180),
|
|
18
|
-
"City":
|
|
19
|
-
"State":
|
|
20
|
-
"PostalCode":
|
|
21
|
-
"Country":
|
|
22
|
-
"Phone":
|
|
23
|
-
"Email":
|
|
24
|
-
"ConsigneeTaxID":
|
|
18
|
+
"City": shipto_address.city,
|
|
19
|
+
"State": shipto_address.state,
|
|
20
|
+
"PostalCode": shipto_address.zip,
|
|
21
|
+
"Country": targetToCountry ? targetToCountry : shipto_address.country,
|
|
22
|
+
"Phone": shipto_address.phone.toString(),
|
|
23
|
+
"Email": shipto_address.email,
|
|
24
|
+
"ConsigneeTaxID": shipto_address.federal_tax_id ? shipto_address.federal_tax_id : ""
|
|
25
25
|
};
|
|
26
26
|
return consignee;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
getShipperInfo(
|
|
30
|
-
const combinedAddress =
|
|
29
|
+
getShipperInfo(shipfrom_address: any,targetFromCountry:any) {
|
|
30
|
+
const combinedAddress = shipfrom_address.address_line_1 + shipfrom_address.address_line_2 + shipfrom_address.address_line_3;
|
|
31
31
|
let shipper: any = {
|
|
32
|
-
"Name":
|
|
33
|
-
"Attention":
|
|
32
|
+
"Name": shipfrom_address.name.slice(0, 50) ,
|
|
33
|
+
"Attention": shipfrom_address.attention_name.slice(0, 50) ,
|
|
34
34
|
"Address1": combinedAddress.substring(0,60),
|
|
35
35
|
"Address2": combinedAddress.substring(61,120),
|
|
36
36
|
"Address3": combinedAddress.substring(121,180),
|
|
37
|
-
"City":
|
|
38
|
-
"State":
|
|
39
|
-
"PostalCode":
|
|
40
|
-
"Country":
|
|
41
|
-
"Phone":
|
|
42
|
-
"Email":
|
|
37
|
+
"City": shipfrom_address.city,
|
|
38
|
+
"State": shipfrom_address.state,
|
|
39
|
+
"PostalCode": shipfrom_address.zip,
|
|
40
|
+
"Country": targetFromCountry ? targetFromCountry : shipfrom_address.country,
|
|
41
|
+
"Phone": shipfrom_address.phone.toString(),
|
|
42
|
+
"Email": shipfrom_address.email
|
|
43
43
|
};
|
|
44
44
|
return shipper;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
getVendorInfo(shipfrom_address: any,targetFromCountry:any,eroiNumber:any,iossNumber:any) {
|
|
48
|
+
const combinedAddress = shipfrom_address.address_line_1 + shipfrom_address.address_line_2 + shipfrom_address.address_line_3;
|
|
49
|
+
let shipper: any = {
|
|
50
|
+
"VendorName": shipfrom_address.name.slice(0, 50) ,
|
|
51
|
+
"Attention": shipfrom_address.attention_name.slice(0, 50) ,
|
|
52
|
+
"VendorAddress1": combinedAddress.substring(0,60),
|
|
53
|
+
"VendorAddress2": combinedAddress.substring(61,120),
|
|
54
|
+
"VendorAddress3": combinedAddress.substring(121,180),
|
|
55
|
+
"VendorCity": shipfrom_address.city,
|
|
56
|
+
"VendorState": shipfrom_address.state,
|
|
57
|
+
"VendorPostalCode": shipfrom_address.zip,
|
|
58
|
+
"VendorCountry": targetFromCountry ? targetFromCountry : shipfrom_address.country,
|
|
59
|
+
"VendorPhone": shipfrom_address.phone.toString(),
|
|
60
|
+
"VendorEmail": shipfrom_address.email,
|
|
61
|
+
"VendorBusinessNumber": "",
|
|
62
|
+
"VendorRGRNumber":"",
|
|
63
|
+
"VendorIOSSNumber":iossNumber,
|
|
64
|
+
"VendorEORINumber":eroiNumber
|
|
65
|
+
};
|
|
66
|
+
return shipper;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
buildShipmentRequest(args: any,username:string,password:string,test:boolean,clientId:number,vendorEORINumber:any,vendorIOSSNumber:any): string{
|
|
47
70
|
try {
|
|
71
|
+
const EUCountries = ["BE", "BG", "CZ", "DK", "DE", "EE", "IE", "EL", "ES", "FR", "HR", "IT", "CY", "LV", "LT", "LU", "HU", "MT", "NL", "AT", "PL", "PT", "RO", "SI", "SK", "FI", "SE"];
|
|
72
|
+
let iossNumber=""
|
|
73
|
+
if( EUCountries.indexOf(args.shipto_address.country.toUpperCase()) != -1 || EUCountries.indexOf(args.targetToCountry.toUpperCase()) != -1 ){
|
|
74
|
+
iossNumber = vendorIOSSNumber
|
|
75
|
+
}
|
|
76
|
+
let eroiNumber=""
|
|
77
|
+
if(args.shipto_address.country.toUpperCase() == "GB" || args.shipto_address.country.toUpperCase() == "UK"){
|
|
78
|
+
eroiNumber = vendorEORINumber
|
|
79
|
+
}
|
|
48
80
|
let importRequest :any = {
|
|
49
81
|
"Login": {
|
|
50
82
|
"Username": username,
|
|
@@ -53,7 +85,7 @@ export default class Shipment {
|
|
|
53
85
|
"Test": test,
|
|
54
86
|
"ClientID": clientId ,
|
|
55
87
|
"Reference": args.reference,
|
|
56
|
-
"ShipTo": this.getConsignee(
|
|
88
|
+
"ShipTo": this.getConsignee(args.shipto_address,args.targetToCountry),
|
|
57
89
|
"ShippingLane": {
|
|
58
90
|
"Region" : "Landmark BUF"
|
|
59
91
|
},
|
|
@@ -74,21 +106,32 @@ export default class Shipment {
|
|
|
74
106
|
"PackageReference":args.reference
|
|
75
107
|
}
|
|
76
108
|
},
|
|
77
|
-
"SendReturnToAddress": this.getShipperInfo(args),
|
|
109
|
+
"SendReturnToAddress": this.getShipperInfo(args.shipfrom_address,args.targetFromCountry),
|
|
110
|
+
"VendorInformation": this.getVendorInfo(args.shipfrom_address,args.targetFromCountry,eroiNumber,iossNumber),
|
|
78
111
|
"IsCommercialShipment": args.b2b ? 1 : 0,
|
|
79
112
|
}
|
|
80
|
-
let items = args.pieces.map((item:any)=>{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
// let items = args.pieces.map((item:any)=>{
|
|
114
|
+
// return {"Item":{
|
|
115
|
+
// "Sku": item.sku || 12345,
|
|
116
|
+
// "Description": item.description.substr(0,100),
|
|
117
|
+
// "Quantity": item.quantity,
|
|
118
|
+
// "UnitPrice": (item.sale_price == 0) ? 0.01 : item.sale_price,
|
|
119
|
+
// "HSCode": item.hs_code,
|
|
120
|
+
// "CountryOfOrigin": item.origin_country_code
|
|
121
|
+
// }
|
|
122
|
+
// }
|
|
123
|
+
// })
|
|
124
|
+
let items = args.pieces.map((item:any) => {
|
|
125
|
+
return {
|
|
126
|
+
"Sku": item.sku || 12345,
|
|
127
|
+
"Description": item.description.substr(0, 100),
|
|
84
128
|
"Quantity": item.quantity,
|
|
85
|
-
"UnitPrice":
|
|
129
|
+
"UnitPrice": (item.sale_price == 0) ? 0.01 : item.sale_price,
|
|
86
130
|
"HSCode": item.hs_code,
|
|
87
131
|
"CountryOfOrigin": item.origin_country_code
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
importRequest["Items"] = items
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
importRequest["Items"] = { "Item": items };
|
|
92
135
|
let request :any = {
|
|
93
136
|
"ImportRequest": importRequest
|
|
94
137
|
}
|
|
@@ -129,7 +172,7 @@ export default class Shipment {
|
|
|
129
172
|
label_type: args.label_format.toLowerCase() == "zpl" ? "zplenc" : "url",
|
|
130
173
|
gross_weight: args.total_weight,
|
|
131
174
|
gross_weight_unit: args.weight_unit,
|
|
132
|
-
submitted_electronically:
|
|
175
|
+
submitted_electronically: true
|
|
133
176
|
};
|
|
134
177
|
return response;
|
|
135
178
|
}
|
package/src/tracking.ts
CHANGED