You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chajia/scripts/verify-address-candidates.ts

42 lines
923 B

import { loadDevEnv } from "@/lib/dev-env";
import { resolveMothershipCandidates } from "@/modules/address/mothership-candidates";
loadDevEnv();
async function main(): Promise<void> {
const started = Date.now();
const result = await resolveMothershipCandidates({
pickup: {
street: "1234 Warehouse Blvd",
city: "Los Angeles",
state: "CA",
zip: "90001",
},
delivery: {
street: "5678 Distribution Dr",
city: "Dallas",
state: "TX",
zip: "75201",
},
});
console.log(
JSON.stringify(
{
ok: true,
elapsedMs: Date.now() - started,
pickupCount: result.pickup_candidates.length,
deliveryCount: result.delivery_candidates.length,
requiresSelection: result.requires_selection,
},
null,
2,
),
);
}
main().catch((error) => {
console.error("[FAIL]", error);
process.exitCode = 1;
});