@cumulus/common 14.0.0 → 15.0.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/cloudwatch-event.js +2 -2
- package/errors.d.ts +9 -0
- package/errors.js +13 -0
- package/execution-history.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/key-pair-provider.js +1 -2
- package/package.json +6 -6
- package/sleep.d.ts +5 -0
- package/sleep.js +9 -0
- package/sns-event.js +1 -1
package/cloudwatch-event.js
CHANGED
|
@@ -63,7 +63,7 @@ exports.isFailedSfStatus = (0, util_1.isOneOf)([
|
|
|
63
63
|
* @param {AwsCloudWatchEvent} event - A Cloudwatch event
|
|
64
64
|
* @returns {string|undefined} Step Function execution status
|
|
65
65
|
*/
|
|
66
|
-
const getSfEventStatus = (event) =>
|
|
66
|
+
const getSfEventStatus = (event) => event?.detail?.status;
|
|
67
67
|
exports.getSfEventStatus = getSfEventStatus;
|
|
68
68
|
/**
|
|
69
69
|
* Get the Step Function output message from a Cloudwatch Event
|
|
@@ -73,7 +73,7 @@ exports.getSfEventStatus = getSfEventStatus;
|
|
|
73
73
|
* @param {string} [defaultValue] - A default value for the message, if none exists
|
|
74
74
|
* @returns {string|undefined} Output message from Step Function
|
|
75
75
|
*/
|
|
76
|
-
const getSfEventDetailValue = (event, field, defaultValue) =>
|
|
76
|
+
const getSfEventDetailValue = (event, field, defaultValue) => event?.detail?.[field] ?? defaultValue;
|
|
77
77
|
exports.getSfEventDetailValue = getSfEventDetailValue;
|
|
78
78
|
/**
|
|
79
79
|
* Get the Step Function output message from a Cloudwatch Event
|
package/errors.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This method is for parsing a caught error which is not an HTTPerror
|
|
3
|
+
* in case the EDL endpoint call results in an unexpected error
|
|
4
|
+
*
|
|
5
|
+
* @param {unkown} e - the Error, if e isn't of type Error then it returns itself
|
|
6
|
+
* @returns {Error}
|
|
7
|
+
*/
|
|
8
|
+
export declare const parseCaughtError: (e: unknown) => Error;
|
|
9
|
+
//# sourceMappingURL=errors.d.ts.map
|
package/errors.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseCaughtError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This method is for parsing a caught error which is not an HTTPerror
|
|
6
|
+
* in case the EDL endpoint call results in an unexpected error
|
|
7
|
+
*
|
|
8
|
+
* @param {unkown} e - the Error, if e isn't of type Error then it returns itself
|
|
9
|
+
* @returns {Error}
|
|
10
|
+
*/
|
|
11
|
+
const parseCaughtError = (e) => (e instanceof Error ? e : new Error(`${e}`));
|
|
12
|
+
exports.parseCaughtError = parseCaughtError;
|
|
13
|
+
//# sourceMappingURL=errors.js.map
|
package/execution-history.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTaskExitedEventOutput = exports.getStepExitedEvent = void 0;
|
|
4
4
|
const getStepExitedEvent = (events, lastStepEvent) => events.find(({ type, previousEventId }) => type === 'TaskStateExited' && previousEventId === lastStepEvent.id);
|
|
5
5
|
exports.getStepExitedEvent = getStepExitedEvent;
|
|
6
|
-
const getTaskExitedEventOutput = (event) =>
|
|
6
|
+
const getTaskExitedEventOutput = (event) => event?.stateExitedEventDetails?.output;
|
|
7
7
|
exports.getTaskExitedEventOutput = getTaskExitedEventOutput;
|
|
8
8
|
//# sourceMappingURL=execution-history.js.map
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -22,6 +22,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
25
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
29
|
exports.workflows = exports.util = exports.testUtils = exports.log = exports.keyPairProvider = exports.fakeProvider = exports.envUtils = exports.cliUtils = exports.BucketsConfig = void 0;
|
|
27
30
|
const BucketsConfig = require("./BucketsConfig");
|
|
@@ -34,4 +37,5 @@ exports.log = __importStar(require("./log"));
|
|
|
34
37
|
exports.testUtils = __importStar(require("./test-utils"));
|
|
35
38
|
exports.util = __importStar(require("./util"));
|
|
36
39
|
exports.workflows = __importStar(require("./workflows"));
|
|
40
|
+
__exportStar(require("./sleep"), exports);
|
|
37
41
|
//# sourceMappingURL=index.js.map
|
package/key-pair-provider.js
CHANGED
|
@@ -25,8 +25,7 @@ const getLocalStackHost = () => {
|
|
|
25
25
|
return process.env.LOCALSTACK_HOST;
|
|
26
26
|
};
|
|
27
27
|
const buildS3Client = () => {
|
|
28
|
-
|
|
29
|
-
const region = (_a = process.env.AWS_DEFAULT_REGION) !== null && _a !== void 0 ? _a : 'us-east-1';
|
|
28
|
+
const region = process.env.AWS_DEFAULT_REGION ?? 'us-east-1';
|
|
30
29
|
const options = {
|
|
31
30
|
apiVersion: '2006-03-01',
|
|
32
31
|
region,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "Common utilities used across tasks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"GIBS",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"NASA"
|
|
9
9
|
],
|
|
10
10
|
"engines": {
|
|
11
|
-
"node": ">=
|
|
11
|
+
"node": ">=16.19.0"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"*.js",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@aws-sdk/client-s3": "^3.58.0",
|
|
45
45
|
"@aws-sdk/signature-v4-crt": "^3.58.0",
|
|
46
|
-
"@cumulus/aws-client": "
|
|
47
|
-
"@cumulus/errors": "
|
|
48
|
-
"@cumulus/logger": "
|
|
46
|
+
"@cumulus/aws-client": "15.0.0",
|
|
47
|
+
"@cumulus/errors": "15.0.0",
|
|
48
|
+
"@cumulus/logger": "15.0.0",
|
|
49
49
|
"ajv": "^6.12.3",
|
|
50
50
|
"aws-sdk": "^2.585.0",
|
|
51
51
|
"follow-redirects": "^1.2.4",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@types/node-forge": "^0.9.5",
|
|
68
68
|
"@types/url-join": "^4.0.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "15986abef3ef23dc9ccefd31f219f78203dcd8db"
|
|
71
71
|
}
|
package/sleep.d.ts
ADDED
package/sleep.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Sleep for the given number of milliseconds
|
|
6
|
+
*/
|
|
7
|
+
const sleep = (duration) => new Promise((resolve) => setTimeout(resolve, duration));
|
|
8
|
+
exports.sleep = sleep;
|
|
9
|
+
//# sourceMappingURL=sleep.js.map
|
package/sns-event.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.isSnsEvent = isSnsEvent;
|
|
|
40
40
|
* @param {any} [defaultValue] - Default value to use for message, if none exists.
|
|
41
41
|
* @returns {any} - Message from SNS event
|
|
42
42
|
*/
|
|
43
|
-
const getSnsEventMessage = (event, defaultValue) =>
|
|
43
|
+
const getSnsEventMessage = (event, defaultValue) => event?.Sns?.Message ?? defaultValue;
|
|
44
44
|
exports.getSnsEventMessage = getSnsEventMessage;
|
|
45
45
|
/**
|
|
46
46
|
* Get message object from SNS event.
|