Skip to content

PLUG-111- Added Analytics Id For Mermaid User - #49

Merged
Prashant-7718 merged 7 commits into
mainfrom
PLUG-111-mcp-stable-analytics-identity-session-device-logged-in-user-id
Jul 31, 2026
Merged

PLUG-111- Added Analytics Id For Mermaid User#49
Prashant-7718 merged 7 commits into
mainfrom
PLUG-111-mcp-stable-analytics-identity-session-device-logged-in-user-id

Conversation

@Prashant-7718

Copy link
Copy Markdown
Contributor

Add the analyticsID field to the MCUser type so the SDK's getUser() exposes the Mermaid Chart analytics ID that the /rest-api/users/me endpoint already returns. This is a type-only change (no runtime behavior changes) that lets consumers like the MCP server identify a stable per-user ID for analytics instead of treating every event as a new user.

Copilot AI review requested due to automatic review settings July 29, 2026 13:02
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
office-plugin-site Ignored Ignored Jul 31, 2026 12:34pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in the SDK’s public types for exposing the Mermaid Chart per-user analytics identifier returned by /rest-api/users/me, enabling downstream consumers (e.g., MCP server) to reliably identify users for analytics.

Changes:

  • Added analyticsID to the exported MCUser type.
  • Updated SDK tests to include analyticsID in the mocked getUser() response.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/sdk/src/types.ts Extends the MCUser type to include the analytics identifier.
packages/sdk/src/index.test.ts Updates the mocked user object to match the expanded MCUser shape.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/sdk/src/types.ts
Copilot AI review requested due to automatic review settings July 29, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

packages/sdk/src/types.ts:26

  • MCUser is defined in multiple packages in this repo (e.g. packages/google/src/Common.ts:51 and packages/office/src/lib/mermaidChartApi.ts:33). Adding analyticsID only to the SDK copy risks the types drifting further, and consumers of the other packages calling the same /rest-api/users/me endpoint won’t see the field. Consider consolidating to a shared MCUser definition, or updating the other MCUser interfaces if they model the same API response.
export interface MCUser {
  fullName: string;
  emailAddress: string;
  analyticsID?: string;
}

Copilot AI review requested due to automatic review settings July 31, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.changeset/nice-buttons-happen.md:5

  • Typo in changeset text: "evetns" should be "events" (and the sentence can be cleaned up for clarity/capitalization).
Added the optional analyticsID for MCUser so we can track the evetns on mermaid mcp server

Copilot AI review requested due to automatic review settings July 31, 2026 12:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.changeset/nice-buttons-happen.md:2

  • The new analyticsID field is required on an exported interface, which is a breaking TypeScript change for any consumers constructing MCUser objects (their builds will start failing). A patch release is likely too low; either make the field optional or bump the changeset to a breaking release (major) to reflect the API contract change.
'@mermaidchart/sdk': patch

Copilot AI review requested due to automatic review settings July 31, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (2)

packages/sdk/src/types.ts:28

  • Adding new required properties to MCUser is a TypeScript breaking change for any consumer code that constructs/serializes MCUser values (even if runtime behavior is unchanged). If you want this to be non-breaking, make the new fields optional; otherwise the changeset should be a minor bump at least.
  emailAddress: string;
  analyticsID: string;
  avatarUrl: string | null;
  mermaidTheme?: string;
  mermaidLook?: string;

packages/sdk/src/types.ts:28

  • The PR description says this is adding only analyticsID, but this change also adds avatarUrl, mermaidTheme, and mermaidLook to MCUser. If those extra fields are intended, the PR description should be updated; if not, the type change should be scoped down to just analyticsID.
  analyticsID: string;
  avatarUrl: string | null;
  mermaidTheme?: string;
  mermaidLook?: string;

Comment thread .changeset/nice-buttons-happen.md Outdated
Copilot AI review requested due to automatic review settings July 31, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Suppressed comments (1)

packages/sdk/src/types.ts:26

  • MCUser is a public exported interface, and adding required properties (analyticsID, avatarUrl) is a breaking TypeScript change for consumers that construct/mock MCUser values (it makes previously-valid objects no longer assignable). If you want to keep this as a patch-level release, consider making the new fields optional while still documenting that the API will usually provide them.
  analyticsID: string;
  avatarUrl: string | null;

@Prashant-7718
Prashant-7718 merged commit 107b9bb into main Jul 31, 2026
51 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants