@lovrabet/rabetbase-cli 2.1.8 → 2.1.10-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) 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/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.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/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/delete.js +1 -1
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/field-update.js +1 -0
  54. package/lib/commands/dataset/index.js +1 -1
  55. package/lib/commands/dataset/link-create.js +1 -1
  56. package/lib/commands/dataset/link-delete.js +1 -1
  57. package/lib/commands/dataset/link-shared.js +1 -1
  58. package/lib/commands/dataset/link-update.js +1 -1
  59. package/lib/commands/dataset/links.js +1 -1
  60. package/lib/commands/dataset/list.js +1 -1
  61. package/lib/commands/dataset/operations.js +1 -1
  62. package/lib/commands/db/analyze-cancel.js +1 -1
  63. package/lib/commands/db/analyze-start.js +1 -1
  64. package/lib/commands/db/analyze-status.js +1 -1
  65. package/lib/commands/db/create.js +1 -1
  66. package/lib/commands/db/delete.js +1 -1
  67. package/lib/commands/db/detail.js +1 -1
  68. package/lib/commands/db/diff.js +1 -1
  69. package/lib/commands/db/index.js +1 -1
  70. package/lib/commands/db/list.js +1 -1
  71. package/lib/commands/db/shared.js +1 -1
  72. package/lib/commands/db/tables.js +1 -1
  73. package/lib/commands/db/test.js +1 -1
  74. package/lib/commands/db/update.js +1 -1
  75. package/lib/commands/doctor.js +1 -1
  76. package/lib/commands/init/index.js +1 -1
  77. package/lib/commands/issue/index.js +1 -1
  78. package/lib/commands/issue/report.js +1 -1
  79. package/lib/commands/logs/index.js +1 -1
  80. package/lib/commands/menu/index.js +1 -1
  81. package/lib/commands/menu/shared/compare-table.js +1 -1
  82. package/lib/commands/menu/shared/index.js +1 -1
  83. package/lib/commands/menu/shared/inquirer.js +1 -1
  84. package/lib/commands/menu/shared/local-pages.js +1 -1
  85. package/lib/commands/menu/shared/logic.js +1 -1
  86. package/lib/commands/menu/shared/service.js +1 -1
  87. package/lib/commands/menu/shared/sync-core.js +1 -1
  88. package/lib/commands/menu/shared/update-core.js +1 -1
  89. package/lib/commands/menu/shared/valid-url.js +1 -1
  90. package/lib/commands/menu/sync.js +1 -1
  91. package/lib/commands/menu/update.js +1 -1
  92. package/lib/commands/page/generate-start.js +1 -1
  93. package/lib/commands/page/generate-status.js +1 -1
  94. package/lib/commands/page/index.js +1 -1
  95. package/lib/commands/page/pull.js +1 -1
  96. package/lib/commands/page/push.js +1 -1
  97. package/lib/commands/page/shared.js +1 -1
  98. package/lib/commands/page/standard-page-status.js +1 -1
  99. package/lib/commands/page/sync.js +1 -1
  100. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  101. package/lib/commands/project/create/format-elapsed.js +1 -1
  102. package/lib/commands/project/create/main.js +1 -1
  103. package/lib/commands/project/create/non-interactive.js +1 -1
  104. package/lib/commands/project/create/project-template-path.js +1 -1
  105. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  106. package/lib/commands/project/create/use-format-code.js +1 -1
  107. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  108. package/lib/commands/project/index.js +1 -1
  109. package/lib/commands/project/init.js +1 -1
  110. package/lib/commands/project/upgrade.js +1 -1
  111. package/lib/commands/registry.js +1 -1
  112. package/lib/commands/run/index.js +1 -1
  113. package/lib/commands/schema.js +1 -1
  114. package/lib/commands/skill/index.js +1 -1
  115. package/lib/commands/sql/create.js +1 -1
  116. package/lib/commands/sql/delete.js +1 -1
  117. package/lib/commands/sql/detail.js +1 -1
  118. package/lib/commands/sql/exec.js +1 -1
  119. package/lib/commands/sql/index.js +1 -1
  120. package/lib/commands/sql/list.js +1 -1
  121. package/lib/commands/sql/pull.js +1 -1
  122. package/lib/commands/sql/push.js +1 -1
  123. package/lib/commands/sql/save.js +1 -1
  124. package/lib/commands/sql/shared.js +1 -1
  125. package/lib/commands/sql/status.js +1 -1
  126. package/lib/commands/sql/validate.js +1 -1
  127. package/lib/config/schema.js +1 -1
  128. package/lib/constant/cdn.js +1 -1
  129. package/lib/constant/cli.js +1 -1
  130. package/lib/constant/defaults.js +1 -1
  131. package/lib/constant/domain.js +1 -1
  132. package/lib/constant/env.js +1 -1
  133. package/lib/constant/output.js +1 -1
  134. package/lib/constant/paths.js +1 -1
  135. package/lib/constant/risk.js +1 -1
  136. package/lib/context.js +1 -1
  137. package/lib/core/alias-resolver.js +1 -1
  138. package/lib/core/api-client.js +1 -1
  139. package/lib/core/bff/config.js +1 -1
  140. package/lib/core/bff/file-system.js +1 -1
  141. package/lib/core/bff/hash.js +1 -1
  142. package/lib/core/bff/lock.js +1 -1
  143. package/lib/core/bff/utils.js +1 -1
  144. package/lib/core/db-resolver.js +1 -1
  145. package/lib/core/page/file-system.js +1 -1
  146. package/lib/core/page/hash.js +1 -1
  147. package/lib/core/page/lock.js +1 -1
  148. package/lib/core/sql-sync/config.js +1 -1
  149. package/lib/core/sql-sync/file-system.js +1 -1
  150. package/lib/core/sql-sync/hash.js +1 -1
  151. package/lib/core/sql-sync/lock.js +1 -1
  152. package/lib/core/sql-sync/utils.js +1 -1
  153. package/lib/core/sql-validator.js +1 -1
  154. package/lib/errors.js +1 -1
  155. package/lib/framework/build-all-flags.js +1 -1
  156. package/lib/framework/flags.js +1 -1
  157. package/lib/framework/help.js +1 -1
  158. package/lib/framework/index.js +1 -1
  159. package/lib/framework/output.js +1 -1
  160. package/lib/framework/response.js +1 -1
  161. package/lib/framework/runner-alias.js +1 -1
  162. package/lib/framework/runner.js +1 -1
  163. package/lib/framework/schema-export.js +1 -1
  164. package/lib/framework/types.js +1 -1
  165. package/lib/generated/build-info.js +1 -1
  166. package/lib/help.js +1 -1
  167. package/lib/skills/main.js +1 -1
  168. package/lib/skills/npx-skills-add.js +1 -1
  169. package/lib/telemetry/cli-command-trace.js +1 -1
  170. package/lib/telemetry/cli-help-trace.js +1 -1
  171. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  172. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  173. package/lib/telemetry/send-cli-trace-log.js +1 -1
  174. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  175. package/lib/utils/ai_config.js +1 -1
  176. package/lib/utils/apply-jq-filter.js +1 -1
  177. package/lib/utils/cdn-config.js +1 -1
  178. package/lib/utils/check-sdk-version.js +1 -1
  179. package/lib/utils/cli-version-check.js +1 -1
  180. package/lib/utils/cli-version-policy.js +1 -1
  181. package/lib/utils/config.js +1 -1
  182. package/lib/utils/copy-directory.js +1 -1
  183. package/lib/utils/entity-with-id.js +1 -1
  184. package/lib/utils/file-utils.js +1 -1
  185. package/lib/utils/guides-cdn.js +1 -1
  186. package/lib/utils/http-client.js +1 -1
  187. package/lib/utils/is-non-interactive.js +1 -1
  188. package/lib/utils/logger.js +1 -1
  189. package/lib/utils/params.js +1 -1
  190. package/lib/utils/platform.js +1 -1
  191. package/lib/utils/rules-cdn.js +1 -1
  192. package/lib/utils/sleep.js +1 -1
  193. package/lib/utils/template-replacer.js +1 -1
  194. package/lib/utils/version.js +1 -1
  195. package/lib/utils/with-active-cookie.js +1 -1
  196. package/lib/utils/write-cli-side-channel.js +1 -1
  197. package/package.json +1 -1
