Is possible to make multiple API calls Sequentially, but just in one plugin action?

for example:
I also tried with return {“message”: “some text returned”} , instead of console.log() , but I don’t see nothing in the console

async function(properties, context) {
// Function to make the first API call
async function firstApiCall() {
  try {
    const response = await fetch('https://jsonplaceholder.typicode.com/todos/1');
    const data = await response.json();
    console.log('First API call:', data);

    // Return the data for the second API call
    return data;
  } catch (error) {
    console.error('Error in the first API call:', error);
    throw error; // Propagate the error
  }
}

// Function to make the second API call using data from the first one
async function secondApiCall(dataFromFirstCall) {
  try {
    // Use data from the first call to construct the URL or payload for the second call
    const secondApiUrl = `https://jsonplaceholder.typicode.com/posts/${dataFromFirstCall.userId}`;
    const response = await fetch(secondApiUrl);
    const data = await response.json();
    console.log('Second API call:', data);
  } catch (error) {
    console.error('Error in the second API call:', error);
    throw error; // Propagate the error
  }
}

// Make both API calls
async function makeApiCalls() {
  try {
    const dataFromFirstCall = await firstApiCall();
    await secondApiCall(dataFromFirstCall);
  } catch (error) {
    console.error('Error making API calls:', error);
  }
}

// Call the function to make both API calls
makeApiCalls();
}

assuming this is a server side action, logs can be seen in the editor under the “logs” section. If you want the fetched data available in the frontend after the action you need to return it from your code (at the moment you are not returning anything)