No, the promise can only be resolved or rejected by the resolve
and reject
functions, respectively.
If these functions aren't called nor exposed, the promise will remain in pending state forever.
That's also a security level, as it helps you ensure the promise you wait for will resolve to the value you expect and when you expect; and allows you to safely return an internal promise, as it is (without any hazards or leaking secrets).
To make a promise, that relies on another promise you don't have control over, but can be resolved (or rejected) manually, regardless of the original, you can use the Promise.race()
function:
//The original promise that may pend forever
const original = new Promise(()=>{})
//Controller promise, whose resolver is exposed (or contains the logic needed for "manual" resolution)
let resolve
const controller = new Promise(rs=>{resolve=rs})
//The promise you wait for (and can be resolved or rejected either by `original` or `controller`)
const mixed = Promise.race([original,controller])
mixed.then(console.log)
setTimeout(()=>resolve('Resolved'), 2000)