Heat the vegetable oil in a large wok or skillet over medium-high heat.
Add the onion and cook for **2 to 3 minutes**, until softened.
Stir in the garlic and cook for about **30 seconds**, until fragrant.
Add the shredded duck and cook for **1 to 2 minutes**, allowing the edges to crisp slightly.
Stir in the diced tomato and cook for another **30 seconds**.
Add the cold jasmine rice and break up any clumps with a spatula.
Pour in the fish sauce, oyster sauce, and white pepper. Stir-fry for **2 to 3 minutes**, tossing until the rice is evenly coated.
Push the rice to one side of the wok.
Pour the beaten eggs into the empty side and scramble until just set.
Mix the eggs into the rice.
Turn off the heat and fold in the Thai basil until just wilted.
Serve immediately with sliced cucumbers, lime wedges, and chili flakes, if desired.