@lovrabet/rabetbase-cli 2.5.1 → 2.5.2-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 (319) 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/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  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/delete.js +1 -1
  53. package/lib/commands/config/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/init.js +1 -1
  56. package/lib/commands/config/list.js +1 -1
  57. package/lib/commands/config/set.js +1 -1
  58. package/lib/commands/config/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/business-groups.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-restore.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  80. package/lib/commands/db/analysis-batching.js +1 -1
  81. package/lib/commands/db/analyze-batch-plan.js +1 -1
  82. package/lib/commands/db/analyze-cancel.js +1 -1
  83. package/lib/commands/db/analyze-start.js +1 -1
  84. package/lib/commands/db/analyze-status.js +1 -1
  85. package/lib/commands/db/create.js +1 -1
  86. package/lib/commands/db/delete.js +1 -1
  87. package/lib/commands/db/detail.js +1 -1
  88. package/lib/commands/db/diff-refresh-start.js +1 -1
  89. package/lib/commands/db/diff-refresh-status.js +1 -1
  90. package/lib/commands/db/diff.js +1 -1
  91. package/lib/commands/db/index.js +1 -1
  92. package/lib/commands/db/list.js +1 -1
  93. package/lib/commands/db/shared.js +1 -1
  94. package/lib/commands/db/table-diff-shared.js +1 -1
  95. package/lib/commands/db/tables.js +1 -1
  96. package/lib/commands/db/test.js +1 -1
  97. package/lib/commands/db/update.js +1 -1
  98. package/lib/commands/deployment/auto-sync.d.ts +3 -11
  99. package/lib/commands/deployment/auto-sync.js +1 -1
  100. package/lib/commands/deployment/index.js +1 -1
  101. package/lib/commands/deployment/sync.js +1 -1
  102. package/lib/commands/doctor.js +1 -1
  103. package/lib/commands/file/index.js +1 -1
  104. package/lib/commands/issue/index.js +1 -1
  105. package/lib/commands/issue/nudge.js +1 -1
  106. package/lib/commands/issue/report.js +1 -1
  107. package/lib/commands/issue/shared.js +1 -1
  108. package/lib/commands/kb/create.js +1 -1
  109. package/lib/commands/kb/delete.js +1 -1
  110. package/lib/commands/kb/detail.js +1 -1
  111. package/lib/commands/kb/index.js +1 -1
  112. package/lib/commands/kb/list.js +1 -1
  113. package/lib/commands/kb/search.js +1 -1
  114. package/lib/commands/kb/shared.js +1 -1
  115. package/lib/commands/kb/update.js +1 -1
  116. package/lib/commands/logs/index.js +1 -1
  117. package/lib/commands/menu/asset-update.js +1 -1
  118. package/lib/commands/menu/delete.js +1 -1
  119. package/lib/commands/menu/external-link-create.js +1 -1
  120. package/lib/commands/menu/external-link-update.js +1 -1
  121. package/lib/commands/menu/group-create.js +1 -1
  122. package/lib/commands/menu/group-update.js +1 -1
  123. package/lib/commands/menu/index.js +1 -1
  124. package/lib/commands/menu/list.js +1 -1
  125. package/lib/commands/menu/move.js +1 -1
  126. package/lib/commands/menu/regroup-start.js +1 -1
  127. package/lib/commands/menu/rename.js +1 -1
  128. package/lib/commands/menu/shared/compare-table.js +1 -1
  129. package/lib/commands/menu/shared/delete-plan.js +1 -1
  130. package/lib/commands/menu/shared/facts.js +1 -1
  131. package/lib/commands/menu/shared/index.js +1 -1
  132. package/lib/commands/menu/shared/inquirer.js +1 -1
  133. package/lib/commands/menu/shared/local-pages.js +1 -1
  134. package/lib/commands/menu/shared/logic.js +1 -1
  135. package/lib/commands/menu/shared/mutations.js +1 -1
  136. package/lib/commands/menu/shared/service.js +1 -1
  137. package/lib/commands/menu/shared/sync-core.js +1 -1
  138. package/lib/commands/menu/shared/update-core.js +1 -1
  139. package/lib/commands/menu/shared/valid-url.js +1 -1
  140. package/lib/commands/menu/sync.js +1 -1
  141. package/lib/commands/menu/visibility-update.js +1 -1
  142. package/lib/commands/notification/config-create.js +1 -1
  143. package/lib/commands/notification/config-delete.js +1 -1
  144. package/lib/commands/notification/config-list.js +1 -1
  145. package/lib/commands/notification/config-update.js +1 -1
  146. package/lib/commands/notification/index.js +1 -1
  147. package/lib/commands/notification/shared.js +1 -1
  148. package/lib/commands/ocr/index.js +1 -1
  149. package/lib/commands/page/create.js +1 -1
  150. package/lib/commands/page/custom/detail.js +1 -1
  151. package/lib/commands/page/custom/list.js +1 -1
  152. package/lib/commands/page/custom/publish.js +1 -1
  153. package/lib/commands/page/custom/shared.js +1 -1
  154. package/lib/commands/page/custom/syntax.js +1 -1
  155. package/lib/commands/page/custom/template.js +1 -1
  156. package/lib/commands/page/custom/update.js +1 -1
  157. package/lib/commands/page/data-list-status.js +1 -1
  158. package/lib/commands/page/generate-start.js +1 -1
  159. package/lib/commands/page/generate-status.js +1 -1
  160. package/lib/commands/page/index.js +1 -1
  161. package/lib/commands/page/pull.js +1 -1
  162. package/lib/commands/page/push.js +1 -1
  163. package/lib/commands/page/relation-audit.js +1 -1
  164. package/lib/commands/page/restore.js +1 -1
  165. package/lib/commands/page/shared.js +1 -1
  166. package/lib/commands/page/sync.js +1 -1
  167. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  168. package/lib/commands/project/create/format-elapsed.js +1 -1
  169. package/lib/commands/project/create/main.js +1 -1
  170. package/lib/commands/project/create/materialize-project-template.js +1 -1
  171. package/lib/commands/project/create/project-name.js +1 -1
  172. package/lib/commands/project/create/project-template-archive.js +1 -1
  173. package/lib/commands/project/create/project-template-path.js +1 -1
  174. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  175. package/lib/commands/project/create/use-format-code.js +1 -1
  176. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  177. package/lib/commands/project/domain-routing-sync.js +1 -1
  178. package/lib/commands/project/index.js +1 -1
  179. package/lib/commands/project/upgrade.js +1 -1
  180. package/lib/commands/registry.js +1 -1
  181. package/lib/commands/role/delete.js +1 -1
  182. package/lib/commands/role/detail.js +1 -1
  183. package/lib/commands/role/index.js +1 -1
  184. package/lib/commands/role/list.js +1 -1
  185. package/lib/commands/role/shared.js +1 -1
  186. package/lib/commands/role/update.js +1 -1
  187. package/lib/commands/role/user-add.js +1 -1
  188. package/lib/commands/role/user-remove.js +1 -1
  189. package/lib/commands/role/user-resolve.js +1 -1
  190. package/lib/commands/rule/get.js +1 -1
  191. package/lib/commands/rule/index.js +1 -1
  192. package/lib/commands/rule/list.js +1 -1
  193. package/lib/commands/rule/set.js +1 -1
  194. package/lib/commands/rule/shared.js +1 -1
  195. package/lib/commands/run/index.js +1 -1
  196. package/lib/commands/schema.js +1 -1
  197. package/lib/commands/sql/create.js +1 -1
  198. package/lib/commands/sql/delete.js +1 -1
  199. package/lib/commands/sql/detail.js +1 -1
  200. package/lib/commands/sql/exec.js +1 -1
  201. package/lib/commands/sql/index.js +1 -1
  202. package/lib/commands/sql/list.js +1 -1
  203. package/lib/commands/sql/pull.js +1 -1
  204. package/lib/commands/sql/push.js +1 -1
  205. package/lib/commands/sql/shared.js +1 -1
  206. package/lib/commands/sql/status.js +1 -1
  207. package/lib/commands/sql/validate.js +1 -1
  208. package/lib/commands/task/index.js +1 -1
  209. package/lib/commands/task/status.js +1 -1
  210. package/lib/commands/tenant/index.js +1 -1
  211. package/lib/commands/tenant/members-list.js +1 -1
  212. package/lib/commands/tenant/shared.js +1 -1
  213. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  214. package/lib/commands/user-account/index.js +1 -1
  215. package/lib/commands/workspace/add.js +1 -1
  216. package/lib/commands/workspace/index.js +1 -1
  217. package/lib/commands/workspace/remove.js +1 -1
  218. package/lib/config/domain-config.js +1 -1
  219. package/lib/config/project-domain-routing.js +1 -1
  220. package/lib/config/schema.js +1 -1
  221. package/lib/constant/cdn.js +1 -1
  222. package/lib/constant/cli.js +1 -1
  223. package/lib/constant/defaults.js +1 -1
  224. package/lib/constant/domain.js +1 -1
  225. package/lib/constant/env.js +1 -1
  226. package/lib/constant/output.js +1 -1
  227. package/lib/constant/paths.js +1 -1
  228. package/lib/constant/region.js +1 -1
  229. package/lib/constant/risk.js +1 -1
  230. package/lib/constant/routing-profile.js +1 -1
  231. package/lib/context/app-resolver.d.ts +0 -2
  232. package/lib/context/app-resolver.js +1 -1
  233. package/lib/context/auth-resolver.js +1 -1
  234. package/lib/context/config-loader.js +1 -1
  235. package/lib/context.js +1 -1
  236. package/lib/core/alias-resolver.js +1 -1
  237. package/lib/core/api-client.d.ts +0 -2
  238. package/lib/core/api-client.js +1 -1
  239. package/lib/core/bff/config.js +1 -1
  240. package/lib/core/bff/file-system.js +1 -1
  241. package/lib/core/bff/hash.js +1 -1
  242. package/lib/core/bff/lock.js +1 -1
  243. package/lib/core/bff/utils.js +1 -1
  244. package/lib/core/db-resolver.js +1 -1
  245. package/lib/core/kb-search-client.js +1 -1
  246. package/lib/core/page/file-system.js +1 -1
  247. package/lib/core/page/hash.js +1 -1
  248. package/lib/core/page/lock.js +1 -1
  249. package/lib/core/sql-index-auditor.js +1 -1
  250. package/lib/core/sql-sync/config.js +1 -1
  251. package/lib/core/sql-sync/file-system.js +1 -1
  252. package/lib/core/sql-sync/hash.js +1 -1
  253. package/lib/core/sql-sync/lock.js +1 -1
  254. package/lib/core/sql-sync/utils.js +1 -1
  255. package/lib/core/sql-validator.js +1 -1
  256. package/lib/errors.js +1 -1
  257. package/lib/framework/build-all-flags.js +1 -1
  258. package/lib/framework/error-output.js +1 -1
  259. package/lib/framework/explicit-yes.js +1 -1
  260. package/lib/framework/flags.js +1 -1
  261. package/lib/framework/help.js +1 -1
  262. package/lib/framework/index.js +1 -1
  263. package/lib/framework/output.js +1 -1
  264. package/lib/framework/response.js +1 -1
  265. package/lib/framework/runner-alias.js +1 -1
  266. package/lib/framework/runner.js +1 -1
  267. package/lib/framework/schema-export.js +1 -1
  268. package/lib/framework/supported-flags.d.ts +2 -0
  269. package/lib/framework/supported-flags.js +1 -0
  270. package/lib/framework/types.d.ts +2 -4
  271. package/lib/framework/types.js +1 -1
  272. package/lib/generated/build-info.d.ts +4 -4
  273. package/lib/generated/build-info.js +1 -1
  274. package/lib/generated/official-routing.js +1 -1
  275. package/lib/generated/routing-contract.js +1 -1
  276. package/lib/help.js +1 -1
  277. package/lib/postinstall.js +1 -1
  278. package/lib/runtime/confirmation.js +1 -1
  279. package/lib/runtime/event.js +1 -1
  280. package/lib/runtime/index.js +1 -1
  281. package/lib/runtime/queue.js +1 -1
  282. package/lib/runtime/resolve.js +1 -1
  283. package/lib/skills/builtin-skill.js +1 -1
  284. package/lib/skills/main.js +1 -1
  285. package/lib/skills/npx-skills-add.js +1 -1
  286. package/lib/skills/skill-presence.js +1 -1
  287. package/lib/telemetry/cli-command-trace.js +1 -1
  288. package/lib/telemetry/cli-help-trace.js +1 -1
  289. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  290. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  291. package/lib/telemetry/send-cli-trace-log.js +1 -1
  292. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  293. package/lib/utils/ai_config.js +1 -1
  294. package/lib/utils/apply-jq-filter.js +1 -1
  295. package/lib/utils/cdn-config.js +1 -1
  296. package/lib/utils/check-sdk-version.js +1 -1
  297. package/lib/utils/cli-version-check.js +1 -1
  298. package/lib/utils/cli-version-policy.js +1 -1
  299. package/lib/utils/config.js +1 -1
  300. package/lib/utils/entity-with-id.js +1 -1
  301. package/lib/utils/file-utils.js +1 -1
  302. package/lib/utils/guides-cdn.js +1 -1
  303. package/lib/utils/http-client.js +1 -1
  304. package/lib/utils/is-non-interactive.js +1 -1
  305. package/lib/utils/logger.js +1 -1
  306. package/lib/utils/params.js +1 -1
  307. package/lib/utils/platform.js +1 -1
  308. package/lib/utils/sleep.js +1 -1
  309. package/lib/utils/template-replacer.js +1 -1
  310. package/lib/utils/update-notice.js +1 -1
  311. package/lib/utils/version.js +1 -1
  312. package/lib/utils/with-active-cookie.js +1 -1
  313. package/lib/utils/write-cli-side-channel.js +1 -1
  314. package/package.json +1 -1
  315. package/skills/rabetbase/SKILL.md +3 -3
  316. package/skills/rabetbase/references/rabetbase-deployment-sync.md +16 -44
  317. package/skills/rabetbase.manifest.json +3 -3
  318. package/lib/config/deployment-sync.d.ts +0 -10
  319. package/lib/config/deployment-sync.js +0 -1
