diff --git a/lib/predefinedOrders/HAC.js b/lib/predefinedOrders/HAC.js index 7700379..82f8f58 100644 --- a/lib/predefinedOrders/HAC.js +++ b/lib/predefinedOrders/HAC.js @@ -1,23 +1,13 @@ 'use strict'; -const dateRange = (start, end) => { - if (start && end) - return { - DateRange: { - Start: start, - End: end, - }, - }; - - return {}; -}; +const utils = require('../utils'); module.exports = (start = null, end = null) => ({ version: 'h004', orderDetails: { OrderType: 'HAC', OrderAttribute: 'DZHNN', - StandardOrderParams: dateRange(start, end), + StandardOrderParams: utils.dateRange(start, end), }, operation: 'download', }); diff --git a/lib/predefinedOrders/PTK.js b/lib/predefinedOrders/PTK.js index 37d5667..a0b7e77 100644 --- a/lib/predefinedOrders/PTK.js +++ b/lib/predefinedOrders/PTK.js @@ -1,23 +1,13 @@ 'use strict'; -const dateRange = (start, end) => { - if (start && end) - return { - DateRange: { - Start: start, - End: end, - }, - }; - - return {}; -}; +const utils = require('../utils'); module.exports = (start = null, end = null) => ({ version: 'h004', orderDetails: { OrderType: 'PTK', OrderAttribute: 'DZHNN', - StandardOrderParams: dateRange(start, end), + StandardOrderParams: utils.dateRange(start, end), }, operation: 'download', }); diff --git a/lib/predefinedOrders/STA.js b/lib/predefinedOrders/STA.js index 1a0b39e..4eb44e9 100644 --- a/lib/predefinedOrders/STA.js +++ b/lib/predefinedOrders/STA.js @@ -1,23 +1,13 @@ 'use strict'; -const dateRange = (start, end) => { - if (start && end) - return { - DateRange: { - Start: start, - End: end, - }, - }; - - return {}; -}; +const utils = require('../utils'); module.exports = (start = null, end = null) => ({ version: 'h004', orderDetails: { OrderType: 'STA', OrderAttribute: 'DZHNN', - StandardOrderParams: dateRange(start, end), + StandardOrderParams: utils.dateRange(start, end), }, operation: 'download', }); diff --git a/lib/predefinedOrders/VMK.js b/lib/predefinedOrders/VMK.js index e2bcc9b..315af09 100644 --- a/lib/predefinedOrders/VMK.js +++ b/lib/predefinedOrders/VMK.js @@ -1,23 +1,13 @@ 'use strict'; -const dateRange = (start, end) => { - if (start && end) - return { - DateRange: { - Start: start, - End: end, - }, - }; - - return {}; -}; +const utils = require('../utils'); module.exports = (start = null, end = null) => ({ version: 'h004', orderDetails: { OrderType: 'VMK', OrderAttribute: 'DZHNN', - StandardOrderParams: dateRange(start, end), + StandardOrderParams: utils.dateRange(start, end), }, operation: 'download', }); diff --git a/lib/predefinedOrders/Z53.js b/lib/predefinedOrders/Z53.js new file mode 100644 index 0000000..d196841 --- /dev/null +++ b/lib/predefinedOrders/Z53.js @@ -0,0 +1,13 @@ +'use strict'; + +const utils = require('../utils'); + +module.exports = (start = null, end = null) => ({ + version: 'h004', + orderDetails: { + OrderType: 'Z53', + OrderAttribute: 'DZHNN', + StandardOrderParams: utils.dateRange(start, end), + }, + operation: 'download', +}); diff --git a/lib/predefinedOrders/index.js b/lib/predefinedOrders/index.js index 6109796..18e4f49 100644 --- a/lib/predefinedOrders/index.js +++ b/lib/predefinedOrders/index.js @@ -22,11 +22,13 @@ const HPD = require('./HPD'); const HKD = require('./HKD'); const PTK = require('./PTK'); const HAC = require('./HAC'); +const Z53 = require('./Z53'); module.exports = { INI, HIA, HPB, + Z53, AZV, CD1, diff --git a/lib/utils.js b/lib/utils.js new file mode 100644 index 0000000..3390ead --- /dev/null +++ b/lib/utils.js @@ -0,0 +1,18 @@ +'use strict'; + +const dateRange = (start, end) => { + if (start && end) + return { + DateRange: { + Start: start, + End: end, + }, + }; + + return {}; +}; + + +module.exports = { + dateRange, +};