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

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 (299) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.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-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.js +1 -1
  87. package/lib/commands/db/diff-refresh-status.js +1 -1
  88. package/lib/commands/db/diff.js +1 -1
  89. package/lib/commands/db/index.js +1 -1
  90. package/lib/commands/db/list.js +1 -1
  91. package/lib/commands/db/shared.js +1 -1
  92. package/lib/commands/db/tables.js +1 -1
  93. package/lib/commands/db/test.js +1 -1
  94. package/lib/commands/db/update.js +1 -1
  95. package/lib/commands/doctor.js +1 -1
  96. package/lib/commands/file/index.js +1 -1
  97. package/lib/commands/init/index.js +1 -1
  98. package/lib/commands/issue/index.js +1 -1
  99. package/lib/commands/issue/nudge.js +1 -1
  100. package/lib/commands/issue/report.js +1 -1
  101. package/lib/commands/issue/shared.js +1 -1
  102. package/lib/commands/kb/create.js +1 -1
  103. package/lib/commands/kb/delete.js +1 -1
  104. package/lib/commands/kb/detail.js +1 -1
  105. package/lib/commands/kb/index.js +1 -1
  106. package/lib/commands/kb/list.js +1 -1
  107. package/lib/commands/kb/shared.js +1 -1
  108. package/lib/commands/kb/update.js +1 -1
  109. package/lib/commands/logs/index.js +1 -1
  110. package/lib/commands/menu/asset-update.js +1 -1
  111. package/lib/commands/menu/delete.js +1 -1
  112. package/lib/commands/menu/external-link-create.js +1 -1
  113. package/lib/commands/menu/external-link-update.js +1 -1
  114. package/lib/commands/menu/group-create.js +1 -1
  115. package/lib/commands/menu/group-update.js +1 -1
  116. package/lib/commands/menu/index.js +1 -1
  117. package/lib/commands/menu/list.js +1 -1
  118. package/lib/commands/menu/move.js +1 -1
  119. package/lib/commands/menu/regroup-start.js +1 -1
  120. package/lib/commands/menu/rename.js +1 -1
  121. package/lib/commands/menu/shared/compare-table.js +1 -1
  122. package/lib/commands/menu/shared/delete-plan.js +1 -1
  123. package/lib/commands/menu/shared/facts.js +1 -1
  124. package/lib/commands/menu/shared/index.js +1 -1
  125. package/lib/commands/menu/shared/inquirer.js +1 -1
  126. package/lib/commands/menu/shared/local-pages.js +1 -1
  127. package/lib/commands/menu/shared/logic.js +1 -1
  128. package/lib/commands/menu/shared/mutations.js +1 -1
  129. package/lib/commands/menu/shared/service.js +1 -1
  130. package/lib/commands/menu/shared/sync-core.js +1 -1
  131. package/lib/commands/menu/shared/update-core.js +1 -1
  132. package/lib/commands/menu/shared/valid-url.js +1 -1
  133. package/lib/commands/menu/sync.js +1 -1
  134. package/lib/commands/notification/config-create.js +1 -1
  135. package/lib/commands/notification/config-delete.js +1 -1
  136. package/lib/commands/notification/config-list.js +1 -1
  137. package/lib/commands/notification/config-update.js +1 -1
  138. package/lib/commands/notification/index.js +1 -1
  139. package/lib/commands/notification/shared.js +1 -1
  140. package/lib/commands/ocr/index.js +1 -1
  141. package/lib/commands/page/generate-start.js +1 -1
  142. package/lib/commands/page/generate-status.js +1 -1
  143. package/lib/commands/page/index.js +1 -1
  144. package/lib/commands/page/pull.js +1 -1
  145. package/lib/commands/page/push.js +1 -1
  146. package/lib/commands/page/react/create.js +1 -1
  147. package/lib/commands/page/react/detail.js +1 -1
  148. package/lib/commands/page/react/list.js +1 -1
  149. package/lib/commands/page/react/publish.js +1 -1
  150. package/lib/commands/page/react/shared.js +1 -1
  151. package/lib/commands/page/react/syntax.js +1 -1
  152. package/lib/commands/page/react/template.js +1 -1
  153. package/lib/commands/page/react/update.js +1 -1
  154. package/lib/commands/page/relation-audit.js +1 -1
  155. package/lib/commands/page/restore.js +1 -1
  156. package/lib/commands/page/shared.js +1 -1
  157. package/lib/commands/page/standard-page-status.js +1 -1
  158. package/lib/commands/page/sync.js +1 -1
  159. package/lib/commands/permit/index.js +1 -1
  160. package/lib/commands/permit/page-get.js +1 -1
  161. package/lib/commands/permit/page-set.js +1 -1
  162. package/lib/commands/permit/role-apis-set.js +1 -1
  163. package/lib/commands/permit/role-menus-set.js +1 -1
  164. package/lib/commands/permit/role-menus.js +1 -1
  165. package/lib/commands/permit/shared.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/index.js +1 -1
  177. package/lib/commands/project/upgrade.js +1 -1
  178. package/lib/commands/registry.js +1 -1
  179. package/lib/commands/role/create.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/run/index.js +1 -1
  190. package/lib/commands/schema.js +1 -1
  191. package/lib/commands/sql/create.js +1 -1
  192. package/lib/commands/sql/delete.js +1 -1
  193. package/lib/commands/sql/detail.js +1 -1
  194. package/lib/commands/sql/exec.js +1 -1
  195. package/lib/commands/sql/index.js +1 -1
  196. package/lib/commands/sql/list.js +1 -1
  197. package/lib/commands/sql/pull.js +1 -1
  198. package/lib/commands/sql/push.js +1 -1
  199. package/lib/commands/sql/shared.js +1 -1
  200. package/lib/commands/sql/status.js +1 -1
  201. package/lib/commands/sql/validate.js +1 -1
  202. package/lib/commands/task/index.js +1 -1
  203. package/lib/commands/task/status.js +1 -1
  204. package/lib/commands/tenant/index.js +1 -1
  205. package/lib/commands/tenant/members-list.js +1 -1
  206. package/lib/commands/tenant/shared.js +1 -1
  207. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  208. package/lib/commands/user-account/index.js +1 -1
  209. package/lib/commands/workspace/add.js +1 -1
  210. package/lib/commands/workspace/index.js +1 -1
  211. package/lib/commands/workspace/remove.js +1 -1
  212. package/lib/config/schema.js +1 -1
  213. package/lib/constant/cdn.js +1 -1
  214. package/lib/constant/cli.js +1 -1
  215. package/lib/constant/defaults.js +1 -1
  216. package/lib/constant/domain.js +1 -1
  217. package/lib/constant/env.js +1 -1
  218. package/lib/constant/output.js +1 -1
  219. package/lib/constant/paths.js +1 -1
  220. package/lib/constant/risk.js +1 -1
  221. package/lib/context/app-resolver.js +1 -1
  222. package/lib/context/auth-resolver.js +1 -1
  223. package/lib/context/config-loader.js +1 -1
  224. package/lib/context.js +1 -1
  225. package/lib/core/alias-resolver.js +1 -1
  226. package/lib/core/api-client.js +1 -1
  227. package/lib/core/bff/config.js +1 -1
  228. package/lib/core/bff/file-system.js +1 -1
  229. package/lib/core/bff/hash.js +1 -1
  230. package/lib/core/bff/lock.js +1 -1
  231. package/lib/core/bff/utils.js +1 -1
  232. package/lib/core/db-resolver.js +1 -1
  233. package/lib/core/page/file-system.js +1 -1
  234. package/lib/core/page/hash.js +1 -1
  235. package/lib/core/page/lock.js +1 -1
  236. package/lib/core/sql-index-auditor.js +1 -1
  237. package/lib/core/sql-sync/config.js +1 -1
  238. package/lib/core/sql-sync/file-system.js +1 -1
  239. package/lib/core/sql-sync/hash.js +1 -1
  240. package/lib/core/sql-sync/lock.js +1 -1
  241. package/lib/core/sql-sync/utils.js +1 -1
  242. package/lib/core/sql-validator.js +1 -1
  243. package/lib/errors.js +1 -1
  244. package/lib/framework/build-all-flags.js +1 -1
  245. package/lib/framework/error-output.js +1 -1
  246. package/lib/framework/explicit-yes.js +1 -1
  247. package/lib/framework/flags.js +1 -1
  248. package/lib/framework/help.js +1 -1
  249. package/lib/framework/index.js +1 -1
  250. package/lib/framework/output.js +1 -1
  251. package/lib/framework/response.js +1 -1
  252. package/lib/framework/runner-alias.js +1 -1
  253. package/lib/framework/runner.js +1 -1
  254. package/lib/framework/schema-export.js +1 -1
  255. package/lib/framework/types.js +1 -1
  256. package/lib/generated/build-info.d.ts +4 -4
  257. package/lib/generated/build-info.js +1 -1
  258. package/lib/help.js +1 -1
  259. package/lib/postinstall.js +1 -1
  260. package/lib/runtime/confirmation.js +1 -1
  261. package/lib/runtime/event.js +1 -1
  262. package/lib/runtime/index.js +1 -1
  263. package/lib/runtime/queue.js +1 -1
  264. package/lib/runtime/resolve.js +1 -1
  265. package/lib/skills/builtin-skill.js +1 -1
  266. package/lib/skills/main.js +1 -1
  267. package/lib/skills/npx-skills-add.js +1 -1
  268. package/lib/skills/skill-presence.js +1 -1
  269. package/lib/telemetry/cli-command-trace.js +1 -1
  270. package/lib/telemetry/cli-help-trace.js +1 -1
  271. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  272. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  273. package/lib/telemetry/send-cli-trace-log.js +1 -1
  274. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  275. package/lib/utils/ai_config.js +1 -1
  276. package/lib/utils/apply-jq-filter.js +1 -1
  277. package/lib/utils/cdn-config.js +1 -1
  278. package/lib/utils/check-sdk-version.js +1 -1
  279. package/lib/utils/cli-version-check.js +1 -1
  280. package/lib/utils/cli-version-policy.js +1 -1
  281. package/lib/utils/config.js +1 -1
  282. package/lib/utils/entity-with-id.js +1 -1
  283. package/lib/utils/file-utils.js +1 -1
  284. package/lib/utils/guides-cdn.js +1 -1
  285. package/lib/utils/http-client.js +1 -1
  286. package/lib/utils/is-non-interactive.js +1 -1
  287. package/lib/utils/logger.js +1 -1
  288. package/lib/utils/params.js +1 -1
  289. package/lib/utils/platform.js +1 -1
  290. package/lib/utils/rules-cdn.js +1 -1
  291. package/lib/utils/sleep.js +1 -1
  292. package/lib/utils/template-replacer.js +1 -1
  293. package/lib/utils/update-notice.js +1 -1
  294. package/lib/utils/version.js +1 -1
  295. package/lib/utils/with-active-cookie.js +1 -1
  296. package/lib/utils/write-cli-side-channel.js +1 -1
  297. package/package.json +1 -1
  298. package/skills/rabetbase/SKILL.md +1 -1
  299. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a198_0x3a3914=a198_0x3075;(function(_0x4003f0,_0x5ea444){const _0x5c86b6=a198_0x3075,_0x4b26d8=_0x4003f0();while(!![]){try{const _0x4008c7=-parseInt(_0x5c86b6(0x1d0))/0x1*(-parseInt(_0x5c86b6(0x194))/0x2)+-parseInt(_0x5c86b6(0x1be))/0x3+-parseInt(_0x5c86b6(0x190))/0x4*(parseInt(_0x5c86b6(0x1af))/0x5)+parseInt(_0x5c86b6(0x19f))/0x6+-parseInt(_0x5c86b6(0x197))/0x7*(-parseInt(_0x5c86b6(0x196))/0x8)+-parseInt(_0x5c86b6(0x1b6))/0x9*(parseInt(_0x5c86b6(0x1ca))/0xa)+parseInt(_0x5c86b6(0x1a1))/0xb*(parseInt(_0x5c86b6(0x1a2))/0xc);if(_0x4008c7===_0x5ea444)break;else _0x4b26d8['push'](_0x4b26d8['shift']());}catch(_0x33c9b6){_0x4b26d8['push'](_0x4b26d8['shift']());}}}(a198_0x20fc,0x3c7e1));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';function a198_0x20fc(){const _0xc18e1e=['validation','write','dbDirectory','Local\x20SQL\x20not\x20found:\x20','243EoGKQF','utf8','No\x20local\x20SQL\x20files\x20found.','path','relativePath','force','\x20skipped,\x20','toISOString','517044upXpsJ','length','\x20pushed,\x20','sqlRoot','sqlcode','trashDir','get','lockFilePath','sqlCode','replace','sql','Push\x20local\x20SQL\x20files\x20to\x20remote','139010SNeHgs','sqlRootDir','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','dbId','filter','startsWith','1JTAwIS','lastSync','has','70044BuvpGZ','sqlName','\x22\x20for\x20sqlCode\x20','/smartapi/custom/updateUserCustomSql','218872TmBDrb','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','8WWGPmI','2706844WGJNNO','\x20failed','sqls','version','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Would\x20push\x20','\x20SQL\x20file(s)','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','366882RRFkQU','catch','6279746lopDPR','12PzGlmH','unchanged','remoteId','mode','filePath','exec','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','appCode','push','POST','Local\x20directory\x20\x22','sqlConfig','boolean','95LshpEl','dbName','bool'];a198_0x20fc=function(){return _0xc18e1e;};return a198_0x20fc();}function a198_0x3075(_0xd30f0e,_0x38ddca){_0xd30f0e=_0xd30f0e-0x190;const _0x20fce2=a198_0x20fc();let _0x30754c=_0x20fce2[_0xd30f0e];return _0x30754c;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x3f5e86,_0x169c6f,_0x390510){const _0x55626e=a198_0x3075,_0x2ec9df=await scanLocalSqlQueries(_0x3f5e86),_0x18d4d8=new Map();for(const _0x588a98 of _0x2ec9df){if(_0x390510&&_0x588a98[_0x55626e(0x1c6)]!==_0x390510)continue;const _0x2afcb6=_0x18d4d8[_0x55626e(0x1c4)](_0x588a98[_0x55626e(0x1c6)])??[];_0x2afcb6['push'](_0x588a98),_0x18d4d8['set'](_0x588a98['sqlCode'],_0x2afcb6);}if(_0x390510&&!_0x18d4d8[_0x55626e(0x1d2)](_0x390510))throw CliErrors[_0x55626e(0x1b2)](_0x55626e(0x1b5)+_0x390510);const _0x45457f=[];for(const [_0x459ef7,_0x34cfbc]of _0x18d4d8['entries']()){if(_0x34cfbc['length']===0x1){_0x45457f[_0x55626e(0x1aa)](_0x34cfbc[0x0]);continue;}const _0x1aa85b=_0x169c6f['sqls'][_0x459ef7],_0x4da362=_0x1aa85b?.[_0x55626e(0x1b9)],_0x1e3525=_0x4da362?_0x34cfbc['filter'](_0x28a49a=>_0x28a49a[_0x55626e(0x1ba)]!==_0x4da362):_0x34cfbc;if(_0x1aa85b&&_0x1e3525[_0x55626e(0x1bf)]===0x1){_0x45457f[_0x55626e(0x1aa)](_0x1e3525[0x0]);continue;}throw CliErrors['validation'](_0x55626e(0x19e)+_0x459ef7+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0x45457f;}export const sqlPush={'service':a198_0x3a3914(0x1c8),'command':a198_0x3a3914(0x1aa),'description':a198_0x3a3914(0x1c9),'risk':a198_0x3a3914(0x1b3),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a198_0x3a3914(0x1bb),'type':a198_0x3a3914(0x1ae),'description':a198_0x3a3914(0x1a8)}],async 'dryRun'(_0xcf2cb1){const _0x3501d8=a198_0x3a3914,_0x2a4b95=loadSqlProjectConfig(_0xcf2cb1['appCode']),_0x5c82ca=await readSqlLockFile(_0x2a4b95[_0x3501d8(0x1c5)]),{appLock:_0x2265c1}=ensureSqlLockScope(_0x5c82ca??createEmptySqlLock(),_0xcf2cb1[_0x3501d8(0x1a9)],_0x2a4b95[_0x3501d8(0x1c1)],_0x3501d8(0x1aa)),_0x2fc523=await getTargetSqlQueries(_0x2a4b95,_0x2265c1,_0xcf2cb1['str'](_0x3501d8(0x1c2))||undefined),_0x541f39=[];for(const _0x387ec4 of _0x2fc523){const _0x198b17=await computeSqlFileHash(_0x387ec4[_0x3501d8(0x1a6)]),_0x127050=_0x2265c1['sqls'][_0x387ec4[_0x3501d8(0x1c6)]],_0x4e25ac=!!_0x127050&&(_0x127050[_0x3501d8(0x1b9)]!==_0x387ec4[_0x3501d8(0x1ba)]||!!_0x387ec4[_0x3501d8(0x191)]&&_0x127050[_0x3501d8(0x191)]!==_0x387ec4[_0x3501d8(0x191)]);if(!_0xcf2cb1[_0x3501d8(0x1b1)](_0x3501d8(0x1bb))&&_0x127050&&_0x127050['hash']===_0x198b17&&!_0x4e25ac)continue;_0x541f39['push'](_0x387ec4[_0x3501d8(0x1c6)]);}return{'method':_0x3501d8(0x1ab),'url':_0x3501d8(0x193),'body':{'sqlCodes':_0x541f39,'appCode':_0xcf2cb1[_0x3501d8(0x1a9)]},'description':_0x3501d8(0x19c)+_0x541f39['length']+_0x3501d8(0x19d)};},async 'execute'(_0x285737){const _0x19f1c7=a198_0x3a3914,_0x13f683=loadSqlProjectConfig(_0x285737['appCode']),_0x4203bd=await readSqlLockFile(_0x13f683[_0x19f1c7(0x1c5)]),{lockData:_0x7dc3e7,appLock:_0x367b82}=ensureSqlLockScope(_0x4203bd??createEmptySqlLock(),_0x285737[_0x19f1c7(0x1a9)],_0x13f683[_0x19f1c7(0x1c1)],'push'),_0x301235=await getTargetSqlQueries(_0x13f683,_0x367b82,_0x285737['str']('sqlcode')||undefined);if(_0x301235['length']===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x19f1c7(0x1b8)};const _0x4fd794=[],_0xc58feb=[],_0x303e22=[];for(const _0x266771 of _0x301235){const _0x4ff441=_0x367b82[_0x19f1c7(0x199)][_0x266771[_0x19f1c7(0x1c6)]];if(!_0x4ff441){_0x303e22[_0x19f1c7(0x1aa)]({'sqlCode':_0x266771['sqlCode'],'error':_0x19f1c7(0x195)});continue;}try{const _0x3947a0=await computeSqlFileHash(_0x266771[_0x19f1c7(0x1a6)]),_0x1356b9=_0x4ff441[_0x19f1c7(0x1b9)]!==_0x266771[_0x19f1c7(0x1ba)]||!!_0x266771[_0x19f1c7(0x191)]&&_0x4ff441[_0x19f1c7(0x191)]!==_0x266771['sqlName'];if(!_0x285737[_0x19f1c7(0x1b1)](_0x19f1c7(0x1bb))&&_0x4ff441['hash']===_0x3947a0&&!_0x1356b9){_0xc58feb['push']({'sqlCode':_0x266771[_0x19f1c7(0x1c6)],'reason':_0x19f1c7(0x1a3)});continue;}if(_0x4ff441[_0x19f1c7(0x19a)]==null){_0x303e22[_0x19f1c7(0x1aa)]({'sqlCode':_0x266771['sqlCode'],'error':_0x19f1c7(0x1cc)});continue;}const _0x35a31c=await readFile(_0x266771[_0x19f1c7(0x1a6)],_0x19f1c7(0x1b7)),_0x5711ed=stripLocalSqlMetadata(_0x35a31c,_0x266771['mode']),_0x5e6284=_0x266771[_0x19f1c7(0x191)]||_0x4ff441[_0x19f1c7(0x191)],_0x31ef14=await resolveTargetDbBinding(_0x285737['appCode'],_0x266771,_0x4ff441),_0x2c274e=await updateSqlQuery({'id':_0x4ff441[_0x19f1c7(0x1a4)],'appCode':_0x285737[_0x19f1c7(0x1a9)],'sqlCode':_0x266771['sqlCode'],'sqlName':_0x5e6284,'dbId':_0x31ef14[_0x19f1c7(0x1cd)],'version':_0x4ff441['version'],'sqlContent':_0x5711ed,'sqlConfig':_0x4ff441[_0x19f1c7(0x1ad)]??undefined}),_0x1ac859=_0x2c274e[_0x19f1c7(0x1cd)]?await getDbName(_0x285737[_0x19f1c7(0x1a9)],Number(_0x2c274e[_0x19f1c7(0x1cd)]))['catch'](()=>_0x31ef14[_0x19f1c7(0x1b0)]):_0x31ef14['dbName'];_0x367b82[_0x19f1c7(0x199)][_0x266771['sqlCode']]={...buildSqlLockEntry(_0x2c274e,_0x5711ed,_0x3947a0,{'dbName':_0x1ac859}),'path':_0x266771[_0x19f1c7(0x1ba)],'mode':_0x4ff441[_0x19f1c7(0x1a5)]},await archivePreviousSqlFileIfNeeded(_0x13f683,_0x4ff441[_0x19f1c7(0x1b9)],_0x266771[_0x19f1c7(0x1ba)]),_0x4fd794[_0x19f1c7(0x1aa)]({'sqlCode':_0x266771[_0x19f1c7(0x1c6)],'remoteId':_0x4ff441['remoteId']});}catch(_0x3da25c){_0x303e22[_0x19f1c7(0x1aa)]({'sqlCode':_0x266771[_0x19f1c7(0x1c6)],'error':_0x3da25c instanceof Error?_0x3da25c['message']:String(_0x3da25c)});}}return _0x367b82[_0x19f1c7(0x1d1)]=new Date()[_0x19f1c7(0x1bd)](),await writeSqlLockFile(_0x13f683[_0x19f1c7(0x1c5)],_0x7dc3e7),{'ok':_0x303e22[_0x19f1c7(0x1bf)]===0x0,'data':{'pushed':_0x4fd794,'skipped':_0xc58feb,'failed':_0x303e22},'message':'Push\x20complete:\x20'+_0x4fd794[_0x19f1c7(0x1bf)]+_0x19f1c7(0x1c0)+_0xc58feb[_0x19f1c7(0x1bf)]+_0x19f1c7(0x1bc)+_0x303e22['length']+_0x19f1c7(0x198)};}};async function archivePreviousSqlFileIfNeeded(_0x307ae4,_0x3ffe9a,_0x24804f){const _0x951c68=a198_0x3a3914;if(!_0x3ffe9a||_0x3ffe9a===_0x24804f)return;const _0x1ac22f=join(_0x307ae4[_0x951c68(0x1cb)],_0x3ffe9a);if(!await fileExists(_0x1ac22f))return;const _0x194586=await moveToTrash(_0x307ae4['projectRoot'],_0x307ae4[_0x951c68(0x1c3)],_0x1ac22f);await cleanupEmptyDirectories(dirname(_0x1ac22f),_0x307ae4['sqlRootDir']),void _0x194586;}async function moveToTrash(_0x6e05,_0x5d0384,_0x5ea9c4){const _0x1af636=a198_0x3a3914,_0x301244=new Date()[_0x1af636(0x1bd)]()[_0x1af636(0x1c7)](/[:.]/g,'-'),_0x10d78d=relative(_0x6e05,_0x5ea9c4),_0x133f22=join(_0x5d0384,_0x301244,_0x10d78d);return await mkdir(dirname(_0x133f22),{'recursive':!![]}),await rename(_0x5ea9c4,_0x133f22),_0x133f22;}async function cleanupEmptyDirectories(_0x371cf1,_0x34a1b1){const _0x260579=a198_0x3a3914;let _0x145d27=resolve(_0x371cf1);const _0x5d91c9=resolve(_0x34a1b1);while(_0x145d27[_0x260579(0x1cf)](''+_0x5d91c9+sep)||_0x145d27===_0x5d91c9){if(_0x145d27===_0x5d91c9)return;try{const _0x2d77e5=await readdir(_0x145d27);if(_0x2d77e5[_0x260579(0x1bf)]>0x0)return;await rmdir(_0x145d27);}catch{return;}_0x145d27=dirname(_0x145d27);}}async function resolveTargetDbBinding(_0x403e45,_0x182e34,_0x29688f){const _0x3258f2=a198_0x3a3914,_0x4f7d7b=_0x182e34[_0x3258f2(0x1b4)];if(!_0x4f7d7b)return{'dbId':_0x29688f[_0x3258f2(0x1cd)],'dbName':_0x29688f[_0x3258f2(0x1b0)]};const _0x8d9f34=buildDbDirectoryName(_0x29688f[_0x3258f2(0x1b0)],_0x29688f[_0x3258f2(0x1cd)]);if(_0x4f7d7b===_0x8d9f34)return{'dbId':_0x29688f['dbId'],'dbName':_0x29688f[_0x3258f2(0x1b0)]};const _0x572168=parseExplicitDbDirectory(_0x4f7d7b);if(_0x572168!=null)return{'dbId':_0x572168,'dbName':await getDbName(_0x403e45,_0x572168)[_0x3258f2(0x1a0)](()=>undefined)};const _0x276395=await listDatabases(_0x403e45),_0x1ca79b=_0x276395[_0x3258f2(0x1ce)](_0x1df8da=>buildDbDirectoryName(_0x1df8da[_0x3258f2(0x1b0)],_0x1df8da['dbId'])===_0x4f7d7b);if(_0x1ca79b['length']===0x1)return{'dbId':_0x1ca79b[0x0][_0x3258f2(0x1cd)],'dbName':_0x1ca79b[0x0][_0x3258f2(0x1b0)]};if(_0x1ca79b['length']===0x0)throw CliErrors[_0x3258f2(0x1b2)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x4f7d7b+_0x3258f2(0x192)+_0x182e34[_0x3258f2(0x1c6)]+'.');const _0x462ef4=_0x1ca79b['map'](_0x4ba436=>_0x4ba436[_0x3258f2(0x1b0)]+'\x20('+_0x4ba436[_0x3258f2(0x1cd)]+')')['join'](',\x20');throw CliErrors[_0x3258f2(0x1b2)](_0x3258f2(0x1ac)+_0x4f7d7b+_0x3258f2(0x19b)+_0x182e34['sqlCode']+':\x20'+_0x462ef4);}function parseExplicitDbDirectory(_0x2a4435){const _0xe0b13a=a198_0x3a3914,_0xb540bc=/^db-(\d+)$/[_0xe0b13a(0x1a7)](_0x2a4435);if(!_0xb540bc)return null;const _0xc76b2f=Number(_0xb540bc[0x1]);return Number['isFinite'](_0xc76b2f)&&_0xc76b2f>0x0?_0xc76b2f:null;}
