@lovrabet/rabetbase-cli 2.3.7-beta.2 → 2.3.7-beta.3

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 (243) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.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/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.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/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- const a156_0x2d077b=a156_0x3bc0;(function(_0x258b42,_0x2e5b48){const _0x465328=a156_0x3bc0,_0x253287=_0x258b42();while(!![]){try{const _0x48bc32=-parseInt(_0x465328(0x1f2))/0x1+parseInt(_0x465328(0x1f0))/0x2+parseInt(_0x465328(0x1e6))/0x3+-parseInt(_0x465328(0x1ea))/0x4+-parseInt(_0x465328(0x1e4))/0x5*(parseInt(_0x465328(0x1f1))/0x6)+-parseInt(_0x465328(0x1e9))/0x7+parseInt(_0x465328(0x1f7))/0x8;if(_0x48bc32===_0x2e5b48)break;else _0x253287['push'](_0x253287['shift']());}catch(_0x4982d0){_0x253287['push'](_0x253287['shift']());}}}(a156_0x509a,0x21ed1));import{getSqlQueryInfo}from'../../core/api-client.js';function a156_0x509a(){const _0x1db7ed=['sqlName','950362KpMpAL','1053644pMAzNT','read','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','verbose','bool','392064KFASdR','6lgIbfl','263722SFhJCZ','detail','appCode','sqlCode','dbId','4524504nDcMTY','772715TLrIFm','boolean','584424UsiMWs','sql'];a156_0x509a=function(){return _0x1db7ed;};return a156_0x509a();}import{getDbName}from'../../core/db-resolver.js';function a156_0x3bc0(_0x1825de,_0x4fe6fe){_0x1825de=_0x1825de-0x1e4;const _0x509a53=a156_0x509a();let _0x3bc043=_0x509a53[_0x1825de];return _0x3bc043;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a156_0x2d077b(0x1e7),'command':a156_0x2d077b(0x1f3),'description':a156_0x2d077b(0x1ed),'risk':a156_0x2d077b(0x1eb),'flags':[SQLCODE_FLAG,{'name':a156_0x2d077b(0x1ee),'type':a156_0x2d077b(0x1e5),'description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x1bd1f4){const _0xa9d75e=a156_0x2d077b,_0x3ccfdd=await getSqlQueryInfo(_0x1bd1f4[_0xa9d75e(0x1f4)],_0x1bd1f4['str']('sqlcode')),_0x4156f7=_0x1bd1f4[_0xa9d75e(0x1ef)](_0xa9d75e(0x1ee));if(_0x4156f7)return{'ok':!![],'data':_0x3ccfdd};const _0x2b3af1=_0x3ccfdd['dbId']?await getDbName(_0x1bd1f4['appCode'],_0x3ccfdd[_0xa9d75e(0x1f6)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x3ccfdd[_0xa9d75e(0x1f5)],'sqlName':_0x3ccfdd[_0xa9d75e(0x1e8)],'db':_0x2b3af1?_0x2b3af1+'\x20('+_0x3ccfdd[_0xa9d75e(0x1f6)]+')':_0x3ccfdd['dbId']??'','description':_0x3ccfdd['description']??'','sqlContent':_0x3ccfdd[_0xa9d75e(0x1ec)]??''}};}};
1
+ function a156_0x2dd8(_0x31847a,_0x4eaa8a){_0x31847a=_0x31847a-0xeb;const _0x6e7b=a156_0x6e7b();let _0x2dd8f0=_0x6e7b[_0x31847a];return _0x2dd8f0;}const a156_0x321b9b=a156_0x2dd8;function a156_0x6e7b(){const _0x4ac191=['sqlcode','sqlCode','6gaOblP','8736539cNKsft','bool','5958603csWnba','966116kWoJhd','detail','appCode','4511416AyTLkq','dbId','Return\x20full\x20raw\x20SQL\x20query\x20object','3034465RmHhDI','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','boolean','472113vdOIlv','read','verbose','3981600LeOKBv','12vaQEHC','2LjsQCx'];a156_0x6e7b=function(){return _0x4ac191;};return a156_0x6e7b();}(function(_0x7f2bc8,_0x17e85e){const _0x3bf83e=a156_0x2dd8,_0x2c1692=_0x7f2bc8();while(!![]){try{const _0x4935c1=parseInt(_0x3bf83e(0xfa))/0x1*(parseInt(_0x3bf83e(0xec))/0x2)+parseInt(_0x3bf83e(0xf5))/0x3*(-parseInt(_0x3bf83e(0xf9))/0x4)+parseInt(_0x3bf83e(0xf2))/0x5+parseInt(_0x3bf83e(0xfd))/0x6*(-parseInt(_0x3bf83e(0xfe))/0x7)+parseInt(_0x3bf83e(0xef))/0x8+parseInt(_0x3bf83e(0xeb))/0x9+-parseInt(_0x3bf83e(0xf8))/0xa;if(_0x4935c1===_0x17e85e)break;else _0x2c1692['push'](_0x2c1692['shift']());}catch(_0x2309b5){_0x2c1692['push'](_0x2c1692['shift']());}}}(a156_0x6e7b,0xa62cd));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':a156_0x321b9b(0xed),'description':a156_0x321b9b(0xf3),'risk':a156_0x321b9b(0xf6),'flags':[SQLCODE_FLAG,{'name':a156_0x321b9b(0xf7),'type':a156_0x321b9b(0xf4),'description':a156_0x321b9b(0xf1)}],async 'execute'(_0x117bd2){const _0x1bf492=a156_0x321b9b,_0xfde96c=await getSqlQueryInfo(_0x117bd2[_0x1bf492(0xee)],_0x117bd2['str'](_0x1bf492(0xfb))),_0x2906ca=_0x117bd2[_0x1bf492(0xff)](_0x1bf492(0xf7));if(_0x2906ca)return{'ok':!![],'data':_0xfde96c};const _0x2f51b5=_0xfde96c[_0x1bf492(0xf0)]?await getDbName(_0x117bd2['appCode'],_0xfde96c['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0xfde96c[_0x1bf492(0xfc)],'sqlName':_0xfde96c['sqlName'],'db':_0x2f51b5?_0x2f51b5+'\x20('+_0xfde96c[_0x1bf492(0xf0)]+')':_0xfde96c['dbId']??'','description':_0xfde96c['description']??'','sqlContent':_0xfde96c['sqlContent']??''}};}};
@@ -1 +1 @@
1
- const a157_0x26fe2a=a157_0x5444;(function(_0x2d0685,_0x1b36a6){const _0x1dbeb9=a157_0x5444,_0x336592=_0x2d0685();while(!![]){try{const _0x2c9eb4=parseInt(_0x1dbeb9(0x76))/0x1*(-parseInt(_0x1dbeb9(0x7c))/0x2)+-parseInt(_0x1dbeb9(0x73))/0x3*(-parseInt(_0x1dbeb9(0x72))/0x4)+-parseInt(_0x1dbeb9(0x75))/0x5*(parseInt(_0x1dbeb9(0x82))/0x6)+parseInt(_0x1dbeb9(0x7f))/0x7+-parseInt(_0x1dbeb9(0x79))/0x8+-parseInt(_0x1dbeb9(0x71))/0x9+-parseInt(_0x1dbeb9(0x7d))/0xa*(-parseInt(_0x1dbeb9(0x6b))/0xb);if(_0x2c9eb4===_0x1b36a6)break;else _0x336592['push'](_0x336592['shift']());}catch(_0x24dcec){_0x336592['push'](_0x336592['shift']());}}}(a157_0x1c77,0xcbd5c));import{executeSql}from'../../core/api-client.js';function a157_0x5444(_0x318832,_0x426001){_0x318832=_0x318832-0x6a;const _0x1c771e=a157_0x1c77();let _0x5444b8=_0x1c771e[_0x318832];return _0x5444b8;}function a157_0x1c77(){const _0x3249d7=['Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','execResult','32JMHGMC','250bavMFL','exec','5207020icPPmh','\x20row(s)\x20in\x20','string','3054BTzoMG','SQL\x20execution\x20failed','1222111kFQgPK','sql','str','read','appCode','length','14078808fVewPv','29960wSICCh','585ZLpKzP','execSuccess','8135IxGJca','60610AnONRK','params','Returned\x20','6278496vKtJkL'];a157_0x1c77=function(){return _0x3249d7;};return a157_0x1c77();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a157_0x26fe2a(0x6c),'command':a157_0x26fe2a(0x7e),'description':a157_0x26fe2a(0x7a),'risk':a157_0x26fe2a(0x6e),'flags':[SQLCODE_FLAG,{'name':'params','type':a157_0x26fe2a(0x81),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x3a0f41){const _0x27bde4=a157_0x26fe2a,_0x49056b=parseJsonParams(_0x3a0f41[_0x27bde4(0x6d)](_0x27bde4(0x77))),_0x39f69a=Date['now'](),_0x143269=await executeSql(_0x3a0f41[_0x27bde4(0x6f)],_0x3a0f41[_0x27bde4(0x6d)]('sqlcode'),_0x49056b),_0x357842=Date['now']()-_0x39f69a,_0x52121d=_0x143269?.[_0x27bde4(0x7b)]??_0x143269,_0x37a27d=_0x143269?.[_0x27bde4(0x74)]??!![];if(!_0x37a27d)return{'ok':![],'data':{'error':_0x143269?.['execError']||_0x27bde4(0x6a),'elapsed':_0x357842},'message':_0x27bde4(0x6a)};const _0x4e3475=Array['isArray'](_0x52121d)?_0x52121d:[];return{'ok':!![],'data':{'rows':_0x4e3475,'rowCount':_0x4e3475[_0x27bde4(0x70)],'elapsed':_0x357842},'message':_0x27bde4(0x78)+_0x4e3475[_0x27bde4(0x70)]+_0x27bde4(0x80)+_0x357842+'ms'};}};
1
+ function a157_0x34b5(_0x1c89ae,_0x43bd18){_0x1c89ae=_0x1c89ae-0x115;const _0x588a1f=a157_0x588a();let _0x34b531=_0x588a1f[_0x1c89ae];return _0x34b531;}const a157_0x4b99e4=a157_0x34b5;function a157_0x588a(){const _0x2ba749=['sql','14117949OZecQX','length','params','205mbzsOx','5394tJLlaN','3QIFYyR','1735168LOKRbx','11626818SdwxjE','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','3295yBAxep','execSuccess','Returned\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','10567472ztSobK','26138920GPKQDB','SQL\x20execution\x20failed','str','now','isArray','execResult','read','execError','11338rzlsnx','sqlcode','exec'];a157_0x588a=function(){return _0x2ba749;};return a157_0x588a();}(function(_0x5ef81f,_0x381c19){const _0x40cc14=a157_0x34b5,_0x202ebb=_0x5ef81f();while(!![]){try{const _0x371db0=-parseInt(_0x40cc14(0x11d))/0x1*(-parseInt(_0x40cc14(0x116))/0x2)+-parseInt(_0x40cc14(0x11f))/0x3*(-parseInt(_0x40cc14(0x120))/0x4)+-parseInt(_0x40cc14(0x123))/0x5*(-parseInt(_0x40cc14(0x11e))/0x6)+parseInt(_0x40cc14(0x121))/0x7+parseInt(_0x40cc14(0x127))/0x8+-parseInt(_0x40cc14(0x11a))/0x9+-parseInt(_0x40cc14(0x128))/0xa;if(_0x371db0===_0x381c19)break;else _0x202ebb['push'](_0x202ebb['shift']());}catch(_0x2cb0dc){_0x202ebb['push'](_0x202ebb['shift']());}}}(a157_0x588a,0xf1255));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a157_0x4b99e4(0x119),'command':a157_0x4b99e4(0x118),'description':a157_0x4b99e4(0x126),'risk':a157_0x4b99e4(0x12e),'flags':[SQLCODE_FLAG,{'name':a157_0x4b99e4(0x11c),'type':'string','description':a157_0x4b99e4(0x122)}],async 'execute'(_0xb80be8){const _0x4fb4c0=a157_0x4b99e4,_0x4ab098=parseJsonParams(_0xb80be8[_0x4fb4c0(0x12a)](_0x4fb4c0(0x11c))),_0x440516=Date['now'](),_0x565a2b=await executeSql(_0xb80be8['appCode'],_0xb80be8['str'](_0x4fb4c0(0x117)),_0x4ab098),_0x2458b7=Date[_0x4fb4c0(0x12b)]()-_0x440516,_0x5f538b=_0x565a2b?.[_0x4fb4c0(0x12d)]??_0x565a2b,_0x454218=_0x565a2b?.[_0x4fb4c0(0x124)]??!![];if(!_0x454218)return{'ok':![],'data':{'error':_0x565a2b?.[_0x4fb4c0(0x115)]||_0x4fb4c0(0x129),'elapsed':_0x2458b7},'message':_0x4fb4c0(0x129)};const _0x40ecdd=Array[_0x4fb4c0(0x12c)](_0x5f538b)?_0x5f538b:[];return{'ok':!![],'data':{'rows':_0x40ecdd,'rowCount':_0x40ecdd[_0x4fb4c0(0x11b)],'elapsed':_0x2458b7},'message':_0x4fb4c0(0x125)+_0x40ecdd[_0x4fb4c0(0x11b)]+'\x20row(s)\x20in\x20'+_0x2458b7+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x23f675,_0x23bb1f){const _0x4f7956=a158_0x7d04,_0xe23146=_0x23f675();while(!![]){try{const _0x5076a7=-parseInt(_0x4f7956(0x123))/0x1*(parseInt(_0x4f7956(0x120))/0x2)+-parseInt(_0x4f7956(0x11b))/0x3+parseInt(_0x4f7956(0x11a))/0x4*(-parseInt(_0x4f7956(0x124))/0x5)+parseInt(_0x4f7956(0x11d))/0x6+-parseInt(_0x4f7956(0x121))/0x7*(-parseInt(_0x4f7956(0x11c))/0x8)+parseInt(_0x4f7956(0x11e))/0x9*(-parseInt(_0x4f7956(0x11f))/0xa)+parseInt(_0x4f7956(0x122))/0xb;if(_0x5076a7===_0x23bb1f)break;else _0xe23146['push'](_0xe23146['shift']());}catch(_0x5ce372){_0xe23146['push'](_0xe23146['shift']());}}}(a158_0x164c,0x8dd1b));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';function a158_0x7d04(_0x5b3f43,_0xd899ed){_0x5b3f43=_0x5b3f43-0x11a;const _0x164c39=a158_0x164c();let _0x7d0472=_0x164c39[_0x5b3f43];return _0x7d0472;}import{sqlSave}from'../../commands/sql/save.js';function a158_0x164c(){const _0x228cbe=['12447hMOftr','7070KSgpFy','328sIWqMf','63273LDbFZe','28147735TIVJzE','2855oWkCPc','25NFbxqV','326748ddHjEg','3036603XjYuuD','160hBjmZQ','4247178mwmLzx'];a158_0x164c=function(){return _0x228cbe;};return a158_0x164c();}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0x900a59,_0x471632){const _0x3bc484=a158_0x480c,_0x337520=_0x900a59();while(!![]){try{const _0x38fcf3=parseInt(_0x3bc484(0xe3))/0x1+-parseInt(_0x3bc484(0xe4))/0x2+parseInt(_0x3bc484(0xe7))/0x3+-parseInt(_0x3bc484(0xe6))/0x4+-parseInt(_0x3bc484(0xea))/0x5+parseInt(_0x3bc484(0xe8))/0x6*(parseInt(_0x3bc484(0xe5))/0x7)+-parseInt(_0x3bc484(0xeb))/0x8*(-parseInt(_0x3bc484(0xe9))/0x9);if(_0x38fcf3===_0x471632)break;else _0x337520['push'](_0x337520['shift']());}catch(_0x4a80b0){_0x337520['push'](_0x337520['shift']());}}}(a158_0x3148,0xc30d3));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';function a158_0x480c(_0x2636d1,_0x1abcc2){_0x2636d1=_0x2636d1-0xe3;const _0x3148c2=a158_0x3148();let _0x480cc2=_0x3148c2[_0x2636d1];return _0x480cc2;}import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a158_0x3148(){const _0x4fe5be=['6360550RpzDUH','6184sRgeBf','1532922QRAAbm','1224828jgvZVA','705691fbQbjz','5769152XrUbtA','141027DJEwTX','6jKhset','28467MfupvS'];a158_0x3148=function(){return _0x4fe5be;};return a158_0x3148();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a159_0x18bd18=a159_0x77a9;(function(_0x3a599d,_0x98cd){const _0x1df0b8=a159_0x77a9,_0x2d38ba=_0x3a599d();while(!![]){try{const _0x515aab=parseInt(_0x1df0b8(0x1a4))/0x1*(-parseInt(_0x1df0b8(0x199))/0x2)+parseInt(_0x1df0b8(0x1b8))/0x3*(parseInt(_0x1df0b8(0x19e))/0x4)+-parseInt(_0x1df0b8(0x1ba))/0x5*(-parseInt(_0x1df0b8(0x1af))/0x6)+parseInt(_0x1df0b8(0x19d))/0x7*(-parseInt(_0x1df0b8(0x196))/0x8)+-parseInt(_0x1df0b8(0x1b1))/0x9*(-parseInt(_0x1df0b8(0x1b6))/0xa)+-parseInt(_0x1df0b8(0x19f))/0xb*(parseInt(_0x1df0b8(0x195))/0xc)+parseInt(_0x1df0b8(0x1a9))/0xd;if(_0x515aab===_0x98cd)break;else _0x2d38ba['push'](_0x2d38ba['shift']());}catch(_0x18babe){_0x2d38ba['push'](_0x2d38ba['shift']());}}}(a159_0x231e,0x71f76));function a159_0x231e(){const _0x2ee159=['1958735qNQUtF','dbId','all','bool','9132DGneeF','864mbvDtM','length','map','8966aOQjKH','boolean','name','description','59843AJWUmK','28XCBbzv','12034lPFtZZ','str','pagesize','read','sqlName','23MoGkeH','tableData','Page\x20size','sql','verbose','4036422ygpJum','Page\x20number','List\x20custom\x20SQL\x20queries','sqlcode','page','num','6nOHJpr','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','9vNKvSw','list','string','number','appCode','8241910MfDggw','paging','342561AQnSpG','totalCount'];a159_0x231e=function(){return _0x2ee159;};return a159_0x231e();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a159_0x77a9(_0x328138,_0x5dc4d0){_0x328138=_0x328138-0x192;const _0x231e32=a159_0x231e();let _0x77a9a5=_0x231e32[_0x328138];return _0x77a9a5;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a159_0x18bd18(0x1a7),'command':a159_0x18bd18(0x1b2),'description':a159_0x18bd18(0x1ab),'risk':a159_0x18bd18(0x1a2),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x18bd18(0x19b),'type':a159_0x18bd18(0x1b3),'description':'Filter\x20by\x20SQL\x20name'},{'name':'page','type':a159_0x18bd18(0x1b4),'description':a159_0x18bd18(0x1aa),'default':0x1},{'name':a159_0x18bd18(0x1a1),'type':a159_0x18bd18(0x1b4),'description':a159_0x18bd18(0x1a6)},{'name':a159_0x18bd18(0x1a8),'type':a159_0x18bd18(0x19a),'description':a159_0x18bd18(0x1b0)}],async 'execute'(_0x3d6ae1){const _0x19e370=a159_0x18bd18,_0xef66c8=await listSqlQueries(_0x3d6ae1[_0x19e370(0x1b5)],{'sqlCode':_0x3d6ae1[_0x19e370(0x1a0)](_0x19e370(0x1ac))||undefined,'sqlName':_0x3d6ae1[_0x19e370(0x1a0)](_0x19e370(0x19b))||undefined,'currentPage':_0x3d6ae1[_0x19e370(0x1ae)](_0x19e370(0x1ad)),'pageSize':_0x3d6ae1[_0x19e370(0x1ae)](_0x19e370(0x1a1),0x32)}),_0x4d7f58=_0x3d6ae1[_0x19e370(0x194)](_0x19e370(0x1a8)),_0x34ac53=_0xef66c8[_0x19e370(0x1a5)]??[],_0x28fd78=_0xef66c8[_0x19e370(0x1b7)]?.[_0x19e370(0x1b9)]??_0x34ac53[_0x19e370(0x197)];let _0x5cc2b5;return _0x4d7f58?_0x5cc2b5=_0x34ac53:_0x5cc2b5=await Promise[_0x19e370(0x193)](_0x34ac53[_0x19e370(0x198)](async _0x3cfe4b=>{const _0x4d0d41=_0x19e370;let _0x12b20d;try{_0x12b20d=_0x3cfe4b[_0x4d0d41(0x192)]?await getDbName(_0x3d6ae1[_0x4d0d41(0x1b5)],_0x3cfe4b[_0x4d0d41(0x192)]):undefined;}catch{}return{'sqlCode':_0x3cfe4b['sqlCode'],'sqlName':_0x3cfe4b[_0x4d0d41(0x1a3)],'description':_0x3cfe4b[_0x4d0d41(0x19c)]??'','db':_0x12b20d?_0x12b20d+'\x20('+_0x3cfe4b[_0x4d0d41(0x192)]+')':_0x3cfe4b[_0x4d0d41(0x192)]??''};})),{'ok':!![],'data':_0x5cc2b5,'message':_0x34ac53['length']===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x34ac53[_0x19e370(0x197)]+'\x20SQL\x20queries\x20(total:\x20'+_0x28fd78+').'};}};
1
+ const a159_0x203d62=a159_0x1fce;(function(_0x582410,_0x17df07){const _0x1aa812=a159_0x1fce,_0x3cf03d=_0x582410();while(!![]){try{const _0x7c4035=-parseInt(_0x1aa812(0x14a))/0x1*(parseInt(_0x1aa812(0x131))/0x2)+-parseInt(_0x1aa812(0x132))/0x3*(-parseInt(_0x1aa812(0x13e))/0x4)+-parseInt(_0x1aa812(0x12a))/0x5+parseInt(_0x1aa812(0x12e))/0x6*(-parseInt(_0x1aa812(0x140))/0x7)+parseInt(_0x1aa812(0x126))/0x8*(-parseInt(_0x1aa812(0x147))/0x9)+-parseInt(_0x1aa812(0x13a))/0xa+parseInt(_0x1aa812(0x142))/0xb;if(_0x7c4035===_0x17df07)break;else _0x3cf03d['push'](_0x3cf03d['shift']());}catch(_0x4037ef){_0x3cf03d['push'](_0x3cf03d['shift']());}}}(a159_0x14a9,0x33d25));function a159_0x14a9(){const _0x5d7070=['str','sql','appCode','Found\x20','898060oBjwwB','boolean','Filter\x20by\x20SQL\x20name','pagesize','44bIIyZf','map','1603sKPxxy','tableData','8203250xcxOMO','List\x20custom\x20SQL\x20queries','name','string','bool','9ISTcyo','page','No\x20custom\x20SQL\x20queries\x20found.','16787pgOeKF','597832bjDqdE','sqlcode','list','num','1475320SMEyLl','Page\x20number','dbId','totalCount','3900JoEKmo','read','Page\x20size','10CQNrML','43335dPCpMQ','paging','length','sqlCode'];a159_0x14a9=function(){return _0x5d7070;};return a159_0x14a9();}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a159_0x1fce(_0x1829fb,_0x1d89c4){_0x1829fb=_0x1829fb-0x126;const _0x14a971=a159_0x14a9();let _0x1fce67=_0x14a971[_0x1829fb];return _0x1fce67;}export const sqlList={'service':a159_0x203d62(0x137),'command':a159_0x203d62(0x128),'description':a159_0x203d62(0x143),'risk':a159_0x203d62(0x12f),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a159_0x203d62(0x144),'type':a159_0x203d62(0x145),'description':a159_0x203d62(0x13c)},{'name':a159_0x203d62(0x148),'type':'number','description':a159_0x203d62(0x12b),'default':0x1},{'name':a159_0x203d62(0x13d),'type':'number','description':a159_0x203d62(0x130)},{'name':'verbose','type':a159_0x203d62(0x13b),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x25480b){const _0x3229d0=a159_0x203d62,_0x1e8cd7=await listSqlQueries(_0x25480b[_0x3229d0(0x138)],{'sqlCode':_0x25480b['str'](_0x3229d0(0x127))||undefined,'sqlName':_0x25480b[_0x3229d0(0x136)](_0x3229d0(0x144))||undefined,'currentPage':_0x25480b[_0x3229d0(0x129)](_0x3229d0(0x148)),'pageSize':_0x25480b[_0x3229d0(0x129)]('pagesize',0x32)}),_0x5b5ecc=_0x25480b[_0x3229d0(0x146)]('verbose'),_0x3b115e=_0x1e8cd7[_0x3229d0(0x141)]??[],_0x4326fb=_0x1e8cd7[_0x3229d0(0x133)]?.[_0x3229d0(0x12d)]??_0x3b115e[_0x3229d0(0x134)];let _0x434ef5;return _0x5b5ecc?_0x434ef5=_0x3b115e:_0x434ef5=await Promise['all'](_0x3b115e[_0x3229d0(0x13f)](async _0x15708a=>{const _0x192e65=_0x3229d0;let _0x56d280;try{_0x56d280=_0x15708a['dbId']?await getDbName(_0x25480b[_0x192e65(0x138)],_0x15708a[_0x192e65(0x12c)]):undefined;}catch{}return{'sqlCode':_0x15708a[_0x192e65(0x135)],'sqlName':_0x15708a['sqlName'],'description':_0x15708a['description']??'','db':_0x56d280?_0x56d280+'\x20('+_0x15708a['dbId']+')':_0x15708a['dbId']??''};})),{'ok':!![],'data':_0x434ef5,'message':_0x3b115e[_0x3229d0(0x134)]===0x0?_0x3229d0(0x149):_0x3229d0(0x139)+_0x3b115e[_0x3229d0(0x134)]+'\x20SQL\x20queries\x20(total:\x20'+_0x4326fb+').'};}};
@@ -1 +1 @@
1
- function a160_0x447e(_0x6c9441,_0x6ef2a1){_0x6c9441=_0x6c9441-0xa4;const _0x2f5c49=a160_0x2f5c();let _0x447ee3=_0x2f5c49[_0x6c9441];return _0x447ee3;}const a160_0x537a4=a160_0x447e;(function(_0x1d085b,_0xfa8a3d){const _0x5d7956=a160_0x447e,_0x23f542=_0x1d085b();while(!![]){try{const _0xef4a72=-parseInt(_0x5d7956(0xa6))/0x1+-parseInt(_0x5d7956(0xb8))/0x2+parseInt(_0x5d7956(0xaf))/0x3+-parseInt(_0x5d7956(0xb9))/0x4+parseInt(_0x5d7956(0xae))/0x5+-parseInt(_0x5d7956(0xd2))/0x6*(-parseInt(_0x5d7956(0xd4))/0x7)+parseInt(_0x5d7956(0xd0))/0x8;if(_0xef4a72===_0xfa8a3d)break;else _0x23f542['push'](_0x23f542['shift']());}catch(_0x1ae473){_0x23f542['push'](_0x23f542['shift']());}}}(a160_0x2f5c,0xef095));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x50cf63,_0x3ddece){const _0x3024e9=a160_0x447e,_0x1199cc=[];let _0x30e4ea=0x1;while(!![]){const _0x169d00=await listSqlQueries(_0x50cf63,{'currentPage':_0x30e4ea,'pageSize':PAGE_SIZE,'sqlCode':_0x3ddece[_0x3024e9(0xb2)],'sqlName':_0x3ddece[_0x3024e9(0xc1)]}),_0x29b061=_0x169d00[_0x3024e9(0xd9)]??[];_0x1199cc[_0x3024e9(0xdb)](..._0x29b061);if(_0x29b061[_0x3024e9(0xd7)]===0x0)break;const _0x2786f6=_0x169d00['paging']?.[_0x3024e9(0xc9)];if(_0x2786f6!=null?_0x1199cc['length']>=_0x2786f6:_0x29b061[_0x3024e9(0xd7)]<PAGE_SIZE)break;_0x30e4ea++;}return _0x1199cc;}async function ensureSqlContent(_0x388a6a){const _0x19f7cc=a160_0x447e;if(_0x388a6a[_0x19f7cc(0xbf)]!=null&&String(_0x388a6a[_0x19f7cc(0xbf)])[_0x19f7cc(0xd7)]>0x0)return _0x388a6a;return getSqlQueryDetail(_0x388a6a[_0x19f7cc(0xb2)]);}export const sqlPull={'service':a160_0x537a4(0xc8),'command':a160_0x537a4(0xad),'description':a160_0x537a4(0xbe),'risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a160_0x537a4(0xb1),'type':a160_0x537a4(0xc7),'description':a160_0x537a4(0xab)},{'name':'force','type':a160_0x537a4(0xdc),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x10110f){const _0x4cd0ee=a160_0x537a4,_0x525c42=loadSqlProjectConfig(_0x10110f['appCode']),_0x34d5b7=await readSqlLockFile(_0x525c42[_0x4cd0ee(0xa8)]),{appLock:_0x438a75}=ensureSqlLockScope(_0x34d5b7??createEmptySqlLock(),_0x525c42[_0x4cd0ee(0xdd)],_0x525c42[_0x4cd0ee(0xa4)],_0x4cd0ee(0xad)),_0x490dcc=await fetchAllSqlQueries(_0x10110f[_0x4cd0ee(0xdd)],{'sqlCode':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xc3))||undefined,'sqlName':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xb1))||undefined}),_0x36e343=[];for(const _0x559e1c of _0x490dcc){const _0x4d5650=await ensureSqlContent(_0x559e1c),_0x16f177=ensureRemoteSqlContent(_0x4d5650),_0x3d32cf=detectModeFromSql(_0x4d5650),_0x55e48d=_0x4d5650[_0x4cd0ee(0xda)]?await getDbName(_0x10110f[_0x4cd0ee(0xdd)],Number(_0x4d5650[_0x4cd0ee(0xda)]))['catch'](()=>undefined):undefined,_0x1e5866=buildLocalSqlFileContent({'sqlCode':_0x4d5650['sqlCode'],'sqlName':_0x4d5650[_0x4cd0ee(0xc1)],'dbId':_0x4d5650[_0x4cd0ee(0xda)]},_0x16f177,{'dbName':_0x55e48d,'mode':_0x3d32cf,'syncedAt':new Date()[_0x4cd0ee(0xc0)](),'description':_0x4d5650[_0x4cd0ee(0xb5)]}),_0x88e7e9=buildSqlLockEntry(_0x4d5650,_0x16f177,'',{'dbName':_0x55e48d}),_0x524eb1=resolveLocalSqlFilePath(_0x525c42,_0x4d5650[_0x4cd0ee(0xb2)],_0x88e7e9);let _0x4aff64=_0x4cd0ee(0xa5),_0x37fed5;if(await fileExists(_0x524eb1)){const _0x18aa69=await readFile(_0x524eb1,_0x4cd0ee(0xca));isEquivalentPulledSqlFile(_0x18aa69,_0x1e5866,_0x3d32cf)?(_0x4aff64='skipped',_0x37fed5='unchanged'):(_0x4aff64=_0x4cd0ee(0xb6),_0x37fed5=_0x4cd0ee(0xb3));}_0x36e343[_0x4cd0ee(0xdb)]({'sqlCode':_0x4d5650[_0x4cd0ee(0xb2)],'sqlName':_0x4d5650[_0x4cd0ee(0xc1)],'filePath':_0x524eb1,'status':_0x4aff64,'reason':_0x37fed5});}return{'method':_0x4cd0ee(0xac),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x10110f[_0x4cd0ee(0xdd)],'sqlCode':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xc3))||null,'sqlName':_0x10110f[_0x4cd0ee(0xbd)](_0x4cd0ee(0xb1))||null,'files':_0x36e343},'description':_0x4cd0ee(0xba)+_0x36e343[_0x4cd0ee(0xd7)]+_0x4cd0ee(0xcc)+_0x525c42[_0x4cd0ee(0xa7)]};},async 'execute'(_0x506607){const _0x4f9ccb=a160_0x537a4,_0x5a9f9f=loadSqlProjectConfig(_0x506607[_0x4f9ccb(0xdd)]),_0x1608a8=await readSqlLockFile(_0x5a9f9f[_0x4f9ccb(0xa8)]),{lockData:_0x132acc,appLock:_0x368c55}=ensureSqlLockScope(_0x1608a8??createEmptySqlLock(),_0x5a9f9f[_0x4f9ccb(0xdd)],_0x5a9f9f[_0x4f9ccb(0xa4)],_0x4f9ccb(0xad)),_0x26a74a=_0x506607[_0x4f9ccb(0xb4)](_0x4f9ccb(0xb7)),_0x2d50d9=await fetchAllSqlQueries(_0x506607[_0x4f9ccb(0xdd)],{'sqlCode':_0x506607['str'](_0x4f9ccb(0xc3))||undefined,'sqlName':_0x506607[_0x4f9ccb(0xbd)](_0x4f9ccb(0xb1))||undefined});if(_0x2d50d9[_0x4f9ccb(0xd7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4f9ccb(0xc5)};const _0x228164=[],_0xd729cf=[];for(const _0x399cc3 of _0x2d50d9){try{_0x228164[_0x4f9ccb(0xdb)](await ensureSqlContent(_0x399cc3));}catch(_0x4a4aa6){_0xd729cf['push']({'sqlCode':_0x399cc3['sqlCode'],'error':_0x4a4aa6 instanceof Error?_0x4a4aa6[_0x4f9ccb(0xaa)]:String(_0x4a4aa6)});}}if(_0x26a74a&&!_0x506607['nonInteractive']){let _0x18ad29=![];for(const _0x401f93 of _0x228164){const _0x28c45a=detectModeFromSql(_0x401f93),_0x979ab7=_0x401f93[_0x4f9ccb(0xda)]?await getDbName(_0x506607[_0x4f9ccb(0xdd)],Number(_0x401f93['dbId']))[_0x4f9ccb(0xde)](()=>undefined):undefined,_0x287c9d=buildLocalSqlFileContent({'sqlCode':_0x401f93['sqlCode'],'sqlName':_0x401f93['sqlName'],'dbId':_0x401f93[_0x4f9ccb(0xda)]},ensureRemoteSqlContent(_0x401f93),{'dbName':_0x979ab7,'mode':_0x28c45a,'syncedAt':new Date()[_0x4f9ccb(0xc0)](),'description':_0x401f93['description']}),_0x536e9d=resolveLocalSqlFilePath(_0x5a9f9f,_0x401f93[_0x4f9ccb(0xb2)],buildSqlLockEntry(_0x401f93,ensureRemoteSqlContent(_0x401f93),'',{'dbName':_0x979ab7}));if(await fileExists(_0x536e9d)){const _0x29c630=await readFile(_0x536e9d,_0x4f9ccb(0xca));if(!isEquivalentPulledSqlFile(_0x29c630,_0x287c9d,_0x28c45a)){_0x18ad29=!![];break;}}}if(_0x18ad29){const _0x366e6b=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x366e6b)throw CliErrors['cancelled'](_0x4f9ccb(0xcb));}}const _0x162691=cloneSqlLockData(_0x132acc),_0x5043a1=_0x162691[_0x4f9ccb(0xd6)][_0x5a9f9f[_0x4f9ccb(0xdd)]],_0x127c2b=[],_0x717e72=[];for(const _0x1fe994 of _0x228164){const _0x23a430=_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994['sqlCode']],_0x10a2fd=ensureRemoteSqlContent(_0x1fe994),_0x4ff51a=detectModeFromSql(_0x1fe994),_0x2a0b78=_0x1fe994['dbId']?await getDbName(_0x506607['appCode'],Number(_0x1fe994[_0x4f9ccb(0xda)]))[_0x4f9ccb(0xde)](()=>undefined):undefined,_0x2c8d19=buildLocalSqlFileContent({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'sqlName':_0x1fe994[_0x4f9ccb(0xc1)],'dbId':_0x1fe994[_0x4f9ccb(0xda)]},_0x10a2fd,{'dbName':_0x2a0b78,'mode':_0x4ff51a,'syncedAt':new Date()['toISOString'](),'description':_0x1fe994[_0x4f9ccb(0xb5)]}),_0x2e9e0b=buildSqlLockEntry(_0x1fe994,_0x10a2fd,computeSqlContentHash(_0x2c8d19),{'dbName':_0x2a0b78}),_0x75fdbd=_0x2e9e0b[_0x4f9ccb(0xc6)],_0x27c0a8=join(_0x5a9f9f[_0x4f9ccb(0xa7)],_0x75fdbd);try{if(await fileExists(_0x27c0a8)){const _0x57a39c=await readFile(_0x27c0a8,_0x4f9ccb(0xca));if(isEquivalentPulledSqlFile(_0x57a39c,_0x2c8d19,_0x4ff51a)){_0x717e72['push']({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'reason':_0x4f9ccb(0xcf)}),_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994['sqlCode']]={..._0x2e9e0b,'hash':computeSqlContentHash(_0x57a39c),'path':_0x75fdbd};continue;}if(!_0x26a74a){_0x717e72[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'reason':_0x4f9ccb(0xc4)});continue;}}const _0x55396a=_0x23a430?.[_0x4f9ccb(0xc6)]?join(_0x5a9f9f[_0x4f9ccb(0xa7)],_0x23a430[_0x4f9ccb(0xc6)]):undefined;_0x55396a&&_0x55396a!==_0x27c0a8&&await fileExists(_0x55396a)&&await rm(_0x55396a,{'force':!![]}),await ensureParentDirectory(_0x27c0a8),await writeFile(_0x27c0a8,_0x2c8d19,'utf8'),_0x5043a1[_0x4f9ccb(0xce)][_0x1fe994[_0x4f9ccb(0xb2)]]={..._0x2e9e0b,'path':_0x75fdbd},_0x127c2b[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994['sqlCode'],'filePath':_0x27c0a8});}catch(_0x2b2193){_0xd729cf[_0x4f9ccb(0xdb)]({'sqlCode':_0x1fe994[_0x4f9ccb(0xb2)],'error':_0x2b2193 instanceof Error?_0x2b2193[_0x4f9ccb(0xaa)]:String(_0x2b2193)});}}return _0x5043a1[_0x4f9ccb(0xd3)]=new Date()[_0x4f9ccb(0xc0)](),await writeSqlLockFile(_0x5a9f9f['lockFilePath'],_0x162691),{'ok':_0xd729cf['length']===0x0,'data':{'pulled':_0x127c2b,'skipped':_0x717e72,'failed':_0xd729cf},'message':_0x4f9ccb(0xb0)+_0x127c2b[_0x4f9ccb(0xd7)]+_0x4f9ccb(0xbc)+_0x717e72[_0x4f9ccb(0xd7)]+_0x4f9ccb(0xbb)+_0xd729cf[_0x4f9ccb(0xd7)]+'\x20failed'};}};function detectModeFromSql(_0x757116){const _0x3744ce=a160_0x537a4,_0x2f46d7=ensureRemoteSqlContent(_0x757116),_0x49b030=stripLocalSqlMetadata(_0x2f46d7,_0x3744ce(0xc2))[_0x3744ce(0xd5)]();if(/^<(select|insert|update|delete)\b/i[_0x3744ce(0xa9)](_0x49b030))return _0x3744ce(0xc2);return _0x3744ce(0xc8);}function isEquivalentPulledSqlFile(_0x3c0b87,_0x558ec3,_0x1779cc){return normalizePullComparableContent(_0x3c0b87,_0x1779cc)===normalizePullComparableContent(_0x558ec3,_0x1779cc);}function a160_0x2f5c(){const _0x20047d=['appCode','catch','sqlRoot','would_pull','893077UqhwVb','sqlRootDir','lockFilePath','test','message','Filter\x20by\x20SQL\x20display\x20name','POST','pull','4066750LyZaMN','2393337QYILGf','Pull\x20complete:\x20','name','sqlCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','bool','description','conflict','force','2440762iLPduJ','2423164zdvemd','Would\x20pull\x20','\x20skipped,\x20','\x20written,\x20','str','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','sqlContent','toISOString','sqlName','mybatisXml','sqlcode','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','path','string','sql','totalCount','utf8','Force\x20pull\x20cancelled.','\x20SQL\x20file(s)\x20into\x20','split','sqls','unchanged','2860496BSnqIV','filter','462FFFmEu','lastSync','157241bLUnRF','trimStart','apps','length','join','tableData','dbId','push','boolean'];a160_0x2f5c=function(){return _0x20047d;};return a160_0x2f5c();}function normalizePullComparableContent(_0x2259a4,_0x19f453){const _0x517f83=a160_0x537a4,_0x5b280f=_0x2259a4['replace'](/\r\n/g,'\x0a')[_0x517f83(0xcd)]('\x0a'),_0x53519f=_0x5b280f[_0x517f83(0xd1)](_0x1b54f2=>!isSyncedAtMetadataLine(_0x1b54f2,_0x19f453));return _0x53519f[_0x517f83(0xd8)]('\x0a');}function isSyncedAtMetadataLine(_0x82ee15,_0x5e039c){const _0x5567d8=a160_0x537a4;if(_0x5e039c===_0x5567d8(0xc2))return/^\s*<!--\s*@lovrabet\.syncedAt:/['test'](_0x82ee15);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x5567d8(0xa9)](_0x82ee15);}
1
+ const a160_0x468f71=a160_0x388d;function a160_0x388d(_0x116f08,_0x2ad546){_0x116f08=_0x116f08-0x12f;const _0x46dec1=a160_0x46de();let _0x388d33=_0x46dec1[_0x116f08];return _0x388d33;}(function(_0x26ce5e,_0x5c2ed1){const _0x5a1365=a160_0x388d,_0x145a13=_0x26ce5e();while(!![]){try{const _0x26f8a4=-parseInt(_0x5a1365(0x14d))/0x1*(-parseInt(_0x5a1365(0x158))/0x2)+-parseInt(_0x5a1365(0x13e))/0x3+parseInt(_0x5a1365(0x16b))/0x4+-parseInt(_0x5a1365(0x155))/0x5+parseInt(_0x5a1365(0x12f))/0x6+-parseInt(_0x5a1365(0x151))/0x7*(-parseInt(_0x5a1365(0x15b))/0x8)+parseInt(_0x5a1365(0x14e))/0x9*(-parseInt(_0x5a1365(0x132))/0xa);if(_0x26f8a4===_0x5c2ed1)break;else _0x145a13['push'](_0x145a13['shift']());}catch(_0x2dc1d1){_0x145a13['push'](_0x145a13['shift']());}}}(a160_0x46de,0x667dd));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x1c8d01,_0x306f4c){const _0x4b26c9=a160_0x388d,_0x2b9d78=[];let _0x27502e=0x1;while(!![]){const _0xaf744f=await listSqlQueries(_0x1c8d01,{'currentPage':_0x27502e,'pageSize':PAGE_SIZE,'sqlCode':_0x306f4c[_0x4b26c9(0x13c)],'sqlName':_0x306f4c[_0x4b26c9(0x149)]}),_0x56907c=_0xaf744f[_0x4b26c9(0x142)]??[];_0x2b9d78['push'](..._0x56907c);if(_0x56907c[_0x4b26c9(0x13d)]===0x0)break;const _0x2c8286=_0xaf744f[_0x4b26c9(0x167)]?.[_0x4b26c9(0x168)];if(_0x2c8286!=null?_0x2b9d78['length']>=_0x2c8286:_0x56907c[_0x4b26c9(0x13d)]<PAGE_SIZE)break;_0x27502e++;}return _0x2b9d78;}async function ensureSqlContent(_0x1fde8d){const _0xa0e031=a160_0x388d;if(_0x1fde8d[_0xa0e031(0x156)]!=null&&String(_0x1fde8d[_0xa0e031(0x156)])['length']>0x0)return _0x1fde8d;return getSqlQueryDetail(_0x1fde8d['sqlCode']);}export const sqlPull={'service':a160_0x468f71(0x153),'command':a160_0x468f71(0x15c),'description':a160_0x468f71(0x16d),'risk':a160_0x468f71(0x16e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a160_0x468f71(0x14b),'type':a160_0x468f71(0x148),'description':a160_0x468f71(0x143)},{'name':'force','type':a160_0x468f71(0x15e),'description':a160_0x468f71(0x14a)}],async 'dryRun'(_0x35ef00){const _0x1e0e63=a160_0x468f71,_0x3d2aa7=loadSqlProjectConfig(_0x35ef00['appCode']),_0x42ba2b=await readSqlLockFile(_0x3d2aa7['lockFilePath']),{appLock:_0x34c327}=ensureSqlLockScope(_0x42ba2b??createEmptySqlLock(),_0x3d2aa7[_0x1e0e63(0x16a)],_0x3d2aa7['sqlRoot'],_0x1e0e63(0x15c)),_0x416e05=await fetchAllSqlQueries(_0x35ef00[_0x1e0e63(0x16a)],{'sqlCode':_0x35ef00['str'](_0x1e0e63(0x165))||undefined,'sqlName':_0x35ef00[_0x1e0e63(0x152)](_0x1e0e63(0x14b))||undefined}),_0x58a453=[];for(const _0x5d3057 of _0x416e05){const _0x4748e2=await ensureSqlContent(_0x5d3057),_0x148958=ensureRemoteSqlContent(_0x4748e2),_0x316b1c=detectModeFromSql(_0x4748e2),_0x565a09=_0x4748e2['dbId']?await getDbName(_0x35ef00[_0x1e0e63(0x16a)],Number(_0x4748e2[_0x1e0e63(0x138)]))[_0x1e0e63(0x141)](()=>undefined):undefined,_0x1ead2c=buildLocalSqlFileContent({'sqlCode':_0x4748e2[_0x1e0e63(0x13c)],'sqlName':_0x4748e2[_0x1e0e63(0x149)],'dbId':_0x4748e2[_0x1e0e63(0x138)]},_0x148958,{'dbName':_0x565a09,'mode':_0x316b1c,'syncedAt':new Date()[_0x1e0e63(0x13f)](),'description':_0x4748e2[_0x1e0e63(0x164)]}),_0x1a2983=buildSqlLockEntry(_0x4748e2,_0x148958,'',{'dbName':_0x565a09}),_0x93a7fc=resolveLocalSqlFilePath(_0x3d2aa7,_0x4748e2[_0x1e0e63(0x13c)],_0x1a2983);let _0x3cda44=_0x1e0e63(0x133),_0x197b67;if(await fileExists(_0x93a7fc)){const _0x47e4ae=await readFile(_0x93a7fc,'utf8');isEquivalentPulledSqlFile(_0x47e4ae,_0x1ead2c,_0x316b1c)?(_0x3cda44='skipped',_0x197b67=_0x1e0e63(0x144)):(_0x3cda44=_0x1e0e63(0x14c),_0x197b67=_0x1e0e63(0x145));}_0x58a453[_0x1e0e63(0x15d)]({'sqlCode':_0x4748e2['sqlCode'],'sqlName':_0x4748e2[_0x1e0e63(0x149)],'filePath':_0x93a7fc,'status':_0x3cda44,'reason':_0x197b67});}return{'method':_0x1e0e63(0x157),'url':_0x1e0e63(0x136),'body':{'appCode':_0x35ef00[_0x1e0e63(0x16a)],'sqlCode':_0x35ef00[_0x1e0e63(0x152)]('sqlcode')||null,'sqlName':_0x35ef00[_0x1e0e63(0x152)](_0x1e0e63(0x14b))||null,'files':_0x58a453},'description':'Would\x20pull\x20'+_0x58a453[_0x1e0e63(0x13d)]+'\x20SQL\x20file(s)\x20into\x20'+_0x3d2aa7[_0x1e0e63(0x13b)]};},async 'execute'(_0x18572e){const _0x52f280=a160_0x468f71,_0x3c15da=loadSqlProjectConfig(_0x18572e[_0x52f280(0x16a)]),_0x54d4b9=await readSqlLockFile(_0x3c15da[_0x52f280(0x147)]),{lockData:_0x1231d1,appLock:_0x1b6d9a}=ensureSqlLockScope(_0x54d4b9??createEmptySqlLock(),_0x3c15da['appCode'],_0x3c15da[_0x52f280(0x14f)],_0x52f280(0x15c)),_0x21fd6f=_0x18572e['bool'](_0x52f280(0x140)),_0x398712=await fetchAllSqlQueries(_0x18572e[_0x52f280(0x16a)],{'sqlCode':_0x18572e[_0x52f280(0x152)](_0x52f280(0x165))||undefined,'sqlName':_0x18572e[_0x52f280(0x152)](_0x52f280(0x14b))||undefined});if(_0x398712[_0x52f280(0x13d)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20SQL\x20queries\x20matched.'};const _0x47ee01=[],_0xa60b7f=[];for(const _0xf47fc of _0x398712){try{_0x47ee01['push'](await ensureSqlContent(_0xf47fc));}catch(_0x5201fc){_0xa60b7f[_0x52f280(0x15d)]({'sqlCode':_0xf47fc[_0x52f280(0x13c)],'error':_0x5201fc instanceof Error?_0x5201fc['message']:String(_0x5201fc)});}}if(_0x21fd6f&&!_0x18572e[_0x52f280(0x150)]){let _0x5962c1=![];for(const _0xd8b38a of _0x47ee01){const _0x4aba01=detectModeFromSql(_0xd8b38a),_0x5a8af5=_0xd8b38a[_0x52f280(0x138)]?await getDbName(_0x18572e[_0x52f280(0x16a)],Number(_0xd8b38a[_0x52f280(0x138)]))[_0x52f280(0x141)](()=>undefined):undefined,_0x45c32b=buildLocalSqlFileContent({'sqlCode':_0xd8b38a[_0x52f280(0x13c)],'sqlName':_0xd8b38a[_0x52f280(0x149)],'dbId':_0xd8b38a[_0x52f280(0x138)]},ensureRemoteSqlContent(_0xd8b38a),{'dbName':_0x5a8af5,'mode':_0x4aba01,'syncedAt':new Date()[_0x52f280(0x13f)](),'description':_0xd8b38a[_0x52f280(0x164)]}),_0x3bdc23=resolveLocalSqlFilePath(_0x3c15da,_0xd8b38a['sqlCode'],buildSqlLockEntry(_0xd8b38a,ensureRemoteSqlContent(_0xd8b38a),'',{'dbName':_0x5a8af5}));if(await fileExists(_0x3bdc23)){const _0x4101ba=await readFile(_0x3bdc23,_0x52f280(0x131));if(!isEquivalentPulledSqlFile(_0x4101ba,_0x45c32b,_0x4aba01)){_0x5962c1=!![];break;}}}if(_0x5962c1){const _0x323602=await confirmForceOverwrite(_0x52f280(0x162));if(!_0x323602)throw CliErrors[_0x52f280(0x161)](_0x52f280(0x135));}}const _0x179587=cloneSqlLockData(_0x1231d1),_0x49f5d8=_0x179587[_0x52f280(0x16c)][_0x3c15da[_0x52f280(0x16a)]],_0xf63ea9=[],_0x25bcec=[];for(const _0x10d05a of _0x47ee01){const _0x1afc71=_0x49f5d8[_0x52f280(0x166)][_0x10d05a[_0x52f280(0x13c)]],_0x5f41f2=ensureRemoteSqlContent(_0x10d05a),_0x150055=detectModeFromSql(_0x10d05a),_0x162cc6=_0x10d05a[_0x52f280(0x138)]?await getDbName(_0x18572e['appCode'],Number(_0x10d05a['dbId']))[_0x52f280(0x141)](()=>undefined):undefined,_0x2d4529=buildLocalSqlFileContent({'sqlCode':_0x10d05a['sqlCode'],'sqlName':_0x10d05a['sqlName'],'dbId':_0x10d05a[_0x52f280(0x138)]},_0x5f41f2,{'dbName':_0x162cc6,'mode':_0x150055,'syncedAt':new Date()[_0x52f280(0x13f)](),'description':_0x10d05a[_0x52f280(0x164)]}),_0x441a72=buildSqlLockEntry(_0x10d05a,_0x5f41f2,computeSqlContentHash(_0x2d4529),{'dbName':_0x162cc6}),_0x5c7bff=_0x441a72[_0x52f280(0x154)],_0x1f01a6=join(_0x3c15da[_0x52f280(0x13b)],_0x5c7bff);try{if(await fileExists(_0x1f01a6)){const _0x171fa5=await readFile(_0x1f01a6,'utf8');if(isEquivalentPulledSqlFile(_0x171fa5,_0x2d4529,_0x150055)){_0x25bcec[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'reason':'unchanged'}),_0x49f5d8[_0x52f280(0x166)][_0x10d05a['sqlCode']]={..._0x441a72,'hash':computeSqlContentHash(_0x171fa5),'path':_0x5c7bff};continue;}if(!_0x21fd6f){_0x25bcec[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'reason':_0x52f280(0x159)});continue;}}const _0xe9ea77=_0x1afc71?.[_0x52f280(0x154)]?join(_0x3c15da['sqlRootDir'],_0x1afc71[_0x52f280(0x154)]):undefined;_0xe9ea77&&_0xe9ea77!==_0x1f01a6&&await fileExists(_0xe9ea77)&&await rm(_0xe9ea77,{'force':!![]}),await ensureParentDirectory(_0x1f01a6),await writeFile(_0x1f01a6,_0x2d4529,_0x52f280(0x131)),_0x49f5d8[_0x52f280(0x166)][_0x10d05a[_0x52f280(0x13c)]]={..._0x441a72,'path':_0x5c7bff},_0xf63ea9[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'filePath':_0x1f01a6});}catch(_0x7a49f0){_0xa60b7f[_0x52f280(0x15d)]({'sqlCode':_0x10d05a[_0x52f280(0x13c)],'error':_0x7a49f0 instanceof Error?_0x7a49f0[_0x52f280(0x16f)]:String(_0x7a49f0)});}}return _0x49f5d8[_0x52f280(0x130)]=new Date()[_0x52f280(0x13f)](),await writeSqlLockFile(_0x3c15da[_0x52f280(0x147)],_0x179587),{'ok':_0xa60b7f[_0x52f280(0x13d)]===0x0,'data':{'pulled':_0xf63ea9,'skipped':_0x25bcec,'failed':_0xa60b7f},'message':_0x52f280(0x137)+_0xf63ea9[_0x52f280(0x13d)]+_0x52f280(0x15f)+_0x25bcec[_0x52f280(0x13d)]+_0x52f280(0x163)+_0xa60b7f[_0x52f280(0x13d)]+_0x52f280(0x13a)};}};function a160_0x46de(){const _0x475090=['write','message','4000182bPuaoo','lastSync','utf8','33910rYjTvh','would_pull','test','Force\x20pull\x20cancelled.','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Pull\x20complete:\x20','dbId','mybatisXml','\x20failed','sqlRootDir','sqlCode','length','1999749uJQACx','toISOString','force','catch','tableData','Filter\x20by\x20SQL\x20display\x20name','unchanged','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','trimStart','lockFilePath','string','sqlName','Force\x20overwrite\x20local\x20unsynced\x20changes','name','conflict','755rKrsej','360hTgUkR','sqlRoot','nonInteractive','14eCQuWA','str','sql','path','2713580jCVXly','sqlContent','POST','1444bpByhI','local\x20differs\x20from\x20remote','split','234464JyDPOL','pull','push','boolean','\x20written,\x20','replace','cancelled','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','\x20skipped,\x20','description','sqlcode','sqls','paging','totalCount','filter','appCode','1977284zgpUZi','apps','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/'];a160_0x46de=function(){return _0x475090;};return a160_0x46de();}function detectModeFromSql(_0x19d731){const _0x5796a4=a160_0x468f71,_0x54befe=ensureRemoteSqlContent(_0x19d731),_0x2ebd55=stripLocalSqlMetadata(_0x54befe,_0x5796a4(0x139))[_0x5796a4(0x146)]();if(/^<(select|insert|update|delete)\b/i['test'](_0x2ebd55))return'mybatisXml';return _0x5796a4(0x153);}function isEquivalentPulledSqlFile(_0x228ffe,_0x6d7ded,_0x2b5129){return normalizePullComparableContent(_0x228ffe,_0x2b5129)===normalizePullComparableContent(_0x6d7ded,_0x2b5129);}function normalizePullComparableContent(_0x33bad6,_0x58cb5a){const _0x5ecb05=a160_0x468f71,_0x5bf37b=_0x33bad6[_0x5ecb05(0x160)](/\r\n/g,'\x0a')[_0x5ecb05(0x15a)]('\x0a'),_0x35befd=_0x5bf37b[_0x5ecb05(0x169)](_0x371c90=>!isSyncedAtMetadataLine(_0x371c90,_0x58cb5a));return _0x35befd['join']('\x0a');}function isSyncedAtMetadataLine(_0x3f529d,_0xe63565){const _0x50f012=a160_0x468f71;if(_0xe63565===_0x50f012(0x139))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x50f012(0x134)](_0x3f529d);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x3f529d);}
@@ -1 +1 @@
1
- const a161_0x428e6a=a161_0x73b8;(function(_0x292c80,_0x5ead11){const _0x476fc9=a161_0x73b8,_0x4a0ce=_0x292c80();while(!![]){try{const _0x43ad55=parseInt(_0x476fc9(0xe9))/0x1+parseInt(_0x476fc9(0xfc))/0x2+parseInt(_0x476fc9(0xd2))/0x3*(parseInt(_0x476fc9(0xf0))/0x4)+-parseInt(_0x476fc9(0x10c))/0x5+-parseInt(_0x476fc9(0x109))/0x6+parseInt(_0x476fc9(0xd5))/0x7*(parseInt(_0x476fc9(0xf5))/0x8)+-parseInt(_0x476fc9(0xd0))/0x9;if(_0x43ad55===_0x5ead11)break;else _0x4a0ce['push'](_0x4a0ce['shift']());}catch(_0x3e9c15){_0x4a0ce['push'](_0x4a0ce['shift']());}}}(a161_0x397e,0x24acb));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';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(_0x24463a,_0x1f6b57,_0x1e6fff){const _0x1072d0=a161_0x73b8,_0x331005=await scanLocalSqlQueries(_0x24463a),_0x5481c8=new Map();for(const _0x362e86 of _0x331005){if(_0x1e6fff&&_0x362e86[_0x1072d0(0xd1)]!==_0x1e6fff)continue;const _0x494d8d=_0x5481c8[_0x1072d0(0x104)](_0x362e86[_0x1072d0(0xd1)])??[];_0x494d8d[_0x1072d0(0xd8)](_0x362e86),_0x5481c8[_0x1072d0(0x102)](_0x362e86['sqlCode'],_0x494d8d);}if(_0x1e6fff&&!_0x5481c8[_0x1072d0(0xef)](_0x1e6fff))throw CliErrors['validation'](_0x1072d0(0xda)+_0x1e6fff);const _0x6b6de7=[];for(const [_0x34d352,_0x2ed44b]of _0x5481c8['entries']()){if(_0x2ed44b['length']===0x1){_0x6b6de7[_0x1072d0(0xd8)](_0x2ed44b[0x0]);continue;}const _0xa8fe6f=_0x1f6b57[_0x1072d0(0x106)][_0x34d352],_0x585c41=_0xa8fe6f?.[_0x1072d0(0xe6)],_0x45c64e=_0x585c41?_0x2ed44b[_0x1072d0(0xf8)](_0x140e80=>_0x140e80[_0x1072d0(0xf4)]!==_0x585c41):_0x2ed44b;if(_0xa8fe6f&&_0x45c64e['length']===0x1){_0x6b6de7[_0x1072d0(0xd8)](_0x45c64e[0x0]);continue;}throw CliErrors[_0x1072d0(0xe2)](_0x1072d0(0xe8)+_0x34d352+_0x1072d0(0xed));}return _0x6b6de7;}export const sqlPush={'service':'sql','command':a161_0x428e6a(0xd8),'description':a161_0x428e6a(0xfa),'risk':a161_0x428e6a(0xfd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a161_0x428e6a(0xdf),'type':a161_0x428e6a(0xf7),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x401101){const _0x116555=a161_0x428e6a,_0x5e5eb6=loadSqlProjectConfig(_0x401101[_0x116555(0xdc)]),_0x41a3e3=await readSqlLockFile(_0x5e5eb6[_0x116555(0x105)]),{appLock:_0x131822}=ensureSqlLockScope(_0x41a3e3??createEmptySqlLock(),_0x401101[_0x116555(0xdc)],_0x5e5eb6['sqlRoot'],_0x116555(0xd8)),_0x521aca=await getTargetSqlQueries(_0x5e5eb6,_0x131822,_0x401101[_0x116555(0xce)](_0x116555(0xcb))||undefined),_0x15d9f0=[];for(const _0x41558c of _0x521aca){const _0x3e3f7a=await computeSqlFileHash(_0x41558c[_0x116555(0xca)]),_0x5c2489=_0x131822[_0x116555(0x106)][_0x41558c[_0x116555(0xd1)]],_0x2439da=!!_0x5c2489&&(_0x5c2489['path']!==_0x41558c['relativePath']||!!_0x41558c['sqlName']&&_0x5c2489[_0x116555(0xfb)]!==_0x41558c[_0x116555(0xfb)]);if(!_0x401101[_0x116555(0xe1)](_0x116555(0xdf))&&_0x5c2489&&_0x5c2489[_0x116555(0xd7)]===_0x3e3f7a&&!_0x2439da)continue;_0x15d9f0[_0x116555(0xd8)](_0x41558c[_0x116555(0xd1)]);}return{'method':_0x116555(0xd9),'url':_0x116555(0x10a),'body':{'sqlCodes':_0x15d9f0,'appCode':_0x401101['appCode']},'description':_0x116555(0xf9)+_0x15d9f0[_0x116555(0xf3)]+_0x116555(0xcd)};},async 'execute'(_0x3eeaa2){const _0x2706a3=a161_0x428e6a,_0x28d4f8=loadSqlProjectConfig(_0x3eeaa2['appCode']),_0x3d46d8=await readSqlLockFile(_0x28d4f8[_0x2706a3(0x105)]),{lockData:_0x54d934,appLock:_0x326fb4}=ensureSqlLockScope(_0x3d46d8??createEmptySqlLock(),_0x3eeaa2['appCode'],_0x28d4f8[_0x2706a3(0xe0)],_0x2706a3(0xd8)),_0x2146c6=await getTargetSqlQueries(_0x28d4f8,_0x326fb4,_0x3eeaa2['str'](_0x2706a3(0xcb))||undefined);if(_0x2146c6[_0x2706a3(0xf3)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x2706a3(0xd3)};const _0x842a15=[],_0x324146=[],_0x2d6449=[];for(const _0x344291 of _0x2146c6){const _0x229f36=_0x326fb4[_0x2706a3(0x106)][_0x344291['sqlCode']];if(!_0x229f36){_0x2d6449['push']({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x2706a3(0xff)});continue;}try{const _0x46a13e=await computeSqlFileHash(_0x344291[_0x2706a3(0xca)]),_0x45332f=_0x229f36[_0x2706a3(0xe6)]!==_0x344291[_0x2706a3(0xf4)]||!!_0x344291[_0x2706a3(0xfb)]&&_0x229f36[_0x2706a3(0xfb)]!==_0x344291['sqlName'];if(!_0x3eeaa2['bool'](_0x2706a3(0xdf))&&_0x229f36['hash']===_0x46a13e&&!_0x45332f){_0x324146[_0x2706a3(0xd8)]({'sqlCode':_0x344291['sqlCode'],'reason':_0x2706a3(0xee)});continue;}if(_0x229f36[_0x2706a3(0x101)]==null){_0x2d6449[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x2706a3(0x10d)});continue;}const _0x210d17=await readFile(_0x344291[_0x2706a3(0xca)],'utf8'),_0x5911b9=stripLocalSqlMetadata(_0x210d17,_0x344291['mode']),_0x4ac754=_0x344291[_0x2706a3(0xfb)]||_0x229f36[_0x2706a3(0xfb)],_0x41bee2=await resolveTargetDbBinding(_0x3eeaa2[_0x2706a3(0xdc)],_0x344291,_0x229f36),_0x233c3f=await updateSqlQuery({'id':_0x229f36[_0x2706a3(0xd6)],'appCode':_0x3eeaa2['appCode'],'sqlCode':_0x344291[_0x2706a3(0xd1)],'sqlName':_0x4ac754,'dbId':_0x41bee2[_0x2706a3(0xf2)],'version':_0x229f36['version'],'sqlContent':_0x5911b9,'sqlConfig':_0x229f36[_0x2706a3(0x10b)]??undefined}),_0x11ff48=_0x233c3f['dbId']?await getDbName(_0x3eeaa2[_0x2706a3(0xdc)],Number(_0x233c3f['dbId']))[_0x2706a3(0xe7)](()=>_0x41bee2[_0x2706a3(0xfe)]):_0x41bee2[_0x2706a3(0xfe)];_0x326fb4['sqls'][_0x344291['sqlCode']]={...buildSqlLockEntry(_0x233c3f,_0x5911b9,_0x46a13e,{'dbName':_0x11ff48}),'path':_0x344291['relativePath'],'mode':_0x229f36[_0x2706a3(0xde)]},await archivePreviousSqlFileIfNeeded(_0x28d4f8,_0x229f36[_0x2706a3(0xe6)],_0x344291[_0x2706a3(0xf4)]),_0x842a15[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'remoteId':_0x229f36['remoteId']});}catch(_0x4d497c){_0x2d6449[_0x2706a3(0xd8)]({'sqlCode':_0x344291[_0x2706a3(0xd1)],'error':_0x4d497c instanceof Error?_0x4d497c[_0x2706a3(0xeb)]:String(_0x4d497c)});}}return _0x326fb4[_0x2706a3(0x108)]=new Date()[_0x2706a3(0xf6)](),await writeSqlLockFile(_0x28d4f8[_0x2706a3(0x105)],_0x54d934),{'ok':_0x2d6449[_0x2706a3(0xf3)]===0x0,'data':{'pushed':_0x842a15,'skipped':_0x324146,'failed':_0x2d6449},'message':_0x2706a3(0xdb)+_0x842a15[_0x2706a3(0xf3)]+_0x2706a3(0xe5)+_0x324146[_0x2706a3(0xf3)]+_0x2706a3(0xe4)+_0x2d6449[_0x2706a3(0xf3)]+_0x2706a3(0xcf)};}};async function archivePreviousSqlFileIfNeeded(_0xd6882,_0x42b77a,_0x497faa){const _0x58ba52=a161_0x428e6a;if(!_0x42b77a||_0x42b77a===_0x497faa)return;const _0x80f88d=join(_0xd6882[_0x58ba52(0xec)],_0x42b77a);if(!await fileExists(_0x80f88d))return;const _0x23eae6=await moveToTrash(_0xd6882[_0x58ba52(0xdd)],_0xd6882[_0x58ba52(0x103)],_0x80f88d);await cleanupEmptyDirectories(dirname(_0x80f88d),_0xd6882[_0x58ba52(0xec)]),void _0x23eae6;}function a161_0x397e(){const _0xa616c7=['sqlcode','map','\x20SQL\x20file(s)','str','\x20failed','373932NZCAbr','sqlCode','300POxCsJ','No\x20local\x20SQL\x20files\x20found.','\x22\x20for\x20sqlCode\x20','35lwsUNz','remoteId','hash','push','POST','Local\x20SQL\x20not\x20found:\x20','Push\x20complete:\x20','appCode','projectRoot','mode','force','sqlRoot','bool','validation','Local\x20directory\x20\x22','\x20skipped,\x20','\x20pushed,\x20','path','catch','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','291097xIhfdI','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','message','sqlRootDir','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','unchanged','has','4544UXyDJk','exec','dbId','length','relativePath','136ntKMLr','toISOString','boolean','filter','Would\x20push\x20','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlName','48274jmcCOR','high-risk-write','dbName','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','dbDirectory','version','set','trashDir','get','lockFilePath','sqls','isFinite','lastSync','598632YizGAs','/smartapi/custom/updateUserCustomSql','sqlConfig','686900JQgmfG','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','filePath'];a161_0x397e=function(){return _0xa616c7;};return a161_0x397e();}async function moveToTrash(_0x3c450d,_0x73cab1,_0x2f53cc){const _0x4ac236=a161_0x428e6a,_0x3ae4cb=new Date()[_0x4ac236(0xf6)]()['replace'](/[:.]/g,'-'),_0x4cf546=relative(_0x3c450d,_0x2f53cc),_0x2cd00a=join(_0x73cab1,_0x3ae4cb,_0x4cf546);return await mkdir(dirname(_0x2cd00a),{'recursive':!![]}),await rename(_0x2f53cc,_0x2cd00a),_0x2cd00a;}async function cleanupEmptyDirectories(_0x3692be,_0x542ef9){let _0x295b7b=resolve(_0x3692be);const _0x5c835c=resolve(_0x542ef9);while(_0x295b7b['startsWith'](''+_0x5c835c+sep)||_0x295b7b===_0x5c835c){if(_0x295b7b===_0x5c835c)return;try{const _0x8ea353=await readdir(_0x295b7b);if(_0x8ea353['length']>0x0)return;await rmdir(_0x295b7b);}catch{return;}_0x295b7b=dirname(_0x295b7b);}}async function resolveTargetDbBinding(_0x6df8da,_0x3b216a,_0x212407){const _0x5e8b61=a161_0x428e6a,_0x332775=_0x3b216a[_0x5e8b61(0x100)];if(!_0x332775)return{'dbId':_0x212407[_0x5e8b61(0xf2)],'dbName':_0x212407[_0x5e8b61(0xfe)]};const _0x422952=buildDbDirectoryName(_0x212407[_0x5e8b61(0xfe)],_0x212407[_0x5e8b61(0xf2)]);if(_0x332775===_0x422952)return{'dbId':_0x212407[_0x5e8b61(0xf2)],'dbName':_0x212407[_0x5e8b61(0xfe)]};const _0x19f22f=parseExplicitDbDirectory(_0x332775);if(_0x19f22f!=null)return{'dbId':_0x19f22f,'dbName':await getDbName(_0x6df8da,_0x19f22f)['catch'](()=>undefined)};const _0x42517f=await listDatabases(_0x6df8da),_0x4a3cd5=_0x42517f[_0x5e8b61(0xf8)](_0x35e853=>buildDbDirectoryName(_0x35e853['dbName'],_0x35e853[_0x5e8b61(0xf2)])===_0x332775);if(_0x4a3cd5[_0x5e8b61(0xf3)]===0x1)return{'dbId':_0x4a3cd5[0x0][_0x5e8b61(0xf2)],'dbName':_0x4a3cd5[0x0][_0x5e8b61(0xfe)]};if(_0x4a3cd5['length']===0x0)throw CliErrors[_0x5e8b61(0xe2)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x332775+_0x5e8b61(0xd4)+_0x3b216a[_0x5e8b61(0xd1)]+'.');const _0x491fd8=_0x4a3cd5[_0x5e8b61(0xcc)](_0x4b5b0b=>_0x4b5b0b[_0x5e8b61(0xfe)]+'\x20('+_0x4b5b0b[_0x5e8b61(0xf2)]+')')['join'](',\x20');throw CliErrors[_0x5e8b61(0xe2)](_0x5e8b61(0xe3)+_0x332775+_0x5e8b61(0xea)+_0x3b216a[_0x5e8b61(0xd1)]+':\x20'+_0x491fd8);}function a161_0x73b8(_0x5bf747,_0x1395da){_0x5bf747=_0x5bf747-0xca;const _0x397e01=a161_0x397e();let _0x73b8a9=_0x397e01[_0x5bf747];return _0x73b8a9;}function parseExplicitDbDirectory(_0x1d1d48){const _0x357c46=a161_0x428e6a,_0x2e8523=/^db-(\d+)$/[_0x357c46(0xf1)](_0x1d1d48);if(!_0x2e8523)return null;const _0x10741f=Number(_0x2e8523[0x1]);return Number[_0x357c46(0x107)](_0x10741f)&&_0x10741f>0x0?_0x10741f:null;}
1
+ const a161_0x13e976=a161_0x396c;function a161_0x396c(_0x51d1c2,_0x1af4da){_0x51d1c2=_0x51d1c2-0x115;const _0x4eb99e=a161_0x4eb9();let _0x396cfe=_0x4eb99e[_0x51d1c2];return _0x396cfe;}(function(_0x32ec68,_0x401e70){const _0x182304=a161_0x396c,_0x3292ec=_0x32ec68();while(!![]){try{const _0x2ab1c1=-parseInt(_0x182304(0x12e))/0x1+parseInt(_0x182304(0x155))/0x2*(-parseInt(_0x182304(0x115))/0x3)+-parseInt(_0x182304(0x119))/0x4+-parseInt(_0x182304(0x151))/0x5+parseInt(_0x182304(0x134))/0x6+parseInt(_0x182304(0x14e))/0x7+parseInt(_0x182304(0x11b))/0x8;if(_0x2ab1c1===_0x401e70)break;else _0x3292ec['push'](_0x3292ec['shift']());}catch(_0x438454){_0x3292ec['push'](_0x3292ec['shift']());}}}(a161_0x4eb9,0x811a9));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';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(_0x4d2487,_0x30547d,_0x4a2b80){const _0x519dd5=a161_0x396c,_0x3f31c2=await scanLocalSqlQueries(_0x4d2487),_0x306505=new Map();for(const _0x241067 of _0x3f31c2){if(_0x4a2b80&&_0x241067[_0x519dd5(0x140)]!==_0x4a2b80)continue;const _0x2c4b60=_0x306505[_0x519dd5(0x13f)](_0x241067[_0x519dd5(0x140)])??[];_0x2c4b60[_0x519dd5(0x157)](_0x241067),_0x306505[_0x519dd5(0x13b)](_0x241067[_0x519dd5(0x140)],_0x2c4b60);}if(_0x4a2b80&&!_0x306505[_0x519dd5(0x137)](_0x4a2b80))throw CliErrors['validation'](_0x519dd5(0x147)+_0x4a2b80);const _0x811500=[];for(const [_0x506fb5,_0x430315]of _0x306505['entries']()){if(_0x430315[_0x519dd5(0x13e)]===0x1){_0x811500[_0x519dd5(0x157)](_0x430315[0x0]);continue;}const _0x114b3f=_0x30547d[_0x519dd5(0x123)][_0x506fb5],_0x220cfb=_0x114b3f?.[_0x519dd5(0x118)],_0x171f55=_0x220cfb?_0x430315[_0x519dd5(0x13c)](_0x13c6f1=>_0x13c6f1[_0x519dd5(0x142)]!==_0x220cfb):_0x430315;if(_0x114b3f&&_0x171f55['length']===0x1){_0x811500['push'](_0x171f55[0x0]);continue;}throw CliErrors[_0x519dd5(0x122)](_0x519dd5(0x131)+_0x506fb5+_0x519dd5(0x14b));}return _0x811500;}export const sqlPush={'service':a161_0x13e976(0x11c),'command':a161_0x13e976(0x157),'description':a161_0x13e976(0x11f),'risk':a161_0x13e976(0x136),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a161_0x13e976(0x124),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0x7ce4a){const _0x420bed=a161_0x13e976,_0x5ab882=loadSqlProjectConfig(_0x7ce4a[_0x420bed(0x12d)]),_0x3c9e29=await readSqlLockFile(_0x5ab882['lockFilePath']),{appLock:_0x15713e}=ensureSqlLockScope(_0x3c9e29??createEmptySqlLock(),_0x7ce4a[_0x420bed(0x12d)],_0x5ab882[_0x420bed(0x143)],_0x420bed(0x157)),_0x521388=await getTargetSqlQueries(_0x5ab882,_0x15713e,_0x7ce4a[_0x420bed(0x128)](_0x420bed(0x150))||undefined),_0x511fa6=[];for(const _0x42abe0 of _0x521388){const _0x126075=await computeSqlFileHash(_0x42abe0[_0x420bed(0x125)]),_0x4f1abf=_0x15713e[_0x420bed(0x123)][_0x42abe0[_0x420bed(0x140)]],_0x4cd2e7=!!_0x4f1abf&&(_0x4f1abf[_0x420bed(0x118)]!==_0x42abe0[_0x420bed(0x142)]||!!_0x42abe0[_0x420bed(0x120)]&&_0x4f1abf[_0x420bed(0x120)]!==_0x42abe0[_0x420bed(0x120)]);if(!_0x7ce4a[_0x420bed(0x146)](_0x420bed(0x117))&&_0x4f1abf&&_0x4f1abf[_0x420bed(0x133)]===_0x126075&&!_0x4cd2e7)continue;_0x511fa6['push'](_0x42abe0[_0x420bed(0x140)]);}return{'method':_0x420bed(0x11a),'url':_0x420bed(0x11e),'body':{'sqlCodes':_0x511fa6,'appCode':_0x7ce4a['appCode']},'description':_0x420bed(0x138)+_0x511fa6[_0x420bed(0x13e)]+_0x420bed(0x149)};},async 'execute'(_0x3887bd){const _0xe8394d=a161_0x13e976,_0x11a2dc=loadSqlProjectConfig(_0x3887bd[_0xe8394d(0x12d)]),_0x552b78=await readSqlLockFile(_0x11a2dc[_0xe8394d(0x132)]),{lockData:_0x1dcc3f,appLock:_0x329194}=ensureSqlLockScope(_0x552b78??createEmptySqlLock(),_0x3887bd[_0xe8394d(0x12d)],_0x11a2dc[_0xe8394d(0x143)],_0xe8394d(0x157)),_0x232f8e=await getTargetSqlQueries(_0x11a2dc,_0x329194,_0x3887bd[_0xe8394d(0x128)](_0xe8394d(0x150))||undefined);if(_0x232f8e[_0xe8394d(0x13e)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0xe8394d(0x12f)};const _0x5a8bbf=[],_0x223dab=[],_0x4406c3=[];for(const _0x262221 of _0x232f8e){const _0x4a03a1=_0x329194[_0xe8394d(0x123)][_0x262221[_0xe8394d(0x140)]];if(!_0x4a03a1){_0x4406c3['push']({'sqlCode':_0x262221[_0xe8394d(0x140)],'error':_0xe8394d(0x13a)});continue;}try{const _0x180543=await computeSqlFileHash(_0x262221[_0xe8394d(0x125)]),_0x36718a=_0x4a03a1['path']!==_0x262221[_0xe8394d(0x142)]||!!_0x262221['sqlName']&&_0x4a03a1[_0xe8394d(0x120)]!==_0x262221[_0xe8394d(0x120)];if(!_0x3887bd[_0xe8394d(0x146)](_0xe8394d(0x117))&&_0x4a03a1[_0xe8394d(0x133)]===_0x180543&&!_0x36718a){_0x223dab[_0xe8394d(0x157)]({'sqlCode':_0x262221[_0xe8394d(0x140)],'reason':_0xe8394d(0x12c)});continue;}if(_0x4a03a1['version']==null){_0x4406c3[_0xe8394d(0x157)]({'sqlCode':_0x262221['sqlCode'],'error':_0xe8394d(0x12a)});continue;}const _0x5287f0=await readFile(_0x262221[_0xe8394d(0x125)],_0xe8394d(0x129)),_0x2d8b35=stripLocalSqlMetadata(_0x5287f0,_0x262221[_0xe8394d(0x141)]),_0x295199=_0x262221[_0xe8394d(0x120)]||_0x4a03a1['sqlName'],_0x1f888c=await resolveTargetDbBinding(_0x3887bd[_0xe8394d(0x12d)],_0x262221,_0x4a03a1),_0x111247=await updateSqlQuery({'id':_0x4a03a1[_0xe8394d(0x153)],'appCode':_0x3887bd[_0xe8394d(0x12d)],'sqlCode':_0x262221[_0xe8394d(0x140)],'sqlName':_0x295199,'dbId':_0x1f888c['dbId'],'version':_0x4a03a1[_0xe8394d(0x13d)],'sqlContent':_0x2d8b35,'sqlConfig':_0x4a03a1[_0xe8394d(0x152)]??undefined}),_0x573063=_0x111247[_0xe8394d(0x11d)]?await getDbName(_0x3887bd['appCode'],Number(_0x111247[_0xe8394d(0x11d)]))['catch'](()=>_0x1f888c['dbName']):_0x1f888c['dbName'];_0x329194[_0xe8394d(0x123)][_0x262221[_0xe8394d(0x140)]]={...buildSqlLockEntry(_0x111247,_0x2d8b35,_0x180543,{'dbName':_0x573063}),'path':_0x262221['relativePath'],'mode':_0x4a03a1[_0xe8394d(0x141)]},await archivePreviousSqlFileIfNeeded(_0x11a2dc,_0x4a03a1[_0xe8394d(0x118)],_0x262221[_0xe8394d(0x142)]),_0x5a8bbf['push']({'sqlCode':_0x262221['sqlCode'],'remoteId':_0x4a03a1[_0xe8394d(0x153)]});}catch(_0x5ea935){_0x4406c3[_0xe8394d(0x157)]({'sqlCode':_0x262221[_0xe8394d(0x140)],'error':_0x5ea935 instanceof Error?_0x5ea935[_0xe8394d(0x116)]:String(_0x5ea935)});}}return _0x329194[_0xe8394d(0x12b)]=new Date()[_0xe8394d(0x144)](),await writeSqlLockFile(_0x11a2dc[_0xe8394d(0x132)],_0x1dcc3f),{'ok':_0x4406c3['length']===0x0,'data':{'pushed':_0x5a8bbf,'skipped':_0x223dab,'failed':_0x4406c3},'message':_0xe8394d(0x145)+_0x5a8bbf[_0xe8394d(0x13e)]+_0xe8394d(0x135)+_0x223dab[_0xe8394d(0x13e)]+'\x20skipped,\x20'+_0x4406c3[_0xe8394d(0x13e)]+_0xe8394d(0x148)};}};async function archivePreviousSqlFileIfNeeded(_0x4546ef,_0x3f4094,_0x4ea82c){const _0x3078a7=a161_0x13e976;if(!_0x3f4094||_0x3f4094===_0x4ea82c)return;const _0x51ef1c=join(_0x4546ef['sqlRootDir'],_0x3f4094);if(!await fileExists(_0x51ef1c))return;const _0x222822=await moveToTrash(_0x4546ef['projectRoot'],_0x4546ef[_0x3078a7(0x14d)],_0x51ef1c);await cleanupEmptyDirectories(dirname(_0x51ef1c),_0x4546ef[_0x3078a7(0x121)]),void _0x222822;}async function moveToTrash(_0x4f1601,_0x1a8079,_0x5c8a8b){const _0x4700a5=a161_0x13e976,_0x35bc04=new Date()[_0x4700a5(0x144)]()['replace'](/[:.]/g,'-'),_0x2d7bb1=relative(_0x4f1601,_0x5c8a8b),_0x32e020=join(_0x1a8079,_0x35bc04,_0x2d7bb1);return await mkdir(dirname(_0x32e020),{'recursive':!![]}),await rename(_0x5c8a8b,_0x32e020),_0x32e020;}async function cleanupEmptyDirectories(_0x51cd64,_0x282eb4){const _0x583c44=a161_0x13e976;let _0x6759fe=resolve(_0x51cd64);const _0x558385=resolve(_0x282eb4);while(_0x6759fe[_0x583c44(0x139)](''+_0x558385+sep)||_0x6759fe===_0x558385){if(_0x6759fe===_0x558385)return;try{const _0x3ff3d8=await readdir(_0x6759fe);if(_0x3ff3d8['length']>0x0)return;await rmdir(_0x6759fe);}catch{return;}_0x6759fe=dirname(_0x6759fe);}}function a161_0x4eb9(){const _0x14d99f=['catch','str','utf8','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','lastSync','unchanged','appCode','452842uAnIBG','No\x20local\x20SQL\x20files\x20found.','No\x20database\x20matches\x20local\x20directory\x20\x22','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','lockFilePath','hash','5325714Qinfnv','\x20pushed,\x20','high-risk-write','has','Would\x20push\x20','startsWith','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','set','filter','version','length','get','sqlCode','mode','relativePath','sqlRoot','toISOString','Push\x20complete:\x20','bool','Local\x20SQL\x20not\x20found:\x20','\x20failed','\x20SQL\x20file(s)','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','isFinite','trashDir','3248777rzndpo','join','sqlcode','926710QBEDCG','sqlConfig','remoteId','dbName','7526BgzESH','map','push','dbDirectory','699ecGcQX','message','force','path','1789788LZqBPh','POST','9115912XcUUvd','sql','dbId','/smartapi/custom/updateUserCustomSql','Push\x20local\x20SQL\x20files\x20to\x20remote','sqlName','sqlRootDir','validation','sqls','boolean','filePath','exec'];a161_0x4eb9=function(){return _0x14d99f;};return a161_0x4eb9();}async function resolveTargetDbBinding(_0xac1150,_0x47c1b6,_0x4338e2){const _0x57f44e=a161_0x13e976,_0x248220=_0x47c1b6[_0x57f44e(0x158)];if(!_0x248220)return{'dbId':_0x4338e2[_0x57f44e(0x11d)],'dbName':_0x4338e2[_0x57f44e(0x154)]};const _0x30604=buildDbDirectoryName(_0x4338e2[_0x57f44e(0x154)],_0x4338e2['dbId']);if(_0x248220===_0x30604)return{'dbId':_0x4338e2[_0x57f44e(0x11d)],'dbName':_0x4338e2['dbName']};const _0x4de272=parseExplicitDbDirectory(_0x248220);if(_0x4de272!=null)return{'dbId':_0x4de272,'dbName':await getDbName(_0xac1150,_0x4de272)[_0x57f44e(0x127)](()=>undefined)};const _0x1c7342=await listDatabases(_0xac1150),_0xe68b49=_0x1c7342[_0x57f44e(0x13c)](_0x1e24ed=>buildDbDirectoryName(_0x1e24ed[_0x57f44e(0x154)],_0x1e24ed[_0x57f44e(0x11d)])===_0x248220);if(_0xe68b49[_0x57f44e(0x13e)]===0x1)return{'dbId':_0xe68b49[0x0][_0x57f44e(0x11d)],'dbName':_0xe68b49[0x0][_0x57f44e(0x154)]};if(_0xe68b49[_0x57f44e(0x13e)]===0x0)throw CliErrors[_0x57f44e(0x122)](_0x57f44e(0x130)+_0x248220+_0x57f44e(0x14a)+_0x47c1b6['sqlCode']+'.');const _0x17f0c4=_0xe68b49[_0x57f44e(0x156)](_0x17856f=>_0x17856f['dbName']+'\x20('+_0x17856f[_0x57f44e(0x11d)]+')')[_0x57f44e(0x14f)](',\x20');throw CliErrors[_0x57f44e(0x122)]('Local\x20directory\x20\x22'+_0x248220+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x47c1b6[_0x57f44e(0x140)]+':\x20'+_0x17f0c4);}function parseExplicitDbDirectory(_0x31e49f){const _0x4e629c=a161_0x13e976,_0x208261=/^db-(\d+)$/[_0x4e629c(0x126)](_0x31e49f);if(!_0x208261)return null;const _0x2ac872=Number(_0x208261[0x1]);return Number[_0x4e629c(0x14c)](_0x2ac872)&&_0x2ac872>0x0?_0x2ac872:null;}
@@ -1 +1 @@
1
- const a162_0x1cc99b=a162_0x50e4;function a162_0x50e4(_0x3b87f7,_0x23903f){_0x3b87f7=_0x3b87f7-0x159;const _0x146b5e=a162_0x146b();let _0x50e455=_0x146b5e[_0x3b87f7];return _0x50e455;}(function(_0x8bfd2c,_0x3b0c95){const _0x1597d6=a162_0x50e4,_0x3ebbdc=_0x8bfd2c();while(!![]){try{const _0x190b79=-parseInt(_0x1597d6(0x15b))/0x1+-parseInt(_0x1597d6(0x16b))/0x2+parseInt(_0x1597d6(0x15a))/0x3*(-parseInt(_0x1597d6(0x170))/0x4)+-parseInt(_0x1597d6(0x163))/0x5*(parseInt(_0x1597d6(0x16a))/0x6)+parseInt(_0x1597d6(0x171))/0x7*(-parseInt(_0x1597d6(0x164))/0x8)+parseInt(_0x1597d6(0x169))/0x9*(-parseInt(_0x1597d6(0x160))/0xa)+parseInt(_0x1597d6(0x159))/0xb*(parseInt(_0x1597d6(0x168))/0xc);if(_0x190b79===_0x3b0c95)break;else _0x3ebbdc['push'](_0x3ebbdc['shift']());}catch(_0x4371e3){_0x3ebbdc['push'](_0x3ebbdc['shift']());}}}(a162_0x146b,0x5d333));function a162_0x146b(){const _0x3bfbd7=['Query\x20description','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','5PvHkQC','17432yZPuMz','save','write','sqlname','32118444BXPZgc','198wRWJga','689160RfiqyN','732326IktZVe','SQL\x20query\x20display\x20name','file','description','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','4MhKWFV','1673mKDeEs','11sCdgTf','1418394OSxmkX','393498TkDOhB','Path\x20to\x20the\x20SQL\x20file','string','Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','validation','193950CGwhTy'];a162_0x146b=function(){return _0x3bfbd7;};return a162_0x146b();}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a162_0x1cc99b(0x16f),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a162_0x1cc99b(0x15e)]['join']('\x0a');export const sqlSave={'service':'sql','command':a162_0x1cc99b(0x165),'description':'Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','risk':a162_0x1cc99b(0x166),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a162_0x1cc99b(0x16d),'type':a162_0x1cc99b(0x15d),'required':!![],'description':a162_0x1cc99b(0x15c)},SQLCODE_FLAG_OPTIONAL,{'name':a162_0x1cc99b(0x167),'type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x16c)},{'name':'db','type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x162)},{'name':a162_0x1cc99b(0x16e),'type':a162_0x1cc99b(0x15d),'description':a162_0x1cc99b(0x161)}],async 'validate'(){const _0x36f221=a162_0x1cc99b;throw CliErrors[_0x36f221(0x15f)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x3d8237=a162_0x1cc99b;throw CliErrors[_0x3d8237(0x15f)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ const a162_0x27ddac=a162_0x9277;function a162_0x9277(_0x5275d1,_0x3982dd){_0x5275d1=_0x5275d1-0x176;const _0x5d0bb2=a162_0x5d0b();let _0x927701=_0x5d0bb2[_0x5275d1];return _0x927701;}(function(_0x1b4ad5,_0x3a5705){const _0x54c21f=a162_0x9277,_0x18c70e=_0x1b4ad5();while(!![]){try{const _0x14fc9a=-parseInt(_0x54c21f(0x177))/0x1+parseInt(_0x54c21f(0x17f))/0x2*(-parseInt(_0x54c21f(0x184))/0x3)+-parseInt(_0x54c21f(0x176))/0x4+parseInt(_0x54c21f(0x17c))/0x5+-parseInt(_0x54c21f(0x180))/0x6*(parseInt(_0x54c21f(0x179))/0x7)+-parseInt(_0x54c21f(0x188))/0x8+-parseInt(_0x54c21f(0x186))/0x9*(-parseInt(_0x54c21f(0x17e))/0xa);if(_0x14fc9a===_0x3a5705)break;else _0x18c70e['push'](_0x18c70e['shift']());}catch(_0x21c3bd){_0x18c70e['push'](_0x18c70e['shift']());}}}(a162_0x5d0b,0x8edad));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a162_0x27ddac(0x178),a162_0x27ddac(0x17a)][a162_0x27ddac(0x17d)]('\x0a');function a162_0x5d0b(){const _0x51c7c3=['Update\x20existing\x20SQL\x20by\x20editing\x20the\x20synced\x20file\x20under\x20`.rabetbase/sql/<appCode>/<dbName|db-<id>>/`\x20and\x20then\x20running\x20`rabetbase\x20sql\x20push\x20--sqlcode\x20<code>\x20--yes`.','sqlname','2202030pEDPWG','join','300qRBFPS','1147574tvtuKr','6UJozvs','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','string','description','3uqwgan','file','662049RKXXvd','validation','5339208qYAkuB','Path\x20to\x20the\x20SQL\x20file','save','sql','110872FsQLZv','341407IXgLBT','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','3162530NnNoLw'];a162_0x5d0b=function(){return _0x51c7c3;};return a162_0x5d0b();}export const sqlSave={'service':a162_0x27ddac(0x18b),'command':a162_0x27ddac(0x18a),'description':a162_0x27ddac(0x181),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a162_0x27ddac(0x185),'type':a162_0x27ddac(0x182),'required':!![],'description':a162_0x27ddac(0x189)},SQLCODE_FLAG_OPTIONAL,{'name':a162_0x27ddac(0x17b),'type':a162_0x27ddac(0x182),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a162_0x27ddac(0x182),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a162_0x27ddac(0x183),'type':a162_0x27ddac(0x182),'description':'Query\x20description'}],async 'validate'(){const _0x1bc6e7=a162_0x27ddac;throw CliErrors[_0x1bc6e7(0x187)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x15ad7f=a162_0x27ddac;throw CliErrors[_0x15ad7f(0x187)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- function a163_0x50eb(_0x321d59,_0x5a185c){_0x321d59=_0x321d59-0x112;const _0x257636=a163_0x2576();let _0x50eb90=_0x257636[_0x321d59];return _0x50eb90;}const a163_0x203136=a163_0x50eb;(function(_0x124389,_0x3b9d15){const _0x3be6fa=a163_0x50eb,_0x16a37b=_0x124389();while(!![]){try{const _0x2d9ee7=-parseInt(_0x3be6fa(0x13a))/0x1+-parseInt(_0x3be6fa(0x13d))/0x2+-parseInt(_0x3be6fa(0x139))/0x3+-parseInt(_0x3be6fa(0x11a))/0x4+-parseInt(_0x3be6fa(0x12c))/0x5+-parseInt(_0x3be6fa(0x11d))/0x6+parseInt(_0x3be6fa(0x12a))/0x7;if(_0x2d9ee7===_0x3b9d15)break;else _0x16a37b['push'](_0x16a37b['shift']());}catch(_0x3a5cad){_0x16a37b['push'](_0x16a37b['shift']());}}}(a163_0x2576,0x329d8));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';function a163_0x2576(){const _0x2ba35c=['sqlRoot','length','136396UcFnJC','replace','sqlCode','.rabetbase/sql','endsWith','syncedAt','\x20[y/N]\x20','stdin','dbId','222168shCZpA','<!--\x20@lovrabet.','--\x20@lovrabet.','994242shyjXV','sqlConfig','trimStart','trim','split','path','fromEntries','apps','join','version','entries','push','question','7904813Rfgnhx','sqlContent','1936525xYEQoq','\x20-->','yes','test','mode','description','toLowerCase','lastSync','filter','mybatisXml','dbName','map','sqlName','465216CtbZkL','90115gZPmrV'];a163_0x2576=function(){return _0x2ba35c;};return a163_0x2576();}export const SQL_LOCAL_REL_DIR=a163_0x203136(0x114);export function buildSqlLockEntry(_0x422d56,_0x228481,_0x274a11,_0x3c45d4){const _0x1d0fcc=a163_0x203136,_0xee4afc=detectSqlMode(_0x228481);return{'path':buildSqlRelativePath(_0x422d56[_0x1d0fcc(0x113)],_0x422d56[_0x1d0fcc(0x138)],_0x3c45d4?.['dbName'],_0xee4afc,_0x422d56['dbId']),'hash':_0x274a11,'remoteId':_0x422d56['id'],'version':_0x422d56[_0x1d0fcc(0x126)],'dbId':Number(_0x422d56['dbId']),'dbName':_0x3c45d4?.[_0x1d0fcc(0x136)],'sqlName':_0x422d56[_0x1d0fcc(0x138)],'sqlConfig':_0x422d56[_0x1d0fcc(0x11e)]??undefined,'mode':_0xee4afc};}export function cloneSqlLockData(_0x45b6b){const _0x39ae76=a163_0x203136;return{'apps':Object[_0x39ae76(0x123)](Object[_0x39ae76(0x127)](_0x45b6b[_0x39ae76(0x124)])[_0x39ae76(0x137)](([_0x3cf06f,_0xfcd67])=>[_0x3cf06f,{'sqlRoot':_0xfcd67[_0x39ae76(0x13b)],'lastSync':_0xfcd67[_0x39ae76(0x133)],'sqls':{..._0xfcd67['sqls']}}]))};}export function ensureRemoteSqlContent(_0x1e7c24){const _0x234026=a163_0x203136;return _0x1e7c24[_0x234026(0x12b)]??'';}export function buildLocalSqlFileContent(_0x3ae017,_0x138a31,_0x5dde61){const _0x2ff207=a163_0x203136,_0x34ff17=_0x5dde61?.[_0x2ff207(0x130)]??detectSqlMode(_0x138a31),_0x1907aa=stripLocalSqlMetadata(_0x138a31,_0x34ff17)[_0x2ff207(0x120)](),_0x2d7cea=[...buildMetadataHeaderLines({'sqlCode':_0x3ae017[_0x2ff207(0x113)],'sqlName':_0x3ae017[_0x2ff207(0x138)],'dbId':_0x3ae017[_0x2ff207(0x119)],'dbName':_0x5dde61?.[_0x2ff207(0x136)],'mode':_0x34ff17,'syncedAt':_0x5dde61?.[_0x2ff207(0x116)],'description':_0x5dde61?.[_0x2ff207(0x131)]},_0x34ff17),'',_0x1907aa],_0x1eaf62=_0x2d7cea[_0x2ff207(0x125)]('\x0a');return _0x1eaf62[_0x2ff207(0x115)]('\x0a')?_0x1eaf62:_0x1eaf62+'\x0a';}export function stripLocalSqlMetadata(_0x3b9b4e,_0x1d3a31){const _0x4c6b67=a163_0x203136,_0x1b47a0=_0x3b9b4e[_0x4c6b67(0x112)](/\r\n/g,'\x0a')[_0x4c6b67(0x121)]('\x0a'),_0x20e2f7=[];let _0x226636=0x0;if(_0x1d3a31===_0x4c6b67(0x135))while(_0x226636<_0x1b47a0[_0x4c6b67(0x13c)]){const _0x2e7f2e=_0x1b47a0[_0x226636]??'';if(/^\s*<!--\s*@lovrabet\./[_0x4c6b67(0x12f)](_0x2e7f2e)){_0x226636++;continue;}if(_0x2e7f2e[_0x4c6b67(0x120)]()===''&&_0x226636>0x0){_0x226636++;continue;}break;}else while(_0x226636<_0x1b47a0['length']){const _0x1c1371=_0x1b47a0[_0x226636]??'';if(/^\s*--\s*@lovrabet\./[_0x4c6b67(0x12f)](_0x1c1371)){_0x226636++;continue;}if(_0x1c1371[_0x4c6b67(0x120)]()===''&&_0x226636>0x0){_0x226636++;continue;}break;}for(;_0x226636<_0x1b47a0[_0x4c6b67(0x13c)];_0x226636++){_0x20e2f7[_0x4c6b67(0x128)](_0x1b47a0[_0x226636]);}return _0x20e2f7[_0x4c6b67(0x125)]('\x0a')[_0x4c6b67(0x11f)]();}export function resolveSqlMode(_0x4be4c3,_0x35384a){const _0x454186=a163_0x203136;if(_0x35384a?.[_0x454186(0x130)])return _0x35384a[_0x454186(0x130)];return detectSqlMode(_0x4be4c3);}export function resolveSqlFileName(_0x365752,_0x1aa543,_0x6b5843){const _0x3261d3=a163_0x203136;if(_0x6b5843?.[_0x3261d3(0x122)])return _0x6b5843['path'];if(_0x6b5843?.[_0x3261d3(0x138)]||_0x6b5843?.['dbName'])return buildSqlRelativePath(_0x365752,_0x6b5843?.[_0x3261d3(0x138)],_0x6b5843?.['dbName'],resolveSqlMode(_0x1aa543,_0x6b5843),_0x6b5843?.['dbId']);return buildDefaultSqlFileName(_0x365752,resolveSqlMode(_0x1aa543,_0x6b5843));}export function resolveSqlLocalDir(_0x1257c9,_0x1cd085){return join(_0x1257c9,SQL_LOCAL_REL_DIR,_0x1cd085);}export async function confirmForceOverwrite(_0x5a3fa1){const _0x1db166=a163_0x203136,_0x545760=createInterface({'input':process[_0x1db166(0x118)],'output':process['stderr']}),_0x1afb04=await new Promise(_0x4a92b2=>{const _0x1c8a5c=_0x1db166;_0x545760[_0x1c8a5c(0x129)](_0x5a3fa1+_0x1c8a5c(0x117),_0x4a92b2);});return _0x545760['close'](),['y',_0x1db166(0x12e)]['includes'](_0x1afb04[_0x1db166(0x120)]()[_0x1db166(0x132)]());}export function findSqlLockScope(_0x4e22ea,_0x482f13){const _0xf4734d=a163_0x203136;return _0x4e22ea[_0xf4734d(0x124)][_0x482f13];}function buildMetadataHeaderLines(_0x52634c,_0x89b6f0){const _0x3778c4=a163_0x203136,_0x5d9453=[['sqlCode',_0x52634c[_0x3778c4(0x113)]],[_0x3778c4(0x138),_0x52634c[_0x3778c4(0x138)]],[_0x3778c4(0x119),_0x52634c[_0x3778c4(0x119)]],[_0x3778c4(0x136),_0x52634c[_0x3778c4(0x136)]],[_0x3778c4(0x130),_0x52634c['mode']],['syncedAt',_0x52634c['syncedAt']],[_0x3778c4(0x131),_0x52634c[_0x3778c4(0x131)]]];if(_0x89b6f0===_0x3778c4(0x135))return _0x5d9453[_0x3778c4(0x134)](([,_0x4b4c5d])=>_0x4b4c5d!==undefined&&_0x4b4c5d!==null&&String(_0x4b4c5d)[_0x3778c4(0x120)]()!=='')[_0x3778c4(0x137)](([_0x3aaae2,_0x2d3efd])=>_0x3778c4(0x11b)+_0x3aaae2+':\x20'+String(_0x2d3efd)+_0x3778c4(0x12d));return _0x5d9453[_0x3778c4(0x134)](([,_0x4cb151])=>_0x4cb151!==undefined&&_0x4cb151!==null&&String(_0x4cb151)['trim']()!=='')['map'](([_0x3bdff0,_0x55876b])=>_0x3778c4(0x11c)+_0x3bdff0+':\x20'+String(_0x55876b));}
1
+ const a163_0x37e93d=a163_0x3d83;(function(_0x37d41e,_0x42544c){const _0x3774b1=a163_0x3d83,_0x5b4687=_0x37d41e();while(!![]){try{const _0x411ab6=parseInt(_0x3774b1(0x1cf))/0x1*(-parseInt(_0x3774b1(0x1e3))/0x2)+-parseInt(_0x3774b1(0x1e2))/0x3+-parseInt(_0x3774b1(0x1c4))/0x4+-parseInt(_0x3774b1(0x1ea))/0x5*(-parseInt(_0x3774b1(0x1dc))/0x6)+-parseInt(_0x3774b1(0x1d8))/0x7+parseInt(_0x3774b1(0x1df))/0x8*(-parseInt(_0x3774b1(0x1c6))/0x9)+-parseInt(_0x3774b1(0x1d6))/0xa*(-parseInt(_0x3774b1(0x1d0))/0xb);if(_0x411ab6===_0x42544c)break;else _0x5b4687['push'](_0x5b4687['shift']());}catch(_0x4cfecd){_0x5b4687['push'](_0x5b4687['shift']());}}}(a163_0x1963,0xb67b4));import{createInterface}from'node:readline';function a163_0x1963(){const _0x5b609e=['1033080JeFdaf','toLowerCase','sqlName','1887591FMbYGA','710FdRRAV','syncedAt','stderr','yes','entries','lastSync','dbId','5IsjtvS','sqlRoot','endsWith','mode','trimStart','2218724zFDbEc','question','81ZHVEPz','\x20-->','map','fromEntries','sqlConfig','sqlContent','--\x20@lovrabet.','description','length','2381ARanRf','11SyJOmF','.rabetbase/sql','\x20[y/N]\x20','push','filter','<!--\x20@lovrabet.','37759900ShYTnY','sqlCode','2383101ImFlEX','join','test','dbName','3019470gVzaBo','trim','apps'];a163_0x1963=function(){return _0x5b609e;};return a163_0x1963();}import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a163_0x37e93d(0x1d1);function a163_0x3d83(_0x5a1a71,_0x3b0c65){_0x5a1a71=_0x5a1a71-0x1c0;const _0x1963a0=a163_0x1963();let _0x3d833c=_0x1963a0[_0x5a1a71];return _0x3d833c;}export function buildSqlLockEntry(_0x2aafba,_0x35e382,_0xed269f,_0x5d88fd){const _0x232ab0=a163_0x37e93d,_0x2ef2ca=detectSqlMode(_0x35e382);return{'path':buildSqlRelativePath(_0x2aafba[_0x232ab0(0x1d7)],_0x2aafba[_0x232ab0(0x1e1)],_0x5d88fd?.[_0x232ab0(0x1db)],_0x2ef2ca,_0x2aafba[_0x232ab0(0x1e9)]),'hash':_0xed269f,'remoteId':_0x2aafba['id'],'version':_0x2aafba['version'],'dbId':Number(_0x2aafba[_0x232ab0(0x1e9)]),'dbName':_0x5d88fd?.['dbName'],'sqlName':_0x2aafba[_0x232ab0(0x1e1)],'sqlConfig':_0x2aafba[_0x232ab0(0x1ca)]??undefined,'mode':_0x2ef2ca};}export function cloneSqlLockData(_0x61d583){const _0x534c90=a163_0x37e93d;return{'apps':Object[_0x534c90(0x1c9)](Object[_0x534c90(0x1e7)](_0x61d583[_0x534c90(0x1de)])[_0x534c90(0x1c8)](([_0xe55046,_0x5ed09d])=>[_0xe55046,{'sqlRoot':_0x5ed09d[_0x534c90(0x1c0)],'lastSync':_0x5ed09d[_0x534c90(0x1e8)],'sqls':{..._0x5ed09d['sqls']}}]))};}export function ensureRemoteSqlContent(_0x4e1953){const _0x112658=a163_0x37e93d;return _0x4e1953[_0x112658(0x1cb)]??'';}export function buildLocalSqlFileContent(_0x16e422,_0x4f3fa9,_0x51f9b0){const _0x362710=a163_0x37e93d,_0x4c649c=_0x51f9b0?.[_0x362710(0x1c2)]??detectSqlMode(_0x4f3fa9),_0x13d198=stripLocalSqlMetadata(_0x4f3fa9,_0x4c649c)[_0x362710(0x1dd)](),_0x30d4b1=[...buildMetadataHeaderLines({'sqlCode':_0x16e422['sqlCode'],'sqlName':_0x16e422[_0x362710(0x1e1)],'dbId':_0x16e422[_0x362710(0x1e9)],'dbName':_0x51f9b0?.['dbName'],'mode':_0x4c649c,'syncedAt':_0x51f9b0?.[_0x362710(0x1e4)],'description':_0x51f9b0?.[_0x362710(0x1cd)]},_0x4c649c),'',_0x13d198],_0x1f9c2a=_0x30d4b1[_0x362710(0x1d9)]('\x0a');return _0x1f9c2a[_0x362710(0x1c1)]('\x0a')?_0x1f9c2a:_0x1f9c2a+'\x0a';}export function stripLocalSqlMetadata(_0x4b8f1b,_0x57992c){const _0x42ae57=a163_0x37e93d,_0x707214=_0x4b8f1b['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x825bc=[];let _0x248797=0x0;if(_0x57992c==='mybatisXml')while(_0x248797<_0x707214['length']){const _0x3703d2=_0x707214[_0x248797]??'';if(/^\s*<!--\s*@lovrabet\./[_0x42ae57(0x1da)](_0x3703d2)){_0x248797++;continue;}if(_0x3703d2['trim']()===''&&_0x248797>0x0){_0x248797++;continue;}break;}else while(_0x248797<_0x707214[_0x42ae57(0x1ce)]){const _0x30083a=_0x707214[_0x248797]??'';if(/^\s*--\s*@lovrabet\./[_0x42ae57(0x1da)](_0x30083a)){_0x248797++;continue;}if(_0x30083a[_0x42ae57(0x1dd)]()===''&&_0x248797>0x0){_0x248797++;continue;}break;}for(;_0x248797<_0x707214[_0x42ae57(0x1ce)];_0x248797++){_0x825bc[_0x42ae57(0x1d3)](_0x707214[_0x248797]);}return _0x825bc[_0x42ae57(0x1d9)]('\x0a')[_0x42ae57(0x1c3)]();}export function resolveSqlMode(_0x4b6a7b,_0x28c096){const _0x1f2481=a163_0x37e93d;if(_0x28c096?.[_0x1f2481(0x1c2)])return _0x28c096[_0x1f2481(0x1c2)];return detectSqlMode(_0x4b6a7b);}export function resolveSqlFileName(_0x250987,_0x373128,_0x596f45){const _0x405a77=a163_0x37e93d;if(_0x596f45?.['path'])return _0x596f45['path'];if(_0x596f45?.[_0x405a77(0x1e1)]||_0x596f45?.[_0x405a77(0x1db)])return buildSqlRelativePath(_0x250987,_0x596f45?.['sqlName'],_0x596f45?.[_0x405a77(0x1db)],resolveSqlMode(_0x373128,_0x596f45),_0x596f45?.[_0x405a77(0x1e9)]);return buildDefaultSqlFileName(_0x250987,resolveSqlMode(_0x373128,_0x596f45));}export function resolveSqlLocalDir(_0x3ee810,_0x56b4ab){return join(_0x3ee810,SQL_LOCAL_REL_DIR,_0x56b4ab);}export async function confirmForceOverwrite(_0x1d85a3){const _0x4efb4e=a163_0x37e93d,_0x455b23=createInterface({'input':process['stdin'],'output':process[_0x4efb4e(0x1e5)]}),_0x313a5e=await new Promise(_0x315b4e=>{const _0x13be39=_0x4efb4e;_0x455b23[_0x13be39(0x1c5)](_0x1d85a3+_0x13be39(0x1d2),_0x315b4e);});return _0x455b23['close'](),['y',_0x4efb4e(0x1e6)]['includes'](_0x313a5e[_0x4efb4e(0x1dd)]()[_0x4efb4e(0x1e0)]());}export function findSqlLockScope(_0xbd5218,_0x2e8c76){const _0x36ef12=a163_0x37e93d;return _0xbd5218[_0x36ef12(0x1de)][_0x2e8c76];}function buildMetadataHeaderLines(_0x528cc6,_0x54a2c5){const _0x448277=a163_0x37e93d,_0x5e9445=[[_0x448277(0x1d7),_0x528cc6[_0x448277(0x1d7)]],[_0x448277(0x1e1),_0x528cc6['sqlName']],[_0x448277(0x1e9),_0x528cc6[_0x448277(0x1e9)]],[_0x448277(0x1db),_0x528cc6[_0x448277(0x1db)]],[_0x448277(0x1c2),_0x528cc6[_0x448277(0x1c2)]],[_0x448277(0x1e4),_0x528cc6['syncedAt']],[_0x448277(0x1cd),_0x528cc6['description']]];if(_0x54a2c5==='mybatisXml')return _0x5e9445[_0x448277(0x1d4)](([,_0x2548eb])=>_0x2548eb!==undefined&&_0x2548eb!==null&&String(_0x2548eb)['trim']()!=='')[_0x448277(0x1c8)](([_0x3dc3f6,_0x59f00b])=>_0x448277(0x1d5)+_0x3dc3f6+':\x20'+String(_0x59f00b)+_0x448277(0x1c7));return _0x5e9445['filter'](([,_0x1a16cf])=>_0x1a16cf!==undefined&&_0x1a16cf!==null&&String(_0x1a16cf)[_0x448277(0x1dd)]()!=='')[_0x448277(0x1c8)](([_0x5d189e,_0x2ef62f])=>_0x448277(0x1cc)+_0x5d189e+':\x20'+String(_0x2ef62f));}
@@ -1 +1 @@
1
- const a164_0x477883=a164_0x26e6;(function(_0x478a63,_0x32891c){const _0x4a2d01=a164_0x26e6,_0x2baae4=_0x478a63();while(!![]){try{const _0x35c045=parseInt(_0x4a2d01(0x144))/0x1+-parseInt(_0x4a2d01(0x156))/0x2+parseInt(_0x4a2d01(0x13e))/0x3+parseInt(_0x4a2d01(0x149))/0x4*(parseInt(_0x4a2d01(0x162))/0x5)+-parseInt(_0x4a2d01(0x153))/0x6+-parseInt(_0x4a2d01(0x13d))/0x7+parseInt(_0x4a2d01(0x15d))/0x8;if(_0x35c045===_0x32891c)break;else _0x2baae4['push'](_0x2baae4['shift']());}catch(_0x44b7e8){_0x2baae4['push'](_0x2baae4['shift']());}}}(a164_0x5c83,0x8b9a4));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a164_0x26e6(_0x349768,_0x26290f){_0x349768=_0x349768-0x13d;const _0x5c8337=a164_0x5c83();let _0x26e6a0=_0x5c8337[_0x349768];return _0x26e6a0;}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 a164_0x5c83(){const _0x31f69a=['appCode','paging','totalCount','\x20added,\x20','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','4689696AfKQQl','tableData','sqls','344752hFXUwd','sqlName','\x20missing,\x20','map','keys','\x20remote-only','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','6905744tSieKi','bool','has','relativePath','push','288055GstroF','7102578LwUvYj','921054aVOlWD','lockKey','status','All\x20SQL\x20queries\x20are\x20in\x20sync.','length','read','736501qEwlyh','path','filePath','remote','sqlRoot','44QYQlpk','hash','\x20unchanged','lockFilePath','sqlCode'];a164_0x5c83=function(){return _0x31f69a;};return a164_0x5c83();}async function fetchAllSqlCodes(_0x4ce17b){const _0x5c1f71=a164_0x26e6,_0x1d94dd=[];let _0x5c5358=0x1;while(!![]){const _0x2cdbdd=await listSqlQueries(_0x4ce17b,{'currentPage':_0x5c5358,'pageSize':PAGE_SIZE}),_0x3f88a8=_0x2cdbdd[_0x5c1f71(0x154)]??[];_0x1d94dd['push'](..._0x3f88a8[_0x5c1f71(0x159)](_0x2aa6bb=>_0x2aa6bb[_0x5c1f71(0x14d)]));if(_0x3f88a8[_0x5c1f71(0x142)]===0x0)break;const _0x530158=_0x2cdbdd[_0x5c1f71(0x14f)]?.[_0x5c1f71(0x150)];if(_0x530158!=null?_0x1d94dd[_0x5c1f71(0x142)]>=_0x530158:_0x3f88a8[_0x5c1f71(0x142)]<PAGE_SIZE)break;_0x5c5358++;}return _0x1d94dd;}export const sqlStatus={'service':'sql','command':'status','description':a164_0x477883(0x15c),'risk':a164_0x477883(0x143),'flags':[{'name':a164_0x477883(0x147),'type':'boolean','description':a164_0x477883(0x152)}],async 'execute'(_0x131431){const _0x576db9=a164_0x477883,_0x9beabb=loadSqlProjectConfig(_0x131431['appCode']),_0x2d2c0f=await readSqlLockFile(_0x9beabb[_0x576db9(0x14c)]),{appLock:_0x3abd3a}=ensureSqlLockScope(_0x2d2c0f??createEmptySqlLock(),_0x9beabb['appCode'],_0x9beabb[_0x576db9(0x148)],_0x576db9(0x140)),_0x5e5748=await scanLocalSqlQueries(_0x9beabb),_0x25881a=[],_0x32b3b0=[],_0x357fdd=[],_0x5507e4=[],_0x520045=new Set(_0x5e5748[_0x576db9(0x159)](_0x353f64=>_0x353f64[_0x576db9(0x13f)]));for(const _0x276af3 of _0x5e5748){const _0x50eb63=await computeSqlFileHash(_0x276af3[_0x576db9(0x146)]),_0x20d944=_0x3abd3a[_0x576db9(0x155)][_0x276af3[_0x576db9(0x13f)]],_0x457a59=!!_0x20d944&&_0x20d944[_0x576db9(0x145)]!==_0x276af3[_0x576db9(0x160)],_0x192cf0=!!_0x20d944&&!!_0x276af3[_0x576db9(0x157)]&&_0x20d944[_0x576db9(0x157)]!==_0x276af3[_0x576db9(0x157)];if(!_0x20d944)_0x25881a[_0x576db9(0x161)](_0x276af3[_0x576db9(0x13f)]);else _0x20d944[_0x576db9(0x14a)]!==_0x50eb63||_0x457a59||_0x192cf0?_0x32b3b0[_0x576db9(0x161)](_0x276af3[_0x576db9(0x13f)]):_0x357fdd[_0x576db9(0x161)](_0x276af3['lockKey']);}for(const _0xf49cb9 of Object[_0x576db9(0x15a)](_0x3abd3a[_0x576db9(0x155)])){!_0x520045[_0x576db9(0x15f)](_0xf49cb9)&&_0x5507e4[_0x576db9(0x161)](_0xf49cb9);}const _0x27d666=[];if(_0x131431[_0x576db9(0x15e)]('remote')){const _0x1102bc=await fetchAllSqlCodes(_0x131431[_0x576db9(0x14e)]);for(const _0x4ca1a4 of _0x1102bc){!_0x520045[_0x576db9(0x15f)](_0x4ca1a4)&&!_0x3abd3a[_0x576db9(0x155)][_0x4ca1a4]&&_0x27d666['push'](_0x4ca1a4);}}const _0x1d5569=_0x25881a[_0x576db9(0x142)]===0x0&&_0x32b3b0[_0x576db9(0x142)]===0x0&&_0x5507e4['length']===0x0&&_0x27d666[_0x576db9(0x142)]===0x0;return{'ok':!![],'data':{'added':_0x25881a,'modified':_0x32b3b0,'missing':_0x5507e4,'unchanged':_0x357fdd,'remoteOnly':_0x27d666},'message':_0x1d5569?_0x576db9(0x141):_0x25881a[_0x576db9(0x142)]+_0x576db9(0x151)+_0x32b3b0[_0x576db9(0x142)]+'\x20modified,\x20'+_0x5507e4[_0x576db9(0x142)]+_0x576db9(0x158)+_0x357fdd[_0x576db9(0x142)]+_0x576db9(0x14b)+(_0x27d666[_0x576db9(0x142)]>0x0?',\x20'+_0x27d666['length']+_0x576db9(0x15b):'')};}};
1
+ const a164_0x30a0cd=a164_0x1866;(function(_0x2c39a4,_0x37faa4){const _0x1d3902=a164_0x1866,_0x771428=_0x2c39a4();while(!![]){try{const _0x16691b=parseInt(_0x1d3902(0x9b))/0x1+-parseInt(_0x1d3902(0x95))/0x2*(parseInt(_0x1d3902(0x7f))/0x3)+-parseInt(_0x1d3902(0x88))/0x4+-parseInt(_0x1d3902(0x9d))/0x5+parseInt(_0x1d3902(0x94))/0x6*(-parseInt(_0x1d3902(0x9c))/0x7)+-parseInt(_0x1d3902(0x92))/0x8+parseInt(_0x1d3902(0x89))/0x9;if(_0x16691b===_0x37faa4)break;else _0x771428['push'](_0x771428['shift']());}catch(_0x394353){_0x771428['push'](_0x771428['shift']());}}}(a164_0x4583,0x9827a));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';function a164_0x1866(_0x931e96,_0x1d173e){_0x931e96=_0x931e96-0x7d;const _0x4583ff=a164_0x4583();let _0x1866a6=_0x4583ff[_0x931e96];return _0x1866a6;}const PAGE_SIZE=0x64;function a164_0x4583(){const _0x498cd5=['8855288UrQkhz','totalCount','105654iezlhE','13926OTYraO','remote','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','has','push','All\x20SQL\x20queries\x20are\x20in\x20sync.','107087dWrVDC','161oxekdy','5525145nUxVqu','map','sqlName','\x20added,\x20','18HPNahx','read','bool','filePath','status','path','sqls','sqlCode','paging','3460456mMRHYU','36359802zXkYxU','keys','length','appCode','boolean','\x20missing,\x20','lockKey','\x20modified,\x20','\x20remote-only'];a164_0x4583=function(){return _0x498cd5;};return a164_0x4583();}async function fetchAllSqlCodes(_0x399199){const _0x568304=a164_0x1866,_0x664acd=[];let _0x19da7e=0x1;while(!![]){const _0x2d1616=await listSqlQueries(_0x399199,{'currentPage':_0x19da7e,'pageSize':PAGE_SIZE}),_0x324b78=_0x2d1616['tableData']??[];_0x664acd['push'](..._0x324b78[_0x568304(0x9e)](_0x4acfb3=>_0x4acfb3[_0x568304(0x86)]));if(_0x324b78[_0x568304(0x8b)]===0x0)break;const _0x174487=_0x2d1616[_0x568304(0x87)]?.[_0x568304(0x93)];if(_0x174487!=null?_0x664acd[_0x568304(0x8b)]>=_0x174487:_0x324b78[_0x568304(0x8b)]<PAGE_SIZE)break;_0x19da7e++;}return _0x664acd;}export const sqlStatus={'service':'sql','command':a164_0x30a0cd(0x83),'description':a164_0x30a0cd(0x97),'risk':a164_0x30a0cd(0x80),'flags':[{'name':a164_0x30a0cd(0x96),'type':a164_0x30a0cd(0x8d),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x292f26){const _0x23df05=a164_0x30a0cd,_0x4ca636=loadSqlProjectConfig(_0x292f26[_0x23df05(0x8c)]),_0x270b1c=await readSqlLockFile(_0x4ca636['lockFilePath']),{appLock:_0x2bf102}=ensureSqlLockScope(_0x270b1c??createEmptySqlLock(),_0x4ca636[_0x23df05(0x8c)],_0x4ca636['sqlRoot'],_0x23df05(0x83)),_0x3705e0=await scanLocalSqlQueries(_0x4ca636),_0x4347fb=[],_0x14e48a=[],_0x5d6b95=[],_0x39da5d=[],_0x541053=new Set(_0x3705e0[_0x23df05(0x9e)](_0x3dad84=>_0x3dad84[_0x23df05(0x8f)]));for(const _0x437b1f of _0x3705e0){const _0x3ea90a=await computeSqlFileHash(_0x437b1f[_0x23df05(0x82)]),_0x4049f5=_0x2bf102[_0x23df05(0x85)][_0x437b1f[_0x23df05(0x8f)]],_0x44ee79=!!_0x4049f5&&_0x4049f5[_0x23df05(0x84)]!==_0x437b1f['relativePath'],_0x5c27c9=!!_0x4049f5&&!!_0x437b1f[_0x23df05(0x7d)]&&_0x4049f5[_0x23df05(0x7d)]!==_0x437b1f[_0x23df05(0x7d)];if(!_0x4049f5)_0x4347fb['push'](_0x437b1f['lockKey']);else _0x4049f5['hash']!==_0x3ea90a||_0x44ee79||_0x5c27c9?_0x14e48a['push'](_0x437b1f[_0x23df05(0x8f)]):_0x5d6b95[_0x23df05(0x99)](_0x437b1f['lockKey']);}for(const _0x36994e of Object[_0x23df05(0x8a)](_0x2bf102[_0x23df05(0x85)])){!_0x541053[_0x23df05(0x98)](_0x36994e)&&_0x39da5d[_0x23df05(0x99)](_0x36994e);}const _0x4d9f57=[];if(_0x292f26[_0x23df05(0x81)]('remote')){const _0xec20c1=await fetchAllSqlCodes(_0x292f26[_0x23df05(0x8c)]);for(const _0x2ab822 of _0xec20c1){!_0x541053['has'](_0x2ab822)&&!_0x2bf102[_0x23df05(0x85)][_0x2ab822]&&_0x4d9f57[_0x23df05(0x99)](_0x2ab822);}}const _0x246402=_0x4347fb['length']===0x0&&_0x14e48a['length']===0x0&&_0x39da5d[_0x23df05(0x8b)]===0x0&&_0x4d9f57[_0x23df05(0x8b)]===0x0;return{'ok':!![],'data':{'added':_0x4347fb,'modified':_0x14e48a,'missing':_0x39da5d,'unchanged':_0x5d6b95,'remoteOnly':_0x4d9f57},'message':_0x246402?_0x23df05(0x9a):_0x4347fb['length']+_0x23df05(0x7e)+_0x14e48a[_0x23df05(0x8b)]+_0x23df05(0x90)+_0x39da5d[_0x23df05(0x8b)]+_0x23df05(0x8e)+_0x5d6b95[_0x23df05(0x8b)]+'\x20unchanged'+(_0x4d9f57[_0x23df05(0x8b)]>0x0?',\x20'+_0x4d9f57[_0x23df05(0x8b)]+_0x23df05(0x91):'')};}};
@@ -1 +1 @@
1
- const a165_0x247fa5=a165_0x13c0;function a165_0x13c0(_0x235d74,_0x177eef){_0x235d74=_0x235d74-0x1c1;const _0x562b9a=a165_0x562b();let _0x13c059=_0x562b9a[_0x235d74];return _0x13c059;}(function(_0x530adf,_0x185f05){const _0x241537=a165_0x13c0,_0x47d029=_0x530adf();while(!![]){try{const _0x2d9f22=parseInt(_0x241537(0x1e9))/0x1*(-parseInt(_0x241537(0x1c5))/0x2)+-parseInt(_0x241537(0x1cb))/0x3+-parseInt(_0x241537(0x1d1))/0x4+parseInt(_0x241537(0x1d6))/0x5*(parseInt(_0x241537(0x1e2))/0x6)+parseInt(_0x241537(0x1db))/0x7+parseInt(_0x241537(0x1eb))/0x8+-parseInt(_0x241537(0x1d4))/0x9;if(_0x2d9f22===_0x185f05)break;else _0x47d029['push'](_0x47d029['shift']());}catch(_0x247a48){_0x47d029['push'](_0x47d029['shift']());}}}(a165_0x562b,0x62020));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a165_0x562b(){const _0x39e472=['sql','SQL\x20schema\x20validation','schemas','push','1840440ERpvdi','Table\x20\x22','isSelectOnly','toLowerCase','tables','valid','1653000RvRljx','type','appCode','360198BTRXNT','reason','5grngOQ','fields','size','tableName','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','4412205ozLgcY','\x22\x20not\x20found\x20or\x20not\x20accessible','schema:','get','parameters','Provide\x20--file\x20or\x20--sql','trim','4679238PjVObz','sqlType','file','dbtableConfig','flagMissing','cwd','length','7HWokyH','map','4865688LfchCF','isArray','validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','str','split','message','schemaWarnings','name','File\x20not\x20found:\x20','validation','filter','157202smohbV','string'];a165_0x562b=function(){return _0x39e472;};return a165_0x562b();}import{CliErrors}from'../../errors.js';import{assertDatasetIsDbTableBacked,filterDbTableBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a165_0x247fa5(0x1c7),'command':a165_0x247fa5(0x1ed),'description':a165_0x247fa5(0x1ee),'risk':'read','flags':[{'name':a165_0x247fa5(0x1e4),'type':a165_0x247fa5(0x1c6),'description':a165_0x247fa5(0x1da)},{'name':a165_0x247fa5(0x1c7),'type':a165_0x247fa5(0x1c6),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':'schemas','type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x1e00d2){const _0xe8347f=a165_0x247fa5,_0x176ca7=_0x1e00d2['str'](_0xe8347f(0x1e4)),_0x2a065e=_0x1e00d2[_0xe8347f(0x1ef)](_0xe8347f(0x1c7));if(!_0x176ca7&&!_0x2a065e)throw CliErrors[_0xe8347f(0x1e6)](_0xe8347f(0x1e4),_0xe8347f(0x1e0));let _0x3e32dd;if(_0x176ca7){const _0x5ebf8f=resolve(process[_0xe8347f(0x1e7)](),_0x176ca7);if(!existsSync(_0x5ebf8f))throw CliErrors[_0xe8347f(0x1c3)](_0xe8347f(0x1c2)+_0x5ebf8f);_0x3e32dd=readFileSync(_0x5ebf8f,'utf-8');}else _0x3e32dd=_0x2a065e;const _0x5d5fea=validateSql(_0x3e32dd),_0x56a5f3={'valid':_0x5d5fea[_0xe8347f(0x1d0)],'sqlType':_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1d2)],'isSelectOnly':_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1cd)],'isDangerous':_0x5d5fea[_0xe8347f(0x1e3)]['isDangerous'],'tables':_0x5d5fea[_0xe8347f(0x1cf)],'parameters':_0x5d5fea[_0xe8347f(0x1df)],'message':_0x5d5fea[_0xe8347f(0x1f1)]};_0x5d5fea['sqlType']['reason']&&(_0x56a5f3[_0xe8347f(0x1d5)]=_0x5d5fea[_0xe8347f(0x1e3)][_0xe8347f(0x1d5)]);const _0x2a4cfd=_0x1e00d2[_0xe8347f(0x1ef)](_0xe8347f(0x1c9));if(_0x2a4cfd&&_0x5d5fea['valid']){const _0x8439c0=_0x2a4cfd[_0xe8347f(0x1f0)](',')[_0xe8347f(0x1ea)](_0x4607b6=>_0x4607b6[_0xe8347f(0x1e1)]())[_0xe8347f(0x1c4)](Boolean),_0x9de078=[],_0x902cc=filterDbTableBackedDatasets(await listDatasets(_0x1e00d2[_0xe8347f(0x1d3)])),_0x4f307c=new Map(_0x902cc[_0xe8347f(0x1ea)](_0x2cc58b=>[_0x2cc58b[_0xe8347f(0x1e5)]?.[_0xe8347f(0x1d9)]?.[_0xe8347f(0x1ce)](),_0x2cc58b]));for(const _0xc952e2 of _0x5d5fea[_0xe8347f(0x1cf)]){const _0x598e84=_0x4f307c[_0xe8347f(0x1de)](_0xc952e2['toLowerCase']());!_0x598e84&&_0x9de078[_0xe8347f(0x1ca)](_0xe8347f(0x1cc)+_0xc952e2+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x203877 of _0x8439c0){let _0x5bab48;try{_0x5bab48=await getDatasetDetail(_0x203877);}catch{_0x9de078[_0xe8347f(0x1ca)]('Dataset\x20\x22'+_0x203877+_0xe8347f(0x1dc));continue;}assertDatasetIsDbTableBacked(_0x5bab48,_0xe8347f(0x1c8));const _0x154f11=Array[_0xe8347f(0x1ec)](_0x5bab48[_0xe8347f(0x1d7)])?_0x5bab48[_0xe8347f(0x1d7)]:[],_0xdb81e9=new Set(_0x154f11[_0xe8347f(0x1ea)](_0x5cc896=>_0x5cc896[_0xe8347f(0x1c1)]?.[_0xe8347f(0x1ce)]())),_0x1c8d40=_0x5bab48['dbtableConfig']?.['tableName']||_0x5bab48[_0xe8347f(0x1d9)]||_0x203877;_0x56a5f3[_0xe8347f(0x1dd)+_0x1c8d40]={'code':_0x203877,'tableName':_0x1c8d40,'fieldCount':_0xdb81e9[_0xe8347f(0x1d8)],'fields':Array['from'](_0xdb81e9)};}_0x9de078[_0xe8347f(0x1e8)]>0x0&&(_0x56a5f3[_0xe8347f(0x1f2)]=_0x9de078);}return{'ok':_0x5d5fea[_0xe8347f(0x1d0)],'data':_0x56a5f3,'message':_0x5d5fea['message']};}};
1
+ const a165_0x12e265=a165_0x223c;(function(_0x3d560a,_0x405cb6){const _0x34b2bd=a165_0x223c,_0x1c97c1=_0x3d560a();while(!![]){try{const _0x2eec6b=-parseInt(_0x34b2bd(0x12a))/0x1+-parseInt(_0x34b2bd(0x12c))/0x2+-parseInt(_0x34b2bd(0x132))/0x3*(parseInt(_0x34b2bd(0x13f))/0x4)+parseInt(_0x34b2bd(0x12b))/0x5+parseInt(_0x34b2bd(0x143))/0x6*(parseInt(_0x34b2bd(0x158))/0x7)+parseInt(_0x34b2bd(0x145))/0x8+parseInt(_0x34b2bd(0x140))/0x9;if(_0x2eec6b===_0x405cb6)break;else _0x1c97c1['push'](_0x1c97c1['shift']());}catch(_0x3671d2){_0x1c97c1['push'](_0x1c97c1['shift']());}}}(a165_0x1e48,0x45ad3));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a165_0x1e48(){const _0x4b8749=['isDangerous','dbtableConfig','\x22\x20not\x20found\x20in\x20any\x20dataset','validate','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','SQL\x20schema\x20validation','tables','toLowerCase','Table\x20\x22','str','name','string','message','trim','sql','length','1026459xXgYvv','schemas','tableName','get','524724TAEsOp','1970745tYNAWV','803732hbykkt','map','isArray','filter','push','File\x20not\x20found:\x20','1292349ksOTHr','split','schemaWarnings','sqlType','valid','Provide\x20--file\x20or\x20--sql','schema:','cwd','parameters','read','file','validation','isSelectOnly','4lDpgda','6593913ewjexd','reason','utf-8','12sWqIeS','fields','1781504EWwgbd','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','type'];a165_0x1e48=function(){return _0x4b8749;};return a165_0x1e48();}function a165_0x223c(_0x6fa7b7,_0x468bb1){_0x6fa7b7=_0x6fa7b7-0x129;const _0x1e48f2=a165_0x1e48();let _0x223c7b=_0x1e48f2[_0x6fa7b7];return _0x223c7b;}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':a165_0x12e265(0x156),'command':a165_0x12e265(0x14b),'description':a165_0x12e265(0x14c),'risk':a165_0x12e265(0x13b),'flags':[{'name':a165_0x12e265(0x13c),'type':a165_0x12e265(0x153),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':'sql','type':a165_0x12e265(0x153),'description':a165_0x12e265(0x146)},{'name':a165_0x12e265(0x159),'type':a165_0x12e265(0x153),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x2825c6){const _0x26951e=a165_0x12e265,_0x2967e7=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x13c)),_0x2b86de=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x156));if(!_0x2967e7&&!_0x2b86de)throw CliErrors['flagMissing'](_0x26951e(0x13c),_0x26951e(0x137));let _0x2fbd3f;if(_0x2967e7){const _0x16b529=resolve(process[_0x26951e(0x139)](),_0x2967e7);if(!existsSync(_0x16b529))throw CliErrors[_0x26951e(0x13d)](_0x26951e(0x131)+_0x16b529);_0x2fbd3f=readFileSync(_0x16b529,_0x26951e(0x142));}else _0x2fbd3f=_0x2b86de;const _0x36077b=validateSql(_0x2fbd3f),_0x35a417={'valid':_0x36077b['valid'],'sqlType':_0x36077b[_0x26951e(0x135)][_0x26951e(0x147)],'isSelectOnly':_0x36077b[_0x26951e(0x135)][_0x26951e(0x13e)],'isDangerous':_0x36077b[_0x26951e(0x135)][_0x26951e(0x148)],'tables':_0x36077b[_0x26951e(0x14e)],'parameters':_0x36077b[_0x26951e(0x13a)],'message':_0x36077b[_0x26951e(0x154)]};_0x36077b['sqlType'][_0x26951e(0x141)]&&(_0x35a417[_0x26951e(0x141)]=_0x36077b[_0x26951e(0x135)][_0x26951e(0x141)]);const _0x1bbdee=_0x2825c6[_0x26951e(0x151)](_0x26951e(0x159));if(_0x1bbdee&&_0x36077b[_0x26951e(0x136)]){const _0x44ee0d=_0x1bbdee[_0x26951e(0x133)](',')[_0x26951e(0x12d)](_0x1a382d=>_0x1a382d[_0x26951e(0x155)]())[_0x26951e(0x12f)](Boolean),_0x366be4=[],_0x517c5e=filterDbTableBackedDatasets(await listDatasets(_0x2825c6['appCode'])),_0x4dce86=new Map(_0x517c5e['map'](_0x4c8d92=>[_0x4c8d92[_0x26951e(0x149)]?.['tableName']?.[_0x26951e(0x14f)](),_0x4c8d92]));for(const _0x201c76 of _0x36077b[_0x26951e(0x14e)]){const _0x272e57=_0x4dce86[_0x26951e(0x129)](_0x201c76[_0x26951e(0x14f)]());!_0x272e57&&_0x366be4[_0x26951e(0x130)](_0x26951e(0x150)+_0x201c76+_0x26951e(0x14a));}for(const _0x2ed298 of _0x44ee0d){let _0x9916b9;try{_0x9916b9=await getDatasetDetail(_0x2ed298);}catch{_0x366be4[_0x26951e(0x130)]('Dataset\x20\x22'+_0x2ed298+'\x22\x20not\x20found\x20or\x20not\x20accessible');continue;}assertDatasetIsDbTableBacked(_0x9916b9,_0x26951e(0x14d));const _0x401908=Array[_0x26951e(0x12e)](_0x9916b9['fields'])?_0x9916b9[_0x26951e(0x144)]:[],_0x3c7e12=new Set(_0x401908[_0x26951e(0x12d)](_0x18a9dc=>_0x18a9dc[_0x26951e(0x152)]?.[_0x26951e(0x14f)]())),_0xb904e6=_0x9916b9['dbtableConfig']?.[_0x26951e(0x15a)]||_0x9916b9['tableName']||_0x2ed298;_0x35a417[_0x26951e(0x138)+_0xb904e6]={'code':_0x2ed298,'tableName':_0xb904e6,'fieldCount':_0x3c7e12['size'],'fields':Array['from'](_0x3c7e12)};}_0x366be4[_0x26951e(0x157)]>0x0&&(_0x35a417[_0x26951e(0x134)]=_0x366be4);}return{'ok':_0x36077b[_0x26951e(0x136)],'data':_0x35a417,'message':_0x36077b[_0x26951e(0x154)]};}};
@@ -1 +1 @@
1
- const a166_0x58a37c=a166_0x5363;function a166_0x5363(_0x5c6b1c,_0x11d4f6){_0x5c6b1c=_0x5c6b1c-0xa8;const _0x596205=a166_0x5962();let _0x536371=_0x596205[_0x5c6b1c];return _0x536371;}(function(_0x474c3c,_0x278a68){const _0x2d3e39=a166_0x5363,_0x53ca58=_0x474c3c();while(!![]){try{const _0x15efe8=-parseInt(_0x2d3e39(0xb6))/0x1+parseInt(_0x2d3e39(0xa8))/0x2+-parseInt(_0x2d3e39(0xb2))/0x3*(parseInt(_0x2d3e39(0xa9))/0x4)+parseInt(_0x2d3e39(0xb5))/0x5+parseInt(_0x2d3e39(0xaa))/0x6+-parseInt(_0x2d3e39(0xad))/0x7*(-parseInt(_0x2d3e39(0xab))/0x8)+-parseInt(_0x2d3e39(0xaf))/0x9;if(_0x15efe8===_0x278a68)break;else _0x53ca58['push'](_0x53ca58['shift']());}catch(_0x13cbc5){_0x53ca58['push'](_0x53ca58['shift']());}}}(a166_0x5962,0x79631));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';function a166_0x5962(){const _0xa7f445=['2997620RHVvqr','846777XtTypY','721118SFkBIx','4660zaypUm','5470878IKjXQA','5734576kwPJIQ','App\x20profile\x20name','7Blubbe','add','3695400UNpvhg','workspace','write','2148JSfBWD','workspace\x20add','name'];a166_0x5962=function(){return _0xa7f445;};return a166_0x5962();}export const workspaceAddDefinition={'service':a166_0x58a37c(0xb0),'command':a166_0x58a37c(0xae),'description':'Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','risk':a166_0x58a37c(0xb1),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a166_0x58a37c(0xb4),'description':a166_0x58a37c(0xac),'required':!![]}],'flags':buildAppAddFlags(),'validate':_0x19aab1=>validateAppName(_0x19aab1,a166_0x58a37c(0xb3)),'execute':_0x5cc97c=>runAppAdd(_0x5cc97c,a166_0x58a37c(0xb3))};
1
+ function a166_0x5d5a(_0x5a419c,_0x4e4f2f){_0x5a419c=_0x5a419c-0x1ab;const _0x1f8fbc=a166_0x1f8f();let _0x5d5a97=_0x1f8fbc[_0x5a419c];return _0x5d5a97;}function a166_0x1f8f(){const _0xf27e62=['27549zfIBiS','3612266GnyHva','workspace','2343000GFDkFE','100DjFmVb','2105420EWIcPo','workspace\x20add','1EvsGUS','12180879zRjdEn','322380vHTLlr','Register\x20an\x20app\x20profile\x20in\x20the\x20current\x20workspace\x20(or\x20--global)','add','784298OLepCf'];a166_0x1f8f=function(){return _0xf27e62;};return a166_0x1f8f();}const a166_0x3f4573=a166_0x5d5a;(function(_0x2bad48,_0xff6027){const _0x1cb478=a166_0x5d5a,_0x2bcc6c=_0x2bad48();while(!![]){try{const _0x446d69=-parseInt(_0x1cb478(0x1b6))/0x1*(parseInt(_0x1cb478(0x1ae))/0x2)+parseInt(_0x1cb478(0x1af))/0x3*(-parseInt(_0x1cb478(0x1b3))/0x4)+parseInt(_0x1cb478(0x1b4))/0x5+-parseInt(_0x1cb478(0x1ab))/0x6+-parseInt(_0x1cb478(0x1b0))/0x7+-parseInt(_0x1cb478(0x1b2))/0x8+parseInt(_0x1cb478(0x1b7))/0x9;if(_0x446d69===_0xff6027)break;else _0x2bcc6c['push'](_0x2bcc6c['shift']());}catch(_0xc9bd9){_0x2bcc6c['push'](_0x2bcc6c['shift']());}}}(a166_0x1f8f,0x46d64));import{buildAppAddFlags,runAppAdd,validateAppName}from'../../commands/common/app-registry.js';export const workspaceAddDefinition={'service':a166_0x3f4573(0x1b1),'command':a166_0x3f4573(0x1ad),'description':a166_0x3f4573(0x1ac),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name','required':!![]}],'flags':buildAppAddFlags(),'validate':_0x31a926=>validateAppName(_0x31a926,a166_0x3f4573(0x1b5)),'execute':_0x2e1275=>runAppAdd(_0x2e1275,'workspace\x20add')};
@@ -1 +1 @@
1
- const a167_0x70b7de=a167_0x50cd;(function(_0x379d19,_0x4df457){const _0x3ba424=a167_0x50cd,_0x234aa1=_0x379d19();while(!![]){try{const _0x4fa6d5=parseInt(_0x3ba424(0xba))/0x1+-parseInt(_0x3ba424(0xa7))/0x2*(parseInt(_0x3ba424(0xb9))/0x3)+-parseInt(_0x3ba424(0xd9))/0x4*(parseInt(_0x3ba424(0xd4))/0x5)+parseInt(_0x3ba424(0xc0))/0x6*(parseInt(_0x3ba424(0xcf))/0x7)+-parseInt(_0x3ba424(0xdc))/0x8*(parseInt(_0x3ba424(0xbd))/0x9)+parseInt(_0x3ba424(0xd0))/0xa+parseInt(_0x3ba424(0xb1))/0xb*(parseInt(_0x3ba424(0xac))/0xc);if(_0x4fa6d5===_0x4df457)break;else _0x234aa1['push'](_0x234aa1['shift']());}catch(_0xd478f3){_0x234aa1['push'](_0x234aa1['shift']());}}}(a167_0x5bce,0x80298));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';function a167_0x5bce(){const _0x18bf70=['\x20workspace\x20','App\x20\x22','workspace','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','flag','Initialize\x20the\x20current\x20workspace\x20app\x20binding','locale','apiDir','number','582183nKYRRe','9686230hOgTzd','app','Invalid\x20appcode:\x20','\x20--app\x20','1707715KTbTDz','Locale\x20for\x20this\x20workspace\x20app\x20profile','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','trim','appcode','8OUjuJl','env','Use\x20`','7895216eeOklg','App\x20code\x20to\x20bind\x20to\x20this\x20workspace','updated','validation','riskLevel','init','format','53614lTyNdW','workspace.','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','\x20workspace\x20use\x20--app\x20<name>`.','isArray','156rKmlsF','defaultApp','keys','string','Missing\x20workspace\x20app\x20selector.','1355178dLzhWN','project','write','\x20(appcode:\x20','str','Switch\x20the\x20current\x20workspace\x20app\x20binding','apps','pageSize','84BqRWEo','292170yTLsdB','defaultFormat','initialized','9cQQUNc','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','.\x20Credentials:\x20not\x20written.','6yQRmZv','Workspace\x20','Target\x20environment','object','join','globalConfig'];a167_0x5bce=function(){return _0x18bf70;};return a167_0x5bce();}function a167_0x50cd(_0x503ca8,_0x501db4){_0x503ca8=_0x503ca8-0xa4;const _0x5bce2c=a167_0x5bce();let _0x50cdbc=_0x5bce2c[_0x503ca8];return _0x50cdbc;}import{RISK_LEVEL_VALUES}from'../../constant/risk.js';import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+'\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]',SAFE_PROFILE_KEYS=[a167_0x70b7de(0xd8),a167_0x70b7de(0xda),a167_0x70b7de(0xcd),a167_0x70b7de(0xa6),a167_0x70b7de(0xb8),'riskLevel',a167_0x70b7de(0xcc)],workspaceFlags=[{'name':a167_0x70b7de(0xd1),'type':'string','description':a167_0x70b7de(0xc9)},{'name':a167_0x70b7de(0xd8),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xdd)},{'name':a167_0x70b7de(0xda),'type':'string','description':a167_0x70b7de(0xc2),'enum':[...RABETBASE_ENV_VALUES]},{'name':a167_0x70b7de(0xcd),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xa9)},{'name':a167_0x70b7de(0xbb),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xbe),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':a167_0x70b7de(0xce),'description':'Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile'},{'name':a167_0x70b7de(0xa4),'type':a167_0x70b7de(0xaf),'description':a167_0x70b7de(0xd6),'enum':[...RISK_LEVEL_VALUES]},{'name':a167_0x70b7de(0xcc),'type':'string','description':a167_0x70b7de(0xd5)}];function isRecord(_0x5d6b7){const _0x222a3d=a167_0x70b7de;return!!_0x5d6b7&&typeof _0x5d6b7===_0x222a3d(0xc3)&&!Array[_0x222a3d(0xab)](_0x5d6b7);}function assertValidAppcode(_0x14cf3c){const _0x5b1d7d=a167_0x70b7de,{valid:_0x5eaa0f,message:_0x477c1e}=validateAppcode(_0x14cf3c);if(!_0x5eaa0f)throw CliErrors[_0x5b1d7d(0xdf)](_0x5b1d7d(0xd2)+_0x14cf3c,_0x477c1e);}function sanitizeProfile(_0x49d155){if(!isRecord(_0x49d155))return{};const _0x22f478={};for(const _0x2d6871 of SAFE_PROFILE_KEYS){if(_0x49d155[_0x2d6871]!==undefined)_0x22f478[_0x2d6871]=_0x49d155[_0x2d6871];}return _0x22f478;}function cloneProfile(_0x207f34){return isRecord(_0x207f34)?{..._0x207f34}:{};}function collectWorkspaceProfileOverrides(_0xae89a6){const _0x5eb356=a167_0x70b7de,_0x765837={},_0x6f1a1a=_0xae89a6['str'](_0x5eb356(0xda)),_0x58aade=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xcd)),_0x139fa8=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xbb)),_0xa2b42=_0xae89a6[_0x5eb356(0xca)](_0x5eb356(0xb8)),_0x168ee3=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xa4)),_0x2c288f=_0xae89a6[_0x5eb356(0xb5)](_0x5eb356(0xcc));if(_0x6f1a1a)_0x765837['env']=_0x6f1a1a;if(_0x58aade)_0x765837['apiDir']=_0x58aade;if(_0x139fa8)_0x765837[_0x5eb356(0xa6)]=_0x139fa8;if(_0xa2b42!==undefined&&_0xa2b42!=='')_0x765837[_0x5eb356(0xb8)]=Number(_0xa2b42);if(_0x168ee3)_0x765837[_0x5eb356(0xa4)]=_0x168ee3;if(_0x2c288f)_0x765837[_0x5eb356(0xcc)]=_0x2c288f;return _0x765837;}async function validateWorkspaceArgs(_0x1a7b10){const _0x44afee=a167_0x70b7de,_0x139e31=_0x1a7b10[_0x44afee(0xb5)](_0x44afee(0xd1))[_0x44afee(0xd7)](),_0x5bba0f=_0x1a7b10[_0x44afee(0xb5)](_0x44afee(0xd8))[_0x44afee(0xd7)]();if(!_0x139e31&&!_0x5bba0f)throw CliErrors['validation'](_0x44afee(0xb0),'Use\x20`'+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x44afee(0xaa));if(_0x5bba0f)assertValidAppcode(_0x5bba0f);}function resolveKnownApps(){const _0x4441ec=a167_0x70b7de,{config:_0x370f9c,layers:_0x187329}=readRawConfigWithLayers(),_0x17638d=isRecord(_0x370f9c[_0x4441ec(0xb7)])?_0x370f9c[_0x4441ec(0xb7)]:{},_0x5b6c0c=isRecord(_0x187329[_0x4441ec(0xc5)][_0x4441ec(0xb7)])?_0x187329[_0x4441ec(0xc5)]['apps']:{};return{..._0x5b6c0c,..._0x17638d};}async function configureWorkspace(_0x4d0eec,_0x3ddab2){const _0x4d3cd3=a167_0x70b7de,_0x426a4f=_0x4d0eec[_0x4d3cd3(0xb5)](_0x4d3cd3(0xd1))['trim'](),_0x58a62a=_0x4d0eec[_0x4d3cd3(0xb5)](_0x4d3cd3(0xd8))['trim'](),_0x532a38=_0x426a4f||_0x58a62a;if(!_0x532a38)throw CliErrors[_0x4d3cd3(0xdf)](_0x4d3cd3(0xb0),_0x4d3cd3(0xdb)+CLI_BIN_NAME+'\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`'+CLI_BIN_NAME+_0x4d3cd3(0xaa));if(_0x58a62a)assertValidAppcode(_0x58a62a);const _0x2ed727=resolveWriteConfigPath(_0x4d3cd3(0xb2)),_0x2dfd2f=readConfigFile(_0x2ed727),_0x24d40f=resolveKnownApps(),_0x820eba=isRecord(_0x2dfd2f[_0x4d3cd3(0xb7)])?{..._0x2dfd2f['apps']}:{},_0x2b185b=cloneProfile(_0x820eba[_0x532a38]),_0x569b26=sanitizeProfile(_0x24d40f[_0x532a38]),_0x292714=_0x58a62a?{}:_0x569b26,_0x4a11bd=_0x58a62a||_0x292714[_0x4d3cd3(0xd8)];if(!_0x4a11bd){const _0x3c4ba1=Object[_0x4d3cd3(0xae)](_0x24d40f),_0x5dfcd6=_0x3c4ba1['length']===0x0?_0x4d3cd3(0xdb)+CLI_BIN_NAME+_0x4d3cd3(0xc6)+_0x3ddab2+_0x4d3cd3(0xd3)+_0x532a38+'\x20--appcode\x20<code>`.':'Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20'+_0x3c4ba1[_0x4d3cd3(0xc4)](',\x20');throw CliErrors['validation'](_0x4d3cd3(0xc7)+_0x532a38+'\x22\x20not\x20found.',_0x5dfcd6);}assertValidAppcode(String(_0x4a11bd));const _0x2631c2={..._0x292714,..._0x2b185b,'appcode':String(_0x4a11bd),...collectWorkspaceProfileOverrides(_0x4d0eec)};return _0x820eba[_0x532a38]=_0x2631c2,_0x2dfd2f['apps']=_0x820eba,_0x2dfd2f[_0x4d3cd3(0xad)]=_0x532a38,delete _0x2dfd2f['appcode'],delete _0x2dfd2f['app'],_0x2631c2[_0x4d3cd3(0xda)]&&(_0x2dfd2f[_0x4d3cd3(0xda)]=_0x2631c2[_0x4d3cd3(0xda)]),writeConfigFile(_0x2ed727,_0x2dfd2f),{'ok':!![],'message':_0x4d3cd3(0xc1)+(_0x3ddab2==='init'?_0x4d3cd3(0xbc):_0x4d3cd3(0xde))+':\x20'+_0x532a38+_0x4d3cd3(0xb4)+_0x2631c2[_0x4d3cd3(0xd8)]+').\x20Config:\x20'+_0x2ed727+_0x4d3cd3(0xbf),'data':{'operation':_0x4d3cd3(0xa8)+_0x3ddab2,'configPath':_0x2ed727,'app':_0x532a38,'appcode':_0x2631c2[_0x4d3cd3(0xd8)],'env':_0x2631c2[_0x4d3cd3(0xda)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a167_0x70b7de(0xc8),'command':a167_0x70b7de(0xa5),'description':a167_0x70b7de(0xcb),'risk':a167_0x70b7de(0xb3),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x33b8b8=>configureWorkspace(_0x33b8b8,a167_0x70b7de(0xa5))},workspaceUseDefinition={'service':a167_0x70b7de(0xc8),'command':'use','description':a167_0x70b7de(0xb6),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x5b5a54=>configureWorkspace(_0x5b5a54,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
1
+ const a167_0x4cd2e6=a167_0x34e0;(function(_0x3b13eb,_0x5af733){const _0x2cbedb=a167_0x34e0,_0x245847=_0x3b13eb();while(!![]){try{const _0x4afba0=-parseInt(_0x2cbedb(0x1df))/0x1*(-parseInt(_0x2cbedb(0x1d6))/0x2)+parseInt(_0x2cbedb(0x200))/0x3+-parseInt(_0x2cbedb(0x1f3))/0x4*(parseInt(_0x2cbedb(0x210))/0x5)+-parseInt(_0x2cbedb(0x1ee))/0x6+-parseInt(_0x2cbedb(0x1f4))/0x7*(-parseInt(_0x2cbedb(0x1fe))/0x8)+-parseInt(_0x2cbedb(0x1e5))/0x9*(parseInt(_0x2cbedb(0x1f2))/0xa)+-parseInt(_0x2cbedb(0x1e2))/0xb*(parseInt(_0x2cbedb(0x1f5))/0xc);if(_0x4afba0===_0x5af733)break;else _0x245847['push'](_0x245847['shift']());}catch(_0x29786e){_0x245847['push'](_0x245847['shift']());}}}(a167_0x58d2,0xdaff1));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 a167_0x58d2(){const _0x37b818=['\x20workspace\x20<init|use>\x20--app\x20<name>\x20[--appcode\x20<code>]','str','format','flag','appcode','\x20--app\x20','length','2901882WPUKVX','\x20--appcode\x20<code>`.','string','object','70210WUxDqR','1019152CeTXdG','72863wafvnf','10344bfIDbj','defaultFormat','locale','project','globalConfig','Initialize\x20the\x20current\x20workspace\x20app\x20binding','initialized','use','Use\x20`','536hHcfGE','join','4144494IGozLc','Risk\x20level\x20for\x20this\x20workspace\x20app\x20profile','keys',').\x20Config:\x20','\x20workspace\x20use\x20--app\x20<name>`.','apps','App\x20profile\x20name\x20to\x20use\x20in\x20this\x20workspace','trim','Missing\x20workspace\x20app\x20selector.','workspace','Switch\x20the\x20current\x20workspace\x20app\x20binding','riskLevel','Workspace\x20','env','Pass\x20--appcode\x20<code>,\x20or\x20choose\x20one\x20of:\x20','updated','25TTHIpx','Target\x20environment','2UAihyI','Invalid\x20appcode:\x20','app','isArray','write','API\x20directory\x20path\x20for\x20this\x20workspace\x20app\x20profile','validation','Default\x20output\x20format\x20for\x20this\x20workspace\x20app\x20profile','Default\x20page\x20size\x20for\x20this\x20workspace\x20app\x20profile','912539JCIeDe','\x20workspace\x20init\x20--appcode\x20<code>`\x20or\x20`','apiDir','1969uxMMak','pageSize','init','234TizCCq','.\x20Credentials:\x20not\x20written.'];a167_0x58d2=function(){return _0x37b818;};return a167_0x58d2();}import{validateAppcode}from'../../commands/common/validate.js';import{readConfigFile,readRawConfigWithLayers,resolveWriteConfigPath,writeConfigFile}from'../../context.js';import{workspaceAddDefinition}from'../../commands/workspace/add.js';import{workspaceRemoveDefinition}from'../../commands/workspace/remove.js';const WORKSPACE_USAGE=CLI_BIN_NAME+a167_0x4cd2e6(0x1e7),SAFE_PROFILE_KEYS=['appcode',a167_0x4cd2e6(0x20d),a167_0x4cd2e6(0x1e1),a167_0x4cd2e6(0x1e9),a167_0x4cd2e6(0x1e3),a167_0x4cd2e6(0x20b),a167_0x4cd2e6(0x1f7)],workspaceFlags=[{'name':a167_0x4cd2e6(0x1d8),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x206)},{'name':a167_0x4cd2e6(0x1eb),'type':'string','description':'App\x20code\x20to\x20bind\x20to\x20this\x20workspace'},{'name':a167_0x4cd2e6(0x20d),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x211),'enum':[...RABETBASE_ENV_VALUES]},{'name':a167_0x4cd2e6(0x1e1),'type':'string','description':a167_0x4cd2e6(0x1db)},{'name':'defaultFormat','type':'string','description':a167_0x4cd2e6(0x1dd),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':a167_0x4cd2e6(0x1e3),'type':'number','description':a167_0x4cd2e6(0x1de)},{'name':a167_0x4cd2e6(0x20b),'type':a167_0x4cd2e6(0x1f0),'description':a167_0x4cd2e6(0x201),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':'string','description':'Locale\x20for\x20this\x20workspace\x20app\x20profile'}];function a167_0x34e0(_0x308e0e,_0x26e3bf){_0x308e0e=_0x308e0e-0x1d6;const _0x58d248=a167_0x58d2();let _0x34e0cc=_0x58d248[_0x308e0e];return _0x34e0cc;}function isRecord(_0x42f02a){const _0x4c5bcc=a167_0x4cd2e6;return!!_0x42f02a&&typeof _0x42f02a===_0x4c5bcc(0x1f1)&&!Array[_0x4c5bcc(0x1d9)](_0x42f02a);}function assertValidAppcode(_0x3c5e10){const _0x5e8c05=a167_0x4cd2e6,{valid:_0x4a157a,message:_0x25bfa5}=validateAppcode(_0x3c5e10);if(!_0x4a157a)throw CliErrors['validation'](_0x5e8c05(0x1d7)+_0x3c5e10,_0x25bfa5);}function sanitizeProfile(_0x3cadab){if(!isRecord(_0x3cadab))return{};const _0x48275b={};for(const _0x2fe611 of SAFE_PROFILE_KEYS){if(_0x3cadab[_0x2fe611]!==undefined)_0x48275b[_0x2fe611]=_0x3cadab[_0x2fe611];}return _0x48275b;}function cloneProfile(_0x1e032a){return isRecord(_0x1e032a)?{..._0x1e032a}:{};}function collectWorkspaceProfileOverrides(_0x1ee6bd){const _0x49dbc6=a167_0x4cd2e6,_0x5883bc={},_0x11b486=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x20d)),_0x10a4e6=_0x1ee6bd[_0x49dbc6(0x1e8)]('apiDir'),_0x1c383c=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x1f6)),_0x301747=_0x1ee6bd[_0x49dbc6(0x1ea)]('pageSize'),_0x408cdc=_0x1ee6bd[_0x49dbc6(0x1e8)]('riskLevel'),_0x3d9bed=_0x1ee6bd[_0x49dbc6(0x1e8)](_0x49dbc6(0x1f7));if(_0x11b486)_0x5883bc[_0x49dbc6(0x20d)]=_0x11b486;if(_0x10a4e6)_0x5883bc['apiDir']=_0x10a4e6;if(_0x1c383c)_0x5883bc[_0x49dbc6(0x1e9)]=_0x1c383c;if(_0x301747!==undefined&&_0x301747!=='')_0x5883bc[_0x49dbc6(0x1e3)]=Number(_0x301747);if(_0x408cdc)_0x5883bc['riskLevel']=_0x408cdc;if(_0x3d9bed)_0x5883bc[_0x49dbc6(0x1f7)]=_0x3d9bed;return _0x5883bc;}async function validateWorkspaceArgs(_0x1c105d){const _0x191088=a167_0x4cd2e6,_0x506cf5=_0x1c105d[_0x191088(0x1e8)]('app')[_0x191088(0x207)](),_0x5ed580=_0x1c105d[_0x191088(0x1e8)](_0x191088(0x1eb))['trim']();if(!_0x506cf5&&!_0x5ed580)throw CliErrors['validation'](_0x191088(0x208),_0x191088(0x1fd)+CLI_BIN_NAME+_0x191088(0x1e0)+CLI_BIN_NAME+_0x191088(0x204));if(_0x5ed580)assertValidAppcode(_0x5ed580);}function resolveKnownApps(){const _0x2de669=a167_0x4cd2e6,{config:_0x4621b8,layers:_0x57fb61}=readRawConfigWithLayers(),_0x2f529a=isRecord(_0x4621b8[_0x2de669(0x205)])?_0x4621b8[_0x2de669(0x205)]:{},_0x4f285e=isRecord(_0x57fb61[_0x2de669(0x1f9)]['apps'])?_0x57fb61[_0x2de669(0x1f9)][_0x2de669(0x205)]:{};return{..._0x4f285e,..._0x2f529a};}async function configureWorkspace(_0x391920,_0xd8f10a){const _0x381682=a167_0x4cd2e6,_0x28a01b=_0x391920[_0x381682(0x1e8)](_0x381682(0x1d8))[_0x381682(0x207)](),_0x3c9e2d=_0x391920['str'](_0x381682(0x1eb))['trim'](),_0x582158=_0x28a01b||_0x3c9e2d;if(!_0x582158)throw CliErrors[_0x381682(0x1dc)](_0x381682(0x208),_0x381682(0x1fd)+CLI_BIN_NAME+_0x381682(0x1e0)+CLI_BIN_NAME+_0x381682(0x204));if(_0x3c9e2d)assertValidAppcode(_0x3c9e2d);const _0x144f3b=resolveWriteConfigPath(_0x381682(0x1f8)),_0x55b30c=readConfigFile(_0x144f3b),_0x12cdc9=resolveKnownApps(),_0xb3c19d=isRecord(_0x55b30c[_0x381682(0x205)])?{..._0x55b30c[_0x381682(0x205)]}:{},_0x2ab04d=cloneProfile(_0xb3c19d[_0x582158]),_0xa84a93=sanitizeProfile(_0x12cdc9[_0x582158]),_0x4be286=_0x3c9e2d?{}:_0xa84a93,_0x760f88=_0x3c9e2d||_0x4be286[_0x381682(0x1eb)];if(!_0x760f88){const _0x2c40b3=Object[_0x381682(0x202)](_0x12cdc9),_0x5a1d6a=_0x2c40b3[_0x381682(0x1ed)]===0x0?_0x381682(0x1fd)+CLI_BIN_NAME+'\x20workspace\x20'+_0xd8f10a+_0x381682(0x1ec)+_0x582158+_0x381682(0x1ef):_0x381682(0x20e)+_0x2c40b3[_0x381682(0x1ff)](',\x20');throw CliErrors[_0x381682(0x1dc)]('App\x20\x22'+_0x582158+'\x22\x20not\x20found.',_0x5a1d6a);}assertValidAppcode(String(_0x760f88));const _0x4c4d1a={..._0x4be286,..._0x2ab04d,'appcode':String(_0x760f88),...collectWorkspaceProfileOverrides(_0x391920)};return _0xb3c19d[_0x582158]=_0x4c4d1a,_0x55b30c[_0x381682(0x205)]=_0xb3c19d,_0x55b30c['defaultApp']=_0x582158,delete _0x55b30c[_0x381682(0x1eb)],delete _0x55b30c[_0x381682(0x1d8)],_0x4c4d1a['env']&&(_0x55b30c[_0x381682(0x20d)]=_0x4c4d1a[_0x381682(0x20d)]),writeConfigFile(_0x144f3b,_0x55b30c),{'ok':!![],'message':_0x381682(0x20c)+(_0xd8f10a===_0x381682(0x1e4)?_0x381682(0x1fb):_0x381682(0x20f))+':\x20'+_0x582158+'\x20(appcode:\x20'+_0x4c4d1a['appcode']+_0x381682(0x203)+_0x144f3b+_0x381682(0x1e6),'data':{'operation':'workspace.'+_0xd8f10a,'configPath':_0x144f3b,'app':_0x582158,'appcode':_0x4c4d1a[_0x381682(0x1eb)],'env':_0x4c4d1a[_0x381682(0x20d)]??null,'credentialsWritten':![]}};}const workspaceInitDefinition={'service':a167_0x4cd2e6(0x209),'command':a167_0x4cd2e6(0x1e4),'description':a167_0x4cd2e6(0x1fa),'risk':a167_0x4cd2e6(0x1da),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0x2a142f=>configureWorkspace(_0x2a142f,a167_0x4cd2e6(0x1e4))},workspaceUseDefinition={'service':a167_0x4cd2e6(0x209),'command':a167_0x4cd2e6(0x1fc),'description':a167_0x4cd2e6(0x20a),'risk':a167_0x4cd2e6(0x1da),'requiresAuth':![],'requiresAppCode':![],'args':[],'flags':workspaceFlags,'validate':validateWorkspaceArgs,'execute':_0xa4a2b4=>configureWorkspace(_0xa4a2b4,'use')};export const workspaceDefinitions=[workspaceInitDefinition,workspaceUseDefinition,workspaceAddDefinition,workspaceRemoveDefinition];export{WORKSPACE_USAGE};
@@ -1 +1 @@
1
- const a168_0x117592=a168_0x497b;(function(_0x17a528,_0x5adce0){const _0x4e3fc4=a168_0x497b,_0x13adc6=_0x17a528();while(!![]){try{const _0x3aba02=parseInt(_0x4e3fc4(0x13c))/0x1+-parseInt(_0x4e3fc4(0x13e))/0x2+-parseInt(_0x4e3fc4(0x142))/0x3+-parseInt(_0x4e3fc4(0x13d))/0x4*(-parseInt(_0x4e3fc4(0x140))/0x5)+-parseInt(_0x4e3fc4(0x143))/0x6+parseInt(_0x4e3fc4(0x138))/0x7*(-parseInt(_0x4e3fc4(0x13b))/0x8)+parseInt(_0x4e3fc4(0x141))/0x9;if(_0x3aba02===_0x5adce0)break;else _0x13adc6['push'](_0x13adc6['shift']());}catch(_0x4540ef){_0x13adc6['push'](_0x13adc6['shift']());}}}(a168_0x4743,0x86b27));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';function a168_0x497b(_0x106fb1,_0x59e362){_0x106fb1=_0x106fb1-0x134;const _0x47433d=a168_0x4743();let _0x497b12=_0x47433d[_0x106fb1];return _0x497b12;}function a168_0x4743(){const _0x5483bf=['workspace','217903mqWmoQ','high-risk-write','remove','120WswkvL','907772MGnKtY','117652ceAVod','18070PwdRsp','App\x20profile\x20name\x20to\x20remove','90PxhlCC','8455923ytceqE','1219458vQqTNa','5655468PGPUEv','name','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)','workspace\x20remove'];a168_0x4743=function(){return _0x5483bf;};return a168_0x4743();}export const workspaceRemoveDefinition={'service':a168_0x117592(0x137),'command':a168_0x117592(0x13a),'description':a168_0x117592(0x135),'risk':a168_0x117592(0x139),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a168_0x117592(0x134),'description':a168_0x117592(0x13f),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x2cfae2=>validateAppName(_0x2cfae2,a168_0x117592(0x136)),'execute':_0x6c0f3e=>runAppRemove(_0x6c0f3e,a168_0x117592(0x136))};
1
+ function a168_0x4079(_0x7022a4,_0x4bac11){_0x7022a4=_0x7022a4-0x75;const _0x3f3a17=a168_0x3f3a();let _0x40793b=_0x3f3a17[_0x7022a4];return _0x40793b;}const a168_0x4dce3b=a168_0x4079;(function(_0x4840c8,_0xe0c50a){const _0x59f9a2=a168_0x4079,_0x231a19=_0x4840c8();while(!![]){try{const _0x3ad7ff=parseInt(_0x59f9a2(0x7e))/0x1+-parseInt(_0x59f9a2(0x83))/0x2+-parseInt(_0x59f9a2(0x76))/0x3*(-parseInt(_0x59f9a2(0x82))/0x4)+-parseInt(_0x59f9a2(0x79))/0x5+-parseInt(_0x59f9a2(0x80))/0x6*(parseInt(_0x59f9a2(0x77))/0x7)+parseInt(_0x59f9a2(0x84))/0x8+-parseInt(_0x59f9a2(0x7c))/0x9*(-parseInt(_0x59f9a2(0x7d))/0xa);if(_0x3ad7ff===_0xe0c50a)break;else _0x231a19['push'](_0x231a19['shift']());}catch(_0x1c1071){_0x231a19['push'](_0x231a19['shift']());}}}(a168_0x3f3a,0xd873a));import{buildAppRemoveFlags,runAppRemove,validateAppName}from'../../commands/common/app-registry.js';export const workspaceRemoveDefinition={'service':'workspace','command':a168_0x4dce3b(0x7f),'description':a168_0x4dce3b(0x7a),'risk':a168_0x4dce3b(0x81),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a168_0x4dce3b(0x78),'description':a168_0x4dce3b(0x75),'required':!![]}],'flags':buildAppRemoveFlags(),'validate':_0x3f6d0f=>validateAppName(_0x3f6d0f,'workspace\x20remove'),'execute':_0x3e9f75=>runAppRemove(_0x3e9f75,a168_0x4dce3b(0x7b))};function a168_0x3f3a(){const _0x16412a=['workspace\x20remove','116514eVsfTR','730oozIwj','939472yVRcsL','remove','32034qEBCaI','high-risk-write','792xVOwaz','3073014YGTRJL','13216296zPTZvQ','App\x20profile\x20name\x20to\x20remove','1605BhcTWN','525BXzPAU','name','4094895ozgnlw','Remove\x20an\x20app\x20profile\x20from\x20the\x20current\x20workspace\x20(or\x20--global)'];a168_0x3f3a=function(){return _0x16412a;};return a168_0x3f3a();}
@@ -1 +1 @@
1
- const a169_0x483b99=a169_0x299c;(function(_0x2d1e7d,_0x7022fa){const _0x22cc32=a169_0x299c,_0x4d10d9=_0x2d1e7d();while(!![]){try{const _0x34d2d6=-parseInt(_0x22cc32(0x1f2))/0x1+parseInt(_0x22cc32(0x206))/0x2+parseInt(_0x22cc32(0x202))/0x3*(-parseInt(_0x22cc32(0x1f3))/0x4)+parseInt(_0x22cc32(0x213))/0x5*(parseInt(_0x22cc32(0x20d))/0x6)+parseInt(_0x22cc32(0x215))/0x7+-parseInt(_0x22cc32(0x210))/0x8*(-parseInt(_0x22cc32(0x207))/0x9)+parseInt(_0x22cc32(0x216))/0xa;if(_0x34d2d6===_0x7022fa)break;else _0x4d10d9['push'](_0x4d10d9['shift']());}catch(_0x4f5ed6){_0x4d10d9['push'](_0x4d10d9['shift']());}}}(a169_0x5972,0x89a2a));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';function a169_0x5972(){const _0x2f26ef=['7976YuRMfN','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','number','8765mnpfWd','defaultFormat','1576491vtGPng','4524700NRMFUy','locale','inherit','apiDir','Locale','appcode','726410lXpcbJ','8bugfeE','Default\x20page\x20size','length','entries','Config\x20key\x20(','string','accessKey','Access\x20key','toLowerCase','map','filter','en-US','join','riskLevel','keys','575205GWErEe','format','API\x20directory\x20path','has','700940EPICyR','3105epjQfL','env','zh-CN','app','Risk\x20level','pageSize','1032kJUjXZ','cookie','defaultApp'];a169_0x5972=function(){return _0x2f26ef;};return a169_0x5972();}import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a169_0x483b99(0x20e),'accessKey',a169_0x483b99(0x217),a169_0x483b99(0x203),a169_0x483b99(0x200)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a169_0x483b99(0x21b),a169_0x483b99(0x208),a169_0x483b99(0x217),'format','cookie',a169_0x483b99(0x1f9),a169_0x483b99(0x219)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x19583f){const _0x3fafd7=a169_0x483b99;return[..._0x19583f][_0x3fafd7(0x1ff)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x338005){const _0x41d053=a169_0x483b99;return TOP_LEVEL_CONFIG_KEYS[_0x41d053(0x205)](_0x338005);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x2551f9=a169_0x483b99;return _0x2551f9(0x1f7)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a169_0x483b99(0x208),'apiDir':a169_0x483b99(0x219),'cookie':a169_0x483b99(0x20e),'accessKey':a169_0x483b99(0x1f9),'defaultFormat':a169_0x483b99(0x203),'pageSize':'pageSize','riskLevel':a169_0x483b99(0x200),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x104ba6=a169_0x483b99;return[{'name':_0x104ba6(0x208),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x104ba6(0x219),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x204)},{'name':_0x104ba6(0x20e),'type':_0x104ba6(0x1f8),'description':'Auth\x20cookie','hidden':!![]},{'name':_0x104ba6(0x1f9),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x1fa),'hidden':!![]},{'name':_0x104ba6(0x214),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x211),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x104ba6(0x20c),'type':_0x104ba6(0x212),'description':_0x104ba6(0x1f4)},{'name':_0x104ba6(0x200),'type':_0x104ba6(0x1f8),'description':_0x104ba6(0x20b),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x104ba6(0x217),'type':'string','description':_0x104ba6(0x21a)}];}function a169_0x299c(_0x3c385c,_0x24d867){_0x3c385c=_0x3c385c-0x1f2;const _0x597254=a169_0x5972();let _0x299c4e=_0x597254[_0x3c385c];return _0x299c4e;}export function collectAppProfileOverrides(_0x587bad){const _0x568bbf=a169_0x483b99,_0x3ae221={};for(const [_0x5166aa,_0x2fc321]of Object[_0x568bbf(0x1f6)](APP_PROFILE_FLAG_KEY_MAP)){const _0x1ed482=_0x587bad(_0x5166aa);if(!_0x1ed482)continue;_0x3ae221[_0x2fc321]=_0x2fc321===_0x568bbf(0x20c)?Number(_0x1ed482):_0x1ed482;}return _0x3ae221;}export function buildAppProfileListFields(_0x303969){const _0x556079=a169_0x483b99;return{'env':_0x303969[_0x556079(0x208)]??null,'apiDir':_0x303969[_0x556079(0x219)]??null,'hasCookie':!!_0x303969[_0x556079(0x20e)],'hasAccessKey':!!_0x303969[_0x556079(0x1f9)],'format':_0x303969['format']??null,'pageSize':_0x303969[_0x556079(0x20c)]??null,'riskLevel':_0x303969[_0x556079(0x200)]??null,'locale':_0x303969[_0x556079(0x217)]??null};}export function buildAppDoctorFields(_0x20216e,_0x24ec69){const _0x59a3b2=a169_0x483b99;return{'env':{'value':_0x20216e[_0x59a3b2(0x208)]||_0x24ec69[_0x59a3b2(0x208)],'source':_0x20216e[_0x59a3b2(0x208)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)},'apiDir':{'value':_0x20216e[_0x59a3b2(0x219)]||_0x24ec69[_0x59a3b2(0x219)],'source':_0x20216e[_0x59a3b2(0x219)]?'app':_0x59a3b2(0x218)},'cookie':{'value':_0x20216e[_0x59a3b2(0x20e)]||_0x24ec69[_0x59a3b2(0x20e)],'source':_0x20216e[_0x59a3b2(0x20e)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)},'accessKey':{'value':_0x20216e[_0x59a3b2(0x1f9)]||_0x24ec69[_0x59a3b2(0x1f9)],'source':_0x20216e[_0x59a3b2(0x1f9)]?_0x59a3b2(0x20a):_0x59a3b2(0x218)}};}export function buildCanonicalAppConfig(_0x45afea,_0x1b5df5){const _0x58c2e5=a169_0x483b99,_0x2de5b2=_0x45afea[_0x58c2e5(0x1fc)](_0xcb1fb6=>String(_0xcb1fb6||'')['trim']())[_0x58c2e5(0x1fd)](Boolean);if(_0x2de5b2[_0x58c2e5(0x1f5)]===0x0)return{};const _0x3370cb={};for(const _0x2ba7a4 of _0x2de5b2){_0x3370cb[_0x2ba7a4]=_0x1b5df5?{'appcode':_0x2ba7a4,'env':_0x1b5df5}:{'appcode':_0x2ba7a4};}return{'apps':_0x3370cb,'defaultApp':_0x2de5b2[0x0]};}export function buildCanonicalProjectConfig(_0x5c886e,_0x81d426){const _0x3d9fd1=a169_0x483b99,{appCodes:appCodes=[],env:_0x5fc23d,metadata:_0x3c6b89}=_0x81d426,_0x279776={..._0x5c886e,..._0x3c6b89||{}};delete _0x279776['appcode'],delete _0x279776['app'];if(_0x5fc23d)_0x279776['env']=_0x5fc23d;else!_0x279776[_0x3d9fd1(0x208)]&&(_0x279776[_0x3d9fd1(0x208)]=DEFAULT_CONFIG_VALUES['env']);const _0x291444=buildCanonicalAppConfig(appCodes,_0x279776[_0x3d9fd1(0x208)]);return Object[_0x3d9fd1(0x201)](_0x291444)[_0x3d9fd1(0x1f5)]>0x0&&(_0x279776['apps']=_0x291444['apps'],_0x279776['defaultApp']=_0x291444[_0x3d9fd1(0x20f)]),_0x279776;}const LOCALE_MAP={'zh':a169_0x483b99(0x209),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a169_0x483b99(0x1fe),'en-us':'en-US','en_us':a169_0x483b99(0x1fe)};export function normalizeLocale(_0x1188a5){const _0xcbdfb7=a169_0x483b99;if(!_0x1188a5)return null;return LOCALE_MAP[_0x1188a5[_0xcbdfb7(0x1fb)]()]??null;}
1
+ const a169_0x324d85=a169_0x300e;(function(_0x4b4537,_0x516bf7){const _0x346677=a169_0x300e,_0x201a3c=_0x4b4537();while(!![]){try{const _0x409bbf=-parseInt(_0x346677(0x14c))/0x1*(-parseInt(_0x346677(0x15b))/0x2)+-parseInt(_0x346677(0x14b))/0x3+parseInt(_0x346677(0x152))/0x4*(parseInt(_0x346677(0x145))/0x5)+parseInt(_0x346677(0x159))/0x6+-parseInt(_0x346677(0x158))/0x7*(-parseInt(_0x346677(0x157))/0x8)+-parseInt(_0x346677(0x14f))/0x9*(-parseInt(_0x346677(0x141))/0xa)+parseInt(_0x346677(0x151))/0xb*(-parseInt(_0x346677(0x14e))/0xc);if(_0x409bbf===_0x516bf7)break;else _0x201a3c['push'](_0x201a3c['shift']());}catch(_0x414968){_0x201a3c['push'](_0x201a3c['shift']());}}}(a169_0x27b9,0x6f43e));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a169_0x27b9(){const _0x117246=['format','pageSize','number','filter','trim','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','defaultFormat','Risk\x20level','map','cookie','2869540MyVtMZ','length','has','entries','915xIeQKu','apiDir','string','Locale','appcode','env','1829577wUgAXo','8IDmdvx','zh-CN','4161396SZKVuK','9LiChRv','apps','55jyDBJV','15316AjGoaW','accessKey','defaultApp','Auth\x20cookie','Default\x20page\x20size','72EnNUTk','589365qlPPzt','3425976CRJRfa','riskLevel','120776eXoPxH','API\x20directory\x20path','inherit','en-US','app','locale','Access\x20key'];a169_0x27b9=function(){return _0x117246;};return a169_0x27b9();}import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a169_0x324d85(0x140),a169_0x324d85(0x153),a169_0x324d85(0x135),'format',a169_0x324d85(0x15a)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a169_0x324d85(0x149),a169_0x324d85(0x14a),a169_0x324d85(0x135),a169_0x324d85(0x137),a169_0x324d85(0x140),a169_0x324d85(0x153),a169_0x324d85(0x146)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x5ef5a7){return[..._0x5ef5a7]['join'](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3fac13){const _0x281021=a169_0x324d85;return TOP_LEVEL_CONFIG_KEYS[_0x281021(0x143)](_0x3fac13);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a169_0x324d85(0x14a),'apiDir':a169_0x324d85(0x146),'cookie':a169_0x324d85(0x140),'accessKey':'accessKey','defaultFormat':a169_0x324d85(0x137),'pageSize':a169_0x324d85(0x138),'riskLevel':'riskLevel','locale':a169_0x324d85(0x135)};export function getAppProfileFlagDefs(){const _0xde9679=a169_0x324d85;return[{'name':_0xde9679(0x14a),'type':_0xde9679(0x147),'description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0xde9679(0x146),'type':_0xde9679(0x147),'description':_0xde9679(0x15c)},{'name':_0xde9679(0x140),'type':_0xde9679(0x147),'description':_0xde9679(0x155),'hidden':!![]},{'name':_0xde9679(0x153),'type':_0xde9679(0x147),'description':_0xde9679(0x136),'hidden':!![]},{'name':_0xde9679(0x13d),'type':_0xde9679(0x147),'description':_0xde9679(0x13c),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0xde9679(0x138),'type':_0xde9679(0x139),'description':_0xde9679(0x156)},{'name':_0xde9679(0x15a),'type':_0xde9679(0x147),'description':_0xde9679(0x13e),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0xde9679(0x147),'description':_0xde9679(0x148)}];}export function collectAppProfileOverrides(_0x4cb7e0){const _0x96ee5d=a169_0x324d85,_0x7fcb6d={};for(const [_0x9ee015,_0x17d858]of Object[_0x96ee5d(0x144)](APP_PROFILE_FLAG_KEY_MAP)){const _0x524bba=_0x4cb7e0(_0x9ee015);if(!_0x524bba)continue;_0x7fcb6d[_0x17d858]=_0x17d858==='pageSize'?Number(_0x524bba):_0x524bba;}return _0x7fcb6d;}export function buildAppProfileListFields(_0x3aa739){const _0x423012=a169_0x324d85;return{'env':_0x3aa739['env']??null,'apiDir':_0x3aa739[_0x423012(0x146)]??null,'hasCookie':!!_0x3aa739[_0x423012(0x140)],'hasAccessKey':!!_0x3aa739[_0x423012(0x153)],'format':_0x3aa739[_0x423012(0x137)]??null,'pageSize':_0x3aa739[_0x423012(0x138)]??null,'riskLevel':_0x3aa739[_0x423012(0x15a)]??null,'locale':_0x3aa739['locale']??null};}export function buildAppDoctorFields(_0x14278e,_0x586da1){const _0x49c6b3=a169_0x324d85;return{'env':{'value':_0x14278e[_0x49c6b3(0x14a)]||_0x586da1[_0x49c6b3(0x14a)],'source':_0x14278e[_0x49c6b3(0x14a)]?_0x49c6b3(0x15f):_0x49c6b3(0x15d)},'apiDir':{'value':_0x14278e[_0x49c6b3(0x146)]||_0x586da1[_0x49c6b3(0x146)],'source':_0x14278e['apiDir']?_0x49c6b3(0x15f):'inherit'},'cookie':{'value':_0x14278e[_0x49c6b3(0x140)]||_0x586da1[_0x49c6b3(0x140)],'source':_0x14278e[_0x49c6b3(0x140)]?'app':_0x49c6b3(0x15d)},'accessKey':{'value':_0x14278e[_0x49c6b3(0x153)]||_0x586da1[_0x49c6b3(0x153)],'source':_0x14278e[_0x49c6b3(0x153)]?_0x49c6b3(0x15f):_0x49c6b3(0x15d)}};}export function buildCanonicalAppConfig(_0x16e65b,_0xdbfad1){const _0x26f0bd=a169_0x324d85,_0x3e6674=_0x16e65b[_0x26f0bd(0x13f)](_0x4a40a4=>String(_0x4a40a4||'')[_0x26f0bd(0x13b)]())[_0x26f0bd(0x13a)](Boolean);if(_0x3e6674[_0x26f0bd(0x142)]===0x0)return{};const _0x30cebb={};for(const _0xc18efc of _0x3e6674){_0x30cebb[_0xc18efc]=_0xdbfad1?{'appcode':_0xc18efc,'env':_0xdbfad1}:{'appcode':_0xc18efc};}return{'apps':_0x30cebb,'defaultApp':_0x3e6674[0x0]};}export function buildCanonicalProjectConfig(_0x371c55,_0x4f6adb){const _0x3694dd=a169_0x324d85,{appCodes:appCodes=[],env:_0x44c4c9,metadata:_0x5adcab}=_0x4f6adb,_0x38da93={..._0x371c55,..._0x5adcab||{}};delete _0x38da93['appcode'],delete _0x38da93[_0x3694dd(0x15f)];if(_0x44c4c9)_0x38da93[_0x3694dd(0x14a)]=_0x44c4c9;else!_0x38da93['env']&&(_0x38da93[_0x3694dd(0x14a)]=DEFAULT_CONFIG_VALUES[_0x3694dd(0x14a)]);const _0x3bc9d5=buildCanonicalAppConfig(appCodes,_0x38da93[_0x3694dd(0x14a)]);return Object['keys'](_0x3bc9d5)[_0x3694dd(0x142)]>0x0&&(_0x38da93[_0x3694dd(0x150)]=_0x3bc9d5[_0x3694dd(0x150)],_0x38da93[_0x3694dd(0x154)]=_0x3bc9d5[_0x3694dd(0x154)]),_0x38da93;}const LOCALE_MAP={'zh':a169_0x324d85(0x14d),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a169_0x324d85(0x15e),'en-us':'en-US','en_us':a169_0x324d85(0x15e)};function a169_0x300e(_0x1ec621,_0x47e6a4){_0x1ec621=_0x1ec621-0x135;const _0x27b97b=a169_0x27b9();let _0x300ee3=_0x27b97b[_0x1ec621];return _0x300ee3;}export function normalizeLocale(_0x4f7b3c){if(!_0x4f7b3c)return null;return LOCALE_MAP[_0x4f7b3c['toLowerCase']()]??null;}
@@ -1 +1 @@
1
- function a170_0xa027(){const _0x4a3a67=['137242ypEgFP','7ZCRTcR','4673034zlHcAK','14901795YFdQPS','97951GbFoan','1788cizaVE','840jqqveC','336mmVBbj','966YZEjgJ','47945bFaLat','10bjuvxQ','5885UuRCVA','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','140179FKaDmW','4kGgDBL'];a170_0xa027=function(){return _0x4a3a67;};return a170_0xa027();}const a170_0x2c8638=a170_0x1a13;(function(_0x1f605b,_0x5b0818){const _0xc33cbd=a170_0x1a13,_0x5f0206=_0x1f605b();while(!![]){try{const _0x19ce67=parseInt(_0xc33cbd(0x1a3))/0x1*(parseInt(_0xc33cbd(0x1a2))/0x2)+parseInt(_0xc33cbd(0x1a4))/0x3*(parseInt(_0xc33cbd(0x1b0))/0x4)+-parseInt(_0xc33cbd(0x1ab))/0x5*(parseInt(_0xc33cbd(0x1a8))/0x6)+parseInt(_0xc33cbd(0x1a6))/0x7*(-parseInt(_0xc33cbd(0x1a9))/0x8)+-parseInt(_0xc33cbd(0x1a5))/0x9*(-parseInt(_0xc33cbd(0x1ac))/0xa)+parseInt(_0xc33cbd(0x1ad))/0xb*(-parseInt(_0xc33cbd(0x1a7))/0xc)+-parseInt(_0xc33cbd(0x1af))/0xd*(parseInt(_0xc33cbd(0x1aa))/0xe);if(_0x19ce67===_0x5b0818)break;else _0x5f0206['push'](_0x5f0206['shift']());}catch(_0x5115ab){_0x5f0206['push'](_0x5f0206['shift']());}}}(a170_0xa027,0xe5760));function a170_0x1a13(_0x5c4572,_0x41a7b2){_0x5c4572=_0x5c4572-0x1a2;const _0xa0271d=a170_0xa027();let _0x1a13ac=_0xa0271d[_0x5c4572];return _0x1a13ac;}export const CLI_VERSION_POLICY_URL=a170_0x2c8638(0x1ae);
1
+ (function(_0x2fda86,_0x22e2e1){const _0x4b6c90=a170_0x55a0,_0x383f31=_0x2fda86();while(!![]){try{const _0x20b492=-parseInt(_0x4b6c90(0xb9))/0x1+-parseInt(_0x4b6c90(0xbf))/0x2*(parseInt(_0x4b6c90(0xbe))/0x3)+-parseInt(_0x4b6c90(0xc2))/0x4+parseInt(_0x4b6c90(0xc0))/0x5+parseInt(_0x4b6c90(0xbd))/0x6+-parseInt(_0x4b6c90(0xc1))/0x7*(parseInt(_0x4b6c90(0xbc))/0x8)+-parseInt(_0x4b6c90(0xbb))/0x9*(-parseInt(_0x4b6c90(0xba))/0xa);if(_0x20b492===_0x22e2e1)break;else _0x383f31['push'](_0x383f31['shift']());}catch(_0x35a42b){_0x383f31['push'](_0x383f31['shift']());}}}(a170_0x42e4,0x281a2));export const CLI_VERSION_POLICY_URL='https://g.lovrabet.com/dist/rabetbase-cli/config/index.json';function a170_0x55a0(_0x26209d,_0x338ba6){_0x26209d=_0x26209d-0xb9;const _0x42e4aa=a170_0x42e4();let _0x55a076=_0x42e4aa[_0x26209d];return _0x55a076;}function a170_0x42e4(){const _0x4e6185=['13533cWKOoJ','142XNgENQ','71080qtuHbR','14Pdyian','277964glkSqk','145279IVafHJ','8628820PUiLCB','9NLSxdn','1101496fcbSsm','585510uOaUfa'];a170_0x42e4=function(){return _0x4e6185;};return a170_0x42e4();}