forked from elanic-tech/angarum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
23 lines (20 loc) · 848 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module.exports.Order = require('./Schemas/order_schema.js');
module.exports.Track = require('./Schemas/track_schema.js');
module.exports.Cancel = require('./Schemas/cancel_schema.js');
module.exports.TrackingStatus = require('./Schemas/tracking_status_schema.js');
var partners = {
'pickrr': require('./Partners/pickrr.js'),
'pyck': require('./Partners/pyck.js'),
'pigeon': require('./Partners/pigeon.js'),
'delhivery': require('./Partners/delhivery.js'),
'nuvoex': require('./Partners/nuvoex.js'),
'shadowfax': require('./Partners/shadowfax.js'),
'xpressbees': require('./Partners/xpressbees.js'),
};
//helper methods
module.exports.Partner = function(partner) {
if (partner.toLowerCase() in partners)
return new partners[partner.toLowerCase()]();
else
throw Error("Partner: " + partner + " not found");
}