@cumulus/move-granules 11.1.2 → 11.1.3
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/index.js +141 -22
- package/dist/lambda.zip +0 -0
- package/dist/schemas/config.json +9 -0
- package/index.js +13 -3
- package/package.json +10 -9
- package/schemas/config.json +9 -0
package/dist/lambda.zip
CHANGED
|
Binary file
|
package/dist/schemas/config.json
CHANGED
|
@@ -59,6 +59,15 @@
|
|
|
59
59
|
"url_path": { "type": "string" }
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
},
|
|
63
|
+
"meta": {
|
|
64
|
+
"title": "Optional Metadata for the Collection",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": true,
|
|
67
|
+
"granuleMetadataFileExtension": {
|
|
68
|
+
"description": "Set to the file extension for task to look for the granule metadata information. If none is specified, the granule CMR metadata or ISO metadata file is used",
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
},
|
package/index.js
CHANGED
|
@@ -27,6 +27,7 @@ const {
|
|
|
27
27
|
const BucketsConfig = require('@cumulus/common/BucketsConfig');
|
|
28
28
|
|
|
29
29
|
const { urlPathTemplate } = require('@cumulus/ingest/url-path-template');
|
|
30
|
+
const { isFileExtensionMatched } = require('@cumulus/message/utils');
|
|
30
31
|
const log = require('@cumulus/common/log');
|
|
31
32
|
|
|
32
33
|
const MB = 1024 * 1024;
|
|
@@ -261,12 +262,21 @@ async function moveGranules(event) {
|
|
|
261
262
|
? config.s3MultipartChunksizeMb : process.env.default_s3_multipart_chunksize_mb;
|
|
262
263
|
|
|
263
264
|
const duplicateHandling = duplicateHandlingType(event);
|
|
265
|
+
const granuleMetadataFileExtension = get(config, 'collection.meta.granuleMetadataFileExtension');
|
|
264
266
|
|
|
265
|
-
log.debug(`moveGranules config duplicateHandling: ${duplicateHandling},
|
|
267
|
+
log.debug(`moveGranules config duplicateHandling: ${duplicateHandling}, `
|
|
268
|
+
+ `moveStagedFiles: ${moveStagedFiles}, `
|
|
269
|
+
+ `s3MultipartChunksizeMb: ${s3MultipartChunksizeMb}, `
|
|
270
|
+
+ `granuleMetadataFileExtension ${granuleMetadataFileExtension}`);
|
|
266
271
|
|
|
267
|
-
|
|
272
|
+
let filterFunc;
|
|
273
|
+
if (granuleMetadataFileExtension) {
|
|
274
|
+
filterFunc = (fileobject) => isFileExtensionMatched(fileobject, granuleMetadataFileExtension);
|
|
275
|
+
} else {
|
|
276
|
+
filterFunc = (fileobject) => isCMRFile(fileobject) || isISOFile(fileobject);
|
|
277
|
+
}
|
|
268
278
|
|
|
269
|
-
const
|
|
279
|
+
const granulesInput = event.input.granules;
|
|
270
280
|
const cmrFiles = granulesToCmrFileObjects(granulesInput, filterFunc);
|
|
271
281
|
const granulesByGranuleId = keyBy(granulesInput, 'granuleId');
|
|
272
282
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/move-granules",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.3",
|
|
4
4
|
"description": "Move granule files from staging to final location",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -38,17 +38,18 @@
|
|
|
38
38
|
"author": "Cumulus Authors",
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@cumulus/aws-client": "11.1.
|
|
42
|
-
"@cumulus/cmrjs": "11.1.
|
|
43
|
-
"@cumulus/common": "11.1.
|
|
41
|
+
"@cumulus/aws-client": "11.1.3",
|
|
42
|
+
"@cumulus/cmrjs": "11.1.3",
|
|
43
|
+
"@cumulus/common": "11.1.3",
|
|
44
44
|
"@cumulus/cumulus-message-adapter-js": "2.0.4",
|
|
45
|
-
"@cumulus/distribution-utils": "11.1.
|
|
46
|
-
"@cumulus/errors": "11.1.
|
|
47
|
-
"@cumulus/ingest": "11.1.
|
|
45
|
+
"@cumulus/distribution-utils": "11.1.3",
|
|
46
|
+
"@cumulus/errors": "11.1.3",
|
|
47
|
+
"@cumulus/ingest": "11.1.3",
|
|
48
|
+
"@cumulus/message": "11.1.3",
|
|
48
49
|
"lodash": "^4.17.21"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
|
-
"@cumulus/schemas": "11.1.
|
|
52
|
+
"@cumulus/schemas": "11.1.3"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "f7c66a63c812c2762da6a366e252e05e3fb8b35d"
|
|
54
55
|
}
|
package/schemas/config.json
CHANGED
|
@@ -59,6 +59,15 @@
|
|
|
59
59
|
"url_path": { "type": "string" }
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
+
},
|
|
63
|
+
"meta": {
|
|
64
|
+
"title": "Optional Metadata for the Collection",
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": true,
|
|
67
|
+
"granuleMetadataFileExtension": {
|
|
68
|
+
"description": "Set to the file extension for task to look for the granule metadata information. If none is specified, the granule CMR metadata or ISO metadata file is used",
|
|
69
|
+
"type": "string"
|
|
70
|
+
}
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
},
|