UNPKG

@lark-project/cli

Version:

飞书项目插件开发工具

120 lines (119 loc) 5.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EFeatureScene = exports.EFeaturePlatform = exports.EFeatureWorkItemTypeScope = exports.ECompType = exports.resolvePointTypeAlias = exports.EFeatureType = exports.APP_TYPES = exports.EPluginFrameworkVersion = exports.ECommandName = void 0; // ⚠️ 改命令名 / flag / alias 时,同步 grep `lpm` skills/ .claude/skills/ 修文档引用 var ECommandName; (function (ECommandName) { ECommandName["init"] = "init"; ECommandName["create"] = "create"; ECommandName["publish"] = "publish"; ECommandName["start"] = "start"; ECommandName["build"] = "build"; ECommandName["release"] = "release"; ECommandName["config"] = "config"; ECommandName["update"] = "update"; ECommandName["check"] = "check"; ECommandName["schema"] = "schema"; ECommandName["localConfig"] = "local-config"; ECommandName["login"] = "login"; ECommandName["listCategories"] = "list-categories"; ECommandName["updateDescription"] = "update-description"; ECommandName["workspace"] = "workspace"; ECommandName["perm"] = "perm"; ECommandName["ai"] = "ai"; ECommandName["whoami"] = "whoami"; })(ECommandName || (exports.ECommandName = ECommandName = {})); /** * 插件框架版本 */ var EPluginFrameworkVersion; (function (EPluginFrameworkVersion) { EPluginFrameworkVersion["v1"] = "1.0.0"; EPluginFrameworkVersion["v2"] = "2.0.0"; })(EPluginFrameworkVersion || (exports.EPluginFrameworkVersion = EPluginFrameworkVersion = {})); /** * 插件形态。三种状态在创建时定型且不可互转: * - normal:普通插件,可任意组合点位 * - ai_node:AI 节点插件,全工程恰好一个 ai_node 点位 * - ai_field:AI 字段插件,全工程恰好一个 ai_field 点位 * * 持久化在 plugin.config.json 的 `app_type` 字段,下游所有命令分流的事实来源。 * 缺省(已存在工程未声明)按 `'normal'` 解释,向后兼容。 */ exports.APP_TYPES = ['normal', 'ai_node', 'ai_field']; /** * 插件构成后端类型枚举 */ var EFeatureType; (function (EFeatureType) { EFeatureType["page"] = "board"; EFeatureType["button"] = "button"; EFeatureType["tab"] = "dashboard"; EFeatureType["control"] = "control"; EFeatureType["view"] = "view"; EFeatureType["configuration"] = "config"; EFeatureType["intercept"] = "intercept"; EFeatureType["component"] = "component"; EFeatureType["customField"] = "field_template"; EFeatureType["liteAppComponent"] = "builder_comp"; })(EFeatureType || (exports.EFeatureType = EFeatureType = {})); /** * 把调用方传的点位类型名翻译成后端 wire 值。`EFeatureType` 编码了两套词汇: * 枚举 key 是本地/skill 对外名(page / customField / liteAppComponent…), * 枚举 value 是 draft/remote JSON 里真实存的 wire 值(board / field_template / * builder_comp…)。该函数让 `lpm ai peek` / `patch-json` 的 path 谓词可以统一用 * 本地词汇——传入 wire 值或未知名字时原样返回,不会破坏既有调用。 */ function resolvePointTypeAlias(value) { // hasOwnProperty.call 避免命中 Object.prototype 成员(toString / constructor / __proto__ 等) return Object.prototype.hasOwnProperty.call(EFeatureType, value) ? EFeatureType[value] : value; } exports.resolvePointTypeAlias = resolvePointTypeAlias; /** * component 组件类型 */ var ECompType; (function (ECompType) { ECompType["schedule"] = "component_schedule"; })(ECompType || (exports.ECompType = ECompType = {})); /** * 插件构成适用工作项类型范围枚举 */ var EFeatureWorkItemTypeScope; (function (EFeatureWorkItemTypeScope) { EFeatureWorkItemTypeScope["all"] = "_all"; EFeatureWorkItemTypeScope["issue"] = "issue"; EFeatureWorkItemTypeScope["sprint"] = "sprint"; EFeatureWorkItemTypeScope["story"] = "story"; EFeatureWorkItemTypeScope["version"] = "version"; EFeatureWorkItemTypeScope["others"] = "work_object"; })(EFeatureWorkItemTypeScope || (exports.EFeatureWorkItemTypeScope = EFeatureWorkItemTypeScope = {})); /** * 插件构成适配端类型枚举 */ var EFeaturePlatform; (function (EFeaturePlatform) { // 网页端 EFeaturePlatform["web"] = "web"; // 移动端 EFeaturePlatform["mobile"] = "mobile"; })(EFeaturePlatform || (exports.EFeaturePlatform = EFeaturePlatform = {})); /** * 插件构成适用位置 */ var EFeatureScene; (function (EFeatureScene) { // for control EFeatureScene[EFeatureScene["controlTable"] = 1] = "controlTable"; EFeatureScene[EFeatureScene["controlDetailForm"] = 2] = "controlDetailForm"; EFeatureScene[EFeatureScene["controlNodeForm"] = 6] = "controlNodeForm"; // for button EFeatureScene[EFeatureScene["buttonWorkItemMore"] = 3] = "buttonWorkItemMore"; EFeatureScene[EFeatureScene["buttonWorkItemNodeMore"] = 4] = "buttonWorkItemNodeMore"; EFeatureScene[EFeatureScene["buttonWorkItemCreate"] = 5] = "buttonWorkItemCreate"; EFeatureScene[EFeatureScene["buttonWorkItemNodeComplete"] = 7] = "buttonWorkItemNodeComplete"; EFeatureScene[EFeatureScene["buttonScheduleUnit"] = 8] = "buttonScheduleUnit"; EFeatureScene[EFeatureScene["buttonBatch"] = 9] = "buttonBatch"; })(EFeatureScene || (exports.EFeatureScene = EFeatureScene = {}));