Skip to content

Commit

Permalink
Update file set download handler aws sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
kdid committed Apr 15, 2024
1 parent 92cb841 commit 81eea17
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions node/src/handlers/get-file-set-download.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const AWS = require("aws-sdk");
const { SFNClient, StartExecutionCommand } = require("@aws-sdk/client-sfn");
const { wrap } = require("./middleware");
const { getFileSet } = require("../api/opensearch");
const { videoTranscodeSettings } = require("./transcode-templates");
Expand Down Expand Up @@ -55,7 +55,7 @@ async function processDownload(doc, email) {
const stepFunctionConfig = process.env.STEP_FUNCTION_ENDPOINT
? { endpoint: process.env.STEP_FUNCTION_ENDPOINT }
: {};
var stepfunctions = new AWS.StepFunctions(stepFunctionConfig);
const client = new SFNClient(stepFunctionConfig);

const fileSet = doc._source;
const url = new URL(fileSet.streaming_url);
Expand Down Expand Up @@ -103,7 +103,9 @@ async function processDownload(doc, email) {
};

try {
await stepfunctions.startExecution(params).promise();
const command = new StartExecutionCommand(params);
await client.send(command);

return {
statusCode: 200,
headers: { "content-type": "text/plain" },
Expand Down

0 comments on commit 81eea17

Please sign in to comment.