@ilivemylife/graph-sdk 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/cli.mjs CHANGED
@@ -523,7 +523,7 @@ function createApolloClient(options) {
523
523
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
524
524
  const requestHeaders = {
525
525
  "access-token": token,
526
- "x-client": `sdk/${"1.0.0"}`
526
+ "x-client": `sdk/${"1.0.2"}`
527
527
  };
528
528
  const httpLink = createHttpLink({
529
529
  uri: httpUrl,
@@ -536,7 +536,7 @@ function createApolloClient(options) {
536
536
  if (enableSubscriptions) {
537
537
  const wsClientOptions = {
538
538
  url: wsUrl,
539
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.0"}` }
539
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.2"}` }
540
540
  };
541
541
  if (webSocketImpl) {
542
542
  wsClientOptions.webSocketImpl = webSocketImpl;
@@ -1520,12 +1520,13 @@ async function cmdLogin(args) {
1520
1520
  const tempGraph = createGraphClient({ token: "temp" });
1521
1521
  try {
1522
1522
  const result = await tempGraph.login(email, password);
1523
+ const name = result.user.displayName || result.user.fullName || result.user.email;
1523
1524
  const config = {
1524
1525
  token: result.accessToken,
1525
1526
  user: {
1526
1527
  id: result.user.id,
1527
1528
  email: result.user.email,
1528
- displayName: result.user.displayName
1529
+ displayName: name
1529
1530
  },
1530
1531
  rootItemId: result.user.rootItemId
1531
1532
  };
@@ -1541,7 +1542,7 @@ async function cmdLogin(args) {
1541
1542
  console.log("\n" + "\u2550".repeat(60));
1542
1543
  console.log("Login successful!");
1543
1544
  console.log("\u2500".repeat(60));
1544
- console.log(`User: ${result.user.displayName || result.user.email}`);
1545
+ console.log(`User: ${name}`);
1545
1546
  console.log(`Root node: ${result.user.rootItemId}`);
1546
1547
  console.log("\u2500".repeat(60));
1547
1548
  console.log(`Config saved to: ${savedPath}`);
@@ -1639,37 +1640,24 @@ async function cmdMe() {
1639
1640
  console.log('Not logged in. Run "ilml login" to authenticate.');
1640
1641
  return;
1641
1642
  }
1642
- if (config.user) {
1643
- console.log("\n" + "\u2550".repeat(60));
1644
- console.log("Cached user info:");
1645
- console.log("\u2500".repeat(60));
1646
- console.log(`User: ${config.user.displayName || "N/A"}`);
1647
- console.log(`Email: ${config.user.email || "N/A"}`);
1648
- console.log(`User ID: ${config.user.id || "N/A"}`);
1649
- console.log(`Root node: ${config.rootItemId || "N/A"}`);
1650
- console.log("\u2500".repeat(60));
1651
- }
1652
- console.log("Verifying with API...");
1653
1643
  try {
1654
1644
  const graph = getGraph();
1655
1645
  const user = await graph.me();
1646
+ const name = user.displayName || user.fullName || "N/A";
1656
1647
  console.log("\n" + "\u2550".repeat(60));
1657
- console.log("Current user (from API):");
1658
- console.log("\u2500".repeat(60));
1659
- console.log(`User: ${user.displayName || "N/A"}`);
1648
+ console.log(`User: ${name}`);
1660
1649
  console.log(`Email: ${user.email || "N/A"}`);
1661
1650
  console.log(`User ID: ${user.id || "N/A"}`);
1662
1651
  console.log(`Root node: ${user.rootItemId || "N/A"}`);
1663
1652
  console.log("\u2550".repeat(60));
1664
- if (user.rootItemId && user.rootItemId !== config.rootItemId) {
1653
+ if (user.rootItemId && (user.rootItemId !== config.rootItemId || !config.user?.displayName)) {
1665
1654
  config.rootItemId = user.rootItemId;
1666
1655
  config.user = {
1667
1656
  id: user.id,
1668
1657
  email: user.email,
1669
- displayName: user.displayName
1658
+ displayName: name
1670
1659
  };
1671
1660
  saveConfig(config);
1672
- console.log("Config updated with latest user info.");
1673
1661
  }
1674
1662
  } catch (error) {
1675
1663
  console.error("Token is invalid or expired:", error.message);
@@ -2370,7 +2358,7 @@ async function cmdUpdate() {
2370
2358
  const { execSync } = await import("child_process");
2371
2359
  console.log("Checking for updates...");
2372
2360
  try {
2373
- const currentVersion = "1.0.0";
2361
+ const currentVersion = "1.0.2";
2374
2362
  let latestVersion;
2375
2363
  try {
2376
2364
  const result = execSync("npm view @ilivemylife/graph-sdk version", { encoding: "utf-8" }).trim();
@@ -2400,7 +2388,7 @@ async function cmdDoctor() {
2400
2388
  console.log("\u2550".repeat(60));
2401
2389
  let issues = 0;
2402
2390
  console.log(`
2403
- [Version] ${"1.0.0"}`);
2391
+ [Version] ${"1.0.2"}`);
2404
2392
  const localConfigPath = findLocalConfigFile();
2405
2393
  const globalExists = existsSync(GLOBAL_CONFIG_FILE);
2406
2394
  console.log("\n[Config Files]");
@@ -2414,8 +2402,10 @@ async function cmdDoctor() {
2414
2402
  }
2415
2403
  if (localData.token) {
2416
2404
  console.log(` Token: ${localData.token.substring(0, 10)}...`);
2405
+ console.log(" \u2190 ACTIVE (takes priority)");
2406
+ } else {
2407
+ console.log(' Token: (missing \u2014 run "ilml login --local")');
2417
2408
  }
2418
- console.log(" \u2190 ACTIVE (takes priority)");
2419
2409
  } catch {
2420
2410
  console.log(" (could not read)");
2421
2411
  }
@@ -2433,9 +2423,11 @@ async function cmdDoctor() {
2433
2423
  }
2434
2424
  if (globalData.token) {
2435
2425
  console.log(` Token: ${globalData.token.substring(0, 10)}...`);
2436
- }
2437
- if (!localConfigPath) {
2438
- console.log(" \u2190 ACTIVE");
2426
+ if (!localConfigPath) {
2427
+ console.log(" \u2190 ACTIVE");
2428
+ }
2429
+ } else {
2430
+ console.log(' Token: (missing \u2014 run "ilml login")');
2439
2431
  }
2440
2432
  } catch {
2441
2433
  console.log(" (could not read)");
@@ -2476,7 +2468,7 @@ async function cmdDoctor() {
2476
2468
  try {
2477
2469
  const graph = createGraphClient({ token });
2478
2470
  const user = await graph.me();
2479
- console.log(` \u2713 Connected as: ${user.displayName || user.email}`);
2471
+ console.log(` \u2713 Connected as: ${user.displayName || user.fullName || user.email}`);
2480
2472
  console.log(` \u2713 Root node: ${user.rootItemId}`);
2481
2473
  } catch (error) {
2482
2474
  const message = error.message;
@@ -2587,11 +2579,11 @@ async function cmdUninstall() {
2587
2579
  console.log("\u2550".repeat(60));
2588
2580
  }
2589
2581
  function showVersion() {
2590
- console.log(`@ilivemylife/graph-sdk v${"1.0.0"}`);
2582
+ console.log(`@ilivemylife/graph-sdk v${"1.0.2"}`);
2591
2583
  }
2592
2584
  function showHelp() {
2593
2585
  console.log(`
2594
- @ilivemylife/graph-sdk v${"1.0.0"}
2586
+ @ilivemylife/graph-sdk v${"1.0.2"}
2595
2587
  CLI for iLiveMyLife Knowledge Graph
2596
2588
 
2597
2589
  USAGE
package/dist/client.cjs CHANGED
@@ -623,7 +623,7 @@ function createApolloClient(options) {
623
623
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
624
624
  const requestHeaders = {
625
625
  "access-token": token,
626
- "x-client": `sdk/${"1.0.0"}`
626
+ "x-client": `sdk/${"1.0.2"}`
627
627
  };
628
628
  const httpLink = createHttpLink({
629
629
  uri: httpUrl,
@@ -636,7 +636,7 @@ function createApolloClient(options) {
636
636
  if (enableSubscriptions) {
637
637
  const wsClientOptions = {
638
638
  url: wsUrl,
639
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.0"}` }
639
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.2"}` }
640
640
  };
641
641
  if (webSocketImpl) {
642
642
  wsClientOptions.webSocketImpl = webSocketImpl;
package/dist/client.mjs CHANGED
@@ -550,7 +550,7 @@ function createApolloClient(options) {
550
550
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
551
551
  const requestHeaders = {
552
552
  "access-token": token,
553
- "x-client": `sdk/${"1.0.0"}`
553
+ "x-client": `sdk/${"1.0.2"}`
554
554
  };
555
555
  const httpLink = createHttpLink({
556
556
  uri: httpUrl,
@@ -563,7 +563,7 @@ function createApolloClient(options) {
563
563
  if (enableSubscriptions) {
564
564
  const wsClientOptions = {
565
565
  url: wsUrl,
566
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.0"}` }
566
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.2"}` }
567
567
  };
568
568
  if (webSocketImpl) {
569
569
  wsClientOptions.webSocketImpl = webSocketImpl;
@@ -540,7 +540,7 @@ function createApolloClient(options) {
540
540
  const { token, httpUrl, wsUrl, enableSubscriptions, webSocketImpl } = options;
541
541
  const requestHeaders = {
542
542
  "access-token": token,
543
- "x-client": `sdk/${"1.0.0"}`
543
+ "x-client": `sdk/${"1.0.2"}`
544
544
  };
545
545
  const httpLink = createHttpLink({
546
546
  uri: httpUrl,
@@ -553,7 +553,7 @@ function createApolloClient(options) {
553
553
  if (enableSubscriptions) {
554
554
  const wsClientOptions = {
555
555
  url: wsUrl,
556
- connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.0"}` }
556
+ connectionParams: { "access-token": token, "x-client": `sdk/${"1.0.2"}` }
557
557
  };
558
558
  if (webSocketImpl) {
559
559
  wsClientOptions.webSocketImpl = webSocketImpl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilivemylife/graph-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "SDK and CLI for iLiveMyLife Knowledge Graph",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -12,7 +12,7 @@
12
12
  "module": "./dist/client.mjs",
13
13
  "types": "./dist/client.d.ts",
14
14
  "bin": {
15
- "ilml": "./bin/ilml",
15
+ "ilml": "./dist/cli.mjs",
16
16
  "ilml-mcp": "./dist/mcp-server.mjs"
17
17
  },
18
18
  "exports": {
@@ -29,7 +29,6 @@
29
29
  },
30
30
  "files": [
31
31
  "dist",
32
- "bin",
33
32
  "examples"
34
33
  ],
35
34
  "scripts": {
package/bin/ilml DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { main } from '../dist/cli.mjs';
4
-
5
- main();