chore(debug): TEMP probe p5fiat model-list endpoints + launchCatalog
This commit is contained in:
@@ -2013,6 +2013,36 @@ export class PL24Service {
|
||||
const backendKey = catalogBase.replace(/^\//, "");
|
||||
const modelPath = BACKEND_MODEL_PATH[backendKey] ?? "/extern/vehicle/modelfamilies";
|
||||
|
||||
// TEMP DEBUG (p5fiat model-list discovery): probe launchCatalog.do + candidate endpoints
|
||||
if (backendKey === "p5fiat") {
|
||||
const probe = async (u: string) => {
|
||||
try {
|
||||
const r = await fetch(`${this.baseUrl}${u}`, {
|
||||
method: "GET",
|
||||
headers,
|
||||
signal: AbortSignal.timeout(12000),
|
||||
});
|
||||
const ct = r.headers.get("content-type") || "";
|
||||
const body = await r.text();
|
||||
return `${r.status} ct=${ct.slice(0, 20)} len=${body.length} head=${body.slice(0, 90).replace(/\s+/g, " ")}`;
|
||||
} catch (e) {
|
||||
return `ERR ${(e as Error).message}`;
|
||||
}
|
||||
};
|
||||
const cands = [
|
||||
`/partslink24/user/launchCatalog.do?serviceName=${serviceName}&lang=tr`,
|
||||
`${catalogBase}/extern/vehicle/manufacturers?lang=tr&serviceName=${serviceName}`,
|
||||
`${catalogBase}/extern/vehicle/vehicleTypes?lang=tr&serviceName=${serviceName}`,
|
||||
`${catalogBase}/extern/vehicle/models?lang=tr&serviceName=${serviceName}`,
|
||||
`${catalogBase}/extern/model/families?lang=tr&serviceName=${serviceName}`,
|
||||
`${catalogBase}/extern/catalog/models?lang=tr&serviceName=${serviceName}`,
|
||||
`${catalogBase}/extern/vehicle/modelfamilies?lang=tr&serviceName=${serviceName}`,
|
||||
];
|
||||
for (const c of cands) {
|
||||
this.logger.warn(`FIAT-PROBE ${c.replace(catalogBase, "").slice(0, 48)} → ${await probe(c)}`);
|
||||
}
|
||||
}
|
||||
|
||||
const url = `${this.baseUrl}${catalogBase}${modelPath}?lang=${this.language}&serviceName=${serviceName}`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user