omnigateway 0.4.3 → 0.4.5
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/gateway.js +16 -3
- package/package.json +1 -1
package/gateway.js
CHANGED
|
@@ -43667,7 +43667,7 @@ function pluginCatalog(plugins) {
|
|
|
43667
43667
|
version: plugin.manifest.version,
|
|
43668
43668
|
nav: plugin.manifest.nav === undefined ? null : plugin.manifest.nav,
|
|
43669
43669
|
ui: plugin.ui === undefined ? null : {
|
|
43670
|
-
entry: plugin.ui.compatible ? `${PLUGIN_ASSET_PREFIX}/${plugin.id}/${plugin.ui.entry}` : null,
|
|
43670
|
+
entry: plugin.ui.compatible ? `${PLUGIN_ASSET_PREFIX}/${plugin.id}/${plugin.ui.entry}?v=${encodeURIComponent(plugin.manifest.version)}` : null,
|
|
43671
43671
|
compatible: plugin.ui.compatible,
|
|
43672
43672
|
...plugin.ui.reason === undefined ? {} : { reason: plugin.ui.reason }
|
|
43673
43673
|
}
|
|
@@ -46261,6 +46261,11 @@ var NETWORK_HINTS = [
|
|
|
46261
46261
|
"socket hang up",
|
|
46262
46262
|
"unable to connect"
|
|
46263
46263
|
];
|
|
46264
|
+
function describeError(error51) {
|
|
46265
|
+
if (!(error51 instanceof Error))
|
|
46266
|
+
return "attempt failed";
|
|
46267
|
+
return error51.message.length > 0 ? error51.message : error51.name;
|
|
46268
|
+
}
|
|
46264
46269
|
function classify(error51) {
|
|
46265
46270
|
if (error51 instanceof GatewayError) {
|
|
46266
46271
|
return {
|
|
@@ -46272,6 +46277,14 @@ function classify(error51) {
|
|
|
46272
46277
|
if (error51 instanceof DOMException && error51.name === "AbortError") {
|
|
46273
46278
|
return { code: "TIMEOUT" };
|
|
46274
46279
|
}
|
|
46280
|
+
if (error51 instanceof AggregateError && Array.isArray(error51.errors)) {
|
|
46281
|
+
for (const inner of error51.errors) {
|
|
46282
|
+
const classified = classify(inner);
|
|
46283
|
+
if (classified.code !== "INTERNAL")
|
|
46284
|
+
return classified;
|
|
46285
|
+
}
|
|
46286
|
+
return { code: "INTERNAL" };
|
|
46287
|
+
}
|
|
46275
46288
|
if (error51 instanceof Error) {
|
|
46276
46289
|
const text = `${error51.name} ${error51.message}`.toLowerCase();
|
|
46277
46290
|
if (NETWORK_HINTS.some((hint) => text.includes(hint)))
|
|
@@ -46580,7 +46593,7 @@ async function dispatch(request2, deps, signal, requestId) {
|
|
|
46580
46593
|
throw signal.reason;
|
|
46581
46594
|
const classifiedError = deadlineAt !== null && dispatchSignal.aborted ? { code: "TIMEOUT" } : classify(error51);
|
|
46582
46595
|
const { code: code2 } = classifiedError;
|
|
46583
|
-
const message2 = error51
|
|
46596
|
+
const message2 = describeError(error51);
|
|
46584
46597
|
lastError = rewrap(classifiedError, message2);
|
|
46585
46598
|
if (code2 === "AUTH" && !committed && !authRefreshRetried && !preemptiveRefreshRequired && candidate.credential.authType === "oauth" && candidate.credential.hasRefreshToken) {
|
|
46586
46599
|
authRefreshRetried = true;
|
|
@@ -46599,7 +46612,7 @@ async function dispatch(request2, deps, signal, requestId) {
|
|
|
46599
46612
|
if (signal.aborted)
|
|
46600
46613
|
throw signal.reason;
|
|
46601
46614
|
const classified = deadlineAt !== null && dispatchSignal.aborted ? { code: "TIMEOUT" } : classify(refreshError);
|
|
46602
|
-
const refreshMessage = refreshError instanceof Error ? refreshError
|
|
46615
|
+
const refreshMessage = refreshError instanceof Error ? describeError(refreshError) : "credential refresh failed";
|
|
46603
46616
|
lastError = rewrap(classified, refreshMessage);
|
|
46604
46617
|
logger2.warn("credential refresh failed", {
|
|
46605
46618
|
requestId,
|
package/package.json
CHANGED