@etainabl/nodejs-sdk 1.3.159 → 1.3.160

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/dist/esm/index.js CHANGED
@@ -1067,6 +1067,7 @@ __export(utils_exports, {
1067
1067
  automationServices: () => automationServices,
1068
1068
  automationSources: () => automationSources,
1069
1069
  getMeterPointNumberBottomLine: () => getMeterPointNumberBottomLine,
1070
+ isTransientError: () => isTransientError,
1070
1071
  units: () => units,
1071
1072
  utilityTypes: () => utilityTypes,
1072
1073
  wasteCategories: () => wasteCategories
@@ -7036,6 +7037,23 @@ var IngestHandler = class {
7036
7037
  }
7037
7038
  };
7038
7039
 
7040
+ // src/utils/errors.ts
7041
+ function isTransientError(error) {
7042
+ if (error.code === "ETIMEDOUT" || error.code === "ECONNRESET" || error.code === "ENOTFOUND" || error.code === "ECONNREFUSED") {
7043
+ return true;
7044
+ }
7045
+ if (error.message?.includes("timeout") || error.message?.includes("ETIMEDOUT")) {
7046
+ return true;
7047
+ }
7048
+ if (error.response?.status >= 500 && error.response?.status < 600) {
7049
+ return true;
7050
+ }
7051
+ if (error.message?.includes("Cloudflare") || error.message?.includes("522") || error.message?.includes("524")) {
7052
+ return true;
7053
+ }
7054
+ return false;
7055
+ }
7056
+
7039
7057
  // src/openai/index.ts
7040
7058
  var openai_exports = {};
7041
7059
  __export(openai_exports, {