@carrierllc/mcp 0.13.33 → 0.13.35
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
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
verifyStorefront,
|
|
81
81
|
withOcsListSummary,
|
|
82
82
|
withTemplateResellerId
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-EH3ZRLVZ.js";
|
|
84
84
|
import "./chunk-SHKKVIIA.js";
|
|
85
85
|
|
|
86
86
|
// src/index.ts
|
|
@@ -1304,12 +1304,19 @@ function wrapHandler(toolName, ocsMethod, requiredScope, ctx, handler, options)
|
|
|
1304
1304
|
content: [{ type: "text", text: `Error: ${message}` }]
|
|
1305
1305
|
};
|
|
1306
1306
|
}
|
|
1307
|
+
const handledOcsCode = result2.ocsStatusCode;
|
|
1308
|
+
if (handledOcsCode !== void 0) {
|
|
1309
|
+
const { ocsStatusCode: _auditOnly, ...clientResult } = result2;
|
|
1310
|
+
void _auditOnly;
|
|
1311
|
+
result2 = clientResult;
|
|
1312
|
+
}
|
|
1307
1313
|
ctx.audit({
|
|
1308
1314
|
tool_name: toolName,
|
|
1309
1315
|
ocs_method: ocsMethod,
|
|
1310
1316
|
status: result2.isError ? "error" : "ok",
|
|
1311
1317
|
dry_run: isDryRun,
|
|
1312
|
-
duration_ms: Date.now() - start
|
|
1318
|
+
duration_ms: Date.now() - start,
|
|
1319
|
+
...handledOcsCode !== void 0 ? { ocs_status_code: handledOcsCode } : {}
|
|
1313
1320
|
});
|
|
1314
1321
|
if (!result2.isError && !isDryRun) {
|
|
1315
1322
|
recordUsage(ctx.env, ctx.props.sub, ctx.props.tier);
|
|
@@ -5041,7 +5048,25 @@ function registerAllBacklogTools(server2, ctx) {
|
|
|
5041
5048
|
ctx,
|
|
5042
5049
|
async ({ voip_plan_id }, token2) => {
|
|
5043
5050
|
const client2 = new OcsClient(ctx.env.CARRIER_OCS_BASE_URL, token2);
|
|
5044
|
-
|
|
5051
|
+
let result2;
|
|
5052
|
+
try {
|
|
5053
|
+
result2 = await client2.call("listVoipTariffRule", voip_plan_id);
|
|
5054
|
+
} catch (err9) {
|
|
5055
|
+
if (err9 instanceof OcsApiError && err9.code === 11) {
|
|
5056
|
+
return {
|
|
5057
|
+
isError: true,
|
|
5058
|
+
// Returned, not thrown, so pass the code to wrapHandler's audit row.
|
|
5059
|
+
ocsStatusCode: 11,
|
|
5060
|
+
content: [
|
|
5061
|
+
{
|
|
5062
|
+
type: "text",
|
|
5063
|
+
text: `No VoIP tariff rules readable for VoIP plan ${voip_plan_id} under this reseller (OCS error 11: Reseller not found). OCS returns this when the plan is not owned by your reseller, for example the get_reseller_info chargingInfo.voipPlan id, which is the plan your parent reseller bills you on. Use a plan id from list_subscriber_voip_tariff; if that returns no rows, this reseller has no VoIP catalog configured.`
|
|
5064
|
+
}
|
|
5065
|
+
]
|
|
5066
|
+
};
|
|
5067
|
+
}
|
|
5068
|
+
throw err9;
|
|
5069
|
+
}
|
|
5045
5070
|
return {
|
|
5046
5071
|
content: [{ type: "text", text: JSON.stringify(result2, null, 2) }]
|
|
5047
5072
|
};
|
|
@@ -12438,7 +12463,7 @@ function buildListSteps(portalBaseUrl) {
|
|
|
12438
12463
|
];
|
|
12439
12464
|
}
|
|
12440
12465
|
function resolvePortalBaseUrl(env) {
|
|
12441
|
-
return env.GREENZONE_PORTAL_URL ?? env.CARRIER_OCS_PORTAL_URL ?? env.
|
|
12466
|
+
return env.GREENZONE_PORTAL_URL ?? env.CARRIER_OCS_PORTAL_URL ?? env.OCS_DASHBOARD_URL ?? "https://portal-esimvault.cloud";
|
|
12442
12467
|
}
|
|
12443
12468
|
|
|
12444
12469
|
// src/tools-greenzone.ts
|
|
@@ -12917,7 +12942,15 @@ var stdioEnv = {
|
|
|
12917
12942
|
// heard of is just the same dead gate one step further along. Setting it to
|
|
12918
12943
|
// anything other than "true" still turns the router off.
|
|
12919
12944
|
CARRIER_ASK_ENABLED: process.env.CARRIER_ASK_ENABLED ?? "true",
|
|
12920
|
-
BILLING_PRIMARY: process.env.BILLING_PRIMARY
|
|
12945
|
+
BILLING_PRIMARY: process.env.BILLING_PRIMARY,
|
|
12946
|
+
// Reseller portal host for the Greenzone tools. Copied as-is (undefined when
|
|
12947
|
+
// unset, "" kept) so resolvePortalBaseUrl's `??` chain sees exactly what the
|
|
12948
|
+
// operator set: GREENZONE_PORTAL_URL ?? CARRIER_OCS_PORTAL_URL ??
|
|
12949
|
+
// OCS_DASHBOARD_URL ?? https://portal-esimvault.cloud. Without these lines
|
|
12950
|
+
// every override was dropped here and the default always won.
|
|
12951
|
+
GREENZONE_PORTAL_URL: process.env.GREENZONE_PORTAL_URL,
|
|
12952
|
+
CARRIER_OCS_PORTAL_URL: process.env.CARRIER_OCS_PORTAL_URL,
|
|
12953
|
+
OCS_DASHBOARD_URL: process.env.OCS_DASHBOARD_URL
|
|
12921
12954
|
};
|
|
12922
12955
|
var props = {
|
|
12923
12956
|
sub: "stdio@local",
|