@lovrabet/rabetbase-cli 2.5.0-beta.5 → 2.5.0

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 (294) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/delete.js +1 -1
  53. package/lib/commands/config/get.js +1 -1
  54. package/lib/commands/config/index.js +1 -1
  55. package/lib/commands/config/init.js +1 -1
  56. package/lib/commands/config/list.js +1 -1
  57. package/lib/commands/config/set.js +1 -1
  58. package/lib/commands/config/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/business-groups.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff-refresh-start.js +1 -1
  87. package/lib/commands/db/diff-refresh-status.js +1 -1
  88. package/lib/commands/db/diff.js +1 -1
  89. package/lib/commands/db/index.js +1 -1
  90. package/lib/commands/db/list.js +1 -1
  91. package/lib/commands/db/shared.js +1 -1
  92. package/lib/commands/db/table-diff-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/issue/index.js +1 -1
  99. package/lib/commands/issue/nudge.js +1 -1
  100. package/lib/commands/issue/report.js +1 -1
  101. package/lib/commands/issue/shared.js +1 -1
  102. package/lib/commands/kb/create.js +1 -1
  103. package/lib/commands/kb/delete.js +1 -1
  104. package/lib/commands/kb/detail.js +1 -1
  105. package/lib/commands/kb/index.js +1 -1
  106. package/lib/commands/kb/list.js +1 -1
  107. package/lib/commands/kb/search.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/menu/visibility-update.js +1 -1
  136. package/lib/commands/notification/config-create.js +1 -1
  137. package/lib/commands/notification/config-delete.js +1 -1
  138. package/lib/commands/notification/config-list.js +1 -1
  139. package/lib/commands/notification/config-update.js +1 -1
  140. package/lib/commands/notification/index.js +1 -1
  141. package/lib/commands/notification/shared.js +1 -1
  142. package/lib/commands/ocr/index.js +1 -1
  143. package/lib/commands/page/create.js +1 -1
  144. package/lib/commands/page/custom/detail.js +1 -1
  145. package/lib/commands/page/custom/list.js +1 -1
  146. package/lib/commands/page/custom/publish.js +1 -1
  147. package/lib/commands/page/custom/shared.js +1 -1
  148. package/lib/commands/page/custom/syntax.js +1 -1
  149. package/lib/commands/page/custom/template.js +1 -1
  150. package/lib/commands/page/custom/update.js +1 -1
  151. package/lib/commands/page/data-list-status.js +1 -1
  152. package/lib/commands/page/generate-start.js +1 -1
  153. package/lib/commands/page/generate-status.js +1 -1
  154. package/lib/commands/page/index.js +1 -1
  155. package/lib/commands/page/pull.js +1 -1
  156. package/lib/commands/page/push.js +1 -1
  157. package/lib/commands/page/relation-audit.js +1 -1
  158. package/lib/commands/page/restore.js +1 -1
  159. package/lib/commands/page/shared.js +1 -1
  160. package/lib/commands/page/sync.js +1 -1
  161. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  162. package/lib/commands/project/create/format-elapsed.js +1 -1
  163. package/lib/commands/project/create/main.js +1 -1
  164. package/lib/commands/project/create/materialize-project-template.js +1 -1
  165. package/lib/commands/project/create/project-name.js +1 -1
  166. package/lib/commands/project/create/project-template-archive.js +1 -1
  167. package/lib/commands/project/create/project-template-path.js +1 -1
  168. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  169. package/lib/commands/project/create/use-format-code.js +1 -1
  170. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  171. package/lib/commands/project/index.js +1 -1
  172. package/lib/commands/project/upgrade.js +1 -1
  173. package/lib/commands/registry.js +1 -1
  174. package/lib/commands/role/delete.js +1 -1
  175. package/lib/commands/role/detail.js +1 -1
  176. package/lib/commands/role/index.js +1 -1
  177. package/lib/commands/role/list.js +1 -1
  178. package/lib/commands/role/shared.js +1 -1
  179. package/lib/commands/role/update.js +1 -1
  180. package/lib/commands/role/user-add.js +1 -1
  181. package/lib/commands/role/user-remove.js +1 -1
  182. package/lib/commands/role/user-resolve.js +1 -1
  183. package/lib/commands/run/index.js +1 -1
  184. package/lib/commands/schema.js +1 -1
  185. package/lib/commands/sql/create.js +1 -1
  186. package/lib/commands/sql/delete.js +1 -1
  187. package/lib/commands/sql/detail.js +1 -1
  188. package/lib/commands/sql/exec.js +1 -1
  189. package/lib/commands/sql/index.js +1 -1
  190. package/lib/commands/sql/list.js +1 -1
  191. package/lib/commands/sql/pull.js +1 -1
  192. package/lib/commands/sql/push.js +1 -1
  193. package/lib/commands/sql/shared.js +1 -1
  194. package/lib/commands/sql/status.js +1 -1
  195. package/lib/commands/sql/validate.js +1 -1
  196. package/lib/commands/task/index.js +1 -1
  197. package/lib/commands/task/status.js +1 -1
  198. package/lib/commands/tenant/index.js +1 -1
  199. package/lib/commands/tenant/members-list.js +1 -1
  200. package/lib/commands/tenant/shared.js +1 -1
  201. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  202. package/lib/commands/user-account/index.js +1 -1
  203. package/lib/commands/workspace/add.js +1 -1
  204. package/lib/commands/workspace/index.js +1 -1
  205. package/lib/commands/workspace/remove.js +1 -1
  206. package/lib/config/domain-config.js +1 -1
  207. package/lib/config/schema.js +1 -1
  208. package/lib/constant/cdn.js +1 -1
  209. package/lib/constant/cli.js +1 -1
  210. package/lib/constant/defaults.js +1 -1
  211. package/lib/constant/domain.js +1 -1
  212. package/lib/constant/env.js +1 -1
  213. package/lib/constant/output.js +1 -1
  214. package/lib/constant/paths.js +1 -1
  215. package/lib/constant/region.js +1 -1
  216. package/lib/constant/risk.js +1 -1
  217. package/lib/context/app-resolver.js +1 -1
  218. package/lib/context/auth-resolver.js +1 -1
  219. package/lib/context/config-loader.js +1 -1
  220. package/lib/context.js +1 -1
  221. package/lib/core/alias-resolver.js +1 -1
  222. package/lib/core/api-client.js +1 -1
  223. package/lib/core/bff/config.js +1 -1
  224. package/lib/core/bff/file-system.js +1 -1
  225. package/lib/core/bff/hash.js +1 -1
  226. package/lib/core/bff/lock.js +1 -1
  227. package/lib/core/bff/utils.js +1 -1
  228. package/lib/core/db-resolver.js +1 -1
  229. package/lib/core/page/file-system.js +1 -1
  230. package/lib/core/page/hash.js +1 -1
  231. package/lib/core/page/lock.js +1 -1
  232. package/lib/core/sql-index-auditor.js +1 -1
  233. package/lib/core/sql-sync/config.js +1 -1
  234. package/lib/core/sql-sync/file-system.js +1 -1
  235. package/lib/core/sql-sync/hash.js +1 -1
  236. package/lib/core/sql-sync/lock.js +1 -1
  237. package/lib/core/sql-sync/utils.js +1 -1
  238. package/lib/core/sql-validator.js +1 -1
  239. package/lib/errors.js +1 -1
  240. package/lib/framework/build-all-flags.js +1 -1
  241. package/lib/framework/error-output.js +1 -1
  242. package/lib/framework/explicit-yes.js +1 -1
  243. package/lib/framework/flags.js +1 -1
  244. package/lib/framework/help.js +1 -1
  245. package/lib/framework/index.js +1 -1
  246. package/lib/framework/output.js +1 -1
  247. package/lib/framework/response.js +1 -1
  248. package/lib/framework/runner-alias.js +1 -1
  249. package/lib/framework/runner.js +1 -1
  250. package/lib/framework/schema-export.js +1 -1
  251. package/lib/framework/types.js +1 -1
  252. package/lib/generated/build-info.d.ts +4 -4
  253. package/lib/generated/build-info.js +1 -1
  254. package/lib/help.js +1 -1
  255. package/lib/postinstall.js +1 -1
  256. package/lib/runtime/confirmation.js +1 -1
  257. package/lib/runtime/event.js +1 -1
  258. package/lib/runtime/index.js +1 -1
  259. package/lib/runtime/queue.js +1 -1
  260. package/lib/runtime/resolve.js +1 -1
  261. package/lib/skills/builtin-skill.js +1 -1
  262. package/lib/skills/main.js +1 -1
  263. package/lib/skills/npx-skills-add.js +1 -1
  264. package/lib/skills/skill-presence.js +1 -1
  265. package/lib/telemetry/cli-command-trace.js +1 -1
  266. package/lib/telemetry/cli-help-trace.js +1 -1
  267. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  268. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  269. package/lib/telemetry/send-cli-trace-log.js +1 -1
  270. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  271. package/lib/utils/ai_config.js +1 -1
  272. package/lib/utils/apply-jq-filter.js +1 -1
  273. package/lib/utils/cdn-config.js +1 -1
  274. package/lib/utils/check-sdk-version.js +1 -1
  275. package/lib/utils/cli-version-check.js +1 -1
  276. package/lib/utils/cli-version-policy.js +1 -1
  277. package/lib/utils/config.js +1 -1
  278. package/lib/utils/entity-with-id.js +1 -1
  279. package/lib/utils/file-utils.js +1 -1
  280. package/lib/utils/guides-cdn.js +1 -1
  281. package/lib/utils/http-client.js +1 -1
  282. package/lib/utils/is-non-interactive.js +1 -1
  283. package/lib/utils/logger.js +1 -1
  284. package/lib/utils/params.js +1 -1
  285. package/lib/utils/platform.js +1 -1
  286. package/lib/utils/sleep.js +1 -1
  287. package/lib/utils/template-replacer.js +1 -1
  288. package/lib/utils/update-notice.js +1 -1
  289. package/lib/utils/version.js +1 -1
  290. package/lib/utils/with-active-cookie.js +1 -1
  291. package/lib/utils/write-cli-side-channel.js +1 -1
  292. package/package.json +1 -1
  293. package/skills/rabetbase/SKILL.md +2 -2
  294. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a192_0x1c918f=a192_0x469e;(function(_0x2c7e8a,_0x143285){const _0x11d916=a192_0x469e,_0x462502=_0x2c7e8a();while(!![]){try{const _0x529ef7=-parseInt(_0x11d916(0xd0))/0x1+-parseInt(_0x11d916(0xcd))/0x2*(parseInt(_0x11d916(0xcb))/0x3)+-parseInt(_0x11d916(0xd7))/0x4+parseInt(_0x11d916(0xb1))/0x5*(-parseInt(_0x11d916(0xa5))/0x6)+-parseInt(_0x11d916(0xd5))/0x7*(-parseInt(_0x11d916(0xd2))/0x8)+-parseInt(_0x11d916(0xb2))/0x9*(parseInt(_0x11d916(0xc0))/0xa)+-parseInt(_0x11d916(0xd1))/0xb*(-parseInt(_0x11d916(0xbd))/0xc);if(_0x529ef7===_0x143285)break;else _0x462502['push'](_0x462502['shift']());}catch(_0x508807){_0x462502['push'](_0x462502['shift']());}}}(a192_0x32c2,0xa83a4));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 a192_0x469e(_0x564dc3,_0x212258){_0x564dc3=_0x564dc3-0x9b;const _0x32c2cc=a192_0x32c2();let _0x469ee2=_0x32c2cc[_0x564dc3];return _0x469ee2;}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';function a192_0x32c2(){const _0x972d46=['Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','bool','\x20skipped,\x20','156CEnnqL','mode','unchanged','492880QUOyDC','filter','get','map','write','/smartapi/custom/updateUserCustomSql','sqlCode','toISOString','set','dbName','Local\x20SQL\x20not\x20found:\x20','1965HFxtkn','exec','2594FhfCwW','dbId','\x20pushed,\x20','192036UyGvVB','2900711BlolsL','541752urUEkY','Push\x20complete:\x20','trashDir','28AQYXPL','sqlRoot','223604HYYzyK','utf8','message','relativePath','filePath','push','path','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','remoteId','sqlConfig','join','sqlRootDir','startsWith','force','Would\x20push\x20','sqlcode','catch','entries','45726CaFpnF','hash','has','Push\x20local\x20SQL\x20files\x20to\x20remote','lastSync','length','boolean','No\x20local\x20SQL\x20files\x20found.','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','appCode','lockFilePath','validation','705vlhLPS','153AePlVn','version','Local\x20directory\x20\x22','\x20failed','sqls','isFinite','str','sqlName'];a192_0x32c2=function(){return _0x972d46;};return a192_0x32c2();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x4eb643,_0x33cf80,_0x359310){const _0x128a81=a192_0x469e,_0x1dedb0=await scanLocalSqlQueries(_0x4eb643),_0x1694ad=new Map();for(const _0x507a73 of _0x1dedb0){if(_0x359310&&_0x507a73[_0x128a81(0xc6)]!==_0x359310)continue;const _0x320a8d=_0x1694ad[_0x128a81(0xc2)](_0x507a73['sqlCode'])??[];_0x320a8d['push'](_0x507a73),_0x1694ad[_0x128a81(0xc8)](_0x507a73[_0x128a81(0xc6)],_0x320a8d);}if(_0x359310&&!_0x1694ad[_0x128a81(0xa7)](_0x359310))throw CliErrors[_0x128a81(0xb0)](_0x128a81(0xca)+_0x359310);const _0xc21f42=[];for(const [_0x58b599,_0x50718e]of _0x1694ad[_0x128a81(0xa4)]()){if(_0x50718e[_0x128a81(0xaa)]===0x1){_0xc21f42[_0x128a81(0xdc)](_0x50718e[0x0]);continue;}const _0x2b183c=_0x33cf80[_0x128a81(0xb6)][_0x58b599],_0x3fdc25=_0x2b183c?.['path'],_0x7d1a4f=_0x3fdc25?_0x50718e[_0x128a81(0xc1)](_0x500c78=>_0x500c78[_0x128a81(0xda)]!==_0x3fdc25):_0x50718e;if(_0x2b183c&&_0x7d1a4f[_0x128a81(0xaa)]===0x1){_0xc21f42[_0x128a81(0xdc)](_0x7d1a4f[0x0]);continue;}throw CliErrors['validation'](_0x128a81(0xad)+_0x58b599+_0x128a81(0xde));}return _0xc21f42;}export const sqlPush={'service':'sql','command':a192_0x1c918f(0xdc),'description':a192_0x1c918f(0xa8),'risk':a192_0x1c918f(0xc4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a192_0x1c918f(0xab),'description':a192_0x1c918f(0xba)}],async 'dryRun'(_0x7c9afb){const _0x1d8c85=a192_0x1c918f,_0x17c592=loadSqlProjectConfig(_0x7c9afb[_0x1d8c85(0xae)]),_0x44bc71=await readSqlLockFile(_0x17c592[_0x1d8c85(0xaf)]),{appLock:_0x353e16}=ensureSqlLockScope(_0x44bc71??createEmptySqlLock(),_0x7c9afb['appCode'],_0x17c592[_0x1d8c85(0xd6)],_0x1d8c85(0xdc)),_0x5038e9=await getTargetSqlQueries(_0x17c592,_0x353e16,_0x7c9afb[_0x1d8c85(0xb8)]('sqlcode')||undefined),_0xcf6864=[];for(const _0x270e28 of _0x5038e9){const _0x336283=await computeSqlFileHash(_0x270e28[_0x1d8c85(0xdb)]),_0x5e8757=_0x353e16[_0x1d8c85(0xb6)][_0x270e28[_0x1d8c85(0xc6)]],_0x18a8ce=!!_0x5e8757&&(_0x5e8757[_0x1d8c85(0xdd)]!==_0x270e28[_0x1d8c85(0xda)]||!!_0x270e28[_0x1d8c85(0xb9)]&&_0x5e8757['sqlName']!==_0x270e28['sqlName']);if(!_0x7c9afb[_0x1d8c85(0xbb)](_0x1d8c85(0xa0))&&_0x5e8757&&_0x5e8757[_0x1d8c85(0xa6)]===_0x336283&&!_0x18a8ce)continue;_0xcf6864[_0x1d8c85(0xdc)](_0x270e28['sqlCode']);}return{'method':'POST','url':_0x1d8c85(0xc5),'body':{'sqlCodes':_0xcf6864,'appCode':_0x7c9afb[_0x1d8c85(0xae)]},'description':_0x1d8c85(0xa1)+_0xcf6864[_0x1d8c85(0xaa)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x55554c){const _0x23c488=a192_0x1c918f,_0x2482bb=loadSqlProjectConfig(_0x55554c[_0x23c488(0xae)]),_0x1789bc=await readSqlLockFile(_0x2482bb[_0x23c488(0xaf)]),{lockData:_0x2c7944,appLock:_0x4b758a}=ensureSqlLockScope(_0x1789bc??createEmptySqlLock(),_0x55554c[_0x23c488(0xae)],_0x2482bb[_0x23c488(0xd6)],'push'),_0x49ad33=await getTargetSqlQueries(_0x2482bb,_0x4b758a,_0x55554c[_0x23c488(0xb8)](_0x23c488(0xa2))||undefined);if(_0x49ad33[_0x23c488(0xaa)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x23c488(0xac)};const _0x24e5be=[],_0x2ec8b3=[],_0x4da585=[];for(const _0x1a2659 of _0x49ad33){const _0x12feb3=_0x4b758a['sqls'][_0x1a2659[_0x23c488(0xc6)]];if(!_0x12feb3){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x235123=await computeSqlFileHash(_0x1a2659[_0x23c488(0xdb)]),_0x3dbfaf=_0x12feb3[_0x23c488(0xdd)]!==_0x1a2659[_0x23c488(0xda)]||!!_0x1a2659[_0x23c488(0xb9)]&&_0x12feb3['sqlName']!==_0x1a2659['sqlName'];if(!_0x55554c[_0x23c488(0xbb)](_0x23c488(0xa0))&&_0x12feb3[_0x23c488(0xa6)]===_0x235123&&!_0x3dbfaf){_0x2ec8b3['push']({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'reason':_0x23c488(0xbf)});continue;}if(_0x12feb3[_0x23c488(0xb3)]==null){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x3d933e=await readFile(_0x1a2659[_0x23c488(0xdb)],_0x23c488(0xd8)),_0x515952=stripLocalSqlMetadata(_0x3d933e,_0x1a2659[_0x23c488(0xbe)]),_0xae03bb=_0x1a2659[_0x23c488(0xb9)]||_0x12feb3[_0x23c488(0xb9)],_0x5d97e2=await resolveTargetDbBinding(_0x55554c[_0x23c488(0xae)],_0x1a2659,_0x12feb3),_0x1ccccf=await updateSqlQuery({'id':_0x12feb3[_0x23c488(0x9b)],'appCode':_0x55554c[_0x23c488(0xae)],'sqlCode':_0x1a2659[_0x23c488(0xc6)],'sqlName':_0xae03bb,'dbId':_0x5d97e2[_0x23c488(0xce)],'version':_0x12feb3[_0x23c488(0xb3)],'sqlContent':_0x515952,'sqlConfig':_0x12feb3[_0x23c488(0x9c)]??undefined}),_0x2cd8fa=_0x1ccccf[_0x23c488(0xce)]?await getDbName(_0x55554c[_0x23c488(0xae)],Number(_0x1ccccf['dbId']))['catch'](()=>_0x5d97e2[_0x23c488(0xc9)]):_0x5d97e2[_0x23c488(0xc9)];_0x4b758a['sqls'][_0x1a2659['sqlCode']]={...buildSqlLockEntry(_0x1ccccf,_0x515952,_0x235123,{'dbName':_0x2cd8fa}),'path':_0x1a2659[_0x23c488(0xda)],'mode':_0x12feb3[_0x23c488(0xbe)]},await archivePreviousSqlFileIfNeeded(_0x2482bb,_0x12feb3[_0x23c488(0xdd)],_0x1a2659[_0x23c488(0xda)]),_0x24e5be[_0x23c488(0xdc)]({'sqlCode':_0x1a2659['sqlCode'],'remoteId':_0x12feb3[_0x23c488(0x9b)]});}catch(_0x4db2b7){_0x4da585[_0x23c488(0xdc)]({'sqlCode':_0x1a2659[_0x23c488(0xc6)],'error':_0x4db2b7 instanceof Error?_0x4db2b7[_0x23c488(0xd9)]:String(_0x4db2b7)});}}return _0x4b758a[_0x23c488(0xa9)]=new Date()[_0x23c488(0xc7)](),await writeSqlLockFile(_0x2482bb[_0x23c488(0xaf)],_0x2c7944),{'ok':_0x4da585[_0x23c488(0xaa)]===0x0,'data':{'pushed':_0x24e5be,'skipped':_0x2ec8b3,'failed':_0x4da585},'message':_0x23c488(0xd3)+_0x24e5be[_0x23c488(0xaa)]+_0x23c488(0xcf)+_0x2ec8b3[_0x23c488(0xaa)]+_0x23c488(0xbc)+_0x4da585[_0x23c488(0xaa)]+_0x23c488(0xb5)};}};async function archivePreviousSqlFileIfNeeded(_0x4c42a4,_0x25404c,_0x24a3bd){const _0x4159ce=a192_0x1c918f;if(!_0x25404c||_0x25404c===_0x24a3bd)return;const _0x38d73b=join(_0x4c42a4[_0x4159ce(0x9e)],_0x25404c);if(!await fileExists(_0x38d73b))return;const _0x3b5d68=await moveToTrash(_0x4c42a4['projectRoot'],_0x4c42a4[_0x4159ce(0xd4)],_0x38d73b);await cleanupEmptyDirectories(dirname(_0x38d73b),_0x4c42a4[_0x4159ce(0x9e)]),void _0x3b5d68;}async function moveToTrash(_0x3e63f2,_0x170ae0,_0x160636){const _0x306463=a192_0x1c918f,_0x4484d4=new Date()[_0x306463(0xc7)]()['replace'](/[:.]/g,'-'),_0x17c3ec=relative(_0x3e63f2,_0x160636),_0x4a2b90=join(_0x170ae0,_0x4484d4,_0x17c3ec);return await mkdir(dirname(_0x4a2b90),{'recursive':!![]}),await rename(_0x160636,_0x4a2b90),_0x4a2b90;}async function cleanupEmptyDirectories(_0x17ba6f,_0x1ab24f){const _0x2e46e9=a192_0x1c918f;let _0x48f784=resolve(_0x17ba6f);const _0x1c895d=resolve(_0x1ab24f);while(_0x48f784[_0x2e46e9(0x9f)](''+_0x1c895d+sep)||_0x48f784===_0x1c895d){if(_0x48f784===_0x1c895d)return;try{const _0x100dc5=await readdir(_0x48f784);if(_0x100dc5['length']>0x0)return;await rmdir(_0x48f784);}catch{return;}_0x48f784=dirname(_0x48f784);}}async function resolveTargetDbBinding(_0x54ecc3,_0x478f15,_0x2155cd){const _0x3c1f26=a192_0x1c918f,_0x2912b9=_0x478f15['dbDirectory'];if(!_0x2912b9)return{'dbId':_0x2155cd[_0x3c1f26(0xce)],'dbName':_0x2155cd[_0x3c1f26(0xc9)]};const _0x21fe75=buildDbDirectoryName(_0x2155cd[_0x3c1f26(0xc9)],_0x2155cd[_0x3c1f26(0xce)]);if(_0x2912b9===_0x21fe75)return{'dbId':_0x2155cd['dbId'],'dbName':_0x2155cd[_0x3c1f26(0xc9)]};const _0x2529d1=parseExplicitDbDirectory(_0x2912b9);if(_0x2529d1!=null)return{'dbId':_0x2529d1,'dbName':await getDbName(_0x54ecc3,_0x2529d1)[_0x3c1f26(0xa3)](()=>undefined)};const _0xf2d021=await listDatabases(_0x54ecc3),_0x41e899=_0xf2d021[_0x3c1f26(0xc1)](_0x37afff=>buildDbDirectoryName(_0x37afff['dbName'],_0x37afff[_0x3c1f26(0xce)])===_0x2912b9);if(_0x41e899['length']===0x1)return{'dbId':_0x41e899[0x0]['dbId'],'dbName':_0x41e899[0x0][_0x3c1f26(0xc9)]};if(_0x41e899[_0x3c1f26(0xaa)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x2912b9+'\x22\x20for\x20sqlCode\x20'+_0x478f15[_0x3c1f26(0xc6)]+'.');const _0x5ed45c=_0x41e899[_0x3c1f26(0xc3)](_0x4cf736=>_0x4cf736[_0x3c1f26(0xc9)]+'\x20('+_0x4cf736[_0x3c1f26(0xce)]+')')[_0x3c1f26(0x9d)](',\x20');throw CliErrors[_0x3c1f26(0xb0)](_0x3c1f26(0xb4)+_0x2912b9+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x478f15[_0x3c1f26(0xc6)]+':\x20'+_0x5ed45c);}function parseExplicitDbDirectory(_0x248e8d){const _0x54cb61=a192_0x1c918f,_0x25c1b8=/^db-(\d+)$/[_0x54cb61(0xcc)](_0x248e8d);if(!_0x25c1b8)return null;const _0x78fa49=Number(_0x25c1b8[0x1]);return Number[_0x54cb61(0xb7)](_0x78fa49)&&_0x78fa49>0x0?_0x78fa49:null;}
