@lark-apaas/miaoda-cli 0.1.3-alpha.7d9ebe6 → 0.1.3-alpha.e47b91b

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.
Files changed (62) hide show
  1. package/dist/api/app/api.js +3 -3
  2. package/dist/api/app/schemas.js +43 -43
  3. package/dist/api/db/api.js +108 -112
  4. package/dist/api/db/client.js +41 -41
  5. package/dist/api/db/parsers.js +20 -20
  6. package/dist/api/db/sql-keywords.js +87 -87
  7. package/dist/api/deploy/api.js +5 -5
  8. package/dist/api/deploy/schemas.js +32 -32
  9. package/dist/api/file/api.js +74 -87
  10. package/dist/api/file/client.js +22 -22
  11. package/dist/api/file/detect.js +3 -3
  12. package/dist/api/file/parsers.js +5 -5
  13. package/dist/api/observability/api.js +6 -6
  14. package/dist/api/observability/schemas.js +14 -14
  15. package/dist/api/plugin/api.js +31 -31
  16. package/dist/cli/commands/app/index.js +12 -12
  17. package/dist/cli/commands/db/index.js +145 -149
  18. package/dist/cli/commands/deploy/index.js +28 -28
  19. package/dist/cli/commands/file/index.js +60 -60
  20. package/dist/cli/commands/observability/index.js +69 -69
  21. package/dist/cli/commands/plugin/index.js +27 -27
  22. package/dist/cli/commands/shared.js +10 -10
  23. package/dist/cli/handlers/app/update.js +2 -2
  24. package/dist/cli/handlers/db/audit.js +48 -39
  25. package/dist/cli/handlers/db/changelog.js +25 -12
  26. package/dist/cli/handlers/db/data.js +28 -28
  27. package/dist/cli/handlers/db/migration.js +23 -23
  28. package/dist/cli/handlers/db/quota.js +3 -3
  29. package/dist/cli/handlers/db/recovery.js +79 -72
  30. package/dist/cli/handlers/db/schema.js +33 -33
  31. package/dist/cli/handlers/db/sql.js +69 -69
  32. package/dist/cli/handlers/deploy/deploy.js +4 -4
  33. package/dist/cli/handlers/deploy/error-log.js +1 -1
  34. package/dist/cli/handlers/deploy/get.js +3 -3
  35. package/dist/cli/handlers/deploy/polling.js +11 -11
  36. package/dist/cli/handlers/file/cp.js +30 -30
  37. package/dist/cli/handlers/file/ls.js +5 -5
  38. package/dist/cli/handlers/file/quota.js +2 -2
  39. package/dist/cli/handlers/file/rm.js +24 -24
  40. package/dist/cli/handlers/file/sign.js +3 -3
  41. package/dist/cli/handlers/file/stat.js +9 -9
  42. package/dist/cli/handlers/observability/analytics.js +47 -47
  43. package/dist/cli/handlers/observability/helpers.js +2 -2
  44. package/dist/cli/handlers/observability/log.js +9 -9
  45. package/dist/cli/handlers/observability/metric.js +26 -26
  46. package/dist/cli/handlers/observability/trace.js +5 -5
  47. package/dist/cli/handlers/plugin/plugin-local.js +53 -53
  48. package/dist/cli/handlers/plugin/plugin.js +15 -15
  49. package/dist/cli/help.js +16 -16
  50. package/dist/main.js +12 -12
  51. package/dist/utils/args.js +1 -1
  52. package/dist/utils/colors.js +2 -2
  53. package/dist/utils/config.js +2 -2
  54. package/dist/utils/devops-error.js +9 -9
  55. package/dist/utils/error.js +2 -2
  56. package/dist/utils/git.js +4 -4
  57. package/dist/utils/http.js +19 -19
  58. package/dist/utils/output.js +47 -47
  59. package/dist/utils/poll.js +2 -2
  60. package/dist/utils/render.js +27 -27
  61. package/dist/utils/time.js +47 -42
  62. package/package.json +1 -1
@@ -4,7 +4,7 @@ exports.getAppInfo = getAppInfo;
4
4
  exports.updateAppMeta = updateAppMeta;
5
5
  const http_1 = require("../../utils/http");
6
6
  const devops_error_1 = require("../../utils/devops-error");
7
- const DEFAULT_ERR_CODE = "INTERNAL_DEVOPS_ERROR";
7
+ const DEFAULT_ERR_CODE = 'INTERNAL_DEVOPS_ERROR';
8
8
  function envelopeOpts(errPrefix) {
9
9
  return {
10
10
  errPrefix,
@@ -15,11 +15,11 @@ function envelopeOpts(errPrefix) {
15
15
  /** GET /v1/devops/app/:appID — 获取应用详情 */
16
16
  async function getAppInfo(appID) {
17
17
  const url = `/v1/devops/app/${encodeURIComponent(appID)}`;
18
- return (0, http_1.getInnerApi)(url, envelopeOpts("Failed to get app info"));
18
+ return (0, http_1.getInnerApi)(url, envelopeOpts('Failed to get app info'));
19
19
  }
20
20
  /** POST /v1/devops/app/:appID/meta — 更新应用元数据 */
21
21
  async function updateAppMeta(req) {
22
22
  const url = `/v1/devops/app/${encodeURIComponent(req.appID)}/meta`;
23
23
  // 路径已带 appID,body 里也保留以匹配 BAM IDL 的 sensitive:"no" 透传约定
24
- return (0, http_1.postInnerApi)(url, req, envelopeOpts("Failed to update app"));
24
+ return (0, http_1.postInnerApi)(url, req, envelopeOpts('Failed to update app'));
25
25
  }
@@ -5,47 +5,47 @@ const output_1 = require("../../utils/output");
5
5
  const types_1 = require("./types");
6
6
  // Partial<Record<...>>:未来 BAM 加新枚举值时这里没声明也不报错,运行期 lookup 自然得 undefined
7
7
  const STATUS_TEXT = {
8
- [types_1.AppStatus.UNSPECIFIED]: "unknown",
9
- [types_1.AppStatus.PREPARING]: "preparing",
10
- [types_1.AppStatus.UNRELEASED]: "unreleased",
11
- [types_1.AppStatus.RELEASED]: "released",
12
- [types_1.AppStatus.DELETED]: "deleted",
13
- [types_1.AppStatus.UPGRADING]: "upgrading",
8
+ [types_1.AppStatus.UNSPECIFIED]: 'unknown',
9
+ [types_1.AppStatus.PREPARING]: 'preparing',
10
+ [types_1.AppStatus.UNRELEASED]: 'unreleased',
11
+ [types_1.AppStatus.RELEASED]: 'released',
12
+ [types_1.AppStatus.DELETED]: 'deleted',
13
+ [types_1.AppStatus.UPGRADING]: 'upgrading',
14
14
  };
15
15
  const MODE_TEXT = {
16
- [types_1.AppMode.UNSPECIFIED]: "unknown",
17
- [types_1.AppMode.STANDARD]: "standard",
18
- [types_1.AppMode.EXPERT]: "expert",
16
+ [types_1.AppMode.UNSPECIFIED]: 'unknown',
17
+ [types_1.AppMode.STANDARD]: 'standard',
18
+ [types_1.AppMode.EXPERT]: 'expert',
19
19
  };
20
20
  const TYPE_TEXT = {
21
- [types_1.AppType.UNSPECIFIED]: "unknown",
22
- [types_1.AppType.STANDARD]: "standard",
23
- [types_1.AppType.PROTOTYPE]: "prototype",
24
- [types_1.AppType.APPLICATION]: "application",
25
- [types_1.AppType.DESIGN]: "design",
26
- [types_1.AppType.OPENCLAW]: "openclaw",
27
- [types_1.AppType.CLAW_SUB]: "claw_sub",
21
+ [types_1.AppType.UNSPECIFIED]: 'unknown',
22
+ [types_1.AppType.STANDARD]: 'standard',
23
+ [types_1.AppType.PROTOTYPE]: 'prototype',
24
+ [types_1.AppType.APPLICATION]: 'application',
25
+ [types_1.AppType.DESIGN]: 'design',
26
+ [types_1.AppType.OPENCLAW]: 'openclaw',
27
+ [types_1.AppType.CLAW_SUB]: 'claw_sub',
28
28
  };
29
29
  const BIZ_TYPE_TEXT = {
30
- [types_1.BizType.UNSPECIFIED]: "unknown",
31
- [types_1.BizType.MIAODA]: "miaoda",
32
- [types_1.BizType.FORCE]: "force",
30
+ [types_1.BizType.UNSPECIFIED]: 'unknown',
31
+ [types_1.BizType.MIAODA]: 'miaoda',
32
+ [types_1.BizType.FORCE]: 'force',
33
33
  };
34
34
  const ARCH_TYPE_TEXT = {
35
- [types_1.ArchType.UNSPECIFIED]: "unknown",
36
- [types_1.ArchType.FULL_STACK]: "full_stack",
37
- [types_1.ArchType.NOT_FULL_STACK]: "not_full_stack",
35
+ [types_1.ArchType.UNSPECIFIED]: 'unknown',
36
+ [types_1.ArchType.FULL_STACK]: 'full_stack',
37
+ [types_1.ArchType.NOT_FULL_STACK]: 'not_full_stack',
38
38
  };
39
39
  const SOURCE_TEXT = {
40
- [types_1.Source.UNSPECIFIED]: "unknown",
41
- [types_1.Source.CHAT]: "chat",
42
- [types_1.Source.TEMPLATE]: "template",
43
- [types_1.Source.IMPORT_ZIP]: "import_zip",
44
- [types_1.Source.IMPORT_BASE]: "import_base",
40
+ [types_1.Source.UNSPECIFIED]: 'unknown',
41
+ [types_1.Source.CHAT]: 'chat',
42
+ [types_1.Source.TEMPLATE]: 'template',
43
+ [types_1.Source.IMPORT_ZIP]: 'import_zip',
44
+ [types_1.Source.IMPORT_BASE]: 'import_base',
45
45
  };
46
46
  function lookup(table) {
47
47
  return (v) => {
48
- if (typeof v !== "number")
48
+ if (typeof v !== 'number')
49
49
  return undefined;
50
50
  return table[v];
51
51
  };
@@ -59,21 +59,21 @@ function lookup(table) {
59
59
  */
60
60
  exports.appMetaSchema = {
61
61
  columns: [
62
- { key: "appID", label: "app-id" },
63
- { key: "name" },
64
- { key: "description" },
65
- { key: "status_text", label: "status", derive: (row) => lookup(STATUS_TEXT)(row.status) },
66
- { key: "appType_text", label: "type", derive: (row) => lookup(TYPE_TEXT)(row.appType) },
67
- { key: "appMode_text", label: "mode", derive: (row) => lookup(MODE_TEXT)(row.appMode) },
68
- { key: "bizType_text", label: "biz-type", derive: (row) => lookup(BIZ_TYPE_TEXT)(row.bizType) },
69
- { key: "archType_text", label: "arch", derive: (row) => lookup(ARCH_TYPE_TEXT)(row.archType) },
70
- { key: "source_text", label: "source", derive: (row) => lookup(SOURCE_TEXT)(row.source) },
71
- { key: "ownedBy", label: "owner" },
72
- { key: "createdBy", label: "creator" },
73
- { key: "dataBranchID", label: "branch" },
74
- { key: "parentAppID", label: "parent-app" },
75
- { key: "createdAt", label: "created-at", format: output_1.fmt.ms() },
76
- { key: "updatedAt", label: "updated-at", format: output_1.fmt.ms() },
62
+ { key: 'appID', label: 'app-id' },
63
+ { key: 'name' },
64
+ { key: 'description' },
65
+ { key: 'status_text', label: 'status', derive: (row) => lookup(STATUS_TEXT)(row.status) },
66
+ { key: 'appType_text', label: 'type', derive: (row) => lookup(TYPE_TEXT)(row.appType) },
67
+ { key: 'appMode_text', label: 'mode', derive: (row) => lookup(MODE_TEXT)(row.appMode) },
68
+ { key: 'bizType_text', label: 'biz-type', derive: (row) => lookup(BIZ_TYPE_TEXT)(row.bizType) },
69
+ { key: 'archType_text', label: 'arch', derive: (row) => lookup(ARCH_TYPE_TEXT)(row.archType) },
70
+ { key: 'source_text', label: 'source', derive: (row) => lookup(SOURCE_TEXT)(row.source) },
71
+ { key: 'ownedBy', label: 'owner' },
72
+ { key: 'createdBy', label: 'creator' },
73
+ { key: 'dataBranchID', label: 'branch' },
74
+ { key: 'parentAppID', label: 'parent-app' },
75
+ { key: 'createdAt', label: 'created-at', format: output_1.fmt.ms() },
76
+ { key: 'updatedAt', label: 'updated-at', format: output_1.fmt.ms() },
77
77
  ],
78
78
  strict: true,
79
79
  };