@lovrabet/rabetbase-cli 2.5.3-beta.1 → 2.5.3-beta.3

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 (419) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.d.ts +22 -0
  3. package/lib/api/api-group.js +1 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +18 -2
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/generate-sdk-config-file.js +1 -1
  8. package/lib/api/legacy-api-file.d.ts +11 -0
  9. package/lib/api/legacy-api-file.js +1 -0
  10. package/lib/api/model-registry-file.d.ts +36 -0
  11. package/lib/api/model-registry-file.js +1 -0
  12. package/lib/api/model-registry-scaffold.d.ts +7 -0
  13. package/lib/api/model-registry-scaffold.js +1 -0
  14. package/lib/api/model-source.d.ts +6 -0
  15. package/lib/api/model-source.js +1 -0
  16. package/lib/auth/auth-server-ui.js +1 -1
  17. package/lib/auth/auth-server.js +1 -1
  18. package/lib/auth/constant.js +1 -1
  19. package/lib/auth/get-cookie.js +1 -1
  20. package/lib/auth/get-session-user.js +1 -1
  21. package/lib/auth/is-session-valid.js +1 -1
  22. package/lib/auth/login-success-html.js +1 -1
  23. package/lib/auth/logout.js +1 -1
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.js +1 -1
  26. package/lib/commands/api/generate.js +1 -1
  27. package/lib/commands/api/index.js +1 -1
  28. package/lib/commands/api/list.js +1 -1
  29. package/lib/commands/api/pull.js +1 -1
  30. package/lib/commands/api/shared.js +1 -1
  31. package/lib/commands/app/index.js +1 -1
  32. package/lib/commands/app/list.js +1 -1
  33. package/lib/commands/app/members-list.js +1 -1
  34. package/lib/commands/app/remote-directory.js +1 -1
  35. package/lib/commands/app/shared.js +1 -1
  36. package/lib/commands/app-config/delete.js +1 -1
  37. package/lib/commands/app-config/get.js +1 -1
  38. package/lib/commands/app-config/index.js +1 -1
  39. package/lib/commands/app-config/list.js +1 -1
  40. package/lib/commands/app-config/set.js +1 -1
  41. package/lib/commands/app-config/shared.js +1 -1
  42. package/lib/commands/auth/index.js +1 -1
  43. package/lib/commands/bff/create.js +1 -1
  44. package/lib/commands/bff/delete.js +1 -1
  45. package/lib/commands/bff/detail.js +1 -1
  46. package/lib/commands/bff/index.js +1 -1
  47. package/lib/commands/bff/list.js +1 -1
  48. package/lib/commands/bff/logs.d.ts +7 -0
  49. package/lib/commands/bff/logs.js +1 -0
  50. package/lib/commands/bff/pull.js +1 -1
  51. package/lib/commands/bff/push.js +1 -1
  52. package/lib/commands/bff/status.js +1 -1
  53. package/lib/commands/cli-skill/index.js +1 -1
  54. package/lib/commands/cli-update.js +1 -1
  55. package/lib/commands/codegen/index.js +1 -1
  56. package/lib/commands/codegen/sdk.js +1 -1
  57. package/lib/commands/codegen/sql.js +1 -1
  58. package/lib/commands/common/app-registry.js +1 -1
  59. package/lib/commands/common/app-selector.js +1 -1
  60. package/lib/commands/common/async-task.js +1 -1
  61. package/lib/commands/common/dry-run.js +1 -1
  62. package/lib/commands/common/flags.d.ts +7 -0
  63. package/lib/commands/common/flags.js +1 -1
  64. package/lib/commands/common/local-file.js +1 -1
  65. package/lib/commands/common/validate.js +1 -1
  66. package/lib/commands/config/delete.js +1 -1
  67. package/lib/commands/config/get.js +1 -1
  68. package/lib/commands/config/index.js +1 -1
  69. package/lib/commands/config/init.js +1 -1
  70. package/lib/commands/config/list.js +1 -1
  71. package/lib/commands/config/set.js +1 -1
  72. package/lib/commands/config/shared.js +1 -1
  73. package/lib/commands/dataset/batch-design.d.ts +21 -0
  74. package/lib/commands/dataset/batch-design.js +1 -0
  75. package/lib/commands/dataset/business-group-update.js +1 -1
  76. package/lib/commands/dataset/business-groups.js +1 -1
  77. package/lib/commands/dataset/capability.js +1 -1
  78. package/lib/commands/dataset/cross-relation-create.d.ts +2 -0
  79. package/lib/commands/dataset/cross-relation-create.js +1 -0
  80. package/lib/commands/dataset/cross-relation-delete.d.ts +2 -0
  81. package/lib/commands/dataset/cross-relation-delete.js +1 -0
  82. package/lib/commands/dataset/cross-relation-list.d.ts +2 -0
  83. package/lib/commands/dataset/cross-relation-list.js +1 -0
  84. package/lib/commands/dataset/cross-relation-shared.d.ts +190 -0
  85. package/lib/commands/dataset/cross-relation-shared.js +1 -0
  86. package/lib/commands/dataset/cross-relation-update.d.ts +2 -0
  87. package/lib/commands/dataset/cross-relation-update.js +1 -0
  88. package/lib/commands/dataset/delete.js +1 -1
  89. package/lib/commands/dataset/detail.js +1 -1
  90. package/lib/commands/dataset/extend-update.js +1 -1
  91. package/lib/commands/dataset/field-restore.js +1 -1
  92. package/lib/commands/dataset/field-update.js +1 -1
  93. package/lib/commands/dataset/generate.js +1 -1
  94. package/lib/commands/dataset/index.js +1 -1
  95. package/lib/commands/dataset/list.js +1 -1
  96. package/lib/commands/dataset/operations.js +1 -1
  97. package/lib/commands/dataset/relation-audit.js +1 -1
  98. package/lib/commands/dataset/relation-create.js +1 -1
  99. package/lib/commands/dataset/relation-delete.js +1 -1
  100. package/lib/commands/dataset/relation-shared.js +1 -1
  101. package/lib/commands/dataset/relation-update.js +1 -1
  102. package/lib/commands/dataset/relations.js +1 -1
  103. package/lib/commands/dataset/rename.js +1 -1
  104. package/lib/commands/dataset/restore.js +1 -1
  105. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  106. package/lib/commands/db/analysis-batching.js +1 -1
  107. package/lib/commands/db/analyze-batch-plan.js +1 -1
  108. package/lib/commands/db/analyze-cancel.js +1 -1
  109. package/lib/commands/db/analyze-start.js +1 -1
  110. package/lib/commands/db/analyze-status.js +1 -1
  111. package/lib/commands/db/create.js +1 -1
  112. package/lib/commands/db/delete.js +1 -1
  113. package/lib/commands/db/detail.js +1 -1
  114. package/lib/commands/db/diff-refresh-start.js +1 -1
  115. package/lib/commands/db/diff-refresh-status.js +1 -1
  116. package/lib/commands/db/diff.js +1 -1
  117. package/lib/commands/db/index.js +1 -1
  118. package/lib/commands/db/list.js +1 -1
  119. package/lib/commands/db/shared.js +1 -1
  120. package/lib/commands/db/table-diff-shared.js +1 -1
  121. package/lib/commands/db/tables.js +1 -1
  122. package/lib/commands/db/test.js +1 -1
  123. package/lib/commands/db/update.js +1 -1
  124. package/lib/commands/deployment/index.js +1 -1
  125. package/lib/commands/deployment/sync-all.js +1 -1
  126. package/lib/commands/deployment/sync-jobs.js +1 -1
  127. package/lib/commands/deployment/sync-status.js +1 -1
  128. package/lib/commands/doctor.js +1 -1
  129. package/lib/commands/file/index.js +1 -1
  130. package/lib/commands/flow/create.d.ts +2 -0
  131. package/lib/commands/flow/create.js +1 -0
  132. package/lib/commands/flow/detail.d.ts +2 -0
  133. package/lib/commands/flow/detail.js +1 -0
  134. package/lib/commands/flow/index.d.ts +3 -0
  135. package/lib/commands/flow/index.js +1 -0
  136. package/lib/commands/flow/list.d.ts +2 -0
  137. package/lib/commands/flow/list.js +1 -0
  138. package/lib/commands/flow/publish.d.ts +2 -0
  139. package/lib/commands/flow/publish.js +1 -0
  140. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  141. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  142. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  143. package/lib/commands/flow/runtime-role-list.js +1 -0
  144. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  145. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  146. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  147. package/lib/commands/flow/runtime-user-search.js +1 -0
  148. package/lib/commands/flow/shared.d.ts +41 -0
  149. package/lib/commands/flow/shared.js +1 -0
  150. package/lib/commands/flow/update.d.ts +2 -0
  151. package/lib/commands/flow/update.js +1 -0
  152. package/lib/commands/flow/validate.d.ts +3 -0
  153. package/lib/commands/flow/validate.js +1 -0
  154. package/lib/commands/instant-api-policy/current.js +1 -1
  155. package/lib/commands/instant-api-policy/index.js +1 -1
  156. package/lib/commands/instant-api-policy/init.js +1 -1
  157. package/lib/commands/instant-api-policy/publish.js +1 -1
  158. package/lib/commands/instant-api-policy/pull.js +1 -1
  159. package/lib/commands/instant-api-policy/revision.js +1 -1
  160. package/lib/commands/instant-api-policy/revisions.js +1 -1
  161. package/lib/commands/instant-api-policy/rollback.js +1 -1
  162. package/lib/commands/instant-api-policy/shared.js +1 -1
  163. package/lib/commands/instant-api-policy/validate.js +1 -1
  164. package/lib/commands/issue/index.js +1 -1
  165. package/lib/commands/issue/nudge.js +1 -1
  166. package/lib/commands/issue/report.js +1 -1
  167. package/lib/commands/issue/shared.js +1 -1
  168. package/lib/commands/kb/create.js +1 -1
  169. package/lib/commands/kb/delete.js +1 -1
  170. package/lib/commands/kb/detail.js +1 -1
  171. package/lib/commands/kb/index.js +1 -1
  172. package/lib/commands/kb/list.js +1 -1
  173. package/lib/commands/kb/search.js +1 -1
  174. package/lib/commands/kb/shared.js +1 -1
  175. package/lib/commands/kb/update.js +1 -1
  176. package/lib/commands/logs/index.js +1 -1
  177. package/lib/commands/menu/asset-update.js +1 -1
  178. package/lib/commands/menu/delete.js +1 -1
  179. package/lib/commands/menu/external-link-create.js +1 -1
  180. package/lib/commands/menu/external-link-update.js +1 -1
  181. package/lib/commands/menu/group-create.js +1 -1
  182. package/lib/commands/menu/group-update.js +1 -1
  183. package/lib/commands/menu/index.js +1 -1
  184. package/lib/commands/menu/list.js +1 -1
  185. package/lib/commands/menu/move.js +1 -1
  186. package/lib/commands/menu/regroup-start.js +1 -1
  187. package/lib/commands/menu/rename.js +1 -1
  188. package/lib/commands/menu/shared/compare-table.js +1 -1
  189. package/lib/commands/menu/shared/delete-plan.js +1 -1
  190. package/lib/commands/menu/shared/facts.js +1 -1
  191. package/lib/commands/menu/shared/index.js +1 -1
  192. package/lib/commands/menu/shared/inquirer.js +1 -1
  193. package/lib/commands/menu/shared/local-pages.js +1 -1
  194. package/lib/commands/menu/shared/logic.js +1 -1
  195. package/lib/commands/menu/shared/mutations.js +1 -1
  196. package/lib/commands/menu/shared/service.js +1 -1
  197. package/lib/commands/menu/shared/sync-core.js +1 -1
  198. package/lib/commands/menu/shared/update-core.js +1 -1
  199. package/lib/commands/menu/shared/valid-url.js +1 -1
  200. package/lib/commands/menu/sync.js +1 -1
  201. package/lib/commands/menu/visibility-update.js +1 -1
  202. package/lib/commands/notification/config-create.js +1 -1
  203. package/lib/commands/notification/config-delete.js +1 -1
  204. package/lib/commands/notification/config-list.js +1 -1
  205. package/lib/commands/notification/config-update.js +1 -1
  206. package/lib/commands/notification/index.js +1 -1
  207. package/lib/commands/notification/shared.js +1 -1
  208. package/lib/commands/ocr/index.js +1 -1
  209. package/lib/commands/page/create.js +1 -1
  210. package/lib/commands/page/custom/detail.js +1 -1
  211. package/lib/commands/page/custom/list.js +1 -1
  212. package/lib/commands/page/custom/publish.js +1 -1
  213. package/lib/commands/page/custom/shared.js +1 -1
  214. package/lib/commands/page/custom/syntax.js +1 -1
  215. package/lib/commands/page/custom/update.js +1 -1
  216. package/lib/commands/page/data-list-status.js +1 -1
  217. package/lib/commands/page/generate-start.js +1 -1
  218. package/lib/commands/page/generate-status.js +1 -1
  219. package/lib/commands/page/index.js +1 -1
  220. package/lib/commands/page/pull.js +1 -1
  221. package/lib/commands/page/push.js +1 -1
  222. package/lib/commands/page/relation-audit.js +1 -1
  223. package/lib/commands/page/restore.js +1 -1
  224. package/lib/commands/page/shared.js +1 -1
  225. package/lib/commands/page/sync.js +1 -1
  226. package/lib/commands/project/api-architecture-upgrade.d.ts +28 -0
  227. package/lib/commands/project/api-architecture-upgrade.js +1 -0
  228. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  229. package/lib/commands/project/create/format-elapsed.js +1 -1
  230. package/lib/commands/project/create/main.js +1 -1
  231. package/lib/commands/project/create/materialize-project-template.js +1 -1
  232. package/lib/commands/project/create/project-name.js +1 -1
  233. package/lib/commands/project/create/project-template-archive.js +1 -1
  234. package/lib/commands/project/create/project-template-path.js +1 -1
  235. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  236. package/lib/commands/project/create/use-format-code.js +1 -1
  237. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  238. package/lib/commands/project/domain-routing-sync.js +1 -1
  239. package/lib/commands/project/index.js +1 -1
  240. package/lib/commands/project/upgrade.d.ts +30 -1
  241. package/lib/commands/project/upgrade.js +1 -1
  242. package/lib/commands/registry.js +1 -1
  243. package/lib/commands/role/delete.js +1 -1
  244. package/lib/commands/role/detail.js +1 -1
  245. package/lib/commands/role/index.js +1 -1
  246. package/lib/commands/role/list.js +1 -1
  247. package/lib/commands/role/shared.js +1 -1
  248. package/lib/commands/role/update.js +1 -1
  249. package/lib/commands/role/user-add.js +1 -1
  250. package/lib/commands/role/user-remove.js +1 -1
  251. package/lib/commands/role/user-resolve.js +1 -1
  252. package/lib/commands/rule/get.js +1 -1
  253. package/lib/commands/rule/index.js +1 -1
  254. package/lib/commands/rule/list.js +1 -1
  255. package/lib/commands/rule/set.js +1 -1
  256. package/lib/commands/rule/shared.js +1 -1
  257. package/lib/commands/run/index.js +1 -1
  258. package/lib/commands/schema.js +1 -1
  259. package/lib/commands/sql/create.js +1 -1
  260. package/lib/commands/sql/delete.js +1 -1
  261. package/lib/commands/sql/detail.js +1 -1
  262. package/lib/commands/sql/exec.js +1 -1
  263. package/lib/commands/sql/index.js +1 -1
  264. package/lib/commands/sql/list.js +1 -1
  265. package/lib/commands/sql/pull.js +1 -1
  266. package/lib/commands/sql/push.js +1 -1
  267. package/lib/commands/sql/shared.js +1 -1
  268. package/lib/commands/sql/status.js +1 -1
  269. package/lib/commands/sql/validate.js +1 -1
  270. package/lib/commands/task/index.js +1 -1
  271. package/lib/commands/task/status.js +1 -1
  272. package/lib/commands/tenant/index.js +1 -1
  273. package/lib/commands/tenant/members-list.js +1 -1
  274. package/lib/commands/tenant/shared.js +1 -1
  275. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  276. package/lib/commands/user-account/index.js +1 -1
  277. package/lib/commands/workspace/add.js +1 -1
  278. package/lib/commands/workspace/index.js +1 -1
  279. package/lib/commands/workspace/remove.js +1 -1
  280. package/lib/config/domain-config.js +1 -1
  281. package/lib/config/project-domain-routing.js +1 -1
  282. package/lib/config/region-config.js +1 -1
  283. package/lib/config/schema.js +1 -1
  284. package/lib/constant/cdn.js +1 -1
  285. package/lib/constant/cli.js +1 -1
  286. package/lib/constant/defaults.js +1 -1
  287. package/lib/constant/domain.js +1 -1
  288. package/lib/constant/env.js +1 -1
  289. package/lib/constant/output.js +1 -1
  290. package/lib/constant/paths.js +1 -1
  291. package/lib/constant/region.js +1 -1
  292. package/lib/constant/risk.js +1 -1
  293. package/lib/constant/routing-profile.js +1 -1
  294. package/lib/context/app-resolver.d.ts +2 -0
  295. package/lib/context/app-resolver.js +1 -1
  296. package/lib/context/auth-resolver.js +1 -1
  297. package/lib/context/config-loader.js +1 -1
  298. package/lib/context.d.ts +2 -1
  299. package/lib/context.js +1 -1
  300. package/lib/core/alias-resolver.d.ts +13 -17
  301. package/lib/core/alias-resolver.js +1 -1
  302. package/lib/core/api-client.d.ts +176 -1
  303. package/lib/core/api-client.js +1 -1
  304. package/lib/core/bff/config.js +1 -1
  305. package/lib/core/bff/file-system.js +1 -1
  306. package/lib/core/bff/hash.js +1 -1
  307. package/lib/core/bff/hook-directory.d.ts +55 -0
  308. package/lib/core/bff/hook-directory.js +1 -0
  309. package/lib/core/bff/lock.js +1 -1
  310. package/lib/core/bff/types.d.ts +15 -0
  311. package/lib/core/bff/utils.js +1 -1
  312. package/lib/core/cross-db-relation.d.ts +41 -0
  313. package/lib/core/cross-db-relation.js +1 -0
  314. package/lib/core/db-resolver.js +1 -1
  315. package/lib/core/flow-config.d.ts +628 -0
  316. package/lib/core/flow-config.js +1 -0
  317. package/lib/core/instant-api-policy/config.js +1 -1
  318. package/lib/core/kb-search-client.js +1 -1
  319. package/lib/core/page/file-system.js +1 -1
  320. package/lib/core/page/hash.js +1 -1
  321. package/lib/core/page/lock.js +1 -1
  322. package/lib/core/page/lr-smart-jsx.js +1 -1
  323. package/lib/core/sql-index-auditor.js +1 -1
  324. package/lib/core/sql-sync/config.js +1 -1
  325. package/lib/core/sql-sync/file-system.js +1 -1
  326. package/lib/core/sql-sync/hash.js +1 -1
  327. package/lib/core/sql-sync/lock.js +1 -1
  328. package/lib/core/sql-sync/utils.js +1 -1
  329. package/lib/core/sql-validator.js +1 -1
  330. package/lib/errors.js +1 -1
  331. package/lib/framework/build-all-flags.js +1 -1
  332. package/lib/framework/error-output.js +1 -1
  333. package/lib/framework/explicit-yes.js +1 -1
  334. package/lib/framework/flags.js +1 -1
  335. package/lib/framework/help.js +1 -1
  336. package/lib/framework/index.js +1 -1
  337. package/lib/framework/output.js +1 -1
  338. package/lib/framework/response.js +1 -1
  339. package/lib/framework/runner-alias.d.ts +1 -1
  340. package/lib/framework/runner-alias.js +1 -1
  341. package/lib/framework/runner.js +1 -1
  342. package/lib/framework/schema-export.js +1 -1
  343. package/lib/framework/supported-flags.js +1 -1
  344. package/lib/framework/types.js +1 -1
  345. package/lib/generated/build-info.d.ts +4 -4
  346. package/lib/generated/build-info.js +1 -1
  347. package/lib/generated/official-routing.js +1 -1
  348. package/lib/generated/routing-contract.js +1 -1
  349. package/lib/help.js +1 -1
  350. package/lib/postinstall.js +1 -1
  351. package/lib/runtime/confirmation.js +1 -1
  352. package/lib/runtime/event.js +1 -1
  353. package/lib/runtime/index.js +1 -1
  354. package/lib/runtime/queue.js +1 -1
  355. package/lib/runtime/resolve.js +1 -1
  356. package/lib/skills/builtin-skill.js +1 -1
  357. package/lib/skills/main.js +1 -1
  358. package/lib/skills/npx-skills-add.d.ts +0 -10
  359. package/lib/skills/npx-skills-add.js +1 -1
  360. package/lib/skills/skill-presence.js +1 -1
  361. package/lib/telemetry/cli-command-trace.js +1 -1
  362. package/lib/telemetry/cli-help-trace.js +1 -1
  363. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  364. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  365. package/lib/telemetry/send-cli-trace-log.js +1 -1
  366. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  367. package/lib/types/index.d.ts +11 -1
  368. package/lib/utils/ai_config.js +1 -1
  369. package/lib/utils/apply-jq-filter.js +1 -1
  370. package/lib/utils/cdn-config.js +1 -1
  371. package/lib/utils/check-sdk-version.js +1 -1
  372. package/lib/utils/cli-version-check.js +1 -1
  373. package/lib/utils/cli-version-policy.d.ts +12 -0
  374. package/lib/utils/cli-version-policy.js +1 -1
  375. package/lib/utils/config.js +1 -1
  376. package/lib/utils/entity-with-id.js +1 -1
  377. package/lib/utils/file-utils.js +1 -1
  378. package/lib/utils/guides-cdn.js +1 -1
  379. package/lib/utils/http-client.js +1 -1
  380. package/lib/utils/is-non-interactive.js +1 -1
  381. package/lib/utils/logger.js +1 -1
  382. package/lib/utils/params.js +1 -1
  383. package/lib/utils/platform.js +1 -1
  384. package/lib/utils/sleep.js +1 -1
  385. package/lib/utils/template-replacer.js +1 -1
  386. package/lib/utils/update-notice.js +1 -1
  387. package/lib/utils/version.js +1 -1
  388. package/lib/utils/with-active-cookie.js +1 -1
  389. package/lib/utils/write-cli-side-channel.js +1 -1
  390. package/package.json +4 -1
  391. package/skills/rabetbase/SKILL.md +31 -9
  392. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  393. package/skills/rabetbase/guides/backend-function.md +19 -9
  394. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  395. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  396. package/skills/rabetbase/guides/sdk-client-generation.md +112 -60
  397. package/skills/rabetbase/guides/typescript-sdk.md +9 -0
  398. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  399. package/skills/rabetbase/references/rabetbase-api-pull.md +30 -19
  400. package/skills/rabetbase/references/rabetbase-app-list.md +1 -1
  401. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  402. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  403. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  404. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  405. package/skills/rabetbase/references/rabetbase-config.md +2 -1
  406. package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +60 -0
  407. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  408. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  409. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  410. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  411. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  412. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  413. package/skills/rabetbase/references/rabetbase-project-create.md +3 -3
  414. package/skills/rabetbase/references/rabetbase-project-upgrade.md +24 -13
  415. package/skills/rabetbase.manifest.json +10 -3
  416. package/templates/README.md +16 -4
  417. package/templates/generate-api/model-runtime.ts.tpl +101 -0
  418. package/templates/generate-api/profile-api.ts.tpl +21 -0
  419. package/templates/generate-api/profile-client.ts.tpl +14 -0
