@lovrabet/rabetbase-cli 2.5.1-beta.6 → 2.5.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 (311) 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.js +1 -1
  99. package/lib/commands/deployment/index.js +1 -1
  100. package/lib/commands/deployment/sync.js +1 -1
  101. package/lib/commands/doctor.js +1 -1
  102. package/lib/commands/file/index.js +1 -1
  103. package/lib/commands/issue/index.js +1 -1
  104. package/lib/commands/issue/nudge.js +1 -1
  105. package/lib/commands/issue/report.js +1 -1
  106. package/lib/commands/issue/shared.js +1 -1
  107. package/lib/commands/kb/create.js +1 -1
  108. package/lib/commands/kb/delete.js +1 -1
  109. package/lib/commands/kb/detail.js +1 -1
  110. package/lib/commands/kb/index.js +1 -1
  111. package/lib/commands/kb/list.js +1 -1
  112. package/lib/commands/kb/search.js +1 -1
  113. package/lib/commands/kb/shared.js +1 -1
  114. package/lib/commands/kb/update.js +1 -1
  115. package/lib/commands/logs/index.js +1 -1
  116. package/lib/commands/menu/asset-update.js +1 -1
  117. package/lib/commands/menu/delete.js +1 -1
  118. package/lib/commands/menu/external-link-create.js +1 -1
  119. package/lib/commands/menu/external-link-update.js +1 -1
  120. package/lib/commands/menu/group-create.js +1 -1
  121. package/lib/commands/menu/group-update.js +1 -1
  122. package/lib/commands/menu/index.js +1 -1
  123. package/lib/commands/menu/list.js +1 -1
  124. package/lib/commands/menu/move.js +1 -1
  125. package/lib/commands/menu/regroup-start.js +1 -1
  126. package/lib/commands/menu/rename.js +1 -1
  127. package/lib/commands/menu/shared/compare-table.js +1 -1
  128. package/lib/commands/menu/shared/delete-plan.js +1 -1
  129. package/lib/commands/menu/shared/facts.js +1 -1
  130. package/lib/commands/menu/shared/index.js +1 -1
  131. package/lib/commands/menu/shared/inquirer.js +1 -1
  132. package/lib/commands/menu/shared/local-pages.js +1 -1
  133. package/lib/commands/menu/shared/logic.js +1 -1
  134. package/lib/commands/menu/shared/mutations.js +1 -1
  135. package/lib/commands/menu/shared/service.js +1 -1
  136. package/lib/commands/menu/shared/sync-core.js +1 -1
  137. package/lib/commands/menu/shared/update-core.js +1 -1
  138. package/lib/commands/menu/shared/valid-url.js +1 -1
  139. package/lib/commands/menu/sync.js +1 -1
  140. package/lib/commands/menu/visibility-update.js +1 -1
  141. package/lib/commands/notification/config-create.js +1 -1
  142. package/lib/commands/notification/config-delete.js +1 -1
  143. package/lib/commands/notification/config-list.js +1 -1
  144. package/lib/commands/notification/config-update.js +1 -1
  145. package/lib/commands/notification/index.js +1 -1
  146. package/lib/commands/notification/shared.js +1 -1
  147. package/lib/commands/ocr/index.js +1 -1
  148. package/lib/commands/page/create.js +1 -1
  149. package/lib/commands/page/custom/detail.js +1 -1
  150. package/lib/commands/page/custom/list.js +1 -1
  151. package/lib/commands/page/custom/publish.js +1 -1
  152. package/lib/commands/page/custom/shared.js +1 -1
  153. package/lib/commands/page/custom/syntax.js +1 -1
  154. package/lib/commands/page/custom/template.js +1 -1
  155. package/lib/commands/page/custom/update.js +1 -1
  156. package/lib/commands/page/data-list-status.js +1 -1
  157. package/lib/commands/page/generate-start.js +1 -1
  158. package/lib/commands/page/generate-status.js +1 -1
  159. package/lib/commands/page/index.js +1 -1
  160. package/lib/commands/page/pull.js +1 -1
  161. package/lib/commands/page/push.js +1 -1
  162. package/lib/commands/page/relation-audit.js +1 -1
  163. package/lib/commands/page/restore.js +1 -1
  164. package/lib/commands/page/shared.js +1 -1
  165. package/lib/commands/page/sync.js +1 -1
  166. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  167. package/lib/commands/project/create/format-elapsed.js +1 -1
  168. package/lib/commands/project/create/main.js +1 -1
  169. package/lib/commands/project/create/materialize-project-template.js +1 -1
  170. package/lib/commands/project/create/project-name.js +1 -1
  171. package/lib/commands/project/create/project-template-archive.js +1 -1
  172. package/lib/commands/project/create/project-template-path.js +1 -1
  173. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  174. package/lib/commands/project/create/use-format-code.js +1 -1
  175. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  176. package/lib/commands/project/domain-routing-sync.js +1 -1
  177. package/lib/commands/project/index.js +1 -1
  178. package/lib/commands/project/upgrade.js +1 -1
  179. package/lib/commands/registry.js +1 -1
  180. package/lib/commands/role/delete.js +1 -1
  181. package/lib/commands/role/detail.js +1 -1
  182. package/lib/commands/role/index.js +1 -1
  183. package/lib/commands/role/list.js +1 -1
  184. package/lib/commands/role/shared.js +1 -1
  185. package/lib/commands/role/update.js +1 -1
  186. package/lib/commands/role/user-add.js +1 -1
  187. package/lib/commands/role/user-remove.js +1 -1
  188. package/lib/commands/role/user-resolve.js +1 -1
  189. package/lib/commands/rule/get.js +1 -1
  190. package/lib/commands/rule/index.js +1 -1
  191. package/lib/commands/rule/list.js +1 -1
  192. package/lib/commands/rule/set.js +1 -1
  193. package/lib/commands/rule/shared.js +1 -1
  194. package/lib/commands/run/index.js +1 -1
  195. package/lib/commands/schema.js +1 -1
  196. package/lib/commands/sql/create.js +1 -1
  197. package/lib/commands/sql/delete.js +1 -1
  198. package/lib/commands/sql/detail.js +1 -1
  199. package/lib/commands/sql/exec.js +1 -1
  200. package/lib/commands/sql/index.js +1 -1
  201. package/lib/commands/sql/list.js +1 -1
  202. package/lib/commands/sql/pull.js +1 -1
  203. package/lib/commands/sql/push.js +1 -1
  204. package/lib/commands/sql/shared.js +1 -1
  205. package/lib/commands/sql/status.js +1 -1
  206. package/lib/commands/sql/validate.js +1 -1
  207. package/lib/commands/task/index.js +1 -1
  208. package/lib/commands/task/status.js +1 -1
  209. package/lib/commands/tenant/index.js +1 -1
  210. package/lib/commands/tenant/members-list.js +1 -1
  211. package/lib/commands/tenant/shared.js +1 -1
  212. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  213. package/lib/commands/user-account/index.js +1 -1
  214. package/lib/commands/workspace/add.js +1 -1
  215. package/lib/commands/workspace/index.js +1 -1
  216. package/lib/commands/workspace/remove.js +1 -1
  217. package/lib/config/deployment-sync.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.js +1 -1
  232. package/lib/context/auth-resolver.js +1 -1
  233. package/lib/context/config-loader.js +1 -1
  234. package/lib/context.js +1 -1
  235. package/lib/core/alias-resolver.js +1 -1
  236. package/lib/core/api-client.js +1 -1
  237. package/lib/core/bff/config.js +1 -1
  238. package/lib/core/bff/file-system.js +1 -1
  239. package/lib/core/bff/hash.js +1 -1
  240. package/lib/core/bff/lock.js +1 -1
  241. package/lib/core/bff/utils.js +1 -1
  242. package/lib/core/db-resolver.js +1 -1
  243. package/lib/core/kb-search-client.js +1 -1
  244. package/lib/core/page/file-system.js +1 -1
  245. package/lib/core/page/hash.js +1 -1
  246. package/lib/core/page/lock.js +1 -1
  247. package/lib/core/sql-index-auditor.js +1 -1
  248. package/lib/core/sql-sync/config.js +1 -1
  249. package/lib/core/sql-sync/file-system.js +1 -1
  250. package/lib/core/sql-sync/hash.js +1 -1
  251. package/lib/core/sql-sync/lock.js +1 -1
  252. package/lib/core/sql-sync/utils.js +1 -1
  253. package/lib/core/sql-validator.js +1 -1
  254. package/lib/errors.js +1 -1
  255. package/lib/framework/build-all-flags.js +1 -1
  256. package/lib/framework/error-output.js +1 -1
  257. package/lib/framework/explicit-yes.js +1 -1
  258. package/lib/framework/flags.js +1 -1
  259. package/lib/framework/help.js +1 -1
  260. package/lib/framework/index.js +1 -1
  261. package/lib/framework/output.js +1 -1
  262. package/lib/framework/response.js +1 -1
  263. package/lib/framework/runner-alias.js +1 -1
  264. package/lib/framework/runner.js +1 -1
  265. package/lib/framework/schema-export.js +1 -1
  266. package/lib/framework/types.js +1 -1
  267. package/lib/generated/build-info.d.ts +4 -4
  268. package/lib/generated/build-info.js +1 -1
  269. package/lib/generated/official-routing.js +1 -1
  270. package/lib/generated/routing-contract.js +1 -1
  271. package/lib/help.js +1 -1
  272. package/lib/postinstall.js +1 -1
  273. package/lib/runtime/confirmation.js +1 -1
  274. package/lib/runtime/event.js +1 -1
  275. package/lib/runtime/index.js +1 -1
  276. package/lib/runtime/queue.js +1 -1
  277. package/lib/runtime/resolve.js +1 -1
  278. package/lib/skills/builtin-skill.js +1 -1
  279. package/lib/skills/main.js +1 -1
  280. package/lib/skills/npx-skills-add.js +1 -1
  281. package/lib/skills/skill-presence.js +1 -1
  282. package/lib/telemetry/cli-command-trace.js +1 -1
  283. package/lib/telemetry/cli-help-trace.js +1 -1
  284. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  285. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  286. package/lib/telemetry/send-cli-trace-log.js +1 -1
  287. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  288. package/lib/utils/ai_config.js +1 -1
  289. package/lib/utils/apply-jq-filter.js +1 -1
  290. package/lib/utils/cdn-config.js +1 -1
  291. package/lib/utils/check-sdk-version.js +1 -1
  292. package/lib/utils/cli-version-check.js +1 -1
  293. package/lib/utils/cli-version-policy.js +1 -1
  294. package/lib/utils/config.js +1 -1
  295. package/lib/utils/entity-with-id.js +1 -1
  296. package/lib/utils/file-utils.js +1 -1
  297. package/lib/utils/guides-cdn.js +1 -1
  298. package/lib/utils/http-client.js +1 -1
  299. package/lib/utils/is-non-interactive.js +1 -1
  300. package/lib/utils/logger.js +1 -1
  301. package/lib/utils/params.js +1 -1
  302. package/lib/utils/platform.js +1 -1
  303. package/lib/utils/sleep.js +1 -1
  304. package/lib/utils/template-replacer.js +1 -1
  305. package/lib/utils/update-notice.js +1 -1
  306. package/lib/utils/version.js +1 -1
  307. package/lib/utils/with-active-cookie.js +1 -1
  308. package/lib/utils/write-cli-side-channel.js +1 -1
  309. package/package.json +1 -1
  310. package/skills/rabetbase/SKILL.md +1 -1
  311. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a185_0x3dc7bd=a185_0x3794;(function(_0x3e1712,_0x3c5bb8){const _0x94d38c=a185_0x3794,_0x5af2cc=_0x3e1712();while(!![]){try{const _0x26a52d=parseInt(_0x94d38c(0x1de))/0x1+parseInt(_0x94d38c(0x1dc))/0x2+-parseInt(_0x94d38c(0x1c6))/0x3*(-parseInt(_0x94d38c(0x1c5))/0x4)+-parseInt(_0x94d38c(0x1d8))/0x5+parseInt(_0x94d38c(0x1da))/0x6+-parseInt(_0x94d38c(0x1d6))/0x7+parseInt(_0x94d38c(0x1df))/0x8;if(_0x26a52d===_0x3c5bb8)break;else _0x5af2cc['push'](_0x5af2cc['shift']());}catch(_0x3b6e21){_0x5af2cc['push'](_0x5af2cc['shift']());}}}(a185_0x7d62,0x39e89));function a185_0x7d62(){const _0x3db087=['Updated\x20role\x20','length','/smartapi/permit/role/update','1443001zxcRKl','validation','1535375cLuXZO','Nothing\x20to\x20update.','1222350vvdmGO','\x20(id=','457328GruOng','POST','105671tQxssn','1514840WgNlix','Role\x20name\x20cannot\x20exceed\x2064\x20characters.','string','update','16NcWRZp','17247EroFjR','New\x20role\x20name','roleName','flag','Update\x20a\x20CUSTOM\x20role\x27s\x20name/remark\x20(built-in\x20roles\x20rejected)','dev','num','appCode','role','name','remark','trim','--name\x20cannot\x20be\x20empty.'];a185_0x7d62=function(){return _0x3db087;};return a185_0x7d62();}import{updateAppRole}from'../../core/api-client.js';function a185_0x3794(_0x5ca34b,_0x5c6176){_0x5ca34b=_0x5ca34b-0x1c4;const _0x7d621a=a185_0x7d62();let _0x37945a=_0x7d621a[_0x5ca34b];return _0x37945a;}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';const UPDATE_PATH=a185_0x3dc7bd(0x1d5);function readPatch(_0x2d79a9){const _0x2e8e7a=a185_0x3dc7bd,_0x5e9af8=_0x2d79a9[_0x2e8e7a(0x1c9)](_0x2e8e7a(0x1cf)),_0x1f084f=_0x2d79a9[_0x2e8e7a(0x1c9)](_0x2e8e7a(0x1d0)),_0x11ba7d={};if(_0x5e9af8!==undefined&&_0x5e9af8!==null){const _0x3730=String(_0x5e9af8)[_0x2e8e7a(0x1d1)]();if(!_0x3730)throw CliErrors[_0x2e8e7a(0x1d7)](_0x2e8e7a(0x1d2));if(_0x3730[_0x2e8e7a(0x1d4)]>0x40)throw CliErrors[_0x2e8e7a(0x1d7)](_0x2e8e7a(0x1e0));_0x11ba7d[_0x2e8e7a(0x1c8)]=_0x3730;}_0x1f084f!==undefined&&_0x1f084f!==null&&(_0x11ba7d[_0x2e8e7a(0x1d0)]=String(_0x1f084f));if(_0x11ba7d[_0x2e8e7a(0x1c8)]===undefined&&_0x11ba7d['remark']===undefined)throw CliErrors[_0x2e8e7a(0x1d7)](_0x2e8e7a(0x1d9),'Pass\x20at\x20least\x20one\x20of\x20--name\x20/\x20--remark.');return _0x11ba7d;}export const roleUpdate={'service':a185_0x3dc7bd(0x1ce),'command':a185_0x3dc7bd(0x1c4),'description':a185_0x3dc7bd(0x1ca),'risk':'write','flags':[ROLE_ID_FLAG,{...REMARK_FLAG},{'name':a185_0x3dc7bd(0x1cf),'type':a185_0x3dc7bd(0x1e1),'required':![],'description':a185_0x3dc7bd(0x1c7)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x25f2f7){readPatch(_0x25f2f7);},async 'dryRun'(_0x29549c){const _0x245a50=a185_0x3dc7bd,_0x5e3bea=_0x29549c[_0x245a50(0x1cc)]('id'),_0x1fd58a=readPatch(_0x29549c),_0x103574=await getRoleById(_0x29549c[_0x245a50(0x1cd)],_0x5e3bea);return assertCustomRole(_0x103574,'update'),asDryRunResult({'scope':_0x245a50(0x1cb),'operation':_0x245a50(0x1c4),'selector':{'appCode':_0x29549c[_0x245a50(0x1cd)],'roleId':_0x5e3bea,'roleName':_0x103574['roleName']},'before':projectRole(_0x103574),'after':projectRole({..._0x103574,..._0x1fd58a[_0x245a50(0x1c8)]!==undefined?{'roleName':_0x1fd58a[_0x245a50(0x1c8)]}:{},..._0x1fd58a[_0x245a50(0x1d0)]!==undefined?{'remark':_0x1fd58a[_0x245a50(0x1d0)]}:{}}),'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[]},{'method':_0x245a50(0x1dd),'url':UPDATE_PATH});},async 'execute'(_0x4c0189){const _0x5f27a7=a185_0x3dc7bd,_0x395e9a=_0x4c0189[_0x5f27a7(0x1cc)]('id'),_0xe09e2c=readPatch(_0x4c0189),_0x2b06ed=await getRoleById(_0x4c0189[_0x5f27a7(0x1cd)],_0x395e9a);assertCustomRole(_0x2b06ed,_0x5f27a7(0x1c4)),await updateAppRole({'id':_0x395e9a,'appCode':_0x4c0189[_0x5f27a7(0x1cd)],..._0xe09e2c['roleName']!==undefined?{'roleName':_0xe09e2c[_0x5f27a7(0x1c8)]}:{},..._0xe09e2c[_0x5f27a7(0x1d0)]!==undefined?{'remark':_0xe09e2c[_0x5f27a7(0x1d0)]}:{}});const _0x171ed3=await getRoleById(_0x4c0189[_0x5f27a7(0x1cd)],_0x395e9a);return{'ok':!![],'data':{'scope':_0x5f27a7(0x1cb),'operation':_0x5f27a7(0x1c4),'selector':{'appCode':_0x4c0189[_0x5f27a7(0x1cd)],'roleId':_0x395e9a,'roleName':_0x171ed3['roleName']},'before':projectRole(_0x2b06ed),'after':projectRole(_0x171ed3),'dryRun':![],'backend':{'method':_0x5f27a7(0x1dd),'path':UPDATE_PATH},'warnings':[]},'message':_0x5f27a7(0x1d3)+_0x171ed3[_0x5f27a7(0x1c8)]+_0x5f27a7(0x1db)+_0x395e9a+')'};}};
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 +1 @@
1
- function a186_0x20a9(_0x3c805e,_0xcc5888){_0x3c805e=_0x3c805e-0x100;const _0x1a2fbb=a186_0x1a2f();let _0x20a9f5=_0x1a2fbb[_0x3c805e];return _0x20a9f5;}const a186_0x23446c=a186_0x20a9;(function(_0x3e6488,_0x5bfcb4){const _0x5c9e31=a186_0x20a9,_0x53b6d=_0x3e6488();while(!![]){try{const _0x5f01a3=parseInt(_0x5c9e31(0x10c))/0x1+parseInt(_0x5c9e31(0x102))/0x2*(parseInt(_0x5c9e31(0x10a))/0x3)+-parseInt(_0x5c9e31(0x109))/0x4*(-parseInt(_0x5c9e31(0x10d))/0x5)+-parseInt(_0x5c9e31(0x107))/0x6+-parseInt(_0x5c9e31(0x111))/0x7*(parseInt(_0x5c9e31(0x117))/0x8)+-parseInt(_0x5c9e31(0x114))/0x9+-parseInt(_0x5c9e31(0x116))/0xa*(-parseInt(_0x5c9e31(0x104))/0xb);if(_0x5f01a3===_0x5bfcb4)break;else _0x53b6d['push'](_0x53b6d['shift']());}catch(_0x2327a9){_0x53b6d['push'](_0x53b6d['shift']());}}}(a186_0x1a2f,0x89ba6));import{createDevUserRole}from'../../core/api-client.js';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_0x23446c(0x10e),'command':a186_0x23446c(0x110),'description':a186_0x23446c(0x112),'risk':a186_0x23446c(0x115),'flags':[ROLE_REF_FLAG,USER_REF_FLAG,EXPECT_USER_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'dryRun'(_0x5cb4ba){const _0x3d7e0b=a186_0x23446c,{mutation:_0x55fed9}=await prepareUserMutation(_0x5cb4ba,_0x3d7e0b(0x110),!![]);return asDryRunResult(_0x55fed9,{'method':_0x3d7e0b(0x113),'url':CREATE_USER_ROLE_PATH});},async 'execute'(_0x136a50){const _0x4bd393=a186_0x23446c,{mutation:_0x15cc29,changed:_0x4e7f82,role:_0x3fbc5a,user:_0x148105}=await prepareUserMutation(_0x136a50,_0x4bd393(0x110),![]);return _0x4e7f82&&await createDevUserRole({'appCode':_0x136a50[_0x4bd393(0x105)],'userId':_0x148105[_0x4bd393(0x118)],'username':_0x148105[_0x4bd393(0x119)],'roleType':_0x3fbc5a[_0x4bd393(0x106)],'roleId':_0x15cc29[_0x4bd393(0x10b)][_0x4bd393(0x100)]}),{'ok':!![],'data':_0x15cc29,'message':_0x4e7f82?_0x4bd393(0x108)+_0x15cc29['selector']['userId']+_0x4bd393(0x10f)+_0x15cc29[_0x4bd393(0x10b)][_0x4bd393(0x103)]:_0x4bd393(0x101)+_0x15cc29[_0x4bd393(0x10b)][_0x4bd393(0x118)]+'\x20already\x20in\x20role\x20'+_0x15cc29[_0x4bd393(0x10b)][_0x4bd393(0x103)]};}};function a186_0x1a2f(){const _0x51346c=['7uguBMZ','Add\x20a\x20user\x20to\x20a\x20role\x20(OWNER\x20rejected);\x20requires\x20--yes','POST','6255909ZkOnpv','high-risk-write','3581580mBQGVj','4742888eXqyrc','userId','username','roleId','No\x20change:\x20user\x20','4ajstww','roleName','22UOMmLE','appCode','roleType','3762870bxLzar','Added\x20user\x20','512YMKuBa','792498qqBfan','selector','394657rTNTBQ','32810xOooqh','role','\x20to\x20role\x20','user-add'];a186_0x1a2f=function(){return _0x51346c;};return a186_0x1a2f();}
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 +1 @@
1
- const a187_0x38eb9c=a187_0xbc4a;(function(_0x53b572,_0x20fe58){const _0x4eb015=a187_0xbc4a,_0x402caa=_0x53b572();while(!![]){try{const _0x23a1bd=parseInt(_0x4eb015(0xd6))/0x1+-parseInt(_0x4eb015(0xd0))/0x2*(-parseInt(_0x4eb015(0xcf))/0x3)+-parseInt(_0x4eb015(0xd7))/0x4+-parseInt(_0x4eb015(0xce))/0x5+parseInt(_0x4eb015(0xd1))/0x6*(-parseInt(_0x4eb015(0xc9))/0x7)+-parseInt(_0x4eb015(0xd4))/0x8*(parseInt(_0x4eb015(0xd2))/0x9)+parseInt(_0x4eb015(0xcd))/0xa;if(_0x23a1bd===_0x20fe58)break;else _0x402caa['push'](_0x402caa['shift']());}catch(_0x58d6e2){_0x402caa['push'](_0x402caa['shift']());}}}(a187_0x474d,0x5539a));function a187_0xbc4a(_0xbb8d78,_0x8293e7){_0xbb8d78=_0xbb8d78-0xc9;const _0x474dd0=a187_0x474d();let _0xbc4a0=_0x474dd0[_0xbb8d78];return _0xbc4a0;}import{deleteDevUserRole}from'../../core/api-client.js';function a187_0x474d(){const _0x381247=['userId','No\x20change:\x20user\x20','POST','9207710jpKXFv','2975920OKafcl','21726ECnDlb','118GPMEVM','218634tONVLj','27homWbb','user-remove','766984eVGEYv','roleName','573660rYZefE','572956ayzJpb','selector','\x20from\x20role\x20','role','105YlbwVP'];a187_0x474d=function(){return _0x381247;};return a187_0x474d();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';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':a187_0x38eb9c(0xda),'command':'user-remove','description':'Remove\x20a\x20user\x20from\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'(_0x932d60){const _0x8607cf=a187_0x38eb9c,{mutation:_0x53cfcb}=await prepareUserMutation(_0x932d60,_0x8607cf(0xd3),!![]);return asDryRunResult(_0x53cfcb,{'method':_0x8607cf(0xcc),'url':DELETE_USER_ROLE_PATH});},async 'execute'(_0x4e0c75){const _0x5d00ad=a187_0x38eb9c,{matchingRelationIds:_0x54f718,mutation:_0x57ab6f,changed:_0xe0f1c3}=await prepareUserMutation(_0x4e0c75,_0x5d00ad(0xd3),![]);if(_0xe0f1c3)for(const _0x27c658 of _0x54f718){await deleteDevUserRole(_0x27c658);}return{'ok':!![],'data':_0x57ab6f,'message':_0xe0f1c3?'Removed\x20user\x20'+_0x57ab6f['selector'][_0x5d00ad(0xca)]+_0x5d00ad(0xd9)+_0x57ab6f['selector'][_0x5d00ad(0xd5)]:_0x5d00ad(0xcb)+_0x57ab6f[_0x5d00ad(0xd8)][_0x5d00ad(0xca)]+'\x20not\x20in\x20role\x20'+_0x57ab6f[_0x5d00ad(0xd8)][_0x5d00ad(0xd5)]};}};
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 +1 @@
1
- const a188_0x4c11f2=a188_0x44c2;(function(_0x3409ff,_0x19e135){const _0x4a3c0b=a188_0x44c2,_0x35a930=_0x3409ff();while(!![]){try{const _0xcce31c=-parseInt(_0x4a3c0b(0x19b))/0x1*(parseInt(_0x4a3c0b(0x19e))/0x2)+-parseInt(_0x4a3c0b(0x1a4))/0x3+parseInt(_0x4a3c0b(0x1a2))/0x4+-parseInt(_0x4a3c0b(0x1ab))/0x5*(-parseInt(_0x4a3c0b(0x1a1))/0x6)+parseInt(_0x4a3c0b(0x1a0))/0x7+-parseInt(_0x4a3c0b(0x1af))/0x8*(parseInt(_0x4a3c0b(0x1ad))/0x9)+parseInt(_0x4a3c0b(0x1ac))/0xa;if(_0xcce31c===_0x19e135)break;else _0x35a930['push'](_0x35a930['shift']());}catch(_0x587660){_0x35a930['push'](_0x35a930['shift']());}}}(a188_0x4ed0,0x7c545));import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a188_0x4ed0(){const _0x5db9b9=['94328pJRXqF','Pass\x20--name\x20<nickname|username>.','2087424oAfLId','Resolve\x20a\x20nickname/username\x20to\x20a\x20userId\x20(tenant\x20member\x20directory)','\x22\x20→\x20userId\x20','username','nickname','role','str','120Pzjcdc','11418150UgrCxy','171NOpoZF','name','146088OabJiM','userId','trim','137QKYkGc','user-resolve','Resolved\x20\x22','3962xNcqms','matchedBy','2692620PpAsEV','68340mmqabD'];a188_0x4ed0=function(){return _0x5db9b9;};return a188_0x4ed0();}function a188_0x44c2(_0x1298a8,_0x530e2b){_0x1298a8=_0x1298a8-0x199;const _0x4ed046=a188_0x4ed0();let _0x44c28d=_0x4ed046[_0x1298a8];return _0x44c28d;}import{resolveUserRef,USER_NAME_FLAG}from'../../commands/role/shared.js';export const roleUserResolve={'service':a188_0x4c11f2(0x1a9),'command':a188_0x4c11f2(0x19c),'description':a188_0x4c11f2(0x1a5),'risk':'read','flags':[USER_NAME_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xd5bc59){const _0x312c38=a188_0x4c11f2;if(!_0xd5bc59[_0x312c38(0x1aa)](_0x312c38(0x1ae))['trim']())throw CliErrors['flagMissing'](_0x312c38(0x1ae),_0x312c38(0x1a3));},async 'execute'(_0x61170d){const _0x29e4c1=a188_0x4c11f2,_0x3012cd=_0x61170d[_0x29e4c1(0x1aa)](_0x29e4c1(0x1ae))[_0x29e4c1(0x19a)](),_0x42da90=await resolveUserRef(_0x3012cd,'Select\x20a\x20listed\x20userId,\x20then\x20pass\x20it\x20to\x20`role\x20user-add`\x20or\x20`role\x20user-remove`\x20with\x20--user\x20<id>.');return{'ok':!![],'data':{'user':{'userId':_0x42da90[_0x29e4c1(0x199)],'username':_0x42da90[_0x29e4c1(0x1a7)],'nickname':_0x42da90[_0x29e4c1(0x1a8)],'matchedBy':_0x42da90[_0x29e4c1(0x19f)]}},'message':_0x29e4c1(0x19d)+_0x3012cd+_0x29e4c1(0x1a6)+_0x42da90[_0x29e4c1(0x199)]};}};
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 +1 @@
1
- const a189_0x1e02f1=a189_0x2823;(function(_0x44845c,_0x27e060){const _0x52be91=a189_0x2823,_0x1eb49d=_0x44845c();while(!![]){try{const _0x5d08b4=-parseInt(_0x52be91(0x18f))/0x1*(-parseInt(_0x52be91(0x18e))/0x2)+-parseInt(_0x52be91(0x195))/0x3*(parseInt(_0x52be91(0x187))/0x4)+-parseInt(_0x52be91(0x19c))/0x5*(parseInt(_0x52be91(0x19a))/0x6)+-parseInt(_0x52be91(0x199))/0x7+-parseInt(_0x52be91(0x19d))/0x8+-parseInt(_0x52be91(0x18b))/0x9*(parseInt(_0x52be91(0x188))/0xa)+-parseInt(_0x52be91(0x18c))/0xb*(-parseInt(_0x52be91(0x189))/0xc);if(_0x5d08b4===_0x27e060)break;else _0x1eb49d['push'](_0x1eb49d['shift']());}catch(_0x2bfa47){_0x1eb49d['push'](_0x1eb49d['shift']());}}}(a189_0x4eb3,0x7e607));import{getAppRule}from'../../core/api-client.js';function a189_0x2823(_0x2b25fa,_0x401525){_0x2b25fa=_0x2b25fa-0x187;const _0x4eb397=a189_0x4eb3();let _0x282393=_0x4eb397[_0x2b25fa];return _0x282393;}function a189_0x4eb3(){const _0x44e902=['Create\x20it\x20with\x20`rabetbase\x20rule\x20set\x20--type\x20','\x20--file\x20<path>\x20--dry-run`.','8943OIekFn','appCode','app_rule_not_found','read','2793868zJAdkk','4419516euGpEj','content','5jGQiyw','4172368AlSQFK','\x20is\x20not\x20configured\x20for\x20app\x20','632QHcakJ','30PbtuyN','11060532wrQDKj','cookie','3102543KXBzoB','33QAdiQh','get','1829882hKddOA','1UPxRnB','Loaded\x20','Get\x20one\x20agent\x20context\x20rule\x20for\x20the\x20resolved\x20app','\x20for\x20'];a189_0x4eb3=function(){return _0x44e902;};return a189_0x4eb3();}import{APP_RULE_TYPE_FLAG,appRuleError,appRuleFileName,projectAppRule,readAppRuleType}from'../../commands/rule/shared.js';export const ruleGet={'service':'rule','command':a189_0x1e02f1(0x18d),'description':a189_0x1e02f1(0x191),'risk':a189_0x1e02f1(0x198),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG],async 'validate'(_0x19e3e8){readAppRuleType(_0x19e3e8);},async 'execute'(_0x547a82){const _0x2ea892=a189_0x1e02f1,_0x47120c=readAppRuleType(_0x547a82),_0x588f18=await getAppRule(_0x547a82[_0x2ea892(0x18a)],{'appCode':_0x547a82[_0x2ea892(0x196)],'type':_0x47120c});if(!_0x588f18)throw appRuleError(_0x2ea892(0x197),appRuleFileName(_0x47120c)+_0x2ea892(0x19e)+_0x547a82[_0x2ea892(0x196)]+'.',_0x2ea892(0x193)+_0x47120c+_0x2ea892(0x194));return{'ok':!![],'data':{'rule':{...projectAppRule(_0x47120c,_0x588f18),'content':_0x588f18[_0x2ea892(0x19b)]}},'message':_0x2ea892(0x190)+appRuleFileName(_0x47120c)+_0x2ea892(0x192)+_0x547a82[_0x2ea892(0x196)]};}};
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 +1 @@
1
- function a190_0x226d(){const _0x215f60=['3820446YcyGer','1664517HRZvoI','126078BJSuWB','156vJezBz','153656ZxzYnM','5199ceEJeP','4pqjfee','2448870HonXyF','13770060SSLyUk','287pQuxHa'];a190_0x226d=function(){return _0x215f60;};return a190_0x226d();}function a190_0x442b(_0x1638f0,_0x537733){_0x1638f0=_0x1638f0-0x6f;const _0x226de6=a190_0x226d();let _0x442b61=_0x226de6[_0x1638f0];return _0x442b61;}(function(_0x199816,_0x247d9e){const _0x5a7efb=a190_0x442b,_0x131ffc=_0x199816();while(!![]){try{const _0x314334=-parseInt(_0x5a7efb(0x72))/0x1*(parseInt(_0x5a7efb(0x70))/0x2)+-parseInt(_0x5a7efb(0x78))/0x3*(-parseInt(_0x5a7efb(0x73))/0x4)+-parseInt(_0x5a7efb(0x74))/0x5+-parseInt(_0x5a7efb(0x6f))/0x6+parseInt(_0x5a7efb(0x76))/0x7*(-parseInt(_0x5a7efb(0x71))/0x8)+parseInt(_0x5a7efb(0x77))/0x9+parseInt(_0x5a7efb(0x75))/0xa;if(_0x314334===_0x247d9e)break;else _0x131ffc['push'](_0x131ffc['shift']());}catch(_0x429caf){_0x131ffc['push'](_0x131ffc['shift']());}}}(a190_0x226d,0x9f4ff));import{ruleGet}from'../../commands/rule/get.js';import{ruleList}from'../../commands/rule/list.js';import{ruleSet}from'../../commands/rule/set.js';export const ruleDefinitions=[ruleList,ruleGet,ruleSet];
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 +1 @@
1
- const a191_0x288785=a191_0x3814;(function(_0x4a2999,_0x23f77d){const _0x54e01d=a191_0x3814,_0x542017=_0x4a2999();while(!![]){try{const _0x3c518c=-parseInt(_0x54e01d(0x132))/0x1*(parseInt(_0x54e01d(0x12d))/0x2)+parseInt(_0x54e01d(0x138))/0x3+parseInt(_0x54e01d(0x133))/0x4+parseInt(_0x54e01d(0x135))/0x5+parseInt(_0x54e01d(0x12e))/0x6+-parseInt(_0x54e01d(0x137))/0x7+-parseInt(_0x54e01d(0x12c))/0x8;if(_0x3c518c===_0x23f77d)break;else _0x542017['push'](_0x542017['shift']());}catch(_0x4cd921){_0x542017['push'](_0x542017['shift']());}}}(a191_0x2118,0x7f3e0));function a191_0x3814(_0x309bfc,_0x2bc8f4){_0x309bfc=_0x309bfc-0x12b;const _0x211839=a191_0x2118();let _0x381435=_0x211839[_0x309bfc];return _0x381435;}import{getAppRule}from'../../core/api-client.js';function a191_0x2118(){const _0x5c62ba=['cookie','list','1ZOQhGu','2082980fzEEjD','List\x20agent\x20context\x20rules\x20for\x20the\x20resolved\x20app','4970855JQzEVQ','read','2390486eIxaWJ','2899035gDIYOX','Loaded\x20app\x20rule\x20configuration\x20for\x20','appCode','17540264qMFHsl','733054ypZUSv','5642886vtbdSt','map'];a191_0x2118=function(){return _0x5c62ba;};return a191_0x2118();}import{APP_RULE_TYPES,projectAppRule}from'../../commands/rule/shared.js';export const ruleList={'service':'rule','command':a191_0x288785(0x131),'description':a191_0x288785(0x134),'risk':a191_0x288785(0x136),'requiresAppCode':!![],'structuredErrors':!![],'flags':[],async 'execute'(_0x3f4ebd){const _0x3617da=a191_0x288785,_0x202de4=await Promise['all'](APP_RULE_TYPES[_0x3617da(0x12f)](_0x1aefa1=>getAppRule(_0x3f4ebd[_0x3617da(0x130)],{'appCode':_0x3f4ebd[_0x3617da(0x12b)],'type':_0x1aefa1}))),_0x431cee=APP_RULE_TYPES['map']((_0x15be31,_0x2320ba)=>projectAppRule(_0x15be31,_0x202de4[_0x2320ba]??null));return{'ok':!![],'data':{'total':_0x431cee['length'],'rules':_0x431cee},'message':_0x3617da(0x139)+_0x3f4ebd[_0x3617da(0x12b)]};}};
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 +1 @@
1
- const a192_0x25bfb8=a192_0x58a4;(function(_0x21917e,_0x54130e){const _0x134b6f=a192_0x58a4,_0x4a4a88=_0x21917e();while(!![]){try{const _0x402505=parseInt(_0x134b6f(0x15f))/0x1*(-parseInt(_0x134b6f(0x17a))/0x2)+-parseInt(_0x134b6f(0x171))/0x3+parseInt(_0x134b6f(0x17d))/0x4+parseInt(_0x134b6f(0x16f))/0x5+parseInt(_0x134b6f(0x164))/0x6*(-parseInt(_0x134b6f(0x18b))/0x7)+-parseInt(_0x134b6f(0x161))/0x8+-parseInt(_0x134b6f(0x14f))/0x9*(-parseInt(_0x134b6f(0x15e))/0xa);if(_0x402505===_0x54130e)break;else _0x4a4a88['push'](_0x4a4a88['shift']());}catch(_0x586c08){_0x4a4a88['push'](_0x4a4a88['shift']());}}}(a192_0x3005,0x6f4fb));function a192_0x3005(){const _0x26e406=['Expected\x20','rules','write','Pass\x20a\x20UTF-8\x20Markdown\x20file.','app_rule_expected_version_invalid','15004430taGUhQ','53153ryDNhR','.\x20Run\x20rule\x20get\x20and\x20review\x20before\x20retrying.','824648OwJDaH',';\x20current\x20version\x20is\x20','--expected-version\x20must\x20be\x20a\x20non-negative\x20safe\x20integer.','6TbTqYt','\x20for\x20','set','Non-atomic\x20preflight\x20assertion\x20for\x20the\x20current\x20version','Do\x20not\x20resubmit\x20automatically.\x20Inspect\x20the\x20exact\x20rule\x20state\x20before\x20retrying.','expected-version','cookie','rabetbase\x20rule\x20get\x20--type\x20','cause','byteSize','app_rule_verification_failed','103895MJJdhJ','\x20does\x20not\x20prove\x20the\x20requested\x20set\x20state.','296241YMhuPF','Set\x20response\x20was\x20unavailable;\x20verified\x20the\x20exact\x20content\x20readback\x20without\x20resubmitting.','before','\x20--format\x20compress','unconfigured','app_rule_version_mismatch','\x20could\x20not\x20be\x20verified.','Set\x20an\x20agent\x20context\x20rule\x20from\x20a\x20UTF-8\x20Markdown\x20file','content','22qQVbnV','push','The\x20set\x20request\x20was\x20sent,\x20but\x20','1875996oKZmSx','str','replacement','POST','appCode','app_rule_set_outcome_unknown','file','contentHash','expectedVersion','input','version','Inspect\x20it\x20with\x20`rabetbase\x20rule\x20get\x20--type\x20','number','flag','5234453FYQuZx','--file\x20is\x20required.','9fyMsdq','beforeRecord','type','app_rule_file_required','rule','--expected-version\x20is\x20a\x20non-atomic\x20read-before-write\x20assertion;\x20the\x20server\x20save\x20contract\x20has\x20no\x20version\x20predicate.','defineProperty','\x20version\x20changed\x20before\x20write.','UTF-8\x20Markdown\x20file\x20(maximum\x205\x20MiB)','verified'];a192_0x3005=function(){return _0x26e406;};return a192_0x3005();}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='/smartapi/knowledge-base/save',NON_ATOMIC_WARNING=a192_0x25bfb8(0x154);function readSetInput(_0x1097a5){const _0x42675b=a192_0x25bfb8,_0x54a536=readAppRuleType(_0x1097a5),_0x987141=_0x1097a5[_0x42675b(0x17e)](_0x42675b(0x183))['trim']();if(!_0x987141)throw appRuleError(_0x42675b(0x152),_0x42675b(0x14e),_0x42675b(0x15c));const _0x516131=_0x1097a5[_0x42675b(0x18a)](_0x42675b(0x169));let _0x4c5126;if(_0x516131!==undefined){_0x4c5126=Number(_0x516131);if(!Number['isSafeInteger'](_0x4c5126)||_0x4c5126<0x0)throw appRuleError(_0x42675b(0x15d),_0x42675b(0x163));}return{'type':_0x54a536,'file':_0x987141,'expectedVersion':_0x4c5126};}async function prepareSet(_0x8da4eb){const _0x3e4396=a192_0x25bfb8,_0x19bf63=readSetInput(_0x8da4eb),_0x5f51e0=await readAppRuleFile(_0x19bf63[_0x3e4396(0x183)]),_0x52e511=await getAppRule(_0x8da4eb[_0x3e4396(0x16a)],{'appCode':_0x8da4eb['appCode'],'type':_0x19bf63[_0x3e4396(0x151)]});if(_0x19bf63['expectedVersion']!==undefined&&_0x52e511?.[_0x3e4396(0x187)]!==_0x19bf63['expectedVersion'])throw appRuleError(_0x3e4396(0x176),appRuleFileName(_0x19bf63[_0x3e4396(0x151)])+_0x3e4396(0x156),_0x3e4396(0x159)+_0x19bf63[_0x3e4396(0x185)]+_0x3e4396(0x162)+(_0x52e511?.[_0x3e4396(0x187)]??_0x3e4396(0x175))+_0x3e4396(0x160));return{'input':_0x19bf63,'replacement':_0x5f51e0,'beforeRecord':_0x52e511,'before':projectAppRule(_0x19bf63[_0x3e4396(0x151)],_0x52e511),'planned':{'type':_0x19bf63[_0x3e4396(0x151)],'fileName':appRuleFileName(_0x19bf63[_0x3e4396(0x151)]),'contextScope':appRuleContextScope(_0x19bf63[_0x3e4396(0x151)]),'enabled':!![],'appCode':_0x8da4eb[_0x3e4396(0x181)],'scope':_0x3e4396(0x15a),'contentByteSize':_0x5f51e0[_0x3e4396(0x16d)],'contentHash':_0x5f51e0[_0x3e4396(0x184)]}};}function a192_0x58a4(_0x34f40b,_0x2b73ed){_0x34f40b=_0x34f40b-0x14e;const _0x300560=a192_0x3005();let _0x58a453=_0x300560[_0x34f40b];return _0x58a453;}function warningsFor(_0x21b649){return _0x21b649===undefined?[]:[NON_ATOMIC_WARNING];}export const ruleSet={'service':a192_0x25bfb8(0x153),'command':'set','description':a192_0x25bfb8(0x178),'risk':a192_0x25bfb8(0x15b),'requiresAppCode':!![],'structuredErrors':!![],'flags':[APP_RULE_TYPE_FLAG,{'name':a192_0x25bfb8(0x183),'type':'string','required':!![],'description':a192_0x25bfb8(0x157)},{'name':a192_0x25bfb8(0x169),'type':a192_0x25bfb8(0x189),'required':![],'description':a192_0x25bfb8(0x167)}],async 'validate'(_0x3d1f49){readSetInput(_0x3d1f49);},async 'dryRun'(_0x15cd27){const _0x4fc164=a192_0x25bfb8,_0x2a9b4f=await prepareSet(_0x15cd27);return asDryRunResult({'operation':'set','selector':{'appCode':_0x15cd27[_0x4fc164(0x181)],'scope':_0x4fc164(0x15a),'type':_0x2a9b4f[_0x4fc164(0x186)][_0x4fc164(0x151)]},'before':_0x2a9b4f[_0x4fc164(0x173)],'after':_0x2a9b4f['planned'],'dryRun':!![],'backend':{'method':_0x4fc164(0x180),'path':SAVE_PATH},'warnings':warningsFor(_0x2a9b4f[_0x4fc164(0x186)][_0x4fc164(0x185)]),'verification':{'expectedVersion':_0x2a9b4f[_0x4fc164(0x186)]['expectedVersion']??null,'atomicCompareAndSet':![],'lookupCommand':_0x4fc164(0x16b)+_0x2a9b4f[_0x4fc164(0x186)][_0x4fc164(0x151)]+_0x4fc164(0x174)}},{'method':_0x4fc164(0x180),'url':SAVE_PATH});},async 'execute'(_0x41d811){const _0x2d406d=a192_0x25bfb8,_0x26557d=await prepareSet(_0x41d811);let _0x1ac5e5=![];try{await saveAppRule(_0x41d811['cookie'],{'appCode':_0x41d811[_0x2d406d(0x181)],'type':_0x26557d[_0x2d406d(0x186)][_0x2d406d(0x151)],'content':_0x26557d[_0x2d406d(0x17f)]['content']});}catch(_0x4c9b26){if(!isPlatformTransportFailure(_0x4c9b26))throw _0x4c9b26;_0x1ac5e5=!![];}let _0x3e997c;try{_0x3e997c=await getAppRule(_0x41d811[_0x2d406d(0x16a)],{'appCode':_0x41d811[_0x2d406d(0x181)],'type':_0x26557d['input'][_0x2d406d(0x151)]});}catch(_0xa1f206){const _0x5a4f99=appRuleError(_0x1ac5e5?_0x2d406d(0x182):'app_rule_verification_unavailable',_0x2d406d(0x17c)+appRuleFileName(_0x26557d[_0x2d406d(0x186)][_0x2d406d(0x151)])+_0x2d406d(0x177),_0x2d406d(0x168));Object[_0x2d406d(0x155)](_0x5a4f99,_0x2d406d(0x16c),{'value':_0xa1f206,'enumerable':![]});throw _0x5a4f99;}const _0x55b512=_0x3e997c&&inspectAppRuleContent(_0x3e997c[_0x2d406d(0x179)])[_0x2d406d(0x184)]===_0x26557d[_0x2d406d(0x17f)]['contentHash'],_0x168d6a=_0x3e997c&&(_0x26557d[_0x2d406d(0x150)]===null||_0x3e997c[_0x2d406d(0x187)]>_0x26557d['beforeRecord'][_0x2d406d(0x187)]);if(!_0x3e997c||!_0x55b512||!_0x168d6a)throw appRuleError(_0x1ac5e5?_0x2d406d(0x182):_0x2d406d(0x16e),appRuleFileName(_0x26557d[_0x2d406d(0x186)][_0x2d406d(0x151)])+_0x2d406d(0x170),_0x2d406d(0x188)+_0x26557d[_0x2d406d(0x186)][_0x2d406d(0x151)]+'\x20--format\x20compress`;\x20do\x20not\x20resubmit\x20automatically.');const _0x5066a5=warningsFor(_0x26557d[_0x2d406d(0x186)][_0x2d406d(0x185)]);_0x1ac5e5&&_0x5066a5[_0x2d406d(0x17b)](_0x2d406d(0x172));const _0x5db16f=projectAppRule(_0x26557d[_0x2d406d(0x186)]['type'],_0x3e997c);return{'ok':!![],'data':{'operation':_0x2d406d(0x166),'selector':{'appCode':_0x41d811['appCode'],'scope':_0x2d406d(0x15a),'type':_0x26557d[_0x2d406d(0x186)]['type']},'before':_0x26557d[_0x2d406d(0x173)],'after':_0x5db16f,'dryRun':![],'backend':{'method':'POST','path':SAVE_PATH},'warnings':_0x5066a5,'verification':{'status':_0x2d406d(0x158),'recoveredAfterUnknownResponse':_0x1ac5e5,'expectedVersion':_0x26557d['input'][_0x2d406d(0x185)]??null,'atomicCompareAndSet':![],'lookupCommand':_0x2d406d(0x16b)+_0x26557d[_0x2d406d(0x186)]['type']+_0x2d406d(0x174)}},'message':'Set\x20'+appRuleFileName(_0x26557d['input'][_0x2d406d(0x151)])+_0x2d406d(0x165)+_0x41d811[_0x2d406d(0x181)]};}};
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 +1 @@
1
- const a193_0x19dc4b=a193_0x2645;(function(_0x4110f4,_0x305701){const _0x3f6257=a193_0x2645,_0x1c9620=_0x4110f4();while(!![]){try{const _0x41ef5b=-parseInt(_0x3f6257(0x12a))/0x1+-parseInt(_0x3f6257(0x150))/0x2*(-parseInt(_0x3f6257(0x13f))/0x3)+parseInt(_0x3f6257(0x147))/0x4+parseInt(_0x3f6257(0x14a))/0x5*(parseInt(_0x3f6257(0x14f))/0x6)+-parseInt(_0x3f6257(0x149))/0x7+parseInt(_0x3f6257(0x12b))/0x8+-parseInt(_0x3f6257(0x14d))/0x9;if(_0x41ef5b===_0x305701)break;else _0x1c9620['push'](_0x1c9620['shift']());}catch(_0x2fef78){_0x1c9620['push'](_0x1c9620['shift']());}}}(a193_0x2a3b,0x7aa1b));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_0x19dc4b(0x153),a193_0x19dc4b(0x126)];export const MAX_APP_RULE_BYTES=0x5*0x400*0x400;function a193_0x2a3b(){const _0x3dbfc1=['size','2373259NSBZtv','15GOMyQS','hex','App\x20rule\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','4624092nanEHC','database-analysis','737598zzOCpF','210AIGnGO','utf8','appCode','rules','app_rule_file_required','database','DATABASE.md','app_rule_content_too_large','from','317791XiMZSM','1942112PRQAsO','sha256:','digest','string','Cannot\x20read\x20app\x20rule\x20file:\x20','isFile','app_rule_file_invalid','trim','message','App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.','utf-8','App\x20rule\x20file\x20is\x20blank:\x20','type','app_rule_file_unreadable','content','decode','RULES.md','byteSize','contentHash','--file\x20is\x20required.','26667qizrjo','str','app_rule_content_invalid','--type\x20must\x20be\x20either\x20rules\x20or\x20database.','createTime','app_rule_type_invalid','updateTime','Cannot\x20access\x20app\x20rule\x20file:\x20','512028jaXDFk'];a193_0x2a3b=function(){return _0x3dbfc1;};return a193_0x2a3b();}const APP_RULE_FILES={'rules':a193_0x19dc4b(0x13b),'database':a193_0x19dc4b(0x127)},APP_RULE_CONTEXT_SCOPES={'rules':'page-api-development','database':a193_0x19dc4b(0x14e)};export function appRuleError(_0x2fc297,_0x2e7917,_0x3d4cca){return new CliError(_0x2fc297,0x1,_0x2e7917,_0x3d4cca);}export function readAppRuleType(_0x504d84){const _0x57cf15=a193_0x19dc4b,_0x20d639=_0x504d84[_0x57cf15(0x140)]('type')[_0x57cf15(0x132)]()['toLowerCase']();if(_0x20d639!==_0x57cf15(0x153)&&_0x20d639!==_0x57cf15(0x126))throw appRuleError(_0x57cf15(0x144),_0x57cf15(0x142));return _0x20d639;}export function appRuleFileName(_0x1cbde0){return APP_RULE_FILES[_0x1cbde0];}export function appRuleContextScope(_0x496673){return APP_RULE_CONTEXT_SCOPES[_0x496673];}export function inspectAppRuleContent(_0x17af21){const _0x315d3c=a193_0x19dc4b,_0x430fb2=Buffer[_0x315d3c(0x129)](_0x17af21,_0x315d3c(0x151));return{'content':_0x17af21,'byteSize':_0x430fb2['byteLength'],'contentHash':_0x315d3c(0x12c)+createHash('sha256')['update'](_0x430fb2)[_0x315d3c(0x12d)](_0x315d3c(0x14b))};}export async function readAppRuleFile(_0x34fe25){const _0x512c08=a193_0x19dc4b,_0x5d10fb=_0x34fe25[_0x512c08(0x132)]();if(!_0x5d10fb)throw appRuleError(_0x512c08(0x125),_0x512c08(0x13e),'Pass\x20a\x20UTF-8\x20Markdown\x20file.');const _0x290d7d=resolve(_0x5d10fb);let _0x1b81df;try{_0x1b81df=await stat(_0x290d7d);}catch(_0x31846a){throw appRuleError(_0x512c08(0x138),_0x512c08(0x146)+_0x5d10fb,_0x31846a instanceof Error?_0x31846a[_0x512c08(0x133)]:String(_0x31846a));}if(!_0x1b81df[_0x512c08(0x130)]())throw appRuleError(_0x512c08(0x131),_0x512c08(0x14c)+_0x5d10fb);if(_0x1b81df[_0x512c08(0x148)]>MAX_APP_RULE_BYTES)throw appRuleError(_0x512c08(0x128),_0x512c08(0x134));let _0x4f57cf;try{_0x4f57cf=await readFile(_0x290d7d);}catch(_0x4db23e){throw appRuleError(_0x512c08(0x138),_0x512c08(0x12f)+_0x5d10fb,_0x4db23e instanceof Error?_0x4db23e['message']:String(_0x4db23e));}if(_0x4f57cf['byteLength']>MAX_APP_RULE_BYTES)throw appRuleError(_0x512c08(0x128),'App\x20rule\x20content\x20exceeds\x20the\x205\x20MiB\x20server\x20limit.');let _0x1c1a48;try{_0x1c1a48=new TextDecoder(_0x512c08(0x135),{'fatal':!![],'ignoreBOM':!![]})[_0x512c08(0x13a)](_0x4f57cf);}catch{throw appRuleError(_0x512c08(0x141),'App\x20rule\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x5d10fb);}if(!_0x1c1a48[_0x512c08(0x132)]())throw appRuleError('app_rule_content_invalid',_0x512c08(0x136)+_0x5d10fb);return inspectAppRuleContent(_0x1c1a48);}export function projectAppRule(_0x5efbfa,_0x18f211){const _0x3fa4c4=a193_0x19dc4b;if(!_0x18f211)return{'type':_0x5efbfa,'fileName':appRuleFileName(_0x5efbfa),'contextScope':appRuleContextScope(_0x5efbfa),'enabled':![]};const _0x2fe916=inspectAppRuleContent(_0x18f211[_0x3fa4c4(0x139)]);return{'type':_0x5efbfa,'fileName':appRuleFileName(_0x5efbfa),'contextScope':appRuleContextScope(_0x5efbfa),'enabled':!![],'id':_0x18f211['id'],'scope':_0x18f211['scope'],'appCode':_0x18f211[_0x3fa4c4(0x152)],'version':_0x18f211['version'],'contentByteSize':_0x2fe916[_0x3fa4c4(0x13c)],'contentHash':_0x2fe916[_0x3fa4c4(0x13d)],..._0x18f211[_0x3fa4c4(0x143)]!==undefined&&_0x18f211['createTime']!==null?{'createTime':_0x18f211[_0x3fa4c4(0x143)]}:{},..._0x18f211[_0x3fa4c4(0x145)]!==undefined&&_0x18f211[_0x3fa4c4(0x145)]!==null?{'updateTime':_0x18f211['updateTime']}:{}};}function a193_0x2645(_0x2b5e31,_0x3df98c){_0x2b5e31=_0x2b5e31-0x125;const _0x2a3bc6=a193_0x2a3b();let _0x2645eb=_0x2a3bc6[_0x2b5e31];return _0x2645eb;}export const APP_RULE_TYPE_FLAG={'name':a193_0x19dc4b(0x137),'type':a193_0x19dc4b(0x12e),'required':!![],'description':'Context\x20rule\x20type:\x20rules\x20for\x20page/API\x20development\x20agents\x20(DB\x20Agent\x20excluded),\x20database\x20for\x20DB\x20Agent\x20database\x20analysis','enum':[...APP_RULE_TYPES]};
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 +1 @@
1
- const a194_0x306f5c=a194_0x1de1;function a194_0x34a9(){const _0x2b39a5=['yarn','push','slice','\x0a\x20\x20Available\x20scripts:\x0a','start','744136lNFdic','bool','join','\x20\x20EXAMPLES','package.json','15GqRMYq','validation','Script\x20\x22','vite\x20preview\x20exited\x20with\x20code\x20','6287310FLGlno','dev','No\x20scripts\x20defined\x20in\x20package.json.','belowMinimum','close','.bin','has','\x20\x20\x20\x20','log','bun','keys','108Iopkmp','vite','28EWiIUf','\x20run\x20<script>\x0a','52064ljhrag','length','333720pbhCKh','node_modules','3237021EbrVYr','preview','bun.lockb','error','inherit','\x20run\x20preview\x20--watch','scripts','cwd','180697bZnUiT','write','pnpm-lock.yaml','args','11595RRYoRY','--watch','parse'];a194_0x34a9=function(){return _0x2b39a5;};return a194_0x34a9();}(function(_0x5f00f4,_0x3ef0f7){const _0x33a093=a194_0x1de1,_0x18911f=_0x5f00f4();while(!![]){try{const _0x399df6=parseInt(_0x33a093(0x173))/0x1+parseInt(_0x33a093(0x163))/0x2*(parseInt(_0x33a093(0x177))/0x3)+-parseInt(_0x33a093(0x167))/0x4*(-parseInt(_0x33a093(0x154))/0x5)+-parseInt(_0x33a093(0x169))/0x6+-parseInt(_0x33a093(0x165))/0x7*(parseInt(_0x33a093(0x14f))/0x8)+-parseInt(_0x33a093(0x16b))/0x9+parseInt(_0x33a093(0x158))/0xa;if(_0x399df6===_0x3ef0f7)break;else _0x18911f['push'](_0x18911f['shift']());}catch(_0x1471dc){_0x18911f['push'](_0x18911f['shift']());}}}(a194_0x34a9,0x41e05));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';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_0x306f5c(0x14e),a194_0x306f5c(0x159)]);function readPackageScripts(_0x471110){const _0x51a94f=a194_0x306f5c,_0x28fecd=resolve(_0x471110,_0x51a94f(0x153));if(!existsSync(_0x28fecd))return null;try{const _0x26a893=JSON[_0x51a94f(0x179)](readFileSync(_0x28fecd,'utf-8'));return _0x26a893[_0x51a94f(0x171)]??{};}catch{return null;}}function detectPackageManager(_0x29c80d){const _0x58400b=a194_0x306f5c;if(existsSync(resolve(_0x29c80d,_0x58400b(0x16d)))||existsSync(resolve(_0x29c80d,'bun.lock')))return _0x58400b(0x161);if(existsSync(resolve(_0x29c80d,_0x58400b(0x175))))return'pnpm';if(existsSync(resolve(_0x29c80d,'yarn.lock')))return _0x58400b(0x17a);return'npm';}async function versionCheck(_0x261f1f){const _0x1ddcd1=a194_0x306f5c,_0x2ed71f=await checkCliVersion();(_0x2ed71f['needsUpgrade']||_0x2ed71f[_0x1ddcd1(0x15b)])&&(printCliUpgradeWarning(_0x2ed71f),assertCliVersionSupported(_0x2ed71f));const _0x1dd087=await checkSdkVersion(_0x261f1f);if(_0x1dd087['needsUpgrade'])printSdkUpgradeWarning(_0x1dd087);}function spawnScript(_0x168bc2,_0x3a63c5,_0x275285,_0x599d66){return new Promise((_0x3e4bee,_0x1b0f72)=>{const _0x2c360d=a194_0x1de1,_0x5ebe2f=['run',_0x3a63c5,..._0x275285],_0x391a29=spawn(_0x168bc2,_0x5ebe2f,{'cwd':_0x599d66,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x599d66,_0x2c360d(0x16a),'.bin')+delimiter+process.env.PATH}});_0x391a29['on'](_0x2c360d(0x15c),_0x4c8001=>{if(_0x4c8001===0x0||_0x4c8001===null)_0x3e4bee();else _0x1b0f72(new Error(_0x168bc2+'\x20run\x20'+_0x3a63c5+'\x20exited\x20with\x20code\x20'+_0x4c8001));}),_0x391a29['on'](_0x2c360d(0x16e),_0x1b0f72);});}function a194_0x1de1(_0xa5a763,_0x6ef9de){_0xa5a763=_0xa5a763-0x14c;const _0x34a9d8=a194_0x34a9();let _0x1de1fb=_0x34a9d8[_0xa5a763];return _0x1de1fb;}function spawnViteBuildWatch(_0x2c0768){return new Promise((_0x2512f5,_0x21bb71)=>{const _0x249887=a194_0x1de1,_0x3eb618=spawn(_0x249887(0x164),['build',_0x249887(0x178)],{'cwd':_0x2c0768,'stdio':_0x249887(0x16f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2c0768,_0x249887(0x16a),_0x249887(0x15d))+delimiter+process.env.PATH}});_0x3eb618['on']('close',_0x4740c7=>{if(_0x4740c7===0x0||_0x4740c7===null)_0x2512f5();else _0x21bb71(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x4740c7));}),_0x3eb618['on'](_0x249887(0x16e),_0x21bb71);});}function spawnVitePreview(_0x4c116f){return new Promise((_0x54933b,_0x3d0c2c)=>{const _0x4b2a9a=a194_0x1de1,_0x4ab5fb=spawn(_0x4b2a9a(0x164),['preview'],{'cwd':_0x4c116f,'stdio':_0x4b2a9a(0x16f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x4c116f,_0x4b2a9a(0x16a),_0x4b2a9a(0x15d))+delimiter+process.env.PATH}});_0x4ab5fb['on'](_0x4b2a9a(0x15c),_0x5f12b1=>{const _0x53137d=_0x4b2a9a;if(_0x5f12b1===0x0||_0x5f12b1===null)_0x54933b();else _0x3d0c2c(new Error(_0x53137d(0x157)+_0x5f12b1));}),_0x4ab5fb['on'](_0x4b2a9a(0x16e),_0x3d0c2c);});}const runFlags=[{'name':'watch','type':'boolean','description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':'run','command':'run','description':'Run\x20a\x20package.json\x20script','risk':a194_0x306f5c(0x174),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x2248d7=a194_0x306f5c,_0x31374f=[];return _0x31374f[_0x2248d7(0x17b)](_0x2248d7(0x152)),_0x31374f[_0x2248d7(0x17b)](_0x2248d7(0x15f)+CLI_BIN_NAME+'\x20run\x20start'),_0x31374f[_0x2248d7(0x17b)](_0x2248d7(0x15f)+CLI_BIN_NAME+'\x20run\x20build'),_0x31374f['push'](_0x2248d7(0x15f)+CLI_BIN_NAME+'\x20run\x20preview'),_0x31374f[_0x2248d7(0x17b)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x2248d7(0x170)),_0x31374f['join']('\x0a');},async 'execute'(_0x4bf350){const _0x43d2f8=a194_0x306f5c,_0x398c24=process[_0x43d2f8(0x172)](),_0x14abf8=_0x4bf350[_0x43d2f8(0x176)][0x0],_0x3c9004=_0x4bf350['args'][_0x43d2f8(0x14c)](0x1),_0x17c3d4=readPackageScripts(_0x398c24);if(!_0x17c3d4)throw CliErrors[_0x43d2f8(0x155)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x14abf8){const _0x182b8c=Object[_0x43d2f8(0x162)](_0x17c3d4);if(_0x182b8c[_0x43d2f8(0x168)]===0x0)console[_0x43d2f8(0x160)](_0x43d2f8(0x15a));else{console[_0x43d2f8(0x160)](_0x43d2f8(0x14d));for(const _0x2e6cd3 of _0x182b8c){console[_0x43d2f8(0x160)](_0x43d2f8(0x15f)+_0x2e6cd3);}console[_0x43d2f8(0x160)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x43d2f8(0x166));}return{'ok':!![]};}if(!_0x17c3d4[_0x14abf8])throw CliErrors[_0x43d2f8(0x155)](_0x43d2f8(0x156)+_0x14abf8+'\x22\x20not\x20found\x20in\x20package.json.','Available:\x20'+(Object[_0x43d2f8(0x162)](_0x17c3d4)[_0x43d2f8(0x151)](',\x20')||'(none)'));const _0x4ec804=detectPackageManager(_0x398c24);VERSION_CHECK_SCRIPTS[_0x43d2f8(0x15e)](_0x14abf8)&&await versionCheck(_0x398c24);if(_0x14abf8===_0x43d2f8(0x16c)&&_0x4bf350[_0x43d2f8(0x150)]('watch'))return await Promise['all']([spawnViteBuildWatch(_0x398c24),spawnVitePreview(_0x398c24)]),{'ok':!![]};return await spawnScript(_0x4ec804,_0x14abf8,_0x3c9004,_0x398c24),{'ok':!![]};}};
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 +1 @@
1
- function a195_0x5a20(_0x78bc67,_0x21d937){_0x78bc67=_0x78bc67-0x149;const _0x1a3349=a195_0x1a33();let _0x5a20ed=_0x1a3349[_0x78bc67];return _0x5a20ed;}const a195_0xd31dd5=a195_0x5a20;(function(_0x147749,_0x527479){const _0x5a5c12=a195_0x5a20,_0x39e139=_0x147749();while(!![]){try{const _0x2bdcf1=-parseInt(_0x5a5c12(0x154))/0x1+-parseInt(_0x5a5c12(0x151))/0x2*(-parseInt(_0x5a5c12(0x14f))/0x3)+parseInt(_0x5a5c12(0x14c))/0x4+parseInt(_0x5a5c12(0x152))/0x5+parseInt(_0x5a5c12(0x149))/0x6*(parseInt(_0x5a5c12(0x14e))/0x7)+parseInt(_0x5a5c12(0x14b))/0x8+-parseInt(_0x5a5c12(0x14d))/0x9*(parseInt(_0x5a5c12(0x155))/0xa);if(_0x2bdcf1===_0x527479)break;else _0x39e139['push'](_0x39e139['shift']());}catch(_0x2f5e51){_0x39e139['push'](_0x39e139['shift']());}}}(a195_0x1a33,0x96230));function a195_0x1a33(){const _0x14978e=['30843FElaiE','35lKluyl','6qQcyMh','json','140928DYqOzI','4127145lOBADn','export','1085768TiXiNC','90yxJujc','55536nIXaSd','schema','1587112lKGqFa','2082180bZezUB'];a195_0x1a33=function(){return _0x14978e;};return a195_0x1a33();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2d5723){const _0x2c7504=await buildSchemaPayload();return{'ok':!![],'data':_0x2c7504};}export const schemaDefinition={'service':a195_0xd31dd5(0x14a),'command':a195_0xd31dd5(0x153),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a195_0xd31dd5(0x150),'flags':[],'execute':execute};
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 +1 @@
1
- function a196_0x1942(_0x24f201,_0x452333){_0x24f201=_0x24f201-0x182;const _0x4e4611=a196_0x4e46();let _0x1942e4=_0x4e4611[_0x24f201];return _0x1942e4;}const a196_0x2670dc=a196_0x1942;(function(_0x5a6625,_0x2816d9){const _0x144951=a196_0x1942,_0x833367=_0x5a6625();while(!![]){try{const _0x28f1b6=-parseInt(_0x144951(0x1c7))/0x1+parseInt(_0x144951(0x1ba))/0x2+-parseInt(_0x144951(0x1bf))/0x3+-parseInt(_0x144951(0x1c2))/0x4*(parseInt(_0x144951(0x182))/0x5)+parseInt(_0x144951(0x1ac))/0x6+-parseInt(_0x144951(0x190))/0x7*(parseInt(_0x144951(0x18b))/0x8)+parseInt(_0x144951(0x1a1))/0x9;if(_0x28f1b6===_0x2816d9)break;else _0x833367['push'](_0x833367['shift']());}catch(_0x9470e8){_0x833367['push'](_0x833367['shift']());}}}(a196_0x4e46,0x1cc3c));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(_0x2a973b){const _0x12fdf8=a196_0x1942;if(_0x2a973b===_0x12fdf8(0x183))return[_0x12fdf8(0x19b),_0x12fdf8(0x1a3),_0x12fdf8(0x1a7),''][_0x12fdf8(0x19c)]('\x0a');return[_0x12fdf8(0x1a9),''][_0x12fdf8(0x19c)]('\x0a');}export const sqlCreate={'service':a196_0x2670dc(0x1ab),'command':'create','description':a196_0x2670dc(0x187),'risk':a196_0x2670dc(0x19d),'flags':[{'name':a196_0x2670dc(0x18a),'type':'string','description':a196_0x2670dc(0x198)},{'name':a196_0x2670dc(0x186),'type':a196_0x2670dc(0x185),'description':a196_0x2670dc(0x1af)},{'name':a196_0x2670dc(0x191),'type':a196_0x2670dc(0x1b1),'enum':[a196_0x2670dc(0x1ab),a196_0x2670dc(0x183)],'description':a196_0x2670dc(0x1be)}],async 'validate'(_0x169059){const _0x3267d6=a196_0x2670dc;if(!_0x169059[_0x3267d6(0x1c6)])return;if(!_0x169059[_0x3267d6(0x1a2)](_0x3267d6(0x18a))[_0x3267d6(0x188)]())throw CliErrors[_0x3267d6(0x1b7)](_0x3267d6(0x18a),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x24a63a=resolveProvidedDbId(_0x169059);if(typeof _0x24a63a!==_0x3267d6(0x185)||!Number['isFinite'](_0x24a63a)||_0x24a63a<=0x0)throw CliErrors[_0x3267d6(0x1b7)](_0x3267d6(0x186),_0x3267d6(0x1ae));if(!_0x169059[_0x3267d6(0x1a2)](_0x3267d6(0x191))[_0x3267d6(0x188)]())throw CliErrors['flagMissing'](_0x3267d6(0x191),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x41fcd3){const _0x45f8cf=a196_0x2670dc,_0x51ecc3=loadSqlProjectConfig(_0x41fcd3[_0x45f8cf(0x184)]),{sqlName:_0x38c39e,dbId:_0x18742b,dbName:_0x765f3f,mode:_0x5cefc9}=await resolveSqlNewInputs(_0x41fcd3),_0x403267=buildSqlRelativePath(_0x45f8cf(0x193),_0x38c39e,_0x765f3f,_0x5cefc9,_0x18742b),_0xe1aed4=_0x51ecc3[_0x45f8cf(0x18d)]+'/'+_0x403267;return{'method':_0x45f8cf(0x196),'url':_0x45f8cf(0x1c1),'body':{'appCode':_0x41fcd3[_0x45f8cf(0x184)],'sqlName':_0x38c39e,'dbId':_0x18742b,'mode':_0x5cefc9,'localPath':_0xe1aed4},'description':_0x45f8cf(0x19f)+_0x51ecc3[_0x45f8cf(0x18d)]};},async 'execute'(_0x24dc26){const _0x47d813=a196_0x2670dc,_0x4fbf96=loadSqlProjectConfig(_0x24dc26[_0x47d813(0x184)]),{sqlName:_0x238cff,dbId:_0x13e75a,dbName:_0x41c177,mode:_0x520294}=await resolveSqlNewInputs(_0x24dc26),_0x59492c=generateSqlTemplate(_0x520294),_0x45db92=await createSqlQuery({'appCode':_0x24dc26['appCode'],'sqlName':_0x238cff,'dbId':_0x13e75a,'sqlContent':_0x59492c}),_0x59fb84=ensureRemoteSqlContent(_0x45db92),_0x2ccd76=_0x41c177||await getDbName(_0x24dc26[_0x47d813(0x184)],_0x13e75a)[_0x47d813(0x1b6)](()=>undefined),_0x58fb11=buildSqlRelativePath(_0x45db92[_0x47d813(0x1a5)],_0x45db92[_0x47d813(0x1bc)],_0x2ccd76,_0x520294,_0x13e75a),_0x152675=_0x4fbf96[_0x47d813(0x18d)]+'/'+_0x58fb11,_0x414b88=buildLocalSqlFileContent({'sqlCode':_0x45db92[_0x47d813(0x1a5)],'sqlName':_0x45db92['sqlName'],'dbId':_0x45db92[_0x47d813(0x1ad)]},_0x59fb84,{'dbName':_0x2ccd76,'mode':_0x520294,'syncedAt':new Date()['toISOString'](),'description':_0x45db92[_0x47d813(0x1c0)]});if(await fileExists(_0x152675))throw CliErrors['validation'](_0x47d813(0x18e)+_0x152675);await ensureParentDirectory(_0x152675),await writeFile(_0x152675,_0x414b88,_0x47d813(0x1a8));const _0x908f7d=await readSqlLockFile(_0x4fbf96['lockFilePath']),{lockData:_0x57356f,appLock:_0x63a43a}=ensureSqlLockScope(_0x908f7d??createEmptySqlLock(),_0x4fbf96[_0x47d813(0x184)],_0x4fbf96['sqlRoot'],_0x47d813(0x1b4));return _0x63a43a[_0x47d813(0x1b3)][_0x45db92[_0x47d813(0x1a5)]]={...buildSqlLockEntry(_0x45db92,_0x59fb84,computeSqlContentHash(_0x414b88),{'dbName':_0x2ccd76}),'path':_0x58fb11,'mode':_0x520294},_0x63a43a[_0x47d813(0x1b0)]=new Date()[_0x47d813(0x18f)](),await writeSqlLockFile(_0x4fbf96[_0x47d813(0x1b2)],_0x57356f),{'ok':!![],'data':{'id':_0x45db92['id'],'sqlCode':_0x45db92[_0x47d813(0x1a5)],'sqlName':_0x45db92[_0x47d813(0x1bc)],'dbId':_0x45db92['dbId'],'path':_0x152675,'mode':_0x520294},'message':_0x47d813(0x199)+_0x45db92[_0x47d813(0x1a5)]};}};async function resolveSqlNewInputs(_0x282e4a){const _0x3032f2=await resolveSqlNameInput(_0x282e4a),{dbId:_0x1960e2,dbName:_0x163f69}=await resolveDbSelection(_0x282e4a),_0x327346=await resolveSqlModeInput(_0x282e4a);return{'sqlName':_0x3032f2,'dbId':_0x1960e2,'dbName':_0x163f69,'mode':_0x327346};}async function resolveSqlNameInput(_0x214ea7){const _0x28963c=a196_0x2670dc,_0x5f32b3=_0x214ea7[_0x28963c(0x1a2)]('name')[_0x28963c(0x188)]();if(_0x5f32b3)return _0x5f32b3;if(_0x214ea7[_0x28963c(0x1c6)])throw CliErrors[_0x28963c(0x1b7)](_0x28963c(0x18a),_0x28963c(0x1a6));return(await input({'message':'SQL\x20name:','validate':_0x57e3bb=>_0x57e3bb[_0x28963c(0x188)]()?!![]:_0x28963c(0x194)}))['trim']();}async function resolveDbSelection(_0x172148){const _0x13cb8b=a196_0x2670dc,_0x501a0f=resolveProvidedDbId(_0x172148);if(typeof _0x501a0f===_0x13cb8b(0x185)&&Number[_0x13cb8b(0x1c3)](_0x501a0f)&&_0x501a0f>0x0)return{'dbId':_0x501a0f,'dbName':await getDbName(_0x172148[_0x13cb8b(0x184)],_0x501a0f)['catch'](()=>undefined)};if(_0x172148['nonInteractive'])throw CliErrors[_0x13cb8b(0x1b7)](_0x13cb8b(0x186),_0x13cb8b(0x1ae));const _0x5e9723=await listDatabases(_0x172148[_0x13cb8b(0x184)])[_0x13cb8b(0x1b6)](()=>[]);if(_0x5e9723[_0x13cb8b(0x1a4)]===0x1)return{'dbId':_0x5e9723[0x0][_0x13cb8b(0x1ad)],'dbName':_0x5e9723[0x0][_0x13cb8b(0x1c5)]};if(_0x5e9723[_0x13cb8b(0x1a4)]>0x1){const _0x4804e3=await select({'message':'Select\x20the\x20target\x20database:','choices':[..._0x5e9723[_0x13cb8b(0x1bd)](_0x5db211=>({'name':_0x5db211[_0x13cb8b(0x1c5)]+'\x20('+_0x5db211[_0x13cb8b(0x1ad)]+')','value':serializeDbSelection(_0x5db211)})),{'name':_0x13cb8b(0x18c),'value':'__manual__'}]});if(_0x4804e3!=='__manual__')return deserializeDbSelection(_0x4804e3);}const _0xb98cd5=await input({'message':_0x13cb8b(0x192),'validate':_0x4dff38=>{const _0x161a88=_0x13cb8b,_0x1052d8=_0x4dff38['trim']();if(!_0x1052d8)return _0x161a88(0x19e);const _0x15bfb0=Number(_0x1052d8);if(!Number[_0x161a88(0x19a)](_0x15bfb0)||_0x15bfb0<=0x0)return _0x161a88(0x1b9);return!![];}});return{'dbId':Number(_0xb98cd5[_0x13cb8b(0x188)]())};}async function resolveSqlModeInput(_0x25998b){const _0x27df0b=a196_0x2670dc,_0x58f06f=_0x25998b[_0x27df0b(0x1a2)](_0x27df0b(0x191))[_0x27df0b(0x188)]();if(_0x58f06f===_0x27df0b(0x1ab)||_0x58f06f==='mybatisXml')return _0x58f06f;if(_0x25998b[_0x27df0b(0x1c6)])throw CliErrors[_0x27df0b(0x1b7)](_0x27df0b(0x191),_0x27df0b(0x1aa));return await select({'message':'Select\x20the\x20local\x20SQL\x20mode:','choices':[{'name':_0x27df0b(0x1a0),'value':'sql','description':_0x27df0b(0x1bb)},{'name':_0x27df0b(0x195),'value':_0x27df0b(0x183),'description':_0x27df0b(0x1b8)}]});}function serializeDbSelection(_0xf961b3){const _0x1d4085=a196_0x2670dc;return JSON[_0x1d4085(0x1b5)]({'dbId':_0xf961b3[_0x1d4085(0x1ad)],'dbName':_0xf961b3[_0x1d4085(0x1c5)]});}function a196_0x4e46(){const _0x4c71d4=['183164eaUBBy','isFinite','validation','dbName','nonInteractive','72363YPfipt','20saVyoc','mybatisXml','appCode','number','db-id','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','trim','flag','name','1703576scuBbx','✎\x20Enter\x20dbId\x20manually','sqlRootDir','File\x20already\x20exists:\x20','toISOString','7NULRbW','mode','Target\x20database\x20dbId:','<server-generated-sqlCode>','SQL\x20name\x20cannot\x20be\x20empty','MyBatis\x20XML\x20(mybatisXml)','POST','Invalid\x20database\x20selection\x20payload:\x20','SQL\x20query\x20display\x20name','Created\x20SQL\x20query\x20','isInteger','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','join','write','dbId\x20cannot\x20be\x20empty','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','Plain\x20SQL\x20(sql)','4866183ViUcdw','str','\x20\x20SELECT\x201\x20AS\x20id','length','sqlCode','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','</select>','utf8','SELECT\x201\x20AS\x20id;','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','sql','23262xQFPTx','dbId','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20ID','lastSync','string','lockFilePath','sqls','new','stringify','catch','flagMissing','For\x20MyBatis\x20XML\x20SQL\x20with\x20dynamic\x20tags','dbId\x20must\x20be\x20a\x20positive\x20integer','154932FxzOGi','For\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20statements\x20that\x20run\x20directly','sqlName','map','Local\x20SQL\x20file\x20mode','107208VPJIRx','description','/smartapi/custom/saveUserCustomSql'];a196_0x4e46=function(){return _0x4c71d4;};return a196_0x4e46();}function deserializeDbSelection(_0x9e7ce1){const _0x1ef66b=a196_0x2670dc;try{const _0x308824=JSON['parse'](_0x9e7ce1);if(typeof _0x308824[_0x1ef66b(0x1ad)]===_0x1ef66b(0x185)&&Number[_0x1ef66b(0x1c3)](_0x308824[_0x1ef66b(0x1ad)]))return{'dbId':_0x308824[_0x1ef66b(0x1ad)],'dbName':_0x308824[_0x1ef66b(0x1c5)]};}catch{}throw CliErrors[_0x1ef66b(0x1c4)](_0x1ef66b(0x197)+_0x9e7ce1);}function resolveProvidedDbId(_0x49bea0){const _0x4d6c75=a196_0x2670dc,_0x17b054=_0x49bea0[_0x4d6c75(0x189)](_0x4d6c75(0x186));if(typeof _0x17b054===_0x4d6c75(0x185)&&Number[_0x4d6c75(0x1c3)](_0x17b054))return _0x17b054;return undefined;}
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 +1 @@
1
- const a197_0x2f9250=a197_0x5796;(function(_0x28d824,_0x46cd4a){const _0x21f3ba=a197_0x5796,_0x2a4f39=_0x28d824();while(!![]){try{const _0x1797e9=-parseInt(_0x21f3ba(0x92))/0x1*(parseInt(_0x21f3ba(0xa1))/0x2)+-parseInt(_0x21f3ba(0xad))/0x3*(parseInt(_0x21f3ba(0x95))/0x4)+-parseInt(_0x21f3ba(0x9e))/0x5+-parseInt(_0x21f3ba(0x94))/0x6+parseInt(_0x21f3ba(0x96))/0x7*(-parseInt(_0x21f3ba(0x99))/0x8)+-parseInt(_0x21f3ba(0xae))/0x9+parseInt(_0x21f3ba(0xac))/0xa;if(_0x1797e9===_0x46cd4a)break;else _0x2a4f39['push'](_0x2a4f39['shift']());}catch(_0xeb96f5){_0x2a4f39['push'](_0x2a4f39['shift']());}}}(a197_0x2bae,0x57af9));function a197_0x5796(_0x28d56b,_0x11f942){_0x28d56b=_0x28d56b-0x91;const _0x2bae6b=a197_0x2bae();let _0x5796e8=_0x2bae6b[_0x28d56b];return _0x5796e8;}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';function a197_0x2bae(){const _0x1475f1=['trashDir','appCode','startsWith','2814890nJAglN','projectRoot','sqlcode','4358WKbhoG','replace','toISOString','fromEntries','\x20(local\x20file\x20moved\x20to\x20trash)','validation','lastSync','delete','length','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','remoteId','23573230xikLtH','14070aUBIZq','4579794lSEVYt','filter','Deleted\x20','/smartapi/custom/deleteUserCustomSql','lockFilePath','sqlRoot','7EomQcY','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','2388534viCfbp','128kxmcoH','8582hMdgUH','str','sqls','2368tbPUGS','SQL\x20lock\x20file\x20not\x20found.'];a197_0x2bae=function(){return _0x1475f1;};return a197_0x2bae();}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':'sql','command':'delete','description':a197_0x2f9250(0x93),'risk':'high-risk-write','flags':[SQLCODE_FLAG],async 'validate'(_0x3328a1){const _0x555acb=a197_0x2f9250,_0xbd6cfc=loadSqlProjectConfig(_0x3328a1[_0x555acb(0x9c)]),_0x3380f0=await readSqlLockFile(_0xbd6cfc[_0x555acb(0xb2)]);if(!_0x3380f0)throw CliErrors[_0x555acb(0xa6)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x4003cc){const _0x419409=a197_0x2f9250,_0x47af25=loadSqlProjectConfig(_0x4003cc[_0x419409(0x9c)]),_0x1a7b6d=await readSqlLockFile(_0x47af25[_0x419409(0xb2)]);if(!_0x1a7b6d)throw CliErrors[_0x419409(0xa6)]('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');const {appLock:_0x5a0d32}=ensureSqlLockScope(_0x1a7b6d,_0x4003cc['appCode'],_0x47af25[_0x419409(0x91)],_0x419409(0xa8)),_0x17ad9e=_0x4003cc[_0x419409(0x97)](_0x419409(0xa0)),_0x459cc9=_0x5a0d32[_0x419409(0x98)][_0x17ad9e];if(!_0x459cc9)throw CliErrors[_0x419409(0xa6)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x17ad9e+'\x22.');return{'method':'POST','url':_0x419409(0xb1),'body':{'sqlCode':_0x17ad9e,'id':_0x459cc9[_0x419409(0xab)],'localPath':resolveLocalSqlFilePath(_0x47af25,_0x17ad9e,_0x459cc9)},'description':'Would\x20delete\x20SQL\x20'+_0x17ad9e+_0x419409(0xaa)+_0x47af25[_0x419409(0x9b)]};},async 'execute'(_0x55d061){const _0xd8d7ae=a197_0x2f9250,_0x24082b=loadSqlProjectConfig(_0x55d061['appCode']),_0x5e0236=await readSqlLockFile(_0x24082b['lockFilePath']);if(!_0x5e0236)throw CliErrors[_0xd8d7ae(0xa6)](_0xd8d7ae(0x9a));const {lockData:_0x325b24,appLock:_0xb3f881}=ensureSqlLockScope(_0x5e0236,_0x55d061[_0xd8d7ae(0x9c)],_0x24082b[_0xd8d7ae(0x91)],_0xd8d7ae(0xa8)),_0x5593a0=_0x55d061[_0xd8d7ae(0x97)](_0xd8d7ae(0xa0)),_0x4d2266=_0xb3f881['sqls'][_0x5593a0];if(!_0x4d2266)throw CliErrors[_0xd8d7ae(0xa6)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x5593a0+'\x22.');await deleteSqlQuery({'id':_0x4d2266[_0xd8d7ae(0xab)],'sqlCode':_0x5593a0}),_0xb3f881[_0xd8d7ae(0x98)]=Object[_0xd8d7ae(0xa4)](Object['entries'](_0xb3f881[_0xd8d7ae(0x98)])[_0xd8d7ae(0xaf)](([_0x40fa17])=>_0x40fa17!==_0x5593a0)),_0xb3f881[_0xd8d7ae(0xa7)]=new Date()[_0xd8d7ae(0xa3)](),await writeSqlLockFile(_0x24082b[_0xd8d7ae(0xb2)],_0x325b24);const _0x4f1db6=resolveLocalSqlFilePath(_0x24082b,_0x5593a0,_0x4d2266);let _0xa84cc1;await fileExists(_0x4f1db6)&&(_0xa84cc1=await moveToTrash(_0x24082b[_0xd8d7ae(0x9f)],_0x24082b[_0xd8d7ae(0x9b)],_0x4f1db6),await cleanupEmptyDirectories(dirname(_0x4f1db6),_0x24082b['sqlRootDir']));const _0x5858ca={'deleted':_0x5593a0,'remoteId':_0x4d2266['remoteId']};if(_0xa84cc1)_0x5858ca['trashedTo']=_0xa84cc1;return{'ok':!![],'data':_0x5858ca,'message':_0xd8d7ae(0xb0)+_0x5593a0+(_0xa84cc1?_0xd8d7ae(0xa5):'')};}};async function moveToTrash(_0x231aae,_0x209d3d,_0x296ed5){const _0x1d5ab9=a197_0x2f9250,_0x46eefa=new Date()[_0x1d5ab9(0xa3)]()[_0x1d5ab9(0xa2)](/[:.]/g,'-'),_0x343e43=relative(_0x231aae,_0x296ed5),_0x122ae8=join(_0x209d3d,_0x46eefa,_0x343e43);return await mkdir(dirname(_0x122ae8),{'recursive':!![]}),await rename(_0x296ed5,_0x122ae8),_0x122ae8;}async function cleanupEmptyDirectories(_0x30bb64,_0x584f9c){const _0x24c0f2=a197_0x2f9250;let _0x5e9f05=resolve(_0x30bb64);const _0x4a5113=resolve(_0x584f9c);while(_0x5e9f05[_0x24c0f2(0x9d)](''+_0x4a5113+sep)||_0x5e9f05===_0x4a5113){if(_0x5e9f05===_0x4a5113)return;try{const _0x246fa5=await readdir(_0x5e9f05);if(_0x246fa5[_0x24c0f2(0xa9)]>0x0)return;await rmdir(_0x5e9f05);}catch{return;}_0x5e9f05=dirname(_0x5e9f05);}}
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 +1 @@
1
- const a198_0x10aa32=a198_0x5704;function a198_0x46b3(){const _0x1b2188=['sqlCode','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','boolean','99mEBPDx','179466hgTUIk','Return\x20full\x20raw\x20SQL\x20query\x20object','64Tlcwrf','dbId','sqlName','695472vMwVRi','66mlnMcL','30480kAhUaM','3oEUWuT','33OOeLaM','11220HcfPax','sqlcode','str','933350YQxSAU','347364CakxOE','detail','38206XeokRQ','verbose','appCode','read','sqlContent'];a198_0x46b3=function(){return _0x1b2188;};return a198_0x46b3();}(function(_0x498b8c,_0x5cd1b9){const _0x42798d=a198_0x5704,_0x72d040=_0x498b8c();while(!![]){try{const _0x2abee1=parseInt(_0x42798d(0x1cd))/0x1*(parseInt(_0x42798d(0x1de))/0x2)+-parseInt(_0x42798d(0x1cb))/0x3*(parseInt(_0x42798d(0x1cc))/0x4)+-parseInt(_0x42798d(0x1d2))/0x5+parseInt(_0x42798d(0x1ca))/0x6+parseInt(_0x42798d(0x1d5))/0x7*(parseInt(_0x42798d(0x1c7))/0x8)+-parseInt(_0x42798d(0x1dd))/0x9*(parseInt(_0x42798d(0x1cf))/0xa)+-parseInt(_0x42798d(0x1ce))/0xb*(-parseInt(_0x42798d(0x1d3))/0xc);if(_0x2abee1===_0x5cd1b9)break;else _0x72d040['push'](_0x72d040['shift']());}catch(_0x33baf8){_0x72d040['push'](_0x72d040['shift']());}}}(a198_0x46b3,0x245e4));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a198_0x5704(_0x2b22d0,_0x3186a4){_0x2b22d0=_0x2b22d0-0x1c7;const _0x46b3b7=a198_0x46b3();let _0x570457=_0x46b3b7[_0x2b22d0];return _0x570457;}export const sqlDetail={'service':'sql','command':a198_0x10aa32(0x1d4),'description':a198_0x10aa32(0x1db),'risk':a198_0x10aa32(0x1d8),'flags':[SQLCODE_FLAG,{'name':a198_0x10aa32(0x1d6),'type':a198_0x10aa32(0x1dc),'description':a198_0x10aa32(0x1df)}],async 'execute'(_0x15a5a2){const _0x52eb4c=a198_0x10aa32,_0x3b1c08=await getSqlQueryInfo(_0x15a5a2[_0x52eb4c(0x1d7)],_0x15a5a2[_0x52eb4c(0x1d1)](_0x52eb4c(0x1d0))),_0x27bcfe=_0x15a5a2['bool'](_0x52eb4c(0x1d6));if(_0x27bcfe)return{'ok':!![],'data':_0x3b1c08};const _0x59f94e=_0x3b1c08[_0x52eb4c(0x1c8)]?await getDbName(_0x15a5a2['appCode'],_0x3b1c08[_0x52eb4c(0x1c8)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3b1c08[_0x52eb4c(0x1da)],'sqlName':_0x3b1c08[_0x52eb4c(0x1c9)],'db':_0x59f94e?_0x59f94e+'\x20('+_0x3b1c08['dbId']+')':_0x3b1c08[_0x52eb4c(0x1c8)]??'','description':_0x3b1c08['description']??'','sqlContent':_0x3b1c08[_0x52eb4c(0x1d9)]??''}};}};
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 +1 @@
1
- function a199_0x2ceb(_0xe0e5a0,_0x580aa8){_0xe0e5a0=_0xe0e5a0-0x1c1;const _0x2b2969=a199_0x2b29();let _0x2ceb0c=_0x2b2969[_0xe0e5a0];return _0x2ceb0c;}const a199_0x3e8b01=a199_0x2ceb;(function(_0x30327c,_0x55228f){const _0x6c474f=a199_0x2ceb,_0x408984=_0x30327c();while(!![]){try{const _0x110d43=-parseInt(_0x6c474f(0x1c1))/0x1+-parseInt(_0x6c474f(0x1c3))/0x2+-parseInt(_0x6c474f(0x1d2))/0x3*(parseInt(_0x6c474f(0x1d5))/0x4)+-parseInt(_0x6c474f(0x1ce))/0x5*(-parseInt(_0x6c474f(0x1cc))/0x6)+-parseInt(_0x6c474f(0x1d4))/0x7+parseInt(_0x6c474f(0x1d3))/0x8+-parseInt(_0x6c474f(0x1ca))/0x9*(-parseInt(_0x6c474f(0x1cd))/0xa);if(_0x110d43===_0x55228f)break;else _0x408984['push'](_0x408984['shift']());}catch(_0x5a5c78){_0x408984['push'](_0x408984['shift']());}}}(a199_0x2b29,0x99e9b));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a199_0x2b29(){const _0x1008e0=['exec','execError','12JpURQS','6542440MMNGPV','4253816ZpElKy','505696TebZZd','str','Returned\x20','string','execResult','209150asiOUO','params','2254736tWCkjP','SQL\x20execution\x20failed','sql','appCode','\x20row(s)\x20in\x20','isArray','now','261ldFFnI','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','906LOOsAk','708690hFiAcq','6865SRTRzb','length'];a199_0x2b29=function(){return _0x1008e0;};return a199_0x2b29();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a199_0x3e8b01(0x1c5),'command':a199_0x3e8b01(0x1d0),'description':a199_0x3e8b01(0x1cb),'risk':'read','flags':[SQLCODE_FLAG,{'name':a199_0x3e8b01(0x1c2),'type':a199_0x3e8b01(0x1d8),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x8ce2c3){const _0x19b206=a199_0x3e8b01,_0x3e4efe=parseJsonParams(_0x8ce2c3[_0x19b206(0x1d6)](_0x19b206(0x1c2))),_0x55b211=Date[_0x19b206(0x1c9)](),_0x1f0605=await executeSql(_0x8ce2c3[_0x19b206(0x1c6)],_0x8ce2c3[_0x19b206(0x1d6)]('sqlcode'),_0x3e4efe),_0x16a1e8=Date[_0x19b206(0x1c9)]()-_0x55b211,_0x538e16=_0x1f0605?.[_0x19b206(0x1d9)]??_0x1f0605,_0x1793d0=_0x1f0605?.['execSuccess']??!![];if(!_0x1793d0)return{'ok':![],'data':{'error':_0x1f0605?.[_0x19b206(0x1d1)]||_0x19b206(0x1c4),'elapsed':_0x16a1e8},'message':'SQL\x20execution\x20failed'};const _0x524009=Array[_0x19b206(0x1c8)](_0x538e16)?_0x538e16:[];return{'ok':!![],'data':{'rows':_0x524009,'rowCount':_0x524009[_0x19b206(0x1cf)],'elapsed':_0x16a1e8},'message':_0x19b206(0x1d7)+_0x524009[_0x19b206(0x1cf)]+_0x19b206(0x1c7)+_0x16a1e8+'ms'};}};
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 +1 @@
1
- (function(_0x12f3dd,_0x176699){const _0x8fff89=a200_0x5a33,_0x2dc825=_0x12f3dd();while(!![]){try{const _0x502a12=parseInt(_0x8fff89(0x151))/0x1+-parseInt(_0x8fff89(0x157))/0x2+-parseInt(_0x8fff89(0x152))/0x3+parseInt(_0x8fff89(0x154))/0x4*(-parseInt(_0x8fff89(0x150))/0x5)+parseInt(_0x8fff89(0x14e))/0x6*(-parseInt(_0x8fff89(0x156))/0x7)+parseInt(_0x8fff89(0x153))/0x8*(-parseInt(_0x8fff89(0x158))/0x9)+parseInt(_0x8fff89(0x155))/0xa*(parseInt(_0x8fff89(0x14f))/0xb);if(_0x502a12===_0x176699)break;else _0x2dc825['push'](_0x2dc825['shift']());}catch(_0x310df7){_0x2dc825['push'](_0x2dc825['shift']());}}}(a200_0x1a5b,0xdcb62));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a200_0x1a5b(){const _0x3abe04=['48370PeuljQ','3492756BbPxfF','14895513VjrJSg','474dvWpcc','17558024AIWJvP','5351750rYjjYO','1031467tZmJfJ','4483482nlCtRY','8QRvVxP','4bxGvsR','40RKSHsO'];a200_0x1a5b=function(){return _0x3abe04;};return a200_0x1a5b();}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_0x5a33(_0x4c112d,_0xc285ee){_0x4c112d=_0x4c112d-0x14e;const _0x1a5b3e=a200_0x1a5b();let _0x5a33e2=_0x1a5b3e[_0x4c112d];return _0x5a33e2;}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
+ (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 +1 @@
1
- const a201_0x2c2de2=a201_0x2373;(function(_0x380375,_0xd30898){const _0x3f49c7=a201_0x2373,_0x11554d=_0x380375();while(!![]){try{const _0x2d7074=parseInt(_0x3f49c7(0x178))/0x1*(parseInt(_0x3f49c7(0x180))/0x2)+-parseInt(_0x3f49c7(0x17d))/0x3+-parseInt(_0x3f49c7(0x164))/0x4*(parseInt(_0x3f49c7(0x174))/0x5)+parseInt(_0x3f49c7(0x177))/0x6*(-parseInt(_0x3f49c7(0x183))/0x7)+-parseInt(_0x3f49c7(0x16a))/0x8+parseInt(_0x3f49c7(0x17a))/0x9+parseInt(_0x3f49c7(0x179))/0xa*(parseInt(_0x3f49c7(0x161))/0xb);if(_0x2d7074===_0xd30898)break;else _0x11554d['push'](_0x11554d['shift']());}catch(_0x89d784){_0x11554d['push'](_0x11554d['shift']());}}}(a201_0x1802,0x51e78));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a201_0x1802(){const _0x345ea4=['name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','string','20PAxqRg','page','bool','283266HkZtbq','23jiROVk','20ZCFley','4948209loVMUW','verbose','str','1457250mfrItx','Filter\x20by\x20SQL\x20name','totalCount','48220dzNkRN','list','sqlcode','28PshGkt','sqlName','appCode','5408524tJRUWe','\x20SQL\x20queries\x20(total:\x20','paging','421388kyyDiq','description','sqlCode','dbId','Found\x20','List\x20custom\x20SQL\x20queries','5249896gKNSuA','pagesize','sql','No\x20custom\x20SQL\x20queries\x20found.','number','all','map'];a201_0x1802=function(){return _0x345ea4;};return a201_0x1802();}function a201_0x2373(_0x1db3d4,_0x5817eb){_0x1db3d4=_0x1db3d4-0x15f;const _0x18029e=a201_0x1802();let _0x2373f8=_0x18029e[_0x1db3d4];return _0x2373f8;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a201_0x2c2de2(0x16c),'command':a201_0x2c2de2(0x181),'description':a201_0x2c2de2(0x169),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a201_0x2c2de2(0x171),'type':a201_0x2c2de2(0x173),'description':a201_0x2c2de2(0x17e)},{'name':a201_0x2c2de2(0x175),'type':a201_0x2c2de2(0x16e),'description':'Page\x20number','default':0x1},{'name':a201_0x2c2de2(0x16b),'type':a201_0x2c2de2(0x16e),'description':'Page\x20size'},{'name':'verbose','type':'boolean','description':a201_0x2c2de2(0x172)}],async 'execute'(_0x395861){const _0x4f9f16=a201_0x2c2de2,_0x335ea6=await listSqlQueries(_0x395861['appCode'],{'sqlCode':_0x395861['str'](_0x4f9f16(0x182))||undefined,'sqlName':_0x395861[_0x4f9f16(0x17c)](_0x4f9f16(0x171))||undefined,'currentPage':_0x395861['num'](_0x4f9f16(0x175)),'pageSize':_0x395861['num']('pagesize',0x32)}),_0x3ad4dd=_0x395861[_0x4f9f16(0x176)](_0x4f9f16(0x17b)),_0x5dbac4=_0x335ea6['tableData']??[],_0x37607d=_0x335ea6[_0x4f9f16(0x163)]?.[_0x4f9f16(0x17f)]??_0x5dbac4['length'];let _0x51318a;return _0x3ad4dd?_0x51318a=_0x5dbac4:_0x51318a=await Promise[_0x4f9f16(0x16f)](_0x5dbac4[_0x4f9f16(0x170)](async _0x5319c7=>{const _0x360a04=_0x4f9f16;let _0x22a145;try{_0x22a145=_0x5319c7[_0x360a04(0x167)]?await getDbName(_0x395861[_0x360a04(0x160)],_0x5319c7[_0x360a04(0x167)]):undefined;}catch{}return{'sqlCode':_0x5319c7[_0x360a04(0x166)],'sqlName':_0x5319c7[_0x360a04(0x15f)],'description':_0x5319c7[_0x360a04(0x165)]??'','db':_0x22a145?_0x22a145+'\x20('+_0x5319c7[_0x360a04(0x167)]+')':_0x5319c7['dbId']??''};})),{'ok':!![],'data':_0x51318a,'message':_0x5dbac4['length']===0x0?_0x4f9f16(0x16d):_0x4f9f16(0x168)+_0x5dbac4['length']+_0x4f9f16(0x162)+_0x37607d+').'};}};
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+').'};}};