@carrierllc/mcp 0.13.10 → 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/{chunk-AUOGFI2I.js → chunk-IQDAU7WA.js} +69 -15
- package/dist/chunk-IQDAU7WA.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +28 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-AUOGFI2I.js.map +0 -1
|
@@ -1820,7 +1820,7 @@ function storefrontScreen(input) {
|
|
|
1820
1820
|
// package.json
|
|
1821
1821
|
var package_default = {
|
|
1822
1822
|
name: "@carrierllc/mcp",
|
|
1823
|
-
version: "0.13.
|
|
1823
|
+
version: "0.13.12",
|
|
1824
1824
|
description: "Carrier MCP \u2014 natural-language control of MVNO/eSIM fleets via eSIMVault OCS. Stdio mode for direct integration with Claude Desktop, Cursor, Windsurf, and MCP-compatible clients. Ships the `carrier` CLI (plugin install + white-label eSIM storefront scaffold).",
|
|
1825
1825
|
license: "MIT",
|
|
1826
1826
|
author: "Carrier (Lifecycle Innovations Limited)",
|
|
@@ -1901,7 +1901,7 @@ var package_default = {
|
|
|
1901
1901
|
// src/version.ts
|
|
1902
1902
|
var CARRIER_VERSION = package_default.version;
|
|
1903
1903
|
|
|
1904
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
1904
|
+
// ../../packages/ocs-client/dist/chunk-BOZG5AMY.js
|
|
1905
1905
|
var OCS_MAX_USAGE_WINDOW_DAYS = 7;
|
|
1906
1906
|
function clampUsagePeriod(start, end, maxDays = OCS_MAX_USAGE_WINDOW_DAYS) {
|
|
1907
1907
|
const endMs = Date.parse(`${end}T00:00:00Z`);
|
|
@@ -2143,27 +2143,48 @@ function addEsimStatusRow(acc, rec) {
|
|
|
2143
2143
|
}
|
|
2144
2144
|
function extractEsimStatusCounts(json) {
|
|
2145
2145
|
const acc = emptyEsimStatusCounts();
|
|
2146
|
+
for (const row of extractEsimStatusByAccount(json)) {
|
|
2147
|
+
acc.active += row.active;
|
|
2148
|
+
acc.suspended += row.suspended;
|
|
2149
|
+
acc.inventory += row.inventory;
|
|
2150
|
+
acc.other += row.other;
|
|
2151
|
+
}
|
|
2152
|
+
acc.total = acc.active + acc.suspended + acc.inventory + acc.other;
|
|
2153
|
+
return acc;
|
|
2154
|
+
}
|
|
2155
|
+
function accountRows(json) {
|
|
2146
2156
|
const root = json ?? {};
|
|
2147
2157
|
const payload = root.data ?? root.esimStatusPerAccount ?? root;
|
|
2148
|
-
|
|
2149
|
-
|
|
2158
|
+
if (Array.isArray(payload)) return payload;
|
|
2159
|
+
return Array.isArray(payload.account) ? payload.account : [];
|
|
2160
|
+
}
|
|
2161
|
+
function extractEsimStatusByAccount(json) {
|
|
2162
|
+
const out = [];
|
|
2163
|
+
for (const account of accountRows(json)) {
|
|
2150
2164
|
const rec = account ?? {};
|
|
2165
|
+
const row = emptyEsimStatusCounts();
|
|
2166
|
+
const id = Number(rec.id ?? rec.accountId);
|
|
2167
|
+
if (rec.id !== void 0 || rec.accountId !== void 0) {
|
|
2168
|
+
if (Number.isFinite(id)) row.id = id;
|
|
2169
|
+
}
|
|
2170
|
+
if (typeof rec.name === "string") row.name = rec.name;
|
|
2151
2171
|
const sponsors = Array.isArray(rec.sponsor) ? rec.sponsor : [];
|
|
2152
2172
|
if (sponsors.length > 0) {
|
|
2153
2173
|
for (const sp of sponsors) {
|
|
2154
2174
|
const esim = sp?.esim ?? {};
|
|
2155
2175
|
const statuses = Array.isArray(esim.status) ? esim.status : [];
|
|
2156
|
-
for (const
|
|
2176
|
+
for (const status of statuses) addEsimStatusRow(row, status ?? {});
|
|
2157
2177
|
}
|
|
2158
|
-
|
|
2178
|
+
} else {
|
|
2179
|
+
row.active += Number(rec.active ?? 0);
|
|
2180
|
+
row.suspended += Number(rec.suspended ?? 0);
|
|
2181
|
+
row.inventory += Number(rec.inventory ?? rec.notActivated ?? rec.free ?? 0);
|
|
2182
|
+
row.other += Number(rec.other ?? rec.terminated ?? 0);
|
|
2159
2183
|
}
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
acc.inventory += Number(rec.inventory ?? rec.notActivated ?? rec.free ?? 0);
|
|
2163
|
-
acc.other += Number(rec.other ?? rec.terminated ?? 0);
|
|
2184
|
+
row.total = row.active + row.suspended + row.inventory + row.other;
|
|
2185
|
+
out.push(row);
|
|
2164
2186
|
}
|
|
2165
|
-
|
|
2166
|
-
return acc;
|
|
2187
|
+
return out;
|
|
2167
2188
|
}
|
|
2168
2189
|
function esimStatusPerAccountParams(args) {
|
|
2169
2190
|
if (typeof args === "number") return { accountId: args };
|
|
@@ -2532,6 +2553,11 @@ function packageTemplateCreateParams(input) {
|
|
|
2532
2553
|
}
|
|
2533
2554
|
return out;
|
|
2534
2555
|
}
|
|
2556
|
+
async function withTemplateResellerId(params, resolveId) {
|
|
2557
|
+
const existing = params["resellerid"];
|
|
2558
|
+
if (typeof existing === "number" && Number.isFinite(existing)) return params;
|
|
2559
|
+
return { ...params, resellerid: await resolveId() };
|
|
2560
|
+
}
|
|
2535
2561
|
function packageTemplateCreateFromToolJson(template) {
|
|
2536
2562
|
let parsed;
|
|
2537
2563
|
try {
|
|
@@ -2679,7 +2705,7 @@ function packageTemplateModifyFromToolJson(changes, method) {
|
|
|
2679
2705
|
return packageTemplateModifyParams(body, method);
|
|
2680
2706
|
}
|
|
2681
2707
|
|
|
2682
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
2708
|
+
// ../../packages/ocs-client/dist/chunk-N2EPJJVN.js
|
|
2683
2709
|
import { z } from "zod";
|
|
2684
2710
|
var OCS_V1_METHODS = /* @__PURE__ */ new Set([
|
|
2685
2711
|
"getResellerInfo",
|
|
@@ -3024,7 +3050,7 @@ async function runWithBudget(method, attempt, budget = ocsBudgetFor(method)) {
|
|
|
3024
3050
|
throw lastTimeout ?? new OcsTimeoutError(method, budget.attemptMs, budget.totalMs, Math.max(attempts, 1));
|
|
3025
3051
|
}
|
|
3026
3052
|
|
|
3027
|
-
// ../../packages/ocs-client/dist/chunk-
|
|
3053
|
+
// ../../packages/ocs-client/dist/chunk-KZB25Q7W.js
|
|
3028
3054
|
var RATE_LIMIT = 10;
|
|
3029
3055
|
var WINDOW_MS = 1e3;
|
|
3030
3056
|
var windows = /* @__PURE__ */ new Map();
|
|
@@ -4373,6 +4399,31 @@ function subscriberSimId(record) {
|
|
|
4373
4399
|
if (nested && typeof nested === "object" && nested !== record) return subscriberSimId(nested);
|
|
4374
4400
|
return void 0;
|
|
4375
4401
|
}
|
|
4402
|
+
function extractSimProviderStatus(data) {
|
|
4403
|
+
const name = (rec) => {
|
|
4404
|
+
if (!rec || typeof rec !== "object") return void 0;
|
|
4405
|
+
const r = rec;
|
|
4406
|
+
for (const key of ["simStatus", "status"]) {
|
|
4407
|
+
const v = r[key];
|
|
4408
|
+
if (typeof v === "string" && v.trim() !== "") return v.trim();
|
|
4409
|
+
}
|
|
4410
|
+
return void 0;
|
|
4411
|
+
};
|
|
4412
|
+
if (!Array.isArray(data)) return name(data);
|
|
4413
|
+
let latest;
|
|
4414
|
+
let firstReadable;
|
|
4415
|
+
for (const entry of data) {
|
|
4416
|
+
const status = name(entry);
|
|
4417
|
+
if (status === void 0) continue;
|
|
4418
|
+
const rec = entry;
|
|
4419
|
+
const end = rec.end;
|
|
4420
|
+
if (end === void 0 || end === null || end === "") return status;
|
|
4421
|
+
firstReadable ??= status;
|
|
4422
|
+
const at = typeof rec.start === "string" || typeof rec.start === "number" ? Date.parse(String(rec.start)) : NaN;
|
|
4423
|
+
if (Number.isFinite(at) && (!latest || at > latest.at)) latest = { status, at };
|
|
4424
|
+
}
|
|
4425
|
+
return latest?.status ?? firstReadable;
|
|
4426
|
+
}
|
|
4376
4427
|
function prepaidPackageRows(data) {
|
|
4377
4428
|
return ocsArray(data, PREPAID_PACKAGE_KEYS);
|
|
4378
4429
|
}
|
|
@@ -4718,11 +4769,13 @@ export {
|
|
|
4718
4769
|
packageActivePeriodParams,
|
|
4719
4770
|
recurringIdForPackage,
|
|
4720
4771
|
extractEsimStatusCounts,
|
|
4772
|
+
extractEsimStatusByAccount,
|
|
4721
4773
|
esimStatusPerAccountParams,
|
|
4722
4774
|
ocsHlrBitrate,
|
|
4723
4775
|
ocsHlrBitrateFromBps,
|
|
4724
4776
|
ocsSimStatus,
|
|
4725
4777
|
locationZoneCreateParams,
|
|
4778
|
+
withTemplateResellerId,
|
|
4726
4779
|
packageTemplateCreateFromToolJson,
|
|
4727
4780
|
packageTemplateModifyFromToolJson,
|
|
4728
4781
|
getLimitForEndpoint,
|
|
@@ -4744,6 +4797,7 @@ export {
|
|
|
4744
4797
|
subscriberRows,
|
|
4745
4798
|
extractResellerBalance,
|
|
4746
4799
|
subscriberSimId,
|
|
4800
|
+
extractSimProviderStatus,
|
|
4747
4801
|
prepaidPackageRows,
|
|
4748
4802
|
isActivePackage,
|
|
4749
4803
|
staleActivePackages,
|
|
@@ -4792,4 +4846,4 @@ export {
|
|
|
4792
4846
|
storefrontScreen,
|
|
4793
4847
|
CARRIER_VERSION
|
|
4794
4848
|
};
|
|
4795
|
-
//# sourceMappingURL=chunk-
|
|
4849
|
+
//# sourceMappingURL=chunk-IQDAU7WA.js.map
|