@lark-apaas/miaoda-cli 0.1.24-alpha.5e3d4ef → 0.1.24-alpha.730fb3f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,6 @@ exports.updateAppMeta = updateAppMeta;
5
5
  exports.getCodeArchive = getCodeArchive;
6
6
  const http_1 = require("../../utils/http");
7
7
  const devops_error_1 = require("../../utils/devops-error");
8
- const error_1 = require("../../utils/error");
9
8
  const DEFAULT_ERR_CODE = 'INTERNAL_DEVOPS_ERROR';
10
9
  function envelopeOpts(errPrefix) {
11
10
  return {
@@ -25,66 +24,22 @@ async function updateAppMeta(req) {
25
24
  // 路径已带 appID,body 里也保留以匹配 BAM IDL 的 sensitive:"no" 透传约定
26
25
  return (0, http_1.postInnerApi)(url, req, envelopeOpts('Failed to update app'));
27
26
  }
28
- function mapExportError(bizCode, message, source) {
29
- // token 是敏感令牌,错误信息只截前 8 位辅助定位
30
- const sourceDesc = source.sourceAppID
31
- ? `应用 ${source.sourceAppID}`
32
- : `分享 token ${(source.sourceMetaToken ?? '').slice(0, 8)}...`;
33
- switch (bizCode) {
34
- // 身份换取失败,或非源应用协作者(服务端 DOWNLOAD 鉴权不过)
35
- case devops_error_1.BizErrCode.STUDIO_UNAUTHENTICATED:
36
- return new error_1.AppError('EXPORT_PERMISSION_DENIED', `无权导出 ${sourceDesc}:${message}`, {
37
- next_actions: [
38
- `确认你是源应用的协作者;不是的话请让应用所有者添加协作者后重试`,
39
- '这是权限问题,不是凭证配置或服务端抖动:不要重复执行本命令,也不要尝试自行签发 token',
40
- ],
41
- });
42
- // meta_token 无效或未绑定妙搭应用(服务端 ResolveAppIDByMetaToken 反查失败)
43
- case devops_error_1.BizErrCode.STUDIO_APP_NOT_FOUND:
44
- return new error_1.AppError('EXPORT_APP_NOT_FOUND', `${sourceDesc} 未找到对应应用:${message}`, {
45
- next_actions: [
46
- '核对分享 token / 链接是否完整(创意应用 URL 形如 https://<tenant>.feishu.cn/page/<token>)',
47
- '确认目标是创意应用(只有创意应用有分享 token);这是目标不存在问题:不要重复执行本命令,请向用户确认',
48
- ],
49
- });
50
- // 应用不存在(错误 ID)
51
- case devops_error_1.BizErrCode.DEVOPS_APP_NOT_FOUND:
52
- case devops_error_1.BizErrCode.DEVOPS_APP_NOT_FOUND_ALT:
53
- return new error_1.AppError('EXPORT_APP_NOT_FOUND', `${sourceDesc} 不存在或不可访问:${message}`, {
54
- next_actions: [
55
- '核对源应用 ID(应用页 URL 形如 /app/app_xxx,该段才是应用 ID)',
56
- '这是目标不存在问题:不要重复执行本命令,请向用户确认正确的应用 ID',
57
- ],
58
- });
59
- default:
60
- return (0, devops_error_1.mapDevopsError)(bizCode, message);
61
- }
62
- }
63
27
  /**
64
- * GET /api/v1/studio/innerapi/apps/:appID/code-archive — 导出源应用源码归档。
28
+ * GET /api/v1/studio/innerapi/apps/:appID/code-archive?sourceAppID=xxx — 导出源应用源码归档。
65
29
  * 走 studio_server inner 通道(force 身份,服务侧 force→lark 换取后按 DOWNLOAD 鉴权,
66
- * 鉴权对象是源应用),与 comment 域同一 inner 信封;创意应用升级链路(app export)消费。
30
+ * 鉴权对象是 sourceAppID),与 comment 域同一 inner 信封;创意应用升级链路(app export)消费。
67
31
  *
68
32
  * path :appID 必须是当前沙箱应用:网关 apaas_force_admin_plugin 强校验 URL appID 与沙箱
69
33
  * AK 绑定应用一致(不一致 400 "appID in url is illegal"),跨应用导出目标因此走 query。
70
- * 源应用定位二选一:sourceAppID(app_xxx),或 sourceMetaToken(创意应用分享 URL
71
- * /page/<token> 的 CCM token,服务端反查 appID 后按同一口径鉴权)。
72
34
  */
73
35
  async function getCodeArchive(params) {
74
- const { appID, sourceAppID, sourceMetaToken, checkpointID } = params;
75
- if (!sourceAppID === !sourceMetaToken) {
76
- throw new error_1.AppError('ARGS_INVALID', 'sourceAppID 与 sourceMetaToken 必须恰传其一');
77
- }
78
- const sourceQuery = sourceAppID
79
- ? `sourceAppID=${encodeURIComponent(sourceAppID)}`
80
- : `sourceMetaToken=${encodeURIComponent(sourceMetaToken ?? '')}`;
81
- let url = `/api/v1/studio/innerapi/apps/${encodeURIComponent(appID)}/code-archive?` + sourceQuery;
36
+ const { appID, sourceAppID, checkpointID } = params;
37
+ let url = `/api/v1/studio/innerapi/apps/${encodeURIComponent(appID)}/code-archive` +
38
+ `?sourceAppID=${encodeURIComponent(sourceAppID)}`;
82
39
  if (checkpointID !== undefined && checkpointID > 0) {
83
40
  url += `&checkPointID=${String(checkpointID)}`;
84
41
  }
85
42
  return (0, http_1.getInnerApi)(url, {
86
43
  errPrefix: 'Failed to export code archive',
87
- defaultErrCode: DEFAULT_ERR_CODE,
88
- mapErr: (bizCode, message) => mapExportError(bizCode, message, { sourceAppID, sourceMetaToken }),
89
44
  });
90
45
  }
@@ -122,37 +122,32 @@ JSON 输出
122
122
  }
123
123
  function registerAppExport(parent) {
124
124
  const cmd = parent
125
- .command('export <app-id-or-token>')
126
- .description('导出指定应用的源码到本工程(创意应用升级:拉取创意稿作只读参考物);接受应用 ID(app_xxx)或创意应用分享 token')
125
+ .command('export <app-id>')
126
+ .description('导出指定应用的源码到本工程(创意应用升级:拉取创意稿作只读参考物)')
127
127
  .option('--out <dir>', '输出目录(相对当前目录)', 'source_package/creative')
128
128
  .option('--checkpoint <n>', '按检查点版本导出;缺省为最新提交(HEAD)')
129
129
  .addHelpText('after', `
130
130
  说明
131
- 从服务端导出源应用(可以不是当前应用)的源码归档并解压到 --out 目录,导出完成后写
132
- --out/.upgrade-manifest.json(含 sourceAppId / 导出时间 / 文件数),供升级链路幂等
133
- 判定与 skill 发现使用。调用者须为源应用协作者(服务端 DOWNLOAD 鉴权)。
134
- <app-id-or-token> 两种形态等价:应用 ID(app_xxx)或创意应用分享 token。拿到的是
135
- 分享链接(https://<tenant>.feishu.cn/page/<token>)时,提取其中 /page/ 后的 <token> 段传入。
136
- 请求以当前应用(MIAODA_APP_ID)为路径主体、源应用走 sourceAppID / sourceMetaToken 参数。
131
+ 从服务端导出 <app-id> 对应应用(源应用,可以不是当前应用)的源码归档并解压到 --out
132
+ 目录,导出完成后写 --out/.upgrade-manifest.json(含 sourceAppId / 导出时间 / 文件数),
133
+ 供升级链路幂等判定与 skill 发现使用。调用者须为源应用协作者(服务端 DOWNLOAD 鉴权)。
134
+ 请求以当前应用(MIAODA_APP_ID)为路径主体、源应用走 sourceAppID 参数。
137
135
 
138
136
  幂等
139
- --out 已存在 manifest 且源定位(sourceAppId / sourceMetaToken)一致时跳过导出
140
- (skipped=true),重复调用安全。
137
+ --out 已存在 manifest 且 sourceAppId 一致时跳过导出(skipped=true),重复调用安全。
141
138
 
142
139
  JSON 输出
143
140
  {"data": {"appId": "...", "out": "source_package/creative", "fileCount": <n>,
144
141
  "archiveName": "...", "skipped": false}}
145
142
  跳过时:{"data": {"appId": "...", "out": "...", "skipped": true, "reason": "already_exported"}}
146
- appId 始终是实际导出的源应用 ID(传 token 时为服务端反查结果)。
147
143
 
148
144
  失败
149
145
  源应用无可导出内容(从未提交过代码)→ EXPORT_EMPTY_ARCHIVE,请先在源应用完成一轮创作。
150
- 非源应用协作者 → EXPORT_PERMISSION_DENIED,权限问题,重试无效,需应用所有者加协作者。
151
- 应用 ID 不存在,或 token 未找到对应应用 → EXPORT_APP_NOT_FOUND,核对入参,重试无效。
146
+ 无权限(非源应用协作者)→ 服务端鉴权错误透传。
152
147
 
153
148
  示例
154
149
  $ miaoda app export app_demo_source
155
- $ miaoda app export DemoPageTokenAbCdEf123456789
150
+ $ miaoda app export app_demo_source --out source_package/creative
156
151
  $ miaoda app export app_demo_source --checkpoint 3
157
152
  `);
158
153
  cmd.action((0, shared_1.withHelp)(cmd, async (appId, rawOpts) => {
@@ -46,29 +46,6 @@ const api = __importStar(require("../../../api/index"));
46
46
  const error_1 = require("../../../utils/error");
47
47
  const output_1 = require("../../../utils/output");
48
48
  const logger_1 = require("../../../utils/logger");
49
- /** 妙搭应用 ID 形态:`app_` + 字母数字下划线。非此形态按创意应用分享 token 处理。 */
50
- const MIAODA_APP_ID_PATTERN = /^app_\w{1,64}$/;
51
- /** 分享 token 宽松形态:16-128 位字母数字(CCM token 实际 20+ 位)。只拦明显不是 token 的输入(误传 flag / 短串),不追平服务端精确口径。 */
52
- const META_TOKEN_PATTERN = /^[A-Za-z0-9_-]{16,128}$/;
53
- /**
54
- * 解析位置参数为源应用定位:app_xxx → appId;满足 token 宽松形态的串 → metaToken 透传
55
- * (精确校验交给服务端反查,避免和服务端口径漂移)。不支持直接传分享链接——调用方
56
- * (上游 agent)自行从链接提取 /page/<token> 段后传 token。
57
- */
58
- function parseSourceRef(raw) {
59
- if (MIAODA_APP_ID_PATTERN.test(raw)) {
60
- return { appId: raw };
61
- }
62
- if (!META_TOKEN_PATTERN.test(raw)) {
63
- throw new error_1.AppError('ARGS_INVALID', `无法识别的源应用定位:${raw}`, {
64
- next_actions: [
65
- '接受两种形态:应用 ID(app_xxx)或创意应用分享 token(16 位以上字母数字)',
66
- '拿到的是分享链接(https://<tenant>.feishu.cn/page/<token>)时,请提取其中 /page/ 后的 <token> 段传入',
67
- ],
68
- });
69
- }
70
- return { metaToken: raw };
71
- }
72
49
  /** 导出目录默认值:创意升级链路的参考物约定位置。 */
73
50
  exports.DEFAULT_EXPORT_OUT = 'source_package/creative';
74
51
  /** 升级 manifest 文件名:前置钩子幂等标记 / skill workspace-contains 锚点 / skill 第 0 步信息源。 */
@@ -120,7 +97,7 @@ function countFiles(dir) {
120
97
  return count;
121
98
  }
122
99
  /**
123
- * miaoda app export <app-id-or-token> [--out <dir>] [--checkpoint <n>]
100
+ * miaoda app export <app-id> [--out <dir>] [--checkpoint <n>]
124
101
  *
125
102
  * 创意应用升级链路:把源应用(创意稿)的源码从服务端导出到本工程,作为只读参考物。
126
103
  * 链路:studio_server InnerGetCodeArchive(inner 通道,force 身份鉴权:调用者须为源应用
@@ -128,18 +105,15 @@ function countFiles(dir) {
128
105
  * skill workspace-contains 锚点 + skill 第 0 步信息源)。
129
106
  *
130
107
  * URL 形状:path :appID 是当前沙箱应用(网关强校验其与沙箱 AK 一致),源应用走 query
131
- * (sourceAppID 或 sourceMetaToken 二选一)—— 跨应用(升级常态:新应用沙箱里导出源
132
- * 创意应用)必须如此。位置参数接受应用 ID / 分享 token 两种形态。
108
+ * sourceAppID —— 跨应用(升级常态:新应用沙箱里导出源创意应用)必须如此。
133
109
  *
134
- * 幂等:--out 已存在 manifest 且源定位(sourceAppId / sourceMetaToken)一致时跳过导出
135
- * 直接返回(重试/多轮不重复拉取)。
110
+ * 幂等:--out 已存在 manifest 且 sourceAppId 一致时跳过导出直接返回(重试/多轮不重复拉取)。
136
111
  */
137
112
  async function handleAppExport(opts) {
138
- const rawSource = (opts.appId || '').trim();
139
- if (!rawSource) {
140
- throw new error_1.AppError('ARGS_INVALID', 'app-id-or-token 不能为空');
113
+ const appId = (opts.appId || '').trim();
114
+ if (!appId) {
115
+ throw new error_1.AppError('ARGS_INVALID', 'app-id 不能为空');
141
116
  }
142
- const source = parseSourceRef(rawSource);
143
117
  // 当前沙箱应用:网关 AK 校验要求 path :appID 与沙箱绑定应用一致
144
118
  const currentAppId = (opts.currentAppId || '').trim();
145
119
  if (!currentAppId) {
@@ -150,24 +124,13 @@ async function handleAppExport(opts) {
150
124
  const outRel = normalizeOutDir(opts.out ?? exports.DEFAULT_EXPORT_OUT);
151
125
  const outDir = node_path_1.default.resolve(process.cwd(), outRel);
152
126
  const manifestPath = node_path_1.default.join(outDir, exports.UPGRADE_MANIFEST_FILENAME);
153
- // 幂等:同源应用已导出过则直接复用(前置钩子重试 / 多轮对话不重复拉取)。
154
- // token 入参时按 manifest 记录的 sourceMetaToken 比对(导出前拿不到反查后的 appId)。
127
+ // 幂等:同源应用已导出过则直接复用(前置钩子重试 / 多轮对话不重复拉取)
155
128
  if (node_fs_1.default.existsSync(manifestPath)) {
156
129
  try {
157
130
  const prev = JSON.parse(node_fs_1.default.readFileSync(manifestPath, 'utf-8'));
158
- const matched = source.appId
159
- ? prev.sourceAppId === source.appId
160
- : prev.sourceMetaToken === source.metaToken;
161
- if (matched) {
131
+ if (prev.sourceAppId === appId) {
162
132
  (0, logger_1.log)('export', `Already exported (manifest matched), skip: ${outRel}`);
163
- (0, output_1.emit)({
164
- data: {
165
- appId: prev.sourceAppId ?? '',
166
- out: outRel,
167
- skipped: true,
168
- reason: 'already_exported',
169
- },
170
- });
133
+ (0, output_1.emit)({ data: { appId, out: outRel, skipped: true, reason: 'already_exported' } });
171
134
  return;
172
135
  }
173
136
  }
@@ -175,11 +138,10 @@ async function handleAppExport(opts) {
175
138
  // manifest 损坏视为未导出,走覆盖导出
176
139
  }
177
140
  }
178
- (0, logger_1.log)('export', `Fetching code archive of ${source.appId ?? 'meta token source'}...`);
141
+ (0, logger_1.log)('export', `Fetching code archive of ${appId}...`);
179
142
  const resp = await api.app.getCodeArchive({
180
143
  appID: currentAppId,
181
- sourceAppID: source.appId,
182
- sourceMetaToken: source.metaToken,
144
+ sourceAppID: appId,
183
145
  checkpointID: opts.checkpoint,
184
146
  });
185
147
  const fileBase64 = resp.file ?? '';
@@ -195,11 +157,9 @@ async function handleAppExport(opts) {
195
157
  if (archive.length > MAX_ARCHIVE_BYTES) {
196
158
  throw new error_1.AppError('EXPORT_ARCHIVE_TOO_LARGE', `归档超过大小上限(${String(archive.length)} > ${String(MAX_ARCHIVE_BYTES)} bytes)`);
197
159
  }
198
- // 实际导出的源应用 ID:服务端回传优先(token 入参时为反查结果),appId 入参时兜底自身
199
- const resolvedSourceAppId = resp.sourceAppID ?? source.appId ?? '';
200
160
  // 归档先落临时文件再解压;解压成功前不动已存在的 outDir 内容之外的文件
201
161
  const tmpDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'miaoda-export-'));
202
- const archivePath = node_path_1.default.join(tmpDir, resp.name ?? `${resolvedSourceAppId || 'source'}.zip`);
162
+ const archivePath = node_path_1.default.join(tmpDir, resp.name ?? `${appId}.zip`);
203
163
  try {
204
164
  node_fs_1.default.writeFileSync(archivePath, archive);
205
165
  node_fs_1.default.mkdirSync(outDir, { recursive: true });
@@ -217,9 +177,7 @@ async function handleAppExport(opts) {
217
177
  node_fs_1.default.rmSync(node_path_1.default.join(outDir, '.gitignore'), { force: true });
218
178
  const fileCount = countFiles(outDir);
219
179
  const manifest = {
220
- sourceAppId: resolvedSourceAppId,
221
- // token 入参时记录 token 供幂等比对;appId 入参时不写该字段
222
- ...(source.metaToken ? { sourceMetaToken: source.metaToken } : {}),
180
+ sourceAppId: appId,
223
181
  archiveName: resp.name ?? '',
224
182
  checkpointId: opts.checkpoint ?? 0,
225
183
  exportedAt: new Date().toISOString(),
@@ -228,12 +186,6 @@ async function handleAppExport(opts) {
228
186
  node_fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n', 'utf-8');
229
187
  (0, logger_1.log)('export', 'Exported successfully');
230
188
  (0, output_1.emit)({
231
- data: {
232
- appId: resolvedSourceAppId,
233
- out: outRel,
234
- fileCount,
235
- archiveName: manifest.archiveName,
236
- skipped: false,
237
- },
189
+ data: { appId, out: outRel, fileCount, archiveName: manifest.archiveName, skipped: false },
238
190
  });
239
191
  }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * html → design-html 的跨 stack 迁移规则。
4
+ *
5
+ * html stack:应用文件在 src/(src/index.html 等),dev/build 走
6
+ * @lark-apaas/coding-html-devserver(devDependency + scripts.dev/build + package-lock)。
7
+ * design-html stack:buildless —— 文件直接放项目根(任意深度),无依赖、无 scripts,
8
+ * deploy 由 CLI 闭环(扫 *.html 生成 routes.json,见 services/deploy/modern/atoms/design-build)。
9
+ *
10
+ * 设计原则:**最小改动**。三件事 —— 布局搬迁、devserver 工具链清理、set-stack:
11
+ * 1. src/ 内容整体搬到项目根(merge:同名冲突 src/ 侧覆盖,搬完删 src/)
12
+ * 2. 清 devserver 残留:package-lock.json + package.json 的 dev/build scripts 与
13
+ * coding-html-devserver devDependency(design-html 模板的 package.json 无任何
14
+ * 依赖 / scripts,用户其余自定义字段一律保留)
15
+ * 3. set-stack 切 .spark/meta.json(archType / templateVersion 由 handler 从
16
+ * design-html template 包回写)
17
+ *
18
+ * 不做的事:
19
+ * - 不从 design-html template 拷任何文件(模板本身只有 _gitignore + package.json;
20
+ * 用户已有的 .gitignore 是 html 版超集,保留无害)
21
+ * - 不动 README.md / .npmrc / .env —— 部署时均被 EXCLUDES 过滤
22
+ * - 不管 dev 进程 / MIAODA_APP_TYPE 切换(平台职责;沙箱 pkill 匹配的
23
+ * scripts/dev.js 在 html 项目里不存在,自然跳过)
24
+ *
25
+ * handler 收尾的 npm install 照常跑:devserver 依赖删掉后重新生成精简 lockfile,
26
+ * 部署时被 EXCLUDES 过滤,无害;不为此引入 skip-install 能力。
27
+ */
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.MIGRATE_CONFIG = void 0;
30
+ exports.MIGRATE_CONFIG = {
31
+ from: 'html',
32
+ to: 'design-html',
33
+ rules: [
34
+ // ===== 1. 布局搬迁:src/ 内容整体搬到项目根 =====
35
+ // 目标 '.'(项目根)已存在 → 走 merge 分支:src/ 每个 entry overlay 到根,
36
+ // 同名冲突 src/ 侧覆盖,完成后删除 src/。相对引用路径不变。
37
+ { type: 'move-directory', from: 'src', to: '.' },
38
+ // ===== 2. 清理 devserver 工具链残留 =====
39
+ // 依赖集合变了(清空),lockfile 删掉由 handler 收尾的 npm install 重新生成
40
+ { type: 'delete-file', to: 'package-lock.json' },
41
+ {
42
+ type: 'delete-json-keys',
43
+ to: 'package.json',
44
+ keys: [
45
+ // coding-html-devserver 的 dev/build 入口,design-html 无 scripts
46
+ 'scripts.dev',
47
+ 'scripts.build',
48
+ // devserver 工具链本体
49
+ 'devDependencies.@lark-apaas/coding-html-devserver',
50
+ ],
51
+ },
52
+ // ===== 3. 切 stack =====
53
+ { type: 'set-stack', stack: 'design-html' },
54
+ ],
55
+ };
56
+ exports.default = exports.MIGRATE_CONFIG;
@@ -18,9 +18,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.getMigrateConfig = getMigrateConfig;
19
19
  exports.listSupportedMigrations = listSupportedMigrations;
20
20
  const vite_react_to_nestjs_react_fullstack_1 = __importDefault(require("./vite-react-to-nestjs-react-fullstack"));
21
+ const html_to_design_html_1 = __importDefault(require("./html-to-design-html"));
21
22
  /** key 格式:`<from>:<to>` */
22
23
  const MIGRATE_REGISTRY = {
23
24
  'vite-react:nestjs-react-fullstack': vite_react_to_nestjs_react_fullstack_1.default,
25
+ 'html:design-html': html_to_design_html_1.default,
24
26
  };
25
27
  /** 返回 (from, to) 对应的 MigrateConfig;未注册时返回 null。 */
26
28
  function getMigrateConfig(from, to) {
@@ -1,38 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BizErrCode = void 0;
4
3
  exports.mapDevopsError = mapDevopsError;
5
4
  const error_1 = require("./error");
6
- exports.BizErrCode = {
7
- /** devops:应用不存在(含把非应用 ID 当 app-id 传入的情况) */
8
- DEVOPS_APP_NOT_FOUND: '400002577',
9
- /** devops:应用不存在(另一路径,与上同义) */
10
- DEVOPS_APP_NOT_FOUND_ALT: '400002569',
11
- /** devops:无应用权限 */
12
- DEVOPS_APP_PERMISSION_DENIED: '400002579',
13
- /** devops:参数非法(如 name / description 超长) */
14
- DEVOPS_INVALID_ARG: '400002575',
15
- /** studio_server:ErrUnauthenticated —— 身份换取失败或未通过资源鉴权 */
16
- STUDIO_UNAUTHENTICATED: '400002671',
17
- /** studio_server:ErrStudioAppNotFound —— meta_token 无效或未绑定妙搭应用 */
18
- STUDIO_APP_NOT_FOUND: '400002667',
19
- };
20
5
  /**
21
6
  * 把 BAM lark.apaas.devops 的业务码(数字字符串)映射成 CLI 错误码。
7
+ * 来源:服务端技术方案 wiki L7P8wlNQ5iyShLkxzlOcCo8LnTg「业务错误码映射表」。
22
8
  *
23
9
  * 放在 utils 下而不是某个具体 api 域里:app / deploy 都跑在 lark.apaas.devops
24
10
  * 这同一 PSM,业务码命名空间也共享;boundaries 规则又禁止 api 域间互引。
25
11
  */
26
12
  function mapDevopsError(bizCode, message) {
27
13
  switch (bizCode) {
28
- case exports.BizErrCode.DEVOPS_APP_NOT_FOUND:
29
- case exports.BizErrCode.DEVOPS_APP_NOT_FOUND_ALT:
14
+ case '400002577':
15
+ case '400002569':
30
16
  return new error_1.AppError('APP_NOT_FOUND', message, {
31
17
  next_actions: ['Run `miaoda app list` to see available apps'],
32
18
  });
33
- case exports.BizErrCode.DEVOPS_APP_PERMISSION_DENIED:
19
+ case '400002579':
34
20
  return new error_1.AppError('APP_PERMISSION_DENIED', message);
35
- case exports.BizErrCode.DEVOPS_INVALID_ARG:
21
+ case '400002575':
36
22
  return new error_1.AppError('INVALID_ARG_VALUE', message, {
37
23
  next_actions: ['缩短 --name / --description 后重试(后端有长度限制)'],
38
24
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-cli",
3
- "version": "0.1.24-alpha.5e3d4ef",
3
+ "version": "0.1.24-alpha.730fb3f",
4
4
  "description": "Miaoda 平台命令行工具,面向 Agent 调用",
5
5
  "type": "commonjs",
6
6
  "bin": {