@@ -1 +1 @@
1
- (function(_0x5f4405,_0x36fd58){var _0xac003c=a57_0x50ef,_0x24a68c=_0x5f4405();while(!![]){try{var _0xea113=parseInt(_0xac003c(0x1b4))/0x1*(parseInt(_0xac003c(0x1b3))/0x2)+parseInt(_0xac003c(0x1a9))/0x3*(-parseInt(_0xac003c(0x1ab))/0x4)+-parseInt(_0xac003c(0x1ae))/0x5+-parseInt(_0xac003c(0x1a8))/0x6*(-parseInt(_0xac003c(0x1aa))/0x7)+-parseInt(_0xac003c(0x1b5))/0x8+parseInt(_0xac003c(0x1ad))/0x9+parseInt(_0xac003c(0x1af))/0xa*(parseInt(_0xac003c(0x1ac))/0xb);if(_0xea113===_0x36fd58)break;else _0x24a68c['push'](_0x24a68c['shift']());}catch(_0x4bfdd8){_0x24a68c['push'](_0x24a68c['shift']());}}}(a57_0x1ff2,0xe8725));function a57_0x1ff2(){var _0xc77c18=['global','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','6QHBBTi','55035xFEzXW','501851jnYHVS','340odOGoQ','726pbbEvW','7263297TFGVaJ','2436085eEikhK','314110tsCHIL','project','validation','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','2422886RnIufF','1LZFaUB','9317216nvEqVs','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`'];a57_0x1ff2=function(){return _0xc77c18;};return a57_0x1ff2();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a57_0x50ef(_0x3a31bd,_0x31ace2){_0x3a31bd=_0x3a31bd-0x1a7;var _0x1ff2c4=a57_0x1ff2();var _0x50ef94=_0x1ff2c4[_0x3a31bd];return _0x50ef94;}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(_0x42a2bd){var _0x1be6f8=a57_0x50ef;if(_0x42a2bd[_0x1be6f8(0x1b7)])return _0x1be6f8(0x1b7);if(!isInProject())throw CliErrors[_0x1be6f8(0x1b1)](_0x1be6f8(0x1b2),_0x1be6f8(0x1b6)+CLI_BIN_NAME+_0x1be6f8(0x1a7));return _0x1be6f8(0x1b0);}export function readScopedConfig(_0x1ebcca){return readConfigFile(resolveWriteConfigPath(_0x1ebcca));}export function writeScopedConfig(_0x5d5c9a,_0x44695e){writeConfigFile(resolveWriteConfigPath(_0x44695e),_0x5d5c9a);}
1
+ (function(_0x10b9d7,_0x57661b){var _0x31794e=a63_0xcae5,_0x36ea38=_0x10b9d7();while(!![]){try{var _0x39b608=parseInt(_0x31794e(0x127))/0x1+-parseInt(_0x31794e(0x123))/0x2*(-parseInt(_0x31794e(0x124))/0x3)+-parseInt(_0x31794e(0x120))/0x4+-parseInt(_0x31794e(0x12d))/0x5*(parseInt(_0x31794e(0x122))/0x6)+-parseInt(_0x31794e(0x126))/0x7+-parseInt(_0x31794e(0x12c))/0x8*(-parseInt(_0x31794e(0x129))/0x9)+parseInt(_0x31794e(0x125))/0xa;if(_0x39b608===_0x57661b)break;else _0x36ea38['push'](_0x36ea38['shift']());}catch(_0x5093aa){_0x36ea38['push'](_0x36ea38['shift']());}}}(a63_0x1bd8,0x91bb3));function a63_0x1bd8(){var _0x185dec=['8307olBpkc','\x20workspace\x20init\x20--appcode\x20<code>`\x20first.','global','3496EJitgi','25xDaPpY','1201516siBEza','project','1425954WrbjpU','6kjusdX','297237ahlEJt','8599870lZXAsi','822178aurKPA','642468vgmVdh','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`'];a63_0x1bd8=function(){return _0x185dec;};return a63_0x1bd8();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a63_0xcae5(_0x2badb2,_0x438150){_0x2badb2=_0x2badb2-0x120;var _0x1bd821=a63_0x1bd8();var _0xcae5c1=_0x1bd821[_0x2badb2];return _0xcae5c1;}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(_0x519ae5){var _0x10f458=a63_0xcae5;if(_0x519ae5[_0x10f458(0x12b)])return _0x10f458(0x12b);if(!isInProject())throw CliErrors['validation']('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x10f458(0x128)+CLI_BIN_NAME+_0x10f458(0x12a));return _0x10f458(0x121);}export function readScopedConfig(_0x3bb423){return readConfigFile(resolveWriteConfigPath(_0x3bb423));}export function writeScopedConfig(_0x4aa4c9,_0x241e4f){writeConfigFile(resolveWriteConfigPath(_0x241e4f),_0x4aa4c9);}
@@ -0,0 +1,21 @@
1
+ export interface DatasetBatchDesign extends Record<string, unknown> {
2
+ kind: "dataset-batch";
3
+ schemaVersion: 1;
4
+ datasets: Array<{
5
+ localKey: string;
6
+ design: Record<string, unknown>;
7
+ }>;
8
+ relations: Record<string, unknown>[];
9
+ unresolvedRelations: Record<string, unknown>[];
10
+ }
11
+ export interface ReconciledBatchResult {
12
+ expectedLocalKeys: string[];
13
+ expectedRelations: Record<string, unknown>[];
14
+ createdDatasets: Record<string, unknown>[];
15
+ createdRelations: Record<string, unknown>[];
16
+ unresolvedRelations: Record<string, unknown>[];
17
+ metrics?: Record<string, unknown>;
18
+ }
19
+ export declare function isDatasetBatchDesign(value: unknown): value is DatasetBatchDesign;
20
+ export declare function validateDatasetBatchDesign(value: unknown): DatasetBatchDesign;
21
+ export declare function reconcileBatchResult(value: unknown): ReconciledBatchResult | null;
@@ -0,0 +1 @@
1
+ const a64_0x3a1ebf=a64_0x1ebe;(function(_0x3ea1ed,_0x38d1e2){const _0x4bd695=a64_0x1ebe,_0x43df95=_0x3ea1ed();while(!![]){try{const _0x3be099=-parseInt(_0x4bd695(0x1b8))/0x1*(parseInt(_0x4bd695(0x16f))/0x2)+-parseInt(_0x4bd695(0x169))/0x3*(-parseInt(_0x4bd695(0x1a3))/0x4)+-parseInt(_0x4bd695(0x19b))/0x5+-parseInt(_0x4bd695(0x174))/0x6*(parseInt(_0x4bd695(0x16b))/0x7)+-parseInt(_0x4bd695(0x1b0))/0x8+-parseInt(_0x4bd695(0x1b6))/0x9+parseInt(_0x4bd695(0x181))/0xa*(parseInt(_0x4bd695(0x17c))/0xb);if(_0x3be099===_0x38d1e2)break;else _0x43df95['push'](_0x43df95['shift']());}catch(_0x201871){_0x43df95['push'](_0x43df95['shift']());}}}(a64_0x546c,0x5915b));import{CliErrors}from'../../errors.js';const LOCAL_KEY=/^[a-z][a-z0-9_]{0,63}$/,SUPPORTED_CARDINALITIES=new Set([a64_0x3a1ebf(0x183),a64_0x3a1ebf(0x1bd)]),SUPPORTED_FIELD_TYPES=new Set(['TEXT',a64_0x3a1ebf(0x172),a64_0x3a1ebf(0x188),a64_0x3a1ebf(0x18d),a64_0x3a1ebf(0x179),'MULTI_SELECT',a64_0x3a1ebf(0x163),a64_0x3a1ebf(0x1a1),'ADDRESS','UPLOAD']);export function isDatasetBatchDesign(_0xdea19f){const _0xcbe239=a64_0x3a1ebf;return isObject(_0xdea19f)&&_0xdea19f[_0xcbe239(0x15d)]==='dataset-batch';}export function validateDatasetBatchDesign(_0x3469d2){const _0x4099de=a64_0x3a1ebf;(!isObject(_0x3469d2)||_0x3469d2['kind']!=='dataset-batch')&&fail(_0x4099de(0x1b2));_0x3469d2[_0x4099de(0x182)]!==0x1&&fail(_0x4099de(0x177));const _0x507a35=objectArray(_0x3469d2['datasets'],_0x4099de(0x186),0x1,0x14),_0x56d4c3=objectArray(_0x3469d2[_0x4099de(0x178)],_0x4099de(0x178),0x0,0xc8),_0x453fe0=objectArray(_0x3469d2['unresolvedRelations'],_0x4099de(0x19e),0x0,0xc8),_0x58be39=new Set(),_0x5d6e08=new Map();for(const [_0x14a40b,_0x312c6c]of _0x507a35[_0x4099de(0x1bc)]()){const _0x3ecd50=requiredString(_0x312c6c[_0x4099de(0x17a)],'datasets['+_0x14a40b+_0x4099de(0x193));!LOCAL_KEY[_0x4099de(0x187)](_0x3ecd50)&&fail('datasets['+_0x14a40b+_0x4099de(0x171)+LOCAL_KEY[_0x4099de(0x1af)]+'.');_0x58be39[_0x4099de(0x1c2)](_0x3ecd50)&&fail(_0x4099de(0x18c));_0x58be39['add'](_0x3ecd50);!isObject(_0x312c6c[_0x4099de(0x1b3)])&&fail(_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x170));rejectServerDatasetIdentity(_0x312c6c[_0x4099de(0x1b3)],_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x194));if(!isObject(_0x312c6c[_0x4099de(0x1b3)][_0x4099de(0x17d)]))fail(_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x191));rejectServerDatasetIdentity(_0x312c6c[_0x4099de(0x1b3)][_0x4099de(0x17d)],'datasets['+_0x14a40b+_0x4099de(0x167)),requiredString(_0x312c6c['design'][_0x4099de(0x17d)][_0x4099de(0x16e)],_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x175));_0x4099de(0x178)in _0x312c6c[_0x4099de(0x1b3)]&&(!Array['isArray'](_0x312c6c[_0x4099de(0x1b3)][_0x4099de(0x178)])||_0x312c6c[_0x4099de(0x1b3)][_0x4099de(0x178)]['length']!==0x0)&&fail(_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x1a9));const _0x43e1cd=objectArray(_0x312c6c[_0x4099de(0x1b3)][_0x4099de(0x18e)],_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x185),0x1,0xc8),_0x3cb44b=new Map();for(const [_0x431312,_0x12e57c]of _0x43e1cd[_0x4099de(0x1bc)]()){const _0x204fe4=fieldName(_0x12e57c);if(!_0x204fe4)fail(_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x184)+_0x431312+']\x20must\x20have\x20a\x20non-empty\x20name\x20or\x20code.');const _0x33acdc=_0x204fe4[_0x4099de(0x189)]();if(_0x3cb44b[_0x4099de(0x1c2)](_0x33acdc))fail('Dataset\x20'+_0x3ecd50+'\x20field\x20names\x20must\x20be\x20unique\x20ignoring\x20case.');const _0xea0238=stringValue(_0x12e57c[_0x4099de(0x15b)]??_0x12e57c[_0x4099de(0x1ba)])[_0x4099de(0x17f)]();if(!SUPPORTED_FIELD_TYPES[_0x4099de(0x1c2)](_0xea0238))fail('datasets['+_0x14a40b+_0x4099de(0x184)+_0x431312+'].type\x20is\x20not\x20supported.');_0x3cb44b[_0x4099de(0x1bf)](_0x33acdc,_0xea0238),[_0x12e57c[_0x4099de(0x166)],_0x12e57c[_0x4099de(0x195)],_0x12e57c[_0x4099de(0x176)]]['some'](_0x1b612b=>stringValue(_0x1b612b))&&fail(_0x4099de(0x16c)+_0x14a40b+_0x4099de(0x184)+_0x431312+_0x4099de(0x190));}_0x5d6e08['set'](_0x3ecd50,_0x3cb44b);}const _0x56df3c=new Set(),_0x158fa9=new Set();for(const [_0x3a2f4a,_0x4e9700]of _0x56d4c3[_0x4099de(0x1bc)]()){const _0x1b3887=validateRelation(_0x4e9700,_0x3a2f4a,_0x58be39,_0x5d6e08);if(_0x56df3c[_0x4099de(0x1c2)](_0x1b3887))fail(_0x4099de(0x1a8));_0x56df3c[_0x4099de(0x1a6)](_0x1b3887);const _0x3738ce=_0x1b3887['split']('\x00',0x2)[_0x4099de(0x165)]('\x00');if(_0x158fa9[_0x4099de(0x1c2)](_0x3738ce))fail(_0x4099de(0x16d));_0x158fa9[_0x4099de(0x1a6)](_0x3738ce);}for(const [_0x20e767,_0x2e8f58]of _0x453fe0[_0x4099de(0x1bc)]()){requiredString(_0x2e8f58[_0x4099de(0x162)],_0x4099de(0x199)+_0x20e767+'].reason'),validateConfidence(_0x2e8f58[_0x4099de(0x1c1)],_0x4099de(0x199)+_0x20e767+'].confidence');}return _0x3469d2;}export function reconcileBatchResult(_0x4695f6){const _0x51a9a1=a64_0x3a1ebf;if(!isObject(_0x4695f6))return null;try{const _0x220dc7=stringArray(_0x4695f6[_0x51a9a1(0x196)],_0x51a9a1(0x196),0x1,0x14),_0x15fcc3=new Set(_0x220dc7);if(_0x15fcc3[_0x51a9a1(0x1b4)]!==_0x220dc7[_0x51a9a1(0x197)]||_0x220dc7[_0x51a9a1(0x19d)](_0x2e7fe7=>!LOCAL_KEY['test'](_0x2e7fe7)))return null;const _0xe632f1=objectArray(_0x4695f6[_0x51a9a1(0x1b7)],_0x51a9a1(0x1b7),0x1,0x14),_0xb01a0a=new Map(),_0x13fbc1=new Set();for(const _0x377f50 of _0xe632f1){const _0x11b687=requiredString(_0x377f50[_0x51a9a1(0x17a)],'createdDatasets[].localKey'),_0x31868c=requiredString(_0x377f50['code']??_0x377f50[_0x51a9a1(0x1a7)],_0x51a9a1(0x161));if(_0xb01a0a[_0x51a9a1(0x1c2)](_0x11b687)||_0x13fbc1[_0x51a9a1(0x1c2)](_0x31868c))return null;_0xb01a0a[_0x51a9a1(0x1bf)](_0x11b687,_0x31868c),_0x13fbc1[_0x51a9a1(0x1a6)](_0x31868c);}if(!sameSet(_0x15fcc3,new Set(_0xb01a0a[_0x51a9a1(0x168)]())))return null;const _0x2cd328=objectArray(_0x4695f6[_0x51a9a1(0x198)],'expectedRelations',0x0,0xc8),_0x584596=objectArray(_0x4695f6['createdRelations'],_0x51a9a1(0x19c),0x0,0xc8),_0x2013e1=relationTupleSet(_0x2cd328,![],_0xb01a0a),_0x354d46=relationTupleSet(_0x584596,!![],_0xb01a0a);if(!_0x2013e1||!_0x354d46||!sameSet(_0x2013e1,_0x354d46))return null;const _0x4550fd=objectArray(_0x4695f6[_0x51a9a1(0x19e)],_0x51a9a1(0x19e),0x0,0xc8);return{'expectedLocalKeys':_0x220dc7,'expectedRelations':_0x2cd328,'createdDatasets':_0xe632f1,'createdRelations':_0x584596,'unresolvedRelations':_0x4550fd,...isObject(_0x4695f6[_0x51a9a1(0x1c0)])?{'metrics':_0x4695f6[_0x51a9a1(0x1c0)]}:{}};}catch{return null;}}function validateRelation(_0x311115,_0xcc36c7,_0xc74754,_0x6f1cad){const _0x1e6fc6=a64_0x3a1ebf,_0x4545b4=_0x1e6fc6(0x19a)+_0xcc36c7+']',_0x311132=requiredString(_0x311115[_0x1e6fc6(0x15e)],_0x4545b4+_0x1e6fc6(0x17b)),_0xb86ff6=requiredString(_0x311115[_0x1e6fc6(0x164)],_0x4545b4+'.toDatasetKey'),_0x15d5a6=requiredString(_0x311115[_0x1e6fc6(0x1a0)],_0x4545b4+_0x1e6fc6(0x18b))[_0x1e6fc6(0x189)](),_0x340cae=requiredString(_0x311115['toField'],_0x4545b4+_0x1e6fc6(0x15c))['toLowerCase']();if(!_0xc74754[_0x1e6fc6(0x1c2)](_0x311132)||!_0xc74754['has'](_0xb86ff6))fail(_0x4545b4+'\x20references\x20an\x20unknown\x20dataset\x20localKey.');const _0x58a892=_0x6f1cad['get'](_0x311132)?.[_0x1e6fc6(0x16a)](_0x15d5a6),_0x3b11e8=_0x6f1cad[_0x1e6fc6(0x16a)](_0xb86ff6)?.['get'](_0x340cae);if(_0x58a892===undefined||_0x3b11e8===undefined)fail(_0x4545b4+'\x20references\x20an\x20unknown\x20field.');if(_0x58a892&&_0x3b11e8&&_0x58a892!==_0x3b11e8)fail(_0x4545b4+_0x1e6fc6(0x160));const _0x156dc1=stringValue(_0x311115['relationType'])||_0x1e6fc6(0x18f);if(_0x156dc1!==_0x1e6fc6(0x18f))fail(_0x4545b4+'.relationType\x20must\x20be\x20\x22lookup\x22.');const _0x503e95=stringValue(_0x311115['cardinality'])||_0x1e6fc6(0x183);if(!SUPPORTED_CARDINALITIES[_0x1e6fc6(0x1c2)](_0x503e95))fail(_0x4545b4+_0x1e6fc6(0x1b9));return requiredString(_0x311115['reason'],_0x4545b4+_0x1e6fc6(0x1bb)),validateConfidence(_0x311115[_0x1e6fc6(0x1c1)],_0x4545b4+_0x1e6fc6(0x180)),tuple(_0x311132,_0x15d5a6,_0xb86ff6,_0x340cae,_0x1e6fc6(0x18f),_0x503e95);}function relationTupleSet(_0x97da3e,_0x4fe0c6,_0x207ccb){const _0x2efe8f=a64_0x3a1ebf,_0x3ce26b=new Set();for(const _0x55eb3f of _0x97da3e){const _0x3e614e=stringValue(_0x55eb3f[_0x2efe8f(0x15e)]),_0x527562=stringValue(_0x55eb3f[_0x2efe8f(0x164)]),_0x4dd70b=stringValue(_0x55eb3f[_0x2efe8f(0x1a0)])['toLowerCase'](),_0x8be7a6=stringValue(_0x55eb3f[_0x2efe8f(0x15a)])[_0x2efe8f(0x189)](),_0x30e90e=stringValue(_0x55eb3f['relationType']),_0x2ec12e=stringValue(_0x55eb3f[_0x2efe8f(0x1ac)]);if(!_0x3e614e||!_0x527562||!_0x4dd70b||!_0x8be7a6||_0x30e90e!==_0x2efe8f(0x18f)||!SUPPORTED_CARDINALITIES[_0x2efe8f(0x1c2)](_0x2ec12e))return null;if(!_0x207ccb[_0x2efe8f(0x1c2)](_0x3e614e)||!_0x207ccb[_0x2efe8f(0x1c2)](_0x527562))return null;if(_0x4fe0c6&&(stringValue(_0x55eb3f[_0x2efe8f(0x173)])!==_0x207ccb['get'](_0x3e614e)||stringValue(_0x55eb3f[_0x2efe8f(0x1a4)])!==_0x207ccb[_0x2efe8f(0x16a)](_0x527562)))return null;const _0x5cfbe6=tuple(_0x3e614e,_0x4dd70b,_0x527562,_0x8be7a6,_0x30e90e,_0x2ec12e);if(_0x3ce26b[_0x2efe8f(0x1c2)](_0x5cfbe6))return null;_0x3ce26b['add'](_0x5cfbe6);}return _0x3ce26b;}function rejectServerDatasetIdentity(_0x2aa699,_0x38d922){const _0x19ac82=a64_0x3a1ebf;for(const _0x5e31bc of['id','datasetId',_0x19ac82(0x19f),_0x19ac82(0x1b5),_0x19ac82(0x1a7),_0x19ac82(0x1aa)]){if(_0x2aa699[_0x5e31bc]!==undefined&&_0x2aa699[_0x5e31bc]!==null&&_0x2aa699[_0x5e31bc]!=='')fail(_0x38d922+'.'+_0x5e31bc+'\x20must\x20not\x20be\x20supplied\x20by\x20the\x20client.');}}function a64_0x546c(){const _0x51daf5=['336IRfUSM','].design.dataset.datasetName','refTableLabelField','Dataset\x20batch\x20schemaVersion\x20must\x20be\x201.','relations','SELECT','localKey','.fromDatasetKey','11kpTjHK','dataset','isFinite','toUpperCase','.confidence','20221630pbpTpy','schemaVersion','MANY_TO_ONE','].design.fields[','].design.fields','datasets','test','DATETIME','toLowerCase','\x20must\x20be\x20between\x200\x20and\x201.','.fromField','Dataset\x20batch\x20localKey\x20values\x20must\x20be\x20unique.','BOOLEAN','fields','lookup',']\x20must\x20not\x20contain\x20embedded\x20relation\x20references.','].design.dataset\x20must\x20be\x20an\x20object.','\x20non-empty\x20strings.','].localKey','].design','refTableField','expectedLocalKeys','length','expectedRelations','unresolvedRelations[','relations[','2398190wQGCxK','createdRelations','some','unresolvedRelations','modelId','fromField','USER','validation','456PoSlhi','toDatasetCode','isArray','add','datasetCode','Dataset\x20batch\x20relations\x20must\x20be\x20unique.','].design.relations\x20must\x20be\x20an\x20empty\x20array;\x20use\x20top-level\x20relations.','modelCode','\x20must\x20contain\x20','cardinality','trim','object','source','4483072itpAyR','name','Batch\x20--design-file\x20must\x20have\x20kind\x20\x22dataset-batch\x22.','design','size','code','4605093pbsjue','createdDatasets','710531zgUtOV','.cardinality\x20is\x20not\x20supported.','fieldType','.reason','entries','ONE_TO_ONE','string','set','metrics','confidence','has','\x20is\x20required.','toField','type','.toField','kind','fromDatasetKey','fieldCode','\x20connects\x20incompatible\x20field\x20types.','createdDatasets[].code','reason','DATE_RANGE','toDatasetKey','join','refTable','].design.dataset','keys','16449WOfoAz','get','2513jtZgcl','datasets[','Each\x20source\x20field\x20may\x20target\x20at\x20most\x20one\x20relation.','datasetName','2DhAgKj','].design\x20must\x20be\x20an\x20object.','].localKey\x20must\x20match\x20','NUMBER','fromDatasetCode'];a64_0x546c=function(){return _0x51daf5;};return a64_0x546c();}function a64_0x1ebe(_0x46a768,_0x7d477b){_0x46a768=_0x46a768-0x15a;const _0x546c2d=a64_0x546c();let _0x1ebe0e=_0x546c2d[_0x46a768];return _0x1ebe0e;}function objectArray(_0x2ef4e9,_0x40aec3,_0x4e201f,_0x36f7e8){const _0x4388bb=a64_0x3a1ebf;return(!Array[_0x4388bb(0x1a5)](_0x2ef4e9)||_0x2ef4e9[_0x4388bb(0x197)]<_0x4e201f||_0x2ef4e9[_0x4388bb(0x197)]>_0x36f7e8||_0x2ef4e9[_0x4388bb(0x19d)](_0x1da4d9=>!isObject(_0x1da4d9)))&&fail(_0x40aec3+_0x4388bb(0x1ab)+_0x4e201f+'..'+_0x36f7e8+'\x20objects.'),_0x2ef4e9;}function stringArray(_0x492444,_0x3db4a4,_0x15c6bd,_0xd7a55d){const _0x29009a=a64_0x3a1ebf;return(!Array[_0x29009a(0x1a5)](_0x492444)||_0x492444[_0x29009a(0x197)]<_0x15c6bd||_0x492444[_0x29009a(0x197)]>_0xd7a55d||_0x492444['some'](_0x2acb63=>typeof _0x2acb63!=='string'||!_0x2acb63['trim']()))&&fail(_0x3db4a4+_0x29009a(0x1ab)+_0x15c6bd+'..'+_0xd7a55d+_0x29009a(0x192)),_0x492444;}function requiredString(_0x3771dd,_0x44870a){const _0x4aeb59=a64_0x3a1ebf,_0xbe48=stringValue(_0x3771dd);if(!_0xbe48)fail(_0x44870a+_0x4aeb59(0x1c3));return _0xbe48;}function stringValue(_0x4567fc){const _0x2fc2f2=a64_0x3a1ebf;return typeof _0x4567fc===_0x2fc2f2(0x1be)?_0x4567fc[_0x2fc2f2(0x1ad)]():'';}function fieldName(_0x51d577){const _0x2a0ed6=a64_0x3a1ebf;return stringValue(_0x51d577[_0x2a0ed6(0x1b5)]??_0x51d577[_0x2a0ed6(0x15f)]??_0x51d577[_0x2a0ed6(0x1b1)]??_0x51d577['fieldName']);}function validateConfidence(_0x55df70,_0x5b6695){const _0x431116=a64_0x3a1ebf;_0x55df70!==undefined&&_0x55df70!==null&&(typeof _0x55df70!=='number'||!Number[_0x431116(0x17e)](_0x55df70)||_0x55df70<0x0||_0x55df70>0x1)&&fail(_0x5b6695+_0x431116(0x18a));}function tuple(..._0x1f8115){const _0x602f0=a64_0x3a1ebf;return _0x1f8115['map']((_0x44957e,_0x5c35e7)=>_0x5c35e7===0x1||_0x5c35e7===0x3?_0x44957e[_0x602f0(0x189)]():_0x44957e)[_0x602f0(0x165)]('\x00');}function sameSet(_0x3a9024,_0x356b1b){const _0xea113b=a64_0x3a1ebf;return _0x3a9024[_0xea113b(0x1b4)]===_0x356b1b[_0xea113b(0x1b4)]&&[..._0x3a9024]['every'](_0x2f11ba=>_0x356b1b[_0xea113b(0x1c2)](_0x2f11ba));}function isObject(_0x1c91fd){const _0x190567=a64_0x3a1ebf;return typeof _0x1c91fd===_0x190567(0x1ae)&&_0x1c91fd!==null&&!Array[_0x190567(0x1a5)](_0x1c91fd);}function fail(_0x56a039){const _0x3afa2f=a64_0x3a1ebf;throw CliErrors[_0x3afa2f(0x1a2)](_0x56a039);}
@@ -1 +1 @@
1
- const a58_0x47f237=a58_0x3f63;(function(_0x354a8f,_0x20fa14){const _0x46e5fa=a58_0x3f63,_0x59d17c=_0x354a8f();while(!![]){try{const _0x4a782f=-parseInt(_0x46e5fa(0x191))/0x1+parseInt(_0x46e5fa(0x1ba))/0x2+parseInt(_0x46e5fa(0x1a8))/0x3*(-parseInt(_0x46e5fa(0x1ad))/0x4)+parseInt(_0x46e5fa(0x184))/0x5*(-parseInt(_0x46e5fa(0x195))/0x6)+-parseInt(_0x46e5fa(0x182))/0x7+parseInt(_0x46e5fa(0x1b2))/0x8+parseInt(_0x46e5fa(0x193))/0x9;if(_0x4a782f===_0x20fa14)break;else _0x59d17c['push'](_0x59d17c['shift']());}catch(_0x5e7e4d){_0x59d17c['push'](_0x59d17c['shift']());}}}(a58_0x3d8b,0x70a73));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=a58_0x47f237(0x1b4),METADATA_BACKEND_PATH='/smartapi/question/er-config/business-group/edit',UNGROUPED_BUSINESS_GROUP=a58_0x47f237(0x19d);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x12a6de,input:_0x3b6e74,dryRun:_0x24d420}){const _0x3dd3ea=a58_0x47f237;validateInput(_0x3b6e74);const _0x5dffa9=normalizeBusinessGroupArgument(_0x3b6e74[_0x3dd3ea(0x1c4)]),_0x3c141b=await getDatasetDetail(_0x3b6e74[_0x3dd3ea(0x1ac)]),_0x3832d9=resolveBusinessGroupDataset(_0x3c141b,_0x3b6e74[_0x3dd3ea(0x1ac)]);assertBusinessGroupUpdateSupported(_0x3832d9,_0x5dffa9);const _0x114f5b=loadCurrentBusinessGroup(_0x3c141b,_0x3832d9);assertExpectedBusinessGroup(_0x114f5b,_0x3b6e74[_0x3dd3ea(0x17e)]);const _0x45c29c=buildBackendPlan(_0x12a6de,_0x3832d9,_0x5dffa9),_0x2fef8f=_0x114f5b!==_0x5dffa9;let _0x5a3ebb;if(_0x2fef8f&&!_0x24d420){_0x45c29c[_0x3dd3ea(0x189)]===_0x3dd3ea(0x1bf)?await updateDbTableBusinessGroup(_0x45c29c[_0x3dd3ea(0x1a6)]):await updateErBusinessGroup(_0x45c29c[_0x3dd3ea(0x1a6)]);const _0x46dd18=await getDatasetDetail(_0x3832d9[_0x3dd3ea(0x1ac)]),_0x46541a=resolveBusinessGroupDataset(_0x46dd18,_0x3832d9[_0x3dd3ea(0x1ac)]),_0x1ee0b5=loadCurrentBusinessGroup(_0x46dd18,_0x46541a);if(_0x1ee0b5!==_0x5dffa9)throw CliErrors['apiError'](_0x3dd3ea(0x1ab),_0x3dd3ea(0x1b9)+JSON[_0x3dd3ea(0x180)](displayBusinessGroup(_0x5dffa9))+_0x3dd3ea(0x1b7)+JSON[_0x3dd3ea(0x180)](displayBusinessGroup(_0x1ee0b5))+'.');_0x5a3ebb={'verified':!![],'status':_0x3dd3ea(0x1a5),'afterReadback':{'businessGroup':displayBusinessGroup(_0x1ee0b5)}};}else!_0x2fef8f&&(_0x5a3ebb={'verified':!![],'status':_0x3dd3ea(0x1c8),'afterReadback':{'businessGroup':displayBusinessGroup(_0x114f5b)}});const _0x334642={'operation':_0x3dd3ea(0x1bb),'appCode':_0x12a6de,'selector':{'code':_0x3832d9[_0x3dd3ea(0x1ac)]},'dataset':{'id':_0x3832d9['id'],'code':_0x3832d9[_0x3dd3ea(0x1ac)],'name':_0x3832d9[_0x3dd3ea(0x1a7)],'sourceType':_0x3832d9['sourceType']},'before':{'businessGroup':displayBusinessGroup(_0x114f5b)},'after':{'businessGroup':displayBusinessGroup(_0x5dffa9)},'changed':_0x2fef8f,'dryRun':_0x24d420,'submitted':_0x2fef8f&&!_0x24d420,'backend':{'method':_0x45c29c[_0x3dd3ea(0x1be)],'path':_0x45c29c[_0x3dd3ea(0x19a)],'payload':_0x45c29c[_0x3dd3ea(0x1a6)]},..._0x5a3ebb?{'verification':_0x5a3ebb}:{},'warnings':[]};return{'ok':!![],'data':_0x334642,'message':_0x2fef8f?_0x24d420?_0x3dd3ea(0x187)+_0x3832d9[_0x3dd3ea(0x1ac)]:'Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20'+_0x3832d9[_0x3dd3ea(0x1ac)]:_0x3dd3ea(0x181)+_0x3832d9[_0x3dd3ea(0x1ac)]};}export const datasetBusinessGroupUpdate={'service':a58_0x47f237(0x199),'command':a58_0x47f237(0x1c1),'description':a58_0x47f237(0x198),'risk':'write','flags':[CODE_FLAG,{'name':'business-group','type':a58_0x47f237(0x188),'required':!![],'description':a58_0x47f237(0x1c0)},{'name':a58_0x47f237(0x18d),'type':a58_0x47f237(0x188),'required':![],'description':a58_0x47f237(0x18f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xd53149){validateInput(readBusinessGroupUpdateInput(_0xd53149));},async 'dryRun'(_0x6f1761){const _0x290126=a58_0x47f237,_0x15ea79=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x6f1761[_0x290126(0x186)],'input':readBusinessGroupUpdateInput(_0x6f1761),'dryRun':!![]});return{'method':_0x15ea79[_0x290126(0x1af)][_0x290126(0x19b)]['method'],'url':_0x15ea79['data'][_0x290126(0x19b)][_0x290126(0x19a)],'body':_0x15ea79[_0x290126(0x1af)][_0x290126(0x19b)][_0x290126(0x1a6)],'description':_0x15ea79['message'],..._0x15ea79['data']};},async 'execute'(_0x5e1bfe){return buildDatasetBusinessGroupUpdateResult({'appCode':_0x5e1bfe['appCode'],'input':readBusinessGroupUpdateInput(_0x5e1bfe),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x58bb0e){const _0x213c93=a58_0x47f237,_0x7d3766=_0x58bb0e[_0x213c93(0x17f)]('expect-business-group');return{'code':trim(_0x58bb0e[_0x213c93(0x17f)](_0x213c93(0x1ac))),'businessGroup':_0x58bb0e[_0x213c93(0x17f)](_0x213c93(0x1c3)),'expectBusinessGroup':_0x7d3766===undefined||_0x7d3766===''?undefined:_0x7d3766};}function validateInput(_0x69fa1f){const _0x530f2c=a58_0x47f237;if(!trim(_0x69fa1f['code']))throw CliErrors[_0x530f2c(0x19f)](_0x530f2c(0x1a0));if(_0x69fa1f[_0x530f2c(0x1c4)]===undefined)throw CliErrors[_0x530f2c(0x19f)](_0x530f2c(0x18a));if(!trim(_0x69fa1f[_0x530f2c(0x1c4)]))throw CliErrors['validation'](_0x530f2c(0x1b6));}function assertBusinessGroupUpdateSupported(_0x231992,_0x9a0a04){const _0x3518d0=a58_0x47f237;if(_0x231992[_0x3518d0(0x1ae)]===_0x3518d0(0x1bc)&&!_0x9a0a04)throw CliErrors[_0x3518d0(0x19f)](_0x3518d0(0x1a1));}function resolveBusinessGroupDataset(_0x342d95,_0x59a86b){const _0x2f0f82=a58_0x47f237,_0x475ae7=asPlainObject(_0x342d95[_0x2f0f82(0x199)]),_0x38e938=asPlainObject(_0x342d95[_0x2f0f82(0x1a9)]),_0x4a66bf=resolveSourceType(_0x342d95,_0x475ae7,_0x38e938),_0x2a3a8b=firstString(_0x342d95[_0x2f0f82(0x192)],_0x342d95[_0x2f0f82(0x1ac)],_0x475ae7[_0x2f0f82(0x1a4)],_0x59a86b)||_0x59a86b;return{'id':firstNumber(_0x342d95['modelId'],_0x342d95['id'],_0x475ae7[_0x2f0f82(0x1a3)])??firstString(_0x342d95[_0x2f0f82(0x197)],_0x342d95['id'],_0x475ae7[_0x2f0f82(0x1a3)])??null,'code':_0x2a3a8b,'name':firstString(_0x342d95[_0x2f0f82(0x1a7)],_0x475ae7['datasetName'],_0x475ae7['name'])||null,'sourceType':_0x4a66bf,'dbTableSelector':_0x4a66bf===_0x2f0f82(0x1bc)?{'dbLinkId':firstNumber(_0x38e938['dbId']),'tableName':firstString(_0x38e938[_0x2f0f82(0x1c5)])||null}:null};}function resolveSourceType(_0x404b4e,_0x6cf56a,_0x3981e9){const _0x350afb=a58_0x47f237,_0x3d19b1=firstString(_0x404b4e[_0x350afb(0x1bd)],_0x404b4e[_0x350afb(0x1ae)],_0x6cf56a[_0x350afb(0x1bd)],_0x6cf56a['sourceType'])?.[_0x350afb(0x1c7)]()[_0x350afb(0x183)]();if(_0x3d19b1===_0x350afb(0x1bc)||_0x3d19b1===_0x350afb(0x19c))return _0x3d19b1;if(Object['keys'](_0x3981e9)[_0x350afb(0x18e)]>0x0)return _0x350afb(0x1bc);throw CliErrors[_0x350afb(0x19f)](_0x350afb(0x18b));}function loadCurrentBusinessGroup(_0x308eda,_0x3612c7){const _0x1092ce=a58_0x47f237,_0x2527d7=readBusinessGroupFromDatasetDetail(_0x308eda,_0x3612c7[_0x1092ce(0x1ae)]);if(_0x2527d7[_0x1092ce(0x1c6)])return normalizeBusinessGroup(_0x2527d7['value']);return'';}function readBusinessGroupFromDatasetDetail(_0x252c1a,_0x36b35c){const _0x554a0f=a58_0x47f237,_0x1f8cb7=asPlainObject(_0x252c1a[_0x554a0f(0x199)]),_0x36b162=firstPresent(_0x252c1a[_0x554a0f(0x1c4)]);if(_0x36b162[_0x554a0f(0x1c6)])return _0x36b162;const _0xa1c2e=firstPresent(_0x1f8cb7[_0x554a0f(0x1c4)]);if(_0xa1c2e[_0x554a0f(0x1c6)])return _0xa1c2e;if(_0x36b35c===_0x554a0f(0x1bc))return{'found':![]};const _0x2e1f51=readBusinessGroupFromExtend(_0x252c1a[_0x554a0f(0x1b8)]);if(_0x2e1f51[_0x554a0f(0x1c6)])return _0x2e1f51;return readBusinessGroupFromExtend(_0x1f8cb7[_0x554a0f(0x1b8)]);}function a58_0x3f63(_0x2cb5f4,_0x463ca1){_0x2cb5f4=_0x2cb5f4-0x17e;const _0x3d8b24=a58_0x3d8b();let _0x3f6394=_0x3d8b24[_0x2cb5f4];return _0x3f6394;}function readBusinessGroupFromExtend(_0x1ff11e){const _0x3f457e=a58_0x47f237;if(_0x1ff11e===undefined||_0x1ff11e===null||_0x1ff11e==='')return{'found':![]};if(typeof _0x1ff11e===_0x3f457e(0x188))try{const _0x664610=JSON[_0x3f457e(0x196)](_0x1ff11e);return readBusinessGroupFromExtend(_0x664610);}catch{return{'found':![]};}const _0x1fe0f3=asPlainObject(_0x1ff11e);if(Object[_0x3f457e(0x190)]['hasOwnProperty']['call'](_0x1fe0f3,_0x3f457e(0x1c4)))return{'found':!![],'value':_0x1fe0f3[_0x3f457e(0x1c4)]};return{'found':![]};}function a58_0x3d8b(){const _0xacd354=['data','POST','isArray','496384SNanMm','number','/smartapi/dblink/updateTableBusinessGroup','metadata','--business-group\x20must\x20not\x20be\x20blank',',\x20actual\x20','extend','Expected\x20','691694rxRBBO','update','DB_TABLE','source','method','db-table','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it','business-group-update','dbLinkId','business-group','businessGroup','tableName','found','trim','unchanged','expectBusinessGroup','str','stringify','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','872928QYzXla','toUpperCase','250610qeJZbF','dbTableSelector','appCode','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','string','kind','--business-group\x20is\x20required','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','isFinite','expect-business-group','length','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','prototype','95450AEMBZq','modelCode','8940582VGzpXY','object','42Dwndhc','parse','modelId','Update\x20business\x20scenario\x20group','dataset','path','backend','METADATA','ungrouped','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','validation','--code\x20is\x20required','Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.','DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.','datasetId','datasetCode','matched','payload','name','3QAQOJd','dbtableConfig','Expectation\x20mismatch\x20at\x20businessGroup','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','code','1475432rVlTkJ','sourceType'];a58_0x3d8b=function(){return _0xacd354;};return a58_0x3d8b();}function firstPresent(..._0x305567){for(const _0x277a09 of _0x305567){if(_0x277a09!==undefined&&_0x277a09!==null)return{'found':!![],'value':_0x277a09};}return{'found':![]};}function assertExpectedBusinessGroup(_0x49e712,_0x55fc69){const _0x273599=a58_0x47f237;if(_0x55fc69===undefined)return;const _0x58f2c2=normalizeBusinessGroupArgument(_0x55fc69);if(_0x49e712!==_0x58f2c2)throw CliErrors['validation'](_0x273599(0x1aa),_0x273599(0x1b9)+JSON[_0x273599(0x180)](_0x58f2c2)+_0x273599(0x1b7)+JSON[_0x273599(0x180)](_0x49e712));}function buildBackendPlan(_0x4da668,_0x5853fe,_0x2e4b8d){const _0x18bfc0=a58_0x47f237;if(_0x5853fe['sourceType']==='DB_TABLE'){if(!_0x5853fe[_0x18bfc0(0x185)]||_0x5853fe[_0x18bfc0(0x185)][_0x18bfc0(0x1c2)]===null||!_0x5853fe[_0x18bfc0(0x185)][_0x18bfc0(0x1c5)])throw CliErrors[_0x18bfc0(0x19f)](_0x18bfc0(0x1a2),_0x18bfc0(0x19e));return{'kind':_0x18bfc0(0x1bf),'method':_0x18bfc0(0x1b0),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0x5853fe[_0x18bfc0(0x185)]['dbLinkId'],'tableName':_0x5853fe['dbTableSelector'][_0x18bfc0(0x1c5)],'businessGroup':_0x2e4b8d}};}return{'kind':_0x18bfc0(0x1b5),'method':'POST','path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x4da668,'datasetCode':_0x5853fe[_0x18bfc0(0x1ac)],'businessGroup':_0x2e4b8d}};}function normalizeBusinessGroup(_0x5eac4c){const _0x5aea50=a58_0x47f237;if(_0x5eac4c===undefined||_0x5eac4c===null)return'';return String(_0x5eac4c)[_0x5aea50(0x1c7)]();}function normalizeBusinessGroupArgument(_0x1cfe68){const _0x2a9fc4=normalizeBusinessGroup(_0x1cfe68);return _0x2a9fc4===UNGROUPED_BUSINESS_GROUP?'':_0x2a9fc4;}function displayBusinessGroup(_0xd61f4){return _0xd61f4||UNGROUPED_BUSINESS_GROUP;}function asPlainObject(_0x11450a){const _0x3bb09e=a58_0x47f237;if(!_0x11450a||typeof _0x11450a!==_0x3bb09e(0x194)||Array[_0x3bb09e(0x1b1)](_0x11450a))return{};return _0x11450a;}function firstString(..._0x1ac682){const _0xa62aa8=a58_0x47f237;for(const _0x2f6ccf of _0x1ac682){if(typeof _0x2f6ccf==='string'&&_0x2f6ccf[_0xa62aa8(0x1c7)]())return _0x2f6ccf['trim']();if(typeof _0x2f6ccf===_0xa62aa8(0x1b3)&&Number[_0xa62aa8(0x18c)](_0x2f6ccf))return String(_0x2f6ccf);}return undefined;}function firstNumber(..._0x19ab21){const _0x1e1ddb=a58_0x47f237;for(const _0x4c81f5 of _0x19ab21){if(typeof _0x4c81f5===_0x1e1ddb(0x1b3)&&Number['isFinite'](_0x4c81f5))return _0x4c81f5;if(typeof _0x4c81f5===_0x1e1ddb(0x188)&&_0x4c81f5[_0x1e1ddb(0x1c7)]()&&Number['isFinite'](Number(_0x4c81f5)))return Number(_0x4c81f5);}return null;}function trim(_0x4667f4){const _0x4558ee=a58_0x47f237;return String(_0x4667f4||'')[_0x4558ee(0x1c7)]();}
1
+ const a65_0x50a72d=a65_0x3431;(function(_0x1bdb11,_0x3820c7){const _0xb98b10=a65_0x3431,_0x318b6b=_0x1bdb11();while(!![]){try{const _0x37d6f2=-parseInt(_0xb98b10(0x131))/0x1+parseInt(_0xb98b10(0x140))/0x2*(parseInt(_0xb98b10(0x153))/0x3)+-parseInt(_0xb98b10(0x16a))/0x4*(-parseInt(_0xb98b10(0x14d))/0x5)+parseInt(_0xb98b10(0x138))/0x6+parseInt(_0xb98b10(0x123))/0x7*(parseInt(_0xb98b10(0x12a))/0x8)+parseInt(_0xb98b10(0x160))/0x9+-parseInt(_0xb98b10(0x124))/0xa*(parseInt(_0xb98b10(0x137))/0xb);if(_0x37d6f2===_0x3820c7)break;else _0x318b6b['push'](_0x318b6b['shift']());}catch(_0x1f6133){_0x318b6b['push'](_0x318b6b['shift']());}}}(a65_0x198f,0x235d1));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';function a65_0x3431(_0x4da6d1,_0x3ae33d){_0x4da6d1=_0x4da6d1-0x123;const _0x198fd9=a65_0x198f();let _0x343114=_0x198fd9[_0x4da6d1];return _0x343114;}const DB_TABLE_BACKEND_PATH=a65_0x50a72d(0x136),METADATA_BACKEND_PATH=a65_0x50a72d(0x167),UNGROUPED_BUSINESS_GROUP=a65_0x50a72d(0x142);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x34ea82,input:_0xba0ab5,dryRun:_0x11a975}){const _0x2dd7f1=a65_0x50a72d;validateInput(_0xba0ab5);const _0xb83f16=normalizeBusinessGroupArgument(_0xba0ab5[_0x2dd7f1(0x147)]),_0x11434c=await getDatasetDetail(_0xba0ab5[_0x2dd7f1(0x148)]),_0x44d751=resolveBusinessGroupDataset(_0x11434c,_0xba0ab5[_0x2dd7f1(0x148)]);assertBusinessGroupUpdateSupported(_0x44d751,_0xb83f16);const _0x24b546=loadCurrentBusinessGroup(_0x11434c,_0x44d751);assertExpectedBusinessGroup(_0x24b546,_0xba0ab5['expectBusinessGroup']);const _0x1e7646=buildBackendPlan(_0x34ea82,_0x44d751,_0xb83f16),_0x4ba6f0=_0x24b546!==_0xb83f16;let _0x51542f;if(_0x4ba6f0&&!_0x11a975){_0x1e7646[_0x2dd7f1(0x15f)]===_0x2dd7f1(0x165)?await updateDbTableBusinessGroup(_0x1e7646[_0x2dd7f1(0x127)]):await updateErBusinessGroup(_0x1e7646[_0x2dd7f1(0x127)]);const _0x90bcdf=await getDatasetDetail(_0x44d751[_0x2dd7f1(0x148)]),_0x2f8b98=resolveBusinessGroupDataset(_0x90bcdf,_0x44d751['code']),_0x25a6f3=loadCurrentBusinessGroup(_0x90bcdf,_0x2f8b98);if(_0x25a6f3!==_0xb83f16)throw CliErrors['apiError'](_0x2dd7f1(0x132),_0x2dd7f1(0x16b)+JSON[_0x2dd7f1(0x139)](displayBusinessGroup(_0xb83f16))+_0x2dd7f1(0x143)+JSON[_0x2dd7f1(0x139)](displayBusinessGroup(_0x25a6f3))+'.');_0x51542f={'verified':!![],'status':_0x2dd7f1(0x15b),'afterReadback':{'businessGroup':displayBusinessGroup(_0x25a6f3)}};}else!_0x4ba6f0&&(_0x51542f={'verified':!![],'status':_0x2dd7f1(0x151),'afterReadback':{'businessGroup':displayBusinessGroup(_0x24b546)}});const _0x131902={'operation':_0x2dd7f1(0x130),'appCode':_0x34ea82,'selector':{'code':_0x44d751[_0x2dd7f1(0x148)]},'dataset':{'id':_0x44d751['id'],'code':_0x44d751[_0x2dd7f1(0x148)],'name':_0x44d751[_0x2dd7f1(0x15e)],'sourceType':_0x44d751[_0x2dd7f1(0x156)]},'before':{'businessGroup':displayBusinessGroup(_0x24b546)},'after':{'businessGroup':displayBusinessGroup(_0xb83f16)},'changed':_0x4ba6f0,'dryRun':_0x11a975,'submitted':_0x4ba6f0&&!_0x11a975,'backend':{'method':_0x1e7646['method'],'path':_0x1e7646[_0x2dd7f1(0x13a)],'payload':_0x1e7646[_0x2dd7f1(0x127)]},..._0x51542f?{'verification':_0x51542f}:{},'warnings':[]};return{'ok':!![],'data':_0x131902,'message':_0x4ba6f0?_0x11a975?_0x2dd7f1(0x12d)+_0x44d751['code']:_0x2dd7f1(0x13f)+_0x44d751['code']:_0x2dd7f1(0x12c)+_0x44d751[_0x2dd7f1(0x148)]};}export const datasetBusinessGroupUpdate={'service':a65_0x50a72d(0x162),'command':a65_0x50a72d(0x14c),'description':a65_0x50a72d(0x13d),'risk':a65_0x50a72d(0x145),'flags':[CODE_FLAG,{'name':'business-group','type':a65_0x50a72d(0x16e),'required':!![],'description':'Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20<domain>---<scenario>\x20when\x20needed;\x20METADATA\x20accepts\x20ungrouped\x20to\x20clear\x20it'},{'name':a65_0x50a72d(0x129),'type':a65_0x50a72d(0x16e),'required':![],'description':a65_0x50a72d(0x14a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x278b99){validateInput(readBusinessGroupUpdateInput(_0x278b99));},async 'dryRun'(_0x42cfa0){const _0x3d3dbd=a65_0x50a72d,_0x1f8169=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x42cfa0['appCode'],'input':readBusinessGroupUpdateInput(_0x42cfa0),'dryRun':!![]});return{'method':_0x1f8169[_0x3d3dbd(0x168)][_0x3d3dbd(0x163)][_0x3d3dbd(0x13e)],'url':_0x1f8169[_0x3d3dbd(0x168)]['backend'][_0x3d3dbd(0x13a)],'body':_0x1f8169[_0x3d3dbd(0x168)][_0x3d3dbd(0x163)]['payload'],'description':_0x1f8169[_0x3d3dbd(0x144)],..._0x1f8169[_0x3d3dbd(0x168)]};},async 'execute'(_0x3d06ac){const _0x34b9b2=a65_0x50a72d;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x3d06ac[_0x34b9b2(0x14b)],'input':readBusinessGroupUpdateInput(_0x3d06ac),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x168a64){const _0x3e23c4=a65_0x50a72d,_0xf106e3=_0x168a64[_0x3e23c4(0x14e)](_0x3e23c4(0x129));return{'code':trim(_0x168a64['str'](_0x3e23c4(0x148))),'businessGroup':_0x168a64['str'](_0x3e23c4(0x12e)),'expectBusinessGroup':_0xf106e3===undefined||_0xf106e3===''?undefined:_0xf106e3};}function validateInput(_0x28fbaa){const _0x1bce87=a65_0x50a72d;if(!trim(_0x28fbaa[_0x1bce87(0x148)]))throw CliErrors[_0x1bce87(0x16c)](_0x1bce87(0x159));if(_0x28fbaa[_0x1bce87(0x147)]===undefined)throw CliErrors['validation']('--business-group\x20is\x20required');if(!trim(_0x28fbaa[_0x1bce87(0x147)]))throw CliErrors[_0x1bce87(0x16c)](_0x1bce87(0x141));}function assertBusinessGroupUpdateSupported(_0x26f233,_0x24c0ab){const _0x41b14c=a65_0x50a72d;if(_0x26f233[_0x41b14c(0x156)]==='DB_TABLE'&&!_0x24c0ab)throw CliErrors[_0x41b14c(0x16c)](_0x41b14c(0x169));}function resolveBusinessGroupDataset(_0x32ce4c,_0x156686){const _0x1280de=a65_0x50a72d,_0x180c10=asPlainObject(_0x32ce4c['dataset']),_0x13c63e=asPlainObject(_0x32ce4c['dbtableConfig']),_0x2da4f8=resolveSourceType(_0x32ce4c,_0x180c10,_0x13c63e),_0x4bba83=firstString(_0x32ce4c[_0x1280de(0x13c)],_0x32ce4c['code'],_0x180c10[_0x1280de(0x134)],_0x156686)||_0x156686;return{'id':firstNumber(_0x32ce4c['modelId'],_0x32ce4c['id'],_0x180c10['datasetId'])??firstString(_0x32ce4c[_0x1280de(0x13b)],_0x32ce4c['id'],_0x180c10[_0x1280de(0x128)])??null,'code':_0x4bba83,'name':firstString(_0x32ce4c[_0x1280de(0x15e)],_0x180c10[_0x1280de(0x149)],_0x180c10['name'])||null,'sourceType':_0x2da4f8,'dbTableSelector':_0x2da4f8===_0x1280de(0x15c)?{'dbLinkId':firstNumber(_0x13c63e[_0x1280de(0x126)]),'tableName':firstString(_0x13c63e[_0x1280de(0x125)])||null}:null};}function resolveSourceType(_0x32b46c,_0x1d6ca3,_0x4391b3){const _0xb29804=a65_0x50a72d,_0x58b06a=firstString(_0x32b46c[_0xb29804(0x152)],_0x32b46c[_0xb29804(0x156)],_0x1d6ca3[_0xb29804(0x152)],_0x1d6ca3[_0xb29804(0x156)])?.[_0xb29804(0x133)]()[_0xb29804(0x158)]();if(_0x58b06a===_0xb29804(0x15c)||_0x58b06a===_0xb29804(0x157))return _0x58b06a;if(Object['keys'](_0x4391b3)[_0xb29804(0x135)]>0x0)return _0xb29804(0x15c);throw CliErrors[_0xb29804(0x16c)](_0xb29804(0x12f));}function loadCurrentBusinessGroup(_0x53221b,_0x1a6ec4){const _0x5a0ad2=a65_0x50a72d,_0x3d7f18=readBusinessGroupFromDatasetDetail(_0x53221b,_0x1a6ec4['sourceType']);if(_0x3d7f18['found'])return normalizeBusinessGroup(_0x3d7f18[_0x5a0ad2(0x150)]);return'';}function readBusinessGroupFromDatasetDetail(_0x38a76e,_0x1bf93c){const _0x568dac=a65_0x50a72d,_0x2688f5=asPlainObject(_0x38a76e[_0x568dac(0x162)]),_0xb33556=firstPresent(_0x38a76e[_0x568dac(0x147)]);if(_0xb33556[_0x568dac(0x166)])return _0xb33556;const _0x44ae1a=firstPresent(_0x2688f5[_0x568dac(0x147)]);if(_0x44ae1a[_0x568dac(0x166)])return _0x44ae1a;if(_0x1bf93c===_0x568dac(0x15c))return{'found':![]};const _0x5c3046=readBusinessGroupFromExtend(_0x38a76e[_0x568dac(0x16d)]);if(_0x5c3046[_0x568dac(0x166)])return _0x5c3046;return readBusinessGroupFromExtend(_0x2688f5[_0x568dac(0x16d)]);}function a65_0x198f(){const _0x23df6b=['18196rDMeWT','Expected\x20','validation','extend','string','140TbOEvM','30dCIjot','tableName','dbId','payload','datasetId','expect-business-group','109232eNVtiT','Run\x20dataset\x20detail\x20and\x20complete\x20database\x20analysis\x20before\x20updating\x20the\x20business\x20group.','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','business-group','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','update','28975NrOhFm','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','trim','datasetCode','length','/smartapi/dblink/updateTableBusinessGroup','1905816zmnjFK','768360SuXUdF','stringify','path','modelId','modelCode','Update\x20business\x20scenario\x20group','method','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','6JvRHFz','--business-group\x20must\x20not\x20be\x20blank','ungrouped',',\x20actual\x20','message','write','isArray','businessGroup','code','datasetName','Expected\x20current\x20business\x20scenario\x20group;\x20use\x20ungrouped\x20to\x20expect\x20no\x20group;\x20mismatch\x20aborts\x20without\x20writing','appCode','business-group-update','80jCcnOq','str','dbTableSelector','value','unchanged','source','128073RZMuyo','dbLinkId','POST','sourceType','METADATA','toUpperCase','--code\x20is\x20required','DB_TABLE\x20dataset\x20requires\x20dbtableConfig.dbId\x20and\x20tableName.','matched','DB_TABLE','metadata','name','kind','824355OnzRra','number','dataset','backend','isFinite','db-table','found','/smartapi/question/er-config/business-group/edit','data','Clearing\x20business\x20scenario\x20groups\x20is\x20not\x20supported\x20for\x20DB_TABLE\x20datasets.'];a65_0x198f=function(){return _0x23df6b;};return a65_0x198f();}function readBusinessGroupFromExtend(_0xd29e6e){const _0x37e250=a65_0x50a72d;if(_0xd29e6e===undefined||_0xd29e6e===null||_0xd29e6e==='')return{'found':![]};if(typeof _0xd29e6e===_0x37e250(0x16e))try{const _0x48626c=JSON['parse'](_0xd29e6e);return readBusinessGroupFromExtend(_0x48626c);}catch{return{'found':![]};}const _0x3bbb90=asPlainObject(_0xd29e6e);if(Object['prototype']['hasOwnProperty']['call'](_0x3bbb90,_0x37e250(0x147)))return{'found':!![],'value':_0x3bbb90[_0x37e250(0x147)]};return{'found':![]};}function firstPresent(..._0x20de2c){for(const _0x451a8d of _0x20de2c){if(_0x451a8d!==undefined&&_0x451a8d!==null)return{'found':!![],'value':_0x451a8d};}return{'found':![]};}function assertExpectedBusinessGroup(_0x2c353f,_0x5da469){const _0x5d5d78=a65_0x50a72d;if(_0x5da469===undefined)return;const _0x1dd8d3=normalizeBusinessGroupArgument(_0x5da469);if(_0x2c353f!==_0x1dd8d3)throw CliErrors[_0x5d5d78(0x16c)]('Expectation\x20mismatch\x20at\x20businessGroup',_0x5d5d78(0x16b)+JSON['stringify'](_0x1dd8d3)+',\x20actual\x20'+JSON[_0x5d5d78(0x139)](_0x2c353f));}function buildBackendPlan(_0x518fba,_0x271f3d,_0x3e5de2){const _0x2b08a9=a65_0x50a72d;if(_0x271f3d['sourceType']===_0x2b08a9(0x15c)){if(!_0x271f3d[_0x2b08a9(0x14f)]||_0x271f3d['dbTableSelector'][_0x2b08a9(0x154)]===null||!_0x271f3d[_0x2b08a9(0x14f)][_0x2b08a9(0x125)])throw CliErrors[_0x2b08a9(0x16c)](_0x2b08a9(0x15a),_0x2b08a9(0x12b));return{'kind':_0x2b08a9(0x165),'method':_0x2b08a9(0x155),'path':DB_TABLE_BACKEND_PATH,'payload':{'dbLinkId':_0x271f3d[_0x2b08a9(0x14f)][_0x2b08a9(0x154)],'tableName':_0x271f3d[_0x2b08a9(0x14f)][_0x2b08a9(0x125)],'businessGroup':_0x3e5de2}};}return{'kind':_0x2b08a9(0x15d),'method':'POST','path':METADATA_BACKEND_PATH,'payload':{'appCode':_0x518fba,'datasetCode':_0x271f3d[_0x2b08a9(0x148)],'businessGroup':_0x3e5de2}};}function normalizeBusinessGroup(_0x3fe831){const _0x1784e3=a65_0x50a72d;if(_0x3fe831===undefined||_0x3fe831===null)return'';return String(_0x3fe831)[_0x1784e3(0x133)]();}function normalizeBusinessGroupArgument(_0x22a3b4){const _0x163320=normalizeBusinessGroup(_0x22a3b4);return _0x163320===UNGROUPED_BUSINESS_GROUP?'':_0x163320;}function displayBusinessGroup(_0x1da598){return _0x1da598||UNGROUPED_BUSINESS_GROUP;}function asPlainObject(_0x452cd1){const _0x5cfc70=a65_0x50a72d;if(!_0x452cd1||typeof _0x452cd1!=='object'||Array[_0x5cfc70(0x146)](_0x452cd1))return{};return _0x452cd1;}function firstString(..._0x3793db){const _0x320235=a65_0x50a72d;for(const _0x573961 of _0x3793db){if(typeof _0x573961==='string'&&_0x573961[_0x320235(0x133)]())return _0x573961[_0x320235(0x133)]();if(typeof _0x573961==='number'&&Number[_0x320235(0x164)](_0x573961))return String(_0x573961);}return undefined;}function firstNumber(..._0xbd2b70){const _0x401f9a=a65_0x50a72d;for(const _0x141aaf of _0xbd2b70){if(typeof _0x141aaf===_0x401f9a(0x161)&&Number[_0x401f9a(0x164)](_0x141aaf))return _0x141aaf;if(typeof _0x141aaf==='string'&&_0x141aaf[_0x401f9a(0x133)]()&&Number['isFinite'](Number(_0x141aaf)))return Number(_0x141aaf);}return null;}function trim(_0x2de626){const _0x2a9fda=a65_0x50a72d;return String(_0x2de626||'')[_0x2a9fda(0x133)]();}
@@ -1 +1 @@
1
- function a59_0x2694(_0x9056f6,_0x1a4430){_0x9056f6=_0x9056f6-0x160;const _0xe036d3=a59_0xe036();let _0x2694e1=_0xe036d3[_0x9056f6];return _0x2694e1;}const a59_0x535b78=a59_0x2694;(function(_0x1312a7,_0x4e3196){const _0x3f8f07=a59_0x2694,_0x45b8dc=_0x1312a7();while(!![]){try{const _0x511c1d=-parseInt(_0x3f8f07(0x160))/0x1+parseInt(_0x3f8f07(0x172))/0x2*(parseInt(_0x3f8f07(0x16d))/0x3)+-parseInt(_0x3f8f07(0x174))/0x4*(parseInt(_0x3f8f07(0x161))/0x5)+-parseInt(_0x3f8f07(0x169))/0x6*(-parseInt(_0x3f8f07(0x16a))/0x7)+parseInt(_0x3f8f07(0x16b))/0x8+-parseInt(_0x3f8f07(0x173))/0x9+-parseInt(_0x3f8f07(0x16c))/0xa*(-parseInt(_0x3f8f07(0x175))/0xb);if(_0x511c1d===_0x4e3196)break;else _0x45b8dc['push'](_0x45b8dc['shift']());}catch(_0x58d8d2){_0x45b8dc['push'](_0x45b8dc['shift']());}}}(a59_0xe036,0x43c93));function a59_0xe036(){const _0xb03bbf=['237Lxbvif','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','business-groups','Found\x20','groups','8494iCcWsW','1437642YeHZmF','4mHGIto','121veEvPY','appCode','277997pCoRYp','1583830pingRK','dbid','length','map','num','businessGroup','\x20business\x20group(s)\x20for\x20database\x20connection\x20','List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','2190MSCMmP','8127jlyeLT','1942664dORMuW','27310vkwUUT'];a59_0xe036=function(){return _0xb03bbf;};return a59_0xe036();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getErBusinessGroupSummary}from'../../core/api-client.js';export const datasetBusinessGroups={'service':'dataset','command':a59_0x535b78(0x16f),'description':a59_0x535b78(0x168),'risk':'read','flags':[{'name':a59_0x535b78(0x162),'type':'number','required':!![],'description':a59_0x535b78(0x16e)},APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1a07ca){const _0x283bc2=a59_0x535b78,_0x139e43=_0x1a07ca[_0x283bc2(0x165)](_0x283bc2(0x162)),_0x21790f=await getErBusinessGroupSummary(_0x1a07ca[_0x283bc2(0x176)],_0x139e43),_0x3d24a7=_0x21790f[_0x283bc2(0x171)][_0x283bc2(0x164)](_0x59602a=>({..._0x59602a,'businessGroup':_0x59602a[_0x283bc2(0x166)]['trim']()||'ungrouped'}));return{'ok':!![],'data':{..._0x21790f,'groups':_0x3d24a7,'scope':'DB_TABLE'},'message':_0x283bc2(0x170)+_0x3d24a7[_0x283bc2(0x163)]+_0x283bc2(0x167)+_0x139e43};}};
1
+ const a66_0x4a58dc=a66_0x3079;function a66_0x3079(_0x16dbe5,_0xa626a7){_0x16dbe5=_0x16dbe5-0x1ab;const _0x20c70b=a66_0x20c7();let _0x307991=_0x20c70b[_0x16dbe5];return _0x307991;}(function(_0x358589,_0x392449){const _0x18d042=a66_0x3079,_0x538f7c=_0x358589();while(!![]){try{const _0x16920f=parseInt(_0x18d042(0x1ab))/0x1*(-parseInt(_0x18d042(0x1b5))/0x2)+-parseInt(_0x18d042(0x1bd))/0x3+parseInt(_0x18d042(0x1b0))/0x4*(parseInt(_0x18d042(0x1be))/0x5)+parseInt(_0x18d042(0x1b3))/0x6*(-parseInt(_0x18d042(0x1af))/0x7)+-parseInt(_0x18d042(0x1c1))/0x8+-parseInt(_0x18d042(0x1b6))/0x9*(-parseInt(_0x18d042(0x1c3))/0xa)+parseInt(_0x18d042(0x1b9))/0xb;if(_0x16920f===_0x392449)break;else _0x538f7c['push'](_0x538f7c['shift']());}catch(_0x5a083b){_0x538f7c['push'](_0x538f7c['shift']());}}}(a66_0x20c7,0xe370e));function a66_0x20c7(){const _0x2b3783=['dbid','\x20business\x20group(s)\x20for\x20database\x20connection\x20','3235902bsmObJ','65MqiBIg','map','dataset','6377360UdqPPB','groups','5210RKkjMH','Found\x20','346EvPbXb','business-groups','trim','ungrouped','14jkpwKM','326524JYsTaq','num','List\x20DB_TABLE\x20dataset\x20business\x20groups\x20for\x20a\x20database\x20connection;\x20does\x20not\x20include\x20METADATA','5068572eeTiVQ','length','850SeotVQ','792zkoZbB','appCode','businessGroup','38906175GPGvrr','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'];a66_0x20c7=function(){return _0x2b3783;};return a66_0x20c7();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getErBusinessGroupSummary}from'../../core/api-client.js';export const datasetBusinessGroups={'service':a66_0x4a58dc(0x1c0),'command':a66_0x4a58dc(0x1ac),'description':a66_0x4a58dc(0x1b2),'risk':'read','flags':[{'name':a66_0x4a58dc(0x1bb),'type':'number','required':!![],'description':a66_0x4a58dc(0x1ba)},APPCODE_FLAG_OPTIONAL],async 'execute'(_0x434339){const _0x41b4e9=a66_0x4a58dc,_0x14f2a0=_0x434339[_0x41b4e9(0x1b1)](_0x41b4e9(0x1bb)),_0x5124e1=await getErBusinessGroupSummary(_0x434339[_0x41b4e9(0x1b7)],_0x14f2a0),_0x259ee7=_0x5124e1[_0x41b4e9(0x1c2)][_0x41b4e9(0x1bf)](_0x57f50f=>({..._0x57f50f,'businessGroup':_0x57f50f[_0x41b4e9(0x1b8)][_0x41b4e9(0x1ad)]()||_0x41b4e9(0x1ae)}));return{'ok':!![],'data':{..._0x5124e1,'groups':_0x259ee7,'scope':'DB_TABLE'},'message':_0x41b4e9(0x1c4)+_0x259ee7[_0x41b4e9(0x1b4)]+_0x41b4e9(0x1bc)+_0x14f2a0};}};
@@ -1 +1 @@
1
- const a60_0x4cbc48=a60_0x594f;(function(_0x1f456b,_0xeb55dc){const _0x302da6=a60_0x594f,_0x376b0a=_0x1f456b();while(!![]){try{const _0x573db7=-parseInt(_0x302da6(0xd3))/0x1*(parseInt(_0x302da6(0xc6))/0x2)+parseInt(_0x302da6(0xe6))/0x3*(parseInt(_0x302da6(0xc3))/0x4)+-parseInt(_0x302da6(0xca))/0x5+parseInt(_0x302da6(0xdf))/0x6*(-parseInt(_0x302da6(0xd6))/0x7)+parseInt(_0x302da6(0xc7))/0x8+parseInt(_0x302da6(0xce))/0x9*(parseInt(_0x302da6(0xd1))/0xa)+parseInt(_0x302da6(0xd7))/0xb;if(_0x573db7===_0xeb55dc)break;else _0x376b0a['push'](_0x376b0a['shift']());}catch(_0x1c81de){_0x376b0a['push'](_0x376b0a['shift']());}}}(a60_0x1dcb,0x58f2b));import{CliErrors}from'../../errors.js';function a60_0x1dcb(){const _0x2c08ff=['To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20','tableName','validation','\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20','dbtable','dataset','18ZpUohy','datasetName','\x20is\x20','sourceType','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','SQL\x20schema\x20validation','filter','14079mtHnJK','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','580YYpJXp','trim','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.','65612XRFMiI','3642992QsxCPb','join','dbId','2010435ryLRRT','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','UNKNOWN','dbtableConfig','18iydKeH','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','modelCode','993110JEagUW','unknown','9mHuvjJ','object','name','1310491ZyXBZI','3177130OGdjLB','getOne'];a60_0x1dcb=function(){return _0x2c08ff;};return a60_0x1dcb();}export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':'lovrabet','filter':a60_0x4cbc48(0xe3),'getOne':a60_0x4cbc48(0xcb)};export const RUNTIME_DATA_ACCESS_SUMMARY=a60_0x4cbc48(0xe7);function valueToString(_0x1fbcb4){const _0x38e6ae=a60_0x4cbc48;return _0x1fbcb4==null?'':String(_0x1fbcb4)[_0x38e6ae(0xc4)]();}function getDatasetCode(_0x5837ff){const _0x388435=a60_0x4cbc48;return valueToString(_0x5837ff['code']??_0x5837ff[_0x388435(0xd0)]??_0x5837ff[_0x388435(0xde)]?.['datasetCode']);}function getDatasetName(_0x1348d2){const _0x13e050=a60_0x4cbc48;return valueToString(_0x1348d2[_0x13e050(0xd5)]??_0x1348d2['dataset']?.[_0x13e050(0xe0)])||_0x13e050(0xd2);}function getDatasetSource(_0x482480){const _0x30b105=a60_0x4cbc48;return valueToString(_0x482480['source']??_0x482480[_0x30b105(0xde)]?.[_0x30b105(0xe2)])['toUpperCase']();}function getDbtableConfig(_0x5b936d){const _0xd8da72=a60_0x4cbc48,_0x371856=_0x5b936d[_0xd8da72(0xcd)]??_0x5b936d[_0xd8da72(0xdd)];return _0x371856&&typeof _0x371856===_0xd8da72(0xd4)?_0x371856:{};}export function isDbTableBackedDataset(_0x5bd609){const _0x14f646=a60_0x4cbc48,_0x53cd33=getDatasetSource(_0x5bd609);if(_0x53cd33==='METADATA')return![];const _0x5c0029=getDbtableConfig(_0x5bd609),_0x496ad6=_0x5c0029[_0x14f646(0xc9)]??_0x5c0029['id'],_0x4dfe55=valueToString(_0x5c0029['tableName']??_0x5bd609[_0x14f646(0xda)]??_0x5bd609[_0x14f646(0xde)]?.[_0x14f646(0xda)]);return _0x496ad6!==undefined&&_0x496ad6!==null&&_0x4dfe55['length']>0x0;}export function filterDbTableBackedDatasets(_0x569db1){const _0x1c3dca=a60_0x4cbc48;return _0x569db1[_0x1c3dca(0xe5)](_0x4b52d8=>isDbTableBackedDataset(_0x4b52d8));}export function buildDbTableBackedRequirementMessage(_0x1ebc22,_0x198ab6=a60_0x4cbc48(0xe4)){const _0x5794e7=a60_0x4cbc48,_0x566e57=getDatasetSource(_0x1ebc22)||_0x5794e7(0xcc),_0x19aaf7=getDatasetName(_0x1ebc22),_0x3d4c90=getDatasetCode(_0x1ebc22),_0x5d67f5=_0x3d4c90?'\x20('+_0x3d4c90+')':'';return['The\x20current\x20dataset\x20\x22'+_0x19aaf7+'\x22'+_0x5d67f5+_0x5794e7(0xe1)+_0x566e57+_0x5794e7(0xdc)+_0x198ab6+'.',_0x5794e7(0xc5),_0x5794e7(0xcf),_0x5794e7(0xd9)+RUNTIME_DATA_ACCESS_COMMANDS['filter']+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0x5794e7(0xd8)]+'.'][_0x5794e7(0xc8)]('\x20');}function a60_0x594f(_0x44c7c5,_0xf4af15){_0x44c7c5=_0x44c7c5-0xc3;const _0x1dcb43=a60_0x1dcb();let _0x594ff5=_0x1dcb43[_0x44c7c5];return _0x594ff5;}export function assertDatasetIsDbTableBacked(_0x225850,_0x3b8bd8){const _0x40d6ba=a60_0x4cbc48;if(!isDbTableBackedDataset(_0x225850))throw CliErrors[_0x40d6ba(0xdb)](buildDbTableBackedRequirementMessage(_0x225850,_0x3b8bd8));}
1
+ function a67_0x4644(_0x439f83,_0x51bb62){_0x439f83=_0x439f83-0x134;const _0x335802=a67_0x3358();let _0x4644ae=_0x335802[_0x439f83];return _0x4644ae;}const a67_0x1d9c1e=a67_0x4644;(function(_0x516cdc,_0x13e80c){const _0x393deb=a67_0x4644,_0x12190b=_0x516cdc();while(!![]){try{const _0x70809a=parseInt(_0x393deb(0x13f))/0x1+-parseInt(_0x393deb(0x13c))/0x2+-parseInt(_0x393deb(0x13b))/0x3+parseInt(_0x393deb(0x158))/0x4+-parseInt(_0x393deb(0x147))/0x5+parseInt(_0x393deb(0x143))/0x6+-parseInt(_0x393deb(0x14b))/0x7*(-parseInt(_0x393deb(0x14a))/0x8);if(_0x70809a===_0x13e80c)break;else _0x12190b['push'](_0x12190b['shift']());}catch(_0x2a564a){_0x12190b['push'](_0x12190b['shift']());}}}(a67_0x3358,0xdf7e3));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a67_0x1d9c1e(0x13d),'filter':a67_0x1d9c1e(0x141),'getOne':a67_0x1d9c1e(0x150)};export const RUNTIME_DATA_ACCESS_SUMMARY=a67_0x1d9c1e(0x134);function valueToString(_0xb28b22){const _0x262c6c=a67_0x1d9c1e;return _0xb28b22==null?'':String(_0xb28b22)[_0x262c6c(0x136)]();}function getDatasetCode(_0x4bc4dc){const _0x5d125f=a67_0x1d9c1e;return valueToString(_0x4bc4dc[_0x5d125f(0x139)]??_0x4bc4dc[_0x5d125f(0x142)]??_0x4bc4dc[_0x5d125f(0x149)]?.['datasetCode']);}function getDatasetName(_0x33c773){const _0x5994de=a67_0x1d9c1e;return valueToString(_0x33c773[_0x5994de(0x138)]??_0x33c773['dataset']?.['datasetName'])||_0x5994de(0x14e);}function getDatasetSource(_0x5b7023){const _0x215834=a67_0x1d9c1e;return valueToString(_0x5b7023[_0x215834(0x152)]??_0x5b7023['dataset']?.['sourceType'])[_0x215834(0x156)]();}function getDbtableConfig(_0xe31c30){const _0x3499cc=a67_0x1d9c1e,_0x34d76a=_0xe31c30[_0x3499cc(0x148)]??_0xe31c30[_0x3499cc(0x153)];return _0x34d76a&&typeof _0x34d76a===_0x3499cc(0x14c)?_0x34d76a:{};}export function isDbTableBackedDataset(_0x25cffd){const _0x6b8994=a67_0x1d9c1e,_0x3e902b=getDatasetSource(_0x25cffd);if(_0x3e902b===_0x6b8994(0x144))return![];const _0x198588=getDbtableConfig(_0x25cffd),_0x4225f1=_0x198588[_0x6b8994(0x137)]??_0x198588['id'],_0x3bda98=valueToString(_0x198588[_0x6b8994(0x13a)]??_0x25cffd[_0x6b8994(0x13a)]??_0x25cffd[_0x6b8994(0x149)]?.[_0x6b8994(0x13a)]);return _0x4225f1!==undefined&&_0x4225f1!==null&&_0x3bda98[_0x6b8994(0x145)]>0x0;}export function filterDbTableBackedDatasets(_0x805b77){const _0x38ec4e=a67_0x1d9c1e;return _0x805b77[_0x38ec4e(0x157)](_0x338666=>isDbTableBackedDataset(_0x338666));}export function buildDbTableBackedRequirementMessage(_0x2b629a,_0xd979b4='SQL\x20schema\x20validation'){const _0x2023c2=a67_0x1d9c1e,_0x23dafb=getDatasetSource(_0x2b629a)||_0x2023c2(0x151),_0x3161c6=getDatasetName(_0x2b629a),_0x211822=getDatasetCode(_0x2b629a),_0xe6b001=_0x211822?'\x20('+_0x211822+')':'';return[_0x2023c2(0x14f)+_0x3161c6+'\x22'+_0xe6b001+_0x2023c2(0x13e)+_0x23dafb+_0x2023c2(0x140)+_0xd979b4+'.',_0x2023c2(0x135),_0x2023c2(0x14d),_0x2023c2(0x146)+RUNTIME_DATA_ACCESS_COMMANDS['filter']+';\x20'+RUNTIME_DATA_ACCESS_COMMANDS[_0x2023c2(0x155)]+'.']['join']('\x20');}function a67_0x3358(){const _0x37d926=['5110260NASalG','dbtableConfig','dataset','17616KikRUe','11550CGdNSW','object','Upgrade\x20or\x20migrate\x20this\x20dataset\x20to\x20a\x20DB_TABLE\x20dataset,\x20then\x20continue\x20with\x20the\x20new\x20dataset\x20code.','unknown','The\x20current\x20dataset\x20\x22','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','UNKNOWN','source','dbtable','validation','getOne','toUpperCase','filter','515880nNPVOc','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','Reason:\x20schema\x20introspection\x20and\x20custom\x20SQL\x20require\x20source=DB_TABLE,\x20dbtableConfig.dbId,\x20dbtableConfig.tableName,\x20and\x20a\x20database\x20connection\x20context.','trim','dbId','name','code','tableName','3076914gLBZCJ','3488980jNKEWq','lovrabet','\x20is\x20','926826DdDjxX','\x20and\x20has\x20no\x20DB_TABLE\x20data-source\x20context\x20for\x20','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','modelCode','111066llslHF','METADATA','length','To\x20inspect\x20real\x20runtime\x20rows,\x20switch\x20to\x20lovrabet\x20CLI:\x20'];a67_0x3358=function(){return _0x37d926;};return a67_0x3358();}export function assertDatasetIsDbTableBacked(_0x17231c,_0x4767ef){const _0x232e25=a67_0x1d9c1e;if(!isDbTableBackedDataset(_0x17231c))throw CliErrors[_0x232e25(0x154)](buildDbTableBackedRequirementMessage(_0x17231c,_0x4767ef));}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const datasetCrossRelationCreate: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a68_0xae7aa3=a68_0x270c;(function(_0x405c99,_0x4f2d16){const _0x1817d7=a68_0x270c,_0x20e991=_0x405c99();while(!![]){try{const _0x1a9477=parseInt(_0x1817d7(0x1fd))/0x1+parseInt(_0x1817d7(0x1fe))/0x2+-parseInt(_0x1817d7(0x1f8))/0x3+parseInt(_0x1817d7(0x1f1))/0x4*(-parseInt(_0x1817d7(0x1f9))/0x5)+-parseInt(_0x1817d7(0x1f2))/0x6*(parseInt(_0x1817d7(0x1fb))/0x7)+-parseInt(_0x1817d7(0x1f7))/0x8*(parseInt(_0x1817d7(0x1f5))/0x9)+parseInt(_0x1817d7(0x1fa))/0xa*(parseInt(_0x1817d7(0x1f4))/0xb);if(_0x1a9477===_0x4f2d16)break;else _0x20e991['push'](_0x20e991['shift']());}catch(_0x1bc6c6){_0x20e991['push'](_0x20e991['shift']());}}}(a68_0x9691,0x9582c));import{createCrossDbRelation}from'../../core/api-client.js';function a68_0x9691(){const _0x3fb3bd=['539810cjXgeF','4385780VjFRcP','1835634dOycfX','cross-relation-create','22BcAbww','117NWfRFS','create','195736DCbcDK','3180843vIdYAB','5KLnffQ','11794710sYacFc','14CDquGD','Create\x20a\x20logical\x20relation\x20between\x20DB_TABLE\x20datasets\x20in\x20different\x20database\x20connections','1070224lGcEwJ'];a68_0x9691=function(){return _0x3fb3bd;};return a68_0x9691();}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';function a68_0x270c(_0x140c9b,_0x237214){_0x140c9b=_0x140c9b-0x1f1;const _0x9691b0=a68_0x9691();let _0x270cd2=_0x9691b0[_0x140c9b];return _0x270cd2;}import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationCreate={'service':'dataset','command':a68_0xae7aa3(0x1f3),'description':a68_0xae7aa3(0x1fc),'risk':'write','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 _0x50b994=>validateCrossRelation(_0x50b994,a68_0xae7aa3(0x1f6)),'dryRun':_0x57900e=>previewCrossRelation(_0x57900e,a68_0xae7aa3(0x1f6)),'execute':_0x3da4c8=>executeCrossRelation(_0x3da4c8,a68_0xae7aa3(0x1f6),createCrossDbRelation)};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const datasetCrossRelationDelete: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a69_0x1d7717=a69_0x566e;(function(_0x2a0dc3,_0x217e24){const _0x535786=a69_0x566e,_0x3f8f42=_0x2a0dc3();while(!![]){try{const _0x4d70e2=-parseInt(_0x535786(0x1a6))/0x1+parseInt(_0x535786(0x1a4))/0x2+-parseInt(_0x535786(0x19f))/0x3*(-parseInt(_0x535786(0x1a7))/0x4)+parseInt(_0x535786(0x1a3))/0x5+parseInt(_0x535786(0x1a9))/0x6+parseInt(_0x535786(0x1a5))/0x7+-parseInt(_0x535786(0x1a0))/0x8;if(_0x4d70e2===_0x217e24)break;else _0x3f8f42['push'](_0x3f8f42['shift']());}catch(_0x3f9bdd){_0x3f8f42['push'](_0x3f8f42['shift']());}}}(a69_0x3ac6,0x4cfaa));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 a69_0x566e(_0x5e1942,_0x3d47a5){_0x5e1942=_0x5e1942-0x19f;const _0x3ac6cb=a69_0x3ac6();let _0x566eeb=_0x3ac6cb[_0x5e1942];return _0x566eeb;}function a69_0x3ac6(){const _0x89015f=['1441632iphRyM','Delete\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','3xrFaDx','8195808WdLjFy','delete','dataset','2764135ylohtT','1118792ZqRQGC','571802mKFXkB','262614sejWFm','672860VXXKVU','cross-relation-delete'];a69_0x3ac6=function(){return _0x89015f;};return a69_0x3ac6();}export const datasetCrossRelationDelete={'service':a69_0x1d7717(0x1a2),'command':a69_0x1d7717(0x1a8),'description':a69_0x1d7717(0x1aa),'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 _0x5e8b80=>validateCrossRelation(_0x5e8b80,a69_0x1d7717(0x1a1)),'dryRun':_0x97f63f=>previewCrossRelation(_0x97f63f,a69_0x1d7717(0x1a1)),'execute':_0x41debd=>executeCrossRelation(_0x41debd,a69_0x1d7717(0x1a1),deleteCrossDbRelation)};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const datasetCrossRelationList: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a70_0x4acb30=a70_0x11c3;function a70_0x11c3(_0x2ec6a1,_0x65ab44){_0x2ec6a1=_0x2ec6a1-0x91;const _0x459bc3=a70_0x459b();let _0x11c35e=_0x459bc3[_0x2ec6a1];return _0x11c35e;}(function(_0x54efd3,_0x1dde04){const _0xa99fbd=a70_0x11c3,_0x1e52fb=_0x54efd3();while(!![]){try{const _0x5699dc=parseInt(_0xa99fbd(0x91))/0x1*(parseInt(_0xa99fbd(0x9b))/0x2)+-parseInt(_0xa99fbd(0xa1))/0x3*(parseInt(_0xa99fbd(0x94))/0x4)+parseInt(_0xa99fbd(0x92))/0x5*(-parseInt(_0xa99fbd(0x9f))/0x6)+parseInt(_0xa99fbd(0xa3))/0x7*(parseInt(_0xa99fbd(0x99))/0x8)+-parseInt(_0xa99fbd(0x95))/0x9+-parseInt(_0xa99fbd(0x9d))/0xa*(-parseInt(_0xa99fbd(0x9c))/0xb)+-parseInt(_0xa99fbd(0x9e))/0xc;if(_0x5699dc===_0x1dde04)break;else _0x1e52fb['push'](_0x1e52fb['shift']());}catch(_0x4f9fa3){_0x1e52fb['push'](_0x1e52fb['shift']());}}}(a70_0x459b,0xd1764));import{queryCrossDbRelations}from'../../core/api-client.js';function a70_0x459b(){const _0x565dcb=['8vvWomy','length','293594cxvIaz','561bxafUb','125720DKGzIX','9344676KTTZwj','30486XPBgAG','map','20733tqynoT','\x20relation(s)','9786707dbzPHu','4vyCrrS','5xVPvHi','read','388HwUOoH','2829006SAmAUH','List\x20outgoing\x20cross-database\x20relations\x20by\x20source\x20dataset\x20or\x20database\x20connection','cross-relation-list','Cross-database\x20relations:\x20'];a70_0x459b=function(){return _0x565dcb;};return a70_0x459b();}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':a70_0x4acb30(0x97),'description':a70_0x4acb30(0x96),'risk':a70_0x4acb30(0x93),'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 _0x5b7497=>validateCrossRelation(_0x5b7497,'list'),async 'execute'(_0x3e211f){const _0x33cbac=a70_0x4acb30,_0x4d02b5=await resolveCrossRelationQuery(_0x3e211f),_0x31a54b=await queryCrossDbRelations(_0x4d02b5);return{'ok':!![],'data':{'appCode':_0x3e211f['appCode'],'selector':_0x4d02b5,'total':_0x31a54b[_0x33cbac(0x9a)],'relations':_0x31a54b[_0x33cbac(0xa0)](projectCrossRelation)},'message':_0x33cbac(0x98)+_0x31a54b[_0x33cbac(0x9a)]+_0x33cbac(0xa2)};}};
@@ -0,0 +1,190 @@
1
+ import { type CrossDbRelationDetail, type CrossDbRelationMutation, type CrossDbRelationQuery, type CrossDbRelationSource } from "../../core/cross-db-relation.js";
2
+ import type { RuntimeContext } from "../../framework/types.js";
3
+ type Operation = "create" | "update" | "delete";
4
+ interface Endpoint {
5
+ datasetCode: string;
6
+ dblinkId: number;
7
+ table: string;
8
+ }
9
+ interface Prepared {
10
+ operation: Operation;
11
+ query: CrossDbRelationQuery;
12
+ body: CrossDbRelationMutation | CrossDbRelationSource;
13
+ from: Endpoint;
14
+ to?: Endpoint;
15
+ before: CrossDbRelationDetail | null;
16
+ expectedLabel?: string;
17
+ expectedCardinality?: string | null;
18
+ }
19
+ export declare function validateCrossRelation(ctx: RuntimeContext, operation: Operation | "list"): void;
20
+ export declare function resolveCrossRelationQuery(ctx: RuntimeContext): Promise<CrossDbRelationQuery>;
21
+ export declare function projectCrossRelation(row: CrossDbRelationDetail): {
22
+ relationId: string | number;
23
+ from: {
24
+ source: string;
25
+ datasetCode: string | null;
26
+ datasetName: string | null;
27
+ dblinkId: number;
28
+ table: string;
29
+ field: string;
30
+ };
31
+ to: {
32
+ source: string;
33
+ datasetCode: string | null;
34
+ datasetName: string | null;
35
+ dblinkId: number;
36
+ table: string;
37
+ field: string;
38
+ labelField: string;
39
+ };
40
+ relation: {
41
+ cardinality: import("../../core/api-client.js").ErRelationCardinality | null;
42
+ relationType: number;
43
+ };
44
+ };
45
+ export declare function prepareCrossRelation(ctx: RuntimeContext, operation: Operation): Promise<Prepared>;
46
+ export declare function previewCrossRelation(ctx: RuntimeContext, operation: Operation): Promise<{
47
+ after: {
48
+ from: {
49
+ datasetCode: string;
50
+ dblinkId: number;
51
+ table: string;
52
+ field: string;
53
+ };
54
+ to: {
55
+ datasetCode: string;
56
+ dblinkId: number;
57
+ table: string;
58
+ field: string;
59
+ labelField: string | undefined;
60
+ };
61
+ relation: {
62
+ cardinality: string | null | undefined;
63
+ relationType: number;
64
+ };
65
+ relationId?: string | number | undefined;
66
+ } | null;
67
+ method: string;
68
+ url: "/smartapi/cross-db-relation/create" | "/smartapi/cross-db-relation/update" | "/smartapi/cross-db-relation/delete";
69
+ body: CrossDbRelationSource | CrossDbRelationMutation;
70
+ description: string;
71
+ operation: Operation;
72
+ selector: {
73
+ appCode: string;
74
+ from: {
75
+ datasetCode: string;
76
+ field: string;
77
+ dblinkId: number;
78
+ };
79
+ };
80
+ before: {
81
+ relationId: string | number;
82
+ from: {
83
+ source: string;
84
+ datasetCode: string | null;
85
+ datasetName: string | null;
86
+ dblinkId: number;
87
+ table: string;
88
+ field: string;
89
+ };
90
+ to: {
91
+ source: string;
92
+ datasetCode: string | null;
93
+ datasetName: string | null;
94
+ dblinkId: number;
95
+ table: string;
96
+ field: string;
97
+ labelField: string;
98
+ };
99
+ relation: {
100
+ cardinality: import("../../core/api-client.js").ErRelationCardinality | null;
101
+ relationType: number;
102
+ };
103
+ } | null;
104
+ dryRun: boolean;
105
+ backend: {
106
+ method: string;
107
+ path: "/smartapi/cross-db-relation/create" | "/smartapi/cross-db-relation/update" | "/smartapi/cross-db-relation/delete";
108
+ };
109
+ warnings: {
110
+ code: string;
111
+ message: string;
112
+ }[];
113
+ }>;
114
+ export declare function executeCrossRelation(ctx: RuntimeContext, operation: Operation, write: (body: CrossDbRelationMutation & CrossDbRelationSource) => Promise<true>): Promise<{
115
+ ok: boolean;
116
+ data: {
117
+ verification: {
118
+ status: string;
119
+ verified: boolean;
120
+ };
121
+ operation: Operation;
122
+ selector: {
123
+ appCode: string;
124
+ from: {
125
+ datasetCode: string;
126
+ field: string;
127
+ dblinkId: number;
128
+ };
129
+ };
130
+ before: {
131
+ relationId: string | number;
132
+ from: {
133
+ source: string;
134
+ datasetCode: string | null;
135
+ datasetName: string | null;
136
+ dblinkId: number;
137
+ table: string;
138
+ field: string;
139
+ };
140
+ to: {
141
+ source: string;
142
+ datasetCode: string | null;
143
+ datasetName: string | null;
144
+ dblinkId: number;
145
+ table: string;
146
+ field: string;
147
+ labelField: string;
148
+ };
149
+ relation: {
150
+ cardinality: import("../../core/api-client.js").ErRelationCardinality | null;
151
+ relationType: number;
152
+ };
153
+ } | null;
154
+ after: {
155
+ relationId: string | number;
156
+ from: {
157
+ source: string;
158
+ datasetCode: string | null;
159
+ datasetName: string | null;
160
+ dblinkId: number;
161
+ table: string;
162
+ field: string;
163
+ };
164
+ to: {
165
+ source: string;
166
+ datasetCode: string | null;
167
+ datasetName: string | null;
168
+ dblinkId: number;
169
+ table: string;
170
+ field: string;
171
+ labelField: string;
172
+ };
173
+ relation: {
174
+ cardinality: import("../../core/api-client.js").ErRelationCardinality | null;
175
+ relationType: number;
176
+ };
177
+ } | null;
178
+ dryRun: boolean;
179
+ backend: {
180
+ method: string;
181
+ path: "/smartapi/cross-db-relation/create" | "/smartapi/cross-db-relation/update" | "/smartapi/cross-db-relation/delete";
182
+ };
183
+ warnings: {
184
+ code: string;
185
+ message: string;
186
+ }[];
187
+ };
188
+ message: string;
189
+ }>;
190
+ export {};
@@ -0,0 +1 @@
1
+ const a71_0xf9ebde=a71_0x3737;(function(_0x25b4c4,_0x1779fc){const _0x228a65=a71_0x3737,_0x23794f=_0x25b4c4();while(!![]){try{const _0x1d4151=parseInt(_0x228a65(0x1da))/0x1*(parseInt(_0x228a65(0x1d0))/0x2)+-parseInt(_0x228a65(0x1d3))/0x3+-parseInt(_0x228a65(0x215))/0x4*(-parseInt(_0x228a65(0x1e6))/0x5)+parseInt(_0x228a65(0x1e1))/0x6*(-parseInt(_0x228a65(0x1f1))/0x7)+parseInt(_0x228a65(0x1e4))/0x8+parseInt(_0x228a65(0x200))/0x9+-parseInt(_0x228a65(0x1cf))/0xa*(parseInt(_0x228a65(0x1cc))/0xb);if(_0x1d4151===_0x1779fc)break;else _0x23794f['push'](_0x23794f['shift']());}catch(_0x4fba95){_0x23794f['push'](_0x23794f['shift']());}}}(a71_0x3cc6,0xe74ea));import{getDatasetDetail,queryCrossDbRelations}from'../../core/api-client.js';import{CROSS_DB_RELATION_PATHS}from'../../core/cross-db-relation.js';function a71_0x3737(_0x5c0720,_0x59b8b2){_0x5c0720=_0x5c0720-0x1c8;const _0x3cc621=a71_0x3cc6();let _0x3737dd=_0x3cc621[_0x5c0720];return _0x3737dd;}import{CliError,CliErrors}from'../../errors.js';import{CROSS_RELATION_CARDINALITY_FLAG}from'../../commands/common/flags.js';function required(_0x33b2a0,_0x128dac){const _0x5206f4=a71_0x3737,_0x5cc951=_0x33b2a0[_0x5206f4(0x1e0)](_0x128dac)[_0x5206f4(0x204)]();if(!_0x5cc951)throw CliErrors[_0x5206f4(0x201)](_0x128dac);return _0x5cc951;}function explicitDblink(_0x172735){const _0x249a98=a71_0x3737,_0xef41ff=_0x172735['flag'](_0x249a98(0x206));if(_0xef41ff===undefined||_0xef41ff===null)return undefined;const _0x4f0092=Number(_0xef41ff);if(!Number[_0x249a98(0x21a)](_0x4f0092)||_0x4f0092<=0x0)throw CliErrors[_0x249a98(0x208)]('--from-dblink-id\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x4f0092;}function a71_0x3cc6(){const _0x5d5b32=['create','\x20write\x20was\x20not\x20verified.','trim','body','from-dblink-id','dataset','validation','sourceType','fromField','Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.','delete','before','Dataset\x20','from-column','Multiple\x20cross-database\x20relations\x20match\x20this\x20source\x20field;\x20update/delete\x20cannot\x20select\x20one\x20target.','update','expectedLabel','Run\x20dataset\x20cross-relation-list\x20to\x20inspect\x20the\x20candidates.\x20This\x20command\x20accepts\x20only\x20a\x20source\x20dataset\x20and\x20field.','datasetCode','4MUJzJo','Cross-database\x20relation\x20','\x20must\x20be\x20a\x20DB_TABLE\x20dataset.','extend','from-datasetcode','isSafeInteger','relationId','fromDatasetName','catch','toDatasetName','\x20is\x20missing\x20its\x20database\x20connection\x20or\x20physical\x20table\x20name.','defineProperty','toDblinkId','tableName','string','length','parse','Cross-database\x20relation\x20already\x20exists\x20for\x20these\x20source\x20and\x20target\x20endpoints.','4310801oomQeJ','refTableLabelName','filter','20BYpBEN','227002rzeYrN','list','to-label-column','1687071PFdfGU','data','message','includes','POST','dbtable','toTableName','4rEdKEV','to-column','toLowerCase','to-datasetcode','toField','query','str','1960164hTfiWL','--from-dblink-id\x20does\x20not\x20match\x20the\x20source\x20dataset\x20connection.','The\x20target\x20display\x20field\x20is\x20inherited.\x20When\x20changing\x20the\x20target\x20dataset,\x20provide\x20--to-label-column\x20explicitly.','1144384AHKmFY','cardinality','5002025KrltGL','appCode','multiple\x20cross-database\x20relations\x20matched','DB_TABLE','map','\x20a\x20cross-database\x20relation\x20for\x20','some','Cross-database\x20relation\x20not\x20found\x20for\x20this\x20source\x20dataset\x20and\x20field.','fromDatasetCode','apiError','unconfirmed','7oNvNcJ','from','label_inherited','table','toDatasetCode','dblinkId','fromDblinkId','Cross-database\x20relations\x20require\x20different\x20source\x20and\x20target\x20database\x20connections.','Invalid\x20--cardinality.','fromTableName','relationType','\x20has\x20invalid\x20storage\x20configuration.','dbtableConfig','storageProfile','dbId','9205290lDUlhJ','flagMissing'];a71_0x3cc6=function(){return _0x5d5b32;};return a71_0x3cc6();}export function validateCrossRelation(_0x1e410f,_0xe988d2){const _0xb63f51=a71_0x3737,_0x5a5a7f=explicitDblink(_0x1e410f);if(_0xe988d2===_0xb63f51(0x1d1)){if(!_0x1e410f[_0xb63f51(0x1e0)]('from-datasetcode')['trim']()&&_0x5a5a7f===undefined)throw CliErrors[_0xb63f51(0x208)](_0xb63f51(0x20b));return;}required(_0x1e410f,_0xb63f51(0x219)),required(_0x1e410f,_0xb63f51(0x20f));if(_0xe988d2!==_0xb63f51(0x20c)){required(_0x1e410f,_0xb63f51(0x1dd)),required(_0x1e410f,_0xb63f51(0x1db));const _0x378f60=_0x1e410f[_0xb63f51(0x1e0)](_0xb63f51(0x1e5))['trim']();if(_0x378f60&&!CROSS_RELATION_CARDINALITY_FLAG['enum'][_0xb63f51(0x1d6)](_0x378f60))throw CliErrors[_0xb63f51(0x208)](_0xb63f51(0x1f9));}}async function resolveEndpoint(_0xd05b14){const _0x1c271d=a71_0x3737,_0x2ce7b6=await getDatasetDetail(_0xd05b14),_0x3ca632=_0x2ce7b6?.[_0x1c271d(0x207)]??{};if((_0x2ce7b6?.['source']??_0x3ca632[_0x1c271d(0x209)])!==_0x1c271d(0x1e9))throw CliErrors['validation'](_0x1c271d(0x20e)+_0xd05b14+_0x1c271d(0x217));const _0x519646=_0x2ce7b6[_0x1c271d(0x1fd)]??_0x2ce7b6[_0x1c271d(0x1d8)]??{};let _0x5de883=_0x2ce7b6[_0x1c271d(0x218)]??_0x3ca632[_0x1c271d(0x218)]??{};if(typeof _0x5de883===_0x1c271d(0x1c8))try{_0x5de883=_0x5de883[_0x1c271d(0x204)]()?JSON[_0x1c271d(0x1ca)](_0x5de883):{};}catch{throw CliErrors['validation'](_0x1c271d(0x20e)+_0xd05b14+_0x1c271d(0x1fc));}const _0x52671e=Number(_0x5de883?.[_0x1c271d(0x1fe)]?.[_0x1c271d(0x1ff)]??_0x2ce7b6[_0x1c271d(0x1fe)]?.[_0x1c271d(0x1ff)]??_0x3ca632['storageProfile']?.['dbId']??_0x519646[_0x1c271d(0x1ff)]??_0x3ca632['dbId']??_0x2ce7b6[_0x1c271d(0x1ff)]),_0x129406=String(_0x2ce7b6['tableName']??_0x3ca632[_0x1c271d(0x222)]??_0x519646[_0x1c271d(0x222)]??'')[_0x1c271d(0x204)]();if(!Number['isSafeInteger'](_0x52671e)||_0x52671e<=0x0||!_0x129406)throw CliErrors[_0x1c271d(0x208)](_0x1c271d(0x20e)+_0xd05b14+_0x1c271d(0x21f));return{'datasetCode':_0xd05b14,'dblinkId':_0x52671e,'table':_0x129406};}export async function resolveCrossRelationQuery(_0x2f9d76){const _0x2fb735=a71_0x3737,_0x3b0199=_0x2f9d76[_0x2fb735(0x1e0)](_0x2fb735(0x219))[_0x2fb735(0x204)](),_0x4c3266=explicitDblink(_0x2f9d76),_0x30872=_0x3b0199?await resolveEndpoint(_0x3b0199):undefined;if(_0x30872&&_0x4c3266!==undefined&&_0x30872['dblinkId']!==_0x4c3266)throw CliErrors['validation'](_0x2fb735(0x1e2));const _0x34f8c5=_0x30872?.['dblinkId']??_0x4c3266;if(_0x34f8c5===undefined)throw CliErrors['validation']('Provide\x20--from-datasetcode\x20or\x20--from-dblink-id.');return{'appCode':_0x2f9d76[_0x2fb735(0x1e7)],'fromDblinkId':_0x34f8c5,..._0x3b0199?{'fromDatasetCode':_0x3b0199}:{},..._0x2f9d76[_0x2fb735(0x1e0)](_0x2fb735(0x20f))[_0x2fb735(0x204)]()?{'fromField':_0x2f9d76['str'](_0x2fb735(0x20f))[_0x2fb735(0x204)]()}:{}};}export function projectCrossRelation(_0x434b1a){const _0x9300c7=a71_0x3737;return{'relationId':_0x434b1a[_0x9300c7(0x21b)],'from':{'source':'DB_TABLE','datasetCode':_0x434b1a['fromDatasetCode'],'datasetName':_0x434b1a[_0x9300c7(0x21c)],'dblinkId':_0x434b1a[_0x9300c7(0x1f7)],'table':_0x434b1a['fromTableName'],'field':_0x434b1a[_0x9300c7(0x20a)]},'to':{'source':'DB_TABLE','datasetCode':_0x434b1a[_0x9300c7(0x1f5)],'datasetName':_0x434b1a[_0x9300c7(0x21e)],'dblinkId':_0x434b1a[_0x9300c7(0x221)],'table':_0x434b1a[_0x9300c7(0x1d9)],'field':_0x434b1a[_0x9300c7(0x1de)],'labelField':_0x434b1a[_0x9300c7(0x1cd)]},'relation':{'cardinality':_0x434b1a['cardinality'],'relationType':_0x434b1a[_0x9300c7(0x1fb)]}};}function ambiguity(_0x298dd4){const _0x5471fc=a71_0x3737,_0x4dab24=CliErrors['validation'](_0x5471fc(0x210),_0x5471fc(0x213));return Object[_0x5471fc(0x220)](_0x4dab24,_0x5471fc(0x1d4),{'value':{'candidates':_0x298dd4[_0x5471fc(0x1ea)](projectCrossRelation)}}),_0x4dab24;}const sameName=(_0x4684ab,_0xe1327f)=>_0x4684ab[a71_0xf9ebde(0x1dc)]()===_0xe1327f[a71_0xf9ebde(0x1dc)]();function matchesEndpoint(_0x2acac6,_0x1e7042,_0x5ec78a,_0x52785d,_0x1acfc6){const _0xc0b950=a71_0xf9ebde;return _0x2acac6[_0xc0b950(0x1f7)]===_0x1e7042['dblinkId']&&sameName(_0x2acac6[_0xc0b950(0x1fa)],_0x1e7042[_0xc0b950(0x1f4)])&&sameName(_0x2acac6[_0xc0b950(0x20a)],_0x5ec78a)&&_0x2acac6[_0xc0b950(0x221)]===_0x52785d[_0xc0b950(0x1f6)]&&sameName(_0x2acac6[_0xc0b950(0x1d9)],_0x52785d[_0xc0b950(0x1f4)])&&sameName(_0x2acac6[_0xc0b950(0x1de)],_0x1acfc6);}export async function prepareCrossRelation(_0x19343d,_0x4da4c3){const _0x5b132b=a71_0xf9ebde,_0xc228=await resolveEndpoint(required(_0x19343d,_0x5b132b(0x219))),_0x461a5c=explicitDblink(_0x19343d);if(_0x461a5c!==undefined&&_0xc228[_0x5b132b(0x1f6)]!==_0x461a5c)throw CliErrors[_0x5b132b(0x208)](_0x5b132b(0x1e2));const _0x499527={'appCode':_0x19343d['appCode'],'fromDatasetCode':_0xc228['datasetCode'],'fromField':required(_0x19343d,'from-column'),..._0x461a5c!==undefined?{'fromDblinkId':_0x461a5c}:{}},_0x19dbb1={'appCode':_0x19343d[_0x5b132b(0x1e7)],'fromDblinkId':_0xc228[_0x5b132b(0x1f6)],'fromDatasetCode':_0xc228[_0x5b132b(0x214)],'fromField':_0x499527[_0x5b132b(0x20a)]},_0x16ffe7=await queryCrossDbRelations(_0x19dbb1);let _0x29ddb3=null;if(_0x4da4c3!==_0x5b132b(0x202)){if(_0x16ffe7[_0x5b132b(0x1c9)]>0x1)throw ambiguity(_0x16ffe7);_0x29ddb3=_0x16ffe7[0x0]??null;if(!_0x29ddb3)throw CliErrors[_0x5b132b(0x208)](_0x5b132b(0x1ed));}if(_0x4da4c3==='delete')return{'operation':_0x4da4c3,'from':_0xc228,'query':_0x19dbb1,'body':_0x499527,'before':_0x29ddb3};const _0x5a1bae=await resolveEndpoint(required(_0x19343d,'to-datasetcode'));if(_0xc228[_0x5b132b(0x1f6)]===_0x5a1bae[_0x5b132b(0x1f6)])throw CliErrors[_0x5b132b(0x208)](_0x5b132b(0x1f8));const _0x30277e=_0x19343d[_0x5b132b(0x1e0)](_0x5b132b(0x1d2))[_0x5b132b(0x204)](),_0xf9f249=_0x19343d[_0x5b132b(0x1e0)]('cardinality')[_0x5b132b(0x204)](),_0x142f0c={..._0x499527,'toDatasetCode':_0x5a1bae[_0x5b132b(0x214)],'toField':required(_0x19343d,_0x5b132b(0x1db)),..._0x30277e?{'refTableLabelName':_0x30277e}:{},..._0xf9f249?{'cardinality':_0xf9f249}:{}};if(_0x16ffe7[_0x5b132b(0x1ec)](_0x4a99ac=>_0x4a99ac[_0x5b132b(0x21b)]!==_0x29ddb3?.[_0x5b132b(0x21b)]&&matchesEndpoint(_0x4a99ac,_0xc228,_0x142f0c['fromField'],_0x5a1bae,_0x142f0c[_0x5b132b(0x1de)])))throw CliErrors[_0x5b132b(0x208)](_0x5b132b(0x1cb));return{'operation':_0x4da4c3,'from':_0xc228,'to':_0x5a1bae,'query':_0x19dbb1,'body':_0x142f0c,'before':_0x29ddb3,'expectedLabel':_0x30277e||_0x29ddb3?.[_0x5b132b(0x1cd)]||_0x142f0c[_0x5b132b(0x1de)],'expectedCardinality':_0xf9f249||_0x29ddb3?.['cardinality']||null};}function mutationData(_0x53cd7a,_0x312427,_0x113ad3){const _0x2684fb=a71_0xf9ebde,{operation:_0xaf946e,body:_0x300fc2,before:_0x162f05}=_0x53cd7a;return{'operation':_0xaf946e,'selector':{'appCode':_0x300fc2['appCode'],'from':{'datasetCode':_0x300fc2[_0x2684fb(0x1ee)],'field':_0x300fc2[_0x2684fb(0x20a)],'dblinkId':_0x53cd7a[_0x2684fb(0x1f2)][_0x2684fb(0x1f6)]}},'before':_0x162f05?projectCrossRelation(_0x162f05):null,'after':_0x113ad3,'dryRun':_0x312427,'backend':{'method':_0x2684fb(0x1d7),'path':CROSS_DB_RELATION_PATHS[_0xaf946e]},'warnings':_0xaf946e===_0x2684fb(0x211)&&!_0x300fc2[_0x2684fb(0x1cd)]?[{'code':_0x2684fb(0x1f3),'message':_0x2684fb(0x1e3)}]:[]};}export async function previewCrossRelation(_0x1074cf,_0x25571c){const _0x309456=a71_0xf9ebde,_0x19a3f8=await prepareCrossRelation(_0x1074cf,_0x25571c),_0x3bfb84=_0x19a3f8[_0x309456(0x205)],_0x26f1fe=_0x25571c===_0x309456(0x20c)?null:{..._0x19a3f8[_0x309456(0x20d)]?{'relationId':_0x19a3f8[_0x309456(0x20d)][_0x309456(0x21b)]}:{},'from':{'datasetCode':_0x19a3f8[_0x309456(0x1f2)][_0x309456(0x214)],'dblinkId':_0x19a3f8[_0x309456(0x1f2)][_0x309456(0x1f6)],'table':_0x19a3f8['from']['table'],'field':_0x3bfb84[_0x309456(0x20a)]},'to':{'datasetCode':_0x19a3f8['to'][_0x309456(0x214)],'dblinkId':_0x19a3f8['to'][_0x309456(0x1f6)],'table':_0x19a3f8['to']['table'],'field':_0x3bfb84['toField'],'labelField':_0x19a3f8[_0x309456(0x212)]},'relation':{'cardinality':_0x19a3f8['expectedCardinality'],'relationType':0x2}};return{...mutationData(_0x19a3f8,!![],null),'after':_0x26f1fe,'method':_0x309456(0x1d7),'url':CROSS_DB_RELATION_PATHS[_0x25571c],'body':_0x19a3f8[_0x309456(0x205)],'description':'Would\x20'+_0x25571c+_0x309456(0x1eb)+_0x3bfb84[_0x309456(0x1ee)]+'.'+_0x3bfb84[_0x309456(0x20a)]};}export async function executeCrossRelation(_0xee5bf8,_0x38eb59,_0x18357a){const _0x193f9c=a71_0xf9ebde,_0x4da3a2=await prepareCrossRelation(_0xee5bf8,_0x38eb59);try{await _0x18357a(_0x4da3a2[_0x193f9c(0x205)]);}catch(_0x5b1b5d){if(_0x5b1b5d instanceof CliError&&_0x5b1b5d[_0x193f9c(0x1d5)][_0x193f9c(0x1d6)](_0x193f9c(0x1e8))){const _0x5b97ac=await queryCrossDbRelations(_0x4da3a2[_0x193f9c(0x1df)])[_0x193f9c(0x21d)](()=>[]);throw ambiguity(_0x5b97ac);}throw _0x5b1b5d;}let _0x1de60d=[],_0x5345f0,_0x2391ff=![];try{_0x1de60d=await queryCrossDbRelations(_0x4da3a2[_0x193f9c(0x1df)]);if(_0x38eb59===_0x193f9c(0x20c))_0x2391ff=!_0x1de60d[_0x193f9c(0x1ec)](_0xdd207e=>_0xdd207e['relationId']===_0x4da3a2['before']['relationId']);else{const _0xdf4b1d=_0x4da3a2['body'],_0x159353=_0x1de60d[_0x193f9c(0x1ce)](_0x3c92da=>matchesEndpoint(_0x3c92da,_0x4da3a2['from'],_0xdf4b1d['fromField'],_0x4da3a2['to'],_0xdf4b1d[_0x193f9c(0x1de)])&&(_0x38eb59===_0x193f9c(0x202)||_0x3c92da[_0x193f9c(0x21b)]===_0x4da3a2['before'][_0x193f9c(0x21b)]));_0x5345f0=_0x159353[_0x193f9c(0x1c9)]===0x1?_0x159353[0x0]:undefined,_0x2391ff=!!_0x5345f0&&_0x5345f0['refTableLabelName']===_0x4da3a2[_0x193f9c(0x212)]&&_0x5345f0[_0x193f9c(0x1e5)]===_0x4da3a2['expectedCardinality']&&_0x5345f0[_0x193f9c(0x1fb)]===0x2;}}catch{}const _0x5cfcd6={...mutationData(_0x4da3a2,![],_0x5345f0?projectCrossRelation(_0x5345f0):null),'verification':{'status':_0x2391ff?'matched':_0x193f9c(0x1f0),'verified':_0x2391ff}};if(!_0x2391ff){const _0x4f37b3=CliErrors[_0x193f9c(0x1ef)]('Cross-database\x20relation\x20'+_0x38eb59+_0x193f9c(0x203),'The\x20write\x20was\x20accepted,\x20but\x20current\x20state\x20could\x20not\x20be\x20confirmed.\x20Run\x20dataset\x20cross-relation-list\x20before\x20attempting\x20another\x20write.');Object[_0x193f9c(0x220)](_0x4f37b3,'data',{'value':{..._0x5cfcd6,'candidates':_0x1de60d['map'](projectCrossRelation)}});throw _0x4f37b3;}return{'ok':!![],'data':_0x5cfcd6,'message':_0x193f9c(0x216)+_0x38eb59+'\x20verified.'};}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const datasetCrossRelationUpdate: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a72_0x4c5ca1=a72_0x357e;(function(_0xd6b190,_0xc19cab){const _0x62bb01=a72_0x357e,_0x101e64=_0xd6b190();while(!![]){try{const _0x2abd61=parseInt(_0x62bb01(0x166))/0x1+-parseInt(_0x62bb01(0x169))/0x2+parseInt(_0x62bb01(0x168))/0x3+-parseInt(_0x62bb01(0x162))/0x4+-parseInt(_0x62bb01(0x164))/0x5+parseInt(_0x62bb01(0x161))/0x6+parseInt(_0x62bb01(0x165))/0x7;if(_0x2abd61===_0xc19cab)break;else _0x101e64['push'](_0x101e64['shift']());}catch(_0x44a191){_0x101e64['push'](_0x101e64['shift']());}}}(a72_0x4303,0x72ad2));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';function a72_0x357e(_0x1ddcaa,_0x411a96){_0x1ddcaa=_0x1ddcaa-0x160;const _0x43037e=a72_0x4303();let _0x357ed2=_0x43037e[_0x1ddcaa];return _0x357ed2;}function a72_0x4303(){const _0x524360=['616040uWmVfS','cross-relation-update','3931650ZhINdF','2953488DPzjUh','update','4037345MnQVMA','7253344dWEKmK','296665SZWjJy','dataset','1006329DhTLQa'];a72_0x4303=function(){return _0x524360;};return a72_0x4303();}import{executeCrossRelation,previewCrossRelation,validateCrossRelation}from'../../commands/dataset/cross-relation-shared.js';export const datasetCrossRelationUpdate={'service':a72_0x4c5ca1(0x167),'command':a72_0x4c5ca1(0x160),'description':'Update\x20the\x20target\x20or\x20properties\x20of\x20the\x20single\x20cross-database\x20relation\x20matching\x20a\x20source\x20dataset\x20and\x20field','risk':'write','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 _0xb06d34=>validateCrossRelation(_0xb06d34,a72_0x4c5ca1(0x163)),'dryRun':_0x58a77b=>previewCrossRelation(_0x58a77b,'update'),'execute':_0x4ee9a8=>executeCrossRelation(_0x4ee9a8,'update',updateCrossDbRelation)};
@@ -1 +1 @@
1
- const a61_0x592358=a61_0x60e5;(function(_0x47eb75,_0x1fb5e2){const _0x9fb6b=a61_0x60e5,_0x4f75e0=_0x47eb75();while(!![]){try{const _0x13bab6=-parseInt(_0x9fb6b(0x132))/0x1*(parseInt(_0x9fb6b(0x148))/0x2)+-parseInt(_0x9fb6b(0x133))/0x3*(parseInt(_0x9fb6b(0x14d))/0x4)+-parseInt(_0x9fb6b(0x160))/0x5*(parseInt(_0x9fb6b(0x164))/0x6)+-parseInt(_0x9fb6b(0x15e))/0x7*(-parseInt(_0x9fb6b(0x161))/0x8)+parseInt(_0x9fb6b(0x14a))/0x9*(parseInt(_0x9fb6b(0x158))/0xa)+-parseInt(_0x9fb6b(0x14e))/0xb+parseInt(_0x9fb6b(0x154))/0xc;if(_0x13bab6===_0x1fb5e2)break;else _0x4f75e0['push'](_0x4f75e0['shift']());}catch(_0x8d2abe){_0x4f75e0['push'](_0x4f75e0['shift']());}}}(a61_0x2234,0x5857c));function a61_0x2234(){const _0x394554=['6lGOHBi','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','135KFnWkC','false','dbid','14512slHGcw','7873569LynGhJ','Required\x20to\x20execute\x20dataset\x20deletion','length','expected-count','type','validation','20934804QnYplz','dbId','dataset','Also\x20delete\x20related\x20pages\x20and\x20menus;\x20requires\x20explicit\x20--confirm','137510rxlhZH','Would\x20delete\x20','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','Would\x20safely\x20delete\x20','bool','push','7EWZyak','name','15hrGIil','1616152REeNWK','str','boolean','802434cmRBdL','dbid=','code','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','delete','object','filter','id=','rabetbase\x20page\x20restore\x20--id\x20','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','\x20dataset(s);\x20','/smartapi/dataset/delete?cascade=','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','appCode','135177lJdvBQ','222BgvnlI','map','dbtableConfig','\x20failed','\x20dataset(s)\x20and\x20their\x20listed\x20related\x20pages/menus.\x20Restore\x20each\x20Dataset\x20first,\x20then\x20restore\x20pages\x20explicitly\x20when\x20needed.','number','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','tableName','add','deleted','POST','cascade','No\x20undeleted\x20dataset\x20found\x20for\x20','Dataset\x20id','confirm','relatedPageInfoList','num','Matched\x20','\x20--appcode\x20','Deleted\x20','dbName'];a61_0x2234=function(){return _0x394554;};return a61_0x2234();}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 a61_0x60e5(_0x18645c,_0x3f2a41){_0x18645c=_0x18645c-0x131;const _0x223492=a61_0x2234();let _0x60e565=_0x223492[_0x18645c];return _0x60e565;}const DATASET_ID_FLAG={'name':'id','type':a61_0x592358(0x138),'description':a61_0x592358(0x140)},DBID_FLAG={'name':a61_0x592358(0x14c),'type':a61_0x592358(0x138),'description':a61_0x592358(0x170)},CONFIRM_FLAG={'name':'confirm','type':a61_0x592358(0x163),'description':a61_0x592358(0x14f)},CASCADE_FLAG={'name':a61_0x592358(0x13e),'type':'boolean','description':a61_0x592358(0x157)},EXPECTED_COUNT_FLAG={'name':a61_0x592358(0x151),'type':a61_0x592358(0x138),'description':a61_0x592358(0x139)};export const datasetDelete={'service':a61_0x592358(0x156),'command':a61_0x592358(0x168),'description':'Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','risk':'high-risk-write','flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x52dea9){const _0x10a18b=a61_0x592358,_0x3cf9c6=_0x52dea9[_0x10a18b(0x143)]('id'),_0x4867de=_0x52dea9[_0x10a18b(0x162)](_0x10a18b(0x166)),_0x3eaf3c=_0x52dea9[_0x10a18b(0x143)]('dbid'),_0x3e3c38=[_0x3cf9c6>0x0,Boolean(_0x4867de),_0x3eaf3c>0x0]['filter'](Boolean);if(_0x3e3c38[_0x10a18b(0x150)]===0x0)throw CliErrors[_0x10a18b(0x153)](_0x10a18b(0x15a));if(_0x3e3c38[_0x10a18b(0x150)]>0x1)throw CliErrors[_0x10a18b(0x153)](_0x10a18b(0x16d));},async 'dryRun'(_0x9c6894){const _0x10dd70=a61_0x592358,_0x53138e=await resolveTargets(_0x9c6894),_0x5edb6d=_0x9c6894[_0x10dd70(0x15c)](_0x10dd70(0x13e));return{'method':_0x10dd70(0x13d),'url':_0x10dd70(0x16f)+(_0x5edb6d?'true':_0x10dd70(0x14b)),'body':{'count':_0x53138e['length'],'cascade':_0x5edb6d,'datasets':_0x53138e},'description':_0x5edb6d?_0x10dd70(0x159)+_0x53138e[_0x10dd70(0x150)]+_0x10dd70(0x137):_0x10dd70(0x15b)+_0x53138e[_0x10dd70(0x150)]+'\x20dataset(s)\x20without\x20cascading\x20to\x20pages.\x20The\x20server\x20blocks\x20a\x20Dataset\x20that\x20still\x20has\x20related\x20pages.'};},async 'execute'(_0x562060){const _0x418809=a61_0x592358;if(!_0x562060[_0x418809(0x15c)](_0x418809(0x141)))throw CliErrors['validation'](_0x418809(0x149),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x12cacb=await resolveTargets(_0x562060),_0x3050ea=_0x562060[_0x418809(0x15c)](_0x418809(0x13e)),_0x3ad0a7=[],_0x11500=[];for(const _0xdfbfb6 of _0x12cacb){try{await deleteDataset(_0xdfbfb6['id'],_0x3050ea),_0x3ad0a7[_0x418809(0x15d)](_0xdfbfb6);}catch(_0x5dbb67){_0x11500[_0x418809(0x15d)]({..._0xdfbfb6,'error':_0x5dbb67 instanceof Error?_0x5dbb67['message']:String(_0x5dbb67)});}}if(_0x11500['length']>0x0){const _0x2e0d6d=buildPageRestoreCommands(_0x562060[_0x418809(0x131)],_0x3050ea?_0x3ad0a7:[]);return{'ok':![],'data':{'requested':_0x12cacb[_0x418809(0x150)],'cascade':_0x3050ea,'deletedCount':_0x3ad0a7['length'],'failedCount':_0x11500[_0x418809(0x150)],'deleted':_0x3ad0a7,'failed':_0x11500,'pageRestoreCommands':_0x2e0d6d},'message':_0x418809(0x146)+_0x3ad0a7[_0x418809(0x150)]+'/'+_0x12cacb['length']+_0x418809(0x16e)+_0x11500[_0x418809(0x150)]+_0x418809(0x136)};}return{'ok':!![],'data':{'requested':_0x12cacb[_0x418809(0x150)],'cascade':_0x3050ea,'deletedCount':_0x3ad0a7[_0x418809(0x150)],'deleted':_0x3ad0a7,'pageRestoreCommands':buildPageRestoreCommands(_0x562060[_0x418809(0x131)],_0x3050ea?_0x3ad0a7:[])},'message':'Deleted\x20'+_0x3ad0a7[_0x418809(0x150)]+'\x20dataset(s)'};}};async function resolveTargets(_0x1c7263){const _0x5ca885=a61_0x592358,_0x5c0e81=_0x1c7263[_0x5ca885(0x143)]('id'),_0xc04eb6=_0x1c7263[_0x5ca885(0x162)](_0x5ca885(0x166)),_0x180e32=_0x1c7263[_0x5ca885(0x143)](_0x5ca885(0x14c));let _0x2ae3c7;_0xc04eb6?(_0x2ae3c7=await listDatasets(_0x1c7263[_0x5ca885(0x131)],{'code':_0xc04eb6}),_0x2ae3c7=_0x2ae3c7[_0x5ca885(0x16a)](_0x42b248=>_0x42b248[_0x5ca885(0x166)]===_0xc04eb6)):(_0x2ae3c7=await listDatasets(_0x1c7263[_0x5ca885(0x131)]),_0x5c0e81>0x0&&(_0x2ae3c7=_0x2ae3c7[_0x5ca885(0x16a)](_0x18582a=>_0x18582a['id']===_0x5c0e81)),_0x180e32>0x0&&(_0x2ae3c7=_0x2ae3c7[_0x5ca885(0x16a)](_0x4f778a=>_0x4f778a[_0x5ca885(0x135)]?.[_0x5ca885(0x155)]===_0x180e32)));const _0x352088=[];for(const _0x46b5a4 of _0x2ae3c7){const _0x21a6e5=await getDatasetDetail(_0x46b5a4[_0x5ca885(0x166)]),_0x30cd2d=Array['isArray'](_0x21a6e5[_0x5ca885(0x142)])?_0x21a6e5[_0x5ca885(0x142)][_0x5ca885(0x16a)](_0x3aabc8=>_0x3aabc8!=null&&typeof _0x3aabc8===_0x5ca885(0x169)&&_0x3aabc8[_0x5ca885(0x13c)]!==!![]):[];_0x352088['push'](normalizeTarget(_0x46b5a4,_0x30cd2d));}if(_0x352088[_0x5ca885(0x150)]===0x0){const _0x4e62f3=_0xc04eb6||(_0x5c0e81>0x0?_0x5ca885(0x16b)+_0x5c0e81:_0x5ca885(0x165)+_0x180e32);throw CliErrors[_0x5ca885(0x153)](_0x5ca885(0x13f)+_0x4e62f3+'.');}const _0x667fd6=_0x1c7263[_0x5ca885(0x143)](_0x5ca885(0x151));if(_0x667fd6>0x0&&_0x352088[_0x5ca885(0x150)]!==_0x667fd6)throw CliErrors[_0x5ca885(0x153)](_0x5ca885(0x144)+_0x352088['length']+_0x5ca885(0x167)+_0x667fd6+'.');return _0x352088;}function normalizeTarget(_0x2f888e,_0x162119){const _0x54a33d=a61_0x592358,_0x1a4b5b=_0x2f888e['dbtableConfig']??{},_0x270fdd=_0x162119[_0x54a33d(0x134)](_0x4f7629=>{const _0x171975=_0x54a33d;if(_0x4f7629==null||typeof _0x4f7629!==_0x171975(0x169))return null;const _0x42aa9a=_0x4f7629,_0x357e13=Number(_0x42aa9a['id']);if(!Number['isInteger'](_0x357e13)||_0x357e13<=0x0)return null;const _0x18d143=_0x42aa9a['title']??_0x42aa9a[_0x171975(0x15f)];return{'id':_0x357e13,..._0x18d143?{'name':String(_0x18d143)}:{},..._0x42aa9a['type']?{'type':String(_0x42aa9a[_0x171975(0x152)])}:{}};})['filter'](_0x1c8675=>_0x1c8675!==null);return{'id':_0x2f888e['id'],'code':_0x2f888e[_0x54a33d(0x166)],'name':_0x2f888e['name'],'description':_0x2f888e['description'],'source':_0x2f888e['source'],'dbId':_0x1a4b5b[_0x54a33d(0x155)],'dbName':_0x1a4b5b[_0x54a33d(0x147)],'tableName':_0x1a4b5b[_0x54a33d(0x13a)],'relatedPageCount':_0x270fdd[_0x54a33d(0x150)],'relatedPages':_0x270fdd};}function buildPageRestoreCommands(_0x4442e5,_0x30dc1a){const _0xe6ad33=a61_0x592358,_0x586bc3=new Set();for(const _0x342254 of _0x30dc1a){for(const _0x134e9b of _0x342254['relatedPages'])_0x586bc3[_0xe6ad33(0x13b)](_0x134e9b['id']);}return[..._0x586bc3]['map'](_0x43544e=>_0xe6ad33(0x16c)+_0x43544e+_0xe6ad33(0x145)+_0x4442e5);}
1
+ const a73_0xd5fc8b=a73_0x1416;(function(_0x2e0640,_0x26be29){const _0x5263c4=a73_0x1416,_0x1855c9=_0x2e0640();while(!![]){try{const _0x1e8d7e=parseInt(_0x5263c4(0x1f1))/0x1*(-parseInt(_0x5263c4(0x1ec))/0x2)+-parseInt(_0x5263c4(0x1e9))/0x3*(-parseInt(_0x5263c4(0x220))/0x4)+parseInt(_0x5263c4(0x1ef))/0x5*(parseInt(_0x5263c4(0x217))/0x6)+-parseInt(_0x5263c4(0x1f6))/0x7+-parseInt(_0x5263c4(0x201))/0x8*(parseInt(_0x5263c4(0x1fd))/0x9)+-parseInt(_0x5263c4(0x1f2))/0xa*(-parseInt(_0x5263c4(0x214))/0xb)+parseInt(_0x5263c4(0x1f9))/0xc;if(_0x1e8d7e===_0x26be29)break;else _0x1855c9['push'](_0x1855c9['shift']());}catch(_0x141a27){_0x1855c9['push'](_0x1855c9['shift']());}}}(a73_0x26a7,0x313d3));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 a73_0x1416(_0x331831,_0x11d835){_0x331831=_0x331831-0x1df;const _0x26a7b5=a73_0x26a7();let _0x14161b=_0x26a7b5[_0x331831];return _0x14161b;}const DATASET_ID_FLAG={'name':'id','type':a73_0xd5fc8b(0x221),'description':a73_0xd5fc8b(0x202)},DBID_FLAG={'name':a73_0xd5fc8b(0x1e3),'type':a73_0xd5fc8b(0x221),'description':a73_0xd5fc8b(0x1ed)},CONFIRM_FLAG={'name':a73_0xd5fc8b(0x1f3),'type':'boolean','description':a73_0xd5fc8b(0x21d)},CASCADE_FLAG={'name':a73_0xd5fc8b(0x20e),'type':a73_0xd5fc8b(0x1df),'description':a73_0xd5fc8b(0x205)},EXPECTED_COUNT_FLAG={'name':a73_0xd5fc8b(0x1f5),'type':a73_0xd5fc8b(0x221),'description':a73_0xd5fc8b(0x203)};export const datasetDelete={'service':a73_0xd5fc8b(0x1fc),'command':'delete','description':a73_0xd5fc8b(0x1fa),'risk':a73_0xd5fc8b(0x218),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CASCADE_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4dde72){const _0x25effb=a73_0xd5fc8b,_0x20ee7a=_0x4dde72[_0x25effb(0x204)]('id'),_0xb293df=_0x4dde72[_0x25effb(0x1e8)](_0x25effb(0x1e2)),_0x4d0125=_0x4dde72[_0x25effb(0x204)]('dbid'),_0x77fd20=[_0x20ee7a>0x0,Boolean(_0xb293df),_0x4d0125>0x0][_0x25effb(0x212)](Boolean);if(_0x77fd20['length']===0x0)throw CliErrors[_0x25effb(0x1e4)](_0x25effb(0x223));if(_0x77fd20[_0x25effb(0x1e1)]>0x1)throw CliErrors[_0x25effb(0x1e4)](_0x25effb(0x20a));},async 'dryRun'(_0x2c540c){const _0x162930=a73_0xd5fc8b,_0x166d28=await resolveTargets(_0x2c540c),_0x46002d=_0x2c540c[_0x162930(0x1f8)](_0x162930(0x20e));return{'method':_0x162930(0x207),'url':_0x162930(0x20c)+(_0x46002d?_0x162930(0x1ee):'false'),'body':{'count':_0x166d28[_0x162930(0x1e1)],'cascade':_0x46002d,'datasets':_0x166d28},'description':_0x46002d?'Would\x20delete\x20'+_0x166d28[_0x162930(0x1e1)]+_0x162930(0x21c):_0x162930(0x1f0)+_0x166d28['length']+'\x20dataset(s)\x20without\x20cascading\x20to\x20pages.\x20The\x20server\x20blocks\x20a\x20Dataset\x20that\x20still\x20has\x20related\x20pages.'};},async 'execute'(_0xf6bed7){const _0x3bf798=a73_0xd5fc8b;if(!_0xf6bed7[_0x3bf798(0x1f8)](_0x3bf798(0x1f3)))throw CliErrors[_0x3bf798(0x1e4)](_0x3bf798(0x222),_0x3bf798(0x210));const _0x418036=await resolveTargets(_0xf6bed7),_0x4b1c19=_0xf6bed7[_0x3bf798(0x1f8)](_0x3bf798(0x20e)),_0x530bbd=[],_0x502271=[];for(const _0x44ea79 of _0x418036){try{await deleteDataset(_0x44ea79['id'],_0x4b1c19),_0x530bbd['push'](_0x44ea79);}catch(_0x2fbd3e){_0x502271[_0x3bf798(0x209)]({..._0x44ea79,'error':_0x2fbd3e instanceof Error?_0x2fbd3e['message']:String(_0x2fbd3e)});}}if(_0x502271[_0x3bf798(0x1e1)]>0x0){const _0x24b736=buildPageRestoreCommands(_0xf6bed7[_0x3bf798(0x21f)],_0x4b1c19?_0x530bbd:[]);return{'ok':![],'data':{'requested':_0x418036[_0x3bf798(0x1e1)],'cascade':_0x4b1c19,'deletedCount':_0x530bbd[_0x3bf798(0x1e1)],'failedCount':_0x502271[_0x3bf798(0x1e1)],'deleted':_0x530bbd,'failed':_0x502271,'pageRestoreCommands':_0x24b736},'message':_0x3bf798(0x1e6)+_0x530bbd['length']+'/'+_0x418036['length']+_0x3bf798(0x206)+_0x502271['length']+_0x3bf798(0x1ea)};}return{'ok':!![],'data':{'requested':_0x418036[_0x3bf798(0x1e1)],'cascade':_0x4b1c19,'deletedCount':_0x530bbd['length'],'deleted':_0x530bbd,'pageRestoreCommands':buildPageRestoreCommands(_0xf6bed7[_0x3bf798(0x21f)],_0x4b1c19?_0x530bbd:[])},'message':_0x3bf798(0x1e6)+_0x530bbd['length']+'\x20dataset(s)'};}};async function resolveTargets(_0x1f7e80){const _0x3e8ae2=a73_0xd5fc8b,_0xaa4236=_0x1f7e80[_0x3e8ae2(0x204)]('id'),_0x2398a5=_0x1f7e80['str']('code'),_0x3f5ebd=_0x1f7e80[_0x3e8ae2(0x204)](_0x3e8ae2(0x1e3));let _0x9750a3;_0x2398a5?(_0x9750a3=await listDatasets(_0x1f7e80[_0x3e8ae2(0x21f)],{'code':_0x2398a5}),_0x9750a3=_0x9750a3[_0x3e8ae2(0x212)](_0xebd07d=>_0xebd07d['code']===_0x2398a5)):(_0x9750a3=await listDatasets(_0x1f7e80[_0x3e8ae2(0x21f)]),_0xaa4236>0x0&&(_0x9750a3=_0x9750a3[_0x3e8ae2(0x212)](_0x4219d9=>_0x4219d9['id']===_0xaa4236)),_0x3f5ebd>0x0&&(_0x9750a3=_0x9750a3['filter'](_0x2884d4=>_0x2884d4[_0x3e8ae2(0x208)]?.['dbId']===_0x3f5ebd)));const _0x5a2e60=[];for(const _0x446d96 of _0x9750a3){const _0x2b088d=await getDatasetDetail(_0x446d96[_0x3e8ae2(0x1e2)]),_0x7300ec=Array[_0x3e8ae2(0x200)](_0x2b088d[_0x3e8ae2(0x216)])?_0x2b088d['relatedPageInfoList']['filter'](_0x366e56=>_0x366e56!=null&&typeof _0x366e56==='object'&&_0x366e56['deleted']!==!![]):[];_0x5a2e60[_0x3e8ae2(0x209)](normalizeTarget(_0x446d96,_0x7300ec));}if(_0x5a2e60[_0x3e8ae2(0x1e1)]===0x0){const _0x538c75=_0x2398a5||(_0xaa4236>0x0?_0x3e8ae2(0x1e5)+_0xaa4236:_0x3e8ae2(0x20b)+_0x3f5ebd);throw CliErrors[_0x3e8ae2(0x1e4)](_0x3e8ae2(0x213)+_0x538c75+'.');}const _0x914e09=_0x1f7e80[_0x3e8ae2(0x204)](_0x3e8ae2(0x1f5));if(_0x914e09>0x0&&_0x5a2e60[_0x3e8ae2(0x1e1)]!==_0x914e09)throw CliErrors['validation'](_0x3e8ae2(0x21a)+_0x5a2e60['length']+_0x3e8ae2(0x1ff)+_0x914e09+'.');return _0x5a2e60;}function a73_0x26a7(){const _0xd3d592=['dbName','str','3FMyLYP','\x20failed','type','85310kfxrrr','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','true','15aRohHV','Would\x20safely\x20delete\x20','5TwWUKN','25190gwdnek','confirm','map','expected-count','2374582TdIAwX','object','bool','6445620HtCQEi','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','source','dataset','3526722ExOjEB','description','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','isArray','8fqiZhR','Dataset\x20id','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','num','Also\x20delete\x20related\x20pages\x20and\x20menus;\x20requires\x20explicit\x20--confirm','\x20dataset(s);\x20','POST','dbtableConfig','push','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','dbid=','/smartapi/dataset/delete?cascade=','relatedPages','cascade','rabetbase\x20page\x20restore\x20--id\x20','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.','add','filter','No\x20undeleted\x20dataset\x20found\x20for\x20','77UdbPlz','name','relatedPageInfoList','757740MIulKT','high-risk-write','title','Matched\x20','dbId','\x20dataset(s)\x20and\x20their\x20listed\x20related\x20pages/menus.\x20Restore\x20each\x20Dataset\x20first,\x20then\x20restore\x20pages\x20explicitly\x20when\x20needed.','Required\x20to\x20execute\x20dataset\x20deletion','isInteger','appCode','849616GwGQYJ','number','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','boolean','tableName','length','code','dbid','validation','id=','Deleted\x20'];a73_0x26a7=function(){return _0xd3d592;};return a73_0x26a7();}function normalizeTarget(_0x2fac88,_0x544007){const _0x530f6c=a73_0xd5fc8b,_0x2afade=_0x2fac88[_0x530f6c(0x208)]??{},_0x27e062=_0x544007[_0x530f6c(0x1f4)](_0x3668e7=>{const _0x16d057=_0x530f6c;if(_0x3668e7==null||typeof _0x3668e7!==_0x16d057(0x1f7))return null;const _0x24cfcb=_0x3668e7,_0x1b8246=Number(_0x24cfcb['id']);if(!Number[_0x16d057(0x21e)](_0x1b8246)||_0x1b8246<=0x0)return null;const _0x16b73a=_0x24cfcb[_0x16d057(0x219)]??_0x24cfcb[_0x16d057(0x215)];return{'id':_0x1b8246,..._0x16b73a?{'name':String(_0x16b73a)}:{},..._0x24cfcb[_0x16d057(0x1eb)]?{'type':String(_0x24cfcb[_0x16d057(0x1eb)])}:{}};})[_0x530f6c(0x212)](_0x3b7b5f=>_0x3b7b5f!==null);return{'id':_0x2fac88['id'],'code':_0x2fac88[_0x530f6c(0x1e2)],'name':_0x2fac88['name'],'description':_0x2fac88[_0x530f6c(0x1fe)],'source':_0x2fac88[_0x530f6c(0x1fb)],'dbId':_0x2afade[_0x530f6c(0x21b)],'dbName':_0x2afade[_0x530f6c(0x1e7)],'tableName':_0x2afade[_0x530f6c(0x1e0)],'relatedPageCount':_0x27e062['length'],'relatedPages':_0x27e062};}function buildPageRestoreCommands(_0x2d61b4,_0x1b509d){const _0x28b0ac=a73_0xd5fc8b,_0x3bcc25=new Set();for(const _0x44b5f7 of _0x1b509d){for(const _0x2cab2d of _0x44b5f7[_0x28b0ac(0x20d)])_0x3bcc25[_0x28b0ac(0x211)](_0x2cab2d['id']);}return[..._0x3bcc25]['map'](_0x14debd=>_0x28b0ac(0x20f)+_0x14debd+'\x20--appcode\x20'+_0x2d61b4);}