@lovrabet/rabetbase-cli 2.3.16-beta.3 → 2.3.16-beta.5

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 (568) hide show
  1. package/lib/api/api-doc.d.ts +9 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.d.ts +2 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +8 -0
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/auth/auth-server-ui.d.ts +13 -0
  8. package/lib/auth/auth-server-ui.js +1 -1
  9. package/lib/auth/auth-server.d.ts +25 -0
  10. package/lib/auth/auth-server.js +1 -1
  11. package/lib/auth/constant.d.ts +2 -0
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.d.ts +1 -0
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +51 -0
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.d.ts +1 -0
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/login-success-html.d.ts +5 -0
  20. package/lib/auth/login-success-html.js +1 -1
  21. package/lib/auth/logout.d.ts +1 -0
  22. package/lib/auth/logout.js +1 -1
  23. package/lib/cli-flags.d.ts +12 -0
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.d.ts +2 -0
  26. package/lib/cli.js +1 -1
  27. package/lib/commands/api/generate.d.ts +2 -0
  28. package/lib/commands/api/generate.js +1 -1
  29. package/lib/commands/api/index.d.ts +2 -0
  30. package/lib/commands/api/index.js +1 -1
  31. package/lib/commands/api/list.d.ts +2 -0
  32. package/lib/commands/api/list.js +1 -1
  33. package/lib/commands/api/pull.d.ts +2 -0
  34. package/lib/commands/api/pull.js +1 -1
  35. package/lib/commands/api/shared.d.ts +18 -0
  36. package/lib/commands/api/shared.js +1 -1
  37. package/lib/commands/app/index.d.ts +5 -0
  38. package/lib/commands/app/index.js +1 -1
  39. package/lib/commands/app/list.d.ts +10 -0
  40. package/lib/commands/app/list.js +1 -1
  41. package/lib/commands/app/members-list.d.ts +2 -0
  42. package/lib/commands/app/members-list.js +1 -1
  43. package/lib/commands/app/remote-directory.d.ts +11 -0
  44. package/lib/commands/app/remote-directory.js +1 -1
  45. package/lib/commands/app/shared.d.ts +46 -0
  46. package/lib/commands/app/shared.js +1 -1
  47. package/lib/commands/app-config/delete.d.ts +2 -0
  48. package/lib/commands/app-config/delete.js +1 -1
  49. package/lib/commands/app-config/get.d.ts +2 -0
  50. package/lib/commands/app-config/get.js +1 -1
  51. package/lib/commands/app-config/index.d.ts +2 -0
  52. package/lib/commands/app-config/index.js +1 -1
  53. package/lib/commands/app-config/list.d.ts +2 -0
  54. package/lib/commands/app-config/list.js +1 -1
  55. package/lib/commands/app-config/set.d.ts +2 -0
  56. package/lib/commands/app-config/set.js +1 -1
  57. package/lib/commands/app-config/shared.d.ts +105 -0
  58. package/lib/commands/app-config/shared.js +1 -1
  59. package/lib/commands/auth/index.d.ts +2 -0
  60. package/lib/commands/auth/index.js +1 -1
  61. package/lib/commands/bff/create.d.ts +4 -0
  62. package/lib/commands/bff/create.js +1 -1
  63. package/lib/commands/bff/delete.d.ts +2 -0
  64. package/lib/commands/bff/delete.js +1 -1
  65. package/lib/commands/bff/detail.d.ts +2 -0
  66. package/lib/commands/bff/detail.js +1 -1
  67. package/lib/commands/bff/index.d.ts +5 -0
  68. package/lib/commands/bff/index.js +1 -1
  69. package/lib/commands/bff/list.d.ts +2 -0
  70. package/lib/commands/bff/list.js +1 -1
  71. package/lib/commands/bff/pull.d.ts +2 -0
  72. package/lib/commands/bff/pull.js +1 -1
  73. package/lib/commands/bff/push.d.ts +2 -0
  74. package/lib/commands/bff/push.js +1 -1
  75. package/lib/commands/bff/status.d.ts +2 -0
  76. package/lib/commands/bff/status.js +1 -1
  77. package/lib/commands/cli-skill/index.d.ts +8 -0
  78. package/lib/commands/cli-skill/index.js +1 -1
  79. package/lib/commands/cli-update.d.ts +2 -0
  80. package/lib/commands/cli-update.js +1 -1
  81. package/lib/commands/codegen/index.d.ts +2 -0
  82. package/lib/commands/codegen/index.js +1 -1
  83. package/lib/commands/codegen/sdk.d.ts +2 -0
  84. package/lib/commands/codegen/sdk.js +1 -1
  85. package/lib/commands/codegen/sql.d.ts +2 -0
  86. package/lib/commands/codegen/sql.js +1 -1
  87. package/lib/commands/common/app-registry.d.ts +17 -0
  88. package/lib/commands/common/app-registry.js +1 -1
  89. package/lib/commands/common/app-selector.d.ts +17 -0
  90. package/lib/commands/common/app-selector.js +1 -1
  91. package/lib/commands/common/async-task.d.ts +11 -0
  92. package/lib/commands/common/async-task.js +1 -1
  93. package/lib/commands/common/dry-run.d.ts +12 -0
  94. package/lib/commands/common/dry-run.js +1 -1
  95. package/lib/commands/common/flags.d.ts +26 -0
  96. package/lib/commands/common/flags.js +1 -1
  97. package/lib/commands/common/local-file.d.ts +6 -0
  98. package/lib/commands/common/local-file.js +1 -1
  99. package/lib/commands/common/validate.d.ts +13 -0
  100. package/lib/commands/common/validate.js +1 -1
  101. package/lib/commands/config/get.d.ts +5 -0
  102. package/lib/commands/config/get.js +1 -1
  103. package/lib/commands/config/index.d.ts +5 -0
  104. package/lib/commands/config/index.js +1 -1
  105. package/lib/commands/config/list.d.ts +5 -0
  106. package/lib/commands/config/list.js +1 -1
  107. package/lib/commands/config/set.d.ts +5 -0
  108. package/lib/commands/config/set.js +1 -1
  109. package/lib/commands/config/shared.d.ts +16 -0
  110. package/lib/commands/config/shared.js +1 -1
  111. package/lib/commands/data/filter.d.ts +7 -0
  112. package/lib/commands/data/filter.js +1 -1
  113. package/lib/commands/data/getOne.d.ts +7 -0
  114. package/lib/commands/data/getOne.js +1 -1
  115. package/lib/commands/data/index.d.ts +8 -0
  116. package/lib/commands/data/index.js +1 -1
  117. package/lib/commands/data/shared.d.ts +33 -0
  118. package/lib/commands/data/shared.js +1 -1
  119. package/lib/commands/dataset/business-group-update.d.ts +18 -0
  120. package/lib/commands/dataset/business-group-update.js +1 -1
  121. package/lib/commands/dataset/capability.d.ts +11 -0
  122. package/lib/commands/dataset/capability.js +1 -1
  123. package/lib/commands/dataset/delete.d.ts +2 -0
  124. package/lib/commands/dataset/delete.js +1 -1
  125. package/lib/commands/dataset/detail.d.ts +2 -0
  126. package/lib/commands/dataset/detail.js +1 -1
  127. package/lib/commands/dataset/extend-update.d.ts +26 -0
  128. package/lib/commands/dataset/extend-update.js +1 -1
  129. package/lib/commands/dataset/field-update.d.ts +27 -0
  130. package/lib/commands/dataset/field-update.js +1 -1
  131. package/lib/commands/dataset/generate.d.ts +3 -0
  132. package/lib/commands/dataset/generate.js +1 -1
  133. package/lib/commands/dataset/index.d.ts +2 -0
  134. package/lib/commands/dataset/index.js +1 -1
  135. package/lib/commands/dataset/list.d.ts +2 -0
  136. package/lib/commands/dataset/list.js +1 -1
  137. package/lib/commands/dataset/operations.d.ts +2 -0
  138. package/lib/commands/dataset/operations.js +1 -1
  139. package/lib/commands/dataset/relation-audit.d.ts +2 -0
  140. package/lib/commands/dataset/relation-audit.js +1 -1
  141. package/lib/commands/dataset/relation-create.d.ts +2 -0
  142. package/lib/commands/dataset/relation-create.js +1 -1
  143. package/lib/commands/dataset/relation-delete.d.ts +2 -0
  144. package/lib/commands/dataset/relation-delete.js +1 -1
  145. package/lib/commands/dataset/relation-shared.d.ts +128 -0
  146. package/lib/commands/dataset/relation-shared.js +1 -1
  147. package/lib/commands/dataset/relation-update.d.ts +2 -0
  148. package/lib/commands/dataset/relation-update.js +1 -1
  149. package/lib/commands/dataset/relations.d.ts +53 -0
  150. package/lib/commands/dataset/relations.js +1 -1
  151. package/lib/commands/dataset/rename.d.ts +17 -0
  152. package/lib/commands/dataset/rename.js +1 -1
  153. package/lib/commands/dataset/restore.d.ts +2 -0
  154. package/lib/commands/dataset/restore.js +1 -1
  155. package/lib/commands/db/analysis-batching.d.ts +30 -0
  156. package/lib/commands/db/analysis-batching.js +1 -1
  157. package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
  158. package/lib/commands/db/analyze-batch-plan.js +1 -1
  159. package/lib/commands/db/analyze-cancel.d.ts +2 -0
  160. package/lib/commands/db/analyze-cancel.js +1 -1
  161. package/lib/commands/db/analyze-start.d.ts +2 -0
  162. package/lib/commands/db/analyze-start.js +1 -1
  163. package/lib/commands/db/analyze-status.d.ts +2 -0
  164. package/lib/commands/db/analyze-status.js +1 -1
  165. package/lib/commands/db/create.d.ts +2 -0
  166. package/lib/commands/db/create.js +1 -1
  167. package/lib/commands/db/delete.d.ts +2 -0
  168. package/lib/commands/db/delete.js +1 -1
  169. package/lib/commands/db/detail.d.ts +2 -0
  170. package/lib/commands/db/detail.js +1 -1
  171. package/lib/commands/db/diff.d.ts +2 -0
  172. package/lib/commands/db/diff.js +1 -1
  173. package/lib/commands/db/index.d.ts +5 -0
  174. package/lib/commands/db/index.js +1 -1
  175. package/lib/commands/db/list.d.ts +2 -0
  176. package/lib/commands/db/list.js +1 -1
  177. package/lib/commands/db/shared.d.ts +15 -0
  178. package/lib/commands/db/shared.js +1 -1
  179. package/lib/commands/db/tables.d.ts +2 -0
  180. package/lib/commands/db/tables.js +1 -1
  181. package/lib/commands/db/test.d.ts +2 -0
  182. package/lib/commands/db/test.js +1 -1
  183. package/lib/commands/db/update.d.ts +2 -0
  184. package/lib/commands/db/update.js +1 -1
  185. package/lib/commands/doctor.d.ts +2 -0
  186. package/lib/commands/doctor.js +1 -1
  187. package/lib/commands/file/index.d.ts +2 -0
  188. package/lib/commands/file/index.js +1 -1
  189. package/lib/commands/init/index.d.ts +11 -0
  190. package/lib/commands/init/index.js +1 -1
  191. package/lib/commands/issue/index.d.ts +2 -0
  192. package/lib/commands/issue/index.js +1 -1
  193. package/lib/commands/issue/nudge.d.ts +23 -0
  194. package/lib/commands/issue/nudge.js +1 -1
  195. package/lib/commands/issue/report.d.ts +2 -0
  196. package/lib/commands/issue/report.js +1 -1
  197. package/lib/commands/issue/shared.d.ts +32 -0
  198. package/lib/commands/issue/shared.js +1 -1
  199. package/lib/commands/kb/create.d.ts +2 -0
  200. package/lib/commands/kb/create.js +1 -1
  201. package/lib/commands/kb/delete.d.ts +2 -0
  202. package/lib/commands/kb/delete.js +1 -1
  203. package/lib/commands/kb/detail.d.ts +2 -0
  204. package/lib/commands/kb/detail.js +1 -1
  205. package/lib/commands/kb/index.d.ts +2 -0
  206. package/lib/commands/kb/index.js +1 -1
  207. package/lib/commands/kb/list.d.ts +2 -0
  208. package/lib/commands/kb/list.js +1 -1
  209. package/lib/commands/kb/shared.d.ts +33 -0
  210. package/lib/commands/kb/shared.js +1 -1
  211. package/lib/commands/kb/update.d.ts +2 -0
  212. package/lib/commands/kb/update.js +1 -1
  213. package/lib/commands/logs/index.d.ts +5 -0
  214. package/lib/commands/logs/index.js +1 -1
  215. package/lib/commands/menu/asset-update.d.ts +2 -0
  216. package/lib/commands/menu/asset-update.js +1 -1
  217. package/lib/commands/menu/delete.d.ts +2 -0
  218. package/lib/commands/menu/delete.js +1 -1
  219. package/lib/commands/menu/external-link-create.d.ts +3 -0
  220. package/lib/commands/menu/external-link-create.js +1 -1
  221. package/lib/commands/menu/external-link-update.d.ts +2 -0
  222. package/lib/commands/menu/external-link-update.js +1 -1
  223. package/lib/commands/menu/group-create.d.ts +2 -0
  224. package/lib/commands/menu/group-create.js +1 -1
  225. package/lib/commands/menu/group-update.d.ts +2 -0
  226. package/lib/commands/menu/group-update.js +1 -1
  227. package/lib/commands/menu/index.d.ts +17 -0
  228. package/lib/commands/menu/index.js +1 -1
  229. package/lib/commands/menu/list.d.ts +2 -0
  230. package/lib/commands/menu/list.js +1 -1
  231. package/lib/commands/menu/move.d.ts +2 -0
  232. package/lib/commands/menu/move.js +1 -1
  233. package/lib/commands/menu/regroup-start.d.ts +2 -0
  234. package/lib/commands/menu/regroup-start.js +1 -1
  235. package/lib/commands/menu/rename.d.ts +2 -0
  236. package/lib/commands/menu/rename.js +1 -1
  237. package/lib/commands/menu/shared/compare-table.d.ts +27 -0
  238. package/lib/commands/menu/shared/compare-table.js +1 -1
  239. package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
  240. package/lib/commands/menu/shared/delete-plan.js +1 -1
  241. package/lib/commands/menu/shared/facts.d.ts +12 -0
  242. package/lib/commands/menu/shared/facts.js +1 -1
  243. package/lib/commands/menu/shared/index.d.ts +12 -0
  244. package/lib/commands/menu/shared/index.js +1 -1
  245. package/lib/commands/menu/shared/inquirer.d.ts +10 -0
  246. package/lib/commands/menu/shared/inquirer.js +1 -1
  247. package/lib/commands/menu/shared/local-pages.d.ts +12 -0
  248. package/lib/commands/menu/shared/local-pages.js +1 -1
  249. package/lib/commands/menu/shared/logic.d.ts +28 -0
  250. package/lib/commands/menu/shared/logic.js +1 -1
  251. package/lib/commands/menu/shared/mutations.d.ts +69 -0
  252. package/lib/commands/menu/shared/mutations.js +1 -1
  253. package/lib/commands/menu/shared/service.d.ts +17 -0
  254. package/lib/commands/menu/shared/service.js +1 -1
  255. package/lib/commands/menu/shared/sync-core.d.ts +7 -0
  256. package/lib/commands/menu/shared/sync-core.js +1 -1
  257. package/lib/commands/menu/shared/types.d.ts +162 -0
  258. package/lib/commands/menu/shared/update-core.d.ts +11 -0
  259. package/lib/commands/menu/shared/update-core.js +1 -1
  260. package/lib/commands/menu/shared/valid-url.d.ts +6 -0
  261. package/lib/commands/menu/shared/valid-url.js +1 -1
  262. package/lib/commands/menu/sync.d.ts +2 -0
  263. package/lib/commands/menu/sync.js +1 -1
  264. package/lib/commands/notification/config-list.d.ts +2 -0
  265. package/lib/commands/notification/config-list.js +1 -1
  266. package/lib/commands/notification/index.d.ts +2 -0
  267. package/lib/commands/notification/index.js +1 -1
  268. package/lib/commands/ocr/index.d.ts +2 -0
  269. package/lib/commands/ocr/index.js +1 -1
  270. package/lib/commands/page/generate-start.d.ts +2 -0
  271. package/lib/commands/page/generate-start.js +1 -1
  272. package/lib/commands/page/generate-status.d.ts +2 -0
  273. package/lib/commands/page/generate-status.js +1 -1
  274. package/lib/commands/page/index.d.ts +2 -0
  275. package/lib/commands/page/index.js +1 -1
  276. package/lib/commands/page/pull.d.ts +2 -0
  277. package/lib/commands/page/pull.js +1 -1
  278. package/lib/commands/page/push.d.ts +2 -0
  279. package/lib/commands/page/push.js +1 -1
  280. package/lib/commands/page/relation-audit.d.ts +2 -0
  281. package/lib/commands/page/relation-audit.js +1 -1
  282. package/lib/commands/page/restore.d.ts +2 -0
  283. package/lib/commands/page/restore.js +1 -1
  284. package/lib/commands/page/shared.d.ts +105 -0
  285. package/lib/commands/page/shared.js +1 -1
  286. package/lib/commands/page/standard-page-status.d.ts +2 -0
  287. package/lib/commands/page/standard-page-status.js +1 -1
  288. package/lib/commands/page/sync.d.ts +2 -0
  289. package/lib/commands/page/sync.js +1 -1
  290. package/lib/commands/permit/index.d.ts +2 -0
  291. package/lib/commands/permit/index.js +1 -1
  292. package/lib/commands/permit/page-get.d.ts +2 -0
  293. package/lib/commands/permit/page-get.js +1 -1
  294. package/lib/commands/permit/page-set.d.ts +2 -0
  295. package/lib/commands/permit/page-set.js +1 -1
  296. package/lib/commands/permit/role-apis-set.d.ts +2 -0
  297. package/lib/commands/permit/role-apis-set.js +1 -1
  298. package/lib/commands/permit/role-menus-set.d.ts +2 -0
  299. package/lib/commands/permit/role-menus-set.js +1 -1
  300. package/lib/commands/permit/role-menus.d.ts +2 -0
  301. package/lib/commands/permit/role-menus.js +1 -1
  302. package/lib/commands/permit/shared.d.ts +74 -0
  303. package/lib/commands/permit/shared.js +1 -1
  304. package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
  305. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  306. package/lib/commands/project/create/format-elapsed.d.ts +1 -0
  307. package/lib/commands/project/create/format-elapsed.js +1 -1
  308. package/lib/commands/project/create/main.d.ts +6 -0
  309. package/lib/commands/project/create/main.js +1 -1
  310. package/lib/commands/project/create/non-interactive.d.ts +9 -0
  311. package/lib/commands/project/create/non-interactive.js +1 -1
  312. package/lib/commands/project/create/project-template-path.d.ts +4 -0
  313. package/lib/commands/project/create/project-template-path.js +1 -1
  314. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
  315. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  316. package/lib/commands/project/create/use-format-code.d.ts +1 -0
  317. package/lib/commands/project/create/use-format-code.js +1 -1
  318. package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
  319. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  320. package/lib/commands/project/index.d.ts +2 -0
  321. package/lib/commands/project/index.js +1 -1
  322. package/lib/commands/project/upgrade.d.ts +1 -0
  323. package/lib/commands/project/upgrade.js +1 -1
  324. package/lib/commands/registry.d.ts +66 -0
  325. package/lib/commands/registry.js +1 -1
  326. package/lib/commands/role/create.d.ts +2 -0
  327. package/lib/commands/role/create.js +1 -1
  328. package/lib/commands/role/delete.d.ts +2 -0
  329. package/lib/commands/role/delete.js +1 -1
  330. package/lib/commands/role/detail.d.ts +2 -0
  331. package/lib/commands/role/detail.js +1 -1
  332. package/lib/commands/role/index.d.ts +2 -0
  333. package/lib/commands/role/index.js +1 -1
  334. package/lib/commands/role/list.d.ts +2 -0
  335. package/lib/commands/role/list.js +1 -1
  336. package/lib/commands/role/shared.d.ts +107 -0
  337. package/lib/commands/role/shared.js +1 -1
  338. package/lib/commands/role/update.d.ts +2 -0
  339. package/lib/commands/role/update.js +1 -1
  340. package/lib/commands/role/user-add.d.ts +2 -0
  341. package/lib/commands/role/user-add.js +1 -1
  342. package/lib/commands/role/user-remove.d.ts +2 -0
  343. package/lib/commands/role/user-remove.js +1 -1
  344. package/lib/commands/role/user-resolve.d.ts +2 -0
  345. package/lib/commands/role/user-resolve.js +1 -1
  346. package/lib/commands/run/index.d.ts +2 -0
  347. package/lib/commands/run/index.js +1 -1
  348. package/lib/commands/schema.d.ts +5 -0
  349. package/lib/commands/schema.js +1 -1
  350. package/lib/commands/sql/create.d.ts +10 -0
  351. package/lib/commands/sql/create.js +1 -1
  352. package/lib/commands/sql/delete.d.ts +5 -0
  353. package/lib/commands/sql/delete.js +1 -1
  354. package/lib/commands/sql/detail.d.ts +2 -0
  355. package/lib/commands/sql/detail.js +1 -1
  356. package/lib/commands/sql/exec.d.ts +2 -0
  357. package/lib/commands/sql/exec.js +1 -1
  358. package/lib/commands/sql/index.d.ts +5 -0
  359. package/lib/commands/sql/index.js +1 -1
  360. package/lib/commands/sql/list.d.ts +2 -0
  361. package/lib/commands/sql/list.js +1 -1
  362. package/lib/commands/sql/pull.d.ts +5 -0
  363. package/lib/commands/sql/pull.js +1 -1
  364. package/lib/commands/sql/push.d.ts +5 -0
  365. package/lib/commands/sql/push.js +1 -1
  366. package/lib/commands/sql/shared.d.ts +23 -0
  367. package/lib/commands/sql/shared.js +1 -1
  368. package/lib/commands/sql/status.d.ts +5 -0
  369. package/lib/commands/sql/status.js +1 -1
  370. package/lib/commands/sql/validate.d.ts +2 -0
  371. package/lib/commands/sql/validate.js +1 -1
  372. package/lib/commands/task/index.d.ts +2 -0
  373. package/lib/commands/task/index.js +1 -1
  374. package/lib/commands/task/status.d.ts +2 -0
  375. package/lib/commands/task/status.js +1 -1
  376. package/lib/commands/tenant/index.d.ts +2 -0
  377. package/lib/commands/tenant/index.js +1 -1
  378. package/lib/commands/tenant/members-list.d.ts +2 -0
  379. package/lib/commands/tenant/members-list.js +1 -1
  380. package/lib/commands/tenant/shared.d.ts +10 -0
  381. package/lib/commands/tenant/shared.js +1 -1
  382. package/lib/commands/workspace/add.d.ts +6 -0
  383. package/lib/commands/workspace/add.js +1 -1
  384. package/lib/commands/workspace/index.d.ts +11 -0
  385. package/lib/commands/workspace/index.js +1 -1
  386. package/lib/commands/workspace/remove.d.ts +6 -0
  387. package/lib/commands/workspace/remove.js +1 -1
  388. package/lib/config/schema.d.ts +50 -0
  389. package/lib/config/schema.js +1 -1
  390. package/lib/constant/cdn.d.ts +1 -0
  391. package/lib/constant/cdn.js +1 -1
  392. package/lib/constant/cli.d.ts +34 -0
  393. package/lib/constant/cli.js +1 -1
  394. package/lib/constant/defaults.d.ts +10 -0
  395. package/lib/constant/defaults.js +1 -1
  396. package/lib/constant/domain.d.ts +14 -0
  397. package/lib/constant/domain.js +1 -1
  398. package/lib/constant/env.d.ts +11 -0
  399. package/lib/constant/env.js +1 -1
  400. package/lib/constant/output.d.ts +1 -0
  401. package/lib/constant/output.js +1 -1
  402. package/lib/constant/paths.d.ts +5 -0
  403. package/lib/constant/paths.js +1 -1
  404. package/lib/constant/risk.d.ts +1 -0
  405. package/lib/constant/risk.js +1 -1
  406. package/lib/context/app-resolver.d.ts +36 -0
  407. package/lib/context/app-resolver.js +1 -1
  408. package/lib/context/auth-resolver.d.ts +5 -0
  409. package/lib/context/auth-resolver.js +1 -1
  410. package/lib/context/config-loader.d.ts +61 -0
  411. package/lib/context/config-loader.js +1 -1
  412. package/lib/context.d.ts +102 -0
  413. package/lib/context.js +1 -1
  414. package/lib/core/alias-resolver.d.ts +31 -0
  415. package/lib/core/alias-resolver.js +1 -1
  416. package/lib/core/api-client.d.ts +1018 -0
  417. package/lib/core/api-client.js +1 -1
  418. package/lib/core/bff/config.d.ts +8 -0
  419. package/lib/core/bff/config.js +1 -1
  420. package/lib/core/bff/file-system.d.ts +28 -0
  421. package/lib/core/bff/file-system.js +1 -1
  422. package/lib/core/bff/hash.d.ts +7 -0
  423. package/lib/core/bff/hash.js +1 -1
  424. package/lib/core/bff/lock.d.ts +25 -0
  425. package/lib/core/bff/lock.js +1 -1
  426. package/lib/core/bff/types.d.ts +92 -0
  427. package/lib/core/bff/utils.d.ts +25 -0
  428. package/lib/core/bff/utils.js +1 -1
  429. package/lib/core/db-resolver.d.ts +43 -0
  430. package/lib/core/db-resolver.js +1 -1
  431. package/lib/core/page/file-system.d.ts +6 -0
  432. package/lib/core/page/file-system.js +1 -1
  433. package/lib/core/page/hash.d.ts +4 -0
  434. package/lib/core/page/hash.js +1 -1
  435. package/lib/core/page/lock.d.ts +8 -0
  436. package/lib/core/page/lock.js +1 -1
  437. package/lib/core/page/types.d.ts +22 -0
  438. package/lib/core/sql-index-auditor.d.ts +33 -0
  439. package/lib/core/sql-index-auditor.js +1 -1
  440. package/lib/core/sql-sync/config.d.ts +7 -0
  441. package/lib/core/sql-sync/config.js +1 -1
  442. package/lib/core/sql-sync/file-system.d.ts +7 -0
  443. package/lib/core/sql-sync/file-system.js +1 -1
  444. package/lib/core/sql-sync/hash.d.ts +5 -0
  445. package/lib/core/sql-sync/hash.js +1 -1
  446. package/lib/core/sql-sync/lock.d.ts +14 -0
  447. package/lib/core/sql-sync/lock.js +1 -1
  448. package/lib/core/sql-sync/types.d.ts +43 -0
  449. package/lib/core/sql-sync/utils.d.ts +10 -0
  450. package/lib/core/sql-sync/utils.js +1 -1
  451. package/lib/core/sql-validator.d.ts +34 -0
  452. package/lib/core/sql-validator.js +1 -1
  453. package/lib/errors.d.ts +3 -0
  454. package/lib/errors.js +1 -1
  455. package/lib/framework/build-all-flags.d.ts +2 -0
  456. package/lib/framework/build-all-flags.js +1 -1
  457. package/lib/framework/error-output.d.ts +9 -0
  458. package/lib/framework/error-output.js +1 -1
  459. package/lib/framework/explicit-yes.d.ts +3 -0
  460. package/lib/framework/explicit-yes.js +1 -1
  461. package/lib/framework/flags.d.ts +3 -0
  462. package/lib/framework/flags.js +1 -1
  463. package/lib/framework/help.d.ts +4 -0
  464. package/lib/framework/help.js +1 -1
  465. package/lib/framework/index.d.ts +11 -0
  466. package/lib/framework/index.js +1 -1
  467. package/lib/framework/output.d.ts +15 -0
  468. package/lib/framework/output.js +1 -1
  469. package/lib/framework/response.d.ts +2 -0
  470. package/lib/framework/response.js +1 -1
  471. package/lib/framework/runner-alias.d.ts +14 -0
  472. package/lib/framework/runner-alias.js +1 -1
  473. package/lib/framework/runner.d.ts +36 -0
  474. package/lib/framework/runner.js +1 -1
  475. package/lib/framework/schema-export.d.ts +3 -0
  476. package/lib/framework/schema-export.js +1 -1
  477. package/lib/framework/types.d.ts +63 -0
  478. package/lib/framework/types.js +1 -1
  479. package/lib/generated/build-info.d.ts +4 -0
  480. package/lib/generated/build-info.js +1 -1
  481. package/lib/help.d.ts +1 -0
  482. package/lib/help.js +1 -1
  483. package/lib/runtime/confirmation.d.ts +4 -0
  484. package/lib/runtime/confirmation.js +1 -0
  485. package/lib/runtime/event.d.ts +5 -0
  486. package/lib/runtime/event.js +1 -0
  487. package/lib/runtime/index.d.ts +7 -0
  488. package/lib/runtime/index.js +1 -0
  489. package/lib/runtime/queue.d.ts +5 -0
  490. package/lib/runtime/queue.js +1 -0
  491. package/lib/runtime/resolve.d.ts +8 -0
  492. package/lib/runtime/resolve.js +1 -0
  493. package/lib/runtime/types.d.ts +50 -0
  494. package/lib/runtime/types.js +1 -0
  495. package/lib/skills/main.d.ts +41 -0
  496. package/lib/skills/main.js +1 -1
  497. package/lib/skills/npx-skills-add.d.ts +99 -0
  498. package/lib/skills/npx-skills-add.js +1 -1
  499. package/lib/skills/skill-presence.d.ts +44 -0
  500. package/lib/skills/skill-presence.js +1 -1
  501. package/lib/telemetry/cli-command-trace.d.ts +12 -0
  502. package/lib/telemetry/cli-command-trace.js +1 -1
  503. package/lib/telemetry/cli-help-trace.d.ts +8 -0
  504. package/lib/telemetry/cli-help-trace.js +1 -1
  505. package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
  506. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  507. package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
  508. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  509. package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
  510. package/lib/telemetry/send-cli-trace-log.js +1 -1
  511. package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
  512. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  513. package/lib/types/index.d.ts +93 -0
  514. package/lib/utils/ai_config.d.ts +47 -0
  515. package/lib/utils/ai_config.js +1 -1
  516. package/lib/utils/apply-jq-filter.d.ts +1 -0
  517. package/lib/utils/apply-jq-filter.js +1 -1
  518. package/lib/utils/cdn-config.d.ts +42 -0
  519. package/lib/utils/cdn-config.js +1 -1
  520. package/lib/utils/check-sdk-version.d.ts +23 -0
  521. package/lib/utils/check-sdk-version.js +1 -1
  522. package/lib/utils/cli-version-check.d.ts +37 -0
  523. package/lib/utils/cli-version-check.js +1 -1
  524. package/lib/utils/cli-version-policy.d.ts +9 -0
  525. package/lib/utils/cli-version-policy.js +1 -1
  526. package/lib/utils/config.d.ts +42 -0
  527. package/lib/utils/config.js +1 -1
  528. package/lib/utils/copy-directory.d.ts +1 -0
  529. package/lib/utils/copy-directory.js +1 -1
  530. package/lib/utils/entity-with-id.d.ts +30 -0
  531. package/lib/utils/entity-with-id.js +1 -1
  532. package/lib/utils/file-utils.d.ts +25 -0
  533. package/lib/utils/file-utils.js +1 -1
  534. package/lib/utils/guides-cdn.d.ts +80 -0
  535. package/lib/utils/guides-cdn.js +1 -1
  536. package/lib/utils/http-client.d.ts +30 -0
  537. package/lib/utils/http-client.js +1 -1
  538. package/lib/utils/is-non-interactive.d.ts +7 -0
  539. package/lib/utils/is-non-interactive.js +1 -1
  540. package/lib/utils/logger.d.ts +62 -0
  541. package/lib/utils/logger.js +1 -1
  542. package/lib/utils/params.d.ts +15 -0
  543. package/lib/utils/params.js +1 -1
  544. package/lib/utils/platform.d.ts +21 -0
  545. package/lib/utils/platform.js +1 -1
  546. package/lib/utils/rules-cdn.d.ts +38 -0
  547. package/lib/utils/rules-cdn.js +1 -1
  548. package/lib/utils/sleep.d.ts +1 -0
  549. package/lib/utils/sleep.js +1 -1
  550. package/lib/utils/template-replacer.d.ts +55 -0
  551. package/lib/utils/template-replacer.js +1 -1
  552. package/lib/utils/update-notice.d.ts +10 -0
  553. package/lib/utils/update-notice.js +1 -1
  554. package/lib/utils/version.d.ts +1 -0
  555. package/lib/utils/version.js +1 -1
  556. package/lib/utils/with-active-cookie.d.ts +1 -0
  557. package/lib/utils/with-active-cookie.js +1 -1
  558. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  559. package/lib/utils/write-cli-side-channel.js +1 -1
  560. package/package.json +9 -1
  561. package/lib/commands/page/react/create.js +0 -1
  562. package/lib/commands/page/react/detail.js +0 -1
  563. package/lib/commands/page/react/list.js +0 -1
  564. package/lib/commands/page/react/publish.js +0 -1
  565. package/lib/commands/page/react/shared.js +0 -1
  566. package/lib/commands/page/react/syntax.js +0 -1
  567. package/lib/commands/page/react/template.js +0 -1
  568. package/lib/commands/page/react/update.js +0 -1
