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.

51 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { assertRpaWorkerEnv } from "@/lib/rpa/env";
import type { QuoteRequest } from "@/modules/providers/quote-provider";
import { MothershipRPAProvider } from "@/workers/rpa/mothership";
import { closeBrowser } from "@/workers/rpa/session-manager";
export const PROBE_QUOTE_REQUEST: QuoteRequest = {
cargoHash: "probe",
pickup: {
street: "1234 Warehouse Blvd",
city: "Los Angeles",
state: "CA",
zip: "90001",
placeId: "place_la_90001",
formattedAddress: "1234 Warehouse Blvd, Los Angeles, CA 90001",
selectedFromSuggestions: true,
mothershipOptionId: "ms_probe_pickup",
mothershipDisplayLabel: "1234 Warehouse Blvd, Los Angeles, CA 90001",
selectedFromMothership: true,
},
delivery: {
street: "5678 Distribution Dr",
city: "Dallas",
state: "TX",
zip: "75201",
placeId: "place_dallas_75201",
formattedAddress: "5678 Distribution Dr, Dallas, TX 75201",
selectedFromSuggestions: true,
mothershipOptionId: "ms_probe_delivery",
mothershipDisplayLabel: "5678 Distribution Dr, Dallas, TX 75201",
selectedFromMothership: true,
},
weightLb: 500,
dimsIn: { l: 48, w: 40, h: 48 },
palletCount: 2,
cargoType: "general_freight",
};
/** 执行单次 RPA probetask-130 / TC-601 */
export async function executeProbeQuote() {
if (process.env.RPA_MOCK_MODE !== "true") {
assertRpaWorkerEnv();
}
const provider = new MothershipRPAProvider();
try {
return await provider.getQuote(PROBE_QUOTE_REQUEST);
} finally {
await closeBrowser();
}
}