@carrierllc/mcp 0.2.9 → 0.2.10

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/index.js CHANGED
@@ -3159,11 +3159,19 @@ function registerIntelligenceTools(server2, ctx) {
3159
3159
  const esim = sp.esim ?? {};
3160
3160
  const statuses = esim.status ?? [];
3161
3161
  for (const s of statuses) {
3162
- const name = String(s.name ?? "").toUpperCase();
3163
3162
  const count = Number(s.count ?? 0);
3164
- if (name === "ACTIVE" || name === "ACTIVATED") active += count;
3165
- else if (name === "SUSPENDED") suspended += count;
3166
- else if (name === "INVENTORY" || name === "NOT_ACTIVATED" || name === "AVAILABLE") inventory += count;
3163
+ const num = s.statusNum;
3164
+ if (typeof num === "number") {
3165
+ if (num === 1) active += count;
3166
+ else if (num === 2) suspended += count;
3167
+ else if (num === 0) inventory += count;
3168
+ else other += count;
3169
+ continue;
3170
+ }
3171
+ const str = String(s.statusStr ?? s.name ?? "").toUpperCase();
3172
+ if (str === "ACTIVATED" || str === "ACTIVE") active += count;
3173
+ else if (str === "SUSPENDED") suspended += count;
3174
+ else if (str === "FREE" || str === "INVENTORY" || str === "NOT_ACTIVATED" || str === "AVAILABLE") inventory += count;
3167
3175
  else other += count;
3168
3176
  }
3169
3177
  }