@carrierllc/mcp 0.2.12 → 0.2.14
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 +32 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5560,11 +5560,12 @@ function registerProvisioningWizard(server2, ctx) {
|
|
|
5560
5560
|
isError: true
|
|
5561
5561
|
};
|
|
5562
5562
|
}
|
|
5563
|
+
const resellerIdForTemplates = await getDefaultResellerId(ctx.env, token2);
|
|
5563
5564
|
const packagesResult = await safeCallWithToken2(
|
|
5564
5565
|
client,
|
|
5565
5566
|
token2,
|
|
5566
|
-
"
|
|
5567
|
-
{}
|
|
5567
|
+
"listPrepaidPackageTemplate",
|
|
5568
|
+
{ resellerId: resellerIdForTemplates }
|
|
5568
5569
|
);
|
|
5569
5570
|
const updated = {
|
|
5570
5571
|
...session,
|
|
@@ -6963,11 +6964,36 @@ var PROJECTS_TOOLS = [
|
|
|
6963
6964
|
handler: async (env, props2) => {
|
|
6964
6965
|
const sub = props2.sub;
|
|
6965
6966
|
const orgId = props2.org_id;
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6967
|
+
if (!env.CARRIER_USERS) {
|
|
6968
|
+
return {
|
|
6969
|
+
credentials: {
|
|
6970
|
+
esimvault_token: {
|
|
6971
|
+
present: true,
|
|
6972
|
+
encrypted: false,
|
|
6973
|
+
last_updated: null,
|
|
6974
|
+
age_days: null,
|
|
6975
|
+
rotation_recommended: false,
|
|
6976
|
+
source: "env-var (stdio)"
|
|
6977
|
+
},
|
|
6978
|
+
oauth: { active: false, method: props2.auth_method ?? "stdio" }
|
|
6979
|
+
},
|
|
6980
|
+
environment: {
|
|
6981
|
+
org_id: orgId ?? null,
|
|
6982
|
+
reseller_id: props2.reseller_id,
|
|
6983
|
+
reseller_name: props2.reseller_name
|
|
6984
|
+
},
|
|
6985
|
+
recommendations: ["stdio mode \u2014 token managed via ESIMVAULT_API_TOKEN env var, no rotation tracking"]
|
|
6986
|
+
};
|
|
6987
|
+
}
|
|
6988
|
+
const primaryKey = orgId ? `org:${orgId}` : `user:clerk_${sub}`;
|
|
6989
|
+
const legacyKey = orgId ? null : `user:${sub}`;
|
|
6990
|
+
let record = await env.CARRIER_USERS.get(primaryKey, "json").catch(() => null);
|
|
6991
|
+
if (!record && legacyKey) {
|
|
6992
|
+
record = await env.CARRIER_USERS.get(legacyKey, "json").catch(() => null);
|
|
6993
|
+
}
|
|
6994
|
+
const hasToken = !!(record && "esimvault_token_enc" in record && record.esimvault_token_enc);
|
|
6969
6995
|
const oauthKey = `oauth:grant:${sub}`;
|
|
6970
|
-
const oauthGrant = await env.OAUTH_KV.get(oauthKey, "json").catch(() => null);
|
|
6996
|
+
const oauthGrant = env.OAUTH_KV ? await env.OAUTH_KV.get(oauthKey, "json").catch(() => null) : null;
|
|
6971
6997
|
const updatedAt = record && "updated_at" in record ? record.updated_at : null;
|
|
6972
6998
|
let tokenAgeDays = null;
|
|
6973
6999
|
if (updatedAt) {
|