Twitter (X) API: Retrieving liked tweets (from my own Twitter account) now that Twitter has anonymized likes

I have an app written in JavaScript that was able to retrieve all liked tweets for my own account earlier this year. However, once Twitter began anonymizing likes, the app no longer works and I can’t figure out how to get it to work now.

This was my OLD code to make the request (was working earlier this year):

const getdata = async () => {
  
  const url = `https://api.twitter.com/2/users/${twitterId}/liked_tweets`;
  
  const response = await needle("get", url, params, {
    headers: {
      "User-Agent": "v2LikedTweetsJS",
      authorization: `Bearer ${token}`
    },
  });

  console.log(response);
}

The new API seems to require OAuth and some cryptography, but I can’t figure it out. This is my NEW code that I’ve been messing around with, but can’t get working and feel like I’m quite lost:

const OAuth = require('oauth-1.0a');
const crypto = require('crypto');

const getdata = async () => {

  // Initialize
  const oauth = OAuth({
    consumer: {
      key: consumer_key,
      secret: consumer_secret,
    },
    signature_method: 'HMAC-SHA1',
    hash_function(base_string, key) {
      return crypto
          .createHmac('sha1', key)
          .update(base_string)
          .digest('base64')
    },
  });
  
  const url = `https://api.twitter.com/2/users/${twitterId}/liked_tweets`;

  const request_data = { url, method: 'POST' };
 
  const token = {
    key: access_token,
    secret: access_token_secret,
  }

  const response = await needle("post", url, params, {
    headers: {
      "User-Agent": "v2LikedTweetsJS",
      authorization: `Bearer ${token}`,
      headers: oauth.toHeader(oauth.authorize(request_data, token))
    },
  });
  
  console.log(response);
  
}

This is the error message I get from my new code:

{
  "title": "Method Not Allowed",
  "detail": "Method Not Allowed",
  "type": "about:blank",
  "status": 405
}

Can anyone help me figure out how to retrieve my own liked tweets?