@cumulus/message 9.4.0 → 9.7.1
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/Collections.d.ts.map +1 -1
- package/Collections.js +15 -5
- package/Collections.js.map +1 -1
- package/README.md +2 -2
- package/package.json +7 -7
- package/src/Collections.ts +14 -5
package/Collections.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;GAQG;AAEH,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,WAAW,MAAM,WAC3C,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM;;;
|
|
1
|
+
{"version":3,"file":"Collections.d.ts","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;;;;;;;GAQG;AAEH,aAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,SAAU,MAAM,WAAW,MAAM,WAC3C,CAAC;AAEzB;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,iBAAkB,MAAM;;;CAe3D,CAAC;AA4BF;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC,YACxC,OAAO,CAAC,cAAc,KAC9B,cAAc,GAAG,SAUnB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,YAC5B,OAAO,CAAC,cAAc,KAC9B,MAAM,GAAG,SAOX,CAAC"}
|
package/Collections.js
CHANGED
|
@@ -19,11 +19,21 @@ exports.constructCollectionId = (name, version) => `${name}___${version}`;
|
|
|
19
19
|
* @returns {Object} name and version as object
|
|
20
20
|
*/
|
|
21
21
|
exports.deconstructCollectionId = (collectionId) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
version
|
|
26
|
-
}
|
|
22
|
+
let name;
|
|
23
|
+
let version;
|
|
24
|
+
try {
|
|
25
|
+
[name, version] = collectionId.split('___');
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new Error(`invalid collectionId: ${JSON.stringify(collectionId)}`);
|
|
29
|
+
}
|
|
30
|
+
if (name && version) {
|
|
31
|
+
return {
|
|
32
|
+
name,
|
|
33
|
+
version,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`invalid collectionId: ${collectionId}`);
|
|
27
37
|
};
|
|
28
38
|
/**
|
|
29
39
|
* Get collection name from execution message.
|
package/Collections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAmBb;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CACrE,GAAG,IAAI,MAAM,OAAO,EAAE,CAAC;AAEzB;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,CAAC,YAAoB,EAAE,EAAE;IAC9D,
|
|
1
|
+
{"version":3,"file":"Collections.js","sourceRoot":"","sources":["src/Collections.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAmBb;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CACrE,GAAG,IAAI,MAAM,OAAO,EAAE,CAAC;AAEzB;;;;;;GAMG;AACU,QAAA,uBAAuB,GAAG,C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AAC,CAAC;IACnE,IAAI,CAAC,cAAc,IAAI,CAAC,iBAAiB,EAAE;QACzC,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,6BAAqB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;AAClE,CAAC,CAAC"}
|
package/README.md
CHANGED
|
@@ -405,8 +405,8 @@ of S3 remote message
|
|
|
405
405
|
Returns the name and version of a collection based on
|
|
406
406
|
the collectionId used in elasticsearch indexing
|
|
407
407
|
|
|
408
|
-
**Kind**: global function
|
|
409
|
-
**Returns**: <code>Object</code> - name and version as object
|
|
408
|
+
**Kind**: global function
|
|
409
|
+
**Returns**: <code>Object</code> - name and version as object
|
|
410
410
|
|
|
411
411
|
| Param | Type | Description |
|
|
412
412
|
| --- | --- | --- |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/message",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.1",
|
|
4
4
|
"description": "Utilities for building and parsing Cumulus messages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"GIBS",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"author": "Cumulus Authors",
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@cumulus/aws-client": "9.
|
|
42
|
-
"@cumulus/common": "9.
|
|
43
|
-
"@cumulus/errors": "9.
|
|
44
|
-
"@cumulus/logger": "9.
|
|
45
|
-
"@cumulus/types": "9.
|
|
41
|
+
"@cumulus/aws-client": "9.7.1",
|
|
42
|
+
"@cumulus/common": "9.7.1",
|
|
43
|
+
"@cumulus/errors": "9.7.1",
|
|
44
|
+
"@cumulus/logger": "9.7.1",
|
|
45
|
+
"@cumulus/types": "9.7.1",
|
|
46
46
|
"jsonpath-plus": "^3.0.0",
|
|
47
47
|
"lodash": "^4.17.20",
|
|
48
48
|
"uuid": "^8.2.0"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/uuid": "^8.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "926740ad299b43f27117fd1fd34050b3db194c71"
|
|
54
54
|
}
|
package/src/Collections.ts
CHANGED
|
@@ -37,11 +37,20 @@ export const constructCollectionId = (name: string, version: string) =>
|
|
|
37
37
|
* @returns {Object} name and version as object
|
|
38
38
|
*/
|
|
39
39
|
export const deconstructCollectionId = (collectionId: string) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
version
|
|
44
|
-
}
|
|
40
|
+
let name;
|
|
41
|
+
let version;
|
|
42
|
+
try {
|
|
43
|
+
[name, version] = collectionId.split('___');
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw new Error(`invalid collectionId: ${JSON.stringify(collectionId)}`);
|
|
46
|
+
}
|
|
47
|
+
if (name && version) {
|
|
48
|
+
return {
|
|
49
|
+
name,
|
|
50
|
+
version,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`invalid collectionId: ${collectionId}`);
|
|
45
54
|
};
|
|
46
55
|
|
|
47
56
|
/**
|