From 81eea17500b9ba67d0e18fc2b653c915116317cb Mon Sep 17 00:00:00 2001 From: Karen Shaw Date: Mon, 15 Apr 2024 15:24:37 +0000 Subject: [PATCH] Update file set download handler aws sdk version --- node/src/handlers/get-file-set-download.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/node/src/handlers/get-file-set-download.js b/node/src/handlers/get-file-set-download.js index 31a80fad..15d8d649 100644 --- a/node/src/handlers/get-file-set-download.js +++ b/node/src/handlers/get-file-set-download.js @@ -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"); @@ -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); @@ -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" },