mcpField
A
add-onedrive

add-onedrive

github.com/microsoft文档处理1.1k242 次安装今天更新
代码仓库

关于 add-onedrive

用于在应用中添加和配置 OneDrive for Business 连接器的开发技能,面向构建 Power Platform 应用的开发者。它涵盖文件操作选择、连接器配置、构建和状态记录。

主要功能

  1. 01检查并更新 Memory Bank
  2. 02添加 OneDrive for Business 连接器
  3. 03配置文件与文件夹操作
  4. 04构建并记录配置状态

适用场景

  1. 01列出 OneDrive 文件夹中的文件
  2. 02按需上传或下载文件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/microsoft/power-platform-skills --skill add-onedrive

安装后在 Claude Code 中输入/add-onedrive确认已加载。

详细介绍

📋 共享说明:shared-instructions.md - 跨领域注意事项。

添加 OneDrive for Business

工作流

  1. 检查 Memory Bank → 2. 添加连接器 → 3. 配置 → 4. 构建 → 5. 更新 Memory Bank

步骤 1:检查 Memory Bank

按照 shared-instructions.md 检查是否存在 memory-bank.md。

步骤 2:添加连接器

首先,查找连接 ID(请参阅 connector-reference.md):

运行 /list-connections 技能。在输出中查找 OneDrive for Business 连接。如果不存在,请引导用户使用特定于环境的 Connections URL 创建连接 — 根据上下文中的活动环境 ID(来自 power.config.json 或前一步骤)构造 URL:https://make.powerapps.com/environments/<environment-id>/connections → + 新建连接 → 搜索连接器 → 创建。

pa app add data-source --connector onedriveforbusiness -c <connection-id>
步骤 3:配置

询问用户需要哪些文件操作(列出文件、上传、下载、创建文件夹等)。

常见操作:

// List files in a folder
const files = await OneDriveForBusinessService.ListFolder({
  id: "root" // or folder ID
});

// Get file metadata
const metadata = await OneDriveForBusinessService.GetFileMetadata({
  id: "file-id"
});

// Get file content
const content = await OneDriveForBusinessService.GetFileContent({
  id: "file-id"
});

// Create file
await OneDriveForBusinessService.CreateFile({
  folderPath: "/Documents",
  name: "report.txt",
  body: "File content here"
});

要点:

  • 可通过 ListFolder 或 ListRootFolder 获取文件和文件夹 ID
  • 按路径创建文件时使用 folderPath,访问现有文件时使用 id
  • 根据操作需要,可能需要对二进制文件内容进行 base64 编码或解码

使用 Grep 在 src/generated/services/OneDriveForBusinessService.ts 中查找特定方法(生成的文件可能非常大 — 请参阅 connector-reference.md)。

步骤 4:构建
npm run build

继续之前,请先修复 TypeScript 错误。暂勿部署。

步骤 5:更新 Memory Bank

在 memory-bank.md 中更新:已添加的连接器、已配置的操作、构建状态。

评论

支持 Markdown