@lovrabet/rabetbase-cli 2.5.13 → 2.6.0-beta.1

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 (446) hide show
  1. package/README.md +42 -17
  2. package/lib/api/api-doc.js +3 -1
  3. package/lib/api/api-group.js +3 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +8 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +2 -1
  8. package/lib/api/model-registry-file.js +11 -1
  9. package/lib/api/model-registry-scaffold.js +2 -1
  10. package/lib/api/model-source.js +3 -1
  11. package/lib/auth/auth-server-ui.js +2 -1
  12. package/lib/auth/auth-server.js +5 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +3 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +5 -1
  21. package/lib/commands/api/generate.js +4 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +2 -1
  24. package/lib/commands/api/pull.js +10 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +5 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +4 -1
  32. package/lib/commands/app-config/delete.js +2 -1
  33. package/lib/commands/app-config/get.js +2 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +2 -1
  36. package/lib/commands/app-config/set.js +3 -1
  37. package/lib/commands/app-config/shared.d.ts +9 -2
  38. package/lib/commands/app-config/shared.js +6 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +11 -1
  41. package/lib/commands/bff/delete.js +6 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +4 -1
  46. package/lib/commands/bff/pull.js +22 -1
  47. package/lib/commands/bff/push.js +16 -1
  48. package/lib/commands/bff/status.js +3 -1
  49. package/lib/commands/cli-skill/index.js +2 -1
  50. package/lib/commands/cli-update.js +7 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +4 -1
  55. package/lib/commands/common/app-selector.js +4 -1
  56. package/lib/commands/common/async-task.js +2 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +3 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +2 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +5 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +4 -1
  67. package/lib/commands/config/shared.js +2 -1
  68. package/lib/commands/dataset/batch-design.js +9 -1
  69. package/lib/commands/dataset/business-group-update.js +10 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +3 -1
  72. package/lib/commands/dataset/cross-relation-create.js +2 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +2 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +10 -1
  76. package/lib/commands/dataset/cross-relation-update.js +2 -1
  77. package/lib/commands/dataset/delete.js +6 -1
  78. package/lib/commands/dataset/design-context.js +1 -1
  79. package/lib/commands/dataset/design-start.js +1 -1
  80. package/lib/commands/dataset/design-status.js +1 -1
  81. package/lib/commands/dataset/design-sync-retry.js +1 -1
  82. package/lib/commands/dataset/design-sync-status.js +1 -1
  83. package/lib/commands/dataset/design-validate.js +1 -1
  84. package/lib/commands/dataset/detail.js +5 -1
  85. package/lib/commands/dataset/extend-update.js +7 -1
  86. package/lib/commands/dataset/field-restore.js +7 -1
  87. package/lib/commands/dataset/field-update.js +7 -1
  88. package/lib/commands/dataset/generate.js +19 -1
  89. package/lib/commands/dataset/index.js +3 -1
  90. package/lib/commands/dataset/list.js +2 -1
  91. package/lib/commands/dataset/operations.js +2 -1
  92. package/lib/commands/dataset/relation-audit.js +7 -1
  93. package/lib/commands/dataset/relation-create.js +3 -1
  94. package/lib/commands/dataset/relation-delete.js +3 -1
  95. package/lib/commands/dataset/relation-shared.js +21 -1
  96. package/lib/commands/dataset/relation-update.js +4 -1
  97. package/lib/commands/dataset/relations.js +7 -1
  98. package/lib/commands/dataset/rename.js +4 -1
  99. package/lib/commands/dataset/restore.js +7 -1
  100. package/lib/commands/dataset/user-deleted-field-list.js +3 -1
  101. package/lib/commands/db/analysis-batching.js +3 -1
  102. package/lib/commands/db/analyze-batch-plan.js +2 -1
  103. package/lib/commands/db/analyze-cancel.js +1 -1
  104. package/lib/commands/db/analyze-start.js +3 -1
  105. package/lib/commands/db/analyze-status.js +6 -1
  106. package/lib/commands/db/create.js +4 -1
  107. package/lib/commands/db/cross-db-analysis-shared.js +3 -1
  108. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-start.js +2 -1
  110. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  111. package/lib/commands/db/delete.js +3 -1
  112. package/lib/commands/db/detail.js +1 -1
  113. package/lib/commands/db/diff-refresh-start.js +1 -1
  114. package/lib/commands/db/diff-refresh-status.js +2 -1
  115. package/lib/commands/db/diff.js +3 -1
  116. package/lib/commands/db/index.js +2 -1
  117. package/lib/commands/db/list.js +2 -1
  118. package/lib/commands/db/shared.js +3 -1
  119. package/lib/commands/db/table-diff-shared.js +2 -1
  120. package/lib/commands/db/tables.js +2 -1
  121. package/lib/commands/db/test.js +2 -1
  122. package/lib/commands/db/update.js +4 -1
  123. package/lib/commands/deployment/index.js +1 -1
  124. package/lib/commands/deployment/sync-all.js +3 -1
  125. package/lib/commands/deployment/sync-jobs.js +2 -1
  126. package/lib/commands/deployment/sync-status.js +2 -1
  127. package/lib/commands/doctor.js +12 -1
  128. package/lib/commands/file/index.js +3 -1
  129. package/lib/commands/flow/create.js +2 -1
  130. package/lib/commands/flow/detail.js +3 -1
  131. package/lib/commands/flow/index.js +1 -1
  132. package/lib/commands/flow/list.js +2 -1
  133. package/lib/commands/flow/page-list.js +2 -1
  134. package/lib/commands/flow/publish.js +2 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +3 -1
  136. package/lib/commands/flow/runtime-role-list.js +2 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +2 -1
  138. package/lib/commands/flow/runtime-user-search.js +2 -1
  139. package/lib/commands/flow/shared.js +6 -1
  140. package/lib/commands/flow/update.js +4 -1
  141. package/lib/commands/flow/validate.js +2 -1
  142. package/lib/commands/instant-api-policy/current.js +1 -1
  143. package/lib/commands/instant-api-policy/index.js +1 -1
  144. package/lib/commands/instant-api-policy/init.js +2 -1
  145. package/lib/commands/instant-api-policy/publish.js +5 -1
  146. package/lib/commands/instant-api-policy/pull.js +2 -1
  147. package/lib/commands/instant-api-policy/revision.js +1 -1
  148. package/lib/commands/instant-api-policy/revisions.js +1 -1
  149. package/lib/commands/instant-api-policy/rollback.js +5 -1
  150. package/lib/commands/instant-api-policy/shared.js +5 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/context.js +1 -1
  153. package/lib/commands/issue/index.js +1 -1
  154. package/lib/commands/issue/nudge.js +2 -1
  155. package/lib/commands/issue/report.js +5 -1
  156. package/lib/commands/kb/create.js +5 -1
  157. package/lib/commands/kb/delete.js +5 -1
  158. package/lib/commands/kb/detail.js +1 -1
  159. package/lib/commands/kb/import-api.d.ts +3 -0
  160. package/lib/commands/kb/import-api.js +1 -0
  161. package/lib/commands/kb/import-resume.d.ts +2 -0
  162. package/lib/commands/kb/import-resume.js +2 -0
  163. package/lib/commands/kb/import-shared.d.ts +69 -0
  164. package/lib/commands/kb/import-shared.js +9 -0
  165. package/lib/commands/kb/import-status.d.ts +2 -0
  166. package/lib/commands/kb/import-status.js +1 -0
  167. package/lib/commands/kb/import.d.ts +2 -0
  168. package/lib/commands/kb/import.js +3 -0
  169. package/lib/commands/kb/index.js +1 -1
  170. package/lib/commands/kb/list.js +1 -1
  171. package/lib/commands/kb/search.js +3 -1
  172. package/lib/commands/kb/shared.js +9 -1
  173. package/lib/commands/kb/update.js +7 -1
  174. package/lib/commands/logs/index.js +2 -1
  175. package/lib/commands/menu/asset-update.js +8 -1
  176. package/lib/commands/menu/delete.js +15 -1
  177. package/lib/commands/menu/external-link-create.js +16 -1
  178. package/lib/commands/menu/external-link-update.js +10 -1
  179. package/lib/commands/menu/group-create.js +8 -1
  180. package/lib/commands/menu/group-update.js +6 -1
  181. package/lib/commands/menu/index.js +2 -1
  182. package/lib/commands/menu/list.js +1 -1
  183. package/lib/commands/menu/move.js +6 -1
  184. package/lib/commands/menu/regroup-start.js +11 -1
  185. package/lib/commands/menu/rename.js +9 -1
  186. package/lib/commands/menu/shared/compare-table.js +2 -1
  187. package/lib/commands/menu/shared/delete-plan.js +13 -1
  188. package/lib/commands/menu/shared/facts.js +5 -1
  189. package/lib/commands/menu/shared/index.js +1 -1
  190. package/lib/commands/menu/shared/inquirer.js +4 -1
  191. package/lib/commands/menu/shared/local-pages.js +5 -1
  192. package/lib/commands/menu/shared/logic.js +3 -1
  193. package/lib/commands/menu/shared/mutations.js +9 -1
  194. package/lib/commands/menu/shared/path.js +1 -1
  195. package/lib/commands/menu/shared/service.js +4 -1
  196. package/lib/commands/menu/shared/subapp-assets.js +4 -1
  197. package/lib/commands/menu/shared/sync-core.js +7 -1
  198. package/lib/commands/menu/shared/types.js +1 -1
  199. package/lib/commands/menu/shared/update-core.js +8 -1
  200. package/lib/commands/menu/shared/valid-url.js +1 -1
  201. package/lib/commands/menu/subapp-assets-status.js +1 -1
  202. package/lib/commands/menu/subapp-assets-update.js +7 -1
  203. package/lib/commands/menu/sync.js +7 -1
  204. package/lib/commands/menu/visibility-update.js +13 -1
  205. package/lib/commands/metric/contract.d.ts +8 -0
  206. package/lib/commands/metric/contract.js +5 -0
  207. package/lib/commands/metric/definition.d.ts +43 -0
  208. package/lib/commands/metric/definition.js +4 -0
  209. package/lib/commands/metric/delete.d.ts +2 -0
  210. package/lib/commands/metric/delete.js +3 -0
  211. package/lib/commands/metric/detail.d.ts +2 -0
  212. package/lib/commands/metric/detail.js +1 -0
  213. package/lib/commands/metric/example.d.ts +2 -0
  214. package/lib/commands/metric/example.js +1 -0
  215. package/lib/commands/metric/index.d.ts +2 -0
  216. package/lib/commands/metric/index.js +1 -0
  217. package/lib/commands/metric/list.d.ts +2 -0
  218. package/lib/commands/metric/list.js +2 -0
  219. package/lib/commands/metric/publication-diff.d.ts +8 -0
  220. package/lib/commands/metric/publication-diff.js +1 -0
  221. package/lib/commands/metric/publish.d.ts +2 -0
  222. package/lib/commands/metric/publish.js +4 -0
  223. package/lib/commands/metric/schema.d.ts +2 -0
  224. package/lib/commands/metric/schema.js +1 -0
  225. package/lib/commands/metric/shared.d.ts +14 -0
  226. package/lib/commands/metric/shared.js +2 -0
  227. package/lib/commands/metric/validate.d.ts +2 -0
  228. package/lib/commands/metric/validate.js +1 -0
  229. package/lib/commands/notification/config-create.js +4 -1
  230. package/lib/commands/notification/config-delete.js +4 -1
  231. package/lib/commands/notification/config-list.js +2 -1
  232. package/lib/commands/notification/config-update.js +4 -1
  233. package/lib/commands/notification/index.js +1 -1
  234. package/lib/commands/notification/shared.js +18 -1
  235. package/lib/commands/ocr/index.js +4 -1
  236. package/lib/commands/page/create.js +6 -1
  237. package/lib/commands/page/custom/detail.js +2 -1
  238. package/lib/commands/page/custom/list.js +2 -1
  239. package/lib/commands/page/custom/publish.js +3 -1
  240. package/lib/commands/page/custom/shared.js +3 -1
  241. package/lib/commands/page/custom/syntax.js +2 -1
  242. package/lib/commands/page/custom/update.js +3 -1
  243. package/lib/commands/page/data-list-status.js +2 -1
  244. package/lib/commands/page/generate-start.js +5 -1
  245. package/lib/commands/page/generate-status.js +4 -1
  246. package/lib/commands/page/index.js +2 -1
  247. package/lib/commands/page/pull.js +6 -1
  248. package/lib/commands/page/push.js +11 -1
  249. package/lib/commands/page/relation-audit.js +15 -1
  250. package/lib/commands/page/restore.js +5 -1
  251. package/lib/commands/page/shared.js +16 -1
  252. package/lib/commands/page/sync.js +2 -1
  253. package/lib/commands/project/api-architecture-upgrade.js +11 -1
  254. package/lib/commands/project/create/enhanced-guided-create.js +2 -1
  255. package/lib/commands/project/create/format-elapsed.js +1 -1
  256. package/lib/commands/project/create/main.js +13 -1
  257. package/lib/commands/project/create/materialize-project-template.js +12 -1
  258. package/lib/commands/project/create/project-name.js +1 -1
  259. package/lib/commands/project/create/project-template-archive.js +5 -1
  260. package/lib/commands/project/create/project-template-path.js +1 -1
  261. package/lib/commands/project/create/use-copy-project-template.js +2 -1
  262. package/lib/commands/project/create/use-format-code.js +1 -1
  263. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  264. package/lib/commands/project/domain-routing-sync.js +1 -1
  265. package/lib/commands/project/index.js +4 -1
  266. package/lib/commands/project/upgrade.js +7 -1
  267. package/lib/commands/registry.js +10 -1
  268. package/lib/commands/role/delete.js +2 -1
  269. package/lib/commands/role/detail.js +1 -1
  270. package/lib/commands/role/index.js +1 -1
  271. package/lib/commands/role/list.js +2 -1
  272. package/lib/commands/role/shared.js +8 -1
  273. package/lib/commands/role/update.js +3 -1
  274. package/lib/commands/role/user-add.js +2 -1
  275. package/lib/commands/role/user-remove.js +2 -1
  276. package/lib/commands/role/user-resolve.js +1 -1
  277. package/lib/commands/rule/get.js +1 -1
  278. package/lib/commands/rule/index.js +1 -1
  279. package/lib/commands/rule/list.js +1 -1
  280. package/lib/commands/rule/set.js +7 -1
  281. package/lib/commands/rule/shared.js +4 -1
  282. package/lib/commands/run/index.js +5 -1
  283. package/lib/commands/schema.js +1 -1
  284. package/lib/commands/sql/create.js +7 -1
  285. package/lib/commands/sql/delete.js +4 -1
  286. package/lib/commands/sql/detail.js +1 -1
  287. package/lib/commands/sql/exec.js +1 -1
  288. package/lib/commands/sql/index.js +1 -1
  289. package/lib/commands/sql/list.js +2 -1
  290. package/lib/commands/sql/pull.js +10 -1
  291. package/lib/commands/sql/push.js +9 -1
  292. package/lib/commands/sql/shared.js +5 -1
  293. package/lib/commands/sql/status.js +3 -1
  294. package/lib/commands/sql/validate.js +5 -1
  295. package/lib/commands/task/index.js +1 -1
  296. package/lib/commands/task/status.js +2 -1
  297. package/lib/commands/tenant/index.js +1 -1
  298. package/lib/commands/tenant/members-list.js +2 -1
  299. package/lib/commands/tenant/shared.js +2 -1
  300. package/lib/commands/user-account/dingding-sandbox-bind.js +2 -1
  301. package/lib/commands/user-account/feishu-bind.js +2 -1
  302. package/lib/commands/user-account/index.js +1 -1
  303. package/lib/commands/workspace/add.js +1 -1
  304. package/lib/commands/workspace/index.js +7 -1
  305. package/lib/commands/workspace/remove.js +1 -1
  306. package/lib/config/domain-config.js +8 -1
  307. package/lib/config/project-domain-routing.js +3 -1
  308. package/lib/config/region-config.js +2 -1
  309. package/lib/config/schema.js +7 -1
  310. package/lib/constant/cdn.js +2 -1
  311. package/lib/constant/cli.js +8 -1
  312. package/lib/constant/defaults.js +1 -1
  313. package/lib/constant/domain.js +4 -1
  314. package/lib/constant/env.js +1 -1
  315. package/lib/constant/output.js +1 -1
  316. package/lib/constant/paths.js +1 -1
  317. package/lib/constant/region.js +1 -1
  318. package/lib/constant/risk.js +1 -1
  319. package/lib/constant/routing-profile.js +1 -1
  320. package/lib/context/app-resolver.js +7 -1
  321. package/lib/context/auth-resolver.js +1 -1
  322. package/lib/context/config-loader.js +7 -1
  323. package/lib/context.js +9 -1
  324. package/lib/core/alias-resolver.js +5 -1
  325. package/lib/core/api-client.d.ts +14 -7
  326. package/lib/core/api-client.js +69 -1
  327. package/lib/core/bff/config.js +1 -1
  328. package/lib/core/bff/file-system.js +6 -1
  329. package/lib/core/bff/hash.js +1 -1
  330. package/lib/core/bff/hook-directory.js +9 -1
  331. package/lib/core/bff/lock.js +2 -1
  332. package/lib/core/bff/types.js +1 -1
  333. package/lib/core/bff/utils.js +3 -1
  334. package/lib/core/cross-db-analysis.js +1 -1
  335. package/lib/core/cross-db-relation.js +1 -1
  336. package/lib/core/db-resolver.js +2 -1
  337. package/lib/core/flow-config.js +49 -1
  338. package/lib/core/instant-api-policy/config.js +7 -1
  339. package/lib/core/instant-api-policy/endpoints.js +1 -1
  340. package/lib/core/kb-management-client.d.ts +11 -0
  341. package/lib/core/kb-management-client.js +4 -1
  342. package/lib/core/kb-search-client.js +3 -1
  343. package/lib/core/page/file-system.js +2 -1
  344. package/lib/core/page/hash.js +1 -1
  345. package/lib/core/page/lock.js +2 -1
  346. package/lib/core/page/lr-smart-jsx.js +4 -1
  347. package/lib/core/page/types.js +1 -1
  348. package/lib/core/sql-index-auditor.js +14 -1
  349. package/lib/core/sql-sync/config.js +1 -1
  350. package/lib/core/sql-sync/file-system.js +3 -1
  351. package/lib/core/sql-sync/hash.js +1 -1
  352. package/lib/core/sql-sync/lock.js +2 -1
  353. package/lib/core/sql-sync/types.js +1 -1
  354. package/lib/core/sql-sync/utils.js +2 -1
  355. package/lib/core/sql-validator.js +15 -1
  356. package/lib/errors.js +3 -1
  357. package/lib/framework/build-all-flags.js +1 -1
  358. package/lib/framework/error-output.js +1 -1
  359. package/lib/framework/explicit-yes.js +1 -1
  360. package/lib/framework/flags.js +1 -1
  361. package/lib/framework/help.js +2 -1
  362. package/lib/framework/index.js +1 -1
  363. package/lib/framework/output.js +2 -1
  364. package/lib/framework/response.js +1 -1
  365. package/lib/framework/runner-alias.js +2 -1
  366. package/lib/framework/runner.js +9 -1
  367. package/lib/framework/schema-export.js +1 -1
  368. package/lib/framework/supported-flags.js +2 -1
  369. package/lib/framework/types.js +1 -1
  370. package/lib/generated/build-info.d.ts +4 -4
  371. package/lib/generated/build-info.js +1 -1
  372. package/lib/generated/official-routing.js +3 -1
  373. package/lib/generated/routing-contract.js +1 -1
  374. package/lib/help.js +1 -1
  375. package/lib/runtime/confirmation.js +2 -1
  376. package/lib/runtime/event.js +1 -1
  377. package/lib/runtime/index.js +4 -1
  378. package/lib/runtime/queue.js +1 -1
  379. package/lib/runtime/resolve.js +2 -1
  380. package/lib/runtime/types.js +1 -1
  381. package/lib/services/dataset-design/checkpoint.js +2 -1
  382. package/lib/services/dataset-design/commands.js +14 -1
  383. package/lib/services/dataset-design/contract.js +8 -1
  384. package/lib/skills/builtin-skill.js +8 -1
  385. package/lib/skills/install-updated-skill.d.ts +8 -0
  386. package/lib/skills/install-updated-skill.js +3 -0
  387. package/lib/skills/local-skills-installer.d.ts +2 -0
  388. package/lib/skills/local-skills-installer.js +1 -0
  389. package/lib/skills/main.js +2 -1
  390. package/lib/skills/npx-skills-add.d.ts +6 -6
  391. package/lib/skills/npx-skills-add.js +5 -1
  392. package/lib/skills/skill-presence.d.ts +1 -30
  393. package/lib/skills/skill-presence.js +2 -1
  394. package/lib/telemetry/cli-command-trace.js +2 -1
  395. package/lib/telemetry/cli-help-trace.js +1 -1
  396. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  397. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  398. package/lib/telemetry/send-cli-trace-log.js +1 -1
  399. package/lib/types/index.js +1 -1
  400. package/lib/utils/ai_config.js +3 -1
  401. package/lib/utils/apply-jq-filter.js +1 -1
  402. package/lib/utils/cdn-config.js +1 -1
  403. package/lib/utils/check-sdk-version.js +5 -1
  404. package/lib/utils/cli-version-check.js +4 -1
  405. package/lib/utils/cli-version-policy.js +3 -1
  406. package/lib/utils/config.js +1 -1
  407. package/lib/utils/entity-with-id.js +1 -1
  408. package/lib/utils/file-utils.js +1 -1
  409. package/lib/utils/guides-cdn.js +3 -1
  410. package/lib/utils/http-client.js +2 -1
  411. package/lib/utils/is-non-interactive.js +1 -1
  412. package/lib/utils/logger.js +3 -1
  413. package/lib/utils/params.js +1 -1
  414. package/lib/utils/platform.js +1 -1
  415. package/lib/utils/sleep.js +1 -1
  416. package/lib/utils/template-replacer.js +5 -1
  417. package/lib/utils/update-notice.js +3 -1
  418. package/lib/utils/version.js +1 -1
  419. package/lib/utils/with-active-cookie.js +1 -1
  420. package/lib/utils/write-cli-side-channel.js +1 -1
  421. package/package.json +10 -7
  422. package/skills/rabetbase/SKILL.md +11 -7
  423. package/skills/rabetbase/guides/backend-function.md +3 -1
  424. package/skills/rabetbase/guides/data-api-guidelines.md +1 -1
  425. package/skills/rabetbase/guides/frontend-development.md +1 -0
  426. package/skills/rabetbase/guides/metric-development.md +185 -0
  427. package/skills/rabetbase/references/rabetbase-app-config.md +4 -3
  428. package/skills/rabetbase/references/rabetbase-cli-skill-install.md +5 -5
  429. package/skills/rabetbase/references/rabetbase-dataset-design.md +1 -1
  430. package/skills/rabetbase/references/rabetbase-kb.md +16 -0
  431. package/skills/rabetbase/references/rabetbase-metric.md +119 -0
  432. package/skills/rabetbase/references/rabetbase-update.md +7 -5
  433. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  434. package/skills/rabetbase-dataset-generation/references/workflow.md +1 -1
  435. package/skills/rabetbase-metrics-generation/SKILL.md +22 -0
  436. package/skills/rabetbase-metrics-generation/references/verification.md +19 -0
  437. package/skills/rabetbase-metrics-generation/references/workflow.md +41 -0
  438. package/skills/rabetbase-metrics-generation/templates/statistics-delivery.md +11 -0
  439. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  440. package/skills/rabetbase-page-generation/references/generation.md +1 -1
  441. package/skills/rabetbase.manifest.json +5 -3
  442. package/templates/metrics/definition.json +78 -0
  443. package/templates/metrics/metric-definition.schema.json +136 -0
  444. package/lib/postinstall.d.ts +0 -3
  445. package/lib/postinstall.js +0 -1
  446. package/scripts/postinstall.mjs +0 -24
