@cumulus/async-operations 18.1.0 → 18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cumulus/async-operations",
3
- "version": "18.1.0",
3
+ "version": "18.2.0",
4
4
  "description": "Cumulus Core internal async operations module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -29,19 +29,20 @@
29
29
  "author": "Cumulus Authors",
30
30
  "license": "Apache-2.0",
31
31
  "dependencies": {
32
- "@cumulus/aws-client": "18.1.0",
33
- "@cumulus/db": "18.1.0",
34
- "@cumulus/errors": "18.1.0",
35
- "@cumulus/es-client": "18.1.0",
36
- "@cumulus/logger": "18.1.0",
37
- "@cumulus/types": "18.1.0",
32
+ "@aws-sdk/client-lambda": "^3.447.0",
33
+ "@cumulus/aws-client": "18.2.0",
34
+ "@cumulus/db": "18.2.0",
35
+ "@cumulus/errors": "18.2.0",
36
+ "@cumulus/es-client": "18.2.0",
37
+ "@cumulus/logger": "18.2.0",
38
+ "@cumulus/types": "18.2.0",
38
39
  "knex": "2.4.1",
39
40
  "uuid": "8.3.2"
40
41
  },
41
42
  "devDependencies": {
42
- "@cumulus/common": "18.1.0",
43
+ "@cumulus/common": "18.2.0",
43
44
  "@types/aws-sdk": "2.7.0",
44
45
  "@types/uuid": "^8.0.0"
45
46
  },
46
- "gitHead": "8428a02e0903d8d303c7dd36215aa6a24906e07b"
47
+ "gitHead": "c3b3d1a8accfbd53df89382ba2e9fa7dcbf46b6e"
47
48
  }
@@ -1,8 +1,8 @@
1
- import { ECS, Lambda } from 'aws-sdk';
1
+ import { ECS } from 'aws-sdk';
2
2
  import { Knex } from 'knex';
3
-
3
+ import { FunctionConfiguration } from '@aws-sdk/client-lambda';
4
4
  import { ecs, s3, lambda } from '@cumulus/aws-client/services';
5
- import { EnvironmentVariables } from 'aws-sdk/clients/lambda';
5
+
6
6
  import {
7
7
  getKnexClient,
8
8
  translateApiAsyncOperationToPostgresAsyncOperation,
@@ -34,13 +34,13 @@ type StartEcsTaskReturnType = Promise<PromiseResult<ECS.RunTaskResponse, AWSErro
34
34
 
35
35
  export const getLambdaConfiguration = async (
36
36
  functionName: string
37
- ): Promise<Lambda.FunctionConfiguration> => lambda().getFunctionConfiguration({
37
+ ): Promise<FunctionConfiguration> => lambda().getFunctionConfiguration({
38
38
  FunctionName: functionName,
39
- }).promise();
39
+ });
40
40
 
41
41
  export const getLambdaEnvironmentVariables = (
42
- configuration: Lambda.FunctionConfiguration
43
- ): EnvironmentVariables[] => Object.entries(configuration?.Environment?.Variables ?? {}).map(
42
+ configuration: FunctionConfiguration
43
+ ): Record<string, string>[] => Object.entries(configuration?.Environment?.Variables ?? {}).map(
44
44
  (obj) => ({
45
45
  name: obj[0],
46
46
  value: obj[1],
@@ -90,7 +90,7 @@ export const startECSTask = async ({
90
90
  { name: 'asyncOperationId', value: id },
91
91
  { name: 'lambdaName', value: lambdaName },
92
92
  { name: 'payloadUrl', value: `s3://${payloadBucket}/${payloadKey}` },
93
- ] as EnvironmentVariables[];
93
+ ] as Record<string, string>[];
94
94
  let taskVars = envVars;
95
95
 
96
96
  const callerLambdaConfig = await getLambdaConfiguration(callerLambdaName);
@@ -81,9 +81,9 @@ test.before(async (t) => {
81
81
  },
82
82
  };
83
83
 
84
- sinon.stub(lambda(), 'getFunctionConfiguration').returns({
85
- promise: () => Promise.resolve(t.context.functionConfig),
86
- });
84
+ sinon.stub(lambda(), 'getFunctionConfiguration').returns(
85
+ Promise.resolve(t.context.functionConfig)
86
+ );
87
87
 
88
88
  t.context.asyncOperationPgModel = new AsyncOperationPgModel();
89
89
  });