@@ -1 +1 @@
1
- const a185_0x46654c=a185_0x3c65;(function(_0x23953a,_0x1f6671){const _0x7a1144=a185_0x3c65,_0x461f69=_0x23953a();while(!![]){try{const _0x272611=-parseInt(_0x7a1144(0xb1))/0x1+parseInt(_0x7a1144(0xac))/0x2+parseInt(_0x7a1144(0xb3))/0x3+parseInt(_0x7a1144(0xaa))/0x4*(parseInt(_0x7a1144(0xad))/0x5)+-parseInt(_0x7a1144(0xb5))/0x6*(parseInt(_0x7a1144(0xb9))/0x7)+-parseInt(_0x7a1144(0xb8))/0x8*(-parseInt(_0x7a1144(0xae))/0x9)+parseInt(_0x7a1144(0xba))/0xa*(-parseInt(_0x7a1144(0xab))/0xb);if(_0x272611===_0x1f6671)break;else _0x461f69['push'](_0x461f69['shift']());}catch(_0x1fc132){_0x461f69['push'](_0x461f69['shift']());}}}(a185_0x2e1d,0xad4ea));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';function a185_0x3c65(_0x5165b4,_0x409f28){_0x5165b4=_0x5165b4-0xaa;const _0x2e1de6=a185_0x2e1d();let _0x3c65e1=_0x2e1de6[_0x5165b4];return _0x3c65e1;}const UPDATE_PATH=a185_0x46654c(0xbd);function readPatch(_0x1d41a8){const _0x252f0f=a185_0x46654c,_0x1e5b2b=_0x1d41a8[_0x252f0f(0xc7)](_0x252f0f(0xc3)),_0x3b5b51=_0x1d41a8['flag']('remark'),_0x43f3bc={};if(_0x1e5b2b!==undefined&&_0x1e5b2b!==null){const _0x538c3f=String(_0x1e5b2b)['trim']();if(!_0x538c3f)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xbc));if(_0x538c3f[_0x252f0f(0xb2)]>0x40)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xc4));_0x43f3bc[_0x252f0f(0xbe)]=_0x538c3f;}_0x3b5b51!==undefined&&_0x3b5b51!==null&&(_0x43f3bc[_0x252f0f(0xb7)]=String(_0x3b5b51));if(_0x43f3bc[_0x252f0f(0xbe)]===undefined&&_0x43f3bc[_0x252f0f(0xb7)]===undefined)throw CliErrors[_0x252f0f(0xaf)](_0x252f0f(0xc0),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x43f3bc;}export const roleUpdate={'service':a185_0x46654c(0xc5),'command':a185_0x46654c(0xc1),'description':a185_0x46654c(0xc6),'risk':a185_0x46654c(0xc8),'flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a185_0x46654c(0xc3),'type':a185_0x46654c(0xb0),'required':![],'description':a185_0x46654c(0xbb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x24aaba){readPatch(_0x24aaba);},async 'dryRun'(_0x2b007f){const _0x407205=a185_0x46654c,_0x401679=_0x2b007f[_0x407205(0xc9)]('id'),_0x1d69ca=readPatch(_0x2b007f),_0xf883b9=await getRoleById(_0x2b007f[_0x407205(0xb4)],_0x401679);return assertCustomRole(_0xf883b9,_0x407205(0xc1)),asDryRunResult({'scope':_0x407205(0xbf),'operation':_0x407205(0xc1),'selector':{'appCode':_0x2b007f[_0x407205(0xb4)],'roleId':_0x401679,'roleName':_0xf883b9['roleName']},'before':projectRole(_0xf883b9),'after':projectRole({..._0xf883b9,..._0x1d69ca[_0x407205(0xbe)]!==undefined?{'roleName':_0x1d69ca[_0x407205(0xbe)]}:{},..._0x1d69ca[_0x407205(0xb7)]!==undefined?{'remark':_0x1d69ca[_0x407205(0xb7)]}:{}}),'dryRun':!![],'backend':{'method':_0x407205(0xc2),'path':UPDATE_PATH},'warnings':[]},{'method':_0x407205(0xc2),'url':UPDATE_PATH});},async 'execute'(_0x19a2a4){const _0x3b1791=a185_0x46654c,_0x4eb179=_0x19a2a4[_0x3b1791(0xc9)]('id'),_0x12923c=readPatch(_0x19a2a4),_0x497d04=await getRoleById(_0x19a2a4[_0x3b1791(0xb4)],_0x4eb179);assertCustomRole(_0x497d04,_0x3b1791(0xc1)),await updateAppRole({'id':_0x4eb179,'appCode':_0x19a2a4[_0x3b1791(0xb4)],..._0x12923c[_0x3b1791(0xbe)]!==undefined?{'roleName':_0x12923c[_0x3b1791(0xbe)]}:{},..._0x12923c[_0x3b1791(0xb7)]!==undefined?{'remark':_0x12923c['remark']}:{}});const _0x5f4f74=await getRoleById(_0x19a2a4[_0x3b1791(0xb4)],_0x4eb179);return{'ok':!![],'data':{'scope':_0x3b1791(0xbf),'operation':_0x3b1791(0xc1),'selector':{'appCode':_0x19a2a4[_0x3b1791(0xb4)],'roleId':_0x4eb179,'roleName':_0x5f4f74[_0x3b1791(0xbe)]},'before':projectRole(_0x497d04),'after':projectRole(_0x5f4f74),'dryRun':![],'backend':{'method':_0x3b1791(0xc2),'path':UPDATE_PATH},'warnings':[]},'message':_0x3b1791(0xb6)+_0x5f4f74[_0x3b1791(0xbe)]+'\x20(id='+_0x4eb179+')'};}};function a185_0x2e1d(){const _0x2f64ed=['2166270yORDrC','355eogFKo','153kHVjtX','validation','string','236565danLRM','length','177885CYptsB','appCode','5988882lHPAGf','Updated\x20role\x20','remark','187424vTFPhZ','7tKXykR','380fJMzzq','New\x20role\x20name','--name\x20cannot\x20be\x20empty.','/smartapi/permit/role/update','roleName','dev','Nothing\x20to\x20update.','update','POST','name','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','role','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','flag','write','num','27080rnoOKi','22231DzHvgk'];a185_0x2e1d=function(){return _0x2f64ed;};return a185_0x2e1d();}
1
+ const a185_0x2e2b43=a185_0x25ee;function a185_0x4d37(){const _0x455dce=['Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','flag','validation','num','27829104iURRyr','string','roleName','update','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','3642544drORsq','430705ZIBjmI','1359698UyhDom','Nothing\x20to\x20update.','dev','2166934mRjeIS','New\x20role\x20name','2581620VLvRhv','Updated\x20role\x20','appCode','POST','role','3cCubDp','remark','4139155EcEICB','name'];a185_0x4d37=function(){return _0x455dce;};return a185_0x4d37();}(function(_0x5ed277,_0x17ed7e){const _0xd50c2a=a185_0x25ee,_0x1f0b2d=_0x5ed277();while(!![]){try{const _0x41d8a9=-parseInt(_0xd50c2a(0xe1))/0x1+-parseInt(_0xd50c2a(0xe2))/0x2+parseInt(_0xd50c2a(0xd2))/0x3*(-parseInt(_0xd50c2a(0xe0))/0x4)+-parseInt(_0xd50c2a(0xd4))/0x5+-parseInt(_0xd50c2a(0xcd))/0x6+parseInt(_0xd50c2a(0xcb))/0x7+parseInt(_0xd50c2a(0xdb))/0x8;if(_0x41d8a9===_0x17ed7e)break;else _0x1f0b2d['push'](_0x1f0b2d['shift']());}catch(_0x216440){_0x1f0b2d['push'](_0x1f0b2d['shift']());}}}(a185_0x4d37,0x7c3ed));import{updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a185_0x25ee(_0x4362e8,_0x29ec80){_0x4362e8=_0x4362e8-0xca;const _0x4d3780=a185_0x4d37();let _0x25ee5d=_0x4d3780[_0x4362e8];return _0x25ee5d;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{assertCustomRole,getRoleById,projectRole,REMARK_FLAG,ROLE_ID_FLAG}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';function readPatch(_0x312bda){const _0x306e21=a185_0x25ee,_0x32efed=_0x312bda[_0x306e21(0xd8)](_0x306e21(0xd5)),_0x5b0e17=_0x312bda[_0x306e21(0xd8)](_0x306e21(0xd3)),_0x2f3007={};if(_0x32efed!==undefined&&_0x32efed!==null){const _0x271a35=String(_0x32efed)['trim']();if(!_0x271a35)throw CliErrors[_0x306e21(0xd9)]('--name\x20cannot\x20be\x20empty.');if(_0x271a35['length']>0x40)throw CliErrors['validation'](_0x306e21(0xd7));_0x2f3007[_0x306e21(0xdd)]=_0x271a35;}_0x5b0e17!==undefined&&_0x5b0e17!==null&&(_0x2f3007[_0x306e21(0xd3)]=String(_0x5b0e17));if(_0x2f3007['roleName']===undefined&&_0x2f3007['remark']===undefined)throw CliErrors[_0x306e21(0xd9)](_0x306e21(0xe3),_0x306e21(0xd6));return _0x2f3007;}export const roleUpdate={'service':a185_0x2e2b43(0xd1),'command':a185_0x2e2b43(0xde),'description':a185_0x2e2b43(0xdf),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a185_0x2e2b43(0xd5),'type':a185_0x2e2b43(0xdc),'required':![],'description':a185_0x2e2b43(0xcc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x28971d){readPatch(_0x28971d);},async 'dryRun'(_0x586202){const _0x44057e=a185_0x2e2b43,_0x12d20b=_0x586202[_0x44057e(0xda)]('id'),_0x2aabe3=readPatch(_0x586202),_0x1d45f1=await getRoleById(_0x586202[_0x44057e(0xcf)],_0x12d20b);return assertCustomRole(_0x1d45f1,_0x44057e(0xde)),asDryRunResult({'scope':'dev','operation':_0x44057e(0xde),'selector':{'appCode':_0x586202['appCode'],'roleId':_0x12d20b,'roleName':_0x1d45f1[_0x44057e(0xdd)]},'before':projectRole(_0x1d45f1),'after':projectRole({..._0x1d45f1,..._0x2aabe3['roleName']!==undefined?{'roleName':_0x2aabe3[_0x44057e(0xdd)]}:{},..._0x2aabe3[_0x44057e(0xd3)]!==undefined?{'remark':_0x2aabe3[_0x44057e(0xd3)]}:{}}),'dryRun':!![],'backend':{'method':_0x44057e(0xd0),'path':UPDATE_PATH},'warnings':[]},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x2a83b4){const _0x1d754d=a185_0x2e2b43,_0x43fa85=_0x2a83b4['num']('id'),_0x316cec=readPatch(_0x2a83b4),_0x11ddae=await getRoleById(_0x2a83b4[_0x1d754d(0xcf)],_0x43fa85);assertCustomRole(_0x11ddae,_0x1d754d(0xde)),await updateAppRole({'id':_0x43fa85,'appCode':_0x2a83b4[_0x1d754d(0xcf)],..._0x316cec[_0x1d754d(0xdd)]!==undefined?{'roleName':_0x316cec[_0x1d754d(0xdd)]}:{},..._0x316cec[_0x1d754d(0xd3)]!==undefined?{'remark':_0x316cec[_0x1d754d(0xd3)]}:{}});const _0x180c06=await getRoleById(_0x2a83b4['appCode'],_0x43fa85);return{'ok':!![],'data':{'scope':_0x1d754d(0xca),'operation':_0x1d754d(0xde),'selector':{'appCode':_0x2a83b4[_0x1d754d(0xcf)],'roleId':_0x43fa85,'roleName':_0x180c06[_0x1d754d(0xdd)]},'before':projectRole(_0x11ddae),'after':projectRole(_0x180c06),'dryRun':![],'backend':{'method':_0x1d754d(0xd0),'path':UPDATE_PATH},'warnings':[]},'message':_0x1d754d(0xce)+_0x180c06[_0x1d754d(0xdd)]+'\x20(id='+_0x43fa85+')'};}};
@@ -1 +1 @@
1
- function a186_0x990c(){const _0x149630=['19925cHGFTp','username','354JwUBxE','user-add','role','133tmWPZB','10822ilwaCM','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','roleId','roleName','4FUJOTd','No\x20change:\x20user\x20','9277086ZzzfzL','appCode','11383520fPBOej','11Iiqcil','selector','29597550IXTaMY','1839888mYaWuM','high-risk-write','userId','roleType','\x20to\x20role\x20','\x20already\x20in\x20role\x20','2774667DPLega'];a186_0x990c=function(){return _0x149630;};return a186_0x990c();}const a186_0x247942=a186_0x262b;(function(_0x24764a,_0x3f5eb5){const _0x2ab184=a186_0x262b,_0x4c179b=_0x24764a();while(!![]){try{const _0x37ff02=parseInt(_0x2ab184(0xf8))/0x1*(-parseInt(_0x2ab184(0xf9))/0x2)+parseInt(_0x2ab184(0xf2))/0x3*(parseInt(_0x2ab184(0xe4))/0x4)+parseInt(_0x2ab184(0xf3))/0x5*(parseInt(_0x2ab184(0xf5))/0x6)+-parseInt(_0x2ab184(0xe6))/0x7+-parseInt(_0x2ab184(0xe8))/0x8+parseInt(_0x2ab184(0xec))/0x9+-parseInt(_0x2ab184(0xeb))/0xa*(-parseInt(_0x2ab184(0xe9))/0xb);if(_0x37ff02===_0x3f5eb5)break;else _0x4c179b['push'](_0x4c179b['shift']());}catch(_0x312cc8){_0x4c179b['push'](_0x4c179b['shift']());}}}(a186_0x990c,0xd10e2));import{createDevUserRole}from'../../core/api-client.js';function a186_0x262b(_0x1babf6,_0x394797){_0x1babf6=_0x1babf6-0xe2;const _0x990c63=a186_0x990c();let _0x262b8c=_0x990c63[_0x1babf6];return _0x262b8c;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a186_0x247942(0xf7),'command':a186_0x247942(0xf6),'description':a186_0x247942(0xfa),'risk':a186_0x247942(0xed),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0xe42b35){const _0x4f4470=a186_0x247942,{mutation:_0x18d65f}=await prepareUserMutation(_0xe42b35,_0x4f4470(0xf6),!![]);return asDryRunResult(_0x18d65f,{'method':'POST','url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x3f7d75){const _0x547ce8=a186_0x247942,{mutation:_0x5c3561,changed:_0x4b9731,role:_0x2d55c5,user:_0x5befff}=await prepareUserMutation(_0x3f7d75,_0x547ce8(0xf6),![]);return _0x4b9731&&await createDevUserRole({'appCode':_0x3f7d75[_0x547ce8(0xe7)],'userId':_0x5befff[_0x547ce8(0xee)],'username':_0x5befff[_0x547ce8(0xf4)],'roleType':_0x2d55c5[_0x547ce8(0xef)],'roleId':_0x5c3561['selector'][_0x547ce8(0xe2)]}),{'ok':!![],'data':_0x5c3561,'message':_0x4b9731?'Added\x20user\x20'+_0x5c3561[_0x547ce8(0xea)]['userId']+_0x547ce8(0xf0)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xe3)]:_0x547ce8(0xe5)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xee)]+_0x547ce8(0xf1)+_0x5c3561[_0x547ce8(0xea)][_0x547ce8(0xe3)]};}};
1
+ function a186_0x5095(){const _0x2967bd=['\x20already\x20in\x20role\x20','role','roleName','No\x20change:\x20user\x20','945HbjKiC','userId','36306FFTuqF','roleType','51464vSFZrQ','username','3137205OBovVR','user-add','selector','4390137obULIN','\x20to\x20role\x20','1000429yQcgGb','755kGwoGH','773062PfNVuB','1203436wPSGWE','appCode','POST','roleId'];a186_0x5095=function(){return _0x2967bd;};return a186_0x5095();}const a186_0x993015=a186_0x21e6;(function(_0x545f2e,_0x4411aa){const _0x59d0f2=a186_0x21e6,_0x10210d=_0x545f2e();while(!![]){try{const _0x247a96=-parseInt(_0x59d0f2(0x16b))/0x1+-parseInt(_0x59d0f2(0x16d))/0x2+parseInt(_0x59d0f2(0x166))/0x3+-parseInt(_0x59d0f2(0x16e))/0x4+-parseInt(_0x59d0f2(0x16c))/0x5*(-parseInt(_0x59d0f2(0x178))/0x6)+parseInt(_0x59d0f2(0x176))/0x7*(parseInt(_0x59d0f2(0x17a))/0x8)+-parseInt(_0x59d0f2(0x169))/0x9;if(_0x247a96===_0x4411aa)break;else _0x10210d['push'](_0x10210d['shift']());}catch(_0x284e50){_0x10210d['push'](_0x10210d['shift']());}}}(a186_0x5095,0x9f3f7));import{createDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';function a186_0x21e6(_0x25c408,_0x509040){_0x25c408=_0x25c408-0x166;const _0x5095b9=a186_0x5095();let _0x21e69e=_0x5095b9[_0x25c408];return _0x21e69e;}import{EXPECT_USER_COUNT_FLAG,CREATE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a186_0x993015(0x173),'command':a186_0x993015(0x167),'description':'Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x4c7a4f){const _0x13edd5=a186_0x993015,{mutation:_0x4606d7}=await prepareUserMutation(_0x4c7a4f,_0x13edd5(0x167),!![]);return asDryRunResult(_0x4606d7,{'method':_0x13edd5(0x170),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x2cbb41){const _0x506532=a186_0x993015,{mutation:_0x3d10a8,changed:_0x1c1c30,role:_0x58ac22,user:_0x5b738b}=await prepareUserMutation(_0x2cbb41,_0x506532(0x167),![]);return _0x1c1c30&&await createDevUserRole({'appCode':_0x2cbb41[_0x506532(0x16f)],'userId':_0x5b738b[_0x506532(0x177)],'username':_0x5b738b[_0x506532(0x17b)],'roleType':_0x58ac22[_0x506532(0x179)],'roleId':_0x3d10a8['selector'][_0x506532(0x171)]}),{'ok':!![],'data':_0x3d10a8,'message':_0x1c1c30?'Added\x20user\x20'+_0x3d10a8[_0x506532(0x168)]['userId']+_0x506532(0x16a)+_0x3d10a8[_0x506532(0x168)][_0x506532(0x174)]:_0x506532(0x175)+_0x3d10a8['selector'][_0x506532(0x177)]+_0x506532(0x172)+_0x3d10a8[_0x506532(0x168)][_0x506532(0x174)]};}};
@@ -1 +1 @@
1
- const a187_0x1f5916=a187_0x3c02;(function(_0x5a55b6,_0x5a3dfb){const _0x2906f9=a187_0x3c02,_0x381d70=_0x5a55b6();while(!![]){try{const _0x550b30=parseInt(_0x2906f9(0x161))/0x1+-parseInt(_0x2906f9(0x164))/0x2+-parseInt(_0x2906f9(0x166))/0x3*(-parseInt(_0x2906f9(0x167))/0x4)+parseInt(_0x2906f9(0x159))/0x5+parseInt(_0x2906f9(0x15e))/0x6*(-parseInt(_0x2906f9(0x15c))/0x7)+parseInt(_0x2906f9(0x168))/0x8+parseInt(_0x2906f9(0x15b))/0x9;if(_0x550b30===_0x5a3dfb)break;else _0x381d70['push'](_0x381d70['shift']());}catch(_0x32669f){_0x381d70['push'](_0x381d70['shift']());}}}(a187_0x3af9,0x52641));import{deleteDevUserRole}from'../../core/api-client.js';function a187_0x3af9(){const _0x148692=['Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','userId','97411kjYRvP','user-remove','Removed\x20user\x20','437146TlNRfT','\x20from\x20role\x20','1083279JYrzNd','4IukTdG','1049200qYQVKT','selector','No\x20change:\x20user\x20','high-risk-write','1051885Bgddlw','POST','2279043MSwSbj','870121RYTzuK','roleName','24QGweuy'];a187_0x3af9=function(){return _0x148692;};return a187_0x3af9();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x3c02(_0x2cd90d,_0x2f8f7b){_0x2cd90d=_0x2cd90d-0x156;const _0x3af9fb=a187_0x3af9();let _0x3c0260=_0x3af9fb[_0x2cd90d];return _0x3c0260;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':a187_0x1f5916(0x162),'description':a187_0x1f5916(0x15f),'risk':a187_0x1f5916(0x158),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x136608){const _0xbf4b5b=a187_0x1f5916,{mutation:_0x3f70b2}=await prepareUserMutation(_0x136608,_0xbf4b5b(0x162),!![]);return asDryRunResult(_0x3f70b2,{'method':_0xbf4b5b(0x15a),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x2e36ad){const _0x3a88a2=a187_0x1f5916,{matchingRelationIds:_0x11ac71,mutation:_0x4d6e4d,changed:_0x3c16ec}=await prepareUserMutation(_0x2e36ad,_0x3a88a2(0x162),![]);if(_0x3c16ec)for(const _0x3c2953 of _0x11ac71){await deleteDevUserRole(_0x3c2953);}return{'ok':!![],'data':_0x4d6e4d,'message':_0x3c16ec?_0x3a88a2(0x163)+_0x4d6e4d['selector']['userId']+_0x3a88a2(0x165)+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x15d)]:_0x3a88a2(0x157)+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x160)]+'\x20not\x20in\x20role\x20'+_0x4d6e4d[_0x3a88a2(0x156)][_0x3a88a2(0x15d)]};}};
1
+ function a187_0x497f(){const _0x50e9c3=['24NsPuAr','high-risk-write','roleName','2318424iqgKYN','\x20not\x20in\x20role\x20','No\x20change:\x20user\x20','644796ognMId','userId','user-remove','336759FukPIK','Remove\x20a\x20user\x20from\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','28QCbsXY','7550564pGSSXd','selector','96745oRjxTr','4283510zkoNvN','144MYHpPG','\x20from\x20role\x20','21858AdoAMP'];a187_0x497f=function(){return _0x50e9c3;};return a187_0x497f();}const a187_0xf4de5e=a187_0x4955;(function(_0x3ec36d,_0x2dcd13){const _0x40f380=a187_0x4955,_0x5da859=_0x3ec36d();while(!![]){try{const _0x2fb8f1=parseInt(_0x40f380(0x1e2))/0x1*(-parseInt(_0x40f380(0x1e1))/0x2)+parseInt(_0x40f380(0x1d8))/0x3+-parseInt(_0x40f380(0x1da))/0x4*(parseInt(_0x40f380(0x1dd))/0x5)+parseInt(_0x40f380(0x1d2))/0x6+-parseInt(_0x40f380(0x1db))/0x7+parseInt(_0x40f380(0x1df))/0x8*(parseInt(_0x40f380(0x1d5))/0x9)+parseInt(_0x40f380(0x1de))/0xa;if(_0x2fb8f1===_0x2dcd13)break;else _0x5da859['push'](_0x5da859['shift']());}catch(_0x2cbadc){_0x5da859['push'](_0x5da859['shift']());}}}(a187_0x497f,0xb4b71));import{deleteDevUserRole}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a187_0x4955(_0x48d28c,_0x4cd2ad){_0x48d28c=_0x48d28c-0x1d1;const _0x497fa8=a187_0x497f();let _0x495558=_0x497fa8[_0x48d28c];return _0x495558;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{EXPECT_USER_COUNT_FLAG,DELETE_USER_ROLE_PATH,prepareUserMutation,ROLE_REF_FLAG,USER_REF_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':'user-remove','description':a187_0xf4de5e(0x1d9),'risk':a187_0xf4de5e(0x1e3),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x1c54d4){const _0x42d75f=a187_0xf4de5e,{mutation:_0x35953b}=await prepareUserMutation(_0x1c54d4,_0x42d75f(0x1d7),!![]);return asDryRunResult(_0x35953b,{'method':'POST','url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x5e2a88){const _0x32d825=a187_0xf4de5e,{matchingRelationIds:_0x1a8979,mutation:_0x1fbb2f,changed:_0x1ec4ce}=await prepareUserMutation(_0x5e2a88,_0x32d825(0x1d7),![]);if(_0x1ec4ce)for(const _0x1eccd6 of _0x1a8979){await deleteDevUserRole(_0x1eccd6);}return{'ok':!![],'data':_0x1fbb2f,'message':_0x1ec4ce?'Removed\x20user\x20'+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d6)]+_0x32d825(0x1e0)+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d1)]:_0x32d825(0x1d4)+_0x1fbb2f['selector'][_0x32d825(0x1d6)]+_0x32d825(0x1d3)+_0x1fbb2f[_0x32d825(0x1dc)][_0x32d825(0x1d1)]};}};
@@ -1 +1 @@
1
- const a188_0x32bf13=a188_0xf4cc;function a188_0xf4cc(_0x529818,_0x4a97bf){_0x529818=_0x529818-0x166;const _0x180b57=a188_0x180b();let _0xf4cc60=_0x180b57[_0x529818];return _0xf4cc60;}(function(_0x4c80c3,_0xb497ba){const _0x19093e=a188_0xf4cc,_0x40aecf=_0x4c80c3();while(!![]){try{const _0x2030ad=-parseInt(_0x19093e(0x171))/0x1*(parseInt(_0x19093e(0x172))/0x2)+-parseInt(_0x19093e(0x168))/0x3*(parseInt(_0x19093e(0x178))/0x4)+-parseInt(_0x19093e(0x16d))/0x5+parseInt(_0x19093e(0x166))/0x6+-parseInt(_0x19093e(0x167))/0x7+-parseInt(_0x19093e(0x174))/0x8+parseInt(_0x19093e(0x177))/0x9;if(_0x2030ad===_0xb497ba)break;else _0x40aecf['push'](_0x40aecf['shift']());}catch(_0x2a8b4f){_0x40aecf['push'](_0x40aecf['shift']());}}}(a188_0x180b,0x734ed));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a188_0x180b(){const _0xb0ad81=['username','1855215EjIAws','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','trim','Resolved\x20\x22','580434WddVUl','2XBNGkw','flagMissing','271352NLKCwl','matchedBy','Pass\x20--name\x20<nickname|username>.','18676746iXRxeM','2134780CopYhD','name','\x22\x20→\x20userId\x20','str','2358840lcdAce','3338594VIVsdU','3kNqHxc','userId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','nickname'];a188_0x180b=function(){return _0xb0ad81;};return a188_0x180b();}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':'role','command':'user-resolve','description':a188_0x32bf13(0x16a),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x36a574){const _0x306c21=a188_0x32bf13;if(!_0x36a574[_0x306c21(0x17b)](_0x306c21(0x179))[_0x306c21(0x16f)]())throw CliErrors[_0x306c21(0x173)](_0x306c21(0x179),_0x306c21(0x176));},async 'execute'(_0x1c03ab){const _0x3df888=a188_0x32bf13,_0x5247e5=_0x1c03ab['str'](_0x3df888(0x179))['trim'](),_0x4cd8d8=await resolveUserRef(_0x5247e5,_0x3df888(0x16e));return{'ok':!![],'data':{'user':{'userId':_0x4cd8d8[_0x3df888(0x169)],'username':_0x4cd8d8[_0x3df888(0x16c)],'nickname':_0x4cd8d8[_0x3df888(0x16b)],'matchedBy':_0x4cd8d8[_0x3df888(0x175)]}},'message':_0x3df888(0x170)+_0x5247e5+_0x3df888(0x17a)+_0x4cd8d8[_0x3df888(0x169)]};}};
1
+ const a188_0x15d10e=a188_0xb31a;(function(_0x1e7d47,_0x3cb1c9){const _0x35fabb=a188_0xb31a,_0x24e191=_0x1e7d47();while(!![]){try{const _0x45b35d=-parseInt(_0x35fabb(0x1b6))/0x1+-parseInt(_0x35fabb(0x1ba))/0x2+parseInt(_0x35fabb(0x1b5))/0x3*(-parseInt(_0x35fabb(0x1a5))/0x4)+-parseInt(_0x35fabb(0x1a8))/0x5+parseInt(_0x35fabb(0x1b4))/0x6*(parseInt(_0x35fabb(0x1af))/0x7)+parseInt(_0x35fabb(0x1ad))/0x8*(parseInt(_0x35fabb(0x1b2))/0x9)+parseInt(_0x35fabb(0x1a9))/0xa*(parseInt(_0x35fabb(0x1a6))/0xb);if(_0x45b35d===_0x3cb1c9)break;else _0x24e191['push'](_0x24e191['shift']());}catch(_0x571b1d){_0x24e191['push'](_0x24e191['shift']());}}}(a188_0x11b7,0x7add0));function a188_0xb31a(_0x1bd5c5,_0x197e69){_0x1bd5c5=_0x1bd5c5-0x1a3;const _0x11b761=a188_0x11b7();let _0xb31a9e=_0x11b761[_0x1bd5c5];return _0xb31a9e;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';function a188_0x11b7(){const _0x22dd65=['name','nickname','Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.','190864uXFwPG','username','28bOissm','role','Pass\x20--name\x20<nickname|username>.','162wrVdHd','str','481038aTOWPg','3PSUdzU','403370bMiYka','userId','read','user-resolve','814166sXyFHA','matchedBy','flagMissing','2008228yXzCHU','847CqrJjG','trim','4581405XRdzzS','257390sOSmip'];a188_0x11b7=function(){return _0x22dd65;};return a188_0x11b7();}export const roleUserResolve={'service':a188_0x15d10e(0x1b0),'command':a188_0x15d10e(0x1b9),'description':'Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','risk':a188_0x15d10e(0x1b8),'flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x246810){const _0x382066=a188_0x15d10e;if(!_0x246810[_0x382066(0x1b3)](_0x382066(0x1aa))[_0x382066(0x1a7)]())throw CliErrors[_0x382066(0x1a4)]('name',_0x382066(0x1b1));},async 'execute'(_0x4c8b26){const _0x4e90b3=a188_0x15d10e,_0x44c4d4=_0x4c8b26[_0x4e90b3(0x1b3)](_0x4e90b3(0x1aa))[_0x4e90b3(0x1a7)](),_0x228103=await resolveUserRef(_0x44c4d4,_0x4e90b3(0x1ac));return{'ok':!![],'data':{'user':{'userId':_0x228103[_0x4e90b3(0x1b7)],'username':_0x228103[_0x4e90b3(0x1ae)],'nickname':_0x228103[_0x4e90b3(0x1ab)],'matchedBy':_0x228103[_0x4e90b3(0x1a3)]}},'message':'Resolved\x20\x22'+_0x44c4d4+'\x22\x20→\x20userId\x20'+_0x228103[_0x4e90b3(0x1b7)]};}};
@@ -1 +1 @@
1
- const a189_0x116181=a189_0x1187;function a189_0x1187(_0x3c46cb,_0x5186e3){_0x3c46cb=_0x3c46cb-0x151;const _0x4b97df=a189_0x4b97();let _0x118774=_0x4b97df[_0x3c46cb];return _0x118774;}(function(_0x1f8068,_0x318caf){const _0x374218=a189_0x1187,_0x429771=_0x1f8068();while(!![]){try{const _0x49e2d8=-parseInt(_0x374218(0x165))/0x1+-parseInt(_0x374218(0x15c))/0x2+parseInt(_0x374218(0x160))/0x3*(-parseInt(_0x374218(0x161))/0x4)+parseInt(_0x374218(0x163))/0x5*(parseInt(_0x374218(0x155))/0x6)+-parseInt(_0x374218(0x15d))/0x7*(-parseInt(_0x374218(0x162))/0x8)+parseInt(_0x374218(0x157))/0x9*(-parseInt(_0x374218(0x164))/0xa)+-parseInt(_0x374218(0x15b))/0xb*(-parseInt(_0x374218(0x158))/0xc);if(_0x49e2d8===_0x318caf)break;else _0x429771['push'](_0x429771['shift']());}catch(_0x31ff43){_0x429771['push'](_0x429771['shift']());}}}(a189_0x4b97,0xd1a0f));function a189_0x4b97(){const _0x4c4732=['read','80361VnVoQM','30516gdNVAB','get','cookie','13541KimJxo','1001730trwdCV','4493167UWqUOm','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','68322zSfmqT','88wCpzhN','8swpVfn','10venTuw','1070czRySk','987947mMjyQJ','\x20is\x20not\x20configured\x20for\x20app\x20','\x20for\x20','content','appCode','\x20--file\x20<path>\x20--dry-run`.','94704THtUWZ'];a189_0x4b97=function(){return _0x4c4732;};return a189_0x4b97();}import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':'rule','command':a189_0x116181(0x159),'description':a189_0x116181(0x15e),'risk':a189_0x116181(0x156),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x278a45){readAppRuleType(_0x278a45);},async 'execute'(_0x507a72){const _0x56a1d2=a189_0x116181,_0x194db8=readAppRuleType(_0x507a72),_0x584fad=await getAppRule(_0x507a72[_0x56a1d2(0x15a)],{'appCode':_0x507a72[_0x56a1d2(0x153)],'type':_0x194db8});if(!_0x584fad)throw appRuleError('app_rule_not_found',appRuleFileName(_0x194db8)+_0x56a1d2(0x166)+_0x507a72[_0x56a1d2(0x153)]+'.',_0x56a1d2(0x15f)+_0x194db8+_0x56a1d2(0x154));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x194db8,_0x584fad),'content':_0x584fad[_0x56a1d2(0x152)]}},'message':'Loaded\x20'+appRuleFileName(_0x194db8)+_0x56a1d2(0x151)+_0x507a72['appCode']};}};
1
+ function a189_0x5d30(_0x29487c,_0x4743cd){_0x29487c=_0x29487c-0x1cc;const _0xbb5428=a189_0xbb54();let _0x5d30da=_0xbb5428[_0x29487c];return _0x5d30da;}const a189_0x1d3efd=a189_0x5d30;(function(_0x45cb16,_0x414d6b){const _0x3982b5=a189_0x5d30,_0x1262d4=_0x45cb16();while(!![]){try{const _0x32cfa7=parseInt(_0x3982b5(0x1cd))/0x1*(-parseInt(_0x3982b5(0x1df))/0x2)+-parseInt(_0x3982b5(0x1cc))/0x3*(-parseInt(_0x3982b5(0x1d1))/0x4)+parseInt(_0x3982b5(0x1dc))/0x5*(parseInt(_0x3982b5(0x1d7))/0x6)+parseInt(_0x3982b5(0x1da))/0x7*(-parseInt(_0x3982b5(0x1d8))/0x8)+-parseInt(_0x3982b5(0x1db))/0x9*(-parseInt(_0x3982b5(0x1d2))/0xa)+parseInt(_0x3982b5(0x1cf))/0xb+-parseInt(_0x3982b5(0x1e2))/0xc;if(_0x32cfa7===_0x414d6b)break;else _0x1262d4['push'](_0x1262d4['shift']());}catch(_0x22a50d){_0x1262d4['push'](_0x1262d4['shift']());}}}(a189_0xbb54,0xcfe66));import{getAppRule}from'../../core/api-client.js';function a189_0xbb54(){const _0x2684d2=['content','app_rule_not_found','1652878kLYMBb','Loaded\x20','\x20--file\x20<path>\x20--dry-run`.','26372040CqmDQF','get','80529izbVXC','1qHwlFd','cookie','15287954NQnTnQ','read','8uTHevd','140QRFJVO','\x20is\x20not\x20configured\x20for\x20app\x20','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','appCode','\x20for\x20','6XyPSrO','256kmCcnm','Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','50547uYDGHt','652518oDUxtv','8241055YkCxGl'];a189_0xbb54=function(){return _0x2684d2;};return a189_0xbb54();}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':'rule','command':a189_0x1d3efd(0x1e3),'description':a189_0x1d3efd(0x1d4),'risk':a189_0x1d3efd(0x1d0),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x57f297){readAppRuleType(_0x57f297);},async 'execute'(_0x5368e7){const _0x519879=a189_0x1d3efd,_0x2d2416=readAppRuleType(_0x5368e7),_0x3fd306=await getAppRule(_0x5368e7[_0x519879(0x1ce)],{'appCode':_0x5368e7[_0x519879(0x1d5)],'type':_0x2d2416});if(!_0x3fd306)throw appRuleError(_0x519879(0x1de),appRuleFileName(_0x2d2416)+_0x519879(0x1d3)+_0x5368e7[_0x519879(0x1d5)]+'.',_0x519879(0x1d9)+_0x2d2416+_0x519879(0x1e1));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x2d2416,_0x3fd306),'content':_0x3fd306[_0x519879(0x1dd)]}},'message':_0x519879(0x1e0)+appRuleFileName(_0x2d2416)+_0x519879(0x1d6)+_0x5368e7[_0x519879(0x1d5)]};}};
@@ -1 +1 @@
1
- (function(_0x1b6fc1,_0x28c7ff){const _0x3708a1=a190_0x5d5f,_0x3f0e01=_0x1b6fc1();while(!![]){try{const _0x3edfe4=parseInt(_0x3708a1(0x111))/0x1+parseInt(_0x3708a1(0x110))/0x2*(parseInt(_0x3708a1(0x112))/0x3)+parseInt(_0x3708a1(0x10d))/0x4+-parseInt(_0x3708a1(0x108))/0x5*(parseInt(_0x3708a1(0x10f))/0x6)+parseInt(_0x3708a1(0x10a))/0x7*(-parseInt(_0x3708a1(0x10b))/0x8)+-parseInt(_0x3708a1(0x10c))/0x9+parseInt(_0x3708a1(0x10e))/0xa*(parseInt(_0x3708a1(0x109))/0xb);if(_0x3edfe4===_0x28c7ff)break;else _0x3f0e01['push'](_0x3f0e01['shift']());}catch(_0x5dfeff){_0x3f0e01['push'](_0x3f0e01['shift']());}}}(a190_0x413b,0x6e8ed));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';function a190_0x5d5f(_0x4f21dc,_0x5dc6be){_0x4f21dc=_0x4f21dc-0x108;const _0x413b29=a190_0x413b();let _0x5d5fce=_0x413b29[_0x4f21dc];return _0x5d5fce;}function a190_0x413b(){const _0x535b07=['1168Fkckhb','2443680VLguvG','1977368Ongybn','10dLagaU','6000rtENak','2768ysldXJ','511179riqXNk','1182NeULtn','3475VkmlYb','762278Sadnyy','9625GsoGZw'];a190_0x413b=function(){return _0x535b07;};return a190_0x413b();}import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
1
+ function a190_0x18df(_0x918dc4,_0x521052){_0x918dc4=_0x918dc4-0x151;const _0x5d368c=a190_0x5d36();let _0x18df84=_0x5d368c[_0x918dc4];return _0x18df84;}(function(_0x4333bb,_0x40245b){const _0x80025f=a190_0x18df,_0x33c151=_0x4333bb();while(!![]){try{const _0x39cff7=parseInt(_0x80025f(0x156))/0x1*(parseInt(_0x80025f(0x154))/0x2)+parseInt(_0x80025f(0x159))/0x3+parseInt(_0x80025f(0x151))/0x4*(-parseInt(_0x80025f(0x155))/0x5)+parseInt(_0x80025f(0x15d))/0x6*(parseInt(_0x80025f(0x153))/0x7)+parseInt(_0x80025f(0x15a))/0x8*(-parseInt(_0x80025f(0x15c))/0x9)+parseInt(_0x80025f(0x158))/0xa*(parseInt(_0x80025f(0x15b))/0xb)+parseInt(_0x80025f(0x152))/0xc*(-parseInt(_0x80025f(0x157))/0xd);if(_0x39cff7===_0x40245b)break;else _0x33c151['push'](_0x33c151['shift']());}catch(_0x4cc47d){_0x33c151['push'](_0x33c151['shift']());}}}(a190_0x5d36,0x45fc6));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';function a190_0x5d36(){const _0x549214=['33dLbJUX','3186RJJGSS','333978DHOWXr','910148xpCujz','180tXkkFJ','14jVJKEa','14DJzDre','5BOFLrv','75689vIFJzY','763464CrlBIf','1726850CjcNMO','904215SqQLQV','1480pXndxI'];a190_0x5d36=function(){return _0x549214;};return a190_0x5d36();}export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
@@ -1 +1 @@
1
- const a191_0x3ab631=a191_0x5219;(function(_0x11104b,_0x4af542){const _0xa75722=a191_0x5219,_0x4e802f=_0x11104b();while(!![]){try{const _0x5262fd=-parseInt(_0xa75722(0xa5))/0x1*(parseInt(_0xa75722(0x9a))/0x2)+-parseInt(_0xa75722(0x95))/0x3+-parseInt(_0xa75722(0xa0))/0x4*(parseInt(_0xa75722(0x96))/0x5)+-parseInt(_0xa75722(0xa3))/0x6+-parseInt(_0xa75722(0xa2))/0x7+-parseInt(_0xa75722(0x9d))/0x8+-parseInt(_0xa75722(0x9b))/0x9*(-parseInt(_0xa75722(0x9e))/0xa);if(_0x5262fd===_0x4af542)break;else _0x4e802f['push'](_0x4e802f['shift']());}catch(_0x379a15){_0x4e802f['push'](_0x4e802f['shift']());}}}(a191_0x5226,0x4e92a));import{getAppRule}from'../../core/api-client.js';function a191_0x5226(){const _0x8c8899=['read','map','1550pWHmtK','207suhUsr','length','4405128WeWbzh','1158520sEkSRa','all','88VVledk','appCode','598549ECCUxD','3238662DpfItI','cookie','697YtVkDU','584010qPdWNm','98180cgnXue','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app'];a191_0x5226=function(){return _0x8c8899;};return a191_0x5226();}function a191_0x5219(_0x18158d,_0x109d11){_0x18158d=_0x18158d-0x95;const _0x522626=a191_0x5226();let _0x521941=_0x522626[_0x18158d];return _0x521941;}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':'list','description':a191_0x3ab631(0x97),'risk':a191_0x3ab631(0x98),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x2260a3){const _0x1038ec=a191_0x3ab631,_0x2c359d=await Promise[_0x1038ec(0x9f)](APP_RULE_TYPES[_0x1038ec(0x99)](_0x290c43=>getAppRule(_0x2260a3[_0x1038ec(0xa4)],{'appCode':_0x2260a3[_0x1038ec(0xa1)],'type':_0x290c43}))),_0xf65e48=APP_RULE_TYPES['map']((_0x69fadc,_0x153fbc)=>projectAppRule(_0x69fadc,_0x2c359d[_0x153fbc]??null));return{'ok':!![],'data':{'total':_0xf65e48[_0x1038ec(0x9c)],'rules':_0xf65e48},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x2260a3[_0x1038ec(0xa1)]};}};
1
+ const a191_0x2b6a0d=a191_0x4921;function a191_0x1ced(){const _0xeaabd5=['appCode','list','length','35dPiEJI','3897PZbJBo','3580FuBKrG','1082496xDfNTh','map','64892LyfCJF','156eXxMbt','434962Rdpwsm','998qBNqep','2097753qjlrGk','all','166512rcOUUB','57xNzEOr','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','388iBnaqq','rule'];a191_0x1ced=function(){return _0xeaabd5;};return a191_0x1ced();}(function(_0x570169,_0xe68810){const _0x53230a=a191_0x4921,_0x61f924=_0x570169();while(!![]){try{const _0x48966b=-parseInt(_0x53230a(0x8a))/0x1*(parseInt(_0x53230a(0x84))/0x2)+-parseInt(_0x53230a(0x88))/0x3*(parseInt(_0x53230a(0x81))/0x4)+-parseInt(_0x53230a(0x8f))/0x5*(-parseInt(_0x53230a(0x87))/0x6)+-parseInt(_0x53230a(0x85))/0x7+parseInt(_0x53230a(0x7f))/0x8+-parseInt(_0x53230a(0x90))/0x9*(-parseInt(_0x53230a(0x7e))/0xa)+parseInt(_0x53230a(0x83))/0xb*(parseInt(_0x53230a(0x82))/0xc);if(_0x48966b===_0xe68810)break;else _0x61f924['push'](_0x61f924['shift']());}catch(_0x4258b6){_0x61f924['push'](_0x61f924['shift']());}}}(a191_0x1ced,0x301f4));import{getAppRule}from'../../core/api-client.js';import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';function a191_0x4921(_0x25d2b5,_0x7c0fb4){_0x25d2b5=_0x25d2b5-0x7e;const _0x1cedfd=a191_0x1ced();let _0x4921d1=_0x1cedfd[_0x25d2b5];return _0x4921d1;}export const ruleList={'service':a191_0x2b6a0d(0x8b),'command':a191_0x2b6a0d(0x8d),'description':a191_0x2b6a0d(0x89),'risk':'read','requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x23b85a){const _0x5bf825=a191_0x2b6a0d,_0x539b2c=await Promise[_0x5bf825(0x86)](APP_RULE_TYPES[_0x5bf825(0x80)](_0x3a93ec=>getAppRule(_0x23b85a['cookie'],{'appCode':_0x23b85a[_0x5bf825(0x8c)],'type':_0x3a93ec}))),_0x2e0aa0=APP_RULE_TYPES[_0x5bf825(0x80)]((_0x2ceab5,_0xa088d6)=>projectAppRule(_0x2ceab5,_0x539b2c[_0xa088d6]??null));return{'ok':!![],'data':{'total':_0x2e0aa0[_0x5bf825(0x8e)],'rules':_0x2e0aa0},'message':'Loaded\x20app\x20rule\x20configuration\x20for\x20'+_0x23b85a['appCode']};}};
@@ -1 +1 @@
1
- const a192_0x4eb518=a192_0x2f79;(function(_0x1b69a8,_0x32da91){const _0x5b8640=a192_0x2f79,_0x3ae770=_0x1b69a8();while(!![]){try{const _0x27656d=parseInt(_0x5b8640(0x152))/0x1*(parseInt(_0x5b8640(0x14e))/0x2)+-parseInt(_0x5b8640(0x133))/0x3+parseInt(_0x5b8640(0x150))/0x4*(parseInt(_0x5b8640(0x140))/0x5)+-parseInt(_0x5b8640(0x13d))/0x6+-parseInt(_0x5b8640(0x139))/0x7*(parseInt(_0x5b8640(0x15c))/0x8)+-parseInt(_0x5b8640(0x147))/0x9+parseInt(_0x5b8640(0x142))/0xa;if(_0x27656d===_0x32da91)break;else _0x3ae770['push'](_0x3ae770['shift']());}catch(_0x1c5f17){_0x3ae770['push'](_0x3ae770['shift']());}}}(a192_0x4b63,0x97359));import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';function a192_0x4b63(){const _0x4da33f=['125839oKpVOK','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','byteSize',';\x20current\x20version\x20is\x20','content','app_rule_version_mismatch','app_rule_verification_failed','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','Set\x20','\x20--format\x20compress','24xOgMip','isSafeInteger','set','POST','\x20could\x20not\x20be\x20verified.','planned','Pass\x20a\x20UTF-8\x20Markdown\x20file.','rules','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','appCode','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','/smartapi/knowledge-base/save','version','flag','cookie','The\x20set\x20request\x20was\x20sent,\x20but\x20','write','1385499KBdxXn','expectedVersion','beforeRecord','app_rule_expected_version_invalid','cause','str','719145XyhUeP','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','expected-version','file','6488208QdmlFW','before','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','813410dEJsXO','contentHash','29982980SrIxuL','input','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','rule','replacement','10742193pBlPEB','push','verified','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','Expected\x20','rabetbase\x20rule\x20get\x20--type\x20','app_rule_set_outcome_unknown','8CBPntA','app_rule_file_required','4TfJcMZ','type'];a192_0x4b63=function(){return _0x4da33f;};return a192_0x4b63();}const SAVE_PATH=a192_0x4eb518(0x12d),NON_ATOMIC_WARNING=a192_0x4eb518(0x166);function readSetInput(_0x5dc4f6){const _0x50cd89=a192_0x4eb518,_0x17993a=readAppRuleType(_0x5dc4f6),_0x3c03ed=_0x5dc4f6[_0x50cd89(0x138)](_0x50cd89(0x13c))['trim']();if(!_0x3c03ed)throw appRuleError(_0x50cd89(0x14f),'--file\x20is\x20required.',_0x50cd89(0x162));const _0x2a627c=_0x5dc4f6[_0x50cd89(0x12f)](_0x50cd89(0x13b));let _0x581a3c;if(_0x2a627c!==undefined){_0x581a3c=Number(_0x2a627c);if(!Number[_0x50cd89(0x15d)](_0x581a3c)||_0x581a3c<0x0)throw appRuleError(_0x50cd89(0x136),'--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.');}return{'type':_0x17993a,'file':_0x3c03ed,'expectedVersion':_0x581a3c};}async function prepareSet(_0x4f745d){const _0xb28f42=a192_0x4eb518,_0x2c9b9e=readSetInput(_0x4f745d),_0x392cf0=await readAppRuleFile(_0x2c9b9e[_0xb28f42(0x13c)]),_0x19d2e8=await getAppRule(_0x4f745d[_0xb28f42(0x130)],{'appCode':_0x4f745d[_0xb28f42(0x165)],'type':_0x2c9b9e[_0xb28f42(0x151)]});if(_0x2c9b9e[_0xb28f42(0x134)]!==undefined&&_0x19d2e8?.[_0xb28f42(0x12e)]!==_0x2c9b9e['expectedVersion'])throw appRuleError(_0xb28f42(0x157),appRuleFileName(_0x2c9b9e[_0xb28f42(0x151)])+'\x20version\x20changed\x20before\x20write.',_0xb28f42(0x14b)+_0x2c9b9e[_0xb28f42(0x134)]+_0xb28f42(0x155)+(_0x19d2e8?.['version']??'unconfigured')+_0xb28f42(0x164));return{'input':_0x2c9b9e,'replacement':_0x392cf0,'beforeRecord':_0x19d2e8,'before':projectAppRule(_0x2c9b9e[_0xb28f42(0x151)],_0x19d2e8),'planned':{'type':_0x2c9b9e[_0xb28f42(0x151)],'fileName':appRuleFileName(_0x2c9b9e[_0xb28f42(0x151)]),'contextScope':appRuleContextScope(_0x2c9b9e[_0xb28f42(0x151)]),'enabled':!![],'appCode':_0x4f745d[_0xb28f42(0x165)],'scope':'rules','contentByteSize':_0x392cf0[_0xb28f42(0x154)],'contentHash':_0x392cf0[_0xb28f42(0x141)]}};}function a192_0x2f79(_0x173f27,_0x12846d){_0x173f27=_0x173f27-0x12d;const _0x4b6311=a192_0x4b63();let _0x2f79a5=_0x4b6311[_0x173f27];return _0x2f79a5;}function warningsFor(_0x19ed90){return _0x19ed90===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a192_0x4eb518(0x145),'command':a192_0x4eb518(0x15e),'description':a192_0x4eb518(0x144),'risk':a192_0x4eb518(0x132),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':'string','required':!![],'description':a192_0x4eb518(0x13a)},{'name':a192_0x4eb518(0x13b),'type':'number','required':![],'description':a192_0x4eb518(0x153)}],async 'validate'(_0x1e7281){readSetInput(_0x1e7281);},async 'dryRun'(_0x3900dd){const _0x48b1b7=a192_0x4eb518,_0x1fcd9a=await prepareSet(_0x3900dd);return asDryRunResult({'operation':_0x48b1b7(0x15e),'selector':{'appCode':_0x3900dd[_0x48b1b7(0x165)],'scope':'rules','type':_0x1fcd9a[_0x48b1b7(0x143)]['type']},'before':_0x1fcd9a[_0x48b1b7(0x13e)],'after':_0x1fcd9a[_0x48b1b7(0x161)],'dryRun':!![],'backend':{'method':_0x48b1b7(0x15f),'path':SAVE_PATH},'warnings':warningsFor(_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x134)]),'verification':{'expectedVersion':_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x134)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x48b1b7(0x14c)+_0x1fcd9a[_0x48b1b7(0x143)][_0x48b1b7(0x151)]+'\x20--format\x20compress'}},{'method':_0x48b1b7(0x15f),'url':SAVE_PATH});},async 'execute'(_0x59d7a5){const _0x3fabd9=a192_0x4eb518,_0xe3de15=await prepareSet(_0x59d7a5);let _0x5a8829=![];try{await saveAppRule(_0x59d7a5['cookie'],{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'type':_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)],'content':_0xe3de15[_0x3fabd9(0x146)]['content']});}catch(_0x5ab34b){if(!isPlatformTransportFailure(_0x5ab34b))throw _0x5ab34b;_0x5a8829=!![];}let _0x444f9b;try{_0x444f9b=await getAppRule(_0x59d7a5[_0x3fabd9(0x130)],{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'type':_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]});}catch(_0x443604){const _0x44eb6e=appRuleError(_0x5a8829?_0x3fabd9(0x14d):'app_rule_verification_unavailable',_0x3fabd9(0x131)+appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+_0x3fabd9(0x160),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object['defineProperty'](_0x44eb6e,_0x3fabd9(0x137),{'value':_0x443604,'enumerable':![]});throw _0x44eb6e;}const _0x4e7165=_0x444f9b&&inspectAppRuleContent(_0x444f9b[_0x3fabd9(0x156)])[_0x3fabd9(0x141)]===_0xe3de15[_0x3fabd9(0x146)][_0x3fabd9(0x141)],_0x59482b=_0x444f9b&&(_0xe3de15[_0x3fabd9(0x135)]===null||_0x444f9b[_0x3fabd9(0x12e)]>_0xe3de15['beforeRecord'][_0x3fabd9(0x12e)]);if(!_0x444f9b||!_0x4e7165||!_0x59482b)throw appRuleError(_0x5a8829?_0x3fabd9(0x14d):_0x3fabd9(0x158),appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+_0x3fabd9(0x13f),_0x3fabd9(0x159)+_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x2e1a8e=warningsFor(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x134)]);_0x5a8829&&_0x2e1a8e[_0x3fabd9(0x148)](_0x3fabd9(0x14a));const _0x53800a=projectAppRule(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)],_0x444f9b);return{'ok':!![],'data':{'operation':_0x3fabd9(0x15e),'selector':{'appCode':_0x59d7a5[_0x3fabd9(0x165)],'scope':_0x3fabd9(0x163),'type':_0xe3de15[_0x3fabd9(0x143)]['type']},'before':_0xe3de15[_0x3fabd9(0x13e)],'after':_0x53800a,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x2e1a8e,'verification':{'status':_0x3fabd9(0x149),'recoveredAfterUnknownResponse':_0x5a8829,'expectedVersion':_0xe3de15[_0x3fabd9(0x143)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':'rabetbase\x20rule\x20get\x20--type\x20'+_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)]+_0x3fabd9(0x15b)}},'message':_0x3fabd9(0x15a)+appRuleFileName(_0xe3de15[_0x3fabd9(0x143)][_0x3fabd9(0x151)])+'\x20for\x20'+_0x59d7a5['appCode']};}};
1
+ const a192_0x1fb0e3=a192_0x3684;(function(_0x343eaa,_0x3d9a3e){const _0x33034d=a192_0x3684,_0x1fb4b0=_0x343eaa();while(!![]){try{const _0x47ac81=parseInt(_0x33034d(0x18e))/0x1*(parseInt(_0x33034d(0x1a5))/0x2)+parseInt(_0x33034d(0x1c3))/0x3+parseInt(_0x33034d(0x199))/0x4*(-parseInt(_0x33034d(0x1c7))/0x5)+-parseInt(_0x33034d(0x19e))/0x6+parseInt(_0x33034d(0x198))/0x7+-parseInt(_0x33034d(0x1bd))/0x8*(-parseInt(_0x33034d(0x1a0))/0x9)+-parseInt(_0x33034d(0x1c1))/0xa;if(_0x47ac81===_0x3d9a3e)break;else _0x1fb4b0['push'](_0x1fb4b0['shift']());}catch(_0x444932){_0x1fb4b0['push'](_0x1fb4b0['shift']());}}}(a192_0x5a92,0x403b6));function a192_0x3684(_0x52a9a9,_0x28138a){_0x52a9a9=_0x52a9a9-0x18b;const _0x5a921f=a192_0x5a92();let _0x36846f=_0x5a921f[_0x52a9a9];return _0x36846f;}import{getAppRule,isPlatformTransportFailure,saveAppRule}from'../../core/api-client.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{APP_RULE_TYPE_FLAG,appRuleContextScope,appRuleError,appRuleFileName,inspectAppRuleContent,projectAppRule,readAppRuleFile,readAppRuleType}from'../../commands/rule/shared.js';const SAVE_PATH=a192_0x1fb0e3(0x19f),NON_ATOMIC_WARNING=a192_0x1fb0e3(0x19b);function readSetInput(_0x1d7076){const _0x11c837=a192_0x1fb0e3,_0x5dc5ef=readAppRuleType(_0x1d7076),_0x2736f1=_0x1d7076[_0x11c837(0x1bb)](_0x11c837(0x1a8))[_0x11c837(0x1be)]();if(!_0x2736f1)throw appRuleError(_0x11c837(0x1b1),_0x11c837(0x1c0),_0x11c837(0x1a4));const _0x58af21=_0x1d7076[_0x11c837(0x1a1)](_0x11c837(0x1b6));let _0x5465e7;if(_0x58af21!==undefined){_0x5465e7=Number(_0x58af21);if(!Number['isSafeInteger'](_0x5465e7)||_0x5465e7<0x0)throw appRuleError(_0x11c837(0x1b8),_0x11c837(0x18f));}return{'type':_0x5dc5ef,'file':_0x2736f1,'expectedVersion':_0x5465e7};}async function prepareSet(_0x4f5d9c){const _0x1f13dc=a192_0x1fb0e3,_0x40fe15=readSetInput(_0x4f5d9c),_0x4ccd4a=await readAppRuleFile(_0x40fe15[_0x1f13dc(0x1a8)]),_0x50cede=await getAppRule(_0x4f5d9c[_0x1f13dc(0x191)],{'appCode':_0x4f5d9c['appCode'],'type':_0x40fe15['type']});if(_0x40fe15[_0x1f13dc(0x19c)]!==undefined&&_0x50cede?.[_0x1f13dc(0x1b3)]!==_0x40fe15[_0x1f13dc(0x19c)])throw appRuleError(_0x1f13dc(0x1ac),appRuleFileName(_0x40fe15[_0x1f13dc(0x1ad)])+_0x1f13dc(0x196),'Expected\x20'+_0x40fe15['expectedVersion']+_0x1f13dc(0x1ab)+(_0x50cede?.[_0x1f13dc(0x1b3)]??_0x1f13dc(0x18b))+_0x1f13dc(0x193));return{'input':_0x40fe15,'replacement':_0x4ccd4a,'beforeRecord':_0x50cede,'before':projectAppRule(_0x40fe15['type'],_0x50cede),'planned':{'type':_0x40fe15[_0x1f13dc(0x1ad)],'fileName':appRuleFileName(_0x40fe15[_0x1f13dc(0x1ad)]),'contextScope':appRuleContextScope(_0x40fe15[_0x1f13dc(0x1ad)]),'enabled':!![],'appCode':_0x4f5d9c[_0x1f13dc(0x1b9)],'scope':_0x1f13dc(0x1a9),'contentByteSize':_0x4ccd4a['byteSize'],'contentHash':_0x4ccd4a['contentHash']}};}function warningsFor(_0x20b047){return _0x20b047===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':'rule','command':a192_0x1fb0e3(0x1b4),'description':a192_0x1fb0e3(0x1a7),'risk':a192_0x1fb0e3(0x19d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':'file','type':a192_0x1fb0e3(0x1b2),'required':!![],'description':a192_0x1fb0e3(0x1c8)},{'name':a192_0x1fb0e3(0x1b6),'type':a192_0x1fb0e3(0x1bf),'required':![],'description':a192_0x1fb0e3(0x1a6)}],async 'validate'(_0x2cb2fd){readSetInput(_0x2cb2fd);},async 'dryRun'(_0x3489c0){const _0x283119=a192_0x1fb0e3,_0x490398=await prepareSet(_0x3489c0);return asDryRunResult({'operation':_0x283119(0x1b4),'selector':{'appCode':_0x3489c0[_0x283119(0x1b9)],'scope':_0x283119(0x1a9),'type':_0x490398['input'][_0x283119(0x1ad)]},'before':_0x490398[_0x283119(0x1ae)],'after':_0x490398[_0x283119(0x1b5)],'dryRun':!![],'backend':{'method':_0x283119(0x1b0),'path':SAVE_PATH},'warnings':warningsFor(_0x490398[_0x283119(0x192)][_0x283119(0x19c)]),'verification':{'expectedVersion':_0x490398[_0x283119(0x192)][_0x283119(0x19c)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x283119(0x197)+_0x490398[_0x283119(0x192)][_0x283119(0x1ad)]+_0x283119(0x1c4)}},{'method':_0x283119(0x1b0),'url':SAVE_PATH});},async 'execute'(_0x2508fc){const _0x20ce8f=a192_0x1fb0e3,_0x56ee78=await prepareSet(_0x2508fc);let _0x2b33d2=![];try{await saveAppRule(_0x2508fc['cookie'],{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)],'content':_0x56ee78[_0x20ce8f(0x1b7)][_0x20ce8f(0x190)]});}catch(_0x55a99d){if(!isPlatformTransportFailure(_0x55a99d))throw _0x55a99d;_0x2b33d2=!![];}let _0x43b699;try{_0x43b699=await getAppRule(_0x2508fc[_0x20ce8f(0x191)],{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]});}catch(_0x1b760b){const _0x20b326=appRuleError(_0x2b33d2?'app_rule_set_outcome_unknown':_0x20ce8f(0x19a),_0x20ce8f(0x1a2)+appRuleFileName(_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)])+_0x20ce8f(0x1a3),'Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.');Object['defineProperty'](_0x20b326,_0x20ce8f(0x1c5),{'value':_0x1b760b,'enumerable':![]});throw _0x20b326;}const _0x21e9d9=_0x43b699&&inspectAppRuleContent(_0x43b699[_0x20ce8f(0x190)])[_0x20ce8f(0x1c6)]===_0x56ee78[_0x20ce8f(0x1b7)][_0x20ce8f(0x1c6)],_0x3445a2=_0x43b699&&(_0x56ee78['beforeRecord']===null||_0x43b699[_0x20ce8f(0x1b3)]>_0x56ee78[_0x20ce8f(0x18c)]['version']);if(!_0x43b699||!_0x21e9d9||!_0x3445a2)throw appRuleError(_0x2b33d2?_0x20ce8f(0x1c2):_0x20ce8f(0x1ba),appRuleFileName(_0x56ee78['input']['type'])+_0x20ce8f(0x1af),_0x20ce8f(0x18d)+_0x56ee78[_0x20ce8f(0x192)]['type']+_0x20ce8f(0x194));const _0x3d6809=warningsFor(_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x19c)]);_0x2b33d2&&_0x3d6809[_0x20ce8f(0x1aa)](_0x20ce8f(0x1bc));const _0x1b780d=projectAppRule(_0x56ee78['input']['type'],_0x43b699);return{'ok':!![],'data':{'operation':_0x20ce8f(0x1b4),'selector':{'appCode':_0x2508fc[_0x20ce8f(0x1b9)],'scope':_0x20ce8f(0x1a9),'type':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]},'before':_0x56ee78[_0x20ce8f(0x1ae)],'after':_0x1b780d,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x3d6809,'verification':{'status':_0x20ce8f(0x195),'recoveredAfterUnknownResponse':_0x2b33d2,'expectedVersion':_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x19c)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x20ce8f(0x197)+_0x56ee78[_0x20ce8f(0x192)][_0x20ce8f(0x1ad)]+_0x20ce8f(0x1c4)}},'message':'Set\x20'+appRuleFileName(_0x56ee78['input']['type'])+'\x20for\x20'+_0x2508fc[_0x20ce8f(0x1b9)]};}};function a192_0x5a92(){const _0x408ce2=['\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.','verified','\x20version\x20changed\x20before\x20write.','rabetbase\x20rule\x20get\x20--type\x20','2400440pQZuLZ','107324QuzUGj','app_rule_verification_unavailable','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','expectedVersion','write','399816tTWMmP','/smartapi/knowledge-base/save','9negYvy','flag','The\x20set\x20request\x20was\x20sent,\x20but\x20','\x20could\x20not\x20be\x20verified.','Pass\x20a\x20UTF-8\x20Markdown\x20file.','4ohKCzF','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','file','rules','push',';\x20current\x20version\x20is\x20','app_rule_version_mismatch','type','before','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','POST','app_rule_file_required','string','version','set','planned','expected-version','replacement','app_rule_expected_version_invalid','appCode','app_rule_verification_failed','str','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','1925656DVSJsa','trim','number','--file\x20is\x20required.','1946940AwsZBF','app_rule_set_outcome_unknown','691128ygjjrM','\x20--format\x20compress','cause','contentHash','95BNGmCq','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','unconfigured','beforeRecord','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','110105HWgvRJ','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','content','cookie','input','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.'];a192_0x5a92=function(){return _0x408ce2;};return a192_0x5a92();}
@@ -1 +1 @@
1
- const a193_0x431c3a=a193_0x1242;function a193_0x53d5(){const _0x52c37a=['appCode','database','11842128ppMeDL','decode','33DczVui','message','content','digest','14050aZFASS','sha256:','1688582FpunpB','scope','rules','sha256','DATABASE.md','trim','app_rule_content_invalid','createTime','548290DBXUBQ','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','3610OypmSC','4204220ozCqng','utf8','updateTime','8166kHMjBC','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','string','app_rule_content_too_large','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','3573liDXJO','version','app_rule_file_required','type','isFile','byteLength','size','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','app_rule_file_invalid','RULES.md','database-analysis','app_rule_file_unreadable','Pass\x20a\x20UTF-8\x20Markdown\x20file.','662zScJaq','Cannot\x20access\x20app\x20rule\x20file:\x20','toLowerCase','16KNjohS'];a193_0x53d5=function(){return _0x52c37a;};return a193_0x53d5();}(function(_0x270501,_0x524224){const _0x103a87=a193_0x1242,_0x4e913c=_0x270501();while(!![]){try{const _0x37b357=-parseInt(_0x103a87(0x9a))/0x1+-parseInt(_0x103a87(0xbc))/0x2*(parseInt(_0x103a87(0xaf))/0x3)+parseInt(_0x103a87(0xa7))/0x4+-parseInt(_0x103a87(0xa6))/0x5*(parseInt(_0x103a87(0xaa))/0x6)+parseInt(_0x103a87(0x9c))/0x7*(-parseInt(_0x103a87(0xbf))/0x8)+parseInt(_0x103a87(0xc2))/0x9+parseInt(_0x103a87(0xa4))/0xa*(parseInt(_0x103a87(0xc4))/0xb);if(_0x37b357===_0x524224)break;else _0x4e913c['push'](_0x4e913c['shift']());}catch(_0x3a09d6){_0x4e913c['push'](_0x4e913c['shift']());}}}(a193_0x53d5,0xa0a31));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a193_0x431c3a(0x9e),a193_0x431c3a(0xc1)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':a193_0x431c3a(0xb8),'database':a193_0x431c3a(0xa0)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a193_0x431c3a(0xb9)};export function appRuleError(_0x1bb820,_0x49706e,_0x5e8d7b){return new CliError(_0x1bb820,0x1,_0x49706e,_0x5e8d7b);}export function readAppRuleType(_0x5dfd3d){const _0xf0142b=a193_0x431c3a,_0x12751f=_0x5dfd3d['str'](_0xf0142b(0xb2))['trim']()[_0xf0142b(0xbe)]();if(_0x12751f!=='rules'&&_0x12751f!=='database')throw appRuleError('app_rule_type_invalid',_0xf0142b(0xb6));return _0x12751f;}export function appRuleFileName(_0xd810aa){return APP_RULE_FILES[_0xd810aa];}function a193_0x1242(_0x53ef58,_0x4f0dce){_0x53ef58=_0x53ef58-0x9a;const _0x53d508=a193_0x53d5();let _0x1242e3=_0x53d508[_0x53ef58];return _0x1242e3;}export function appRuleContextScope(_0x19180b){return APP_RULE_CONTEXT_SCOPES[_0x19180b];}export function inspectAppRuleContent(_0x23629f){const _0x2b77a1=a193_0x431c3a,_0x523245=Buffer['from'](_0x23629f,_0x2b77a1(0xa8));return{'content':_0x23629f,'byteSize':_0x523245[_0x2b77a1(0xb4)],'contentHash':_0x2b77a1(0x9b)+createHash(_0x2b77a1(0x9f))['update'](_0x523245)[_0x2b77a1(0xc7)]('hex')};}export async function readAppRuleFile(_0x33ee9c){const _0x363e89=a193_0x431c3a,_0x3c339d=_0x33ee9c[_0x363e89(0xa1)]();if(!_0x3c339d)throw appRuleError(_0x363e89(0xb1),'--file\x20is\x20required.',_0x363e89(0xbb));const _0x345354=resolve(_0x3c339d);let _0xd801b5;try{_0xd801b5=await stat(_0x345354);}catch(_0x5c88db){throw appRuleError(_0x363e89(0xba),_0x363e89(0xbd)+_0x3c339d,_0x5c88db instanceof Error?_0x5c88db[_0x363e89(0xc5)]:String(_0x5c88db));}if(!_0xd801b5[_0x363e89(0xb3)]())throw appRuleError(_0x363e89(0xb7),_0x363e89(0xab)+_0x3c339d);if(_0xd801b5[_0x363e89(0xb5)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x363e89(0xad),_0x363e89(0xae));let _0x383ce9;try{_0x383ce9=await readFile(_0x345354);}catch(_0xc83e2e){throw appRuleError(_0x363e89(0xba),'Cannot\x20read\x20app\x20rule\x20file:\x20'+_0x3c339d,_0xc83e2e instanceof Error?_0xc83e2e[_0x363e89(0xc5)]:String(_0xc83e2e));}if(_0x383ce9[_0x363e89(0xb4)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x363e89(0xad),_0x363e89(0xae));let _0x410526;try{_0x410526=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x363e89(0xc3)](_0x383ce9);}catch{throw appRuleError(_0x363e89(0xa2),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x3c339d);}if(!_0x410526['trim']())throw appRuleError(_0x363e89(0xa2),'App\x20rule\x20file\x20is\x20blank:\x20'+_0x3c339d);return inspectAppRuleContent(_0x410526);}export function projectAppRule(_0x4822da,_0x36ec6b){const _0x4a619a=a193_0x431c3a;if(!_0x36ec6b)return{'type':_0x4822da,'fileName':appRuleFileName(_0x4822da),'contextScope':appRuleContextScope(_0x4822da),'enabled':![]};const _0x4af3e3=inspectAppRuleContent(_0x36ec6b[_0x4a619a(0xc6)]);return{'type':_0x4822da,'fileName':appRuleFileName(_0x4822da),'contextScope':appRuleContextScope(_0x4822da),'enabled':!![],'id':_0x36ec6b['id'],'scope':_0x36ec6b[_0x4a619a(0x9d)],'appCode':_0x36ec6b[_0x4a619a(0xc0)],'version':_0x36ec6b[_0x4a619a(0xb0)],'contentByteSize':_0x4af3e3['byteSize'],'contentHash':_0x4af3e3['contentHash'],..._0x36ec6b[_0x4a619a(0xa3)]!==undefined&&_0x36ec6b[_0x4a619a(0xa3)]!==null?{'createTime':_0x36ec6b[_0x4a619a(0xa3)]}:{},..._0x36ec6b['updateTime']!==undefined&&_0x36ec6b['updateTime']!==null?{'updateTime':_0x36ec6b[_0x4a619a(0xa9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':a193_0x431c3a(0xb2),'type':a193_0x431c3a(0xac),'required':!![],'description':a193_0x431c3a(0xa5),'enum':[...APP_RULE_TYPES]};
1
+ const a193_0x3fc4f6=a193_0x40df;(function(_0x37bee8,_0x49a7f0){const _0x20ba93=a193_0x40df,_0x99c238=_0x37bee8();while(!![]){try{const _0x4658c0=-parseInt(_0x20ba93(0xca))/0x1+parseInt(_0x20ba93(0xcf))/0x2+parseInt(_0x20ba93(0xc5))/0x3+-parseInt(_0x20ba93(0xe9))/0x4*(parseInt(_0x20ba93(0xdf))/0x5)+-parseInt(_0x20ba93(0xcb))/0x6*(parseInt(_0x20ba93(0xe0))/0x7)+-parseInt(_0x20ba93(0xe7))/0x8*(parseInt(_0x20ba93(0xec))/0x9)+parseInt(_0x20ba93(0xe1))/0xa;if(_0x4658c0===_0x49a7f0)break;else _0x99c238['push'](_0x99c238['shift']());}catch(_0xdefe76){_0x99c238['push'](_0x99c238['shift']());}}}(a193_0x2d78,0x4e950));import{createHash}from'node:crypto';import{readFile,stat}from'node:fs/promises';import{resolve}from'node:path';import{TextDecoder}from'node:util';function a193_0x40df(_0x3537e3,_0x1236f0){_0x3537e3=_0x3537e3-0xc3;const _0x2d785b=a193_0x2d78();let _0x40df5c=_0x2d785b[_0x3537e3];return _0x40df5c;}import{CliError}from'../../errors.js';export const APP_RULE_TYPES=[a193_0x3fc4f6(0xd4),a193_0x3fc4f6(0xe3)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;const APP_RULE_FILES={'rules':'RULES.md','database':a193_0x3fc4f6(0xd0)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a193_0x3fc4f6(0xd7)};export function appRuleError(_0x216bb2,_0x5cafe8,_0x4dd83b){return new CliError(_0x216bb2,0x1,_0x5cafe8,_0x4dd83b);}export function readAppRuleType(_0x1a5705){const _0xdfa556=a193_0x3fc4f6,_0x411316=_0x1a5705[_0xdfa556(0xea)](_0xdfa556(0xed))[_0xdfa556(0xe4)]()['toLowerCase']();if(_0x411316!==_0xdfa556(0xd4)&&_0x411316!==_0xdfa556(0xe3))throw appRuleError(_0xdfa556(0xd6),'--type\x20must\x20be\x20either\x20rules\x20or\x20database.');return _0x411316;}function a193_0x2d78(){const _0x3f1a47=['109026Xybefk','DATABASE.md','message','--file\x20is\x20required.','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','rules','update','app_rule_type_invalid','database-analysis','size','byteLength','Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','utf8','string','byteSize','sha256','45xBhNrz','4205299QPqMpa','14193570TPYMMI','contentHash','database','trim','App\x20rule\x20file\x20is\x20blank:\x20','from','24JoKjDs','scope','162076RVOBrR','str','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','470268nXubTP','type','Cannot\x20read\x20app\x20rule\x20file:\x20','createTime','882645ipHRkS','Cannot\x20access\x20app\x20rule\x20file:\x20','appCode','version','updateTime','324029fdqpXk','6ZEFfbn','app_rule_file_invalid','utf-8','app_rule_content_invalid'];a193_0x2d78=function(){return _0x3f1a47;};return a193_0x2d78();}export function appRuleFileName(_0xd0afa5){return APP_RULE_FILES[_0xd0afa5];}export function appRuleContextScope(_0x5a07ef){return APP_RULE_CONTEXT_SCOPES[_0x5a07ef];}export function inspectAppRuleContent(_0x345da7){const _0x2ed7c6=a193_0x3fc4f6,_0x87f795=Buffer[_0x2ed7c6(0xe6)](_0x345da7,_0x2ed7c6(0xdb));return{'content':_0x345da7,'byteSize':_0x87f795['byteLength'],'contentHash':'sha256:'+createHash(_0x2ed7c6(0xde))[_0x2ed7c6(0xd5)](_0x87f795)['digest']('hex')};}export async function readAppRuleFile(_0x3e11cd){const _0x1fcbad=a193_0x3fc4f6,_0x21dc63=_0x3e11cd[_0x1fcbad(0xe4)]();if(!_0x21dc63)throw appRuleError('app_rule_file_required',_0x1fcbad(0xd2),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x17ed0c=resolve(_0x21dc63);let _0x153a92;try{_0x153a92=await stat(_0x17ed0c);}catch(_0x4da2b7){throw appRuleError('app_rule_file_unreadable',_0x1fcbad(0xc6)+_0x21dc63,_0x4da2b7 instanceof Error?_0x4da2b7[_0x1fcbad(0xd1)]:String(_0x4da2b7));}if(!_0x153a92['isFile']())throw appRuleError(_0x1fcbad(0xcc),_0x1fcbad(0xd3)+_0x21dc63);if(_0x153a92[_0x1fcbad(0xd8)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x1fcbad(0xeb));let _0x273088;try{_0x273088=await readFile(_0x17ed0c);}catch(_0x18b9a2){throw appRuleError('app_rule_file_unreadable',_0x1fcbad(0xc3)+_0x21dc63,_0x18b9a2 instanceof Error?_0x18b9a2[_0x1fcbad(0xd1)]:String(_0x18b9a2));}if(_0x273088[_0x1fcbad(0xd9)]>MAX_APP_RULE_BYTES)throw appRuleError('app_rule_content_too_large',_0x1fcbad(0xeb));let _0x1232fa;try{_0x1232fa=new TextDecoder(_0x1fcbad(0xcd),{'fatal':!![],'ignoreBOM':!![]})['decode'](_0x273088);}catch{throw appRuleError(_0x1fcbad(0xce),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x21dc63);}if(!_0x1232fa[_0x1fcbad(0xe4)]())throw appRuleError(_0x1fcbad(0xce),_0x1fcbad(0xe5)+_0x21dc63);return inspectAppRuleContent(_0x1232fa);}export function projectAppRule(_0x159b80,_0x5f3b8d){const _0x3254f4=a193_0x3fc4f6;if(!_0x5f3b8d)return{'type':_0x159b80,'fileName':appRuleFileName(_0x159b80),'contextScope':appRuleContextScope(_0x159b80),'enabled':![]};const _0x156f94=inspectAppRuleContent(_0x5f3b8d['content']);return{'type':_0x159b80,'fileName':appRuleFileName(_0x159b80),'contextScope':appRuleContextScope(_0x159b80),'enabled':!![],'id':_0x5f3b8d['id'],'scope':_0x5f3b8d[_0x3254f4(0xe8)],'appCode':_0x5f3b8d[_0x3254f4(0xc7)],'version':_0x5f3b8d[_0x3254f4(0xc8)],'contentByteSize':_0x156f94[_0x3254f4(0xdd)],'contentHash':_0x156f94[_0x3254f4(0xe2)],..._0x5f3b8d['createTime']!==undefined&&_0x5f3b8d[_0x3254f4(0xc4)]!==null?{'createTime':_0x5f3b8d[_0x3254f4(0xc4)]}:{},..._0x5f3b8d[_0x3254f4(0xc9)]!==undefined&&_0x5f3b8d[_0x3254f4(0xc9)]!==null?{'updateTime':_0x5f3b8d[_0x3254f4(0xc9)]}:{}};}export const APP_RULE_TYPE_FLAG={'name':'type','type':a193_0x3fc4f6(0xdc),'required':!![],'description':a193_0x3fc4f6(0xda),'enum':[...APP_RULE_TYPES]};
@@ -1 +1 @@
1
- const a194_0x45b3fd=a194_0x4e54;(function(_0x4b5219,_0x46c36c){const _0x562d30=a194_0x4e54,_0xf69677=_0x4b5219();while(!![]){try{const _0x593e5e=-parseInt(_0x562d30(0x1d4))/0x1*(-parseInt(_0x562d30(0x1b5))/0x2)+-parseInt(_0x562d30(0x1c2))/0x3*(parseInt(_0x562d30(0x1b7))/0x4)+-parseInt(_0x562d30(0x1b9))/0x5*(-parseInt(_0x562d30(0x1be))/0x6)+-parseInt(_0x562d30(0x1ba))/0x7*(-parseInt(_0x562d30(0x1bf))/0x8)+parseInt(_0x562d30(0x1d0))/0x9*(parseInt(_0x562d30(0x1ca))/0xa)+-parseInt(_0x562d30(0x1c5))/0xb+-parseInt(_0x562d30(0x1c7))/0xc;if(_0x593e5e===_0x46c36c)break;else _0xf69677['push'](_0xf69677['shift']());}catch(_0xac92fd){_0xf69677['push'](_0xf69677['shift']());}}}(a194_0x1176,0x36a4e));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';function a194_0x1176(){const _0x2c1111=['\x20run\x20preview\x20--watch','package.json','65060BAngjW','log','\x20run\x20start','script','vite\x20preview\x20exited\x20with\x20code\x20','join','72nVHyaP','utf-8','Available:\x20','(none)','1kWObGy','args','bun.lock','\x20run\x20','Enable\x20watch\x20mode\x20for\x20preview','pnpm','\x20run\x20build','vite','Run\x20a\x20package.json\x20script','belowMinimum','keys','error','node_modules','\x20exited\x20with\x20code\x20','\x0a\x20\x20Usage:\x20','preview','boolean','watch','\x20\x20EXAMPLES','No\x20package.json\x20found\x20in\x20current\x20directory.','inherit','length','all','slice','has','parse','Script\x20\x22','run','\x20\x20\x20\x20','push','scripts','309476emRLGd','.bin','164568voHRaO','close','1189855osPbNs','7aktSbO','--watch','pnpm-lock.yaml','npm','6BvOHjX','3114152OsmbdR','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20preview','3JoKraD','validation','needsUpgrade','3871417BZxMlY','bool','2605380TjacUY'];a194_0x1176=function(){return _0x2c1111;};return a194_0x1176();}import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';function a194_0x4e54(_0x4de431,_0x5d26c2){_0x4de431=_0x4de431-0x1a7;const _0x1176ed=a194_0x1176();let _0x4e5406=_0x1176ed[_0x4de431];return _0x4e5406;}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start','dev']);function readPackageScripts(_0x4ce342){const _0x310afc=a194_0x4e54,_0x4405b4=resolve(_0x4ce342,_0x310afc(0x1c9));if(!existsSync(_0x4405b4))return null;try{const _0x573a10=JSON[_0x310afc(0x1af)](readFileSync(_0x4405b4,_0x310afc(0x1d1)));return _0x573a10[_0x310afc(0x1b4)]??{};}catch{return null;}}function detectPackageManager(_0x2a15bd){const _0x3a817d=a194_0x4e54;if(existsSync(resolve(_0x2a15bd,'bun.lockb'))||existsSync(resolve(_0x2a15bd,_0x3a817d(0x1d6))))return'bun';if(existsSync(resolve(_0x2a15bd,_0x3a817d(0x1bc))))return _0x3a817d(0x1d9);if(existsSync(resolve(_0x2a15bd,'yarn.lock')))return'yarn';return _0x3a817d(0x1bd);}async function versionCheck(_0x20bf49){const _0xbab53c=a194_0x4e54,_0x57e6dd=await checkCliVersion();(_0x57e6dd[_0xbab53c(0x1c4)]||_0x57e6dd[_0xbab53c(0x1dd)])&&(printCliUpgradeWarning(_0x57e6dd),assertCliVersionSupported(_0x57e6dd));const _0x264ff0=await checkSdkVersion(_0x20bf49);if(_0x264ff0[_0xbab53c(0x1c4)])printSdkUpgradeWarning(_0x264ff0);}function spawnScript(_0x1a4d1c,_0x42e407,_0x741752,_0x25bc8c){return new Promise((_0x56b00f,_0x3621f1)=>{const _0x5f1a34=a194_0x4e54,_0x1e0460=[_0x5f1a34(0x1b1),_0x42e407,..._0x741752],_0x5aa81a=spawn(_0x1a4d1c,_0x1e0460,{'cwd':_0x25bc8c,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x25bc8c,_0x5f1a34(0x1e0),_0x5f1a34(0x1b6))+delimiter+process.env.PATH}});_0x5aa81a['on'](_0x5f1a34(0x1b8),_0xcbb4ac=>{const _0x4aa4d4=_0x5f1a34;if(_0xcbb4ac===0x0||_0xcbb4ac===null)_0x56b00f();else _0x3621f1(new Error(_0x1a4d1c+_0x4aa4d4(0x1d7)+_0x42e407+_0x4aa4d4(0x1e1)+_0xcbb4ac));}),_0x5aa81a['on'](_0x5f1a34(0x1df),_0x3621f1);});}function spawnViteBuildWatch(_0x3c795d){return new Promise((_0x12455f,_0x2efede)=>{const _0x2c434d=a194_0x4e54,_0x52d0ee=spawn(_0x2c434d(0x1db),['build',_0x2c434d(0x1bb)],{'cwd':_0x3c795d,'stdio':_0x2c434d(0x1aa),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3c795d,_0x2c434d(0x1e0),_0x2c434d(0x1b6))+delimiter+process.env.PATH}});_0x52d0ee['on'](_0x2c434d(0x1b8),_0x4548c2=>{const _0x59c430=_0x2c434d;if(_0x4548c2===0x0||_0x4548c2===null)_0x12455f();else _0x2efede(new Error(_0x59c430(0x1c0)+_0x4548c2));}),_0x52d0ee['on'](_0x2c434d(0x1df),_0x2efede);});}function spawnVitePreview(_0x209d03){return new Promise((_0xe40bfb,_0x920ff7)=>{const _0x293b9f=a194_0x4e54,_0x4dcc1e=spawn(_0x293b9f(0x1db),[_0x293b9f(0x1e3)],{'cwd':_0x209d03,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x209d03,_0x293b9f(0x1e0),_0x293b9f(0x1b6))+delimiter+process.env.PATH}});_0x4dcc1e['on']('close',_0x4f4579=>{const _0x1e8fe3=_0x293b9f;if(_0x4f4579===0x0||_0x4f4579===null)_0xe40bfb();else _0x920ff7(new Error(_0x1e8fe3(0x1ce)+_0x4f4579));}),_0x4dcc1e['on'](_0x293b9f(0x1df),_0x920ff7);});}const runFlags=[{'name':'watch','type':a194_0x45b3fd(0x1e4),'description':a194_0x45b3fd(0x1d8),'default':![]}];export const runDefinition={'service':'run','command':a194_0x45b3fd(0x1b1),'description':a194_0x45b3fd(0x1dc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a194_0x45b3fd(0x1cd),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x25eb61=a194_0x45b3fd,_0x399d0f=[];return _0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1a8)),_0x399d0f['push'](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1cc)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1da)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1c1)),_0x399d0f[_0x25eb61(0x1b3)](_0x25eb61(0x1b2)+CLI_BIN_NAME+_0x25eb61(0x1c8)),_0x399d0f[_0x25eb61(0x1cf)]('\x0a');},async 'execute'(_0x5ed4d3){const _0x15099a=a194_0x45b3fd,_0x314bbd=process['cwd'](),_0x3a312f=_0x5ed4d3[_0x15099a(0x1d5)][0x0],_0x52e90f=_0x5ed4d3[_0x15099a(0x1d5)][_0x15099a(0x1ad)](0x1),_0x44bae5=readPackageScripts(_0x314bbd);if(!_0x44bae5)throw CliErrors[_0x15099a(0x1c3)](_0x15099a(0x1a9));if(!_0x3a312f){const _0x5ca5ab=Object[_0x15099a(0x1de)](_0x44bae5);if(_0x5ca5ab[_0x15099a(0x1ab)]===0x0)console[_0x15099a(0x1cb)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x15099a(0x1cb)]('\x0a\x20\x20Available\x20scripts:\x0a');for(const _0x5bdd5a of _0x5ca5ab){console[_0x15099a(0x1cb)](_0x15099a(0x1b2)+_0x5bdd5a);}console[_0x15099a(0x1cb)](_0x15099a(0x1e2)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x44bae5[_0x3a312f])throw CliErrors[_0x15099a(0x1c3)](_0x15099a(0x1b0)+_0x3a312f+'\x22\x20not\x20found\x20in\x20package.json.',_0x15099a(0x1d2)+(Object['keys'](_0x44bae5)[_0x15099a(0x1cf)](',\x20')||_0x15099a(0x1d3)));const _0x1366f1=detectPackageManager(_0x314bbd);VERSION_CHECK_SCRIPTS[_0x15099a(0x1ae)](_0x3a312f)&&await versionCheck(_0x314bbd);if(_0x3a312f===_0x15099a(0x1e3)&&_0x5ed4d3[_0x15099a(0x1c6)](_0x15099a(0x1a7)))return await Promise[_0x15099a(0x1ac)]([spawnViteBuildWatch(_0x314bbd),spawnVitePreview(_0x314bbd)]),{'ok':!![]};return await spawnScript(_0x1366f1,_0x3a312f,_0x52e90f,_0x314bbd),{'ok':!![]};}};
1
+ const a194_0x24aee1=a194_0x4077;(function(_0x24e076,_0x496871){const _0x2b0663=a194_0x4077,_0x24014e=_0x24e076();while(!![]){try{const _0x16818a=-parseInt(_0x2b0663(0x146))/0x1*(-parseInt(_0x2b0663(0x13e))/0x2)+parseInt(_0x2b0663(0x169))/0x3*(-parseInt(_0x2b0663(0x155))/0x4)+parseInt(_0x2b0663(0x13d))/0x5*(-parseInt(_0x2b0663(0x147))/0x6)+-parseInt(_0x2b0663(0x15e))/0x7+parseInt(_0x2b0663(0x145))/0x8+parseInt(_0x2b0663(0x166))/0x9*(parseInt(_0x2b0663(0x16e))/0xa)+-parseInt(_0x2b0663(0x134))/0xb;if(_0x16818a===_0x496871)break;else _0x24014e['push'](_0x24014e['shift']());}catch(_0x4d2572){_0x24014e['push'](_0x24014e['shift']());}}}(a194_0x24b6,0xdb20b));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';function a194_0x24b6(){const _0x2733b8=['\x20run\x20<script>\x0a','.bin','\x20exited\x20with\x20code\x20','\x20run\x20preview\x20--watch','error','start','push','171uskNxH','inherit','script','3EAJrPp','vite','Script\x20\x22','validation','\x22\x20not\x20found\x20in\x20package.json.','874470EpqcsZ','parse','bool','watch','log','dev','\x20run\x20preview','981530mCBwKM','cwd','\x20\x20\x20\x20','keys','node_modules','build','package.json','run','bun.lock','6795qgVpWD','302EKygKx','\x20run\x20build','\x20run\x20','Script\x20name\x20defined\x20in\x20package.json','join','--watch','preview','3780824yjhHnS','1093DKjcBn','432wsMdiF','args','No\x20scripts\x20defined\x20in\x20package.json.','close','\x20\x20EXAMPLES','\x0a\x20\x20Usage:\x20','needsUpgrade','Enable\x20watch\x20mode\x20for\x20preview','boolean','pnpm','Run\x20a\x20package.json\x20script','slice','utf-8','vite\x20preview\x20exited\x20with\x20code\x20','937636AUKkIu','has','yarn.lock','npm','No\x20package.json\x20found\x20in\x20current\x20directory.','pnpm-lock.yaml','write','\x0a\x20\x20Available\x20scripts:\x0a','length','6860735ukuQem'];a194_0x24b6=function(){return _0x2733b8;};return a194_0x24b6();}function a194_0x4077(_0x2c1416,_0x4a639c){_0x2c1416=_0x2c1416-0x130;const _0x24b6be=a194_0x24b6();let _0x40776b=_0x24b6be[_0x2c1416];return _0x40776b;}import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a194_0x24aee1(0x164),a194_0x24aee1(0x132)]);function readPackageScripts(_0x2eb98d){const _0x1df6b1=a194_0x24aee1,_0x39c1b3=resolve(_0x2eb98d,_0x1df6b1(0x13a));if(!existsSync(_0x39c1b3))return null;try{const _0x3235ca=JSON[_0x1df6b1(0x16f)](readFileSync(_0x39c1b3,_0x1df6b1(0x153)));return _0x3235ca['scripts']??{};}catch{return null;}}function detectPackageManager(_0x4002c2){const _0x1aa2ba=a194_0x24aee1;if(existsSync(resolve(_0x4002c2,'bun.lockb'))||existsSync(resolve(_0x4002c2,_0x1aa2ba(0x13c))))return'bun';if(existsSync(resolve(_0x4002c2,_0x1aa2ba(0x15a))))return _0x1aa2ba(0x150);if(existsSync(resolve(_0x4002c2,_0x1aa2ba(0x157))))return'yarn';return _0x1aa2ba(0x158);}async function versionCheck(_0x383502){const _0x314b78=a194_0x24aee1,_0x3a6b27=await checkCliVersion();(_0x3a6b27[_0x314b78(0x14d)]||_0x3a6b27['belowMinimum'])&&(printCliUpgradeWarning(_0x3a6b27),assertCliVersionSupported(_0x3a6b27));const _0x40b6a5=await checkSdkVersion(_0x383502);if(_0x40b6a5['needsUpgrade'])printSdkUpgradeWarning(_0x40b6a5);}function spawnScript(_0x34699a,_0x4d87c7,_0x54f116,_0x3489d8){return new Promise((_0x4b473b,_0xf4ec99)=>{const _0x53cd22=a194_0x4077,_0x2e996c=[_0x53cd22(0x13b),_0x4d87c7,..._0x54f116],_0x50f90b=spawn(_0x34699a,_0x2e996c,{'cwd':_0x3489d8,'stdio':_0x53cd22(0x167),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3489d8,_0x53cd22(0x138),_0x53cd22(0x160))+delimiter+process.env.PATH}});_0x50f90b['on'](_0x53cd22(0x14a),_0x5b0a09=>{const _0x24727e=_0x53cd22;if(_0x5b0a09===0x0||_0x5b0a09===null)_0x4b473b();else _0xf4ec99(new Error(_0x34699a+_0x24727e(0x140)+_0x4d87c7+_0x24727e(0x161)+_0x5b0a09));}),_0x50f90b['on'](_0x53cd22(0x163),_0xf4ec99);});}function spawnViteBuildWatch(_0x1cd3fb){return new Promise((_0x1ed3b5,_0x3e358e)=>{const _0x418892=a194_0x4077,_0x4961d8=spawn(_0x418892(0x16a),[_0x418892(0x139),_0x418892(0x143)],{'cwd':_0x1cd3fb,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1cd3fb,_0x418892(0x138),_0x418892(0x160))+delimiter+process.env.PATH}});_0x4961d8['on'](_0x418892(0x14a),_0x32e3c6=>{if(_0x32e3c6===0x0||_0x32e3c6===null)_0x1ed3b5();else _0x3e358e(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x32e3c6));}),_0x4961d8['on']('error',_0x3e358e);});}function spawnVitePreview(_0x2fab76){return new Promise((_0x4b3e19,_0x956e74)=>{const _0x335d23=a194_0x4077,_0x58f28e=spawn(_0x335d23(0x16a),[_0x335d23(0x144)],{'cwd':_0x2fab76,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x2fab76,_0x335d23(0x138),_0x335d23(0x160))+delimiter+process.env.PATH}});_0x58f28e['on'](_0x335d23(0x14a),_0x26a5da=>{const _0x328637=_0x335d23;if(_0x26a5da===0x0||_0x26a5da===null)_0x4b3e19();else _0x956e74(new Error(_0x328637(0x154)+_0x26a5da));}),_0x58f28e['on'](_0x335d23(0x163),_0x956e74);});}const runFlags=[{'name':a194_0x24aee1(0x130),'type':a194_0x24aee1(0x14f),'description':a194_0x24aee1(0x14e),'default':![]}];export const runDefinition={'service':'run','command':a194_0x24aee1(0x13b),'description':a194_0x24aee1(0x151),'risk':a194_0x24aee1(0x15b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a194_0x24aee1(0x168),'description':a194_0x24aee1(0x141),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4d104d=a194_0x24aee1,_0xa36549=[];return _0xa36549[_0x4d104d(0x165)](_0x4d104d(0x14b)),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+'\x20run\x20start'),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x13f)),_0xa36549[_0x4d104d(0x165)](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x133)),_0xa36549['push'](_0x4d104d(0x136)+CLI_BIN_NAME+_0x4d104d(0x162)),_0xa36549[_0x4d104d(0x142)]('\x0a');},async 'execute'(_0x51d8b4){const _0xddc785=a194_0x24aee1,_0x1ad13c=process[_0xddc785(0x135)](),_0x10a70e=_0x51d8b4['args'][0x0],_0x16c4cb=_0x51d8b4[_0xddc785(0x148)][_0xddc785(0x152)](0x1),_0x3a9839=readPackageScripts(_0x1ad13c);if(!_0x3a9839)throw CliErrors[_0xddc785(0x16c)](_0xddc785(0x159));if(!_0x10a70e){const _0x18322a=Object['keys'](_0x3a9839);if(_0x18322a[_0xddc785(0x15d)]===0x0)console['log'](_0xddc785(0x149));else{console[_0xddc785(0x131)](_0xddc785(0x15c));for(const _0x2b2dcd of _0x18322a){console[_0xddc785(0x131)]('\x20\x20\x20\x20'+_0x2b2dcd);}console[_0xddc785(0x131)](_0xddc785(0x14c)+CLI_BIN_NAME+_0xddc785(0x15f));}return{'ok':!![]};}if(!_0x3a9839[_0x10a70e])throw CliErrors['validation'](_0xddc785(0x16b)+_0x10a70e+_0xddc785(0x16d),'Available:\x20'+(Object[_0xddc785(0x137)](_0x3a9839)[_0xddc785(0x142)](',\x20')||'(none)'));const _0x411536=detectPackageManager(_0x1ad13c);VERSION_CHECK_SCRIPTS[_0xddc785(0x156)](_0x10a70e)&&await versionCheck(_0x1ad13c);if(_0x10a70e===_0xddc785(0x144)&&_0x51d8b4[_0xddc785(0x170)](_0xddc785(0x130)))return await Promise['all']([spawnViteBuildWatch(_0x1ad13c),spawnVitePreview(_0x1ad13c)]),{'ok':!![]};return await spawnScript(_0x411536,_0x10a70e,_0x16c4cb,_0x1ad13c),{'ok':!![]};}};
@@ -1 +1 @@
1
- const a195_0x49c3b6=a195_0x4592;function a195_0x53d3(){const _0xe018f6=['read','35ZNloHn','2836134hRCSFg','6277180tDKzOC','17905MCrqWG','220OXnBWJ','506565AOpjul','1056icgpbS','158qkmCGe','export','2954392CpzhPM','100614WCiLau'];a195_0x53d3=function(){return _0xe018f6;};return a195_0x53d3();}function a195_0x4592(_0x3fffd1,_0x43d7e0){_0x3fffd1=_0x3fffd1-0x1a3;const _0x53d335=a195_0x53d3();let _0x4592e6=_0x53d335[_0x3fffd1];return _0x4592e6;}(function(_0x2047b7,_0x301dc9){const _0x4abdcb=a195_0x4592,_0x45447b=_0x2047b7();while(!![]){try{const _0x177ff1=-parseInt(_0x4abdcb(0x1a4))/0x1*(-parseInt(_0x4abdcb(0x1a3))/0x2)+parseInt(_0x4abdcb(0x1ae))/0x3+-parseInt(_0x4abdcb(0x1ad))/0x4*(parseInt(_0x4abdcb(0x1ac))/0x5)+parseInt(_0x4abdcb(0x1a7))/0x6*(parseInt(_0x4abdcb(0x1a9))/0x7)+parseInt(_0x4abdcb(0x1a6))/0x8+parseInt(_0x4abdcb(0x1aa))/0x9+-parseInt(_0x4abdcb(0x1ab))/0xa;if(_0x177ff1===_0x301dc9)break;else _0x45447b['push'](_0x45447b['shift']());}catch(_0x4fc130){_0x45447b['push'](_0x45447b['shift']());}}}(a195_0x53d3,0x2fd24));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x35489b){const _0x1568b0=await buildSchemaPayload();return{'ok':!![],'data':_0x1568b0};}export const schemaDefinition={'service':'schema','command':a195_0x49c3b6(0x1a5),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a195_0x49c3b6(0x1a8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
1
+ function a195_0x4af5(_0x21ebde,_0x3ae9b5){_0x21ebde=_0x21ebde-0x12f;const _0x2ee017=a195_0x2ee0();let _0x4af5a3=_0x2ee017[_0x21ebde];return _0x4af5a3;}const a195_0x31ffb0=a195_0x4af5;(function(_0x389947,_0x3b374a){const _0x56314e=a195_0x4af5,_0x592989=_0x389947();while(!![]){try{const _0x12993b=-parseInt(_0x56314e(0x134))/0x1*(parseInt(_0x56314e(0x131))/0x2)+-parseInt(_0x56314e(0x13b))/0x3+parseInt(_0x56314e(0x13c))/0x4+-parseInt(_0x56314e(0x13a))/0x5*(parseInt(_0x56314e(0x139))/0x6)+parseInt(_0x56314e(0x138))/0x7*(parseInt(_0x56314e(0x135))/0x8)+parseInt(_0x56314e(0x137))/0x9+parseInt(_0x56314e(0x136))/0xa*(parseInt(_0x56314e(0x130))/0xb);if(_0x12993b===_0x3b374a)break;else _0x592989['push'](_0x592989['shift']());}catch(_0x5e217e){_0x592989['push'](_0x592989['shift']());}}}(a195_0x2ee0,0x2053c));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x22a868){const _0xba9cae=await buildSchemaPayload();return{'ok':!![],'data':_0xba9cae};}function a195_0x2ee0(){const _0x8b5a85=['2GIFMvq','read','export','256471kCQoRe','2012440zRBDgV','20rlgiYz','1136619tTxjLO','7hmrgQX','6GRUDvx','529420gBglEG','248187qUUgdE','354272IVbBXM','schema','json','Export\x20machine-readable\x20command\x20schema\x20(JSON)','610951zehWth'];a195_0x2ee0=function(){return _0x8b5a85;};return a195_0x2ee0();}export const schemaDefinition={'service':a195_0x31ffb0(0x13d),'command':a195_0x31ffb0(0x133),'description':a195_0x31ffb0(0x12f),'risk':a195_0x31ffb0(0x132),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a195_0x31ffb0(0x13e),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a196_0x492311=a196_0x3fb6;(function(_0x54e859,_0x417d5f){const _0xcdc7d=a196_0x3fb6,_0x3512c5=_0x54e859();while(!![]){try{const _0x324cf6=-parseInt(_0xcdc7d(0x1f7))/0x1*(-parseInt(_0xcdc7d(0x1dc))/0x2)+parseInt(_0xcdc7d(0x1e0))/0x3+-parseInt(_0xcdc7d(0x1fa))/0x4*(parseInt(_0xcdc7d(0x1da))/0x5)+parseInt(_0xcdc7d(0x1e4))/0x6*(parseInt(_0xcdc7d(0x1ec))/0x7)+parseInt(_0xcdc7d(0x1e6))/0x8+parseInt(_0xcdc7d(0x206))/0x9+-parseInt(_0xcdc7d(0x20c))/0xa;if(_0x324cf6===_0x417d5f)break;else _0x3512c5['push'](_0x3512c5['shift']());}catch(_0x335b9b){_0x3512c5['push'](_0x3512c5['shift']());}}}(a196_0x2239,0xa603a));function a196_0x3fb6(_0x5221fb,_0x3e4bef){_0x5221fb=_0x5221fb-0x1c8;const _0x2239c1=a196_0x2239();let _0x3fb6b4=_0x2239c1[_0x5221fb];return _0x3fb6b4;}import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x4b66fe){const _0x31bdd6=a196_0x3fb6;if(_0x4b66fe===_0x31bdd6(0x1ca))return[_0x31bdd6(0x1d0),_0x31bdd6(0x1f2),_0x31bdd6(0x1d6),''][_0x31bdd6(0x1d7)]('\x0a');return[_0x31bdd6(0x1d1),''][_0x31bdd6(0x1d7)]('\x0a');}function a196_0x2239(){const _0x2dc464=['isFinite','sqls','2703012PulBiV','nonInteractive','appCode','Select\x20the\x20local\x20SQL\x20mode:','420498dYvgwj','sql','2355960wPGrWm','create','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','db-id','/smartapi/custom/saveUserCustomSql','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','21cJJPHE','catch','sqlCode','dbName','File\x20already\x20exists:\x20','string','\x20\x20SELECT\x201\x20AS\x20id','POST','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','length','sqlRootDir','173041hdoVEb','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','888MrpCnH','number','name','new','parse','str','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','flag','Created\x20SQL\x20query\x20','SQL\x20query\x20display\x20name','trim','Invalid\x20database\x20selection\x20payload:\x20','11743317itYTKc','<server-generated-sqlCode>','description','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','mode','flagMissing','10776240cZNibi','stringify','✎\x20Enter\x20dbId\x20manually','dbId','mybatisXml','isInteger','Target\x20database\x20ID','toISOString','lockFilePath','validation','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','SELECT\x201\x20AS\x20id;','SQL\x20name\x20cannot\x20be\x20empty','Local\x20SQL\x20file\x20mode','sqlName','write','</select>','join','__manual__','dbId\x20must\x20be\x20a\x20positive\x20integer','25360yhtHHf','map','2IpgGkk','dbId\x20cannot\x20be\x20empty'];a196_0x2239=function(){return _0x2dc464;};return a196_0x2239();}export const sqlCreate={'service':a196_0x492311(0x1e5),'command':a196_0x492311(0x1e7),'description':a196_0x492311(0x1f8),'risk':a196_0x492311(0x1d5),'flags':[{'name':a196_0x492311(0x1fc),'type':a196_0x492311(0x1f1),'description':a196_0x492311(0x203)},{'name':a196_0x492311(0x1e9),'type':a196_0x492311(0x1fb),'description':a196_0x492311(0x1cc)},{'name':'mode','type':a196_0x492311(0x1f1),'enum':[a196_0x492311(0x1e5),a196_0x492311(0x1ca)],'description':a196_0x492311(0x1d3)}],async 'validate'(_0x2ca04c){const _0x125b3c=a196_0x492311;if(!_0x2ca04c['nonInteractive'])return;if(!_0x2ca04c[_0x125b3c(0x1ff)](_0x125b3c(0x1fc))['trim']())throw CliErrors['flagMissing'](_0x125b3c(0x1fc),_0x125b3c(0x1eb));const _0x3ebf42=resolveProvidedDbId(_0x2ca04c);if(typeof _0x3ebf42!==_0x125b3c(0x1fb)||!Number[_0x125b3c(0x1de)](_0x3ebf42)||_0x3ebf42<=0x0)throw CliErrors[_0x125b3c(0x20b)]('db-id','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');if(!_0x2ca04c[_0x125b3c(0x1ff)](_0x125b3c(0x20a))[_0x125b3c(0x204)]())throw CliErrors['flagMissing'](_0x125b3c(0x20a),_0x125b3c(0x200));},async 'dryRun'(_0x27609b){const _0x201000=a196_0x492311,_0x27c848=loadSqlProjectConfig(_0x27609b[_0x201000(0x1e2)]),{sqlName:_0x3e958f,dbId:_0xfdf021,dbName:_0xd788df,mode:_0x17760f}=await resolveSqlNewInputs(_0x27609b),_0x4192aa=buildSqlRelativePath(_0x201000(0x207),_0x3e958f,_0xd788df,_0x17760f,_0xfdf021),_0x4402f5=_0x27c848[_0x201000(0x1f6)]+'/'+_0x4192aa;return{'method':_0x201000(0x1f3),'url':_0x201000(0x1ea),'body':{'appCode':_0x27609b['appCode'],'sqlName':_0x3e958f,'dbId':_0xfdf021,'mode':_0x17760f,'localPath':_0x4402f5},'description':_0x201000(0x1f9)+_0x27c848[_0x201000(0x1f6)]};},async 'execute'(_0x3658f3){const _0x4506d3=a196_0x492311,_0x3db16a=loadSqlProjectConfig(_0x3658f3[_0x4506d3(0x1e2)]),{sqlName:_0x204bc9,dbId:_0x227a8a,dbName:_0x399434,mode:_0x54604f}=await resolveSqlNewInputs(_0x3658f3),_0x2e4bfe=generateSqlTemplate(_0x54604f),_0xbad0a8=await createSqlQuery({'appCode':_0x3658f3['appCode'],'sqlName':_0x204bc9,'dbId':_0x227a8a,'sqlContent':_0x2e4bfe}),_0x58e73c=ensureRemoteSqlContent(_0xbad0a8),_0x2f31c4=_0x399434||await getDbName(_0x3658f3[_0x4506d3(0x1e2)],_0x227a8a)[_0x4506d3(0x1ed)](()=>undefined),_0x32f1f2=buildSqlRelativePath(_0xbad0a8['sqlCode'],_0xbad0a8['sqlName'],_0x2f31c4,_0x54604f,_0x227a8a),_0x760d7a=_0x3db16a[_0x4506d3(0x1f6)]+'/'+_0x32f1f2,_0x1f8dd9=buildLocalSqlFileContent({'sqlCode':_0xbad0a8[_0x4506d3(0x1ee)],'sqlName':_0xbad0a8[_0x4506d3(0x1d4)],'dbId':_0xbad0a8[_0x4506d3(0x1c9)]},_0x58e73c,{'dbName':_0x2f31c4,'mode':_0x54604f,'syncedAt':new Date()[_0x4506d3(0x1cd)](),'description':_0xbad0a8[_0x4506d3(0x208)]});if(await fileExists(_0x760d7a))throw CliErrors[_0x4506d3(0x1cf)](_0x4506d3(0x1f0)+_0x760d7a);await ensureParentDirectory(_0x760d7a),await writeFile(_0x760d7a,_0x1f8dd9,'utf8');const _0x283603=await readSqlLockFile(_0x3db16a[_0x4506d3(0x1ce)]),{lockData:_0x3546f7,appLock:_0xb719ea}=ensureSqlLockScope(_0x283603??createEmptySqlLock(),_0x3db16a[_0x4506d3(0x1e2)],_0x3db16a['sqlRoot'],_0x4506d3(0x1fd));return _0xb719ea[_0x4506d3(0x1df)][_0xbad0a8[_0x4506d3(0x1ee)]]={...buildSqlLockEntry(_0xbad0a8,_0x58e73c,computeSqlContentHash(_0x1f8dd9),{'dbName':_0x2f31c4}),'path':_0x32f1f2,'mode':_0x54604f},_0xb719ea['lastSync']=new Date()[_0x4506d3(0x1cd)](),await writeSqlLockFile(_0x3db16a[_0x4506d3(0x1ce)],_0x3546f7),{'ok':!![],'data':{'id':_0xbad0a8['id'],'sqlCode':_0xbad0a8[_0x4506d3(0x1ee)],'sqlName':_0xbad0a8[_0x4506d3(0x1d4)],'dbId':_0xbad0a8[_0x4506d3(0x1c9)],'path':_0x760d7a,'mode':_0x54604f},'message':_0x4506d3(0x202)+_0xbad0a8['sqlCode']};}};async function resolveSqlNewInputs(_0x223e0a){const _0x17d22b=await resolveSqlNameInput(_0x223e0a),{dbId:_0x4cb50a,dbName:_0x13ad82}=await resolveDbSelection(_0x223e0a),_0x25eb53=await resolveSqlModeInput(_0x223e0a);return{'sqlName':_0x17d22b,'dbId':_0x4cb50a,'dbName':_0x13ad82,'mode':_0x25eb53};}async function resolveSqlNameInput(_0x1ae09c){const _0x5388de=a196_0x492311,_0x552cf1=_0x1ae09c[_0x5388de(0x1ff)](_0x5388de(0x1fc))[_0x5388de(0x204)]();if(_0x552cf1)return _0x552cf1;if(_0x1ae09c[_0x5388de(0x1e1)])throw CliErrors[_0x5388de(0x20b)](_0x5388de(0x1fc),_0x5388de(0x1eb));return(await input({'message':'SQL\x20name:','validate':_0x2fef42=>_0x2fef42[_0x5388de(0x204)]()?!![]:_0x5388de(0x1d2)}))[_0x5388de(0x204)]();}async function resolveDbSelection(_0x2616bf){const _0x3913f5=a196_0x492311,_0x4c4573=resolveProvidedDbId(_0x2616bf);if(typeof _0x4c4573===_0x3913f5(0x1fb)&&Number[_0x3913f5(0x1de)](_0x4c4573)&&_0x4c4573>0x0)return{'dbId':_0x4c4573,'dbName':await getDbName(_0x2616bf[_0x3913f5(0x1e2)],_0x4c4573)[_0x3913f5(0x1ed)](()=>undefined)};if(_0x2616bf[_0x3913f5(0x1e1)])throw CliErrors['flagMissing'](_0x3913f5(0x1e9),_0x3913f5(0x209));const _0x4356c3=await listDatabases(_0x2616bf[_0x3913f5(0x1e2)])[_0x3913f5(0x1ed)](()=>[]);if(_0x4356c3[_0x3913f5(0x1f5)]===0x1)return{'dbId':_0x4356c3[0x0][_0x3913f5(0x1c9)],'dbName':_0x4356c3[0x0][_0x3913f5(0x1ef)]};if(_0x4356c3[_0x3913f5(0x1f5)]>0x1){const _0x5c30d6=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x4356c3[_0x3913f5(0x1db)](_0x37290e=>({'name':_0x37290e[_0x3913f5(0x1ef)]+'\x20('+_0x37290e[_0x3913f5(0x1c9)]+')','value':serializeDbSelection(_0x37290e)})),{'name':_0x3913f5(0x1c8),'value':_0x3913f5(0x1d8)}]});if(_0x5c30d6!==_0x3913f5(0x1d8))return deserializeDbSelection(_0x5c30d6);}const _0x4f50dc=await input({'message':'Target\x20database\x20dbId:','validate':_0x133d92=>{const _0x187203=_0x3913f5,_0x12dd77=_0x133d92['trim']();if(!_0x12dd77)return _0x187203(0x1dd);const _0x398761=Number(_0x12dd77);if(!Number[_0x187203(0x1cb)](_0x398761)||_0x398761<=0x0)return _0x187203(0x1d9);return!![];}});return{'dbId':Number(_0x4f50dc[_0x3913f5(0x204)]())};}async function resolveSqlModeInput(_0x39415c){const _0x5b7042=a196_0x492311,_0x41b34f=_0x39415c[_0x5b7042(0x1ff)]('mode')[_0x5b7042(0x204)]();if(_0x41b34f===_0x5b7042(0x1e5)||_0x41b34f===_0x5b7042(0x1ca))return _0x41b34f;if(_0x39415c[_0x5b7042(0x1e1)])throw CliErrors[_0x5b7042(0x20b)](_0x5b7042(0x20a),_0x5b7042(0x200));return await select({'message':_0x5b7042(0x1e3),'choices':[{'name':'Plain\x20SQL\x20(sql)','value':_0x5b7042(0x1e5),'description':_0x5b7042(0x1e8)},{'name':'MyBatis\x20XML\x20(mybatisXml)','value':_0x5b7042(0x1ca),'description':_0x5b7042(0x1f4)}]});}function serializeDbSelection(_0x2d6659){const _0x5eaa18=a196_0x492311;return JSON[_0x5eaa18(0x20d)]({'dbId':_0x2d6659['dbId'],'dbName':_0x2d6659[_0x5eaa18(0x1ef)]});}function deserializeDbSelection(_0x41a362){const _0x5d685b=a196_0x492311;try{const _0x19b66c=JSON[_0x5d685b(0x1fe)](_0x41a362);if(typeof _0x19b66c[_0x5d685b(0x1c9)]==='number'&&Number[_0x5d685b(0x1de)](_0x19b66c[_0x5d685b(0x1c9)]))return{'dbId':_0x19b66c[_0x5d685b(0x1c9)],'dbName':_0x19b66c['dbName']};}catch{}throw CliErrors[_0x5d685b(0x1cf)](_0x5d685b(0x205)+_0x41a362);}function resolveProvidedDbId(_0x2b697a){const _0xdd6bed=a196_0x492311,_0x1bf510=_0x2b697a[_0xdd6bed(0x201)](_0xdd6bed(0x1e9));if(typeof _0x1bf510==='number'&&Number[_0xdd6bed(0x1de)](_0x1bf510))return _0x1bf510;return undefined;}
1
+ const a196_0x2507a9=a196_0x5551;(function(_0x11d8cd,_0x1fc40d){const _0x4e6a47=a196_0x5551,_0x3f9ff1=_0x11d8cd();while(!![]){try{const _0x42a661=-parseInt(_0x4e6a47(0x171))/0x1+parseInt(_0x4e6a47(0x16f))/0x2*(parseInt(_0x4e6a47(0x140))/0x3)+parseInt(_0x4e6a47(0x150))/0x4+-parseInt(_0x4e6a47(0x146))/0x5*(parseInt(_0x4e6a47(0x147))/0x6)+-parseInt(_0x4e6a47(0x153))/0x7+-parseInt(_0x4e6a47(0x166))/0x8*(parseInt(_0x4e6a47(0x16c))/0x9)+parseInt(_0x4e6a47(0x14f))/0xa;if(_0x42a661===_0x1fc40d)break;else _0x3f9ff1['push'](_0x3f9ff1['shift']());}catch(_0x569308){_0x3f9ff1['push'](_0x3f9ff1['shift']());}}}(a196_0x1f31,0x74a0d));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x3009de){const _0x50f506=a196_0x5551;if(_0x3009de===_0x50f506(0x15f))return['<select\x20id=\x22query\x22\x20resultType=\x22map\x22>',_0x50f506(0x154),_0x50f506(0x157),''][_0x50f506(0x14b)]('\x0a');return['SELECT\x201\x20AS\x20id;','']['join']('\x0a');}function a196_0x5551(_0x5f34d3,_0x306ea0){_0x5f34d3=_0x5f34d3-0x139;const _0x1f3132=a196_0x1f31();let _0x55516f=_0x1f3132[_0x5f34d3];return _0x55516f;}export const sqlCreate={'service':'sql','command':a196_0x2507a9(0x15a),'description':'Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','risk':a196_0x2507a9(0x152),'flags':[{'name':a196_0x2507a9(0x16b),'type':a196_0x2507a9(0x173),'description':a196_0x2507a9(0x16e)},{'name':a196_0x2507a9(0x165),'type':a196_0x2507a9(0x14d),'description':a196_0x2507a9(0x164)},{'name':a196_0x2507a9(0x13b),'type':'string','enum':[a196_0x2507a9(0x14e),a196_0x2507a9(0x15f)],'description':a196_0x2507a9(0x16d)}],async 'validate'(_0x3ee36b){const _0x4deab5=a196_0x2507a9;if(!_0x3ee36b[_0x4deab5(0x13a)])return;if(!_0x3ee36b[_0x4deab5(0x14c)](_0x4deab5(0x16b))[_0x4deab5(0x168)]())throw CliErrors['flagMissing']('name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x460188=resolveProvidedDbId(_0x3ee36b);if(typeof _0x460188!==_0x4deab5(0x14d)||!Number['isFinite'](_0x460188)||_0x460188<=0x0)throw CliErrors[_0x4deab5(0x162)]('db-id',_0x4deab5(0x170));if(!_0x3ee36b[_0x4deab5(0x14c)](_0x4deab5(0x13b))[_0x4deab5(0x168)]())throw CliErrors['flagMissing'](_0x4deab5(0x13b),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x7b1e59){const _0x265cbd=a196_0x2507a9,_0x3022e6=loadSqlProjectConfig(_0x7b1e59['appCode']),{sqlName:_0x3fb160,dbId:_0x18777a,dbName:_0x46aaa4,mode:_0xa7f806}=await resolveSqlNewInputs(_0x7b1e59),_0x5404e1=buildSqlRelativePath('<server-generated-sqlCode>',_0x3fb160,_0x46aaa4,_0xa7f806,_0x18777a),_0x5b6ae7=_0x3022e6[_0x265cbd(0x178)]+'/'+_0x5404e1;return{'method':_0x265cbd(0x174),'url':_0x265cbd(0x179),'body':{'appCode':_0x7b1e59['appCode'],'sqlName':_0x3fb160,'dbId':_0x18777a,'mode':_0xa7f806,'localPath':_0x5b6ae7},'description':_0x265cbd(0x15e)+_0x3022e6['sqlRootDir']};},async 'execute'(_0x445952){const _0x46cca8=a196_0x2507a9,_0x1c671b=loadSqlProjectConfig(_0x445952['appCode']),{sqlName:_0x5c2a2c,dbId:_0x89c255,dbName:_0x1aed63,mode:_0x302c7f}=await resolveSqlNewInputs(_0x445952),_0x58513=generateSqlTemplate(_0x302c7f),_0x2bd5ef=await createSqlQuery({'appCode':_0x445952[_0x46cca8(0x163)],'sqlName':_0x5c2a2c,'dbId':_0x89c255,'sqlContent':_0x58513}),_0x5be2b3=ensureRemoteSqlContent(_0x2bd5ef),_0x1569dd=_0x1aed63||await getDbName(_0x445952['appCode'],_0x89c255)['catch'](()=>undefined),_0x43b151=buildSqlRelativePath(_0x2bd5ef[_0x46cca8(0x148)],_0x2bd5ef[_0x46cca8(0x177)],_0x1569dd,_0x302c7f,_0x89c255),_0x10b9a8=_0x1c671b[_0x46cca8(0x178)]+'/'+_0x43b151,_0x1a3ef3=buildLocalSqlFileContent({'sqlCode':_0x2bd5ef[_0x46cca8(0x148)],'sqlName':_0x2bd5ef['sqlName'],'dbId':_0x2bd5ef[_0x46cca8(0x143)]},_0x5be2b3,{'dbName':_0x1569dd,'mode':_0x302c7f,'syncedAt':new Date()[_0x46cca8(0x13e)](),'description':_0x2bd5ef[_0x46cca8(0x167)]});if(await fileExists(_0x10b9a8))throw CliErrors[_0x46cca8(0x172)]('File\x20already\x20exists:\x20'+_0x10b9a8);await ensureParentDirectory(_0x10b9a8),await writeFile(_0x10b9a8,_0x1a3ef3,_0x46cca8(0x156));const _0x17ccf7=await readSqlLockFile(_0x1c671b[_0x46cca8(0x13f)]),{lockData:_0x30cc98,appLock:_0x3fd3ef}=ensureSqlLockScope(_0x17ccf7??createEmptySqlLock(),_0x1c671b['appCode'],_0x1c671b[_0x46cca8(0x15c)],'new');return _0x3fd3ef[_0x46cca8(0x175)][_0x2bd5ef[_0x46cca8(0x148)]]={...buildSqlLockEntry(_0x2bd5ef,_0x5be2b3,computeSqlContentHash(_0x1a3ef3),{'dbName':_0x1569dd}),'path':_0x43b151,'mode':_0x302c7f},_0x3fd3ef[_0x46cca8(0x144)]=new Date()[_0x46cca8(0x13e)](),await writeSqlLockFile(_0x1c671b[_0x46cca8(0x13f)],_0x30cc98),{'ok':!![],'data':{'id':_0x2bd5ef['id'],'sqlCode':_0x2bd5ef[_0x46cca8(0x148)],'sqlName':_0x2bd5ef[_0x46cca8(0x177)],'dbId':_0x2bd5ef[_0x46cca8(0x143)],'path':_0x10b9a8,'mode':_0x302c7f},'message':_0x46cca8(0x15b)+_0x2bd5ef[_0x46cca8(0x148)]};}};async function resolveSqlNewInputs(_0x4702bd){const _0x3d610e=await resolveSqlNameInput(_0x4702bd),{dbId:_0x970c16,dbName:_0x2f9186}=await resolveDbSelection(_0x4702bd),_0x463313=await resolveSqlModeInput(_0x4702bd);return{'sqlName':_0x3d610e,'dbId':_0x970c16,'dbName':_0x2f9186,'mode':_0x463313};}async function resolveSqlNameInput(_0x5360f7){const _0x579d73=a196_0x2507a9,_0x4f2725=_0x5360f7[_0x579d73(0x14c)](_0x579d73(0x16b))['trim']();if(_0x4f2725)return _0x4f2725;if(_0x5360f7[_0x579d73(0x13a)])throw CliErrors[_0x579d73(0x162)](_0x579d73(0x16b),_0x579d73(0x141));return(await input({'message':_0x579d73(0x159),'validate':_0x3f33a5=>_0x3f33a5['trim']()?!![]:_0x579d73(0x15d)}))[_0x579d73(0x168)]();}async function resolveDbSelection(_0x1a9f75){const _0x493f7f=a196_0x2507a9,_0xb4c559=resolveProvidedDbId(_0x1a9f75);if(typeof _0xb4c559===_0x493f7f(0x14d)&&Number['isFinite'](_0xb4c559)&&_0xb4c559>0x0)return{'dbId':_0xb4c559,'dbName':await getDbName(_0x1a9f75[_0x493f7f(0x163)],_0xb4c559)[_0x493f7f(0x14a)](()=>undefined)};if(_0x1a9f75[_0x493f7f(0x13a)])throw CliErrors['flagMissing'](_0x493f7f(0x165),_0x493f7f(0x170));const _0x5f16b3=await listDatabases(_0x1a9f75[_0x493f7f(0x163)])[_0x493f7f(0x14a)](()=>[]);if(_0x5f16b3['length']===0x1)return{'dbId':_0x5f16b3[0x0][_0x493f7f(0x143)],'dbName':_0x5f16b3[0x0][_0x493f7f(0x16a)]};if(_0x5f16b3[_0x493f7f(0x139)]>0x1){const _0x352504=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x5f16b3[_0x493f7f(0x145)](_0x15c847=>({'name':_0x15c847[_0x493f7f(0x16a)]+'\x20('+_0x15c847[_0x493f7f(0x143)]+')','value':serializeDbSelection(_0x15c847)})),{'name':'✎\x20Enter\x20dbId\x20manually','value':_0x493f7f(0x160)}]});if(_0x352504!==_0x493f7f(0x160))return deserializeDbSelection(_0x352504);}const _0x573fa2=await input({'message':'Target\x20database\x20dbId:','validate':_0x241694=>{const _0x2b28b4=_0x493f7f,_0x347dc8=_0x241694[_0x2b28b4(0x168)]();if(!_0x347dc8)return _0x2b28b4(0x176);const _0x2626d2=Number(_0x347dc8);if(!Number[_0x2b28b4(0x13d)](_0x2626d2)||_0x2626d2<=0x0)return _0x2b28b4(0x13c);return!![];}});return{'dbId':Number(_0x573fa2[_0x493f7f(0x168)]())};}async function resolveSqlModeInput(_0xb31742){const _0x288a7f=a196_0x2507a9,_0x1ccd75=_0xb31742['str']('mode')[_0x288a7f(0x168)]();if(_0x1ccd75==='sql'||_0x1ccd75===_0x288a7f(0x15f))return _0x1ccd75;if(_0xb31742['nonInteractive'])throw CliErrors[_0x288a7f(0x162)]('mode',_0x288a7f(0x158));return await select({'message':_0x288a7f(0x155),'choices':[{'name':_0x288a7f(0x149),'value':'sql','description':'For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly'},{'name':_0x288a7f(0x142),'value':_0x288a7f(0x15f),'description':_0x288a7f(0x151)}]});}function serializeDbSelection(_0x4659d6){const _0x16a9bf=a196_0x2507a9;return JSON['stringify']({'dbId':_0x4659d6[_0x16a9bf(0x143)],'dbName':_0x4659d6[_0x16a9bf(0x16a)]});}function a196_0x1f31(){const _0x38a931=['--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','113748DydVkN','validation','string','POST','sqls','dbId\x20cannot\x20be\x20empty','sqlName','sqlRootDir','/smartapi/custom/saveUserCustomSql','length','nonInteractive','mode','dbId\x20must\x20be\x20a\x20positive\x20integer','isInteger','toISOString','lockFilePath','5361eijvYY','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','MyBatis\x20XML\x20(mybatisXml)','dbId','lastSync','map','18175MmBfEE','42ijSpaZ','sqlCode','Plain\x20SQL\x20(sql)','catch','join','str','number','sql','8935420ayEDjr','1397556tOwltB','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','write','3022033RQxTpL','\x20\x20SELECT\x201\x20AS\x20id','Select\x20the\x20local\x20SQL\x20mode:','utf8','</select>','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','SQL\x20name:','create','Created\x20SQL\x20query\x20','sqlRoot','SQL\x20name\x20cannot\x20be\x20empty','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','mybatisXml','__manual__','flag','flagMissing','appCode','Target\x20database\x20ID','db-id','608zPqGjb','description','trim','isFinite','dbName','name','75915YfPeUm','Local\x20SQL\x20file\x20mode','SQL\x20query\x20display\x20name','500HxaIYa'];a196_0x1f31=function(){return _0x38a931;};return a196_0x1f31();}function deserializeDbSelection(_0x1e521){const _0x2b4a2b=a196_0x2507a9;try{const _0x3ac61d=JSON['parse'](_0x1e521);if(typeof _0x3ac61d['dbId']===_0x2b4a2b(0x14d)&&Number[_0x2b4a2b(0x169)](_0x3ac61d[_0x2b4a2b(0x143)]))return{'dbId':_0x3ac61d[_0x2b4a2b(0x143)],'dbName':_0x3ac61d[_0x2b4a2b(0x16a)]};}catch{}throw CliErrors[_0x2b4a2b(0x172)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x1e521);}function resolveProvidedDbId(_0x74cc90){const _0x5b856d=a196_0x2507a9,_0x169043=_0x74cc90[_0x5b856d(0x161)](_0x5b856d(0x165));if(typeof _0x169043===_0x5b856d(0x14d)&&Number[_0x5b856d(0x169)](_0x169043))return _0x169043;return undefined;}
@@ -1 +1 @@
1
- const a197_0x2476de=a197_0x50aa;(function(_0x5648d9,_0x40eddf){const _0x5a8bc2=a197_0x50aa,_0x51e803=_0x5648d9();while(!![]){try{const _0x36fa7b=parseInt(_0x5a8bc2(0x153))/0x1*(parseInt(_0x5a8bc2(0x169))/0x2)+-parseInt(_0x5a8bc2(0x150))/0x3+parseInt(_0x5a8bc2(0x147))/0x4*(-parseInt(_0x5a8bc2(0x15e))/0x5)+parseInt(_0x5a8bc2(0x157))/0x6+parseInt(_0x5a8bc2(0x148))/0x7*(parseInt(_0x5a8bc2(0x14f))/0x8)+parseInt(_0x5a8bc2(0x151))/0x9+parseInt(_0x5a8bc2(0x146))/0xa*(parseInt(_0x5a8bc2(0x168))/0xb);if(_0x36fa7b===_0x40eddf)break;else _0x51e803['push'](_0x51e803['shift']());}catch(_0x3e600c){_0x51e803['push'](_0x51e803['shift']());}}}(a197_0x1671,0x8d5fd));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';function a197_0x1671(){const _0x4f9bfc=['42165tMMFDR','sql','sqls','validation','length','Deleted\x20','delete','lockFilePath','SQL\x20lock\x20file\x20not\x20found.','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','121waDaFp','46JXGPNJ','high-risk-write','POST','str','71870UWCUJt','356ffeBOK','153321yPQBxP','remoteId','projectRoot','toISOString','replace','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','fromEntries','72CWUJMW','2587422NPvWpF','2702961eofQbe','appCode','31885QSybHD','filter','sqlcode','sqlRoot','5293272jcgcAZ','startsWith','\x20(local\x20file\x20moved\x20to\x20trash)','entries','trashDir','trashedTo','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.'];a197_0x1671=function(){return _0x4f9bfc;};return a197_0x1671();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a197_0x50aa(_0xfd0680,_0x420117){_0xfd0680=_0xfd0680-0x143;const _0x167128=a197_0x1671();let _0x50aa5f=_0x167128[_0xfd0680];return _0x50aa5f;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a197_0x2476de(0x15f),'command':a197_0x2476de(0x164),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a197_0x2476de(0x143),'flags':[SQLCODE_FLAG],async 'validate'(_0x190258){const _0x33546a=a197_0x2476de,_0x6eda05=loadSqlProjectConfig(_0x190258[_0x33546a(0x152)]),_0x2c2ed0=await readSqlLockFile(_0x6eda05[_0x33546a(0x165)]);if(!_0x2c2ed0)throw CliErrors[_0x33546a(0x161)](_0x33546a(0x15d));},async 'dryRun'(_0x26fa1b){const _0x7e178b=a197_0x2476de,_0x401315=loadSqlProjectConfig(_0x26fa1b[_0x7e178b(0x152)]),_0x5db8ad=await readSqlLockFile(_0x401315[_0x7e178b(0x165)]);if(!_0x5db8ad)throw CliErrors['validation'](_0x7e178b(0x15d));const {appLock:_0x2afd15}=ensureSqlLockScope(_0x5db8ad,_0x26fa1b[_0x7e178b(0x152)],_0x401315[_0x7e178b(0x156)],_0x7e178b(0x164)),_0x38e516=_0x26fa1b[_0x7e178b(0x145)](_0x7e178b(0x155)),_0x3edb47=_0x2afd15['sqls'][_0x38e516];if(!_0x3edb47)throw CliErrors[_0x7e178b(0x161)](_0x7e178b(0x167)+_0x38e516+'\x22.');return{'method':_0x7e178b(0x144),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x38e516,'id':_0x3edb47[_0x7e178b(0x149)],'localPath':resolveLocalSqlFilePath(_0x401315,_0x38e516,_0x3edb47)},'description':'Would\x20delete\x20SQL\x20'+_0x38e516+_0x7e178b(0x14d)+_0x401315['trashDir']};},async 'execute'(_0x4c032a){const _0x11015d=a197_0x2476de,_0x6d8f61=loadSqlProjectConfig(_0x4c032a[_0x11015d(0x152)]),_0x9555eb=await readSqlLockFile(_0x6d8f61[_0x11015d(0x165)]);if(!_0x9555eb)throw CliErrors['validation'](_0x11015d(0x166));const {lockData:_0x3feada,appLock:_0x7baf74}=ensureSqlLockScope(_0x9555eb,_0x4c032a[_0x11015d(0x152)],_0x6d8f61[_0x11015d(0x156)],_0x11015d(0x164)),_0x2fbe95=_0x4c032a[_0x11015d(0x145)](_0x11015d(0x155)),_0x4ee1aa=_0x7baf74[_0x11015d(0x160)][_0x2fbe95];if(!_0x4ee1aa)throw CliErrors['validation'](_0x11015d(0x167)+_0x2fbe95+'\x22.');await deleteSqlQuery({'id':_0x4ee1aa['remoteId'],'sqlCode':_0x2fbe95}),_0x7baf74[_0x11015d(0x160)]=Object[_0x11015d(0x14e)](Object[_0x11015d(0x15a)](_0x7baf74['sqls'])[_0x11015d(0x154)](([_0x1f3172])=>_0x1f3172!==_0x2fbe95)),_0x7baf74['lastSync']=new Date()[_0x11015d(0x14b)](),await writeSqlLockFile(_0x6d8f61['lockFilePath'],_0x3feada);const _0x1c399f=resolveLocalSqlFilePath(_0x6d8f61,_0x2fbe95,_0x4ee1aa);let _0x199ab3;await fileExists(_0x1c399f)&&(_0x199ab3=await moveToTrash(_0x6d8f61[_0x11015d(0x14a)],_0x6d8f61[_0x11015d(0x15b)],_0x1c399f),await cleanupEmptyDirectories(dirname(_0x1c399f),_0x6d8f61['sqlRootDir']));const _0x106590={'deleted':_0x2fbe95,'remoteId':_0x4ee1aa[_0x11015d(0x149)]};if(_0x199ab3)_0x106590[_0x11015d(0x15c)]=_0x199ab3;return{'ok':!![],'data':_0x106590,'message':_0x11015d(0x163)+_0x2fbe95+(_0x199ab3?_0x11015d(0x159):'')};}};async function moveToTrash(_0x12da92,_0x2c9171,_0x4113fe){const _0x27475a=a197_0x2476de,_0x158b5e=new Date()[_0x27475a(0x14b)]()[_0x27475a(0x14c)](/[:.]/g,'-'),_0x36736c=relative(_0x12da92,_0x4113fe),_0x422fc2=join(_0x2c9171,_0x158b5e,_0x36736c);return await mkdir(dirname(_0x422fc2),{'recursive':!![]}),await rename(_0x4113fe,_0x422fc2),_0x422fc2;}async function cleanupEmptyDirectories(_0x2bc47d,_0x203d8e){const _0x28c256=a197_0x2476de;let _0x293874=resolve(_0x2bc47d);const _0x52218f=resolve(_0x203d8e);while(_0x293874[_0x28c256(0x158)](''+_0x52218f+sep)||_0x293874===_0x52218f){if(_0x293874===_0x52218f)return;try{const _0x447e3d=await readdir(_0x293874);if(_0x447e3d[_0x28c256(0x162)]>0x0)return;await rmdir(_0x293874);}catch{return;}_0x293874=dirname(_0x293874);}}
1
+ const a197_0x42ff5b=a197_0x2e71;function a197_0x2e71(_0x2e39a7,_0x53960c){_0x2e39a7=_0x2e39a7-0x11d;const _0x2227f6=a197_0x2227();let _0x2e7185=_0x2227f6[_0x2e39a7];return _0x2e7185;}(function(_0x330d3e,_0x28010d){const _0x4a15f2=a197_0x2e71,_0x4ededd=_0x330d3e();while(!![]){try{const _0x3cc74f=parseInt(_0x4a15f2(0x12e))/0x1+-parseInt(_0x4a15f2(0x136))/0x2*(-parseInt(_0x4a15f2(0x125))/0x3)+parseInt(_0x4a15f2(0x122))/0x4*(parseInt(_0x4a15f2(0x12c))/0x5)+-parseInt(_0x4a15f2(0x135))/0x6+parseInt(_0x4a15f2(0x133))/0x7*(-parseInt(_0x4a15f2(0x124))/0x8)+-parseInt(_0x4a15f2(0x129))/0x9+parseInt(_0x4a15f2(0x121))/0xa;if(_0x3cc74f===_0x28010d)break;else _0x4ededd['push'](_0x4ededd['shift']());}catch(_0x234f59){_0x4ededd['push'](_0x4ededd['shift']());}}}(a197_0x2227,0xe23ce));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a197_0x42ff5b(0x13c),'command':'delete','description':a197_0x42ff5b(0x123),'risk':a197_0x42ff5b(0x134),'flags':[SQLCODE_FLAG],async 'validate'(_0x5395b2){const _0x2e4ef0=a197_0x42ff5b,_0x18c4d8=loadSqlProjectConfig(_0x5395b2['appCode']),_0x22495f=await readSqlLockFile(_0x18c4d8[_0x2e4ef0(0x11d)]);if(!_0x22495f)throw CliErrors[_0x2e4ef0(0x11f)](_0x2e4ef0(0x13b));},async 'dryRun'(_0x4b3389){const _0x2113f3=a197_0x42ff5b,_0x5a082c=loadSqlProjectConfig(_0x4b3389['appCode']),_0x423977=await readSqlLockFile(_0x5a082c[_0x2113f3(0x11d)]);if(!_0x423977)throw CliErrors[_0x2113f3(0x11f)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x4b731d}=ensureSqlLockScope(_0x423977,_0x4b3389['appCode'],_0x5a082c['sqlRoot'],'delete'),_0x3eb13c=_0x4b3389[_0x2113f3(0x141)](_0x2113f3(0x128)),_0x28d8c2=_0x4b731d[_0x2113f3(0x132)][_0x3eb13c];if(!_0x28d8c2)throw CliErrors['validation']('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x3eb13c+'\x22.');return{'method':'POST','url':_0x2113f3(0x13f),'body':{'sqlCode':_0x3eb13c,'id':_0x28d8c2[_0x2113f3(0x13e)],'localPath':resolveLocalSqlFilePath(_0x5a082c,_0x3eb13c,_0x28d8c2)},'description':_0x2113f3(0x12f)+_0x3eb13c+_0x2113f3(0x140)+_0x5a082c[_0x2113f3(0x139)]};},async 'execute'(_0x5ea998){const _0xa92215=a197_0x42ff5b,_0x2fb2d1=loadSqlProjectConfig(_0x5ea998[_0xa92215(0x12b)]),_0x5baa58=await readSqlLockFile(_0x2fb2d1['lockFilePath']);if(!_0x5baa58)throw CliErrors[_0xa92215(0x11f)]('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x3839fb,appLock:_0x122eed}=ensureSqlLockScope(_0x5baa58,_0x5ea998[_0xa92215(0x12b)],_0x2fb2d1[_0xa92215(0x13d)],_0xa92215(0x12d)),_0x39a569=_0x5ea998[_0xa92215(0x141)](_0xa92215(0x128)),_0xcb4dd9=_0x122eed['sqls'][_0x39a569];if(!_0xcb4dd9)throw CliErrors['validation'](_0xa92215(0x138)+_0x39a569+'\x22.');await deleteSqlQuery({'id':_0xcb4dd9[_0xa92215(0x13e)],'sqlCode':_0x39a569}),_0x122eed[_0xa92215(0x132)]=Object[_0xa92215(0x12a)](Object['entries'](_0x122eed[_0xa92215(0x132)])[_0xa92215(0x126)](([_0x1fcbbc])=>_0x1fcbbc!==_0x39a569)),_0x122eed[_0xa92215(0x120)]=new Date()[_0xa92215(0x11e)](),await writeSqlLockFile(_0x2fb2d1['lockFilePath'],_0x3839fb);const _0x16c472=resolveLocalSqlFilePath(_0x2fb2d1,_0x39a569,_0xcb4dd9);let _0x57e306;await fileExists(_0x16c472)&&(_0x57e306=await moveToTrash(_0x2fb2d1[_0xa92215(0x130)],_0x2fb2d1[_0xa92215(0x139)],_0x16c472),await cleanupEmptyDirectories(dirname(_0x16c472),_0x2fb2d1[_0xa92215(0x137)]));const _0x7614f7={'deleted':_0x39a569,'remoteId':_0xcb4dd9[_0xa92215(0x13e)]};if(_0x57e306)_0x7614f7['trashedTo']=_0x57e306;return{'ok':!![],'data':_0x7614f7,'message':_0xa92215(0x131)+_0x39a569+(_0x57e306?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a197_0x2227(){const _0x58e74a=['sqlRootDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','trashDir','startsWith','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','sql','sqlRoot','remoteId','/smartapi/custom/deleteUserCustomSql','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','str','lockFilePath','toISOString','validation','lastSync','18909850QxSkQf','88PcpLUT','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','1792PMfnNe','162654VmDvic','filter','length','sqlcode','6437520PUrOCy','fromEntries','appCode','109205wJcTki','delete','96902eDiRRr','Would\x20delete\x20SQL\x20','projectRoot','Deleted\x20','sqls','31017kFBnrr','high-risk-write','2256450UwtBRv','20oxzetI'];a197_0x2227=function(){return _0x58e74a;};return a197_0x2227();}async function moveToTrash(_0x236cd4,_0x2469fd,_0x223a57){const _0x3f68bb=a197_0x42ff5b,_0x204fde=new Date()[_0x3f68bb(0x11e)]()['replace'](/[:.]/g,'-'),_0x1056f8=relative(_0x236cd4,_0x223a57),_0x2b4fd1=join(_0x2469fd,_0x204fde,_0x1056f8);return await mkdir(dirname(_0x2b4fd1),{'recursive':!![]}),await rename(_0x223a57,_0x2b4fd1),_0x2b4fd1;}async function cleanupEmptyDirectories(_0x423878,_0x5a5eb4){const _0x13907c=a197_0x42ff5b;let _0xb37a5d=resolve(_0x423878);const _0x13d030=resolve(_0x5a5eb4);while(_0xb37a5d[_0x13907c(0x13a)](''+_0x13d030+sep)||_0xb37a5d===_0x13d030){if(_0xb37a5d===_0x13d030)return;try{const _0x33ebe8=await readdir(_0xb37a5d);if(_0x33ebe8[_0x13907c(0x127)]>0x0)return;await rmdir(_0xb37a5d);}catch{return;}_0xb37a5d=dirname(_0xb37a5d);}}
@@ -1 +1 @@
1
- const a198_0x2c2983=a198_0x39f5;function a198_0x39f5(_0x3ac565,_0x2a47f6){_0x3ac565=_0x3ac565-0x96;const _0x5420dc=a198_0x5420();let _0x39f575=_0x5420dc[_0x3ac565];return _0x39f575;}(function(_0x29ce47,_0x8edf97){const _0x501015=a198_0x39f5,_0x214779=_0x29ce47();while(!![]){try{const _0x2b2a84=-parseInt(_0x501015(0xa7))/0x1+-parseInt(_0x501015(0x9f))/0x2+parseInt(_0x501015(0xa2))/0x3+parseInt(_0x501015(0x96))/0x4*(parseInt(_0x501015(0x99))/0x5)+parseInt(_0x501015(0xa9))/0x6*(parseInt(_0x501015(0xa3))/0x7)+parseInt(_0x501015(0x9c))/0x8*(parseInt(_0x501015(0xa6))/0x9)+parseInt(_0x501015(0xa5))/0xa*(parseInt(_0x501015(0xa4))/0xb);if(_0x2b2a84===_0x8edf97)break;else _0x214779['push'](_0x214779['shift']());}catch(_0x367632){_0x214779['push'](_0x214779['shift']());}}}(a198_0x5420,0xe56df));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a198_0x5420(){const _0x2b8666=['Return\x20full\x20raw\x20SQL\x20query\x20object','sql','1525210SsbeCd','sqlName','verbose','2242395tjCRKf','7klYBee','143YinEVS','126010rBASiK','5265HSKyuP','295056brHXgo','appCode','3461772VgBTvg','read','sqlcode','bool','8cjNvLB','str','boolean','450985StjuIX','description','dbId','4496zWRWEl'];a198_0x5420=function(){return _0x2b8666;};return a198_0x5420();}export const sqlDetail={'service':a198_0x2c2983(0x9e),'command':'detail','description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a198_0x2c2983(0xaa),'flags':[SQLCODE_FLAG,{'name':a198_0x2c2983(0xa1),'type':a198_0x2c2983(0x98),'description':a198_0x2c2983(0x9d)}],async 'execute'(_0x3d7396){const _0x4bbcbb=a198_0x2c2983,_0x50087e=await getSqlQueryInfo(_0x3d7396[_0x4bbcbb(0xa8)],_0x3d7396[_0x4bbcbb(0x97)](_0x4bbcbb(0xab))),_0x2c218b=_0x3d7396[_0x4bbcbb(0xac)](_0x4bbcbb(0xa1));if(_0x2c218b)return{'ok':!![],'data':_0x50087e};const _0x51bb94=_0x50087e[_0x4bbcbb(0x9b)]?await getDbName(_0x3d7396[_0x4bbcbb(0xa8)],_0x50087e[_0x4bbcbb(0x9b)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x50087e['sqlCode'],'sqlName':_0x50087e[_0x4bbcbb(0xa0)],'db':_0x51bb94?_0x51bb94+'\x20('+_0x50087e[_0x4bbcbb(0x9b)]+')':_0x50087e['dbId']??'','description':_0x50087e[_0x4bbcbb(0x9a)]??'','sqlContent':_0x50087e['sqlContent']??''}};}};
1
+ function a198_0x2a71(){const _0x584bd0=['sql','bool','description','1852208JDqRXJ','2BJooNb','appCode','sqlcode','sqlContent','detail','5701770hThvWv','str','42siAsDF','verbose','dbId','5307370RcJJhs','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','sqlCode','read','2212551FLrbZa','9uIEetk','boolean','3135308qicdwb','755862qRJMlo','182759iLSVHs','sqlName','Return\x20full\x20raw\x20SQL\x20query\x20object'];a198_0x2a71=function(){return _0x584bd0;};return a198_0x2a71();}const a198_0x5e72a8=a198_0x3127;(function(_0x40ffa8,_0x933a48){const _0x52398c=a198_0x3127,_0x50b0bf=_0x40ffa8();while(!![]){try{const _0x2984c8=parseInt(_0x52398c(0xf6))/0x1*(parseInt(_0x52398c(0xfd))/0x2)+-parseInt(_0x52398c(0xf1))/0x3+parseInt(_0x52398c(0xf4))/0x4+-parseInt(_0x52398c(0x102))/0x5+-parseInt(_0x52398c(0xf5))/0x6*(-parseInt(_0x52398c(0xea))/0x7)+-parseInt(_0x52398c(0xfc))/0x8*(-parseInt(_0x52398c(0xf2))/0x9)+parseInt(_0x52398c(0xed))/0xa;if(_0x2984c8===_0x933a48)break;else _0x50b0bf['push'](_0x50b0bf['shift']());}catch(_0x1ec69d){_0x50b0bf['push'](_0x50b0bf['shift']());}}}(a198_0x2a71,0x94278));import{getSqlQueryInfo}from'../../core/api-client.js';function a198_0x3127(_0x5ac1b0,_0x9900a0){_0x5ac1b0=_0x5ac1b0-0xea;const _0x2a7125=a198_0x2a71();let _0x312797=_0x2a7125[_0x5ac1b0];return _0x312797;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a198_0x5e72a8(0xf9),'command':a198_0x5e72a8(0x101),'description':a198_0x5e72a8(0xee),'risk':a198_0x5e72a8(0xf0),'flags':[SQLCODE_FLAG,{'name':'verbose','type':a198_0x5e72a8(0xf3),'description':a198_0x5e72a8(0xf8)}],async 'execute'(_0x34cfca){const _0x588b71=a198_0x5e72a8,_0x42effd=await getSqlQueryInfo(_0x34cfca['appCode'],_0x34cfca[_0x588b71(0x103)](_0x588b71(0xff))),_0x13c9c3=_0x34cfca[_0x588b71(0xfa)](_0x588b71(0xeb));if(_0x13c9c3)return{'ok':!![],'data':_0x42effd};const _0x456e66=_0x42effd[_0x588b71(0xec)]?await getDbName(_0x34cfca[_0x588b71(0xfe)],_0x42effd[_0x588b71(0xec)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x42effd[_0x588b71(0xef)],'sqlName':_0x42effd[_0x588b71(0xf7)],'db':_0x456e66?_0x456e66+'\x20('+_0x42effd[_0x588b71(0xec)]+')':_0x42effd[_0x588b71(0xec)]??'','description':_0x42effd[_0x588b71(0xfb)]??'','sqlContent':_0x42effd[_0x588b71(0x100)]??''}};}};
@@ -1 +1 @@
1
- const a199_0x5328ae=a199_0x57b3;(function(_0x4e93ac,_0x27ca2e){const _0xc2da1c=a199_0x57b3,_0x21ab06=_0x4e93ac();while(!![]){try{const _0x4e39cf=parseInt(_0xc2da1c(0x9a))/0x1*(parseInt(_0xc2da1c(0xa1))/0x2)+-parseInt(_0xc2da1c(0x9c))/0x3*(parseInt(_0xc2da1c(0x9f))/0x4)+-parseInt(_0xc2da1c(0xa0))/0x5*(parseInt(_0xc2da1c(0x8d))/0x6)+-parseInt(_0xc2da1c(0x91))/0x7*(-parseInt(_0xc2da1c(0xaa))/0x8)+parseInt(_0xc2da1c(0xa8))/0x9*(-parseInt(_0xc2da1c(0x90))/0xa)+-parseInt(_0xc2da1c(0x9d))/0xb*(parseInt(_0xc2da1c(0xa7))/0xc)+-parseInt(_0xc2da1c(0x95))/0xd*(-parseInt(_0xc2da1c(0x99))/0xe);if(_0x4e39cf===_0x27ca2e)break;else _0x21ab06['push'](_0x21ab06['shift']());}catch(_0x501927){_0x21ab06['push'](_0x21ab06['shift']());}}}(a199_0x112e,0x25bad));import{executeSql}from'../../core/api-client.js';function a199_0x57b3(_0x456341,_0x4ee0cc){_0x456341=_0x456341-0x8d;const _0x112e53=a199_0x112e();let _0x57b3d9=_0x112e53[_0x456341];return _0x57b3d9;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a199_0x112e(){const _0xf3b403=['12DtbXEQ','11xOVQyW','string','172436fiwEei','10opDwjY','200730urAFwh','\x20row(s)\x20in\x20','isArray','appCode','Returned\x20','now','1410504jkqVIy','9ZaSnyz','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','600736DzmJnG','params','330564wuZzQS','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execError','1161070acUEGN','14HuopMW','SQL\x20execution\x20failed','str','sql','13PpFGIY','exec','read','length','5883710cQdRRb','1bbjhpr','execSuccess'];a199_0x112e=function(){return _0xf3b403;};return a199_0x112e();}export const sqlExec={'service':a199_0x5328ae(0x94),'command':a199_0x5328ae(0x96),'description':a199_0x5328ae(0x8e),'risk':a199_0x5328ae(0x97),'flags':[SQLCODE_FLAG,{'name':a199_0x5328ae(0xab),'type':a199_0x5328ae(0x9e),'description':a199_0x5328ae(0xa9)}],async 'execute'(_0x3008e6){const _0x16e6db=a199_0x5328ae,_0x2a571c=parseJsonParams(_0x3008e6['str'](_0x16e6db(0xab))),_0x4734ce=Date[_0x16e6db(0xa6)](),_0x4aabc3=await executeSql(_0x3008e6[_0x16e6db(0xa4)],_0x3008e6[_0x16e6db(0x93)]('sqlcode'),_0x2a571c),_0x391dde=Date[_0x16e6db(0xa6)]()-_0x4734ce,_0x36bb39=_0x4aabc3?.['execResult']??_0x4aabc3,_0x5a1e02=_0x4aabc3?.[_0x16e6db(0x9b)]??!![];if(!_0x5a1e02)return{'ok':![],'data':{'error':_0x4aabc3?.[_0x16e6db(0x8f)]||_0x16e6db(0x92),'elapsed':_0x391dde},'message':_0x16e6db(0x92)};const _0x4e1d9b=Array[_0x16e6db(0xa3)](_0x36bb39)?_0x36bb39:[];return{'ok':!![],'data':{'rows':_0x4e1d9b,'rowCount':_0x4e1d9b[_0x16e6db(0x98)],'elapsed':_0x391dde},'message':_0x16e6db(0xa5)+_0x4e1d9b['length']+_0x16e6db(0xa2)+_0x391dde+'ms'};}};
1
+ const a199_0x517dad=a199_0x11e4;function a199_0x11e4(_0x1dbe2b,_0x5e4e0a){_0x1dbe2b=_0x1dbe2b-0x1a0;const _0x539029=a199_0x5390();let _0x11e4d1=_0x539029[_0x1dbe2b];return _0x11e4d1;}(function(_0x1fde35,_0x220177){const _0x4c642d=a199_0x11e4,_0x430423=_0x1fde35();while(!![]){try{const _0xb802a=parseInt(_0x4c642d(0x1b8))/0x1*(parseInt(_0x4c642d(0x1a5))/0x2)+-parseInt(_0x4c642d(0x1b3))/0x3+parseInt(_0x4c642d(0x1b0))/0x4+parseInt(_0x4c642d(0x1b1))/0x5*(-parseInt(_0x4c642d(0x1af))/0x6)+parseInt(_0x4c642d(0x1ac))/0x7+parseInt(_0x4c642d(0x1b4))/0x8+parseInt(_0x4c642d(0x1a3))/0x9;if(_0xb802a===_0x220177)break;else _0x430423['push'](_0x430423['shift']());}catch(_0x1f7fda){_0x430423['push'](_0x430423['shift']());}}}(a199_0x5390,0xa740d));function a199_0x5390(){const _0x2424b5=['3100012qqGsGe','44430bGEBEI','\x20row(s)\x20in\x20','2366052lvFKXT','1514480vdCjvv','execError','params','string','2ptkGal','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','sql','length','135963IhIfLX','execSuccess','189814PzCpAy','str','SQL\x20execution\x20failed','appCode','execResult','exec','sqlcode','3624481fnSEYc','Returned\x20','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','144PwiCWq'];a199_0x5390=function(){return _0x2424b5;};return a199_0x5390();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a199_0x517dad(0x1a1),'command':a199_0x517dad(0x1aa),'description':a199_0x517dad(0x1a0),'risk':'read','flags':[SQLCODE_FLAG,{'name':a199_0x517dad(0x1b6),'type':a199_0x517dad(0x1b7),'description':a199_0x517dad(0x1ae)}],async 'execute'(_0x2e49da){const _0x251c82=a199_0x517dad,_0x334ce0=parseJsonParams(_0x2e49da['str']('params')),_0x1e5f01=Date['now'](),_0x3bbdc4=await executeSql(_0x2e49da[_0x251c82(0x1a8)],_0x2e49da[_0x251c82(0x1a6)](_0x251c82(0x1ab)),_0x334ce0),_0x11604d=Date['now']()-_0x1e5f01,_0x525b11=_0x3bbdc4?.[_0x251c82(0x1a9)]??_0x3bbdc4,_0x5ead3b=_0x3bbdc4?.[_0x251c82(0x1a4)]??!![];if(!_0x5ead3b)return{'ok':![],'data':{'error':_0x3bbdc4?.[_0x251c82(0x1b5)]||_0x251c82(0x1a7),'elapsed':_0x11604d},'message':_0x251c82(0x1a7)};const _0x4434b1=Array['isArray'](_0x525b11)?_0x525b11:[];return{'ok':!![],'data':{'rows':_0x4434b1,'rowCount':_0x4434b1[_0x251c82(0x1a2)],'elapsed':_0x11604d},'message':_0x251c82(0x1ad)+_0x4434b1[_0x251c82(0x1a2)]+_0x251c82(0x1b2)+_0x11604d+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x4df921,_0x179264){const _0x36f203=a200_0x1d08,_0x20e2b2=_0x4df921();while(!![]){try{const _0x92e9ae=parseInt(_0x36f203(0x1b6))/0x1+parseInt(_0x36f203(0x1b9))/0x2*(parseInt(_0x36f203(0x1b8))/0x3)+-parseInt(_0x36f203(0x1b4))/0x4*(-parseInt(_0x36f203(0x1b0))/0x5)+-parseInt(_0x36f203(0x1b1))/0x6*(-parseInt(_0x36f203(0x1b3))/0x7)+parseInt(_0x36f203(0x1bb))/0x8*(parseInt(_0x36f203(0x1b7))/0x9)+parseInt(_0x36f203(0x1ba))/0xa+-parseInt(_0x36f203(0x1b5))/0xb*(parseInt(_0x36f203(0x1b2))/0xc);if(_0x92e9ae===_0x179264)break;else _0x20e2b2['push'](_0x20e2b2['shift']());}catch(_0x262ee8){_0x20e2b2['push'](_0x20e2b2['shift']());}}}(a200_0x43f4,0x28b65));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';function a200_0x1d08(_0x1da616,_0x5dae30){_0x1da616=_0x1da616-0x1b0;const _0x43f4b9=a200_0x43f4();let _0x1d089c=_0x43f4b9[_0x1da616];return _0x1d089c;}import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a200_0x43f4(){const _0x3192b7=['36gywfuU','11nSsWFC','297618CGtdVS','230643WpRjln','54411XWjuol','10ZXObFN','2683950aXyNCV','8eCYAXm','86725vwVWwt','786ZcwONy','8431068ioFfAs','1652iyEzvg'];a200_0x43f4=function(){return _0x3192b7;};return a200_0x43f4();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x6ffbc2,_0x20e32e){const _0x195d56=a200_0x4420,_0x2f7bcd=_0x6ffbc2();while(!![]){try{const _0x1ba1e6=parseInt(_0x195d56(0x1bf))/0x1+parseInt(_0x195d56(0x1c1))/0x2*(-parseInt(_0x195d56(0x1c7))/0x3)+-parseInt(_0x195d56(0x1c3))/0x4*(-parseInt(_0x195d56(0x1c2))/0x5)+-parseInt(_0x195d56(0x1c4))/0x6+-parseInt(_0x195d56(0x1c5))/0x7+-parseInt(_0x195d56(0x1c0))/0x8+parseInt(_0x195d56(0x1c6))/0x9;if(_0x1ba1e6===_0x20e32e)break;else _0x2f7bcd['push'](_0x2f7bcd['shift']());}catch(_0x5d27c0){_0x2f7bcd['push'](_0x2f7bcd['shift']());}}}(a200_0x3059,0x417f2));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlExec}from'../../commands/sql/exec.js';function a200_0x3059(){const _0x3f14c9=['28398OReBKU','323502MLTSul','3216864ovZvhZ','98txCNHo','145RIFlPX','39836Qtewiz','2365332tlqfFW','3170328pThJHN','12321261sFubCB'];a200_0x3059=function(){return _0x3f14c9;};return a200_0x3059();}import{sqlPull}from'../../commands/sql/pull.js';function a200_0x4420(_0x457482,_0x267b0d){_0x457482=_0x457482-0x1bf;const _0x30592f=a200_0x3059();let _0x4420dd=_0x30592f[_0x457482];return _0x4420dd;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a201_0x25d7a3=a201_0x208c;(function(_0x42fce4,_0x41b14b){const _0x9331e4=a201_0x208c,_0x163045=_0x42fce4();while(!![]){try{const _0x337c11=-parseInt(_0x9331e4(0x150))/0x1*(-parseInt(_0x9331e4(0x157))/0x2)+parseInt(_0x9331e4(0x153))/0x3*(-parseInt(_0x9331e4(0x156))/0x4)+-parseInt(_0x9331e4(0x14d))/0x5*(-parseInt(_0x9331e4(0x14c))/0x6)+parseInt(_0x9331e4(0x15b))/0x7+parseInt(_0x9331e4(0x149))/0x8*(parseInt(_0x9331e4(0x147))/0x9)+-parseInt(_0x9331e4(0x155))/0xa+parseInt(_0x9331e4(0x144))/0xb*(-parseInt(_0x9331e4(0x152))/0xc);if(_0x337c11===_0x41b14b)break;else _0x163045['push'](_0x163045['shift']());}catch(_0x115a99){_0x163045['push'](_0x163045['shift']());}}}(a201_0x371b,0x3deed));import{listSqlQueries}from'../../core/api-client.js';function a201_0x371b(){const _0xc17bab=['boolean','name','dbId','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','1996489llBAua','length','read','18dVnEgR','sqlcode','1976872GfPXAm','totalCount','tableData','68496WsZBNd','185nPhtUT','map','pagesize','914eqffNf','page','24qRjiMt','171177cdsJFk','appCode','2204240RkVHHq','20kqXjQf','252rxiGqR','List\x20custom\x20SQL\x20queries','description','Page\x20size','634340xQmQdc','list','str','sqlCode','num','number','sql','verbose','Found\x20','bool','No\x20custom\x20SQL\x20queries\x20found.'];a201_0x371b=function(){return _0xc17bab;};return a201_0x371b();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a201_0x208c(_0x3d5e0e,_0x2ba049){_0x3d5e0e=_0x3d5e0e-0x143;const _0x371b08=a201_0x371b();let _0x208c9e=_0x371b08[_0x3d5e0e];return _0x208c9e;}export const sqlList={'service':a201_0x25d7a3(0x161),'command':a201_0x25d7a3(0x15c),'description':a201_0x25d7a3(0x158),'risk':a201_0x25d7a3(0x146),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a201_0x25d7a3(0x167),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a201_0x25d7a3(0x151),'type':'number','description':'Page\x20number','default':0x1},{'name':a201_0x25d7a3(0x14f),'type':a201_0x25d7a3(0x160),'description':a201_0x25d7a3(0x15a)},{'name':a201_0x25d7a3(0x162),'type':a201_0x25d7a3(0x166),'description':a201_0x25d7a3(0x143)}],async 'execute'(_0x1e3c0c){const _0x1ad4f6=a201_0x25d7a3,_0x12e421=await listSqlQueries(_0x1e3c0c[_0x1ad4f6(0x154)],{'sqlCode':_0x1e3c0c[_0x1ad4f6(0x15d)](_0x1ad4f6(0x148))||undefined,'sqlName':_0x1e3c0c[_0x1ad4f6(0x15d)](_0x1ad4f6(0x167))||undefined,'currentPage':_0x1e3c0c[_0x1ad4f6(0x15f)](_0x1ad4f6(0x151)),'pageSize':_0x1e3c0c[_0x1ad4f6(0x15f)](_0x1ad4f6(0x14f),0x32)}),_0x1c6b87=_0x1e3c0c[_0x1ad4f6(0x164)]('verbose'),_0x5c4b5f=_0x12e421[_0x1ad4f6(0x14b)]??[],_0x3c75b4=_0x12e421['paging']?.[_0x1ad4f6(0x14a)]??_0x5c4b5f[_0x1ad4f6(0x145)];let _0x46b36e;return _0x1c6b87?_0x46b36e=_0x5c4b5f:_0x46b36e=await Promise['all'](_0x5c4b5f[_0x1ad4f6(0x14e)](async _0x5a2279=>{const _0x3af562=_0x1ad4f6;let _0x185a6e;try{_0x185a6e=_0x5a2279['dbId']?await getDbName(_0x1e3c0c['appCode'],_0x5a2279['dbId']):undefined;}catch{}return{'sqlCode':_0x5a2279[_0x3af562(0x15e)],'sqlName':_0x5a2279['sqlName'],'description':_0x5a2279[_0x3af562(0x159)]??'','db':_0x185a6e?_0x185a6e+'\x20('+_0x5a2279[_0x3af562(0x168)]+')':_0x5a2279['dbId']??''};})),{'ok':!![],'data':_0x46b36e,'message':_0x5c4b5f[_0x1ad4f6(0x145)]===0x0?_0x1ad4f6(0x165):_0x1ad4f6(0x163)+_0x5c4b5f[_0x1ad4f6(0x145)]+'\x20SQL\x20queries\x20(total:\x20'+_0x3c75b4+').'};}};
1
+ const a201_0x53dcbd=a201_0x1003;(function(_0x1fbc39,_0x22613e){const _0x194e26=a201_0x1003,_0xc4e44a=_0x1fbc39();while(!![]){try{const _0x5986f7=parseInt(_0x194e26(0x1c4))/0x1+-parseInt(_0x194e26(0x1c6))/0x2*(parseInt(_0x194e26(0x1c2))/0x3)+-parseInt(_0x194e26(0x1b3))/0x4+parseInt(_0x194e26(0x1bf))/0x5*(parseInt(_0x194e26(0x1ce))/0x6)+-parseInt(_0x194e26(0x1b7))/0x7+parseInt(_0x194e26(0x1b0))/0x8*(-parseInt(_0x194e26(0x1cd))/0x9)+parseInt(_0x194e26(0x1cf))/0xa;if(_0x5986f7===_0x22613e)break;else _0xc4e44a['push'](_0xc4e44a['shift']());}catch(_0x45ff26){_0xc4e44a['push'](_0xc4e44a['shift']());}}}(a201_0x3171,0x7e43f));import{listSqlQueries}from'../../core/api-client.js';function a201_0x3171(){const _0x29964c=['No\x20custom\x20SQL\x20queries\x20found.','name','description','read','dbId','1615025ecRxPP','length','sqlcode','100083NZNimW','paging','1024583ZyETgY','verbose','22nasYXL','page','str','string','Found\x20','sql','number','833634ebDAIP','6wmFMls','16544280vHoHOZ','Filter\x20by\x20SQL\x20name','all','num','tableData','\x20SQL\x20queries\x20(total:\x20','64mujcwD','appCode','bool','1984140fdDuHk','map','totalCount','sqlCode','6165733ZjqUNH','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sqlName'];a201_0x3171=function(){return _0x29964c;};return a201_0x3171();}function a201_0x1003(_0x36e797,_0x273e03){_0x36e797=_0x36e797-0x1ab;const _0x317128=a201_0x3171();let _0x100336=_0x317128[_0x36e797];return _0x100336;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a201_0x53dcbd(0x1cb),'command':'list','description':'List\x20custom\x20SQL\x20queries','risk':a201_0x53dcbd(0x1bd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a201_0x53dcbd(0x1bb),'type':a201_0x53dcbd(0x1c9),'description':a201_0x53dcbd(0x1ab)},{'name':a201_0x53dcbd(0x1c7),'type':a201_0x53dcbd(0x1cc),'description':'Page\x20number','default':0x1},{'name':'pagesize','type':'number','description':'Page\x20size'},{'name':a201_0x53dcbd(0x1c5),'type':'boolean','description':a201_0x53dcbd(0x1b8)}],async 'execute'(_0x13e5d9){const _0x245622=a201_0x53dcbd,_0x30c880=await listSqlQueries(_0x13e5d9[_0x245622(0x1b1)],{'sqlCode':_0x13e5d9['str'](_0x245622(0x1c1))||undefined,'sqlName':_0x13e5d9[_0x245622(0x1c8)](_0x245622(0x1bb))||undefined,'currentPage':_0x13e5d9[_0x245622(0x1ad)](_0x245622(0x1c7)),'pageSize':_0x13e5d9['num']('pagesize',0x32)}),_0x499661=_0x13e5d9[_0x245622(0x1b2)]('verbose'),_0x4f3101=_0x30c880[_0x245622(0x1ae)]??[],_0x31cc95=_0x30c880[_0x245622(0x1c3)]?.[_0x245622(0x1b5)]??_0x4f3101[_0x245622(0x1c0)];let _0x5d754c;return _0x499661?_0x5d754c=_0x4f3101:_0x5d754c=await Promise[_0x245622(0x1ac)](_0x4f3101[_0x245622(0x1b4)](async _0x1346ea=>{const _0x1ff482=_0x245622;let _0x48de0b;try{_0x48de0b=_0x1346ea[_0x1ff482(0x1be)]?await getDbName(_0x13e5d9[_0x1ff482(0x1b1)],_0x1346ea[_0x1ff482(0x1be)]):undefined;}catch{}return{'sqlCode':_0x1346ea[_0x1ff482(0x1b6)],'sqlName':_0x1346ea[_0x1ff482(0x1b9)],'description':_0x1346ea[_0x1ff482(0x1bc)]??'','db':_0x48de0b?_0x48de0b+'\x20('+_0x1346ea['dbId']+')':_0x1346ea['dbId']??''};})),{'ok':!![],'data':_0x5d754c,'message':_0x4f3101[_0x245622(0x1c0)]===0x0?_0x245622(0x1ba):_0x245622(0x1ca)+_0x4f3101[_0x245622(0x1c0)]+_0x245622(0x1af)+_0x31cc95+').'};}};