Skip to content

PLUG-131: Add shareDiagram API to Mermaid Chart SDK - #51

Open
Prashant-7718 wants to merge 5 commits into
mainfrom
PLUG-131-share-mermaid-chart-diagrams-with-colleagues-from-vs-code
Open

PLUG-131: Add shareDiagram API to Mermaid Chart SDK#51
Prashant-7718 wants to merge 5 commits into
mainfrom
PLUG-131-share-mermaid-chart-diagrams-with-colleagues-from-vs-code

Conversation

@Prashant-7718

@Prashant-7718 Prashant-7718 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Adds shareDiagram(documentID, request) to the SDK, along with ShareDiagramRequest/ShareDiagramResponse types and the /rest-api/documents/:documentID/share URL helper, so clients can generate a share link and optionally send email invites.

Note: Do not merge until the collab PR is merged.

Copilot AI lite review requested due to automatic review settings September 10, 2026 08:33
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
office-plugin-site Ignored Ignored Sep 10, 2026 9:47am UTC

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.

🟡 Changes recommended

The new shareDiagram() API is not covered by the existing unit test suite patterns used for other SDK methods, increasing regression risk for the endpoint URL and request payload shape.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new SDK surface area for generating diagram share links (and optionally emailing invites) by introducing a /rest-api/documents/:documentID/share URL helper, associated request/response types, and a MermaidChart.shareDiagram() method.

Changes:

  • Added share URL helper under URLS.rest.documents.pick(...) for /rest-api/documents/:documentID/share.
  • Introduced ShareDiagramAccess, ShareDiagramRequest, and ShareDiagramResponse types and wired them into the SDK entrypoint.
  • Added MermaidChart.shareDiagram(documentID, request) plus bumped the SDK version to 0.2.8.
File summaries
File Description
packages/sdk/src/urls.ts Adds a share REST URL helper for document sharing.
packages/sdk/src/types.ts Defines share-link request/response types and access-level union.
packages/sdk/src/index.ts Exposes share types and adds MermaidChart.shareDiagram() API method.
packages/sdk/package.json Bumps SDK version to 0.2.8.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/sdk/src/index.ts
Copilot AI review requested due to automatic review settings September 10, 2026 09:32

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.

🔵 Needs a closer look

A formatting issue in the newly added types section is likely to fail Prettier/lint checks.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/sdk/src/types.ts:202

  • There are two consecutive blank lines between ShareDiagramRequest and ShareDiagramResponse; this will likely fail prettier --check and should be reduced to a single blank line.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 10, 2026 09:37

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.

🟡 Changes recommended

The SDK version is being manually bumped despite the repo using Changesets to generate version bumps in a separate “Version Packages” PR, which can lead to release/versioning conflicts.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread .changeset/fluffy-birds-vanish.md
Comment thread packages/sdk/src/index.test.ts

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.

🔵 Needs a closer look

The changeset description should be corrected to accurately reflect the SDK feature being released.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.changeset/fluffy-birds-vanish.md:5

  • Changeset note is inaccurate/unclear for release notes (mentions “mermaid commercial plugin” rather than the SDK/API being added). Suggest rewording to describe the new shareDiagram API in the Mermaid Chart SDK.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 10, 2026 09:47

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.

🔵 Needs a closer look

A few public-facing docs/release notes should be corrected to accurately reflect the SDK API scope and the emailAddresses invite capability.

Review details

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

.changeset/fluffy-birds-vanish.md:5

  • The changeset summary mentions a "commercial plugin", but this PR adds a shareDiagram API to the SDK itself. Updating the summary will make the release note accurate for SDK consumers.
    packages/sdk/src/index.ts:328
  • The JSDoc for request mentions only access level, but ShareDiagramRequest also supports emailAddresses for sending invites. Updating this docstring avoids hiding that functionality from SDK consumers.
    packages/sdk/src/types.ts:199
  • ShareDiagramRequest is part of the public SDK types, but unlike nearby request interfaces in this file it lacks field-level JSDoc. Adding brief comments keeps the type docs consistent and improves editor IntelliSense for access and emailAddresses.

This issue also appears on line 201 of the same file.

packages/sdk/src/types.ts:205

  • ShareDiagramResponse is missing the short property docs that other response types in this file include. Adding JSDoc clarifies what emailsSent contains and makes the response shape self-documenting.
export interface ShareDiagramResponse {
  shareUrl: string;
  access: ShareDiagramAccess;
  emailsSent?: string[];
}
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

2 participants