@@ -1 +1 @@
1
- const a121_0x4585ee=a121_0x28f9;(function(_0x3525b5,_0x771c74){const _0xe869a6=a121_0x28f9,_0x57e2bf=_0x3525b5();while(!![]){try{const _0x1e7a24=parseInt(_0xe869a6(0xec))/0x1*(-parseInt(_0xe869a6(0x10d))/0x2)+parseInt(_0xe869a6(0x115))/0x3+-parseInt(_0xe869a6(0xfa))/0x4*(-parseInt(_0xe869a6(0x107))/0x5)+parseInt(_0xe869a6(0x102))/0x6+parseInt(_0xe869a6(0x10a))/0x7*(parseInt(_0xe869a6(0xfe))/0x8)+-parseInt(_0xe869a6(0x10e))/0x9*(parseInt(_0xe869a6(0x100))/0xa)+-parseInt(_0xe869a6(0xff))/0xb;if(_0x1e7a24===_0x771c74)break;else _0x57e2bf['push'](_0x57e2bf['shift']());}catch(_0x1d00b9){_0x57e2bf['push'](_0x57e2bf['shift']());}}}(a121_0x468e,0x6fef9));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';function a121_0x28f9(_0x42ac03,_0xca87a6){_0x42ac03=_0x42ac03-0xe4;const _0x468e67=a121_0x468e();let _0x28f9b1=_0x468e67[_0x42ac03];return _0x28f9b1;}import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x246cfe,_0x36ec73,_0x5e8609){const _0x1a0e65=a121_0x28f9,_0x4eaf99=await scanLocalSqlQueries(_0x246cfe),_0x2d6fc7=new Map();for(const _0x3481ad of _0x4eaf99){if(_0x5e8609&&_0x3481ad[_0x1a0e65(0xf7)]!==_0x5e8609)continue;const _0x5a213e=_0x2d6fc7[_0x1a0e65(0xfd)](_0x3481ad[_0x1a0e65(0xf7)])??[];_0x5a213e['push'](_0x3481ad),_0x2d6fc7[_0x1a0e65(0x11d)](_0x3481ad[_0x1a0e65(0xf7)],_0x5a213e);}if(_0x5e8609&&!_0x2d6fc7['has'](_0x5e8609))throw CliErrors[_0x1a0e65(0xf5)](_0x1a0e65(0xf6)+_0x5e8609);const _0xb350ad=[];for(const [_0x35fdc1,_0x826910]of _0x2d6fc7['entries']()){if(_0x826910[_0x1a0e65(0x103)]===0x1){_0xb350ad[_0x1a0e65(0xeb)](_0x826910[0x0]);continue;}const _0x2c3152=_0x36ec73[_0x1a0e65(0x104)][_0x35fdc1],_0x1ebb53=_0x2c3152?.[_0x1a0e65(0xf0)],_0xc9afd0=_0x1ebb53?_0x826910[_0x1a0e65(0xf9)](_0x5b8d46=>_0x5b8d46['relativePath']!==_0x1ebb53):_0x826910;if(_0x2c3152&&_0xc9afd0[_0x1a0e65(0x103)]===0x1){_0xb350ad['push'](_0xc9afd0[0x0]);continue;}throw CliErrors[_0x1a0e65(0xf5)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x35fdc1+_0x1a0e65(0x11b));}return _0xb350ad;}export const sqlPush={'service':'sql','command':a121_0x4585ee(0xeb),'description':a121_0x4585ee(0x113),'risk':a121_0x4585ee(0xe7),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x4585ee(0x10f),'type':a121_0x4585ee(0x120),'description':a121_0x4585ee(0x106)}],async 'dryRun'(_0x2c6d27){const _0xe8d0d=a121_0x4585ee,_0x324e15=loadSqlProjectConfig(_0x2c6d27[_0xe8d0d(0x121)]),_0x361af9=await readSqlLockFile(_0x324e15[_0xe8d0d(0xe5)]),{appLock:_0x408030}=ensureSqlLockScope(_0x361af9??createEmptySqlLock(),_0x2c6d27[_0xe8d0d(0x121)],_0x324e15[_0xe8d0d(0x11f)],_0xe8d0d(0xeb)),_0x1b29bd=await getTargetSqlQueries(_0x324e15,_0x408030,_0x2c6d27[_0xe8d0d(0xe9)]('sqlcode')||undefined),_0x49ac3d=[];for(const _0x4cfed9 of _0x1b29bd){const _0x567079=await computeSqlFileHash(_0x4cfed9[_0xe8d0d(0xe8)]),_0x3032c1=_0x408030[_0xe8d0d(0x104)][_0x4cfed9[_0xe8d0d(0xf7)]],_0xf53ca6=!!_0x3032c1&&(_0x3032c1[_0xe8d0d(0xf0)]!==_0x4cfed9[_0xe8d0d(0x108)]||!!_0x4cfed9[_0xe8d0d(0x110)]&&_0x3032c1[_0xe8d0d(0x110)]!==_0x4cfed9[_0xe8d0d(0x110)]);if(!_0x2c6d27['bool'](_0xe8d0d(0x10f))&&_0x3032c1&&_0x3032c1[_0xe8d0d(0x114)]===_0x567079&&!_0xf53ca6)continue;_0x49ac3d['push'](_0x4cfed9[_0xe8d0d(0xf7)]);}return{'method':_0xe8d0d(0x109),'url':_0xe8d0d(0xee),'body':{'sqlCodes':_0x49ac3d,'appCode':_0x2c6d27[_0xe8d0d(0x121)]},'description':'Would\x20push\x20'+_0x49ac3d[_0xe8d0d(0x103)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x5cd0d1){const _0x5a413f=a121_0x4585ee,_0x1e81c4=loadSqlProjectConfig(_0x5cd0d1[_0x5a413f(0x121)]),_0x1859fe=await readSqlLockFile(_0x1e81c4['lockFilePath']),{lockData:_0x127585,appLock:_0x35f708}=ensureSqlLockScope(_0x1859fe??createEmptySqlLock(),_0x5cd0d1[_0x5a413f(0x121)],_0x1e81c4['sqlRoot'],_0x5a413f(0xeb)),_0x2f12da=await getTargetSqlQueries(_0x1e81c4,_0x35f708,_0x5cd0d1['str']('sqlcode')||undefined);if(_0x2f12da[_0x5a413f(0x103)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x5a413f(0x11c)};const _0xdc2b2c=[],_0x20ccea=[],_0x3b2e1b=[];for(const _0x357d38 of _0x2f12da){const _0x3355ea=_0x35f708['sqls'][_0x357d38['sqlCode']];if(!_0x3355ea){_0x3b2e1b['push']({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x4dc014=await computeSqlFileHash(_0x357d38[_0x5a413f(0xe8)]),_0x4040b7=_0x3355ea[_0x5a413f(0xf0)]!==_0x357d38['relativePath']||!!_0x357d38[_0x5a413f(0x110)]&&_0x3355ea['sqlName']!==_0x357d38['sqlName'];if(!_0x5cd0d1['bool'](_0x5a413f(0x10f))&&_0x3355ea[_0x5a413f(0x114)]===_0x4dc014&&!_0x4040b7){_0x20ccea[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'reason':_0x5a413f(0xe6)});continue;}if(_0x3355ea[_0x5a413f(0xf3)]==null){_0x3b2e1b[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':_0x5a413f(0xf2)});continue;}const _0x396d16=await readFile(_0x357d38[_0x5a413f(0xe8)],'utf8'),_0x24fec9=stripLocalSqlMetadata(_0x396d16,_0x357d38['mode']),_0x3cd0e1=_0x357d38['sqlName']||_0x3355ea['sqlName'],_0x13345f=await resolveTargetDbBinding(_0x5cd0d1[_0x5a413f(0x121)],_0x357d38,_0x3355ea),_0x352b77=await updateSqlQuery({'id':_0x3355ea[_0x5a413f(0x10b)],'appCode':_0x5cd0d1[_0x5a413f(0x121)],'sqlCode':_0x357d38[_0x5a413f(0xf7)],'sqlName':_0x3cd0e1,'dbId':_0x13345f[_0x5a413f(0x105)],'version':_0x3355ea[_0x5a413f(0xf3)],'sqlContent':_0x24fec9,'sqlConfig':_0x3355ea[_0x5a413f(0x111)]??undefined}),_0x217310=_0x352b77[_0x5a413f(0x105)]?await getDbName(_0x5cd0d1['appCode'],Number(_0x352b77[_0x5a413f(0x105)]))[_0x5a413f(0xfc)](()=>_0x13345f[_0x5a413f(0x10c)]):_0x13345f['dbName'];_0x35f708[_0x5a413f(0x104)][_0x357d38[_0x5a413f(0xf7)]]={...buildSqlLockEntry(_0x352b77,_0x24fec9,_0x4dc014,{'dbName':_0x217310}),'path':_0x357d38[_0x5a413f(0x108)],'mode':_0x3355ea[_0x5a413f(0x112)]},await archivePreviousSqlFileIfNeeded(_0x1e81c4,_0x3355ea['path'],_0x357d38['relativePath']),_0xdc2b2c[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'remoteId':_0x3355ea['remoteId']});}catch(_0x25c779){_0x3b2e1b[_0x5a413f(0xeb)]({'sqlCode':_0x357d38[_0x5a413f(0xf7)],'error':_0x25c779 instanceof Error?_0x25c779[_0x5a413f(0xe4)]:String(_0x25c779)});}}return _0x35f708[_0x5a413f(0xed)]=new Date()[_0x5a413f(0x119)](),await writeSqlLockFile(_0x1e81c4[_0x5a413f(0xe5)],_0x127585),{'ok':_0x3b2e1b[_0x5a413f(0x103)]===0x0,'data':{'pushed':_0xdc2b2c,'skipped':_0x20ccea,'failed':_0x3b2e1b},'message':_0x5a413f(0x116)+_0xdc2b2c[_0x5a413f(0x103)]+'\x20pushed,\x20'+_0x20ccea['length']+_0x5a413f(0xef)+_0x3b2e1b[_0x5a413f(0x103)]+'\x20failed'};}};function a121_0x468e(){const _0x34d3f7=['str','sqlRootDir','push','3tsvDEP','lastSync','/smartapi/custom/updateUserCustomSql','\x20skipped,\x20','path','replace','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','version','startsWith','validation','Local\x20SQL\x20not\x20found:\x20','sqlCode','exec','filter','88OUwjim','trashDir','catch','get','6184tGRoQP','4528018Lmjbpu','60STAmuH','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','1448178PcuxnH','length','sqls','dbId','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','13415CAAtIl','relativePath','POST','7581gQNKcq','remoteId','dbName','125318YmalDQ','841959IepVrX','force','sqlName','sqlConfig','mode','Push\x20local\x20SQL\x20files\x20to\x20remote','hash','1445586kYiZLp','Push\x20complete:\x20','Local\x20directory\x20\x22','dbDirectory','toISOString','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','No\x20local\x20SQL\x20files\x20found.','set','join','sqlRoot','boolean','appCode','message','lockFilePath','unchanged','high-risk-write','filePath'];a121_0x468e=function(){return _0x34d3f7;};return a121_0x468e();}async function archivePreviousSqlFileIfNeeded(_0x5bc858,_0x47265f,_0x490480){const _0x46ae6c=a121_0x4585ee;if(!_0x47265f||_0x47265f===_0x490480)return;const _0xc2d39d=join(_0x5bc858[_0x46ae6c(0xea)],_0x47265f);if(!await fileExists(_0xc2d39d))return;const _0x29a683=await moveToTrash(_0x5bc858['projectRoot'],_0x5bc858[_0x46ae6c(0xfb)],_0xc2d39d);await cleanupEmptyDirectories(dirname(_0xc2d39d),_0x5bc858[_0x46ae6c(0xea)]),void _0x29a683;}async function moveToTrash(_0x4e2b91,_0x1ea841,_0x3b46ce){const _0x4dee21=a121_0x4585ee,_0xb02742=new Date()[_0x4dee21(0x119)]()[_0x4dee21(0xf1)](/[:.]/g,'-'),_0x329d45=relative(_0x4e2b91,_0x3b46ce),_0x154d63=join(_0x1ea841,_0xb02742,_0x329d45);return await mkdir(dirname(_0x154d63),{'recursive':!![]}),await rename(_0x3b46ce,_0x154d63),_0x154d63;}async function cleanupEmptyDirectories(_0x4134ed,_0xa975b4){const _0x28e386=a121_0x4585ee;let _0x16429c=resolve(_0x4134ed);const _0xb1d4e3=resolve(_0xa975b4);while(_0x16429c[_0x28e386(0xf4)](''+_0xb1d4e3+sep)||_0x16429c===_0xb1d4e3){if(_0x16429c===_0xb1d4e3)return;try{const _0xe57b59=await readdir(_0x16429c);if(_0xe57b59['length']>0x0)return;await rmdir(_0x16429c);}catch{return;}_0x16429c=dirname(_0x16429c);}}async function resolveTargetDbBinding(_0x1da415,_0x29533e,_0x339fc4){const _0x27fb2a=a121_0x4585ee,_0x5a292f=_0x29533e[_0x27fb2a(0x118)];if(!_0x5a292f)return{'dbId':_0x339fc4[_0x27fb2a(0x105)],'dbName':_0x339fc4['dbName']};const _0x1b19b9=buildDbDirectoryName(_0x339fc4[_0x27fb2a(0x10c)],_0x339fc4[_0x27fb2a(0x105)]);if(_0x5a292f===_0x1b19b9)return{'dbId':_0x339fc4[_0x27fb2a(0x105)],'dbName':_0x339fc4['dbName']};const _0x263195=parseExplicitDbDirectory(_0x5a292f);if(_0x263195!=null)return{'dbId':_0x263195,'dbName':await getDbName(_0x1da415,_0x263195)[_0x27fb2a(0xfc)](()=>undefined)};const _0x50727d=await listDatabases(_0x1da415),_0x238885=_0x50727d['filter'](_0x4a07a4=>buildDbDirectoryName(_0x4a07a4['dbName'],_0x4a07a4['dbId'])===_0x5a292f);if(_0x238885[_0x27fb2a(0x103)]===0x1)return{'dbId':_0x238885[0x0][_0x27fb2a(0x105)],'dbName':_0x238885[0x0]['dbName']};if(_0x238885[_0x27fb2a(0x103)]===0x0)throw CliErrors['validation']('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x5a292f+_0x27fb2a(0x11a)+_0x29533e[_0x27fb2a(0xf7)]+'.');const _0x15b208=_0x238885['map'](_0x903cb3=>_0x903cb3[_0x27fb2a(0x10c)]+'\x20('+_0x903cb3[_0x27fb2a(0x105)]+')')[_0x27fb2a(0x11e)](',\x20');throw CliErrors[_0x27fb2a(0xf5)](_0x27fb2a(0x117)+_0x5a292f+_0x27fb2a(0x101)+_0x29533e[_0x27fb2a(0xf7)]+':\x20'+_0x15b208);}function parseExplicitDbDirectory(_0x2aeb50){const _0x16be5a=a121_0x4585ee,_0x17c8a0=/^db-(\d+)$/[_0x16be5a(0xf8)](_0x2aeb50);if(!_0x17c8a0)return null;const _0x1b0f4a=Number(_0x17c8a0[0x1]);return Number['isFinite'](_0x1b0f4a)&&_0x1b0f4a>0x0?_0x1b0f4a:null;}
1
+ const a122_0x282861=a122_0x1326;(function(_0x15ff88,_0x5e5760){const _0x2f190d=a122_0x1326,_0x5b8b2e=_0x15ff88();while(!![]){try{const _0x2fa933=parseInt(_0x2f190d(0x1d0))/0x1*(parseInt(_0x2f190d(0x1b4))/0x2)+parseInt(_0x2f190d(0x1b1))/0x3*(-parseInt(_0x2f190d(0x1bc))/0x4)+parseInt(_0x2f190d(0x1a3))/0x5*(parseInt(_0x2f190d(0x1d5))/0x6)+parseInt(_0x2f190d(0x1c6))/0x7+-parseInt(_0x2f190d(0x19e))/0x8*(-parseInt(_0x2f190d(0x1cd))/0x9)+-parseInt(_0x2f190d(0x19d))/0xa+-parseInt(_0x2f190d(0x1bf))/0xb;if(_0x2fa933===_0x5e5760)break;else _0x5b8b2e['push'](_0x5b8b2e['shift']());}catch(_0x14fdbc){_0x5b8b2e['push'](_0x5b8b2e['shift']());}}}(a122_0x56dc,0xba4f3));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';function a122_0x56dc(){const _0x391e23=['force','39ZDTqQo','unchanged','validation','6TUauKs','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','Would\x20push\x20','message','relativePath','lastSync','path','filter','340808ZclKUs','set','lockFilePath','6040452rIElww','bool','sqlRootDir','version','Local\x20SQL\x20not\x20found:\x20','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','dbName','1329328jSGdFT','dbDirectory','sqlName','appCode','No\x20database\x20matches\x20local\x20directory\x20\x22','sqlCode','mode','9KndvpS','remoteId','dbId','92212ttSubs','\x20SQL\x20file(s)','replace','toISOString','Push\x20complete:\x20','150XzuNdd','sqlcode','trashDir','push','\x20skipped,\x20','hash','\x20pushed,\x20','3765070JQLkvc','10357784NGhHFB','filePath','boolean','sql','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','207025Dluopj','\x22\x20for\x20sqlCode\x20','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','/smartapi/custom/updateUserCustomSql','utf8','sqls','has','get','str','length','sqlConfig','POST','sqlRoot'];a122_0x56dc=function(){return _0x391e23;};return a122_0x56dc();}import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x5ea487,_0x1f656f,_0x7f2780){const _0x5f0b36=a122_0x1326,_0x291963=await scanLocalSqlQueries(_0x5ea487),_0x274825=new Map();for(const _0x267858 of _0x291963){if(_0x7f2780&&_0x267858['sqlCode']!==_0x7f2780)continue;const _0x560b9c=_0x274825[_0x5f0b36(0x1aa)](_0x267858[_0x5f0b36(0x1cb)])??[];_0x560b9c[_0x5f0b36(0x1d8)](_0x267858),_0x274825[_0x5f0b36(0x1bd)](_0x267858[_0x5f0b36(0x1cb)],_0x560b9c);}if(_0x7f2780&&!_0x274825[_0x5f0b36(0x1a9)](_0x7f2780))throw CliErrors['validation'](_0x5f0b36(0x1c3)+_0x7f2780);const _0x5ef86d=[];for(const [_0x10aae8,_0x191f8f]of _0x274825['entries']()){if(_0x191f8f[_0x5f0b36(0x1ac)]===0x1){_0x5ef86d[_0x5f0b36(0x1d8)](_0x191f8f[0x0]);continue;}const _0x26f993=_0x1f656f[_0x5f0b36(0x1a8)][_0x10aae8],_0x79c2df=_0x26f993?.['path'],_0x262fee=_0x79c2df?_0x191f8f[_0x5f0b36(0x1bb)](_0x520b81=>_0x520b81['relativePath']!==_0x79c2df):_0x191f8f;if(_0x26f993&&_0x262fee[_0x5f0b36(0x1ac)]===0x1){_0x5ef86d[_0x5f0b36(0x1d8)](_0x262fee[0x0]);continue;}throw CliErrors[_0x5f0b36(0x1b3)]('Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20'+_0x10aae8+_0x5f0b36(0x1a5));}return _0x5ef86d;}export const sqlPush={'service':a122_0x282861(0x1a1),'command':a122_0x282861(0x1d8),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':'high-risk-write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0x282861(0x1b0),'type':a122_0x282861(0x1a0),'description':a122_0x282861(0x1c4)}],async 'dryRun'(_0x4041a5){const _0x2de754=a122_0x282861,_0x488f99=loadSqlProjectConfig(_0x4041a5['appCode']),_0x30c6ee=await readSqlLockFile(_0x488f99[_0x2de754(0x1be)]),{appLock:_0x2a8bc5}=ensureSqlLockScope(_0x30c6ee??createEmptySqlLock(),_0x4041a5['appCode'],_0x488f99[_0x2de754(0x1af)],_0x2de754(0x1d8)),_0x5c1eb3=await getTargetSqlQueries(_0x488f99,_0x2a8bc5,_0x4041a5[_0x2de754(0x1ab)](_0x2de754(0x1d6))||undefined),_0x3e16be=[];for(const _0x24a784 of _0x5c1eb3){const _0x163f7a=await computeSqlFileHash(_0x24a784[_0x2de754(0x19f)]),_0xc1c69d=_0x2a8bc5[_0x2de754(0x1a8)][_0x24a784[_0x2de754(0x1cb)]],_0x2f8d4b=!!_0xc1c69d&&(_0xc1c69d[_0x2de754(0x1ba)]!==_0x24a784[_0x2de754(0x1b8)]||!!_0x24a784['sqlName']&&_0xc1c69d[_0x2de754(0x1c8)]!==_0x24a784[_0x2de754(0x1c8)]);if(!_0x4041a5['bool'](_0x2de754(0x1b0))&&_0xc1c69d&&_0xc1c69d['hash']===_0x163f7a&&!_0x2f8d4b)continue;_0x3e16be[_0x2de754(0x1d8)](_0x24a784[_0x2de754(0x1cb)]);}return{'method':_0x2de754(0x1ae),'url':_0x2de754(0x1a6),'body':{'sqlCodes':_0x3e16be,'appCode':_0x4041a5['appCode']},'description':_0x2de754(0x1b6)+_0x3e16be[_0x2de754(0x1ac)]+_0x2de754(0x1d1)};},async 'execute'(_0x2c4c18){const _0xcf602=a122_0x282861,_0x2fb0ad=loadSqlProjectConfig(_0x2c4c18[_0xcf602(0x1c9)]),_0x1f6d4b=await readSqlLockFile(_0x2fb0ad[_0xcf602(0x1be)]),{lockData:_0x318068,appLock:_0x26f09b}=ensureSqlLockScope(_0x1f6d4b??createEmptySqlLock(),_0x2c4c18[_0xcf602(0x1c9)],_0x2fb0ad['sqlRoot'],_0xcf602(0x1d8)),_0x77cf14=await getTargetSqlQueries(_0x2fb0ad,_0x26f09b,_0x2c4c18[_0xcf602(0x1ab)]('sqlcode')||undefined);if(_0x77cf14[_0xcf602(0x1ac)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x215276=[],_0x33da16=[],_0x1eb4c6=[];for(const _0x48885c of _0x77cf14){const _0x3374b3=_0x26f09b[_0xcf602(0x1a8)][_0x48885c[_0xcf602(0x1cb)]];if(!_0x3374b3){_0x1eb4c6[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':_0xcf602(0x1a2)});continue;}try{const _0x40d2f2=await computeSqlFileHash(_0x48885c['filePath']),_0x5c7b48=_0x3374b3[_0xcf602(0x1ba)]!==_0x48885c[_0xcf602(0x1b8)]||!!_0x48885c[_0xcf602(0x1c8)]&&_0x3374b3[_0xcf602(0x1c8)]!==_0x48885c[_0xcf602(0x1c8)];if(!_0x2c4c18[_0xcf602(0x1c0)](_0xcf602(0x1b0))&&_0x3374b3[_0xcf602(0x19b)]===_0x40d2f2&&!_0x5c7b48){_0x33da16[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'reason':_0xcf602(0x1b2)});continue;}if(_0x3374b3[_0xcf602(0x1c2)]==null){_0x1eb4c6[_0xcf602(0x1d8)]({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x50850e=await readFile(_0x48885c[_0xcf602(0x19f)],_0xcf602(0x1a7)),_0x15b87b=stripLocalSqlMetadata(_0x50850e,_0x48885c[_0xcf602(0x1cc)]),_0x5d896a=_0x48885c[_0xcf602(0x1c8)]||_0x3374b3[_0xcf602(0x1c8)],_0x1f9a3d=await resolveTargetDbBinding(_0x2c4c18['appCode'],_0x48885c,_0x3374b3),_0x393ddc=await updateSqlQuery({'id':_0x3374b3[_0xcf602(0x1ce)],'appCode':_0x2c4c18[_0xcf602(0x1c9)],'sqlCode':_0x48885c[_0xcf602(0x1cb)],'sqlName':_0x5d896a,'dbId':_0x1f9a3d[_0xcf602(0x1cf)],'version':_0x3374b3['version'],'sqlContent':_0x15b87b,'sqlConfig':_0x3374b3[_0xcf602(0x1ad)]??undefined}),_0x5f092c=_0x393ddc[_0xcf602(0x1cf)]?await getDbName(_0x2c4c18['appCode'],Number(_0x393ddc[_0xcf602(0x1cf)]))['catch'](()=>_0x1f9a3d['dbName']):_0x1f9a3d[_0xcf602(0x1c5)];_0x26f09b[_0xcf602(0x1a8)][_0x48885c[_0xcf602(0x1cb)]]={...buildSqlLockEntry(_0x393ddc,_0x15b87b,_0x40d2f2,{'dbName':_0x5f092c}),'path':_0x48885c[_0xcf602(0x1b8)],'mode':_0x3374b3[_0xcf602(0x1cc)]},await archivePreviousSqlFileIfNeeded(_0x2fb0ad,_0x3374b3[_0xcf602(0x1ba)],_0x48885c['relativePath']),_0x215276[_0xcf602(0x1d8)]({'sqlCode':_0x48885c['sqlCode'],'remoteId':_0x3374b3['remoteId']});}catch(_0x49537a){_0x1eb4c6['push']({'sqlCode':_0x48885c[_0xcf602(0x1cb)],'error':_0x49537a instanceof Error?_0x49537a[_0xcf602(0x1b7)]:String(_0x49537a)});}}return _0x26f09b[_0xcf602(0x1b9)]=new Date()[_0xcf602(0x1d3)](),await writeSqlLockFile(_0x2fb0ad['lockFilePath'],_0x318068),{'ok':_0x1eb4c6['length']===0x0,'data':{'pushed':_0x215276,'skipped':_0x33da16,'failed':_0x1eb4c6},'message':_0xcf602(0x1d4)+_0x215276[_0xcf602(0x1ac)]+_0xcf602(0x19c)+_0x33da16[_0xcf602(0x1ac)]+_0xcf602(0x19a)+_0x1eb4c6[_0xcf602(0x1ac)]+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x15f991,_0x31bfd7,_0x55ff0f){const _0x3e6d06=a122_0x282861;if(!_0x31bfd7||_0x31bfd7===_0x55ff0f)return;const _0x3e9758=join(_0x15f991[_0x3e6d06(0x1c1)],_0x31bfd7);if(!await fileExists(_0x3e9758))return;const _0x1f2bbc=await moveToTrash(_0x15f991['projectRoot'],_0x15f991[_0x3e6d06(0x1d7)],_0x3e9758);await cleanupEmptyDirectories(dirname(_0x3e9758),_0x15f991[_0x3e6d06(0x1c1)]),void _0x1f2bbc;}async function moveToTrash(_0x5f399d,_0x5894f4,_0x26aa71){const _0x5ad3e9=a122_0x282861,_0x226eab=new Date()[_0x5ad3e9(0x1d3)]()[_0x5ad3e9(0x1d2)](/[:.]/g,'-'),_0x4d1dde=relative(_0x5f399d,_0x26aa71),_0x13b13f=join(_0x5894f4,_0x226eab,_0x4d1dde);return await mkdir(dirname(_0x13b13f),{'recursive':!![]}),await rename(_0x26aa71,_0x13b13f),_0x13b13f;}async function cleanupEmptyDirectories(_0x9c2444,_0x551592){const _0x41cd0e=a122_0x282861;let _0xace721=resolve(_0x9c2444);const _0x41e1cd=resolve(_0x551592);while(_0xace721['startsWith'](''+_0x41e1cd+sep)||_0xace721===_0x41e1cd){if(_0xace721===_0x41e1cd)return;try{const _0x23e410=await readdir(_0xace721);if(_0x23e410[_0x41cd0e(0x1ac)]>0x0)return;await rmdir(_0xace721);}catch{return;}_0xace721=dirname(_0xace721);}}function a122_0x1326(_0x4b1eee,_0x3e516a){_0x4b1eee=_0x4b1eee-0x19a;const _0x56dcef=a122_0x56dc();let _0x1326b9=_0x56dcef[_0x4b1eee];return _0x1326b9;}async function resolveTargetDbBinding(_0xdeb861,_0x17742d,_0x7809e3){const _0x2efc47=a122_0x282861,_0x5e900c=_0x17742d[_0x2efc47(0x1c7)];if(!_0x5e900c)return{'dbId':_0x7809e3[_0x2efc47(0x1cf)],'dbName':_0x7809e3[_0x2efc47(0x1c5)]};const _0xee7f99=buildDbDirectoryName(_0x7809e3[_0x2efc47(0x1c5)],_0x7809e3[_0x2efc47(0x1cf)]);if(_0x5e900c===_0xee7f99)return{'dbId':_0x7809e3[_0x2efc47(0x1cf)],'dbName':_0x7809e3[_0x2efc47(0x1c5)]};const _0x37cb0e=parseExplicitDbDirectory(_0x5e900c);if(_0x37cb0e!=null)return{'dbId':_0x37cb0e,'dbName':await getDbName(_0xdeb861,_0x37cb0e)['catch'](()=>undefined)};const _0x27a24f=await listDatabases(_0xdeb861),_0x204280=_0x27a24f[_0x2efc47(0x1bb)](_0x7f4ba4=>buildDbDirectoryName(_0x7f4ba4[_0x2efc47(0x1c5)],_0x7f4ba4[_0x2efc47(0x1cf)])===_0x5e900c);if(_0x204280[_0x2efc47(0x1ac)]===0x1)return{'dbId':_0x204280[0x0][_0x2efc47(0x1cf)],'dbName':_0x204280[0x0][_0x2efc47(0x1c5)]};if(_0x204280[_0x2efc47(0x1ac)]===0x0)throw CliErrors[_0x2efc47(0x1b3)](_0x2efc47(0x1ca)+_0x5e900c+_0x2efc47(0x1a4)+_0x17742d[_0x2efc47(0x1cb)]+'.');const _0x1bd0cd=_0x204280['map'](_0x4a57fb=>_0x4a57fb[_0x2efc47(0x1c5)]+'\x20('+_0x4a57fb[_0x2efc47(0x1cf)]+')')['join'](',\x20');throw CliErrors[_0x2efc47(0x1b3)]('Local\x20directory\x20\x22'+_0x5e900c+_0x2efc47(0x1b5)+_0x17742d[_0x2efc47(0x1cb)]+':\x20'+_0x1bd0cd);}function parseExplicitDbDirectory(_0x17a0cc){const _0x5c0c56=/^db-(\d+)$/['exec'](_0x17a0cc);if(!_0x5c0c56)return null;const _0x37d2c2=Number(_0x5c0c56[0x1]);return Number['isFinite'](_0x37d2c2)&&_0x37d2c2>0x0?_0x37d2c2:null;}
@@ -1 +1 @@
1
- const a122_0x5e758f=a122_0x17d2;function a122_0x18b2(){const _0x2d3488=['Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','52806HjUaPK','2702508mbjVVC','string','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','16618bufals','27445XnmueB','sqlname','1580JPfQgr','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','Query\x20description','260sXRznY','validation','file','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`.','Path\x20to\x20the\x20SQL\x20file','40PicDSn','289TcBTrx','3570pbjNPq','144qTMVhJ','join','466NvkSDQ','write','164169cLdEkk','description'];a122_0x18b2=function(){return _0x2d3488;};return a122_0x18b2();}(function(_0x4eb016,_0x23b392){const _0x9d4a2c=a122_0x17d2,_0x167f90=_0x4eb016();while(!![]){try{const _0x109dc8=parseInt(_0x9d4a2c(0x186))/0x1*(-parseInt(_0x9d4a2c(0x18a))/0x2)+parseInt(_0x9d4a2c(0x18f))/0x3*(parseInt(_0x9d4a2c(0x185))/0x4)+parseInt(_0x9d4a2c(0x17d))/0x5*(-parseInt(_0x9d4a2c(0x187))/0x6)+-parseInt(_0x9d4a2c(0x17a))/0x7*(-parseInt(_0x9d4a2c(0x188))/0x8)+-parseInt(_0x9d4a2c(0x18c))/0x9+parseInt(_0x9d4a2c(0x180))/0xa*(-parseInt(_0x9d4a2c(0x17b))/0xb)+parseInt(_0x9d4a2c(0x190))/0xc;if(_0x109dc8===_0x23b392)break;else _0x167f90['push'](_0x167f90['shift']());}catch(_0x1a2b4){_0x167f90['push'](_0x167f90['shift']());}}}(a122_0x18b2,0x19c15));function a122_0x17d2(_0x413a6a,_0x3f666e){_0x413a6a=_0x413a6a-0x17a;const _0x18b2eb=a122_0x18b2();let _0x17d2a3=_0x18b2eb[_0x413a6a];return _0x17d2a3;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a122_0x5e758f(0x192),'Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.',a122_0x5e758f(0x183)][a122_0x5e758f(0x189)]('\x0a');export const sqlSave={'service':'sql','command':'save','description':a122_0x5e758f(0x17e),'risk':a122_0x5e758f(0x18b),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a122_0x5e758f(0x182),'type':a122_0x5e758f(0x191),'required':!![],'description':a122_0x5e758f(0x184)},SQLCODE_FLAG_OPTIONAL,{'name':a122_0x5e758f(0x17c),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a122_0x5e758f(0x18e)},{'name':a122_0x5e758f(0x18d),'type':a122_0x5e758f(0x191),'description':a122_0x5e758f(0x17f)}],async 'validate'(){const _0x527e90=a122_0x5e758f;throw CliErrors[_0x527e90(0x181)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x19e896=a122_0x5e758f;throw CliErrors[_0x19e896(0x181)](SQL_SAVE_DEPRECATED_HINT);}};
1
+ function a123_0x5b15(){const _0x3047f2=['137100YkKyFi','string','1884570BdpwFW','1441750YIHtMk','save','SQL\x20query\x20display\x20name','validation','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','27THvPDE','2018936sueekQ','description','25974gkwJCZ','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`.','join','sql','4741464KLkTua','file','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','write','Path\x20to\x20the\x20SQL\x20file','4217442VbJZbB','340UpLuii','sqlname','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update'];a123_0x5b15=function(){return _0x3047f2;};return a123_0x5b15();}const a123_0x476ccf=a123_0x4b63;(function(_0x2958dd,_0x27af19){const _0x2b8e07=a123_0x4b63,_0x3d701f=_0x2958dd();while(!![]){try{const _0x51d7f1=-parseInt(_0x2b8e07(0x1ee))/0x1+parseInt(_0x2b8e07(0x1f0))/0x2+parseInt(_0x2b8e07(0x1e1))/0x3*(-parseInt(_0x2b8e07(0x1eb))/0x4)+-parseInt(_0x2b8e07(0x1f1))/0x5+-parseInt(_0x2b8e07(0x1ea))/0x6+parseInt(_0x2b8e07(0x1e5))/0x7+parseInt(_0x2b8e07(0x1df))/0x8*(parseInt(_0x2b8e07(0x1de))/0x9);if(_0x51d7f1===_0x27af19)break;else _0x3d701f['push'](_0x3d701f['shift']());}catch(_0x501b67){_0x3d701f['push'](_0x3d701f['shift']());}}}(a123_0x5b15,0x7d1c3));function a123_0x4b63(_0x1036f9,_0xfb63e6){_0x1036f9=_0x1036f9-0x1dc;const _0x5b1524=a123_0x5b15();let _0x4b6391=_0x5b1524[_0x1036f9];return _0x4b6391;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=[a123_0x476ccf(0x1e7),a123_0x476ccf(0x1dd),a123_0x476ccf(0x1e2)][a123_0x476ccf(0x1e3)]('\x0a');export const sqlSave={'service':a123_0x476ccf(0x1e4),'command':a123_0x476ccf(0x1f2),'description':a123_0x476ccf(0x1ed),'risk':a123_0x476ccf(0x1e8),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a123_0x476ccf(0x1e6),'type':a123_0x476ccf(0x1ef),'required':!![],'description':a123_0x476ccf(0x1e9)},SQLCODE_FLAG_OPTIONAL,{'name':a123_0x476ccf(0x1ec),'type':'string','description':a123_0x476ccf(0x1f3)},{'name':'db','type':a123_0x476ccf(0x1ef),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a123_0x476ccf(0x1e0),'type':a123_0x476ccf(0x1ef),'description':'Query\x20description'}],async 'validate'(){const _0x44f090=a123_0x476ccf;throw CliErrors[_0x44f090(0x1dc)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- (function(_0x2545a3,_0x3ff25f){const _0x2438fe=a123_0x4475,_0x668919=_0x2545a3();while(!![]){try{const _0x3adcc5=parseInt(_0x2438fe(0x1f2))/0x1+parseInt(_0x2438fe(0x213))/0x2+-parseInt(_0x2438fe(0x1f5))/0x3*(-parseInt(_0x2438fe(0x215))/0x4)+-parseInt(_0x2438fe(0x205))/0x5+-parseInt(_0x2438fe(0x20a))/0x6+-parseInt(_0x2438fe(0x214))/0x7+parseInt(_0x2438fe(0x20d))/0x8;if(_0x3adcc5===_0x3ff25f)break;else _0x668919['push'](_0x668919['shift']());}catch(_0x5ea267){_0x668919['push'](_0x668919['shift']());}}}(a123_0x2c84,0x6529b));import{createInterface}from'node:readline';import{join}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x3dd372,_0x57ac69,_0x2b2a57,_0x42416b){const _0x122ee0=a123_0x4475,_0x11c8db=detectSqlMode(_0x57ac69);return{'path':buildSqlRelativePath(_0x3dd372[_0x122ee0(0x1f8)],_0x3dd372[_0x122ee0(0x20e)],_0x42416b?.[_0x122ee0(0x1f3)],_0x11c8db,_0x3dd372[_0x122ee0(0x1fb)]),'hash':_0x2b2a57,'remoteId':_0x3dd372['id'],'version':_0x3dd372[_0x122ee0(0x210)],'dbId':Number(_0x3dd372['dbId']),'dbName':_0x42416b?.[_0x122ee0(0x1f3)],'sqlName':_0x3dd372['sqlName'],'sqlConfig':_0x3dd372[_0x122ee0(0x207)]??undefined,'mode':_0x11c8db};}export function cloneSqlLockData(_0x3186ac){const _0x2e4010=a123_0x4475;return{'apps':Object[_0x2e4010(0x1fd)](Object[_0x2e4010(0x20b)](_0x3186ac[_0x2e4010(0x21b)])['map'](([_0x238449,_0x32fd59])=>[_0x238449,{'sqlRoot':_0x32fd59[_0x2e4010(0x202)],'lastSync':_0x32fd59['lastSync'],'sqls':{..._0x32fd59[_0x2e4010(0x1f9)]}}]))};}export function ensureRemoteSqlContent(_0x38a2df){const _0x5831b7=a123_0x4475;return _0x38a2df[_0x5831b7(0x204)]??'';}function a123_0x4475(_0xddc41b,_0x23dc58){_0xddc41b=_0xddc41b-0x1f1;const _0x2c8463=a123_0x2c84();let _0x4475f4=_0x2c8463[_0xddc41b];return _0x4475f4;}function a123_0x2c84(){const _0x4eb544=['6425856tIjKcr','sqlName','push','version','split','includes','837652jtnQjp','2786595lHOzXl','7864WjykmO','length','mybatisXml','<!--\x20@lovrabet.','endsWith','map','apps','stderr','description','402786wHCIet','dbName','yes','315PVPdLK','path','trim','sqlCode','sqls','syncedAt','dbId','close','fromEntries','\x20-->','question','test','toLowerCase','sqlRoot','mode','sqlContent','2315740sHcOur','filter','sqlConfig','stdin','--\x20@lovrabet.','3334068TVLiQZ','entries','\x20[y/N]\x20'];a123_0x2c84=function(){return _0x4eb544;};return a123_0x2c84();}export function buildLocalSqlFileContent(_0x4314cd,_0x43384,_0x585f9e){const _0x13ead1=a123_0x4475,_0x318969=_0x585f9e?.['mode']??detectSqlMode(_0x43384),_0x302f14=stripLocalSqlMetadata(_0x43384,_0x318969)[_0x13ead1(0x1f7)](),_0x5f2b0c=[...buildMetadataHeaderLines({'sqlCode':_0x4314cd['sqlCode'],'sqlName':_0x4314cd[_0x13ead1(0x20e)],'dbId':_0x4314cd['dbId'],'dbName':_0x585f9e?.[_0x13ead1(0x1f3)],'mode':_0x318969,'syncedAt':_0x585f9e?.[_0x13ead1(0x1fa)],'description':_0x585f9e?.[_0x13ead1(0x1f1)]},_0x318969),'',_0x302f14],_0x2c676c=_0x5f2b0c['join']('\x0a');return _0x2c676c[_0x13ead1(0x219)]('\x0a')?_0x2c676c:_0x2c676c+'\x0a';}export function stripLocalSqlMetadata(_0x1145f1,_0x485258){const _0x222548=a123_0x4475,_0x4ef0e8=_0x1145f1['replace'](/\r\n/g,'\x0a')[_0x222548(0x211)]('\x0a'),_0x13c108=[];let _0x59f499=0x0;if(_0x485258===_0x222548(0x217))while(_0x59f499<_0x4ef0e8[_0x222548(0x216)]){const _0x8f9157=_0x4ef0e8[_0x59f499]??'';if(/^\s*<!--\s*@lovrabet\./[_0x222548(0x200)](_0x8f9157)){_0x59f499++;continue;}if(_0x8f9157['trim']()===''&&_0x59f499>0x0){_0x59f499++;continue;}break;}else while(_0x59f499<_0x4ef0e8[_0x222548(0x216)]){const _0x22a385=_0x4ef0e8[_0x59f499]??'';if(/^\s*--\s*@lovrabet\./[_0x222548(0x200)](_0x22a385)){_0x59f499++;continue;}if(_0x22a385[_0x222548(0x1f7)]()===''&&_0x59f499>0x0){_0x59f499++;continue;}break;}for(;_0x59f499<_0x4ef0e8[_0x222548(0x216)];_0x59f499++){_0x13c108[_0x222548(0x20f)](_0x4ef0e8[_0x59f499]);}return _0x13c108['join']('\x0a')['trimStart']();}export function resolveSqlMode(_0x5497d4,_0x5d1b90){const _0x16cd39=a123_0x4475;if(_0x5d1b90?.[_0x16cd39(0x203)])return _0x5d1b90[_0x16cd39(0x203)];return detectSqlMode(_0x5497d4);}export function resolveSqlFileName(_0x534685,_0x48765,_0xb543ed){const _0x456fa2=a123_0x4475;if(_0xb543ed?.[_0x456fa2(0x1f6)])return _0xb543ed[_0x456fa2(0x1f6)];if(_0xb543ed?.[_0x456fa2(0x20e)]||_0xb543ed?.[_0x456fa2(0x1f3)])return buildSqlRelativePath(_0x534685,_0xb543ed?.[_0x456fa2(0x20e)],_0xb543ed?.[_0x456fa2(0x1f3)],resolveSqlMode(_0x48765,_0xb543ed),_0xb543ed?.['dbId']);return buildDefaultSqlFileName(_0x534685,resolveSqlMode(_0x48765,_0xb543ed));}export function resolveSqlLocalDir(_0x42ed8e,_0x1f0b6f){return join(_0x42ed8e,SQL_LOCAL_REL_DIR,_0x1f0b6f);}export async function confirmForceOverwrite(_0x3f1829){const _0xddc20b=a123_0x4475,_0x2df95d=createInterface({'input':process[_0xddc20b(0x208)],'output':process[_0xddc20b(0x21c)]}),_0x237ffc=await new Promise(_0x4dcbdb=>{const _0x690a67=_0xddc20b;_0x2df95d[_0x690a67(0x1ff)](_0x3f1829+_0x690a67(0x20c),_0x4dcbdb);});return _0x2df95d[_0xddc20b(0x1fc)](),['y',_0xddc20b(0x1f4)][_0xddc20b(0x212)](_0x237ffc[_0xddc20b(0x1f7)]()[_0xddc20b(0x201)]());}export function findSqlLockScope(_0x4d845b,_0x260154){const _0x3fe9dd=a123_0x4475;return _0x4d845b[_0x3fe9dd(0x21b)][_0x260154];}function buildMetadataHeaderLines(_0xc8748,_0x4195ea){const _0x374b36=a123_0x4475,_0x7e6308=[[_0x374b36(0x1f8),_0xc8748[_0x374b36(0x1f8)]],[_0x374b36(0x20e),_0xc8748['sqlName']],[_0x374b36(0x1fb),_0xc8748[_0x374b36(0x1fb)]],[_0x374b36(0x1f3),_0xc8748[_0x374b36(0x1f3)]],['mode',_0xc8748[_0x374b36(0x203)]],[_0x374b36(0x1fa),_0xc8748[_0x374b36(0x1fa)]],[_0x374b36(0x1f1),_0xc8748['description']]];if(_0x4195ea===_0x374b36(0x217))return _0x7e6308[_0x374b36(0x206)](([,_0x3878fc])=>_0x3878fc!==undefined&&_0x3878fc!==null&&String(_0x3878fc)[_0x374b36(0x1f7)]()!=='')['map'](([_0x143021,_0x5c4ad6])=>_0x374b36(0x218)+_0x143021+':\x20'+String(_0x5c4ad6)+_0x374b36(0x1fe));return _0x7e6308[_0x374b36(0x206)](([,_0x436b08])=>_0x436b08!==undefined&&_0x436b08!==null&&String(_0x436b08)[_0x374b36(0x1f7)]()!=='')[_0x374b36(0x21a)](([_0x5497cd,_0x99b628])=>_0x374b36(0x209)+_0x5497cd+':\x20'+String(_0x99b628));}
1
+ const a124_0xb83511=a124_0x363f;(function(_0x55a237,_0x11331b){const _0x415093=a124_0x363f,_0x4d6517=_0x55a237();while(!![]){try{const _0x147cac=-parseInt(_0x415093(0x90))/0x1*(-parseInt(_0x415093(0x8b))/0x2)+-parseInt(_0x415093(0x9a))/0x3+parseInt(_0x415093(0x93))/0x4+parseInt(_0x415093(0x81))/0x5*(parseInt(_0x415093(0xab))/0x6)+-parseInt(_0x415093(0xa9))/0x7*(-parseInt(_0x415093(0x88))/0x8)+-parseInt(_0x415093(0x92))/0x9+parseInt(_0x415093(0x8c))/0xa*(-parseInt(_0x415093(0x91))/0xb);if(_0x147cac===_0x11331b)break;else _0x4d6517['push'](_0x4d6517['shift']());}catch(_0x1c7d6b){_0x4d6517['push'](_0x4d6517['shift']());}}}(a124_0x30a0,0x21435));import{createInterface}from'node:readline';import{join}from'node:path';function a124_0x30a0(){const _0x581d68=['\x20[y/N]\x20','toLowerCase','978817aFHWIR','fromEntries','2094IziwRn','mode','endsWith','dbName','includes','trimStart','length','3695hqfCjV','yes','path','.rabetbase/sql','trim','entries','stdin','8SvKIZq','dbId','replace','530866uxBVtV','2478640UbZpmp','sqlRoot','push','filter','1BnNQDh','22ZfsnZZ','615339HTpyYc','815948BamNWr','sqlConfig','<!--\x20@lovrabet.','map','sqlCode','--\x20@lovrabet.','\x20-->','500454FhTsAm','test','description','mybatisXml','lastSync','close','sqlName','sqls','join','question','stderr','syncedAt','apps'];a124_0x30a0=function(){return _0x581d68;};return a124_0x30a0();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR=a124_0xb83511(0x84);export function buildSqlLockEntry(_0x36f9db,_0x439076,_0x3f9bb1,_0x3588c9){const _0x89b8ea=a124_0xb83511,_0x528167=detectSqlMode(_0x439076);return{'path':buildSqlRelativePath(_0x36f9db[_0x89b8ea(0x97)],_0x36f9db['sqlName'],_0x3588c9?.[_0x89b8ea(0x7d)],_0x528167,_0x36f9db[_0x89b8ea(0x89)]),'hash':_0x3f9bb1,'remoteId':_0x36f9db['id'],'version':_0x36f9db['version'],'dbId':Number(_0x36f9db[_0x89b8ea(0x89)]),'dbName':_0x3588c9?.[_0x89b8ea(0x7d)],'sqlName':_0x36f9db[_0x89b8ea(0xa0)],'sqlConfig':_0x36f9db[_0x89b8ea(0x94)]??undefined,'mode':_0x528167};}export function cloneSqlLockData(_0x21ba29){const _0x3e6dfe=a124_0xb83511;return{'apps':Object[_0x3e6dfe(0xaa)](Object[_0x3e6dfe(0x86)](_0x21ba29[_0x3e6dfe(0xa6)])[_0x3e6dfe(0x96)](([_0x3bcd0b,_0x1b4b94])=>[_0x3bcd0b,{'sqlRoot':_0x1b4b94[_0x3e6dfe(0x8d)],'lastSync':_0x1b4b94[_0x3e6dfe(0x9e)],'sqls':{..._0x1b4b94[_0x3e6dfe(0xa1)]}}]))};}export function ensureRemoteSqlContent(_0x28f9c3){return _0x28f9c3['sqlContent']??'';}export function buildLocalSqlFileContent(_0x53f7ef,_0x14ce63,_0x42e99e){const _0x62ea00=a124_0xb83511,_0x2e26c9=_0x42e99e?.[_0x62ea00(0x7b)]??detectSqlMode(_0x14ce63),_0x7f91fe=stripLocalSqlMetadata(_0x14ce63,_0x2e26c9)[_0x62ea00(0x85)](),_0x596486=[...buildMetadataHeaderLines({'sqlCode':_0x53f7ef['sqlCode'],'sqlName':_0x53f7ef['sqlName'],'dbId':_0x53f7ef['dbId'],'dbName':_0x42e99e?.[_0x62ea00(0x7d)],'mode':_0x2e26c9,'syncedAt':_0x42e99e?.[_0x62ea00(0xa5)],'description':_0x42e99e?.[_0x62ea00(0x9c)]},_0x2e26c9),'',_0x7f91fe],_0x26b533=_0x596486[_0x62ea00(0xa2)]('\x0a');return _0x26b533[_0x62ea00(0x7c)]('\x0a')?_0x26b533:_0x26b533+'\x0a';}function a124_0x363f(_0x500bba,_0x5ae180){_0x500bba=_0x500bba-0x7b;const _0x30a06e=a124_0x30a0();let _0x363ffd=_0x30a06e[_0x500bba];return _0x363ffd;}export function stripLocalSqlMetadata(_0x1dc4a1,_0x5e7558){const _0x428348=a124_0xb83511,_0x4b5eec=_0x1dc4a1[_0x428348(0x8a)](/\r\n/g,'\x0a')['split']('\x0a'),_0x296beb=[];let _0x5a33c7=0x0;if(_0x5e7558===_0x428348(0x9d))while(_0x5a33c7<_0x4b5eec[_0x428348(0x80)]){const _0x1b432b=_0x4b5eec[_0x5a33c7]??'';if(/^\s*<!--\s*@lovrabet\./[_0x428348(0x9b)](_0x1b432b)){_0x5a33c7++;continue;}if(_0x1b432b[_0x428348(0x85)]()===''&&_0x5a33c7>0x0){_0x5a33c7++;continue;}break;}else while(_0x5a33c7<_0x4b5eec['length']){const _0x54cfaf=_0x4b5eec[_0x5a33c7]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x54cfaf)){_0x5a33c7++;continue;}if(_0x54cfaf[_0x428348(0x85)]()===''&&_0x5a33c7>0x0){_0x5a33c7++;continue;}break;}for(;_0x5a33c7<_0x4b5eec[_0x428348(0x80)];_0x5a33c7++){_0x296beb[_0x428348(0x8e)](_0x4b5eec[_0x5a33c7]);}return _0x296beb[_0x428348(0xa2)]('\x0a')[_0x428348(0x7f)]();}export function resolveSqlMode(_0x77f0ad,_0x25efba){const _0xc70186=a124_0xb83511;if(_0x25efba?.[_0xc70186(0x7b)])return _0x25efba[_0xc70186(0x7b)];return detectSqlMode(_0x77f0ad);}export function resolveSqlFileName(_0x544786,_0x2ce2c8,_0x1e1883){const _0x36b427=a124_0xb83511;if(_0x1e1883?.['path'])return _0x1e1883[_0x36b427(0x83)];if(_0x1e1883?.[_0x36b427(0xa0)]||_0x1e1883?.[_0x36b427(0x7d)])return buildSqlRelativePath(_0x544786,_0x1e1883?.['sqlName'],_0x1e1883?.[_0x36b427(0x7d)],resolveSqlMode(_0x2ce2c8,_0x1e1883),_0x1e1883?.[_0x36b427(0x89)]);return buildDefaultSqlFileName(_0x544786,resolveSqlMode(_0x2ce2c8,_0x1e1883));}export function resolveSqlLocalDir(_0xaa3de1,_0x97089d){return join(_0xaa3de1,SQL_LOCAL_REL_DIR,_0x97089d);}export async function confirmForceOverwrite(_0x1730bb){const _0x261e72=a124_0xb83511,_0x3593e9=createInterface({'input':process[_0x261e72(0x87)],'output':process[_0x261e72(0xa4)]}),_0x30ad9d=await new Promise(_0x534007=>{const _0xe0b47=_0x261e72;_0x3593e9[_0xe0b47(0xa3)](_0x1730bb+_0xe0b47(0xa7),_0x534007);});return _0x3593e9[_0x261e72(0x9f)](),['y',_0x261e72(0x82)][_0x261e72(0x7e)](_0x30ad9d['trim']()[_0x261e72(0xa8)]());}export function findSqlLockScope(_0x24d08a,_0x1703c2){const _0x3c74f3=a124_0xb83511;return _0x24d08a[_0x3c74f3(0xa6)][_0x1703c2];}function buildMetadataHeaderLines(_0x31fd4,_0x20f10c){const _0x3ef15f=a124_0xb83511,_0x40d40a=[['sqlCode',_0x31fd4[_0x3ef15f(0x97)]],[_0x3ef15f(0xa0),_0x31fd4['sqlName']],[_0x3ef15f(0x89),_0x31fd4[_0x3ef15f(0x89)]],['dbName',_0x31fd4[_0x3ef15f(0x7d)]],[_0x3ef15f(0x7b),_0x31fd4[_0x3ef15f(0x7b)]],[_0x3ef15f(0xa5),_0x31fd4['syncedAt']],[_0x3ef15f(0x9c),_0x31fd4[_0x3ef15f(0x9c)]]];if(_0x20f10c===_0x3ef15f(0x9d))return _0x40d40a['filter'](([,_0x46ca30])=>_0x46ca30!==undefined&&_0x46ca30!==null&&String(_0x46ca30)['trim']()!=='')[_0x3ef15f(0x96)](([_0x4fa693,_0x593211])=>_0x3ef15f(0x95)+_0x4fa693+':\x20'+String(_0x593211)+_0x3ef15f(0x99));return _0x40d40a[_0x3ef15f(0x8f)](([,_0x32b344])=>_0x32b344!==undefined&&_0x32b344!==null&&String(_0x32b344)[_0x3ef15f(0x85)]()!=='')[_0x3ef15f(0x96)](([_0x3a6933,_0xb4176c])=>_0x3ef15f(0x98)+_0x3a6933+':\x20'+String(_0xb4176c));}
@@ -1 +1 @@
1
- const a124_0x1054e8=a124_0x3774;(function(_0x1213cc,_0x44bc5b){const _0x1b44cc=a124_0x3774,_0x1a4d00=_0x1213cc();while(!![]){try{const _0x4f3439=parseInt(_0x1b44cc(0x1e4))/0x1+-parseInt(_0x1b44cc(0x1cf))/0x2+-parseInt(_0x1b44cc(0x1d3))/0x3*(-parseInt(_0x1b44cc(0x1e3))/0x4)+-parseInt(_0x1b44cc(0x1ce))/0x5*(-parseInt(_0x1b44cc(0x1e2))/0x6)+-parseInt(_0x1b44cc(0x1ed))/0x7+-parseInt(_0x1b44cc(0x1ee))/0x8*(-parseInt(_0x1b44cc(0x1d1))/0x9)+parseInt(_0x1b44cc(0x1ea))/0xa*(-parseInt(_0x1b44cc(0x1e7))/0xb);if(_0x4f3439===_0x44bc5b)break;else _0x1a4d00['push'](_0x1a4d00['shift']());}catch(_0x1bcd1e){_0x1a4d00['push'](_0x1a4d00['shift']());}}}(a124_0x57e1,0x4f0a3));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a124_0x57e1(){const _0x24e06a=['totalCount','remote','1290qWyyCl','\x20added,\x20','sqlName','376292ocsdlC','16WBivgu','tableData','relativePath','\x20unchanged','lockFilePath','\x20missing,\x20','sqlRoot','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','5ixKOei','843760sbZzFl','\x20remote-only','2113119lmyrek','map','30IDboDk','push','read','paging','sqlCode','keys','has','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','lockKey','status','appCode','length','filePath','path','sql','3533226IIEmQH','190492SHiNtH','510195vLXIXi','hash','sqls','106205pUKOmg'];a124_0x57e1=function(){return _0x24e06a;};return a124_0x57e1();}function a124_0x3774(_0x494041,_0x212dda){_0x494041=_0x494041-0x1c7;const _0x57e1be=a124_0x57e1();let _0x377409=_0x57e1be[_0x494041];return _0x377409;}import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x25c0dc){const _0xa0a146=a124_0x3774,_0x2dfed0=[];let _0x37fb24=0x1;while(!![]){const _0x4f19ea=await listSqlQueries(_0x25c0dc,{'currentPage':_0x37fb24,'pageSize':PAGE_SIZE}),_0x5c74bc=_0x4f19ea[_0xa0a146(0x1c7)]??[];_0x2dfed0[_0xa0a146(0x1d4)](..._0x5c74bc[_0xa0a146(0x1d2)](_0x54651f=>_0x54651f[_0xa0a146(0x1d7)]));if(_0x5c74bc['length']===0x0)break;const _0x37de13=_0x4f19ea[_0xa0a146(0x1d6)]?.[_0xa0a146(0x1e8)];if(_0x37de13!=null?_0x2dfed0[_0xa0a146(0x1de)]>=_0x37de13:_0x5c74bc[_0xa0a146(0x1de)]<PAGE_SIZE)break;_0x37fb24++;}return _0x2dfed0;}export const sqlStatus={'service':a124_0x1054e8(0x1e1),'command':'status','description':a124_0x1054e8(0x1cd),'risk':a124_0x1054e8(0x1d5),'flags':[{'name':'remote','type':'boolean','description':a124_0x1054e8(0x1da)}],async 'execute'(_0x55d080){const _0x912fc5=a124_0x1054e8,_0x14bd01=loadSqlProjectConfig(_0x55d080[_0x912fc5(0x1dd)]),_0x4934a8=await readSqlLockFile(_0x14bd01[_0x912fc5(0x1ca)]),{appLock:_0x3283c8}=ensureSqlLockScope(_0x4934a8??createEmptySqlLock(),_0x14bd01[_0x912fc5(0x1dd)],_0x14bd01[_0x912fc5(0x1cc)],_0x912fc5(0x1dc)),_0x3260f7=await scanLocalSqlQueries(_0x14bd01),_0x24cce5=[],_0x3141fc=[],_0x2692b7=[],_0x277a9a=[],_0x4195a2=new Set(_0x3260f7['map'](_0x3a0ca9=>_0x3a0ca9[_0x912fc5(0x1db)]));for(const _0x4b94ef of _0x3260f7){const _0x3eb8eb=await computeSqlFileHash(_0x4b94ef[_0x912fc5(0x1df)]),_0x3e33b0=_0x3283c8[_0x912fc5(0x1e6)][_0x4b94ef[_0x912fc5(0x1db)]],_0x487ad4=!!_0x3e33b0&&_0x3e33b0[_0x912fc5(0x1e0)]!==_0x4b94ef[_0x912fc5(0x1c8)],_0x3625cb=!!_0x3e33b0&&!!_0x4b94ef['sqlName']&&_0x3e33b0[_0x912fc5(0x1ec)]!==_0x4b94ef[_0x912fc5(0x1ec)];if(!_0x3e33b0)_0x24cce5[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]);else _0x3e33b0[_0x912fc5(0x1e5)]!==_0x3eb8eb||_0x487ad4||_0x3625cb?_0x3141fc[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]):_0x2692b7[_0x912fc5(0x1d4)](_0x4b94ef[_0x912fc5(0x1db)]);}for(const _0x51422a of Object[_0x912fc5(0x1d8)](_0x3283c8[_0x912fc5(0x1e6)])){!_0x4195a2[_0x912fc5(0x1d9)](_0x51422a)&&_0x277a9a[_0x912fc5(0x1d4)](_0x51422a);}const _0x3ceb41=[];if(_0x55d080['bool'](_0x912fc5(0x1e9))){const _0x5310d1=await fetchAllSqlCodes(_0x55d080[_0x912fc5(0x1dd)]);for(const _0x4f812c of _0x5310d1){!_0x4195a2['has'](_0x4f812c)&&!_0x3283c8[_0x912fc5(0x1e6)][_0x4f812c]&&_0x3ceb41[_0x912fc5(0x1d4)](_0x4f812c);}}const _0x19dea5=_0x24cce5[_0x912fc5(0x1de)]===0x0&&_0x3141fc['length']===0x0&&_0x277a9a[_0x912fc5(0x1de)]===0x0&&_0x3ceb41[_0x912fc5(0x1de)]===0x0;return{'ok':!![],'data':{'added':_0x24cce5,'modified':_0x3141fc,'missing':_0x277a9a,'unchanged':_0x2692b7,'remoteOnly':_0x3ceb41},'message':_0x19dea5?'All\x20SQL\x20queries\x20are\x20in\x20sync.':_0x24cce5[_0x912fc5(0x1de)]+_0x912fc5(0x1eb)+_0x3141fc[_0x912fc5(0x1de)]+'\x20modified,\x20'+_0x277a9a[_0x912fc5(0x1de)]+_0x912fc5(0x1cb)+_0x2692b7[_0x912fc5(0x1de)]+_0x912fc5(0x1c9)+(_0x3ceb41[_0x912fc5(0x1de)]>0x0?',\x20'+_0x3ceb41[_0x912fc5(0x1de)]+_0x912fc5(0x1d0):'')};}};
1
+ const a125_0x2092df=a125_0x5cc9;(function(_0x5782f5,_0x5b04c1){const _0x339464=a125_0x5cc9,_0x5efda2=_0x5782f5();while(!![]){try{const _0x38219b=-parseInt(_0x339464(0x107))/0x1+parseInt(_0x339464(0x110))/0x2*(parseInt(_0x339464(0xfd))/0x3)+parseInt(_0x339464(0x105))/0x4+-parseInt(_0x339464(0xfb))/0x5*(-parseInt(_0x339464(0x10d))/0x6)+-parseInt(_0x339464(0x100))/0x7*(-parseInt(_0x339464(0x109))/0x8)+parseInt(_0x339464(0xff))/0x9*(-parseInt(_0x339464(0x101))/0xa)+-parseInt(_0x339464(0x108))/0xb;if(_0x38219b===_0x5b04c1)break;else _0x5efda2['push'](_0x5efda2['shift']());}catch(_0x3b087c){_0x5efda2['push'](_0x5efda2['shift']());}}}(a125_0xa9ec,0x562b3));import{listSqlQueries}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;function a125_0xa9ec(){const _0x21756c=['boolean','190319eNOpfk','2004552tkBFtM','7352UPazna','push','path','\x20remote-only','886242OVHjOR','All\x20SQL\x20queries\x20are\x20in\x20sync.','sqlName','6DspjTy','tableData','relativePath','read','bool','appCode','keys','Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','status','sqlCode','totalCount','sqls','remote','filePath','lockKey','has','10yzqWJj','paging','99834FEyqIM','hash','45vfgebO','3353wnsOoW','1203180qAxRaL','\x20unchanged','length','map','1966556rTUtbr'];a125_0xa9ec=function(){return _0x21756c;};return a125_0xa9ec();}function a125_0x5cc9(_0x4b72b6,_0xfe571d){_0x4b72b6=_0x4b72b6-0xed;const _0xa9ecde=a125_0xa9ec();let _0x5cc920=_0xa9ecde[_0x4b72b6];return _0x5cc920;}async function fetchAllSqlCodes(_0x3c51d2){const _0x2dbdef=a125_0x5cc9,_0x1e18cb=[];let _0x492505=0x1;while(!![]){const _0x2de8fd=await listSqlQueries(_0x3c51d2,{'currentPage':_0x492505,'pageSize':PAGE_SIZE}),_0x18255e=_0x2de8fd[_0x2dbdef(0x111)]??[];_0x1e18cb[_0x2dbdef(0x10a)](..._0x18255e[_0x2dbdef(0x104)](_0x3761df=>_0x3761df[_0x2dbdef(0xf4)]));if(_0x18255e[_0x2dbdef(0x103)]===0x0)break;const _0xde3e9e=_0x2de8fd[_0x2dbdef(0xfc)]?.[_0x2dbdef(0xf5)];if(_0xde3e9e!=null?_0x1e18cb[_0x2dbdef(0x103)]>=_0xde3e9e:_0x18255e[_0x2dbdef(0x103)]<PAGE_SIZE)break;_0x492505++;}return _0x1e18cb;}export const sqlStatus={'service':'sql','command':a125_0x2092df(0xf3),'description':a125_0x2092df(0xf2),'risk':a125_0x2092df(0xee),'flags':[{'name':a125_0x2092df(0xf7),'type':a125_0x2092df(0x106),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x576ed1){const _0xfdaf55=a125_0x2092df,_0x2bf5bd=loadSqlProjectConfig(_0x576ed1[_0xfdaf55(0xf0)]),_0x4f3b98=await readSqlLockFile(_0x2bf5bd['lockFilePath']),{appLock:_0x7d02ff}=ensureSqlLockScope(_0x4f3b98??createEmptySqlLock(),_0x2bf5bd[_0xfdaf55(0xf0)],_0x2bf5bd['sqlRoot'],'status'),_0xd47008=await scanLocalSqlQueries(_0x2bf5bd),_0xa1f7e4=[],_0x112baf=[],_0x451d10=[],_0x1b8dbd=[],_0x491364=new Set(_0xd47008[_0xfdaf55(0x104)](_0x3878d6=>_0x3878d6[_0xfdaf55(0xf9)]));for(const _0x1e9e0c of _0xd47008){const _0x530ec7=await computeSqlFileHash(_0x1e9e0c[_0xfdaf55(0xf8)]),_0x434291=_0x7d02ff[_0xfdaf55(0xf6)][_0x1e9e0c[_0xfdaf55(0xf9)]],_0x1c6ebe=!!_0x434291&&_0x434291[_0xfdaf55(0x10b)]!==_0x1e9e0c[_0xfdaf55(0xed)],_0x2d3479=!!_0x434291&&!!_0x1e9e0c[_0xfdaf55(0x10f)]&&_0x434291[_0xfdaf55(0x10f)]!==_0x1e9e0c[_0xfdaf55(0x10f)];if(!_0x434291)_0xa1f7e4['push'](_0x1e9e0c[_0xfdaf55(0xf9)]);else _0x434291[_0xfdaf55(0xfe)]!==_0x530ec7||_0x1c6ebe||_0x2d3479?_0x112baf[_0xfdaf55(0x10a)](_0x1e9e0c[_0xfdaf55(0xf9)]):_0x451d10[_0xfdaf55(0x10a)](_0x1e9e0c[_0xfdaf55(0xf9)]);}for(const _0x353f65 of Object[_0xfdaf55(0xf1)](_0x7d02ff[_0xfdaf55(0xf6)])){!_0x491364[_0xfdaf55(0xfa)](_0x353f65)&&_0x1b8dbd['push'](_0x353f65);}const _0x3476fb=[];if(_0x576ed1[_0xfdaf55(0xef)](_0xfdaf55(0xf7))){const _0x138223=await fetchAllSqlCodes(_0x576ed1[_0xfdaf55(0xf0)]);for(const _0x2781c1 of _0x138223){!_0x491364[_0xfdaf55(0xfa)](_0x2781c1)&&!_0x7d02ff['sqls'][_0x2781c1]&&_0x3476fb[_0xfdaf55(0x10a)](_0x2781c1);}}const _0xce3dd8=_0xa1f7e4['length']===0x0&&_0x112baf[_0xfdaf55(0x103)]===0x0&&_0x1b8dbd[_0xfdaf55(0x103)]===0x0&&_0x3476fb[_0xfdaf55(0x103)]===0x0;return{'ok':!![],'data':{'added':_0xa1f7e4,'modified':_0x112baf,'missing':_0x1b8dbd,'unchanged':_0x451d10,'remoteOnly':_0x3476fb},'message':_0xce3dd8?_0xfdaf55(0x10e):_0xa1f7e4['length']+'\x20added,\x20'+_0x112baf[_0xfdaf55(0x103)]+'\x20modified,\x20'+_0x1b8dbd[_0xfdaf55(0x103)]+'\x20missing,\x20'+_0x451d10[_0xfdaf55(0x103)]+_0xfdaf55(0x102)+(_0x3476fb[_0xfdaf55(0x103)]>0x0?',\x20'+_0x3476fb[_0xfdaf55(0x103)]+_0xfdaf55(0x10c):'')};}};
@@ -1 +1 @@
1
- const a125_0x2f62a1=a125_0x56a7;function a125_0x56a7(_0x1a65c5,_0x50a6a3){_0x1a65c5=_0x1a65c5-0x1bf;const _0x5e9fb4=a125_0x5e9f();let _0x56a724=_0x5e9fb4[_0x1a65c5];return _0x56a724;}(function(_0x3e91f1,_0x22619b){const _0x1b2243=a125_0x56a7,_0x4d3578=_0x3e91f1();while(!![]){try{const _0x51f49b=-parseInt(_0x1b2243(0x1d7))/0x1+parseInt(_0x1b2243(0x1d8))/0x2+-parseInt(_0x1b2243(0x1d1))/0x3+parseInt(_0x1b2243(0x1df))/0x4+-parseInt(_0x1b2243(0x1cd))/0x5+parseInt(_0x1b2243(0x1e4))/0x6+-parseInt(_0x1b2243(0x1d5))/0x7;if(_0x51f49b===_0x22619b)break;else _0x4d3578['push'](_0x4d3578['shift']());}catch(_0x173423){_0x4d3578['push'](_0x4d3578['shift']());}}}(a125_0x5e9f,0xd1ba1));function a125_0x5e9f(){const _0x3d4ee5=['2387830JXVoec','isDangerous','filter','size','2149806svXZhE','get','reason','Provide\x20--file\x20or\x20--sql','1169126NwIOxu','utf-8','302056JOUQWs','1359428yeFLtn','dbtableConfig','sqlType','validate','sql','cwd','isSelectOnly','2332008tDxJef','File\x20not\x20found:\x20','flagMissing','Table\x20\x22','string','7557402Fhkmol','tables','file','schemas','parameters','read','Dataset\x20\x22','message','fields','schemaWarnings','type','map','trim','validation','valid','isArray','from','tableName','str','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','toLowerCase','\x22\x20not\x20found\x20in\x20any\x20dataset','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','push'];a125_0x5e9f=function(){return _0x3d4ee5;};return a125_0x5e9f();}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';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a125_0x2f62a1(0x1dc),'command':a125_0x2f62a1(0x1db),'description':a125_0x2f62a1(0x1c8),'risk':a125_0x2f62a1(0x1e9),'flags':[{'name':a125_0x2f62a1(0x1e6),'type':a125_0x2f62a1(0x1e3),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a125_0x2f62a1(0x1dc),'type':a125_0x2f62a1(0x1e3),'description':a125_0x2f62a1(0x1cb)},{'name':a125_0x2f62a1(0x1e7),'type':a125_0x2f62a1(0x1e3),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x287f0b){const _0x172a43=a125_0x2f62a1,_0x2dd6cd=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1e6)),_0x2e1942=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1dc));if(!_0x2dd6cd&&!_0x2e1942)throw CliErrors[_0x172a43(0x1e1)](_0x172a43(0x1e6),_0x172a43(0x1d4));let _0x1643b3;if(_0x2dd6cd){const _0x2382c0=resolve(process[_0x172a43(0x1dd)](),_0x2dd6cd);if(!existsSync(_0x2382c0))throw CliErrors[_0x172a43(0x1c2)](_0x172a43(0x1e0)+_0x2382c0);_0x1643b3=readFileSync(_0x2382c0,_0x172a43(0x1d6));}else _0x1643b3=_0x2e1942;const _0x3b2786=validateSql(_0x1643b3),_0x640130={'valid':_0x3b2786[_0x172a43(0x1c3)],'sqlType':_0x3b2786[_0x172a43(0x1da)][_0x172a43(0x1bf)],'isSelectOnly':_0x3b2786[_0x172a43(0x1da)][_0x172a43(0x1de)],'isDangerous':_0x3b2786['sqlType'][_0x172a43(0x1ce)],'tables':_0x3b2786[_0x172a43(0x1e5)],'parameters':_0x3b2786[_0x172a43(0x1e8)],'message':_0x3b2786[_0x172a43(0x1eb)]};_0x3b2786['sqlType'][_0x172a43(0x1d3)]&&(_0x640130[_0x172a43(0x1d3)]=_0x3b2786[_0x172a43(0x1da)]['reason']);const _0xbf0ce8=_0x287f0b[_0x172a43(0x1c7)](_0x172a43(0x1e7));if(_0xbf0ce8&&_0x3b2786['valid']){const _0x5762fc=_0xbf0ce8['split'](',')[_0x172a43(0x1c0)](_0xfa563f=>_0xfa563f[_0x172a43(0x1c1)]())[_0x172a43(0x1cf)](Boolean),_0x193e08=[],_0x4b89ef=await listDatasets(_0x287f0b['appCode']),_0x3033bc=new Map(_0x4b89ef[_0x172a43(0x1c0)](_0x1f6213=>[_0x1f6213[_0x172a43(0x1d9)]?.['tableName']?.[_0x172a43(0x1c9)](),_0x1f6213]));for(const _0x2a045f of _0x3b2786[_0x172a43(0x1e5)]){const _0x54633f=_0x3033bc[_0x172a43(0x1d2)](_0x2a045f[_0x172a43(0x1c9)]());!_0x54633f&&_0x193e08[_0x172a43(0x1cc)](_0x172a43(0x1e2)+_0x2a045f+_0x172a43(0x1ca));}for(const _0x3468a7 of _0x5762fc){try{const _0x1287b9=await getDatasetDetail(_0x3468a7),_0x315b2c=Array[_0x172a43(0x1c4)](_0x1287b9[_0x172a43(0x1ec)])?_0x1287b9[_0x172a43(0x1ec)]:[],_0x28e454=new Set(_0x315b2c[_0x172a43(0x1c0)](_0x109154=>_0x109154['name']?.[_0x172a43(0x1c9)]())),_0x2d62b7=_0x1287b9[_0x172a43(0x1d9)]?.[_0x172a43(0x1c6)]||_0x1287b9[_0x172a43(0x1c6)]||_0x3468a7;_0x640130['schema:'+_0x2d62b7]={'code':_0x3468a7,'tableName':_0x2d62b7,'fieldCount':_0x28e454[_0x172a43(0x1d0)],'fields':Array[_0x172a43(0x1c5)](_0x28e454)};}catch{_0x193e08[_0x172a43(0x1cc)](_0x172a43(0x1ea)+_0x3468a7+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x193e08['length']>0x0&&(_0x640130[_0x172a43(0x1ed)]=_0x193e08);}return{'ok':_0x3b2786[_0x172a43(0x1c3)],'data':_0x640130,'message':_0x3b2786[_0x172a43(0x1eb)]};}};
1
+ function a126_0x573d(_0x397c9e,_0x36c651){_0x397c9e=_0x397c9e-0x120;const _0x5a481c=a126_0x5a48();let _0x573d0c=_0x5a481c[_0x397c9e];return _0x573d0c;}const a126_0x15c65e=a126_0x573d;(function(_0x5b13b1,_0x23fa9b){const _0xe1e49f=a126_0x573d,_0xd5010f=_0x5b13b1();while(!![]){try{const _0xf17cf1=-parseInt(_0xe1e49f(0x133))/0x1*(-parseInt(_0xe1e49f(0x149))/0x2)+parseInt(_0xe1e49f(0x123))/0x3+-parseInt(_0xe1e49f(0x134))/0x4+parseInt(_0xe1e49f(0x12b))/0x5+parseInt(_0xe1e49f(0x126))/0x6*(-parseInt(_0xe1e49f(0x145))/0x7)+parseInt(_0xe1e49f(0x136))/0x8+-parseInt(_0xe1e49f(0x150))/0x9;if(_0xf17cf1===_0x23fa9b)break;else _0xd5010f['push'](_0xd5010f['shift']());}catch(_0x5e6d6b){_0xd5010f['push'](_0xd5010f['shift']());}}}(a126_0x5a48,0xc630e));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a126_0x5a48(){const _0x3737dd=['str','54MnTlCt','appCode','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','Provide\x20--file\x20or\x20--sql','\x22\x20not\x20found\x20or\x20not\x20accessible','1478980BEeINt','push','parameters','tableName','File\x20not\x20found:\x20','schemaWarnings','trim','toLowerCase','2GQqOEc','480296JpkZXh','validation','5661872BwpSSe','valid','type','string','schemas','isDangerous','length','sql','Table\x20\x22','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','isSelectOnly','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','map','get','944503RtkHQX','name','Dataset\x20\x22','validate','763292VffVAy','dbtableConfig','file','reason','fields','tables','message','4114854tjSgFJ','schema:','isArray','cwd','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','2509827HurbNa','sqlType'];a126_0x5a48=function(){return _0x3737dd;};return a126_0x5a48();}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a126_0x15c65e(0x13d),'command':a126_0x15c65e(0x148),'description':a126_0x15c65e(0x13f),'risk':'read','flags':[{'name':a126_0x15c65e(0x14b),'type':a126_0x15c65e(0x139),'description':a126_0x15c65e(0x142)},{'name':'sql','type':'string','description':a126_0x15c65e(0x122)},{'name':a126_0x15c65e(0x13a),'type':'string','description':a126_0x15c65e(0x128)}],async 'execute'(_0x34399e){const _0x20bf87=a126_0x15c65e,_0x1add54=_0x34399e[_0x20bf87(0x125)](_0x20bf87(0x14b)),_0x45d689=_0x34399e[_0x20bf87(0x125)](_0x20bf87(0x13d));if(!_0x1add54&&!_0x45d689)throw CliErrors['flagMissing']('file',_0x20bf87(0x129));let _0x357d6b;if(_0x1add54){const _0x53e9e7=resolve(process[_0x20bf87(0x121)](),_0x1add54);if(!existsSync(_0x53e9e7))throw CliErrors[_0x20bf87(0x135)](_0x20bf87(0x12f)+_0x53e9e7);_0x357d6b=readFileSync(_0x53e9e7,'utf-8');}else _0x357d6b=_0x45d689;const _0x3d9971=validateSql(_0x357d6b),_0x11bb41={'valid':_0x3d9971[_0x20bf87(0x137)],'sqlType':_0x3d9971['sqlType'][_0x20bf87(0x138)],'isSelectOnly':_0x3d9971[_0x20bf87(0x124)][_0x20bf87(0x141)],'isDangerous':_0x3d9971['sqlType'][_0x20bf87(0x13b)],'tables':_0x3d9971[_0x20bf87(0x14e)],'parameters':_0x3d9971[_0x20bf87(0x12d)],'message':_0x3d9971[_0x20bf87(0x14f)]};_0x3d9971['sqlType']['reason']&&(_0x11bb41[_0x20bf87(0x14c)]=_0x3d9971[_0x20bf87(0x124)][_0x20bf87(0x14c)]);const _0xe4af19=_0x34399e['str'](_0x20bf87(0x13a));if(_0xe4af19&&_0x3d9971[_0x20bf87(0x137)]){const _0x52c3f9=_0xe4af19['split'](',')[_0x20bf87(0x143)](_0x2a2937=>_0x2a2937[_0x20bf87(0x131)]())['filter'](Boolean),_0x4ab2a1=[],_0x5c8d48=await listDatasets(_0x34399e[_0x20bf87(0x127)]),_0x25a574=new Map(_0x5c8d48['map'](_0x2160a9=>[_0x2160a9[_0x20bf87(0x14a)]?.[_0x20bf87(0x12e)]?.['toLowerCase'](),_0x2160a9]));for(const _0x36b8cd of _0x3d9971[_0x20bf87(0x14e)]){const _0x5894c4=_0x25a574[_0x20bf87(0x144)](_0x36b8cd[_0x20bf87(0x132)]());!_0x5894c4&&_0x4ab2a1[_0x20bf87(0x12c)](_0x20bf87(0x13e)+_0x36b8cd+_0x20bf87(0x140));}for(const _0x91a147 of _0x52c3f9){try{const _0x4ced22=await getDatasetDetail(_0x91a147),_0x53aafa=Array[_0x20bf87(0x120)](_0x4ced22[_0x20bf87(0x14d)])?_0x4ced22[_0x20bf87(0x14d)]:[],_0x85d4d1=new Set(_0x53aafa['map'](_0x611d82=>_0x611d82[_0x20bf87(0x146)]?.[_0x20bf87(0x132)]())),_0x2e57ca=_0x4ced22['dbtableConfig']?.[_0x20bf87(0x12e)]||_0x4ced22[_0x20bf87(0x12e)]||_0x91a147;_0x11bb41[_0x20bf87(0x151)+_0x2e57ca]={'code':_0x91a147,'tableName':_0x2e57ca,'fieldCount':_0x85d4d1['size'],'fields':Array['from'](_0x85d4d1)};}catch{_0x4ab2a1[_0x20bf87(0x12c)](_0x20bf87(0x147)+_0x91a147+_0x20bf87(0x12a));}}_0x4ab2a1[_0x20bf87(0x13c)]>0x0&&(_0x11bb41[_0x20bf87(0x130)]=_0x4ab2a1);}return{'ok':_0x3d9971[_0x20bf87(0x137)],'data':_0x11bb41,'message':_0x3d9971[_0x20bf87(0x14f)]};}};
@@ -1 +1 @@
1
- const a126_0x52207c=a126_0x3496;(function(_0x2817c0,_0x4b7bfb){const _0x44b271=a126_0x3496,_0x1dd957=_0x2817c0();while(!![]){try{const _0x5744fb=parseInt(_0x44b271(0x10e))/0x1+parseInt(_0x44b271(0x107))/0x2+parseInt(_0x44b271(0x12d))/0x3+parseInt(_0x44b271(0x11d))/0x4*(parseInt(_0x44b271(0x119))/0x5)+-parseInt(_0x44b271(0x10a))/0x6*(-parseInt(_0x44b271(0x109))/0x7)+parseInt(_0x44b271(0x115))/0x8+parseInt(_0x44b271(0x126))/0x9*(-parseInt(_0x44b271(0x125))/0xa);if(_0x5744fb===_0x4b7bfb)break;else _0x1dd957['push'](_0x1dd957['shift']());}catch(_0x5161ef){_0x1dd957['push'](_0x1dd957['shift']());}}}(a126_0x449f,0x2b7bf));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a126_0x52207c(0x114),a126_0x52207c(0x110),a126_0x52207c(0x112),a126_0x52207c(0x127),a126_0x52207c(0x113)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a126_0x52207c(0x111),'env',a126_0x52207c(0x112),a126_0x52207c(0x127),a126_0x52207c(0x114),'accessKey','apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x4fe3c3){return[..._0x4fe3c3]['join'](',\x20');}function a126_0x3496(_0x11f30c,_0x5c5f6a){_0x11f30c=_0x11f30c-0x107;const _0x449f72=a126_0x449f();let _0x3496b7=_0x449f72[_0x11f30c];return _0x3496b7;}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x30d96b){const _0x1722de=a126_0x52207c;return TOP_LEVEL_CONFIG_KEYS[_0x1722de(0x124)](_0x30d96b);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x20d201=a126_0x52207c;return _0x20d201(0x10b)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a126_0x52207c(0x12c),'apiDir':a126_0x52207c(0x10c),'cookie':a126_0x52207c(0x114),'accessKey':a126_0x52207c(0x110),'defaultFormat':a126_0x52207c(0x127),'pageSize':a126_0x52207c(0x108),'riskLevel':a126_0x52207c(0x113),'locale':a126_0x52207c(0x112)};function a126_0x449f(){const _0x43e4cb=['en-US','Auth\x20cookie','463272UBDrAn','pageSize','321433HjNcNn','24XgQTtA','Config\x20key\x20(','apiDir','inherit','133037OmZpVu','entries','accessKey','appcode','locale','riskLevel','cookie','1642528KwtRGY','length','zh-CN','toLowerCase','5jlHvIf','Target\x20environment','defaultApp','string','1149740qrNyJb','app','Risk\x20level','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','apps','trim','Locale','has','2525200JxaayX','36wajXVe','format','map','defaultFormat','filter','number','env','441273hPDRjK'];a126_0x449f=function(){return _0x43e4cb;};return a126_0x449f();}export function getAppProfileFlagDefs(){const _0x5aea9f=a126_0x52207c;return[{'name':_0x5aea9f(0x12c),'type':_0x5aea9f(0x11c),'description':_0x5aea9f(0x11a),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x5aea9f(0x10c),'type':_0x5aea9f(0x11c),'description':'API\x20directory\x20path'},{'name':_0x5aea9f(0x114),'type':_0x5aea9f(0x11c),'description':_0x5aea9f(0x12f),'hidden':!![]},{'name':_0x5aea9f(0x110),'type':_0x5aea9f(0x11c),'description':'Access\x20key','hidden':!![]},{'name':_0x5aea9f(0x129),'type':'string','description':_0x5aea9f(0x120),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x5aea9f(0x108),'type':_0x5aea9f(0x12b),'description':'Default\x20page\x20size'},{'name':'riskLevel','type':'string','description':_0x5aea9f(0x11f),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x5aea9f(0x112),'type':'string','description':_0x5aea9f(0x123)}];}export function collectAppProfileOverrides(_0x515cbc){const _0x45fe81=a126_0x52207c,_0xf0ef8a={};for(const [_0x4f1d08,_0x5ed817]of Object[_0x45fe81(0x10f)](APP_PROFILE_FLAG_KEY_MAP)){const _0x12e5a5=_0x515cbc(_0x4f1d08);if(!_0x12e5a5)continue;_0xf0ef8a[_0x5ed817]=_0x5ed817===_0x45fe81(0x108)?Number(_0x12e5a5):_0x12e5a5;}return _0xf0ef8a;}export function buildAppProfileListFields(_0x4de3c5){const _0x9e22ad=a126_0x52207c;return{'env':_0x4de3c5[_0x9e22ad(0x12c)]??null,'apiDir':_0x4de3c5['apiDir']??null,'hasCookie':!!_0x4de3c5['cookie'],'hasAccessKey':!!_0x4de3c5[_0x9e22ad(0x110)],'format':_0x4de3c5['format']??null,'pageSize':_0x4de3c5['pageSize']??null,'riskLevel':_0x4de3c5['riskLevel']??null,'locale':_0x4de3c5[_0x9e22ad(0x112)]??null};}export function buildAppDoctorFields(_0x49f664,_0x4aa8a0){const _0x4896d9=a126_0x52207c;return{'env':{'value':_0x49f664['env']||_0x4aa8a0[_0x4896d9(0x12c)],'source':_0x49f664[_0x4896d9(0x12c)]?_0x4896d9(0x11e):_0x4896d9(0x10d)},'apiDir':{'value':_0x49f664['apiDir']||_0x4aa8a0[_0x4896d9(0x10c)],'source':_0x49f664[_0x4896d9(0x10c)]?_0x4896d9(0x11e):_0x4896d9(0x10d)},'cookie':{'value':_0x49f664[_0x4896d9(0x114)]||_0x4aa8a0[_0x4896d9(0x114)],'source':_0x49f664[_0x4896d9(0x114)]?'app':_0x4896d9(0x10d)},'accessKey':{'value':_0x49f664[_0x4896d9(0x110)]||_0x4aa8a0[_0x4896d9(0x110)],'source':_0x49f664[_0x4896d9(0x110)]?_0x4896d9(0x11e):_0x4896d9(0x10d)}};}export function buildCanonicalAppConfig(_0x4e37a3,_0x2afdc0){const _0x4534b6=a126_0x52207c,_0xa7d13=_0x4e37a3[_0x4534b6(0x128)](_0x271a42=>String(_0x271a42||'')[_0x4534b6(0x122)]())[_0x4534b6(0x12a)](Boolean);if(_0xa7d13[_0x4534b6(0x116)]===0x0)return{};const _0x46688f={};for(const _0x46856f of _0xa7d13){_0x46688f[_0x46856f]=_0x2afdc0?{'appcode':_0x46856f,'env':_0x2afdc0}:{'appcode':_0x46856f};}return{'apps':_0x46688f,'defaultApp':_0xa7d13[0x0]};}export function buildCanonicalProjectConfig(_0xf628f3,_0x488d20){const _0x4ac513=a126_0x52207c,{appCodes:appCodes=[],env:_0x317d8c,metadata:_0x20d0a7}=_0x488d20,_0xff316={..._0xf628f3,..._0x20d0a7||{}};delete _0xff316[_0x4ac513(0x111)],delete _0xff316[_0x4ac513(0x11e)];if(_0x317d8c)_0xff316[_0x4ac513(0x12c)]=_0x317d8c;else!_0xff316['env']&&(_0xff316['env']=DEFAULT_CONFIG_VALUES['env']);const _0x5d2644=buildCanonicalAppConfig(appCodes,_0xff316['env']);return Object['keys'](_0x5d2644)['length']>0x0&&(_0xff316['apps']=_0x5d2644[_0x4ac513(0x121)],_0xff316['defaultApp']=_0x5d2644[_0x4ac513(0x11b)]),_0xff316;}const LOCALE_MAP={'zh':a126_0x52207c(0x117),'zh-cn':a126_0x52207c(0x117),'zh_cn':'zh-CN','en':a126_0x52207c(0x12e),'en-us':a126_0x52207c(0x12e),'en_us':a126_0x52207c(0x12e)};export function normalizeLocale(_0x2d358e){const _0x140f67=a126_0x52207c;if(!_0x2d358e)return null;return LOCALE_MAP[_0x2d358e[_0x140f67(0x118)]()]??null;}
1
+ const a127_0x223b74=a127_0x38e2;(function(_0x26918a,_0xe8a49b){const _0x189ae7=a127_0x38e2,_0x59a5d0=_0x26918a();while(!![]){try{const _0x461dd1=-parseInt(_0x189ae7(0x1e4))/0x1*(parseInt(_0x189ae7(0x1cb))/0x2)+parseInt(_0x189ae7(0x1ca))/0x3*(-parseInt(_0x189ae7(0x1e2))/0x4)+parseInt(_0x189ae7(0x1db))/0x5+parseInt(_0x189ae7(0x1cd))/0x6*(-parseInt(_0x189ae7(0x1e5))/0x7)+parseInt(_0x189ae7(0x1c9))/0x8+parseInt(_0x189ae7(0x1d3))/0x9+-parseInt(_0x189ae7(0x1e8))/0xa;if(_0x461dd1===_0xe8a49b)break;else _0x59a5d0['push'](_0x59a5d0['shift']());}catch(_0x24cb66){_0x59a5d0['push'](_0x59a5d0['shift']());}}}(a127_0x3205,0x7c692));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a127_0x38e2(_0x3d2760,_0x3303a5){_0x3d2760=_0x3d2760-0x1c7;const _0x320579=a127_0x3205();let _0x38e2fe=_0x320579[_0x3d2760];return _0x38e2fe;}export const PROJECT_CREATE_INHERITABLE_KEYS=[a127_0x223b74(0x1ea),a127_0x223b74(0x1d9),a127_0x223b74(0x1e3),'format',a127_0x223b74(0x1ec)];function a127_0x3205(){const _0x4d8831=['6360280clUjQA','toLowerCase','cookie','trim','riskLevel','length','en-US','inherit','5681680LoejTG','478209Kqaoxw','58zmCsOx','Access\x20key','6CYgcgb','zh-CN','defaultApp','pageSize','string','map','7751844cgChnk','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','has','Auth\x20cookie','env','Default\x20page\x20size','accessKey','Target\x20environment','3031240jAbHcd','apps','apiDir','app','join','appcode','format','4tAFJmn','locale','18650qqukEd','2323349QUXoTy','filter','Risk\x20level'];a127_0x3205=function(){return _0x4d8831;};return a127_0x3205();}export const TOP_LEVEL_CONFIG_KEYS=new Set([a127_0x223b74(0x1e0),'env',a127_0x223b74(0x1e3),a127_0x223b74(0x1e1),a127_0x223b74(0x1ea),'accessKey','apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x3ceb0a){const _0x1ca5a1=a127_0x223b74;return[..._0x3ceb0a][_0x1ca5a1(0x1df)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x50ab17){const _0x220742=a127_0x223b74;return TOP_LEVEL_CONFIG_KEYS[_0x220742(0x1d5)](_0x50ab17);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){return'Config\x20key\x20('+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a127_0x223b74(0x1d7),'apiDir':'apiDir','cookie':a127_0x223b74(0x1ea),'accessKey':a127_0x223b74(0x1d9),'defaultFormat':'format','pageSize':a127_0x223b74(0x1d0),'riskLevel':a127_0x223b74(0x1ec),'locale':a127_0x223b74(0x1e3)};export function getAppProfileFlagDefs(){const _0x1cdcc3=a127_0x223b74;return[{'name':_0x1cdcc3(0x1d7),'type':_0x1cdcc3(0x1d1),'description':_0x1cdcc3(0x1da),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x1cdcc3(0x1dd),'type':_0x1cdcc3(0x1d1),'description':'API\x20directory\x20path'},{'name':_0x1cdcc3(0x1ea),'type':_0x1cdcc3(0x1d1),'description':_0x1cdcc3(0x1d6),'hidden':!![]},{'name':_0x1cdcc3(0x1d9),'type':_0x1cdcc3(0x1d1),'description':_0x1cdcc3(0x1cc),'hidden':!![]},{'name':'defaultFormat','type':'string','description':_0x1cdcc3(0x1d4),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':'number','description':_0x1cdcc3(0x1d8)},{'name':'riskLevel','type':'string','description':_0x1cdcc3(0x1e7),'enum':[...RISK_LEVEL_VALUES]},{'name':'locale','type':_0x1cdcc3(0x1d1),'description':'Locale'}];}export function collectAppProfileOverrides(_0x5f5d36){const _0x3c0f56=a127_0x223b74,_0x2a0fe1={};for(const [_0x582bd6,_0x1c56b3]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x3c0934=_0x5f5d36(_0x582bd6);if(!_0x3c0934)continue;_0x2a0fe1[_0x1c56b3]=_0x1c56b3===_0x3c0f56(0x1d0)?Number(_0x3c0934):_0x3c0934;}return _0x2a0fe1;}export function buildAppProfileListFields(_0x43be0b){const _0x548e1e=a127_0x223b74;return{'env':_0x43be0b[_0x548e1e(0x1d7)]??null,'apiDir':_0x43be0b['apiDir']??null,'hasCookie':!!_0x43be0b[_0x548e1e(0x1ea)],'hasAccessKey':!!_0x43be0b[_0x548e1e(0x1d9)],'format':_0x43be0b['format']??null,'pageSize':_0x43be0b[_0x548e1e(0x1d0)]??null,'riskLevel':_0x43be0b[_0x548e1e(0x1ec)]??null,'locale':_0x43be0b[_0x548e1e(0x1e3)]??null};}export function buildAppDoctorFields(_0x323b20,_0x2061bf){const _0xcbf484=a127_0x223b74;return{'env':{'value':_0x323b20['env']||_0x2061bf[_0xcbf484(0x1d7)],'source':_0x323b20[_0xcbf484(0x1d7)]?_0xcbf484(0x1de):_0xcbf484(0x1c8)},'apiDir':{'value':_0x323b20[_0xcbf484(0x1dd)]||_0x2061bf[_0xcbf484(0x1dd)],'source':_0x323b20[_0xcbf484(0x1dd)]?'app':_0xcbf484(0x1c8)},'cookie':{'value':_0x323b20[_0xcbf484(0x1ea)]||_0x2061bf[_0xcbf484(0x1ea)],'source':_0x323b20[_0xcbf484(0x1ea)]?'app':_0xcbf484(0x1c8)},'accessKey':{'value':_0x323b20['accessKey']||_0x2061bf[_0xcbf484(0x1d9)],'source':_0x323b20['accessKey']?_0xcbf484(0x1de):_0xcbf484(0x1c8)}};}export function buildCanonicalAppConfig(_0x21f301,_0x275697){const _0x5d83fd=a127_0x223b74,_0x52227c=_0x21f301[_0x5d83fd(0x1d2)](_0x153a75=>String(_0x153a75||'')[_0x5d83fd(0x1eb)]())[_0x5d83fd(0x1e6)](Boolean);if(_0x52227c[_0x5d83fd(0x1ed)]===0x0)return{};const _0x33955e={};for(const _0x2def15 of _0x52227c){_0x33955e[_0x2def15]=_0x275697?{'appcode':_0x2def15,'env':_0x275697}:{'appcode':_0x2def15};}return{'apps':_0x33955e,'defaultApp':_0x52227c[0x0]};}export function buildCanonicalProjectConfig(_0x8b8bb8,_0x78f24d){const _0x33c30b=a127_0x223b74,{appCodes:appCodes=[],env:_0x468de2,metadata:_0x47cddb}=_0x78f24d,_0x4f8df3={..._0x8b8bb8,..._0x47cddb||{}};delete _0x4f8df3[_0x33c30b(0x1e0)],delete _0x4f8df3['app'];if(_0x468de2)_0x4f8df3[_0x33c30b(0x1d7)]=_0x468de2;else!_0x4f8df3[_0x33c30b(0x1d7)]&&(_0x4f8df3['env']=DEFAULT_CONFIG_VALUES['env']);const _0xe46ae=buildCanonicalAppConfig(appCodes,_0x4f8df3['env']);return Object['keys'](_0xe46ae)[_0x33c30b(0x1ed)]>0x0&&(_0x4f8df3[_0x33c30b(0x1dc)]=_0xe46ae[_0x33c30b(0x1dc)],_0x4f8df3[_0x33c30b(0x1cf)]=_0xe46ae[_0x33c30b(0x1cf)]),_0x4f8df3;}const LOCALE_MAP={'zh':a127_0x223b74(0x1ce),'zh-cn':a127_0x223b74(0x1ce),'zh_cn':a127_0x223b74(0x1ce),'en':a127_0x223b74(0x1c7),'en-us':'en-US','en_us':a127_0x223b74(0x1c7)};export function normalizeLocale(_0x144854){const _0x29de82=a127_0x223b74;if(!_0x144854)return null;return LOCALE_MAP[_0x144854[_0x29de82(0x1e9)]()]??null;}
@@ -1 +1 @@
1
- const a127_0x2cdc94=a127_0x542c;function a127_0x542c(_0x52c6e8,_0x1b818f){_0x52c6e8=_0x52c6e8-0xd6;const _0xffc122=a127_0xffc1();let _0x542c37=_0xffc122[_0x52c6e8];return _0x542c37;}(function(_0x552884,_0x3f18de){const _0x31071c=a127_0x542c,_0x395178=_0x552884();while(!![]){try{const _0x4d475f=-parseInt(_0x31071c(0xdf))/0x1*(parseInt(_0x31071c(0xd7))/0x2)+parseInt(_0x31071c(0xe0))/0x3*(parseInt(_0x31071c(0xda))/0x4)+parseInt(_0x31071c(0xdc))/0x5+-parseInt(_0x31071c(0xdb))/0x6+parseInt(_0x31071c(0xd8))/0x7+-parseInt(_0x31071c(0xdd))/0x8*(parseInt(_0x31071c(0xde))/0x9)+parseInt(_0x31071c(0xe1))/0xa*(parseInt(_0x31071c(0xd9))/0xb);if(_0x4d475f===_0x3f18de)break;else _0x395178['push'](_0x395178['shift']());}catch(_0x482c62){_0x395178['push'](_0x395178['shift']());}}}(a127_0xffc1,0xa02c2));export const CLI_VERSION_POLICY_URL=a127_0x2cdc94(0xd6);function a127_0xffc1(){const _0x1f76a4=['3UYTdRn','3855JPpdvY','90cJAlWU','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','505714FVwzSw','4326133gNYssJ','564223OfCbSP','3148kFMhqX','4336260azoEaq','6559425CMrlJd','94616PQqOct','963gqvfRu'];a127_0xffc1=function(){return _0x1f76a4;};return a127_0xffc1();}
1
+ const a128_0x37ec8b=a128_0x528d;function a128_0x993a(){const _0x47b09d=['9659340rqDrlF','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','244UsidjP','309176gFmtKT','38697DvSZRs','916995QCmtVw','3991092UYxOBh','72tFPDuQ','3004360QoJOFz','118qHkTrP'];a128_0x993a=function(){return _0x47b09d;};return a128_0x993a();}function a128_0x528d(_0x23bcdf,_0x3ade90){_0x23bcdf=_0x23bcdf-0xa3;const _0x993afa=a128_0x993a();let _0x528d37=_0x993afa[_0x23bcdf];return _0x528d37;}(function(_0x2db937,_0x2fd550){const _0x5c5e2d=a128_0x528d,_0x28dd73=_0x2db937();while(!![]){try{const _0x24ede6=-parseInt(_0x5c5e2d(0xa4))/0x1*(parseInt(_0x5c5e2d(0xa7))/0x2)+parseInt(_0x5c5e2d(0xa9))/0x3+-parseInt(_0x5c5e2d(0xa3))/0x4+-parseInt(_0x5c5e2d(0xaa))/0x5+parseInt(_0x5c5e2d(0xab))/0x6+-parseInt(_0x5c5e2d(0xa8))/0x7*(parseInt(_0x5c5e2d(0xac))/0x8)+parseInt(_0x5c5e2d(0xa5))/0x9;if(_0x24ede6===_0x2fd550)break;else _0x28dd73['push'](_0x28dd73['shift']());}catch(_0x25205b){_0x28dd73['push'](_0x28dd73['shift']());}}}(a128_0x993a,0x62dd0));export const CLI_VERSION_POLICY_URL=a128_0x37ec8b(0xa6);
@@ -1 +1 @@
1
- function a128_0x47dd(){const _0xc3ef9a=['verbose','operationType','output','function-node','target','pagesize','Description\x20file','key','db-id','52420dbDSWy','dbid','7oFPvtG','production\x20|\x20daily','Title','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Code\x20filter','format','SQL\x20string','global','Force\x20overwrite','Override\x20appcode','type','sqlname','Dataset\x20code','all','sql','Config\x20value','dbId','@lovrabet/rabetbase-cli','JSON\x20params','Confirm\x20destructive\x20action','datasetcode','value','Name','page','nonInteractive','file','env','Preview\x20operation\x20without\x20executing','Clear','skip-imports','Type\x20filter','File\x20path','title','yes','Skip\x20import\x20generation','description-file','confirm','name','Use\x20remote','Page\x20size','DB\x20ID','expected-count','non-interactive','Skip\x20confirmation\x20for\x20high-risk\x20writes','Select\x20app\x20profile\x20by\x20name','dryRun','operation','13543060gfQSQW','fromEntries','Expected\x20affected\x20count','app','boolean','dry-run','string','description','params','Operation\x20type','map','clear','SQL\x20code','sqlcode','Alias\x20for\x20--non-interactive','1109262TbLVKm','Page\x20number','remote','1032816pSDsOn','8986752FOeoxs','meowKey','SQL\x20name','appcode','Description','force','help','1439135nTLqGO','schemas','Rabetbase\x20CLI','descriptionFile','project','Schemas','129PecCCS','Enable\x20BFF\x20save','<code>','skipImports','Output\x20format','watch','Target\x20path','18uHTIBC','keyword','Verbose\x20output','enable-bff-save','code','1092600ynbxbS'];a128_0x47dd=function(){return _0xc3ef9a;};return a128_0x47dd();}const a128_0x2dc4d4=a128_0x4d9c;(function(_0x3ac0ce,_0x97c1f7){const _0x44e4da=a128_0x4d9c,_0x379a61=_0x3ac0ce();while(!![]){try{const _0x5c9f2d=parseInt(_0x44e4da(0x156))/0x1+parseInt(_0x44e4da(0x1ba))/0x2+parseInt(_0x44e4da(0x164))/0x3*(-parseInt(_0x44e4da(0x17a))/0x4)+-parseInt(_0x44e4da(0x15e))/0x5*(parseInt(_0x44e4da(0x16b))/0x6)+-parseInt(_0x44e4da(0x17c))/0x7*(-parseInt(_0x44e4da(0x170))/0x8)+-parseInt(_0x44e4da(0x157))/0x9+parseInt(_0x44e4da(0x1ab))/0xa;if(_0x5c9f2d===_0x97c1f7)break;else _0x379a61['push'](_0x379a61['shift']());}catch(_0x146cb1){_0x379a61['push'](_0x379a61['shift']());}}}(a128_0x47dd,0x9f604));export const CLI_BIN_NAME='rabetbase';export const CLI_DISPLAY_NAME=a128_0x2dc4d4(0x160);export const NPM_PACKAGE_NAME=a128_0x2dc4d4(0x18d);export const GLOBAL_FLAGS=[{'name':a128_0x2dc4d4(0x15a),'meowKey':a128_0x2dc4d4(0x15a),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x185),'hint':a128_0x2dc4d4(0x166)},{'name':'app','meowKey':a128_0x2dc4d4(0x1ae),'type':'string','description':a128_0x2dc4d4(0x1a8),'hint':'<name>'},{'name':'env','meowKey':a128_0x2dc4d4(0x196),'type':a128_0x2dc4d4(0x1b1),'description':'Environment','hint':a128_0x2dc4d4(0x17d)},{'name':a128_0x2dc4d4(0x181),'meowKey':'format','type':'string','description':a128_0x2dc4d4(0x168),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x17f),'hint':'<expr>'},{'name':a128_0x2dc4d4(0x1b0),'meowKey':a128_0x2dc4d4(0x1a9),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x197)},{'name':a128_0x2dc4d4(0x19d),'meowKey':a128_0x2dc4d4(0x19d),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x1a7)},{'name':a128_0x2dc4d4(0x1a6),'meowKey':a128_0x2dc4d4(0x194),'type':a128_0x2dc4d4(0x1af),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a128_0x2dc4d4(0x183),'meowKey':a128_0x2dc4d4(0x183),'type':a128_0x2dc4d4(0x1af),'description':'Use\x20global\x20config\x20scope'},{'name':a128_0x2dc4d4(0x162),'meowKey':a128_0x2dc4d4(0x162),'type':a128_0x2dc4d4(0x1af),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x1b9),'hidden':!![]},{'name':a128_0x2dc4d4(0x15d),'meowKey':a128_0x2dc4d4(0x15d),'type':a128_0x2dc4d4(0x1af),'description':'Show\x20help'},{'name':'name','meowKey':a128_0x2dc4d4(0x1a1),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x192),'hidden':!![]},{'name':a128_0x2dc4d4(0x19c),'meowKey':a128_0x2dc4d4(0x19c),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x17e),'hidden':!![]},{'name':'clear','meowKey':a128_0x2dc4d4(0x1b6),'type':'boolean','description':a128_0x2dc4d4(0x198),'hidden':!![]},{'name':a128_0x2dc4d4(0x169),'meowKey':a128_0x2dc4d4(0x169),'type':a128_0x2dc4d4(0x1af),'description':'Watch\x20mode','hidden':!![]},{'name':'output','meowKey':a128_0x2dc4d4(0x173),'type':a128_0x2dc4d4(0x1b1),'description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':a128_0x2dc4d4(0x1b3),'type':'string','description':a128_0x2dc4d4(0x18e),'hidden':!![]},{'name':a128_0x2dc4d4(0x190),'meowKey':a128_0x2dc4d4(0x190),'type':'string','description':a128_0x2dc4d4(0x188),'hidden':!![]},{'name':a128_0x2dc4d4(0x189),'meowKey':a128_0x2dc4d4(0x189),'type':a128_0x2dc4d4(0x1af),'description':'Apply\x20to\x20all','hidden':!![]},{'name':a128_0x2dc4d4(0x16e),'meowKey':'enableBffSave','type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x165),'hidden':!![]},{'name':'id','meowKey':'id','type':a128_0x2dc4d4(0x1b1),'description':'Record\x20ID','hidden':!![]},{'name':a128_0x2dc4d4(0x186),'meowKey':a128_0x2dc4d4(0x186),'type':'string','description':a128_0x2dc4d4(0x19a),'hidden':!![]},{'name':'file','meowKey':a128_0x2dc4d4(0x195),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x19b),'hidden':!![]},{'name':a128_0x2dc4d4(0x1b8),'meowKey':a128_0x2dc4d4(0x1b8),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1b7),'hidden':!![]},{'name':'sql-name','meowKey':'sqlName','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x159),'hidden':!![]},{'name':a128_0x2dc4d4(0x187),'meowKey':a128_0x2dc4d4(0x187),'type':'string','description':'SQL\x20name','hidden':!![]},{'name':a128_0x2dc4d4(0x179),'meowKey':a128_0x2dc4d4(0x18c),'type':'string','description':a128_0x2dc4d4(0x1a4),'hidden':!![]},{'name':a128_0x2dc4d4(0x17b),'meowKey':a128_0x2dc4d4(0x17b),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1a4),'hidden':!![]},{'name':a128_0x2dc4d4(0x1b2),'meowKey':'description','type':'string','description':a128_0x2dc4d4(0x15b),'hidden':!![]},{'name':a128_0x2dc4d4(0x19f),'meowKey':a128_0x2dc4d4(0x161),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x177),'hidden':!![]},{'name':'page','meowKey':a128_0x2dc4d4(0x193),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1bb),'hidden':!![]},{'name':a128_0x2dc4d4(0x176),'meowKey':a128_0x2dc4d4(0x176),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1a3),'hidden':!![]},{'name':a128_0x2dc4d4(0x16c),'meowKey':a128_0x2dc4d4(0x16c),'type':a128_0x2dc4d4(0x1b1),'description':'Keyword\x20filter','hidden':!![]},{'name':a128_0x2dc4d4(0x16f),'meowKey':a128_0x2dc4d4(0x16f),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x180),'hidden':!![]},{'name':'sql','meowKey':a128_0x2dc4d4(0x18a),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x182),'hidden':!![]},{'name':'schemas','meowKey':a128_0x2dc4d4(0x15f),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x163),'hidden':!![]},{'name':a128_0x2dc4d4(0x1aa),'meowKey':a128_0x2dc4d4(0x1aa),'type':a128_0x2dc4d4(0x1b1),'description':'Operation\x20type','hidden':!![]},{'name':a128_0x2dc4d4(0x175),'meowKey':a128_0x2dc4d4(0x175),'type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x16a),'hidden':!![]},{'name':a128_0x2dc4d4(0x199),'meowKey':a128_0x2dc4d4(0x167),'type':'boolean','description':a128_0x2dc4d4(0x19e),'hidden':!![]},{'name':a128_0x2dc4d4(0x178),'meowKey':a128_0x2dc4d4(0x178),'type':'string','description':'Config\x20key','hidden':!![]},{'name':a128_0x2dc4d4(0x191),'meowKey':'value','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x18b),'hidden':!![]},{'name':a128_0x2dc4d4(0x15c),'meowKey':a128_0x2dc4d4(0x15c),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x184),'hidden':!![]},{'name':a128_0x2dc4d4(0x1a0),'meowKey':a128_0x2dc4d4(0x1a0),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x18f),'hidden':!![]},{'name':a128_0x2dc4d4(0x155),'meowKey':a128_0x2dc4d4(0x155),'type':'boolean','description':a128_0x2dc4d4(0x1a2),'hidden':!![]},{'name':a128_0x2dc4d4(0x171),'meowKey':a128_0x2dc4d4(0x171),'type':a128_0x2dc4d4(0x1af),'description':a128_0x2dc4d4(0x16d),'hidden':!![]},{'name':a128_0x2dc4d4(0x1a5),'meowKey':'expectedCount','type':a128_0x2dc4d4(0x1b1),'description':a128_0x2dc4d4(0x1ad),'hidden':!![]},{'name':'operation-type','meowKey':a128_0x2dc4d4(0x172),'type':'string','description':a128_0x2dc4d4(0x1b4),'hidden':!![]},{'name':a128_0x2dc4d4(0x174),'meowKey':'functionNode','type':a128_0x2dc4d4(0x1b1),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode',a128_0x2dc4d4(0x1ae),a128_0x2dc4d4(0x196),'format','jq',a128_0x2dc4d4(0x1b0),a128_0x2dc4d4(0x19d),'non-interactive','ci']);function a128_0x4d9c(_0x4dc740,_0x5b5ae2){_0x4dc740=_0x4dc740-0x155;const _0x47ddd5=a128_0x47dd();let _0x4d9c2f=_0x47ddd5[_0x4dc740];return _0x4d9c2f;}export function buildMeowFlags(){const _0x163594=a128_0x2dc4d4;return Object[_0x163594(0x1ac)](GLOBAL_FLAGS[_0x163594(0x1b5)](_0x2ee2b3=>[_0x2ee2b3[_0x163594(0x158)],{'type':_0x2ee2b3['type']}]));}
1
+ const a129_0x1dd9a7=a129_0x408d;(function(_0x37688c,_0x49ba9e){const _0x22ba01=a129_0x408d,_0x4b6c4a=_0x37688c();while(!![]){try{const _0xf7eb37=-parseInt(_0x22ba01(0x134))/0x1*(-parseInt(_0x22ba01(0x105))/0x2)+-parseInt(_0x22ba01(0x114))/0x3*(-parseInt(_0x22ba01(0x128))/0x4)+parseInt(_0x22ba01(0xf7))/0x5+-parseInt(_0x22ba01(0x14f))/0x6*(-parseInt(_0x22ba01(0xee))/0x7)+parseInt(_0x22ba01(0x109))/0x8*(parseInt(_0x22ba01(0x150))/0x9)+parseInt(_0x22ba01(0x143))/0xa*(parseInt(_0x22ba01(0xf1))/0xb)+-parseInt(_0x22ba01(0xfa))/0xc;if(_0xf7eb37===_0x49ba9e)break;else _0x4b6c4a['push'](_0x4b6c4a['shift']());}catch(_0x1997b0){_0x4b6c4a['push'](_0x4b6c4a['shift']());}}}(a129_0x4385,0xdda20));function a129_0x408d(_0x1d1288,_0x1699de){_0x1d1288=_0x1d1288-0xe7;const _0x4385a1=a129_0x4385();let _0x408dba=_0x4385a1[_0x1d1288];return _0x408dba;}export const CLI_BIN_NAME=a129_0x1dd9a7(0x10a);export const CLI_DISPLAY_NAME=a129_0x1dd9a7(0xe8);export const NPM_PACKAGE_NAME=a129_0x1dd9a7(0x14b);export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a129_0x1dd9a7(0x136),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x140),'hint':a129_0x1dd9a7(0x137)},{'name':'app','meowKey':a129_0x1dd9a7(0x111),'type':a129_0x1dd9a7(0x151),'description':'Select\x20app\x20profile\x20by\x20name','hint':a129_0x1dd9a7(0x10b)},{'name':a129_0x1dd9a7(0x144),'meowKey':a129_0x1dd9a7(0x144),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0xfd),'hint':a129_0x1dd9a7(0x12e)},{'name':a129_0x1dd9a7(0xeb),'meowKey':a129_0x1dd9a7(0xeb),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x102),'hint':a129_0x1dd9a7(0xf6)},{'name':'jq','meowKey':'jq','type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x112),'hint':'<expr>'},{'name':a129_0x1dd9a7(0x11c),'meowKey':a129_0x1dd9a7(0x12d),'type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x148)},{'name':a129_0x1dd9a7(0x149),'meowKey':'yes','type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x117)},{'name':a129_0x1dd9a7(0x13f),'meowKey':'nonInteractive','type':'boolean','description':a129_0x1dd9a7(0x12f)},{'name':a129_0x1dd9a7(0xfc),'meowKey':a129_0x1dd9a7(0xfc),'type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0xea)},{'name':a129_0x1dd9a7(0x129),'meowKey':a129_0x1dd9a7(0x129),'type':'boolean','description':a129_0x1dd9a7(0xf4)},{'name':'ci','meowKey':'ci','type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x130),'hidden':!![]},{'name':a129_0x1dd9a7(0x12b),'meowKey':a129_0x1dd9a7(0x12b),'type':'boolean','description':a129_0x1dd9a7(0x152)},{'name':'name','meowKey':'name','type':'string','description':a129_0x1dd9a7(0x120),'hidden':!![]},{'name':a129_0x1dd9a7(0x12c),'meowKey':a129_0x1dd9a7(0x12c),'type':'string','description':a129_0x1dd9a7(0xf0),'hidden':!![]},{'name':a129_0x1dd9a7(0x101),'meowKey':a129_0x1dd9a7(0x101),'type':a129_0x1dd9a7(0x13c),'description':'Clear','hidden':!![]},{'name':a129_0x1dd9a7(0x13b),'meowKey':'watch','type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0xfb),'hidden':!![]},{'name':a129_0x1dd9a7(0x12a),'meowKey':a129_0x1dd9a7(0x12a),'type':'string','description':a129_0x1dd9a7(0x142),'hidden':!![]},{'name':'params','meowKey':a129_0x1dd9a7(0x100),'type':a129_0x1dd9a7(0x151),'description':'JSON\x20params','hidden':!![]},{'name':a129_0x1dd9a7(0x127),'meowKey':'datasetcode','type':'string','description':'Dataset\x20code','hidden':!![]},{'name':a129_0x1dd9a7(0xfe),'meowKey':'all','type':'boolean','description':a129_0x1dd9a7(0x145),'hidden':!![]},{'name':a129_0x1dd9a7(0x113),'meowKey':a129_0x1dd9a7(0x11a),'type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x13a),'hidden':!![]},{'name':'id','meowKey':'id','type':a129_0x1dd9a7(0x151),'description':'Record\x20ID','hidden':!![]},{'name':a129_0x1dd9a7(0x108),'meowKey':'type','type':a129_0x1dd9a7(0x151),'description':'Type\x20filter','hidden':!![]},{'name':a129_0x1dd9a7(0x116),'meowKey':a129_0x1dd9a7(0x116),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x14c),'hidden':!![]},{'name':'sqlcode','meowKey':a129_0x1dd9a7(0x121),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0xec),'hidden':!![]},{'name':a129_0x1dd9a7(0xf5),'meowKey':a129_0x1dd9a7(0x119),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x11d),'hidden':!![]},{'name':'sqlname','meowKey':a129_0x1dd9a7(0x10d),'type':a129_0x1dd9a7(0x151),'description':'SQL\x20name','hidden':!![]},{'name':a129_0x1dd9a7(0x122),'meowKey':'dbId','type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x107),'hidden':!![]},{'name':a129_0x1dd9a7(0x11f),'meowKey':a129_0x1dd9a7(0x11f),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x107),'hidden':!![]},{'name':a129_0x1dd9a7(0xed),'meowKey':a129_0x1dd9a7(0xed),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x14e),'hidden':!![]},{'name':a129_0x1dd9a7(0x103),'meowKey':a129_0x1dd9a7(0x14a),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x146),'hidden':!![]},{'name':a129_0x1dd9a7(0x13d),'meowKey':a129_0x1dd9a7(0x13d),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x131),'hidden':!![]},{'name':a129_0x1dd9a7(0x126),'meowKey':a129_0x1dd9a7(0x126),'type':'string','description':'Page\x20size','hidden':!![]},{'name':a129_0x1dd9a7(0xf3),'meowKey':a129_0x1dd9a7(0xf3),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x141),'hidden':!![]},{'name':a129_0x1dd9a7(0xe9),'meowKey':a129_0x1dd9a7(0xe9),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x135),'hidden':!![]},{'name':a129_0x1dd9a7(0x106),'meowKey':a129_0x1dd9a7(0x106),'type':a129_0x1dd9a7(0x151),'description':'SQL\x20string','hidden':!![]},{'name':a129_0x1dd9a7(0x118),'meowKey':'schemas','type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0x138),'hidden':!![]},{'name':a129_0x1dd9a7(0x147),'meowKey':a129_0x1dd9a7(0x147),'type':'string','description':a129_0x1dd9a7(0xf8),'hidden':!![]},{'name':a129_0x1dd9a7(0x13e),'meowKey':a129_0x1dd9a7(0x13e),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a129_0x1dd9a7(0x133),'meowKey':'skipImports','type':'boolean','description':'Skip\x20import\x20generation','hidden':!![]},{'name':a129_0x1dd9a7(0x10e),'meowKey':a129_0x1dd9a7(0x10e),'type':'string','description':a129_0x1dd9a7(0x139),'hidden':!![]},{'name':a129_0x1dd9a7(0xf2),'meowKey':a129_0x1dd9a7(0xf2),'type':a129_0x1dd9a7(0x151),'description':'Config\x20value','hidden':!![]},{'name':a129_0x1dd9a7(0x110),'meowKey':'force','type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x115),'hidden':!![]},{'name':a129_0x1dd9a7(0xef),'meowKey':a129_0x1dd9a7(0xef),'type':a129_0x1dd9a7(0x13c),'description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a129_0x1dd9a7(0x11b),'meowKey':'remote','type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x10f),'hidden':!![]},{'name':'verbose','meowKey':a129_0x1dd9a7(0x14d),'type':a129_0x1dd9a7(0x13c),'description':a129_0x1dd9a7(0x125),'hidden':!![]},{'name':'expected-count','meowKey':a129_0x1dd9a7(0x10c),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0xf9),'hidden':!![]},{'name':a129_0x1dd9a7(0x123),'meowKey':a129_0x1dd9a7(0xe7),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0xf8),'hidden':!![]},{'name':a129_0x1dd9a7(0x124),'meowKey':a129_0x1dd9a7(0x104),'type':a129_0x1dd9a7(0x151),'description':a129_0x1dd9a7(0xff),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set(['appcode',a129_0x1dd9a7(0x111),a129_0x1dd9a7(0x144),a129_0x1dd9a7(0xeb),'jq',a129_0x1dd9a7(0x11c),a129_0x1dd9a7(0x149),a129_0x1dd9a7(0x13f),'ci']);function a129_0x4385(){const _0x20f7ab=['title','dryRun','production\x20|\x20daily','Force\x20non-interactive\x20mode\x20(CI)','Alias\x20for\x20--non-interactive','Page\x20number','meowKey','skip-imports','2053mHRees','Code\x20filter','appcode','<code>','Schemas','Config\x20key','Enable\x20BFF\x20save','watch','boolean','page','target','non-interactive','Override\x20appcode','Keyword\x20filter','Output\x20path','122240KRMfHa','env','Apply\x20to\x20all','Description\x20file','operation','Preview\x20operation\x20without\x20executing','yes','descriptionFile','@lovrabet/rabetbase-cli','File\x20path','verbose','Description','6KxILQC','99HBCTxf','string','Show\x20help','operationType','Rabetbase\x20CLI','code','Use\x20global\x20config\x20scope','format','SQL\x20code','description','10093923EHhLOH','confirm','Title','407DJPEXP','value','keyword','Use\x20project\x20config\x20scope','sql-name','json\x20|\x20pretty\x20|\x20compress','6125190BtqKFP','Operation\x20type','Expected\x20affected\x20count','74726784SbpGSy','Watch\x20mode','global','Environment','all','Function\x20node','params','clear','Output\x20format','description-file','functionNode','928oFkFSR','sql','DB\x20ID','type','1148944uyEjRm','rabetbase','<name>','expectedCount','sqlname','key','Use\x20remote','force','app','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','enable-bff-save','45WPDiJv','Force\x20overwrite','file','Skip\x20confirmation\x20for\x20high-risk\x20writes','schemas','sqlName','enableBffSave','remote','dry-run','SQL\x20name','fromEntries','dbid','Name','sqlcode','db-id','operation-type','function-node','Verbose\x20output','pagesize','datasetcode','395556ZAHyHj','project','output','help'];a129_0x4385=function(){return _0x20f7ab;};return a129_0x4385();}export function buildMeowFlags(){const _0x2ba5d0=a129_0x1dd9a7;return Object[_0x2ba5d0(0x11e)](GLOBAL_FLAGS['map'](_0x1b254a=>[_0x1b254a[_0x2ba5d0(0x132)],{'type':_0x1b254a[_0x2ba5d0(0x108)]}]));}
@@ -1 +1 @@
1
- const a129_0x16316a=a129_0x4578;(function(_0x2f273f,_0x188125){const _0x269f3a=a129_0x4578,_0x423904=_0x2f273f();while(!![]){try{const _0x486fda=parseInt(_0x269f3a(0x6d))/0x1+-parseInt(_0x269f3a(0x70))/0x2+parseInt(_0x269f3a(0x76))/0x3+-parseInt(_0x269f3a(0x74))/0x4*(-parseInt(_0x269f3a(0x77))/0x5)+parseInt(_0x269f3a(0x71))/0x6*(-parseInt(_0x269f3a(0x72))/0x7)+parseInt(_0x269f3a(0x75))/0x8+-parseInt(_0x269f3a(0x6f))/0x9;if(_0x486fda===_0x188125)break;else _0x423904['push'](_0x423904['shift']());}catch(_0x23518d){_0x423904['push'](_0x423904['shift']());}}}(a129_0x1b40,0x97700));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':'production','format':'compress','locale':a129_0x16316a(0x73),'riskLevel':a129_0x16316a(0x6e),'apiDir':DEFAULT_API_DIR};function a129_0x1b40(){const _0x58ae5d=['7RgFqZP','en-US','16sIlDti','3803280DAuJwc','1343100XYwnCc','486120DfsdJf','compress','644042ijhHnp','high-risk-write','6030261TioJuc','1122588gnOswM','626622NiMfDF'];a129_0x1b40=function(){return _0x58ae5d;};return a129_0x1b40();}function a129_0x4578(_0x25b879,_0x7f0a00){_0x25b879=_0x25b879-0x6c;const _0x1b4022=a129_0x1b40();let _0x4578e7=_0x1b4022[_0x25b879];return _0x4578e7;}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a129_0x16316a(0x6c);
1
+ const a130_0x66229a=a130_0x5f2d;(function(_0x4ef26d,_0xbba6c6){const _0x58f098=a130_0x5f2d,_0x3571bc=_0x4ef26d();while(!![]){try{const _0x4083be=-parseInt(_0x58f098(0x1d8))/0x1+-parseInt(_0x58f098(0x1d5))/0x2*(-parseInt(_0x58f098(0x1dc))/0x3)+-parseInt(_0x58f098(0x1d7))/0x4+-parseInt(_0x58f098(0x1db))/0x5+-parseInt(_0x58f098(0x1d6))/0x6+-parseInt(_0x58f098(0x1d3))/0x7*(parseInt(_0x58f098(0x1d2))/0x8)+-parseInt(_0x58f098(0x1d4))/0x9*(-parseInt(_0x58f098(0x1d1))/0xa);if(_0x4083be===_0xbba6c6)break;else _0x3571bc['push'](_0x3571bc['shift']());}catch(_0x14a9d1){_0x3571bc['push'](_0x3571bc['shift']());}}}(a130_0x4cb9,0x52fd4));import{DEFAULT_API_DIR}from'../constant/paths.js';function a130_0x5f2d(_0x901e32,_0x4184ee){_0x901e32=_0x901e32-0x1d0;const _0x4cb9b7=a130_0x4cb9();let _0x5f2d27=_0x4cb9b7[_0x901e32];return _0x5f2d27;}export const DEFAULT_CONFIG_VALUES={'env':a130_0x66229a(0x1d0),'format':'compress','locale':a130_0x66229a(0x1dd),'riskLevel':a130_0x66229a(0x1d9),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a130_0x66229a(0x1da);function a130_0x4cb9(){const _0x54d12b=['production','10vyUZjG','3347056UKhtkz','7wfNpqJ','11941245LjqWlk','833764DnyCZE','304236LvNwtj','2165024OaWrrm','47783qlKOzd','high-risk-write','compress','1728180RdcHvZ','3RubKEo','en-US'];a130_0x4cb9=function(){return _0x54d12b;};return a130_0x4cb9();}
@@ -1 +1 @@
1
- const a130_0x85f8e4=a130_0x4025;(function(_0x17ed9f,_0x287be8){const _0x57c580=a130_0x4025,_0x70aa6d=_0x17ed9f();while(!![]){try{const _0x3b4994=parseInt(_0x57c580(0x1ab))/0x1+parseInt(_0x57c580(0x1ac))/0x2+parseInt(_0x57c580(0x1a9))/0x3+parseInt(_0x57c580(0x1b1))/0x4*(-parseInt(_0x57c580(0x1b6))/0x5)+parseInt(_0x57c580(0x1b7))/0x6+parseInt(_0x57c580(0x1b3))/0x7*(-parseInt(_0x57c580(0x1b4))/0x8)+-parseInt(_0x57c580(0x1b5))/0x9*(parseInt(_0x57c580(0x1af))/0xa);if(_0x3b4994===_0x287be8)break;else _0x70aa6d['push'](_0x70aa6d['shift']());}catch(_0x477bec){_0x70aa6d['push'](_0x70aa6d['shift']());}}}(a130_0x5b41,0x53b98));function a130_0x5b41(){const _0x2a8614=['runtimeDomain','680cVzFQm','userDomain','409160gQGyhU','https://user-daily.lovrabet.com','21553GHNjfP','1264XsVUws','36126pdrRQK','10waOEkF','1437606NTKZst','https://runtime.lovrabet.com','1080786uGYXpC','https://daily-api.lovrabet.com','186861MyBTxH','1040452MWXwSf','https://daily-runtime.lovrabet.com'];a130_0x5b41=function(){return _0x2a8614;};return a130_0x5b41();}import{getEnv,isProduction}from'../constant/env.js';function a130_0x4025(_0x1b317b,_0x2b6557){_0x1b317b=_0x1b317b-0x1a9;const _0x5b4139=a130_0x5b41();let _0x402575=_0x5b4139[_0x1b317b];return _0x402575;}let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x226807){const _0x5e4c16=a130_0x4025;customApiDomain=_0x226807?.['apiDomain'],customUserDomain=_0x226807?.[_0x5e4c16(0x1b0)],customRuntimeDomain=_0x226807?.[_0x5e4c16(0x1ae)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a130_0x85f8e4(0x1b2));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a130_0x85f8e4(0x1aa));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a130_0x85f8e4(0x1b8):a130_0x85f8e4(0x1ad));
1
+ const a131_0x6eb284=a131_0x428c;(function(_0x4340e9,_0x30e16e){const _0x2b035c=a131_0x428c,_0x49876f=_0x4340e9();while(!![]){try{const _0x33682d=parseInt(_0x2b035c(0x19e))/0x1*(parseInt(_0x2b035c(0x19a))/0x2)+-parseInt(_0x2b035c(0x1a0))/0x3*(parseInt(_0x2b035c(0x1a3))/0x4)+parseInt(_0x2b035c(0x19d))/0x5+parseInt(_0x2b035c(0x1a1))/0x6*(parseInt(_0x2b035c(0x19b))/0x7)+parseInt(_0x2b035c(0x1a5))/0x8*(-parseInt(_0x2b035c(0x1a2))/0x9)+parseInt(_0x2b035c(0x195))/0xa+-parseInt(_0x2b035c(0x198))/0xb*(parseInt(_0x2b035c(0x1a4))/0xc);if(_0x33682d===_0x30e16e)break;else _0x49876f['push'](_0x49876f['shift']());}catch(_0x4ea564){_0x49876f['push'](_0x49876f['shift']());}}}(a131_0x20da,0x621bf));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a131_0x20da(){const _0x5f1741=['125148gdlxot','16rsZGZv','4701340kYURVE','runtimeDomain','https://user-daily.lovrabet.com','440MaHKDz','userDomain','2MOzeBZ','190435GXvbIn','https://runtime.lovrabet.com','1962850BxZWrd','480262ZqvRzg','apiDomain','63AdcPHf','132mftJrg','2064402xlnCnz','126420FJcHvp'];a131_0x20da=function(){return _0x5f1741;};return a131_0x20da();}export function initDomains(_0x89cec5){const _0x5eb3ff=a131_0x428c;customApiDomain=_0x89cec5?.[_0x5eb3ff(0x19f)],customUserDomain=_0x89cec5?.[_0x5eb3ff(0x199)],customRuntimeDomain=_0x89cec5?.[_0x5eb3ff(0x196)];}function a131_0x428c(_0x4cb8ff,_0x106233){_0x4cb8ff=_0x4cb8ff-0x195;const _0x20da1d=a131_0x20da();let _0x428c69=_0x20da1d[_0x4cb8ff];return _0x428c69;}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a131_0x6eb284(0x197));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a131_0x6eb284(0x19c):'https://daily-runtime.lovrabet.com');
@@ -1 +1 @@
1
- const a131_0x7d281=a131_0x21e1;function a131_0x4b59(){const _0x5b1a16=['development','96913KjZBub','1381041pxHAnb','production','1736912XQeYLq','4465AtUphU','4oBVEpO','1746oYtaCJ','26829JbbFAs','daily','2110LLpaPI','497163YiMSiq','online','72424yBCCIr','7yRQqWI'];a131_0x4b59=function(){return _0x5b1a16;};return a131_0x4b59();}(function(_0x14a02b,_0x1b94e4){const _0x30099e=a131_0x21e1,_0x131491=_0x14a02b();while(!![]){try{const _0x2aea81=-parseInt(_0x30099e(0x199))/0x1+-parseInt(_0x30099e(0x196))/0x2+parseInt(_0x30099e(0x194))/0x3*(parseInt(_0x30099e(0x19e))/0x4)+-parseInt(_0x30099e(0x19d))/0x5*(-parseInt(_0x30099e(0x19f))/0x6)+-parseInt(_0x30099e(0x197))/0x7*(-parseInt(_0x30099e(0x19c))/0x8)+parseInt(_0x30099e(0x19a))/0x9+parseInt(_0x30099e(0x1a2))/0xa*(-parseInt(_0x30099e(0x1a0))/0xb);if(_0x2aea81===_0x1b94e4)break;else _0x131491['push'](_0x131491['shift']());}catch(_0x3d7dd7){_0x131491['push'](_0x131491['shift']());}}}(a131_0x4b59,0x243a9));export const RABETBASE_ENV_VALUES=['production',a131_0x7d281(0x1a1)];export function normalizeEnv(_0x269be5){const _0x246dd5=a131_0x7d281;return _0x269be5===_0x246dd5(0x195)?_0x246dd5(0x19b):_0x269be5;}function a131_0x21e1(_0x5a4c33,_0x595941){_0x5a4c33=_0x5a4c33-0x194;const _0x4b59ab=a131_0x4b59();let _0x21e1b8=_0x4b59ab[_0x5a4c33];return _0x21e1b8;}export function isProduction(_0x47a289){const _0x48f6f3=a131_0x7d281;return normalizeEnv(_0x47a289)===_0x48f6f3(0x19b);}export function isDaily(_0x246554){return normalizeEnv(_0x246554)==='daily';}export function isDev(_0x3f4f0b){const _0x52bb26=a131_0x7d281,_0x2855e3=normalizeEnv(_0x3f4f0b);return _0x2855e3===_0x52bb26(0x198)||_0x2855e3==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a131_0x7d281(0x19b));export function getEnv(){return env;}export function initEnv(_0x3d7d2f){env=normalizeEnv(_0x3d7d2f);}
1
+ const a132_0x13b81b=a132_0x1ce1;(function(_0x3ce40d,_0x539e08){const _0x5c6775=a132_0x1ce1,_0x125a21=_0x3ce40d();while(!![]){try{const _0x1533af=parseInt(_0x5c6775(0xae))/0x1+-parseInt(_0x5c6775(0xb1))/0x2+parseInt(_0x5c6775(0xb2))/0x3*(parseInt(_0x5c6775(0xb6))/0x4)+-parseInt(_0x5c6775(0xb3))/0x5+-parseInt(_0x5c6775(0xb0))/0x6+parseInt(_0x5c6775(0xb9))/0x7*(parseInt(_0x5c6775(0xba))/0x8)+-parseInt(_0x5c6775(0xb4))/0x9;if(_0x1533af===_0x539e08)break;else _0x125a21['push'](_0x125a21['shift']());}catch(_0x5c31d9){_0x125a21['push'](_0x125a21['shift']());}}}(a132_0x47e5,0x78330));export const RABETBASE_ENV_VALUES=[a132_0x13b81b(0xad),a132_0x13b81b(0xb5)];export function normalizeEnv(_0x1bcc12){const _0x141438=a132_0x13b81b;return _0x1bcc12===_0x141438(0xb8)?_0x141438(0xad):_0x1bcc12;}function a132_0x47e5(){const _0x41d4ec=['5199TzFxWU','1501085zKqmUZ','5684148kbqPfp','daily','2224lnJTte','development','online','1131956oRgeVJ','8HDhDxi','production','682021VjMgNO','dev','1857432eGIzJu','147160ZUMqbG'];a132_0x47e5=function(){return _0x41d4ec;};return a132_0x47e5();}export function isProduction(_0x3dba4b){const _0x4135b1=a132_0x13b81b;return normalizeEnv(_0x3dba4b)===_0x4135b1(0xad);}export function isDaily(_0x195256){const _0x1f7246=a132_0x13b81b;return normalizeEnv(_0x195256)===_0x1f7246(0xb5);}function a132_0x1ce1(_0x17eff3,_0x891636){_0x17eff3=_0x17eff3-0xad;const _0x47e51e=a132_0x47e5();let _0x1ce1bd=_0x47e51e[_0x17eff3];return _0x1ce1bd;}export function isDev(_0x38b1e2){const _0x359405=a132_0x13b81b,_0x579ccd=normalizeEnv(_0x38b1e2);return _0x579ccd===_0x359405(0xb7)||_0x579ccd===_0x359405(0xaf);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a132_0x13b81b(0xad));export function getEnv(){return env;}export function initEnv(_0x545c73){env=normalizeEnv(_0x545c73);}
@@ -1 +1 @@
1
- function a132_0x4b8c(_0x4c172a,_0x202964){_0x4c172a=_0x4c172a-0x73;const _0x373dc1=a132_0x373d();let _0x4b8c2e=_0x373dc1[_0x4c172a];return _0x4b8c2e;}const a132_0x234921=a132_0x4b8c;(function(_0x243556,_0x4e215a){const _0x43ff61=a132_0x4b8c,_0x1419c0=_0x243556();while(!![]){try{const _0x374e0f=-parseInt(_0x43ff61(0x7d))/0x1*(parseInt(_0x43ff61(0x75))/0x2)+parseInt(_0x43ff61(0x76))/0x3+parseInt(_0x43ff61(0x79))/0x4*(-parseInt(_0x43ff61(0x74))/0x5)+-parseInt(_0x43ff61(0x7a))/0x6+parseInt(_0x43ff61(0x78))/0x7+-parseInt(_0x43ff61(0x7b))/0x8+parseInt(_0x43ff61(0x7c))/0x9*(parseInt(_0x43ff61(0x77))/0xa);if(_0x374e0f===_0x4e215a)break;else _0x1419c0['push'](_0x1419c0['shift']());}catch(_0x50027c){_0x1419c0['push'](_0x1419c0['shift']());}}}(a132_0x373d,0xbd5b5));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a132_0x234921(0x7e),'pretty',a132_0x234921(0x73)];function a132_0x373d(){const _0x7e7fb8=['26171720JlJJFr','3684478IgbwIN','29576iRrWGh','1769556UUQDsx','7620392bMpvMJ','9VOBFlK','2382XAEplf','json','compress','965igDcwK','122kVdnyW','1355694FPIDsl'];a132_0x373d=function(){return _0x7e7fb8;};return a132_0x373d();}
1
+ function a133_0x4773(){const _0x228536=['4497040ToTYFp','3793HXIoks','17621330MDsyiO','4520436nQKtte','4eIPZcW','4XNrfVb','compress','1150971gjFqOZ','24ZMydph','2569977XUYkTG','2064076sEtGGm'];a133_0x4773=function(){return _0x228536;};return a133_0x4773();}const a133_0x33e1ac=a133_0x3a34;function a133_0x3a34(_0x4c4f5f,_0x4b73e2){_0x4c4f5f=_0x4c4f5f-0x135;const _0x477384=a133_0x4773();let _0x3a34cc=_0x477384[_0x4c4f5f];return _0x3a34cc;}(function(_0x4f6658,_0x3d86ec){const _0x26ee46=a133_0x3a34,_0x1734c3=_0x4f6658();while(!![]){try{const _0x47c9c2=-parseInt(_0x26ee46(0x13b))/0x1*(-parseInt(_0x26ee46(0x13e))/0x2)+-parseInt(_0x26ee46(0x136))/0x3*(parseInt(_0x26ee46(0x13f))/0x4)+parseInt(_0x26ee46(0x13a))/0x5+parseInt(_0x26ee46(0x13d))/0x6+parseInt(_0x26ee46(0x139))/0x7+-parseInt(_0x26ee46(0x137))/0x8*(-parseInt(_0x26ee46(0x138))/0x9)+-parseInt(_0x26ee46(0x13c))/0xa;if(_0x47c9c2===_0x3d86ec)break;else _0x1734c3['push'](_0x1734c3['shift']());}catch(_0x444747){_0x1734c3['push'](_0x1734c3['shift']());}}}(a133_0x4773,0xa2a19));export const RABETBASE_OUTPUT_FORMAT_VALUES=['json','pretty',a133_0x33e1ac(0x135)];
@@ -1 +1 @@
1
- const a133_0x38c349=a133_0xc20b;function a133_0x5dab(){const _0x432b24=['8752920dmYyMa','1270psbmRU','19156nqfRde','./src/api','6DOfBax','8036630LoeMUF','5711990oUDAFC','101VPNBYg','44937WRDHfI','925336uWoGVc','133008qeWcsq','116XLhdeY'];a133_0x5dab=function(){return _0x432b24;};return a133_0x5dab();}function a133_0xc20b(_0x588aa5,_0x3e1282){_0x588aa5=_0x588aa5-0xe8;const _0x5dab28=a133_0x5dab();let _0xc20b38=_0x5dab28[_0x588aa5];return _0xc20b38;}(function(_0x3bfc8a,_0x1a58eb){const _0x25c2bf=a133_0xc20b,_0x556cfa=_0x3bfc8a();while(!![]){try{const _0x26d133=-parseInt(_0x25c2bf(0xe8))/0x1*(-parseInt(_0x25c2bf(0xef))/0x2)+parseInt(_0x25c2bf(0xeb))/0x3*(-parseInt(_0x25c2bf(0xec))/0x4)+parseInt(_0x25c2bf(0xf3))/0x5*(parseInt(_0x25c2bf(0xf1))/0x6)+parseInt(_0x25c2bf(0xf2))/0x7+parseInt(_0x25c2bf(0xea))/0x8+-parseInt(_0x25c2bf(0xe9))/0x9*(parseInt(_0x25c2bf(0xee))/0xa)+-parseInt(_0x25c2bf(0xed))/0xb;if(_0x26d133===_0x1a58eb)break;else _0x556cfa['push'](_0x556cfa['shift']());}catch(_0x3caa21){_0x556cfa['push'](_0x556cfa['shift']());}}}(a133_0x5dab,0xa0a26));export const DEFAULT_API_DIR=a133_0x38c349(0xf0);
1
+ function a134_0x2a3c(){const _0x358784=['96pvfpPe','1136124IyXVKF','5055210iOYBUT','273605AWOmnA','./src/api','3931606TYLMmW','42448QZKwYr','2405491gFlOzf','12tCdZyo','1aEIAXq','16BECLWB','351whmTNH','342507MQilQy'];a134_0x2a3c=function(){return _0x358784;};return a134_0x2a3c();}const a134_0x961d4=a134_0x3715;function a134_0x3715(_0x29c61d,_0x206826){_0x29c61d=_0x29c61d-0x128;const _0x2a3c1f=a134_0x2a3c();let _0x3715a8=_0x2a3c1f[_0x29c61d];return _0x3715a8;}(function(_0x24bd09,_0x2c68b6){const _0x19443d=a134_0x3715,_0x3f0b6e=_0x24bd09();while(!![]){try{const _0x2e2928=-parseInt(_0x19443d(0x134))/0x1*(parseInt(_0x19443d(0x12c))/0x2)+-parseInt(_0x19443d(0x12a))/0x3*(-parseInt(_0x19443d(0x128))/0x4)+parseInt(_0x19443d(0x12e))/0x5*(parseInt(_0x19443d(0x133))/0x6)+-parseInt(_0x19443d(0x130))/0x7+parseInt(_0x19443d(0x131))/0x8*(-parseInt(_0x19443d(0x129))/0x9)+-parseInt(_0x19443d(0x12d))/0xa+-parseInt(_0x19443d(0x132))/0xb*(-parseInt(_0x19443d(0x12b))/0xc);if(_0x2e2928===_0x2c68b6)break;else _0x3f0b6e['push'](_0x3f0b6e['shift']());}catch(_0x5877d9){_0x3f0b6e['push'](_0x3f0b6e['shift']());}}}(a134_0x2a3c,0x7392f));export const DEFAULT_API_DIR=a134_0x961d4(0x12f);
@@ -1 +1 @@
1
- const a134_0x266009=a134_0x43a8;(function(_0x4466e3,_0x417089){const _0xbe670c=a134_0x43a8,_0xb58e24=_0x4466e3();while(!![]){try{const _0x26fff6=-parseInt(_0xbe670c(0x89))/0x1*(-parseInt(_0xbe670c(0x8b))/0x2)+-parseInt(_0xbe670c(0x8f))/0x3*(parseInt(_0xbe670c(0x92))/0x4)+-parseInt(_0xbe670c(0x8d))/0x5+-parseInt(_0xbe670c(0x91))/0x6*(-parseInt(_0xbe670c(0x90))/0x7)+parseInt(_0xbe670c(0x8a))/0x8+parseInt(_0xbe670c(0x94))/0x9+parseInt(_0xbe670c(0x95))/0xa*(parseInt(_0xbe670c(0x8e))/0xb);if(_0x26fff6===_0x417089)break;else _0xb58e24['push'](_0xb58e24['shift']());}catch(_0x2bc2c9){_0xb58e24['push'](_0xb58e24['shift']());}}}(a134_0xacc0,0xdc8d9));export const RISK_LEVEL_VALUES=[a134_0x266009(0x93),a134_0x266009(0x8c),'high-risk-write'];function a134_0x43a8(_0x3b33cc,_0x5cdc08){_0x3b33cc=_0x3b33cc-0x89;const _0xacc031=a134_0xacc0();let _0x43a8fc=_0xacc031[_0x3b33cc];return _0x43a8fc;}function a134_0xacc0(){const _0xb0912c=['20mBBZgt','read','3571569KutWet','69130UlyMdO','57973HuuCYQ','6324224EyEXcV','10HvMEmQ','write','5518725DwJULm','407CZmLkW','913449rlCdsf','12575710llDnmC','6WTECSZ'];a134_0xacc0=function(){return _0xb0912c;};return a134_0xacc0();}
1
+ const a135_0xd68b=a135_0x40a5;function a135_0x40a5(_0x4263cb,_0x2d5619){_0x4263cb=_0x4263cb-0x13a;const _0x1b3dec=a135_0x1b3d();let _0x40a5da=_0x1b3dec[_0x4263cb];return _0x40a5da;}(function(_0x3315e0,_0x5d230c){const _0x4c4524=a135_0x40a5,_0x1cb03a=_0x3315e0();while(!![]){try{const _0x1d3cbc=-parseInt(_0x4c4524(0x13b))/0x1*(-parseInt(_0x4c4524(0x13c))/0x2)+parseInt(_0x4c4524(0x146))/0x3*(-parseInt(_0x4c4524(0x13e))/0x4)+-parseInt(_0x4c4524(0x142))/0x5+-parseInt(_0x4c4524(0x145))/0x6+parseInt(_0x4c4524(0x140))/0x7*(-parseInt(_0x4c4524(0x13a))/0x8)+-parseInt(_0x4c4524(0x13f))/0x9+parseInt(_0x4c4524(0x143))/0xa;if(_0x1d3cbc===_0x5d230c)break;else _0x1cb03a['push'](_0x1cb03a['shift']());}catch(_0x3deba0){_0x1cb03a['push'](_0x1cb03a['shift']());}}}(a135_0x1b3d,0x7e29c));export const RISK_LEVEL_VALUES=[a135_0xd68b(0x141),a135_0xd68b(0x13d),a135_0xd68b(0x144)];function a135_0x1b3d(){const _0x4a803b=['323644snKPIJ','2239479IPiqFK','1855021RzHhjy','read','3931250iHUQgv','17555360ubyADa','high-risk-write','3962298AuMQuW','6fRlhqm','8cmZWlP','1Cxyghp','1767034rFdBJC','write'];a135_0x1b3d=function(){return _0x4a803b;};return a135_0x1b3d();}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a135_0x532b73=a135_0x24fb;(function(_0x169c96,_0x439da0){const _0x9a9678=a135_0x24fb,_0x1597bd=_0x169c96();while(!![]){try{const _0x102550=parseInt(_0x9a9678(0x1f6))/0x1*(-parseInt(_0x9a9678(0x1b6))/0x2)+parseInt(_0x9a9678(0x1c6))/0x3*(parseInt(_0x9a9678(0x1e0))/0x4)+parseInt(_0x9a9678(0x1c4))/0x5+-parseInt(_0x9a9678(0x1ae))/0x6*(parseInt(_0x9a9678(0x1b5))/0x7)+-parseInt(_0x9a9678(0x1f0))/0x8+parseInt(_0x9a9678(0x1de))/0x9*(parseInt(_0x9a9678(0x1b4))/0xa)+parseInt(_0x9a9678(0x1e7))/0xb;if(_0x102550===_0x439da0)break;else _0x1597bd['push'](_0x1597bd['shift']());}catch(_0x12bd7a){_0x1597bd['push'](_0x1597bd['shift']());}}}(a135_0x5ce0,0x22252));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';function a135_0x24fb(_0x3345f6,_0x22a2b7){_0x3345f6=_0x3345f6-0x1ab;const _0x5ce007=a135_0x5ce0();let _0x24fbb1=_0x5ce007[_0x3345f6];return _0x24fbb1;}import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x371a7a){return process.env[`RABETBASE_${_0x371a7a}`]||process.env[`LOVRABET_${_0x371a7a}`]||undefined;}export const NEW_CONFIG_NAME=a135_0x532b73(0x1df);export const CONFIG_NAMES=[a135_0x532b73(0x1df),a135_0x532b73(0x1ef),a135_0x532b73(0x1f5)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a135_0x532b73(0x1fe)](_0x58b63c=>_0x58b63c!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x47cb1a){for(const _0x1a6c03 of CONFIG_NAMES){const _0x145bc7=resolve(_0x47cb1a,_0x1a6c03);if(existsSync(_0x145bc7))return _0x145bc7;}return undefined;}export function findProjectRootDirectory(_0x2254a5=process['cwd']()){let _0x2ffa9a=resolve(_0x2254a5);const {root:_0x2fa6a6}=parse(_0x2ffa9a),_0x72ec09=homedir();while(!![]){if(resolveConfigPath(_0x2ffa9a)){if(_0x2ffa9a===_0x72ec09)break;return _0x2ffa9a;}if(_0x2ffa9a===_0x2fa6a6||_0x2ffa9a===_0x72ec09)break;const _0x51d181=dirname(_0x2ffa9a);if(_0x51d181===_0x2ffa9a)break;_0x2ffa9a=_0x51d181;}return resolve(_0x2254a5);}export async function createContext(_0xa93fd8){const _0x4e5cc2=a135_0x532b73,_0x577534=readRawConfig(),_0x1c5aa6=buildConfig(_0x577534,_0xa93fd8),{initEnv:_0x5506f7}=await import(_0x4e5cc2(0x1be));if(_0x1c5aa6['env'])_0x5506f7(_0x1c5aa6['env']);else _0xa93fd8[_0x4e5cc2(0x1c2)]&&typeof _0xa93fd8[_0x4e5cc2(0x1c2)]===_0x4e5cc2(0x1f9)&&_0x5506f7(_0xa93fd8[_0x4e5cc2(0x1c2)]);const {initDomains:_0x187690,getUserDomain:_0x8f4ebf,getApiDomain:_0x58f50b}=await import(_0x4e5cc2(0x1d6));_0x187690({'apiDomain':_0x577534[_0x4e5cc2(0x1ea)]||undefined,'userDomain':_0x577534['userDomain']||undefined,'runtimeDomain':_0x577534[_0x4e5cc2(0x1ed)]||undefined});const _0x3bfef8={'apiDomain':_0x58f50b(),'userDomain':_0x8f4ebf()},_0x271928=await buildAuth(_0x1c5aa6);logger[_0x4e5cc2(0x1dd)](process['cwd']());const _0x5798c8=(CLI_BIN_NAME+'\x20'+process['argv'][_0x4e5cc2(0x1f2)](0x2)[_0x4e5cc2(0x1ce)]('\x20'))['trim']();logger[_0x4e5cc2(0x1ac)](_0x5798c8);const {isNonInteractive:_0x56884f}=await import(_0x4e5cc2(0x1da)),_0x120d81=_0x56884f(_0xa93fd8);return{'config':_0x1c5aa6,'auth':_0x271928,'logger':logger,'env':_0x3bfef8,'nonInteractive':_0x120d81};}export function buildConfigFromFlags(_0x287d1b){return buildConfig(readRawConfig(),_0x287d1b);}export function getProjectConfigPath(){const _0x33373f=a135_0x532b73;return resolveConfigPath(process[_0x33373f(0x1b3)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0xc8563e){const _0xde4097=a135_0x532b73;if(!existsSync(_0xc8563e))return{'status':_0xde4097(0x1f3)};try{const _0x1f52a2=readFileSync(_0xc8563e,{'encoding':'utf8'});if(!_0x1f52a2?.[_0xde4097(0x1db)]())return{'status':'empty'};const _0x932ed6=JSON['parse'](_0x1f52a2);return{'status':'ok','data':_0x932ed6};}catch(_0x4a049f){return{'status':_0xde4097(0x1bf),'message':_0x4a049f instanceof Error?_0x4a049f[_0xde4097(0x1d4)]:String(_0x4a049f)};}}function parseCliConfigJsonFile(_0x45394e,_0xb2e7a5,_0x43f11f){const _0x4fa659=a135_0x532b73,_0x435996=inspectCliConfigJsonFile(_0x45394e);if(_0x435996[_0x4fa659(0x1d1)]===_0x4fa659(0x1f3)||_0x435996[_0x4fa659(0x1d1)]==='empty')return{};if(_0x435996[_0x4fa659(0x1d1)]==='ok')return _0x435996[_0x4fa659(0x1ff)];return _0xb2e7a5===_0x4fa659(0x1cc)&&_0x43f11f&&console[_0x4fa659(0x1bf)](CLI_BIN_NAME+':\x20'+_0x43f11f+_0x4fa659(0x1bb)+_0x45394e+_0x4fa659(0x1ec)+_0x435996[_0x4fa659(0x1d4)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x23935a){const _0x5bfed0=a135_0x532b73;if(!_0x23935a||typeof _0x23935a!=='object')return{'config':{},'migrated':![]};const _0x454795={..._0x23935a},_0x59222e=_0x454795[_0x5bfed0(0x1d5)]&&typeof _0x454795[_0x5bfed0(0x1d5)]==='object'?{..._0x454795[_0x5bfed0(0x1d5)]}:{},_0x2e78f8=Object[_0x5bfed0(0x1f1)](_0x59222e)[_0x5bfed0(0x1e5)],_0x5ef1e5=_0x454795[_0x5bfed0(0x1b2)]||_0x454795[_0x5bfed0(0x1cd)];let _0x24e7f0=![];if(_0x5ef1e5&&_0x2e78f8===0x0){const _0x22d9e5=typeof _0x454795[_0x5bfed0(0x1c0)]===_0x5bfed0(0x1f9)&&_0x454795[_0x5bfed0(0x1c0)][_0x5bfed0(0x1db)]()?_0x454795[_0x5bfed0(0x1c0)]:String(_0x5ef1e5)[_0x5bfed0(0x1db)]();_0x59222e[_0x22d9e5]={'appcode':String(_0x5ef1e5)['trim'](),..._0x454795['env']!=null?{'env':_0x454795[_0x5bfed0(0x1c2)]}:{},..._0x454795['apiDir']!=null?{'apiDir':_0x454795[_0x5bfed0(0x1c9)]}:{},..._0x454795['cookie']!=null?{'cookie':_0x454795[_0x5bfed0(0x1e9)]}:{},..._0x454795[_0x5bfed0(0x1d0)]!=null?{'accessKey':_0x454795[_0x5bfed0(0x1d0)]}:{},..._0x454795[_0x5bfed0(0x1f7)]!=null?{'format':_0x454795['format']}:{},..._0x454795[_0x5bfed0(0x1ee)]!=null?{'pageSize':_0x454795[_0x5bfed0(0x1ee)]}:{},..._0x454795[_0x5bfed0(0x1b1)]!=null?{'riskLevel':_0x454795['riskLevel']}:{},..._0x454795['locale']!=null?{'locale':_0x454795[_0x5bfed0(0x1d8)]}:{}},_0x454795[_0x5bfed0(0x1d5)]=_0x59222e;if(!_0x454795[_0x5bfed0(0x1c0)])_0x454795['defaultApp']=_0x22d9e5;_0x24e7f0=!![];}return(_0x5bfed0(0x1b2)in _0x454795||_0x5bfed0(0x1cd)in _0x454795)&&(delete _0x454795['appcode'],delete _0x454795['app'],_0x24e7f0=!![]),{'config':_0x454795,'migrated':_0x24e7f0};}function writeNormalizedConfigIfNeeded(_0x4d7477,_0x163751){const _0x689e48=a135_0x532b73,_0x27c470=JSON['stringify'](_0x163751,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x4d7477)===_0x27c470)return;writeConfigFile(_0x4d7477,_0x163751),normalizedWriteCache[_0x689e48(0x1c3)](_0x4d7477,_0x27c470);}function parseAndNormalizeConfig(_0x566e30,_0x19dbd2,_0x3a138c){const _0xd10cce=a135_0x532b73,_0x296122=parseCliConfigJsonFile(_0x566e30,_0x19dbd2,_0x3a138c),_0x20ea86=normalizeLegacyConfigShape(_0x296122);if(_0x20ea86[_0xd10cce(0x1bd)])try{writeNormalizedConfigIfNeeded(_0x566e30,_0x20ea86['config']);}catch{}return _0x20ea86[_0xd10cce(0x1e8)];}function a135_0x5ce0(){const _0x29b1f9=['authRequired','setLogPath','6561joxtdk','.rabetbase.json','4aFSQXV','./auth/get-cookie.js','Global','RISK_LEVEL','daily','length','maxRisk','1099813OawOmJ','config','cookie','apiDomain','MAX_RISK','\x0a\x20\x20','runtimeDomain','pageSize','.lovrabet.json','1665224CpNgEH','keys','slice','missing','merged','.lovrabetrc','9fhsxiz','format','inherit','string','PAGE_SIZE','api.ts','Project','ENV','filter','data','stringify','setRawCommand','https://g.lovrabet.com/dist/lovrabet-skill','14622eVsOwH','projectConfig','template_base_url','riskLevel','appcode','cwd','1090BUcEgL','7iBcCil','8722nmWQjc','write','utf8','.tmp','object','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','project','migrated','./constant/env.js','error','defaultApp','FORMAT','env','set','517995XEeefN','entries','319962vbNHMH','map','APP','apiDir','silent','ACCESS_KEY','warn','app','join','-api.ts','accessKey','status','find','VERBOSE','message','apps','./constant/domain.js','true','locale','read','./utils/is-non-interactive.js','trim'];a135_0x5ce0=function(){return _0x29b1f9;};return a135_0x5ce0();}export function loadRawConfigLayers(_0x565e72){const _0x2a244b=a135_0x532b73;let _0x522ec0={},_0x300319={};const _0x148453=resolveConfigPath(homedir());_0x148453&&(_0x522ec0=parseAndNormalizeConfig(_0x148453,_0x2a244b(0x1cc),_0x2a244b(0x1e2)));const _0x4b6465=_0x565e72??findProjectRootDirectory(),_0x177230=resolveConfigPath(_0x4b6465);return _0x177230&&(_0x300319=parseAndNormalizeConfig(_0x177230,_0x2a244b(0x1cc),_0x2a244b(0x1fc))),{'globalPath':_0x148453,'projectPath':_0x177230,'globalConfig':_0x522ec0,'projectConfig':_0x300319};}function mergeRawConfigLayers(_0x45808c){const _0x1e7572=a135_0x532b73,{globalConfig:_0x5ef9f2,projectConfig:_0x148f3c}=_0x45808c;if(_0x148f3c[_0x1e7572(0x1f8)]===![]){const _0x9bf2e6={..._0x148f3c};delete _0x9bf2e6[_0x1e7572(0x1f8)];const _0x1e434a=_0x148f3c[_0x1e7572(0x1d5)]&&typeof _0x148f3c['apps']===_0x1e7572(0x1ba)?_0x148f3c[_0x1e7572(0x1d5)]:{};Object[_0x1e7572(0x1f1)](_0x1e434a)['length']>0x0?_0x9bf2e6[_0x1e7572(0x1d5)]=_0x1e434a:delete _0x9bf2e6['apps'];if(_0x1e7572(0x1c0)in _0x148f3c)_0x9bf2e6[_0x1e7572(0x1c0)]=_0x148f3c[_0x1e7572(0x1c0)];else Object[_0x1e7572(0x1f1)](_0x1e434a)[_0x1e7572(0x1e5)]>0x0&&(_0x9bf2e6[_0x1e7572(0x1c0)]=Object[_0x1e7572(0x1f1)](_0x1e434a)[0x0]);return _0x9bf2e6;}const _0x5ac23f=_0x5ef9f2['apps']&&typeof _0x5ef9f2[_0x1e7572(0x1d5)]==='object'?_0x5ef9f2[_0x1e7572(0x1d5)]:{},_0x3e0284=_0x148f3c[_0x1e7572(0x1d5)]&&typeof _0x148f3c[_0x1e7572(0x1d5)]==='object'?_0x148f3c['apps']:{},_0x380359={..._0x5ac23f,..._0x3e0284},_0x35291c={..._0x5ef9f2,..._0x148f3c};Object[_0x1e7572(0x1f1)](_0x380359)[_0x1e7572(0x1e5)]>0x0&&(_0x35291c[_0x1e7572(0x1d5)]=_0x380359);if('defaultApp'in _0x148f3c)_0x35291c[_0x1e7572(0x1c0)]=_0x148f3c[_0x1e7572(0x1c0)];else{if(_0x3e0284&&Object[_0x1e7572(0x1f1)](_0x3e0284)[_0x1e7572(0x1e5)]>0x0)_0x35291c['defaultApp']=Object[_0x1e7572(0x1f1)](_0x3e0284)[0x0];else{if(_0x5ef9f2[_0x1e7572(0x1c0)])_0x35291c[_0x1e7572(0x1c0)]=_0x5ef9f2[_0x1e7572(0x1c0)];else{const _0x43d87e=Object[_0x1e7572(0x1f1)](_0x5ac23f);_0x43d87e[_0x1e7572(0x1e5)]>0x0&&(_0x35291c[_0x1e7572(0x1c0)]=_0x43d87e[0x0]);}}}return _0x35291c;}export function readRawConfigWithLayers(_0x8be249){const _0x4e8ab9=loadRawConfigLayers(_0x8be249);return{'config':mergeRawConfigLayers(_0x4e8ab9),'layers':_0x4e8ab9};}export function readRawConfig(_0x4f779c){return mergeRawConfigLayers(loadRawConfigLayers(_0x4f779c));}export function getConfigAppCode(_0xeb5b64){const _0x2dfb6c=a135_0x532b73,_0x2a40c9=readRawConfig(_0xeb5b64);if(_0x2a40c9[_0x2dfb6c(0x1d5)]&&typeof _0x2a40c9[_0x2dfb6c(0x1d5)]===_0x2dfb6c(0x1ba)){const _0xb9551f=_0x2a40c9['defaultApp'];if(_0xb9551f&&_0x2a40c9[_0x2dfb6c(0x1d5)][_0xb9551f]?.['appcode'])return String(_0x2a40c9[_0x2dfb6c(0x1d5)][_0xb9551f][_0x2dfb6c(0x1b2)])[_0x2dfb6c(0x1db)]();const _0x543a75=Object['values'](_0x2a40c9['apps'])[0x0];if(_0x543a75?.[_0x2dfb6c(0x1b2)])return String(_0x543a75[_0x2dfb6c(0x1b2)])[_0x2dfb6c(0x1db)]();}const _0x39f5a3=_0x2a40c9[_0x2dfb6c(0x1b2)]||_0x2a40c9['app'];if(typeof _0x39f5a3!=='string'||_0x39f5a3[_0x2dfb6c(0x1db)]()==='')return undefined;return _0x39f5a3['trim']();}export function getMultiAppConfigs(_0x4be44f=a135_0x532b73(0x1bc),_0x110cf3){const _0x2a0bda=a135_0x532b73,_0x2aae19=_0x4be44f===_0x2a0bda(0x1f4)?readRawConfig(_0x110cf3):loadRawConfigLayers(_0x110cf3)[_0x2a0bda(0x1af)],_0x8935d9=_0x2aae19[_0x2a0bda(0x1d5)];if(!_0x8935d9||typeof _0x8935d9!==_0x2a0bda(0x1ba)||Object['keys'](_0x8935d9)[_0x2a0bda(0x1e5)]===0x0)return null;const _0x160aa4=_0x2aae19[_0x2a0bda(0x1c0)];return Object[_0x2a0bda(0x1c5)](_0x8935d9)[_0x2a0bda(0x1c7)](([_0x3057ec,_0x49a222])=>({'name':_0x3057ec,'appcode':_0x49a222?.[_0x2a0bda(0x1b2)]||'','isDefault':_0x3057ec===_0x160aa4,'env':_0x49a222?.[_0x2a0bda(0x1c2)],'apiDir':_0x49a222?.[_0x2a0bda(0x1c9)],'cookie':_0x49a222?.['cookie']||undefined}))[_0x2a0bda(0x1fe)](_0x4044c9=>_0x4044c9[_0x2a0bda(0x1b2)]);}export function getTemplateBaseUrl(_0x1cbee7){const _0x4f64bc=a135_0x532b73,_0x4904ab=readRawConfig(_0x1cbee7);if(_0x4904ab[_0x4f64bc(0x1b0)]&&typeof _0x4904ab[_0x4f64bc(0x1b0)]===_0x4f64bc(0x1f9))return _0x4904ab[_0x4f64bc(0x1b0)]['replace'](/\/$/,'');return _0x4f64bc(0x1ad);}export function readConfigFile(_0x4ea4f5){const _0x1daf32=a135_0x532b73;return parseAndNormalizeConfig(_0x4ea4f5,_0x1daf32(0x1ca));}export function writeConfigFile(_0x33799a,_0x1b858d){const _0x254037=a135_0x532b73,_0x181cdb=dirname(_0x33799a);!existsSync(_0x181cdb)&&mkdirSync(_0x181cdb,{'recursive':!![]});const _0x4d2c97=_0x33799a+_0x254037(0x1b9);try{writeFileSync(_0x4d2c97,JSON[_0x254037(0x1ab)](_0x1b858d,null,0x2)+'\x0a',{'encoding':_0x254037(0x1b8),'mode':0x180}),renameSync(_0x4d2c97,_0x33799a);}catch(_0x4cbbda){try{unlinkSync(_0x4d2c97);}catch{}throw _0x4cbbda;}}export function resolveWriteConfigPath(_0x37ccb4){const _0x393921=a135_0x532b73,_0x54ecd4=_0x37ccb4===_0x393921(0x1bc)?process[_0x393921(0x1b3)]():homedir(),_0x1b4a4e=resolveConfigPath(_0x54ecd4);return _0x1b4a4e??resolve(_0x54ecd4,NEW_CONFIG_NAME);}function buildConfig(_0x14dddd,_0x119e5e){const _0x391722=a135_0x532b73,_0x417af7={};if(_0x14dddd['apps']&&typeof _0x14dddd['apps']===_0x391722(0x1ba))for(const [_0x2c3372,_0x5b7b3a]of Object['entries'](_0x14dddd[_0x391722(0x1d5)])){_0x5b7b3a&&typeof _0x5b7b3a==='object'&&_0x5b7b3a[_0x391722(0x1b2)]&&(_0x417af7[_0x2c3372]=_0x5b7b3a);}const _0x4bc75b=_0x14dddd[_0x391722(0x1c0)]||undefined,_0xe3eeea=Object[_0x391722(0x1f1)](_0x417af7)[_0x391722(0x1e5)]>0x0,_0x3df9c7=_0x119e5e[_0x391722(0x1cd)]||env(_0x391722(0x1c8))||undefined,_0x5bc8bc=_0x3df9c7||_0x4bc75b||undefined,_0x266ce3=_0x119e5e[_0x391722(0x1b2)]||env('APPCODE')||undefined,_0x47fcc3=_0x266ce3?Object[_0x391722(0x1c5)](_0x417af7)['find'](([,_0x14f2ae])=>_0x14f2ae?.['appcode']===_0x266ce3):undefined,_0x18540f=_0x47fcc3?.[0x0],_0x1b5cb4=_0x47fcc3?.[0x1];let _0x71ee92=_0x266ce3?_0x18540f:_0x5bc8bc,_0x2faf36=_0x71ee92&&_0x417af7[_0x71ee92]?_0x417af7[_0x71ee92]:undefined;_0x266ce3&&_0x1b5cb4&&(_0x2faf36=_0x1b5cb4);const _0x1b28b8=_0x266ce3?_0x1b5cb4??_0x2faf36:_0x2faf36,_0x55cb20=_0x3df9c7||(_0x266ce3?_0x18540f:undefined),_0x2beda9=_0x266ce3||_0x1b28b8?.['appcode']||undefined,_0x2afd07=_0x119e5e[_0x391722(0x1c2)]||env(_0x391722(0x1fd))||_0x1b28b8?.['env']||_0x14dddd[_0x391722(0x1c2)]||DEFAULT_CONFIG_VALUES[_0x391722(0x1c2)],_0x56fb2f=_0x1b28b8?.[_0x391722(0x1d8)]||_0x14dddd[_0x391722(0x1d8)]||DEFAULT_CONFIG_VALUES[_0x391722(0x1d8)],_0x302584=env('COOKIE')||_0x1b28b8?.[_0x391722(0x1e9)]||_0x14dddd[_0x391722(0x1e9)]||undefined,_0x4e873a=env(_0x391722(0x1cb))||_0x1b28b8?.[_0x391722(0x1d0)]||_0x14dddd['accessKey']||undefined,_0x5cd364=_0x119e5e[_0x391722(0x1f7)]||env(_0x391722(0x1c1))||_0x1b28b8?.[_0x391722(0x1f7)]||_0x14dddd[_0x391722(0x1f7)],_0x4ddbab=normalizeLegacyOutputFormat(_0x5cd364),_0x3edcfd=env(_0x391722(0x1fa))||_0x1b28b8?.[_0x391722(0x1ee)]||_0x14dddd['pageSize'],_0x4f36d0=_0x3edcfd?Number(_0x3edcfd)||undefined:undefined,_0x4ccaca=env(_0x391722(0x1e3))||env(_0x391722(0x1eb))||_0x1b28b8?.[_0x391722(0x1b1)]||_0x14dddd['riskLevel']||_0x14dddd[_0x391722(0x1e6)],_0x550000=_0x4ccaca===_0x391722(0x1d9)||_0x4ccaca===_0x391722(0x1b7)?_0x4ccaca:DEFAULT_CONFIG_VALUES[_0x391722(0x1b1)],_0x2e40d6=env(_0x391722(0x1d3)),_0x5d0b26=_0x2e40d6==='1'||_0x2e40d6===_0x391722(0x1d7),_0x28cdec=_0x1b28b8?.[_0x391722(0x1c9)]||_0x14dddd[_0x391722(0x1c9)]||DEFAULT_CONFIG_VALUES[_0x391722(0x1c9)],_0x2b9293=isDaily(normalizeEnv(String(_0x2afd07)))?_0x391722(0x1e4):'production';return{'appCode':typeof _0x2beda9===_0x391722(0x1f9)&&_0x2beda9[_0x391722(0x1db)]()?_0x2beda9['trim']():undefined,'env':_0x2b9293,'locale':_0x56fb2f,'cookie':_0x302584,'accessKey':_0x4e873a,'format':_0x4ddbab,'pageSize':_0x4f36d0,'riskLevel':_0x550000,'verbose':_0x5d0b26,'apiDir':_0x28cdec,'apps':_0x417af7,'defaultApp':_0x4bc75b,'currentApp':_0xe3eeea?_0x71ee92:undefined,'explicitAppName':_0x55cb20,'raw':_0x14dddd};}async function buildAuth(_0x4e1d92){const _0x2dcb4b=a135_0x532b73,{getCookie:_0x2d500a}=await import(_0x2dcb4b(0x1e1)),_0x381de3=_0x4e1d92[_0x2dcb4b(0x1e9)]||_0x2d500a(),_0xb248ba=_0x381de3?await getIsSessionValid():![];return{'cookie':_0x381de3,'isLoggedIn':_0xb248ba,async 'getOrLogin'(){const _0x91f723=_0x2dcb4b;if(_0x381de3&&_0xb248ba)return _0x381de3;throw CliErrors[_0x91f723(0x1dc)]();}};}export function resolveApiFilePath(_0x245750,_0x1cb03c){const _0x35a141=a135_0x532b73,_0x563789=resolve(process[_0x35a141(0x1b3)](),_0x245750),_0x52ae12=resolve(_0x563789,_0x35a141(0x1fb));if(!_0x1cb03c)return _0x52ae12;const _0xd938f1=readRawConfig(),_0x420245=_0xd938f1[_0x35a141(0x1d5)]&&typeof _0xd938f1[_0x35a141(0x1d5)]==='object'?_0xd938f1[_0x35a141(0x1d5)]:{},_0x1a3381=Object[_0x35a141(0x1c5)](_0x420245)[_0x35a141(0x1d2)](([,_0x485dc9])=>_0x485dc9?.['appcode']===_0x1cb03c);if(!_0x1a3381)return _0x52ae12;const [_0x2b12ae,_0x18fdd1]=_0x1a3381,_0x514ad9=typeof _0xd938f1[_0x35a141(0x1c0)]==='string'?_0xd938f1[_0x35a141(0x1c0)]:undefined;if(_0x18fdd1?.['apiDir'])return _0x52ae12;if(_0x514ad9&&_0x2b12ae!==_0x514ad9)return resolve(_0x563789,_0x2b12ae+_0x35a141(0x1cf));return _0x52ae12;}
1
+ function a136_0x52ee(){const _0x379cb3=['map','.tmp','utf8','migrated','filter','https://g.lovrabet.com/dist/lovrabet-skill','riskLevel','176782ZdkroZ','set','APP','read','status','join','stringify','MAX_RISK','authRequired','error','length','84CQHWWe','maxRisk','Project','argv','env','RISK_LEVEL','33964117ZRdnDV','string','.lovrabet.json','appcode','APPCODE','get','daily','values','object','./auth/get-cookie.js','accessKey','apiDir','.rabetbase.json','data','19qzKJTI','.lovrabetrc','keys','entries','12MbAhzI','./constant/env.js','production','trim','-api.ts','1862259moBgmi','9nfJhqN','COOKIE','apps','empty','./utils/is-non-interactive.js','locale','message','defaultApp','userDomain','pageSize','setLogPath','8884904ANlxBk','1653670SfSHWI','cwd','missing','ACCESS_KEY','merged','\x0a\x20\x20','slice','config','template_base_url','cookie','parse','app','warn','1035310gJnTgm','18yzHsxs','ENV','replace','write','format','138537ORZnZw','apiDomain','PAGE_SIZE','FORMAT','find'];a136_0x52ee=function(){return _0x379cb3;};return a136_0x52ee();}const a136_0x44858f=a136_0x4703;(function(_0x5b4f34,_0x31d626){const _0x512dae=a136_0x4703,_0x4e3d59=_0x5b4f34();while(!![]){try{const _0x2199be=-parseInt(_0x512dae(0x146))/0x1*(parseInt(_0x512dae(0x127))/0x2)+parseInt(_0x512dae(0x11b))/0x3*(parseInt(_0x512dae(0x132))/0x4)+parseInt(_0x512dae(0x115))/0x5+parseInt(_0x512dae(0x116))/0x6*(-parseInt(_0x512dae(0x14f))/0x7)+-parseInt(_0x512dae(0x15b))/0x8+parseInt(_0x512dae(0x150))/0x9*(parseInt(_0x512dae(0x15c))/0xa)+-parseInt(_0x512dae(0x138))/0xb*(-parseInt(_0x512dae(0x14a))/0xc);if(_0x2199be===_0x31d626)break;else _0x4e3d59['push'](_0x4e3d59['shift']());}catch(_0x513df2){_0x4e3d59['push'](_0x4e3d59['shift']());}}}(a136_0x52ee,0xcd7d2));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x2b68a5){return process.env[`RABETBASE_${_0x2b68a5}`]||process.env[`LOVRABET_${_0x2b68a5}`]||undefined;}export const NEW_CONFIG_NAME=a136_0x44858f(0x144);export const CONFIG_NAMES=[a136_0x44858f(0x144),a136_0x44858f(0x13a),a136_0x44858f(0x147)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a136_0x44858f(0x124)](_0xdf6c42=>_0xdf6c42!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x286339){for(const _0x3bf85d of CONFIG_NAMES){const _0x351cfe=resolve(_0x286339,_0x3bf85d);if(existsSync(_0x351cfe))return _0x351cfe;}return undefined;}export function findProjectRootDirectory(_0x5e44b7=process[a136_0x44858f(0x15d)]()){let _0x2ad055=resolve(_0x5e44b7);const {root:_0x5d68f5}=parse(_0x2ad055),_0x299737=homedir();while(!![]){if(resolveConfigPath(_0x2ad055)){if(_0x2ad055===_0x299737)break;return _0x2ad055;}if(_0x2ad055===_0x5d68f5||_0x2ad055===_0x299737)break;const _0x42f543=dirname(_0x2ad055);if(_0x42f543===_0x2ad055)break;_0x2ad055=_0x42f543;}return resolve(_0x5e44b7);}export async function createContext(_0x155377){const _0x575ce3=a136_0x44858f,_0x3275b2=readRawConfig(),_0x245b91=buildConfig(_0x3275b2,_0x155377),{initEnv:_0xb2d13e}=await import(_0x575ce3(0x14b));if(_0x245b91[_0x575ce3(0x136)])_0xb2d13e(_0x245b91[_0x575ce3(0x136)]);else _0x155377[_0x575ce3(0x136)]&&typeof _0x155377[_0x575ce3(0x136)]===_0x575ce3(0x139)&&_0xb2d13e(_0x155377['env']);const {initDomains:_0x7ecca7,getUserDomain:_0x4921f6,getApiDomain:_0x10ef11}=await import('./constant/domain.js');_0x7ecca7({'apiDomain':_0x3275b2[_0x575ce3(0x11c)]||undefined,'userDomain':_0x3275b2[_0x575ce3(0x158)]||undefined,'runtimeDomain':_0x3275b2['runtimeDomain']||undefined});const _0x2c91dd={'apiDomain':_0x10ef11(),'userDomain':_0x4921f6()},_0x4a40f7=await buildAuth(_0x245b91);logger[_0x575ce3(0x15a)](process[_0x575ce3(0x15d)]());const _0x37f8c6=(CLI_BIN_NAME+'\x20'+process[_0x575ce3(0x135)][_0x575ce3(0x162)](0x2)[_0x575ce3(0x12c)]('\x20'))['trim']();logger['setRawCommand'](_0x37f8c6);const {isNonInteractive:_0x1888f1}=await import(_0x575ce3(0x154)),_0x3522f6=_0x1888f1(_0x155377);return{'config':_0x245b91,'auth':_0x4a40f7,'logger':logger,'env':_0x2c91dd,'nonInteractive':_0x3522f6};}export function buildConfigFromFlags(_0xc68ba7){return buildConfig(readRawConfig(),_0xc68ba7);}export function getProjectConfigPath(){const _0x3dbfa4=a136_0x44858f;return resolveConfigPath(process[_0x3dbfa4(0x15d)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a136_0x4703(_0x42c157,_0xc568fb){_0x42c157=_0x42c157-0x114;const _0x52eed6=a136_0x52ee();let _0x47032f=_0x52eed6[_0x42c157];return _0x47032f;}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3a0aea){const _0x218347=a136_0x44858f;if(!existsSync(_0x3a0aea))return{'status':_0x218347(0x15e)};try{const _0x3e3011=readFileSync(_0x3a0aea,{'encoding':_0x218347(0x122)});if(!_0x3e3011?.[_0x218347(0x14d)]())return{'status':'empty'};const _0x2cd039=JSON[_0x218347(0x166)](_0x3e3011);return{'status':'ok','data':_0x2cd039};}catch(_0x35ee21){return{'status':'error','message':_0x35ee21 instanceof Error?_0x35ee21[_0x218347(0x156)]:String(_0x35ee21)};}}function parseCliConfigJsonFile(_0x39a876,_0x230d10,_0x14790d){const _0x334afc=a136_0x44858f,_0x1013e3=inspectCliConfigJsonFile(_0x39a876);if(_0x1013e3[_0x334afc(0x12b)]===_0x334afc(0x15e)||_0x1013e3['status']===_0x334afc(0x153))return{};if(_0x1013e3[_0x334afc(0x12b)]==='ok')return _0x1013e3[_0x334afc(0x145)];return _0x230d10===_0x334afc(0x114)&&_0x14790d&&console[_0x334afc(0x130)](CLI_BIN_NAME+':\x20'+_0x14790d+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x39a876+_0x334afc(0x161)+_0x1013e3[_0x334afc(0x156)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0xb71c26){const _0x4f23a4=a136_0x44858f;if(!_0xb71c26||typeof _0xb71c26!==_0x4f23a4(0x140))return{'config':{},'migrated':![]};const _0x4ea5a8={..._0xb71c26},_0xa6d1ea=_0x4ea5a8[_0x4f23a4(0x152)]&&typeof _0x4ea5a8[_0x4f23a4(0x152)]===_0x4f23a4(0x140)?{..._0x4ea5a8[_0x4f23a4(0x152)]}:{},_0x43e2ff=Object[_0x4f23a4(0x148)](_0xa6d1ea)[_0x4f23a4(0x131)],_0x536f37=_0x4ea5a8['appcode']||_0x4ea5a8[_0x4f23a4(0x167)];let _0x535265=![];if(_0x536f37&&_0x43e2ff===0x0){const _0x189f5e=typeof _0x4ea5a8[_0x4f23a4(0x157)]===_0x4f23a4(0x139)&&_0x4ea5a8[_0x4f23a4(0x157)]['trim']()?_0x4ea5a8['defaultApp']:String(_0x536f37)[_0x4f23a4(0x14d)]();_0xa6d1ea[_0x189f5e]={'appcode':String(_0x536f37)[_0x4f23a4(0x14d)](),..._0x4ea5a8[_0x4f23a4(0x136)]!=null?{'env':_0x4ea5a8[_0x4f23a4(0x136)]}:{},..._0x4ea5a8[_0x4f23a4(0x143)]!=null?{'apiDir':_0x4ea5a8[_0x4f23a4(0x143)]}:{},..._0x4ea5a8[_0x4f23a4(0x165)]!=null?{'cookie':_0x4ea5a8[_0x4f23a4(0x165)]}:{},..._0x4ea5a8[_0x4f23a4(0x142)]!=null?{'accessKey':_0x4ea5a8[_0x4f23a4(0x142)]}:{},..._0x4ea5a8[_0x4f23a4(0x11a)]!=null?{'format':_0x4ea5a8['format']}:{},..._0x4ea5a8[_0x4f23a4(0x159)]!=null?{'pageSize':_0x4ea5a8[_0x4f23a4(0x159)]}:{},..._0x4ea5a8['riskLevel']!=null?{'riskLevel':_0x4ea5a8[_0x4f23a4(0x126)]}:{},..._0x4ea5a8[_0x4f23a4(0x155)]!=null?{'locale':_0x4ea5a8['locale']}:{}},_0x4ea5a8['apps']=_0xa6d1ea;if(!_0x4ea5a8[_0x4f23a4(0x157)])_0x4ea5a8[_0x4f23a4(0x157)]=_0x189f5e;_0x535265=!![];}return(_0x4f23a4(0x13b)in _0x4ea5a8||_0x4f23a4(0x167)in _0x4ea5a8)&&(delete _0x4ea5a8[_0x4f23a4(0x13b)],delete _0x4ea5a8[_0x4f23a4(0x167)],_0x535265=!![]),{'config':_0x4ea5a8,'migrated':_0x535265};}function writeNormalizedConfigIfNeeded(_0x1c71eb,_0x378c54){const _0xbedd64=a136_0x44858f,_0x36f8da=JSON[_0xbedd64(0x12d)](_0x378c54,null,0x2)+'\x0a';if(normalizedWriteCache[_0xbedd64(0x13d)](_0x1c71eb)===_0x36f8da)return;writeConfigFile(_0x1c71eb,_0x378c54),normalizedWriteCache[_0xbedd64(0x128)](_0x1c71eb,_0x36f8da);}function parseAndNormalizeConfig(_0x3f6811,_0x5bcfce,_0x4e7360){const _0x699be9=a136_0x44858f,_0x68aa2d=parseCliConfigJsonFile(_0x3f6811,_0x5bcfce,_0x4e7360),_0x1cba1a=normalizeLegacyConfigShape(_0x68aa2d);if(_0x1cba1a[_0x699be9(0x123)])try{writeNormalizedConfigIfNeeded(_0x3f6811,_0x1cba1a[_0x699be9(0x163)]);}catch{}return _0x1cba1a[_0x699be9(0x163)];}export function loadRawConfigLayers(_0x3e816c){const _0x3796f8=a136_0x44858f;let _0x3c2a08={},_0x10de5b={};const _0x531951=resolveConfigPath(homedir());_0x531951&&(_0x3c2a08=parseAndNormalizeConfig(_0x531951,'warn','Global'));const _0x39ea89=_0x3e816c??findProjectRootDirectory(),_0x4e73d5=resolveConfigPath(_0x39ea89);return _0x4e73d5&&(_0x10de5b=parseAndNormalizeConfig(_0x4e73d5,'warn',_0x3796f8(0x134))),{'globalPath':_0x531951,'projectPath':_0x4e73d5,'globalConfig':_0x3c2a08,'projectConfig':_0x10de5b};}function mergeRawConfigLayers(_0x285170){const _0x5873a5=a136_0x44858f,{globalConfig:_0x5c942f,projectConfig:_0x3ede4d}=_0x285170;if(_0x3ede4d['inherit']===![]){const _0x5dd873={..._0x3ede4d};delete _0x5dd873['inherit'];const _0x5c4326=_0x3ede4d['apps']&&typeof _0x3ede4d[_0x5873a5(0x152)]===_0x5873a5(0x140)?_0x3ede4d[_0x5873a5(0x152)]:{};Object[_0x5873a5(0x148)](_0x5c4326)[_0x5873a5(0x131)]>0x0?_0x5dd873[_0x5873a5(0x152)]=_0x5c4326:delete _0x5dd873['apps'];if(_0x5873a5(0x157)in _0x3ede4d)_0x5dd873['defaultApp']=_0x3ede4d['defaultApp'];else Object['keys'](_0x5c4326)[_0x5873a5(0x131)]>0x0&&(_0x5dd873[_0x5873a5(0x157)]=Object['keys'](_0x5c4326)[0x0]);return _0x5dd873;}const _0x54bf33=_0x5c942f[_0x5873a5(0x152)]&&typeof _0x5c942f[_0x5873a5(0x152)]===_0x5873a5(0x140)?_0x5c942f[_0x5873a5(0x152)]:{},_0x32b0ab=_0x3ede4d['apps']&&typeof _0x3ede4d[_0x5873a5(0x152)]===_0x5873a5(0x140)?_0x3ede4d[_0x5873a5(0x152)]:{},_0x354254={..._0x54bf33,..._0x32b0ab},_0x32720d={..._0x5c942f,..._0x3ede4d};Object['keys'](_0x354254)['length']>0x0&&(_0x32720d[_0x5873a5(0x152)]=_0x354254);if(_0x5873a5(0x157)in _0x3ede4d)_0x32720d['defaultApp']=_0x3ede4d[_0x5873a5(0x157)];else{if(_0x32b0ab&&Object['keys'](_0x32b0ab)[_0x5873a5(0x131)]>0x0)_0x32720d[_0x5873a5(0x157)]=Object[_0x5873a5(0x148)](_0x32b0ab)[0x0];else{if(_0x5c942f[_0x5873a5(0x157)])_0x32720d['defaultApp']=_0x5c942f[_0x5873a5(0x157)];else{const _0x5d0b61=Object['keys'](_0x54bf33);_0x5d0b61[_0x5873a5(0x131)]>0x0&&(_0x32720d[_0x5873a5(0x157)]=_0x5d0b61[0x0]);}}}return _0x32720d;}export function readRawConfigWithLayers(_0x51826d){const _0x388935=loadRawConfigLayers(_0x51826d);return{'config':mergeRawConfigLayers(_0x388935),'layers':_0x388935};}export function readRawConfig(_0x5cef63){return mergeRawConfigLayers(loadRawConfigLayers(_0x5cef63));}export function getConfigAppCode(_0x3ce3a4){const _0x2aa76e=a136_0x44858f,_0xad5fb2=readRawConfig(_0x3ce3a4);if(_0xad5fb2['apps']&&typeof _0xad5fb2[_0x2aa76e(0x152)]===_0x2aa76e(0x140)){const _0x1bfe0d=_0xad5fb2[_0x2aa76e(0x157)];if(_0x1bfe0d&&_0xad5fb2[_0x2aa76e(0x152)][_0x1bfe0d]?.[_0x2aa76e(0x13b)])return String(_0xad5fb2['apps'][_0x1bfe0d]['appcode'])['trim']();const _0x21c92c=Object[_0x2aa76e(0x13f)](_0xad5fb2[_0x2aa76e(0x152)])[0x0];if(_0x21c92c?.[_0x2aa76e(0x13b)])return String(_0x21c92c[_0x2aa76e(0x13b)])[_0x2aa76e(0x14d)]();}const _0x3de6f0=_0xad5fb2[_0x2aa76e(0x13b)]||_0xad5fb2[_0x2aa76e(0x167)];if(typeof _0x3de6f0!=='string'||_0x3de6f0[_0x2aa76e(0x14d)]()==='')return undefined;return _0x3de6f0[_0x2aa76e(0x14d)]();}export function getMultiAppConfigs(_0x16b198='project',_0x181764){const _0x17a002=a136_0x44858f,_0x455e2b=_0x16b198===_0x17a002(0x160)?readRawConfig(_0x181764):loadRawConfigLayers(_0x181764)['projectConfig'],_0x4a31b4=_0x455e2b['apps'];if(!_0x4a31b4||typeof _0x4a31b4!=='object'||Object[_0x17a002(0x148)](_0x4a31b4)[_0x17a002(0x131)]===0x0)return null;const _0x5d856b=_0x455e2b[_0x17a002(0x157)];return Object['entries'](_0x4a31b4)[_0x17a002(0x120)](([_0x28c3d6,_0x2e8c8f])=>({'name':_0x28c3d6,'appcode':_0x2e8c8f?.['appcode']||'','isDefault':_0x28c3d6===_0x5d856b,'env':_0x2e8c8f?.[_0x17a002(0x136)],'apiDir':_0x2e8c8f?.[_0x17a002(0x143)],'cookie':_0x2e8c8f?.[_0x17a002(0x165)]||undefined}))[_0x17a002(0x124)](_0x38309c=>_0x38309c['appcode']);}export function getTemplateBaseUrl(_0x3e030a){const _0x3296a1=a136_0x44858f,_0x90a992=readRawConfig(_0x3e030a);if(_0x90a992['template_base_url']&&typeof _0x90a992['template_base_url']===_0x3296a1(0x139))return _0x90a992[_0x3296a1(0x164)][_0x3296a1(0x118)](/\/$/,'');return _0x3296a1(0x125);}export function readConfigFile(_0x6b9663){return parseAndNormalizeConfig(_0x6b9663,'silent');}export function writeConfigFile(_0x645d21,_0x236058){const _0x1b7a42=a136_0x44858f,_0x25d023=dirname(_0x645d21);!existsSync(_0x25d023)&&mkdirSync(_0x25d023,{'recursive':!![]});const _0x55fa44=_0x645d21+_0x1b7a42(0x121);try{writeFileSync(_0x55fa44,JSON[_0x1b7a42(0x12d)](_0x236058,null,0x2)+'\x0a',{'encoding':_0x1b7a42(0x122),'mode':0x180}),renameSync(_0x55fa44,_0x645d21);}catch(_0x1648b7){try{unlinkSync(_0x55fa44);}catch{}throw _0x1648b7;}}export function resolveWriteConfigPath(_0x44e1b7){const _0x5ea005=_0x44e1b7==='project'?process['cwd']():homedir(),_0x2354d2=resolveConfigPath(_0x5ea005);return _0x2354d2??resolve(_0x5ea005,NEW_CONFIG_NAME);}function buildConfig(_0x53a04b,_0x333b24){const _0x3dd3a4=a136_0x44858f,_0xc0c9e5={};if(_0x53a04b[_0x3dd3a4(0x152)]&&typeof _0x53a04b[_0x3dd3a4(0x152)]===_0x3dd3a4(0x140))for(const [_0x2ed239,_0x4a43ad]of Object[_0x3dd3a4(0x149)](_0x53a04b[_0x3dd3a4(0x152)])){_0x4a43ad&&typeof _0x4a43ad===_0x3dd3a4(0x140)&&_0x4a43ad[_0x3dd3a4(0x13b)]&&(_0xc0c9e5[_0x2ed239]=_0x4a43ad);}const _0x6888e6=_0x53a04b[_0x3dd3a4(0x157)]||undefined,_0x3606ac=Object[_0x3dd3a4(0x148)](_0xc0c9e5)['length']>0x0,_0x36d4d0=_0x333b24['app']||env(_0x3dd3a4(0x129))||undefined,_0x54e108=_0x36d4d0||_0x6888e6||undefined,_0x11e17f=_0x333b24[_0x3dd3a4(0x13b)]||env(_0x3dd3a4(0x13c))||undefined,_0x170eca=_0x11e17f?Object['entries'](_0xc0c9e5)[_0x3dd3a4(0x11f)](([,_0x2fee78])=>_0x2fee78?.[_0x3dd3a4(0x13b)]===_0x11e17f):undefined,_0xe66bd2=_0x170eca?.[0x0],_0xf59576=_0x170eca?.[0x1];let _0x26343b=_0x11e17f?_0xe66bd2:_0x54e108,_0x4d93fe=_0x26343b&&_0xc0c9e5[_0x26343b]?_0xc0c9e5[_0x26343b]:undefined;_0x11e17f&&_0xf59576&&(_0x4d93fe=_0xf59576);const _0x4c4530=_0x11e17f?_0xf59576??_0x4d93fe:_0x4d93fe,_0x6f9190=_0x36d4d0||(_0x11e17f?_0xe66bd2:undefined),_0x4eb243=_0x11e17f||_0x4c4530?.[_0x3dd3a4(0x13b)]||undefined,_0x47dfc4=_0x333b24[_0x3dd3a4(0x136)]||env(_0x3dd3a4(0x117))||_0x4c4530?.[_0x3dd3a4(0x136)]||_0x53a04b[_0x3dd3a4(0x136)]||DEFAULT_CONFIG_VALUES[_0x3dd3a4(0x136)],_0xe11052=_0x4c4530?.[_0x3dd3a4(0x155)]||_0x53a04b[_0x3dd3a4(0x155)]||DEFAULT_CONFIG_VALUES[_0x3dd3a4(0x155)],_0x5dae8b=env(_0x3dd3a4(0x151))||_0x4c4530?.[_0x3dd3a4(0x165)]||_0x53a04b[_0x3dd3a4(0x165)]||undefined,_0x576bf7=env(_0x3dd3a4(0x15f))||_0x4c4530?.[_0x3dd3a4(0x142)]||_0x53a04b[_0x3dd3a4(0x142)]||undefined,_0xc02c41=_0x333b24[_0x3dd3a4(0x11a)]||env(_0x3dd3a4(0x11e))||_0x4c4530?.[_0x3dd3a4(0x11a)]||_0x53a04b[_0x3dd3a4(0x11a)],_0x4fffbd=normalizeLegacyOutputFormat(_0xc02c41),_0x4d6d63=env(_0x3dd3a4(0x11d))||_0x4c4530?.[_0x3dd3a4(0x159)]||_0x53a04b[_0x3dd3a4(0x159)],_0x54046a=_0x4d6d63?Number(_0x4d6d63)||undefined:undefined,_0x4f7ff0=env(_0x3dd3a4(0x137))||env(_0x3dd3a4(0x12e))||_0x4c4530?.['riskLevel']||_0x53a04b[_0x3dd3a4(0x126)]||_0x53a04b[_0x3dd3a4(0x133)],_0x5e949f=_0x4f7ff0===_0x3dd3a4(0x12a)||_0x4f7ff0===_0x3dd3a4(0x119)?_0x4f7ff0:DEFAULT_CONFIG_VALUES[_0x3dd3a4(0x126)],_0x418ac6=env('VERBOSE'),_0x375a12=_0x418ac6==='1'||_0x418ac6==='true',_0x59f8f2=_0x4c4530?.[_0x3dd3a4(0x143)]||_0x53a04b['apiDir']||DEFAULT_CONFIG_VALUES[_0x3dd3a4(0x143)],_0x2e4c47=isDaily(normalizeEnv(String(_0x47dfc4)))?_0x3dd3a4(0x13e):_0x3dd3a4(0x14c);return{'appCode':typeof _0x4eb243===_0x3dd3a4(0x139)&&_0x4eb243['trim']()?_0x4eb243[_0x3dd3a4(0x14d)]():undefined,'env':_0x2e4c47,'locale':_0xe11052,'cookie':_0x5dae8b,'accessKey':_0x576bf7,'format':_0x4fffbd,'pageSize':_0x54046a,'riskLevel':_0x5e949f,'verbose':_0x375a12,'apiDir':_0x59f8f2,'apps':_0xc0c9e5,'defaultApp':_0x6888e6,'currentApp':_0x3606ac?_0x26343b:undefined,'explicitAppName':_0x6f9190,'raw':_0x53a04b};}async function buildAuth(_0x5a80aa){const _0x5a2126=a136_0x44858f,{getCookie:_0x28d919}=await import(_0x5a2126(0x141)),_0x84f477=_0x5a80aa[_0x5a2126(0x165)]||_0x28d919(),_0x3aa620=_0x84f477?await getIsSessionValid():![];return{'cookie':_0x84f477,'isLoggedIn':_0x3aa620,async 'getOrLogin'(){const _0x3cdd40=_0x5a2126;if(_0x84f477&&_0x3aa620)return _0x84f477;throw CliErrors[_0x3cdd40(0x12f)]();}};}export function resolveApiFilePath(_0x17814c,_0x1c589d){const _0x1f7d44=a136_0x44858f,_0x331dbe=resolve(process['cwd'](),_0x17814c),_0x231a72=resolve(_0x331dbe,'api.ts');if(!_0x1c589d)return _0x231a72;const _0xc1bd48=readRawConfig(),_0x4e8462=_0xc1bd48['apps']&&typeof _0xc1bd48['apps']===_0x1f7d44(0x140)?_0xc1bd48[_0x1f7d44(0x152)]:{},_0x9a12f5=Object[_0x1f7d44(0x149)](_0x4e8462)[_0x1f7d44(0x11f)](([,_0xf6b75c])=>_0xf6b75c?.[_0x1f7d44(0x13b)]===_0x1c589d);if(!_0x9a12f5)return _0x231a72;const [_0x37357e,_0x3b4f2f]=_0x9a12f5,_0x433cbf=typeof _0xc1bd48['defaultApp']===_0x1f7d44(0x139)?_0xc1bd48[_0x1f7d44(0x157)]:undefined;if(_0x3b4f2f?.['apiDir'])return _0x231a72;if(_0x433cbf&&_0x37357e!==_0x433cbf)return resolve(_0x331dbe,_0x37357e+_0x1f7d44(0x14e));return _0x231a72;}