1
+ const a198_0x8130a9=a198_0x3f84;(function(_0x279125,_0x534fe8){const _0x2d16b4=a198_0x3f84,_0xc42f47=_0x279125();while(!![]){try{const _0x576a36=parseInt(_0x2d16b4(0x138))/0x1+parseInt(_0x2d16b4(0x136))/0x2*(parseInt(_0x2d16b4(0x135))/0x3)+parseInt(_0x2d16b4(0x168))/0x4+-parseInt(_0x2d16b4(0x164))/0x5*(-parseInt(_0x2d16b4(0x137))/0x6)+parseInt(_0x2d16b4(0x142))/0x7+parseInt(_0x2d16b4(0x157))/0x8*(-parseInt(_0x2d16b4(0x172))/0x9)+parseInt(_0x2d16b4(0x167))/0xa*(-parseInt(_0x2d16b4(0x14c))/0xb);if(_0x576a36===_0x534fe8)break;else _0xc42f47['push'](_0xc42f47['shift']());}catch(_0x55787c){_0xc42f47['push'](_0xc42f47['shift']());}}}(a198_0x4df4,0x7228c));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a198_0x4df4(){const _0x240c2d=['trashDir','9375872kDThrj','Local\x20SQL\x20not\x20found:\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','length','Push\x20complete:\x20','sqlRoot','Local\x20directory\x20\x22','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','get','\x20skipped,\x20','236744DufNoo','sqls','force','dbDirectory','No\x20local\x20SQL\x20files\x20found.','filter','push','sqlCode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','sqlRootDir','replace','dbId','Push\x20local\x20SQL\x20files\x20to\x20remote','4260035NCGcnG','toISOString','mode','30wLyvnB','2435980Lqnpmr','appCode','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sql','sqlName','lockFilePath','write','catch','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','27eYsrSn','map','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','set','exec','message','entries','relativePath','filePath','1611717NRPVyM','2byEsLA','6hyMqDk','684441yDaScK','\x20pushed,\x20','hash','sqlcode','remoteId','validation','/smartapi/custom/updateUserCustomSql','join','\x20SQL\x20file(s)','path','3015243axJLCM','boolean','utf8','POST','Would\x20push\x20','dbName','No\x20database\x20matches\x20local\x20directory\x20\x22','startsWith','lastSync'];a198_0x4df4=function(){return _0x240c2d;};return a198_0x4df4();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a198_0x3f84(_0x1c3eb0,_0x3b285a){_0x1c3eb0=_0x1c3eb0-0x135;const _0x4df429=a198_0x4df4();let _0x3f8453=_0x4df429[_0x1c3eb0];return _0x3f8453;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x234fe2,_0x5ae8cb,_0x41e129){const _0x1377fe=a198_0x3f84,_0x21a57a=await scanLocalSqlQueries(_0x234fe2),_0x56a61e=new Map();for(const _0x135516 of _0x21a57a){if(_0x41e129&&_0x135516[_0x1377fe(0x15e)]!==_0x41e129)continue;const _0xab4030=_0x56a61e[_0x1377fe(0x155)](_0x135516['sqlCode'])??[];_0xab4030['push'](_0x135516),_0x56a61e[_0x1377fe(0x175)](_0x135516[_0x1377fe(0x15e)],_0xab4030);}if(_0x41e129&&!_0x56a61e['has'](_0x41e129))throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14d)+_0x41e129);const _0x3eb7ef=[];for(const [_0x1b552f,_0xf0a761]of _0x56a61e[_0x1377fe(0x178)]()){if(_0xf0a761[_0x1377fe(0x14f)]===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0xf0a761[0x0]);continue;}const _0x383bf1=_0x5ae8cb[_0x1377fe(0x158)][_0x1b552f],_0x2483a8=_0x383bf1?.[_0x1377fe(0x141)],_0x8f0848=_0x2483a8?_0xf0a761['filter'](_0x2133d8=>_0x2133d8[_0x1377fe(0x179)]!==_0x2483a8):_0xf0a761;if(_0x383bf1&&_0x8f0848['length']===0x1){_0x3eb7ef[_0x1377fe(0x15d)](_0x8f0848[0x0]);continue;}throw CliErrors[_0x1377fe(0x13d)](_0x1377fe(0x14e)+_0x1b552f+_0x1377fe(0x15f));}return _0x3eb7ef;}export const sqlPush={'service':a198_0x8130a9(0x16b),'command':'push','description':a198_0x8130a9(0x163),'risk':a198_0x8130a9(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a198_0x8130a9(0x159),'type':a198_0x8130a9(0x143),'description':a198_0x8130a9(0x174)}],async 'dryRun'(_0x3491f1){const _0x404db9=a198_0x8130a9,_0x23b065=loadSqlProjectConfig(_0x3491f1[_0x404db9(0x169)]),_0x296622=await readSqlLockFile(_0x23b065[_0x404db9(0x16d)]),{appLock:_0x81ca33}=ensureSqlLockScope(_0x296622??createEmptySqlLock(),_0x3491f1[_0x404db9(0x169)],_0x23b065['sqlRoot'],'push'),_0x4bd504=await getTargetSqlQueries(_0x23b065,_0x81ca33,_0x3491f1['str'](_0x404db9(0x13b))||undefined),_0xc1259=[];for(const _0x2c22a7 of _0x4bd504){const _0x268156=await computeSqlFileHash(_0x2c22a7[_0x404db9(0x17a)]),_0x2c65b9=_0x81ca33['sqls'][_0x2c22a7[_0x404db9(0x15e)]],_0x3f9272=!!_0x2c65b9&&(_0x2c65b9[_0x404db9(0x141)]!==_0x2c22a7[_0x404db9(0x179)]||!!_0x2c22a7[_0x404db9(0x16c)]&&_0x2c65b9[_0x404db9(0x16c)]!==_0x2c22a7[_0x404db9(0x16c)]);if(!_0x3491f1[_0x404db9(0x153)](_0x404db9(0x159))&&_0x2c65b9&&_0x2c65b9['hash']===_0x268156&&!_0x3f9272)continue;_0xc1259[_0x404db9(0x15d)](_0x2c22a7[_0x404db9(0x15e)]);}return{'method':_0x404db9(0x145),'url':_0x404db9(0x13e),'body':{'sqlCodes':_0xc1259,'appCode':_0x3491f1[_0x404db9(0x169)]},'description':_0x404db9(0x146)+_0xc1259['length']+_0x404db9(0x140)};},async 'execute'(_0xa07ee5){const _0x1d9240=a198_0x8130a9,_0x52837a=loadSqlProjectConfig(_0xa07ee5['appCode']),_0x364539=await readSqlLockFile(_0x52837a[_0x1d9240(0x16d)]),{lockData:_0x4b978b,appLock:_0x29fe57}=ensureSqlLockScope(_0x364539??createEmptySqlLock(),_0xa07ee5[_0x1d9240(0x169)],_0x52837a[_0x1d9240(0x151)],_0x1d9240(0x15d)),_0x174d95=await getTargetSqlQueries(_0x52837a,_0x29fe57,_0xa07ee5['str']('sqlcode')||undefined);if(_0x174d95[_0x1d9240(0x14f)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x1d9240(0x15b)};const _0x1bdfb4=[],_0x3316fa=[],_0x510da0=[];for(const _0x28b734 of _0x174d95){const _0x5d87e3=_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']];if(!_0x5d87e3){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x154)});continue;}try{const _0x12c83e=await computeSqlFileHash(_0x28b734[_0x1d9240(0x17a)]),_0x1490f9=_0x5d87e3['path']!==_0x28b734[_0x1d9240(0x179)]||!!_0x28b734[_0x1d9240(0x16c)]&&_0x5d87e3['sqlName']!==_0x28b734['sqlName'];if(!_0xa07ee5[_0x1d9240(0x153)](_0x1d9240(0x159))&&_0x5d87e3[_0x1d9240(0x13a)]===_0x12c83e&&!_0x1490f9){_0x3316fa[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'reason':'unchanged'});continue;}if(_0x5d87e3['version']==null){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x1d9240(0x16a)});continue;}const _0x265b42=await readFile(_0x28b734[_0x1d9240(0x17a)],_0x1d9240(0x144)),_0x52f0cd=stripLocalSqlMetadata(_0x265b42,_0x28b734[_0x1d9240(0x166)]),_0x240165=_0x28b734[_0x1d9240(0x16c)]||_0x5d87e3[_0x1d9240(0x16c)],_0x36ee64=await resolveTargetDbBinding(_0xa07ee5[_0x1d9240(0x169)],_0x28b734,_0x5d87e3),_0xe157e5=await updateSqlQuery({'id':_0x5d87e3[_0x1d9240(0x13c)],'appCode':_0xa07ee5[_0x1d9240(0x169)],'sqlCode':_0x28b734[_0x1d9240(0x15e)],'sqlName':_0x240165,'dbId':_0x36ee64[_0x1d9240(0x162)],'version':_0x5d87e3['version'],'sqlContent':_0x52f0cd,'sqlConfig':_0x5d87e3['sqlConfig']??undefined}),_0x38b54b=_0xe157e5[_0x1d9240(0x162)]?await getDbName(_0xa07ee5[_0x1d9240(0x169)],Number(_0xe157e5[_0x1d9240(0x162)]))[_0x1d9240(0x16f)](()=>_0x36ee64[_0x1d9240(0x147)]):_0x36ee64[_0x1d9240(0x147)];_0x29fe57[_0x1d9240(0x158)][_0x28b734['sqlCode']]={...buildSqlLockEntry(_0xe157e5,_0x52f0cd,_0x12c83e,{'dbName':_0x38b54b}),'path':_0x28b734[_0x1d9240(0x179)],'mode':_0x5d87e3[_0x1d9240(0x166)]},await archivePreviousSqlFileIfNeeded(_0x52837a,_0x5d87e3[_0x1d9240(0x141)],_0x28b734[_0x1d9240(0x179)]),_0x1bdfb4['push']({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'remoteId':_0x5d87e3[_0x1d9240(0x13c)]});}catch(_0x24b2e6){_0x510da0[_0x1d9240(0x15d)]({'sqlCode':_0x28b734[_0x1d9240(0x15e)],'error':_0x24b2e6 instanceof Error?_0x24b2e6[_0x1d9240(0x177)]:String(_0x24b2e6)});}}return _0x29fe57[_0x1d9240(0x14a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x52837a[_0x1d9240(0x16d)],_0x4b978b),{'ok':_0x510da0[_0x1d9240(0x14f)]===0x0,'data':{'pushed':_0x1bdfb4,'skipped':_0x3316fa,'failed':_0x510da0},'message':_0x1d9240(0x150)+_0x1bdfb4[_0x1d9240(0x14f)]+_0x1d9240(0x139)+_0x3316fa[_0x1d9240(0x14f)]+_0x1d9240(0x156)+_0x510da0[_0x1d9240(0x14f)]+_0x1d9240(0x170)};}};async function archivePreviousSqlFileIfNeeded(_0x48c3ab,_0x1a6df2,_0x4de8f0){const _0x3cd742=a198_0x8130a9;if(!_0x1a6df2||_0x1a6df2===_0x4de8f0)return;const _0x238a03=join(_0x48c3ab['sqlRootDir'],_0x1a6df2);if(!await fileExists(_0x238a03))return;const _0x2606e3=await moveToTrash(_0x48c3ab['projectRoot'],_0x48c3ab[_0x3cd742(0x14b)],_0x238a03);await cleanupEmptyDirectories(dirname(_0x238a03),_0x48c3ab[_0x3cd742(0x160)]),void _0x2606e3;}async function moveToTrash(_0x4f19cb,_0x7c6537,_0x1b09a3){const _0x1dce91=a198_0x8130a9,_0xfa336b=new Date()[_0x1dce91(0x165)]()[_0x1dce91(0x161)](/[:.]/g,'-'),_0xef8a6f=relative(_0x4f19cb,_0x1b09a3),_0x3b3716=join(_0x7c6537,_0xfa336b,_0xef8a6f);return await mkdir(dirname(_0x3b3716),{'recursive':!![]}),await rename(_0x1b09a3,_0x3b3716),_0x3b3716;}async function cleanupEmptyDirectories(_0x81ce22,_0x4be9cc){const _0x446418=a198_0x8130a9;let _0x411427=resolve(_0x81ce22);const _0x5da06c=resolve(_0x4be9cc);while(_0x411427[_0x446418(0x149)](''+_0x5da06c+sep)||_0x411427===_0x5da06c){if(_0x411427===_0x5da06c)return;try{const _0x12ed32=await readdir(_0x411427);if(_0x12ed32['length']>0x0)return;await rmdir(_0x411427);}catch{return;}_0x411427=dirname(_0x411427);}}async function resolveTargetDbBinding(_0x365d35,_0x29c742,_0x23c93){const _0x35e841=a198_0x8130a9,_0x552e79=_0x29c742[_0x35e841(0x15a)];if(!_0x552e79)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0x32a2ae=buildDbDirectoryName(_0x23c93[_0x35e841(0x147)],_0x23c93['dbId']);if(_0x552e79===_0x32a2ae)return{'dbId':_0x23c93[_0x35e841(0x162)],'dbName':_0x23c93[_0x35e841(0x147)]};const _0xc5b942=parseExplicitDbDirectory(_0x552e79);if(_0xc5b942!=null)return{'dbId':_0xc5b942,'dbName':await getDbName(_0x365d35,_0xc5b942)[_0x35e841(0x16f)](()=>undefined)};const _0x502a15=await listDatabases(_0x365d35),_0x41e836=_0x502a15[_0x35e841(0x15c)](_0xbdcddb=>buildDbDirectoryName(_0xbdcddb['dbName'],_0xbdcddb['dbId'])===_0x552e79);if(_0x41e836[_0x35e841(0x14f)]===0x1)return{'dbId':_0x41e836[0x0][_0x35e841(0x162)],'dbName':_0x41e836[0x0][_0x35e841(0x147)]};if(_0x41e836[_0x35e841(0x14f)]===0x0)throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x148)+_0x552e79+'\x22\x20for\x20sqlCode\x20'+_0x29c742[_0x35e841(0x15e)]+'.');const _0x3cc6c7=_0x41e836[_0x35e841(0x173)](_0x5c6a06=>_0x5c6a06[_0x35e841(0x147)]+'\x20('+_0x5c6a06[_0x35e841(0x162)]+')')[_0x35e841(0x13f)](',\x20');throw CliErrors[_0x35e841(0x13d)](_0x35e841(0x152)+_0x552e79+_0x35e841(0x171)+_0x29c742[_0x35e841(0x15e)]+':\x20'+_0x3cc6c7);}function parseExplicitDbDirectory(_0x4c4bdf){const _0x2cdfb6=a198_0x8130a9,_0x36f317=/^db-(\d+)$/[_0x2cdfb6(0x176)](_0x4c4bdf);if(!_0x36f317)return null;const _0x1e56ff=Number(_0x36f317[0x1]);return Number['isFinite'](_0x1e56ff)&&_0x1e56ff>0x0?_0x1e56ff:null;}
@@ -1 +1 @@
1
- const a199_0x31d501=a199_0x8875;(function(_0x3a0e13,_0x5b599b){const _0x486215=a199_0x8875,_0xe7500=_0x3a0e13();while(!![]){try{const _0x154add=parseInt(_0x486215(0xfe))/0x1+-parseInt(_0x486215(0xfd))/0x2+-parseInt(_0x486215(0xfb))/0x3*(parseInt(_0x486215(0x10d))/0x4)+parseInt(_0x486215(0xfa))/0x5*(parseInt(_0x486215(0x119))/0x6)+-parseInt(_0x486215(0xf5))/0x7+parseInt(_0x486215(0x100))/0x8+-parseInt(_0x486215(0x10f))/0x9*(-parseInt(_0x486215(0xf1))/0xa);if(_0x154add===_0x5b599b)break;else _0xe7500['push'](_0xe7500['shift']());}catch(_0x2b38e3){_0xe7500['push'](_0xe7500['shift']());}}}(a199_0x1824,0xcfaad));function a199_0x8875(_0x53c981,_0x3a7134){_0x53c981=_0x53c981-0xf1;const _0x18244d=a199_0x1824();let _0x887553=_0x18244d[_0x53c981];return _0x887553;}import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a199_0x31d501(0x10b);export function buildSqlLockEntry(_0x4ae059,_0x4cfc58,_0x1c2f16,_0x48cec3){const _0x14390d=a199_0x31d501,_0x5950da=detectSqlMode(_0x4cfc58);return{'path':buildSqlRelativePath(_0x4ae059[_0x14390d(0x117)],_0x4ae059[_0x14390d(0x110)],_0x48cec3?.[_0x14390d(0xff)],_0x5950da,_0x4ae059['dbId']),'hash':_0x1c2f16,'remoteId':_0x4ae059['id'],'version':_0x4ae059[_0x14390d(0x113)],'dbId':Number(_0x4ae059[_0x14390d(0xf4)]),'dbName':_0x48cec3?.[_0x14390d(0xff)],'sqlName':_0x4ae059[_0x14390d(0x110)],'sqlConfig':_0x4ae059['sqlConfig']??undefined,'mode':_0x5950da};}export function cloneSqlLockData(_0xfedd7c){const _0xfbe808=a199_0x31d501;return{'apps':Object[_0xfbe808(0x107)](Object['entries'](_0xfedd7c[_0xfbe808(0xf2)])[_0xfbe808(0xf6)](([_0x3ec3cc,_0xac5f9])=>[_0x3ec3cc,{'sqlRoot':_0xac5f9[_0xfbe808(0x108)],'lastSync':_0xac5f9[_0xfbe808(0xfc)],'sqls':{..._0xac5f9['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3428f3){return _0x3428f3['sqlContent']??'';}function a199_0x1824(){const _0x460e95=['version','\x20-->','mybatisXml','length','sqlCode','<!--\x20@lovrabet.','24jYjTpR','path','yes','6354410vmWiYk','apps','push','dbId','7835485bRzRzh','map','replace','join','description','557565qTghJO','194124yPjVGB','lastSync','1789110nThDll','1512129ZNzTdL','dbName','13038088UNQCtP','stderr','mode','\x20[y/N]\x20','split','syncedAt','trim','fromEntries','sqlRoot','trimStart','stdin','.rabetbase/sql','test','84JoTwxT','question','9HrBmbZ','sqlName','filter','toLowerCase'];a199_0x1824=function(){return _0x460e95;};return a199_0x1824();}export function buildLocalSqlFileContent(_0x5901f4,_0x440683,_0x51d651){const _0x4207d9=a199_0x31d501,_0x1c3df4=_0x51d651?.[_0x4207d9(0x102)]??detectSqlMode(_0x440683),_0x59cf68=stripLocalSqlMetadata(_0x440683,_0x1c3df4)['trim'](),_0x60f002=[...buildMetadataHeaderLines({'sqlCode':_0x5901f4[_0x4207d9(0x117)],'sqlName':_0x5901f4[_0x4207d9(0x110)],'dbId':_0x5901f4[_0x4207d9(0xf4)],'dbName':_0x51d651?.['dbName'],'mode':_0x1c3df4,'syncedAt':_0x51d651?.[_0x4207d9(0x105)],'description':_0x51d651?.['description']},_0x1c3df4),'',_0x59cf68],_0xe5a10f=_0x60f002['join']('\x0a');return _0xe5a10f['endsWith']('\x0a')?_0xe5a10f:_0xe5a10f+'\x0a';}export function stripLocalSqlMetadata(_0x19ee3b,_0x127cbe){const _0x3c7977=a199_0x31d501,_0x4ef3d2=_0x19ee3b[_0x3c7977(0xf7)](/\r\n/g,'\x0a')[_0x3c7977(0x104)]('\x0a'),_0x3130db=[];let _0x57e0e1=0x0;if(_0x127cbe===_0x3c7977(0x115))while(_0x57e0e1<_0x4ef3d2[_0x3c7977(0x116)]){const _0x5ac6fe=_0x4ef3d2[_0x57e0e1]??'';if(/^\s*<!--\s*@lovrabet\./[_0x3c7977(0x10c)](_0x5ac6fe)){_0x57e0e1++;continue;}if(_0x5ac6fe['trim']()===''&&_0x57e0e1>0x0){_0x57e0e1++;continue;}break;}else while(_0x57e0e1<_0x4ef3d2[_0x3c7977(0x116)]){const _0x325616=_0x4ef3d2[_0x57e0e1]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x325616)){_0x57e0e1++;continue;}if(_0x325616[_0x3c7977(0x106)]()===''&&_0x57e0e1>0x0){_0x57e0e1++;continue;}break;}for(;_0x57e0e1<_0x4ef3d2[_0x3c7977(0x116)];_0x57e0e1++){_0x3130db[_0x3c7977(0xf3)](_0x4ef3d2[_0x57e0e1]);}return _0x3130db[_0x3c7977(0xf8)]('\x0a')[_0x3c7977(0x109)]();}export function resolveSqlMode(_0x20fd0f,_0x5685ec){if(_0x5685ec?.['mode'])return _0x5685ec['mode'];return detectSqlMode(_0x20fd0f);}export function resolveSqlFileName(_0x51380b,_0xc434a,_0x392eb5){const _0x7bb3ab=a199_0x31d501;if(_0x392eb5?.[_0x7bb3ab(0x11a)])return _0x392eb5[_0x7bb3ab(0x11a)];if(_0x392eb5?.['sqlName']||_0x392eb5?.[_0x7bb3ab(0xff)])return buildSqlRelativePath(_0x51380b,_0x392eb5?.[_0x7bb3ab(0x110)],_0x392eb5?.[_0x7bb3ab(0xff)],resolveSqlMode(_0xc434a,_0x392eb5),_0x392eb5?.[_0x7bb3ab(0xf4)]);return buildDefaultSqlFileName(_0x51380b,resolveSqlMode(_0xc434a,_0x392eb5));}export function resolveSqlLocalDir(_0x1d0116,_0x2c601a){return join(_0x1d0116,SQL_LOCAL_REL_DIR,_0x2c601a);}export async function confirmForceOverwrite(_0x2faaa3){const _0x2d8378=a199_0x31d501,_0x54ec86=createInterface({'input':process[_0x2d8378(0x10a)],'output':process[_0x2d8378(0x101)]}),_0x4ca052=await new Promise(_0x5245e6=>{const _0x1edd52=_0x2d8378;_0x54ec86[_0x1edd52(0x10e)](_0x2faaa3+_0x1edd52(0x103),_0x5245e6);});return _0x54ec86['close'](),['y',_0x2d8378(0x11b)]['includes'](_0x4ca052[_0x2d8378(0x106)]()[_0x2d8378(0x112)]());}export function findSqlLockScope(_0x5c871b,_0x408130){return _0x5c871b['apps'][_0x408130];}function buildMetadataHeaderLines(_0x230fcf,_0x37a272){const _0x5bae9a=a199_0x31d501,_0x3717fd=[[_0x5bae9a(0x117),_0x230fcf[_0x5bae9a(0x117)]],[_0x5bae9a(0x110),_0x230fcf[_0x5bae9a(0x110)]],[_0x5bae9a(0xf4),_0x230fcf[_0x5bae9a(0xf4)]],['dbName',_0x230fcf[_0x5bae9a(0xff)]],[_0x5bae9a(0x102),_0x230fcf[_0x5bae9a(0x102)]],[_0x5bae9a(0x105),_0x230fcf[_0x5bae9a(0x105)]],[_0x5bae9a(0xf9),_0x230fcf[_0x5bae9a(0xf9)]]];if(_0x37a272==='mybatisXml')return _0x3717fd[_0x5bae9a(0x111)](([,_0x4da029])=>_0x4da029!==undefined&&_0x4da029!==null&&String(_0x4da029)[_0x5bae9a(0x106)]()!=='')[_0x5bae9a(0xf6)](([_0x3962e1,_0x15a03f])=>_0x5bae9a(0x118)+_0x3962e1+':\x20'+String(_0x15a03f)+_0x5bae9a(0x114));return _0x3717fd[_0x5bae9a(0x111)](([,_0x3d195b])=>_0x3d195b!==undefined&&_0x3d195b!==null&&String(_0x3d195b)[_0x5bae9a(0x106)]()!=='')[_0x5bae9a(0xf6)](([_0x47715b,_0x571a8c])=>'--\x20@lovrabet.'+_0x47715b+':\x20'+String(_0x571a8c));}
1
+ const a199_0x7931c3=a199_0x4dd0;(function(_0x2c8131,_0x9391d9){const _0x4a8329=a199_0x4dd0,_0x362648=_0x2c8131();while(!![]){try{const _0x28c735=parseInt(_0x4a8329(0x115))/0x1*(parseInt(_0x4a8329(0x128))/0x2)+-parseInt(_0x4a8329(0x11e))/0x3*(parseInt(_0x4a8329(0x108))/0x4)+-parseInt(_0x4a8329(0x123))/0x5*(-parseInt(_0x4a8329(0x105))/0x6)+parseInt(_0x4a8329(0x118))/0x7*(-parseInt(_0x4a8329(0x110))/0x8)+-parseInt(_0x4a8329(0x111))/0x9*(-parseInt(_0x4a8329(0x11d))/0xa)+parseInt(_0x4a8329(0x122))/0xb+parseInt(_0x4a8329(0x126))/0xc*(-parseInt(_0x4a8329(0x109))/0xd);if(_0x28c735===_0x9391d9)break;else _0x362648['push'](_0x362648['shift']());}catch(_0x554f7a){_0x362648['push'](_0x362648['shift']());}}}(a199_0x468a,0x20f24));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a199_0x468a(){const _0x46ccc4=['70OvTCvm','sqlCode','close','.rabetbase/sql','\x20[y/N]\x20','20AqQKlf','3lvHkll','stderr','syncedAt','yes','2664156DEuHcb','5YWdfJZ','join','length','1116084VoLaxK','--\x20@lovrabet.','253700lYDUev','path','map','dbName','mybatisXml','filter','split','test','388536aAtVLt','<!--\x20@lovrabet.','sqlName','400852NcWZzy','13smxfPZ','description','apps','sqlContent','push','trim','dbId','156048qeyyNk','402417DMHXAS','version','\x20-->','lastSync','1yEAFgH','stdin','mode'];a199_0x468a=function(){return _0x46ccc4;};return a199_0x468a();}export const SQL_LOCAL_REL_DIR=a199_0x7931c3(0x11b);export function buildSqlLockEntry(_0xb20b3a,_0x39e01a,_0x5f314e,_0x5c1053){const _0x3c5ab7=a199_0x7931c3,_0x535b52=detectSqlMode(_0x39e01a);return{'path':buildSqlRelativePath(_0xb20b3a[_0x3c5ab7(0x119)],_0xb20b3a[_0x3c5ab7(0x107)],_0x5c1053?.[_0x3c5ab7(0x100)],_0x535b52,_0xb20b3a[_0x3c5ab7(0x10f)]),'hash':_0x5f314e,'remoteId':_0xb20b3a['id'],'version':_0xb20b3a[_0x3c5ab7(0x112)],'dbId':Number(_0xb20b3a[_0x3c5ab7(0x10f)]),'dbName':_0x5c1053?.[_0x3c5ab7(0x100)],'sqlName':_0xb20b3a[_0x3c5ab7(0x107)],'sqlConfig':_0xb20b3a['sqlConfig']??undefined,'mode':_0x535b52};}export function cloneSqlLockData(_0x3f081b){const _0x413565=a199_0x7931c3;return{'apps':Object['fromEntries'](Object['entries'](_0x3f081b[_0x413565(0x10b)])[_0x413565(0xff)](([_0x3f68f8,_0xa11a6e])=>[_0x3f68f8,{'sqlRoot':_0xa11a6e['sqlRoot'],'lastSync':_0xa11a6e[_0x413565(0x114)],'sqls':{..._0xa11a6e['sqls']}}]))};}export function ensureRemoteSqlContent(_0x3ab31c){const _0x5b76ea=a199_0x7931c3;return _0x3ab31c[_0x5b76ea(0x10c)]??'';}function a199_0x4dd0(_0x1d0987,_0x1b6be9){_0x1d0987=_0x1d0987-0xff;const _0x468a9c=a199_0x468a();let _0x4dd023=_0x468a9c[_0x1d0987];return _0x4dd023;}export function buildLocalSqlFileContent(_0x197d25,_0x21211d,_0x16bd6b){const _0xad9d98=a199_0x7931c3,_0xb45b12=_0x16bd6b?.[_0xad9d98(0x117)]??detectSqlMode(_0x21211d),_0x25fab9=stripLocalSqlMetadata(_0x21211d,_0xb45b12)['trim'](),_0x3af4db=[...buildMetadataHeaderLines({'sqlCode':_0x197d25[_0xad9d98(0x119)],'sqlName':_0x197d25[_0xad9d98(0x107)],'dbId':_0x197d25[_0xad9d98(0x10f)],'dbName':_0x16bd6b?.[_0xad9d98(0x100)],'mode':_0xb45b12,'syncedAt':_0x16bd6b?.['syncedAt'],'description':_0x16bd6b?.[_0xad9d98(0x10a)]},_0xb45b12),'',_0x25fab9],_0x25f03e=_0x3af4db[_0xad9d98(0x124)]('\x0a');return _0x25f03e['endsWith']('\x0a')?_0x25f03e:_0x25f03e+'\x0a';}export function stripLocalSqlMetadata(_0x28e8b5,_0x23c416){const _0x2e2ef2=a199_0x7931c3,_0x3a4180=_0x28e8b5['replace'](/\r\n/g,'\x0a')[_0x2e2ef2(0x103)]('\x0a'),_0x418ae9=[];let _0xa1e290=0x0;if(_0x23c416===_0x2e2ef2(0x101))while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x3f5682=_0x3a4180[_0xa1e290]??'';if(/^\s*<!--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x3f5682)){_0xa1e290++;continue;}if(_0x3f5682[_0x2e2ef2(0x10e)]()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}else while(_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)]){const _0x11ca27=_0x3a4180[_0xa1e290]??'';if(/^\s*--\s*@lovrabet\./[_0x2e2ef2(0x104)](_0x11ca27)){_0xa1e290++;continue;}if(_0x11ca27['trim']()===''&&_0xa1e290>0x0){_0xa1e290++;continue;}break;}for(;_0xa1e290<_0x3a4180[_0x2e2ef2(0x125)];_0xa1e290++){_0x418ae9[_0x2e2ef2(0x10d)](_0x3a4180[_0xa1e290]);}return _0x418ae9['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x4458af,_0x13dc7b){const _0x469645=a199_0x7931c3;if(_0x13dc7b?.[_0x469645(0x117)])return _0x13dc7b[_0x469645(0x117)];return detectSqlMode(_0x4458af);}export function resolveSqlFileName(_0x1e1e22,_0xa2c040,_0x4c7d06){const _0x46df0f=a199_0x7931c3;if(_0x4c7d06?.[_0x46df0f(0x129)])return _0x4c7d06[_0x46df0f(0x129)];if(_0x4c7d06?.[_0x46df0f(0x107)]||_0x4c7d06?.['dbName'])return buildSqlRelativePath(_0x1e1e22,_0x4c7d06?.[_0x46df0f(0x107)],_0x4c7d06?.[_0x46df0f(0x100)],resolveSqlMode(_0xa2c040,_0x4c7d06),_0x4c7d06?.['dbId']);return buildDefaultSqlFileName(_0x1e1e22,resolveSqlMode(_0xa2c040,_0x4c7d06));}export function resolveSqlLocalDir(_0x38d117,_0x2b6d6b){return join(_0x38d117,SQL_LOCAL_REL_DIR,_0x2b6d6b);}export async function confirmForceOverwrite(_0x288aa5){const _0x5bb283=a199_0x7931c3,_0x5ba4c9=createInterface({'input':process[_0x5bb283(0x116)],'output':process[_0x5bb283(0x11f)]}),_0x5919e2=await new Promise(_0x5c0591=>{const _0x20a92b=_0x5bb283;_0x5ba4c9['question'](_0x288aa5+_0x20a92b(0x11c),_0x5c0591);});return _0x5ba4c9[_0x5bb283(0x11a)](),['y',_0x5bb283(0x121)]['includes'](_0x5919e2[_0x5bb283(0x10e)]()['toLowerCase']());}export function findSqlLockScope(_0x5d90c8,_0xd1edfc){const _0x77f6f7=a199_0x7931c3;return _0x5d90c8[_0x77f6f7(0x10b)][_0xd1edfc];}function buildMetadataHeaderLines(_0x179e5a,_0x548032){const _0x48c0e9=a199_0x7931c3,_0x5c753e=[[_0x48c0e9(0x119),_0x179e5a[_0x48c0e9(0x119)]],[_0x48c0e9(0x107),_0x179e5a[_0x48c0e9(0x107)]],[_0x48c0e9(0x10f),_0x179e5a[_0x48c0e9(0x10f)]],[_0x48c0e9(0x100),_0x179e5a[_0x48c0e9(0x100)]],[_0x48c0e9(0x117),_0x179e5a[_0x48c0e9(0x117)]],[_0x48c0e9(0x120),_0x179e5a['syncedAt']],[_0x48c0e9(0x10a),_0x179e5a[_0x48c0e9(0x10a)]]];if(_0x548032==='mybatisXml')return _0x5c753e[_0x48c0e9(0x102)](([,_0x3e98db])=>_0x3e98db!==undefined&&_0x3e98db!==null&&String(_0x3e98db)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x16f2ac,_0x3d51c5])=>_0x48c0e9(0x106)+_0x16f2ac+':\x20'+String(_0x3d51c5)+_0x48c0e9(0x113));return _0x5c753e[_0x48c0e9(0x102)](([,_0x1323bb])=>_0x1323bb!==undefined&&_0x1323bb!==null&&String(_0x1323bb)[_0x48c0e9(0x10e)]()!=='')[_0x48c0e9(0xff)](([_0x7d0d0a,_0x47f7b6])=>_0x48c0e9(0x127)+_0x7d0d0a+':\x20'+String(_0x47f7b6));}
@@ -1 +1 @@
1
- const a200_0x1dcb87=a200_0x2004;(function(_0x3d66f1,_0x950c76){const _0x23466f=a200_0x2004,_0x253a22=_0x3d66f1();while(!![]){try{const _0x217f9d=-parseInt(_0x23466f(0x88))/0x1+parseInt(_0x23466f(0x82))/0x2+-parseInt(_0x23466f(0x75))/0x3+-parseInt(_0x23466f(0x90))/0x4+-parseInt(_0x23466f(0x84))/0x5+-parseInt(_0x23466f(0x83))/0x6+-parseInt(_0x23466f(0x8e))/0x7*(-parseInt(_0x23466f(0x7f))/0x8);if(_0x217f9d===_0x950c76)break;else _0x253a22['push'](_0x253a22['shift']());}catch(_0x5be1dd){_0x253a22['push'](_0x253a22['shift']());}}}(a200_0x2d39,0xb9729));function a200_0x2d39(){const _0x9fdd45=['\x20unchanged','hash','totalCount','3467946aHxuCx','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','status','length','has','path','sqls','push','sqlName','tableData','104184idQxUr','appCode','sqlRoot','1841498WZBtDr','4972170zjXAKj','552730miVZgl','\x20modified,\x20','map','remote','1113443hoRmkw','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockKey','sql','read','boolean','2212QeVZCA','\x20added,\x20','4271032HxhwzM','sqlCode','paging','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','bool','relativePath'];a200_0x2d39=function(){return _0x9fdd45;};return a200_0x2d39();}import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a200_0x2004(_0x4df51d,_0x886584){_0x4df51d=_0x4df51d-0x6d;const _0x2d396e=a200_0x2d39();let _0x200431=_0x2d396e[_0x4df51d];return _0x200431;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1adc17){const _0x509edb=a200_0x2004,_0x1f2f29=[];let _0xee969b=0x1;while(!![]){const _0x49d721=await listSqlQueries(_0x1adc17,{'currentPage':_0xee969b,'pageSize':PAGE_SIZE}),_0x5b9383=_0x49d721[_0x509edb(0x7e)]??[];_0x1f2f29['push'](..._0x5b9383['map'](_0x26af24=>_0x26af24[_0x509edb(0x6d)]));if(_0x5b9383['length']===0x0)break;const _0x27e8d7=_0x49d721[_0x509edb(0x6e)]?.[_0x509edb(0x74)];if(_0x27e8d7!=null?_0x1f2f29['length']>=_0x27e8d7:_0x5b9383[_0x509edb(0x78)]<PAGE_SIZE)break;_0xee969b++;}return _0x1f2f29;}export const sqlStatus={'service':a200_0x1dcb87(0x8b),'command':a200_0x1dcb87(0x77),'description':a200_0x1dcb87(0x6f),'risk':a200_0x1dcb87(0x8c),'flags':[{'name':a200_0x1dcb87(0x87),'type':a200_0x1dcb87(0x8d),'description':a200_0x1dcb87(0x76)}],async 'execute'(_0x4e47aa){const _0x283119=a200_0x1dcb87,_0x14953c=loadSqlProjectConfig(_0x4e47aa[_0x283119(0x80)]),_0x5cd7ba=await readSqlLockFile(_0x14953c['lockFilePath']),{appLock:_0x356945}=ensureSqlLockScope(_0x5cd7ba??createEmptySqlLock(),_0x14953c[_0x283119(0x80)],_0x14953c[_0x283119(0x81)],_0x283119(0x77)),_0xe87fa=await scanLocalSqlQueries(_0x14953c),_0x1a4991=[],_0x28768a=[],_0x3130b1=[],_0x407ed7=[],_0x2446bf=new Set(_0xe87fa[_0x283119(0x86)](_0x2bd170=>_0x2bd170[_0x283119(0x8a)]));for(const _0x1ab385 of _0xe87fa){const _0xe90d89=await computeSqlFileHash(_0x1ab385['filePath']),_0x18b080=_0x356945['sqls'][_0x1ab385[_0x283119(0x8a)]],_0x5b5ff9=!!_0x18b080&&_0x18b080[_0x283119(0x7a)]!==_0x1ab385[_0x283119(0x71)],_0x4e43be=!!_0x18b080&&!!_0x1ab385['sqlName']&&_0x18b080['sqlName']!==_0x1ab385[_0x283119(0x7d)];if(!_0x18b080)_0x1a4991[_0x283119(0x7c)](_0x1ab385[_0x283119(0x8a)]);else _0x18b080[_0x283119(0x73)]!==_0xe90d89||_0x5b5ff9||_0x4e43be?_0x28768a[_0x283119(0x7c)](_0x1ab385[_0x283119(0x8a)]):_0x3130b1['push'](_0x1ab385[_0x283119(0x8a)]);}for(const _0x54fca6 of Object['keys'](_0x356945[_0x283119(0x7b)])){!_0x2446bf[_0x283119(0x79)](_0x54fca6)&&_0x407ed7['push'](_0x54fca6);}const _0x4d0d6d=[];if(_0x4e47aa[_0x283119(0x70)](_0x283119(0x87))){const _0x4ad60b=await fetchAllSqlCodes(_0x4e47aa[_0x283119(0x80)]);for(const _0x169a00 of _0x4ad60b){!_0x2446bf[_0x283119(0x79)](_0x169a00)&&!_0x356945['sqls'][_0x169a00]&&_0x4d0d6d[_0x283119(0x7c)](_0x169a00);}}const _0x380c1f=_0x1a4991['length']===0x0&&_0x28768a[_0x283119(0x78)]===0x0&&_0x407ed7[_0x283119(0x78)]===0x0&&_0x4d0d6d['length']===0x0;return{'ok':!![],'data':{'added':_0x1a4991,'modified':_0x28768a,'missing':_0x407ed7,'unchanged':_0x3130b1,'remoteOnly':_0x4d0d6d},'message':_0x380c1f?_0x283119(0x89):_0x1a4991[_0x283119(0x78)]+_0x283119(0x8f)+_0x28768a[_0x283119(0x78)]+_0x283119(0x85)+_0x407ed7[_0x283119(0x78)]+'\x20missing,\x20'+_0x3130b1[_0x283119(0x78)]+_0x283119(0x72)+(_0x4d0d6d[_0x283119(0x78)]>0x0?',\x20'+_0x4d0d6d[_0x283119(0x78)]+'\x20remote-only':'')};}};
1
+ const a200_0x47656a=a200_0x3465;(function(_0x41c439,_0x1b4adf){const _0x2067ca=a200_0x3465,_0x59b423=_0x41c439();while(!![]){try{const _0x1fc561=parseInt(_0x2067ca(0x1ba))/0x1*(parseInt(_0x2067ca(0x1a8))/0x2)+parseInt(_0x2067ca(0x1ac))/0x3*(parseInt(_0x2067ca(0x1c1))/0x4)+parseInt(_0x2067ca(0x1bd))/0x5*(parseInt(_0x2067ca(0x1bb))/0x6)+parseInt(_0x2067ca(0x1a1))/0x7*(parseInt(_0x2067ca(0x1a7))/0x8)+parseInt(_0x2067ca(0x1c0))/0x9*(-parseInt(_0x2067ca(0x1af))/0xa)+parseInt(_0x2067ca(0x1bc))/0xb*(parseInt(_0x2067ca(0x1a4))/0xc)+-parseInt(_0x2067ca(0x1ad))/0xd;if(_0x1fc561===_0x1b4adf)break;else _0x59b423['push'](_0x59b423['shift']());}catch(_0x4921b6){_0x59b423['push'](_0x59b423['shift']());}}}(a200_0x141b,0x9d03e));import{listSqlQueries}from'../../core/api-client.js';function a200_0x3465(_0x3ca09a,_0x51b35f){_0x3ca09a=_0x3ca09a-0x1a1;const _0x141b52=a200_0x141b();let _0x3465f6=_0x141b52[_0x3ca09a];return _0x3465f6;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x3b005b){const _0x5ed89b=a200_0x3465,_0x5ed49e=[];let _0x26a6e3=0x1;while(!![]){const _0x3194a3=await listSqlQueries(_0x3b005b,{'currentPage':_0x26a6e3,'pageSize':PAGE_SIZE}),_0x2587dc=_0x3194a3['tableData']??[];_0x5ed49e[_0x5ed89b(0x1c4)](..._0x2587dc[_0x5ed89b(0x1c3)](_0xf10e2=>_0xf10e2[_0x5ed89b(0x1b3)]));if(_0x2587dc[_0x5ed89b(0x1b1)]===0x0)break;const _0x589149=_0x3194a3['paging']?.[_0x5ed89b(0x1a3)];if(_0x589149!=null?_0x5ed49e['length']>=_0x589149:_0x2587dc[_0x5ed89b(0x1b1)]<PAGE_SIZE)break;_0x26a6e3++;}return _0x5ed49e;}function a200_0x141b(){const _0x21df12=['sql','131350JexaCw','\x20unchanged','length','\x20modified,\x20','sqlCode','All\x20SQL\x20queries\x20are\x20in\x20sync.','lockKey','keys','lockFilePath','filePath','remote','11GQEQtt','51162ezdsSZ','21142APZDZl','190DNUWVt','sqlName','\x20remote-only','513fqKjZc','2164ypgOke','bool','map','push','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','\x20missing,\x20','sqls','917zpmQAL','path','totalCount','3972MZZhHN','read','sqlRoot','72272FGkUZe','61882mvGKEw','\x20added,\x20','appCode','boolean','3453nHcZmy','22293375UQzCah'];a200_0x141b=function(){return _0x21df12;};return a200_0x141b();}export const sqlStatus={'service':a200_0x47656a(0x1ae),'command':'status','description':a200_0x47656a(0x1c5),'risk':a200_0x47656a(0x1a5),'flags':[{'name':a200_0x47656a(0x1b9),'type':a200_0x47656a(0x1ab),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x20d6dc){const _0x37fe22=a200_0x47656a,_0x71dec8=loadSqlProjectConfig(_0x20d6dc['appCode']),_0x1e8968=await readSqlLockFile(_0x71dec8[_0x37fe22(0x1b7)]),{appLock:_0x1bf879}=ensureSqlLockScope(_0x1e8968??createEmptySqlLock(),_0x71dec8[_0x37fe22(0x1aa)],_0x71dec8[_0x37fe22(0x1a6)],'status'),_0xbbf5e6=await scanLocalSqlQueries(_0x71dec8),_0x54c285=[],_0x13555e=[],_0x15c864=[],_0x5e6e6d=[],_0x3c9b94=new Set(_0xbbf5e6[_0x37fe22(0x1c3)](_0x553469=>_0x553469['lockKey']));for(const _0x169205 of _0xbbf5e6){const _0x1cd5ff=await computeSqlFileHash(_0x169205[_0x37fe22(0x1b8)]),_0x47437f=_0x1bf879[_0x37fe22(0x1c7)][_0x169205[_0x37fe22(0x1b5)]],_0x169978=!!_0x47437f&&_0x47437f[_0x37fe22(0x1a2)]!==_0x169205['relativePath'],_0x3771a3=!!_0x47437f&&!!_0x169205[_0x37fe22(0x1be)]&&_0x47437f[_0x37fe22(0x1be)]!==_0x169205[_0x37fe22(0x1be)];if(!_0x47437f)_0x54c285[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);else _0x47437f['hash']!==_0x1cd5ff||_0x169978||_0x3771a3?_0x13555e[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]):_0x15c864[_0x37fe22(0x1c4)](_0x169205[_0x37fe22(0x1b5)]);}for(const _0x2dfdeb of Object[_0x37fe22(0x1b6)](_0x1bf879[_0x37fe22(0x1c7)])){!_0x3c9b94['has'](_0x2dfdeb)&&_0x5e6e6d[_0x37fe22(0x1c4)](_0x2dfdeb);}const _0x1edfb9=[];if(_0x20d6dc[_0x37fe22(0x1c2)](_0x37fe22(0x1b9))){const _0x53f1=await fetchAllSqlCodes(_0x20d6dc['appCode']);for(const _0x5ea187 of _0x53f1){!_0x3c9b94['has'](_0x5ea187)&&!_0x1bf879['sqls'][_0x5ea187]&&_0x1edfb9[_0x37fe22(0x1c4)](_0x5ea187);}}const _0xe963bc=_0x54c285[_0x37fe22(0x1b1)]===0x0&&_0x13555e[_0x37fe22(0x1b1)]===0x0&&_0x5e6e6d[_0x37fe22(0x1b1)]===0x0&&_0x1edfb9[_0x37fe22(0x1b1)]===0x0;return{'ok':!![],'data':{'added':_0x54c285,'modified':_0x13555e,'missing':_0x5e6e6d,'unchanged':_0x15c864,'remoteOnly':_0x1edfb9},'message':_0xe963bc?_0x37fe22(0x1b4):_0x54c285[_0x37fe22(0x1b1)]+_0x37fe22(0x1a9)+_0x13555e[_0x37fe22(0x1b1)]+_0x37fe22(0x1b2)+_0x5e6e6d['length']+_0x37fe22(0x1c6)+_0x15c864[_0x37fe22(0x1b1)]+_0x37fe22(0x1b0)+(_0x1edfb9[_0x37fe22(0x1b1)]>0x0?',\x20'+_0x1edfb9[_0x37fe22(0x1b1)]+_0x37fe22(0x1bf):'')};}};
@@ -1 +1 @@
1
- const a201_0x23a3a0=a201_0x34e0;(function(_0x3272a7,_0xc87d66){const _0x3f409d=a201_0x34e0,_0x3f5906=_0x3272a7();while(!![]){try{const _0x5c6c9e=-parseInt(_0x3f409d(0x176))/0x1+-parseInt(_0x3f409d(0x172))/0x2*(parseInt(_0x3f409d(0x18e))/0x3)+-parseInt(_0x3f409d(0x165))/0x4+-parseInt(_0x3f409d(0x158))/0x5+parseInt(_0x3f409d(0x167))/0x6*(parseInt(_0x3f409d(0x16e))/0x7)+-parseInt(_0x3f409d(0x188))/0x8*(parseInt(_0x3f409d(0x177))/0x9)+parseInt(_0x3f409d(0x154))/0xa*(parseInt(_0x3f409d(0x18a))/0xb);if(_0x5c6c9e===_0xc87d66)break;else _0x3f5906['push'](_0x3f5906['shift']());}catch(_0x2768c5){_0x3f5906['push'](_0x3f5906['shift']());}}}(a201_0x23df,0x58d93));import{readFileSync,existsSync}from'node:fs';function a201_0x34e0(_0xb2996,_0x347a03){_0xb2996=_0xb2996-0x151;const _0x23dfa3=a201_0x23df();let _0x34e090=_0x23dfa3[_0xb2996];return _0x34e090;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a201_0x23df(){const _0x2719ad=['333221tOnEtm','parameters','--check-indexes\x20requires\x20--schemas.','push','2GWuppq','validation','reason','file','602995MSigvB','9zZCdNc','check-indexes','toLowerCase','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','string','dataset','type','utf-8','isDangerous','tableName','length','sql','read','cwd','\x22\x20not\x20found\x20or\x20not\x20accessible','filter','File\x20not\x20found:\x20','3690784MkGwfE','index_type','110vPOOsF','indexName','trim','indexes','1543803GHrvFj','schemaWarnings','joinAudit','isArray','primary','dbtableConfig','valid','split','Table\x20\x22','\x22\x20not\x20found\x20in\x20any\x20dataset','index_columns','1790330rXrRgm','appCode','tables','fields','2092435QulDve','index_name','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','sqlType','boolean','schema:','schemas','validate','name','find','size','SQL\x20schema\x20validation','381672uEdnCB','flatMap','84EMmfoY','message','columnNames','pkField','map','Dataset\x20\x22','str'];a201_0x23df=function(){return _0x2719ad;};return a201_0x23df();}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a201_0x23a3a0(0x182),'command':a201_0x23a3a0(0x160),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a201_0x23a3a0(0x183),'flags':[{'name':a201_0x23a3a0(0x175),'type':a201_0x23a3a0(0x17b),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a201_0x23a3a0(0x17b),'description':a201_0x23a3a0(0x15b)},{'name':a201_0x23a3a0(0x15f),'type':a201_0x23a3a0(0x17b),'description':a201_0x23a3a0(0x17a)},{'name':a201_0x23a3a0(0x178),'type':a201_0x23a3a0(0x15d),'description':a201_0x23a3a0(0x15a)}],async 'execute'(_0x2b41a7){const _0x4aeca6=a201_0x23a3a0,_0xafb977=_0x2b41a7[_0x4aeca6(0x16d)](_0x4aeca6(0x175)),_0x22954e=_0x2b41a7[_0x4aeca6(0x16d)](_0x4aeca6(0x182)),_0x39fa8c=_0x2b41a7['str'](_0x4aeca6(0x15f)),_0x49224d=_0x2b41a7['bool'](_0x4aeca6(0x178));if(!_0xafb977&&!_0x22954e)throw CliErrors['flagMissing'](_0x4aeca6(0x175),'Provide\x20--file\x20or\x20--sql');if(_0x49224d&&!_0x39fa8c)throw CliErrors[_0x4aeca6(0x173)](_0x4aeca6(0x170));let _0x416f4c;if(_0xafb977){const _0x574eb6=resolve(process[_0x4aeca6(0x184)](),_0xafb977);if(!existsSync(_0x574eb6))throw CliErrors[_0x4aeca6(0x173)](_0x4aeca6(0x187)+_0x574eb6);_0x416f4c=readFileSync(_0x574eb6,_0x4aeca6(0x17e));}else _0x416f4c=_0x22954e;const _0x5e93a1=validateSql(_0x416f4c),_0x3d0a3c={'valid':_0x5e93a1['valid'],'sqlType':_0x5e93a1[_0x4aeca6(0x15c)][_0x4aeca6(0x17d)],'isSelectOnly':_0x5e93a1[_0x4aeca6(0x15c)]['isSelectOnly'],'isDangerous':_0x5e93a1['sqlType'][_0x4aeca6(0x17f)],'tables':_0x5e93a1['tables'],'parameters':_0x5e93a1[_0x4aeca6(0x16f)],'message':_0x5e93a1[_0x4aeca6(0x168)]};_0x5e93a1['sqlType']['reason']&&(_0x3d0a3c[_0x4aeca6(0x174)]=_0x5e93a1[_0x4aeca6(0x15c)][_0x4aeca6(0x174)]);if(_0x39fa8c&&_0x5e93a1[_0x4aeca6(0x194)]){const _0x50512c=_0x39fa8c[_0x4aeca6(0x195)](',')[_0x4aeca6(0x16b)](_0x5ebb2a=>_0x5ebb2a[_0x4aeca6(0x18c)]())[_0x4aeca6(0x186)](Boolean),_0x54d276=[],_0x50faa9=[],_0x48d67a=filterDbTableBackedDatasets(await listDatasets(_0x2b41a7[_0x4aeca6(0x155)])),_0x39a144=new Map(_0x48d67a[_0x4aeca6(0x16b)](_0x2607e8=>[_0x2607e8[_0x4aeca6(0x193)]?.['tableName']?.[_0x4aeca6(0x179)](),_0x2607e8]));for(const _0x41451d of _0x5e93a1[_0x4aeca6(0x156)]){const _0x3db4c7=_0x39a144['get'](_0x41451d[_0x4aeca6(0x179)]());!_0x3db4c7&&_0x54d276[_0x4aeca6(0x171)](_0x4aeca6(0x151)+_0x41451d+_0x4aeca6(0x152));}for(const _0xae6b1a of _0x50512c){let _0x5d1631;try{_0x5d1631=await getDatasetDetail(_0xae6b1a);}catch{_0x54d276[_0x4aeca6(0x171)](_0x4aeca6(0x16c)+_0xae6b1a+_0x4aeca6(0x185));continue;}assertDatasetIsDbTableBacked(_0x5d1631,_0x4aeca6(0x164));const _0x4dec7b=Array[_0x4aeca6(0x191)](_0x5d1631[_0x4aeca6(0x157)])?_0x5d1631[_0x4aeca6(0x157)]:[],_0x5bd2f7=new Set(_0x4dec7b[_0x4aeca6(0x16b)](_0x122648=>_0x122648[_0x4aeca6(0x161)]?.[_0x4aeca6(0x179)]())),_0x540471=_0x5d1631[_0x4aeca6(0x193)]?.[_0x4aeca6(0x180)]||_0x5d1631[_0x4aeca6(0x180)]||_0xae6b1a;_0x3d0a3c[_0x4aeca6(0x15e)+_0x540471]={'code':_0xae6b1a,'tableName':_0x540471,'fieldCount':_0x5bd2f7[_0x4aeca6(0x163)],'fields':Array['from'](_0x5bd2f7)};if(_0x49224d){const _0x467953=normalizeDatasetIndexes(_0x5d1631);_0x50faa9['push']({'tableName':_0x540471,..._0x467953});}}_0x54d276[_0x4aeca6(0x181)]>0x0&&(_0x3d0a3c[_0x4aeca6(0x18f)]=_0x54d276),_0x49224d&&(_0x3d0a3c[_0x4aeca6(0x190)]=auditSqlJoinIndexes(_0x416f4c,_0x50faa9));}return{'ok':_0x5e93a1[_0x4aeca6(0x194)],'data':_0x3d0a3c,'message':_0x5e93a1['message']};}};function normalizeDatasetIndexes(_0x5e1563){const _0x371ebf=a201_0x23a3a0,_0x474b6d=Array[_0x371ebf(0x191)](_0x5e1563?.[_0x371ebf(0x17c)]?.[_0x371ebf(0x18d)])?_0x5e1563[_0x371ebf(0x17c)]['indexes']:Array['isArray'](_0x5e1563?.[_0x371ebf(0x18d)])?_0x5e1563[_0x371ebf(0x18d)]:[],_0x1b1399=_0x474b6d[_0x371ebf(0x166)](_0x161329=>{const _0x282b78=_0x371ebf,_0x409d4c=Array[_0x282b78(0x191)](_0x161329?.[_0x282b78(0x153)])?_0x161329[_0x282b78(0x153)]:Array[_0x282b78(0x191)](_0x161329?.['columnNames'])?_0x161329[_0x282b78(0x169)]:Array[_0x282b78(0x191)](_0x161329?.['columns'])?_0x161329['columns']:[],_0x4bae64=_0x409d4c[_0x282b78(0x186)](_0xa40f9b=>typeof _0xa40f9b===_0x282b78(0x17b))[_0x282b78(0x16b)](_0x28c20a=>_0x28c20a['trim']())[_0x282b78(0x186)](Boolean);if(_0x4bae64[_0x282b78(0x181)]===0x0)return[];const _0x382d43=[_0x161329?.[_0x282b78(0x18b)],_0x161329?.[_0x282b78(0x159)],_0x161329?.[_0x282b78(0x161)]][_0x282b78(0x162)](_0x50240d=>typeof _0x50240d===_0x282b78(0x17b)&&_0x50240d[_0x282b78(0x18c)]()),_0x4232bd=[_0x161329?.[_0x282b78(0x189)],_0x161329?.[_0x282b78(0x17d)]]['find'](_0x35c861=>typeof _0x35c861===_0x282b78(0x17b)&&_0x35c861[_0x282b78(0x18c)]());return[{..._0x382d43?{'name':_0x382d43[_0x282b78(0x18c)]()}:{},..._0x4232bd?{'type':_0x4232bd[_0x282b78(0x18c)]()}:{},'columns':_0x4bae64}];}),_0x25470e=[..._0x1b1399],_0x491515=typeof _0x5e1563?.[_0x371ebf(0x193)]?.[_0x371ebf(0x16a)]===_0x371ebf(0x17b)?_0x5e1563[_0x371ebf(0x193)][_0x371ebf(0x16a)][_0x371ebf(0x195)](',')[_0x371ebf(0x16b)](_0x2dc34b=>_0x2dc34b[_0x371ebf(0x18c)]())[_0x371ebf(0x186)](Boolean):[];return _0x491515[_0x371ebf(0x181)]>0x0&&_0x25470e['unshift']({'type':_0x371ebf(0x192),'columns':_0x491515}),{'indexes':_0x25470e,'metadataAvailable':_0x1b1399[_0x371ebf(0x181)]>0x0};}
1
+ const a201_0x386770=a201_0x4fdf;function a201_0xed52(){const _0x55b930=['tableName','34121964SdAuTs','pkField','1152993IqtDPm','length','3822917MeVjhF','primary','toLowerCase','4952225TtwGkM','name','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','902hWkbof','1204KTuIhX','schema:','from','reason','--check-indexes\x20requires\x20--schemas.','index_type','trim','sqlType','index_name','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','flagMissing','validation','bool','index_columns','get','isSelectOnly','read','str','type','Provide\x20--file\x20or\x20--sql','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','map','valid','message','8FfVgtM','File\x20not\x20found:\x20','push','columns','sql','cwd','schemaWarnings','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','file','boolean','tables','filter','find','isArray','appCode','isDangerous','dbtableConfig','string','unshift','2088AcBrrV','indexName','check-indexes','Dataset\x20\x22','schemas','indexes','167580jVPmfX','dataset','6mQzTbv','fields','62523emBmoE','SQL\x20schema\x20validation','583pGwmpO','size'];a201_0xed52=function(){return _0x55b930;};return a201_0xed52();}(function(_0x27bf36,_0x429c01){const _0x17a263=a201_0x4fdf,_0x425247=_0x27bf36();while(!![]){try{const _0x17a191=parseInt(_0x17a263(0xe7))/0x1*(parseInt(_0x17a263(0xe6))/0x2)+-parseInt(_0x17a263(0xde))/0x3*(-parseInt(_0x17a263(0xba))/0x4)+parseInt(_0x17a263(0xe3))/0x5+-parseInt(_0x17a263(0xd5))/0x6*(-parseInt(_0x17a263(0xe0))/0x7)+parseInt(_0x17a263(0xcd))/0x8*(parseInt(_0x17a263(0xd7))/0x9)+-parseInt(_0x17a263(0xd3))/0xa*(parseInt(_0x17a263(0xd9))/0xb)+-parseInt(_0x17a263(0xdc))/0xc;if(_0x17a191===_0x429c01)break;else _0x425247['push'](_0x425247['shift']());}catch(_0x527ed2){_0x425247['push'](_0x425247['shift']());}}}(a201_0xed52,0xe2fca));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a201_0x4fdf(_0xd2982,_0x1a7117){_0xd2982=_0xd2982-0xae;const _0xed52a=a201_0xed52();let _0x4fdf75=_0xed52a[_0xd2982];return _0x4fdf75;}import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a201_0x386770(0xbe),'command':'validate','description':a201_0x386770(0xc1),'risk':a201_0x386770(0xb2),'flags':[{'name':a201_0x386770(0xc2),'type':a201_0x386770(0xcb),'description':a201_0x386770(0xb6)},{'name':a201_0x386770(0xbe),'type':a201_0x386770(0xcb),'description':a201_0x386770(0xe5)},{'name':a201_0x386770(0xd1),'type':a201_0x386770(0xcb),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a201_0x386770(0xcf),'type':a201_0x386770(0xc3),'description':a201_0x386770(0xf0)}],async 'execute'(_0x3d5ed2){const _0x4c1999=a201_0x386770,_0x147bd9=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xc2)),_0xa0e350=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xbe)),_0x3d4b5e=_0x3d5ed2[_0x4c1999(0xb3)](_0x4c1999(0xd1)),_0x59a998=_0x3d5ed2[_0x4c1999(0xae)]('check-indexes');if(!_0x147bd9&&!_0xa0e350)throw CliErrors[_0x4c1999(0xf1)](_0x4c1999(0xc2),_0x4c1999(0xb5));if(_0x59a998&&!_0x3d4b5e)throw CliErrors[_0x4c1999(0xf2)](_0x4c1999(0xeb));let _0x59ca1d;if(_0x147bd9){const _0x253b06=resolve(process[_0x4c1999(0xbf)](),_0x147bd9);if(!existsSync(_0x253b06))throw CliErrors[_0x4c1999(0xf2)](_0x4c1999(0xbb)+_0x253b06);_0x59ca1d=readFileSync(_0x253b06,'utf-8');}else _0x59ca1d=_0xa0e350;const _0x4bde87=validateSql(_0x59ca1d),_0x5e29f3={'valid':_0x4bde87['valid'],'sqlType':_0x4bde87[_0x4c1999(0xee)]['type'],'isSelectOnly':_0x4bde87['sqlType'][_0x4c1999(0xb1)],'isDangerous':_0x4bde87[_0x4c1999(0xee)][_0x4c1999(0xc9)],'tables':_0x4bde87[_0x4c1999(0xc4)],'parameters':_0x4bde87['parameters'],'message':_0x4bde87[_0x4c1999(0xb9)]};_0x4bde87[_0x4c1999(0xee)][_0x4c1999(0xea)]&&(_0x5e29f3[_0x4c1999(0xea)]=_0x4bde87['sqlType'][_0x4c1999(0xea)]);if(_0x3d4b5e&&_0x4bde87[_0x4c1999(0xb8)]){const _0x5ee009=_0x3d4b5e['split'](',')['map'](_0x375ef3=>_0x375ef3[_0x4c1999(0xed)]())[_0x4c1999(0xc5)](Boolean),_0x17b682=[],_0x46b0f9=[],_0x1d73c6=filterDbTableBackedDatasets(await listDatasets(_0x3d5ed2[_0x4c1999(0xc8)])),_0x53aae2=new Map(_0x1d73c6[_0x4c1999(0xb7)](_0x11beed=>[_0x11beed['dbtableConfig']?.['tableName']?.['toLowerCase'](),_0x11beed]));for(const _0x386259 of _0x4bde87[_0x4c1999(0xc4)]){const _0x3af334=_0x53aae2[_0x4c1999(0xb0)](_0x386259[_0x4c1999(0xe2)]());!_0x3af334&&_0x17b682[_0x4c1999(0xbc)]('Table\x20\x22'+_0x386259+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x234dc7 of _0x5ee009){let _0xb05f41;try{_0xb05f41=await getDatasetDetail(_0x234dc7);}catch{_0x17b682['push'](_0x4c1999(0xd0)+_0x234dc7+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0xb05f41,_0x4c1999(0xd8));const _0x257441=Array[_0x4c1999(0xc7)](_0xb05f41[_0x4c1999(0xd6)])?_0xb05f41['fields']:[],_0x73c295=new Set(_0x257441['map'](_0x2eacf5=>_0x2eacf5[_0x4c1999(0xe4)]?.[_0x4c1999(0xe2)]())),_0x34beb9=_0xb05f41[_0x4c1999(0xca)]?.[_0x4c1999(0xdb)]||_0xb05f41[_0x4c1999(0xdb)]||_0x234dc7;_0x5e29f3[_0x4c1999(0xe8)+_0x34beb9]={'code':_0x234dc7,'tableName':_0x34beb9,'fieldCount':_0x73c295[_0x4c1999(0xda)],'fields':Array[_0x4c1999(0xe9)](_0x73c295)};if(_0x59a998){const _0x338753=normalizeDatasetIndexes(_0xb05f41);_0x46b0f9[_0x4c1999(0xbc)]({'tableName':_0x34beb9,..._0x338753});}}_0x17b682[_0x4c1999(0xdf)]>0x0&&(_0x5e29f3[_0x4c1999(0xc0)]=_0x17b682),_0x59a998&&(_0x5e29f3['joinAudit']=auditSqlJoinIndexes(_0x59ca1d,_0x46b0f9));}return{'ok':_0x4bde87['valid'],'data':_0x5e29f3,'message':_0x4bde87[_0x4c1999(0xb9)]};}};function normalizeDatasetIndexes(_0xa26d9){const _0x1bbc7f=a201_0x386770,_0x271f1a=Array['isArray'](_0xa26d9?.[_0x1bbc7f(0xd4)]?.['indexes'])?_0xa26d9['dataset'][_0x1bbc7f(0xd2)]:Array[_0x1bbc7f(0xc7)](_0xa26d9?.['indexes'])?_0xa26d9[_0x1bbc7f(0xd2)]:[],_0x28237f=_0x271f1a['flatMap'](_0x5b1eff=>{const _0xfffb2=_0x1bbc7f,_0x46a193=Array[_0xfffb2(0xc7)](_0x5b1eff?.[_0xfffb2(0xaf)])?_0x5b1eff[_0xfffb2(0xaf)]:Array[_0xfffb2(0xc7)](_0x5b1eff?.['columnNames'])?_0x5b1eff['columnNames']:Array[_0xfffb2(0xc7)](_0x5b1eff?.[_0xfffb2(0xbd)])?_0x5b1eff['columns']:[],_0x3b8c3f=_0x46a193[_0xfffb2(0xc5)](_0x35a4fa=>typeof _0x35a4fa===_0xfffb2(0xcb))[_0xfffb2(0xb7)](_0xc964e7=>_0xc964e7[_0xfffb2(0xed)]())[_0xfffb2(0xc5)](Boolean);if(_0x3b8c3f[_0xfffb2(0xdf)]===0x0)return[];const _0x42f127=[_0x5b1eff?.[_0xfffb2(0xce)],_0x5b1eff?.[_0xfffb2(0xef)],_0x5b1eff?.[_0xfffb2(0xe4)]]['find'](_0x538e46=>typeof _0x538e46===_0xfffb2(0xcb)&&_0x538e46[_0xfffb2(0xed)]()),_0x534008=[_0x5b1eff?.[_0xfffb2(0xec)],_0x5b1eff?.[_0xfffb2(0xb4)]][_0xfffb2(0xc6)](_0x340f1f=>typeof _0x340f1f==='string'&&_0x340f1f['trim']());return[{..._0x42f127?{'name':_0x42f127['trim']()}:{},..._0x534008?{'type':_0x534008[_0xfffb2(0xed)]()}:{},'columns':_0x3b8c3f}];}),_0x3c2c6a=[..._0x28237f],_0x3a2c9e=typeof _0xa26d9?.[_0x1bbc7f(0xca)]?.[_0x1bbc7f(0xdd)]===_0x1bbc7f(0xcb)?_0xa26d9[_0x1bbc7f(0xca)][_0x1bbc7f(0xdd)]['split'](',')['map'](_0x43552c=>_0x43552c['trim']())[_0x1bbc7f(0xc5)](Boolean):[];return _0x3a2c9e[_0x1bbc7f(0xdf)]>0x0&&_0x3c2c6a[_0x1bbc7f(0xcc)]({'type':_0x1bbc7f(0xe1),'columns':_0x3a2c9e}),{'indexes':_0x3c2c6a,'metadataAvailable':_0x28237f[_0x1bbc7f(0xdf)]>0x0};}
@@ -1 +1 @@
1
- function a202_0x587c(){const _0xbfc685=['54GYicWz','3554VHkJlX','295888vZMouL','639006ADdrHi','1725910MQAsKJ','45970PlzrIr','636pjqFMl','13NEiHvn','48vPcLnG','2041782geoTxk','7GlZExQ','8734EYSMrg'];a202_0x587c=function(){return _0xbfc685;};return a202_0x587c();}(function(_0x509180,_0x49dca6){const _0x1b0a32=a202_0x43fd,_0x5e520=_0x509180();while(!![]){try{const _0x5d8b9f=-parseInt(_0x1b0a32(0x1ac))/0x1*(parseInt(_0x1b0a32(0x1b2))/0x2)+parseInt(_0x1b0a32(0x1a8))/0x3+parseInt(_0x1b0a32(0x1ad))/0x4*(-parseInt(_0x1b0a32(0x1aa))/0x5)+parseInt(_0x1b0a32(0x1ae))/0x6*(-parseInt(_0x1b0a32(0x1af))/0x7)+parseInt(_0x1b0a32(0x1a7))/0x8*(parseInt(_0x1b0a32(0x1b1))/0x9)+parseInt(_0x1b0a32(0x1a9))/0xa+parseInt(_0x1b0a32(0x1b0))/0xb*(parseInt(_0x1b0a32(0x1ab))/0xc);if(_0x5d8b9f===_0x49dca6)break;else _0x5e520['push'](_0x5e520['shift']());}catch(_0x31aca3){_0x5e520['push'](_0x5e520['shift']());}}}(a202_0x587c,0x2aef9));function a202_0x43fd(_0x19715b,_0x58dbe6){_0x19715b=_0x19715b-0x1a7;const _0x587c9a=a202_0x587c();let _0x43fdce=_0x587c9a[_0x19715b];return _0x43fdce;}import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
1
+ (function(_0x2da987,_0x1f34f5){const _0x1dc56c=a202_0xb757,_0x42e38e=_0x2da987();while(!![]){try{const _0x41294c=-parseInt(_0x1dc56c(0x7d))/0x1+-parseInt(_0x1dc56c(0x7b))/0x2*(parseInt(_0x1dc56c(0x7c))/0x3)+-parseInt(_0x1dc56c(0x79))/0x4+parseInt(_0x1dc56c(0x81))/0x5+parseInt(_0x1dc56c(0x7f))/0x6+-parseInt(_0x1dc56c(0x7a))/0x7+-parseInt(_0x1dc56c(0x80))/0x8*(-parseInt(_0x1dc56c(0x7e))/0x9);if(_0x41294c===_0x1f34f5)break;else _0x42e38e['push'](_0x42e38e['shift']());}catch(_0xade1d5){_0x42e38e['push'](_0x42e38e['shift']());}}}(a202_0xbfa8,0xcf854));function a202_0xb757(_0x12508b,_0x407bac){_0x12508b=_0x12508b-0x79;const _0xbfa8b2=a202_0xbfa8();let _0xb75788=_0xbfa8b2[_0x12508b];return _0xb75788;}import{taskStatus}from'../../commands/task/status.js';function a202_0xbfa8(){const _0x3f7fed=['7088395gRGPNN','1745396GwRPpE','9891966rBsYXT','129730chfMcv','33KlRQAa','590679tOvKNf','9WNbRUC','1706322Hfijpt','18412952SqCYAJ'];a202_0xbfa8=function(){return _0x3f7fed;};return a202_0xbfa8();}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a203_0x4eb350=a203_0x36d2;(function(_0x390143,_0x5b22dc){const _0x545ec7=a203_0x36d2,_0x3208d1=_0x390143();while(!![]){try{const _0xbda5ce=-parseInt(_0x545ec7(0x10e))/0x1*(-parseInt(_0x545ec7(0x10d))/0x2)+-parseInt(_0x545ec7(0xfb))/0x3+parseInt(_0x545ec7(0x101))/0x4+-parseInt(_0x545ec7(0xf6))/0x5+-parseInt(_0x545ec7(0x106))/0x6*(-parseInt(_0x545ec7(0xfd))/0x7)+parseInt(_0x545ec7(0xff))/0x8+-parseInt(_0x545ec7(0xfa))/0x9*(-parseInt(_0x545ec7(0x104))/0xa);if(_0xbda5ce===_0x5b22dc)break;else _0x3208d1['push'](_0x3208d1['shift']());}catch(_0x1ac072){_0x3208d1['push'](_0x3208d1['shift']());}}}(a203_0x10cc,0xb7efd));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';function a203_0x36d2(_0x12e2e0,_0x3b68a3){_0x12e2e0=_0x12e2e0-0xf6;const _0x10cc59=a203_0x10cc();let _0x36d270=_0x10cc59[_0x12e2e0];return _0x36d270;}function a203_0x10cc(){const _0x59e7e3=['apiError','45zAyVKn','485703iurJAK','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','476BdgxYn',',\x20received\x20','6722672YqKwvb','appCode','1092900LxNWWZ','compress','cookie','1404290sxBlif','status','4878WIiPsb','trim','isTerminal','task','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','str','taskId','2ohsHIQ','23294QuGBZw','4894880ROXkmB','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id'];a203_0x10cc=function(){return _0x59e7e3;};return a203_0x10cc();}import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const taskStatus={'service':a203_0x4eb350(0x109),'command':a203_0x4eb350(0x105),'description':a203_0x4eb350(0xf7),'risk':'read','defaultOutputFormat':a203_0x4eb350(0x102),'structuredErrors':!![],'flags':[{'name':a203_0x4eb350(0xf8),'type':'string','required':!![],'description':a203_0x4eb350(0xfc)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x56d225){const _0x16bba4=a203_0x4eb350;if(!_0x56d225['str'](_0x16bba4(0xf8))[_0x16bba4(0x107)]())throw CliErrors['flagMissing'](_0x16bba4(0xf8));},async 'execute'(_0x481eb5){const _0x24c4fd=a203_0x4eb350,_0x588d98=_0x481eb5[_0x24c4fd(0x10b)](_0x24c4fd(0xf8))[_0x24c4fd(0x107)](),_0x13116c=normalizeAsyncTask(await getAsyncTaskStatus(_0x588d98,_0x481eb5[_0x24c4fd(0x100)],_0x481eb5[_0x24c4fd(0x103)]));if(_0x13116c[_0x24c4fd(0x10c)]!==_0x588d98)throw CliErrors[_0x24c4fd(0xf9)](_0x24c4fd(0x10a)+_0x588d98+_0x24c4fd(0xfe)+_0x13116c[_0x24c4fd(0x10c)]+'.');const _0x4d1a44=buildAsyncTaskStatusCommand(_0x13116c[_0x24c4fd(0x10c)],_0x481eb5[_0x24c4fd(0x100)]);return{'ok':!![],'message':asyncTaskMessage(_0x13116c),'data':{'appCode':_0x481eb5[_0x24c4fd(0x100)],..._0x13116c,'query':_0x13116c[_0x24c4fd(0x108)]?null:{'command':_0x4d1a44}}};}};
1
+ const a203_0x1098f1=a203_0x3b16;(function(_0x28b38f,_0x4de014){const _0x3e1033=a203_0x3b16,_0x47f938=_0x28b38f();while(!![]){try{const _0xebe8bd=-parseInt(_0x3e1033(0x12b))/0x1+-parseInt(_0x3e1033(0x11d))/0x2+-parseInt(_0x3e1033(0x12a))/0x3+parseInt(_0x3e1033(0x11e))/0x4+parseInt(_0x3e1033(0x125))/0x5*(-parseInt(_0x3e1033(0x120))/0x6)+-parseInt(_0x3e1033(0x12c))/0x7*(parseInt(_0x3e1033(0x127))/0x8)+parseInt(_0x3e1033(0x129))/0x9;if(_0xebe8bd===_0x4de014)break;else _0x47f938['push'](_0x47f938['shift']());}catch(_0x25e157){_0x47f938['push'](_0x47f938['shift']());}}}(a203_0x29e6,0xc6c7d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a203_0x3b16(_0x4a5ec2,_0x19b06f){_0x4a5ec2=_0x4a5ec2-0x11b;const _0x29e688=a203_0x29e6();let _0x3b16d2=_0x29e688[_0x4a5ec2];return _0x3b16d2;}import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a203_0x29e6(){const _0x4ff036=['str',',\x20received\x20','1695122YByKmj','132684RLKePL','status','54jrmGep','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task','appCode','string','231955goKcDe','isTerminal','401832VPVsMr','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','47663442KRLSKQ','4069050pNJKTi','1240497NTpNXj','91ovTPCj','task-id','compress','read','taskId','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','trim'];a203_0x29e6=function(){return _0x4ff036;};return a203_0x29e6();}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a203_0x1098f1(0x122),'command':a203_0x1098f1(0x11f),'description':a203_0x1098f1(0x121),'risk':a203_0x1098f1(0x12f),'defaultOutputFormat':a203_0x1098f1(0x12e),'structuredErrors':!![],'flags':[{'name':'task-id','type':a203_0x1098f1(0x124),'required':!![],'description':a203_0x1098f1(0x131)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4240ba){const _0x26362a=a203_0x1098f1;if(!_0x4240ba[_0x26362a(0x11b)](_0x26362a(0x12d))['trim']())throw CliErrors['flagMissing'](_0x26362a(0x12d));},async 'execute'(_0xc95163){const _0x9d4da2=a203_0x1098f1,_0x55966b=_0xc95163[_0x9d4da2(0x11b)]('task-id')[_0x9d4da2(0x132)](),_0x442c40=normalizeAsyncTask(await getAsyncTaskStatus(_0x55966b,_0xc95163['appCode'],_0xc95163['cookie']));if(_0x442c40['taskId']!==_0x55966b)throw CliErrors['apiError'](_0x9d4da2(0x128)+_0x55966b+_0x9d4da2(0x11c)+_0x442c40[_0x9d4da2(0x130)]+'.');const _0x2469d3=buildAsyncTaskStatusCommand(_0x442c40[_0x9d4da2(0x130)],_0xc95163[_0x9d4da2(0x123)]);return{'ok':!![],'message':asyncTaskMessage(_0x442c40),'data':{'appCode':_0xc95163[_0x9d4da2(0x123)],..._0x442c40,'query':_0x442c40[_0x9d4da2(0x126)]?null:{'command':_0x2469d3}}};}};
@@ -1 +1 @@
1
- (function(_0x260b15,_0x290d9e){const _0x5759b3=a204_0x2906,_0x30748a=_0x260b15();while(!![]){try{const _0x5300aa=parseInt(_0x5759b3(0x19f))/0x1*(parseInt(_0x5759b3(0x19b))/0x2)+-parseInt(_0x5759b3(0x19c))/0x3*(parseInt(_0x5759b3(0x199))/0x4)+-parseInt(_0x5759b3(0x19a))/0x5+-parseInt(_0x5759b3(0x1a0))/0x6*(-parseInt(_0x5759b3(0x198))/0x7)+-parseInt(_0x5759b3(0x19e))/0x8+parseInt(_0x5759b3(0x19d))/0x9+parseInt(_0x5759b3(0x197))/0xa;if(_0x5300aa===_0x290d9e)break;else _0x30748a['push'](_0x30748a['shift']());}catch(_0xb9bb57){_0x30748a['push'](_0x30748a['shift']());}}}(a204_0x2721,0xe817f));function a204_0x2721(){const _0x57b0b1=['10851327KrEkQc','10810024YdlCco','1VWPxPK','96PjdXJb','16673570lzjyiW','449617Xnicea','680DHrVPR','8672605fjuKrW','1581366RQYSwr','11559daFZsR'];a204_0x2721=function(){return _0x57b0b1;};return a204_0x2721();}function a204_0x2906(_0x37a553,_0x5acb09){_0x37a553=_0x37a553-0x197;const _0x272166=a204_0x2721();let _0x290663=_0x272166[_0x37a553];return _0x290663;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
1
+ function a204_0x4438(_0x17ad35,_0x1eeba5){_0x17ad35=_0x17ad35-0xc2;const _0x49bee9=a204_0x49be();let _0x4438fa=_0x49bee9[_0x17ad35];return _0x4438fa;}(function(_0x1693b8,_0x5df620){const _0x206eec=a204_0x4438,_0x402da4=_0x1693b8();while(!![]){try{const _0x13c1d5=-parseInt(_0x206eec(0xc5))/0x1+parseInt(_0x206eec(0xc3))/0x2*(parseInt(_0x206eec(0xca))/0x3)+parseInt(_0x206eec(0xc4))/0x4*(parseInt(_0x206eec(0xc6))/0x5)+-parseInt(_0x206eec(0xc7))/0x6+parseInt(_0x206eec(0xcc))/0x7*(-parseInt(_0x206eec(0xc8))/0x8)+-parseInt(_0x206eec(0xc9))/0x9*(-parseInt(_0x206eec(0xcb))/0xa)+parseInt(_0x206eec(0xc2))/0xb;if(_0x13c1d5===_0x5df620)break;else _0x402da4['push'](_0x402da4['shift']());}catch(_0x2a5de7){_0x402da4['push'](_0x402da4['shift']());}}}(a204_0x49be,0xee39a));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a204_0x49be(){const _0x49acca=['7kodXsN','1302279Nkaqwi','202802tMMWcR','4hggTKv','1224187pUTAVU','895525NieHZc','2329062gnHvbN','6784048ZYDruC','9OPidzw','39WwkHdE','18204330sVimjY'];a204_0x49be=function(){return _0x49acca;};return a204_0x49be();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a205_0x2653fb=a205_0x14fa;(function(_0xa2f03,_0x28771a){const _0x1a9a99=a205_0x14fa,_0x1eb197=_0xa2f03();while(!![]){try{const _0x53cd7a=-parseInt(_0x1a9a99(0x143))/0x1+-parseInt(_0x1a9a99(0x151))/0x2*(parseInt(_0x1a9a99(0x149))/0x3)+parseInt(_0x1a9a99(0x13f))/0x4*(parseInt(_0x1a9a99(0x142))/0x5)+-parseInt(_0x1a9a99(0x14e))/0x6+parseInt(_0x1a9a99(0x14b))/0x7*(parseInt(_0x1a9a99(0x13e))/0x8)+-parseInt(_0x1a9a99(0x146))/0x9*(-parseInt(_0x1a9a99(0x150))/0xa)+-parseInt(_0x1a9a99(0x152))/0xb*(parseInt(_0x1a9a99(0x147))/0xc);if(_0x53cd7a===_0x28771a)break;else _0x1eb197['push'](_0x1eb197['shift']());}catch(_0x3f3215){_0x1eb197['push'](_0x1eb197['shift']());}}}(a205_0x3939,0xae737));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a205_0x14fa(_0x47c3de,_0x7bdfd8){_0x47c3de=_0x47c3de-0x13d;const _0x3939b5=a205_0x3939();let _0x14fa25=_0x3939b5[_0x47c3de];return _0x14fa25;}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a205_0x3939(){const _0x3f1e03=['81QtSLfD','1572yEzHYt','tenant-code','3nDqCyZ','length','1675709bGRmSM','Pass\x20--tenant-code\x20<code>.','members-list','4809930PugjNE','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','1337170aMxWNy','1442256zcAhnV','30833KZCuVx','str','32BoQjKo','52604pqGkbT','tenant','flagMissing','415mPlTym','648007FOOZvp','Found\x20','Exact\x20tenant\x20code'];a205_0x3939=function(){return _0x3f1e03;};return a205_0x3939();}export const tenantMembersListDefinition={'service':a205_0x2653fb(0x140),'command':a205_0x2653fb(0x14d),'description':a205_0x2653fb(0x14f),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a205_0x2653fb(0x148),'type':'string','required':!![],'description':a205_0x2653fb(0x145)}],async 'validate'(_0x229c84){const _0x40acf9=a205_0x2653fb;if(!_0x229c84[_0x40acf9(0x13d)](_0x40acf9(0x148))['trim']())throw CliErrors[_0x40acf9(0x141)](_0x40acf9(0x148),_0x40acf9(0x14c));},async 'execute'(_0x191ff8){const _0x1ce295=a205_0x2653fb,_0x41d5d3=_0x191ff8[_0x1ce295(0x13d)](_0x1ce295(0x148))['trim'](),_0x93650a=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x41d5d3,_0x93650a);const _0x4aa015=projectTenantMembers(await listTenantDirectoryMembers(_0x41d5d3));return{'ok':!![],'data':{'tenantCode':_0x41d5d3,'items':_0x4aa015,'totalCount':_0x4aa015[_0x1ce295(0x14a)]},'message':_0x1ce295(0x144)+_0x4aa015['length']+'\x20tenant\x20member(s)'};}};
1
+ function a205_0x169b(){const _0xb1992c=['read','50868HEILlq','2209260zEdsea','flagMissing','1163110NVNrnz','tenant','Pass\x20--tenant-code\x20<code>.','Exact\x20tenant\x20code','Found\x20','trim','25eWTZNC','tenant-code','10IkqCHw','356892THWZhC','string','3131826NQafKv','str','568ATRhlM','45DnLJsy','108774bvrLQH','392vvnqtl','671EkJwdT','length','\x20tenant\x20member(s)'];a205_0x169b=function(){return _0xb1992c;};return a205_0x169b();}const a205_0x59bc46=a205_0x35b7;(function(_0x314c24,_0x35b1d7){const _0x589bb9=a205_0x35b7,_0xce97a8=_0x314c24();while(!![]){try{const _0x31f5f5=parseInt(_0x589bb9(0xd0))/0x1*(parseInt(_0x589bb9(0xd7))/0x2)+parseInt(_0x589bb9(0xde))/0x3+-parseInt(_0x589bb9(0xdd))/0x4*(parseInt(_0x589bb9(0xce))/0x5)+parseInt(_0x589bb9(0xd3))/0x6+-parseInt(_0x589bb9(0xd8))/0x7*(-parseInt(_0x589bb9(0xd5))/0x8)+-parseInt(_0x589bb9(0xd6))/0x9*(-parseInt(_0x589bb9(0xe0))/0xa)+-parseInt(_0x589bb9(0xd9))/0xb*(parseInt(_0x589bb9(0xd1))/0xc);if(_0x31f5f5===_0x35b1d7)break;else _0xce97a8['push'](_0xce97a8['shift']());}catch(_0x2ea29a){_0xce97a8['push'](_0xce97a8['shift']());}}}(a205_0x169b,0x7c836));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';function a205_0x35b7(_0x2a8c5c,_0x5974f9){_0x2a8c5c=_0x2a8c5c-0xcb;const _0x169be0=a205_0x169b();let _0x35b7d7=_0x169be0[_0x2a8c5c];return _0x35b7d7;}export const tenantMembersListDefinition={'service':a205_0x59bc46(0xe1),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a205_0x59bc46(0xdc),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a205_0x59bc46(0xcf),'type':a205_0x59bc46(0xd2),'required':!![],'description':a205_0x59bc46(0xcb)}],async 'validate'(_0x476258){const _0xb2983a=a205_0x59bc46;if(!_0x476258['str']('tenant-code')['trim']())throw CliErrors[_0xb2983a(0xdf)](_0xb2983a(0xcf),_0xb2983a(0xe2));},async 'execute'(_0x313b04){const _0x484eaa=a205_0x59bc46,_0x28977f=_0x313b04[_0x484eaa(0xd4)]('tenant-code')[_0x484eaa(0xcd)](),_0x3d2951=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x28977f,_0x3d2951);const _0x14e478=projectTenantMembers(await listTenantDirectoryMembers(_0x28977f));return{'ok':!![],'data':{'tenantCode':_0x28977f,'items':_0x14e478,'totalCount':_0x14e478[_0x484eaa(0xda)]},'message':_0x484eaa(0xcc)+_0x14e478[_0x484eaa(0xda)]+_0x484eaa(0xdb)};}};
@@ -1 +1 @@
1
- (function(_0x5b0896,_0x27ea57){const _0x2efafb=a206_0x47fd,_0xf119e8=_0x5b0896();while(!![]){try{const _0x4f715c=-parseInt(_0x2efafb(0x1e4))/0x1*(parseInt(_0x2efafb(0x1e2))/0x2)+parseInt(_0x2efafb(0x1dc))/0x3*(parseInt(_0x2efafb(0x1eb))/0x4)+parseInt(_0x2efafb(0x1e6))/0x5+parseInt(_0x2efafb(0x1f5))/0x6*(parseInt(_0x2efafb(0x1f3))/0x7)+-parseInt(_0x2efafb(0x1e5))/0x8*(-parseInt(_0x2efafb(0x1ee))/0x9)+-parseInt(_0x2efafb(0x1e1))/0xa*(-parseInt(_0x2efafb(0x1f4))/0xb)+-parseInt(_0x2efafb(0x1f6))/0xc;if(_0x4f715c===_0x27ea57)break;else _0xf119e8['push'](_0xf119e8['shift']());}catch(_0x485e4a){_0xf119e8['push'](_0xf119e8['shift']());}}}(a206_0x4afb,0x80934));import{CliErrors}from'../../errors.js';function a206_0x47fd(_0x2b8f50,_0xefa7d0){_0x2b8f50=_0x2b8f50-0x1db;const _0x4afb3f=a206_0x4afb();let _0x47fdf4=_0x4afb3f[_0x2b8f50];return _0x47fdf4;}function textOrNull(_0x124421){const _0x4b845e=a206_0x47fd,_0x5e8b8b=_0x124421?.[_0x4b845e(0x1ea)]();return _0x5e8b8b?_0x5e8b8b:null;}export function projectTenantMembers(_0x57c763){const _0x3b49d3=a206_0x47fd,_0x85e9c7=new Map();for(const _0x124355 of _0x57c763){const _0x42c1bf=Number(_0x124355['userId']);if(!Number[_0x3b49d3(0x1de)](_0x42c1bf)||_0x42c1bf<=0x0)continue;const _0x314024={'userId':_0x42c1bf,'username':textOrNull(_0x124355['username']),'displayName':textOrNull(_0x124355[_0x3b49d3(0x1db)]),'role':_0x124355[_0x3b49d3(0x1df)]===!![]?_0x3b49d3(0x1e7):_0x3b49d3(0x1ec),'status':textOrNull(_0x124355[_0x3b49d3(0x1f1)])},_0x1cce3e=_0x85e9c7['get'](_0x42c1bf);if(!_0x1cce3e){_0x85e9c7['set'](_0x42c1bf,_0x314024);continue;}_0x1cce3e[_0x3b49d3(0x1ed)]??=_0x314024[_0x3b49d3(0x1ed)],_0x1cce3e[_0x3b49d3(0x1f2)]??=_0x314024['displayName'],_0x1cce3e[_0x3b49d3(0x1f1)]??=_0x314024[_0x3b49d3(0x1f1)];if(_0x314024['role']==='ADMIN')_0x1cce3e['role']=_0x3b49d3(0x1e7);}return[..._0x85e9c7[_0x3b49d3(0x1e3)]()][_0x3b49d3(0x1e9)]((_0x2bbd26,_0x3abaee)=>_0x2bbd26['userId']-_0x3abaee[_0x3b49d3(0x1f0)]);}export function assertTenantAccessible(_0x55d389,_0x423ba9){const _0x4bbe52=a206_0x47fd;if(_0x423ba9[_0x4bbe52(0x1e8)](_0x775f9e=>_0x775f9e[_0x4bbe52(0x1ef)]===_0x55d389))return;throw CliErrors[_0x4bbe52(0x1e0)](_0x4bbe52(0x1dd)+_0x55d389+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x4bbe52(0x1f7));}function a206_0x4afb(){const _0x1b8bc9=['4963iovuii','11iDvzUl','138soZvDq','27232908DkWcVO','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','nickname','1922562XBvdmf','Tenant\x20\x22','isFinite','adminFlag','validation','7305370epMiGh','30qABudj','values','2994hThOdZ','48xSrEHR','3498415ajvyoT','ADMIN','some','sort','trim','4WJCfaS','MEMBER','username','1130373qDFADj','tenantCode','userId','status','displayName'];a206_0x4afb=function(){return _0x1b8bc9;};return a206_0x4afb();}
1
+ (function(_0x1be548,_0xed1fff){const _0x530172=a206_0x519a,_0x16125e=_0x1be548();while(!![]){try{const _0x4d96a7=-parseInt(_0x530172(0x68))/0x1*(-parseInt(_0x530172(0x7b))/0x2)+-parseInt(_0x530172(0x77))/0x3+parseInt(_0x530172(0x67))/0x4*(parseInt(_0x530172(0x70))/0x5)+-parseInt(_0x530172(0x82))/0x6+-parseInt(_0x530172(0x72))/0x7*(-parseInt(_0x530172(0x7d))/0x8)+parseInt(_0x530172(0x6c))/0x9*(parseInt(_0x530172(0x75))/0xa)+-parseInt(_0x530172(0x83))/0xb*(parseInt(_0x530172(0x6d))/0xc);if(_0x4d96a7===_0xed1fff)break;else _0x16125e['push'](_0x16125e['shift']());}catch(_0x570083){_0x16125e['push'](_0x16125e['shift']());}}}(a206_0x436f,0x39148));import{CliErrors}from'../../errors.js';function textOrNull(_0x5cd255){const _0x3727e3=a206_0x519a,_0x36c341=_0x5cd255?.[_0x3727e3(0x79)]();return _0x36c341?_0x36c341:null;}function a206_0x436f(){const _0x2cbc27=['ADMIN','validation','135370vThszw','isFinite','804108SdgnCS','username','trim','status','7536jYVRuW','displayName','8wMPUCP','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','some','role','userId','1687536yQFIyb','154tYjStb','MEMBER','512emqOLV','107DJMRIo','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','tenantCode','adminFlag','81ykmmCj','24456dfxFyT','set','sort','1700yqPKwU','nickname','1701665ratBCk'];a206_0x436f=function(){return _0x2cbc27;};return a206_0x436f();}function a206_0x519a(_0x1ab47e,_0x5799a4){_0x1ab47e=_0x1ab47e-0x66;const _0x436f0f=a206_0x436f();let _0x519a13=_0x436f0f[_0x1ab47e];return _0x519a13;}export function projectTenantMembers(_0x230c92){const _0x5cb428=a206_0x519a,_0x4dba8f=new Map();for(const _0x148bef of _0x230c92){const _0x120ad3=Number(_0x148bef['userId']);if(!Number[_0x5cb428(0x76)](_0x120ad3)||_0x120ad3<=0x0)continue;const _0x5b8a02={'userId':_0x120ad3,'username':textOrNull(_0x148bef[_0x5cb428(0x78)]),'displayName':textOrNull(_0x148bef[_0x5cb428(0x71)]),'role':_0x148bef[_0x5cb428(0x6b)]===!![]?_0x5cb428(0x73):_0x5cb428(0x66),'status':textOrNull(_0x148bef[_0x5cb428(0x7a)])},_0x229657=_0x4dba8f['get'](_0x120ad3);if(!_0x229657){_0x4dba8f[_0x5cb428(0x6e)](_0x120ad3,_0x5b8a02);continue;}_0x229657[_0x5cb428(0x78)]??=_0x5b8a02[_0x5cb428(0x78)],_0x229657[_0x5cb428(0x7c)]??=_0x5b8a02['displayName'],_0x229657[_0x5cb428(0x7a)]??=_0x5b8a02[_0x5cb428(0x7a)];if(_0x5b8a02[_0x5cb428(0x80)]===_0x5cb428(0x73))_0x229657['role']=_0x5cb428(0x73);}return[..._0x4dba8f['values']()][_0x5cb428(0x6f)]((_0xa2c31c,_0x3a5043)=>_0xa2c31c[_0x5cb428(0x81)]-_0x3a5043[_0x5cb428(0x81)]);}export function assertTenantAccessible(_0x47eaad,_0x2f8798){const _0x2a39e7=a206_0x519a;if(_0x2f8798[_0x2a39e7(0x7f)](_0x5eed1c=>_0x5eed1c[_0x2a39e7(0x6a)]===_0x47eaad))return;throw CliErrors[_0x2a39e7(0x74)]('Tenant\x20\x22'+_0x47eaad+_0x2a39e7(0x69),_0x2a39e7(0x7e));}
@@ -1 +1 @@
1
- const a207_0x48d4e1=a207_0x351d;(function(_0x5500b2,_0x31dbd6){const _0xc000ee=a207_0x351d,_0x4d5197=_0x5500b2();while(!![]){try{const _0x1c502b=-parseInt(_0xc000ee(0xe0))/0x1+-parseInt(_0xc000ee(0xe2))/0x2+-parseInt(_0xc000ee(0xe8))/0x3+parseInt(_0xc000ee(0xdd))/0x4*(parseInt(_0xc000ee(0xea))/0x5)+-parseInt(_0xc000ee(0xdf))/0x6+parseInt(_0xc000ee(0xf4))/0x7*(-parseInt(_0xc000ee(0xf3))/0x8)+parseInt(_0xc000ee(0xe3))/0x9*(parseInt(_0xc000ee(0xe6))/0xa);if(_0x1c502b===_0x31dbd6)break;else _0x4d5197['push'](_0x4d5197['shift']());}catch(_0x401ac6){_0x4d5197['push'](_0x4d5197['shift']());}}}(a207_0x1123,0xeebd8));function a207_0x351d(_0x17593e,_0x45768c){_0x17593e=_0x17593e-0xdd;const _0x1123c0=a207_0x1123();let _0x351d3c=_0x1123c0[_0x17593e];return _0x351d3c;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a207_0x48d4e1(0xee),CURRENT_BINDING_WARNING=a207_0x48d4e1(0xde);function readDingTalkUserId(_0x486936){const _0x105e95=a207_0x48d4e1,_0x3900b3=_0x486936['str']('ding-talk-user-id')[_0x105e95(0xec)]();if(!_0x3900b3)throw CliErrors['validation'](_0x105e95(0xef),_0x105e95(0xf1));return _0x3900b3;}function buildBindingData(_0x3b5291,_0x8b7d23){const _0x186e33=a207_0x48d4e1;return{'operation':_0x186e33(0xeb),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3b5291},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x3b5291,'bound':!![]},'dryRun':_0x8b7d23,'backend':{'method':_0x186e33(0xf0),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}function a207_0x1123(){const _0x4ed185=['--ding-talk-user-id\x20cannot\x20be\x20empty.','POST','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','string','31384NgdYKq','2065xubpsf','367436DeGLGI','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','1563096yUCpEi','1087644viqCDo','dingding-sandbox-bind','270404dXevnJ','18ZhGbKT','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','24191240LBjqBB','ding-talk-user-id','5312625yUAUXq','user-account','30nQDGOn','bind','trim','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','dingding-sandbox'];a207_0x1123=function(){return _0x4ed185;};return a207_0x1123();}export const dingTalkSandboxBind={'service':a207_0x48d4e1(0xe9),'command':a207_0x48d4e1(0xe1),'description':a207_0x48d4e1(0xe5),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a207_0x48d4e1(0xe7),'type':a207_0x48d4e1(0xf2),'required':!![],'description':a207_0x48d4e1(0xe4)}],async 'validate'(_0x9aa685){readDingTalkUserId(_0x9aa685);},async 'dryRun'(_0x5a2b95){const _0x15a4ad=a207_0x48d4e1,_0x5740ee=readDingTalkUserId(_0x5a2b95);return asDryRunResult(buildBindingData(_0x5740ee,!![]),{'method':_0x15a4ad(0xf0),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x3483af){const _0x3020c0=a207_0x48d4e1,_0x1bd542=readDingTalkUserId(_0x3483af),_0x426001=await bindDingTalkSandboxAccount(_0x1bd542);if(_0x426001!==!![])throw CliErrors['apiError']('DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.',_0x3020c0(0xed));return{'ok':!![],'data':buildBindingData(_0x1bd542,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
1
+ const a207_0x206dab=a207_0x49a2;(function(_0x247f08,_0x1c4533){const _0x5272cd=a207_0x49a2,_0xde15f=_0x247f08();while(!![]){try{const _0x3d9306=parseInt(_0x5272cd(0x151))/0x1+parseInt(_0x5272cd(0x144))/0x2*(parseInt(_0x5272cd(0x147))/0x3)+parseInt(_0x5272cd(0x142))/0x4+-parseInt(_0x5272cd(0x158))/0x5*(parseInt(_0x5272cd(0x153))/0x6)+-parseInt(_0x5272cd(0x146))/0x7+-parseInt(_0x5272cd(0x14d))/0x8*(parseInt(_0x5272cd(0x159))/0x9)+parseInt(_0x5272cd(0x14c))/0xa;if(_0x3d9306===_0x1c4533)break;else _0xde15f['push'](_0xde15f['shift']());}catch(_0x3ce4d1){_0xde15f['push'](_0xde15f['shift']());}}}(a207_0xa6c3,0x2fd53));function a207_0x49a2(_0x47e530,_0x38495b){_0x47e530=_0x47e530-0x141;const _0xa6c34c=a207_0xa6c3();let _0x49a29e=_0xa6c34c[_0x47e530];return _0x49a29e;}import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a207_0x206dab(0x152),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function a207_0xa6c3(){const _0x41ad5d=['POST','321588AvjPuS','dingding-sandbox','14466qVIzMd','string','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','trim','user-account','695XUrmtT','3197241QhxFPU','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','557832KuvVOm','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','2MMXgwF','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','826070qGHsBc','252393XjWuED','ding-talk-user-id','apiError','bind','--ding-talk-user-id\x20cannot\x20be\x20empty.','4591340dXVaKD','8xcGkNI','write','str'];a207_0xa6c3=function(){return _0x41ad5d;};return a207_0xa6c3();}function readDingTalkUserId(_0x4d4f75){const _0x18e5c8=a207_0x206dab,_0x2dc1d1=_0x4d4f75[_0x18e5c8(0x14f)](_0x18e5c8(0x148))[_0x18e5c8(0x156)]();if(!_0x2dc1d1)throw CliErrors['validation'](_0x18e5c8(0x14b),_0x18e5c8(0x15a));return _0x2dc1d1;}function buildBindingData(_0x1cd09d,_0x2b4f78){const _0x2ce9d1=a207_0x206dab;return{'operation':_0x2ce9d1(0x14a),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1cd09d},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x1cd09d,'bound':!![]},'dryRun':_0x2b4f78,'backend':{'method':_0x2ce9d1(0x150),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a207_0x206dab(0x157),'command':'dingding-sandbox-bind','description':a207_0x206dab(0x141),'risk':a207_0x206dab(0x14e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'ding-talk-user-id','type':a207_0x206dab(0x154),'required':!![],'description':a207_0x206dab(0x143)}],async 'validate'(_0x418f3f){readDingTalkUserId(_0x418f3f);},async 'dryRun'(_0x5a35b6){const _0x21d02b=a207_0x206dab,_0x35ce95=readDingTalkUserId(_0x5a35b6);return asDryRunResult(buildBindingData(_0x35ce95,!![]),{'method':_0x21d02b(0x150),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x461a01){const _0x433b4c=a207_0x206dab,_0x198bc8=readDingTalkUserId(_0x461a01),_0x343505=await bindDingTalkSandboxAccount(_0x198bc8);if(_0x343505!==!![])throw CliErrors[_0x433b4c(0x149)](_0x433b4c(0x155),_0x433b4c(0x145));return{'ok':!![],'data':buildBindingData(_0x198bc8,![]),'message':'Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.'};}};
@@ -1 +1 @@
1
- function a208_0x57fa(){const _0x3dca3a=['2023820QlqCcF','109230VVaOcH','9Htopty','4VKyFSt','541573yPpXXI','2931580OiFpFS','8864464KbaplA','49538203GDTCSS','455kBWlcR','3864003gzGXhJ','10VxHHeg'];a208_0x57fa=function(){return _0x3dca3a;};return a208_0x57fa();}function a208_0x43a3(_0x2e2d5a,_0x2468b8){_0x2e2d5a=_0x2e2d5a-0x18a;const _0x57faf3=a208_0x57fa();let _0x43a3bc=_0x57faf3[_0x2e2d5a];return _0x43a3bc;}(function(_0x551e22,_0x473571){const _0x16ce2f=a208_0x43a3,_0x28a778=_0x551e22();while(!![]){try{const _0x1899d9=-parseInt(_0x16ce2f(0x190))/0x1+parseInt(_0x16ce2f(0x18c))/0x2+-parseInt(_0x16ce2f(0x18a))/0x3+-parseInt(_0x16ce2f(0x18f))/0x4*(parseInt(_0x16ce2f(0x191))/0x5)+-parseInt(_0x16ce2f(0x18d))/0x6*(parseInt(_0x16ce2f(0x194))/0x7)+-parseInt(_0x16ce2f(0x192))/0x8*(parseInt(_0x16ce2f(0x18e))/0x9)+parseInt(_0x16ce2f(0x18b))/0xa*(parseInt(_0x16ce2f(0x193))/0xb);if(_0x1899d9===_0x473571)break;else _0x28a778['push'](_0x28a778['shift']());}catch(_0x8b4ddf){_0x28a778['push'](_0x28a778['shift']());}}}(a208_0x57fa,0xc54ae));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0x581eb2,_0x39e5e){const _0x1a15a4=a208_0x3312,_0x140b6a=_0x581eb2();while(!![]){try{const _0x18ca41=parseInt(_0x1a15a4(0x14b))/0x1*(parseInt(_0x1a15a4(0x14e))/0x2)+parseInt(_0x1a15a4(0x152))/0x3+parseInt(_0x1a15a4(0x14f))/0x4*(-parseInt(_0x1a15a4(0x148))/0x5)+parseInt(_0x1a15a4(0x151))/0x6+parseInt(_0x1a15a4(0x14a))/0x7*(parseInt(_0x1a15a4(0x150))/0x8)+parseInt(_0x1a15a4(0x14d))/0x9*(-parseInt(_0x1a15a4(0x147))/0xa)+parseInt(_0x1a15a4(0x14c))/0xb*(-parseInt(_0x1a15a4(0x149))/0xc);if(_0x18ca41===_0x39e5e)break;else _0x140b6a['push'](_0x140b6a['shift']());}catch(_0x3f75c4){_0x140b6a['push'](_0x140b6a['shift']());}}}(a208_0x290b,0x65f8d));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a208_0x3312(_0x7b354b,_0x567456){_0x7b354b=_0x7b354b-0x147;const _0x290ba1=a208_0x290b();let _0x33120d=_0x290ba1[_0x7b354b];return _0x33120d;}export const userAccountDefinitions=[dingTalkSandboxBind];function a208_0x290b(){const _0x5de33c=['14IXqiRF','4daDKMg','8kiNOKO','1776222MIDvQW','1675986jOplks','99670ohkcbO','379815gFgurG','24JAXoRb','4464481UvWLKy','16442hsFpkV','5249552ZXNFMA','144wSFGfM'];a208_0x290b=function(){return _0x5de33c;};return a208_0x290b();}
@@ -1 +1 @@
1
- const a209_0x5ef7ba=a209_0x3461;(function(_0x32faa8,_0x27350){const _0x1c626f=a209_0x3461,_0x5d2a6b=_0x32faa8();while(!![]){try{const _0x20c4c7=-parseInt(_0x1c626f(0x6a))/0x1*(-parseInt(_0x1c626f(0x67))/0x2)+-parseInt(_0x1c626f(0x68))/0x3*(-parseInt(_0x1c626f(0x69))/0x4)+-parseInt(_0x1c626f(0x6d))/0x5*(parseInt(_0x1c626f(0x6c))/0x6)+parseInt(_0x1c626f(0x74))/0x7+-parseInt(_0x1c626f(0x73))/0x8+parseInt(_0x1c626f(0x71))/0x9+-parseInt(_0x1c626f(0x72))/0xa;if(_0x20c4c7===_0x27350)break;else _0x5d2a6b['push'](_0x5d2a6b['shift']());}catch(_0x4ca56d){_0x5d2a6b['push'](_0x5d2a6b['shift']());}}}(a209_0x10ca,0x72b2a));function a209_0x10ca(){const _0x216824=['Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','122AHMYhz','2913yvQnqw','1284zeZDeh','3569EGGqTR','workspace','3633702brlaps','5buMPfk','workspace\x20add','name','add','6800814nJfwCo','8037730tGxgKl','2124192aWNcXA','6017690XtgmPW','write'];a209_0x10ca=function(){return _0x216824;};return a209_0x10ca();}function a209_0x3461(_0x44860b,_0x249ab1){_0x44860b=_0x44860b-0x67;const _0x10ca10=a209_0x10ca();let _0x3461c4=_0x10ca10[_0x44860b];return _0x3461c4;}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a209_0x5ef7ba(0x6b),'command':a209_0x5ef7ba(0x70),'description':a209_0x5ef7ba(0x76),'risk':a209_0x5ef7ba(0x75),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a209_0x5ef7ba(0x6f),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x4b32b6=>validateAppName(_0x4b32b6,a209_0x5ef7ba(0x6e)),'execute':_0x245945=>runAppAdd(_0x245945,a209_0x5ef7ba(0x6e))};
1
+ const a209_0x23d2a6=a209_0x5ccb;(function(_0x55e7ad,_0x2aeab8){const _0x34652d=a209_0x5ccb,_0x3ea50c=_0x55e7ad();while(!![]){try{const _0x58407c=-parseInt(_0x34652d(0x172))/0x1*(parseInt(_0x34652d(0x16b))/0x2)+-parseInt(_0x34652d(0x168))/0x3*(-parseInt(_0x34652d(0x176))/0x4)+-parseInt(_0x34652d(0x16a))/0x5+parseInt(_0x34652d(0x175))/0x6+-parseInt(_0x34652d(0x166))/0x7*(parseInt(_0x34652d(0x16c))/0x8)+parseInt(_0x34652d(0x177))/0x9*(parseInt(_0x34652d(0x173))/0xa)+parseInt(_0x34652d(0x174))/0xb*(parseInt(_0x34652d(0x16d))/0xc);if(_0x58407c===_0x2aeab8)break;else _0x3ea50c['push'](_0x3ea50c['shift']());}catch(_0x51b3bf){_0x3ea50c['push'](_0x3ea50c['shift']());}}}(a209_0xc4f9,0x966f0));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a209_0x23d2a6(0x170),'command':a209_0x23d2a6(0x16f),'description':a209_0x23d2a6(0x16e),'risk':a209_0x23d2a6(0x167),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a209_0x23d2a6(0x171),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x1c2001=>validateAppName(_0x1c2001,a209_0x23d2a6(0x169)),'execute':_0xa7b562=>runAppAdd(_0xa7b562,a209_0x23d2a6(0x169))};function a209_0x5ccb(_0x105952,_0x1355ed){_0x105952=_0x105952-0x166;const _0xc4f92f=a209_0xc4f9();let _0x5ccb7a=_0xc4f92f[_0x105952];return _0x5ccb7a;}function a209_0xc4f9(){const _0x1c8ca0=['1040454OMLlFl','28jWvsIL','5066802NoTdtq','70WUXnnb','write','47802URyAcz','workspace\x20add','277115CaLfpF','2qqvpmZ','63880xEyKxF','1165596pAYAta','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','workspace','App\x20profile\x20name','1164939uObcuN','10SZCWIm','121lOzoFw'];a209_0xc4f9=function(){return _0x1c8ca0;};return a209_0xc4f9();}
@@ -1 +1 @@
1
- const a210_0xd00145=a210_0x24ad;(function(_0xeca789,_0x85c46a){const _0x3cc89a=a210_0x24ad,_0x379ff6=_0xeca789();while(!![]){try{const _0x5ac4a8=-parseInt(_0x3cc89a(0x18b))/0x1*(parseInt(_0x3cc89a(0x1aa))/0x2)+parseInt(_0x3cc89a(0x1a9))/0x3+parseInt(_0x3cc89a(0x1bf))/0x4*(parseInt(_0x3cc89a(0x19b))/0x5)+-parseInt(_0x3cc89a(0x1a3))/0x6+parseInt(_0x3cc89a(0x1a7))/0x7*(parseInt(_0x3cc89a(0x196))/0x8)+parseInt(_0x3cc89a(0x1ab))/0x9*(parseInt(_0x3cc89a(0x1bb))/0xa)+parseInt(_0x3cc89a(0x193))/0xb;if(_0x5ac4a8===_0x85c46a)break;else _0x379ff6['push'](_0x379ff6['shift']());}catch(_0xd2d675){_0x379ff6['push'](_0x379ff6['shift']());}}}(a210_0x5508,0x3919d));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';function a210_0x24ad(_0x4cd4ec,_0x5508a7){_0x4cd4ec=_0x4cd4ec-0x18b;const _0x550836=a210_0x5508();let _0x24ad99=_0x550836[_0x4cd4ec];return _0x24ad99;}import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=['appcode',a210_0xd00145(0x1a8),a210_0xd00145(0x18c),'format',a210_0xd00145(0x1b9),a210_0xd00145(0x1ac),a210_0xd00145(0x1b8)],workspaceFlags=[{'name':a210_0xd00145(0x194),'type':'string','description':a210_0xd00145(0x1a1)},{'name':a210_0xd00145(0x198),'type':'string','description':a210_0xd00145(0x1a2)},{'name':'env','type':a210_0xd00145(0x19f),'description':a210_0xd00145(0x1ae),'enum':[...RABETBASE_ENV_VALUES]},{'name':a210_0xd00145(0x18c),'type':'string','description':a210_0xd00145(0x19e)},{'name':a210_0xd00145(0x1c4),'type':'string','description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a210_0xd00145(0x1b9),'type':'number','description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a210_0xd00145(0x1ac),'type':a210_0xd00145(0x19f),'description':a210_0xd00145(0x1ba),'enum':[...RISK_LEVEL_VALUES]},{'name':a210_0xd00145(0x1b8),'type':a210_0xd00145(0x19f),'description':a210_0xd00145(0x1be)}];function isRecord(_0x392fec){const _0x5e2348=a210_0xd00145;return!!_0x392fec&&typeof _0x392fec==='object'&&!Array[_0x5e2348(0x1b4)](_0x392fec);}function assertValidAppcode(_0x5a5a43){const _0x30c2ab=a210_0xd00145,{valid:_0x4c08a4,message:_0x36db5a}=validateAppcode(_0x5a5a43);if(!_0x4c08a4)throw CliErrors['validation'](_0x30c2ab(0x1b2)+_0x5a5a43,_0x36db5a);}function sanitizeProfile(_0x2d3f3f){if(!isRecord(_0x2d3f3f))return{};const _0x3e37f7={};for(const _0x21f4ad of SAFE_PROFILE_KEYS){if(_0x2d3f3f[_0x21f4ad]!==undefined)_0x3e37f7[_0x21f4ad]=_0x2d3f3f[_0x21f4ad];}return _0x3e37f7;}function cloneProfile(_0x3e3519){return isRecord(_0x3e3519)?{..._0x3e3519}:{};}function collectWorkspaceProfileOverrides(_0x34c58e){const _0x6bb08b=a210_0xd00145,_0x28e8f6={},_0x3c6fdf=_0x34c58e[_0x6bb08b(0x192)](_0x6bb08b(0x1a8)),_0x15530d=_0x34c58e['str'](_0x6bb08b(0x18c)),_0x249f90=_0x34c58e[_0x6bb08b(0x192)](_0x6bb08b(0x1c4)),_0x4f4361=_0x34c58e[_0x6bb08b(0x1bc)]('pageSize'),_0xe80eb8=_0x34c58e['str'](_0x6bb08b(0x1ac)),_0x41871f=_0x34c58e['str']('locale');if(_0x3c6fdf)_0x28e8f6[_0x6bb08b(0x1a8)]=_0x3c6fdf;if(_0x15530d)_0x28e8f6[_0x6bb08b(0x18c)]=_0x15530d;if(_0x249f90)_0x28e8f6[_0x6bb08b(0x1bd)]=_0x249f90;if(_0x4f4361!==undefined&&_0x4f4361!=='')_0x28e8f6[_0x6bb08b(0x1b9)]=Number(_0x4f4361);if(_0xe80eb8)_0x28e8f6[_0x6bb08b(0x1ac)]=_0xe80eb8;if(_0x41871f)_0x28e8f6[_0x6bb08b(0x1b8)]=_0x41871f;return _0x28e8f6;}async function validateWorkspaceArgs(_0x2b903d){const _0x6c063d=a210_0xd00145,_0x18225c=_0x2b903d['str']('app')[_0x6c063d(0x1af)](),_0x45198c=_0x2b903d[_0x6c063d(0x192)](_0x6c063d(0x198))['trim']();if(!_0x18225c&&!_0x45198c)throw CliErrors[_0x6c063d(0x1a6)]('Missing\x20workspace\x20app\x20selector.',_0x6c063d(0x1a4)+CLI_BIN_NAME+_0x6c063d(0x1c2)+CLI_BIN_NAME+_0x6c063d(0x1a5));if(_0x45198c)assertValidAppcode(_0x45198c);}function resolveKnownApps(){const _0xaeafc7=a210_0xd00145,{config:_0x3add6b,layers:_0x59f03f}=readRawConfigWithLayers(),_0x23f93b=isRecord(_0x3add6b[_0xaeafc7(0x18e)])?_0x3add6b[_0xaeafc7(0x18e)]:{},_0x1f61bb=isRecord(_0x59f03f['globalConfig']['apps'])?_0x59f03f[_0xaeafc7(0x1ad)][_0xaeafc7(0x18e)]:{};return{..._0x1f61bb,..._0x23f93b};}async function configureWorkspace(_0x522c48,_0x37555e){const _0x2f6abf=a210_0xd00145,_0x2035dc=_0x522c48['str'](_0x2f6abf(0x194))[_0x2f6abf(0x1af)](),_0x120b9d=_0x522c48['str'](_0x2f6abf(0x198))[_0x2f6abf(0x1af)](),_0x215aee=_0x2035dc||_0x120b9d;if(!_0x215aee)throw CliErrors['validation'](_0x2f6abf(0x19c),_0x2f6abf(0x1a4)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x2f6abf(0x1a5));if(_0x120b9d)assertValidAppcode(_0x120b9d);const _0x850364=resolveWriteConfigPath(_0x2f6abf(0x197)),_0x4290ed=readConfigFile(_0x850364),_0x588788=resolveKnownApps(),_0x3fd0b2=isRecord(_0x4290ed['apps'])?{..._0x4290ed[_0x2f6abf(0x18e)]}:{},_0x41fd93=cloneProfile(_0x3fd0b2[_0x215aee]),_0x2b9df5=sanitizeProfile(_0x588788[_0x215aee]),_0x34e90b=_0x120b9d?{}:_0x2b9df5,_0x92b430=_0x120b9d||_0x34e90b[_0x2f6abf(0x198)];if(!_0x92b430){const _0x4e5657=Object['keys'](_0x588788),_0x4521e8=_0x4e5657['length']===0x0?_0x2f6abf(0x1a4)+CLI_BIN_NAME+'\x20workspace\x20'+_0x37555e+'\x20--app\x20'+_0x215aee+_0x2f6abf(0x191):_0x2f6abf(0x1b7)+_0x4e5657[_0x2f6abf(0x1b3)](',\x20');throw CliErrors[_0x2f6abf(0x1a6)](_0x2f6abf(0x18f)+_0x215aee+_0x2f6abf(0x1b6),_0x4521e8);}assertValidAppcode(String(_0x92b430));const _0x30854c={..._0x34e90b,..._0x41fd93,'appcode':String(_0x92b430),...collectWorkspaceProfileOverrides(_0x522c48)};return _0x3fd0b2[_0x215aee]=_0x30854c,_0x4290ed[_0x2f6abf(0x18e)]=_0x3fd0b2,_0x4290ed[_0x2f6abf(0x19a)]=_0x215aee,delete _0x4290ed['appcode'],delete _0x4290ed['app'],_0x30854c[_0x2f6abf(0x1a8)]&&(_0x4290ed[_0x2f6abf(0x1a8)]=_0x30854c[_0x2f6abf(0x1a8)]),writeConfigFile(_0x850364,_0x4290ed),{'ok':!![],'message':_0x2f6abf(0x1b5)+(_0x37555e===_0x2f6abf(0x1c3)?_0x2f6abf(0x199):_0x2f6abf(0x18d))+':\x20'+_0x215aee+_0x2f6abf(0x1b0)+_0x30854c['appcode']+').\x20Config:\x20'+_0x850364+_0x2f6abf(0x1a0),'data':{'operation':_0x2f6abf(0x1c1)+_0x37555e,'configPath':_0x850364,'app':_0x215aee,'appcode':_0x30854c[_0x2f6abf(0x198)],'env':_0x30854c[_0x2f6abf(0x1a8)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a210_0xd00145(0x1c0),'command':a210_0xd00145(0x1c3),'description':a210_0xd00145(0x195),'risk':a210_0xd00145(0x190),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4dc183=>configureWorkspace(_0x4dc183,a210_0xd00145(0x1c3))},workspaceUseDefinition={'service':'workspace','command':a210_0xd00145(0x1b1),'description':a210_0xd00145(0x19d),'risk':a210_0xd00145(0x190),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2e89d7=>configureWorkspace(_0x2e89d7,a210_0xd00145(0x1b1))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];function a210_0x5508(){const _0x46525f=['riskLevel','globalConfig','Target\x20environment','trim','\x20(appcode:\x20','use','Invalid\x20appcode:\x20','join','isArray','Workspace\x20','\x22\x20not\x20found.','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','locale','pageSize','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','66890rVDoaW','flag','format','Locale\x20for\x20this\x20workspace\x20app\x20profile','68KJHrEO','workspace','workspace.','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','init','defaultFormat','450611TvNjZy','apiDir','updated','apps','App\x20\x22','write','\x20--appcode\x20<code>`.','str','1123639kzgryM','app','Initialize\x20the\x20current\x20workspace\x20app\x20binding','365624tzngNP','project','appcode','initialized','defaultApp','64910rlCpVV','Missing\x20workspace\x20app\x20selector.','Switch\x20the\x20current\x20workspace\x20app\x20binding','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','string','.\x20Credentials:\x20not\x20written.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','2446140zljePo','Use\x20`','\x20workspace\x20use\x20--app\x20<name>`.','validation','35bnVUgn','env','1000407gGmdWY','2JeTJHC','279dgAGCs'];a210_0x5508=function(){return _0x46525f;};return a210_0x5508();}export{WORKSPACE_USAGE};
1
+ const a210_0x29c2cb=a210_0x340b;(function(_0x4448d4,_0x41edb5){const _0x5b3d1d=a210_0x340b,_0x4d715d=_0x4448d4();while(!![]){try{const _0x55b911=-parseInt(_0x5b3d1d(0x1ac))/0x1*(parseInt(_0x5b3d1d(0x191))/0x2)+-parseInt(_0x5b3d1d(0x19d))/0x3+-parseInt(_0x5b3d1d(0x1a6))/0x4+parseInt(_0x5b3d1d(0x18e))/0x5+parseInt(_0x5b3d1d(0x197))/0x6*(parseInt(_0x5b3d1d(0x19c))/0x7)+parseInt(_0x5b3d1d(0x1be))/0x8+-parseInt(_0x5b3d1d(0x196))/0x9;if(_0x55b911===_0x41edb5)break;else _0x4d715d['push'](_0x4d715d['shift']());}catch(_0x161a69){_0x4d715d['push'](_0x4d715d['shift']());}}}(a210_0x377e,0x2c480));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a210_0x29c2cb(0x1a7),SAFE_PROFILE_KEYS=[a210_0x29c2cb(0x1a1),a210_0x29c2cb(0x1b7),'apiDir',a210_0x29c2cb(0x199),a210_0x29c2cb(0x194),a210_0x29c2cb(0x193),a210_0x29c2cb(0x192)],workspaceFlags=[{'name':a210_0x29c2cb(0x1b8),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x1aa)},{'name':a210_0x29c2cb(0x1a1),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x1b6)},{'name':a210_0x29c2cb(0x1b7),'type':a210_0x29c2cb(0x1ba),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a210_0x29c2cb(0x1a0),'type':'string','description':a210_0x29c2cb(0x18a)},{'name':a210_0x29c2cb(0x1a9),'type':a210_0x29c2cb(0x1ba),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a210_0x29c2cb(0x194),'type':a210_0x29c2cb(0x18f),'description':a210_0x29c2cb(0x19b)},{'name':a210_0x29c2cb(0x193),'type':a210_0x29c2cb(0x1ba),'description':a210_0x29c2cb(0x18b),'enum':[...RISK_LEVEL_VALUES]},{'name':a210_0x29c2cb(0x192),'type':a210_0x29c2cb(0x1ba),'description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function isRecord(_0x2ba306){const _0x4a1e29=a210_0x29c2cb;return!!_0x2ba306&&typeof _0x2ba306===_0x4a1e29(0x190)&&!Array[_0x4a1e29(0x19f)](_0x2ba306);}function assertValidAppcode(_0x2de70f){const _0x5daa63=a210_0x29c2cb,{valid:_0x3336e4,message:_0x33cb92}=validateAppcode(_0x2de70f);if(!_0x3336e4)throw CliErrors[_0x5daa63(0x1bd)](_0x5daa63(0x195)+_0x2de70f,_0x33cb92);}function sanitizeProfile(_0x65fa54){if(!isRecord(_0x65fa54))return{};const _0x4d9764={};for(const _0x254807 of SAFE_PROFILE_KEYS){if(_0x65fa54[_0x254807]!==undefined)_0x4d9764[_0x254807]=_0x65fa54[_0x254807];}return _0x4d9764;}function cloneProfile(_0x593094){return isRecord(_0x593094)?{..._0x593094}:{};}function collectWorkspaceProfileOverrides(_0xe032a4){const _0x3d5f20=a210_0x29c2cb,_0x5aef0d={},_0x7b95ea=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x1b7)),_0x61c5c3=_0xe032a4['str'](_0x3d5f20(0x1a0)),_0x22a992=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x1a9)),_0x469d07=_0xe032a4[_0x3d5f20(0x1ad)](_0x3d5f20(0x194)),_0x40b0b9=_0xe032a4[_0x3d5f20(0x19e)](_0x3d5f20(0x193)),_0x1073d7=_0xe032a4['str'](_0x3d5f20(0x192));if(_0x7b95ea)_0x5aef0d['env']=_0x7b95ea;if(_0x61c5c3)_0x5aef0d[_0x3d5f20(0x1a0)]=_0x61c5c3;if(_0x22a992)_0x5aef0d[_0x3d5f20(0x199)]=_0x22a992;if(_0x469d07!==undefined&&_0x469d07!=='')_0x5aef0d[_0x3d5f20(0x194)]=Number(_0x469d07);if(_0x40b0b9)_0x5aef0d[_0x3d5f20(0x193)]=_0x40b0b9;if(_0x1073d7)_0x5aef0d[_0x3d5f20(0x192)]=_0x1073d7;return _0x5aef0d;}async function validateWorkspaceArgs(_0xe47d1e){const _0x34aa3a=a210_0x29c2cb,_0x26bd53=_0xe47d1e[_0x34aa3a(0x19e)](_0x34aa3a(0x1b8))['trim'](),_0x138f89=_0xe47d1e[_0x34aa3a(0x19e)](_0x34aa3a(0x1a1))[_0x34aa3a(0x18c)]();if(!_0x26bd53&&!_0x138f89)throw CliErrors[_0x34aa3a(0x1bd)]('Missing\x20workspace\x20app\x20selector.',_0x34aa3a(0x1b1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x138f89)assertValidAppcode(_0x138f89);}function resolveKnownApps(){const _0x1bad0d=a210_0x29c2cb,{config:_0x39d52f,layers:_0x15fe67}=readRawConfigWithLayers(),_0x4f3221=isRecord(_0x39d52f[_0x1bad0d(0x1a3)])?_0x39d52f[_0x1bad0d(0x1a3)]:{},_0x1e0f51=isRecord(_0x15fe67[_0x1bad0d(0x1b3)]['apps'])?_0x15fe67[_0x1bad0d(0x1b3)][_0x1bad0d(0x1a3)]:{};return{..._0x1e0f51,..._0x4f3221};}function a210_0x340b(_0x32887a,_0xd4f4e1){_0x32887a=_0x32887a-0x189;const _0x377eb6=a210_0x377e();let _0x340b62=_0x377eb6[_0x32887a];return _0x340b62;}async function configureWorkspace(_0x200c9c,_0x40b51e){const _0x2f4ad3=a210_0x29c2cb,_0x939873=_0x200c9c[_0x2f4ad3(0x19e)](_0x2f4ad3(0x1b8))['trim'](),_0x5dde04=_0x200c9c['str'](_0x2f4ad3(0x1a1))['trim'](),_0x472499=_0x939873||_0x5dde04;if(!_0x472499)throw CliErrors[_0x2f4ad3(0x1bd)]('Missing\x20workspace\x20app\x20selector.',_0x2f4ad3(0x1b1)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x2f4ad3(0x1bb));if(_0x5dde04)assertValidAppcode(_0x5dde04);const _0x3a2afe=resolveWriteConfigPath(_0x2f4ad3(0x1af)),_0x56d616=readConfigFile(_0x3a2afe),_0x3fdab5=resolveKnownApps(),_0x321f05=isRecord(_0x56d616[_0x2f4ad3(0x1a3)])?{..._0x56d616['apps']}:{},_0x474aec=cloneProfile(_0x321f05[_0x472499]),_0x225555=sanitizeProfile(_0x3fdab5[_0x472499]),_0x5cde43=_0x5dde04?{}:_0x225555,_0x4b039d=_0x5dde04||_0x5cde43[_0x2f4ad3(0x1a1)];if(!_0x4b039d){const _0x4e16a6=Object['keys'](_0x3fdab5),_0xe515a6=_0x4e16a6['length']===0x0?_0x2f4ad3(0x1b1)+CLI_BIN_NAME+_0x2f4ad3(0x198)+_0x40b51e+'\x20--app\x20'+_0x472499+_0x2f4ad3(0x1b2):_0x2f4ad3(0x1b4)+_0x4e16a6[_0x2f4ad3(0x1ae)](',\x20');throw CliErrors[_0x2f4ad3(0x1bd)](_0x2f4ad3(0x1ab)+_0x472499+_0x2f4ad3(0x18d),_0xe515a6);}assertValidAppcode(String(_0x4b039d));const _0xea58c6={..._0x5cde43,..._0x474aec,'appcode':String(_0x4b039d),...collectWorkspaceProfileOverrides(_0x200c9c)};return _0x321f05[_0x472499]=_0xea58c6,_0x56d616[_0x2f4ad3(0x1a3)]=_0x321f05,_0x56d616[_0x2f4ad3(0x1b9)]=_0x472499,delete _0x56d616[_0x2f4ad3(0x1a1)],delete _0x56d616[_0x2f4ad3(0x1b8)],_0xea58c6[_0x2f4ad3(0x1b7)]&&(_0x56d616[_0x2f4ad3(0x1b7)]=_0xea58c6[_0x2f4ad3(0x1b7)]),writeConfigFile(_0x3a2afe,_0x56d616),{'ok':!![],'message':_0x2f4ad3(0x1bc)+(_0x40b51e===_0x2f4ad3(0x1b0)?_0x2f4ad3(0x1b5):_0x2f4ad3(0x1a4))+':\x20'+_0x472499+'\x20(appcode:\x20'+_0xea58c6[_0x2f4ad3(0x1a1)]+').\x20Config:\x20'+_0x3a2afe+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x2f4ad3(0x1bf)+_0x40b51e,'configPath':_0x3a2afe,'app':_0x472499,'appcode':_0xea58c6[_0x2f4ad3(0x1a1)],'env':_0xea58c6['env']??null,'credentialsWritten':![]}};}function a210_0x377e(){const _0x3141e7=['API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','trim','\x22\x20not\x20found.','1791070fYLcMm','number','object','356002eeRybY','locale','riskLevel','pageSize','Invalid\x20appcode:\x20','1656459XQPMzj','138WWgFJf','\x20workspace\x20','format','use','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','62167umcChF','730917pvswai','str','isArray','apiDir','appcode','Initialize\x20the\x20current\x20workspace\x20app\x20binding','apps','updated','Switch\x20the\x20current\x20workspace\x20app\x20binding','442996rhZefL','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','write','defaultFormat','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','App\x20\x22','1ZarWBe','flag','join','project','init','Use\x20`','\x20--appcode\x20<code>`.','globalConfig','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','initialized','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','env','app','defaultApp','string','\x20workspace\x20use\x20--app\x20<name>`.','Workspace\x20','validation','2682712FrKeKo','workspace.','workspace'];a210_0x377e=function(){return _0x3141e7;};return a210_0x377e();}const workspaceInitDefinition={'service':a210_0x29c2cb(0x189),'command':a210_0x29c2cb(0x1b0),'description':a210_0x29c2cb(0x1a2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x3cbd85=>configureWorkspace(_0x3cbd85,a210_0x29c2cb(0x1b0))},workspaceUseDefinition={'service':a210_0x29c2cb(0x189),'command':a210_0x29c2cb(0x19a),'description':a210_0x29c2cb(0x1a5),'risk':a210_0x29c2cb(0x1a8),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x50de49=>configureWorkspace(_0x50de49,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- function a211_0x3ac4(){const _0x6c46c7=['2121488ilaRPG','App\x20profile\x20name\x20to\x20remove','1048748INBFOB','10447758HTKcRd','14NMPZnR','268280oUYgDp','workspace\x20remove','697749VzqfPc','3187530rwVKIb','write','3WsAQCw','workspace','remove','name','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','860370zFxXCV'];a211_0x3ac4=function(){return _0x6c46c7;};return a211_0x3ac4();}function a211_0x52a2(_0x33437d,_0x20df4f){_0x33437d=_0x33437d-0xc7;const _0x3ac4d7=a211_0x3ac4();let _0x52a23f=_0x3ac4d7[_0x33437d];return _0x52a23f;}const a211_0x41d914=a211_0x52a2;(function(_0xbac371,_0x12b3ec){const _0x23c2a0=a211_0x52a2,_0x1bca62=_0xbac371();while(!![]){try{const _0xa95c9e=parseInt(_0x23c2a0(0xd2))/0x1+-parseInt(_0x23c2a0(0xcd))/0x2+parseInt(_0x23c2a0(0xd5))/0x3*(-parseInt(_0x23c2a0(0xcb))/0x4)+parseInt(_0x23c2a0(0xca))/0x5+-parseInt(_0x23c2a0(0xd3))/0x6+parseInt(_0x23c2a0(0xcf))/0x7*(parseInt(_0x23c2a0(0xd0))/0x8)+parseInt(_0x23c2a0(0xce))/0x9;if(_0xa95c9e===_0x12b3ec)break;else _0x1bca62['push'](_0x1bca62['shift']());}catch(_0x41203d){_0x1bca62['push'](_0x1bca62['shift']());}}}(a211_0x3ac4,0x7cf0a));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a211_0x41d914(0xd6),'command':a211_0x41d914(0xc7),'description':a211_0x41d914(0xc9),'risk':a211_0x41d914(0xd4),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a211_0x41d914(0xc8),'description':a211_0x41d914(0xcc),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3e06b1=>validateAppName(_0x3e06b1,a211_0x41d914(0xd1)),'execute':_0x1a8f1e=>runAppRemove(_0x1a8f1e,'workspace\x20remove')};
1
+ function a211_0x390e(){const _0xd5d02=['6844tTvWoD','85apOrrE','1930kDBBeU','App\x20profile\x20name\x20to\x20remove','7524464nhzbPR','name','5076gcwlSs','remove','workspace','868858dYLrBa','workspace\x20remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','131845dyWETv','4289082SciBzN','968808jkwbqn','7YfopVd'];a211_0x390e=function(){return _0xd5d02;};return a211_0x390e();}const a211_0x5418ed=a211_0x2614;(function(_0x4fe105,_0x1245bb){const _0x5ae370=a211_0x2614,_0x59bd11=_0x4fe105();while(!![]){try{const _0x21e790=-parseInt(_0x5ae370(0x132))/0x1+-parseInt(_0x5ae370(0x12f))/0x2+-parseInt(_0x5ae370(0x134))/0x3+parseInt(_0x5ae370(0x126))/0x4*(-parseInt(_0x5ae370(0x127))/0x5)+parseInt(_0x5ae370(0x133))/0x6+parseInt(_0x5ae370(0x125))/0x7*(parseInt(_0x5ae370(0x12a))/0x8)+-parseInt(_0x5ae370(0x12c))/0x9*(parseInt(_0x5ae370(0x128))/0xa);if(_0x21e790===_0x1245bb)break;else _0x59bd11['push'](_0x59bd11['shift']());}catch(_0x25bc9d){_0x59bd11['push'](_0x59bd11['shift']());}}}(a211_0x390e,0x99620));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a211_0x2614(_0x530307,_0x163bc9){_0x530307=_0x530307-0x125;const _0x390ecd=a211_0x390e();let _0x26149a=_0x390ecd[_0x530307];return _0x26149a;}export const workspaceRemoveDefinition={'service':a211_0x5418ed(0x12e),'command':a211_0x5418ed(0x12d),'description':a211_0x5418ed(0x131),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a211_0x5418ed(0x12b),'description':a211_0x5418ed(0x129),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x4a1c39=>validateAppName(_0x4a1c39,a211_0x5418ed(0x130)),'execute':_0xb36783=>runAppRemove(_0xb36783,a211_0x5418ed(0x130))};
@@ -1 +1 @@
1
- const a212_0x22c27c=a212_0x156b;(function(_0x2ac414,_0x5a1e05){const _0x2f0e6c=a212_0x156b,_0x2cbdd1=_0x2ac414();while(!![]){try{const _0x5081d3=parseInt(_0x2f0e6c(0xb3))/0x1+parseInt(_0x2f0e6c(0xaa))/0x2+parseInt(_0x2f0e6c(0xba))/0x3+parseInt(_0x2f0e6c(0xb8))/0x4*(parseInt(_0x2f0e6c(0xb9))/0x5)+parseInt(_0x2f0e6c(0xa8))/0x6*(-parseInt(_0x2f0e6c(0xb6))/0x7)+-parseInt(_0x2f0e6c(0xa4))/0x8+-parseInt(_0x2f0e6c(0xc6))/0x9;if(_0x5081d3===_0x5a1e05)break;else _0x2cbdd1['push'](_0x2cbdd1['shift']());}catch(_0x2f2192){_0x2cbdd1['push'](_0x2cbdd1['shift']());}}}(a212_0x5204,0xdd2cf));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a212_0x22c27c(0xbc),a212_0x22c27c(0xb7),a212_0x22c27c(0xbf),a212_0x22c27c(0xb4),a212_0x22c27c(0xbe)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a212_0x22c27c(0xb0),'env',a212_0x22c27c(0xbf),'format',a212_0x22c27c(0xbc),a212_0x22c27c(0xb7),'apiDir']);function a212_0x156b(_0x20c30b,_0x448710){_0x20c30b=_0x20c30b-0xa4;const _0x5204f0=a212_0x5204();let _0x156b3f=_0x5204f0[_0x20c30b];return _0x156b3f;}export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x28133d){const _0x440554=a212_0x22c27c;return[..._0x28133d][_0x440554(0xa9)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3fc498){return TOP_LEVEL_CONFIG_KEYS['has'](_0x3fc498);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a212_0x22c27c(0xa6),'apiDir':a212_0x22c27c(0xae),'cookie':a212_0x22c27c(0xbc),'accessKey':a212_0x22c27c(0xb7),'defaultFormat':'format','pageSize':a212_0x22c27c(0xbd),'riskLevel':'riskLevel','locale':a212_0x22c27c(0xbf)};export function getAppProfileFlagDefs(){const _0x29a1c4=a212_0x22c27c;return[{'name':'env','type':_0x29a1c4(0xb2),'description':_0x29a1c4(0xc3),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x29a1c4(0xae),'type':'string','description':_0x29a1c4(0xc5)},{'name':_0x29a1c4(0xbc),'type':'string','description':_0x29a1c4(0xac),'hidden':!![]},{'name':'accessKey','type':_0x29a1c4(0xb2),'description':_0x29a1c4(0xb5),'hidden':!![]},{'name':'defaultFormat','type':'string','description':_0x29a1c4(0xc1),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x29a1c4(0xbd),'type':_0x29a1c4(0xc8),'description':_0x29a1c4(0xc4)},{'name':_0x29a1c4(0xbe),'type':'string','description':'Risk\x20level','enum':[...RISK_LEVEL_VALUES]},{'name':_0x29a1c4(0xbf),'type':_0x29a1c4(0xb2),'description':_0x29a1c4(0xab)}];}function a212_0x5204(){const _0x5a8d40=['801592TlDiiT','Locale','Auth\x20cookie','toLowerCase','apiDir','apps','appcode','app','string','1548026qpfRFj','format','Access\x20key','49KyzCkd','accessKey','1512404VriIOP','5NYbQOw','2333229RdbWMj','entries','cookie','pageSize','riskLevel','locale','keys','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','inherit','Target\x20environment','Default\x20page\x20size','API\x20directory\x20path','9892890EExOiF','length','number','en-US','6286080nnbfEY','defaultApp','env','zh-CN','268938bQAwgi','join'];a212_0x5204=function(){return _0x5a8d40;};return a212_0x5204();}export function collectAppProfileOverrides(_0x165c18){const _0x5d25ca=a212_0x22c27c,_0x268de8={};for(const [_0x2176a7,_0x2bede7]of Object[_0x5d25ca(0xbb)](APP_PROFILE_FLAG_KEY_MAP)){const _0x395a21=_0x165c18(_0x2176a7);if(!_0x395a21)continue;_0x268de8[_0x2bede7]=_0x2bede7===_0x5d25ca(0xbd)?Number(_0x395a21):_0x395a21;}return _0x268de8;}export function buildAppProfileListFields(_0x51e1c8){const _0x5b9993=a212_0x22c27c;return{'env':_0x51e1c8[_0x5b9993(0xa6)]??null,'apiDir':_0x51e1c8[_0x5b9993(0xae)]??null,'hasCookie':!!_0x51e1c8[_0x5b9993(0xbc)],'hasAccessKey':!!_0x51e1c8['accessKey'],'format':_0x51e1c8[_0x5b9993(0xb4)]??null,'pageSize':_0x51e1c8[_0x5b9993(0xbd)]??null,'riskLevel':_0x51e1c8['riskLevel']??null,'locale':_0x51e1c8[_0x5b9993(0xbf)]??null};}export function buildAppDoctorFields(_0x7a149b,_0x5bce79){const _0x378048=a212_0x22c27c;return{'env':{'value':_0x7a149b[_0x378048(0xa6)]||_0x5bce79['env'],'source':_0x7a149b[_0x378048(0xa6)]?'app':_0x378048(0xc2)},'apiDir':{'value':_0x7a149b[_0x378048(0xae)]||_0x5bce79[_0x378048(0xae)],'source':_0x7a149b['apiDir']?'app':'inherit'},'cookie':{'value':_0x7a149b[_0x378048(0xbc)]||_0x5bce79[_0x378048(0xbc)],'source':_0x7a149b['cookie']?_0x378048(0xb1):'inherit'},'accessKey':{'value':_0x7a149b[_0x378048(0xb7)]||_0x5bce79[_0x378048(0xb7)],'source':_0x7a149b[_0x378048(0xb7)]?_0x378048(0xb1):_0x378048(0xc2)}};}export function buildCanonicalAppConfig(_0x387572,_0x25dc7b){const _0xb7191e=a212_0x22c27c,_0x2d5d64=_0x387572['map'](_0x1442f3=>String(_0x1442f3||'')['trim']())['filter'](Boolean);if(_0x2d5d64[_0xb7191e(0xc7)]===0x0)return{};const _0x5ac3ec={};for(const _0x1dd24d of _0x2d5d64){_0x5ac3ec[_0x1dd24d]=_0x25dc7b?{'appcode':_0x1dd24d,'env':_0x25dc7b}:{'appcode':_0x1dd24d};}return{'apps':_0x5ac3ec,'defaultApp':_0x2d5d64[0x0]};}export function buildCanonicalProjectConfig(_0x4c1d5a,_0x50635a){const _0x1de4f7=a212_0x22c27c,{appCodes:appCodes=[],env:_0x559525,metadata:_0x5562e4}=_0x50635a,_0x25344c={..._0x4c1d5a,..._0x5562e4||{}};delete _0x25344c[_0x1de4f7(0xb0)],delete _0x25344c[_0x1de4f7(0xb1)];if(_0x559525)_0x25344c[_0x1de4f7(0xa6)]=_0x559525;else!_0x25344c['env']&&(_0x25344c[_0x1de4f7(0xa6)]=DEFAULT_CONFIG_VALUES[_0x1de4f7(0xa6)]);const _0x19c3a7=buildCanonicalAppConfig(appCodes,_0x25344c[_0x1de4f7(0xa6)]);return Object[_0x1de4f7(0xc0)](_0x19c3a7)[_0x1de4f7(0xc7)]>0x0&&(_0x25344c[_0x1de4f7(0xaf)]=_0x19c3a7[_0x1de4f7(0xaf)],_0x25344c['defaultApp']=_0x19c3a7[_0x1de4f7(0xa5)]),_0x25344c;}const LOCALE_MAP={'zh':a212_0x22c27c(0xa7),'zh-cn':a212_0x22c27c(0xa7),'zh_cn':a212_0x22c27c(0xa7),'en':a212_0x22c27c(0xc9),'en-us':a212_0x22c27c(0xc9),'en_us':a212_0x22c27c(0xc9)};export function normalizeLocale(_0x26c9d6){const _0x386218=a212_0x22c27c;if(!_0x26c9d6)return null;return LOCALE_MAP[_0x26c9d6[_0x386218(0xad)]()]??null;}
1
+ const a212_0x2fa449=a212_0x1d67;(function(_0x5cb3a9,_0x3cb6c7){const _0xd33af3=a212_0x1d67,_0x4b04de=_0x5cb3a9();while(!![]){try{const _0x166e07=-parseInt(_0xd33af3(0xfc))/0x1*(-parseInt(_0xd33af3(0xd6))/0x2)+-parseInt(_0xd33af3(0xf8))/0x3+-parseInt(_0xd33af3(0xec))/0x4*(-parseInt(_0xd33af3(0xd7))/0x5)+parseInt(_0xd33af3(0xe6))/0x6*(parseInt(_0xd33af3(0xf6))/0x7)+parseInt(_0xd33af3(0xed))/0x8*(-parseInt(_0xd33af3(0xe4))/0x9)+-parseInt(_0xd33af3(0xd4))/0xa*(-parseInt(_0xd33af3(0xdb))/0xb)+parseInt(_0xd33af3(0xe8))/0xc*(parseInt(_0xd33af3(0xfd))/0xd);if(_0x166e07===_0x3cb6c7)break;else _0x4b04de['push'](_0x4b04de['shift']());}catch(_0x3efb7b){_0x4b04de['push'](_0x4b04de['shift']());}}}(a212_0x376a,0xb1e67));function a212_0x1d67(_0x4e1aca,_0x428b18){_0x4e1aca=_0x4e1aca-0xd3;const _0x376a2e=a212_0x376a();let _0x1d67d5=_0x376a2e[_0x4e1aca];return _0x1d67d5;}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a212_0x2fa449(0xd5),a212_0x2fa449(0xf4),a212_0x2fa449(0xfa),a212_0x2fa449(0xda),a212_0x2fa449(0xea)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a212_0x2fa449(0xd9),a212_0x2fa449(0xee),a212_0x2fa449(0xfa),a212_0x2fa449(0xda),a212_0x2fa449(0xd5),a212_0x2fa449(0xf4),a212_0x2fa449(0xf0)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x24d713){const _0xd9b13c=a212_0x2fa449;return[..._0x24d713][_0xd9b13c(0xf3)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x1af043){const _0x1c319a=a212_0x2fa449;return TOP_LEVEL_CONFIG_KEYS[_0x1c319a(0xef)](_0x1af043);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a212_0x376a(){const _0x35ca2c=['apiDir','defaultFormat','defaultApp','join','accessKey','pageSize','7iwGLCa','zh-CN','736944xfSouQ','number','locale','apps','173nsfLpN','382174DjcnTH','Risk\x20level','126460LwUhNq','cookie','674YBVHUC','455800izojQz','filter','appcode','format','165cCzbah','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','length','inherit','entries','Auth\x20cookie','string','map','Config\x20key\x20(','25344hPEPHt','app','1302348XTGtOP','en-US','300qjAKAB','API\x20directory\x20path','riskLevel','trim','20yunPjO','1936zOpRxS','env','has'];a212_0x376a=function(){return _0x35ca2c;};return a212_0x376a();}export function getConfigCommandKeyDescription(){const _0x39f4b2=a212_0x2fa449;return _0x39f4b2(0xe3)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a212_0x2fa449(0xee),'apiDir':a212_0x2fa449(0xf0),'cookie':a212_0x2fa449(0xd5),'accessKey':a212_0x2fa449(0xf4),'defaultFormat':a212_0x2fa449(0xda),'pageSize':a212_0x2fa449(0xf5),'riskLevel':a212_0x2fa449(0xea),'locale':a212_0x2fa449(0xfa)};export function getAppProfileFlagDefs(){const _0x600423=a212_0x2fa449;return[{'name':_0x600423(0xee),'type':_0x600423(0xe1),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x600423(0xf0),'type':_0x600423(0xe1),'description':_0x600423(0xe9)},{'name':_0x600423(0xd5),'type':_0x600423(0xe1),'description':_0x600423(0xe0),'hidden':!![]},{'name':_0x600423(0xf4),'type':_0x600423(0xe1),'description':'Access\x20key','hidden':!![]},{'name':_0x600423(0xf1),'type':_0x600423(0xe1),'description':_0x600423(0xdc),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x600423(0xf9),'description':'Default\x20page\x20size'},{'name':_0x600423(0xea),'type':_0x600423(0xe1),'description':_0x600423(0xd3),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x600423(0xe1),'description':'Locale'}];}export function collectAppProfileOverrides(_0x39afa3){const _0x524548=a212_0x2fa449,_0x3a4c91={};for(const [_0xa6bd27,_0x4462b4]of Object[_0x524548(0xdf)](APP_PROFILE_FLAG_KEY_MAP)){const _0x15f323=_0x39afa3(_0xa6bd27);if(!_0x15f323)continue;_0x3a4c91[_0x4462b4]=_0x4462b4===_0x524548(0xf5)?Number(_0x15f323):_0x15f323;}return _0x3a4c91;}export function buildAppProfileListFields(_0x28f947){const _0x4f6cb5=a212_0x2fa449;return{'env':_0x28f947['env']??null,'apiDir':_0x28f947[_0x4f6cb5(0xf0)]??null,'hasCookie':!!_0x28f947[_0x4f6cb5(0xd5)],'hasAccessKey':!!_0x28f947[_0x4f6cb5(0xf4)],'format':_0x28f947['format']??null,'pageSize':_0x28f947[_0x4f6cb5(0xf5)]??null,'riskLevel':_0x28f947[_0x4f6cb5(0xea)]??null,'locale':_0x28f947[_0x4f6cb5(0xfa)]??null};}export function buildAppDoctorFields(_0x37388f,_0x4f48db){const _0x4654f6=a212_0x2fa449;return{'env':{'value':_0x37388f[_0x4654f6(0xee)]||_0x4f48db[_0x4654f6(0xee)],'source':_0x37388f[_0x4654f6(0xee)]?'app':_0x4654f6(0xde)},'apiDir':{'value':_0x37388f[_0x4654f6(0xf0)]||_0x4f48db[_0x4654f6(0xf0)],'source':_0x37388f[_0x4654f6(0xf0)]?_0x4654f6(0xe5):_0x4654f6(0xde)},'cookie':{'value':_0x37388f[_0x4654f6(0xd5)]||_0x4f48db[_0x4654f6(0xd5)],'source':_0x37388f[_0x4654f6(0xd5)]?_0x4654f6(0xe5):_0x4654f6(0xde)},'accessKey':{'value':_0x37388f[_0x4654f6(0xf4)]||_0x4f48db[_0x4654f6(0xf4)],'source':_0x37388f[_0x4654f6(0xf4)]?'app':_0x4654f6(0xde)}};}export function buildCanonicalAppConfig(_0x5ac995,_0x223fd9){const _0x2c8f82=a212_0x2fa449,_0x22f103=_0x5ac995[_0x2c8f82(0xe2)](_0x426952=>String(_0x426952||'')[_0x2c8f82(0xeb)]())[_0x2c8f82(0xd8)](Boolean);if(_0x22f103[_0x2c8f82(0xdd)]===0x0)return{};const _0x46befc={};for(const _0x1badf4 of _0x22f103){_0x46befc[_0x1badf4]=_0x223fd9?{'appcode':_0x1badf4,'env':_0x223fd9}:{'appcode':_0x1badf4};}return{'apps':_0x46befc,'defaultApp':_0x22f103[0x0]};}export function buildCanonicalProjectConfig(_0x3f9787,_0x501464){const _0x38113c=a212_0x2fa449,{appCodes:appCodes=[],env:_0x28b0a9,metadata:_0x3ddc3a}=_0x501464,_0x36bd47={..._0x3f9787,..._0x3ddc3a||{}};delete _0x36bd47['appcode'],delete _0x36bd47[_0x38113c(0xe5)];if(_0x28b0a9)_0x36bd47[_0x38113c(0xee)]=_0x28b0a9;else!_0x36bd47[_0x38113c(0xee)]&&(_0x36bd47[_0x38113c(0xee)]=DEFAULT_CONFIG_VALUES[_0x38113c(0xee)]);const _0x164eba=buildCanonicalAppConfig(appCodes,_0x36bd47[_0x38113c(0xee)]);return Object['keys'](_0x164eba)[_0x38113c(0xdd)]>0x0&&(_0x36bd47[_0x38113c(0xfb)]=_0x164eba[_0x38113c(0xfb)],_0x36bd47['defaultApp']=_0x164eba[_0x38113c(0xf2)]),_0x36bd47;}const LOCALE_MAP={'zh':a212_0x2fa449(0xf7),'zh-cn':a212_0x2fa449(0xf7),'zh_cn':a212_0x2fa449(0xf7),'en':'en-US','en-us':'en-US','en_us':a212_0x2fa449(0xe7)};export function normalizeLocale(_0x5497fb){if(!_0x5497fb)return null;return LOCALE_MAP[_0x5497fb['toLowerCase']()]??null;}
@@ -1 +1 @@
1
- const a213_0xb7846e=a213_0x46aa;(function(_0x5d4ac6,_0xa1e4d4){const _0x5a1561=a213_0x46aa,_0x127a06=_0x5d4ac6();while(!![]){try{const _0x85f7f7=-parseInt(_0x5a1561(0xed))/0x1+-parseInt(_0x5a1561(0xe6))/0x2+parseInt(_0x5a1561(0xe8))/0x3*(parseInt(_0x5a1561(0xec))/0x4)+parseInt(_0x5a1561(0xeb))/0x5*(parseInt(_0x5a1561(0xef))/0x6)+parseInt(_0x5a1561(0xe9))/0x7*(parseInt(_0x5a1561(0xee))/0x8)+-parseInt(_0x5a1561(0xe7))/0x9+-parseInt(_0x5a1561(0xe5))/0xa;if(_0x85f7f7===_0xa1e4d4)break;else _0x127a06['push'](_0x127a06['shift']());}catch(_0x2c6087){_0x127a06['push'](_0x127a06['shift']());}}}(a213_0x5cf3,0xd9e9c));export const RABETBASE_CDN_BASE_URL='https://g.lovrabet.com/dist/rabetbase-cli';function a213_0x5cf3(){const _0x3be1a7=['/templates/projects','5698070jfvjjG','75056sCjIgp','7602966YshUvT','271587EaHtIo','7833dwZqew','/config/index.json','405XuLzWz','32WpYkHD','186814mJeiRX','5448mCfkkW','77424NBkFRS'];a213_0x5cf3=function(){return _0x3be1a7;};return a213_0x5cf3();}export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a213_0xb7846e(0xea);function a213_0x46aa(_0x3493c7,_0x4a1f30){_0x3493c7=_0x3493c7-0xe4;const _0x5cf380=a213_0x5cf3();let _0x46aa25=_0x5cf380[_0x3493c7];return _0x46aa25;}export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a213_0xb7846e(0xe4);
1
+ const a213_0x5a2b96=a213_0x4503;function a213_0x4503(_0x31eff4,_0x6ab30){_0x31eff4=_0x31eff4-0x1b4;const _0x3f7968=a213_0x3f79();let _0x4503dc=_0x3f7968[_0x31eff4];return _0x4503dc;}(function(_0x3966de,_0x5204f2){const _0x5288a0=a213_0x4503,_0x9524ec=_0x3966de();while(!![]){try{const _0x3ed9af=parseInt(_0x5288a0(0x1bc))/0x1*(parseInt(_0x5288a0(0x1bf))/0x2)+parseInt(_0x5288a0(0x1b6))/0x3+-parseInt(_0x5288a0(0x1b4))/0x4+-parseInt(_0x5288a0(0x1b5))/0x5+-parseInt(_0x5288a0(0x1bd))/0x6*(-parseInt(_0x5288a0(0x1b8))/0x7)+parseInt(_0x5288a0(0x1b9))/0x8+-parseInt(_0x5288a0(0x1b7))/0x9*(-parseInt(_0x5288a0(0x1bb))/0xa);if(_0x3ed9af===_0x5204f2)break;else _0x9524ec['push'](_0x9524ec['shift']());}catch(_0x429d53){_0x9524ec['push'](_0x9524ec['shift']());}}}(a213_0x3f79,0xb4e95));function a213_0x3f79(){const _0x282a65=['309465okvMxo','5706nbcItm','115129vLQdFL','48552fHOJZq','https://g.lovrabet.com/dist/rabetbase-cli','6800NCQJnl','17bOkzwH','132qzZMMG','/config/index.json','146088PYFuHS','/templates/projects','3417984iZemzX','2742085eQYAtK'];a213_0x3f79=function(){return _0x282a65;};return a213_0x3f79();}export const RABETBASE_CDN_BASE_URL=a213_0x5a2b96(0x1ba);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a213_0x5a2b96(0x1be);export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a213_0x5a2b96(0x1c0);