@lovrabet/rabetbase-cli 2.5.13-beta.1 → 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(_0x3b9989,_0x112ae5){const _0x3d65cc=a20_0x36d2,_0x18227c=_0x3b9989();while(!![]){try{const _0x3c9f67=parseInt(_0x3d65cc(0xa5))/0x1*(-parseInt(_0x3d65cc(0xa6))/0x2)+parseInt(_0x3d65cc(0xa7))/0x3+-parseInt(_0x3d65cc(0xa9))/0x4*(parseInt(_0x3d65cc(0xac))/0x5)+-parseInt(_0x3d65cc(0xab))/0x6*(-parseInt(_0x3d65cc(0xaa))/0x7)+-parseInt(_0x3d65cc(0xad))/0x8+-parseInt(_0x3d65cc(0xa8))/0x9+parseInt(_0x3d65cc(0xae))/0xa;if(_0x3c9f67===_0x112ae5)break;else _0x18227c['push'](_0x18227c['shift']());}catch(_0x4e89b3){_0x18227c['push'](_0x18227c['shift']());}}}(a20_0x36fa,0xe7c3e));function a20_0x36fa(){const _0x55b9d5=['58224erZmDT','79855nkEyZR','6957024tSDmPS','35356810weyaWj','1733129XXUNLJ','2lgXOQl','3099204bXOfca','7488981uZKbbg','124YYiwgf','224udlDRD'];a20_0x36fa=function(){return _0x55b9d5;};return a20_0x36fa();}import{apiList}from'../../commands/api/list.js';import{apiPull}from'../../commands/api/pull.js';import{apiGenerate}from'../../commands/api/generate.js';function a20_0x36d2(_0x405b68,_0x1a7b79){_0x405b68=_0x405b68-0xa5;const _0x36fad7=a20_0x36fa();let _0x36d2c0=_0x36fad7[_0x405b68];return _0x36d2c0;}export const apiDefinitions=[apiList,apiPull,apiGenerate];
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
- const a21_0x403827=a21_0x57bf;function a21_0x349d(){const _0x127c9d=['22596fnEiPT','206798gTenGK','659791VjgbJw','60MZLfQX','list','2017970cYoDvA','1576lZEEZw','cookie','appcode','push','25exCIld','103940dMoLoq','boolean','isDefault','map','1672692KXJwkh','name','List\x20all\x20datasets/models\x20for\x20the\x20configured\x20app(s)','rawFlags','region','appCode','global','3aAzaxn','504704RoqUaM','18pxbUoK'];a21_0x349d=function(){return _0x127c9d;};return a21_0x349d();}(function(_0x1ce7a4,_0x2665bd){const _0x5aac72=a21_0x57bf,_0x466c34=_0x1ce7a4();while(!![]){try{const _0x411c22=-parseInt(_0x5aac72(0xb3))/0x1+parseInt(_0x5aac72(0xb6))/0x2*(-parseInt(_0x5aac72(0xb2))/0x3)+parseInt(_0x5aac72(0xc0))/0x4*(parseInt(_0x5aac72(0xbf))/0x5)+parseInt(_0x5aac72(0xc4))/0x6+parseInt(_0x5aac72(0xb5))/0x7*(parseInt(_0x5aac72(0xbb))/0x8)+-parseInt(_0x5aac72(0xb4))/0x9*(parseInt(_0x5aac72(0xba))/0xa)+parseInt(_0x5aac72(0xb7))/0xb*(parseInt(_0x5aac72(0xb8))/0xc);if(_0x411c22===_0x2665bd)break;else _0x466c34['push'](_0x466c34['shift']());}catch(_0x29d1d0){_0x466c34['push'](_0x466c34['shift']());}}}(a21_0x349d,0x5141f));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';function a21_0x57bf(_0x21c0e9,_0x2f11ba){_0x21c0e9=_0x21c0e9-0xb0;const _0x349df0=a21_0x349d();let _0x57bfae=_0x349df0[_0x21c0e9];return _0x57bfae;}export const apiList={'service':'api','command':a21_0x403827(0xb9),'description':a21_0x403827(0xc6),'risk':'read','requiresAppCode':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a21_0x403827(0xb1),'type':a21_0x403827(0xc1),'description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]}],async 'execute'(_0x5c6d0c){const _0x5e1f07=a21_0x403827,_0x32e724=_0x5c6d0c[_0x5e1f07(0xc7)]['appcode']?String(_0x5c6d0c[_0x5e1f07(0xc7)][_0x5e1f07(0xbd)]):undefined,_0xe66c97=resolveTargetApps(_0x5c6d0c,_0x32e724);if(_0xe66c97){const _0x41bc9d=[];for(const _0x38cef7 of _0xe66c97){const _0x49a957=_0x38cef7[_0x5e1f07(0xbc)]||_0x5c6d0c['cookie'];await initMultiAppEnvironment(_0x38cef7);const {configArray:_0xdbb049}=await fetchModelList(_0x38cef7[_0x5e1f07(0xbd)],_0x49a957);_0x41bc9d[_0x5e1f07(0xbe)](..._0xdbb049[_0x5e1f07(0xc3)](_0xe9962c=>({..._0xe9962c,'_appName':_0x38cef7[_0x5e1f07(0xc5)],'_appCode':_0x38cef7['appcode'],'_region':_0x38cef7[_0x5e1f07(0xc8)],'_isDefault':_0x38cef7[_0x5e1f07(0xc2)]})));}return{'ok':!![],'data':_0x41bc9d};}const {configArray:_0x23d464}=await fetchModelList(_0x5c6d0c[_0x5e1f07(0xb0)],_0x5c6d0c['cookie']);return{'ok':!![],'data':_0x23d464};}};
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_0x1640ac=a22_0x3203;(function(_0x378a55,_0x55139c){const _0x33d262=a22_0x3203,_0xfe2a25=_0x378a55();while(!![]){try{const _0x289d9d=parseInt(_0x33d262(0x143))/0x1*(-parseInt(_0x33d262(0x150))/0x2)+-parseInt(_0x33d262(0x114))/0x3*(parseInt(_0x33d262(0x12a))/0x4)+parseInt(_0x33d262(0x115))/0x5*(-parseInt(_0x33d262(0x13d))/0x6)+-parseInt(_0x33d262(0x132))/0x7+parseInt(_0x33d262(0x151))/0x8+parseInt(_0x33d262(0x118))/0x9*(parseInt(_0x33d262(0x106))/0xa)+parseInt(_0x33d262(0x10f))/0xb;if(_0x289d9d===_0x55139c)break;else _0xfe2a25['push'](_0xfe2a25['shift']());}catch(_0x4af9aa){_0xfe2a25['push'](_0xfe2a25['shift']());}}}(a22_0x5921,0x6bbd1));import a22_0x3c605c from'ora';function a22_0x5921(){const _0x1a7cd1=['string','succeed','apiFilePath','\x20dataset\x20fact(s)\x20and\x20refreshed\x20','\x22\x20was\x20not\x20resolved.','client','validation','Accept\x20an\x20empty\x20model\x20result,\x20or\x20replace\x20a\x20legacy\x20prefixed\x20scaffold;\x20requires\x20--yes','6573237YceURz','\x20is\x20not\x20a\x20valid\x20Rabetbase\x20generated\x20file.\x20Move\x20or\x20repair\x20it\x20before\x20pulling\x20models\x20again.','read','selectedAppName','production','185730IiAzOU','2115210jMhLCX',';\x20created\x20the\x20stable\x20TypeScript\x20entrypoints','modelRuntimePath','9lcggJv','Select\x20the\x20target\x20explicitly\x20with\x20--app\x20<profile>.','map','Output\x20directory\x20(default:\x20','app','split','Failed:\x20','\x20dataset\x20fact(s)\x20and\x20replaced\x20the\x20TypeScript\x20scaffold\x20with\x20','...','currentApp','includes','none','NOT-SET','join','files',')...','models','profiles','20PuxMfl','\x20\x20•\x20','Select\x20a\x20configured\x20app\x20profile\x20or\x20use\x20a\x20separate\x20apiDir.','appCode','isDefault','\x20succeeded,\x20','modelRegistryPath','\x20dataset\x20fact(s)\x20and\x20refreshed\x20model\x20profile\x20\x22','144298lnmSqY','modelProfile','mergedCli','Pulling\x20','force','filter','\x20dataset\x20fact(s)\x20and\x20wrote\x20a\x20scaffold\x20with\x20','exists','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`.','appcode','overwritten','6blVtnE','isUnboundTemplate',';\x20preserved\x20the\x20stable\x20TypeScript\x20entrypoints','boolean','size','needsAgentMerge','1RIOwYp','\x22\x20belongs\x20to\x20multiple\x20app\x20profiles:\x20','env','Pulling\x20API\x20config\x20for\x20','pull','configName','\x20model(s)','project','basename','cookie','find','rawFlags','global','1764332ddsUWP','6282952efUItK','merged','length',';\x20replaced\x20the\x20stable\x20TypeScript\x20entrypoints','sdkRouting','hasAppCode','Done:\x20','yes','Fetched\x20','sdkConfigPath','output','Pull\x20dataset\x20facts\x20and\x20refresh\x20the\x20generated\x20SDK\x20model\x20registry\x20(','defaultApp','bool','modelCount','clientFilePath','name','outputDir','isDefaultConfig','apiDir','action','fail','api','created','Verify\x20the\x20selected\x20profile\x20and\x20review\x20legacy\x20generated\x20files,\x20then\x20rerun\x20with\x20--force\x20--yes.','Internal\x20error:\x20API\x20layout\x20for\x20app\x20profile\x20\x22','6937330WHbIwz'];a22_0x5921=function(){return _0x1a7cd1;};return a22_0x5921();}import{getEnv}from'../../constant/env.js';import{fetchModelList}from'../../core/api-client.js';import{generateApiFile}from'../../api/generate-api-file.js';function a22_0x3203(_0x368d92,_0x1764ed){_0x368d92=_0x368d92-0xee;const _0x59211b=a22_0x5921();let _0x3203d7=_0x59211b[_0x368d92];return _0x3203d7;}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_0x1e24c9 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=a22_0x1640ac(0x13a);function inspectModelRegistry(_0x235358,_0x3b12b3){const _0x1610db=a22_0x1640ac,_0x240bd0=a22_0x1e24c9[_0x1610db(0x125)](_0x235358,MODEL_REGISTRY_FILE_NAME),_0x195c92=existsSync(_0x240bd0);if(!_0x195c92)return{'exists':![],'hasAppCode':![],'isUnboundTemplate':![]};const _0x49d0cf=readModelRegistry(_0x240bd0);if(!_0x49d0cf)throw new Error(MODEL_REGISTRY_FILE_NAME+_0x1610db(0x110));const _0x354b4c=new Set(Object['values'](_0x49d0cf[_0x1610db(0x129)])[_0x1610db(0x11a)](_0x289f32=>_0x289f32[_0x1610db(0x12d)])[_0x1610db(0x137)](_0x3b4620=>_0x3b4620!==_0x1610db(0x124)));return{'exists':!![],'hasAppCode':!!_0x3b12b3&&_0x354b4c['has'](_0x3b12b3),'isUnboundTemplate':_0x354b4c[_0x1610db(0x141)]===0x0};}function toPullData(_0x1252a4){const _0x333bb0=a22_0x1640ac;return{'appCode':_0x1252a4[_0x333bb0(0x12d)],'configName':_0x1252a4[_0x333bb0(0x148)],'isDefaultConfig':_0x1252a4[_0x333bb0(0xfe)],'models':_0x1252a4[_0x333bb0(0x128)],'sdkRouting':_0x1252a4[_0x333bb0(0xf0)],'files':_0x1252a4[_0x333bb0(0x126)],'needsAgentMerge':_0x1252a4[_0x333bb0(0x142)],'needsProjectUpgrade':_0x1252a4['needsProjectUpgrade'],'apiFilePath':_0x1252a4[_0x333bb0(0x109)],'clientFilePath':_0x1252a4['clientFilePath'],'sdkConfigPath':_0x1252a4['sdkConfigPath'],'modelRegistryPath':_0x1252a4['modelRegistryPath'],'modelRuntimePath':_0x1252a4[_0x333bb0(0x117)],'modelProfile':_0x1252a4[_0x333bb0(0x133)],'datasetCount':_0x1252a4['modelCount'],'modelCount':_0x1252a4[_0x333bb0(0xfa)]};}function describePull(_0x4b95a1){const _0xc897b0=a22_0x1640ac,_0x29ad36=a22_0x1e24c9[_0xc897b0(0x14b)](_0x4b95a1[_0xc897b0(0xf5)]);if(_0x4b95a1['modelProfile']){const _0x32bcc2=_0xc897b0(0xf4)+_0x4b95a1[_0xc897b0(0xfa)]+_0xc897b0(0x131)+_0x4b95a1['modelProfile']+'\x22';if(_0x4b95a1[_0xc897b0(0x142)])return _0x32bcc2+'.\x20'+EXISTING_TS_HINT;if(_0x4b95a1[_0xc897b0(0x126)][_0xc897b0(0x102)][_0xc897b0(0x100)]===_0xc897b0(0x13c)||_0x4b95a1[_0xc897b0(0x126)][_0xc897b0(0x10c)]['action']===_0xc897b0(0x13c))return _0x32bcc2+_0xc897b0(0xef);if(_0x4b95a1[_0xc897b0(0x126)][_0xc897b0(0x102)][_0xc897b0(0x100)]===_0xc897b0(0x103)||_0x4b95a1['files'][_0xc897b0(0x10c)]['action']===_0xc897b0(0x103))return _0x32bcc2+_0xc897b0(0x116);return _0x32bcc2+_0xc897b0(0x13f);}if(_0x4b95a1[_0xc897b0(0x142)])return'Fetched\x20'+_0x4b95a1[_0xc897b0(0xfa)]+_0xc897b0(0x10a)+_0x29ad36+'.\x20'+EXISTING_TS_HINT;if(_0x4b95a1['files'][_0xc897b0(0x102)][_0xc897b0(0x100)]===_0xc897b0(0x13c)||_0x4b95a1[_0xc897b0(0x126)][_0xc897b0(0x10c)][_0xc897b0(0x100)]===_0xc897b0(0x13c))return _0xc897b0(0xf4)+_0x4b95a1['modelCount']+_0xc897b0(0x11f)+_0x4b95a1['modelCount']+_0xc897b0(0x149);return _0xc897b0(0xf4)+_0x4b95a1['modelCount']+_0xc897b0(0x138)+_0x4b95a1[_0xc897b0(0xfa)]+_0xc897b0(0x149);}export const apiPull={'service':a22_0x1640ac(0x102),'command':a22_0x1640ac(0x147),'description':a22_0x1640ac(0xf7)+DEFAULT_API_DIR+'/)','risk':a22_0x1640ac(0x111),'requiresAppCode':!![],'hasFormat':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a22_0x1640ac(0xf6),'type':a22_0x1640ac(0x107),'description':a22_0x1640ac(0x11b)+DEFAULT_API_DIR+'/)'},{'name':a22_0x1640ac(0x14f),'type':a22_0x1640ac(0x140),'description':'Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','default':![]},{'name':'force','type':a22_0x1640ac(0x140),'description':a22_0x1640ac(0x10e),'default':![]}],async 'validate'(_0xd15ba4){const _0x22ec17=a22_0x1640ac;if(_0xd15ba4[_0x22ec17(0xf9)]('force')&&!_0xd15ba4[_0x22ec17(0xf9)](_0x22ec17(0xf3)))throw CliErrors[_0x22ec17(0x10d)]('--force\x20requires\x20--yes\x20because\x20it\x20may\x20remove\x20existing\x20model\x20facts\x20or\x20replace\x20a\x20legacy\x20generated\x20scaffold.',_0x22ec17(0x104));},async 'execute'(_0x304ce5){const _0x24559a=a22_0x1640ac,_0x12553=_0x304ce5['rawFlags'][_0x24559a(0x13b)]?String(_0x304ce5[_0x24559a(0x14e)][_0x24559a(0x13b)]):undefined,_0x470a33=_0x304ce5['str'](_0x24559a(0xf6))||undefined,_0x5c0380=_0x304ce5[_0x24559a(0xf9)](_0x24559a(0x136)),_0x3b7938=resolveTargetApps(_0x304ce5,_0x12553),_0x38e8b8=_0x304ce5[_0x24559a(0xf9)](_0x24559a(0x14f))?_0x24559a(0x152):_0x24559a(0x14a),_0x1611c2=getMultiAppConfigs(_0x38e8b8),_0x60cc4=_0x1e5367=>_0x1e5367[_0x24559a(0xff)]||_0x470a33||_0x304ce5[_0x24559a(0xff)]||DEFAULT_API_DIR,_0x535a1b=_0x1611c2?resolveApiProfileLayouts(_0x1611c2,_0x60cc4):undefined;let _0x33af3d=_0x3b7938;if(!_0x33af3d&&_0x1611c2){const _0x1f5661=_0x304ce5['selectedAppName']?_0x1611c2[_0x24559a(0x14d)](_0x3146fe=>_0x3146fe[_0x24559a(0xfc)]===_0x304ce5[_0x24559a(0x112)]):undefined,_0x24978e=_0x1611c2[_0x24559a(0x137)](_0x1b12d0=>_0x1b12d0[_0x24559a(0x13b)]===_0x304ce5[_0x24559a(0x12d)]);if(!_0x1f5661&&_0x24978e[_0x24559a(0xee)]>0x1)throw CliErrors[_0x24559a(0x10d)]('AppCode\x20\x22'+_0x304ce5['appCode']+_0x24559a(0x144)+_0x24978e['map'](_0x4e0f5f=>_0x4e0f5f[_0x24559a(0xfc)])[_0x24559a(0x125)](',\x20')+'.',_0x24559a(0x119));const _0x7b1d3a=_0x1f5661??_0x24978e[0x0];if(_0x7b1d3a)_0x33af3d=[_0x7b1d3a];}if(_0x33af3d){let _0x35383e=0x0,_0x55359e=0x0;const _0x2abbcb=[],_0x417eac=_0x535a1b??resolveApiProfileLayouts(_0x33af3d,_0x60cc4);for(const _0x40bb96 of _0x33af3d){const _0x9c5a98=_0x40bb96[_0x24559a(0x14c)]||_0x304ce5[_0x24559a(0x14c)],_0x5641dc=_0x40bb96[_0x24559a(0x145)]||_0x24559a(0x113);await initMultiAppEnvironment(_0x40bb96);const _0x102fa7=_0x417eac[_0x24559a(0x14d)](_0x2990dd=>_0x2990dd['app'][_0x24559a(0xfc)]===_0x40bb96[_0x24559a(0xfc)]);if(!_0x102fa7)throw new Error(_0x24559a(0x105)+_0x40bb96[_0x24559a(0xfc)]+_0x24559a(0x10b));const _0xa064b1=getRegistryGroup(_0x417eac,_0x102fa7),_0x416023=_0x102fa7[_0x24559a(0xfd)],_0x1b0bea=_0xa064b1?'':_0x40bb96['isDefault']?'':_0x40bb96[_0x24559a(0xfc)]||_0x40bb96[_0x24559a(0x13b)],_0x4d91c4=_0xa064b1?.[_0x24559a(0x14d)](_0x2132ff=>_0x2132ff[_0x24559a(0x11c)][_0x24559a(0x12e)])??_0xa064b1?.[0x0];if(_0xa064b1)inspectModelRegistry(_0x416023);const _0x55e90d=a22_0x3c605c(_0x24559a(0x135)+_0x40bb96[_0x24559a(0xfc)]+'\x20('+_0x40bb96[_0x24559a(0x13b)]+_0x24559a(0x127))['start']();try{const {configArray:_0x16ed1c}=await fetchModelList(_0x40bb96['appcode'],_0x9c5a98),_0x1c1d2a=await generateApiFile(_0x16ed1c,_0x1b0bea,_0x40bb96[_0x24559a(0x13b)],_0x40bb96['isDefault'],_0x5641dc,_0x416023,_0x40bb96['name'],getSdkClientRoutingConfig(),{'overwriteTypescript':_0xa064b1?![]:_0x5c0380,'allowEmptyModelReplacement':_0xa064b1?_0x5c0380:undefined,'scaffoldMode':_0xa064b1?_0x24559a(0x123):undefined,..._0xa064b1?{'modelProfile':{'name':_0x40bb96[_0x24559a(0xfc)],'defaultName':_0x4d91c4[_0x24559a(0x11c)][_0x24559a(0xfc)],'runtimeDomain':getRuntimeDomain()}}:{}});_0x55e90d[_0x24559a(0x108)](_0x40bb96[_0x24559a(0xfc)]+':\x20'+describePull(_0x1c1d2a)),writeCliSideChannelLine(_0x24559a(0x12b)+_0x1c1d2a[_0x24559a(0xf5)]),writeCliSideChannelLine(_0x24559a(0x12b)+_0x1c1d2a[_0x24559a(0x109)]),writeCliSideChannelLine(_0x24559a(0x12b)+_0x1c1d2a[_0x24559a(0xfb)]),_0x1c1d2a['modelRegistryPath']&&writeCliSideChannelLine(_0x24559a(0x12b)+_0x1c1d2a[_0x24559a(0x130)]),_0x1c1d2a[_0x24559a(0x117)]&&writeCliSideChannelLine(_0x24559a(0x12b)+_0x1c1d2a[_0x24559a(0x117)]),_0x2abbcb['push'](toPullData(_0x1c1d2a)),_0x35383e++;}catch(_0x3ad150){_0x55e90d[_0x24559a(0x101)](_0x40bb96[_0x24559a(0xfc)]+':\x20'+(_0x3ad150 instanceof Error?_0x3ad150['message']:String(_0x3ad150))),_0x55359e++;}}writeCliSideChannelLine('');if(_0x55359e>0x0)writeCliSideChannelLine('!\x20'+_0x55359e+'\x20app(s)\x20failed');return{'ok':_0x55359e===0x0,'message':_0x24559a(0xf2)+_0x35383e+_0x24559a(0x12f)+_0x55359e+'\x20failed','data':{'apps':_0x2abbcb,'succeeded':_0x35383e,'failed':_0x55359e}};}const _0x122408=_0x12553&&_0x12553[_0x24559a(0x122)]('-')?_0x12553[_0x24559a(0x11d)]('-')['slice'](0x1)['join']('-'):'',_0x22e393=_0x470a33||_0x304ce5[_0x24559a(0xff)]||DEFAULT_API_DIR,_0x59bbb6=!_0x12553,_0x1908b2=inspectModelRegistry(_0x22e393,_0x304ce5[_0x24559a(0x12d)]),_0x5149ee=_0x304ce5['selectedAppName']||_0x304ce5[_0x24559a(0x134)]?.[_0x24559a(0x121)]||_0x304ce5[_0x24559a(0x134)]?.[_0x24559a(0xf8)]||'default';if(_0x1908b2[_0x24559a(0x139)]&&!_0x1908b2[_0x24559a(0xf1)]&&!_0x1908b2[_0x24559a(0x13e)])throw CliErrors[_0x24559a(0x10d)](MODEL_REGISTRY_FILE_NAME+'\x20does\x20not\x20contain\x20AppCode\x20\x22'+_0x304ce5[_0x24559a(0x12d)]+'\x22.',_0x24559a(0x12c));const _0x21b157=a22_0x3c605c(_0x24559a(0x146)+_0x304ce5[_0x24559a(0x12d)]+_0x24559a(0x120))['start']();try{const {configArray:_0x5d58ae}=await fetchModelList(_0x304ce5[_0x24559a(0x12d)],_0x304ce5[_0x24559a(0x14c)]),_0x2049d0=await generateApiFile(_0x5d58ae,_0x122408,_0x304ce5['appCode'],_0x59bbb6,getEnv(),_0x22e393,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':_0x1908b2['exists']?![]:_0x5c0380,'allowEmptyModelReplacement':_0x1908b2[_0x24559a(0x139)]?_0x5c0380:undefined,'scaffoldMode':_0x1908b2['exists']?_0x24559a(0x123):undefined,..._0x1908b2[_0x24559a(0xf1)]||_0x1908b2[_0x24559a(0x13e)]||!_0x1908b2['exists']&&_0x5c0380?{'modelProfile':{'name':_0x5149ee,'defaultName':_0x304ce5[_0x24559a(0x134)]?.[_0x24559a(0xf8)]??_0x5149ee,'runtimeDomain':getRuntimeDomain()}}:{}});return _0x21b157[_0x24559a(0x108)](describePull(_0x2049d0)),writeCliSideChannelLine('\x20\x20•\x20'+_0x2049d0[_0x24559a(0xf5)]),writeCliSideChannelLine(_0x24559a(0x12b)+_0x2049d0[_0x24559a(0x109)]),writeCliSideChannelLine(_0x24559a(0x12b)+_0x2049d0[_0x24559a(0xfb)]),_0x2049d0[_0x24559a(0x130)]&&writeCliSideChannelLine(_0x24559a(0x12b)+_0x2049d0[_0x24559a(0x130)]),_0x2049d0['modelRuntimePath']&&writeCliSideChannelLine(_0x24559a(0x12b)+_0x2049d0['modelRuntimePath']),{'ok':!![],'message':describePull(_0x2049d0),'data':toPullData(_0x2049d0)};}catch(_0x57c31a){_0x21b157[_0x24559a(0x101)](_0x24559a(0x11e)+(_0x57c31a instanceof Error?_0x57c31a['message']:String(_0x57c31a)));throw _0x57c31a;}}};
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_0x1c35(){const _0x316a54=['selectedAppName','9936108uJlFor','filter','3ADYMmY','1822absQNK','204235HVLiVb','name','1502eIXSwA','join','3678731TJgXpf','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','global','length','App\x20\x22','validation','bool','map','4512018OKlYZX','1587692rvWtwa','9464096kEUIOH'];a23_0x1c35=function(){return _0x316a54;};return a23_0x1c35();}(function(_0x11c23d,_0x40fb8a){const _0x19af9b=a23_0x3910,_0x4c82e8=_0x11c23d();while(!![]){try{const _0xe69f47=-parseInt(_0x19af9b(0x77))/0x1*(parseInt(_0x19af9b(0x74))/0x2)+parseInt(_0x19af9b(0x73))/0x3*(-parseInt(_0x19af9b(0x82))/0x4)+parseInt(_0x19af9b(0x75))/0x5+parseInt(_0x19af9b(0x81))/0x6+-parseInt(_0x19af9b(0x79))/0x7+parseInt(_0x19af9b(0x83))/0x8+parseInt(_0x19af9b(0x71))/0x9;if(_0xe69f47===_0x40fb8a)break;else _0x4c82e8['push'](_0x4c82e8['shift']());}catch(_0x1e30d0){_0x4c82e8['push'](_0x4c82e8['shift']());}}}(a23_0x1c35,0xc0a68));import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';function a23_0x3910(_0x1b0a2e,_0x105801){_0x1b0a2e=_0x1b0a2e-0x71;const _0x1c3528=a23_0x1c35();let _0x3910a5=_0x1c3528[_0x1b0a2e];return _0x3910a5;}export function resolveTargetApps(_0x50e62c,_0x184f74){const _0xe2cc18=a23_0x3910;if(_0x184f74)return null;const _0x54ec90=_0x50e62c[_0xe2cc18(0x7f)](_0xe2cc18(0x7b))?'merged':'project';let _0x210d51=getMultiAppConfigs(_0x54ec90);if(!_0x210d51||_0x210d51[_0xe2cc18(0x7c)]===0x0)return null;if(_0x50e62c[_0xe2cc18(0x84)]){const _0x4118ac=_0x210d51[_0xe2cc18(0x72)](_0x246337=>_0x246337['name']===_0x50e62c[_0xe2cc18(0x84)]);if(_0x4118ac[_0xe2cc18(0x7c)]===0x0){const _0x88df33=_0x210d51[_0xe2cc18(0x80)](_0x5efb59=>_0x5efb59[_0xe2cc18(0x76)])[_0xe2cc18(0x78)](',\x20');throw CliErrors[_0xe2cc18(0x7e)](_0xe2cc18(0x7d)+_0x50e62c['selectedAppName']+_0xe2cc18(0x7a)+_0x88df33);}_0x210d51=_0x4118ac;}return _0x210d51;}
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
- function a24_0x242c(){const _0x1ece40=['107056mTXbqk','63mYvGje','Application\x20vipDeploy\x20is\x20unknown:\x20the\x20platform\x20did\x20not\x20return\x20a\x20boolean\x20flag.','Platform\x20deployment\x20sync\x20flag\x20read;\x20automatic\x20sync,\x20runtime\x20login\x20and\x20sync\x20progress\x20are\x20not\x20assessed.','5JQciLF','654woijPz','6229668XLlBhl','appCode','89201GhYhHT','693430JXjBrM','11knFRsN','1094440wNJodn','12DaVGMK','445042akFBUs','1981824AnUTJw','Read\x20the\x20platform\x27s\x20vipDeploy\x20flag\x20for\x20independent\x20deployment\x20data\x20sync','read'];a24_0x242c=function(){return _0x1ece40;};return a24_0x242c();}function a24_0x3d1f(_0x178d57,_0x209f4a){_0x178d57=_0x178d57-0xc2;const _0x242c79=a24_0x242c();let _0x3d1f53=_0x242c79[_0x178d57];return _0x3d1f53;}const a24_0x2b4671=a24_0x3d1f;(function(_0x47243f,_0x2edebf){const _0x17be74=a24_0x3d1f,_0xeff076=_0x47243f();while(!![]){try{const _0x3e0d69=parseInt(_0x17be74(0xcf))/0x1+parseInt(_0x17be74(0xc2))/0x2*(parseInt(_0x17be74(0xd2))/0x3)+-parseInt(_0x17be74(0xc6))/0x4*(-parseInt(_0x17be74(0xca))/0x5)+parseInt(_0x17be74(0xcb))/0x6*(-parseInt(_0x17be74(0xce))/0x7)+parseInt(_0x17be74(0xc3))/0x8+-parseInt(_0x17be74(0xc7))/0x9*(-parseInt(_0x17be74(0xd1))/0xa)+-parseInt(_0x17be74(0xd0))/0xb*(parseInt(_0x17be74(0xcc))/0xc);if(_0x3e0d69===_0x2edebf)break;else _0xeff076['push'](_0xeff076['shift']());}catch(_0xe8b060){_0xeff076['push'](_0xeff076['shift']());}}}(a24_0x242c,0xaecd4));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getAppVipDeploy}from'../../core/api-client.js';export const appDetailDefinition={'service':'app','command':'detail','description':a24_0x2b4671(0xc4),'risk':a24_0x2b4671(0xc5),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x5728d4){const _0x5e7cef=a24_0x2b4671,_0x11cafc=await getAppVipDeploy(_0x5728d4[_0x5e7cef(0xcd)],_0x5728d4['cookie']);return{'ok':!![],'data':{'vipDeploy':_0x11cafc??null},'message':_0x11cafc===undefined?_0x5e7cef(0xc8):_0x5e7cef(0xc9)};}};
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(_0x3cd93a,_0x4c1f87){const _0x3a5a0c=a25_0x40b5,_0x16bf16=_0x3cd93a();while(!![]){try{const _0x4f3135=parseInt(_0x3a5a0c(0x10d))/0x1+parseInt(_0x3a5a0c(0x110))/0x2*(-parseInt(_0x3a5a0c(0x10b))/0x3)+-parseInt(_0x3a5a0c(0x113))/0x4*(-parseInt(_0x3a5a0c(0x112))/0x5)+-parseInt(_0x3a5a0c(0x111))/0x6*(-parseInt(_0x3a5a0c(0x10e))/0x7)+parseInt(_0x3a5a0c(0x10c))/0x8+-parseInt(_0x3a5a0c(0x109))/0x9+parseInt(_0x3a5a0c(0x10f))/0xa*(-parseInt(_0x3a5a0c(0x10a))/0xb);if(_0x4f3135===_0x4c1f87)break;else _0x16bf16['push'](_0x16bf16['shift']());}catch(_0x45aff1){_0x16bf16['push'](_0x16bf16['shift']());}}}(a25_0x4330,0xef5d6));function a25_0x4330(){const _0x2d2d97=['356326HMcYfd','35ZAXkuv','50dYjwIT','4MwXxwZ','703338lmEoNP','235QmHFFA','123416LWgdFF','1060164GMMTFc','3318304HvnxxC','2194251pEyxKk','13414472RIhUOG'];a25_0x4330=function(){return _0x2d2d97;};return a25_0x4330();}import{appListDefinition}from'../../commands/app/list.js';import{appMembersListDefinition}from'../../commands/app/members-list.js';import{appDetailDefinition}from'../../commands/app/detail.js';function a25_0x40b5(_0x2a6921,_0x1d52c0){_0x2a6921=_0x2a6921-0x109;const _0x4330b6=a25_0x4330();let _0x40b5bd=_0x4330b6[_0x2a6921];return _0x40b5bd;}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_0x8b3c87=a26_0x1536;(function(_0x3edaca,_0x1fff6b){const _0x84f546=a26_0x1536,_0x30a960=_0x3edaca();while(!![]){try{const _0x5a637a=parseInt(_0x84f546(0x1e3))/0x1*(-parseInt(_0x84f546(0x1f3))/0x2)+parseInt(_0x84f546(0x202))/0x3+-parseInt(_0x84f546(0x1ef))/0x4*(parseInt(_0x84f546(0x1fc))/0x5)+parseInt(_0x84f546(0x1ec))/0x6+parseInt(_0x84f546(0x20a))/0x7+parseInt(_0x84f546(0x1f0))/0x8*(-parseInt(_0x84f546(0x1f7))/0x9)+-parseInt(_0x84f546(0x1fe))/0xa*(-parseInt(_0x84f546(0x1e4))/0xb);if(_0x5a637a===_0x1fff6b)break;else _0x30a960['push'](_0x30a960['shift']());}catch(_0x2ec4cf){_0x30a960['push'](_0x30a960['shift']());}}}(a26_0x242a,0x24afd));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(_0x4e619a,_0x4a8920,_0x35abf4){const _0x260f16=a26_0x1536,_0x42b950=[],_0x4820e8=_0x4e619a[_0x260f16(0x1f6)]&&typeof _0x4e619a['apps']===_0x260f16(0x1ff)?_0x4e619a[_0x260f16(0x1f6)]:{},_0xdfdebd=_0x4e619a['defaultApp']||undefined,_0x2221dd=_0xdfdebd??(Object[_0x260f16(0x20b)](_0x4820e8)['length']===0x1?Object['keys'](_0x4820e8)[0x0]:undefined);for(const [_0x50f553,_0x3549f1]of Object['entries'](_0x4820e8)){if(!_0x3549f1||typeof _0x3549f1!=='object'||!_0x3549f1[_0x260f16(0x1e2)])continue;const _0x4b07f3=resolveEffectiveRegion({'appRegion':_0x3549f1[_0x260f16(0x200)],'projectRegion':_0x4a8920===_0x260f16(0x1e6)?_0x4e619a['region']:undefined,'globalRegion':_0x4a8920==='global'?_0x4e619a[_0x260f16(0x200)]:_0x35abf4,'appName':_0x50f553});_0x42b950[_0x260f16(0x203)]({'name':_0x50f553,'appcode':_0x3549f1[_0x260f16(0x1e2)],'named':!![],'definedIn':_0x4a8920,'isDefault':_0x50f553===_0x2221dd,...buildAppProfileListFields(_0x3549f1),'effectiveRegion':_0x4b07f3[_0x260f16(0x200)],'regionSource':_0x4b07f3[_0x260f16(0x1fb)]});}return _0x42b950;}function a26_0x242a(){const _0x452eb8=['103SGyHME','11cRErlj','list','project','global','name','merged','isCurrent','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','852174iujsPb','hasOwnProperty','length','4kToWRk','16fnRymr','projectConfig','\x20in\x20','4946FCjHQM','optional','globalConfig','apps','1105452EkmtOK','boolean','call','read','source','907035AvzEnn','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','2278670yqDUgX','object','region','defaultApp','864426cVYicK','push','bool','globalPath','No\x20apps\x20configured','remote','projectPath','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','1218091SLPPop','keys','\x20config','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','find','entries','map','validation','appcode'];a26_0x242a=function(){return _0x452eb8;};return a26_0x242a();}function a26_0x1536(_0x5cb6b1,_0x502cd5){_0x5cb6b1=_0x5cb6b1-0x1de;const _0x242acc=a26_0x242a();let _0x1536db=_0x242acc[_0x5cb6b1];return _0x1536db;}function buildMergedItems(_0x54a793,_0x47947e){const _0x5a04f3=a26_0x1536,{apps:apps={}}=_0x54a793,_0x50776e=_0x54a793[_0x5a04f3(0x201)],_0x3b98fb=_0x50776e??(Object[_0x5a04f3(0x20b)](apps)[_0x5a04f3(0x1ee)]===0x1?Object['keys'](apps)[0x0]:undefined),_0x250408=_0x47947e['globalConfig']['apps']&&typeof _0x47947e['globalConfig'][_0x5a04f3(0x1f6)]===_0x5a04f3(0x1ff)?_0x47947e['globalConfig']['apps']:{},_0x33fc10=_0x47947e['projectConfig'][_0x5a04f3(0x1f6)]&&typeof _0x47947e[_0x5a04f3(0x1f1)]['apps']===_0x5a04f3(0x1ff)?_0x47947e['projectConfig'][_0x5a04f3(0x1f6)]:{},_0x399828=Object[_0x5a04f3(0x1df)](apps),_0x15f348=_0x399828[_0x5a04f3(0x1e0)](([_0x476538,_0x4a07b9])=>{const _0x36407f=_0x5a04f3,_0x4bfa91=appDefinedIn(_0x476538,_0x250408,_0x33fc10),_0x44332d=Object['prototype'][_0x36407f(0x1ed)][_0x36407f(0x1f9)](_0x33fc10,_0x476538),_0x4bf1bf=resolveEffectiveRegion({'appRegion':_0x4a07b9['region'],'projectRegion':_0x44332d?_0x47947e['projectConfig']['region']:undefined,'globalRegion':_0x47947e[_0x36407f(0x1f5)]['region'],'mergedRegion':_0x54a793[_0x36407f(0x200)],'appName':_0x476538});return{'name':_0x476538,'appcode':_0x4a07b9[_0x36407f(0x1e2)],'named':!![],'definedIn':_0x4bfa91,'isDefault':_0x476538===_0x3b98fb,...buildAppProfileListFields(_0x4a07b9),'effectiveRegion':_0x4bf1bf[_0x36407f(0x200)],'regionSource':_0x4bf1bf[_0x36407f(0x1fb)]};});return _0x15f348;}function validateAppListFlags(_0x20da36){const _0x27b3f3=a26_0x1536;if(!_0x20da36[_0x27b3f3(0x204)](_0x27b3f3(0x207)))return;if(!_0x20da36[_0x27b3f3(0x204)](_0x27b3f3(0x1e7))&&!_0x20da36[_0x27b3f3(0x204)](_0x27b3f3(0x1e6)))return;throw CliErrors[_0x27b3f3(0x1e1)]('`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.',_0x27b3f3(0x1eb));}async function execute(_0x28fe7a){const _0x51f15d=a26_0x1536;validateAppListFlags(_0x28fe7a);if(_0x28fe7a['bool'](_0x51f15d(0x207)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x28fe7a)};const _0x2d24a9=_0x28fe7a[_0x51f15d(0x204)](_0x51f15d(0x1e7)),_0x432285=_0x28fe7a['bool'](_0x51f15d(0x1e6)),_0x494542=_0x2d24a9?_0x51f15d(0x1e7):_0x432285?_0x51f15d(0x1e6):_0x51f15d(0x1e9),{config:_0x36b247,layers:_0x2f066f}=readRawConfigWithLayers(),_0x291780=resolveDefaultAppSource(_0x2f066f),{defaultApp:_0x45fe24}=_0x36b247;let _0x126cfd,_0x2e84a7;switch(_0x494542){case _0x51f15d(0x1e7):_0x126cfd=buildItemsFromLayer(_0x2f066f['globalConfig'],_0x51f15d(0x1e7)),_0x2e84a7=_0x2f066f['globalPath'];break;case _0x51f15d(0x1e6):_0x126cfd=buildItemsFromLayer(_0x2f066f[_0x51f15d(0x1f1)],_0x51f15d(0x1e6),_0x2f066f[_0x51f15d(0x1f5)][_0x51f15d(0x200)]),_0x2e84a7=_0x2f066f['projectPath'];break;default:_0x126cfd=buildMergedItems(_0x36b247,_0x2f066f);break;}enrichAppListItemsWithMergedSelection(_0x126cfd,_0x28fe7a['mergedCli']);if(_0x126cfd[_0x51f15d(0x1ee)]===0x0){const _0x26d90b=_0x494542==='merged'?'':_0x51f15d(0x1f2)+_0x494542+_0x51f15d(0x20c);return{'ok':!![],'data':[],'message':_0x51f15d(0x206)+_0x26d90b+'.\x20Use\x20`'+CLI_BIN_NAME+_0x51f15d(0x1fd)};}const _0x550292=_0x126cfd[_0x51f15d(0x1de)](_0x39905b=>_0x39905b[_0x51f15d(0x1ea)]===!![]),_0x437e81=_0x45fe24??_0x550292?.[_0x51f15d(0x1e8)]??null,_0x3b1c42=_0x494542==='merged'?{'globalPath':_0x2f066f[_0x51f15d(0x205)]??null,'projectPath':_0x2f066f[_0x51f15d(0x208)]??null,'defaultApp':_0x437e81,'defaultAppSource':_0x45fe24!=null?_0x291780:null}:{'scope':_0x494542,'configPath':_0x2e84a7??null};return{'ok':!![],'data':{'items':_0x126cfd,'meta':_0x3b1c42}};}export const appListDefinition={'service':'app','command':a26_0x8b3c87(0x1e5),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a26_0x8b3c87(0x1fa),'auth':a26_0x8b3c87(0x1f4),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a26_0x8b3c87(0x207),'type':a26_0x8b3c87(0x1f8),'description':a26_0x8b3c87(0x209),'default':![]},{'name':a26_0x8b3c87(0x1e7),'type':a26_0x8b3c87(0x1f8),'description':a26_0x8b3c87(0x20d),'default':![]},{'name':a26_0x8b3c87(0x1e6),'type':a26_0x8b3c87(0x1f8),'description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],async 'validate'(_0x479b58){validateAppListFlags(_0x479b58);},'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_0x44823c=a27_0x5e79;(function(_0x2de3a5,_0x2c68b4){const _0xfe9f78=a27_0x5e79,_0x51d671=_0x2de3a5();while(!![]){try{const _0xe4e582=parseInt(_0xfe9f78(0x1e6))/0x1*(-parseInt(_0xfe9f78(0x1f0))/0x2)+-parseInt(_0xfe9f78(0x1ef))/0x3*(-parseInt(_0xfe9f78(0x1ec))/0x4)+parseInt(_0xfe9f78(0x1e4))/0x5+parseInt(_0xfe9f78(0x1f1))/0x6+parseInt(_0xfe9f78(0x1e5))/0x7+-parseInt(_0xfe9f78(0x1e2))/0x8+-parseInt(_0xfe9f78(0x1e7))/0x9*(parseInt(_0xfe9f78(0x1e8))/0xa);if(_0xe4e582===_0x2c68b4)break;else _0x51d671['push'](_0x51d671['shift']());}catch(_0x2a204e){_0x51d671['push'](_0x51d671['shift']());}}}(a27_0xf2c9,0x504bd));function a27_0xf2c9(){const _0x3341b3=['members-list','456050ptYbbj','2339197mfuvTm','4aMfUiu','9xFSCdC','2687060aESTrT','List\x20application\x20members\x20with\x20their\x20role\x20memberships','app','Found\x20','86876uXcmRN','appCode','length','57VUbSVi','84278cHXPBi','1317480qHVoDe','\x20application\x20member(s)','2331736baLlkk'];a27_0xf2c9=function(){return _0x3341b3;};return a27_0xf2c9();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a27_0x5e79(_0x3a7ed7,_0x57453b){_0x3a7ed7=_0x3a7ed7-0x1e1;const _0xf2c989=a27_0xf2c9();let _0x5e79b2=_0xf2c989[_0x3a7ed7];return _0x5e79b2;}import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a27_0x44823c(0x1ea),'command':a27_0x44823c(0x1e3),'description':a27_0x44823c(0x1e9),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x39c592){const _0x4ab070=a27_0x44823c,_0xcb62ba=projectAppMembers(await listRoleUsers(_0x39c592[_0x4ab070(0x1ed)]));return{'ok':!![],'data':{'appCode':_0x39c592[_0x4ab070(0x1ed)],'items':_0xcb62ba,'totalCount':_0xcb62ba['length']},'message':_0x4ab070(0x1eb)+_0xcb62ba[_0x4ab070(0x1ee)]+_0x4ab070(0x1e1)};}};
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(_0x35c0ed,_0x155eb5){const _0x25eef4=a28_0x31d2,_0xe3a401=_0x35c0ed();while(!![]){try{const _0x104868=parseInt(_0x25eef4(0x1aa))/0x1*(-parseInt(_0x25eef4(0x1b0))/0x2)+parseInt(_0x25eef4(0x1ab))/0x3*(-parseInt(_0x25eef4(0x1a7))/0x4)+-parseInt(_0x25eef4(0x1a9))/0x5*(parseInt(_0x25eef4(0x1a6))/0x6)+-parseInt(_0x25eef4(0x1b1))/0x7*(parseInt(_0x25eef4(0x1ad))/0x8)+parseInt(_0x25eef4(0x1ac))/0x9+-parseInt(_0x25eef4(0x1b4))/0xa+parseInt(_0x25eef4(0x1b3))/0xb;if(_0x104868===_0x155eb5)break;else _0xe3a401['push'](_0xe3a401['shift']());}catch(_0xb48e93){_0xe3a401['push'](_0xe3a401['shift']());}}}(a28_0x54ab,0xd432c));import{listRemoteApps}from'../../core/api-client.js';function a28_0x54ab(){const _0x2e52d8=['map','cookie','1276jwWTmJ','7XDrvTZ','platform','41949039BbjxKl','4978540myhWjI','appDesc','6aDHYAi','4NbiiuP','appName','2500285UCKcoJ','2213hmvcjH','2444889ujVQGF','15395652FjwQdm','11441960fqzHXS'];a28_0x54ab=function(){return _0x2e52d8;};return a28_0x54ab();}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a28_0x31d2(_0x219174,_0xf037d){_0x219174=_0x219174-0x1a6;const _0x54ab61=a28_0x54ab();let _0x31d2b4=_0x54ab61[_0x219174];return _0x31d2b4;}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x465a06){const _0x5e8c2b=a28_0x31d2,_0x2e3ab3=_0x465a06[_0x5e8c2b(0x1af)]||getCookie();if(!_0x2e3ab3)throw CliErrors['authRequired']();return _0x2e3ab3;}export async function listRemoteAppDirectory(_0x5e2899){const _0x1e7491=a28_0x31d2,_0xff3d96=await withActiveCookie(resolveCookie(_0x5e2899),()=>listRemoteApps());return{'items':_0xff3d96[_0x1e7491(0x1ae)](_0x31dffa=>({..._0x31dffa['id']!=null?{'id':_0x31dffa['id']}:{},'appCode':_0x31dffa['appCode'],'appName':_0x31dffa[_0x1e7491(0x1a8)],..._0x31dffa[_0x1e7491(0x1b5)]!=null?{'appDesc':_0x31dffa[_0x1e7491(0x1b5)]}:{}})),'meta':{'source':_0x1e7491(0x1b2)}};}
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 a29_0x4223(){const _0x296265=['apps','roleCode','keys','displayName','1190YYSvSA','currentApp','sort','921185aMYMOG','12sHcoml','set','values','projectConfig','7lzwyZP','ACTIVE','8311672vyCCyY','hasOwnProperty','call','defaultApp','membershipStatus','PENDING','object','length','roleName','isCurrent','1539055SLDBgj','2055874MLEBZz','userList','status','roleId','name','appcode','477684ZoFyHc','userId','username','roleKeys','nickname','trim','221441QeOodz','3605256QjojnB','both','roles','project','has','prototype','global','18eVvJiZ','roleType','appCode','named','globalConfig','applyUserList','\x20(global)','map'];a29_0x4223=function(){return _0x296265;};return a29_0x4223();}(function(_0x3b25c9,_0x50e2ae){const _0x46e175=a29_0x3a6a,_0x13eb6d=_0x3b25c9();while(!![]){try{const _0x19838b=-parseInt(_0x46e175(0x155))/0x1+parseInt(_0x46e175(0x167))/0x2+parseInt(_0x46e175(0x16d))/0x3*(parseInt(_0x46e175(0x156))/0x4)+-parseInt(_0x46e175(0x166))/0x5*(-parseInt(_0x46e175(0x17b))/0x6)+-parseInt(_0x46e175(0x15a))/0x7*(-parseInt(_0x46e175(0x15c))/0x8)+parseInt(_0x46e175(0x174))/0x9+-parseInt(_0x46e175(0x187))/0xa*(parseInt(_0x46e175(0x173))/0xb);if(_0x19838b===_0x50e2ae)break;else _0x13eb6d['push'](_0x13eb6d['shift']());}catch(_0x428b58){_0x13eb6d['push'](_0x13eb6d['shift']());}}}(a29_0x4223,0x86b8f));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x17e876){const _0x3ef15e=a29_0x3a6a,_0x486eca=_0x17e876?.[_0x3ef15e(0x172)]();return _0x486eca?_0x486eca:null;}export function projectAppMembers(_0x444e02){const _0x5e88a3=a29_0x3a6a,_0x201142=new Map(),_0x5780ca=[..._0x444e02]['sort']((_0x486d6e,_0x373e1c)=>_0x486d6e['id']-_0x373e1c['id']),_0x4ca34a=(_0x2dd01c,_0x4719c6,_0x3a87b8)=>{const _0x29bac7=a29_0x3a6a;for(const _0x518e1b of _0x4719c6){const _0x3afebe=Number(_0x518e1b[_0x29bac7(0x16e)]);if(!Number['isFinite'](_0x3afebe)||_0x3afebe<=0x0)continue;let _0xbfeb60=_0x201142['get'](_0x3afebe);if(!_0xbfeb60)_0xbfeb60={'userId':_0x3afebe,'username':nullableText(_0x518e1b[_0x29bac7(0x16f)]),'displayName':nullableText(_0x518e1b['nickname']),'status':_0x3a87b8,'roles':[],'roleKeys':new Set()},_0x201142[_0x29bac7(0x157)](_0x3afebe,_0xbfeb60);else{_0xbfeb60[_0x29bac7(0x16f)]??=nullableText(_0x518e1b[_0x29bac7(0x16f)]),_0xbfeb60[_0x29bac7(0x186)]??=nullableText(_0x518e1b[_0x29bac7(0x171)]);if(_0x3a87b8===_0x29bac7(0x15b))_0xbfeb60[_0x29bac7(0x169)]=_0x29bac7(0x15b);}const _0x314553=_0x2dd01c['id']+':'+_0x3a87b8;if(_0xbfeb60[_0x29bac7(0x170)][_0x29bac7(0x178)](_0x314553))continue;_0xbfeb60['roleKeys']['add'](_0x314553),_0xbfeb60[_0x29bac7(0x176)]['push']({'roleId':_0x2dd01c['id'],'roleCode':_0x2dd01c[_0x29bac7(0x184)],'roleName':nullableText(_0x2dd01c[_0x29bac7(0x164)]),'roleType':nullableText(_0x2dd01c[_0x29bac7(0x17c)]),'membershipStatus':_0x3a87b8});}};for(const _0x564526 of _0x5780ca){_0x4ca34a(_0x564526,_0x564526[_0x5e88a3(0x168)]??[],_0x5e88a3(0x15b)),_0x4ca34a(_0x564526,_0x564526[_0x5e88a3(0x180)]??[],_0x5e88a3(0x161));}return[..._0x201142[_0x5e88a3(0x158)]()][_0x5e88a3(0x182)](_0x189528=>({'userId':_0x189528['userId'],'username':_0x189528[_0x5e88a3(0x16f)],'displayName':_0x189528[_0x5e88a3(0x186)],'status':_0x189528['status'],'roles':_0x189528[_0x5e88a3(0x176)][_0x5e88a3(0x154)]((_0x228d19,_0x2ac8a9)=>_0x228d19[_0x5e88a3(0x16a)]-_0x2ac8a9[_0x5e88a3(0x16a)]||(_0x228d19[_0x5e88a3(0x160)]===_0x2ac8a9[_0x5e88a3(0x160)]?0x0:_0x228d19[_0x5e88a3(0x160)]==='ACTIVE'?-0x1:0x1))}))[_0x5e88a3(0x154)]((_0x498ac3,_0x1aa328)=>_0x498ac3[_0x5e88a3(0x16e)]-_0x1aa328[_0x5e88a3(0x16e)]);}export function enrichAppListItemsWithMergedSelection(_0x375f5b,_0x49aebd){const _0x1cb0e6=a29_0x3a6a;if(!_0x49aebd)return;const _0x2b7c80=_0x49aebd[_0x1cb0e6(0x183)]&&typeof _0x49aebd['apps']===_0x1cb0e6(0x162)?_0x49aebd[_0x1cb0e6(0x183)]:{},_0x269db5=Object[_0x1cb0e6(0x185)](_0x2b7c80)[_0x1cb0e6(0x163)]>0x0;for(const _0x5c899a of _0x375f5b){_0x5c899a[_0x1cb0e6(0x165)]=![];}const _0x16656a=_0x49aebd[_0x1cb0e6(0x17d)]!=null?String(_0x49aebd[_0x1cb0e6(0x17d)])[_0x1cb0e6(0x172)]():'';if(_0x269db5){const _0x40590f=_0x49aebd[_0x1cb0e6(0x188)]??_0x49aebd[_0x1cb0e6(0x15f)];if(_0x40590f)for(const _0x18b580 of _0x375f5b){_0x18b580[_0x1cb0e6(0x17e)]===!![]&&_0x18b580[_0x1cb0e6(0x16b)]===_0x40590f&&(_0x18b580[_0x1cb0e6(0x165)]=!![]);}for(const _0x33d4f3 of _0x375f5b){if(_0x33d4f3[_0x1cb0e6(0x17e)]!==![])continue;if(_0x49aebd['defaultApp'])continue;_0x16656a&&String(_0x33d4f3['appcode']??'')[_0x1cb0e6(0x172)]()===_0x16656a&&(_0x33d4f3[_0x1cb0e6(0x165)]=!![]);}return;}if(!_0x16656a)return;for(const _0x12cee6 of _0x375f5b){String(_0x12cee6[_0x1cb0e6(0x16c)]??'')[_0x1cb0e6(0x172)]()===_0x16656a&&(_0x12cee6[_0x1cb0e6(0x165)]=!![]);}}export function resolveAppScopeForWrite(_0x23d1b6,_0x5a768b,_0x513511){const _0x5b6d0b=a29_0x3a6a;if(_0x5a768b)return _0x5b6d0b(0x17a);const _0x24790a=_0x513511['projectConfig']['apps']&&typeof _0x513511[_0x5b6d0b(0x159)][_0x5b6d0b(0x183)]===_0x5b6d0b(0x162)?_0x513511[_0x5b6d0b(0x159)]['apps']:{},_0x15600d=_0x513511[_0x5b6d0b(0x17f)][_0x5b6d0b(0x183)]&&typeof _0x513511[_0x5b6d0b(0x17f)][_0x5b6d0b(0x183)]==='object'?_0x513511['globalConfig']['apps']:{};if(Object[_0x5b6d0b(0x179)][_0x5b6d0b(0x15d)][_0x5b6d0b(0x15e)](_0x24790a,_0x23d1b6))return _0x5b6d0b(0x177);if(Object['prototype'][_0x5b6d0b(0x15d)]['call'](_0x15600d,_0x23d1b6))return _0x5b6d0b(0x17a);return _0x5b6d0b(0x177);}export function appDefinedIn(_0x41fa1a,_0x3fd87a,_0x33a68c){const _0x4d0ca9=a29_0x3a6a,_0x3312eb=Object[_0x4d0ca9(0x179)][_0x4d0ca9(0x15d)][_0x4d0ca9(0x15e)](_0x3fd87a,_0x41fa1a),_0x5c6865=Object[_0x4d0ca9(0x179)][_0x4d0ca9(0x15d)][_0x4d0ca9(0x15e)](_0x33a68c,_0x41fa1a);if(_0x3312eb&&_0x5c6865)return _0x4d0ca9(0x175);if(_0x5c6865)return _0x4d0ca9(0x177);return _0x4d0ca9(0x17a);}export function resolveDefaultAppSource(_0x34de4b){const _0x254d2f=a29_0x3a6a,_0x3caf98=_0x34de4b['projectConfig'][_0x254d2f(0x183)]&&typeof _0x34de4b[_0x254d2f(0x159)][_0x254d2f(0x183)]==='object'?_0x34de4b['projectConfig'][_0x254d2f(0x183)]:{};if(_0x254d2f(0x15f)in _0x34de4b[_0x254d2f(0x159)])return'project';if(Object[_0x254d2f(0x185)](_0x3caf98)[_0x254d2f(0x163)]>0x0)return'project';if(Object[_0x254d2f(0x185)](_0x34de4b[_0x254d2f(0x159)])[_0x254d2f(0x163)]===0x0&&_0x34de4b[_0x254d2f(0x17f)][_0x254d2f(0x15f)])return'global';return null;}function a29_0x3a6a(_0x1a5dd6,_0x10cdba){_0x1a5dd6=_0x1a5dd6-0x154;const _0x422363=a29_0x4223();let _0x3a6af1=_0x422363[_0x1a5dd6];return _0x3a6af1;}export function getConfigPath(_0x2d4e09={}){const _0x291d33=a29_0x3a6a,_0x240f35=_0x2d4e09[_0x291d33(0x17a)]?_0x291d33(0x17a):_0x291d33(0x177);return resolveWriteConfigPath(_0x240f35);}export function readConfig(_0x4606ca={}){return readConfigFile(getConfigPath(_0x4606ca));}export function writeConfig(_0x2e09fb,_0x15b840={}){writeConfigFile(getConfigPath(_0x15b840),_0x2e09fb);}export function scopeLabel(_0x27151d){const _0x13d70f=a29_0x3a6a;return _0x27151d['global']?_0x13d70f(0x181):'';}
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
- const a30_0x392659=a30_0xd412;(function(_0x3da5d3,_0x10aa5d){const _0x164448=a30_0xd412,_0x93ae92=_0x3da5d3();while(!![]){try{const _0x4820a4=parseInt(_0x164448(0x184))/0x1+-parseInt(_0x164448(0x188))/0x2+-parseInt(_0x164448(0x183))/0x3+parseInt(_0x164448(0x182))/0x4+parseInt(_0x164448(0x181))/0x5*(-parseInt(_0x164448(0x179))/0x6)+-parseInt(_0x164448(0x176))/0x7*(-parseInt(_0x164448(0x17f))/0x8)+parseInt(_0x164448(0x17d))/0x9;if(_0x4820a4===_0x10aa5d)break;else _0x93ae92['push'](_0x93ae92['shift']());}catch(_0x5be8d8){_0x93ae92['push'](_0x93ae92['shift']());}}}(a30_0xa491,0x61fa8));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';function a30_0xd412(_0x3a8d8c,_0x3f76a9){_0x3a8d8c=_0x3a8d8c-0x176;const _0xa4917=a30_0xa491();let _0xd412c1=_0xa4917[_0x3a8d8c];return _0xd412c1;}const DELETE_PATH=a30_0x392659(0x17a);export const appConfigDelete={'service':a30_0x392659(0x186),'command':a30_0x392659(0x18a),'description':a30_0x392659(0x189),'risk':a30_0x392659(0x177),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x405def){readKeyArg(_0x405def);},async 'dryRun'(_0x2335dd){const _0x3471f4=a30_0x392659,_0x252818=readKeyArg(_0x2335dd),_0x14625b=await mustGetByKey(_0x2335dd[_0x3471f4(0x185)],_0x252818);return asAppConfigDryRunResult(buildMutationData({'operation':_0x3471f4(0x18a),'appCode':_0x2335dd['appCode'],'key':_0x252818,'before':projectAppConfig(_0x14625b),'after':null,'dryRun':!![]}),{'method':_0x3471f4(0x17b),'url':DELETE_PATH});},async 'execute'(_0x1f099b){const _0x190b02=a30_0x392659,_0x4dd700=readKeyArg(_0x1f099b),_0x5e9390=await mustGetByKey(_0x1f099b[_0x190b02(0x185)],_0x4dd700);return await withAppConfigApiBoundary(_0x190b02(0x18a),{'appCode':_0x1f099b['appCode'],'key':_0x4dd700},()=>deleteAppConfig({'appCode':_0x1f099b['appCode'],'id':requireAppConfigId(_0x5e9390,_0x4dd700,_0x1f099b[_0x190b02(0x185)])})),{'ok':!![],'data':buildMutationData({'operation':_0x190b02(0x18a),'appCode':_0x1f099b[_0x190b02(0x185)],'key':_0x4dd700,'before':projectAppConfig(_0x5e9390),'after':null,'dryRun':![]}),'message':'Deleted\x20app\x20config\x20'+_0x4dd700};}};function a30_0xa491(){const _0x106fff=['app-config','App\x20config\x20key\x20not\x20found:\x20','1051988dQvkXB','Delete\x20one\x20runtime\x20app-config\x20key','delete','isFinite','77532KeodKR','high-risk-write','validation','12372GHDgoK','/smartapi/app-config/delete','POST','appCode:\x20','4010787VBQiCl','apiError','544QYoAVD','App\x20config\x20server\x20id\x20missing\x20for\x20key=','1145GBlJdg','1819872dTAkKi','1412796btoqWQ','216665LIbYQo','appCode'];a30_0xa491=function(){return _0x106fff;};return a30_0xa491();}async function mustGetByKey(_0x4e1985,_0x9253f5){const _0xe2e199=a30_0x392659,_0x1dcc5d=await withAppConfigApiBoundary('get',{'appCode':_0x4e1985,'key':_0x9253f5},()=>getAppConfigByKey(_0x4e1985,_0x9253f5));if(!_0x1dcc5d)throw CliErrors[_0xe2e199(0x178)](_0xe2e199(0x187)+_0x9253f5,_0xe2e199(0x17c)+_0x4e1985);return _0x1dcc5d;}function requireAppConfigId(_0x1e00c5,_0x1a7f0f,_0xd754bd){const _0x796006=a30_0x392659;if(typeof _0x1e00c5['id']==='number'&&Number[_0x796006(0x18b)](_0x1e00c5['id'])&&_0x1e00c5['id']>0x0)return _0x1e00c5['id'];throw CliErrors[_0x796006(0x17e)](_0x796006(0x180)+_0x1a7f0f+',\x20appCode='+_0xd754bd);}
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
- function a31_0x12e9(_0x274c57,_0x1d70db){_0x274c57=_0x274c57-0x12c;const _0x41a6e=a31_0x41a6();let _0x12e9cd=_0x41a6e[_0x274c57];return _0x12e9cd;}const a31_0x47f2f5=a31_0x12e9;function a31_0x41a6(){const _0x4b090d=['appCode','\x20with\x20value\x20revealed','233968QqhQbo','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','6259635XZSUss','1055210NLwNMc','get','28JETTAR','bool','app-config','Loaded\x20app\x20config\x20','370038TfbGsU','appCode:\x20','App\x20config\x20key\x20not\x20found:\x20','835470FyUeJy','2498565bBcNcP','12kHGrCk','\x20with\x20value\x20redacted','536244aRHeEh','reveal'];a31_0x41a6=function(){return _0x4b090d;};return a31_0x41a6();}(function(_0x1299fd,_0x102a12){const _0x541ac3=a31_0x12e9,_0x1b2f25=_0x1299fd();while(!![]){try{const _0x4c7710=-parseInt(_0x541ac3(0x134))/0x1+-parseInt(_0x541ac3(0x13f))/0x2+parseInt(_0x541ac3(0x138))/0x3+-parseInt(_0x541ac3(0x136))/0x4*(-parseInt(_0x541ac3(0x135))/0x5)+parseInt(_0x541ac3(0x131))/0x6*(-parseInt(_0x541ac3(0x12d))/0x7)+parseInt(_0x541ac3(0x13c))/0x8+parseInt(_0x541ac3(0x13e))/0x9;if(_0x4c7710===_0x102a12)break;else _0x1b2f25['push'](_0x1b2f25['shift']());}catch(_0xc3a8d0){_0x1b2f25['push'](_0x1b2f25['shift']());}}}(a31_0x41a6,0xc1931));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_0x47f2f5(0x12f),'command':a31_0x47f2f5(0x12c),'description':a31_0x47f2f5(0x13d),'risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x4b9882){readKeyArg(_0x4b9882);},async 'execute'(_0x60cfde){const _0x580057=a31_0x47f2f5,_0x242864=readKeyArg(_0x60cfde),_0x1cd824=await withAppConfigApiBoundary(_0x580057(0x12c),{'appCode':_0x60cfde[_0x580057(0x13a)],'key':_0x242864},()=>getAppConfigByKey(_0x60cfde['appCode'],_0x242864));if(!_0x1cd824)throw CliErrors['validation'](_0x580057(0x133)+_0x242864,_0x580057(0x132)+_0x60cfde[_0x580057(0x13a)]);const _0x152bcc=projectAppConfig(_0x1cd824,{'reveal':_0x60cfde[_0x580057(0x12e)](_0x580057(0x139))});return{'ok':!![],'data':{'config':_0x152bcc},'message':_0x60cfde[_0x580057(0x12e)](_0x580057(0x139))?_0x580057(0x130)+_0x242864+_0x580057(0x13b):_0x580057(0x130)+_0x242864+_0x580057(0x137)};}};
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(_0xb7fc97,_0x318d6d){const _0x147e50=a32_0x3c68,_0x11f0eb=_0xb7fc97();while(!![]){try{const _0x5caa92=-parseInt(_0x147e50(0x1a8))/0x1+-parseInt(_0x147e50(0x1ac))/0x2+-parseInt(_0x147e50(0x1a9))/0x3*(-parseInt(_0x147e50(0x1a5))/0x4)+parseInt(_0x147e50(0x1ab))/0x5+parseInt(_0x147e50(0x1a7))/0x6+-parseInt(_0x147e50(0x1aa))/0x7+-parseInt(_0x147e50(0x1a6))/0x8;if(_0x5caa92===_0x318d6d)break;else _0x11f0eb['push'](_0x11f0eb['shift']());}catch(_0x5001b8){_0x11f0eb['push'](_0x11f0eb['shift']());}}}(a32_0xb2e4,0xd1937));function a32_0xb2e4(){const _0x547af7=['3MtxfxG','4854724AWdNeY','5993935eCWJPa','677846ylobdB','2861508IIMlyA','6546272aVRavn','5228832ktsMGQ','76474dZPGiv'];a32_0xb2e4=function(){return _0x547af7;};return a32_0xb2e4();}import{appConfigList}from'../../commands/app-config/list.js';function a32_0x3c68(_0xc51e45,_0x16d250){_0xc51e45=_0xc51e45-0x1a5;const _0xb2e455=a32_0xb2e4();let _0x3c686b=_0xb2e455[_0xc51e45];return _0x3c686b;}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_0x20e115=a33_0x324c;function a33_0x37e9(){const _0x1dc898=['919610GMcHyw','6822774nlfUXB','\x20app\x20config(s)','key','Found\x20','45977120rGfuQN','map','length','3016788riMkyx','9174930LiLjeu','1207742fpsdzF','trim','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','appCode','str','8xSDjqf','read','Filter\x20by\x20exact\x20config\x20key','1183677EgvVEM'];a33_0x37e9=function(){return _0x1dc898;};return a33_0x37e9();}(function(_0x465177,_0x258bd7){const _0x4ff303=a33_0x324c,_0x37c868=_0x465177();while(!![]){try{const _0x41d8fb=-parseInt(_0x4ff303(0x125))/0x1+-parseInt(_0x4ff303(0x11d))/0x2+-parseInt(_0x4ff303(0x11b))/0x3+-parseInt(_0x4ff303(0x122))/0x4*(-parseInt(_0x4ff303(0x113))/0x5)+-parseInt(_0x4ff303(0x11c))/0x6+-parseInt(_0x4ff303(0x114))/0x7+parseInt(_0x4ff303(0x118))/0x8;if(_0x41d8fb===_0x258bd7)break;else _0x37c868['push'](_0x37c868['shift']());}catch(_0x552fb8){_0x37c868['push'](_0x37c868['shift']());}}}(a33_0x37e9,0xc7b53));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';function a33_0x324c(_0x141d38,_0x24b006){_0x141d38=_0x141d38-0x113;const _0x37e954=a33_0x37e9();let _0x324c6a=_0x37e954[_0x141d38];return _0x324c6a;}export const appConfigList={'service':'app-config','command':'list','description':a33_0x20e115(0x11f),'risk':a33_0x20e115(0x123),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a33_0x20e115(0x116),'type':'string','description':a33_0x20e115(0x124)},TAGS_FLAG],async 'validate'(_0x5409fa){const _0x50b8bb=a33_0x20e115,_0x411ba3=_0x5409fa[_0x50b8bb(0x121)](_0x50b8bb(0x116))[_0x50b8bb(0x11e)]();if(_0x411ba3)validateKey(_0x411ba3);readOptionalTags(_0x5409fa);},async 'execute'(_0x28122f){const _0x28bc7d=a33_0x20e115,_0xfc7398=_0x28122f['str'](_0x28bc7d(0x116))[_0x28bc7d(0x11e)]()||undefined,_0x58d6c0=readOptionalTags(_0x28122f),_0x257564=await withAppConfigApiBoundary('list',{'appCode':_0x28122f[_0x28bc7d(0x120)]},()=>listAppConfigs(_0x28122f[_0x28bc7d(0x120)],{'key':_0xfc7398,'tags':_0x58d6c0})),_0x3aa3a7=_0x257564[_0x28bc7d(0x119)](_0x51f924=>projectAppConfig(_0x51f924));return{'ok':!![],'data':{'appCode':_0x28122f[_0x28bc7d(0x120)],'count':_0x3aa3a7['length'],'configs':_0x3aa3a7},'message':_0x28bc7d(0x117)+_0x3aa3a7[_0x28bc7d(0x11a)]+_0x28bc7d(0x115)};}};
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_0x24cfe3=a34_0x492c;(function(_0xe1397b,_0x7cbdb0){const _0x264e85=a34_0x492c,_0x426768=_0xe1397b();while(!![]){try{const _0x1b15f0=parseInt(_0x264e85(0x198))/0x1*(parseInt(_0x264e85(0x181))/0x2)+parseInt(_0x264e85(0x196))/0x3*(parseInt(_0x264e85(0x18d))/0x4)+-parseInt(_0x264e85(0x19a))/0x5+parseInt(_0x264e85(0x19d))/0x6*(parseInt(_0x264e85(0x19e))/0x7)+parseInt(_0x264e85(0x188))/0x8*(-parseInt(_0x264e85(0x185))/0x9)+-parseInt(_0x264e85(0x19f))/0xa+-parseInt(_0x264e85(0x191))/0xb*(-parseInt(_0x264e85(0x18c))/0xc);if(_0x1b15f0===_0x7cbdb0)break;else _0x426768['push'](_0x426768['shift']());}catch(_0x36df6f){_0x426768['push'](_0x426768['shift']());}}}(a34_0x50c8,0x2dd0a));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x492c(_0x564af0,_0x223817){_0x564af0=_0x564af0-0x181;const _0x50c870=a34_0x50c8();let _0x492c65=_0x50c870[_0x564af0];return _0x492c65;}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';function a34_0x50c8(){const _0x9c3603=['get','1165043EbTxkF','app-config','Updated','\x20app\x20config\x20','/smartapi/app-config/create','6705uSlFYs','string','2311RzsCpx','create','1369935IiELiU','update','file','962022mpXBVO','7CEhByp','3334520WBILHe','Read\x20config\x20value\x20from\x20file','62cUDHtE',',\x20appCode=','/smartapi/app-config/update','appCode','396zdbIXm','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','apiError','65080VooIDt','write','tags','isFinite','96GHcRjN','132iyEyVd','POST','App\x20config\x20server\x20id\x20missing\x20for\x20key='];a34_0x50c8=function(){return _0x9c3603;};return a34_0x50c8();}const CREATE_PATH=a34_0x24cfe3(0x195),UPDATE_PATH=a34_0x24cfe3(0x183);export const appConfigSet={'service':a34_0x24cfe3(0x192),'command':'set','description':a34_0x24cfe3(0x186),'risk':a34_0x24cfe3(0x189),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x24cfe3(0x19c),'type':a34_0x24cfe3(0x197),'description':a34_0x24cfe3(0x1a0)}],async 'validate'(_0x3f9f3a){readKeyArg(_0x3f9f3a),readOptionalTags(_0x3f9f3a),assertSingleValueSource(_0x3f9f3a);},async 'dryRun'(_0x33da74){const _0x18df1a=a34_0x24cfe3,_0x35df70=readKeyArg(_0x33da74),_0x302afd=readOptionalTags(_0x33da74),_0x3bc054=assertSingleValueSource(_0x33da74);await assertValueSourceReadable(_0x3bc054);const _0x3f8015=await withAppConfigApiBoundary(_0x18df1a(0x190),{'appCode':_0x33da74['appCode'],'key':_0x35df70},()=>getAppConfigByKey(_0x33da74[_0x18df1a(0x184)],_0x35df70)),_0x36e3e2=_0x3f8015?_0x18df1a(0x19b):_0x18df1a(0x199),_0x27e8a7=_0x3f8015?projectAppConfig(_0x3f8015):null,_0xbf6432=plannedAppConfig({'appCode':_0x33da74[_0x18df1a(0x184)],'key':_0x35df70,'tags':_0x302afd??_0x3f8015?.[_0x18df1a(0x18a)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x36e3e2,'appCode':_0x33da74[_0x18df1a(0x184)],'key':_0x35df70,'before':_0x27e8a7,'after':_0xbf6432,'dryRun':!![]}),{'method':_0x18df1a(0x18e),'url':_0x36e3e2===_0x18df1a(0x19b)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x52db16){const _0x5da8a2=a34_0x24cfe3,_0xa72ad4=readKeyArg(_0x52db16),_0xb53840=readOptionalTags(_0x52db16),_0x1c6288=await withAppConfigApiBoundary(_0x5da8a2(0x190),{'appCode':_0x52db16['appCode'],'key':_0xa72ad4},()=>getAppConfigByKey(_0x52db16[_0x5da8a2(0x184)],_0xa72ad4)),_0x2412c7=_0x1c6288?projectAppConfig(_0x1c6288):null,_0x165096=_0x1c6288?_0x5da8a2(0x19b):_0x5da8a2(0x199),{value:_0x55d373,warnings:_0x57a586}=await readAppConfigValue(_0x52db16),_0xca3450={'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'value':_0x55d373,'tags':_0xb53840??_0x1c6288?.[_0x5da8a2(0x18a)]??undefined};await withAppConfigApiBoundary(_0x165096,{'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4},async()=>{const _0x1f6882=_0x5da8a2;_0x1c6288?await updateAppConfig({..._0xca3450,'id':requireAppConfigId(_0x1c6288,_0xa72ad4,_0x52db16[_0x1f6882(0x184)])}):await createAppConfig(_0xca3450);});const _0x7271fd=await withAppConfigApiBoundary(_0x5da8a2(0x190),{'appCode':_0x52db16['appCode'],'key':_0xa72ad4},()=>getAppConfigByKey(_0x52db16['appCode'],_0xa72ad4)),_0x552a45=_0x7271fd?projectAppConfig(_0x7271fd):plannedAppConfig({'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'tags':_0xca3450[_0x5da8a2(0x18a)],'hasValue':_0x55d373!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x165096,'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'before':_0x2412c7,'after':_0x552a45,'dryRun':![],'warnings':_0x57a586}),'message':(_0x165096===_0x5da8a2(0x19b)?_0x5da8a2(0x193):'Created')+_0x5da8a2(0x194)+_0xa72ad4};}};function requireAppConfigId(_0x4d47d2,_0x2257b7,_0x479ad3){const _0x583d6a=a34_0x24cfe3;if(typeof _0x4d47d2['id']==='number'&&Number[_0x583d6a(0x18b)](_0x4d47d2['id'])&&_0x4d47d2['id']>0x0)return _0x4d47d2['id'];throw CliErrors[_0x583d6a(0x187)](_0x583d6a(0x18f)+_0x2257b7+_0x583d6a(0x182)+_0x479ad3);}
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_0x584b32=a35_0x5057;function a35_0x1132(){const _0x122fce=['setEncoding','298142rhSnil','dryRun','value','Value\x20file\x20is\x20not\x20readable:\x20','str','Runtime\x20app-config\x20key','287022nRhvMT','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','validation','tags','env','4dZgHCl','gmtModified','1044LAwyMt','push','before','utf8','Read\x20config\x20value\x20from\x20stdin','key','name','198165WfTRRi','bool','558vmAlJl','end','operation','args','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','hasValue','method','string','kind','\x20app\x20config.','from-env','1005770DyjkLe','Missing\x20app-config\x20key.','url','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','240PbkrXg','stdin','6KQtygd','file','6392505yqFmvK','error','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','apiError','length','once','239546SRjCNT','after','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','argument','appCode:\x20','63736HWmAAz','App\x20config\x20value\x20source\x20is\x20ambiguous.','slice','reveal','boolean','Environment\x20variable\x20is\x20not\x20set:\x20','trim','valueRedacted','2tBaHnP','appCode','Failed\x20to\x20','path'];a35_0x1132=function(){return _0x122fce;};return a35_0x1132();}(function(_0x5aba80,_0x590429){const _0x255105=a35_0x5057,_0x5ca852=_0x5aba80();while(!![]){try{const _0x5e11fd=-parseInt(_0x255105(0xc3))/0x1*(parseInt(_0x255105(0xb6))/0x2)+-parseInt(_0x255105(0xce))/0x3*(parseInt(_0x255105(0xd3))/0x4)+parseInt(_0x255105(0xe9))/0x5*(-parseInt(_0x255105(0xae))/0x6)+-parseInt(_0x255105(0xb0))/0x7+-parseInt(_0x255105(0xbb))/0x8*(parseInt(_0x255105(0xde))/0x9)+-parseInt(_0x255105(0xed))/0xa*(-parseInt(_0x255105(0xdc))/0xb)+parseInt(_0x255105(0xd5))/0xc*(parseInt(_0x255105(0xc8))/0xd);if(_0x5e11fd===_0x590429)break;else _0x5ca852['push'](_0x5ca852['shift']());}catch(_0x26b1ef){_0x5ca852['push'](_0x5ca852['shift']());}}}(a35_0x1132,0x762eb));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x584b32(0xda),'description':a35_0x584b32(0xcd),'required':!![]};export const VALUE_ARG={'name':a35_0x584b32(0xca),'description':a35_0x584b32(0xb2),'required':![]};export const TAGS_FLAG={'name':a35_0x584b32(0xd1),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x584b32(0xad),'type':a35_0x584b32(0xbf),'description':a35_0x584b32(0xd9),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x584b32(0xe8),'type':a35_0x584b32(0xe5),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x584b32(0xbe),'type':a35_0x584b32(0xbf),'description':a35_0x584b32(0xec),'default':![]};export function readKeyArg(_0x36677f){const _0x2817df=a35_0x584b32,_0x339163=_0x36677f[_0x2817df(0xe1)][0x0]?.[_0x2817df(0xc1)]()??'';return validateKey(_0x339163),_0x339163;}function a35_0x5057(_0x46d35d,_0x5c571f){_0x46d35d=_0x46d35d-0xad;const _0x1132cc=a35_0x1132();let _0x505725=_0x1132cc[_0x46d35d];return _0x505725;}export function readOptionalTags(_0x298f47){const _0xfdc294=a35_0x584b32,_0x388c6a=_0x298f47[_0xfdc294(0xcc)]('tags')[_0xfdc294(0xc1)]();if(!_0x388c6a)return undefined;if(_0x388c6a[_0xfdc294(0xb4)]>0x20)throw CliErrors['validation'](_0xfdc294(0xe2));return _0x388c6a;}export function validateKey(_0x3b269d){const _0x31a0a5=a35_0x584b32;if(!_0x3b269d)throw CliErrors[_0x31a0a5(0xd0)](_0x31a0a5(0xea));if(_0x3b269d['length']>0x100)throw CliErrors[_0x31a0a5(0xd0)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x3f49de,_0x1ed513){const _0x21e643=a35_0x584b32,_0x58a76c=_0x3f49de['value']!==undefined&&_0x3f49de['value']!==null&&_0x3f49de[_0x21e643(0xca)]!=='',_0x560ffc={'appCode':_0x3f49de[_0x21e643(0xc4)],'key':_0x3f49de['key'],'tags':_0x3f49de[_0x21e643(0xd1)]??undefined,'hasValue':_0x58a76c,'valueRedacted':_0x58a76c&&!_0x1ed513?.['reveal'],'gmtCreate':_0x3f49de['gmtCreate'],'gmtModified':_0x3f49de[_0x21e643(0xd4)]};return _0x1ed513?.['reveal']&&(_0x560ffc['value']=_0x3f49de[_0x21e643(0xca)]??'',_0x560ffc[_0x21e643(0xc2)]=![]),_0x560ffc;}export function plannedAppConfig(_0x9fdca2){const _0x127155=a35_0x584b32,_0x1c948c=_0x9fdca2[_0x127155(0xe3)]??!![];return{'appCode':_0x9fdca2[_0x127155(0xc4)],'key':_0x9fdca2['key'],'tags':_0x9fdca2['tags']??undefined,'hasValue':_0x1c948c,'valueRedacted':_0x1c948c};}export function buildMutationData(_0x1ae564){const _0x32eaa6=a35_0x584b32;return{'operation':_0x1ae564[_0x32eaa6(0xe0)],'selector':{'appCode':_0x1ae564[_0x32eaa6(0xc4)],'key':_0x1ae564[_0x32eaa6(0xda)]},'before':_0x1ae564[_0x32eaa6(0xd7)],'after':_0x1ae564[_0x32eaa6(0xb7)],'dryRun':_0x1ae564[_0x32eaa6(0xc9)],'warnings':_0x1ae564['warnings']??[]};}export async function withAppConfigApiBoundary(_0x324ec8,_0x5c99bb,_0x263da1){const _0x8f8998=a35_0x584b32;try{return await _0x263da1();}catch{const _0x481577=[_0x8f8998(0xba)+_0x5c99bb[_0x8f8998(0xc4)]];if(_0x5c99bb[_0x8f8998(0xda)])_0x481577[_0x8f8998(0xd6)]('key:\x20'+_0x5c99bb[_0x8f8998(0xda)]);_0x481577[_0x8f8998(0xd6)]('value\x20is\x20redacted');throw CliErrors[_0x8f8998(0xb3)](_0x8f8998(0xc5)+_0x324ec8+_0x8f8998(0xe7),_0x481577['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4d01e9,_0x4ad209){const _0x25709e=a35_0x584b32;return Object['defineProperties'](_0x4d01e9,{'method':{'value':_0x4ad209[_0x25709e(0xe4)],'enumerable':![]},'url':{'value':_0x4ad209[_0x25709e(0xeb)],'enumerable':![]}});}export function assertSingleValueSource(_0x2f04c1){const _0x4c84e5=a35_0x584b32,_0x3814b7=[];_0x2f04c1[_0x4c84e5(0xe1)]['length']>0x1&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xb9),'value':_0x2f04c1[_0x4c84e5(0xe1)][_0x4c84e5(0xbd)](0x1)['join']('\x20')});const _0x2aeb87=_0x2f04c1['flag'](_0x4c84e5(0xca));_0x2aeb87!==undefined&&_0x2aeb87!==null&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xb9),'value':String(_0x2aeb87)});_0x2f04c1[_0x4c84e5(0xdd)](_0x4c84e5(0xad))&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xad)});const _0x1ef9c3=_0x2f04c1['str'](_0x4c84e5(0xe8))[_0x4c84e5(0xc1)]();_0x1ef9c3&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':'env','name':_0x1ef9c3});const _0x5b962f=_0x2f04c1['str']('file')['trim']();_0x5b962f&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':'file','path':_0x5b962f});if(_0x3814b7[_0x4c84e5(0xb4)]===0x0)throw CliErrors[_0x4c84e5(0xd0)]('Missing\x20app-config\x20value\x20source.',_0x4c84e5(0xb8));if(_0x3814b7[_0x4c84e5(0xb4)]>0x1)throw CliErrors['validation'](_0x4c84e5(0xbc),'Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');return _0x3814b7[0x0];}export async function assertValueSourceReadable(_0x58bbb6){const _0x233bb1=a35_0x584b32;if(_0x58bbb6[_0x233bb1(0xe6)]===_0x233bb1(0xd2)&&!(_0x58bbb6[_0x233bb1(0xdb)]in process.env))throw CliErrors[_0x233bb1(0xd0)](_0x233bb1(0xc0)+_0x58bbb6['name']);if(_0x58bbb6[_0x233bb1(0xe6)]===_0x233bb1(0xaf))try{await access(_0x58bbb6[_0x233bb1(0xc6)]);}catch{throw CliErrors[_0x233bb1(0xd0)](_0x233bb1(0xcb)+_0x58bbb6[_0x233bb1(0xc6)]);}}export async function readAppConfigValue(_0x2d90e9){const _0x367113=a35_0x584b32,_0x37c842=assertSingleValueSource(_0x2d90e9),_0x138456=[];if(_0x37c842[_0x367113(0xe6)]===_0x367113(0xb9))return _0x138456[_0x367113(0xd6)](_0x367113(0xcf)),{'value':_0x37c842['value']??'','source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};if(_0x37c842['kind']===_0x367113(0xad))return{'value':await readStdin(),'source':_0x37c842['kind'],'warnings':_0x138456};if(_0x37c842['kind']===_0x367113(0xd2)){if(!(_0x37c842[_0x367113(0xdb)]in process.env))throw CliErrors[_0x367113(0xd0)](_0x367113(0xc0)+_0x37c842['name']);return{'value':process.env[_0x37c842.name]??'','source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};}return{'value':await readFile(_0x37c842[_0x367113(0xc6)],'utf8'),'source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};}function readStdin(){return new Promise((_0x5c1c1c,_0x4dd46f)=>{const _0x49d441=a35_0x5057;let _0x4efc40='';process['stdin'][_0x49d441(0xc7)](_0x49d441(0xd8)),process['stdin']['on']('data',_0x7e9e5c=>{_0x4efc40+=_0x7e9e5c;}),process[_0x49d441(0xad)]['once'](_0x49d441(0xdf),()=>_0x5c1c1c(_0x4efc40)),process[_0x49d441(0xad)][_0x49d441(0xb5)](_0x49d441(0xb1),_0x4dd46f);});}
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
- const a36_0x118632=a36_0x550e;(function(_0x233171,_0x1c8fdb){const _0x3d8553=a36_0x550e,_0x3efbe5=_0x233171();while(!![]){try{const _0x20fdc0=parseInt(_0x3d8553(0x1f5))/0x1+parseInt(_0x3d8553(0x1fa))/0x2+parseInt(_0x3d8553(0x1f3))/0x3*(parseInt(_0x3d8553(0x1f1))/0x4)+-parseInt(_0x3d8553(0x1fb))/0x5*(parseInt(_0x3d8553(0x1e8))/0x6)+parseInt(_0x3d8553(0x1f4))/0x7+parseInt(_0x3d8553(0x1fd))/0x8*(-parseInt(_0x3d8553(0x1ed))/0x9)+-parseInt(_0x3d8553(0x1f2))/0xa*(parseInt(_0x3d8553(0x1f6))/0xb);if(_0x20fdc0===_0x1c8fdb)break;else _0x3efbe5['push'](_0x3efbe5['shift']());}catch(_0x5025d4){_0x3efbe5['push'](_0x3efbe5['shift']());}}}(a36_0x1334,0x31021));import{unlinkSync,existsSync}from'node:fs';function a36_0x550e(_0x46c2fc,_0x301c4a){_0x46c2fc=_0x46c2fc-0x1e8;const _0x133428=a36_0x1334();let _0x550ed0=_0x133428[_0x46c2fc];return _0x550ed0;}function a36_0x1334(){const _0x7f7e4d=['boolean','753198hovGuW','85mpRCvk','auth','1016408VmyXdx','write','57432YJFKNB','Login\x20via\x20browser','login','log','yes','9hDSFEg','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','✓\x20Logged\x20out','12BmewJg','130aZFuQw','224673aTODSw','2075990qXMeOU','15872OFQswO','358094IzzAbY','bool','Clear\x20login\x20session'];a36_0x1334=function(){return _0x7f7e4d;};return a36_0x1334();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a36_0x118632(0x1fc),'command':a36_0x118632(0x1ea),'description':a36_0x118632(0x1e9),'risk':a36_0x118632(0x1fe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x118632(0x1ec),'type':a36_0x118632(0x1f9),'description':a36_0x118632(0x1ef),'default':![]}],async 'execute'(_0x378e54){const _0x1c3dfb=a36_0x118632,{runAuthServer:_0x59f50f}=await import('../../auth/auth-server-ui.js');return await _0x59f50f({'autoYes':_0x378e54[_0x1c3dfb(0x1f7)]('yes'),'nonInteractive':_0x378e54['nonInteractive']}),{'ok':!![]};}},{'service':a36_0x118632(0x1fc),'command':'logout','description':a36_0x118632(0x1f8),'risk':a36_0x118632(0x1fe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1e154d){const _0x5aaaa8=a36_0x118632;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5aaaa8(0x1eb)](_0x5aaaa8(0x1f0))):console[_0x5aaaa8(0x1eb)](_0x5aaaa8(0x1ee)),{'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_0x375ddc=a37_0x3547;(function(_0x431f4a,_0x59d52f){const _0x3ae49f=a37_0x3547,_0x72f072=_0x431f4a();while(!![]){try{const _0x4819d7=-parseInt(_0x3ae49f(0x152))/0x1+-parseInt(_0x3ae49f(0x162))/0x2*(-parseInt(_0x3ae49f(0x14b))/0x3)+-parseInt(_0x3ae49f(0x183))/0x4+-parseInt(_0x3ae49f(0x185))/0x5*(-parseInt(_0x3ae49f(0x180))/0x6)+parseInt(_0x3ae49f(0x1ae))/0x7*(-parseInt(_0x3ae49f(0x14e))/0x8)+-parseInt(_0x3ae49f(0x18d))/0x9*(parseInt(_0x3ae49f(0x197))/0xa)+parseInt(_0x3ae49f(0x198))/0xb*(parseInt(_0x3ae49f(0x19a))/0xc);if(_0x4819d7===_0x59d52f)break;else _0x72f072['push'](_0x72f072['shift']());}catch(_0x2858dd){_0x72f072['push'](_0x72f072['shift']());}}}(a37_0x3f05,0xe0c9b));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';function a37_0x3547(_0x498833,_0x471839){_0x498833=_0x498833-0x143;const _0x3f0556=a37_0x3f05();let _0x3547d5=_0x3f0556[_0x498833];return _0x3547d5;}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';function a37_0x3f05(){const _0x5a471d=['No\x20operation\x20types\x20found\x20for\x20dataset\x20','9584okbFKc','datasetCode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','map','1196161WeQOKF','description','Select\x20operation\x20type:','Select\x20trigger\x20node:','name','修改后的请求参数','datasetcode','Alias\x20\x22','str','Invalid\x20dataset\x20selection.','keys','当前响应结果','HOOK\x20requires\x20alias/operation/node\x20options.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','HOOK','Operation\x20type\x20\x22','109248HjkpmS','length','bff','stdin','alias','tableName','/**\x0a\x20*\x20','/ENDPOINT/','.js\x0a\x20*\x20[触发节点]\x20','appCode','\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','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','nonInteractive','operationType','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','datasetId','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Operation\x20type\x20(HOOK\x20only)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','write','Function\x20name\x20(valid\x20JS\x20identifier)','profileName','operation-type','before','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','defaultApp','currentApp','string','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','6VqTtuK','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Select\x20dataset:','2011260ulaOHR','Available:\x20','9149465BWevSA','Available\x20aliases:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','includes','\x20api\x20pull`\x20to\x20refresh.','/COMMON/','validation','819333lcYuaZ','after','functionNode','Trigger\x20node\x20(HOOK\x20only)','question','type','COMMON','Created\x20','scriptsRootDir','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','30wGkrMJ','8481121DQAoOx','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','12GOfyIV','find','utf8','File\x20already\x20exists:\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','No\x20datasets\x20found\x20for\x20this\x20app.','code','apiDir','filePath','join','Invalid\x20function\x20name\x20\x22','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','mergedCli','ENDPOINT','stderr','create','\x22\x20not\x20found.\x20','\x22,\x20params\x20})\x0a','read','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','8827OVPPHJ','\x22\x20not\x20found\x20for\x20dataset\x20','isInteger','function-node','trim','.js\x0a','entries','\x22.\x20','\x0a\x20*\x20[平台配置]\x20','parseInt','99CelkqT','No\x20model\x20aliases\x20found.\x20Run\x20`'];a37_0x3f05=function(){return _0x5a471d;};return a37_0x3f05();}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x375ddc(0x164),'command':a37_0x375ddc(0x1a9),'description':a37_0x375ddc(0x15f),'risk':a37_0x375ddc(0x1ac),'flags':[{'name':a37_0x375ddc(0x192),'type':'string','required':!![],'enum':[a37_0x375ddc(0x193),'ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a37_0x375ddc(0x156),'type':'string','required':!![],'description':a37_0x375ddc(0x177)},{'name':a37_0x375ddc(0x153),'type':a37_0x375ddc(0x17e),'description':'Script\x20description'},{'name':a37_0x375ddc(0x166),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x375ddc(0x158),'type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x19e)},{'name':'operation-type','type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x173)},{'name':a37_0x375ddc(0x144),'type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x190),'enum':[a37_0x375ddc(0x17a),a37_0x375ddc(0x18e)]}],async 'validate'(_0x190592){const _0x5cc46c=a37_0x375ddc,_0xfd5fee=_0x190592['str']('name');if(!isValidBffFunctionName(_0xfd5fee))throw CliErrors[_0x5cc46c(0x18c)](_0x5cc46c(0x1a4)+_0xfd5fee+_0x5cc46c(0x187));},async 'execute'(_0x948594){const _0x10e562=a37_0x375ddc,_0xd56d3e=loadBffProjectConfig(_0x948594[_0x10e562(0x16b)]),_0x86db9c=_0x948594[_0x10e562(0x15a)](_0x10e562(0x192)),_0x27c04c=_0x948594['str'](_0x10e562(0x156)),_0x1aa74c=_0x948594[_0x10e562(0x15a)]('description')||undefined,_0x36d3b3=_0x86db9c===_0x10e562(0x160)?await resolveHookOptions(_0xd56d3e,_0x948594):undefined,_0x214059=buildFilePath(_0xd56d3e,_0x86db9c,_0x27c04c,_0x36d3b3);if(await fileExists(_0x214059))throw CliErrors[_0x10e562(0x18c)](_0x10e562(0x19d)+_0x214059);await mkdir(dirname(_0x214059),{'recursive':!![]});const _0x44b3a4=generateTemplate(_0x86db9c,_0x27c04c,_0x948594['appCode'],_0x1aa74c,_0x36d3b3);await writeFile(_0x214059,_0x44b3a4,_0x10e562(0x19c));const _0x1e0314={'type':_0x86db9c,'name':_0x27c04c,'path':_0x214059};if(_0x1aa74c)_0x1e0314[_0x10e562(0x153)]=_0x1aa74c;if(_0x36d3b3){if(_0x36d3b3[_0x10e562(0x166)])_0x1e0314[_0x10e562(0x166)]=_0x36d3b3[_0x10e562(0x166)];_0x1e0314[_0x10e562(0x14f)]=_0x36d3b3[_0x10e562(0x14f)],_0x1e0314[_0x10e562(0x16f)]=_0x36d3b3[_0x10e562(0x16f)],_0x1e0314[_0x10e562(0x18f)]=_0x36d3b3[_0x10e562(0x18f)];}return{'ok':!![],'data':_0x1e0314,'message':_0x10e562(0x194)+_0x86db9c+'\x20function:\x20'+_0x27c04c};}};async function resolveHookOptions(_0xc5219a,_0xfc09f4){const _0x12d3b8=a37_0x375ddc,_0x4602a7=resolveApiModelSource(_0xfc09f4[_0x12d3b8(0x1a1)],_0xfc09f4[_0x12d3b8(0x16b)],_0xfc09f4['selectedAppName']||_0xfc09f4[_0x12d3b8(0x1a6)]?.[_0x12d3b8(0x17d)]||_0xfc09f4['mergedCli']?.[_0x12d3b8(0x17c)]),_0x56f79d=loadAliasMap(_0xfc09f4[_0x12d3b8(0x1a1)],undefined,_0x4602a7['filePath'],_0x4602a7['profileName']),_0x54efef=_0x56f79d[_0x12d3b8(0x163)]>0x0;let _0x2e7ddf,_0x695677,_0x58e043;const _0x10dca5=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x166)),_0xc6f9d5=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x158));if(_0x10dca5){const _0x23fa9d=resolveAlias(_0xfc09f4[_0x12d3b8(0x1a1)],_0x10dca5,undefined,_0x4602a7[_0x12d3b8(0x1a2)],_0x4602a7[_0x12d3b8(0x178)]);if(!_0x23fa9d){const _0x21bb8b=_0x54efef?_0x12d3b8(0x186)+_0x56f79d['map'](_0x24ddbe=>_0x24ddbe[_0x12d3b8(0x166)])[_0x12d3b8(0x1a3)](',\x20'):_0x12d3b8(0x14c)+CLI_BIN_NAME+_0x12d3b8(0x174);throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x159)+_0x10dca5+_0x12d3b8(0x1aa)+_0x21bb8b);}_0x2e7ddf=_0x10dca5,_0x695677=_0x23fa9d;}else{if(_0xc6f9d5){_0x695677=_0xc6f9d5;const _0x51e3e8=_0x56f79d['find'](_0x496e28=>_0x496e28[_0x12d3b8(0x14f)]===_0xc6f9d5);_0x2e7ddf=_0x51e3e8?.[_0x12d3b8(0x166)];}else{if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors['validation'](_0x12d3b8(0x17f));else{if(_0x54efef){const _0x1ec463=_0x56f79d['map'](_0x57e0e5=>_0x57e0e5['alias']+'\x20('+_0x57e0e5[_0x12d3b8(0x167)]+')'),_0x2b2886=await promptSelect(_0x12d3b8(0x182),_0x1ec463),_0x3f3435=_0x56f79d[_0x2b2886];if(!_0x3f3435)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x15b));_0x2e7ddf=_0x3f3435['alias'],_0x695677=_0x3f3435[_0x12d3b8(0x14f)];}else{const _0x29437a=await listDatasets(_0xfc09f4[_0x12d3b8(0x16b)]);if(_0x29437a[_0x12d3b8(0x163)]===0x0)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x19f));const _0xaa256c=_0x29437a[_0x12d3b8(0x151)](_0x56bb21=>_0x56bb21[_0x12d3b8(0x156)]+'\x20['+(_0x56bb21['source']??'UNKNOWN')+']\x20('+_0x56bb21[_0x12d3b8(0x1a0)]+')'),_0x42fa70=await promptSelect(_0x12d3b8(0x182),_0xaa256c),_0x1556c4=_0x29437a[_0x42fa70];if(!_0x1556c4)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x15b));_0x695677=_0x1556c4['code'],_0x2e7ddf=undefined;}}}}const _0xed5883=await listDatasets(_0xfc09f4[_0x12d3b8(0x16b)]),_0x23094b=_0xed5883[_0x12d3b8(0x19b)](_0x2533f3=>_0x2533f3[_0x12d3b8(0x1a0)]===_0x695677);if(!_0x23094b)throw CliErrors[_0x12d3b8(0x18c)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x695677+_0x12d3b8(0x148)+(_0x2e7ddf?'The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x12d3b8(0x18a):''));_0x58e043=_0x23094b['id'];const _0xe010ea=_0x2e7ddf??_0x695677,_0x4030b4=await listBffDatasetOperations(_0xfc09f4[_0x12d3b8(0x16b)],_0x58e043),_0x504e0e=_0x4030b4?Object[_0x12d3b8(0x15c)](_0x4030b4):[];if(_0x504e0e[_0x12d3b8(0x163)]===0x0)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x14d)+_0xe010ea+'.');let _0x35d0bc;const _0x3b085a=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x179));if(_0x3b085a){if(!_0x504e0e[_0x12d3b8(0x189)](_0x3b085a))throw CliErrors['validation'](_0x12d3b8(0x161)+_0x3b085a+_0x12d3b8(0x1af)+_0xe010ea+'.\x20'+(_0x12d3b8(0x184)+_0x504e0e[_0x12d3b8(0x1a3)](',\x20')));_0x35d0bc=_0x3b085a;}else{if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors['validation'](_0x12d3b8(0x170));const _0x13f9d3=await promptSelect(_0x12d3b8(0x154),_0x504e0e);_0x35d0bc=_0x504e0e[_0x13f9d3]??_0x504e0e[0x0];}let _0x596fb1=normalizeHookFunctionNode(_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x144)));if(!_0x596fb1){if(_0xfc09f4['str'](_0x12d3b8(0x144)))throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x172));if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x1a5));const _0x5506e3=await promptSelect(_0x12d3b8(0x155),[_0x12d3b8(0x17a),_0x12d3b8(0x18e)]);_0x596fb1=['before',_0x12d3b8(0x18e)][_0x5506e3]??'before';}return{'alias':_0x2e7ddf,'datasetCode':_0x695677,'datasetId':_0x58e043,'operationType':_0x35d0bc,'functionNode':_0x596fb1};}async function promptSelect(_0x2b29b9,_0x3ed7c3){const _0x368f13=a37_0x375ddc;if(_0x3ed7c3['length']===0x1)return 0x0;for(const [_0x3b300f,_0x4287c7]of _0x3ed7c3[_0x368f13(0x147)]()){process[_0x368f13(0x1a8)][_0x368f13(0x176)]('\x20\x20'+(_0x3b300f+0x1)+'.\x20'+_0x4287c7+'\x0a');}const _0x21da03=createInterface({'input':process[_0x368f13(0x165)],'output':process[_0x368f13(0x1a8)]});while(!![]){const _0x4d7418=await new Promise(_0x469c97=>{const _0x3f57d2=_0x368f13;_0x21da03[_0x3f57d2(0x191)](_0x2b29b9+'\x20',_0x469c97);}),_0x519859=Number[_0x368f13(0x14a)](_0x4d7418[_0x368f13(0x145)](),0xa);if(Number[_0x368f13(0x143)](_0x519859)&&_0x519859>=0x1&&_0x519859<=_0x3ed7c3['length'])return _0x21da03['close'](),_0x519859-0x1;process[_0x368f13(0x1a8)][_0x368f13(0x176)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x3ed7c3[_0x368f13(0x163)]+'.\x0a');}}function buildFilePath(_0x2ca260,_0x5ed5fd,_0x4518fe,_0x4a67f7){const _0x13f6c2=a37_0x375ddc;if(_0x5ed5fd===_0x13f6c2(0x160)){if(!_0x4a67f7)throw CliErrors[_0x13f6c2(0x18c)](_0x13f6c2(0x15e));const _0x38ad59=_0x4a67f7[_0x13f6c2(0x166)]??_0x4a67f7[_0x13f6c2(0x14f)];return join(_0x2ca260[_0x13f6c2(0x195)],_0x13f6c2(0x160),_0x38ad59,_0x4a67f7[_0x13f6c2(0x16f)],_0x4a67f7[_0x13f6c2(0x18f)],_0x4518fe+'.js');}return join(_0x2ca260[_0x13f6c2(0x195)],_0x5ed5fd,_0x4518fe+'.js');}export function generateTemplate(_0x5cf6bb,_0x277d63,_0x35d16b,_0x54b6e1,_0x1ba2e9){const _0x147392=a37_0x375ddc,_0x4a0c8f=_0x54b6e1?.[_0x147392(0x145)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x137000=getAppBaseUrl(_0x35d16b),_0x2d2739=_0x147392(0x188);if(_0x5cf6bb===_0x147392(0x193))return _0x147392(0x168)+_0x4a0c8f+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x277d63+_0x147392(0x149)+_0x137000+_0x147392(0x16d)+_0x35d16b+_0x147392(0x18b)+_0x277d63+_0x147392(0x196)+_0x277d63+_0x147392(0x1ab)+_0x2d2739+_0x147392(0x16c)+_0x277d63+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x5cf6bb===_0x147392(0x1a7))return _0x147392(0x168)+_0x4a0c8f+_0x147392(0x150)+_0x277d63+_0x147392(0x199)+_0x35d16b+'/'+_0x277d63+_0x147392(0x149)+_0x137000+_0x147392(0x16d)+_0x35d16b+_0x147392(0x169)+_0x277d63+_0x147392(0x146)+_0x2d2739+'\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'+_0x277d63+_0x147392(0x1ad);if(!_0x1ba2e9)throw CliErrors['validation'](_0x147392(0x181));const _0x152de3=_0x1ba2e9[_0x147392(0x166)]??_0x1ba2e9[_0x147392(0x14f)],_0x381e4f=_0x1ba2e9[_0x147392(0x18f)]===_0x147392(0x17a)?'当前请求参数':_0x147392(0x15d),_0x180edd=_0x1ba2e9['functionNode']===_0x147392(0x17a)?_0x147392(0x157):'修改后的响应结果';return _0x147392(0x168)+_0x4a0c8f+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x277d63+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x35d16b+'/'+_0x1ba2e9['datasetCode']+'/'+_0x1ba2e9[_0x147392(0x16f)]+_0x147392(0x149)+_0x137000+'/data/dataset/'+_0x1ba2e9[_0x147392(0x171)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x35d16b+'/HOOK/'+_0x152de3+'/'+_0x1ba2e9['operationType']+'/'+_0x1ba2e9[_0x147392(0x18f)]+'/'+_0x277d63+_0x147392(0x16a)+_0x1ba2e9['functionNode']+'\x0a'+_0x2d2739+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x381e4f+_0x147392(0x175)+_0x180edd+_0x147392(0x17b)+_0x277d63+_0x147392(0x1ad);}
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_0x1628a0=a38_0xda2d;(function(_0x299363,_0x4e240a){const _0x2eba35=a38_0xda2d,_0x248d44=_0x299363();while(!![]){try{const _0x254dd5=parseInt(_0x2eba35(0x11d))/0x1+parseInt(_0x2eba35(0x139))/0x2*(-parseInt(_0x2eba35(0x119))/0x3)+parseInt(_0x2eba35(0x129))/0x4*(parseInt(_0x2eba35(0x11b))/0x5)+-parseInt(_0x2eba35(0x12a))/0x6+-parseInt(_0x2eba35(0x110))/0x7+parseInt(_0x2eba35(0x11e))/0x8+-parseInt(_0x2eba35(0x137))/0x9*(parseInt(_0x2eba35(0x126))/0xa);if(_0x254dd5===_0x4e240a)break;else _0x248d44['push'](_0x248d44['shift']());}catch(_0x56d1c8){_0x248d44['push'](_0x248d44['shift']());}}}(a38_0xd928,0x96634));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';function a38_0xd928(){const _0x48769a=['apps','scriptsRootDir','bff','str','/api/management/library/scripts/delete','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Would\x20delete\x20','213qqQiuA','Backend\x20Function\x20lock\x20file\x20not\x20found.','45LJGols','trashDir','1214466Tzxgvg','6150832vLSovR','toISOString','remoteId','projectRoot','replace','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','includes','\x20\x20-\x20','2085910zlltUu','split','trashedTo','76324Yxofam','3842316sdVglX','string','scriptsRoot','parse','delete','high-risk-write','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','validation','Lock\x20scope\x20for\x20app\x20\x22','target','lastSync','Deleted\x20','length','9QCfieY','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','9890NFbeOD','Local\x20delete\x20not\x20settled\x20for\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','functions','<timestamp>','map','join','lockFilePath','Multiple\x20functions\x20match\x20\x22','2372923aOKlRZ','appCode'];a38_0xd928=function(){return _0x48769a;};return a38_0xd928();}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_0x1628a0(0x114),'command':a38_0x1628a0(0x12e),'description':a38_0x1628a0(0x130),'risk':a38_0x1628a0(0x12f),'flags':[{'name':a38_0x1628a0(0x133),'type':a38_0x1628a0(0x12b),'required':!![],'description':a38_0x1628a0(0x117)}],async 'validate'(_0x524d8d){const _0x4c6758=a38_0x1628a0,_0x321f43=loadBffProjectConfig(_0x524d8d[_0x4c6758(0x111)]),_0x411a83=await readBffLockFile(_0x321f43['lockFilePath']);if(!_0x411a83)throw CliErrors[_0x4c6758(0x131)](_0x4c6758(0x138));},async 'dryRun'(_0x3794c7){const _0x551110=a38_0x1628a0,_0x9bdc6b=loadBffProjectConfig(_0x3794c7[_0x551110(0x111)]),_0x326663=await readBffLockFile(_0x9bdc6b[_0x551110(0x10e)]);if(!_0x326663)throw CliErrors['validation'](_0x551110(0x11a));const {appLock:_0x5bbee5}=ensureLockScope(_0x326663,_0x3794c7['appCode'],_0x9bdc6b[_0x551110(0x12c)],_0x551110(0x12e)),_0x17a691=_0x3794c7[_0x551110(0x115)](_0x551110(0x133)),_0xd89d2e=Object['keys'](_0x5bbee5[_0x551110(0x13c)]),_0x265c18=resolveDeleteTarget(_0x17a691,_0xd89d2e),_0x34b4f9=_0x5bbee5[_0x551110(0x13c)][_0x265c18];if(!_0x34b4f9)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x265c18+'\x22.');const _0x60af0d=resolveLocalFilePathFromLockKey(_0x9bdc6b,_0x265c18),_0x46b841=relative(_0x9bdc6b['projectRoot'],_0x60af0d),_0x28bc51=join(_0x9bdc6b[_0x551110(0x11c)],_0x551110(0x13d),_0x46b841);return{'method':'POST','url':_0x551110(0x116),'body':{'appCode':_0x3794c7[_0x551110(0x111)],'target':_0x265c18,'remoteId':_0x34b4f9[_0x551110(0x120)],'localFilePath':_0x60af0d,'trashedPath':_0x28bc51},'description':_0x551110(0x118)+_0x265c18+_0x551110(0x13b)};},async 'execute'(_0x3ed1cf){const _0x14bc3b=a38_0x1628a0,_0x475702=loadBffProjectConfig(_0x3ed1cf[_0x14bc3b(0x111)]),_0x431b4e=await readBffLockFile(_0x475702['lockFilePath']);if(!_0x431b4e)throw CliErrors['validation'](_0x14bc3b(0x11a));const {lockData:_0x4e41e5,appLock:_0x23c76a}=ensureLockScope(_0x431b4e,_0x3ed1cf['appCode'],_0x475702['scriptsRoot'],_0x14bc3b(0x12e)),_0x22173=JSON[_0x14bc3b(0x12d)](JSON['stringify'](_0x4e41e5)),_0x7ff1ab=_0x22173[_0x14bc3b(0x112)][_0x3ed1cf[_0x14bc3b(0x111)]];if(!_0x7ff1ab)throw new Error(_0x14bc3b(0x132)+_0x3ed1cf[_0x14bc3b(0x111)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x10590d=_0x3ed1cf['str'](_0x14bc3b(0x133)),_0x308c93=Object['keys'](_0x7ff1ab[_0x14bc3b(0x13c)]),_0x334cdd=resolveDeleteTarget(_0x10590d,_0x308c93),_0x5657aa=_0x7ff1ab['functions'][_0x334cdd];if(!_0x5657aa)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x334cdd+'\x22.');await deleteBffScript(_0x5657aa[_0x14bc3b(0x120)]),delete _0x7ff1ab['functions'][_0x334cdd],_0x7ff1ab[_0x14bc3b(0x134)]=new Date()[_0x14bc3b(0x11f)](),await writeBffLockFile(_0x475702['lockFilePath'],_0x22173);const _0x18332c=resolveLocalFilePathFromLockKey(_0x475702,_0x334cdd);let _0x2a1673;await fileExists(_0x18332c)&&(_0x2a1673=await moveToTrash(_0x475702[_0x14bc3b(0x121)],_0x475702[_0x14bc3b(0x11c)],_0x18332c),await cleanupEmptyDirectories(dirname(_0x18332c),_0x475702[_0x14bc3b(0x113)]));await waitForDeleteSettlement(_0x475702[_0x14bc3b(0x10e)],_0x3ed1cf[_0x14bc3b(0x111)],_0x334cdd,_0x18332c),await sleep(0x96);const _0xe46af4={'deleted':_0x334cdd,'remoteId':_0x5657aa[_0x14bc3b(0x120)]};if(_0x2a1673)_0xe46af4[_0x14bc3b(0x128)]=_0x2a1673;return{'ok':!![],'data':_0xe46af4,'message':_0x14bc3b(0x135)+_0x334cdd+(_0x2a1673?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a38_0xda2d(_0x401585,_0x32e9a0){_0x401585=_0x401585-0x10e;const _0xd9280e=a38_0xd928();let _0xda2d87=_0xd9280e[_0x401585];return _0xda2d87;}function resolveDeleteTarget(_0x564ab1,_0x597fee){const _0x411da2=a38_0x1628a0;if(_0x564ab1[_0x411da2(0x124)]('/')){const _0x581b1b=_0x597fee['find'](_0x59aa8b=>_0x59aa8b===_0x564ab1);if(!_0x581b1b)throw CliErrors[_0x411da2(0x131)]('Function\x20not\x20found:\x20'+_0x564ab1);return _0x581b1b;}const _0x5092ab=_0x597fee['filter'](_0x56575f=>_0x56575f[_0x411da2(0x127)]('/')['at'](-0x1)===_0x564ab1);if(_0x5092ab[_0x411da2(0x136)]===0x0)throw CliErrors[_0x411da2(0x131)]('Function\x20not\x20found:\x20'+_0x564ab1);if(_0x5092ab[_0x411da2(0x136)]>0x1)throw CliErrors[_0x411da2(0x131)](_0x411da2(0x10f)+_0x564ab1+_0x411da2(0x123)+_0x5092ab[_0x411da2(0x13e)](_0x210b24=>_0x411da2(0x125)+_0x210b24)[_0x411da2(0x13f)]('\x0a'));return _0x5092ab[0x0];}async function moveToTrash(_0x4057ac,_0x26da6c,_0x1ba5c4){const _0x3dfdac=a38_0x1628a0,_0x3896e6=new Date()['toISOString']()[_0x3dfdac(0x122)](/[:.]/g,'-'),_0x234b66=relative(_0x4057ac,_0x1ba5c4),_0x4ecae4=join(_0x26da6c,_0x3896e6,_0x234b66);return await mkdir(dirname(_0x4ecae4),{'recursive':!![]}),await rename(_0x1ba5c4,_0x4ecae4),_0x4ecae4;}async function cleanupEmptyDirectories(_0x5cad24,_0x4a0807){const _0x50cc12=a38_0x1628a0;let _0x243a0c=resolve(_0x5cad24);const _0x375479=resolve(_0x4a0807);while(_0x243a0c['startsWith'](''+_0x375479+sep)||_0x243a0c===_0x375479){if(_0x243a0c===_0x375479)return;try{const _0x35a060=await readdir(_0x243a0c);if(_0x35a060[_0x50cc12(0x136)]>0x0)return;await rmdir(_0x243a0c);}catch{return;}_0x243a0c=dirname(_0x243a0c);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x5a194e,_0x20ae2b,_0x21752b,_0x1a9f38){const _0x5a7070=a38_0x1628a0;for(let _0x31975a=0x0;_0x31975a<DELETE_SETTLE_RETRY_COUNT;_0x31975a+=0x1){const _0x2c07d8=await readBffLockFile(_0x5a194e),_0x2a3024=!!_0x2c07d8?.[_0x5a7070(0x112)]?.[_0x20ae2b]?.[_0x5a7070(0x13c)]?.[_0x21752b],_0x573ee2=await fileExists(_0x1a9f38);if(!_0x2a3024&&!_0x573ee2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x5a7070(0x13a)+_0x21752b+'.');}
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_0x3ce64b=a39_0xbaf7;function a39_0x3c5c(){const _0x29b4a6=['createdTime','num','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','scriptType','functionName','(none)','7gNLLwF','detail','updatedTime','verbose','1668044QdeWeX','Script\x20ID','boolean','read','2232102NpYJrv','23155740GUNrYh','Return\x20full\x20raw\x20script\x20object','appCode','336869lvxviv','4TZaQAn','1968627VAOlei','number','scriptContent','3027470zmhxPW','updateUserName','108272gRQdPY'];a39_0x3c5c=function(){return _0x29b4a6;};return a39_0x3c5c();}function a39_0xbaf7(_0x40e4f6,_0x11d0ea){_0x40e4f6=_0x40e4f6-0x19f;const _0x3c5cef=a39_0x3c5c();let _0xbaf7ee=_0x3c5cef[_0x40e4f6];return _0xbaf7ee;}(function(_0x2f55ff,_0x44a881){const _0x18da56=a39_0xbaf7,_0xf33662=_0x2f55ff();while(!![]){try{const _0x386fed=parseInt(_0x18da56(0x1b0))/0x1+-parseInt(_0x18da56(0x1a8))/0x2+-parseInt(_0x18da56(0x1b2))/0x3*(parseInt(_0x18da56(0x1b1))/0x4)+-parseInt(_0x18da56(0x1b5))/0x5+-parseInt(_0x18da56(0x1ac))/0x6*(parseInt(_0x18da56(0x1a4))/0x7)+-parseInt(_0x18da56(0x1b7))/0x8+parseInt(_0x18da56(0x1ad))/0x9;if(_0x386fed===_0x44a881)break;else _0xf33662['push'](_0xf33662['shift']());}catch(_0x3cd7bd){_0xf33662['push'](_0xf33662['shift']());}}}(a39_0x3c5c,0x689a5));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a39_0x3ce64b(0x1a5),'description':a39_0x3ce64b(0x1a0),'risk':a39_0x3ce64b(0x1ab),'flags':[{'name':'id','type':a39_0x3ce64b(0x1b3),'required':!![],'description':a39_0x3ce64b(0x1a9)},{'name':a39_0x3ce64b(0x1a7),'type':a39_0x3ce64b(0x1aa),'description':a39_0x3ce64b(0x1ae)}],async 'execute'(_0x16531d){const _0x45d315=a39_0x3ce64b,_0x3df051=await getBffScriptInfo(_0x16531d[_0x45d315(0x19f)]('id')),_0x453442=_0x16531d['bool'](_0x45d315(0x1a7));if(_0x453442)return{'ok':!![],'data':_0x3df051};return{'ok':!![],'data':{'id':_0x3df051['id'],'functionName':_0x3df051[_0x45d315(0x1a2)]??'','version':_0x3df051['version']??'','updateUserName':_0x3df051[_0x45d315(0x1b6)]??'','appCode':_0x3df051[_0x45d315(0x1af)],'scriptType':_0x3df051[_0x45d315(0x1a1)],'description':_0x3df051['description']||_0x45d315(0x1a3),'createdTime':_0x3df051[_0x45d315(0x1b8)]??'','updatedTime':_0x3df051[_0x45d315(0x1a6)]??'','scriptContent':_0x3df051[_0x45d315(0x1b4)]??''}};}};
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(_0x1e6fab,_0x1db54e){const _0x38a636=a40_0x4e97,_0x135395=_0x1e6fab();while(!![]){try{const _0x2c4269=parseInt(_0x38a636(0xfc))/0x1*(-parseInt(_0x38a636(0x101))/0x2)+parseInt(_0x38a636(0xfe))/0x3+-parseInt(_0x38a636(0xfb))/0x4+-parseInt(_0x38a636(0x100))/0x5+-parseInt(_0x38a636(0xff))/0x6+-parseInt(_0x38a636(0xfa))/0x7+parseInt(_0x38a636(0xfd))/0x8;if(_0x2c4269===_0x1db54e)break;else _0x135395['push'](_0x135395['shift']());}catch(_0x558c2a){_0x135395['push'](_0x135395['shift']());}}}(a40_0x45ad,0x93b4a));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a40_0x4e97(_0x1ad6c1,_0x2b6996){_0x1ad6c1=_0x1ad6c1-0xfa;const _0x45adb2=a40_0x45ad();let _0x4e9715=_0x45adb2[_0x1ad6c1];return _0x4e9715;}import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x45ad(){const _0x51f9f1=['18862024KQZRBm','102672AtVSwC','497394otzQdx','2525600nWoQbY','218irqHMJ','1355193sXRBPG','547816HLaKpO','7967Hfozst'];a40_0x45ad=function(){return _0x51f9f1;};return a40_0x45ad();}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];
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];