@lovrabet/rabetbase-cli 2.1.11 → 2.1.12-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 (198) 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/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/field-update.js +1 -1
  55. package/lib/commands/dataset/index.js +1 -1
  56. package/lib/commands/dataset/link-create.js +1 -1
  57. package/lib/commands/dataset/link-delete.js +1 -1
  58. package/lib/commands/dataset/link-shared.js +1 -1
  59. package/lib/commands/dataset/link-update.js +1 -1
  60. package/lib/commands/dataset/links.js +1 -1
  61. package/lib/commands/dataset/list.js +1 -1
  62. package/lib/commands/dataset/operations.js +1 -1
  63. package/lib/commands/db/analyze-cancel.js +1 -1
  64. package/lib/commands/db/analyze-start.js +1 -1
  65. package/lib/commands/db/analyze-status.js +1 -1
  66. package/lib/commands/db/create.js +1 -1
  67. package/lib/commands/db/delete.js +1 -1
  68. package/lib/commands/db/detail.js +1 -1
  69. package/lib/commands/db/diff.js +1 -1
  70. package/lib/commands/db/index.js +1 -1
  71. package/lib/commands/db/list.js +1 -1
  72. package/lib/commands/db/shared.js +1 -1
  73. package/lib/commands/db/tables.js +1 -1
  74. package/lib/commands/db/test.js +1 -1
  75. package/lib/commands/db/update.js +1 -1
  76. package/lib/commands/doctor.js +1 -1
  77. package/lib/commands/init/index.js +1 -1
  78. package/lib/commands/issue/index.js +1 -1
  79. package/lib/commands/issue/report.js +1 -1
  80. package/lib/commands/logs/index.js +1 -1
  81. package/lib/commands/menu/index.js +1 -1
  82. package/lib/commands/menu/shared/compare-table.js +1 -1
  83. package/lib/commands/menu/shared/index.js +1 -1
  84. package/lib/commands/menu/shared/inquirer.js +1 -1
  85. package/lib/commands/menu/shared/local-pages.js +1 -1
  86. package/lib/commands/menu/shared/logic.js +1 -1
  87. package/lib/commands/menu/shared/service.js +1 -1
  88. package/lib/commands/menu/shared/sync-core.js +1 -1
  89. package/lib/commands/menu/shared/update-core.js +1 -1
  90. package/lib/commands/menu/shared/valid-url.js +1 -1
  91. package/lib/commands/menu/sync.js +1 -1
  92. package/lib/commands/menu/update.js +1 -1
  93. package/lib/commands/page/generate-start.js +1 -1
  94. package/lib/commands/page/generate-status.js +1 -1
  95. package/lib/commands/page/index.js +1 -1
  96. package/lib/commands/page/pull.js +1 -1
  97. package/lib/commands/page/push.js +1 -1
  98. package/lib/commands/page/shared.js +1 -1
  99. package/lib/commands/page/standard-page-status.js +1 -1
  100. package/lib/commands/page/sync.js +1 -1
  101. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  102. package/lib/commands/project/create/format-elapsed.js +1 -1
  103. package/lib/commands/project/create/main.js +1 -1
  104. package/lib/commands/project/create/non-interactive.js +1 -1
  105. package/lib/commands/project/create/project-template-path.js +1 -1
  106. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  107. package/lib/commands/project/create/use-format-code.js +1 -1
  108. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  109. package/lib/commands/project/index.js +1 -1
  110. package/lib/commands/project/init.js +1 -1
  111. package/lib/commands/project/upgrade.js +1 -1
  112. package/lib/commands/registry.js +1 -1
  113. package/lib/commands/run/index.js +1 -1
  114. package/lib/commands/schema.js +1 -1
  115. package/lib/commands/skill/index.js +1 -1
  116. package/lib/commands/sql/create.js +1 -1
  117. package/lib/commands/sql/delete.js +1 -1
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.js +1 -1
  120. package/lib/commands/sql/index.js +1 -1
  121. package/lib/commands/sql/list.js +1 -1
  122. package/lib/commands/sql/pull.js +1 -1
  123. package/lib/commands/sql/push.js +1 -1
  124. package/lib/commands/sql/save.js +1 -1
  125. package/lib/commands/sql/shared.js +1 -1
  126. package/lib/commands/sql/status.js +1 -1
  127. package/lib/commands/sql/validate.js +1 -1
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/cdn.js +1 -1
  130. package/lib/constant/cli.js +1 -1
  131. package/lib/constant/defaults.js +1 -1
  132. package/lib/constant/domain.js +1 -1
  133. package/lib/constant/env.js +1 -1
  134. package/lib/constant/output.js +1 -1
  135. package/lib/constant/paths.js +1 -1
  136. package/lib/constant/risk.js +1 -1
  137. package/lib/context.js +1 -1
  138. package/lib/core/alias-resolver.js +1 -1
  139. package/lib/core/api-client.js +1 -1
  140. package/lib/core/bff/config.js +1 -1
  141. package/lib/core/bff/file-system.js +1 -1
  142. package/lib/core/bff/hash.js +1 -1
  143. package/lib/core/bff/lock.js +1 -1
  144. package/lib/core/bff/utils.js +1 -1
  145. package/lib/core/db-resolver.js +1 -1
  146. package/lib/core/page/file-system.js +1 -1
  147. package/lib/core/page/hash.js +1 -1
  148. package/lib/core/page/lock.js +1 -1
  149. package/lib/core/sql-sync/config.js +1 -1
  150. package/lib/core/sql-sync/file-system.js +1 -1
  151. package/lib/core/sql-sync/hash.js +1 -1
  152. package/lib/core/sql-sync/lock.js +1 -1
  153. package/lib/core/sql-sync/utils.js +1 -1
  154. package/lib/core/sql-validator.js +1 -1
  155. package/lib/errors.js +1 -1
  156. package/lib/framework/build-all-flags.js +1 -1
  157. package/lib/framework/flags.js +1 -1
  158. package/lib/framework/help.js +1 -1
  159. package/lib/framework/index.js +1 -1
  160. package/lib/framework/output.js +1 -1
  161. package/lib/framework/response.js +1 -1
  162. package/lib/framework/runner-alias.js +1 -1
  163. package/lib/framework/runner.js +1 -1
  164. package/lib/framework/schema-export.js +1 -1
  165. package/lib/framework/types.js +1 -1
  166. package/lib/generated/build-info.js +1 -1
  167. package/lib/help.js +1 -1
  168. package/lib/skills/main.js +1 -1
  169. package/lib/skills/npx-skills-add.js +1 -1
  170. package/lib/telemetry/cli-command-trace.js +1 -1
  171. package/lib/telemetry/cli-help-trace.js +1 -1
  172. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  173. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  174. package/lib/telemetry/send-cli-trace-log.js +1 -1
  175. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  176. package/lib/utils/ai_config.js +1 -1
  177. package/lib/utils/apply-jq-filter.js +1 -1
  178. package/lib/utils/cdn-config.js +1 -1
  179. package/lib/utils/check-sdk-version.js +1 -1
  180. package/lib/utils/cli-version-check.js +1 -1
  181. package/lib/utils/cli-version-policy.js +1 -1
  182. package/lib/utils/config.js +1 -1
  183. package/lib/utils/copy-directory.js +1 -1
  184. package/lib/utils/entity-with-id.js +1 -1
  185. package/lib/utils/file-utils.js +1 -1
  186. package/lib/utils/guides-cdn.js +1 -1
  187. package/lib/utils/http-client.js +1 -1
  188. package/lib/utils/is-non-interactive.js +1 -1
  189. package/lib/utils/logger.js +1 -1
  190. package/lib/utils/params.js +1 -1
  191. package/lib/utils/platform.js +1 -1
  192. package/lib/utils/rules-cdn.js +1 -1
  193. package/lib/utils/sleep.js +1 -1
  194. package/lib/utils/template-replacer.js +1 -1
  195. package/lib/utils/version.js +1 -1
  196. package/lib/utils/with-active-cookie.js +1 -1
  197. package/lib/utils/write-cli-side-channel.js +1 -1
  198. package/package.json +2 -2
