younium-mcp 1.0.0 → 1.0.2

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/auth.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getToken = getToken;
4
- const TOKEN_URL = "https://auth.younium.com/connect/token";
5
- const REFRESH_BUFFER_SECS = 60;
4
+ const TOKEN_URL = "https://api.younium.com/auth/token";
5
+ const REFRESH_BUFFER_SECS = 300;
6
6
  let cached = null;
7
7
  function getEnv(name) {
8
8
  const val = process.env[name];
@@ -15,24 +15,19 @@ async function getToken() {
15
15
  if (cached && cached.expiresAt > now + REFRESH_BUFFER_SECS) {
16
16
  return cached.value;
17
17
  }
18
- const body = new URLSearchParams({
19
- grant_type: "password",
20
- scope: "youniumapi",
21
- username: getEnv("YOUNIUM_USERNAME"),
22
- password: getEnv("YOUNIUM_PASSWORD"),
23
- client_id: getEnv("YOUNIUM_CLIENT_ID"),
24
- client_secret: getEnv("YOUNIUM_CLIENT_SECRET"),
25
- });
26
18
  const res = await fetch(TOKEN_URL, {
27
19
  method: "POST",
28
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
29
- body: body.toString(),
20
+ headers: { "Content-Type": "application/json" },
21
+ body: JSON.stringify({
22
+ clientId: getEnv("YOUNIUM_CLIENT_ID"),
23
+ secret: getEnv("YOUNIUM_SECRET"),
24
+ }),
30
25
  });
31
26
  if (!res.ok) {
32
27
  const text = await res.text();
33
28
  throw new Error(`Younium auth failed (${res.status}): ${text}`);
34
29
  }
35
30
  const data = (await res.json());
36
- cached = { value: data.access_token, expiresAt: now + data.expires_in };
31
+ cached = { value: data.accessToken, expiresAt: now + data.expiresIn };
37
32
  return cached.value;
38
33
  }
@@ -131,9 +131,13 @@ function loadTools() {
131
131
  continue;
132
132
  const rawId = op.operationId ?? `${method}_${pathTemplate.replace(/[^a-zA-Z0-9]/g, "_")}`;
133
133
  let name = operationIdToName(rawId);
134
- // Deduplicate
134
+ // Enforce 64-char limit then deduplicate
135
+ if (name.length > 64) {
136
+ name = name.slice(0, 64).replace(/_+$/, "");
137
+ }
135
138
  if (seen.has(name)) {
136
- name = `${name}_${method}`;
139
+ const suffix = `_${method}`;
140
+ name = name.slice(0, 64 - suffix.length).replace(/_+$/, "") + suffix;
137
141
  }
138
142
  seen.add(name);
139
143
  const description = [op.summary, op.description]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "younium-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "MCP server for the Younium subscription management API",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",