Skip to content

Add public document sharing and password publishing APIs#36

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-47602664-470670876-0b944f31-7201-4c29-ab2f-8872e545ac45
Open

Add public document sharing and password publishing APIs#36
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-47602664-470670876-0b944f31-7201-4c29-ab2f-8872e545ac45

Conversation

Copilot AI commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR-36 PR-36 PR-36 Powered by Pull Request Badge

This PR adds SDK support for publishing Lark/Feishu documents externally. It wraps the public permission and password APIs, and exposes a high-level LarkApp.prototype.publishFile() helper for common sharing flows.

  • Drive permission API wrappers

    • add typed wrappers for updating public document permissions
    • add typed wrapper for enabling a public access password
    • model the relevant public-permission request/response payloads in src/module/Drive/type.ts
  • High-level publish helper

    • add LarkApp.prototype.publishFile(URI, enablePassword = false, editable = false)
    • resolve the input URI into document type/token
    • enable external access and set link sharing to:
      • anyone_readable by default
      • anyone_editable when editable = true
    • optionally create and return a password when enablePassword = true
  • Type surface

    • export the new public permission and publish result types through the existing module exports
    • return a structured publish result containing updated permission state and optional password
const result = await larkApp.publishFile(
    'https://example.feishu.cn/docx/xxxx',
    true,
    false
);

// result.password -> generated share password
// result.permissionPublic -> updated public permission state

Copilot AI changed the title [WIP] Add APIs for document sharing in MobX-Lark Add public document sharing and password publishing APIs Jun 19, 2026
Copilot AI requested a review from TechQuery June 19, 2026 22:51
Comment thread src/module/Drive/type.ts Outdated
@TechQuery TechQuery marked this pull request as ready for review June 19, 2026 23:09
Copilot AI review requested due to automatic review settings June 19, 2026 23:09

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

This PR adds SDK support for publishing Lark/Feishu Drive documents externally by wrapping the public permission/password endpoints and introducing a high-level LarkApp.publishFile() helper.

Changes:

  • Add public permission / link-sharing / password-related type models in the Drive module.
  • Add Drive API wrappers for patching public permissions and creating a public access password.
  • Add LarkApp.prototype.publishFile(URI, enablePassword, editable) to orchestrate common “publish” flows.

Reviewed changes

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

File Description
src/module/Drive/type.ts Adds new public permission/password type surface used by the new API wrappers and publishFile() return type.
src/module/Drive/index.ts Adds wrappers for updating public permissions and creating a public password; refactors permission base URI usage for transfer owner.
src/Lark.ts Adds publishFile() helper that parses a Drive URI and applies public sharing settings (optionally generating a password).

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

Comment thread src/Lark.ts
Comment on lines +303 to +308
const [[pathType, token]] = DriveFileModel.parseURI(URI),
type: PublicFileType =
pathType === 'wiki'
? pathType
: getLarkDocumentType(pathType as LarkDocumentPathType);

Comment thread src/module/Drive/type.ts
Comment on lines +45 to +48
export interface PublishedFile {
permissionPublic: Partial<PermissionPublic>;
password?: string;
}
Comment thread src/Lark.ts
Comment on lines +296 to +300
async publishFile(
URI: string,
enablePassword = false,
editable = false
): Promise<PublishedFile> {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Some improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants