@cumulus/common 10.1.0 → 10.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/cloudwatch-event.d.ts +1 -1
- package/cloudwatch-event.js +5 -1
- package/env.d.ts +3 -0
- package/fake-provider.d.ts +2 -0
- package/fake-provider.js +24 -0
- package/index.d.ts +1 -0
- package/index.js +7 -2
- package/key-pair-provider.js +1 -1
- package/package.json +7 -6
- package/sns-event.d.ts +1 -1
- package/sns-event.js +5 -1
- package/test-utils.d.ts +3 -0
- package/util.d.ts +2 -1
- package/util.js +5 -1
package/cloudwatch-event.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare const getSfEventStatus: (event: AwsCloudWatchEvent) => string | u
|
|
|
35
35
|
* @param {string} [defaultValue] - A default value for the message, if none exists
|
|
36
36
|
* @returns {string|undefined} Output message from Step Function
|
|
37
37
|
*/
|
|
38
|
-
export declare const getSfEventDetailValue: (event: AwsCloudWatchEvent, field: 'input' | 'output', defaultValue?: string
|
|
38
|
+
export declare const getSfEventDetailValue: (event: AwsCloudWatchEvent, field: 'input' | 'output', defaultValue?: string) => string | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Get the Step Function output message from a Cloudwatch Event
|
|
41
41
|
*
|
package/cloudwatch-event.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/env.d.ts
CHANGED
package/fake-provider.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.fetchFakeProviderIp = void 0;
|
|
7
|
+
const is_ip_1 = __importDefault(require("is-ip"));
|
|
8
|
+
const S3_1 = require("@cumulus/aws-client/S3");
|
|
9
|
+
const fetchFakeProviderIp = async () => {
|
|
10
|
+
if (!process.env.FAKE_PROVIDER_CONFIG_BUCKET) {
|
|
11
|
+
throw new Error('The FAKE_PROVIDER_CONFIG_BUCKET environment variable must be set');
|
|
12
|
+
}
|
|
13
|
+
const textObject = await (0, S3_1.getTextObject)(process.env.FAKE_PROVIDER_CONFIG_BUCKET, 'fake-provider-ip');
|
|
14
|
+
if (!textObject) {
|
|
15
|
+
throw new Error('Failed to get object defined in FAKE_PROVIDER_CONFIG_BUCKET');
|
|
16
|
+
}
|
|
17
|
+
const ip = textObject.trim();
|
|
18
|
+
if (!(0, is_ip_1.default)(ip)) {
|
|
19
|
+
throw new Error(`Invalid fake provider IP "${ip}" fetched from s3://${process.env.FAKE_PROVIDER_CONFIG_BUCKET}/fake-provider-ip`);
|
|
20
|
+
}
|
|
21
|
+
return ip;
|
|
22
|
+
};
|
|
23
|
+
exports.fetchFakeProviderIp = fetchFakeProviderIp;
|
|
24
|
+
//# sourceMappingURL=fake-provider.js.map
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import BucketsConfig = require('./BucketsConfig');
|
|
|
2
2
|
export { BucketsConfig };
|
|
3
3
|
export * as cliUtils from './cli-utils';
|
|
4
4
|
export * as envUtils from './env';
|
|
5
|
+
export * as fakeProvider from './fake-provider';
|
|
5
6
|
export * as keyPairProvider from './key-pair-provider';
|
|
6
7
|
export * as log from './log';
|
|
7
8
|
export * as testUtils from './test-utils';
|
package/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -19,11 +23,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.workflows = exports.util = exports.testUtils = exports.log = exports.keyPairProvider = exports.envUtils = exports.cliUtils = exports.BucketsConfig = void 0;
|
|
26
|
+
exports.workflows = exports.util = exports.testUtils = exports.log = exports.keyPairProvider = exports.fakeProvider = exports.envUtils = exports.cliUtils = exports.BucketsConfig = void 0;
|
|
23
27
|
const BucketsConfig = require("./BucketsConfig");
|
|
24
28
|
exports.BucketsConfig = BucketsConfig;
|
|
25
29
|
exports.cliUtils = __importStar(require("./cli-utils"));
|
|
26
30
|
exports.envUtils = __importStar(require("./env"));
|
|
31
|
+
exports.fakeProvider = __importStar(require("./fake-provider"));
|
|
27
32
|
exports.keyPairProvider = __importStar(require("./key-pair-provider"));
|
|
28
33
|
exports.log = __importStar(require("./log"));
|
|
29
34
|
exports.testUtils = __importStar(require("./test-utils"));
|
package/key-pair-provider.js
CHANGED
|
@@ -37,7 +37,7 @@ const buildS3Client = () => {
|
|
|
37
37
|
};
|
|
38
38
|
if ((0, test_utils_1.inTestMode)()) {
|
|
39
39
|
options.accessKeyId = 'my-access-key-id';
|
|
40
|
-
options.endpoint = `http://${getLocalStackHost()}:
|
|
40
|
+
options.endpoint = `http://${getLocalStackHost()}:4566`;
|
|
41
41
|
options.region = 'us-east-1';
|
|
42
42
|
options.s3ForcePathStyle = true;
|
|
43
43
|
options.secretAccessKey = 'my-secret-access-key';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cumulus/common",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.3",
|
|
4
4
|
"description": "Common utilities used across tasks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"GIBS",
|
|
@@ -41,15 +41,16 @@
|
|
|
41
41
|
"author": "Cumulus Authors",
|
|
42
42
|
"license": "Apache-2.0",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@cumulus/errors": "10.1.
|
|
45
|
-
"@cumulus/logger": "10.1.
|
|
44
|
+
"@cumulus/errors": "10.1.3",
|
|
45
|
+
"@cumulus/logger": "10.1.3",
|
|
46
46
|
"ajv": "^6.12.3",
|
|
47
47
|
"aws-sdk": "^2.585.0",
|
|
48
48
|
"follow-redirects": "^1.2.4",
|
|
49
49
|
"fs-extra": "^5.0.0",
|
|
50
|
+
"is-ip": "^3.1.0",
|
|
50
51
|
"jsonpath-plus": "^3.0.0",
|
|
51
|
-
"lodash": "^4.17.
|
|
52
|
-
"node-forge": "^1.
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"node-forge": "^1.3.0",
|
|
53
54
|
"p-limit": "^2.0.0",
|
|
54
55
|
"p-map": "^1.2.0",
|
|
55
56
|
"p-retry": "^4.2.0",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"@types/node-forge": "^0.9.5",
|
|
64
65
|
"@types/url-join": "^4.0.0"
|
|
65
66
|
},
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3dfabef58c4647d3ae5a64997bacaad5d6b274e1"
|
|
67
68
|
}
|
package/sns-event.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare const isSnsEvent: (event: {
|
|
|
20
20
|
* @param {any} [defaultValue] - Default value to use for message, if none exists.
|
|
21
21
|
* @returns {any} - Message from SNS event
|
|
22
22
|
*/
|
|
23
|
-
export declare const getSnsEventMessage: (event: AwsLambdaSnsMessageEventRecord, defaultValue?: string
|
|
23
|
+
export declare const getSnsEventMessage: (event: AwsLambdaSnsMessageEventRecord, defaultValue?: string) => string;
|
|
24
24
|
/**
|
|
25
25
|
* Get message object from SNS event.
|
|
26
26
|
*
|
package/sns-event.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/test-utils.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
2
5
|
import { ExecutionContext } from 'ava';
|
|
3
6
|
export { readJsonFile as readJsonFixture } from './FileUtils';
|
|
4
7
|
export declare const inTestMode: (env?: NodeJS.ProcessEnv) => boolean;
|
package/util.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module util
|
|
4
4
|
*/
|
|
5
5
|
/// <reference types="lodash" />
|
|
6
|
+
/// <reference types="lodash" />
|
|
6
7
|
/**
|
|
7
8
|
* Mark a piece of code as deprecated.
|
|
8
9
|
*
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
*
|
|
18
19
|
* @alias module:util
|
|
19
20
|
*/
|
|
20
|
-
export declare const deprecate: (name: string, version: string, alternative?: string
|
|
21
|
+
export declare const deprecate: (name: string, version: string, alternative?: string) => void;
|
|
21
22
|
/**
|
|
22
23
|
* Remove properties whose values are `null` or `undefined`
|
|
23
24
|
*
|
package/util.js
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
9
13
|
}) : (function(o, m, k, k2) {
|
|
10
14
|
if (k2 === undefined) k2 = k;
|
|
11
15
|
o[k2] = m[k];
|