@lovrabet/rabetbase-cli 2.4.4 → 2.4.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.d.ts +1 -0
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
  63. package/lib/commands/dataset/business-groups.js +1 -0
  64. package/lib/commands/dataset/capability.js +1 -1
  65. package/lib/commands/dataset/delete.js +1 -1
  66. package/lib/commands/dataset/detail.js +1 -1
  67. package/lib/commands/dataset/extend-update.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.d.ts +15 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/tables.js +1 -1
  97. package/lib/commands/db/test.js +1 -1
  98. package/lib/commands/db/update.js +1 -1
  99. package/lib/commands/doctor.js +1 -1
  100. package/lib/commands/file/index.js +1 -1
  101. package/lib/commands/init/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/shared.js +1 -1
  112. package/lib/commands/kb/update.js +1 -1
  113. package/lib/commands/logs/index.js +1 -1
  114. package/lib/commands/menu/asset-update.js +1 -1
  115. package/lib/commands/menu/delete.js +1 -1
  116. package/lib/commands/menu/external-link-create.js +1 -1
  117. package/lib/commands/menu/external-link-update.js +1 -1
  118. package/lib/commands/menu/group-create.js +1 -1
  119. package/lib/commands/menu/group-update.js +1 -1
  120. package/lib/commands/menu/index.js +1 -1
  121. package/lib/commands/menu/list.js +1 -1
  122. package/lib/commands/menu/move.js +1 -1
  123. package/lib/commands/menu/regroup-start.js +1 -1
  124. package/lib/commands/menu/rename.js +1 -1
  125. package/lib/commands/menu/shared/compare-table.js +1 -1
  126. package/lib/commands/menu/shared/delete-plan.js +1 -1
  127. package/lib/commands/menu/shared/facts.js +1 -1
  128. package/lib/commands/menu/shared/index.js +1 -1
  129. package/lib/commands/menu/shared/inquirer.js +1 -1
  130. package/lib/commands/menu/shared/local-pages.js +1 -1
  131. package/lib/commands/menu/shared/logic.js +1 -1
  132. package/lib/commands/menu/shared/mutations.js +1 -1
  133. package/lib/commands/menu/shared/service.js +1 -1
  134. package/lib/commands/menu/shared/sync-core.js +1 -1
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/generate-start.js +1 -1
  146. package/lib/commands/page/generate-status.js +1 -1
  147. package/lib/commands/page/index.js +1 -1
  148. package/lib/commands/page/pull.js +1 -1
  149. package/lib/commands/page/push.js +1 -1
  150. package/lib/commands/page/react/create.js +1 -1
  151. package/lib/commands/page/react/detail.js +1 -1
  152. package/lib/commands/page/react/list.js +1 -1
  153. package/lib/commands/page/react/publish.js +1 -1
  154. package/lib/commands/page/react/shared.js +1 -1
  155. package/lib/commands/page/react/syntax.js +1 -1
  156. package/lib/commands/page/react/template.js +1 -1
  157. package/lib/commands/page/react/update.js +1 -1
  158. package/lib/commands/page/relation-audit.js +1 -1
  159. package/lib/commands/page/restore.js +1 -1
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.d.ts +15 -17
  181. package/lib/commands/role/shared.js +1 -1
  182. package/lib/commands/role/update.js +1 -1
  183. package/lib/commands/role/user-add.js +1 -1
  184. package/lib/commands/role/user-remove.js +1 -1
  185. package/lib/commands/role/user-resolve.js +1 -1
  186. package/lib/commands/run/index.js +1 -1
  187. package/lib/commands/schema.js +1 -1
  188. package/lib/commands/sql/create.js +1 -1
  189. package/lib/commands/sql/delete.js +1 -1
  190. package/lib/commands/sql/detail.js +1 -1
  191. package/lib/commands/sql/exec.js +1 -1
  192. package/lib/commands/sql/index.js +1 -1
  193. package/lib/commands/sql/list.js +1 -1
  194. package/lib/commands/sql/pull.js +1 -1
  195. package/lib/commands/sql/push.js +1 -1
  196. package/lib/commands/sql/shared.js +1 -1
  197. package/lib/commands/sql/status.js +1 -1
  198. package/lib/commands/sql/validate.js +1 -1
  199. package/lib/commands/task/index.js +1 -1
  200. package/lib/commands/task/status.js +1 -1
  201. package/lib/commands/tenant/index.js +1 -1
  202. package/lib/commands/tenant/members-list.js +1 -1
  203. package/lib/commands/tenant/shared.js +1 -1
  204. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  205. package/lib/commands/user-account/index.js +1 -1
  206. package/lib/commands/workspace/add.js +1 -1
  207. package/lib/commands/workspace/index.js +1 -1
  208. package/lib/commands/workspace/remove.js +1 -1
  209. package/lib/config/schema.js +1 -1
  210. package/lib/constant/cdn.js +1 -1
  211. package/lib/constant/cli.js +1 -1
  212. package/lib/constant/defaults.js +1 -1
  213. package/lib/constant/domain.js +1 -1
  214. package/lib/constant/env.js +1 -1
  215. package/lib/constant/output.js +1 -1
  216. package/lib/constant/paths.js +1 -1
  217. package/lib/constant/risk.js +1 -1
  218. package/lib/context/app-resolver.js +1 -1
  219. package/lib/context/auth-resolver.js +1 -1
  220. package/lib/context/config-loader.js +1 -1
  221. package/lib/context.js +1 -1
  222. package/lib/core/alias-resolver.js +1 -1
  223. package/lib/core/api-client.d.ts +70 -79
  224. package/lib/core/api-client.js +1 -1
  225. package/lib/core/bff/config.js +1 -1
  226. package/lib/core/bff/file-system.d.ts +1 -0
  227. package/lib/core/bff/file-system.js +1 -1
  228. package/lib/core/bff/hash.js +1 -1
  229. package/lib/core/bff/lock.js +1 -1
  230. package/lib/core/bff/utils.js +1 -1
  231. package/lib/core/db-resolver.js +1 -1
  232. package/lib/core/page/file-system.js +1 -1
  233. package/lib/core/page/hash.js +1 -1
  234. package/lib/core/page/lock.js +1 -1
  235. package/lib/core/sql-index-auditor.js +1 -1
  236. package/lib/core/sql-sync/config.js +1 -1
  237. package/lib/core/sql-sync/file-system.js +1 -1
  238. package/lib/core/sql-sync/hash.js +1 -1
  239. package/lib/core/sql-sync/lock.js +1 -1
  240. package/lib/core/sql-sync/utils.js +1 -1
  241. package/lib/core/sql-validator.js +1 -1
  242. package/lib/errors.js +1 -1
  243. package/lib/framework/build-all-flags.js +1 -1
  244. package/lib/framework/error-output.js +1 -1
  245. package/lib/framework/explicit-yes.js +1 -1
  246. package/lib/framework/flags.js +1 -1
  247. package/lib/framework/help.js +1 -1
  248. package/lib/framework/index.js +1 -1
  249. package/lib/framework/output.js +1 -1
  250. package/lib/framework/response.js +1 -1
  251. package/lib/framework/runner-alias.js +1 -1
  252. package/lib/framework/runner.js +1 -1
  253. package/lib/framework/schema-export.js +1 -1
  254. package/lib/framework/types.js +1 -1
  255. package/lib/generated/build-info.d.ts +4 -4
  256. package/lib/generated/build-info.js +1 -1
  257. package/lib/help.js +1 -1
  258. package/lib/postinstall.js +1 -1
  259. package/lib/runtime/confirmation.js +1 -1
  260. package/lib/runtime/event.js +1 -1
  261. package/lib/runtime/index.js +1 -1
  262. package/lib/runtime/queue.js +1 -1
  263. package/lib/runtime/resolve.js +1 -1
  264. package/lib/skills/builtin-skill.js +1 -1
  265. package/lib/skills/main.js +1 -1
  266. package/lib/skills/npx-skills-add.js +1 -1
  267. package/lib/skills/skill-presence.js +1 -1
  268. package/lib/telemetry/cli-command-trace.js +1 -1
  269. package/lib/telemetry/cli-help-trace.js +1 -1
  270. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  271. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  272. package/lib/telemetry/send-cli-trace-log.js +1 -1
  273. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  274. package/lib/utils/ai_config.js +1 -1
  275. package/lib/utils/apply-jq-filter.js +1 -1
  276. package/lib/utils/cdn-config.js +1 -1
  277. package/lib/utils/check-sdk-version.js +1 -1
  278. package/lib/utils/cli-version-check.js +1 -1
  279. package/lib/utils/cli-version-policy.js +1 -1
  280. package/lib/utils/config.js +1 -1
  281. package/lib/utils/entity-with-id.js +1 -1
  282. package/lib/utils/file-utils.js +1 -1
  283. package/lib/utils/guides-cdn.js +1 -1
  284. package/lib/utils/http-client.js +1 -1
  285. package/lib/utils/is-non-interactive.js +1 -1
  286. package/lib/utils/logger.js +1 -1
  287. package/lib/utils/params.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/rules-cdn.js +1 -1
  290. package/lib/utils/sleep.js +1 -1
  291. package/lib/utils/template-replacer.js +1 -1
  292. package/lib/utils/update-notice.js +1 -1
  293. package/lib/utils/version.js +1 -1
  294. package/lib/utils/with-active-cookie.js +1 -1
  295. package/lib/utils/write-cli-side-channel.js +1 -1
  296. package/package.json +1 -1
  297. package/skills/rabetbase/SKILL.md +18 -24
  298. package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
  299. package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
  300. package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
  301. package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
  302. package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
  303. package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
  304. package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
  305. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
  306. package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
  307. package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
  308. package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
  309. package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
  310. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  311. package/skills/rabetbase.manifest.json +4 -7
  312. package/lib/commands/permit/index.js +0 -1
  313. package/lib/commands/permit/page-get.d.ts +0 -2
  314. package/lib/commands/permit/page-get.js +0 -1
  315. package/lib/commands/permit/page-set.d.ts +0 -2
  316. package/lib/commands/permit/page-set.js +0 -1
  317. package/lib/commands/permit/role-apis-set.d.ts +0 -2
  318. package/lib/commands/permit/role-apis-set.js +0 -1
  319. package/lib/commands/permit/role-menus-set.d.ts +0 -2
  320. package/lib/commands/permit/role-menus-set.js +0 -1
  321. package/lib/commands/permit/role-menus.d.ts +0 -2
  322. package/lib/commands/permit/role-menus.js +0 -1
  323. package/lib/commands/permit/shared.d.ts +0 -74
  324. package/lib/commands/permit/shared.js +0 -1
  325. package/lib/commands/role/create.d.ts +0 -2
  326. package/lib/commands/role/create.js +0 -1
  327. package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
  328. package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
  329. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
  330. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +0 -57