@@ -1 +1 @@
1
- (function(_0x1fce90,_0x113409){const _0x321b68=a120_0x4a07,_0x48afd5=_0x1fce90();while(!![]){try{const _0x1bf8c0=parseInt(_0x321b68(0x1ea))/0x1*(-parseInt(_0x321b68(0x1e6))/0x2)+-parseInt(_0x321b68(0x1e8))/0x3*(parseInt(_0x321b68(0x1e3))/0x4)+-parseInt(_0x321b68(0x1ec))/0x5*(parseInt(_0x321b68(0x1e5))/0x6)+parseInt(_0x321b68(0x1ed))/0x7*(parseInt(_0x321b68(0x1eb))/0x8)+parseInt(_0x321b68(0x1e7))/0x9+-parseInt(_0x321b68(0x1e9))/0xa+parseInt(_0x321b68(0x1e4))/0xb;if(_0x1bf8c0===_0x113409)break;else _0x48afd5['push'](_0x48afd5['shift']());}catch(_0x4aa042){_0x48afd5['push'](_0x48afd5['shift']());}}}(a120_0x45eb,0x3b4f5));function a120_0x4a07(_0x18d639,_0x68027f){_0x18d639=_0x18d639-0x1e3;const _0x45eb77=a120_0x45eb();let _0x4a07cd=_0x45eb77[_0x18d639];return _0x4a07cd;}function a120_0x45eb(){const _0xecefc1=['1719628aRKwqn','17045248rcSSdM','6gxBJyU','4RLCprN','1097892ZrHmPx','3BSeeZf','4503300nBoaaa','208419OXGvFQ','41368DcmZoZ','2286605wybLIP','441AWEpzg'];a120_0x45eb=function(){return _0xecefc1;};return a120_0x45eb();}import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0xa0d394,_0x19c8c8){const _0x4b5dc6=a120_0x123d,_0x561057=_0xa0d394();while(!![]){try{const _0x2aa7ea=parseInt(_0x4b5dc6(0xa4))/0x1*(parseInt(_0x4b5dc6(0x9d))/0x2)+-parseInt(_0x4b5dc6(0x9f))/0x3*(-parseInt(_0x4b5dc6(0xa7))/0x4)+-parseInt(_0x4b5dc6(0xa0))/0x5*(-parseInt(_0x4b5dc6(0xa6))/0x6)+-parseInt(_0x4b5dc6(0xa3))/0x7*(parseInt(_0x4b5dc6(0xa1))/0x8)+-parseInt(_0x4b5dc6(0xa8))/0x9*(-parseInt(_0x4b5dc6(0xa5))/0xa)+parseInt(_0x4b5dc6(0xa2))/0xb*(parseInt(_0x4b5dc6(0xa9))/0xc)+-parseInt(_0x4b5dc6(0x9e))/0xd;if(_0x2aa7ea===_0x19c8c8)break;else _0x561057['push'](_0x561057['shift']());}catch(_0x660487){_0x561057['push'](_0x561057['shift']());}}}(a120_0x7766,0xc4fd4));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';function a120_0x123d(_0x2f86b1,_0x4d25be){_0x2f86b1=_0x2f86b1-0x9d;const _0x776665=a120_0x7766();let _0x123d8d=_0x776665[_0x2f86b1];return _0x123d8d;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';function a120_0x7766(){const _0xb9fc17=['36672285gAVjQt','2294142GXjgsR','10NUibqh','130984UDoOEC','33HIaNQw','231ErgbyE','34351crqnuC','2971880cThHyP','836616gWIBkB','4dRZSEJ','27aQUyyY','4809768NyWHEG','60vBUDvL'];a120_0x7766=function(){return _0xb9fc17;};return a120_0x7766();}import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a121_0x156752=a121_0x1562;function a121_0x4395(){const _0x37ca5b=['Filter\x20by\x20SQL\x20name','\x20SQL\x20queries\x20(total:\x20','Page\x20size','295Aenkka','string','num','114ARrqqG','sqlCode','totalCount','tableData','19610GtpAwI','read','str','Found\x20','dbId','19729580gKYqow','list','sqlName','page','Page\x20number','pagesize','24544hVXGPs','24222rTKRUP','description','verbose','sqlcode','226576ZUgrUH','name','map','15691482cZetPH','number','appCode','217Wdjdyz','396660HoMIwv','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','sql','length','List\x20custom\x20SQL\x20queries'];a121_0x4395=function(){return _0x37ca5b;};return a121_0x4395();}(function(_0xebd4f0,_0xea631c){const _0x389c58=a121_0x1562,_0x4f633e=_0xebd4f0();while(!![]){try{const _0x290d61=parseInt(_0x389c58(0x9d))/0x1+-parseInt(_0x389c58(0x86))/0x2*(parseInt(_0x389c58(0x82))/0x3)+-parseInt(_0x389c58(0x91))/0x4+-parseInt(_0x389c58(0xa5))/0x5*(parseInt(_0x389c58(0x92))/0x6)+parseInt(_0x389c58(0x9c))/0x7*(parseInt(_0x389c58(0x96))/0x8)+-parseInt(_0x389c58(0x99))/0x9+parseInt(_0x389c58(0x8b))/0xa;if(_0x290d61===_0xea631c)break;else _0x4f633e['push'](_0x4f633e['shift']());}catch(_0x44115d){_0x4f633e['push'](_0x4f633e['shift']());}}}(a121_0x4395,0xd8999));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a121_0x1562(_0x24fd0e,_0x200bfa){_0x24fd0e=_0x24fd0e-0x82;const _0x439582=a121_0x4395();let _0x156264=_0x439582[_0x24fd0e];return _0x156264;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a121_0x156752(0x9f),'command':a121_0x156752(0x8c),'description':a121_0x156752(0xa1),'risk':a121_0x156752(0x87),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a121_0x156752(0x97),'type':a121_0x156752(0xa6),'description':a121_0x156752(0xa2)},{'name':a121_0x156752(0x8e),'type':a121_0x156752(0x9a),'description':a121_0x156752(0x8f),'default':0x1},{'name':'pagesize','type':a121_0x156752(0x9a),'description':a121_0x156752(0xa4)},{'name':a121_0x156752(0x94),'type':'boolean','description':a121_0x156752(0x9e)}],async 'execute'(_0x4cab71){const _0x544e20=a121_0x156752,_0x51b450=await listSqlQueries(_0x4cab71['appCode'],{'sqlCode':_0x4cab71[_0x544e20(0x88)](_0x544e20(0x95))||undefined,'sqlName':_0x4cab71['str'](_0x544e20(0x97))||undefined,'currentPage':_0x4cab71['num'](_0x544e20(0x8e)),'pageSize':_0x4cab71[_0x544e20(0xa7)](_0x544e20(0x90),0x32)}),_0x10dcf3=_0x4cab71['bool'](_0x544e20(0x94)),_0x40b2c4=_0x51b450[_0x544e20(0x85)]??[],_0x2f9b1=_0x51b450['paging']?.[_0x544e20(0x84)]??_0x40b2c4[_0x544e20(0xa0)];let _0x44bece;return _0x10dcf3?_0x44bece=_0x40b2c4:_0x44bece=await Promise['all'](_0x40b2c4[_0x544e20(0x98)](async _0xfeb32=>{const _0x9e595e=_0x544e20;let _0x11b736;try{_0x11b736=_0xfeb32[_0x9e595e(0x8a)]?await getDbName(_0x4cab71[_0x9e595e(0x9b)],_0xfeb32[_0x9e595e(0x8a)]):undefined;}catch{}return{'sqlCode':_0xfeb32[_0x9e595e(0x83)],'sqlName':_0xfeb32[_0x9e595e(0x8d)],'description':_0xfeb32[_0x9e595e(0x93)]??'','db':_0x11b736?_0x11b736+'\x20('+_0xfeb32[_0x9e595e(0x8a)]+')':_0xfeb32[_0x9e595e(0x8a)]??''};})),{'ok':!![],'data':_0x44bece,'message':_0x40b2c4[_0x544e20(0xa0)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x544e20(0x89)+_0x40b2c4['length']+_0x544e20(0xa3)+_0x2f9b1+').'};}};
1
+ const a121_0x1d7aaa=a121_0x1fba;(function(_0x34fbb1,_0x13aeab){const _0xd2e0b1=a121_0x1fba,_0xff5bce=_0x34fbb1();while(!![]){try{const _0x10fda3=-parseInt(_0xd2e0b1(0x7d))/0x1*(parseInt(_0xd2e0b1(0x8e))/0x2)+-parseInt(_0xd2e0b1(0x9a))/0x3+-parseInt(_0xd2e0b1(0x92))/0x4*(-parseInt(_0xd2e0b1(0x9e))/0x5)+parseInt(_0xd2e0b1(0x9f))/0x6+parseInt(_0xd2e0b1(0x87))/0x7*(parseInt(_0xd2e0b1(0x8d))/0x8)+parseInt(_0xd2e0b1(0x93))/0x9+parseInt(_0xd2e0b1(0x83))/0xa*(-parseInt(_0xd2e0b1(0x99))/0xb);if(_0x10fda3===_0x13aeab)break;else _0xff5bce['push'](_0xff5bce['shift']());}catch(_0x44fb1f){_0xff5bce['push'](_0xff5bce['shift']());}}}(a121_0x27f9,0x80375));import{listSqlQueries}from'../../core/api-client.js';function a121_0x1fba(_0x6b8bdb,_0x3415df){_0x6b8bdb=_0x6b8bdb-0x7c;const _0x27f94c=a121_0x27f9();let _0x1fbacd=_0x27f94c[_0x6b8bdb];return _0x1fbacd;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a121_0x27f9(){const _0x54c099=['365OBcTQU','4897206baXziq','Found\x20','23egZLSY','sqlName','map','Page\x20number','dbId','verbose','435410fUgeRS','No\x20custom\x20SQL\x20queries\x20found.','totalCount','boolean','4459847cttuBb','tableData','num','appCode','length','list','8ATBIkV','14522yVXZJH','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','List\x20custom\x20SQL\x20queries','sqlCode','31484PsadxD','7081785GvaqwO','page','str','pagesize','all','number','473JHgRIj','750993oMAwNs','name','\x20SQL\x20queries\x20(total:\x20','Page\x20size'];a121_0x27f9=function(){return _0x54c099;};return a121_0x27f9();}export const sqlList={'service':'sql','command':a121_0x1d7aaa(0x8c),'description':a121_0x1d7aaa(0x90),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a121_0x1d7aaa(0x94),'type':a121_0x1d7aaa(0x98),'description':a121_0x1d7aaa(0x80),'default':0x1},{'name':a121_0x1d7aaa(0x96),'type':'number','description':a121_0x1d7aaa(0x9d)},{'name':a121_0x1d7aaa(0x82),'type':a121_0x1d7aaa(0x86),'description':a121_0x1d7aaa(0x8f)}],async 'execute'(_0xc83f8e){const _0x127194=a121_0x1d7aaa,_0x13c59a=await listSqlQueries(_0xc83f8e[_0x127194(0x8a)],{'sqlCode':_0xc83f8e[_0x127194(0x95)]('sqlcode')||undefined,'sqlName':_0xc83f8e[_0x127194(0x95)](_0x127194(0x9b))||undefined,'currentPage':_0xc83f8e[_0x127194(0x89)](_0x127194(0x94)),'pageSize':_0xc83f8e[_0x127194(0x89)]('pagesize',0x32)}),_0x50f7da=_0xc83f8e['bool'](_0x127194(0x82)),_0x5a634b=_0x13c59a[_0x127194(0x88)]??[],_0x4db1a5=_0x13c59a['paging']?.[_0x127194(0x85)]??_0x5a634b['length'];let _0x5d208d;return _0x50f7da?_0x5d208d=_0x5a634b:_0x5d208d=await Promise[_0x127194(0x97)](_0x5a634b[_0x127194(0x7f)](async _0x2e33a9=>{const _0x1e057a=_0x127194;let _0x4a5cef;try{_0x4a5cef=_0x2e33a9[_0x1e057a(0x81)]?await getDbName(_0xc83f8e[_0x1e057a(0x8a)],_0x2e33a9[_0x1e057a(0x81)]):undefined;}catch{}return{'sqlCode':_0x2e33a9[_0x1e057a(0x91)],'sqlName':_0x2e33a9[_0x1e057a(0x7e)],'description':_0x2e33a9['description']??'','db':_0x4a5cef?_0x4a5cef+'\x20('+_0x2e33a9[_0x1e057a(0x81)]+')':_0x2e33a9[_0x1e057a(0x81)]??''};})),{'ok':!![],'data':_0x5d208d,'message':_0x5a634b[_0x127194(0x8b)]===0x0?_0x127194(0x84):_0x127194(0x7c)+_0x5a634b[_0x127194(0x8b)]+_0x127194(0x9c)+_0x4db1a5+').'};}};
@@ -1 +1 @@
1
- const a122_0xe25332=a122_0x3cb8;function a122_0x4262(){const _0x58917d=['utf8','sqls','paging','18119739eUTdvD','path','2911980rpcVJB','\x20written,\x20','force','sqlCode','4vNQxOf','sqlName','message','lastSync','6mSievm','27tBglPz','POST','Force\x20pull\x20cancelled.','70PmMOqR','lockFilePath','pull','No\x20remote\x20SQL\x20queries\x20matched.','1744370XaoPJr','length','Force\x20overwrite\x20local\x20unsynced\x20changes','split','\x20failed','skipped','\x20skipped,\x20','str','tableData','appCode','sqlRootDir','test','trimStart','cancelled','would_pull','Filter\x20by\x20SQL\x20display\x20name','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.','bool','sqlRoot','12UDdYyO','catch','Pull\x20complete:\x20','10891160nIrfET','sqlcode','sql','totalCount','push','unchanged','name','toISOString','2960BCcNkI','2114790wvasax','dbId','sqlContent','local\x20differs\x20from\x20remote','description','9663297YoZZeo','replace','mybatisXml'];a122_0x4262=function(){return _0x58917d;};return a122_0x4262();}(function(_0x1eaefe,_0x50899d){const _0x3bb18a=a122_0x3cb8,_0x5b33ff=_0x1eaefe();while(!![]){try{const _0x1a4cf6=parseInt(_0x3bb18a(0x159))/0x1*(parseInt(_0x3bb18a(0x13f))/0x2)+parseInt(_0x3bb18a(0x140))/0x3+-parseInt(_0x3bb18a(0x151))/0x4*(-parseInt(_0x3bb18a(0x14d))/0x5)+-parseInt(_0x3bb18a(0x155))/0x6*(parseInt(_0x3bb18a(0x145))/0x7)+-parseInt(_0x3bb18a(0x137))/0x8+-parseInt(_0x3bb18a(0x156))/0x9*(-parseInt(_0x3bb18a(0x15d))/0xa)+parseInt(_0x3bb18a(0x14b))/0xb*(parseInt(_0x3bb18a(0x134))/0xc);if(_0x1a4cf6===_0x50899d)break;else _0x5b33ff['push'](_0x5b33ff['shift']());}catch(_0x55b190){_0x5b33ff['push'](_0x5b33ff['shift']());}}}(a122_0x4262,0xc81a4));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';function a122_0x3cb8(_0x1f58a1,_0x5869f9){_0x1f58a1=_0x1f58a1-0x12c;const _0x42625c=a122_0x4262();let _0x3cb846=_0x42625c[_0x1f58a1];return _0x3cb846;}import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x337d76,_0x46eb46){const _0x19642b=a122_0x3cb8,_0x3b5dc6=[];let _0x32da19=0x1;while(!![]){const _0x97ae6a=await listSqlQueries(_0x337d76,{'currentPage':_0x32da19,'pageSize':PAGE_SIZE,'sqlCode':_0x46eb46[_0x19642b(0x150)],'sqlName':_0x46eb46[_0x19642b(0x152)]}),_0xda8c01=_0x97ae6a[_0x19642b(0x165)]??[];_0x3b5dc6[_0x19642b(0x13b)](..._0xda8c01);if(_0xda8c01[_0x19642b(0x15e)]===0x0)break;const _0x28da48=_0x97ae6a[_0x19642b(0x14a)]?.[_0x19642b(0x13a)];if(_0x28da48!=null?_0x3b5dc6[_0x19642b(0x15e)]>=_0x28da48:_0xda8c01[_0x19642b(0x15e)]<PAGE_SIZE)break;_0x32da19++;}return _0x3b5dc6;}async function ensureSqlContent(_0x433b56){const _0x211878=a122_0x3cb8;if(_0x433b56[_0x211878(0x142)]!=null&&String(_0x433b56[_0x211878(0x142)])[_0x211878(0x15e)]>0x0)return _0x433b56;return getSqlQueryDetail(_0x433b56[_0x211878(0x150)]);}export const sqlPull={'service':a122_0xe25332(0x139),'command':a122_0xe25332(0x15b),'description':'Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','risk':'write','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0xe25332(0x13d),'type':'string','description':a122_0xe25332(0x130)},{'name':a122_0xe25332(0x14f),'type':'boolean','description':a122_0xe25332(0x15f)}],async 'dryRun'(_0x290611){const _0x358c51=a122_0xe25332,_0xedb627=loadSqlProjectConfig(_0x290611[_0x358c51(0x166)]),_0x1321ea=await readSqlLockFile(_0xedb627['lockFilePath']),{appLock:_0x315bb4}=ensureSqlLockScope(_0x1321ea??createEmptySqlLock(),_0xedb627[_0x358c51(0x166)],_0xedb627[_0x358c51(0x133)],_0x358c51(0x15b)),_0x2da727=await fetchAllSqlQueries(_0x290611[_0x358c51(0x166)],{'sqlCode':_0x290611['str'](_0x358c51(0x138))||undefined,'sqlName':_0x290611[_0x358c51(0x164)](_0x358c51(0x13d))||undefined}),_0xfc4ed0=[];for(const _0x388272 of _0x2da727){const _0x173402=await ensureSqlContent(_0x388272),_0x4efd2a=ensureRemoteSqlContent(_0x173402),_0x1ff38d=detectModeFromSql(_0x173402),_0x4d8562=_0x173402[_0x358c51(0x141)]?await getDbName(_0x290611[_0x358c51(0x166)],Number(_0x173402[_0x358c51(0x141)]))[_0x358c51(0x135)](()=>undefined):undefined,_0x3131c5=buildLocalSqlFileContent({'sqlCode':_0x173402[_0x358c51(0x150)],'sqlName':_0x173402['sqlName'],'dbId':_0x173402[_0x358c51(0x141)]},_0x4efd2a,{'dbName':_0x4d8562,'mode':_0x1ff38d,'syncedAt':new Date()['toISOString'](),'description':_0x173402[_0x358c51(0x144)]}),_0x4321d3=buildSqlLockEntry(_0x173402,_0x4efd2a,'',{'dbName':_0x4d8562}),_0x4df309=resolveLocalSqlFilePath(_0xedb627,_0x173402['sqlCode'],_0x4321d3);let _0x2e7a44=_0x358c51(0x12f),_0x4b43ea;if(await fileExists(_0x4df309)){const _0xeef235=await readFile(_0x4df309,_0x358c51(0x148));isEquivalentPulledSqlFile(_0xeef235,_0x3131c5,_0x1ff38d)?(_0x2e7a44=_0x358c51(0x162),_0x4b43ea=_0x358c51(0x13c)):(_0x2e7a44='conflict',_0x4b43ea='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0xfc4ed0[_0x358c51(0x13b)]({'sqlCode':_0x173402[_0x358c51(0x150)],'sqlName':_0x173402[_0x358c51(0x152)],'filePath':_0x4df309,'status':_0x2e7a44,'reason':_0x4b43ea});}return{'method':_0x358c51(0x157),'url':'/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','body':{'appCode':_0x290611['appCode'],'sqlCode':_0x290611[_0x358c51(0x164)]('sqlcode')||null,'sqlName':_0x290611[_0x358c51(0x164)](_0x358c51(0x13d))||null,'files':_0xfc4ed0},'description':'Would\x20pull\x20'+_0xfc4ed0[_0x358c51(0x15e)]+'\x20SQL\x20file(s)\x20into\x20'+_0xedb627[_0x358c51(0x167)]};},async 'execute'(_0xef5581){const _0x31ff2e=a122_0xe25332,_0x22c0a8=loadSqlProjectConfig(_0xef5581[_0x31ff2e(0x166)]),_0x174c8c=await readSqlLockFile(_0x22c0a8['lockFilePath']),{lockData:_0x4ada0b,appLock:_0x2e9cef}=ensureSqlLockScope(_0x174c8c??createEmptySqlLock(),_0x22c0a8[_0x31ff2e(0x166)],_0x22c0a8['sqlRoot'],'pull'),_0xfab3f9=_0xef5581[_0x31ff2e(0x132)](_0x31ff2e(0x14f)),_0x40cc6d=await fetchAllSqlQueries(_0xef5581[_0x31ff2e(0x166)],{'sqlCode':_0xef5581['str']('sqlcode')||undefined,'sqlName':_0xef5581['str']('name')||undefined});if(_0x40cc6d['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x31ff2e(0x15c)};const _0x342fa6=[],_0xc7d9a2=[];for(const _0x34275d of _0x40cc6d){try{_0x342fa6[_0x31ff2e(0x13b)](await ensureSqlContent(_0x34275d));}catch(_0xbe7334){_0xc7d9a2['push']({'sqlCode':_0x34275d[_0x31ff2e(0x150)],'error':_0xbe7334 instanceof Error?_0xbe7334[_0x31ff2e(0x153)]:String(_0xbe7334)});}}if(_0xfab3f9&&!_0xef5581['nonInteractive']){let _0x560087=![];for(const _0x25fcf1 of _0x342fa6){const _0xca8ce5=detectModeFromSql(_0x25fcf1),_0x10f32c=_0x25fcf1[_0x31ff2e(0x141)]?await getDbName(_0xef5581['appCode'],Number(_0x25fcf1[_0x31ff2e(0x141)]))[_0x31ff2e(0x135)](()=>undefined):undefined,_0x38ff07=buildLocalSqlFileContent({'sqlCode':_0x25fcf1[_0x31ff2e(0x150)],'sqlName':_0x25fcf1[_0x31ff2e(0x152)],'dbId':_0x25fcf1[_0x31ff2e(0x141)]},ensureRemoteSqlContent(_0x25fcf1),{'dbName':_0x10f32c,'mode':_0xca8ce5,'syncedAt':new Date()[_0x31ff2e(0x13e)](),'description':_0x25fcf1['description']}),_0x2a75ec=resolveLocalSqlFilePath(_0x22c0a8,_0x25fcf1[_0x31ff2e(0x150)],buildSqlLockEntry(_0x25fcf1,ensureRemoteSqlContent(_0x25fcf1),'',{'dbName':_0x10f32c}));if(await fileExists(_0x2a75ec)){const _0x47614f=await readFile(_0x2a75ec,_0x31ff2e(0x148));if(!isEquivalentPulledSqlFile(_0x47614f,_0x38ff07,_0xca8ce5)){_0x560087=!![];break;}}}if(_0x560087){const _0x36d234=await confirmForceOverwrite(_0x31ff2e(0x131));if(!_0x36d234)throw CliErrors[_0x31ff2e(0x12e)](_0x31ff2e(0x158));}}const _0x2a1a0b=cloneSqlLockData(_0x4ada0b),_0x309dd4=_0x2a1a0b['apps'][_0x22c0a8[_0x31ff2e(0x166)]],_0x1b93fe=[],_0x54cd37=[];for(const _0x5e3f0d of _0x342fa6){const _0xd09e7d=_0x309dd4[_0x31ff2e(0x149)][_0x5e3f0d[_0x31ff2e(0x150)]],_0x19eb76=ensureRemoteSqlContent(_0x5e3f0d),_0x203d3c=detectModeFromSql(_0x5e3f0d),_0x2283d9=_0x5e3f0d[_0x31ff2e(0x141)]?await getDbName(_0xef5581['appCode'],Number(_0x5e3f0d[_0x31ff2e(0x141)]))[_0x31ff2e(0x135)](()=>undefined):undefined,_0x5657e0=buildLocalSqlFileContent({'sqlCode':_0x5e3f0d[_0x31ff2e(0x150)],'sqlName':_0x5e3f0d[_0x31ff2e(0x152)],'dbId':_0x5e3f0d[_0x31ff2e(0x141)]},_0x19eb76,{'dbName':_0x2283d9,'mode':_0x203d3c,'syncedAt':new Date()[_0x31ff2e(0x13e)](),'description':_0x5e3f0d[_0x31ff2e(0x144)]}),_0x56702b=buildSqlLockEntry(_0x5e3f0d,_0x19eb76,computeSqlContentHash(_0x5657e0),{'dbName':_0x2283d9}),_0x58497a=_0x56702b[_0x31ff2e(0x14c)],_0x4f38b2=join(_0x22c0a8['sqlRootDir'],_0x58497a);try{if(await fileExists(_0x4f38b2)){const _0x52b990=await readFile(_0x4f38b2,'utf8');if(isEquivalentPulledSqlFile(_0x52b990,_0x5657e0,_0x203d3c)){_0x54cd37[_0x31ff2e(0x13b)]({'sqlCode':_0x5e3f0d[_0x31ff2e(0x150)],'reason':_0x31ff2e(0x13c)}),_0x309dd4[_0x31ff2e(0x149)][_0x5e3f0d['sqlCode']]={..._0x56702b,'hash':computeSqlContentHash(_0x52b990),'path':_0x58497a};continue;}if(!_0xfab3f9){_0x54cd37[_0x31ff2e(0x13b)]({'sqlCode':_0x5e3f0d['sqlCode'],'reason':_0x31ff2e(0x143)});continue;}}const _0x75a01=_0xd09e7d?.[_0x31ff2e(0x14c)]?join(_0x22c0a8[_0x31ff2e(0x167)],_0xd09e7d['path']):undefined;_0x75a01&&_0x75a01!==_0x4f38b2&&await fileExists(_0x75a01)&&await rm(_0x75a01,{'force':!![]}),await ensureParentDirectory(_0x4f38b2),await writeFile(_0x4f38b2,_0x5657e0,_0x31ff2e(0x148)),_0x309dd4[_0x31ff2e(0x149)][_0x5e3f0d['sqlCode']]={..._0x56702b,'path':_0x58497a},_0x1b93fe[_0x31ff2e(0x13b)]({'sqlCode':_0x5e3f0d[_0x31ff2e(0x150)],'filePath':_0x4f38b2});}catch(_0x2a5b5f){_0xc7d9a2['push']({'sqlCode':_0x5e3f0d[_0x31ff2e(0x150)],'error':_0x2a5b5f instanceof Error?_0x2a5b5f[_0x31ff2e(0x153)]:String(_0x2a5b5f)});}}return _0x309dd4[_0x31ff2e(0x154)]=new Date()[_0x31ff2e(0x13e)](),await writeSqlLockFile(_0x22c0a8[_0x31ff2e(0x15a)],_0x2a1a0b),{'ok':_0xc7d9a2['length']===0x0,'data':{'pulled':_0x1b93fe,'skipped':_0x54cd37,'failed':_0xc7d9a2},'message':_0x31ff2e(0x136)+_0x1b93fe[_0x31ff2e(0x15e)]+_0x31ff2e(0x14e)+_0x54cd37['length']+_0x31ff2e(0x163)+_0xc7d9a2[_0x31ff2e(0x15e)]+_0x31ff2e(0x161)};}};function detectModeFromSql(_0x591e79){const _0x3b2cc1=a122_0xe25332,_0x4a1b12=ensureRemoteSqlContent(_0x591e79),_0x3f7693=stripLocalSqlMetadata(_0x4a1b12,_0x3b2cc1(0x147))[_0x3b2cc1(0x12d)]();if(/^<(select|insert|update|delete)\b/i[_0x3b2cc1(0x12c)](_0x3f7693))return _0x3b2cc1(0x147);return _0x3b2cc1(0x139);}function isEquivalentPulledSqlFile(_0x5aa7b6,_0x4af99e,_0x120978){return normalizePullComparableContent(_0x5aa7b6,_0x120978)===normalizePullComparableContent(_0x4af99e,_0x120978);}function normalizePullComparableContent(_0x5e5bb5,_0x55b3bf){const _0x1b829b=a122_0xe25332,_0xb59673=_0x5e5bb5[_0x1b829b(0x146)](/\r\n/g,'\x0a')[_0x1b829b(0x160)]('\x0a'),_0x5dc6f3=_0xb59673['filter'](_0x528887=>!isSyncedAtMetadataLine(_0x528887,_0x55b3bf));return _0x5dc6f3['join']('\x0a');}function isSyncedAtMetadataLine(_0x2de522,_0x48872b){const _0x2415dc=a122_0xe25332;if(_0x48872b==='mybatisXml')return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x2415dc(0x12c)](_0x2de522);return/^\s*--\s*@lovrabet\.syncedAt:/['test'](_0x2de522);}
1
+ const a122_0x743f62=a122_0x54bc;(function(_0x1857a,_0x428523){const _0x467aba=a122_0x54bc,_0x2411f1=_0x1857a();while(!![]){try{const _0x1025cf=-parseInt(_0x467aba(0x7b))/0x1+parseInt(_0x467aba(0x7d))/0x2+parseInt(_0x467aba(0x80))/0x3+-parseInt(_0x467aba(0xa6))/0x4*(-parseInt(_0x467aba(0x94))/0x5)+parseInt(_0x467aba(0xaa))/0x6*(-parseInt(_0x467aba(0x96))/0x7)+-parseInt(_0x467aba(0x77))/0x8+parseInt(_0x467aba(0x87))/0x9*(parseInt(_0x467aba(0x9c))/0xa);if(_0x1025cf===_0x428523)break;else _0x2411f1['push'](_0x2411f1['shift']());}catch(_0x147396){_0x2411f1['push'](_0x2411f1['shift']());}}}(a122_0x281c,0x2fa44));import{readFile,rm,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryDetail,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a122_0x281c(){const _0x1fdd4f=['trimStart','12cERqmH','path','paging','name','\x20written,\x20','length','unchanged','str','2252168NugzCl','message','sqlcode','utf8','228763aPqaZu','nonInteractive','438432lyPVDH','sqls','Force\x20overwrite\x20local\x20unsynced\x20changes','517935nfMzSb','sqlRootDir','description','sqlCode','test','cancelled','mybatisXml','1287xIMWCu','sqlRoot','sqlName','write','apps','Would\x20pull\x20','filter','appCode','\x20skipped,\x20','No\x20remote\x20SQL\x20queries\x20matched.','bool','/smartapi/custom/queryUserCustomSqlList\x20+\x20/smartapi/custom/getUserCustomSql','Force\x20pull\x20cancelled.','14410QFuKPs','catch','197477hrcTfK','sql','force','Pull\x20remote\x20SQL\x20queries\x20to\x20local\x20.rabetbase/sql/','boolean','lockFilePath','14990YqLZCp','pull','skipped','tableData','\x20SQL\x20file(s)\x20into\x20','push','join','toISOString','dbId','totalCount','216oCtvzG','sqlContent','Filter\x20by\x20SQL\x20display\x20name'];a122_0x281c=function(){return _0x1fdd4f;};return a122_0x281c();}import{getDbName}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildLocalSqlFileContent,buildSqlLockEntry,cloneSqlLockData,confirmForceOverwrite,ensureRemoteSqlContent,stripLocalSqlMetadata}from'./shared.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x382059,_0xc7dc35){const _0x349bb8=a122_0x54bc,_0x4d4787=[];let _0x4508d7=0x1;while(!![]){const _0x3180ee=await listSqlQueries(_0x382059,{'currentPage':_0x4508d7,'pageSize':PAGE_SIZE,'sqlCode':_0xc7dc35['sqlCode'],'sqlName':_0xc7dc35[_0x349bb8(0x89)]}),_0x5bf441=_0x3180ee[_0x349bb8(0x9f)]??[];_0x4d4787[_0x349bb8(0xa1)](..._0x5bf441);if(_0x5bf441[_0x349bb8(0x74)]===0x0)break;const _0x4b83cc=_0x3180ee[_0x349bb8(0xac)]?.[_0x349bb8(0xa5)];if(_0x4b83cc!=null?_0x4d4787[_0x349bb8(0x74)]>=_0x4b83cc:_0x5bf441['length']<PAGE_SIZE)break;_0x4508d7++;}return _0x4d4787;}async function ensureSqlContent(_0x1b309d){const _0x260151=a122_0x54bc;if(_0x1b309d[_0x260151(0xa7)]!=null&&String(_0x1b309d[_0x260151(0xa7)])[_0x260151(0x74)]>0x0)return _0x1b309d;return getSqlQueryDetail(_0x1b309d[_0x260151(0x83)]);}export const sqlPull={'service':a122_0x743f62(0x97),'command':a122_0x743f62(0x9d),'description':a122_0x743f62(0x99),'risk':a122_0x743f62(0x8a),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a122_0x743f62(0x72),'type':'string','description':a122_0x743f62(0xa8)},{'name':a122_0x743f62(0x98),'type':a122_0x743f62(0x9a),'description':a122_0x743f62(0x7f)}],async 'dryRun'(_0x307fd9){const _0x196a65=a122_0x743f62,_0x35f580=loadSqlProjectConfig(_0x307fd9[_0x196a65(0x8e)]),_0x43c78c=await readSqlLockFile(_0x35f580[_0x196a65(0x9b)]),{appLock:_0x251d06}=ensureSqlLockScope(_0x43c78c??createEmptySqlLock(),_0x35f580['appCode'],_0x35f580[_0x196a65(0x88)],_0x196a65(0x9d)),_0x45b081=await fetchAllSqlQueries(_0x307fd9[_0x196a65(0x8e)],{'sqlCode':_0x307fd9['str'](_0x196a65(0x79))||undefined,'sqlName':_0x307fd9['str'](_0x196a65(0x72))||undefined}),_0x47ea84=[];for(const _0x35711b of _0x45b081){const _0x14fe06=await ensureSqlContent(_0x35711b),_0x50dc9b=ensureRemoteSqlContent(_0x14fe06),_0x2b1861=detectModeFromSql(_0x14fe06),_0x32beef=_0x14fe06[_0x196a65(0xa4)]?await getDbName(_0x307fd9[_0x196a65(0x8e)],Number(_0x14fe06[_0x196a65(0xa4)]))[_0x196a65(0x95)](()=>undefined):undefined,_0x2afc82=buildLocalSqlFileContent({'sqlCode':_0x14fe06['sqlCode'],'sqlName':_0x14fe06['sqlName'],'dbId':_0x14fe06[_0x196a65(0xa4)]},_0x50dc9b,{'dbName':_0x32beef,'mode':_0x2b1861,'syncedAt':new Date()['toISOString'](),'description':_0x14fe06['description']}),_0x398574=buildSqlLockEntry(_0x14fe06,_0x50dc9b,'',{'dbName':_0x32beef}),_0x256f82=resolveLocalSqlFilePath(_0x35f580,_0x14fe06[_0x196a65(0x83)],_0x398574);let _0x4a8e66='would_pull',_0x5bea69;if(await fileExists(_0x256f82)){const _0x331b4d=await readFile(_0x256f82,_0x196a65(0x7a));isEquivalentPulledSqlFile(_0x331b4d,_0x2afc82,_0x2b1861)?(_0x4a8e66=_0x196a65(0x9e),_0x5bea69=_0x196a65(0x75)):(_0x4a8e66='conflict',_0x5bea69='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x47ea84[_0x196a65(0xa1)]({'sqlCode':_0x14fe06['sqlCode'],'sqlName':_0x14fe06['sqlName'],'filePath':_0x256f82,'status':_0x4a8e66,'reason':_0x5bea69});}return{'method':'POST','url':_0x196a65(0x92),'body':{'appCode':_0x307fd9['appCode'],'sqlCode':_0x307fd9['str'](_0x196a65(0x79))||null,'sqlName':_0x307fd9[_0x196a65(0x76)](_0x196a65(0x72))||null,'files':_0x47ea84},'description':_0x196a65(0x8c)+_0x47ea84[_0x196a65(0x74)]+_0x196a65(0xa0)+_0x35f580[_0x196a65(0x81)]};},async 'execute'(_0x5ca4c2){const _0x471939=a122_0x743f62,_0x5d0a08=loadSqlProjectConfig(_0x5ca4c2[_0x471939(0x8e)]),_0x36ad08=await readSqlLockFile(_0x5d0a08['lockFilePath']),{lockData:_0x5f0be1,appLock:_0x4a241d}=ensureSqlLockScope(_0x36ad08??createEmptySqlLock(),_0x5d0a08[_0x471939(0x8e)],_0x5d0a08[_0x471939(0x88)],_0x471939(0x9d)),_0x2cfa5b=_0x5ca4c2[_0x471939(0x91)]('force'),_0x4fd28e=await fetchAllSqlQueries(_0x5ca4c2[_0x471939(0x8e)],{'sqlCode':_0x5ca4c2['str'](_0x471939(0x79))||undefined,'sqlName':_0x5ca4c2['str'](_0x471939(0x72))||undefined});if(_0x4fd28e['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x471939(0x90)};const _0x142eb0=[],_0x43f40a=[];for(const _0x4879bd of _0x4fd28e){try{_0x142eb0[_0x471939(0xa1)](await ensureSqlContent(_0x4879bd));}catch(_0x231c12){_0x43f40a[_0x471939(0xa1)]({'sqlCode':_0x4879bd[_0x471939(0x83)],'error':_0x231c12 instanceof Error?_0x231c12[_0x471939(0x78)]:String(_0x231c12)});}}if(_0x2cfa5b&&!_0x5ca4c2[_0x471939(0x7c)]){let _0x5bc2b5=![];for(const _0x58b78e of _0x142eb0){const _0x388d16=detectModeFromSql(_0x58b78e),_0x58bd9d=_0x58b78e[_0x471939(0xa4)]?await getDbName(_0x5ca4c2[_0x471939(0x8e)],Number(_0x58b78e['dbId']))[_0x471939(0x95)](()=>undefined):undefined,_0x546209=buildLocalSqlFileContent({'sqlCode':_0x58b78e[_0x471939(0x83)],'sqlName':_0x58b78e[_0x471939(0x89)],'dbId':_0x58b78e[_0x471939(0xa4)]},ensureRemoteSqlContent(_0x58b78e),{'dbName':_0x58bd9d,'mode':_0x388d16,'syncedAt':new Date()[_0x471939(0xa3)](),'description':_0x58b78e[_0x471939(0x82)]}),_0x2e8e81=resolveLocalSqlFilePath(_0x5d0a08,_0x58b78e[_0x471939(0x83)],buildSqlLockEntry(_0x58b78e,ensureRemoteSqlContent(_0x58b78e),'',{'dbName':_0x58bd9d}));if(await fileExists(_0x2e8e81)){const _0x216420=await readFile(_0x2e8e81,'utf8');if(!isEquivalentPulledSqlFile(_0x216420,_0x546209,_0x388d16)){_0x5bc2b5=!![];break;}}}if(_0x5bc2b5){const _0x172c69=await confirmForceOverwrite('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.');if(!_0x172c69)throw CliErrors[_0x471939(0x85)](_0x471939(0x93));}}const _0x28a555=cloneSqlLockData(_0x5f0be1),_0x539417=_0x28a555[_0x471939(0x8b)][_0x5d0a08[_0x471939(0x8e)]],_0x10ee86=[],_0x240f99=[];for(const _0x3c5721 of _0x142eb0){const _0x168efe=_0x539417[_0x471939(0x7e)][_0x3c5721[_0x471939(0x83)]],_0x2f71df=ensureRemoteSqlContent(_0x3c5721),_0xf3045f=detectModeFromSql(_0x3c5721),_0x270bca=_0x3c5721[_0x471939(0xa4)]?await getDbName(_0x5ca4c2[_0x471939(0x8e)],Number(_0x3c5721['dbId']))[_0x471939(0x95)](()=>undefined):undefined,_0x4c7822=buildLocalSqlFileContent({'sqlCode':_0x3c5721[_0x471939(0x83)],'sqlName':_0x3c5721[_0x471939(0x89)],'dbId':_0x3c5721[_0x471939(0xa4)]},_0x2f71df,{'dbName':_0x270bca,'mode':_0xf3045f,'syncedAt':new Date()[_0x471939(0xa3)](),'description':_0x3c5721[_0x471939(0x82)]}),_0x25775d=buildSqlLockEntry(_0x3c5721,_0x2f71df,computeSqlContentHash(_0x4c7822),{'dbName':_0x270bca}),_0x3985b5=_0x25775d['path'],_0x121804=join(_0x5d0a08[_0x471939(0x81)],_0x3985b5);try{if(await fileExists(_0x121804)){const _0x498f0b=await readFile(_0x121804,_0x471939(0x7a));if(isEquivalentPulledSqlFile(_0x498f0b,_0x4c7822,_0xf3045f)){_0x240f99[_0x471939(0xa1)]({'sqlCode':_0x3c5721[_0x471939(0x83)],'reason':_0x471939(0x75)}),_0x539417[_0x471939(0x7e)][_0x3c5721[_0x471939(0x83)]]={..._0x25775d,'hash':computeSqlContentHash(_0x498f0b),'path':_0x3985b5};continue;}if(!_0x2cfa5b){_0x240f99['push']({'sqlCode':_0x3c5721[_0x471939(0x83)],'reason':'local\x20differs\x20from\x20remote'});continue;}}const _0x2a1fb6=_0x168efe?.[_0x471939(0xab)]?join(_0x5d0a08['sqlRootDir'],_0x168efe[_0x471939(0xab)]):undefined;_0x2a1fb6&&_0x2a1fb6!==_0x121804&&await fileExists(_0x2a1fb6)&&await rm(_0x2a1fb6,{'force':!![]}),await ensureParentDirectory(_0x121804),await writeFile(_0x121804,_0x4c7822,_0x471939(0x7a)),_0x539417[_0x471939(0x7e)][_0x3c5721[_0x471939(0x83)]]={..._0x25775d,'path':_0x3985b5},_0x10ee86[_0x471939(0xa1)]({'sqlCode':_0x3c5721[_0x471939(0x83)],'filePath':_0x121804});}catch(_0x1e6ce0){_0x43f40a[_0x471939(0xa1)]({'sqlCode':_0x3c5721['sqlCode'],'error':_0x1e6ce0 instanceof Error?_0x1e6ce0[_0x471939(0x78)]:String(_0x1e6ce0)});}}return _0x539417['lastSync']=new Date()['toISOString'](),await writeSqlLockFile(_0x5d0a08[_0x471939(0x9b)],_0x28a555),{'ok':_0x43f40a[_0x471939(0x74)]===0x0,'data':{'pulled':_0x10ee86,'skipped':_0x240f99,'failed':_0x43f40a},'message':'Pull\x20complete:\x20'+_0x10ee86[_0x471939(0x74)]+_0x471939(0x73)+_0x240f99[_0x471939(0x74)]+_0x471939(0x8f)+_0x43f40a['length']+'\x20failed'};}};function a122_0x54bc(_0x5d56f0,_0x3cfaa5){_0x5d56f0=_0x5d56f0-0x72;const _0x281c58=a122_0x281c();let _0x54bcba=_0x281c58[_0x5d56f0];return _0x54bcba;}function detectModeFromSql(_0x44d64e){const _0x2ed98c=a122_0x743f62,_0x292e0c=ensureRemoteSqlContent(_0x44d64e),_0x1944a9=stripLocalSqlMetadata(_0x292e0c,_0x2ed98c(0x86))[_0x2ed98c(0xa9)]();if(/^<(select|insert|update|delete)\b/i[_0x2ed98c(0x84)](_0x1944a9))return _0x2ed98c(0x86);return _0x2ed98c(0x97);}function isEquivalentPulledSqlFile(_0xd920fe,_0x2849f1,_0x4dc175){return normalizePullComparableContent(_0xd920fe,_0x4dc175)===normalizePullComparableContent(_0x2849f1,_0x4dc175);}function normalizePullComparableContent(_0x15da1d,_0x39f2f1){const _0x5b7fa2=a122_0x743f62,_0x2cd687=_0x15da1d['replace'](/\r\n/g,'\x0a')['split']('\x0a'),_0x1c91f0=_0x2cd687[_0x5b7fa2(0x8d)](_0x3ebb64=>!isSyncedAtMetadataLine(_0x3ebb64,_0x39f2f1));return _0x1c91f0[_0x5b7fa2(0xa2)]('\x0a');}function isSyncedAtMetadataLine(_0x47a7f7,_0x49628c){const _0x259cd6=a122_0x743f62;if(_0x49628c===_0x259cd6(0x86))return/^\s*<!--\s*@lovrabet\.syncedAt:/[_0x259cd6(0x84)](_0x47a7f7);return/^\s*--\s*@lovrabet\.syncedAt:/[_0x259cd6(0x84)](_0x47a7f7);}
@@ -1 +1 @@
1
- const a123_0x2881db=a123_0x55e1;(function(_0x587683,_0x55ed6a){const _0xe96c99=a123_0x55e1,_0x264bbe=_0x587683();while(!![]){try{const _0x580e37=parseInt(_0xe96c99(0x179))/0x1+-parseInt(_0xe96c99(0x181))/0x2*(-parseInt(_0xe96c99(0x16e))/0x3)+-parseInt(_0xe96c99(0x18c))/0x4+parseInt(_0xe96c99(0x171))/0x5+parseInt(_0xe96c99(0x159))/0x6*(parseInt(_0xe96c99(0x18a))/0x7)+-parseInt(_0xe96c99(0x185))/0x8*(-parseInt(_0xe96c99(0x164))/0x9)+parseInt(_0xe96c99(0x16c))/0xa*(-parseInt(_0xe96c99(0x18f))/0xb);if(_0x580e37===_0x55ed6a)break;else _0x264bbe['push'](_0x264bbe['shift']());}catch(_0x524290){_0x264bbe['push'](_0x264bbe['shift']());}}}(a123_0x3046,0xa3060));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a123_0x3046(){const _0x3bc32b=['sqlCode','23859fZyUKs','startsWith','exec','sqlName','dbDirectory','\x20failed','\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20','sqlRootDir','sql','1165170IzSooZ','validation','local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first','sqlcode','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','str','Local\x20directory\x20\x22','Push\x20complete:\x20','trashDir','No\x20local\x20SQL\x20files\x20found.','filter','14481mKNnYy','boolean','Local\x20SQL\x20not\x20found:\x20','/smartapi/custom/updateUserCustomSql','filePath','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','message','sqlRoot','10420CwzMZZ','join','24iEAyWa','remoteId','POST','3923205AiAKbO','mode','dbId','sqls','replace','isFinite','has','projectRoot','182280ubCPZP','length','path','push','\x22\x20for\x20sqlCode\x20','utf8','version','catch','210228YDuUQR','toISOString','force','appCode','3024mRWWWR','high-risk-write','lockFilePath','relativePath','hash','28rqVziY','dbName','1059892SieZMj','bool'];a123_0x3046=function(){return _0x3bc32b;};return a123_0x3046();}import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x7b2e56,_0x5823ef,_0x5a31b0){const _0xcc40e6=a123_0x55e1,_0x428657=await scanLocalSqlQueries(_0x7b2e56),_0x12c073=new Map();for(const _0x522158 of _0x428657){if(_0x5a31b0&&_0x522158[_0xcc40e6(0x18e)]!==_0x5a31b0)continue;const _0x173468=_0x12c073['get'](_0x522158[_0xcc40e6(0x18e)])??[];_0x173468[_0xcc40e6(0x17c)](_0x522158),_0x12c073['set'](_0x522158['sqlCode'],_0x173468);}if(_0x5a31b0&&!_0x12c073[_0xcc40e6(0x177)](_0x5a31b0))throw CliErrors[_0xcc40e6(0x15a)](_0xcc40e6(0x166)+_0x5a31b0);const _0x2eeaef=[];for(const [_0x813213,_0x9740d6]of _0x12c073['entries']()){if(_0x9740d6[_0xcc40e6(0x17a)]===0x1){_0x2eeaef[_0xcc40e6(0x17c)](_0x9740d6[0x0]);continue;}const _0x37dd4c=_0x5823ef['sqls'][_0x813213],_0x2c7904=_0x37dd4c?.[_0xcc40e6(0x17b)],_0xaac98c=_0x2c7904?_0x9740d6['filter'](_0x3ac813=>_0x3ac813['relativePath']!==_0x2c7904):_0x9740d6;if(_0x37dd4c&&_0xaac98c[_0xcc40e6(0x17a)]===0x1){_0x2eeaef['push'](_0xaac98c[0x0]);continue;}throw CliErrors[_0xcc40e6(0x15a)](_0xcc40e6(0x169)+_0x813213+_0xcc40e6(0x15d));}return _0x2eeaef;}export const sqlPush={'service':a123_0x2881db(0x158),'command':a123_0x2881db(0x17c),'description':'Push\x20local\x20SQL\x20files\x20to\x20remote','risk':a123_0x2881db(0x186),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'force','type':a123_0x2881db(0x165),'description':'Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock'}],async 'dryRun'(_0xbe969c){const _0x58e5a8=a123_0x2881db,_0x22b342=loadSqlProjectConfig(_0xbe969c[_0x58e5a8(0x184)]),_0x97cd66=await readSqlLockFile(_0x22b342[_0x58e5a8(0x187)]),{appLock:_0x3b154c}=ensureSqlLockScope(_0x97cd66??createEmptySqlLock(),_0xbe969c[_0x58e5a8(0x184)],_0x22b342[_0x58e5a8(0x16b)],_0x58e5a8(0x17c)),_0x2920ac=await getTargetSqlQueries(_0x22b342,_0x3b154c,_0xbe969c[_0x58e5a8(0x15e)](_0x58e5a8(0x15c))||undefined),_0x405ba9=[];for(const _0x1be9a2 of _0x2920ac){const _0x328f1d=await computeSqlFileHash(_0x1be9a2[_0x58e5a8(0x168)]),_0x331c45=_0x3b154c['sqls'][_0x1be9a2[_0x58e5a8(0x18e)]],_0x1f4ca9=!!_0x331c45&&(_0x331c45[_0x58e5a8(0x17b)]!==_0x1be9a2[_0x58e5a8(0x188)]||!!_0x1be9a2[_0x58e5a8(0x192)]&&_0x331c45[_0x58e5a8(0x192)]!==_0x1be9a2[_0x58e5a8(0x192)]);if(!_0xbe969c['bool'](_0x58e5a8(0x183))&&_0x331c45&&_0x331c45[_0x58e5a8(0x189)]===_0x328f1d&&!_0x1f4ca9)continue;_0x405ba9[_0x58e5a8(0x17c)](_0x1be9a2[_0x58e5a8(0x18e)]);}return{'method':_0x58e5a8(0x170),'url':_0x58e5a8(0x167),'body':{'sqlCodes':_0x405ba9,'appCode':_0xbe969c[_0x58e5a8(0x184)]},'description':'Would\x20push\x20'+_0x405ba9[_0x58e5a8(0x17a)]+'\x20SQL\x20file(s)'};},async 'execute'(_0x2e486f){const _0x423fec=a123_0x2881db,_0x2092db=loadSqlProjectConfig(_0x2e486f[_0x423fec(0x184)]),_0x14d0da=await readSqlLockFile(_0x2092db['lockFilePath']),{lockData:_0x74c6c7,appLock:_0x4c935b}=ensureSqlLockScope(_0x14d0da??createEmptySqlLock(),_0x2e486f[_0x423fec(0x184)],_0x2092db[_0x423fec(0x16b)],_0x423fec(0x17c)),_0xe6f1f9=await getTargetSqlQueries(_0x2092db,_0x4c935b,_0x2e486f['str'](_0x423fec(0x15c))||undefined);if(_0xe6f1f9[_0x423fec(0x17a)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':_0x423fec(0x162)};const _0x2fb438=[],_0x3fa6c6=[],_0x16ed89=[];for(const _0x32dfd4 of _0xe6f1f9){const _0x4a964d=_0x4c935b[_0x423fec(0x174)][_0x32dfd4[_0x423fec(0x18e)]];if(!_0x4a964d){_0x16ed89['push']({'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'error':_0x423fec(0x15b)});continue;}try{const _0x16c1f9=await computeSqlFileHash(_0x32dfd4[_0x423fec(0x168)]),_0x58dd37=_0x4a964d[_0x423fec(0x17b)]!==_0x32dfd4[_0x423fec(0x188)]||!!_0x32dfd4[_0x423fec(0x192)]&&_0x4a964d[_0x423fec(0x192)]!==_0x32dfd4[_0x423fec(0x192)];if(!_0x2e486f[_0x423fec(0x18d)](_0x423fec(0x183))&&_0x4a964d[_0x423fec(0x189)]===_0x16c1f9&&!_0x58dd37){_0x3fa6c6[_0x423fec(0x17c)]({'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'reason':'unchanged'});continue;}if(_0x4a964d[_0x423fec(0x17f)]==null){_0x16ed89[_0x423fec(0x17c)]({'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'error':'missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first'});continue;}const _0x47b767=await readFile(_0x32dfd4[_0x423fec(0x168)],_0x423fec(0x17e)),_0xb377b0=stripLocalSqlMetadata(_0x47b767,_0x32dfd4[_0x423fec(0x172)]),_0x483cf1=_0x32dfd4['sqlName']||_0x4a964d[_0x423fec(0x192)],_0x3521f4=await resolveTargetDbBinding(_0x2e486f['appCode'],_0x32dfd4,_0x4a964d),_0x115e65=await updateSqlQuery({'id':_0x4a964d[_0x423fec(0x16f)],'appCode':_0x2e486f[_0x423fec(0x184)],'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'sqlName':_0x483cf1,'dbId':_0x3521f4[_0x423fec(0x173)],'version':_0x4a964d[_0x423fec(0x17f)],'sqlContent':_0xb377b0,'sqlConfig':_0x4a964d['sqlConfig']??undefined}),_0x549e61=_0x115e65[_0x423fec(0x173)]?await getDbName(_0x2e486f[_0x423fec(0x184)],Number(_0x115e65[_0x423fec(0x173)]))[_0x423fec(0x180)](()=>_0x3521f4['dbName']):_0x3521f4[_0x423fec(0x18b)];_0x4c935b['sqls'][_0x32dfd4[_0x423fec(0x18e)]]={...buildSqlLockEntry(_0x115e65,_0xb377b0,_0x16c1f9,{'dbName':_0x549e61}),'path':_0x32dfd4[_0x423fec(0x188)],'mode':_0x4a964d[_0x423fec(0x172)]},await archivePreviousSqlFileIfNeeded(_0x2092db,_0x4a964d[_0x423fec(0x17b)],_0x32dfd4[_0x423fec(0x188)]),_0x2fb438['push']({'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'remoteId':_0x4a964d[_0x423fec(0x16f)]});}catch(_0x4e5217){_0x16ed89[_0x423fec(0x17c)]({'sqlCode':_0x32dfd4[_0x423fec(0x18e)],'error':_0x4e5217 instanceof Error?_0x4e5217[_0x423fec(0x16a)]:String(_0x4e5217)});}}return _0x4c935b['lastSync']=new Date()[_0x423fec(0x182)](),await writeSqlLockFile(_0x2092db[_0x423fec(0x187)],_0x74c6c7),{'ok':_0x16ed89[_0x423fec(0x17a)]===0x0,'data':{'pushed':_0x2fb438,'skipped':_0x3fa6c6,'failed':_0x16ed89},'message':_0x423fec(0x160)+_0x2fb438[_0x423fec(0x17a)]+'\x20pushed,\x20'+_0x3fa6c6[_0x423fec(0x17a)]+'\x20skipped,\x20'+_0x16ed89[_0x423fec(0x17a)]+_0x423fec(0x155)};}};async function archivePreviousSqlFileIfNeeded(_0x1b80a2,_0xb51f74,_0xd4bd6f){const _0x46f312=a123_0x2881db;if(!_0xb51f74||_0xb51f74===_0xd4bd6f)return;const _0x4ba8a8=join(_0x1b80a2[_0x46f312(0x157)],_0xb51f74);if(!await fileExists(_0x4ba8a8))return;const _0x3897b0=await moveToTrash(_0x1b80a2[_0x46f312(0x178)],_0x1b80a2[_0x46f312(0x161)],_0x4ba8a8);await cleanupEmptyDirectories(dirname(_0x4ba8a8),_0x1b80a2[_0x46f312(0x157)]),void _0x3897b0;}function a123_0x55e1(_0x58f600,_0x22e3f0){_0x58f600=_0x58f600-0x155;const _0x3046df=a123_0x3046();let _0x55e1c7=_0x3046df[_0x58f600];return _0x55e1c7;}async function moveToTrash(_0x586320,_0x1655e1,_0x5d5192){const _0x58d00c=a123_0x2881db,_0x4cff51=new Date()[_0x58d00c(0x182)]()[_0x58d00c(0x175)](/[:.]/g,'-'),_0x4e8134=relative(_0x586320,_0x5d5192),_0x569de9=join(_0x1655e1,_0x4cff51,_0x4e8134);return await mkdir(dirname(_0x569de9),{'recursive':!![]}),await rename(_0x5d5192,_0x569de9),_0x569de9;}async function cleanupEmptyDirectories(_0x36384c,_0x357985){const _0x5ec1a9=a123_0x2881db;let _0x6df9b2=resolve(_0x36384c);const _0x499491=resolve(_0x357985);while(_0x6df9b2[_0x5ec1a9(0x190)](''+_0x499491+sep)||_0x6df9b2===_0x499491){if(_0x6df9b2===_0x499491)return;try{const _0x4c2f61=await readdir(_0x6df9b2);if(_0x4c2f61['length']>0x0)return;await rmdir(_0x6df9b2);}catch{return;}_0x6df9b2=dirname(_0x6df9b2);}}async function resolveTargetDbBinding(_0x5e1431,_0x4e0086,_0x2946ce){const _0x5c40ff=a123_0x2881db,_0x54bfe0=_0x4e0086[_0x5c40ff(0x193)];if(!_0x54bfe0)return{'dbId':_0x2946ce[_0x5c40ff(0x173)],'dbName':_0x2946ce[_0x5c40ff(0x18b)]};const _0x2aec10=buildDbDirectoryName(_0x2946ce['dbName'],_0x2946ce['dbId']);if(_0x54bfe0===_0x2aec10)return{'dbId':_0x2946ce[_0x5c40ff(0x173)],'dbName':_0x2946ce['dbName']};const _0x435e9b=parseExplicitDbDirectory(_0x54bfe0);if(_0x435e9b!=null)return{'dbId':_0x435e9b,'dbName':await getDbName(_0x5e1431,_0x435e9b)[_0x5c40ff(0x180)](()=>undefined)};const _0x359510=await listDatabases(_0x5e1431),_0x5be1a2=_0x359510[_0x5c40ff(0x163)](_0x34f825=>buildDbDirectoryName(_0x34f825[_0x5c40ff(0x18b)],_0x34f825[_0x5c40ff(0x173)])===_0x54bfe0);if(_0x5be1a2[_0x5c40ff(0x17a)]===0x1)return{'dbId':_0x5be1a2[0x0]['dbId'],'dbName':_0x5be1a2[0x0][_0x5c40ff(0x18b)]};if(_0x5be1a2[_0x5c40ff(0x17a)]===0x0)throw CliErrors[_0x5c40ff(0x15a)]('No\x20database\x20matches\x20local\x20directory\x20\x22'+_0x54bfe0+_0x5c40ff(0x17d)+_0x4e0086['sqlCode']+'.');const _0x17f3e8=_0x5be1a2['map'](_0x4f0c38=>_0x4f0c38[_0x5c40ff(0x18b)]+'\x20('+_0x4f0c38[_0x5c40ff(0x173)]+')')[_0x5c40ff(0x16d)](',\x20');throw CliErrors[_0x5c40ff(0x15a)](_0x5c40ff(0x15f)+_0x54bfe0+_0x5c40ff(0x156)+_0x4e0086['sqlCode']+':\x20'+_0x17f3e8);}function parseExplicitDbDirectory(_0x185634){const _0x48e0bd=a123_0x2881db,_0x2bb3bb=/^db-(\d+)$/[_0x48e0bd(0x191)](_0x185634);if(!_0x2bb3bb)return null;const _0x1d292e=Number(_0x2bb3bb[0x1]);return Number[_0x48e0bd(0x176)](_0x1d292e)&&_0x1d292e>0x0?_0x1d292e:null;}
1
+ const a123_0x184a25=a123_0x1d2e;function a123_0x25ed(){const _0x57e726=['boolean','toISOString','\x20SQL\x20file(s)','Force\x20push\x20even\x20if\x20local\x20hash\x20matches\x20lock','lockFilePath','650545mFFpfX','Would\x20push\x20','missing\x20remote\x20version;\x20run\x20`rabetbase\x20sql\x20pull`\x20to\x20refresh\x20version\x20info\x20first','Local\x20SQL\x20not\x20found:\x20','2NwkbYT','8CgKHMe','1050300OupRCu','83937LpnXnn','length','force','4775397NqdjNA','hash','filePath','unchanged','\x22\x20for\x20sqlCode\x20','lastSync','sqlCode','high-risk-write','appCode','Local\x20directory\x20\x22','.\x20Keep\x20only\x20one\x20file\x20under\x20its\x20sqlCode\x20directory\x20before\x20pushing.','has','376xKsblm','Multiple\x20local\x20SQL\x20files\x20found\x20for\x20sqlCode\x20','\x20pushed,\x20','sqlConfig','Push\x20complete:\x20','No\x20database\x20matches\x20local\x20directory\x20\x22','324023GZajKC','2565576BZfWhc','\x20skipped,\x20','join','Push\x20local\x20SQL\x20files\x20to\x20remote','push','10PGCidH','dbDirectory','filter','sqls','isFinite','dbName','4296843LWKbGO','path','exec','version','catch','relativePath','mode','remoteId','dbId','trashDir','sqlRootDir','projectRoot','bool','replace','entries','sqlName','sqlRoot','utf8','message','validation','sqlcode'];a123_0x25ed=function(){return _0x57e726;};return a123_0x25ed();}(function(_0x51f6a4,_0xc82e6c){const _0x5a4f74=a123_0x1d2e,_0x10e433=_0x51f6a4();while(!![]){try{const _0x45bd96=-parseInt(_0x5a4f74(0x128))/0x1*(-parseInt(_0x5a4f74(0x152))/0x2)+-parseInt(_0x5a4f74(0x154))/0x3+-parseInt(_0x5a4f74(0x153))/0x4*(-parseInt(_0x5a4f74(0x14e))/0x5)+-parseInt(_0x5a4f74(0x129))/0x6+-parseInt(_0x5a4f74(0x155))/0x7*(-parseInt(_0x5a4f74(0x122))/0x8)+-parseInt(_0x5a4f74(0x134))/0x9+parseInt(_0x5a4f74(0x12e))/0xa*(parseInt(_0x5a4f74(0x158))/0xb);if(_0x45bd96===_0xc82e6c)break;else _0x10e433['push'](_0x10e433['shift']());}catch(_0x425c5d){_0x10e433['push'](_0x10e433['shift']());}}}(a123_0x25ed,0x4fca6));import{mkdir,readFile,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{updateSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{fileExists}from'../../core/bff/file-system.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{buildSqlLockEntry,stripLocalSqlMetadata}from'./shared.js';import{buildDbDirectoryName}from'../../core/sql-sync/utils.js';async function getTargetSqlQueries(_0x30caa8,_0xf53df,_0x4346fc){const _0xee5243=a123_0x1d2e,_0x5cfae4=await scanLocalSqlQueries(_0x30caa8),_0x546107=new Map();for(const _0x4029a3 of _0x5cfae4){if(_0x4346fc&&_0x4029a3[_0xee5243(0x11c)]!==_0x4346fc)continue;const _0x47c599=_0x546107['get'](_0x4029a3[_0xee5243(0x11c)])??[];_0x47c599[_0xee5243(0x12d)](_0x4029a3),_0x546107['set'](_0x4029a3['sqlCode'],_0x47c599);}if(_0x4346fc&&!_0x546107[_0xee5243(0x121)](_0x4346fc))throw CliErrors[_0xee5243(0x147)](_0xee5243(0x151)+_0x4346fc);const _0x219601=[];for(const [_0x406bee,_0x5bd34b]of _0x546107[_0xee5243(0x142)]()){if(_0x5bd34b[_0xee5243(0x156)]===0x1){_0x219601[_0xee5243(0x12d)](_0x5bd34b[0x0]);continue;}const _0x1b1e08=_0xf53df[_0xee5243(0x131)][_0x406bee],_0x23ef36=_0x1b1e08?.['path'],_0x2ae577=_0x23ef36?_0x5bd34b['filter'](_0x205fa6=>_0x205fa6[_0xee5243(0x139)]!==_0x23ef36):_0x5bd34b;if(_0x1b1e08&&_0x2ae577['length']===0x1){_0x219601[_0xee5243(0x12d)](_0x2ae577[0x0]);continue;}throw CliErrors[_0xee5243(0x147)](_0xee5243(0x123)+_0x406bee+_0xee5243(0x120));}return _0x219601;}function a123_0x1d2e(_0x216e7a,_0x266155){_0x216e7a=_0x216e7a-0x11b;const _0x25edf9=a123_0x25ed();let _0x1d2e10=_0x25edf9[_0x216e7a];return _0x1d2e10;}export const sqlPush={'service':'sql','command':a123_0x184a25(0x12d),'description':a123_0x184a25(0x12c),'risk':a123_0x184a25(0x11d),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a123_0x184a25(0x157),'type':a123_0x184a25(0x149),'description':a123_0x184a25(0x14c)}],async 'dryRun'(_0x2e2ec0){const _0xd4dba0=a123_0x184a25,_0x144bfc=loadSqlProjectConfig(_0x2e2ec0[_0xd4dba0(0x11e)]),_0x5ea1e0=await readSqlLockFile(_0x144bfc['lockFilePath']),{appLock:_0x536780}=ensureSqlLockScope(_0x5ea1e0??createEmptySqlLock(),_0x2e2ec0[_0xd4dba0(0x11e)],_0x144bfc[_0xd4dba0(0x144)],'push'),_0x18a17e=await getTargetSqlQueries(_0x144bfc,_0x536780,_0x2e2ec0['str'](_0xd4dba0(0x148))||undefined),_0x290d66=[];for(const _0x530755 of _0x18a17e){const _0x44d391=await computeSqlFileHash(_0x530755[_0xd4dba0(0x15a)]),_0x24c2bd=_0x536780[_0xd4dba0(0x131)][_0x530755[_0xd4dba0(0x11c)]],_0x9d355f=!!_0x24c2bd&&(_0x24c2bd[_0xd4dba0(0x135)]!==_0x530755[_0xd4dba0(0x139)]||!!_0x530755['sqlName']&&_0x24c2bd['sqlName']!==_0x530755[_0xd4dba0(0x143)]);if(!_0x2e2ec0[_0xd4dba0(0x140)](_0xd4dba0(0x157))&&_0x24c2bd&&_0x24c2bd['hash']===_0x44d391&&!_0x9d355f)continue;_0x290d66[_0xd4dba0(0x12d)](_0x530755['sqlCode']);}return{'method':'POST','url':'/smartapi/custom/updateUserCustomSql','body':{'sqlCodes':_0x290d66,'appCode':_0x2e2ec0[_0xd4dba0(0x11e)]},'description':_0xd4dba0(0x14f)+_0x290d66[_0xd4dba0(0x156)]+_0xd4dba0(0x14b)};},async 'execute'(_0x4e6b71){const _0x294248=a123_0x184a25,_0x525309=loadSqlProjectConfig(_0x4e6b71[_0x294248(0x11e)]),_0x293a4a=await readSqlLockFile(_0x525309[_0x294248(0x14d)]),{lockData:_0x2a0801,appLock:_0x3d621c}=ensureSqlLockScope(_0x293a4a??createEmptySqlLock(),_0x4e6b71[_0x294248(0x11e)],_0x525309[_0x294248(0x144)],'push'),_0x288898=await getTargetSqlQueries(_0x525309,_0x3d621c,_0x4e6b71['str'](_0x294248(0x148))||undefined);if(_0x288898[_0x294248(0x156)]===0x0)return{'ok':!![],'data':{'pushed':[],'skipped':[],'failed':[]},'message':'No\x20local\x20SQL\x20files\x20found.'};const _0x4c3837=[],_0x6ee53f=[],_0x1c5a16=[];for(const _0x4adc8a of _0x288898){const _0x315742=_0x3d621c[_0x294248(0x131)][_0x4adc8a[_0x294248(0x11c)]];if(!_0x315742){_0x1c5a16['push']({'sqlCode':_0x4adc8a[_0x294248(0x11c)],'error':'local\x20SQL\x20is\x20not\x20tracked\x20by\x20sql.lock.json;\x20use\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first'});continue;}try{const _0x1bb621=await computeSqlFileHash(_0x4adc8a[_0x294248(0x15a)]),_0x5c4f3d=_0x315742[_0x294248(0x135)]!==_0x4adc8a[_0x294248(0x139)]||!!_0x4adc8a[_0x294248(0x143)]&&_0x315742['sqlName']!==_0x4adc8a[_0x294248(0x143)];if(!_0x4e6b71['bool'](_0x294248(0x157))&&_0x315742[_0x294248(0x159)]===_0x1bb621&&!_0x5c4f3d){_0x6ee53f[_0x294248(0x12d)]({'sqlCode':_0x4adc8a[_0x294248(0x11c)],'reason':_0x294248(0x15b)});continue;}if(_0x315742['version']==null){_0x1c5a16[_0x294248(0x12d)]({'sqlCode':_0x4adc8a[_0x294248(0x11c)],'error':_0x294248(0x150)});continue;}const _0x13d4f4=await readFile(_0x4adc8a[_0x294248(0x15a)],_0x294248(0x145)),_0x5cbf55=stripLocalSqlMetadata(_0x13d4f4,_0x4adc8a[_0x294248(0x13a)]),_0x3148cf=_0x4adc8a[_0x294248(0x143)]||_0x315742['sqlName'],_0x454b51=await resolveTargetDbBinding(_0x4e6b71[_0x294248(0x11e)],_0x4adc8a,_0x315742),_0x44cd98=await updateSqlQuery({'id':_0x315742['remoteId'],'appCode':_0x4e6b71[_0x294248(0x11e)],'sqlCode':_0x4adc8a[_0x294248(0x11c)],'sqlName':_0x3148cf,'dbId':_0x454b51[_0x294248(0x13c)],'version':_0x315742[_0x294248(0x137)],'sqlContent':_0x5cbf55,'sqlConfig':_0x315742[_0x294248(0x125)]??undefined}),_0x4c0923=_0x44cd98[_0x294248(0x13c)]?await getDbName(_0x4e6b71['appCode'],Number(_0x44cd98[_0x294248(0x13c)]))[_0x294248(0x138)](()=>_0x454b51[_0x294248(0x133)]):_0x454b51['dbName'];_0x3d621c[_0x294248(0x131)][_0x4adc8a[_0x294248(0x11c)]]={...buildSqlLockEntry(_0x44cd98,_0x5cbf55,_0x1bb621,{'dbName':_0x4c0923}),'path':_0x4adc8a['relativePath'],'mode':_0x315742['mode']},await archivePreviousSqlFileIfNeeded(_0x525309,_0x315742[_0x294248(0x135)],_0x4adc8a[_0x294248(0x139)]),_0x4c3837[_0x294248(0x12d)]({'sqlCode':_0x4adc8a[_0x294248(0x11c)],'remoteId':_0x315742[_0x294248(0x13b)]});}catch(_0x25ecc3){_0x1c5a16[_0x294248(0x12d)]({'sqlCode':_0x4adc8a[_0x294248(0x11c)],'error':_0x25ecc3 instanceof Error?_0x25ecc3[_0x294248(0x146)]:String(_0x25ecc3)});}}return _0x3d621c[_0x294248(0x11b)]=new Date()['toISOString'](),await writeSqlLockFile(_0x525309[_0x294248(0x14d)],_0x2a0801),{'ok':_0x1c5a16['length']===0x0,'data':{'pushed':_0x4c3837,'skipped':_0x6ee53f,'failed':_0x1c5a16},'message':_0x294248(0x126)+_0x4c3837[_0x294248(0x156)]+_0x294248(0x124)+_0x6ee53f['length']+_0x294248(0x12a)+_0x1c5a16['length']+'\x20failed'};}};async function archivePreviousSqlFileIfNeeded(_0x109ec5,_0x421596,_0x48841c){const _0x431c14=a123_0x184a25;if(!_0x421596||_0x421596===_0x48841c)return;const _0x4b94a1=join(_0x109ec5[_0x431c14(0x13e)],_0x421596);if(!await fileExists(_0x4b94a1))return;const _0x1a5672=await moveToTrash(_0x109ec5[_0x431c14(0x13f)],_0x109ec5[_0x431c14(0x13d)],_0x4b94a1);await cleanupEmptyDirectories(dirname(_0x4b94a1),_0x109ec5[_0x431c14(0x13e)]),void _0x1a5672;}async function moveToTrash(_0xd8cc3a,_0x5ad9fb,_0x5dea1f){const _0x4b94cc=a123_0x184a25,_0x3cec05=new Date()[_0x4b94cc(0x14a)]()[_0x4b94cc(0x141)](/[:.]/g,'-'),_0x2506e9=relative(_0xd8cc3a,_0x5dea1f),_0x2c5d7b=join(_0x5ad9fb,_0x3cec05,_0x2506e9);return await mkdir(dirname(_0x2c5d7b),{'recursive':!![]}),await rename(_0x5dea1f,_0x2c5d7b),_0x2c5d7b;}async function cleanupEmptyDirectories(_0x1c973b,_0x470907){let _0x506039=resolve(_0x1c973b);const _0x488cb5=resolve(_0x470907);while(_0x506039['startsWith'](''+_0x488cb5+sep)||_0x506039===_0x488cb5){if(_0x506039===_0x488cb5)return;try{const _0x3a7836=await readdir(_0x506039);if(_0x3a7836['length']>0x0)return;await rmdir(_0x506039);}catch{return;}_0x506039=dirname(_0x506039);}}async function resolveTargetDbBinding(_0x23ec7d,_0x32aea4,_0x173246){const _0x25db8c=a123_0x184a25,_0x21d2f1=_0x32aea4[_0x25db8c(0x12f)];if(!_0x21d2f1)return{'dbId':_0x173246[_0x25db8c(0x13c)],'dbName':_0x173246[_0x25db8c(0x133)]};const _0x42a685=buildDbDirectoryName(_0x173246['dbName'],_0x173246['dbId']);if(_0x21d2f1===_0x42a685)return{'dbId':_0x173246[_0x25db8c(0x13c)],'dbName':_0x173246[_0x25db8c(0x133)]};const _0x49cb65=parseExplicitDbDirectory(_0x21d2f1);if(_0x49cb65!=null)return{'dbId':_0x49cb65,'dbName':await getDbName(_0x23ec7d,_0x49cb65)[_0x25db8c(0x138)](()=>undefined)};const _0x1e39c4=await listDatabases(_0x23ec7d),_0x29a79a=_0x1e39c4[_0x25db8c(0x130)](_0x584c2c=>buildDbDirectoryName(_0x584c2c['dbName'],_0x584c2c['dbId'])===_0x21d2f1);if(_0x29a79a[_0x25db8c(0x156)]===0x1)return{'dbId':_0x29a79a[0x0]['dbId'],'dbName':_0x29a79a[0x0][_0x25db8c(0x133)]};if(_0x29a79a[_0x25db8c(0x156)]===0x0)throw CliErrors[_0x25db8c(0x147)](_0x25db8c(0x127)+_0x21d2f1+_0x25db8c(0x15c)+_0x32aea4[_0x25db8c(0x11c)]+'.');const _0x178040=_0x29a79a['map'](_0x403a14=>_0x403a14[_0x25db8c(0x133)]+'\x20('+_0x403a14[_0x25db8c(0x13c)]+')')[_0x25db8c(0x12b)](',\x20');throw CliErrors[_0x25db8c(0x147)](_0x25db8c(0x11f)+_0x21d2f1+'\x22\x20matches\x20multiple\x20databases\x20for\x20sqlCode\x20'+_0x32aea4[_0x25db8c(0x11c)]+':\x20'+_0x178040);}function parseExplicitDbDirectory(_0x43bdc7){const _0x2b2ce2=a123_0x184a25,_0x1b0b67=/^db-(\d+)$/[_0x2b2ce2(0x136)](_0x43bdc7);if(!_0x1b0b67)return null;const _0x3a9c90=Number(_0x1b0b67[0x1]);return Number[_0x2b2ce2(0x132)](_0x3a9c90)&&_0x3a9c90>0x0?_0x3a9c90:null;}
@@ -1 +1 @@
1
- const a124_0x5d52fa=a124_0x37b1;(function(_0x20220d,_0x1ca7b7){const _0x533958=a124_0x37b1,_0x3d25e2=_0x20220d();while(!![]){try{const _0x389245=-parseInt(_0x533958(0x76))/0x1*(-parseInt(_0x533958(0x71))/0x2)+-parseInt(_0x533958(0x70))/0x3+-parseInt(_0x533958(0x77))/0x4*(parseInt(_0x533958(0x78))/0x5)+-parseInt(_0x533958(0x7c))/0x6*(parseInt(_0x533958(0x6f))/0x7)+-parseInt(_0x533958(0x6e))/0x8*(parseInt(_0x533958(0x7a))/0x9)+parseInt(_0x533958(0x74))/0xa+parseInt(_0x533958(0x80))/0xb;if(_0x389245===_0x1ca7b7)break;else _0x3d25e2['push'](_0x3d25e2['shift']());}catch(_0x27daa9){_0x3d25e2['push'](_0x3d25e2['shift']());}}}(a124_0x5cf8,0x316db));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const SQL_SAVE_DEPRECATED_HINT=['`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.',a124_0x5d52fa(0x81),a124_0x5d52fa(0x6d)][a124_0x5d52fa(0x7f)]('\x0a');export const sqlSave={'service':a124_0x5d52fa(0x7e),'command':a124_0x5d52fa(0x79),'description':a124_0x5d52fa(0x73),'risk':a124_0x5d52fa(0x72),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a124_0x5d52fa(0x82),'type':a124_0x5d52fa(0x75),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a124_0x5d52fa(0x7d),'type':a124_0x5d52fa(0x75),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a124_0x5d52fa(0x75),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':a124_0x5d52fa(0x75),'description':'Query\x20description'}],async 'validate'(){const _0x403bf8=a124_0x5d52fa;throw CliErrors[_0x403bf8(0x7b)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){throw CliErrors['validation'](SQL_SAVE_DEPRECATED_HINT);}};function a124_0x37b1(_0x8dd801,_0x2f3ea6){_0x8dd801=_0x8dd801-0x6d;const _0x5cf84b=a124_0x5cf8();let _0x37b14c=_0x5cf84b[_0x8dd801];return _0x37b14c;}function a124_0x5cf8(){const _0x54254e=['save','36SWWmwn','validation','578232hVcHBH','sqlname','sql','join','5970250vCDKbH','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','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`.','728056UBZRsk','14NXlUuq','401454BwyahB','6wIvSuI','write','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','958000aXZyyR','string','88490rlGALa','92TwPTxG','2385JTYiDu'];a124_0x5cf8=function(){return _0x54254e;};return a124_0x5cf8();}
1
+ const a124_0x994ca7=a124_0x2fae;(function(_0x2466a1,_0x3a30d7){const _0x5eb350=a124_0x2fae,_0x10b8d7=_0x2466a1();while(!![]){try{const _0x3503f0=parseInt(_0x5eb350(0xc7))/0x1*(parseInt(_0x5eb350(0xbf))/0x2)+parseInt(_0x5eb350(0xb5))/0x3+parseInt(_0x5eb350(0xb8))/0x4*(parseInt(_0x5eb350(0xc0))/0x5)+parseInt(_0x5eb350(0xb9))/0x6*(-parseInt(_0x5eb350(0xcb))/0x7)+-parseInt(_0x5eb350(0xb6))/0x8+-parseInt(_0x5eb350(0xc9))/0x9+parseInt(_0x5eb350(0xc4))/0xa;if(_0x3503f0===_0x3a30d7)break;else _0x10b8d7['push'](_0x10b8d7['shift']());}catch(_0x4935f3){_0x10b8d7['push'](_0x10b8d7['shift']());}}}(a124_0x3750,0xd5b76));import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a124_0x3750(){const _0x263909=['1795780nbdNgd','Deprecated:\x20use\x20sql\x20create\x20to\x20create\x20and\x20sql\x20push\x20to\x20update','description','3265NUruWS','sql','5546349dCBeNl','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','84xsEfWC','write','4217727khkaVa','9400552tIwsVf','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`.','64VIFWZk','544992ZqQane','sqlname','join','SQL\x20query\x20display\x20name','Path\x20to\x20the\x20SQL\x20file','`rabetbase\x20sql\x20save`\x20has\x20been\x20deprecated.','338AABeWJ','506070IfmMJS','validation','Create\x20new\x20SQL\x20with\x20`rabetbase\x20sql\x20create\x20--name\x20<name>\x20--db-id\x20<id>\x20--mode\x20sql|mybatisXml`.','string'];a124_0x3750=function(){return _0x263909;};return a124_0x3750();}function a124_0x2fae(_0x25fd35,_0x5ddfec){_0x25fd35=_0x25fd35-0xb5;const _0x3750f6=a124_0x3750();let _0x2faed6=_0x3750f6[_0x25fd35];return _0x2faed6;}const SQL_SAVE_DEPRECATED_HINT=[a124_0x994ca7(0xbe),a124_0x994ca7(0xc2),a124_0x994ca7(0xb7)][a124_0x994ca7(0xbb)]('\x0a');export const sqlSave={'service':a124_0x994ca7(0xc8),'command':'save','description':a124_0x994ca7(0xc5),'risk':a124_0x994ca7(0xcc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'file','type':'string','required':!![],'description':a124_0x994ca7(0xbd)},SQLCODE_FLAG_OPTIONAL,{'name':a124_0x994ca7(0xba),'type':a124_0x994ca7(0xc3),'description':a124_0x994ca7(0xbc)},{'name':'db','type':a124_0x994ca7(0xc3),'description':a124_0x994ca7(0xca)},{'name':a124_0x994ca7(0xc6),'type':a124_0x994ca7(0xc3),'description':'Query\x20description'}],async 'validate'(){const _0x315059=a124_0x994ca7;throw CliErrors[_0x315059(0xc1)](SQL_SAVE_DEPRECATED_HINT);},async 'execute'(){const _0x42eb93=a124_0x994ca7;throw CliErrors[_0x42eb93(0xc1)](SQL_SAVE_DEPRECATED_HINT);}};
@@ -1 +1 @@
1
- const a125_0x2a36c4=a125_0x39a0;(function(_0x3783f9,_0x1684ab){const _0x3e33ca=a125_0x39a0,_0x133f96=_0x3783f9();while(!![]){try{const _0x30ee33=parseInt(_0x3e33ca(0xe5))/0x1*(parseInt(_0x3e33ca(0xe2))/0x2)+parseInt(_0x3e33ca(0xf1))/0x3*(-parseInt(_0x3e33ca(0xd6))/0x4)+-parseInt(_0x3e33ca(0xfc))/0x5+-parseInt(_0x3e33ca(0xe4))/0x6+-parseInt(_0x3e33ca(0xf7))/0x7+parseInt(_0x3e33ca(0xfb))/0x8*(-parseInt(_0x3e33ca(0xf8))/0x9)+parseInt(_0x3e33ca(0xe0))/0xa;if(_0x30ee33===_0x1684ab)break;else _0x133f96['push'](_0x133f96['shift']());}catch(_0x10d600){_0x133f96['push'](_0x133f96['shift']());}}}(a125_0x558b,0xc32bf));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=a125_0x2a36c4(0xea);export function buildSqlLockEntry(_0x4630e0,_0x4c70e0,_0xbfb4f1,_0x23c61b){const _0x598c2a=a125_0x2a36c4,_0x59e931=detectSqlMode(_0x4c70e0);return{'path':buildSqlRelativePath(_0x4630e0[_0x598c2a(0xe8)],_0x4630e0[_0x598c2a(0xe9)],_0x23c61b?.[_0x598c2a(0xd5)],_0x59e931,_0x4630e0[_0x598c2a(0xe6)]),'hash':_0xbfb4f1,'remoteId':_0x4630e0['id'],'version':_0x4630e0[_0x598c2a(0xde)],'dbId':Number(_0x4630e0[_0x598c2a(0xe6)]),'dbName':_0x23c61b?.[_0x598c2a(0xd5)],'sqlName':_0x4630e0['sqlName'],'sqlConfig':_0x4630e0['sqlConfig']??undefined,'mode':_0x59e931};}function a125_0x558b(){const _0x361ee4=['6301060uHuiwf','stdin','sqlRoot','\x20-->','mode','apps','push','trimStart','path','dbName','7804ZPWysR','toLowerCase','endsWith','question','close','map','length','join','version','fromEntries','38839760TSMBUU','--\x20@lovrabet.','101630tnNMwx','stderr','765072SHRHjB','8NLPwxH','dbId','mybatisXml','sqlCode','sqlName','.rabetbase/sql','replace','\x20[y/N]\x20','sqls','lastSync','syncedAt','filter','492KBobWw','split','trim','sqlContent','includes','<!--\x20@lovrabet.','6804231dVrIaX','72AJDACF','entries','description','811352KyGroA'];a125_0x558b=function(){return _0x361ee4;};return a125_0x558b();}export function cloneSqlLockData(_0x32ce51){const _0x1446c2=a125_0x2a36c4;return{'apps':Object[_0x1446c2(0xdf)](Object[_0x1446c2(0xf9)](_0x32ce51[_0x1446c2(0x101)])[_0x1446c2(0xdb)](([_0x51fe53,_0x30dc4b])=>[_0x51fe53,{'sqlRoot':_0x30dc4b[_0x1446c2(0xfe)],'lastSync':_0x30dc4b[_0x1446c2(0xee)],'sqls':{..._0x30dc4b[_0x1446c2(0xed)]}}]))};}export function ensureRemoteSqlContent(_0x18c502){const _0x2e4021=a125_0x2a36c4;return _0x18c502[_0x2e4021(0xf4)]??'';}export function buildLocalSqlFileContent(_0x2e4cbb,_0x33e16d,_0x412d48){const _0x42faba=a125_0x2a36c4,_0x23b27a=_0x412d48?.['mode']??detectSqlMode(_0x33e16d),_0x49c19f=stripLocalSqlMetadata(_0x33e16d,_0x23b27a)[_0x42faba(0xf3)](),_0x50bf13=[...buildMetadataHeaderLines({'sqlCode':_0x2e4cbb[_0x42faba(0xe8)],'sqlName':_0x2e4cbb[_0x42faba(0xe9)],'dbId':_0x2e4cbb[_0x42faba(0xe6)],'dbName':_0x412d48?.['dbName'],'mode':_0x23b27a,'syncedAt':_0x412d48?.[_0x42faba(0xef)],'description':_0x412d48?.[_0x42faba(0xfa)]},_0x23b27a),'',_0x49c19f],_0x498a88=_0x50bf13[_0x42faba(0xdd)]('\x0a');return _0x498a88[_0x42faba(0xd8)]('\x0a')?_0x498a88:_0x498a88+'\x0a';}export function stripLocalSqlMetadata(_0x27dfb7,_0xaf1508){const _0x237197=a125_0x2a36c4,_0x363871=_0x27dfb7[_0x237197(0xeb)](/\r\n/g,'\x0a')[_0x237197(0xf2)]('\x0a'),_0x213e0c=[];let _0x4cdfd1=0x0;if(_0xaf1508===_0x237197(0xe7))while(_0x4cdfd1<_0x363871[_0x237197(0xdc)]){const _0x24dd4e=_0x363871[_0x4cdfd1]??'';if(/^\s*<!--\s*@lovrabet\./['test'](_0x24dd4e)){_0x4cdfd1++;continue;}if(_0x24dd4e[_0x237197(0xf3)]()===''&&_0x4cdfd1>0x0){_0x4cdfd1++;continue;}break;}else while(_0x4cdfd1<_0x363871[_0x237197(0xdc)]){const _0x1dd37f=_0x363871[_0x4cdfd1]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x1dd37f)){_0x4cdfd1++;continue;}if(_0x1dd37f['trim']()===''&&_0x4cdfd1>0x0){_0x4cdfd1++;continue;}break;}for(;_0x4cdfd1<_0x363871[_0x237197(0xdc)];_0x4cdfd1++){_0x213e0c[_0x237197(0x102)](_0x363871[_0x4cdfd1]);}return _0x213e0c[_0x237197(0xdd)]('\x0a')[_0x237197(0x103)]();}export function resolveSqlMode(_0x4ea2b1,_0x2e7e8d){const _0x302540=a125_0x2a36c4;if(_0x2e7e8d?.[_0x302540(0x100)])return _0x2e7e8d[_0x302540(0x100)];return detectSqlMode(_0x4ea2b1);}export function resolveSqlFileName(_0x52fe46,_0x3a9436,_0x545353){const _0x4eb6cc=a125_0x2a36c4;if(_0x545353?.[_0x4eb6cc(0x104)])return _0x545353[_0x4eb6cc(0x104)];if(_0x545353?.[_0x4eb6cc(0xe9)]||_0x545353?.[_0x4eb6cc(0xd5)])return buildSqlRelativePath(_0x52fe46,_0x545353?.[_0x4eb6cc(0xe9)],_0x545353?.[_0x4eb6cc(0xd5)],resolveSqlMode(_0x3a9436,_0x545353),_0x545353?.['dbId']);return buildDefaultSqlFileName(_0x52fe46,resolveSqlMode(_0x3a9436,_0x545353));}export function resolveSqlLocalDir(_0x1fccc3,_0x4e6b8a){return join(_0x1fccc3,SQL_LOCAL_REL_DIR,_0x4e6b8a);}export async function confirmForceOverwrite(_0x414183){const _0xbb19cc=a125_0x2a36c4,_0x31482d=createInterface({'input':process[_0xbb19cc(0xfd)],'output':process[_0xbb19cc(0xe3)]}),_0x38cdd0=await new Promise(_0x50c4d0=>{const _0x67fe7d=_0xbb19cc;_0x31482d[_0x67fe7d(0xd9)](_0x414183+_0x67fe7d(0xec),_0x50c4d0);});return _0x31482d[_0xbb19cc(0xda)](),['y','yes'][_0xbb19cc(0xf5)](_0x38cdd0[_0xbb19cc(0xf3)]()[_0xbb19cc(0xd7)]());}export function findSqlLockScope(_0x25319d,_0x40e431){return _0x25319d['apps'][_0x40e431];}function a125_0x39a0(_0x4ffa6d,_0x105d01){_0x4ffa6d=_0x4ffa6d-0xd5;const _0x558b75=a125_0x558b();let _0x39a0db=_0x558b75[_0x4ffa6d];return _0x39a0db;}function buildMetadataHeaderLines(_0x552e62,_0x5e9982){const _0x1cd63d=a125_0x2a36c4,_0x4e6ef1=[['sqlCode',_0x552e62['sqlCode']],['sqlName',_0x552e62['sqlName']],[_0x1cd63d(0xe6),_0x552e62['dbId']],['dbName',_0x552e62[_0x1cd63d(0xd5)]],[_0x1cd63d(0x100),_0x552e62['mode']],[_0x1cd63d(0xef),_0x552e62[_0x1cd63d(0xef)]],[_0x1cd63d(0xfa),_0x552e62[_0x1cd63d(0xfa)]]];if(_0x5e9982==='mybatisXml')return _0x4e6ef1[_0x1cd63d(0xf0)](([,_0xc7d8c6])=>_0xc7d8c6!==undefined&&_0xc7d8c6!==null&&String(_0xc7d8c6)[_0x1cd63d(0xf3)]()!=='')[_0x1cd63d(0xdb)](([_0x5e2baf,_0x2140c6])=>_0x1cd63d(0xf6)+_0x5e2baf+':\x20'+String(_0x2140c6)+_0x1cd63d(0xff));return _0x4e6ef1[_0x1cd63d(0xf0)](([,_0x447eec])=>_0x447eec!==undefined&&_0x447eec!==null&&String(_0x447eec)[_0x1cd63d(0xf3)]()!=='')[_0x1cd63d(0xdb)](([_0xf9e135,_0x528ed1])=>_0x1cd63d(0xe1)+_0xf9e135+':\x20'+String(_0x528ed1));}
1
+ (function(_0x1de16,_0x251a8d){const _0x310a6f=a125_0x4aae,_0x12ec6f=_0x1de16();while(!![]){try{const _0x16cb00=parseInt(_0x310a6f(0xd8))/0x1+-parseInt(_0x310a6f(0xbd))/0x2*(-parseInt(_0x310a6f(0xbb))/0x3)+parseInt(_0x310a6f(0xb8))/0x4+parseInt(_0x310a6f(0xd5))/0x5+parseInt(_0x310a6f(0xbf))/0x6*(-parseInt(_0x310a6f(0xda))/0x7)+-parseInt(_0x310a6f(0xc7))/0x8*(parseInt(_0x310a6f(0xd2))/0x9)+-parseInt(_0x310a6f(0xc5))/0xa;if(_0x16cb00===_0x251a8d)break;else _0x12ec6f['push'](_0x12ec6f['shift']());}catch(_0x4c788b){_0x12ec6f['push'](_0x12ec6f['shift']());}}}(a125_0xb30b,0x5700e));import{createInterface}from'node:readline';import{join}from'node:path';function a125_0xb30b(){const _0x1916ad=['dbId','sqlName','<!--\x20@lovrabet.','map','syncedAt','trimStart','apps','sqls','split','entries','300924jcxFZJ','includes','sqlRoot','1165435nEsZiK','description','mode','680768xQGmvl','test','2317HMlbNI','filter','lastSync','\x20[y/N]\x20','question','endsWith','length','1753368XeiYUj','stdin','join','1663923mEFwzZ','dbName','2CEPZKt','version','5496IysxWM','sqlCode','--\x20@lovrabet.','mybatisXml','trim','path','11135320QjKRIM','yes','32QCerFY'];a125_0xb30b=function(){return _0x1916ad;};return a125_0xb30b();}import{buildDefaultSqlFileName,buildSqlRelativePath,detectSqlMode}from'../../core/sql-sync/utils.js';export const SQL_LOCAL_REL_DIR='.rabetbase/sql';export function buildSqlLockEntry(_0x49e966,_0x555710,_0x1ea45a,_0x3275c2){const _0x228342=a125_0x4aae,_0x8db659=detectSqlMode(_0x555710);return{'path':buildSqlRelativePath(_0x49e966[_0x228342(0xc0)],_0x49e966['sqlName'],_0x3275c2?.[_0x228342(0xbc)],_0x8db659,_0x49e966['dbId']),'hash':_0x1ea45a,'remoteId':_0x49e966['id'],'version':_0x49e966[_0x228342(0xbe)],'dbId':Number(_0x49e966[_0x228342(0xc8)]),'dbName':_0x3275c2?.[_0x228342(0xbc)],'sqlName':_0x49e966['sqlName'],'sqlConfig':_0x49e966['sqlConfig']??undefined,'mode':_0x8db659};}export function cloneSqlLockData(_0xcaf4d7){const _0x3e742c=a125_0x4aae;return{'apps':Object['fromEntries'](Object[_0x3e742c(0xd1)](_0xcaf4d7[_0x3e742c(0xce)])[_0x3e742c(0xcb)](([_0x512a78,_0x2cf00a])=>[_0x512a78,{'sqlRoot':_0x2cf00a[_0x3e742c(0xd4)],'lastSync':_0x2cf00a[_0x3e742c(0xdc)],'sqls':{..._0x2cf00a[_0x3e742c(0xcf)]}}]))};}export function ensureRemoteSqlContent(_0x469f71){return _0x469f71['sqlContent']??'';}export function buildLocalSqlFileContent(_0x38338b,_0x358daa,_0x524d59){const _0x4bbfe5=a125_0x4aae,_0xe8dffc=_0x524d59?.[_0x4bbfe5(0xd7)]??detectSqlMode(_0x358daa),_0x4a7939=stripLocalSqlMetadata(_0x358daa,_0xe8dffc)[_0x4bbfe5(0xc3)](),_0x23309f=[...buildMetadataHeaderLines({'sqlCode':_0x38338b[_0x4bbfe5(0xc0)],'sqlName':_0x38338b[_0x4bbfe5(0xc9)],'dbId':_0x38338b[_0x4bbfe5(0xc8)],'dbName':_0x524d59?.[_0x4bbfe5(0xbc)],'mode':_0xe8dffc,'syncedAt':_0x524d59?.['syncedAt'],'description':_0x524d59?.[_0x4bbfe5(0xd6)]},_0xe8dffc),'',_0x4a7939],_0xb94845=_0x23309f[_0x4bbfe5(0xba)]('\x0a');return _0xb94845[_0x4bbfe5(0xb6)]('\x0a')?_0xb94845:_0xb94845+'\x0a';}export function stripLocalSqlMetadata(_0x519492,_0xf1bf1d){const _0x55a285=a125_0x4aae,_0x20f6eb=_0x519492['replace'](/\r\n/g,'\x0a')[_0x55a285(0xd0)]('\x0a'),_0x261978=[];let _0x461dad=0x0;if(_0xf1bf1d==='mybatisXml')while(_0x461dad<_0x20f6eb[_0x55a285(0xb7)]){const _0x588972=_0x20f6eb[_0x461dad]??'';if(/^\s*<!--\s*@lovrabet\./[_0x55a285(0xd9)](_0x588972)){_0x461dad++;continue;}if(_0x588972['trim']()===''&&_0x461dad>0x0){_0x461dad++;continue;}break;}else while(_0x461dad<_0x20f6eb[_0x55a285(0xb7)]){const _0x4ff540=_0x20f6eb[_0x461dad]??'';if(/^\s*--\s*@lovrabet\./['test'](_0x4ff540)){_0x461dad++;continue;}if(_0x4ff540[_0x55a285(0xc3)]()===''&&_0x461dad>0x0){_0x461dad++;continue;}break;}for(;_0x461dad<_0x20f6eb[_0x55a285(0xb7)];_0x461dad++){_0x261978['push'](_0x20f6eb[_0x461dad]);}return _0x261978[_0x55a285(0xba)]('\x0a')[_0x55a285(0xcd)]();}export function resolveSqlMode(_0x13c6a1,_0x22324e){const _0xa70d80=a125_0x4aae;if(_0x22324e?.[_0xa70d80(0xd7)])return _0x22324e[_0xa70d80(0xd7)];return detectSqlMode(_0x13c6a1);}export function resolveSqlFileName(_0x462306,_0x2ac042,_0x4e77d){const _0x2a953f=a125_0x4aae;if(_0x4e77d?.[_0x2a953f(0xc4)])return _0x4e77d[_0x2a953f(0xc4)];if(_0x4e77d?.[_0x2a953f(0xc9)]||_0x4e77d?.[_0x2a953f(0xbc)])return buildSqlRelativePath(_0x462306,_0x4e77d?.['sqlName'],_0x4e77d?.[_0x2a953f(0xbc)],resolveSqlMode(_0x2ac042,_0x4e77d),_0x4e77d?.['dbId']);return buildDefaultSqlFileName(_0x462306,resolveSqlMode(_0x2ac042,_0x4e77d));}export function resolveSqlLocalDir(_0x5e833c,_0x7a6450){return join(_0x5e833c,SQL_LOCAL_REL_DIR,_0x7a6450);}export async function confirmForceOverwrite(_0x354c6f){const _0x89b8d8=a125_0x4aae,_0x23f63e=createInterface({'input':process[_0x89b8d8(0xb9)],'output':process['stderr']}),_0x52c67b=await new Promise(_0x38bb49=>{const _0x30c63f=_0x89b8d8;_0x23f63e[_0x30c63f(0xb5)](_0x354c6f+_0x30c63f(0xb4),_0x38bb49);});return _0x23f63e['close'](),['y',_0x89b8d8(0xc6)][_0x89b8d8(0xd3)](_0x52c67b[_0x89b8d8(0xc3)]()['toLowerCase']());}function a125_0x4aae(_0x576b52,_0x4036b3){_0x576b52=_0x576b52-0xb4;const _0xb30be3=a125_0xb30b();let _0x4aae4a=_0xb30be3[_0x576b52];return _0x4aae4a;}export function findSqlLockScope(_0x3334c5,_0x14d79a){const _0xed379d=a125_0x4aae;return _0x3334c5[_0xed379d(0xce)][_0x14d79a];}function buildMetadataHeaderLines(_0x168654,_0x2e431c){const _0x33ba7d=a125_0x4aae,_0x5ecdf8=[['sqlCode',_0x168654[_0x33ba7d(0xc0)]],[_0x33ba7d(0xc9),_0x168654[_0x33ba7d(0xc9)]],['dbId',_0x168654['dbId']],[_0x33ba7d(0xbc),_0x168654[_0x33ba7d(0xbc)]],[_0x33ba7d(0xd7),_0x168654[_0x33ba7d(0xd7)]],[_0x33ba7d(0xcc),_0x168654[_0x33ba7d(0xcc)]],['description',_0x168654[_0x33ba7d(0xd6)]]];if(_0x2e431c===_0x33ba7d(0xc2))return _0x5ecdf8[_0x33ba7d(0xdb)](([,_0x5078fb])=>_0x5078fb!==undefined&&_0x5078fb!==null&&String(_0x5078fb)[_0x33ba7d(0xc3)]()!=='')['map'](([_0x1adf7c,_0x5137dc])=>_0x33ba7d(0xca)+_0x1adf7c+':\x20'+String(_0x5137dc)+'\x20-->');return _0x5ecdf8[_0x33ba7d(0xdb)](([,_0x39ede4])=>_0x39ede4!==undefined&&_0x39ede4!==null&&String(_0x39ede4)[_0x33ba7d(0xc3)]()!=='')[_0x33ba7d(0xcb)](([_0x752754,_0x25d4c3])=>_0x33ba7d(0xc1)+_0x752754+':\x20'+String(_0x25d4c3));}
@@ -1 +1 @@
1
- const a126_0x4d3dbd=a126_0x2faa;(function(_0x23598e,_0x26c610){const _0x115dac=a126_0x2faa,_0x561434=_0x23598e();while(!![]){try{const _0x3d1856=-parseInt(_0x115dac(0x182))/0x1*(-parseInt(_0x115dac(0x196))/0x2)+parseInt(_0x115dac(0x17d))/0x3+-parseInt(_0x115dac(0x190))/0x4+-parseInt(_0x115dac(0x19c))/0x5*(-parseInt(_0x115dac(0x197))/0x6)+-parseInt(_0x115dac(0x17b))/0x7*(parseInt(_0x115dac(0x193))/0x8)+-parseInt(_0x115dac(0x187))/0x9*(parseInt(_0x115dac(0x189))/0xa)+parseInt(_0x115dac(0x181))/0xb;if(_0x3d1856===_0x26c610)break;else _0x561434['push'](_0x561434['shift']());}catch(_0x36dadc){_0x561434['push'](_0x561434['shift']());}}}(a126_0x416b,0xb68a7));import{listSqlQueries}from'../../core/api-client.js';function a126_0x416b(){const _0x2bdda1=['sql','5606271GTlWHZ','61TbkzxA','sqlName','\x20added,\x20','\x20unchanged','lockKey','9ppKbYy','sqls','7618890XRxPRj','Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally','path','hash','map','keys','boolean','2717232IQONcI','has','paging','8XJBBwc','status','remote','39474AuGdrW','462uxqshr','relativePath','sqlRoot','lockFilePath','All\x20SQL\x20queries\x20are\x20in\x20sync.','33220dMEdje','appCode','totalCount','read','\x20remote-only','sqlCode','bool','8010170mAHDrP','push','3323964jPXXga','\x20missing,\x20','length'];a126_0x416b=function(){return _0x2bdda1;};return a126_0x416b();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';function a126_0x2faa(_0x4d0a23,_0x348b05){_0x4d0a23=_0x4d0a23-0x178;const _0x416b03=a126_0x416b();let _0x2faabd=_0x416b03[_0x4d0a23];return _0x2faabd;}const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x2cfda8){const _0x59d662=a126_0x2faa,_0x42c2c0=[];let _0x592897=0x1;while(!![]){const _0x431a24=await listSqlQueries(_0x2cfda8,{'currentPage':_0x592897,'pageSize':PAGE_SIZE}),_0x2283db=_0x431a24['tableData']??[];_0x42c2c0['push'](..._0x2283db[_0x59d662(0x18d)](_0x3d4c82=>_0x3d4c82[_0x59d662(0x179)]));if(_0x2283db[_0x59d662(0x17f)]===0x0)break;const _0x32629f=_0x431a24[_0x59d662(0x192)]?.[_0x59d662(0x19e)];if(_0x32629f!=null?_0x42c2c0[_0x59d662(0x17f)]>=_0x32629f:_0x2283db[_0x59d662(0x17f)]<PAGE_SIZE)break;_0x592897++;}return _0x42c2c0;}export const sqlStatus={'service':a126_0x4d3dbd(0x180),'command':a126_0x4d3dbd(0x194),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':a126_0x4d3dbd(0x19f),'flags':[{'name':a126_0x4d3dbd(0x195),'type':a126_0x4d3dbd(0x18f),'description':a126_0x4d3dbd(0x18a)}],async 'execute'(_0x5bb324){const _0x3e5eb1=a126_0x4d3dbd,_0x131fe6=loadSqlProjectConfig(_0x5bb324[_0x3e5eb1(0x19d)]),_0x5d5c61=await readSqlLockFile(_0x131fe6[_0x3e5eb1(0x19a)]),{appLock:_0x1b702e}=ensureSqlLockScope(_0x5d5c61??createEmptySqlLock(),_0x131fe6[_0x3e5eb1(0x19d)],_0x131fe6[_0x3e5eb1(0x199)],_0x3e5eb1(0x194)),_0x461e47=await scanLocalSqlQueries(_0x131fe6),_0x3d64b6=[],_0x14c0c1=[],_0x4d134f=[],_0x1b08d9=[],_0x9ad80b=new Set(_0x461e47['map'](_0x35f479=>_0x35f479[_0x3e5eb1(0x186)]));for(const _0x6f4e84 of _0x461e47){const _0x5eaab8=await computeSqlFileHash(_0x6f4e84['filePath']),_0x5adfbf=_0x1b702e[_0x3e5eb1(0x188)][_0x6f4e84['lockKey']],_0x339afe=!!_0x5adfbf&&_0x5adfbf[_0x3e5eb1(0x18b)]!==_0x6f4e84[_0x3e5eb1(0x198)],_0x949af1=!!_0x5adfbf&&!!_0x6f4e84['sqlName']&&_0x5adfbf['sqlName']!==_0x6f4e84[_0x3e5eb1(0x183)];if(!_0x5adfbf)_0x3d64b6[_0x3e5eb1(0x17c)](_0x6f4e84[_0x3e5eb1(0x186)]);else _0x5adfbf[_0x3e5eb1(0x18c)]!==_0x5eaab8||_0x339afe||_0x949af1?_0x14c0c1[_0x3e5eb1(0x17c)](_0x6f4e84[_0x3e5eb1(0x186)]):_0x4d134f[_0x3e5eb1(0x17c)](_0x6f4e84['lockKey']);}for(const _0x33f138 of Object[_0x3e5eb1(0x18e)](_0x1b702e['sqls'])){!_0x9ad80b[_0x3e5eb1(0x191)](_0x33f138)&&_0x1b08d9['push'](_0x33f138);}const _0x455dea=[];if(_0x5bb324[_0x3e5eb1(0x17a)]('remote')){const _0x2570e4=await fetchAllSqlCodes(_0x5bb324['appCode']);for(const _0x20fb6e of _0x2570e4){!_0x9ad80b[_0x3e5eb1(0x191)](_0x20fb6e)&&!_0x1b702e['sqls'][_0x20fb6e]&&_0x455dea[_0x3e5eb1(0x17c)](_0x20fb6e);}}const _0x1b388b=_0x3d64b6[_0x3e5eb1(0x17f)]===0x0&&_0x14c0c1[_0x3e5eb1(0x17f)]===0x0&&_0x1b08d9['length']===0x0&&_0x455dea[_0x3e5eb1(0x17f)]===0x0;return{'ok':!![],'data':{'added':_0x3d64b6,'modified':_0x14c0c1,'missing':_0x1b08d9,'unchanged':_0x4d134f,'remoteOnly':_0x455dea},'message':_0x1b388b?_0x3e5eb1(0x19b):_0x3d64b6[_0x3e5eb1(0x17f)]+_0x3e5eb1(0x184)+_0x14c0c1[_0x3e5eb1(0x17f)]+'\x20modified,\x20'+_0x1b08d9[_0x3e5eb1(0x17f)]+_0x3e5eb1(0x17e)+_0x4d134f[_0x3e5eb1(0x17f)]+_0x3e5eb1(0x185)+(_0x455dea[_0x3e5eb1(0x17f)]>0x0?',\x20'+_0x455dea[_0x3e5eb1(0x17f)]+_0x3e5eb1(0x178):'')};}};
1
+ const a126_0x5e7647=a126_0x4b4e;(function(_0x4f301c,_0x208fc0){const _0xba107e=a126_0x4b4e,_0xf7c701=_0x4f301c();while(!![]){try{const _0x423c48=-parseInt(_0xba107e(0x1af))/0x1*(parseInt(_0xba107e(0x19b))/0x2)+-parseInt(_0xba107e(0x1a9))/0x3+parseInt(_0xba107e(0x1b0))/0x4*(parseInt(_0xba107e(0x1b3))/0x5)+-parseInt(_0xba107e(0x198))/0x6+-parseInt(_0xba107e(0x19a))/0x7*(parseInt(_0xba107e(0x1a5))/0x8)+parseInt(_0xba107e(0x1a4))/0x9+-parseInt(_0xba107e(0x1ad))/0xa*(-parseInt(_0xba107e(0x1a7))/0xb);if(_0x423c48===_0x208fc0)break;else _0xf7c701['push'](_0xf7c701['shift']());}catch(_0x1de9c7){_0xf7c701['push'](_0xf7c701['shift']());}}}(a126_0x5d6f,0x3c7d5));import{listSqlQueries}from'../../core/api-client.js';function a126_0x5d6f(){const _0x396484=['totalCount','appCode','map','bool','621630brPpIQ','3705704BGzeZl','boolean','55AgTOZQ','sqlRoot','1112076cOWNKg','sqls','\x20unchanged','remote','1962910jpZUkd','status','63834FLnUEC','1844044hePUVa','paging','sqlCode','5lATSDg','lockKey','keys','tableData','length','sqlName','664176ngPxWf','All\x20SQL\x20queries\x20are\x20in\x20sync.','7xLsPZC','10utdTAl','filePath','path','\x20remote-only','push'];a126_0x5d6f=function(){return _0x396484;};return a126_0x5d6f();}import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{scanLocalSqlQueries}from'../../core/sql-sync/file-system.js';import{computeSqlFileHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile}from'../../core/sql-sync/lock.js';const PAGE_SIZE=0x64;async function fetchAllSqlCodes(_0x40415c){const _0x530f0d=a126_0x4b4e,_0x4c387d=[];let _0x233e7b=0x1;while(!![]){const _0x4dac76=await listSqlQueries(_0x40415c,{'currentPage':_0x233e7b,'pageSize':PAGE_SIZE}),_0x500e67=_0x4dac76[_0x530f0d(0x1b6)]??[];_0x4c387d['push'](..._0x500e67[_0x530f0d(0x1a2)](_0x50d4a6=>_0x50d4a6[_0x530f0d(0x1b2)]));if(_0x500e67[_0x530f0d(0x1b7)]===0x0)break;const _0x35a669=_0x4dac76[_0x530f0d(0x1b1)]?.[_0x530f0d(0x1a0)];if(_0x35a669!=null?_0x4c387d['length']>=_0x35a669:_0x500e67['length']<PAGE_SIZE)break;_0x233e7b++;}return _0x4c387d;}function a126_0x4b4e(_0x206b3c,_0x582d86){_0x206b3c=_0x206b3c-0x197;const _0x5d6f08=a126_0x5d6f();let _0x4b4ed5=_0x5d6f08[_0x206b3c];return _0x4b4ed5;}export const sqlStatus={'service':'sql','command':a126_0x5e7647(0x1ae),'description':'Check\x20local\x20SQL\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':a126_0x5e7647(0x1ac),'type':a126_0x5e7647(0x1a6),'description':'Also\x20check\x20for\x20remote-only\x20SQL\x20queries\x20not\x20present\x20locally'}],async 'execute'(_0x151efb){const _0x36e027=a126_0x5e7647,_0x1224c0=loadSqlProjectConfig(_0x151efb[_0x36e027(0x1a1)]),_0x53d33f=await readSqlLockFile(_0x1224c0['lockFilePath']),{appLock:_0x6f87e6}=ensureSqlLockScope(_0x53d33f??createEmptySqlLock(),_0x1224c0[_0x36e027(0x1a1)],_0x1224c0[_0x36e027(0x1a8)],_0x36e027(0x1ae)),_0x15416a=await scanLocalSqlQueries(_0x1224c0),_0x9a2c3a=[],_0xb2c85c=[],_0x4af78e=[],_0xa6dd72=[],_0xb7d663=new Set(_0x15416a[_0x36e027(0x1a2)](_0x4f300e=>_0x4f300e[_0x36e027(0x1b4)]));for(const _0x4d5c12 of _0x15416a){const _0x28632f=await computeSqlFileHash(_0x4d5c12[_0x36e027(0x19c)]),_0x39f190=_0x6f87e6[_0x36e027(0x1aa)][_0x4d5c12['lockKey']],_0x418d2e=!!_0x39f190&&_0x39f190[_0x36e027(0x19d)]!==_0x4d5c12['relativePath'],_0x23a371=!!_0x39f190&&!!_0x4d5c12[_0x36e027(0x197)]&&_0x39f190['sqlName']!==_0x4d5c12[_0x36e027(0x197)];if(!_0x39f190)_0x9a2c3a[_0x36e027(0x19f)](_0x4d5c12[_0x36e027(0x1b4)]);else _0x39f190['hash']!==_0x28632f||_0x418d2e||_0x23a371?_0xb2c85c[_0x36e027(0x19f)](_0x4d5c12[_0x36e027(0x1b4)]):_0x4af78e[_0x36e027(0x19f)](_0x4d5c12[_0x36e027(0x1b4)]);}for(const _0x8c2d of Object[_0x36e027(0x1b5)](_0x6f87e6['sqls'])){!_0xb7d663['has'](_0x8c2d)&&_0xa6dd72['push'](_0x8c2d);}const _0x1f0714=[];if(_0x151efb[_0x36e027(0x1a3)]('remote')){const _0x4c6c04=await fetchAllSqlCodes(_0x151efb[_0x36e027(0x1a1)]);for(const _0x3ff202 of _0x4c6c04){!_0xb7d663['has'](_0x3ff202)&&!_0x6f87e6[_0x36e027(0x1aa)][_0x3ff202]&&_0x1f0714[_0x36e027(0x19f)](_0x3ff202);}}const _0x5a855b=_0x9a2c3a[_0x36e027(0x1b7)]===0x0&&_0xb2c85c[_0x36e027(0x1b7)]===0x0&&_0xa6dd72[_0x36e027(0x1b7)]===0x0&&_0x1f0714[_0x36e027(0x1b7)]===0x0;return{'ok':!![],'data':{'added':_0x9a2c3a,'modified':_0xb2c85c,'missing':_0xa6dd72,'unchanged':_0x4af78e,'remoteOnly':_0x1f0714},'message':_0x5a855b?_0x36e027(0x199):_0x9a2c3a[_0x36e027(0x1b7)]+'\x20added,\x20'+_0xb2c85c[_0x36e027(0x1b7)]+'\x20modified,\x20'+_0xa6dd72[_0x36e027(0x1b7)]+'\x20missing,\x20'+_0x4af78e[_0x36e027(0x1b7)]+_0x36e027(0x1ab)+(_0x1f0714['length']>0x0?',\x20'+_0x1f0714['length']+_0x36e027(0x19e):'')};}};
@@ -1 +1 @@
1
- const a127_0x15e9b2=a127_0x3f55;(function(_0x42bb2c,_0xce7204){const _0x5adb4e=a127_0x3f55,_0x12bb8d=_0x42bb2c();while(!![]){try{const _0x5e2477=parseInt(_0x5adb4e(0x1d8))/0x1+-parseInt(_0x5adb4e(0x1d7))/0x2+-parseInt(_0x5adb4e(0x1d4))/0x3*(parseInt(_0x5adb4e(0x1bd))/0x4)+parseInt(_0x5adb4e(0x1ca))/0x5+-parseInt(_0x5adb4e(0x1bc))/0x6+-parseInt(_0x5adb4e(0x1cf))/0x7+-parseInt(_0x5adb4e(0x1c4))/0x8*(-parseInt(_0x5adb4e(0x1de))/0x9);if(_0x5e2477===_0xce7204)break;else _0x12bb8d['push'](_0x12bb8d['shift']());}catch(_0x4a1c4f){_0x12bb8d['push'](_0x12bb8d['shift']());}}}(a127_0x3965,0xd46fb));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a127_0x3f55(_0x2a6488,_0x477057){_0x2a6488=_0x2a6488-0x1b5;const _0x3965c2=a127_0x3965();let _0x3f554c=_0x3965c2[_0x2a6488];return _0x3f554c;}import{validateSql}from'../../core/sql-validator.js';function a127_0x3965(){const _0x2be891=['isArray','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','valid','SQL\x20schema\x20validation','tables','dbtableConfig','\x22\x20not\x20found\x20in\x20any\x20dataset','3975762lChEbX','5583228lLlzLW','string','get','tableName','File\x20not\x20found:\x20','Table\x20\x22','validation','16OefQAN','flagMissing','name','Provide\x20--file\x20or\x20--sql','cwd','schema:','1970680CTVNFr','trim','size','file','toLowerCase','12101880HWvZiA','schemaWarnings','Dataset\x20\x22','sql','map','3RbMiyH','str','reason','754382hatwNx','563492KlTiGb','fields','sqlType','push','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','message','18346392IBTdJy','validate','read','\x22\x20not\x20found\x20or\x20not\x20accessible','split','filter','schemas','appCode'];a127_0x3965=function(){return _0x2be891;};return a127_0x3965();}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetSupportsLocalDevelopment,filterDbBackedDatasets}from'../../commands/dataset/capability.js';export const sqlValidate={'service':a127_0x15e9b2(0x1d2),'command':a127_0x15e9b2(0x1df),'description':a127_0x15e9b2(0x1b6),'risk':a127_0x15e9b2(0x1e0),'flags':[{'name':a127_0x15e9b2(0x1cd),'type':'string','description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a127_0x15e9b2(0x1d2),'type':a127_0x15e9b2(0x1be),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a127_0x15e9b2(0x1e4),'type':'string','description':a127_0x15e9b2(0x1dc)}],async 'execute'(_0xfc34d6){const _0x1a6618=a127_0x15e9b2,_0x4838d5=_0xfc34d6[_0x1a6618(0x1d5)](_0x1a6618(0x1cd)),_0x2fbe3e=_0xfc34d6['str'](_0x1a6618(0x1d2));if(!_0x4838d5&&!_0x2fbe3e)throw CliErrors[_0x1a6618(0x1c5)]('file',_0x1a6618(0x1c7));let _0x4db4e0;if(_0x4838d5){const _0x3d3996=resolve(process[_0x1a6618(0x1c8)](),_0x4838d5);if(!existsSync(_0x3d3996))throw CliErrors[_0x1a6618(0x1c3)](_0x1a6618(0x1c1)+_0x3d3996);_0x4db4e0=readFileSync(_0x3d3996,'utf-8');}else _0x4db4e0=_0x2fbe3e;const _0x30d8d7=validateSql(_0x4db4e0),_0x3b1e22={'valid':_0x30d8d7[_0x1a6618(0x1b7)],'sqlType':_0x30d8d7['sqlType']['type'],'isSelectOnly':_0x30d8d7[_0x1a6618(0x1da)]['isSelectOnly'],'isDangerous':_0x30d8d7[_0x1a6618(0x1da)]['isDangerous'],'tables':_0x30d8d7[_0x1a6618(0x1b9)],'parameters':_0x30d8d7['parameters'],'message':_0x30d8d7[_0x1a6618(0x1dd)]};_0x30d8d7[_0x1a6618(0x1da)][_0x1a6618(0x1d6)]&&(_0x3b1e22[_0x1a6618(0x1d6)]=_0x30d8d7['sqlType'][_0x1a6618(0x1d6)]);const _0x5b365b=_0xfc34d6[_0x1a6618(0x1d5)](_0x1a6618(0x1e4));if(_0x5b365b&&_0x30d8d7[_0x1a6618(0x1b7)]){const _0x5ba094=_0x5b365b[_0x1a6618(0x1e2)](',')['map'](_0x36706f=>_0x36706f[_0x1a6618(0x1cb)]())[_0x1a6618(0x1e3)](Boolean),_0x1daccd=[],_0x3a8105=filterDbBackedDatasets(await listDatasets(_0xfc34d6[_0x1a6618(0x1e5)])),_0x330609=new Map(_0x3a8105[_0x1a6618(0x1d3)](_0x4cff95=>[_0x4cff95['dbtableConfig']?.[_0x1a6618(0x1c0)]?.[_0x1a6618(0x1ce)](),_0x4cff95]));for(const _0x4b140c of _0x30d8d7[_0x1a6618(0x1b9)]){const _0x292cf8=_0x330609[_0x1a6618(0x1bf)](_0x4b140c[_0x1a6618(0x1ce)]());!_0x292cf8&&_0x1daccd[_0x1a6618(0x1db)](_0x1a6618(0x1c2)+_0x4b140c+_0x1a6618(0x1bb));}for(const _0x1d8f7d of _0x5ba094){let _0x1eea95;try{_0x1eea95=await getDatasetDetail(_0x1d8f7d);}catch{_0x1daccd['push'](_0x1a6618(0x1d1)+_0x1d8f7d+_0x1a6618(0x1e1));continue;}assertDatasetSupportsLocalDevelopment(_0x1eea95,_0x1a6618(0x1b8));const _0xf0d89b=Array[_0x1a6618(0x1b5)](_0x1eea95[_0x1a6618(0x1d9)])?_0x1eea95[_0x1a6618(0x1d9)]:[],_0x3e27c0=new Set(_0xf0d89b[_0x1a6618(0x1d3)](_0x27d0ca=>_0x27d0ca[_0x1a6618(0x1c6)]?.[_0x1a6618(0x1ce)]())),_0x4a4ea8=_0x1eea95[_0x1a6618(0x1ba)]?.['tableName']||_0x1eea95[_0x1a6618(0x1c0)]||_0x1d8f7d;_0x3b1e22[_0x1a6618(0x1c9)+_0x4a4ea8]={'code':_0x1d8f7d,'tableName':_0x4a4ea8,'fieldCount':_0x3e27c0[_0x1a6618(0x1cc)],'fields':Array['from'](_0x3e27c0)};}_0x1daccd['length']>0x0&&(_0x3b1e22[_0x1a6618(0x1d0)]=_0x1daccd);}return{'ok':_0x30d8d7[_0x1a6618(0x1b7)],'data':_0x3b1e22,'message':_0x30d8d7[_0x1a6618(0x1dd)]};}};
1
+ const a127_0xa23e1a=a127_0x3396;(function(_0x22e65a,_0xeb1ae8){const _0x12c217=a127_0x3396,_0xbe7ef0=_0x22e65a();while(!![]){try{const _0x39b9c4=parseInt(_0x12c217(0xca))/0x1+-parseInt(_0x12c217(0xba))/0x2+parseInt(_0x12c217(0xc1))/0x3*(-parseInt(_0x12c217(0xbe))/0x4)+-parseInt(_0x12c217(0xc6))/0x5*(parseInt(_0x12c217(0xbc))/0x6)+parseInt(_0x12c217(0xe2))/0x7*(parseInt(_0x12c217(0xbb))/0x8)+parseInt(_0x12c217(0xc0))/0x9*(-parseInt(_0x12c217(0xce))/0xa)+parseInt(_0x12c217(0xe8))/0xb*(parseInt(_0x12c217(0xd6))/0xc);if(_0x39b9c4===_0xeb1ae8)break;else _0xbe7ef0['push'](_0xbe7ef0['shift']());}catch(_0xff0370){_0xbe7ef0['push'](_0xbe7ef0['shift']());}}}(a127_0x3618,0x98947));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a127_0x3396(_0x235272,_0x564324){_0x235272=_0x235272-0xb6;const _0x3618e2=a127_0x3618();let _0x33960d=_0x3618e2[_0x235272];return _0x33960d;}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{assertDatasetSupportsLocalDevelopment,filterDbBackedDatasets}from'../../commands/dataset/capability.js';function a127_0x3618(){const _0x278737=['8793640sBEyGQ','trim','file','split','message','schemas','schema:','get','27626892KpBHrR','map','tableName','type','size','str','sql','reason','length','\x22\x20not\x20found\x20in\x20any\x20dataset','string','valid','797398DaXNSr','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','parameters','push','isSelectOnly','toLowerCase','11GzsjlS','flagMissing','isArray','cwd','Provide\x20--file\x20or\x20--sql','\x22\x20not\x20found\x20or\x20not\x20accessible','sqlType','name','917444MuiXCR','24KSbuSq','6YDpWod','fields','15116EGYTqO','dbtableConfig','9dDvMpL','231PkroKh','SQL\x20schema\x20validation','validation','tables','validate','5949865LsEEGY','File\x20not\x20found:\x20','isDangerous','schemaWarnings','800026fqmdLh','Table\x20\x22','Dataset\x20\x22','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)'];a127_0x3618=function(){return _0x278737;};return a127_0x3618();}export const sqlValidate={'service':a127_0xa23e1a(0xdc),'command':a127_0xa23e1a(0xc5),'description':a127_0xa23e1a(0xcd),'risk':'read','flags':[{'name':a127_0xa23e1a(0xd0),'type':a127_0xa23e1a(0xe0),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a127_0xa23e1a(0xdc),'type':'string','description':a127_0xa23e1a(0xe3)},{'name':a127_0xa23e1a(0xd3),'type':'string','description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x11a264){const _0x3c2e41=a127_0xa23e1a,_0x29d1f9=_0x11a264[_0x3c2e41(0xdb)](_0x3c2e41(0xd0)),_0x3b4cea=_0x11a264[_0x3c2e41(0xdb)]('sql');if(!_0x29d1f9&&!_0x3b4cea)throw CliErrors[_0x3c2e41(0xe9)](_0x3c2e41(0xd0),_0x3c2e41(0xb6));let _0x2d9544;if(_0x29d1f9){const _0x1272d3=resolve(process[_0x3c2e41(0xeb)](),_0x29d1f9);if(!existsSync(_0x1272d3))throw CliErrors[_0x3c2e41(0xc3)](_0x3c2e41(0xc7)+_0x1272d3);_0x2d9544=readFileSync(_0x1272d3,'utf-8');}else _0x2d9544=_0x3b4cea;const _0x3523fd=validateSql(_0x2d9544),_0x24519d={'valid':_0x3523fd[_0x3c2e41(0xe1)],'sqlType':_0x3523fd['sqlType'][_0x3c2e41(0xd9)],'isSelectOnly':_0x3523fd[_0x3c2e41(0xb8)][_0x3c2e41(0xe6)],'isDangerous':_0x3523fd[_0x3c2e41(0xb8)][_0x3c2e41(0xc8)],'tables':_0x3523fd[_0x3c2e41(0xc4)],'parameters':_0x3523fd[_0x3c2e41(0xe4)],'message':_0x3523fd[_0x3c2e41(0xd2)]};_0x3523fd[_0x3c2e41(0xb8)]['reason']&&(_0x24519d[_0x3c2e41(0xdd)]=_0x3523fd[_0x3c2e41(0xb8)][_0x3c2e41(0xdd)]);const _0x4dcb79=_0x11a264[_0x3c2e41(0xdb)](_0x3c2e41(0xd3));if(_0x4dcb79&&_0x3523fd['valid']){const _0x4a1ef4=_0x4dcb79[_0x3c2e41(0xd1)](',')[_0x3c2e41(0xd7)](_0x499a15=>_0x499a15[_0x3c2e41(0xcf)]())['filter'](Boolean),_0x54b99d=[],_0x2b5e31=filterDbBackedDatasets(await listDatasets(_0x11a264['appCode'])),_0x3be4c9=new Map(_0x2b5e31[_0x3c2e41(0xd7)](_0x519c8c=>[_0x519c8c[_0x3c2e41(0xbf)]?.[_0x3c2e41(0xd8)]?.['toLowerCase'](),_0x519c8c]));for(const _0x589ad6 of _0x3523fd[_0x3c2e41(0xc4)]){const _0x193891=_0x3be4c9[_0x3c2e41(0xd5)](_0x589ad6['toLowerCase']());!_0x193891&&_0x54b99d[_0x3c2e41(0xe5)](_0x3c2e41(0xcb)+_0x589ad6+_0x3c2e41(0xdf));}for(const _0xa47a24 of _0x4a1ef4){let _0x5e7cea;try{_0x5e7cea=await getDatasetDetail(_0xa47a24);}catch{_0x54b99d[_0x3c2e41(0xe5)](_0x3c2e41(0xcc)+_0xa47a24+_0x3c2e41(0xb7));continue;}assertDatasetSupportsLocalDevelopment(_0x5e7cea,_0x3c2e41(0xc2));const _0x3bb0e5=Array[_0x3c2e41(0xea)](_0x5e7cea['fields'])?_0x5e7cea[_0x3c2e41(0xbd)]:[],_0xaf45e=new Set(_0x3bb0e5['map'](_0x35a2ce=>_0x35a2ce[_0x3c2e41(0xb9)]?.[_0x3c2e41(0xe7)]())),_0x56fa86=_0x5e7cea[_0x3c2e41(0xbf)]?.['tableName']||_0x5e7cea['tableName']||_0xa47a24;_0x24519d[_0x3c2e41(0xd4)+_0x56fa86]={'code':_0xa47a24,'tableName':_0x56fa86,'fieldCount':_0xaf45e[_0x3c2e41(0xda)],'fields':Array['from'](_0xaf45e)};}_0x54b99d[_0x3c2e41(0xde)]>0x0&&(_0x24519d[_0x3c2e41(0xc9)]=_0x54b99d);}return{'ok':_0x3523fd['valid'],'data':_0x24519d,'message':_0x3523fd[_0x3c2e41(0xd2)]};}};
@@ -1 +1 @@
1
- const a128_0x14ae3b=a128_0x5c29;(function(_0x34ebdc,_0x22c4cb){const _0xa5b4d2=a128_0x5c29,_0x18d0b5=_0x34ebdc();while(!![]){try{const _0x4a69fb=-parseInt(_0xa5b4d2(0x1ea))/0x1+parseInt(_0xa5b4d2(0x1e1))/0x2*(parseInt(_0xa5b4d2(0x1ec))/0x3)+parseInt(_0xa5b4d2(0x1d4))/0x4*(parseInt(_0xa5b4d2(0x1f1))/0x5)+parseInt(_0xa5b4d2(0x1f3))/0x6*(-parseInt(_0xa5b4d2(0x1e3))/0x7)+-parseInt(_0xa5b4d2(0x1e4))/0x8*(parseInt(_0xa5b4d2(0x1dc))/0x9)+-parseInt(_0xa5b4d2(0x1d6))/0xa+parseInt(_0xa5b4d2(0x1ca))/0xb;if(_0x4a69fb===_0x22c4cb)break;else _0x18d0b5['push'](_0x18d0b5['shift']());}catch(_0x11ab58){_0x18d0b5['push'](_0x18d0b5['shift']());}}}(a128_0x1e31,0x4681d));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a128_0x5c29(_0x29f6b2,_0x135147){_0x29f6b2=_0x29f6b2-0x1ca;const _0x1e31cc=a128_0x1e31();let _0x5c2990=_0x1e31cc[_0x29f6b2];return _0x5c2990;}import{RABETBASE_ENV_VALUES}from'../constant/env.js';function a128_0x1e31(){const _0x5532ed=['Locale','entries','appcode','env','API\x20directory\x20path','1362124mXbhPW','riskLevel','4992180DLgVIE','map','number','Default\x20page\x20size','zh-CN','Auth\x20cookie','666459AHwkGY','Access\x20key','defaultFormat','toLowerCase','Config\x20key\x20(','92dnmcWa','en-US','343SOUucT','56CmlrRh','apiDir','format','join','app','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','168586lQYqGC','apps','29517ucDXKw','cookie','inherit','accessKey','string','5AOZWAL','keys','10410SHbxpg','length','has','8435328xCrtna','defaultApp','Target\x20environment','pageSize','locale'];a128_0x1e31=function(){return _0x5532ed;};return a128_0x1e31();}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=[a128_0x14ae3b(0x1ed),a128_0x14ae3b(0x1ef),'locale',a128_0x14ae3b(0x1e6),a128_0x14ae3b(0x1d5)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a128_0x14ae3b(0x1d1),'env',a128_0x14ae3b(0x1ce),'format',a128_0x14ae3b(0x1ed),'accessKey',a128_0x14ae3b(0x1e5)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x3ead25){const _0x36afea=a128_0x14ae3b;return[..._0x3ead25][_0x36afea(0x1e7)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x35cbf0){const _0x404de7=a128_0x14ae3b;return TOP_LEVEL_CONFIG_KEYS[_0x404de7(0x1f5)](_0x35cbf0);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x78b46b=a128_0x14ae3b;return _0x78b46b(0x1e0)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a128_0x14ae3b(0x1e5),'cookie':'cookie','accessKey':a128_0x14ae3b(0x1ef),'defaultFormat':a128_0x14ae3b(0x1e6),'pageSize':a128_0x14ae3b(0x1cd),'riskLevel':a128_0x14ae3b(0x1d5),'locale':a128_0x14ae3b(0x1ce)};export function getAppProfileFlagDefs(){const _0x3609df=a128_0x14ae3b;return[{'name':_0x3609df(0x1d2),'type':_0x3609df(0x1f0),'description':_0x3609df(0x1cc),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x3609df(0x1e5),'type':_0x3609df(0x1f0),'description':_0x3609df(0x1d3)},{'name':_0x3609df(0x1ed),'type':_0x3609df(0x1f0),'description':_0x3609df(0x1db),'hidden':!![]},{'name':_0x3609df(0x1ef),'type':_0x3609df(0x1f0),'description':_0x3609df(0x1dd),'hidden':!![]},{'name':_0x3609df(0x1de),'type':_0x3609df(0x1f0),'description':_0x3609df(0x1e9),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x3609df(0x1d8),'description':_0x3609df(0x1d9)},{'name':_0x3609df(0x1d5),'type':'string','description':'Risk\x20level','enum':[...RISK_LEVEL_VALUES]},{'name':_0x3609df(0x1ce),'type':'string','description':_0x3609df(0x1cf)}];}export function collectAppProfileOverrides(_0x182db6){const _0x51164b=a128_0x14ae3b,_0x361b62={};for(const [_0x4b1ef7,_0x1da4e5]of Object[_0x51164b(0x1d0)](APP_PROFILE_FLAG_KEY_MAP)){const _0x60ef1d=_0x182db6(_0x4b1ef7);if(!_0x60ef1d)continue;_0x361b62[_0x1da4e5]=_0x1da4e5===_0x51164b(0x1cd)?Number(_0x60ef1d):_0x60ef1d;}return _0x361b62;}export function buildAppProfileListFields(_0x30e727){const _0x24a943=a128_0x14ae3b;return{'env':_0x30e727[_0x24a943(0x1d2)]??null,'apiDir':_0x30e727['apiDir']??null,'hasCookie':!!_0x30e727[_0x24a943(0x1ed)],'hasAccessKey':!!_0x30e727[_0x24a943(0x1ef)],'format':_0x30e727[_0x24a943(0x1e6)]??null,'pageSize':_0x30e727[_0x24a943(0x1cd)]??null,'riskLevel':_0x30e727[_0x24a943(0x1d5)]??null,'locale':_0x30e727[_0x24a943(0x1ce)]??null};}export function buildAppDoctorFields(_0x1c365a,_0x4bc26d){const _0x1a4900=a128_0x14ae3b;return{'env':{'value':_0x1c365a[_0x1a4900(0x1d2)]||_0x4bc26d['env'],'source':_0x1c365a[_0x1a4900(0x1d2)]?_0x1a4900(0x1e8):'inherit'},'apiDir':{'value':_0x1c365a[_0x1a4900(0x1e5)]||_0x4bc26d[_0x1a4900(0x1e5)],'source':_0x1c365a['apiDir']?_0x1a4900(0x1e8):'inherit'},'cookie':{'value':_0x1c365a[_0x1a4900(0x1ed)]||_0x4bc26d[_0x1a4900(0x1ed)],'source':_0x1c365a['cookie']?_0x1a4900(0x1e8):_0x1a4900(0x1ee)},'accessKey':{'value':_0x1c365a[_0x1a4900(0x1ef)]||_0x4bc26d[_0x1a4900(0x1ef)],'source':_0x1c365a[_0x1a4900(0x1ef)]?_0x1a4900(0x1e8):_0x1a4900(0x1ee)}};}export function buildCanonicalAppConfig(_0x21a50f,_0x280108){const _0x1492f2=a128_0x14ae3b,_0x3d8917=_0x21a50f[_0x1492f2(0x1d7)](_0x263c36=>String(_0x263c36||'')['trim']())['filter'](Boolean);if(_0x3d8917[_0x1492f2(0x1f4)]===0x0)return{};const _0x3e35d1={};for(const _0x714f68 of _0x3d8917){_0x3e35d1[_0x714f68]=_0x280108?{'appcode':_0x714f68,'env':_0x280108}:{'appcode':_0x714f68};}return{'apps':_0x3e35d1,'defaultApp':_0x3d8917[0x0]};}export function buildCanonicalProjectConfig(_0x18772b,_0x3ecd81){const _0x12e187=a128_0x14ae3b,{appCodes:appCodes=[],env:_0x10b409,metadata:_0x2948f6}=_0x3ecd81,_0x47e84b={..._0x18772b,..._0x2948f6||{}};delete _0x47e84b['appcode'],delete _0x47e84b['app'];if(_0x10b409)_0x47e84b[_0x12e187(0x1d2)]=_0x10b409;else!_0x47e84b[_0x12e187(0x1d2)]&&(_0x47e84b[_0x12e187(0x1d2)]=DEFAULT_CONFIG_VALUES['env']);const _0x2d7c89=buildCanonicalAppConfig(appCodes,_0x47e84b[_0x12e187(0x1d2)]);return Object[_0x12e187(0x1f2)](_0x2d7c89)['length']>0x0&&(_0x47e84b[_0x12e187(0x1eb)]=_0x2d7c89[_0x12e187(0x1eb)],_0x47e84b[_0x12e187(0x1cb)]=_0x2d7c89[_0x12e187(0x1cb)]),_0x47e84b;}const LOCALE_MAP={'zh':a128_0x14ae3b(0x1da),'zh-cn':'zh-CN','zh_cn':'zh-CN','en':a128_0x14ae3b(0x1e2),'en-us':a128_0x14ae3b(0x1e2),'en_us':a128_0x14ae3b(0x1e2)};export function normalizeLocale(_0x2f080b){const _0x5dc9d9=a128_0x14ae3b;if(!_0x2f080b)return null;return LOCALE_MAP[_0x2f080b[_0x5dc9d9(0x1df)]()]??null;}
1
+ const a128_0x1cdcba=a128_0x5306;(function(_0x3f5596,_0x2c2984){const _0x761de9=a128_0x5306,_0x2d27a9=_0x3f5596();while(!![]){try{const _0x1059f7=-parseInt(_0x761de9(0x15c))/0x1+parseInt(_0x761de9(0x176))/0x2*(parseInt(_0x761de9(0x169))/0x3)+-parseInt(_0x761de9(0x17b))/0x4*(-parseInt(_0x761de9(0x15f))/0x5)+-parseInt(_0x761de9(0x165))/0x6*(-parseInt(_0x761de9(0x177))/0x7)+-parseInt(_0x761de9(0x166))/0x8+-parseInt(_0x761de9(0x162))/0x9+parseInt(_0x761de9(0x16f))/0xa;if(_0x1059f7===_0x2c2984)break;else _0x2d27a9['push'](_0x2d27a9['shift']());}catch(_0x598f40){_0x2d27a9['push'](_0x2d27a9['shift']());}}}(a128_0x2a6b,0x9d456));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=[a128_0x1cdcba(0x173),a128_0x1cdcba(0x17f),a128_0x1cdcba(0x15b),a128_0x1cdcba(0x161),a128_0x1cdcba(0x174)];export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode',a128_0x1cdcba(0x167),a128_0x1cdcba(0x15b),a128_0x1cdcba(0x161),a128_0x1cdcba(0x173),a128_0x1cdcba(0x17f),'apiDir']);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x15f0b4){const _0x59fd64=a128_0x1cdcba;return[..._0x15f0b4][_0x59fd64(0x179)](',\x20');}function a128_0x2a6b(){const _0x2c7c44=['1394520LMZilo','Default\x20page\x20size','pageSize','string','cookie','riskLevel','zh-CN','839660lyxncq','154bitDaz','apps','join','length','28QSzEdb','number','keys','filter','accessKey','API\x20directory\x20path','appcode','locale','951088IuxxvW','entries','Config\x20key\x20(','573395DTPdBo','Risk\x20level','format','3186603dpuYVK','Auth\x20cookie','apiDir','301734etqAlw','4152448BewhrS','env','Target\x20environment','3XtTDyi','inherit','en-US','has','defaultFormat','app'];a128_0x2a6b=function(){return _0x2c7c44;};return a128_0x2a6b();}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x3cfdfd){const _0x33e55d=a128_0x1cdcba;return TOP_LEVEL_CONFIG_KEYS[_0x33e55d(0x16c)](_0x3cfdfd);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x3926c4=a128_0x1cdcba;return _0x3926c4(0x15e)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':a128_0x1cdcba(0x167),'apiDir':a128_0x1cdcba(0x164),'cookie':a128_0x1cdcba(0x173),'accessKey':a128_0x1cdcba(0x17f),'defaultFormat':a128_0x1cdcba(0x161),'pageSize':a128_0x1cdcba(0x171),'riskLevel':a128_0x1cdcba(0x174),'locale':a128_0x1cdcba(0x15b)};export function getAppProfileFlagDefs(){const _0x584c63=a128_0x1cdcba;return[{'name':_0x584c63(0x167),'type':_0x584c63(0x172),'description':_0x584c63(0x168),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x584c63(0x164),'type':_0x584c63(0x172),'description':_0x584c63(0x180)},{'name':_0x584c63(0x173),'type':_0x584c63(0x172),'description':_0x584c63(0x163),'hidden':!![]},{'name':_0x584c63(0x17f),'type':_0x584c63(0x172),'description':'Access\x20key','hidden':!![]},{'name':_0x584c63(0x16d),'type':_0x584c63(0x172),'description':'Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x584c63(0x171),'type':_0x584c63(0x17c),'description':_0x584c63(0x170)},{'name':'riskLevel','type':_0x584c63(0x172),'description':_0x584c63(0x160),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x584c63(0x15b),'type':_0x584c63(0x172),'description':'Locale'}];}export function collectAppProfileOverrides(_0x9b3c47){const _0x559558=a128_0x1cdcba,_0x13c507={};for(const [_0x16a35b,_0x30072c]of Object[_0x559558(0x15d)](APP_PROFILE_FLAG_KEY_MAP)){const _0x56929c=_0x9b3c47(_0x16a35b);if(!_0x56929c)continue;_0x13c507[_0x30072c]=_0x30072c==='pageSize'?Number(_0x56929c):_0x56929c;}return _0x13c507;}function a128_0x5306(_0x5e3cfe,_0x4ff1bf){_0x5e3cfe=_0x5e3cfe-0x15a;const _0x2a6b1a=a128_0x2a6b();let _0x53060c=_0x2a6b1a[_0x5e3cfe];return _0x53060c;}export function buildAppProfileListFields(_0x46d73b){const _0x1b6b0b=a128_0x1cdcba;return{'env':_0x46d73b['env']??null,'apiDir':_0x46d73b[_0x1b6b0b(0x164)]??null,'hasCookie':!!_0x46d73b['cookie'],'hasAccessKey':!!_0x46d73b[_0x1b6b0b(0x17f)],'format':_0x46d73b[_0x1b6b0b(0x161)]??null,'pageSize':_0x46d73b[_0x1b6b0b(0x171)]??null,'riskLevel':_0x46d73b[_0x1b6b0b(0x174)]??null,'locale':_0x46d73b[_0x1b6b0b(0x15b)]??null};}export function buildAppDoctorFields(_0x5b9d72,_0x14ca79){const _0x169ef6=a128_0x1cdcba;return{'env':{'value':_0x5b9d72[_0x169ef6(0x167)]||_0x14ca79[_0x169ef6(0x167)],'source':_0x5b9d72[_0x169ef6(0x167)]?_0x169ef6(0x16e):'inherit'},'apiDir':{'value':_0x5b9d72[_0x169ef6(0x164)]||_0x14ca79[_0x169ef6(0x164)],'source':_0x5b9d72[_0x169ef6(0x164)]?'app':_0x169ef6(0x16a)},'cookie':{'value':_0x5b9d72[_0x169ef6(0x173)]||_0x14ca79['cookie'],'source':_0x5b9d72[_0x169ef6(0x173)]?_0x169ef6(0x16e):_0x169ef6(0x16a)},'accessKey':{'value':_0x5b9d72[_0x169ef6(0x17f)]||_0x14ca79[_0x169ef6(0x17f)],'source':_0x5b9d72['accessKey']?_0x169ef6(0x16e):_0x169ef6(0x16a)}};}export function buildCanonicalAppConfig(_0x5efc79,_0x2c554a){const _0x4651c4=a128_0x1cdcba,_0x557bca=_0x5efc79['map'](_0x6ebe7a=>String(_0x6ebe7a||'')['trim']())[_0x4651c4(0x17e)](Boolean);if(_0x557bca[_0x4651c4(0x17a)]===0x0)return{};const _0x1ed255={};for(const _0x135fdf of _0x557bca){_0x1ed255[_0x135fdf]=_0x2c554a?{'appcode':_0x135fdf,'env':_0x2c554a}:{'appcode':_0x135fdf};}return{'apps':_0x1ed255,'defaultApp':_0x557bca[0x0]};}export function buildCanonicalProjectConfig(_0x452f0e,_0x387ff4){const _0x353d8d=a128_0x1cdcba,{appCodes:appCodes=[],env:_0x5555dc,metadata:_0x51a9c3}=_0x387ff4,_0x2c78b8={..._0x452f0e,..._0x51a9c3||{}};delete _0x2c78b8[_0x353d8d(0x15a)],delete _0x2c78b8['app'];if(_0x5555dc)_0x2c78b8[_0x353d8d(0x167)]=_0x5555dc;else!_0x2c78b8[_0x353d8d(0x167)]&&(_0x2c78b8[_0x353d8d(0x167)]=DEFAULT_CONFIG_VALUES[_0x353d8d(0x167)]);const _0x595888=buildCanonicalAppConfig(appCodes,_0x2c78b8[_0x353d8d(0x167)]);return Object[_0x353d8d(0x17d)](_0x595888)[_0x353d8d(0x17a)]>0x0&&(_0x2c78b8[_0x353d8d(0x178)]=_0x595888['apps'],_0x2c78b8['defaultApp']=_0x595888['defaultApp']),_0x2c78b8;}const LOCALE_MAP={'zh':a128_0x1cdcba(0x175),'zh-cn':'zh-CN','zh_cn':a128_0x1cdcba(0x175),'en':a128_0x1cdcba(0x16b),'en-us':a128_0x1cdcba(0x16b),'en_us':a128_0x1cdcba(0x16b)};export function normalizeLocale(_0x1f9f7e){if(!_0x1f9f7e)return null;return LOCALE_MAP[_0x1f9f7e['toLowerCase']()]??null;}
@@ -1 +1 @@
1
- const a129_0x504776=a129_0x370c;function a129_0x1bd5(){const _0x4cfb81=['9PUnqdb','1212680tLsOBy','3946280ovRawD','68788LDsThi','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','206zTvtrc','2604qELZcF','135780CYkZyw','63917EoXfHE','938916kKsWnz'];a129_0x1bd5=function(){return _0x4cfb81;};return a129_0x1bd5();}(function(_0x3d5716,_0x429c3a){const _0x4ead39=a129_0x370c,_0x33f992=_0x3d5716();while(!![]){try{const _0x3b724d=parseInt(_0x4ead39(0x16e))/0x1+parseInt(_0x4ead39(0x170))/0x2*(parseInt(_0x4ead39(0x167))/0x3)+parseInt(_0x4ead39(0x16a))/0x4+parseInt(_0x4ead39(0x16c))/0x5+parseInt(_0x4ead39(0x168))/0x6+parseInt(_0x4ead39(0x169))/0x7+-parseInt(_0x4ead39(0x16d))/0x8*(parseInt(_0x4ead39(0x16b))/0x9);if(_0x3b724d===_0x429c3a)break;else _0x33f992['push'](_0x33f992['shift']());}catch(_0x50a338){_0x33f992['push'](_0x33f992['shift']());}}}(a129_0x1bd5,0x2a76d));function a129_0x370c(_0x1ac912,_0x245212){_0x1ac912=_0x1ac912-0x167;const _0x1bd5a8=a129_0x1bd5();let _0x370ccf=_0x1bd5a8[_0x1ac912];return _0x370ccf;}export const CLI_VERSION_POLICY_URL=a129_0x504776(0x16f);
1
+ const a129_0xe9f575=a129_0x5ad8;function a129_0x2fef(){const _0x269eb2=['7TygHsr','174350WfcvQD','5704110DrHqzP','1088764LuplXW','https://g.lovrabet.com/dist/rabetbase-cli/config/index.json','306445ghJfQo','10TmmeYI','219uyLfBy','259000AHZmLb','25934xRmqcE','2592972cXftVm'];a129_0x2fef=function(){return _0x269eb2;};return a129_0x2fef();}function a129_0x5ad8(_0x54a40a,_0x45e438){_0x54a40a=_0x54a40a-0x1b6;const _0x2feff6=a129_0x2fef();let _0x5ad8ca=_0x2feff6[_0x54a40a];return _0x5ad8ca;}(function(_0x502a1e,_0xbfe8b6){const _0x4e4677=a129_0x5ad8,_0x123dde=_0x502a1e();while(!![]){try{const _0x4b3c25=parseInt(_0x4e4677(0x1bf))/0x1+parseInt(_0x4e4677(0x1b8))/0x2*(parseInt(_0x4e4677(0x1b6))/0x3)+parseInt(_0x4e4677(0x1bd))/0x4*(-parseInt(_0x4e4677(0x1c0))/0x5)+parseInt(_0x4e4677(0x1b9))/0x6+parseInt(_0x4e4677(0x1ba))/0x7*(parseInt(_0x4e4677(0x1b7))/0x8)+-parseInt(_0x4e4677(0x1bc))/0x9+-parseInt(_0x4e4677(0x1bb))/0xa;if(_0x4b3c25===_0xbfe8b6)break;else _0x123dde['push'](_0x123dde['shift']());}catch(_0xbc538a){_0x123dde['push'](_0x123dde['shift']());}}}(a129_0x2fef,0x7f6ee));export const CLI_VERSION_POLICY_URL=a129_0xe9f575(0x1be);
@@ -1 +1 @@
1
- const a130_0x28a82e=a130_0x31c3;(function(_0x4337d5,_0x35a275){const _0x571b05=a130_0x31c3,_0x34d23c=_0x4337d5();while(!![]){try{const _0x312a5c=-parseInt(_0x571b05(0x12f))/0x1+parseInt(_0x571b05(0x15e))/0x2+-parseInt(_0x571b05(0x155))/0x3+parseInt(_0x571b05(0x188))/0x4*(-parseInt(_0x571b05(0x174))/0x5)+-parseInt(_0x571b05(0x17d))/0x6+-parseInt(_0x571b05(0x178))/0x7+parseInt(_0x571b05(0x148))/0x8;if(_0x312a5c===_0x35a275)break;else _0x34d23c['push'](_0x34d23c['shift']());}catch(_0x16d859){_0x34d23c['push'](_0x34d23c['shift']());}}}(a130_0x315f,0x28df7));export const CLI_BIN_NAME=a130_0x28a82e(0x127);export const CLI_DISPLAY_NAME=a130_0x28a82e(0x12e);export const NPM_PACKAGE_NAME=a130_0x28a82e(0x14f);export const GLOBAL_FLAGS=[{'name':a130_0x28a82e(0x182),'meowKey':a130_0x28a82e(0x182),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x14e),'hint':a130_0x28a82e(0x184)},{'name':a130_0x28a82e(0x172),'meowKey':a130_0x28a82e(0x172),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x12d),'hint':'<name>'},{'name':'env','meowKey':'env','type':a130_0x28a82e(0x167),'description':'Environment','hint':a130_0x28a82e(0x15f)},{'name':'format','meowKey':'format','type':a130_0x28a82e(0x167),'description':'Output\x20format','hint':a130_0x28a82e(0x149)},{'name':'jq','meowKey':'jq','type':'string','description':a130_0x28a82e(0x12b),'hint':a130_0x28a82e(0x173)},{'name':a130_0x28a82e(0x134),'meowKey':'dryRun','type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x16e)},{'name':a130_0x28a82e(0x16d),'meowKey':a130_0x28a82e(0x16d),'type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x151)},{'name':a130_0x28a82e(0x170),'meowKey':a130_0x28a82e(0x17c),'type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x179)},{'name':a130_0x28a82e(0x13e),'meowKey':a130_0x28a82e(0x13e),'type':'boolean','description':a130_0x28a82e(0x145)},{'name':a130_0x28a82e(0x17e),'meowKey':a130_0x28a82e(0x17e),'type':a130_0x28a82e(0x126),'description':'Use\x20project\x20config\x20scope'},{'name':'ci','meowKey':'ci','type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x128),'hidden':!![]},{'name':'help','meowKey':a130_0x28a82e(0x166),'type':'boolean','description':a130_0x28a82e(0x168)},{'name':'name','meowKey':a130_0x28a82e(0x157),'type':'string','description':'Name','hidden':!![]},{'name':a130_0x28a82e(0x13a),'meowKey':a130_0x28a82e(0x13a),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x138),'hidden':!![]},{'name':'clear','meowKey':'clear','type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x130),'hidden':!![]},{'name':'watch','meowKey':a130_0x28a82e(0x163),'type':'boolean','description':a130_0x28a82e(0x171),'hidden':!![]},{'name':a130_0x28a82e(0x131),'meowKey':'output','type':a130_0x28a82e(0x167),'description':'Output\x20path','hidden':!![]},{'name':a130_0x28a82e(0x15b),'meowKey':a130_0x28a82e(0x15b),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x18b),'hidden':!![]},{'name':a130_0x28a82e(0x13c),'meowKey':'datasetcode','type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x140),'hidden':!![]},{'name':a130_0x28a82e(0x175),'meowKey':a130_0x28a82e(0x175),'type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x152),'hidden':!![]},{'name':a130_0x28a82e(0x164),'meowKey':'enableBffSave','type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x12c),'hidden':!![]},{'name':'id','meowKey':'id','type':'string','description':a130_0x28a82e(0x183),'hidden':!![]},{'name':'type','meowKey':'type','type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x132),'hidden':!![]},{'name':a130_0x28a82e(0x14b),'meowKey':a130_0x28a82e(0x14b),'type':a130_0x28a82e(0x167),'description':'File\x20path','hidden':!![]},{'name':a130_0x28a82e(0x18d),'meowKey':'sqlcode','type':a130_0x28a82e(0x167),'description':'SQL\x20code','hidden':!![]},{'name':a130_0x28a82e(0x146),'meowKey':a130_0x28a82e(0x181),'type':'string','description':a130_0x28a82e(0x17b),'hidden':!![]},{'name':'sqlname','meowKey':a130_0x28a82e(0x137),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x17b),'hidden':!![]},{'name':a130_0x28a82e(0x187),'meowKey':a130_0x28a82e(0x162),'type':a130_0x28a82e(0x167),'description':'DB\x20ID','hidden':!![]},{'name':a130_0x28a82e(0x154),'meowKey':a130_0x28a82e(0x154),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x17a),'hidden':!![]},{'name':a130_0x28a82e(0x16a),'meowKey':a130_0x28a82e(0x16a),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x15a),'hidden':!![]},{'name':a130_0x28a82e(0x186),'meowKey':'descriptionFile','type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x18e),'hidden':!![]},{'name':a130_0x28a82e(0x158),'meowKey':a130_0x28a82e(0x158),'type':'string','description':a130_0x28a82e(0x133),'hidden':!![]},{'name':'pagesize','meowKey':a130_0x28a82e(0x13b),'type':a130_0x28a82e(0x167),'description':'Page\x20size','hidden':!![]},{'name':a130_0x28a82e(0x142),'meowKey':a130_0x28a82e(0x142),'type':'string','description':a130_0x28a82e(0x150),'hidden':!![]},{'name':a130_0x28a82e(0x16b),'meowKey':a130_0x28a82e(0x16b),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x153),'hidden':!![]},{'name':a130_0x28a82e(0x17f),'meowKey':a130_0x28a82e(0x17f),'type':a130_0x28a82e(0x167),'description':'SQL\x20string','hidden':!![]},{'name':a130_0x28a82e(0x15d),'meowKey':a130_0x28a82e(0x15d),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x169),'hidden':!![]},{'name':'operation','meowKey':a130_0x28a82e(0x176),'type':a130_0x28a82e(0x167),'description':'Operation\x20type','hidden':!![]},{'name':a130_0x28a82e(0x14c),'meowKey':a130_0x28a82e(0x14c),'type':'string','description':'Target\x20path','hidden':!![]},{'name':a130_0x28a82e(0x16f),'meowKey':a130_0x28a82e(0x159),'type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x147),'hidden':!![]},{'name':a130_0x28a82e(0x13f),'meowKey':'key','type':'string','description':a130_0x28a82e(0x12a),'hidden':!![]},{'name':a130_0x28a82e(0x165),'meowKey':'value','type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x14d),'hidden':!![]},{'name':a130_0x28a82e(0x129),'meowKey':a130_0x28a82e(0x129),'type':'boolean','description':a130_0x28a82e(0x16c),'hidden':!![]},{'name':a130_0x28a82e(0x136),'meowKey':a130_0x28a82e(0x136),'type':a130_0x28a82e(0x126),'description':'Confirm\x20destructive\x20action','hidden':!![]},{'name':a130_0x28a82e(0x18c),'meowKey':a130_0x28a82e(0x18c),'type':'boolean','description':a130_0x28a82e(0x177),'hidden':!![]},{'name':a130_0x28a82e(0x161),'meowKey':'verbose','type':a130_0x28a82e(0x126),'description':a130_0x28a82e(0x141),'hidden':!![]},{'name':a130_0x28a82e(0x180),'meowKey':a130_0x28a82e(0x15c),'type':a130_0x28a82e(0x167),'description':'Expected\x20affected\x20count','hidden':!![]},{'name':a130_0x28a82e(0x14a),'meowKey':'operationType','type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x156),'hidden':!![]},{'name':a130_0x28a82e(0x135),'meowKey':a130_0x28a82e(0x189),'type':a130_0x28a82e(0x167),'description':a130_0x28a82e(0x139),'hidden':!![]}];function a130_0x31c3(_0xa77ec8,_0x318efb){_0xa77ec8=_0xa77ec8-0x126;const _0x315f2e=a130_0x315f();let _0x31c3ec=_0x315f2e[_0xa77ec8];return _0x31c3ec;}export const PIPELINE_FLAG_NAMES=new Set([a130_0x28a82e(0x182),a130_0x28a82e(0x172),a130_0x28a82e(0x18a),a130_0x28a82e(0x143),'jq',a130_0x28a82e(0x134),a130_0x28a82e(0x16d),a130_0x28a82e(0x170),'ci']);function a130_0x315f(){const _0x49391b=['Type\x20filter','Page\x20number','dry-run','function-node','confirm','sqlname','Title','Function\x20node','title','pagesize','datasetcode','type','global','key','Dataset\x20code','Verbose\x20output','keyword','format','fromEntries','Use\x20global\x20config\x20scope','sql-name','Skip\x20import\x20generation','8664288XUxJNb','json\x20|\x20pretty\x20|\x20compress','operation-type','file','target','Config\x20value','Override\x20appcode','@lovrabet/rabetbase-cli','Keyword\x20filter','Skip\x20confirmation\x20for\x20high-risk\x20writes','Apply\x20to\x20all','Code\x20filter','dbid','578643BDxzGc','Operation\x20type','name','page','skipImports','Description','params','expectedCount','schemas','337352AuysJm','production\x20|\x20daily','map','verbose','dbId','watch','enable-bff-save','value','help','string','Show\x20help','Schemas','description','code','Force\x20overwrite','yes','Preview\x20operation\x20without\x20executing','skip-imports','non-interactive','Watch\x20mode','app','<expr>','315oCiuhe','all','operation','Use\x20remote','1499050uiCSfn','Force\x20non-interactive\x20mode\x20(CI)','DB\x20ID','SQL\x20name','nonInteractive','382230oGTGIG','project','sql','expected-count','sqlName','appcode','Record\x20ID','<code>','meowKey','description-file','db-id','17772myAjmy','functionNode','env','JSON\x20params','remote','sqlcode','Description\x20file','boolean','rabetbase','Alias\x20for\x20--non-interactive','force','Config\x20key','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','Enable\x20BFF\x20save','Select\x20app\x20profile\x20by\x20name','Rabetbase\x20CLI','333652MWDNzu','Clear','output'];a130_0x315f=function(){return _0x49391b;};return a130_0x315f();}export function buildMeowFlags(){const _0x1d9832=a130_0x28a82e;return Object[_0x1d9832(0x144)](GLOBAL_FLAGS[_0x1d9832(0x160)](_0x45d3c0=>[_0x45d3c0[_0x1d9832(0x185)],{'type':_0x45d3c0[_0x1d9832(0x13d)]}]));}
1
+ const a130_0x32db95=a130_0x532e;function a130_0x532e(_0x2b73a4,_0x588fdb){_0x2b73a4=_0x2b73a4-0x162;const _0x13995c=a130_0x1399();let _0x532e18=_0x13995c[_0x2b73a4];return _0x532e18;}(function(_0x7ead89,_0x58f53e){const _0xff3728=a130_0x532e,_0x1eb5dc=_0x7ead89();while(!![]){try{const _0x32ea19=parseInt(_0xff3728(0x1bf))/0x1+parseInt(_0xff3728(0x163))/0x2+parseInt(_0xff3728(0x16e))/0x3*(-parseInt(_0xff3728(0x172))/0x4)+parseInt(_0xff3728(0x1bc))/0x5*(-parseInt(_0xff3728(0x18d))/0x6)+parseInt(_0xff3728(0x171))/0x7*(-parseInt(_0xff3728(0x1a4))/0x8)+parseInt(_0xff3728(0x19b))/0x9+-parseInt(_0xff3728(0x1b2))/0xa*(-parseInt(_0xff3728(0x1c5))/0xb);if(_0x32ea19===_0x58f53e)break;else _0x1eb5dc['push'](_0x1eb5dc['shift']());}catch(_0x9687b7){_0x1eb5dc['push'](_0x1eb5dc['shift']());}}}(a130_0x1399,0x248b1));export const CLI_BIN_NAME=a130_0x32db95(0x1bd);export const CLI_DISPLAY_NAME=a130_0x32db95(0x1a9);export const NPM_PACKAGE_NAME=a130_0x32db95(0x187);export const GLOBAL_FLAGS=[{'name':a130_0x32db95(0x1a3),'meowKey':a130_0x32db95(0x1a3),'type':'string','description':'Override\x20appcode','hint':'<code>'},{'name':a130_0x32db95(0x1cb),'meowKey':a130_0x32db95(0x1cb),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a130_0x32db95(0x199)},{'name':a130_0x32db95(0x1ba),'meowKey':a130_0x32db95(0x1ba),'type':'string','description':a130_0x32db95(0x1bb),'hint':a130_0x32db95(0x18a)},{'name':a130_0x32db95(0x181),'meowKey':'format','type':'string','description':'Output\x20format','hint':a130_0x32db95(0x196)},{'name':'jq','meowKey':'jq','type':a130_0x32db95(0x186),'description':a130_0x32db95(0x18f),'hint':a130_0x32db95(0x1c4)},{'name':a130_0x32db95(0x166),'meowKey':a130_0x32db95(0x1c2),'type':'boolean','description':a130_0x32db95(0x193)},{'name':a130_0x32db95(0x195),'meowKey':a130_0x32db95(0x195),'type':'boolean','description':a130_0x32db95(0x19c)},{'name':a130_0x32db95(0x179),'meowKey':a130_0x32db95(0x1b5),'type':a130_0x32db95(0x1b3),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':'global','type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x177)},{'name':'project','meowKey':a130_0x32db95(0x169),'type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x168)},{'name':'ci','meowKey':'ci','type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x17d),'hidden':!![]},{'name':'help','meowKey':a130_0x32db95(0x1a5),'type':'boolean','description':'Show\x20help'},{'name':a130_0x32db95(0x16a),'meowKey':a130_0x32db95(0x16a),'type':'string','description':a130_0x32db95(0x19f),'hidden':!![]},{'name':'title','meowKey':'title','type':'string','description':a130_0x32db95(0x182),'hidden':!![]},{'name':a130_0x32db95(0x17b),'meowKey':'clear','type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x1ad),'hidden':!![]},{'name':a130_0x32db95(0x1b6),'meowKey':a130_0x32db95(0x1b6),'type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x1c3),'hidden':!![]},{'name':'output','meowKey':a130_0x32db95(0x165),'type':'string','description':'Output\x20path','hidden':!![]},{'name':'params','meowKey':a130_0x32db95(0x19e),'type':a130_0x32db95(0x186),'description':'JSON\x20params','hidden':!![]},{'name':a130_0x32db95(0x174),'meowKey':a130_0x32db95(0x174),'type':a130_0x32db95(0x186),'description':'Dataset\x20code','hidden':!![]},{'name':a130_0x32db95(0x185),'meowKey':'all','type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x1af),'hidden':!![]},{'name':'enable-bff-save','meowKey':a130_0x32db95(0x188),'type':'boolean','description':a130_0x32db95(0x18b),'hidden':!![]},{'name':'id','meowKey':'id','type':a130_0x32db95(0x186),'description':a130_0x32db95(0x17a),'hidden':!![]},{'name':a130_0x32db95(0x164),'meowKey':'type','type':a130_0x32db95(0x186),'description':a130_0x32db95(0x180),'hidden':!![]},{'name':a130_0x32db95(0x1ca),'meowKey':'file','type':a130_0x32db95(0x186),'description':a130_0x32db95(0x176),'hidden':!![]},{'name':'sqlcode','meowKey':a130_0x32db95(0x1b4),'type':'string','description':'SQL\x20code','hidden':!![]},{'name':a130_0x32db95(0x16b),'meowKey':a130_0x32db95(0x1ab),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x17c),'hidden':!![]},{'name':a130_0x32db95(0x162),'meowKey':a130_0x32db95(0x162),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x17c),'hidden':!![]},{'name':a130_0x32db95(0x184),'meowKey':'dbId','type':a130_0x32db95(0x186),'description':'DB\x20ID','hidden':!![]},{'name':'dbid','meowKey':a130_0x32db95(0x17e),'type':a130_0x32db95(0x186),'description':'DB\x20ID','hidden':!![]},{'name':a130_0x32db95(0x1aa),'meowKey':a130_0x32db95(0x1aa),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x178),'hidden':!![]},{'name':a130_0x32db95(0x189),'meowKey':'descriptionFile','type':a130_0x32db95(0x186),'description':'Description\x20file','hidden':!![]},{'name':a130_0x32db95(0x1c0),'meowKey':a130_0x32db95(0x1c0),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x192),'hidden':!![]},{'name':'pagesize','meowKey':a130_0x32db95(0x18e),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x198),'hidden':!![]},{'name':a130_0x32db95(0x18c),'meowKey':a130_0x32db95(0x18c),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x1b0),'hidden':!![]},{'name':'code','meowKey':a130_0x32db95(0x1b1),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x1ac),'hidden':!![]},{'name':a130_0x32db95(0x19a),'meowKey':a130_0x32db95(0x19a),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x167),'hidden':!![]},{'name':a130_0x32db95(0x183),'meowKey':'schemas','type':a130_0x32db95(0x186),'description':'Schemas','hidden':!![]},{'name':'operation','meowKey':a130_0x32db95(0x173),'type':a130_0x32db95(0x186),'description':'Operation\x20type','hidden':!![]},{'name':'target','meowKey':a130_0x32db95(0x1b8),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x1a0),'hidden':!![]},{'name':a130_0x32db95(0x1ae),'meowKey':a130_0x32db95(0x16d),'type':'boolean','description':a130_0x32db95(0x175),'hidden':!![]},{'name':'key','meowKey':a130_0x32db95(0x1a1),'type':'string','description':a130_0x32db95(0x17f),'hidden':!![]},{'name':a130_0x32db95(0x170),'meowKey':a130_0x32db95(0x170),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x16c),'hidden':!![]},{'name':a130_0x32db95(0x191),'meowKey':a130_0x32db95(0x191),'type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x1c8),'hidden':!![]},{'name':'confirm','meowKey':a130_0x32db95(0x1c9),'type':a130_0x32db95(0x1b3),'description':a130_0x32db95(0x1a6),'hidden':!![]},{'name':'remote','meowKey':a130_0x32db95(0x197),'type':a130_0x32db95(0x1b3),'description':'Use\x20remote','hidden':!![]},{'name':a130_0x32db95(0x190),'meowKey':a130_0x32db95(0x190),'type':a130_0x32db95(0x1b3),'description':'Verbose\x20output','hidden':!![]},{'name':a130_0x32db95(0x194),'meowKey':a130_0x32db95(0x16f),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x1b7),'hidden':!![]},{'name':a130_0x32db95(0x1a8),'meowKey':a130_0x32db95(0x1b9),'type':'string','description':a130_0x32db95(0x1a2),'hidden':!![]},{'name':a130_0x32db95(0x1c1),'meowKey':a130_0x32db95(0x1c6),'type':a130_0x32db95(0x186),'description':a130_0x32db95(0x19d),'hidden':!![]}];function a130_0x1399(){const _0xde954b=['<expr>','77nHtlFp','functionNode','map','Force\x20overwrite','confirm','file','app','sqlname','213702VPFOgz','type','output','dry-run','SQL\x20string','Use\x20project\x20config\x20scope','project','name','sql-name','Config\x20value','skipImports','2730kcdFyn','expectedCount','value','28ufZxtL','532ynkoHN','operation','datasetcode','Skip\x20import\x20generation','File\x20path','Use\x20global\x20config\x20scope','Description','non-interactive','Record\x20ID','clear','SQL\x20name','Alias\x20for\x20--non-interactive','dbid','Config\x20key','Type\x20filter','format','Title','schemas','db-id','all','string','@lovrabet/rabetbase-cli','enableBffSave','description-file','production\x20|\x20daily','Enable\x20BFF\x20save','keyword','78MUocrO','pagesize','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','verbose','force','Page\x20number','Preview\x20operation\x20without\x20executing','expected-count','yes','json\x20|\x20pretty\x20|\x20compress','remote','Page\x20size','<name>','sql','327699FXRBXe','Skip\x20confirmation\x20for\x20high-risk\x20writes','Function\x20node','params','Name','Target\x20path','key','Operation\x20type','appcode','578192bDuskB','help','Confirm\x20destructive\x20action','fromEntries','operation-type','Rabetbase\x20CLI','description','sqlName','Code\x20filter','Clear','skip-imports','Apply\x20to\x20all','Keyword\x20filter','code','373870QljXRh','boolean','sqlcode','nonInteractive','watch','Expected\x20affected\x20count','target','operationType','env','Environment','17695RBacQO','rabetbase','meowKey','200843WGaRvo','page','function-node','dryRun','Watch\x20mode'];a130_0x1399=function(){return _0xde954b;};return a130_0x1399();}export const PIPELINE_FLAG_NAMES=new Set(['appcode',a130_0x32db95(0x1cb),'env','format','jq',a130_0x32db95(0x166),a130_0x32db95(0x195),a130_0x32db95(0x179),'ci']);export function buildMeowFlags(){const _0x384698=a130_0x32db95;return Object[_0x384698(0x1a7)](GLOBAL_FLAGS[_0x384698(0x1c7)](_0x42335=>[_0x42335[_0x384698(0x1be)],{'type':_0x42335[_0x384698(0x164)]}]));}
@@ -1 +1 @@
1
- function a131_0x5136(_0x10e4d5,_0x5258bf){_0x10e4d5=_0x10e4d5-0xd6;const _0x1778ee=a131_0x1778();let _0x5136b8=_0x1778ee[_0x10e4d5];return _0x5136b8;}const a131_0x1756df=a131_0x5136;(function(_0x54682c,_0xfc96d1){const _0x317ed5=a131_0x5136,_0x23aabb=_0x54682c();while(!![]){try{const _0x1d25eb=parseInt(_0x317ed5(0xe2))/0x1+parseInt(_0x317ed5(0xdc))/0x2+parseInt(_0x317ed5(0xd8))/0x3*(parseInt(_0x317ed5(0xdd))/0x4)+parseInt(_0x317ed5(0xdb))/0x5+parseInt(_0x317ed5(0xe0))/0x6+-parseInt(_0x317ed5(0xd6))/0x7*(parseInt(_0x317ed5(0xde))/0x8)+-parseInt(_0x317ed5(0xd9))/0x9;if(_0x1d25eb===_0xfc96d1)break;else _0x23aabb['push'](_0x23aabb['shift']());}catch(_0x296784){_0x23aabb['push'](_0x23aabb['shift']());}}}(a131_0x1778,0xe75a0));import{DEFAULT_API_DIR}from'../constant/paths.js';export const DEFAULT_CONFIG_VALUES={'env':a131_0x1756df(0xda),'format':'compress','locale':a131_0x1756df(0xe1),'riskLevel':a131_0x1756df(0xdf),'apiDir':DEFAULT_API_DIR};function a131_0x1778(){const _0xac1b42=['132ALfurR','641464qrCcAc','high-risk-write','7258926WjcwXF','en-US','960579WqsTRu','35GeKttA','compress','60393rzMFdY','41203530bWrszS','production','7447345YLQSCo','3205018YCOOeC'];a131_0x1778=function(){return _0xac1b42;};return a131_0x1778();}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a131_0x1756df(0xd7);
1
+ const a131_0x15252a=a131_0x1896;(function(_0x55d100,_0x2d747d){const _0x1cf92d=a131_0x1896,_0x13c293=_0x55d100();while(!![]){try{const _0x14b8ec=parseInt(_0x1cf92d(0x108))/0x1*(-parseInt(_0x1cf92d(0x101))/0x2)+-parseInt(_0x1cf92d(0x102))/0x3+parseInt(_0x1cf92d(0x106))/0x4*(-parseInt(_0x1cf92d(0xfd))/0x5)+parseInt(_0x1cf92d(0x107))/0x6*(-parseInt(_0x1cf92d(0x104))/0x7)+parseInt(_0x1cf92d(0x109))/0x8+parseInt(_0x1cf92d(0x105))/0x9+parseInt(_0x1cf92d(0xff))/0xa;if(_0x14b8ec===_0x2d747d)break;else _0x13c293['push'](_0x13c293['shift']());}catch(_0x216f56){_0x13c293['push'](_0x13c293['shift']());}}}(a131_0x3bf6,0x205fa));function a131_0x3bf6(){const _0x3d1d2b=['1645rWivYz','1326672ucjBDx','772XbvZlK','1572XSOluX','1AeQcFc','857408XGomLJ','production','5IhhScL','high-risk-write','3219360qMOMpN','compress','470248UxobDc','441093xkiaIM','en-US'];a131_0x3bf6=function(){return _0x3d1d2b;};return a131_0x3bf6();}import{DEFAULT_API_DIR}from'../constant/paths.js';function a131_0x1896(_0x375fd1,_0x204b7a){_0x375fd1=_0x375fd1-0xfc;const _0x3bf634=a131_0x3bf6();let _0x18963d=_0x3bf634[_0x375fd1];return _0x18963d;}export const DEFAULT_CONFIG_VALUES={'env':a131_0x15252a(0xfc),'format':'compress','locale':a131_0x15252a(0x103),'riskLevel':a131_0x15252a(0xfe),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a131_0x15252a(0x100);
@@ -1 +1 @@
1
- function a132_0x1d24(){const _0x504a4e=['3147102kVdBWT','924220EfSCdn','https://daily-runtime.lovrabet.com','1136448fSuzJx','userDomain','https://user.lovrabet.com','apiDomain','https://daily-api.lovrabet.com','28PeWmCl','30155QiYQFr','https://user-daily.lovrabet.com','412209IckLdG','3139284cCXABp','22414560UbBqaS','144OjIRmy','runtimeDomain','124YINiAg'];a132_0x1d24=function(){return _0x504a4e;};return a132_0x1d24();}const a132_0x215431=a132_0x33fa;(function(_0x1b14fd,_0x2b459f){const _0x173da8=a132_0x33fa,_0x36cde9=_0x1b14fd();while(!![]){try{const _0x194959=-parseInt(_0x173da8(0x7b))/0x1+-parseInt(_0x173da8(0x75))/0x2+parseInt(_0x173da8(0x7a))/0x3+parseInt(_0x173da8(0x79))/0x4*(parseInt(_0x173da8(0x83))/0x5)+-parseInt(_0x173da8(0x7d))/0x6*(-parseInt(_0x173da8(0x82))/0x7)+-parseInt(_0x173da8(0x77))/0x8*(parseInt(_0x173da8(0x85))/0x9)+parseInt(_0x173da8(0x76))/0xa;if(_0x194959===_0x2b459f)break;else _0x36cde9['push'](_0x36cde9['shift']());}catch(_0x5bdb3d){_0x36cde9['push'](_0x36cde9['shift']());}}}(a132_0x1d24,0xdfd43));function a132_0x33fa(_0x4e058c,_0x436bf9){_0x4e058c=_0x4e058c-0x75;const _0x1d24a4=a132_0x1d24();let _0x33fae1=_0x1d24a4[_0x4e058c];return _0x33fae1;}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x1c9d1f){const _0x4d83d9=a132_0x33fa;customApiDomain=_0x1c9d1f?.[_0x4d83d9(0x80)],customUserDomain=_0x1c9d1f?.[_0x4d83d9(0x7e)],customRuntimeDomain=_0x1c9d1f?.[_0x4d83d9(0x78)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a132_0x215431(0x7f):a132_0x215431(0x84));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a132_0x215431(0x81));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?'https://runtime.lovrabet.com':a132_0x215431(0x7c));
1
+ const a132_0x30ccbf=a132_0x1305;(function(_0x4a2cea,_0x320e22){const _0x6b913=a132_0x1305,_0x30dff5=_0x4a2cea();while(!![]){try{const _0x143c91=parseInt(_0x6b913(0x99))/0x1+parseInt(_0x6b913(0x8c))/0x2*(parseInt(_0x6b913(0x97))/0x3)+parseInt(_0x6b913(0x8a))/0x4*(-parseInt(_0x6b913(0x95))/0x5)+parseInt(_0x6b913(0x8d))/0x6*(-parseInt(_0x6b913(0x8b))/0x7)+-parseInt(_0x6b913(0x98))/0x8+-parseInt(_0x6b913(0x9c))/0x9*(parseInt(_0x6b913(0x91))/0xa)+parseInt(_0x6b913(0x8f))/0xb;if(_0x143c91===_0x320e22)break;else _0x30dff5['push'](_0x30dff5['shift']());}catch(_0x16fe92){_0x30dff5['push'](_0x30dff5['shift']());}}}(a132_0x2ded,0x86e86));import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;function a132_0x1305(_0x34590d,_0x4cb6dc){_0x34590d=_0x34590d-0x89;const _0x2ded14=a132_0x2ded();let _0x1305c2=_0x2ded14[_0x34590d];return _0x1305c2;}function a132_0x2ded(){const _0x134b19=['32631830cAaJrP','userDomain','54840kqMGhI','https://daily-runtime.lovrabet.com','https://api.lovrabet.com','runtimeDomain','2673470eSNPDx','https://runtime.lovrabet.com','2714781KwRxBf','4834656WQukDA','97757juRlal','https://user.lovrabet.com','apiDomain','1440MuvXhh','https://daily-api.lovrabet.com','8RTcUEf','189322DufNBl','2oeXKFz','192zzNssX','https://user-daily.lovrabet.com'];a132_0x2ded=function(){return _0x134b19;};return a132_0x2ded();}export function initDomains(_0x9530b0){const _0x492d5c=a132_0x1305;customApiDomain=_0x9530b0?.[_0x492d5c(0x9b)],customUserDomain=_0x9530b0?.[_0x492d5c(0x90)],customRuntimeDomain=_0x9530b0?.[_0x492d5c(0x94)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a132_0x30ccbf(0x9a):a132_0x30ccbf(0x8e));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a132_0x30ccbf(0x93):a132_0x30ccbf(0x89));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a132_0x30ccbf(0x96):a132_0x30ccbf(0x92));
@@ -1 +1 @@
1
- function a133_0x4e77(_0x5d3c53,_0x49c132){_0x5d3c53=_0x5d3c53-0x92;const _0x3fc08d=a133_0x3fc0();let _0x4e772e=_0x3fc08d[_0x5d3c53];return _0x4e772e;}const a133_0x2a437e=a133_0x4e77;(function(_0x43b9ce,_0x3862b3){const _0x25a564=a133_0x4e77,_0x40f10c=_0x43b9ce();while(!![]){try{const _0xc85d47=parseInt(_0x25a564(0x92))/0x1+-parseInt(_0x25a564(0x93))/0x2*(parseInt(_0x25a564(0x9b))/0x3)+parseInt(_0x25a564(0x9d))/0x4+-parseInt(_0x25a564(0x9a))/0x5*(-parseInt(_0x25a564(0x9f))/0x6)+-parseInt(_0x25a564(0xa0))/0x7*(parseInt(_0x25a564(0x9e))/0x8)+parseInt(_0x25a564(0x96))/0x9+-parseInt(_0x25a564(0x97))/0xa;if(_0xc85d47===_0x3862b3)break;else _0x40f10c['push'](_0x40f10c['shift']());}catch(_0x1324d7){_0x40f10c['push'](_0x40f10c['shift']());}}}(a133_0x3fc0,0xf28d1));export const RABETBASE_ENV_VALUES=['production',a133_0x2a437e(0x98)];export function normalizeEnv(_0x5b83d4){const _0x1ea295=a133_0x2a437e;return _0x5b83d4===_0x1ea295(0x99)?_0x1ea295(0x9c):_0x5b83d4;}export function isProduction(_0xc2117){return normalizeEnv(_0xc2117)==='production';}export function isDaily(_0x370bb8){const _0x28893e=a133_0x2a437e;return normalizeEnv(_0x370bb8)===_0x28893e(0x98);}export function isDev(_0x5e3dad){const _0x12cb21=a133_0x2a437e,_0x2d2b9e=normalizeEnv(_0x5e3dad);return _0x2d2b9e===_0x12cb21(0x95)||_0x2d2b9e===_0x12cb21(0x94);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a133_0x2a437e(0x9c));export function getEnv(){return env;}function a133_0x3fc0(){const _0x449d15=['production','1047224vrpgHp','15442232GwidqV','1878lKQPkH','7iFiJKh','1741561hYHDyw','2766430FFTSAj','dev','development','11181510zFezgL','4821770XdCQll','daily','online','24655MvvQAm','3ngBqxz'];a133_0x3fc0=function(){return _0x449d15;};return a133_0x3fc0();}export function initEnv(_0xb96887){env=normalizeEnv(_0xb96887);}
1
+ const a133_0x22cd28=a133_0x1818;(function(_0x2730c3,_0x2a3372){const _0x41b276=a133_0x1818,_0x4ad07b=_0x2730c3();while(!![]){try{const _0x36bdff=-parseInt(_0x41b276(0xba))/0x1+-parseInt(_0x41b276(0xb9))/0x2+-parseInt(_0x41b276(0xb1))/0x3+-parseInt(_0x41b276(0xb3))/0x4*(parseInt(_0x41b276(0xb5))/0x5)+parseInt(_0x41b276(0xb0))/0x6+parseInt(_0x41b276(0xaf))/0x7*(-parseInt(_0x41b276(0xb7))/0x8)+parseInt(_0x41b276(0xae))/0x9*(parseInt(_0x41b276(0xb2))/0xa);if(_0x36bdff===_0x2a3372)break;else _0x4ad07b['push'](_0x4ad07b['shift']());}catch(_0x3653fe){_0x4ad07b['push'](_0x4ad07b['shift']());}}}(a133_0x3619,0x7cabe));export const RABETBASE_ENV_VALUES=[a133_0x22cd28(0xb6),a133_0x22cd28(0xb4)];export function normalizeEnv(_0x1c1728){const _0x1927e4=a133_0x22cd28;return _0x1c1728==='online'?_0x1927e4(0xb6):_0x1c1728;}export function isProduction(_0xd44f65){return normalizeEnv(_0xd44f65)==='production';}export function isDaily(_0x40d7cb){return normalizeEnv(_0x40d7cb)==='daily';}function a133_0x3619(){const _0x254946=['254100WIVzMt','2312376odvLqz','10pMBDJE','8okJLpy','daily','487225zxueqw','production','3176NWcPQh','development','1704172ogSjmk','561382NpnNyi','33834267ZDMDmj','16079rMpjKk'];a133_0x3619=function(){return _0x254946;};return a133_0x3619();}export function isDev(_0x13f38d){const _0x1b3774=a133_0x22cd28,_0x10b873=normalizeEnv(_0x13f38d);return _0x10b873===_0x1b3774(0xb8)||_0x10b873==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a133_0x22cd28(0xb6));export function getEnv(){return env;}function a133_0x1818(_0x4630cb,_0x1b48d6){_0x4630cb=_0x4630cb-0xae;const _0x361904=a133_0x3619();let _0x1818a4=_0x361904[_0x4630cb];return _0x1818a4;}export function initEnv(_0x550ece){env=normalizeEnv(_0x550ece);}
@@ -1 +1 @@
1
- function a134_0x1974(_0x3a0c19,_0x32375e){_0x3a0c19=_0x3a0c19-0x76;const _0x3ba752=a134_0x3ba7();let _0x197492=_0x3ba752[_0x3a0c19];return _0x197492;}const a134_0x250b44=a134_0x1974;function a134_0x3ba7(){const _0x53b185=['7819090QOLEcm','2815164XrTRit','9sMKbMM','2714008MgIrCQ','474661lGHUQD','7ZjaMQw','665904HDbsGE','3738822RmPQod','pretty','16588310flyZZW','2pVHRRb','json'];a134_0x3ba7=function(){return _0x53b185;};return a134_0x3ba7();}(function(_0x702223,_0x3b5fa7){const _0x28372e=a134_0x1974,_0x5f4ed9=_0x702223();while(!![]){try{const _0x2d934d=parseInt(_0x28372e(0x77))/0x1*(-parseInt(_0x28372e(0x7d))/0x2)+parseInt(_0x28372e(0x79))/0x3+parseInt(_0x28372e(0x80))/0x4+-parseInt(_0x28372e(0x7f))/0x5+parseInt(_0x28372e(0x7a))/0x6*(parseInt(_0x28372e(0x78))/0x7)+parseInt(_0x28372e(0x76))/0x8*(-parseInt(_0x28372e(0x81))/0x9)+parseInt(_0x28372e(0x7c))/0xa;if(_0x2d934d===_0x3b5fa7)break;else _0x5f4ed9['push'](_0x5f4ed9['shift']());}catch(_0x3fd8b6){_0x5f4ed9['push'](_0x5f4ed9['shift']());}}}(a134_0x3ba7,0xcaa2d));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a134_0x250b44(0x7e),a134_0x250b44(0x7b),'compress'];
1
+ function a134_0x343f(_0x3af0ad,_0x2c8931){_0x3af0ad=_0x3af0ad-0xba;const _0x24df07=a134_0x24df();let _0x343fce=_0x24df07[_0x3af0ad];return _0x343fce;}const a134_0xea5525=a134_0x343f;(function(_0x51d8bb,_0x1322a2){const _0x2559ea=a134_0x343f,_0x5ce8d2=_0x51d8bb();while(!![]){try{const _0x968229=parseInt(_0x2559ea(0xc4))/0x1*(-parseInt(_0x2559ea(0xba))/0x2)+parseInt(_0x2559ea(0xbe))/0x3*(parseInt(_0x2559ea(0xc2))/0x4)+-parseInt(_0x2559ea(0xc1))/0x5+-parseInt(_0x2559ea(0xbb))/0x6+parseInt(_0x2559ea(0xc5))/0x7+-parseInt(_0x2559ea(0xbf))/0x8+parseInt(_0x2559ea(0xc3))/0x9*(parseInt(_0x2559ea(0xbd))/0xa);if(_0x968229===_0x1322a2)break;else _0x5ce8d2['push'](_0x5ce8d2['shift']());}catch(_0x1f7953){_0x5ce8d2['push'](_0x5ce8d2['shift']());}}}(a134_0x24df,0x8743c));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a134_0xea5525(0xc0),a134_0xea5525(0xbc),a134_0xea5525(0xc6)];function a134_0x24df(){const _0x1a7e7d=['compress','6EDkHiB','5328582igaCJd','pretty','120hXNHnw','3rcpcjb','2901480XdDRPJ','json','2687880QzuFqj','4315412pzpiwg','604467TJRwtD','187037PQRBwz','7130928quwcUq'];a134_0x24df=function(){return _0x1a7e7d;};return a134_0x24df();}