@cumulus/integration-tests 21.0.1 → 21.2.0
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/cmr.js +11 -2
- package/dist/index.js +13042 -15564
- package/package.json +13 -12
package/cmr.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const got = require('got');
|
|
4
4
|
const pWaitFor = require('p-wait-for');
|
|
5
|
-
const
|
|
5
|
+
const js2xmlParser = require('js2xmlparser');
|
|
6
6
|
const { s3 } = require('@cumulus/aws-client/services');
|
|
7
7
|
const { buildS3Uri } = require('@cumulus/aws-client/S3');
|
|
8
8
|
const { sleep } = require('@cumulus/common');
|
|
@@ -204,6 +204,11 @@ function generateCmrXml(granule, collection, additionalUrls,
|
|
|
204
204
|
url.OnlineAccessURL.URL = url.OnlineAccessURL.URL.replace(oldGranuleId, replacementId);
|
|
205
205
|
});
|
|
206
206
|
|
|
207
|
+
xmlObject.Granule.DataGranule = new Map();
|
|
208
|
+
xmlObject.Granule.DataGranule.set('SizeMBDataGranule', '10');
|
|
209
|
+
xmlObject.Granule.DataGranule.set('DayNightFlag', 'BOTH');
|
|
210
|
+
xmlObject.Granule.DataGranule.set('ProductionDateTime', '2018-07-19T12:01:01Z');
|
|
211
|
+
|
|
207
212
|
if (additionalUrls) {
|
|
208
213
|
xmlObject.Granule.OnlineAccessURLs = additionalUrls.map((url) => ({
|
|
209
214
|
OnlineAccessURL: {
|
|
@@ -212,8 +217,12 @@ function generateCmrXml(granule, collection, additionalUrls,
|
|
|
212
217
|
},
|
|
213
218
|
}));
|
|
214
219
|
}
|
|
220
|
+
const granuleMap = new Map();
|
|
221
|
+
Object.keys(xmlObject.Granule).forEach((key) => {
|
|
222
|
+
granuleMap.set(key, xmlObject.Granule[key]);
|
|
223
|
+
});
|
|
215
224
|
|
|
216
|
-
const xml =
|
|
225
|
+
const xml = js2xmlParser.parse('Granule', granuleMap);
|
|
217
226
|
return xml;
|
|
218
227
|
}
|
|
219
228
|
|