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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/README.md +42 -17
  2. package/lib/api/api-doc.js +3 -1
  3. package/lib/api/api-group.js +3 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +8 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +2 -1
  8. package/lib/api/model-registry-file.js +11 -1
  9. package/lib/api/model-registry-scaffold.js +2 -1
  10. package/lib/api/model-source.js +3 -1
  11. package/lib/auth/auth-server-ui.js +2 -1
  12. package/lib/auth/auth-server.js +5 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +3 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +5 -1
  21. package/lib/commands/api/generate.js +4 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +2 -1
  24. package/lib/commands/api/pull.js +10 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +5 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +4 -1
  32. package/lib/commands/app-config/delete.js +2 -1
  33. package/lib/commands/app-config/get.js +2 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +2 -1
  36. package/lib/commands/app-config/set.js +3 -1
  37. package/lib/commands/app-config/shared.d.ts +9 -2
  38. package/lib/commands/app-config/shared.js +6 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +11 -1
  41. package/lib/commands/bff/delete.js +6 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +4 -1
  46. package/lib/commands/bff/pull.js +22 -1
  47. package/lib/commands/bff/push.js +16 -1
  48. package/lib/commands/bff/status.js +3 -1
  49. package/lib/commands/cli-skill/index.js +2 -1
  50. package/lib/commands/cli-update.js +7 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +4 -1
  55. package/lib/commands/common/app-selector.js +4 -1
  56. package/lib/commands/common/async-task.js +2 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +3 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +2 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +5 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +4 -1
  67. package/lib/commands/config/shared.js +2 -1
  68. package/lib/commands/dataset/batch-design.js +9 -1
  69. package/lib/commands/dataset/business-group-update.js +10 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +3 -1
  72. package/lib/commands/dataset/cross-relation-create.js +2 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +2 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +10 -1
  76. package/lib/commands/dataset/cross-relation-update.js +2 -1
  77. package/lib/commands/dataset/delete.js +6 -1
  78. package/lib/commands/dataset/design-context.js +1 -1
  79. package/lib/commands/dataset/design-start.js +1 -1
  80. package/lib/commands/dataset/design-status.js +1 -1
  81. package/lib/commands/dataset/design-sync-retry.js +1 -1
  82. package/lib/commands/dataset/design-sync-status.js +1 -1
  83. package/lib/commands/dataset/design-validate.js +1 -1
  84. package/lib/commands/dataset/detail.js +5 -1
  85. package/lib/commands/dataset/extend-update.js +7 -1
  86. package/lib/commands/dataset/field-restore.js +7 -1
  87. package/lib/commands/dataset/field-update.js +7 -1
  88. package/lib/commands/dataset/generate.js +19 -1
  89. package/lib/commands/dataset/index.js +3 -1
  90. package/lib/commands/dataset/list.js +2 -1
  91. package/lib/commands/dataset/operations.js +2 -1
  92. package/lib/commands/dataset/relation-audit.js +7 -1
  93. package/lib/commands/dataset/relation-create.js +3 -1
  94. package/lib/commands/dataset/relation-delete.js +3 -1
  95. package/lib/commands/dataset/relation-shared.js +21 -1
  96. package/lib/commands/dataset/relation-update.js +4 -1
  97. package/lib/commands/dataset/relations.js +7 -1
  98. package/lib/commands/dataset/rename.js +4 -1
  99. package/lib/commands/dataset/restore.js +7 -1
  100. package/lib/commands/dataset/user-deleted-field-list.js +3 -1
  101. package/lib/commands/db/analysis-batching.js +3 -1
  102. package/lib/commands/db/analyze-batch-plan.js +2 -1
  103. package/lib/commands/db/analyze-cancel.js +1 -1
  104. package/lib/commands/db/analyze-start.js +3 -1
  105. package/lib/commands/db/analyze-status.js +6 -1
  106. package/lib/commands/db/create.js +4 -1
  107. package/lib/commands/db/cross-db-analysis-shared.js +3 -1
  108. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-start.js +2 -1
  110. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  111. package/lib/commands/db/delete.js +3 -1
  112. package/lib/commands/db/detail.js +1 -1
  113. package/lib/commands/db/diff-refresh-start.js +1 -1
  114. package/lib/commands/db/diff-refresh-status.js +2 -1
  115. package/lib/commands/db/diff.js +3 -1
  116. package/lib/commands/db/index.js +2 -1
  117. package/lib/commands/db/list.js +2 -1
  118. package/lib/commands/db/shared.js +3 -1
  119. package/lib/commands/db/table-diff-shared.js +2 -1
  120. package/lib/commands/db/tables.js +2 -1
  121. package/lib/commands/db/test.js +2 -1
  122. package/lib/commands/db/update.js +4 -1
  123. package/lib/commands/deployment/index.js +1 -1
  124. package/lib/commands/deployment/sync-all.js +3 -1
  125. package/lib/commands/deployment/sync-jobs.js +2 -1
  126. package/lib/commands/deployment/sync-status.js +2 -1
  127. package/lib/commands/doctor.js +12 -1
  128. package/lib/commands/file/index.js +3 -1
  129. package/lib/commands/flow/create.js +2 -1
  130. package/lib/commands/flow/detail.js +3 -1
  131. package/lib/commands/flow/index.js +1 -1
  132. package/lib/commands/flow/list.js +2 -1
  133. package/lib/commands/flow/page-list.js +2 -1
  134. package/lib/commands/flow/publish.js +2 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +3 -1
  136. package/lib/commands/flow/runtime-role-list.js +2 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +2 -1
  138. package/lib/commands/flow/runtime-user-search.js +2 -1
  139. package/lib/commands/flow/shared.js +6 -1
  140. package/lib/commands/flow/update.js +4 -1
  141. package/lib/commands/flow/validate.js +2 -1
  142. package/lib/commands/instant-api-policy/current.js +1 -1
  143. package/lib/commands/instant-api-policy/index.js +1 -1
  144. package/lib/commands/instant-api-policy/init.js +2 -1
  145. package/lib/commands/instant-api-policy/publish.js +5 -1
  146. package/lib/commands/instant-api-policy/pull.js +2 -1
  147. package/lib/commands/instant-api-policy/revision.js +1 -1
  148. package/lib/commands/instant-api-policy/revisions.js +1 -1
  149. package/lib/commands/instant-api-policy/rollback.js +5 -1
  150. package/lib/commands/instant-api-policy/shared.js +5 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/context.js +1 -1
  153. package/lib/commands/issue/index.js +1 -1
  154. package/lib/commands/issue/nudge.js +2 -1
  155. package/lib/commands/issue/report.js +5 -1
  156. package/lib/commands/kb/create.js +5 -1
  157. package/lib/commands/kb/delete.js +5 -1
  158. package/lib/commands/kb/detail.js +1 -1
  159. package/lib/commands/kb/import-api.d.ts +3 -0
  160. package/lib/commands/kb/import-api.js +1 -0
  161. package/lib/commands/kb/import-resume.d.ts +2 -0
  162. package/lib/commands/kb/import-resume.js +2 -0
  163. package/lib/commands/kb/import-shared.d.ts +69 -0
  164. package/lib/commands/kb/import-shared.js +9 -0
  165. package/lib/commands/kb/import-status.d.ts +2 -0
  166. package/lib/commands/kb/import-status.js +1 -0
  167. package/lib/commands/kb/import.d.ts +2 -0
  168. package/lib/commands/kb/import.js +3 -0
  169. package/lib/commands/kb/index.js +1 -1
  170. package/lib/commands/kb/list.js +1 -1
  171. package/lib/commands/kb/search.js +3 -1
  172. package/lib/commands/kb/shared.js +9 -1
  173. package/lib/commands/kb/update.js +7 -1
  174. package/lib/commands/logs/index.js +2 -1
  175. package/lib/commands/menu/asset-update.js +8 -1
  176. package/lib/commands/menu/delete.js +15 -1
  177. package/lib/commands/menu/external-link-create.js +16 -1
  178. package/lib/commands/menu/external-link-update.js +10 -1
  179. package/lib/commands/menu/group-create.js +8 -1
  180. package/lib/commands/menu/group-update.js +6 -1
  181. package/lib/commands/menu/index.js +2 -1
  182. package/lib/commands/menu/list.js +1 -1
  183. package/lib/commands/menu/move.js +6 -1
  184. package/lib/commands/menu/regroup-start.js +11 -1
  185. package/lib/commands/menu/rename.js +9 -1
  186. package/lib/commands/menu/shared/compare-table.js +2 -1
  187. package/lib/commands/menu/shared/delete-plan.js +13 -1
  188. package/lib/commands/menu/shared/facts.js +5 -1
  189. package/lib/commands/menu/shared/index.js +1 -1
  190. package/lib/commands/menu/shared/inquirer.js +4 -1
  191. package/lib/commands/menu/shared/local-pages.js +5 -1
  192. package/lib/commands/menu/shared/logic.js +3 -1
  193. package/lib/commands/menu/shared/mutations.js +9 -1
  194. package/lib/commands/menu/shared/path.js +1 -1
  195. package/lib/commands/menu/shared/service.js +4 -1
  196. package/lib/commands/menu/shared/subapp-assets.js +4 -1
  197. package/lib/commands/menu/shared/sync-core.js +7 -1
  198. package/lib/commands/menu/shared/types.js +1 -1
  199. package/lib/commands/menu/shared/update-core.js +8 -1
  200. package/lib/commands/menu/shared/valid-url.js +1 -1
  201. package/lib/commands/menu/subapp-assets-status.js +1 -1
  202. package/lib/commands/menu/subapp-assets-update.js +7 -1
  203. package/lib/commands/menu/sync.js +7 -1
  204. package/lib/commands/menu/visibility-update.js +13 -1
  205. package/lib/commands/metric/contract.d.ts +8 -0
  206. package/lib/commands/metric/contract.js +5 -0
  207. package/lib/commands/metric/definition.d.ts +43 -0
  208. package/lib/commands/metric/definition.js +4 -0
  209. package/lib/commands/metric/delete.d.ts +2 -0
  210. package/lib/commands/metric/delete.js +3 -0
  211. package/lib/commands/metric/detail.d.ts +2 -0
  212. package/lib/commands/metric/detail.js +1 -0
  213. package/lib/commands/metric/example.d.ts +2 -0
  214. package/lib/commands/metric/example.js +1 -0
  215. package/lib/commands/metric/index.d.ts +2 -0
  216. package/lib/commands/metric/index.js +1 -0
  217. package/lib/commands/metric/list.d.ts +2 -0
  218. package/lib/commands/metric/list.js +2 -0
  219. package/lib/commands/metric/publication-diff.d.ts +8 -0
  220. package/lib/commands/metric/publication-diff.js +1 -0
  221. package/lib/commands/metric/publish.d.ts +2 -0
  222. package/lib/commands/metric/publish.js +4 -0
  223. package/lib/commands/metric/schema.d.ts +2 -0
  224. package/lib/commands/metric/schema.js +1 -0
  225. package/lib/commands/metric/shared.d.ts +14 -0
  226. package/lib/commands/metric/shared.js +2 -0
  227. package/lib/commands/metric/validate.d.ts +2 -0
  228. package/lib/commands/metric/validate.js +1 -0
  229. package/lib/commands/notification/config-create.js +4 -1
  230. package/lib/commands/notification/config-delete.js +4 -1
  231. package/lib/commands/notification/config-list.js +2 -1
  232. package/lib/commands/notification/config-update.js +4 -1
  233. package/lib/commands/notification/index.js +1 -1
  234. package/lib/commands/notification/shared.js +18 -1
  235. package/lib/commands/ocr/index.js +4 -1
  236. package/lib/commands/page/create.js +6 -1
  237. package/lib/commands/page/custom/detail.js +2 -1
  238. package/lib/commands/page/custom/list.js +2 -1
  239. package/lib/commands/page/custom/publish.js +3 -1
  240. package/lib/commands/page/custom/shared.js +3 -1
  241. package/lib/commands/page/custom/syntax.js +2 -1
  242. package/lib/commands/page/custom/update.js +3 -1
  243. package/lib/commands/page/data-list-status.js +2 -1
  244. package/lib/commands/page/generate-start.js +5 -1
  245. package/lib/commands/page/generate-status.js +4 -1
  246. package/lib/commands/page/index.js +2 -1
  247. package/lib/commands/page/pull.js +6 -1
  248. package/lib/commands/page/push.js +11 -1
  249. package/lib/commands/page/relation-audit.js +15 -1
  250. package/lib/commands/page/restore.js +5 -1
  251. package/lib/commands/page/shared.js +16 -1
  252. package/lib/commands/page/sync.js +2 -1
  253. package/lib/commands/project/api-architecture-upgrade.js +11 -1
  254. package/lib/commands/project/create/enhanced-guided-create.js +2 -1
  255. package/lib/commands/project/create/format-elapsed.js +1 -1
  256. package/lib/commands/project/create/main.js +13 -1
  257. package/lib/commands/project/create/materialize-project-template.js +12 -1
  258. package/lib/commands/project/create/project-name.js +1 -1
  259. package/lib/commands/project/create/project-template-archive.js +5 -1
  260. package/lib/commands/project/create/project-template-path.js +1 -1
  261. package/lib/commands/project/create/use-copy-project-template.js +2 -1
  262. package/lib/commands/project/create/use-format-code.js +1 -1
  263. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  264. package/lib/commands/project/domain-routing-sync.js +1 -1
  265. package/lib/commands/project/index.js +4 -1
  266. package/lib/commands/project/upgrade.js +7 -1
  267. package/lib/commands/registry.js +10 -1
  268. package/lib/commands/role/delete.js +2 -1
  269. package/lib/commands/role/detail.js +1 -1
  270. package/lib/commands/role/index.js +1 -1
  271. package/lib/commands/role/list.js +2 -1
  272. package/lib/commands/role/shared.js +8 -1
  273. package/lib/commands/role/update.js +3 -1
  274. package/lib/commands/role/user-add.js +2 -1
  275. package/lib/commands/role/user-remove.js +2 -1
  276. package/lib/commands/role/user-resolve.js +1 -1
  277. package/lib/commands/rule/get.js +1 -1
  278. package/lib/commands/rule/index.js +1 -1
  279. package/lib/commands/rule/list.js +1 -1
  280. package/lib/commands/rule/set.js +7 -1
  281. package/lib/commands/rule/shared.js +4 -1
  282. package/lib/commands/run/index.js +5 -1
  283. package/lib/commands/schema.js +1 -1
  284. package/lib/commands/sql/create.js +7 -1
  285. package/lib/commands/sql/delete.js +4 -1
  286. package/lib/commands/sql/detail.js +1 -1
  287. package/lib/commands/sql/exec.js +1 -1
  288. package/lib/commands/sql/index.js +1 -1
  289. package/lib/commands/sql/list.js +2 -1
  290. package/lib/commands/sql/pull.js +10 -1
  291. package/lib/commands/sql/push.js +9 -1
  292. package/lib/commands/sql/shared.js +5 -1
  293. package/lib/commands/sql/status.js +3 -1
  294. package/lib/commands/sql/validate.js +5 -1
  295. package/lib/commands/task/index.js +1 -1
  296. package/lib/commands/task/status.js +2 -1
  297. package/lib/commands/tenant/index.js +1 -1
  298. package/lib/commands/tenant/members-list.js +2 -1
  299. package/lib/commands/tenant/shared.js +2 -1
  300. package/lib/commands/user-account/dingding-sandbox-bind.js +2 -1
  301. package/lib/commands/user-account/feishu-bind.js +2 -1
  302. package/lib/commands/user-account/index.js +1 -1
  303. package/lib/commands/workspace/add.js +1 -1
  304. package/lib/commands/workspace/index.js +7 -1
  305. package/lib/commands/workspace/remove.js +1 -1
  306. package/lib/config/domain-config.js +8 -1
  307. package/lib/config/project-domain-routing.js +3 -1
  308. package/lib/config/region-config.js +2 -1
  309. package/lib/config/schema.js +7 -1
  310. package/lib/constant/cdn.js +2 -1
  311. package/lib/constant/cli.js +8 -1
  312. package/lib/constant/defaults.js +1 -1
  313. package/lib/constant/domain.js +4 -1
  314. package/lib/constant/env.js +1 -1
  315. package/lib/constant/output.js +1 -1
  316. package/lib/constant/paths.js +1 -1
  317. package/lib/constant/region.js +1 -1
  318. package/lib/constant/risk.js +1 -1
  319. package/lib/constant/routing-profile.js +1 -1
  320. package/lib/context/app-resolver.js +7 -1
  321. package/lib/context/auth-resolver.js +1 -1
  322. package/lib/context/config-loader.js +7 -1
  323. package/lib/context.js +9 -1
  324. package/lib/core/alias-resolver.js +5 -1
  325. package/lib/core/api-client.d.ts +14 -7
  326. package/lib/core/api-client.js +69 -1
  327. package/lib/core/bff/config.js +1 -1
  328. package/lib/core/bff/file-system.js +6 -1
  329. package/lib/core/bff/hash.js +1 -1
  330. package/lib/core/bff/hook-directory.js +9 -1
  331. package/lib/core/bff/lock.js +2 -1
  332. package/lib/core/bff/types.js +1 -1
  333. package/lib/core/bff/utils.js +3 -1
  334. package/lib/core/cross-db-analysis.js +1 -1
  335. package/lib/core/cross-db-relation.js +1 -1
  336. package/lib/core/db-resolver.js +2 -1
  337. package/lib/core/flow-config.js +49 -1
  338. package/lib/core/instant-api-policy/config.js +7 -1
  339. package/lib/core/instant-api-policy/endpoints.js +1 -1
  340. package/lib/core/kb-management-client.d.ts +11 -0
  341. package/lib/core/kb-management-client.js +4 -1
  342. package/lib/core/kb-search-client.js +3 -1
  343. package/lib/core/page/file-system.js +2 -1
  344. package/lib/core/page/hash.js +1 -1
  345. package/lib/core/page/lock.js +2 -1
  346. package/lib/core/page/lr-smart-jsx.js +4 -1
  347. package/lib/core/page/types.js +1 -1
  348. package/lib/core/sql-index-auditor.js +14 -1
  349. package/lib/core/sql-sync/config.js +1 -1
  350. package/lib/core/sql-sync/file-system.js +3 -1
  351. package/lib/core/sql-sync/hash.js +1 -1
  352. package/lib/core/sql-sync/lock.js +2 -1
  353. package/lib/core/sql-sync/types.js +1 -1
  354. package/lib/core/sql-sync/utils.js +2 -1
  355. package/lib/core/sql-validator.js +15 -1
  356. package/lib/errors.js +3 -1
  357. package/lib/framework/build-all-flags.js +1 -1
  358. package/lib/framework/error-output.js +1 -1
  359. package/lib/framework/explicit-yes.js +1 -1
  360. package/lib/framework/flags.js +1 -1
  361. package/lib/framework/help.js +2 -1
  362. package/lib/framework/index.js +1 -1
  363. package/lib/framework/output.js +2 -1
  364. package/lib/framework/response.js +1 -1
  365. package/lib/framework/runner-alias.js +2 -1
  366. package/lib/framework/runner.js +9 -1
  367. package/lib/framework/schema-export.js +1 -1
  368. package/lib/framework/supported-flags.js +2 -1
  369. package/lib/framework/types.js +1 -1
  370. package/lib/generated/build-info.d.ts +4 -4
  371. package/lib/generated/build-info.js +1 -1
  372. package/lib/generated/official-routing.js +3 -1
  373. package/lib/generated/routing-contract.js +1 -1
  374. package/lib/help.js +1 -1
  375. package/lib/runtime/confirmation.js +2 -1
  376. package/lib/runtime/event.js +1 -1
  377. package/lib/runtime/index.js +4 -1
  378. package/lib/runtime/queue.js +1 -1
  379. package/lib/runtime/resolve.js +2 -1
  380. package/lib/runtime/types.js +1 -1
  381. package/lib/services/dataset-design/checkpoint.js +2 -1
  382. package/lib/services/dataset-design/commands.js +14 -1
  383. package/lib/services/dataset-design/contract.js +8 -1
  384. package/lib/skills/builtin-skill.js +8 -1
  385. package/lib/skills/install-updated-skill.d.ts +8 -0
  386. package/lib/skills/install-updated-skill.js +3 -0
  387. package/lib/skills/local-skills-installer.d.ts +2 -0
  388. package/lib/skills/local-skills-installer.js +1 -0
  389. package/lib/skills/main.js +2 -1
  390. package/lib/skills/npx-skills-add.d.ts +6 -6
  391. package/lib/skills/npx-skills-add.js +5 -1
  392. package/lib/skills/skill-presence.d.ts +1 -30
  393. package/lib/skills/skill-presence.js +2 -1
  394. package/lib/telemetry/cli-command-trace.js +2 -1
  395. package/lib/telemetry/cli-help-trace.js +1 -1
  396. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  397. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  398. package/lib/telemetry/send-cli-trace-log.js +1 -1
  399. package/lib/types/index.js +1 -1
  400. package/lib/utils/ai_config.js +3 -1
  401. package/lib/utils/apply-jq-filter.js +1 -1
  402. package/lib/utils/cdn-config.js +1 -1
  403. package/lib/utils/check-sdk-version.js +5 -1
  404. package/lib/utils/cli-version-check.js +4 -1
  405. package/lib/utils/cli-version-policy.js +3 -1
  406. package/lib/utils/config.js +1 -1
  407. package/lib/utils/entity-with-id.js +1 -1
  408. package/lib/utils/file-utils.js +1 -1
  409. package/lib/utils/guides-cdn.js +3 -1
  410. package/lib/utils/http-client.js +2 -1
  411. package/lib/utils/is-non-interactive.js +1 -1
  412. package/lib/utils/logger.js +3 -1
  413. package/lib/utils/params.js +1 -1
  414. package/lib/utils/platform.js +1 -1
  415. package/lib/utils/sleep.js +1 -1
  416. package/lib/utils/template-replacer.js +5 -1
  417. package/lib/utils/update-notice.js +3 -1
  418. package/lib/utils/version.js +1 -1
  419. package/lib/utils/with-active-cookie.js +1 -1
  420. package/lib/utils/write-cli-side-channel.js +1 -1
  421. package/package.json +10 -7
  422. package/skills/rabetbase/SKILL.md +11 -7
  423. package/skills/rabetbase/guides/backend-function.md +3 -1
  424. package/skills/rabetbase/guides/data-api-guidelines.md +1 -1
  425. package/skills/rabetbase/guides/frontend-development.md +1 -0
  426. package/skills/rabetbase/guides/metric-development.md +185 -0
  427. package/skills/rabetbase/references/rabetbase-app-config.md +4 -3
  428. package/skills/rabetbase/references/rabetbase-cli-skill-install.md +5 -5
  429. package/skills/rabetbase/references/rabetbase-dataset-design.md +1 -1
  430. package/skills/rabetbase/references/rabetbase-kb.md +16 -0
  431. package/skills/rabetbase/references/rabetbase-metric.md +119 -0
  432. package/skills/rabetbase/references/rabetbase-update.md +7 -5
  433. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  434. package/skills/rabetbase-dataset-generation/references/workflow.md +1 -1
  435. package/skills/rabetbase-metrics-generation/SKILL.md +22 -0
  436. package/skills/rabetbase-metrics-generation/references/verification.md +19 -0
  437. package/skills/rabetbase-metrics-generation/references/workflow.md +41 -0
  438. package/skills/rabetbase-metrics-generation/templates/statistics-delivery.md +11 -0
  439. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  440. package/skills/rabetbase-page-generation/references/generation.md +1 -1
  441. package/skills/rabetbase.manifest.json +5 -3
  442. package/templates/metrics/definition.json +78 -0
  443. package/templates/metrics/metric-definition.schema.json +136 -0
  444. package/lib/postinstall.d.ts +0 -3
  445. package/lib/postinstall.js +0 -1
  446. package/scripts/postinstall.mjs +0 -24
