@carrierllc/mcp 0.13.11 → 0.13.12

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/cli.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  verifyStorefront,
40
40
  walletScreen,
41
41
  which
42
- } from "./chunk-ZLPXWOYO.js";
42
+ } from "./chunk-IQDAU7WA.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  deploySite,
18
18
  esimStatusPerAccountParams,
19
19
  extractDailyUsage,
20
+ extractEsimStatusByAccount,
20
21
  extractEsimStatusCounts,
21
22
  extractResellerBalance,
22
23
  extractSimProviderStatus,
@@ -70,8 +71,9 @@ import {
70
71
  summarizeNetworkEvents,
71
72
  usageOverPeriodParams,
72
73
  verifyStorefront,
73
- withOcsListSummary
74
- } from "./chunk-ZLPXWOYO.js";
74
+ withOcsListSummary,
75
+ withTemplateResellerId
76
+ } from "./chunk-IQDAU7WA.js";
75
77
  import "./chunk-SHKKVIIA.js";
76
78
 
77
79
  // src/index.ts
@@ -2213,7 +2215,11 @@ function registerAllTools(server2, ctx) {
2213
2215
  content: [{ type: "text", text: `Error: ${params.error}` }]
2214
2216
  };
2215
2217
  }
2216
- return ocsCall(ctx.env, token2, "createPrepaidPackageTemplate", params);
2218
+ const withReseller = await withTemplateResellerId(
2219
+ params,
2220
+ () => getDefaultResellerId(ctx.env, token2)
2221
+ );
2222
+ return ocsCall(ctx.env, token2, "createPrepaidPackageTemplate", withReseller);
2217
2223
  }
2218
2224
  )
2219
2225
  );
@@ -10672,19 +10678,23 @@ function extractAccounts(json) {
10672
10678
  function toFleetInput(raw) {
10673
10679
  const counts = extractEsimStatusCounts(raw.status);
10674
10680
  const accountRecords = extractAccounts(raw.accounts);
10675
- const accounts = accountRecords.map((a) => ({
10676
- name: String(a.name ?? a.accountId ?? "?"),
10677
- balance: Number(a.balance ?? 0),
10678
- // Per-account status breakdown is not in listResellerAccount; the fleet
10679
- // totals come from the status call. Showing 0 here would read as "this
10680
- // account has no eSIMs", so the per-account columns stay at the balance
10681
- // and flags this call actually carries.
10682
- active: 0,
10683
- suspended: 0,
10684
- inventory: 0,
10685
- other: 0,
10686
- packageOnly: Boolean(a.packageOnly)
10687
- }));
10681
+ const byId = /* @__PURE__ */ new Map();
10682
+ for (const row of extractEsimStatusByAccount(raw.status)) {
10683
+ if (row.id !== void 0) byId.set(row.id, row);
10684
+ }
10685
+ const accounts = accountRecords.map((a) => {
10686
+ const id = Number(a.id ?? a.accountId);
10687
+ const status = Number.isFinite(id) ? byId.get(id) : void 0;
10688
+ return {
10689
+ name: String(a.name ?? a.accountId ?? "?"),
10690
+ balance: Number(a.balance ?? 0),
10691
+ active: status?.active ?? 0,
10692
+ suspended: status?.suspended ?? 0,
10693
+ inventory: status?.inventory ?? 0,
10694
+ other: status?.other ?? 0,
10695
+ packageOnly: Boolean(a.packageOnly)
10696
+ };
10697
+ });
10688
10698
  const unavailable = [];
10689
10699
  if (raw.statusError) unavailable.push(`esimStatusPerAccount: ${raw.statusError}`);
10690
10700
  if (raw.accountsError) unavailable.push(`listResellerAccount: ${raw.accountsError}`);