1
+ const a192_0x511c5b=a192_0x15ce;function a192_0x2cbb(){const _0x46714d=['\x20failed','mode','168JXbTpY','entries','7174377pFwrNU','boolean','utf8','Local\x20directory\x20\x22','projectRoot','startsWith','map','393318rDgyMS','str','sqlRoot','Would\x20push\x20','trashDir','unchanged','catch','sqlName','sqlRootDir','get','filter','\x20skipped,\x20','dbDirectory','Push\x20local\x20SQL\x20files\x20to\x20remote','validation','lockFilePath','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','relativePath','sqlCode','hash','has','bool','175462lmJwgy','length','sqlcode','sql','4416762YrfRsx','15oAMGrL','remoteId','Push\x20complete:\x20','1248636BJaxFp','lastSync','sqlConfig','dbId','push','No\x20local\x20SQL\x20files\x20found.','toISOString','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','set','No\x20database\x20matches\x20local\x20directory\x20\x22','dbName','message','appCode','filePath','1187618GnFpIx','\x20SQL\x20file(s)','exec','join','version','/smartapi/custom/updateUserCustomSql','sqls','32298oyqOrQ','force','path','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'];a192_0x2cbb=function(){return _0x46714d;};return a192_0x2cbb();}(function(_0x3cdfc4,_0x45fcc8){const _0x530bd1=a192_0x15ce,_0x287ab9=_0x3cdfc4();while(!![]){try{const _0x2e0441=parseInt(_0x530bd1(0x1c7))/0x1+parseInt(_0x530bd1(0x1b1))/0x2+-parseInt(_0x530bd1(0x1b8))/0x3+parseInt(_0x530bd1(0x1a3))/0x4*(-parseInt(_0x530bd1(0x1a0))/0x5)+parseInt(_0x530bd1(0x19f))/0x6+-parseInt(_0x530bd1(0x19b))/0x7*(-parseInt(_0x530bd1(0x1be))/0x8)+-parseInt(_0x530bd1(0x1c0))/0x9;if(_0x2e0441===_0x45fcc8)break;else _0x287ab9['push'](_0x287ab9['shift']());}catch(_0x32eaf1){_0x287ab9['push'](_0x287ab9['shift']());}}}(a192_0x2cbb,0x7b59c));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 a192_0x15ce(_0x33bac0,_0x4b31b9){_0x33bac0=_0x33bac0-0x19a;const _0x2cbbd6=a192_0x2cbb();let _0x15cec2=_0x2cbbd6[_0x33bac0];return _0x15cec2;}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(_0x4ecc6a,_0x158252,_0x51fe82){const _0x510ed4=a192_0x15ce,_0x1e7efc=await scanLocalSqlQueries(_0x4ecc6a),_0x111c70=new Map();for(const _0x5a5afa of _0x1e7efc){if(_0x51fe82&&_0x5a5afa[_0x510ed4(0x1da)]!==_0x51fe82)continue;const _0x2de29d=_0x111c70[_0x510ed4(0x1d0)](_0x5a5afa['sqlCode'])??[];_0x2de29d[_0x510ed4(0x1a7)](_0x5a5afa),_0x111c70[_0x510ed4(0x1ab)](_0x5a5afa['sqlCode'],_0x2de29d);}if(_0x51fe82&&!_0x111c70[_0x510ed4(0x1dc)](_0x51fe82))throw CliErrors[_0x510ed4(0x1d5)]('Local\x20SQL\x20not\x20found:\x20'+_0x51fe82);const _0x301f03=[];for(const [_0x562fe7,_0x1473a1]of _0x111c70[_0x510ed4(0x1bf)]()){if(_0x1473a1[_0x510ed4(0x19c)]===0x1){_0x301f03[_0x510ed4(0x1a7)](_0x1473a1[0x0]);continue;}const _0x15c990=_0x158252['sqls'][_0x562fe7],_0x2c0e62=_0x15c990?.[_0x510ed4(0x1ba)],_0x578862=_0x2c0e62?_0x1473a1[_0x510ed4(0x1d1)](_0x527c60=>_0x527c60[_0x510ed4(0x1d9)]!==_0x2c0e62):_0x1473a1;if(_0x15c990&&_0x578862[_0x510ed4(0x19c)]===0x1){_0x301f03[_0x510ed4(0x1a7)](_0x578862[0x0]);continue;}throw CliErrors['validation']('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x562fe7+_0x510ed4(0x1d8));}return _0x301f03;}export const sqlPush={'service':a192_0x511c5b(0x19e),'command':a192_0x511c5b(0x1a7),'description':a192_0x511c5b(0x1d4),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a192_0x511c5b(0x1b9),'type':a192_0x511c5b(0x1c1),'description':a192_0x511c5b(0x1bb)}],async 'dryRun'(_0x5d2f23){const _0x289c8e=a192_0x511c5b,_0x2e9d60=loadSqlProjectConfig(_0x5d2f23[_0x289c8e(0x1af)]),_0x2df7d6=await readSqlLockFile(_0x2e9d60['lockFilePath']),{appLock:_0x2d261f}=ensureSqlLockScope(_0x2df7d6??createEmptySqlLock(),_0x5d2f23[_0x289c8e(0x1af)],_0x2e9d60['sqlRoot'],_0x289c8e(0x1a7)),_0xb9af12=await getTargetSqlQueries(_0x2e9d60,_0x2d261f,_0x5d2f23[_0x289c8e(0x1c8)](_0x289c8e(0x19d))||undefined),_0x1ce757=[];for(const _0x29a0b0 of _0xb9af12){const _0x1ed6fb=await computeSqlFileHash(_0x29a0b0[_0x289c8e(0x1b0)]),_0x4788e4=_0x2d261f['sqls'][_0x29a0b0['sqlCode']],_0x460adb=!!_0x4788e4&&(_0x4788e4['path']!==_0x29a0b0[_0x289c8e(0x1d9)]||!!_0x29a0b0['sqlName']&&_0x4788e4[_0x289c8e(0x1ce)]!==_0x29a0b0['sqlName']);if(!_0x5d2f23[_0x289c8e(0x19a)](_0x289c8e(0x1b9))&&_0x4788e4&&_0x4788e4[_0x289c8e(0x1db)]===_0x1ed6fb&&!_0x460adb)continue;_0x1ce757[_0x289c8e(0x1a7)](_0x29a0b0['sqlCode']);}return{'method':'POST','url':_0x289c8e(0x1b6),'body':{'sqlCodes':_0x1ce757,'appCode':_0x5d2f23[_0x289c8e(0x1af)]},'description':_0x289c8e(0x1ca)+_0x1ce757[_0x289c8e(0x19c)]+_0x289c8e(0x1b2)};},async 'execute'(_0x3a8a01){const _0xc895ed=a192_0x511c5b,_0x49cecd=loadSqlProjectConfig(_0x3a8a01[_0xc895ed(0x1af)]),_0x3ec8ec=await readSqlLockFile(_0x49cecd['lockFilePath']),{lockData:_0x77bc57,appLock:_0x25dd1f}=ensureSqlLockScope(_0x3ec8ec??createEmptySqlLock(),_0x3a8a01[_0xc895ed(0x1af)],_0x49cecd[_0xc895ed(0x1c9)],'push'),_0x8f2710=await getTargetSqlQueries(_0x49cecd,_0x25dd1f,_0x3a8a01[_0xc895ed(0x1c8)](_0xc895ed(0x19d))||undefined);if(_0x8f2710[_0xc895ed(0x19c)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xc895ed(0x1a8)};const _0x2707f5=[],_0x439922=[],_0x109f52=[];for(const _0x229dff of _0x8f2710){const _0x262934=_0x25dd1f[_0xc895ed(0x1b7)][_0x229dff[_0xc895ed(0x1da)]];if(!_0x262934){_0x109f52[_0xc895ed(0x1a7)]({'sqlCode':_0x229dff[_0xc895ed(0x1da)],'error':_0xc895ed(0x1aa)});continue;}try{const _0x13d1ee=await computeSqlFileHash(_0x229dff['filePath']),_0x52f8e1=_0x262934['path']!==_0x229dff[_0xc895ed(0x1d9)]||!!_0x229dff[_0xc895ed(0x1ce)]&&_0x262934['sqlName']!==_0x229dff[_0xc895ed(0x1ce)];if(!_0x3a8a01[_0xc895ed(0x19a)](_0xc895ed(0x1b9))&&_0x262934[_0xc895ed(0x1db)]===_0x13d1ee&&!_0x52f8e1){_0x439922[_0xc895ed(0x1a7)]({'sqlCode':_0x229dff[_0xc895ed(0x1da)],'reason':_0xc895ed(0x1cc)});continue;}if(_0x262934[_0xc895ed(0x1b5)]==null){_0x109f52['push']({'sqlCode':_0x229dff[_0xc895ed(0x1da)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x2329ae=await readFile(_0x229dff[_0xc895ed(0x1b0)],_0xc895ed(0x1c2)),_0x1996f0=stripLocalSqlMetadata(_0x2329ae,_0x229dff[_0xc895ed(0x1bd)]),_0x39829e=_0x229dff[_0xc895ed(0x1ce)]||_0x262934['sqlName'],_0x5d947b=await resolveTargetDbBinding(_0x3a8a01[_0xc895ed(0x1af)],_0x229dff,_0x262934),_0x54a295=await updateSqlQuery({'id':_0x262934[_0xc895ed(0x1a1)],'appCode':_0x3a8a01[_0xc895ed(0x1af)],'sqlCode':_0x229dff[_0xc895ed(0x1da)],'sqlName':_0x39829e,'dbId':_0x5d947b['dbId'],'version':_0x262934[_0xc895ed(0x1b5)],'sqlContent':_0x1996f0,'sqlConfig':_0x262934[_0xc895ed(0x1a5)]??undefined}),_0x4c3ecc=_0x54a295['dbId']?await getDbName(_0x3a8a01[_0xc895ed(0x1af)],Number(_0x54a295[_0xc895ed(0x1a6)]))[_0xc895ed(0x1cd)](()=>_0x5d947b[_0xc895ed(0x1ad)]):_0x5d947b[_0xc895ed(0x1ad)];_0x25dd1f[_0xc895ed(0x1b7)][_0x229dff['sqlCode']]={...buildSqlLockEntry(_0x54a295,_0x1996f0,_0x13d1ee,{'dbName':_0x4c3ecc}),'path':_0x229dff[_0xc895ed(0x1d9)],'mode':_0x262934['mode']},await archivePreviousSqlFileIfNeeded(_0x49cecd,_0x262934[_0xc895ed(0x1ba)],_0x229dff[_0xc895ed(0x1d9)]),_0x2707f5[_0xc895ed(0x1a7)]({'sqlCode':_0x229dff['sqlCode'],'remoteId':_0x262934[_0xc895ed(0x1a1)]});}catch(_0x58e35b){_0x109f52[_0xc895ed(0x1a7)]({'sqlCode':_0x229dff[_0xc895ed(0x1da)],'error':_0x58e35b instanceof Error?_0x58e35b[_0xc895ed(0x1ae)]:String(_0x58e35b)});}}return _0x25dd1f[_0xc895ed(0x1a4)]=new Date()[_0xc895ed(0x1a9)](),await writeSqlLockFile(_0x49cecd[_0xc895ed(0x1d6)],_0x77bc57),{'ok':_0x109f52['length']===0x0,'data':{'pushed':_0x2707f5,'skipped':_0x439922,'failed':_0x109f52},'message':_0xc895ed(0x1a2)+_0x2707f5['length']+'\x20pushed,\x20'+_0x439922[_0xc895ed(0x19c)]+_0xc895ed(0x1d2)+_0x109f52['length']+_0xc895ed(0x1bc)};}};async function archivePreviousSqlFileIfNeeded(_0x1157a7,_0x1467c0,_0x11868a){const _0x10441a=a192_0x511c5b;if(!_0x1467c0||_0x1467c0===_0x11868a)return;const _0x51c57f=join(_0x1157a7[_0x10441a(0x1cf)],_0x1467c0);if(!await fileExists(_0x51c57f))return;const _0x5e4668=await moveToTrash(_0x1157a7[_0x10441a(0x1c4)],_0x1157a7[_0x10441a(0x1cb)],_0x51c57f);await cleanupEmptyDirectories(dirname(_0x51c57f),_0x1157a7[_0x10441a(0x1cf)]),void _0x5e4668;}async function moveToTrash(_0x4a398b,_0x3c51f3,_0x120fc8){const _0x2960cf=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1f8ad6=relative(_0x4a398b,_0x120fc8),_0x39cddb=join(_0x3c51f3,_0x2960cf,_0x1f8ad6);return await mkdir(dirname(_0x39cddb),{'recursive':!![]}),await rename(_0x120fc8,_0x39cddb),_0x39cddb;}async function cleanupEmptyDirectories(_0x1d75d1,_0x9f96cd){const _0x231059=a192_0x511c5b;let _0x327e2c=resolve(_0x1d75d1);const _0xc2e79f=resolve(_0x9f96cd);while(_0x327e2c[_0x231059(0x1c5)](''+_0xc2e79f+sep)||_0x327e2c===_0xc2e79f){if(_0x327e2c===_0xc2e79f)return;try{const _0x4c0211=await readdir(_0x327e2c);if(_0x4c0211[_0x231059(0x19c)]>0x0)return;await rmdir(_0x327e2c);}catch{return;}_0x327e2c=dirname(_0x327e2c);}}async function resolveTargetDbBinding(_0x34b2d0,_0x34d513,_0x388bce){const _0x1c5ba9=a192_0x511c5b,_0x295e3b=_0x34d513[_0x1c5ba9(0x1d3)];if(!_0x295e3b)return{'dbId':_0x388bce[_0x1c5ba9(0x1a6)],'dbName':_0x388bce[_0x1c5ba9(0x1ad)]};const _0x36b970=buildDbDirectoryName(_0x388bce[_0x1c5ba9(0x1ad)],_0x388bce[_0x1c5ba9(0x1a6)]);if(_0x295e3b===_0x36b970)return{'dbId':_0x388bce['dbId'],'dbName':_0x388bce[_0x1c5ba9(0x1ad)]};const _0x519ad1=parseExplicitDbDirectory(_0x295e3b);if(_0x519ad1!=null)return{'dbId':_0x519ad1,'dbName':await getDbName(_0x34b2d0,_0x519ad1)['catch'](()=>undefined)};const _0x1ee3cf=await listDatabases(_0x34b2d0),_0x29534c=_0x1ee3cf[_0x1c5ba9(0x1d1)](_0x1cb818=>buildDbDirectoryName(_0x1cb818['dbName'],_0x1cb818[_0x1c5ba9(0x1a6)])===_0x295e3b);if(_0x29534c[_0x1c5ba9(0x19c)]===0x1)return{'dbId':_0x29534c[0x0][_0x1c5ba9(0x1a6)],'dbName':_0x29534c[0x0][_0x1c5ba9(0x1ad)]};if(_0x29534c[_0x1c5ba9(0x19c)]===0x0)throw CliErrors[_0x1c5ba9(0x1d5)](_0x1c5ba9(0x1ac)+_0x295e3b+_0x1c5ba9(0x1d7)+_0x34d513[_0x1c5ba9(0x1da)]+'.');const _0x3ac511=_0x29534c[_0x1c5ba9(0x1c6)](_0x24d29d=>_0x24d29d[_0x1c5ba9(0x1ad)]+'\x20('+_0x24d29d[_0x1c5ba9(0x1a6)]+')')[_0x1c5ba9(0x1b4)](',\x20');throw CliErrors[_0x1c5ba9(0x1d5)](_0x1c5ba9(0x1c3)+_0x295e3b+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x34d513[_0x1c5ba9(0x1da)]+':\x20'+_0x3ac511);}function parseExplicitDbDirectory(_0x38e37a){const _0x5862ca=a192_0x511c5b,_0x5bd3fd=/^db-(\d+)$/[_0x5862ca(0x1b3)](_0x38e37a);if(!_0x5bd3fd)return null;const _0x38bc31=Number(_0x5bd3fd[0x1]);return Number['isFinite'](_0x38bc31)&&_0x38bc31>0x0?_0x38bc31:null;}
@@ -1 +1 @@
1
- const a193_0x26fece=a193_0x32ea;(function(_0x4de378,_0x4484f2){const _0x52deaf=a193_0x32ea,_0xf41d7f=_0x4de378();while(!![]){try{const _0x3d72ba=parseInt(_0x52deaf(0x8c))/0x1*(parseInt(_0x52deaf(0x8e))/0x2)+-parseInt(_0x52deaf(0xb1))/0x3+-parseInt(_0x52deaf(0xab))/0x4*(parseInt(_0x52deaf(0x91))/0x5)+-parseInt(_0x52deaf(0xa6))/0x6+parseInt(_0x52deaf(0xaf))/0x7*(-parseInt(_0x52deaf(0x8a))/0x8)+parseInt(_0x52deaf(0x9c))/0x9+parseInt(_0x52deaf(0xa3))/0xa;if(_0x3d72ba===_0x4484f2)break;else _0xf41d7f['push'](_0xf41d7f['shift']());}catch(_0x580ecb){_0xf41d7f['push'](_0xf41d7f['shift']());}}}(a193_0x1f8d,0x678eb));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=a193_0x26fece(0x8b);export function buildSqlLockEntry(_0x17b7bd,_0x3b4c2c,_0x41f22c,_0x26aa0d){const _0x10b449=a193_0x26fece,_0x3e5e0c=detectSqlMode(_0x3b4c2c);return{'path':buildSqlRelativePath(_0x17b7bd[_0x10b449(0xb0)],_0x17b7bd[_0x10b449(0x88)],_0x26aa0d?.[_0x10b449(0xa9)],_0x3e5e0c,_0x17b7bd[_0x10b449(0x99)]),'hash':_0x41f22c,'remoteId':_0x17b7bd['id'],'version':_0x17b7bd[_0x10b449(0x97)],'dbId':Number(_0x17b7bd[_0x10b449(0x99)]),'dbName':_0x26aa0d?.[_0x10b449(0xa9)],'sqlName':_0x17b7bd[_0x10b449(0x88)],'sqlConfig':_0x17b7bd[_0x10b449(0x94)]??undefined,'mode':_0x3e5e0c};}export function cloneSqlLockData(_0x269308){const _0x5afc2d=a193_0x26fece;return{'apps':Object['fromEntries'](Object['entries'](_0x269308[_0x5afc2d(0xa5)])[_0x5afc2d(0xad)](([_0x282989,_0x4e1894])=>[_0x282989,{'sqlRoot':_0x4e1894[_0x5afc2d(0xae)],'lastSync':_0x4e1894['lastSync'],'sqls':{..._0x4e1894[_0x5afc2d(0xa1)]}}]))};}export function ensureRemoteSqlContent(_0x537971){const _0x26cc21=a193_0x26fece;return _0x537971[_0x26cc21(0x9a)]??'';}export function buildLocalSqlFileContent(_0x4b320a,_0x2fd1ca,_0x3bf874){const _0x45c90e=a193_0x26fece,_0x407440=_0x3bf874?.[_0x45c90e(0x93)]??detectSqlMode(_0x2fd1ca),_0x59ba13=stripLocalSqlMetadata(_0x2fd1ca,_0x407440)[_0x45c90e(0x89)](),_0x111e56=[...buildMetadataHeaderLines({'sqlCode':_0x4b320a[_0x45c90e(0xb0)],'sqlName':_0x4b320a[_0x45c90e(0x88)],'dbId':_0x4b320a[_0x45c90e(0x99)],'dbName':_0x3bf874?.[_0x45c90e(0xa9)],'mode':_0x407440,'syncedAt':_0x3bf874?.[_0x45c90e(0x9d)],'description':_0x3bf874?.[_0x45c90e(0x9f)]},_0x407440),'',_0x59ba13],_0x2045ec=_0x111e56['join']('\x0a');return _0x2045ec[_0x45c90e(0xa7)]('\x0a')?_0x2045ec:_0x2045ec+'\x0a';}function a193_0x32ea(_0x40bae7,_0x35d175){_0x40bae7=_0x40bae7-0x88;const _0x1f8d6a=a193_0x1f8d();let _0x32eaae=_0x1f8d6a[_0x40bae7];return _0x32eaae;}export function stripLocalSqlMetadata(_0x1c421b,_0x3cc134){const _0x55460a=a193_0x26fece,_0x4d72ca=_0x1c421b['replace'](/\r\n/g,'\x0a')[_0x55460a(0x9b)]('\x0a'),_0x2fde12=[];let _0x1db617=0x0;if(_0x3cc134===_0x55460a(0x92))while(_0x1db617<_0x4d72ca[_0x55460a(0xa8)]){const _0x4d14e0=_0x4d72ca[_0x1db617]??'';if(/^\s*<!--\s*@lovrabet\./[_0x55460a(0xa2)](_0x4d14e0)){_0x1db617++;continue;}if(_0x4d14e0[_0x55460a(0x89)]()===''&&_0x1db617>0x0){_0x1db617++;continue;}break;}else while(_0x1db617<_0x4d72ca[_0x55460a(0xa8)]){const _0x42bdc0=_0x4d72ca[_0x1db617]??'';if(/^\s*--\s*@lovrabet\./[_0x55460a(0xa2)](_0x42bdc0)){_0x1db617++;continue;}if(_0x42bdc0[_0x55460a(0x89)]()===''&&_0x1db617>0x0){_0x1db617++;continue;}break;}for(;_0x1db617<_0x4d72ca[_0x55460a(0xa8)];_0x1db617++){_0x2fde12['push'](_0x4d72ca[_0x1db617]);}return _0x2fde12[_0x55460a(0x8f)]('\x0a')['trimStart']();}export function resolveSqlMode(_0x1293a5,_0x3bbacb){const _0x45b35c=a193_0x26fece;if(_0x3bbacb?.[_0x45b35c(0x93)])return _0x3bbacb['mode'];return detectSqlMode(_0x1293a5);}export function resolveSqlFileName(_0x5604bd,_0x81bd9d,_0x1a2007){const _0x552caf=a193_0x26fece;if(_0x1a2007?.[_0x552caf(0xb2)])return _0x1a2007[_0x552caf(0xb2)];if(_0x1a2007?.[_0x552caf(0x88)]||_0x1a2007?.['dbName'])return buildSqlRelativePath(_0x5604bd,_0x1a2007?.[_0x552caf(0x88)],_0x1a2007?.[_0x552caf(0xa9)],resolveSqlMode(_0x81bd9d,_0x1a2007),_0x1a2007?.['dbId']);return buildDefaultSqlFileName(_0x5604bd,resolveSqlMode(_0x81bd9d,_0x1a2007));}export function resolveSqlLocalDir(_0x3860cf,_0xdc3419){return join(_0x3860cf,SQL_LOCAL_REL_DIR,_0xdc3419);}export async function confirmForceOverwrite(_0x1787b9){const _0x1f14a8=a193_0x26fece,_0x44691=createInterface({'input':process[_0x1f14a8(0xa4)],'output':process[_0x1f14a8(0x90)]}),_0x48a9c1=await new Promise(_0x2a8748=>{_0x44691['question'](_0x1787b9+'\x20[y/N]\x20',_0x2a8748);});return _0x44691[_0x1f14a8(0x95)](),['y',_0x1f14a8(0xac)][_0x1f14a8(0x96)](_0x48a9c1[_0x1f14a8(0x89)]()[_0x1f14a8(0xa0)]());}export function findSqlLockScope(_0x29cd47,_0x11b819){const _0x164a87=a193_0x26fece;return _0x29cd47[_0x164a87(0xa5)][_0x11b819];}function buildMetadataHeaderLines(_0x38b4a5,_0xf5cda1){const _0x582b87=a193_0x26fece,_0x3d2225=[['sqlCode',_0x38b4a5[_0x582b87(0xb0)]],[_0x582b87(0x88),_0x38b4a5[_0x582b87(0x88)]],['dbId',_0x38b4a5[_0x582b87(0x99)]],[_0x582b87(0xa9),_0x38b4a5[_0x582b87(0xa9)]],[_0x582b87(0x93),_0x38b4a5['mode']],[_0x582b87(0x9d),_0x38b4a5[_0x582b87(0x9d)]],[_0x582b87(0x9f),_0x38b4a5['description']]];if(_0xf5cda1==='mybatisXml')return _0x3d2225[_0x582b87(0x9e)](([,_0x2d6181])=>_0x2d6181!==undefined&&_0x2d6181!==null&&String(_0x2d6181)[_0x582b87(0x89)]()!=='')[_0x582b87(0xad)](([_0x6967aa,_0x4cd243])=>_0x582b87(0x98)+_0x6967aa+':\x20'+String(_0x4cd243)+_0x582b87(0x8d));return _0x3d2225[_0x582b87(0x9e)](([,_0x4861a7])=>_0x4861a7!==undefined&&_0x4861a7!==null&&String(_0x4861a7)['trim']()!=='')['map'](([_0x20845b,_0x36afa9])=>_0x582b87(0xaa)+_0x20845b+':\x20'+String(_0x36afa9));}function a193_0x1f8d(){const _0x3ad1a=['1242969ZmAYWC','path','sqlName','trim','76536fSMjwb','.rabetbase/sql','1DMhYFa','\x20-->','54878VkmqdJ','join','stderr','5WyVlHx','mybatisXml','mode','sqlConfig','close','includes','version','<!--\x20@lovrabet.','dbId','sqlContent','split','3078306anHoZv','syncedAt','filter','description','toLowerCase','sqls','test','22098070iMccvt','stdin','apps','3164358TzFsuH','endsWith','length','dbName','--\x20@lovrabet.','2060008mtEsYy','yes','map','sqlRoot','511Zfqyto','sqlCode'];a193_0x1f8d=function(){return _0x3ad1a;};return a193_0x1f8d();}
1
+ function a193_0x57e7(_0x3c5d22,_0x393e3c){_0x3c5d22=_0x3c5d22-0x1c7;const _0x19b886=a193_0x19b8();let _0x57e705=_0x19b886[_0x3c5d22];return _0x57e705;}const a193_0x4807a4=a193_0x57e7;(function(_0x4e4b19,_0x56adb6){const _0x5a41dd=a193_0x57e7,_0x3d1a51=_0x4e4b19();while(!![]){try{const _0x2550bf=-parseInt(_0x5a41dd(0x1db))/0x1+-parseInt(_0x5a41dd(0x1e5))/0x2+-parseInt(_0x5a41dd(0x1e0))/0x3+-parseInt(_0x5a41dd(0x1da))/0x4+parseInt(_0x5a41dd(0x1d6))/0x5*(parseInt(_0x5a41dd(0x1e7))/0x6)+-parseInt(_0x5a41dd(0x1d1))/0x7+parseInt(_0x5a41dd(0x1e1))/0x8;if(_0x2550bf===_0x56adb6)break;else _0x3d1a51['push'](_0x3d1a51['shift']());}catch(_0x137d64){_0x3d1a51['push'](_0x3d1a51['shift']());}}}(a193_0x19b8,0x98089));import{createInterface}from'node:readline';function a193_0x19b8(){const _0x5bf701=['trimStart','207711CLtqfu','replace','mode','split','fromEntries','78215MhvFsu','trim','\x20[y/N]\x20','.rabetbase/sql','3528884iHYPHV','470456hdmGYD','sqlRoot','stdin','dbName','syncedAt','2765751ehJBJE','23575416THBZAQ','test','join','dbId','196292qmGpQU','apps','30HlawTd','version','entries','--\x20@lovrabet.','sqlName','sqlContent','stderr','close','sqlConfig','length','toLowerCase','question','map','endsWith','path','sqlCode','yes','description'];a193_0x19b8=function(){return _0x5bf701;};return a193_0x19b8();}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a193_0x4807a4(0x1d9);export function buildSqlLockEntry(_0x558d1f,_0x3c5e58,_0x3d3b3c,_0x3e21b6){const _0x46ff01=a193_0x4807a4,_0x1e33d3=detectSqlMode(_0x3c5e58);return{'path':buildSqlRelativePath(_0x558d1f[_0x46ff01(0x1cd)],_0x558d1f[_0x46ff01(0x1eb)],_0x3e21b6?.[_0x46ff01(0x1de)],_0x1e33d3,_0x558d1f[_0x46ff01(0x1e4)]),'hash':_0x3d3b3c,'remoteId':_0x558d1f['id'],'version':_0x558d1f[_0x46ff01(0x1e8)],'dbId':Number(_0x558d1f[_0x46ff01(0x1e4)]),'dbName':_0x3e21b6?.['dbName'],'sqlName':_0x558d1f[_0x46ff01(0x1eb)],'sqlConfig':_0x558d1f[_0x46ff01(0x1ef)]??undefined,'mode':_0x1e33d3};}export function cloneSqlLockData(_0x43c74f){const _0xb8c58f=a193_0x4807a4;return{'apps':Object[_0xb8c58f(0x1d5)](Object[_0xb8c58f(0x1e9)](_0x43c74f[_0xb8c58f(0x1e6)])['map'](([_0x553f72,_0x107392])=>[_0x553f72,{'sqlRoot':_0x107392[_0xb8c58f(0x1dc)],'lastSync':_0x107392['lastSync'],'sqls':{..._0x107392['sqls']}}]))};}export function ensureRemoteSqlContent(_0x319d8c){const _0x503fb8=a193_0x4807a4;return _0x319d8c[_0x503fb8(0x1ec)]??'';}export function buildLocalSqlFileContent(_0x3ffe72,_0x369da0,_0x4b9238){const _0x8ea993=a193_0x4807a4,_0x284bcb=_0x4b9238?.[_0x8ea993(0x1d3)]??detectSqlMode(_0x369da0),_0x9e1110=stripLocalSqlMetadata(_0x369da0,_0x284bcb)[_0x8ea993(0x1d7)](),_0x4bf702=[...buildMetadataHeaderLines({'sqlCode':_0x3ffe72[_0x8ea993(0x1cd)],'sqlName':_0x3ffe72['sqlName'],'dbId':_0x3ffe72[_0x8ea993(0x1e4)],'dbName':_0x4b9238?.['dbName'],'mode':_0x284bcb,'syncedAt':_0x4b9238?.[_0x8ea993(0x1df)],'description':_0x4b9238?.[_0x8ea993(0x1cf)]},_0x284bcb),'',_0x9e1110],_0x47d115=_0x4bf702[_0x8ea993(0x1e3)]('\x0a');return _0x47d115[_0x8ea993(0x1cb)]('\x0a')?_0x47d115:_0x47d115+'\x0a';}export function stripLocalSqlMetadata(_0x4dc916,_0x10d7a4){const _0x55bf58=a193_0x4807a4,_0x531693=_0x4dc916[_0x55bf58(0x1d2)](/\r\n/g,'\x0a')[_0x55bf58(0x1d4)]('\x0a'),_0x2d549e=[];let _0x266ce7=0x0;if(_0x10d7a4==='mybatisXml')while(_0x266ce7<_0x531693[_0x55bf58(0x1c7)]){const _0x2a9284=_0x531693[_0x266ce7]??'';if(/^\s*<!--\s*@lovrabet\./[_0x55bf58(0x1e2)](_0x2a9284)){_0x266ce7++;continue;}if(_0x2a9284['trim']()===''&&_0x266ce7>0x0){_0x266ce7++;continue;}break;}else while(_0x266ce7<_0x531693[_0x55bf58(0x1c7)]){const _0x158497=_0x531693[_0x266ce7]??'';if(/^\s*--\s*@lovrabet\./[_0x55bf58(0x1e2)](_0x158497)){_0x266ce7++;continue;}if(_0x158497[_0x55bf58(0x1d7)]()===''&&_0x266ce7>0x0){_0x266ce7++;continue;}break;}for(;_0x266ce7<_0x531693[_0x55bf58(0x1c7)];_0x266ce7++){_0x2d549e['push'](_0x531693[_0x266ce7]);}return _0x2d549e[_0x55bf58(0x1e3)]('\x0a')[_0x55bf58(0x1d0)]();}export function resolveSqlMode(_0x3f9c82,_0x47104b){const _0x2c07fe=a193_0x4807a4;if(_0x47104b?.[_0x2c07fe(0x1d3)])return _0x47104b[_0x2c07fe(0x1d3)];return detectSqlMode(_0x3f9c82);}export function resolveSqlFileName(_0x3ce794,_0x20b6f1,_0xe963ca){const _0x38d1aa=a193_0x4807a4;if(_0xe963ca?.['path'])return _0xe963ca[_0x38d1aa(0x1cc)];if(_0xe963ca?.[_0x38d1aa(0x1eb)]||_0xe963ca?.[_0x38d1aa(0x1de)])return buildSqlRelativePath(_0x3ce794,_0xe963ca?.[_0x38d1aa(0x1eb)],_0xe963ca?.[_0x38d1aa(0x1de)],resolveSqlMode(_0x20b6f1,_0xe963ca),_0xe963ca?.['dbId']);return buildDefaultSqlFileName(_0x3ce794,resolveSqlMode(_0x20b6f1,_0xe963ca));}export function resolveSqlLocalDir(_0x3f0fd4,_0x375e39){return join(_0x3f0fd4,SQL_LOCAL_REL_DIR,_0x375e39);}export async function confirmForceOverwrite(_0x8994e2){const _0x3ef022=a193_0x4807a4,_0x2ee2b5=createInterface({'input':process[_0x3ef022(0x1dd)],'output':process[_0x3ef022(0x1ed)]}),_0x56ec14=await new Promise(_0xcd0598=>{const _0xbacb32=_0x3ef022;_0x2ee2b5[_0xbacb32(0x1c9)](_0x8994e2+_0xbacb32(0x1d8),_0xcd0598);});return _0x2ee2b5[_0x3ef022(0x1ee)](),['y',_0x3ef022(0x1ce)]['includes'](_0x56ec14[_0x3ef022(0x1d7)]()[_0x3ef022(0x1c8)]());}export function findSqlLockScope(_0x5c05bf,_0x3b3f25){const _0x5e78cd=a193_0x4807a4;return _0x5c05bf[_0x5e78cd(0x1e6)][_0x3b3f25];}function buildMetadataHeaderLines(_0x19bd34,_0x47dbe8){const _0x2b0850=a193_0x4807a4,_0x1624f5=[[_0x2b0850(0x1cd),_0x19bd34[_0x2b0850(0x1cd)]],[_0x2b0850(0x1eb),_0x19bd34[_0x2b0850(0x1eb)]],[_0x2b0850(0x1e4),_0x19bd34['dbId']],[_0x2b0850(0x1de),_0x19bd34[_0x2b0850(0x1de)]],[_0x2b0850(0x1d3),_0x19bd34[_0x2b0850(0x1d3)]],[_0x2b0850(0x1df),_0x19bd34[_0x2b0850(0x1df)]],[_0x2b0850(0x1cf),_0x19bd34[_0x2b0850(0x1cf)]]];if(_0x47dbe8==='mybatisXml')return _0x1624f5['filter'](([,_0xa8eefc])=>_0xa8eefc!==undefined&&_0xa8eefc!==null&&String(_0xa8eefc)[_0x2b0850(0x1d7)]()!=='')['map'](([_0x2cc28e,_0x18495c])=>'<!--\x20@lovrabet.'+_0x2cc28e+':\x20'+String(_0x18495c)+'\x20-->');return _0x1624f5['filter'](([,_0x1c4409])=>_0x1c4409!==undefined&&_0x1c4409!==null&&String(_0x1c4409)[_0x2b0850(0x1d7)]()!=='')[_0x2b0850(0x1ca)](([_0x2f9dd4,_0x3eca90])=>_0x2b0850(0x1ea)+_0x2f9dd4+':\x20'+String(_0x3eca90));}
@@ -1 +1 @@
1
- const a194_0x3687e7=a194_0x4bc0;(function(_0x2c7d2c,_0x25fdb0){const _0xb4a39=a194_0x4bc0,_0x4028cc=_0x2c7d2c();while(!![]){try{const _0x310c35=parseInt(_0xb4a39(0x141))/0x1*(-parseInt(_0xb4a39(0x137))/0x2)+parseInt(_0xb4a39(0x150))/0x3+parseInt(_0xb4a39(0x149))/0x4*(-parseInt(_0xb4a39(0x14a))/0x5)+-parseInt(_0xb4a39(0x14c))/0x6*(-parseInt(_0xb4a39(0x136))/0x7)+-parseInt(_0xb4a39(0x13b))/0x8*(-parseInt(_0xb4a39(0x14d))/0x9)+parseInt(_0xb4a39(0x145))/0xa+-parseInt(_0xb4a39(0x139))/0xb;if(_0x310c35===_0x25fdb0)break;else _0x4028cc['push'](_0x4028cc['shift']());}catch(_0x54380e){_0x4028cc['push'](_0x4028cc['shift']());}}}(a194_0x1f6f,0xcb0c1));import{listSqlQueries}from'../../core/api-client.js';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';function a194_0x4bc0(_0x5621b1,_0x493424){_0x5621b1=_0x5621b1-0x136;const _0x1f6fea=a194_0x1f6f();let _0x4bc0ce=_0x1f6fea[_0x5621b1];return _0x4bc0ce;}import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0xa6f0a6){const _0x135d0e=a194_0x4bc0,_0x2d9821=[];let _0x26f72d=0x1;while(!![]){const _0x211898=await listSqlQueries(_0xa6f0a6,{'currentPage':_0x26f72d,'pageSize':PAGE_SIZE}),_0x3d857b=_0x211898['tableData']??[];_0x2d9821[_0x135d0e(0x140)](..._0x3d857b[_0x135d0e(0x143)](_0x1e46ea=>_0x1e46ea['sqlCode']));if(_0x3d857b[_0x135d0e(0x13a)]===0x0)break;const _0x1a35e6=_0x211898['paging']?.[_0x135d0e(0x13f)];if(_0x1a35e6!=null?_0x2d9821[_0x135d0e(0x13a)]>=_0x1a35e6:_0x3d857b['length']<PAGE_SIZE)break;_0x26f72d++;}return _0x2d9821;}export const sqlStatus={'service':'sql','command':a194_0x3687e7(0x13c),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a194_0x3687e7(0x153),'flags':[{'name':'remote','type':a194_0x3687e7(0x14e),'description':a194_0x3687e7(0x148)}],async 'execute'(_0x58dec4){const _0x3436c0=a194_0x3687e7,_0x50bd76=loadSqlProjectConfig(_0x58dec4[_0x3436c0(0x13e)]),_0x5b81df=await readSqlLockFile(_0x50bd76[_0x3436c0(0x14f)]),{appLock:_0x5bb1c1}=ensureSqlLockScope(_0x5b81df??createEmptySqlLock(),_0x50bd76[_0x3436c0(0x13e)],_0x50bd76[_0x3436c0(0x144)],'status'),_0xdfd14b=await scanLocalSqlQueries(_0x50bd76),_0x4f737b=[],_0x222468=[],_0x5be02a=[],_0x42a91f=[],_0x4a3b35=new Set(_0xdfd14b[_0x3436c0(0x143)](_0x24cf70=>_0x24cf70[_0x3436c0(0x147)]));for(const _0x169a2b of _0xdfd14b){const _0x5b60c8=await computeSqlFileHash(_0x169a2b['filePath']),_0x550c68=_0x5bb1c1['sqls'][_0x169a2b[_0x3436c0(0x147)]],_0x1abd31=!!_0x550c68&&_0x550c68['path']!==_0x169a2b['relativePath'],_0x1d1236=!!_0x550c68&&!!_0x169a2b[_0x3436c0(0x13d)]&&_0x550c68[_0x3436c0(0x13d)]!==_0x169a2b['sqlName'];if(!_0x550c68)_0x4f737b[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]);else _0x550c68['hash']!==_0x5b60c8||_0x1abd31||_0x1d1236?_0x222468[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]):_0x5be02a[_0x3436c0(0x140)](_0x169a2b[_0x3436c0(0x147)]);}for(const _0x20325d of Object[_0x3436c0(0x142)](_0x5bb1c1[_0x3436c0(0x138)])){!_0x4a3b35[_0x3436c0(0x146)](_0x20325d)&&_0x42a91f[_0x3436c0(0x140)](_0x20325d);}const _0x1b0c86=[];if(_0x58dec4[_0x3436c0(0x152)](_0x3436c0(0x14b))){const _0x3b6e74=await fetchAllSqlCodes(_0x58dec4[_0x3436c0(0x13e)]);for(const _0x28b8d9 of _0x3b6e74){!_0x4a3b35[_0x3436c0(0x146)](_0x28b8d9)&&!_0x5bb1c1[_0x3436c0(0x138)][_0x28b8d9]&&_0x1b0c86[_0x3436c0(0x140)](_0x28b8d9);}}const _0x3489ab=_0x4f737b[_0x3436c0(0x13a)]===0x0&&_0x222468['length']===0x0&&_0x42a91f[_0x3436c0(0x13a)]===0x0&&_0x1b0c86[_0x3436c0(0x13a)]===0x0;return{'ok':!![],'data':{'added':_0x4f737b,'modified':_0x222468,'missing':_0x42a91f,'unchanged':_0x5be02a,'remoteOnly':_0x1b0c86},'message':_0x3489ab?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x4f737b[_0x3436c0(0x13a)]+_0x3436c0(0x154)+_0x222468[_0x3436c0(0x13a)]+'\x20modified,\x20'+_0x42a91f[_0x3436c0(0x13a)]+'\x20missing,\x20'+_0x5be02a['length']+'\x20unchanged'+(_0x1b0c86[_0x3436c0(0x13a)]>0x0?',\x20'+_0x1b0c86[_0x3436c0(0x13a)]+_0x3436c0(0x151):'')};}};function a194_0x1f6f(){const _0x373ca3=['read','\x20added,\x20','7kcBLhI','947038eiDmUP','sqls','27984374zsVfNB','length','24uZBOTm','status','sqlName','appCode','totalCount','push','2kbmnbt','keys','map','sqlRoot','16074460fVsnut','has','lockKey','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','28YyFehE','781790CoOaHF','remote','9212730geWCbT','2439189DiVRLU','boolean','lockFilePath','4383885FGkotJ','\x20remote-only','bool'];a194_0x1f6f=function(){return _0x373ca3;};return a194_0x1f6f();}
1
+ const a194_0x149901=a194_0x1177;(function(_0x50e33d,_0x34788d){const _0x20640c=a194_0x1177,_0x488c38=_0x50e33d();while(!![]){try{const _0x5050f7=parseInt(_0x20640c(0x197))/0x1+-parseInt(_0x20640c(0x1b7))/0x2+parseInt(_0x20640c(0x193))/0x3*(-parseInt(_0x20640c(0x1b3))/0x4)+-parseInt(_0x20640c(0x1ad))/0x5*(parseInt(_0x20640c(0x1ab))/0x6)+parseInt(_0x20640c(0x198))/0x7*(-parseInt(_0x20640c(0x1a3))/0x8)+-parseInt(_0x20640c(0x191))/0x9+-parseInt(_0x20640c(0x192))/0xa*(-parseInt(_0x20640c(0x196))/0xb);if(_0x5050f7===_0x34788d)break;else _0x488c38['push'](_0x488c38['shift']());}catch(_0x9b310e){_0x488c38['push'](_0x488c38['shift']());}}}(a194_0x4193,0x2855f));import{listSqlQueries}from'../../core/api-client.js';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;function a194_0x1177(_0x2677ae,_0x4f8e77){_0x2677ae=_0x2677ae-0x190;const _0x419386=a194_0x4193();let _0x11779d=_0x419386[_0x2677ae];return _0x11779d;}function a194_0x4193(){const _0x4ac13c=['path','lockFilePath','boolean','2895255WctSjU','230bbNkjB','543759MfjsDZ','push','lockKey','263758YVjhoP','314618MZwlwn','287oSVKXp','\x20added,\x20','status','remote','map','filePath','sql','paging','\x20modified,\x20','sqls','tableData','3096BGjXOP','read','appCode','has','\x20missing,\x20','sqlName','All\x20SQL\x20queries\x20are\x20in\x20sync.','keys','400626RKjDBm','hash','5WvtJmO','totalCount','bool','\x20unchanged','sqlRoot','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','4HgiwUg','relativePath','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','length','230622rnLZxv','\x20remote-only'];a194_0x4193=function(){return _0x4ac13c;};return a194_0x4193();}async function fetchAllSqlCodes(_0x49066f){const _0x4b0416=a194_0x1177,_0x12b478=[];let _0xb53227=0x1;while(!![]){const _0x195b78=await listSqlQueries(_0x49066f,{'currentPage':_0xb53227,'pageSize':PAGE_SIZE}),_0xce58ea=_0x195b78[_0x4b0416(0x1a2)]??[];_0x12b478[_0x4b0416(0x194)](..._0xce58ea[_0x4b0416(0x19c)](_0x502d67=>_0x502d67['sqlCode']));if(_0xce58ea[_0x4b0416(0x1b6)]===0x0)break;const _0x15ffcc=_0x195b78[_0x4b0416(0x19f)]?.[_0x4b0416(0x1ae)];if(_0x15ffcc!=null?_0x12b478['length']>=_0x15ffcc:_0xce58ea[_0x4b0416(0x1b6)]<PAGE_SIZE)break;_0xb53227++;}return _0x12b478;}export const sqlStatus={'service':a194_0x149901(0x19e),'command':'status','description':a194_0x149901(0x1b5),'risk':a194_0x149901(0x1a4),'flags':[{'name':a194_0x149901(0x19b),'type':a194_0x149901(0x190),'description':a194_0x149901(0x1b2)}],async 'execute'(_0x9e324){const _0x5af909=a194_0x149901,_0x57b7b5=loadSqlProjectConfig(_0x9e324['appCode']),_0x2604e5=await readSqlLockFile(_0x57b7b5[_0x5af909(0x1ba)]),{appLock:_0x2187fa}=ensureSqlLockScope(_0x2604e5??createEmptySqlLock(),_0x57b7b5[_0x5af909(0x1a5)],_0x57b7b5[_0x5af909(0x1b1)],_0x5af909(0x19a)),_0x38beb5=await scanLocalSqlQueries(_0x57b7b5),_0x1a482c=[],_0x365446=[],_0x21f1ed=[],_0x1e51c5=[],_0x596462=new Set(_0x38beb5['map'](_0x1f0a19=>_0x1f0a19['lockKey']));for(const _0x33fd7b of _0x38beb5){const _0x47f522=await computeSqlFileHash(_0x33fd7b[_0x5af909(0x19d)]),_0x4c5e0c=_0x2187fa[_0x5af909(0x1a1)][_0x33fd7b[_0x5af909(0x195)]],_0x5b6581=!!_0x4c5e0c&&_0x4c5e0c[_0x5af909(0x1b9)]!==_0x33fd7b[_0x5af909(0x1b4)],_0xb59f5=!!_0x4c5e0c&&!!_0x33fd7b[_0x5af909(0x1a8)]&&_0x4c5e0c[_0x5af909(0x1a8)]!==_0x33fd7b[_0x5af909(0x1a8)];if(!_0x4c5e0c)_0x1a482c[_0x5af909(0x194)](_0x33fd7b[_0x5af909(0x195)]);else _0x4c5e0c[_0x5af909(0x1ac)]!==_0x47f522||_0x5b6581||_0xb59f5?_0x365446[_0x5af909(0x194)](_0x33fd7b[_0x5af909(0x195)]):_0x21f1ed['push'](_0x33fd7b[_0x5af909(0x195)]);}for(const _0x34c2bd of Object[_0x5af909(0x1aa)](_0x2187fa[_0x5af909(0x1a1)])){!_0x596462[_0x5af909(0x1a6)](_0x34c2bd)&&_0x1e51c5[_0x5af909(0x194)](_0x34c2bd);}const _0x29345a=[];if(_0x9e324[_0x5af909(0x1af)]('remote')){const _0x14d966=await fetchAllSqlCodes(_0x9e324[_0x5af909(0x1a5)]);for(const _0x118c8b of _0x14d966){!_0x596462[_0x5af909(0x1a6)](_0x118c8b)&&!_0x2187fa[_0x5af909(0x1a1)][_0x118c8b]&&_0x29345a[_0x5af909(0x194)](_0x118c8b);}}const _0x14aa5e=_0x1a482c['length']===0x0&&_0x365446[_0x5af909(0x1b6)]===0x0&&_0x1e51c5[_0x5af909(0x1b6)]===0x0&&_0x29345a[_0x5af909(0x1b6)]===0x0;return{'ok':!![],'data':{'added':_0x1a482c,'modified':_0x365446,'missing':_0x1e51c5,'unchanged':_0x21f1ed,'remoteOnly':_0x29345a},'message':_0x14aa5e?_0x5af909(0x1a9):_0x1a482c['length']+_0x5af909(0x199)+_0x365446[_0x5af909(0x1b6)]+_0x5af909(0x1a0)+_0x1e51c5[_0x5af909(0x1b6)]+_0x5af909(0x1a7)+_0x21f1ed[_0x5af909(0x1b6)]+_0x5af909(0x1b0)+(_0x29345a[_0x5af909(0x1b6)]>0x0?',\x20'+_0x29345a[_0x5af909(0x1b6)]+_0x5af909(0x1b8):'')};}};
@@ -1 +1 @@
1
- const a195_0x2b7273=a195_0x589c;(function(_0x17203e,_0x48e8c9){const _0xcc40f2=a195_0x589c,_0x1db952=_0x17203e();while(!![]){try{const _0x1e19ae=parseInt(_0xcc40f2(0x1a3))/0x1*(-parseInt(_0xcc40f2(0x1c3))/0x2)+-parseInt(_0xcc40f2(0x19d))/0x3*(-parseInt(_0xcc40f2(0x1c8))/0x4)+-parseInt(_0xcc40f2(0x1a7))/0x5+parseInt(_0xcc40f2(0x1ca))/0x6*(parseInt(_0xcc40f2(0x1ac))/0x7)+-parseInt(_0xcc40f2(0x1d3))/0x8*(-parseInt(_0xcc40f2(0x1ad))/0x9)+-parseInt(_0xcc40f2(0x1d6))/0xa+-parseInt(_0xcc40f2(0x1bc))/0xb*(-parseInt(_0xcc40f2(0x1e1))/0xc);if(_0x1e19ae===_0x48e8c9)break;else _0x1db952['push'](_0x1db952['shift']());}catch(_0x543028){_0x1db952['push'](_0x1db952['shift']());}}}(a195_0x5853,0x67b1b));import{readFileSync,existsSync}from'node:fs';function a195_0x589c(_0x4a3cf7,_0x37086b){_0x4a3cf7=_0x4a3cf7-0x19d;const _0x5853fa=a195_0x5853();let _0x589c27=_0x5853fa[_0x4a3cf7];return _0x589c27;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{auditSqlJoinIndexes}from'../../core/sql-index-auditor.js';function a195_0x5853(){const _0x94f6d9=['2mqWxJC','columns','flagMissing','indexName','reason','20FpdvOQ','index_name','174OCbxvB','from','\x22\x20not\x20found\x20or\x20not\x20accessible','length','file','dbtableConfig','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','name','indexes','24SSaJZK','Table\x20\x22','message','1150100wGEBCi','schema:','isArray','tableName','sql','utf-8','isDangerous','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','unshift','index_columns','string','16368wVLoyM','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','331122AhumHl','filter','trim','--check-indexes\x20requires\x20--schemas.','schemas','fields','534901wApepu','str','columnNames','Provide\x20--file\x20or\x20--sql','89325CVKFZp','check-indexes','appCode','valid','dataset','88529kTsyYv','484794PvPQzF','validation','validate','push','map','toLowerCase','parameters','flatMap','bool','pkField','isSelectOnly','SQL\x20schema\x20validation','split','boolean','Dataset\x20\x22','99ZWwDpg','cwd','File\x20not\x20found:\x20','type','schemaWarnings','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','sqlType'];a195_0x5853=function(){return _0x94f6d9;};return a195_0x5853();}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':a195_0x2b7273(0x1da),'command':a195_0x2b7273(0x1af),'description':a195_0x2b7273(0x1d0),'risk':'read','flags':[{'name':a195_0x2b7273(0x1ce),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1c1)},{'name':a195_0x2b7273(0x1da),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1dd)},{'name':a195_0x2b7273(0x1a1),'type':a195_0x2b7273(0x1e0),'description':a195_0x2b7273(0x1e3)},{'name':'check-indexes','type':a195_0x2b7273(0x1ba),'description':a195_0x2b7273(0x1e2)}],async 'execute'(_0x5aa0f3){const _0xdeddc4=a195_0x2b7273,_0x4613c3=_0x5aa0f3['str'](_0xdeddc4(0x1ce)),_0x102c38=_0x5aa0f3['str']('sql'),_0x3b3bdd=_0x5aa0f3[_0xdeddc4(0x1a4)](_0xdeddc4(0x1a1)),_0x3fd671=_0x5aa0f3[_0xdeddc4(0x1b5)](_0xdeddc4(0x1a8));if(!_0x4613c3&&!_0x102c38)throw CliErrors[_0xdeddc4(0x1c5)]('file',_0xdeddc4(0x1a6));if(_0x3fd671&&!_0x3b3bdd)throw CliErrors[_0xdeddc4(0x1ae)](_0xdeddc4(0x1a0));let _0x5ee648;if(_0x4613c3){const _0x336bec=resolve(process[_0xdeddc4(0x1bd)](),_0x4613c3);if(!existsSync(_0x336bec))throw CliErrors['validation'](_0xdeddc4(0x1be)+_0x336bec);_0x5ee648=readFileSync(_0x336bec,_0xdeddc4(0x1db));}else _0x5ee648=_0x102c38;const _0xe9390a=validateSql(_0x5ee648),_0x527fdb={'valid':_0xe9390a[_0xdeddc4(0x1aa)],'sqlType':_0xe9390a[_0xdeddc4(0x1c2)][_0xdeddc4(0x1bf)],'isSelectOnly':_0xe9390a['sqlType'][_0xdeddc4(0x1b7)],'isDangerous':_0xe9390a['sqlType'][_0xdeddc4(0x1dc)],'tables':_0xe9390a['tables'],'parameters':_0xe9390a[_0xdeddc4(0x1b3)],'message':_0xe9390a[_0xdeddc4(0x1d5)]};_0xe9390a['sqlType'][_0xdeddc4(0x1c7)]&&(_0x527fdb[_0xdeddc4(0x1c7)]=_0xe9390a['sqlType'][_0xdeddc4(0x1c7)]);if(_0x3b3bdd&&_0xe9390a[_0xdeddc4(0x1aa)]){const _0x4f0017=_0x3b3bdd[_0xdeddc4(0x1b9)](',')[_0xdeddc4(0x1b1)](_0x41a729=>_0x41a729[_0xdeddc4(0x19f)]())[_0xdeddc4(0x19e)](Boolean),_0x1471ce=[],_0x9c97bb=[],_0x2e6e6e=filterDbTableBackedDatasets(await listDatasets(_0x5aa0f3[_0xdeddc4(0x1a9)])),_0x231939=new Map(_0x2e6e6e[_0xdeddc4(0x1b1)](_0x19ac9b=>[_0x19ac9b[_0xdeddc4(0x1cf)]?.[_0xdeddc4(0x1d9)]?.[_0xdeddc4(0x1b2)](),_0x19ac9b]));for(const _0x35c837 of _0xe9390a['tables']){const _0xbf6188=_0x231939['get'](_0x35c837[_0xdeddc4(0x1b2)]());!_0xbf6188&&_0x1471ce['push'](_0xdeddc4(0x1d4)+_0x35c837+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x3479a6 of _0x4f0017){let _0x40111c;try{_0x40111c=await getDatasetDetail(_0x3479a6);}catch{_0x1471ce[_0xdeddc4(0x1b0)](_0xdeddc4(0x1bb)+_0x3479a6+_0xdeddc4(0x1cc));continue;}assertDatasetIsDbTableBacked(_0x40111c,_0xdeddc4(0x1b8));const _0x19ff9d=Array[_0xdeddc4(0x1d8)](_0x40111c['fields'])?_0x40111c[_0xdeddc4(0x1a2)]:[],_0x323daa=new Set(_0x19ff9d[_0xdeddc4(0x1b1)](_0x514f8a=>_0x514f8a['name']?.[_0xdeddc4(0x1b2)]())),_0xd0a5d4=_0x40111c['dbtableConfig']?.[_0xdeddc4(0x1d9)]||_0x40111c[_0xdeddc4(0x1d9)]||_0x3479a6;_0x527fdb[_0xdeddc4(0x1d7)+_0xd0a5d4]={'code':_0x3479a6,'tableName':_0xd0a5d4,'fieldCount':_0x323daa['size'],'fields':Array[_0xdeddc4(0x1cb)](_0x323daa)};if(_0x3fd671){const _0x4953b1=normalizeDatasetIndexes(_0x40111c);_0x9c97bb[_0xdeddc4(0x1b0)]({'tableName':_0xd0a5d4,..._0x4953b1});}}_0x1471ce[_0xdeddc4(0x1cd)]>0x0&&(_0x527fdb[_0xdeddc4(0x1c0)]=_0x1471ce),_0x3fd671&&(_0x527fdb['joinAudit']=auditSqlJoinIndexes(_0x5ee648,_0x9c97bb));}return{'ok':_0xe9390a[_0xdeddc4(0x1aa)],'data':_0x527fdb,'message':_0xe9390a[_0xdeddc4(0x1d5)]};}};function normalizeDatasetIndexes(_0x5e99a9){const _0x148651=a195_0x2b7273,_0x492228=Array['isArray'](_0x5e99a9?.[_0x148651(0x1ab)]?.[_0x148651(0x1d2)])?_0x5e99a9[_0x148651(0x1ab)][_0x148651(0x1d2)]:Array[_0x148651(0x1d8)](_0x5e99a9?.[_0x148651(0x1d2)])?_0x5e99a9['indexes']:[],_0x16ff12=_0x492228[_0x148651(0x1b4)](_0x48333a=>{const _0x4d9b27=_0x148651,_0x419720=Array['isArray'](_0x48333a?.[_0x4d9b27(0x1df)])?_0x48333a['index_columns']:Array[_0x4d9b27(0x1d8)](_0x48333a?.[_0x4d9b27(0x1a5)])?_0x48333a[_0x4d9b27(0x1a5)]:Array[_0x4d9b27(0x1d8)](_0x48333a?.['columns'])?_0x48333a[_0x4d9b27(0x1c4)]:[],_0xa32b98=_0x419720[_0x4d9b27(0x19e)](_0x2dcb26=>typeof _0x2dcb26===_0x4d9b27(0x1e0))[_0x4d9b27(0x1b1)](_0xd6aecd=>_0xd6aecd[_0x4d9b27(0x19f)]())[_0x4d9b27(0x19e)](Boolean);if(_0xa32b98[_0x4d9b27(0x1cd)]===0x0)return[];const _0x3eebfb=[_0x48333a?.[_0x4d9b27(0x1c6)],_0x48333a?.[_0x4d9b27(0x1c9)],_0x48333a?.[_0x4d9b27(0x1d1)]]['find'](_0x2857ea=>typeof _0x2857ea===_0x4d9b27(0x1e0)&&_0x2857ea[_0x4d9b27(0x19f)]()),_0x5c9401=[_0x48333a?.['index_type'],_0x48333a?.['type']]['find'](_0x21a61f=>typeof _0x21a61f===_0x4d9b27(0x1e0)&&_0x21a61f[_0x4d9b27(0x19f)]());return[{..._0x3eebfb?{'name':_0x3eebfb[_0x4d9b27(0x19f)]()}:{},..._0x5c9401?{'type':_0x5c9401[_0x4d9b27(0x19f)]()}:{},'columns':_0xa32b98}];}),_0x147988=[..._0x16ff12],_0x123156=typeof _0x5e99a9?.[_0x148651(0x1cf)]?.[_0x148651(0x1b6)]===_0x148651(0x1e0)?_0x5e99a9[_0x148651(0x1cf)]['pkField']['split'](',')[_0x148651(0x1b1)](_0x37fe35=>_0x37fe35[_0x148651(0x19f)]())[_0x148651(0x19e)](Boolean):[];return _0x123156[_0x148651(0x1cd)]>0x0&&_0x147988[_0x148651(0x1de)]({'type':'primary','columns':_0x123156}),{'indexes':_0x147988,'metadataAvailable':_0x16ff12['length']>0x0};}
1
+ const a195_0x5bc679=a195_0x3647;(function(_0x2dd08a,_0x4422a2){const _0x107ed6=a195_0x3647,_0x5245da=_0x2dd08a();while(!![]){try{const _0x597591=-parseInt(_0x107ed6(0x1f1))/0x1*(parseInt(_0x107ed6(0x1c3))/0x2)+parseInt(_0x107ed6(0x1cb))/0x3+-parseInt(_0x107ed6(0x1cf))/0x4+parseInt(_0x107ed6(0x1ee))/0x5*(-parseInt(_0x107ed6(0x1c8))/0x6)+parseInt(_0x107ed6(0x1c5))/0x7*(-parseInt(_0x107ed6(0x1d8))/0x8)+-parseInt(_0x107ed6(0x1ce))/0x9*(-parseInt(_0x107ed6(0x1dc))/0xa)+-parseInt(_0x107ed6(0x1e4))/0xb*(-parseInt(_0x107ed6(0x1c1))/0xc);if(_0x597591===_0x4422a2)break;else _0x5245da['push'](_0x5245da['shift']());}catch(_0x1efde2){_0x5245da['push'](_0x5245da['shift']());}}}(a195_0x2a68,0x33e2a));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':a195_0x5bc679(0x1e1),'command':a195_0x5bc679(0x1d2),'description':a195_0x5bc679(0x1e0),'risk':a195_0x5bc679(0x1e9),'flags':[{'name':a195_0x5bc679(0x1e8),'type':a195_0x5bc679(0x1e3),'description':a195_0x5bc679(0x1f8)},{'name':a195_0x5bc679(0x1e1),'type':a195_0x5bc679(0x1e3),'description':a195_0x5bc679(0x1fc)},{'name':a195_0x5bc679(0x1d1),'type':a195_0x5bc679(0x1e3),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'},{'name':a195_0x5bc679(0x1d0),'type':a195_0x5bc679(0x1e5),'description':a195_0x5bc679(0x1ed)}],async 'execute'(_0x6e8ee6){const _0x248da7=a195_0x5bc679,_0x3cabe6=_0x6e8ee6[_0x248da7(0x1c6)]('file'),_0x2d2004=_0x6e8ee6[_0x248da7(0x1c6)]('sql'),_0x425aa3=_0x6e8ee6[_0x248da7(0x1c6)](_0x248da7(0x1d1)),_0x3cd9a5=_0x6e8ee6[_0x248da7(0x1ec)](_0x248da7(0x1d0));if(!_0x3cabe6&&!_0x2d2004)throw CliErrors['flagMissing'](_0x248da7(0x1e8),_0x248da7(0x1f9));if(_0x3cd9a5&&!_0x425aa3)throw CliErrors[_0x248da7(0x200)]('--check-indexes\x20requires\x20--schemas.');let _0x51c70c;if(_0x3cabe6){const _0x14931a=resolve(process[_0x248da7(0x1dd)](),_0x3cabe6);if(!existsSync(_0x14931a))throw CliErrors['validation'](_0x248da7(0x1d4)+_0x14931a);_0x51c70c=readFileSync(_0x14931a,'utf-8');}else _0x51c70c=_0x2d2004;const _0x54a766=validateSql(_0x51c70c),_0x56aab1={'valid':_0x54a766[_0x248da7(0x1bf)],'sqlType':_0x54a766[_0x248da7(0x1c7)][_0x248da7(0x1f5)],'isSelectOnly':_0x54a766[_0x248da7(0x1c7)][_0x248da7(0x1fa)],'isDangerous':_0x54a766['sqlType']['isDangerous'],'tables':_0x54a766[_0x248da7(0x1f2)],'parameters':_0x54a766[_0x248da7(0x1f6)],'message':_0x54a766['message']};_0x54a766['sqlType'][_0x248da7(0x1e2)]&&(_0x56aab1[_0x248da7(0x1e2)]=_0x54a766[_0x248da7(0x1c7)]['reason']);if(_0x425aa3&&_0x54a766['valid']){const _0x4b1b3d=_0x425aa3['split'](',')['map'](_0x26fdad=>_0x26fdad[_0x248da7(0x1df)]())[_0x248da7(0x1f0)](Boolean),_0x21cab7=[],_0x54db13=[],_0x5591bc=filterDbTableBackedDatasets(await listDatasets(_0x6e8ee6['appCode'])),_0x4321be=new Map(_0x5591bc[_0x248da7(0x1db)](_0x26cfa3=>[_0x26cfa3[_0x248da7(0x1fb)]?.[_0x248da7(0x1d9)]?.['toLowerCase'](),_0x26cfa3]));for(const _0x58962f of _0x54a766[_0x248da7(0x1f2)]){const _0x379736=_0x4321be['get'](_0x58962f[_0x248da7(0x1de)]());!_0x379736&&_0x21cab7['push']('Table\x20\x22'+_0x58962f+_0x248da7(0x1d6));}for(const _0x38aac0 of _0x4b1b3d){let _0x4d3cef;try{_0x4d3cef=await getDatasetDetail(_0x38aac0);}catch{_0x21cab7['push'](_0x248da7(0x1c9)+_0x38aac0+_0x248da7(0x1fd));continue;}assertDatasetIsDbTableBacked(_0x4d3cef,_0x248da7(0x1be));const _0xbe171=Array[_0x248da7(0x1f4)](_0x4d3cef[_0x248da7(0x1cc)])?_0x4d3cef[_0x248da7(0x1cc)]:[],_0x2bf9bf=new Set(_0xbe171[_0x248da7(0x1db)](_0x5560d3=>_0x5560d3[_0x248da7(0x1da)]?.[_0x248da7(0x1de)]())),_0xc7b09f=_0x4d3cef[_0x248da7(0x1fb)]?.[_0x248da7(0x1d9)]||_0x4d3cef[_0x248da7(0x1d9)]||_0x38aac0;_0x56aab1[_0x248da7(0x1ea)+_0xc7b09f]={'code':_0x38aac0,'tableName':_0xc7b09f,'fieldCount':_0x2bf9bf['size'],'fields':Array['from'](_0x2bf9bf)};if(_0x3cd9a5){const _0x27f8cd=normalizeDatasetIndexes(_0x4d3cef);_0x54db13[_0x248da7(0x1eb)]({'tableName':_0xc7b09f,..._0x27f8cd});}}_0x21cab7[_0x248da7(0x1f7)]>0x0&&(_0x56aab1[_0x248da7(0x1cd)]=_0x21cab7),_0x3cd9a5&&(_0x56aab1['joinAudit']=auditSqlJoinIndexes(_0x51c70c,_0x54db13));}return{'ok':_0x54a766['valid'],'data':_0x56aab1,'message':_0x54a766[_0x248da7(0x1f3)]};}};function normalizeDatasetIndexes(_0x9c3e3){const _0x50fe32=a195_0x5bc679,_0x2966a5=Array[_0x50fe32(0x1f4)](_0x9c3e3?.[_0x50fe32(0x1c4)]?.[_0x50fe32(0x1e7)])?_0x9c3e3[_0x50fe32(0x1c4)][_0x50fe32(0x1e7)]:Array[_0x50fe32(0x1f4)](_0x9c3e3?.[_0x50fe32(0x1e7)])?_0x9c3e3[_0x50fe32(0x1e7)]:[],_0x4dc363=_0x2966a5[_0x50fe32(0x1ff)](_0x3bad4a=>{const _0x5b14fc=_0x50fe32,_0x71ce84=Array[_0x5b14fc(0x1f4)](_0x3bad4a?.[_0x5b14fc(0x1ca)])?_0x3bad4a[_0x5b14fc(0x1ca)]:Array[_0x5b14fc(0x1f4)](_0x3bad4a?.[_0x5b14fc(0x1ef)])?_0x3bad4a[_0x5b14fc(0x1ef)]:Array[_0x5b14fc(0x1f4)](_0x3bad4a?.[_0x5b14fc(0x1d7)])?_0x3bad4a['columns']:[],_0x2ee5e9=_0x71ce84['filter'](_0x244f81=>typeof _0x244f81===_0x5b14fc(0x1e3))[_0x5b14fc(0x1db)](_0x31f33a=>_0x31f33a['trim']())[_0x5b14fc(0x1f0)](Boolean);if(_0x2ee5e9[_0x5b14fc(0x1f7)]===0x0)return[];const _0x2daf76=[_0x3bad4a?.[_0x5b14fc(0x1e6)],_0x3bad4a?.['index_name'],_0x3bad4a?.[_0x5b14fc(0x1da)]][_0x5b14fc(0x1fe)](_0xec66d0=>typeof _0xec66d0===_0x5b14fc(0x1e3)&&_0xec66d0['trim']()),_0x7213a0=[_0x3bad4a?.[_0x5b14fc(0x1c2)],_0x3bad4a?.[_0x5b14fc(0x1f5)]][_0x5b14fc(0x1fe)](_0x3c3713=>typeof _0x3c3713===_0x5b14fc(0x1e3)&&_0x3c3713[_0x5b14fc(0x1df)]());return[{..._0x2daf76?{'name':_0x2daf76[_0x5b14fc(0x1df)]()}:{},..._0x7213a0?{'type':_0x7213a0[_0x5b14fc(0x1df)]()}:{},'columns':_0x2ee5e9}];}),_0x44436c=[..._0x4dc363],_0x3b0e5f=typeof _0x9c3e3?.['dbtableConfig']?.[_0x50fe32(0x1d5)]===_0x50fe32(0x1e3)?_0x9c3e3[_0x50fe32(0x1fb)][_0x50fe32(0x1d5)]['split'](',')['map'](_0x2a04eb=>_0x2a04eb['trim']())[_0x50fe32(0x1f0)](Boolean):[];return _0x3b0e5f[_0x50fe32(0x1f7)]>0x0&&_0x44436c[_0x50fe32(0x1d3)]({'type':_0x50fe32(0x1c0),'columns':_0x3b0e5f}),{'indexes':_0x44436c,'metadataAvailable':_0x4dc363[_0x50fe32(0x1f7)]>0x0};}function a195_0x3647(_0x5ca883,_0x8ba441){_0x5ca883=_0x5ca883-0x1be;const _0x2a6878=a195_0x2a68();let _0x36479d=_0x2a6878[_0x5ca883];return _0x36479d;}function a195_0x2a68(){const _0x56c04d=['isArray','type','parameters','length','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','Provide\x20--file\x20or\x20--sql','isSelectOnly','dbtableConfig','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','\x22\x20not\x20found\x20or\x20not\x20accessible','find','flatMap','validation','SQL\x20schema\x20validation','valid','primary','7553172xKVMST','index_type','133806rtviNa','dataset','456834yZhGtT','str','sqlType','120FIwwLx','Dataset\x20\x22','index_columns','149559ksReJB','fields','schemaWarnings','369zKiEaB','473344PVDIkT','check-indexes','schemas','validate','unshift','File\x20not\x20found:\x20','pkField','\x22\x20not\x20found\x20in\x20any\x20dataset','columns','8tCGtKj','tableName','name','map','26990fNFCIE','cwd','toLowerCase','trim','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','sql','reason','string','11CifnQu','boolean','indexName','indexes','file','read','schema:','push','bool','Audit\x20top-level\x20JOIN\x20equality\x20predicates\x20against\x20dataset\x20index\x20metadata','81730GySLZc','columnNames','filter','1ugZAZp','tables','message'];a195_0x2a68=function(){return _0x56c04d;};return a195_0x2a68();}
@@ -1 +1 @@
1
- function a196_0x1b4d(){const _0x2eedc2=['725820DJpddd','84bEVjvx','4nkeNqM','12933256egwFXX','2131014dXyabb','2493205KQylqT','1580352cWKqvr','73236348zBcuFe','2888688RQiGaU'];a196_0x1b4d=function(){return _0x2eedc2;};return a196_0x1b4d();}function a196_0x423e(_0x15c9ea,_0x11cf65){_0x15c9ea=_0x15c9ea-0x11b;const _0x1b4d03=a196_0x1b4d();let _0x423e51=_0x1b4d03[_0x15c9ea];return _0x423e51;}(function(_0x517b8f,_0x4c4d8b){const _0x337a44=a196_0x423e,_0x46c7b3=_0x517b8f();while(!![]){try{const _0x24e9a7=-parseInt(_0x337a44(0x11f))/0x1+-parseInt(_0x337a44(0x121))/0x2+parseInt(_0x337a44(0x11d))/0x3*(-parseInt(_0x337a44(0x11b))/0x4)+-parseInt(_0x337a44(0x11e))/0x5+-parseInt(_0x337a44(0x122))/0x6*(parseInt(_0x337a44(0x123))/0x7)+-parseInt(_0x337a44(0x11c))/0x8+parseInt(_0x337a44(0x120))/0x9;if(_0x24e9a7===_0x4c4d8b)break;else _0x46c7b3['push'](_0x46c7b3['shift']());}catch(_0xb97637){_0x46c7b3['push'](_0x46c7b3['shift']());}}}(a196_0x1b4d,0xcbf48));import{taskStatus}from'../../commands/task/status.js';export const taskDefinitions=[taskStatus];
1
+ (function(_0x1a837a,_0x530033){const _0x48c01e=a196_0x3ec0,_0x34c48c=_0x1a837a();while(!![]){try{const _0x58dda1=-parseInt(_0x48c01e(0x1f0))/0x1*(parseInt(_0x48c01e(0x1f8))/0x2)+parseInt(_0x48c01e(0x1f4))/0x3*(parseInt(_0x48c01e(0x1f2))/0x4)+-parseInt(_0x48c01e(0x1f1))/0x5+parseInt(_0x48c01e(0x1f5))/0x6*(-parseInt(_0x48c01e(0x1ef))/0x7)+-parseInt(_0x48c01e(0x1f6))/0x8+-parseInt(_0x48c01e(0x1f3))/0x9*(-parseInt(_0x48c01e(0x1f9))/0xa)+parseInt(_0x48c01e(0x1f7))/0xb;if(_0x58dda1===_0x530033)break;else _0x34c48c['push'](_0x34c48c['shift']());}catch(_0x2b31bb){_0x34c48c['push'](_0x34c48c['shift']());}}}(a196_0x45ae,0x37546));import{taskStatus}from'../../commands/task/status.js';function a196_0x45ae(){const _0x3da969=['520352UZPend','1854281GjQpdz','8FKPiHx','30930nGROIM','252mLZjqi','22406TzIehg','1093020GTRFnJ','4noUSge','999KbOzef','274824efljKY','600pTiHRE'];a196_0x45ae=function(){return _0x3da969;};return a196_0x45ae();}function a196_0x3ec0(_0x5f03f4,_0x3a2d28){_0x5f03f4=_0x5f03f4-0x1ef;const _0x45ae2e=a196_0x45ae();let _0x3ec0ef=_0x45ae2e[_0x5f03f4];return _0x3ec0ef;}export const taskDefinitions=[taskStatus];
@@ -1 +1 @@
1
- const a197_0x86ef15=a197_0x39a7;(function(_0x2da726,_0x240a29){const _0x5b5a4d=a197_0x39a7,_0x1f83cc=_0x2da726();while(!![]){try{const _0x511ae5=parseInt(_0x5b5a4d(0x117))/0x1+-parseInt(_0x5b5a4d(0x11f))/0x2+parseInt(_0x5b5a4d(0x11c))/0x3*(parseInt(_0x5b5a4d(0x11d))/0x4)+-parseInt(_0x5b5a4d(0x124))/0x5+-parseInt(_0x5b5a4d(0x126))/0x6+parseInt(_0x5b5a4d(0x12c))/0x7*(parseInt(_0x5b5a4d(0x12b))/0x8)+parseInt(_0x5b5a4d(0x121))/0x9;if(_0x511ae5===_0x240a29)break;else _0x1f83cc['push'](_0x1f83cc['shift']());}catch(_0x51ea85){_0x1f83cc['push'](_0x1f83cc['shift']());}}}(a197_0x37a8,0x5a7b3));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';import{CliErrors}from'../../errors.js';function a197_0x37a8(){const _0x403858=['33HBTYej','79796mEdyRB','cookie','1132248GsJoHr','Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','9436194znLlYF','trim','appCode','1448110oGnAaf','taskId','3762492FnbDJD','isTerminal','str','compress','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','3128432SnsTQh','7Capaem','apiError','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','flagMissing','194480JOFkWm','task-id','read','task','string'];a197_0x37a8=function(){return _0x403858;};return a197_0x37a8();}function a197_0x39a7(_0x5a0cae,_0x4a0a1a){_0x5a0cae=_0x5a0cae-0x116;const _0x37a898=a197_0x37a8();let _0x39a7f4=_0x37a898[_0x5a0cae];return _0x39a7f4;}export const taskStatus={'service':a197_0x86ef15(0x11a),'command':'status','description':a197_0x86ef15(0x120),'risk':a197_0x86ef15(0x119),'defaultOutputFormat':a197_0x86ef15(0x129),'structuredErrors':!![],'flags':[{'name':a197_0x86ef15(0x118),'type':a197_0x86ef15(0x11b),'required':!![],'description':a197_0x86ef15(0x12e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3fc11a){const _0x3b7da6=a197_0x86ef15;if(!_0x3fc11a[_0x3b7da6(0x128)](_0x3b7da6(0x118))[_0x3b7da6(0x122)]())throw CliErrors[_0x3b7da6(0x116)]('task-id');},async 'execute'(_0x33912b){const _0x3f3223=a197_0x86ef15,_0x43bb59=_0x33912b[_0x3f3223(0x128)]('task-id')[_0x3f3223(0x122)](),_0x466bff=normalizeAsyncTask(await getAsyncTaskStatus(_0x43bb59,_0x33912b[_0x3f3223(0x123)],_0x33912b[_0x3f3223(0x11e)]));if(_0x466bff[_0x3f3223(0x125)]!==_0x43bb59)throw CliErrors[_0x3f3223(0x12d)](_0x3f3223(0x12a)+_0x43bb59+',\x20received\x20'+_0x466bff['taskId']+'.');const _0x45e860=buildAsyncTaskStatusCommand(_0x466bff[_0x3f3223(0x125)],_0x33912b[_0x3f3223(0x123)]);return{'ok':!![],'message':asyncTaskMessage(_0x466bff),'data':{'appCode':_0x33912b[_0x3f3223(0x123)],..._0x466bff,'query':_0x466bff[_0x3f3223(0x127)]?null:{'command':_0x45e860}}};}};
1
+ const a197_0x4a7bec=a197_0x44ad;function a197_0x2fd9(){const _0x1d10e0=['flagMissing','trim','4819638bohoql','task-id','taskId','248552DiItZb','7872116gDTQUS','appCode','9gXrbYq','4179906gcVbSq',',\x20received\x20','25wYYaOA','status','180KXFMrS','str','Task\x20status\x20response\x20id\x20mismatch:\x20requested\x20','Task\x20id\x20returned\x20by\x20an\x20asynchronous\x20platform\x20command','cookie','714109MoiUEB','read','4778RGrvhF','390568OLOOKY','string','494DFTqlJ'];a197_0x2fd9=function(){return _0x1d10e0;};return a197_0x2fd9();}function a197_0x44ad(_0x290bd3,_0x36eb14){_0x290bd3=_0x290bd3-0x97;const _0x2fd90f=a197_0x2fd9();let _0x44ad9b=_0x2fd90f[_0x290bd3];return _0x44ad9b;}(function(_0x58a8c0,_0x20d255){const _0x52e387=a197_0x44ad,_0x3272e3=_0x58a8c0();while(!![]){try{const _0x149bad=parseInt(_0x52e387(0xa7))/0x1*(-parseInt(_0x52e387(0xaa))/0x2)+parseInt(_0x52e387(0x9c))/0x3+parseInt(_0x52e387(0x98))/0x4*(-parseInt(_0x52e387(0x9e))/0x5)+parseInt(_0x52e387(0xad))/0x6+-parseInt(_0x52e387(0x99))/0x7+parseInt(_0x52e387(0xa8))/0x8*(-parseInt(_0x52e387(0x9b))/0x9)+parseInt(_0x52e387(0xa0))/0xa*(parseInt(_0x52e387(0xa5))/0xb);if(_0x149bad===_0x20d255)break;else _0x3272e3['push'](_0x3272e3['shift']());}catch(_0x5f02a4){_0x3272e3['push'](_0x3272e3['shift']());}}}(a197_0x2fd9,0xab1b4));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';import{CliErrors}from'../../errors.js';export const taskStatus={'service':'task','command':a197_0x4a7bec(0x9f),'description':'Query\x20an\x20asynchronous\x20task;\x20repeat\x20for\x20PENDING\x20or\x20PROCESSING\x20until\x20SUCCESS\x20or\x20FAILED','risk':a197_0x4a7bec(0xa6),'defaultOutputFormat':'compress','structuredErrors':!![],'flags':[{'name':a197_0x4a7bec(0xae),'type':a197_0x4a7bec(0xa9),'required':!![],'description':a197_0x4a7bec(0xa3)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x20177b){const _0x3fb04c=a197_0x4a7bec;if(!_0x20177b[_0x3fb04c(0xa1)](_0x3fb04c(0xae))[_0x3fb04c(0xac)]())throw CliErrors[_0x3fb04c(0xab)](_0x3fb04c(0xae));},async 'execute'(_0x5bac12){const _0x5c26d6=a197_0x4a7bec,_0x2dca85=_0x5bac12[_0x5c26d6(0xa1)](_0x5c26d6(0xae))['trim'](),_0x2517d9=normalizeAsyncTask(await getAsyncTaskStatus(_0x2dca85,_0x5bac12[_0x5c26d6(0x9a)],_0x5bac12[_0x5c26d6(0xa4)]));if(_0x2517d9[_0x5c26d6(0x97)]!==_0x2dca85)throw CliErrors['apiError'](_0x5c26d6(0xa2)+_0x2dca85+_0x5c26d6(0x9d)+_0x2517d9[_0x5c26d6(0x97)]+'.');const _0x1391c6=buildAsyncTaskStatusCommand(_0x2517d9[_0x5c26d6(0x97)],_0x5bac12[_0x5c26d6(0x9a)]);return{'ok':!![],'message':asyncTaskMessage(_0x2517d9),'data':{'appCode':_0x5bac12[_0x5c26d6(0x9a)],..._0x2517d9,'query':_0x2517d9['isTerminal']?null:{'command':_0x1391c6}}};}};
@@ -1 +1 @@
1
- function a198_0x2f15(_0x1717c9,_0x4af7c8){_0x1717c9=_0x1717c9-0x17a;const _0x4db4c6=a198_0x4db4();let _0x2f1521=_0x4db4c6[_0x1717c9];return _0x2f1521;}(function(_0x5a0601,_0x2834e1){const _0x408823=a198_0x2f15,_0xbc6763=_0x5a0601();while(!![]){try{const _0xf36b28=parseInt(_0x408823(0x180))/0x1*(parseInt(_0x408823(0x17d))/0x2)+parseInt(_0x408823(0x182))/0x3+parseInt(_0x408823(0x185))/0x4+-parseInt(_0x408823(0x183))/0x5*(parseInt(_0x408823(0x17f))/0x6)+parseInt(_0x408823(0x17e))/0x7*(parseInt(_0x408823(0x181))/0x8)+-parseInt(_0x408823(0x184))/0x9*(parseInt(_0x408823(0x17b))/0xa)+-parseInt(_0x408823(0x17c))/0xb*(parseInt(_0x408823(0x17a))/0xc);if(_0xf36b28===_0x2834e1)break;else _0xbc6763['push'](_0xbc6763['shift']());}catch(_0x46dcee){_0xbc6763['push'](_0xbc6763['shift']());}}}(a198_0x4db4,0xd2f80));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];function a198_0x4db4(){const _0x38fffe=['2440491YsabpS','5yfsOty','12344607nMVtnK','4993940WYlvzJ','24JXTcIf','10KJllDi','4443901VemtZE','526LyhocT','707qhumTl','5421732mZrKoW','1934bwHnmN','109048YbGQHZ'];a198_0x4db4=function(){return _0x38fffe;};return a198_0x4db4();}
1
+ function a198_0x2537(){const _0x4766c0=['4178512JQSFGH','8jXoAvg','601481TWDekV','8596800QrWbdk','7fWllnG','11043576lTTtnf','2497656GwqzSF','4685544pdWXeD','81894nVVvHB'];a198_0x2537=function(){return _0x4766c0;};return a198_0x2537();}function a198_0x25f2(_0x1ccde6,_0x2e5170){_0x1ccde6=_0x1ccde6-0x1a0;const _0x2537c7=a198_0x2537();let _0x25f266=_0x2537c7[_0x1ccde6];return _0x25f266;}(function(_0x59808e,_0x47e43f){const _0x598ddb=a198_0x25f2,_0x4bc8f3=_0x59808e();while(!![]){try{const _0x1c3344=parseInt(_0x598ddb(0x1a0))/0x1+-parseInt(_0x598ddb(0x1a4))/0x2+parseInt(_0x598ddb(0x1a6))/0x3*(-parseInt(_0x598ddb(0x1a8))/0x4)+parseInt(_0x598ddb(0x1a1))/0x5+-parseInt(_0x598ddb(0x1a5))/0x6*(parseInt(_0x598ddb(0x1a2))/0x7)+-parseInt(_0x598ddb(0x1a7))/0x8+parseInt(_0x598ddb(0x1a3))/0x9;if(_0x1c3344===_0x47e43f)break;else _0x4bc8f3['push'](_0x4bc8f3['shift']());}catch(_0x514012){_0x4bc8f3['push'](_0x4bc8f3['shift']());}}}(a198_0x2537,0xe5cbb));import{tenantMembersListDefinition}from'../../commands/tenant/members-list.js';export const tenantDefinitions=[tenantMembersListDefinition];
@@ -1 +1 @@
1
- const a199_0x3a7cf0=a199_0xd2b7;(function(_0xe495d0,_0x50b7d8){const _0x49113b=a199_0xd2b7,_0x33c50d=_0xe495d0();while(!![]){try{const _0x29c7b1=parseInt(_0x49113b(0x118))/0x1+parseInt(_0x49113b(0x113))/0x2+-parseInt(_0x49113b(0x11a))/0x3+parseInt(_0x49113b(0x117))/0x4+parseInt(_0x49113b(0x115))/0x5*(parseInt(_0x49113b(0x112))/0x6)+parseInt(_0x49113b(0x11f))/0x7*(-parseInt(_0x49113b(0x11d))/0x8)+parseInt(_0x49113b(0x114))/0x9*(-parseInt(_0x49113b(0x122))/0xa);if(_0x29c7b1===_0x50b7d8)break;else _0x33c50d['push'](_0x33c50d['shift']());}catch(_0x1267e2){_0x33c50d['push'](_0x33c50d['shift']());}}}(a199_0x479a,0x95e6d));function a199_0x479a(){const _0x50ddea=['42088eHwsAT','read','826QogaWg','Found\x20','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','1436430KsBwci','str','string','tenant-code','18294WQVWNg','741374WaErwp','117rNalUW','1685XdXvlk','Pass\x20--tenant-code\x20<code>.','3225300mEAdeb','1188593xFSqpZ','tenant','872892KnZDJC','trim','length'];a199_0x479a=function(){return _0x50ddea;};return a199_0x479a();}import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a199_0xd2b7(_0x6ed401,_0x20cce1){_0x6ed401=_0x6ed401-0x10f;const _0x479a79=a199_0x479a();let _0xd2b727=_0x479a79[_0x6ed401];return _0xd2b727;}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a199_0x3a7cf0(0x119),'command':'members-list','description':a199_0x3a7cf0(0x121),'risk':a199_0x3a7cf0(0x11e),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a199_0x3a7cf0(0x111),'type':a199_0x3a7cf0(0x110),'required':!![],'description':'Exact\x20tenant\x20code'}],async 'validate'(_0x17ec24){const _0x59b57c=a199_0x3a7cf0;if(!_0x17ec24[_0x59b57c(0x10f)](_0x59b57c(0x111))['trim']())throw CliErrors['flagMissing']('tenant-code',_0x59b57c(0x116));},async 'execute'(_0x3e405){const _0x4833c9=a199_0x3a7cf0,_0x40ae23=_0x3e405[_0x4833c9(0x10f)]('tenant-code')[_0x4833c9(0x11b)](),_0x4789e1=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x40ae23,_0x4789e1);const _0x3fb9d1=projectTenantMembers(await listTenantDirectoryMembers(_0x40ae23));return{'ok':!![],'data':{'tenantCode':_0x40ae23,'items':_0x3fb9d1,'totalCount':_0x3fb9d1[_0x4833c9(0x11c)]},'message':_0x4833c9(0x120)+_0x3fb9d1[_0x4833c9(0x11c)]+'\x20tenant\x20member(s)'};}};
1
+ const a199_0xe27287=a199_0x1a2a;(function(_0x520d08,_0x59fc49){const _0x4928c0=a199_0x1a2a,_0x20f73d=_0x520d08();while(!![]){try{const _0x14b466=parseInt(_0x4928c0(0x136))/0x1*(-parseInt(_0x4928c0(0x135))/0x2)+parseInt(_0x4928c0(0x13d))/0x3+parseInt(_0x4928c0(0x130))/0x4+-parseInt(_0x4928c0(0x13a))/0x5*(-parseInt(_0x4928c0(0x13e))/0x6)+parseInt(_0x4928c0(0x143))/0x7*(-parseInt(_0x4928c0(0x138))/0x8)+parseInt(_0x4928c0(0x131))/0x9+-parseInt(_0x4928c0(0x13b))/0xa;if(_0x14b466===_0x59fc49)break;else _0x20f73d['push'](_0x20f73d['shift']());}catch(_0x534bd3){_0x20f73d['push'](_0x20f73d['shift']());}}}(a199_0x44ab,0x73e45));import{listCurrentUserTenantMemberships,listTenantDirectoryMembers}from'../../core/api-client.js';function a199_0x1a2a(_0x303138,_0x438773){_0x303138=_0x303138-0x12f;const _0x44ab88=a199_0x44ab();let _0x1a2a43=_0x44ab88[_0x303138];return _0x1a2a43;}import{CliErrors}from'../../errors.js';function a199_0x44ab(){const _0x4d94fc=['\x20tenant\x20member(s)','2275347SQFxoR','156OjCrwZ','tenant','Found\x20','length','read','7MfMsVr','str','members-list','2607980ssKTQw','6208110jLHrSl','tenant-code','Pass\x20--tenant-code\x20<code>.','trim','2zdOEVE','484221faNHUw','Exact\x20tenant\x20code','4300096sPWJll','List\x20members\x20of\x20a\x20tenant\x20available\x20to\x20the\x20current\x20account','47925KTzyXq','8530180NhEMAk'];a199_0x44ab=function(){return _0x4d94fc;};return a199_0x44ab();}import{assertTenantAccessible,projectTenantMembers}from'../../commands/tenant/shared.js';export const tenantMembersListDefinition={'service':a199_0xe27287(0x13f),'command':a199_0xe27287(0x12f),'description':a199_0xe27287(0x139),'risk':a199_0xe27287(0x142),'requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a199_0xe27287(0x132),'type':'string','required':!![],'description':a199_0xe27287(0x137)}],async 'validate'(_0x2c4734){const _0x5bc38d=a199_0xe27287;if(!_0x2c4734[_0x5bc38d(0x144)](_0x5bc38d(0x132))[_0x5bc38d(0x134)]())throw CliErrors['flagMissing'](_0x5bc38d(0x132),_0x5bc38d(0x133));},async 'execute'(_0x268d25){const _0xbafd8b=a199_0xe27287,_0x1f49b9=_0x268d25[_0xbafd8b(0x144)](_0xbafd8b(0x132))[_0xbafd8b(0x134)](),_0x3a9656=await listCurrentUserTenantMemberships();assertTenantAccessible(_0x1f49b9,_0x3a9656);const _0x78994=projectTenantMembers(await listTenantDirectoryMembers(_0x1f49b9));return{'ok':!![],'data':{'tenantCode':_0x1f49b9,'items':_0x78994,'totalCount':_0x78994[_0xbafd8b(0x141)]},'message':_0xbafd8b(0x140)+_0x78994[_0xbafd8b(0x141)]+_0xbafd8b(0x13c)};}};
@@ -1 +1 @@
1
- (function(_0x1dd1e0,_0x98c4b8){const _0x3a3957=a200_0x3cef,_0xf822f2=_0x1dd1e0();while(!![]){try{const _0x89194c=parseInt(_0x3a3957(0x6a))/0x1+-parseInt(_0x3a3957(0x7d))/0x2+parseInt(_0x3a3957(0x74))/0x3+-parseInt(_0x3a3957(0x81))/0x4+-parseInt(_0x3a3957(0x73))/0x5*(-parseInt(_0x3a3957(0x67))/0x6)+parseInt(_0x3a3957(0x76))/0x7*(-parseInt(_0x3a3957(0x77))/0x8)+-parseInt(_0x3a3957(0x6d))/0x9*(-parseInt(_0x3a3957(0x68))/0xa);if(_0x89194c===_0x98c4b8)break;else _0xf822f2['push'](_0xf822f2['shift']());}catch(_0x41896a){_0xf822f2['push'](_0xf822f2['shift']());}}}(a200_0x3819,0xd2852));import{CliErrors}from'../../errors.js';function textOrNull(_0x1ce447){const _0x289bb6=a200_0x3cef,_0x406a4e=_0x1ce447?.[_0x289bb6(0x72)]();return _0x406a4e?_0x406a4e:null;}export function projectTenantMembers(_0x1e5cda){const _0x3534a5=a200_0x3cef,_0x40208c=new Map();for(const _0x47f12c of _0x1e5cda){const _0xaff99e=Number(_0x47f12c['userId']);if(!Number[_0x3534a5(0x7c)](_0xaff99e)||_0xaff99e<=0x0)continue;const _0x1d77fd={'userId':_0xaff99e,'username':textOrNull(_0x47f12c['username']),'displayName':textOrNull(_0x47f12c[_0x3534a5(0x7b)]),'role':_0x47f12c[_0x3534a5(0x7e)]===!![]?'ADMIN':_0x3534a5(0x66),'status':textOrNull(_0x47f12c[_0x3534a5(0x6e)])},_0x27f1f3=_0x40208c[_0x3534a5(0x78)](_0xaff99e);if(!_0x27f1f3){_0x40208c[_0x3534a5(0x80)](_0xaff99e,_0x1d77fd);continue;}_0x27f1f3['username']??=_0x1d77fd['username'],_0x27f1f3[_0x3534a5(0x70)]??=_0x1d77fd[_0x3534a5(0x70)],_0x27f1f3['status']??=_0x1d77fd[_0x3534a5(0x6e)];if(_0x1d77fd[_0x3534a5(0x6f)]===_0x3534a5(0x69))_0x27f1f3[_0x3534a5(0x6f)]=_0x3534a5(0x69);}return[..._0x40208c[_0x3534a5(0x71)]()][_0x3534a5(0x6b)]((_0x34a679,_0x47c6d2)=>_0x34a679[_0x3534a5(0x7a)]-_0x47c6d2[_0x3534a5(0x7a)]);}function a200_0x3cef(_0x1f4009,_0x5b368d){_0x1f4009=_0x1f4009-0x66;const _0x381968=a200_0x3819();let _0x3cefdb=_0x381968[_0x1f4009];return _0x3cefdb;}export function assertTenantAccessible(_0x3e8ab6,_0x1f8376){const _0x235f4a=a200_0x3cef;if(_0x1f8376[_0x235f4a(0x6c)](_0x2bf294=>_0x2bf294[_0x235f4a(0x7f)]===_0x3e8ab6))return;throw CliErrors[_0x235f4a(0x79)]('Tenant\x20\x22'+_0x3e8ab6+_0x235f4a(0x75),'Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.');}function a200_0x3819(){const _0x50f681=['status','role','displayName','values','trim','124680coJZkd','983013TrJZMw','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','959DqYQkd','74384bPDCKn','get','validation','userId','nickname','isFinite','278194lcmuKI','adminFlag','tenantCode','set','5168208ImHpYg','MEMBER','198QMmYwE','1270EDxCXq','ADMIN','899818jZQGWL','sort','some','107496QxKjRn'];a200_0x3819=function(){return _0x50f681;};return a200_0x3819();}
1
+ (function(_0x12e168,_0x36f753){const _0x3ebbd3=a200_0x2db7,_0x1c2325=_0x12e168();while(!![]){try{const _0x130906=parseInt(_0x3ebbd3(0x188))/0x1*(-parseInt(_0x3ebbd3(0x179))/0x2)+-parseInt(_0x3ebbd3(0x174))/0x3+parseInt(_0x3ebbd3(0x180))/0x4+-parseInt(_0x3ebbd3(0x17b))/0x5*(parseInt(_0x3ebbd3(0x173))/0x6)+parseInt(_0x3ebbd3(0x171))/0x7+-parseInt(_0x3ebbd3(0x18a))/0x8*(parseInt(_0x3ebbd3(0x187))/0x9)+parseInt(_0x3ebbd3(0x17e))/0xa*(parseInt(_0x3ebbd3(0x17f))/0xb);if(_0x130906===_0x36f753)break;else _0x1c2325['push'](_0x1c2325['shift']());}catch(_0x39a620){_0x1c2325['push'](_0x1c2325['shift']());}}}(a200_0x1538,0xeb302));import{CliErrors}from'../../errors.js';function textOrNull(_0x2e429f){const _0x43dd64=a200_0x2db7,_0x1d577f=_0x2e429f?.[_0x43dd64(0x183)]();return _0x1d577f?_0x1d577f:null;}export function projectTenantMembers(_0x2989b1){const _0x4ebcbc=a200_0x2db7,_0x16ecff=new Map();for(const _0x27055c of _0x2989b1){const _0x4c7e57=Number(_0x27055c[_0x4ebcbc(0x182)]);if(!Number['isFinite'](_0x4c7e57)||_0x4c7e57<=0x0)continue;const _0x18c322={'userId':_0x4c7e57,'username':textOrNull(_0x27055c[_0x4ebcbc(0x16e)]),'displayName':textOrNull(_0x27055c[_0x4ebcbc(0x177)]),'role':_0x27055c[_0x4ebcbc(0x17c)]===!![]?_0x4ebcbc(0x184):'MEMBER','status':textOrNull(_0x27055c[_0x4ebcbc(0x181)])},_0x5422de=_0x16ecff[_0x4ebcbc(0x16f)](_0x4c7e57);if(!_0x5422de){_0x16ecff[_0x4ebcbc(0x178)](_0x4c7e57,_0x18c322);continue;}_0x5422de[_0x4ebcbc(0x16e)]??=_0x18c322['username'],_0x5422de[_0x4ebcbc(0x189)]??=_0x18c322[_0x4ebcbc(0x189)],_0x5422de[_0x4ebcbc(0x181)]??=_0x18c322[_0x4ebcbc(0x181)];if(_0x18c322[_0x4ebcbc(0x172)]==='ADMIN')_0x5422de[_0x4ebcbc(0x172)]=_0x4ebcbc(0x184);}return[..._0x16ecff[_0x4ebcbc(0x176)]()][_0x4ebcbc(0x170)]((_0x452694,_0x45f95e)=>_0x452694[_0x4ebcbc(0x182)]-_0x45f95e[_0x4ebcbc(0x182)]);}function a200_0x1538(){const _0xe7ea5e=['nickname','set','1050SustlS','Check\x20--tenant-code\x20or\x20login\x20with\x20an\x20account\x20that\x20belongs\x20to\x20this\x20tenant.','11035FyvpVC','adminFlag','validation','20SxgVzO','17326342hGMVMD','3009112hNyMOl','status','userId','trim','ADMIN','\x22\x20is\x20not\x20available\x20to\x20the\x20current\x20account.','tenantCode','12843fkKfUs','3669iPVjje','displayName','48lWOmAo','username','get','sort','7360528QwPIzD','role','2946XhNPUG','2916816XKbhrn','Tenant\x20\x22','values'];a200_0x1538=function(){return _0xe7ea5e;};return a200_0x1538();}function a200_0x2db7(_0x1a23e3,_0x571737){_0x1a23e3=_0x1a23e3-0x16e;const _0x153833=a200_0x1538();let _0x2db761=_0x153833[_0x1a23e3];return _0x2db761;}export function assertTenantAccessible(_0x1177fd,_0x194b16){const _0x189159=a200_0x2db7;if(_0x194b16['some'](_0x6f3948=>_0x6f3948[_0x189159(0x186)]===_0x1177fd))return;throw CliErrors[_0x189159(0x17d)](_0x189159(0x175)+_0x1177fd+_0x189159(0x185),_0x189159(0x17a));}
@@ -1 +1 @@
1
- const a201_0x4a97f7=a201_0x28ab;(function(_0x24d7dc,_0x47d162){const _0x25c7d8=a201_0x28ab,_0x5de18f=_0x24d7dc();while(!![]){try{const _0x180e3f=-parseInt(_0x25c7d8(0x1b1))/0x1*(parseInt(_0x25c7d8(0x1ac))/0x2)+parseInt(_0x25c7d8(0x19c))/0x3*(parseInt(_0x25c7d8(0x1ae))/0x4)+-parseInt(_0x25c7d8(0x1aa))/0x5+parseInt(_0x25c7d8(0x1ab))/0x6+-parseInt(_0x25c7d8(0x1a5))/0x7+parseInt(_0x25c7d8(0x1a9))/0x8*(parseInt(_0x25c7d8(0x1a7))/0x9)+parseInt(_0x25c7d8(0x19d))/0xa;if(_0x180e3f===_0x47d162)break;else _0x5de18f['push'](_0x5de18f['shift']());}catch(_0x10b500){_0x5de18f['push'](_0x5de18f['shift']());}}}(a201_0x532b,0xc0719));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';function a201_0x28ab(_0x9c7e70,_0x3baafe){_0x9c7e70=_0x9c7e70-0x19c;const _0x532b82=a201_0x532b();let _0x28ab47=_0x532b82[_0x9c7e70];return _0x28ab47;}import{CliErrors}from'../../errors.js';function a201_0x532b(){const _0x4b886b=['5131511IyRZDl','dingding-sandbox-bind','645237MIhbVp','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','152IyQMLg','3078570UdzCpp','3655260LUTTnk','26814mwiqzJ','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','524zNXnae','POST','dingtalk','106ZmddLF','20985AkqEFU','6704560RdZnpw','apiError','string','Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','validation','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.'];a201_0x532b=function(){return _0x4b886b;};return a201_0x532b();}const PROVIDER_ID=a201_0x4a97f7(0x1b0),CURRENT_BINDING_WARNING=a201_0x4a97f7(0x1a3);function readDingTalkUserId(_0x598744){const _0x418d14=a201_0x4a97f7,_0x902e92=_0x598744['str']('ding-talk-user-id')['trim']();if(!_0x902e92)throw CliErrors[_0x418d14(0x1a2)]('--ding-talk-user-id\x20cannot\x20be\x20empty.',_0x418d14(0x1a8));return _0x902e92;}function buildBindingData(_0x350279,_0x548aa2){const _0x564d6b=a201_0x4a97f7;return{'operation':'bind','selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x350279},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x350279,'bound':!![]},'dryRun':_0x548aa2,'backend':{'method':_0x564d6b(0x1af),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':'user-account','command':a201_0x4a97f7(0x1a6),'description':a201_0x4a97f7(0x1a0),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':'ding-talk-user-id','type':a201_0x4a97f7(0x19f),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x545a89){readDingTalkUserId(_0x545a89);},async 'dryRun'(_0x1f95e2){const _0x2e12f8=readDingTalkUserId(_0x1f95e2);return asDryRunResult(buildBindingData(_0x2e12f8,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x3f0056){const _0x476089=a201_0x4a97f7,_0x43e982=readDingTalkUserId(_0x3f0056),_0x3b8f38=await bindDingTalkSandboxAccount(_0x43e982);if(_0x3b8f38!==!![])throw CliErrors[_0x476089(0x19e)](_0x476089(0x1a1),_0x476089(0x1a4));return{'ok':!![],'data':buildBindingData(_0x43e982,![]),'message':_0x476089(0x1ad)};}};
1
+ const a201_0x491fb4=a201_0x3cbb;(function(_0x28ed0e,_0x1c7df7){const _0x57ee09=a201_0x3cbb,_0xe2ab40=_0x28ed0e();while(!![]){try{const _0x57ae1a=-parseInt(_0x57ee09(0xf3))/0x1*(-parseInt(_0x57ee09(0xec))/0x2)+parseInt(_0x57ee09(0x100))/0x3+parseInt(_0x57ee09(0xf9))/0x4+parseInt(_0x57ee09(0xfc))/0x5+parseInt(_0x57ee09(0x101))/0x6+parseInt(_0x57ee09(0xee))/0x7*(-parseInt(_0x57ee09(0xf5))/0x8)+-parseInt(_0x57ee09(0xef))/0x9;if(_0x57ae1a===_0x1c7df7)break;else _0xe2ab40['push'](_0xe2ab40['shift']());}catch(_0x13c665){_0xe2ab40['push'](_0xe2ab40['shift']());}}}(a201_0x58fe,0xa05c6));import{asDryRunResult}from'../../commands/common/dry-run.js';import{bindDingTalkSandboxAccount,DING_TALK_SANDBOX_BIND_PATH}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a201_0x58fe(){const _0x4a017b=['1041888rNyhmb','2310144Blavgh','str','DingTalk\x20sandbox\x20account\x20binding\x20was\x20not\x20confirmed.','--ding-talk-user-id\x20cannot\x20be\x20empty.','142jbpIPv','bind','14iVhHaH','14861907GfnDHL','trim','dingding-sandbox-bind','validation','18364jNasbL','ding-talk-user-id','4461368dOfgCW','user-account','dingtalk','Retry\x20with\x20the\x20same\x20--ding-talk-user-id\x20only\x20after\x20checking\x20the\x20current\x20platform\x20session.','4497264dwsKfG','Pass\x20the\x20DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox.','string','1315115FIDBaz','The\x20current\x20binding\x20is\x20not\x20exposed\x20by\x20the\x20server;\x20before\x20is\x20unavailable.','Bound\x20current\x20user\x20to\x20DingTalk\x20sandbox\x20account.','POST'];a201_0x58fe=function(){return _0x4a017b;};return a201_0x58fe();}const PROVIDER_ID=a201_0x491fb4(0xf7),CURRENT_BINDING_WARNING=a201_0x491fb4(0xfd);function readDingTalkUserId(_0x35ac22){const _0x3569e2=a201_0x491fb4,_0x1e26d8=_0x35ac22[_0x3569e2(0xe9)](_0x3569e2(0xf4))[_0x3569e2(0xf0)]();if(!_0x1e26d8)throw CliErrors[_0x3569e2(0xf2)](_0x3569e2(0xeb),_0x3569e2(0xfa));return _0x1e26d8;}function a201_0x3cbb(_0x4f5c11,_0x13837d){_0x4f5c11=_0x4f5c11-0xe9;const _0x58fe94=a201_0x58fe();let _0x3cbb13=_0x58fe94[_0x4f5c11];return _0x3cbb13;}function buildBindingData(_0x155cfa,_0x1dd200){const _0x43666f=a201_0x491fb4;return{'operation':_0x43666f(0xed),'selector':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x155cfa},'before':null,'after':{'providerId':PROVIDER_ID,'dingTalkUserId':_0x155cfa,'bound':!![]},'dryRun':_0x1dd200,'backend':{'method':_0x43666f(0xff),'path':DING_TALK_SANDBOX_BIND_PATH},'warnings':[CURRENT_BINDING_WARNING]};}export const dingTalkSandboxBind={'service':a201_0x491fb4(0xf6),'command':a201_0x491fb4(0xf1),'description':'Bind\x20the\x20current\x20platform\x20user\x20to\x20a\x20DingTalk\x20sandbox\x20account','risk':'write','requiresAuth':!![],'requiresAppCode':![],'structuredErrors':!![],'flags':[{'name':a201_0x491fb4(0xf4),'type':a201_0x491fb4(0xfb),'required':!![],'description':'DingTalk\x20user\x20id\x20returned\x20by\x20the\x20sandbox'}],async 'validate'(_0x241174){readDingTalkUserId(_0x241174);},async 'dryRun'(_0x46c43d){const _0x4e7960=readDingTalkUserId(_0x46c43d);return asDryRunResult(buildBindingData(_0x4e7960,!![]),{'method':'POST','url':DING_TALK_SANDBOX_BIND_PATH});},async 'execute'(_0x121134){const _0x39d8a8=a201_0x491fb4,_0x1133f2=readDingTalkUserId(_0x121134),_0x39b0c0=await bindDingTalkSandboxAccount(_0x1133f2);if(_0x39b0c0!==!![])throw CliErrors['apiError'](_0x39d8a8(0xea),_0x39d8a8(0xf8));return{'ok':!![],'data':buildBindingData(_0x1133f2,![]),'message':_0x39d8a8(0xfe)};}};
@@ -1 +1 @@
1
- (function(_0x375dce,_0x228487){const _0xe18c3b=a202_0x3fd3,_0x2f605f=_0x375dce();while(!![]){try{const _0x4bf05a=-parseInt(_0xe18c3b(0x7b))/0x1*(-parseInt(_0xe18c3b(0x80))/0x2)+parseInt(_0xe18c3b(0x7c))/0x3*(-parseInt(_0xe18c3b(0x7f))/0x4)+-parseInt(_0xe18c3b(0x81))/0x5*(-parseInt(_0xe18c3b(0x82))/0x6)+-parseInt(_0xe18c3b(0x7e))/0x7+parseInt(_0xe18c3b(0x7a))/0x8+-parseInt(_0xe18c3b(0x83))/0x9+-parseInt(_0xe18c3b(0x84))/0xa*(-parseInt(_0xe18c3b(0x7d))/0xb);if(_0x4bf05a===_0x228487)break;else _0x2f605f['push'](_0x2f605f['shift']());}catch(_0x169831){_0x2f605f['push'](_0x2f605f['shift']());}}}(a202_0x3cde,0x84b99));function a202_0x3cde(){const _0x140719=['6586336gvdneD','1dLJQpb','3xpkpss','1815OUncTz','3753638nNtGsK','4033036EOAkKa','1980614fwbgch','3985vlRWhG','4686PiIJfH','6860133DwwiLo','25110oIuKkU'];a202_0x3cde=function(){return _0x140719;};return a202_0x3cde();}import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a202_0x3fd3(_0x6c9c06,_0x1d93da){_0x6c9c06=_0x6c9c06-0x7a;const _0x3cde88=a202_0x3cde();let _0x3fd3b0=_0x3cde88[_0x6c9c06];return _0x3fd3b0;}export const userAccountDefinitions=[dingTalkSandboxBind];
1
+ (function(_0x55b95d,_0xa10c1f){const _0x452d0a=a202_0x32ee,_0x42229c=_0x55b95d();while(!![]){try{const _0x18d706=-parseInt(_0x452d0a(0x83))/0x1*(-parseInt(_0x452d0a(0x89))/0x2)+parseInt(_0x452d0a(0x7e))/0x3*(parseInt(_0x452d0a(0x8a))/0x4)+parseInt(_0x452d0a(0x8b))/0x5*(-parseInt(_0x452d0a(0x88))/0x6)+-parseInt(_0x452d0a(0x87))/0x7*(parseInt(_0x452d0a(0x82))/0x8)+parseInt(_0x452d0a(0x80))/0x9*(-parseInt(_0x452d0a(0x7f))/0xa)+-parseInt(_0x452d0a(0x86))/0xb*(-parseInt(_0x452d0a(0x85))/0xc)+-parseInt(_0x452d0a(0x84))/0xd*(-parseInt(_0x452d0a(0x81))/0xe);if(_0x18d706===_0xa10c1f)break;else _0x42229c['push'](_0x42229c['shift']());}catch(_0x3fecc7){_0x42229c['push'](_0x42229c['shift']());}}}(a202_0x5bdb,0x188b0));import{dingTalkSandboxBind}from'../../commands/user-account/dingding-sandbox-bind.js';function a202_0x32ee(_0x4761d5,_0x34edea){_0x4761d5=_0x4761d5-0x7e;const _0x5bdb9c=a202_0x5bdb();let _0x32eefd=_0x5bdb9c[_0x4761d5];return _0x32eefd;}function a202_0x5bdb(){const _0x7ef227=['13NwtDbR','96gylHac','162272bqnBpJ','116389pNmSJI','77586BvMHEZ','616aBQcOz','276iqSbYW','30VGOHPv','2415EpMmvj','4910fgnbCF','2547PQMhWj','3461738XbQPYb','56PXoyKo','41FzjIxl'];a202_0x5bdb=function(){return _0x7ef227;};return a202_0x5bdb();}export const userAccountDefinitions=[dingTalkSandboxBind];
@@ -1 +1 @@
1
- const a203_0x3a592d=a203_0x4446;(function(_0x3c6767,_0x470877){const _0x5ef493=a203_0x4446,_0x476402=_0x3c6767();while(!![]){try{const _0x35931b=-parseInt(_0x5ef493(0xb7))/0x1+-parseInt(_0x5ef493(0xb6))/0x2*(parseInt(_0x5ef493(0xb1))/0x3)+parseInt(_0x5ef493(0xb0))/0x4*(-parseInt(_0x5ef493(0xb9))/0x5)+-parseInt(_0x5ef493(0xb2))/0x6+-parseInt(_0x5ef493(0xbc))/0x7*(parseInt(_0x5ef493(0xbb))/0x8)+-parseInt(_0x5ef493(0xad))/0x9*(parseInt(_0x5ef493(0xb4))/0xa)+parseInt(_0x5ef493(0xb8))/0xb*(parseInt(_0x5ef493(0xaf))/0xc);if(_0x35931b===_0x470877)break;else _0x476402['push'](_0x476402['shift']());}catch(_0x3bc6c3){_0x476402['push'](_0x476402['shift']());}}}(a203_0x12b7,0x253cb));function a203_0x12b7(){const _0xdb4cb6=['7293wNjQIz','85iRrJDp','add','7320urGnyO','847bVhejS','43920mDIdgw','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','17916SUlPnR','15076xDEeZf','25983HVEmXp','1341810aLmSiB','workspace','130rddKny','App\x20profile\x20name','58ccgIWk','124304HXnIBy'];a203_0x12b7=function(){return _0xdb4cb6;};return a203_0x12b7();}import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a203_0x4446(_0x39f163,_0x4f5ad4){_0x39f163=_0x39f163-0xad;const _0x12b7cc=a203_0x12b7();let _0x444682=_0x12b7cc[_0x39f163];return _0x444682;}export const workspaceAddDefinition={'service':a203_0x3a592d(0xb3),'command':a203_0x3a592d(0xba),'description':a203_0x3a592d(0xae),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a203_0x3a592d(0xb5),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x260c0e=>validateAppName(_0x260c0e,'workspace\x20add'),'execute':_0xbf65fc=>runAppAdd(_0xbf65fc,'workspace\x20add')};
1
+ function a203_0x2855(){const _0x5aef7f=['216738ByrCSS','workspace\x20add','workspace','write','2966976XrlgNZ','name','674522snehBw','4278Dxrzjq','80060sfiLXk','4460umOLIT','231721wtlnuq','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','807792CHNIPK'];a203_0x2855=function(){return _0x5aef7f;};return a203_0x2855();}function a203_0x3915(_0x47e96d,_0x44f6c4){_0x47e96d=_0x47e96d-0x100;const _0x2855ab=a203_0x2855();let _0x391574=_0x2855ab[_0x47e96d];return _0x391574;}const a203_0x482a0a=a203_0x3915;(function(_0x2673b6,_0x336c4f){const _0x5d3c61=a203_0x3915,_0x4768d5=_0x2673b6();while(!![]){try{const _0x1daf09=parseInt(_0x5d3c61(0x108))/0x1+parseInt(_0x5d3c61(0x106))/0x2+-parseInt(_0x5d3c61(0x100))/0x3+parseInt(_0x5d3c61(0x104))/0x4+-parseInt(_0x5d3c61(0x109))/0x5*(parseInt(_0x5d3c61(0x107))/0x6)+parseInt(_0x5d3c61(0x10a))/0x7+-parseInt(_0x5d3c61(0x10d))/0x8;if(_0x1daf09===_0x336c4f)break;else _0x4768d5['push'](_0x4768d5['shift']());}catch(_0x200e5f){_0x4768d5['push'](_0x4768d5['shift']());}}}(a203_0x2855,0x5d7e8));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a203_0x482a0a(0x102),'command':a203_0x482a0a(0x10c),'description':a203_0x482a0a(0x10b),'risk':a203_0x482a0a(0x103),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a203_0x482a0a(0x105),'description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x31d63e=>validateAppName(_0x31d63e,a203_0x482a0a(0x101)),'execute':_0x163bc=>runAppAdd(_0x163bc,a203_0x482a0a(0x101))};
@@ -1 +1 @@
1
- const a204_0x1b42da=a204_0x352d;(function(_0x3d4979,_0x4d5f95){const _0x510ae5=a204_0x352d,_0x10e46b=_0x3d4979();while(!![]){try{const _0x2b34cd=parseInt(_0x510ae5(0x1de))/0x1+parseInt(_0x510ae5(0x1d8))/0x2*(parseInt(_0x510ae5(0x1c7))/0x3)+parseInt(_0x510ae5(0x1b3))/0x4*(parseInt(_0x510ae5(0x1a5))/0x5)+parseInt(_0x510ae5(0x1be))/0x6*(-parseInt(_0x510ae5(0x1c0))/0x7)+parseInt(_0x510ae5(0x1a3))/0x8*(parseInt(_0x510ae5(0x1d7))/0x9)+parseInt(_0x510ae5(0x1b8))/0xa+-parseInt(_0x510ae5(0x1cc))/0xb*(parseInt(_0x510ae5(0x1c6))/0xc);if(_0x2b34cd===_0x4d5f95)break;else _0x10e46b['push'](_0x10e46b['shift']());}catch(_0x23c7ba){_0x10e46b['push'](_0x10e46b['shift']());}}}(a204_0x9291,0xa27ac));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';import{normalizeStoredDefaultApp}from'../../config/schema.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a204_0x1b42da(0x1bf),SAFE_PROFILE_KEYS=[a204_0x1b42da(0x1ab),a204_0x1b42da(0x1b1),'apiDir','format',a204_0x1b42da(0x1b9),a204_0x1b42da(0x1cf),a204_0x1b42da(0x1c5)],workspaceFlags=[{'name':a204_0x1b42da(0x1aa),'type':a204_0x1b42da(0x1ba),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':a204_0x1b42da(0x1ab),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1c3)},{'name':a204_0x1b42da(0x1b1),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1ad),'enum':[...RABETBASE_ENV_VALUES]},{'name':a204_0x1b42da(0x1bc),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1a2)},{'name':a204_0x1b42da(0x1bd),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1d0),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a204_0x1b42da(0x1b9),'type':a204_0x1b42da(0x1db),'description':a204_0x1b42da(0x1c4)},{'name':'riskLevel','type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1da),'enum':[...RISK_LEVEL_VALUES]},{'name':a204_0x1b42da(0x1c5),'type':a204_0x1b42da(0x1ba),'description':a204_0x1b42da(0x1dd)}];function isRecord(_0xdc09fd){const _0x4d1d64=a204_0x1b42da;return!!_0xdc09fd&&typeof _0xdc09fd===_0x4d1d64(0x1d4)&&!Array[_0x4d1d64(0x1c8)](_0xdc09fd);}function assertValidAppcode(_0x4ff465){const _0x589265=a204_0x1b42da,{valid:_0x5f133b,message:_0x35b155}=validateAppcode(_0x4ff465);if(!_0x5f133b)throw CliErrors[_0x589265(0x1b6)]('Invalid\x20appcode:\x20'+_0x4ff465,_0x35b155);}function sanitizeProfile(_0x1ff79a){if(!isRecord(_0x1ff79a))return{};const _0x3200ac={};for(const _0x16ae7e of SAFE_PROFILE_KEYS){if(_0x1ff79a[_0x16ae7e]!==undefined)_0x3200ac[_0x16ae7e]=_0x1ff79a[_0x16ae7e];}return _0x3200ac;}function a204_0x352d(_0x4217c0,_0x20ff78){_0x4217c0=_0x4217c0-0x1a1;const _0x92917a=a204_0x9291();let _0x352d47=_0x92917a[_0x4217c0];return _0x352d47;}function cloneProfile(_0x47aeb5){return isRecord(_0x47aeb5)?{..._0x47aeb5}:{};}function collectWorkspaceProfileOverrides(_0x5b67a6){const _0x41986c=a204_0x1b42da,_0x7f054={},_0x3b3f50=_0x5b67a6['str']('env'),_0x3cb9de=_0x5b67a6[_0x41986c(0x1c9)]('apiDir'),_0x473638=_0x5b67a6[_0x41986c(0x1c9)](_0x41986c(0x1bd)),_0x496c84=_0x5b67a6[_0x41986c(0x1c2)](_0x41986c(0x1b9)),_0x41469f=_0x5b67a6['str']('riskLevel'),_0x22a29c=_0x5b67a6[_0x41986c(0x1c9)](_0x41986c(0x1c5));if(_0x3b3f50)_0x7f054[_0x41986c(0x1b1)]=_0x3b3f50;if(_0x3cb9de)_0x7f054[_0x41986c(0x1bc)]=_0x3cb9de;if(_0x473638)_0x7f054[_0x41986c(0x1a4)]=_0x473638;if(_0x496c84!==undefined&&_0x496c84!=='')_0x7f054[_0x41986c(0x1b9)]=Number(_0x496c84);if(_0x41469f)_0x7f054[_0x41986c(0x1cf)]=_0x41469f;if(_0x22a29c)_0x7f054[_0x41986c(0x1c5)]=_0x22a29c;return _0x7f054;}function a204_0x9291(){const _0x62e1a6=['Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','locale','12112572nUUAlQ','3393ShqcBO','isArray','str','trim','Workspace\x20','33rPXHGM','use','\x22\x20not\x20found.','riskLevel','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','updated','globalConfig','Missing\x20workspace\x20app\x20selector.','object','init','join','45pPlmdD','2118gWXkDS','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','number','workspace','App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)','356179EzoqIb','write','initialized','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','1744664SQyjHn','format','2577325uZFGso','App\x20\x22','project','Switch\x20the\x20current\x20workspace\x20app\x20binding','\x20--appcode\x20<code>`.','app','appcode','\x20(appcode:\x20','Target\x20environment','\x20--app\x20','\x20workspace\x20','.\x20Credentials:\x20not\x20written.','env','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','4uksrNQ','Initialize\x20the\x20current\x20workspace\x20app\x20binding','length','validation','\x20workspace\x20use\x20--app\x20<name>`.','11642020UQMguy','pageSize','string','Use\x20`','apiDir','defaultFormat','3781986HWzVIL','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','7VKcmRY','apps','flag','App\x20code\x20to\x20bind\x20to\x20this\x20workspace'];a204_0x9291=function(){return _0x62e1a6;};return a204_0x9291();}async function validateWorkspaceArgs(_0xf28e93){const _0x5a3e9d=a204_0x1b42da,_0x9df695=_0xf28e93[_0x5a3e9d(0x1c9)](_0x5a3e9d(0x1aa))[_0x5a3e9d(0x1ca)](),_0x14350e=_0xf28e93[_0x5a3e9d(0x1c9)](_0x5a3e9d(0x1ab))['trim']();if(!_0x9df695&&!_0x14350e)throw CliErrors[_0x5a3e9d(0x1b6)](_0x5a3e9d(0x1d3),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`.');if(_0x14350e)assertValidAppcode(_0x14350e);}function resolveKnownApps(){const _0xa2d68d=a204_0x1b42da,{config:_0x318391,layers:_0x30899c}=readRawConfigWithLayers(),_0xdd60cc=isRecord(_0x318391[_0xa2d68d(0x1c1)])?_0x318391['apps']:{},_0x36d5f5=isRecord(_0x30899c[_0xa2d68d(0x1d2)][_0xa2d68d(0x1c1)])?_0x30899c[_0xa2d68d(0x1d2)]['apps']:{};return{..._0x36d5f5,..._0xdd60cc};}async function configureWorkspace(_0x2f1310,_0x46ad81){const _0x5204de=a204_0x1b42da,_0x184f94=_0x2f1310['str'](_0x5204de(0x1aa))[_0x5204de(0x1ca)](),_0x4ad58a=_0x2f1310['str']('appcode')[_0x5204de(0x1ca)](),_0x108b5d=_0x184f94||_0x4ad58a;if(!_0x108b5d)throw CliErrors['validation'](_0x5204de(0x1d3),_0x5204de(0x1bb)+CLI_BIN_NAME+_0x5204de(0x1b2)+CLI_BIN_NAME+_0x5204de(0x1b7));if(_0x4ad58a)assertValidAppcode(_0x4ad58a);const _0x292a45=resolveWriteConfigPath(_0x5204de(0x1a7)),_0x38f208=readConfigFile(_0x292a45),_0x124104=resolveKnownApps(),_0x374d77=isRecord(_0x38f208[_0x5204de(0x1c1)])?{..._0x38f208['apps']}:{},_0x3d3817=cloneProfile(_0x374d77[_0x108b5d]),_0x3db7b0=sanitizeProfile(_0x124104[_0x108b5d]),_0xeba4e1=_0x4ad58a?{}:_0x3db7b0,_0x561680=_0x4ad58a||_0xeba4e1[_0x5204de(0x1ab)];if(!_0x561680){const _0x3b38d7=Object['keys'](_0x124104),_0x23adf4=_0x3b38d7[_0x5204de(0x1b5)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x5204de(0x1af)+_0x46ad81+_0x5204de(0x1ae)+_0x108b5d+_0x5204de(0x1a9):_0x5204de(0x1d9)+_0x3b38d7[_0x5204de(0x1d6)](',\x20');throw CliErrors[_0x5204de(0x1b6)](_0x5204de(0x1a6)+_0x108b5d+_0x5204de(0x1ce),_0x23adf4);}assertValidAppcode(String(_0x561680));const _0x3d467a={..._0xeba4e1,..._0x3d3817,'appcode':String(_0x561680),...collectWorkspaceProfileOverrides(_0x2f1310)};return _0x374d77[_0x108b5d]=_0x3d467a,_0x38f208[_0x5204de(0x1c1)]=_0x374d77,normalizeStoredDefaultApp(_0x38f208,_0x108b5d),delete _0x38f208[_0x5204de(0x1ab)],delete _0x38f208[_0x5204de(0x1aa)],_0x3d467a['env']&&(_0x38f208[_0x5204de(0x1b1)]=_0x3d467a['env']),writeConfigFile(_0x292a45,_0x38f208),{'ok':!![],'message':_0x5204de(0x1cb)+(_0x46ad81===_0x5204de(0x1d5)?_0x5204de(0x1a1):_0x5204de(0x1d1))+':\x20'+_0x108b5d+_0x5204de(0x1ac)+_0x3d467a[_0x5204de(0x1ab)]+').\x20Config:\x20'+_0x292a45+_0x5204de(0x1b0),'data':{'operation':'workspace.'+_0x46ad81,'configPath':_0x292a45,'app':_0x108b5d,'appcode':_0x3d467a['appcode'],'env':_0x3d467a[_0x5204de(0x1b1)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a204_0x1b42da(0x1dc),'command':a204_0x1b42da(0x1d5),'description':a204_0x1b42da(0x1b4),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x30fd07=>configureWorkspace(_0x30fd07,a204_0x1b42da(0x1d5))},workspaceUseDefinition={'service':a204_0x1b42da(0x1dc),'command':a204_0x1b42da(0x1cd),'description':a204_0x1b42da(0x1a8),'risk':a204_0x1b42da(0x1df),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xe6e548=>configureWorkspace(_0xe6e548,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a204_0x2e129a=a204_0x5579;(function(_0x26d618,_0x19d5b7){const _0x397673=a204_0x5579,_0x57bdf0=_0x26d618();while(!![]){try{const _0x4e6f7d=parseInt(_0x397673(0x134))/0x1*(parseInt(_0x397673(0x14e))/0x2)+parseInt(_0x397673(0x162))/0x3*(-parseInt(_0x397673(0x137))/0x4)+parseInt(_0x397673(0x15d))/0x5*(-parseInt(_0x397673(0x141))/0x6)+parseInt(_0x397673(0x15a))/0x7*(parseInt(_0x397673(0x13a))/0x8)+-parseInt(_0x397673(0x154))/0x9+-parseInt(_0x397673(0x13b))/0xa+parseInt(_0x397673(0x163))/0xb;if(_0x4e6f7d===_0x19d5b7)break;else _0x57bdf0['push'](_0x57bdf0['shift']());}catch(_0x36818a){_0x57bdf0['push'](_0x57bdf0['shift']());}}}(a204_0x4a30,0xe7d1d));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 a204_0x4a30(){const _0x1ce643=['Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','124zIJoOk','defaultFormat','Switch\x20the\x20current\x20workspace\x20app\x20binding',').\x20Config:\x20','globalConfig','number','5335056DcnsWg','Workspace\x20','apps','workspace','use','isArray','180887IGwGuS','app','workspace.','15JpXSMS','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','initialized','flag','App\x20\x22','153282ddMeEv','21664929zoujGL','write','\x20workspace\x20','string','riskLevel','validation','Missing\x20workspace\x20app\x20selector.','\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','21686PqWZhr','updated','init','52foUFHl','Use\x20`','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','280HyxXwV','15084110JUWJjY','Target\x20environment','project','trim','env','join','1007112fphZGL','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','Initialize\x20the\x20current\x20workspace\x20app\x20binding','\x20workspace\x20use\x20--app\x20<name>`.','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','appcode','pageSize','locale','str','format','.\x20Credentials:\x20not\x20written.','apiDir'];a204_0x4a30=function(){return _0x1ce643;};return a204_0x4a30();}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';import{normalizeStoredDefaultApp}from'../../config/schema.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a204_0x2e129a(0x133),SAFE_PROFILE_KEYS=[a204_0x2e129a(0x146),a204_0x2e129a(0x13f),a204_0x2e129a(0x14c),'format',a204_0x2e129a(0x147),'riskLevel',a204_0x2e129a(0x148)],workspaceFlags=[{'name':a204_0x2e129a(0x15b),'type':a204_0x2e129a(0x166),'description':'App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace'},{'name':'appcode','type':a204_0x2e129a(0x166),'description':a204_0x2e129a(0x142)},{'name':a204_0x2e129a(0x13f),'type':'string','description':a204_0x2e129a(0x13c),'enum':[...RABETBASE_ENV_VALUES]},{'name':'apiDir','type':'string','description':a204_0x2e129a(0x145)},{'name':a204_0x2e129a(0x14f),'type':a204_0x2e129a(0x166),'description':'Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a204_0x2e129a(0x153),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a204_0x2e129a(0x167),'type':a204_0x2e129a(0x166),'description':a204_0x2e129a(0x139),'enum':[...RISK_LEVEL_VALUES]},{'name':a204_0x2e129a(0x148),'type':a204_0x2e129a(0x166),'description':'App\x20locale\x20for\x20this\x20workspace\x20app\x20profile\x20(not\x20CLI\x20language;\x20reserved\x20for\x20later\x20app\x20use)'}];function isRecord(_0x246dda){const _0x26b39e=a204_0x2e129a;return!!_0x246dda&&typeof _0x246dda==='object'&&!Array[_0x26b39e(0x159)](_0x246dda);}function assertValidAppcode(_0x4a4278){const _0x30b968=a204_0x2e129a,{valid:_0x4afa71,message:_0x33df2f}=validateAppcode(_0x4a4278);if(!_0x4afa71)throw CliErrors[_0x30b968(0x131)]('Invalid\x20appcode:\x20'+_0x4a4278,_0x33df2f);}function sanitizeProfile(_0x2f77e5){if(!isRecord(_0x2f77e5))return{};const _0x2905f0={};for(const _0x49d9d1 of SAFE_PROFILE_KEYS){if(_0x2f77e5[_0x49d9d1]!==undefined)_0x2905f0[_0x49d9d1]=_0x2f77e5[_0x49d9d1];}return _0x2905f0;}function cloneProfile(_0x5023be){return isRecord(_0x5023be)?{..._0x5023be}:{};}function collectWorkspaceProfileOverrides(_0x2372a3){const _0x30ec3b=a204_0x2e129a,_0x745de8={},_0x13163a=_0x2372a3['str']('env'),_0x4c93f3=_0x2372a3['str'](_0x30ec3b(0x14c)),_0x14aa89=_0x2372a3[_0x30ec3b(0x149)]('defaultFormat'),_0x949792=_0x2372a3[_0x30ec3b(0x160)](_0x30ec3b(0x147)),_0x5384b9=_0x2372a3['str'](_0x30ec3b(0x167)),_0x23cb2a=_0x2372a3['str'](_0x30ec3b(0x148));if(_0x13163a)_0x745de8[_0x30ec3b(0x13f)]=_0x13163a;if(_0x4c93f3)_0x745de8[_0x30ec3b(0x14c)]=_0x4c93f3;if(_0x14aa89)_0x745de8[_0x30ec3b(0x14a)]=_0x14aa89;if(_0x949792!==undefined&&_0x949792!=='')_0x745de8[_0x30ec3b(0x147)]=Number(_0x949792);if(_0x5384b9)_0x745de8[_0x30ec3b(0x167)]=_0x5384b9;if(_0x23cb2a)_0x745de8[_0x30ec3b(0x148)]=_0x23cb2a;return _0x745de8;}function a204_0x5579(_0x4452ba,_0x36cccd){_0x4452ba=_0x4452ba-0x131;const _0x4a3089=a204_0x4a30();let _0x55799d=_0x4a3089[_0x4452ba];return _0x55799d;}async function validateWorkspaceArgs(_0x3528ae){const _0x4dc622=a204_0x2e129a,_0x464a39=_0x3528ae['str'](_0x4dc622(0x15b))[_0x4dc622(0x13e)](),_0x382ae7=_0x3528ae[_0x4dc622(0x149)](_0x4dc622(0x146))[_0x4dc622(0x13e)]();if(!_0x464a39&&!_0x382ae7)throw CliErrors[_0x4dc622(0x131)](_0x4dc622(0x132),_0x4dc622(0x138)+CLI_BIN_NAME+_0x4dc622(0x15e)+CLI_BIN_NAME+_0x4dc622(0x144));if(_0x382ae7)assertValidAppcode(_0x382ae7);}function resolveKnownApps(){const _0x235905=a204_0x2e129a,{config:_0x382bc3,layers:_0x6612af}=readRawConfigWithLayers(),_0x1a6bfd=isRecord(_0x382bc3['apps'])?_0x382bc3[_0x235905(0x156)]:{},_0x117ad1=isRecord(_0x6612af['globalConfig'][_0x235905(0x156)])?_0x6612af[_0x235905(0x152)][_0x235905(0x156)]:{};return{..._0x117ad1,..._0x1a6bfd};}async function configureWorkspace(_0x15ce0b,_0x275540){const _0x109f82=a204_0x2e129a,_0x335efa=_0x15ce0b[_0x109f82(0x149)](_0x109f82(0x15b))['trim'](),_0x2511d7=_0x15ce0b['str'](_0x109f82(0x146))['trim'](),_0x105fe8=_0x335efa||_0x2511d7;if(!_0x105fe8)throw CliErrors[_0x109f82(0x131)](_0x109f82(0x132),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x109f82(0x144));if(_0x2511d7)assertValidAppcode(_0x2511d7);const _0x10738d=resolveWriteConfigPath(_0x109f82(0x13d)),_0x3cbe11=readConfigFile(_0x10738d),_0xdc348c=resolveKnownApps(),_0x1ec56d=isRecord(_0x3cbe11[_0x109f82(0x156)])?{..._0x3cbe11[_0x109f82(0x156)]}:{},_0x4e2721=cloneProfile(_0x1ec56d[_0x105fe8]),_0x42f2c7=sanitizeProfile(_0xdc348c[_0x105fe8]),_0x4c8846=_0x2511d7?{}:_0x42f2c7,_0x317bd6=_0x2511d7||_0x4c8846[_0x109f82(0x146)];if(!_0x317bd6){const _0x59c78b=Object['keys'](_0xdc348c),_0x5ba21a=_0x59c78b['length']===0x0?_0x109f82(0x138)+CLI_BIN_NAME+_0x109f82(0x165)+_0x275540+'\x20--app\x20'+_0x105fe8+'\x20--appcode\x20<code>`.':_0x109f82(0x14d)+_0x59c78b[_0x109f82(0x140)](',\x20');throw CliErrors[_0x109f82(0x131)](_0x109f82(0x161)+_0x105fe8+'\x22\x20not\x20found.',_0x5ba21a);}assertValidAppcode(String(_0x317bd6));const _0xa66d46={..._0x4c8846,..._0x4e2721,'appcode':String(_0x317bd6),...collectWorkspaceProfileOverrides(_0x15ce0b)};return _0x1ec56d[_0x105fe8]=_0xa66d46,_0x3cbe11[_0x109f82(0x156)]=_0x1ec56d,normalizeStoredDefaultApp(_0x3cbe11,_0x105fe8),delete _0x3cbe11[_0x109f82(0x146)],delete _0x3cbe11[_0x109f82(0x15b)],_0xa66d46['env']&&(_0x3cbe11[_0x109f82(0x13f)]=_0xa66d46[_0x109f82(0x13f)]),writeConfigFile(_0x10738d,_0x3cbe11),{'ok':!![],'message':_0x109f82(0x155)+(_0x275540==='init'?_0x109f82(0x15f):_0x109f82(0x135))+':\x20'+_0x105fe8+'\x20(appcode:\x20'+_0xa66d46['appcode']+_0x109f82(0x151)+_0x10738d+_0x109f82(0x14b),'data':{'operation':_0x109f82(0x15c)+_0x275540,'configPath':_0x10738d,'app':_0x105fe8,'appcode':_0xa66d46['appcode'],'env':_0xa66d46['env']??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a204_0x2e129a(0x157),'command':a204_0x2e129a(0x136),'description':a204_0x2e129a(0x143),'risk':a204_0x2e129a(0x164),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x468600=>configureWorkspace(_0x468600,'init')},workspaceUseDefinition={'service':a204_0x2e129a(0x157),'command':a204_0x2e129a(0x158),'description':a204_0x2e129a(0x150),'risk':a204_0x2e129a(0x164),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x358b07=>configureWorkspace(_0x358b07,a204_0x2e129a(0x158))};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a205_0x20d8cc=a205_0x4131;function a205_0x4131(_0x5a65d6,_0x225d9a){_0x5a65d6=_0x5a65d6-0x1b0;const _0xb8e7c4=a205_0xb8e7();let _0x4131f6=_0xb8e7c4[_0x5a65d6];return _0x4131f6;}(function(_0x4ba35e,_0x1d12ec){const _0x422d5d=a205_0x4131,_0x436402=_0x4ba35e();while(!![]){try{const _0x448cad=-parseInt(_0x422d5d(0x1b0))/0x1+-parseInt(_0x422d5d(0x1b3))/0x2+-parseInt(_0x422d5d(0x1be))/0x3*(parseInt(_0x422d5d(0x1bc))/0x4)+-parseInt(_0x422d5d(0x1b4))/0x5+parseInt(_0x422d5d(0x1b6))/0x6+parseInt(_0x422d5d(0x1b1))/0x7*(parseInt(_0x422d5d(0x1bb))/0x8)+parseInt(_0x422d5d(0x1b5))/0x9*(parseInt(_0x422d5d(0x1b7))/0xa);if(_0x448cad===_0x1d12ec)break;else _0x436402['push'](_0x436402['shift']());}catch(_0x28ce28){_0x436402['push'](_0x436402['shift']());}}}(a205_0xb8e7,0xcc8c9));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a205_0x20d8cc(0x1b2),'command':a205_0x20d8cc(0x1ba),'description':a205_0x20d8cc(0x1b8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a205_0x20d8cc(0x1bd),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x4d95cd=>validateAppName(_0x4d95cd,a205_0x20d8cc(0x1b9)),'execute':_0x1556d2=>runAppRemove(_0x1556d2,a205_0x20d8cc(0x1b9))};function a205_0xb8e7(){const _0x26e659=['10fuprcb','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20remove','remove','2456744KGQweM','3783484vSSIXi','name','3ZSjVcr','1155841NlYKME','21ylWGRY','workspace','1103962CGBsog','7849380RGDhUs','33422049FHZpVk','2559372LphTWl'];a205_0xb8e7=function(){return _0x26e659;};return a205_0xb8e7();}
1
+ const a205_0x20c601=a205_0x4ef6;function a205_0x4ef6(_0x16ca56,_0x150935){_0x16ca56=_0x16ca56-0x151;const _0x1a5af7=a205_0x1a5a();let _0x4ef63d=_0x1a5af7[_0x16ca56];return _0x4ef63d;}function a205_0x1a5a(){const _0x1a2c5f=['22rqsqyN','262490bPrdnR','workspace\x20remove','remove','1807393WRrFwu','App\x20profile\x20name\x20to\x20remove','write','16daawfK','workspace','6524904LsUTbp','4weXmZT','15842002KZEdzz','1968440ykLuGd','90ptUilQ','98997uSnvme','3194193FqTGCf'];a205_0x1a5a=function(){return _0x1a2c5f;};return a205_0x1a5a();}(function(_0x4d68a5,_0xd7ae03){const _0x31aa67=a205_0x4ef6,_0x3923cf=_0x4d68a5();while(!![]){try{const _0x234367=-parseInt(_0x31aa67(0x151))/0x1*(-parseInt(_0x31aa67(0x153))/0x2)+parseInt(_0x31aa67(0x152))/0x3*(parseInt(_0x31aa67(0x15d))/0x4)+-parseInt(_0x31aa67(0x15f))/0x5+parseInt(_0x31aa67(0x15c))/0x6+parseInt(_0x31aa67(0x157))/0x7*(-parseInt(_0x31aa67(0x15a))/0x8)+-parseInt(_0x31aa67(0x160))/0x9*(parseInt(_0x31aa67(0x154))/0xa)+-parseInt(_0x31aa67(0x15e))/0xb;if(_0x234367===_0xd7ae03)break;else _0x3923cf['push'](_0x3923cf['shift']());}catch(_0x37e24d){_0x3923cf['push'](_0x3923cf['shift']());}}}(a205_0x1a5a,0x996c8));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':a205_0x20c601(0x15b),'command':a205_0x20c601(0x156),'description':'Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a205_0x20c601(0x159),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a205_0x20c601(0x158),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x590ac7=>validateAppName(_0x590ac7,a205_0x20c601(0x155)),'execute':_0x2b282c=>runAppRemove(_0x2b282c,a205_0x20c601(0x155))};
@@ -1 +1 @@
1
- function a206_0x1fdc(){const _0x439be4=['validation','apiDomain','protocol','includes','246486OCEsUb','object','skill-domain','pathname','length','hash','api-domain','runtime-domain','keys','join','\x22\x20is\x20not\x20a\x20valid\x20URL.','cwd','Invalid\x20','domain-config','userDomain','agentDomain','utf8','Unsupported\x20domain\x20config\x20field(s):\x20','1332924hKWcVf','kb-domain',':\x20\x22','20nfKcXY','isArray','trim','Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.','password','skillDomain',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','https:','154495UfFMEC','skillHubDomain','search','799351YWodGj','1DLheWV','str',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','username','6129774Bqaddz','parse','For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.','270312WquuMF','Invalid\x20domain\x20config\x20JSON:\x20','filter','996036MVpOPo'];a206_0x1fdc=function(){return _0x439be4;};return a206_0x1fdc();}const a206_0x1a9564=a206_0x1ce8;(function(_0x2ecf62,_0x7398ea){const _0x374900=a206_0x1ce8,_0x49001e=_0x2ecf62();while(!![]){try{const _0x207903=parseInt(_0x374900(0xd2))/0x1*(parseInt(_0x374900(0xdc))/0x2)+parseInt(_0x374900(0xe1))/0x3*(-parseInt(_0x374900(0xf6))/0x4)+parseInt(_0x374900(0xce))/0x5+-parseInt(_0x374900(0xf3))/0x6+-parseInt(_0x374900(0xd1))/0x7+-parseInt(_0x374900(0xd9))/0x8+parseInt(_0x374900(0xd6))/0x9;if(_0x207903===_0x7398ea)break;else _0x49001e['push'](_0x49001e['shift']());}catch(_0x1e4bf0){_0x49001e['push'](_0x49001e['shift']());}}}(a206_0x1fdc,0x68c01));import{existsSync,readFileSync}from'node:fs';function a206_0x1ce8(_0x136591,_0x2cef52){_0x136591=_0x136591-0xc9;const _0x1fdce8=a206_0x1fdc();let _0x1ce842=_0x1fdce8[_0x136591];return _0x1ce842;}import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';export const DOMAIN_CONFIG_FIELDS=[a206_0x1a9564(0xef),a206_0x1a9564(0xde),'runtimeDomain',a206_0x1a9564(0xcb),'kbDomain','appDomain'];const DOMAIN_FLAGS={'userDomain':'user-domain','apiDomain':a206_0x1a9564(0xe7),'runtimeDomain':a206_0x1a9564(0xe8),'skillDomain':a206_0x1a9564(0xe3),'kbDomain':a206_0x1a9564(0xf4),'appDomain':'app-domain'};export const LEGACY_DOMAIN_CONFIG_FIELDS=[a206_0x1a9564(0xf0),'platformDomain',a206_0x1a9564(0xcf)];export function normalizeDomainOrigin(_0x2a6cc4,_0x6d77fd){const _0x5bf7ab=a206_0x1a9564;if(typeof _0x6d77fd!=='string'||!_0x6d77fd['trim']())throw CliErrors[_0x5bf7ab(0xdd)](_0x5bf7ab(0xed)+_0x2a6cc4+_0x5bf7ab(0xd4));let _0x3ecbf1;try{_0x3ecbf1=new URL(_0x6d77fd[_0x5bf7ab(0xf8)]());}catch{throw CliErrors['validation']('Invalid\x20'+_0x2a6cc4+_0x5bf7ab(0xf5)+_0x6d77fd+_0x5bf7ab(0xeb));}if(_0x3ecbf1[_0x5bf7ab(0xdf)]!==_0x5bf7ab(0xcd)||_0x3ecbf1[_0x5bf7ab(0xd5)]||_0x3ecbf1[_0x5bf7ab(0xca)]||_0x3ecbf1[_0x5bf7ab(0xe4)]!=='/'&&_0x3ecbf1[_0x5bf7ab(0xe4)]!==''||_0x3ecbf1[_0x5bf7ab(0xd0)]||_0x3ecbf1[_0x5bf7ab(0xe6)])throw CliErrors['validation'](_0x5bf7ab(0xed)+_0x2a6cc4+_0x5bf7ab(0xcc),_0x5bf7ab(0xd8));return _0x3ecbf1['origin'];}export function readDomainConfig(_0x1b1753){const _0x40db8f=a206_0x1a9564,_0x1ea95d=isAbsolute(_0x1b1753)?_0x1b1753:resolve(process[_0x40db8f(0xec)](),_0x1b1753);if(!existsSync(_0x1ea95d))throw CliErrors[_0x40db8f(0xdd)]('Domain\x20config\x20file\x20not\x20found:\x20'+_0x1ea95d);let _0xedcecb;try{_0xedcecb=JSON[_0x40db8f(0xd7)](readFileSync(_0x1ea95d,_0x40db8f(0xf1)));}catch{throw CliErrors['validation'](_0x40db8f(0xda)+_0x1ea95d);}if(!_0xedcecb||typeof _0xedcecb!==_0x40db8f(0xe2)||Array[_0x40db8f(0xf7)](_0xedcecb))throw CliErrors[_0x40db8f(0xdd)]('Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.');const _0x519800=_0xedcecb,_0x161061=Object[_0x40db8f(0xe9)](_0x519800)[_0x40db8f(0xdb)](_0x22ed8c=>!DOMAIN_CONFIG_FIELDS[_0x40db8f(0xe0)](_0x22ed8c));if(_0x161061[_0x40db8f(0xe5)]>0x0)throw CliErrors[_0x40db8f(0xdd)](_0x40db8f(0xf2)+_0x161061[_0x40db8f(0xea)](',\x20'),'Allowed\x20fields:\x20'+DOMAIN_CONFIG_FIELDS[_0x40db8f(0xea)](',\x20'));const _0x412cdf={};for(const _0x106f9f of DOMAIN_CONFIG_FIELDS){_0x519800[_0x106f9f]!==undefined&&(_0x412cdf[_0x106f9f]=normalizeDomainOrigin(_0x106f9f,_0x519800[_0x106f9f]));}if(Object['keys'](_0x412cdf)[_0x40db8f(0xe5)]===0x0)throw CliErrors[_0x40db8f(0xdd)](_0x40db8f(0xc9));return _0x412cdf;}export function resolveDomainFlags(_0x38bd9a){const _0x411b3c=a206_0x1a9564,_0x3f4dae=(_0x38bd9a[_0x411b3c(0xd3)](_0x411b3c(0xee))||'')[_0x411b3c(0xf8)](),_0xc34403=_0x3f4dae?readDomainConfig(_0x3f4dae):{};for(const _0xf3e691 of DOMAIN_CONFIG_FIELDS){const _0x190a35=(_0x38bd9a['str'](DOMAIN_FLAGS[_0xf3e691])||'')[_0x411b3c(0xf8)]();if(_0x190a35)_0xc34403[_0xf3e691]=normalizeDomainOrigin(_0xf3e691,_0x190a35);}return _0xc34403;}
1
+ const a206_0x229324=a206_0x4e72;(function(_0x1f715d,_0x2c31e3){const _0x2ec5a1=a206_0x4e72,_0x47d28c=_0x1f715d();while(!![]){try{const _0x11025f=-parseInt(_0x2ec5a1(0xe0))/0x1+-parseInt(_0x2ec5a1(0xe3))/0x2+parseInt(_0x2ec5a1(0xd6))/0x3+parseInt(_0x2ec5a1(0xd8))/0x4+-parseInt(_0x2ec5a1(0xd1))/0x5*(-parseInt(_0x2ec5a1(0xd9))/0x6)+-parseInt(_0x2ec5a1(0xec))/0x7*(-parseInt(_0x2ec5a1(0xf7))/0x8)+parseInt(_0x2ec5a1(0xde))/0x9*(-parseInt(_0x2ec5a1(0xe8))/0xa);if(_0x11025f===_0x2c31e3)break;else _0x47d28c['push'](_0x47d28c['shift']());}catch(_0x1ff500){_0x47d28c['push'](_0x47d28c['shift']());}}}(a206_0x36bc,0xc2888));import{existsSync,readFileSync}from'node:fs';import{isAbsolute,resolve}from'node:path';import{CliErrors}from'../errors.js';export const DOMAIN_CONFIG_FIELDS=[a206_0x229324(0xcb),'apiDomain',a206_0x229324(0xca),a206_0x229324(0xe5),a206_0x229324(0xe7),a206_0x229324(0xef)];function a206_0x36bc(){const _0x1d1e57=['string','2155930wddIOR','origin','filter','search','hash','3908136HyDxvX','pathname','4441736pAgVof','18NKjRSL','str','Invalid\x20domain\x20config\x20JSON:\x20',':\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','utf8','110079VzIMkd',':\x20expected\x20a\x20non-empty\x20HTTPS\x20origin.','673095SMoPYL','Allowed\x20fields:\x20','domain-config','1810324SQkkXz','Domain\x20config\x20file\x20not\x20found:\x20','skillDomain','trim','kbDomain','2190yEpEyJ','join','keys','Invalid\x20','377146lQMHcZ','skillHubDomain','For\x20internal\x20deployments,\x20terminate\x20TLS\x20at\x20the\x20ingress,\x20reverse\x20proxy,\x20or\x20load\x20balancer;\x20an\x20internal\x20CA\x20is\x20supported.','appDomain','agentDomain','isArray','user-domain','Invalid\x20domain\x20config:\x20provide\x20at\x20least\x20one\x20supported\x20Domain.','protocol','length','validation','200heiXyV','runtimeDomain','userDomain','\x22\x20is\x20not\x20a\x20valid\x20URL.','https:','includes','skill-domain'];a206_0x36bc=function(){return _0x1d1e57;};return a206_0x36bc();}const DOMAIN_FLAGS={'userDomain':a206_0x229324(0xf2),'apiDomain':'api-domain','runtimeDomain':'runtime-domain','skillDomain':a206_0x229324(0xcf),'kbDomain':'kb-domain','appDomain':'app-domain'};function a206_0x4e72(_0x28ce74,_0x1ae9c3){_0x28ce74=_0x28ce74-0xca;const _0x36bc3b=a206_0x36bc();let _0x4e72a9=_0x36bc3b[_0x28ce74];return _0x4e72a9;}export const LEGACY_DOMAIN_CONFIG_FIELDS=[a206_0x229324(0xf0),'platformDomain',a206_0x229324(0xed)];export function normalizeDomainOrigin(_0x4716fc,_0x468fff){const _0x50e0f2=a206_0x229324;if(typeof _0x468fff!==_0x50e0f2(0xd0)||!_0x468fff['trim']())throw CliErrors['validation'](_0x50e0f2(0xeb)+_0x4716fc+_0x50e0f2(0xdf));let _0x1995fe;try{_0x1995fe=new URL(_0x468fff[_0x50e0f2(0xe6)]());}catch{throw CliErrors['validation'](_0x50e0f2(0xeb)+_0x4716fc+':\x20\x22'+_0x468fff+_0x50e0f2(0xcc));}if(_0x1995fe[_0x50e0f2(0xf4)]!==_0x50e0f2(0xcd)||_0x1995fe['username']||_0x1995fe['password']||_0x1995fe[_0x50e0f2(0xd7)]!=='/'&&_0x1995fe[_0x50e0f2(0xd7)]!==''||_0x1995fe[_0x50e0f2(0xd4)]||_0x1995fe[_0x50e0f2(0xd5)])throw CliErrors[_0x50e0f2(0xf6)](_0x50e0f2(0xeb)+_0x4716fc+_0x50e0f2(0xdc),_0x50e0f2(0xee));return _0x1995fe[_0x50e0f2(0xd2)];}export function readDomainConfig(_0x382890){const _0x45e835=a206_0x229324,_0x38c53d=isAbsolute(_0x382890)?_0x382890:resolve(process['cwd'](),_0x382890);if(!existsSync(_0x38c53d))throw CliErrors[_0x45e835(0xf6)](_0x45e835(0xe4)+_0x38c53d);let _0x183184;try{_0x183184=JSON['parse'](readFileSync(_0x38c53d,_0x45e835(0xdd)));}catch{throw CliErrors[_0x45e835(0xf6)](_0x45e835(0xdb)+_0x38c53d);}if(!_0x183184||typeof _0x183184!=='object'||Array[_0x45e835(0xf1)](_0x183184))throw CliErrors['validation']('Invalid\x20domain\x20config:\x20expected\x20a\x20JSON\x20object.');const _0x147ab8=_0x183184,_0x1e4df3=Object['keys'](_0x147ab8)[_0x45e835(0xd3)](_0x5322ed=>!DOMAIN_CONFIG_FIELDS[_0x45e835(0xce)](_0x5322ed));if(_0x1e4df3[_0x45e835(0xf5)]>0x0)throw CliErrors['validation']('Unsupported\x20domain\x20config\x20field(s):\x20'+_0x1e4df3[_0x45e835(0xe9)](',\x20'),_0x45e835(0xe1)+DOMAIN_CONFIG_FIELDS[_0x45e835(0xe9)](',\x20'));const _0x4140c2={};for(const _0x5dc1d8 of DOMAIN_CONFIG_FIELDS){_0x147ab8[_0x5dc1d8]!==undefined&&(_0x4140c2[_0x5dc1d8]=normalizeDomainOrigin(_0x5dc1d8,_0x147ab8[_0x5dc1d8]));}if(Object[_0x45e835(0xea)](_0x4140c2)['length']===0x0)throw CliErrors[_0x45e835(0xf6)](_0x45e835(0xf3));return _0x4140c2;}export function resolveDomainFlags(_0x14af31){const _0x1dd971=a206_0x229324,_0x507e80=(_0x14af31[_0x1dd971(0xda)](_0x1dd971(0xe2))||'')['trim'](),_0x475f4f=_0x507e80?readDomainConfig(_0x507e80):{};for(const _0x55801e of DOMAIN_CONFIG_FIELDS){const _0x2ef865=(_0x14af31[_0x1dd971(0xda)](DOMAIN_FLAGS[_0x55801e])||'')['trim']();if(_0x2ef865)_0x475f4f[_0x55801e]=normalizeDomainOrigin(_0x55801e,_0x2ef865);}return _0x475f4f;}