@@ -1 +1 @@
1
- (function(_0x59887a,_0x93d07e){const _0x43eb5a=a20_0x5a9e,_0x53a6bf=_0x59887a();while(!![]){try{const _0x285852=parseInt(_0x43eb5a(0x16a))/0x1+parseInt(_0x43eb5a(0x16e))/0x2+parseInt(_0x43eb5a(0x16c))/0x3+parseInt(_0x43eb5a(0x16b))/0x4+-parseInt(_0x43eb5a(0x170))/0x5+parseInt(_0x43eb5a(0x16f))/0x6+parseInt(_0x43eb5a(0x171))/0x7*(-parseInt(_0x43eb5a(0x16d))/0x8);if(_0x285852===_0x93d07e)break;else _0x53a6bf['push'](_0x53a6bf['shift']());}catch(_0x12d8d7){_0x53a6bf['push'](_0x53a6bf['shift']());}}}(a20_0x37e9,0x19aa6));import{apiList}from'../../commands/api/list.js';import{apiPull}from'../../commands/api/pull.js';import{apiGenerate}from'../../commands/api/generate.js';function a20_0x5a9e(_0x3fa414,_0x503e47){_0x3fa414=_0x3fa414-0x16a;const _0x37e939=a20_0x37e9();let _0x5a9ef0=_0x37e939[_0x3fa414];return _0x5a9ef0;}export const apiDefinitions=[apiList,apiPull,apiGenerate];function a20_0x37e9(){const _0xe2c6b3=['651240SZclcE','652475XPyKGo','12271XmGNHg','198503RjUpKb','745508thaTVr','394014aJroqr','2032xEhelw','112250bAhDut'];a20_0x37e9=function(){return _0xe2c6b3;};return a20_0x37e9();}
1
+ import{apiList}from"../../commands/api/list.js";import{apiPull}from"../../commands/api/pull.js";import{apiGenerate}from"../../commands/api/generate.js";export const apiDefinitions=[apiList,apiPull,apiGenerate];
@@ -1 +1,2 @@
1
- function a21_0x171f(_0x261b57,_0x3535d8){_0x261b57=_0x261b57-0x6b;const _0x170cbb=a21_0x170c();let _0x171fb6=_0x170cbb[_0x261b57];return _0x171fb6;}const a21_0x3e5ddf=a21_0x171f;function a21_0x170c(){const _0xaac2b3=['12DrMDHD','region','appcode','425173HQvqYy','boolean','270nAFkER','appCode','99025VJOgBE','api','2094ukwWih','List\x20all\x20datasets/models\x20for\x20the\x20configured\x20app(s)','1786374PHhUXS','push','8ERcwWC','isDefault','rawFlags','5641992HvFfuP','cookie','505UvhuLu','4460UaODuT','1508tdUnAf','179674ecSWIY','map'];a21_0x170c=function(){return _0xaac2b3;};return a21_0x170c();}(function(_0x489143,_0x3570c9){const _0x416957=a21_0x171f,_0x33cffd=_0x489143();while(!![]){try{const _0x153dff=parseInt(_0x416957(0x76))/0x1+parseInt(_0x416957(0x6c))/0x2*(-parseInt(_0x416957(0x78))/0x3)+parseInt(_0x416957(0x6b))/0x4*(-parseInt(_0x416957(0x81))/0x5)+parseInt(_0x416957(0x6f))/0x6*(parseInt(_0x416957(0x72))/0x7)+parseInt(_0x416957(0x7c))/0x8*(-parseInt(_0x416957(0x7a))/0x9)+parseInt(_0x416957(0x74))/0xa*(parseInt(_0x416957(0x6d))/0xb)+parseInt(_0x416957(0x7f))/0xc;if(_0x153dff===_0x3570c9)break;else _0x33cffd['push'](_0x33cffd['shift']());}catch(_0x53fe63){_0x33cffd['push'](_0x33cffd['shift']());}}}(a21_0x170c,0x47d96));import{fetchModelList}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveTargetApps}from'../../commands/api/shared.js';import{initMultiAppEnvironment}from'../../context.js';export const apiList={'service':a21_0x3e5ddf(0x77),'command':'list','description':a21_0x3e5ddf(0x79),'risk':'read','requiresAppCode':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':'global','type':a21_0x3e5ddf(0x73),'description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]}],async 'execute'(_0x469bb4){const _0x44123f=a21_0x3e5ddf,_0x19f62a=_0x469bb4[_0x44123f(0x7e)][_0x44123f(0x71)]?String(_0x469bb4['rawFlags'][_0x44123f(0x71)]):undefined,_0x884d4f=resolveTargetApps(_0x469bb4,_0x19f62a);if(_0x884d4f){const _0x676c43=[];for(const _0x500fe9 of _0x884d4f){const _0x5ea78e=_0x500fe9[_0x44123f(0x80)]||_0x469bb4['cookie'];await initMultiAppEnvironment(_0x500fe9);const {configArray:_0x2d38b5}=await fetchModelList(_0x500fe9['appcode'],_0x5ea78e);_0x676c43[_0x44123f(0x7b)](..._0x2d38b5[_0x44123f(0x6e)](_0x24fb97=>({..._0x24fb97,'_appName':_0x500fe9['name'],'_appCode':_0x500fe9[_0x44123f(0x71)],'_region':_0x500fe9[_0x44123f(0x70)],'_isDefault':_0x500fe9[_0x44123f(0x7d)]})));}return{'ok':!![],'data':_0x676c43};}const {configArray:_0x4a27ff}=await fetchModelList(_0x469bb4[_0x44123f(0x75)],_0x469bb4[_0x44123f(0x80)]);return{'ok':!![],'data':_0x4a27ff};}};
1
+ import{fetchModelList}from"../../core/api-client.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{resolveTargetApps}from"../../commands/api/shared.js";import{initMultiAppEnvironment}from"../../context.js";export const apiList={service:"api",command:"list",description:"List all datasets/models for the configured app(s)",risk:"read",requiresAppCode:true,flags:[{...APPCODE_FLAG_OPTIONAL,hidden:true},{name:"global",type:"boolean",description:"Resolve apps from merged global+project config (default: project apps only)",default:false}],async execute(ctx){const explicitAppcode=ctx.rawFlags.appcode?String(ctx.rawFlags.appcode):undefined;const targetApps=resolveTargetApps(ctx,explicitAppcode);if(targetApps){const allModels=[];for(const app of targetApps){const appCookie=app.cookie||ctx.cookie;await initMultiAppEnvironment(app);const{configArray:configArray}=await fetchModelList(app.appcode,appCookie);allModels.push(...configArray.map(m=>({...m,_appName:app.name,
2
+ _appCode:app.appcode,_region:app.region,_isDefault:app.isDefault})))}return{ok:true,data:allModels}}const{configArray:configArray}=await fetchModelList(ctx.appCode,ctx.cookie);return{ok:true,data:configArray}}};
@@ -1 +1,10 @@
1
- const a22_0x36e2fb=a22_0xb2c2;(function(_0x3bb56d,_0x58d325){const _0x74ec24=a22_0xb2c2,_0x173433=_0x3bb56d();while(!![]){try{const _0xe2f2c1=parseInt(_0x74ec24(0x15a))/0x1+parseInt(_0x74ec24(0x192))/0x2+-parseInt(_0x74ec24(0x1a5))/0x3*(-parseInt(_0x74ec24(0x168))/0x4)+-parseInt(_0x74ec24(0x17e))/0x5+-parseInt(_0x74ec24(0x172))/0x6*(-parseInt(_0x74ec24(0x193))/0x7)+parseInt(_0x74ec24(0x157))/0x8+-parseInt(_0x74ec24(0x184))/0x9*(parseInt(_0x74ec24(0x158))/0xa);if(_0xe2f2c1===_0x58d325)break;else _0x173433['push'](_0x173433['shift']());}catch(_0x3983c0){_0x173433['push'](_0x173433['shift']());}}}(a22_0x5dea,0x7f18b));import a22_0x38a16e from'ora';import{getEnv}from'../../constant/env.js';import{fetchModelList}from'../../core/api-client.js';function a22_0x5dea(){const _0x831522=['Pull\x20dataset\x20facts\x20and\x20refresh\x20the\x20generated\x20SDK\x20model\x20registry\x20(','overwritten','project','\x20model(s)','find','4473hymztu','app','push','modelCount','configName','start','Pulling\x20API\x20config\x20for\x20','length','\x20dataset\x20fact(s)\x20and\x20replaced\x20the\x20TypeScript\x20scaffold\x20with\x20','cookie','AppCode\x20\x22','\x22\x20belongs\x20to\x20multiple\x20app\x20profiles:\x20','slice','needsProjectUpgrade','\x20\x20•\x20','\x20dataset\x20fact(s)\x20and\x20wrote\x20a\x20scaffold\x20with\x20','Internal\x20error:\x20API\x20layout\x20for\x20app\x20profile\x20\x22','\x20dataset\x20fact(s)\x20and\x20refreshed\x20model\x20profile\x20\x22','Verify\x20the\x20selected\x20profile\x20and\x20review\x20legacy\x20generated\x20files,\x20then\x20rerun\x20with\x20--force\x20--yes.','7092216mBbMbc','1180QOZwfR','pull','367283kcokLs','\x22\x20was\x20not\x20resolved.','modelProfile','\x20succeeded,\x20','defaultApp','isDefault','output','values','NOT-SET','merged','outputDir','modelRegistryPath','none','default','1512ktBFOe','validation',';\x20created\x20the\x20stable\x20TypeScript\x20entrypoints','sdkRouting','clientFilePath','exists','\x20app(s)\x20failed','fail','hasAppCode','appCode','993918mvJpCn','bool','boolean','\x20failed','currentApp','action','basename','rawFlags','read','includes','Failed:\x20','selectedAppName','3748535SMChsi','api','mergedCli',';\x20replaced\x20the\x20stable\x20TypeScript\x20entrypoints','apiFilePath','map','78066YIeohD','name','force','appcode','client','Done:\x20','env','succeed','--force\x20requires\x20--yes\x20because\x20it\x20may\x20remove\x20existing\x20model\x20facts\x20or\x20replace\x20a\x20legacy\x20generated\x20scaffold.','message','Select\x20the\x20target\x20explicitly\x20with\x20--app\x20<profile>.','needsAgentMerge','join','filter','290224VbFDVq','14xtVoDf','sdkConfigPath','string','Fetched\x20','global','size','files','has','Pulling\x20','\x20does\x20not\x20contain\x20AppCode\x20\x22','isUnboundTemplate','modelRuntimePath','\x20is\x20not\x20a\x20valid\x20Rabetbase\x20generated\x20file.\x20Move\x20or\x20repair\x20it\x20before\x20pulling\x20models\x20again.'];a22_0x5dea=function(){return _0x831522;};return a22_0x5dea();}import{generateApiFile}from'../../api/generate-api-file.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{resolveTargetApps}from'../../commands/api/shared.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getRuntimeDomain,getSdkClientRoutingConfig}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';import{initMultiAppEnvironment}from'../../context.js';import a22_0x5dfcf1 from'node:path';import{existsSync}from'node:fs';import{MODEL_REGISTRY_FILE_NAME,readModelRegistry}from'../../api/model-registry-file.js';import{getMultiAppConfigs}from'../../utils/config.js';import{getRegistryGroup,resolveApiProfileLayouts}from'../../api/api-group.js';const EXISTING_TS_HINT='Model\x20facts\x20were\x20refreshed,\x20but\x20the\x20stable\x20source\x20entrypoints\x20are\x20not\x20installed.\x20Run\x20`rabetbase\x20project\x20upgrade\x20--dry-run`,\x20then\x20`rabetbase\x20project\x20upgrade\x20--yes`.';function inspectModelRegistry(_0x5f334b,_0xe82687){const _0xe4dd1d=a22_0xb2c2,_0x2cb96a=a22_0x5dfcf1[_0xe4dd1d(0x190)](_0x5f334b,MODEL_REGISTRY_FILE_NAME),_0x342e0c=existsSync(_0x2cb96a);if(!_0x342e0c)return{'exists':![],'hasAppCode':![],'isUnboundTemplate':![]};const _0x20efce=readModelRegistry(_0x2cb96a);if(!_0x20efce)throw new Error(MODEL_REGISTRY_FILE_NAME+_0xe4dd1d(0x19f));const _0x5b85e0=new Set(Object[_0xe4dd1d(0x161)](_0x20efce['profiles'])[_0xe4dd1d(0x183)](_0x33d37d=>_0x33d37d[_0xe4dd1d(0x171)])[_0xe4dd1d(0x191)](_0x4544eb=>_0x4544eb!==_0xe4dd1d(0x162)));return{'exists':!![],'hasAppCode':!!_0xe82687&&_0x5b85e0[_0xe4dd1d(0x19a)](_0xe82687),'isUnboundTemplate':_0x5b85e0[_0xe4dd1d(0x198)]===0x0};}function a22_0xb2c2(_0x58a03a,_0x3e6da5){_0x58a03a=_0x58a03a-0x154;const _0x5dea87=a22_0x5dea();let _0xb2c241=_0x5dea87[_0x58a03a];return _0xb2c241;}function toPullData(_0x52db96){const _0x3b71c1=a22_0xb2c2;return{'appCode':_0x52db96[_0x3b71c1(0x171)],'configName':_0x52db96[_0x3b71c1(0x1a9)],'isDefaultConfig':_0x52db96['isDefaultConfig'],'models':_0x52db96['models'],'sdkRouting':_0x52db96[_0x3b71c1(0x16b)],'files':_0x52db96['files'],'needsAgentMerge':_0x52db96[_0x3b71c1(0x18f)],'needsProjectUpgrade':_0x52db96[_0x3b71c1(0x1b2)],'apiFilePath':_0x52db96[_0x3b71c1(0x182)],'clientFilePath':_0x52db96[_0x3b71c1(0x16c)],'sdkConfigPath':_0x52db96[_0x3b71c1(0x194)],'modelRegistryPath':_0x52db96['modelRegistryPath'],'modelRuntimePath':_0x52db96['modelRuntimePath'],'modelProfile':_0x52db96['modelProfile'],'datasetCount':_0x52db96[_0x3b71c1(0x1a8)],'modelCount':_0x52db96['modelCount']};}function describePull(_0x468340){const _0x19dba4=a22_0xb2c2,_0xd309d9=a22_0x5dfcf1[_0x19dba4(0x178)](_0x468340['sdkConfigPath']);if(_0x468340[_0x19dba4(0x15c)]){const _0x241961=_0x19dba4(0x196)+_0x468340[_0x19dba4(0x1a8)]+_0x19dba4(0x155)+_0x468340[_0x19dba4(0x15c)]+'\x22';if(_0x468340['needsAgentMerge'])return _0x241961+'.\x20'+EXISTING_TS_HINT;if(_0x468340[_0x19dba4(0x199)][_0x19dba4(0x17f)][_0x19dba4(0x177)]===_0x19dba4(0x1a1)||_0x468340[_0x19dba4(0x199)][_0x19dba4(0x188)]['action']===_0x19dba4(0x1a1))return _0x241961+_0x19dba4(0x181);if(_0x468340[_0x19dba4(0x199)][_0x19dba4(0x17f)]['action']==='created'||_0x468340[_0x19dba4(0x199)][_0x19dba4(0x188)][_0x19dba4(0x177)]==='created')return _0x241961+_0x19dba4(0x16a);return _0x241961+';\x20preserved\x20the\x20stable\x20TypeScript\x20entrypoints';}if(_0x468340[_0x19dba4(0x18f)])return _0x19dba4(0x196)+_0x468340[_0x19dba4(0x1a8)]+'\x20dataset\x20fact(s)\x20and\x20refreshed\x20'+_0xd309d9+'.\x20'+EXISTING_TS_HINT;if(_0x468340[_0x19dba4(0x199)][_0x19dba4(0x17f)]['action']===_0x19dba4(0x1a1)||_0x468340[_0x19dba4(0x199)][_0x19dba4(0x188)][_0x19dba4(0x177)]===_0x19dba4(0x1a1))return _0x19dba4(0x196)+_0x468340['modelCount']+_0x19dba4(0x1ad)+_0x468340['modelCount']+_0x19dba4(0x1a3);return'Fetched\x20'+_0x468340[_0x19dba4(0x1a8)]+_0x19dba4(0x1b4)+_0x468340['modelCount']+'\x20model(s)';}export const apiPull={'service':'api','command':a22_0x36e2fb(0x159),'description':a22_0x36e2fb(0x1a0)+DEFAULT_API_DIR+'/)','risk':a22_0x36e2fb(0x17a),'requiresAppCode':!![],'hasFormat':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a22_0x36e2fb(0x160),'type':a22_0x36e2fb(0x195),'description':'Output\x20directory\x20(default:\x20'+DEFAULT_API_DIR+'/)'},{'name':a22_0x36e2fb(0x197),'type':a22_0x36e2fb(0x174),'description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]},{'name':a22_0x36e2fb(0x186),'type':a22_0x36e2fb(0x174),'description':'Accept\x20an\x20empty\x20model\x20result,\x20or\x20replace\x20a\x20legacy\x20prefixed\x20scaffold;\x20requires\x20--yes','default':![]}],async 'validate'(_0x149eea){const _0x25b590=a22_0x36e2fb;if(_0x149eea[_0x25b590(0x173)](_0x25b590(0x186))&&!_0x149eea[_0x25b590(0x173)]('yes'))throw CliErrors[_0x25b590(0x169)](_0x25b590(0x18c),_0x25b590(0x156));},async 'execute'(_0x1395d8){const _0x11e4c2=a22_0x36e2fb,_0x2f67ca=_0x1395d8['rawFlags']['appcode']?String(_0x1395d8[_0x11e4c2(0x179)][_0x11e4c2(0x187)]):undefined,_0x3c8204=_0x1395d8['str']('output')||undefined,_0x116908=_0x1395d8[_0x11e4c2(0x173)](_0x11e4c2(0x186)),_0x1c2d2e=resolveTargetApps(_0x1395d8,_0x2f67ca),_0x577f65=_0x1395d8[_0x11e4c2(0x173)](_0x11e4c2(0x197))?_0x11e4c2(0x163):_0x11e4c2(0x1a2),_0x406711=getMultiAppConfigs(_0x577f65),_0x50f258=_0x5801b4=>_0x5801b4['apiDir']||_0x3c8204||_0x1395d8['apiDir']||DEFAULT_API_DIR,_0x52235e=_0x406711?resolveApiProfileLayouts(_0x406711,_0x50f258):undefined;let _0x355300=_0x1c2d2e;if(!_0x355300&&_0x406711){const _0x410ba4=_0x1395d8[_0x11e4c2(0x17d)]?_0x406711[_0x11e4c2(0x1a4)](_0x141fad=>_0x141fad[_0x11e4c2(0x185)]===_0x1395d8[_0x11e4c2(0x17d)]):undefined,_0x474650=_0x406711[_0x11e4c2(0x191)](_0x3ecc55=>_0x3ecc55[_0x11e4c2(0x187)]===_0x1395d8[_0x11e4c2(0x171)]);if(!_0x410ba4&&_0x474650[_0x11e4c2(0x1ac)]>0x1)throw CliErrors['validation'](_0x11e4c2(0x1af)+_0x1395d8['appCode']+_0x11e4c2(0x1b0)+_0x474650['map'](_0x4df7d5=>_0x4df7d5[_0x11e4c2(0x185)])[_0x11e4c2(0x190)](',\x20')+'.',_0x11e4c2(0x18e));const _0x290888=_0x410ba4??_0x474650[0x0];if(_0x290888)_0x355300=[_0x290888];}if(_0x355300){let _0x122e30=0x0,_0x3ffeaf=0x0;const _0x4b1ed1=[],_0x599fef=_0x52235e??resolveApiProfileLayouts(_0x355300,_0x50f258);for(const _0xb3b8c of _0x355300){const _0x2e61f9=_0xb3b8c[_0x11e4c2(0x1ae)]||_0x1395d8[_0x11e4c2(0x1ae)],_0x14f993=_0xb3b8c[_0x11e4c2(0x18a)]||'production';await initMultiAppEnvironment(_0xb3b8c);const _0x395f1d=_0x599fef[_0x11e4c2(0x1a4)](_0x4ea616=>_0x4ea616[_0x11e4c2(0x1a6)][_0x11e4c2(0x185)]===_0xb3b8c[_0x11e4c2(0x185)]);if(!_0x395f1d)throw new Error(_0x11e4c2(0x154)+_0xb3b8c[_0x11e4c2(0x185)]+_0x11e4c2(0x15b));const _0x2425ae=getRegistryGroup(_0x599fef,_0x395f1d),_0x27c0d9=_0x395f1d[_0x11e4c2(0x164)],_0x4c2270=_0x2425ae?'':_0xb3b8c[_0x11e4c2(0x15f)]?'':_0xb3b8c[_0x11e4c2(0x185)]||_0xb3b8c[_0x11e4c2(0x187)],_0x155a39=_0x2425ae?.[_0x11e4c2(0x1a4)](_0x1e67fb=>_0x1e67fb[_0x11e4c2(0x1a6)][_0x11e4c2(0x15f)])??_0x2425ae?.[0x0];if(_0x2425ae)inspectModelRegistry(_0x27c0d9);const _0x53b21d=a22_0x38a16e(_0x11e4c2(0x19b)+_0xb3b8c[_0x11e4c2(0x185)]+'\x20('+_0xb3b8c[_0x11e4c2(0x187)]+')...')[_0x11e4c2(0x1aa)]();try{const {configArray:_0x252f61}=await fetchModelList(_0xb3b8c[_0x11e4c2(0x187)],_0x2e61f9),_0x111923=await generateApiFile(_0x252f61,_0x4c2270,_0xb3b8c[_0x11e4c2(0x187)],_0xb3b8c[_0x11e4c2(0x15f)],_0x14f993,_0x27c0d9,_0xb3b8c[_0x11e4c2(0x185)],getSdkClientRoutingConfig(),{'overwriteTypescript':_0x2425ae?![]:_0x116908,'allowEmptyModelReplacement':_0x2425ae?_0x116908:undefined,'scaffoldMode':_0x2425ae?_0x11e4c2(0x166):undefined,..._0x2425ae?{'modelProfile':{'name':_0xb3b8c[_0x11e4c2(0x185)],'defaultName':_0x155a39[_0x11e4c2(0x1a6)][_0x11e4c2(0x185)],'runtimeDomain':getRuntimeDomain()}}:{}});_0x53b21d[_0x11e4c2(0x18b)](_0xb3b8c['name']+':\x20'+describePull(_0x111923)),writeCliSideChannelLine('\x20\x20•\x20'+_0x111923[_0x11e4c2(0x194)]),writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x111923[_0x11e4c2(0x182)]),writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x111923[_0x11e4c2(0x16c)]),_0x111923[_0x11e4c2(0x165)]&&writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x111923[_0x11e4c2(0x165)]),_0x111923[_0x11e4c2(0x19e)]&&writeCliSideChannelLine('\x20\x20•\x20'+_0x111923[_0x11e4c2(0x19e)]),_0x4b1ed1[_0x11e4c2(0x1a7)](toPullData(_0x111923)),_0x122e30++;}catch(_0x2055aa){_0x53b21d[_0x11e4c2(0x16f)](_0xb3b8c[_0x11e4c2(0x185)]+':\x20'+(_0x2055aa instanceof Error?_0x2055aa[_0x11e4c2(0x18d)]:String(_0x2055aa))),_0x3ffeaf++;}}writeCliSideChannelLine('');if(_0x3ffeaf>0x0)writeCliSideChannelLine('!\x20'+_0x3ffeaf+_0x11e4c2(0x16e));return{'ok':_0x3ffeaf===0x0,'message':_0x11e4c2(0x189)+_0x122e30+_0x11e4c2(0x15d)+_0x3ffeaf+_0x11e4c2(0x175),'data':{'apps':_0x4b1ed1,'succeeded':_0x122e30,'failed':_0x3ffeaf}};}const _0x529dea=_0x2f67ca&&_0x2f67ca[_0x11e4c2(0x17b)]('-')?_0x2f67ca['split']('-')[_0x11e4c2(0x1b1)](0x1)[_0x11e4c2(0x190)]('-'):'',_0x148077=_0x3c8204||_0x1395d8['apiDir']||DEFAULT_API_DIR,_0x527b84=!_0x2f67ca,_0x217a0e=inspectModelRegistry(_0x148077,_0x1395d8['appCode']),_0x5f419d=_0x1395d8[_0x11e4c2(0x17d)]||_0x1395d8[_0x11e4c2(0x180)]?.[_0x11e4c2(0x176)]||_0x1395d8['mergedCli']?.['defaultApp']||_0x11e4c2(0x167);if(_0x217a0e[_0x11e4c2(0x16d)]&&!_0x217a0e[_0x11e4c2(0x170)]&&!_0x217a0e[_0x11e4c2(0x19d)])throw CliErrors[_0x11e4c2(0x169)](MODEL_REGISTRY_FILE_NAME+_0x11e4c2(0x19c)+_0x1395d8['appCode']+'\x22.','Select\x20a\x20configured\x20app\x20profile\x20or\x20use\x20a\x20separate\x20apiDir.');const _0x453528=a22_0x38a16e(_0x11e4c2(0x1ab)+_0x1395d8[_0x11e4c2(0x171)]+'...')[_0x11e4c2(0x1aa)]();try{const {configArray:_0x477abc}=await fetchModelList(_0x1395d8[_0x11e4c2(0x171)],_0x1395d8['cookie']),_0x452f6b=await generateApiFile(_0x477abc,_0x529dea,_0x1395d8[_0x11e4c2(0x171)],_0x527b84,getEnv(),_0x148077,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':_0x217a0e[_0x11e4c2(0x16d)]?![]:_0x116908,'allowEmptyModelReplacement':_0x217a0e['exists']?_0x116908:undefined,'scaffoldMode':_0x217a0e[_0x11e4c2(0x16d)]?'none':undefined,..._0x217a0e[_0x11e4c2(0x170)]||_0x217a0e[_0x11e4c2(0x19d)]||!_0x217a0e[_0x11e4c2(0x16d)]&&_0x116908?{'modelProfile':{'name':_0x5f419d,'defaultName':_0x1395d8[_0x11e4c2(0x180)]?.[_0x11e4c2(0x15e)]??_0x5f419d,'runtimeDomain':getRuntimeDomain()}}:{}});return _0x453528['succeed'](describePull(_0x452f6b)),writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x452f6b[_0x11e4c2(0x194)]),writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x452f6b[_0x11e4c2(0x182)]),writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x452f6b['clientFilePath']),_0x452f6b[_0x11e4c2(0x165)]&&writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x452f6b[_0x11e4c2(0x165)]),_0x452f6b['modelRuntimePath']&&writeCliSideChannelLine(_0x11e4c2(0x1b3)+_0x452f6b[_0x11e4c2(0x19e)]),{'ok':!![],'message':describePull(_0x452f6b),'data':toPullData(_0x452f6b)};}catch(_0x4b1d20){_0x453528[_0x11e4c2(0x16f)](_0x11e4c2(0x17c)+(_0x4b1d20 instanceof Error?_0x4b1d20[_0x11e4c2(0x18d)]:String(_0x4b1d20)));throw _0x4b1d20;}}};
1
+ import ora from"ora";import{getEnv}from"../../constant/env.js";import{fetchModelList}from"../../core/api-client.js";import{generateApiFile}from"../../api/generate-api-file.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{DEFAULT_API_DIR}from"../../constant/paths.js";import{resolveTargetApps}from"../../commands/api/shared.js";import{writeCliSideChannelLine}from"../../utils/write-cli-side-channel.js";import{getRuntimeDomain,getSdkClientRoutingConfig}from"../../constant/domain.js";import{CliErrors}from"../../errors.js";import{initMultiAppEnvironment}from"../../context.js";import path from"node:path";import{existsSync}from"node:fs";import{MODEL_REGISTRY_FILE_NAME,readModelRegistry}from"../../api/model-registry-file.js";import{getMultiAppConfigs}from"../../utils/config.js";import{getRegistryGroup,resolveApiProfileLayouts}from"../../api/api-group.js"
2
+ ;const EXISTING_TS_HINT="Model facts were refreshed, but the stable source entrypoints are not installed. Run `rabetbase project upgrade --dry-run`, then `rabetbase project upgrade --yes`.";function inspectModelRegistry(outputDir,appCode){const registryPath=path.join(outputDir,MODEL_REGISTRY_FILE_NAME);const exists=existsSync(registryPath);if(!exists)return{exists:false,hasAppCode:false,isUnboundTemplate:false};const registry=readModelRegistry(registryPath);if(!registry){throw new Error(`${MODEL_REGISTRY_FILE_NAME} is not a valid Rabetbase generated file. Move or repair it before pulling models again.`)}const appCodes=new Set(Object.values(registry.profiles).map(profile=>profile.appCode).filter(code=>code!=="NOT-SET"));return{exists:true,hasAppCode:!!appCode&&appCodes.has(appCode),isUnboundTemplate:appCodes.size===0}}function toPullData(result){return{appCode:result.appCode,configName:result.configName,isDefaultConfig:result.isDefaultConfig,models:result.models,
3
+ sdkRouting:result.sdkRouting,files:result.files,needsAgentMerge:result.needsAgentMerge,needsProjectUpgrade:result.needsProjectUpgrade,apiFilePath:result.apiFilePath,clientFilePath:result.clientFilePath,sdkConfigPath:result.sdkConfigPath,modelRegistryPath:result.modelRegistryPath,modelRuntimePath:result.modelRuntimePath,modelProfile:result.modelProfile,datasetCount:result.modelCount,modelCount:result.modelCount}}function describePull(result){const sdkConfigName=path.basename(result.sdkConfigPath);if(result.modelProfile){const base=`Fetched ${result.modelCount} dataset fact(s) and refreshed model profile "${result.modelProfile}"`;if(result.needsAgentMerge)return`${base}. ${EXISTING_TS_HINT}`;if(result.files.api.action==="overwritten"||result.files.client.action==="overwritten"){return`${base}; replaced the stable TypeScript entrypoints`}if(result.files.api.action==="created"||result.files.client.action==="created"){return`${base}; created the stable TypeScript entrypoints`}
4
+ return`${base}; preserved the stable TypeScript entrypoints`}if(result.needsAgentMerge){return`Fetched ${result.modelCount} dataset fact(s) and refreshed ${sdkConfigName}. ${EXISTING_TS_HINT}`}if(result.files.api.action==="overwritten"||result.files.client.action==="overwritten"){return`Fetched ${result.modelCount} dataset fact(s) and replaced the TypeScript scaffold with ${result.modelCount} model(s)`}return`Fetched ${result.modelCount} dataset fact(s) and wrote a scaffold with ${result.modelCount} model(s)`}export const apiPull={service:"api",command:"pull",description:`Pull dataset facts and refresh the generated SDK model registry (${DEFAULT_API_DIR}/)`,risk:"read",requiresAppCode:true,hasFormat:true,flags:[{...APPCODE_FLAG_OPTIONAL,hidden:true},{name:"output",type:"string",description:`Output directory (default: ${DEFAULT_API_DIR}/)`},{name:"global",type:"boolean",description:"Resolve apps from merged global+project config (default: project apps only)",default:false},{
5
+ name:"force",type:"boolean",description:"Accept an empty model result, or replace a legacy prefixed scaffold; requires --yes",default:false}],async validate(ctx){if(ctx.bool("force")&&!ctx.bool("yes")){throw CliErrors.validation("--force requires --yes because it may remove existing model facts or replace a legacy generated scaffold.","Verify the selected profile and review legacy generated files, then rerun with --force --yes.")}},async execute(ctx){const explicitAppcode=ctx.rawFlags.appcode?String(ctx.rawFlags.appcode):undefined;const output=ctx.str("output")||undefined;const force=ctx.bool("force");const targetApps=resolveTargetApps(ctx,explicitAppcode);const scope=ctx.bool("global")?"merged":"project";const configuredApps=getMultiAppConfigs(scope);const resolveOutputDir=app=>app.apiDir||output||ctx.apiDir||DEFAULT_API_DIR;const configuredLayouts=configuredApps?resolveApiProfileLayouts(configuredApps,resolveOutputDir):undefined;let effectiveTargetApps=targetApps
6
+ ;if(!effectiveTargetApps&&configuredApps){const selectedByName=ctx.selectedAppName?configuredApps.find(app=>app.name===ctx.selectedAppName):undefined;const appCodeMatches=configuredApps.filter(app=>app.appcode===ctx.appCode);if(!selectedByName&&appCodeMatches.length>1){throw CliErrors.validation(`AppCode "${ctx.appCode}" belongs to multiple app profiles: ${appCodeMatches.map(app=>app.name).join(", ")}.`,"Select the target explicitly with --app <profile>.")}const selected=selectedByName??appCodeMatches[0];if(selected)effectiveTargetApps=[selected]}if(effectiveTargetApps){let succeeded=0;let failed=0;const apps=[];const allLayouts=configuredLayouts??resolveApiProfileLayouts(effectiveTargetApps,resolveOutputDir);for(const app of effectiveTargetApps){const appCookie=app.cookie||ctx.cookie;const appEnv=app.env||"production";await initMultiAppEnvironment(app);const layout=allLayouts.find(candidate=>candidate.app.name===app.name);if(!layout){
7
+ throw new Error(`Internal error: API layout for app profile "${app.name}" was not resolved.`)}const registryGroup=getRegistryGroup(allLayouts,layout);const outputDir=layout.outputDir;const filePrefix=registryGroup?"":app.isDefault?"":app.name||app.appcode;const configuredDefault=registryGroup?.find(candidate=>candidate.app.isDefault)??registryGroup?.[0];if(registryGroup)inspectModelRegistry(outputDir);const spinner=ora(`Pulling ${app.name} (${app.appcode})...`).start();try{const{configArray:configArray}=await fetchModelList(app.appcode,appCookie);const result=await generateApiFile(configArray,filePrefix,app.appcode,app.isDefault,appEnv,outputDir,app.name,getSdkClientRoutingConfig(),{overwriteTypescript:registryGroup?false:force,allowEmptyModelReplacement:registryGroup?force:undefined,scaffoldMode:registryGroup?"none":undefined,...registryGroup?{modelProfile:{name:app.name,defaultName:configuredDefault.app.name,runtimeDomain:getRuntimeDomain()}}:{}})
8
+ ;spinner.succeed(`${app.name}: ${describePull(result)}`);writeCliSideChannelLine(` • ${result.sdkConfigPath}`);writeCliSideChannelLine(` • ${result.apiFilePath}`);writeCliSideChannelLine(` • ${result.clientFilePath}`);if(result.modelRegistryPath){writeCliSideChannelLine(` • ${result.modelRegistryPath}`)}if(result.modelRuntimePath){writeCliSideChannelLine(` • ${result.modelRuntimePath}`)}apps.push(toPullData(result));succeeded++}catch(err){spinner.fail(`${app.name}: ${err instanceof Error?err.message:String(err)}`);failed++}}writeCliSideChannelLine("");if(failed>0)writeCliSideChannelLine(`! ${failed} app(s) failed`);return{ok:failed===0,message:`Done: ${succeeded} succeeded, ${failed} failed`,data:{apps:apps,succeeded:succeeded,failed:failed}}}const filePrefix=explicitAppcode&&explicitAppcode.includes("-")?explicitAppcode.split("-").slice(1).join("-"):"";const outputDir=output||ctx.apiDir||DEFAULT_API_DIR;const isFromDefaultConfig=!explicitAppcode
9
+ ;const registry=inspectModelRegistry(outputDir,ctx.appCode);const profileName=ctx.selectedAppName||ctx.mergedCli?.currentApp||ctx.mergedCli?.defaultApp||"default";if(registry.exists&&!registry.hasAppCode&&!registry.isUnboundTemplate){throw CliErrors.validation(`${MODEL_REGISTRY_FILE_NAME} does not contain AppCode "${ctx.appCode}".`,"Select a configured app profile or use a separate apiDir.")}const spinner=ora(`Pulling API config for ${ctx.appCode}...`).start();try{const{configArray:configArray}=await fetchModelList(ctx.appCode,ctx.cookie);const result=await generateApiFile(configArray,filePrefix,ctx.appCode,isFromDefaultConfig,getEnv(),outputDir,undefined,getSdkClientRoutingConfig(),{overwriteTypescript:registry.exists?false:force,allowEmptyModelReplacement:registry.exists?force:undefined,scaffoldMode:registry.exists?"none":undefined,...registry.hasAppCode||registry.isUnboundTemplate||!registry.exists&&force?{modelProfile:{name:profileName,
10
+ defaultName:ctx.mergedCli?.defaultApp??profileName,runtimeDomain:getRuntimeDomain()}}:{}});spinner.succeed(describePull(result));writeCliSideChannelLine(` • ${result.sdkConfigPath}`);writeCliSideChannelLine(` • ${result.apiFilePath}`);writeCliSideChannelLine(` • ${result.clientFilePath}`);if(result.modelRegistryPath){writeCliSideChannelLine(` • ${result.modelRegistryPath}`)}if(result.modelRuntimePath){writeCliSideChannelLine(` • ${result.modelRuntimePath}`)}return{ok:true,message:describePull(result),data:toPullData(result)}}catch(err){spinner.fail(`Failed: ${err instanceof Error?err.message:String(err)}`);throw err}}};
@@ -1 +1 @@
1
- function a23_0x48e7(_0x583b35,_0x4d0c16){_0x583b35=_0x583b35-0xc1;const _0xca0e6f=a23_0xca0e();let _0x48e7a4=_0xca0e6f[_0x583b35];return _0x48e7a4;}(function(_0x281d09,_0x2ca208){const _0x7e35cd=a23_0x48e7,_0x159055=_0x281d09();while(!![]){try{const _0x12436a=parseInt(_0x7e35cd(0xc2))/0x1+parseInt(_0x7e35cd(0xc6))/0x2+parseInt(_0x7e35cd(0xc9))/0x3+-parseInt(_0x7e35cd(0xca))/0x4*(parseInt(_0x7e35cd(0xd1))/0x5)+parseInt(_0x7e35cd(0xc3))/0x6*(parseInt(_0x7e35cd(0xcc))/0x7)+-parseInt(_0x7e35cd(0xcd))/0x8+-parseInt(_0x7e35cd(0xc4))/0x9;if(_0x12436a===_0x2ca208)break;else _0x159055['push'](_0x159055['shift']());}catch(_0x98567a){_0x159055['push'](_0x159055['shift']());}}}(a23_0xca0e,0x64cb3));import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';function a23_0xca0e(){const _0x1ca528=['map','28EdKSPp','941576BmYMHq','merged','length','selectedAppName','1030rXWIiZ','App\x20\x22','validation','813355FeedEO','210282QWpNLV','4980483dQueuk','global','264952sYmPHA','join','filter','286062djvUzU','1892tEHbPn'];a23_0xca0e=function(){return _0x1ca528;};return a23_0xca0e();}export function resolveTargetApps(_0x12399e,_0x58dda4){const _0x367391=a23_0x48e7;if(_0x58dda4)return null;const _0x1ca017=_0x12399e['bool'](_0x367391(0xc5))?_0x367391(0xce):'project';let _0x1a1f23=getMultiAppConfigs(_0x1ca017);if(!_0x1a1f23||_0x1a1f23[_0x367391(0xcf)]===0x0)return null;if(_0x12399e['selectedAppName']){const _0x51edc0=_0x1a1f23[_0x367391(0xc8)](_0x35b661=>_0x35b661['name']===_0x12399e['selectedAppName']);if(_0x51edc0[_0x367391(0xcf)]===0x0){const _0x37f98a=_0x1a1f23[_0x367391(0xcb)](_0x125b40=>_0x125b40['name'])[_0x367391(0xc7)](',\x20');throw CliErrors[_0x367391(0xc1)](_0x367391(0xd2)+_0x12399e[_0x367391(0xd0)]+'\x22\x20not\x20found\x20in\x20config.\x20Available:\x20'+_0x37f98a);}_0x1a1f23=_0x51edc0;}return _0x1a1f23;}
1
+ import{getMultiAppConfigs}from"../../utils/config.js";import{CliErrors}from"../../errors.js";export function resolveTargetApps(ctx,explicitAppcode){if(explicitAppcode)return null;const scope=ctx.bool("global")?"merged":"project";let multiApps=getMultiAppConfigs(scope);if(!multiApps||multiApps.length===0)return null;if(ctx.selectedAppName){const filtered=multiApps.filter(a=>a.name===ctx.selectedAppName);if(filtered.length===0){const available=multiApps.map(a=>a.name).join(", ");throw CliErrors.validation(`App "${ctx.selectedAppName}" not found in config. Available: ${available}`)}multiApps=filtered}return multiApps}
@@ -1 +1 @@
1
- const a24_0x4bbbcf=a24_0x30ea;(function(_0x52429e,_0x56816d){const _0x414311=a24_0x30ea,_0x5ed239=_0x52429e();while(!![]){try{const _0x49d60f=-parseInt(_0x414311(0x81))/0x1+parseInt(_0x414311(0x85))/0x2+parseInt(_0x414311(0x82))/0x3*(-parseInt(_0x414311(0x7b))/0x4)+parseInt(_0x414311(0x7a))/0x5*(-parseInt(_0x414311(0x7d))/0x6)+parseInt(_0x414311(0x7c))/0x7+-parseInt(_0x414311(0x86))/0x8+-parseInt(_0x414311(0x88))/0x9*(-parseInt(_0x414311(0x83))/0xa);if(_0x49d60f===_0x56816d)break;else _0x5ed239['push'](_0x5ed239['shift']());}catch(_0x19ea90){_0x5ed239['push'](_0x5ed239['shift']());}}}(a24_0x1155,0x9b673));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getAppVipDeploy}from'../../core/api-client.js';function a24_0x30ea(_0x19002c,_0xe148c3){_0x19002c=_0x19002c-0x7a;const _0x115588=a24_0x1155();let _0x30eafb=_0x115588[_0x19002c];return _0x30eafb;}export const appDetailDefinition={'service':a24_0x4bbbcf(0x80),'command':a24_0x4bbbcf(0x7f),'description':'Read\x20the\x20platform\x27s\x20vipDeploy\x20flag\x20for\x20independent\x20deployment\x20data\x20sync','risk':a24_0x4bbbcf(0x84),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x686f5a){const _0x1a68c0=a24_0x4bbbcf,_0x38f79e=await getAppVipDeploy(_0x686f5a['appCode'],_0x686f5a[_0x1a68c0(0x7e)]);return{'ok':!![],'data':{'vipDeploy':_0x38f79e??null},'message':_0x38f79e===undefined?_0x1a68c0(0x87):'Platform\x20deployment\x20sync\x20flag\x20read;\x20automatic\x20sync,\x20runtime\x20login\x20and\x20sync\x20progress\x20are\x20not\x20assessed.'};}};function a24_0x1155(){const _0x625b3e=['app','1010640PdSAuW','1414278Lwwcbq','102310SZuOLE','read','1567696MEESjs','1134888eWixrr','Application\x20vipDeploy\x20is\x20unknown:\x20the\x20platform\x20did\x20not\x20return\x20a\x20boolean\x20flag.','1692cksivN','80690XRTCXM','4GpdWsn','1955744AQdqKP','270kTmPMn','cookie','detail'];a24_0x1155=function(){return _0x625b3e;};return a24_0x1155();}
1
+ import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{getAppVipDeploy}from"../../core/api-client.js";export const appDetailDefinition={service:"app",command:"detail",description:"Read the platform's vipDeploy flag for independent deployment data sync",risk:"read",requiresAuth:true,requiresAppCode:true,structuredErrors:true,flags:[APPCODE_FLAG_OPTIONAL],async execute(ctx){const vipDeploy=await getAppVipDeploy(ctx.appCode,ctx.cookie);return{ok:true,data:{vipDeploy:vipDeploy??null},message:vipDeploy===undefined?"Application vipDeploy is unknown: the platform did not return a boolean flag.":"Platform deployment sync flag read; automatic sync, runtime login and sync progress are not assessed."}}};
@@ -1 +1 @@
1
- (function(_0xd5197c,_0x297956){const _0x12d45d=a25_0x2af8,_0x134974=_0xd5197c();while(!![]){try{const _0x177a88=parseInt(_0x12d45d(0x102))/0x1*(parseInt(_0x12d45d(0x109))/0x2)+-parseInt(_0x12d45d(0x100))/0x3*(-parseInt(_0x12d45d(0x104))/0x4)+-parseInt(_0x12d45d(0x108))/0x5*(parseInt(_0x12d45d(0x105))/0x6)+parseInt(_0x12d45d(0x106))/0x7+parseInt(_0x12d45d(0x101))/0x8+parseInt(_0x12d45d(0x103))/0x9+-parseInt(_0x12d45d(0x107))/0xa;if(_0x177a88===_0x297956)break;else _0x134974['push'](_0x134974['shift']());}catch(_0x241883){_0x134974['push'](_0x134974['shift']());}}}(a25_0x2e01,0x95d51));import{appListDefinition}from'../../commands/app/list.js';function a25_0x2e01(){const _0x27981c=['12004700qJjCxu','1597955HSFOPN','125162QEpexB','51bVjyxj','5712560xEffcN','1IdfMHj','8483931wdYQod','166524IBOXbq','18NUsvXl','2421433tsAXQx'];a25_0x2e01=function(){return _0x27981c;};return a25_0x2e01();}import{appMembersListDefinition}from'../../commands/app/members-list.js';function a25_0x2af8(_0x436050,_0x2ff697){_0x436050=_0x436050-0x100;const _0x2e012e=a25_0x2e01();let _0x2af81b=_0x2e012e[_0x436050];return _0x2af81b;}import{appDetailDefinition}from'../../commands/app/detail.js';export const appDefinitions=[appListDefinition,appDetailDefinition,appMembersListDefinition];
1
+ import{appListDefinition}from"../../commands/app/list.js";import{appMembersListDefinition}from"../../commands/app/members-list.js";import{appDetailDefinition}from"../../commands/app/detail.js";export const appDefinitions=[appListDefinition,appDetailDefinition,appMembersListDefinition];
@@ -1 +1,5 @@
1
- const a26_0x44f3b0=a26_0xd027;(function(_0x5c159d,_0x280ad2){const _0x428c8d=a26_0xd027,_0x47ffbd=_0x5c159d();while(!![]){try{const _0x7ce01=parseInt(_0x428c8d(0x83))/0x1+parseInt(_0x428c8d(0xa2))/0x2*(parseInt(_0x428c8d(0x80))/0x3)+parseInt(_0x428c8d(0xa4))/0x4+-parseInt(_0x428c8d(0x88))/0x5*(parseInt(_0x428c8d(0xaa))/0x6)+-parseInt(_0x428c8d(0xa3))/0x7+parseInt(_0x428c8d(0xa7))/0x8+-parseInt(_0x428c8d(0x82))/0x9*(parseInt(_0x428c8d(0x8b))/0xa);if(_0x7ce01===_0x280ad2)break;else _0x47ffbd['push'](_0x47ffbd['shift']());}catch(_0xa13b05){_0x47ffbd['push'](_0x47ffbd['shift']());}}}(a26_0x253c,0xc0443));function a26_0x253c(){const _0x385a35=['21371TwCOUz','4560128ueIerb','bool','merged','1670216rQbaeo','\x20config','appcode','34116mVINgh','No\x20apps\x20configured','1059WaPXwF','projectPath','16489557xQgHSr','725187nswRSp','boolean','apps','globalConfig','app','300jNvhoY','push','optional','10VcqWKR','defaultApp','length','global','region','project','globalPath','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','hasOwnProperty','map','source','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','object','read','remote','prototype','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','projectConfig','entries','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','\x20in\x20','keys','call','5042KZHaTL'];a26_0x253c=function(){return _0x385a35;};return a26_0x253c();}import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';function a26_0xd027(_0x548048,_0x18935e){_0x548048=_0x548048-0x7f;const _0x253c69=a26_0x253c();let _0xd02751=_0x253c69[_0x548048];return _0xd02751;}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';import{resolveEffectiveRegion}from'../../config/region-config.js';function buildItemsFromLayer(_0x243c05,_0x22e2c3,_0x21e137){const _0x10d97c=a26_0xd027,_0x5cde39=[],_0x1a4beb=_0x243c05[_0x10d97c(0x85)]&&typeof _0x243c05[_0x10d97c(0x85)]==='object'?_0x243c05['apps']:{},_0x3dab55=_0x243c05[_0x10d97c(0x8c)]||undefined,_0x402a2a=_0x3dab55??(Object[_0x10d97c(0xa0)](_0x1a4beb)[_0x10d97c(0x8d)]===0x1?Object['keys'](_0x1a4beb)[0x0]:undefined);for(const [_0x501a60,_0xf1c7e]of Object[_0x10d97c(0x9d)](_0x1a4beb)){if(!_0xf1c7e||typeof _0xf1c7e!==_0x10d97c(0x97)||!_0xf1c7e[_0x10d97c(0xa9)])continue;const _0x1977dd=resolveEffectiveRegion({'appRegion':_0xf1c7e[_0x10d97c(0x8f)],'projectRegion':_0x22e2c3==='project'?_0x243c05[_0x10d97c(0x8f)]:undefined,'globalRegion':_0x22e2c3===_0x10d97c(0x8e)?_0x243c05[_0x10d97c(0x8f)]:_0x21e137,'appName':_0x501a60});_0x5cde39[_0x10d97c(0x89)]({'name':_0x501a60,'appcode':_0xf1c7e[_0x10d97c(0xa9)],'named':!![],'definedIn':_0x22e2c3,'isDefault':_0x501a60===_0x402a2a,...buildAppProfileListFields(_0xf1c7e),'effectiveRegion':_0x1977dd['region'],'regionSource':_0x1977dd['source']});}return _0x5cde39;}function buildMergedItems(_0x585d6a,_0x6b9ff0){const _0x29b193=a26_0xd027,{apps:apps={}}=_0x585d6a,_0x309676=_0x585d6a['defaultApp'],_0x30351e=_0x309676??(Object[_0x29b193(0xa0)](apps)[_0x29b193(0x8d)]===0x1?Object[_0x29b193(0xa0)](apps)[0x0]:undefined),_0x69bd5f=_0x6b9ff0[_0x29b193(0x86)][_0x29b193(0x85)]&&typeof _0x6b9ff0[_0x29b193(0x86)][_0x29b193(0x85)]==='object'?_0x6b9ff0[_0x29b193(0x86)][_0x29b193(0x85)]:{},_0x56d8e9=_0x6b9ff0['projectConfig'][_0x29b193(0x85)]&&typeof _0x6b9ff0['projectConfig'][_0x29b193(0x85)]==='object'?_0x6b9ff0[_0x29b193(0x9c)]['apps']:{},_0x22b747=Object[_0x29b193(0x9d)](apps),_0x1e26f6=_0x22b747[_0x29b193(0x94)](([_0x4543b7,_0x164087])=>{const _0x346817=_0x29b193,_0x80b7e=appDefinedIn(_0x4543b7,_0x69bd5f,_0x56d8e9),_0x3243d3=Object[_0x346817(0x9a)][_0x346817(0x93)][_0x346817(0xa1)](_0x56d8e9,_0x4543b7),_0x537e3c=resolveEffectiveRegion({'appRegion':_0x164087[_0x346817(0x8f)],'projectRegion':_0x3243d3?_0x6b9ff0[_0x346817(0x9c)][_0x346817(0x8f)]:undefined,'globalRegion':_0x6b9ff0[_0x346817(0x86)]['region'],'mergedRegion':_0x585d6a['region'],'appName':_0x4543b7});return{'name':_0x4543b7,'appcode':_0x164087[_0x346817(0xa9)],'named':!![],'definedIn':_0x80b7e,'isDefault':_0x4543b7===_0x30351e,...buildAppProfileListFields(_0x164087),'effectiveRegion':_0x537e3c['region'],'regionSource':_0x537e3c[_0x346817(0x95)]};});return _0x1e26f6;}function validateAppListFlags(_0x5d7c80){const _0x2577e1=a26_0xd027;if(!_0x5d7c80[_0x2577e1(0xa5)](_0x2577e1(0x99)))return;if(!_0x5d7c80[_0x2577e1(0xa5)]('global')&&!_0x5d7c80['bool'](_0x2577e1(0x90)))return;throw CliErrors['validation'](_0x2577e1(0x96),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x47ee35){const _0x879ce5=a26_0xd027;validateAppListFlags(_0x47ee35);if(_0x47ee35[_0x879ce5(0xa5)](_0x879ce5(0x99)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x47ee35)};const _0xeb71d4=_0x47ee35['bool'](_0x879ce5(0x8e)),_0x1c7389=_0x47ee35['bool'](_0x879ce5(0x90)),_0xfe1168=_0xeb71d4?_0x879ce5(0x8e):_0x1c7389?_0x879ce5(0x90):'merged',{config:_0x40b5fa,layers:_0x481610}=readRawConfigWithLayers(),_0x17f108=resolveDefaultAppSource(_0x481610),{defaultApp:_0x4e4a3d}=_0x40b5fa;let _0x26658b,_0x3fa250;switch(_0xfe1168){case _0x879ce5(0x8e):_0x26658b=buildItemsFromLayer(_0x481610[_0x879ce5(0x86)],_0x879ce5(0x8e)),_0x3fa250=_0x481610['globalPath'];break;case _0x879ce5(0x90):_0x26658b=buildItemsFromLayer(_0x481610[_0x879ce5(0x9c)],_0x879ce5(0x90),_0x481610[_0x879ce5(0x86)][_0x879ce5(0x8f)]),_0x3fa250=_0x481610[_0x879ce5(0x81)];break;default:_0x26658b=buildMergedItems(_0x40b5fa,_0x481610);break;}enrichAppListItemsWithMergedSelection(_0x26658b,_0x47ee35['mergedCli']);if(_0x26658b[_0x879ce5(0x8d)]===0x0){const _0xf7ebbd=_0xfe1168===_0x879ce5(0xa6)?'':_0x879ce5(0x9f)+_0xfe1168+_0x879ce5(0xa8);return{'ok':!![],'data':[],'message':_0x879ce5(0x7f)+_0xf7ebbd+'.\x20Use\x20`'+CLI_BIN_NAME+_0x879ce5(0x9e)};}const _0x427522=_0x26658b['find'](_0x1e94e5=>_0x1e94e5['isCurrent']===!![]),_0x416f22=_0x4e4a3d??_0x427522?.['name']??null,_0xfb371b=_0xfe1168===_0x879ce5(0xa6)?{'globalPath':_0x481610[_0x879ce5(0x91)]??null,'projectPath':_0x481610[_0x879ce5(0x81)]??null,'defaultApp':_0x416f22,'defaultAppSource':_0x4e4a3d!=null?_0x17f108:null}:{'scope':_0xfe1168,'configPath':_0x3fa250??null};return{'ok':!![],'data':{'items':_0x26658b,'meta':_0xfb371b}};}export const appListDefinition={'service':a26_0x44f3b0(0x87),'command':'list','description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a26_0x44f3b0(0x98),'auth':a26_0x44f3b0(0x8a),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':'boolean','description':'List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','default':![]},{'name':a26_0x44f3b0(0x8e),'type':a26_0x44f3b0(0x84),'description':a26_0x44f3b0(0x92),'default':![]},{'name':'project','type':a26_0x44f3b0(0x84),'description':a26_0x44f3b0(0x9b),'default':![]}],async 'validate'(_0x2da680){validateAppListFlags(_0x2da680);},'execute':execute};
1
+ import{readRawConfigWithLayers}from"../../context.js";import{CLI_BIN_NAME}from"../../constant/cli.js";import{CliErrors}from"../../errors.js";import{buildAppProfileListFields}from"../../config/schema.js";import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from"../../commands/app/shared.js";import{listRemoteAppDirectory}from"../../commands/app/remote-directory.js";import{resolveEffectiveRegion}from"../../config/region-config.js";function buildItemsFromLayer(layerConfig,definedIn,inheritedRegion){const items=[];const apps=layerConfig.apps&&typeof layerConfig.apps==="object"?layerConfig.apps:{};const explicitDefault=layerConfig.defaultApp||undefined;const defaultApp=explicitDefault??(Object.keys(apps).length===1?Object.keys(apps)[0]:undefined);for(const[name,profile]of Object.entries(apps)){if(!profile||typeof profile!=="object"||!profile.appcode)continue;const resolvedRegion=resolveEffectiveRegion({appRegion:profile.region,
2
+ projectRegion:definedIn==="project"?layerConfig.region:undefined,globalRegion:definedIn==="global"?layerConfig.region:inheritedRegion,appName:name});items.push({name:name,appcode:profile.appcode,named:true,definedIn:definedIn,isDefault:name===defaultApp,...buildAppProfileListFields(profile),effectiveRegion:resolvedRegion.region,regionSource:resolvedRegion.source})}return items}function buildMergedItems(config,layers){const{apps:apps={}}=config;const explicitDefault=config.defaultApp;const defaultApp=explicitDefault??(Object.keys(apps).length===1?Object.keys(apps)[0]:undefined);const globalApps=layers.globalConfig.apps&&typeof layers.globalConfig.apps==="object"?layers.globalConfig.apps:{};const projectApps=layers.projectConfig.apps&&typeof layers.projectConfig.apps==="object"?layers.projectConfig.apps:{};const entries=Object.entries(apps);const items=entries.map(([name,profile])=>{const definedIn=appDefinedIn(name,globalApps,projectApps)
3
+ ;const isProjectDefinition=Object.prototype.hasOwnProperty.call(projectApps,name);const resolvedRegion=resolveEffectiveRegion({appRegion:profile.region,projectRegion:isProjectDefinition?layers.projectConfig.region:undefined,globalRegion:layers.globalConfig.region,mergedRegion:config.region,appName:name});return{name:name,appcode:profile.appcode,named:true,definedIn:definedIn,isDefault:name===defaultApp,...buildAppProfileListFields(profile),effectiveRegion:resolvedRegion.region,regionSource:resolvedRegion.source}});return items}function validateAppListFlags(ctx){if(!ctx.bool("remote"))return;if(!ctx.bool("global")&&!ctx.bool("project"))return;throw CliErrors.validation("`--remote` cannot be used with `--global` or `--project`.","Use `rabetbase app list --remote` for the platform directory, or `rabetbase app list --global/--project` for local config.")}async function execute(ctx){validateAppListFlags(ctx);if(ctx.bool("remote")){return{ok:true,data:await listRemoteAppDirectory(ctx)}}
4
+ const isGlobal=ctx.bool("global");const isProject=ctx.bool("project");const scope=isGlobal?"global":isProject?"project":"merged";const{config:config,layers:layers}=readRawConfigWithLayers();const defaultAppSource=resolveDefaultAppSource(layers);const{defaultApp:defaultApp}=config;let items;let configPath;switch(scope){case"global":items=buildItemsFromLayer(layers.globalConfig,"global");configPath=layers.globalPath;break;case"project":items=buildItemsFromLayer(layers.projectConfig,"project",layers.globalConfig.region);configPath=layers.projectPath;break;default:items=buildMergedItems(config,layers);break}enrichAppListItemsWithMergedSelection(items,ctx.mergedCli);if(items.length===0){const hint=scope==="merged"?"":` in ${scope} config`;return{ok:true,data:[],message:`No apps configured${hint}. Use \`${CLI_BIN_NAME} workspace add <name> --appcode <code>\` to add one.`}}const currentItem=items.find(i=>i.isCurrent===true);const effectiveDefault=defaultApp??currentItem?.name??null
5
+ ;const meta=scope==="merged"?{globalPath:layers.globalPath??null,projectPath:layers.projectPath??null,defaultApp:effectiveDefault,defaultAppSource:defaultApp!=null?defaultAppSource:null}:{scope:scope,configPath:configPath??null};return{ok:true,data:{items:items,meta:meta}}}export const appListDefinition={service:"app",command:"list",description:"List configured apps, or platform apps with --remote",risk:"read",auth:"optional",requiresAuth:false,requiresAppCode:false,flags:[{name:"remote",type:"boolean",description:"List apps available on the platform for the current login",default:false},{name:"global",type:"boolean",description:"Show only apps from global ~/.rabetbase.json",default:false},{name:"project",type:"boolean",description:"Show only apps from project .rabetbase.json",default:false}],async validate(ctx){validateAppListFlags(ctx)},execute:execute};
@@ -1 +1 @@
1
- const a27_0x3484ca=a27_0x36f7;(function(_0x3043b5,_0x1de507){const _0x49f75d=a27_0x36f7,_0x7fe981=_0x3043b5();while(!![]){try{const _0x191550=-parseInt(_0x49f75d(0x189))/0x1*(-parseInt(_0x49f75d(0x180))/0x2)+parseInt(_0x49f75d(0x181))/0x3*(parseInt(_0x49f75d(0x18a))/0x4)+-parseInt(_0x49f75d(0x18e))/0x5+-parseInt(_0x49f75d(0x17e))/0x6*(parseInt(_0x49f75d(0x186))/0x7)+parseInt(_0x49f75d(0x18d))/0x8+-parseInt(_0x49f75d(0x18c))/0x9*(-parseInt(_0x49f75d(0x17f))/0xa)+-parseInt(_0x49f75d(0x185))/0xb*(parseInt(_0x49f75d(0x187))/0xc);if(_0x191550===_0x1de507)break;else _0x7fe981['push'](_0x7fe981['shift']());}catch(_0x378b31){_0x7fe981['push'](_0x7fe981['shift']());}}}(a27_0x4d7d,0x54ccf));function a27_0x4d7d(){const _0x395427=['appCode','\x20application\x20member(s)','length','33WVwrMP','4683paCapY','4097028tceKRw','read','243657qHWgZJ','1075192ySSgsd','List\x20application\x20members\x20with\x20their\x20role\x20memberships','4691619veWGoC','1143176eYotui','587335elcFxO','1794ILiLei','10TNPybQ','4boPUcA','6ENbLsc'];a27_0x4d7d=function(){return _0x395427;};return a27_0x4d7d();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a27_0x36f7(_0x512caf,_0x64e0d7){_0x512caf=_0x512caf-0x17e;const _0x4d7d47=a27_0x4d7d();let _0x36f75f=_0x4d7d47[_0x512caf];return _0x36f75f;}import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':'app','command':'members-list','description':a27_0x3484ca(0x18b),'risk':a27_0x3484ca(0x188),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x172959){const _0x2f7440=a27_0x3484ca,_0x4b3ad5=projectAppMembers(await listRoleUsers(_0x172959[_0x2f7440(0x182)]));return{'ok':!![],'data':{'appCode':_0x172959[_0x2f7440(0x182)],'items':_0x4b3ad5,'totalCount':_0x4b3ad5[_0x2f7440(0x184)]},'message':'Found\x20'+_0x4b3ad5[_0x2f7440(0x184)]+_0x2f7440(0x183)};}};
1
+ import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{projectAppMembers}from"../../commands/app/shared.js";import{listRoleUsers}from"../../core/api-client.js";export const appMembersListDefinition={service:"app",command:"members-list",description:"List application members with their role memberships",risk:"read",requiresAuth:true,requiresAppCode:true,structuredErrors:true,flags:[APPCODE_FLAG_OPTIONAL],async execute(ctx){const items=projectAppMembers(await listRoleUsers(ctx.appCode));return{ok:true,data:{appCode:ctx.appCode,items:items,totalCount:items.length},message:`Found ${items.length} application member(s)`}}};
@@ -1 +1 @@
1
- function a28_0x50b3(){const _0x109644=['154ERwLgR','135570hpXuJA','75890LYLLVj','567nKgLKI','appDesc','appCode','8493OcnyPF','7816SaZujB','appName','1NBKQHH','30cylIFQ','30695LfEPcf','cookie','491283foIGKu','platform','map','2264412UUsidD','180tYomot'];a28_0x50b3=function(){return _0x109644;};return a28_0x50b3();}(function(_0x13ef38,_0x5bc94e){const _0x2195a5=a28_0x242f,_0x39898b=_0x13ef38();while(!![]){try{const _0x4ec275=parseInt(_0x2195a5(0x101))/0x1*(parseInt(_0x2195a5(0x10b))/0x2)+-parseInt(_0x2195a5(0xfe))/0x3*(-parseInt(_0x2195a5(0x109))/0x4)+parseInt(_0x2195a5(0x103))/0x5*(parseInt(_0x2195a5(0x102))/0x6)+parseInt(_0x2195a5(0x10d))/0x7*(-parseInt(_0x2195a5(0xff))/0x8)+parseInt(_0x2195a5(0x105))/0x9+parseInt(_0x2195a5(0x10c))/0xa*(parseInt(_0x2195a5(0x10a))/0xb)+-parseInt(_0x2195a5(0x108))/0xc;if(_0x4ec275===_0x5bc94e)break;else _0x39898b['push'](_0x39898b['shift']());}catch(_0x517851){_0x39898b['push'](_0x39898b['shift']());}}}(a28_0x50b3,0x1d056));import{listRemoteApps}from'../../core/api-client.js';function a28_0x242f(_0x1ee99d,_0x3458b6){_0x1ee99d=_0x1ee99d-0xfe;const _0x50b3d2=a28_0x50b3();let _0x242fbc=_0x50b3d2[_0x1ee99d];return _0x242fbc;}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x586cd9){const _0x2349b6=a28_0x242f,_0x112f5a=_0x586cd9[_0x2349b6(0x104)]||getCookie();if(!_0x112f5a)throw CliErrors['authRequired']();return _0x112f5a;}export async function listRemoteAppDirectory(_0x1b50b8){const _0x1ee120=a28_0x242f,_0x440eba=await withActiveCookie(resolveCookie(_0x1b50b8),()=>listRemoteApps());return{'items':_0x440eba[_0x1ee120(0x107)](_0x3e6512=>({..._0x3e6512['id']!=null?{'id':_0x3e6512['id']}:{},'appCode':_0x3e6512[_0x1ee120(0x10f)],'appName':_0x3e6512[_0x1ee120(0x100)],..._0x3e6512[_0x1ee120(0x10e)]!=null?{'appDesc':_0x3e6512[_0x1ee120(0x10e)]}:{}})),'meta':{'source':_0x1ee120(0x106)}};}
1
+ import{listRemoteApps}from"../../core/api-client.js";import{getCookie}from"../../auth/get-cookie.js";import{CliErrors}from"../../errors.js";import{withActiveCookie}from"../../utils/with-active-cookie.js";function resolveCookie(ctx){const cookie=ctx.cookie||getCookie();if(!cookie)throw CliErrors.authRequired();return cookie}export async function listRemoteAppDirectory(ctx){const apps=await withActiveCookie(resolveCookie(ctx),()=>listRemoteApps());return{items:apps.map(app=>({...app.id!=null?{id:app.id}:{},appCode:app.appCode,appName:app.appName,...app.appDesc!=null?{appDesc:app.appDesc}:{}})),meta:{source:"platform"}}}
@@ -1 +1,4 @@
1
- (function(_0x438a65,_0x5d695f){const _0x3c81f9=a29_0x4d4b,_0x3f61ec=_0x438a65();while(!![]){try{const _0x111a1c=-parseInt(_0x3c81f9(0xa7))/0x1+parseInt(_0x3c81f9(0x9c))/0x2+-parseInt(_0x3c81f9(0xba))/0x3+parseInt(_0x3c81f9(0xa2))/0x4+parseInt(_0x3c81f9(0xb0))/0x5+parseInt(_0x3c81f9(0xad))/0x6+-parseInt(_0x3c81f9(0xae))/0x7*(parseInt(_0x3c81f9(0xb5))/0x8);if(_0x111a1c===_0x5d695f)break;else _0x3f61ec['push'](_0x3f61ec['shift']());}catch(_0x508c85){_0x3f61ec['push'](_0x3f61ec['shift']());}}}(a29_0x6fe8,0x38ccb));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x61923d){const _0x163dff=a29_0x4d4b,_0xac96df=_0x61923d?.[_0x163dff(0xc0)]();return _0xac96df?_0xac96df:null;}export function projectAppMembers(_0x20bca2){const _0x8a7598=a29_0x4d4b,_0x18b1b7=new Map(),_0x284114=[..._0x20bca2][_0x8a7598(0xb4)]((_0xe0580,_0x39565b)=>_0xe0580['id']-_0x39565b['id']),_0x361e4f=(_0x675067,_0x5bd750,_0x178183)=>{const _0x4edc0f=_0x8a7598;for(const _0x1591ed of _0x5bd750){const _0x1be772=Number(_0x1591ed[_0x4edc0f(0xc1)]);if(!Number[_0x4edc0f(0xb7)](_0x1be772)||_0x1be772<=0x0)continue;let _0x43973f=_0x18b1b7['get'](_0x1be772);if(!_0x43973f)_0x43973f={'userId':_0x1be772,'username':nullableText(_0x1591ed[_0x4edc0f(0x9e)]),'displayName':nullableText(_0x1591ed[_0x4edc0f(0xa9)]),'status':_0x178183,'roles':[],'roleKeys':new Set()},_0x18b1b7['set'](_0x1be772,_0x43973f);else{_0x43973f[_0x4edc0f(0x9e)]??=nullableText(_0x1591ed[_0x4edc0f(0x9e)]),_0x43973f[_0x4edc0f(0xaf)]??=nullableText(_0x1591ed[_0x4edc0f(0xa9)]);if(_0x178183==='ACTIVE')_0x43973f['status']=_0x4edc0f(0xbe);}const _0x1f17f3=_0x675067['id']+':'+_0x178183;if(_0x43973f['roleKeys'][_0x4edc0f(0x97)](_0x1f17f3))continue;_0x43973f[_0x4edc0f(0xb9)]['add'](_0x1f17f3),_0x43973f['roles']['push']({'roleId':_0x675067['id'],'roleCode':_0x675067[_0x4edc0f(0xb1)],'roleName':nullableText(_0x675067['roleName']),'roleType':nullableText(_0x675067[_0x4edc0f(0xab)]),'membershipStatus':_0x178183});}};for(const _0x5ab723 of _0x284114){_0x361e4f(_0x5ab723,_0x5ab723[_0x8a7598(0xa8)]??[],_0x8a7598(0xbe)),_0x361e4f(_0x5ab723,_0x5ab723['applyUserList']??[],_0x8a7598(0xb3));}return[..._0x18b1b7[_0x8a7598(0xbb)]()][_0x8a7598(0xc3)](_0x2262dd=>({'userId':_0x2262dd[_0x8a7598(0xc1)],'username':_0x2262dd['username'],'displayName':_0x2262dd[_0x8a7598(0xaf)],'status':_0x2262dd['status'],'roles':_0x2262dd[_0x8a7598(0xa4)][_0x8a7598(0xb4)]((_0x591302,_0x318c00)=>_0x591302[_0x8a7598(0xa5)]-_0x318c00[_0x8a7598(0xa5)]||(_0x591302['membershipStatus']===_0x318c00[_0x8a7598(0x96)]?0x0:_0x591302[_0x8a7598(0x96)]===_0x8a7598(0xbe)?-0x1:0x1))}))['sort']((_0x435c53,_0x4cca3a)=>_0x435c53[_0x8a7598(0xc1)]-_0x4cca3a[_0x8a7598(0xc1)]);}export function enrichAppListItemsWithMergedSelection(_0x4d283c,_0x42e925){const _0x22812e=a29_0x4d4b;if(!_0x42e925)return;const _0x3a4839=_0x42e925[_0x22812e(0x9b)]&&typeof _0x42e925[_0x22812e(0x9b)]===_0x22812e(0xb8)?_0x42e925[_0x22812e(0x9b)]:{},_0xb98c8d=Object[_0x22812e(0xc2)](_0x3a4839)[_0x22812e(0x9d)]>0x0;for(const _0x19b804 of _0x4d283c){_0x19b804['isCurrent']=![];}const _0x489a17=_0x42e925[_0x22812e(0xaa)]!=null?String(_0x42e925[_0x22812e(0xaa)])[_0x22812e(0xc0)]():'';if(_0xb98c8d){const _0x1e66a9=_0x42e925[_0x22812e(0xa3)]??_0x42e925[_0x22812e(0xb2)];if(_0x1e66a9)for(const _0x9542d9 of _0x4d283c){_0x9542d9[_0x22812e(0xbf)]===!![]&&_0x9542d9['name']===_0x1e66a9&&(_0x9542d9[_0x22812e(0xa1)]=!![]);}for(const _0x52fd75 of _0x4d283c){if(_0x52fd75['named']!==![])continue;if(_0x42e925['defaultApp'])continue;_0x489a17&&String(_0x52fd75[_0x22812e(0x98)]??'')[_0x22812e(0xc0)]()===_0x489a17&&(_0x52fd75[_0x22812e(0xa1)]=!![]);}return;}if(!_0x489a17)return;for(const _0x2ae148 of _0x4d283c){String(_0x2ae148[_0x22812e(0x98)]??'')['trim']()===_0x489a17&&(_0x2ae148[_0x22812e(0xa1)]=!![]);}}function a29_0x4d4b(_0x595e25,_0x190734){_0x595e25=_0x595e25-0x96;const _0x6fe845=a29_0x6fe8();let _0x4d4be1=_0x6fe845[_0x595e25];return _0x4d4be1;}export function resolveAppScopeForWrite(_0x3975f8,_0x4abcc8,_0x31da51){const _0xee5f92=a29_0x4d4b;if(_0x4abcc8)return _0xee5f92(0xb6);const _0x5db555=_0x31da51[_0xee5f92(0x99)][_0xee5f92(0x9b)]&&typeof _0x31da51[_0xee5f92(0x99)][_0xee5f92(0x9b)]===_0xee5f92(0xb8)?_0x31da51[_0xee5f92(0x99)]['apps']:{},_0x40d157=_0x31da51[_0xee5f92(0xbd)][_0xee5f92(0x9b)]&&typeof _0x31da51[_0xee5f92(0xbd)][_0xee5f92(0x9b)]==='object'?_0x31da51['globalConfig']['apps']:{};if(Object[_0xee5f92(0xa6)][_0xee5f92(0x9f)][_0xee5f92(0xbc)](_0x5db555,_0x3975f8))return _0xee5f92(0xac);if(Object['prototype'][_0xee5f92(0x9f)]['call'](_0x40d157,_0x3975f8))return'global';return _0xee5f92(0xac);}export function appDefinedIn(_0xe1c754,_0x1a27a3,_0x5e09b8){const _0x599ba9=a29_0x4d4b,_0x282ec2=Object[_0x599ba9(0xa6)]['hasOwnProperty'][_0x599ba9(0xbc)](_0x1a27a3,_0xe1c754),_0x128305=Object[_0x599ba9(0xa6)][_0x599ba9(0x9f)]['call'](_0x5e09b8,_0xe1c754);if(_0x282ec2&&_0x128305)return _0x599ba9(0x9a);if(_0x128305)return _0x599ba9(0xac);return _0x599ba9(0xb6);}export function resolveDefaultAppSource(_0x59d9b3){const _0x5aca75=a29_0x4d4b,_0x4a0e71=_0x59d9b3[_0x5aca75(0x99)]['apps']&&typeof _0x59d9b3['projectConfig'][_0x5aca75(0x9b)]===_0x5aca75(0xb8)?_0x59d9b3['projectConfig'][_0x5aca75(0x9b)]:{};if(_0x5aca75(0xb2)in _0x59d9b3[_0x5aca75(0x99)])return'project';if(Object['keys'](_0x4a0e71)[_0x5aca75(0x9d)]>0x0)return _0x5aca75(0xac);if(Object[_0x5aca75(0xc2)](_0x59d9b3[_0x5aca75(0x99)])[_0x5aca75(0x9d)]===0x0&&_0x59d9b3['globalConfig'][_0x5aca75(0xb2)])return _0x5aca75(0xb6);return null;}function a29_0x6fe8(){const _0x19c974=['apps','310718cNuuJS','length','username','hasOwnProperty','\x20(global)','isCurrent','1650624aSiioT','currentApp','roles','roleId','prototype','406647PZpxCa','userList','nickname','appCode','roleType','project','1727298GUqxnj','420yAOBOu','displayName','676590ErshDB','roleCode','defaultApp','PENDING','sort','31192eseZyV','global','isFinite','object','roleKeys','353934kfvJvW','values','call','globalConfig','ACTIVE','named','trim','userId','keys','map','membershipStatus','has','appcode','projectConfig','both'];a29_0x6fe8=function(){return _0x19c974;};return a29_0x6fe8();}export function getConfigPath(_0x3b8dae={}){const _0x5827ae=a29_0x4d4b,_0x1a1a11=_0x3b8dae[_0x5827ae(0xb6)]?_0x5827ae(0xb6):_0x5827ae(0xac);return resolveWriteConfigPath(_0x1a1a11);}export function readConfig(_0x26e2f3={}){return readConfigFile(getConfigPath(_0x26e2f3));}export function writeConfig(_0x16b1a9,_0x460ff0={}){writeConfigFile(getConfigPath(_0x460ff0),_0x16b1a9);}export function scopeLabel(_0x524d4a){const _0x3f533a=a29_0x4d4b;return _0x524d4a[_0x3f533a(0xb6)]?_0x3f533a(0xa0):'';}
1
+ import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from"../../context.js";function nullableText(value){const normalized=value?.trim();return normalized?normalized:null}export function projectAppMembers(groups){const members=new Map;const sortedGroups=[...groups].sort((left,right)=>left.id-right.id);const addUsers=(group,users,membershipStatus)=>{for(const user of users){const userId=Number(user.userId);if(!Number.isFinite(userId)||userId<=0)continue;let member=members.get(userId);if(!member){member={userId:userId,username:nullableText(user.username),displayName:nullableText(user.nickname),status:membershipStatus,roles:[],roleKeys:new Set};members.set(userId,member)}else{member.username??=nullableText(user.username);member.displayName??=nullableText(user.nickname);if(membershipStatus==="ACTIVE")member.status="ACTIVE"}const roleKey=`${group.id}:${membershipStatus}`;if(member.roleKeys.has(roleKey))continue;member.roleKeys.add(roleKey);member.roles.push({roleId:group.id,
2
+ roleCode:group.roleCode,roleName:nullableText(group.roleName),roleType:nullableText(group.roleType),membershipStatus:membershipStatus})}};for(const group of sortedGroups){addUsers(group,group.userList??[],"ACTIVE");addUsers(group,group.applyUserList??[],"PENDING")}return[...members.values()].map(member=>({userId:member.userId,username:member.username,displayName:member.displayName,status:member.status,roles:member.roles.sort((left,right)=>left.roleId-right.roleId||(left.membershipStatus===right.membershipStatus?0:left.membershipStatus==="ACTIVE"?-1:1))})).sort((left,right)=>left.userId-right.userId)}export function enrichAppListItemsWithMergedSelection(items,merged){if(!merged)return;const apps=merged.apps&&typeof merged.apps==="object"?merged.apps:{};const isMultiApp=Object.keys(apps).length>0;for(const item of items){item.isCurrent=false}const appCodeStr=merged.appCode!=null?String(merged.appCode).trim():"";if(isMultiApp){const eff=merged.currentApp??merged.defaultApp;if(eff){
3
+ for(const item of items){if(item.named===true&&item.name===eff){item.isCurrent=true}}}for(const item of items){if(item.named!==false)continue;if(merged.defaultApp)continue;if(appCodeStr&&String(item.appcode??"").trim()===appCodeStr){item.isCurrent=true}}return}if(!appCodeStr)return;for(const item of items){if(String(item.appcode??"").trim()===appCodeStr){item.isCurrent=true}}}export function resolveAppScopeForWrite(name,explicitGlobal,layers){if(explicitGlobal)return"global";const projectApps=layers.projectConfig.apps&&typeof layers.projectConfig.apps==="object"?layers.projectConfig.apps:{};const globalApps=layers.globalConfig.apps&&typeof layers.globalConfig.apps==="object"?layers.globalConfig.apps:{};if(Object.prototype.hasOwnProperty.call(projectApps,name))return"project";if(Object.prototype.hasOwnProperty.call(globalApps,name))return"global";return"project"}export function appDefinedIn(name,globalApps,projectApps){const g=Object.prototype.hasOwnProperty.call(globalApps,name)
4
+ ;const p=Object.prototype.hasOwnProperty.call(projectApps,name);if(g&&p)return"both";if(p)return"project";return"global"}export function resolveDefaultAppSource(layers){const projectApps=layers.projectConfig.apps&&typeof layers.projectConfig.apps==="object"?layers.projectConfig.apps:{};if("defaultApp"in layers.projectConfig)return"project";if(Object.keys(projectApps).length>0)return"project";if(Object.keys(layers.projectConfig).length===0&&layers.globalConfig.defaultApp)return"global";return null}export function getConfigPath(flags={}){const scope=flags.global?"global":"project";return resolveWriteConfigPath(scope)}export function readConfig(flags={}){return readConfigFile(getConfigPath(flags))}export function writeConfig(config,flags={}){writeConfigFile(getConfigPath(flags),config)}export function scopeLabel(flags){return flags.global?" (global)":""}
@@ -1 +1,2 @@
1
- function a30_0x57b4(){const _0x420749=['high-risk-write','507700ULQqqR','1461084EvEHcy','appCode:\x20','get','number','5tmihjC','2fHQtCr','/smartapi/app-config/delete','1692QMUTmo','validation','10302457cneTeD','7798KBywdj','delete','POST','6896025OKnAgD','apiError','86730txysdF','391312xjYrMK','App\x20config\x20key\x20not\x20found:\x20','20BONaRG','Deleted\x20app\x20config\x20','app-config','App\x20config\x20server\x20id\x20missing\x20for\x20key=','appCode','isFinite','Delete\x20one\x20runtime\x20app-config\x20key',',\x20appCode='];a30_0x57b4=function(){return _0x420749;};return a30_0x57b4();}const a30_0x43330b=a30_0x4c12;(function(_0x226219,_0x13d495){const _0x8cfcc2=a30_0x4c12,_0x4b12b5=_0x226219();while(!![]){try{const _0x97cf12=-parseInt(_0x8cfcc2(0x196))/0x1+parseInt(_0x8cfcc2(0x1a8))/0x2*(-parseInt(_0x8cfcc2(0x1a3))/0x3)+-parseInt(_0x8cfcc2(0x1a2))/0x4*(-parseInt(_0x8cfcc2(0x1a7))/0x5)+-parseInt(_0x8cfcc2(0x18e))/0x6*(parseInt(_0x8cfcc2(0x191))/0x7)+parseInt(_0x8cfcc2(0x197))/0x8+-parseInt(_0x8cfcc2(0x194))/0x9+-parseInt(_0x8cfcc2(0x199))/0xa*(-parseInt(_0x8cfcc2(0x190))/0xb);if(_0x97cf12===_0x13d495)break;else _0x4b12b5['push'](_0x4b12b5['shift']());}catch(_0x1a9726){_0x4b12b5['push'](_0x4b12b5['shift']());}}}(a30_0x57b4,0x60682));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a30_0x43330b(0x1a9);function a30_0x4c12(_0x3c081a,_0x4c2924){_0x3c081a=_0x3c081a-0x18e;const _0x57b486=a30_0x57b4();let _0x4c1238=_0x57b486[_0x3c081a];return _0x4c1238;}export const appConfigDelete={'service':a30_0x43330b(0x19b),'command':a30_0x43330b(0x192),'description':a30_0x43330b(0x19f),'risk':a30_0x43330b(0x1a1),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x533f37){readKeyArg(_0x533f37);},async 'dryRun'(_0xc07ab9){const _0x2b7ade=a30_0x43330b,_0x418e92=readKeyArg(_0xc07ab9),_0x31242e=await mustGetByKey(_0xc07ab9['appCode'],_0x418e92);return asAppConfigDryRunResult(buildMutationData({'operation':_0x2b7ade(0x192),'appCode':_0xc07ab9[_0x2b7ade(0x19d)],'key':_0x418e92,'before':projectAppConfig(_0x31242e),'after':null,'dryRun':!![]}),{'method':_0x2b7ade(0x193),'url':DELETE_PATH});},async 'execute'(_0x102f5d){const _0x2753b3=a30_0x43330b,_0x106deb=readKeyArg(_0x102f5d),_0x3633a3=await mustGetByKey(_0x102f5d[_0x2753b3(0x19d)],_0x106deb);return await withAppConfigApiBoundary(_0x2753b3(0x192),{'appCode':_0x102f5d[_0x2753b3(0x19d)],'key':_0x106deb},()=>deleteAppConfig({'appCode':_0x102f5d[_0x2753b3(0x19d)],'id':requireAppConfigId(_0x3633a3,_0x106deb,_0x102f5d[_0x2753b3(0x19d)])})),{'ok':!![],'data':buildMutationData({'operation':_0x2753b3(0x192),'appCode':_0x102f5d[_0x2753b3(0x19d)],'key':_0x106deb,'before':projectAppConfig(_0x3633a3),'after':null,'dryRun':![]}),'message':_0x2753b3(0x19a)+_0x106deb};}};async function mustGetByKey(_0x55de9d,_0x298431){const _0x5e4f7e=a30_0x43330b,_0x210e07=await withAppConfigApiBoundary(_0x5e4f7e(0x1a5),{'appCode':_0x55de9d,'key':_0x298431},()=>getAppConfigByKey(_0x55de9d,_0x298431));if(!_0x210e07)throw CliErrors[_0x5e4f7e(0x18f)](_0x5e4f7e(0x198)+_0x298431,_0x5e4f7e(0x1a4)+_0x55de9d);return _0x210e07;}function requireAppConfigId(_0xc99484,_0x2f22ba,_0x599899){const _0x290cc7=a30_0x43330b;if(typeof _0xc99484['id']===_0x290cc7(0x1a6)&&Number[_0x290cc7(0x19e)](_0xc99484['id'])&&_0xc99484['id']>0x0)return _0xc99484['id'];throw CliErrors[_0x290cc7(0x195)](_0x290cc7(0x19c)+_0x2f22ba+_0x290cc7(0x1a0)+_0x599899);}
1
+ import{deleteAppConfig,getAppConfigByKey}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,requireAppConfigId,readKeyArg,withAppConfigApiBoundary}from"../../commands/app-config/shared.js";const DELETE_PATH="/smartapi/app-config/delete";export const appConfigDelete={service:"app-config",command:"delete",description:"Delete one runtime app-config key",risk:"high-risk-write",args:[KEY_ARG],flags:[APPCODE_FLAG_OPTIONAL],async validate(ctx){readKeyArg(ctx)},async dryRun(ctx){const key=readKeyArg(ctx);const before=await mustGetByKey(ctx.appCode,key);requireAppConfigId(before);return asAppConfigDryRunResult(buildMutationData({operation:"delete",appCode:ctx.appCode,key:key,before:projectAppConfig(before),after:null,dryRun:true}),{method:"POST",url:DELETE_PATH})},async execute(ctx){const key=readKeyArg(ctx)
2
+ ;const before=await mustGetByKey(ctx.appCode,key);await withAppConfigApiBoundary("delete",{appCode:ctx.appCode,key:key},()=>deleteAppConfig({appCode:ctx.appCode,id:requireAppConfigId(before)}));return{ok:true,data:buildMutationData({operation:"delete",appCode:ctx.appCode,key:key,before:projectAppConfig(before),after:null,dryRun:false}),message:`Deleted app config ${key}`}}};async function mustGetByKey(appCode,key){const item=await withAppConfigApiBoundary("get",{appCode:appCode,key:key},()=>getAppConfigByKey(appCode,key));if(!item){throw CliErrors.validation(`App config key not found: ${key}`,`appCode: ${appCode}`)}return item}
@@ -1 +1,2 @@
1
- const a31_0x38c0e7=a31_0x3ab7;function a31_0x3ab7(_0x2d41bd,_0x3fdddb){_0x2d41bd=_0x2d41bd-0x9b;const _0x325e67=a31_0x325e();let _0x3ab7f0=_0x325e67[_0x2d41bd];return _0x3ab7f0;}(function(_0x131f9a,_0x1d252f){const _0x290864=a31_0x3ab7,_0x282177=_0x131f9a();while(!![]){try{const _0x141959=parseInt(_0x290864(0xaf))/0x1*(parseInt(_0x290864(0xad))/0x2)+parseInt(_0x290864(0xac))/0x3*(-parseInt(_0x290864(0xa3))/0x4)+parseInt(_0x290864(0xa6))/0x5*(parseInt(_0x290864(0xa8))/0x6)+-parseInt(_0x290864(0x9b))/0x7+-parseInt(_0x290864(0x9d))/0x8+parseInt(_0x290864(0x9e))/0x9+parseInt(_0x290864(0xaa))/0xa;if(_0x141959===_0x1d252f)break;else _0x282177['push'](_0x282177['shift']());}catch(_0x247423){_0x282177['push'](_0x282177['shift']());}}}(a31_0x325e,0x70bd9));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a31_0x38c0e7(0x9c),'command':'get','description':a31_0x38c0e7(0xa4),'risk':a31_0x38c0e7(0xa2),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x1e7b27){readKeyArg(_0x1e7b27);},async 'execute'(_0x3783aa){const _0x1de215=a31_0x38c0e7,_0x1bedfb=readKeyArg(_0x3783aa),_0x381308=await withAppConfigApiBoundary('get',{'appCode':_0x3783aa[_0x1de215(0xab)],'key':_0x1bedfb},()=>getAppConfigByKey(_0x3783aa[_0x1de215(0xab)],_0x1bedfb));if(!_0x381308)throw CliErrors[_0x1de215(0xa9)](_0x1de215(0xae)+_0x1bedfb,'appCode:\x20'+_0x3783aa[_0x1de215(0xab)]);const _0x24fc8c=projectAppConfig(_0x381308,{'reveal':_0x3783aa[_0x1de215(0xa7)](_0x1de215(0x9f))});return{'ok':!![],'data':{'config':_0x24fc8c},'message':_0x3783aa[_0x1de215(0xa7)](_0x1de215(0x9f))?_0x1de215(0xa5)+_0x1bedfb+_0x1de215(0xa1):_0x1de215(0xa5)+_0x1bedfb+_0x1de215(0xa0)};}};function a31_0x325e(){const _0x1b7299=['233486LWZMcA','App\x20config\x20key\x20not\x20found:\x20','1nNUbOs','5596444gylGFS','app-config','3554992zLMCYK','5178537BUJkmR','reveal','\x20with\x20value\x20redacted','\x20with\x20value\x20revealed','read','2636iHcnTq','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','Loaded\x20app\x20config\x20','1144465AevIdE','bool','6qLhyUc','validation','9408050kxSUpF','appCode','711YgQaWo'];a31_0x325e=function(){return _0x1b7299;};return a31_0x325e();}
1
+ import{getAppConfigByKey}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from"../../commands/app-config/shared.js";export const appConfigGet={service:"app-config",command:"get",description:"Inspect one runtime app-config key; value is redacted unless --reveal is used",risk:"read",args:[KEY_ARG],flags:[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async validate(ctx){readKeyArg(ctx)},async execute(ctx){const key=readKeyArg(ctx);const item=await withAppConfigApiBoundary("get",{appCode:ctx.appCode,key:key},()=>getAppConfigByKey(ctx.appCode,key));if(!item){throw CliErrors.validation(`App config key not found: ${key}`,`appCode: ${ctx.appCode}`)}const config=projectAppConfig(item,{reveal:ctx.bool("reveal")});return{ok:true,data:{config:config},
2
+ message:ctx.bool("reveal")?`Loaded app config ${key} with value revealed`:`Loaded app config ${key} with value redacted`}}};
@@ -1 +1 @@
1
- (function(_0x4bae08,_0x8b4f1f){const _0x1fbef1=a32_0x590f,_0x8c6b79=_0x4bae08();while(!![]){try{const _0x224377=parseInt(_0x1fbef1(0x154))/0x1+parseInt(_0x1fbef1(0x158))/0x2*(-parseInt(_0x1fbef1(0x157))/0x3)+-parseInt(_0x1fbef1(0x151))/0x4+-parseInt(_0x1fbef1(0x159))/0x5+parseInt(_0x1fbef1(0x155))/0x6*(-parseInt(_0x1fbef1(0x156))/0x7)+parseInt(_0x1fbef1(0x153))/0x8*(parseInt(_0x1fbef1(0x152))/0x9)+parseInt(_0x1fbef1(0x150))/0xa;if(_0x224377===_0x8b4f1f)break;else _0x8c6b79['push'](_0x8c6b79['shift']());}catch(_0x232208){_0x8c6b79['push'](_0x8c6b79['shift']());}}}(a32_0x20cf,0xa5e06));function a32_0x20cf(){const _0x77c005=['4314yAKxvF','7175JTfyEY','21hhkOKM','136BeBQjR','2790865gQDVtt','887400vyvovy','1882388wPLvti','9578916jGCvci','8qstaAj','1292587ZNBkFE'];a32_0x20cf=function(){return _0x77c005;};return a32_0x20cf();}import{appConfigList}from'../../commands/app-config/list.js';function a32_0x590f(_0x35ffc5,_0x5e9b37){_0x35ffc5=_0x35ffc5-0x150;const _0x20cf6d=a32_0x20cf();let _0x590fae=_0x20cf6d[_0x35ffc5];return _0x590fae;}import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
1
+ import{appConfigList}from"../../commands/app-config/list.js";import{appConfigGet}from"../../commands/app-config/get.js";import{appConfigSet}from"../../commands/app-config/set.js";import{appConfigDelete}from"../../commands/app-config/delete.js";export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
@@ -1 +1,2 @@
1
- const a33_0x116e29=a33_0x3234;function a33_0x3234(_0x512763,_0x49062f){_0x512763=_0x512763-0x95;const _0x1c4b4c=a33_0x1c4b();let _0x32345a=_0x1c4b4c[_0x512763];return _0x32345a;}function a33_0x1c4b(){const _0x2696d8=['19618BbGFuM','669264mUqdeG','35IddcGi','appCode','46936CTnryL','8067720vgfYfQ','369DmpthJ','1878366LraiRU','key','list','Found\x20','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','app-config','str','length','17uJFEIS','86932jiCNwH','trim','read','457890lRPonk'];a33_0x1c4b=function(){return _0x2696d8;};return a33_0x1c4b();}(function(_0x19107f,_0x37bc77){const _0x414aa3=a33_0x3234,_0x2a597c=_0x19107f();while(!![]){try{const _0x2d1840=parseInt(_0x414aa3(0x97))/0x1*(parseInt(_0x414aa3(0x9c))/0x2)+-parseInt(_0x414aa3(0x9d))/0x3+-parseInt(_0x414aa3(0x98))/0x4*(parseInt(_0x414aa3(0x9e))/0x5)+parseInt(_0x414aa3(0x9b))/0x6+-parseInt(_0x414aa3(0xa3))/0x7+-parseInt(_0x414aa3(0xa0))/0x8*(parseInt(_0x414aa3(0xa2))/0x9)+parseInt(_0x414aa3(0xa1))/0xa;if(_0x2d1840===_0x37bc77)break;else _0x2a597c['push'](_0x2a597c['shift']());}catch(_0x149477){_0x2a597c['push'](_0x2a597c['shift']());}}}(a33_0x1c4b,0x28768));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a33_0x116e29(0xa8),'command':a33_0x116e29(0xa5),'description':a33_0x116e29(0xa7),'risk':a33_0x116e29(0x9a),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':'string','description':'Filter\x20by\x20exact\x20config\x20key'},TAGS_FLAG],async 'validate'(_0x21f1f8){const _0x50b247=a33_0x116e29,_0x592d73=_0x21f1f8[_0x50b247(0x95)](_0x50b247(0xa4))[_0x50b247(0x99)]();if(_0x592d73)validateKey(_0x592d73);readOptionalTags(_0x21f1f8);},async 'execute'(_0x4e78e2){const _0x1d107c=a33_0x116e29,_0x484e73=_0x4e78e2[_0x1d107c(0x95)](_0x1d107c(0xa4))['trim']()||undefined,_0x44c799=readOptionalTags(_0x4e78e2),_0x2cd9b7=await withAppConfigApiBoundary(_0x1d107c(0xa5),{'appCode':_0x4e78e2[_0x1d107c(0x9f)]},()=>listAppConfigs(_0x4e78e2[_0x1d107c(0x9f)],{'key':_0x484e73,'tags':_0x44c799})),_0x4ce469=_0x2cd9b7['map'](_0x419969=>projectAppConfig(_0x419969));return{'ok':!![],'data':{'appCode':_0x4e78e2['appCode'],'count':_0x4ce469['length'],'configs':_0x4ce469},'message':_0x1d107c(0xa6)+_0x4ce469[_0x1d107c(0x96)]+'\x20app\x20config(s)'};}};
1
+ import{listAppConfigs}from"../../core/api-client.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from"../../commands/app-config/shared.js";export const appConfigList={service:"app-config",command:"list",description:"List runtime app-config key metadata without printing values",risk:"read",flags:[APPCODE_FLAG_OPTIONAL,{name:"key",type:"string",description:"Filter by exact config key"},TAGS_FLAG],async validate(ctx){const key=ctx.str("key").trim();if(key)validateKey(key);readOptionalTags(ctx)},async execute(ctx){const key=ctx.str("key").trim()||undefined;const tags=readOptionalTags(ctx);const items=await withAppConfigApiBoundary("list",{appCode:ctx.appCode},()=>listAppConfigs(ctx.appCode,{key:key,tags:tags}));const configs=items.map(item=>projectAppConfig(item));return{ok:true,data:{appCode:ctx.appCode,count:configs.length,configs:configs},
2
+ message:`Found ${configs.length} app config(s)`}}};
@@ -1 +1,3 @@
1
- const a34_0x1dd3b4=a34_0x5be1;(function(_0x81e607,_0x1b24fc){const _0x42ca16=a34_0x5be1,_0x1bd83a=_0x81e607();while(!![]){try{const _0x11d027=parseInt(_0x42ca16(0x14a))/0x1*(parseInt(_0x42ca16(0x15f))/0x2)+parseInt(_0x42ca16(0x15a))/0x3+parseInt(_0x42ca16(0x156))/0x4+parseInt(_0x42ca16(0x15d))/0x5*(parseInt(_0x42ca16(0x161))/0x6)+-parseInt(_0x42ca16(0x157))/0x7+parseInt(_0x42ca16(0x165))/0x8*(parseInt(_0x42ca16(0x14e))/0x9)+parseInt(_0x42ca16(0x155))/0xa*(-parseInt(_0x42ca16(0x153))/0xb);if(_0x11d027===_0x1b24fc)break;else _0x1bd83a['push'](_0x1bd83a['shift']());}catch(_0xbd69af){_0x1bd83a['push'](_0x1bd83a['shift']());}}}(a34_0x10b5,0xc0ced));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x1dd3b4(0x163),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a34_0x1dd3b4(0x14d),'command':a34_0x1dd3b4(0x158),'description':a34_0x1dd3b4(0x15c),'risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x1dd3b4(0x149),'type':a34_0x1dd3b4(0x150),'description':a34_0x1dd3b4(0x154)}],async 'validate'(_0x1c3637){readKeyArg(_0x1c3637),readOptionalTags(_0x1c3637),assertSingleValueSource(_0x1c3637);},async 'dryRun'(_0x57a9b4){const _0xb7f527=a34_0x1dd3b4,_0x10c1e0=readKeyArg(_0x57a9b4),_0x11f9e5=readOptionalTags(_0x57a9b4),_0x3fcf98=assertSingleValueSource(_0x57a9b4);await assertValueSourceReadable(_0x3fcf98);const _0x5c8889=await withAppConfigApiBoundary(_0xb7f527(0x14c),{'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0},()=>getAppConfigByKey(_0x57a9b4[_0xb7f527(0x151)],_0x10c1e0)),_0x353a70=_0x5c8889?_0xb7f527(0x164):'create',_0x583a03=_0x5c8889?projectAppConfig(_0x5c8889):null,_0x3bf860=plannedAppConfig({'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0,'tags':_0x11f9e5??_0x5c8889?.[_0xb7f527(0x15e)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x353a70,'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0,'before':_0x583a03,'after':_0x3bf860,'dryRun':!![]}),{'method':_0xb7f527(0x152),'url':_0x353a70===_0xb7f527(0x164)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x44d598){const _0x184116=a34_0x1dd3b4,_0x1c39b2=readKeyArg(_0x44d598),_0x59eb0e=readOptionalTags(_0x44d598),_0x2bd417=await withAppConfigApiBoundary(_0x184116(0x14c),{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},()=>getAppConfigByKey(_0x44d598['appCode'],_0x1c39b2)),_0x416e96=_0x2bd417?projectAppConfig(_0x2bd417):null,_0x674983=_0x2bd417?_0x184116(0x164):_0x184116(0x14b),{value:_0x173ff7,warnings:_0x402862}=await readAppConfigValue(_0x44d598),_0x2c96d7={'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2,'value':_0x173ff7,'tags':_0x59eb0e??_0x2bd417?.[_0x184116(0x15e)]??undefined};await withAppConfigApiBoundary(_0x674983,{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},async()=>{const _0xa2dfac=_0x184116;_0x2bd417?await updateAppConfig({..._0x2c96d7,'id':requireAppConfigId(_0x2bd417,_0x1c39b2,_0x44d598[_0xa2dfac(0x151)])}):await createAppConfig(_0x2c96d7);});const _0x10e935=await withAppConfigApiBoundary('get',{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},()=>getAppConfigByKey(_0x44d598[_0x184116(0x151)],_0x1c39b2)),_0x472cac=_0x10e935?projectAppConfig(_0x10e935):plannedAppConfig({'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2,'tags':_0x2c96d7['tags'],'hasValue':_0x173ff7!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x674983,'appCode':_0x44d598['appCode'],'key':_0x1c39b2,'before':_0x416e96,'after':_0x472cac,'dryRun':![],'warnings':_0x402862}),'message':(_0x674983==='update'?_0x184116(0x160):_0x184116(0x162))+_0x184116(0x159)+_0x1c39b2};}};function requireAppConfigId(_0x3ddbaa,_0x497b08,_0x106e4c){const _0x28698f=a34_0x1dd3b4;if(typeof _0x3ddbaa['id']==='number'&&Number['isFinite'](_0x3ddbaa['id'])&&_0x3ddbaa['id']>0x0)return _0x3ddbaa['id'];throw CliErrors[_0x28698f(0x15b)](_0x28698f(0x14f)+_0x497b08+_0x28698f(0x148)+_0x106e4c);}function a34_0x5be1(_0x12c8d0,_0x3647fb){_0x12c8d0=_0x12c8d0-0x148;const _0x10b5e5=a34_0x10b5();let _0x5be1e8=_0x10b5e5[_0x12c8d0];return _0x5be1e8;}function a34_0x10b5(){const _0x2a2e86=['/smartapi/app-config/create','update','1632208bXXKLU',',\x20appCode=','file','2RCWdHn','create','get','app-config','36nJyBCa','App\x20config\x20server\x20id\x20missing\x20for\x20key=','string','appCode','POST','14696BQRlMC','Read\x20config\x20value\x20from\x20file','16840mxNmdf','1571112geLNJk','2474486sxFnaA','set','\x20app\x20config\x20','2119449RdLVyJ','apiError','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','190uIHfzw','tags','592564jTYXkC','Updated','139758fyytpC','Created'];a34_0x10b5=function(){return _0x2a2e86;};return a34_0x10b5();}
1
+ import{createAppConfig,getAppConfigByKey,updateAppConfig}from"../../core/api-client.js";import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,requireAppConfigId,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from"../../commands/app-config/shared.js";const CREATE_PATH="/smartapi/app-config/create";const UPDATE_PATH="/smartapi/app-config/update";export const appConfigSet={service:"app-config",command:"set",description:"Create or update one runtime app-config key",risk:"write",args:[KEY_ARG,VALUE_ARG],flags:[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{name:"file",type:"string",description:"Read config value from file"}],async validate(ctx){readKeyArg(ctx);readOptionalTags(ctx);assertSingleValueSource(ctx)},async dryRun(ctx){const key=readKeyArg(ctx)
2
+ ;const tags=readOptionalTags(ctx);const source=assertSingleValueSource(ctx);await assertValueSourceReadable(source);const before=await withAppConfigApiBoundary("get",{appCode:ctx.appCode,key:key},()=>getAppConfigByKey(ctx.appCode,key));if(before)requireAppConfigId(before);const operation=before?"update":"create";const beforeProjection=before?projectAppConfig(before):null;const afterProjection=plannedAppConfig({appCode:ctx.appCode,key:key,tags:tags??before?.tags,hasValue:true});return asAppConfigDryRunResult(buildMutationData({operation:operation,appCode:ctx.appCode,key:key,before:beforeProjection,after:afterProjection,dryRun:true}),{method:"POST",url:operation==="update"?UPDATE_PATH:CREATE_PATH})},async execute(ctx){const key=readKeyArg(ctx);const tags=readOptionalTags(ctx);const before=await withAppConfigApiBoundary("get",{appCode:ctx.appCode,key:key},()=>getAppConfigByKey(ctx.appCode,key));const beforeProjection=before?projectAppConfig(before):null
3
+ ;if(before)requireAppConfigId(before);const operation=before?"update":"create";const{value:value,warnings:warnings}=await readAppConfigValue(ctx);const writeInput={appCode:ctx.appCode,key:key,value:value,tags:tags??before?.tags??undefined};await withAppConfigApiBoundary(operation,{appCode:ctx.appCode,key:key},async()=>{if(before){await updateAppConfig({...writeInput,id:requireAppConfigId(before)})}else{await createAppConfig(writeInput)}});const after=await withAppConfigApiBoundary("get",{appCode:ctx.appCode,key:key},()=>getAppConfigByKey(ctx.appCode,key));const afterProjection=after?projectAppConfig(after):plannedAppConfig({appCode:ctx.appCode,key:key,tags:writeInput.tags,hasValue:value!==""});return{ok:true,data:buildMutationData({operation:operation,appCode:ctx.appCode,key:key,before:beforeProjection,after:afterProjection,dryRun:false,warnings:warnings}),message:`${operation==="update"?"Updated":"Created"} app config ${key}`}}};
@@ -1,13 +1,18 @@
1
1
  import type { AppConfigItem } from "../../core/api-client.js";