@@ -1 +1 @@
1
- const a216_0x230cbf=a216_0x23cf;(function(_0x48d645,_0x190072){const _0x433371=a216_0x23cf,_0x73ff5f=_0x48d645();while(!![]){try{const _0x1ac9a1=-parseInt(_0x433371(0x226))/0x1*(parseInt(_0x433371(0x120))/0x2)+-parseInt(_0x433371(0x21b))/0x3+parseInt(_0x433371(0x1cd))/0x4+parseInt(_0x433371(0x156))/0x5*(parseInt(_0x433371(0x141))/0x6)+-parseInt(_0x433371(0x19a))/0x7+parseInt(_0x433371(0x225))/0x8*(parseInt(_0x433371(0x168))/0x9)+parseInt(_0x433371(0x1ce))/0xa;if(_0x1ac9a1===_0x190072)break;else _0x73ff5f['push'](_0x73ff5f['shift']());}catch(_0xbe1eb2){_0x73ff5f['push'](_0x73ff5f['shift']());}}}(a216_0x42a8,0xf2507));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x158970){_activeCookie=_0x158970||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol('platform-transport-failure'),PLATFORM_ERROR_CODE=Symbol(a216_0x230cbf(0x133));export function isPlatformTransportFailure(_0x38242d){const _0x3c5195=a216_0x230cbf;return Boolean(_0x38242d&&typeof _0x38242d===_0x3c5195(0x1c2)&&_0x38242d[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x395442){const _0x29653b=a216_0x230cbf;if(!_0x395442||typeof _0x395442!==_0x29653b(0x1c2))return undefined;const _0x370b17=_0x395442[PLATFORM_ERROR_CODE];return typeof _0x370b17===_0x29653b(0x112)&&_0x370b17?_0x370b17:undefined;}function createPlatformApiError(_0x3ae08b,_0x5d1bb0){const _0x4e1bb5=a216_0x230cbf,_0xa64b79=typeof _0x5d1bb0===_0x4e1bb5(0x112)?_0x5d1bb0[_0x4e1bb5(0x1d9)]():typeof _0x5d1bb0===_0x4e1bb5(0x197)?String(_0x5d1bb0):'',_0x5b4d6f=CliErrors['apiError'](_0x3ae08b,_0xa64b79?'API\x20error\x20code:\x20'+_0xa64b79:undefined);return _0xa64b79&&(Object[_0x4e1bb5(0x22d)](_0x5b4d6f,PLATFORM_ERROR_CODE,{'value':_0xa64b79}),Object[_0x4e1bb5(0x22d)](_0x5b4d6f,_0x4e1bb5(0x171),{'value':{'remoteErrorCode':_0xa64b79},'enumerable':![]})),_0x5b4d6f;}function createFetchFailureError(_0x4f82d9,_0x576332){const _0x12b34a=a216_0x230cbf,_0x2a5193=_0x576332 instanceof Error?_0x576332[_0x12b34a(0x20e)]:String(_0x576332),_0x4fd95e=CliErrors[_0x12b34a(0x147)](_0x12b34a(0x1ff)+_0x4f82d9+(_0x2a5193?'\x20('+_0x2a5193+')':''),_0x12b34a(0x1db));return Object['defineProperty'](_0x4fd95e,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x4fd95e;}function createIndeterminateResponseError(_0xc8a913){const _0x19017c=a216_0x230cbf,_0x117d96=CliErrors['apiError'](_0xc8a913+_0x19017c(0x216),_0x19017c(0x1d2));return Object[_0x19017c(0x22d)](_0x117d96,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x117d96;}async function apiRequest(_0xf27853,_0x3ac049={}){const _0x35ef2f=a216_0x230cbf,{method:method=_0x35ef2f(0x19f),body:_0x2a6c5a,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x3ac049,_0x3e4f65=useRuntime?getRuntimeDomain():getApiDomain(),_0x1ba6b=_activeCookie||getCookie(),_0x3dd4c9=''+_0x3e4f65+_0xf27853,_0xcfa69b=new AbortController(),_0x27f136=setTimeout(()=>_0xcfa69b['abort'](),timeout);try{const _0x3b97f4=await fetch(_0x3dd4c9,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x1ba6b,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x2a6c5a?JSON[_0x35ef2f(0x22a)](_0x2a6c5a):undefined,'signal':_0xcfa69b[_0x35ef2f(0x148)]});let _0x4ab27b;try{_0x4ab27b=await _0x3b97f4[_0x35ef2f(0x179)]();}catch(_0x4f093b){if(_0x4f093b instanceof Error&&_0x4f093b[_0x35ef2f(0x11b)]==='AbortError')throw CliErrors[_0x35ef2f(0x147)](_0x35ef2f(0x134)+_0x3dd4c9);if(_0x3b97f4['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors[_0x35ef2f(0x147)](_0x35ef2f(0x21d)+_0x3b97f4[_0x35ef2f(0x162)]+')',_0x3b97f4['status']>=0x190?_0x35ef2f(0x208):undefined);}if(!_0x3b97f4['ok']||_0x4ab27b[_0x35ef2f(0x175)]===![])throw CliErrors[_0x35ef2f(0x147)](_0x4ab27b[_0x35ef2f(0x1c5)]||_0x4ab27b[_0x35ef2f(0x20e)]||_0x35ef2f(0x15c)+_0x3b97f4[_0x35ef2f(0x162)],_0x4ab27b[_0x35ef2f(0x1df)]?'API\x20error\x20code:\x20'+_0x4ab27b[_0x35ef2f(0x1df)]:undefined);return _0x4ab27b;}catch(_0x24bd56){if(_0x24bd56 instanceof CliError)throw _0x24bd56;if(_0x24bd56 instanceof Error&&_0x24bd56[_0x35ef2f(0x11b)]===_0x35ef2f(0x110))throw CliErrors['apiError'](_0x35ef2f(0x134)+_0x3dd4c9);throw createFetchFailureError(_0x3dd4c9,_0x24bd56);}finally{clearTimeout(_0x27f136);}}async function apiFormRequest(_0x4883f6,_0x174b7d,_0x3ed3df={}){const _0x2a9462=a216_0x230cbf,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x3ed3df,_0x40b08a=_activeCookie||getCookie(),_0x6e6c9a=''+getApiDomain()+_0x4883f6,_0x4cdc9d=new AbortController(),_0x528ba5=setTimeout(()=>_0x4cdc9d[_0x2a9462(0x21e)](),timeout);try{const _0x3c60ce=await fetch(_0x6e6c9a,{'method':_0x2a9462(0x204),'headers':{'Cookie':_0x40b08a,'X-Invoke-Source':_0x2a9462(0x1aa)},'body':_0x174b7d,'signal':_0x4cdc9d['signal']});let _0x2bd347;try{_0x2bd347=await _0x3c60ce[_0x2a9462(0x179)]();}catch(_0x4ad4d4){if(_0x4ad4d4 instanceof Error&&_0x4ad4d4[_0x2a9462(0x11b)]==='AbortError')throw CliErrors[_0x2a9462(0x147)]('Request\x20timeout:\x20'+_0x6e6c9a);throw CliErrors['apiError'](_0x2a9462(0x21d)+_0x3c60ce[_0x2a9462(0x162)]+')',_0x3c60ce[_0x2a9462(0x162)]>=0x190?_0x2a9462(0x208):undefined);}if(!_0x3c60ce['ok']||_0x2bd347[_0x2a9462(0x175)]===![])throw CliErrors[_0x2a9462(0x147)](_0x2bd347[_0x2a9462(0x1c5)]||_0x2bd347[_0x2a9462(0x20e)]||_0x2a9462(0x15c)+_0x3c60ce['status'],_0x2bd347[_0x2a9462(0x1df)]?_0x2a9462(0x126)+_0x2bd347['errorCode']:undefined);return _0x2bd347;}catch(_0x4574b6){if(_0x4574b6 instanceof CliError)throw _0x4574b6;if(_0x4574b6 instanceof Error&&_0x4574b6[_0x2a9462(0x11b)]===_0x2a9462(0x110))throw CliErrors[_0x2a9462(0x147)]('Request\x20timeout:\x20'+_0x6e6c9a);throw createFetchFailureError(_0x6e6c9a,_0x4574b6);}finally{clearTimeout(_0x528ba5);}}export async function uploadDevelopmentFile(_0x235874,_0xef199d){const _0x2bd4a0=a216_0x230cbf,_0x42ad9d=await readFile(_0xef199d),_0x528eca=new FormData();_0x528eca[_0x2bd4a0(0x1dd)](_0x2bd4a0(0x1ec),_0x235874),_0x528eca[_0x2bd4a0(0x1dd)]('file',new Blob([new Uint8Array(_0x42ad9d)]),basename(_0xef199d));const _0x471214=await apiFormRequest(_0x2bd4a0(0x1e2),_0x528eca);return _0x471214['data'];}export async function queryDevelopmentFileUrl(_0x4c045a,_0x435ee2={}){const _0x4c31ab=a216_0x230cbf,_0x34effc=await apiRequest(_0x4c31ab(0x16f),{'method':'POST','body':{'filePath':_0x4c045a,'downloadFlag':_0x435ee2[_0x4c31ab(0x19d)]??![],..._0x435ee2[_0x4c31ab(0x22c)]?{'longTerm':!![]}:{}}});return _0x34effc[_0x4c31ab(0x171)];}export async function recognizeDevelopmentOcr(_0x1726c1,_0x215ea4){const _0x3f0fdc=a216_0x230cbf,_0x20a5a8=new URLSearchParams({'url':_0x215ea4[_0x3f0fdc(0x1da)],'type':_0x215ea4[_0x3f0fdc(0x1d4)],'appCode':_0x1726c1}),_0x421dd1=await apiRequest(_0x3f0fdc(0x144)+_0x20a5a8[_0x3f0fdc(0x183)](),{'method':'GET'});return _0x421dd1[_0x3f0fdc(0x171)];}function isAuthFailure(_0x478bab){const _0x46a826=a216_0x230cbf,_0x5eaffd=_0x478bab[_0x46a826(0x1c5)]||_0x478bab[_0x46a826(0x20e)]||_0x478bab['data']?.[_0x46a826(0x20e)]||_0x478bab[_0x46a826(0x233)]||_0x478bab[_0x46a826(0x1d1)]||'';return _0x478bab[_0x46a826(0x1df)]===_0x46a826(0x20f)||_0x478bab[_0x46a826(0x137)]===0x191||_0x478bab[_0x46a826(0x137)]===_0x46a826(0x182)||_0x5eaffd[_0x46a826(0x1a8)]('401')||_0x5eaffd['includes']('Unauthorized')||_0x5eaffd[_0x46a826(0x1a8)]('登录')||_0x5eaffd[_0x46a826(0x1a8)]('认证');}export async function platformFetch(_0x26c4ac,_0x4c408d){const _0x450ee8=a216_0x230cbf;let _0x4e147b;try{_0x4e147b=await fetch(_0x26c4ac,{'method':_0x4c408d['method']??_0x450ee8(0x19f),'headers':{'Content-Type':_0x450ee8(0x121),'Cookie':_0x4c408d['cookie'],'X-Invoke-Source':_0x450ee8(0x1aa)},..._0x4c408d[_0x450ee8(0x143)]&&{'body':JSON[_0x450ee8(0x22a)](_0x4c408d[_0x450ee8(0x143)])}});}catch(_0x25d269){throw createFetchFailureError(_0x26c4ac,_0x25d269);}let _0x4ce6a8;try{_0x4ce6a8=await _0x4e147b[_0x450ee8(0x179)]();}catch(_0x1a6f92){if(!_0x4e147b['ok']){if(_0x4e147b[_0x450ee8(0x162)]===0x191)throw CliErrors[_0x450ee8(0x16a)]();throw CliErrors['apiError'](_0x4c408d[_0x450ee8(0x165)]+_0x450ee8(0x224)+_0x4e147b['status']);}throw createFetchFailureError(_0x26c4ac,_0x1a6f92);}if(_0x4ce6a8===null||typeof _0x4ce6a8!==_0x450ee8(0x1c2)||Array[_0x450ee8(0x1e3)](_0x4ce6a8)){if(_0x4e147b[_0x450ee8(0x162)]===0x191)throw CliErrors[_0x450ee8(0x16a)]();if(_0x4e147b['ok'])throw createIndeterminateResponseError(_0x4c408d['label']);throw CliErrors['apiError'](_0x4c408d[_0x450ee8(0x165)]+_0x450ee8(0x11c)+(!_0x4e147b['ok']?_0x450ee8(0x131)+_0x4e147b[_0x450ee8(0x162)]:'')+_0x450ee8(0x1d5));}const _0x452436=typeof _0x4ce6a8[_0x450ee8(0x1df)]===_0x450ee8(0x112)||typeof _0x4ce6a8[_0x450ee8(0x1df)]==='number',_0x564b49=_0x452436?String(_0x4ce6a8[_0x450ee8(0x1df)])[_0x450ee8(0x1d9)]():'',_0x36925c=_0x4ce6a8[_0x450ee8(0x175)]===![]||_0x452436&&_0x564b49!==_0x450ee8(0x17b);if(!_0x4e147b['ok']||_0x36925c){if(_0x4e147b[_0x450ee8(0x162)]===0x191||isAuthFailure(_0x4ce6a8))throw CliErrors[_0x450ee8(0x16a)]();throw createPlatformApiError(_0x4ce6a8['errorMsg']||_0x4ce6a8['message']||_0x4c408d['label']+_0x450ee8(0x11c)+(!_0x4e147b['ok']?_0x450ee8(0x131)+_0x4e147b[_0x450ee8(0x162)]:''),_0x4ce6a8['errorCode']??_0x4ce6a8[_0x450ee8(0x137)]);}if(_0x4ce6a8['success']!==!![]||_0x4ce6a8[_0x450ee8(0x1df)]!=='0000')throw createIndeterminateResponseError(_0x4c408d['label']);return _0x4ce6a8[_0x450ee8(0x171)];}export async function platformRequest(_0x5bc8ff,_0x105e93){const _0x571eec=a216_0x230cbf;if(/^https?:\/\//i[_0x571eec(0x14e)](_0x5bc8ff))throw CliErrors['validation'](_0x571eec(0x172)+_0x5bc8ff,_0x571eec(0x1bb));const _0x3be0bc=_0x5bc8ff[_0x571eec(0x13c)]('/')?_0x5bc8ff:'/'+_0x5bc8ff;return platformFetch(''+getApiDomain()+_0x3be0bc,_0x105e93);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x1c56ac,_0x2d9774){const _0x3e03a0=a216_0x230cbf,_0x200bdd=typeof _0x1c56ac===_0x3e03a0(0x197)?_0x1c56ac:typeof _0x1c56ac===_0x3e03a0(0x112)&&/^(0|[1-9]\d*)$/[_0x3e03a0(0x14e)](_0x1c56ac)?Number(_0x1c56ac):Number[_0x3e03a0(0x122)],_0x8cf463=Number[_0x3e03a0(0x17c)](_0x200bdd)&&(_0x2d9774==='id'?_0x200bdd>0x0:_0x200bdd>=0x0);if(!_0x8cf463)throw CliErrors['apiError']('Knowledge-base\x20response\x20contains\x20an\x20invalid\x20'+_0x2d9774+'.');return _0x200bdd;}function parseKnowledgeBaseText(_0x5c3c0d,_0x240549){const _0x2ba187=a216_0x230cbf;if(typeof _0x5c3c0d===_0x2ba187(0x112)&&(_0x240549===_0x2ba187(0x1e5)||_0x5c3c0d[_0x2ba187(0x1d9)]()))return _0x5c3c0d;throw CliErrors[_0x2ba187(0x147)](_0x2ba187(0x20b)+_0x240549+'.');}function a216_0x23cf(_0x3f29ed,_0x36578f){_0x3f29ed=_0x3f29ed-0x10f;const _0x42a80b=a216_0x42a8();let _0x23cff3=_0x42a80b[_0x3f29ed];return _0x23cff3;}function parseKnowledgeBaseRecord(_0x1c5fb3){const _0x4236a0=a216_0x230cbf;if(!_0x1c5fb3||typeof _0x1c5fb3!==_0x4236a0(0x1c2)||Array[_0x4236a0(0x1e3)](_0x1c5fb3))throw CliErrors[_0x4236a0(0x147)]('Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.');const _0x1875ea=_0x1c5fb3;if(_0x1875ea[_0x4236a0(0x181)]!==_0x4236a0(0x13d)&&_0x1875ea[_0x4236a0(0x181)]!=='personal')throw CliErrors['apiError'](_0x4236a0(0x191));const _0x5d79ce={'id':parseKnowledgeBaseInteger(_0x1875ea['id'],'id'),'scope':_0x1875ea[_0x4236a0(0x181)],'appCode':parseKnowledgeBaseText(_0x1875ea['appCode'],'appCode'),'title':parseKnowledgeBaseText(_0x1875ea[_0x4236a0(0x15f)],_0x4236a0(0x15f)),'version':parseKnowledgeBaseInteger(_0x1875ea['version'],_0x4236a0(0x12b)),'content':parseKnowledgeBaseText(_0x1875ea[_0x4236a0(0x1e5)],'content')};return(_0x1875ea[_0x4236a0(0x198)]===null||typeof _0x1875ea['createTime']==='string'||typeof _0x1875ea[_0x4236a0(0x198)]===_0x4236a0(0x197))&&(_0x5d79ce['createTime']=_0x1875ea[_0x4236a0(0x198)]),(_0x1875ea['updateTime']===null||typeof _0x1875ea['updateTime']===_0x4236a0(0x112)||typeof _0x1875ea[_0x4236a0(0x220)]==='number')&&(_0x5d79ce[_0x4236a0(0x220)]=_0x1875ea[_0x4236a0(0x220)]),_0x5d79ce;}export async function listEnterpriseKnowledgeBases(_0x28a2cd,_0x2ca8b7={}){const _0x3aaa5f=a216_0x230cbf,_0x4b2c82=_0x2ca8b7[_0x3aaa5f(0x21c)]??0x32;if(!Number[_0x3aaa5f(0x17c)](_0x4b2c82)||_0x4b2c82<0x1||_0x4b2c82>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors['validation']('Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20'+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x21637d=await platformRequest(_0x3aaa5f(0x1b0),{'method':'POST','cookie':_0x28a2cd,'label':_0x3aaa5f(0x22b),'body':{'currentPage':_0x2ca8b7['currentPage']??0x1,'pageSize':_0x4b2c82,'scope':_0x3aaa5f(0x13d),..._0x2ca8b7['appCode']?{'appCode':_0x2ca8b7['appCode']}:{},..._0x2ca8b7[_0x3aaa5f(0x15f)]?{'title':_0x2ca8b7[_0x3aaa5f(0x15f)]}:{}}});if(!_0x21637d||typeof _0x21637d!==_0x3aaa5f(0x1c2)||Array[_0x3aaa5f(0x1e3)](_0x21637d)||!Array[_0x3aaa5f(0x1e3)](_0x21637d['tableData']))throw CliErrors[_0x3aaa5f(0x147)]('List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.');const _0x36c322=extractPaging(_0x21637d);if(!_0x36c322||!Number[_0x3aaa5f(0x111)](_0x36c322[_0x3aaa5f(0x215)])||!Number['isInteger'](_0x36c322['pageSize'])||!Number[_0x3aaa5f(0x111)](_0x36c322[_0x3aaa5f(0x169)])||_0x36c322['currentPage']<0x1||_0x36c322[_0x3aaa5f(0x21c)]<0x1||_0x36c322[_0x3aaa5f(0x21c)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x36c322[_0x3aaa5f(0x169)]<0x0)throw CliErrors[_0x3aaa5f(0x147)](_0x3aaa5f(0x1de));return{'items':extractList(_0x21637d)['map'](parseKnowledgeBaseRecord),'paging':_0x36c322};}export async function getEnterpriseKnowledgeBase(_0x198aa9,_0x5b7698){const _0x1447a5=a216_0x230cbf,_0x38534a=await platformRequest(_0x1447a5(0x1cb)+buildQuery({'id':_0x5b7698}),{'cookie':_0x198aa9,'label':'Get\x20enterprise\x20knowledge\x20base'});return parseKnowledgeBaseRecord(_0x38534a);}export async function createEnterpriseKnowledgeBase(_0x16dfe8,_0x3bf206){const _0x5d3508=a216_0x230cbf,_0x1590db=await platformRequest(_0x5d3508(0x1d7),{'method':_0x5d3508(0x204),'cookie':_0x16dfe8,'label':_0x5d3508(0x12d),'body':{'scope':_0x5d3508(0x13d),..._0x3bf206}});return parseKnowledgeBaseRecord(_0x1590db);}export async function updateEnterpriseKnowledgeBase(_0xf4413,_0x38b4d1){const _0x2e77db=a216_0x230cbf;if(_0x38b4d1[_0x2e77db(0x15f)]===undefined&&_0x38b4d1[_0x2e77db(0x1e5)]===undefined)throw CliErrors[_0x2e77db(0x1d6)](_0x2e77db(0x118));const _0x4f4037=await platformRequest(_0x2e77db(0x1b1),{'method':'POST','cookie':_0xf4413,'label':_0x2e77db(0x15a),'body':{'id':_0x38b4d1['id'],..._0x38b4d1[_0x2e77db(0x15f)]!==undefined?{'title':_0x38b4d1[_0x2e77db(0x15f)]}:{},..._0x38b4d1[_0x2e77db(0x1e5)]!==undefined?{'content':_0x38b4d1['content']}:{}}});return parseKnowledgeBaseRecord(_0x4f4037);}export async function deleteEnterpriseKnowledgeBase(_0x526e92,_0x4d01f5){const _0x21a07e=a216_0x230cbf;await platformRequest(_0x21a07e(0x1b8),{'method':_0x21a07e(0x204),'cookie':_0x526e92,'label':_0x21a07e(0x1f4),'body':{'id':_0x4d01f5}});}function cleanNewlines(_0x49d963){const _0x17f7d6=a216_0x230cbf;return _0x49d963[_0x17f7d6(0x164)](/[\r\n]+/g,'\x20')[_0x17f7d6(0x1d9)]();}function cleanDatasetName(_0x435e87){const _0x3fa625=a216_0x230cbf;if(!_0x435e87['name'])return _0x435e87;return{..._0x435e87,'name':cleanNewlines(_0x435e87[_0x3fa625(0x11b)])};}export async function fetchModelList(_0x3154ec,_0xefe51c){const _0x159d6c=a216_0x230cbf,_0x3d7492=getEnv(),_0x579e3f=new URLSearchParams({'appcode':_0x3154ec,'otype':_0x159d6c(0x1ab)}),_0x2a8986='/api/node-toolbox/dataset/model-list?'+_0x579e3f[_0x159d6c(0x183)]();logger['info'](_0x159d6c(0x210),_0x159d6c(0x1fe)+_0x3d7492+')',{'apiPath':_0x2a8986});const _0x58fb57=await platformRequest(_0x2a8986,{'cookie':_0xefe51c,'label':_0x159d6c(0x1a7)}),_0x30f721=(_0x58fb57['configArray']??[])[_0x159d6c(0x1ad)](cleanDatasetName);return{'configArray':_0x30f721,'count':_0x30f721[_0x159d6c(0x1e6)]};}export async function fetchDatasetDoc(_0x5cfd06){const _0x47c2f3=a216_0x230cbf,{appCode:_0x5b9c4b,cookie:_0x1c6f4f,datasetCode:_0x374da9,datasetId:_0x2b4cd6,extraParams:_0x29f87e}=_0x5cfd06,_0x4193c4=await platformRequest(_0x47c2f3(0x14f),{'method':'POST','body':{'appCode':_0x5b9c4b,'datasetCode':_0x374da9,'datasetId':_0x2b4cd6,..._0x29f87e||{}},'cookie':_0x1c6f4f,'label':_0x47c2f3(0x18b)+_0x374da9+')'});if(!_0x4193c4||typeof _0x4193c4['markdown']!==_0x47c2f3(0x112))throw new Error(_0x47c2f3(0x166)+_0x374da9+_0x47c2f3(0x1c1));return _0x4193c4[_0x47c2f3(0x1f8)];}export async function getMenuTree(_0xe1ed2e,_0x43ff6e){const _0x5443ea=a216_0x230cbf,_0x29953c=new URLSearchParams({'appCode':_0xe1ed2e});return platformRequest('/smartapi/menu/find?'+_0x29953c[_0x5443ea(0x183)](),{'cookie':_0x43ff6e,'label':_0x5443ea(0x149)});}export async function createMenuRecord(_0x2e7bd9,_0x201dc3,_0x1930b0){const _0xea4ca9=a216_0x230cbf;return platformRequest('/smartapi/menu/create',{'method':_0xea4ca9(0x204),'body':_0x2e7bd9,'cookie':_0x201dc3,'label':_0x1930b0});}export async function updateMenuRecord(_0x558f22,_0x30f928,_0x4b10c9){const _0x55904c=a216_0x230cbf;return platformRequest(_0x55904c(0x188),{'method':_0x55904c(0x204),'body':_0x558f22,'cookie':_0x30f928,'label':_0x4b10c9});}export async function deleteMenuRecord(_0x26f76d,_0x239fb3,_0x1143f3){const _0xa7410f=a216_0x230cbf;return platformRequest(_0xa7410f(0x1ac),{'method':_0xa7410f(0x204),'body':{'id':_0x26f76d},'cookie':_0x239fb3,'label':_0x1143f3});}export async function batchDeleteMenuRecords(_0x4c0550,_0x52cd6a,_0x16059e){const _0x48c0e3=a216_0x230cbf;return platformRequest(_0x48c0e3(0x21f),{'method':_0x48c0e3(0x204),'body':{'idList':_0x4c0550},'cookie':_0x52cd6a,'label':_0x16059e});}export async function startMenuRegroup(_0x742b9,_0x36af4b,_0x5bcf18){const _0x45a53b=a216_0x230cbf;return platformRequest(_0x45a53b(0x17d),{'method':_0x45a53b(0x204),'body':_0x742b9,'cookie':_0x36af4b,'label':_0x5bcf18});}export async function getAsyncTaskStatus(_0x413faf,_0x15a8d0,_0x43aeb1){const _0x41d940=a216_0x230cbf,_0x1e3d0a=new URLSearchParams({'appCode':_0x15a8d0});return platformRequest(_0x41d940(0x161)+encodeURIComponent(_0x413faf)+'?'+_0x1e3d0a[_0x41d940(0x183)](),{'cookie':_0x43aeb1,'label':_0x41d940(0x186)+_0x413faf});}export async function listBffScripts(_0x13ff04,_0x20c1fe,_0x51bf67){const _0x37a2ee=a216_0x230cbf;let _0x250b9b=_0x37a2ee(0x1fc)+_0x13ff04;if(_0x20c1fe)_0x250b9b+='&type='+_0x20c1fe;const _0x1c9ea9=await apiRequest(_0x250b9b);let _0x69bf4b=extractList(_0x1c9ea9['data']);if(_0x51bf67?.[_0x37a2ee(0x1af)]){const _0x3bd15a=_0x51bf67[_0x37a2ee(0x1af)]['toLowerCase']();_0x69bf4b=_0x69bf4b[_0x37a2ee(0x206)](_0x9eafcb=>_0x9eafcb[_0x37a2ee(0x167)]?.[_0x37a2ee(0x223)]()[_0x37a2ee(0x1a8)](_0x3bd15a)||_0x9eafcb['description']?.['toLowerCase']()[_0x37a2ee(0x1a8)](_0x3bd15a));}return _0x69bf4b;}export async function getBffScriptInfo(_0x2b23d9){const _0x4b7fe2=a216_0x230cbf,_0x5c59c4=await apiRequest(_0x4b7fe2(0x1c7)+_0x2b23d9);if(!_0x5c59c4['data'])throw CliErrors[_0x4b7fe2(0x1d6)]('BFF\x20script\x20not\x20found:\x20id='+_0x2b23d9);return _0x5c59c4[_0x4b7fe2(0x171)];}export async function saveBffScript(_0x3e3f6d){const _0x1c7d33=a216_0x230cbf,_0x4f470b=await apiRequest(_0x1c7d33(0x1fb),{'method':_0x1c7d33(0x204),'body':_0x3e3f6d}),{id:_0xed2c37,entity:_0x1d8fda}=normalizeEntityWithIdResponse(_0x4f470b[_0x1c7d33(0x171)]);if(_0xed2c37!==undefined){const _0x555e53=typeof _0x1d8fda[_0x1c7d33(0x167)]==='string'||typeof _0x1d8fda[_0x1c7d33(0x125)]==='string'?_0x1d8fda:undefined;return{'id':_0xed2c37,'script':_0x555e53};}throw CliErrors[_0x1c7d33(0x147)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x3580d4){const _0x17c491=a216_0x230cbf;await apiRequest(_0x17c491(0x139),{'method':_0x17c491(0x204),'body':{'id':_0x3580d4}});}export async function getBffScriptStatistics(_0x1e6d15){const _0x1f4fbd=a216_0x230cbf,_0x1760b7=await apiRequest(_0x1f4fbd(0x196)+_0x1e6d15);return extractList(_0x1760b7[_0x1f4fbd(0x171)]);}export async function clearBffScriptCache(){const _0x4c8df1=a216_0x230cbf,_0x36ef73=await apiRequest(_0x4c8df1(0x20d),{'method':_0x4c8df1(0x204),'useRuntime':!![]});return typeof _0x36ef73[_0x4c8df1(0x171)]===_0x4c8df1(0x112)?_0x36ef73[_0x4c8df1(0x171)]:'';}export async function listBffDatasetOperations(_0x42eebe,_0x3cf140){const _0x4723f5=a216_0x230cbf,_0x4d0fa0=await apiRequest(_0x4723f5(0x207),{'method':_0x4723f5(0x204),'body':{'appCode':_0x42eebe,'datasetId':_0x3cf140}});return _0x4d0fa0[_0x4723f5(0x171)];}export async function listSqlQueries(_0x462dea,_0x2f3bd5){const _0x434147=a216_0x230cbf,_0x267801=await apiRequest(_0x434147(0x22e),{'method':'POST','body':{'appCode':_0x462dea,'currentPage':_0x2f3bd5?.[_0x434147(0x215)]??0x1,'pageSize':_0x2f3bd5?.[_0x434147(0x21c)]??0x32,'sqlCode':_0x2f3bd5?.[_0x434147(0x123)],'sqlName':_0x2f3bd5?.[_0x434147(0x227)]}});return _0x267801['data'];}export async function getSqlQueryInfo(_0x4d7001,_0x1bbfc4){const _0x654f7e=a216_0x230cbf,_0x293fef=await listSqlQueries(_0x4d7001,{'sqlCode':_0x1bbfc4}),_0x530c7c=_0x293fef[_0x654f7e(0x12f)]?.[0x0];if(!_0x530c7c)throw CliErrors[_0x654f7e(0x1d6)](_0x654f7e(0x229)+_0x1bbfc4);return _0x530c7c;}export async function getSqlQueryDetail(_0x4d996e){const _0x41516e=a216_0x230cbf,_0x6fe3a2=await apiRequest(_0x41516e(0x201)+(_0x41516e(0x11d)+encodeURIComponent(_0x4d996e)));if(!_0x6fe3a2[_0x41516e(0x171)])throw CliErrors['validation'](_0x41516e(0x229)+_0x4d996e);return _0x6fe3a2[_0x41516e(0x171)];}export async function getSqlQueryDetailById(_0x4025bf){const _0x314ac9=a216_0x230cbf,_0x425df1=await apiRequest(_0x314ac9(0x1a5)+_0x4025bf);if(!_0x425df1[_0x314ac9(0x171)])throw CliErrors[_0x314ac9(0x1d6)](_0x314ac9(0x15d)+_0x4025bf);return _0x425df1[_0x314ac9(0x171)];}export async function createSqlQuery(_0x572fce){const _0x5be252=a216_0x230cbf,_0x11f480=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':_0x5be252(0x204),'body':_0x572fce}),{id:_0x3de4df,entity:_0x480bc2}=normalizeEntityWithIdResponse(_0x11f480['data']);if(!(_0x5be252(0x123)in _0x480bc2)&&_0x3de4df)return getSqlQueryDetailById(_0x3de4df);return normalizeSqlQueryEntity(_0x480bc2);}export async function updateSqlQuery(_0x99f058){const _0x5df2db=a216_0x230cbf,_0x2bb423=await apiRequest(_0x5df2db(0x16b),{'method':_0x5df2db(0x204),'body':_0x99f058}),{id:_0x37c40a,entity:_0x575e79}=normalizeEntityWithIdResponse(_0x2bb423[_0x5df2db(0x171)]);if(!(_0x5df2db(0x123)in _0x575e79)){if(_0x99f058[_0x5df2db(0x123)])return getSqlQueryDetail(_0x99f058['sqlCode']);if(_0x37c40a)return getSqlQueryDetailById(_0x37c40a);}return normalizeSqlQueryEntity(_0x575e79);}export async function deleteSqlQuery(_0x1598ef){const _0x414130=a216_0x230cbf;await apiRequest(_0x414130(0x163),{'method':_0x414130(0x204),'body':_0x1598ef});}export async function saveSqlQuery(_0x2c96d8){const _0xd18c11=a216_0x230cbf,_0x294caa=await apiRequest(_0xd18c11(0x217),{'method':_0xd18c11(0x204),'body':_0x2c96d8});return _0x294caa[_0xd18c11(0x171)];}function normalizeSqlQueryEntity(_0x5d6b78){const _0x4565b8=a216_0x230cbf;return{..._0x5d6b78,'id':Number(_0x5d6b78['id']),'dbId':_0x5d6b78[_0x4565b8(0x232)]==null?undefined:Number(_0x5d6b78[_0x4565b8(0x232)]),'version':_0x5d6b78[_0x4565b8(0x12b)]==null?undefined:Number(_0x5d6b78[_0x4565b8(0x12b)])};}export async function executeSql(_0x1cc838,_0x596efe,_0x4fdee4){const _0x3af0f8=a216_0x230cbf,_0xc77a2=await apiRequest(_0x3af0f8(0x1fd),{'method':_0x3af0f8(0x204),'body':{'appCode':_0x1cc838,'sqlCode':_0x596efe,..._0x4fdee4&&{'params':_0x4fdee4}},'useRuntime':!![]});return _0xc77a2[_0x3af0f8(0x171)];}export async function executeDatasetDataOperation(_0x4f66c0,_0xf59f2a,_0x5d2cbf,_0x4b7e0e={}){const _0x1a8f9d=a216_0x230cbf;try{const _0x2b06e9=await apiRequest('/api/'+_0x4f66c0+'/'+_0xf59f2a+'/'+_0x5d2cbf,{'method':_0x1a8f9d(0x204),'body':_0x4b7e0e,'useRuntime':!![]});return _0x2b06e9['data'];}catch(_0x3a5dbc){if(_0x5d2cbf===_0x1a8f9d(0x199)&&_0x3a5dbc instanceof CliError&&_0x3a5dbc['code']===_0x1a8f9d(0x17e)&&_0x4b7e0e['id']!==undefined&&_0x4b7e0e['id']!==null&&_0x4b7e0e['id']!==''){const _0xd5edba=await apiRequest(_0x1a8f9d(0x209)+_0x4f66c0+'/'+_0xf59f2a+_0x1a8f9d(0x1c3),{'method':_0x1a8f9d(0x204),'body':{'where':{'id':{'$eq':_0x4b7e0e['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x2149d7=Array[_0x1a8f9d(0x1e3)](_0xd5edba['data']?.[_0x1a8f9d(0x12f)])?_0xd5edba[_0x1a8f9d(0x171)][_0x1a8f9d(0x12f)]:[];return _0x2149d7[0x0]??null;}throw _0x3a5dbc;}}export async function listDatasets(_0x232695,_0x2307cc){const _0x46fc31=a216_0x230cbf,_0xdc46f1={'appCode':_0x232695,'deleted':_0x2307cc?.[_0x46fc31(0x193)]??![]};if(_0x2307cc?.[_0x46fc31(0x137)])_0xdc46f1[_0x46fc31(0x137)]=_0x2307cc[_0x46fc31(0x137)];if(_0x2307cc?.[_0x46fc31(0x11b)])_0xdc46f1[_0x46fc31(0x11b)]=_0x2307cc[_0x46fc31(0x11b)];const _0x948083=await apiRequest(_0x46fc31(0x1b9),{'method':_0x46fc31(0x204),'body':_0xdc46f1});return extractList(_0x948083[_0x46fc31(0x171)]);}export async function deleteDataset(_0x2b7be8,_0x2a92b9){const _0x26e537=a216_0x230cbf;await apiRequest(_0x26e537(0x128),{'method':_0x26e537(0x204),'body':{'appCode':_0x2b7be8,'datasetId':_0x2a92b9}});}export async function restoreDataset(_0x3c3915,_0x56bd65){const _0x242156=a216_0x230cbf;await apiRequest('/smartapi/dataset/restore-dataset',{'method':_0x242156(0x204),'body':{'appCode':_0x3c3915,'datasetId':_0x56bd65}});}export async function previewTextGeneratedDataset(_0xab4880,_0x4d3cf9){const _0x32f525=a216_0x230cbf,_0x213107=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':'POST','body':{'appCode':_0xab4880,'datasetName':_0x4d3cf9[_0x32f525(0x127)],'requirementDescription':_0x4d3cf9[_0x32f525(0x234)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x213107[_0x32f525(0x171)];}export async function startTextGeneratedDataset(_0x16087f,_0x1cd284,_0x21c8f3){const _0x11a06b=a216_0x230cbf,_0x267537=await apiRequest(_0x11a06b(0x1c4),{'method':_0x11a06b(0x204),'body':{'appCode':_0x16087f,..._0x21c8f3?.[_0x11a06b(0x214)]?{'clientOperationId':_0x21c8f3['clientOperationId']}:{},'design':_0x1cd284},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x267537[_0x11a06b(0x171)];}export async function getTextGeneratedDatasetStatus(_0x109e5b,_0x1ea629){const _0x4b3e71=a216_0x230cbf,_0x5adf85=new URLSearchParams({'appCode':_0x109e5b});_0x1ea629[_0x4b3e71(0x154)]&&_0x5adf85[_0x4b3e71(0x19b)](_0x4b3e71(0x154),_0x1ea629[_0x4b3e71(0x154)]);_0x1ea629[_0x4b3e71(0x214)]&&_0x5adf85[_0x4b3e71(0x19b)](_0x4b3e71(0x214),_0x1ea629['clientOperationId']);const _0x4fe011=await apiRequest(_0x4b3e71(0x160)+_0x5adf85[_0x4b3e71(0x183)]());return _0x4fe011[_0x4b3e71(0x171)];}export async function searchDatasets(_0xdce9c6,_0x52ab34){const _0x5bbc4b=a216_0x230cbf,_0x33e9bd=await listDatasets(_0xdce9c6,{'name':_0x52ab34}),_0x1e19d0=_0x52ab34[_0x5bbc4b(0x223)](),_0x4c4804=new Set(_0x33e9bd[_0x5bbc4b(0x1ad)](_0x552671=>_0x552671['id'])),_0x3e5cef=_0x33e9bd[_0x5bbc4b(0x206)](_0x51490d=>_0x51490d['dbtableConfig']?.['tableName']?.[_0x5bbc4b(0x223)]()[_0x5bbc4b(0x1a8)](_0x1e19d0)||_0x51490d[_0x5bbc4b(0x187)]?.[_0x5bbc4b(0x223)]()['includes'](_0x1e19d0)),_0x2d8b16=await listDatasets(_0xdce9c6,{'code':_0x52ab34});for(const _0x5a8d16 of _0x2d8b16){!_0x4c4804[_0x5bbc4b(0x158)](_0x5a8d16['id'])&&(_0x33e9bd[_0x5bbc4b(0x1a1)](_0x5a8d16),_0x4c4804[_0x5bbc4b(0x1e4)](_0x5a8d16['id']));}return _0x33e9bd;}export function normalizeDatasetOperations(_0x45db20){const _0x36fb11=a216_0x230cbf;if(Array['isArray'](_0x45db20))return _0x45db20['filter'](_0x365944=>_0x365944!=null&&typeof _0x365944===_0x36fb11(0x1c2));if(_0x45db20&&typeof _0x45db20===_0x36fb11(0x1c2))return Object[_0x36fb11(0x16c)](_0x45db20)[_0x36fb11(0x206)](([,_0x44e84a])=>_0x44e84a!=null&&typeof _0x44e84a===_0x36fb11(0x1c2))[_0x36fb11(0x1ad)](([_0x4105bc,_0x56f438])=>({..._0x56f438,'name':_0x56f438[_0x36fb11(0x11b)]??_0x56f438['operationName']??_0x4105bc}));return[];}export async function getDatasetDetail(_0x4d7c07){const _0x1d08e3=a216_0x230cbf,_0x14ee54=/^\d+$/['test'](_0x4d7c07)?'id':_0x1d08e3(0x137),_0x7c0c61=await apiRequest(_0x1d08e3(0x1b3)+_0x14ee54+'='+_0x4d7c07);return _0x7c0c61['data'];}export async function updateDrivenData(_0x5d2321){const _0x306db7=a216_0x230cbf,_0x1081b0=await apiRequest(_0x306db7(0x195),{'method':_0x306db7(0x204),'body':_0x5d2321});return _0x1081b0[_0x306db7(0x171)];}export async function getDatasetOperations(_0x2d8fb7){const _0x49428b=a216_0x230cbf,_0x5b9ee8=await getDatasetDetail(_0x2d8fb7),_0x3646fe=normalizeDatasetOperations(_0x5b9ee8[_0x49428b(0x1b7)])['map'](_0x7366c2=>({'name':_0x7366c2[_0x49428b(0x11b)]||_0x7366c2['operationName'],'displayName':_0x7366c2['displayName']||_0x7366c2[_0x49428b(0x11b)],'type':_0x7366c2[_0x49428b(0x1d4)],'method':_0x7366c2[_0x49428b(0x1a0)],'path':_0x7366c2[_0x49428b(0x190)],'enabled':_0x7366c2[_0x49428b(0x1bf)]??!![],'requestFields':_0x7366c2[_0x49428b(0x12a)],'responseFields':_0x7366c2['responseFields']}));return{'dataset':{'id':_0x5b9ee8['id']??_0x5b9ee8[_0x49428b(0x157)],'name':_0x5b9ee8[_0x49428b(0x11b)],'code':_0x5b9ee8[_0x49428b(0x137)]||_0x5b9ee8['modelCode'],'tableName':_0x5b9ee8[_0x49428b(0x202)]||_0x5b9ee8[_0x49428b(0x1e8)]?.[_0x49428b(0x202)]},'operations':_0x3646fe};}export async function getOperationDetail(_0x21898e,_0x2322bd,_0xaa8637){const _0x1b68e4=a216_0x230cbf;let _0x2433f3=_0x2322bd;if(!/^\d+$/[_0x1b68e4(0x14e)](_0x2322bd)){const _0x4c25b8=await listDatasets(_0x21898e,{'code':_0x2322bd}),_0x4ec429=_0x4c25b8[_0x1b68e4(0x1f1)](_0x57cf38=>_0x57cf38[_0x1b68e4(0x137)]===_0x2322bd||String(_0x57cf38['id'])===_0x2322bd);if(!_0x4ec429)throw CliErrors[_0x1b68e4(0x1d6)]('Dataset\x20not\x20found:\x20'+_0x2322bd);_0x2433f3=String(_0x4ec429['id']);}const _0x47310c=await getDatasetDetail(_0x2433f3),_0x4a1498=normalizeDatasetOperations(_0x47310c[_0x1b68e4(0x1b7)])[_0x1b68e4(0x1f1)](_0x592511=>(_0x592511[_0x1b68e4(0x11b)]||_0x592511[_0x1b68e4(0x1b4)])===_0xaa8637);if(!_0x4a1498)throw CliErrors['validation'](_0x1b68e4(0x1cc)+_0xaa8637+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x2322bd);return{'dataset':{'id':_0x47310c['id']??_0x47310c[_0x1b68e4(0x157)],'name':_0x47310c[_0x1b68e4(0x11b)],'code':_0x47310c[_0x1b68e4(0x137)]||_0x47310c[_0x1b68e4(0x1c0)],'tableName':_0x47310c[_0x1b68e4(0x202)]||_0x47310c[_0x1b68e4(0x1e8)]?.['tableName']},'operation':_0x4a1498};}export async function getAppInfo(_0x309911){const _0x3b23b0=a216_0x230cbf,_0x2b1ade=await apiRequest(_0x3b23b0(0x200)+buildQuery({'appCode':_0x309911}));return _0x2b1ade[_0x3b23b0(0x171)];}export async function getI18nInfo(_0x45bdc6){const _0x471f69=a216_0x230cbf,_0x17a358=await getAppInfo(_0x45bdc6);return{'enableI18n':_0x17a358[_0x471f69(0x1f2)],..._0x17a358[_0x471f69(0x192)]};}export async function createReactPage(_0x25e5e4){const _0x1cf460=a216_0x230cbf,_0xe4d55a=await apiRequest(_0x1cf460(0x14b),{'method':_0x1cf460(0x204),'body':{'appCode':_0x25e5e4[_0x1cf460(0x1ec)],'pageName':_0x25e5e4[_0x1cf460(0x212)],..._0x25e5e4['parentMenuId']!=null?{'parentMenuId':_0x25e5e4[_0x1cf460(0x228)]}:{},'createMenu':_0x25e5e4[_0x1cf460(0x1ea)],'codeContent':_0x25e5e4['files']}});return{'pageId':_0xe4d55a[_0x1cf460(0x171)]['pageId'],'pageName':_0xe4d55a[_0x1cf460(0x171)][_0x1cf460(0x1b6)]??_0x25e5e4[_0x1cf460(0x212)],'appCode':_0x25e5e4['appCode'],'version':_0xe4d55a[_0x1cf460(0x171)][_0x1cf460(0x115)]??0x0,'menuId':_0xe4d55a['data'][_0x1cf460(0x1a3)]?.['id']??null,'menuPath':_0xe4d55a[_0x1cf460(0x171)][_0x1cf460(0x1a3)]?.[_0x1cf460(0x190)]??null,'files':_0xe4d55a[_0x1cf460(0x171)][_0x1cf460(0x1ca)]};}export async function updateReactPageContent(_0xf99fd5){const _0x1817ba=a216_0x230cbf,_0x5607ab=await apiRequest(_0x1817ba(0x1cf),{'method':_0x1817ba(0x204),'body':{'id':_0xf99fd5[_0x1817ba(0x218)],'codeContent':_0xf99fd5[_0x1817ba(0x17a)]}});return{'pageId':_0xf99fd5[_0x1817ba(0x218)],'newVersion':_0x5607ab[_0x1817ba(0x171)]};}export async function publishReactPage(_0x131f02){const _0x304c93=a216_0x230cbf,_0x2fc880=await apiRequest(_0x304c93(0x1a9),{'method':'POST','body':{'id':_0x131f02[_0x304c93(0x218)],..._0x131f02[_0x304c93(0x1f9)]?{'remark':_0x131f02['remark']}:{}}});return _0x2fc880[_0x304c93(0x171)];}export async function getReactPageSource(_0x9008dc){const _0x6badad=a216_0x230cbf,_0x178d8d=await apiRequest(_0x6badad(0x1f3)+buildQuery({'id':_0x9008dc}));if(!_0x178d8d[_0x6badad(0x171)])throw CliErrors['validation'](_0x6badad(0x146)+_0x9008dc);return _0x178d8d[_0x6badad(0x171)];}export async function startGenerateStandardPages(_0x13c3f8,_0x4fa10e,_0x32917d){const _0x48d77e=a216_0x230cbf,_0x129ff8=await apiRequest(_0x48d77e(0x1a2)+_0x4fa10e+'/generate-standard-pages/start',{'method':_0x48d77e(0x204),'body':{'appCode':_0x13c3f8,..._0x32917d?.['clientOperationId']?{'clientOperationId':_0x32917d[_0x48d77e(0x214)]}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x129ff8[_0x48d77e(0x171)];}export async function getGenerateStandardPagesStatus(_0x4f01cc,_0x1dc9be,_0x4e48e2){const _0x40d44b=a216_0x230cbf,_0x55bf36=new URLSearchParams({'appCode':_0x4f01cc});_0x4e48e2[_0x40d44b(0x154)]&&_0x55bf36[_0x40d44b(0x19b)](_0x40d44b(0x154),_0x4e48e2[_0x40d44b(0x154)]);_0x4e48e2['clientOperationId']&&_0x55bf36[_0x40d44b(0x19b)](_0x40d44b(0x214),_0x4e48e2[_0x40d44b(0x214)]);const _0x5a8c7a=await apiRequest(_0x40d44b(0x1a2)+_0x1dc9be+_0x40d44b(0x20c)+_0x55bf36[_0x40d44b(0x183)]());return _0x5a8c7a['data'];}export async function getStandardPageStatus(_0x134f7e,_0x516b0b){const _0x21ac77=a216_0x230cbf,_0x4e6e12=await apiRequest(_0x21ac77(0x1a2)+_0x516b0b+_0x21ac77(0x18c)+encodeURIComponent(_0x134f7e));return _0x4e6e12[_0x21ac77(0x171)];}export async function tryGetStandardPageStatus(_0x5150e6,_0xce49c5){const _0x287bb8=a216_0x230cbf;try{return await getStandardPageStatus(_0x5150e6,_0xce49c5);}catch(_0x17fd46){if(_0x17fd46 instanceof CliError&&_0x17fd46[_0x287bb8(0x137)]===_0x287bb8(0x17e)&&/404|not found|non-json response/i[_0x287bb8(0x14e)](_0x17fd46[_0x287bb8(0x20e)]))return null;throw _0x17fd46;}}export async function syncStandardPages(_0x3b4ef9,_0x1b149c){const _0x5cc072=a216_0x230cbf,_0x123c05=await apiRequest(_0x5cc072(0x1a2)+_0x1b149c+_0x5cc072(0x1c6),{'method':_0x5cc072(0x204),'body':{'appCode':_0x3b4ef9}});return _0x123c05[_0x5cc072(0x171)];}export async function getPageDetail(_0x54c602){const _0x14c30e=a216_0x230cbf,_0x109d83=await apiRequest(_0x14c30e(0x1c8)+_0x54c602);if(!_0x109d83[_0x14c30e(0x171)])throw CliErrors['validation'](_0x14c30e(0x1b5)+_0x54c602);return _0x109d83[_0x14c30e(0x171)];}export async function listDeletedPages(_0x335786,_0xab10b6,_0x23d498){const _0x222a78=a216_0x230cbf,_0x670146=new URLSearchParams({'appCode':_0x335786,'type':_0xab10b6,'currentPage':String(_0x23d498[_0x222a78(0x215)]),'pageSize':String(_0x23d498[_0x222a78(0x21c)])}),_0x4749d0=await apiRequest(_0x222a78(0x12c)+_0x670146[_0x222a78(0x183)]());return _0x4749d0[_0x222a78(0x171)];}export async function restoreStandardPage(_0x3787c9){const _0xa089ef=a216_0x230cbf;await apiRequest('/smartapi/page/restore',{'method':_0xa089ef(0x204),'body':{'id':_0x3787c9}});}export async function restoreJsxPage(_0xb5ef1f,_0x53f46d){const _0x53ffd1=a216_0x230cbf,_0x1a480e=await apiRequest(_0x53ffd1(0x21a),{'method':'POST','body':{'appCode':_0xb5ef1f,'id':_0x53f46d}});return _0x1a480e[_0x53ffd1(0x171)];}export async function updatePage(_0x32679e,_0x3f0417,_0x28c005,_0x532f12){const _0xa9d554=a216_0x230cbf,_0x3b30b3=await apiRequest(_0xa9d554(0x155),{'method':_0xa9d554(0x204),'body':{'appCode':_0x32679e,'pageId':_0x3f0417,'code':_0x28c005,'datasetIds':_0x532f12}});return _0x3b30b3[_0xa9d554(0x171)];}export function generateSdkCode(_0x5e75dd,_0x2c17b9,_0x44b061){const _0x1253bc=a216_0x230cbf,_0x24513c=_0x44b061?.[_0x1253bc(0x135)]??!![],_0x1a7e9f=_0x1253bc(0x1d3)+_0x5e75dd[_0x1253bc(0x137)]?.[_0x1253bc(0x164)](/-/g,'_'),_0x187aec=_0x2c17b9[_0x1253bc(0x11b)]||_0x2c17b9[_0x1253bc(0x1b4)]||_0x1253bc(0x206),_0x19b90c=[];_0x24513c&&_0x19b90c[_0x1253bc(0x1a1)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x1253bc(0x170),'');_0x19b90c[_0x1253bc(0x1a1)](_0x1253bc(0x17f)+_0x5e75dd['name']+'\x20('+(_0x5e75dd['tableName']||_0x1253bc(0x117))+')');if(_0x187aec==='filter')_0x19b90c[_0x1253bc(0x1a1)]('const\x20result\x20=\x20await\x20client.models.'+_0x1a7e9f+'.filter({',_0x1253bc(0x1bd),_0x1253bc(0x1be),_0x1253bc(0x177),_0x1253bc(0x174));else{if(_0x187aec==='getOne')_0x19b90c['push'](_0x1253bc(0x180)+_0x1a7e9f+'.getOne(id);');else{if(_0x187aec==='create')_0x19b90c[_0x1253bc(0x1a1)]('const\x20result\x20=\x20await\x20client.models.'+_0x1a7e9f+_0x1253bc(0x130));else{if(_0x187aec===_0x1253bc(0x129))_0x19b90c['push'](_0x1253bc(0x180)+_0x1a7e9f+_0x1253bc(0x1ed));else _0x187aec===_0x1253bc(0x16e)||_0x187aec===_0x1253bc(0x142)?_0x19b90c[_0x1253bc(0x1a1)](_0x1253bc(0x180)+_0x1a7e9f+_0x1253bc(0x13a)):_0x19b90c['push'](_0x1253bc(0x180)+_0x1a7e9f+'.'+_0x187aec+_0x1253bc(0x205));}}}return _0x19b90c[_0x1253bc(0x1fa)]('\x0a');}export function generateSqlCodeTemplate(_0x2b394d,_0x46c435){const _0x46324a=a216_0x230cbf,_0x3e6959=_0x46c435?.['target']??'sdk',_0x582174=_0x46c435?.[_0x46324a(0x135)]??!![],_0x1c1435=[];return _0x1c1435[_0x46324a(0x1a1)](_0x46324a(0x14d)+_0x2b394d[_0x46324a(0x227)]+'\x20('+_0x2b394d[_0x46324a(0x123)]+')'),_0x3e6959==='sdk'?(_0x582174&&_0x1c1435['push'](_0x46324a(0x1ef),'',_0x46324a(0x170),''),_0x1c1435[_0x46324a(0x1a1)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x46324a(0x1f5)+_0x2b394d['sqlCode']+'\x27,',_0x46324a(0x184),'});','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x46324a(0x16d))):_0x1c1435[_0x46324a(0x1a1)](_0x46324a(0x15b),_0x46324a(0x1e7),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x46324a(0x1a4)+_0x2b394d['sqlCode']+'\x27,',_0x46324a(0x19c),_0x46324a(0x1eb),_0x46324a(0x18a),'}'),_0x1c1435['join']('\x0a');}export async function getErConfig(_0x3c24f6,_0x278c0c){const _0x8088c1=a216_0x230cbf,_0x9b9283=await apiRequest('/smartapi/question/er-config',{'method':_0x8088c1(0x204),'body':{'appCode':_0x3c24f6,'dblinkId':_0x278c0c},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x9b9283[_0x8088c1(0x171)];}export async function getErRelationDetail(_0x22bb1c,_0x25e1f4){const _0x1ce600=a216_0x230cbf,_0x2376dc=new URLSearchParams({'appCode':_0x22bb1c,'relationId':String(_0x25e1f4)});try{const _0x1c17cd=await apiRequest(_0x1ce600(0x1a6)+_0x2376dc[_0x1ce600(0x183)]());return _0x1c17cd['data']?.[_0x1ce600(0x1d8)]??null;}catch(_0x32ac69){if(_0x32ac69 instanceof CliError&&_0x32ac69[_0x1ce600(0x137)]==='api_error'&&(_0x32ac69['hint']?.[_0x1ce600(0x1a8)](_0x1ce600(0x151))||_0x32ac69['hint']===_0x1ce600(0x1b2)&&_0x32ac69[_0x1ce600(0x20e)]===_0x1ce600(0x150)))return null;throw _0x32ac69;}}export async function createErRelation(_0x507932){const _0x292a34=a216_0x230cbf,_0x5488ca=await apiRequest(_0x292a34(0x14a),{'method':'POST','body':_0x507932,'allowNonJsonSuccess':!![]});return _0x5488ca[_0x292a34(0x171)];}export async function updateErRelation(_0x1b641a){const _0x38721b=a216_0x230cbf,_0x13959f=await apiRequest(_0x38721b(0x19e),{'method':_0x38721b(0x204),'body':_0x1b641a,'allowNonJsonSuccess':!![]});return _0x13959f[_0x38721b(0x171)];}export async function deleteErRelation(_0x5337ca){const _0x486e30=a216_0x230cbf,_0x2dd94f=await apiRequest(_0x486e30(0x114),{'method':'POST','body':_0x5337ca,'allowNonJsonSuccess':!![]});return _0x2dd94f[_0x486e30(0x171)];}export async function updateErBusinessGroup(_0x4d3e68){const _0x14fd31=a216_0x230cbf,_0x2119a8=await apiRequest(_0x14fd31(0x11e),{'method':_0x14fd31(0x204),'body':_0x4d3e68,'allowNonJsonSuccess':!![]});return _0x2119a8[_0x14fd31(0x171)];}function buildQuery(_0x55f084){const _0x1f3000=a216_0x230cbf,_0x486412=new URLSearchParams();for(const [_0x33d7b5,_0xfca35]of Object[_0x1f3000(0x16c)](_0x55f084)){if(_0xfca35===undefined||_0xfca35==='')continue;_0x486412[_0x1f3000(0x19b)](_0x33d7b5,String(_0xfca35));}const _0x2fbf07=_0x486412[_0x1f3000(0x183)]();return _0x2fbf07?'?'+_0x2fbf07:'';}export async function listNotificationChannelConfigs(_0x5937bf,_0x58ac0f){const _0x517fa3=a216_0x230cbf,_0x318b9e=await apiRequest(_0x517fa3(0x185)+buildQuery({'appCode':_0x5937bf,'channelType':_0x58ac0f}));return Array['isArray'](_0x318b9e[_0x517fa3(0x171)])?_0x318b9e['data']:[];}export async function listAppConfigs(_0x43d1ed,_0x43a3ef){const _0x1994c5=a216_0x230cbf,_0x51fafd=await apiRequest(_0x1994c5(0x1d0),{'method':'POST','body':{'appCode':_0x43d1ed,..._0x43a3ef?.[_0x1994c5(0x1ba)]?{'key':_0x43a3ef[_0x1994c5(0x1ba)]}:{},..._0x43a3ef?.[_0x1994c5(0x13b)]?{'tags':_0x43a3ef[_0x1994c5(0x13b)]}:{}}});return extractAppConfigList(_0x51fafd['data']);}export async function getAppConfigByKey(_0x34f875,_0x310634){const _0x758dac=a216_0x230cbf,_0x3a10c5=await apiRequest(_0x758dac(0x1ae)+buildQuery({'appCode':_0x34f875,'key':_0x310634}));return _0x3a10c5['data']??null;}export async function createAppConfig(_0x37de20){const _0x573a8e=a216_0x230cbf,_0x4dd8a2=await apiRequest(_0x573a8e(0x213),{'method':_0x573a8e(0x204),'body':{'appCode':_0x37de20[_0x573a8e(0x1ec)],'key':_0x37de20['key'],'value':_0x37de20[_0x573a8e(0x18d)],..._0x37de20['tags']?{'tags':_0x37de20[_0x573a8e(0x13b)]}:{}}});return _0x4dd8a2[_0x573a8e(0x171)];}export async function updateAppConfig(_0x19b78b){const _0x3e78bb=a216_0x230cbf;await apiRequest(_0x3e78bb(0x1f7),{'method':_0x3e78bb(0x204),'body':{'id':_0x19b78b['id'],'appCode':_0x19b78b[_0x3e78bb(0x1ec)],'key':_0x19b78b[_0x3e78bb(0x1ba)],'value':_0x19b78b[_0x3e78bb(0x18d)],..._0x19b78b[_0x3e78bb(0x13b)]?{'tags':_0x19b78b[_0x3e78bb(0x13b)]}:{}}});}export async function deleteAppConfig(_0x2726dd){const _0x33acb3=a216_0x230cbf;await apiRequest(_0x33acb3(0x1e0),{'method':_0x33acb3(0x204),'body':_0x2726dd});}function extractAppConfigList(_0x44d8eb){const _0x3077f0=a216_0x230cbf;if(Array[_0x3077f0(0x1e3)](_0x44d8eb))return _0x44d8eb;if(_0x44d8eb&&typeof _0x44d8eb===_0x3077f0(0x1c2)&&Array['isArray'](_0x44d8eb[_0x3077f0(0x178)]))return _0x44d8eb['list'];return extractList(_0x44d8eb);}function a216_0x42a8(){const _0x5f3e32=['object','/filter','/smartapi/dataset/text-generate/start','errorMsg','/sync-to-pages','/api/management/library/scripts/info?id=','/smartapi/lovrabet/detail?pageId=','/smartapi/permit/user-role/update-user-list','files','/admin/knowledge-base/get-one','Operation\x20\x22','3265348EbLTQZ','26201210XjHrjd','/smartapi/webcode/page/update/content','/smartapi/app-config/list','error','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','dataset_','type',':\x20invalid\x20JSON\x20response\x20envelope','validation','/admin/knowledge-base/create','relation','trim','url','Check\x20network\x20connectivity\x20and\x20try\x20again.','physicalTableCount','append','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','errorCode','/smartapi/app-config/delete','/smartapi/dblink/getAllTableList','/smartapi/common/uploadFile','isArray','add','content','length','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','dbtableConfig','userId','createMenu','\x20\x20});','appCode','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','email','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','/smartapi/dblink/getTableDiffV2ByPage','find','enableI18n','/smartapi/webcode/page/detail','Delete\x20enterprise\x20knowledge\x20base','\x20\x20sqlCode:\x20\x27','/smartapi/dblink/getList','/smartapi/app-config/update','markdown','remark','join','/api/management/library/scripts/save','/api/management/library/scripts/list?appCode=','/api/custom/executeSql','正在从服务器拉取模型列表...\x20(环境:\x20','Request\x20failed:\x20','/smartapi/app/getOne','/smartapi/custom/getUserCustomSql','tableName','/smartapi/permit/page/get-one','POST','(/*\x20params\x20*/);','filter','/smartapi/dataset/get-dataset-operation','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','/api/','/smartapi/permit/resource/get-api-list','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','/generate-standard-pages/status?','/api/management/script/cache/clear','message','UNAUTHORIZED','fetch-model-list','permits','pageName','/smartapi/app-config/create','clientOperationId','currentPage','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','/api/node-toolbox/sql/save','pageId','/smartapi/dblink/delete','/smartapi/webcode/page/restore','3704211gZealM','pageSize','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','abort','/smartapi/menu/batchDelete','updateTime','Warning:\x20showing\x20first\x20','CUSTOM','toLowerCase','\x20failed,\x20HTTP\x20','4456gcDXem','19103qcwgJL','sqlName','parentMenuId','SQL\x20query\x20not\x20found:\x20','stringify','List\x20enterprise\x20knowledge\x20bases','longTerm','defineProperty','/smartapi/custom/queryUserCustomSqlList','\x20of\x20','warn','/smartapi/dblink/create','dbId','errorMessage','requirementDescription','nickname','AbortError','isInteger','string','/smartapi/dblink/getOne','/smartapi/question/er-config/cli/delete-single','draftVersion','/smartapi/permit/role/get-list','table','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','/smartapi/permit/role/get-permit-list','/smartapi/dblink/update','name','\x20failed','?sqlCode=','/smartapi/question/er-config/business-group/edit','/smartapi/app/getList','168iXrhji','application/json','NaN','sqlCode','ENABLE','scriptType','API\x20error\x20code:\x20','datasetName','/smartapi/dataset/delete-dataset','update','requestFields','version','/smartapi/page/getDeletedPageList?','Create\x20enterprise\x20knowledge\x20base','isFinite','tableData','.create({\x20/*\x20fields\x20*/\x20});',',\x20HTTP\x20','userTenantRelationList','platform-error-code','Request\x20timeout:\x20','includeImports','/smartapi/dblink/testConnect','code','/userTenant/queryBelongsTenants','/api/management/library/scripts/delete','.remove(id);','tags','startsWith','company','needPublic','/smartapi/permit/role/create','\x20apps.\x20','1934586fAUDRS','remove','body','/smartapi/ocr/recognize-text?','needSelf','React\x20custom\x20page\x20not\x20found:\x20','apiError','signal','Fetch\x20menu\x20list','/smartapi/question/er-config/cli/erCreate','/smartapi/webcode/page/create','summary','//\x20SQL:\x20','test','/api/node-toolbox/api-doc-generator','ER\x20relation\x20does\x20not\x20exist','DATA_NOT_EXIST','username','max','operationId','/smartapi/lovrabet/update-page','15yCpktB','modelId','has','mobile','Update\x20enterprise\x20knowledge\x20base','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','API\x20error:\x20','SQL\x20query\x20not\x20found:\x20id=','avatar','title','/smartapi/dataset/text-generate/status?','/smartapi/tasks/','status','/smartapi/custom/deleteUserCustomSql','replace','label','Invalid\x20response\x20format\x20(','functionName','21987AIqKFQ','totalCount','authRequired','/smartapi/custom/updateUserCustomSql','entries','const\x20results\x20=\x20data.execResult\x20||\x20[];','delete','/smartapi/common/queryFileUrl','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','data','platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20','tableList','});','success','roleType','\x20\x20currentPage:\x201,','list','json','pageContent','0000','isSafeInteger','/smartapi/menu/regroup','api_error','//\x20','const\x20result\x20=\x20await\x20client.models.','scope','401','toString','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/notification/channel-config/list','Fetch\x20async\x20task\x20','description','/smartapi/menu/update','roleName','\x20\x20return\x20rows;','Fetch\x20doc\x20(','/standard-page-status?appCode=','value','/smartapi/permit/resource/get-menu-list','min','path','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','i18nInfo','deleted','pageIndex','/smartapi/dataset/update-driven-data','/api/management/library/scripts/statistics?appCode=','number','createTime','getOne','13528158laIEIL','set','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','download','/smartapi/question/er-config/cli/update-single','GET','method','push','/smartapi/lovrabet/dataset/','menu','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/custom/getUserCustomSql?id=','/smartapi/question/er-config/cli/detail?','Fetch\x20datasets','includes','/smartapi/webcode/file/publish','cli:rabetbase','array','/smartapi/menu/delete','map','/smartapi/app-config/getByKey','scriptName','/admin/knowledge-base/get-list','/admin/knowledge-base/update','API\x20error\x20code:\x20306','/smartapi/dataset/get-driven-data?','operationName','Page\x20not\x20found:\x20','materialName','operations','/admin/knowledge-base/delete','/smartapi/dataset/get-dataset-list','key','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/permit/user-role/get-user-list','\x20\x20where:\x20{},','\x20\x20pageSize:\x2020,','enabled','modelCode','):\x20missing\x20data.markdown\x20field'];a216_0x42a8=function(){return _0x5f3e32;};return a216_0x42a8();}export async function listDbLinks(_0x2e8f09,_0x421c78){const _0x211441=a216_0x230cbf,_0x4e9062=await apiRequest(_0x211441(0x1f6),{'method':'POST','body':{'appCode':_0x2e8f09,'currentPage':_0x421c78?.['currentPage']??0x1,'pageSize':_0x421c78?.['pageSize']??0x64}});return{'items':extractList(_0x4e9062[_0x211441(0x171)]),'paging':extractPaging(_0x4e9062['data'])};}export async function getDbLinkInfo(_0x59e51e){const _0x52f03c=a216_0x230cbf,_0x5463a7=await apiRequest(_0x52f03c(0x113)+buildQuery({'id':_0x59e51e}));return _0x5463a7[_0x52f03c(0x171)];}export async function createDbLink(_0x4de0dc){const _0x59551a=a216_0x230cbf,_0x158b66=await apiRequest(_0x59551a(0x231),{'method':_0x59551a(0x204),'body':_0x4de0dc});return _0x158b66[_0x59551a(0x171)];}export async function updateDbLink(_0x3d3393){const _0x24f083=a216_0x230cbf,_0x38f4d2=await apiRequest(_0x24f083(0x11a),{'method':_0x24f083(0x204),'body':_0x3d3393});return _0x38f4d2['data'];}export async function deleteDbLink(_0x11b79f){const _0x348815=a216_0x230cbf;await apiRequest(_0x348815(0x219),{'method':'POST','body':{'id':_0x11b79f}});}export async function testDbLinkConnect(_0x4a707a){const _0x2a7e03=a216_0x230cbf,_0x422cc3=await apiRequest(_0x2a7e03(0x136)+buildQuery({'id':_0x4a707a}));return _0x422cc3[_0x2a7e03(0x171)];}export async function startDbAnalysis(_0x955914,_0x24be63){const _0x3d62ba=a216_0x230cbf,_0x493000=await apiRequest('/smartapi/db-analysis/start',{'method':_0x3d62ba(0x204),'body':{'dbLinkId':_0x955914,..._0x24be63&&_0x24be63['length']>0x0?{'tableNames':_0x24be63}:{}}});return _0x493000['data'];}export async function cancelDbAnalysis(_0x4cbe45){const _0x1f7030=a216_0x230cbf;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x4cbe45}),{'method':_0x1f7030(0x204)});}export async function getDbAnalysisStatus(_0x17995e){const _0x10a724=a216_0x230cbf,_0x210e91=await apiRequest('/smartapi/db-analysis/status/'+encodeURIComponent(_0x17995e));return _0x210e91[_0x10a724(0x171)];}export async function getDbAllTableList(_0x22a3b7,_0x360f55){const _0x1bebd2=a216_0x230cbf,_0x31ea66=await apiRequest(_0x1bebd2(0x1e1)+buildQuery({'appCode':_0x22a3b7,'dbLinkId':_0x360f55})),_0x242b8f=_0x31ea66['data'];if(Array[_0x1bebd2(0x1e3)](_0x242b8f))return _0x242b8f;return extractList(_0x242b8f);}export async function getDbTableDiff(_0x18b1aa,_0x323f41,_0x12d1bc){const _0x2d26d8=a216_0x230cbf,_0x1556ab=await apiRequest(_0x2d26d8(0x1f0)+buildQuery({'appCode':_0x18b1aa,'dbLinkId':_0x323f41,'pageIndex':_0x12d1bc?.[_0x2d26d8(0x194)]??0x1,'pageSize':_0x12d1bc?.['pageSize']??0x14,'tableName':_0x12d1bc?.[_0x2d26d8(0x202)]})),_0x8a987a=_0x1556ab[_0x2d26d8(0x171)];return{'totalCount':_0x8a987a?.['totalCount']??0x0,'physicalTableCount':_0x8a987a?.[_0x2d26d8(0x1dc)]??0x0,'datasetTableCount':_0x8a987a?.['datasetTableCount']??0x0,..._0x8a987a?.[_0x2d26d8(0x14c)]?{'summary':_0x8a987a[_0x2d26d8(0x14c)]}:{},'tableList':Array[_0x2d26d8(0x1e3)](_0x8a987a?.[_0x2d26d8(0x173)])?_0x8a987a[_0x2d26d8(0x173)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x2f1bc1=a216_0x230cbf,_0x581561=await apiRequest(_0x2f1bc1(0x11f),{'method':_0x2f1bc1(0x204),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x10da0a=extractList(_0x581561[_0x2f1bc1(0x171)]),_0x22faa1=extractPaging(_0x581561['data']);return _0x22faa1&&_0x22faa1['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x2f1bc1(0x230)](_0x2f1bc1(0x221)+REMOTE_APP_PAGE_SIZE+_0x2f1bc1(0x22f)+_0x22faa1['totalCount']+_0x2f1bc1(0x140)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x10da0a;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0x569d01,_0x5109c3){const _0x4a9552=a216_0x230cbf,_0xe59b4f=Math[_0x4a9552(0x18f)](Math[_0x4a9552(0x153)](_0x5109c3?.[_0x4a9552(0x21c)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x52a079=await apiRequest(_0x4a9552(0x116),{'method':_0x4a9552(0x204),'body':{'appCode':_0x569d01,'currentPage':_0x5109c3?.[_0x4a9552(0x215)]??0x1,'pageSize':_0xe59b4f}});return{'items':extractList(_0x52a079[_0x4a9552(0x171)]),'paging':extractPaging(_0x52a079[_0x4a9552(0x171)])};}export async function getAppRole(_0x2c8a8d){const _0x5d1b4b=await apiRequest('/smartapi/permit/role/get-one'+buildQuery({'id':_0x2c8a8d}));return _0x5d1b4b['data'];}export async function createAppRole(_0x566fac){const _0x5c63f3=a216_0x230cbf,_0x38a8f1=await apiRequest(_0x5c63f3(0x13f),{'method':_0x5c63f3(0x204),'body':{'appCode':_0x566fac[_0x5c63f3(0x1ec)],'roleName':_0x566fac[_0x5c63f3(0x189)],'roleType':_0x5c63f3(0x222),..._0x566fac[_0x5c63f3(0x1f9)]?{'remark':_0x566fac[_0x5c63f3(0x1f9)]}:{}}});return _0x38a8f1[_0x5c63f3(0x171)];}export async function updateAppRole(_0x2afdd2){const _0x15c1e4=a216_0x230cbf,_0x241822=await apiRequest('/smartapi/permit/role/update',{'method':'POST','body':{'id':_0x2afdd2['id'],'appCode':_0x2afdd2[_0x15c1e4(0x1ec)],..._0x2afdd2[_0x15c1e4(0x176)]?{'roleType':_0x2afdd2[_0x15c1e4(0x176)]}:{},..._0x2afdd2[_0x15c1e4(0x189)]!==undefined?{'roleName':_0x2afdd2[_0x15c1e4(0x189)]}:{},..._0x2afdd2[_0x15c1e4(0x1f9)]!==undefined?{'remark':_0x2afdd2[_0x15c1e4(0x1f9)]}:{},..._0x2afdd2[_0x15c1e4(0x211)]?{'permits':_0x2afdd2[_0x15c1e4(0x211)]}:{}}});return _0x241822[_0x15c1e4(0x171)];}export async function deleteAppRole(_0x343629){const _0x1d9b19=a216_0x230cbf;await apiRequest('/smartapi/permit/role/delete',{'method':_0x1d9b19(0x204),'body':{'id':_0x343629}});}export async function listPermitRoles(_0x4c5fa7,_0x399cc1){const _0x53940b=a216_0x230cbf,_0x41371e=await apiRequest(_0x53940b(0x119),{'method':_0x53940b(0x204),'body':{'appCode':_0x4c5fa7,..._0x399cc1?.[_0x53940b(0x145)]!==undefined?{'needSelf':_0x399cc1['needSelf']}:{},..._0x399cc1?.[_0x53940b(0x13e)]!==undefined?{'needPublic':_0x399cc1[_0x53940b(0x13e)]}:{}}});return extractList(_0x41371e[_0x53940b(0x171)]);}export async function getRoleMenuResources(_0x37a30f,_0x5a26c4){const _0x537554=a216_0x230cbf,_0xeee2b7=await apiRequest(_0x537554(0x18e),{'method':_0x537554(0x204),'body':{'appCode':_0x37a30f,'roleId':_0x5a26c4}});return extractList(_0xeee2b7['data']);}export async function getRoleApiResources(_0x6ac05,_0x39965d){const _0x3562ba=a216_0x230cbf,_0x3fe4da=await apiRequest(_0x3562ba(0x20a),{'method':_0x3562ba(0x204),'body':{'appCode':_0x6ac05,'roleId':_0x39965d}});return extractList(_0x3fe4da[_0x3562ba(0x171)]);}export async function listRoleUsers(_0x3c03ab){const _0x3f0dc0=a216_0x230cbf,_0x28a0ef=await apiRequest(_0x3f0dc0(0x1bc),{'method':_0x3f0dc0(0x204),'body':{'appCode':_0x3c03ab}});return extractList(_0x28a0ef[_0x3f0dc0(0x171)])[_0x3f0dc0(0x1ad)](({id:_0x122d3b,userList:_0x1395cf,applyUserList:_0x331a84,..._0x47865f})=>({..._0x47865f,'id':Number(_0x122d3b),'userList':_0x1395cf['map'](_0x32e8f9=>({..._0x32e8f9,'userId':Number(_0x32e8f9[_0x3f0dc0(0x1e9)])})),..._0x331a84?{'applyUserList':_0x331a84['map'](_0x56c75e=>({..._0x56c75e,'userId':Number(_0x56c75e[_0x3f0dc0(0x1e9)])}))}:{}}));}export async function updateRoleUsers(_0x3d992c,_0x5d933b){const _0x2c99be=a216_0x230cbf;await apiRequest(_0x2c99be(0x1c9),{'method':_0x2c99be(0x204),'body':{'appCode':_0x3d992c,'roleList':_0x5d933b}});}export async function getPagePermit(_0x4e9abe){const _0x5ae8df=a216_0x230cbf,_0x3f5720=await apiRequest(_0x5ae8df(0x203)+buildQuery({'menuId':_0x4e9abe}));return _0x3f5720[_0x5ae8df(0x171)];}export async function savePagePermit(_0x5edafe){const _0xf9b669=a216_0x230cbf,_0x438c5e=await apiRequest('/smartapi/permit/page/save',{'method':_0xf9b669(0x204),'body':_0x5edafe});return _0x438c5e['data'];}export async function listCurrentUserTenantMemberships(){const _0x2e117a=a216_0x230cbf,_0x2d0910=await apiRequest(_0x2e117a(0x138));return extractList(_0x2d0910[_0x2e117a(0x171)]);}export async function listTenantDirectoryMembers(_0x2d0bbf){const _0x335161=a216_0x230cbf,_0x697801=await apiRequest('/userTenant/getByTenantCode'+buildQuery({'code':_0x2d0bbf})),_0x280514=_0x697801[_0x335161(0x171)]?.[_0x335161(0x132)];return Array[_0x335161(0x1e3)](_0x280514)?_0x280514:[];}export async function getTenantMembers(_0x169d3e){const _0x55279c=a216_0x230cbf,_0x50fc18=await listTenantDirectoryMembers(_0x169d3e);return _0x50fc18['filter'](_0x3cad34=>_0x3cad34[_0x55279c(0x162)]===_0x55279c(0x124)||_0x3cad34[_0x55279c(0x162)]===undefined)[_0x55279c(0x1ad)](_0xaea5bd=>({'userId':Number(_0xaea5bd[_0x55279c(0x1e9)]??_0xaea5bd['id']),'username':_0xaea5bd[_0x55279c(0x152)],'nickname':_0xaea5bd[_0x55279c(0x10f)],'status':_0xaea5bd[_0x55279c(0x162)],'email':_0xaea5bd[_0x55279c(0x1ee)],'mobile':_0xaea5bd[_0x55279c(0x159)],'avatar':_0xaea5bd[_0x55279c(0x15e)]}))['filter'](_0x10acbc=>Number[_0x55279c(0x12e)](_0x10acbc['userId'])&&_0x10acbc[_0x55279c(0x1e9)]>0x0);}
1
+ const a208_0x958b7=a208_0x1894;(function(_0x419833,_0xbadf4b){const _0x1ba3e1=a208_0x1894,_0x16aae2=_0x419833();while(!![]){try{const _0x257a56=parseInt(_0x1ba3e1(0x125))/0x1*(-parseInt(_0x1ba3e1(0x130))/0x2)+parseInt(_0x1ba3e1(0x188))/0x3+parseInt(_0x1ba3e1(0x1b4))/0x4*(parseInt(_0x1ba3e1(0x204))/0x5)+-parseInt(_0x1ba3e1(0x16b))/0x6+parseInt(_0x1ba3e1(0x1fc))/0x7*(-parseInt(_0x1ba3e1(0x1d2))/0x8)+parseInt(_0x1ba3e1(0x11b))/0x9*(parseInt(_0x1ba3e1(0x15b))/0xa)+parseInt(_0x1ba3e1(0x193))/0xb;if(_0x257a56===_0xbadf4b)break;else _0x16aae2['push'](_0x16aae2['shift']());}catch(_0x30754b){_0x16aae2['push'](_0x16aae2['shift']());}}}(a208_0x25a2,0x85f31));import{readFile}from'node:fs/promises';import{basename}from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{getEnv}from'../constant/env.js';import{CliError,CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';import{normalizeEntityWithIdResponse}from'../utils/entity-with-id.js';import{logger}from'../utils/logger.js';let _activeCookie;export function setActiveCookie(_0x20cd16){_activeCookie=_0x20cd16||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}const DEFAULT_REQUEST_TIMEOUT_MS=0x7530,ER_CONFIG_REQUEST_TIMEOUT_MS=0x1d4c0,TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS=0x57e40,PLATFORM_TRANSPORT_FAILURE=Symbol(a208_0x958b7(0x14f)),PLATFORM_ERROR_CODE=Symbol(a208_0x958b7(0x21e));export function isPlatformTransportFailure(_0x2a597f){const _0x450ac1=a208_0x958b7;return Boolean(_0x2a597f&&typeof _0x2a597f===_0x450ac1(0x1bb)&&_0x2a597f[PLATFORM_TRANSPORT_FAILURE]===!![]);}export function getPlatformErrorCode(_0x154312){const _0x5e4bad=a208_0x958b7;if(!_0x154312||typeof _0x154312!=='object')return undefined;const _0x89c68c=_0x154312[PLATFORM_ERROR_CODE];return typeof _0x89c68c===_0x5e4bad(0x14a)&&_0x89c68c?_0x89c68c:undefined;}function a208_0x1894(_0x4b47b4,_0x20fdfa){_0x4b47b4=_0x4b47b4-0x11a;const _0x25a220=a208_0x25a2();let _0x189404=_0x25a220[_0x4b47b4];return _0x189404;}function createPlatformApiError(_0x14c825,_0x3a859f){const _0x85baa5=a208_0x958b7,_0x45b00c=typeof _0x3a859f===_0x85baa5(0x14a)?_0x3a859f[_0x85baa5(0x1dc)]():typeof _0x3a859f==='number'?String(_0x3a859f):'',_0x321892=CliErrors[_0x85baa5(0x22b)](_0x14c825,_0x45b00c?_0x85baa5(0x200)+_0x45b00c:undefined);return _0x45b00c&&(Object[_0x85baa5(0x11a)](_0x321892,PLATFORM_ERROR_CODE,{'value':_0x45b00c}),Object['defineProperty'](_0x321892,'data',{'value':{'remoteErrorCode':_0x45b00c},'enumerable':![]})),_0x321892;}function createFetchFailureError(_0x168e79,_0x223fc5){const _0x24c39e=a208_0x958b7,_0x39638b=_0x223fc5 instanceof Error?_0x223fc5[_0x24c39e(0x181)]:String(_0x223fc5),_0x6977aa=CliErrors['apiError']('Request\x20failed:\x20'+_0x168e79+(_0x39638b?'\x20('+_0x39638b+')':''),_0x24c39e(0x173));return Object[_0x24c39e(0x11a)](_0x6977aa,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x6977aa;}function createIndeterminateResponseError(_0xb6e5d7){const _0x2f64a4=a208_0x958b7,_0x1b9dc4=CliErrors[_0x2f64a4(0x22b)](_0xb6e5d7+_0x2f64a4(0x171),_0x2f64a4(0x134));return Object[_0x2f64a4(0x11a)](_0x1b9dc4,PLATFORM_TRANSPORT_FAILURE,{'value':!![]}),_0x1b9dc4;}async function apiRequest(_0x78aae7,_0x51f1d9={}){const _0x54e547=a208_0x958b7,{method:method=_0x54e547(0x224),body:_0x4d969f,headers:headers={},timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS,useRuntime:useRuntime=![],allowNonJsonSuccess:allowNonJsonSuccess=![]}=_0x51f1d9,_0x34352e=useRuntime?getRuntimeDomain():getApiDomain(),_0x44ae18=_activeCookie||getCookie(),_0x4c054d=''+_0x34352e+_0x78aae7,_0x420219=new AbortController(),_0x2ce625=setTimeout(()=>_0x420219['abort'](),timeout);try{const _0x145411=await fetch(_0x4c054d,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x44ae18,'X-Invoke-Source':_0x54e547(0x1c4),...headers},'body':_0x4d969f?JSON[_0x54e547(0x11d)](_0x4d969f):undefined,'signal':_0x420219[_0x54e547(0x1d0)]});let _0x5b8139;try{_0x5b8139=await _0x145411['json']();}catch(_0x2bbc6e){if(_0x2bbc6e instanceof Error&&_0x2bbc6e[_0x54e547(0x1c8)]==='AbortError')throw CliErrors[_0x54e547(0x22b)](_0x54e547(0x21d)+_0x4c054d);if(_0x145411['ok']&&allowNonJsonSuccess)return{'success':!![],'data':undefined};throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x145411[_0x54e547(0x1bd)]+')',_0x145411[_0x54e547(0x1bd)]>=0x190?_0x54e547(0x1e7):undefined);}if(!_0x145411['ok']||_0x5b8139[_0x54e547(0x210)]===![])throw CliErrors[_0x54e547(0x22b)](_0x5b8139[_0x54e547(0x218)]||_0x5b8139['message']||_0x54e547(0x1cb)+_0x145411[_0x54e547(0x1bd)],_0x5b8139[_0x54e547(0x192)]?_0x54e547(0x200)+_0x5b8139[_0x54e547(0x192)]:undefined);return _0x5b8139;}catch(_0xee09dd){if(_0xee09dd instanceof CliError)throw _0xee09dd;if(_0xee09dd instanceof Error&&_0xee09dd['name']===_0x54e547(0x14e))throw CliErrors[_0x54e547(0x22b)](_0x54e547(0x21d)+_0x4c054d);throw createFetchFailureError(_0x4c054d,_0xee09dd);}finally{clearTimeout(_0x2ce625);}}async function apiFormRequest(_0x5ed08e,_0x161cb4,_0x123a13={}){const _0x3b7478=a208_0x958b7,{timeout:timeout=DEFAULT_REQUEST_TIMEOUT_MS}=_0x123a13,_0x43efd9=_activeCookie||getCookie(),_0x2d86a0=''+getApiDomain()+_0x5ed08e,_0x57f39b=new AbortController(),_0xe51231=setTimeout(()=>_0x57f39b[_0x3b7478(0x126)](),timeout);try{const _0x1c638d=await fetch(_0x2d86a0,{'method':'POST','headers':{'Cookie':_0x43efd9,'X-Invoke-Source':_0x3b7478(0x1c4)},'body':_0x161cb4,'signal':_0x57f39b[_0x3b7478(0x1d0)]});let _0x18ae03;try{_0x18ae03=await _0x1c638d[_0x3b7478(0x150)]();}catch(_0x49dc1c){if(_0x49dc1c instanceof Error&&_0x49dc1c[_0x3b7478(0x1c8)]===_0x3b7478(0x14e))throw CliErrors[_0x3b7478(0x22b)](_0x3b7478(0x21d)+_0x2d86a0);throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1c638d['status']+')',_0x1c638d[_0x3b7478(0x1bd)]>=0x190?_0x3b7478(0x1e7):undefined);}if(!_0x1c638d['ok']||_0x18ae03[_0x3b7478(0x210)]===![])throw CliErrors[_0x3b7478(0x22b)](_0x18ae03['errorMsg']||_0x18ae03[_0x3b7478(0x181)]||_0x3b7478(0x1cb)+_0x1c638d[_0x3b7478(0x1bd)],_0x18ae03['errorCode']?_0x3b7478(0x200)+_0x18ae03[_0x3b7478(0x192)]:undefined);return _0x18ae03;}catch(_0x13cb4b){if(_0x13cb4b instanceof CliError)throw _0x13cb4b;if(_0x13cb4b instanceof Error&&_0x13cb4b[_0x3b7478(0x1c8)]===_0x3b7478(0x14e))throw CliErrors[_0x3b7478(0x22b)](_0x3b7478(0x21d)+_0x2d86a0);throw createFetchFailureError(_0x2d86a0,_0x13cb4b);}finally{clearTimeout(_0xe51231);}}export async function uploadDevelopmentFile(_0x38dd4b,_0x214024){const _0x41766d=a208_0x958b7,_0x3990aa=await readFile(_0x214024),_0x5746ba=new FormData();_0x5746ba[_0x41766d(0x168)](_0x41766d(0x1cc),_0x38dd4b),_0x5746ba[_0x41766d(0x168)]('file',new Blob([new Uint8Array(_0x3990aa)]),basename(_0x214024));const _0x42c4d3=await apiFormRequest(_0x41766d(0x139),_0x5746ba);return _0x42c4d3[_0x41766d(0x178)];}export async function queryDevelopmentFileUrl(_0x470591,_0x3fc366={}){const _0xe7b667=a208_0x958b7,_0xe9521c=await apiRequest('/smartapi/common/queryFileUrl',{'method':'POST','body':{'filePath':_0x470591,'downloadFlag':_0x3fc366[_0xe7b667(0x179)]??![],..._0x3fc366[_0xe7b667(0x1f2)]?{'longTerm':!![]}:{}}});return _0xe9521c[_0xe7b667(0x178)];}export async function recognizeDevelopmentOcr(_0xaa2024,_0x26ebbe){const _0x32afa9=a208_0x958b7,_0x4e5d10=new URLSearchParams({'url':_0x26ebbe[_0x32afa9(0x16a)],'type':_0x26ebbe[_0x32afa9(0x15f)],'appCode':_0xaa2024}),_0x2c9cb4=await apiRequest(_0x32afa9(0x1ea)+_0x4e5d10[_0x32afa9(0x1b7)](),{'method':_0x32afa9(0x224)});return _0x2c9cb4[_0x32afa9(0x178)];}function isAuthFailure(_0x1182f2){const _0x3349ff=a208_0x958b7,_0x77c8ca=_0x1182f2[_0x3349ff(0x218)]||_0x1182f2[_0x3349ff(0x181)]||_0x1182f2[_0x3349ff(0x178)]?.[_0x3349ff(0x181)]||_0x1182f2[_0x3349ff(0x1af)]||_0x1182f2[_0x3349ff(0x15a)]||'';return _0x1182f2[_0x3349ff(0x192)]==='UNAUTHORIZED'||_0x1182f2['code']===0x191||_0x1182f2[_0x3349ff(0x18e)]===_0x3349ff(0x225)||_0x77c8ca['includes']('401')||_0x77c8ca[_0x3349ff(0x1ed)]('Unauthorized')||_0x77c8ca[_0x3349ff(0x1ed)]('登录')||_0x77c8ca[_0x3349ff(0x1ed)]('认证');}export async function platformFetch(_0x7ceffd,_0x4a9789){const _0x4717eb=a208_0x958b7;let _0xaac0c;try{_0xaac0c=await fetch(_0x7ceffd,{'method':_0x4a9789[_0x4717eb(0x1f8)]??_0x4717eb(0x224),'headers':{'Content-Type':'application/json','Cookie':_0x4a9789[_0x4717eb(0x1bf)],'X-Invoke-Source':_0x4717eb(0x1c4)},..._0x4a9789['body']&&{'body':JSON[_0x4717eb(0x11d)](_0x4a9789[_0x4717eb(0x1f1)])}});}catch(_0x48043a){throw createFetchFailureError(_0x7ceffd,_0x48043a);}let _0x42fdfb;try{_0x42fdfb=await _0xaac0c[_0x4717eb(0x150)]();}catch(_0x5520c0){if(!_0xaac0c['ok']){if(_0xaac0c['status']===0x191)throw CliErrors[_0x4717eb(0x1a0)]();throw CliErrors['apiError'](_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x145)+_0xaac0c[_0x4717eb(0x1bd)]);}throw createFetchFailureError(_0x7ceffd,_0x5520c0);}if(_0x42fdfb===null||typeof _0x42fdfb!==_0x4717eb(0x1bb)||Array['isArray'](_0x42fdfb)){if(_0xaac0c[_0x4717eb(0x1bd)]===0x191)throw CliErrors[_0x4717eb(0x1a0)]();if(_0xaac0c['ok'])throw createIndeterminateResponseError(_0x4a9789[_0x4717eb(0x18f)]);throw CliErrors['apiError'](_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x18b)+(!_0xaac0c['ok']?_0x4717eb(0x1ec)+_0xaac0c[_0x4717eb(0x1bd)]:'')+_0x4717eb(0x1e3));}const _0x4289c2=typeof _0x42fdfb['errorCode']==='string'||typeof _0x42fdfb['errorCode']==='number',_0x1377a9=_0x4289c2?String(_0x42fdfb[_0x4717eb(0x192)])[_0x4717eb(0x1dc)]():'',_0x1a16e7=_0x42fdfb['success']===![]||_0x4289c2&&_0x1377a9!==_0x4717eb(0x1c9);if(!_0xaac0c['ok']||_0x1a16e7){if(_0xaac0c[_0x4717eb(0x1bd)]===0x191||isAuthFailure(_0x42fdfb))throw CliErrors[_0x4717eb(0x1a0)]();throw createPlatformApiError(_0x42fdfb[_0x4717eb(0x218)]||_0x42fdfb[_0x4717eb(0x181)]||_0x4a9789[_0x4717eb(0x18f)]+_0x4717eb(0x18b)+(!_0xaac0c['ok']?',\x20HTTP\x20'+_0xaac0c[_0x4717eb(0x1bd)]:''),_0x42fdfb['errorCode']??_0x42fdfb[_0x4717eb(0x18e)]);}if(_0x42fdfb[_0x4717eb(0x210)]!==!![]||_0x42fdfb[_0x4717eb(0x192)]!=='0000')throw createIndeterminateResponseError(_0x4a9789['label']);return _0x42fdfb[_0x4717eb(0x178)];}export async function platformRequest(_0x54c374,_0x84a272){const _0x85c8b8=a208_0x958b7;if(/^https?:\/\//i[_0x85c8b8(0x1f3)](_0x54c374))throw CliErrors['validation']('platformRequest\x20expects\x20an\x20API\x20path,\x20got\x20absolute\x20URL:\x20'+_0x54c374,_0x85c8b8(0x1ac));const _0xa664ef=_0x54c374[_0x85c8b8(0x184)]('/')?_0x54c374:'/'+_0x54c374;return platformFetch(''+getApiDomain()+_0xa664ef,_0x84a272);}const MAX_KNOWLEDGE_BASE_PAGE_SIZE=0x64;function parseKnowledgeBaseInteger(_0x4c954b,_0x59943e){const _0x2b7217=a208_0x958b7,_0x44b918=typeof _0x4c954b==='number'?_0x4c954b:typeof _0x4c954b===_0x2b7217(0x14a)&&/^(0|[1-9]\d*)$/[_0x2b7217(0x1f3)](_0x4c954b)?Number(_0x4c954b):Number[_0x2b7217(0x12c)],_0x445538=Number[_0x2b7217(0x12a)](_0x44b918)&&(_0x59943e==='id'?_0x44b918>0x0:_0x44b918>=0x0);if(!_0x445538)throw CliErrors[_0x2b7217(0x22b)](_0x2b7217(0x216)+_0x59943e+'.');return _0x44b918;}function parseKnowledgeBaseText(_0x3688be,_0x594968){const _0x2d15b2=a208_0x958b7;if(typeof _0x3688be==='string'&&(_0x594968===_0x2d15b2(0x229)||_0x3688be['trim']()))return _0x3688be;throw CliErrors[_0x2d15b2(0x22b)](_0x2d15b2(0x203)+_0x594968+'.');}function parseKnowledgeBaseRecord(_0x269e33){const _0x3d9cd0=a208_0x958b7;if(!_0x269e33||typeof _0x269e33!=='object'||Array[_0x3d9cd0(0x127)](_0x269e33))throw CliErrors[_0x3d9cd0(0x22b)]('Knowledge-base\x20API\x20returned\x20an\x20invalid\x20record\x20contract.');const _0x26bf6e=_0x269e33;if(_0x26bf6e['scope']!==_0x3d9cd0(0x19f)&&_0x26bf6e['scope']!==_0x3d9cd0(0x1f7))throw CliErrors['apiError'](_0x3d9cd0(0x11c));const _0x4c384c={'id':parseKnowledgeBaseInteger(_0x26bf6e['id'],'id'),'scope':_0x26bf6e[_0x3d9cd0(0x1a1)],'appCode':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x1cc)],'appCode'),'title':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x164)],_0x3d9cd0(0x164)),'version':parseKnowledgeBaseInteger(_0x26bf6e[_0x3d9cd0(0x13c)],_0x3d9cd0(0x13c)),'content':parseKnowledgeBaseText(_0x26bf6e[_0x3d9cd0(0x229)],'content')};return(_0x26bf6e['createTime']===null||typeof _0x26bf6e[_0x3d9cd0(0x172)]===_0x3d9cd0(0x14a)||typeof _0x26bf6e['createTime']===_0x3d9cd0(0x1d7))&&(_0x4c384c[_0x3d9cd0(0x172)]=_0x26bf6e[_0x3d9cd0(0x172)]),(_0x26bf6e[_0x3d9cd0(0x149)]===null||typeof _0x26bf6e[_0x3d9cd0(0x149)]===_0x3d9cd0(0x14a)||typeof _0x26bf6e[_0x3d9cd0(0x149)]===_0x3d9cd0(0x1d7))&&(_0x4c384c[_0x3d9cd0(0x149)]=_0x26bf6e['updateTime']),_0x4c384c;}export async function listEnterpriseKnowledgeBases(_0x34f1ed,_0x48a6e2={}){const _0x451870=a208_0x958b7,_0x2166c8=_0x48a6e2['pageSize']??0x32;if(!Number[_0x451870(0x12a)](_0x2166c8)||_0x2166c8<0x1||_0x2166c8>MAX_KNOWLEDGE_BASE_PAGE_SIZE)throw CliErrors[_0x451870(0x11e)](_0x451870(0x22a)+MAX_KNOWLEDGE_BASE_PAGE_SIZE+'.');const _0x5937c1=await platformRequest(_0x451870(0x133),{'method':'POST','cookie':_0x34f1ed,'label':'List\x20enterprise\x20knowledge\x20bases','body':{'currentPage':_0x48a6e2['currentPage']??0x1,'pageSize':_0x2166c8,'scope':'company',..._0x48a6e2[_0x451870(0x1cc)]?{'appCode':_0x48a6e2[_0x451870(0x1cc)]}:{},..._0x48a6e2['title']?{'title':_0x48a6e2[_0x451870(0x164)]}:{}}});if(!_0x5937c1||typeof _0x5937c1!==_0x451870(0x1bb)||Array[_0x451870(0x127)](_0x5937c1)||!Array[_0x451870(0x127)](_0x5937c1[_0x451870(0x180)]))throw CliErrors[_0x451870(0x22b)](_0x451870(0x142));const _0x50f91b=extractPaging(_0x5937c1);if(!_0x50f91b||!Number['isInteger'](_0x50f91b[_0x451870(0x19a)])||!Number['isInteger'](_0x50f91b[_0x451870(0x137)])||!Number[_0x451870(0x158)](_0x50f91b[_0x451870(0x227)])||_0x50f91b[_0x451870(0x19a)]<0x1||_0x50f91b[_0x451870(0x137)]<0x1||_0x50f91b[_0x451870(0x137)]>MAX_KNOWLEDGE_BASE_PAGE_SIZE||_0x50f91b[_0x451870(0x227)]<0x0)throw CliErrors['apiError'](_0x451870(0x13e));return{'items':extractList(_0x5937c1)['map'](parseKnowledgeBaseRecord),'paging':_0x50f91b};}export async function getEnterpriseKnowledgeBase(_0x26c557,_0x152a65){const _0x32cc61=await platformRequest('/admin/knowledge-base/get-one'+buildQuery({'id':_0x152a65}),{'cookie':_0x26c557,'label':'Get\x20enterprise\x20knowledge\x20base'});return parseKnowledgeBaseRecord(_0x32cc61);}export async function createEnterpriseKnowledgeBase(_0x4ac139,_0x3a2ea7){const _0x18fdf4=a208_0x958b7,_0x40916a=await platformRequest('/admin/knowledge-base/create',{'method':'POST','cookie':_0x4ac139,'label':_0x18fdf4(0x21a),'body':{'scope':_0x18fdf4(0x19f),..._0x3a2ea7}});return parseKnowledgeBaseRecord(_0x40916a);}export async function updateEnterpriseKnowledgeBase(_0xdb2098,_0x5aab21){const _0x2c026b=a208_0x958b7;if(_0x5aab21[_0x2c026b(0x164)]===undefined&&_0x5aab21[_0x2c026b(0x229)]===undefined)throw CliErrors[_0x2c026b(0x11e)](_0x2c026b(0x1a7));const _0x39f300=await platformRequest(_0x2c026b(0x120),{'method':_0x2c026b(0x1fb),'cookie':_0xdb2098,'label':'Update\x20enterprise\x20knowledge\x20base','body':{'id':_0x5aab21['id'],..._0x5aab21['title']!==undefined?{'title':_0x5aab21[_0x2c026b(0x164)]}:{},..._0x5aab21[_0x2c026b(0x229)]!==undefined?{'content':_0x5aab21['content']}:{}}});return parseKnowledgeBaseRecord(_0x39f300);}export async function deleteEnterpriseKnowledgeBase(_0x54ee59,_0x2687b8){const _0x5e2c86=a208_0x958b7;await platformRequest(_0x5e2c86(0x1c5),{'method':_0x5e2c86(0x1fb),'cookie':_0x54ee59,'label':'Delete\x20enterprise\x20knowledge\x20base','body':{'id':_0x2687b8}});}function cleanNewlines(_0x31dc57){const _0x40cb50=a208_0x958b7;return _0x31dc57['replace'](/[\r\n]+/g,'\x20')[_0x40cb50(0x1dc)]();}function cleanDatasetName(_0x864550){if(!_0x864550['name'])return _0x864550;return{..._0x864550,'name':cleanNewlines(_0x864550['name'])};}export async function fetchModelList(_0x433c8a,_0x53637a){const _0x1e6218=a208_0x958b7,_0x2663bc=getEnv(),_0x415868=new URLSearchParams({'appcode':_0x433c8a,'otype':_0x1e6218(0x18a)}),_0x203403=_0x1e6218(0x136)+_0x415868['toString']();logger[_0x1e6218(0x185)]('fetch-model-list',_0x1e6218(0x1fa)+_0x2663bc+')',{'apiPath':_0x203403});const _0x53b616=await platformRequest(_0x203403,{'cookie':_0x53637a,'label':_0x1e6218(0x228)}),_0x550a69=(_0x53b616[_0x1e6218(0x17e)]??[])[_0x1e6218(0x221)](cleanDatasetName);return{'configArray':_0x550a69,'count':_0x550a69['length']};}export async function fetchDatasetDoc(_0x986621){const _0x19e111=a208_0x958b7,{appCode:_0x314341,cookie:_0xba43fa,datasetCode:_0x38c304,datasetId:_0x3736be,extraParams:_0x3ed8f5}=_0x986621,_0x3146ea=await platformRequest('/api/node-toolbox/api-doc-generator',{'method':'POST','body':{'appCode':_0x314341,'datasetCode':_0x38c304,'datasetId':_0x3736be,..._0x3ed8f5||{}},'cookie':_0xba43fa,'label':_0x19e111(0x1b6)+_0x38c304+')'});if(!_0x3146ea||typeof _0x3146ea[_0x19e111(0x143)]!==_0x19e111(0x14a))throw new Error(_0x19e111(0x190)+_0x38c304+_0x19e111(0x1d1));return _0x3146ea['markdown'];}export async function getMenuTree(_0x479059,_0x4a3ddc){const _0x1005ae=a208_0x958b7,_0x3667ce=new URLSearchParams({'appCode':_0x479059});return platformRequest('/smartapi/menu/find?'+_0x3667ce[_0x1005ae(0x1b7)](),{'cookie':_0x4a3ddc,'label':_0x1005ae(0x19c)});}export async function createMenuRecord(_0x3f8dcd,_0x49ea66,_0x51bd3d){const _0x4a7337=a208_0x958b7;return platformRequest(_0x4a7337(0x1f9),{'method':_0x4a7337(0x1fb),'body':_0x3f8dcd,'cookie':_0x49ea66,'label':_0x51bd3d});}export async function updateMenuRecord(_0x3e2941,_0x587aee,_0x3374d6){const _0x42a871=a208_0x958b7;return platformRequest(_0x42a871(0x226),{'method':_0x42a871(0x1fb),'body':_0x3e2941,'cookie':_0x587aee,'label':_0x3374d6});}export async function deleteMenuRecord(_0x5ce648,_0x1627f4,_0x1c025f){const _0x3fc5e5=a208_0x958b7;return platformRequest(_0x3fc5e5(0x197),{'method':_0x3fc5e5(0x1fb),'body':{'id':_0x5ce648},'cookie':_0x1627f4,'label':_0x1c025f});}export async function batchDeleteMenuRecords(_0x4660c0,_0x9e6757,_0x26752e){const _0x59d0cc=a208_0x958b7;return platformRequest(_0x59d0cc(0x1ff),{'method':_0x59d0cc(0x1fb),'body':{'idList':_0x4660c0},'cookie':_0x9e6757,'label':_0x26752e});}export async function startMenuRegroup(_0x2c2410,_0x6ed307,_0x276578){const _0x220d11=a208_0x958b7;return platformRequest(_0x220d11(0x1b9),{'method':_0x220d11(0x1fb),'body':_0x2c2410,'cookie':_0x6ed307,'label':_0x276578});}export async function getAsyncTaskStatus(_0x4c1175,_0x357709,_0x426e81){const _0x2d0fa4=a208_0x958b7,_0x26f383=new URLSearchParams({'appCode':_0x357709});return platformRequest(_0x2d0fa4(0x135)+encodeURIComponent(_0x4c1175)+'?'+_0x26f383['toString'](),{'cookie':_0x426e81,'label':'Fetch\x20async\x20task\x20'+_0x4c1175});}export async function listBffScripts(_0x2e948a,_0x2ecc4b,_0x54a33c){const _0x21d54e=a208_0x958b7;let _0x4e9467=_0x21d54e(0x217)+_0x2e948a;if(_0x2ecc4b)_0x4e9467+='&type='+_0x2ecc4b;const _0x52e393=await apiRequest(_0x4e9467);let _0x58ce01=extractList(_0x52e393[_0x21d54e(0x178)]);if(_0x54a33c?.[_0x21d54e(0x176)]){const _0x4f75b7=_0x54a33c[_0x21d54e(0x176)]['toLowerCase']();_0x58ce01=_0x58ce01[_0x21d54e(0x1dd)](_0x3a9a9f=>_0x3a9a9f[_0x21d54e(0x14c)]?.['toLowerCase']()[_0x21d54e(0x1ed)](_0x4f75b7)||_0x3a9a9f[_0x21d54e(0x121)]?.[_0x21d54e(0x1bc)]()[_0x21d54e(0x1ed)](_0x4f75b7));}return _0x58ce01;}export async function getBffScriptInfo(_0x12d022){const _0xc73585=a208_0x958b7,_0x271bb6=await apiRequest(_0xc73585(0x17c)+_0x12d022);if(!_0x271bb6[_0xc73585(0x178)])throw CliErrors[_0xc73585(0x11e)](_0xc73585(0x17d)+_0x12d022);return _0x271bb6[_0xc73585(0x178)];}export async function saveBffScript(_0x46f8b9){const _0x307c80=a208_0x958b7,_0x583549=await apiRequest(_0x307c80(0x1df),{'method':_0x307c80(0x1fb),'body':_0x46f8b9}),{id:_0x39e212,entity:_0xcb2a7e}=normalizeEntityWithIdResponse(_0x583549['data']);if(_0x39e212!==undefined){const _0x1e7760=typeof _0xcb2a7e[_0x307c80(0x14c)]==='string'||typeof _0xcb2a7e[_0x307c80(0x1b3)]===_0x307c80(0x14a)?_0xcb2a7e:undefined;return{'id':_0x39e212,'script':_0x1e7760};}throw CliErrors[_0x307c80(0x22b)]('BFF\x20save\x20returned\x20no\x20valid\x20id');}export async function deleteBffScript(_0x49570c){const _0x56aee9=a208_0x958b7;await apiRequest(_0x56aee9(0x1ca),{'method':_0x56aee9(0x1fb),'body':{'id':_0x49570c}});}export async function getBffScriptStatistics(_0x5ca78e){const _0x109d6e=a208_0x958b7,_0xc4078e=await apiRequest(_0x109d6e(0x214)+_0x5ca78e);return extractList(_0xc4078e[_0x109d6e(0x178)]);}export async function clearBffScriptCache(){const _0x3d303f=a208_0x958b7,_0x460003=await apiRequest('/api/management/script/cache/clear',{'method':_0x3d303f(0x1fb),'useRuntime':!![]});return typeof _0x460003[_0x3d303f(0x178)]==='string'?_0x460003['data']:'';}export async function listBffDatasetOperations(_0x217502,_0xceeae2){const _0x27d15a=a208_0x958b7,_0x2f7986=await apiRequest(_0x27d15a(0x165),{'method':_0x27d15a(0x1fb),'body':{'appCode':_0x217502,'datasetId':_0xceeae2}});return _0x2f7986[_0x27d15a(0x178)];}export async function listSqlQueries(_0x365a6e,_0x39a5cf){const _0xae618d=a208_0x958b7,_0x2ab844=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0xae618d(0x1fb),'body':{'appCode':_0x365a6e,'currentPage':_0x39a5cf?.['currentPage']??0x1,'pageSize':_0x39a5cf?.['pageSize']??0x32,'sqlCode':_0x39a5cf?.[_0xae618d(0x1d5)],'sqlName':_0x39a5cf?.[_0xae618d(0x1da)]}});return _0x2ab844[_0xae618d(0x178)];}export async function getSqlQueryInfo(_0x39cf2e,_0xbb3d85){const _0xb2d3ca=a208_0x958b7,_0x108e02=await listSqlQueries(_0x39cf2e,{'sqlCode':_0xbb3d85}),_0x5a6dec=_0x108e02['tableData']?.[0x0];if(!_0x5a6dec)throw CliErrors[_0xb2d3ca(0x11e)]('SQL\x20query\x20not\x20found:\x20'+_0xbb3d85);return _0x5a6dec;}export async function getSqlQueryDetail(_0x40f274){const _0x15b94d=a208_0x958b7,_0x24bd8f=await apiRequest(_0x15b94d(0x1e5)+(_0x15b94d(0x195)+encodeURIComponent(_0x40f274)));if(!_0x24bd8f[_0x15b94d(0x178)])throw CliErrors[_0x15b94d(0x11e)](_0x15b94d(0x1e4)+_0x40f274);return _0x24bd8f[_0x15b94d(0x178)];}export async function getSqlQueryDetailById(_0x2394f8){const _0x131017=a208_0x958b7,_0x38956b=await apiRequest('/smartapi/custom/getUserCustomSql?id='+_0x2394f8);if(!_0x38956b[_0x131017(0x178)])throw CliErrors['validation'](_0x131017(0x206)+_0x2394f8);return _0x38956b[_0x131017(0x178)];}export async function createSqlQuery(_0x1b5bb9){const _0x41e7dc=a208_0x958b7,_0x14f14d=await apiRequest('/smartapi/custom/saveUserCustomSql',{'method':'POST','body':_0x1b5bb9}),{id:_0x3fc4c9,entity:_0xebedb6}=normalizeEntityWithIdResponse(_0x14f14d[_0x41e7dc(0x178)]);if(!(_0x41e7dc(0x1d5)in _0xebedb6)&&_0x3fc4c9)return getSqlQueryDetailById(_0x3fc4c9);return normalizeSqlQueryEntity(_0xebedb6);}export async function updateSqlQuery(_0x3d9a39){const _0x6752d6=a208_0x958b7,_0x545564=await apiRequest(_0x6752d6(0x1ab),{'method':_0x6752d6(0x1fb),'body':_0x3d9a39}),{id:_0x93b4f6,entity:_0x9ad335}=normalizeEntityWithIdResponse(_0x545564[_0x6752d6(0x178)]);if(!('sqlCode'in _0x9ad335)){if(_0x3d9a39[_0x6752d6(0x1d5)])return getSqlQueryDetail(_0x3d9a39[_0x6752d6(0x1d5)]);if(_0x93b4f6)return getSqlQueryDetailById(_0x93b4f6);}return normalizeSqlQueryEntity(_0x9ad335);}export async function deleteSqlQuery(_0x54d161){const _0x20371b=a208_0x958b7;await apiRequest(_0x20371b(0x1ce),{'method':'POST','body':_0x54d161});}export async function saveSqlQuery(_0x5f451b){const _0x4abd1e=a208_0x958b7,_0x14ff19=await apiRequest(_0x4abd1e(0x170),{'method':_0x4abd1e(0x1fb),'body':_0x5f451b});return _0x14ff19[_0x4abd1e(0x178)];}function normalizeSqlQueryEntity(_0x43881c){const _0x1988fd=a208_0x958b7;return{..._0x43881c,'id':Number(_0x43881c['id']),'dbId':_0x43881c[_0x1988fd(0x1b0)]==null?undefined:Number(_0x43881c['dbId']),'version':_0x43881c[_0x1988fd(0x13c)]==null?undefined:Number(_0x43881c[_0x1988fd(0x13c)])};}export async function executeSql(_0x1072c3,_0x228acd,_0x5c84dc){const _0x34c11f=a208_0x958b7,_0x25f6c2=await apiRequest(_0x34c11f(0x1fe),{'method':'POST','body':{'appCode':_0x1072c3,'sqlCode':_0x228acd,..._0x5c84dc&&{'params':_0x5c84dc}},'useRuntime':!![]});return _0x25f6c2[_0x34c11f(0x178)];}export async function executeDatasetDataOperation(_0x2c6bf0,_0x2a5c0c,_0x4fc83c,_0x2d086a={}){const _0x394858=a208_0x958b7;try{const _0x7d06d2=await apiRequest(_0x394858(0x196)+_0x2c6bf0+'/'+_0x2a5c0c+'/'+_0x4fc83c,{'method':_0x394858(0x1fb),'body':_0x2d086a,'useRuntime':!![]});return _0x7d06d2[_0x394858(0x178)];}catch(_0x4fffbc){if(_0x4fc83c===_0x394858(0x129)&&_0x4fffbc instanceof CliError&&_0x4fffbc[_0x394858(0x18e)]===_0x394858(0x159)&&_0x2d086a['id']!==undefined&&_0x2d086a['id']!==null&&_0x2d086a['id']!==''){const _0xc9e6bb=await apiRequest('/api/'+_0x2c6bf0+'/'+_0x2a5c0c+_0x394858(0x1c6),{'method':_0x394858(0x1fb),'body':{'where':{'id':{'$eq':_0x2d086a['id']}},'currentPage':0x1,'pageSize':0x1},'useRuntime':!![]}),_0x9ee418=Array[_0x394858(0x127)](_0xc9e6bb[_0x394858(0x178)]?.[_0x394858(0x180)])?_0xc9e6bb['data'][_0x394858(0x180)]:[];return _0x9ee418[0x0]??null;}throw _0x4fffbc;}}export async function listDatasets(_0x509a27,_0x425fd6){const _0x3bba9e=a208_0x958b7,_0x4c4765={'appCode':_0x509a27,'deleted':_0x425fd6?.[_0x3bba9e(0x1f4)]??![]};if(_0x425fd6?.[_0x3bba9e(0x18e)])_0x4c4765[_0x3bba9e(0x18e)]=_0x425fd6['code'];if(_0x425fd6?.[_0x3bba9e(0x1c8)])_0x4c4765[_0x3bba9e(0x1c8)]=_0x425fd6[_0x3bba9e(0x1c8)];const _0x3b353e=await apiRequest(_0x3bba9e(0x22c),{'method':_0x3bba9e(0x1fb),'body':_0x4c4765});return extractList(_0x3b353e['data']);}export async function deleteDataset(_0x42115b,_0x2ca7d){const _0x2a0244=a208_0x958b7;await apiRequest(_0x2a0244(0x1cd),{'method':_0x2a0244(0x1fb),'body':{'appCode':_0x42115b,'datasetId':_0x2ca7d}});}export async function restoreDataset(_0x157086,_0x38d02b){const _0x2fa1c9=a208_0x958b7;await apiRequest(_0x2fa1c9(0x14d),{'method':_0x2fa1c9(0x1fb),'body':{'appCode':_0x157086,'datasetId':_0x38d02b}});}export async function previewTextGeneratedDataset(_0x5e4e2e,_0x334bd6){const _0x35be64=a208_0x958b7,_0x1926a3=await apiRequest('/smartapi/dataset/text-generate/preview',{'method':_0x35be64(0x1fb),'body':{'appCode':_0x5e4e2e,'datasetName':_0x334bd6[_0x35be64(0x163)],'requirementDescription':_0x334bd6[_0x35be64(0x222)]},'timeout':TEXT_GENERATED_DATASET_PREVIEW_TIMEOUT_MS});return _0x1926a3['data'];}export async function startTextGeneratedDataset(_0x259982,_0x4feced,_0xf3377a){const _0x233554=a208_0x958b7,_0x353855=await apiRequest(_0x233554(0x198),{'method':_0x233554(0x1fb),'body':{'appCode':_0x259982,..._0xf3377a?.[_0x233554(0x13b)]?{'clientOperationId':_0xf3377a[_0x233554(0x13b)]}:{},'design':_0x4feced},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x353855[_0x233554(0x178)];}export async function getTextGeneratedDatasetStatus(_0x3b4938,_0x5a5359){const _0x1add8c=a208_0x958b7,_0x10ff62=new URLSearchParams({'appCode':_0x3b4938});_0x5a5359[_0x1add8c(0x157)]&&_0x10ff62[_0x1add8c(0x1e0)]('operationId',_0x5a5359[_0x1add8c(0x157)]);_0x5a5359['clientOperationId']&&_0x10ff62[_0x1add8c(0x1e0)]('clientOperationId',_0x5a5359[_0x1add8c(0x13b)]);const _0x313695=await apiRequest('/smartapi/dataset/text-generate/status?'+_0x10ff62[_0x1add8c(0x1b7)]());return _0x313695[_0x1add8c(0x178)];}export async function searchDatasets(_0x309f71,_0x33fd48){const _0x5501ce=a208_0x958b7,_0x4018d0=await listDatasets(_0x309f71,{'name':_0x33fd48}),_0x559bed=_0x33fd48[_0x5501ce(0x1bc)](),_0x2c57f8=new Set(_0x4018d0[_0x5501ce(0x221)](_0x38f638=>_0x38f638['id'])),_0x53cc7d=_0x4018d0[_0x5501ce(0x1dd)](_0x476a9f=>_0x476a9f['dbtableConfig']?.[_0x5501ce(0x12b)]?.['toLowerCase']()['includes'](_0x559bed)||_0x476a9f[_0x5501ce(0x121)]?.[_0x5501ce(0x1bc)]()['includes'](_0x559bed)),_0x5b9621=await listDatasets(_0x309f71,{'code':_0x33fd48});for(const _0x4d53ef of _0x5b9621){!_0x2c57f8[_0x5501ce(0x205)](_0x4d53ef['id'])&&(_0x4018d0['push'](_0x4d53ef),_0x2c57f8[_0x5501ce(0x141)](_0x4d53ef['id']));}return _0x4018d0;}export function normalizeDatasetOperations(_0x1fafad){const _0x2906de=a208_0x958b7;if(Array[_0x2906de(0x127)](_0x1fafad))return _0x1fafad[_0x2906de(0x1dd)](_0x1e4381=>_0x1e4381!=null&&typeof _0x1e4381===_0x2906de(0x1bb));if(_0x1fafad&&typeof _0x1fafad==='object')return Object[_0x2906de(0x223)](_0x1fafad)[_0x2906de(0x1dd)](([,_0x290634])=>_0x290634!=null&&typeof _0x290634===_0x2906de(0x1bb))[_0x2906de(0x221)](([_0x65cbd7,_0x1dcdbb])=>({..._0x1dcdbb,'name':_0x1dcdbb[_0x2906de(0x1c8)]??_0x1dcdbb[_0x2906de(0x183)]??_0x65cbd7}));return[];}export async function getDatasetDetail(_0x8b8047){const _0x34669e=a208_0x958b7,_0x4eb70f=/^\d+$/['test'](_0x8b8047)?'id':'code',_0x1a66dd=await apiRequest(_0x34669e(0x140)+_0x4eb70f+'='+_0x8b8047);return _0x1a66dd['data'];}export async function updateDrivenData(_0x54d573){const _0x1fcaa4=a208_0x958b7,_0x19b487=await apiRequest(_0x1fcaa4(0x21b),{'method':'POST','body':_0x54d573});return _0x19b487[_0x1fcaa4(0x178)];}export async function getDatasetOperations(_0x5af1aa){const _0x34abc8=a208_0x958b7,_0x5540f2=await getDatasetDetail(_0x5af1aa),_0x4b8318=normalizeDatasetOperations(_0x5540f2['operations'])[_0x34abc8(0x221)](_0x46aab1=>({'name':_0x46aab1['name']||_0x46aab1['operationName'],'displayName':_0x46aab1[_0x34abc8(0x1a8)]||_0x46aab1[_0x34abc8(0x1c8)],'type':_0x46aab1[_0x34abc8(0x15f)],'method':_0x46aab1['method'],'path':_0x46aab1[_0x34abc8(0x1de)],'enabled':_0x46aab1[_0x34abc8(0x16e)]??!![],'requestFields':_0x46aab1['requestFields'],'responseFields':_0x46aab1[_0x34abc8(0x211)]}));return{'dataset':{'id':_0x5540f2['id']??_0x5540f2[_0x34abc8(0x1a9)],'name':_0x5540f2['name'],'code':_0x5540f2[_0x34abc8(0x18e)]||_0x5540f2[_0x34abc8(0x17f)],'tableName':_0x5540f2['tableName']||_0x5540f2['dbtableConfig']?.[_0x34abc8(0x12b)]},'operations':_0x4b8318};}export async function getOperationDetail(_0x8e93e1,_0xd99fbc,_0x2e20b5){const _0x311b48=a208_0x958b7;let _0x2864b2=_0xd99fbc;if(!/^\d+$/[_0x311b48(0x1f3)](_0xd99fbc)){const _0x293460=await listDatasets(_0x8e93e1,{'code':_0xd99fbc}),_0x22d9ca=_0x293460[_0x311b48(0x20f)](_0x3120ae=>_0x3120ae['code']===_0xd99fbc||String(_0x3120ae['id'])===_0xd99fbc);if(!_0x22d9ca)throw CliErrors[_0x311b48(0x11e)]('Dataset\x20not\x20found:\x20'+_0xd99fbc);_0x2864b2=String(_0x22d9ca['id']);}const _0x2ee852=await getDatasetDetail(_0x2864b2),_0x2c551d=normalizeDatasetOperations(_0x2ee852['operations'])['find'](_0x3cadbe=>(_0x3cadbe[_0x311b48(0x1c8)]||_0x3cadbe[_0x311b48(0x183)])===_0x2e20b5);if(!_0x2c551d)throw CliErrors[_0x311b48(0x11e)](_0x311b48(0x1aa)+_0x2e20b5+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0xd99fbc);return{'dataset':{'id':_0x2ee852['id']??_0x2ee852[_0x311b48(0x1a9)],'name':_0x2ee852['name'],'code':_0x2ee852['code']||_0x2ee852[_0x311b48(0x17f)],'tableName':_0x2ee852[_0x311b48(0x12b)]||_0x2ee852[_0x311b48(0x1b1)]?.[_0x311b48(0x12b)]},'operation':_0x2c551d};}export async function startGenerateStandardPages(_0x10968e,_0x499b2c,_0x3f66b3){const _0x39fe5e=a208_0x958b7,_0x520093=await apiRequest('/smartapi/lovrabet/dataset/'+_0x499b2c+_0x39fe5e(0x199),{'method':_0x39fe5e(0x1fb),'body':{'appCode':_0x10968e,..._0x3f66b3?.[_0x39fe5e(0x13b)]?{'clientOperationId':_0x3f66b3['clientOperationId']}:{}},'timeout':DEFAULT_REQUEST_TIMEOUT_MS});return _0x520093[_0x39fe5e(0x178)];}export async function getGenerateStandardPagesStatus(_0x2c18be,_0x2e0f81,_0x260786){const _0x3d29ae=a208_0x958b7,_0x5ee61a=new URLSearchParams({'appCode':_0x2c18be});_0x260786[_0x3d29ae(0x157)]&&_0x5ee61a[_0x3d29ae(0x1e0)](_0x3d29ae(0x157),_0x260786[_0x3d29ae(0x157)]);_0x260786[_0x3d29ae(0x13b)]&&_0x5ee61a['set'](_0x3d29ae(0x13b),_0x260786[_0x3d29ae(0x13b)]);const _0x1e5fee=await apiRequest('/smartapi/lovrabet/dataset/'+_0x2e0f81+_0x3d29ae(0x1c0)+_0x5ee61a[_0x3d29ae(0x1b7)]());return _0x1e5fee[_0x3d29ae(0x178)];}export async function getStandardPageStatus(_0x26e10b,_0x16b340){const _0x49d8a1=a208_0x958b7,_0xa7b3a6=await apiRequest(_0x49d8a1(0x156)+_0x16b340+_0x49d8a1(0x20c)+encodeURIComponent(_0x26e10b));return _0xa7b3a6['data'];}export async function tryGetStandardPageStatus(_0x2b86ae,_0x5af417){const _0x43e999=a208_0x958b7;try{return await getStandardPageStatus(_0x2b86ae,_0x5af417);}catch(_0x1eec83){if(_0x1eec83 instanceof CliError&&_0x1eec83[_0x43e999(0x18e)]==='api_error'&&/404|not found|non-json response/i[_0x43e999(0x1f3)](_0x1eec83[_0x43e999(0x181)]))return null;throw _0x1eec83;}}export async function syncStandardPages(_0x3be5c0,_0x26cc91){const _0x1bb24d=a208_0x958b7,_0x227ae7=await apiRequest(_0x1bb24d(0x156)+_0x26cc91+_0x1bb24d(0x1c2),{'method':_0x1bb24d(0x1fb),'body':{'appCode':_0x3be5c0}});return _0x227ae7[_0x1bb24d(0x178)];}export async function getPageDetail(_0x5b92f1){const _0x7e11dc=a208_0x958b7,_0x3dce92=await apiRequest(_0x7e11dc(0x186)+_0x5b92f1);if(!_0x3dce92[_0x7e11dc(0x178)])throw CliErrors[_0x7e11dc(0x11e)](_0x7e11dc(0x169)+_0x5b92f1);return _0x3dce92['data'];}export async function listDeletedPages(_0x9b540d,_0x4386ed,_0x41ef97){const _0xc976f1=a208_0x958b7,_0x50f770=new URLSearchParams({'appCode':_0x9b540d,'type':_0x4386ed,'currentPage':String(_0x41ef97[_0xc976f1(0x19a)]),'pageSize':String(_0x41ef97[_0xc976f1(0x137)])}),_0x3e9570=await apiRequest(_0xc976f1(0x1ad)+_0x50f770[_0xc976f1(0x1b7)]());return _0x3e9570['data'];}export async function restoreStandardPage(_0x207ff7){const _0x40f97a=a208_0x958b7;await apiRequest(_0x40f97a(0x1e9),{'method':_0x40f97a(0x1fb),'body':{'id':_0x207ff7}});}export async function restoreJsxPage(_0x4023d6,_0x412f67){const _0x3d0125=a208_0x958b7,_0x431e06=await apiRequest(_0x3d0125(0x1f0),{'method':_0x3d0125(0x1fb),'body':{'appCode':_0x4023d6,'id':_0x412f67}});return _0x431e06[_0x3d0125(0x178)];}export async function updatePage(_0x2c4dce,_0x1632cd,_0x4e2c35,_0x4fdc08){const _0x212fa5=a208_0x958b7,_0x3e6645=await apiRequest(_0x212fa5(0x177),{'method':_0x212fa5(0x1fb),'body':{'appCode':_0x2c4dce,'pageId':_0x1632cd,'code':_0x4e2c35,'datasetIds':_0x4fdc08}});return _0x3e6645[_0x212fa5(0x178)];}export function generateSdkCode(_0x30b755,_0x4d0053,_0x21f6f1){const _0x26af7b=a208_0x958b7,_0x3cfe9d=_0x21f6f1?.[_0x26af7b(0x1eb)]??!![],_0x22742f=_0x26af7b(0x209)+_0x30b755[_0x26af7b(0x18e)]?.['replace'](/-/g,'_'),_0x26f539=_0x4d0053[_0x26af7b(0x1c8)]||_0x4d0053[_0x26af7b(0x183)]||_0x26af7b(0x1dd),_0x4f5d59=[];_0x3cfe9d&&_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x14b),'',_0x26af7b(0x13a),'');_0x4f5d59[_0x26af7b(0x1a4)]('//\x20'+_0x30b755[_0x26af7b(0x1c8)]+'\x20('+(_0x30b755[_0x26af7b(0x12b)]||_0x26af7b(0x155))+')');if(_0x26f539===_0x26af7b(0x1dd))_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x208),_0x26af7b(0x138),_0x26af7b(0x1b5),_0x26af7b(0x1d8),_0x26af7b(0x152));else{if(_0x26f539===_0x26af7b(0x129))_0x4f5d59[_0x26af7b(0x1a4)]('const\x20result\x20=\x20await\x20client.models.'+_0x22742f+_0x26af7b(0x202));else{if(_0x26f539===_0x26af7b(0x1a2))_0x4f5d59['push'](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x15e));else{if(_0x26f539==='update')_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x13d));else _0x26f539===_0x26af7b(0x207)||_0x26f539===_0x26af7b(0x175)?_0x4f5d59['push'](_0x26af7b(0x182)+_0x22742f+_0x26af7b(0x16d)):_0x4f5d59[_0x26af7b(0x1a4)](_0x26af7b(0x182)+_0x22742f+'.'+_0x26f539+'(/*\x20params\x20*/);');}}}return _0x4f5d59[_0x26af7b(0x20e)]('\x0a');}export function generateSqlCodeTemplate(_0x4d8748,_0x345003){const _0x2ae20d=a208_0x958b7,_0x1d27a8=_0x345003?.[_0x2ae20d(0x1e6)]??'sdk',_0x2e1807=_0x345003?.[_0x2ae20d(0x1eb)]??!![],_0x53a73a=[];return _0x53a73a[_0x2ae20d(0x1a4)](_0x2ae20d(0x215)+_0x4d8748[_0x2ae20d(0x1da)]+'\x20('+_0x4d8748[_0x2ae20d(0x1d5)]+')'),_0x1d27a8==='sdk'?(_0x2e1807&&_0x53a73a[_0x2ae20d(0x1a4)]('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});',''),_0x53a73a[_0x2ae20d(0x1a4)](_0x2ae20d(0x194),_0x2ae20d(0x11f)+_0x4d8748[_0x2ae20d(0x1d5)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x2ae20d(0x152),_0x2ae20d(0x1a3),_0x2ae20d(0x187))):_0x53a73a[_0x2ae20d(0x1a4)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly',_0x2ae20d(0x19b),_0x2ae20d(0x189),'\x20\x20\x20\x20sqlCode:\x20\x27'+_0x4d8748[_0x2ae20d(0x1d5)]+'\x27,',_0x2ae20d(0x12e),_0x2ae20d(0x151),_0x2ae20d(0x20d),'}'),_0x53a73a['join']('\x0a');}export async function getErConfig(_0x30b94b,_0xcd34d7){const _0x2142aa=a208_0x958b7,_0x50df28=await apiRequest('/smartapi/question/er-config',{'method':_0x2142aa(0x1fb),'body':{'appCode':_0x30b94b,'dblinkId':_0xcd34d7},'timeout':ER_CONFIG_REQUEST_TIMEOUT_MS});return _0x50df28[_0x2142aa(0x178)];}export async function getErRelationDetail(_0x5cfbed,_0x23acce){const _0x256f85=a208_0x958b7,_0x4eaa3f=new URLSearchParams({'appCode':_0x5cfbed,'relationId':String(_0x23acce)});try{const _0x405680=await apiRequest(_0x256f85(0x1a5)+_0x4eaa3f[_0x256f85(0x1b7)]());return _0x405680['data']?.[_0x256f85(0x1d4)]??null;}catch(_0x424653){if(_0x424653 instanceof CliError&&_0x424653[_0x256f85(0x18e)]===_0x256f85(0x159)&&(_0x424653['hint']?.[_0x256f85(0x1ed)]('DATA_NOT_EXIST')||_0x424653[_0x256f85(0x154)]===_0x256f85(0x1f5)&&_0x424653['message']===_0x256f85(0x1fd)))return null;throw _0x424653;}}export async function createErRelation(_0x5bb581){const _0x4c2092=a208_0x958b7,_0x56029a=await apiRequest(_0x4c2092(0x1f6),{'method':_0x4c2092(0x1fb),'body':_0x5bb581,'allowNonJsonSuccess':!![]});return _0x56029a[_0x4c2092(0x178)];}export async function updateErRelation(_0x4c20fe){const _0x5a82f2=a208_0x958b7,_0x515ec2=await apiRequest(_0x5a82f2(0x15d),{'method':_0x5a82f2(0x1fb),'body':_0x4c20fe,'allowNonJsonSuccess':!![]});return _0x515ec2['data'];}export async function deleteErRelation(_0x1fd7cf){const _0x1a65f5=a208_0x958b7,_0x2ed35b=await apiRequest(_0x1a65f5(0x147),{'method':_0x1a65f5(0x1fb),'body':_0x1fd7cf,'allowNonJsonSuccess':!![]});return _0x2ed35b['data'];}export async function updateErBusinessGroup(_0x48c891){const _0x16830e=a208_0x958b7,_0x52e5da=await apiRequest(_0x16830e(0x1ba),{'method':_0x16830e(0x1fb),'body':_0x48c891,'allowNonJsonSuccess':!![]});return _0x52e5da[_0x16830e(0x178)];}function buildQuery(_0x588cd1){const _0x458842=a208_0x958b7,_0x42a85b=new URLSearchParams();for(const [_0x2d4c7d,_0x42db6c]of Object['entries'](_0x588cd1)){if(_0x42db6c===undefined||_0x42db6c==='')continue;_0x42a85b[_0x458842(0x1e0)](_0x2d4c7d,String(_0x42db6c));}const _0x4e586b=_0x42a85b[_0x458842(0x1b7)]();return _0x4e586b?'?'+_0x4e586b:'';}export async function listNotificationChannelConfigs(_0x393848,_0x5b92f7){const _0x50a4f4=a208_0x958b7,_0x4b5e4f=await apiRequest('/notification/channel-config/list'+buildQuery({'appCode':_0x393848,'channelType':_0x5b92f7}));return Array['isArray'](_0x4b5e4f[_0x50a4f4(0x178)])?_0x4b5e4f[_0x50a4f4(0x178)]:[];}export async function listAppConfigs(_0x5ce1c3,_0x2c72b6){const _0x13a67c=a208_0x958b7,_0x381f0f=await apiRequest('/smartapi/app-config/list',{'method':_0x13a67c(0x1fb),'body':{'appCode':_0x5ce1c3,..._0x2c72b6?.['key']?{'key':_0x2c72b6[_0x13a67c(0x1b8)]}:{},..._0x2c72b6?.[_0x13a67c(0x144)]?{'tags':_0x2c72b6['tags']}:{}}});return extractAppConfigList(_0x381f0f[_0x13a67c(0x178)]);}export async function getAppConfigByKey(_0x11d845,_0x411383){const _0xa67780=a208_0x958b7,_0x1e4078=await apiRequest(_0xa67780(0x219)+buildQuery({'appCode':_0x11d845,'key':_0x411383}));return _0x1e4078[_0xa67780(0x178)]??null;}export async function createAppConfig(_0x4c631f){const _0x647cf7=a208_0x958b7,_0x3ee80a=await apiRequest(_0x647cf7(0x12d),{'method':_0x647cf7(0x1fb),'body':{'appCode':_0x4c631f['appCode'],'key':_0x4c631f[_0x647cf7(0x1b8)],'value':_0x4c631f[_0x647cf7(0x160)],..._0x4c631f[_0x647cf7(0x144)]?{'tags':_0x4c631f[_0x647cf7(0x144)]}:{}}});return _0x3ee80a[_0x647cf7(0x178)];}export async function updateAppConfig(_0x248f8f){const _0x4ab2f7=a208_0x958b7;await apiRequest(_0x4ab2f7(0x161),{'method':_0x4ab2f7(0x1fb),'body':{'id':_0x248f8f['id'],'appCode':_0x248f8f[_0x4ab2f7(0x1cc)],'key':_0x248f8f[_0x4ab2f7(0x1b8)],'value':_0x248f8f[_0x4ab2f7(0x160)],..._0x248f8f[_0x4ab2f7(0x144)]?{'tags':_0x248f8f[_0x4ab2f7(0x144)]}:{}}});}export async function deleteAppConfig(_0x16108c){const _0x3910ff=a208_0x958b7;await apiRequest(_0x3910ff(0x1db),{'method':_0x3910ff(0x1fb),'body':_0x16108c});}function extractAppConfigList(_0xd1f90c){const _0x236f59=a208_0x958b7;if(Array[_0x236f59(0x127)](_0xd1f90c))return _0xd1f90c;if(_0xd1f90c&&typeof _0xd1f90c===_0x236f59(0x1bb)&&Array[_0x236f59(0x127)](_0xd1f90c[_0x236f59(0x1a6)]))return _0xd1f90c[_0x236f59(0x1a6)];return extractList(_0xd1f90c);}export async function listDbLinks(_0x376230,_0x5221e6){const _0x3a6c07=a208_0x958b7,_0x5286e6=await apiRequest('/smartapi/dblink/getList',{'method':'POST','body':{'appCode':_0x376230,'currentPage':_0x5221e6?.[_0x3a6c07(0x19a)]??0x1,'pageSize':_0x5221e6?.[_0x3a6c07(0x137)]??0x64}});return{'items':extractList(_0x5286e6[_0x3a6c07(0x178)]),'paging':extractPaging(_0x5286e6['data'])};}export async function getDbLinkInfo(_0x181566){const _0x4448d4=a208_0x958b7,_0x58923d=await apiRequest(_0x4448d4(0x166)+buildQuery({'id':_0x181566}));return _0x58923d[_0x4448d4(0x178)];}export async function createDbLink(_0x5b5a7c){const _0x1ac06c=a208_0x958b7,_0x253a92=await apiRequest(_0x1ac06c(0x1c3),{'method':'POST','body':_0x5b5a7c});return _0x253a92[_0x1ac06c(0x178)];}export async function updateDbLink(_0xf10b9d){const _0x2b24fe=a208_0x958b7,_0x1e1425=await apiRequest(_0x2b24fe(0x146),{'method':_0x2b24fe(0x1fb),'body':_0xf10b9d});return _0x1e1425[_0x2b24fe(0x178)];}export async function deleteDbLink(_0x37d25f){const _0x1eb533=a208_0x958b7;await apiRequest(_0x1eb533(0x1d3),{'method':_0x1eb533(0x1fb),'body':{'id':_0x37d25f}});}function a208_0x25a2(){const _0x3e2e47=['/api/management/library/scripts/info?id=','BFF\x20script\x20not\x20found:\x20id=','configArray','modelCode','tableData','message','const\x20result\x20=\x20await\x20client.models.','operationName','startsWith','info','/smartapi/lovrabet/detail?pageId=','const\x20results\x20=\x20data.execResult\x20||\x20[];','772044LQtKel','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','array','\x20failed','/smartapi/permit/role/get-list','/smartapi/dblink/testConnect','code','label','Invalid\x20response\x20format\x20(','/smartapi/db-analysis/status/','errorCode','21791275PyqOPk','const\x20data\x20=\x20await\x20client.sql.execute({','?sqlCode=','/api/','/smartapi/menu/delete','/smartapi/dataset/text-generate/start','/generate-standard-pages/start','currentPage','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','Fetch\x20menu\x20list','warn','length','company','authRequired','scope','create','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','push','/smartapi/question/er-config/cli/detail?','list','Knowledge-base\x20update\x20requires\x20title\x20or\x20content.','displayName','modelId','Operation\x20\x22','/smartapi/custom/updateUserCustomSql','Use\x20platformFetch\x20only\x20for\x20legacy\x20absolute-URL\x20calls.','/smartapi/page/getDeletedPageList?','/smartapi/permit/user-role/update-user-list','errorMessage','dbId','dbtableConfig','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','scriptType','248cYQkXP','\x20\x20pageSize:\x2020,','Fetch\x20doc\x20(','toString','key','/smartapi/menu/regroup','/smartapi/question/er-config/business-group/edit','object','toLowerCase','status','/smartapi/app/getList','cookie','/generate-standard-pages/status?','/smartapi/permit/role/get-one','/sync-to-pages','/smartapi/dblink/create','cli:rabetbase','/admin/knowledge-base/delete','/filter','tableList','name','0000','/api/management/library/scripts/delete','API\x20error:\x20','appCode','/smartapi/dataset/delete-dataset','/smartapi/custom/deleteUserCustomSql','/smartapi/dblink/getAllTableList','signal','):\x20missing\x20data.markdown\x20field','8nOEKHN','/smartapi/dblink/delete','relation','sqlCode','\x20of\x20','number','\x20\x20currentPage:\x201,','userId','sqlName','/smartapi/app-config/delete','trim','filter','path','/api/management/library/scripts/save','set','/smartapi/permit/role/create','/smartapi/permit/role/update',':\x20invalid\x20JSON\x20response\x20envelope','SQL\x20query\x20not\x20found:\x20','/smartapi/custom/getUserCustomSql','target','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','email','/smartapi/page/restore','/smartapi/ocr/recognize-text?','includeImports',',\x20HTTP\x20','includes','summary','nickname','/smartapi/webcode/page/restore','body','longTerm','test','deleted','API\x20error\x20code:\x20306','/smartapi/question/er-config/cli/erCreate','personal','method','/smartapi/menu/create','正在从服务器拉取模型列表...\x20(环境:\x20','POST','5400647aPTvSQ','ER\x20relation\x20does\x20not\x20exist','/api/custom/executeSql','/smartapi/menu/batchDelete','API\x20error\x20code:\x20','mobile','.getOne(id);','Knowledge-base\x20response\x20is\x20missing\x20a\x20valid\x20','70epFhpk','has','SQL\x20query\x20not\x20found:\x20id=','delete','.filter({','dataset_','/smartapi/permit/page/get-one','/smartapi/permit/resource/get-menu-list','/standard-page-status?appCode=','\x20\x20return\x20rows;','join','find','success','responseFields','/smartapi/permit/user-role/get-user-list','avatar','/api/management/library/scripts/statistics?appCode=','//\x20SQL:\x20','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20','/api/management/library/scripts/list?appCode=','errorMsg','/smartapi/app-config/getByKey','Create\x20enterprise\x20knowledge\x20base','/smartapi/dataset/update-driven-data','roleType','Request\x20timeout:\x20','platform-error-code','min','needPublic','map','requirementDescription','entries','GET','401','/smartapi/menu/update','totalCount','Fetch\x20datasets','content','Knowledge-base\x20pageSize\x20must\x20be\x20an\x20integer\x20between\x201\x20and\x20','apiError','/smartapi/dataset/get-dataset-list','defineProperty','2259KKyZcf','Knowledge-base\x20response\x20contains\x20an\x20invalid\x20scope.','stringify','validation','\x20\x20sqlCode:\x20\x27','/admin/knowledge-base/update','description','\x20apps.\x20','pageIndex','/smartapi/permit/role/get-permit-list','11000PRMIgK','abort','isArray','/smartapi/db-analysis/start','getOne','isSafeInteger','tableName','NaN','/smartapi/app-config/create','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','username','188LMEIxC','physicalTableCount','datasetTableCount','/admin/knowledge-base/get-list','The\x20server\x20outcome\x20is\x20indeterminate.\x20Verify\x20current\x20state\x20before\x20retrying\x20any\x20mutation.','/smartapi/tasks/','/api/node-toolbox/dataset/model-list?','pageSize','\x20\x20where:\x20{},','/smartapi/common/uploadFile','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','clientOperationId','version','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','List\x20enterprise\x20knowledge\x20bases\x20returned\x20invalid\x20paging\x20metadata.','/userTenant/queryBelongsTenants','/smartapi/dataset/get-driven-data?','add','List\x20enterprise\x20knowledge\x20bases\x20returned\x20an\x20invalid\x20response\x20contract.','markdown','tags','\x20failed,\x20HTTP\x20','/smartapi/dblink/update','/smartapi/question/er-config/cli/delete-single','CUSTOM','updateTime','string','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','functionName','/smartapi/dataset/restore-dataset','AbortError','platform-transport-failure','json','\x20\x20});','});','/smartapi/permit/role/delete','hint','table','/smartapi/lovrabet/dataset/','operationId','isInteger','api_error','error','24740KOrxVv','userTenantRelationList','/smartapi/question/er-config/cli/update-single','.create({\x20/*\x20fields\x20*/\x20});','type','value','/smartapi/app-config/update','remark','datasetName','title','/smartapi/dataset/get-dataset-operation','/smartapi/dblink/getOne','permits','append','Page\x20not\x20found:\x20','url','3036222EvGJou','/userTenant/getByTenantCode','.remove(id);','enabled','ENABLE','/api/node-toolbox/sql/save','\x20returned\x20an\x20invalid\x20JSON\x20response\x20envelope\x20after\x20HTTP\x20success.','createTime','Check\x20network\x20connectivity\x20and\x20try\x20again.','/smartapi/permit/resource/get-api-list','remove','scriptName','/smartapi/lovrabet/update-page','data','download','/smartapi/permit/page/save','roleName'];a208_0x25a2=function(){return _0x3e2e47;};return a208_0x25a2();}export async function testDbLinkConnect(_0x3d6a33){const _0x835ffb=a208_0x958b7,_0x3fb3a3=await apiRequest(_0x835ffb(0x18d)+buildQuery({'id':_0x3d6a33}));return _0x3fb3a3[_0x835ffb(0x178)];}export async function startDbAnalysis(_0x5cc47d,_0x35841c){const _0x125510=a208_0x958b7,_0x121911=await apiRequest(_0x125510(0x128),{'method':_0x125510(0x1fb),'body':{'dbLinkId':_0x5cc47d,..._0x35841c&&_0x35841c[_0x125510(0x19e)]>0x0?{'tableNames':_0x35841c}:{}}});return _0x121911[_0x125510(0x178)];}export async function cancelDbAnalysis(_0x351aa3){const _0x1dcaa3=a208_0x958b7;await apiRequest('/smartapi/db-analysis/jobs/cancel'+buildQuery({'planId':_0x351aa3}),{'method':_0x1dcaa3(0x1fb)});}export async function getDbAnalysisStatus(_0x221188){const _0x107c46=a208_0x958b7,_0x333ee7=await apiRequest(_0x107c46(0x191)+encodeURIComponent(_0x221188));return _0x333ee7[_0x107c46(0x178)];}export async function getDbAllTableList(_0xc5bd1b,_0x11c6d1){const _0x251570=a208_0x958b7,_0x176e6f=await apiRequest(_0x251570(0x1cf)+buildQuery({'appCode':_0xc5bd1b,'dbLinkId':_0x11c6d1})),_0x4aee03=_0x176e6f[_0x251570(0x178)];if(Array[_0x251570(0x127)](_0x4aee03))return _0x4aee03;return extractList(_0x4aee03);}export async function getDbTableDiff(_0x504071,_0x202f3c,_0x50d27a){const _0x6cf133=a208_0x958b7,_0x1c80ff=await apiRequest('/smartapi/dblink/getTableDiffV2ByPage'+buildQuery({'appCode':_0x504071,'dbLinkId':_0x202f3c,'pageIndex':_0x50d27a?.[_0x6cf133(0x123)]??0x1,'pageSize':_0x50d27a?.['pageSize']??0x14,'tableName':_0x50d27a?.[_0x6cf133(0x12b)]})),_0x5abde4=_0x1c80ff[_0x6cf133(0x178)];return{'totalCount':_0x5abde4?.[_0x6cf133(0x227)]??0x0,'physicalTableCount':_0x5abde4?.[_0x6cf133(0x131)]??0x0,'datasetTableCount':_0x5abde4?.[_0x6cf133(0x132)]??0x0,..._0x5abde4?.[_0x6cf133(0x1ee)]?{'summary':_0x5abde4[_0x6cf133(0x1ee)]}:{},'tableList':Array[_0x6cf133(0x127)](_0x5abde4?.['tableList'])?_0x5abde4[_0x6cf133(0x1c7)]:[]};}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x403772=a208_0x958b7,_0x420935=await apiRequest(_0x403772(0x1be),{'method':_0x403772(0x1fb),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x3604ba=extractList(_0x420935[_0x403772(0x178)]),_0x1fabec=extractPaging(_0x420935[_0x403772(0x178)]);return _0x1fabec&&_0x1fabec[_0x403772(0x227)]>REMOTE_APP_PAGE_SIZE&&console[_0x403772(0x19d)]('Warning:\x20showing\x20first\x20'+REMOTE_APP_PAGE_SIZE+_0x403772(0x1d6)+_0x1fabec[_0x403772(0x227)]+_0x403772(0x122)+_0x403772(0x1b2)),_0x3604ba;}const APP_ROLE_PAGE_SIZE_MAX=0x64;export async function listAppRoles(_0xf58914,_0x589508){const _0x6b202b=a208_0x958b7,_0x13231e=Math[_0x6b202b(0x21f)](Math['max'](_0x589508?.[_0x6b202b(0x137)]??APP_ROLE_PAGE_SIZE_MAX,0x1),APP_ROLE_PAGE_SIZE_MAX),_0x3b5317=await apiRequest(_0x6b202b(0x18c),{'method':_0x6b202b(0x1fb),'body':{'appCode':_0xf58914,'currentPage':_0x589508?.['currentPage']??0x1,'pageSize':_0x13231e}});return{'items':extractList(_0x3b5317[_0x6b202b(0x178)]),'paging':extractPaging(_0x3b5317['data'])};}export async function getAppRole(_0x282a05){const _0x37eb75=a208_0x958b7,_0x471f74=await apiRequest(_0x37eb75(0x1c1)+buildQuery({'id':_0x282a05}));return _0x471f74[_0x37eb75(0x178)];}export async function createAppRole(_0x48ff80){const _0x8a459c=a208_0x958b7,_0x83329=await apiRequest(_0x8a459c(0x1e1),{'method':_0x8a459c(0x1fb),'body':{'appCode':_0x48ff80['appCode'],'roleName':_0x48ff80[_0x8a459c(0x17b)],'roleType':_0x8a459c(0x148),..._0x48ff80[_0x8a459c(0x162)]?{'remark':_0x48ff80[_0x8a459c(0x162)]}:{}}});return _0x83329[_0x8a459c(0x178)];}export async function updateAppRole(_0x86b530){const _0x588c2c=a208_0x958b7,_0x37e603=await apiRequest(_0x588c2c(0x1e2),{'method':'POST','body':{'id':_0x86b530['id'],'appCode':_0x86b530[_0x588c2c(0x1cc)],..._0x86b530[_0x588c2c(0x21c)]?{'roleType':_0x86b530[_0x588c2c(0x21c)]}:{},..._0x86b530[_0x588c2c(0x17b)]!==undefined?{'roleName':_0x86b530[_0x588c2c(0x17b)]}:{},..._0x86b530[_0x588c2c(0x162)]!==undefined?{'remark':_0x86b530['remark']}:{},..._0x86b530[_0x588c2c(0x167)]?{'permits':_0x86b530[_0x588c2c(0x167)]}:{}}});return _0x37e603[_0x588c2c(0x178)];}export async function deleteAppRole(_0x12dd0f){const _0x14c38d=a208_0x958b7;await apiRequest(_0x14c38d(0x153),{'method':_0x14c38d(0x1fb),'body':{'id':_0x12dd0f}});}export async function listPermitRoles(_0x54e7c1,_0x1dd79c){const _0x3f3ab4=a208_0x958b7,_0x485322=await apiRequest(_0x3f3ab4(0x124),{'method':_0x3f3ab4(0x1fb),'body':{'appCode':_0x54e7c1,..._0x1dd79c?.['needSelf']!==undefined?{'needSelf':_0x1dd79c['needSelf']}:{},..._0x1dd79c?.[_0x3f3ab4(0x220)]!==undefined?{'needPublic':_0x1dd79c['needPublic']}:{}}});return extractList(_0x485322['data']);}export async function getRoleMenuResources(_0x332a40,_0x31d4ea){const _0x590941=a208_0x958b7,_0x539da8=await apiRequest(_0x590941(0x20b),{'method':_0x590941(0x1fb),'body':{'appCode':_0x332a40,'roleId':_0x31d4ea}});return extractList(_0x539da8[_0x590941(0x178)]);}export async function getRoleApiResources(_0x4be0bb,_0x57df84){const _0x52a7c5=a208_0x958b7,_0x518964=await apiRequest(_0x52a7c5(0x174),{'method':_0x52a7c5(0x1fb),'body':{'appCode':_0x4be0bb,'roleId':_0x57df84}});return extractList(_0x518964[_0x52a7c5(0x178)]);}export async function listRoleUsers(_0x5ca4e8){const _0x48f039=a208_0x958b7,_0x37ec7a=await apiRequest(_0x48f039(0x212),{'method':_0x48f039(0x1fb),'body':{'appCode':_0x5ca4e8}});return extractList(_0x37ec7a[_0x48f039(0x178)])[_0x48f039(0x221)](({id:_0x5e7721,userList:_0x454954,applyUserList:_0x4b69b4,..._0x329fa0})=>({..._0x329fa0,'id':Number(_0x5e7721),'userList':_0x454954['map'](_0x5abcc3=>({..._0x5abcc3,'userId':Number(_0x5abcc3['userId'])})),..._0x4b69b4?{'applyUserList':_0x4b69b4[_0x48f039(0x221)](_0x47bc10=>({..._0x47bc10,'userId':Number(_0x47bc10['userId'])}))}:{}}));}export async function updateRoleUsers(_0x30b18b,_0x5248b1){const _0x5defb3=a208_0x958b7;await apiRequest(_0x5defb3(0x1ae),{'method':_0x5defb3(0x1fb),'body':{'appCode':_0x30b18b,'roleList':_0x5248b1}});}export async function getPagePermit(_0x3c81ae){const _0x375d6d=a208_0x958b7,_0x552ec6=await apiRequest(_0x375d6d(0x20a)+buildQuery({'menuId':_0x3c81ae}));return _0x552ec6[_0x375d6d(0x178)];}export async function savePagePermit(_0x5d5e5b){const _0x360a1b=a208_0x958b7,_0x1419c3=await apiRequest(_0x360a1b(0x17a),{'method':_0x360a1b(0x1fb),'body':_0x5d5e5b});return _0x1419c3[_0x360a1b(0x178)];}export async function listCurrentUserTenantMemberships(){const _0x25c8a3=a208_0x958b7,_0x571c68=await apiRequest(_0x25c8a3(0x13f));return extractList(_0x571c68[_0x25c8a3(0x178)]);}export async function listTenantDirectoryMembers(_0x45be65){const _0x53c6a7=a208_0x958b7,_0x1fe0d6=await apiRequest(_0x53c6a7(0x16c)+buildQuery({'code':_0x45be65})),_0x9d9581=_0x1fe0d6[_0x53c6a7(0x178)]?.[_0x53c6a7(0x15c)];return Array[_0x53c6a7(0x127)](_0x9d9581)?_0x9d9581:[];}export async function getTenantMembers(_0x114aa3){const _0x5481ca=a208_0x958b7,_0x2961c2=await listTenantDirectoryMembers(_0x114aa3);return _0x2961c2[_0x5481ca(0x1dd)](_0x217f43=>_0x217f43[_0x5481ca(0x1bd)]===_0x5481ca(0x16f)||_0x217f43[_0x5481ca(0x1bd)]===undefined)[_0x5481ca(0x221)](_0x1db587=>({'userId':Number(_0x1db587[_0x5481ca(0x1d9)]??_0x1db587['id']),'username':_0x1db587[_0x5481ca(0x12f)],'nickname':_0x1db587[_0x5481ca(0x1ef)],'status':_0x1db587[_0x5481ca(0x1bd)],'email':_0x1db587[_0x5481ca(0x1e8)],'mobile':_0x1db587[_0x5481ca(0x201)],'avatar':_0x1db587[_0x5481ca(0x213)]}))['filter'](_0x5552cb=>Number['isFinite'](_0x5552cb[_0x5481ca(0x1d9)])&&_0x5552cb[_0x5481ca(0x1d9)]>0x0);}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * BFF 同步体系 —— 项目配置
3
+ *
4
+ * 纯路径计算:接收已解析的 appCode,返回 scriptsRoot / lockFilePath 等派生路径。
5
+ * 不读取 .rabetbase.json —— 配置由框架管线提供。
6
+ */
7
+ import type { BffProjectConfig } from "../../core/bff/types.js";
8
+ export declare function loadBffProjectConfig(appCode: string, projectRoot?: string): BffProjectConfig;
@@ -1 +1 @@
1
- const a217_0xd24957=a217_0x2ab1;function a217_0x2dfc(){const _0x46b981=['21936rmYnDw','.rabetbase','50LeoIek','2923090ynLLoX','bff','/bff','3291747eVllQb','4qlpmIs','6429860Hdlciy','264DKsWGT','bff.lock.json','1589081vpNhWp','2297702OebDhs','1owTzve','1665624YbCgYB','4995JMSpeB','7DylESi','bff-trash'];a217_0x2dfc=function(){return _0x46b981;};return a217_0x2dfc();}(function(_0x17d5f0,_0x5af671){const _0x1f6d4b=a217_0x2ab1,_0x22f9ac=_0x17d5f0();while(!![]){try{const _0x3773e9=-parseInt(_0x1f6d4b(0x16c))/0x1*(-parseInt(_0x1f6d4b(0x162))/0x2)+parseInt(_0x1f6d4b(0x165))/0x3+-parseInt(_0x1f6d4b(0x166))/0x4*(parseInt(_0x1f6d4b(0x167))/0x5)+-parseInt(_0x1f6d4b(0x16d))/0x6*(parseInt(_0x1f6d4b(0x16f))/0x7)+-parseInt(_0x1f6d4b(0x171))/0x8*(-parseInt(_0x1f6d4b(0x16e))/0x9)+-parseInt(_0x1f6d4b(0x161))/0xa*(-parseInt(_0x1f6d4b(0x16b))/0xb)+-parseInt(_0x1f6d4b(0x168))/0xc*(parseInt(_0x1f6d4b(0x16a))/0xd);if(_0x3773e9===_0x5af671)break;else _0x22f9ac['push'](_0x22f9ac['shift']());}catch(_0x524b98){_0x22f9ac['push'](_0x22f9ac['shift']());}}}(a217_0x2dfc,0xd4f20));function a217_0x2ab1(_0xd2e215,_0xf2355c){_0xd2e215=_0xd2e215-0x160;const _0x2dfcdf=a217_0x2dfc();let _0x2ab126=_0x2dfcdf[_0xd2e215];return _0x2ab126;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a217_0xd24957(0x160),LOCK_FILE_NAME=a217_0xd24957(0x169),TRASH_DIR_NAME=a217_0xd24957(0x170);export function loadBffProjectConfig(_0x43dd03,_0x789477){const _0x1bf064=a217_0xd24957,_0x3178c2=resolve(_0x789477??findProjectRootDirectory()),_0x32170b=DOT_DIR+_0x1bf064(0x164),_0x1d78ae=_0x32170b+'/'+_0x43dd03;return{'projectRoot':_0x3178c2,'appCode':_0x43dd03,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x32170b,'scriptsRoot':_0x1d78ae,'scriptsRootDir':resolve(_0x3178c2,DOT_DIR,_0x1bf064(0x163),_0x43dd03),'lockFilePath':resolve(_0x3178c2,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3178c2,DOT_DIR,TRASH_DIR_NAME)};}
1
+ function a209_0xd8f0(){const _0xa57a15=['9560ANzDSp','105189PJQIIS','1564940uMrvit','.rabetbase','2109348mGFmTg','10ujyfuk','70iztUgf','2593134dyVjZw','bff.lock.json','/bff','153WqtiLa','bff-trash','18120AGKCdh','115464ZDiSID','2112bwnRdJ'];a209_0xd8f0=function(){return _0xa57a15;};return a209_0xd8f0();}const a209_0x31c107=a209_0x2d69;(function(_0x1ae854,_0x1ef794){const _0x202f8e=a209_0x2d69,_0x2554d9=_0x1ae854();while(!![]){try{const _0x497e08=-parseInt(_0x202f8e(0x78))/0x1*(-parseInt(_0x202f8e(0x7c))/0x2)+-parseInt(_0x202f8e(0x81))/0x3*(parseInt(_0x202f8e(0x83))/0x4)+parseInt(_0x202f8e(0x79))/0x5+-parseInt(_0x202f8e(0x7e))/0x6+parseInt(_0x202f8e(0x7d))/0x7*(parseInt(_0x202f8e(0x84))/0x8)+-parseInt(_0x202f8e(0x7b))/0x9+parseInt(_0x202f8e(0x86))/0xa*(parseInt(_0x202f8e(0x85))/0xb);if(_0x497e08===_0x1ef794)break;else _0x2554d9['push'](_0x2554d9['shift']());}catch(_0x272b0e){_0x2554d9['push'](_0x2554d9['shift']());}}}(a209_0xd8f0,0x41ba8));function a209_0x2d69(_0x24fc95,_0x39ebb6){_0x24fc95=_0x24fc95-0x78;const _0xd8f0ba=a209_0xd8f0();let _0x2d6917=_0xd8f0ba[_0x24fc95];return _0x2d6917;}import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a209_0x31c107(0x7a),LOCK_FILE_NAME=a209_0x31c107(0x7f),TRASH_DIR_NAME=a209_0x31c107(0x82);export function loadBffProjectConfig(_0x17a0c4,_0x5cc384){const _0x165c1e=a209_0x31c107,_0x172fd9=resolve(_0x5cc384??findProjectRootDirectory()),_0x31a845=DOT_DIR+_0x165c1e(0x80),_0x4eb5f7=_0x31a845+'/'+_0x17a0c4;return{'projectRoot':_0x172fd9,'appCode':_0x17a0c4,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x31a845,'scriptsRoot':_0x4eb5f7,'scriptsRootDir':resolve(_0x172fd9,DOT_DIR,'bff',_0x17a0c4),'lockFilePath':resolve(_0x172fd9,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x172fd9,DOT_DIR,TRASH_DIR_NAME)};}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * BFF 同步体系 —— 本地文件扫描与路径解析
3
+ *
4
+ * 负责:
5
+ * - 扫描 COMMON / ENDPOINT / HOOK 目录下的 .js 脚本文件
6
+ * - 根据远端脚本信息 + HOOK 统计解析本地落盘目标
7
+ * - lockKey ↔ filePath 双向映射
8
+ */
9
+ import type { BffLockEntry, BffProjectConfig, BffScriptType, HookLocation, LocalBffFunction, RemoteBffScript, ResolvedRemoteScriptTarget, ScriptStatistics } from "../../core/bff/types.js";
10
+ export declare const SUPPORTED_BFF_TYPES: BffScriptType[];
11
+ export declare function normalizeBffType(rawType?: string): BffScriptType | undefined;
12
+ export declare function scanLocalBffFunctions(config: BffProjectConfig, filterType?: BffScriptType): Promise<LocalBffFunction[]>;
13
+ export declare function resolveLocalFilePathFromLockKey(config: BffProjectConfig, lockKey: string): string;
14
+ /**
15
+ * Build a map from remote script ID to its HOOK location using statistics data.
16
+ */
17
+ export declare function createHookLocationMap(statistics: ScriptStatistics[]): Map<number, HookLocation>;
18
+ /**
19
+ * Resolve a remote script to its local file target (lockKey + filePath).
20
+ * HOOK scripts use alias (from api.ts) for local directory naming.
21
+ * Returns null if the script type is unknown or a HOOK location cannot be determined.
22
+ *
23
+ * @param datasetCodeToAlias - Map from datasetCode → alias (from alias-resolver)
24
+ */
25
+ export declare function resolveRemoteScriptTarget(config: BffProjectConfig, script: RemoteBffScript, hookLocationMap: Map<number, HookLocation>, lockFunctions: Record<string, BffLockEntry>, datasetCodeToAlias: Map<string, string>): ResolvedRemoteScriptTarget | null;
26
+ export declare function ensureParentDirectory(filePath: string): Promise<void>;
27
+ export declare function fileExists(filePath: string): Promise<boolean>;
28
+ export declare function directoryExists(dirPath: string): Promise<boolean>;
@@ -1 +1 @@
1
- const a218_0x44494d=a218_0xe969;(function(_0x57e83d,_0x4f5486){const _0x356f87=a218_0xe969,_0x340212=_0x57e83d();while(!![]){try{const _0xcbda3=parseInt(_0x356f87(0xdb))/0x1+-parseInt(_0x356f87(0xe9))/0x2+-parseInt(_0x356f87(0xca))/0x3*(-parseInt(_0x356f87(0xc7))/0x4)+-parseInt(_0x356f87(0xda))/0x5+-parseInt(_0x356f87(0xc8))/0x6*(-parseInt(_0x356f87(0xc6))/0x7)+-parseInt(_0x356f87(0xe3))/0x8+parseInt(_0x356f87(0xe4))/0x9*(parseInt(_0x356f87(0xcc))/0xa);if(_0xcbda3===_0x4f5486)break;else _0x340212['push'](_0x340212['shift']());}catch(_0xc14488){_0x340212['push'](_0x340212['shift']());}}}(a218_0x1fe5,0xd2da9));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a218_0x44494d(0xe8),'ENDPOINT',a218_0x44494d(0xcd)];export function normalizeBffType(_0x41932f){const _0xb1804=a218_0x44494d;if(!_0x41932f)return undefined;const _0x4a66d3=_0x41932f[_0xb1804(0xd1)]()[_0xb1804(0xde)]();return SUPPORTED_BFF_TYPES['includes'](_0x4a66d3)?_0x4a66d3:undefined;}async function scanJsFilesRecursively(_0x5e7768,_0x3874bc){const _0x390b10=a218_0x44494d,_0x3f5859=[];try{const _0x3e90dd=await readdir(_0x5e7768,{'withFileTypes':!![]});for(const _0x55da02 of _0x3e90dd){const _0x27ee36=join(_0x5e7768,_0x55da02[_0x390b10(0xe0)]);if(_0x55da02[_0x390b10(0xe2)]())_0x3f5859[_0x390b10(0xd9)](...await scanJsFilesRecursively(_0x27ee36,_0x3874bc+'/'+_0x55da02[_0x390b10(0xe0)]));else _0x55da02['isFile']()&&_0x55da02[_0x390b10(0xe0)][_0x390b10(0xc9)](_0x390b10(0xd7))&&_0x3f5859[_0x390b10(0xd9)]({'lockKey':_0x3874bc+'/'+_0x55da02[_0x390b10(0xe0)][_0x390b10(0xdf)](/\.js$/,''),'filePath':_0x27ee36});}}catch(_0x1128a2){if(_0x1128a2[_0x390b10(0xea)]!=='ENOENT')throw _0x1128a2;}return _0x3f5859;}async function scanFlatFunctions(_0x22b74c,_0x1c71e2){const _0x4810f7=a218_0x44494d,_0x5e77bd=join(_0x22b74c['scriptsRootDir'],_0x1c71e2),_0x51e61c=await scanJsFilesRecursively(_0x5e77bd,_0x1c71e2);return _0x51e61c[_0x4810f7(0xdc)](({lockKey:_0x484206,filePath:_0x588fe7})=>({'type':_0x1c71e2,'name':_0x484206[_0x4810f7(0xd5)]('/')['at'](-0x1)??'','filePath':_0x588fe7,'lockKey':_0x484206}));}async function scanHookFunctions(_0x1e1fe1){const _0x263f14=a218_0x44494d,_0x389646=join(_0x1e1fe1[_0x263f14(0xd0)],_0x263f14(0xcd)),_0x1c66e3=[];try{const _0x19582b=await readdir(_0x389646,{'withFileTypes':!![]});for(const _0x408bd0 of _0x19582b){if(!_0x408bd0[_0x263f14(0xe2)]())continue;const _0x5426c7=_0x408bd0[_0x263f14(0xe0)],_0x37faf9=join(_0x389646,_0x5426c7),_0x266e03=await readdir(_0x37faf9,{'withFileTypes':!![]});for(const _0x4d365b of _0x266e03){if(!_0x4d365b[_0x263f14(0xe2)]())continue;const _0x57b265=_0x4d365b[_0x263f14(0xe0)],_0x2991b1=join(_0x37faf9,_0x57b265),_0x28341d=await readdir(_0x2991b1,{'withFileTypes':!![]});for(const _0x1f2e17 of _0x28341d){if(!_0x1f2e17[_0x263f14(0xe2)]())continue;const _0x50902c=_0x1f2e17['name'],_0x27488b=join(_0x2991b1,_0x50902c),_0x32d0a8=await readdir(_0x27488b,{'withFileTypes':!![]});for(const _0x12929b of _0x32d0a8){if(!_0x12929b[_0x263f14(0xd2)]()||!_0x12929b[_0x263f14(0xe0)]['endsWith']('.js'))continue;const _0x4009df=_0x12929b['name'][_0x263f14(0xdf)](/\.js$/,'');_0x1c66e3[_0x263f14(0xd9)]({'type':_0x263f14(0xcd),'name':_0x4009df,'filePath':join(_0x27488b,_0x12929b[_0x263f14(0xe0)]),'lockKey':_0x263f14(0xd4)+_0x5426c7+'/'+_0x57b265+'/'+_0x50902c+'/'+_0x4009df,'alias':_0x5426c7,'operationType':_0x57b265,'functionNode':_0x50902c});}}}}}catch(_0x1295a0){if(_0x1295a0[_0x263f14(0xea)]!=='ENOENT')throw _0x1295a0;}return _0x1c66e3;}export async function scanLocalBffFunctions(_0x516550,_0x2bcf53){const _0x12cfdb=a218_0x44494d;if(_0x2bcf53==='COMMON'||_0x2bcf53===_0x12cfdb(0xce))return scanFlatFunctions(_0x516550,_0x2bcf53);if(_0x2bcf53===_0x12cfdb(0xcd))return scanHookFunctions(_0x516550);const [_0x321aa3,_0x11f697,_0x3837d8]=await Promise['all']([scanFlatFunctions(_0x516550,_0x12cfdb(0xe8)),scanFlatFunctions(_0x516550,'ENDPOINT'),scanHookFunctions(_0x516550)]);return[..._0x321aa3,..._0x11f697,..._0x3837d8];}function a218_0x1fe5(){const _0x359ea6=['4991215wiIPFH','1200277crPQxH','map','after','toUpperCase','replace','name','datasetCode','isDirectory','10358704sAxwCX','24858FTHRNL','operationType','before','functionName','COMMON','1577352skcELp','code','36631jPQtsL','11652rsrHGb','150UbHWUJ','endsWith','468nomMOb','functionNode','7820seAJsZ','HOOK','ENDPOINT','scriptType','scriptsRootDir','trim','isFile','F_OK','HOOK/','split','afterScriptId','.js','beforeScriptId','push'];a218_0x1fe5=function(){return _0x359ea6;};return a218_0x1fe5();}export function resolveLocalFilePathFromLockKey(_0x4db779,_0x3071d6){const _0x64ac82=a218_0x44494d;return join(_0x4db779['scriptsRootDir'],..._0x3071d6[_0x64ac82(0xd5)]('/'))+_0x64ac82(0xd7);}function a218_0xe969(_0xc5c451,_0x2d9802){_0xc5c451=_0xc5c451-0xc6;const _0x1fe55a=a218_0x1fe5();let _0xe96958=_0x1fe55a[_0xc5c451];return _0xe96958;}export function createHookLocationMap(_0x331b4b){const _0x4570b7=a218_0x44494d,_0x4a0ce6=new Map();for(const _0x5b78d8 of _0x331b4b){_0x5b78d8[_0x4570b7(0xd8)]&&_0x4a0ce6['set'](_0x5b78d8[_0x4570b7(0xd8)],{'datasetCode':_0x5b78d8[_0x4570b7(0xe1)],'operationType':snakeToCamel(_0x5b78d8[_0x4570b7(0xe5)]),'functionNode':_0x4570b7(0xe6)}),_0x5b78d8[_0x4570b7(0xd6)]&&_0x4a0ce6['set'](_0x5b78d8[_0x4570b7(0xd6)],{'datasetCode':_0x5b78d8[_0x4570b7(0xe1)],'operationType':snakeToCamel(_0x5b78d8[_0x4570b7(0xe5)]),'functionNode':_0x4570b7(0xdd)});}return _0x4a0ce6;}export function resolveRemoteScriptTarget(_0x289a21,_0x1055fb,_0x3597c1,_0x34f27c,_0x369554){const _0x4f8d63=a218_0x44494d,_0x46f7c2=normalizeBffType(_0x1055fb[_0x4f8d63(0xcf)]);if(!_0x46f7c2||!_0x1055fb[_0x4f8d63(0xe7)])return null;if(_0x46f7c2==='HOOK'){const _0x176495=(_0x1055fb['id']?_0x3597c1['get'](_0x1055fb['id']):undefined)??findHookLocationByRemoteId(_0x34f27c,_0x1055fb['id']);if(!_0x176495)return null;const _0x3c7031=_0x176495['alias']||_0x369554['get'](_0x176495[_0x4f8d63(0xe1)]),_0x1af8a2=_0x3c7031??_0x176495[_0x4f8d63(0xe1)],_0x1d9e03={..._0x176495,'alias':_0x3c7031},_0x2fc87c=_0x4f8d63(0xd4)+_0x1af8a2+'/'+_0x1d9e03[_0x4f8d63(0xe5)]+'/'+_0x1d9e03[_0x4f8d63(0xcb)]+'/'+_0x1055fb[_0x4f8d63(0xe7)];return{'lockKey':_0x2fc87c,'filePath':resolveLocalFilePathFromLockKey(_0x289a21,_0x2fc87c),'type':_0x4f8d63(0xcd),'hookLocation':_0x1d9e03};}const _0x4c6b48=_0x46f7c2+'/'+_0x1055fb['functionName'];return{'lockKey':_0x4c6b48,'filePath':resolveLocalFilePathFromLockKey(_0x289a21,_0x4c6b48),'type':_0x46f7c2};}export async function ensureParentDirectory(_0xa09c8a){await mkdir(dirname(_0xa09c8a),{'recursive':!![]});}export async function fileExists(_0x55c210){const _0x226cd8=a218_0x44494d;try{return await access(_0x55c210,constants[_0x226cd8(0xd3)]),!![];}catch{return![];}}export async function directoryExists(_0x3e8f45){const _0x139708=a218_0x44494d;try{const _0x18510a=await stat(_0x3e8f45);return _0x18510a[_0x139708(0xe2)]();}catch{return![];}}
1
+ const a210_0x254d23=a210_0x1661;(function(_0x3b667b,_0x51c2fa){const _0x5d0b10=a210_0x1661,_0x25df60=_0x3b667b();while(!![]){try{const _0x26b235=parseInt(_0x5d0b10(0xcf))/0x1+parseInt(_0x5d0b10(0xc4))/0x2*(-parseInt(_0x5d0b10(0xce))/0x3)+parseInt(_0x5d0b10(0xd1))/0x4+-parseInt(_0x5d0b10(0xbd))/0x5*(-parseInt(_0x5d0b10(0xb5))/0x6)+-parseInt(_0x5d0b10(0xb8))/0x7+parseInt(_0x5d0b10(0xbc))/0x8+parseInt(_0x5d0b10(0xbf))/0x9*(parseInt(_0x5d0b10(0xb3))/0xa);if(_0x26b235===_0x51c2fa)break;else _0x25df60['push'](_0x25df60['shift']());}catch(_0x1d0e7d){_0x25df60['push'](_0x25df60['shift']());}}}(a210_0x39d9,0xca9e0));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'../../core/bff/utils.js';export const SUPPORTED_BFF_TYPES=[a210_0x254d23(0xd7),a210_0x254d23(0xb9),a210_0x254d23(0xbb)];export function normalizeBffType(_0x17ea5c){const _0x13d006=a210_0x254d23;if(!_0x17ea5c)return undefined;const _0x5d560f=_0x17ea5c[_0x13d006(0xbe)]()['toUpperCase']();return SUPPORTED_BFF_TYPES[_0x13d006(0xb6)](_0x5d560f)?_0x5d560f:undefined;}async function scanJsFilesRecursively(_0x1f9313,_0xb23977){const _0x3ca9b5=a210_0x254d23,_0x11474f=[];try{const _0x403729=await readdir(_0x1f9313,{'withFileTypes':!![]});for(const _0x1f2db1 of _0x403729){const _0x58d481=join(_0x1f9313,_0x1f2db1['name']);if(_0x1f2db1['isDirectory']())_0x11474f[_0x3ca9b5(0xc1)](...await scanJsFilesRecursively(_0x58d481,_0xb23977+'/'+_0x1f2db1['name']));else _0x1f2db1[_0x3ca9b5(0xc9)]()&&_0x1f2db1[_0x3ca9b5(0xd2)][_0x3ca9b5(0xcd)]('.js')&&_0x11474f[_0x3ca9b5(0xc1)]({'lockKey':_0xb23977+'/'+_0x1f2db1[_0x3ca9b5(0xd2)][_0x3ca9b5(0xd4)](/\.js$/,''),'filePath':_0x58d481});}}catch(_0x3557f7){if(_0x3557f7[_0x3ca9b5(0xba)]!==_0x3ca9b5(0xc0))throw _0x3557f7;}return _0x11474f;}async function scanFlatFunctions(_0x4bd53e,_0x32ddf6){const _0x10b729=a210_0x254d23,_0x2c22e7=join(_0x4bd53e['scriptsRootDir'],_0x32ddf6),_0x1452e7=await scanJsFilesRecursively(_0x2c22e7,_0x32ddf6);return _0x1452e7[_0x10b729(0xc5)](({lockKey:_0x907872,filePath:_0x94d739})=>({'type':_0x32ddf6,'name':_0x907872[_0x10b729(0xc6)]('/')['at'](-0x1)??'','filePath':_0x94d739,'lockKey':_0x907872}));}function a210_0x39d9(){const _0x18d0ff=['afterScriptId','2760793QLORIt','ENDPOINT','code','HOOK','1433224qeFUnF','20110pDhODp','trim','908478qBObRf','ENOENT','push','get','datasetCode','2539700WBKXvG','map','split','isDirectory','all','isFile','.js','functionNode','alias','endsWith','3zDyfhc','1070848NOIijl','operationType','847168BTJfTp','name','scriptsRootDir','replace','beforeScriptId','functionName','COMMON','set','70lLwFYs','HOOK/','486bOhYqn','includes'];a210_0x39d9=function(){return _0x18d0ff;};return a210_0x39d9();}async function scanHookFunctions(_0x3bca68){const _0x26d8d9=a210_0x254d23,_0x1ce4dd=join(_0x3bca68[_0x26d8d9(0xd3)],_0x26d8d9(0xbb)),_0x5e8a64=[];try{const _0x30a906=await readdir(_0x1ce4dd,{'withFileTypes':!![]});for(const _0x534eb7 of _0x30a906){if(!_0x534eb7[_0x26d8d9(0xc7)]())continue;const _0x3a3aab=_0x534eb7[_0x26d8d9(0xd2)],_0x54be0=join(_0x1ce4dd,_0x3a3aab),_0x145229=await readdir(_0x54be0,{'withFileTypes':!![]});for(const _0x1fabd8 of _0x145229){if(!_0x1fabd8[_0x26d8d9(0xc7)]())continue;const _0x497425=_0x1fabd8['name'],_0x3c6354=join(_0x54be0,_0x497425),_0xffe0=await readdir(_0x3c6354,{'withFileTypes':!![]});for(const _0x1cf82c of _0xffe0){if(!_0x1cf82c['isDirectory']())continue;const _0xd10129=_0x1cf82c[_0x26d8d9(0xd2)],_0x1b24a4=join(_0x3c6354,_0xd10129),_0x507106=await readdir(_0x1b24a4,{'withFileTypes':!![]});for(const _0x226e03 of _0x507106){if(!_0x226e03['isFile']()||!_0x226e03[_0x26d8d9(0xd2)][_0x26d8d9(0xcd)](_0x26d8d9(0xca)))continue;const _0x49d772=_0x226e03[_0x26d8d9(0xd2)]['replace'](/\.js$/,'');_0x5e8a64['push']({'type':_0x26d8d9(0xbb),'name':_0x49d772,'filePath':join(_0x1b24a4,_0x226e03[_0x26d8d9(0xd2)]),'lockKey':_0x26d8d9(0xb4)+_0x3a3aab+'/'+_0x497425+'/'+_0xd10129+'/'+_0x49d772,'alias':_0x3a3aab,'operationType':_0x497425,'functionNode':_0xd10129});}}}}}catch(_0x35bad7){if(_0x35bad7[_0x26d8d9(0xba)]!==_0x26d8d9(0xc0))throw _0x35bad7;}return _0x5e8a64;}export async function scanLocalBffFunctions(_0x427937,_0x3dcf02){const _0x2ce45c=a210_0x254d23;if(_0x3dcf02==='COMMON'||_0x3dcf02===_0x2ce45c(0xb9))return scanFlatFunctions(_0x427937,_0x3dcf02);if(_0x3dcf02===_0x2ce45c(0xbb))return scanHookFunctions(_0x427937);const [_0x741ce,_0x4fdf29,_0x472b43]=await Promise[_0x2ce45c(0xc8)]([scanFlatFunctions(_0x427937,_0x2ce45c(0xd7)),scanFlatFunctions(_0x427937,_0x2ce45c(0xb9)),scanHookFunctions(_0x427937)]);return[..._0x741ce,..._0x4fdf29,..._0x472b43];}export function resolveLocalFilePathFromLockKey(_0x5b4ff0,_0x4638df){const _0x395919=a210_0x254d23;return join(_0x5b4ff0[_0x395919(0xd3)],..._0x4638df[_0x395919(0xc6)]('/'))+'.js';}export function createHookLocationMap(_0x1faf56){const _0x1caa70=a210_0x254d23,_0x53b391=new Map();for(const _0x7e170e of _0x1faf56){_0x7e170e[_0x1caa70(0xd5)]&&_0x53b391[_0x1caa70(0xb2)](_0x7e170e['beforeScriptId'],{'datasetCode':_0x7e170e['datasetCode'],'operationType':snakeToCamel(_0x7e170e[_0x1caa70(0xd0)]),'functionNode':'before'}),_0x7e170e['afterScriptId']&&_0x53b391[_0x1caa70(0xb2)](_0x7e170e[_0x1caa70(0xb7)],{'datasetCode':_0x7e170e[_0x1caa70(0xc3)],'operationType':snakeToCamel(_0x7e170e[_0x1caa70(0xd0)]),'functionNode':'after'});}return _0x53b391;}export function resolveRemoteScriptTarget(_0x11ab41,_0x191b9b,_0x33cb21,_0x468956,_0x5b90fc){const _0x3baa48=a210_0x254d23,_0x3934ef=normalizeBffType(_0x191b9b['scriptType']);if(!_0x3934ef||!_0x191b9b['functionName'])return null;if(_0x3934ef===_0x3baa48(0xbb)){const _0x3ecfa0=(_0x191b9b['id']?_0x33cb21[_0x3baa48(0xc2)](_0x191b9b['id']):undefined)??findHookLocationByRemoteId(_0x468956,_0x191b9b['id']);if(!_0x3ecfa0)return null;const _0x3bd1cf=_0x3ecfa0[_0x3baa48(0xcc)]||_0x5b90fc['get'](_0x3ecfa0[_0x3baa48(0xc3)]),_0x13b873=_0x3bd1cf??_0x3ecfa0[_0x3baa48(0xc3)],_0x18b9e6={..._0x3ecfa0,'alias':_0x3bd1cf},_0x15a8ac=_0x3baa48(0xb4)+_0x13b873+'/'+_0x18b9e6[_0x3baa48(0xd0)]+'/'+_0x18b9e6[_0x3baa48(0xcb)]+'/'+_0x191b9b[_0x3baa48(0xd6)];return{'lockKey':_0x15a8ac,'filePath':resolveLocalFilePathFromLockKey(_0x11ab41,_0x15a8ac),'type':_0x3baa48(0xbb),'hookLocation':_0x18b9e6};}const _0x4b749a=_0x3934ef+'/'+_0x191b9b[_0x3baa48(0xd6)];return{'lockKey':_0x4b749a,'filePath':resolveLocalFilePathFromLockKey(_0x11ab41,_0x4b749a),'type':_0x3934ef};}export async function ensureParentDirectory(_0x520da3){await mkdir(dirname(_0x520da3),{'recursive':!![]});}export async function fileExists(_0x3b98a3){try{return await access(_0x3b98a3,constants['F_OK']),!![];}catch{return![];}}function a210_0x1661(_0x258d32,_0x552046){_0x258d32=_0x258d32-0xb2;const _0x39d9d3=a210_0x39d9();let _0x166137=_0x39d9d3[_0x258d32];return _0x166137;}export async function directoryExists(_0x30f092){try{const _0x36cbe8=await stat(_0x30f092);return _0x36cbe8['isDirectory']();}catch{return![];}}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * BFF 同步体系 —— 内容哈希
3
+ *
4
+ * 基于 MD5 计算文件/文本内容的指纹,用于 push/pull 跳过未变更文件。
5
+ */
6
+ export declare function computeContentHash(content: string): string;
7
+ export declare function computeFileHash(filePath: string): Promise<string>;
@@ -1 +1 @@
1
- (function(_0x314720,_0x2322e1){const _0x3b840a=a219_0x4413,_0x55a7ed=_0x314720();while(!![]){try{const _0x1a243b=-parseInt(_0x3b840a(0x8a))/0x1+-parseInt(_0x3b840a(0x81))/0x2*(-parseInt(_0x3b840a(0x7e))/0x3)+parseInt(_0x3b840a(0x82))/0x4+parseInt(_0x3b840a(0x7f))/0x5+-parseInt(_0x3b840a(0x88))/0x6*(parseInt(_0x3b840a(0x89))/0x7)+-parseInt(_0x3b840a(0x83))/0x8*(-parseInt(_0x3b840a(0x84))/0x9)+-parseInt(_0x3b840a(0x87))/0xa;if(_0x1a243b===_0x2322e1)break;else _0x55a7ed['push'](_0x55a7ed['shift']());}catch(_0x112bca){_0x55a7ed['push'](_0x55a7ed['shift']());}}}(a219_0x5073,0x1bcd6));import{readFile}from'node:fs/promises';import a219_0x1ea394 from'node:crypto';export function computeContentHash(_0x3eb53e){const _0x36ec41=a219_0x4413;return a219_0x1ea394[_0x36ec41(0x86)]('md5')[_0x36ec41(0x85)](_0x3eb53e)['digest']('hex');}export async function computeFileHash(_0x888362){const _0x5857c8=a219_0x4413,_0x15e062=await readFile(_0x888362,_0x5857c8(0x80));return computeContentHash(_0x15e062);}function a219_0x4413(_0x2f71e6,_0x55cf59){_0x2f71e6=_0x2f71e6-0x7e;const _0x50739b=a219_0x5073();let _0x44139f=_0x50739b[_0x2f71e6];return _0x44139f;}function a219_0x5073(){const _0x537100=['utf8','2GGIBDX','744672hgMOcx','889736vxJvbh','9miBMxg','update','createHash','2358360OKYPxk','24RcXxfw','1295jSaAIH','225910rtZwom','578559rPHoZR','430630KaIoag'];a219_0x5073=function(){return _0x537100;};return a219_0x5073();}
1
+ (function(_0x23fcec,_0x22cdf0){const _0x4d6fd5=a211_0x5256,_0x5ac2d1=_0x23fcec();while(!![]){try{const _0x51369c=-parseInt(_0x4d6fd5(0xc7))/0x1+-parseInt(_0x4d6fd5(0xc2))/0x2+parseInt(_0x4d6fd5(0xc3))/0x3+parseInt(_0x4d6fd5(0xc5))/0x4+-parseInt(_0x4d6fd5(0xc0))/0x5*(-parseInt(_0x4d6fd5(0xbf))/0x6)+parseInt(_0x4d6fd5(0xbb))/0x7*(parseInt(_0x4d6fd5(0xc6))/0x8)+-parseInt(_0x4d6fd5(0xbd))/0x9;if(_0x51369c===_0x22cdf0)break;else _0x5ac2d1['push'](_0x5ac2d1['shift']());}catch(_0x15334b){_0x5ac2d1['push'](_0x5ac2d1['shift']());}}}(a211_0x55d5,0x63f75));function a211_0x5256(_0x50288b,_0x3cccf6){_0x50288b=_0x50288b-0xbb;const _0x55d53c=a211_0x55d5();let _0x52565a=_0x55d53c[_0x50288b];return _0x52565a;}import{readFile}from'node:fs/promises';import a211_0x3c721d from'node:crypto';export function computeContentHash(_0x4b2f94){const _0x3f1776=a211_0x5256;return a211_0x3c721d[_0x3f1776(0xc1)](_0x3f1776(0xbc))['update'](_0x4b2f94)[_0x3f1776(0xc8)](_0x3f1776(0xc4));}export async function computeFileHash(_0x40a7fe){const _0x577649=a211_0x5256,_0x617435=await readFile(_0x40a7fe,_0x577649(0xbe));return computeContentHash(_0x617435);}function a211_0x55d5(){const _0x4eb873=['140zRzyXQ','md5','13498866EbMBVS','utf8','12pvyfOf','1171195KQxtvc','createHash','21930fRTKcJ','2071926PGTsOX','hex','2732704fAPiOE','131816tXZayH','251536phdpSD','digest'];a211_0x55d5=function(){return _0x4eb873;};return a211_0x55d5();}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * BFF 同步体系 —— Lock 文件管理
3
+ *
4
+ * .rabetbase/bff.lock.json 记录每个 appCode 下脚本的 hash / remoteId / version,
5
+ * 用于 push/pull 的变更检测与冲突保护。
6
+ *
7
+ * 多 appCode 共享同一 lock 文件,各自拥有独立的 BffLockScope。
8
+ */
9
+ import type { BffLockFile, BffLockScope } from "../../core/bff/types.js";
10
+ /**
11
+ * Create an empty multi-app BFF lock file.
12
+ *
13
+ * @returns New lock object with no app scopes.
14
+ */
15
+ export declare function createEmptyBffLock(): BffLockFile;
16
+ /**
17
+ * Get (or create) the lock scope for the given appCode.
18
+ * Blocks execution if scriptsRoot has changed unexpectedly.
19
+ */
20
+ export declare function ensureLockScope(lockData: BffLockFile, currentAppCode: string, currentScriptsRoot: string, commandName: string): {
21
+ lockData: BffLockFile;
22
+ appLock: BffLockScope;
23
+ };
24
+ export declare function readBffLockFile(lockFilePath: string): Promise<BffLockFile | null>;
25
+ export declare function writeBffLockFile(lockFilePath: string, lockData: BffLockFile): Promise<void>;
@@ -1 +1 @@
1
- (function(_0x5949e0,_0x4cb3e8){const _0x132bb8=a220_0x6de9,_0x48839d=_0x5949e0();while(!![]){try{const _0x24d602=-parseInt(_0x132bb8(0x9b))/0x1*(-parseInt(_0x132bb8(0x9e))/0x2)+-parseInt(_0x132bb8(0x94))/0x3+-parseInt(_0x132bb8(0x98))/0x4+-parseInt(_0x132bb8(0x9f))/0x5*(-parseInt(_0x132bb8(0x92))/0x6)+-parseInt(_0x132bb8(0x90))/0x7*(-parseInt(_0x132bb8(0x96))/0x8)+-parseInt(_0x132bb8(0x95))/0x9*(-parseInt(_0x132bb8(0x8e))/0xa)+-parseInt(_0x132bb8(0x9c))/0xb;if(_0x24d602===_0x4cb3e8)break;else _0x48839d['push'](_0x48839d['shift']());}catch(_0x452450){_0x48839d['push'](_0x48839d['shift']());}}}(a220_0x45f3,0xd854b));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a220_0x6de9(_0x1d3330,_0x341a8f){_0x1d3330=_0x1d3330-0x8d;const _0x45f3ed=a220_0x45f3();let _0x6de92b=_0x45f3ed[_0x1d3330];return _0x6de92b;}function a220_0x45f3(){const _0x260d8b=['19687228qyjyiH','scriptsRoot','7934QgWPxL','674715WinOmf','code','\x22.\x20','lastSync','functions','apps','\x22\x20vs\x20lock\x20\x22','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','15014330FPYEga','parse','294301hHnXpX','object','66gTFEZQ','current\x20\x22','4703010LJquye','9mhLZFf','40ZYpJAw','utf8','2284192UwjgiT',':\x20scriptsRoot\x20mismatch\x20—\x20','stringify','408GzpVDM'];a220_0x45f3=function(){return _0x260d8b;};return a220_0x45f3();}export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x2d6d83,_0x3f45d6,_0x26440a,_0x6bd328){const _0x11a02e=a220_0x6de9,_0x496712={'apps':_0x2d6d83[_0x11a02e(0xa4)]&&typeof _0x2d6d83['apps']==='object'?_0x2d6d83['apps']:{}};let _0x2e8b90=_0x496712[_0x11a02e(0xa4)][_0x3f45d6];if(!_0x2e8b90)return _0x2e8b90={'scriptsRoot':_0x26440a,'lastSync':'','functions':{}},_0x496712[_0x11a02e(0xa4)][_0x3f45d6]=_0x2e8b90,{'lockData':_0x496712,'appLock':_0x2e8b90};if(!_0x2e8b90[_0x11a02e(0x9d)])_0x2e8b90[_0x11a02e(0x9d)]=_0x26440a;else{if(_0x2e8b90[_0x11a02e(0x9d)]!==_0x26440a)throw new Error(_0x6bd328+_0x11a02e(0x99)+(_0x11a02e(0x93)+_0x26440a+_0x11a02e(0xa5)+_0x2e8b90[_0x11a02e(0x9d)]+_0x11a02e(0xa1))+_0x11a02e(0x8d));}return!_0x2e8b90[_0x11a02e(0xa3)]&&(_0x2e8b90[_0x11a02e(0xa3)]={}),!_0x2e8b90[_0x11a02e(0xa2)]&&(_0x2e8b90[_0x11a02e(0xa2)]=''),{'lockData':_0x496712,'appLock':_0x2e8b90};}export async function readBffLockFile(_0x10ca27){const _0x39fb43=a220_0x6de9;try{const _0x2f520e=await readFile(_0x10ca27,_0x39fb43(0x97)),_0x5d8a2f=JSON[_0x39fb43(0x8f)](_0x2f520e);return{'apps':_0x5d8a2f['apps']&&typeof _0x5d8a2f[_0x39fb43(0xa4)]===_0x39fb43(0x91)?_0x5d8a2f[_0x39fb43(0xa4)]:{}};}catch(_0x945d20){if(_0x945d20[_0x39fb43(0xa0)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x945d20));}}export async function writeBffLockFile(_0x199776,_0x3387da){const _0x4e83a9=a220_0x6de9;await mkdir(dirname(_0x199776),{'recursive':!![]}),await writeFile(_0x199776,JSON[_0x4e83a9(0x9a)](_0x3387da,null,0x2),_0x4e83a9(0x97));}
1
+ (function(_0x1b32bc,_0x1a7701){const _0x3e5106=a212_0x3f08,_0x1a433e=_0x1b32bc();while(!![]){try{const _0xfd4b26=parseInt(_0x3e5106(0xab))/0x1+parseInt(_0x3e5106(0xbc))/0x2+-parseInt(_0x3e5106(0xa7))/0x3+parseInt(_0x3e5106(0xb3))/0x4*(parseInt(_0x3e5106(0xaf))/0x5)+-parseInt(_0x3e5106(0xa5))/0x6*(parseInt(_0x3e5106(0xb0))/0x7)+-parseInt(_0x3e5106(0xb8))/0x8*(parseInt(_0x3e5106(0xb7))/0x9)+parseInt(_0x3e5106(0xb4))/0xa*(parseInt(_0x3e5106(0xa9))/0xb);if(_0xfd4b26===_0x1a7701)break;else _0x1a433e['push'](_0x1a433e['shift']());}catch(_0x191210){_0x1a433e['push'](_0x1a433e['shift']());}}}(a212_0x12cb,0x983fd));import{mkdir,readFile,writeFile}from'node:fs/promises';function a212_0x3f08(_0x59cf42,_0x18364f){_0x59cf42=_0x59cf42-0xa5;const _0x12cb8c=a212_0x12cb();let _0x3f088c=_0x12cb8c[_0x59cf42];return _0x3f088c;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x55ca32,_0xb466a8,_0x3db4fd,_0x3ea215){const _0x5664fc=a212_0x3f08,_0x5e5b27={'apps':_0x55ca32[_0x5664fc(0xad)]&&typeof _0x55ca32[_0x5664fc(0xad)]==='object'?_0x55ca32['apps']:{}};let _0xf11485=_0x5e5b27[_0x5664fc(0xad)][_0xb466a8];if(!_0xf11485)return _0xf11485={'scriptsRoot':_0x3db4fd,'lastSync':'','functions':{}},_0x5e5b27[_0x5664fc(0xad)][_0xb466a8]=_0xf11485,{'lockData':_0x5e5b27,'appLock':_0xf11485};if(!_0xf11485[_0x5664fc(0xa8)])_0xf11485[_0x5664fc(0xa8)]=_0x3db4fd;else{if(_0xf11485[_0x5664fc(0xa8)]!==_0x3db4fd)throw new Error(_0x3ea215+_0x5664fc(0xa6)+('current\x20\x22'+_0x3db4fd+'\x22\x20vs\x20lock\x20\x22'+_0xf11485[_0x5664fc(0xa8)]+_0x5664fc(0xb2))+_0x5664fc(0xaa));}return!_0xf11485[_0x5664fc(0xbb)]&&(_0xf11485['functions']={}),!_0xf11485['lastSync']&&(_0xf11485[_0x5664fc(0xac)]=''),{'lockData':_0x5e5b27,'appLock':_0xf11485};}function a212_0x12cb(){const _0x4d7cf2=['\x22.\x20','129432mHxBGS','13612840uWGKEy','parse','object','1468233fbKBYX','16IdHgjT','ENOENT','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','functions','2333154AfCgmc','2186820pOpTsa',':\x20scriptsRoot\x20mismatch\x20—\x20','3613161WqDKAu','scriptsRoot','11xkBzpE','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','363885RyxAQr','lastSync','apps','stringify','55DAQeXx','21vadoUB','utf8'];a212_0x12cb=function(){return _0x4d7cf2;};return a212_0x12cb();}export async function readBffLockFile(_0x5a26bc){const _0x1349b9=a212_0x3f08;try{const _0x1efb61=await readFile(_0x5a26bc,_0x1349b9(0xb1)),_0x553d80=JSON[_0x1349b9(0xb5)](_0x1efb61);return{'apps':_0x553d80[_0x1349b9(0xad)]&&typeof _0x553d80['apps']===_0x1349b9(0xb6)?_0x553d80['apps']:{}};}catch(_0x217d32){if(_0x217d32['code']===_0x1349b9(0xb9))return null;throw new Error(_0x1349b9(0xba)+String(_0x217d32));}}export async function writeBffLockFile(_0x4bbc16,_0x462321){const _0x36e2f9=a212_0x3f08;await mkdir(dirname(_0x4bbc16),{'recursive':!![]}),await writeFile(_0x4bbc16,JSON[_0x36e2f9(0xae)](_0x462321,null,0x2),_0x36e2f9(0xb1));}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * BFF 同步体系 —— 类型定义
3
+ *
4
+ * 覆盖 lock 文件结构、本地函数描述、远端脚本模型、项目配置等。
5
+ * 仅类型,不含运行时逻辑。
6
+ */
7
+ export type BffScriptType = "COMMON" | "ENDPOINT" | "HOOK";
8
+ export interface HookLocation {
9
+ /** api.ts 中定义的别名,用于本地目录命名和 lockKey。从 statistics 构建时可能缺失,由命令层补充。 */
10
+ alias?: string;
11
+ /** 32 位数据集编码,用于 API 通信 */
12
+ datasetCode: string;
13
+ operationType: string;
14
+ functionNode: string;
15
+ }
16
+ export interface BffProjectConfig {
17
+ projectRoot: string;
18
+ appCode: string;
19
+ scriptsBaseDir: string;
20
+ scriptsWorkspaceRoot: string;
21
+ scriptsRoot: string;
22
+ scriptsRootDir: string;
23
+ lockFilePath: string;
24
+ trashDir: string;
25
+ }
26
+ export interface LocalBffFunction extends Partial<HookLocation> {
27
+ type: BffScriptType;
28
+ name: string;
29
+ filePath: string;
30
+ lockKey: string;
31
+ }
32
+ export interface BffLockEntry extends Partial<HookLocation> {
33
+ hash: string;
34
+ remoteId: number;
35
+ version?: number;
36
+ }
37
+ export interface BffLockScope {
38
+ scriptsRoot: string;
39
+ lastSync: string;
40
+ functions: Record<string, BffLockEntry>;
41
+ }
42
+ export interface BffLockFile {
43
+ apps: Record<string, BffLockScope>;
44
+ }
45
+ export interface ScriptStatistics {
46
+ datasetCode: string;
47
+ operationType: string;
48
+ beforeScriptId: number | null;
49
+ afterScriptId: number | null;
50
+ }
51
+ export interface DatasetInfo {
52
+ id: number;
53
+ name: string;
54
+ code: string;
55
+ }
56
+ export interface DatasetOperation {
57
+ operationType: string;
58
+ operationName: string;
59
+ }
60
+ export interface RemoteBffScript {
61
+ id?: number;
62
+ appCode: string;
63
+ functionName?: string;
64
+ functionNode?: string;
65
+ scriptType: string;
66
+ scriptContent?: string;
67
+ version?: number;
68
+ description?: string;
69
+ datasetId?: number | null;
70
+ operationType?: string | null;
71
+ }
72
+ export interface SaveBffScriptPayload {
73
+ id?: number;
74
+ appCode: string;
75
+ functionName: string;
76
+ functionNode?: string;
77
+ scriptType: string;
78
+ scriptContent: string;
79
+ version?: number;
80
+ description?: string;
81
+ datasetId?: number;
82
+ operationType?: string;
83
+ }
84
+ export interface ResolvedRemoteScriptTarget {
85
+ lockKey: string;
86
+ filePath: string;
87
+ type: BffScriptType;
88
+ hookLocation?: HookLocation;
89
+ }
90
+ export interface HookCreationOptions extends HookLocation {
91
+ datasetId: number;
92
+ }