@@ -1 +1 @@
1
- const a198_0x8130a9=a198_0x3f84;(function(_0x279125,_0x534fe8){const _0x2d16b4=a198_0x3f84,_0xc42f47=_0x279125();while(!![]){try{const _0x576a36=parseInt(_0x2d16b4(0x138))/0x1+parseInt(_0x2d16b4(0x136))/0x2*(parseInt(_0x2d16b4(0x135))/0x3)+parseInt(_0x2d16b4(0x168))/0x4+-parseInt(_0x2d16b4(0x164))/0x5*(-parseInt(_0x2d16b4(0x137))/0x6)+parseInt(_0x2d16b4(0x142))/0x7+parseInt(_0x2d16b4(0x157))/0x8*(-parseInt(_0x2d16b4(0x172))/0x9)+parseInt(_0x2d16b4(0x167))/0xa*(-parseInt(_0x2d16b4(0x14c))/0xb);if(_0x576a36===_0x534fe8)break;else _0xc42f47['push'](_0xc42f47['shift']());}catch(_0x55787c){_0xc42f47['push'](_0xc42f47['shift']());}}}(a198_0x4df4,0x7228c));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a198_0x4df4(){const _0x240c2d=['trashDir','9375872kDThrj','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','length','Push\x20complete:\x20','sqlRoot','Local\x20directory\x20\x22','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','get','\x20skipped,\x20','236744DufNoo','sqls','force','dbDirectory','No\x20local\x20SQL\x20files\x20found.','filter','push','sqlCode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRootDir','replace','dbId','Push\x20local\x20SQL\x20files\x20to\x20remote','4260035NCGcnG','toISOString','mode','30wLyvnB','2435980Lqnpmr','appCode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sql','sqlName','lockFilePath','write','catch','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','27eYsrSn','map','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','set','exec','message','entries','relativePath','filePath','1611717NRPVyM','2byEsLA','6hyMqDk','684441yDaScK','\x20pushed,\x20','hash','sqlcode','remoteId','validation','/smartapi/custom/updateUserCustomSql','join','\x20SQL\x20file(s)','path','3015243axJLCM','boolean','utf8','POST','Would\x20push\x20','dbName','No\x20database\x20matches\x20local\x20directory\x20\x22','startsWith','lastSync'];a198_0x4df4=function(){return _0x240c2d;};return a198_0x4df4();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a198_0x3f84(_0x1c3eb0,_0x3b285a){_0x1c3eb0=_0x1c3eb0-0x135;const _0x4df429=a198_0x4df4();let _0x3f8453=_0x4df429[_0x1c3eb0];return _0x3f8453;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x234fe2,_0x5ae8cb,_0x41e129){const _0x1377fe=a198_0x3f84,_0x21a57a=await scanLocalSqlQueries(_0x234fe2),_0x56a61e=new Map();for(const _0x135516 of _0x21a57a){if(_0x41e129&&_0x135516[_0x1377fe(0x15e)]!==_0x41e129)continue;const _0xab4030=_0x56a61e[_0x1377fe(0x155)](_0x135516['sqlCode'])??[];_0xab4030['push'](_0x135516),_0x56a61e[_0x1377fe(0x175)](_0x135516[_0x1377fe(0x15e)],_0xab4030);}if(_0x41e129&&!_0x56a61e['has'](_0x41e129))throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14d)+_0x41e129);const _0x3eb7ef=[];for(const [_0x1b552f,_0xf0a761]of _0x56a61e[_0x1377fe(0x178)]()){if(_0xf0a761[_0x1377fe(0x14f)]===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0xf0a761[0x0]);continue;}const _0x383bf1=_0x5ae8cb[_0x1377fe(0x158)][_0x1b552f],_0x2483a8=_0x383bf1?.[_0x1377fe(0x141)],_0x8f0848=_0x2483a8?_0xf0a761['filter'](_0x2133d8=>_0x2133d8[_0x1377fe(0x179)]!==_0x2483a8):_0xf0a761;if(_0x383bf1&&_0x8f0848['length']===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0x8f0848[0x0]);continue;}throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14e)+_0x1b552f+_0x1377fe(0x15f));}return _0x3eb7ef;}export const sqlPush={'service':a198_0x8130a9(0x16b),'command':'push','description':a198_0x8130a9(0x163),'risk':a198_0x8130a9(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a198_0x8130a9(0x159),'type':a198_0x8130a9(0x143),'description':a198_0x8130a9(0x174)}],async 'dryRun'(_0x3491f1){const _0x404db9=a198_0x8130a9,_0x23b065=loadSqlProjectConfig(_0x3491f1[_0x404db9(0x169)]),_0x296622=await readSqlLockFile(_0x23b065[_0x404db9(0x16d)]),{appLock:_0x81ca33}=ensureSqlLockScope(_0x296622??createEmptySqlLock(),_0x3491f1[_0x404db9(0x169)],_0x23b065['sqlRoot'],'push'),_0x4bd504=await getTargetSqlQueries(_0x23b065,_0x81ca33,_0x3491f1['str'](_0x404db9(0x13b))||undefined),_0xc1259=[];for(const _0x2c22a7 of _0x4bd504){const _0x268156=await computeSqlFileHash(_0x2c22a7[_0x404db9(0x17a)]),_0x2c65b9=_0x81ca33['sqls'][_0x2c22a7[_0x404db9(0x15e)]],_0x3f9272=!!_0x2c65b9&&(_0x2c65b9[_0x404db9(0x141)]!==_0x2c22a7[_0x404db9(0x179)]||!!_0x2c22a7[_0x404db9(0x16c)]&&_0x2c65b9[_0x404db9(0x16c)]!==_0x2c22a7[_0x404db9(0x16c)]);if(!_0x3491f1[_0x404db9(0x153)](_0x404db9(0x159))&&_0x2c65b9&&_0x2c65b9['hash']===_0x268156&&!_0x3f9272)continue;_0xc1259[_0x404db9(0x15d)](_0x2c22a7[_0x404db9(0x15e)]);}return{'method':_0x404db9(0x145),'url':_0x404db9(0x13e),'body':{'sqlCodes':_0xc1259,'appCode':_0x3491f1[_0x404db9(0x169)]},'description':_0x404db9(0x146)+_0xc1259['length']+_0x404db9(0x140)};},async 'execute'(_0xa07ee5){const _0x1d9240=a198_0x8130a9,_0x52837a=loadSqlProjectConfig(_0xa07ee5['appCode']),_0x364539=await readSqlLockFile(_0x52837a[_0x1d9240(0x16d)]),{lockData:_0x4b978b,appLock:_0x29fe57}=ensureSqlLockScope(_0x364539??createEmptySqlLock(),_0xa07ee5[_0x1d9240(0x169)],_0x52837a[_0x1d9240(0x151)],_0x1d9240(0x15d)),_0x174d95=await getTargetSqlQueries(_0x52837a,_0x29fe57,_0xa07ee5['str']('sqlcode')||undefined);if(_0x174d95[_0x1d9240(0x14f)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x1d9240(0x15b)};const _0x1bdfb4=[],_0x3316fa=[],_0x510da0=[];for(const _0x28b734 of _0x174d95){const _0x5d87e3=_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']];if(!_0x5d87e3){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x154)});continue;}try{const _0x12c83e=await computeSqlFileHash(_0x28b734[_0x1d9240(0x17a)]),_0x1490f9=_0x5d87e3['path']!==_0x28b734[_0x1d9240(0x179)]||!!_0x28b734[_0x1d9240(0x16c)]&&_0x5d87e3['sqlName']!==_0x28b734['sqlName'];if(!_0xa07ee5[_0x1d9240(0x153)](_0x1d9240(0x159))&&_0x5d87e3[_0x1d9240(0x13a)]===_0x12c83e&&!_0x1490f9){_0x3316fa[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'reason':'unchanged'});continue;}if(_0x5d87e3['version']==null){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x16a)});continue;}const _0x265b42=await readFile(_0x28b734[_0x1d9240(0x17a)],_0x1d9240(0x144)),_0x52f0cd=stripLocalSqlMetadata(_0x265b42,_0x28b734[_0x1d9240(0x166)]),_0x240165=_0x28b734[_0x1d9240(0x16c)]||_0x5d87e3[_0x1d9240(0x16c)],_0x36ee64=await resolveTargetDbBinding(_0xa07ee5[_0x1d9240(0x169)],_0x28b734,_0x5d87e3),_0xe157e5=await updateSqlQuery({'id':_0x5d87e3[_0x1d9240(0x13c)],'appCode':_0xa07ee5[_0x1d9240(0x169)],'sqlCode':_0x28b734[_0x1d9240(0x15e)],'sqlName':_0x240165,'dbId':_0x36ee64[_0x1d9240(0x162)],'version':_0x5d87e3['version'],'sqlContent':_0x52f0cd,'sqlConfig':_0x5d87e3['sqlConfig']??undefined}),_0x38b54b=_0xe157e5[_0x1d9240(0x162)]?await getDbName(_0xa07ee5[_0x1d9240(0x169)],Number(_0xe157e5[_0x1d9240(0x162)]))[_0x1d9240(0x16f)](()=>_0x36ee64[_0x1d9240(0x147)]):_0x36ee64[_0x1d9240(0x147)];_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']]={...buildSqlLockEntry(_0xe157e5,_0x52f0cd,_0x12c83e,{'dbName':_0x38b54b}),'path':_0x28b734[_0x1d9240(0x179)],'mode':_0x5d87e3[_0x1d9240(0x166)]},await archivePreviousSqlFileIfNeeded(_0x52837a,_0x5d87e3[_0x1d9240(0x141)],_0x28b734[_0x1d9240(0x179)]),_0x1bdfb4['push']({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'remoteId':_0x5d87e3[_0x1d9240(0x13c)]});}catch(_0x24b2e6){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x24b2e6 instanceof Error?_0x24b2e6[_0x1d9240(0x177)]:String(_0x24b2e6)});}}return _0x29fe57[_0x1d9240(0x14a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x52837a[_0x1d9240(0x16d)],_0x4b978b),{'ok':_0x510da0[_0x1d9240(0x14f)]===0x0,'data':{'pushed':_0x1bdfb4,'skipped':_0x3316fa,'failed':_0x510da0},'message':_0x1d9240(0x150)+_0x1bdfb4[_0x1d9240(0x14f)]+_0x1d9240(0x139)+_0x3316fa[_0x1d9240(0x14f)]+_0x1d9240(0x156)+_0x510da0[_0x1d9240(0x14f)]+_0x1d9240(0x170)};}};async function archivePreviousSqlFileIfNeeded(_0x48c3ab,_0x1a6df2,_0x4de8f0){const _0x3cd742=a198_0x8130a9;if(!_0x1a6df2||_0x1a6df2===_0x4de8f0)return;const _0x238a03=join(_0x48c3ab['sqlRootDir'],_0x1a6df2);if(!await fileExists(_0x238a03))return;const _0x2606e3=await moveToTrash(_0x48c3ab['projectRoot'],_0x48c3ab[_0x3cd742(0x14b)],_0x238a03);await cleanupEmptyDirectories(dirname(_0x238a03),_0x48c3ab[_0x3cd742(0x160)]),void _0x2606e3;}async function moveToTrash(_0x4f19cb,_0x7c6537,_0x1b09a3){const _0x1dce91=a198_0x8130a9,_0xfa336b=new Date()[_0x1dce91(0x165)]()[_0x1dce91(0x161)](/[:.]/g,'-'),_0xef8a6f=relative(_0x4f19cb,_0x1b09a3),_0x3b3716=join(_0x7c6537,_0xfa336b,_0xef8a6f);return await mkdir(dirname(_0x3b3716),{'recursive':!![]}),await rename(_0x1b09a3,_0x3b3716),_0x3b3716;}async function cleanupEmptyDirectories(_0x81ce22,_0x4be9cc){const _0x446418=a198_0x8130a9;let _0x411427=resolve(_0x81ce22);const _0x5da06c=resolve(_0x4be9cc);while(_0x411427[_0x446418(0x149)](''+_0x5da06c+sep)||_0x411427===_0x5da06c){if(_0x411427===_0x5da06c)return;try{const _0x12ed32=await readdir(_0x411427);if(_0x12ed32['length']>0x0)return;await rmdir(_0x411427);}catch{return;}_0x411427=dirname(_0x411427);}}async function resolveTargetDbBinding(_0x365d35,_0x29c742,_0x23c93){const _0x35e841=a198_0x8130a9,_0x552e79=_0x29c742[_0x35e841(0x15a)];if(!_0x552e79)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0x32a2ae=buildDbDirectoryName(_0x23c93[_0x35e841(0x147)],_0x23c93['dbId']);if(_0x552e79===_0x32a2ae)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0xc5b942=parseExplicitDbDirectory(_0x552e79);if(_0xc5b942!=null)return{'dbId':_0xc5b942,'dbName':await getDbName(_0x365d35,_0xc5b942)[_0x35e841(0x16f)](()=>undefined)};const _0x502a15=await listDatabases(_0x365d35),_0x41e836=_0x502a15[_0x35e841(0x15c)](_0xbdcddb=>buildDbDirectoryName(_0xbdcddb['dbName'],_0xbdcddb['dbId'])===_0x552e79);if(_0x41e836[_0x35e841(0x14f)]===0x1)return{'dbId':_0x41e836[0x0][_0x35e841(0x162)],'dbName':_0x41e836[0x0][_0x35e841(0x147)]};if(_0x41e836[_0x35e841(0x14f)]===0x0)throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x148)+_0x552e79+'\x22\x20for\x20sqlCode\x20'+_0x29c742[_0x35e841(0x15e)]+'.');const _0x3cc6c7=_0x41e836[_0x35e841(0x173)](_0x5c6a06=>_0x5c6a06[_0x35e841(0x147)]+'\x20('+_0x5c6a06[_0x35e841(0x162)]+')')[_0x35e841(0x13f)](',\x20');throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x152)+_0x552e79+_0x35e841(0x171)+_0x29c742[_0x35e841(0x15e)]+':\x20'+_0x3cc6c7);}function parseExplicitDbDirectory(_0x4c4bdf){const _0x2cdfb6=a198_0x8130a9,_0x36f317=/^db-(\d+)$/[_0x2cdfb6(0x176)](_0x4c4bdf);if(!_0x36f317)return null;const _0x1e56ff=Number(_0x36f317[0x1]);return Number['isFinite'](_0x1e56ff)&&_0x1e56ff>0x0?_0x1e56ff:null;}
1
+ const a191_0x445a58=a191_0x5960;(function(_0x446792,_0x132c10){const _0x54faaf=a191_0x5960,_0x928946=_0x446792();while(!![]){try{const _0x47aa6c=parseInt(_0x54faaf(0x1ed))/0x1*(-parseInt(_0x54faaf(0x1dd))/0x2)+-parseInt(_0x54faaf(0x1c6))/0x3+parseInt(_0x54faaf(0x1ba))/0x4*(parseInt(_0x54faaf(0x1ee))/0x5)+parseInt(_0x54faaf(0x1d2))/0x6*(parseInt(_0x54faaf(0x1c2))/0x7)+-parseInt(_0x54faaf(0x1df))/0x8*(-parseInt(_0x54faaf(0x1b1))/0x9)+parseInt(_0x54faaf(0x1d1))/0xa+-parseInt(_0x54faaf(0x1b2))/0xb;if(_0x47aa6c===_0x132c10)break;else _0x928946['push'](_0x928946['shift']());}catch(_0x5b3e0b){_0x928946['push'](_0x928946['shift']());}}}(a191_0x19c2,0x62b15));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a191_0x5960(_0x126de7,_0x3443b1){_0x126de7=_0x126de7-0x1ab;const _0x19c235=a191_0x19c2();let _0x59608c=_0x19c235[_0x126de7];return _0x59608c;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x102d4e,_0x470bef,_0x1757c3){const _0x29540b=a191_0x5960,_0x5c46d6=await scanLocalSqlQueries(_0x102d4e),_0x5070ec=new Map();for(const _0x22f8e0 of _0x5c46d6){if(_0x1757c3&&_0x22f8e0[_0x29540b(0x1ea)]!==_0x1757c3)continue;const _0x1a73da=_0x5070ec['get'](_0x22f8e0[_0x29540b(0x1ea)])??[];_0x1a73da['push'](_0x22f8e0),_0x5070ec[_0x29540b(0x1c3)](_0x22f8e0['sqlCode'],_0x1a73da);}if(_0x1757c3&&!_0x5070ec[_0x29540b(0x1e2)](_0x1757c3))throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1b3)+_0x1757c3);const _0x5572ef=[];for(const [_0x1fb43d,_0x15c68e]of _0x5070ec[_0x29540b(0x1eb)]()){if(_0x15c68e['length']===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x15c68e[0x0]);continue;}const _0x223e5b=_0x470bef[_0x29540b(0x1ef)][_0x1fb43d],_0x3310e6=_0x223e5b?.[_0x29540b(0x1b5)],_0x4080eb=_0x3310e6?_0x15c68e[_0x29540b(0x1ac)](_0x5e0a69=>_0x5e0a69[_0x29540b(0x1d6)]!==_0x3310e6):_0x15c68e;if(_0x223e5b&&_0x4080eb[_0x29540b(0x1c1)]===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x4080eb[0x0]);continue;}throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1ab)+_0x1fb43d+_0x29540b(0x1d4));}return _0x5572ef;}export const sqlPush={'service':a191_0x445a58(0x1cb),'command':a191_0x445a58(0x1cd),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x445a58(0x1ca),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a191_0x445a58(0x1b9),'description':a191_0x445a58(0x1ae)}],async 'dryRun'(_0x343567){const _0xd9946a=a191_0x445a58,_0x19fd5b=loadSqlProjectConfig(_0x343567[_0xd9946a(0x1d0)]),_0x3abd2c=await readSqlLockFile(_0x19fd5b[_0xd9946a(0x1c7)]),{appLock:_0x128f4b}=ensureSqlLockScope(_0x3abd2c??createEmptySqlLock(),_0x343567[_0xd9946a(0x1d0)],_0x19fd5b[_0xd9946a(0x1d9)],_0xd9946a(0x1cd)),_0x6e6ada=await getTargetSqlQueries(_0x19fd5b,_0x128f4b,_0x343567[_0xd9946a(0x1b4)](_0xd9946a(0x1c8))||undefined),_0x59deb2=[];for(const _0x8028d3 of _0x6e6ada){const _0x97b16f=await computeSqlFileHash(_0x8028d3[_0xd9946a(0x1da)]),_0x15d8c1=_0x128f4b['sqls'][_0x8028d3[_0xd9946a(0x1ea)]],_0x18c675=!!_0x15d8c1&&(_0x15d8c1[_0xd9946a(0x1b5)]!==_0x8028d3['relativePath']||!!_0x8028d3[_0xd9946a(0x1e1)]&&_0x15d8c1[_0xd9946a(0x1e1)]!==_0x8028d3[_0xd9946a(0x1e1)]);if(!_0x343567[_0xd9946a(0x1c9)](_0xd9946a(0x1cc))&&_0x15d8c1&&_0x15d8c1[_0xd9946a(0x1ec)]===_0x97b16f&&!_0x18c675)continue;_0x59deb2[_0xd9946a(0x1cd)](_0x8028d3['sqlCode']);}return{'method':_0xd9946a(0x1e7),'url':_0xd9946a(0x1e8),'body':{'sqlCodes':_0x59deb2,'appCode':_0x343567[_0xd9946a(0x1d0)]},'description':_0xd9946a(0x1b6)+_0x59deb2[_0xd9946a(0x1c1)]+_0xd9946a(0x1bd)};},async 'execute'(_0x23e476){const _0x35d804=a191_0x445a58,_0x1d5c32=loadSqlProjectConfig(_0x23e476['appCode']),_0x3b33db=await readSqlLockFile(_0x1d5c32['lockFilePath']),{lockData:_0x270c11,appLock:_0x173a63}=ensureSqlLockScope(_0x3b33db??createEmptySqlLock(),_0x23e476[_0x35d804(0x1d0)],_0x1d5c32[_0x35d804(0x1d9)],_0x35d804(0x1cd)),_0x1a2f76=await getTargetSqlQueries(_0x1d5c32,_0x173a63,_0x23e476['str']('sqlcode')||undefined);if(_0x1a2f76[_0x35d804(0x1c1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x35d804(0x1c4)};const _0x6eeb4e=[],_0x1a28b3=[],_0x561048=[];for(const _0xd646ab of _0x1a2f76){const _0x534851=_0x173a63['sqls'][_0xd646ab['sqlCode']];if(!_0x534851){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x35d804(0x1c5)});continue;}try{const _0x22486a=await computeSqlFileHash(_0xd646ab[_0x35d804(0x1da)]),_0x3e7fa6=_0x534851[_0x35d804(0x1b5)]!==_0xd646ab[_0x35d804(0x1d6)]||!!_0xd646ab['sqlName']&&_0x534851[_0x35d804(0x1e1)]!==_0xd646ab[_0x35d804(0x1e1)];if(!_0x23e476[_0x35d804(0x1c9)](_0x35d804(0x1cc))&&_0x534851[_0x35d804(0x1ec)]===_0x22486a&&!_0x3e7fa6){_0x1a28b3['push']({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'reason':_0x35d804(0x1af)});continue;}if(_0x534851[_0x35d804(0x1e0)]==null){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x12c5ab=await readFile(_0xd646ab[_0x35d804(0x1da)],_0x35d804(0x1de)),_0x5def3a=stripLocalSqlMetadata(_0x12c5ab,_0xd646ab['mode']),_0x26d1b3=_0xd646ab[_0x35d804(0x1e1)]||_0x534851[_0x35d804(0x1e1)],_0x2c5f10=await resolveTargetDbBinding(_0x23e476[_0x35d804(0x1d0)],_0xd646ab,_0x534851),_0x10a802=await updateSqlQuery({'id':_0x534851[_0x35d804(0x1d3)],'appCode':_0x23e476[_0x35d804(0x1d0)],'sqlCode':_0xd646ab['sqlCode'],'sqlName':_0x26d1b3,'dbId':_0x2c5f10[_0x35d804(0x1d5)],'version':_0x534851['version'],'sqlContent':_0x5def3a,'sqlConfig':_0x534851[_0x35d804(0x1e5)]??undefined}),_0x5b34ef=_0x10a802['dbId']?await getDbName(_0x23e476['appCode'],Number(_0x10a802['dbId']))['catch'](()=>_0x2c5f10[_0x35d804(0x1b0)]):_0x2c5f10['dbName'];_0x173a63[_0x35d804(0x1ef)][_0xd646ab[_0x35d804(0x1ea)]]={...buildSqlLockEntry(_0x10a802,_0x5def3a,_0x22486a,{'dbName':_0x5b34ef}),'path':_0xd646ab['relativePath'],'mode':_0x534851[_0x35d804(0x1ce)]},await archivePreviousSqlFileIfNeeded(_0x1d5c32,_0x534851[_0x35d804(0x1b5)],_0xd646ab[_0x35d804(0x1d6)]),_0x6eeb4e[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'remoteId':_0x534851['remoteId']});}catch(_0x2f49a0){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x2f49a0 instanceof Error?_0x2f49a0[_0x35d804(0x1f0)]:String(_0x2f49a0)});}}return _0x173a63[_0x35d804(0x1cf)]=new Date()[_0x35d804(0x1bf)](),await writeSqlLockFile(_0x1d5c32[_0x35d804(0x1c7)],_0x270c11),{'ok':_0x561048['length']===0x0,'data':{'pushed':_0x6eeb4e,'skipped':_0x1a28b3,'failed':_0x561048},'message':_0x35d804(0x1c0)+_0x6eeb4e[_0x35d804(0x1c1)]+_0x35d804(0x1f1)+_0x1a28b3[_0x35d804(0x1c1)]+_0x35d804(0x1e6)+_0x561048[_0x35d804(0x1c1)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2d4db9,_0x43a7a4,_0xf0d7c1){const _0x206bcd=a191_0x445a58;if(!_0x43a7a4||_0x43a7a4===_0xf0d7c1)return;const _0x550b75=join(_0x2d4db9['sqlRootDir'],_0x43a7a4);if(!await fileExists(_0x550b75))return;const _0x53a5b9=await moveToTrash(_0x2d4db9['projectRoot'],_0x2d4db9[_0x206bcd(0x1dc)],_0x550b75);await cleanupEmptyDirectories(dirname(_0x550b75),_0x2d4db9[_0x206bcd(0x1bc)]),void _0x53a5b9;}async function moveToTrash(_0x4b0bd6,_0x8f60d0,_0x1976fe){const _0x4743a3=a191_0x445a58,_0x3c9f6d=new Date()[_0x4743a3(0x1bf)]()[_0x4743a3(0x1b7)](/[:.]/g,'-'),_0x43b2df=relative(_0x4b0bd6,_0x1976fe),_0x202c14=join(_0x8f60d0,_0x3c9f6d,_0x43b2df);return await mkdir(dirname(_0x202c14),{'recursive':!![]}),await rename(_0x1976fe,_0x202c14),_0x202c14;}function a191_0x19c2(){const _0x518b5c=['.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','relativePath','map','exec','sqlRoot','filePath','Local\x20directory\x20\x22','trashDir','1696VBeobr','utf8','272Abqemw','version','sqlName','has','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','validation','sqlConfig','\x20skipped,\x20','POST','/smartapi/custom/updateUserCustomSql','\x22\x20for\x20sqlCode\x20','sqlCode','entries','hash','21iYtIQt','259085fhsTOQ','sqls','message','\x20pushed,\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filter','isFinite','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','unchanged','dbName','102519YSKXOp','17319665uKvIwf','Local\x20SQL\x20not\x20found:\x20','str','path','Would\x20push\x20','replace','No\x20database\x20matches\x20local\x20directory\x20\x22','boolean','44RnRnUr','join','sqlRootDir','\x20SQL\x20file(s)','dbDirectory','toISOString','Push\x20complete:\x20','length','14zeOcOw','set','No\x20local\x20SQL\x20files\x20found.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','30159AGUnxP','lockFilePath','sqlcode','bool','write','sql','force','push','mode','lastSync','appCode','5900900LVTIeB','1377750aMnrdW','remoteId'];a191_0x19c2=function(){return _0x518b5c;};return a191_0x19c2();}async function cleanupEmptyDirectories(_0x2c1acc,_0x127fd5){let _0x4e6f01=resolve(_0x2c1acc);const _0x57269c=resolve(_0x127fd5);while(_0x4e6f01['startsWith'](''+_0x57269c+sep)||_0x4e6f01===_0x57269c){if(_0x4e6f01===_0x57269c)return;try{const _0x2969f5=await readdir(_0x4e6f01);if(_0x2969f5['length']>0x0)return;await rmdir(_0x4e6f01);}catch{return;}_0x4e6f01=dirname(_0x4e6f01);}}async function resolveTargetDbBinding(_0x5dd1eb,_0x6245a,_0x34ef27){const _0x28dd48=a191_0x445a58,_0x149913=_0x6245a[_0x28dd48(0x1be)];if(!_0x149913)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0xfea5c8=buildDbDirectoryName(_0x34ef27[_0x28dd48(0x1b0)],_0x34ef27[_0x28dd48(0x1d5)]);if(_0x149913===_0xfea5c8)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0x115dfd=parseExplicitDbDirectory(_0x149913);if(_0x115dfd!=null)return{'dbId':_0x115dfd,'dbName':await getDbName(_0x5dd1eb,_0x115dfd)['catch'](()=>undefined)};const _0x1c8d6e=await listDatabases(_0x5dd1eb),_0x2f9cdb=_0x1c8d6e[_0x28dd48(0x1ac)](_0x2c7e29=>buildDbDirectoryName(_0x2c7e29[_0x28dd48(0x1b0)],_0x2c7e29[_0x28dd48(0x1d5)])===_0x149913);if(_0x2f9cdb[_0x28dd48(0x1c1)]===0x1)return{'dbId':_0x2f9cdb[0x0][_0x28dd48(0x1d5)],'dbName':_0x2f9cdb[0x0][_0x28dd48(0x1b0)]};if(_0x2f9cdb['length']===0x0)throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1b8)+_0x149913+_0x28dd48(0x1e9)+_0x6245a[_0x28dd48(0x1ea)]+'.');const _0x147e47=_0x2f9cdb[_0x28dd48(0x1d7)](_0x166e3d=>_0x166e3d[_0x28dd48(0x1b0)]+'\x20('+_0x166e3d[_0x28dd48(0x1d5)]+')')[_0x28dd48(0x1bb)](',\x20');throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1db)+_0x149913+_0x28dd48(0x1e3)+_0x6245a[_0x28dd48(0x1ea)]+':\x20'+_0x147e47);}function parseExplicitDbDirectory(_0xe45f6f){const _0x37683a=a191_0x445a58,_0x2d4cca=/^db-(\d+)$/[_0x37683a(0x1d8)](_0xe45f6f);if(!_0x2d4cca)return null;const _0x1e1ae4=Number(_0x2d4cca[0x1]);return Number[_0x37683a(0x1ad)](_0x1e1ae4)&&_0x1e1ae4>0x0?_0x1e1ae4:null;}
@@ -1 +1 @@
1
- const a199_0x7931c3=a199_0x4dd0;(function(_0x2c8131,_0x9391d9){const _0x4a8329=a199_0x4dd0,_0x362648=_0x2c8131();while(!![]){try{const _0x28c735=parseInt(_0x4a8329(0x115))/0x1*(parseInt(_0x4a8329(0x128))/0x2)+-parseInt(_0x4a8329(0x11e))/0x3*(parseInt(_0x4a8329(0x108))/0x4)+-parseInt(_0x4a8329(0x123))/0x5*(-parseInt(_0x4a8329(0x105))/0x6)+parseInt(_0x4a8329(0x118))/0x7*(-parseInt(_0x4a8329(0x110))/0x8)+-parseInt(_0x4a8329(0x111))/0x9*(-parseInt(_0x4a8329(0x11d))/0xa)+parseInt(_0x4a8329(0x122))/0xb+parseInt(_0x4a8329(0x126))/0xc*(-parseInt(_0x4a8329(0x109))/0xd);if(_0x28c735===_0x9391d9)break;else _0x362648['push'](_0x362648['shift']());}catch(_0x554f7a){_0x362648['push'](_0x362648['shift']());}}}(a199_0x468a,0x20f24));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a199_0x468a(){const _0x46ccc4=['70OvTCvm','sqlCode','close','.rabetbase/sql','\x20[y/N]\x20','20AqQKlf','3lvHkll','stderr','syncedAt','yes','2664156DEuHcb','5YWdfJZ','join','length','1116084VoLaxK','--\x20@lovrabet.','253700lYDUev','path','map','dbName','mybatisXml','filter','split','test','388536aAtVLt','<!--\x20@lovrabet.','sqlName','400852NcWZzy','13smxfPZ','description','apps','sqlContent','push','trim','dbId','156048qeyyNk','402417DMHXAS','version','\x20-->','lastSync','1yEAFgH','stdin','mode'];a199_0x468a=function(){return _0x46ccc4;};return a199_0x468a();}export const SQL_LOCAL_REL_DIR=a199_0x7931c3(0x11b);export function buildSqlLockEntry(_0xb20b3a,_0x39e01a,_0x5f314e,_0x5c1053){const _0x3c5ab7=a199_0x7931c3,_0x535b52=detectSqlMode(_0x39e01a);return{'path':buildSqlRelativePath(_0xb20b3a[_0x3c5ab7(0x119)],_0xb20b3a[_0x3c5ab7(0x107)],_0x5c1053?.[_0x3c5ab7(0x100)],_0x535b52,_0xb20b3a[_0x3c5ab7(0x10f)]),'hash':_0x5f314e,'remoteId':_0xb20b3a['id'],'version':_0xb20b3a[_0x3c5ab7(0x112)],'dbId':Number(_0xb20b3a[_0x3c5ab7(0x10f)]),'dbName':_0x5c1053?.[_0x3c5ab7(0x100)],'sqlName':_0xb20b3a[_0x3c5ab7(0x107)],'sqlConfig':_0xb20b3a['sqlConfig']??undefined,'mode':_0x535b52};}export function cloneSqlLockData(_0x3f081b){const _0x413565=a199_0x7931c3;return{'apps':Object['fromEntries'](Object['entries'](_0x3f081b[_0x413565(0x10b)])[_0x413565(0xff)](([_0x3f68f8,_0xa11a6e])=>[_0x3f68f8,{'sqlRoot':_0xa11a6e['sqlRoot'],'lastSync':_0xa11a6e[_0x413565(0x114)],'sqls':{..._0xa11a6e['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3ab31c){const _0x5b76ea=a199_0x7931c3;return _0x3ab31c[_0x5b76ea(0x10c)]??'';}function a199_0x4dd0(_0x1d0987,_0x1b6be9){_0x1d0987=_0x1d0987-0xff;const _0x468a9c=a199_0x468a();let _0x4dd023=_0x468a9c[_0x1d0987];return _0x4dd023;}export function buildLocalSqlFileContent(_0x197d25,_0x21211d,_0x16bd6b){const _0xad9d98=a199_0x7931c3,_0xb45b12=_0x16bd6b?.[_0xad9d98(0x117)]??detectSqlMode(_0x21211d),_0x25fab9=stripLocalSqlMetadata(_0x21211d,_0xb45b12)['trim'](),_0x3af4db=[...buildMetadataHeaderLines({'sqlCode':_0x197d25[_0xad9d98(0x119)],'sqlName':_0x197d25[_0xad9d98(0x107)],'dbId':_0x197d25[_0xad9d98(0x10f)],'dbName':_0x16bd6b?.[_0xad9d98(0x100)],'mode':_0xb45b12,'syncedAt':_0x16bd6b?.['syncedAt'],'description':_0x16bd6b?.[_0xad9d98(0x10a)]},_0xb45b12),'',_0x25fab9],_0x25f03e=_0x3af4db[_0xad9d98(0x124)]('\x0a');return _0x25f03e['endsWith']('\x0a')?_0x25f03e:_0x25f03e+'\x0a';}export function stripLocalSqlMetadata(_0x28e8b5,_0x23c416){const _0x2e2ef2=a199_0x7931c3,_0x3a4180=_0x28e8b5['replace'](/\r\n/g,'\x0a')[_0x2e2ef2(0x103)]('\x0a'),_0x418ae9=[];let _0xa1e290=0x0;if(_0x23c416===_0x2e2ef2(0x101))while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x3f5682=_0x3a4180[_0xa1e290]??'';if(/^\s*<!--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x3f5682)){_0xa1e290++;continue;}if(_0x3f5682[_0x2e2ef2(0x10e)]()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}else while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x11ca27=_0x3a4180[_0xa1e290]??'';if(/^\s*--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x11ca27)){_0xa1e290++;continue;}if(_0x11ca27['trim']()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}for(;_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)];_0xa1e290++){_0x418ae9[_0x2e2ef2(0x10d)](_0x3a4180[_0xa1e290]);}return _0x418ae9['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x4458af,_0x13dc7b){const _0x469645=a199_0x7931c3;if(_0x13dc7b?.[_0x469645(0x117)])return _0x13dc7b[_0x469645(0x117)];return detectSqlMode(_0x4458af);}export function resolveSqlFileName(_0x1e1e22,_0xa2c040,_0x4c7d06){const _0x46df0f=a199_0x7931c3;if(_0x4c7d06?.[_0x46df0f(0x129)])return _0x4c7d06[_0x46df0f(0x129)];if(_0x4c7d06?.[_0x46df0f(0x107)]||_0x4c7d06?.['dbName'])return buildSqlRelativePath(_0x1e1e22,_0x4c7d06?.[_0x46df0f(0x107)],_0x4c7d06?.[_0x46df0f(0x100)],resolveSqlMode(_0xa2c040,_0x4c7d06),_0x4c7d06?.['dbId']);return buildDefaultSqlFileName(_0x1e1e22,resolveSqlMode(_0xa2c040,_0x4c7d06));}export function resolveSqlLocalDir(_0x38d117,_0x2b6d6b){return join(_0x38d117,SQL_LOCAL_REL_DIR,_0x2b6d6b);}export async function confirmForceOverwrite(_0x288aa5){const _0x5bb283=a199_0x7931c3,_0x5ba4c9=createInterface({'input':process[_0x5bb283(0x116)],'output':process[_0x5bb283(0x11f)]}),_0x5919e2=await new Promise(_0x5c0591=>{const _0x20a92b=_0x5bb283;_0x5ba4c9['question'](_0x288aa5+_0x20a92b(0x11c),_0x5c0591);});return _0x5ba4c9[_0x5bb283(0x11a)](),['y',_0x5bb283(0x121)]['includes'](_0x5919e2[_0x5bb283(0x10e)]()['toLowerCase']());}export function findSqlLockScope(_0x5d90c8,_0xd1edfc){const _0x77f6f7=a199_0x7931c3;return _0x5d90c8[_0x77f6f7(0x10b)][_0xd1edfc];}function buildMetadataHeaderLines(_0x179e5a,_0x548032){const _0x48c0e9=a199_0x7931c3,_0x5c753e=[[_0x48c0e9(0x119),_0x179e5a[_0x48c0e9(0x119)]],[_0x48c0e9(0x107),_0x179e5a[_0x48c0e9(0x107)]],[_0x48c0e9(0x10f),_0x179e5a[_0x48c0e9(0x10f)]],[_0x48c0e9(0x100),_0x179e5a[_0x48c0e9(0x100)]],[_0x48c0e9(0x117),_0x179e5a[_0x48c0e9(0x117)]],[_0x48c0e9(0x120),_0x179e5a['syncedAt']],[_0x48c0e9(0x10a),_0x179e5a[_0x48c0e9(0x10a)]]];if(_0x548032==='mybatisXml')return _0x5c753e[_0x48c0e9(0x102)](([,_0x3e98db])=>_0x3e98db!==undefined&&_0x3e98db!==null&&String(_0x3e98db)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x16f2ac,_0x3d51c5])=>_0x48c0e9(0x106)+_0x16f2ac+':\x20'+String(_0x3d51c5)+_0x48c0e9(0x113));return _0x5c753e[_0x48c0e9(0x102)](([,_0x1323bb])=>_0x1323bb!==undefined&&_0x1323bb!==null&&String(_0x1323bb)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x7d0d0a,_0x47f7b6])=>_0x48c0e9(0x127)+_0x7d0d0a+':\x20'+String(_0x47f7b6));}
1
+ (function(_0xe45b9c,_0x24d27d){const _0x1a2a10=a192_0x16c7,_0x54f3e2=_0xe45b9c();while(!![]){try{const _0x24c913=parseInt(_0x1a2a10(0x127))/0x1*(parseInt(_0x1a2a10(0x134))/0x2)+-parseInt(_0x1a2a10(0x13c))/0x3*(parseInt(_0x1a2a10(0x11a))/0x4)+parseInt(_0x1a2a10(0x12f))/0x5*(-parseInt(_0x1a2a10(0x131))/0x6)+-parseInt(_0x1a2a10(0x13a))/0x7+parseInt(_0x1a2a10(0x11c))/0x8+parseInt(_0x1a2a10(0x125))/0x9+parseInt(_0x1a2a10(0x12e))/0xa*(parseInt(_0x1a2a10(0x11b))/0xb);if(_0x24c913===_0x24d27d)break;else _0x54f3e2['push'](_0x54f3e2['shift']());}catch(_0x73d1be){_0x54f3e2['push'](_0x54f3e2['shift']());}}}(a192_0x5481,0xceae9));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';function a192_0x16c7(_0x53a0aa,_0x501423){_0x53a0aa=_0x53a0aa-0x110;const _0x548139=a192_0x5481();let _0x16c73e=_0x548139[_0x53a0aa];return _0x16c73e;}function a192_0x5481(){const _0x4f7498=['2rWozSP','sqlName','sqlContent','mode','dbName','mybatisXml','6121962cIAhpK','apps','118977Udbuhs','path','stdin','yes','syncedAt','close','description','lastSync','includes','sqls','sqlCode','104GcVQwd','25219634BCQBrp','2995144DkcZmD','trim','entries','test','map','trimStart','\x20[y/N]\x20','sqlConfig','split','7963578tPnwBR','endsWith','550931EWEotC','filter','length','--\x20@lovrabet.','fromEntries','dbId','push','10cVZJxa','613905wLqfJL','sqlRoot','66mPAmwV','stderr','join'];a192_0x5481=function(){return _0x4f7498;};return a192_0x5481();}export function buildSqlLockEntry(_0x4bde7b,_0x194960,_0x12f177,_0x5d5e88){const _0x56b56a=a192_0x16c7,_0x2080a0=detectSqlMode(_0x194960);return{'path':buildSqlRelativePath(_0x4bde7b[_0x56b56a(0x119)],_0x4bde7b[_0x56b56a(0x135)],_0x5d5e88?.[_0x56b56a(0x138)],_0x2080a0,_0x4bde7b[_0x56b56a(0x12c)]),'hash':_0x12f177,'remoteId':_0x4bde7b['id'],'version':_0x4bde7b['version'],'dbId':Number(_0x4bde7b['dbId']),'dbName':_0x5d5e88?.[_0x56b56a(0x138)],'sqlName':_0x4bde7b[_0x56b56a(0x135)],'sqlConfig':_0x4bde7b[_0x56b56a(0x123)]??undefined,'mode':_0x2080a0};}export function cloneSqlLockData(_0xa28cc8){const _0xaa9680=a192_0x16c7;return{'apps':Object[_0xaa9680(0x12b)](Object[_0xaa9680(0x11e)](_0xa28cc8[_0xaa9680(0x13b)])[_0xaa9680(0x120)](([_0x27b6b,_0x400118])=>[_0x27b6b,{'sqlRoot':_0x400118[_0xaa9680(0x130)],'lastSync':_0x400118[_0xaa9680(0x116)],'sqls':{..._0x400118[_0xaa9680(0x118)]}}]))};}export function ensureRemoteSqlContent(_0x3e466c){const _0xcd3b6b=a192_0x16c7;return _0x3e466c[_0xcd3b6b(0x136)]??'';}export function buildLocalSqlFileContent(_0x10c68a,_0x1ba8d8,_0x2fae74){const _0x2ddf2e=a192_0x16c7,_0x2ad335=_0x2fae74?.[_0x2ddf2e(0x137)]??detectSqlMode(_0x1ba8d8),_0x1bbe7d=stripLocalSqlMetadata(_0x1ba8d8,_0x2ad335)[_0x2ddf2e(0x11d)](),_0x2e8c2c=[...buildMetadataHeaderLines({'sqlCode':_0x10c68a['sqlCode'],'sqlName':_0x10c68a[_0x2ddf2e(0x135)],'dbId':_0x10c68a[_0x2ddf2e(0x12c)],'dbName':_0x2fae74?.[_0x2ddf2e(0x138)],'mode':_0x2ad335,'syncedAt':_0x2fae74?.[_0x2ddf2e(0x113)],'description':_0x2fae74?.[_0x2ddf2e(0x115)]},_0x2ad335),'',_0x1bbe7d],_0x587547=_0x2e8c2c[_0x2ddf2e(0x133)]('\x0a');return _0x587547[_0x2ddf2e(0x126)]('\x0a')?_0x587547:_0x587547+'\x0a';}export function stripLocalSqlMetadata(_0x722588,_0x5cd4c5){const _0x3444e9=a192_0x16c7,_0x432613=_0x722588['replace'](/\r\n/g,'\x0a')[_0x3444e9(0x124)]('\x0a'),_0x258f4d=[];let _0x2225bb=0x0;if(_0x5cd4c5==='mybatisXml')while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x40a19d=_0x432613[_0x2225bb]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x40a19d)){_0x2225bb++;continue;}if(_0x40a19d[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}else while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x3db748=_0x432613[_0x2225bb]??'';if(/^\s*--\s*@lovrabet\./[_0x3444e9(0x11f)](_0x3db748)){_0x2225bb++;continue;}if(_0x3db748[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}for(;_0x2225bb<_0x432613['length'];_0x2225bb++){_0x258f4d[_0x3444e9(0x12d)](_0x432613[_0x2225bb]);}return _0x258f4d['join']('\x0a')[_0x3444e9(0x121)]();}export function resolveSqlMode(_0x5dd49c,_0x368da5){const _0x4c0261=a192_0x16c7;if(_0x368da5?.[_0x4c0261(0x137)])return _0x368da5[_0x4c0261(0x137)];return detectSqlMode(_0x5dd49c);}export function resolveSqlFileName(_0x18b434,_0x550028,_0x32e61a){const _0x37a390=a192_0x16c7;if(_0x32e61a?.[_0x37a390(0x110)])return _0x32e61a[_0x37a390(0x110)];if(_0x32e61a?.[_0x37a390(0x135)]||_0x32e61a?.[_0x37a390(0x138)])return buildSqlRelativePath(_0x18b434,_0x32e61a?.[_0x37a390(0x135)],_0x32e61a?.['dbName'],resolveSqlMode(_0x550028,_0x32e61a),_0x32e61a?.['dbId']);return buildDefaultSqlFileName(_0x18b434,resolveSqlMode(_0x550028,_0x32e61a));}export function resolveSqlLocalDir(_0x418f8e,_0x1196f0){return join(_0x418f8e,SQL_LOCAL_REL_DIR,_0x1196f0);}export async function confirmForceOverwrite(_0x1be92d){const _0x18222a=a192_0x16c7,_0x5e3e72=createInterface({'input':process[_0x18222a(0x111)],'output':process[_0x18222a(0x132)]}),_0x13c987=await new Promise(_0x3ea5cc=>{const _0x53c81f=_0x18222a;_0x5e3e72['question'](_0x1be92d+_0x53c81f(0x122),_0x3ea5cc);});return _0x5e3e72[_0x18222a(0x114)](),['y',_0x18222a(0x112)][_0x18222a(0x117)](_0x13c987[_0x18222a(0x11d)]()['toLowerCase']());}export function findSqlLockScope(_0x12da49,_0x4aef32){const _0x3bf873=a192_0x16c7;return _0x12da49[_0x3bf873(0x13b)][_0x4aef32];}function buildMetadataHeaderLines(_0xbff397,_0x51330a){const _0x11c2a4=a192_0x16c7,_0x2ed238=[['sqlCode',_0xbff397[_0x11c2a4(0x119)]],[_0x11c2a4(0x135),_0xbff397['sqlName']],[_0x11c2a4(0x12c),_0xbff397[_0x11c2a4(0x12c)]],[_0x11c2a4(0x138),_0xbff397['dbName']],[_0x11c2a4(0x137),_0xbff397[_0x11c2a4(0x137)]],['syncedAt',_0xbff397['syncedAt']],[_0x11c2a4(0x115),_0xbff397['description']]];if(_0x51330a===_0x11c2a4(0x139))return _0x2ed238[_0x11c2a4(0x128)](([,_0x5b8061])=>_0x5b8061!==undefined&&_0x5b8061!==null&&String(_0x5b8061)[_0x11c2a4(0x11d)]()!=='')[_0x11c2a4(0x120)](([_0x1b836c,_0x3cc4d8])=>'<!--\x20@lovrabet.'+_0x1b836c+':\x20'+String(_0x3cc4d8)+'\x20-->');return _0x2ed238[_0x11c2a4(0x128)](([,_0x3c549b])=>_0x3c549b!==undefined&&_0x3c549b!==null&&String(_0x3c549b)[_0x11c2a4(0x11d)]()!=='')['map'](([_0x111607,_0x342271])=>_0x11c2a4(0x12a)+_0x111607+':\x20'+String(_0x342271));}
@@ -1 +1 @@
1
- const a200_0x47656a=a200_0x3465;(function(_0x41c439,_0x1b4adf){const _0x2067ca=a200_0x3465,_0x59b423=_0x41c439();while(!![]){try{const _0x1fc561=parseInt(_0x2067ca(0x1ba))/0x1*(parseInt(_0x2067ca(0x1a8))/0x2)+parseInt(_0x2067ca(0x1ac))/0x3*(parseInt(_0x2067ca(0x1c1))/0x4)+parseInt(_0x2067ca(0x1bd))/0x5*(parseInt(_0x2067ca(0x1bb))/0x6)+parseInt(_0x2067ca(0x1a1))/0x7*(parseInt(_0x2067ca(0x1a7))/0x8)+parseInt(_0x2067ca(0x1c0))/0x9*(-parseInt(_0x2067ca(0x1af))/0xa)+parseInt(_0x2067ca(0x1bc))/0xb*(parseInt(_0x2067ca(0x1a4))/0xc)+-parseInt(_0x2067ca(0x1ad))/0xd;if(_0x1fc561===_0x1b4adf)break;else _0x59b423['push'](_0x59b423['shift']());}catch(_0x4921b6){_0x59b423['push'](_0x59b423['shift']());}}}(a200_0x141b,0x9d03e));import{listSqlQueries}from'../../core/api-client.js';function a200_0x3465(_0x3ca09a,_0x51b35f){_0x3ca09a=_0x3ca09a-0x1a1;const _0x141b52=a200_0x141b();let _0x3465f6=_0x141b52[_0x3ca09a];return _0x3465f6;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3b005b){const _0x5ed89b=a200_0x3465,_0x5ed49e=[];let _0x26a6e3=0x1;while(!![]){const _0x3194a3=await listSqlQueries(_0x3b005b,{'currentPage':_0x26a6e3,'pageSize':PAGE_SIZE}),_0x2587dc=_0x3194a3['tableData']??[];_0x5ed49e[_0x5ed89b(0x1c4)](..._0x2587dc[_0x5ed89b(0x1c3)](_0xf10e2=>_0xf10e2[_0x5ed89b(0x1b3)]));if(_0x2587dc[_0x5ed89b(0x1b1)]===0x0)break;const _0x589149=_0x3194a3['paging']?.[_0x5ed89b(0x1a3)];if(_0x589149!=null?_0x5ed49e['length']>=_0x589149:_0x2587dc[_0x5ed89b(0x1b1)]<PAGE_SIZE)break;_0x26a6e3++;}return _0x5ed49e;}function a200_0x141b(){const _0x21df12=['sql','131350JexaCw','\x20unchanged','length','\x20modified,\x20','sqlCode','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockKey','keys','lockFilePath','filePath','remote','11GQEQtt','51162ezdsSZ','21142APZDZl','190DNUWVt','sqlName','\x20remote-only','513fqKjZc','2164ypgOke','bool','map','push','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20missing,\x20','sqls','917zpmQAL','path','totalCount','3972MZZhHN','read','sqlRoot','72272FGkUZe','61882mvGKEw','\x20added,\x20','appCode','boolean','3453nHcZmy','22293375UQzCah'];a200_0x141b=function(){return _0x21df12;};return a200_0x141b();}export const sqlStatus={'service':a200_0x47656a(0x1ae),'command':'status','description':a200_0x47656a(0x1c5),'risk':a200_0x47656a(0x1a5),'flags':[{'name':a200_0x47656a(0x1b9),'type':a200_0x47656a(0x1ab),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x20d6dc){const _0x37fe22=a200_0x47656a,_0x71dec8=loadSqlProjectConfig(_0x20d6dc['appCode']),_0x1e8968=await readSqlLockFile(_0x71dec8[_0x37fe22(0x1b7)]),{appLock:_0x1bf879}=ensureSqlLockScope(_0x1e8968??createEmptySqlLock(),_0x71dec8[_0x37fe22(0x1aa)],_0x71dec8[_0x37fe22(0x1a6)],'status'),_0xbbf5e6=await scanLocalSqlQueries(_0x71dec8),_0x54c285=[],_0x13555e=[],_0x15c864=[],_0x5e6e6d=[],_0x3c9b94=new Set(_0xbbf5e6[_0x37fe22(0x1c3)](_0x553469=>_0x553469['lockKey']));for(const _0x169205 of _0xbbf5e6){const _0x1cd5ff=await computeSqlFileHash(_0x169205[_0x37fe22(0x1b8)]),_0x47437f=_0x1bf879[_0x37fe22(0x1c7)][_0x169205[_0x37fe22(0x1b5)]],_0x169978=!!_0x47437f&&_0x47437f[_0x37fe22(0x1a2)]!==_0x169205['relativePath'],_0x3771a3=!!_0x47437f&&!!_0x169205[_0x37fe22(0x1be)]&&_0x47437f[_0x37fe22(0x1be)]!==_0x169205[_0x37fe22(0x1be)];if(!_0x47437f)_0x54c285[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);else _0x47437f['hash']!==_0x1cd5ff||_0x169978||_0x3771a3?_0x13555e[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]):_0x15c864[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);}for(const _0x2dfdeb of Object[_0x37fe22(0x1b6)](_0x1bf879[_0x37fe22(0x1c7)])){!_0x3c9b94['has'](_0x2dfdeb)&&_0x5e6e6d[_0x37fe22(0x1c4)](_0x2dfdeb);}const _0x1edfb9=[];if(_0x20d6dc[_0x37fe22(0x1c2)](_0x37fe22(0x1b9))){const _0x53f1=await fetchAllSqlCodes(_0x20d6dc['appCode']);for(const _0x5ea187 of _0x53f1){!_0x3c9b94['has'](_0x5ea187)&&!_0x1bf879['sqls'][_0x5ea187]&&_0x1edfb9[_0x37fe22(0x1c4)](_0x5ea187);}}const _0xe963bc=_0x54c285[_0x37fe22(0x1b1)]===0x0&&_0x13555e[_0x37fe22(0x1b1)]===0x0&&_0x5e6e6d[_0x37fe22(0x1b1)]===0x0&&_0x1edfb9[_0x37fe22(0x1b1)]===0x0;return{'ok':!![],'data':{'added':_0x54c285,'modified':_0x13555e,'missing':_0x5e6e6d,'unchanged':_0x15c864,'remoteOnly':_0x1edfb9},'message':_0xe963bc?_0x37fe22(0x1b4):_0x54c285[_0x37fe22(0x1b1)]+_0x37fe22(0x1a9)+_0x13555e[_0x37fe22(0x1b1)]+_0x37fe22(0x1b2)+_0x5e6e6d['length']+_0x37fe22(0x1c6)+_0x15c864[_0x37fe22(0x1b1)]+_0x37fe22(0x1b0)+(_0x1edfb9[_0x37fe22(0x1b1)]>0x0?',\x20'+_0x1edfb9[_0x37fe22(0x1b1)]+_0x37fe22(0x1bf):'')};}};
1
+ const a193_0x1ca1c1=a193_0x5948;(function(_0x1de720,_0x1fee27){const _0x2c5df4=a193_0x5948,_0x2f242b=_0x1de720();while(!![]){try{const _0x1d4698=parseInt(_0x2c5df4(0xc9))/0x1*(-parseInt(_0x2c5df4(0xe3))/0x2)+-parseInt(_0x2c5df4(0xdf))/0x3*(-parseInt(_0x2c5df4(0xdd))/0x4)+parseInt(_0x2c5df4(0xc7))/0x5*(-parseInt(_0x2c5df4(0xe2))/0x6)+parseInt(_0x2c5df4(0xdb))/0x7+parseInt(_0x2c5df4(0xe5))/0x8+-parseInt(_0x2c5df4(0xca))/0x9*(-parseInt(_0x2c5df4(0xd0))/0xa)+-parseInt(_0x2c5df4(0xd6))/0xb;if(_0x1d4698===_0x1fee27)break;else _0x2f242b['push'](_0x2f242b['shift']());}catch(_0x243380){_0x2f242b['push'](_0x2f242b['shift']());}}}(a193_0x3ad7,0x4033f));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a193_0x5948(_0xc1bcde,_0x319c85){_0xc1bcde=_0xc1bcde-0xc2;const _0x3ad734=a193_0x3ad7();let _0x594801=_0x3ad734[_0xc1bcde];return _0x594801;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1fa17c){const _0xf741d7=a193_0x5948,_0x4195bd=[];let _0x53d4f8=0x1;while(!![]){const _0x10f10b=await listSqlQueries(_0x1fa17c,{'currentPage':_0x53d4f8,'pageSize':PAGE_SIZE}),_0x383d71=_0x10f10b[_0xf741d7(0xd4)]??[];_0x4195bd[_0xf741d7(0xe6)](..._0x383d71[_0xf741d7(0xcc)](_0xdedd95=>_0xdedd95[_0xf741d7(0xc4)]));if(_0x383d71[_0xf741d7(0xe0)]===0x0)break;const _0x905e02=_0x10f10b[_0xf741d7(0xe1)]?.[_0xf741d7(0xc2)];if(_0x905e02!=null?_0x4195bd[_0xf741d7(0xe0)]>=_0x905e02:_0x383d71[_0xf741d7(0xe0)]<PAGE_SIZE)break;_0x53d4f8++;}return _0x4195bd;}function a193_0x3ad7(){const _0x4ed731=['8349440unKbbo','\x20missing,\x20','has','\x20added,\x20','lockKey','1306935uMmvra','\x20modified,\x20','3148fvbUnZ','lockFilePath','1770VckNBj','length','paging','12zOBhAW','804986HSdEmz','sqlRoot','2176616ZreOnk','push','totalCount','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','appCode','sqlName','34060eTftnJ','remote','1ZwhsVe','99WqAJoJ','All\x20SQL\x20queries\x20are\x20in\x20sync.','map','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','hash','468200jJMPzQ','status','sqls','filePath','tableData','boolean'];a193_0x3ad7=function(){return _0x4ed731;};return a193_0x3ad7();}export const sqlStatus={'service':'sql','command':'status','description':a193_0x1ca1c1(0xc3),'risk':'read','flags':[{'name':a193_0x1ca1c1(0xc8),'type':a193_0x1ca1c1(0xd5),'description':a193_0x1ca1c1(0xce)}],async 'execute'(_0x572a3e){const _0x32e47a=a193_0x1ca1c1,_0x5006a7=loadSqlProjectConfig(_0x572a3e[_0x32e47a(0xc5)]),_0x31439b=await readSqlLockFile(_0x5006a7[_0x32e47a(0xde)]),{appLock:_0x2d0a35}=ensureSqlLockScope(_0x31439b??createEmptySqlLock(),_0x5006a7[_0x32e47a(0xc5)],_0x5006a7[_0x32e47a(0xe4)],_0x32e47a(0xd1)),_0x52143e=await scanLocalSqlQueries(_0x5006a7),_0x329b89=[],_0x4bd31d=[],_0x6852a9=[],_0x388750=[],_0x2ad0e9=new Set(_0x52143e['map'](_0x22a77e=>_0x22a77e[_0x32e47a(0xda)]));for(const _0x4b78d4 of _0x52143e){const _0x26d34b=await computeSqlFileHash(_0x4b78d4[_0x32e47a(0xd3)]),_0x5d8977=_0x2d0a35[_0x32e47a(0xd2)][_0x4b78d4['lockKey']],_0x23ee04=!!_0x5d8977&&_0x5d8977['path']!==_0x4b78d4['relativePath'],_0x40d89d=!!_0x5d8977&&!!_0x4b78d4[_0x32e47a(0xc6)]&&_0x5d8977[_0x32e47a(0xc6)]!==_0x4b78d4[_0x32e47a(0xc6)];if(!_0x5d8977)_0x329b89[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);else _0x5d8977[_0x32e47a(0xcf)]!==_0x26d34b||_0x23ee04||_0x40d89d?_0x4bd31d[_0x32e47a(0xe6)](_0x4b78d4['lockKey']):_0x6852a9[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);}for(const _0x5b193e of Object['keys'](_0x2d0a35['sqls'])){!_0x2ad0e9[_0x32e47a(0xd8)](_0x5b193e)&&_0x388750[_0x32e47a(0xe6)](_0x5b193e);}const _0x51d296=[];if(_0x572a3e['bool'](_0x32e47a(0xc8))){const _0x50d14b=await fetchAllSqlCodes(_0x572a3e[_0x32e47a(0xc5)]);for(const _0x51943b of _0x50d14b){!_0x2ad0e9[_0x32e47a(0xd8)](_0x51943b)&&!_0x2d0a35[_0x32e47a(0xd2)][_0x51943b]&&_0x51d296['push'](_0x51943b);}}const _0x283f7f=_0x329b89[_0x32e47a(0xe0)]===0x0&&_0x4bd31d[_0x32e47a(0xe0)]===0x0&&_0x388750[_0x32e47a(0xe0)]===0x0&&_0x51d296[_0x32e47a(0xe0)]===0x0;return{'ok':!![],'data':{'added':_0x329b89,'modified':_0x4bd31d,'missing':_0x388750,'unchanged':_0x6852a9,'remoteOnly':_0x51d296},'message':_0x283f7f?_0x32e47a(0xcb):_0x329b89[_0x32e47a(0xe0)]+_0x32e47a(0xd9)+_0x4bd31d[_0x32e47a(0xe0)]+_0x32e47a(0xdc)+_0x388750[_0x32e47a(0xe0)]+_0x32e47a(0xd7)+_0x6852a9['length']+'\x20unchanged'+(_0x51d296[_0x32e47a(0xe0)]>0x0?',\x20'+_0x51d296[_0x32e47a(0xe0)]+_0x32e47a(0xcd):'')};}};
@@ -1 +1 @@
1
- const a201_0x386770=a201_0x4fdf;function a201_0xed52(){const _0x55b930=['tableName','34121964SdAuTs','pkField','1152993IqtDPm','length','3822917MeVjhF','primary','toLowerCase','4952225TtwGkM','name','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','902hWkbof','1204KTuIhX','schema:','from','reason','--check-indexes\x20requires\x20--schemas.','index_type','trim','sqlType','index_name','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','flagMissing','validation','bool','index_columns','get','isSelectOnly','read','str','type','Provide\x20--file\x20or\x20--sql','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','map','valid','message','8FfVgtM','File\x20not\x20found:\x20','push','columns','sql','cwd','schemaWarnings','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','file','boolean','tables','filter','find','isArray','appCode','isDangerous','dbtableConfig','string','unshift','2088AcBrrV','indexName','check-indexes','Dataset\x20\x22','schemas','indexes','167580jVPmfX','dataset','6mQzTbv','fields','62523emBmoE','SQL\x20schema\x20validation','583pGwmpO','size'];a201_0xed52=function(){return _0x55b930;};return a201_0xed52();}(function(_0x27bf36,_0x429c01){const _0x17a263=a201_0x4fdf,_0x425247=_0x27bf36();while(!![]){try{const _0x17a191=parseInt(_0x17a263(0xe7))/0x1*(parseInt(_0x17a263(0xe6))/0x2)+-parseInt(_0x17a263(0xde))/0x3*(-parseInt(_0x17a263(0xba))/0x4)+parseInt(_0x17a263(0xe3))/0x5+-parseInt(_0x17a263(0xd5))/0x6*(-parseInt(_0x17a263(0xe0))/0x7)+parseInt(_0x17a263(0xcd))/0x8*(parseInt(_0x17a263(0xd7))/0x9)+-parseInt(_0x17a263(0xd3))/0xa*(parseInt(_0x17a263(0xd9))/0xb)+-parseInt(_0x17a263(0xdc))/0xc;if(_0x17a191===_0x429c01)break;else _0x425247['push'](_0x425247['shift']());}catch(_0x527ed2){_0x425247['push'](_0x425247['shift']());}}}(a201_0xed52,0xe2fca));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a201_0x4fdf(_0xd2982,_0x1a7117){_0xd2982=_0xd2982-0xae;const _0xed52a=a201_0xed52();let _0x4fdf75=_0xed52a[_0xd2982];return _0x4fdf75;}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a201_0x386770(0xbe),'command':'validate','description':a201_0x386770(0xc1),'risk':a201_0x386770(0xb2),'flags':[{'name':a201_0x386770(0xc2),'type':a201_0x386770(0xcb),'description':a201_0x386770(0xb6)},{'name':a201_0x386770(0xbe),'type':a201_0x386770(0xcb),'description':a201_0x386770(0xe5)},{'name':a201_0x386770(0xd1),'type':a201_0x386770(0xcb),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a201_0x386770(0xcf),'type':a201_0x386770(0xc3),'description':a201_0x386770(0xf0)}],async 'execute'(_0x3d5ed2){const _0x4c1999=a201_0x386770,_0x147bd9=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xc2)),_0xa0e350=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xbe)),_0x3d4b5e=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xd1)),_0x59a998=_0x3d5ed2[_0x4c1999(0xae)]('check-indexes');if(!_0x147bd9&&!_0xa0e350)throw CliErrors[_0x4c1999(0xf1)](_0x4c1999(0xc2),_0x4c1999(0xb5));if(_0x59a998&&!_0x3d4b5e)throw CliErrors[_0x4c1999(0xf2)](_0x4c1999(0xeb));let _0x59ca1d;if(_0x147bd9){const _0x253b06=resolve(process[_0x4c1999(0xbf)](),_0x147bd9);if(!existsSync(_0x253b06))throw CliErrors[_0x4c1999(0xf2)](_0x4c1999(0xbb)+_0x253b06);_0x59ca1d=readFileSync(_0x253b06,'utf-8');}else _0x59ca1d=_0xa0e350;const _0x4bde87=validateSql(_0x59ca1d),_0x5e29f3={'valid':_0x4bde87['valid'],'sqlType':_0x4bde87[_0x4c1999(0xee)]['type'],'isSelectOnly':_0x4bde87['sqlType'][_0x4c1999(0xb1)],'isDangerous':_0x4bde87[_0x4c1999(0xee)][_0x4c1999(0xc9)],'tables':_0x4bde87[_0x4c1999(0xc4)],'parameters':_0x4bde87['parameters'],'message':_0x4bde87[_0x4c1999(0xb9)]};_0x4bde87[_0x4c1999(0xee)][_0x4c1999(0xea)]&&(_0x5e29f3[_0x4c1999(0xea)]=_0x4bde87['sqlType'][_0x4c1999(0xea)]);if(_0x3d4b5e&&_0x4bde87[_0x4c1999(0xb8)]){const _0x5ee009=_0x3d4b5e['split'](',')['map'](_0x375ef3=>_0x375ef3[_0x4c1999(0xed)]())[_0x4c1999(0xc5)](Boolean),_0x17b682=[],_0x46b0f9=[],_0x1d73c6=filterDbTableBackedDatasets(await listDatasets(_0x3d5ed2[_0x4c1999(0xc8)])),_0x53aae2=new Map(_0x1d73c6[_0x4c1999(0xb7)](_0x11beed=>[_0x11beed['dbtableConfig']?.['tableName']?.['toLowerCase'](),_0x11beed]));for(const _0x386259 of _0x4bde87[_0x4c1999(0xc4)]){const _0x3af334=_0x53aae2[_0x4c1999(0xb0)](_0x386259[_0x4c1999(0xe2)]());!_0x3af334&&_0x17b682[_0x4c1999(0xbc)]('Table\x20\x22'+_0x386259+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x234dc7 of _0x5ee009){let _0xb05f41;try{_0xb05f41=await getDatasetDetail(_0x234dc7);}catch{_0x17b682['push'](_0x4c1999(0xd0)+_0x234dc7+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0xb05f41,_0x4c1999(0xd8));const _0x257441=Array[_0x4c1999(0xc7)](_0xb05f41[_0x4c1999(0xd6)])?_0xb05f41['fields']:[],_0x73c295=new Set(_0x257441['map'](_0x2eacf5=>_0x2eacf5[_0x4c1999(0xe4)]?.[_0x4c1999(0xe2)]())),_0x34beb9=_0xb05f41[_0x4c1999(0xca)]?.[_0x4c1999(0xdb)]||_0xb05f41[_0x4c1999(0xdb)]||_0x234dc7;_0x5e29f3[_0x4c1999(0xe8)+_0x34beb9]={'code':_0x234dc7,'tableName':_0x34beb9,'fieldCount':_0x73c295[_0x4c1999(0xda)],'fields':Array[_0x4c1999(0xe9)](_0x73c295)};if(_0x59a998){const _0x338753=normalizeDatasetIndexes(_0xb05f41);_0x46b0f9[_0x4c1999(0xbc)]({'tableName':_0x34beb9,..._0x338753});}}_0x17b682[_0x4c1999(0xdf)]>0x0&&(_0x5e29f3[_0x4c1999(0xc0)]=_0x17b682),_0x59a998&&(_0x5e29f3['joinAudit']=auditSqlJoinIndexes(_0x59ca1d,_0x46b0f9));}return{'ok':_0x4bde87['valid'],'data':_0x5e29f3,'message':_0x4bde87[_0x4c1999(0xb9)]};}};function normalizeDatasetIndexes(_0xa26d9){const _0x1bbc7f=a201_0x386770,_0x271f1a=Array['isArray'](_0xa26d9?.[_0x1bbc7f(0xd4)]?.['indexes'])?_0xa26d9['dataset'][_0x1bbc7f(0xd2)]:Array[_0x1bbc7f(0xc7)](_0xa26d9?.['indexes'])?_0xa26d9[_0x1bbc7f(0xd2)]:[],_0x28237f=_0x271f1a['flatMap'](_0x5b1eff=>{const _0xfffb2=_0x1bbc7f,_0x46a193=Array[_0xfffb2(0xc7)](_0x5b1eff?.[_0xfffb2(0xaf)])?_0x5b1eff[_0xfffb2(0xaf)]:Array[_0xfffb2(0xc7)](_0x5b1eff?.['columnNames'])?_0x5b1eff['columnNames']:Array[_0xfffb2(0xc7)](_0x5b1eff?.[_0xfffb2(0xbd)])?_0x5b1eff['columns']:[],_0x3b8c3f=_0x46a193[_0xfffb2(0xc5)](_0x35a4fa=>typeof _0x35a4fa===_0xfffb2(0xcb))[_0xfffb2(0xb7)](_0xc964e7=>_0xc964e7[_0xfffb2(0xed)]())[_0xfffb2(0xc5)](Boolean);if(_0x3b8c3f[_0xfffb2(0xdf)]===0x0)return[];const _0x42f127=[_0x5b1eff?.[_0xfffb2(0xce)],_0x5b1eff?.[_0xfffb2(0xef)],_0x5b1eff?.[_0xfffb2(0xe4)]]['find'](_0x538e46=>typeof _0x538e46===_0xfffb2(0xcb)&&_0x538e46[_0xfffb2(0xed)]()),_0x534008=[_0x5b1eff?.[_0xfffb2(0xec)],_0x5b1eff?.[_0xfffb2(0xb4)]][_0xfffb2(0xc6)](_0x340f1f=>typeof _0x340f1f==='string'&&_0x340f1f['trim']());return[{..._0x42f127?{'name':_0x42f127['trim']()}:{},..._0x534008?{'type':_0x534008[_0xfffb2(0xed)]()}:{},'columns':_0x3b8c3f}];}),_0x3c2c6a=[..._0x28237f],_0x3a2c9e=typeof _0xa26d9?.[_0x1bbc7f(0xca)]?.[_0x1bbc7f(0xdd)]===_0x1bbc7f(0xcb)?_0xa26d9[_0x1bbc7f(0xca)][_0x1bbc7f(0xdd)]['split'](',')['map'](_0x43552c=>_0x43552c['trim']())[_0x1bbc7f(0xc5)](Boolean):[];return _0x3a2c9e[_0x1bbc7f(0xdf)]>0x0&&_0x3c2c6a[_0x1bbc7f(0xcc)]({'type':_0x1bbc7f(0xe1),'columns':_0x3a2c9e}),{'indexes':_0x3c2c6a,'metadataAvailable':_0x28237f[_0x1bbc7f(0xdf)]>0x0};}
1
+ const a194_0x2210d3=a194_0x1bd1;(function(_0x3da535,_0x2c6320){const _0x327c55=a194_0x1bd1,_0x30abd5=_0x3da535();while(!![]){try{const _0x355d29=parseInt(_0x327c55(0x148))/0x1+parseInt(_0x327c55(0x15c))/0x2+-parseInt(_0x327c55(0x167))/0x3+-parseInt(_0x327c55(0x14c))/0x4*(-parseInt(_0x327c55(0x159))/0x5)+parseInt(_0x327c55(0x152))/0x6*(-parseInt(_0x327c55(0x15b))/0x7)+parseInt(_0x327c55(0x15d))/0x8+parseInt(_0x327c55(0x144))/0x9*(-parseInt(_0x327c55(0x13e))/0xa);if(_0x355d29===_0x2c6320)break;else _0x30abd5['push'](_0x30abd5['shift']());}catch(_0x5d9ed5){_0x30abd5['push'](_0x30abd5['shift']());}}}(a194_0x26f8,0xca1b1));function a194_0x26f8(){const _0x30eb1a=['Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','flagMissing','push','Provide\x20--file\x20or\x20--sql','schema:','indexes','200eTfYhI','schemas','parameters','map','sqlType','pkField','120816eZDdye','Dataset\x20\x22','dbtableConfig','isArray','511478iDuuIy','indexName','index_name','bool','44alJtXc','file','length','trim','message','flatMap','56004KAcovk','filter','size','dataset','--check-indexes\x20requires\x20--schemas.','tables','\x22\x20not\x20found\x20or\x20not\x20accessible','207300eiSnPr','index_columns','483QpDORH','1321746CFFDTb','10684056pvFzVV','Table\x20\x22','tableName','columns','string','index_type','utf-8','get','str','split','3670701VUStwV','read','unshift','reason','check-indexes','columnNames','type','isSelectOnly','toLowerCase','find','schemaWarnings','SQL\x20schema\x20validation','valid','File\x20not\x20found:\x20','isDangerous','validation','sql','name','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','joinAudit','fields'];a194_0x26f8=function(){return _0x30eb1a;};return a194_0x26f8();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a194_0x1bd1(_0x4a5ec5,_0x58ad2f){_0x4a5ec5=_0x4a5ec5-0x122;const _0x26f8fc=a194_0x26f8();let _0x1bd13b=_0x26f8fc[_0x4a5ec5];return _0x1bd13b;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2210d3(0x130),'command':a194_0x2210d3(0x134),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a194_0x2210d3(0x168),'flags':[{'name':a194_0x2210d3(0x14d),'type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x132)},{'name':'sql','type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x138)},{'name':a194_0x2210d3(0x13f),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a194_0x2210d3(0x124),'type':'boolean','description':a194_0x2210d3(0x137)}],async 'execute'(_0x24e13a){const _0x21a004=a194_0x2210d3,_0x2cce8c=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x14d)),_0x423faa=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x130)),_0xd97136=_0x24e13a['str'](_0x21a004(0x13f)),_0x1bddad=_0x24e13a[_0x21a004(0x14b)](_0x21a004(0x124));if(!_0x2cce8c&&!_0x423faa)throw CliErrors[_0x21a004(0x139)]('file',_0x21a004(0x13b));if(_0x1bddad&&!_0xd97136)throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x156));let _0x414de5;if(_0x2cce8c){const _0x5aacdf=resolve(process['cwd'](),_0x2cce8c);if(!existsSync(_0x5aacdf))throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x12d)+_0x5aacdf);_0x414de5=readFileSync(_0x5aacdf,_0x21a004(0x163));}else _0x414de5=_0x423faa;const _0xe873e6=validateSql(_0x414de5),_0x2fe89d={'valid':_0xe873e6[_0x21a004(0x12c)],'sqlType':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x126)],'isSelectOnly':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x127)],'isDangerous':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x12e)],'tables':_0xe873e6['tables'],'parameters':_0xe873e6[_0x21a004(0x140)],'message':_0xe873e6['message']};_0xe873e6[_0x21a004(0x142)]['reason']&&(_0x2fe89d[_0x21a004(0x123)]=_0xe873e6[_0x21a004(0x142)]['reason']);if(_0xd97136&&_0xe873e6[_0x21a004(0x12c)]){const _0x2e3b34=_0xd97136[_0x21a004(0x166)](',')[_0x21a004(0x141)](_0x13a5dd=>_0x13a5dd[_0x21a004(0x14f)]())[_0x21a004(0x153)](Boolean),_0x495e39=[],_0x507d45=[],_0x2f3b2a=filterDbTableBackedDatasets(await listDatasets(_0x24e13a['appCode'])),_0x52e2a3=new Map(_0x2f3b2a[_0x21a004(0x141)](_0x3ff41e=>[_0x3ff41e['dbtableConfig']?.[_0x21a004(0x15f)]?.[_0x21a004(0x128)](),_0x3ff41e]));for(const _0xa38bb8 of _0xe873e6[_0x21a004(0x157)]){const _0x4be4f1=_0x52e2a3[_0x21a004(0x164)](_0xa38bb8['toLowerCase']());!_0x4be4f1&&_0x495e39[_0x21a004(0x13a)](_0x21a004(0x15e)+_0xa38bb8+_0x21a004(0x133));}for(const _0x2c220e of _0x2e3b34){let _0x52262b;try{_0x52262b=await getDatasetDetail(_0x2c220e);}catch{_0x495e39[_0x21a004(0x13a)](_0x21a004(0x145)+_0x2c220e+_0x21a004(0x158));continue;}assertDatasetIsDbTableBacked(_0x52262b,_0x21a004(0x12b));const _0x54092d=Array[_0x21a004(0x147)](_0x52262b[_0x21a004(0x136)])?_0x52262b[_0x21a004(0x136)]:[],_0x3ab62d=new Set(_0x54092d[_0x21a004(0x141)](_0x3fb517=>_0x3fb517[_0x21a004(0x131)]?.[_0x21a004(0x128)]())),_0x10c826=_0x52262b[_0x21a004(0x146)]?.[_0x21a004(0x15f)]||_0x52262b[_0x21a004(0x15f)]||_0x2c220e;_0x2fe89d[_0x21a004(0x13c)+_0x10c826]={'code':_0x2c220e,'tableName':_0x10c826,'fieldCount':_0x3ab62d[_0x21a004(0x154)],'fields':Array['from'](_0x3ab62d)};if(_0x1bddad){const _0x4b0786=normalizeDatasetIndexes(_0x52262b);_0x507d45['push']({'tableName':_0x10c826,..._0x4b0786});}}_0x495e39[_0x21a004(0x14e)]>0x0&&(_0x2fe89d[_0x21a004(0x12a)]=_0x495e39),_0x1bddad&&(_0x2fe89d[_0x21a004(0x135)]=auditSqlJoinIndexes(_0x414de5,_0x507d45));}return{'ok':_0xe873e6[_0x21a004(0x12c)],'data':_0x2fe89d,'message':_0xe873e6[_0x21a004(0x150)]};}};function normalizeDatasetIndexes(_0x2c0363){const _0x514712=a194_0x2210d3,_0x1311c7=Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x155)]?.['indexes'])?_0x2c0363[_0x514712(0x155)]['indexes']:Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x13d)])?_0x2c0363[_0x514712(0x13d)]:[],_0x219889=_0x1311c7[_0x514712(0x151)](_0x188842=>{const _0x5e9d99=_0x514712,_0x2b8daa=Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x15a)])?_0x188842[_0x5e9d99(0x15a)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x125)])?_0x188842[_0x5e9d99(0x125)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x160)])?_0x188842[_0x5e9d99(0x160)]:[],_0xa97569=_0x2b8daa[_0x5e9d99(0x153)](_0x4b0335=>typeof _0x4b0335===_0x5e9d99(0x161))[_0x5e9d99(0x141)](_0x37e4df=>_0x37e4df[_0x5e9d99(0x14f)]())[_0x5e9d99(0x153)](Boolean);if(_0xa97569[_0x5e9d99(0x14e)]===0x0)return[];const _0xc766e=[_0x188842?.[_0x5e9d99(0x149)],_0x188842?.[_0x5e9d99(0x14a)],_0x188842?.[_0x5e9d99(0x131)]][_0x5e9d99(0x129)](_0x4d5ec1=>typeof _0x4d5ec1===_0x5e9d99(0x161)&&_0x4d5ec1[_0x5e9d99(0x14f)]()),_0x16549a=[_0x188842?.[_0x5e9d99(0x162)],_0x188842?.[_0x5e9d99(0x126)]][_0x5e9d99(0x129)](_0x1484d7=>typeof _0x1484d7===_0x5e9d99(0x161)&&_0x1484d7[_0x5e9d99(0x14f)]());return[{..._0xc766e?{'name':_0xc766e[_0x5e9d99(0x14f)]()}:{},..._0x16549a?{'type':_0x16549a[_0x5e9d99(0x14f)]()}:{},'columns':_0xa97569}];}),_0x22dcdb=[..._0x219889],_0x177374=typeof _0x2c0363?.[_0x514712(0x146)]?.[_0x514712(0x143)]===_0x514712(0x161)?_0x2c0363[_0x514712(0x146)]['pkField']['split'](',')[_0x514712(0x141)](_0xa97ca6=>_0xa97ca6[_0x514712(0x14f)]())[_0x514712(0x153)](Boolean):[];return _0x177374['length']>0x0&&_0x22dcdb[_0x514712(0x122)]({'type':'primary','columns':_0x177374}),{'indexes':_0x22dcdb,'metadataAvailable':_0x219889[_0x514712(0x14e)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x2da987,_0x1f34f5){const _0x1dc56c=a202_0xb757,_0x42e38e=_0x2da987();while(!![]){try{const _0x41294c=-parseInt(_0x1dc56c(0x7d))/0x1+-parseInt(_0x1dc56c(0x7b))/0x2*(parseInt(_0x1dc56c(0x7c))/0x3)+-parseInt(_0x1dc56c(0x79))/0x4+parseInt(_0x1dc56c(0x81))/0x5+parseInt(_0x1dc56c(0x7f))/0x6+-parseInt(_0x1dc56c(0x7a))/0x7+-parseInt(_0x1dc56c(0x80))/0x8*(-parseInt(_0x1dc56c(0x7e))/0x9);if(_0x41294c===_0x1f34f5)break;else _0x42e38e['push'](_0x42e38e['shift']());}catch(_0xade1d5){_0x42e38e['push'](_0x42e38e['shift']());}}}(a202_0xbfa8,0xcf854));function a202_0xb757(_0x12508b,_0x407bac){_0x12508b=_0x12508b-0x79;const _0xbfa8b2=a202_0xbfa8();let _0xb75788=_0xbfa8b2[_0x12508b];return _0xb75788;}import{taskStatus}from'../../commands/task/status.js';function a202_0xbfa8(){const _0x3f7fed=['7088395gRGPNN','1745396GwRPpE','9891966rBsYXT','129730chfMcv','33KlRQAa','590679tOvKNf','9WNbRUC','1706322Hfijpt','18412952SqCYAJ'];a202_0xbfa8=function(){return _0x3f7fed;};return a202_0xbfa8();}export const taskDefinitions=[taskStatus];
1
+ (function(_0x1e21f,_0x59c3de){const _0x43b2b2=a195_0x8a3c,_0x4ddab5=_0x1e21f();while(!![]){try{const _0x1b61ba=parseInt(_0x43b2b2(0x73))/0x1+parseInt(_0x43b2b2(0x72))/0x2+parseInt(_0x43b2b2(0x70))/0x3*(-parseInt(_0x43b2b2(0x6d))/0x4)+parseInt(_0x43b2b2(0x77))/0x5*(parseInt(_0x43b2b2(0x6f))/0x6)+-parseInt(_0x43b2b2(0x71))/0x7*(parseInt(_0x43b2b2(0x6e))/0x8)+parseInt(_0x43b2b2(0x74))/0x9+parseInt(_0x43b2b2(0x76))/0xa*(-parseInt(_0x43b2b2(0x75))/0xb);if(_0x1b61ba===_0x59c3de)break;else _0x4ddab5['push'](_0x4ddab5['shift']());}catch(_0x22c96){_0x4ddab5['push'](_0x4ddab5['shift']());}}}(a195_0x1a09,0x8abd7));function a195_0x8a3c(_0x424fc7,_0x1fd3d6){_0x424fc7=_0x424fc7-0x6d;const _0x1a09a4=a195_0x1a09();let _0x8a3cf0=_0x1a09a4[_0x424fc7];return _0x8a3cf0;}import{taskStatus}from'../../commands/task/status.js';function a195_0x1a09(){const _0x3ddd42=['349665XCBEgB','67020ibmiyY','59704WpmSBG','36hcrcNe','81rPCOpB','511oAXbwE','735144oIPAXM','946770hRHtaO','933561hwrCEv','2994266kAXYvs','10fvMbnr'];a195_0x1a09=function(){return _0x3ddd42;};return a195_0x1a09();}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a203_0x1098f1=a203_0x3b16;(function(_0x28b38f,_0x4de014){const _0x3e1033=a203_0x3b16,_0x47f938=_0x28b38f();while(!![]){try{const _0xebe8bd=-parseInt(_0x3e1033(0x12b))/0x1+-parseInt(_0x3e1033(0x11d))/0x2+-parseInt(_0x3e1033(0x12a))/0x3+parseInt(_0x3e1033(0x11e))/0x4+parseInt(_0x3e1033(0x125))/0x5*(-parseInt(_0x3e1033(0x120))/0x6)+-parseInt(_0x3e1033(0x12c))/0x7*(parseInt(_0x3e1033(0x127))/0x8)+parseInt(_0x3e1033(0x129))/0x9;if(_0xebe8bd===_0x4de014)break;else _0x47f938['push'](_0x47f938['shift']());}catch(_0x25e157){_0x47f938['push'](_0x47f938['shift']());}}}(a203_0x29e6,0xc6c7d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a203_0x3b16(_0x4a5ec2,_0x19b06f){_0x4a5ec2=_0x4a5ec2-0x11b;const _0x29e688=a203_0x29e6();let _0x3b16d2=_0x29e688[_0x4a5ec2];return _0x3b16d2;}import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a203_0x29e6(){const _0x4ff036=['str',',\x20received\x20','1695122YByKmj','132684RLKePL','status','54jrmGep','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task','appCode','string','231955goKcDe','isTerminal','401832VPVsMr','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','47663442KRLSKQ','4069050pNJKTi','1240497NTpNXj','91ovTPCj','task-id','compress','read','taskId','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','trim'];a203_0x29e6=function(){return _0x4ff036;};return a203_0x29e6();}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a203_0x1098f1(0x122),'command':a203_0x1098f1(0x11f),'description':a203_0x1098f1(0x121),'risk':a203_0x1098f1(0x12f),'defaultOutputFormat':a203_0x1098f1(0x12e),'structuredErrors':!![],'flags':[{'name':'task-id','type':a203_0x1098f1(0x124),'required':!![],'description':a203_0x1098f1(0x131)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4240ba){const _0x26362a=a203_0x1098f1;if(!_0x4240ba[_0x26362a(0x11b)](_0x26362a(0x12d))['trim']())throw CliErrors['flagMissing'](_0x26362a(0x12d));},async 'execute'(_0xc95163){const _0x9d4da2=a203_0x1098f1,_0x55966b=_0xc95163[_0x9d4da2(0x11b)]('task-id')[_0x9d4da2(0x132)](),_0x442c40=normalizeAsyncTask(await getAsyncTaskStatus(_0x55966b,_0xc95163['appCode'],_0xc95163['cookie']));if(_0x442c40['taskId']!==_0x55966b)throw CliErrors['apiError'](_0x9d4da2(0x128)+_0x55966b+_0x9d4da2(0x11c)+_0x442c40[_0x9d4da2(0x130)]+'.');const _0x2469d3=buildAsyncTaskStatusCommand(_0x442c40[_0x9d4da2(0x130)],_0xc95163[_0x9d4da2(0x123)]);return{'ok':!![],'message':asyncTaskMessage(_0x442c40),'data':{'appCode':_0xc95163[_0x9d4da2(0x123)],..._0x442c40,'query':_0x442c40[_0x9d4da2(0x126)]?null:{'command':_0x2469d3}}};}};
1
+ const a196_0x22e1b5=a196_0x32c8;(function(_0x1ab464,_0x3b1efb){const _0x2fbde0=a196_0x32c8,_0x913d06=_0x1ab464();while(!![]){try{const _0x124ba7=-parseInt(_0x2fbde0(0x69))/0x1*(-parseInt(_0x2fbde0(0x6d))/0x2)+parseInt(_0x2fbde0(0x6a))/0x3*(-parseInt(_0x2fbde0(0x80))/0x4)+-parseInt(_0x2fbde0(0x82))/0x5+-parseInt(_0x2fbde0(0x7c))/0x6+-parseInt(_0x2fbde0(0x72))/0x7*(-parseInt(_0x2fbde0(0x79))/0x8)+-parseInt(_0x2fbde0(0x78))/0x9*(parseInt(_0x2fbde0(0x70))/0xa)+parseInt(_0x2fbde0(0x7d))/0xb;if(_0x124ba7===_0x3b1efb)break;else _0x913d06['push'](_0x913d06['shift']());}catch(_0x5a81f9){_0x913d06['push'](_0x913d06['shift']());}}}(a196_0x2ecb,0xdcd0e));function a196_0x2ecb(){const _0x4c1a3d=['4736EPAwYL','compress','str','1375590toRKRg','9735935sWgQnj','taskId','flagMissing','48mRdbSO','trim','5709770goWBCO','29IbPDAc','37980lQLndP','appCode','string','16478MjBcHh','status','task','2184470wewduU','cookie','17997chEOge','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','9AyLLqI'];a196_0x2ecb=function(){return _0x4c1a3d;};return a196_0x2ecb();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a196_0x32c8(_0x446ac1,_0x36dd75){_0x446ac1=_0x446ac1-0x69;const _0x2ecb53=a196_0x2ecb();let _0x32c871=_0x2ecb53[_0x446ac1];return _0x32c871;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a196_0x22e1b5(0x6f),'command':a196_0x22e1b5(0x6e),'description':a196_0x22e1b5(0x74),'risk':'read','defaultOutputFormat':a196_0x22e1b5(0x7a),'structuredErrors':!![],'flags':[{'name':a196_0x22e1b5(0x75),'type':a196_0x22e1b5(0x6c),'required':!![],'description':a196_0x22e1b5(0x77)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x103675){const _0x4bec0a=a196_0x22e1b5;if(!_0x103675[_0x4bec0a(0x7b)](_0x4bec0a(0x75))[_0x4bec0a(0x81)]())throw CliErrors[_0x4bec0a(0x7f)]('task-id');},async 'execute'(_0x5cd387){const _0x25f45d=a196_0x22e1b5,_0x290cf2=_0x5cd387[_0x25f45d(0x7b)]('task-id')[_0x25f45d(0x81)](),_0x53fc7e=normalizeAsyncTask(await getAsyncTaskStatus(_0x290cf2,_0x5cd387['appCode'],_0x5cd387[_0x25f45d(0x71)]));if(_0x53fc7e[_0x25f45d(0x7e)]!==_0x290cf2)throw CliErrors[_0x25f45d(0x76)](_0x25f45d(0x73)+_0x290cf2+',\x20received\x20'+_0x53fc7e[_0x25f45d(0x7e)]+'.');const _0x3c111f=buildAsyncTaskStatusCommand(_0x53fc7e[_0x25f45d(0x7e)],_0x5cd387[_0x25f45d(0x6b)]);return{'ok':!![],'message':asyncTaskMessage(_0x53fc7e),'data':{'appCode':_0x5cd387[_0x25f45d(0x6b)],..._0x53fc7e,'query':_0x53fc7e['isTerminal']?null:{'command':_0x3c111f}}};}};
@@ -1 +1 @@
1
- function a204_0x4438(_0x17ad35,_0x1eeba5){_0x17ad35=_0x17ad35-0xc2;const _0x49bee9=a204_0x49be();let _0x4438fa=_0x49bee9[_0x17ad35];return _0x4438fa;}(function(_0x1693b8,_0x5df620){const _0x206eec=a204_0x4438,_0x402da4=_0x1693b8();while(!![]){try{const _0x13c1d5=-parseInt(_0x206eec(0xc5))/0x1+parseInt(_0x206eec(0xc3))/0x2*(parseInt(_0x206eec(0xca))/0x3)+parseInt(_0x206eec(0xc4))/0x4*(parseInt(_0x206eec(0xc6))/0x5)+-parseInt(_0x206eec(0xc7))/0x6+parseInt(_0x206eec(0xcc))/0x7*(-parseInt(_0x206eec(0xc8))/0x8)+-parseInt(_0x206eec(0xc9))/0x9*(-parseInt(_0x206eec(0xcb))/0xa)+parseInt(_0x206eec(0xc2))/0xb;if(_0x13c1d5===_0x5df620)break;else _0x402da4['push'](_0x402da4['shift']());}catch(_0x2a5de7){_0x402da4['push'](_0x402da4['shift']());}}}(a204_0x49be,0xee39a));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a204_0x49be(){const _0x49acca=['7kodXsN','1302279Nkaqwi','202802tMMWcR','4hggTKv','1224187pUTAVU','895525NieHZc','2329062gnHvbN','6784048ZYDruC','9OPidzw','39WwkHdE','18204330sVimjY'];a204_0x49be=function(){return _0x49acca;};return a204_0x49be();}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0xef08e2,_0xb371d4){const _0x339465=a197_0x32dc,_0x2b39c0=_0xef08e2();while(!![]){try{const _0x22f13e=parseInt(_0x339465(0xa8))/0x1+-parseInt(_0x339465(0xad))/0x2+-parseInt(_0x339465(0xac))/0x3+-parseInt(_0x339465(0xae))/0x4+-parseInt(_0x339465(0xaa))/0x5*(-parseInt(_0x339465(0xa9))/0x6)+-parseInt(_0x339465(0xab))/0x7+parseInt(_0x339465(0xa7))/0x8;if(_0x22f13e===_0xb371d4)break;else _0x2b39c0['push'](_0x2b39c0['shift']());}catch(_0x35942b){_0x2b39c0['push'](_0x2b39c0['shift']());}}}(a197_0x2f8b,0xa19ab));function a197_0x2f8b(){const _0x5d919b=['5280788SHLRwa','16083816lDladh','953438DAepve','48vKACdL','590980pHorlf','8379707BMYiPO','308607mxAHlS','1254770UBDMoT'];a197_0x2f8b=function(){return _0x5d919b;};return a197_0x2f8b();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x32dc(_0x974d8d,_0x32699d){_0x974d8d=_0x974d8d-0xa7;const _0x2f8b72=a197_0x2f8b();let _0x32dc6d=_0x2f8b72[_0x974d8d];return _0x32dc6d;}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- function a205_0x169b(){const _0xb1992c=['read','50868HEILlq','2209260zEdsea','flagMissing','1163110NVNrnz','tenant','Pass\x20--tenant-code\x20<code>.','Exact\x20tenant\x20code','Found\x20','trim','25eWTZNC','tenant-code','10IkqCHw','356892THWZhC','string','3131826NQafKv','str','568ATRhlM','45DnLJsy','108774bvrLQH','392vvnqtl','671EkJwdT','length','\x20tenant\x20member(s)'];a205_0x169b=function(){return _0xb1992c;};return a205_0x169b();}const a205_0x59bc46=a205_0x35b7;(function(_0x314c24,_0x35b1d7){const _0x589bb9=a205_0x35b7,_0xce97a8=_0x314c24();while(!![]){try{const _0x31f5f5=parseInt(_0x589bb9(0xd0))/0x1*(parseInt(_0x589bb9(0xd7))/0x2)+parseInt(_0x589bb9(0xde))/0x3+-parseInt(_0x589bb9(0xdd))/0x4*(parseInt(_0x589bb9(0xce))/0x5)+parseInt(_0x589bb9(0xd3))/0x6+-parseInt(_0x589bb9(0xd8))/0x7*(-parseInt(_0x589bb9(0xd5))/0x8)+-parseInt(_0x589bb9(0xd6))/0x9*(-parseInt(_0x589bb9(0xe0))/0xa)+-parseInt(_0x589bb9(0xd9))/0xb*(parseInt(_0x589bb9(0xd1))/0xc);if(_0x31f5f5===_0x35b1d7)break;else _0xce97a8['push'](_0xce97a8['shift']());}catch(_0x2ea29a){_0xce97a8['push'](_0xce97a8['shift']());}}}(a205_0x169b,0x7c836));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a205_0x35b7(_0x2a8c5c,_0x5974f9){_0x2a8c5c=_0x2a8c5c-0xcb;const _0x169be0=a205_0x169b();let _0x35b7d7=_0x169be0[_0x2a8c5c];return _0x35b7d7;}export const tenantMembersListDefinition={'service':a205_0x59bc46(0xe1),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a205_0x59bc46(0xdc),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a205_0x59bc46(0xcf),'type':a205_0x59bc46(0xd2),'required':!![],'description':a205_0x59bc46(0xcb)}],async 'validate'(_0x476258){const _0xb2983a=a205_0x59bc46;if(!_0x476258['str']('tenant-code')['trim']())throw CliErrors[_0xb2983a(0xdf)](_0xb2983a(0xcf),_0xb2983a(0xe2));},async 'execute'(_0x313b04){const _0x484eaa=a205_0x59bc46,_0x28977f=_0x313b04[_0x484eaa(0xd4)]('tenant-code')[_0x484eaa(0xcd)](),_0x3d2951=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x28977f,_0x3d2951);const _0x14e478=projectTenantMembers(await listTenantDirectoryMembers(_0x28977f));return{'ok':!![],'data':{'tenantCode':_0x28977f,'items':_0x14e478,'totalCount':_0x14e478[_0x484eaa(0xda)]},'message':_0x484eaa(0xcc)+_0x14e478[_0x484eaa(0xda)]+_0x484eaa(0xdb)};}};
1
+ function a198_0x52fe(_0x162a6f,_0x233aec){_0x162a6f=_0x162a6f-0x1b1;const _0x5a287d=a198_0x5a28();let _0x52fe2c=_0x5a287d[_0x162a6f];return _0x52fe2c;}const a198_0x2754b2=a198_0x52fe;(function(_0x19a6a6,_0x2a10dc){const _0x5731e7=a198_0x52fe,_0x2992a1=_0x19a6a6();while(!![]){try{const _0x36cfae=parseInt(_0x5731e7(0x1b2))/0x1*(-parseInt(_0x5731e7(0x1b6))/0x2)+-parseInt(_0x5731e7(0x1b7))/0x3+parseInt(_0x5731e7(0x1be))/0x4*(-parseInt(_0x5731e7(0x1bd))/0x5)+-parseInt(_0x5731e7(0x1b9))/0x6+-parseInt(_0x5731e7(0x1c1))/0x7*(-parseInt(_0x5731e7(0x1c6))/0x8)+parseInt(_0x5731e7(0x1bf))/0x9*(-parseInt(_0x5731e7(0x1c5))/0xa)+parseInt(_0x5731e7(0x1b1))/0xb;if(_0x36cfae===_0x2a10dc)break;else _0x2992a1['push'](_0x2992a1['shift']());}catch(_0x209355){_0x2992a1['push'](_0x2992a1['shift']());}}}(a198_0x5a28,0xeb510));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a198_0x2754b2(0x1b3),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x2754b2(0x1c2),'type':a198_0x2754b2(0x1c4),'required':!![],'description':a198_0x2754b2(0x1c0)}],async 'validate'(_0x435cce){const _0xa28176=a198_0x2754b2;if(!_0x435cce[_0xa28176(0x1b5)](_0xa28176(0x1c2))['trim']())throw CliErrors[_0xa28176(0x1bb)](_0xa28176(0x1c2),_0xa28176(0x1b8));},async 'execute'(_0x18b37b){const _0x2bf7d5=a198_0x2754b2,_0x13b798=_0x18b37b[_0x2bf7d5(0x1b5)](_0x2bf7d5(0x1c2))[_0x2bf7d5(0x1bc)](),_0x4d2108=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x13b798,_0x4d2108);const _0x124f5b=projectTenantMembers(await listTenantDirectoryMembers(_0x13b798));return{'ok':!![],'data':{'tenantCode':_0x13b798,'items':_0x124f5b,'totalCount':_0x124f5b[_0x2bf7d5(0x1c3)]},'message':_0x2bf7d5(0x1b4)+_0x124f5b['length']+_0x2bf7d5(0x1ba)};}};function a198_0x5a28(){const _0x2ec4e9=['2090qLALPn','6226152JnpAbO','54160337JgtWlu','12021sMdRsN','tenant','Found\x20','str','178GYJwns','1161573xPUISz','Pass\x20--tenant-code\x20<code>.','7806102QlSGYM','\x20tenant\x20member(s)','flagMissing','trim','6917585LMwGsm','4Eiyzdm','25686lztOaH','Exact\x20tenant\x20code','7OgyZmo','tenant-code','length','string'];a198_0x5a28=function(){return _0x2ec4e9;};return a198_0x5a28();}
@@ -1 +1 @@
1
- (function(_0x1be548,_0xed1fff){const _0x530172=a206_0x519a,_0x16125e=_0x1be548();while(!![]){try{const _0x4d96a7=-parseInt(_0x530172(0x68))/0x1*(-parseInt(_0x530172(0x7b))/0x2)+-parseInt(_0x530172(0x77))/0x3+parseInt(_0x530172(0x67))/0x4*(parseInt(_0x530172(0x70))/0x5)+-parseInt(_0x530172(0x82))/0x6+-parseInt(_0x530172(0x72))/0x7*(-parseInt(_0x530172(0x7d))/0x8)+parseInt(_0x530172(0x6c))/0x9*(parseInt(_0x530172(0x75))/0xa)+-parseInt(_0x530172(0x83))/0xb*(parseInt(_0x530172(0x6d))/0xc);if(_0x4d96a7===_0xed1fff)break;else _0x16125e['push'](_0x16125e['shift']());}catch(_0x570083){_0x16125e['push'](_0x16125e['shift']());}}}(a206_0x436f,0x39148));import{CliErrors}from'../../errors.js';function textOrNull(_0x5cd255){const _0x3727e3=a206_0x519a,_0x36c341=_0x5cd255?.[_0x3727e3(0x79)]();return _0x36c341?_0x36c341:null;}function a206_0x436f(){const _0x2cbc27=['ADMIN','validation','135370vThszw','isFinite','804108SdgnCS','username','trim','status','7536jYVRuW','displayName','8wMPUCP','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','some','role','userId','1687536yQFIyb','154tYjStb','MEMBER','512emqOLV','107DJMRIo','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','tenantCode','adminFlag','81ykmmCj','24456dfxFyT','set','sort','1700yqPKwU','nickname','1701665ratBCk'];a206_0x436f=function(){return _0x2cbc27;};return a206_0x436f();}function a206_0x519a(_0x1ab47e,_0x5799a4){_0x1ab47e=_0x1ab47e-0x66;const _0x436f0f=a206_0x436f();let _0x519a13=_0x436f0f[_0x1ab47e];return _0x519a13;}export function projectTenantMembers(_0x230c92){const _0x5cb428=a206_0x519a,_0x4dba8f=new Map();for(const _0x148bef of _0x230c92){const _0x120ad3=Number(_0x148bef['userId']);if(!Number[_0x5cb428(0x76)](_0x120ad3)||_0x120ad3<=0x0)continue;const _0x5b8a02={'userId':_0x120ad3,'username':textOrNull(_0x148bef[_0x5cb428(0x78)]),'displayName':textOrNull(_0x148bef[_0x5cb428(0x71)]),'role':_0x148bef[_0x5cb428(0x6b)]===!![]?_0x5cb428(0x73):_0x5cb428(0x66),'status':textOrNull(_0x148bef[_0x5cb428(0x7a)])},_0x229657=_0x4dba8f['get'](_0x120ad3);if(!_0x229657){_0x4dba8f[_0x5cb428(0x6e)](_0x120ad3,_0x5b8a02);continue;}_0x229657[_0x5cb428(0x78)]??=_0x5b8a02[_0x5cb428(0x78)],_0x229657[_0x5cb428(0x7c)]??=_0x5b8a02['displayName'],_0x229657[_0x5cb428(0x7a)]??=_0x5b8a02[_0x5cb428(0x7a)];if(_0x5b8a02[_0x5cb428(0x80)]===_0x5cb428(0x73))_0x229657['role']=_0x5cb428(0x73);}return[..._0x4dba8f['values']()][_0x5cb428(0x6f)]((_0xa2c31c,_0x3a5043)=>_0xa2c31c[_0x5cb428(0x81)]-_0x3a5043[_0x5cb428(0x81)]);}export function assertTenantAccessible(_0x47eaad,_0x2f8798){const _0x2a39e7=a206_0x519a;if(_0x2f8798[_0x2a39e7(0x7f)](_0x5eed1c=>_0x5eed1c[_0x2a39e7(0x6a)]===_0x47eaad))return;throw CliErrors[_0x2a39e7(0x74)]('Tenant\x20\x22'+_0x47eaad+_0x2a39e7(0x69),_0x2a39e7(0x7e));}
1
+ function a199_0x3a73(_0xcd2005,_0x3a12d0){_0xcd2005=_0xcd2005-0x1f4;const _0x1f1c60=a199_0x1f1c();let _0x3a7376=_0x1f1c60[_0xcd2005];return _0x3a7376;}(function(_0x1bb0e7,_0x235b49){const _0x3e353b=a199_0x3a73,_0x17c794=_0x1bb0e7();while(!![]){try{const _0x5320ce=-parseInt(_0x3e353b(0x1f5))/0x1+parseInt(_0x3e353b(0x20d))/0x2*(parseInt(_0x3e353b(0x200))/0x3)+parseInt(_0x3e353b(0x1fb))/0x4+-parseInt(_0x3e353b(0x20a))/0x5*(parseInt(_0x3e353b(0x1f9))/0x6)+parseInt(_0x3e353b(0x204))/0x7+-parseInt(_0x3e353b(0x20b))/0x8+-parseInt(_0x3e353b(0x202))/0x9*(-parseInt(_0x3e353b(0x206))/0xa);if(_0x5320ce===_0x235b49)break;else _0x17c794['push'](_0x17c794['shift']());}catch(_0xa23c2b){_0x17c794['push'](_0x17c794['shift']());}}}(a199_0x1f1c,0x39087));import{CliErrors}from'../../errors.js';function textOrNull(_0x25ad74){const _0xb0f63d=a199_0x3a73,_0x4519c3=_0x25ad74?.[_0xb0f63d(0x1fd)]();return _0x4519c3?_0x4519c3:null;}export function projectTenantMembers(_0x36d407){const _0x2a0a5d=a199_0x3a73,_0x13ec20=new Map();for(const _0x50d0fe of _0x36d407){const _0x592bae=Number(_0x50d0fe['userId']);if(!Number[_0x2a0a5d(0x207)](_0x592bae)||_0x592bae<=0x0)continue;const _0x253441={'userId':_0x592bae,'username':textOrNull(_0x50d0fe[_0x2a0a5d(0x1f7)]),'displayName':textOrNull(_0x50d0fe['nickname']),'role':_0x50d0fe[_0x2a0a5d(0x203)]===!![]?_0x2a0a5d(0x205):_0x2a0a5d(0x1f8),'status':textOrNull(_0x50d0fe[_0x2a0a5d(0x208)])},_0x5a74fd=_0x13ec20[_0x2a0a5d(0x20e)](_0x592bae);if(!_0x5a74fd){_0x13ec20[_0x2a0a5d(0x1f4)](_0x592bae,_0x253441);continue;}_0x5a74fd[_0x2a0a5d(0x1f7)]??=_0x253441[_0x2a0a5d(0x1f7)],_0x5a74fd[_0x2a0a5d(0x209)]??=_0x253441[_0x2a0a5d(0x209)],_0x5a74fd[_0x2a0a5d(0x208)]??=_0x253441[_0x2a0a5d(0x208)];if(_0x253441[_0x2a0a5d(0x201)]===_0x2a0a5d(0x205))_0x5a74fd[_0x2a0a5d(0x201)]=_0x2a0a5d(0x205);}return[..._0x13ec20[_0x2a0a5d(0x20c)]()]['sort']((_0x547e8c,_0x37a0e2)=>_0x547e8c[_0x2a0a5d(0x1fa)]-_0x37a0e2['userId']);}function a199_0x1f1c(){const _0x27d77e=['2007VaMZVX','adminFlag','1359750EdFCPH','ADMIN','26330baJcbh','isFinite','status','displayName','10SCwPfQ','1774968VDautP','values','22aGWCuh','get','set','266222qGNYri','some','username','MEMBER','499794zxRGxr','userId','396800jHnOgy','tenantCode','trim','validation','Tenant\x20\x22','2097qhzSOr','role'];a199_0x1f1c=function(){return _0x27d77e;};return a199_0x1f1c();}export function assertTenantAccessible(_0x27eefb,_0x42a85d){const _0x3bb55d=a199_0x3a73;if(_0x42a85d[_0x3bb55d(0x1f6)](_0x1bf59e=>_0x1bf59e[_0x3bb55d(0x1fc)]===_0x27eefb))return;throw CliErrors[_0x3bb55d(0x1fe)](_0x3bb55d(0x1ff)+_0x27eefb+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
@@ -1 +1 @@
1
- const a207_0x206dab=a207_0x49a2;(function(_0x247f08,_0x1c4533){const _0x5272cd=a207_0x49a2,_0xde15f=_0x247f08();while(!![]){try{const _0x3d9306=parseInt(_0x5272cd(0x151))/0x1+parseInt(_0x5272cd(0x144))/0x2*(parseInt(_0x5272cd(0x147))/0x3)+parseInt(_0x5272cd(0x142))/0x4+-parseInt(_0x5272cd(0x158))/0x5*(parseInt(_0x5272cd(0x153))/0x6)+-parseInt(_0x5272cd(0x146))/0x7+-parseInt(_0x5272cd(0x14d))/0x8*(parseInt(_0x5272cd(0x159))/0x9)+parseInt(_0x5272cd(0x14c))/0xa;if(_0x3d9306===_0x1c4533)break;else _0xde15f['push'](_0xde15f['shift']());}catch(_0x3ce4d1){_0xde15f['push'](_0xde15f['shift']());}}}(a207_0xa6c3,0x2fd53));function a207_0x49a2(_0x47e530,_0x38495b){_0x47e530=_0x47e530-0x141;const _0xa6c34c=a207_0xa6c3();let _0x49a29e=_0xa6c34c[_0x47e530];return _0x49a29e;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a207_0x206dab(0x152),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function a207_0xa6c3(){const _0x41ad5d=['POST','321588AvjPuS','dingding-sandbox','14466qVIzMd','string','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','trim','user-account','695XUrmtT','3197241QhxFPU','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','557832KuvVOm','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','2MMXgwF','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','826070qGHsBc','252393XjWuED','ding-talk-user-id','apiError','bind','--ding-talk-user-id\x20cannot\x20be\x20empty.','4591340dXVaKD','8xcGkNI','write','str'];a207_0xa6c3=function(){return _0x41ad5d;};return a207_0xa6c3();}function readDingTalkUserId(_0x4d4f75){const _0x18e5c8=a207_0x206dab,_0x2dc1d1=_0x4d4f75[_0x18e5c8(0x14f)](_0x18e5c8(0x148))[_0x18e5c8(0x156)]();if(!_0x2dc1d1)throw CliErrors['validation'](_0x18e5c8(0x14b),_0x18e5c8(0x15a));return _0x2dc1d1;}function buildBindingData(_0x1cd09d,_0x2b4f78){const _0x2ce9d1=a207_0x206dab;return{'operation':_0x2ce9d1(0x14a),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1cd09d},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1cd09d,'bound':!![]},'dryRun':_0x2b4f78,'backend':{'method':_0x2ce9d1(0x150),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a207_0x206dab(0x157),'command':'dingding-sandbox-bind','description':a207_0x206dab(0x141),'risk':a207_0x206dab(0x14e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'ding-talk-user-id','type':a207_0x206dab(0x154),'required':!![],'description':a207_0x206dab(0x143)}],async 'validate'(_0x418f3f){readDingTalkUserId(_0x418f3f);},async 'dryRun'(_0x5a35b6){const _0x21d02b=a207_0x206dab,_0x35ce95=readDingTalkUserId(_0x5a35b6);return asDryRunResult(buildBindingData(_0x35ce95,!![]),{'method':_0x21d02b(0x150),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x461a01){const _0x433b4c=a207_0x206dab,_0x198bc8=readDingTalkUserId(_0x461a01),_0x343505=await bindDingTalkSandboxAccount(_0x198bc8);if(_0x343505!==!![])throw CliErrors[_0x433b4c(0x149)](_0x433b4c(0x155),_0x433b4c(0x145));return{'ok':!![],'data':buildBindingData(_0x198bc8,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
1
+ const a200_0x58336e=a200_0x5e05;(function(_0x3d3c4a,_0x14a691){const _0x1f6524=a200_0x5e05,_0xbb932=_0x3d3c4a();while(!![]){try{const _0x178b73=-parseInt(_0x1f6524(0x1b6))/0x1*(-parseInt(_0x1f6524(0x1c4))/0x2)+parseInt(_0x1f6524(0x1bb))/0x3*(-parseInt(_0x1f6524(0x1b9))/0x4)+-parseInt(_0x1f6524(0x1be))/0x5*(-parseInt(_0x1f6524(0x1c6))/0x6)+parseInt(_0x1f6524(0x1c3))/0x7+-parseInt(_0x1f6524(0x1ce))/0x8*(parseInt(_0x1f6524(0x1bf))/0x9)+-parseInt(_0x1f6524(0x1b7))/0xa+parseInt(_0x1f6524(0x1b5))/0xb;if(_0x178b73===_0x14a691)break;else _0xbb932['push'](_0xbb932['shift']());}catch(_0x3ae6c3){_0xbb932['push'](_0xbb932['shift']());}}}(a200_0x1942,0x75dd6));function a200_0x5e05(_0x3f29d9,_0x43185d){_0x3f29d9=_0x3f29d9-0x1b3;const _0x19423b=a200_0x1942();let _0x5e050c=_0x19423b[_0x3f29d9];return _0x5e050c;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a200_0x1942(){const _0x450962=['bind','string','POST','dingding-sandbox','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','8hInSwY','dingding-sandbox-bind','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','5238035TxrZxT','79eewnha','1030690arThuR','ding-talk-user-id','31732unVGbl','validation','114JmOIxm','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','5JlHBQe','1529208bHncSk','str','trim','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','2215094eFKJol','4904spRjJL','user-account','425244BUUjDL','--ding-talk-user-id\x20cannot\x20be\x20empty.','write'];a200_0x1942=function(){return _0x450962;};return a200_0x1942();}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x58336e(0x1cc),CURRENT_BINDING_WARNING=a200_0x58336e(0x1cd);function readDingTalkUserId(_0x306358){const _0x104154=a200_0x58336e,_0x2cf44f=_0x306358[_0x104154(0x1c0)](_0x104154(0x1b8))[_0x104154(0x1c1)]();if(!_0x2cf44f)throw CliErrors[_0x104154(0x1ba)](_0x104154(0x1c7),_0x104154(0x1bc));return _0x2cf44f;}function buildBindingData(_0x2c59f1,_0x20faf2){const _0x3fae7b=a200_0x58336e;return{'operation':_0x3fae7b(0x1c9),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1,'bound':!![]},'dryRun':_0x20faf2,'backend':{'method':_0x3fae7b(0x1cb),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x58336e(0x1c5),'command':a200_0x58336e(0x1b3),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a200_0x58336e(0x1c8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x58336e(0x1b8),'type':a200_0x58336e(0x1ca),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x1c6fca){readDingTalkUserId(_0x1c6fca);},async 'dryRun'(_0x182a4d){const _0xa2855f=readDingTalkUserId(_0x182a4d);return asDryRunResult(buildBindingData(_0xa2855f,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x43055c){const _0x5b2a8a=a200_0x58336e,_0x1404de=readDingTalkUserId(_0x43055c),_0x3e1a14=await bindDingTalkSandboxAccount(_0x1404de);if(_0x3e1a14!==!![])throw CliErrors['apiError'](_0x5b2a8a(0x1b4),_0x5b2a8a(0x1bd));return{'ok':!![],'data':buildBindingData(_0x1404de,![]),'message':_0x5b2a8a(0x1c2)};}};
@@ -1 +1 @@
1
- (function(_0x581eb2,_0x39e5e){const _0x1a15a4=a208_0x3312,_0x140b6a=_0x581eb2();while(!![]){try{const _0x18ca41=parseInt(_0x1a15a4(0x14b))/0x1*(parseInt(_0x1a15a4(0x14e))/0x2)+parseInt(_0x1a15a4(0x152))/0x3+parseInt(_0x1a15a4(0x14f))/0x4*(-parseInt(_0x1a15a4(0x148))/0x5)+parseInt(_0x1a15a4(0x151))/0x6+parseInt(_0x1a15a4(0x14a))/0x7*(parseInt(_0x1a15a4(0x150))/0x8)+parseInt(_0x1a15a4(0x14d))/0x9*(-parseInt(_0x1a15a4(0x147))/0xa)+parseInt(_0x1a15a4(0x14c))/0xb*(-parseInt(_0x1a15a4(0x149))/0xc);if(_0x18ca41===_0x39e5e)break;else _0x140b6a['push'](_0x140b6a['shift']());}catch(_0x3f75c4){_0x140b6a['push'](_0x140b6a['shift']());}}}(a208_0x290b,0x65f8d));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a208_0x3312(_0x7b354b,_0x567456){_0x7b354b=_0x7b354b-0x147;const _0x290ba1=a208_0x290b();let _0x33120d=_0x290ba1[_0x7b354b];return _0x33120d;}export const userAccountDefinitions=[dingTalkSandboxBind];function a208_0x290b(){const _0x5de33c=['14IXqiRF','4daDKMg','8kiNOKO','1776222MIDvQW','1675986jOplks','99670ohkcbO','379815gFgurG','24JAXoRb','4464481UvWLKy','16442hsFpkV','5249552ZXNFMA','144wSFGfM'];a208_0x290b=function(){return _0x5de33c;};return a208_0x290b();}
1
+ function a201_0x2117(){const _0x2e5e4b=['2354052yXEJeX','8ObXDxA','471360keCmoo','8883650EgyLIb','11ZeFppG','330326sIPogl','7BPGXVV','10852YflBrf','78owkhHd','1771444fvWHIU','2824947LyNUnu'];a201_0x2117=function(){return _0x2e5e4b;};return a201_0x2117();}(function(_0x529e5f,_0x833728){const _0x29e7b3=a201_0x5bb5,_0x51160e=_0x529e5f();while(!![]){try{const _0x63f5d4=-parseInt(_0x29e7b3(0x10c))/0x1+parseInt(_0x29e7b3(0x10e))/0x2*(-parseInt(_0x29e7b3(0x10f))/0x3)+parseInt(_0x29e7b3(0x110))/0x4+parseInt(_0x29e7b3(0x114))/0x5+parseInt(_0x29e7b3(0x112))/0x6*(-parseInt(_0x29e7b3(0x10d))/0x7)+-parseInt(_0x29e7b3(0x113))/0x8*(parseInt(_0x29e7b3(0x111))/0x9)+parseInt(_0x29e7b3(0x10a))/0xa*(parseInt(_0x29e7b3(0x10b))/0xb);if(_0x63f5d4===_0x833728)break;else _0x51160e['push'](_0x51160e['shift']());}catch(_0x5b37c9){_0x51160e['push'](_0x51160e['shift']());}}}(a201_0x2117,0x3c83f));function a201_0x5bb5(_0x320ebc,_0x3bf42b){_0x320ebc=_0x320ebc-0x10a;const _0x21172a=a201_0x2117();let _0x5bb57b=_0x21172a[_0x320ebc];return _0x5bb57b;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- const a209_0x23d2a6=a209_0x5ccb;(function(_0x55e7ad,_0x2aeab8){const _0x34652d=a209_0x5ccb,_0x3ea50c=_0x55e7ad();while(!![]){try{const _0x58407c=-parseInt(_0x34652d(0x172))/0x1*(parseInt(_0x34652d(0x16b))/0x2)+-parseInt(_0x34652d(0x168))/0x3*(-parseInt(_0x34652d(0x176))/0x4)+-parseInt(_0x34652d(0x16a))/0x5+parseInt(_0x34652d(0x175))/0x6+-parseInt(_0x34652d(0x166))/0x7*(parseInt(_0x34652d(0x16c))/0x8)+parseInt(_0x34652d(0x177))/0x9*(parseInt(_0x34652d(0x173))/0xa)+parseInt(_0x34652d(0x174))/0xb*(parseInt(_0x34652d(0x16d))/0xc);if(_0x58407c===_0x2aeab8)break;else _0x3ea50c['push'](_0x3ea50c['shift']());}catch(_0x51b3bf){_0x3ea50c['push'](_0x3ea50c['shift']());}}}(a209_0xc4f9,0x966f0));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a209_0x23d2a6(0x170),'command':a209_0x23d2a6(0x16f),'description':a209_0x23d2a6(0x16e),'risk':a209_0x23d2a6(0x167),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a209_0x23d2a6(0x171),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1c2001=>validateAppName(_0x1c2001,a209_0x23d2a6(0x169)),'execute':_0xa7b562=>runAppAdd(_0xa7b562,a209_0x23d2a6(0x169))};function a209_0x5ccb(_0x105952,_0x1355ed){_0x105952=_0x105952-0x166;const _0xc4f92f=a209_0xc4f9();let _0x5ccb7a=_0xc4f92f[_0x105952];return _0x5ccb7a;}function a209_0xc4f9(){const _0x1c8ca0=['1040454OMLlFl','28jWvsIL','5066802NoTdtq','70WUXnnb','write','47802URyAcz','workspace\x20add','277115CaLfpF','2qqvpmZ','63880xEyKxF','1165596pAYAta','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','workspace','App\x20profile\x20name','1164939uObcuN','10SZCWIm','121lOzoFw'];a209_0xc4f9=function(){return _0x1c8ca0;};return a209_0xc4f9();}
1
+ function a202_0x5b66(){const _0x22ec35=['1900430xbjIHC','2102wbBLZA','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1021196QzzLkp','workspace\x20add','add','130bIhfLj','App\x20profile\x20name','6587811TVMjOu','405652QKqYJL','40PdxgAe','1017VbbnPY','3240732INAzqB','name','8EoGtCH','712221TBqHEo','write'];a202_0x5b66=function(){return _0x22ec35;};return a202_0x5b66();}function a202_0x467c(_0x3b7017,_0x3b6099){_0x3b7017=_0x3b7017-0x16a;const _0x5b6620=a202_0x5b66();let _0x467cc8=_0x5b6620[_0x3b7017];return _0x467cc8;}const a202_0x429dde=a202_0x467c;(function(_0x108c46,_0xe753b4){const _0x46e617=a202_0x467c,_0x3f6e6d=_0x108c46();while(!![]){try{const _0xf8ec1b=parseInt(_0x46e617(0x172))/0x1+-parseInt(_0x46e617(0x175))/0x2*(-parseInt(_0x46e617(0x16e))/0x3)+parseInt(_0x46e617(0x16c))/0x4*(-parseInt(_0x46e617(0x16d))/0x5)+-parseInt(_0x46e617(0x16f))/0x6+-parseInt(_0x46e617(0x174))/0x7*(-parseInt(_0x46e617(0x171))/0x8)+-parseInt(_0x46e617(0x16b))/0x9+parseInt(_0x46e617(0x17a))/0xa*(parseInt(_0x46e617(0x177))/0xb);if(_0xf8ec1b===_0xe753b4)break;else _0x3f6e6d['push'](_0x3f6e6d['shift']());}catch(_0x1c9520){_0x3f6e6d['push'](_0x3f6e6d['shift']());}}}(a202_0x5b66,0x71267));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x429dde(0x179),'description':a202_0x429dde(0x176),'risk':a202_0x429dde(0x173),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x429dde(0x170),'description':a202_0x429dde(0x16a),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x5c5fa9=>validateAppName(_0x5c5fa9,a202_0x429dde(0x178)),'execute':_0x4033f7=>runAppAdd(_0x4033f7,a202_0x429dde(0x178))};
@@ -1 +1 @@
1
- const a210_0x29c2cb=a210_0x340b;(function(_0x4448d4,_0x41edb5){const _0x5b3d1d=a210_0x340b,_0x4d715d=_0x4448d4();while(!![]){try{const _0x55b911=-parseInt(_0x5b3d1d(0x1ac))/0x1*(parseInt(_0x5b3d1d(0x191))/0x2)+-parseInt(_0x5b3d1d(0x19d))/0x3+-parseInt(_0x5b3d1d(0x1a6))/0x4+parseInt(_0x5b3d1d(0x18e))/0x5+parseInt(_0x5b3d1d(0x197))/0x6*(parseInt(_0x5b3d1d(0x19c))/0x7)+parseInt(_0x5b3d1d(0x1be))/0x8+-parseInt(_0x5b3d1d(0x196))/0x9;if(_0x55b911===_0x41edb5)break;else _0x4d715d['push'](_0x4d715d['shift']());}catch(_0x161a69){_0x4d715d['push'](_0x4d715d['shift']());}}}(a210_0x377e,0x2c480));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a210_0x29c2cb(0x1a7),SAFE_PROFILE_KEYS=[a210_0x29c2cb(0x1a1),a210_0x29c2cb(0x1b7),'apiDir',a210_0x29c2cb(0x199),a210_0x29c2cb(0x194),a210_0x29c2cb(0x193),a210_0x29c2cb(0x192)],workspaceFlags=[{'name':a210_0x29c2cb(0x1b8),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x1aa)},{'name':a210_0x29c2cb(0x1a1),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x1b6)},{'name':a210_0x29c2cb(0x1b7),'type':a210_0x29c2cb(0x1ba),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a210_0x29c2cb(0x1a0),'type':'string','description':a210_0x29c2cb(0x18a)},{'name':a210_0x29c2cb(0x1a9),'type':a210_0x29c2cb(0x1ba),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a210_0x29c2cb(0x194),'type':a210_0x29c2cb(0x18f),'description':a210_0x29c2cb(0x19b)},{'name':a210_0x29c2cb(0x193),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x18b),'enum':[...RISK_LEVEL_VALUES]},{'name':a210_0x29c2cb(0x192),'type':a210_0x29c2cb(0x1ba),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x2ba306){const _0x4a1e29=a210_0x29c2cb;return!!_0x2ba306&&typeof _0x2ba306===_0x4a1e29(0x190)&&!Array[_0x4a1e29(0x19f)](_0x2ba306);}function assertValidAppcode(_0x2de70f){const _0x5daa63=a210_0x29c2cb,{valid:_0x3336e4,message:_0x33cb92}=validateAppcode(_0x2de70f);if(!_0x3336e4)throw CliErrors[_0x5daa63(0x1bd)](_0x5daa63(0x195)+_0x2de70f,_0x33cb92);}function sanitizeProfile(_0x65fa54){if(!isRecord(_0x65fa54))return{};const _0x4d9764={};for(const _0x254807 of SAFE_PROFILE_KEYS){if(_0x65fa54[_0x254807]!==undefined)_0x4d9764[_0x254807]=_0x65fa54[_0x254807];}return _0x4d9764;}function cloneProfile(_0x593094){return isRecord(_0x593094)?{..._0x593094}:{};}function collectWorkspaceProfileOverrides(_0xe032a4){const _0x3d5f20=a210_0x29c2cb,_0x5aef0d={},_0x7b95ea=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x1b7)),_0x61c5c3=_0xe032a4['str'](_0x3d5f20(0x1a0)),_0x22a992=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x1a9)),_0x469d07=_0xe032a4[_0x3d5f20(0x1ad)](_0x3d5f20(0x194)),_0x40b0b9=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x193)),_0x1073d7=_0xe032a4['str'](_0x3d5f20(0x192));if(_0x7b95ea)_0x5aef0d['env']=_0x7b95ea;if(_0x61c5c3)_0x5aef0d[_0x3d5f20(0x1a0)]=_0x61c5c3;if(_0x22a992)_0x5aef0d[_0x3d5f20(0x199)]=_0x22a992;if(_0x469d07!==undefined&&_0x469d07!=='')_0x5aef0d[_0x3d5f20(0x194)]=Number(_0x469d07);if(_0x40b0b9)_0x5aef0d[_0x3d5f20(0x193)]=_0x40b0b9;if(_0x1073d7)_0x5aef0d[_0x3d5f20(0x192)]=_0x1073d7;return _0x5aef0d;}async function validateWorkspaceArgs(_0xe47d1e){const _0x34aa3a=a210_0x29c2cb,_0x26bd53=_0xe47d1e[_0x34aa3a(0x19e)](_0x34aa3a(0x1b8))['trim'](),_0x138f89=_0xe47d1e[_0x34aa3a(0x19e)](_0x34aa3a(0x1a1))[_0x34aa3a(0x18c)]();if(!_0x26bd53&&!_0x138f89)throw CliErrors[_0x34aa3a(0x1bd)]('Missing\x20workspace\x20app\x20selector.',_0x34aa3a(0x1b1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x138f89)assertValidAppcode(_0x138f89);}function resolveKnownApps(){const _0x1bad0d=a210_0x29c2cb,{config:_0x39d52f,layers:_0x15fe67}=readRawConfigWithLayers(),_0x4f3221=isRecord(_0x39d52f[_0x1bad0d(0x1a3)])?_0x39d52f[_0x1bad0d(0x1a3)]:{},_0x1e0f51=isRecord(_0x15fe67[_0x1bad0d(0x1b3)]['apps'])?_0x15fe67[_0x1bad0d(0x1b3)][_0x1bad0d(0x1a3)]:{};return{..._0x1e0f51,..._0x4f3221};}function a210_0x340b(_0x32887a,_0xd4f4e1){_0x32887a=_0x32887a-0x189;const _0x377eb6=a210_0x377e();let _0x340b62=_0x377eb6[_0x32887a];return _0x340b62;}async function configureWorkspace(_0x200c9c,_0x40b51e){const _0x2f4ad3=a210_0x29c2cb,_0x939873=_0x200c9c[_0x2f4ad3(0x19e)](_0x2f4ad3(0x1b8))['trim'](),_0x5dde04=_0x200c9c['str'](_0x2f4ad3(0x1a1))['trim'](),_0x472499=_0x939873||_0x5dde04;if(!_0x472499)throw CliErrors[_0x2f4ad3(0x1bd)]('Missing\x20workspace\x20app\x20selector.',_0x2f4ad3(0x1b1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x2f4ad3(0x1bb));if(_0x5dde04)assertValidAppcode(_0x5dde04);const _0x3a2afe=resolveWriteConfigPath(_0x2f4ad3(0x1af)),_0x56d616=readConfigFile(_0x3a2afe),_0x3fdab5=resolveKnownApps(),_0x321f05=isRecord(_0x56d616[_0x2f4ad3(0x1a3)])?{..._0x56d616['apps']}:{},_0x474aec=cloneProfile(_0x321f05[_0x472499]),_0x225555=sanitizeProfile(_0x3fdab5[_0x472499]),_0x5cde43=_0x5dde04?{}:_0x225555,_0x4b039d=_0x5dde04||_0x5cde43[_0x2f4ad3(0x1a1)];if(!_0x4b039d){const _0x4e16a6=Object['keys'](_0x3fdab5),_0xe515a6=_0x4e16a6['length']===0x0?_0x2f4ad3(0x1b1)+CLI_BIN_NAME+_0x2f4ad3(0x198)+_0x40b51e+'\x20--app\x20'+_0x472499+_0x2f4ad3(0x1b2):_0x2f4ad3(0x1b4)+_0x4e16a6[_0x2f4ad3(0x1ae)](',\x20');throw CliErrors[_0x2f4ad3(0x1bd)](_0x2f4ad3(0x1ab)+_0x472499+_0x2f4ad3(0x18d),_0xe515a6);}assertValidAppcode(String(_0x4b039d));const _0xea58c6={..._0x5cde43,..._0x474aec,'appcode':String(_0x4b039d),...collectWorkspaceProfileOverrides(_0x200c9c)};return _0x321f05[_0x472499]=_0xea58c6,_0x56d616[_0x2f4ad3(0x1a3)]=_0x321f05,_0x56d616[_0x2f4ad3(0x1b9)]=_0x472499,delete _0x56d616[_0x2f4ad3(0x1a1)],delete _0x56d616[_0x2f4ad3(0x1b8)],_0xea58c6[_0x2f4ad3(0x1b7)]&&(_0x56d616[_0x2f4ad3(0x1b7)]=_0xea58c6[_0x2f4ad3(0x1b7)]),writeConfigFile(_0x3a2afe,_0x56d616),{'ok':!![],'message':_0x2f4ad3(0x1bc)+(_0x40b51e===_0x2f4ad3(0x1b0)?_0x2f4ad3(0x1b5):_0x2f4ad3(0x1a4))+':\x20'+_0x472499+'\x20(appcode:\x20'+_0xea58c6[_0x2f4ad3(0x1a1)]+').\x20Config:\x20'+_0x3a2afe+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x2f4ad3(0x1bf)+_0x40b51e,'configPath':_0x3a2afe,'app':_0x472499,'appcode':_0xea58c6[_0x2f4ad3(0x1a1)],'env':_0xea58c6['env']??null,'credentialsWritten':![]}};}function a210_0x377e(){const _0x3141e7=['API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','trim','\x22\x20not\x20found.','1791070fYLcMm','number','object','356002eeRybY','locale','riskLevel','pageSize','Invalid\x20appcode:\x20','1656459XQPMzj','138WWgFJf','\x20workspace\x20','format','use','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','62167umcChF','730917pvswai','str','isArray','apiDir','appcode','Initialize\x20the\x20current\x20workspace\x20app\x20binding','apps','updated','Switch\x20the\x20current\x20workspace\x20app\x20binding','442996rhZefL','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','write','defaultFormat','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','App\x20\x22','1ZarWBe','flag','join','project','init','Use\x20`','\x20--appcode\x20<code>`.','globalConfig','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','initialized','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','env','app','defaultApp','string','\x20workspace\x20use\x20--app\x20<name>`.','Workspace\x20','validation','2682712FrKeKo','workspace.','workspace'];a210_0x377e=function(){return _0x3141e7;};return a210_0x377e();}const workspaceInitDefinition={'service':a210_0x29c2cb(0x189),'command':a210_0x29c2cb(0x1b0),'description':a210_0x29c2cb(0x1a2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x3cbd85=>configureWorkspace(_0x3cbd85,a210_0x29c2cb(0x1b0))},workspaceUseDefinition={'service':a210_0x29c2cb(0x189),'command':a210_0x29c2cb(0x19a),'description':a210_0x29c2cb(0x1a5),'risk':a210_0x29c2cb(0x1a8),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x50de49=>configureWorkspace(_0x50de49,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a203_0x29b80a=a203_0x5623;(function(_0x47301,_0x4ee5bb){const _0x1d011f=a203_0x5623,_0x7b3b3f=_0x47301();while(!![]){try{const _0x167541=-parseInt(_0x1d011f(0x10c))/0x1+-parseInt(_0x1d011f(0x119))/0x2+parseInt(_0x1d011f(0x110))/0x3*(parseInt(_0x1d011f(0x115))/0x4)+-parseInt(_0x1d011f(0xf1))/0x5*(parseInt(_0x1d011f(0xfc))/0x6)+-parseInt(_0x1d011f(0x11d))/0x7+parseInt(_0x1d011f(0x10f))/0x8*(parseInt(_0x1d011f(0x118))/0x9)+parseInt(_0x1d011f(0x102))/0xa*(parseInt(_0x1d011f(0x108))/0xb);if(_0x167541===_0x4ee5bb)break;else _0x7b3b3f['push'](_0x7b3b3f['shift']());}catch(_0x337a31){_0x7b3b3f['push'](_0x7b3b3f['shift']());}}}(a203_0x3f0f,0xe3387));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';function a203_0x3f0f(){const _0x43764d=['workspace','flag','\x20--appcode\x20<code>`.','6544433qssPDl','riskLevel','Target\x20environment','trim','object','locale','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x20(appcode:\x20','apiDir','format','8982065yWqoYu','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','number','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','length','env','workspace.','pageSize','App\x20\x22','6biRAbV','apps','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20use\x20--app\x20<name>`.','app','10cdeElS','validation','Use\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Locale\x20for\x20this\x20workspace\x20app\x20profile','init','60268197hCzmjG','\x20--app\x20','keys','use','1585888rDXxEu','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','str','5624096CPsHAL','15BrJABV','globalConfig','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Missing\x20workspace\x20app\x20selector.','286792eZZOHa','string','write','9oPpebe','2585028MchtNr'];a203_0x3f0f=function(){return _0x43764d;};return a203_0x3f0f();}function a203_0x5623(_0x3d6934,_0x41dbb4){_0x3d6934=_0x3d6934-0xee;const _0x3f0f34=a203_0x3f0f();let _0x562364=_0x3f0f34[_0x3d6934];return _0x562364;}const WORKSPACE_USAGE=CLI_BIN_NAME+a203_0x29b80a(0x113),SAFE_PROFILE_KEYS=['appcode','env','apiDir',a203_0x29b80a(0xf0),a203_0x29b80a(0xfa),a203_0x29b80a(0x11e),a203_0x29b80a(0x122)],workspaceFlags=[{'name':a203_0x29b80a(0x101),'type':a203_0x29b80a(0x116),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a203_0x29b80a(0xf8),'type':'string','description':a203_0x29b80a(0x11f),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a203_0x29b80a(0x10d)},{'name':a203_0x29b80a(0xf6),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x123),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a203_0x29b80a(0xf3),'description':a203_0x29b80a(0x112)},{'name':a203_0x29b80a(0x11e),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0xf4),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x29b80a(0x122),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x106)}];function isRecord(_0x4732c8){const _0x17b09e=a203_0x29b80a;return!!_0x4732c8&&typeof _0x4732c8===_0x17b09e(0x121)&&!Array['isArray'](_0x4732c8);}function assertValidAppcode(_0x249e8f){const _0x44abce=a203_0x29b80a,{valid:_0x154775,message:_0x417ea9}=validateAppcode(_0x249e8f);if(!_0x154775)throw CliErrors[_0x44abce(0x103)]('Invalid\x20appcode:\x20'+_0x249e8f,_0x417ea9);}function sanitizeProfile(_0x2660da){if(!isRecord(_0x2660da))return{};const _0x25b20d={};for(const _0x34a2b4 of SAFE_PROFILE_KEYS){if(_0x2660da[_0x34a2b4]!==undefined)_0x25b20d[_0x34a2b4]=_0x2660da[_0x34a2b4];}return _0x25b20d;}function cloneProfile(_0x39842e){return isRecord(_0x39842e)?{..._0x39842e}:{};}function collectWorkspaceProfileOverrides(_0x3e4cbf){const _0x499b86=a203_0x29b80a,_0x190568={},_0xf2915f=_0x3e4cbf['str'](_0x499b86(0xf8)),_0x5cd1c0=_0x3e4cbf['str']('apiDir'),_0x5d9bcd=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0xf6)),_0x88384f=_0x3e4cbf[_0x499b86(0x11b)]('pageSize'),_0xf34247=_0x3e4cbf[_0x499b86(0x10e)]('riskLevel'),_0x1e8ce7=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0x122));if(_0xf2915f)_0x190568[_0x499b86(0xf8)]=_0xf2915f;if(_0x5cd1c0)_0x190568[_0x499b86(0xef)]=_0x5cd1c0;if(_0x5d9bcd)_0x190568[_0x499b86(0xf0)]=_0x5d9bcd;if(_0x88384f!==undefined&&_0x88384f!=='')_0x190568['pageSize']=Number(_0x88384f);if(_0xf34247)_0x190568[_0x499b86(0x11e)]=_0xf34247;if(_0x1e8ce7)_0x190568['locale']=_0x1e8ce7;return _0x190568;}async function validateWorkspaceArgs(_0x2fdcbf){const _0x23351c=a203_0x29b80a,_0x484df8=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0x101))[_0x23351c(0x120)](),_0x30e407=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0xf5))[_0x23351c(0x120)]();if(!_0x484df8&&!_0x30e407)throw CliErrors['validation'](_0x23351c(0x114),_0x23351c(0x104)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x23351c(0x100));if(_0x30e407)assertValidAppcode(_0x30e407);}function resolveKnownApps(){const _0x52b505=a203_0x29b80a,{config:_0x351695,layers:_0x587bfe}=readRawConfigWithLayers(),_0x2708b5=isRecord(_0x351695['apps'])?_0x351695[_0x52b505(0xfd)]:{},_0x4ff698=isRecord(_0x587bfe['globalConfig'][_0x52b505(0xfd)])?_0x587bfe[_0x52b505(0x111)][_0x52b505(0xfd)]:{};return{..._0x4ff698,..._0x2708b5};}async function configureWorkspace(_0xd92d6c,_0x384fff){const _0x303cd8=a203_0x29b80a,_0x1c53b0=_0xd92d6c[_0x303cd8(0x10e)](_0x303cd8(0x101))[_0x303cd8(0x120)](),_0x578c19=_0xd92d6c['str'](_0x303cd8(0xf5))['trim'](),_0x452292=_0x1c53b0||_0x578c19;if(!_0x452292)throw CliErrors[_0x303cd8(0x103)](_0x303cd8(0x114),'Use\x20`'+CLI_BIN_NAME+_0x303cd8(0x105)+CLI_BIN_NAME+_0x303cd8(0x100));if(_0x578c19)assertValidAppcode(_0x578c19);const _0x446b4e=resolveWriteConfigPath('project'),_0x301fde=readConfigFile(_0x446b4e),_0x25df8e=resolveKnownApps(),_0x23b70d=isRecord(_0x301fde[_0x303cd8(0xfd)])?{..._0x301fde[_0x303cd8(0xfd)]}:{},_0x1cf75d=cloneProfile(_0x23b70d[_0x452292]),_0x50b96d=sanitizeProfile(_0x25df8e[_0x452292]),_0x301a16=_0x578c19?{}:_0x50b96d,_0x1997b4=_0x578c19||_0x301a16['appcode'];if(!_0x1997b4){const _0x11f962=Object[_0x303cd8(0x10a)](_0x25df8e),_0x2c5a1b=_0x11f962[_0x303cd8(0xf7)]===0x0?_0x303cd8(0x104)+CLI_BIN_NAME+'\x20workspace\x20'+_0x384fff+_0x303cd8(0x109)+_0x452292+_0x303cd8(0x11c):_0x303cd8(0xf2)+_0x11f962['join'](',\x20');throw CliErrors['validation'](_0x303cd8(0xfb)+_0x452292+'\x22\x20not\x20found.',_0x2c5a1b);}assertValidAppcode(String(_0x1997b4));const _0x10724e={..._0x301a16,..._0x1cf75d,'appcode':String(_0x1997b4),...collectWorkspaceProfileOverrides(_0xd92d6c)};return _0x23b70d[_0x452292]=_0x10724e,_0x301fde['apps']=_0x23b70d,_0x301fde['defaultApp']=_0x452292,delete _0x301fde[_0x303cd8(0xf5)],delete _0x301fde[_0x303cd8(0x101)],_0x10724e[_0x303cd8(0xf8)]&&(_0x301fde[_0x303cd8(0xf8)]=_0x10724e[_0x303cd8(0xf8)]),writeConfigFile(_0x446b4e,_0x301fde),{'ok':!![],'message':'Workspace\x20'+(_0x384fff===_0x303cd8(0x107)?'initialized':'updated')+':\x20'+_0x452292+_0x303cd8(0xee)+_0x10724e['appcode']+').\x20Config:\x20'+_0x446b4e+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x303cd8(0xf9)+_0x384fff,'configPath':_0x446b4e,'app':_0x452292,'appcode':_0x10724e[_0x303cd8(0xf5)],'env':_0x10724e[_0x303cd8(0xf8)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x107),'description':a203_0x29b80a(0xfe),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4147e1=>configureWorkspace(_0x4147e1,a203_0x29b80a(0x107))},workspaceUseDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x10b),'description':a203_0x29b80a(0xff),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x9d6464=>configureWorkspace(_0x9d6464,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- function a211_0x390e(){const _0xd5d02=['6844tTvWoD','85apOrrE','1930kDBBeU','App\x20profile\x20name\x20to\x20remove','7524464nhzbPR','name','5076gcwlSs','remove','workspace','868858dYLrBa','workspace\x20remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','131845dyWETv','4289082SciBzN','968808jkwbqn','7YfopVd'];a211_0x390e=function(){return _0xd5d02;};return a211_0x390e();}const a211_0x5418ed=a211_0x2614;(function(_0x4fe105,_0x1245bb){const _0x5ae370=a211_0x2614,_0x59bd11=_0x4fe105();while(!![]){try{const _0x21e790=-parseInt(_0x5ae370(0x132))/0x1+-parseInt(_0x5ae370(0x12f))/0x2+-parseInt(_0x5ae370(0x134))/0x3+parseInt(_0x5ae370(0x126))/0x4*(-parseInt(_0x5ae370(0x127))/0x5)+parseInt(_0x5ae370(0x133))/0x6+parseInt(_0x5ae370(0x125))/0x7*(parseInt(_0x5ae370(0x12a))/0x8)+-parseInt(_0x5ae370(0x12c))/0x9*(parseInt(_0x5ae370(0x128))/0xa);if(_0x21e790===_0x1245bb)break;else _0x59bd11['push'](_0x59bd11['shift']());}catch(_0x25bc9d){_0x59bd11['push'](_0x59bd11['shift']());}}}(a211_0x390e,0x99620));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a211_0x2614(_0x530307,_0x163bc9){_0x530307=_0x530307-0x125;const _0x390ecd=a211_0x390e();let _0x26149a=_0x390ecd[_0x530307];return _0x26149a;}export const workspaceRemoveDefinition={'service':a211_0x5418ed(0x12e),'command':a211_0x5418ed(0x12d),'description':a211_0x5418ed(0x131),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a211_0x5418ed(0x12b),'description':a211_0x5418ed(0x129),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x4a1c39=>validateAppName(_0x4a1c39,a211_0x5418ed(0x130)),'execute':_0xb36783=>runAppRemove(_0xb36783,a211_0x5418ed(0x130))};
1
+ const a204_0x4305c7=a204_0x567d;function a204_0x567d(_0x319d42,_0x3d9d32){_0x319d42=_0x319d42-0x19c;const _0x262c6a=a204_0x262c();let _0x567daf=_0x262c6a[_0x319d42];return _0x567daf;}(function(_0x6d2c6,_0x2008da){const _0x1b4e1c=a204_0x567d,_0x2ec167=_0x6d2c6();while(!![]){try{const _0x428af9=-parseInt(_0x1b4e1c(0x1a0))/0x1*(parseInt(_0x1b4e1c(0x1a9))/0x2)+-parseInt(_0x1b4e1c(0x1a8))/0x3*(parseInt(_0x1b4e1c(0x1a1))/0x4)+parseInt(_0x1b4e1c(0x19e))/0x5+-parseInt(_0x1b4e1c(0x1ac))/0x6*(-parseInt(_0x1b4e1c(0x1a2))/0x7)+parseInt(_0x1b4e1c(0x19d))/0x8+parseInt(_0x1b4e1c(0x1a5))/0x9+-parseInt(_0x1b4e1c(0x1ab))/0xa*(parseInt(_0x1b4e1c(0x1a4))/0xb);if(_0x428af9===_0x2008da)break;else _0x2ec167['push'](_0x2ec167['shift']());}catch(_0x1b42b1){_0x2ec167['push'](_0x2ec167['shift']());}}}(a204_0x262c,0x38428));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a204_0x262c(){const _0x56e89b=['10Urvnqm','48RxJRlG','write','574600xGNWSn','19680VwFIBE','App\x20profile\x20name\x20to\x20remove','12cxzIuT','212UQpswQ','284977PPBUXw','name','2613391iocAIT','4078917PZNwla','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','3039vXxvGr','55492oiigkk','workspace\x20remove'];a204_0x262c=function(){return _0x56e89b;};return a204_0x262c();}export const workspaceRemoveDefinition={'service':'workspace','command':a204_0x4305c7(0x1a6),'description':a204_0x4305c7(0x1a7),'risk':a204_0x4305c7(0x19c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x4305c7(0x1a3),'description':a204_0x4305c7(0x19f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3bfdf9=>validateAppName(_0x3bfdf9,'workspace\x20remove'),'execute':_0x30287d=>runAppRemove(_0x30287d,a204_0x4305c7(0x1aa))};
@@ -1 +1 @@
1
- const a212_0x2fa449=a212_0x1d67;(function(_0x5cb3a9,_0x3cb6c7){const _0xd33af3=a212_0x1d67,_0x4b04de=_0x5cb3a9();while(!![]){try{const _0x166e07=-parseInt(_0xd33af3(0xfc))/0x1*(-parseInt(_0xd33af3(0xd6))/0x2)+-parseInt(_0xd33af3(0xf8))/0x3+-parseInt(_0xd33af3(0xec))/0x4*(-parseInt(_0xd33af3(0xd7))/0x5)+parseInt(_0xd33af3(0xe6))/0x6*(parseInt(_0xd33af3(0xf6))/0x7)+parseInt(_0xd33af3(0xed))/0x8*(-parseInt(_0xd33af3(0xe4))/0x9)+-parseInt(_0xd33af3(0xd4))/0xa*(-parseInt(_0xd33af3(0xdb))/0xb)+parseInt(_0xd33af3(0xe8))/0xc*(parseInt(_0xd33af3(0xfd))/0xd);if(_0x166e07===_0x3cb6c7)break;else _0x4b04de['push'](_0x4b04de['shift']());}catch(_0x3efb7b){_0x4b04de['push'](_0x4b04de['shift']());}}}(a212_0x376a,0xb1e67));function a212_0x1d67(_0x4e1aca,_0x428b18){_0x4e1aca=_0x4e1aca-0xd3;const _0x376a2e=a212_0x376a();let _0x1d67d5=_0x376a2e[_0x4e1aca];return _0x1d67d5;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a212_0x2fa449(0xd5),a212_0x2fa449(0xf4),a212_0x2fa449(0xfa),a212_0x2fa449(0xda),a212_0x2fa449(0xea)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a212_0x2fa449(0xd9),a212_0x2fa449(0xee),a212_0x2fa449(0xfa),a212_0x2fa449(0xda),a212_0x2fa449(0xd5),a212_0x2fa449(0xf4),a212_0x2fa449(0xf0)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x24d713){const _0xd9b13c=a212_0x2fa449;return[..._0x24d713][_0xd9b13c(0xf3)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x1af043){const _0x1c319a=a212_0x2fa449;return TOP_LEVEL_CONFIG_KEYS[_0x1c319a(0xef)](_0x1af043);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a212_0x376a(){const _0x35ca2c=['apiDir','defaultFormat','defaultApp','join','accessKey','pageSize','7iwGLCa','zh-CN','736944xfSouQ','number','locale','apps','173nsfLpN','382174DjcnTH','Risk\x20level','126460LwUhNq','cookie','674YBVHUC','455800izojQz','filter','appcode','format','165cCzbah','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','length','inherit','entries','Auth\x20cookie','string','map','Config\x20key\x20(','25344hPEPHt','app','1302348XTGtOP','en-US','300qjAKAB','API\x20directory\x20path','riskLevel','trim','20yunPjO','1936zOpRxS','env','has'];a212_0x376a=function(){return _0x35ca2c;};return a212_0x376a();}export function getConfigCommandKeyDescription(){const _0x39f4b2=a212_0x2fa449;return _0x39f4b2(0xe3)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a212_0x2fa449(0xee),'apiDir':a212_0x2fa449(0xf0),'cookie':a212_0x2fa449(0xd5),'accessKey':a212_0x2fa449(0xf4),'defaultFormat':a212_0x2fa449(0xda),'pageSize':a212_0x2fa449(0xf5),'riskLevel':a212_0x2fa449(0xea),'locale':a212_0x2fa449(0xfa)};export function getAppProfileFlagDefs(){const _0x600423=a212_0x2fa449;return[{'name':_0x600423(0xee),'type':_0x600423(0xe1),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x600423(0xf0),'type':_0x600423(0xe1),'description':_0x600423(0xe9)},{'name':_0x600423(0xd5),'type':_0x600423(0xe1),'description':_0x600423(0xe0),'hidden':!![]},{'name':_0x600423(0xf4),'type':_0x600423(0xe1),'description':'Access\x20key','hidden':!![]},{'name':_0x600423(0xf1),'type':_0x600423(0xe1),'description':_0x600423(0xdc),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x600423(0xf9),'description':'Default\x20page\x20size'},{'name':_0x600423(0xea),'type':_0x600423(0xe1),'description':_0x600423(0xd3),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x600423(0xe1),'description':'Locale'}];}export function collectAppProfileOverrides(_0x39afa3){const _0x524548=a212_0x2fa449,_0x3a4c91={};for(const [_0xa6bd27,_0x4462b4]of Object[_0x524548(0xdf)](APP_PROFILE_FLAG_KEY_MAP)){const _0x15f323=_0x39afa3(_0xa6bd27);if(!_0x15f323)continue;_0x3a4c91[_0x4462b4]=_0x4462b4===_0x524548(0xf5)?Number(_0x15f323):_0x15f323;}return _0x3a4c91;}export function buildAppProfileListFields(_0x28f947){const _0x4f6cb5=a212_0x2fa449;return{'env':_0x28f947['env']??null,'apiDir':_0x28f947[_0x4f6cb5(0xf0)]??null,'hasCookie':!!_0x28f947[_0x4f6cb5(0xd5)],'hasAccessKey':!!_0x28f947[_0x4f6cb5(0xf4)],'format':_0x28f947['format']??null,'pageSize':_0x28f947[_0x4f6cb5(0xf5)]??null,'riskLevel':_0x28f947[_0x4f6cb5(0xea)]??null,'locale':_0x28f947[_0x4f6cb5(0xfa)]??null};}export function buildAppDoctorFields(_0x37388f,_0x4f48db){const _0x4654f6=a212_0x2fa449;return{'env':{'value':_0x37388f[_0x4654f6(0xee)]||_0x4f48db[_0x4654f6(0xee)],'source':_0x37388f[_0x4654f6(0xee)]?'app':_0x4654f6(0xde)},'apiDir':{'value':_0x37388f[_0x4654f6(0xf0)]||_0x4f48db[_0x4654f6(0xf0)],'source':_0x37388f[_0x4654f6(0xf0)]?_0x4654f6(0xe5):_0x4654f6(0xde)},'cookie':{'value':_0x37388f[_0x4654f6(0xd5)]||_0x4f48db[_0x4654f6(0xd5)],'source':_0x37388f[_0x4654f6(0xd5)]?_0x4654f6(0xe5):_0x4654f6(0xde)},'accessKey':{'value':_0x37388f[_0x4654f6(0xf4)]||_0x4f48db[_0x4654f6(0xf4)],'source':_0x37388f[_0x4654f6(0xf4)]?'app':_0x4654f6(0xde)}};}export function buildCanonicalAppConfig(_0x5ac995,_0x223fd9){const _0x2c8f82=a212_0x2fa449,_0x22f103=_0x5ac995[_0x2c8f82(0xe2)](_0x426952=>String(_0x426952||'')[_0x2c8f82(0xeb)]())[_0x2c8f82(0xd8)](Boolean);if(_0x22f103[_0x2c8f82(0xdd)]===0x0)return{};const _0x46befc={};for(const _0x1badf4 of _0x22f103){_0x46befc[_0x1badf4]=_0x223fd9?{'appcode':_0x1badf4,'env':_0x223fd9}:{'appcode':_0x1badf4};}return{'apps':_0x46befc,'defaultApp':_0x22f103[0x0]};}export function buildCanonicalProjectConfig(_0x3f9787,_0x501464){const _0x38113c=a212_0x2fa449,{appCodes:appCodes=[],env:_0x28b0a9,metadata:_0x3ddc3a}=_0x501464,_0x36bd47={..._0x3f9787,..._0x3ddc3a||{}};delete _0x36bd47['appcode'],delete _0x36bd47[_0x38113c(0xe5)];if(_0x28b0a9)_0x36bd47[_0x38113c(0xee)]=_0x28b0a9;else!_0x36bd47[_0x38113c(0xee)]&&(_0x36bd47[_0x38113c(0xee)]=DEFAULT_CONFIG_VALUES[_0x38113c(0xee)]);const _0x164eba=buildCanonicalAppConfig(appCodes,_0x36bd47[_0x38113c(0xee)]);return Object['keys'](_0x164eba)[_0x38113c(0xdd)]>0x0&&(_0x36bd47[_0x38113c(0xfb)]=_0x164eba[_0x38113c(0xfb)],_0x36bd47['defaultApp']=_0x164eba[_0x38113c(0xf2)]),_0x36bd47;}const LOCALE_MAP={'zh':a212_0x2fa449(0xf7),'zh-cn':a212_0x2fa449(0xf7),'zh_cn':a212_0x2fa449(0xf7),'en':'en-US','en-us':'en-US','en_us':a212_0x2fa449(0xe7)};export function normalizeLocale(_0x5497fb){if(!_0x5497fb)return null;return LOCALE_MAP[_0x5497fb['toLowerCase']()]??null;}
1
+ const a205_0x2a2608=a205_0x3536;(function(_0x1fe300,_0xc51b32){const _0xb22d81=a205_0x3536,_0x203104=_0x1fe300();while(!![]){try{const _0x78544b=-parseInt(_0xb22d81(0x1c9))/0x1+-parseInt(_0xb22d81(0x1bc))/0x2*(-parseInt(_0xb22d81(0x1cc))/0x3)+parseInt(_0xb22d81(0x1d7))/0x4*(-parseInt(_0xb22d81(0x1b4))/0x5)+parseInt(_0xb22d81(0x1d5))/0x6*(parseInt(_0xb22d81(0x1c7))/0x7)+parseInt(_0xb22d81(0x1bb))/0x8*(parseInt(_0xb22d81(0x1d3))/0x9)+parseInt(_0xb22d81(0x1c8))/0xa+-parseInt(_0xb22d81(0x1c2))/0xb;if(_0x78544b===_0xc51b32)break;else _0x203104['push'](_0x203104['shift']());}catch(_0x40d601){_0x203104['push'](_0x203104['shift']());}}}(a205_0x11e4,0x970b1));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';function a205_0x11e4(){const _0x35924d=['3640VhVlHR','Default\x20page\x20size','inherit','length','Access\x20key','format','apiDir','riskLevel','2545yYAimc','accessKey','cookie','Config\x20key\x20(','app','en-US','locale','9242536xvtQgN','567718HapnLW','zh-CN','map','has','Locale','entries','7817458avhBeA','Auth\x20cookie','toLowerCase','env','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','7QiQQKz','4895730igDeDa','918185DdgzGe','apps','defaultApp','3yoXVZh','Target\x20environment','API\x20directory\x20path','string','filter','pageSize','keys','9FegoTU','appcode','4691862weKlNf','Risk\x20level'];a205_0x11e4=function(){return _0x35924d;};return a205_0x11e4();}export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a205_0x2a2608(0x1b5),a205_0x2a2608(0x1ba),a205_0x2a2608(0x1dc),a205_0x2a2608(0x1de)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x2a2608(0x1d4),a205_0x2a2608(0x1c5),a205_0x2a2608(0x1ba),'format',a205_0x2a2608(0x1b6),a205_0x2a2608(0x1b5),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5c72c0){return[..._0x5c72c0]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x183985){const _0x29e9fd=a205_0x2a2608;return TOP_LEVEL_CONFIG_KEYS[_0x29e9fd(0x1bf)](_0x183985);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a205_0x3536(_0xb17dc6,_0x2a7a89){_0xb17dc6=_0xb17dc6-0x1b4;const _0x11e494=a205_0x11e4();let _0x3536f0=_0x11e494[_0xb17dc6];return _0x3536f0;}export function getConfigCommandKeyDescription(){const _0x50b102=a205_0x2a2608;return _0x50b102(0x1b7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x2a2608(0x1c5),'apiDir':a205_0x2a2608(0x1dd),'cookie':a205_0x2a2608(0x1b6),'accessKey':'accessKey','defaultFormat':a205_0x2a2608(0x1dc),'pageSize':a205_0x2a2608(0x1d1),'riskLevel':a205_0x2a2608(0x1de),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x59d973=a205_0x2a2608;return[{'name':_0x59d973(0x1c5),'type':'string','description':_0x59d973(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x59d973(0x1dd),'type':'string','description':_0x59d973(0x1ce)},{'name':_0x59d973(0x1b6),'type':'string','description':_0x59d973(0x1c3),'hidden':!![]},{'name':_0x59d973(0x1b5),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1db),'hidden':!![]},{'name':'defaultFormat','type':_0x59d973(0x1cf),'description':_0x59d973(0x1c6),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x59d973(0x1d1),'type':'number','description':_0x59d973(0x1d8)},{'name':_0x59d973(0x1de),'type':'string','description':_0x59d973(0x1d6),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x59d973(0x1ba),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1c0)}];}export function collectAppProfileOverrides(_0x2ca2e3){const _0x259120=a205_0x2a2608,_0x25f20c={};for(const [_0x1716d6,_0x5adf94]of Object[_0x259120(0x1c1)](APP_PROFILE_FLAG_KEY_MAP)){const _0x31bb11=_0x2ca2e3(_0x1716d6);if(!_0x31bb11)continue;_0x25f20c[_0x5adf94]=_0x5adf94==='pageSize'?Number(_0x31bb11):_0x31bb11;}return _0x25f20c;}export function buildAppProfileListFields(_0x5aa890){const _0x4d1c78=a205_0x2a2608;return{'env':_0x5aa890[_0x4d1c78(0x1c5)]??null,'apiDir':_0x5aa890['apiDir']??null,'hasCookie':!!_0x5aa890[_0x4d1c78(0x1b6)],'hasAccessKey':!!_0x5aa890[_0x4d1c78(0x1b5)],'format':_0x5aa890[_0x4d1c78(0x1dc)]??null,'pageSize':_0x5aa890['pageSize']??null,'riskLevel':_0x5aa890[_0x4d1c78(0x1de)]??null,'locale':_0x5aa890[_0x4d1c78(0x1ba)]??null};}export function buildAppDoctorFields(_0x44d971,_0x273efc){const _0x26b04=a205_0x2a2608;return{'env':{'value':_0x44d971[_0x26b04(0x1c5)]||_0x273efc[_0x26b04(0x1c5)],'source':_0x44d971[_0x26b04(0x1c5)]?'app':'inherit'},'apiDir':{'value':_0x44d971[_0x26b04(0x1dd)]||_0x273efc[_0x26b04(0x1dd)],'source':_0x44d971['apiDir']?_0x26b04(0x1b8):_0x26b04(0x1d9)},'cookie':{'value':_0x44d971['cookie']||_0x273efc[_0x26b04(0x1b6)],'source':_0x44d971['cookie']?'app':'inherit'},'accessKey':{'value':_0x44d971['accessKey']||_0x273efc['accessKey'],'source':_0x44d971[_0x26b04(0x1b5)]?_0x26b04(0x1b8):_0x26b04(0x1d9)}};}export function buildCanonicalAppConfig(_0x571b2f,_0x2d6d72){const _0x5f2537=a205_0x2a2608,_0x4596d7=_0x571b2f[_0x5f2537(0x1be)](_0x5ccda8=>String(_0x5ccda8||'')['trim']())[_0x5f2537(0x1d0)](Boolean);if(_0x4596d7[_0x5f2537(0x1da)]===0x0)return{};const _0x1afac3={};for(const _0x129dda of _0x4596d7){_0x1afac3[_0x129dda]=_0x2d6d72?{'appcode':_0x129dda,'env':_0x2d6d72}:{'appcode':_0x129dda};}return{'apps':_0x1afac3,'defaultApp':_0x4596d7[0x0]};}export function buildCanonicalProjectConfig(_0x5d558c,_0x5acb6d){const _0x5a44ae=a205_0x2a2608,{appCodes:appCodes=[],env:_0x399f8a,metadata:_0x25d2c2}=_0x5acb6d,_0x3e81c4={..._0x5d558c,..._0x25d2c2||{}};delete _0x3e81c4['appcode'],delete _0x3e81c4['app'];if(_0x399f8a)_0x3e81c4[_0x5a44ae(0x1c5)]=_0x399f8a;else!_0x3e81c4[_0x5a44ae(0x1c5)]&&(_0x3e81c4[_0x5a44ae(0x1c5)]=DEFAULT_CONFIG_VALUES[_0x5a44ae(0x1c5)]);const _0x25f350=buildCanonicalAppConfig(appCodes,_0x3e81c4[_0x5a44ae(0x1c5)]);return Object[_0x5a44ae(0x1d2)](_0x25f350)[_0x5a44ae(0x1da)]>0x0&&(_0x3e81c4[_0x5a44ae(0x1ca)]=_0x25f350[_0x5a44ae(0x1ca)],_0x3e81c4[_0x5a44ae(0x1cb)]=_0x25f350[_0x5a44ae(0x1cb)]),_0x3e81c4;}const LOCALE_MAP={'zh':a205_0x2a2608(0x1bd),'zh-cn':'zh-CN','zh_cn':a205_0x2a2608(0x1bd),'en':'en-US','en-us':'en-US','en_us':a205_0x2a2608(0x1b9)};export function normalizeLocale(_0x4ab4e2){const _0x7fc565=a205_0x2a2608;if(!_0x4ab4e2)return null;return LOCALE_MAP[_0x4ab4e2[_0x7fc565(0x1c4)]()]??null;}
@@ -1 +1 @@
1
- const a213_0x5a2b96=a213_0x4503;function a213_0x4503(_0x31eff4,_0x6ab30){_0x31eff4=_0x31eff4-0x1b4;const _0x3f7968=a213_0x3f79();let _0x4503dc=_0x3f7968[_0x31eff4];return _0x4503dc;}(function(_0x3966de,_0x5204f2){const _0x5288a0=a213_0x4503,_0x9524ec=_0x3966de();while(!![]){try{const _0x3ed9af=parseInt(_0x5288a0(0x1bc))/0x1*(parseInt(_0x5288a0(0x1bf))/0x2)+parseInt(_0x5288a0(0x1b6))/0x3+-parseInt(_0x5288a0(0x1b4))/0x4+-parseInt(_0x5288a0(0x1b5))/0x5+-parseInt(_0x5288a0(0x1bd))/0x6*(-parseInt(_0x5288a0(0x1b8))/0x7)+parseInt(_0x5288a0(0x1b9))/0x8+-parseInt(_0x5288a0(0x1b7))/0x9*(-parseInt(_0x5288a0(0x1bb))/0xa);if(_0x3ed9af===_0x5204f2)break;else _0x9524ec['push'](_0x9524ec['shift']());}catch(_0x429d53){_0x9524ec['push'](_0x9524ec['shift']());}}}(a213_0x3f79,0xb4e95));function a213_0x3f79(){const _0x282a65=['309465okvMxo','5706nbcItm','115129vLQdFL','48552fHOJZq','https://g.lovrabet.com/dist/rabetbase-cli','6800NCQJnl','17bOkzwH','132qzZMMG','/config/index.json','146088PYFuHS','/templates/projects','3417984iZemzX','2742085eQYAtK'];a213_0x3f79=function(){return _0x282a65;};return a213_0x3f79();}export const RABETBASE_CDN_BASE_URL=a213_0x5a2b96(0x1ba);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a213_0x5a2b96(0x1be);export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a213_0x5a2b96(0x1c0);
1
+ const a206_0x34f8c9=a206_0x141c;(function(_0x52517b,_0x224fdb){const _0x354846=a206_0x141c,_0x2f4c52=_0x52517b();while(!![]){try{const _0x34d7c7=-parseInt(_0x354846(0x105))/0x1*(parseInt(_0x354846(0xfb))/0x2)+-parseInt(_0x354846(0xf6))/0x3*(parseInt(_0x354846(0xfe))/0x4)+-parseInt(_0x354846(0x101))/0x5*(parseInt(_0x354846(0xfa))/0x6)+-parseInt(_0x354846(0x100))/0x7*(parseInt(_0x354846(0xff))/0x8)+-parseInt(_0x354846(0x103))/0x9*(parseInt(_0x354846(0xf8))/0xa)+parseInt(_0x354846(0xf7))/0xb+-parseInt(_0x354846(0xf9))/0xc*(-parseInt(_0x354846(0xfc))/0xd);if(_0x34d7c7===_0x224fdb)break;else _0x2f4c52['push'](_0x2f4c52['shift']());}catch(_0x352a1e){_0x2f4c52['push'](_0x2f4c52['shift']());}}}(a206_0x21bd,0x2d110));export const RABETBASE_CDN_BASE_URL=a206_0x34f8c9(0x104);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0xfd);function a206_0x21bd(){const _0x46cac1=['27339bHypzu','87UeLsAq','2995553CtouAQ','5410gDTaJT','76872BbDXdu','216DuxlGy','2IFeSpa','1703yQUooM','/config/index.json','37740jzRDYL','24zpqENA','558033oTBtEX','27725oaXTkX','/templates/projects','3114DQATOR','https://g.lovrabet.com/dist/rabetbase-cli'];a206_0x21bd=function(){return _0x46cac1;};return a206_0x21bd();}function a206_0x141c(_0x2d5dde,_0x1d8598){_0x2d5dde=_0x2d5dde-0xf6;const _0x21bdc0=a206_0x21bd();let _0x141c53=_0x21bdc0[_0x2d5dde];return _0x141c53;}export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0x102);