snow-flow-test 10.0.1-test.112 → 10.0.1-test.113
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -407,17 +407,32 @@ async function probeFlowFactoryNamespace(
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
|
|
410
|
-
// 5. Probe each candidate — GET
|
|
410
|
+
// 5. Probe each candidate — GET the /discover endpoint (a real GET handler)
|
|
411
|
+
// If /discover doesn't exist yet, fall back to /create (expects 405)
|
|
411
412
|
for (var j = 0; j < unique.length; j++) {
|
|
413
|
+
// Try /discover first (GET endpoint, returns 200 when namespace is correct)
|
|
414
|
+
try {
|
|
415
|
+
var discoverResp = await client.get('/api/' + unique[j] + '/' + FLOW_FACTORY_API_ID + '/discover');
|
|
416
|
+
if (discoverResp.status === 200 || discoverResp.data) {
|
|
417
|
+
return unique[j]; // Namespace confirmed via /discover
|
|
418
|
+
}
|
|
419
|
+
} catch (discoverErr: any) {
|
|
420
|
+
var ds = discoverErr.response?.status;
|
|
421
|
+
if (ds === 401 || ds === 403) {
|
|
422
|
+
return unique[j]; // Namespace correct but auth issue
|
|
423
|
+
}
|
|
424
|
+
// 404 = wrong namespace OR /discover not deployed yet, try /create
|
|
425
|
+
}
|
|
426
|
+
// Fallback: try /create (POST-only, expect 405 for correct namespace)
|
|
412
427
|
try {
|
|
413
428
|
await client.get('/api/' + unique[j] + '/' + FLOW_FACTORY_API_ID + '/create');
|
|
414
|
-
return unique[j]; // 200 =
|
|
415
|
-
} catch (
|
|
416
|
-
var
|
|
417
|
-
if (
|
|
429
|
+
return unique[j]; // 200 = unexpected but valid
|
|
430
|
+
} catch (createErr: any) {
|
|
431
|
+
var cs = createErr.response?.status;
|
|
432
|
+
if (cs === 405 || cs === 401 || cs === 403) {
|
|
418
433
|
return unique[j]; // Namespace correct — method or auth rejected
|
|
419
434
|
}
|
|
420
|
-
// 404 = wrong namespace, try next
|
|
435
|
+
// 404 = wrong namespace, try next candidate
|
|
421
436
|
}
|
|
422
437
|
}
|
|
423
438
|
|