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

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 (447) 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
  447. package/templates/README.md +0 -130
@@ -1 +1 @@
1
- function a57_0x4bde(_0x5b15a4,_0xa3a8a2){_0x5b15a4=_0x5b15a4-0x172;const _0x1db85c=a57_0x1db8();let _0x4bde66=_0x1db85c[_0x5b15a4];return _0x4bde66;}(function(_0xcd4f43,_0x5a58ca){const _0x4a0c25=a57_0x4bde,_0x573dc0=_0xcd4f43();while(!![]){try{const _0x48440b=parseInt(_0x4a0c25(0x173))/0x1*(-parseInt(_0x4a0c25(0x17c))/0x2)+-parseInt(_0x4a0c25(0x183))/0x3*(-parseInt(_0x4a0c25(0x17f))/0x4)+-parseInt(_0x4a0c25(0x177))/0x5*(parseInt(_0x4a0c25(0x174))/0x6)+-parseInt(_0x4a0c25(0x178))/0x7*(-parseInt(_0x4a0c25(0x172))/0x8)+parseInt(_0x4a0c25(0x179))/0x9*(-parseInt(_0x4a0c25(0x17e))/0xa)+-parseInt(_0x4a0c25(0x17b))/0xb+-parseInt(_0x4a0c25(0x17a))/0xc*(-parseInt(_0x4a0c25(0x180))/0xd);if(_0x48440b===_0x5a58ca)break;else _0x573dc0['push'](_0x573dc0['shift']());}catch(_0x3688cd){_0x573dc0['push'](_0x573dc0['shift']());}}}(a57_0x1db8,0xa7b27));function a57_0x1db8(){const _0x459677=['2EaelPf','length','10LoZYGQ','68rpyxWa','2665HzMiRs','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','App\x20Code\x20cannot\x20exceed\x20100\x20characters','149445TTzWoH','35656sBWroW','230890akgYJn','66zpEPhC','test','trim','158810BAMiLh','504xMYMze','10448892GbJyWJ','82776OAoyLY','1690722ynUNze'];a57_0x1db8=function(){return _0x459677;};return a57_0x1db8();}export function validateAppcode(_0x1cf726){const _0x59fb98=a57_0x4bde,_0x58277b=_0x1cf726[_0x59fb98(0x176)]();if(!_0x58277b)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x58277b[_0x59fb98(0x17d)]>0x64)return{'valid':![],'message':_0x59fb98(0x182)};if(!/^[A-Za-z0-9_-]+$/[_0x59fb98(0x175)](_0x58277b))return{'valid':![],'message':_0x59fb98(0x181)};return{'valid':!![]};}
1
+ export function validateAppcode(code){const trimmed=code.trim();if(!trimmed)return{valid:false,message:"App Code cannot be empty"};if(trimmed.length>100)return{valid:false,message:"App Code cannot exceed 100 characters"};if(!/^[A-Za-z0-9_-]+$/.test(trimmed))return{valid:false,message:"Only letters, numbers, - and _ are allowed"};return{valid:true}}
@@ -1 +1,2 @@
1
- function a58_0x9ee0(){const _0x35fc41=['\x20already\x20absent','inherit','boolean','2796093Rblkbe','\x20config\x20delete\x20<key>\x20[--global]','4326114jfghfA','Project','delete','5224Anirkw','2253310FGNllR','\x22\x20is\x20not\x20deletable.','17504663BFLMus','9wqUkxL','Top-level\x20key\x20\x22','833aTvOGy','15FHUirD','6TLBANU','hasOwnProperty','prototype','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','defaultApp','riskLevel','validation','config','Missing\x20key\x20argument.','Global','has','Use\x20workspace\x20commands\x20to\x20modify\x20apps\x20and\x20their\x20default\x20selection.','\x20deleted','Usage:\x20','213757vFdqQC','Delete\x20a\x20config\x20value\x20from\x20one\x20scope','Delete\x20from\x20global\x20config\x20(~/.rabetbase.json)','key','bool','116300yDwoHg','Top-level\x20config\x20key;\x20legacy\x20inherit\x20is\x20accepted\x20for\x20migration','args','global','write','call'];a58_0x9ee0=function(){return _0x35fc41;};return a58_0x9ee0();}const a58_0x4a9201=a58_0x133c;(function(_0x2cad6b,_0x1dc4a9){const _0x13b5a0=a58_0x133c,_0x1789a4=_0x2cad6b();while(!![]){try{const _0x418b97=parseInt(_0x13b5a0(0x1b6))/0x1*(-parseInt(_0x13b5a0(0x1a8))/0x2)+-parseInt(_0x13b5a0(0x19b))/0x3+-parseInt(_0x13b5a0(0x1bb))/0x4*(parseInt(_0x13b5a0(0x1a7))/0x5)+parseInt(_0x13b5a0(0x19d))/0x6+-parseInt(_0x13b5a0(0x1a6))/0x7*(-parseInt(_0x13b5a0(0x1a0))/0x8)+parseInt(_0x13b5a0(0x1a4))/0x9*(-parseInt(_0x13b5a0(0x1a1))/0xa)+parseInt(_0x13b5a0(0x1a3))/0xb;if(_0x418b97===_0x1dc4a9)break;else _0x1789a4['push'](_0x1789a4['shift']());}catch(_0x164013){_0x1789a4['push'](_0x1789a4['shift']());}}}(a58_0x9ee0,0x7b189));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,isTopLevelConfigKey,readScopedConfig,resolveWriteScope,writeScopedConfig}from'../../commands/config/shared.js';const LEGACY_DELETABLE_KEYS=new Set([a58_0x4a9201(0x1c2)]),EXTRA_DELETABLE_KEYS=new Set([a58_0x4a9201(0x1ac),'routing']);async function execute(_0x30d52d){const _0x9582ed=a58_0x4a9201,_0x47a0e2=_0x30d52d[_0x9582ed(0x1bd)][0x0]?.['trim']();if(!_0x47a0e2)throw CliErrors[_0x9582ed(0x1ae)](_0x9582ed(0x1b0),_0x9582ed(0x1b5)+CLI_BIN_NAME+_0x9582ed(0x19c));if(_0x47a0e2===_0x9582ed(0x1ad))throw CliErrors[_0x9582ed(0x1ae)](_0x9582ed(0x1ab));if(!isTopLevelConfigKey(_0x47a0e2)&&!EXTRA_DELETABLE_KEYS['has'](_0x47a0e2)&&!LEGACY_DELETABLE_KEYS[_0x9582ed(0x1b2)](_0x47a0e2))throw CliErrors[_0x9582ed(0x1ae)](_0x9582ed(0x1a5)+_0x47a0e2+_0x9582ed(0x1a2),_0x9582ed(0x1b3));const _0x5846d1=resolveWriteScope({'global':_0x30d52d[_0x9582ed(0x1ba)](_0x9582ed(0x1be))}),_0x58cfd8=readScopedConfig(_0x5846d1),_0x520c6e=Object[_0x9582ed(0x1aa)][_0x9582ed(0x1a9)][_0x9582ed(0x1c0)](_0x58cfd8,_0x47a0e2);_0x520c6e&&(delete _0x58cfd8[_0x47a0e2],writeScopedConfig(_0x58cfd8,_0x5846d1));const _0xaacbdc=_0x5846d1==='global'?_0x9582ed(0x1b1):_0x9582ed(0x19e);return{'ok':!![],'message':_0x520c6e?'✓\x20'+_0xaacbdc+'\x20'+_0x47a0e2+_0x9582ed(0x1b4):'✓\x20'+_0xaacbdc+'\x20'+_0x47a0e2+_0x9582ed(0x1c1),'data':{'key':_0x47a0e2,'scope':_0x5846d1,'changed':_0x520c6e}};}function a58_0x133c(_0x2ecaf6,_0xcc37af){_0x2ecaf6=_0x2ecaf6-0x19b;const _0x9ee084=a58_0x9ee0();let _0x133c11=_0x9ee084[_0x2ecaf6];return _0x133c11;}export const configDeleteDefinition={'service':a58_0x4a9201(0x1af),'command':a58_0x4a9201(0x19f),'description':a58_0x4a9201(0x1b7),'risk':a58_0x4a9201(0x1bf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a58_0x4a9201(0x1b9),'description':a58_0x4a9201(0x1bc),'required':!![]}],'flags':[{'name':a58_0x4a9201(0x1be),'type':a58_0x4a9201(0x1c3),'description':a58_0x4a9201(0x1b8),'default':![]}],'execute':execute};
1
+ import{CliErrors}from"../../errors.js";import{CLI_BIN_NAME,isTopLevelConfigKey,readScopedConfig,resolveWriteScope,writeScopedConfig}from"../../commands/config/shared.js";const LEGACY_DELETABLE_KEYS=new Set(["inherit"]);const EXTRA_DELETABLE_KEYS=new Set(["defaultApp","routing"]);async function execute(ctx){const key=ctx.args[0]?.trim();if(!key){throw CliErrors.validation("Missing key argument.",`Usage: ${CLI_BIN_NAME} config delete <key> [--global]`)}if(key==="riskLevel"){throw CliErrors.validation('"riskLevel" cannot be changed via the CLI.')}if(!isTopLevelConfigKey(key)&&!EXTRA_DELETABLE_KEYS.has(key)&&!LEGACY_DELETABLE_KEYS.has(key)){throw CliErrors.validation(`Top-level key "${key}" is not deletable.`,"Use workspace commands to modify apps and their default selection.")}const scope=resolveWriteScope({global:ctx.bool("global")});const config=readScopedConfig(scope);const changed=Object.prototype.hasOwnProperty.call(config,key);if(changed){delete config[key]
2
+ ;writeScopedConfig(config,scope)}const scopeLabel=scope==="global"?"Global":"Project";return{ok:true,message:changed?`✓ ${scopeLabel} ${key} deleted`:`✓ ${scopeLabel} ${key} already absent`,data:{key:key,scope:scope,changed:changed}}}export const configDeleteDefinition={service:"config",command:"delete",description:"Delete a config value from one scope",risk:"write",requiresAuth:false,requiresAppCode:false,args:[{name:"key",description:"Top-level config key; legacy inherit is accepted for migration",required:true}],flags:[{name:"global",type:"boolean",description:"Delete from global config (~/.rabetbase.json)",default:false}],execute:execute};
@@ -1 +1 @@
1
- function a59_0x1093(){const _0x5c7041=['get','app','read','3IEFoUg','object','string','1030995LpDBui','5Ljyanf','validation','Key\x20not\x20found:\x20','1303372alaFku','5757582rDdPdR','config','\x20config\x20get\x20--key\x20<key>','2390128Mxmhbk','str','key','Usage:\x20','1281090xKUuwy','90333XxjTlb','1910Gjgahv','Get\x20a\x20config\x20value\x20by\x20key','5035226ovRzZp','Missing\x20key.'];a59_0x1093=function(){return _0x5c7041;};return a59_0x1093();}const a59_0x450f09=a59_0x19a1;(function(_0x3d6974,_0x87dca4){const _0x2aa9ba=a59_0x19a1,_0x47c508=_0x3d6974();while(!![]){try{const _0x49e96e=-parseInt(_0x2aa9ba(0x1e0))/0x1+parseInt(_0x2aa9ba(0x1d4))/0x2+parseInt(_0x2aa9ba(0x1dd))/0x3*(-parseInt(_0x2aa9ba(0x1cc))/0x4)+-parseInt(_0x2aa9ba(0x1c9))/0x5*(parseInt(_0x2aa9ba(0x1cd))/0x6)+parseInt(_0x2aa9ba(0x1d8))/0x7+-parseInt(_0x2aa9ba(0x1d0))/0x8+-parseInt(_0x2aa9ba(0x1d5))/0x9*(-parseInt(_0x2aa9ba(0x1d6))/0xa);if(_0x49e96e===_0x87dca4)break;else _0x47c508['push'](_0x47c508['shift']());}catch(_0x45f7ad){_0x47c508['push'](_0x47c508['shift']());}}}(a59_0x1093,0xa18e1));import{CliErrors}from'../../errors.js';function a59_0x19a1(_0x33e178,_0x28af04){_0x33e178=_0x33e178-0x1c9;const _0x10934f=a59_0x1093();let _0x19a1c1=_0x10934f[_0x33e178];return _0x19a1c1;}import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x2720b4){const _0x3d76c0=a59_0x19a1,_0x17bc13=_0x2720b4[_0x3d76c0(0x1d1)](_0x3d76c0(0x1d2));if(!_0x17bc13)throw CliErrors[_0x3d76c0(0x1ca)](_0x3d76c0(0x1d9),_0x3d76c0(0x1d3)+CLI_BIN_NAME+_0x3d76c0(0x1cf));const _0x2acdc5=readConfig(),_0x256b35=_0x17bc13===_0x3d76c0(0x1db)?'appcode':_0x17bc13,_0x4ab9f6=_0x2acdc5[_0x256b35];if(_0x4ab9f6===undefined)throw CliErrors['validation'](_0x3d76c0(0x1cb)+_0x17bc13);return{'ok':!![],'data':typeof _0x4ab9f6===_0x3d76c0(0x1de)?_0x4ab9f6:{[_0x256b35]:_0x4ab9f6},'message':typeof _0x4ab9f6===_0x3d76c0(0x1de)?undefined:String(_0x4ab9f6)};}export const configGetDefinition={'service':a59_0x450f09(0x1ce),'command':a59_0x450f09(0x1da),'description':a59_0x450f09(0x1d7),'risk':a59_0x450f09(0x1dc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a59_0x450f09(0x1df),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
1
+ import{CliErrors}from"../../errors.js";import{readConfig}from"../../utils/config.js";import{CLI_BIN_NAME}from"../../constant/cli.js";import{getConfigCommandKeyDescription}from"../../commands/config/shared.js";async function execute(ctx){const key=ctx.str("key");if(!key){throw CliErrors.validation("Missing key.",`Usage: ${CLI_BIN_NAME} config get --key <key>`)}const config=readConfig();const actualKey=key==="app"?"appcode":key;const val=config[actualKey];if(val===undefined){throw CliErrors.validation(`Key not found: ${key}`)}return{ok:true,data:typeof val==="object"?val:{[actualKey]:val},message:typeof val==="object"?undefined:String(val)}}export const configGetDefinition={service:"config",command:"get",description:"Get a config value by key",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[{name:"key",type:"string",description:getConfigCommandKeyDescription(),required:true}],execute:execute};
@@ -1 +1 @@
1
- (function(_0xb104e,_0x135e51){const _0x4c4c8e=a60_0x2aa7,_0x1ae874=_0xb104e();while(!![]){try{const _0x48bee6=parseInt(_0x4c4c8e(0x1a8))/0x1*(-parseInt(_0x4c4c8e(0x1ab))/0x2)+-parseInt(_0x4c4c8e(0x1b1))/0x3+-parseInt(_0x4c4c8e(0x1ac))/0x4*(-parseInt(_0x4c4c8e(0x1b0))/0x5)+-parseInt(_0x4c4c8e(0x1a9))/0x6*(parseInt(_0x4c4c8e(0x1aa))/0x7)+parseInt(_0x4c4c8e(0x1ae))/0x8*(-parseInt(_0x4c4c8e(0x1ad))/0x9)+-parseInt(_0x4c4c8e(0x1a7))/0xa+parseInt(_0x4c4c8e(0x1af))/0xb;if(_0x48bee6===_0x135e51)break;else _0x1ae874['push'](_0x1ae874['shift']());}catch(_0x464b6e){_0x1ae874['push'](_0x1ae874['shift']());}}}(a60_0x5593,0x2fbb9));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';import{configDeleteDefinition}from'../../commands/config/delete.js';function a60_0x2aa7(_0x2ee030,_0x4e8d3b){_0x2ee030=_0x2ee030-0x1a7;const _0x559361=a60_0x5593();let _0x2aa73e=_0x559361[_0x2ee030];return _0x2aa73e;}function a60_0x5593(){const _0x2cdf70=['2557760DsuJtX','2zxCMbq','1312908lkcwNt','7EVrdcJ','96746eecFML','1479952oRRWQn','666RrjyNL','31456dmrxGP','8085264ggrAVD','5yONFOj','141573XMsiEc'];a60_0x5593=function(){return _0x2cdf70;};return a60_0x5593();}import{configInitDefinition}from'../../commands/config/init.js';export const configDefinitions=[configInitDefinition,configListDefinition,configGetDefinition,configSetDefinition,configDeleteDefinition];
1
+ import{configListDefinition}from"../../commands/config/list.js";import{configGetDefinition}from"../../commands/config/get.js";import{configSetDefinition}from"../../commands/config/set.js";import{configDeleteDefinition}from"../../commands/config/delete.js";import{configInitDefinition}from"../../commands/config/init.js";export const configDefinitions=[configInitDefinition,configListDefinition,configGetDefinition,configSetDefinition,configDeleteDefinition];
@@ -1 +1,5 @@
1
- const a61_0x2f488c=a61_0x13d6;function a61_0x32e1(){const _0x3cc689=['1996UejLXo','Custom\x20Runtime\x20HTTPS\x20origin','3980328sIIjQB','27770BDUaTg','Official\x20Lovrabet\x20region:\x20','label','Region\x20\x22','routing','Available\x20regions:\x20','domains','local-domain','Choose\x20either\x20an\x20official\x20region\x20or\x20independent-deployment\x20Domains,\x20not\x20both.','1617TouKOk','certificate-domain','Custom\x20platform\x20API\x20HTTPS\x20origin','Rabetbase\x20connection\x20configured\x20for\x20region:\x20','407tyjAgx','region','localDomain','bool','init','skill-domain','711rwLsrH','Rabetbase\x20connection\x20configured\x20for\x20independent\x20deployment.\x20Domains:\x20','api-domain','mode','860318VurJxR','global','official','5430hiXFNW','228768Fczxyt','Custom\x20knowledge-base\x20HTTPS\x20origin','name','Custom\x20User\x20HTTPS\x20origin','join','1FktKvX','Custom\x20SkillHub\x20HTTPS\x20origin','Select\x20Lovrabet\x20region','Independent-deployment\x20Domain\x20JSON\x20file','enterprise-v1','6189850gqHTST','Custom\x20local\x20callback\x20HTTPS\x20origin','manifestDomains','cancelled','user-domain','project','Custom\x20certificate\x20service\x20HTTPS\x20origin','3603qcxUlj','validation','length','ExitPromptError','\x22\x20is\x20not\x20currently\x20available.','Custom\x20Lovrabet\x20workspace\x20HTTPS\x20origin','config','Updates\x20the\x20selected\x20Rabetbase\x20region\x20or\x20independent-deployment\x20Domain\x20configuration.\x20Cookie,\x20output\x20format,\x20and\x20app\x20bindings\x20stay\x20unchanged.','cdn','str','string','app-domain','Custom\x20KB\x20Service\x20HTTPS\x20origin','keys','domain-config'];a61_0x32e1=function(){return _0x3cc689;};return a61_0x32e1();}(function(_0x22a9dd,_0x341cbc){const _0x2c0963=a61_0x13d6,_0x22bf7a=_0x22a9dd();while(!![]){try{const _0x1b9e8d=-parseInt(_0x2c0963(0x12d))/0x1*(parseInt(_0x2c0963(0x124))/0x2)+-parseInt(_0x2c0963(0x139))/0x3*(-parseInt(_0x2c0963(0x148))/0x4)+parseInt(_0x2c0963(0x132))/0x5+-parseInt(_0x2c0963(0x127))/0x6*(-parseInt(_0x2c0963(0x116))/0x7)+-parseInt(_0x2c0963(0x14a))/0x8+-parseInt(_0x2c0963(0x120))/0x9*(-parseInt(_0x2c0963(0x14b))/0xa)+parseInt(_0x2c0963(0x11a))/0xb*(-parseInt(_0x2c0963(0x128))/0xc);if(_0x1b9e8d===_0x341cbc)break;else _0x22bf7a['push'](_0x22bf7a['shift']());}catch(_0x511131){_0x22bf7a['push'](_0x22bf7a['shift']());}}}(a61_0x32e1,0x9a73f));import{select}from'@inquirer/prompts';import{CliErrors}from'../../errors.js';import{readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from'../../config/domain-config.js';import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from'../../generated/routing-contract.js';import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from'../../constant/region.js';import{getOfficialRoutingProfile}from'../../constant/routing-profile.js';import{GLOBAL_SCOPE_FLAG}from'../../commands/common/flags.js';function a61_0x13d6(_0x33e54b,_0x59feae){_0x33e54b=_0x33e54b-0x112;const _0x32e1ed=a61_0x32e1();let _0x13d609=_0x32e1ed[_0x33e54b];return _0x13d609;}export const configInitFlags=[GLOBAL_SCOPE_FLAG,{'name':a61_0x2f488c(0x11b),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x14c)+ENABLED_LOVRABET_REGION_VALUES[a61_0x2f488c(0x12c)](',\x20'),'enum':[...ENABLED_LOVRABET_REGION_VALUES]},{'name':a61_0x2f488c(0x147),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x130)},{'name':a61_0x2f488c(0x136),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x12b)},{'name':a61_0x2f488c(0x122),'type':'string','description':a61_0x2f488c(0x118)},{'name':'runtime-domain','type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x149)},{'name':a61_0x2f488c(0x11f),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x12e)},{'name':'kb-domain','type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x129)},{'name':'kb-service-domain','type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x145)},{'name':a61_0x2f488c(0x144),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x13e)},{'name':a61_0x2f488c(0x114),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x133)},{'name':a61_0x2f488c(0x117),'type':a61_0x2f488c(0x143),'description':a61_0x2f488c(0x138)}];async function resolveRegion(_0x4c11dd){const _0x11767f=a61_0x2f488c,_0x2c20d3=_0x4c11dd[_0x11767f(0x142)](_0x11767f(0x11b));if(_0x2c20d3){if(!isEnabledLovrabetRegion(_0x2c20d3))throw CliErrors[_0x11767f(0x13a)](_0x11767f(0x14e)+_0x2c20d3+_0x11767f(0x13d),_0x11767f(0x112)+ENABLED_LOVRABET_REGION_VALUES[_0x11767f(0x12c)](',\x20'));return _0x2c20d3;}if(_0x4c11dd['nonInteractive'])return DEFAULT_LOVRABET_REGION;try{return await select({'message':_0x11767f(0x12f),'default':DEFAULT_LOVRABET_REGION,'choices':ENABLED_LOVRABET_REGION_VALUES['map'](_0x369a72=>({'name':getOfficialRoutingProfile(_0x369a72)[_0x11767f(0x14d)]+'\x20('+_0x369a72+')','value':_0x369a72}))});}catch(_0x512089){if(_0x512089?.[_0x11767f(0x12a)]===_0x11767f(0x13c))throw CliErrors[_0x11767f(0x135)]();throw _0x512089;}}export async function executeConfigInit(_0x5b1e3f){const _0x8ba3e0=a61_0x2f488c,_0x4826d0=resolveDomainConfigInput(_0x5b1e3f),_0x54ba49=_0x4826d0[_0x8ba3e0(0x113)],_0x552725=Object[_0x8ba3e0(0x146)](_0x54ba49)[_0x8ba3e0(0x13b)]>0x0;if(_0x552725&&_0x5b1e3f[_0x8ba3e0(0x142)]('region'))throw CliErrors[_0x8ba3e0(0x13a)](_0x8ba3e0(0x115));if(!!_0x54ba49[_0x8ba3e0(0x11c)]!==!!_0x54ba49['certificateDomain'])throw CliErrors[_0x8ba3e0(0x13a)]('Independent\x20deployment\x20requires\x20--local-domain\x20and\x20--certificate-domain\x20together.');const _0x44f47a=_0x5b1e3f[_0x8ba3e0(0x11d)]('global')?_0x8ba3e0(0x125):_0x8ba3e0(0x137),_0x144669=readScopedConfig(_0x44f47a);for(const _0x51397c of DOMAIN_CONFIG_FIELDS)delete _0x144669[_0x51397c];for(const _0x1157e3 of LEGACY_DOMAIN_CONFIG_FIELDS)delete _0x144669[_0x1157e3];delete _0x144669['routing'];let _0x297e91=null;if(_0x552725)delete _0x144669[_0x8ba3e0(0x11b)],_0x4826d0[_0x8ba3e0(0x123)]===_0x8ba3e0(0x131)?_0x144669[_0x8ba3e0(0x14f)]={'protocol':ENTERPRISE_ROUTING_PROTOCOL,'kind':ENTERPRISE_ROUTING_KIND,'domains':_0x4826d0[_0x8ba3e0(0x134)],'cdn':_0x4826d0[_0x8ba3e0(0x141)]}:Object['assign'](_0x144669,_0x54ba49);else{_0x297e91=await resolveRegion(_0x5b1e3f);if(_0x297e91===DEFAULT_LOVRABET_REGION)delete _0x144669[_0x8ba3e0(0x11b)];else _0x144669[_0x8ba3e0(0x11b)]=_0x297e91;}return writeScopedConfig(_0x144669,_0x44f47a),{'ok':!![],'message':_0x552725?_0x8ba3e0(0x121)+Object[_0x8ba3e0(0x146)](_0x4826d0[_0x8ba3e0(0x123)]===_0x8ba3e0(0x131)?_0x4826d0[_0x8ba3e0(0x134)]:_0x54ba49)[_0x8ba3e0(0x12c)](',\x20')+'.':_0x8ba3e0(0x119)+_0x297e91+'.','data':{'mode':_0x552725?'independent':_0x8ba3e0(0x126),'protocol':_0x4826d0['mode']==='enterprise-v1'?ENTERPRISE_ROUTING_PROTOCOL:undefined,'region':_0x297e91,'domains':_0x54ba49,'cdn':_0x4826d0[_0x8ba3e0(0x123)]===_0x8ba3e0(0x131)?_0x4826d0[_0x8ba3e0(0x141)]:undefined}};}export const configInitDefinition={'service':a61_0x2f488c(0x13f),'command':a61_0x2f488c(0x11e),'description':'Initialize\x20the\x20Lovrabet\x20region\x20or\x20independent-deployment\x20Domains','risk':'write','confirmationDescription':a61_0x2f488c(0x140),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':configInitFlags,'execute':executeConfigInit};
1
+ import{select}from"@inquirer/prompts";import{CliErrors}from"../../errors.js";import{readScopedConfig,writeScopedConfig}from"../../commands/config/shared.js";import{DOMAIN_CONFIG_FIELDS,LEGACY_DOMAIN_CONFIG_FIELDS,resolveDomainConfigInput}from"../../config/domain-config.js";import{ENTERPRISE_ROUTING_KIND,ENTERPRISE_ROUTING_PROTOCOL}from"../../generated/routing-contract.js";import{DEFAULT_LOVRABET_REGION,ENABLED_LOVRABET_REGION_VALUES,isEnabledLovrabetRegion}from"../../constant/region.js";import{getOfficialRoutingProfile}from"../../constant/routing-profile.js";import{GLOBAL_SCOPE_FLAG}from"../../commands/common/flags.js";export const configInitFlags=[GLOBAL_SCOPE_FLAG,{name:"region",type:"string",description:`Official Lovrabet region: ${ENABLED_LOVRABET_REGION_VALUES.join(", ")}`,enum:[...ENABLED_LOVRABET_REGION_VALUES]},{name:"domain-config",type:"string",description:"Independent-deployment Domain JSON file"},{name:"user-domain",type:"string",description:"Custom User HTTPS origin"},{
2
+ name:"api-domain",type:"string",description:"Custom platform API HTTPS origin"},{name:"runtime-domain",type:"string",description:"Custom Runtime HTTPS origin"},{name:"skill-domain",type:"string",description:"Custom SkillHub HTTPS origin"},{name:"kb-domain",type:"string",description:"Custom knowledge-base HTTPS origin"},{name:"kb-service-domain",type:"string",description:"Custom KB Service HTTPS origin"},{name:"app-domain",type:"string",description:"Custom Lovrabet workspace HTTPS origin"},{name:"local-domain",type:"string",description:"Custom local callback HTTPS origin"},{name:"certificate-domain",type:"string",description:"Custom certificate service HTTPS origin"}];async function resolveRegion(ctx){const explicit=ctx.str("region");if(explicit){if(!isEnabledLovrabetRegion(explicit)){throw CliErrors.validation(`Region "${explicit}" is not currently available.`,`Available regions: ${ENABLED_LOVRABET_REGION_VALUES.join(", ")}`)}return explicit}
3
+ if(ctx.nonInteractive)return DEFAULT_LOVRABET_REGION;try{return await select({message:"Select Lovrabet region",default:DEFAULT_LOVRABET_REGION,choices:ENABLED_LOVRABET_REGION_VALUES.map(region=>({name:`${getOfficialRoutingProfile(region).label} (${region})`,value:region}))})}catch(err){if(err?.name==="ExitPromptError"){throw CliErrors.cancelled()}throw err}}export async function executeConfigInit(ctx){const routingInput=resolveDomainConfigInput(ctx);const domains=routingInput.domains;const hasDomains=Object.keys(domains).length>0;if(hasDomains&&ctx.str("region")){throw CliErrors.validation("Choose either an official region or independent-deployment Domains, not both.")}if(!!domains.localDomain!==!!domains.certificateDomain){throw CliErrors.validation("Independent deployment requires --local-domain and --certificate-domain together.")}const scope=ctx.bool("global")?"global":"project";const config=readScopedConfig(scope);for(const field of DOMAIN_CONFIG_FIELDS)delete config[field]
4
+ ;for(const field of LEGACY_DOMAIN_CONFIG_FIELDS)delete config[field];delete config.routing;let region=null;if(hasDomains){delete config.region;if(routingInput.mode==="enterprise-v1"){config.routing={protocol:ENTERPRISE_ROUTING_PROTOCOL,kind:ENTERPRISE_ROUTING_KIND,domains:routingInput.manifestDomains,cdn:routingInput.cdn}}else{Object.assign(config,domains)}}else{region=await resolveRegion(ctx);if(region===DEFAULT_LOVRABET_REGION)delete config.region;else config.region=region}writeScopedConfig(config,scope);return{ok:true,message:hasDomains?`Rabetbase connection configured for independent deployment. Domains: ${Object.keys(routingInput.mode==="enterprise-v1"?routingInput.manifestDomains:domains).join(", ")}.`:`Rabetbase connection configured for region: ${region}.`,data:{mode:hasDomains?"independent":"official",protocol:routingInput.mode==="enterprise-v1"?ENTERPRISE_ROUTING_PROTOCOL:undefined,region:region,domains:domains,
5
+ cdn:routingInput.mode==="enterprise-v1"?routingInput.cdn:undefined}}}export const configInitDefinition={service:"config",command:"init",description:"Initialize the Lovrabet region or independent-deployment Domains",risk:"write",confirmationDescription:"Updates the selected Rabetbase region or independent-deployment Domain configuration. Cookie, output format, and app bindings stay unchanged.",requiresAuth:false,requiresAppCode:false,hasFormat:false,flags:configInitFlags,execute:executeConfigInit};
@@ -1 +1 @@
1
- const a62_0x41b0db=a62_0x2bec;(function(_0x33a53c,_0x3ee30a){const _0x3be5f5=a62_0x2bec,_0x4fe60f=_0x33a53c();while(!![]){try{const _0x9e881d=parseInt(_0x3be5f5(0x135))/0x1+-parseInt(_0x3be5f5(0x13c))/0x2+-parseInt(_0x3be5f5(0x13b))/0x3+-parseInt(_0x3be5f5(0x131))/0x4+-parseInt(_0x3be5f5(0x130))/0x5*(-parseInt(_0x3be5f5(0x136))/0x6)+parseInt(_0x3be5f5(0x139))/0x7+parseInt(_0x3be5f5(0x138))/0x8*(parseInt(_0x3be5f5(0x12f))/0x9);if(_0x9e881d===_0x3ee30a)break;else _0x4fe60f['push'](_0x4fe60f['shift']());}catch(_0x1e6395){_0x4fe60f['push'](_0x4fe60f['shift']());}}}(a62_0x4cb5,0xbb94f));function a62_0x2bec(_0x580e0f,_0x378fa2){_0x580e0f=_0x580e0f-0x12e;const _0x4cb538=a62_0x4cb5();let _0x2bec52=_0x4cb538[_0x580e0f];return _0x2bec52;}import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';function a62_0x4cb5(){const _0x5b83c5=['6216728daACpp','read','1343916KGinqO','2335634KBvllE','global','List\x20all\x20config\x20values','1917018jrOPqM','40vgsmoC','5813348gqWNef','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','boolean','list','1169563TERDSH','536088CUBYIA','bool','40urrDzI'];a62_0x4cb5=function(){return _0x5b83c5;};return a62_0x4cb5();}async function execute(_0x60b138){const _0x38d0cc=a62_0x2bec,_0x727673=_0x60b138[_0x38d0cc(0x137)]('global')?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x727673};}export const configListDefinition={'service':'config','command':a62_0x41b0db(0x134),'description':a62_0x41b0db(0x12e),'risk':a62_0x41b0db(0x13a),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a62_0x41b0db(0x13d),'type':a62_0x41b0db(0x133),'description':a62_0x41b0db(0x132),'default':![]}],'execute':execute};
1
+ import{readScopedConfig}from"../../commands/config/shared.js";import{readConfig}from"../../utils/config.js";async function execute(ctx){const config=ctx.bool("global")?readScopedConfig("global"):readConfig();return{ok:true,data:config}}export const configListDefinition={service:"config",command:"list",description:"List all config values",risk:"read",requiresAuth:false,requiresAppCode:false,flags:[{name:"global",type:"boolean",description:"Show global config only (~/.rabetbase.json)",default:false}],execute:execute};
@@ -1 +1,4 @@
1
- const a63_0x2a3c13=a63_0x5aa8;(function(_0x40acf4,_0x56a2a4){const _0x4f35b5=a63_0x5aa8,_0x4b69fa=_0x40acf4();while(!![]){try{const _0x4ed149=-parseInt(_0x4f35b5(0x17f))/0x1*(parseInt(_0x4f35b5(0x1ac))/0x2)+parseInt(_0x4f35b5(0x1a6))/0x3*(parseInt(_0x4f35b5(0x188))/0x4)+parseInt(_0x4f35b5(0x1a8))/0x5+parseInt(_0x4f35b5(0x18a))/0x6*(-parseInt(_0x4f35b5(0x17b))/0x7)+-parseInt(_0x4f35b5(0x190))/0x8*(-parseInt(_0x4f35b5(0x182))/0x9)+parseInt(_0x4f35b5(0x197))/0xa+-parseInt(_0x4f35b5(0x192))/0xb;if(_0x4ed149===_0x56a2a4)break;else _0x4b69fa['push'](_0x4b69fa['shift']());}catch(_0x41abac){_0x4b69fa['push'](_0x4b69fa['shift']());}}}(a63_0x5e18,0xae431));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';function a63_0x5e18(){const _0x540b6e=['Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','apps','3690783tmVGEf','Project','value','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','includes','Settable\x20top-level\x20keys:\x20','5118140apPKTJ','appcode','6nYitZC','env','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','locale','validation','object','8gFcEmq','string','6821155JKLgmw','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','Config\x20value','\x20(stored\x20as\x20a\x20single\x20app\x20profile)','Global','3414920QchwaY','\x20appcode\x20set\x20to:\x20','Usage:\x20','Missing\x20key.','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','Invalid\x20locale\x20value.','write','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','config','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','Missing\x20value.','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Top-level\x20key\x20\x22','riskLevel','join','3flKrWP','Invalid\x20value\x20for\x20\x22','1376765ezAeOm','boolean','bool','app','4GoUItj','global','length','\x22.\x20Allowed:\x20','5694899bkNZaw','`,\x20`','keys','str','79514vOtgmH'];a63_0x5e18=function(){return _0x540b6e;};return a63_0x5e18();}import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';function a63_0x5aa8(_0x540673,_0x553d56){_0x540673=_0x540673-0x17a;const _0x5e1855=a63_0x5e18();let _0x5aa8a4=_0x5e1855[_0x540673];return _0x5aa8a4;}import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from'../../config/domain-config.js';async function execute(_0x206189){const _0x5af050=a63_0x5aa8,_0x4ab50d=_0x206189[_0x5af050(0x17e)]('key'),_0x2e6801=_0x206189[_0x5af050(0x17e)](_0x5af050(0x184));if(!_0x4ab50d)throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x19a),'Usage:\x20'+CLI_BIN_NAME+_0x5af050(0x19e));if(_0x2e6801===undefined||_0x2e6801==='')throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x1a1),_0x5af050(0x199)+CLI_BIN_NAME+_0x5af050(0x19e));let _0x274f3e=_0x4ab50d,_0x2cf657=_0x2e6801;if(_0x2e6801[_0x5af050(0x1ae)]>0x1f4)throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x19b));if(_0x4ab50d===_0x5af050(0x1a4))throw CliErrors['validation'](_0x5af050(0x1a2));if(!isTopLevelConfigKey(_0x4ab50d))throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x1a3)+_0x4ab50d+'\x22\x20is\x20not\x20settable.',_0x5af050(0x187)+getTopLevelConfigKeySummary());if(CONFIG_ENUM_VALUES[_0x4ab50d]&&!CONFIG_ENUM_VALUES[_0x4ab50d][_0x5af050(0x186)](_0x2e6801))throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x1a7)+_0x4ab50d+_0x5af050(0x17a)+CONFIG_ENUM_VALUES[_0x4ab50d][_0x5af050(0x1a5)](',\x20'));if(_0x4ab50d===_0x5af050(0x18d)&&!normalizeLocale(_0x2e6801))throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x19c),_0x5af050(0x1a0));DOMAIN_CONFIG_FIELDS[_0x5af050(0x186)](_0x4ab50d)&&(_0x2cf657=normalizeDomainOrigin(_0x4ab50d,_0x2e6801));const _0x4fca6e={'global':_0x206189[_0x5af050(0x1aa)]('global')},_0x3cc3da=resolveWriteScope(_0x4fca6e),_0x365129=readScopedConfig(_0x3cc3da);_0x4ab50d===_0x5af050(0x1ab)&&(_0x274f3e='appcode',delete _0x365129[_0x5af050(0x1ab)]);_0x4ab50d===_0x5af050(0x18d)&&(_0x2cf657=normalizeLocale(_0x2e6801));if(_0x4ab50d===_0x5af050(0x18b)){_0x2cf657=normalizeEnv(_0x2e6801);if(!isProduction(_0x2cf657)&&!isDaily(_0x2cf657))throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x193),_0x5af050(0x185));}if(_0x4ab50d===_0x5af050(0x189)){const _0x8d9e21=_0x365129[_0x5af050(0x181)]&&typeof _0x365129['apps']===_0x5af050(0x18f)?Object[_0x5af050(0x17d)](_0x365129[_0x5af050(0x181)]):[];if(_0x8d9e21[_0x5af050(0x1ae)]>0x0)throw CliErrors[_0x5af050(0x18e)](_0x5af050(0x180),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20'+_0x2cf657+_0x5af050(0x17c)+CLI_BIN_NAME+_0x5af050(0x18c));const _0x3a6671=buildCanonicalProjectConfig({..._0x365129},{'appCodes':[_0x2cf657],'env':typeof _0x365129[_0x5af050(0x18b)]===_0x5af050(0x191)?_0x365129[_0x5af050(0x18b)]:undefined});writeScopedConfig(_0x3a6671,_0x3cc3da);const _0x3421e2=_0x3cc3da===_0x5af050(0x1ad)?'Global':_0x5af050(0x183);return{'ok':!![],'message':'✓\x20'+_0x3421e2+_0x5af050(0x198)+_0x2cf657+_0x5af050(0x195)};}_0x365129[_0x274f3e]=_0x2cf657,writeScopedConfig(_0x365129,_0x3cc3da);const _0xa748e1=_0x3cc3da===_0x5af050(0x1ad)?_0x5af050(0x196):_0x5af050(0x183);return{'ok':!![],'message':'✓\x20'+_0xa748e1+'\x20'+_0x274f3e+'\x20set\x20to:\x20'+_0x2cf657};}export const configSetDefinition={'service':a63_0x2a3c13(0x19f),'command':'set','description':'Set\x20a\x20config\x20value','risk':a63_0x2a3c13(0x19d),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a63_0x2a3c13(0x191),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a63_0x2a3c13(0x184),'type':a63_0x2a3c13(0x191),'description':a63_0x2a3c13(0x194),'required':!![]},{'name':a63_0x2a3c13(0x1ad),'type':a63_0x2a3c13(0x1a9),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
1
+ import{CliErrors}from"../../errors.js";import{buildCanonicalProjectConfig}from"../../config/schema.js";import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from"../../commands/config/shared.js";import{normalizeEnv,isProduction,isDaily}from"../../constant/env.js";import{DOMAIN_CONFIG_FIELDS,normalizeDomainOrigin}from"../../config/domain-config.js";async function execute(ctx){const key=ctx.str("key");const value=ctx.str("value");if(!key){throw CliErrors.validation("Missing key.",`Usage: ${CLI_BIN_NAME} config set --key <key> --value <value>`)}if(value===undefined||value===""){throw CliErrors.validation("Missing value.",`Usage: ${CLI_BIN_NAME} config set --key <key> --value <value>`)}let actualKey=key;let actualValue=value;if(value.length>500){throw CliErrors.validation("Config value is invalid or too long.")}if(key==="riskLevel"){
2
+ throw CliErrors.validation(`"riskLevel" cannot be changed via the CLI.`)}if(!isTopLevelConfigKey(key)){throw CliErrors.validation(`Top-level key "${key}" is not settable.`,`Settable top-level keys: ${getTopLevelConfigKeySummary()}`)}if(CONFIG_ENUM_VALUES[key]&&!CONFIG_ENUM_VALUES[key].includes(value)){throw CliErrors.validation(`Invalid value for "${key}". Allowed: ${CONFIG_ENUM_VALUES[key].join(", ")}`)}if(key==="locale"&&!normalizeLocale(value)){throw CliErrors.validation("Invalid locale value.","Supported: zh, en, zh-CN, en-US")}if(DOMAIN_CONFIG_FIELDS.includes(key)){actualValue=normalizeDomainOrigin(key,value)}const flags={global:ctx.bool("global")};const scope=resolveWriteScope(flags);const config=readScopedConfig(scope);if(key==="app"){actualKey="appcode";delete config.app}if(key==="locale"){actualValue=normalizeLocale(value)}if(key==="env"){actualValue=normalizeEnv(value);if(!isProduction(actualValue)&&!isDaily(actualValue)){
3
+ throw CliErrors.validation("Invalid value for env. Allowed: production, daily.",'Legacy alias "online" is accepted and stored as production.')}}if(key==="appcode"){const existingApps=config.apps&&typeof config.apps==="object"?Object.keys(config.apps):[];if(existingApps.length>0){throw CliErrors.validation('Cannot set top-level "appcode" when multi-app config already exists.',`Use \`${CLI_BIN_NAME} workspace add <name> --appcode ${actualValue}\`, \`${CLI_BIN_NAME} workspace use --app <name>\`, or pass \`--appcode\` on the command.`)}const nextConfig=buildCanonicalProjectConfig({...config},{appCodes:[actualValue],env:typeof config.env==="string"?config.env:undefined});writeScopedConfig(nextConfig,scope);const scopeLabel=scope==="global"?"Global":"Project";return{ok:true,message:`✓ ${scopeLabel} appcode set to: ${actualValue} (stored as a single app profile)`}}config[actualKey]=actualValue;writeScopedConfig(config,scope);const scopeLabel=scope==="global"?"Global":"Project";return{ok:true,
4
+ message:`✓ ${scopeLabel} ${actualKey} set to: ${actualValue}`}}export const configSetDefinition={service:"config",command:"set",description:"Set a config value",risk:"write",requiresAuth:false,requiresAppCode:false,flags:[{name:"key",type:"string",description:getConfigCommandKeyDescription(),required:true},{name:"value",type:"string",description:"Config value",required:true},{name:"global",type:"boolean",description:"Write to global config (~/.rabetbase.json)",default:false}],execute:execute};
@@ -1 +1,2 @@
1
- (function(_0x5623c2,_0x14c31e){var _0x533816=a64_0x8bcf,_0x2a688e=_0x5623c2();while(!![]){try{var _0x38ce1d=parseInt(_0x533816(0x1ed))/0x1*(parseInt(_0x533816(0x1f1))/0x2)+-parseInt(_0x533816(0x1fe))/0x3*(-parseInt(_0x533816(0x1f4))/0x4)+parseInt(_0x533816(0x1f6))/0x5*(parseInt(_0x533816(0x1f7))/0x6)+-parseInt(_0x533816(0x1ef))/0x7*(parseInt(_0x533816(0x1fc))/0x8)+-parseInt(_0x533816(0x1ec))/0x9+-parseInt(_0x533816(0x1fb))/0xa*(parseInt(_0x533816(0x1f5))/0xb)+parseInt(_0x533816(0x1f2))/0xc*(-parseInt(_0x533816(0x1fa))/0xd);if(_0x38ce1d===_0x14c31e)break;else _0x2a688e['push'](_0x2a688e['shift']());}catch(_0x1cd7e4){_0x2a688e['push'](_0x2a688e['shift']());}}}(a64_0x5de5,0xa7a30));import{CLI_BIN_NAME}from'../../constant/cli.js';function a64_0x8bcf(_0x9a6763,_0x13f467){_0x9a6763=_0x9a6763-0x1ec;var _0x5de5ed=a64_0x5de5();var _0x8bcf32=_0x5de5ed[_0x9a6763];return _0x8bcf32;}import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};function a64_0x5de5(){var _0x577850=['validation','13FDDLkL','320Ljktfy','1944sDBAPY','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','33oHGDVg','2279700BUObzB','4353AfwqzK','global','24451EbSNJv','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','204eMnoBP','82920VCzaMk','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','409160xAFGnv','266453ANeLwt','40715bTNmTm','738bdUUve','project'];a64_0x5de5=function(){return _0x577850;};return a64_0x5de5();}export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x424fc4){var _0x26983e=a64_0x8bcf;if(_0x424fc4[_0x26983e(0x1ee)])return'global';if(!isInProject())throw CliErrors[_0x26983e(0x1f9)](_0x26983e(0x1f3),_0x26983e(0x1f0)+CLI_BIN_NAME+_0x26983e(0x1fd));return _0x26983e(0x1f8);}export function readScopedConfig(_0x488cc4){return readConfigFile(resolveWriteConfigPath(_0x488cc4));}export function writeScopedConfig(_0x419d0f,_0x5b9f75){writeConfigFile(resolveWriteConfigPath(_0x5b9f75),_0x419d0f);}
1
+ import{CLI_BIN_NAME}from"../../constant/cli.js";import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from"../../context.js";import{CliErrors}from"../../errors.js";import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from"../../config/schema.js";export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(flags){if(flags.global)return"global";if(!isInProject()){throw CliErrors.validation("Not inside a project (no .rabetbase.json found).",`Add --global to write to ~/.rabetbase.json, or run \`${CLI_BIN_NAME} workspace init --appcode <code>\` first.`)}return"project"}export function readScopedConfig(scope){return readConfigFile(resolveWriteConfigPath(scope))}
2
+ export function writeScopedConfig(config,scope){writeConfigFile(resolveWriteConfigPath(scope),config)}
@@ -1 +1,9 @@
1
- const a65_0x559050=a65_0x544f;(function(_0x20b9ca,_0xe65264){const _0x5ccbee=a65_0x544f,_0x26dc21=_0x20b9ca();while(!![]){try{const _0x8a643=-parseInt(_0x5ccbee(0x96))/0x1*(-parseInt(_0x5ccbee(0x9f))/0x2)+-parseInt(_0x5ccbee(0x91))/0x3+parseInt(_0x5ccbee(0xc1))/0x4*(-parseInt(_0x5ccbee(0xaf))/0x5)+-parseInt(_0x5ccbee(0xac))/0x6*(parseInt(_0x5ccbee(0xd3))/0x7)+-parseInt(_0x5ccbee(0x8a))/0x8+-parseInt(_0x5ccbee(0x80))/0x9+parseInt(_0x5ccbee(0x9d))/0xa;if(_0x8a643===_0xe65264)break;else _0x26dc21['push'](_0x26dc21['shift']());}catch(_0x180a63){_0x26dc21['push'](_0x26dc21['shift']());}}}(a65_0x1667,0x6c735));import{CliErrors}from'../../errors.js';const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/,SUPPORTED_CARDINALITIES=new Set([a65_0x559050(0xc6),a65_0x559050(0xba)]),SUPPORTED_FIELD_TYPES=new Set([a65_0x559050(0x89),a65_0x559050(0x6e),'DATETIME',a65_0x559050(0xbc),a65_0x559050(0xbb),a65_0x559050(0xb1),a65_0x559050(0xcb),a65_0x559050(0x7e),'ADDRESS',a65_0x559050(0x88)]);export function isDatasetBatchDesign(_0x2e7c7c){const _0x1964e0=a65_0x559050;return isObject(_0x2e7c7c)&&_0x2e7c7c[_0x1964e0(0xcf)]==='dataset-batch';}export function validateDatasetBatchDesign(_0x1d3679){const _0x3ddd21=a65_0x559050;(!isObject(_0x1d3679)||_0x1d3679[_0x3ddd21(0xcf)]!==_0x3ddd21(0xd6))&&fail(_0x3ddd21(0x74));_0x1d3679[_0x3ddd21(0x81)]!==0x1&&fail(_0x3ddd21(0x7c));const _0x304577=objectArray(_0x1d3679[_0x3ddd21(0x9e)],_0x3ddd21(0x9e),0x1,0x14),_0x4f2c6d=objectArray(_0x1d3679['relations'],_0x3ddd21(0x84),0x0,0xc8),_0x30f3a9=objectArray(_0x1d3679['unresolvedRelations'],'unresolvedRelations',0x0,0xc8),_0x527818=new Set(),_0x2667f8=new Map();for(const [_0x29b955,_0x59c40d]of _0x304577['entries']()){const _0x59995e=requiredString(_0x59c40d[_0x3ddd21(0xad)],_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x6d));!LOCAL_KEY[_0x3ddd21(0xb5)](_0x59995e)&&fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x93)+LOCAL_KEY['source']+'.');_0x527818['has'](_0x59995e)&&fail(_0x3ddd21(0x86));_0x527818['add'](_0x59995e);!isObject(_0x59c40d[_0x3ddd21(0x72)])&&fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0xc9));rejectServerDatasetIdentity(_0x59c40d[_0x3ddd21(0x72)],'datasets['+_0x29b955+_0x3ddd21(0xcd));if(!isObject(_0x59c40d[_0x3ddd21(0x72)]['dataset']))fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x97));rejectServerDatasetIdentity(_0x59c40d['design']['dataset'],_0x3ddd21(0xb8)+_0x29b955+'].design.dataset'),requiredString(_0x59c40d['design'][_0x3ddd21(0xd5)][_0x3ddd21(0x82)],_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0xbf));'relations'in _0x59c40d[_0x3ddd21(0x72)]&&(!Array[_0x3ddd21(0xa6)](_0x59c40d[_0x3ddd21(0x72)]['relations'])||_0x59c40d[_0x3ddd21(0x72)][_0x3ddd21(0x84)][_0x3ddd21(0xc7)]!==0x0)&&fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x8d));const _0x3b98e0=objectArray(_0x59c40d[_0x3ddd21(0x72)]['fields'],_0x3ddd21(0xb8)+_0x29b955+'].design.fields',0x1,0xc8),_0x22d3c9=new Map();for(const [_0x1c7291,_0x254a00]of _0x3b98e0['entries']()){const _0x24cf4d=fieldName(_0x254a00);if(!_0x24cf4d)fail(_0x3ddd21(0xb8)+_0x29b955+'].design.fields['+_0x1c7291+_0x3ddd21(0x99));const _0x4f5940=_0x24cf4d['toLowerCase']();if(_0x22d3c9[_0x3ddd21(0xb0)](_0x4f5940))fail(_0x3ddd21(0xa5)+_0x59995e+_0x3ddd21(0xc8));const _0x5c23aa=stringValue(_0x254a00[_0x3ddd21(0x85)]??_0x254a00[_0x3ddd21(0xce)])[_0x3ddd21(0xa0)]();if(!SUPPORTED_FIELD_TYPES[_0x3ddd21(0xb0)](_0x5c23aa))fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x7d)+_0x1c7291+'].type\x20is\x20not\x20supported.');_0x22d3c9[_0x3ddd21(0xa8)](_0x4f5940,_0x5c23aa),[_0x254a00[_0x3ddd21(0xa4)],_0x254a00[_0x3ddd21(0x95)],_0x254a00[_0x3ddd21(0xd4)]]['some'](_0x58ac84=>stringValue(_0x58ac84))&&fail(_0x3ddd21(0xb8)+_0x29b955+_0x3ddd21(0x7d)+_0x1c7291+_0x3ddd21(0x70));}_0x2667f8[_0x3ddd21(0xa8)](_0x59995e,_0x22d3c9);}const _0xac7147=new Set(),_0xee5dcf=new Set();for(const [_0x3be205,_0x5062fa]of _0x4f2c6d[_0x3ddd21(0x76)]()){const _0x11d57f=validateRelation(_0x5062fa,_0x3be205,_0x527818,_0x2667f8);if(_0xac7147[_0x3ddd21(0xb0)](_0x11d57f))fail('Dataset\x20batch\x20relations\x20must\x20be\x20unique.');_0xac7147['add'](_0x11d57f);const _0x16776a=_0x11d57f[_0x3ddd21(0xa3)]('\x00',0x2)['join']('\x00');if(_0xee5dcf[_0x3ddd21(0xb0)](_0x16776a))fail(_0x3ddd21(0x8b));_0xee5dcf['add'](_0x16776a);}for(const [_0x4b14d4,_0x366354]of _0x30f3a9[_0x3ddd21(0x76)]()){requiredString(_0x366354[_0x3ddd21(0xa9)],'unresolvedRelations['+_0x4b14d4+_0x3ddd21(0x92)),validateConfidence(_0x366354[_0x3ddd21(0x73)],_0x3ddd21(0xae)+_0x4b14d4+_0x3ddd21(0x98));}return _0x1d3679;}function a65_0x544f(_0x411c35,_0x2e2c14){_0x411c35=_0x411c35-0x6c;const _0x1667db=a65_0x1667();let _0x544f1f=_0x1667db[_0x411c35];return _0x544f1f;}export function reconcileBatchResult(_0x2df936){const _0x4df768=a65_0x559050;if(!isObject(_0x2df936))return null;try{const _0x2855cb=stringArray(_0x2df936['expectedLocalKeys'],'expectedLocalKeys',0x1,0x14),_0x521d37=new Set(_0x2855cb);if(_0x521d37[_0x4df768(0xb7)]!==_0x2855cb['length']||_0x2855cb[_0x4df768(0xb2)](_0x454738=>!LOCAL_KEY[_0x4df768(0xb5)](_0x454738)))return null;const _0x502476=objectArray(_0x2df936[_0x4df768(0xc3)],_0x4df768(0xc3),0x1,0x14),_0x45fd43=new Map(),_0x2dc546=new Set();for(const _0x1a32ed of _0x502476){const _0x16c2c2=requiredString(_0x1a32ed[_0x4df768(0xad)],'createdDatasets[].localKey'),_0x36f9d1=requiredString(_0x1a32ed['code']??_0x1a32ed['datasetCode'],_0x4df768(0x8f));if(_0x45fd43[_0x4df768(0xb0)](_0x16c2c2)||_0x2dc546[_0x4df768(0xb0)](_0x36f9d1))return null;_0x45fd43[_0x4df768(0xa8)](_0x16c2c2,_0x36f9d1),_0x2dc546[_0x4df768(0x9a)](_0x36f9d1);}if(!sameSet(_0x521d37,new Set(_0x45fd43[_0x4df768(0xa2)]())))return null;const _0x436562=objectArray(_0x2df936[_0x4df768(0x78)],_0x4df768(0x78),0x0,0xc8),_0x159ca5=objectArray(_0x2df936[_0x4df768(0x6f)],_0x4df768(0x6f),0x0,0xc8),_0x2e2061=relationTupleSet(_0x436562,![],_0x45fd43),_0x4415e5=relationTupleSet(_0x159ca5,!![],_0x45fd43);if(!_0x2e2061||!_0x4415e5||!sameSet(_0x2e2061,_0x4415e5))return null;const _0x143aa0=objectArray(_0x2df936[_0x4df768(0xd7)],_0x4df768(0xd7),0x0,0xc8);return{'expectedLocalKeys':_0x2855cb,'expectedRelations':_0x436562,'createdDatasets':_0x502476,'createdRelations':_0x159ca5,'unresolvedRelations':_0x143aa0,...isObject(_0x2df936[_0x4df768(0x83)])?{'metrics':_0x2df936[_0x4df768(0x83)]}:{}};}catch{return null;}}function a65_0x1667(){const _0x4472f5=['set','reason','\x20connects\x20incompatible\x20field\x20types.','map','6lkNLrP','localKey','unresolvedRelations[','4144975MDufxz','has','MULTI_SELECT','some','fromField','\x20must\x20not\x20be\x20supplied\x20by\x20the\x20client.','test','get','size','datasets[','every','ONE_TO_ONE','SELECT','BOOLEAN','relationType','\x20non-empty\x20strings.','].design.dataset.datasetName','trim','4UkpVZa','toField','createdDatasets','modelId','isFinite','MANY_TO_ONE','length','\x20field\x20names\x20must\x20be\x20unique\x20ignoring\x20case.','].design\x20must\x20be\x20an\x20object.','validation','DATE_RANGE','.confidence','].design','fieldType','kind','string','\x20must\x20be\x20between\x200\x20and\x201.','.fromDatasetKey','1015833tNuEME','refTableLabelField','dataset','dataset-batch','unresolvedRelations','\x20references\x20an\x20unknown\x20field.','datasetId','].localKey','NUMBER','createdRelations',']\x20must\x20not\x20contain\x20embedded\x20relation\x20references.','toDatasetKey','design','confidence','Batch\x20--design-file\x20must\x20have\x20kind\x20\x22dataset-batch\x22.','\x20objects.','entries','.fromField','expectedRelations','cardinality','toDatasetCode','fromDatasetCode','Dataset\x20batch\x20schemaVersion\x20must\x20be\x201.','].design.fields[','USER','number','1029312ojngIW','schemaVersion','datasetName','metrics','relations','type','Dataset\x20batch\x20localKey\x20values\x20must\x20be\x20unique.','.reason','UPLOAD','TEXT','3419032UlRnek','Each\x20source\x20field\x20may\x20target\x20at\x20most\x20one\x20relation.','toLowerCase','].design.relations\x20must\x20be\x20an\x20empty\x20array;\x20use\x20top-level\x20relations.','object','createdDatasets[].code','\x20must\x20contain\x20','308274FTQPgp','].reason','].localKey\x20must\x20match\x20','.relationType\x20must\x20be\x20\x22lookup\x22.','refTableField','421SyqUTE','].design.dataset\x20must\x20be\x20an\x20object.','].confidence',']\x20must\x20have\x20a\x20non-empty\x20name\x20or\x20code.','add','lookup','join','17214010LUoJQI','datasets','1622KGhNUV','toUpperCase','fromDatasetKey','keys','split','refTable','Dataset\x20','isArray','code'];a65_0x1667=function(){return _0x4472f5;};return a65_0x1667();}function validateRelation(_0x5d70ed,_0x2491ff,_0x26ae5a,_0x138f56){const _0x1a4745=a65_0x559050,_0x1909b5='relations['+_0x2491ff+']',_0x32b263=requiredString(_0x5d70ed['fromDatasetKey'],_0x1909b5+_0x1a4745(0xd2)),_0x7d1e2=requiredString(_0x5d70ed[_0x1a4745(0x71)],_0x1909b5+'.toDatasetKey'),_0x3b55b3=requiredString(_0x5d70ed[_0x1a4745(0xb3)],_0x1909b5+_0x1a4745(0x77))['toLowerCase'](),_0x21f13e=requiredString(_0x5d70ed[_0x1a4745(0xc2)],_0x1909b5+'.toField')[_0x1a4745(0x8c)]();if(!_0x26ae5a[_0x1a4745(0xb0)](_0x32b263)||!_0x26ae5a[_0x1a4745(0xb0)](_0x7d1e2))fail(_0x1909b5+'\x20references\x20an\x20unknown\x20dataset\x20localKey.');const _0x544f8f=_0x138f56[_0x1a4745(0xb6)](_0x32b263)?.['get'](_0x3b55b3),_0x2bd015=_0x138f56[_0x1a4745(0xb6)](_0x7d1e2)?.['get'](_0x21f13e);if(_0x544f8f===undefined||_0x2bd015===undefined)fail(_0x1909b5+_0x1a4745(0xd8));if(_0x544f8f&&_0x2bd015&&_0x544f8f!==_0x2bd015)fail(_0x1909b5+_0x1a4745(0xaa));const _0x2d460d=stringValue(_0x5d70ed[_0x1a4745(0xbd)])||_0x1a4745(0x9b);if(_0x2d460d!==_0x1a4745(0x9b))fail(_0x1909b5+_0x1a4745(0x94));const _0x3d681b=stringValue(_0x5d70ed[_0x1a4745(0x79)])||_0x1a4745(0xc6);if(!SUPPORTED_CARDINALITIES[_0x1a4745(0xb0)](_0x3d681b))fail(_0x1909b5+'.cardinality\x20is\x20not\x20supported.');return requiredString(_0x5d70ed[_0x1a4745(0xa9)],_0x1909b5+_0x1a4745(0x87)),validateConfidence(_0x5d70ed[_0x1a4745(0x73)],_0x1909b5+_0x1a4745(0xcc)),tuple(_0x32b263,_0x3b55b3,_0x7d1e2,_0x21f13e,_0x1a4745(0x9b),_0x3d681b);}function relationTupleSet(_0x55d11a,_0x5e0f81,_0x102dfa){const _0x3c515e=a65_0x559050,_0x2e1b5f=new Set();for(const _0x4b422a of _0x55d11a){const _0x4b8c41=stringValue(_0x4b422a[_0x3c515e(0xa1)]),_0xc7239e=stringValue(_0x4b422a['toDatasetKey']),_0x576fb0=stringValue(_0x4b422a[_0x3c515e(0xb3)])['toLowerCase'](),_0x4bb274=stringValue(_0x4b422a[_0x3c515e(0xc2)])[_0x3c515e(0x8c)](),_0x195801=stringValue(_0x4b422a[_0x3c515e(0xbd)]),_0x270af=stringValue(_0x4b422a[_0x3c515e(0x79)]);if(!_0x4b8c41||!_0xc7239e||!_0x576fb0||!_0x4bb274||_0x195801!=='lookup'||!SUPPORTED_CARDINALITIES[_0x3c515e(0xb0)](_0x270af))return null;if(!_0x102dfa[_0x3c515e(0xb0)](_0x4b8c41)||!_0x102dfa[_0x3c515e(0xb0)](_0xc7239e))return null;if(_0x5e0f81&&(stringValue(_0x4b422a[_0x3c515e(0x7b)])!==_0x102dfa['get'](_0x4b8c41)||stringValue(_0x4b422a[_0x3c515e(0x7a)])!==_0x102dfa['get'](_0xc7239e)))return null;const _0x3edff0=tuple(_0x4b8c41,_0x576fb0,_0xc7239e,_0x4bb274,_0x195801,_0x270af);if(_0x2e1b5f[_0x3c515e(0xb0)](_0x3edff0))return null;_0x2e1b5f[_0x3c515e(0x9a)](_0x3edff0);}return _0x2e1b5f;}function rejectServerDatasetIdentity(_0x5eed25,_0x4b937b){const _0x6adde5=a65_0x559050;for(const _0x4f53de of['id',_0x6adde5(0x6c),_0x6adde5(0xc4),_0x6adde5(0xa7),'datasetCode','modelCode']){if(_0x5eed25[_0x4f53de]!==undefined&&_0x5eed25[_0x4f53de]!==null&&_0x5eed25[_0x4f53de]!=='')fail(_0x4b937b+'.'+_0x4f53de+_0x6adde5(0xb4));}}function objectArray(_0x1e6f2c,_0x1171f9,_0x285695,_0x434960){const _0x463e6d=a65_0x559050;return(!Array[_0x463e6d(0xa6)](_0x1e6f2c)||_0x1e6f2c[_0x463e6d(0xc7)]<_0x285695||_0x1e6f2c['length']>_0x434960||_0x1e6f2c[_0x463e6d(0xb2)](_0x3cd283=>!isObject(_0x3cd283)))&&fail(_0x1171f9+_0x463e6d(0x90)+_0x285695+'..'+_0x434960+_0x463e6d(0x75)),_0x1e6f2c;}function stringArray(_0x2c5bfe,_0x24826f,_0x743f5,_0x3f8d2e){const _0x2e34d7=a65_0x559050;return(!Array['isArray'](_0x2c5bfe)||_0x2c5bfe['length']<_0x743f5||_0x2c5bfe['length']>_0x3f8d2e||_0x2c5bfe[_0x2e34d7(0xb2)](_0x47abd6=>typeof _0x47abd6!==_0x2e34d7(0xd0)||!_0x47abd6[_0x2e34d7(0xc0)]()))&&fail(_0x24826f+'\x20must\x20contain\x20'+_0x743f5+'..'+_0x3f8d2e+_0x2e34d7(0xbe)),_0x2c5bfe;}function requiredString(_0x2a706b,_0x426a49){const _0x557196=stringValue(_0x2a706b);if(!_0x557196)fail(_0x426a49+'\x20is\x20required.');return _0x557196;}function stringValue(_0x148f92){const _0x2aa088=a65_0x559050;return typeof _0x148f92===_0x2aa088(0xd0)?_0x148f92[_0x2aa088(0xc0)]():'';}function fieldName(_0x3971e1){const _0x3ed973=a65_0x559050;return stringValue(_0x3971e1[_0x3ed973(0xa7)]??_0x3971e1['fieldCode']??_0x3971e1['name']??_0x3971e1['fieldName']);}function validateConfidence(_0x243529,_0x4fadef){const _0x3b0891=a65_0x559050;_0x243529!==undefined&&_0x243529!==null&&(typeof _0x243529!==_0x3b0891(0x7f)||!Number[_0x3b0891(0xc5)](_0x243529)||_0x243529<0x0||_0x243529>0x1)&&fail(_0x4fadef+_0x3b0891(0xd1));}function tuple(..._0x1e2be1){const _0x175fcd=a65_0x559050;return _0x1e2be1[_0x175fcd(0xab)]((_0x1cf8b1,_0x59db35)=>_0x59db35===0x1||_0x59db35===0x3?_0x1cf8b1[_0x175fcd(0x8c)]():_0x1cf8b1)[_0x175fcd(0x9c)]('\x00');}function sameSet(_0x5ca061,_0x242658){const _0x19590c=a65_0x559050;return _0x5ca061['size']===_0x242658['size']&&[..._0x5ca061][_0x19590c(0xb9)](_0x19870a=>_0x242658['has'](_0x19870a));}function isObject(_0x28546d){const _0x3fdb3f=a65_0x559050;return typeof _0x28546d===_0x3fdb3f(0x8e)&&_0x28546d!==null&&!Array['isArray'](_0x28546d);}function fail(_0x1b48ae){const _0x1444ba=a65_0x559050;throw CliErrors[_0x1444ba(0xca)](_0x1b48ae);}
1
+ import{CliErrors}from"../../errors.js";const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/;const SUPPORTED_CARDINALITIES=new Set(["MANY_TO_ONE","ONE_TO_ONE"]);const SUPPORTED_FIELD_TYPES=new Set(["TEXT","NUMBER","DATETIME","BOOLEAN","SELECT","MULTI_SELECT","DATE_RANGE","USER","ADDRESS","UPLOAD"]);export function isDatasetBatchDesign(value){return isObject(value)&&value.kind==="dataset-batch"}export function validateDatasetBatchDesign(value){if(!isObject(value)||value.kind!=="dataset-batch"){fail('Batch --design-file must have kind "dataset-batch".')}if(value.schemaVersion!==1){fail("Dataset batch schemaVersion must be 1.")}const datasets=objectArray(value.datasets,"datasets",1,20);const relations=objectArray(value.relations,"relations",0,200);const unresolved=objectArray(value.unresolvedRelations,"unresolvedRelations",0,200);const datasetKeys=new Set;const fieldsByDataset=new Map;for(const[index,item]of datasets.entries()){const localKey=requiredString(item.localKey,`datasets[${index}].localKey`)
2
+ ;if(!LOCAL_KEY.test(localKey)){fail(`datasets[${index}].localKey must match ${LOCAL_KEY.source}.`)}if(datasetKeys.has(localKey)){fail("Dataset batch localKey values must be unique.")}datasetKeys.add(localKey);if(!isObject(item.design)){fail(`datasets[${index}].design must be an object.`)}rejectServerDatasetIdentity(item.design,`datasets[${index}].design`);if(!isObject(item.design.dataset))fail(`datasets[${index}].design.dataset must be an object.`);rejectServerDatasetIdentity(item.design.dataset,`datasets[${index}].design.dataset`);requiredString(item.design.dataset.datasetName,`datasets[${index}].design.dataset.datasetName`);if("relations"in item.design&&(!Array.isArray(item.design.relations)||item.design.relations.length!==0)){fail(`datasets[${index}].design.relations must be an empty array; use top-level relations.`)}const fields=objectArray(item.design.fields,`datasets[${index}].design.fields`,1,200);const fieldTypes=new Map;for(const[fieldIndex,field]of fields.entries()){
3
+ const name=fieldName(field);if(!name)fail(`datasets[${index}].design.fields[${fieldIndex}] must have a non-empty name or code.`);const normalized=name.toLowerCase();if(fieldTypes.has(normalized))fail(`Dataset ${localKey} field names must be unique ignoring case.`);const type=stringValue(field.type??field.fieldType).toUpperCase();if(!SUPPORTED_FIELD_TYPES.has(type))fail(`datasets[${index}].design.fields[${fieldIndex}].type is not supported.`);fieldTypes.set(normalized,type);if([field.refTable,field.refTableField,field.refTableLabelField].some(entry=>stringValue(entry))){fail(`datasets[${index}].design.fields[${fieldIndex}] must not contain embedded relation references.`)}}fieldsByDataset.set(localKey,fieldTypes)}const relationTuples=new Set;const sources=new Set;for(const[index,relation]of relations.entries()){const tuple=validateRelation(relation,index,datasetKeys,fieldsByDataset);if(relationTuples.has(tuple))fail("Dataset batch relations must be unique.");relationTuples.add(tuple)
4
+ ;const source=tuple.split("\0",2).join("\0");if(sources.has(source))fail("Each source field may target at most one relation.");sources.add(source)}for(const[index,relation]of unresolved.entries()){requiredString(relation.reason,`unresolvedRelations[${index}].reason`);validateConfidence(relation.confidence,`unresolvedRelations[${index}].confidence`)}return value}export function reconcileBatchResult(value){if(!isObject(value))return null;try{const expectedLocalKeys=stringArray(value.expectedLocalKeys,"expectedLocalKeys",1,20);const expectedSet=new Set(expectedLocalKeys);if(expectedSet.size!==expectedLocalKeys.length||expectedLocalKeys.some(key=>!LOCAL_KEY.test(key)))return null;const createdDatasets=objectArray(value.createdDatasets,"createdDatasets",1,20);const codes=new Map;const uniqueCodes=new Set;for(const dataset of createdDatasets){const localKey=requiredString(dataset.localKey,"createdDatasets[].localKey")
5
+ ;const code=requiredString(dataset.code??dataset.datasetCode,"createdDatasets[].code");if(codes.has(localKey)||uniqueCodes.has(code))return null;codes.set(localKey,code);uniqueCodes.add(code)}if(!sameSet(expectedSet,new Set(codes.keys())))return null;const expectedRelations=objectArray(value.expectedRelations,"expectedRelations",0,200);const createdRelations=objectArray(value.createdRelations,"createdRelations",0,200);const expectedTuples=relationTupleSet(expectedRelations,false,codes);const createdTuples=relationTupleSet(createdRelations,true,codes);if(!expectedTuples||!createdTuples||!sameSet(expectedTuples,createdTuples))return null;const unresolvedRelations=objectArray(value.unresolvedRelations,"unresolvedRelations",0,200);return{expectedLocalKeys:expectedLocalKeys,expectedRelations:expectedRelations,createdDatasets:createdDatasets,createdRelations:createdRelations,unresolvedRelations:unresolvedRelations,...isObject(value.metrics)?{metrics:value.metrics}:{}}}catch{return null}}
6
+ function validateRelation(relation,index,datasetKeys,fieldsByDataset){const prefix=`relations[${index}]`;const fromKey=requiredString(relation.fromDatasetKey,`${prefix}.fromDatasetKey`);const toKey=requiredString(relation.toDatasetKey,`${prefix}.toDatasetKey`);const fromField=requiredString(relation.fromField,`${prefix}.fromField`).toLowerCase();const toField=requiredString(relation.toField,`${prefix}.toField`).toLowerCase();if(!datasetKeys.has(fromKey)||!datasetKeys.has(toKey))fail(`${prefix} references an unknown dataset localKey.`);const fromType=fieldsByDataset.get(fromKey)?.get(fromField);const toType=fieldsByDataset.get(toKey)?.get(toField);if(fromType===undefined||toType===undefined)fail(`${prefix} references an unknown field.`);if(fromType&&toType&&fromType!==toType)fail(`${prefix} connects incompatible field types.`);const relationType=stringValue(relation.relationType)||"lookup";if(relationType!=="lookup")fail(`${prefix}.relationType must be "lookup".`)
7
+ ;const cardinality=stringValue(relation.cardinality)||"MANY_TO_ONE";if(!SUPPORTED_CARDINALITIES.has(cardinality))fail(`${prefix}.cardinality is not supported.`);requiredString(relation.reason,`${prefix}.reason`);validateConfidence(relation.confidence,`${prefix}.confidence`);return tuple(fromKey,fromField,toKey,toField,"lookup",cardinality)}function relationTupleSet(relations,requireCodes,codes){const result=new Set;for(const relation of relations){const fromKey=stringValue(relation.fromDatasetKey);const toKey=stringValue(relation.toDatasetKey);const fromField=stringValue(relation.fromField).toLowerCase();const toField=stringValue(relation.toField).toLowerCase();const relationType=stringValue(relation.relationType);const cardinality=stringValue(relation.cardinality);if(!fromKey||!toKey||!fromField||!toField||relationType!=="lookup"||!SUPPORTED_CARDINALITIES.has(cardinality))return null;if(!codes.has(fromKey)||!codes.has(toKey))return null
8
+ ;if(requireCodes&&(stringValue(relation.fromDatasetCode)!==codes.get(fromKey)||stringValue(relation.toDatasetCode)!==codes.get(toKey)))return null;const key=tuple(fromKey,fromField,toKey,toField,relationType,cardinality);if(result.has(key))return null;result.add(key)}return result}function rejectServerDatasetIdentity(value,path){for(const key of["id","datasetId","modelId","code","datasetCode","modelCode"]){if(value[key]!==undefined&&value[key]!==null&&value[key]!=="")fail(`${path}.${key} must not be supplied by the client.`)}}function objectArray(value,path,min,max){if(!Array.isArray(value)||value.length<min||value.length>max||value.some(item=>!isObject(item))){fail(`${path} must contain ${min}..${max} objects.`)}return value}function stringArray(value,path,min,max){if(!Array.isArray(value)||value.length<min||value.length>max||value.some(item=>typeof item!=="string"||!item.trim())){fail(`${path} must contain ${min}..${max} non-empty strings.`)}return value}
9
+ function requiredString(value,path){const result=stringValue(value);if(!result)fail(`${path} is required.`);return result}function stringValue(value){return typeof value==="string"?value.trim():""}function fieldName(field){return stringValue(field.code??field.fieldCode??field.name??field.fieldName)}function validateConfidence(value,path){if(value!==undefined&&value!==null&&(typeof value!=="number"||!Number.isFinite(value)||value<0||value>1)){fail(`${path} must be between 0 and 1.`)}}function tuple(...parts){return parts.map((part,index)=>index===1||index===3?part.toLowerCase():part).join("\0")}function sameSet(left,right){return left.size===right.size&&[...left].every(item=>right.has(item))}function isObject(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}function fail(message){throw CliErrors.validation(message)}
@@ -1 +1,10 @@
1
- const a66_0x3deab3=a66_0x1282;(function(_0x3f3e70,_0x10f5a0){const _0x4205e3=a66_0x1282,_0x34e9d3=_0x3f3e70();while(!![]){try{const _0x31571c=parseInt(_0x4205e3(0x131))/0x1*(parseInt(_0x4205e3(0xf5))/0x2)+-parseInt(_0x4205e3(0xe9))/0x3*(-parseInt(_0x4205e3(0x100))/0x4)+parseInt(_0x4205e3(0xed))/0x5*(-parseInt(_0x4205e3(0xfc))/0x6)+parseInt(_0x4205e3(0x128))/0x7*(-parseInt(_0x4205e3(0x120))/0x8)+parseInt(_0x4205e3(0x101))/0x9*(-parseInt(_0x4205e3(0x111))/0xa)+parseInt(_0x4205e3(0x112))/0xb*(-parseInt(_0x4205e3(0x119))/0xc)+parseInt(_0x4205e3(0x109))/0xd*(parseInt(_0x4205e3(0x105))/0xe);if(_0x31571c===_0x10f5a0)break;else _0x34e9d3['push'](_0x34e9d3['shift']());}catch(_0x465635){_0x34e9d3['push'](_0x34e9d3['shift']());}}}(a66_0x59b8,0x3a0b8));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDbTableBusinessGroup,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DB_TABLE_BACKEND_PATH=a66_0x3deab3(0x138),METADATA_BACKEND_PATH=a66_0x3deab3(0xf9),UNGROUPED_BUSINESS_GROUP=a66_0x3deab3(0x130);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x5e5eb1,input:_0x34b7ae,dryRun:_0xdb9805}){const _0x3bb0a5=a66_0x3deab3;validateInput(_0x34b7ae);const _0xc004cc=normalizeBusinessGroupArgument(_0x34b7ae[_0x3bb0a5(0x135)]),_0xb6259f=await getDatasetDetail(_0x34b7ae[_0x3bb0a5(0x129)]),_0x462df0=resolveBusinessGroupDataset(_0xb6259f,_0x34b7ae[_0x3bb0a5(0x129)]);assertBusinessGroupUpdateSupported(_0x462df0,_0xc004cc);const _0x478714=loadCurrentBusinessGroup(_0xb6259f,_0x462df0);assertExpectedBusinessGroup(_0x478714,_0x34b7ae[_0x3bb0a5(0x137)]);const _0x1192fa=buildBackendPlan(_0x5e5eb1,_0x462df0,_0xc004cc),_0x2878b5=_0x478714!==_0xc004cc;let _0x30b3fe;if(_0x2878b5&&!_0xdb9805){_0x1192fa[_0x3bb0a5(0x12c)]===_0x3bb0a5(0x13b)?await updateDbTableBusinessGroup(_0x1192fa[_0x3bb0a5(0x133)]):await updateErBusinessGroup(_0x1192fa[_0x3bb0a5(0x133)]);const _0x58b78b=await getDatasetDetail(_0x462df0[_0x3bb0a5(0x129)]),_0x363a99=resolveBusinessGroupDataset(_0x58b78b,_0x462df0[_0x3bb0a5(0x129)]),_0x35aa36=loadCurrentBusinessGroup(_0x58b78b,_0x363a99);if(_0x35aa36!==_0xc004cc)throw CliErrors[_0x3bb0a5(0x139)]('Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.',_0x3bb0a5(0x12b)+JSON['stringify'](displayBusinessGroup(_0xc004cc))+_0x3bb0a5(0x113)+JSON[_0x3bb0a5(0x114)](displayBusinessGroup(_0x35aa36))+'.');_0x30b3fe={'verified':!![],'status':_0x3bb0a5(0x122),'afterReadback':{'businessGroup':displayBusinessGroup(_0x35aa36)}};}else!_0x2878b5&&(_0x30b3fe={'verified':!![],'status':_0x3bb0a5(0xfd),'afterReadback':{'businessGroup':displayBusinessGroup(_0x478714)}});const _0x1cf52e={'operation':_0x3bb0a5(0xef),'appCode':_0x5e5eb1,'selector':{'code':_0x462df0[_0x3bb0a5(0x129)]},'dataset':{'id':_0x462df0['id'],'code':_0x462df0[_0x3bb0a5(0x129)],'name':_0x462df0[_0x3bb0a5(0x126)],'sourceType':_0x462df0[_0x3bb0a5(0x10d)]},'before':{'businessGroup':displayBusinessGroup(_0x478714)},'after':{'businessGroup':displayBusinessGroup(_0xc004cc)},'changed':_0x2878b5,'dryRun':_0xdb9805,'submitted':_0x2878b5&&!_0xdb9805,'backend':{'method':_0x1192fa[_0x3bb0a5(0xf0)],'path':_0x1192fa[_0x3bb0a5(0xec)],'payload':_0x1192fa[_0x3bb0a5(0x133)]},..._0x30b3fe?{'verification':_0x30b3fe}:{},'warnings':[]};return{'ok':!![],'data':_0x1cf52e,'message':_0x2878b5?_0xdb9805?_0x3bb0a5(0xf1)+_0x462df0[_0x3bb0a5(0x129)]:_0x3bb0a5(0x132)+_0x462df0[_0x3bb0a5(0x129)]:_0x3bb0a5(0x134)+_0x462df0[_0x3bb0a5(0x129)]};}export const datasetBusinessGroupUpdate={'service':'dataset','command':'business-group-update','description':a66_0x3deab3(0xf4),'risk':a66_0x3deab3(0x12d),'flags':[CODE_FLAG,{'name':a66_0x3deab3(0x10e),'type':'string','required':!![],'description':'Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it'},{'name':a66_0x3deab3(0x11c),'type':'string','required':![],'description':a66_0x3deab3(0x10c)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x356916){validateInput(readBusinessGroupUpdateInput(_0x356916));},async 'dryRun'(_0x37bef6){const _0x4221b0=a66_0x3deab3,_0x4903ed=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x37bef6['appCode'],'input':readBusinessGroupUpdateInput(_0x37bef6),'dryRun':!![]});return{'method':_0x4903ed[_0x4221b0(0x12f)][_0x4221b0(0xff)][_0x4221b0(0xf0)],'url':_0x4903ed[_0x4221b0(0x12f)][_0x4221b0(0xff)][_0x4221b0(0xec)],'body':_0x4903ed[_0x4221b0(0x12f)]['backend'][_0x4221b0(0x133)],'description':_0x4903ed[_0x4221b0(0xfe)],..._0x4903ed[_0x4221b0(0x12f)]};},async 'execute'(_0x561013){const _0x107135=a66_0x3deab3;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x561013[_0x107135(0x121)],'input':readBusinessGroupUpdateInput(_0x561013),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x3a7255){const _0x3b8b8c=a66_0x3deab3,_0x219ed6=_0x3a7255[_0x3b8b8c(0x102)](_0x3b8b8c(0x11c));return{'code':trim(_0x3a7255[_0x3b8b8c(0x102)](_0x3b8b8c(0x129))),'businessGroup':_0x3a7255[_0x3b8b8c(0x102)](_0x3b8b8c(0x10e)),'expectBusinessGroup':_0x219ed6===undefined||_0x219ed6===''?undefined:_0x219ed6};}function validateInput(_0x44d5d6){const _0x24d770=a66_0x3deab3;if(!trim(_0x44d5d6[_0x24d770(0x129)]))throw CliErrors[_0x24d770(0x12a)](_0x24d770(0x118));if(_0x44d5d6[_0x24d770(0x135)]===undefined)throw CliErrors['validation'](_0x24d770(0x107));if(!trim(_0x44d5d6[_0x24d770(0x135)]))throw CliErrors[_0x24d770(0x12a)](_0x24d770(0x104));}function assertBusinessGroupUpdateSupported(_0x285cbb,_0x15514c){const _0x3481c1=a66_0x3deab3;if(_0x285cbb[_0x3481c1(0x10d)]===_0x3481c1(0x117)&&!_0x15514c)throw CliErrors[_0x3481c1(0x12a)](_0x3481c1(0x11e));}function resolveBusinessGroupDataset(_0x245f8c,_0x8f2a75){const _0x4f79c4=a66_0x3deab3,_0x168102=asPlainObject(_0x245f8c[_0x4f79c4(0xf7)]),_0x20eb00=asPlainObject(_0x245f8c[_0x4f79c4(0xea)]),_0x255934=resolveSourceType(_0x245f8c,_0x168102,_0x20eb00),_0x5e072d=firstString(_0x245f8c[_0x4f79c4(0x103)],_0x245f8c[_0x4f79c4(0x129)],_0x168102[_0x4f79c4(0x11d)],_0x8f2a75)||_0x8f2a75;return{'id':firstNumber(_0x245f8c['modelId'],_0x245f8c['id'],_0x168102['datasetId'])??firstString(_0x245f8c[_0x4f79c4(0xf6)],_0x245f8c['id'],_0x168102[_0x4f79c4(0xf3)])??null,'code':_0x5e072d,'name':firstString(_0x245f8c[_0x4f79c4(0x126)],_0x168102[_0x4f79c4(0x125)],_0x168102['name'])||null,'sourceType':_0x255934,'dbTableSelector':_0x255934===_0x4f79c4(0x117)?{'dbLinkId':firstNumber(_0x20eb00[_0x4f79c4(0x11b)]),'tableName':firstString(_0x20eb00['tableName'])||null}:null};}function resolveSourceType(_0x40c809,_0x34d0c3,_0x5c496b){const _0x3716ff=a66_0x3deab3,_0x56e1ab=firstString(_0x40c809[_0x3716ff(0x123)],_0x40c809[_0x3716ff(0x10d)],_0x34d0c3[_0x3716ff(0x123)],_0x34d0c3[_0x3716ff(0x10d)])?.[_0x3716ff(0x124)]()[_0x3716ff(0x13c)]();if(_0x56e1ab===_0x3716ff(0x117)||_0x56e1ab==='METADATA')return _0x56e1ab;if(Object[_0x3716ff(0x136)](_0x5c496b)[_0x3716ff(0x110)]>0x0)return'DB_TABLE';throw CliErrors[_0x3716ff(0x12a)](_0x3716ff(0xeb));}function a66_0x59b8(){const _0x5a41d9=[',\x20actual\x20','stringify','dbLinkId','metadata','DB_TABLE','--code\x20is\x20required','1291452CyZrjc','isFinite','dbId','expect-business-group','datasetCode','Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.','hasOwnProperty','432AwnrYO','appCode','matched','source','trim','datasetName','name','tableName','51569uRqORI','code','validation','Expected\x20','kind','write','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','data','ungrouped','121798MCmMtw','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','payload','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','businessGroup','keys','expectBusinessGroup','/smartapi/dblink/updateTableBusinessGroup','apiError','string','db-table','toUpperCase','object','3RBCDyJ','dbtableConfig','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','path','5990leqzVn','dbTableSelector','update','method','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','Expectation\x20mismatch\x20at\x20businessGroup','datasetId','Update\x20business\x20scenario\x20group','6cvejJt','modelId','dataset','value','/smartapi/question/er-config/business-group/edit','isArray','found','798VGxLDH','unchanged','message','backend','62968SyOrwg','280179guzJiO','str','modelCode','--business-group\x20must\x20not\x20be\x20blank','56RHdNqG','call','--business-group\x20is\x20required','POST','3009799ZocFFQ','number','parse','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','sourceType','business-group','extend','length','130RSXujx','11Dqezyb'];a66_0x59b8=function(){return _0x5a41d9;};return a66_0x59b8();}function loadCurrentBusinessGroup(_0x189fb2,_0x43dfe0){const _0xc1c63b=a66_0x3deab3,_0x168744=readBusinessGroupFromDatasetDetail(_0x189fb2,_0x43dfe0['sourceType']);if(_0x168744[_0xc1c63b(0xfb)])return normalizeBusinessGroup(_0x168744[_0xc1c63b(0xf8)]);return'';}function a66_0x1282(_0x374c8d,_0x24f2a3){_0x374c8d=_0x374c8d-0xe9;const _0x59b872=a66_0x59b8();let _0x128258=_0x59b872[_0x374c8d];return _0x128258;}function readBusinessGroupFromDatasetDetail(_0x27b526,_0x4d9356){const _0x1b9321=a66_0x3deab3,_0x35122e=asPlainObject(_0x27b526[_0x1b9321(0xf7)]),_0x594402=firstPresent(_0x27b526['businessGroup']);if(_0x594402['found'])return _0x594402;const _0x48a83b=firstPresent(_0x35122e[_0x1b9321(0x135)]);if(_0x48a83b[_0x1b9321(0xfb)])return _0x48a83b;if(_0x4d9356==='DB_TABLE')return{'found':![]};const _0x2cbdae=readBusinessGroupFromExtend(_0x27b526[_0x1b9321(0x10f)]);if(_0x2cbdae[_0x1b9321(0xfb)])return _0x2cbdae;return readBusinessGroupFromExtend(_0x35122e[_0x1b9321(0x10f)]);}function readBusinessGroupFromExtend(_0x44f6cc){const _0x10ea7e=a66_0x3deab3;if(_0x44f6cc===undefined||_0x44f6cc===null||_0x44f6cc==='')return{'found':![]};if(typeof _0x44f6cc===_0x10ea7e(0x13a))try{const _0x4e09e9=JSON[_0x10ea7e(0x10b)](_0x44f6cc);return readBusinessGroupFromExtend(_0x4e09e9);}catch{return{'found':![]};}const _0xdc40f5=asPlainObject(_0x44f6cc);if(Object['prototype'][_0x10ea7e(0x11f)][_0x10ea7e(0x106)](_0xdc40f5,_0x10ea7e(0x135)))return{'found':!![],'value':_0xdc40f5[_0x10ea7e(0x135)]};return{'found':![]};}function firstPresent(..._0x3241e3){for(const _0x10370d of _0x3241e3){if(_0x10370d!==undefined&&_0x10370d!==null)return{'found':!![],'value':_0x10370d};}return{'found':![]};}function assertExpectedBusinessGroup(_0x7fbbe2,_0x34c56c){const _0x2be7dc=a66_0x3deab3;if(_0x34c56c===undefined)return;const _0x14fbc7=normalizeBusinessGroupArgument(_0x34c56c);if(_0x7fbbe2!==_0x14fbc7)throw CliErrors[_0x2be7dc(0x12a)](_0x2be7dc(0xf2),_0x2be7dc(0x12b)+JSON[_0x2be7dc(0x114)](_0x14fbc7)+_0x2be7dc(0x113)+JSON[_0x2be7dc(0x114)](_0x7fbbe2));}function buildBackendPlan(_0x33c2b6,_0xf38b0d,_0xcbaa03){const _0x33ad9e=a66_0x3deab3;if(_0xf38b0d[_0x33ad9e(0x10d)]==='DB_TABLE'){if(!_0xf38b0d['dbTableSelector']||_0xf38b0d[_0x33ad9e(0xee)]['dbLinkId']===null||!_0xf38b0d[_0x33ad9e(0xee)][_0x33ad9e(0x127)])throw CliErrors[_0x33ad9e(0x12a)]('DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.',_0x33ad9e(0x12e));return{'kind':'db-table','method':_0x33ad9e(0x108),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0xf38b0d[_0x33ad9e(0xee)][_0x33ad9e(0x115)],'tableName':_0xf38b0d['dbTableSelector'][_0x33ad9e(0x127)],'businessGroup':_0xcbaa03}};}return{'kind':_0x33ad9e(0x116),'method':'POST','path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x33c2b6,'datasetCode':_0xf38b0d['code'],'businessGroup':_0xcbaa03}};}function normalizeBusinessGroup(_0x1c1f50){if(_0x1c1f50===undefined||_0x1c1f50===null)return'';return String(_0x1c1f50)['trim']();}function normalizeBusinessGroupArgument(_0x31dc47){const _0x4f1fac=normalizeBusinessGroup(_0x31dc47);return _0x4f1fac===UNGROUPED_BUSINESS_GROUP?'':_0x4f1fac;}function displayBusinessGroup(_0xecb910){return _0xecb910||UNGROUPED_BUSINESS_GROUP;}function asPlainObject(_0x30e47f){const _0x1c7b66=a66_0x3deab3;if(!_0x30e47f||typeof _0x30e47f!==_0x1c7b66(0x13d)||Array[_0x1c7b66(0xfa)](_0x30e47f))return{};return _0x30e47f;}function firstString(..._0x10d391){const _0x116735=a66_0x3deab3;for(const _0xc5ae32 of _0x10d391){if(typeof _0xc5ae32===_0x116735(0x13a)&&_0xc5ae32[_0x116735(0x124)]())return _0xc5ae32['trim']();if(typeof _0xc5ae32===_0x116735(0x10a)&&Number[_0x116735(0x11a)](_0xc5ae32))return String(_0xc5ae32);}return undefined;}function firstNumber(..._0x22e591){const _0x132701=a66_0x3deab3;for(const _0x4bacea of _0x22e591){if(typeof _0x4bacea==='number'&&Number['isFinite'](_0x4bacea))return _0x4bacea;if(typeof _0x4bacea===_0x132701(0x13a)&&_0x4bacea[_0x132701(0x124)]()&&Number[_0x132701(0x11a)](Number(_0x4bacea)))return Number(_0x4bacea);}return null;}function trim(_0x46ba96){const _0x41b6d8=a66_0x3deab3;return String(_0x46ba96||'')[_0x41b6d8(0x124)]();}
1
+ import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from"../../commands/common/flags.js";import{getDatasetDetail,updateDbTableBusinessGroup,updateErBusinessGroup}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";const DB_TABLE_BACKEND_PATH="/smartapi/dblink/updateTableBusinessGroup";const METADATA_BACKEND_PATH="/smartapi/question/er-config/business-group/edit";const UNGROUPED_BUSINESS_GROUP="ungrouped";export async function buildDatasetBusinessGroupUpdateResult({appCode:appCode,input:input,dryRun:dryRun}){validateInput(input);const requestedBusinessGroup=normalizeBusinessGroupArgument(input.businessGroup);const drivenData=await getDatasetDetail(input.code);const dataset=resolveBusinessGroupDataset(drivenData,input.code);assertBusinessGroupUpdateSupported(dataset,requestedBusinessGroup);const beforeBusinessGroup=loadCurrentBusinessGroup(drivenData,dataset);assertExpectedBusinessGroup(beforeBusinessGroup,input.expectBusinessGroup)
2
+ ;const backend=buildBackendPlan(appCode,dataset,requestedBusinessGroup);const changed=beforeBusinessGroup!==requestedBusinessGroup;let verification;if(changed&&!dryRun){if(backend.kind==="db-table"){await updateDbTableBusinessGroup(backend.payload)}else{await updateErBusinessGroup(backend.payload)}const readbackDrivenData=await getDatasetDetail(dataset.code);const readbackDataset=resolveBusinessGroupDataset(readbackDrivenData,dataset.code);const afterReadback=loadCurrentBusinessGroup(readbackDrivenData,readbackDataset);if(afterReadback!==requestedBusinessGroup){throw CliErrors.apiError("Business scenario group update did not match dataset detail readback.",`Expected ${JSON.stringify(displayBusinessGroup(requestedBusinessGroup))}, actual ${JSON.stringify(displayBusinessGroup(afterReadback))}.`)}verification={verified:true,status:"matched",afterReadback:{businessGroup:displayBusinessGroup(afterReadback)}}}else if(!changed){verification={verified:true,status:"unchanged",afterReadback:{
3
+ businessGroup:displayBusinessGroup(beforeBusinessGroup)}}}const data={operation:"update",appCode:appCode,selector:{code:dataset.code},dataset:{id:dataset.id,code:dataset.code,name:dataset.name,sourceType:dataset.sourceType},before:{businessGroup:displayBusinessGroup(beforeBusinessGroup)},after:{businessGroup:displayBusinessGroup(requestedBusinessGroup)},changed:changed,dryRun:dryRun,submitted:changed&&!dryRun,backend:{method:backend.method,path:backend.path,payload:backend.payload},...verification?{verification:verification}:{},warnings:[]};return{ok:true,data:data,message:changed?dryRun?`Dry-run: business scenario group would change for dataset ${dataset.code}`:`Updated business scenario group for dataset ${dataset.code}`:`No changes for business scenario group on dataset ${dataset.code}`}}export const datasetBusinessGroupUpdate={service:"dataset",command:"business-group-update",description:"Update business scenario group",risk:"write",flags:[CODE_FLAG,{name:"business-group",
4
+ type:"string",required:true,description:"Business scenario group (not technical): use <scenario>, <domain>---<scenario> when needed; METADATA accepts ungrouped to clear it"},{name:"expect-business-group",type:"string",required:false,description:"Expected current business scenario group; use ungrouped to expect no group; mismatch aborts without writing"},APPCODE_FLAG_OPTIONAL],async validate(ctx){validateInput(readBusinessGroupUpdateInput(ctx))},async dryRun(ctx){const preview=await buildDatasetBusinessGroupUpdateResult({appCode:ctx.appCode,input:readBusinessGroupUpdateInput(ctx),dryRun:true});return{method:preview.data.backend.method,url:preview.data.backend.path,body:preview.data.backend.payload,description:preview.message,...preview.data}},async execute(ctx){return buildDatasetBusinessGroupUpdateResult({appCode:ctx.appCode,input:readBusinessGroupUpdateInput(ctx),dryRun:false})}};function readBusinessGroupUpdateInput(ctx){const expectBusinessGroup=ctx.str("expect-business-group")
5
+ ;return{code:trim(ctx.str("code")),businessGroup:ctx.str("business-group"),expectBusinessGroup:expectBusinessGroup===undefined||expectBusinessGroup===""?undefined:expectBusinessGroup}}function validateInput(input){if(!trim(input.code)){throw CliErrors.validation("--code is required")}if(input.businessGroup===undefined){throw CliErrors.validation("--business-group is required")}if(!trim(input.businessGroup)){throw CliErrors.validation("--business-group must not be blank")}}function assertBusinessGroupUpdateSupported(dataset,requestedBusinessGroup){if(dataset.sourceType==="DB_TABLE"&&!requestedBusinessGroup){throw CliErrors.validation("Clearing business scenario groups is not supported for DB_TABLE datasets.")}}function resolveBusinessGroupDataset(drivenData,fallbackCode){const dataset=asPlainObject(drivenData.dataset);const dbtable=asPlainObject(drivenData.dbtableConfig);const sourceType=resolveSourceType(drivenData,dataset,dbtable)
6
+ ;const code=firstString(drivenData.modelCode,drivenData.code,dataset.datasetCode,fallbackCode)||fallbackCode;return{id:firstNumber(drivenData.modelId,drivenData.id,dataset.datasetId)??firstString(drivenData.modelId,drivenData.id,dataset.datasetId)??null,code:code,name:firstString(drivenData.name,dataset.datasetName,dataset.name)||null,sourceType:sourceType,dbTableSelector:sourceType==="DB_TABLE"?{dbLinkId:firstNumber(dbtable.dbId),tableName:firstString(dbtable.tableName)||null}:null}}function resolveSourceType(drivenData,dataset,dbtable){const source=firstString(drivenData.source,drivenData.sourceType,dataset.source,dataset.sourceType)?.trim().toUpperCase();if(source==="DB_TABLE"||source==="METADATA"){return source}if(Object.keys(dbtable).length>0){return"DB_TABLE"}throw CliErrors.validation("Dataset sourceType is required and must be DB_TABLE or METADATA.")}function loadCurrentBusinessGroup(drivenData,dataset){
7
+ const businessGroup=readBusinessGroupFromDatasetDetail(drivenData,dataset.sourceType);if(businessGroup.found){return normalizeBusinessGroup(businessGroup.value)}return""}function readBusinessGroupFromDatasetDetail(drivenData,sourceType){const dataset=asPlainObject(drivenData.dataset);const topLevel=firstPresent(drivenData.businessGroup);if(topLevel.found){return topLevel}const direct=firstPresent(dataset.businessGroup);if(direct.found){return direct}if(sourceType==="DB_TABLE"){return{found:false}}const extendValue=readBusinessGroupFromExtend(drivenData.extend);if(extendValue.found){return extendValue}return readBusinessGroupFromExtend(dataset.extend)}function readBusinessGroupFromExtend(extend){if(extend===undefined||extend===null||extend===""){return{found:false}}if(typeof extend==="string"){try{const parsed=JSON.parse(extend);return readBusinessGroupFromExtend(parsed)}catch{return{found:false}}}const extendObject=asPlainObject(extend)
8
+ ;if(Object.prototype.hasOwnProperty.call(extendObject,"businessGroup")){return{found:true,value:extendObject.businessGroup}}return{found:false}}function firstPresent(...values){for(const value of values){if(value!==undefined&&value!==null){return{found:true,value:value}}}return{found:false}}function assertExpectedBusinessGroup(actual,expected){if(expected===undefined)return;const normalizedExpected=normalizeBusinessGroupArgument(expected);if(actual!==normalizedExpected){throw CliErrors.validation("Expectation mismatch at businessGroup",`Expected ${JSON.stringify(normalizedExpected)}, actual ${JSON.stringify(actual)}`)}}function buildBackendPlan(appCode,dataset,businessGroup){if(dataset.sourceType==="DB_TABLE"){if(!dataset.dbTableSelector||dataset.dbTableSelector.dbLinkId===null||!dataset.dbTableSelector.tableName){
9
+ throw CliErrors.validation("DB_TABLE dataset requires dbtableConfig.dbId and tableName.","Run dataset detail and complete database analysis before updating the business group.")}return{kind:"db-table",method:"POST",path:DB_TABLE_BACKEND_PATH,payload:{dbLinkId:dataset.dbTableSelector.dbLinkId,tableName:dataset.dbTableSelector.tableName,businessGroup:businessGroup}}}return{kind:"metadata",method:"POST",path:METADATA_BACKEND_PATH,payload:{appCode:appCode,datasetCode:dataset.code,businessGroup:businessGroup}}}function normalizeBusinessGroup(value){if(value===undefined||value===null)return"";return String(value).trim()}function normalizeBusinessGroupArgument(value){const normalized=normalizeBusinessGroup(value);return normalized===UNGROUPED_BUSINESS_GROUP?"":normalized}function displayBusinessGroup(value){return value||UNGROUPED_BUSINESS_GROUP}function asPlainObject(value){if(!value||typeof value!=="object"||Array.isArray(value))return{};return value}function firstString(...values){
10
+ for(const value of values){if(typeof value==="string"&&value.trim())return value.trim();if(typeof value==="number"&&Number.isFinite(value)){return String(value)}}return undefined}function firstNumber(...values){for(const value of values){if(typeof value==="number"&&Number.isFinite(value))return value;if(typeof value==="string"&&value.trim()&&Number.isFinite(Number(value))){return Number(value)}}return null}function trim(value){return String(value||"").trim()}
@@ -1 +1 @@
1
- const a67_0x35ac15=a67_0x2359;(function(_0x177aa6,_0x7d7efd){const _0x1b9416=a67_0x2359,_0x422206=_0x177aa6();while(!![]){try{const _0x1a0289=-parseInt(_0x1b9416(0x88))/0x1+-parseInt(_0x1b9416(0x7b))/0x2*(parseInt(_0x1b9416(0x74))/0x3)+parseInt(_0x1b9416(0x73))/0x4*(parseInt(_0x1b9416(0x8a))/0x5)+-parseInt(_0x1b9416(0x80))/0x6*(parseInt(_0x1b9416(0x81))/0x7)+parseInt(_0x1b9416(0x7c))/0x8+parseInt(_0x1b9416(0x78))/0x9+parseInt(_0x1b9416(0x76))/0xa;if(_0x1a0289===_0x7d7efd)break;else _0x422206['push'](_0x422206['shift']());}catch(_0x30eaf2){_0x422206['push'](_0x422206['shift']());}}}(a67_0x519c,0xde7ba));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a67_0x2359(_0x3fcdbe,_0x6ecda2){_0x3fcdbe=_0x3fcdbe-0x73;const _0x519c21=a67_0x519c();let _0x23598d=_0x519c21[_0x3fcdbe];return _0x23598d;}import{getErBusinessGroupSummary}from'../../core/api-client.js';function a67_0x519c(){const _0x170988=['9254592ExMHqH','trim','List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','dataset','5393736WccmkQ','7XBOuUk','groups','business-groups','number','\x20business\x20group(s)\x20for\x20database\x20connection\x20','map','ungrouped','419804kuBNPF','DB_TABLE','5265nIBDgS','3052euMyFx','25527coqjMv','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','5503240blyWWs','businessGroup','4444038huIxqe','dbid','appCode','182QCOJFU'];a67_0x519c=function(){return _0x170988;};return a67_0x519c();}export const datasetBusinessGroups={'service':a67_0x35ac15(0x7f),'command':a67_0x35ac15(0x83),'description':a67_0x35ac15(0x7e),'risk':'read','flags':[{'name':'dbid','type':a67_0x35ac15(0x84),'required':!![],'description':a67_0x35ac15(0x75)},APPCODE_FLAG_OPTIONAL],async 'execute'(_0xb33327){const _0x70b23d=a67_0x35ac15,_0x1f78f1=_0xb33327['num'](_0x70b23d(0x79)),_0x2b87e4=await getErBusinessGroupSummary(_0xb33327[_0x70b23d(0x7a)],_0x1f78f1),_0x41f5cf=_0x2b87e4[_0x70b23d(0x82)][_0x70b23d(0x86)](_0x1892fa=>({..._0x1892fa,'businessGroup':_0x1892fa[_0x70b23d(0x77)][_0x70b23d(0x7d)]()||_0x70b23d(0x87)}));return{'ok':!![],'data':{..._0x2b87e4,'groups':_0x41f5cf,'scope':_0x70b23d(0x89)},'message':'Found\x20'+_0x41f5cf['length']+_0x70b23d(0x85)+_0x1f78f1};}};
1
+ import{APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{getErBusinessGroupSummary}from"../../core/api-client.js";export const datasetBusinessGroups={service:"dataset",command:"business-groups",description:"List DB_TABLE dataset business groups for a database connection; does not include METADATA",risk:"read",flags:[{name:"dbid",type:"number",required:true,description:"Database connection ID (dblink id from db list)"},APPCODE_FLAG_OPTIONAL],async execute(ctx){const dblinkId=ctx.num("dbid");const summary=await getErBusinessGroupSummary(ctx.appCode,dblinkId);const groups=summary.groups.map(group=>({...group,businessGroup:group.businessGroup.trim()||"ungrouped"}));return{ok:true,data:{...summary,groups:groups,scope:"DB_TABLE"},message:`Found ${groups.length} business group(s) for database connection ${dblinkId}`}}};
@@ -1 +1,3 @@
1
- const a68_0x583c8a=a68_0x4cfe;(function(_0x324e96,_0x392753){const _0x5401f5=a68_0x4cfe,_0x331502=_0x324e96();while(!![]){try{const _0xec4795=-parseInt(_0x5401f5(0xd9))/0x1+parseInt(_0x5401f5(0xdc))/0x2+parseInt(_0x5401f5(0xdd))/0x3*(parseInt(_0x5401f5(0xd3))/0x4)+parseInt(_0x5401f5(0xe2))/0x5+-parseInt(_0x5401f5(0xea))/0x6*(parseInt(_0x5401f5(0xd4))/0x7)+-parseInt(_0x5401f5(0xed))/0x8+parseInt(_0x5401f5(0xf5))/0x9;if(_0xec4795===_0x392753)break;else _0x331502['push'](_0x331502['shift']());}catch(_0x369081){_0x331502['push'](_0x331502['shift']());}}}(a68_0x297a,0x1acaf));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a68_0x583c8a(0xf4),'filter':a68_0x583c8a(0xec),'getOne':'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress'};function a68_0x4cfe(_0x56a718,_0xc489de){_0x56a718=_0x56a718-0xd3;const _0x297a18=a68_0x297a();let _0x4cfe92=_0x297a18[_0x56a718];return _0x4cfe92;}export const RUNTIME_DATA_ACCESS_SUMMARY=a68_0x583c8a(0xe9);function valueToString(_0x4a92dc){const _0x4723cc=a68_0x583c8a;return _0x4a92dc==null?'':String(_0x4a92dc)[_0x4723cc(0xef)]();}function getDatasetCode(_0x41960a){const _0x5186cd=a68_0x583c8a;return valueToString(_0x41960a[_0x5186cd(0xf1)]??_0x41960a[_0x5186cd(0xd8)]??_0x41960a[_0x5186cd(0xda)]?.[_0x5186cd(0xe8)]);}function getDatasetName(_0x1a17c4){const _0x454133=a68_0x583c8a;return valueToString(_0x1a17c4[_0x454133(0xf6)]??_0x1a17c4['dataset']?.[_0x454133(0xe1)])||_0x454133(0xe7);}function getDatasetSource(_0x26585d){const _0x38cbef=a68_0x583c8a;return valueToString(_0x26585d[_0x38cbef(0xd5)]??_0x26585d[_0x38cbef(0xda)]?.['sourceType'])[_0x38cbef(0xee)]();}function getDbtableConfig(_0x25adcc){const _0x1864b5=a68_0x583c8a,_0x2b2aa7=_0x25adcc[_0x1864b5(0xde)]??_0x25adcc['dbtable'];return _0x2b2aa7&&typeof _0x2b2aa7===_0x1864b5(0xeb)?_0x2b2aa7:{};}export function isDbTableBackedDataset(_0x2cc380){const _0x26ba85=a68_0x583c8a,_0x3c64c9=getDatasetSource(_0x2cc380);if(_0x3c64c9==='METADATA')return![];const _0x5820e2=getDbtableConfig(_0x2cc380),_0x3cd9cd=_0x5820e2[_0x26ba85(0xe5)]??_0x5820e2['id'],_0x24dda1=valueToString(_0x5820e2[_0x26ba85(0xdb)]??_0x2cc380[_0x26ba85(0xdb)]??_0x2cc380[_0x26ba85(0xda)]?.['tableName']);return _0x3cd9cd!==undefined&&_0x3cd9cd!==null&&_0x24dda1[_0x26ba85(0xe3)]>0x0;}export function filterDbTableBackedDatasets(_0x4b63fe){const _0x60b4c=a68_0x583c8a;return _0x4b63fe[_0x60b4c(0xf0)](_0x370e6f=>isDbTableBackedDataset(_0x370e6f));}export function buildDbTableBackedRequirementMessage(_0x45a6ae,_0xcabc24=a68_0x583c8a(0xe6)){const _0x14be29=a68_0x583c8a,_0x2f2a3a=getDatasetSource(_0x45a6ae)||'UNKNOWN',_0xe3ee37=getDatasetName(_0x45a6ae),_0x1af360=getDatasetCode(_0x45a6ae),_0x54c3e0=_0x1af360?'\x20('+_0x1af360+')':'';return[_0x14be29(0xd7)+_0xe3ee37+'\x22'+_0x54c3e0+_0x14be29(0xe4)+_0x2f2a3a+'\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20'+_0xcabc24+'.','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.',_0x14be29(0xf2),_0x14be29(0xdf)+RUNTIME_DATA_ACCESS_COMMANDS['filter']+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0x14be29(0xe0)]+'.'][_0x14be29(0xf3)]('\x20');}export function assertDatasetIsDbTableBacked(_0xb91b9,_0x4be755){const _0x3a42ba=a68_0x583c8a;if(!isDbTableBackedDataset(_0xb91b9))throw CliErrors[_0x3a42ba(0xd6)](buildDbTableBackedRequirementMessage(_0xb91b9,_0x4be755));}function a68_0x297a(){const _0x3c2257=['232257IkaCIx','dbtableConfig','To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20','getOne','datasetName','211970chQbZU','length','\x20is\x20','dbId','SQL\x20schema\x20validation','unknown','datasetCode','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','870bbgXen','object','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','631192UPXxhe','toUpperCase','trim','filter','code','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','join','lovrabet','140913xlFmom','name','4KSFWKM','3283SLFAzV','source','validation','The\x20current\x20dataset\x20\x22','modelCode','75885FXFeHN','dataset','tableName','394124LLMNqP'];a68_0x297a=function(){return _0x3c2257;};return a68_0x297a();}
1
+ import{CliErrors}from"../../errors.js";export const RUNTIME_DATA_ACCESS_COMMANDS={cli:"lovrabet",filter:"lovrabet data filter --code <datasetCode> --params '<json>' --format compress",getOne:"lovrabet data getOne --code <datasetCode> --params '{\"id\":123}' --format compress"};export const RUNTIME_DATA_ACCESS_SUMMARY="Use lovrabet data filter/getOne for real runtime records.";function valueToString(value){return value==null?"":String(value).trim()}function getDatasetCode(dataset){return valueToString(dataset.code??dataset.modelCode??dataset.dataset?.datasetCode)}function getDatasetName(dataset){return valueToString(dataset.name??dataset.dataset?.datasetName)||"unknown"}function getDatasetSource(dataset){return valueToString(dataset.source??dataset.dataset?.sourceType).toUpperCase()}function getDbtableConfig(dataset){const dbtable=dataset.dbtableConfig??dataset.dbtable;return dbtable&&typeof dbtable==="object"?dbtable:{}}export function isDbTableBackedDataset(dataset){
2
+ const source=getDatasetSource(dataset);if(source==="METADATA")return false;const dbtable=getDbtableConfig(dataset);const dbId=dbtable.dbId??dbtable.id;const tableName=valueToString(dbtable.tableName??dataset.tableName??dataset.dataset?.tableName);return dbId!==undefined&&dbId!==null&&tableName.length>0}export function filterDbTableBackedDatasets(datasets){return datasets.filter(dataset=>isDbTableBackedDataset(dataset))}export function buildDbTableBackedRequirementMessage(dataset,assetName="SQL schema validation"){const source=getDatasetSource(dataset)||"UNKNOWN";const name=getDatasetName(dataset);const code=getDatasetCode(dataset);const suffix=code?` (${code})`:""
3
+ ;return[`The current dataset "${name}"${suffix} is ${source} and has no DB_TABLE data-source context for ${assetName}.`,"Reason: schema introspection and custom SQL require source=DB_TABLE, dbtableConfig.dbId, dbtableConfig.tableName, and a database connection context.","Upgrade or migrate this dataset to a DB_TABLE dataset, then continue with the new dataset code.",`To inspect real runtime rows, switch to lovrabet CLI: ${RUNTIME_DATA_ACCESS_COMMANDS.filter}; ${RUNTIME_DATA_ACCESS_COMMANDS.getOne}.`].join(" ")}export function assertDatasetIsDbTableBacked(dataset,assetName){if(!isDbTableBackedDataset(dataset)){throw CliErrors.validation(buildDbTableBackedRequirementMessage(dataset,assetName))}}
@@ -1 +1,2 @@
1
- function a69_0x4117(){const _0x1acf43=['269260DWnAfC','Create\x20a\x20logical\x20relation\x20between\x20DB_TABLE\x20datasets\x20in\x20different\x20database\x20connections','230198GucHlZ','3kUXKYe','464970sWPPwv','2141536abNxtI','create','dataset','write','218150alvvrq','5NpjHox','62784BEDWgy','1887867XaaPuZ','112kpJNUO'];a69_0x4117=function(){return _0x1acf43;};return a69_0x4117();}const a69_0x404bae=a69_0x33b3;(function(_0x3bf17a,_0x6f970d){const _0x1e731e=a69_0x33b3,_0x2272a6=_0x3bf17a();while(!![]){try{const _0x15a98c=-parseInt(_0x1e731e(0x86))/0x1+-parseInt(_0x1e731e(0x7f))/0x2*(-parseInt(_0x1e731e(0x80))/0x3)+parseInt(_0x1e731e(0x8b))/0x4*(parseInt(_0x1e731e(0x87))/0x5)+parseInt(_0x1e731e(0x88))/0x6*(parseInt(_0x1e731e(0x8a))/0x7)+parseInt(_0x1e731e(0x82))/0x8+-parseInt(_0x1e731e(0x89))/0x9+-parseInt(_0x1e731e(0x81))/0xa;if(_0x15a98c===_0x6f970d)break;else _0x2272a6['push'](_0x2272a6['shift']());}catch(_0x7578f1){_0x2272a6['push'](_0x2272a6['shift']());}}}(a69_0x4117,0x22f10));import{createCrossDbRelation}from'../../core/api-client.js';function a69_0x33b3(_0x253f33,_0x129ebd){_0x253f33=_0x253f33-0x7f;const _0x4117aa=a69_0x4117();let _0x33b385=_0x4117aa[_0x253f33];return _0x33b385;}import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationCreate={'service':a69_0x404bae(0x84),'command':'cross-relation-create','description':a69_0x404bae(0x8c),'risk':a69_0x404bae(0x85),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0x5bda3e=>validateCrossRelation(_0x5bda3e,a69_0x404bae(0x83)),'dryRun':_0x691ef=>previewCrossRelation(_0x691ef,a69_0x404bae(0x83)),'execute':_0x3fd525=>executeCrossRelation(_0x3fd525,a69_0x404bae(0x83),createCrossDbRelation)};
1
+ import{createCrossDbRelation}from"../../core/api-client.js";import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from"../../commands/dataset/cross-relation-shared.js";export const datasetCrossRelationCreate={service:"dataset",command:"cross-relation-create",description:"Create a logical relation between DB_TABLE datasets in different database connections",risk:"write",strictFlags:true,requiresCookieAuth:true,structuredErrors:true,flags:[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,APPCODE_FLAG_OPTIONAL],validate:async ctx=>validateCrossRelation(ctx,"create"),
2
+ dryRun:ctx=>previewCrossRelation(ctx,"create"),execute:ctx=>executeCrossRelation(ctx,"create",createCrossDbRelation)};
@@ -1 +1 @@
1
- const a70_0x34d83c=a70_0x1f9c;(function(_0x172649,_0x3549b3){const _0x49f3c4=a70_0x1f9c,_0x52cdb8=_0x172649();while(!![]){try{const _0x1a252a=-parseInt(_0x49f3c4(0x103))/0x1+-parseInt(_0x49f3c4(0x104))/0x2*(parseInt(_0x49f3c4(0x107))/0x3)+parseInt(_0x49f3c4(0x10c))/0x4*(parseInt(_0x49f3c4(0x100))/0x5)+parseInt(_0x49f3c4(0x109))/0x6*(-parseInt(_0x49f3c4(0x101))/0x7)+-parseInt(_0x49f3c4(0x108))/0x8*(parseInt(_0x49f3c4(0x105))/0x9)+parseInt(_0x49f3c4(0x102))/0xa+-parseInt(_0x49f3c4(0xff))/0xb*(parseInt(_0x49f3c4(0x10a))/0xc);if(_0x1a252a===_0x3549b3)break;else _0x52cdb8['push'](_0x52cdb8['shift']());}catch(_0x130dde){_0x52cdb8['push'](_0x52cdb8['shift']());}}}(a70_0x28bc,0x543e7));function a70_0x28bc(){const _0x21e2fa=['10XoksvN','9VJBrkl','dataset','123507knFGNh','118264PMXTeg','6fTUMnc','12tzwFbT','delete','41124peqylH','2550218UssRkP','305Rdhobi','2926511HebfJg','6135970OxPDiK','25136LbNMYW'];a70_0x28bc=function(){return _0x21e2fa;};return a70_0x28bc();}import{deleteCrossDbRelation}from'../../core/api-client.js';import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';function a70_0x1f9c(_0x4d9810,_0xad4668){_0x4d9810=_0x4d9810-0xff;const _0x28bcd6=a70_0x28bc();let _0x1f9c7d=_0x28bcd6[_0x4d9810];return _0x1f9c7d;}export const datasetCrossRelationDelete={'service':a70_0x34d83c(0x106),'command':'cross-relation-delete','description':'Delete\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','risk':'high-risk-write','strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0x1f4b3e=>validateCrossRelation(_0x1f4b3e,a70_0x34d83c(0x10b)),'dryRun':_0x3a7c0a=>previewCrossRelation(_0x3a7c0a,a70_0x34d83c(0x10b)),'execute':_0x407a68=>executeCrossRelation(_0x407a68,'delete',deleteCrossDbRelation)};
1
+ import{deleteCrossDbRelation}from"../../core/api-client.js";import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from"../../commands/dataset/cross-relation-shared.js";export const datasetCrossRelationDelete={service:"dataset",command:"cross-relation-delete",description:"Delete the single cross-database relation matching a source dataset and field",risk:"high-risk-write",strictFlags:true,requiresCookieAuth:true,structuredErrors:true,flags:[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],validate:async ctx=>validateCrossRelation(ctx,"delete"),dryRun:ctx=>previewCrossRelation(ctx,"delete"),execute:ctx=>executeCrossRelation(ctx,"delete",deleteCrossDbRelation)};
@@ -1 +1,2 @@
1
- const a71_0x218055=a71_0x5dd9;(function(_0x484a49,_0x2096f9){const _0x4bb1b2=a71_0x5dd9,_0x5c1f8a=_0x484a49();while(!![]){try{const _0x46f303=parseInt(_0x4bb1b2(0x188))/0x1*(-parseInt(_0x4bb1b2(0x17e))/0x2)+parseInt(_0x4bb1b2(0x182))/0x3+-parseInt(_0x4bb1b2(0x184))/0x4+-parseInt(_0x4bb1b2(0x185))/0x5*(parseInt(_0x4bb1b2(0x177))/0x6)+-parseInt(_0x4bb1b2(0x17c))/0x7+-parseInt(_0x4bb1b2(0x178))/0x8*(parseInt(_0x4bb1b2(0x17f))/0x9)+parseInt(_0x4bb1b2(0x186))/0xa;if(_0x46f303===_0x2096f9)break;else _0x5c1f8a['push'](_0x5c1f8a['shift']());}catch(_0x103751){_0x5c1f8a['push'](_0x5c1f8a['shift']());}}}(a71_0x1232,0x52972));import{queryCrossDbRelations}from'../../core/api-client.js';function a71_0x1232(){const _0x48a799=['appCode','26ntDOrH','cross-relation-list','6qnpkCB','1355544LGAGol','Cross-database\x20relations:\x20','list','List\x20outgoing\x20cross-database\x20relations\x20by\x20source\x20dataset\x20or\x20database\x20connection','746697OGKkZi','\x20relation(s)','16186EEqVdV','18eNZUhm','length','map','979815sERQZQ','read','663112ejGCVu','1496195IbjCJo','11326770obitoB'];a71_0x1232=function(){return _0x48a799;};return a71_0x1232();}function a71_0x5dd9(_0x424a1a,_0x4795ec){_0x424a1a=_0x424a1a-0x177;const _0x1232db=a71_0x1232();let _0x5dd974=_0x1232db[_0x424a1a];return _0x5dd974;}import{APPCODE_FLAG_OPTIONAL,CROSS_RELATION_DBLINK_FLAG,CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG}from'../../commands/common/flags.js';import{projectCrossRelation,resolveCrossRelationQuery,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationList={'service':'dataset','command':a71_0x218055(0x189),'description':a71_0x218055(0x17b),'risk':a71_0x218055(0x183),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[{...CROSS_RELATION_FROM_DATASET_FLAG,'required':![]},CROSS_RELATION_DBLINK_FLAG,{...CROSS_RELATION_FROM_COLUMN_FLAG,'required':![]},APPCODE_FLAG_OPTIONAL],'validate':async _0xe116fb=>validateCrossRelation(_0xe116fb,a71_0x218055(0x17a)),async 'execute'(_0x199bdc){const _0xa4bc0b=a71_0x218055,_0x24213d=await resolveCrossRelationQuery(_0x199bdc),_0x4f70af=await queryCrossDbRelations(_0x24213d);return{'ok':!![],'data':{'appCode':_0x199bdc[_0xa4bc0b(0x187)],'selector':_0x24213d,'total':_0x4f70af[_0xa4bc0b(0x180)],'relations':_0x4f70af[_0xa4bc0b(0x181)](projectCrossRelation)},'message':_0xa4bc0b(0x179)+_0x4f70af[_0xa4bc0b(0x180)]+_0xa4bc0b(0x17d)};}};
1
+ import{queryCrossDbRelations}from"../../core/api-client.js";import{APPCODE_FLAG_OPTIONAL,CROSS_RELATION_DBLINK_FLAG,CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG}from"../../commands/common/flags.js";import{projectCrossRelation,resolveCrossRelationQuery,validateCrossRelation}from"../../commands/dataset/cross-relation-shared.js";export const datasetCrossRelationList={service:"dataset",command:"cross-relation-list",description:"List outgoing cross-database relations by source dataset or database connection",risk:"read",strictFlags:true,requiresCookieAuth:true,structuredErrors:true,flags:[{...CROSS_RELATION_FROM_DATASET_FLAG,required:false},CROSS_RELATION_DBLINK_FLAG,{...CROSS_RELATION_FROM_COLUMN_FLAG,required:false},APPCODE_FLAG_OPTIONAL],validate:async ctx=>validateCrossRelation(ctx,"list"),async execute(ctx){const query=await resolveCrossRelationQuery(ctx);const rows=await queryCrossDbRelations(query);return{ok:true,data:{appCode:ctx.appCode,selector:query,
2
+ total:rows.length,relations:rows.map(projectCrossRelation)},message:`Cross-database relations: ${rows.length} relation(s)`}}};
@@ -1 +1,10 @@
1
- const a72_0x5bffc1=a72_0x5595;(function(_0x19a38d,_0x31693f){const _0xc0890e=a72_0x5595,_0x2daef1=_0x19a38d();while(!![]){try{const _0x23f06a=-parseInt(_0xc0890e(0xb3))/0x1+-parseInt(_0xc0890e(0xb8))/0x2+parseInt(_0xc0890e(0xc2))/0x3*(parseInt(_0xc0890e(0xa5))/0x4)+-parseInt(_0xc0890e(0xc5))/0x5+parseInt(_0xc0890e(0xae))/0x6*(-parseInt(_0xc0890e(0x99))/0x7)+parseInt(_0xc0890e(0xd4))/0x8+parseInt(_0xc0890e(0xb7))/0x9;if(_0x23f06a===_0x31693f)break;else _0x2daef1['push'](_0x2daef1['shift']());}catch(_0x29d85f){_0x2daef1['push'](_0x2daef1['shift']());}}}(a72_0x1fbc,0x9617a));import{getDatasetDetail,queryCrossDbRelations}from'../../core/api-client.js';import{CROSS_DB_RELATION_PATHS}from'../../core/cross-db-relation.js';function a72_0x5595(_0x15c16b,_0x173dc4){_0x15c16b=_0x15c16b-0x96;const _0x1fbc61=a72_0x1fbc();let _0x5595cb=_0x1fbc61[_0x15c16b];return _0x5595cb;}import{CliError,CliErrors}from'../../errors.js';import{CROSS_RELATION_CARDINALITY_FLAG}from'../../commands/common/flags.js';function required(_0xc96da0,_0x4cfdb1){const _0x5009a4=a72_0x5595,_0x53088f=_0xc96da0[_0x5009a4(0xcd)](_0x4cfdb1)[_0x5009a4(0x96)]();if(!_0x53088f)throw CliErrors[_0x5009a4(0xc4)](_0x4cfdb1);return _0x53088f;}function explicitDblink(_0x19c656){const _0x33e346=a72_0x5595,_0xf9c506=_0x19c656[_0x33e346(0xb0)](_0x33e346(0x9b));if(_0xf9c506===undefined||_0xf9c506===null)return undefined;const _0x1038e0=Number(_0xf9c506);if(!Number[_0x33e346(0xb1)](_0x1038e0)||_0x1038e0<=0x0)throw CliErrors['validation'](_0x33e346(0xa7));return _0x1038e0;}export function validateCrossRelation(_0x38ce77,_0x2e8f14){const _0x42dd80=a72_0x5595,_0x478482=explicitDblink(_0x38ce77);if(_0x2e8f14==='list'){if(!_0x38ce77['str'](_0x42dd80(0xad))['trim']()&&_0x478482===undefined)throw CliErrors['validation'](_0x42dd80(0xbe));return;}required(_0x38ce77,'from-datasetcode'),required(_0x38ce77,'from-column');if(_0x2e8f14!==_0x42dd80(0xa3)){required(_0x38ce77,_0x42dd80(0xc1)),required(_0x38ce77,_0x42dd80(0x97));const _0x3c4d85=_0x38ce77[_0x42dd80(0xcd)]('cardinality')['trim']();if(_0x3c4d85&&!CROSS_RELATION_CARDINALITY_FLAG['enum'][_0x42dd80(0xbf)](_0x3c4d85))throw CliErrors[_0x42dd80(0xa2)](_0x42dd80(0xea));}}function a72_0x1fbc(){const _0x393749=['label_inherited','\x20write\x20was\x20not\x20verified.','validation','delete','datasetCode','4472828JQSNVi','update','--from-dblink-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','table','Would\x20','length','map','\x20verified.','from-datasetcode','5348298GHWjrP','string','flag','isSafeInteger','dataset','1068320IJmtrl','\x20must\x20be\x20a\x20DB_TABLE\x20dataset.','The\x20target\x20display\x20field\x20is\x20inherited.\x20When\x20changing\x20the\x20target\x20dataset,\x20provide\x20--to-label-column\x20explicitly.','relationType','9734409vDUZHK','1086rplvaF','toField','filter','data','Cross-database\x20relations\x20require\x20different\x20source\x20and\x20target\x20database\x20connections.','extend','Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.','includes','toTableName','to-datasetcode','3sSfYWS','some','flagMissing','2784475mdktpc','\x20is\x20missing\x20its\x20database\x20connection\x20or\x20physical\x20table\x20name.','DB_TABLE','expectedLabel','\x20a\x20cross-database\x20relation\x20for\x20','query','unconfirmed','fromDblinkId','str','to-label-column','fromTableName','Run\x20dataset\x20cross-relation-list\x20to\x20inspect\x20the\x20candidates.\x20This\x20command\x20accepts\x20only\x20a\x20source\x20dataset\x20and\x20field.','matched','appCode','parse','7456888tJiqvL','toDatasetCode','dbId','create','Dataset\x20','dblinkId','expectedCardinality','from','toLowerCase','cardinality','refTableLabelName','tableName','fromField','from-column','dbtable','\x20has\x20invalid\x20storage\x20configuration.','catch','apiError','Multiple\x20cross-database\x20relations\x20match\x20this\x20source\x20field;\x20update/delete\x20cannot\x20select\x20one\x20target.','source','storageProfile','fromDatasetName','Invalid\x20--cardinality.','toDblinkId','POST','relationId','trim','to-column','Cross-database\x20relation\x20not\x20found\x20for\x20this\x20source\x20dataset\x20and\x20field.','7HmRzwJ','fromDatasetCode','from-dblink-id','before','sourceType','body','--from-dblink-id\x20does\x20not\x20match\x20the\x20source\x20dataset\x20connection.'];a72_0x1fbc=function(){return _0x393749;};return a72_0x1fbc();}async function resolveEndpoint(_0x2bee35){const _0x38b2b0=a72_0x5595,_0x11d511=await getDatasetDetail(_0x2bee35),_0x1f352d=_0x11d511?.[_0x38b2b0(0xb2)]??{};if((_0x11d511?.[_0x38b2b0(0xe7)]??_0x1f352d[_0x38b2b0(0x9d)])!==_0x38b2b0(0xc7))throw CliErrors[_0x38b2b0(0xa2)](_0x38b2b0(0xd8)+_0x2bee35+_0x38b2b0(0xb4));const _0x13af82=_0x11d511['dbtableConfig']??_0x11d511[_0x38b2b0(0xe2)]??{};let _0x289e66=_0x11d511['extend']??_0x1f352d[_0x38b2b0(0xbd)]??{};if(typeof _0x289e66===_0x38b2b0(0xaf))try{_0x289e66=_0x289e66[_0x38b2b0(0x96)]()?JSON[_0x38b2b0(0xd3)](_0x289e66):{};}catch{throw CliErrors[_0x38b2b0(0xa2)]('Dataset\x20'+_0x2bee35+_0x38b2b0(0xe3));}const _0x31f170=Number(_0x289e66?.['storageProfile']?.[_0x38b2b0(0xd6)]??_0x11d511['storageProfile']?.[_0x38b2b0(0xd6)]??_0x1f352d[_0x38b2b0(0xe8)]?.[_0x38b2b0(0xd6)]??_0x13af82[_0x38b2b0(0xd6)]??_0x1f352d[_0x38b2b0(0xd6)]??_0x11d511[_0x38b2b0(0xd6)]),_0xaaedfe=String(_0x11d511[_0x38b2b0(0xdf)]??_0x1f352d[_0x38b2b0(0xdf)]??_0x13af82[_0x38b2b0(0xdf)]??'')[_0x38b2b0(0x96)]();if(!Number[_0x38b2b0(0xb1)](_0x31f170)||_0x31f170<=0x0||!_0xaaedfe)throw CliErrors[_0x38b2b0(0xa2)](_0x38b2b0(0xd8)+_0x2bee35+_0x38b2b0(0xc6));return{'datasetCode':_0x2bee35,'dblinkId':_0x31f170,'table':_0xaaedfe};}export async function resolveCrossRelationQuery(_0x1125e8){const _0x24f0bb=a72_0x5595,_0x441642=_0x1125e8[_0x24f0bb(0xcd)](_0x24f0bb(0xad))['trim'](),_0x253ae1=explicitDblink(_0x1125e8),_0x83dcaa=_0x441642?await resolveEndpoint(_0x441642):undefined;if(_0x83dcaa&&_0x253ae1!==undefined&&_0x83dcaa[_0x24f0bb(0xd9)]!==_0x253ae1)throw CliErrors[_0x24f0bb(0xa2)](_0x24f0bb(0x9f));const _0x5b7f7e=_0x83dcaa?.[_0x24f0bb(0xd9)]??_0x253ae1;if(_0x5b7f7e===undefined)throw CliErrors['validation']('Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.');return{'appCode':_0x1125e8['appCode'],'fromDblinkId':_0x5b7f7e,..._0x441642?{'fromDatasetCode':_0x441642}:{},..._0x1125e8[_0x24f0bb(0xcd)]('from-column')[_0x24f0bb(0x96)]()?{'fromField':_0x1125e8[_0x24f0bb(0xcd)](_0x24f0bb(0xe1))['trim']()}:{}};}export function projectCrossRelation(_0x1bf011){const _0x55651b=a72_0x5595;return{'relationId':_0x1bf011[_0x55651b(0xed)],'from':{'source':_0x55651b(0xc7),'datasetCode':_0x1bf011[_0x55651b(0x9a)],'datasetName':_0x1bf011[_0x55651b(0xe9)],'dblinkId':_0x1bf011[_0x55651b(0xcc)],'table':_0x1bf011['fromTableName'],'field':_0x1bf011[_0x55651b(0xe0)]},'to':{'source':'DB_TABLE','datasetCode':_0x1bf011[_0x55651b(0xd5)],'datasetName':_0x1bf011['toDatasetName'],'dblinkId':_0x1bf011[_0x55651b(0xeb)],'table':_0x1bf011[_0x55651b(0xc0)],'field':_0x1bf011[_0x55651b(0xb9)],'labelField':_0x1bf011[_0x55651b(0xde)]},'relation':{'cardinality':_0x1bf011[_0x55651b(0xdd)],'relationType':_0x1bf011[_0x55651b(0xb6)]}};}function ambiguity(_0x3e311b){const _0x5dc40e=a72_0x5595,_0x4e9344=CliErrors['validation'](_0x5dc40e(0xe6),_0x5dc40e(0xd0));return Object['defineProperty'](_0x4e9344,_0x5dc40e(0xbb),{'value':{'candidates':_0x3e311b[_0x5dc40e(0xab)](projectCrossRelation)}}),_0x4e9344;}const sameName=(_0x2b83ec,_0x157ed5)=>_0x2b83ec[a72_0x5bffc1(0xdc)]()===_0x157ed5[a72_0x5bffc1(0xdc)]();function matchesEndpoint(_0x298c3e,_0x26fc8c,_0x58f6a2,_0x510838,_0x261086){const _0x383386=a72_0x5bffc1;return _0x298c3e[_0x383386(0xcc)]===_0x26fc8c[_0x383386(0xd9)]&&sameName(_0x298c3e[_0x383386(0xcf)],_0x26fc8c[_0x383386(0xa8)])&&sameName(_0x298c3e[_0x383386(0xe0)],_0x58f6a2)&&_0x298c3e[_0x383386(0xeb)]===_0x510838['dblinkId']&&sameName(_0x298c3e['toTableName'],_0x510838['table'])&&sameName(_0x298c3e['toField'],_0x261086);}export async function prepareCrossRelation(_0x210eb1,_0x940c50){const _0x5e4208=a72_0x5bffc1,_0x42a19f=await resolveEndpoint(required(_0x210eb1,'from-datasetcode')),_0x4e1381=explicitDblink(_0x210eb1);if(_0x4e1381!==undefined&&_0x42a19f[_0x5e4208(0xd9)]!==_0x4e1381)throw CliErrors[_0x5e4208(0xa2)](_0x5e4208(0x9f));const _0x13793d={'appCode':_0x210eb1[_0x5e4208(0xd2)],'fromDatasetCode':_0x42a19f[_0x5e4208(0xa4)],'fromField':required(_0x210eb1,'from-column'),..._0x4e1381!==undefined?{'fromDblinkId':_0x4e1381}:{}},_0x13d889={'appCode':_0x210eb1['appCode'],'fromDblinkId':_0x42a19f['dblinkId'],'fromDatasetCode':_0x42a19f['datasetCode'],'fromField':_0x13793d[_0x5e4208(0xe0)]},_0x4429d5=await queryCrossDbRelations(_0x13d889);let _0x1b9c49=null;if(_0x940c50!==_0x5e4208(0xd7)){if(_0x4429d5[_0x5e4208(0xaa)]>0x1)throw ambiguity(_0x4429d5);_0x1b9c49=_0x4429d5[0x0]??null;if(!_0x1b9c49)throw CliErrors['validation'](_0x5e4208(0x98));}if(_0x940c50===_0x5e4208(0xa3))return{'operation':_0x940c50,'from':_0x42a19f,'query':_0x13d889,'body':_0x13793d,'before':_0x1b9c49};const _0x266a7d=await resolveEndpoint(required(_0x210eb1,_0x5e4208(0xc1)));if(_0x42a19f['dblinkId']===_0x266a7d[_0x5e4208(0xd9)])throw CliErrors[_0x5e4208(0xa2)](_0x5e4208(0xbc));const _0x60b7e3=_0x210eb1[_0x5e4208(0xcd)](_0x5e4208(0xce))[_0x5e4208(0x96)](),_0x313646=_0x210eb1[_0x5e4208(0xcd)](_0x5e4208(0xdd))[_0x5e4208(0x96)](),_0x354c74={..._0x13793d,'toDatasetCode':_0x266a7d[_0x5e4208(0xa4)],'toField':required(_0x210eb1,'to-column'),..._0x60b7e3?{'refTableLabelName':_0x60b7e3}:{},..._0x313646?{'cardinality':_0x313646}:{}};if(_0x4429d5[_0x5e4208(0xc3)](_0x55c8e6=>_0x55c8e6['relationId']!==_0x1b9c49?.[_0x5e4208(0xed)]&&matchesEndpoint(_0x55c8e6,_0x42a19f,_0x354c74[_0x5e4208(0xe0)],_0x266a7d,_0x354c74[_0x5e4208(0xb9)])))throw CliErrors[_0x5e4208(0xa2)]('Cross-database\x20relation\x20already\x20exists\x20for\x20these\x20source\x20and\x20target\x20endpoints.');return{'operation':_0x940c50,'from':_0x42a19f,'to':_0x266a7d,'query':_0x13d889,'body':_0x354c74,'before':_0x1b9c49,'expectedLabel':_0x60b7e3||_0x1b9c49?.[_0x5e4208(0xde)]||_0x354c74[_0x5e4208(0xb9)],'expectedCardinality':_0x313646||_0x1b9c49?.[_0x5e4208(0xdd)]||null};}function mutationData(_0x2df385,_0x4e0277,_0x22940f){const _0x251fb0=a72_0x5bffc1,{operation:_0x1f58f2,body:_0x3042aa,before:_0x4e8c59}=_0x2df385;return{'operation':_0x1f58f2,'selector':{'appCode':_0x3042aa[_0x251fb0(0xd2)],'from':{'datasetCode':_0x3042aa[_0x251fb0(0x9a)],'field':_0x3042aa[_0x251fb0(0xe0)],'dblinkId':_0x2df385[_0x251fb0(0xdb)][_0x251fb0(0xd9)]}},'before':_0x4e8c59?projectCrossRelation(_0x4e8c59):null,'after':_0x22940f,'dryRun':_0x4e0277,'backend':{'method':_0x251fb0(0xec),'path':CROSS_DB_RELATION_PATHS[_0x1f58f2]},'warnings':_0x1f58f2===_0x251fb0(0xa6)&&!_0x3042aa['refTableLabelName']?[{'code':_0x251fb0(0xa0),'message':_0x251fb0(0xb5)}]:[]};}export async function previewCrossRelation(_0x35573a,_0x44a1f8){const _0x5c1e00=a72_0x5bffc1,_0x5e43a2=await prepareCrossRelation(_0x35573a,_0x44a1f8),_0x7ee611=_0x5e43a2[_0x5c1e00(0x9e)],_0x38b67a=_0x44a1f8===_0x5c1e00(0xa3)?null:{..._0x5e43a2[_0x5c1e00(0x9c)]?{'relationId':_0x5e43a2[_0x5c1e00(0x9c)][_0x5c1e00(0xed)]}:{},'from':{'datasetCode':_0x5e43a2[_0x5c1e00(0xdb)][_0x5c1e00(0xa4)],'dblinkId':_0x5e43a2[_0x5c1e00(0xdb)]['dblinkId'],'table':_0x5e43a2[_0x5c1e00(0xdb)][_0x5c1e00(0xa8)],'field':_0x7ee611[_0x5c1e00(0xe0)]},'to':{'datasetCode':_0x5e43a2['to'][_0x5c1e00(0xa4)],'dblinkId':_0x5e43a2['to'][_0x5c1e00(0xd9)],'table':_0x5e43a2['to']['table'],'field':_0x7ee611['toField'],'labelField':_0x5e43a2[_0x5c1e00(0xc8)]},'relation':{'cardinality':_0x5e43a2[_0x5c1e00(0xda)],'relationType':0x2}};return{...mutationData(_0x5e43a2,!![],null),'after':_0x38b67a,'method':_0x5c1e00(0xec),'url':CROSS_DB_RELATION_PATHS[_0x44a1f8],'body':_0x5e43a2['body'],'description':_0x5c1e00(0xa9)+_0x44a1f8+_0x5c1e00(0xc9)+_0x7ee611['fromDatasetCode']+'.'+_0x7ee611['fromField']};}export async function executeCrossRelation(_0x64bd15,_0x10a4e2,_0x395903){const _0xf76088=a72_0x5bffc1,_0x22bdb5=await prepareCrossRelation(_0x64bd15,_0x10a4e2);try{await _0x395903(_0x22bdb5['body']);}catch(_0x4ec865){if(_0x4ec865 instanceof CliError&&_0x4ec865['message']['includes']('multiple\x20cross-database\x20relations\x20matched')){const _0x5aa51d=await queryCrossDbRelations(_0x22bdb5[_0xf76088(0xca)])[_0xf76088(0xe4)](()=>[]);throw ambiguity(_0x5aa51d);}throw _0x4ec865;}let _0x3d01fb=[],_0x5ed34c,_0x1f9e3d=![];try{_0x3d01fb=await queryCrossDbRelations(_0x22bdb5[_0xf76088(0xca)]);if(_0x10a4e2===_0xf76088(0xa3))_0x1f9e3d=!_0x3d01fb[_0xf76088(0xc3)](_0x50cd51=>_0x50cd51['relationId']===_0x22bdb5['before']['relationId']);else{const _0xb752ab=_0x22bdb5[_0xf76088(0x9e)],_0x24f46d=_0x3d01fb[_0xf76088(0xba)](_0xad24ab=>matchesEndpoint(_0xad24ab,_0x22bdb5[_0xf76088(0xdb)],_0xb752ab['fromField'],_0x22bdb5['to'],_0xb752ab['toField'])&&(_0x10a4e2===_0xf76088(0xd7)||_0xad24ab[_0xf76088(0xed)]===_0x22bdb5[_0xf76088(0x9c)][_0xf76088(0xed)]));_0x5ed34c=_0x24f46d[_0xf76088(0xaa)]===0x1?_0x24f46d[0x0]:undefined,_0x1f9e3d=!!_0x5ed34c&&_0x5ed34c['refTableLabelName']===_0x22bdb5[_0xf76088(0xc8)]&&_0x5ed34c[_0xf76088(0xdd)]===_0x22bdb5['expectedCardinality']&&_0x5ed34c['relationType']===0x2;}}catch{}const _0x37f1fc={...mutationData(_0x22bdb5,![],_0x5ed34c?projectCrossRelation(_0x5ed34c):null),'verification':{'status':_0x1f9e3d?_0xf76088(0xd1):_0xf76088(0xcb),'verified':_0x1f9e3d}};if(!_0x1f9e3d){const _0x545154=CliErrors[_0xf76088(0xe5)]('Cross-database\x20relation\x20'+_0x10a4e2+_0xf76088(0xa1),'The\x20write\x20was\x20accepted,\x20but\x20current\x20state\x20could\x20not\x20be\x20confirmed.\x20Run\x20dataset\x20cross-relation-list\x20before\x20attempting\x20another\x20write.');Object['defineProperty'](_0x545154,_0xf76088(0xbb),{'value':{..._0x37f1fc,'candidates':_0x3d01fb[_0xf76088(0xab)](projectCrossRelation)}});throw _0x545154;}return{'ok':!![],'data':_0x37f1fc,'message':'Cross-database\x20relation\x20'+_0x10a4e2+_0xf76088(0xac)};}
1
+ import{getDatasetDetail,queryCrossDbRelations}from"../../core/api-client.js";import{CROSS_DB_RELATION_PATHS}from"../../core/cross-db-relation.js";import{CliError,CliErrors}from"../../errors.js";import{CROSS_RELATION_CARDINALITY_FLAG}from"../../commands/common/flags.js";function required(ctx,flag){const value=ctx.str(flag).trim();if(!value)throw CliErrors.flagMissing(flag);return value}function explicitDblink(ctx){const raw=ctx.flag("from-dblink-id");if(raw===undefined||raw===null)return undefined;const id=Number(raw);if(!Number.isSafeInteger(id)||id<=0)throw CliErrors.validation("--from-dblink-id must be a positive safe integer.");return id}export function validateCrossRelation(ctx,operation){const id=explicitDblink(ctx);if(operation==="list"){if(!ctx.str("from-datasetcode").trim()&&id===undefined){throw CliErrors.validation("Provide --from-datasetcode or --from-dblink-id.")}return}required(ctx,"from-datasetcode");required(ctx,"from-column");if(operation!=="delete"){
2
+ required(ctx,"to-datasetcode");required(ctx,"to-column");const cardinality=ctx.str("cardinality").trim();if(cardinality&&!CROSS_RELATION_CARDINALITY_FLAG.enum.includes(cardinality)){throw CliErrors.validation("Invalid --cardinality.")}}}async function resolveEndpoint(datasetCode){const detail=await getDatasetDetail(datasetCode);const dataset=detail?.dataset??{};if((detail?.source??dataset.sourceType)!=="DB_TABLE"){throw CliErrors.validation(`Dataset ${datasetCode} must be a DB_TABLE dataset.`)}const dbtable=detail.dbtableConfig??detail.dbtable??{};let extend=detail.extend??dataset.extend??{};if(typeof extend==="string"){try{extend=extend.trim()?JSON.parse(extend):{}}catch{throw CliErrors.validation(`Dataset ${datasetCode} has invalid storage configuration.`)}}const dblinkId=Number(extend?.storageProfile?.dbId??detail.storageProfile?.dbId??dataset.storageProfile?.dbId??dbtable.dbId??dataset.dbId??detail.dbId)
3
+ ;const table=String(detail.tableName??dataset.tableName??dbtable.tableName??"").trim();if(!Number.isSafeInteger(dblinkId)||dblinkId<=0||!table){throw CliErrors.validation(`Dataset ${datasetCode} is missing its database connection or physical table name.`)}return{datasetCode:datasetCode,dblinkId:dblinkId,table:table}}export async function resolveCrossRelationQuery(ctx){const code=ctx.str("from-datasetcode").trim();const requestedId=explicitDblink(ctx);const from=code?await resolveEndpoint(code):undefined;if(from&&requestedId!==undefined&&from.dblinkId!==requestedId){throw CliErrors.validation("--from-dblink-id does not match the source dataset connection.")}const id=from?.dblinkId??requestedId;if(id===undefined)throw CliErrors.validation("Provide --from-datasetcode or --from-dblink-id.");return{appCode:ctx.appCode,fromDblinkId:id,...code?{fromDatasetCode:code}:{},...ctx.str("from-column").trim()?{fromField:ctx.str("from-column").trim()}:{}}}export function projectCrossRelation(row){
4
+ return{relationId:row.relationId,from:{source:"DB_TABLE",datasetCode:row.fromDatasetCode,datasetName:row.fromDatasetName,dblinkId:row.fromDblinkId,table:row.fromTableName,field:row.fromField},to:{source:"DB_TABLE",datasetCode:row.toDatasetCode,datasetName:row.toDatasetName,dblinkId:row.toDblinkId,table:row.toTableName,field:row.toField,labelField:row.refTableLabelName},relation:{cardinality:row.cardinality,relationType:row.relationType}}}function ambiguity(candidates){const error=CliErrors.validation("Multiple cross-database relations match this source field; update/delete cannot select one target.","Run dataset cross-relation-list to inspect the candidates. This command accepts only a source dataset and field.");Object.defineProperty(error,"data",{value:{candidates:candidates.map(projectCrossRelation)}});return error}const sameName=(left,right)=>left.toLowerCase()===right.toLowerCase();function matchesEndpoint(row,from,fromField,to,toField){
5
+ return row.fromDblinkId===from.dblinkId&&sameName(row.fromTableName,from.table)&&sameName(row.fromField,fromField)&&row.toDblinkId===to.dblinkId&&sameName(row.toTableName,to.table)&&sameName(row.toField,toField)}export async function prepareCrossRelation(ctx,operation){const from=await resolveEndpoint(required(ctx,"from-datasetcode"));const requestedId=explicitDblink(ctx);if(requestedId!==undefined&&from.dblinkId!==requestedId){throw CliErrors.validation("--from-dblink-id does not match the source dataset connection.")}const source={appCode:ctx.appCode,fromDatasetCode:from.datasetCode,fromField:required(ctx,"from-column"),...requestedId!==undefined?{fromDblinkId:requestedId}:{}};const query={appCode:ctx.appCode,fromDblinkId:from.dblinkId,fromDatasetCode:from.datasetCode,fromField:source.fromField};const candidates=await queryCrossDbRelations(query);let before=null;if(operation!=="create"){if(candidates.length>1)throw ambiguity(candidates);before=candidates[0]??null
6
+ ;if(!before)throw CliErrors.validation("Cross-database relation not found for this source dataset and field.")}if(operation==="delete")return{operation:operation,from:from,query:query,body:source,before:before};const to=await resolveEndpoint(required(ctx,"to-datasetcode"));if(from.dblinkId===to.dblinkId){throw CliErrors.validation("Cross-database relations require different source and target database connections.")}const label=ctx.str("to-label-column").trim();const cardinality=ctx.str("cardinality").trim();const body={...source,toDatasetCode:to.datasetCode,toField:required(ctx,"to-column"),...label?{refTableLabelName:label}:{},...cardinality?{cardinality:cardinality}:{}};if(candidates.some(row=>row.relationId!==before?.relationId&&matchesEndpoint(row,from,body.fromField,to,body.toField))){throw CliErrors.validation("Cross-database relation already exists for these source and target endpoints.")}return{operation:operation,from:from,to:to,query:query,body:body,before:before,
7
+ expectedLabel:label||before?.refTableLabelName||body.toField,expectedCardinality:cardinality||before?.cardinality||null}}function mutationData(prepared,dryRun,after){const{operation:operation,body:body,before:before}=prepared;return{operation:operation,selector:{appCode:body.appCode,from:{datasetCode:body.fromDatasetCode,field:body.fromField,dblinkId:prepared.from.dblinkId}},before:before?projectCrossRelation(before):null,after:after,dryRun:dryRun,backend:{method:"POST",path:CROSS_DB_RELATION_PATHS[operation]},warnings:operation==="update"&&!body.refTableLabelName?[{code:"label_inherited",message:"The target display field is inherited. When changing the target dataset, provide --to-label-column explicitly."}]:[]}}export async function previewCrossRelation(ctx,operation){const prepared=await prepareCrossRelation(ctx,operation);const body=prepared.body;const after=operation==="delete"?null:{...prepared.before?{relationId:prepared.before.relationId}:{},from:{
8
+ datasetCode:prepared.from.datasetCode,dblinkId:prepared.from.dblinkId,table:prepared.from.table,field:body.fromField},to:{datasetCode:prepared.to.datasetCode,dblinkId:prepared.to.dblinkId,table:prepared.to.table,field:body.toField,labelField:prepared.expectedLabel},relation:{cardinality:prepared.expectedCardinality,relationType:2}};return{...mutationData(prepared,true,null),after:after,method:"POST",url:CROSS_DB_RELATION_PATHS[operation],body:prepared.body,description:`Would ${operation} a cross-database relation for ${body.fromDatasetCode}.${body.fromField}`}}export async function executeCrossRelation(ctx,operation,write){const prepared=await prepareCrossRelation(ctx,operation);try{await write(prepared.body)}catch(error){if(error instanceof CliError&&error.message.includes("multiple cross-database relations matched")){const candidates=await queryCrossDbRelations(prepared.query).catch(()=>[]);throw ambiguity(candidates)}throw error}let rows=[];let after;let verified=false;try{
9
+ rows=await queryCrossDbRelations(prepared.query);if(operation==="delete"){verified=!rows.some(row=>row.relationId===prepared.before.relationId)}else{const body=prepared.body;const matches=rows.filter(row=>matchesEndpoint(row,prepared.from,body.fromField,prepared.to,body.toField)&&(operation==="create"||row.relationId===prepared.before.relationId));after=matches.length===1?matches[0]:undefined;verified=!!after&&after.refTableLabelName===prepared.expectedLabel&&after.cardinality===prepared.expectedCardinality&&after.relationType===2}}catch{}const data={...mutationData(prepared,false,after?projectCrossRelation(after):null),verification:{status:verified?"matched":"unconfirmed",verified:verified}};if(!verified){const error=CliErrors.apiError(`Cross-database relation ${operation} write was not verified.`,"The write was accepted, but current state could not be confirmed. Run dataset cross-relation-list before attempting another write.");Object.defineProperty(error,"data",{value:{...data,
10
+ candidates:rows.map(projectCrossRelation)}});throw error}return{ok:true,data:data,message:`Cross-database relation ${operation} verified.`}}
@@ -1 +1,2 @@
1
- const a73_0x1fff0d=a73_0x309b;(function(_0x216b9d,_0x3f0ac6){const _0x27b796=a73_0x309b,_0x5b4b6c=_0x216b9d();while(!![]){try{const _0x346a7f=-parseInt(_0x27b796(0x1b0))/0x1+parseInt(_0x27b796(0x1a5))/0x2*(parseInt(_0x27b796(0x1b1))/0x3)+parseInt(_0x27b796(0x1a4))/0x4+-parseInt(_0x27b796(0x1a6))/0x5+parseInt(_0x27b796(0x1a9))/0x6*(-parseInt(_0x27b796(0x1ab))/0x7)+-parseInt(_0x27b796(0x1b2))/0x8+-parseInt(_0x27b796(0x1ad))/0x9*(-parseInt(_0x27b796(0x1ae))/0xa);if(_0x346a7f===_0x3f0ac6)break;else _0x5b4b6c['push'](_0x5b4b6c['shift']());}catch(_0xb3d2a9){_0x5b4b6c['push'](_0x5b4b6c['shift']());}}}(a73_0x2087,0x21ddc));import{updateCrossDbRelation}from'../../core/api-client.js';function a73_0x309b(_0x2bedec,_0x5ab7f0){_0x2bedec=_0x2bedec-0x1a4;const _0x2087de=a73_0x2087();let _0x309b98=_0x2087de[_0x2bedec];return _0x309b98;}function a73_0x2087(){const _0x2207f5=['30250auzlTr','cross-relation-update','write','6zTyBOd','dataset','1699061tenuaB','Update\x20the\x20target\x20or\x20properties\x20of\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','18lTTfwF','1724980DwUUAE','update','240687kFPTSA','5388yxaQbf','1071152AphITe','949896KjmRMA','200ZDEZgI'];a73_0x2087=function(){return _0x2207f5;};return a73_0x2087();}import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationUpdate={'service':a73_0x1fff0d(0x1aa),'command':a73_0x1fff0d(0x1a7),'description':a73_0x1fff0d(0x1ac),'risk':a73_0x1fff0d(0x1a8),'strictFlags':!![],'requiresCookieAuth':!![],'structuredErrors':!![],'flags':[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],'validate':async _0x36e929=>validateCrossRelation(_0x36e929,a73_0x1fff0d(0x1af)),'dryRun':_0x9b66be=>previewCrossRelation(_0x9b66be,a73_0x1fff0d(0x1af)),'execute':_0x564bfb=>executeCrossRelation(_0x564bfb,a73_0x1fff0d(0x1af),updateCrossDbRelation)};
1
+ import{updateCrossDbRelation}from"../../core/api-client.js";import{CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from"../../commands/dataset/cross-relation-shared.js";export const datasetCrossRelationUpdate={service:"dataset",command:"cross-relation-update",description:"Update the target or properties of the single cross-database relation matching a source dataset and field",risk:"write",strictFlags:true,requiresCookieAuth:true,structuredErrors:true,flags:[CROSS_RELATION_FROM_DATASET_FLAG,CROSS_RELATION_FROM_COLUMN_FLAG,CROSS_RELATION_TO_DATASET_FLAG,CROSS_RELATION_TO_COLUMN_FLAG,CROSS_RELATION_LABEL_FLAG,CROSS_RELATION_CARDINALITY_FLAG,CROSS_RELATION_DBLINK_FLAG,APPCODE_FLAG_OPTIONAL],
2
+ validate:async ctx=>validateCrossRelation(ctx,"update"),dryRun:ctx=>previewCrossRelation(ctx,"update"),execute:ctx=>executeCrossRelation(ctx,"update",updateCrossDbRelation)};
@@ -1 +1,6 @@
1
- const a74_0x5873d2=a74_0x5250;(function(_0x16e0e9,_0x449a23){const _0x136488=a74_0x5250,_0x5b8c84=_0x16e0e9();while(!![]){try{const _0x3e59ed=parseInt(_0x136488(0x13d))/0x1*(-parseInt(_0x136488(0x14c))/0x2)+parseInt(_0x136488(0x11b))/0x3*(-parseInt(_0x136488(0x142))/0x4)+-parseInt(_0x136488(0x129))/0x5*(-parseInt(_0x136488(0x134))/0x6)+-parseInt(_0x136488(0x12e))/0x7+parseInt(_0x136488(0x14f))/0x8*(parseInt(_0x136488(0x151))/0x9)+-parseInt(_0x136488(0x132))/0xa+-parseInt(_0x136488(0x152))/0xb*(-parseInt(_0x136488(0x13c))/0xc);if(_0x3e59ed===_0x449a23)break;else _0x5b8c84['push'](_0x5b8c84['shift']());}catch(_0xf6eeb2){_0x5b8c84['push'](_0x5b8c84['shift']());}}}(a74_0x1ed0,0x7f779));import{deleteDataset,getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a74_0x1ed0(){const _0xe0e997=['isArray','dbid=','description','message','confirm','isInteger','type','16404XCguPU','387624YleqBc','title','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','length','appCode','153828thnDCf','cascade','source','Would\x20delete\x20','map','/smartapi/dataset/delete?cascade=','\x20--appcode\x20','validation','POST','add','4JqsFOc','false','\x20dataset(s)','160pbrQHI','high-risk-write','242685uPyeRg','12815PxdxGo','boolean','Dataset\x20id','dbid','dbId','code','push','Matched\x20','name','No\x20undeleted\x20dataset\x20found\x20for\x20','str','dataset','57ijieRE','num','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','expected-count','tableName','relatedPageInfoList','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','\x20dataset(s)\x20and\x20their\x20listed\x20related\x20pages/menus.\x20Restore\x20each\x20Dataset\x20first,\x20then\x20restore\x20pages\x20explicitly\x20when\x20needed.','dbtableConfig','\x20dataset(s)\x20without\x20cascading\x20to\x20pages.\x20The\x20server\x20blocks\x20a\x20Dataset\x20that\x20still\x20has\x20related\x20pages.','\x20dataset(s);\x20','Deleted\x20','deleted','Also\x20delete\x20related\x20pages\x20and\x20menus;\x20requires\x20explicit\x20--confirm','850wZfQAe','filter','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','relatedPages','true','4206741OGgZRW','object','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','bool','271360EaCQqw','delete','18504kXRYNU'];a74_0x1ed0=function(){return _0xe0e997;};return a74_0x1ed0();}const DATASET_ID_FLAG={'name':'id','type':'number','description':a74_0x5873d2(0x154)},DBID_FLAG={'name':a74_0x5873d2(0x112),'type':'number','description':a74_0x5873d2(0x12b)},CONFIRM_FLAG={'name':a74_0x5873d2(0x139),'type':a74_0x5873d2(0x153),'description':'Required\x20to\x20execute\x20dataset\x20deletion'},CASCADE_FLAG={'name':a74_0x5873d2(0x143),'type':'boolean','description':a74_0x5873d2(0x128)},EXPECTED_COUNT_FLAG={'name':'expected-count','type':'number','description':a74_0x5873d2(0x11d)};export const datasetDelete={'service':a74_0x5873d2(0x11a),'command':a74_0x5873d2(0x133),'description':'Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','risk':a74_0x5873d2(0x150),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5ab053){const _0x47cbc9=a74_0x5873d2,_0x1b75cc=_0x5ab053[_0x47cbc9(0x11c)]('id'),_0x2160dd=_0x5ab053[_0x47cbc9(0x119)](_0x47cbc9(0x114)),_0x357ccf=_0x5ab053[_0x47cbc9(0x11c)](_0x47cbc9(0x112)),_0x1d1003=[_0x1b75cc>0x0,Boolean(_0x2160dd),_0x357ccf>0x0][_0x47cbc9(0x12a)](Boolean);if(_0x1d1003[_0x47cbc9(0x140)]===0x0)throw CliErrors[_0x47cbc9(0x149)](_0x47cbc9(0x130));if(_0x1d1003[_0x47cbc9(0x140)]>0x1)throw CliErrors[_0x47cbc9(0x149)](_0x47cbc9(0x13f));},async 'dryRun'(_0x29d96f){const _0x44d7cf=a74_0x5873d2,_0x218fe0=await resolveTargets(_0x29d96f),_0x23cb7a=_0x29d96f[_0x44d7cf(0x131)](_0x44d7cf(0x143));return{'method':_0x44d7cf(0x14a),'url':_0x44d7cf(0x147)+(_0x23cb7a?_0x44d7cf(0x12d):_0x44d7cf(0x14d)),'body':{'count':_0x218fe0[_0x44d7cf(0x140)],'cascade':_0x23cb7a,'datasets':_0x218fe0},'description':_0x23cb7a?_0x44d7cf(0x145)+_0x218fe0['length']+_0x44d7cf(0x122):'Would\x20safely\x20delete\x20'+_0x218fe0[_0x44d7cf(0x140)]+_0x44d7cf(0x124)};},async 'execute'(_0x460015){const _0x5a324a=a74_0x5873d2;if(!_0x460015[_0x5a324a(0x131)](_0x5a324a(0x139)))throw CliErrors[_0x5a324a(0x149)](_0x5a324a(0x121),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x169ecd=await resolveTargets(_0x460015),_0x114f78=_0x460015[_0x5a324a(0x131)](_0x5a324a(0x143)),_0x456ec8=[],_0x19097c=[];for(const _0x104a61 of _0x169ecd){try{await deleteDataset(_0x104a61['id'],_0x114f78),_0x456ec8[_0x5a324a(0x115)](_0x104a61);}catch(_0x3ce291){_0x19097c['push']({..._0x104a61,'error':_0x3ce291 instanceof Error?_0x3ce291[_0x5a324a(0x138)]:String(_0x3ce291)});}}if(_0x19097c[_0x5a324a(0x140)]>0x0){const _0x3ba12b=buildPageRestoreCommands(_0x460015['appCode'],_0x114f78?_0x456ec8:[]);return{'ok':![],'data':{'requested':_0x169ecd[_0x5a324a(0x140)],'cascade':_0x114f78,'deletedCount':_0x456ec8['length'],'failedCount':_0x19097c['length'],'deleted':_0x456ec8,'failed':_0x19097c,'pageRestoreCommands':_0x3ba12b},'message':_0x5a324a(0x126)+_0x456ec8['length']+'/'+_0x169ecd[_0x5a324a(0x140)]+_0x5a324a(0x125)+_0x19097c[_0x5a324a(0x140)]+'\x20failed'};}return{'ok':!![],'data':{'requested':_0x169ecd[_0x5a324a(0x140)],'cascade':_0x114f78,'deletedCount':_0x456ec8[_0x5a324a(0x140)],'deleted':_0x456ec8,'pageRestoreCommands':buildPageRestoreCommands(_0x460015[_0x5a324a(0x141)],_0x114f78?_0x456ec8:[])},'message':_0x5a324a(0x126)+_0x456ec8['length']+_0x5a324a(0x14e)};}};async function resolveTargets(_0x4dd5b8){const _0x165f6f=a74_0x5873d2,_0x67db65=_0x4dd5b8[_0x165f6f(0x11c)]('id'),_0x1ce685=_0x4dd5b8['str'](_0x165f6f(0x114)),_0x415204=_0x4dd5b8[_0x165f6f(0x11c)](_0x165f6f(0x112));let _0x3ea840;_0x1ce685?(_0x3ea840=await listDatasets(_0x4dd5b8[_0x165f6f(0x141)],{'code':_0x1ce685}),_0x3ea840=_0x3ea840['filter'](_0x37afbe=>_0x37afbe[_0x165f6f(0x114)]===_0x1ce685)):(_0x3ea840=await listDatasets(_0x4dd5b8['appCode']),_0x67db65>0x0&&(_0x3ea840=_0x3ea840[_0x165f6f(0x12a)](_0x46119b=>_0x46119b['id']===_0x67db65)),_0x415204>0x0&&(_0x3ea840=_0x3ea840[_0x165f6f(0x12a)](_0xf8cf2e=>_0xf8cf2e[_0x165f6f(0x123)]?.['dbId']===_0x415204)));const _0x2c75d6=[];for(const _0x5c2338 of _0x3ea840){const _0x42555b=await getDatasetDetail(_0x5c2338[_0x165f6f(0x114)]),_0x38a156=Array[_0x165f6f(0x135)](_0x42555b[_0x165f6f(0x120)])?_0x42555b[_0x165f6f(0x120)][_0x165f6f(0x12a)](_0x206d18=>_0x206d18!=null&&typeof _0x206d18===_0x165f6f(0x12f)&&_0x206d18[_0x165f6f(0x127)]!==!![]):[];_0x2c75d6['push'](normalizeTarget(_0x5c2338,_0x38a156));}if(_0x2c75d6[_0x165f6f(0x140)]===0x0){const _0xadd35f=_0x1ce685||(_0x67db65>0x0?'id='+_0x67db65:_0x165f6f(0x136)+_0x415204);throw CliErrors[_0x165f6f(0x149)](_0x165f6f(0x118)+_0xadd35f+'.');}const _0x57ca66=_0x4dd5b8[_0x165f6f(0x11c)](_0x165f6f(0x11e));if(_0x57ca66>0x0&&_0x2c75d6[_0x165f6f(0x140)]!==_0x57ca66)throw CliErrors['validation'](_0x165f6f(0x116)+_0x2c75d6[_0x165f6f(0x140)]+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x57ca66+'.');return _0x2c75d6;}function normalizeTarget(_0x3a446b,_0x18e5fd){const _0x55e4dd=a74_0x5873d2,_0x44c86a=_0x3a446b[_0x55e4dd(0x123)]??{},_0x41f953=_0x18e5fd[_0x55e4dd(0x146)](_0x357474=>{const _0xe57895=_0x55e4dd;if(_0x357474==null||typeof _0x357474!=='object')return null;const _0x2b61c4=_0x357474,_0x284e1e=Number(_0x2b61c4['id']);if(!Number[_0xe57895(0x13a)](_0x284e1e)||_0x284e1e<=0x0)return null;const _0x56cc10=_0x2b61c4[_0xe57895(0x13e)]??_0x2b61c4[_0xe57895(0x117)];return{'id':_0x284e1e,..._0x56cc10?{'name':String(_0x56cc10)}:{},..._0x2b61c4[_0xe57895(0x13b)]?{'type':String(_0x2b61c4['type'])}:{}};})[_0x55e4dd(0x12a)](_0x5e0f78=>_0x5e0f78!==null);return{'id':_0x3a446b['id'],'code':_0x3a446b[_0x55e4dd(0x114)],'name':_0x3a446b['name'],'description':_0x3a446b[_0x55e4dd(0x137)],'source':_0x3a446b[_0x55e4dd(0x144)],'dbId':_0x44c86a[_0x55e4dd(0x113)],'dbName':_0x44c86a['dbName'],'tableName':_0x44c86a[_0x55e4dd(0x11f)],'relatedPageCount':_0x41f953[_0x55e4dd(0x140)],'relatedPages':_0x41f953};}function a74_0x5250(_0x3f0b1e,_0x4e2c3e){_0x3f0b1e=_0x3f0b1e-0x112;const _0x1ed07a=a74_0x1ed0();let _0x5250f7=_0x1ed07a[_0x3f0b1e];return _0x5250f7;}function buildPageRestoreCommands(_0x19f2ad,_0x31f7ef){const _0x2131ac=a74_0x5873d2,_0x3fe6a0=new Set();for(const _0x542326 of _0x31f7ef){for(const _0xf8802e of _0x542326[_0x2131ac(0x12c)])_0x3fe6a0[_0x2131ac(0x14b)](_0xf8802e['id']);}return[..._0x3fe6a0][_0x2131ac(0x146)](_0x1fd6a5=>'rabetbase\x20page\x20restore\x20--id\x20'+_0x1fd6a5+_0x2131ac(0x148)+_0x19f2ad);}
1
+ import{deleteDataset,getDatasetDetail,listDatasets}from"../../core/api-client.js";import{CliErrors}from"../../errors.js";import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from"../../commands/common/flags.js";const DATASET_ID_FLAG={name:"id",type:"number",description:"Dataset id"};const DBID_FLAG={name:"dbid",type:"number",description:"Delete all datasets under this database connection id"};const CONFIRM_FLAG={name:"confirm",type:"boolean",description:"Required to execute dataset deletion"};const CASCADE_FLAG={name:"cascade",type:"boolean",description:"Also delete related pages and menus; requires explicit --confirm"};const EXPECTED_COUNT_FLAG={name:"expected-count",type:"number",description:"Abort unless the matched dataset count equals this value"};export const datasetDelete={service:"dataset",command:"delete",description:"Delete dataset metadata by id/code or all datasets under a db id",risk:"high-risk-write",
2
+ flags:[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async validate(ctx){const id=ctx.num("id");const code=ctx.str("code");const dbId=ctx.num("dbid");const selectors=[id>0,Boolean(code),dbId>0].filter(Boolean);if(selectors.length===0){throw CliErrors.validation("One of --id, --code, or --dbid is required.")}if(selectors.length>1){throw CliErrors.validation("Use only one of --id, --code, or --dbid.")}},async dryRun(ctx){const targets=await resolveTargets(ctx);const cascade=ctx.bool("cascade");return{method:"POST",url:`/smartapi/dataset/delete?cascade=${cascade?"true":"false"}`,body:{count:targets.length,cascade:cascade,datasets:targets},
3
+ description:cascade?`Would delete ${targets.length} dataset(s) and their listed related pages/menus. Restore each Dataset first, then restore pages explicitly when needed.`:`Would safely delete ${targets.length} dataset(s) without cascading to pages. The server blocks a Dataset that still has related pages.`}},async execute(ctx){if(!ctx.bool("confirm")){throw CliErrors.validation("--confirm is required to delete datasets.","Run with --dry-run first, then add --confirm when the target list is correct.")}const targets=await resolveTargets(ctx);const cascade=ctx.bool("cascade");const deleted=[];const failed=[];for(const target of targets){try{await deleteDataset(target.id,cascade);deleted.push(target)}catch(error){failed.push({...target,error:error instanceof Error?error.message:String(error)})}}if(failed.length>0){const pageRestoreCommands=buildPageRestoreCommands(ctx.appCode,cascade?deleted:[]);return{ok:false,data:{requested:targets.length,cascade:cascade,deletedCount:deleted.length,
4
+ failedCount:failed.length,deleted:deleted,failed:failed,pageRestoreCommands:pageRestoreCommands},message:`Deleted ${deleted.length}/${targets.length} dataset(s); ${failed.length} failed`}}return{ok:true,data:{requested:targets.length,cascade:cascade,deletedCount:deleted.length,deleted:deleted,pageRestoreCommands:buildPageRestoreCommands(ctx.appCode,cascade?deleted:[])},message:`Deleted ${deleted.length} dataset(s)`}}};async function resolveTargets(ctx){const id=ctx.num("id");const code=ctx.str("code");const dbId=ctx.num("dbid");let datasets;if(code){datasets=await listDatasets(ctx.appCode,{code:code});datasets=datasets.filter(item=>item.code===code)}else{datasets=await listDatasets(ctx.appCode);if(id>0){datasets=datasets.filter(item=>item.id===id)}if(dbId>0){datasets=datasets.filter(item=>item.dbtableConfig?.dbId===dbId)}}const targets=[];for(const dataset of datasets){const detail=await getDatasetDetail(dataset.code)
5
+ ;const relatedPages=Array.isArray(detail.relatedPageInfoList)?detail.relatedPageInfoList.filter(page=>page!=null&&typeof page==="object"&&page.deleted!==true):[];targets.push(normalizeTarget(dataset,relatedPages))}if(targets.length===0){const selector=code||(id>0?`id=${id}`:`dbid=${dbId}`);throw CliErrors.validation(`No undeleted dataset found for ${selector}.`)}const expectedCount=ctx.num("expected-count");if(expectedCount>0&&targets.length!==expectedCount){throw CliErrors.validation(`Matched ${targets.length} dataset(s), but --expected-count is ${expectedCount}.`)}return targets}function normalizeTarget(dataset,relatedPages){const db=dataset.dbtableConfig??{};const normalizedPages=relatedPages.map(page=>{if(page==null||typeof page!=="object")return null;const raw=page;const id=Number(raw.id);if(!Number.isInteger(id)||id<=0)return null;const name=raw.title??raw.name;return{id:id,...name?{name:String(name)}:{},...raw.type?{type:String(raw.type)}:{}}}).filter(page=>page!==null);return{
6
+ id:dataset.id,code:dataset.code,name:dataset.name,description:dataset.description,source:dataset.source,dbId:db.dbId,dbName:db.dbName,tableName:db.tableName,relatedPageCount:normalizedPages.length,relatedPages:normalizedPages}}function buildPageRestoreCommands(appCode,targets){const pageIds=new Set;for(const target of targets){for(const page of target.relatedPages)pageIds.add(page.id)}return[...pageIds].map(pageId=>`rabetbase page restore --id ${pageId} --appcode ${appCode}`)}
@@ -1 +1 @@
1
- function a75_0x2af0(){const _0x36c7d8=['1327944imEUeQ','15mhcPOv','240KDEupC','11MydOru','context','8846988vazgYh','3nvmQKf','2797638tZsmQo','91ZncvkO','543384luQYnN','837080KwmAUK','3141700eJcuqK','412740otRmWh'];a75_0x2af0=function(){return _0x36c7d8;};return a75_0x2af0();}const a75_0x4c3147=a75_0x19e9;function a75_0x19e9(_0x191d07,_0x8cfa6f){_0x191d07=_0x191d07-0x17f;const _0x2af013=a75_0x2af0();let _0x19e99c=_0x2af013[_0x191d07];return _0x19e99c;}(function(_0x387c69,_0x92c8c0){const _0x1deaeb=a75_0x19e9,_0x4b5252=_0x387c69();while(!![]){try{const _0x1dd7d8=parseInt(_0x1deaeb(0x17f))/0x1+parseInt(_0x1deaeb(0x180))/0x2+parseInt(_0x1deaeb(0x188))/0x3*(parseInt(_0x1deaeb(0x182))/0x4)+-parseInt(_0x1deaeb(0x183))/0x5*(parseInt(_0x1deaeb(0x189))/0x6)+-parseInt(_0x1deaeb(0x18a))/0x7*(parseInt(_0x1deaeb(0x18b))/0x8)+-parseInt(_0x1deaeb(0x181))/0x9*(-parseInt(_0x1deaeb(0x184))/0xa)+-parseInt(_0x1deaeb(0x185))/0xb*(parseInt(_0x1deaeb(0x187))/0xc);if(_0x1dd7d8===_0x92c8c0)break;else _0x4b5252['push'](_0x4b5252['shift']());}catch(_0x354365){_0x4b5252['push'](_0x4b5252['shift']());}}}(a75_0x2af0,0xc88f1));import{designCommand}from'../../services/dataset-design/commands.js';export const datasetDesignContext=designCommand(a75_0x4c3147(0x186));
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignContext=designCommand("context");
@@ -1 +1 @@
1
- const a76_0x31de3f=a76_0x4eb5;function a76_0x4eb5(_0x19234f,_0x393225){_0x19234f=_0x19234f-0xd0;const _0xc6849b=a76_0xc684();let _0x4eb54e=_0xc6849b[_0x19234f];return _0x4eb54e;}(function(_0x5bd899,_0x5c4abc){const _0x100e66=a76_0x4eb5,_0x1bec7d=_0x5bd899();while(!![]){try{const _0x3840a0=-parseInt(_0x100e66(0xd3))/0x1+-parseInt(_0x100e66(0xd0))/0x2+-parseInt(_0x100e66(0xd4))/0x3+-parseInt(_0x100e66(0xd5))/0x4+-parseInt(_0x100e66(0xd2))/0x5+-parseInt(_0x100e66(0xd6))/0x6+parseInt(_0x100e66(0xd7))/0x7;if(_0x3840a0===_0x5c4abc)break;else _0x1bec7d['push'](_0x1bec7d['shift']());}catch(_0x2ebf96){_0x1bec7d['push'](_0x1bec7d['shift']());}}}(a76_0xc684,0x5a1ba));import{designCommand}from'../../services/dataset-design/commands.js';function a76_0xc684(){const _0x26eac6=['683892gPWoSg','1663692FYXvaR','1220604DnhbmL','3779454nVNwYx','19758354MOxomD','406570OuZOug','start','383695CeoDIt'];a76_0xc684=function(){return _0x26eac6;};return a76_0xc684();}export const datasetDesignStart=designCommand(a76_0x31de3f(0xd1));
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignStart=designCommand("start");
@@ -1 +1 @@
1
- (function(_0x3a8d58,_0x29fc90){const _0x36be88=a77_0x45ab,_0x19ab8e=_0x3a8d58();while(!![]){try{const _0x3324c0=-parseInt(_0x36be88(0x189))/0x1+-parseInt(_0x36be88(0x186))/0x2+parseInt(_0x36be88(0x184))/0x3*(parseInt(_0x36be88(0x188))/0x4)+parseInt(_0x36be88(0x18a))/0x5*(-parseInt(_0x36be88(0x18c))/0x6)+-parseInt(_0x36be88(0x182))/0x7+parseInt(_0x36be88(0x185))/0x8*(-parseInt(_0x36be88(0x18b))/0x9)+-parseInt(_0x36be88(0x187))/0xa*(-parseInt(_0x36be88(0x183))/0xb);if(_0x3324c0===_0x29fc90)break;else _0x19ab8e['push'](_0x19ab8e['shift']());}catch(_0x119b51){_0x19ab8e['push'](_0x19ab8e['shift']());}}}(a77_0x2923,0x76ccc));function a77_0x45ab(_0x1ac90e,_0x1bcf6e){_0x1ac90e=_0x1ac90e-0x182;const _0x2923d5=a77_0x2923();let _0x45ab88=_0x2923d5[_0x1ac90e];return _0x45ab88;}function a77_0x2923(){const _0x307555=['10ZHCtgI','48476lhTYlc','877054LottGz','2324200XQENYG','63BrdnWE','6vgRHBx','851039pFOaiP','36217676yzoLCq','27QrbCIe','778192GWZXZp','1541188rTbOgf'];a77_0x2923=function(){return _0x307555;};return a77_0x2923();}import{designCommand}from'../../services/dataset-design/commands.js';export const datasetDesignStatus=designCommand('status');
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignStatus=designCommand("status");
@@ -1 +1 @@
1
- (function(_0x4a522e,_0x1f43da){const _0x315d12=a78_0x35ae,_0x4d901b=_0x4a522e();while(!![]){try{const _0x5723b9=parseInt(_0x315d12(0x1c0))/0x1+parseInt(_0x315d12(0x1c3))/0x2+parseInt(_0x315d12(0x1c1))/0x3*(-parseInt(_0x315d12(0x1c6))/0x4)+parseInt(_0x315d12(0x1c4))/0x5*(-parseInt(_0x315d12(0x1c7))/0x6)+parseInt(_0x315d12(0x1c5))/0x7*(parseInt(_0x315d12(0x1ca))/0x8)+-parseInt(_0x315d12(0x1c9))/0x9*(parseInt(_0x315d12(0x1c8))/0xa)+parseInt(_0x315d12(0x1c2))/0xb;if(_0x5723b9===_0x1f43da)break;else _0x4d901b['push'](_0x4d901b['shift']());}catch(_0x324dba){_0x4d901b['push'](_0x4d901b['shift']());}}}(a78_0x47ba,0x7c91a));function a78_0x35ae(_0x1ca806,_0x1933aa){_0x1ca806=_0x1ca806-0x1c0;const _0x47ba2f=a78_0x47ba();let _0x35ae76=_0x47ba2f[_0x1ca806];return _0x35ae76;}import{designCommand}from'../../services/dataset-design/commands.js';export const datasetDesignSyncRetry=designCommand('sync-retry');function a78_0x47ba(){const _0x57a5ab=['1520510IwDWSM','9mLbswY','8IxQHMK','34425oHkiEK','2742018yyTRpy','10780143LmBCTE','1572304GWyfJR','16045GjTXrm','3641323LfiWBw','4hjkQmE','1392xFzDDI'];a78_0x47ba=function(){return _0x57a5ab;};return a78_0x47ba();}
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignSyncRetry=designCommand("sync-retry");
@@ -1 +1 @@
1
- function a79_0x2ce8(_0x3f9264,_0x5e6271){_0x3f9264=_0x3f9264-0x9d;const _0x4fb5c8=a79_0x4fb5();let _0x2ce8b6=_0x4fb5c8[_0x3f9264];return _0x2ce8b6;}function a79_0x4fb5(){const _0x32dbe2=['3267803qWYMbk','1432jRSwzh','12zlOMbd','1472555oMKprR','7LlRKDg','1062872xOygWc','103942QSamlp','60UCjkUn','1660445Soozbq','3tnwVbQ','10737jeCuEb','5304100YDvkxv'];a79_0x4fb5=function(){return _0x32dbe2;};return a79_0x4fb5();}(function(_0x12ac2f,_0x351ad9){const _0x4c00c8=a79_0x2ce8,_0x55d70c=_0x12ac2f();while(!![]){try{const _0x476937=-parseInt(_0x4c00c8(0x9d))/0x1*(-parseInt(_0x4c00c8(0x9f))/0x2)+parseInt(_0x4c00c8(0xa2))/0x3*(parseInt(_0x4c00c8(0x9e))/0x4)+-parseInt(_0x4c00c8(0xa1))/0x5*(-parseInt(_0x4c00c8(0xa7))/0x6)+-parseInt(_0x4c00c8(0xa8))/0x7+-parseInt(_0x4c00c8(0xa6))/0x8*(-parseInt(_0x4c00c8(0xa3))/0x9)+parseInt(_0x4c00c8(0xa4))/0xa+-parseInt(_0x4c00c8(0xa5))/0xb*(parseInt(_0x4c00c8(0xa0))/0xc);if(_0x476937===_0x351ad9)break;else _0x55d70c['push'](_0x55d70c['shift']());}catch(_0x40050a){_0x55d70c['push'](_0x55d70c['shift']());}}}(a79_0x4fb5,0x537a0));import{designCommand}from'../../services/dataset-design/commands.js';export const datasetDesignSyncStatus=designCommand('sync-status');
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignSyncStatus=designCommand("sync-status");
@@ -1 +1 @@
1
- function a80_0x13b1(){const _0x372d93=['110257gmnNSy','19621224qECbdG','25491QCfBJW','validate','6965100kbHViY','4053975QoJYGs','2297600yPQtHx','1154011jpOpGO','496qsTlRj'];a80_0x13b1=function(){return _0x372d93;};return a80_0x13b1();}const a80_0x233284=a80_0x374b;function a80_0x374b(_0x3ccbd5,_0x2ba8c7){_0x3ccbd5=_0x3ccbd5-0x155;const _0x13b1bb=a80_0x13b1();let _0x374b15=_0x13b1bb[_0x3ccbd5];return _0x374b15;}(function(_0xfbd8ad,_0x390325){const _0x5ebe20=a80_0x374b,_0x4b3cda=_0xfbd8ad();while(!![]){try{const _0x25f7e6=-parseInt(_0x5ebe20(0x15d))/0x1+parseInt(_0x5ebe20(0x15c))/0x2+parseInt(_0x5ebe20(0x158))/0x3*(parseInt(_0x5ebe20(0x155))/0x4)+parseInt(_0x5ebe20(0x15b))/0x5+parseInt(_0x5ebe20(0x15a))/0x6+parseInt(_0x5ebe20(0x156))/0x7+-parseInt(_0x5ebe20(0x157))/0x8;if(_0x25f7e6===_0x390325)break;else _0x4b3cda['push'](_0x4b3cda['shift']());}catch(_0x58a517){_0x4b3cda['push'](_0x4b3cda['shift']());}}}(a80_0x13b1,0x8e5f8));import{designCommand}from'../../services/dataset-design/commands.js';export const datasetDesignValidate=designCommand(a80_0x233284(0x159));
1
+ import{designCommand}from"../../services/dataset-design/commands.js";export const datasetDesignValidate=designCommand("validate");