🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ks-dbdev/template-data-connector-plugin

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ks-dbdev/template-data-connector-plugin

数据连接器插件开发模板

latest
npmnpm
Version
1.0.3
Version published
Maintainers
3
Created
Source

@ks-dev/template-data-connector-plugin

多维表格数据连接器插件开发模板

npm version license

🚀 快速开始

使用 CLI 创建项目(推荐)

# 使用 dbdev CLI 工具
npx @ks-dbdev/cli create template

# 或全局安装后使用
npm install -g @ks-dbdev/cli
dbdev create template

选择 "数据连接器插件" 模板

📁 项目结构

template-data-connector-plugin/
├── package.json
├── plugin.json              # 插件配置
├── README.md
├── src/
│   ├── main.py             # Python 主逻辑
│   └── meta.json           # 插件元数据和 UI 配置
├── scripts/
│   └── build.js            # 构建脚本
└── dist/                   # 打包输出目录
    └── plugin.zip          # 生成的插件包

🛠️ 开发流程

1. 安装依赖

npm install

2. 编写插件逻辑

编辑 src/main.py

实现你的数据同步逻辑,支持多种数据源对接:

# 示例:数据库连接和数据同步
def sync_data(config):
    # 1. 连接数据源
    # 2. 获取数据
    # 3. 转换数据格式
    # 4. 返回结果
    pass

编辑 src/meta.json

配置插件的基本信息和 UI 界面:

  • plugin_name: 插件名称
  • plugin_desc: 插件描述
  • plugin_icon: 插件图标
  • plugin_code: 前后端代码配置
    • backend: Python 后端逻辑配置
    • frontend: UI 模板配置(账号管理、数据源配置等)

3. 打包插件

执行以下命令构建插件包:

npm run build

构建完成后,会在 dist/ 目录下生成 plugin.zip 文件,即可上传到 WPS 开放平台。

📝 配置说明

meta.json 配置项

数据连接器插件的 meta.json 主要包含以下部分:

  • 插件基础信息:名称、描述、图标
  • 账号管理页面:配置数据源连接参数
  • 数据源配置页面:选择要同步的数据和字段映射
  • 同步设置:配置同步频率和规则

示例配置参考 src/meta.json 文件。

📚 相关文档

Keywords

plugin

FAQs

Package last updated on 30 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts