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

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 (292) 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/business-groups.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff-refresh-start.js +1 -1
  88. package/lib/commands/db/diff-refresh-status.js +1 -1
  89. package/lib/commands/db/diff.js +1 -1
  90. package/lib/commands/db/index.js +1 -1
  91. package/lib/commands/db/list.js +1 -1
  92. package/lib/commands/db/shared.js +1 -1
  93. package/lib/commands/db/tables.js +1 -1
  94. package/lib/commands/db/test.js +1 -1
  95. package/lib/commands/db/update.js +1 -1
  96. package/lib/commands/doctor.js +1 -1
  97. package/lib/commands/file/index.js +1 -1
  98. package/lib/commands/init/index.js +1 -1
  99. package/lib/commands/issue/index.js +1 -1
  100. package/lib/commands/issue/nudge.js +1 -1
  101. package/lib/commands/issue/report.js +1 -1
  102. package/lib/commands/issue/shared.js +1 -1
  103. package/lib/commands/kb/create.js +1 -1
  104. package/lib/commands/kb/delete.js +1 -1
  105. package/lib/commands/kb/detail.js +1 -1
  106. package/lib/commands/kb/index.js +1 -1
  107. package/lib/commands/kb/list.js +1 -1
  108. package/lib/commands/kb/shared.js +1 -1
  109. package/lib/commands/kb/update.js +1 -1
  110. package/lib/commands/logs/index.js +1 -1
  111. package/lib/commands/menu/asset-update.js +1 -1
  112. package/lib/commands/menu/delete.js +1 -1
  113. package/lib/commands/menu/external-link-create.js +1 -1
  114. package/lib/commands/menu/external-link-update.js +1 -1
  115. package/lib/commands/menu/group-create.js +1 -1
  116. package/lib/commands/menu/group-update.js +1 -1
  117. package/lib/commands/menu/index.js +1 -1
  118. package/lib/commands/menu/list.js +1 -1
  119. package/lib/commands/menu/move.js +1 -1
  120. package/lib/commands/menu/regroup-start.js +1 -1
  121. package/lib/commands/menu/rename.js +1 -1
  122. package/lib/commands/menu/shared/compare-table.js +1 -1
  123. package/lib/commands/menu/shared/delete-plan.js +1 -1
  124. package/lib/commands/menu/shared/facts.js +1 -1
  125. package/lib/commands/menu/shared/index.js +1 -1
  126. package/lib/commands/menu/shared/inquirer.js +1 -1
  127. package/lib/commands/menu/shared/local-pages.js +1 -1
  128. package/lib/commands/menu/shared/logic.js +1 -1
  129. package/lib/commands/menu/shared/mutations.js +1 -1
  130. package/lib/commands/menu/shared/service.js +1 -1
  131. package/lib/commands/menu/shared/sync-core.js +1 -1
  132. package/lib/commands/menu/shared/update-core.js +1 -1
  133. package/lib/commands/menu/shared/valid-url.js +1 -1
  134. package/lib/commands/menu/sync.js +1 -1
  135. package/lib/commands/notification/config-create.js +1 -1
  136. package/lib/commands/notification/config-delete.js +1 -1
  137. package/lib/commands/notification/config-list.js +1 -1
  138. package/lib/commands/notification/config-update.js +1 -1
  139. package/lib/commands/notification/index.js +1 -1
  140. package/lib/commands/notification/shared.js +1 -1
  141. package/lib/commands/ocr/index.js +1 -1
  142. package/lib/commands/page/generate-start.js +1 -1
  143. package/lib/commands/page/generate-status.js +1 -1
  144. package/lib/commands/page/index.js +1 -1
  145. package/lib/commands/page/pull.js +1 -1
  146. package/lib/commands/page/push.js +1 -1
  147. package/lib/commands/page/react/create.js +1 -1
  148. package/lib/commands/page/react/detail.js +1 -1
  149. package/lib/commands/page/react/list.js +1 -1
  150. package/lib/commands/page/react/publish.js +1 -1
  151. package/lib/commands/page/react/shared.js +1 -1
  152. package/lib/commands/page/react/syntax.js +1 -1
  153. package/lib/commands/page/react/template.js +1 -1
  154. package/lib/commands/page/react/update.js +1 -1
  155. package/lib/commands/page/relation-audit.js +1 -1
  156. package/lib/commands/page/restore.js +1 -1
  157. package/lib/commands/page/shared.js +1 -1
  158. package/lib/commands/page/standard-page-status.js +1 -1
  159. package/lib/commands/page/sync.js +1 -1
  160. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  161. package/lib/commands/project/create/format-elapsed.js +1 -1
  162. package/lib/commands/project/create/main.js +1 -1
  163. package/lib/commands/project/create/materialize-project-template.js +1 -1
  164. package/lib/commands/project/create/project-name.js +1 -1
  165. package/lib/commands/project/create/project-template-archive.js +1 -1
  166. package/lib/commands/project/create/project-template-path.js +1 -1
  167. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  168. package/lib/commands/project/create/use-format-code.js +1 -1
  169. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  170. package/lib/commands/project/index.js +1 -1
  171. package/lib/commands/project/upgrade.js +1 -1
  172. package/lib/commands/registry.js +1 -1
  173. package/lib/commands/role/delete.js +1 -1
  174. package/lib/commands/role/detail.js +1 -1
  175. package/lib/commands/role/index.js +1 -1
  176. package/lib/commands/role/list.js +1 -1
  177. package/lib/commands/role/shared.js +1 -1
  178. package/lib/commands/role/update.js +1 -1
  179. package/lib/commands/role/user-add.js +1 -1
  180. package/lib/commands/role/user-remove.js +1 -1
  181. package/lib/commands/role/user-resolve.js +1 -1
  182. package/lib/commands/run/index.js +1 -1
  183. package/lib/commands/schema.js +1 -1
  184. package/lib/commands/sql/create.js +1 -1
  185. package/lib/commands/sql/delete.js +1 -1
  186. package/lib/commands/sql/detail.js +1 -1
  187. package/lib/commands/sql/exec.js +1 -1
  188. package/lib/commands/sql/index.js +1 -1
  189. package/lib/commands/sql/list.js +1 -1
  190. package/lib/commands/sql/pull.js +1 -1
  191. package/lib/commands/sql/push.js +1 -1
  192. package/lib/commands/sql/shared.js +1 -1
  193. package/lib/commands/sql/status.js +1 -1
  194. package/lib/commands/sql/validate.js +1 -1
  195. package/lib/commands/task/index.js +1 -1
  196. package/lib/commands/task/status.js +1 -1
  197. package/lib/commands/tenant/index.js +1 -1
  198. package/lib/commands/tenant/members-list.js +1 -1
  199. package/lib/commands/tenant/shared.js +1 -1
  200. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  201. package/lib/commands/user-account/index.js +1 -1
  202. package/lib/commands/workspace/add.js +1 -1
  203. package/lib/commands/workspace/index.js +1 -1
  204. package/lib/commands/workspace/remove.js +1 -1
  205. package/lib/config/schema.js +1 -1
  206. package/lib/constant/cdn.js +1 -1
  207. package/lib/constant/cli.js +1 -1
  208. package/lib/constant/defaults.js +1 -1
  209. package/lib/constant/domain.js +1 -1
  210. package/lib/constant/env.js +1 -1
  211. package/lib/constant/output.js +1 -1
  212. package/lib/constant/paths.js +1 -1
  213. package/lib/constant/risk.js +1 -1
  214. package/lib/context/app-resolver.js +1 -1
  215. package/lib/context/auth-resolver.js +1 -1
  216. package/lib/context/config-loader.js +1 -1
  217. package/lib/context.js +1 -1
  218. package/lib/core/alias-resolver.js +1 -1
  219. package/lib/core/api-client.js +1 -1
  220. package/lib/core/bff/config.js +1 -1
  221. package/lib/core/bff/file-system.js +1 -1
  222. package/lib/core/bff/hash.js +1 -1
  223. package/lib/core/bff/lock.js +1 -1
  224. package/lib/core/bff/utils.js +1 -1
  225. package/lib/core/db-resolver.js +1 -1
  226. package/lib/core/page/file-system.js +1 -1
  227. package/lib/core/page/hash.js +1 -1
  228. package/lib/core/page/lock.js +1 -1
  229. package/lib/core/sql-index-auditor.js +1 -1
  230. package/lib/core/sql-sync/config.js +1 -1
  231. package/lib/core/sql-sync/file-system.js +1 -1
  232. package/lib/core/sql-sync/hash.js +1 -1
  233. package/lib/core/sql-sync/lock.js +1 -1
  234. package/lib/core/sql-sync/utils.js +1 -1
  235. package/lib/core/sql-validator.js +1 -1
  236. package/lib/errors.js +1 -1
  237. package/lib/framework/build-all-flags.js +1 -1
  238. package/lib/framework/error-output.js +1 -1
  239. package/lib/framework/explicit-yes.js +1 -1
  240. package/lib/framework/flags.js +1 -1
  241. package/lib/framework/help.js +1 -1
  242. package/lib/framework/index.js +1 -1
  243. package/lib/framework/output.js +1 -1
  244. package/lib/framework/response.js +1 -1
  245. package/lib/framework/runner-alias.js +1 -1
  246. package/lib/framework/runner.js +1 -1
  247. package/lib/framework/schema-export.js +1 -1
  248. package/lib/framework/types.js +1 -1
  249. package/lib/generated/build-info.d.ts +4 -4
  250. package/lib/generated/build-info.js +1 -1
  251. package/lib/help.js +1 -1
  252. package/lib/postinstall.js +1 -1
  253. package/lib/runtime/confirmation.js +1 -1
  254. package/lib/runtime/event.js +1 -1
  255. package/lib/runtime/index.js +1 -1
  256. package/lib/runtime/queue.js +1 -1
  257. package/lib/runtime/resolve.js +1 -1
  258. package/lib/skills/builtin-skill.js +1 -1
  259. package/lib/skills/main.js +1 -1
  260. package/lib/skills/npx-skills-add.js +1 -1
  261. package/lib/skills/skill-presence.js +1 -1
  262. package/lib/telemetry/cli-command-trace.js +1 -1
  263. package/lib/telemetry/cli-help-trace.js +1 -1
  264. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  265. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  266. package/lib/telemetry/send-cli-trace-log.js +1 -1
  267. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  268. package/lib/utils/ai_config.js +1 -1
  269. package/lib/utils/apply-jq-filter.js +1 -1
  270. package/lib/utils/cdn-config.js +1 -1
  271. package/lib/utils/check-sdk-version.js +1 -1
  272. package/lib/utils/cli-version-check.js +1 -1
  273. package/lib/utils/cli-version-policy.js +1 -1
  274. package/lib/utils/config.js +1 -1
  275. package/lib/utils/entity-with-id.js +1 -1
  276. package/lib/utils/file-utils.js +1 -1
  277. package/lib/utils/guides-cdn.js +1 -1
  278. package/lib/utils/http-client.js +1 -1
  279. package/lib/utils/is-non-interactive.js +1 -1
  280. package/lib/utils/logger.js +1 -1
  281. package/lib/utils/params.js +1 -1
  282. package/lib/utils/platform.js +1 -1
  283. package/lib/utils/rules-cdn.js +1 -1
  284. package/lib/utils/sleep.js +1 -1
  285. package/lib/utils/template-replacer.js +1 -1
  286. package/lib/utils/update-notice.js +1 -1
  287. package/lib/utils/version.js +1 -1
  288. package/lib/utils/with-active-cookie.js +1 -1
  289. package/lib/utils/write-cli-side-channel.js +1 -1
  290. package/package.json +1 -1
  291. package/skills/rabetbase/SKILL.md +1 -1
  292. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a191_0x445a58=a191_0x5960;(function(_0x446792,_0x132c10){const _0x54faaf=a191_0x5960,_0x928946=_0x446792();while(!![]){try{const _0x47aa6c=parseInt(_0x54faaf(0x1ed))/0x1*(-parseInt(_0x54faaf(0x1dd))/0x2)+-parseInt(_0x54faaf(0x1c6))/0x3+parseInt(_0x54faaf(0x1ba))/0x4*(parseInt(_0x54faaf(0x1ee))/0x5)+parseInt(_0x54faaf(0x1d2))/0x6*(parseInt(_0x54faaf(0x1c2))/0x7)+-parseInt(_0x54faaf(0x1df))/0x8*(-parseInt(_0x54faaf(0x1b1))/0x9)+parseInt(_0x54faaf(0x1d1))/0xa+-parseInt(_0x54faaf(0x1b2))/0xb;if(_0x47aa6c===_0x132c10)break;else _0x928946['push'](_0x928946['shift']());}catch(_0x5b3e0b){_0x928946['push'](_0x928946['shift']());}}}(a191_0x19c2,0x62b15));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a191_0x5960(_0x126de7,_0x3443b1){_0x126de7=_0x126de7-0x1ab;const _0x19c235=a191_0x19c2();let _0x59608c=_0x19c235[_0x126de7];return _0x59608c;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x102d4e,_0x470bef,_0x1757c3){const _0x29540b=a191_0x5960,_0x5c46d6=await scanLocalSqlQueries(_0x102d4e),_0x5070ec=new Map();for(const _0x22f8e0 of _0x5c46d6){if(_0x1757c3&&_0x22f8e0[_0x29540b(0x1ea)]!==_0x1757c3)continue;const _0x1a73da=_0x5070ec['get'](_0x22f8e0[_0x29540b(0x1ea)])??[];_0x1a73da['push'](_0x22f8e0),_0x5070ec[_0x29540b(0x1c3)](_0x22f8e0['sqlCode'],_0x1a73da);}if(_0x1757c3&&!_0x5070ec[_0x29540b(0x1e2)](_0x1757c3))throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1b3)+_0x1757c3);const _0x5572ef=[];for(const [_0x1fb43d,_0x15c68e]of _0x5070ec[_0x29540b(0x1eb)]()){if(_0x15c68e['length']===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x15c68e[0x0]);continue;}const _0x223e5b=_0x470bef[_0x29540b(0x1ef)][_0x1fb43d],_0x3310e6=_0x223e5b?.[_0x29540b(0x1b5)],_0x4080eb=_0x3310e6?_0x15c68e[_0x29540b(0x1ac)](_0x5e0a69=>_0x5e0a69[_0x29540b(0x1d6)]!==_0x3310e6):_0x15c68e;if(_0x223e5b&&_0x4080eb[_0x29540b(0x1c1)]===0x1){_0x5572ef[_0x29540b(0x1cd)](_0x4080eb[0x0]);continue;}throw CliErrors[_0x29540b(0x1e4)](_0x29540b(0x1ab)+_0x1fb43d+_0x29540b(0x1d4));}return _0x5572ef;}export const sqlPush={'service':a191_0x445a58(0x1cb),'command':a191_0x445a58(0x1cd),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x445a58(0x1ca),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a191_0x445a58(0x1b9),'description':a191_0x445a58(0x1ae)}],async 'dryRun'(_0x343567){const _0xd9946a=a191_0x445a58,_0x19fd5b=loadSqlProjectConfig(_0x343567[_0xd9946a(0x1d0)]),_0x3abd2c=await readSqlLockFile(_0x19fd5b[_0xd9946a(0x1c7)]),{appLock:_0x128f4b}=ensureSqlLockScope(_0x3abd2c??createEmptySqlLock(),_0x343567[_0xd9946a(0x1d0)],_0x19fd5b[_0xd9946a(0x1d9)],_0xd9946a(0x1cd)),_0x6e6ada=await getTargetSqlQueries(_0x19fd5b,_0x128f4b,_0x343567[_0xd9946a(0x1b4)](_0xd9946a(0x1c8))||undefined),_0x59deb2=[];for(const _0x8028d3 of _0x6e6ada){const _0x97b16f=await computeSqlFileHash(_0x8028d3[_0xd9946a(0x1da)]),_0x15d8c1=_0x128f4b['sqls'][_0x8028d3[_0xd9946a(0x1ea)]],_0x18c675=!!_0x15d8c1&&(_0x15d8c1[_0xd9946a(0x1b5)]!==_0x8028d3['relativePath']||!!_0x8028d3[_0xd9946a(0x1e1)]&&_0x15d8c1[_0xd9946a(0x1e1)]!==_0x8028d3[_0xd9946a(0x1e1)]);if(!_0x343567[_0xd9946a(0x1c9)](_0xd9946a(0x1cc))&&_0x15d8c1&&_0x15d8c1[_0xd9946a(0x1ec)]===_0x97b16f&&!_0x18c675)continue;_0x59deb2[_0xd9946a(0x1cd)](_0x8028d3['sqlCode']);}return{'method':_0xd9946a(0x1e7),'url':_0xd9946a(0x1e8),'body':{'sqlCodes':_0x59deb2,'appCode':_0x343567[_0xd9946a(0x1d0)]},'description':_0xd9946a(0x1b6)+_0x59deb2[_0xd9946a(0x1c1)]+_0xd9946a(0x1bd)};},async 'execute'(_0x23e476){const _0x35d804=a191_0x445a58,_0x1d5c32=loadSqlProjectConfig(_0x23e476['appCode']),_0x3b33db=await readSqlLockFile(_0x1d5c32['lockFilePath']),{lockData:_0x270c11,appLock:_0x173a63}=ensureSqlLockScope(_0x3b33db??createEmptySqlLock(),_0x23e476[_0x35d804(0x1d0)],_0x1d5c32[_0x35d804(0x1d9)],_0x35d804(0x1cd)),_0x1a2f76=await getTargetSqlQueries(_0x1d5c32,_0x173a63,_0x23e476['str']('sqlcode')||undefined);if(_0x1a2f76[_0x35d804(0x1c1)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x35d804(0x1c4)};const _0x6eeb4e=[],_0x1a28b3=[],_0x561048=[];for(const _0xd646ab of _0x1a2f76){const _0x534851=_0x173a63['sqls'][_0xd646ab['sqlCode']];if(!_0x534851){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x35d804(0x1c5)});continue;}try{const _0x22486a=await computeSqlFileHash(_0xd646ab[_0x35d804(0x1da)]),_0x3e7fa6=_0x534851[_0x35d804(0x1b5)]!==_0xd646ab[_0x35d804(0x1d6)]||!!_0xd646ab['sqlName']&&_0x534851[_0x35d804(0x1e1)]!==_0xd646ab[_0x35d804(0x1e1)];if(!_0x23e476[_0x35d804(0x1c9)](_0x35d804(0x1cc))&&_0x534851[_0x35d804(0x1ec)]===_0x22486a&&!_0x3e7fa6){_0x1a28b3['push']({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'reason':_0x35d804(0x1af)});continue;}if(_0x534851[_0x35d804(0x1e0)]==null){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x12c5ab=await readFile(_0xd646ab[_0x35d804(0x1da)],_0x35d804(0x1de)),_0x5def3a=stripLocalSqlMetadata(_0x12c5ab,_0xd646ab['mode']),_0x26d1b3=_0xd646ab[_0x35d804(0x1e1)]||_0x534851[_0x35d804(0x1e1)],_0x2c5f10=await resolveTargetDbBinding(_0x23e476[_0x35d804(0x1d0)],_0xd646ab,_0x534851),_0x10a802=await updateSqlQuery({'id':_0x534851[_0x35d804(0x1d3)],'appCode':_0x23e476[_0x35d804(0x1d0)],'sqlCode':_0xd646ab['sqlCode'],'sqlName':_0x26d1b3,'dbId':_0x2c5f10[_0x35d804(0x1d5)],'version':_0x534851['version'],'sqlContent':_0x5def3a,'sqlConfig':_0x534851[_0x35d804(0x1e5)]??undefined}),_0x5b34ef=_0x10a802['dbId']?await getDbName(_0x23e476['appCode'],Number(_0x10a802['dbId']))['catch'](()=>_0x2c5f10[_0x35d804(0x1b0)]):_0x2c5f10['dbName'];_0x173a63[_0x35d804(0x1ef)][_0xd646ab[_0x35d804(0x1ea)]]={...buildSqlLockEntry(_0x10a802,_0x5def3a,_0x22486a,{'dbName':_0x5b34ef}),'path':_0xd646ab['relativePath'],'mode':_0x534851[_0x35d804(0x1ce)]},await archivePreviousSqlFileIfNeeded(_0x1d5c32,_0x534851[_0x35d804(0x1b5)],_0xd646ab[_0x35d804(0x1d6)]),_0x6eeb4e[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'remoteId':_0x534851['remoteId']});}catch(_0x2f49a0){_0x561048[_0x35d804(0x1cd)]({'sqlCode':_0xd646ab[_0x35d804(0x1ea)],'error':_0x2f49a0 instanceof Error?_0x2f49a0[_0x35d804(0x1f0)]:String(_0x2f49a0)});}}return _0x173a63[_0x35d804(0x1cf)]=new Date()[_0x35d804(0x1bf)](),await writeSqlLockFile(_0x1d5c32[_0x35d804(0x1c7)],_0x270c11),{'ok':_0x561048['length']===0x0,'data':{'pushed':_0x6eeb4e,'skipped':_0x1a28b3,'failed':_0x561048},'message':_0x35d804(0x1c0)+_0x6eeb4e[_0x35d804(0x1c1)]+_0x35d804(0x1f1)+_0x1a28b3[_0x35d804(0x1c1)]+_0x35d804(0x1e6)+_0x561048[_0x35d804(0x1c1)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x2d4db9,_0x43a7a4,_0xf0d7c1){const _0x206bcd=a191_0x445a58;if(!_0x43a7a4||_0x43a7a4===_0xf0d7c1)return;const _0x550b75=join(_0x2d4db9['sqlRootDir'],_0x43a7a4);if(!await fileExists(_0x550b75))return;const _0x53a5b9=await moveToTrash(_0x2d4db9['projectRoot'],_0x2d4db9[_0x206bcd(0x1dc)],_0x550b75);await cleanupEmptyDirectories(dirname(_0x550b75),_0x2d4db9[_0x206bcd(0x1bc)]),void _0x53a5b9;}async function moveToTrash(_0x4b0bd6,_0x8f60d0,_0x1976fe){const _0x4743a3=a191_0x445a58,_0x3c9f6d=new Date()[_0x4743a3(0x1bf)]()[_0x4743a3(0x1b7)](/[:.]/g,'-'),_0x43b2df=relative(_0x4b0bd6,_0x1976fe),_0x202c14=join(_0x8f60d0,_0x3c9f6d,_0x43b2df);return await mkdir(dirname(_0x202c14),{'recursive':!![]}),await rename(_0x1976fe,_0x202c14),_0x202c14;}function a191_0x19c2(){const _0x518b5c=['.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','dbId','relativePath','map','exec','sqlRoot','filePath','Local\x20directory\x20\x22','trashDir','1696VBeobr','utf8','272Abqemw','version','sqlName','has','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','validation','sqlConfig','\x20skipped,\x20','POST','/smartapi/custom/updateUserCustomSql','\x22\x20for\x20sqlCode\x20','sqlCode','entries','hash','21iYtIQt','259085fhsTOQ','sqls','message','\x20pushed,\x20','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','filter','isFinite','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','unchanged','dbName','102519YSKXOp','17319665uKvIwf','Local\x20SQL\x20not\x20found:\x20','str','path','Would\x20push\x20','replace','No\x20database\x20matches\x20local\x20directory\x20\x22','boolean','44RnRnUr','join','sqlRootDir','\x20SQL\x20file(s)','dbDirectory','toISOString','Push\x20complete:\x20','length','14zeOcOw','set','No\x20local\x20SQL\x20files\x20found.','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','30159AGUnxP','lockFilePath','sqlcode','bool','write','sql','force','push','mode','lastSync','appCode','5900900LVTIeB','1377750aMnrdW','remoteId'];a191_0x19c2=function(){return _0x518b5c;};return a191_0x19c2();}async function cleanupEmptyDirectories(_0x2c1acc,_0x127fd5){let _0x4e6f01=resolve(_0x2c1acc);const _0x57269c=resolve(_0x127fd5);while(_0x4e6f01['startsWith'](''+_0x57269c+sep)||_0x4e6f01===_0x57269c){if(_0x4e6f01===_0x57269c)return;try{const _0x2969f5=await readdir(_0x4e6f01);if(_0x2969f5['length']>0x0)return;await rmdir(_0x4e6f01);}catch{return;}_0x4e6f01=dirname(_0x4e6f01);}}async function resolveTargetDbBinding(_0x5dd1eb,_0x6245a,_0x34ef27){const _0x28dd48=a191_0x445a58,_0x149913=_0x6245a[_0x28dd48(0x1be)];if(!_0x149913)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0xfea5c8=buildDbDirectoryName(_0x34ef27[_0x28dd48(0x1b0)],_0x34ef27[_0x28dd48(0x1d5)]);if(_0x149913===_0xfea5c8)return{'dbId':_0x34ef27[_0x28dd48(0x1d5)],'dbName':_0x34ef27[_0x28dd48(0x1b0)]};const _0x115dfd=parseExplicitDbDirectory(_0x149913);if(_0x115dfd!=null)return{'dbId':_0x115dfd,'dbName':await getDbName(_0x5dd1eb,_0x115dfd)['catch'](()=>undefined)};const _0x1c8d6e=await listDatabases(_0x5dd1eb),_0x2f9cdb=_0x1c8d6e[_0x28dd48(0x1ac)](_0x2c7e29=>buildDbDirectoryName(_0x2c7e29[_0x28dd48(0x1b0)],_0x2c7e29[_0x28dd48(0x1d5)])===_0x149913);if(_0x2f9cdb[_0x28dd48(0x1c1)]===0x1)return{'dbId':_0x2f9cdb[0x0][_0x28dd48(0x1d5)],'dbName':_0x2f9cdb[0x0][_0x28dd48(0x1b0)]};if(_0x2f9cdb['length']===0x0)throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1b8)+_0x149913+_0x28dd48(0x1e9)+_0x6245a[_0x28dd48(0x1ea)]+'.');const _0x147e47=_0x2f9cdb[_0x28dd48(0x1d7)](_0x166e3d=>_0x166e3d[_0x28dd48(0x1b0)]+'\x20('+_0x166e3d[_0x28dd48(0x1d5)]+')')[_0x28dd48(0x1bb)](',\x20');throw CliErrors[_0x28dd48(0x1e4)](_0x28dd48(0x1db)+_0x149913+_0x28dd48(0x1e3)+_0x6245a[_0x28dd48(0x1ea)]+':\x20'+_0x147e47);}function parseExplicitDbDirectory(_0xe45f6f){const _0x37683a=a191_0x445a58,_0x2d4cca=/^db-(\d+)$/[_0x37683a(0x1d8)](_0xe45f6f);if(!_0x2d4cca)return null;const _0x1e1ae4=Number(_0x2d4cca[0x1]);return Number[_0x37683a(0x1ad)](_0x1e1ae4)&&_0x1e1ae4>0x0?_0x1e1ae4:null;}
1
+ const a191_0x110479=a191_0x30d8;(function(_0x2bc606,_0x1f1f2d){const _0x4d5235=a191_0x30d8,_0x39ca42=_0x2bc606();while(!![]){try{const _0x2ea889=parseInt(_0x4d5235(0x10b))/0x1*(-parseInt(_0x4d5235(0x113))/0x2)+parseInt(_0x4d5235(0x127))/0x3*(parseInt(_0x4d5235(0x11b))/0x4)+parseInt(_0x4d5235(0x100))/0x5*(-parseInt(_0x4d5235(0xf6))/0x6)+parseInt(_0x4d5235(0x11f))/0x7*(-parseInt(_0x4d5235(0x101))/0x8)+parseInt(_0x4d5235(0x131))/0x9*(parseInt(_0x4d5235(0x134))/0xa)+-parseInt(_0x4d5235(0x104))/0xb+-parseInt(_0x4d5235(0x10a))/0xc*(-parseInt(_0x4d5235(0x11a))/0xd);if(_0x2ea889===_0x1f1f2d)break;else _0x39ca42['push'](_0x39ca42['shift']());}catch(_0x16658b){_0x39ca42['push'](_0x39ca42['shift']());}}}(a191_0x1c0a,0x88a9a));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';function a191_0x30d8(_0x16cbf5,_0x549243){_0x16cbf5=_0x16cbf5-0xf3;const _0x1c0a2f=a191_0x1c0a();let _0x30d869=_0x1c0a2f[_0x16cbf5];return _0x30d869;}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';function a191_0x1c0a(){const _0x3d30c6=['No\x20database\x20matches\x20local\x20directory\x20\x22','push','str','appCode','set','dbId','sqlRootDir','/smartapi/custom/updateUserCustomSql','sql','9778599KyUCkq','sqlCode','\x20skipped,\x20','10XvFoIR','dbDirectory','\x22\x20for\x20sqlCode\x20','sqlName','force','validation','No\x20local\x20SQL\x20files\x20found.','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','6QwRFoK','lockFilePath','utf8','bool','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','has','trashDir','startsWith','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','\x20pushed,\x20','4328925gjAMwL','2927648fyaKnR','\x20failed','path','9369294KikBDQ','remoteId','relativePath','version','hash','message','12OCpgDD','2FOJwNo','get','exec','dbName','sqls','mode','POST','catch','379906Jpmcbu','projectRoot','sqlcode','Local\x20directory\x20\x22','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','sqlRoot','isFinite','14590550pdNobx','1628620mWbRnO','join','write','lastSync','7fOTdhY','filter','map','entries','length','unchanged','Local\x20SQL\x20not\x20found:\x20','Would\x20push\x20','6DyOboG'];a191_0x1c0a=function(){return _0x3d30c6;};return a191_0x1c0a();}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(_0x2fc2de,_0x429ea9,_0x2e2a95){const _0x1d276d=a191_0x30d8,_0x38c2db=await scanLocalSqlQueries(_0x2fc2de),_0x558ef=new Map();for(const _0x3a7f91 of _0x38c2db){if(_0x2e2a95&&_0x3a7f91['sqlCode']!==_0x2e2a95)continue;const _0x4ec7b7=_0x558ef[_0x1d276d(0x10c)](_0x3a7f91['sqlCode'])??[];_0x4ec7b7[_0x1d276d(0x129)](_0x3a7f91),_0x558ef[_0x1d276d(0x12c)](_0x3a7f91[_0x1d276d(0x132)],_0x4ec7b7);}if(_0x2e2a95&&!_0x558ef[_0x1d276d(0xfb)](_0x2e2a95))throw CliErrors[_0x1d276d(0xf3)](_0x1d276d(0x125)+_0x2e2a95);const _0xd5eb75=[];for(const [_0x5dff59,_0x1ecf9d]of _0x558ef[_0x1d276d(0x122)]()){if(_0x1ecf9d[_0x1d276d(0x123)]===0x1){_0xd5eb75[_0x1d276d(0x129)](_0x1ecf9d[0x0]);continue;}const _0x31f70f=_0x429ea9[_0x1d276d(0x10f)][_0x5dff59],_0x5a88a2=_0x31f70f?.[_0x1d276d(0x103)],_0x40d509=_0x5a88a2?_0x1ecf9d[_0x1d276d(0x120)](_0x197ec5=>_0x197ec5[_0x1d276d(0x106)]!==_0x5a88a2):_0x1ecf9d;if(_0x31f70f&&_0x40d509[_0x1d276d(0x123)]===0x1){_0xd5eb75[_0x1d276d(0x129)](_0x40d509[0x0]);continue;}throw CliErrors[_0x1d276d(0xf3)](_0x1d276d(0xf5)+_0x5dff59+'.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.');}return _0xd5eb75;}export const sqlPush={'service':a191_0x110479(0x130),'command':a191_0x110479(0x129),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a191_0x110479(0x11d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':'boolean','description':a191_0x110479(0xfe)}],async 'dryRun'(_0x1f5fbb){const _0x5a2bff=a191_0x110479,_0x598c20=loadSqlProjectConfig(_0x1f5fbb[_0x5a2bff(0x12b)]),_0x5e4330=await readSqlLockFile(_0x598c20[_0x5a2bff(0xf7)]),{appLock:_0x1686b7}=ensureSqlLockScope(_0x5e4330??createEmptySqlLock(),_0x1f5fbb[_0x5a2bff(0x12b)],_0x598c20[_0x5a2bff(0x118)],_0x5a2bff(0x129)),_0x5635b9=await getTargetSqlQueries(_0x598c20,_0x1686b7,_0x1f5fbb[_0x5a2bff(0x12a)](_0x5a2bff(0x115))||undefined),_0x4b938c=[];for(const _0x297707 of _0x5635b9){const _0x5584a9=await computeSqlFileHash(_0x297707['filePath']),_0x430667=_0x1686b7[_0x5a2bff(0x10f)][_0x297707[_0x5a2bff(0x132)]],_0x14c4c1=!!_0x430667&&(_0x430667[_0x5a2bff(0x103)]!==_0x297707[_0x5a2bff(0x106)]||!!_0x297707[_0x5a2bff(0x137)]&&_0x430667['sqlName']!==_0x297707[_0x5a2bff(0x137)]);if(!_0x1f5fbb[_0x5a2bff(0xf9)](_0x5a2bff(0x138))&&_0x430667&&_0x430667[_0x5a2bff(0x108)]===_0x5584a9&&!_0x14c4c1)continue;_0x4b938c[_0x5a2bff(0x129)](_0x297707['sqlCode']);}return{'method':_0x5a2bff(0x111),'url':_0x5a2bff(0x12f),'body':{'sqlCodes':_0x4b938c,'appCode':_0x1f5fbb[_0x5a2bff(0x12b)]},'description':_0x5a2bff(0x126)+_0x4b938c[_0x5a2bff(0x123)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x1dc9e9){const _0x5d84bd=a191_0x110479,_0x7aa3e7=loadSqlProjectConfig(_0x1dc9e9[_0x5d84bd(0x12b)]),_0x2750c5=await readSqlLockFile(_0x7aa3e7[_0x5d84bd(0xf7)]),{lockData:_0x3dd614,appLock:_0x460697}=ensureSqlLockScope(_0x2750c5??createEmptySqlLock(),_0x1dc9e9[_0x5d84bd(0x12b)],_0x7aa3e7[_0x5d84bd(0x118)],_0x5d84bd(0x129)),_0x391e66=await getTargetSqlQueries(_0x7aa3e7,_0x460697,_0x1dc9e9[_0x5d84bd(0x12a)]('sqlcode')||undefined);if(_0x391e66[_0x5d84bd(0x123)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5d84bd(0xf4)};const _0x5a64b0=[],_0x288a32=[],_0x4e6477=[];for(const _0x57a846 of _0x391e66){const _0xec37b2=_0x460697[_0x5d84bd(0x10f)][_0x57a846['sqlCode']];if(!_0xec37b2){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'error':_0x5d84bd(0xfa)});continue;}try{const _0x3bacb9=await computeSqlFileHash(_0x57a846['filePath']),_0x163712=_0xec37b2[_0x5d84bd(0x103)]!==_0x57a846['relativePath']||!!_0x57a846['sqlName']&&_0xec37b2['sqlName']!==_0x57a846[_0x5d84bd(0x137)];if(!_0x1dc9e9['bool'](_0x5d84bd(0x138))&&_0xec37b2[_0x5d84bd(0x108)]===_0x3bacb9&&!_0x163712){_0x288a32[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'reason':_0x5d84bd(0x124)});continue;}if(_0xec37b2['version']==null){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'error':_0x5d84bd(0x117)});continue;}const _0x599607=await readFile(_0x57a846['filePath'],_0x5d84bd(0xf8)),_0x5c2486=stripLocalSqlMetadata(_0x599607,_0x57a846[_0x5d84bd(0x110)]),_0x271860=_0x57a846['sqlName']||_0xec37b2[_0x5d84bd(0x137)],_0x113504=await resolveTargetDbBinding(_0x1dc9e9[_0x5d84bd(0x12b)],_0x57a846,_0xec37b2),_0x4cc2a0=await updateSqlQuery({'id':_0xec37b2[_0x5d84bd(0x105)],'appCode':_0x1dc9e9['appCode'],'sqlCode':_0x57a846[_0x5d84bd(0x132)],'sqlName':_0x271860,'dbId':_0x113504[_0x5d84bd(0x12d)],'version':_0xec37b2[_0x5d84bd(0x107)],'sqlContent':_0x5c2486,'sqlConfig':_0xec37b2['sqlConfig']??undefined}),_0x271fd0=_0x4cc2a0[_0x5d84bd(0x12d)]?await getDbName(_0x1dc9e9['appCode'],Number(_0x4cc2a0['dbId']))[_0x5d84bd(0x112)](()=>_0x113504['dbName']):_0x113504['dbName'];_0x460697['sqls'][_0x57a846[_0x5d84bd(0x132)]]={...buildSqlLockEntry(_0x4cc2a0,_0x5c2486,_0x3bacb9,{'dbName':_0x271fd0}),'path':_0x57a846[_0x5d84bd(0x106)],'mode':_0xec37b2[_0x5d84bd(0x110)]},await archivePreviousSqlFileIfNeeded(_0x7aa3e7,_0xec37b2[_0x5d84bd(0x103)],_0x57a846['relativePath']),_0x5a64b0[_0x5d84bd(0x129)]({'sqlCode':_0x57a846[_0x5d84bd(0x132)],'remoteId':_0xec37b2[_0x5d84bd(0x105)]});}catch(_0x30af63){_0x4e6477[_0x5d84bd(0x129)]({'sqlCode':_0x57a846['sqlCode'],'error':_0x30af63 instanceof Error?_0x30af63[_0x5d84bd(0x109)]:String(_0x30af63)});}}return _0x460697[_0x5d84bd(0x11e)]=new Date()['toISOString'](),await writeSqlLockFile(_0x7aa3e7[_0x5d84bd(0xf7)],_0x3dd614),{'ok':_0x4e6477[_0x5d84bd(0x123)]===0x0,'data':{'pushed':_0x5a64b0,'skipped':_0x288a32,'failed':_0x4e6477},'message':'Push\x20complete:\x20'+_0x5a64b0[_0x5d84bd(0x123)]+_0x5d84bd(0xff)+_0x288a32[_0x5d84bd(0x123)]+_0x5d84bd(0x133)+_0x4e6477['length']+_0x5d84bd(0x102)};}};async function archivePreviousSqlFileIfNeeded(_0x241cfc,_0x1bf5e5,_0x2a9d2d){const _0xdca36a=a191_0x110479;if(!_0x1bf5e5||_0x1bf5e5===_0x2a9d2d)return;const _0x5e6e62=join(_0x241cfc[_0xdca36a(0x12e)],_0x1bf5e5);if(!await fileExists(_0x5e6e62))return;const _0x378764=await moveToTrash(_0x241cfc[_0xdca36a(0x114)],_0x241cfc[_0xdca36a(0xfc)],_0x5e6e62);await cleanupEmptyDirectories(dirname(_0x5e6e62),_0x241cfc['sqlRootDir']),void _0x378764;}async function moveToTrash(_0x586086,_0x48e81c,_0x4b2953){const _0x92143a=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1c4c0c=relative(_0x586086,_0x4b2953),_0x36f50c=join(_0x48e81c,_0x92143a,_0x1c4c0c);return await mkdir(dirname(_0x36f50c),{'recursive':!![]}),await rename(_0x4b2953,_0x36f50c),_0x36f50c;}async function cleanupEmptyDirectories(_0x2d4072,_0x285bfc){const _0x3e3a25=a191_0x110479;let _0x3f8a10=resolve(_0x2d4072);const _0x1e5c32=resolve(_0x285bfc);while(_0x3f8a10[_0x3e3a25(0xfd)](''+_0x1e5c32+sep)||_0x3f8a10===_0x1e5c32){if(_0x3f8a10===_0x1e5c32)return;try{const _0x455250=await readdir(_0x3f8a10);if(_0x455250[_0x3e3a25(0x123)]>0x0)return;await rmdir(_0x3f8a10);}catch{return;}_0x3f8a10=dirname(_0x3f8a10);}}async function resolveTargetDbBinding(_0x12771b,_0x1c4b7d,_0x260cf8){const _0x1267cb=a191_0x110479,_0xd4477c=_0x1c4b7d[_0x1267cb(0x135)];if(!_0xd4477c)return{'dbId':_0x260cf8['dbId'],'dbName':_0x260cf8[_0x1267cb(0x10e)]};const _0x3e195d=buildDbDirectoryName(_0x260cf8[_0x1267cb(0x10e)],_0x260cf8[_0x1267cb(0x12d)]);if(_0xd4477c===_0x3e195d)return{'dbId':_0x260cf8['dbId'],'dbName':_0x260cf8['dbName']};const _0x3815f7=parseExplicitDbDirectory(_0xd4477c);if(_0x3815f7!=null)return{'dbId':_0x3815f7,'dbName':await getDbName(_0x12771b,_0x3815f7)[_0x1267cb(0x112)](()=>undefined)};const _0x47bfb7=await listDatabases(_0x12771b),_0x36ffde=_0x47bfb7['filter'](_0x492c50=>buildDbDirectoryName(_0x492c50[_0x1267cb(0x10e)],_0x492c50['dbId'])===_0xd4477c);if(_0x36ffde[_0x1267cb(0x123)]===0x1)return{'dbId':_0x36ffde[0x0]['dbId'],'dbName':_0x36ffde[0x0][_0x1267cb(0x10e)]};if(_0x36ffde['length']===0x0)throw CliErrors[_0x1267cb(0xf3)](_0x1267cb(0x128)+_0xd4477c+_0x1267cb(0x136)+_0x1c4b7d['sqlCode']+'.');const _0x47dc51=_0x36ffde[_0x1267cb(0x121)](_0x5cc6e0=>_0x5cc6e0['dbName']+'\x20('+_0x5cc6e0['dbId']+')')[_0x1267cb(0x11c)](',\x20');throw CliErrors[_0x1267cb(0xf3)](_0x1267cb(0x116)+_0xd4477c+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x1c4b7d[_0x1267cb(0x132)]+':\x20'+_0x47dc51);}function parseExplicitDbDirectory(_0x38af16){const _0x5ba65c=a191_0x110479,_0x135d36=/^db-(\d+)$/[_0x5ba65c(0x10d)](_0x38af16);if(!_0x135d36)return null;const _0x1a254b=Number(_0x135d36[0x1]);return Number[_0x5ba65c(0x119)](_0x1a254b)&&_0x1a254b>0x0?_0x1a254b:null;}
@@ -1 +1 @@
1
- (function(_0xe45b9c,_0x24d27d){const _0x1a2a10=a192_0x16c7,_0x54f3e2=_0xe45b9c();while(!![]){try{const _0x24c913=parseInt(_0x1a2a10(0x127))/0x1*(parseInt(_0x1a2a10(0x134))/0x2)+-parseInt(_0x1a2a10(0x13c))/0x3*(parseInt(_0x1a2a10(0x11a))/0x4)+parseInt(_0x1a2a10(0x12f))/0x5*(-parseInt(_0x1a2a10(0x131))/0x6)+-parseInt(_0x1a2a10(0x13a))/0x7+parseInt(_0x1a2a10(0x11c))/0x8+parseInt(_0x1a2a10(0x125))/0x9+parseInt(_0x1a2a10(0x12e))/0xa*(parseInt(_0x1a2a10(0x11b))/0xb);if(_0x24c913===_0x24d27d)break;else _0x54f3e2['push'](_0x54f3e2['shift']());}catch(_0x73d1be){_0x54f3e2['push'](_0x54f3e2['shift']());}}}(a192_0x5481,0xceae9));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';function a192_0x16c7(_0x53a0aa,_0x501423){_0x53a0aa=_0x53a0aa-0x110;const _0x548139=a192_0x5481();let _0x16c73e=_0x548139[_0x53a0aa];return _0x16c73e;}function a192_0x5481(){const _0x4f7498=['2rWozSP','sqlName','sqlContent','mode','dbName','mybatisXml','6121962cIAhpK','apps','118977Udbuhs','path','stdin','yes','syncedAt','close','description','lastSync','includes','sqls','sqlCode','104GcVQwd','25219634BCQBrp','2995144DkcZmD','trim','entries','test','map','trimStart','\x20[y/N]\x20','sqlConfig','split','7963578tPnwBR','endsWith','550931EWEotC','filter','length','--\x20@lovrabet.','fromEntries','dbId','push','10cVZJxa','613905wLqfJL','sqlRoot','66mPAmwV','stderr','join'];a192_0x5481=function(){return _0x4f7498;};return a192_0x5481();}export function buildSqlLockEntry(_0x4bde7b,_0x194960,_0x12f177,_0x5d5e88){const _0x56b56a=a192_0x16c7,_0x2080a0=detectSqlMode(_0x194960);return{'path':buildSqlRelativePath(_0x4bde7b[_0x56b56a(0x119)],_0x4bde7b[_0x56b56a(0x135)],_0x5d5e88?.[_0x56b56a(0x138)],_0x2080a0,_0x4bde7b[_0x56b56a(0x12c)]),'hash':_0x12f177,'remoteId':_0x4bde7b['id'],'version':_0x4bde7b['version'],'dbId':Number(_0x4bde7b['dbId']),'dbName':_0x5d5e88?.[_0x56b56a(0x138)],'sqlName':_0x4bde7b[_0x56b56a(0x135)],'sqlConfig':_0x4bde7b[_0x56b56a(0x123)]??undefined,'mode':_0x2080a0};}export function cloneSqlLockData(_0xa28cc8){const _0xaa9680=a192_0x16c7;return{'apps':Object[_0xaa9680(0x12b)](Object[_0xaa9680(0x11e)](_0xa28cc8[_0xaa9680(0x13b)])[_0xaa9680(0x120)](([_0x27b6b,_0x400118])=>[_0x27b6b,{'sqlRoot':_0x400118[_0xaa9680(0x130)],'lastSync':_0x400118[_0xaa9680(0x116)],'sqls':{..._0x400118[_0xaa9680(0x118)]}}]))};}export function ensureRemoteSqlContent(_0x3e466c){const _0xcd3b6b=a192_0x16c7;return _0x3e466c[_0xcd3b6b(0x136)]??'';}export function buildLocalSqlFileContent(_0x10c68a,_0x1ba8d8,_0x2fae74){const _0x2ddf2e=a192_0x16c7,_0x2ad335=_0x2fae74?.[_0x2ddf2e(0x137)]??detectSqlMode(_0x1ba8d8),_0x1bbe7d=stripLocalSqlMetadata(_0x1ba8d8,_0x2ad335)[_0x2ddf2e(0x11d)](),_0x2e8c2c=[...buildMetadataHeaderLines({'sqlCode':_0x10c68a['sqlCode'],'sqlName':_0x10c68a[_0x2ddf2e(0x135)],'dbId':_0x10c68a[_0x2ddf2e(0x12c)],'dbName':_0x2fae74?.[_0x2ddf2e(0x138)],'mode':_0x2ad335,'syncedAt':_0x2fae74?.[_0x2ddf2e(0x113)],'description':_0x2fae74?.[_0x2ddf2e(0x115)]},_0x2ad335),'',_0x1bbe7d],_0x587547=_0x2e8c2c[_0x2ddf2e(0x133)]('\x0a');return _0x587547[_0x2ddf2e(0x126)]('\x0a')?_0x587547:_0x587547+'\x0a';}export function stripLocalSqlMetadata(_0x722588,_0x5cd4c5){const _0x3444e9=a192_0x16c7,_0x432613=_0x722588['replace'](/\r\n/g,'\x0a')[_0x3444e9(0x124)]('\x0a'),_0x258f4d=[];let _0x2225bb=0x0;if(_0x5cd4c5==='mybatisXml')while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x40a19d=_0x432613[_0x2225bb]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x40a19d)){_0x2225bb++;continue;}if(_0x40a19d[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}else while(_0x2225bb<_0x432613[_0x3444e9(0x129)]){const _0x3db748=_0x432613[_0x2225bb]??'';if(/^\s*--\s*@lovrabet\./[_0x3444e9(0x11f)](_0x3db748)){_0x2225bb++;continue;}if(_0x3db748[_0x3444e9(0x11d)]()===''&&_0x2225bb>0x0){_0x2225bb++;continue;}break;}for(;_0x2225bb<_0x432613['length'];_0x2225bb++){_0x258f4d[_0x3444e9(0x12d)](_0x432613[_0x2225bb]);}return _0x258f4d['join']('\x0a')[_0x3444e9(0x121)]();}export function resolveSqlMode(_0x5dd49c,_0x368da5){const _0x4c0261=a192_0x16c7;if(_0x368da5?.[_0x4c0261(0x137)])return _0x368da5[_0x4c0261(0x137)];return detectSqlMode(_0x5dd49c);}export function resolveSqlFileName(_0x18b434,_0x550028,_0x32e61a){const _0x37a390=a192_0x16c7;if(_0x32e61a?.[_0x37a390(0x110)])return _0x32e61a[_0x37a390(0x110)];if(_0x32e61a?.[_0x37a390(0x135)]||_0x32e61a?.[_0x37a390(0x138)])return buildSqlRelativePath(_0x18b434,_0x32e61a?.[_0x37a390(0x135)],_0x32e61a?.['dbName'],resolveSqlMode(_0x550028,_0x32e61a),_0x32e61a?.['dbId']);return buildDefaultSqlFileName(_0x18b434,resolveSqlMode(_0x550028,_0x32e61a));}export function resolveSqlLocalDir(_0x418f8e,_0x1196f0){return join(_0x418f8e,SQL_LOCAL_REL_DIR,_0x1196f0);}export async function confirmForceOverwrite(_0x1be92d){const _0x18222a=a192_0x16c7,_0x5e3e72=createInterface({'input':process[_0x18222a(0x111)],'output':process[_0x18222a(0x132)]}),_0x13c987=await new Promise(_0x3ea5cc=>{const _0x53c81f=_0x18222a;_0x5e3e72['question'](_0x1be92d+_0x53c81f(0x122),_0x3ea5cc);});return _0x5e3e72[_0x18222a(0x114)](),['y',_0x18222a(0x112)][_0x18222a(0x117)](_0x13c987[_0x18222a(0x11d)]()['toLowerCase']());}export function findSqlLockScope(_0x12da49,_0x4aef32){const _0x3bf873=a192_0x16c7;return _0x12da49[_0x3bf873(0x13b)][_0x4aef32];}function buildMetadataHeaderLines(_0xbff397,_0x51330a){const _0x11c2a4=a192_0x16c7,_0x2ed238=[['sqlCode',_0xbff397[_0x11c2a4(0x119)]],[_0x11c2a4(0x135),_0xbff397['sqlName']],[_0x11c2a4(0x12c),_0xbff397[_0x11c2a4(0x12c)]],[_0x11c2a4(0x138),_0xbff397['dbName']],[_0x11c2a4(0x137),_0xbff397[_0x11c2a4(0x137)]],['syncedAt',_0xbff397['syncedAt']],[_0x11c2a4(0x115),_0xbff397['description']]];if(_0x51330a===_0x11c2a4(0x139))return _0x2ed238[_0x11c2a4(0x128)](([,_0x5b8061])=>_0x5b8061!==undefined&&_0x5b8061!==null&&String(_0x5b8061)[_0x11c2a4(0x11d)]()!=='')[_0x11c2a4(0x120)](([_0x1b836c,_0x3cc4d8])=>'<!--\x20@lovrabet.'+_0x1b836c+':\x20'+String(_0x3cc4d8)+'\x20-->');return _0x2ed238[_0x11c2a4(0x128)](([,_0x3c549b])=>_0x3c549b!==undefined&&_0x3c549b!==null&&String(_0x3c549b)[_0x11c2a4(0x11d)]()!=='')['map'](([_0x111607,_0x342271])=>_0x11c2a4(0x12a)+_0x111607+':\x20'+String(_0x342271));}
1
+ const a192_0x36ea5a=a192_0x54f0;(function(_0x46d68a,_0x1f6f18){const _0x48339f=a192_0x54f0,_0x345418=_0x46d68a();while(!![]){try{const _0x2a06bc=-parseInt(_0x48339f(0x1a0))/0x1+parseInt(_0x48339f(0x196))/0x2+-parseInt(_0x48339f(0x193))/0x3+parseInt(_0x48339f(0x190))/0x4*(-parseInt(_0x48339f(0x1a6))/0x5)+parseInt(_0x48339f(0x197))/0x6*(-parseInt(_0x48339f(0x189))/0x7)+-parseInt(_0x48339f(0x185))/0x8*(parseInt(_0x48339f(0x19a))/0x9)+parseInt(_0x48339f(0x1ad))/0xa*(parseInt(_0x48339f(0x1aa))/0xb);if(_0x2a06bc===_0x1f6f18)break;else _0x345418['push'](_0x345418['shift']());}catch(_0x19b5b4){_0x345418['push'](_0x345418['shift']());}}}(a192_0x4812,0x9308b));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=a192_0x36ea5a(0x199);export function buildSqlLockEntry(_0x3a7100,_0x52cb31,_0x1d3e6e,_0x45db57){const _0x54ce82=a192_0x36ea5a,_0x2404ea=detectSqlMode(_0x52cb31);return{'path':buildSqlRelativePath(_0x3a7100[_0x54ce82(0x1a4)],_0x3a7100['sqlName'],_0x45db57?.[_0x54ce82(0x18e)],_0x2404ea,_0x3a7100[_0x54ce82(0x186)]),'hash':_0x1d3e6e,'remoteId':_0x3a7100['id'],'version':_0x3a7100['version'],'dbId':Number(_0x3a7100['dbId']),'dbName':_0x45db57?.[_0x54ce82(0x18e)],'sqlName':_0x3a7100[_0x54ce82(0x19c)],'sqlConfig':_0x3a7100[_0x54ce82(0x1a1)]??undefined,'mode':_0x2404ea};}export function cloneSqlLockData(_0xfd04c4){const _0x1b047d=a192_0x36ea5a;return{'apps':Object[_0x1b047d(0x19b)](Object[_0x1b047d(0x18a)](_0xfd04c4[_0x1b047d(0x1a5)])[_0x1b047d(0x18b)](([_0x132257,_0x2ed951])=>[_0x132257,{'sqlRoot':_0x2ed951[_0x1b047d(0x1a9)],'lastSync':_0x2ed951[_0x1b047d(0x194)],'sqls':{..._0x2ed951['sqls']}}]))};}export function ensureRemoteSqlContent(_0x162d22){const _0x506814=a192_0x36ea5a;return _0x162d22[_0x506814(0x195)]??'';}export function buildLocalSqlFileContent(_0x469a39,_0x5d9d61,_0x6b50b6){const _0x435074=a192_0x36ea5a,_0x51125a=_0x6b50b6?.[_0x435074(0x1a2)]??detectSqlMode(_0x5d9d61),_0x2b65c0=stripLocalSqlMetadata(_0x5d9d61,_0x51125a)[_0x435074(0x18d)](),_0x8176e8=[...buildMetadataHeaderLines({'sqlCode':_0x469a39[_0x435074(0x1a4)],'sqlName':_0x469a39[_0x435074(0x19c)],'dbId':_0x469a39[_0x435074(0x186)],'dbName':_0x6b50b6?.['dbName'],'mode':_0x51125a,'syncedAt':_0x6b50b6?.[_0x435074(0x191)],'description':_0x6b50b6?.['description']},_0x51125a),'',_0x2b65c0],_0x1899f2=_0x8176e8[_0x435074(0x1ac)]('\x0a');return _0x1899f2[_0x435074(0x18f)]('\x0a')?_0x1899f2:_0x1899f2+'\x0a';}function a192_0x54f0(_0x2ba293,_0x6decc8){_0x2ba293=_0x2ba293-0x183;const _0x481246=a192_0x4812();let _0x54f036=_0x481246[_0x2ba293];return _0x54f036;}export function stripLocalSqlMetadata(_0x381b78,_0x17c804){const _0x570e54=a192_0x36ea5a,_0x1cfb6d=_0x381b78[_0x570e54(0x18c)](/\r\n/g,'\x0a')[_0x570e54(0x19e)]('\x0a'),_0x50b361=[];let _0x3718d3=0x0;if(_0x17c804===_0x570e54(0x1ae))while(_0x3718d3<_0x1cfb6d[_0x570e54(0x192)]){const _0x4f4b10=_0x1cfb6d[_0x3718d3]??'';if(/^\s*<!--\s*@lovrabet\./[_0x570e54(0x198)](_0x4f4b10)){_0x3718d3++;continue;}if(_0x4f4b10[_0x570e54(0x18d)]()===''&&_0x3718d3>0x0){_0x3718d3++;continue;}break;}else while(_0x3718d3<_0x1cfb6d[_0x570e54(0x192)]){const _0x3a3973=_0x1cfb6d[_0x3718d3]??'';if(/^\s*--\s*@lovrabet\./[_0x570e54(0x198)](_0x3a3973)){_0x3718d3++;continue;}if(_0x3a3973[_0x570e54(0x18d)]()===''&&_0x3718d3>0x0){_0x3718d3++;continue;}break;}for(;_0x3718d3<_0x1cfb6d[_0x570e54(0x192)];_0x3718d3++){_0x50b361[_0x570e54(0x1a8)](_0x1cfb6d[_0x3718d3]);}return _0x50b361[_0x570e54(0x1ac)]('\x0a')[_0x570e54(0x183)]();}function a192_0x4812(){const _0x2480fe=['763526aIbuRu','143214JYxLDb','test','.rabetbase/sql','639vUNPxn','fromEntries','sqlName','close','split','--\x20@lovrabet.','160960RgrGSo','sqlConfig','mode','description','sqlCode','apps','5nmsUhv','filter','push','sqlRoot','11sLUiDn','toLowerCase','join','24713450NzzDCx','mybatisXml','path','question','\x20-->','\x20[y/N]\x20','trimStart','yes','58616HVhdVb','dbId','<!--\x20@lovrabet.','stderr','154nKCDKT','entries','map','replace','trim','dbName','endsWith','2276468lBkgvW','syncedAt','length','1426335sSuCex','lastSync','sqlContent'];a192_0x4812=function(){return _0x2480fe;};return a192_0x4812();}export function resolveSqlMode(_0x1ce115,_0x29da5c){const _0x40af6a=a192_0x36ea5a;if(_0x29da5c?.[_0x40af6a(0x1a2)])return _0x29da5c[_0x40af6a(0x1a2)];return detectSqlMode(_0x1ce115);}export function resolveSqlFileName(_0x2bb1cc,_0x54c787,_0xa37899){const _0x5a3c28=a192_0x36ea5a;if(_0xa37899?.[_0x5a3c28(0x1af)])return _0xa37899[_0x5a3c28(0x1af)];if(_0xa37899?.[_0x5a3c28(0x19c)]||_0xa37899?.[_0x5a3c28(0x18e)])return buildSqlRelativePath(_0x2bb1cc,_0xa37899?.[_0x5a3c28(0x19c)],_0xa37899?.[_0x5a3c28(0x18e)],resolveSqlMode(_0x54c787,_0xa37899),_0xa37899?.[_0x5a3c28(0x186)]);return buildDefaultSqlFileName(_0x2bb1cc,resolveSqlMode(_0x54c787,_0xa37899));}export function resolveSqlLocalDir(_0x168aaf,_0x2b9879){return join(_0x168aaf,SQL_LOCAL_REL_DIR,_0x2b9879);}export async function confirmForceOverwrite(_0x4c749f){const _0x48de0b=a192_0x36ea5a,_0x43ea8b=createInterface({'input':process['stdin'],'output':process[_0x48de0b(0x188)]}),_0x89a4b9=await new Promise(_0x461d82=>{const _0x73238c=_0x48de0b;_0x43ea8b[_0x73238c(0x1b0)](_0x4c749f+_0x73238c(0x1b2),_0x461d82);});return _0x43ea8b[_0x48de0b(0x19d)](),['y',_0x48de0b(0x184)]['includes'](_0x89a4b9[_0x48de0b(0x18d)]()[_0x48de0b(0x1ab)]());}export function findSqlLockScope(_0x16a062,_0x186754){const _0x43f65f=a192_0x36ea5a;return _0x16a062[_0x43f65f(0x1a5)][_0x186754];}function buildMetadataHeaderLines(_0x5bd070,_0x29d5f1){const _0x4897c5=a192_0x36ea5a,_0x22e9de=[[_0x4897c5(0x1a4),_0x5bd070['sqlCode']],[_0x4897c5(0x19c),_0x5bd070[_0x4897c5(0x19c)]],[_0x4897c5(0x186),_0x5bd070[_0x4897c5(0x186)]],[_0x4897c5(0x18e),_0x5bd070[_0x4897c5(0x18e)]],['mode',_0x5bd070[_0x4897c5(0x1a2)]],[_0x4897c5(0x191),_0x5bd070[_0x4897c5(0x191)]],[_0x4897c5(0x1a3),_0x5bd070[_0x4897c5(0x1a3)]]];if(_0x29d5f1===_0x4897c5(0x1ae))return _0x22e9de[_0x4897c5(0x1a7)](([,_0x18104a])=>_0x18104a!==undefined&&_0x18104a!==null&&String(_0x18104a)[_0x4897c5(0x18d)]()!=='')[_0x4897c5(0x18b)](([_0x4626b5,_0x21e520])=>_0x4897c5(0x187)+_0x4626b5+':\x20'+String(_0x21e520)+_0x4897c5(0x1b1));return _0x22e9de[_0x4897c5(0x1a7)](([,_0x129278])=>_0x129278!==undefined&&_0x129278!==null&&String(_0x129278)[_0x4897c5(0x18d)]()!=='')[_0x4897c5(0x18b)](([_0x40b2f6,_0x35d8d3])=>_0x4897c5(0x19f)+_0x40b2f6+':\x20'+String(_0x35d8d3));}
@@ -1 +1 @@
1
- const a193_0x1ca1c1=a193_0x5948;(function(_0x1de720,_0x1fee27){const _0x2c5df4=a193_0x5948,_0x2f242b=_0x1de720();while(!![]){try{const _0x1d4698=parseInt(_0x2c5df4(0xc9))/0x1*(-parseInt(_0x2c5df4(0xe3))/0x2)+-parseInt(_0x2c5df4(0xdf))/0x3*(-parseInt(_0x2c5df4(0xdd))/0x4)+parseInt(_0x2c5df4(0xc7))/0x5*(-parseInt(_0x2c5df4(0xe2))/0x6)+parseInt(_0x2c5df4(0xdb))/0x7+parseInt(_0x2c5df4(0xe5))/0x8+-parseInt(_0x2c5df4(0xca))/0x9*(-parseInt(_0x2c5df4(0xd0))/0xa)+-parseInt(_0x2c5df4(0xd6))/0xb;if(_0x1d4698===_0x1fee27)break;else _0x2f242b['push'](_0x2f242b['shift']());}catch(_0x243380){_0x2f242b['push'](_0x2f242b['shift']());}}}(a193_0x3ad7,0x4033f));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a193_0x5948(_0xc1bcde,_0x319c85){_0xc1bcde=_0xc1bcde-0xc2;const _0x3ad734=a193_0x3ad7();let _0x594801=_0x3ad734[_0xc1bcde];return _0x594801;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x1fa17c){const _0xf741d7=a193_0x5948,_0x4195bd=[];let _0x53d4f8=0x1;while(!![]){const _0x10f10b=await listSqlQueries(_0x1fa17c,{'currentPage':_0x53d4f8,'pageSize':PAGE_SIZE}),_0x383d71=_0x10f10b[_0xf741d7(0xd4)]??[];_0x4195bd[_0xf741d7(0xe6)](..._0x383d71[_0xf741d7(0xcc)](_0xdedd95=>_0xdedd95[_0xf741d7(0xc4)]));if(_0x383d71[_0xf741d7(0xe0)]===0x0)break;const _0x905e02=_0x10f10b[_0xf741d7(0xe1)]?.[_0xf741d7(0xc2)];if(_0x905e02!=null?_0x4195bd[_0xf741d7(0xe0)]>=_0x905e02:_0x383d71[_0xf741d7(0xe0)]<PAGE_SIZE)break;_0x53d4f8++;}return _0x4195bd;}function a193_0x3ad7(){const _0x4ed731=['8349440unKbbo','\x20missing,\x20','has','\x20added,\x20','lockKey','1306935uMmvra','\x20modified,\x20','3148fvbUnZ','lockFilePath','1770VckNBj','length','paging','12zOBhAW','804986HSdEmz','sqlRoot','2176616ZreOnk','push','totalCount','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','sqlCode','appCode','sqlName','34060eTftnJ','remote','1ZwhsVe','99WqAJoJ','All\x20SQL\x20queries\x20are\x20in\x20sync.','map','\x20remote-only','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','hash','468200jJMPzQ','status','sqls','filePath','tableData','boolean'];a193_0x3ad7=function(){return _0x4ed731;};return a193_0x3ad7();}export const sqlStatus={'service':'sql','command':'status','description':a193_0x1ca1c1(0xc3),'risk':'read','flags':[{'name':a193_0x1ca1c1(0xc8),'type':a193_0x1ca1c1(0xd5),'description':a193_0x1ca1c1(0xce)}],async 'execute'(_0x572a3e){const _0x32e47a=a193_0x1ca1c1,_0x5006a7=loadSqlProjectConfig(_0x572a3e[_0x32e47a(0xc5)]),_0x31439b=await readSqlLockFile(_0x5006a7[_0x32e47a(0xde)]),{appLock:_0x2d0a35}=ensureSqlLockScope(_0x31439b??createEmptySqlLock(),_0x5006a7[_0x32e47a(0xc5)],_0x5006a7[_0x32e47a(0xe4)],_0x32e47a(0xd1)),_0x52143e=await scanLocalSqlQueries(_0x5006a7),_0x329b89=[],_0x4bd31d=[],_0x6852a9=[],_0x388750=[],_0x2ad0e9=new Set(_0x52143e['map'](_0x22a77e=>_0x22a77e[_0x32e47a(0xda)]));for(const _0x4b78d4 of _0x52143e){const _0x26d34b=await computeSqlFileHash(_0x4b78d4[_0x32e47a(0xd3)]),_0x5d8977=_0x2d0a35[_0x32e47a(0xd2)][_0x4b78d4['lockKey']],_0x23ee04=!!_0x5d8977&&_0x5d8977['path']!==_0x4b78d4['relativePath'],_0x40d89d=!!_0x5d8977&&!!_0x4b78d4[_0x32e47a(0xc6)]&&_0x5d8977[_0x32e47a(0xc6)]!==_0x4b78d4[_0x32e47a(0xc6)];if(!_0x5d8977)_0x329b89[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);else _0x5d8977[_0x32e47a(0xcf)]!==_0x26d34b||_0x23ee04||_0x40d89d?_0x4bd31d[_0x32e47a(0xe6)](_0x4b78d4['lockKey']):_0x6852a9[_0x32e47a(0xe6)](_0x4b78d4[_0x32e47a(0xda)]);}for(const _0x5b193e of Object['keys'](_0x2d0a35['sqls'])){!_0x2ad0e9[_0x32e47a(0xd8)](_0x5b193e)&&_0x388750[_0x32e47a(0xe6)](_0x5b193e);}const _0x51d296=[];if(_0x572a3e['bool'](_0x32e47a(0xc8))){const _0x50d14b=await fetchAllSqlCodes(_0x572a3e[_0x32e47a(0xc5)]);for(const _0x51943b of _0x50d14b){!_0x2ad0e9[_0x32e47a(0xd8)](_0x51943b)&&!_0x2d0a35[_0x32e47a(0xd2)][_0x51943b]&&_0x51d296['push'](_0x51943b);}}const _0x283f7f=_0x329b89[_0x32e47a(0xe0)]===0x0&&_0x4bd31d[_0x32e47a(0xe0)]===0x0&&_0x388750[_0x32e47a(0xe0)]===0x0&&_0x51d296[_0x32e47a(0xe0)]===0x0;return{'ok':!![],'data':{'added':_0x329b89,'modified':_0x4bd31d,'missing':_0x388750,'unchanged':_0x6852a9,'remoteOnly':_0x51d296},'message':_0x283f7f?_0x32e47a(0xcb):_0x329b89[_0x32e47a(0xe0)]+_0x32e47a(0xd9)+_0x4bd31d[_0x32e47a(0xe0)]+_0x32e47a(0xdc)+_0x388750[_0x32e47a(0xe0)]+_0x32e47a(0xd7)+_0x6852a9['length']+'\x20unchanged'+(_0x51d296[_0x32e47a(0xe0)]>0x0?',\x20'+_0x51d296[_0x32e47a(0xe0)]+_0x32e47a(0xcd):'')};}};
1
+ const a193_0x2ab540=a193_0x4e29;function a193_0x4e29(_0x563a6a,_0x5115cd){_0x563a6a=_0x563a6a-0x14f;const _0x12419c=a193_0x1241();let _0x4e29a5=_0x12419c[_0x563a6a];return _0x4e29a5;}(function(_0x4447fd,_0x36410c){const _0x555c85=a193_0x4e29,_0x2c5b22=_0x4447fd();while(!![]){try{const _0x3e446a=-parseInt(_0x555c85(0x15f))/0x1*(-parseInt(_0x555c85(0x15d))/0x2)+-parseInt(_0x555c85(0x15e))/0x3+-parseInt(_0x555c85(0x16f))/0x4*(-parseInt(_0x555c85(0x16e))/0x5)+-parseInt(_0x555c85(0x169))/0x6+parseInt(_0x555c85(0x153))/0x7+parseInt(_0x555c85(0x16a))/0x8+-parseInt(_0x555c85(0x16b))/0x9;if(_0x3e446a===_0x36410c)break;else _0x2c5b22['push'](_0x2c5b22['shift']());}catch(_0x455cfd){_0x2c5b22['push'](_0x2c5b22['shift']());}}}(a193_0x1241,0x39742));import{listSqlQueries}from'../../core/api-client.js';function a193_0x1241(){const _0x182ff6=['remote','12055MaXdNw','4vUZOGV','hash','\x20unchanged','sqls','status','map','totalCount','appCode','boolean','\x20modified,\x20','3018974DAxyZU','paging','read','relativePath','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','All\x20SQL\x20queries\x20are\x20in\x20sync.','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','push','sqlRoot','lockFilePath','39486iFoqPy','1104711qOfEBR','1veAjnU','lockKey','\x20added,\x20','tableData','bool','path','has','keys','sqlName','length','155550nkQKib','3079280tekyHE','1879686kntUgU','sql'];a193_0x1241=function(){return _0x182ff6;};return a193_0x1241();}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(_0x304b0b){const _0x5ca650=a193_0x4e29,_0x464f43=[];let _0x17c02d=0x1;while(!![]){const _0x44035c=await listSqlQueries(_0x304b0b,{'currentPage':_0x17c02d,'pageSize':PAGE_SIZE}),_0x2da2f6=_0x44035c[_0x5ca650(0x162)]??[];_0x464f43[_0x5ca650(0x15a)](..._0x2da2f6[_0x5ca650(0x174)](_0x22438a=>_0x22438a['sqlCode']));if(_0x2da2f6[_0x5ca650(0x168)]===0x0)break;const _0x4c3a5c=_0x44035c[_0x5ca650(0x154)]?.[_0x5ca650(0x14f)];if(_0x4c3a5c!=null?_0x464f43[_0x5ca650(0x168)]>=_0x4c3a5c:_0x2da2f6[_0x5ca650(0x168)]<PAGE_SIZE)break;_0x17c02d++;}return _0x464f43;}export const sqlStatus={'service':a193_0x2ab540(0x16c),'command':a193_0x2ab540(0x173),'description':a193_0x2ab540(0x159),'risk':a193_0x2ab540(0x155),'flags':[{'name':a193_0x2ab540(0x16d),'type':a193_0x2ab540(0x151),'description':a193_0x2ab540(0x157)}],async 'execute'(_0x54134d){const _0x1bf4a6=a193_0x2ab540,_0x1714d9=loadSqlProjectConfig(_0x54134d[_0x1bf4a6(0x150)]),_0x3255d4=await readSqlLockFile(_0x1714d9[_0x1bf4a6(0x15c)]),{appLock:_0x352423}=ensureSqlLockScope(_0x3255d4??createEmptySqlLock(),_0x1714d9[_0x1bf4a6(0x150)],_0x1714d9[_0x1bf4a6(0x15b)],_0x1bf4a6(0x173)),_0x6babf3=await scanLocalSqlQueries(_0x1714d9),_0x23d21e=[],_0x2f147c=[],_0x294aac=[],_0xa49080=[],_0x133ce4=new Set(_0x6babf3[_0x1bf4a6(0x174)](_0x1a6023=>_0x1a6023[_0x1bf4a6(0x160)]));for(const _0x17d005 of _0x6babf3){const _0x1b100c=await computeSqlFileHash(_0x17d005['filePath']),_0x4992a4=_0x352423[_0x1bf4a6(0x172)][_0x17d005[_0x1bf4a6(0x160)]],_0x265da0=!!_0x4992a4&&_0x4992a4[_0x1bf4a6(0x164)]!==_0x17d005[_0x1bf4a6(0x156)],_0x4ea840=!!_0x4992a4&&!!_0x17d005['sqlName']&&_0x4992a4['sqlName']!==_0x17d005[_0x1bf4a6(0x167)];if(!_0x4992a4)_0x23d21e[_0x1bf4a6(0x15a)](_0x17d005['lockKey']);else _0x4992a4[_0x1bf4a6(0x170)]!==_0x1b100c||_0x265da0||_0x4ea840?_0x2f147c[_0x1bf4a6(0x15a)](_0x17d005['lockKey']):_0x294aac['push'](_0x17d005[_0x1bf4a6(0x160)]);}for(const _0x55dfd4 of Object[_0x1bf4a6(0x166)](_0x352423['sqls'])){!_0x133ce4[_0x1bf4a6(0x165)](_0x55dfd4)&&_0xa49080[_0x1bf4a6(0x15a)](_0x55dfd4);}const _0x26155c=[];if(_0x54134d[_0x1bf4a6(0x163)](_0x1bf4a6(0x16d))){const _0xe650fe=await fetchAllSqlCodes(_0x54134d[_0x1bf4a6(0x150)]);for(const _0x35180d of _0xe650fe){!_0x133ce4[_0x1bf4a6(0x165)](_0x35180d)&&!_0x352423[_0x1bf4a6(0x172)][_0x35180d]&&_0x26155c[_0x1bf4a6(0x15a)](_0x35180d);}}const _0x4fe258=_0x23d21e[_0x1bf4a6(0x168)]===0x0&&_0x2f147c['length']===0x0&&_0xa49080[_0x1bf4a6(0x168)]===0x0&&_0x26155c[_0x1bf4a6(0x168)]===0x0;return{'ok':!![],'data':{'added':_0x23d21e,'modified':_0x2f147c,'missing':_0xa49080,'unchanged':_0x294aac,'remoteOnly':_0x26155c},'message':_0x4fe258?_0x1bf4a6(0x158):_0x23d21e[_0x1bf4a6(0x168)]+_0x1bf4a6(0x161)+_0x2f147c[_0x1bf4a6(0x168)]+_0x1bf4a6(0x152)+_0xa49080[_0x1bf4a6(0x168)]+'\x20missing,\x20'+_0x294aac['length']+_0x1bf4a6(0x171)+(_0x26155c[_0x1bf4a6(0x168)]>0x0?',\x20'+_0x26155c['length']+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- const a194_0x2210d3=a194_0x1bd1;(function(_0x3da535,_0x2c6320){const _0x327c55=a194_0x1bd1,_0x30abd5=_0x3da535();while(!![]){try{const _0x355d29=parseInt(_0x327c55(0x148))/0x1+parseInt(_0x327c55(0x15c))/0x2+-parseInt(_0x327c55(0x167))/0x3+-parseInt(_0x327c55(0x14c))/0x4*(-parseInt(_0x327c55(0x159))/0x5)+parseInt(_0x327c55(0x152))/0x6*(-parseInt(_0x327c55(0x15b))/0x7)+parseInt(_0x327c55(0x15d))/0x8+parseInt(_0x327c55(0x144))/0x9*(-parseInt(_0x327c55(0x13e))/0xa);if(_0x355d29===_0x2c6320)break;else _0x30abd5['push'](_0x30abd5['shift']());}catch(_0x5d9ed5){_0x30abd5['push'](_0x30abd5['shift']());}}}(a194_0x26f8,0xca1b1));function a194_0x26f8(){const _0x30eb1a=['Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','flagMissing','push','Provide\x20--file\x20or\x20--sql','schema:','indexes','200eTfYhI','schemas','parameters','map','sqlType','pkField','120816eZDdye','Dataset\x20\x22','dbtableConfig','isArray','511478iDuuIy','indexName','index_name','bool','44alJtXc','file','length','trim','message','flatMap','56004KAcovk','filter','size','dataset','--check-indexes\x20requires\x20--schemas.','tables','\x22\x20not\x20found\x20or\x20not\x20accessible','207300eiSnPr','index_columns','483QpDORH','1321746CFFDTb','10684056pvFzVV','Table\x20\x22','tableName','columns','string','index_type','utf-8','get','str','split','3670701VUStwV','read','unshift','reason','check-indexes','columnNames','type','isSelectOnly','toLowerCase','find','schemaWarnings','SQL\x20schema\x20validation','valid','File\x20not\x20found:\x20','isDangerous','validation','sql','name','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','joinAudit','fields'];a194_0x26f8=function(){return _0x30eb1a;};return a194_0x26f8();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a194_0x1bd1(_0x4a5ec5,_0x58ad2f){_0x4a5ec5=_0x4a5ec5-0x122;const _0x26f8fc=a194_0x26f8();let _0x1bd13b=_0x26f8fc[_0x4a5ec5];return _0x1bd13b;}import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x2210d3(0x130),'command':a194_0x2210d3(0x134),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':a194_0x2210d3(0x168),'flags':[{'name':a194_0x2210d3(0x14d),'type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x132)},{'name':'sql','type':a194_0x2210d3(0x161),'description':a194_0x2210d3(0x138)},{'name':a194_0x2210d3(0x13f),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a194_0x2210d3(0x124),'type':'boolean','description':a194_0x2210d3(0x137)}],async 'execute'(_0x24e13a){const _0x21a004=a194_0x2210d3,_0x2cce8c=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x14d)),_0x423faa=_0x24e13a[_0x21a004(0x165)](_0x21a004(0x130)),_0xd97136=_0x24e13a['str'](_0x21a004(0x13f)),_0x1bddad=_0x24e13a[_0x21a004(0x14b)](_0x21a004(0x124));if(!_0x2cce8c&&!_0x423faa)throw CliErrors[_0x21a004(0x139)]('file',_0x21a004(0x13b));if(_0x1bddad&&!_0xd97136)throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x156));let _0x414de5;if(_0x2cce8c){const _0x5aacdf=resolve(process['cwd'](),_0x2cce8c);if(!existsSync(_0x5aacdf))throw CliErrors[_0x21a004(0x12f)](_0x21a004(0x12d)+_0x5aacdf);_0x414de5=readFileSync(_0x5aacdf,_0x21a004(0x163));}else _0x414de5=_0x423faa;const _0xe873e6=validateSql(_0x414de5),_0x2fe89d={'valid':_0xe873e6[_0x21a004(0x12c)],'sqlType':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x126)],'isSelectOnly':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x127)],'isDangerous':_0xe873e6[_0x21a004(0x142)][_0x21a004(0x12e)],'tables':_0xe873e6['tables'],'parameters':_0xe873e6[_0x21a004(0x140)],'message':_0xe873e6['message']};_0xe873e6[_0x21a004(0x142)]['reason']&&(_0x2fe89d[_0x21a004(0x123)]=_0xe873e6[_0x21a004(0x142)]['reason']);if(_0xd97136&&_0xe873e6[_0x21a004(0x12c)]){const _0x2e3b34=_0xd97136[_0x21a004(0x166)](',')[_0x21a004(0x141)](_0x13a5dd=>_0x13a5dd[_0x21a004(0x14f)]())[_0x21a004(0x153)](Boolean),_0x495e39=[],_0x507d45=[],_0x2f3b2a=filterDbTableBackedDatasets(await listDatasets(_0x24e13a['appCode'])),_0x52e2a3=new Map(_0x2f3b2a[_0x21a004(0x141)](_0x3ff41e=>[_0x3ff41e['dbtableConfig']?.[_0x21a004(0x15f)]?.[_0x21a004(0x128)](),_0x3ff41e]));for(const _0xa38bb8 of _0xe873e6[_0x21a004(0x157)]){const _0x4be4f1=_0x52e2a3[_0x21a004(0x164)](_0xa38bb8['toLowerCase']());!_0x4be4f1&&_0x495e39[_0x21a004(0x13a)](_0x21a004(0x15e)+_0xa38bb8+_0x21a004(0x133));}for(const _0x2c220e of _0x2e3b34){let _0x52262b;try{_0x52262b=await getDatasetDetail(_0x2c220e);}catch{_0x495e39[_0x21a004(0x13a)](_0x21a004(0x145)+_0x2c220e+_0x21a004(0x158));continue;}assertDatasetIsDbTableBacked(_0x52262b,_0x21a004(0x12b));const _0x54092d=Array[_0x21a004(0x147)](_0x52262b[_0x21a004(0x136)])?_0x52262b[_0x21a004(0x136)]:[],_0x3ab62d=new Set(_0x54092d[_0x21a004(0x141)](_0x3fb517=>_0x3fb517[_0x21a004(0x131)]?.[_0x21a004(0x128)]())),_0x10c826=_0x52262b[_0x21a004(0x146)]?.[_0x21a004(0x15f)]||_0x52262b[_0x21a004(0x15f)]||_0x2c220e;_0x2fe89d[_0x21a004(0x13c)+_0x10c826]={'code':_0x2c220e,'tableName':_0x10c826,'fieldCount':_0x3ab62d[_0x21a004(0x154)],'fields':Array['from'](_0x3ab62d)};if(_0x1bddad){const _0x4b0786=normalizeDatasetIndexes(_0x52262b);_0x507d45['push']({'tableName':_0x10c826,..._0x4b0786});}}_0x495e39[_0x21a004(0x14e)]>0x0&&(_0x2fe89d[_0x21a004(0x12a)]=_0x495e39),_0x1bddad&&(_0x2fe89d[_0x21a004(0x135)]=auditSqlJoinIndexes(_0x414de5,_0x507d45));}return{'ok':_0xe873e6[_0x21a004(0x12c)],'data':_0x2fe89d,'message':_0xe873e6[_0x21a004(0x150)]};}};function normalizeDatasetIndexes(_0x2c0363){const _0x514712=a194_0x2210d3,_0x1311c7=Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x155)]?.['indexes'])?_0x2c0363[_0x514712(0x155)]['indexes']:Array[_0x514712(0x147)](_0x2c0363?.[_0x514712(0x13d)])?_0x2c0363[_0x514712(0x13d)]:[],_0x219889=_0x1311c7[_0x514712(0x151)](_0x188842=>{const _0x5e9d99=_0x514712,_0x2b8daa=Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x15a)])?_0x188842[_0x5e9d99(0x15a)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x125)])?_0x188842[_0x5e9d99(0x125)]:Array[_0x5e9d99(0x147)](_0x188842?.[_0x5e9d99(0x160)])?_0x188842[_0x5e9d99(0x160)]:[],_0xa97569=_0x2b8daa[_0x5e9d99(0x153)](_0x4b0335=>typeof _0x4b0335===_0x5e9d99(0x161))[_0x5e9d99(0x141)](_0x37e4df=>_0x37e4df[_0x5e9d99(0x14f)]())[_0x5e9d99(0x153)](Boolean);if(_0xa97569[_0x5e9d99(0x14e)]===0x0)return[];const _0xc766e=[_0x188842?.[_0x5e9d99(0x149)],_0x188842?.[_0x5e9d99(0x14a)],_0x188842?.[_0x5e9d99(0x131)]][_0x5e9d99(0x129)](_0x4d5ec1=>typeof _0x4d5ec1===_0x5e9d99(0x161)&&_0x4d5ec1[_0x5e9d99(0x14f)]()),_0x16549a=[_0x188842?.[_0x5e9d99(0x162)],_0x188842?.[_0x5e9d99(0x126)]][_0x5e9d99(0x129)](_0x1484d7=>typeof _0x1484d7===_0x5e9d99(0x161)&&_0x1484d7[_0x5e9d99(0x14f)]());return[{..._0xc766e?{'name':_0xc766e[_0x5e9d99(0x14f)]()}:{},..._0x16549a?{'type':_0x16549a[_0x5e9d99(0x14f)]()}:{},'columns':_0xa97569}];}),_0x22dcdb=[..._0x219889],_0x177374=typeof _0x2c0363?.[_0x514712(0x146)]?.[_0x514712(0x143)]===_0x514712(0x161)?_0x2c0363[_0x514712(0x146)]['pkField']['split'](',')[_0x514712(0x141)](_0xa97ca6=>_0xa97ca6[_0x514712(0x14f)]())[_0x514712(0x153)](Boolean):[];return _0x177374['length']>0x0&&_0x22dcdb[_0x514712(0x122)]({'type':'primary','columns':_0x177374}),{'indexes':_0x22dcdb,'metadataAvailable':_0x219889[_0x514712(0x14e)]>0x0};}
1
+ function a194_0x4128(_0x324404,_0x40e5de){_0x324404=_0x324404-0x19b;const _0x519162=a194_0x5191();let _0x412885=_0x519162[_0x324404];return _0x412885;}const a194_0x222ff7=a194_0x4128;(function(_0x3a2160,_0x3b0259){const _0x26fbee=a194_0x4128,_0x8cb894=_0x3a2160();while(!![]){try{const _0x1992a4=-parseInt(_0x26fbee(0x1c0))/0x1+-parseInt(_0x26fbee(0x1ae))/0x2+-parseInt(_0x26fbee(0x1ce))/0x3+parseInt(_0x26fbee(0x1cd))/0x4+-parseInt(_0x26fbee(0x1a5))/0x5+parseInt(_0x26fbee(0x19b))/0x6*(parseInt(_0x26fbee(0x1b9))/0x7)+parseInt(_0x26fbee(0x1b2))/0x8*(parseInt(_0x26fbee(0x1bb))/0x9);if(_0x1992a4===_0x3b0259)break;else _0x8cb894['push'](_0x8cb894['shift']());}catch(_0x437a79){_0x8cb894['push'](_0x8cb894['shift']());}}}(a194_0x5191,0xa1a23));import{readFileSync,existsSync}from'node:fs';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';import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a194_0x222ff7(0x1b0),'command':a194_0x222ff7(0x1d0),'description':a194_0x222ff7(0x19d),'risk':'read','flags':[{'name':a194_0x222ff7(0x1d4),'type':a194_0x222ff7(0x1aa),'description':a194_0x222ff7(0x1db)},{'name':a194_0x222ff7(0x1b0),'type':a194_0x222ff7(0x1aa),'description':a194_0x222ff7(0x1ca)},{'name':a194_0x222ff7(0x1ad),'type':'string','description':a194_0x222ff7(0x1d5)},{'name':a194_0x222ff7(0x1a4),'type':'boolean','description':'Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata'}],async 'execute'(_0x504d06){const _0x15598e=a194_0x222ff7,_0x131470=_0x504d06[_0x15598e(0x1b6)](_0x15598e(0x1d4)),_0x4a5375=_0x504d06[_0x15598e(0x1b6)](_0x15598e(0x1b0)),_0xf43f0a=_0x504d06['str'](_0x15598e(0x1ad)),_0x50888f=_0x504d06[_0x15598e(0x1c2)](_0x15598e(0x1a4));if(!_0x131470&&!_0x4a5375)throw CliErrors[_0x15598e(0x1c7)]('file',_0x15598e(0x1a3));if(_0x50888f&&!_0xf43f0a)throw CliErrors[_0x15598e(0x1c9)](_0x15598e(0x1b3));let _0x103431;if(_0x131470){const _0x4f6d08=resolve(process[_0x15598e(0x1d1)](),_0x131470);if(!existsSync(_0x4f6d08))throw CliErrors[_0x15598e(0x1c9)](_0x15598e(0x1ac)+_0x4f6d08);_0x103431=readFileSync(_0x4f6d08,'utf-8');}else _0x103431=_0x4a5375;const _0x1158ab=validateSql(_0x103431),_0x27f83f={'valid':_0x1158ab[_0x15598e(0x1d6)],'sqlType':_0x1158ab[_0x15598e(0x1ba)][_0x15598e(0x1bd)],'isSelectOnly':_0x1158ab['sqlType'][_0x15598e(0x1b1)],'isDangerous':_0x1158ab[_0x15598e(0x1ba)][_0x15598e(0x1cf)],'tables':_0x1158ab[_0x15598e(0x1b8)],'parameters':_0x1158ab[_0x15598e(0x1af)],'message':_0x1158ab[_0x15598e(0x1b4)]};_0x1158ab[_0x15598e(0x1ba)][_0x15598e(0x1dc)]&&(_0x27f83f[_0x15598e(0x1dc)]=_0x1158ab['sqlType']['reason']);if(_0xf43f0a&&_0x1158ab[_0x15598e(0x1d6)]){const _0x41b9ac=_0xf43f0a[_0x15598e(0x1cc)](',')['map'](_0x1769aa=>_0x1769aa['trim']())[_0x15598e(0x1c6)](Boolean),_0x4d806e=[],_0xcc8418=[],_0xdd973e=filterDbTableBackedDatasets(await listDatasets(_0x504d06[_0x15598e(0x19c)])),_0x32c000=new Map(_0xdd973e[_0x15598e(0x1d9)](_0x210e9e=>[_0x210e9e[_0x15598e(0x1bf)]?.[_0x15598e(0x1bc)]?.[_0x15598e(0x1d2)](),_0x210e9e]));for(const _0x3fcea4 of _0x1158ab[_0x15598e(0x1b8)]){const _0x49572b=_0x32c000['get'](_0x3fcea4[_0x15598e(0x1d2)]());!_0x49572b&&_0x4d806e[_0x15598e(0x1a2)](_0x15598e(0x1a1)+_0x3fcea4+_0x15598e(0x1ab));}for(const _0x26c0d3 of _0x41b9ac){let _0x43fa36;try{_0x43fa36=await getDatasetDetail(_0x26c0d3);}catch{_0x4d806e[_0x15598e(0x1a2)](_0x15598e(0x1a9)+_0x26c0d3+_0x15598e(0x1cb));continue;}assertDatasetIsDbTableBacked(_0x43fa36,_0x15598e(0x1be));const _0xb9f2e0=Array['isArray'](_0x43fa36['fields'])?_0x43fa36[_0x15598e(0x1c1)]:[],_0x3f9442=new Set(_0xb9f2e0[_0x15598e(0x1d9)](_0x59d25f=>_0x59d25f[_0x15598e(0x19e)]?.[_0x15598e(0x1d2)]())),_0x17c432=_0x43fa36[_0x15598e(0x1bf)]?.[_0x15598e(0x1bc)]||_0x43fa36[_0x15598e(0x1bc)]||_0x26c0d3;_0x27f83f[_0x15598e(0x1c8)+_0x17c432]={'code':_0x26c0d3,'tableName':_0x17c432,'fieldCount':_0x3f9442[_0x15598e(0x1d8)],'fields':Array['from'](_0x3f9442)};if(_0x50888f){const _0x2de434=normalizeDatasetIndexes(_0x43fa36);_0xcc8418[_0x15598e(0x1a2)]({'tableName':_0x17c432,..._0x2de434});}}_0x4d806e[_0x15598e(0x1da)]>0x0&&(_0x27f83f['schemaWarnings']=_0x4d806e),_0x50888f&&(_0x27f83f[_0x15598e(0x1d3)]=auditSqlJoinIndexes(_0x103431,_0xcc8418));}return{'ok':_0x1158ab[_0x15598e(0x1d6)],'data':_0x27f83f,'message':_0x1158ab['message']};}};function a194_0x5191(){const _0x877513=['message','index_type','str','find','tables','997773GVnoMG','sqlType','11715093QUMEnm','tableName','type','SQL\x20schema\x20validation','dbtableConfig','487856VGZzYR','fields','bool','index_columns','columns','columnNames','filter','flagMissing','schema:','validation','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','\x22\x20not\x20found\x20or\x20not\x20accessible','split','3210296JVpNOO','1566942tnMnJx','isDangerous','validate','cwd','toLowerCase','joinAudit','file','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','valid','isArray','size','map','length','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','reason','48JxypXt','appCode','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','name','indexName','dataset','Table\x20\x22','push','Provide\x20--file\x20or\x20--sql','check-indexes','5129920SXEFsq','indexes','trim','pkField','Dataset\x20\x22','string','\x22\x20not\x20found\x20in\x20any\x20dataset','File\x20not\x20found:\x20','schemas','1092716hBatov','parameters','sql','isSelectOnly','8SjUIYq','--check-indexes\x20requires\x20--schemas.'];a194_0x5191=function(){return _0x877513;};return a194_0x5191();}function normalizeDatasetIndexes(_0x2ba488){const _0x5e025a=a194_0x222ff7,_0x4869bd=Array[_0x5e025a(0x1d7)](_0x2ba488?.[_0x5e025a(0x1a0)]?.[_0x5e025a(0x1a6)])?_0x2ba488['dataset']['indexes']:Array[_0x5e025a(0x1d7)](_0x2ba488?.[_0x5e025a(0x1a6)])?_0x2ba488[_0x5e025a(0x1a6)]:[],_0x1b384e=_0x4869bd['flatMap'](_0x1cf346=>{const _0x36c193=_0x5e025a,_0x35226d=Array['isArray'](_0x1cf346?.[_0x36c193(0x1c3)])?_0x1cf346[_0x36c193(0x1c3)]:Array[_0x36c193(0x1d7)](_0x1cf346?.[_0x36c193(0x1c5)])?_0x1cf346[_0x36c193(0x1c5)]:Array[_0x36c193(0x1d7)](_0x1cf346?.[_0x36c193(0x1c4)])?_0x1cf346[_0x36c193(0x1c4)]:[],_0x3a042c=_0x35226d['filter'](_0x19b47a=>typeof _0x19b47a===_0x36c193(0x1aa))[_0x36c193(0x1d9)](_0x1c0ce7=>_0x1c0ce7[_0x36c193(0x1a7)]())[_0x36c193(0x1c6)](Boolean);if(_0x3a042c['length']===0x0)return[];const _0x379147=[_0x1cf346?.[_0x36c193(0x19f)],_0x1cf346?.['index_name'],_0x1cf346?.[_0x36c193(0x19e)]][_0x36c193(0x1b7)](_0x5dc7eb=>typeof _0x5dc7eb===_0x36c193(0x1aa)&&_0x5dc7eb[_0x36c193(0x1a7)]()),_0x2bab9a=[_0x1cf346?.[_0x36c193(0x1b5)],_0x1cf346?.['type']][_0x36c193(0x1b7)](_0x4f7dad=>typeof _0x4f7dad===_0x36c193(0x1aa)&&_0x4f7dad[_0x36c193(0x1a7)]());return[{..._0x379147?{'name':_0x379147[_0x36c193(0x1a7)]()}:{},..._0x2bab9a?{'type':_0x2bab9a[_0x36c193(0x1a7)]()}:{},'columns':_0x3a042c}];}),_0xf688f8=[..._0x1b384e],_0x123087=typeof _0x2ba488?.[_0x5e025a(0x1bf)]?.[_0x5e025a(0x1a8)]===_0x5e025a(0x1aa)?_0x2ba488[_0x5e025a(0x1bf)][_0x5e025a(0x1a8)][_0x5e025a(0x1cc)](',')['map'](_0x38997f=>_0x38997f['trim']())[_0x5e025a(0x1c6)](Boolean):[];return _0x123087[_0x5e025a(0x1da)]>0x0&&_0xf688f8['unshift']({'type':'primary','columns':_0x123087}),{'indexes':_0xf688f8,'metadataAvailable':_0x1b384e[_0x5e025a(0x1da)]>0x0};}
@@ -1 +1 @@
1
- (function(_0x1e21f,_0x59c3de){const _0x43b2b2=a195_0x8a3c,_0x4ddab5=_0x1e21f();while(!![]){try{const _0x1b61ba=parseInt(_0x43b2b2(0x73))/0x1+parseInt(_0x43b2b2(0x72))/0x2+parseInt(_0x43b2b2(0x70))/0x3*(-parseInt(_0x43b2b2(0x6d))/0x4)+parseInt(_0x43b2b2(0x77))/0x5*(parseInt(_0x43b2b2(0x6f))/0x6)+-parseInt(_0x43b2b2(0x71))/0x7*(parseInt(_0x43b2b2(0x6e))/0x8)+parseInt(_0x43b2b2(0x74))/0x9+parseInt(_0x43b2b2(0x76))/0xa*(-parseInt(_0x43b2b2(0x75))/0xb);if(_0x1b61ba===_0x59c3de)break;else _0x4ddab5['push'](_0x4ddab5['shift']());}catch(_0x22c96){_0x4ddab5['push'](_0x4ddab5['shift']());}}}(a195_0x1a09,0x8abd7));function a195_0x8a3c(_0x424fc7,_0x1fd3d6){_0x424fc7=_0x424fc7-0x6d;const _0x1a09a4=a195_0x1a09();let _0x8a3cf0=_0x1a09a4[_0x424fc7];return _0x8a3cf0;}import{taskStatus}from'../../commands/task/status.js';function a195_0x1a09(){const _0x3ddd42=['349665XCBEgB','67020ibmiyY','59704WpmSBG','36hcrcNe','81rPCOpB','511oAXbwE','735144oIPAXM','946770hRHtaO','933561hwrCEv','2994266kAXYvs','10fvMbnr'];a195_0x1a09=function(){return _0x3ddd42;};return a195_0x1a09();}export const taskDefinitions=[taskStatus];
1
+ (function(_0x6cbb27,_0x1c897f){const _0x5979c7=a195_0x401e,_0x922cbe=_0x6cbb27();while(!![]){try{const _0x7695ce=parseInt(_0x5979c7(0x1f5))/0x1+-parseInt(_0x5979c7(0x1f0))/0x2+-parseInt(_0x5979c7(0x1f4))/0x3+-parseInt(_0x5979c7(0x1ef))/0x4+parseInt(_0x5979c7(0x1f1))/0x5+-parseInt(_0x5979c7(0x1f3))/0x6+parseInt(_0x5979c7(0x1f2))/0x7;if(_0x7695ce===_0x1c897f)break;else _0x922cbe['push'](_0x922cbe['shift']());}catch(_0x429246){_0x922cbe['push'](_0x922cbe['shift']());}}}(a195_0x2f35,0xcdd49));import{taskStatus}from'../../commands/task/status.js';function a195_0x401e(_0x1946d8,_0x310885){_0x1946d8=_0x1946d8-0x1ef;const _0x2f35f5=a195_0x2f35();let _0x401edd=_0x2f35f5[_0x1946d8];return _0x401edd;}export const taskDefinitions=[taskStatus];function a195_0x2f35(){const _0x32845e=['1074058BXPXWm','1646364ZZjIqM','1181190DrptVO','5377605cUUFEB','8524537OGrZxT','424158KCXMZv','4354230EkqiUR'];a195_0x2f35=function(){return _0x32845e;};return a195_0x2f35();}
@@ -1 +1 @@
1
- const a196_0x22e1b5=a196_0x32c8;(function(_0x1ab464,_0x3b1efb){const _0x2fbde0=a196_0x32c8,_0x913d06=_0x1ab464();while(!![]){try{const _0x124ba7=-parseInt(_0x2fbde0(0x69))/0x1*(-parseInt(_0x2fbde0(0x6d))/0x2)+parseInt(_0x2fbde0(0x6a))/0x3*(-parseInt(_0x2fbde0(0x80))/0x4)+-parseInt(_0x2fbde0(0x82))/0x5+-parseInt(_0x2fbde0(0x7c))/0x6+-parseInt(_0x2fbde0(0x72))/0x7*(-parseInt(_0x2fbde0(0x79))/0x8)+-parseInt(_0x2fbde0(0x78))/0x9*(parseInt(_0x2fbde0(0x70))/0xa)+parseInt(_0x2fbde0(0x7d))/0xb;if(_0x124ba7===_0x3b1efb)break;else _0x913d06['push'](_0x913d06['shift']());}catch(_0x5a81f9){_0x913d06['push'](_0x913d06['shift']());}}}(a196_0x2ecb,0xdcd0e));function a196_0x2ecb(){const _0x4c1a3d=['4736EPAwYL','compress','str','1375590toRKRg','9735935sWgQnj','taskId','flagMissing','48mRdbSO','trim','5709770goWBCO','29IbPDAc','37980lQLndP','appCode','string','16478MjBcHh','status','task','2184470wewduU','cookie','17997chEOge','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','task-id','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','9AyLLqI'];a196_0x2ecb=function(){return _0x4c1a3d;};return a196_0x2ecb();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';function a196_0x32c8(_0x446ac1,_0x36dd75){_0x446ac1=_0x446ac1-0x69;const _0x2ecb53=a196_0x2ecb();let _0x32c871=_0x2ecb53[_0x446ac1];return _0x32c871;}import{CliErrors}from'../../errors.js';export const taskStatus={'service':a196_0x22e1b5(0x6f),'command':a196_0x22e1b5(0x6e),'description':a196_0x22e1b5(0x74),'risk':'read','defaultOutputFormat':a196_0x22e1b5(0x7a),'structuredErrors':!![],'flags':[{'name':a196_0x22e1b5(0x75),'type':a196_0x22e1b5(0x6c),'required':!![],'description':a196_0x22e1b5(0x77)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x103675){const _0x4bec0a=a196_0x22e1b5;if(!_0x103675[_0x4bec0a(0x7b)](_0x4bec0a(0x75))[_0x4bec0a(0x81)]())throw CliErrors[_0x4bec0a(0x7f)]('task-id');},async 'execute'(_0x5cd387){const _0x25f45d=a196_0x22e1b5,_0x290cf2=_0x5cd387[_0x25f45d(0x7b)]('task-id')[_0x25f45d(0x81)](),_0x53fc7e=normalizeAsyncTask(await getAsyncTaskStatus(_0x290cf2,_0x5cd387['appCode'],_0x5cd387[_0x25f45d(0x71)]));if(_0x53fc7e[_0x25f45d(0x7e)]!==_0x290cf2)throw CliErrors[_0x25f45d(0x76)](_0x25f45d(0x73)+_0x290cf2+',\x20received\x20'+_0x53fc7e[_0x25f45d(0x7e)]+'.');const _0x3c111f=buildAsyncTaskStatusCommand(_0x53fc7e[_0x25f45d(0x7e)],_0x5cd387[_0x25f45d(0x6b)]);return{'ok':!![],'message':asyncTaskMessage(_0x53fc7e),'data':{'appCode':_0x5cd387[_0x25f45d(0x6b)],..._0x53fc7e,'query':_0x53fc7e['isTerminal']?null:{'command':_0x3c111f}}};}};
1
+ const a196_0x15b163=a196_0x1404;(function(_0x16b4bb,_0x5e8bfb){const _0x3c06d9=a196_0x1404,_0x4fb1d1=_0x16b4bb();while(!![]){try{const _0x2096fa=-parseInt(_0x3c06d9(0x7e))/0x1*(-parseInt(_0x3c06d9(0x85))/0x2)+-parseInt(_0x3c06d9(0x76))/0x3*(-parseInt(_0x3c06d9(0x75))/0x4)+-parseInt(_0x3c06d9(0x74))/0x5*(-parseInt(_0x3c06d9(0x83))/0x6)+-parseInt(_0x3c06d9(0x73))/0x7*(parseInt(_0x3c06d9(0x7f))/0x8)+parseInt(_0x3c06d9(0x87))/0x9*(-parseInt(_0x3c06d9(0x7c))/0xa)+-parseInt(_0x3c06d9(0x8a))/0xb*(-parseInt(_0x3c06d9(0x82))/0xc)+-parseInt(_0x3c06d9(0x8c))/0xd*(-parseInt(_0x3c06d9(0x7b))/0xe);if(_0x2096fa===_0x5e8bfb)break;else _0x4fb1d1['push'](_0x4fb1d1['shift']());}catch(_0x182cb0){_0x4fb1d1['push'](_0x4fb1d1['shift']());}}}(a196_0x376e,0xedee9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a196_0x1404(_0x353932,_0x58044c){_0x353932=_0x353932-0x72;const _0x376efa=a196_0x376e();let _0x14043a=_0x376efa[_0x353932];return _0x14043a;}import{asyncTaskMessage,buildAsyncTaskStatusCommand,normalizeAsyncTask}from'../../commands/common/async-task.js';import{getAsyncTaskStatus}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a196_0x376e(){const _0x3b2c40=['18yyFvls','task','string','task-id','compress','3494470rsUJEx','3530QhtwUB','str','1093426KEDemG','13825592dCspgE','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','isTerminal','12dTpVff','2790trHwwb','appCode','2BPiEnK','trim','49500CetrTG',',\x20received\x20','taskId','677039MLhyPP','cookie','91olCMil','apiError','7Qthvrq','11520JyGrPy','447132uOoafS'];a196_0x376e=function(){return _0x3b2c40;};return a196_0x376e();}export const taskStatus={'service':a196_0x15b163(0x77),'command':'status','description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':'read','defaultOutputFormat':a196_0x15b163(0x7a),'structuredErrors':!![],'flags':[{'name':a196_0x15b163(0x79),'type':a196_0x15b163(0x78),'required':!![],'description':a196_0x15b163(0x80)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1da9d1){const _0x5258aa=a196_0x15b163;if(!_0x1da9d1[_0x5258aa(0x7d)](_0x5258aa(0x79))[_0x5258aa(0x86)]())throw CliErrors['flagMissing']('task-id');},async 'execute'(_0x132a97){const _0x1dc987=a196_0x15b163,_0x1d74bc=_0x132a97[_0x1dc987(0x7d)]('task-id')['trim'](),_0x5d9c37=normalizeAsyncTask(await getAsyncTaskStatus(_0x1d74bc,_0x132a97[_0x1dc987(0x84)],_0x132a97[_0x1dc987(0x8b)]));if(_0x5d9c37[_0x1dc987(0x89)]!==_0x1d74bc)throw CliErrors[_0x1dc987(0x72)]('Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20'+_0x1d74bc+_0x1dc987(0x88)+_0x5d9c37[_0x1dc987(0x89)]+'.');const _0x32e306=buildAsyncTaskStatusCommand(_0x5d9c37[_0x1dc987(0x89)],_0x132a97[_0x1dc987(0x84)]);return{'ok':!![],'message':asyncTaskMessage(_0x5d9c37),'data':{'appCode':_0x132a97[_0x1dc987(0x84)],..._0x5d9c37,'query':_0x5d9c37[_0x1dc987(0x81)]?null:{'command':_0x32e306}}};}};
@@ -1 +1 @@
1
- (function(_0xef08e2,_0xb371d4){const _0x339465=a197_0x32dc,_0x2b39c0=_0xef08e2();while(!![]){try{const _0x22f13e=parseInt(_0x339465(0xa8))/0x1+-parseInt(_0x339465(0xad))/0x2+-parseInt(_0x339465(0xac))/0x3+-parseInt(_0x339465(0xae))/0x4+-parseInt(_0x339465(0xaa))/0x5*(-parseInt(_0x339465(0xa9))/0x6)+-parseInt(_0x339465(0xab))/0x7+parseInt(_0x339465(0xa7))/0x8;if(_0x22f13e===_0xb371d4)break;else _0x2b39c0['push'](_0x2b39c0['shift']());}catch(_0x35942b){_0x2b39c0['push'](_0x2b39c0['shift']());}}}(a197_0x2f8b,0xa19ab));function a197_0x2f8b(){const _0x5d919b=['5280788SHLRwa','16083816lDladh','953438DAepve','48vKACdL','590980pHorlf','8379707BMYiPO','308607mxAHlS','1254770UBDMoT'];a197_0x2f8b=function(){return _0x5d919b;};return a197_0x2f8b();}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x32dc(_0x974d8d,_0x32699d){_0x974d8d=_0x974d8d-0xa7;const _0x2f8b72=a197_0x2f8b();let _0x32dc6d=_0x2f8b72[_0x974d8d];return _0x32dc6d;}export const tenantDefinitions=[tenantMembersListDefinition];
1
+ (function(_0x159405,_0x431d3e){const _0x42efc2=a197_0x584b,_0xf16590=_0x159405();while(!![]){try{const _0x597404=-parseInt(_0x42efc2(0xea))/0x1*(-parseInt(_0x42efc2(0xe9))/0x2)+-parseInt(_0x42efc2(0xeb))/0x3+parseInt(_0x42efc2(0xec))/0x4+parseInt(_0x42efc2(0xe8))/0x5*(parseInt(_0x42efc2(0xed))/0x6)+-parseInt(_0x42efc2(0xe5))/0x7+parseInt(_0x42efc2(0xef))/0x8*(parseInt(_0x42efc2(0xee))/0x9)+parseInt(_0x42efc2(0xe7))/0xa*(-parseInt(_0x42efc2(0xe6))/0xb);if(_0x597404===_0x431d3e)break;else _0xf16590['push'](_0xf16590['shift']());}catch(_0x3e58c3){_0xf16590['push'](_0xf16590['shift']());}}}(a197_0x44f3,0xb8467));function a197_0x584b(_0x6a5cd,_0x65a430){_0x6a5cd=_0x6a5cd-0xe5;const _0x44f359=a197_0x44f3();let _0x584b80=_0x44f359[_0x6a5cd];return _0x584b80;}import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';function a197_0x44f3(){const _0x19cdd9=['231JZrAuK','1488680YznJXK','862490KftfIz','127954gwTLnM','23BVUMdu','281376YuFHZg','5848752gHfBHv','30KPljGd','9864VgDjLB','7960jDmsXM','6383006DLjApQ'];a197_0x44f3=function(){return _0x19cdd9;};return a197_0x44f3();}export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- function a198_0x52fe(_0x162a6f,_0x233aec){_0x162a6f=_0x162a6f-0x1b1;const _0x5a287d=a198_0x5a28();let _0x52fe2c=_0x5a287d[_0x162a6f];return _0x52fe2c;}const a198_0x2754b2=a198_0x52fe;(function(_0x19a6a6,_0x2a10dc){const _0x5731e7=a198_0x52fe,_0x2992a1=_0x19a6a6();while(!![]){try{const _0x36cfae=parseInt(_0x5731e7(0x1b2))/0x1*(-parseInt(_0x5731e7(0x1b6))/0x2)+-parseInt(_0x5731e7(0x1b7))/0x3+parseInt(_0x5731e7(0x1be))/0x4*(-parseInt(_0x5731e7(0x1bd))/0x5)+-parseInt(_0x5731e7(0x1b9))/0x6+-parseInt(_0x5731e7(0x1c1))/0x7*(-parseInt(_0x5731e7(0x1c6))/0x8)+parseInt(_0x5731e7(0x1bf))/0x9*(-parseInt(_0x5731e7(0x1c5))/0xa)+parseInt(_0x5731e7(0x1b1))/0xb;if(_0x36cfae===_0x2a10dc)break;else _0x2992a1['push'](_0x2992a1['shift']());}catch(_0x209355){_0x2992a1['push'](_0x2992a1['shift']());}}}(a198_0x5a28,0xeb510));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a198_0x2754b2(0x1b3),'command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':'read','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x2754b2(0x1c2),'type':a198_0x2754b2(0x1c4),'required':!![],'description':a198_0x2754b2(0x1c0)}],async 'validate'(_0x435cce){const _0xa28176=a198_0x2754b2;if(!_0x435cce[_0xa28176(0x1b5)](_0xa28176(0x1c2))['trim']())throw CliErrors[_0xa28176(0x1bb)](_0xa28176(0x1c2),_0xa28176(0x1b8));},async 'execute'(_0x18b37b){const _0x2bf7d5=a198_0x2754b2,_0x13b798=_0x18b37b[_0x2bf7d5(0x1b5)](_0x2bf7d5(0x1c2))[_0x2bf7d5(0x1bc)](),_0x4d2108=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x13b798,_0x4d2108);const _0x124f5b=projectTenantMembers(await listTenantDirectoryMembers(_0x13b798));return{'ok':!![],'data':{'tenantCode':_0x13b798,'items':_0x124f5b,'totalCount':_0x124f5b[_0x2bf7d5(0x1c3)]},'message':_0x2bf7d5(0x1b4)+_0x124f5b['length']+_0x2bf7d5(0x1ba)};}};function a198_0x5a28(){const _0x2ec4e9=['2090qLALPn','6226152JnpAbO','54160337JgtWlu','12021sMdRsN','tenant','Found\x20','str','178GYJwns','1161573xPUISz','Pass\x20--tenant-code\x20<code>.','7806102QlSGYM','\x20tenant\x20member(s)','flagMissing','trim','6917585LMwGsm','4Eiyzdm','25686lztOaH','Exact\x20tenant\x20code','7OgyZmo','tenant-code','length','string'];a198_0x5a28=function(){return _0x2ec4e9;};return a198_0x5a28();}
1
+ function a198_0x24ef(){const _0x3a65c7=['6kNmGOJ','716377MtgTYu','9BmmEVQ','3598710MrnQnG','12480376jEIeVH','4orxGsY','trim','5325502hrraOC','3390785VNxQMf','7459872mNlQvV','string','\x20tenant\x20member(s)','tenant-code','129501qzQnsd','read','flagMissing','Exact\x20tenant\x20code','str','Pass\x20--tenant-code\x20<code>.','length'];a198_0x24ef=function(){return _0x3a65c7;};return a198_0x24ef();}const a198_0x25df39=a198_0x9505;function a198_0x9505(_0x34abff,_0x52324b){_0x34abff=_0x34abff-0x196;const _0x24efab=a198_0x24ef();let _0x95054f=_0x24efab[_0x34abff];return _0x95054f;}(function(_0x14d023,_0x3dc7c8){const _0x381ad3=a198_0x9505,_0x37b384=_0x14d023();while(!![]){try{const _0x494304=parseInt(_0x381ad3(0x1a9))/0x1+parseInt(_0x381ad3(0x1a8))/0x2*(parseInt(_0x381ad3(0x1a1))/0x3)+-parseInt(_0x381ad3(0x199))/0x4*(-parseInt(_0x381ad3(0x19c))/0x5)+parseInt(_0x381ad3(0x19d))/0x6+-parseInt(_0x381ad3(0x19b))/0x7+parseInt(_0x381ad3(0x198))/0x8*(-parseInt(_0x381ad3(0x196))/0x9)+parseInt(_0x381ad3(0x197))/0xa;if(_0x494304===_0x3dc7c8)break;else _0x37b384['push'](_0x37b384['shift']());}catch(_0x5e06ab){_0x37b384['push'](_0x37b384['shift']());}}}(a198_0x24ef,0xc4df1));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':'tenant','command':'members-list','description':'List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','risk':a198_0x25df39(0x1a2),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a198_0x25df39(0x1a0),'type':a198_0x25df39(0x19e),'required':!![],'description':a198_0x25df39(0x1a4)}],async 'validate'(_0x38dacf){const _0x1337ce=a198_0x25df39;if(!_0x38dacf[_0x1337ce(0x1a5)](_0x1337ce(0x1a0))[_0x1337ce(0x19a)]())throw CliErrors[_0x1337ce(0x1a3)]('tenant-code',_0x1337ce(0x1a6));},async 'execute'(_0x3d58f4){const _0x4d2ef7=a198_0x25df39,_0x47a7d4=_0x3d58f4[_0x4d2ef7(0x1a5)](_0x4d2ef7(0x1a0))[_0x4d2ef7(0x19a)](),_0x5a968a=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x47a7d4,_0x5a968a);const _0x347063=projectTenantMembers(await listTenantDirectoryMembers(_0x47a7d4));return{'ok':!![],'data':{'tenantCode':_0x47a7d4,'items':_0x347063,'totalCount':_0x347063[_0x4d2ef7(0x1a7)]},'message':'Found\x20'+_0x347063[_0x4d2ef7(0x1a7)]+_0x4d2ef7(0x19f)};}};
@@ -1 +1 @@
1
- function a199_0x3a73(_0xcd2005,_0x3a12d0){_0xcd2005=_0xcd2005-0x1f4;const _0x1f1c60=a199_0x1f1c();let _0x3a7376=_0x1f1c60[_0xcd2005];return _0x3a7376;}(function(_0x1bb0e7,_0x235b49){const _0x3e353b=a199_0x3a73,_0x17c794=_0x1bb0e7();while(!![]){try{const _0x5320ce=-parseInt(_0x3e353b(0x1f5))/0x1+parseInt(_0x3e353b(0x20d))/0x2*(parseInt(_0x3e353b(0x200))/0x3)+parseInt(_0x3e353b(0x1fb))/0x4+-parseInt(_0x3e353b(0x20a))/0x5*(parseInt(_0x3e353b(0x1f9))/0x6)+parseInt(_0x3e353b(0x204))/0x7+-parseInt(_0x3e353b(0x20b))/0x8+-parseInt(_0x3e353b(0x202))/0x9*(-parseInt(_0x3e353b(0x206))/0xa);if(_0x5320ce===_0x235b49)break;else _0x17c794['push'](_0x17c794['shift']());}catch(_0xa23c2b){_0x17c794['push'](_0x17c794['shift']());}}}(a199_0x1f1c,0x39087));import{CliErrors}from'../../errors.js';function textOrNull(_0x25ad74){const _0xb0f63d=a199_0x3a73,_0x4519c3=_0x25ad74?.[_0xb0f63d(0x1fd)]();return _0x4519c3?_0x4519c3:null;}export function projectTenantMembers(_0x36d407){const _0x2a0a5d=a199_0x3a73,_0x13ec20=new Map();for(const _0x50d0fe of _0x36d407){const _0x592bae=Number(_0x50d0fe['userId']);if(!Number[_0x2a0a5d(0x207)](_0x592bae)||_0x592bae<=0x0)continue;const _0x253441={'userId':_0x592bae,'username':textOrNull(_0x50d0fe[_0x2a0a5d(0x1f7)]),'displayName':textOrNull(_0x50d0fe['nickname']),'role':_0x50d0fe[_0x2a0a5d(0x203)]===!![]?_0x2a0a5d(0x205):_0x2a0a5d(0x1f8),'status':textOrNull(_0x50d0fe[_0x2a0a5d(0x208)])},_0x5a74fd=_0x13ec20[_0x2a0a5d(0x20e)](_0x592bae);if(!_0x5a74fd){_0x13ec20[_0x2a0a5d(0x1f4)](_0x592bae,_0x253441);continue;}_0x5a74fd[_0x2a0a5d(0x1f7)]??=_0x253441[_0x2a0a5d(0x1f7)],_0x5a74fd[_0x2a0a5d(0x209)]??=_0x253441[_0x2a0a5d(0x209)],_0x5a74fd[_0x2a0a5d(0x208)]??=_0x253441[_0x2a0a5d(0x208)];if(_0x253441[_0x2a0a5d(0x201)]===_0x2a0a5d(0x205))_0x5a74fd[_0x2a0a5d(0x201)]=_0x2a0a5d(0x205);}return[..._0x13ec20[_0x2a0a5d(0x20c)]()]['sort']((_0x547e8c,_0x37a0e2)=>_0x547e8c[_0x2a0a5d(0x1fa)]-_0x37a0e2['userId']);}function a199_0x1f1c(){const _0x27d77e=['2007VaMZVX','adminFlag','1359750EdFCPH','ADMIN','26330baJcbh','isFinite','status','displayName','10SCwPfQ','1774968VDautP','values','22aGWCuh','get','set','266222qGNYri','some','username','MEMBER','499794zxRGxr','userId','396800jHnOgy','tenantCode','trim','validation','Tenant\x20\x22','2097qhzSOr','role'];a199_0x1f1c=function(){return _0x27d77e;};return a199_0x1f1c();}export function assertTenantAccessible(_0x27eefb,_0x42a85d){const _0x3bb55d=a199_0x3a73;if(_0x42a85d[_0x3bb55d(0x1f6)](_0x1bf59e=>_0x1bf59e[_0x3bb55d(0x1fc)]===_0x27eefb))return;throw CliErrors[_0x3bb55d(0x1fe)](_0x3bb55d(0x1ff)+_0x27eefb+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}
1
+ function a199_0x1380(_0x9acbc4,_0x2ea50d){_0x9acbc4=_0x9acbc4-0x6b;const _0x356a9e=a199_0x356a();let _0x138011=_0x356a9e[_0x9acbc4];return _0x138011;}(function(_0x201db4,_0x4ad6d0){const _0x22011c=a199_0x1380,_0x4549bf=_0x201db4();while(!![]){try{const _0x128072=parseInt(_0x22011c(0x72))/0x1+parseInt(_0x22011c(0x85))/0x2*(-parseInt(_0x22011c(0x6c))/0x3)+parseInt(_0x22011c(0x77))/0x4+parseInt(_0x22011c(0x7a))/0x5*(parseInt(_0x22011c(0x6d))/0x6)+-parseInt(_0x22011c(0x6b))/0x7*(-parseInt(_0x22011c(0x80))/0x8)+parseInt(_0x22011c(0x70))/0x9+parseInt(_0x22011c(0x7b))/0xa*(-parseInt(_0x22011c(0x78))/0xb);if(_0x128072===_0x4ad6d0)break;else _0x4549bf['push'](_0x4549bf['shift']());}catch(_0xb2d9f){_0x4549bf['push'](_0x4549bf['shift']());}}}(a199_0x356a,0x95e16));import{CliErrors}from'../../errors.js';function textOrNull(_0x5baee2){const _0x243637=a199_0x1380,_0x14d1df=_0x5baee2?.[_0x243637(0x74)]();return _0x14d1df?_0x14d1df:null;}export function projectTenantMembers(_0x2a7342){const _0x2bd8f6=a199_0x1380,_0x373ac4=new Map();for(const _0x475266 of _0x2a7342){const _0x32a8d5=Number(_0x475266[_0x2bd8f6(0x76)]);if(!Number[_0x2bd8f6(0x6e)](_0x32a8d5)||_0x32a8d5<=0x0)continue;const _0x35a22b={'userId':_0x32a8d5,'username':textOrNull(_0x475266[_0x2bd8f6(0x75)]),'displayName':textOrNull(_0x475266['nickname']),'role':_0x475266[_0x2bd8f6(0x83)]===!![]?_0x2bd8f6(0x71):'MEMBER','status':textOrNull(_0x475266[_0x2bd8f6(0x73)])},_0x28c12c=_0x373ac4['get'](_0x32a8d5);if(!_0x28c12c){_0x373ac4[_0x2bd8f6(0x7f)](_0x32a8d5,_0x35a22b);continue;}_0x28c12c[_0x2bd8f6(0x75)]??=_0x35a22b[_0x2bd8f6(0x75)],_0x28c12c[_0x2bd8f6(0x79)]??=_0x35a22b['displayName'],_0x28c12c[_0x2bd8f6(0x73)]??=_0x35a22b[_0x2bd8f6(0x73)];if(_0x35a22b['role']===_0x2bd8f6(0x71))_0x28c12c[_0x2bd8f6(0x6f)]='ADMIN';}return[..._0x373ac4[_0x2bd8f6(0x7d)]()][_0x2bd8f6(0x84)]((_0x2afb58,_0x3fe0c)=>_0x2afb58['userId']-_0x3fe0c['userId']);}export function assertTenantAccessible(_0x1a24d7,_0x4264dc){const _0x7f2e87=a199_0x1380;if(_0x4264dc[_0x7f2e87(0x81)](_0x22bd61=>_0x22bd61[_0x7f2e87(0x7c)]===_0x1a24d7))return;throw CliErrors[_0x7f2e87(0x82)]('Tenant\x20\x22'+_0x1a24d7+'\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.',_0x7f2e87(0x7e));}function a199_0x356a(){const _0x318a0d=['22YStScg','displayName','232945NtMwPo','2996830FbnPqf','tenantCode','values','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','set','54472iAmuNr','some','validation','adminFlag','sort','818UoRbUf','322JbfAQU','8319MalnMv','42aHOxjc','isFinite','role','123003sUuLAd','ADMIN','799215DDvPGj','status','trim','username','userId','3580856RivKMl'];a199_0x356a=function(){return _0x318a0d;};return a199_0x356a();}
@@ -1 +1 @@
1
- const a200_0x58336e=a200_0x5e05;(function(_0x3d3c4a,_0x14a691){const _0x1f6524=a200_0x5e05,_0xbb932=_0x3d3c4a();while(!![]){try{const _0x178b73=-parseInt(_0x1f6524(0x1b6))/0x1*(-parseInt(_0x1f6524(0x1c4))/0x2)+parseInt(_0x1f6524(0x1bb))/0x3*(-parseInt(_0x1f6524(0x1b9))/0x4)+-parseInt(_0x1f6524(0x1be))/0x5*(-parseInt(_0x1f6524(0x1c6))/0x6)+parseInt(_0x1f6524(0x1c3))/0x7+-parseInt(_0x1f6524(0x1ce))/0x8*(parseInt(_0x1f6524(0x1bf))/0x9)+-parseInt(_0x1f6524(0x1b7))/0xa+parseInt(_0x1f6524(0x1b5))/0xb;if(_0x178b73===_0x14a691)break;else _0xbb932['push'](_0xbb932['shift']());}catch(_0x3ae6c3){_0xbb932['push'](_0xbb932['shift']());}}}(a200_0x1942,0x75dd6));function a200_0x5e05(_0x3f29d9,_0x43185d){_0x3f29d9=_0x3f29d9-0x1b3;const _0x19423b=a200_0x1942();let _0x5e050c=_0x19423b[_0x3f29d9];return _0x5e050c;}import{asDryRunResult}from'../../commands/common/dry-run.js';function a200_0x1942(){const _0x450962=['bind','string','POST','dingding-sandbox','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','8hInSwY','dingding-sandbox-bind','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','5238035TxrZxT','79eewnha','1030690arThuR','ding-talk-user-id','31732unVGbl','validation','114JmOIxm','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','5JlHBQe','1529208bHncSk','str','trim','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','2215094eFKJol','4904spRjJL','user-account','425244BUUjDL','--ding-talk-user-id\x20cannot\x20be\x20empty.','write'];a200_0x1942=function(){return _0x450962;};return a200_0x1942();}import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x58336e(0x1cc),CURRENT_BINDING_WARNING=a200_0x58336e(0x1cd);function readDingTalkUserId(_0x306358){const _0x104154=a200_0x58336e,_0x2cf44f=_0x306358[_0x104154(0x1c0)](_0x104154(0x1b8))[_0x104154(0x1c1)]();if(!_0x2cf44f)throw CliErrors[_0x104154(0x1ba)](_0x104154(0x1c7),_0x104154(0x1bc));return _0x2cf44f;}function buildBindingData(_0x2c59f1,_0x20faf2){const _0x3fae7b=a200_0x58336e;return{'operation':_0x3fae7b(0x1c9),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x2c59f1,'bound':!![]},'dryRun':_0x20faf2,'backend':{'method':_0x3fae7b(0x1cb),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x58336e(0x1c5),'command':a200_0x58336e(0x1b3),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a200_0x58336e(0x1c8),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x58336e(0x1b8),'type':a200_0x58336e(0x1ca),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x1c6fca){readDingTalkUserId(_0x1c6fca);},async 'dryRun'(_0x182a4d){const _0xa2855f=readDingTalkUserId(_0x182a4d);return asDryRunResult(buildBindingData(_0xa2855f,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x43055c){const _0x5b2a8a=a200_0x58336e,_0x1404de=readDingTalkUserId(_0x43055c),_0x3e1a14=await bindDingTalkSandboxAccount(_0x1404de);if(_0x3e1a14!==!![])throw CliErrors['apiError'](_0x5b2a8a(0x1b4),_0x5b2a8a(0x1bd));return{'ok':!![],'data':buildBindingData(_0x1404de,![]),'message':_0x5b2a8a(0x1c2)};}};
1
+ const a200_0x4ac1ca=a200_0x2618;function a200_0xced1(){const _0x32cc9e=['2tYPdov','POST','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','1426605nWBkCd','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','write','ding-talk-user-id','str','2102236AfamiM','dingding-sandbox-bind','apiError','6072437jjzIzA','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','bind','857732kUlsAv','7132120zdUbRw','3058608DWhRZJ','408321LwiSzj','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','dingding-sandbox','12XlxVAj','string','trim','user-account','--ding-talk-user-id\x20cannot\x20be\x20empty.','690ZpcGxW','DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox','validation'];a200_0xced1=function(){return _0x32cc9e;};return a200_0xced1();}(function(_0x130486,_0x28dac7){const _0x54a269=a200_0x2618,_0x5d2de4=_0x130486();while(!![]){try{const _0xa63b42=-parseInt(_0x54a269(0x18d))/0x1+parseInt(_0x54a269(0x17f))/0x2*(-parseInt(_0x54a269(0x18f))/0x3)+parseInt(_0x54a269(0x187))/0x4+parseInt(_0x54a269(0x182))/0x5*(parseInt(_0x54a269(0x177))/0x6)+-parseInt(_0x54a269(0x18a))/0x7+-parseInt(_0x54a269(0x18e))/0x8+parseInt(_0x54a269(0x190))/0x9*(parseInt(_0x54a269(0x17c))/0xa);if(_0xa63b42===_0x28dac7)break;else _0x5d2de4['push'](_0x5d2de4['shift']());}catch(_0x65023e){_0x5d2de4['push'](_0x5d2de4['shift']());}}}(a200_0xced1,0x90234));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a200_0x2618(_0x4707a7,_0x2b9557){_0x4707a7=_0x4707a7-0x177;const _0xced1f0=a200_0xced1();let _0x2618a5=_0xced1f0[_0x4707a7];return _0x2618a5;}import{CliErrors}from'../../errors.js';const PROVIDER_ID=a200_0x4ac1ca(0x192),CURRENT_BINDING_WARNING='The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.';function readDingTalkUserId(_0x2238a5){const _0x2d3f2f=a200_0x4ac1ca,_0x1ae750=_0x2238a5[_0x2d3f2f(0x186)](_0x2d3f2f(0x185))[_0x2d3f2f(0x179)]();if(!_0x1ae750)throw CliErrors[_0x2d3f2f(0x17e)](_0x2d3f2f(0x17b),_0x2d3f2f(0x18b));return _0x1ae750;}function buildBindingData(_0x292fdf,_0x5ef67e){const _0x4eac8d=a200_0x4ac1ca;return{'operation':_0x4eac8d(0x18c),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x292fdf},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x292fdf,'bound':!![]},'dryRun':_0x5ef67e,'backend':{'method':_0x4eac8d(0x180),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a200_0x4ac1ca(0x17a),'command':a200_0x4ac1ca(0x188),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':a200_0x4ac1ca(0x184),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a200_0x4ac1ca(0x185),'type':a200_0x4ac1ca(0x178),'required':!![],'description':a200_0x4ac1ca(0x17d)}],async 'validate'(_0x498a52){readDingTalkUserId(_0x498a52);},async 'dryRun'(_0x35cd63){const _0x5180e1=a200_0x4ac1ca,_0x44f9c1=readDingTalkUserId(_0x35cd63);return asDryRunResult(buildBindingData(_0x44f9c1,!![]),{'method':_0x5180e1(0x180),'url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x1de165){const _0xd71604=a200_0x4ac1ca,_0x1a73a3=readDingTalkUserId(_0x1de165),_0x3aaa80=await bindDingTalkSandboxAccount(_0x1a73a3);if(_0x3aaa80!==!![])throw CliErrors[_0xd71604(0x189)](_0xd71604(0x181),_0xd71604(0x191));return{'ok':!![],'data':buildBindingData(_0x1a73a3,![]),'message':_0xd71604(0x183)};}};
@@ -1 +1 @@
1
- function a201_0x2117(){const _0x2e5e4b=['2354052yXEJeX','8ObXDxA','471360keCmoo','8883650EgyLIb','11ZeFppG','330326sIPogl','7BPGXVV','10852YflBrf','78owkhHd','1771444fvWHIU','2824947LyNUnu'];a201_0x2117=function(){return _0x2e5e4b;};return a201_0x2117();}(function(_0x529e5f,_0x833728){const _0x29e7b3=a201_0x5bb5,_0x51160e=_0x529e5f();while(!![]){try{const _0x63f5d4=-parseInt(_0x29e7b3(0x10c))/0x1+parseInt(_0x29e7b3(0x10e))/0x2*(-parseInt(_0x29e7b3(0x10f))/0x3)+parseInt(_0x29e7b3(0x110))/0x4+parseInt(_0x29e7b3(0x114))/0x5+parseInt(_0x29e7b3(0x112))/0x6*(-parseInt(_0x29e7b3(0x10d))/0x7)+-parseInt(_0x29e7b3(0x113))/0x8*(parseInt(_0x29e7b3(0x111))/0x9)+parseInt(_0x29e7b3(0x10a))/0xa*(parseInt(_0x29e7b3(0x10b))/0xb);if(_0x63f5d4===_0x833728)break;else _0x51160e['push'](_0x51160e['shift']());}catch(_0x5b37c9){_0x51160e['push'](_0x51160e['shift']());}}}(a201_0x2117,0x3c83f));function a201_0x5bb5(_0x320ebc,_0x3bf42b){_0x320ebc=_0x320ebc-0x10a;const _0x21172a=a201_0x2117();let _0x5bb57b=_0x21172a[_0x320ebc];return _0x5bb57b;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ function a201_0x8751(){const _0x390f6d=['402820nbvPpn','4746186vZujgR','358939dtvBJK','14GZQBXZ','18712kLqMJF','45kZkPNB','4906910FlqtME','5166uvOUqc','1582176Wgfwer','27243050oTQVpa'];a201_0x8751=function(){return _0x390f6d;};return a201_0x8751();}(function(_0xce5c6e,_0x20240c){const _0x3b278e=a201_0x5f49,_0x55cf02=_0xce5c6e();while(!![]){try{const _0x3a398e=parseInt(_0x3b278e(0x1be))/0x1+parseInt(_0x3b278e(0x1ba))/0x2+parseInt(_0x3b278e(0x1c1))/0x3*(-parseInt(_0x3b278e(0x1bc))/0x4)+parseInt(_0x3b278e(0x1c2))/0x5+-parseInt(_0x3b278e(0x1bd))/0x6*(-parseInt(_0x3b278e(0x1bf))/0x7)+-parseInt(_0x3b278e(0x1c0))/0x8*(-parseInt(_0x3b278e(0x1b9))/0x9)+-parseInt(_0x3b278e(0x1bb))/0xa;if(_0x3a398e===_0x20240c)break;else _0x55cf02['push'](_0x55cf02['shift']());}catch(_0xf96340){_0x55cf02['push'](_0x55cf02['shift']());}}}(a201_0x8751,0xc87b9));function a201_0x5f49(_0x220afa,_0x3fc917){_0x220afa=_0x220afa-0x1b9;const _0x875120=a201_0x8751();let _0x5f49d9=_0x875120[_0x220afa];return _0x5f49d9;}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- function a202_0x5b66(){const _0x22ec35=['1900430xbjIHC','2102wbBLZA','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','1021196QzzLkp','workspace\x20add','add','130bIhfLj','App\x20profile\x20name','6587811TVMjOu','405652QKqYJL','40PdxgAe','1017VbbnPY','3240732INAzqB','name','8EoGtCH','712221TBqHEo','write'];a202_0x5b66=function(){return _0x22ec35;};return a202_0x5b66();}function a202_0x467c(_0x3b7017,_0x3b6099){_0x3b7017=_0x3b7017-0x16a;const _0x5b6620=a202_0x5b66();let _0x467cc8=_0x5b6620[_0x3b7017];return _0x467cc8;}const a202_0x429dde=a202_0x467c;(function(_0x108c46,_0xe753b4){const _0x46e617=a202_0x467c,_0x3f6e6d=_0x108c46();while(!![]){try{const _0xf8ec1b=parseInt(_0x46e617(0x172))/0x1+-parseInt(_0x46e617(0x175))/0x2*(-parseInt(_0x46e617(0x16e))/0x3)+parseInt(_0x46e617(0x16c))/0x4*(-parseInt(_0x46e617(0x16d))/0x5)+-parseInt(_0x46e617(0x16f))/0x6+-parseInt(_0x46e617(0x174))/0x7*(-parseInt(_0x46e617(0x171))/0x8)+-parseInt(_0x46e617(0x16b))/0x9+parseInt(_0x46e617(0x17a))/0xa*(parseInt(_0x46e617(0x177))/0xb);if(_0xf8ec1b===_0xe753b4)break;else _0x3f6e6d['push'](_0x3f6e6d['shift']());}catch(_0x1c9520){_0x3f6e6d['push'](_0x3f6e6d['shift']());}}}(a202_0x5b66,0x71267));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':'workspace','command':a202_0x429dde(0x179),'description':a202_0x429dde(0x176),'risk':a202_0x429dde(0x173),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x429dde(0x170),'description':a202_0x429dde(0x16a),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x5c5fa9=>validateAppName(_0x5c5fa9,a202_0x429dde(0x178)),'execute':_0x4033f7=>runAppAdd(_0x4033f7,a202_0x429dde(0x178))};
1
+ const a202_0x5ad548=a202_0x3ff6;function a202_0x1b06(){const _0x4ed14c=['3269730jORprY','workspace','50562srgVEX','App\x20profile\x20name','827612EUoQXF','workspace\x20add','write','3045WSndBh','12942520UDCmvK','name','903332LcyxbC','3752xVwccw','12UIpcEx','424UzYsAt','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','4993807PPwlHa'];a202_0x1b06=function(){return _0x4ed14c;};return a202_0x1b06();}function a202_0x3ff6(_0x59f54d,_0x47aaaa){_0x59f54d=_0x59f54d-0xa0;const _0x1b0612=a202_0x1b06();let _0x3ff628=_0x1b0612[_0x59f54d];return _0x3ff628;}(function(_0x362fbb,_0x4c3d91){const _0x5e021c=a202_0x3ff6,_0x4a58be=_0x362fbb();while(!![]){try{const _0x2a1d07=parseInt(_0x5e021c(0xa9))/0x1+parseInt(_0x5e021c(0xaf))/0x2+parseInt(_0x5e021c(0xac))/0x3*(-parseInt(_0x5e021c(0xb0))/0x4)+parseInt(_0x5e021c(0xa5))/0x5+-parseInt(_0x5e021c(0xa0))/0x6*(-parseInt(_0x5e021c(0xa4))/0x7)+parseInt(_0x5e021c(0xa1))/0x8*(-parseInt(_0x5e021c(0xa7))/0x9)+-parseInt(_0x5e021c(0xad))/0xa;if(_0x2a1d07===_0x4c3d91)break;else _0x4a58be['push'](_0x4a58be['shift']());}catch(_0x1c2385){_0x4a58be['push'](_0x4a58be['shift']());}}}(a202_0x1b06,0xc734e));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a202_0x5ad548(0xa6),'command':a202_0x5ad548(0xa3),'description':a202_0x5ad548(0xa2),'risk':a202_0x5ad548(0xab),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a202_0x5ad548(0xae),'description':a202_0x5ad548(0xa8),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x299338=>validateAppName(_0x299338,'workspace\x20add'),'execute':_0xd027be=>runAppAdd(_0xd027be,a202_0x5ad548(0xaa))};
@@ -1 +1 @@
1
- const a203_0x29b80a=a203_0x5623;(function(_0x47301,_0x4ee5bb){const _0x1d011f=a203_0x5623,_0x7b3b3f=_0x47301();while(!![]){try{const _0x167541=-parseInt(_0x1d011f(0x10c))/0x1+-parseInt(_0x1d011f(0x119))/0x2+parseInt(_0x1d011f(0x110))/0x3*(parseInt(_0x1d011f(0x115))/0x4)+-parseInt(_0x1d011f(0xf1))/0x5*(parseInt(_0x1d011f(0xfc))/0x6)+-parseInt(_0x1d011f(0x11d))/0x7+parseInt(_0x1d011f(0x10f))/0x8*(parseInt(_0x1d011f(0x118))/0x9)+parseInt(_0x1d011f(0x102))/0xa*(parseInt(_0x1d011f(0x108))/0xb);if(_0x167541===_0x4ee5bb)break;else _0x7b3b3f['push'](_0x7b3b3f['shift']());}catch(_0x337a31){_0x7b3b3f['push'](_0x7b3b3f['shift']());}}}(a203_0x3f0f,0xe3387));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{RABETBASE_ENV_VALUES}from'../../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';function a203_0x3f0f(){const _0x43764d=['workspace','flag','\x20--appcode\x20<code>`.','6544433qssPDl','riskLevel','Target\x20environment','trim','object','locale','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','\x20(appcode:\x20','apiDir','format','8982065yWqoYu','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','number','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','appcode','defaultFormat','length','env','workspace.','pageSize','App\x20\x22','6biRAbV','apps','Initialize\x20the\x20current\x20workspace\x20app\x20binding','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20use\x20--app\x20<name>`.','app','10cdeElS','validation','Use\x20`','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','Locale\x20for\x20this\x20workspace\x20app\x20profile','init','60268197hCzmjG','\x20--app\x20','keys','use','1585888rDXxEu','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','str','5624096CPsHAL','15BrJABV','globalConfig','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','Missing\x20workspace\x20app\x20selector.','286792eZZOHa','string','write','9oPpebe','2585028MchtNr'];a203_0x3f0f=function(){return _0x43764d;};return a203_0x3f0f();}function a203_0x5623(_0x3d6934,_0x41dbb4){_0x3d6934=_0x3d6934-0xee;const _0x3f0f34=a203_0x3f0f();let _0x562364=_0x3f0f34[_0x3d6934];return _0x562364;}const WORKSPACE_USAGE=CLI_BIN_NAME+a203_0x29b80a(0x113),SAFE_PROFILE_KEYS=['appcode','env','apiDir',a203_0x29b80a(0xf0),a203_0x29b80a(0xfa),a203_0x29b80a(0x11e),a203_0x29b80a(0x122)],workspaceFlags=[{'name':a203_0x29b80a(0x101),'type':a203_0x29b80a(0x116),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a203_0x29b80a(0xf8),'type':'string','description':a203_0x29b80a(0x11f),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a203_0x29b80a(0x10d)},{'name':a203_0x29b80a(0xf6),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x123),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a203_0x29b80a(0xf3),'description':a203_0x29b80a(0x112)},{'name':a203_0x29b80a(0x11e),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0xf4),'enum':[...RISK_LEVEL_VALUES]},{'name':a203_0x29b80a(0x122),'type':a203_0x29b80a(0x116),'description':a203_0x29b80a(0x106)}];function isRecord(_0x4732c8){const _0x17b09e=a203_0x29b80a;return!!_0x4732c8&&typeof _0x4732c8===_0x17b09e(0x121)&&!Array['isArray'](_0x4732c8);}function assertValidAppcode(_0x249e8f){const _0x44abce=a203_0x29b80a,{valid:_0x154775,message:_0x417ea9}=validateAppcode(_0x249e8f);if(!_0x154775)throw CliErrors[_0x44abce(0x103)]('Invalid\x20appcode:\x20'+_0x249e8f,_0x417ea9);}function sanitizeProfile(_0x2660da){if(!isRecord(_0x2660da))return{};const _0x25b20d={};for(const _0x34a2b4 of SAFE_PROFILE_KEYS){if(_0x2660da[_0x34a2b4]!==undefined)_0x25b20d[_0x34a2b4]=_0x2660da[_0x34a2b4];}return _0x25b20d;}function cloneProfile(_0x39842e){return isRecord(_0x39842e)?{..._0x39842e}:{};}function collectWorkspaceProfileOverrides(_0x3e4cbf){const _0x499b86=a203_0x29b80a,_0x190568={},_0xf2915f=_0x3e4cbf['str'](_0x499b86(0xf8)),_0x5cd1c0=_0x3e4cbf['str']('apiDir'),_0x5d9bcd=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0xf6)),_0x88384f=_0x3e4cbf[_0x499b86(0x11b)]('pageSize'),_0xf34247=_0x3e4cbf[_0x499b86(0x10e)]('riskLevel'),_0x1e8ce7=_0x3e4cbf[_0x499b86(0x10e)](_0x499b86(0x122));if(_0xf2915f)_0x190568[_0x499b86(0xf8)]=_0xf2915f;if(_0x5cd1c0)_0x190568[_0x499b86(0xef)]=_0x5cd1c0;if(_0x5d9bcd)_0x190568[_0x499b86(0xf0)]=_0x5d9bcd;if(_0x88384f!==undefined&&_0x88384f!=='')_0x190568['pageSize']=Number(_0x88384f);if(_0xf34247)_0x190568[_0x499b86(0x11e)]=_0xf34247;if(_0x1e8ce7)_0x190568['locale']=_0x1e8ce7;return _0x190568;}async function validateWorkspaceArgs(_0x2fdcbf){const _0x23351c=a203_0x29b80a,_0x484df8=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0x101))[_0x23351c(0x120)](),_0x30e407=_0x2fdcbf[_0x23351c(0x10e)](_0x23351c(0xf5))[_0x23351c(0x120)]();if(!_0x484df8&&!_0x30e407)throw CliErrors['validation'](_0x23351c(0x114),_0x23351c(0x104)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x23351c(0x100));if(_0x30e407)assertValidAppcode(_0x30e407);}function resolveKnownApps(){const _0x52b505=a203_0x29b80a,{config:_0x351695,layers:_0x587bfe}=readRawConfigWithLayers(),_0x2708b5=isRecord(_0x351695['apps'])?_0x351695[_0x52b505(0xfd)]:{},_0x4ff698=isRecord(_0x587bfe['globalConfig'][_0x52b505(0xfd)])?_0x587bfe[_0x52b505(0x111)][_0x52b505(0xfd)]:{};return{..._0x4ff698,..._0x2708b5};}async function configureWorkspace(_0xd92d6c,_0x384fff){const _0x303cd8=a203_0x29b80a,_0x1c53b0=_0xd92d6c[_0x303cd8(0x10e)](_0x303cd8(0x101))[_0x303cd8(0x120)](),_0x578c19=_0xd92d6c['str'](_0x303cd8(0xf5))['trim'](),_0x452292=_0x1c53b0||_0x578c19;if(!_0x452292)throw CliErrors[_0x303cd8(0x103)](_0x303cd8(0x114),'Use\x20`'+CLI_BIN_NAME+_0x303cd8(0x105)+CLI_BIN_NAME+_0x303cd8(0x100));if(_0x578c19)assertValidAppcode(_0x578c19);const _0x446b4e=resolveWriteConfigPath('project'),_0x301fde=readConfigFile(_0x446b4e),_0x25df8e=resolveKnownApps(),_0x23b70d=isRecord(_0x301fde[_0x303cd8(0xfd)])?{..._0x301fde[_0x303cd8(0xfd)]}:{},_0x1cf75d=cloneProfile(_0x23b70d[_0x452292]),_0x50b96d=sanitizeProfile(_0x25df8e[_0x452292]),_0x301a16=_0x578c19?{}:_0x50b96d,_0x1997b4=_0x578c19||_0x301a16['appcode'];if(!_0x1997b4){const _0x11f962=Object[_0x303cd8(0x10a)](_0x25df8e),_0x2c5a1b=_0x11f962[_0x303cd8(0xf7)]===0x0?_0x303cd8(0x104)+CLI_BIN_NAME+'\x20workspace\x20'+_0x384fff+_0x303cd8(0x109)+_0x452292+_0x303cd8(0x11c):_0x303cd8(0xf2)+_0x11f962['join'](',\x20');throw CliErrors['validation'](_0x303cd8(0xfb)+_0x452292+'\x22\x20not\x20found.',_0x2c5a1b);}assertValidAppcode(String(_0x1997b4));const _0x10724e={..._0x301a16,..._0x1cf75d,'appcode':String(_0x1997b4),...collectWorkspaceProfileOverrides(_0xd92d6c)};return _0x23b70d[_0x452292]=_0x10724e,_0x301fde['apps']=_0x23b70d,_0x301fde['defaultApp']=_0x452292,delete _0x301fde[_0x303cd8(0xf5)],delete _0x301fde[_0x303cd8(0x101)],_0x10724e[_0x303cd8(0xf8)]&&(_0x301fde[_0x303cd8(0xf8)]=_0x10724e[_0x303cd8(0xf8)]),writeConfigFile(_0x446b4e,_0x301fde),{'ok':!![],'message':'Workspace\x20'+(_0x384fff===_0x303cd8(0x107)?'initialized':'updated')+':\x20'+_0x452292+_0x303cd8(0xee)+_0x10724e['appcode']+').\x20Config:\x20'+_0x446b4e+'.\x20Credentials:\x20not\x20written.','data':{'operation':_0x303cd8(0xf9)+_0x384fff,'configPath':_0x446b4e,'app':_0x452292,'appcode':_0x10724e[_0x303cd8(0xf5)],'env':_0x10724e[_0x303cd8(0xf8)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x107),'description':a203_0x29b80a(0xfe),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4147e1=>configureWorkspace(_0x4147e1,a203_0x29b80a(0x107))},workspaceUseDefinition={'service':a203_0x29b80a(0x11a),'command':a203_0x29b80a(0x10b),'description':a203_0x29b80a(0xff),'risk':a203_0x29b80a(0x117),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x9d6464=>configureWorkspace(_0x9d6464,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a203_0x4c47b8=a203_0xc44f;(function(_0x15b761,_0x521803){const _0x3d207f=a203_0xc44f,_0x1c1315=_0x15b761();while(!![]){try{const _0x56e7b1=-parseInt(_0x3d207f(0xeb))/0x1+parseInt(_0x3d207f(0xe0))/0x2+parseInt(_0x3d207f(0xdd))/0x3+-parseInt(_0x3d207f(0xda))/0x4*(-parseInt(_0x3d207f(0xe7))/0x5)+-parseInt(_0x3d207f(0xcb))/0x6+-parseInt(_0x3d207f(0xef))/0x7+parseInt(_0x3d207f(0xf3))/0x8;if(_0x56e7b1===_0x521803)break;else _0x1c1315['push'](_0x1c1315['shift']());}catch(_0x536a16){_0x1c1315['push'](_0x1c1315['shift']());}}}(a203_0x5869,0xc15d2));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';function a203_0xc44f(_0x581f6d,_0x525d9c){_0x581f6d=_0x581f6d-0xc6;const _0x586975=a203_0x5869();let _0xc44f50=_0x586975[_0x581f6d];return _0xc44f50;}function a203_0x5869(){const _0x37a8d0=['Initialize\x20the\x20current\x20workspace\x20app\x20binding','Missing\x20workspace\x20app\x20selector.','\x20workspace\x20','env','.\x20Credentials:\x20not\x20written.','app','475bZQWxk','pageSize','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','apps','1260847NQVSjf','trim','globalConfig','defaultApp','10079832wjIxlt','apiDir','initialized','appcode','8906624EKzItF','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','flag','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','\x20--app\x20','\x20(appcode:\x20','isArray','write','Workspace\x20','defaultFormat','validation','updated','workspace','use','init','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','App\x20\x22','4676382bAqZay','number','\x20workspace\x20use\x20--app\x20<name>`.','str','format','Switch\x20the\x20current\x20workspace\x20app\x20binding','length','string','locale','\x22\x20not\x20found.',').\x20Config:\x20','Locale\x20for\x20this\x20workspace\x20app\x20profile','riskLevel','object','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','66472XIDPcH','Use\x20`','project','3338394frUHKC','workspace.','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','934804eMQfeP'];a203_0x5869=function(){return _0x37a8d0;};return a203_0x5869();}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+a203_0x4c47b8(0xf6),SAFE_PROFILE_KEYS=[a203_0x4c47b8(0xf2),a203_0x4c47b8(0xe4),a203_0x4c47b8(0xf0),a203_0x4c47b8(0xcf),a203_0x4c47b8(0xe8),a203_0x4c47b8(0xd7),a203_0x4c47b8(0xd3)],workspaceFlags=[{'name':a203_0x4c47b8(0xe6),'type':'string','description':a203_0x4c47b8(0xdf)},{'name':a203_0x4c47b8(0xf2),'type':a203_0x4c47b8(0xd2),'description':a203_0x4c47b8(0xe9)},{'name':a203_0x4c47b8(0xe4),'type':a203_0x4c47b8(0xd2),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':a203_0x4c47b8(0xf0),'type':'string','description':a203_0x4c47b8(0xf4)},{'name':a203_0x4c47b8(0xfc),'type':a203_0x4c47b8(0xd2),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a203_0x4c47b8(0xe8),'type':a203_0x4c47b8(0xcc),'description':a203_0x4c47b8(0xd9)},{'name':'riskLevel','type':a203_0x4c47b8(0xd2),'description':'Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':a203_0x4c47b8(0xd6)}];function isRecord(_0x46fe74){const _0x394f80=a203_0x4c47b8;return!!_0x46fe74&&typeof _0x46fe74===_0x394f80(0xd8)&&!Array[_0x394f80(0xf9)](_0x46fe74);}function assertValidAppcode(_0x2ee5e3){const _0x58f8c1=a203_0x4c47b8,{valid:_0x9350ec,message:_0x29cf4c}=validateAppcode(_0x2ee5e3);if(!_0x9350ec)throw CliErrors[_0x58f8c1(0xfd)]('Invalid\x20appcode:\x20'+_0x2ee5e3,_0x29cf4c);}function sanitizeProfile(_0x236fc2){if(!isRecord(_0x236fc2))return{};const _0x23b612={};for(const _0x495f08 of SAFE_PROFILE_KEYS){if(_0x236fc2[_0x495f08]!==undefined)_0x23b612[_0x495f08]=_0x236fc2[_0x495f08];}return _0x23b612;}function cloneProfile(_0x378863){return isRecord(_0x378863)?{..._0x378863}:{};}function collectWorkspaceProfileOverrides(_0x20962b){const _0x7be68b=a203_0x4c47b8,_0x189e46={},_0x444dda=_0x20962b[_0x7be68b(0xce)]('env'),_0x26c2be=_0x20962b[_0x7be68b(0xce)]('apiDir'),_0x5408a9=_0x20962b['str']('defaultFormat'),_0x344c34=_0x20962b[_0x7be68b(0xf5)](_0x7be68b(0xe8)),_0x5cfaba=_0x20962b['str']('riskLevel'),_0x4a4a88=_0x20962b[_0x7be68b(0xce)]('locale');if(_0x444dda)_0x189e46[_0x7be68b(0xe4)]=_0x444dda;if(_0x26c2be)_0x189e46[_0x7be68b(0xf0)]=_0x26c2be;if(_0x5408a9)_0x189e46[_0x7be68b(0xcf)]=_0x5408a9;if(_0x344c34!==undefined&&_0x344c34!=='')_0x189e46[_0x7be68b(0xe8)]=Number(_0x344c34);if(_0x5cfaba)_0x189e46[_0x7be68b(0xd7)]=_0x5cfaba;if(_0x4a4a88)_0x189e46[_0x7be68b(0xd3)]=_0x4a4a88;return _0x189e46;}async function validateWorkspaceArgs(_0x5373bd){const _0x56582d=a203_0x4c47b8,_0x2e3e48=_0x5373bd[_0x56582d(0xce)]('app')[_0x56582d(0xec)](),_0x1d94cb=_0x5373bd['str'](_0x56582d(0xf2))[_0x56582d(0xec)]();if(!_0x2e3e48&&!_0x1d94cb)throw CliErrors[_0x56582d(0xfd)](_0x56582d(0xe2),_0x56582d(0xdb)+CLI_BIN_NAME+_0x56582d(0xc9)+CLI_BIN_NAME+_0x56582d(0xcd));if(_0x1d94cb)assertValidAppcode(_0x1d94cb);}function resolveKnownApps(){const _0x1135c2=a203_0x4c47b8,{config:_0x1ddd51,layers:_0x4b4e26}=readRawConfigWithLayers(),_0x335ed1=isRecord(_0x1ddd51[_0x1135c2(0xea)])?_0x1ddd51[_0x1135c2(0xea)]:{},_0xc6ba1=isRecord(_0x4b4e26[_0x1135c2(0xed)][_0x1135c2(0xea)])?_0x4b4e26[_0x1135c2(0xed)]['apps']:{};return{..._0xc6ba1,..._0x335ed1};}async function configureWorkspace(_0x5492ef,_0x4df398){const _0x3d20c9=a203_0x4c47b8,_0x539bbe=_0x5492ef[_0x3d20c9(0xce)]('app')['trim'](),_0x22ac53=_0x5492ef[_0x3d20c9(0xce)]('appcode')[_0x3d20c9(0xec)](),_0x72e958=_0x539bbe||_0x22ac53;if(!_0x72e958)throw CliErrors[_0x3d20c9(0xfd)](_0x3d20c9(0xe2),'Use\x20`'+CLI_BIN_NAME+_0x3d20c9(0xc9)+CLI_BIN_NAME+_0x3d20c9(0xcd));if(_0x22ac53)assertValidAppcode(_0x22ac53);const _0x15f168=resolveWriteConfigPath(_0x3d20c9(0xdc)),_0x3e2c72=readConfigFile(_0x15f168),_0x2cb508=resolveKnownApps(),_0x1e5f48=isRecord(_0x3e2c72[_0x3d20c9(0xea)])?{..._0x3e2c72['apps']}:{},_0x3266d2=cloneProfile(_0x1e5f48[_0x72e958]),_0x1e4860=sanitizeProfile(_0x2cb508[_0x72e958]),_0x46b32e=_0x22ac53?{}:_0x1e4860,_0x4062dd=_0x22ac53||_0x46b32e[_0x3d20c9(0xf2)];if(!_0x4062dd){const _0x32f0fd=Object['keys'](_0x2cb508),_0x428a0a=_0x32f0fd[_0x3d20c9(0xd1)]===0x0?_0x3d20c9(0xdb)+CLI_BIN_NAME+_0x3d20c9(0xe3)+_0x4df398+_0x3d20c9(0xf7)+_0x72e958+'\x20--appcode\x20<code>`.':'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x32f0fd['join'](',\x20');throw CliErrors['validation'](_0x3d20c9(0xca)+_0x72e958+_0x3d20c9(0xd4),_0x428a0a);}assertValidAppcode(String(_0x4062dd));const _0x11abb9={..._0x46b32e,..._0x3266d2,'appcode':String(_0x4062dd),...collectWorkspaceProfileOverrides(_0x5492ef)};return _0x1e5f48[_0x72e958]=_0x11abb9,_0x3e2c72['apps']=_0x1e5f48,_0x3e2c72[_0x3d20c9(0xee)]=_0x72e958,delete _0x3e2c72[_0x3d20c9(0xf2)],delete _0x3e2c72[_0x3d20c9(0xe6)],_0x11abb9[_0x3d20c9(0xe4)]&&(_0x3e2c72[_0x3d20c9(0xe4)]=_0x11abb9[_0x3d20c9(0xe4)]),writeConfigFile(_0x15f168,_0x3e2c72),{'ok':!![],'message':_0x3d20c9(0xfb)+(_0x4df398==='init'?_0x3d20c9(0xf1):_0x3d20c9(0xfe))+':\x20'+_0x72e958+_0x3d20c9(0xf8)+_0x11abb9['appcode']+_0x3d20c9(0xd5)+_0x15f168+_0x3d20c9(0xe5),'data':{'operation':_0x3d20c9(0xde)+_0x4df398,'configPath':_0x15f168,'app':_0x72e958,'appcode':_0x11abb9[_0x3d20c9(0xf2)],'env':_0x11abb9[_0x3d20c9(0xe4)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':'workspace','command':a203_0x4c47b8(0xc8),'description':a203_0x4c47b8(0xe1),'risk':a203_0x4c47b8(0xfa),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x4ea013=>configureWorkspace(_0x4ea013,'init')},workspaceUseDefinition={'service':a203_0x4c47b8(0xc6),'command':a203_0x4c47b8(0xc7),'description':a203_0x4c47b8(0xd0),'risk':a203_0x4c47b8(0xfa),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x3336d7=>configureWorkspace(_0x3336d7,a203_0x4c47b8(0xc7))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a204_0x4305c7=a204_0x567d;function a204_0x567d(_0x319d42,_0x3d9d32){_0x319d42=_0x319d42-0x19c;const _0x262c6a=a204_0x262c();let _0x567daf=_0x262c6a[_0x319d42];return _0x567daf;}(function(_0x6d2c6,_0x2008da){const _0x1b4e1c=a204_0x567d,_0x2ec167=_0x6d2c6();while(!![]){try{const _0x428af9=-parseInt(_0x1b4e1c(0x1a0))/0x1*(parseInt(_0x1b4e1c(0x1a9))/0x2)+-parseInt(_0x1b4e1c(0x1a8))/0x3*(parseInt(_0x1b4e1c(0x1a1))/0x4)+parseInt(_0x1b4e1c(0x19e))/0x5+-parseInt(_0x1b4e1c(0x1ac))/0x6*(-parseInt(_0x1b4e1c(0x1a2))/0x7)+parseInt(_0x1b4e1c(0x19d))/0x8+parseInt(_0x1b4e1c(0x1a5))/0x9+-parseInt(_0x1b4e1c(0x1ab))/0xa*(parseInt(_0x1b4e1c(0x1a4))/0xb);if(_0x428af9===_0x2008da)break;else _0x2ec167['push'](_0x2ec167['shift']());}catch(_0x1b42b1){_0x2ec167['push'](_0x2ec167['shift']());}}}(a204_0x262c,0x38428));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a204_0x262c(){const _0x56e89b=['10Urvnqm','48RxJRlG','write','574600xGNWSn','19680VwFIBE','App\x20profile\x20name\x20to\x20remove','12cxzIuT','212UQpswQ','284977PPBUXw','name','2613391iocAIT','4078917PZNwla','remove','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','3039vXxvGr','55492oiigkk','workspace\x20remove'];a204_0x262c=function(){return _0x56e89b;};return a204_0x262c();}export const workspaceRemoveDefinition={'service':'workspace','command':a204_0x4305c7(0x1a6),'description':a204_0x4305c7(0x1a7),'risk':a204_0x4305c7(0x19c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a204_0x4305c7(0x1a3),'description':a204_0x4305c7(0x19f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3bfdf9=>validateAppName(_0x3bfdf9,'workspace\x20remove'),'execute':_0x30287d=>runAppRemove(_0x30287d,a204_0x4305c7(0x1aa))};
1
+ function a204_0x3b6f(_0x30c4f5,_0xb0f2db){_0x30c4f5=_0x30c4f5-0x13c;const _0x530bbc=a204_0x530b();let _0x3b6f76=_0x530bbc[_0x30c4f5];return _0x3b6f76;}const a204_0x5599e4=a204_0x3b6f;function a204_0x530b(){const _0x417db6=['Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','355336dolKTL','1347430qHIcxF','6DAeqyV','81EsAgvL','11qIZtNK','14186VHmyVI','2916130bhElTl','46wxQOWG','1515997CSfjoq','workspace\x20remove','remove','App\x20profile\x20name\x20to\x20remove','564248ETPzlw','897264UUnjtq','3xqCSEp'];a204_0x530b=function(){return _0x417db6;};return a204_0x530b();}(function(_0x2c056b,_0x20de3c){const _0xce8231=a204_0x3b6f,_0x30c5f4=_0x2c056b();while(!![]){try{const _0x46664c=-parseInt(_0xce8231(0x140))/0x1*(parseInt(_0xce8231(0x142))/0x2)+-parseInt(_0xce8231(0x149))/0x3*(parseInt(_0xce8231(0x14b))/0x4)+parseInt(_0xce8231(0x13c))/0x5+-parseInt(_0xce8231(0x13d))/0x6*(-parseInt(_0xce8231(0x143))/0x7)+parseInt(_0xce8231(0x147))/0x8*(parseInt(_0xce8231(0x13e))/0x9)+-parseInt(_0xce8231(0x141))/0xa*(parseInt(_0xce8231(0x13f))/0xb)+-parseInt(_0xce8231(0x148))/0xc;if(_0x46664c===_0x20de3c)break;else _0x30c5f4['push'](_0x30c5f4['shift']());}catch(_0x1006a7){_0x30c5f4['push'](_0x30c5f4['shift']());}}}(a204_0x530b,0x52d8b));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a204_0x5599e4(0x145),'description':a204_0x5599e4(0x14a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a204_0x5599e4(0x146),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x42f167=>validateAppName(_0x42f167,'workspace\x20remove'),'execute':_0x51b44f=>runAppRemove(_0x51b44f,a204_0x5599e4(0x144))};
@@ -1 +1 @@
1
- const a205_0x2a2608=a205_0x3536;(function(_0x1fe300,_0xc51b32){const _0xb22d81=a205_0x3536,_0x203104=_0x1fe300();while(!![]){try{const _0x78544b=-parseInt(_0xb22d81(0x1c9))/0x1+-parseInt(_0xb22d81(0x1bc))/0x2*(-parseInt(_0xb22d81(0x1cc))/0x3)+parseInt(_0xb22d81(0x1d7))/0x4*(-parseInt(_0xb22d81(0x1b4))/0x5)+parseInt(_0xb22d81(0x1d5))/0x6*(parseInt(_0xb22d81(0x1c7))/0x7)+parseInt(_0xb22d81(0x1bb))/0x8*(parseInt(_0xb22d81(0x1d3))/0x9)+parseInt(_0xb22d81(0x1c8))/0xa+-parseInt(_0xb22d81(0x1c2))/0xb;if(_0x78544b===_0xc51b32)break;else _0x203104['push'](_0x203104['shift']());}catch(_0x40d601){_0x203104['push'](_0x203104['shift']());}}}(a205_0x11e4,0x970b1));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';function a205_0x11e4(){const _0x35924d=['3640VhVlHR','Default\x20page\x20size','inherit','length','Access\x20key','format','apiDir','riskLevel','2545yYAimc','accessKey','cookie','Config\x20key\x20(','app','en-US','locale','9242536xvtQgN','567718HapnLW','zh-CN','map','has','Locale','entries','7817458avhBeA','Auth\x20cookie','toLowerCase','env','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','7QiQQKz','4895730igDeDa','918185DdgzGe','apps','defaultApp','3yoXVZh','Target\x20environment','API\x20directory\x20path','string','filter','pageSize','keys','9FegoTU','appcode','4691862weKlNf','Risk\x20level'];a205_0x11e4=function(){return _0x35924d;};return a205_0x11e4();}export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a205_0x2a2608(0x1b5),a205_0x2a2608(0x1ba),a205_0x2a2608(0x1dc),a205_0x2a2608(0x1de)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x2a2608(0x1d4),a205_0x2a2608(0x1c5),a205_0x2a2608(0x1ba),'format',a205_0x2a2608(0x1b6),a205_0x2a2608(0x1b5),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5c72c0){return[..._0x5c72c0]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x183985){const _0x29e9fd=a205_0x2a2608;return TOP_LEVEL_CONFIG_KEYS[_0x29e9fd(0x1bf)](_0x183985);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}function a205_0x3536(_0xb17dc6,_0x2a7a89){_0xb17dc6=_0xb17dc6-0x1b4;const _0x11e494=a205_0x11e4();let _0x3536f0=_0x11e494[_0xb17dc6];return _0x3536f0;}export function getConfigCommandKeyDescription(){const _0x50b102=a205_0x2a2608;return _0x50b102(0x1b7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a205_0x2a2608(0x1c5),'apiDir':a205_0x2a2608(0x1dd),'cookie':a205_0x2a2608(0x1b6),'accessKey':'accessKey','defaultFormat':a205_0x2a2608(0x1dc),'pageSize':a205_0x2a2608(0x1d1),'riskLevel':a205_0x2a2608(0x1de),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x59d973=a205_0x2a2608;return[{'name':_0x59d973(0x1c5),'type':'string','description':_0x59d973(0x1cd),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x59d973(0x1dd),'type':'string','description':_0x59d973(0x1ce)},{'name':_0x59d973(0x1b6),'type':'string','description':_0x59d973(0x1c3),'hidden':!![]},{'name':_0x59d973(0x1b5),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1db),'hidden':!![]},{'name':'defaultFormat','type':_0x59d973(0x1cf),'description':_0x59d973(0x1c6),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x59d973(0x1d1),'type':'number','description':_0x59d973(0x1d8)},{'name':_0x59d973(0x1de),'type':'string','description':_0x59d973(0x1d6),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x59d973(0x1ba),'type':_0x59d973(0x1cf),'description':_0x59d973(0x1c0)}];}export function collectAppProfileOverrides(_0x2ca2e3){const _0x259120=a205_0x2a2608,_0x25f20c={};for(const [_0x1716d6,_0x5adf94]of Object[_0x259120(0x1c1)](APP_PROFILE_FLAG_KEY_MAP)){const _0x31bb11=_0x2ca2e3(_0x1716d6);if(!_0x31bb11)continue;_0x25f20c[_0x5adf94]=_0x5adf94==='pageSize'?Number(_0x31bb11):_0x31bb11;}return _0x25f20c;}export function buildAppProfileListFields(_0x5aa890){const _0x4d1c78=a205_0x2a2608;return{'env':_0x5aa890[_0x4d1c78(0x1c5)]??null,'apiDir':_0x5aa890['apiDir']??null,'hasCookie':!!_0x5aa890[_0x4d1c78(0x1b6)],'hasAccessKey':!!_0x5aa890[_0x4d1c78(0x1b5)],'format':_0x5aa890[_0x4d1c78(0x1dc)]??null,'pageSize':_0x5aa890['pageSize']??null,'riskLevel':_0x5aa890[_0x4d1c78(0x1de)]??null,'locale':_0x5aa890[_0x4d1c78(0x1ba)]??null};}export function buildAppDoctorFields(_0x44d971,_0x273efc){const _0x26b04=a205_0x2a2608;return{'env':{'value':_0x44d971[_0x26b04(0x1c5)]||_0x273efc[_0x26b04(0x1c5)],'source':_0x44d971[_0x26b04(0x1c5)]?'app':'inherit'},'apiDir':{'value':_0x44d971[_0x26b04(0x1dd)]||_0x273efc[_0x26b04(0x1dd)],'source':_0x44d971['apiDir']?_0x26b04(0x1b8):_0x26b04(0x1d9)},'cookie':{'value':_0x44d971['cookie']||_0x273efc[_0x26b04(0x1b6)],'source':_0x44d971['cookie']?'app':'inherit'},'accessKey':{'value':_0x44d971['accessKey']||_0x273efc['accessKey'],'source':_0x44d971[_0x26b04(0x1b5)]?_0x26b04(0x1b8):_0x26b04(0x1d9)}};}export function buildCanonicalAppConfig(_0x571b2f,_0x2d6d72){const _0x5f2537=a205_0x2a2608,_0x4596d7=_0x571b2f[_0x5f2537(0x1be)](_0x5ccda8=>String(_0x5ccda8||'')['trim']())[_0x5f2537(0x1d0)](Boolean);if(_0x4596d7[_0x5f2537(0x1da)]===0x0)return{};const _0x1afac3={};for(const _0x129dda of _0x4596d7){_0x1afac3[_0x129dda]=_0x2d6d72?{'appcode':_0x129dda,'env':_0x2d6d72}:{'appcode':_0x129dda};}return{'apps':_0x1afac3,'defaultApp':_0x4596d7[0x0]};}export function buildCanonicalProjectConfig(_0x5d558c,_0x5acb6d){const _0x5a44ae=a205_0x2a2608,{appCodes:appCodes=[],env:_0x399f8a,metadata:_0x25d2c2}=_0x5acb6d,_0x3e81c4={..._0x5d558c,..._0x25d2c2||{}};delete _0x3e81c4['appcode'],delete _0x3e81c4['app'];if(_0x399f8a)_0x3e81c4[_0x5a44ae(0x1c5)]=_0x399f8a;else!_0x3e81c4[_0x5a44ae(0x1c5)]&&(_0x3e81c4[_0x5a44ae(0x1c5)]=DEFAULT_CONFIG_VALUES[_0x5a44ae(0x1c5)]);const _0x25f350=buildCanonicalAppConfig(appCodes,_0x3e81c4[_0x5a44ae(0x1c5)]);return Object[_0x5a44ae(0x1d2)](_0x25f350)[_0x5a44ae(0x1da)]>0x0&&(_0x3e81c4[_0x5a44ae(0x1ca)]=_0x25f350[_0x5a44ae(0x1ca)],_0x3e81c4[_0x5a44ae(0x1cb)]=_0x25f350[_0x5a44ae(0x1cb)]),_0x3e81c4;}const LOCALE_MAP={'zh':a205_0x2a2608(0x1bd),'zh-cn':'zh-CN','zh_cn':a205_0x2a2608(0x1bd),'en':'en-US','en-us':'en-US','en_us':a205_0x2a2608(0x1b9)};export function normalizeLocale(_0x4ab4e2){const _0x7fc565=a205_0x2a2608;if(!_0x4ab4e2)return null;return LOCALE_MAP[_0x4ab4e2[_0x7fc565(0x1c4)]()]??null;}
1
+ function a205_0x81df(_0x51ff7e,_0x28be6b){_0x51ff7e=_0x51ff7e-0x16d;const _0xa85fd9=a205_0xa85f();let _0x81df4c=_0xa85fd9[_0x51ff7e];return _0x81df4c;}const a205_0x17eed4=a205_0x81df;(function(_0x57cc77,_0x86b96c){const _0x1a8e7e=a205_0x81df,_0xaeeb65=_0x57cc77();while(!![]){try{const _0xaf630=-parseInt(_0x1a8e7e(0x188))/0x1+parseInt(_0x1a8e7e(0x186))/0x2*(parseInt(_0x1a8e7e(0x183))/0x3)+-parseInt(_0x1a8e7e(0x177))/0x4*(parseInt(_0x1a8e7e(0x17e))/0x5)+parseInt(_0x1a8e7e(0x17f))/0x6+-parseInt(_0x1a8e7e(0x180))/0x7+-parseInt(_0x1a8e7e(0x173))/0x8+parseInt(_0x1a8e7e(0x17c))/0x9;if(_0xaf630===_0x86b96c)break;else _0xaeeb65['push'](_0xaeeb65['shift']());}catch(_0x4cccdb){_0xaeeb65['push'](_0xaeeb65['shift']());}}}(a205_0xa85f,0xe29d3));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=[a205_0x17eed4(0x185),'accessKey',a205_0x17eed4(0x174),'format','riskLevel'];export const TOP_LEVEL_CONFIG_KEYS=new Set([a205_0x17eed4(0x18c),a205_0x17eed4(0x16e),a205_0x17eed4(0x174),'format',a205_0x17eed4(0x185),a205_0x17eed4(0x178),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x583ee1){const _0x185695=a205_0x17eed4;return[..._0x583ee1][_0x185695(0x18a)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x2c9ff7){const _0x494051=a205_0x17eed4;return TOP_LEVEL_CONFIG_KEYS[_0x494051(0x187)](_0x2c9ff7);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x3f7f7e=a205_0x17eed4;return _0x3f7f7e(0x193)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a205_0x17eed4(0x18f),'cookie':a205_0x17eed4(0x185),'accessKey':a205_0x17eed4(0x178),'defaultFormat':'format','pageSize':a205_0x17eed4(0x170),'riskLevel':a205_0x17eed4(0x181),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x5b10c2=a205_0x17eed4;return[{'name':'env','type':_0x5b10c2(0x171),'description':_0x5b10c2(0x16d),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':_0x5b10c2(0x171),'description':'API\x20directory\x20path'},{'name':_0x5b10c2(0x185),'type':_0x5b10c2(0x171),'description':_0x5b10c2(0x17d),'hidden':!![]},{'name':_0x5b10c2(0x178),'type':_0x5b10c2(0x171),'description':_0x5b10c2(0x172),'hidden':!![]},{'name':_0x5b10c2(0x175),'type':_0x5b10c2(0x171),'description':_0x5b10c2(0x16f),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x5b10c2(0x170),'type':_0x5b10c2(0x189),'description':'Default\x20page\x20size'},{'name':_0x5b10c2(0x181),'type':'string','description':_0x5b10c2(0x18e),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':_0x5b10c2(0x176)}];}export function collectAppProfileOverrides(_0xb76a1c){const _0x242abf=a205_0x17eed4,_0x2c12bd={};for(const [_0x4b7393,_0x4da7c3]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x3b1c99=_0xb76a1c(_0x4b7393);if(!_0x3b1c99)continue;_0x2c12bd[_0x4da7c3]=_0x4da7c3===_0x242abf(0x170)?Number(_0x3b1c99):_0x3b1c99;}return _0x2c12bd;}export function buildAppProfileListFields(_0x320364){const _0x3588d0=a205_0x17eed4;return{'env':_0x320364['env']??null,'apiDir':_0x320364['apiDir']??null,'hasCookie':!!_0x320364[_0x3588d0(0x185)],'hasAccessKey':!!_0x320364[_0x3588d0(0x178)],'format':_0x320364[_0x3588d0(0x179)]??null,'pageSize':_0x320364['pageSize']??null,'riskLevel':_0x320364[_0x3588d0(0x181)]??null,'locale':_0x320364[_0x3588d0(0x174)]??null};}export function buildAppDoctorFields(_0xea70f0,_0x6daf05){const _0x392c09=a205_0x17eed4;return{'env':{'value':_0xea70f0[_0x392c09(0x16e)]||_0x6daf05[_0x392c09(0x16e)],'source':_0xea70f0[_0x392c09(0x16e)]?_0x392c09(0x17a):_0x392c09(0x18b)},'apiDir':{'value':_0xea70f0[_0x392c09(0x18f)]||_0x6daf05[_0x392c09(0x18f)],'source':_0xea70f0['apiDir']?_0x392c09(0x17a):_0x392c09(0x18b)},'cookie':{'value':_0xea70f0[_0x392c09(0x185)]||_0x6daf05[_0x392c09(0x185)],'source':_0xea70f0[_0x392c09(0x185)]?_0x392c09(0x17a):_0x392c09(0x18b)},'accessKey':{'value':_0xea70f0['accessKey']||_0x6daf05[_0x392c09(0x178)],'source':_0xea70f0[_0x392c09(0x178)]?_0x392c09(0x17a):_0x392c09(0x18b)}};}export function buildCanonicalAppConfig(_0xd56520,_0x3b039c){const _0x1d7bce=a205_0x17eed4,_0x3a4b0=_0xd56520['map'](_0x129e3c=>String(_0x129e3c||'')[_0x1d7bce(0x184)]())[_0x1d7bce(0x190)](Boolean);if(_0x3a4b0[_0x1d7bce(0x191)]===0x0)return{};const _0x222624={};for(const _0x26d99b of _0x3a4b0){_0x222624[_0x26d99b]=_0x3b039c?{'appcode':_0x26d99b,'env':_0x3b039c}:{'appcode':_0x26d99b};}return{'apps':_0x222624,'defaultApp':_0x3a4b0[0x0]};}export function buildCanonicalProjectConfig(_0x457056,_0x4a1fd6){const _0xf0311d=a205_0x17eed4,{appCodes:appCodes=[],env:_0x320141,metadata:_0xe832af}=_0x4a1fd6,_0xfc0fa9={..._0x457056,..._0xe832af||{}};delete _0xfc0fa9[_0xf0311d(0x18c)],delete _0xfc0fa9[_0xf0311d(0x17a)];if(_0x320141)_0xfc0fa9['env']=_0x320141;else!_0xfc0fa9[_0xf0311d(0x16e)]&&(_0xfc0fa9['env']=DEFAULT_CONFIG_VALUES[_0xf0311d(0x16e)]);const _0xed0bd5=buildCanonicalAppConfig(appCodes,_0xfc0fa9[_0xf0311d(0x16e)]);return Object['keys'](_0xed0bd5)['length']>0x0&&(_0xfc0fa9['apps']=_0xed0bd5['apps'],_0xfc0fa9[_0xf0311d(0x17b)]=_0xed0bd5[_0xf0311d(0x17b)]),_0xfc0fa9;}const LOCALE_MAP={'zh':a205_0x17eed4(0x192),'zh-cn':a205_0x17eed4(0x192),'zh_cn':a205_0x17eed4(0x192),'en':a205_0x17eed4(0x18d),'en-us':a205_0x17eed4(0x18d),'en_us':a205_0x17eed4(0x18d)};export function normalizeLocale(_0x4b4d2b){const _0x436875=a205_0x17eed4;if(!_0x4b4d2b)return null;return LOCALE_MAP[_0x4b4d2b[_0x436875(0x182)]()]??null;}function a205_0xa85f(){const _0x49d45e=['filter','length','zh-CN','Config\x20key\x20(','Target\x20environment','env','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','pageSize','string','Access\x20key','861376EACNTD','locale','defaultFormat','Locale','29584MHcNdS','accessKey','format','app','defaultApp','32626467ENckWa','Auth\x20cookie','815mlvGjD','1877940Fknjws','9692032OQhBTR','riskLevel','toLowerCase','753baFPLd','trim','cookie','4504IXWiiJ','has','877398OuGRNQ','number','join','inherit','appcode','en-US','Risk\x20level','apiDir'];a205_0xa85f=function(){return _0x49d45e;};return a205_0xa85f();}
@@ -1 +1 @@
1
- const a206_0x34f8c9=a206_0x141c;(function(_0x52517b,_0x224fdb){const _0x354846=a206_0x141c,_0x2f4c52=_0x52517b();while(!![]){try{const _0x34d7c7=-parseInt(_0x354846(0x105))/0x1*(parseInt(_0x354846(0xfb))/0x2)+-parseInt(_0x354846(0xf6))/0x3*(parseInt(_0x354846(0xfe))/0x4)+-parseInt(_0x354846(0x101))/0x5*(parseInt(_0x354846(0xfa))/0x6)+-parseInt(_0x354846(0x100))/0x7*(parseInt(_0x354846(0xff))/0x8)+-parseInt(_0x354846(0x103))/0x9*(parseInt(_0x354846(0xf8))/0xa)+parseInt(_0x354846(0xf7))/0xb+-parseInt(_0x354846(0xf9))/0xc*(-parseInt(_0x354846(0xfc))/0xd);if(_0x34d7c7===_0x224fdb)break;else _0x2f4c52['push'](_0x2f4c52['shift']());}catch(_0x352a1e){_0x2f4c52['push'](_0x2f4c52['shift']());}}}(a206_0x21bd,0x2d110));export const RABETBASE_CDN_BASE_URL=a206_0x34f8c9(0x104);export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0xfd);function a206_0x21bd(){const _0x46cac1=['27339bHypzu','87UeLsAq','2995553CtouAQ','5410gDTaJT','76872BbDXdu','216DuxlGy','2IFeSpa','1703yQUooM','/config/index.json','37740jzRDYL','24zpqENA','558033oTBtEX','27725oaXTkX','/templates/projects','3114DQATOR','https://g.lovrabet.com/dist/rabetbase-cli'];a206_0x21bd=function(){return _0x46cac1;};return a206_0x21bd();}function a206_0x141c(_0x2d5dde,_0x1d8598){_0x2d5dde=_0x2d5dde-0xf6;const _0x21bdc0=a206_0x21bd();let _0x141c53=_0x21bdc0[_0x2d5dde];return _0x141c53;}export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x34f8c9(0x102);
1
+ function a206_0x5cc2(){const _0x4f04d8=['/templates/projects','1784VIOlNk','https://g.lovrabet.com/dist/rabetbase-cli','1002130byLDDw','124329aIKcsP','3292436RnOUDL','6pHCVlg','81474vHpwQh','634488UKBqAK','7911aqBtzK','2990130OJPVqJ','/config/index.json','2KHjvkW'];a206_0x5cc2=function(){return _0x4f04d8;};return a206_0x5cc2();}const a206_0x193cbf=a206_0x1d6e;(function(_0x4e337c,_0xb78ebf){const _0x50f926=a206_0x1d6e,_0x5d0fca=_0x4e337c();while(!![]){try{const _0x50fcb5=parseInt(_0x50f926(0x10c))/0x1+parseInt(_0x50f926(0x104))/0x2*(-parseInt(_0x50f926(0x109))/0x3)+-parseInt(_0x50f926(0x100))/0x4+parseInt(_0x50f926(0x108))/0x5*(-parseInt(_0x50f926(0x10b))/0x6)+parseInt(_0x50f926(0x10a))/0x7+-parseInt(_0x50f926(0x106))/0x8*(parseInt(_0x50f926(0x101))/0x9)+parseInt(_0x50f926(0x102))/0xa;if(_0x50fcb5===_0xb78ebf)break;else _0x5d0fca['push'](_0x5d0fca['shift']());}catch(_0x3a0a53){_0x5d0fca['push'](_0x5d0fca['shift']());}}}(a206_0x5cc2,0x3e177));export const RABETBASE_CDN_BASE_URL=a206_0x193cbf(0x107);function a206_0x1d6e(_0x5928a6,_0xe62bca){_0x5928a6=_0x5928a6-0x100;const _0x5cc2a3=a206_0x5cc2();let _0x1d6e44=_0x5cc2a3[_0x5928a6];return _0x1d6e44;}export const CLI_VERSION_POLICY_URL=RABETBASE_CDN_BASE_URL+a206_0x193cbf(0x103);export const PROJECT_TEMPLATE_ASSET_BASE_URL=RABETBASE_CDN_BASE_URL+a206_0x193cbf(0x105);