@@ -1 +1,2 @@
1
- const a264_0x1a1d91=a264_0x57b7;(function(_0x143913,_0x8ad0f5){const _0x5289eb=a264_0x57b7,_0x47e6a3=_0x143913();while(!![]){try{const _0x111a38=-parseInt(_0x5289eb(0x96))/0x1+parseInt(_0x5289eb(0x9a))/0x2+-parseInt(_0x5289eb(0x9c))/0x3+parseInt(_0x5289eb(0x98))/0x4+-parseInt(_0x5289eb(0xa3))/0x5+parseInt(_0x5289eb(0x92))/0x6*(parseInt(_0x5289eb(0x94))/0x7)+parseInt(_0x5289eb(0x93))/0x8;if(_0x111a38===_0x8ad0f5)break;else _0x47e6a3['push'](_0x47e6a3['shift']());}catch(_0x15ac69){_0x47e6a3['push'](_0x47e6a3['shift']());}}}(a264_0x56cf,0xce290));function a264_0x56cf(){const _0x2f818e=['Feishu\x20union_id\x20for\x20the\x20configured\x20Feishu\x20application\x20developer','3298287ChjwKM','validation','POST','trim','write','Feishu\x20account\x20binding\x20was\x20not\x20confirmed.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20Feishu\x20account','2926275CcGoBs','test','Verify\x20the\x20current\x20binding\x20through\x20the\x20platform\x20before\x20explicitly\x20retrying;\x20do\x20not\x20automatically\x20retry.','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','bind','apiError','union-id','Bound\x20current\x20user\x20to\x20Feishu\x20account.','user-account','1295484NREaBE','9709712tOIXzR','21CMbDZO','--union-id\x20must\x20match\x20on_\x20followed\x20by\x20letters,\x20digits,\x20underscores,\x20or\x20hyphens.','1364747CBlkdB','feishu-bind','5310944bTJRxn','string','1409342gtJAGV'];a264_0x56cf=function(){return _0x2f818e;};return a264_0x56cf();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindFeishuAccount,FEISHU_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a264_0x57b7(_0x42192f,_0x2bc144){_0x42192f=_0x42192f-0x8d;const _0x56cfa2=a264_0x56cf();let _0x57b724=_0x56cfa2[_0x42192f];return _0x57b724;}const PROVIDER_ID='feishu',CURRENT_BINDING_WARNING=a264_0x1a1d91(0xa6);function readUnionId(_0x2f7be0){const _0x345f35=a264_0x1a1d91,_0x2723fe=_0x2f7be0['str'](_0x345f35(0x8f))[_0x345f35(0x9f)]();if(!/^on_[A-Za-z0-9_-]+$/[_0x345f35(0xa4)](_0x2723fe))throw CliErrors[_0x345f35(0x9d)](_0x345f35(0x95),'Pass\x20a\x20Feishu\x20union\x20id\x20such\x20as\x20on_example_001.');return _0x2723fe;}function buildBindingData(_0x23bd9a,_0x3d37a3){const _0x221d32=a264_0x1a1d91;return{'operation':_0x221d32(0x8d),'selector':{'providerId':PROVIDER_ID,'unionId':_0x23bd9a},'before':null,'after':{'providerId':PROVIDER_ID,'unionId':_0x23bd9a,'bound':!![]},'dryRun':_0x3d37a3,'backend':{'method':_0x221d32(0x9e),'path':FEISHU_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const feishuBind={'service':a264_0x1a1d91(0x91),'command':a264_0x1a1d91(0x97),'description':a264_0x1a1d91(0xa2),'risk':a264_0x1a1d91(0xa0),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'union-id','type':a264_0x1a1d91(0x99),'required':!![],'description':a264_0x1a1d91(0x9b)}],async 'validate'(_0x94710){readUnionId(_0x94710);},async 'dryRun'(_0x204b21){const _0x5a8659=a264_0x1a1d91,_0x527931=readUnionId(_0x204b21);return asDryRunResult(buildBindingData(_0x527931,!![]),{'method':_0x5a8659(0x9e),'url':FEISHU_BIND_PATH});},async 'execute'(_0x1a0300){const _0x43bc89=a264_0x1a1d91,_0x1d8a2a=readUnionId(_0x1a0300),_0x4629e0=await bindFeishuAccount(_0x1d8a2a);if(_0x4629e0!==!![])throw CliErrors[_0x43bc89(0x8e)](_0x43bc89(0xa1),_0x43bc89(0xa5));return{'ok':!![],'data':buildBindingData(_0x1d8a2a,![]),'message':_0x43bc89(0x90)};}};
1
+ import{asDryRunResult}from"../../commands/common/dry-run.js";import{bindFeishuAccount,FEISHU_BIND_PATH}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";const PROVIDER_ID="feishu";const CURRENT_BINDING_WARNING="The current binding is not exposed by the server; before is unavailable.";function readUnionId(ctx){const unionId=ctx.str("union-id").trim();if(!/^on_[A-Za-z0-9_-]+$/.test(unionId)){throw CliErrors.validation("--union-id must match on_ followed by letters, digits, underscores, or hyphens.","Pass a Feishu union id such as on_example_001.")}return unionId}function buildBindingData(unionId,dryRun){return{operation:"bind",selector:{providerId:PROVIDER_ID,unionId:unionId},before:null,after:{providerId:PROVIDER_ID,unionId:unionId,bound:true},dryRun:dryRun,backend:{method:"POST",path:FEISHU_BIND_PATH},warnings:[CURRENT_BINDING_WARNING]}}export const feishuBind={service:"user-account",command:"feishu-bind",
2
+ description:"Bind the current platform user to a Feishu account",risk:"write",requiresAuth:true,requiresAppCode:false,structuredErrors:true,flags:[{name:"union-id",type:"string",required:true,description:"Feishu union_id for the configured Feishu application developer"}],async validate(ctx){readUnionId(ctx)},async dryRun(ctx){const unionId=readUnionId(ctx);return asDryRunResult(buildBindingData(unionId,true),{method:"POST",url:FEISHU_BIND_PATH})},async execute(ctx){const unionId=readUnionId(ctx);const confirmed=await bindFeishuAccount(unionId);if(confirmed!==true){throw CliErrors.apiError("Feishu account binding was not confirmed.","Verify the current binding through the platform before explicitly retrying; do not automatically retry.")}return{ok:true,data:buildBindingData(unionId,false),message:"Bound current user to Feishu account."}}};
@@ -1 +1 @@
1
- (function(_0x349b04,_0x54c1a9){const _0x2719a0=a265_0x7d66,_0x448781=_0x349b04();while(!![]){try{const _0x3a159f=parseInt(_0x2719a0(0x134))/0x1*(-parseInt(_0x2719a0(0x131))/0x2)+parseInt(_0x2719a0(0x133))/0x3+parseInt(_0x2719a0(0x12b))/0x4*(-parseInt(_0x2719a0(0x130))/0x5)+-parseInt(_0x2719a0(0x12e))/0x6*(-parseInt(_0x2719a0(0x12f))/0x7)+-parseInt(_0x2719a0(0x12c))/0x8+-parseInt(_0x2719a0(0x12d))/0x9*(-parseInt(_0x2719a0(0x135))/0xa)+parseInt(_0x2719a0(0x132))/0xb*(parseInt(_0x2719a0(0x136))/0xc);if(_0x3a159f===_0x54c1a9)break;else _0x448781['push'](_0x448781['shift']());}catch(_0x10b6e4){_0x448781['push'](_0x448781['shift']());}}}(a265_0x5602,0xb7993));function a265_0x7d66(_0x246588,_0x4b526d){_0x246588=_0x246588-0x12b;const _0x560280=a265_0x5602();let _0x7d668f=_0x560280[_0x246588];return _0x7d668f;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';import{feishuBind}from'../../commands/user-account/feishu-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];function a265_0x5602(){const _0x484f6e=['1aPeAno','10ndsPss','42492SMBruT','404lJAkkc','196504KnrSGS','7725762rTSjEr','81246JSifCT','301PJouSF','52655isicJH','1896166ENZBiI','2640MgcMsr','1493325uHYJnC'];a265_0x5602=function(){return _0x484f6e;};return a265_0x5602();}
1
+ import{dingTalkSandboxBind}from"../../commands/user-account/dingding-sandbox-bind.js";import{feishuBind}from"../../commands/user-account/feishu-bind.js";export const userAccountDefinitions=[dingTalkSandboxBind,feishuBind];
@@ -1 +1 @@
1
- const a266_0x5ac617=a266_0x1ac2;(function(_0x4a0eb9,_0x183db7){const _0x4cb039=a266_0x1ac2,_0x36126f=_0x4a0eb9();while(!![]){try{const _0x915222=parseInt(_0x4cb039(0x6e))/0x1+parseInt(_0x4cb039(0x6f))/0x2*(parseInt(_0x4cb039(0x78))/0x3)+parseInt(_0x4cb039(0x74))/0x4+-parseInt(_0x4cb039(0x6d))/0x5*(-parseInt(_0x4cb039(0x70))/0x6)+parseInt(_0x4cb039(0x69))/0x7*(-parseInt(_0x4cb039(0x76))/0x8)+-parseInt(_0x4cb039(0x6a))/0x9+parseInt(_0x4cb039(0x71))/0xa;if(_0x915222===_0x183db7)break;else _0x36126f['push'](_0x36126f['shift']());}catch(_0x50d93b){_0x36126f['push'](_0x36126f['shift']());}}}(a266_0x298f,0x1e27f));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a266_0x5ac617(0x77),'command':a266_0x5ac617(0x73),'description':a266_0x5ac617(0x75),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a266_0x5ac617(0x6c),'description':a266_0x5ac617(0x72),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x220727=>validateAppName(_0x220727,'workspace\x20add'),'execute':_0x58f7f8=>runAppAdd(_0x58f7f8,a266_0x5ac617(0x6b))};function a266_0x1ac2(_0x494c3a,_0x38b592){_0x494c3a=_0x494c3a-0x69;const _0x298f10=a266_0x298f();let _0x1ac294=_0x298f10[_0x494c3a];return _0x1ac294;}function a266_0x298f(){const _0x374943=['App\x20profile\x20name','add','341112HEnHkb','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1847264kKrVkj','workspace','3vnlpCU','7aUJBnP','2088702UVnBEs','workspace\x20add','name','1840zCxtzq','139675GjpZBV','57262mHlzvH','3402gcDFAG','1242650gzfCWt'];a266_0x298f=function(){return _0x374943;};return a266_0x298f();}
1
+ import{buildAppAddFlags,runAppAdd,validateAppName}from"../../commands/common/app-registry.js";export const workspaceAddDefinition={service:"workspace",command:"add",description:"Register an app profile in the current workspace (or --global)",risk:"write",requiresAuth:false,requiresAppCode:false,args:[{name:"name",description:"App profile name",required:true}],flags:buildAppAddFlags(),validate:ctx=>validateAppName(ctx,"workspace add"),execute:ctx=>runAppAdd(ctx,"workspace add")};
@@ -1 +1,7 @@
1
- const a267_0x1bde60=a267_0x1342;(function(_0x37babb,_0x42deb8){const _0x36f14a=a267_0x1342,_0x59fefb=_0x37babb();while(!![]){try{const _0x50e871=parseInt(_0x36f14a(0x9b))/0x1+-parseInt(_0x36f14a(0x7d))/0x2*(-parseInt(_0x36f14a(0x8e))/0x3)+parseInt(_0x36f14a(0x97))/0x4*(-parseInt(_0x36f14a(0x9e))/0x5)+-parseInt(_0x36f14a(0x9f))/0x6*(parseInt(_0x36f14a(0x86))/0x7)+parseInt(_0x36f14a(0xa7))/0x8*(-parseInt(_0x36f14a(0xa4))/0x9)+parseInt(_0x36f14a(0x9c))/0xa*(parseInt(_0x36f14a(0xa6))/0xb)+-parseInt(_0x36f14a(0x7f))/0xc;if(_0x50e871===_0x42deb8)break;else _0x59fefb['push'](_0x59fefb['shift']());}catch(_0x624d4c){_0x59fefb['push'](_0x59fefb['shift']());}}}(a267_0x3e07,0x507ba));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';import{normalizeStoredDefaultApp}from'../../config/schema.js';import{ENABLED_LOVRABET_REGION_VALUES}from'../../constant/region.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a267_0x1bde60(0x79),SAFE_PROFILE_KEYS=['appcode',a267_0x1bde60(0x88),'region',a267_0x1bde60(0x73),a267_0x1bde60(0x98),a267_0x1bde60(0x90),'pageSize',a267_0x1bde60(0x8a),'locale'],workspaceFlags=[{'name':a267_0x1bde60(0x7c),'type':a267_0x1bde60(0x7b),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a267_0x1bde60(0xa0),'type':a267_0x1bde60(0x7b),'description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':'apiGroup','type':a267_0x1bde60(0x7b),'description':a267_0x1bde60(0x99)},{'name':a267_0x1bde60(0x71),'type':'string','description':a267_0x1bde60(0x87),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':'env','type':'string','description':a267_0x1bde60(0x94),'enum':[...RABETBASE_ENV_VALUES]},{'name':a267_0x1bde60(0x98),'type':a267_0x1bde60(0x7b),'description':a267_0x1bde60(0x82)},{'name':'defaultFormat','type':a267_0x1bde60(0x7b),'description':a267_0x1bde60(0x93),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a267_0x1bde60(0x77),'type':a267_0x1bde60(0x7a),'description':a267_0x1bde60(0x8c)},{'name':a267_0x1bde60(0x8a),'type':a267_0x1bde60(0x7b),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':a267_0x1bde60(0xa5),'type':a267_0x1bde60(0x7b),'description':a267_0x1bde60(0x6b)}];function isRecord(_0x311fa0){return!!_0x311fa0&&typeof _0x311fa0==='object'&&!Array['isArray'](_0x311fa0);}function assertValidAppcode(_0x4119f1){const _0x48faf0=a267_0x1bde60,{valid:_0x4cfdbe,message:_0x567c4e}=validateAppcode(_0x4119f1);if(!_0x4cfdbe)throw CliErrors[_0x48faf0(0x7e)]('Invalid\x20appcode:\x20'+_0x4119f1,_0x567c4e);}function sanitizeProfile(_0xeccb4d){if(!isRecord(_0xeccb4d))return{};const _0x5d9c20={};for(const _0x5829f1 of SAFE_PROFILE_KEYS){if(_0xeccb4d[_0x5829f1]!==undefined)_0x5d9c20[_0x5829f1]=_0xeccb4d[_0x5829f1];}return _0x5d9c20;}function a267_0x1342(_0x4bf137,_0x23072c){_0x4bf137=_0x4bf137-0x6a;const _0x3e0723=a267_0x3e07();let _0x1342e4=_0x3e0723[_0x4bf137];return _0x1342e4;}function cloneProfile(_0xb3e90d){return isRecord(_0xb3e90d)?{..._0xb3e90d}:{};}function collectWorkspaceProfileOverrides(_0x5d442a){const _0x20743e=a267_0x1bde60,_0x31c814={},_0xa53d6c=_0x5d442a[_0x20743e(0xa9)](_0x20743e(0x88)),_0x871bfe=_0x5d442a[_0x20743e(0xa9)](_0x20743e(0x71)),_0xe9c25c=_0x5d442a[_0x20743e(0xa9)](_0x20743e(0x73)),_0x17930d=_0x5d442a[_0x20743e(0xa9)]('apiDir'),_0x4edd3d=_0x5d442a[_0x20743e(0xa9)](_0x20743e(0x6d)),_0x24a329=_0x5d442a[_0x20743e(0x78)](_0x20743e(0x77)),_0x3c2cee=_0x5d442a[_0x20743e(0xa9)]('riskLevel'),_0x22af8b=_0x5d442a[_0x20743e(0xa9)](_0x20743e(0xa5));if(_0xa53d6c)_0x31c814[_0x20743e(0x88)]=_0xa53d6c;if(_0x871bfe)_0x31c814[_0x20743e(0x71)]=_0x871bfe;if(_0xe9c25c)_0x31c814[_0x20743e(0x73)]=_0xe9c25c;if(_0x17930d)_0x31c814['apiDir']=_0x17930d;if(_0x4edd3d)_0x31c814[_0x20743e(0x90)]=_0x4edd3d;if(_0x24a329!==undefined&&_0x24a329!=='')_0x31c814[_0x20743e(0x77)]=Number(_0x24a329);if(_0x3c2cee)_0x31c814['riskLevel']=_0x3c2cee;if(_0x22af8b)_0x31c814[_0x20743e(0xa5)]=_0x22af8b;return _0x31c814;}function a267_0x3e07(){const _0x46bf96=['497XowXJr','Country/region\x20for\x20this\x20workspace\x20app\x20profile','apiGroup','workspace.','riskLevel','Switch\x20the\x20current\x20workspace\x20app\x20binding','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','initialized','1788942GteKBl','apps','format','join','updated','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Target\x20environment','\x20workspace\x20','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','4Ejmtcl','apiDir','Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry','.\x20Credentials:\x20not\x20written.','354356lYisbr','30KKRYPf','\x20(appcode:\x20','1743800MCkkBz','20946scJVLO','appcode',').\x20Config:\x20','use','Use\x20`','9wwWewS','locale','1975116MQpfWs','539656AQsmEH','project','str','write','\x22\x20not\x20found.','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','trim','defaultFormat','globalConfig','App\x20\x22','length','region','init','env','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','\x20workspace\x20use\x20--app\x20<name>`.','Workspace\x20','pageSize','flag','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','number','string','app','2udUjSV','validation','5947224KHnlhs','\x20--appcode\x20<code>`.','Missing\x20workspace\x20app\x20selector.','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','workspace','\x20--app\x20','keys'];a267_0x3e07=function(){return _0x46bf96;};return a267_0x3e07();}async function validateWorkspaceArgs(_0x840e59){const _0x52261c=a267_0x1bde60,_0x128151=_0x840e59[_0x52261c(0xa9)]('app')[_0x52261c(0x6c)](),_0x1251f5=_0x840e59[_0x52261c(0xa9)]('appcode')[_0x52261c(0x6c)]();if(!_0x128151&&!_0x1251f5)throw CliErrors[_0x52261c(0x7e)](_0x52261c(0x81),_0x52261c(0xa3)+CLI_BIN_NAME+_0x52261c(0x74)+CLI_BIN_NAME+_0x52261c(0x75));if(_0x1251f5)assertValidAppcode(_0x1251f5);}function resolveKnownApps(){const _0x2b0b2f=a267_0x1bde60,{config:_0x36934a,layers:_0x4bc150}=readRawConfigWithLayers(),_0x4252ff=isRecord(_0x36934a['apps'])?_0x36934a[_0x2b0b2f(0x8f)]:{},_0x21f825=isRecord(_0x4bc150['globalConfig'][_0x2b0b2f(0x8f)])?_0x4bc150[_0x2b0b2f(0x6e)][_0x2b0b2f(0x8f)]:{};return{..._0x21f825,..._0x4252ff};}async function configureWorkspace(_0x2e72f3,_0x1281fd){const _0x35ce55=a267_0x1bde60,_0x30d82d=_0x2e72f3['str'](_0x35ce55(0x7c))[_0x35ce55(0x6c)](),_0x374754=_0x2e72f3[_0x35ce55(0xa9)]('appcode')[_0x35ce55(0x6c)](),_0x5ea46b=_0x30d82d||_0x374754;if(!_0x5ea46b)throw CliErrors['validation'](_0x35ce55(0x81),_0x35ce55(0xa3)+CLI_BIN_NAME+_0x35ce55(0x74)+CLI_BIN_NAME+_0x35ce55(0x75));if(_0x374754)assertValidAppcode(_0x374754);const _0x281bfc=resolveWriteConfigPath(_0x35ce55(0xa8)),_0x47ceb7=readConfigFile(_0x281bfc),_0x187b11=resolveKnownApps(),_0x27a08f=isRecord(_0x47ceb7['apps'])?{..._0x47ceb7[_0x35ce55(0x8f)]}:{},_0x4dee91=cloneProfile(_0x27a08f[_0x5ea46b]),_0x115f64=sanitizeProfile(_0x187b11[_0x5ea46b]),_0x4abcdc=_0x374754?{}:_0x115f64,_0x21695f=_0x374754||_0x4abcdc['appcode'];if(!_0x21695f){const _0x5ac82f=Object[_0x35ce55(0x85)](_0x187b11),_0x170614=_0x5ac82f[_0x35ce55(0x70)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x35ce55(0x95)+_0x1281fd+_0x35ce55(0x84)+_0x5ea46b+_0x35ce55(0x80):_0x35ce55(0x96)+_0x5ac82f[_0x35ce55(0x91)](',\x20');throw CliErrors[_0x35ce55(0x7e)](_0x35ce55(0x6f)+_0x5ea46b+_0x35ce55(0x6a),_0x170614);}assertValidAppcode(String(_0x21695f));const _0x1ded22={..._0x4abcdc,..._0x4dee91,'appcode':String(_0x21695f),...collectWorkspaceProfileOverrides(_0x2e72f3)};return _0x27a08f[_0x5ea46b]=_0x1ded22,_0x47ceb7['apps']=_0x27a08f,normalizeStoredDefaultApp(_0x47ceb7,_0x5ea46b),delete _0x47ceb7[_0x35ce55(0xa0)],delete _0x47ceb7['app'],_0x1ded22[_0x35ce55(0x73)]&&(_0x47ceb7[_0x35ce55(0x73)]=_0x1ded22[_0x35ce55(0x73)]),writeConfigFile(_0x281bfc,_0x47ceb7),{'ok':!![],'message':_0x35ce55(0x76)+(_0x1281fd===_0x35ce55(0x72)?_0x35ce55(0x8d):_0x35ce55(0x92))+':\x20'+_0x5ea46b+_0x35ce55(0x9d)+_0x1ded22[_0x35ce55(0xa0)]+_0x35ce55(0xa1)+_0x281bfc+_0x35ce55(0x9a),'data':{'operation':_0x35ce55(0x89)+_0x1281fd,'configPath':_0x281bfc,'app':_0x5ea46b,'appcode':_0x1ded22[_0x35ce55(0xa0)],'apiGroup':_0x1ded22[_0x35ce55(0x88)]??null,'region':_0x1ded22[_0x35ce55(0x71)]??null,'env':_0x1ded22[_0x35ce55(0x73)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a267_0x1bde60(0x83),'command':a267_0x1bde60(0x72),'description':'Initialize\x20the\x20current\x20workspace\x20app\x20binding','risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x32ebf8=>configureWorkspace(_0x32ebf8,a267_0x1bde60(0x72))},workspaceUseDefinition={'service':a267_0x1bde60(0x83),'command':a267_0x1bde60(0xa2),'description':a267_0x1bde60(0x8b),'risk':a267_0x1bde60(0xaa),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x83ddbb=>configureWorkspace(_0x83ddbb,a267_0x1bde60(0xa2))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ import{CliErrors}from"../../errors.js";import{CLI_BIN_NAME}from"../../constant/cli.js";import{RABETBASE_ENV_VALUES}from"../../constant/env.js";import{RABETBASE_OUTPUT_FORMAT_VALUES}from"../../constant/output.js";import{RISK_LEVEL_VALUES}from"../../constant/risk.js";import{validateAppcode}from"../../commands/common/validate.js";import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from"../../context.js";import{workspaceAddDefinition}from"../../commands/workspace/add.js";import{workspaceRemoveDefinition}from"../../commands/workspace/remove.js";import{normalizeStoredDefaultApp}from"../../config/schema.js";import{ENABLED_LOVRABET_REGION_VALUES}from"../../constant/region.js";const WORKSPACE_USAGE=`${CLI_BIN_NAME} workspace <init|use> --app <name> [--appcode <code>]`;const SAFE_PROFILE_KEYS=["appcode","apiGroup","region","env","apiDir","format","pageSize","riskLevel","locale"];const workspaceFlags=[{name:"app",type:"string",
2
+ description:"App profile name to use in this workspace"},{name:"appcode",type:"string",description:"App code to bind to this workspace"},{name:"apiGroup",type:"string",description:"Join key for app profiles that share one generated API model registry"},{name:"region",type:"string",description:"Country/region for this workspace app profile",enum:[...ENABLED_LOVRABET_REGION_VALUES]},{name:"env",type:"string",description:"Target environment",enum:[...RABETBASE_ENV_VALUES]},{name:"apiDir",type:"string",description:"API directory path for this workspace app profile"},{name:"defaultFormat",type:"string",description:"Default output format for this workspace app profile",enum:[...RABETBASE_OUTPUT_FORMAT_VALUES]},{name:"pageSize",type:"number",description:"Default page size for this workspace app profile"},{name:"riskLevel",type:"string",description:"Risk level for this workspace app profile",enum:[...RISK_LEVEL_VALUES]},{name:"locale",type:"string",
3
+ description:"App locale for this workspace app profile (not CLI language; reserved for later app use)"}];function isRecord(value){return!!value&&typeof value==="object"&&!Array.isArray(value)}function assertValidAppcode(appcode){const{valid:valid,message:message}=validateAppcode(appcode);if(!valid){throw CliErrors.validation(`Invalid appcode: ${appcode}`,message)}}function sanitizeProfile(profile){if(!isRecord(profile))return{};const sanitized={};for(const key of SAFE_PROFILE_KEYS){if(profile[key]!==undefined)sanitized[key]=profile[key]}return sanitized}function cloneProfile(profile){return isRecord(profile)?{...profile}:{}}function collectWorkspaceProfileOverrides(ctx){const profile={};const apiGroup=ctx.str("apiGroup");const region=ctx.str("region");const env=ctx.str("env");const apiDir=ctx.str("apiDir");const defaultFormat=ctx.str("defaultFormat");const pageSize=ctx.flag("pageSize");const riskLevel=ctx.str("riskLevel");const locale=ctx.str("locale")
4
+ ;if(apiGroup)profile.apiGroup=apiGroup;if(region)profile.region=region;if(env)profile.env=env;if(apiDir)profile.apiDir=apiDir;if(defaultFormat)profile.format=defaultFormat;if(pageSize!==undefined&&pageSize!=="")profile.pageSize=Number(pageSize);if(riskLevel)profile.riskLevel=riskLevel;if(locale)profile.locale=locale;return profile}async function validateWorkspaceArgs(ctx){const app=ctx.str("app").trim();const appcode=ctx.str("appcode").trim();if(!app&&!appcode){throw CliErrors.validation("Missing workspace app selector.",`Use \`${CLI_BIN_NAME} workspace init --appcode <code>\` or \`${CLI_BIN_NAME} workspace use --app <name>\`.`)}if(appcode)assertValidAppcode(appcode)}function resolveKnownApps(){const{config:merged,layers:layers}=readRawConfigWithLayers();const mergedApps=isRecord(merged.apps)?merged.apps:{};const globalApps=isRecord(layers.globalConfig.apps)?layers.globalConfig.apps:{};return{...globalApps,...mergedApps}}async function configureWorkspace(ctx,operation){
5
+ const inputApp=ctx.str("app").trim();const inputAppcode=ctx.str("appcode").trim();const appName=inputApp||inputAppcode;if(!appName){throw CliErrors.validation("Missing workspace app selector.",`Use \`${CLI_BIN_NAME} workspace init --appcode <code>\` or \`${CLI_BIN_NAME} workspace use --app <name>\`.`)}if(inputAppcode)assertValidAppcode(inputAppcode);const configPath=resolveWriteConfigPath("project");const config=readConfigFile(configPath);const knownApps=resolveKnownApps();const projectApps=isRecord(config.apps)?{...config.apps}:{};const existingProjectProfile=cloneProfile(projectApps[appName]);const knownProfile=sanitizeProfile(knownApps[appName]);const sourceProfile=inputAppcode?{}:knownProfile;const resolvedAppcode=inputAppcode||sourceProfile.appcode;if(!resolvedAppcode){const available=Object.keys(knownApps)
6
+ ;const hint=available.length===0?`Use \`${CLI_BIN_NAME} workspace ${operation} --app ${appName} --appcode <code>\`.`:`Pass --appcode <code>, or choose one of: ${available.join(", ")}`;throw CliErrors.validation(`App "${appName}" not found.`,hint)}assertValidAppcode(String(resolvedAppcode));const profile={...sourceProfile,...existingProjectProfile,appcode:String(resolvedAppcode),...collectWorkspaceProfileOverrides(ctx)};projectApps[appName]=profile;config.apps=projectApps;normalizeStoredDefaultApp(config,appName);delete config.appcode;delete config.app;if(profile.env){config.env=profile.env}writeConfigFile(configPath,config);return{ok:true,message:`Workspace ${operation==="init"?"initialized":"updated"}: ${appName} (appcode: ${profile.appcode}). Config: ${configPath}. Credentials: not written.`,data:{operation:`workspace.${operation}`,configPath:configPath,app:appName,appcode:profile.appcode,apiGroup:profile.apiGroup??null,region:profile.region??null,env:profile.env??null,
7
+ credentialsWritten:false}}}const workspaceInitDefinition={service:"workspace",command:"init",description:"Initialize the current workspace app binding",risk:"write",requiresAuth:false,requiresAppCode:false,args:[],flags:workspaceFlags,validate:validateWorkspaceArgs,execute:ctx=>configureWorkspace(ctx,"init")};const workspaceUseDefinition={service:"workspace",command:"use",description:"Switch the current workspace app binding",risk:"write",requiresAuth:false,requiresAppCode:false,args:[],flags:workspaceFlags,validate:validateWorkspaceArgs,execute:ctx=>configureWorkspace(ctx,"use")};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a268_0x436685=a268_0x562d;function a268_0x562d(_0x216df4,_0x5b20f6){_0x216df4=_0x216df4-0x186;const _0x4d224f=a268_0x4d22();let _0x562d70=_0x4d224f[_0x216df4];return _0x562d70;}function a268_0x4d22(){const _0x28580a=['workspace\x20remove','401532hYGgEP','App\x20profile\x20name\x20to\x20remove','13229326oKNRdF','1ZzLERO','156737NkZHLv','918545sxiQKV','182700okyjnw','remove','name','184JpsjtN','1180766xymfho','45IdXbSY','6CTTuZX','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','1162872lmQNZy','write'];a268_0x4d22=function(){return _0x28580a;};return a268_0x4d22();}(function(_0x3ebae0,_0xd398fe){const _0x5a9c71=a268_0x562d,_0x16c004=_0x3ebae0();while(!![]){try{const _0x420356=parseInt(_0x5a9c71(0x192))/0x1*(parseInt(_0x5a9c71(0x188))/0x2)+parseInt(_0x5a9c71(0x18f))/0x3+parseInt(_0x5a9c71(0x18c))/0x4+-parseInt(_0x5a9c71(0x194))/0x5*(-parseInt(_0x5a9c71(0x18a))/0x6)+parseInt(_0x5a9c71(0x193))/0x7*(parseInt(_0x5a9c71(0x187))/0x8)+parseInt(_0x5a9c71(0x189))/0x9*(-parseInt(_0x5a9c71(0x195))/0xa)+-parseInt(_0x5a9c71(0x191))/0xb;if(_0x420356===_0xd398fe)break;else _0x16c004['push'](_0x16c004['shift']());}catch(_0x364f81){_0x16c004['push'](_0x16c004['shift']());}}}(a268_0x4d22,0x6672f));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a268_0x436685(0x196),'description':a268_0x436685(0x18b),'risk':a268_0x436685(0x18d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a268_0x436685(0x186),'description':a268_0x436685(0x190),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x516db9=>validateAppName(_0x516db9,'workspace\x20remove'),'execute':_0x2afa6b=>runAppRemove(_0x2afa6b,a268_0x436685(0x18e))};
1
+ import{buildAppRemoveFlags,runAppRemove,validateAppName}from"../../commands/common/app-registry.js";export const workspaceRemoveDefinition={service:"workspace",command:"remove",description:"Remove an app profile from the current workspace (or --global)",risk:"write",requiresAuth:false,requiresAppCode:false,args:[{name:"name",description:"App profile name to remove",required:true}],flags:buildAppRemoveFlags(),validate:ctx=>validateAppName(ctx,"workspace remove"),execute:ctx=>runAppRemove(ctx,"workspace remove")};
@@ -1 +1,8 @@
1
- function a269_0x515d(_0x2b182c,_0x48d902){_0x2b182c=_0x2b182c-0x119;const _0x50b279=a269_0x50b2();let _0x515d95=_0x50b279[_0x2b182c];return _0x515d95;}const a269_0x71b363=a269_0x515d;(function(_0x5ddaea,_0x4eb6ea){const _0x121873=a269_0x515d,_0x3322ce=_0x5ddaea();while(!![]){try{const _0xf8672a=-parseInt(_0x121873(0x127))/0x1*(parseInt(_0x121873(0x14c))/0x2)+parseInt(_0x121873(0x13f))/0x3+parseInt(_0x121873(0x14a))/0x4*(-parseInt(_0x121873(0x167))/0x5)+parseInt(_0x121873(0x11b))/0x6+-parseInt(_0x121873(0x138))/0x7+-parseInt(_0x121873(0x119))/0x8+parseInt(_0x121873(0x13c))/0x9*(parseInt(_0x121873(0x163))/0xa);if(_0xf8672a===_0x4eb6ea)break;else _0x3322ce['push'](_0x3322ce['shift']());}catch(_0x28d344){_0x3322ce['push'](_0x3322ce['shift']());}}}(a269_0x50b2,0x990c2));import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from'../generated/routing-contract.js';export const DOMAIN_CONFIG_FIELDS=[a269_0x71b363(0x156),a269_0x71b363(0x124),a269_0x71b363(0x15f),a269_0x71b363(0x125),'kbDomain',a269_0x71b363(0x162),a269_0x71b363(0x137),a269_0x71b363(0x14f),'certificateDomain'];function a269_0x50b2(){const _0x21ba28=['app-domain','join','platformDomain','pathname','runtimeDomain','skillHubDomain','\x20without\x20credentials,\x20query,\x20or\x20fragment.','kbServiceDomain','590OdlJzJ','password',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','string','30SZZynq','trim','Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.','kind',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','9316248mnEVLm','keys','5428206fBlDfj','kb-service-domain','Unsupported\x20routing\x20manifest:\x20expected\x20protocol\x20\x22','certificateDomain','cwd','includes','Invalid\x20cdn.','protocol','isArray','apiDomain','skillDomain','origin','1bIxcSv','Enterprise\x20','Update\x20the\x20manifest\x20so\x20both\x20CLIs\x20consume\x20the\x20same\x20routing\x20data.','Enterprise\x20routing\x20manifest\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.',':\x20expected\x20a\x20non-empty\x20HTTPS\x20URL.','Invalid\x20enterprise\x20routing\x20manifest:\x20domains\x20must\x20be\x20an\x20object.','base\x20URL','user-domain','hash','Unsupported\x20domain\x20config\x20field(s):\x20','username','domains','For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.','replace','Enterprise\x20routing\x20manifests\x20cannot\x20be\x20combined\x20with\x20individual\x20Domain\x20flags.','skill-domain','appDomain','2956030rnpfdZ','local-domain','enterprise-v1',':\x20expected\x20an\x20HTTPS\x20','112797BdKWNE','api-domain','Invalid\x20enterprise\x20routing\x20config:\x20expected\x20an\x20object.','3712386lxVgiB','Invalid\x20enterprise\x20routing\x20manifest:\x20cdn\x20must\x20be\x20an\x20object.','Allowed\x20fields:\x20','search','object','Invalid\x20','https:','\x22\x20is\x20not\x20a\x20valid\x20URL.','Unsupported\x20enterprise\x20CDN\x20field(s):\x20','\x20does\x20not\x20provide\x20a\x20Domain\x20for\x20','agentDomain','122892mrFYYk','runtime-domain','967138qgztjt','Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20Domain(s):\x20','filter','localDomain','cdn','\x20and\x20has\x20no\x20default.','\x22\x20and\x20kind\x20\x22',':\x20\x22','validation','Enterprise\x20routing\x20manifest\x20is\x20missing\x20required\x20CDN\x20field(s):\x20','userDomain','length','str','kbDomain','rabetbase-cli'];a269_0x50b2=function(){return _0x21ba28;};return a269_0x50b2();}const DOMAIN_FLAGS={'userDomain':a269_0x71b363(0x12e),'apiDomain':a269_0x71b363(0x13d),'runtimeDomain':a269_0x71b363(0x14b),'skillDomain':a269_0x71b363(0x136),'kbDomain':'kb-domain','kbServiceDomain':a269_0x71b363(0x11c),'appDomain':a269_0x71b363(0x15b),'localDomain':a269_0x71b363(0x139),'certificateDomain':'certificate-domain'};export const LEGACY_DOMAIN_CONFIG_FIELDS=[a269_0x71b363(0x149),a269_0x71b363(0x15d),a269_0x71b363(0x160)];const ENTERPRISE_TO_LOCAL_FIELD={'userDomain':a269_0x71b363(0x156),'apiDomain':a269_0x71b363(0x124),'runtimeDomain':a269_0x71b363(0x15f),'skillDomain':a269_0x71b363(0x125),'kbDomain':a269_0x71b363(0x159),'kbServiceDomain':a269_0x71b363(0x162),'appDomain':a269_0x71b363(0x137),'localDomain':a269_0x71b363(0x14f),'certificateDomain':a269_0x71b363(0x11e)},ROUTING_CONSUMER=a269_0x71b363(0x15a);export function normalizeDomainOrigin(_0x305230,_0x10cd0f){const _0x8800f7=a269_0x71b363;if(typeof _0x10cd0f!==_0x8800f7(0x166)||!_0x10cd0f[_0x8800f7(0x168)]())throw CliErrors[_0x8800f7(0x154)](_0x8800f7(0x144)+_0x305230+_0x8800f7(0x16b));let _0x2f72f7;try{_0x2f72f7=new URL(_0x10cd0f[_0x8800f7(0x168)]());}catch{throw CliErrors[_0x8800f7(0x154)]('Invalid\x20'+_0x305230+':\x20\x22'+_0x10cd0f+_0x8800f7(0x146));}if(_0x2f72f7[_0x8800f7(0x122)]!=='https:'||_0x2f72f7[_0x8800f7(0x131)]||_0x2f72f7[_0x8800f7(0x164)]||_0x2f72f7[_0x8800f7(0x15e)]!=='/'&&_0x2f72f7[_0x8800f7(0x15e)]!==''||_0x2f72f7[_0x8800f7(0x142)]||_0x2f72f7['hash'])throw CliErrors['validation'](_0x8800f7(0x144)+_0x305230+_0x8800f7(0x165),_0x8800f7(0x133));return _0x2f72f7[_0x8800f7(0x126)];}export function normalizeRoutingDomainValue(_0x41af51,_0x46f51a){const _0x26504e=a269_0x71b363;if(typeof _0x46f51a===_0x26504e(0x166))return normalizeDomainOrigin(_0x41af51,_0x46f51a);if(!_0x46f51a||typeof _0x46f51a!==_0x26504e(0x143)||Array['isArray'](_0x46f51a))throw CliErrors[_0x26504e(0x154)](_0x26504e(0x144)+_0x41af51+':\x20expected\x20an\x20HTTPS\x20origin\x20or\x20consumer\x20Domain\x20object.');const _0x49c1e6=_0x46f51a,_0x16b0b8=_0x49c1e6[ROUTING_CONSUMER]??_0x49c1e6['default'];if(_0x16b0b8===undefined)throw CliErrors[_0x26504e(0x154)](_0x26504e(0x128)+_0x41af51+_0x26504e(0x148)+ROUTING_CONSUMER+_0x26504e(0x151));return normalizeDomainOrigin(_0x41af51,_0x16b0b8);}export function normalizeCdnBaseUrl(_0x4a576c,_0x4b6ef7){const _0x4537a2=a269_0x71b363;if(typeof _0x4b6ef7!==_0x4537a2(0x166)||!_0x4b6ef7[_0x4537a2(0x168)]())throw CliErrors[_0x4537a2(0x154)]('Invalid\x20cdn.'+_0x4a576c+_0x4537a2(0x12b));const _0x4549f4=_0x4b6ef7['trim']()[_0x4537a2(0x134)](/\/$/,'');let _0x2154fe;try{_0x2154fe=new URL(_0x4549f4);}catch{throw CliErrors[_0x4537a2(0x154)](_0x4537a2(0x121)+_0x4a576c+_0x4537a2(0x153)+_0x4b6ef7+_0x4537a2(0x146));}if(_0x2154fe[_0x4537a2(0x122)]!==_0x4537a2(0x145)||_0x2154fe[_0x4537a2(0x131)]||_0x2154fe[_0x4537a2(0x164)]||_0x2154fe['search']||_0x2154fe[_0x4537a2(0x12f)]||_0x2154fe['href'][_0x4537a2(0x134)](/\/$/,'')!==_0x4549f4||_0x4a576c==='lovrabet'&&_0x2154fe[_0x4537a2(0x126)]!==_0x4549f4)throw CliErrors[_0x4537a2(0x154)](_0x4537a2(0x121)+_0x4a576c+_0x4537a2(0x13b)+(_0x4a576c==='lovrabet'?_0x4537a2(0x126):_0x4537a2(0x12d))+_0x4537a2(0x161));return _0x4549f4;}export function resolveEnterpriseRoutingConfig(_0x165a89){const _0x1d7ce6=a269_0x71b363;return resolveEnterpriseRoutingManifest(_0x165a89)?.[_0x1d7ce6(0x132)];}export function resolveEnterpriseRoutingManifest(_0x2369a6){const _0xde29f7=a269_0x71b363;if(_0x2369a6===undefined)return undefined;if(!_0x2369a6||typeof _0x2369a6!==_0xde29f7(0x143)||Array[_0xde29f7(0x123)](_0x2369a6))throw CliErrors[_0xde29f7(0x154)](_0xde29f7(0x13e));return parseEnterpriseRoutingManifest(_0x2369a6);}export function readDomainConfigInput(_0x36790b){const _0x27ccaa=a269_0x71b363,_0x205501=isAbsolute(_0x36790b)?_0x36790b:resolve(process[_0x27ccaa(0x11f)](),_0x36790b);if(!existsSync(_0x205501))throw CliErrors[_0x27ccaa(0x154)]('Domain\x20config\x20file\x20not\x20found:\x20'+_0x205501);let _0x42b82c;try{_0x42b82c=JSON['parse'](readFileSync(_0x205501,'utf8'));}catch{throw CliErrors[_0x27ccaa(0x154)]('Invalid\x20domain\x20config\x20JSON:\x20'+_0x205501);}if(!_0x42b82c||typeof _0x42b82c!=='object'||Array[_0x27ccaa(0x123)](_0x42b82c))throw CliErrors[_0x27ccaa(0x154)](_0x27ccaa(0x169));const _0x433da1=_0x42b82c;if(_0x27ccaa(0x122)in _0x433da1)return parseEnterpriseRoutingManifest(_0x433da1);const _0x2b01a1=Object['keys'](_0x433da1)['filter'](_0x39257f=>!DOMAIN_CONFIG_FIELDS[_0x27ccaa(0x120)](_0x39257f));if(_0x2b01a1['length']>0x0)throw CliErrors['validation'](_0x27ccaa(0x130)+_0x2b01a1['join'](',\x20'),_0x27ccaa(0x141)+DOMAIN_CONFIG_FIELDS[_0x27ccaa(0x15c)](',\x20'));const _0x49311f={};for(const _0x346a0b of DOMAIN_CONFIG_FIELDS){_0x433da1[_0x346a0b]!==undefined&&(_0x49311f[_0x346a0b]=normalizeDomainOrigin(_0x346a0b,_0x433da1[_0x346a0b]));}if(Object[_0x27ccaa(0x11a)](_0x49311f)[_0x27ccaa(0x157)]===0x0)throw CliErrors['validation']('Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.');return{'mode':'legacy','domains':_0x49311f};}export function readDomainConfig(_0x1db9dc){const _0x36f03d=a269_0x71b363;return readDomainConfigInput(_0x1db9dc)[_0x36f03d(0x132)];}export function resolveDomainConfigInput(_0x57994f){const _0x4c7c20=a269_0x71b363,_0x27a79f=(_0x57994f[_0x4c7c20(0x158)]('domain-config')||'')[_0x4c7c20(0x168)](),_0x3fe560=_0x27a79f?readDomainConfigInput(_0x27a79f):{'mode':'legacy','domains':{}},_0x1783bd=DOMAIN_CONFIG_FIELDS[_0x4c7c20(0x14e)](_0x89e62b=>Boolean((_0x57994f[_0x4c7c20(0x158)](DOMAIN_FLAGS[_0x89e62b])||'')[_0x4c7c20(0x168)]()));if(_0x3fe560['mode']===_0x4c7c20(0x13a)&&_0x1783bd[_0x4c7c20(0x157)]>0x0)throw CliErrors[_0x4c7c20(0x154)](_0x4c7c20(0x135),_0x4c7c20(0x129));for(const _0x80f5e8 of DOMAIN_CONFIG_FIELDS){const _0x1de840=(_0x57994f[_0x4c7c20(0x158)](DOMAIN_FLAGS[_0x80f5e8])||'')[_0x4c7c20(0x168)]();if(_0x1de840)_0x3fe560[_0x4c7c20(0x132)][_0x80f5e8]=normalizeDomainOrigin(_0x80f5e8,_0x1de840);}return _0x3fe560;}export function resolveDomainFlags(_0xa5b8ef){return resolveDomainConfigInput(_0xa5b8ef)['domains'];}export function parseEnterpriseRoutingManifest(_0x241f6c){const _0x50fada=a269_0x71b363;if(_0x241f6c[_0x50fada(0x122)]!==ENTERPRISE_ROUTING_PROTOCOL||_0x241f6c[_0x50fada(0x16a)]!==ENTERPRISE_ROUTING_KIND)throw CliErrors[_0x50fada(0x154)](_0x50fada(0x11d)+ENTERPRISE_ROUTING_PROTOCOL+_0x50fada(0x152)+ENTERPRISE_ROUTING_KIND+'\x22.');if(!_0x241f6c[_0x50fada(0x132)]||typeof _0x241f6c['domains']!==_0x50fada(0x143)||Array[_0x50fada(0x123)](_0x241f6c[_0x50fada(0x132)]))throw CliErrors[_0x50fada(0x154)](_0x50fada(0x12c));if(!_0x241f6c[_0x50fada(0x150)]||typeof _0x241f6c[_0x50fada(0x150)]!==_0x50fada(0x143)||Array[_0x50fada(0x123)](_0x241f6c[_0x50fada(0x150)]))throw CliErrors['validation'](_0x50fada(0x140));const _0x27f1fa=_0x241f6c[_0x50fada(0x132)],_0x408a73=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS[_0x50fada(0x14e)](_0x427811=>_0x27f1fa[_0x427811]===undefined);if(_0x408a73[_0x50fada(0x157)]>0x0)throw CliErrors[_0x50fada(0x154)](_0x50fada(0x14d)+_0x408a73[_0x50fada(0x15c)](',\x20'));if(_0x27f1fa[_0x50fada(0x14f)]===undefined!==(_0x27f1fa[_0x50fada(0x11e)]===undefined))throw CliErrors[_0x50fada(0x154)](_0x50fada(0x12a));const _0xee0670=_0x241f6c['cdn'],_0x4e0a53=Object[_0x50fada(0x11a)](_0xee0670)['filter'](_0x25c773=>!ENTERPRISE_ROUTING_CDN_FIELDS[_0x50fada(0x120)](_0x25c773));if(_0x4e0a53[_0x50fada(0x157)]>0x0)throw CliErrors[_0x50fada(0x154)](_0x50fada(0x147)+_0x4e0a53[_0x50fada(0x15c)](',\x20'),_0x50fada(0x141)+ENTERPRISE_ROUTING_CDN_FIELDS[_0x50fada(0x15c)](',\x20'));const _0x1caf4f=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS[_0x50fada(0x14e)](_0x1109ba=>_0xee0670[_0x1109ba]===undefined);if(_0x1caf4f[_0x50fada(0x157)]>0x0)throw CliErrors['validation'](_0x50fada(0x155)+_0x1caf4f[_0x50fada(0x15c)](',\x20'));const _0x354c4e={};for(const _0x5af6f6 of ENTERPRISE_ROUTING_CDN_FIELDS){_0x354c4e[_0x5af6f6]=normalizeCdnBaseUrl(_0x5af6f6,_0xee0670[_0x5af6f6]);}const _0x1546a9={},_0x15515b={};for(const _0x501e5d of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const _0x1fd3e4=_0x27f1fa[_0x501e5d];if(_0x1fd3e4===undefined)continue;const _0x251698=normalizeRoutingDomainValue(_0x501e5d,_0x1fd3e4);_0x1546a9[_0x501e5d]=_0x251698;const _0x4b3b50=ENTERPRISE_TO_LOCAL_FIELD[_0x501e5d];_0x4b3b50&&(_0x15515b[_0x4b3b50]=_0x251698);}return{'mode':_0x50fada(0x13a),'domains':_0x15515b,'manifestDomains':_0x1546a9,'cdn':_0x354c4e};}
1
+ import{existsSync,readFileSync}from"node:fs";import{isAbsolute,resolve}from"node:path";import{CliErrors}from"../errors.js";import{ENTERPRISE_ROUTING_CDN_FIELDS,ENTERPRISE_ROUTING_DOMAIN_FIELDS,ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL,REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS,REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS}from"../generated/routing-contract.js";export const DOMAIN_CONFIG_FIELDS=["userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"];const DOMAIN_FLAGS={userDomain:"user-domain",apiDomain:"api-domain",runtimeDomain:"runtime-domain",skillDomain:"skill-domain",kbDomain:"kb-domain",kbServiceDomain:"kb-service-domain",appDomain:"app-domain",localDomain:"local-domain",certificateDomain:"certificate-domain"};export const LEGACY_DOMAIN_CONFIG_FIELDS=["agentDomain","platformDomain","skillHubDomain"];const ENTERPRISE_TO_LOCAL_FIELD={userDomain:"userDomain",apiDomain:"apiDomain",
2
+ runtimeDomain:"runtimeDomain",skillDomain:"skillDomain",kbDomain:"kbDomain",kbServiceDomain:"kbServiceDomain",appDomain:"appDomain",localDomain:"localDomain",certificateDomain:"certificateDomain"};const ROUTING_CONSUMER="rabetbase-cli";export function normalizeDomainOrigin(field,input){if(typeof input!=="string"||!input.trim()){throw CliErrors.validation(`Invalid ${field}: expected a non-empty HTTPS origin.`)}let url;try{url=new URL(input.trim())}catch{throw CliErrors.validation(`Invalid ${field}: "${input}" is not a valid URL.`)}if(url.protocol!=="https:"||url.username||url.password||url.pathname!=="/"&&url.pathname!==""||url.search||url.hash){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin without credentials, path, query, or fragment.`,"For internal deployments, terminate TLS at the ingress, reverse proxy, or load balancer; an internal CA is supported.")}return url.origin}export function normalizeRoutingDomainValue(field,input){
3
+ if(typeof input==="string")return normalizeDomainOrigin(field,input);if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation(`Invalid ${field}: expected an HTTPS origin or consumer Domain object.`)}const source=input;const resolved=source[ROUTING_CONSUMER]??source.default;if(resolved===undefined){throw CliErrors.validation(`Enterprise ${field} does not provide a Domain for ${ROUTING_CONSUMER} and has no default.`)}return normalizeDomainOrigin(field,resolved)}export function normalizeCdnBaseUrl(field,input){if(typeof input!=="string"||!input.trim()){throw CliErrors.validation(`Invalid cdn.${field}: expected a non-empty HTTPS URL.`)}const value=input.trim().replace(/\/$/,"");let url;try{url=new URL(value)}catch{throw CliErrors.validation(`Invalid cdn.${field}: "${input}" is not a valid URL.`)}if(url.protocol!=="https:"||url.username||url.password||url.search||url.hash||url.href.replace(/\/$/,"")!==value||field==="lovrabet"&&url.origin!==value){
4
+ throw CliErrors.validation(`Invalid cdn.${field}: expected an HTTPS ${field==="lovrabet"?"origin":"base URL"} without credentials, query, or fragment.`)}return value}export function resolveEnterpriseRoutingConfig(input){return resolveEnterpriseRoutingManifest(input)?.domains}export function resolveEnterpriseRoutingManifest(input){if(input===undefined)return undefined;if(!input||typeof input!=="object"||Array.isArray(input)){throw CliErrors.validation("Invalid enterprise routing config: expected an object.")}return parseEnterpriseRoutingManifest(input)}export function readDomainConfigInput(filePath){const absolutePath=isAbsolute(filePath)?filePath:resolve(process.cwd(),filePath);if(!existsSync(absolutePath)){throw CliErrors.validation(`Domain config file not found: ${absolutePath}`)}let parsed;try{parsed=JSON.parse(readFileSync(absolutePath,"utf8"))}catch{throw CliErrors.validation(`Invalid domain config JSON: ${absolutePath}`)}
5
+ if(!parsed||typeof parsed!=="object"||Array.isArray(parsed)){throw CliErrors.validation("Invalid domain config: expected a JSON object.")}const source=parsed;if("protocol"in source)return parseEnterpriseRoutingManifest(source);const unknown=Object.keys(source).filter(key=>!DOMAIN_CONFIG_FIELDS.includes(key));if(unknown.length>0){throw CliErrors.validation(`Unsupported domain config field(s): ${unknown.join(", ")}`,`Allowed fields: ${DOMAIN_CONFIG_FIELDS.join(", ")}`)}const result={};for(const field of DOMAIN_CONFIG_FIELDS){if(source[field]!==undefined){result[field]=normalizeDomainOrigin(field,source[field])}}if(Object.keys(result).length===0){throw CliErrors.validation("Invalid domain config: provide at least one supported Domain.")}return{mode:"legacy",domains:result}}export function readDomainConfig(filePath){return readDomainConfigInput(filePath).domains}export function resolveDomainConfigInput(ctx){const filePath=(ctx.str("domain-config")||"").trim()
6
+ ;const input=filePath?readDomainConfigInput(filePath):{mode:"legacy",domains:{}};const explicitFields=DOMAIN_CONFIG_FIELDS.filter(field=>Boolean((ctx.str(DOMAIN_FLAGS[field])||"").trim()));if(input.mode==="enterprise-v1"&&explicitFields.length>0){throw CliErrors.validation("Enterprise routing manifests cannot be combined with individual Domain flags.","Update the manifest so both CLIs consume the same routing data.")}for(const field of DOMAIN_CONFIG_FIELDS){const value=(ctx.str(DOMAIN_FLAGS[field])||"").trim();if(value)input.domains[field]=normalizeDomainOrigin(field,value)}return input}export function resolveDomainFlags(ctx){return resolveDomainConfigInput(ctx).domains}export function parseEnterpriseRoutingManifest(source){if(source.protocol!==ENTERPRISE_ROUTING_PROTOCOL||source.kind!==ENTERPRISE_ROUTING_KIND){throw CliErrors.validation(`Unsupported routing manifest: expected protocol "${ENTERPRISE_ROUTING_PROTOCOL}" and kind "${ENTERPRISE_ROUTING_KIND}".`)}
7
+ if(!source.domains||typeof source.domains!=="object"||Array.isArray(source.domains)){throw CliErrors.validation("Invalid enterprise routing manifest: domains must be an object.")}if(!source.cdn||typeof source.cdn!=="object"||Array.isArray(source.cdn)){throw CliErrors.validation("Invalid enterprise routing manifest: cdn must be an object.")}const rawDomains=source.domains;const missing=REQUIRED_ENTERPRISE_ROUTING_DOMAIN_FIELDS.filter(field=>rawDomains[field]===undefined);if(missing.length>0){throw CliErrors.validation(`Enterprise routing manifest is missing required Domain(s): ${missing.join(", ")}`)}if(rawDomains.localDomain===undefined!==(rawDomains.certificateDomain===undefined)){throw CliErrors.validation("Enterprise routing manifest requires localDomain and certificateDomain together.")}const rawCdn=source.cdn;const unknownCdnFields=Object.keys(rawCdn).filter(field=>!ENTERPRISE_ROUTING_CDN_FIELDS.includes(field));if(unknownCdnFields.length>0){
8
+ throw CliErrors.validation(`Unsupported enterprise CDN field(s): ${unknownCdnFields.join(", ")}`,`Allowed fields: ${ENTERPRISE_ROUTING_CDN_FIELDS.join(", ")}`)}const missingCdnFields=REQUIRED_ENTERPRISE_ROUTING_CDN_FIELDS.filter(field=>rawCdn[field]===undefined);if(missingCdnFields.length>0){throw CliErrors.validation(`Enterprise routing manifest is missing required CDN field(s): ${missingCdnFields.join(", ")}`)}const cdn={};for(const field of ENTERPRISE_ROUTING_CDN_FIELDS){cdn[field]=normalizeCdnBaseUrl(field,rawCdn[field])}const manifestDomains={};const domains={};for(const field of ENTERPRISE_ROUTING_DOMAIN_FIELDS){const value=rawDomains[field];if(value===undefined)continue;const normalized=normalizeRoutingDomainValue(field,value);manifestDomains[field]=normalized;const localField=ENTERPRISE_TO_LOCAL_FIELD[field];if(localField){domains[localField]=normalized}}return{mode:"enterprise-v1",domains:domains,manifestDomains:manifestDomains,cdn:cdn}}
@@ -1 +1,3 @@
1
- const a270_0x3221b9=a270_0x35cb;function a270_0x35cb(_0x4279d4,_0x436e48){_0x4279d4=_0x4279d4-0x11d;const _0x42f866=a270_0x42f8();let _0x35cb98=_0x42f866[_0x4279d4];return _0x35cb98;}(function(_0x35f7b8,_0x7f3fc7){const _0x249252=a270_0x35cb,_0x583745=_0x35f7b8();while(!![]){try{const _0x51134e=-parseInt(_0x249252(0x126))/0x1*(-parseInt(_0x249252(0x123))/0x2)+parseInt(_0x249252(0x11d))/0x3*(-parseInt(_0x249252(0x124))/0x4)+parseInt(_0x249252(0x120))/0x5*(-parseInt(_0x249252(0x11e))/0x6)+-parseInt(_0x249252(0x128))/0x7*(-parseInt(_0x249252(0x127))/0x8)+parseInt(_0x249252(0x129))/0x9+-parseInt(_0x249252(0x12d))/0xa*(-parseInt(_0x249252(0x133))/0xb)+-parseInt(_0x249252(0x130))/0xc*(parseInt(_0x249252(0x125))/0xd);if(_0x51134e===_0x7f3fc7)break;else _0x583745['push'](_0x583745['shift']());}catch(_0x363da1){_0x583745['push'](_0x583745['shift']());}}}(a270_0x42f8,0x59ae9));import{readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{join}from'node:path';import{getActiveRegion,getActiveCdn,getApiDomain,getAppDomain,getCertificateDomain,getKbDomain,getLocalDomain,getRuntimeDomain,getSkillDomain,getUserDomain,isIndependentDeployment}from'../constant/domain.js';function a270_0x42f8(){const _0x1a82ba=['official','pid','36zkRzNz','rabetbase.domain-routing.json','Independent\x20deployment\x20routing\x20requires\x20localDomain\x20and\x20certificateDomain\x20together.','132SQhPal','now','6OwCOBy','6IpLyUU','origin','2800365rlrOru','lovrabet','stringify','2098SrhYLW','179524FGWUXZ','4658888mUEOCe','251GMXHRa','244304dSiYvV','133VSprqC','6248547MadYnN','independent','http://localhost','/cert/lovrabet-dev.json','462080KWPcXv'];a270_0x42f8=function(){return _0x1a82ba;};return a270_0x42f8();}import{getOfficialRoutingProfile}from'../constant/routing-profile.js';export const PROJECT_DOMAIN_ROUTING_FILE_NAME=a270_0x3221b9(0x131);export const PROJECT_DOMAIN_ROUTING_PROTOCOL='lovrabet-project-domain-routing/v1';export function getProjectDomainRoutingManifest(){const _0x247bdc=a270_0x3221b9,_0x3d231c=getActiveRegion(),_0x547998=isIndependentDeployment(),_0x47520b=getOfficialRoutingProfile(_0x3d231c),_0x43d21c=getLocalDomain(),_0x1038b9=getCertificateDomain(),_0x4f0022=getActiveCdn();if(!!_0x43d21c!==!!_0x1038b9)throw new Error(_0x247bdc(0x132));return{'protocol':PROJECT_DOMAIN_ROUTING_PROTOCOL,'mode':_0x547998?_0x247bdc(0x12a):_0x247bdc(0x12e),'region':_0x547998?null:_0x3d231c,'domains':{'api':getApiDomain(),'runtime':getRuntimeDomain(),'user':getUserDomain(),'app':getAppDomain(),'skill':getSkillDomain(),'kb':getKbDomain()},'cdn':_0x4f0022,'local':_0x43d21c&&_0x1038b9?{'origin':_0x43d21c,'certificateUrl':_0x1038b9+_0x247bdc(0x12c)}:_0x547998?{'origin':_0x247bdc(0x12b)}:{'origin':_0x47520b['local'][_0x247bdc(0x11f)],'certificateUrl':_0x4f0022[_0x247bdc(0x121)]+_0x247bdc(0x12c)}};}export function writeProjectDomainRoutingManifest(_0x907d62){const _0xdaab74=a270_0x3221b9,_0x5d846d=getProjectDomainRoutingManifest(),_0x5902d6=join(_0x907d62,PROJECT_DOMAIN_ROUTING_FILE_NAME),_0xc6f09b=JSON[_0xdaab74(0x122)](_0x5d846d,null,0x2)+'\x0a';try{if(readFileSync(_0x5902d6,'utf8')===_0xc6f09b)return{'path':_0x5902d6,'manifest':_0x5d846d,'changed':![]};}catch{}const _0x4f4c4c=_0x5902d6+'.'+process[_0xdaab74(0x12f)]+'.'+Date[_0xdaab74(0x134)]()+'.tmp';try{writeFileSync(_0x4f4c4c,_0xc6f09b,{'encoding':'utf8','mode':0x1a4}),renameSync(_0x4f4c4c,_0x5902d6);}catch(_0xc3ae20){try{unlinkSync(_0x4f4c4c);}catch{}throw _0xc3ae20;}return{'path':_0x5902d6,'manifest':_0x5d846d,'changed':!![]};}
1
+ import{readFileSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{join}from"node:path";import{getActiveRegion,getActiveCdn,getApiDomain,getAppDomain,getCertificateDomain,getKbDomain,getLocalDomain,getRuntimeDomain,getSkillDomain,getUserDomain,isIndependentDeployment}from"../constant/domain.js";import{getOfficialRoutingProfile}from"../constant/routing-profile.js";export const PROJECT_DOMAIN_ROUTING_FILE_NAME="rabetbase.domain-routing.json";export const PROJECT_DOMAIN_ROUTING_PROTOCOL="lovrabet-project-domain-routing/v1";export function getProjectDomainRoutingManifest(){const region=getActiveRegion();const independent=isIndependentDeployment();const officialProfile=getOfficialRoutingProfile(region);const localDomain=getLocalDomain();const certificateDomain=getCertificateDomain();const cdn=getActiveCdn();if(!!localDomain!==!!certificateDomain){throw new Error("Independent deployment routing requires localDomain and certificateDomain together.")}return{
2
+ protocol:PROJECT_DOMAIN_ROUTING_PROTOCOL,mode:independent?"independent":"official",region:independent?null:region,domains:{api:getApiDomain(),runtime:getRuntimeDomain(),user:getUserDomain(),app:getAppDomain(),skill:getSkillDomain(),kb:getKbDomain()},cdn:cdn,local:localDomain&&certificateDomain?{origin:localDomain,certificateUrl:`${certificateDomain}/cert/lovrabet-dev.json`}:independent?{origin:"http://localhost"}:{origin:officialProfile.local.origin,certificateUrl:`${cdn.lovrabet}/cert/lovrabet-dev.json`}}}export function writeProjectDomainRoutingManifest(projectRoot){const manifest=getProjectDomainRoutingManifest();const filePath=join(projectRoot,PROJECT_DOMAIN_ROUTING_FILE_NAME);const content=`${JSON.stringify(manifest,null,2)}\n`;try{if(readFileSync(filePath,"utf8")===content){return{path:filePath,manifest:manifest,changed:false}}}catch{}const tempPath=`${filePath}.${process.pid}.${Date.now()}.tmp`;try{writeFileSync(tempPath,content,{encoding:"utf8",mode:420})
3
+ ;renameSync(tempPath,filePath)}catch(error){try{unlinkSync(tempPath)}catch{}throw error}return{path:filePath,manifest:manifest,changed:true}}
@@ -1 +1,2 @@
1
- const a271_0x3a344d=a271_0x2879;(function(_0x4bbc07,_0x301d84){const _0x2afb50=a271_0x2879,_0x127c8c=_0x4bbc07();while(!![]){try{const _0x4d2e87=parseInt(_0x2afb50(0xc2))/0x1+parseInt(_0x2afb50(0xb9))/0x2*(parseInt(_0x2afb50(0xb8))/0x3)+parseInt(_0x2afb50(0xc0))/0x4+-parseInt(_0x2afb50(0xac))/0x5+-parseInt(_0x2afb50(0xca))/0x6*(-parseInt(_0x2afb50(0xbb))/0x7)+-parseInt(_0x2afb50(0xc8))/0x8+-parseInt(_0x2afb50(0xcb))/0x9*(parseInt(_0x2afb50(0xbc))/0xa);if(_0x4d2e87===_0x301d84)break;else _0x127c8c['push'](_0x127c8c['shift']());}catch(_0x3b3e94){_0x127c8c['push'](_0x127c8c['shift']());}}}(a271_0x4722,0x73fd1));import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_LOVRABET_REGION,isInvalidLovrabetRegion,normalizeLovrabetRegion}from'../constant/region.js';import{CliErrors}from'../errors.js';export function selectConfiguredRegion(_0x5f398f){const _0x40aee7=a271_0x2879;if(_0x5f398f[_0x40aee7(0xc3)]!==undefined&&_0x5f398f[_0x40aee7(0xc3)]!==null&&_0x5f398f[_0x40aee7(0xc3)]!=='')return{'value':_0x5f398f[_0x40aee7(0xc3)],'source':_0x40aee7(0xb1)};if(_0x5f398f[_0x40aee7(0xb4)]!==undefined&&_0x5f398f[_0x40aee7(0xb4)]!==null&&_0x5f398f['projectRegion']!=='')return{'value':_0x5f398f['projectRegion'],'source':'project'};if(_0x5f398f['globalRegion']!==undefined&&_0x5f398f[_0x40aee7(0xc7)]!==null&&_0x5f398f[_0x40aee7(0xc7)]!=='')return{'value':_0x5f398f[_0x40aee7(0xc7)],'source':'global'};if(_0x5f398f['mergedRegion']!==undefined&&_0x5f398f['mergedRegion']!==null&&_0x5f398f[_0x40aee7(0xbe)]!=='')return{'value':_0x5f398f[_0x40aee7(0xbe)],'source':_0x40aee7(0xc6)};return{'value':undefined,'source':_0x40aee7(0xba)};}function describeConfiguredRegion(_0x599a09){const _0x9b101f=a271_0x2879;return typeof _0x599a09===_0x9b101f(0xb2)?JSON[_0x9b101f(0xb6)](_0x599a09):_0x9b101f(0xbd)+(_0x599a09===null?_0x9b101f(0xb7):typeof _0x599a09);}export function resolveConfiguredRegion(_0x1a9a31,_0x367e37=a271_0x3a344d(0xc4)){const _0x26d94d=a271_0x3a344d;if(isInvalidLovrabetRegion(_0x1a9a31))throw CliErrors[_0x26d94d(0xb0)](_0x26d94d(0xad)+describeConfiguredRegion(_0x1a9a31)+'\x20in\x20'+_0x367e37+'.',_0x26d94d(0xbf)+CLI_BIN_NAME+_0x26d94d(0xaf));return normalizeLovrabetRegion(_0x1a9a31)??DEFAULT_LOVRABET_REGION;}export function resolveEffectiveRegion(_0x3164d3){const _0x5c5f02=a271_0x3a344d,_0x38f5b2=selectConfiguredRegion(_0x3164d3),_0x3deec3=_0x38f5b2[_0x5c5f02(0xc1)]==='app'?_0x3164d3['appName']?_0x5c5f02(0xb5)+_0x3164d3['appName']+'\x22':_0x5c5f02(0xb3):_0x38f5b2['source']===_0x5c5f02(0xc5)?'project\x20Rabetbase\x20configuration':_0x38f5b2[_0x5c5f02(0xc1)]===_0x5c5f02(0xc9)?_0x5c5f02(0xae):_0x5c5f02(0xc4);return{'region':resolveConfiguredRegion(_0x38f5b2['value'],_0x3deec3),'source':_0x38f5b2[_0x5c5f02(0xc1)]};}function a271_0x2879(_0x5cf671,_0x5317d3){_0x5cf671=_0x5cf671-0xac;const _0x472221=a271_0x4722();let _0x28791a=_0x472221[_0x5cf671];return _0x28791a;}function a271_0x4722(){const _0x1ab618=['global\x20Rabetbase\x20configuration','\x20doctor`\x20to\x20locate\x20and\x20repair\x20the\x20invalid\x20configuration\x20before\x20retrying.','validation','app','string','selected\x20app\x20profile','projectRegion','app\x20profile\x20\x22','stringify','null','10272DVCqMH','374lqeoNO','default','14LyHvBR','10DxYJCN','a\x20value\x20of\x20type\x20','mergedRegion','Run\x20`','182004UVUIoH','source','911134ygsRRO','appRegion','Rabetbase\x20configuration','project','config','globalRegion','2800296sJobqz','global','1229898vsVTXn','2639772ZcTuLW','4442275hFKIOD','Invalid\x20country/region\x20'];a271_0x4722=function(){return _0x1ab618;};return a271_0x4722();}
1
+ import{CLI_BIN_NAME}from"../constant/cli.js";import{DEFAULT_LOVRABET_REGION,isInvalidLovrabetRegion,normalizeLovrabetRegion}from"../constant/region.js";import{CliErrors}from"../errors.js";export function selectConfiguredRegion(options){if(options.appRegion!==undefined&&options.appRegion!==null&&options.appRegion!==""){return{value:options.appRegion,source:"app"}}if(options.projectRegion!==undefined&&options.projectRegion!==null&&options.projectRegion!==""){return{value:options.projectRegion,source:"project"}}if(options.globalRegion!==undefined&&options.globalRegion!==null&&options.globalRegion!==""){return{value:options.globalRegion,source:"global"}}if(options.mergedRegion!==undefined&&options.mergedRegion!==null&&options.mergedRegion!==""){return{value:options.mergedRegion,source:"config"}}return{value:undefined,source:"default"}}function describeConfiguredRegion(value){return typeof value==="string"?JSON.stringify(value):`a value of type ${value===null?"null":typeof value}`}
2
+ export function resolveConfiguredRegion(value,location="Rabetbase configuration"){if(isInvalidLovrabetRegion(value)){throw CliErrors.validation(`Invalid country/region ${describeConfiguredRegion(value)} in ${location}.`,`Run \`${CLI_BIN_NAME} doctor\` to locate and repair the invalid configuration before retrying.`)}return normalizeLovrabetRegion(value)??DEFAULT_LOVRABET_REGION}export function resolveEffectiveRegion(options){const selected=selectConfiguredRegion(options);const location=selected.source==="app"?options.appName?`app profile "${options.appName}"`:"selected app profile":selected.source==="project"?"project Rabetbase configuration":selected.source==="global"?"global Rabetbase configuration":"Rabetbase configuration";return{region:resolveConfiguredRegion(selected.value,location),source:selected.source}}
@@ -1 +1,7 @@
1
- const a272_0x52ac85=a272_0x26ba;(function(_0x4f8787,_0x4bd9cc){const _0x5637d6=a272_0x26ba,_0x5628bd=_0x4f8787();while(!![]){try{const _0x3bdacc=-parseInt(_0x5637d6(0x197))/0x1*(parseInt(_0x5637d6(0x18d))/0x2)+-parseInt(_0x5637d6(0x1a4))/0x3*(parseInt(_0x5637d6(0x17c))/0x4)+parseInt(_0x5637d6(0x184))/0x5+-parseInt(_0x5637d6(0x1a6))/0x6*(parseInt(_0x5637d6(0x193))/0x7)+-parseInt(_0x5637d6(0x19a))/0x8+parseInt(_0x5637d6(0x191))/0x9*(-parseInt(_0x5637d6(0x1a5))/0xa)+parseInt(_0x5637d6(0x1ad))/0xb;if(_0x3bdacc===_0x4bd9cc)break;else _0x5628bd['push'](_0x5628bd['shift']());}catch(_0x5870f0){_0x5628bd['push'](_0x5628bd['shift']());}}}(a272_0x3799,0xbfb0e));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,isProduction,RABETBASE_ENV_VALUES}from'../constant/env.js';function a272_0x3799(){const _0x35d85b=['App\x20locale\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','trim','3TXjaeq','35390URNOCS','414jaywpB','appcode','apiDir','env','values','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','keys','50910860lLUtQp','number','kbDomain','region','string','kbServiceDomain','Risk\x20level','locale','some','2975204YyouDt','Access\x20key','en-US','apiDomain','pageSize','certificateDomain','cookie','app','5369610qxEUkD','accessKey','object','map','defaultFormat','has','Default\x20page\x20size','Target\x20environment','appDomain','24554icwCuV','defaultApp','API\x20directory\x20path','length','1944UjaJAO','runtimeDomain','148547QGWoIW','format','riskLevel','apps','111ORXwkY','entries','userDomain','4654360AYfEhq','apiGroup','localDomain','filter','inherit','toLowerCase','zh-CN','Join\x20key\x20for\x20app\x20profiles\x20that\x20share\x20one\x20generated\x20API\x20model\x20registry'];a272_0x3799=function(){return _0x35d85b;};return a272_0x3799();}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';import{ENABLED_LOVRABET_REGION_VALUES}from'../constant/region.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a272_0x52ac85(0x182),a272_0x52ac85(0x185),a272_0x52ac85(0x1b4),a272_0x52ac85(0x194),'riskLevel',a272_0x52ac85(0x1b0),'routing',a272_0x52ac85(0x199),a272_0x52ac85(0x17f),a272_0x52ac85(0x192),'skillDomain',a272_0x52ac85(0x1af),a272_0x52ac85(0x1b2),a272_0x52ac85(0x18c),a272_0x52ac85(0x19c),a272_0x52ac85(0x181)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a272_0x52ac85(0x1a7),a272_0x52ac85(0x1a9),'locale',a272_0x52ac85(0x194),'cookie',a272_0x52ac85(0x185),a272_0x52ac85(0x1a8),a272_0x52ac85(0x1b0),a272_0x52ac85(0x199),'apiDomain',a272_0x52ac85(0x192),'skillDomain','kbDomain','kbServiceDomain',a272_0x52ac85(0x18c),a272_0x52ac85(0x19c),a272_0x52ac85(0x181)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES],'region':[...ENABLED_LOVRABET_REGION_VALUES]};export function formatConfigKeyList(_0x244a52){return[..._0x244a52]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x51a3fa){const _0xbb2a6e=a272_0x52ac85;return TOP_LEVEL_CONFIG_KEYS[_0xbb2a6e(0x189)](_0x51a3fa);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'apiGroup':a272_0x52ac85(0x19b),'region':a272_0x52ac85(0x1b0),'env':'env','apiDir':a272_0x52ac85(0x1a8),'cookie':a272_0x52ac85(0x182),'accessKey':a272_0x52ac85(0x185),'defaultFormat':'format','pageSize':a272_0x52ac85(0x180),'riskLevel':a272_0x52ac85(0x195),'locale':a272_0x52ac85(0x1b4)};export function getAppProfileFlagDefs(){const _0x3e5f38=a272_0x52ac85;return[{'name':'apiGroup','type':_0x3e5f38(0x1b1),'description':_0x3e5f38(0x1a1)},{'name':_0x3e5f38(0x1b0),'type':_0x3e5f38(0x1b1),'description':'Country/region\x20for\x20this\x20app\x20profile','enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':'env','type':'string','description':_0x3e5f38(0x18b),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x3e5f38(0x1a8),'type':_0x3e5f38(0x1b1),'description':_0x3e5f38(0x18f)},{'name':_0x3e5f38(0x182),'type':_0x3e5f38(0x1b1),'description':'Auth\x20cookie','hidden':!![]},{'name':_0x3e5f38(0x185),'type':'string','description':_0x3e5f38(0x17d),'hidden':!![]},{'name':_0x3e5f38(0x188),'type':'string','description':_0x3e5f38(0x1ab),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x3e5f38(0x180),'type':_0x3e5f38(0x1ae),'description':_0x3e5f38(0x18a)},{'name':_0x3e5f38(0x195),'type':_0x3e5f38(0x1b1),'description':_0x3e5f38(0x1b3),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x3e5f38(0x1b4),'type':_0x3e5f38(0x1b1),'description':_0x3e5f38(0x1a2)}];}export function collectAppProfileOverrides(_0x3c9500){const _0x2efb18=a272_0x52ac85,_0x102b9d={};for(const [_0x47b6bd,_0x319bb4]of Object[_0x2efb18(0x198)](APP_PROFILE_FLAG_KEY_MAP)){const _0x1aaa15=_0x3c9500(_0x47b6bd);if(!_0x1aaa15)continue;_0x102b9d[_0x319bb4]=_0x319bb4===_0x2efb18(0x180)?Number(_0x1aaa15):_0x1aaa15;}return _0x102b9d;}function a272_0x26ba(_0x29b6a5,_0x5c4ba9){_0x29b6a5=_0x29b6a5-0x17b;const _0x3799d3=a272_0x3799();let _0x26baa7=_0x3799d3[_0x29b6a5];return _0x26baa7;}export function buildAppProfileListFields(_0x32ce05){const _0x629482=a272_0x52ac85;return{'apiGroup':_0x32ce05[_0x629482(0x19b)]??null,'region':_0x32ce05['region']??null,'env':_0x32ce05[_0x629482(0x1a9)]??null,'apiDir':_0x32ce05[_0x629482(0x1a8)]??null,'hasCookie':!!_0x32ce05[_0x629482(0x182)],'hasAccessKey':!!_0x32ce05[_0x629482(0x185)],'format':_0x32ce05[_0x629482(0x194)]??null,'pageSize':_0x32ce05[_0x629482(0x180)]??null,'riskLevel':_0x32ce05[_0x629482(0x195)]??null,'locale':_0x32ce05[_0x629482(0x1b4)]??null};}export function buildAppDoctorFields(_0x34ab42,_0x5c00ee){const _0x41f65f=a272_0x52ac85;return{'region':{'value':_0x34ab42[_0x41f65f(0x1b0)]||_0x5c00ee[_0x41f65f(0x1b0)],'source':_0x34ab42[_0x41f65f(0x1b0)]?'app':_0x41f65f(0x19e)},'env':{'value':_0x34ab42[_0x41f65f(0x1a9)]||_0x5c00ee[_0x41f65f(0x1a9)],'source':_0x34ab42[_0x41f65f(0x1a9)]?'app':_0x41f65f(0x19e)},'apiDir':{'value':_0x34ab42['apiDir']||_0x5c00ee[_0x41f65f(0x1a8)],'source':_0x34ab42[_0x41f65f(0x1a8)]?_0x41f65f(0x183):'inherit'},'cookie':{'value':_0x34ab42[_0x41f65f(0x182)]||_0x5c00ee[_0x41f65f(0x182)],'source':_0x34ab42[_0x41f65f(0x182)]?_0x41f65f(0x183):_0x41f65f(0x19e)},'accessKey':{'value':_0x34ab42['accessKey']||_0x5c00ee[_0x41f65f(0x185)],'source':_0x34ab42[_0x41f65f(0x185)]?_0x41f65f(0x183):_0x41f65f(0x19e)}};}export function buildCanonicalAppConfig(_0x153f72,_0x1c138c){const _0x4c5cdf=a272_0x52ac85,_0x23d4dd=_0x153f72[_0x4c5cdf(0x187)](_0x379e84=>String(_0x379e84||'')[_0x4c5cdf(0x1a3)]())[_0x4c5cdf(0x19d)](Boolean);if(_0x23d4dd[_0x4c5cdf(0x190)]===0x0)return{};const _0x2dc115={};for(const _0xae3ff1 of _0x23d4dd){_0x2dc115[_0xae3ff1]=_0x1c138c&&!isProduction(_0x1c138c)?{'appcode':_0xae3ff1,'env':_0x1c138c}:{'appcode':_0xae3ff1};}return _0x23d4dd[_0x4c5cdf(0x190)]>0x1?{'apps':_0x2dc115,'defaultApp':_0x23d4dd[0x0]}:{'apps':_0x2dc115};}export function normalizeStoredDefaultApp(_0x1a03c8,_0x4f5f87){const _0x51e9ab=a272_0x52ac85,_0x2daaae=_0x1a03c8['apps']&&typeof _0x1a03c8[_0x51e9ab(0x196)]===_0x51e9ab(0x186)?_0x1a03c8[_0x51e9ab(0x196)]:{},_0x3ace60=Object[_0x51e9ab(0x1ac)](_0x2daaae);if(_0x3ace60[_0x51e9ab(0x190)]<=0x1)return delete _0x1a03c8[_0x51e9ab(0x18e)],undefined;const _0x1febd8=typeof _0x1a03c8[_0x51e9ab(0x18e)]===_0x51e9ab(0x1b1)&&_0x2daaae[_0x1a03c8['defaultApp']]?_0x1a03c8[_0x51e9ab(0x18e)]:undefined,_0x29789d=_0x4f5f87&&_0x2daaae[_0x4f5f87]?_0x4f5f87:_0x1febd8;if(_0x29789d)return _0x1a03c8[_0x51e9ab(0x18e)]=_0x29789d,_0x29789d;return delete _0x1a03c8[_0x51e9ab(0x18e)],undefined;}export function buildCanonicalProjectConfig(_0x5d33a8,_0x16004c){const _0x354e8e=a272_0x52ac85,{appCodes:appCodes=[],env:_0x2ca329,metadata:_0x29ed62}=_0x16004c,_0x4be512={..._0x5d33a8,..._0x29ed62||{}};delete _0x4be512[_0x354e8e(0x1a7)],delete _0x4be512['app'];const _0xa271a7=_0x2ca329||(typeof _0x4be512['env']===_0x354e8e(0x1b1)?_0x4be512[_0x354e8e(0x1a9)]:'')||DEFAULT_CONFIG_VALUES[_0x354e8e(0x1a9)];if(isProduction(_0xa271a7))delete _0x4be512[_0x354e8e(0x1a9)];else _0x4be512[_0x354e8e(0x1a9)]=_0xa271a7;const _0x2f6463=buildCanonicalAppConfig(appCodes,_0xa271a7);if(Object[_0x354e8e(0x1ac)](_0x2f6463)[_0x354e8e(0x190)]>0x0){_0x4be512['apps']=_0x2f6463['apps'];if(_0x2f6463[_0x354e8e(0x18e)])_0x4be512[_0x354e8e(0x18e)]=_0x2f6463[_0x354e8e(0x18e)];else delete _0x4be512['defaultApp'];}return normalizeConfigForWrite(_0x4be512);}function isRecord(_0x491257){const _0x6d23ff=a272_0x52ac85;return!!_0x491257&&typeof _0x491257===_0x6d23ff(0x186)&&!Array['isArray'](_0x491257);}export function normalizeConfigForWrite(_0x2a59b5){const _0x3fb67b=a272_0x52ac85,_0x3b69d5={..._0x2a59b5},_0x1fca31=isRecord(_0x2a59b5[_0x3fb67b(0x196)])?_0x2a59b5[_0x3fb67b(0x196)]:undefined,_0x4db719=_0x1fca31?Object['fromEntries'](Object[_0x3fb67b(0x198)](_0x1fca31)['map'](([_0x56ccec,_0x4afad2])=>[_0x56ccec,isRecord(_0x4afad2)?{..._0x4afad2}:_0x4afad2])):undefined;if(_0x4db719){const _0xb8d5e7=typeof _0x3b69d5['env']===_0x3fb67b(0x1b1)?_0x3b69d5['env']:undefined,_0x3b8e23=Object[_0x3fb67b(0x1aa)](_0x4db719)[_0x3fb67b(0x17b)](_0x4dff2c=>isRecord(_0x4dff2c)&&typeof _0x4dff2c[_0x3fb67b(0x1a9)]===_0x3fb67b(0x1b1)&&isProduction(_0x4dff2c[_0x3fb67b(0x1a9)]));if(_0xb8d5e7&&isDaily(_0xb8d5e7)&&_0x3b8e23){for(const _0x41e16f of Object[_0x3fb67b(0x1aa)](_0x4db719)){if(!isRecord(_0x41e16f))continue;if(_0x41e16f[_0x3fb67b(0x1a9)]===undefined)_0x41e16f['env']=_0xb8d5e7;}delete _0x3b69d5[_0x3fb67b(0x1a9)];}for(const _0x281c98 of Object[_0x3fb67b(0x1aa)](_0x4db719)){isRecord(_0x281c98)&&typeof _0x281c98['env']===_0x3fb67b(0x1b1)&&isProduction(_0x281c98[_0x3fb67b(0x1a9)])&&delete _0x281c98[_0x3fb67b(0x1a9)];}_0x3b69d5['apps']=_0x4db719;}return typeof _0x3b69d5[_0x3fb67b(0x1a9)]===_0x3fb67b(0x1b1)&&isProduction(_0x3b69d5[_0x3fb67b(0x1a9)])&&delete _0x3b69d5[_0x3fb67b(0x1a9)],_0x3b69d5;}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a272_0x52ac85(0x1a0),'zh_cn':a272_0x52ac85(0x1a0),'en':'en-US','en-us':'en-US','en_us':a272_0x52ac85(0x17e)};export function normalizeLocale(_0xe40e06){const _0x120640=a272_0x52ac85;if(!_0xe40e06)return null;return LOCALE_MAP[_0xe40e06[_0x120640(0x19f)]()]??null;}
1
+ import{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";import{isDaily,isProduction,RABETBASE_ENV_VALUES}from"../constant/env.js";import{RABETBASE_OUTPUT_FORMAT_VALUES}from"../constant/output.js";import{RISK_LEVEL_VALUES}from"../constant/risk.js";import{ENABLED_LOVRABET_REGION_VALUES}from"../constant/region.js";export{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";export const PROJECT_CREATE_INHERITABLE_KEYS=["cookie","accessKey","locale","format","riskLevel","region","routing","userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"];export const TOP_LEVEL_CONFIG_KEYS=new Set(["appcode","env","locale","format","cookie","accessKey","apiDir","region","userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"]);export const CONFIG_ENUM_VALUES={env:[...RABETBASE_ENV_VALUES],format:[...RABETBASE_OUTPUT_FORMAT_VALUES],
2
+ region:[...ENABLED_LOVRABET_REGION_VALUES]};export function formatConfigKeyList(keys){return[...keys].join(", ")}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS]}export function isTopLevelConfigKey(key){return TOP_LEVEL_CONFIG_KEYS.has(key)}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList())}export function getConfigCommandKeyDescription(){return`Config key (${getTopLevelConfigKeySummary()})`}export const APP_PROFILE_FLAG_KEY_MAP={apiGroup:"apiGroup",region:"region",env:"env",apiDir:"apiDir",cookie:"cookie",accessKey:"accessKey",defaultFormat:"format",pageSize:"pageSize",riskLevel:"riskLevel",locale:"locale"};export function getAppProfileFlagDefs(){return[{name:"apiGroup",type:"string",description:"Join key for app profiles that share one generated API model registry"},{name:"region",type:"string",description:"Country/region for this app profile",enum:[...ENABLED_LOVRABET_REGION_VALUES]},{name:"env",
3
+ type:"string",description:"Target environment",enum:[...RABETBASE_ENV_VALUES]},{name:"apiDir",type:"string",description:"API directory path"},{name:"cookie",type:"string",description:"Auth cookie",hidden:true},{name:"accessKey",type:"string",description:"Access key",hidden:true},{name:"defaultFormat",type:"string",description:"Default output format for this app (profile)",enum:[...RABETBASE_OUTPUT_FORMAT_VALUES]},{name:"pageSize",type:"number",description:"Default page size"},{name:"riskLevel",type:"string",description:"Risk level",enum:[...RISK_LEVEL_VALUES]},{name:"locale",type:"string",description:"App locale (not CLI language; reserved for later app use)"}]}export function collectAppProfileOverrides(getFlagValue){const profile={};for(const[flagKey,profileKey]of Object.entries(APP_PROFILE_FLAG_KEY_MAP)){const val=getFlagValue(flagKey);if(!val)continue;profile[profileKey]=profileKey==="pageSize"?Number(val):val}return profile}export function buildAppProfileListFields(profile){return{
4
+ apiGroup:profile.apiGroup??null,region:profile.region??null,env:profile.env??null,apiDir:profile.apiDir??null,hasCookie:!!profile.cookie,hasAccessKey:!!profile.accessKey,format:profile.format??null,pageSize:profile.pageSize??null,riskLevel:profile.riskLevel??null,locale:profile.locale??null}}export function buildAppDoctorFields(profile,effective){return{region:{value:profile.region||effective.region,source:profile.region?"app":"inherit"},env:{value:profile.env||effective.env,source:profile.env?"app":"inherit"},apiDir:{value:profile.apiDir||effective.apiDir,source:profile.apiDir?"app":"inherit"},cookie:{value:profile.cookie||effective.cookie,source:profile.cookie?"app":"inherit"},accessKey:{value:profile.accessKey||effective.accessKey,source:profile.accessKey?"app":"inherit"}}}export function buildCanonicalAppConfig(appCodes,env){const normalized=appCodes.map(code=>String(code||"").trim()).filter(Boolean);if(normalized.length===0)return{};const apps={};for(const appCode of normalized){
5
+ apps[appCode]=env&&!isProduction(env)?{appcode:appCode,env:env}:{appcode:appCode}}return normalized.length>1?{apps:apps,defaultApp:normalized[0]}:{apps:apps}}export function normalizeStoredDefaultApp(config,preferredApp){const apps=config.apps&&typeof config.apps==="object"?config.apps:{};const names=Object.keys(apps);if(names.length<=1){delete config.defaultApp;return undefined}const current=typeof config.defaultApp==="string"&&apps[config.defaultApp]?config.defaultApp:undefined;const selected=preferredApp&&apps[preferredApp]?preferredApp:current;if(selected){config.defaultApp=selected;return selected}delete config.defaultApp;return undefined}export function buildCanonicalProjectConfig(base,options){const{appCodes:appCodes=[],env:env,metadata:metadata}=options;const config={...base,...metadata||{}};delete config.appcode;delete config.app;const effectiveEnv=env||(typeof config.env==="string"?config.env:"")||DEFAULT_CONFIG_VALUES.env
6
+ ;if(isProduction(effectiveEnv))delete config.env;else config.env=effectiveEnv;const appConfig=buildCanonicalAppConfig(appCodes,effectiveEnv);if(Object.keys(appConfig).length>0){config.apps=appConfig.apps;if(appConfig.defaultApp)config.defaultApp=appConfig.defaultApp;else delete config.defaultApp}return normalizeConfigForWrite(config)}function isRecord(value){return!!value&&typeof value==="object"&&!Array.isArray(value)}export function normalizeConfigForWrite(input){const config={...input};const inputApps=isRecord(input.apps)?input.apps:undefined;const apps=inputApps?Object.fromEntries(Object.entries(inputApps).map(([name,profile])=>[name,isRecord(profile)?{...profile}:profile])):undefined;if(apps){const topLevelEnv=typeof config.env==="string"?config.env:undefined;const hasDefaultOverride=Object.values(apps).some(profile=>isRecord(profile)&&typeof profile.env==="string"&&isProduction(profile.env));if(topLevelEnv&&isDaily(topLevelEnv)&&hasDefaultOverride){
7
+ for(const profile of Object.values(apps)){if(!isRecord(profile))continue;if(profile.env===undefined)profile.env=topLevelEnv}delete config.env}for(const profile of Object.values(apps)){if(isRecord(profile)&&typeof profile.env==="string"&&isProduction(profile.env)){delete profile.env}}config.apps=apps}if(typeof config.env==="string"&&isProduction(config.env)){delete config.env}return config}const LOCALE_MAP={zh:"zh-CN","zh-cn":"zh-CN",zh_cn:"zh-CN",en:"en-US","en-us":"en-US",en_us:"en-US"};export function normalizeLocale(value){if(!value)return null;return LOCALE_MAP[value.toLowerCase()]??null}
@@ -1 +1,2 @@
1
- function a273_0x452d(){const _0x3e61c4=['2JawVIC','sub-app-react-demo-','templates/projects','56758DuxFbF','8227088UJVDmS','185065xmFPNP','140NZHEpG','27779890lyxIej','.zip','4174686YqYkHx','2360937FripHE','131341xrbnGj','84MBcVwK','freeze','https://g.lovrabet.com','rabetbase-cli','sub-app-react-demo-beta.zip'];a273_0x452d=function(){return _0x3e61c4;};return a273_0x452d();}const a273_0x531f43=a273_0x4d76;(function(_0xf106a8,_0x445719){const _0x5e1e07=a273_0x4d76,_0x3ee776=_0xf106a8();while(!![]){try{const _0x310b73=-parseInt(_0x5e1e07(0x102))/0x1+parseInt(_0x5e1e07(0xff))/0x2*(-parseInt(_0x5e1e07(0xf8))/0x3)+-parseInt(_0x5e1e07(0x105))/0x4*(parseInt(_0x5e1e07(0x104))/0x5)+parseInt(_0x5e1e07(0xfa))/0x6*(-parseInt(_0x5e1e07(0xf9))/0x7)+parseInt(_0x5e1e07(0x103))/0x8+-parseInt(_0x5e1e07(0xf7))/0x9+parseInt(_0x5e1e07(0xf5))/0xa;if(_0x310b73===_0x445719)break;else _0x3ee776['push'](_0x3ee776['shift']());}catch(_0x37097f){_0x3ee776['push'](_0x3ee776['shift']());}}}(a273_0x452d,0xe5a67));import{getActiveCdn}from'../constant/domain.js';const RABETBASE_CDN_PROJECT=a273_0x531f43(0xfd),RABETBASE_CDN_CONFIG_ORIGIN=a273_0x531f43(0xfc),CDN_CONFIG_PATH='config/index.json',PROJECT_TEMPLATE_ASSET_PATH=a273_0x531f43(0x101),PROJECT_TEMPLATE_ARCHIVE_NAMES=Object[a273_0x531f43(0xfb)]({'release':'sub-app-react-demo.zip','beta':a273_0x531f43(0xfe)});export const RABETBASE_CDN_PROJECT_PATH='/dist/'+RABETBASE_CDN_PROJECT;function getRabetbaseCdnBaseUrl(){return''+getActiveCdn()['lovrabet']+RABETBASE_CDN_PROJECT_PATH;}function a273_0x4d76(_0x3284b9,_0x2b4394){_0x3284b9=_0x3284b9-0xf5;const _0x452d6e=a273_0x452d();let _0x4d76bc=_0x452d6e[_0x3284b9];return _0x4d76bc;}export function getCliVersionPolicyUrl(){return''+RABETBASE_CDN_CONFIG_ORIGIN+RABETBASE_CDN_PROJECT_PATH+'/'+CDN_CONFIG_PATH;}export function getProjectTemplateAssetBaseUrl(){return getRabetbaseCdnBaseUrl()+'/'+PROJECT_TEMPLATE_ASSET_PATH;}export function getProjectTemplateLegacyAssetBaseUrl(){return''+RABETBASE_CDN_CONFIG_ORIGIN+RABETBASE_CDN_PROJECT_PATH+'/'+PROJECT_TEMPLATE_ASSET_PATH;}export function getProjectTemplateRelativeUrl(_0x2ec157,_0x54ad78){const _0x6170dd=a273_0x531f43,_0x6e3e38=_0x54ad78?_0x6170dd(0x100)+_0x54ad78+_0x6170dd(0xf6):PROJECT_TEMPLATE_ARCHIVE_NAMES[_0x2ec157];return RABETBASE_CDN_PROJECT_PATH+'/'+PROJECT_TEMPLATE_ASSET_PATH+'/'+_0x6e3e38;}
1
+ import{getActiveCdn}from"../constant/domain.js";const RABETBASE_CDN_PROJECT="rabetbase-cli";const RABETBASE_CDN_CONFIG_ORIGIN="https://g.lovrabet.com";const CDN_CONFIG_PATH="config/index.json";const PROJECT_TEMPLATE_ASSET_PATH="templates/projects";const PROJECT_TEMPLATE_ARCHIVE_NAMES=Object.freeze({release:"sub-app-react-demo.zip",beta:"sub-app-react-demo-beta.zip"});export const RABETBASE_CDN_PROJECT_PATH=`/dist/${RABETBASE_CDN_PROJECT}`;function getRabetbaseCdnBaseUrl(){return`${getActiveCdn().lovrabet}${RABETBASE_CDN_PROJECT_PATH}`}export function getCliVersionPolicyUrl(){return`${RABETBASE_CDN_CONFIG_ORIGIN}${RABETBASE_CDN_PROJECT_PATH}/${CDN_CONFIG_PATH}`}export function getProjectTemplateAssetBaseUrl(){return`${getRabetbaseCdnBaseUrl()}/${PROJECT_TEMPLATE_ASSET_PATH}`}export function getProjectTemplateLegacyAssetBaseUrl(){return`${RABETBASE_CDN_CONFIG_ORIGIN}${RABETBASE_CDN_PROJECT_PATH}/${PROJECT_TEMPLATE_ASSET_PATH}`}
2
+ export function getProjectTemplateRelativeUrl(channel,version){const archiveName=version?`sub-app-react-demo-${version}.zip`:PROJECT_TEMPLATE_ARCHIVE_NAMES[channel];return`${RABETBASE_CDN_PROJECT_PATH}/${PROJECT_TEMPLATE_ASSET_PATH}/${archiveName}`}
@@ -1 +1,8 @@
1
- function a274_0x13e4(){const _0x4c8e76=['fromEntries','tags','Comma-separated\x20menu\x20IDs','reveal','name','dataset-code','Verbose\x20output','locale','Target\x20path','Description','non-interactive','Output\x20format','verbose','Flow\x20code','remote','value','Dataset\x20code','format','51062jFPEPY','task-id','Config\x20value','file','Preview\x20operation\x20without\x20executing','sort','Confirm\x20destructive\x20action','Schemas','expectedChildrenCount','flowType','stdin','dry-run','dryRun','sql','rabetbase','SQL\x20string','boolean','Maximum\x20search\x20hits','9AkZRLS','expectPath','clear','2266880BecwmR','5573560wdatmG','expect-path','pagesize','skipImports','all','Force\x20non-interactive\x20mode\x20(CI)','Name','Description\x20file','Select\x20app\x20profile\x20by\x20name','2953348DZxYCP','Menu\x20sort\x20value','sqlcode','Expected\x20affected\x20count','Function\x20node','Read\x20value\x20from\x20stdin','Watch\x20mode','map','label','<name>','query','Expected\x20current\x20menu\x20path','flowStatus','Page\x20size','parentId','topk','appcode','Flow\x20type','Skip\x20confirmation\x20for\x20high-risk\x20writes','codes','operation','watch','Config\x20key','Enable\x20Backend\x20Function\x20save','force','flow-name','code','operation-type','help','Code\x20filter','Operation\x20type','function-node','Flow\x20status','target','meowKey','Environment','menu-ids','expected-count','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Read\x20value\x20from\x20environment\x20variable','db-id','Apply\x20to\x20all','string','production\x20|\x20daily','Parent\x20menu\x20id','<code>','flowCode','Reveal\x20sensitive\x20value','Record\x20ID','datasetCode','global','DB\x20ID','Output\x20path','Keyword\x20filter','SQL\x20name','Search\x20query','output','datasetcode','zh-CN\x20|\x20en-US','flow-code','from-env','operationType','6247746kKqied','3277136rsSVIw','Use\x20remote','flow-status','functionNode','Type\x20filter','params','app','confirm','Menu\x20label','env','Page\x20number','App\x20locale\x20(workspace\x20pass-through;\x20not\x20CLI\x20language)','description-file','schemas','yes','enableBffSave','Alias\x20for\x20--non-interactive','title','@lovrabet/rabetbase-cli','Flow\x20name','keyword','Override\x20appcode','File\x20path','project','881910ACmrvr','expect-parent-id','expected-children-count','dbId','pageSize','Rabetbase\x20CLI','page','<expr>','type','description','Use\x20global\x20config\x20scope','skip-imports'];a274_0x13e4=function(){return _0x4c8e76;};return a274_0x13e4();}const a274_0x2e8707=a274_0x20cc;(function(_0x51a436,_0x28b7c4){const _0x308f88=a274_0x20cc,_0x422ea1=_0x51a436();while(!![]){try{const _0x14a1a9=-parseInt(_0x308f88(0x1c9))/0x1+-parseInt(_0x308f88(0x1e7))/0x2*(-parseInt(_0x308f88(0x165))/0x3)+parseInt(_0x308f88(0x172))/0x4+-parseInt(_0x308f88(0x169))/0x5+parseInt(_0x308f88(0x1b0))/0x6+parseInt(_0x308f88(0x168))/0x7+parseInt(_0x308f88(0x1b1))/0x8;if(_0x14a1a9===_0x28b7c4)break;else _0x422ea1['push'](_0x422ea1['shift']());}catch(_0x2caf00){_0x422ea1['push'](_0x422ea1['shift']());}}}(a274_0x13e4,0x90cb9));export const CLI_BIN_NAME=a274_0x2e8707(0x161);export const CLI_DISPLAY_NAME=a274_0x2e8707(0x1ce);export const NPM_PACKAGE_NAME=a274_0x2e8707(0x1c3);export const GLOBAL_FLAGS=[{'name':a274_0x2e8707(0x182),'meowKey':a274_0x2e8707(0x182),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1c6),'hint':a274_0x2e8707(0x19f)},{'name':a274_0x2e8707(0x1b7),'meowKey':a274_0x2e8707(0x1b7),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x171),'hint':a274_0x2e8707(0x17b)},{'name':a274_0x2e8707(0x1ba),'meowKey':'env','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x195),'hint':a274_0x2e8707(0x19d)},{'name':a274_0x2e8707(0x1e6),'meowKey':a274_0x2e8707(0x1e6),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1e0),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x198),'hint':a274_0x2e8707(0x1d0)},{'name':a274_0x2e8707(0x15e),'meowKey':a274_0x2e8707(0x15f),'type':'boolean','description':a274_0x2e8707(0x1eb)},{'name':a274_0x2e8707(0x1bf),'meowKey':a274_0x2e8707(0x1bf),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x184)},{'name':a274_0x2e8707(0x1df),'meowKey':'nonInteractive','type':'boolean','description':a274_0x2e8707(0x16e)},{'name':'global','meowKey':a274_0x2e8707(0x1a4),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1d3)},{'name':a274_0x2e8707(0x1c8),'meowKey':a274_0x2e8707(0x1c8),'type':a274_0x2e8707(0x163),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1c1),'hidden':!![]},{'name':a274_0x2e8707(0x18e),'meowKey':a274_0x2e8707(0x18e),'type':'boolean','description':'Show\x20help'},{'name':'locale','meowKey':a274_0x2e8707(0x1dc),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1bc),'hidden':!![],'hint':a274_0x2e8707(0x1ac)},{'name':'name','meowKey':a274_0x2e8707(0x1d9),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x16f),'hidden':!![]},{'name':a274_0x2e8707(0x1c2),'meowKey':a274_0x2e8707(0x1c2),'type':a274_0x2e8707(0x19c),'description':'Title','hidden':!![]},{'name':'query','meowKey':a274_0x2e8707(0x17c),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a9),'hidden':!![]},{'name':'topk','meowKey':a274_0x2e8707(0x181),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x164),'hidden':!![]},{'name':a274_0x2e8707(0x167),'meowKey':a274_0x2e8707(0x167),'type':a274_0x2e8707(0x163),'description':'Clear','hidden':!![]},{'name':a274_0x2e8707(0x187),'meowKey':'watch','type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x178),'hidden':!![]},{'name':a274_0x2e8707(0x1aa),'meowKey':'output','type':'string','description':a274_0x2e8707(0x1a6),'hidden':!![]},{'name':a274_0x2e8707(0x1b6),'meowKey':a274_0x2e8707(0x1b6),'type':a274_0x2e8707(0x19c),'description':'JSON\x20params','hidden':!![]},{'name':a274_0x2e8707(0x1ab),'meowKey':a274_0x2e8707(0x1ab),'type':a274_0x2e8707(0x19c),'description':'Dataset\x20code','hidden':!![]},{'name':a274_0x2e8707(0x16d),'meowKey':a274_0x2e8707(0x16d),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x19b),'hidden':!![]},{'name':'enable-bff-save','meowKey':a274_0x2e8707(0x1c0),'type':'boolean','description':a274_0x2e8707(0x189),'hidden':!![]},{'name':'id','meowKey':'id','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a2),'hidden':!![]},{'name':'type','meowKey':'type','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1b5),'hidden':!![]},{'name':a274_0x2e8707(0x1ea),'meowKey':a274_0x2e8707(0x1ea),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1c7),'hidden':!![]},{'name':a274_0x2e8707(0x1ad),'meowKey':a274_0x2e8707(0x1a0),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1e2),'hidden':!![]},{'name':a274_0x2e8707(0x18b),'meowKey':'flowName','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1c4),'hidden':!![]},{'name':a274_0x2e8707(0x1b3),'meowKey':a274_0x2e8707(0x17e),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x192),'hidden':!![]},{'name':'flow-type','meowKey':a274_0x2e8707(0x15c),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x183),'hidden':!![]},{'name':a274_0x2e8707(0x1da),'meowKey':a274_0x2e8707(0x1a3),'type':'string','description':a274_0x2e8707(0x1e5),'hidden':!![]},{'name':a274_0x2e8707(0x174),'meowKey':a274_0x2e8707(0x174),'type':a274_0x2e8707(0x19c),'description':'SQL\x20code','hidden':!![]},{'name':'sql-name','meowKey':'sqlName','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a8),'hidden':!![]},{'name':'sqlname','meowKey':'sqlname','type':'string','description':a274_0x2e8707(0x1a8),'hidden':!![]},{'name':a274_0x2e8707(0x19a),'meowKey':a274_0x2e8707(0x1cc),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a5),'hidden':!![]},{'name':'dbid','meowKey':'dbid','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a5),'hidden':!![]},{'name':a274_0x2e8707(0x1d2),'meowKey':a274_0x2e8707(0x1d2),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1de),'hidden':!![]},{'name':a274_0x2e8707(0x1bd),'meowKey':'descriptionFile','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x170),'hidden':!![]},{'name':a274_0x2e8707(0x1cf),'meowKey':a274_0x2e8707(0x1cf),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1bb),'hidden':!![]},{'name':'page-size','meowKey':a274_0x2e8707(0x1cd),'type':a274_0x2e8707(0x19c),'description':'Page\x20size','hidden':!![]},{'name':a274_0x2e8707(0x16b),'meowKey':a274_0x2e8707(0x16b),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x17f),'hidden':!![]},{'name':a274_0x2e8707(0x1c5),'meowKey':a274_0x2e8707(0x1c5),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1a7),'hidden':!![]},{'name':a274_0x2e8707(0x18c),'meowKey':'code','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x18f),'hidden':!![]},{'name':a274_0x2e8707(0x160),'meowKey':a274_0x2e8707(0x160),'type':'string','description':a274_0x2e8707(0x162),'hidden':!![]},{'name':a274_0x2e8707(0x1be),'meowKey':a274_0x2e8707(0x1be),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1ee),'hidden':!![]},{'name':a274_0x2e8707(0x186),'meowKey':'operation','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x190),'hidden':!![]},{'name':a274_0x2e8707(0x193),'meowKey':a274_0x2e8707(0x193),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1dd),'hidden':!![]},{'name':a274_0x2e8707(0x1d4),'meowKey':a274_0x2e8707(0x16c),'type':a274_0x2e8707(0x163),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':'key','meowKey':'key','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x188),'hidden':!![]},{'name':'value','meowKey':a274_0x2e8707(0x1e4),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1e9),'hidden':!![]},{'name':a274_0x2e8707(0x1d6),'meowKey':a274_0x2e8707(0x1d6),'type':a274_0x2e8707(0x19c),'description':'Tags','hidden':!![]},{'name':a274_0x2e8707(0x15d),'meowKey':a274_0x2e8707(0x15d),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x177),'hidden':!![]},{'name':a274_0x2e8707(0x1ae),'meowKey':'fromEnv','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x199),'hidden':!![]},{'name':a274_0x2e8707(0x1d8),'meowKey':'reveal','type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1a1),'hidden':!![]},{'name':'force','meowKey':a274_0x2e8707(0x18a),'type':a274_0x2e8707(0x163),'description':'Force\x20overwrite','hidden':!![]},{'name':a274_0x2e8707(0x1b8),'meowKey':a274_0x2e8707(0x1b8),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1ed),'hidden':!![]},{'name':'remote','meowKey':a274_0x2e8707(0x1e3),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1b2),'hidden':!![]},{'name':a274_0x2e8707(0x1e1),'meowKey':a274_0x2e8707(0x1e1),'type':a274_0x2e8707(0x163),'description':a274_0x2e8707(0x1db),'hidden':!![]},{'name':a274_0x2e8707(0x197),'meowKey':'expectedCount','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x175),'hidden':!![]},{'name':a274_0x2e8707(0x17a),'meowKey':a274_0x2e8707(0x17a),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1b9),'hidden':!![]},{'name':'parent-id','meowKey':a274_0x2e8707(0x180),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x19e),'hidden':!![]},{'name':a274_0x2e8707(0x1ec),'meowKey':'sort','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x173),'hidden':!![]},{'name':a274_0x2e8707(0x1ca),'meowKey':'expectParentId','type':'string','description':'Expected\x20current\x20parent\x20menu\x20id','hidden':!![]},{'name':a274_0x2e8707(0x16a),'meowKey':a274_0x2e8707(0x166),'type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x17d),'hidden':!![]},{'name':a274_0x2e8707(0x1cb),'meowKey':a274_0x2e8707(0x15b),'type':'string','description':'Expected\x20current\x20child\x20count','hidden':!![]},{'name':a274_0x2e8707(0x196),'meowKey':'menuIds','type':a274_0x2e8707(0x19c),'description':a274_0x2e8707(0x1d7),'hidden':!![]},{'name':a274_0x2e8707(0x1e8),'meowKey':'taskId','type':a274_0x2e8707(0x19c),'description':'Asynchronous\x20task\x20ID','hidden':!![]},{'name':a274_0x2e8707(0x18d),'meowKey':a274_0x2e8707(0x1af),'type':a274_0x2e8707(0x19c),'description':'Operation\x20type','hidden':!![]},{'name':a274_0x2e8707(0x191),'meowKey':a274_0x2e8707(0x1b4),'type':'string','description':a274_0x2e8707(0x176),'hidden':!![]},{'name':'codes','meowKey':a274_0x2e8707(0x185),'type':a274_0x2e8707(0x19c),'description':'Comma-separated\x20metadata\x20codes','hidden':!![]}];function a274_0x20cc(_0x4a71fc,_0x466a08){_0x4a71fc=_0x4a71fc-0x15b;const _0x13e4eb=a274_0x13e4();let _0x20cc57=_0x13e4eb[_0x4a71fc];return _0x20cc57;}export const PIPELINE_FLAG_NAMES=new Set([a274_0x2e8707(0x182),'app','env',a274_0x2e8707(0x1e6),'jq',a274_0x2e8707(0x15e),a274_0x2e8707(0x1bf),a274_0x2e8707(0x1df),'ci']);export function buildMeowFlags(){const _0x3698b5=a274_0x2e8707;return Object[_0x3698b5(0x1d5)](GLOBAL_FLAGS[_0x3698b5(0x179)](_0x439884=>[_0x439884[_0x3698b5(0x194)],{'type':_0x439884[_0x3698b5(0x1d1)]}]));}
1
+ export const CLI_BIN_NAME="rabetbase";export const CLI_DISPLAY_NAME="Rabetbase CLI";export const NPM_PACKAGE_NAME="@lovrabet/rabetbase-cli";export const GLOBAL_FLAGS=[{name:"appcode",meowKey:"appcode",type:"string",description:"Override appcode",hint:"<code>"},{name:"app",meowKey:"app",type:"string",description:"Select app profile by name",hint:"<name>"},{name:"env",meowKey:"env",type:"string",description:"Environment",hint:"production | daily"},{name:"format",meowKey:"format",type:"string",description:"Output format",hint:"json | pretty | compress"},{name:"jq",meowKey:"jq",type:"string",description:"Filter JSON output (JQ_PATH > bundled jq > PATH; use with --format json or compress)",hint:"<expr>"},{name:"dry-run",meowKey:"dryRun",type:"boolean",description:"Preview operation without executing"},{name:"yes",meowKey:"yes",type:"boolean",description:"Skip confirmation for high-risk writes"},{name:"non-interactive",meowKey:"nonInteractive",type:"boolean",
2
+ description:"Force non-interactive mode (CI)"},{name:"global",meowKey:"global",type:"boolean",description:"Use global config scope"},{name:"project",meowKey:"project",type:"boolean",description:"Use project config scope"},{name:"ci",meowKey:"ci",type:"boolean",description:"Alias for --non-interactive",hidden:true},{name:"help",meowKey:"help",type:"boolean",description:"Show help"},{name:"locale",meowKey:"locale",type:"string",description:"App locale (workspace pass-through; not CLI language)",hidden:true,hint:"zh-CN | en-US"},{name:"name",meowKey:"name",type:"string",description:"Name",hidden:true},{name:"title",meowKey:"title",type:"string",description:"Title",hidden:true},{name:"query",meowKey:"query",type:"string",description:"Search query",hidden:true},{name:"topk",meowKey:"topk",type:"string",description:"Maximum search hits",hidden:true},{name:"clear",meowKey:"clear",type:"boolean",description:"Clear",hidden:true},{name:"watch",meowKey:"watch",type:"boolean",
3
+ description:"Watch mode",hidden:true},{name:"output",meowKey:"output",type:"string",description:"Output path",hidden:true},{name:"params",meowKey:"params",type:"string",description:"JSON params",hidden:true},{name:"datasetcode",meowKey:"datasetcode",type:"string",description:"Dataset code",hidden:true},{name:"all",meowKey:"all",type:"boolean",description:"Apply to all",hidden:true},{name:"enable-bff-save",meowKey:"enableBffSave",type:"boolean",description:"Enable Backend Function save",hidden:true},{name:"id",meowKey:"id",type:"string",description:"Record ID",hidden:true},{name:"type",meowKey:"type",type:"string",description:"Type filter",hidden:true},{name:"file",meowKey:"file",type:"string",description:"File path",hidden:true},{name:"flow-code",meowKey:"flowCode",type:"string",description:"Flow code",hidden:true},{name:"flow-name",meowKey:"flowName",type:"string",description:"Flow name",hidden:true},{name:"flow-status",meowKey:"flowStatus",type:"string",description:"Flow status",
4
+ hidden:true},{name:"flow-type",meowKey:"flowType",type:"string",description:"Flow type",hidden:true},{name:"dataset-code",meowKey:"datasetCode",type:"string",description:"Dataset code",hidden:true},{name:"sqlcode",meowKey:"sqlcode",type:"string",description:"SQL code",hidden:true},{name:"sql-name",meowKey:"sqlName",type:"string",description:"SQL name",hidden:true},{name:"sqlname",meowKey:"sqlname",type:"string",description:"SQL name",hidden:true},{name:"db-id",meowKey:"dbId",type:"string",description:"DB ID",hidden:true},{name:"dbid",meowKey:"dbid",type:"string",description:"DB ID",hidden:true},{name:"description",meowKey:"description",type:"string",description:"Description",hidden:true},{name:"description-file",meowKey:"descriptionFile",type:"string",description:"Description file",hidden:true},{name:"page",meowKey:"page",type:"string",description:"Page number",hidden:true},{name:"page-size",meowKey:"pageSize",type:"string",description:"Page size",hidden:true},{name:"pagesize",
5
+ meowKey:"pagesize",type:"string",description:"Page size",hidden:true},{name:"keyword",meowKey:"keyword",type:"string",description:"Keyword filter",hidden:true},{name:"code",meowKey:"code",type:"string",description:"Code filter",hidden:true},{name:"sql",meowKey:"sql",type:"string",description:"SQL string",hidden:true},{name:"schemas",meowKey:"schemas",type:"string",description:"Schemas",hidden:true},{name:"operation",meowKey:"operation",type:"string",description:"Operation type",hidden:true},{name:"target",meowKey:"target",type:"string",description:"Target path",hidden:true},{name:"skip-imports",meowKey:"skipImports",type:"boolean",description:"Skip import generation",hidden:true},{name:"key",meowKey:"key",type:"string",description:"Config key",hidden:true},{name:"value",meowKey:"value",type:"string",description:"Config value",hidden:true},{name:"tags",meowKey:"tags",type:"string",description:"Tags",hidden:true},{name:"stdin",meowKey:"stdin",type:"boolean",
6
+ description:"Read value from stdin",hidden:true},{name:"from-env",meowKey:"fromEnv",type:"string",description:"Read value from environment variable",hidden:true},{name:"reveal",meowKey:"reveal",type:"boolean",description:"Reveal sensitive value",hidden:true},{name:"force",meowKey:"force",type:"boolean",description:"Force overwrite",hidden:true},{name:"confirm",meowKey:"confirm",type:"boolean",description:"Confirm destructive action",hidden:true},{name:"remote",meowKey:"remote",type:"boolean",description:"Use remote",hidden:true},{name:"verbose",meowKey:"verbose",type:"boolean",description:"Verbose output",hidden:true},{name:"expected-count",meowKey:"expectedCount",type:"string",description:"Expected affected count",hidden:true},{name:"label",meowKey:"label",type:"string",description:"Menu label",hidden:true},{name:"parent-id",meowKey:"parentId",type:"string",description:"Parent menu id",hidden:true},{name:"sort",meowKey:"sort",type:"string",description:"Menu sort value",hidden:true},{
7
+ name:"expect-parent-id",meowKey:"expectParentId",type:"string",description:"Expected current parent menu id",hidden:true},{name:"expect-path",meowKey:"expectPath",type:"string",description:"Expected current menu path",hidden:true},{name:"expected-children-count",meowKey:"expectedChildrenCount",type:"string",description:"Expected current child count",hidden:true},{name:"menu-ids",meowKey:"menuIds",type:"string",description:"Comma-separated menu IDs",hidden:true},{name:"task-id",meowKey:"taskId",type:"string",description:"Asynchronous task ID",hidden:true},{name:"operation-type",meowKey:"operationType",type:"string",description:"Operation type",hidden:true},{name:"function-node",meowKey:"functionNode",type:"string",description:"Function node",hidden:true},{name:"codes",meowKey:"codes",type:"string",description:"Comma-separated metadata codes",hidden:true}];export const PIPELINE_FLAG_NAMES=new Set(["appcode","app","env","format","jq","dry-run","yes","non-interactive","ci"])
8
+ ;export function buildMeowFlags(){return Object.fromEntries(GLOBAL_FLAGS.map(f=>[f.meowKey,{type:f.type}]))}
@@ -1 +1 @@
1
- const a275_0x14e7e1=a275_0x146b;(function(_0x51fcf5,_0x423c7e){const _0x284544=a275_0x146b,_0x377ed8=_0x51fcf5();while(!![]){try{const _0x24723b=parseInt(_0x284544(0xd3))/0x1+-parseInt(_0x284544(0xd1))/0x2+-parseInt(_0x284544(0xca))/0x3+parseInt(_0x284544(0xcf))/0x4+-parseInt(_0x284544(0xcc))/0x5*(parseInt(_0x284544(0xce))/0x6)+-parseInt(_0x284544(0xd2))/0x7*(-parseInt(_0x284544(0xd0))/0x8)+parseInt(_0x284544(0xd4))/0x9*(parseInt(_0x284544(0xcd))/0xa);if(_0x24723b===_0x423c7e)break;else _0x377ed8['push'](_0x377ed8['shift']());}catch(_0x1e0578){_0x377ed8['push'](_0x377ed8['shift']());}}}(a275_0x4c1b,0x62349));function a275_0x4c1b(){const _0x431d22=['2235460UfeQiw','1292360MmVdmT','1000474DRVBWh','7SAtnZB','432705XhqoLQ','9340983urwpPs','production','1852260VmFMJT','write','1490lodTje','10nUjItp','13512qiJDLz'];a275_0x4c1b=function(){return _0x431d22;};return a275_0x4c1b();}import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a275_0x14e7e1(0xd5),'format':'compress','locale':'en-US','riskLevel':a275_0x14e7e1(0xcb),'apiDir':DEFAULT_API_DIR};function a275_0x146b(_0x246bc8,_0x57ce0f){_0x246bc8=_0x246bc8-0xca;const _0x4c1ba0=a275_0x4c1b();let _0x146bc1=_0x4c1ba0[_0x246bc8];return _0x146bc1;}export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';
1
+ import{DEFAULT_API_DIR}from"../constant/paths.js";export const DEFAULT_CONFIG_VALUES={env:"production",format:"compress",locale:"en-US",riskLevel:"write",apiDir:DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT="compress";
@@ -1 +1,4 @@
1
- const a276_0x4a6f93=a276_0x58de;(function(_0x46dde9,_0xeeaa77){const _0x12273c=a276_0x58de,_0x4b8d49=_0x46dde9();while(!![]){try{const _0x389954=parseInt(_0x12273c(0x1a4))/0x1+-parseInt(_0x12273c(0x1b0))/0x2*(-parseInt(_0x12273c(0x1b4))/0x3)+-parseInt(_0x12273c(0x1bf))/0x4+parseInt(_0x12273c(0x1ae))/0x5+parseInt(_0x12273c(0x1a9))/0x6*(parseInt(_0x12273c(0x1b3))/0x7)+-parseInt(_0x12273c(0x1b1))/0x8*(-parseInt(_0x12273c(0x1b2))/0x9)+-parseInt(_0x12273c(0x1a5))/0xa;if(_0x389954===_0xeeaa77)break;else _0x4b8d49['push'](_0x4b8d49['shift']());}catch(_0x59a7e0){_0x4b8d49['push'](_0x4b8d49['shift']());}}}(a276_0x2dd6,0xde97e));import{getEnv,isProduction}from'../constant/env.js';import{DEFAULT_LOVRABET_REGION}from'../constant/region.js';import{getOfficialRoutingCdn,getOfficialRoutingProfile}from'../constant/routing-profile.js';let customApiDomain,customUserDomain,customRuntimeDomain,customSkillDomain,customKbDomain,customKbServiceDomain,allowOfficialKbServiceDefault=!![],customAppDomain,customLocalDomain,customCertificateDomain,customCdn,activeRegion=DEFAULT_LOVRABET_REGION;function getActiveRegionDomains(){const _0xf0b113=a276_0x58de,_0x246ac4=getOfficialRoutingProfile(activeRegion);return isProduction(getEnv())?_0x246ac4[_0xf0b113(0x1bb)]['production']:_0x246ac4[_0xf0b113(0x1bb)][_0xf0b113(0x1aa)]??_0x246ac4[_0xf0b113(0x1bb)][_0xf0b113(0x1ba)];}export function initDomains(_0x954e73){const _0x5f3064=a276_0x58de;customApiDomain=_0x954e73?.[_0x5f3064(0x1ad)],customUserDomain=_0x954e73?.['userDomain'],customRuntimeDomain=_0x954e73?.[_0x5f3064(0x1c0)],customSkillDomain=_0x954e73?.['skillDomain'],customKbDomain=_0x954e73?.[_0x5f3064(0x1b6)],customKbServiceDomain=_0x954e73?.['kbServiceDomain'],allowOfficialKbServiceDefault=_0x954e73?.[_0x5f3064(0x1b8)]??!![],customAppDomain=_0x954e73?.[_0x5f3064(0x1b7)],customLocalDomain=_0x954e73?.['localDomain'],customCertificateDomain=_0x954e73?.[_0x5f3064(0x1a6)],customCdn=_0x954e73?.[_0x5f3064(0x1be)],activeRegion=_0x954e73?.[_0x5f3064(0x1a7)]??DEFAULT_LOVRABET_REGION;}export const getUserDomain=()=>customUserDomain||getActiveRegionDomains()[a276_0x4a6f93(0x1bc)];export const getApiDomain=()=>customApiDomain||getActiveRegionDomains()[a276_0x4a6f93(0x1af)];export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains()[a276_0x4a6f93(0x1ab)];export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains()[a276_0x4a6f93(0x1ac)];export const getKbDomain=()=>customKbDomain||customApiDomain||getActiveRegionDomains()['kb'];export const getKbServiceDomain=()=>{const _0x53348b=a276_0x4a6f93;if(customKbServiceDomain)return customKbServiceDomain;if(!allowOfficialKbServiceDefault)return undefined;return getActiveRegionDomains()[_0x53348b(0x1b9)];};export const getAppDomain=()=>customAppDomain||getActiveRegionDomains()[a276_0x4a6f93(0x1b5)];export const getActiveRegion=()=>activeRegion;export const getLocalDomain=()=>customLocalDomain;function a276_0x58de(_0x1bb117,_0x3946d1){_0x1bb117=_0x1bb117-0x1a3;const _0x2dd6aa=a276_0x2dd6();let _0x58dec7=_0x2dd6aa[_0x1bb117];return _0x58dec7;}export const getCertificateDomain=()=>customCertificateDomain;export const getActiveCdn=()=>customCdn||getOfficialRoutingCdn(activeRegion);export function isIndependentDeployment(){return!!(customApiDomain||customUserDomain||customRuntimeDomain||customSkillDomain||customKbDomain||customAppDomain||customLocalDomain||customCertificateDomain);}function a276_0x2dd6(){const _0x54029c=['6534102vMvnhw','daily','runtime','skill','apiDomain','3895895gCbWkB','api','2cLApBz','3143384XZbled','9GbruKH','7IWxqcJ','862275fdbWji','app','kbDomain','appDomain','allowOfficialKbServiceDefault','kbService','production','serviceDomains','user','trim','cdn','6043840SrLKGt','runtimeDomain','/web-app/app/','920747kaLVab','10465890vIJCcZ','certificateDomain','region','hostname'];a276_0x2dd6=function(){return _0x54029c;};return a276_0x2dd6();}export function getSdkClientRoutingConfig(){const _0x4bc031=a276_0x4a6f93;if(customRuntimeDomain&&customRuntimeDomain!==getActiveRegionDomains()[_0x4bc031(0x1ab)])return{'runtimeDomain':customRuntimeDomain};if(activeRegion!==DEFAULT_LOVRABET_REGION)return{'runtimeDomain':getRuntimeDomain()};return{};}export const getAppBaseUrl=_0x36cf25=>{const _0x360e49=a276_0x4a6f93,_0x59b280=encodeURIComponent(_0x36cf25[_0x360e49(0x1bd)]());return isProduction(getEnv())?getAppDomain()+'/app/'+_0x59b280:getAppDomain()+_0x360e49(0x1a3)+_0x59b280;};export const getPublishedAppDomain=_0x18b30b=>{const _0x2a4ecc=a276_0x4a6f93,_0x163e16=new URL(getAppDomain());return _0x163e16[_0x2a4ecc(0x1a8)]=_0x18b30b[_0x2a4ecc(0x1bd)]()+'.'+_0x163e16[_0x2a4ecc(0x1a8)],_0x163e16['origin'];};
1
+ import{getEnv,isProduction}from"../constant/env.js";import{DEFAULT_LOVRABET_REGION}from"../constant/region.js";import{getOfficialRoutingCdn,getOfficialRoutingProfile}from"../constant/routing-profile.js";let customApiDomain;let customUserDomain;let customRuntimeDomain;let customSkillDomain;let customKbDomain;let customKbServiceDomain;let allowOfficialKbServiceDefault=true;let customAppDomain;let customLocalDomain;let customCertificateDomain;let customCdn;let activeRegion=DEFAULT_LOVRABET_REGION;function getActiveRegionDomains(){const profile=getOfficialRoutingProfile(activeRegion);return isProduction(getEnv())?profile.serviceDomains.production:profile.serviceDomains.daily??profile.serviceDomains.production}export function initDomains(domains){customApiDomain=domains?.apiDomain;customUserDomain=domains?.userDomain;customRuntimeDomain=domains?.runtimeDomain;customSkillDomain=domains?.skillDomain;customKbDomain=domains?.kbDomain;customKbServiceDomain=domains?.kbServiceDomain
2
+ ;allowOfficialKbServiceDefault=domains?.allowOfficialKbServiceDefault??true;customAppDomain=domains?.appDomain;customLocalDomain=domains?.localDomain;customCertificateDomain=domains?.certificateDomain;customCdn=domains?.cdn;activeRegion=domains?.region??DEFAULT_LOVRABET_REGION}export const getUserDomain=()=>customUserDomain||getActiveRegionDomains().user;export const getApiDomain=()=>customApiDomain||getActiveRegionDomains().api;export const getRuntimeDomain=()=>customRuntimeDomain||getActiveRegionDomains().runtime;export const getSkillDomain=()=>customSkillDomain||getActiveRegionDomains().skill;export const getKbDomain=()=>customKbDomain||customApiDomain||getActiveRegionDomains().kb;export const getKbServiceDomain=()=>{if(customKbServiceDomain)return customKbServiceDomain;if(!allowOfficialKbServiceDefault)return undefined;return getActiveRegionDomains().kbService};export const getAppDomain=()=>customAppDomain||getActiveRegionDomains().app;export const getActiveRegion=()=>activeRegion
3
+ ;export const getLocalDomain=()=>customLocalDomain;export const getCertificateDomain=()=>customCertificateDomain;export const getActiveCdn=()=>customCdn||getOfficialRoutingCdn(activeRegion);export function isIndependentDeployment(){return!!(customApiDomain||customUserDomain||customRuntimeDomain||customSkillDomain||customKbDomain||customAppDomain||customLocalDomain||customCertificateDomain)}export function getSdkClientRoutingConfig(){if(customRuntimeDomain&&customRuntimeDomain!==getActiveRegionDomains().runtime){return{runtimeDomain:customRuntimeDomain}}if(activeRegion!==DEFAULT_LOVRABET_REGION){return{runtimeDomain:getRuntimeDomain()}}return{}}export const getAppBaseUrl=appCode=>{const encodedAppCode=encodeURIComponent(appCode.trim());return isProduction(getEnv())?`${getAppDomain()}/app/${encodedAppCode}`:`${getAppDomain()}/web-app/app/${encodedAppCode}`};export const getPublishedAppDomain=appCode=>{const appUrl=new URL(getAppDomain())
4
+ ;appUrl.hostname=`${appCode.trim()}.${appUrl.hostname}`;return appUrl.origin};
@@ -1 +1 @@
1
- const a277_0x1570e2=a277_0x469a;(function(_0x31d4a5,_0x2a9fe6){const _0x224fbf=a277_0x469a,_0x4efb02=_0x31d4a5();while(!![]){try{const _0x1b9db2=-parseInt(_0x224fbf(0x11e))/0x1*(-parseInt(_0x224fbf(0x11a))/0x2)+-parseInt(_0x224fbf(0x124))/0x3*(parseInt(_0x224fbf(0x123))/0x4)+-parseInt(_0x224fbf(0x11f))/0x5*(parseInt(_0x224fbf(0x126))/0x6)+-parseInt(_0x224fbf(0x11b))/0x7+-parseInt(_0x224fbf(0x120))/0x8*(parseInt(_0x224fbf(0x125))/0x9)+parseInt(_0x224fbf(0x11d))/0xa+-parseInt(_0x224fbf(0x127))/0xb*(-parseInt(_0x224fbf(0x11c))/0xc);if(_0x1b9db2===_0x2a9fe6)break;else _0x4efb02['push'](_0x4efb02['shift']());}catch(_0x46e7f6){_0x4efb02['push'](_0x4efb02['shift']());}}}(a277_0x56a1,0x40ef2));export const RABETBASE_ENV_VALUES=[a277_0x1570e2(0x119),a277_0x1570e2(0x121)];export function normalizeEnv(_0x5276f2){const _0x14db04=a277_0x1570e2;return _0x5276f2===_0x14db04(0x118)?_0x14db04(0x119):_0x5276f2;}function a277_0x56a1(){const _0x1e17c=['3656387lSCQEp','12BpwVDn','2326600YdyLYh','198IlKpub','5dkfAyc','24MhEKLl','daily','development','1044YdQNrn','876PvtcpB','196353YuxoTy','1227282tZskGf','8890277XSFwPM','online','production','946qDMLXd'];a277_0x56a1=function(){return _0x1e17c;};return a277_0x56a1();}export function isProduction(_0x78ba0a){const _0x18b01d=a277_0x1570e2;return normalizeEnv(_0x78ba0a)===_0x18b01d(0x119);}export function isDaily(_0x143add){const _0x52d082=a277_0x1570e2;return normalizeEnv(_0x143add)===_0x52d082(0x121);}export function isDev(_0x5ee8c6){const _0x52ad2c=a277_0x1570e2,_0x4faa26=normalizeEnv(_0x5ee8c6);return _0x4faa26===_0x52ad2c(0x122)||_0x4faa26==='dev';}function a277_0x469a(_0x313b93,_0x4a1063){_0x313b93=_0x313b93-0x118;const _0x56a13b=a277_0x56a1();let _0x469a5f=_0x56a13b[_0x313b93];return _0x469a5f;}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a277_0x1570e2(0x119));export function getEnv(){return env;}export function initEnv(_0x522240){env=normalizeEnv(_0x522240);}
1
+ export const RABETBASE_ENV_VALUES=["production","daily"];export function normalizeEnv(e){return e==="online"?"production":e}export function isProduction(e){return normalizeEnv(e)==="production"}export function isDaily(e){return normalizeEnv(e)==="daily"}export function isDev(e){const c=normalizeEnv(e);return c==="development"||c==="dev"}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||"production");export function getEnv(){return env}export function initEnv(_env){env=normalizeEnv(_env)}
@@ -1 +1 @@
1
- const a278_0x4379fc=a278_0x1945;function a278_0x1945(_0x1a5439,_0x3dad3f){_0x1a5439=_0x1a5439-0x175;const _0x381b89=a278_0x381b();let _0x19453e=_0x381b89[_0x1a5439];return _0x19453e;}(function(_0x5a35c6,_0x46fcc9){const _0x1e5476=a278_0x1945,_0x2ceed3=_0x5a35c6();while(!![]){try{const _0x1ab84d=parseInt(_0x1e5476(0x17c))/0x1+parseInt(_0x1e5476(0x17b))/0x2*(parseInt(_0x1e5476(0x176))/0x3)+-parseInt(_0x1e5476(0x17a))/0x4+-parseInt(_0x1e5476(0x17e))/0x5*(-parseInt(_0x1e5476(0x175))/0x6)+-parseInt(_0x1e5476(0x180))/0x7+-parseInt(_0x1e5476(0x177))/0x8*(parseInt(_0x1e5476(0x179))/0x9)+-parseInt(_0x1e5476(0x17f))/0xa*(parseInt(_0x1e5476(0x182))/0xb);if(_0x1ab84d===_0x46fcc9)break;else _0x2ceed3['push'](_0x2ceed3['shift']());}catch(_0x5df1c9){_0x2ceed3['push'](_0x2ceed3['shift']());}}}(a278_0x381b,0x1c42c));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a278_0x4379fc(0x178),a278_0x4379fc(0x181),a278_0x4379fc(0x17d)];function a278_0x381b(){const _0x4a057e=['50khZYJe','919961LGOkBP','pretty','33847maMQrp','12NTSqbG','18879cIdGRS','1099944ATvnut','json','9jcnPDn','344776TEvbiX','58oGgzVM','102836ZfWHpz','compress','502295cxrpeI'];a278_0x381b=function(){return _0x4a057e;};return a278_0x381b();}
1
+ export const RABETBASE_OUTPUT_FORMAT_VALUES=["json","pretty","compress"];
@@ -1 +1 @@
1
- const a279_0x22e26e=a279_0x1d5e;(function(_0x563371,_0x12c965){const _0x49069b=a279_0x1d5e,_0x3c15b6=_0x563371();while(!![]){try{const _0x29555b=parseInt(_0x49069b(0x1d0))/0x1+parseInt(_0x49069b(0x1d3))/0x2*(-parseInt(_0x49069b(0x1ce))/0x3)+parseInt(_0x49069b(0x1d6))/0x4*(parseInt(_0x49069b(0x1cb))/0x5)+-parseInt(_0x49069b(0x1d2))/0x6*(-parseInt(_0x49069b(0x1cc))/0x7)+-parseInt(_0x49069b(0x1ca))/0x8*(-parseInt(_0x49069b(0x1cd))/0x9)+parseInt(_0x49069b(0x1d1))/0xa*(-parseInt(_0x49069b(0x1d4))/0xb)+-parseInt(_0x49069b(0x1d5))/0xc;if(_0x29555b===_0x12c965)break;else _0x3c15b6['push'](_0x3c15b6['shift']());}catch(_0x579222){_0x3c15b6['push'](_0x3c15b6['shift']());}}}(a279_0x5afb,0xa4079));export const DEFAULT_API_DIR=a279_0x22e26e(0x1cf);function a279_0x1d5e(_0x434a5e,_0x743967){_0x434a5e=_0x434a5e-0x1ca;const _0x5afb93=a279_0x5afb();let _0x1d5edb=_0x5afb93[_0x434a5e];return _0x1d5edb;}function a279_0x5afb(){const _0x2d0330=['2314230cjUOHx','7IZkIFW','9UsYEgJ','9HuorEl','./src/api','946408AuRhjj','133450Vqzbxa','6479580oaoLqF','140846hltoQU','319TeMMxL','22203180ZyxeQY','4aeQFty','5049760RMGXgJ'];a279_0x5afb=function(){return _0x2d0330;};return a279_0x5afb();}
1
+ export const DEFAULT_API_DIR="./src/api";
@@ -1 +1 @@
1
- function a280_0x398e(){const _0x2c6366=['20PDxShx','9945rmPHlc','string','3882582xujKUq','5seJawL','242743PWBayP','1539004OuhRsT','747928VUeblJ','includes','2AqEmcW','2269908MVdrDA','6106078htloiW','21NThMer'];a280_0x398e=function(){return _0x2c6366;};return a280_0x398e();}(function(_0x150d60,_0xb191b9){const _0x59534b=a280_0x3685,_0x8f43ae=_0x150d60();while(!![]){try{const _0x1d2cc0=-parseInt(_0x59534b(0xcf))/0x1*(parseInt(_0x59534b(0xd3))/0x2)+parseInt(_0x59534b(0xcb))/0x3+-parseInt(_0x59534b(0xd0))/0x4+parseInt(_0x59534b(0xce))/0x5*(-parseInt(_0x59534b(0xc7))/0x6)+-parseInt(_0x59534b(0xc9))/0x7*(parseInt(_0x59534b(0xd1))/0x8)+parseInt(_0x59534b(0xcd))/0x9+parseInt(_0x59534b(0xca))/0xa*(parseInt(_0x59534b(0xc8))/0xb);if(_0x1d2cc0===_0xb191b9)break;else _0x8f43ae['push'](_0x8f43ae['shift']());}catch(_0xfb1d89){_0x8f43ae['push'](_0x8f43ae['shift']());}}}(a280_0x398e,0x3f240));import{DEFAULT_REGION,ENABLED_REGION_VALUES,REGION_ALIASES,REGION_VALUES}from'../generated/official-routing.js';function a280_0x3685(_0x4de7f9,_0x416ff9){_0x4de7f9=_0x4de7f9-0xc7;const _0x398e18=a280_0x398e();let _0x3685e6=_0x398e18[_0x4de7f9];return _0x3685e6;}export const LOVRABET_REGION_VALUES=REGION_VALUES;export const ENABLED_LOVRABET_REGION_VALUES=ENABLED_REGION_VALUES;export const DEFAULT_LOVRABET_REGION=DEFAULT_REGION;export function isLovrabetRegion(_0x2b8e38){const _0x3b8b39=a280_0x3685;return typeof _0x2b8e38===_0x3b8b39(0xcc)&&LOVRABET_REGION_VALUES[_0x3b8b39(0xd2)](_0x2b8e38);}export function isEnabledLovrabetRegion(_0x51c30b){const _0x3364c4=a280_0x3685;return typeof _0x51c30b===_0x3364c4(0xcc)&&ENABLED_LOVRABET_REGION_VALUES[_0x3364c4(0xd2)](_0x51c30b);}export function normalizeLovrabetRegion(_0x55b6a2){if(typeof _0x55b6a2!=='string')return undefined;const _0x2e3c8e=REGION_ALIASES[_0x55b6a2]??_0x55b6a2;return isLovrabetRegion(_0x2e3c8e)?_0x2e3c8e:undefined;}export function isInvalidLovrabetRegion(_0x305c09){return _0x305c09!==undefined&&_0x305c09!==null&&_0x305c09!==''&&normalizeLovrabetRegion(_0x305c09)===undefined;}
1
+ import{DEFAULT_REGION,ENABLED_REGION_VALUES,REGION_ALIASES,REGION_VALUES}from"../generated/official-routing.js";export const LOVRABET_REGION_VALUES=REGION_VALUES;export const ENABLED_LOVRABET_REGION_VALUES=ENABLED_REGION_VALUES;export const DEFAULT_LOVRABET_REGION=DEFAULT_REGION;export function isLovrabetRegion(value){return typeof value==="string"&&LOVRABET_REGION_VALUES.includes(value)}export function isEnabledLovrabetRegion(value){return typeof value==="string"&&ENABLED_LOVRABET_REGION_VALUES.includes(value)}export function normalizeLovrabetRegion(value){if(typeof value!=="string")return undefined;const normalized=REGION_ALIASES[value]??value;return isLovrabetRegion(normalized)?normalized:undefined}export function isInvalidLovrabetRegion(value){return value!==undefined&&value!==null&&value!==""&&normalizeLovrabetRegion(value)===undefined}
@@ -1 +1 @@
1
- function a281_0x3975(_0x19fc30,_0x4a47cc){_0x19fc30=_0x19fc30-0xb1;const _0x562f4a=a281_0x562f();let _0x397544=_0x562f4a[_0x19fc30];return _0x397544;}const a281_0x186d7e=a281_0x3975;function a281_0x562f(){const _0x4c3ba6=['14795gxiBfk','4650tbtmvj','40edvamY','7169260vJdmMd','598922sZFtIt','read','8mDZFrZ','121666KxcOJx','30yIQWpH','284932NpLzFb','write','high-risk-write','8061132BxKmgN','9335520Snsvmd'];a281_0x562f=function(){return _0x4c3ba6;};return a281_0x562f();}(function(_0x1d05dc,_0x1780ed){const _0x15cabf=a281_0x3975,_0x63ee0c=_0x1d05dc();while(!![]){try{const _0x11b765=parseInt(_0x15cabf(0xbd))/0x1+parseInt(_0x15cabf(0xb2))/0x2*(parseInt(_0x15cabf(0xb3))/0x3)+-parseInt(_0x15cabf(0xb4))/0x4*(parseInt(_0x15cabf(0xbb))/0x5)+-parseInt(_0x15cabf(0xb7))/0x6+parseInt(_0x15cabf(0xbc))/0x7+parseInt(_0x15cabf(0xb1))/0x8*(parseInt(_0x15cabf(0xb8))/0x9)+parseInt(_0x15cabf(0xba))/0xa*(-parseInt(_0x15cabf(0xb9))/0xb);if(_0x11b765===_0x1780ed)break;else _0x63ee0c['push'](_0x63ee0c['shift']());}catch(_0xcb028d){_0x63ee0c['push'](_0x63ee0c['shift']());}}}(a281_0x562f,0xb232d));export const RISK_LEVEL_VALUES=[a281_0x186d7e(0xbe),a281_0x186d7e(0xb5),a281_0x186d7e(0xb6)];
1
+ export const RISK_LEVEL_VALUES=["read","write","high-risk-write"];
@@ -1 +1 @@
1
- (function(_0xd05ec7,_0x2edcd0){const _0x3f4ae6=a282_0x380c,_0x4f198a=_0xd05ec7();while(!![]){try{const _0x4b8ca6=parseInt(_0x3f4ae6(0x1e9))/0x1*(-parseInt(_0x3f4ae6(0x1ec))/0x2)+-parseInt(_0x3f4ae6(0x1e4))/0x3+parseInt(_0x3f4ae6(0x1eb))/0x4*(parseInt(_0x3f4ae6(0x1e3))/0x5)+-parseInt(_0x3f4ae6(0x1e5))/0x6+-parseInt(_0x3f4ae6(0x1e8))/0x7*(-parseInt(_0x3f4ae6(0x1e1))/0x8)+parseInt(_0x3f4ae6(0x1e0))/0x9*(parseInt(_0x3f4ae6(0x1df))/0xa)+parseInt(_0x3f4ae6(0x1e2))/0xb;if(_0x4b8ca6===_0x2edcd0)break;else _0x4f198a['push'](_0x4f198a['shift']());}catch(_0xc6a071){_0x4f198a['push'](_0x4f198a['shift']());}}}(a282_0x4b84,0x7e5d9));function a282_0x380c(_0x331a9e,_0x21809f){_0x331a9e=_0x331a9e-0x1df;const _0x4b84a2=a282_0x4b84();let _0x380cc6=_0x4b84a2[_0x331a9e];return _0x380cc6;}import{OFFICIAL_ROUTING_PROFILES as a282_0x3bcc1c,ROUTING_CATALOG_DIGEST}from'../generated/official-routing.js';export const OFFICIAL_ROUTING_PROFILES=a282_0x3bcc1c;function a282_0x4b84(){const _0x322861=['27tWOIRa','16zALsGM','11874280akosbo','1441185MSpwhC','847461IwVoXQ','4435254qlNjIS','lovrabet','libraries','934521tbixkN','1WNpYGC','\x22\x20is\x20not\x20ready:\x20Lovrabet\x20CDN\x20Domain\x20is\x20not\x20configured.','4xLWKZx','1469324jtsaIE','2130760upfYEm'];a282_0x4b84=function(){return _0x322861;};return a282_0x4b84();}export{ROUTING_CATALOG_DIGEST};export function getOfficialRoutingProfile(_0x171cb5){return OFFICIAL_ROUTING_PROFILES[_0x171cb5];}export function getOfficialRoutingCdn(_0x3b8d28){const _0xe90c0c=a282_0x380c,_0x1d71c6=getOfficialRoutingProfile(_0x3b8d28)['cdn'];if(!_0x1d71c6['lovrabet'])throw new Error('Official\x20routing\x20for\x20region\x20\x22'+_0x3b8d28+_0xe90c0c(0x1ea));return{'libraries':_0x1d71c6[_0xe90c0c(0x1e7)],'lovrabet':_0x1d71c6[_0xe90c0c(0x1e6)]};}
1
+ import{OFFICIAL_ROUTING_PROFILES as GENERATED_OFFICIAL_ROUTING_PROFILES,ROUTING_CATALOG_DIGEST}from"../generated/official-routing.js";export const OFFICIAL_ROUTING_PROFILES=GENERATED_OFFICIAL_ROUTING_PROFILES;export{ROUTING_CATALOG_DIGEST};export function getOfficialRoutingProfile(region){return OFFICIAL_ROUTING_PROFILES[region]}export function getOfficialRoutingCdn(region){const cdn=getOfficialRoutingProfile(region).cdn;if(!cdn.lovrabet){throw new Error(`Official routing for region "${region}" is not ready: Lovrabet CDN Domain is not configured.`)}return{libraries:cdn.libraries,lovrabet:cdn.lovrabet}}
@@ -1 +1,7 @@
1
- (function(_0x2b0112,_0x152185){const _0x3e0323=a283_0x581b,_0xc3fc94=_0x2b0112();while(!![]){try{const _0x217c20=-parseInt(_0x3e0323(0x1aa))/0x1+-parseInt(_0x3e0323(0x1a6))/0x2*(parseInt(_0x3e0323(0x1bf))/0x3)+-parseInt(_0x3e0323(0x1c7))/0x4+parseInt(_0x3e0323(0x1bd))/0x5*(-parseInt(_0x3e0323(0x1b6))/0x6)+-parseInt(_0x3e0323(0x1b2))/0x7+-parseInt(_0x3e0323(0x1bb))/0x8+parseInt(_0x3e0323(0x1b1))/0x9;if(_0x217c20===_0x152185)break;else _0xc3fc94['push'](_0xc3fc94['shift']());}catch(_0x1be1a3){_0xc3fc94['push'](_0xc3fc94['shift']());}}}(a283_0x531a,0xd1bf7));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{isDaily,normalizeEnv}from'../constant/env.js';import{normalizeLegacyOutputFormat,riskLevelOrder}from'../framework/types.js';import{DEFAULT_LOVRABET_REGION,normalizeLovrabetRegion}from'../constant/region.js';import{selectConfiguredRegion}from'../config/region-config.js';function stringConfigValue(_0x1f342a){const _0x1904aa=a283_0x581b;return typeof _0x1f342a===_0x1904aa(0x1c0)&&_0x1f342a['trim']()?_0x1f342a[_0x1904aa(0x1c3)]():undefined;}function appProfiles(_0x422924){const _0x3f5c2e=a283_0x581b;return _0x422924[_0x3f5c2e(0x1c4)]&&typeof _0x422924[_0x3f5c2e(0x1c4)]===_0x3f5c2e(0x1bc)?_0x422924['apps']:{};}function resolveDefaultAppName(_0x47e97b){const _0x5de2f7=a283_0x581b,_0x30b352=stringConfigValue(_0x47e97b[_0x5de2f7(0x1c6)]);if(_0x30b352)return _0x30b352;const _0x5b0fa3=Object[_0x5de2f7(0x1ad)](appProfiles(_0x47e97b));return _0x5b0fa3[_0x5de2f7(0x1ab)]===0x1?_0x5b0fa3[0x0]:undefined;}function resolveTopLevelAppCode(_0x189426){const _0x2f55c4=a283_0x581b;return stringConfigValue(_0x189426[_0x2f55c4(0x1a9)])||stringConfigValue(_0x189426[_0x2f55c4(0x1b3)]);}function a283_0x531a(){const _0x24341b=['source','defaultApp','3049492DJjNJV','daily','VERBOSE','accessKey','riskLevel','APP','globalConfig','cookie','RISK_LEVEL','834KkBKcj','high-risk-write','env','appcode','764978VdKTOR','length','pageSize','keys','ENV','projectPath','entries','51999831vQyKLa','10533803dstzQf','app','locale','format','204mBVgEm','ACCESS_KEY','projectConfig','read','COOKIE','2808880ZRyHry','object','158575wJpdyS','region','3288aAJsGO','string','apiDir','true','trim','apps'];a283_0x531a=function(){return _0x24341b;};return a283_0x531a();}function a283_0x581b(_0x53d15b,_0x34e914){_0x53d15b=_0x53d15b-0x1a2;const _0x531aac=a283_0x531a();let _0x581b70=_0x531aac[_0x53d15b];return _0x581b70;}function normalizeRiskCeiling(_0x8b44ce){const _0x5aba2e=a283_0x581b;if(_0x8b44ce===undefined||_0x8b44ce===null)return undefined;if(_0x8b44ce===_0x5aba2e(0x1b9)||_0x8b44ce==='write'||_0x8b44ce===_0x5aba2e(0x1a7))return _0x8b44ce;return _0x5aba2e(0x1b9);}function resolveRiskCeiling(..._0x1e9fbc){const _0x26e2e8=a283_0x581b;let _0x50caab;for(const _0x370db7 of _0x1e9fbc){const _0x54a6c2=normalizeRiskCeiling(_0x370db7);_0x54a6c2&&(!_0x50caab||riskLevelOrder(_0x54a6c2)<riskLevelOrder(_0x50caab))&&(_0x50caab=_0x54a6c2);}return _0x50caab??DEFAULT_CONFIG_VALUES[_0x26e2e8(0x1cb)];}export function resolveAppConfig({raw:_0x56605f,flags:_0x2d8c4b,layers:_0x2fd286,readEnv:_0x5cca52}){const _0x4b4100=a283_0x581b,_0x13e4c6=_0x2fd286?.['projectConfig']??{},_0x271664=_0x2fd286?.['globalConfig']??{},_0x2ae93f=!!_0x2fd286?.[_0x4b4100(0x1af)]||Object[_0x4b4100(0x1ad)](_0x13e4c6)[_0x4b4100(0x1ab)]>0x0,_0x98fdc8=!_0x2ae93f,_0x51cbbd=_0x2ae93f?resolveDefaultAppName(_0x13e4c6):undefined,_0x37d54e=_0x98fdc8?resolveDefaultAppName(_0x271664):undefined,_0x4ca78e=stringConfigValue(_0x2d8c4b[_0x4b4100(0x1b3)]),_0x30035b=_0x5cca52(_0x4b4100(0x1a2)),_0x463ef5={};if(_0x56605f[_0x4b4100(0x1c4)]&&typeof _0x56605f['apps']===_0x4b4100(0x1bc))for(const [_0xd71dcf,_0x535343]of Object[_0x4b4100(0x1b0)](_0x56605f[_0x4b4100(0x1c4)])){_0x535343&&typeof _0x535343===_0x4b4100(0x1bc)&&_0x535343[_0x4b4100(0x1a9)]&&(_0x463ef5[_0xd71dcf]=_0x535343);}const _0x3fbf13=_0x51cbbd||_0x37d54e||resolveDefaultAppName(_0x56605f),_0xb14f39=Object['keys'](_0x463ef5)[_0x4b4100(0x1ab)]>0x0,_0x16cf66=_0x4ca78e||_0x51cbbd||_0x30035b||_0x37d54e||_0x3fbf13||undefined,_0x47fbcc=stringConfigValue(_0x2d8c4b[_0x4b4100(0x1a9)]),_0x3b7c6c=_0x47fbcc?Object[_0x4b4100(0x1b0)](_0x463ef5)['filter'](([,_0x2273fe])=>_0x2273fe?.[_0x4b4100(0x1a9)]===_0x47fbcc):[],_0x123996=_0x4ca78e&&_0x463ef5[_0x4ca78e]?.[_0x4b4100(0x1a9)]===_0x47fbcc?[_0x4ca78e,_0x463ef5[_0x4ca78e]]:undefined,_0x4070b4=_0x123996??(_0x3b7c6c[_0x4b4100(0x1ab)]===0x1?_0x3b7c6c[0x0]:undefined),_0xb0cdd7=_0x4070b4?.[0x0],_0x7edfe3=_0x4070b4?.[0x1],_0x14c554=_0x47fbcc?_0xb0cdd7:_0x16cf66;let _0x1dfaed=_0x14c554&&_0x463ef5[_0x14c554]?_0x463ef5[_0x14c554]:undefined;_0x47fbcc&&_0x7edfe3&&(_0x1dfaed=_0x7edfe3);const _0x254cc5=_0x47fbcc?_0x7edfe3??_0x1dfaed:_0x1dfaed,_0xf5df3c=!_0x4ca78e&&!_0x51cbbd&&_0x30035b&&_0x14c554===_0x30035b,_0x3b5dba=_0x4ca78e||(_0xf5df3c?_0x30035b:undefined)||(_0x47fbcc?_0xb0cdd7:undefined),_0x433911=_0x254cc5?.['appcode'],_0x557a12=_0x2ae93f?resolveTopLevelAppCode(_0x13e4c6):undefined,_0x462e34=_0x98fdc8?resolveTopLevelAppCode(_0x271664):undefined,_0x10e207=_0x4ca78e||_0x51cbbd?_0x433911:undefined,_0x3e7ec0=!_0x4ca78e&&!_0x51cbbd?_0x433911:undefined,_0x58f2cb=_0x47fbcc||_0x10e207||_0x557a12||_0x3e7ec0||_0x462e34||undefined,_0x166654=_0x2ae93f?stringConfigValue(_0x13e4c6[_0x4b4100(0x1a8)]):undefined,_0x50a782=_0x98fdc8?stringConfigValue(_0x271664[_0x4b4100(0x1a8)]):undefined,_0x1a88be=_0x2d8c4b[_0x4b4100(0x1a8)]||_0x254cc5?.[_0x4b4100(0x1a8)]||_0x166654||_0x5cca52(_0x4b4100(0x1ae))||_0x50a782||_0x56605f[_0x4b4100(0x1a8)]||DEFAULT_CONFIG_VALUES[_0x4b4100(0x1a8)],_0x268f56=_0x254cc5?.[_0x4b4100(0x1b4)]||_0x56605f[_0x4b4100(0x1b4)]||DEFAULT_CONFIG_VALUES[_0x4b4100(0x1b4)],_0x413d3e=_0x5cca52(_0x4b4100(0x1ba))||_0x254cc5?.[_0x4b4100(0x1a4)]||_0x56605f[_0x4b4100(0x1a4)]||undefined,_0x934660=_0x5cca52(_0x4b4100(0x1b7))||_0x254cc5?.['accessKey']||_0x56605f[_0x4b4100(0x1ca)]||undefined,_0x56c0e4=_0x2d8c4b['format']||_0x5cca52('FORMAT')||_0x254cc5?.['format']||_0x56605f[_0x4b4100(0x1b5)],_0x38a017=normalizeLegacyOutputFormat(_0x56c0e4),_0x42bb26=_0x5cca52('PAGE_SIZE')||_0x254cc5?.[_0x4b4100(0x1ac)]||_0x56605f[_0x4b4100(0x1ac)],_0x4afb08=_0x42bb26?Number(_0x42bb26)||undefined:undefined,_0x32e885=_0x2fd286?[_0x2fd286[_0x4b4100(0x1a3)][_0x4b4100(0x1cb)],_0x2fd286[_0x4b4100(0x1b8)]['riskLevel']]:[_0x56605f['riskLevel']],_0x4e1dfa=resolveRiskCeiling(..._0x32e885,_0x254cc5?.[_0x4b4100(0x1cb)]),_0x43a9af=resolveRiskCeiling(_0x4e1dfa,_0x5cca52(_0x4b4100(0x1a5))),_0x4bf063=_0x5cca52(_0x4b4100(0x1c9)),_0x51ca04=_0x4bf063==='1'||_0x4bf063===_0x4b4100(0x1c2),_0x5b428c=_0x254cc5?.[_0x4b4100(0x1c1)]||_0x56605f[_0x4b4100(0x1c1)]||DEFAULT_CONFIG_VALUES[_0x4b4100(0x1c1)],_0x4c95ab=selectConfiguredRegion({'appRegion':_0x254cc5?.[_0x4b4100(0x1be)],'projectRegion':_0x2ae93f?_0x13e4c6[_0x4b4100(0x1be)]:undefined,'globalRegion':_0x2ae93f||_0x98fdc8?_0x271664['region']:undefined,'mergedRegion':_0x56605f['region']}),_0x1ae852=normalizeLovrabetRegion(_0x4c95ab['value'])??DEFAULT_LOVRABET_REGION,_0x35cfd9=isDaily(normalizeEnv(String(_0x1a88be)))?_0x4b4100(0x1c8):'production';return{'appCode':typeof _0x58f2cb===_0x4b4100(0x1c0)&&_0x58f2cb[_0x4b4100(0x1c3)]()?_0x58f2cb[_0x4b4100(0x1c3)]():undefined,'region':_0x1ae852,'regionConfiguredValue':_0x4c95ab['value'],'regionSource':_0x4c95ab[_0x4b4100(0x1c5)],'env':_0x35cfd9,'locale':_0x268f56,'cookie':_0x413d3e,'accessKey':_0x934660,'format':_0x38a017,'pageSize':_0x4afb08,'riskLevel':_0x43a9af,'verbose':_0x51ca04,'apiDir':_0x5b428c,'apps':_0x463ef5,'defaultApp':_0x3fbf13,'currentApp':_0xb14f39?_0x14c554:undefined,'explicitAppName':_0x3b5dba};}
1
+ import{DEFAULT_CONFIG_VALUES}from"../constant/defaults.js";import{isDaily,normalizeEnv}from"../constant/env.js";import{normalizeLegacyOutputFormat,riskLevelOrder}from"../framework/types.js";import{DEFAULT_LOVRABET_REGION,normalizeLovrabetRegion}from"../constant/region.js";import{selectConfiguredRegion}from"../config/region-config.js";function stringConfigValue(value){return typeof value==="string"&&value.trim()?value.trim():undefined}function appProfiles(config){return config.apps&&typeof config.apps==="object"?config.apps:{}}function resolveDefaultAppName(config){const defaultApp=stringConfigValue(config.defaultApp);if(defaultApp)return defaultApp;const names=Object.keys(appProfiles(config));return names.length===1?names[0]:undefined}function resolveTopLevelAppCode(config){return stringConfigValue(config.appcode)||stringConfigValue(config.app)}function normalizeRiskCeiling(value){if(value===undefined||value===null)return undefined
2
+ ;if(value==="read"||value==="write"||value==="high-risk-write"){return value}return"read"}function resolveRiskCeiling(...values){let resolved;for(const value of values){const candidate=normalizeRiskCeiling(value);if(candidate&&(!resolved||riskLevelOrder(candidate)<riskLevelOrder(resolved))){resolved=candidate}}return resolved??DEFAULT_CONFIG_VALUES.riskLevel}export function resolveAppConfig({raw:raw,flags:flags,layers:layers,readEnv:readEnv}){const projectConfig=layers?.projectConfig??{};const globalConfig=layers?.globalConfig??{};const hasProjectConfig=!!layers?.projectPath||Object.keys(projectConfig).length>0;const canUseGlobalAppConfig=!hasProjectConfig;const projectDefaultApp=hasProjectConfig?resolveDefaultAppName(projectConfig):undefined;const globalDefaultApp=canUseGlobalAppConfig?resolveDefaultAppName(globalConfig):undefined;const flagApp=stringConfigValue(flags.app);const envApp=readEnv("APP");const apps={};if(raw.apps&&typeof raw.apps==="object"){
3
+ for(const[name,profile]of Object.entries(raw.apps)){if(profile&&typeof profile==="object"&&profile.appcode){apps[name]=profile}}}const defaultApp=projectDefaultApp||globalDefaultApp||resolveDefaultAppName(raw);const isMultiApp=Object.keys(apps).length>0;const baseCurrentApp=flagApp||projectDefaultApp||envApp||globalDefaultApp||defaultApp||undefined;const explicitAppCode=stringConfigValue(flags.appcode);const matchedAppEntries=explicitAppCode?Object.entries(apps).filter(([,profile])=>profile?.appcode===explicitAppCode):[];const flagAppEntry=flagApp&&apps[flagApp]?.appcode===explicitAppCode?[flagApp,apps[flagApp]]:undefined;const matchedAppEntry=flagAppEntry??(matchedAppEntries.length===1?matchedAppEntries[0]:undefined);const matchedAppName=matchedAppEntry?.[0];const matchedAppProfile=matchedAppEntry?.[1];const currentApp=explicitAppCode?matchedAppName:baseCurrentApp;let activeProfile=currentApp&&apps[currentApp]?apps[currentApp]:undefined;if(explicitAppCode&&matchedAppProfile){
4
+ activeProfile=matchedAppProfile}const profileForResolution=explicitAppCode?matchedAppProfile??activeProfile:activeProfile;const envAppIsActive=!flagApp&&!projectDefaultApp&&envApp&&currentApp===envApp;const explicitAppName=flagApp||(envAppIsActive?envApp:undefined)||(explicitAppCode?matchedAppName:undefined);const selectedProfileAppCode=profileForResolution?.appcode;const projectTopLevelAppCode=hasProjectConfig?resolveTopLevelAppCode(projectConfig):undefined;const globalTopLevelAppCode=canUseGlobalAppConfig?resolveTopLevelAppCode(globalConfig):undefined;const selectedProfileBeforeEnv=flagApp||projectDefaultApp?selectedProfileAppCode:undefined;const selectedProfileAfterEnv=!flagApp&&!projectDefaultApp?selectedProfileAppCode:undefined;const appCode=explicitAppCode||selectedProfileBeforeEnv||projectTopLevelAppCode||selectedProfileAfterEnv||globalTopLevelAppCode||undefined;const projectTopLevelEnv=hasProjectConfig?stringConfigValue(projectConfig.env):undefined
5
+ ;const globalTopLevelEnv=canUseGlobalAppConfig?stringConfigValue(globalConfig.env):undefined;const resolvedEnv=flags.env||profileForResolution?.env||projectTopLevelEnv||readEnv("ENV")||globalTopLevelEnv||raw.env||DEFAULT_CONFIG_VALUES.env;const locale=profileForResolution?.locale||raw.locale||DEFAULT_CONFIG_VALUES.locale;const cookie=readEnv("COOKIE")||profileForResolution?.cookie||raw.cookie||undefined;const accessKey=readEnv("ACCESS_KEY")||profileForResolution?.accessKey||raw.accessKey||undefined;const rawFormat=flags.format||readEnv("FORMAT")||profileForResolution?.format||raw.format;const format=normalizeLegacyOutputFormat(rawFormat);const rawPageSize=readEnv("PAGE_SIZE")||profileForResolution?.pageSize||raw.pageSize;const pageSize=rawPageSize?Number(rawPageSize)||undefined:undefined;const configuredCeilings=layers?[layers.globalConfig.riskLevel,layers.projectConfig.riskLevel]:[raw.riskLevel]
6
+ ;const configuredRiskLevel=resolveRiskCeiling(...configuredCeilings,profileForResolution?.riskLevel);const riskLevel=resolveRiskCeiling(configuredRiskLevel,readEnv("RISK_LEVEL"));const verboseVal=readEnv("VERBOSE");const verbose=verboseVal==="1"||verboseVal==="true";const apiDir=profileForResolution?.apiDir||raw.apiDir||DEFAULT_CONFIG_VALUES.apiDir;const selectedRegion=selectConfiguredRegion({appRegion:profileForResolution?.region,projectRegion:hasProjectConfig?projectConfig.region:undefined,globalRegion:hasProjectConfig||canUseGlobalAppConfig?globalConfig.region:undefined,mergedRegion:raw.region});const region=normalizeLovrabetRegion(selectedRegion.value)??DEFAULT_LOVRABET_REGION;const configEnv=isDaily(normalizeEnv(String(resolvedEnv)))?"daily":"production";return{appCode:typeof appCode==="string"&&appCode.trim()?appCode.trim():undefined,region:region,regionConfiguredValue:selectedRegion.value,regionSource:selectedRegion.source,env:configEnv,locale:locale,cookie:cookie,
7
+ accessKey:accessKey,format:format,pageSize:pageSize,riskLevel:riskLevel,verbose:verbose,apiDir:apiDir,apps:apps,defaultApp:defaultApp,currentApp:isMultiApp?currentApp:undefined,explicitAppName:explicitAppName}}
@@ -1 +1 @@
1
- function a284_0xd61c(_0x517084,_0x5c9e4c){_0x517084=_0x517084-0x1aa;const _0x2a850e=a284_0x2a85();let _0xd61c9e=_0x2a850e[_0x517084];return _0xd61c9e;}(function(_0x24571a,_0xaf2bba){const _0x31965a=a284_0xd61c,_0x100768=_0x24571a();while(!![]){try{const _0x38dff4=-parseInt(_0x31965a(0x1b0))/0x1*(parseInt(_0x31965a(0x1b6))/0x2)+parseInt(_0x31965a(0x1af))/0x3+-parseInt(_0x31965a(0x1ae))/0x4+parseInt(_0x31965a(0x1b5))/0x5*(-parseInt(_0x31965a(0x1ab))/0x6)+parseInt(_0x31965a(0x1ad))/0x7*(-parseInt(_0x31965a(0x1b4))/0x8)+-parseInt(_0x31965a(0x1b8))/0x9*(parseInt(_0x31965a(0x1b7))/0xa)+-parseInt(_0x31965a(0x1b2))/0xb*(-parseInt(_0x31965a(0x1aa))/0xc);if(_0x38dff4===_0xaf2bba)break;else _0x100768['push'](_0x100768['shift']());}catch(_0x46a6f4){_0x100768['push'](_0x100768['shift']());}}}(a284_0x2a85,0x2507e));import{getIsSessionValid}from'../auth/is-session-valid.js';import{CliErrors}from'../errors.js';function a284_0x2a85(){const _0x35fcbc=['1718lfWghY','authRequired','10229153KOjvkR','cookie','24ateDue','10CshQyw','328vyfpOL','44300rGvnLF','225HBVwbh','12MAMtlg','248946FMBaZh','../auth/get-cookie.js','510202lHeLIm','615464DJPmGa','209289AbdOZc'];a284_0x2a85=function(){return _0x35fcbc;};return a284_0x2a85();}export async function buildAuth(_0x5c9ed7){const _0x1d8bb6=a284_0xd61c,{getCookie:_0xd3ce54}=await import(_0x1d8bb6(0x1ac)),_0x36b0d0=_0x5c9ed7[_0x1d8bb6(0x1b3)]||_0xd3ce54(),_0x3e6cd0=_0x36b0d0?await getIsSessionValid():![];return{'cookie':_0x36b0d0,'isLoggedIn':_0x3e6cd0,async 'getOrLogin'(){const _0x529d40=_0x1d8bb6;if(_0x36b0d0&&_0x3e6cd0)return _0x36b0d0;throw CliErrors[_0x529d40(0x1b1)]();}};}
1
+ import{getIsSessionValid}from"../auth/is-session-valid.js";import{CliErrors}from"../errors.js";export async function buildAuth(config){const{getCookie:getCookie}=await(import("../auth/get-cookie.js"));const cookie=config.cookie||getCookie();const isLoggedIn=cookie?await getIsSessionValid():false;return{cookie:cookie,isLoggedIn:isLoggedIn,async getOrLogin(){if(cookie&&isLoggedIn)return cookie;throw CliErrors.authRequired()}}}
@@ -1 +1,7 @@
1
- const a285_0x4fd327=a285_0x2dc6;(function(_0x2f6c6e,_0x418ca0){const _0x2e5687=a285_0x2dc6,_0x196e54=_0x2f6c6e();while(!![]){try{const _0x127fc5=parseInt(_0x2e5687(0x1e9))/0x1*(-parseInt(_0x2e5687(0x1ff))/0x2)+parseInt(_0x2e5687(0x1fb))/0x3*(parseInt(_0x2e5687(0x1fe))/0x4)+parseInt(_0x2e5687(0x202))/0x5*(parseInt(_0x2e5687(0x212))/0x6)+parseInt(_0x2e5687(0x203))/0x7*(parseInt(_0x2e5687(0x1ea))/0x8)+-parseInt(_0x2e5687(0x1e4))/0x9+-parseInt(_0x2e5687(0x1f4))/0xa+parseInt(_0x2e5687(0x214))/0xb*(parseInt(_0x2e5687(0x1f8))/0xc);if(_0x127fc5===_0x418ca0)break;else _0x196e54['push'](_0x196e54['shift']());}catch(_0x198f6f){_0x196e54['push'](_0x196e54['shift']());}}}(a285_0x244a,0x41136));function a285_0x2dc6(_0x115cbb,_0x329e3a){_0x115cbb=_0x115cbb-0x1e2;const _0x244a88=a285_0x244a();let _0x2dc697=_0x244a88[_0x115cbb];return _0x2dc697;}import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{dirname,parse,resolve}from'node:path';import{homedir}from'node:os';import{CLI_BIN_NAME}from'../constant/cli.js';import{normalizeConfigForWrite}from'../config/schema.js';export const NEW_CONFIG_NAME=a285_0x4fd327(0x1f0);export const CONFIG_NAMES=[NEW_CONFIG_NAME];const normalizedWriteCache=new Map();export function resolveConfigPath(_0x41cae8){for(const _0x6d3de6 of CONFIG_NAMES){const _0xf8690c=resolve(_0x41cae8,_0x6d3de6);if(existsSync(_0xf8690c))return _0xf8690c;}return undefined;}export function findProjectRootDirectory(_0x2c166b=process['cwd']()){let _0x4d4833=resolve(_0x2c166b);const {root:_0x1231e8}=parse(_0x4d4833),_0xb1169d=homedir();while(!![]){if(resolveConfigPath(_0x4d4833)){if(_0x4d4833===_0xb1169d)break;return _0x4d4833;}if(_0x4d4833===_0x1231e8||_0x4d4833===_0xb1169d)break;const _0x2bd842=dirname(_0x4d4833);if(_0x2bd842===_0x4d4833)break;_0x4d4833=_0x2bd842;}return resolve(_0x2c166b);}export function getProjectConfigPath(){const _0x4ea1f6=a285_0x4fd327;return resolveConfigPath(process[_0x4ea1f6(0x1f2)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4fb16b){const _0x2c59aa=a285_0x4fd327;if(!existsSync(_0x4fb16b))return{'status':_0x2c59aa(0x210)};try{const _0x44cc05=readFileSync(_0x4fb16b,{'encoding':_0x2c59aa(0x20d)});if(!_0x44cc05?.['trim']())return{'status':_0x2c59aa(0x20c)};const _0x37a214=JSON[_0x2c59aa(0x1e6)](_0x44cc05);return{'status':'ok','data':_0x37a214};}catch(_0xb78db5){return{'status':_0x2c59aa(0x1f9),'message':_0xb78db5 instanceof Error?_0xb78db5[_0x2c59aa(0x1eb)]:String(_0xb78db5)};}}function parseCliConfigJsonFile(_0x1318e5,_0x55d7cf,_0x5c11c5){const _0x35f3b3=a285_0x4fd327,_0x8b7f89=inspectCliConfigJsonFile(_0x1318e5);if(_0x8b7f89[_0x35f3b3(0x1f6)]===_0x35f3b3(0x210)||_0x8b7f89[_0x35f3b3(0x1f6)]==='empty')return{};if(_0x8b7f89[_0x35f3b3(0x1f6)]==='ok')return _0x8b7f89[_0x35f3b3(0x1f3)];return _0x55d7cf===_0x35f3b3(0x211)&&_0x5c11c5&&console[_0x35f3b3(0x1f9)](CLI_BIN_NAME+':\x20'+_0x5c11c5+_0x35f3b3(0x207)+_0x1318e5+'\x0a\x20\x20'+_0x8b7f89[_0x35f3b3(0x1eb)]),{};}function normalizeLegacyConfigShape(_0xb917c9){const _0x30f606=a285_0x4fd327;if(!_0xb917c9||typeof _0xb917c9!==_0x30f606(0x204))return{'config':{},'migrated':![]};const _0x11ecfe={..._0xb917c9},_0x3babdc=_0x11ecfe[_0x30f606(0x1ef)]&&typeof _0x11ecfe[_0x30f606(0x1ef)]==='object'?{..._0x11ecfe[_0x30f606(0x1ef)]}:{},_0x6c821e=Object['keys'](_0x3babdc)[_0x30f606(0x1e8)],_0x338371=_0x11ecfe[_0x30f606(0x21b)]||_0x11ecfe[_0x30f606(0x1e7)];let _0x213aa2=![];if(_0x338371&&_0x6c821e===0x0){const _0x53075e=typeof _0x11ecfe[_0x30f606(0x20a)]==='string'&&_0x11ecfe[_0x30f606(0x20a)]['trim']()?_0x11ecfe[_0x30f606(0x20a)]:String(_0x338371)[_0x30f606(0x215)]();_0x3babdc[_0x53075e]={'appcode':String(_0x338371)[_0x30f606(0x215)](),..._0x11ecfe['env']!=null?{'env':_0x11ecfe['env']}:{},..._0x11ecfe[_0x30f606(0x208)]!=null?{'apiDir':_0x11ecfe[_0x30f606(0x208)]}:{},..._0x11ecfe[_0x30f606(0x20e)]!=null?{'cookie':_0x11ecfe[_0x30f606(0x20e)]}:{},..._0x11ecfe['accessKey']!=null?{'accessKey':_0x11ecfe[_0x30f606(0x1fd)]}:{},..._0x11ecfe[_0x30f606(0x201)]!=null?{'format':_0x11ecfe[_0x30f606(0x201)]}:{},..._0x11ecfe['pageSize']!=null?{'pageSize':_0x11ecfe['pageSize']}:{},..._0x11ecfe[_0x30f606(0x206)]!=null?{'riskLevel':_0x11ecfe['riskLevel']}:{},..._0x11ecfe['locale']!=null?{'locale':_0x11ecfe[_0x30f606(0x1ec)]}:{}},_0x11ecfe[_0x30f606(0x1ef)]=_0x3babdc,delete _0x11ecfe[_0x30f606(0x20a)],_0x213aa2=!![];}return(_0x30f606(0x21b)in _0x11ecfe||'app'in _0x11ecfe)&&(delete _0x11ecfe['appcode'],delete _0x11ecfe['app'],_0x213aa2=!![]),{'config':_0x11ecfe,'migrated':_0x213aa2};}function writeNormalizedConfigIfNeeded(_0x1a7a4b,_0x1ed908){const _0x1e7e5f=a285_0x4fd327,_0x13a070=JSON['stringify'](normalizeConfigForWrite(_0x1ed908),null,0x2)+'\x0a';if(normalizedWriteCache[_0x1e7e5f(0x200)](_0x1a7a4b)===_0x13a070)return;writeConfigFile(_0x1a7a4b,_0x1ed908),normalizedWriteCache[_0x1e7e5f(0x1fa)](_0x1a7a4b,_0x13a070);}function a285_0x244a(){const _0x752f4=['keys','appcode','runtimeDomain','project','4568454uGfRvd','Global','parse','app','length','5bewHUr','88nPLQFn','message','locale','kbDomain','certificateDomain','apps','.rabetbase.json','inherit','cwd','data','4983080BexWjG','projectPath','status','kbServiceDomain','3570972htDGTU','error','set','7251IiQvQl','Project','accessKey','436CqgXwT','58254QgQdLz','get','format','1085FzKTWf','215782NLHYTz','object','routing','riskLevel','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','apiDir','apiDomain','defaultApp','config','empty','utf8','cookie','region','missing','warn','14322NeLKCy','stringify','11hGvkbm','trim','localDomain','.tmp','pageSize','silent'];a285_0x244a=function(){return _0x752f4;};return a285_0x244a();}function parseAndNormalizeConfig(_0x113dc4,_0x50ecc5,_0x49f9c6){const _0x16e440=a285_0x4fd327,_0x151da4=parseCliConfigJsonFile(_0x113dc4,_0x50ecc5,_0x49f9c6),_0xfcc91a=normalizeLegacyConfigShape(_0x151da4);if(_0xfcc91a['migrated'])try{writeNormalizedConfigIfNeeded(_0x113dc4,_0xfcc91a[_0x16e440(0x20b)]);}catch{}return _0xfcc91a[_0x16e440(0x20b)];}export function loadRawConfigLayers(_0x56704e){const _0x241026=a285_0x4fd327;let _0x5e9a66={},_0xb551b5={};const _0x59da00=resolveConfigPath(homedir());_0x59da00&&(_0x5e9a66=parseAndNormalizeConfig(_0x59da00,_0x241026(0x211),_0x241026(0x1e5)));const _0x2d1c00=_0x56704e??findProjectRootDirectory(),_0x53bc4d=resolveConfigPath(_0x2d1c00);return _0x53bc4d&&(_0xb551b5=parseAndNormalizeConfig(_0x53bc4d,_0x241026(0x211),_0x241026(0x1fc))),{'globalPath':_0x59da00,'projectPath':_0x53bc4d,'globalConfig':_0x5e9a66,'projectConfig':_0xb551b5};}const INHERIT_WHITELIST=['cookie',a285_0x4fd327(0x1fd),a285_0x4fd327(0x1ec),a285_0x4fd327(0x201),a285_0x4fd327(0x206),a285_0x4fd327(0x218),a285_0x4fd327(0x20f),a285_0x4fd327(0x205),'userDomain',a285_0x4fd327(0x209),a285_0x4fd327(0x1e2),'skillDomain',a285_0x4fd327(0x1ed),a285_0x4fd327(0x1f7),'appDomain',a285_0x4fd327(0x216),a285_0x4fd327(0x1ee)];export function mergeRawConfigLayers(_0x299ed2){const _0xa01030=a285_0x4fd327,{globalConfig:_0xb05b5a,projectConfig:_0x446f9d}=_0x299ed2,_0x48d730=!!_0x299ed2[_0xa01030(0x1f5)]||Object[_0xa01030(0x21a)](_0x446f9d)['length']>0x0;if(!_0x48d730)return mergeGlobalOnly(_0xb05b5a);return mergeProjectFirst(_0xb05b5a,_0x446f9d);}function mergeGlobalOnly(_0x2a8532){const _0x2d7d16=a285_0x4fd327,_0x5bb295={..._0x2a8532};delete _0x5bb295[_0x2d7d16(0x1f1)];const _0x59c9f1=_0x2a8532[_0x2d7d16(0x1ef)]&&typeof _0x2a8532[_0x2d7d16(0x1ef)]===_0x2d7d16(0x204)?_0x2a8532['apps']:{};if(Object['keys'](_0x59c9f1)[_0x2d7d16(0x1e8)]>0x0)_0x5bb295[_0x2d7d16(0x1ef)]=_0x59c9f1;if(_0x2a8532[_0x2d7d16(0x20a)])_0x5bb295[_0x2d7d16(0x20a)]=_0x2a8532[_0x2d7d16(0x20a)];return _0x5bb295;}function mergeProjectFirst(_0x3534c2,_0x4f72b4){const _0x3f2b0c=a285_0x4fd327,_0x595519={..._0x4f72b4};delete _0x595519[_0x3f2b0c(0x1f1)];for(const _0x5f0d6c of INHERIT_WHITELIST){!(_0x5f0d6c in _0x595519)&&_0x5f0d6c in _0x3534c2&&(_0x595519[_0x5f0d6c]=_0x3534c2[_0x5f0d6c]);}const _0x51a681=_0x4f72b4[_0x3f2b0c(0x1ef)]&&typeof _0x4f72b4[_0x3f2b0c(0x1ef)]===_0x3f2b0c(0x204)?_0x4f72b4[_0x3f2b0c(0x1ef)]:{};return Object[_0x3f2b0c(0x21a)](_0x51a681)[_0x3f2b0c(0x1e8)]>0x0?_0x595519[_0x3f2b0c(0x1ef)]=_0x51a681:delete _0x595519[_0x3f2b0c(0x1ef)],_0x3f2b0c(0x20a)in _0x4f72b4?_0x595519[_0x3f2b0c(0x20a)]=_0x4f72b4[_0x3f2b0c(0x20a)]:delete _0x595519[_0x3f2b0c(0x20a)],_0x595519;}export function readRawConfigWithLayers(_0x354fbe){const _0x94c3ff=loadRawConfigLayers(_0x354fbe);return{'config':mergeRawConfigLayers(_0x94c3ff),'layers':_0x94c3ff};}export function readRawConfig(_0x4bb5f9){return mergeRawConfigLayers(loadRawConfigLayers(_0x4bb5f9));}export function readConfigFile(_0xbd7b59){const _0x573728=a285_0x4fd327;return parseAndNormalizeConfig(_0xbd7b59,_0x573728(0x219));}export function writeConfigFile(_0x438c21,_0x4e848e){const _0x3b7eb8=a285_0x4fd327,_0x4c370c=dirname(_0x438c21);!existsSync(_0x4c370c)&&mkdirSync(_0x4c370c,{'recursive':!![]});const _0xb41986=_0x438c21+_0x3b7eb8(0x217);try{const _0x11056c=normalizeConfigForWrite(_0x4e848e);writeFileSync(_0xb41986,JSON[_0x3b7eb8(0x213)](_0x11056c,null,0x2)+'\x0a',{'encoding':_0x3b7eb8(0x20d),'mode':0x180}),renameSync(_0xb41986,_0x438c21);}catch(_0xdb0d88){try{unlinkSync(_0xb41986);}catch{}throw _0xdb0d88;}}export function resolveWriteConfigPath(_0xa1ffba){const _0x285a57=a285_0x4fd327,_0x2a8162=_0xa1ffba===_0x285a57(0x1e3)?process[_0x285a57(0x1f2)]():homedir(),_0x203521=resolveConfigPath(_0x2a8162);return _0x203521??resolve(_0x2a8162,NEW_CONFIG_NAME);}
1
+ import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from"node:fs";import{dirname,parse,resolve}from"node:path";import{homedir}from"node:os";import{CLI_BIN_NAME}from"../constant/cli.js";import{normalizeConfigForWrite}from"../config/schema.js";export const NEW_CONFIG_NAME=".rabetbase.json";export const CONFIG_NAMES=[NEW_CONFIG_NAME];const normalizedWriteCache=new Map;export function resolveConfigPath(base){for(const name of CONFIG_NAMES){const p=resolve(base,name);if(existsSync(p))return p}return undefined}export function findProjectRootDirectory(startDir=process.cwd()){let dir=resolve(startDir);const{root:root}=parse(dir);const home=homedir();while(true){if(resolveConfigPath(dir)){if(dir===home)break;return dir}if(dir===root||dir===home)break;const parent=dirname(dir);if(parent===dir)break;dir=parent}return resolve(startDir)}export function getProjectConfigPath(){return resolveConfigPath(process.cwd())}export function getGlobalConfigPath(){
2
+ return resolveConfigPath(homedir())}export function isInProject(){return!!getProjectConfigPath()}export function inspectCliConfigJsonFile(filePath){if(!existsSync(filePath))return{status:"missing"};try{const raw=readFileSync(filePath,{encoding:"utf8"});if(!raw?.trim())return{status:"empty"};const data=JSON.parse(raw);return{status:"ok",data:data}}catch(err){return{status:"error",message:err instanceof Error?err.message:String(err)}}}function parseCliConfigJsonFile(filePath,onParseError,scopeLabel){const r=inspectCliConfigJsonFile(filePath);if(r.status==="missing"||r.status==="empty")return{};if(r.status==="ok")return r.data;if(onParseError==="warn"&&scopeLabel){console.error(`${CLI_BIN_NAME}: ${scopeLabel} config file ignored (invalid JSON or unreadable): ${filePath}\n ${r.message}`)}return{}}function normalizeLegacyConfigShape(input){if(!input||typeof input!=="object")return{config:{},migrated:false};const config={...input};const apps=config.apps&&typeof config.apps==="object"?{
3
+ ...config.apps}:{};const appCount=Object.keys(apps).length;const legacyAppcode=config.appcode||config.app;let migrated=false;if(legacyAppcode&&appCount===0){const appName=typeof config.defaultApp==="string"&&config.defaultApp.trim()?config.defaultApp:String(legacyAppcode).trim();apps[appName]={appcode:String(legacyAppcode).trim(),...config.env!=null?{env:config.env}:{},...config.apiDir!=null?{apiDir:config.apiDir}:{},...config.cookie!=null?{cookie:config.cookie}:{},...config.accessKey!=null?{accessKey:config.accessKey}:{},...config.format!=null?{format:config.format}:{},...config.pageSize!=null?{pageSize:config.pageSize}:{},...config.riskLevel!=null?{riskLevel:config.riskLevel}:{},...config.locale!=null?{locale:config.locale}:{}};config.apps=apps;delete config.defaultApp;migrated=true}if("appcode"in config||"app"in config){delete config.appcode;delete config.app;migrated=true}return{config:config,migrated:migrated}}function writeNormalizedConfigIfNeeded(filePath,config){
4
+ const serialized=JSON.stringify(normalizeConfigForWrite(config),null,2)+"\n";if(normalizedWriteCache.get(filePath)===serialized)return;writeConfigFile(filePath,config);normalizedWriteCache.set(filePath,serialized)}function parseAndNormalizeConfig(filePath,mode,sourceLabel){const parsed=parseCliConfigJsonFile(filePath,mode,sourceLabel);const normalized=normalizeLegacyConfigShape(parsed);if(normalized.migrated){try{writeNormalizedConfigIfNeeded(filePath,normalized.config)}catch{}}return normalized.config}export function loadRawConfigLayers(projectRoot){let globalConfig={};let projectConfig={};const globalPath=resolveConfigPath(homedir());if(globalPath){globalConfig=parseAndNormalizeConfig(globalPath,"warn","Global")}const base=projectRoot??findProjectRootDirectory();const projectPath=resolveConfigPath(base);if(projectPath){projectConfig=parseAndNormalizeConfig(projectPath,"warn","Project")}return{globalPath:globalPath,projectPath:projectPath,globalConfig:globalConfig,
5
+ projectConfig:projectConfig}}const INHERIT_WHITELIST=["cookie","accessKey","locale","format","riskLevel","pageSize","region","routing","userDomain","apiDomain","runtimeDomain","skillDomain","kbDomain","kbServiceDomain","appDomain","localDomain","certificateDomain"];export function mergeRawConfigLayers(layers){const{globalConfig:globalConfig,projectConfig:projectConfig}=layers;const hasProject=!!layers.projectPath||Object.keys(projectConfig).length>0;if(!hasProject)return mergeGlobalOnly(globalConfig);return mergeProjectFirst(globalConfig,projectConfig)}function mergeGlobalOnly(globalConfig){const config={...globalConfig};delete config.inherit;const globalApps=globalConfig.apps&&typeof globalConfig.apps==="object"?globalConfig.apps:{};if(Object.keys(globalApps).length>0)config.apps=globalApps;if(globalConfig.defaultApp)config.defaultApp=globalConfig.defaultApp;return config}function mergeProjectFirst(globalConfig,projectConfig){const config={...projectConfig};delete config.inherit
6
+ ;for(const field of INHERIT_WHITELIST){if(!(field in config)&&field in globalConfig){config[field]=globalConfig[field]}}const projectApps=projectConfig.apps&&typeof projectConfig.apps==="object"?projectConfig.apps:{};if(Object.keys(projectApps).length>0){config.apps=projectApps}else{delete config.apps}if("defaultApp"in projectConfig){config.defaultApp=projectConfig.defaultApp}else{delete config.defaultApp}return config}export function readRawConfigWithLayers(projectRoot){const layers=loadRawConfigLayers(projectRoot);return{config:mergeRawConfigLayers(layers),layers:layers}}export function readRawConfig(projectRoot){return mergeRawConfigLayers(loadRawConfigLayers(projectRoot))}export function readConfigFile(filePath){return parseAndNormalizeConfig(filePath,"silent")}export function writeConfigFile(filePath,data){const dir=dirname(filePath);if(!existsSync(dir)){mkdirSync(dir,{recursive:true})}const tempPath=`${filePath}.tmp`;try{const persisted=normalizeConfigForWrite(data)
7
+ ;writeFileSync(tempPath,JSON.stringify(persisted,null,2)+"\n",{encoding:"utf8",mode:384});renameSync(tempPath,filePath)}catch(err){try{unlinkSync(tempPath)}catch{}throw err}}export function resolveWriteConfigPath(scope){const base=scope==="project"?process.cwd():homedir();const existing=resolveConfigPath(base);return existing??resolve(base,NEW_CONFIG_NAME)}