Add public document sharing and password publishing APIs#36
Open
Copilot wants to merge 5 commits into
Open
Conversation
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
TechQuery
requested changes
Jun 19, 2026
There was a problem hiding this comment.
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 on lines
+303
to
+308
| const [[pathType, token]] = DriveFileModel.parseURI(URI), | ||
| type: PublicFileType = | ||
| pathType === 'wiki' | ||
| ? pathType | ||
| : getLarkDocumentType(pathType as LarkDocumentPathType); | ||
|
|
Comment on lines
+45
to
+48
| export interface PublishedFile { | ||
| permissionPublic: Partial<PermissionPublic>; | ||
| password?: string; | ||
| } |
Comment on lines
+296
to
+300
| async publishFile( | ||
| URI: string, | ||
| enablePassword = false, | ||
| editable = false | ||
| ): Promise<PublishedFile> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
src/module/Drive/type.tsHigh-level publish helper
LarkApp.prototype.publishFile(URI, enablePassword = false, editable = false)anyone_readableby defaultanyone_editablewheneditable = trueenablePassword = trueType surface