2
2
  import type { CommandDefinition, DryRunResult, RuntimeContext } from "../../framework/types.js";
3
3
  export interface AppConfigProjection {
4
+ id?: number | string;
5
+ description?: string | null;
6
+ operatorId?: number | string | null;
7
+ operatorUsername?: string | null;
8
+ operatorNickname?: string | null;
4
9
  appCode: string;
5
10
  key: string;
6
11
  tags?: string | null;
7
12
  hasValue: boolean;
8
13
  valueRedacted: boolean;
9
- gmtCreate?: string;
10
- gmtModified?: string;
14
+ gmtCreate?: number | null;
15
+ gmtModified?: number | null;
11
16
  value?: string | null;
12
17
  }
13
18
  export interface AppConfigMutationData {
@@ -72,6 +77,8 @@ export declare function validateKey(key: string): void;
72
77
  export declare function projectAppConfig(item: AppConfigItem, options?: {
73
78
  reveal?: boolean;
74
79
  }): AppConfigProjection;
80
+ /** Keep the server ID representation; never round a Long before a write. */
81
+ export declare function requireAppConfigId(item: AppConfigItem): number | string;
75
82
  export declare function plannedAppConfig(params: {
76
83
  appCode: string;
77
84
  key: string;
@@ -1 +1,6 @@
1
- const a35_0x23d9ba=a35_0x2d1d;(function(_0x28bd8f,_0x22e8f9){const _0x5e82fd=a35_0x2d1d,_0x5b009d=_0x28bd8f();while(!![]){try{const _0x2c39f2=-parseInt(_0x5e82fd(0x103))/0x1+parseInt(_0x5e82fd(0xfb))/0x2+parseInt(_0x5e82fd(0x109))/0x3*(-parseInt(_0x5e82fd(0xd1))/0x4)+parseInt(_0x5e82fd(0xc8))/0x5*(-parseInt(_0x5e82fd(0xe8))/0x6)+-parseInt(_0x5e82fd(0xc7))/0x7+parseInt(_0x5e82fd(0xdc))/0x8+parseInt(_0x5e82fd(0xf2))/0x9;if(_0x2c39f2===_0x22e8f9)break;else _0x5b009d['push'](_0x5b009d['shift']());}catch(_0xda4b23){_0x5b009d['push'](_0x5b009d['shift']());}}}(a35_0x385d,0x969ac));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x23d9ba(0xff),'description':a35_0x23d9ba(0xdf),'required':!![]};export const VALUE_ARG={'name':'value','description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};function a35_0x2d1d(_0x5d1bff,_0x247837){_0x5d1bff=_0x5d1bff-0xc7;const _0x385d30=a35_0x385d();let _0x2d1db5=_0x385d30[_0x5d1bff];return _0x2d1db5;}export const TAGS_FLAG={'name':a35_0x23d9ba(0xfa),'type':a35_0x23d9ba(0xd7),'description':a35_0x23d9ba(0xe4)};export const STDIN_FLAG={'name':a35_0x23d9ba(0x108),'type':a35_0x23d9ba(0x102),'description':a35_0x23d9ba(0xf3),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x23d9ba(0xd3),'type':a35_0x23d9ba(0xd7),'description':a35_0x23d9ba(0xce)};export const REVEAL_FLAG={'name':a35_0x23d9ba(0xe1),'type':'boolean','description':a35_0x23d9ba(0xcd),'default':![]};export function readKeyArg(_0x4bbd1b){const _0x3fc71e=a35_0x23d9ba,_0x2d99b5=_0x4bbd1b[_0x3fc71e(0xf6)][0x0]?.['trim']()??'';return validateKey(_0x2d99b5),_0x2d99b5;}export function readOptionalTags(_0x3a8c93){const _0x8a76f1=a35_0x23d9ba,_0x493e55=_0x3a8c93[_0x8a76f1(0xf4)](_0x8a76f1(0xfa))[_0x8a76f1(0xd0)]();if(!_0x493e55)return undefined;if(_0x493e55['length']>0x20)throw CliErrors['validation'](_0x8a76f1(0x107));return _0x493e55;}export function validateKey(_0x4c6da1){const _0x26eaac=a35_0x23d9ba;if(!_0x4c6da1)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x4c6da1[_0x26eaac(0xf1)]>0x100)throw CliErrors[_0x26eaac(0xdb)](_0x26eaac(0xec));}function a35_0x385d(){const _0x257f63=['error','argument','flag','dryRun','length','15952644LBzkSS','Read\x20config\x20value\x20from\x20stdin','str','appCode','args','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Failed\x20to\x20','appCode:\x20','tags','1740960CdExDJ','end','url','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','key','key:\x20','after','boolean','1011953fThMos','utf8','once','push','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','stdin','9mSlzqj','4180995blJiVX','10AugCNo','Value\x20file\x20is\x20not\x20readable:\x20','bool','warnings','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','gmtModified','trim','58540ACIYyh','Environment\x20variable\x20is\x20not\x20set:\x20','from-env','join','name','kind','string','defineProperties','env','operation','validation','3210168VAhTqO','data','hasValue','Runtime\x20app-config\x20key','value','reveal','valueRedacted','App\x20config\x20value\x20source\x20is\x20ambiguous.','Config\x20tags\x20for\x20filtering/display\x20metadata','path','gmtCreate','slice','2322744LoWKgP','before','file','apiError','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.'];a35_0x385d=function(){return _0x257f63;};return a35_0x385d();}export function projectAppConfig(_0x1f527b,_0xd64e4c){const _0x54d43e=a35_0x23d9ba,_0x348b72=_0x1f527b[_0x54d43e(0xe0)]!==undefined&&_0x1f527b[_0x54d43e(0xe0)]!==null&&_0x1f527b[_0x54d43e(0xe0)]!=='',_0x53b082={'appCode':_0x1f527b[_0x54d43e(0xf5)],'key':_0x1f527b['key'],'tags':_0x1f527b[_0x54d43e(0xfa)]??undefined,'hasValue':_0x348b72,'valueRedacted':_0x348b72&&!_0xd64e4c?.[_0x54d43e(0xe1)],'gmtCreate':_0x1f527b[_0x54d43e(0xe6)],'gmtModified':_0x1f527b[_0x54d43e(0xcf)]};return _0xd64e4c?.[_0x54d43e(0xe1)]&&(_0x53b082[_0x54d43e(0xe0)]=_0x1f527b[_0x54d43e(0xe0)]??'',_0x53b082[_0x54d43e(0xe2)]=![]),_0x53b082;}export function plannedAppConfig(_0x2de24e){const _0x36f60b=a35_0x23d9ba,_0x5f540c=_0x2de24e[_0x36f60b(0xde)]??!![];return{'appCode':_0x2de24e[_0x36f60b(0xf5)],'key':_0x2de24e[_0x36f60b(0xff)],'tags':_0x2de24e[_0x36f60b(0xfa)]??undefined,'hasValue':_0x5f540c,'valueRedacted':_0x5f540c};}export function buildMutationData(_0x50d4a5){const _0x13e8f7=a35_0x23d9ba;return{'operation':_0x50d4a5[_0x13e8f7(0xda)],'selector':{'appCode':_0x50d4a5['appCode'],'key':_0x50d4a5[_0x13e8f7(0xff)]},'before':_0x50d4a5[_0x13e8f7(0xe9)],'after':_0x50d4a5[_0x13e8f7(0x101)],'dryRun':_0x50d4a5[_0x13e8f7(0xf0)],'warnings':_0x50d4a5[_0x13e8f7(0xcb)]??[]};}export async function withAppConfigApiBoundary(_0x414478,_0x64fb60,_0x25ad5a){const _0x28e109=a35_0x23d9ba;try{return await _0x25ad5a();}catch{const _0x43b840=[_0x28e109(0xf9)+_0x64fb60[_0x28e109(0xf5)]];if(_0x64fb60[_0x28e109(0xff)])_0x43b840[_0x28e109(0x106)](_0x28e109(0x100)+_0x64fb60[_0x28e109(0xff)]);_0x43b840[_0x28e109(0x106)]('value\x20is\x20redacted');throw CliErrors[_0x28e109(0xeb)](_0x28e109(0xf8)+_0x414478+'\x20app\x20config.',_0x43b840[_0x28e109(0xd4)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x21a1f9,_0x2bb59a){const _0x410d14=a35_0x23d9ba;return Object[_0x410d14(0xd8)](_0x21a1f9,{'method':{'value':_0x2bb59a['method'],'enumerable':![]},'url':{'value':_0x2bb59a[_0x410d14(0xfd)],'enumerable':![]}});}export function assertSingleValueSource(_0x2733fd){const _0x3b0261=a35_0x23d9ba,_0x11cdf7=[];_0x2733fd['args'][_0x3b0261(0xf1)]>0x1&&_0x11cdf7['push']({'kind':_0x3b0261(0xee),'value':_0x2733fd[_0x3b0261(0xf6)][_0x3b0261(0xe7)](0x1)['join']('\x20')});const _0x2687b7=_0x2733fd[_0x3b0261(0xef)](_0x3b0261(0xe0));_0x2687b7!==undefined&&_0x2687b7!==null&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xee),'value':String(_0x2687b7)});_0x2733fd[_0x3b0261(0xca)](_0x3b0261(0x108))&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0x108)});const _0x24a825=_0x2733fd['str'](_0x3b0261(0xd3))['trim']();_0x24a825&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xd9),'name':_0x24a825});const _0x355083=_0x2733fd[_0x3b0261(0xf4)](_0x3b0261(0xea))[_0x3b0261(0xd0)]();_0x355083&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xea),'path':_0x355083});if(_0x11cdf7[_0x3b0261(0xf1)]===0x0)throw CliErrors[_0x3b0261(0xdb)]('Missing\x20app-config\x20value\x20source.',_0x3b0261(0xcc));if(_0x11cdf7[_0x3b0261(0xf1)]>0x1)throw CliErrors[_0x3b0261(0xdb)](_0x3b0261(0xe3),_0x3b0261(0xfe));return _0x11cdf7[0x0];}export async function assertValueSourceReadable(_0x1a4f82){const _0x399b26=a35_0x23d9ba;if(_0x1a4f82[_0x399b26(0xd6)]==='env'&&!(_0x1a4f82[_0x399b26(0xd5)]in process.env))throw CliErrors['validation'](_0x399b26(0xd2)+_0x1a4f82[_0x399b26(0xd5)]);if(_0x1a4f82['kind']===_0x399b26(0xea))try{await access(_0x1a4f82['path']);}catch{throw CliErrors[_0x399b26(0xdb)](_0x399b26(0xc9)+_0x1a4f82[_0x399b26(0xe5)]);}}export async function readAppConfigValue(_0x24d00f){const _0x3aa5e7=a35_0x23d9ba,_0x5e3e26=assertSingleValueSource(_0x24d00f),_0x23d3a8=[];if(_0x5e3e26[_0x3aa5e7(0xd6)]==='argument')return _0x23d3a8['push'](_0x3aa5e7(0xf7)),{'value':_0x5e3e26[_0x3aa5e7(0xe0)]??'','source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};if(_0x5e3e26[_0x3aa5e7(0xd6)]===_0x3aa5e7(0x108))return{'value':await readStdin(),'source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};if(_0x5e3e26[_0x3aa5e7(0xd6)]===_0x3aa5e7(0xd9)){if(!(_0x5e3e26['name']in process.env))throw CliErrors[_0x3aa5e7(0xdb)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x5e3e26[_0x3aa5e7(0xd5)]);return{'value':process.env[_0x5e3e26.name]??'','source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};}return{'value':await readFile(_0x5e3e26[_0x3aa5e7(0xe5)],_0x3aa5e7(0x104)),'source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};}function readStdin(){return new Promise((_0x9ed647,_0x5204ac)=>{const _0x5f5493=a35_0x2d1d;let _0x29725f='';process[_0x5f5493(0x108)]['setEncoding']('utf8'),process[_0x5f5493(0x108)]['on'](_0x5f5493(0xdd),_0x293cea=>{_0x29725f+=_0x293cea;}),process['stdin']['once'](_0x5f5493(0xfc),()=>_0x9ed647(_0x29725f)),process[_0x5f5493(0x108)][_0x5f5493(0x105)](_0x5f5493(0xed),_0x5204ac);});}
1
+ import{access,readFile}from"node:fs/promises";import{CliErrors}from"../../errors.js";export const KEY_ARG={name:"key",description:"Runtime app-config key",required:true};export const VALUE_ARG={name:"value",description:"Sensitive config value. Prefer --stdin, --from-env, or --file for secrets.",required:false};export const TAGS_FLAG={name:"tags",type:"string",description:"Config tags for filtering/display metadata"};export const STDIN_FLAG={name:"stdin",type:"boolean",description:"Read config value from stdin",default:false};export const FROM_ENV_FLAG={name:"from-env",type:"string",description:"Read config value from the named environment variable"};export const REVEAL_FLAG={name:"reveal",type:"boolean",description:"Reveal the sensitive value for this single key",default:false};export function readKeyArg(ctx){const key=ctx.args[0]?.trim()??"";validateKey(key);return key}export function readOptionalTags(ctx){const tags=ctx.str("tags").trim();if(!tags)return undefined;if(tags.length>32){
2
+ throw CliErrors.validation("App config tags length cannot exceed 32.")}return tags}export function validateKey(key){if(!key){throw CliErrors.validation("Missing app-config key.")}if(key.length>256){throw CliErrors.validation("App config key length cannot exceed 256.")}}export function projectAppConfig(item,options){const hasValue=item.value!==undefined&&item.value!==null&&item.value!=="";const projected={id:item.id,description:item.description,operatorId:item.operatorId,operatorUsername:item.operatorUsername,operatorNickname:item.operatorNickname,appCode:item.appCode,key:item.key,tags:item.tags??undefined,hasValue:hasValue,valueRedacted:hasValue&&!options?.reveal,gmtCreate:item.gmtCreate,gmtModified:item.gmtModified};if(options?.reveal){projected.value=item.value??"";projected.valueRedacted=false}return projected}export function requireAppConfigId(item){const id=item.id;if(typeof id==="string"&&/^[1-9][0-9]*$/.test(id))return id
3
+ ;if(typeof id==="number"&&Number.isSafeInteger(id)&&id>0)return id;throw CliErrors.apiError(`App config server id missing or invalid for key=${item.key}, appCode=${item.appCode}`)}export function plannedAppConfig(params){const hasValue=params.hasValue??true;return{appCode:params.appCode,key:params.key,tags:params.tags??undefined,hasValue:hasValue,valueRedacted:hasValue}}export function buildMutationData(params){return{operation:params.operation,selector:{appCode:params.appCode,key:params.key},before:params.before,after:params.after,dryRun:params.dryRun,warnings:params.warnings??[]}}export async function withAppConfigApiBoundary(operation,selector,fn){try{return await fn()}catch{const parts=[`appCode: ${selector.appCode}`];if(selector.key)parts.push(`key: ${selector.key}`);parts.push("value is redacted");throw CliErrors.apiError(`Failed to ${operation} app config.`,`${parts.join("; ")}.`)}}export function asAppConfigDryRunResult(data,backend){return Object.defineProperties(data,{
4
+ method:{value:backend.method,enumerable:false},url:{value:backend.url,enumerable:false}})}export function assertSingleValueSource(ctx){const sources=[];if(ctx.args.length>1){sources.push({kind:"argument",value:ctx.args.slice(1).join(" ")})}const rawValueFlag=ctx.flag("value");if(rawValueFlag!==undefined&&rawValueFlag!==null){sources.push({kind:"argument",value:String(rawValueFlag)})}if(ctx.bool("stdin")){sources.push({kind:"stdin"})}const envName=ctx.str("from-env").trim();if(envName){sources.push({kind:"env",name:envName})}const filePath=ctx.str("file").trim();if(filePath){sources.push({kind:"file",path:filePath})}if(sources.length===0){throw CliErrors.validation("Missing app-config value source.","Use one of: positional <value>, --stdin, --from-env <NAME>, or --file <path>.")}if(sources.length>1){throw CliErrors.validation("App config value source is ambiguous.","Use exactly one of: positional <value>, --stdin, --from-env <NAME>, or --file <path>.")}return sources[0]}
5
+ export async function assertValueSourceReadable(source){if(source.kind==="env"&&!(source.name in process.env)){throw CliErrors.validation(`Environment variable is not set: ${source.name}`)}if(source.kind==="file"){try{await access(source.path)}catch{throw CliErrors.validation(`Value file is not readable: ${source.path}`)}}}export async function readAppConfigValue(ctx){const source=assertSingleValueSource(ctx);const warnings=[];if(source.kind==="argument"){warnings.push("Value was provided as a command argument; prefer --stdin, --from-env, or --file for secrets.");return{value:source.value??"",source:source.kind,warnings:warnings}}if(source.kind==="stdin"){return{value:await readStdin(),source:source.kind,warnings:warnings}}if(source.kind==="env"){if(!(source.name in process.env)){throw CliErrors.validation(`Environment variable is not set: ${source.name}`)}return{value:process.env[source.name]??"",source:source.kind,warnings:warnings}}return{value:await readFile(source.path,"utf8"),
6
+ source:source.kind,warnings:warnings}}function readStdin(){return new Promise((resolve,reject)=>{let data="";process.stdin.setEncoding("utf8");process.stdin.on("data",chunk=>{data+=chunk});process.stdin.once("end",()=>resolve(data));process.stdin.once("error",reject)})}
@@ -1 +1 @@
1
- function a36_0xe6b2(){const _0x53ecfa=['✓\x20Logged\x20out','../../auth/auth-server-ui.js','Login\x20via\x20browser','11847sFWRTx','581BGoaIQ','2399592CoQoaT','21393ITjjed','6590Vgiiku','!\x20Not\x20logged\x20in','4VNijel','write','1718dfEyuj','17970264ELUnvf','auth','log','6aFfqvr','nonInteractive','bool','6663205PfZOrM','2336MCJNuR','3589908qILgwS','yes','Clear\x20login\x20session'];a36_0xe6b2=function(){return _0x53ecfa;};return a36_0xe6b2();}const a36_0x300e37=a36_0x1847;(function(_0x2bd620,_0x342d2b){const _0x50919d=a36_0x1847,_0x18f0d1=_0x2bd620();while(!![]){try{const _0x5756f5=-parseInt(_0x50919d(0x12e))/0x1*(parseInt(_0x50919d(0x135))/0x2)+parseInt(_0x50919d(0x12f))/0x3*(-parseInt(_0x50919d(0x133))/0x4)+-parseInt(_0x50919d(0x125))/0x5*(parseInt(_0x50919d(0x122))/0x6)+parseInt(_0x50919d(0x127))/0x7+-parseInt(_0x50919d(0x126))/0x8*(-parseInt(_0x50919d(0x130))/0x9)+parseInt(_0x50919d(0x131))/0xa*(parseInt(_0x50919d(0x12d))/0xb)+parseInt(_0x50919d(0x136))/0xc;if(_0x5756f5===_0x342d2b)break;else _0x18f0d1['push'](_0x18f0d1['shift']());}catch(_0x2e5a2d){_0x18f0d1['push'](_0x18f0d1['shift']());}}}(a36_0xe6b2,0xbf111));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x1847(_0x27c745,_0x414f45){_0x27c745=_0x27c745-0x122;const _0xe6b213=a36_0xe6b2();let _0x1847c0=_0xe6b213[_0x27c745];return _0x1847c0;}export const authDefinitions=[{'service':a36_0x300e37(0x137),'command':'login','description':a36_0x300e37(0x12c),'risk':a36_0x300e37(0x134),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x300e37(0x128),'type':'boolean','description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x557097){const _0x417a80=a36_0x300e37,{runAuthServer:_0x7a94c4}=await import(_0x417a80(0x12b));return await _0x7a94c4({'autoYes':_0x557097[_0x417a80(0x124)](_0x417a80(0x128)),'nonInteractive':_0x557097[_0x417a80(0x123)]}),{'ok':!![]};}},{'service':a36_0x300e37(0x137),'command':'logout','description':a36_0x300e37(0x129),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x533aad){const _0x534c5f=a36_0x300e37;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x534c5f(0x138)](_0x534c5f(0x12a))):console[_0x534c5f(0x138)](_0x534c5f(0x132)),{'ok':!![]};}}];
1
+ import{unlinkSync,existsSync}from"node:fs";import{cookieFile}from"../../auth/constant.js";export const authDefinitions=[{service:"auth",command:"login",description:"Login via browser",risk:"write",requiresAuth:false,requiresAppCode:false,hasFormat:false,flags:[{name:"yes",type:"boolean",description:"Skip login confirmation and start browser auth immediately",default:false}],async execute(ctx){const{runAuthServer:runAuthServer}=await(import("../../auth/auth-server-ui.js"));await runAuthServer({autoYes:ctx.bool("yes"),nonInteractive:ctx.nonInteractive});return{ok:true}}},{service:"auth",command:"logout",description:"Clear login session",risk:"write",requiresAuth:false,requiresAppCode:false,hasFormat:false,flags:[],async execute(_ctx){if(existsSync(cookieFile)){unlinkSync(cookieFile);console.log("✓ Logged out")}else{console.log("! Not logged in")}return{ok:true}}}];
@@ -1 +1,11 @@
1
- const a37_0x54fa13=a37_0x27ed;(function(_0x18f634,_0x166681){const _0x36a682=a37_0x27ed,_0x183a20=_0x18f634();while(!![]){try{const _0x27b77a=parseInt(_0x36a682(0x206))/0x1*(parseInt(_0x36a682(0x1fc))/0x2)+parseInt(_0x36a682(0x237))/0x3*(-parseInt(_0x36a682(0x22d))/0x4)+parseInt(_0x36a682(0x238))/0x5*(-parseInt(_0x36a682(0x239))/0x6)+parseInt(_0x36a682(0x20b))/0x7+parseInt(_0x36a682(0x23a))/0x8*(-parseInt(_0x36a682(0x1f1))/0x9)+-parseInt(_0x36a682(0x222))/0xa+parseInt(_0x36a682(0x209))/0xb*(parseInt(_0x36a682(0x1f6))/0xc);if(_0x27b77a===_0x166681)break;else _0x183a20['push'](_0x183a20['shift']());}catch(_0x311475){_0x183a20['push'](_0x183a20['shift']());}}}(a37_0x3fea,0xeb48c));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x54fa13(0x244),'command':a37_0x54fa13(0x1f8),'description':a37_0x54fa13(0x203),'risk':a37_0x54fa13(0x243),'flags':[{'name':a37_0x54fa13(0x213),'type':a37_0x54fa13(0x220),'required':!![],'enum':[a37_0x54fa13(0x24c),a37_0x54fa13(0x20d),a37_0x54fa13(0x1fa)],'description':a37_0x54fa13(0x205)},{'name':'name','type':'string','required':!![],'description':a37_0x54fa13(0x21d)},{'name':a37_0x54fa13(0x208),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x249)},{'name':a37_0x54fa13(0x214),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x224)},{'name':a37_0x54fa13(0x219),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x217)},{'name':a37_0x54fa13(0x204),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x1e6)},{'name':a37_0x54fa13(0x22e),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x241),'enum':[a37_0x54fa13(0x1ea),'after']}],async 'validate'(_0x2fcc27){const _0x2951c2=a37_0x54fa13,_0x1fa14c=_0x2fcc27['str'](_0x2951c2(0x23f));if(!isValidBffFunctionName(_0x1fa14c))throw CliErrors['validation'](_0x2951c2(0x1ff)+_0x1fa14c+_0x2951c2(0x22b));},async 'execute'(_0x1f28be){const _0x245bc8=a37_0x54fa13,_0x2a7519=loadBffProjectConfig(_0x1f28be[_0x245bc8(0x20e)]),_0x4aca08=_0x1f28be['str'](_0x245bc8(0x213)),_0x4855c7=_0x1f28be['str']('name'),_0x11d894=_0x1f28be['str'](_0x245bc8(0x208))||undefined,_0x5200ed=_0x4aca08===_0x245bc8(0x1fa)?await resolveHookOptions(_0x2a7519,_0x1f28be):undefined,_0x312bab=buildFilePath(_0x2a7519,_0x4aca08,_0x4855c7,_0x5200ed);if(await fileExists(_0x312bab))throw CliErrors[_0x245bc8(0x1e5)](_0x245bc8(0x207)+_0x312bab);await mkdir(dirname(_0x312bab),{'recursive':!![]});const _0x3f4266=generateTemplate(_0x4aca08,_0x4855c7,_0x1f28be[_0x245bc8(0x20e)],_0x11d894,_0x5200ed);await writeFile(_0x312bab,_0x3f4266,_0x245bc8(0x210));const _0xfa525f={'type':_0x4aca08,'name':_0x4855c7,'path':_0x312bab};if(_0x11d894)_0xfa525f[_0x245bc8(0x208)]=_0x11d894;if(_0x5200ed){if(_0x5200ed['alias'])_0xfa525f['alias']=_0x5200ed['alias'];_0xfa525f[_0x245bc8(0x229)]=_0x5200ed[_0x245bc8(0x229)],_0xfa525f[_0x245bc8(0x20c)]=_0x5200ed[_0x245bc8(0x20c)],_0xfa525f[_0x245bc8(0x226)]=_0x5200ed[_0x245bc8(0x226)];}return{'ok':!![],'data':_0xfa525f,'message':_0x245bc8(0x215)+_0x4aca08+'\x20function:\x20'+_0x4855c7};}};function a37_0x3fea(){const _0x168731=['\x0a\x20*\x20[平台配置]\x20','write','datasetCode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','isInteger','223136aMHNls','function-node','/**\x0a\x20*\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','close','tableName','HOOK\x20requires\x20alias/operation/node\x20options.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Dataset\x20not\x20found\x20for\x20code\x20\x22','60WxBGqG','5gUNllV','1460718sTNuuH','16fdtBfY','parseInt','Available:\x20','length','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','name','/HOOK/','Trigger\x20node\x20(HOOK\x20only)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','read','bff','join','\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Script\x20description','/ENDPOINT/','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','COMMON','filePath','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','stdin','Invalid\x20dataset\x20selection.','validation','Operation\x20type\x20(HOOK\x20only)','keys','\x20api\x20pull`\x20to\x20refresh.','当前响应结果','before','.js','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','/data/dataset/','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','7424316lxbvyk','修改后的请求参数','nonInteractive','scriptsRootDir','str','2436ERCgBB','Alias\x20\x22','create','map','HOOK','\x22,\x20params\x20})\x0a','1545122grkglQ','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','defaultApp','Invalid\x20function\x20name\x20\x22','profileName','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','stderr','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','operation-type','Script\x20type','1rptanJ','File\x20already\x20exists:\x20','description','186197eJYNDp','\x22\x20not\x20found\x20for\x20dataset\x20','4799991wAlfqQ','operationType','ENDPOINT','appCode','find','utf8','includes','修改后的响应结果','type','alias','Created\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Select\x20dataset:','datasetcode','source','mergedCli','question','Function\x20name\x20(valid\x20JS\x20identifier)','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','apiDir','string','\x22\x20not\x20found.\x20','9217500NWFNbg','Select\x20operation\x20type:','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','code','functionNode'];a37_0x3fea=function(){return _0x168731;};return a37_0x3fea();}function a37_0x27ed(_0x165f0a,_0x6df7cb){_0x165f0a=_0x165f0a-0x1e4;const _0x3fea48=a37_0x3fea();let _0x27ed0f=_0x3fea48[_0x165f0a];return _0x27ed0f;}async function resolveHookOptions(_0x4c5144,_0x28cfe6){const _0x338fcd=a37_0x54fa13,_0x2c845a=resolveApiModelSource(_0x28cfe6[_0x338fcd(0x21f)],_0x28cfe6[_0x338fcd(0x20e)],_0x28cfe6['selectedAppName']||_0x28cfe6[_0x338fcd(0x21b)]?.['currentApp']||_0x28cfe6[_0x338fcd(0x21b)]?.[_0x338fcd(0x1fe)]),_0x4f760f=loadAliasMap(_0x28cfe6[_0x338fcd(0x21f)],undefined,_0x2c845a[_0x338fcd(0x24d)],_0x2c845a['profileName']),_0x31d865=_0x4f760f[_0x338fcd(0x23d)]>0x0;let _0x55d321,_0x55556a,_0x28be37;const _0x409c9d=_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x214)),_0x4c005f=_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x219));if(_0x409c9d){const _0x4074a6=resolveAlias(_0x28cfe6[_0x338fcd(0x21f)],_0x409c9d,undefined,_0x2c845a[_0x338fcd(0x24d)],_0x2c845a[_0x338fcd(0x200)]);if(!_0x4074a6){const _0x328e64=_0x31d865?'Available\x20aliases:\x20'+_0x4f760f[_0x338fcd(0x1f9)](_0x1834d7=>_0x1834d7[_0x338fcd(0x214)])[_0x338fcd(0x245)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x1f7)+_0x409c9d+_0x338fcd(0x221)+_0x328e64);}_0x55d321=_0x409c9d,_0x55556a=_0x4074a6;}else{if(_0x4c005f){_0x55556a=_0x4c005f;const _0x5a4ea1=_0x4f760f[_0x338fcd(0x20f)](_0x4f5fed=>_0x4f5fed[_0x338fcd(0x229)]===_0x4c005f);_0x55d321=_0x5a4ea1?.[_0x338fcd(0x214)];}else{if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation'](_0x338fcd(0x247));else{if(_0x31d865){const _0x9cb28c=_0x4f760f[_0x338fcd(0x1f9)](_0x115b87=>_0x115b87[_0x338fcd(0x214)]+'\x20('+_0x115b87[_0x338fcd(0x233)]+')'),_0x4c3713=await promptSelect(_0x338fcd(0x218),_0x9cb28c),_0x2b16e3=_0x4f760f[_0x4c3713];if(!_0x2b16e3)throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x1e4));_0x55d321=_0x2b16e3[_0x338fcd(0x214)],_0x55556a=_0x2b16e3[_0x338fcd(0x229)];}else{const _0x33a532=await listDatasets(_0x28cfe6['appCode']);if(_0x33a532['length']===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x4d950c=_0x33a532[_0x338fcd(0x1f9)](_0x2ccbf9=>_0x2ccbf9[_0x338fcd(0x23f)]+'\x20['+(_0x2ccbf9[_0x338fcd(0x21a)]??'UNKNOWN')+']\x20('+_0x2ccbf9['code']+')'),_0x521491=await promptSelect(_0x338fcd(0x218),_0x4d950c),_0x1a056c=_0x33a532[_0x521491];if(!_0x1a056c)throw CliErrors[_0x338fcd(0x1e5)]('Invalid\x20dataset\x20selection.');_0x55556a=_0x1a056c[_0x338fcd(0x225)],_0x55d321=undefined;}}}}const _0x514a2c=await listDatasets(_0x28cfe6[_0x338fcd(0x20e)]),_0x3a3dc6=_0x514a2c[_0x338fcd(0x20f)](_0x391dda=>_0x391dda[_0x338fcd(0x225)]===_0x55556a);if(!_0x3a3dc6)throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x236)+_0x55556a+_0x338fcd(0x246)+(_0x55d321?_0x338fcd(0x201)+CLI_BIN_NAME+_0x338fcd(0x1e8):''));_0x28be37=_0x3a3dc6['id'];const _0x50fc02=_0x55d321??_0x55556a,_0x3f959e=await listBffDatasetOperations(_0x28cfe6[_0x338fcd(0x20e)],_0x28be37),_0x4973ae=_0x3f959e?Object[_0x338fcd(0x1e7)](_0x3f959e):[];if(_0x4973ae[_0x338fcd(0x23d)]===0x0)throw CliErrors['validation'](_0x338fcd(0x248)+_0x50fc02+'.');let _0x13dc1c;const _0x48d6a2=_0x28cfe6['str'](_0x338fcd(0x204));if(_0x48d6a2){if(!_0x4973ae[_0x338fcd(0x211)](_0x48d6a2))throw CliErrors[_0x338fcd(0x1e5)]('Operation\x20type\x20\x22'+_0x48d6a2+_0x338fcd(0x20a)+_0x50fc02+'.\x20'+(_0x338fcd(0x23c)+_0x4973ae['join'](',\x20')));_0x13dc1c=_0x48d6a2;}else{if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x4ec9bb=await promptSelect(_0x338fcd(0x223),_0x4973ae);_0x13dc1c=_0x4973ae[_0x4ec9bb]??_0x4973ae[0x0];}let _0x28a30d=normalizeHookFunctionNode(_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x22e)));if(!_0x28a30d){if(_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x22e)))throw CliErrors['validation'](_0x338fcd(0x21e));if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation'](_0x338fcd(0x24f));const _0xff9680=await promptSelect('Select\x20trigger\x20node:',[_0x338fcd(0x1ea),'after']);_0x28a30d=[_0x338fcd(0x1ea),'after'][_0xff9680]??'before';}return{'alias':_0x55d321,'datasetCode':_0x55556a,'datasetId':_0x28be37,'operationType':_0x13dc1c,'functionNode':_0x28a30d};}async function promptSelect(_0x4b79d5,_0x1d60d2){const _0x5d3b08=a37_0x54fa13;if(_0x1d60d2['length']===0x1)return 0x0;for(const [_0x589f32,_0x3edbce]of _0x1d60d2['entries']()){process[_0x5d3b08(0x202)][_0x5d3b08(0x228)]('\x20\x20'+(_0x589f32+0x1)+'.\x20'+_0x3edbce+'\x0a');}const _0x12d784=createInterface({'input':process[_0x5d3b08(0x250)],'output':process['stderr']});while(!![]){const _0x2d6e87=await new Promise(_0x2376eb=>{const _0x4c77f4=_0x5d3b08;_0x12d784[_0x4c77f4(0x21c)](_0x4b79d5+'\x20',_0x2376eb);}),_0x4b1f0e=Number[_0x5d3b08(0x23b)](_0x2d6e87['trim'](),0xa);if(Number[_0x5d3b08(0x22c)](_0x4b1f0e)&&_0x4b1f0e>=0x1&&_0x4b1f0e<=_0x1d60d2[_0x5d3b08(0x23d)])return _0x12d784[_0x5d3b08(0x232)](),_0x4b1f0e-0x1;process[_0x5d3b08(0x202)][_0x5d3b08(0x228)](_0x5d3b08(0x242)+_0x1d60d2[_0x5d3b08(0x23d)]+'.\x0a');}}function buildFilePath(_0x18bec5,_0x4e233c,_0x44ab6d,_0x287716){const _0x35812c=a37_0x54fa13;if(_0x4e233c==='HOOK'){if(!_0x287716)throw CliErrors[_0x35812c(0x1e5)](_0x35812c(0x234));const _0x139982=_0x287716[_0x35812c(0x214)]??_0x287716['datasetCode'];return join(_0x18bec5[_0x35812c(0x1f4)],_0x35812c(0x1fa),_0x139982,_0x287716[_0x35812c(0x20c)],_0x287716[_0x35812c(0x226)],_0x44ab6d+_0x35812c(0x1eb));}return join(_0x18bec5['scriptsRootDir'],_0x4e233c,_0x44ab6d+_0x35812c(0x1eb));}export function generateTemplate(_0x551226,_0x2fa378,_0x14b9b8,_0x17fc4a,_0x48553e){const _0x260b1b=a37_0x54fa13,_0x51e5a5=_0x17fc4a?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x318ba5=getAppBaseUrl(_0x14b9b8),_0x2f7d31=_0x260b1b(0x24b);if(_0x551226==='COMMON')return'/**\x0a\x20*\x20'+_0x51e5a5+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x2fa378+'\x0a\x20*\x20[平台配置]\x20'+_0x318ba5+_0x260b1b(0x23e)+_0x14b9b8+'/COMMON/'+_0x2fa378+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x2fa378+_0x260b1b(0x1fb)+_0x2f7d31+_0x260b1b(0x1f0)+_0x2fa378+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x551226===_0x260b1b(0x20d))return _0x260b1b(0x22f)+_0x51e5a5+_0x260b1b(0x22a)+_0x2fa378+_0x260b1b(0x216)+_0x14b9b8+'/'+_0x2fa378+_0x260b1b(0x227)+_0x318ba5+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x14b9b8+_0x260b1b(0x24a)+_0x2fa378+'.js\x0a'+_0x2f7d31+_0x260b1b(0x1fd)+_0x2fa378+_0x260b1b(0x235);if(!_0x48553e)throw CliErrors[_0x260b1b(0x1e5)](_0x260b1b(0x1ec));const _0x3e4fa4=_0x48553e[_0x260b1b(0x214)]??_0x48553e[_0x260b1b(0x229)],_0xb0db35=_0x48553e[_0x260b1b(0x226)]===_0x260b1b(0x1ea)?'当前请求参数':_0x260b1b(0x1e9),_0x59e814=_0x48553e[_0x260b1b(0x226)]===_0x260b1b(0x1ea)?_0x260b1b(0x1f2):_0x260b1b(0x212);return _0x260b1b(0x22f)+_0x51e5a5+_0x260b1b(0x230)+_0x2fa378+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x14b9b8+'/'+_0x48553e['datasetCode']+'/'+_0x48553e['operationType']+_0x260b1b(0x227)+_0x318ba5+_0x260b1b(0x1ef)+_0x48553e['datasetId']+_0x260b1b(0x24e)+_0x14b9b8+_0x260b1b(0x240)+_0x3e4fa4+'/'+_0x48553e['operationType']+'/'+_0x48553e[_0x260b1b(0x226)]+'/'+_0x2fa378+'.js\x0a\x20*\x20[触发节点]\x20'+_0x48553e[_0x260b1b(0x226)]+'\x0a'+_0x2f7d31+_0x260b1b(0x231)+_0xb0db35+_0x260b1b(0x1ee)+_0x59e814+_0x260b1b(0x1ed)+_0x2fa378+_0x260b1b(0x235);}
1
+ import{createInterface}from"node:readline";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{listDatasets,listBffDatasetOperations}from"../../core/api-client.js";import{loadAliasMap,resolveAlias}from"../../core/alias-resolver.js";import{resolveApiModelSource}from"../../api/model-source.js";import{loadBffProjectConfig}from"../../core/bff/config.js";import{fileExists}from"../../core/bff/file-system.js";import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from"../../core/bff/utils.js";import{CliErrors}from"../../errors.js";import{CLI_BIN_NAME}from"../../constant/cli.js";import{getAppBaseUrl}from"../../constant/domain.js";export const bffCreate={service:"bff",command:"create",description:"Scaffold a new Backend Function script from template",risk:"read",flags:[{name:"type",type:"string",required:true,enum:["COMMON","ENDPOINT","HOOK"],description:"Script type"},{name:"name",type:"string",required:true,
2
+ description:"Function name (valid JS identifier)"},{name:"description",type:"string",description:"Script description"},{name:"alias",type:"string",description:"Dataset alias from api.ts (HOOK only, preferred)"},{name:"datasetcode",type:"string",description:"Dataset code (HOOK only, fallback when alias unavailable)"},{name:"operation-type",type:"string",description:"Operation type (HOOK only)"},{name:"function-node",type:"string",description:"Trigger node (HOOK only)",enum:["before","after"]}],async validate(ctx){const functionName=ctx.str("name");if(!isValidBffFunctionName(functionName)){throw CliErrors.validation(`Invalid function name "${functionName}". Must be a valid JS identifier (e.g. createOrder, beforeFilter).`)}},async execute(ctx){const config=loadBffProjectConfig(ctx.appCode);const scriptType=ctx.str("type");const functionName=ctx.str("name");const description=ctx.str("description")||undefined
3
+ ;const hookOptions=scriptType==="HOOK"?await resolveHookOptions(config,ctx):undefined;const targetFilePath=buildFilePath(config,scriptType,functionName,hookOptions);if(await fileExists(targetFilePath)){throw CliErrors.validation(`File already exists: ${targetFilePath}`)}await mkdir(dirname(targetFilePath),{recursive:true});const template=generateTemplate(scriptType,functionName,ctx.appCode,description,hookOptions);await writeFile(targetFilePath,template,"utf8");const data={type:scriptType,name:functionName,path:targetFilePath};if(description)data["description"]=description;if(hookOptions){if(hookOptions.alias)data["alias"]=hookOptions.alias;data["datasetCode"]=hookOptions.datasetCode;data["operationType"]=hookOptions.operationType;data["functionNode"]=hookOptions.functionNode}return{ok:true,data:data,message:`Created ${scriptType} function: ${functionName}`}}};async function resolveHookOptions(config,ctx){
4
+ const source=resolveApiModelSource(ctx.apiDir,ctx.appCode,ctx.selectedAppName||ctx.mergedCli?.currentApp||ctx.mergedCli?.defaultApp);const aliasEntries=loadAliasMap(ctx.apiDir,undefined,source.filePath,source.profileName);const hasAliasMap=aliasEntries.length>0;let selectedAlias;let selectedDatasetCode;let selectedDatasetId;const aliasFlag=ctx.str("alias");const datasetcodeFlag=ctx.str("datasetcode");if(aliasFlag){const datasetCode=resolveAlias(ctx.apiDir,aliasFlag,undefined,source.filePath,source.profileName);if(!datasetCode){const hint=hasAliasMap?`Available aliases: ${aliasEntries.map(e=>e.alias).join(", ")}`:`No model aliases found. Run \`${CLI_BIN_NAME} api pull\` first, or use --datasetcode instead.`;throw CliErrors.validation(`Alias "${aliasFlag}" not found. ${hint}`)}selectedAlias=aliasFlag;selectedDatasetCode=datasetCode}else if(datasetcodeFlag){selectedDatasetCode=datasetcodeFlag;const entry=aliasEntries.find(e=>e.datasetCode===datasetcodeFlag);selectedAlias=entry?.alias
5
+ }else if(ctx.nonInteractive){throw CliErrors.validation("--alias or --datasetcode is required for HOOK in non-interactive mode.")}else if(hasAliasMap){const choices=aliasEntries.map(e=>`${e.alias} (${e.tableName})`);const idx=await promptSelect("Select dataset:",choices);const entry=aliasEntries[idx];if(!entry)throw CliErrors.validation("Invalid dataset selection.");selectedAlias=entry.alias;selectedDatasetCode=entry.datasetCode}else{const datasets=await listDatasets(ctx.appCode);if(datasets.length===0){throw CliErrors.validation("No datasets found for this app.")}const choices=datasets.map(d=>`${d.name} [${d.source??"UNKNOWN"}] (${d.code})`);const idx=await promptSelect("Select dataset:",choices);const ds=datasets[idx];if(!ds)throw CliErrors.validation("Invalid dataset selection.");selectedDatasetCode=ds.code;selectedAlias=undefined}const datasets=await listDatasets(ctx.appCode);const matchedDataset=datasets.find(d=>d.code===selectedDatasetCode);if(!matchedDataset){
6
+ throw CliErrors.validation(`Dataset not found for code "${selectedDatasetCode}". `+(selectedAlias?`The generated model facts may be stale — run \`${CLI_BIN_NAME} api pull\` to refresh.`:""))}selectedDatasetId=matchedDataset.id;const dirName=selectedAlias??selectedDatasetCode;const rawOps=await listBffDatasetOperations(ctx.appCode,selectedDatasetId);const opTypes=rawOps?Object.keys(rawOps):[];if(opTypes.length===0){throw CliErrors.validation(`No operation types found for dataset ${dirName}.`)}let operationType;const opTypeFlag=ctx.str("operation-type");if(opTypeFlag){if(!opTypes.includes(opTypeFlag)){throw CliErrors.validation(`Operation type "${opTypeFlag}" not found for dataset ${dirName}. `+`Available: ${opTypes.join(", ")}`)}operationType=opTypeFlag}else{if(ctx.nonInteractive){throw CliErrors.validation("--operation-type is required for HOOK in non-interactive mode.")}const idx=await promptSelect("Select operation type:",opTypes);operationType=opTypes[idx]??opTypes[0]}
7
+ let functionNode=normalizeHookFunctionNode(ctx.str("function-node"));if(!functionNode){if(ctx.str("function-node")){throw CliErrors.validation("--function-node must be 'before' or 'after'.")}if(ctx.nonInteractive){throw CliErrors.validation("--function-node is required for HOOK in non-interactive mode.")}const idx=await promptSelect("Select trigger node:",["before","after"]);functionNode=["before","after"][idx]??"before"}return{alias:selectedAlias,datasetCode:selectedDatasetCode,datasetId:selectedDatasetId,operationType:operationType,functionNode:functionNode}}async function promptSelect(message,choices){if(choices.length===1)return 0;for(const[i,label]of choices.entries()){process.stderr.write(` ${i+1}. ${label}\n`)}const rl=createInterface({input:process.stdin,output:process.stderr});while(true){const answer=await new Promise(resolve=>{rl.question(`${message} `,resolve)});const idx=Number.parseInt(answer.trim(),10);if(Number.isInteger(idx)&&idx>=1&&idx<=choices.length){rl.close()
8
+ ;return idx-1}process.stderr.write(` Enter a number between 1 and ${choices.length}.\n`)}}function buildFilePath(config,scriptType,functionName,hookOptions){if(scriptType==="HOOK"){if(!hookOptions)throw CliErrors.validation("HOOK requires alias/operation/node options.");const dirName=hookOptions.alias??hookOptions.datasetCode;return join(config.scriptsRootDir,"HOOK",dirName,hookOptions.operationType,hookOptions.functionNode,`${functionName}.js`)}return join(config.scriptsRootDir,scriptType,`${functionName}.js`)}export function generateTemplate(scriptType,functionName,appCode,description,hookOptions){const desc=description?.trim()||DEFAULT_BFF_SCRIPT_DESCRIPTION;const platformBaseUrl=getAppBaseUrl(appCode);const dependencyNotes=` * [依赖数据集] 无(如有依赖,DB_TABLE 填物理表名;METADATA 填数据集编码与用途)\n * [调用 BF] 无(如有调用,填写脚本名称与用途)\n * [执行 SQL] 无(如有执行,填写 SQL 名称与用途)\n * [副作用] 无(如有通知或外部调用,说明影响与失败策略)`;if(scriptType==="COMMON"){
9
+ return`/**\n * ${desc}\n *\n * [脚本类型] COMMON\n * [脚本名称] ${functionName}\n * [平台配置] ${platformBaseUrl}/data/backend-function\n * [本地路径] .rabetbase/bff/${appCode}/COMMON/${functionName}.js\n * [调用方式] context.client.bff.execute({ scriptName: "${functionName}", params })\n${dependencyNotes}\n * [参数字段] 按实际输入为 params.<字段名> 补充 JSDoc 参数标签;无字段时仅保留根参数\n * [异常说明] 无;显式抛出异常时补充异常类型与触发条件\n *\n * @param {Object} params 请求参数\n * @param {Object} context 平台注入的执行上下文\n * @returns {Promise<Object>} TODO: 补充返回数据结构\n */\nexport default async function ${functionName}(params, context) {\n return params;\n}\n`}if(scriptType==="ENDPOINT"){
10
+ return`/**\n * ${desc}\n *\n * [脚本类型] ENDPOINT\n * [脚本名称] ${functionName}\n * [接口路径] POST /api/endpoint/${appCode}/${functionName}\n * [平台配置] ${platformBaseUrl}/data/backend-function\n * [本地路径] .rabetbase/bff/${appCode}/ENDPOINT/${functionName}.js\n${dependencyNotes}\n * [参数字段] 按实际请求体为 params.<字段名> 补充 JSDoc 参数标签;无字段时仅保留根参数\n * [异常说明] 无;显式抛出异常时补充异常类型与触发条件\n *\n * @param {Object} params HTTP 请求体参数\n * @param {Object} context 平台注入的执行上下文\n * @returns {Promise<Object>} TODO: 补充业务返回数据结构\n */\nexport default async function ${functionName}(params, context) {\n return params;\n}\n`}if(!hookOptions)throw CliErrors.validation("HOOK requires hookOptions for template generation.");const hookDirName=hookOptions.alias??hookOptions.datasetCode;const hookParamsDescription=hookOptions.functionNode==="before"?"当前请求参数":"当前响应结果";const hookReturnDescription=hookOptions.functionNode==="before"?"修改后的请求参数":"修改后的响应结果"
11
+ ;return`/**\n * ${desc}\n *\n * [脚本类型] HOOK\n * [脚本名称] ${functionName}\n * [接口路径] POST /api/${appCode}/${hookOptions.datasetCode}/${hookOptions.operationType}\n * [平台配置] ${platformBaseUrl}/data/dataset/${hookOptions.datasetId}#api-list\n * [本地路径] .rabetbase/bff/${appCode}/HOOK/${hookDirName}/${hookOptions.operationType}/${hookOptions.functionNode}/${functionName}.js\n * [触发节点] ${hookOptions.functionNode}\n${dependencyNotes}\n * [参数字段] 按实际输入为 params.<字段名> 补充 JSDoc 参数标签;无字段时仅保留根参数\n * [异常说明] 无;显式抛出异常时补充异常类型与触发条件\n *\n * @param {Object} params ${hookParamsDescription}\n * @param {Object} context 平台注入的执行上下文\n * @returns {Promise<Object>} ${hookReturnDescription}\n */\nexport default async function ${functionName}(params, context) {\n return params;\n}\n`}
@@ -1 +1,6 @@
1
- const a38_0x274d2=a38_0x3902;function a38_0x3902(_0x58a88f,_0x296a3e){_0x58a88f=_0x58a88f-0x14e;const _0x39a8c6=a38_0x39a8();let _0x390283=_0x39a8c6[_0x58a88f];return _0x390283;}(function(_0x1c4439,_0x3e62cc){const _0x317bd7=a38_0x3902,_0x205fce=_0x1c4439();while(!![]){try{const _0x446c90=-parseInt(_0x317bd7(0x153))/0x1*(-parseInt(_0x317bd7(0x14f))/0x2)+-parseInt(_0x317bd7(0x170))/0x3*(-parseInt(_0x317bd7(0x162))/0x4)+-parseInt(_0x317bd7(0x168))/0x5*(-parseInt(_0x317bd7(0x166))/0x6)+-parseInt(_0x317bd7(0x165))/0x7*(-parseInt(_0x317bd7(0x177))/0x8)+-parseInt(_0x317bd7(0x159))/0x9+-parseInt(_0x317bd7(0x161))/0xa+parseInt(_0x317bd7(0x154))/0xb;if(_0x446c90===_0x3e62cc)break;else _0x205fce['push'](_0x205fce['shift']());}catch(_0x404f8b){_0x205fce['push'](_0x205fce['shift']());}}}(a38_0x39a8,0x4033c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';function a38_0x39a8(){const _0x51e1fc=['includes','5528NXniOf','Function\x20not\x20found:\x20','map','string','97xcjFeQ','5566539wNnFmh','length','high-risk-write','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','apps','4733487lJQPzY','projectRoot','parse','remoteId','lastSync','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','trashDir','2979310IqPEEg','20IYULTl','toISOString','startsWith','110089EdAnNg','4710FzhtLj','Backend\x20Function\x20lock\x20file\x20not\x20found.','655MrvLpP','scriptsRootDir','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','delete','validation','59859BbeWKl','bff','Would\x20delete\x20','split','\x20(local\x20file\x20moved\x20to\x20trash)','<timestamp>','scriptsRoot','56vurhTQ','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','appCode','keys','functions','target'];a38_0x39a8=function(){return _0x51e1fc;};return a38_0x39a8();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x274d2(0x171),'command':a38_0x274d2(0x16e),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0x274d2(0x156),'flags':[{'name':a38_0x274d2(0x17c),'type':a38_0x274d2(0x152),'required':!![],'description':a38_0x274d2(0x178)}],async 'validate'(_0x2e2c2f){const _0x590168=a38_0x274d2,_0x83699b=loadBffProjectConfig(_0x2e2c2f[_0x590168(0x179)]),_0x5593cd=await readBffLockFile(_0x83699b[_0x590168(0x16c)]);if(!_0x5593cd)throw CliErrors[_0x590168(0x16f)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x552314){const _0x537ab7=a38_0x274d2,_0x5a1940=loadBffProjectConfig(_0x552314['appCode']),_0x368f5b=await readBffLockFile(_0x5a1940[_0x537ab7(0x16c)]);if(!_0x368f5b)throw CliErrors['validation'](_0x537ab7(0x167));const {appLock:_0x19ede7}=ensureLockScope(_0x368f5b,_0x552314[_0x537ab7(0x179)],_0x5a1940[_0x537ab7(0x176)],'delete'),_0x519712=_0x552314[_0x537ab7(0x16a)](_0x537ab7(0x17c)),_0x5e376f=Object[_0x537ab7(0x17a)](_0x19ede7[_0x537ab7(0x17b)]),_0x280e4d=resolveDeleteTarget(_0x519712,_0x5e376f),_0x525aee=_0x19ede7[_0x537ab7(0x17b)][_0x280e4d];if(!_0x525aee)throw CliErrors[_0x537ab7(0x16f)](_0x537ab7(0x15f)+_0x280e4d+'\x22.');const _0x4ea489=resolveLocalFilePathFromLockKey(_0x5a1940,_0x280e4d),_0x5000d2=relative(_0x5a1940[_0x537ab7(0x15a)],_0x4ea489),_0x197aa0=join(_0x5a1940[_0x537ab7(0x160)],_0x537ab7(0x175),_0x5000d2);return{'method':'POST','url':_0x537ab7(0x15e),'body':{'appCode':_0x552314['appCode'],'target':_0x280e4d,'remoteId':_0x525aee['remoteId'],'localFilePath':_0x4ea489,'trashedPath':_0x197aa0},'description':_0x537ab7(0x172)+_0x280e4d+_0x537ab7(0x16d)};},async 'execute'(_0x45517d){const _0x567726=a38_0x274d2,_0x4dc779=loadBffProjectConfig(_0x45517d[_0x567726(0x179)]),_0x525a26=await readBffLockFile(_0x4dc779[_0x567726(0x16c)]);if(!_0x525a26)throw CliErrors['validation'](_0x567726(0x167));const {lockData:_0x312d3a,appLock:_0x55bfcc}=ensureLockScope(_0x525a26,_0x45517d[_0x567726(0x179)],_0x4dc779['scriptsRoot'],_0x567726(0x16e)),_0x5dbc79=JSON[_0x567726(0x15b)](JSON['stringify'](_0x312d3a)),_0x41f790=_0x5dbc79['apps'][_0x45517d[_0x567726(0x179)]];if(!_0x41f790)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x45517d[_0x567726(0x179)]+_0x567726(0x16b));const _0x377906=_0x45517d['str']('target'),_0x1a258f=Object['keys'](_0x41f790['functions']),_0x57e095=resolveDeleteTarget(_0x377906,_0x1a258f),_0x3c19df=_0x41f790[_0x567726(0x17b)][_0x57e095];if(!_0x3c19df)throw CliErrors[_0x567726(0x16f)](_0x567726(0x15f)+_0x57e095+'\x22.');await deleteBffScript(_0x3c19df[_0x567726(0x15c)]),delete _0x41f790['functions'][_0x57e095],_0x41f790[_0x567726(0x15d)]=new Date()[_0x567726(0x163)](),await writeBffLockFile(_0x4dc779[_0x567726(0x16c)],_0x5dbc79);const _0x251446=resolveLocalFilePathFromLockKey(_0x4dc779,_0x57e095);let _0x192642;await fileExists(_0x251446)&&(_0x192642=await moveToTrash(_0x4dc779[_0x567726(0x15a)],_0x4dc779[_0x567726(0x160)],_0x251446),await cleanupEmptyDirectories(dirname(_0x251446),_0x4dc779[_0x567726(0x169)]));await waitForDeleteSettlement(_0x4dc779[_0x567726(0x16c)],_0x45517d['appCode'],_0x57e095,_0x251446),await sleep(0x96);const _0x19f676={'deleted':_0x57e095,'remoteId':_0x3c19df['remoteId']};if(_0x192642)_0x19f676['trashedTo']=_0x192642;return{'ok':!![],'data':_0x19f676,'message':'Deleted\x20'+_0x57e095+(_0x192642?_0x567726(0x174):'')};}};function resolveDeleteTarget(_0x4afddf,_0x1a1f5d){const _0x148d30=a38_0x274d2;if(_0x4afddf[_0x148d30(0x14e)]('/')){const _0x100de7=_0x1a1f5d['find'](_0x4f14f9=>_0x4f14f9===_0x4afddf);if(!_0x100de7)throw CliErrors[_0x148d30(0x16f)](_0x148d30(0x150)+_0x4afddf);return _0x100de7;}const _0xef0c06=_0x1a1f5d['filter'](_0x384327=>_0x384327[_0x148d30(0x173)]('/')['at'](-0x1)===_0x4afddf);if(_0xef0c06['length']===0x0)throw CliErrors[_0x148d30(0x16f)]('Function\x20not\x20found:\x20'+_0x4afddf);if(_0xef0c06[_0x148d30(0x155)]>0x1)throw CliErrors[_0x148d30(0x16f)]('Multiple\x20functions\x20match\x20\x22'+_0x4afddf+_0x148d30(0x157)+_0xef0c06[_0x148d30(0x151)](_0x454eeb=>'\x20\x20-\x20'+_0x454eeb)['join']('\x0a'));return _0xef0c06[0x0];}async function moveToTrash(_0x1623a5,_0x431be4,_0x18ad4){const _0x552701=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x3722f3=relative(_0x1623a5,_0x18ad4),_0x592743=join(_0x431be4,_0x552701,_0x3722f3);return await mkdir(dirname(_0x592743),{'recursive':!![]}),await rename(_0x18ad4,_0x592743),_0x592743;}async function cleanupEmptyDirectories(_0x3ffd51,_0x8f124e){const _0x2ca4bb=a38_0x274d2;let _0x343407=resolve(_0x3ffd51);const _0x2b21d2=resolve(_0x8f124e);while(_0x343407[_0x2ca4bb(0x164)](''+_0x2b21d2+sep)||_0x343407===_0x2b21d2){if(_0x343407===_0x2b21d2)return;try{const _0x29f4fd=await readdir(_0x343407);if(_0x29f4fd[_0x2ca4bb(0x155)]>0x0)return;await rmdir(_0x343407);}catch{return;}_0x343407=dirname(_0x343407);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x900c28,_0x3a2b7f,_0x11a225,_0x470f9c){const _0x15dca7=a38_0x274d2;for(let _0x4a2eef=0x0;_0x4a2eef<DELETE_SETTLE_RETRY_COUNT;_0x4a2eef+=0x1){const _0x4021c2=await readBffLockFile(_0x900c28),_0x26b5bc=!!_0x4021c2?.[_0x15dca7(0x158)]?.[_0x3a2b7f]?.[_0x15dca7(0x17b)]?.[_0x11a225],_0x13e1ff=await fileExists(_0x470f9c);if(!_0x26b5bc&&!_0x13e1ff)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x11a225+'.');}
1
+ import{mkdir,readdir,rename,rmdir}from"node:fs/promises";import{dirname,join,relative,resolve,sep}from"node:path";import{deleteBffScript}from"../../core/api-client.js";import{loadBffProjectConfig}from"../../core/bff/config.js";import{fileExists,resolveLocalFilePathFromLockKey}from"../../core/bff/file-system.js";import{ensureLockScope,readBffLockFile,writeBffLockFile}from"../../core/bff/lock.js";import{CliErrors}from"../../errors.js";import{sleep}from"../../utils/sleep.js";export const bffDelete={service:"bff",command:"delete",description:"Delete a Backend Function script from remote and local",risk:"high-risk-write",flags:[{name:"target",type:"string",required:true,description:"Lock key (e.g. ENDPOINT/createOrder) or short function name"}],async validate(ctx){const config=loadBffProjectConfig(ctx.appCode);const lockData=await readBffLockFile(config.lockFilePath);if(!lockData){
2
+ throw CliErrors.validation("Backend Function lock file not found. Run `push` or `pull` first to initialize sync state.")}},async dryRun(ctx){const config=loadBffProjectConfig(ctx.appCode);const lockData=await readBffLockFile(config.lockFilePath);if(!lockData){throw CliErrors.validation("Backend Function lock file not found.")}const{appLock:appLock}=ensureLockScope(lockData,ctx.appCode,config.scriptsRoot,"delete");const targetInput=ctx.str("target");const lockKeys=Object.keys(appLock.functions);const targetKey=resolveDeleteTarget(targetInput,lockKeys);const targetEntry=appLock.functions[targetKey];if(!targetEntry){throw CliErrors.validation(`No lock entry found for "${targetKey}".`)}const localFilePath=resolveLocalFilePathFromLockKey(config,targetKey);const relativePath=relative(config.projectRoot,localFilePath);const trashedPath=join(config.trashDir,"<timestamp>",relativePath);return{method:"POST",url:"/api/management/library/scripts/delete",body:{appCode:ctx.appCode,target:targetKey,
3
+ remoteId:targetEntry.remoteId,localFilePath:localFilePath,trashedPath:trashedPath},description:`Would delete ${targetKey} from remote and move local file to trash`}},async execute(ctx){const config=loadBffProjectConfig(ctx.appCode);const lockDataFromFile=await readBffLockFile(config.lockFilePath);if(!lockDataFromFile){throw CliErrors.validation("Backend Function lock file not found.")}const{lockData:lockData,appLock:appLock}=ensureLockScope(lockDataFromFile,ctx.appCode,config.scriptsRoot,"delete");const nextLockData=JSON.parse(JSON.stringify(lockData));const nextAppLock=nextLockData.apps[ctx.appCode];if(!nextAppLock){throw new Error(`Lock scope for app "${ctx.appCode}" not found after ensureLockScope.`)}const targetInput=ctx.str("target");const lockKeys=Object.keys(nextAppLock.functions);const targetKey=resolveDeleteTarget(targetInput,lockKeys);const targetEntry=nextAppLock.functions[targetKey];if(!targetEntry){throw CliErrors.validation(`No lock entry found for "${targetKey}".`)}
4
+ await deleteBffScript(targetEntry.remoteId);delete nextAppLock.functions[targetKey];nextAppLock.lastSync=(new Date).toISOString();await writeBffLockFile(config.lockFilePath,nextLockData);const localFilePath=resolveLocalFilePathFromLockKey(config,targetKey);let trashedPath;if(await fileExists(localFilePath)){trashedPath=await moveToTrash(config.projectRoot,config.trashDir,localFilePath);await cleanupEmptyDirectories(dirname(localFilePath),config.scriptsRootDir)}await waitForDeleteSettlement(config.lockFilePath,ctx.appCode,targetKey,localFilePath);await sleep(150);const data={deleted:targetKey,remoteId:targetEntry.remoteId};if(trashedPath)data["trashedTo"]=trashedPath;return{ok:true,data:data,message:`Deleted ${targetKey}`+(trashedPath?` (local file moved to trash)`:"")}}};function resolveDeleteTarget(target,lockKeys){if(target.includes("/")){const exact=lockKeys.find(k=>k===target);if(!exact)throw CliErrors.validation(`Function not found: ${target}`);return exact}
5
+ const matches=lockKeys.filter(k=>k.split("/").at(-1)===target);if(matches.length===0){throw CliErrors.validation(`Function not found: ${target}`)}if(matches.length>1){throw CliErrors.validation(`Multiple functions match "${target}". Use the full lock key:\n`+matches.map(k=>` - ${k}`).join("\n"))}return matches[0]}async function moveToTrash(projectRoot,trashDir,localFilePath){const timestamp=(new Date).toISOString().replace(/[:.]/g,"-");const relativePath=relative(projectRoot,localFilePath);const targetPath=join(trashDir,timestamp,relativePath);await mkdir(dirname(targetPath),{recursive:true});await rename(localFilePath,targetPath);return targetPath}async function cleanupEmptyDirectories(startDir,stopDir){let currentDir=resolve(startDir);const normalizedStop=resolve(stopDir);while(currentDir.startsWith(`${normalizedStop}${sep}`)||currentDir===normalizedStop){if(currentDir===normalizedStop)return;try{const entries=await readdir(currentDir);if(entries.length>0)return
6
+ ;await rmdir(currentDir)}catch{return}currentDir=dirname(currentDir)}}const DELETE_SETTLE_RETRY_COUNT=20;const DELETE_SETTLE_DELAY_MS=100;async function waitForDeleteSettlement(lockFilePath,appCode,targetKey,localFilePath){for(let i=0;i<DELETE_SETTLE_RETRY_COUNT;i+=1){const latestLock=await readBffLockFile(lockFilePath);const stillInLock=!!latestLock?.apps?.[appCode]?.functions?.[targetKey];const stillHasFile=await fileExists(localFilePath);if(!stillInLock&&!stillHasFile){return}await sleep(DELETE_SETTLE_DELAY_MS)}throw new Error(`Local delete not settled for ${targetKey}.`)}
@@ -1 +1 @@
1
- const a39_0x296e5f=a39_0x384e;(function(_0x1467b6,_0x16733f){const _0x4c671f=a39_0x384e,_0x513f11=_0x1467b6();while(!![]){try{const _0x45f108=-parseInt(_0x4c671f(0xc2))/0x1+parseInt(_0x4c671f(0xc3))/0x2*(parseInt(_0x4c671f(0xc9))/0x3)+-parseInt(_0x4c671f(0xd0))/0x4*(-parseInt(_0x4c671f(0xd2))/0x5)+parseInt(_0x4c671f(0xbd))/0x6*(parseInt(_0x4c671f(0xbe))/0x7)+-parseInt(_0x4c671f(0xce))/0x8*(-parseInt(_0x4c671f(0xbb))/0x9)+parseInt(_0x4c671f(0xc6))/0xa+-parseInt(_0x4c671f(0xcd))/0xb*(parseInt(_0x4c671f(0xd3))/0xc);if(_0x45f108===_0x16733f)break;else _0x513f11['push'](_0x513f11['shift']());}catch(_0x5ac3c9){_0x513f11['push'](_0x513f11['shift']());}}}(a39_0x47d8,0xef1ff));import{getBffScriptInfo}from'../../core/api-client.js';function a39_0x47d8(){const _0x310dd4=['scriptType','verbose','1760507SjYARL','84418iWhYvF','(none)','description','15921840rRumYl','detail','num','27PptKht','bool','bff','scriptContent','66xwKMBt','3365984Yvjqmd','createdTime','776WtTnmm','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','49470KRWhcO','4019076SfItgF','Script\x20ID','appCode','18WiTEML','read','99018thKRjG','7dvbZOq','number'];a39_0x47d8=function(){return _0x310dd4;};return a39_0x47d8();}function a39_0x384e(_0x405c55,_0x415de9){_0x405c55=_0x405c55-0xbb;const _0x47d85a=a39_0x47d8();let _0x384ee2=_0x47d85a[_0x405c55];return _0x384ee2;}export const bffDetail={'service':a39_0x296e5f(0xcb),'command':a39_0x296e5f(0xc7),'description':a39_0x296e5f(0xd1),'risk':a39_0x296e5f(0xbc),'flags':[{'name':'id','type':a39_0x296e5f(0xbf),'required':!![],'description':a39_0x296e5f(0xd4)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x20855a){const _0x6a80e1=a39_0x296e5f,_0x24bbd7=await getBffScriptInfo(_0x20855a[_0x6a80e1(0xc8)]('id')),_0x4beb60=_0x20855a[_0x6a80e1(0xca)](_0x6a80e1(0xc1));if(_0x4beb60)return{'ok':!![],'data':_0x24bbd7};return{'ok':!![],'data':{'id':_0x24bbd7['id'],'functionName':_0x24bbd7['functionName']??'','version':_0x24bbd7['version']??'','updateUserName':_0x24bbd7['updateUserName']??'','appCode':_0x24bbd7[_0x6a80e1(0xd5)],'scriptType':_0x24bbd7[_0x6a80e1(0xc0)],'description':_0x24bbd7[_0x6a80e1(0xc5)]||_0x6a80e1(0xc4),'createdTime':_0x24bbd7[_0x6a80e1(0xcf)]??'','updatedTime':_0x24bbd7['updatedTime']??'','scriptContent':_0x24bbd7[_0x6a80e1(0xcc)]??''}};}};
1
+ import{getBffScriptInfo}from"../../core/api-client.js";export const bffDetail={service:"bff",command:"detail",description:"Get Backend Function script details by ID",risk:"read",flags:[{name:"id",type:"number",required:true,description:"Script ID"},{name:"verbose",type:"boolean",description:"Return full raw script object"}],async execute(ctx){const script=await getBffScriptInfo(ctx.num("id"));const verbose=ctx.bool("verbose");if(verbose){return{ok:true,data:script}}return{ok:true,data:{id:script.id,functionName:script.functionName??"",version:script.version??"",updateUserName:script.updateUserName??"",appCode:script.appCode,scriptType:script.scriptType,description:script.description||"(none)",createdTime:script.createdTime??"",updatedTime:script.updatedTime??"",scriptContent:script.scriptContent??""}}}};
@@ -1 +1 @@
1
- (function(_0x514ef3,_0x209c12){const _0xd8348d=a40_0x3092,_0x39d90b=_0x514ef3();while(!![]){try{const _0x462fb6=-parseInt(_0xd8348d(0x13e))/0x1*(parseInt(_0xd8348d(0x139))/0x2)+parseInt(_0xd8348d(0x13b))/0x3*(-parseInt(_0xd8348d(0x13a))/0x4)+parseInt(_0xd8348d(0x134))/0x5+parseInt(_0xd8348d(0x137))/0x6+-parseInt(_0xd8348d(0x138))/0x7+-parseInt(_0xd8348d(0x136))/0x8*(parseInt(_0xd8348d(0x13d))/0x9)+-parseInt(_0xd8348d(0x13c))/0xa*(-parseInt(_0xd8348d(0x135))/0xb);if(_0x462fb6===_0x209c12)break;else _0x39d90b['push'](_0x39d90b['shift']());}catch(_0x4343fa){_0x39d90b['push'](_0x39d90b['shift']());}}}(a40_0xebfc,0x284e2));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x3092(_0x4c3c6e,_0x4752fc){_0x4c3c6e=_0x4c3c6e-0x134;const _0xebfc94=a40_0xebfc();let _0x3092df=_0xebfc94[_0x4c3c6e];return _0x3092df;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a40_0xebfc(){const _0x17d2c7=['21AnGmgX','640390BLACCP','558261DsysiC','5iZrJuf','1436025hUZDyp','55oYbJYX','8hPjSiB','874098ocFJHz','1298766bLIiyn','96878ihsZzV','56132iHfbZW'];a40_0xebfc=function(){return _0x17d2c7;};return a40_0xebfc();}import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ import{bffList}from"../../commands/bff/list.js";import{bffDetail}from"../../commands/bff/detail.js";import{bffStatus}from"../../commands/bff/status.js";import{bffCreate}from"../../commands/bff/create.js";import{bffPush}from"../../commands/bff/push.js";import{bffPull}from"../../commands/bff/pull.js";import{bffDelete}from"../../commands/bff/delete.js";import{bffLogs}from"../../commands/bff/logs.js";export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];