add-connector

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
📋 通用说明:shared-instructions.md - 跨领域相关事项。

Add Connector (Generic)

添加连接器(通用版)

Fallback skill for any connector not covered by a specific
/add-*
skill. For common connectors, prefer the dedicated skills:
  • /add-dataverse
    -- Dataverse tables
  • /add-azuredevops
    -- Azure DevOps
  • /add-teams
    -- Microsoft Teams
  • /add-excel
    -- Excel Online (Business)
  • /add-onedrive
    -- OneDrive for Business
  • /add-sharepoint
    -- SharePoint Online
  • /add-office365
    -- Office 365 Outlook (calendar, email, contacts)
作为未被特定
/add-*
技能覆盖的连接器的备选技能。对于常用连接器,优先使用专用技能:
  • /add-dataverse
    -- Dataverse 表
  • /add-azuredevops
    -- Azure DevOps
  • /add-teams
    -- Microsoft Teams
  • /add-excel
    -- Excel Online (Business)
  • /add-onedrive
    -- OneDrive for Business
  • /add-sharepoint
    -- SharePoint Online
  • /add-office365
    -- Office 365 Outlook(日历、邮件、联系人)

Workflow

工作流程

  1. Check Memory Bank → 2. Identify Connector → 3. Add Connector → 4. Inspect & Configure → 5. Build → 6. Update Memory Bank

  1. 检查记忆库 → 2. 识别连接器 → 3. 添加连接器 → 4. 检查与配置 → 5. 构建 → 6. 更新记忆库

Step 1: Check Memory Bank

步骤1:检查记忆库

Check for
memory-bank.md
per shared-instructions.md.
根据shared-instructions.md检查
memory-bank.md
文件。

Step 2: Identify Connector

步骤2:识别连接器

If
$ARGUMENTS
is provided or the caller already specified the connector
, use it directly and skip the question below.
Otherwise, ask the user which connector they want to add. Browse available connectors: Connector Reference
Before proceeding, check if the connector has a dedicated skill. If it does, delegate immediately and STOP:
Connector API nameDelegate to
sharepointonline
/add-sharepoint
teams
/add-teams
excelonlinebusiness
/add-excel
onedriveforbusiness
/add-onedrive
azuredevops
/add-azuredevops
office365
/add-office365
commondataservice
/add-dataverse
Invoke the appropriate skill with the same
$ARGUMENTS
and do not continue this skill's workflow.
Common connector API names:
  • sharepointonline
    ,
    teams
    ,
    excelonlinebusiness
    ,
    onedriveforbusiness
  • azuredevops
    ,
    azureblob
    ,
    azurequeues
  • office365
    ,
    office365users
    ,
    office365groups
  • sql
    ,
    commondataservice
如果已提供
$ARGUMENTS
或调用者已指定连接器
,直接使用该连接器,跳过以下问题。
否则,询问用户想要添加的连接器。可浏览可用连接器:连接器参考文档
在继续之前,检查该连接器是否有专用技能。如果有,立即委托给该技能并停止当前流程:
连接器API名称委托至技能
sharepointonline
/add-sharepoint
teams
/add-teams
excelonlinebusiness
/add-excel
onedriveforbusiness
/add-onedrive
azuredevops
/add-azuredevops
office365
/add-office365
commondataservice
/add-dataverse
使用相同的
$ARGUMENTS
调用相应技能,不要继续当前技能的工作流程
常用连接器API名称:
  • sharepointonline
    ,
    teams
    ,
    excelonlinebusiness
    ,
    onedriveforbusiness
  • azuredevops
    ,
    azureblob
    ,
    azurequeues
  • office365
    ,
    office365users
    ,
    office365groups
  • sql
    ,
    commondataservice

Step 3: Add Connector

步骤3:添加连接器

First, find the connection ID (see connector-reference.md):
Run the
/list-connections
skill. Find the connector in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from
power.config.json
or a prior step):
https://make.powerapps.com/environments/<environment-id>/connections
+ New connection → search for the connector → Create.
bash
undefined
首先,查找连接ID(参考connector-reference.md):
运行
/list-connections
技能。在输出结果中查找该连接器。如果不存在,引导用户使用环境专属的连接URL创建连接——根据上下文(来自
power.config.json
或之前步骤)中的活跃环境ID构建该URL:
https://make.powerapps.com/environments/<environment-id>/connections
+ 新建连接 → 搜索连接器 → 创建。
bash
undefined

Non-tabular connectors (Teams, Azure DevOps, etc.)

非表格型连接器(Teams、Azure DevOps等)

pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id>"
pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id>"

Tabular connectors (SharePoint, Excel, SQL, etc.) -- also need dataset and table

表格型连接器(SharePoint、Excel、SQL等)——还需要数据集和表

pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id> -d '<dataset>' -t '<table>'"

**Parameter reference:**

- `-a` (apiId) -- connector name (e.g., `sharepointonline`, `teams`)
- `-c` (connectionId) -- **required** for all non-Dataverse connectors. Get from `/list-connections`.
- `-d` (dataset) -- required for tabular datasources (e.g., SharePoint site URL, SQL database). Not needed for Dataverse.
- `-t` (table) -- table/list name for tabular datasources (e.g., SharePoint list, Dataverse table logical name)
pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id> -d '<dataset>' -t '<table>'"

**参数参考:**

- `-a`(apiId)——连接器名称(例如`sharepointonline`, `teams`)
- `-c`(connectionId)——**所有非Dataverse连接器必填**。从`/list-connections`获取。
- `-d`(dataset)——表格型数据源必填(例如SharePoint站点URL、SQL数据库)。Dataverse无需此参数。
- `-t`(table)——表格型数据源的表/列表名称(例如SharePoint列表、Dataverse表逻辑名称)

Step 4: Inspect & Configure

步骤4:检查与配置

After adding, inspect the generated files. Generated service files can be very large -- use
Grep
to find specific methods instead of reading the entire file:
Grep pattern="async \w+" path="src/generated/services/<Connector>Service.ts"
Files to check:
  • src/generated/services/<Connector>Service.ts
    -- available operations and their parameters
  • src/generated/models/<Connector>Model.ts
    -- TypeScript interfaces (if generated)
  • .power/schemas/<connector>/
    -- connector schema and configuration
For each method the user needs:
  1. Grep for the method name to find its signature
  2. Read just that method's section (use
    offset
    and
    limit
    parameters on Read)
  3. Identify required vs optional parameters and response type
Help the user write code using the generated service methods.
添加完成后,检查生成的文件。生成的服务文件可能非常大——使用
Grep
查找特定方法,而非阅读整个文件:
Grep pattern="async \w+" path="src/generated/services/<Connector>Service.ts"
需要检查的文件:
  • src/generated/services/<Connector>Service.ts
    ——可用操作及其参数
  • src/generated/models/<Connector>Model.ts
    ——TypeScript接口(若已生成)
  • .power/schemas/<connector>/
    ——连接器架构与配置
对于用户需要的每个方法:
  1. 使用Grep查找方法名称以获取其签名
  2. 仅阅读该方法的相关部分(使用Read操作的
    offset
    limit
    参数)
  3. 区分必填参数与可选参数,以及响应类型
协助用户使用生成的服务方法编写代码。

Step 5: Build

步骤5:构建

powershell
npm run build
Fix TypeScript errors before proceeding. Do NOT deploy yet.
powershell
npm run build
继续前修复所有TypeScript错误。暂不部署

Step 6: Update Memory Bank

步骤6:更新记忆库

Update
memory-bank.md
with: connector added, configured operations, build status.
memory-bank.md
中更新以下内容:已添加的连接器、已配置的操作、构建状态。