@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.7

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 (132) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -0
  10. package/lib/auth/is-session-valid.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/doc.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/app.js +1 -1
  19. package/lib/commands/auth.js +1 -1
  20. package/lib/commands/bff/delete.js +1 -1
  21. package/lib/commands/bff/detail.js +1 -1
  22. package/lib/commands/bff/index.js +1 -1
  23. package/lib/commands/bff/list.js +1 -1
  24. package/lib/commands/bff/new.js +1 -1
  25. package/lib/commands/bff/pull.js +1 -1
  26. package/lib/commands/bff/push.js +1 -1
  27. package/lib/commands/bff/status.js +1 -1
  28. package/lib/commands/build.js +1 -1
  29. package/lib/commands/cli-update.js +1 -1
  30. package/lib/commands/codegen/index.js +1 -1
  31. package/lib/commands/codegen/sdk.js +1 -1
  32. package/lib/commands/codegen/sql.js +1 -1
  33. package/lib/commands/common/flags.js +1 -1
  34. package/lib/commands/config.js +1 -1
  35. package/lib/commands/create.js +1 -1
  36. package/lib/commands/dataset/detail.js +1 -1
  37. package/lib/commands/dataset/index.js +1 -1
  38. package/lib/commands/dataset/links.js +1 -1
  39. package/lib/commands/dataset/list.js +1 -1
  40. package/lib/commands/dataset/operations.js +1 -1
  41. package/lib/commands/doctor.js +1 -1
  42. package/lib/commands/init.js +1 -1
  43. package/lib/commands/logout.js +1 -1
  44. package/lib/commands/logs.js +1 -1
  45. package/lib/commands/mcp.js +1 -1
  46. package/lib/commands/menu/index.js +1 -1
  47. package/lib/commands/menu/shared/compare-table.js +1 -1
  48. package/lib/commands/menu/shared/index.js +1 -1
  49. package/lib/commands/menu/shared/inquirer.js +1 -1
  50. package/lib/commands/menu/shared/local-pages.js +1 -1
  51. package/lib/commands/menu/shared/logic.js +1 -1
  52. package/lib/commands/menu/shared/service.js +1 -1
  53. package/lib/commands/menu/shared/sync-core.js +1 -1
  54. package/lib/commands/menu/shared/update-core.js +1 -1
  55. package/lib/commands/menu/shared/valid-url.js +1 -1
  56. package/lib/commands/menu/sync.js +1 -1
  57. package/lib/commands/menu/update.js +1 -1
  58. package/lib/commands/preview.js +1 -1
  59. package/lib/commands/project-upgrade.js +1 -1
  60. package/lib/commands/registry.js +1 -1
  61. package/lib/commands/run.js +1 -1
  62. package/lib/commands/skill.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/sql/list.js +1 -1
  67. package/lib/commands/sql/save.js +1 -1
  68. package/lib/commands/sql/validate.js +1 -1
  69. package/lib/commands/start.js +1 -1
  70. package/lib/config/config-help.js +1 -1
  71. package/lib/config/main.js +1 -1
  72. package/lib/constant/cli.js +1 -1
  73. package/lib/constant/domain.js +1 -1
  74. package/lib/constant/env.js +1 -1
  75. package/lib/context.js +1 -1
  76. package/lib/core/alias-resolver.js +1 -1
  77. package/lib/core/api-client.js +1 -1
  78. package/lib/core/bff/config.js +1 -1
  79. package/lib/core/bff/file-system.js +1 -1
  80. package/lib/core/bff/hash.js +1 -1
  81. package/lib/core/bff/lock.js +1 -1
  82. package/lib/core/bff/utils.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sql-validator.js +1 -1
  85. package/lib/create-app/enhanced-guided-create.js +1 -1
  86. package/lib/create-app/format-elapsed.js +1 -1
  87. package/lib/create-app/main.js +1 -1
  88. package/lib/create-app/non-interactive.js +1 -1
  89. package/lib/create-app/task-finished.js +1 -1
  90. package/lib/create-app/task-loading.js +1 -1
  91. package/lib/create-app/task-running.js +1 -1
  92. package/lib/create-app/task-time.js +1 -1
  93. package/lib/create-app/use-copy-project-template.js +1 -1
  94. package/lib/create-app/use-format-code.js +1 -1
  95. package/lib/create-app/use-install-dependencies.js +1 -1
  96. package/lib/errors.js +1 -1
  97. package/lib/framework/flags.js +1 -1
  98. package/lib/framework/help.js +1 -1
  99. package/lib/framework/index.js +1 -1
  100. package/lib/framework/output.js +1 -1
  101. package/lib/framework/response.js +1 -1
  102. package/lib/framework/runner.js +1 -1
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/init/main.js +1 -1
  106. package/lib/mcp/McpInstallUI.js +1 -1
  107. package/lib/mcp/claude.js +1 -1
  108. package/lib/mcp/cursor.js +1 -1
  109. package/lib/mcp/main.js +1 -1
  110. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  111. package/lib/mcp/mcp-installer.js +1 -1
  112. package/lib/skills/main.js +1 -1
  113. package/lib/skills/npx-skills-add.js +1 -1
  114. package/lib/telemetry/cli-help-trace.js +1 -0
  115. package/lib/telemetry/otel-logger-version.js +1 -0
  116. package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
  117. package/lib/ui/IDESelector.js +1 -1
  118. package/lib/ui/useIDESelection.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/cdn-config.js +1 -1
  121. package/lib/utils/check-sdk-version.js +1 -1
  122. package/lib/utils/cli-version-check.js +1 -1
  123. package/lib/utils/config.js +1 -1
  124. package/lib/utils/copy-directory.js +1 -1
  125. package/lib/utils/file-utils.js +1 -1
  126. package/lib/utils/guides-cdn.js +1 -1
  127. package/lib/utils/http-client.js +1 -1
  128. package/lib/utils/logger.js +1 -1
  129. package/lib/utils/rules-cdn.js +1 -1
  130. package/lib/utils/sleep.js +1 -1
  131. package/lib/utils/template-replacer.js +1 -1
  132. package/package.json +2 -1
@@ -1 +1 @@
1
- function a16_0x2609(){const _0x526660=['app','\x20(default)','Migrated\x20existing\x20app\x20\x22','Usage:\x20rabetbase\x20app\x20use\x20<name>\x20[--global]','3302cYbdvN','global','pageSize','accessKey','24348BTbFjH','defaultApp','project','apps','accesskey','50NDgSnV','--appcode\x20is\x20required\x20when\x20adding\x20an\x20app.','No\x20default\x20app\x20set.\x20Use\x20`rabetbase\x20app\x20use\x20<name>`\x20to\x20set\x20one.','apidir','format','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','\x20\x20env:\x20','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','702500VQEETz','pagesize','appcode','571869lRhgnp','log','apiDir','6yjbOXZ','slice','\x20(global)','Usage:\x20rabetbase\x20app\x20remove\x20<name>\x20[--global]','3608297QcHsoS','Manage\x20multiple\x20apps\x20in\x20one\x20workspace','4VNRRkj','\x20--appcode\x20<code>`\x20first.','App\x20\x22','keys','\x20\x20\x20\x20pageSize:\x20\x20','use','\x20\x20\x20\x20format:\x20\x20\x20\x20','\x22\x20not\x20found.','length','remove','appCode','Default\x20app\x20set\x20to\x20\x22','Default:\x20','2268427EpBJig','24dkbvHe','\x20\x20\x20\x20cookie:\x20\x20\x20\x20(set)','Removed\x20app\x20\x22','env','list','258TxThwO','Single-app\x20mode:','\x20\x20\x20\x20accessKey:\x20(set)','cookie','locale','\x22\x20(appcode:\x20','\x20\x20\x20\x20apiDir:\x20\x20\x20\x20','riskLevel','4724TEcOHu','2349065QIBHeY','Set\x20as\x20default\x20app.','risklevel','\x20app\x20\x22','Added','config','add','join','exit','Configured\x20apps:\x0a','\x22\x20not\x20found.\x20Available:\x20','error'];a16_0x2609=function(){return _0x526660;};return a16_0x2609();}const a16_0x254741=a16_0x58a6;(function(_0x564fde,_0x16c753){const _0xca78e2=a16_0x58a6,_0x39f285=_0x564fde();while(!![]){try{const _0x5e3fc9=-parseInt(_0xca78e2(0x1c0))/0x1+-parseInt(_0xca78e2(0x19e))/0x2*(parseInt(_0xca78e2(0x196))/0x3)+-parseInt(_0xca78e2(0x183))/0x4*(parseInt(_0xca78e2(0x19f))/0x5)+-parseInt(_0xca78e2(0x1c6))/0x6*(-parseInt(_0xca78e2(0x190))/0x7)+-parseInt(_0xca78e2(0x191))/0x8*(parseInt(_0xca78e2(0x1c3))/0x9)+parseInt(_0xca78e2(0x1b8))/0xa*(parseInt(_0xca78e2(0x1ca))/0xb)+-parseInt(_0xca78e2(0x1b3))/0xc*(-parseInt(_0xca78e2(0x1af))/0xd);if(_0x5e3fc9===_0x16c753)break;else _0x39f285['push'](_0x39f285['shift']());}catch(_0x2bf5e0){_0x39f285['push'](_0x39f285['shift']());}}}(a16_0x2609,0xdf056));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function getConfigPath(_0x2c875b={}){const _0xea0d53=a16_0x58a6,_0x470a28=_0x2c875b['global']?_0xea0d53(0x1b0):_0xea0d53(0x1b5);return resolveWriteConfigPath(_0x470a28);}function readConfig(_0x27b0cf={}){return readConfigFile(getConfigPath(_0x27b0cf));}function writeConfig(_0x3ed107,_0x54d103={}){writeConfigFile(getConfigPath(_0x54d103),_0x3ed107);}function listApps(_0x1ae3d){const _0x3104d5=a16_0x58a6,{apps:_0x305934,defaultApp:_0x14a86c,currentApp:_0x105aa6}=_0x1ae3d[_0x3104d5(0x1a4)],_0x4249e6=Object['entries'](_0x305934);if(_0x4249e6['length']===0x0){const _0x2e301c=_0x1ae3d[_0x3104d5(0x1a4)][_0x3104d5(0x18d)];_0x2e301c?(console[_0x3104d5(0x1c4)](_0x3104d5(0x197)),console[_0x3104d5(0x1c4)]('\x20\x20appcode:\x20'+_0x2e301c+_0x3104d5(0x1be)+_0x1ae3d[_0x3104d5(0x1a4)][_0x3104d5(0x194)]),console[_0x3104d5(0x1c4)]('\x0aUse\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.')):console[_0x3104d5(0x1c4)](_0x3104d5(0x1bf));return;}console[_0x3104d5(0x1c4)](_0x3104d5(0x1a8));for(const [_0x3fe367,_0x5134b7]of _0x4249e6){const _0x389ebf=_0x3fe367===_0x14a86c,_0x1515b8=_0x3fe367===_0x105aa6,_0x2932a0=_0x1515b8?'\x20*':_0x389ebf?_0x3104d5(0x1ac):'';console[_0x3104d5(0x1c4)]('\x20\x20'+_0x3fe367+_0x2932a0),console[_0x3104d5(0x1c4)]('\x20\x20\x20\x20appcode:\x20'+_0x5134b7[_0x3104d5(0x1c2)]);if(_0x5134b7[_0x3104d5(0x194)])console[_0x3104d5(0x1c4)]('\x20\x20\x20\x20env:\x20\x20\x20\x20\x20\x20\x20'+_0x5134b7['env']);if(_0x5134b7[_0x3104d5(0x1c5)])console[_0x3104d5(0x1c4)](_0x3104d5(0x19c)+_0x5134b7[_0x3104d5(0x1c5)]);if(_0x5134b7['cookie'])console[_0x3104d5(0x1c4)](_0x3104d5(0x192));if(_0x5134b7['accessKey'])console[_0x3104d5(0x1c4)](_0x3104d5(0x198));if(_0x5134b7['format'])console[_0x3104d5(0x1c4)](_0x3104d5(0x189)+_0x5134b7['format']);if(_0x5134b7[_0x3104d5(0x1b1)])console[_0x3104d5(0x1c4)](_0x3104d5(0x187)+_0x5134b7[_0x3104d5(0x1b1)]);if(_0x5134b7[_0x3104d5(0x19d)])console[_0x3104d5(0x1c4)]('\x20\x20\x20\x20riskLevel:\x20'+_0x5134b7['riskLevel']);if(_0x5134b7[_0x3104d5(0x19a)])console[_0x3104d5(0x1c4)]('\x20\x20\x20\x20locale:\x20\x20\x20\x20'+_0x5134b7[_0x3104d5(0x19a)]);console[_0x3104d5(0x1c4)]('');}_0x14a86c?console[_0x3104d5(0x1c4)](_0x3104d5(0x18f)+_0x14a86c):console[_0x3104d5(0x1c4)](_0x3104d5(0x1ba));}function useApp(_0x461cca,_0x232b4e,_0x18a1a1){const _0x18dfd5=a16_0x58a6,_0x1969a2=_0x232b4e[0x0];!_0x1969a2&&(console[_0x18dfd5(0x1aa)](_0x18dfd5(0x1ae)),process[_0x18dfd5(0x1a7)](0x1));const _0xec5f63=readConfig(_0x18a1a1),_0x29b4ae=_0xec5f63[_0x18dfd5(0x1b6)]||{};if(!_0x29b4ae[_0x1969a2]){const _0x2420df=Object['keys'](_0x29b4ae);_0x2420df[_0x18dfd5(0x18b)]===0x0?console['error']('No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20'+_0x1969a2+_0x18dfd5(0x184)):console[_0x18dfd5(0x1aa)](_0x18dfd5(0x185)+_0x1969a2+_0x18dfd5(0x1a9)+_0x2420df[_0x18dfd5(0x1a6)](',\x20')),process[_0x18dfd5(0x1a7)](0x1);}_0xec5f63[_0x18dfd5(0x1b4)]=_0x1969a2,writeConfig(_0xec5f63,_0x18a1a1);const _0xf1de8=_0x18a1a1[_0x18dfd5(0x1b0)]?'\x20(global)':'';console[_0x18dfd5(0x1c4)](_0x18dfd5(0x18e)+_0x1969a2+_0x18dfd5(0x19b)+_0x29b4ae[_0x1969a2]['appcode']+')'+_0xf1de8);}function migrateLegacySingleApp(_0x50c430,_0x10dce0){const _0x8c25d6=a16_0x58a6,_0x3df9ce=_0x50c430[_0x8c25d6(0x1c2)]||_0x50c430[_0x8c25d6(0x1ab)];if(!_0x3df9ce)return;const _0x20ae3e=String(_0x3df9ce);if(_0x20ae3e===_0x10dce0)return;const _0x2faaa8={'appcode':_0x3df9ce};if(_0x50c430[_0x8c25d6(0x194)])_0x2faaa8['env']=_0x50c430[_0x8c25d6(0x194)];if(_0x50c430['apiDir'])_0x2faaa8[_0x8c25d6(0x1c5)]=_0x50c430['apiDir'];if(_0x50c430['cookie'])_0x2faaa8[_0x8c25d6(0x199)]=_0x50c430[_0x8c25d6(0x199)];if(_0x50c430[_0x8c25d6(0x1b2)])_0x2faaa8[_0x8c25d6(0x1b2)]=_0x50c430[_0x8c25d6(0x1b2)];if(_0x50c430[_0x8c25d6(0x1bc)])_0x2faaa8['format']=_0x50c430['format'];if(_0x50c430[_0x8c25d6(0x1b1)])_0x2faaa8['pageSize']=_0x50c430[_0x8c25d6(0x1b1)];if(_0x50c430[_0x8c25d6(0x19d)])_0x2faaa8['riskLevel']=_0x50c430[_0x8c25d6(0x19d)];if(_0x50c430['locale'])_0x2faaa8[_0x8c25d6(0x19a)]=_0x50c430[_0x8c25d6(0x19a)];_0x50c430[_0x8c25d6(0x1b6)][_0x20ae3e]=_0x2faaa8,_0x50c430['defaultApp']=_0x20ae3e,delete _0x50c430['appcode'],delete _0x50c430['app'],console['log'](_0x8c25d6(0x1ad)+_0x20ae3e+_0x8c25d6(0x1bd));}function a16_0x58a6(_0x948f0a,_0x1ce4d5){_0x948f0a=_0x948f0a-0x182;const _0x260908=a16_0x2609();let _0x58a696=_0x260908[_0x948f0a];return _0x58a696;}function addApp(_0x12cb99,_0xf7b46f,_0xd5c217){const _0x33fc5f=a16_0x58a6,_0x1f48df=_0xf7b46f[0x0];!_0x1f48df&&(console['error']('Usage:\x20rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>\x20[--env\x20<env>]\x20[--apiDir\x20<dir>]\x20[--global]'),process[_0x33fc5f(0x1a7)](0x1));const _0x406275=_0xd5c217[_0x33fc5f(0x1c2)];!_0x406275&&(console['error'](_0x33fc5f(0x1b9)),process[_0x33fc5f(0x1a7)](0x1));const _0x24c566=readConfig(_0xd5c217);if(!_0x24c566['apps'])_0x24c566[_0x33fc5f(0x1b6)]={};Object[_0x33fc5f(0x186)](_0x24c566[_0x33fc5f(0x1b6)])[_0x33fc5f(0x18b)]===0x0&&migrateLegacySingleApp(_0x24c566,_0x1f48df);const _0x3a1505={'appcode':_0x406275};if(_0xd5c217['env'])_0x3a1505[_0x33fc5f(0x194)]=_0xd5c217[_0x33fc5f(0x194)];if(_0xd5c217['apiDir']||_0xd5c217[_0x33fc5f(0x1bb)])_0x3a1505[_0x33fc5f(0x1c5)]=_0xd5c217[_0x33fc5f(0x1c5)]||_0xd5c217[_0x33fc5f(0x1bb)];if(_0xd5c217[_0x33fc5f(0x199)])_0x3a1505['cookie']=_0xd5c217[_0x33fc5f(0x199)];if(_0xd5c217['accessKey']||_0xd5c217['accesskey'])_0x3a1505[_0x33fc5f(0x1b2)]=_0xd5c217[_0x33fc5f(0x1b2)]||_0xd5c217[_0x33fc5f(0x1b7)];if(_0xd5c217[_0x33fc5f(0x1bc)])_0x3a1505[_0x33fc5f(0x1bc)]=_0xd5c217[_0x33fc5f(0x1bc)];if(_0xd5c217[_0x33fc5f(0x1b1)]||_0xd5c217[_0x33fc5f(0x1c1)])_0x3a1505[_0x33fc5f(0x1b1)]=Number(_0xd5c217['pageSize']||_0xd5c217[_0x33fc5f(0x1c1)]);if(_0xd5c217[_0x33fc5f(0x19d)]||_0xd5c217[_0x33fc5f(0x1a1)])_0x3a1505['riskLevel']=_0xd5c217['riskLevel']||_0xd5c217[_0x33fc5f(0x1a1)];if(_0xd5c217[_0x33fc5f(0x19a)])_0x3a1505[_0x33fc5f(0x19a)]=_0xd5c217[_0x33fc5f(0x19a)];const _0x4f7695=!!_0x24c566[_0x33fc5f(0x1b6)][_0x1f48df];_0x24c566[_0x33fc5f(0x1b6)][_0x1f48df]=_0x3a1505;!_0x24c566[_0x33fc5f(0x1b4)]&&(_0x24c566['defaultApp']=_0x1f48df);writeConfig(_0x24c566,_0xd5c217);const _0x114b88=_0xd5c217[_0x33fc5f(0x1b0)]?_0x33fc5f(0x1c8):'';console[_0x33fc5f(0x1c4)]((_0x4f7695?'Updated':_0x33fc5f(0x1a3))+_0x33fc5f(0x1a2)+_0x1f48df+_0x33fc5f(0x19b)+_0x406275+')'+_0x114b88),_0x24c566['defaultApp']===_0x1f48df&&!_0x4f7695&&console[_0x33fc5f(0x1c4)](_0x33fc5f(0x1a0));}function removeApp(_0x4cd8cc,_0x2e5156,_0x196a08){const _0x19fea1=a16_0x58a6,_0x491d24=_0x2e5156[0x0];!_0x491d24&&(console['error'](_0x19fea1(0x1c9)),process[_0x19fea1(0x1a7)](0x1));const _0xf5eeea=readConfig(_0x196a08);(!_0xf5eeea['apps']||!_0xf5eeea[_0x19fea1(0x1b6)][_0x491d24])&&(console[_0x19fea1(0x1aa)]('App\x20\x22'+_0x491d24+_0x19fea1(0x18a)),process[_0x19fea1(0x1a7)](0x1));delete _0xf5eeea[_0x19fea1(0x1b6)][_0x491d24];if(_0xf5eeea[_0x19fea1(0x1b4)]===_0x491d24){const _0x3bcf64=Object[_0x19fea1(0x186)](_0xf5eeea['apps']);_0xf5eeea['defaultApp']=_0x3bcf64[_0x19fea1(0x18b)]>0x0?_0x3bcf64[0x0]:undefined,_0xf5eeea[_0x19fea1(0x1b4)]?console['log']('Default\x20app\x20changed\x20to\x20\x22'+_0xf5eeea[_0x19fea1(0x1b4)]+'\x22.'):delete _0xf5eeea[_0x19fea1(0x1b4)];}Object[_0x19fea1(0x186)](_0xf5eeea['apps'])['length']===0x0&&(delete _0xf5eeea[_0x19fea1(0x1b6)],delete _0xf5eeea[_0x19fea1(0x1b4)]),writeConfig(_0xf5eeea,_0x196a08),console['log'](_0x19fea1(0x193)+_0x491d24+'\x22.');}export const appCommand={'name':a16_0x254741(0x1ab),'description':a16_0x254741(0x182),async 'run'(_0x1fa5a7,_0x38d881,_0x59b87b){const _0x3b7ef9=a16_0x254741,_0x197335=_0x38d881[0x0],_0x1caa54=_0x38d881[_0x3b7ef9(0x1c7)](0x1);switch(_0x197335){case _0x3b7ef9(0x195):listApps(_0x1fa5a7);break;case _0x3b7ef9(0x188):useApp(_0x1fa5a7,_0x1caa54,_0x59b87b);break;case _0x3b7ef9(0x1a5):addApp(_0x1fa5a7,_0x1caa54,_0x59b87b);break;case _0x3b7ef9(0x18c):removeApp(_0x1fa5a7,_0x1caa54,_0x59b87b);break;default:listApps(_0x1fa5a7);break;}}};
1
+ const a17_0x31fb62=a17_0x2097;(function(_0x2668ac,_0x5162d7){const _0x10e831=a17_0x2097,_0x281225=_0x2668ac();while(!![]){try{const _0x58574a=parseInt(_0x10e831(0x190))/0x1*(parseInt(_0x10e831(0x1a4))/0x2)+parseInt(_0x10e831(0x180))/0x3*(parseInt(_0x10e831(0x1a3))/0x4)+-parseInt(_0x10e831(0x17b))/0x5+parseInt(_0x10e831(0x1bc))/0x6*(-parseInt(_0x10e831(0x188))/0x7)+parseInt(_0x10e831(0x183))/0x8*(parseInt(_0x10e831(0x18e))/0x9)+parseInt(_0x10e831(0x19d))/0xa*(-parseInt(_0x10e831(0x1ad))/0xb)+-parseInt(_0x10e831(0x175))/0xc*(-parseInt(_0x10e831(0x1ab))/0xd);if(_0x58574a===_0x5162d7)break;else _0x281225['push'](_0x281225['shift']());}catch(_0x499d33){_0x281225['push'](_0x281225['shift']());}}}(a17_0x5a32,0x99ad1));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function a17_0x2097(_0x2d8563,_0x393c87){_0x2d8563=_0x2d8563-0x173;const _0x5a322e=a17_0x5a32();let _0x209799=_0x5a322e[_0x2d8563];return _0x209799;}function getConfigPath(_0x135190={}){const _0x2f6161=a17_0x2097,_0x5034e7=_0x135190[_0x2f6161(0x189)]?'global':_0x2f6161(0x184);return resolveWriteConfigPath(_0x5034e7);}function readConfig(_0x1315fd={}){return readConfigFile(getConfigPath(_0x1315fd));}function writeConfig(_0x1fa89c,_0xfc7b1b={}){writeConfigFile(getConfigPath(_0xfc7b1b),_0x1fa89c);}function listApps(_0x168259){const _0x1ac6fb=a17_0x2097,{apps:_0x5d1fb8,defaultApp:_0x473402,currentApp:_0x4eedb2}=_0x168259[_0x1ac6fb(0x18c)],_0x2c3f48=Object[_0x1ac6fb(0x198)](_0x5d1fb8);if(_0x2c3f48[_0x1ac6fb(0x19f)]===0x0){const _0x3d05c6=_0x168259['config']['appCode'];_0x3d05c6?(console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x185)),console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x19a)+_0x3d05c6+_0x1ac6fb(0x176)+_0x168259[_0x1ac6fb(0x18c)][_0x1ac6fb(0x1ae)]),console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b7))):console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x17d));return;}console[_0x1ac6fb(0x1bb)]('Configured\x20apps:\x0a');for(const [_0x3c3ef5,_0x5812fe]of _0x2c3f48){const _0x2d8560=_0x3c3ef5===_0x473402,_0x358b09=_0x3c3ef5===_0x4eedb2,_0xccffa7=_0x358b09?'\x20*':_0x2d8560?_0x1ac6fb(0x1aa):'';console[_0x1ac6fb(0x1bb)]('\x20\x20'+_0x3c3ef5+_0xccffa7),console[_0x1ac6fb(0x1bb)]('\x20\x20\x20\x20appcode:\x20'+_0x5812fe[_0x1ac6fb(0x187)]);if(_0x5812fe['env'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x194)+_0x5812fe['env']);if(_0x5812fe[_0x1ac6fb(0x1b9)])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b4)+_0x5812fe[_0x1ac6fb(0x1b9)]);if(_0x5812fe['cookie'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x186));if(_0x5812fe[_0x1ac6fb(0x197)])console['log'](_0x1ac6fb(0x1a0));if(_0x5812fe['format'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x191)+_0x5812fe['format']);if(_0x5812fe[_0x1ac6fb(0x179)])console['log'](_0x1ac6fb(0x17c)+_0x5812fe['pageSize']);if(_0x5812fe['riskLevel'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x196)+_0x5812fe[_0x1ac6fb(0x18b)]);if(_0x5812fe[_0x1ac6fb(0x1b6)])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b8)+_0x5812fe[_0x1ac6fb(0x1b6)]);console[_0x1ac6fb(0x1bb)]('');}_0x473402?console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1a2)+_0x473402):console['log'](_0x1ac6fb(0x1ba));}function useApp(_0x101794,_0xb84618,_0x2c35a3){const _0x26619c=a17_0x2097,_0x4d56d4=_0xb84618[0x0];!_0x4d56d4&&(console[_0x26619c(0x19b)]('Usage:\x20rabetbase\x20app\x20use\x20<name>\x20[--global]'),process[_0x26619c(0x1b0)](0x1));const _0x1235e6=readConfig(_0x2c35a3),_0x523e55=_0x1235e6[_0x26619c(0x1a7)]||{};if(!_0x523e55[_0x4d56d4]){const _0x8e1a33=Object[_0x26619c(0x195)](_0x523e55);_0x8e1a33[_0x26619c(0x19f)]===0x0?console[_0x26619c(0x19b)](_0x26619c(0x199)+_0x4d56d4+_0x26619c(0x1a6)):console[_0x26619c(0x19b)]('App\x20\x22'+_0x4d56d4+_0x26619c(0x1a5)+_0x8e1a33[_0x26619c(0x1a1)](',\x20')),process['exit'](0x1);}_0x1235e6[_0x26619c(0x1ac)]=_0x4d56d4,writeConfig(_0x1235e6,_0x2c35a3);const _0x1318f0=_0x2c35a3[_0x26619c(0x189)]?_0x26619c(0x18f):'';console['log'](_0x26619c(0x192)+_0x4d56d4+_0x26619c(0x1b1)+_0x523e55[_0x4d56d4][_0x26619c(0x187)]+')'+_0x1318f0);}function migrateLegacySingleApp(_0x4ab5b6,_0x2e6e99){const _0x4f1bb5=a17_0x2097,_0x3c8ca0=_0x4ab5b6[_0x4f1bb5(0x187)]||_0x4ab5b6[_0x4f1bb5(0x177)];if(!_0x3c8ca0)return;const _0x5ef0cf=String(_0x3c8ca0);if(_0x5ef0cf===_0x2e6e99)return;const _0x1b69af={'appcode':_0x3c8ca0};if(_0x4ab5b6['env'])_0x1b69af[_0x4f1bb5(0x1ae)]=_0x4ab5b6[_0x4f1bb5(0x1ae)];if(_0x4ab5b6[_0x4f1bb5(0x1b9)])_0x1b69af[_0x4f1bb5(0x1b9)]=_0x4ab5b6['apiDir'];if(_0x4ab5b6[_0x4f1bb5(0x17a)])_0x1b69af[_0x4f1bb5(0x17a)]=_0x4ab5b6[_0x4f1bb5(0x17a)];if(_0x4ab5b6[_0x4f1bb5(0x197)])_0x1b69af[_0x4f1bb5(0x197)]=_0x4ab5b6[_0x4f1bb5(0x197)];if(_0x4ab5b6[_0x4f1bb5(0x181)])_0x1b69af[_0x4f1bb5(0x181)]=_0x4ab5b6[_0x4f1bb5(0x181)];if(_0x4ab5b6[_0x4f1bb5(0x179)])_0x1b69af[_0x4f1bb5(0x179)]=_0x4ab5b6[_0x4f1bb5(0x179)];if(_0x4ab5b6[_0x4f1bb5(0x18b)])_0x1b69af[_0x4f1bb5(0x18b)]=_0x4ab5b6['riskLevel'];if(_0x4ab5b6[_0x4f1bb5(0x1b6)])_0x1b69af['locale']=_0x4ab5b6[_0x4f1bb5(0x1b6)];_0x4ab5b6[_0x4f1bb5(0x1a7)][_0x5ef0cf]=_0x1b69af,_0x4ab5b6['defaultApp']=_0x5ef0cf,delete _0x4ab5b6['appcode'],delete _0x4ab5b6[_0x4f1bb5(0x177)],console[_0x4f1bb5(0x1bb)](_0x4f1bb5(0x1a8)+_0x5ef0cf+_0x4f1bb5(0x17f));}function addApp(_0x214c1e,_0x39528e,_0x18ca06){const _0x3eeda7=a17_0x2097,_0x5bc3a7=_0x39528e[0x0];!_0x5bc3a7&&(console['error']('Usage:\x20rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>\x20[--env\x20<env>]\x20[--apiDir\x20<dir>]\x20[--global]'),process['exit'](0x1));const _0x52db97=_0x18ca06['appcode'];!_0x52db97&&(console['error'](_0x3eeda7(0x1b5)),process[_0x3eeda7(0x1b0)](0x1));const _0x401508=readConfig(_0x18ca06);if(!_0x401508[_0x3eeda7(0x1a7)])_0x401508[_0x3eeda7(0x1a7)]={};Object[_0x3eeda7(0x195)](_0x401508[_0x3eeda7(0x1a7)])[_0x3eeda7(0x19f)]===0x0&&migrateLegacySingleApp(_0x401508,_0x5bc3a7);const _0x45d6e1={'appcode':_0x52db97};if(_0x18ca06[_0x3eeda7(0x1ae)])_0x45d6e1[_0x3eeda7(0x1ae)]=_0x18ca06[_0x3eeda7(0x1ae)];if(_0x18ca06[_0x3eeda7(0x1b9)]||_0x18ca06[_0x3eeda7(0x19c)])_0x45d6e1['apiDir']=_0x18ca06[_0x3eeda7(0x1b9)]||_0x18ca06[_0x3eeda7(0x19c)];if(_0x18ca06[_0x3eeda7(0x17a)])_0x45d6e1[_0x3eeda7(0x17a)]=_0x18ca06['cookie'];if(_0x18ca06[_0x3eeda7(0x197)]||_0x18ca06[_0x3eeda7(0x1b2)])_0x45d6e1['accessKey']=_0x18ca06[_0x3eeda7(0x197)]||_0x18ca06[_0x3eeda7(0x1b2)];if(_0x18ca06[_0x3eeda7(0x181)])_0x45d6e1[_0x3eeda7(0x181)]=_0x18ca06['format'];if(_0x18ca06['pageSize']||_0x18ca06['pagesize'])_0x45d6e1['pageSize']=Number(_0x18ca06[_0x3eeda7(0x179)]||_0x18ca06[_0x3eeda7(0x182)]);if(_0x18ca06[_0x3eeda7(0x18b)]||_0x18ca06[_0x3eeda7(0x193)])_0x45d6e1[_0x3eeda7(0x18b)]=_0x18ca06['riskLevel']||_0x18ca06[_0x3eeda7(0x193)];if(_0x18ca06['locale'])_0x45d6e1[_0x3eeda7(0x1b6)]=_0x18ca06[_0x3eeda7(0x1b6)];const _0x373c4b=!!_0x401508[_0x3eeda7(0x1a7)][_0x5bc3a7];_0x401508[_0x3eeda7(0x1a7)][_0x5bc3a7]=_0x45d6e1;!_0x401508['defaultApp']&&(_0x401508[_0x3eeda7(0x1ac)]=_0x5bc3a7);writeConfig(_0x401508,_0x18ca06);const _0x288ec7=_0x18ca06['global']?_0x3eeda7(0x18f):'';console['log']((_0x373c4b?_0x3eeda7(0x1af):_0x3eeda7(0x17e))+'\x20app\x20\x22'+_0x5bc3a7+'\x22\x20(appcode:\x20'+_0x52db97+')'+_0x288ec7),_0x401508[_0x3eeda7(0x1ac)]===_0x5bc3a7&&!_0x373c4b&&console[_0x3eeda7(0x1bb)](_0x3eeda7(0x173));}function removeApp(_0x461fee,_0x2e0ddf,_0x1aa415){const _0x5cc633=a17_0x2097,_0x554040=_0x2e0ddf[0x0];!_0x554040&&(console[_0x5cc633(0x19b)](_0x5cc633(0x18d)),process[_0x5cc633(0x1b0)](0x1));const _0x1220fe=readConfig(_0x1aa415);(!_0x1220fe[_0x5cc633(0x1a7)]||!_0x1220fe[_0x5cc633(0x1a7)][_0x554040])&&(console[_0x5cc633(0x19b)]('App\x20\x22'+_0x554040+_0x5cc633(0x19e)),process[_0x5cc633(0x1b0)](0x1));delete _0x1220fe[_0x5cc633(0x1a7)][_0x554040];if(_0x1220fe[_0x5cc633(0x1ac)]===_0x554040){const _0x51d12c=Object[_0x5cc633(0x195)](_0x1220fe['apps']);_0x1220fe['defaultApp']=_0x51d12c[_0x5cc633(0x19f)]>0x0?_0x51d12c[0x0]:undefined,_0x1220fe['defaultApp']?console[_0x5cc633(0x1bb)](_0x5cc633(0x178)+_0x1220fe[_0x5cc633(0x1ac)]+'\x22.'):delete _0x1220fe[_0x5cc633(0x1ac)];}Object['keys'](_0x1220fe[_0x5cc633(0x1a7)])[_0x5cc633(0x19f)]===0x0&&(delete _0x1220fe[_0x5cc633(0x1a7)],delete _0x1220fe[_0x5cc633(0x1ac)]),writeConfig(_0x1220fe,_0x1aa415),console[_0x5cc633(0x1bb)]('Removed\x20app\x20\x22'+_0x554040+'\x22.');}export const appCommand={'name':a17_0x31fb62(0x177),'description':a17_0x31fb62(0x1a9),async 'run'(_0x501e5d,_0x1225e3,_0x5c55b1){const _0x2827aa=a17_0x31fb62,_0x3cd218=_0x1225e3[0x0],_0x520879=_0x1225e3['slice'](0x1);switch(_0x3cd218){case _0x2827aa(0x1b3):listApps(_0x501e5d);break;case'use':useApp(_0x501e5d,_0x520879,_0x5c55b1);break;case _0x2827aa(0x174):addApp(_0x501e5d,_0x520879,_0x5c55b1);break;case _0x2827aa(0x18a):removeApp(_0x501e5d,_0x520879,_0x5c55b1);break;default:listApps(_0x501e5d);break;}}};function a17_0x5a32(){const _0x5d3ead=['\x20\x20\x20\x20apiDir:\x20\x20\x20\x20','--appcode\x20is\x20required\x20when\x20adding\x20an\x20app.','locale','\x0aUse\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','\x20\x20\x20\x20locale:\x20\x20\x20\x20','apiDir','No\x20default\x20app\x20set.\x20Use\x20`rabetbase\x20app\x20use\x20<name>`\x20to\x20set\x20one.','log','2969022xshCwP','Set\x20as\x20default\x20app.','add','12KGuCge','\x20\x20env:\x20','app','Default\x20app\x20changed\x20to\x20\x22','pageSize','cookie','5190215eWNbyc','\x20\x20\x20\x20pageSize:\x20\x20','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','Added','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','3pxJOfO','format','pagesize','356280nuGMgy','project','Single-app\x20mode:','\x20\x20\x20\x20cookie:\x20\x20\x20\x20(set)','appcode','14grkXvN','global','remove','riskLevel','config','Usage:\x20rabetbase\x20app\x20remove\x20<name>\x20[--global]','117WhjoIJ','\x20(global)','2HqBiqU','\x20\x20\x20\x20format:\x20\x20\x20\x20','Default\x20app\x20set\x20to\x20\x22','risklevel','\x20\x20\x20\x20env:\x20\x20\x20\x20\x20\x20\x20','keys','\x20\x20\x20\x20riskLevel:\x20','accessKey','entries','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20','\x20\x20appcode:\x20','error','apidir','112030qPcAHJ','\x22\x20not\x20found.','length','\x20\x20\x20\x20accessKey:\x20(set)','join','Default:\x20','2653508KqNCDj','276658RGshVf','\x22\x20not\x20found.\x20Available:\x20','\x20--appcode\x20<code>`\x20first.','apps','Migrated\x20existing\x20app\x20\x22','Manage\x20multiple\x20apps\x20in\x20one\x20workspace','\x20(default)','18728645DmQRVg','defaultApp','297YgDsYj','env','Updated','exit','\x22\x20(appcode:\x20','accesskey','list'];a17_0x5a32=function(){return _0x5d3ead;};return a17_0x5a32();}
@@ -1 +1 @@
1
- function a17_0x5335(){const _0x4defd5=['Authenticate\x20with\x20rabetbase','95qnpqPy','516678OHnlMB','13166289JAHukE','2451351opHxmN','8570368gPZeSl','auth','1971364sFLimW','220980zeUXux','4lVuCfO','242537Uastum'];a17_0x5335=function(){return _0x4defd5;};return a17_0x5335();}const a17_0x4243e6=a17_0x377d;function a17_0x377d(_0x35c627,_0x4089b4){_0x35c627=_0x35c627-0x99;const _0x5335b2=a17_0x5335();let _0x377df6=_0x5335b2[_0x35c627];return _0x377df6;}(function(_0x4b417b,_0x2f088e){const _0x3c6b58=a17_0x377d,_0x4759bf=_0x4b417b();while(!![]){try{const _0x57f4ec=parseInt(_0x3c6b58(0xa0))/0x1+-parseInt(_0x3c6b58(0x9f))/0x2*(-parseInt(_0x3c6b58(0xa3))/0x3)+-parseInt(_0x3c6b58(0x9d))/0x4+parseInt(_0x3c6b58(0xa2))/0x5*(parseInt(_0x3c6b58(0x9e))/0x6)+-parseInt(_0x3c6b58(0x9a))/0x7+-parseInt(_0x3c6b58(0x9b))/0x8+parseInt(_0x3c6b58(0x99))/0x9;if(_0x57f4ec===_0x2f088e)break;else _0x4759bf['push'](_0x4759bf['shift']());}catch(_0x131149){_0x4759bf['push'](_0x4759bf['shift']());}}}(a17_0x5335,0xcbf16));import{jsx as a17_0x38b996}from'react/jsx-runtime';import{render}from'ink';import{AuthServer}from'../auth/auth-server-ui.js';export const authCommand={'name':a17_0x4243e6(0x9c),'description':a17_0x4243e6(0xa1),async 'run'(_0x395739,_0x1e6e2b,_0x116d46){render(a17_0x38b996(AuthServer,{}));}};
1
+ const a18_0x2340e2=a18_0x53e1;(function(_0x4679cc,_0x4d116a){const _0x18e51c=a18_0x53e1,_0x401558=_0x4679cc();while(!![]){try{const _0x1817a6=-parseInt(_0x18e51c(0xf2))/0x1*(-parseInt(_0x18e51c(0xf5))/0x2)+-parseInt(_0x18e51c(0xf0))/0x3+-parseInt(_0x18e51c(0xf6))/0x4+parseInt(_0x18e51c(0xef))/0x5+-parseInt(_0x18e51c(0xf1))/0x6+parseInt(_0x18e51c(0xf3))/0x7*(-parseInt(_0x18e51c(0xf4))/0x8)+parseInt(_0x18e51c(0xf7))/0x9;if(_0x1817a6===_0x4d116a)break;else _0x401558['push'](_0x401558['shift']());}catch(_0x4cf612){_0x401558['push'](_0x401558['shift']());}}}(a18_0xf283,0x99208));function a18_0x53e1(_0x44976d,_0x5b053b){_0x44976d=_0x44976d-0xef;const _0xf2835c=a18_0xf283();let _0x53e1ac=_0xf2835c[_0x44976d];return _0x53e1ac;}import{jsx as a18_0x394b5d}from'react/jsx-runtime';function a18_0xf283(){const _0x2cee53=['auth','3355800KTNMse','2996511tAKkQX','4799400MPkdsW','2246fFYfoa','1631LAczOd','2136ZtLkJq','294mhSSCV','1655576LmYMKJ','17106552RqgNef'];a18_0xf283=function(){return _0x2cee53;};return a18_0xf283();}import{render}from'ink';import{AuthServer}from'../auth/auth-server-ui.js';export const authCommand={'name':a18_0x2340e2(0xf8),'description':'Authenticate\x20with\x20rabetbase',async 'run'(_0x3ea08a,_0x7f1b78,_0x558c3a){render(a18_0x394b5d(AuthServer,{}));}};
@@ -1 +1 @@
1
- function a18_0x3216(_0x25953c,_0x31b397){_0x25953c=_0x25953c-0x1a7;const _0x427381=a18_0x4273();let _0x32163b=_0x427381[_0x25953c];return _0x32163b;}const a18_0x5387f5=a18_0x3216;(function(_0x56e063,_0x39bd0e){const _0x2e4768=a18_0x3216,_0x4c4123=_0x56e063();while(!![]){try{const _0x5420b3=parseInt(_0x2e4768(0x1ce))/0x1*(parseInt(_0x2e4768(0x1ab))/0x2)+parseInt(_0x2e4768(0x1b9))/0x3*(-parseInt(_0x2e4768(0x1bb))/0x4)+parseInt(_0x2e4768(0x1c9))/0x5+parseInt(_0x2e4768(0x1ba))/0x6*(-parseInt(_0x2e4768(0x1b7))/0x7)+parseInt(_0x2e4768(0x1c6))/0x8*(-parseInt(_0x2e4768(0x1c2))/0x9)+parseInt(_0x2e4768(0x1be))/0xa+-parseInt(_0x2e4768(0x1ac))/0xb*(parseInt(_0x2e4768(0x1b5))/0xc);if(_0x5420b3===_0x39bd0e)break;else _0x4c4123['push'](_0x4c4123['shift']());}catch(_0x2f3170){_0x4c4123['push'](_0x4c4123['shift']());}}}(a18_0x4273,0x59773));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a18_0x5387f5(0x1b3),'command':a18_0x5387f5(0x1ad),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a18_0x5387f5(0x1ae),'flags':[{'name':'target','type':a18_0x5387f5(0x1c5),'required':!![],'description':a18_0x5387f5(0x1b2)}],async 'validate'(_0x1c4e85){const _0x26ef5d=a18_0x5387f5,_0x2a5a48=loadBffProjectConfig(_0x1c4e85['appCode']),_0x233ba0=await readBffLockFile(_0x2a5a48[_0x26ef5d(0x1b8)]);if(!_0x233ba0)throw CliErrors[_0x26ef5d(0x1cb)](_0x26ef5d(0x1ca));},async 'execute'(_0x2f0e73){const _0x31731c=a18_0x5387f5,_0x5d5bf7=loadBffProjectConfig(_0x2f0e73['appCode']),_0xf33d90=await readBffLockFile(_0x5d5bf7['lockFilePath']);if(!_0xf33d90)throw CliErrors[_0x31731c(0x1cb)](_0x31731c(0x1bc));const {lockData:_0x3e613e,appLock:_0x11f2f0}=ensureLockScope(_0xf33d90,_0x5d5bf7[_0x31731c(0x1cf)],_0x5d5bf7[_0x31731c(0x1c3)],_0x31731c(0x1ad),_0x5d5bf7[_0x31731c(0x1cf)],_0x5d5bf7[_0x31731c(0x1aa)]+'/'+_0x5d5bf7[_0x31731c(0x1cf)]),_0x562d7b=_0x2f0e73[_0x31731c(0x1b1)](_0x31731c(0x1c1)),_0x22514d=Object['keys'](_0x11f2f0[_0x31731c(0x1d0)]),_0x3b81e8=resolveDeleteTarget(_0x562d7b,_0x22514d),_0x200c66=_0x11f2f0[_0x31731c(0x1d0)][_0x3b81e8];if(!_0x200c66)throw CliErrors['validation'](_0x31731c(0x1cc)+_0x3b81e8+'\x22.');await deleteBffScript(_0x200c66['remoteId']),delete _0x11f2f0[_0x31731c(0x1d0)][_0x3b81e8],_0x11f2f0['lastSync']=new Date()[_0x31731c(0x1d1)](),await writeBffLockFile(_0x5d5bf7['lockFilePath'],_0x3e613e);const _0x6ab4c6=resolveLocalFilePathFromLockKey(_0x5d5bf7,_0x3b81e8);let _0x64a4f;await fileExists(_0x6ab4c6)&&(_0x64a4f=await moveToTrash(_0x5d5bf7[_0x31731c(0x1d2)],_0x5d5bf7['trashDir'],_0x6ab4c6),await cleanupEmptyDirectories(dirname(_0x6ab4c6),_0x5d5bf7[_0x31731c(0x1bf)]));const _0x58f24a={'deleted':_0x3b81e8,'remoteId':_0x200c66[_0x31731c(0x1a7)]};if(_0x64a4f)_0x58f24a[_0x31731c(0x1c0)]=_0x64a4f;return{'ok':!![],'data':_0x58f24a,'message':_0x31731c(0x1b0)+_0x3b81e8+(_0x64a4f?_0x31731c(0x1af):'')};}};function a18_0x4273(){const _0x346008=['join','101871XgENiD','lockFilePath','39IzlCQY','42CWKXiH','16396eOQdeW','BFF\x20lock\x20file\x20not\x20found.','Function\x20not\x20found:\x20','4684360WDBkzF','scriptsRootDir','trashedTo','target','9EONvBp','scriptsRoot','includes','string','87496GQXhQL','split','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','2759220uWhbBK','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','validation','No\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','73512VfueqR','appCode','functions','toISOString','projectRoot','\x20\x20-\x20','remoteId','map','length','scriptsWorkspaceRoot','8CyMiua','2866534SkuEej','delete','high-risk-write','\x20(local\x20file\x20moved\x20to\x20trash)','Deleted\x20','str','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','bff','replace','36VwHiwB'];a18_0x4273=function(){return _0x346008;};return a18_0x4273();}function resolveDeleteTarget(_0x300d39,_0x5697e3){const _0x3e5aa4=a18_0x5387f5;if(_0x300d39[_0x3e5aa4(0x1c4)]('/')){const _0x31debc=_0x5697e3['find'](_0x47c269=>_0x47c269===_0x300d39);if(!_0x31debc)throw CliErrors[_0x3e5aa4(0x1cb)](_0x3e5aa4(0x1bd)+_0x300d39);return _0x31debc;}const _0x13c688=_0x5697e3['filter'](_0x34f734=>_0x34f734[_0x3e5aa4(0x1c7)]('/')['at'](-0x1)===_0x300d39);if(_0x13c688[_0x3e5aa4(0x1a9)]===0x0)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x300d39);if(_0x13c688[_0x3e5aa4(0x1a9)]>0x1)throw CliErrors['validation']('Multiple\x20functions\x20match\x20\x22'+_0x300d39+_0x3e5aa4(0x1c8)+_0x13c688[_0x3e5aa4(0x1a8)](_0x1353e3=>_0x3e5aa4(0x1d3)+_0x1353e3)[_0x3e5aa4(0x1b6)]('\x0a'));return _0x13c688[0x0];}async function moveToTrash(_0x4d63c6,_0x4d0560,_0x419266){const _0x253395=a18_0x5387f5,_0x4a42fb=new Date()[_0x253395(0x1d1)]()[_0x253395(0x1b4)](/[:.]/g,'-'),_0x44f499=relative(_0x4d63c6,_0x419266),_0x31a61d=join(_0x4d0560,_0x4a42fb,_0x44f499);return await mkdir(dirname(_0x31a61d),{'recursive':!![]}),await rename(_0x419266,_0x31a61d),_0x31a61d;}async function cleanupEmptyDirectories(_0x9c7234,_0x3ae2f2){const _0x733a46=a18_0x5387f5;let _0x2d8a75=resolve(_0x9c7234);const _0x2da860=resolve(_0x3ae2f2);while(_0x2d8a75[_0x733a46(0x1cd)](''+_0x2da860+sep)||_0x2d8a75===_0x2da860){if(_0x2d8a75===_0x2da860)return;try{const _0xaf11aa=await readdir(_0x2d8a75);if(_0xaf11aa[_0x733a46(0x1a9)]>0x0)return;await rmdir(_0x2d8a75);}catch{return;}_0x2d8a75=dirname(_0x2d8a75);}}
1
+ const a19_0x5b102f=a19_0x1d1d;(function(_0x5893b8,_0x47e384){const _0xf0c292=a19_0x1d1d,_0x144508=_0x5893b8();while(!![]){try{const _0x40def8=-parseInt(_0xf0c292(0x8b))/0x1*(parseInt(_0xf0c292(0xa4))/0x2)+parseInt(_0xf0c292(0xa6))/0x3*(-parseInt(_0xf0c292(0x89))/0x4)+-parseInt(_0xf0c292(0x80))/0x5*(parseInt(_0xf0c292(0x83))/0x6)+parseInt(_0xf0c292(0x86))/0x7*(-parseInt(_0xf0c292(0x93))/0x8)+parseInt(_0xf0c292(0x8f))/0x9*(parseInt(_0xf0c292(0x96))/0xa)+-parseInt(_0xf0c292(0x8e))/0xb+-parseInt(_0xf0c292(0x87))/0xc*(-parseInt(_0xf0c292(0x82))/0xd);if(_0x40def8===_0x47e384)break;else _0x144508['push'](_0x144508['shift']());}catch(_0x1f7976){_0x144508['push'](_0x144508['shift']());}}}(a19_0x3c2f,0xdca09));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a19_0x1d1d(_0x4e922d,_0x11bc2e){_0x4e922d=_0x4e922d-0x7b;const _0x3c2f8f=a19_0x3c2f();let _0x1d1daa=_0x3c2f8f[_0x4e922d];return _0x1d1daa;}function a19_0x3c2f(){const _0x129485=['42YEILHw','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','delete','replace','scriptsRootDir','bff','Function\x20not\x20found:\x20','string','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','120485jqsBMu','\x20\x20-\x20','13ZSVRnq','156cYAcvp','map','\x20(local\x20file\x20moved\x20to\x20trash)','29393aUkkvP','51852588hJOWzr','remoteId','315224iAODHz','Deleted\x20','107TTTgiH','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','str','2411552bsBiUa','6724287tTRwCN','toISOString','validation','filter','3104CADySH','Multiple\x20functions\x20match\x20\x22','scriptsWorkspaceRoot','10LFpSVv','keys','scriptsRoot','startsWith','lastSync','length','find','includes','No\x20lock\x20entry\x20found\x20for\x20\x22','lockFilePath','join','high-risk-write','functions','appCode','10958plrrTG','target'];a19_0x3c2f=function(){return _0x129485;};return a19_0x3c2f();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a19_0x5b102f(0x7c),'command':'delete','description':a19_0x5b102f(0x7f),'risk':a19_0x5b102f(0xa1),'flags':[{'name':a19_0x5b102f(0xa5),'type':a19_0x5b102f(0x7e),'required':!![],'description':a19_0x5b102f(0xa7)}],async 'validate'(_0x3abb55){const _0x9c7be7=a19_0x5b102f,_0x37a179=loadBffProjectConfig(_0x3abb55['appCode']),_0xe94a4e=await readBffLockFile(_0x37a179[_0x9c7be7(0x9f)]);if(!_0xe94a4e)throw CliErrors['validation'](_0x9c7be7(0x8c));},async 'execute'(_0x29d191){const _0x53cd8d=a19_0x5b102f,_0x13b0df=loadBffProjectConfig(_0x29d191[_0x53cd8d(0xa3)]),_0x3c6d2b=await readBffLockFile(_0x13b0df[_0x53cd8d(0x9f)]);if(!_0x3c6d2b)throw CliErrors[_0x53cd8d(0x91)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x298267,appLock:_0xfc5bf}=ensureLockScope(_0x3c6d2b,_0x13b0df[_0x53cd8d(0xa3)],_0x13b0df[_0x53cd8d(0x98)],_0x53cd8d(0xa8),_0x13b0df[_0x53cd8d(0xa3)],_0x13b0df[_0x53cd8d(0x95)]+'/'+_0x13b0df[_0x53cd8d(0xa3)]),_0x2bfc30=_0x29d191[_0x53cd8d(0x8d)](_0x53cd8d(0xa5)),_0x5f0892=Object[_0x53cd8d(0x97)](_0xfc5bf['functions']),_0x387444=resolveDeleteTarget(_0x2bfc30,_0x5f0892),_0x53092c=_0xfc5bf[_0x53cd8d(0xa2)][_0x387444];if(!_0x53092c)throw CliErrors[_0x53cd8d(0x91)](_0x53cd8d(0x9e)+_0x387444+'\x22.');await deleteBffScript(_0x53092c[_0x53cd8d(0x88)]),delete _0xfc5bf[_0x53cd8d(0xa2)][_0x387444],_0xfc5bf[_0x53cd8d(0x9a)]=new Date()['toISOString'](),await writeBffLockFile(_0x13b0df[_0x53cd8d(0x9f)],_0x298267);const _0x19ef5e=resolveLocalFilePathFromLockKey(_0x13b0df,_0x387444);let _0x3e20c0;await fileExists(_0x19ef5e)&&(_0x3e20c0=await moveToTrash(_0x13b0df['projectRoot'],_0x13b0df['trashDir'],_0x19ef5e),await cleanupEmptyDirectories(dirname(_0x19ef5e),_0x13b0df[_0x53cd8d(0x7b)]));const _0x394bdc={'deleted':_0x387444,'remoteId':_0x53092c['remoteId']};if(_0x3e20c0)_0x394bdc['trashedTo']=_0x3e20c0;return{'ok':!![],'data':_0x394bdc,'message':_0x53cd8d(0x8a)+_0x387444+(_0x3e20c0?_0x53cd8d(0x85):'')};}};function resolveDeleteTarget(_0xf855e2,_0x9a55d2){const _0x1a86f4=a19_0x5b102f;if(_0xf855e2[_0x1a86f4(0x9d)]('/')){const _0x44c954=_0x9a55d2[_0x1a86f4(0x9c)](_0x3f29c0=>_0x3f29c0===_0xf855e2);if(!_0x44c954)throw CliErrors['validation'](_0x1a86f4(0x7d)+_0xf855e2);return _0x44c954;}const _0x439044=_0x9a55d2[_0x1a86f4(0x92)](_0x3d4c73=>_0x3d4c73['split']('/')['at'](-0x1)===_0xf855e2);if(_0x439044['length']===0x0)throw CliErrors[_0x1a86f4(0x91)](_0x1a86f4(0x7d)+_0xf855e2);if(_0x439044[_0x1a86f4(0x9b)]>0x1)throw CliErrors[_0x1a86f4(0x91)](_0x1a86f4(0x94)+_0xf855e2+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x439044[_0x1a86f4(0x84)](_0x6dfa99=>_0x1a86f4(0x81)+_0x6dfa99)[_0x1a86f4(0xa0)]('\x0a'));return _0x439044[0x0];}async function moveToTrash(_0x25fcc4,_0x22b898,_0x480cfd){const _0x2cb477=a19_0x5b102f,_0x3bcd5b=new Date()[_0x2cb477(0x90)]()[_0x2cb477(0xa9)](/[:.]/g,'-'),_0x2ba3fc=relative(_0x25fcc4,_0x480cfd),_0x121112=join(_0x22b898,_0x3bcd5b,_0x2ba3fc);return await mkdir(dirname(_0x121112),{'recursive':!![]}),await rename(_0x480cfd,_0x121112),_0x121112;}async function cleanupEmptyDirectories(_0x16ff9f,_0x49b294){const _0x176c5b=a19_0x5b102f;let _0x5f1ae7=resolve(_0x16ff9f);const _0x40cb5b=resolve(_0x49b294);while(_0x5f1ae7[_0x176c5b(0x99)](''+_0x40cb5b+sep)||_0x5f1ae7===_0x40cb5b){if(_0x5f1ae7===_0x40cb5b)return;try{const _0x3811c5=await readdir(_0x5f1ae7);if(_0x3811c5[_0x176c5b(0x9b)]>0x0)return;await rmdir(_0x5f1ae7);}catch{return;}_0x5f1ae7=dirname(_0x5f1ae7);}}
@@ -1 +1 @@
1
- const a19_0x14ebeb=a19_0x3723;(function(_0x5c9503,_0x1077fd){const _0x5d6e31=a19_0x3723,_0xe730cb=_0x5c9503();while(!![]){try{const _0x18601d=-parseInt(_0x5d6e31(0xab))/0x1+parseInt(_0x5d6e31(0xb3))/0x2+-parseInt(_0x5d6e31(0xa7))/0x3*(parseInt(_0x5d6e31(0xa4))/0x4)+-parseInt(_0x5d6e31(0xa5))/0x5+-parseInt(_0x5d6e31(0xb4))/0x6*(-parseInt(_0x5d6e31(0xb1))/0x7)+-parseInt(_0x5d6e31(0xb0))/0x8*(-parseInt(_0x5d6e31(0xa0))/0x9)+parseInt(_0x5d6e31(0xaa))/0xa;if(_0x18601d===_0x1077fd)break;else _0xe730cb['push'](_0xe730cb['shift']());}catch(_0x37e5c5){_0xe730cb['push'](_0xe730cb['shift']());}}}(a19_0x4320,0x686b5));function a19_0x4320(){const _0x11b768=['3443490JsUYvq','730370SRKGen','Get\x20BFF\x20script\x20details\x20by\x20ID','scriptContent','bff','updatedTime','368LiHiaI','4005932HOLKxr','verbose','1552174OoCMFC','6sEGuwf','createdTime','number','bool','read','120105VLveZX','num','appCode','Script\x20ID','588LLurHN','2374050UiDdHC','scriptType','13749zVTiVa','boolean','(none)'];a19_0x4320=function(){return _0x11b768;};return a19_0x4320();}function a19_0x3723(_0x4649a1,_0x114644){_0x4649a1=_0x4649a1-0x9f;const _0x432033=a19_0x4320();let _0x372386=_0x432033[_0x4649a1];return _0x372386;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a19_0x14ebeb(0xae),'command':'detail','description':a19_0x14ebeb(0xac),'risk':a19_0x14ebeb(0x9f),'flags':[{'name':'id','type':a19_0x14ebeb(0xb6),'required':!![],'description':a19_0x14ebeb(0xa3)},{'name':a19_0x14ebeb(0xb2),'type':a19_0x14ebeb(0xa8),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x595d3a){const _0x301956=a19_0x14ebeb,_0x38b442=await getBffScriptInfo(_0x595d3a[_0x301956(0xa1)]('id')),_0x4d8167=_0x595d3a[_0x301956(0xb7)]('verbose');if(_0x4d8167)return{'ok':!![],'data':_0x38b442};return{'ok':!![],'data':{'id':_0x38b442['id'],'appCode':_0x38b442[_0x301956(0xa2)],'scriptType':_0x38b442[_0x301956(0xa6)],'description':_0x38b442['description']||_0x301956(0xa9),'createdTime':_0x38b442[_0x301956(0xb5)]??'','updatedTime':_0x38b442[_0x301956(0xaf)]??'','scriptContent':_0x38b442[_0x301956(0xad)]??''}};}};
1
+ function a20_0x9ec7(_0x438d08,_0x1edd28){_0x438d08=_0x438d08-0x1a4;const _0x21eee0=a20_0x21ee();let _0x9ec7e4=_0x21eee0[_0x438d08];return _0x9ec7e4;}const a20_0x1e3176=a20_0x9ec7;(function(_0x4fb92b,_0x4eb8d6){const _0x29bbc0=a20_0x9ec7,_0x4415a8=_0x4fb92b();while(!![]){try{const _0x13900c=parseInt(_0x29bbc0(0x1b1))/0x1+parseInt(_0x29bbc0(0x1a8))/0x2+parseInt(_0x29bbc0(0x1b9))/0x3+parseInt(_0x29bbc0(0x1ab))/0x4+-parseInt(_0x29bbc0(0x1ac))/0x5*(parseInt(_0x29bbc0(0x1a5))/0x6)+parseInt(_0x29bbc0(0x1bb))/0x7*(parseInt(_0x29bbc0(0x1a7))/0x8)+-parseInt(_0x29bbc0(0x1a4))/0x9*(parseInt(_0x29bbc0(0x1af))/0xa);if(_0x13900c===_0x4eb8d6)break;else _0x4415a8['push'](_0x4415a8['shift']());}catch(_0x43a366){_0x4415a8['push'](_0x4415a8['shift']());}}}(a20_0x21ee,0x3b462));import{getBffScriptInfo}from'../../core/api-client.js';function a20_0x21ee(){const _0x3efcd8=['number','1249443xmSZKa','scriptContent','86114uleSsf','scriptType','45nheROx','79158rBNiNR','bff','56BJfcrU','248058czSkLL','read','bool','250784oSemCz','85epErRI','verbose','detail','914710udPadK','createdTime','235102jlHgEO','num','Script\x20ID','boolean','description','updatedTime','Return\x20full\x20raw\x20script\x20object'];a20_0x21ee=function(){return _0x3efcd8;};return a20_0x21ee();}export const bffDetail={'service':a20_0x1e3176(0x1a6),'command':a20_0x1e3176(0x1ae),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a20_0x1e3176(0x1a9),'flags':[{'name':'id','type':a20_0x1e3176(0x1b8),'required':!![],'description':a20_0x1e3176(0x1b3)},{'name':a20_0x1e3176(0x1ad),'type':a20_0x1e3176(0x1b4),'description':a20_0x1e3176(0x1b7)}],async 'execute'(_0x47843f){const _0x2c0cee=a20_0x1e3176,_0x383fb0=await getBffScriptInfo(_0x47843f[_0x2c0cee(0x1b2)]('id')),_0x20621d=_0x47843f[_0x2c0cee(0x1aa)]('verbose');if(_0x20621d)return{'ok':!![],'data':_0x383fb0};return{'ok':!![],'data':{'id':_0x383fb0['id'],'appCode':_0x383fb0['appCode'],'scriptType':_0x383fb0[_0x2c0cee(0x1bc)],'description':_0x383fb0[_0x2c0cee(0x1b5)]||'(none)','createdTime':_0x383fb0[_0x2c0cee(0x1b0)]??'','updatedTime':_0x383fb0[_0x2c0cee(0x1b6)]??'','scriptContent':_0x383fb0[_0x2c0cee(0x1ba)]??''}};}};
@@ -1 +1 @@
1
- function a20_0x46bf(_0x33e552,_0x56b65b){_0x33e552=_0x33e552-0x7b;const _0x461913=a20_0x4619();let _0x46bf98=_0x461913[_0x33e552];return _0x46bf98;}(function(_0x2a822c,_0x2d98eb){const _0x4dcf09=a20_0x46bf,_0x188b22=_0x2a822c();while(!![]){try{const _0x2aef9b=-parseInt(_0x4dcf09(0x81))/0x1*(-parseInt(_0x4dcf09(0x7e))/0x2)+parseInt(_0x4dcf09(0x7d))/0x3+-parseInt(_0x4dcf09(0x85))/0x4*(parseInt(_0x4dcf09(0x80))/0x5)+-parseInt(_0x4dcf09(0x82))/0x6*(-parseInt(_0x4dcf09(0x7b))/0x7)+parseInt(_0x4dcf09(0x84))/0x8+-parseInt(_0x4dcf09(0x7f))/0x9*(parseInt(_0x4dcf09(0x7c))/0xa)+-parseInt(_0x4dcf09(0x83))/0xb;if(_0x2aef9b===_0x2d98eb)break;else _0x188b22['push'](_0x188b22['shift']());}catch(_0x27583d){_0x188b22['push'](_0x188b22['shift']());}}}(a20_0x4619,0xa155e));import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';function a20_0x4619(){const _0x327d0f=['9VZebdk','255bzasJT','81421HzTJta','5979612QeJNAR','6405454vxRNlE','10392560sbddMQ','88360Wlwhkc','7eqmBNJ','8067830rzewos','1909746DeIlzT','6vfMIrv'];a20_0x4619=function(){return _0x327d0f;};return a20_0x4619();}import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ function a21_0x2114(_0x54a1c3,_0xee3197){_0x54a1c3=_0x54a1c3-0xfd;const _0x26fc83=a21_0x26fc();let _0x21145a=_0x26fc83[_0x54a1c3];return _0x21145a;}(function(_0x35e380,_0x4576e4){const _0x2ee42e=a21_0x2114,_0x17e3c6=_0x35e380();while(!![]){try{const _0x5413b5=-parseInt(_0x2ee42e(0x108))/0x1*(parseInt(_0x2ee42e(0xfd))/0x2)+parseInt(_0x2ee42e(0x100))/0x3*(parseInt(_0x2ee42e(0x106))/0x4)+parseInt(_0x2ee42e(0x101))/0x5*(parseInt(_0x2ee42e(0x105))/0x6)+-parseInt(_0x2ee42e(0xff))/0x7+parseInt(_0x2ee42e(0x102))/0x8*(parseInt(_0x2ee42e(0x104))/0x9)+parseInt(_0x2ee42e(0xfe))/0xa*(-parseInt(_0x2ee42e(0x107))/0xb)+parseInt(_0x2ee42e(0x103))/0xc;if(_0x5413b5===_0x4576e4)break;else _0x17e3c6['push'](_0x17e3c6['shift']());}catch(_0x47b719){_0x17e3c6['push'](_0x17e3c6['shift']());}}}(a21_0x26fc,0x7a2d1));import{bffList}from'./list.js';function a21_0x26fc(){const _0x3d7c8e=['360shCURl','1661880ICaaFv','40914WmjVPE','79386yaYXDe','388PfDCfs','1417845DFkCXH','43271HSIINF','22VOcACo','30AtiHIz','619507liVTNw','24873JOIxzm','115FcNQQN'];a21_0x26fc=function(){return _0x3d7c8e;};return a21_0x26fc();}import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- function a21_0x5f5c(_0x10e68c,_0x3fbbd9){_0x10e68c=_0x10e68c-0x18b;const _0x86afad=a21_0x86af();let _0x5f5c1b=_0x86afad[_0x10e68c];return _0x5f5c1b;}const a21_0x2aab9f=a21_0x5f5c;function a21_0x86af(){const _0x341b18=['No\x20BFF\x20scripts\x20found.','bool','type','289122HKzTvj','string','read','bff','124WHHagS','1266LABUUv','name','verbose','Filter\x20by\x20script\x20name','appCode','1626200HSyfCo','2801457LRCLMY','(unnamed)','Return\x20full\x20script\x20objects','7273YwnsxO','str','326613mkWsLn','scriptType','List\x20BFF\x20scripts','ENDPOINT','boolean','59005GhwtdU','functionName','length','map','30026oQesiY'];a21_0x86af=function(){return _0x341b18;};return a21_0x86af();}(function(_0x48f9d4,_0x37eec8){const _0x11b811=a21_0x5f5c,_0x58a115=_0x48f9d4();while(!![]){try{const _0x36c22a=-parseInt(_0x11b811(0x18d))/0x1+-parseInt(_0x11b811(0x196))/0x2+-parseInt(_0x11b811(0x19a))/0x3+parseInt(_0x11b811(0x19e))/0x4*(parseInt(_0x11b811(0x192))/0x5)+parseInt(_0x11b811(0x19f))/0x6*(parseInt(_0x11b811(0x18b))/0x7)+-parseInt(_0x11b811(0x1a4))/0x8+parseInt(_0x11b811(0x1a5))/0x9;if(_0x36c22a===_0x37eec8)break;else _0x58a115['push'](_0x58a115['shift']());}catch(_0x4047ab){_0x58a115['push'](_0x58a115['shift']());}}}(a21_0x86af,0x3e452));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a21_0x2aab9f(0x19d),'command':'list','description':a21_0x2aab9f(0x18f),'risk':a21_0x2aab9f(0x19c),'flags':[{'name':a21_0x2aab9f(0x199),'type':a21_0x2aab9f(0x19b),'description':'Script\x20type\x20filter','default':a21_0x2aab9f(0x190),'enum':[a21_0x2aab9f(0x190),'COMMON']},{'name':a21_0x2aab9f(0x1a0),'type':a21_0x2aab9f(0x19b),'description':a21_0x2aab9f(0x1a2)},{'name':a21_0x2aab9f(0x1a1),'type':a21_0x2aab9f(0x191),'description':a21_0x2aab9f(0x1a7)}],async 'execute'(_0x415ee9){const _0x2ece39=a21_0x2aab9f,_0x1f6fb2=await listBffScripts(_0x415ee9[_0x2ece39(0x1a3)],_0x415ee9[_0x2ece39(0x18c)]('type'),{'scriptName':_0x415ee9[_0x2ece39(0x18c)]('name')||undefined}),_0x396430=_0x415ee9[_0x2ece39(0x198)](_0x2ece39(0x1a1));return{'ok':!![],'data':_0x396430?_0x1f6fb2:_0x1f6fb2[_0x2ece39(0x195)](_0x5ccad1=>({'id':_0x5ccad1['id'],'functionName':_0x5ccad1[_0x2ece39(0x193)]??'','description':_0x5ccad1['description']||_0x2ece39(0x1a6),'scriptType':_0x5ccad1[_0x2ece39(0x18e)]})),'message':_0x1f6fb2[_0x2ece39(0x194)]===0x0?_0x2ece39(0x197):undefined};}};
1
+ const a22_0x584037=a22_0x5609;(function(_0x316c93,_0x57ef3b){const _0x491999=a22_0x5609,_0x29e95e=_0x316c93();while(!![]){try{const _0x3400cf=parseInt(_0x491999(0x84))/0x1+-parseInt(_0x491999(0x8f))/0x2*(-parseInt(_0x491999(0x75))/0x3)+-parseInt(_0x491999(0x8c))/0x4*(-parseInt(_0x491999(0x7b))/0x5)+parseInt(_0x491999(0x7c))/0x6*(parseInt(_0x491999(0x91))/0x7)+-parseInt(_0x491999(0x78))/0x8+-parseInt(_0x491999(0x8a))/0x9*(parseInt(_0x491999(0x89))/0xa)+-parseInt(_0x491999(0x80))/0xb;if(_0x3400cf===_0x57ef3b)break;else _0x29e95e['push'](_0x29e95e['shift']());}catch(_0x2ed180){_0x29e95e['push'](_0x29e95e['shift']());}}}(a22_0x21b5,0xd267c));function a22_0x5609(_0x1d43f0,_0x373796){_0x1d43f0=_0x1d43f0-0x75;const _0x21b52e=a22_0x21b5();let _0x560965=_0x21b52e[_0x1d43f0];return _0x560965;}function a22_0x21b5(){const _0x4d9ed8=['50644iCFMFd','list','bff','111212EcGmao','No\x20BFF\x20scripts\x20found.','14364gvSdvq','List\x20BFF\x20scripts','type','6CgmfSd','str','description','3048056jmAJTD','functionName','COMMON','105uxpQBA','4506bWTIQX','Script\x20type\x20filter','length','verbose','24502258EyDfhb','boolean','scriptType','ENDPOINT','1607360xJnbSU','name','bool','string','map','24000iSmgPJ','207eZBtKe','Filter\x20by\x20script\x20name'];a22_0x21b5=function(){return _0x4d9ed8;};return a22_0x21b5();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a22_0x584037(0x8e),'command':a22_0x584037(0x8d),'description':a22_0x584037(0x92),'risk':'read','flags':[{'name':a22_0x584037(0x93),'type':a22_0x584037(0x87),'description':a22_0x584037(0x7d),'default':a22_0x584037(0x83),'enum':[a22_0x584037(0x83),a22_0x584037(0x7a)]},{'name':a22_0x584037(0x85),'type':a22_0x584037(0x87),'description':a22_0x584037(0x8b)},{'name':'verbose','type':a22_0x584037(0x81),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x2889a8){const _0x2226d1=a22_0x584037,_0x57447b=await listBffScripts(_0x2889a8['appCode'],_0x2889a8[_0x2226d1(0x76)](_0x2226d1(0x93)),{'scriptName':_0x2889a8[_0x2226d1(0x76)](_0x2226d1(0x85))||undefined}),_0xf90bf1=_0x2889a8[_0x2226d1(0x86)](_0x2226d1(0x7f));return{'ok':!![],'data':_0xf90bf1?_0x57447b:_0x57447b[_0x2226d1(0x88)](_0x232cc8=>({'id':_0x232cc8['id'],'functionName':_0x232cc8[_0x2226d1(0x79)]??'','description':_0x232cc8[_0x2226d1(0x77)]||'(unnamed)','scriptType':_0x232cc8[_0x2226d1(0x82)]})),'message':_0x57447b[_0x2226d1(0x7e)]===0x0?_0x2226d1(0x90):undefined};}};
@@ -1 +1 @@
1
- const a22_0x56bc11=a22_0xe834;(function(_0x5653ae,_0x303b89){const _0xe1fcd=a22_0xe834,_0x4b9304=_0x5653ae();while(!![]){try{const _0x5db4bb=-parseInt(_0xe1fcd(0xb0))/0x1*(-parseInt(_0xe1fcd(0x9c))/0x2)+-parseInt(_0xe1fcd(0xb5))/0x3+parseInt(_0xe1fcd(0xde))/0x4+parseInt(_0xe1fcd(0xa3))/0x5+parseInt(_0xe1fcd(0xa5))/0x6+-parseInt(_0xe1fcd(0xd7))/0x7+parseInt(_0xe1fcd(0xeb))/0x8*(-parseInt(_0xe1fcd(0xcc))/0x9);if(_0x5db4bb===_0x303b89)break;else _0x4b9304['push'](_0x4b9304['shift']());}catch(_0x30b568){_0x4b9304['push'](_0x4b9304['shift']());}}}(a22_0x1858,0xb985d));function a22_0x1858(){const _0xe9f827=['1611pIcgKI','\x0a\x20*\x20[脚本名称]\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x20api\x20pull`\x20to\x20refresh.','366585TvVXMC','appCode','TODO:\x20add\x20script\x20description','str','COMMON','includes','File\x20already\x20exists:\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Dataset\x20not\x20found\x20for\x20code\x20\x22','alias','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','type','length','datasetcode','No\x20operation\x20types\x20found\x20for\x20dataset\x20','map','\x0a\x20*\x20[触发节点]\x20','find','tableName','parseInt','apiDir','Operation\x20type\x20\x22','140085aMObBy','\x22.\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','datasetCode','ENDPOINT','HOOK','operation-type','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','utf8','validation','question','4933467pvOBpt','code','Script\x20description','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Created\x20','write','5813396GAnBHF','Alias\x20\x22','name','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','.js','\x20function:\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','No\x20api.ts\x20found.\x20Run\x20`','\x22\x20not\x20found.\x20','HOOK\x20requires\x20alias/operation/node\x20options.','close','Select\x20trigger\x20node:','operationType','696IdcqQL','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Select\x20dataset:','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','new','function-node','Trigger\x20node\x20(HOOK\x20only)','Invalid\x20dataset\x20selection.','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','description','stderr','No\x20datasets\x20found\x20for\x20this\x20app.','74OMvreH','join','before','\x22\x20not\x20found\x20for\x20dataset\x20','entries','Available:\x20','Available\x20aliases:\x20','516090fcSLlA','scriptsRootDir','7949148CsjUYZ','keys','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','after','Invalid\x20function\x20name\x20\x22','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','functionNode','string','isInteger','nonInteractive'];a22_0x1858=function(){return _0xe9f827;};return a22_0x1858();}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':'bff','command':a22_0x56bc11(0x94),'description':a22_0x56bc11(0xe1),'risk':a22_0x56bc11(0xdd),'flags':[{'name':a22_0x56bc11(0xc1),'type':a22_0x56bc11(0xad),'required':!![],'enum':[a22_0x56bc11(0xb9),'ENDPOINT',a22_0x56bc11(0xd1)],'description':'Script\x20type'},{'name':a22_0x56bc11(0xe0),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a22_0x56bc11(0xad),'description':a22_0x56bc11(0xd9)},{'name':'alias','type':a22_0x56bc11(0xad),'description':a22_0x56bc11(0xdb)},{'name':a22_0x56bc11(0xc3),'type':a22_0x56bc11(0xad),'description':a22_0x56bc11(0xab)},{'name':a22_0x56bc11(0xd2),'type':a22_0x56bc11(0xad),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a22_0x56bc11(0xad),'description':a22_0x56bc11(0x96),'enum':[a22_0x56bc11(0x9e),a22_0x56bc11(0xa8)]}],async 'validate'(_0x67edf7){const _0x1e8500=a22_0x56bc11,_0x19b48a=_0x67edf7[_0x1e8500(0xb8)](_0x1e8500(0xe0));if(!isValidBffFunctionName(_0x19b48a))throw CliErrors[_0x1e8500(0xd5)](_0x1e8500(0xa9)+_0x19b48a+_0x1e8500(0xd3));},async 'execute'(_0x1aa221){const _0x374b71=a22_0x56bc11,_0x5b5801=loadBffProjectConfig(_0x1aa221[_0x374b71(0xb6)]),_0x261902=_0x1aa221[_0x374b71(0xb8)]('type'),_0x127daf=_0x1aa221[_0x374b71(0xb8)]('name'),_0x330c79=_0x1aa221[_0x374b71(0xb8)](_0x374b71(0x99))||undefined,_0x2b8e26=_0x261902==='HOOK'?await resolveHookOptions(_0x5b5801,_0x1aa221):undefined,_0x1af1f5=buildFilePath(_0x5b5801,_0x261902,_0x127daf,_0x2b8e26);if(await fileExists(_0x1af1f5))throw CliErrors[_0x374b71(0xd5)](_0x374b71(0xbb)+_0x1af1f5);await mkdir(dirname(_0x1af1f5),{'recursive':!![]});const _0x103351=generateTemplate(_0x261902,_0x127daf,_0x5b5801,_0x330c79,_0x2b8e26);await writeFile(_0x1af1f5,_0x103351,_0x374b71(0xd4));const _0x2f5fe1={'type':_0x261902,'name':_0x127daf,'path':_0x1af1f5};if(_0x330c79)_0x2f5fe1[_0x374b71(0x99)]=_0x330c79;if(_0x2b8e26){if(_0x2b8e26[_0x374b71(0xbe)])_0x2f5fe1['alias']=_0x2b8e26[_0x374b71(0xbe)];_0x2f5fe1['datasetCode']=_0x2b8e26[_0x374b71(0xcf)],_0x2f5fe1[_0x374b71(0xea)]=_0x2b8e26[_0x374b71(0xea)],_0x2f5fe1[_0x374b71(0xac)]=_0x2b8e26['functionNode'];}return{'ok':!![],'data':_0x2f5fe1,'message':_0x374b71(0xdc)+_0x261902+_0x374b71(0xe3)+_0x127daf};}};async function resolveHookOptions(_0x2aa348,_0x20a0f7){const _0x23356c=a22_0x56bc11,_0x3c80ea=loadAliasMap(_0x20a0f7[_0x23356c(0xca)]),_0x9bd01b=_0x3c80ea[_0x23356c(0xc2)]>0x0;let _0x420c20,_0x4c93de,_0x541fa9;const _0x272b63=_0x20a0f7['str'](_0x23356c(0xbe)),_0x4106a2=_0x20a0f7['str'](_0x23356c(0xc3));if(_0x272b63){const _0x1be821=resolveAlias(_0x20a0f7['apiDir'],_0x272b63);if(!_0x1be821){const _0x260f1e=_0x9bd01b?_0x23356c(0xa2)+_0x3c80ea[_0x23356c(0xc5)](_0x498071=>_0x498071[_0x23356c(0xbe)])['join'](',\x20'):_0x23356c(0xe5)+CLI_BIN_NAME+_0x23356c(0xbc);throw CliErrors[_0x23356c(0xd5)](_0x23356c(0xdf)+_0x272b63+_0x23356c(0xe6)+_0x260f1e);}_0x420c20=_0x272b63,_0x4c93de=_0x1be821;}else{if(_0x4106a2){_0x4c93de=_0x4106a2;const _0x9ce6a7=_0x3c80ea[_0x23356c(0xc7)](_0x331743=>_0x331743[_0x23356c(0xcf)]===_0x4106a2);_0x420c20=_0x9ce6a7?.[_0x23356c(0xbe)];}else{if(_0x20a0f7[_0x23356c(0xaf)])throw CliErrors[_0x23356c(0xd5)](_0x23356c(0xee));else{if(_0x9bd01b){const _0x307ff1=_0x3c80ea[_0x23356c(0xc5)](_0xf13827=>_0xf13827[_0x23356c(0xbe)]+'\x20('+_0xf13827[_0x23356c(0xc8)]+')'),_0x17ed51=await promptSelect('Select\x20dataset:',_0x307ff1),_0x484e8a=_0x3c80ea[_0x17ed51];if(!_0x484e8a)throw CliErrors[_0x23356c(0xd5)](_0x23356c(0x97));_0x420c20=_0x484e8a[_0x23356c(0xbe)],_0x4c93de=_0x484e8a[_0x23356c(0xcf)];}else{const _0x4d22bf=await listDatasets(_0x2aa348[_0x23356c(0xb6)]);if(_0x4d22bf[_0x23356c(0xc2)]===0x0)throw CliErrors[_0x23356c(0xd5)](_0x23356c(0x9b));const _0x35d1f1=_0x4d22bf[_0x23356c(0xc5)](_0x3e0985=>_0x3e0985[_0x23356c(0xe0)]+'\x20('+_0x3e0985[_0x23356c(0xd8)]+')'),_0x3bad5f=await promptSelect(_0x23356c(0xed),_0x35d1f1),_0x35e902=_0x4d22bf[_0x3bad5f];if(!_0x35e902)throw CliErrors[_0x23356c(0xd5)](_0x23356c(0x97));_0x4c93de=_0x35e902['code'],_0x420c20=undefined;}}}}const _0x5d3042=await listDatasets(_0x2aa348['appCode']),_0x4f63f6=_0x5d3042['find'](_0x5b6361=>_0x5b6361[_0x23356c(0xd8)]===_0x4c93de);if(!_0x4f63f6)throw CliErrors[_0x23356c(0xd5)](_0x23356c(0xbd)+_0x4c93de+_0x23356c(0xcd)+(_0x420c20?_0x23356c(0xda)+CLI_BIN_NAME+_0x23356c(0xb4):''));_0x541fa9=_0x4f63f6['id'];const _0x41cbac=_0x420c20??_0x4c93de,_0x3a0e5a=await listBffDatasetOperations(_0x2aa348[_0x23356c(0xb6)],_0x541fa9),_0x36aa3d=_0x3a0e5a?Object[_0x23356c(0xa6)](_0x3a0e5a):[];if(_0x36aa3d[_0x23356c(0xc2)]===0x0)throw CliErrors['validation'](_0x23356c(0xc4)+_0x41cbac+'.');let _0x1beb0c;const _0x5ecd05=_0x20a0f7[_0x23356c(0xb8)]('operation-type');if(_0x5ecd05){if(!_0x36aa3d[_0x23356c(0xba)](_0x5ecd05))throw CliErrors[_0x23356c(0xd5)](_0x23356c(0xcb)+_0x5ecd05+_0x23356c(0x9f)+_0x41cbac+'.\x20'+(_0x23356c(0xa1)+_0x36aa3d[_0x23356c(0x9d)](',\x20')));_0x1beb0c=_0x5ecd05;}else{if(_0x20a0f7[_0x23356c(0xaf)])throw CliErrors[_0x23356c(0xd5)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x28c6d2=await promptSelect('Select\x20operation\x20type:',_0x36aa3d);_0x1beb0c=_0x36aa3d[_0x28c6d2]??_0x36aa3d[0x0];}let _0xe3dc04=normalizeHookFunctionNode(_0x20a0f7['str'](_0x23356c(0x95)));if(!_0xe3dc04){if(_0x20a0f7['str'](_0x23356c(0x95)))throw CliErrors[_0x23356c(0xd5)](_0x23356c(0xce));if(_0x20a0f7[_0x23356c(0xaf)])throw CliErrors[_0x23356c(0xd5)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x4eaa01=await promptSelect(_0x23356c(0xe9),[_0x23356c(0x9e),_0x23356c(0xa8)]);_0xe3dc04=[_0x23356c(0x9e),_0x23356c(0xa8)][_0x4eaa01]??'before';}return{'alias':_0x420c20,'datasetCode':_0x4c93de,'datasetId':_0x541fa9,'operationType':_0x1beb0c,'functionNode':_0xe3dc04};}function a22_0xe834(_0x3760a1,_0x275a5f){_0x3760a1=_0x3760a1-0x93;const _0x18588c=a22_0x1858();let _0xe8341=_0x18588c[_0x3760a1];return _0xe8341;}async function promptSelect(_0x3dd0d9,_0x144e55){const _0x422785=a22_0x56bc11;if(_0x144e55['length']===0x1)return 0x0;for(const [_0x4b6ec0,_0x55c031]of _0x144e55[_0x422785(0xa0)]()){process[_0x422785(0x9a)][_0x422785(0xdd)]('\x20\x20'+(_0x4b6ec0+0x1)+'.\x20'+_0x55c031+'\x0a');}const _0x3db3c0=createInterface({'input':process[_0x422785(0xc0)],'output':process[_0x422785(0x9a)]});while(!![]){const _0x4047eb=await new Promise(_0x1d072e=>{const _0x58f58d=_0x422785;_0x3db3c0[_0x58f58d(0xd6)](_0x3dd0d9+'\x20',_0x1d072e);}),_0x2c7a42=Number[_0x422785(0xc9)](_0x4047eb['trim'](),0xa);if(Number[_0x422785(0xae)](_0x2c7a42)&&_0x2c7a42>=0x1&&_0x2c7a42<=_0x144e55[_0x422785(0xc2)])return _0x3db3c0[_0x422785(0xe8)](),_0x2c7a42-0x1;process['stderr'][_0x422785(0xdd)](_0x422785(0xe4)+_0x144e55['length']+'.\x0a');}}function buildFilePath(_0x2f0fb8,_0x2bbead,_0x59bd2e,_0x4a7851){const _0x532878=a22_0x56bc11;if(_0x2bbead===_0x532878(0xd1)){if(!_0x4a7851)throw CliErrors['validation'](_0x532878(0xe7));const _0x23130b=_0x4a7851[_0x532878(0xbe)]??_0x4a7851[_0x532878(0xcf)];return join(_0x2f0fb8['scriptsRootDir'],_0x532878(0xd1),_0x23130b,_0x4a7851['operationType'],_0x4a7851[_0x532878(0xac)],_0x59bd2e+_0x532878(0xe2));}return join(_0x2f0fb8[_0x532878(0xa4)],_0x2bbead,_0x59bd2e+_0x532878(0xe2));}function generateTemplate(_0x33e03f,_0x4f9c02,_0x19db36,_0x41ab76,_0x32e53a){const _0x18361b=a22_0x56bc11,_0x207936=_0x41ab76?.['trim']()||_0x18361b(0xb7);if(_0x33e03f==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x207936+_0x18361b(0xb1)+_0x4f9c02+_0x18361b(0xb3)+_0x4f9c02+_0x18361b(0x93)+_0x4f9c02+_0x18361b(0xbf);if(_0x33e03f===_0x18361b(0xd0))return _0x18361b(0xa7)+_0x207936+_0x18361b(0xec)+_0x19db36[_0x18361b(0xb6)]+'/endpoint/'+_0x4f9c02+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4f9c02+_0x18361b(0xbf);if(!_0x32e53a)throw CliErrors[_0x18361b(0xd5)](_0x18361b(0xb2));return _0x18361b(0xaa)+_0x207936+_0x18361b(0xec)+_0x19db36[_0x18361b(0xb6)]+'/'+_0x32e53a[_0x18361b(0xcf)]+'/'+_0x32e53a['operationType']+_0x18361b(0xc6)+_0x32e53a['functionNode']+_0x18361b(0x98)+_0x4f9c02+_0x18361b(0xbf);}
1
+ const a23_0x1a088d=a23_0x4a89;(function(_0x330fc7,_0x34dc56){const _0x5e8993=a23_0x4a89,_0x422565=_0x330fc7();while(!![]){try{const _0x5e1afe=-parseInt(_0x5e8993(0xbf))/0x1+parseInt(_0x5e8993(0xb3))/0x2+parseInt(_0x5e8993(0xb5))/0x3*(parseInt(_0x5e8993(0xca))/0x4)+parseInt(_0x5e8993(0xcc))/0x5+parseInt(_0x5e8993(0xb8))/0x6+-parseInt(_0x5e8993(0xaf))/0x7+-parseInt(_0x5e8993(0x9a))/0x8;if(_0x5e1afe===_0x34dc56)break;else _0x422565['push'](_0x422565['shift']());}catch(_0x50fdc5){_0x422565['push'](_0x422565['shift']());}}}(a23_0x4a2b,0x96123));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a23_0x4a89(_0x5c9226,_0x2dfb55){_0x5c9226=_0x5c9226-0x7d;const _0x4a2b03=a23_0x4a2b();let _0x4a89b9=_0x4a2b03[_0x5c9226];return _0x4a89b9;}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a23_0x4a2b(){const _0x3e44bf=['str','utf8','function-node','entries','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','File\x20already\x20exists:\x20','76ytRyEh','\x0a\x20*\x20[脚本名称]\x20','4945630eLkuMF','No\x20operation\x20types\x20found\x20for\x20dataset\x20','HOOK','\x22\x20not\x20found.\x20','datasetcode','isInteger','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','string','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','join','before','/endpoint/','\x20function:\x20','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20api\x20pull`\x20to\x20refresh.','No\x20api.ts\x20found.\x20Run\x20`','code','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','operation-type','stderr','description','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','new','datasetCode','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','includes','nonInteractive','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','length','Invalid\x20dataset\x20selection.','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','Select\x20trigger\x20node:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Dataset\x20not\x20found\x20for\x20code\x20\x22','Operation\x20type\x20(HOOK\x20only)','Created\x20','7388144sgFcrv','TODO:\x20add\x20script\x20description','trim','question','Available\x20aliases:\x20','type','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','name','map','validation','ENDPOINT','find','operationType','\x22.\x20','Select\x20operation\x20type:','after','functionNode','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','apiDir','write','6884927nuabug','tableName','appCode','Script\x20type','385034ivoMai','Select\x20dataset:','179931ilRAaF','alias','Function\x20name\x20(valid\x20JS\x20identifier)','3134820fSLUyR','COMMON','.js','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','scriptsRootDir','close','Operation\x20type\x20\x22','321906oICVIh','keys','HOOK\x20requires\x20alias/operation/node\x20options.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Invalid\x20function\x20name\x20\x22'];a23_0x4a2b=function(){return _0x3e44bf;};return a23_0x4a2b();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':'bff','command':a23_0x1a088d(0x8b),'description':a23_0x1a088d(0xa0),'risk':a23_0x1a088d(0xae),'flags':[{'name':'type','type':a23_0x1a088d(0xd3),'required':!![],'enum':[a23_0x1a088d(0xb9),a23_0x1a088d(0xa4),a23_0x1a088d(0xce)],'description':a23_0x1a088d(0xb2)},{'name':a23_0x1a088d(0xa1),'type':a23_0x1a088d(0xd3),'required':!![],'description':a23_0x1a088d(0xb7)},{'name':a23_0x1a088d(0x89),'type':a23_0x1a088d(0xd3),'description':'Script\x20description'},{'name':a23_0x1a088d(0xb6),'type':'string','description':a23_0x1a088d(0x81)},{'name':a23_0x1a088d(0xd0),'type':a23_0x1a088d(0xd3),'description':a23_0x1a088d(0xd4)},{'name':a23_0x1a088d(0x87),'type':a23_0x1a088d(0xd3),'description':a23_0x1a088d(0x98)},{'name':a23_0x1a088d(0xc6),'type':'string','description':a23_0x1a088d(0x80),'enum':[a23_0x1a088d(0x7d),a23_0x1a088d(0xa9)]}],async 'validate'(_0x487d4e){const _0x451ea6=a23_0x1a088d,_0x56f506=_0x487d4e[_0x451ea6(0xc4)](_0x451ea6(0xa1));if(!isValidBffFunctionName(_0x56f506))throw CliErrors[_0x451ea6(0xa3)](_0x451ea6(0xc3)+_0x56f506+_0x451ea6(0x8a));},async 'execute'(_0x283c21){const _0x321597=a23_0x1a088d,_0x1af7ba=loadBffProjectConfig(_0x283c21['appCode']),_0x9083a8=_0x283c21['str'](_0x321597(0x9f)),_0x36c50e=_0x283c21[_0x321597(0xc4)](_0x321597(0xa1)),_0x391a08=_0x283c21['str'](_0x321597(0x89))||undefined,_0x419e7e=_0x9083a8==='HOOK'?await resolveHookOptions(_0x1af7ba,_0x283c21):undefined,_0x5f0114=buildFilePath(_0x1af7ba,_0x9083a8,_0x36c50e,_0x419e7e);if(await fileExists(_0x5f0114))throw CliErrors['validation'](_0x321597(0xc9)+_0x5f0114);await mkdir(dirname(_0x5f0114),{'recursive':!![]});const _0x524741=generateTemplate(_0x9083a8,_0x36c50e,_0x1af7ba,_0x391a08,_0x419e7e);await writeFile(_0x5f0114,_0x524741,_0x321597(0xc5));const _0x1dc25d={'type':_0x9083a8,'name':_0x36c50e,'path':_0x5f0114};if(_0x391a08)_0x1dc25d[_0x321597(0x89)]=_0x391a08;if(_0x419e7e){if(_0x419e7e[_0x321597(0xb6)])_0x1dc25d['alias']=_0x419e7e[_0x321597(0xb6)];_0x1dc25d['datasetCode']=_0x419e7e[_0x321597(0x8c)],_0x1dc25d[_0x321597(0xa6)]=_0x419e7e[_0x321597(0xa6)],_0x1dc25d[_0x321597(0xaa)]=_0x419e7e['functionNode'];}return{'ok':!![],'data':_0x1dc25d,'message':_0x321597(0x99)+_0x9083a8+_0x321597(0x7f)+_0x36c50e};}};async function resolveHookOptions(_0x323ed8,_0x2fb27e){const _0x57d6b3=a23_0x1a088d,_0x17527a=loadAliasMap(_0x2fb27e[_0x57d6b3(0xad)]),_0x4d71bb=_0x17527a[_0x57d6b3(0x92)]>0x0;let _0x202412,_0x104f68,_0x20eec3;const _0x4f22b2=_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xb6)),_0x54d451=_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xd0));if(_0x4f22b2){const _0x53ff7c=resolveAlias(_0x2fb27e[_0x57d6b3(0xad)],_0x4f22b2);if(!_0x53ff7c){const _0x488236=_0x4d71bb?_0x57d6b3(0x9e)+_0x17527a[_0x57d6b3(0xa2)](_0x45c85f=>_0x45c85f[_0x57d6b3(0xb6)])[_0x57d6b3(0xd5)](',\x20'):_0x57d6b3(0x84)+CLI_BIN_NAME+_0x57d6b3(0xbb);throw CliErrors['validation']('Alias\x20\x22'+_0x4f22b2+_0x57d6b3(0xcf)+_0x488236);}_0x202412=_0x4f22b2,_0x104f68=_0x53ff7c;}else{if(_0x54d451){_0x104f68=_0x54d451;const _0x4e1b54=_0x17527a['find'](_0x154cb9=>_0x154cb9[_0x57d6b3(0x8c)]===_0x54d451);_0x202412=_0x4e1b54?.[_0x57d6b3(0xb6)];}else{if(_0x2fb27e['nonInteractive'])throw CliErrors[_0x57d6b3(0xa3)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x4d71bb){const _0x49e933=_0x17527a['map'](_0x53f4d1=>_0x53f4d1['alias']+'\x20('+_0x53f4d1[_0x57d6b3(0xb0)]+')'),_0x59a367=await promptSelect(_0x57d6b3(0xb4),_0x49e933),_0x485cf0=_0x17527a[_0x59a367];if(!_0x485cf0)throw CliErrors['validation'](_0x57d6b3(0x93));_0x202412=_0x485cf0[_0x57d6b3(0xb6)],_0x104f68=_0x485cf0[_0x57d6b3(0x8c)];}else{const _0x150c74=await listDatasets(_0x323ed8[_0x57d6b3(0xb1)]);if(_0x150c74['length']===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x402b05=_0x150c74[_0x57d6b3(0xa2)](_0x2835cf=>_0x2835cf[_0x57d6b3(0xa1)]+'\x20('+_0x2835cf[_0x57d6b3(0x85)]+')'),_0x4174b3=await promptSelect(_0x57d6b3(0xb4),_0x402b05),_0x2661c1=_0x150c74[_0x4174b3];if(!_0x2661c1)throw CliErrors['validation'](_0x57d6b3(0x93));_0x104f68=_0x2661c1[_0x57d6b3(0x85)],_0x202412=undefined;}}}}const _0x44b7f6=await listDatasets(_0x323ed8[_0x57d6b3(0xb1)]),_0x2c889d=_0x44b7f6[_0x57d6b3(0xa5)](_0x51185a=>_0x51185a[_0x57d6b3(0x85)]===_0x104f68);if(!_0x2c889d)throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0x97)+_0x104f68+_0x57d6b3(0xa7)+(_0x202412?_0x57d6b3(0xd2)+CLI_BIN_NAME+_0x57d6b3(0x83):''));_0x20eec3=_0x2c889d['id'];const _0x3c9538=_0x202412??_0x104f68,_0x2b771c=await listBffDatasetOperations(_0x323ed8[_0x57d6b3(0xb1)],_0x20eec3),_0x5532a7=_0x2b771c?Object[_0x57d6b3(0xc0)](_0x2b771c):[];if(_0x5532a7['length']===0x0)throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xcd)+_0x3c9538+'.');let _0x526d78;const _0x4986ce=_0x2fb27e['str'](_0x57d6b3(0x87));if(_0x4986ce){if(!_0x5532a7[_0x57d6b3(0x8f)](_0x4986ce))throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xbe)+_0x4986ce+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x3c9538+'.\x20'+('Available:\x20'+_0x5532a7[_0x57d6b3(0xd5)](',\x20')));_0x526d78=_0x4986ce;}else{if(_0x2fb27e[_0x57d6b3(0x90)])throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0x96));const _0x2d1cfe=await promptSelect(_0x57d6b3(0xa8),_0x5532a7);_0x526d78=_0x5532a7[_0x2d1cfe]??_0x5532a7[0x0];}let _0x134814=normalizeHookFunctionNode(_0x2fb27e[_0x57d6b3(0xc4)]('function-node'));if(!_0x134814){if(_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xc6)))throw CliErrors[_0x57d6b3(0xa3)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2fb27e[_0x57d6b3(0x90)])throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xac));const _0x23cdde=await promptSelect(_0x57d6b3(0x95),['before',_0x57d6b3(0xa9)]);_0x134814=['before','after'][_0x23cdde]??_0x57d6b3(0x7d);}return{'alias':_0x202412,'datasetCode':_0x104f68,'datasetId':_0x20eec3,'operationType':_0x526d78,'functionNode':_0x134814};}async function promptSelect(_0x54f04f,_0x2e4059){const _0x4050f7=a23_0x1a088d;if(_0x2e4059[_0x4050f7(0x92)]===0x1)return 0x0;for(const [_0x3ec072,_0x32cbeb]of _0x2e4059[_0x4050f7(0xc7)]()){process['stderr'][_0x4050f7(0xae)]('\x20\x20'+(_0x3ec072+0x1)+'.\x20'+_0x32cbeb+'\x0a');}const _0x2c1b02=createInterface({'input':process['stdin'],'output':process[_0x4050f7(0x88)]});while(!![]){const _0x432dbd=await new Promise(_0x25a200=>{const _0x1de4b3=_0x4050f7;_0x2c1b02[_0x1de4b3(0x9d)](_0x54f04f+'\x20',_0x25a200);}),_0x218d50=Number['parseInt'](_0x432dbd[_0x4050f7(0x9c)](),0xa);if(Number[_0x4050f7(0xd1)](_0x218d50)&&_0x218d50>=0x1&&_0x218d50<=_0x2e4059[_0x4050f7(0x92)])return _0x2c1b02[_0x4050f7(0xbd)](),_0x218d50-0x1;process[_0x4050f7(0x88)]['write'](_0x4050f7(0xc2)+_0x2e4059['length']+'.\x0a');}}function buildFilePath(_0x31a754,_0x114ed4,_0x5efa82,_0x45eedc){const _0x4acf14=a23_0x1a088d;if(_0x114ed4===_0x4acf14(0xce)){if(!_0x45eedc)throw CliErrors['validation'](_0x4acf14(0xc1));const _0x388b5b=_0x45eedc[_0x4acf14(0xb6)]??_0x45eedc[_0x4acf14(0x8c)];return join(_0x31a754['scriptsRootDir'],'HOOK',_0x388b5b,_0x45eedc[_0x4acf14(0xa6)],_0x45eedc['functionNode'],_0x5efa82+_0x4acf14(0xba));}return join(_0x31a754[_0x4acf14(0xbc)],_0x114ed4,_0x5efa82+_0x4acf14(0xba));}function generateTemplate(_0x34426d,_0x594b6f,_0x2e7e90,_0x1b8111,_0x40cc29){const _0x18e9dd=a23_0x1a088d,_0x4f0581=_0x1b8111?.[_0x18e9dd(0x9c)]()||_0x18e9dd(0x9b);if(_0x34426d===_0x18e9dd(0xb9))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x4f0581+_0x18e9dd(0xcb)+_0x594b6f+_0x18e9dd(0x8d)+_0x594b6f+_0x18e9dd(0x8e)+_0x594b6f+_0x18e9dd(0x94);if(_0x34426d===_0x18e9dd(0xa4))return _0x18e9dd(0xc8)+_0x4f0581+_0x18e9dd(0x91)+_0x2e7e90['appCode']+_0x18e9dd(0x7e)+_0x594b6f+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x594b6f+_0x18e9dd(0x94);if(!_0x40cc29)throw CliErrors[_0x18e9dd(0xa3)](_0x18e9dd(0x82));return _0x18e9dd(0x86)+_0x4f0581+_0x18e9dd(0x91)+_0x2e7e90[_0x18e9dd(0xb1)]+'/'+_0x40cc29[_0x18e9dd(0x8c)]+'/'+_0x40cc29[_0x18e9dd(0xa6)]+'\x0a\x20*\x20[触发节点]\x20'+_0x40cc29['functionNode']+_0x18e9dd(0xab)+_0x594b6f+_0x18e9dd(0x94);}
@@ -1 +1 @@
1
- const a23_0x250d08=a23_0x1c1b;(function(_0x45fdd7,_0x2b0003){const _0x17dc8c=a23_0x1c1b,_0x47a080=_0x45fdd7();while(!![]){try{const _0x181898=parseInt(_0x17dc8c(0xf4))/0x1+parseInt(_0x17dc8c(0x10e))/0x2*(parseInt(_0x17dc8c(0x11c))/0x3)+parseInt(_0x17dc8c(0x107))/0x4*(-parseInt(_0x17dc8c(0x111))/0x5)+parseInt(_0x17dc8c(0x109))/0x6+parseInt(_0x17dc8c(0xf0))/0x7*(-parseInt(_0x17dc8c(0x120))/0x8)+-parseInt(_0x17dc8c(0xed))/0x9*(parseInt(_0x17dc8c(0xef))/0xa)+parseInt(_0x17dc8c(0x126))/0xb;if(_0x181898===_0x2b0003)break;else _0x47a080['push'](_0x47a080['shift']());}catch(_0x1758b3){_0x47a080['push'](_0x47a080['shift']());}}}(a23_0x1349,0xe1da1));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a23_0x1349(){const _0x1a496c=['functionNode','ENDPOINT','Pull\x20complete:\x20','utf8','functions','push','bff','1785GaPzMn','apps','functionName','type','8dKZAcq','fromEntries','Remote\x20script\x20missing\x20id.','map','write','datasetCode','39255909hwYHJd','validation','nonInteractive','\x20failed','\x20pulled,\x20','operationType','str','string','Remote\x20script\x20missing\x20content.','apiDir','length','trim','Force\x20overwrite\x20local\x20unsynced\x20changes','message','appCode','Force\x20pull\x20cancelled.','1696392wnaWTE','boolean','70qxLREZ','8089963xLwxQQ','lastSync','Would\x20pull\x20','GET','656664HXpmRi','stderr','scriptsRoot','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','alias','aliases','scriptsWorkspaceRoot','bool','hookLocation','No\x20remote\x20BFF\x20scripts\x20found.','includes','scriptType','question','close','Pull\x20only\x20this\x20script\x20type','filePath','toLowerCase','all','force','5476dsMBTE','pull','324096nzmbKu','toISOString','lockKey','local\x20unsynced\x20changes','COMMON','450hAiCtN','hash','\x20file(s)','3700KdAGcc','lockFilePath','\x20skipped,\x20','scriptContent'];a23_0x1349=function(){return _0x1a496c;};return a23_0x1349();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a23_0x250d08(0x11b),'command':'pull','description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a23_0x250d08(0x124),'flags':[{'name':'type','type':a23_0x250d08(0x12d),'description':a23_0x250d08(0x102),'enum':[a23_0x250d08(0x10d),a23_0x250d08(0x116),'HOOK']},{'name':a23_0x250d08(0x106),'type':a23_0x250d08(0xee),'description':a23_0x250d08(0xe9)}],async 'dryRun'(_0x2df3d1){const _0x266d58=a23_0x250d08,_0x5e3e6b=loadBffProjectConfig(_0x2df3d1[_0x266d58(0xeb)]),_0x33bf04=await readBffLockFile(_0x5e3e6b['lockFilePath']),{appLock:_0x557fa1}=ensureLockScope(_0x33bf04??createEmptyBffLock(),_0x5e3e6b[_0x266d58(0xeb)],_0x5e3e6b[_0x266d58(0xf6)],_0x266d58(0x108),_0x5e3e6b[_0x266d58(0xeb)],_0x5e3e6b[_0x266d58(0xfa)]+'/'+_0x5e3e6b['appCode']),_0x369cc6=buildDatasetCodeToAliasMap(_0x2df3d1[_0x266d58(0x12f)]),_0x5b8ffb=normalizeBffType(_0x2df3d1['str']('type'))??undefined,[_0xc8050d,_0x2c0f42]=await Promise['all']([listBffScripts(_0x2df3d1[_0x266d58(0xeb)],_0x5b8ffb),getBffScriptStatistics(_0x2df3d1[_0x266d58(0xeb)])]),_0x4d366d=createHookLocationMap(_0x2c0f42),_0xf7529f=[];for(const _0x5cc92a of _0xc8050d){const _0x5ed10e=resolveRemoteScriptTarget(_0x5e3e6b,_0x5cc92a,_0x4d366d,_0x557fa1[_0x266d58(0x119)],_0x369cc6);if(_0x5ed10e)_0xf7529f[_0x266d58(0x11a)](_0x5ed10e[_0x266d58(0x10b)]);}return{'method':_0x266d58(0xf3),'url':'/api/management/library/scripts/list','body':{'scripts':_0xf7529f,'appCode':_0x2df3d1[_0x266d58(0xeb)]},'description':_0x266d58(0xf2)+_0xf7529f[_0x266d58(0x130)]+_0x266d58(0x110)};},async 'execute'(_0x50bbdf){const _0xc8938e=a23_0x250d08,_0x409779=loadBffProjectConfig(_0x50bbdf[_0xc8938e(0xeb)]),_0x541b0e=await readBffLockFile(_0x409779['lockFilePath']),{lockData:_0x31c94b,appLock:_0x2f5616}=ensureLockScope(_0x541b0e??createEmptyBffLock(),_0x409779[_0xc8938e(0xeb)],_0x409779['scriptsRoot'],'pull',_0x409779[_0xc8938e(0xeb)],_0x409779[_0xc8938e(0xfa)]+'/'+_0x409779[_0xc8938e(0xeb)]),_0x2107e2=normalizeBffType(_0x50bbdf['str']('type'))??undefined;if(_0x50bbdf[_0xc8938e(0x12c)](_0xc8938e(0x11f))&&!_0x2107e2)throw CliErrors[_0xc8938e(0x127)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x139602,_0x33efa4]=await Promise[_0xc8938e(0x105)]([listBffScripts(_0x50bbdf[_0xc8938e(0xeb)],_0x2107e2),getBffScriptStatistics(_0x50bbdf[_0xc8938e(0xeb)])]);if(_0x139602[_0xc8938e(0x130)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xc8938e(0xfd)};const _0xc6cfeb=_0x50bbdf[_0xc8938e(0xfb)]('force');if(_0xc6cfeb&&!_0x50bbdf[_0xc8938e(0x128)]){const _0x3578b6=await confirmForce();if(!_0x3578b6)throw CliErrors['cancelled'](_0xc8938e(0xec));}if(_0xc6cfeb&&_0x50bbdf['nonInteractive']){}const _0x159670=buildDatasetCodeToAliasMap(_0x50bbdf[_0xc8938e(0x12f)]),_0x5a1d43=createHookLocationMap(_0x33efa4),_0x5af14c=cloneLockData(_0x31c94b),_0x192fd6=_0x5af14c[_0xc8938e(0x11d)][_0x409779[_0xc8938e(0xeb)]],_0x29ba37=[],_0x371e13=[],_0x125b6f=[];for(const _0x89c5d5 of _0x139602){const _0x36360a=resolveRemoteScriptTarget(_0x409779,_0x89c5d5,_0x5a1d43,_0x2f5616[_0xc8938e(0x119)],_0x159670);if(!_0x36360a){_0x371e13[_0xc8938e(0x11a)]({'lockKey':_0x89c5d5[_0xc8938e(0xff)]+'/'+_0x89c5d5[_0xc8938e(0x11e)],'reason':'unresolvable\x20target\x20path'});continue;}const _0xc42954=_0x2f5616[_0xc8938e(0x119)][_0x36360a[_0xc8938e(0x10b)]];try{if(!_0xc6cfeb){const _0x366470=await hasUnsyncedLocalChanges(_0x36360a[_0xc8938e(0x103)],_0xc42954);if(_0x366470){_0x371e13[_0xc8938e(0x11a)]({'lockKey':_0x36360a[_0xc8938e(0x10b)],'reason':_0xc8938e(0x10c)});continue;}}if(!_0x89c5d5['id'])throw new Error(_0xc8938e(0x122));if(_0x89c5d5[_0xc8938e(0x114)]==null)throw new Error(_0xc8938e(0x12e));const _0x2690ee=_0x89c5d5['scriptContent'];await ensureParentDirectory(_0x36360a[_0xc8938e(0x103)]),await writeFile(_0x36360a['filePath'],_0x2690ee,_0xc8938e(0x118));const _0x4f8374={'hash':computeContentHash(_0x2690ee),'remoteId':_0x89c5d5['id'],'version':_0x89c5d5['version']};_0x36360a[_0xc8938e(0x11f)]==='HOOK'&&_0x36360a[_0xc8938e(0xfc)]&&(_0x4f8374[_0xc8938e(0xf8)]=_0x36360a[_0xc8938e(0xfc)][_0xc8938e(0xf8)],_0x4f8374[_0xc8938e(0x125)]=_0x36360a['hookLocation'][_0xc8938e(0x125)],_0x4f8374['operationType']=_0x36360a[_0xc8938e(0xfc)][_0xc8938e(0x12b)],_0x4f8374[_0xc8938e(0x115)]=_0x36360a['hookLocation']['functionNode']),_0x192fd6[_0xc8938e(0x119)][_0x36360a[_0xc8938e(0x10b)]]=_0x4f8374,_0x29ba37[_0xc8938e(0x11a)]({'lockKey':_0x36360a[_0xc8938e(0x10b)],'remoteId':_0x89c5d5['id']});}catch(_0x9651ec){_0x125b6f[_0xc8938e(0x11a)]({'lockKey':_0x36360a['lockKey'],'error':_0x9651ec instanceof Error?_0x9651ec[_0xc8938e(0xea)]:String(_0x9651ec)});}}return _0x192fd6[_0xc8938e(0xf1)]=new Date()[_0xc8938e(0x10a)](),await writeBffLockFile(_0x409779[_0xc8938e(0x112)],_0x5af14c),{'ok':_0x125b6f[_0xc8938e(0x130)]===0x0,'data':{'pulled':_0x29ba37,'skipped':_0x371e13,'failed':_0x125b6f},'message':_0xc8938e(0x117)+_0x29ba37['length']+_0xc8938e(0x12a)+_0x371e13[_0xc8938e(0x130)]+_0xc8938e(0x113)+_0x125b6f[_0xc8938e(0x130)]+_0xc8938e(0x129)};}};async function hasUnsyncedLocalChanges(_0x1e20fd,_0xd8e5be){const _0x2e33d3=a23_0x250d08;if(!await fileExists(_0x1e20fd))return![];const _0x40e43c=await computeFileHash(_0x1e20fd);if(!_0xd8e5be)return!![];return _0x40e43c!==_0xd8e5be[_0x2e33d3(0x10f)];}function cloneLockData(_0x53b113){const _0x3c6e29=a23_0x250d08;return{'aliases':{..._0x53b113[_0x3c6e29(0xf9)]},'apps':Object[_0x3c6e29(0x121)](Object['entries'](_0x53b113['apps'])[_0x3c6e29(0x123)](([_0xbe8c45,_0x10e60f])=>[_0xbe8c45,{'scriptsRoot':_0x10e60f[_0x3c6e29(0xf6)],'lastSync':_0x10e60f[_0x3c6e29(0xf1)],'functions':{..._0x10e60f['functions']}}]))};}function a23_0x1c1b(_0x36ac11,_0x3e30e2){_0x36ac11=_0x36ac11-0xe9;const _0x134957=a23_0x1349();let _0x1c1b32=_0x134957[_0x36ac11];return _0x1c1b32;}function buildDatasetCodeToAliasMap(_0x28e59c){const _0x5599b1=a23_0x250d08,_0xc02814=loadAliasMap(_0x28e59c);return new Map(_0xc02814['map'](_0x15022c=>[_0x15022c[_0x5599b1(0x125)],_0x15022c['alias']]));}async function confirmForce(){const _0x788423=a23_0x250d08,_0x44eac2=createInterface({'input':process['stdin'],'output':process[_0x788423(0xf5)]}),_0x4f099c=await new Promise(_0x56f4ea=>{const _0xa9c5eb=_0x788423;_0x44eac2[_0xa9c5eb(0x100)](_0xa9c5eb(0xf7),_0x56f4ea);});return _0x44eac2[_0x788423(0x101)](),['y','yes'][_0x788423(0xfe)](_0x4f099c[_0x788423(0x131)]()[_0x788423(0x104)]());}
1
+ const a24_0x25d292=a24_0x12a1;(function(_0xd9a952,_0x1a45a5){const _0xf0efc=a24_0x12a1,_0x78fce3=_0xd9a952();while(!![]){try{const _0x336283=parseInt(_0xf0efc(0x161))/0x1+-parseInt(_0xf0efc(0x163))/0x2+-parseInt(_0xf0efc(0x177))/0x3+-parseInt(_0xf0efc(0x18d))/0x4*(parseInt(_0xf0efc(0x180))/0x5)+-parseInt(_0xf0efc(0x176))/0x6+parseInt(_0xf0efc(0x17b))/0x7+parseInt(_0xf0efc(0x186))/0x8;if(_0x336283===_0x1a45a5)break;else _0x78fce3['push'](_0x78fce3['shift']());}catch(_0x3d57b6){_0x78fce3['push'](_0x78fce3['shift']());}}}(a24_0xb09f,0xd959c));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a24_0xb09f(){const _0x47f7fc=['3419566NIovyL','alias','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','lastSync','type','toLowerCase','scriptsWorkspaceRoot','all','bff','hookLocation','write','question','str','push','HOOK','ENDPOINT','utf8','cancelled','7143282rDwnjF','644211sebRKu','stderr','boolean','apiDir','10900792NJhUZu','scriptType','appCode','force','version','260SRwVAn','pull','Remote\x20script\x20missing\x20content.','functionName','No\x20remote\x20BFF\x20scripts\x20found.','Would\x20pull\x20','20688576UlxewD','bool','lockFilePath','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','scriptContent','COMMON','\x20skipped,\x20','97628iLJlnS','length','Pull\x20complete:\x20','message','functions','apps','lockKey','\x20failed','nonInteractive','operationType','close','scriptsRoot','\x20file(s)','Remote\x20script\x20missing\x20id.','stdin','datasetCode','string','filePath','1131171fZfyVm','map'];a24_0xb09f=function(){return _0x47f7fc;};return a24_0xb09f();}import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a24_0x25d292(0x16c),'command':a24_0x25d292(0x181),'description':a24_0x25d292(0x189),'risk':a24_0x25d292(0x16e),'flags':[{'name':'type','type':a24_0x25d292(0x15f),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a24_0x25d292(0x18b),a24_0x25d292(0x173),a24_0x25d292(0x172)]},{'name':'force','type':a24_0x25d292(0x179),'description':a24_0x25d292(0x165)}],async 'dryRun'(_0x1ff601){const _0x2cfc35=a24_0x25d292,_0xbba11f=loadBffProjectConfig(_0x1ff601[_0x2cfc35(0x17d)]),_0x12aaed=await readBffLockFile(_0xbba11f[_0x2cfc35(0x188)]),{appLock:_0x28896a}=ensureLockScope(_0x12aaed??createEmptyBffLock(),_0xbba11f[_0x2cfc35(0x17d)],_0xbba11f[_0x2cfc35(0x15a)],_0x2cfc35(0x181),_0xbba11f[_0x2cfc35(0x17d)],_0xbba11f[_0x2cfc35(0x16a)]+'/'+_0xbba11f['appCode']),_0x3ecf34=buildDatasetCodeToAliasMap(_0x1ff601[_0x2cfc35(0x17a)]),_0x19184f=normalizeBffType(_0x1ff601[_0x2cfc35(0x170)](_0x2cfc35(0x168)))??undefined,[_0x13378b,_0x2851f8]=await Promise[_0x2cfc35(0x16b)]([listBffScripts(_0x1ff601[_0x2cfc35(0x17d)],_0x19184f),getBffScriptStatistics(_0x1ff601[_0x2cfc35(0x17d)])]),_0x1a7112=createHookLocationMap(_0x2851f8),_0x58013c=[];for(const _0x2753a8 of _0x13378b){const _0x3606f3=resolveRemoteScriptTarget(_0xbba11f,_0x2753a8,_0x1a7112,_0x28896a[_0x2cfc35(0x153)],_0x3ecf34);if(_0x3606f3)_0x58013c[_0x2cfc35(0x171)](_0x3606f3[_0x2cfc35(0x155)]);}return{'method':'GET','url':'/api/management/library/scripts/list','body':{'scripts':_0x58013c,'appCode':_0x1ff601[_0x2cfc35(0x17d)]},'description':_0x2cfc35(0x185)+_0x58013c[_0x2cfc35(0x18e)]+_0x2cfc35(0x15b)};},async 'execute'(_0x389730){const _0x4a2071=a24_0x25d292,_0x1b80e1=loadBffProjectConfig(_0x389730[_0x4a2071(0x17d)]),_0x427627=await readBffLockFile(_0x1b80e1[_0x4a2071(0x188)]),{lockData:_0x1a82ee,appLock:_0x38e566}=ensureLockScope(_0x427627??createEmptyBffLock(),_0x1b80e1[_0x4a2071(0x17d)],_0x1b80e1[_0x4a2071(0x15a)],_0x4a2071(0x181),_0x1b80e1[_0x4a2071(0x17d)],_0x1b80e1[_0x4a2071(0x16a)]+'/'+_0x1b80e1['appCode']),_0x252960=normalizeBffType(_0x389730[_0x4a2071(0x170)](_0x4a2071(0x168)))??undefined;if(_0x389730[_0x4a2071(0x170)](_0x4a2071(0x168))&&!_0x252960)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x4bf228,_0x4b9ba2]=await Promise[_0x4a2071(0x16b)]([listBffScripts(_0x389730[_0x4a2071(0x17d)],_0x252960),getBffScriptStatistics(_0x389730[_0x4a2071(0x17d)])]);if(_0x4bf228[_0x4a2071(0x18e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4a2071(0x184)};const _0x45a256=_0x389730[_0x4a2071(0x187)](_0x4a2071(0x17e));if(_0x45a256&&!_0x389730[_0x4a2071(0x157)]){const _0x4fc441=await confirmForce();if(!_0x4fc441)throw CliErrors[_0x4a2071(0x175)]('Force\x20pull\x20cancelled.');}if(_0x45a256&&_0x389730[_0x4a2071(0x157)]){}const _0x31ab58=buildDatasetCodeToAliasMap(_0x389730['apiDir']),_0x426c4e=createHookLocationMap(_0x4b9ba2),_0x4df3b8=cloneLockData(_0x1a82ee),_0x1e9dd2=_0x4df3b8[_0x4a2071(0x154)][_0x1b80e1[_0x4a2071(0x17d)]],_0xc5eb29=[],_0x1137bc=[],_0x1bbbea=[];for(const _0x2d7bdf of _0x4bf228){const _0xbbc8f3=resolveRemoteScriptTarget(_0x1b80e1,_0x2d7bdf,_0x426c4e,_0x38e566['functions'],_0x31ab58);if(!_0xbbc8f3){_0x1137bc['push']({'lockKey':_0x2d7bdf[_0x4a2071(0x17c)]+'/'+_0x2d7bdf[_0x4a2071(0x183)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2bf6c7=_0x38e566[_0x4a2071(0x153)][_0xbbc8f3['lockKey']];try{if(!_0x45a256){const _0x3f8590=await hasUnsyncedLocalChanges(_0xbbc8f3[_0x4a2071(0x160)],_0x2bf6c7);if(_0x3f8590){_0x1137bc['push']({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'reason':'local\x20unsynced\x20changes'});continue;}}if(!_0x2d7bdf['id'])throw new Error(_0x4a2071(0x15c));if(_0x2d7bdf[_0x4a2071(0x18a)]==null)throw new Error(_0x4a2071(0x182));const _0x233e2e=_0x2d7bdf[_0x4a2071(0x18a)];await ensureParentDirectory(_0xbbc8f3[_0x4a2071(0x160)]),await writeFile(_0xbbc8f3[_0x4a2071(0x160)],_0x233e2e,_0x4a2071(0x174));const _0x22e1fd={'hash':computeContentHash(_0x233e2e),'remoteId':_0x2d7bdf['id'],'version':_0x2d7bdf[_0x4a2071(0x17f)]};_0xbbc8f3[_0x4a2071(0x168)]===_0x4a2071(0x172)&&_0xbbc8f3[_0x4a2071(0x16d)]&&(_0x22e1fd['alias']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x164)],_0x22e1fd['datasetCode']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x15e)],_0x22e1fd['operationType']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x158)],_0x22e1fd['functionNode']=_0xbbc8f3[_0x4a2071(0x16d)]['functionNode']),_0x1e9dd2[_0x4a2071(0x153)][_0xbbc8f3[_0x4a2071(0x155)]]=_0x22e1fd,_0xc5eb29[_0x4a2071(0x171)]({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'remoteId':_0x2d7bdf['id']});}catch(_0x188f1d){_0x1bbbea[_0x4a2071(0x171)]({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'error':_0x188f1d instanceof Error?_0x188f1d[_0x4a2071(0x152)]:String(_0x188f1d)});}}return _0x1e9dd2[_0x4a2071(0x167)]=new Date()['toISOString'](),await writeBffLockFile(_0x1b80e1['lockFilePath'],_0x4df3b8),{'ok':_0x1bbbea[_0x4a2071(0x18e)]===0x0,'data':{'pulled':_0xc5eb29,'skipped':_0x1137bc,'failed':_0x1bbbea},'message':_0x4a2071(0x151)+_0xc5eb29['length']+'\x20pulled,\x20'+_0x1137bc[_0x4a2071(0x18e)]+_0x4a2071(0x18c)+_0x1bbbea[_0x4a2071(0x18e)]+_0x4a2071(0x156)};}};async function hasUnsyncedLocalChanges(_0x398882,_0x5f5aa0){if(!await fileExists(_0x398882))return![];const _0x56d044=await computeFileHash(_0x398882);if(!_0x5f5aa0)return!![];return _0x56d044!==_0x5f5aa0['hash'];}function a24_0x12a1(_0x559560,_0x57c586){_0x559560=_0x559560-0x151;const _0xb09fc5=a24_0xb09f();let _0x12a10e=_0xb09fc5[_0x559560];return _0x12a10e;}function cloneLockData(_0x526535){const _0x124edf=a24_0x25d292;return{'aliases':{..._0x526535['aliases']},'apps':Object['fromEntries'](Object['entries'](_0x526535['apps'])['map'](([_0x3aba09,_0x36ccec])=>[_0x3aba09,{'scriptsRoot':_0x36ccec[_0x124edf(0x15a)],'lastSync':_0x36ccec[_0x124edf(0x167)],'functions':{..._0x36ccec[_0x124edf(0x153)]}}]))};}function buildDatasetCodeToAliasMap(_0x3ccc23){const _0x59f535=a24_0x25d292,_0x3b36e2=loadAliasMap(_0x3ccc23);return new Map(_0x3b36e2[_0x59f535(0x162)](_0x329763=>[_0x329763[_0x59f535(0x15e)],_0x329763[_0x59f535(0x164)]]));}async function confirmForce(){const _0x1aeaca=a24_0x25d292,_0x526c32=createInterface({'input':process[_0x1aeaca(0x15d)],'output':process[_0x1aeaca(0x178)]}),_0xeaa7b4=await new Promise(_0x2bfcd0=>{const _0x3b5ae9=_0x1aeaca;_0x526c32[_0x3b5ae9(0x16f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x2bfcd0);});return _0x526c32[_0x1aeaca(0x159)](),['y','yes']['includes'](_0xeaa7b4[_0x1aeaca(0x166)]()[_0x1aeaca(0x169)]());}
@@ -1 +1 @@
1
- function a24_0x35ac(){const _0x4ef973=['/api/management/library/scripts/save','set','No\x20local\x20BFF\x20functions\x20found.','POST','map','description','713553YJEAhX','COMMON','Would\x20push\x20','1086TzdTkg','length','appCode','4705FfyVEB','force','Push\x20complete:\x20','Incomplete\x20HOOK\x20path:\x20','Local\x20function\x20not\x20found:\x20','aliasToDatasetCode','type','push','scriptsRoot','lockKey','\x20file(s)','2629TheTVU','filePath','validation','510JakVwS','302kGnyDR','22380KunWLn','version','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','functionNode','897aNTyWU','str','filter','55314831QipSuO','Run\x20`','Cannot\x20resolve\x20dataset\x20for\x20\x22','16fsEPJm','datasetCodeToId','has','lockFilePath','get','datasetCode','string','Force\x20push\x20ignoring\x20hash\x20protection','datasetId','functions','Push\x20only\x20this\x20script\x20type','2858919fBVFCs',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','HOOK','values','message','bool','remoteId','\x22.\x20','high-risk-write','Push\x20local\x20BFF\x20scripts\x20to\x20remote','hash','apiDir','129141lWQoox','\x20skipped,\x20','name','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','code','some','utf8','alias','scriptsWorkspaceRoot','20wmBxwB','operationType'];a24_0x35ac=function(){return _0x4ef973;};return a24_0x35ac();}const a24_0x36abaa=a24_0x1abb;(function(_0x52ac38,_0x13c15d){const _0x1eadfc=a24_0x1abb,_0x32fa9b=_0x52ac38();while(!![]){try{const _0x2b23e6=parseInt(_0x1eadfc(0x1db))/0x1*(-parseInt(_0x1eadfc(0x1d6))/0x2)+-parseInt(_0x1eadfc(0x1c1))/0x3*(parseInt(_0x1eadfc(0x1b9))/0x4)+-parseInt(_0x1eadfc(0x1c7))/0x5*(parseInt(_0x1eadfc(0x1c4))/0x6)+parseInt(_0x1eadfc(0x1ec))/0x7*(-parseInt(_0x1eadfc(0x1e1))/0x8)+-parseInt(_0x1eadfc(0x1b0))/0x9*(parseInt(_0x1eadfc(0x1d5))/0xa)+-parseInt(_0x1eadfc(0x1d2))/0xb*(parseInt(_0x1eadfc(0x1d7))/0xc)+parseInt(_0x1eadfc(0x1de))/0xd;if(_0x2b23e6===_0x13c15d)break;else _0x32fa9b['push'](_0x32fa9b['shift']());}catch(_0x52c3c2){_0x32fa9b['push'](_0x32fa9b['shift']());}}}(a24_0x35ac,0xbae9c));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a24_0x1abb(_0x3a9993,_0x42caef){_0x3a9993=_0x3a9993-0x1ae;const _0x35aced=a24_0x35ac();let _0x1abba7=_0x35aced[_0x3a9993];return _0x1abba7;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':'bff','command':'push','description':a24_0x36abaa(0x1f5),'risk':a24_0x36abaa(0x1f4),'flags':[{'name':a24_0x36abaa(0x1cd),'type':'string','description':a24_0x36abaa(0x1eb),'enum':[a24_0x36abaa(0x1c2),'ENDPOINT',a24_0x36abaa(0x1ee)]},{'name':a24_0x36abaa(0x1b2),'type':a24_0x36abaa(0x1e7),'description':a24_0x36abaa(0x1b3)},{'name':a24_0x36abaa(0x1c8),'type':'boolean','description':a24_0x36abaa(0x1e8)}],async 'dryRun'(_0x1c6dbe){const _0x2f310c=a24_0x36abaa,_0x419819=loadBffProjectConfig(_0x1c6dbe[_0x2f310c(0x1c6)]),_0x1f9dac=await readBffLockFile(_0x419819[_0x2f310c(0x1e4)]),{appLock:_0x14e0b0}=ensureLockScope(_0x1f9dac??createEmptyBffLock(),_0x419819[_0x2f310c(0x1c6)],_0x419819['scriptsRoot'],_0x2f310c(0x1ce),_0x419819[_0x2f310c(0x1c6)],_0x419819[_0x2f310c(0x1b8)]+'/'+_0x419819['appCode']),_0x5ddeea=await getTargetFunctions(_0x419819,_0x1c6dbe),_0x4cf7af=_0x1c6dbe[_0x2f310c(0x1f1)](_0x2f310c(0x1c8)),_0x13f536=[];for(const _0x1a5131 of _0x5ddeea){const _0x2268c1=await computeFileHash(_0x1a5131[_0x2f310c(0x1d3)]),_0x4ed932=_0x14e0b0[_0x2f310c(0x1ea)][_0x1a5131[_0x2f310c(0x1d0)]];if(!_0x4cf7af&&_0x4ed932&&_0x4ed932[_0x2f310c(0x1ae)]===_0x2268c1)continue;_0x13f536[_0x2f310c(0x1ce)](_0x1a5131[_0x2f310c(0x1d0)]);}return{'method':_0x2f310c(0x1be),'url':_0x2f310c(0x1bb),'body':{'files':_0x13f536,'appCode':_0x1c6dbe[_0x2f310c(0x1c6)]},'description':_0x2f310c(0x1c3)+_0x13f536[_0x2f310c(0x1c5)]+_0x2f310c(0x1d1)};},async 'execute'(_0x5a8f4a){const _0x46bfd8=a24_0x36abaa,_0x4e00c9=loadBffProjectConfig(_0x5a8f4a[_0x46bfd8(0x1c6)]),_0x24f147=await readBffLockFile(_0x4e00c9[_0x46bfd8(0x1e4)]),{lockData:_0x4fc68e,appLock:_0x17d8f7}=ensureLockScope(_0x24f147??createEmptyBffLock(),_0x4e00c9[_0x46bfd8(0x1c6)],_0x4e00c9[_0x46bfd8(0x1cf)],_0x46bfd8(0x1ce),_0x4e00c9[_0x46bfd8(0x1c6)],_0x4e00c9[_0x46bfd8(0x1b8)]+'/'+_0x4e00c9['appCode']),_0x37e18e=await getTargetFunctions(_0x4e00c9,_0x5a8f4a);if(_0x37e18e[_0x46bfd8(0x1c5)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x46bfd8(0x1bd)};const _0x357daa=_0x5a8f4a[_0x46bfd8(0x1f1)](_0x46bfd8(0x1c8)),_0x5404e8=await buildHookMaps(_0x4e00c9[_0x46bfd8(0x1c6)],_0x5a8f4a[_0x46bfd8(0x1af)],_0x37e18e,_0x17d8f7),_0x15289c=[],_0x16095c=[],_0x35ab25=[];for(const _0x23fcb7 of _0x37e18e){const _0x2320b3=await computeFileHash(_0x23fcb7[_0x46bfd8(0x1d3)]),_0x5434b1=_0x17d8f7[_0x46bfd8(0x1ea)][_0x23fcb7[_0x46bfd8(0x1d0)]];if(!_0x357daa&&_0x5434b1&&_0x5434b1['hash']===_0x2320b3){_0x16095c[_0x46bfd8(0x1ce)]({'lockKey':_0x23fcb7['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x4e00c9[_0x46bfd8(0x1c6)],_0x23fcb7,_0x17d8f7,_0x5404e8);const _0x15d220=_0x17d8f7[_0x46bfd8(0x1ea)][_0x23fcb7[_0x46bfd8(0x1d0)]];_0x15289c[_0x46bfd8(0x1ce)]({'lockKey':_0x23fcb7[_0x46bfd8(0x1d0)],'remoteId':_0x15d220?.[_0x46bfd8(0x1f2)]??0x0});}catch(_0x17ce82){_0x35ab25['push']({'lockKey':_0x23fcb7[_0x46bfd8(0x1d0)],'error':_0x17ce82 instanceof Error?_0x17ce82[_0x46bfd8(0x1f0)]:String(_0x17ce82)});}}return _0x17d8f7['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x4e00c9[_0x46bfd8(0x1e4)],_0x4fc68e),{'ok':_0x35ab25[_0x46bfd8(0x1c5)]===0x0,'data':{'uploaded':_0x15289c,'skipped':_0x16095c,'failed':_0x35ab25},'message':_0x46bfd8(0x1c9)+_0x15289c[_0x46bfd8(0x1c5)]+'\x20uploaded,\x20'+_0x16095c[_0x46bfd8(0x1c5)]+_0x46bfd8(0x1b1)+_0x35ab25[_0x46bfd8(0x1c5)]+'\x20failed'};}};async function getTargetFunctions(_0x2d6537,_0x49a883){const _0x7712f=a24_0x36abaa,_0x47adb8=_0x49a883[_0x7712f(0x1dc)](_0x7712f(0x1cd)),_0x14adaf=_0x49a883[_0x7712f(0x1dc)](_0x7712f(0x1b2)),_0x3ffae1=normalizeBffType(_0x47adb8)??undefined;if(_0x14adaf&&!_0x3ffae1)throw CliErrors[_0x7712f(0x1d4)](_0x7712f(0x1d9));const _0x25d6b4=await scanLocalBffFunctions(_0x2d6537,_0x3ffae1);if(_0x14adaf){const _0x15000f=_0x25d6b4[_0x7712f(0x1dd)](_0x2405da=>_0x2405da[_0x7712f(0x1b2)]===_0x14adaf);if(_0x15000f[_0x7712f(0x1c5)]===0x0)throw CliErrors[_0x7712f(0x1d4)](_0x7712f(0x1cb)+_0x3ffae1+'/'+_0x14adaf);return _0x15000f;}return _0x25d6b4;}async function buildHookMaps(_0x383888,_0x35744e,_0x47e42b,_0xb5860a){const _0x29c567=a24_0x36abaa,_0x22acce=_0x47e42b[_0x29c567(0x1b5)](_0x41d13e=>_0x41d13e['type']===_0x29c567(0x1ee));if(!_0x22acce)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x37dbc2=loadAliasMap(_0x35744e),_0x5d2cb5=new Map(_0x37dbc2[_0x29c567(0x1bf)](_0x11b927=>[_0x11b927[_0x29c567(0x1b7)],_0x11b927[_0x29c567(0x1e6)]]));for(const _0x1066e9 of Object[_0x29c567(0x1ef)](_0xb5860a[_0x29c567(0x1ea)])){_0x1066e9[_0x29c567(0x1b7)]&&_0x1066e9[_0x29c567(0x1e6)]&&!_0x5d2cb5[_0x29c567(0x1e3)](_0x1066e9[_0x29c567(0x1b7)])&&_0x5d2cb5[_0x29c567(0x1bc)](_0x1066e9[_0x29c567(0x1b7)],_0x1066e9['datasetCode']);}const _0x3bf48c=await listDatasets(_0x383888),_0x51c529=new Map(_0x3bf48c[_0x29c567(0x1bf)](_0x1da60a=>[_0x1da60a[_0x29c567(0x1b4)],_0x1da60a['id']]));return{'aliasToDatasetCode':_0x5d2cb5,'datasetCodeToId':_0x51c529};}async function uploadSingleFunction(_0x6afbb0,_0x89a86a,_0x3b2532,_0x1f6e2d){const _0x287941=a24_0x36abaa,_0x23e9e5=await readFile(_0x89a86a[_0x287941(0x1d3)],_0x287941(0x1b6)),_0x46bcd0=await computeFileHash(_0x89a86a[_0x287941(0x1d3)]),_0x425cc4=_0x3b2532[_0x287941(0x1ea)][_0x89a86a[_0x287941(0x1d0)]];if(_0x425cc4?.['remoteId']&&_0x425cc4[_0x287941(0x1d8)]==null)throw CliErrors[_0x287941(0x1d4)](_0x89a86a[_0x287941(0x1d0)]+_0x287941(0x1ed));let _0xdbca34=extractScriptDescription(_0x23e9e5);if(!_0xdbca34&&_0x425cc4?.[_0x287941(0x1f2)]){const _0x595e53=await getBffScriptInfo(_0x425cc4[_0x287941(0x1f2)]);_0xdbca34=_0x595e53[_0x287941(0x1c0)]||undefined;}const _0x19f694={'appCode':_0x6afbb0,'functionName':_0x89a86a[_0x287941(0x1b2)],'scriptType':_0x89a86a[_0x287941(0x1cd)],'scriptContent':_0x23e9e5};if(_0x425cc4?.[_0x287941(0x1f2)])_0x19f694['id']=_0x425cc4['remoteId'];if(_0x425cc4?.['version']!=null)_0x19f694['version']=_0x425cc4[_0x287941(0x1d8)];if(_0xdbca34)_0x19f694[_0x287941(0x1c0)]=_0xdbca34;if(_0x89a86a['type']===_0x287941(0x1ee)){const _0x29e095=_0x89a86a['alias'];if(!_0x29e095||!_0x89a86a[_0x287941(0x1ba)]||!_0x89a86a[_0x287941(0x1da)])throw CliErrors['validation'](_0x287941(0x1ca)+_0x89a86a['lockKey']);const _0x2d5e58=_0x1f6e2d[_0x287941(0x1cc)][_0x287941(0x1e5)](_0x29e095)??_0x425cc4?.[_0x287941(0x1e6)]??_0x29e095,_0x446af1=_0x1f6e2d[_0x287941(0x1e2)][_0x287941(0x1e5)](_0x2d5e58);if(!_0x446af1)throw CliErrors[_0x287941(0x1d4)](_0x287941(0x1e0)+_0x29e095+_0x287941(0x1f3)+(_0x287941(0x1df)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x19f694[_0x287941(0x1e9)]=_0x446af1,_0x19f694[_0x287941(0x1ba)]=_0x89a86a['operationType'],_0x19f694[_0x287941(0x1da)]=_0x89a86a[_0x287941(0x1da)];}const _0x1d2aeb=await saveBffScript(_0x19f694),_0x462e02=await getBffScriptInfo(_0x1d2aeb),_0xcc026={'hash':_0x46bcd0,'remoteId':_0x1d2aeb,'version':_0x462e02[_0x287941(0x1d8)]};if(_0x89a86a['type']===_0x287941(0x1ee)){const _0x57e4d0=_0x89a86a[_0x287941(0x1b7)],_0x1f4063=_0x1f6e2d['aliasToDatasetCode'][_0x287941(0x1e5)](_0x57e4d0)??_0x425cc4?.[_0x287941(0x1e6)]??_0x57e4d0;_0x1f6e2d[_0x287941(0x1cc)][_0x287941(0x1e3)](_0x57e4d0)?_0xcc026[_0x287941(0x1b7)]=_0x57e4d0:_0xcc026[_0x287941(0x1b7)]=_0x425cc4?.[_0x287941(0x1b7)],_0xcc026[_0x287941(0x1e6)]=_0x1f4063,_0xcc026[_0x287941(0x1ba)]=_0x89a86a['operationType'],_0xcc026[_0x287941(0x1da)]=_0x89a86a[_0x287941(0x1da)];}_0x3b2532[_0x287941(0x1ea)][_0x89a86a['lockKey']]=_0xcc026;}
1
+ const a25_0x4a7acb=a25_0x1af5;(function(_0x44557d,_0x507251){const _0x2f0d0f=a25_0x1af5,_0x45d528=_0x44557d();while(!![]){try{const _0x226d89=parseInt(_0x2f0d0f(0x96))/0x1+parseInt(_0x2f0d0f(0x9e))/0x2*(-parseInt(_0x2f0d0f(0xaf))/0x3)+-parseInt(_0x2f0d0f(0xc4))/0x4+-parseInt(_0x2f0d0f(0xa6))/0x5*(-parseInt(_0x2f0d0f(0xcf))/0x6)+-parseInt(_0x2f0d0f(0x95))/0x7+parseInt(_0x2f0d0f(0x91))/0x8*(parseInt(_0x2f0d0f(0x94))/0x9)+parseInt(_0x2f0d0f(0xc1))/0xa;if(_0x226d89===_0x507251)break;else _0x45d528['push'](_0x45d528['shift']());}catch(_0x4e6182){_0x45d528['push'](_0x45d528['shift']());}}}(a25_0x3a41,0xf33a1));function a25_0x1af5(_0x2c74a7,_0x4cba31){_0x2c74a7=_0x2c74a7-0x8e;const _0x3a41f2=a25_0x3a41();let _0x1af546=_0x3a41f2[_0x2c74a7];return _0x1af546;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a25_0x3a41(){const _0xf26853=['Push\x20local\x20BFF\x20scripts\x20to\x20remote','Push\x20complete:\x20','\x20uploaded,\x20','\x20failed','functionNode','88NxHsBy','utf8','COMMON','aliasToDatasetCode','filePath','str','toISOString','Incomplete\x20HOOK\x20path:\x20','1055sgPnGq','version','alias','scriptsWorkspaceRoot','lastSync','description','length','Would\x20push\x20','hash','81039xJRmLw','lockKey','code','push','unchanged','Run\x20`','appCode','datasetCode','\x20file(s)','POST','type','high-risk-write','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','HOOK','string','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','apiDir','force','13428670HfPNBO','remoteId','bff','4607420vyvdmG','Cannot\x20resolve\x20dataset\x20for\x20\x22','boolean','get','/api/management/library/scripts/save','validation','map','filter','\x22.\x20','ENDPOINT','No\x20local\x20BFF\x20functions\x20found.','51108oxoxpR','has','datasetId','lockFilePath','scriptsRoot','59352aYYpkD','operationType','message','2151hOkQpD','11735234KOEaZc','99840twmCdl','functions','name'];a25_0x3a41=function(){return _0xf26853;};return a25_0x3a41();}import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a25_0x4a7acb(0xc3),'command':a25_0x4a7acb(0xb2),'description':a25_0x4a7acb(0x99),'risk':a25_0x4a7acb(0xba),'flags':[{'name':a25_0x4a7acb(0xb9),'type':a25_0x4a7acb(0xbd),'description':'Push\x20only\x20this\x20script\x20type','enum':[a25_0x4a7acb(0xa0),a25_0x4a7acb(0xcd),a25_0x4a7acb(0xbc)]},{'name':a25_0x4a7acb(0x98),'type':a25_0x4a7acb(0xbd),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a25_0x4a7acb(0xc0),'type':a25_0x4a7acb(0xc6),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x4aece5){const _0x5ee337=a25_0x4a7acb,_0x22e730=loadBffProjectConfig(_0x4aece5[_0x5ee337(0xb5)]),_0x4fbad4=await readBffLockFile(_0x22e730[_0x5ee337(0x8f)]),{appLock:_0x4e7fd0}=ensureLockScope(_0x4fbad4??createEmptyBffLock(),_0x22e730[_0x5ee337(0xb5)],_0x22e730[_0x5ee337(0x90)],_0x5ee337(0xb2),_0x22e730[_0x5ee337(0xb5)],_0x22e730[_0x5ee337(0xa9)]+'/'+_0x22e730[_0x5ee337(0xb5)]),_0x3c6cdd=await getTargetFunctions(_0x22e730,_0x4aece5),_0x7387a6=_0x4aece5['bool'](_0x5ee337(0xc0)),_0xcbc77c=[];for(const _0x1334a9 of _0x3c6cdd){const _0x16b4fd=await computeFileHash(_0x1334a9['filePath']),_0x4e396d=_0x4e7fd0[_0x5ee337(0x97)][_0x1334a9[_0x5ee337(0xb0)]];if(!_0x7387a6&&_0x4e396d&&_0x4e396d['hash']===_0x16b4fd)continue;_0xcbc77c[_0x5ee337(0xb2)](_0x1334a9[_0x5ee337(0xb0)]);}return{'method':_0x5ee337(0xb8),'url':_0x5ee337(0xc8),'body':{'files':_0xcbc77c,'appCode':_0x4aece5['appCode']},'description':_0x5ee337(0xad)+_0xcbc77c[_0x5ee337(0xac)]+_0x5ee337(0xb7)};},async 'execute'(_0x2d0e33){const _0x32ea72=a25_0x4a7acb,_0x2c5776=loadBffProjectConfig(_0x2d0e33['appCode']),_0x33bd13=await readBffLockFile(_0x2c5776['lockFilePath']),{lockData:_0x1d4c20,appLock:_0xe4eb47}=ensureLockScope(_0x33bd13??createEmptyBffLock(),_0x2c5776['appCode'],_0x2c5776[_0x32ea72(0x90)],_0x32ea72(0xb2),_0x2c5776[_0x32ea72(0xb5)],_0x2c5776[_0x32ea72(0xa9)]+'/'+_0x2c5776['appCode']),_0x1a252a=await getTargetFunctions(_0x2c5776,_0x2d0e33);if(_0x1a252a[_0x32ea72(0xac)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x32ea72(0xce)};const _0x58a807=_0x2d0e33['bool'](_0x32ea72(0xc0)),_0x4e7783=await buildHookMaps(_0x2c5776[_0x32ea72(0xb5)],_0x2d0e33[_0x32ea72(0xbf)],_0x1a252a,_0xe4eb47),_0x2307d7=[],_0x463b90=[],_0x15b915=[];for(const _0x333de4 of _0x1a252a){const _0xcffc91=await computeFileHash(_0x333de4['filePath']),_0x1459a3=_0xe4eb47[_0x32ea72(0x97)][_0x333de4[_0x32ea72(0xb0)]];if(!_0x58a807&&_0x1459a3&&_0x1459a3[_0x32ea72(0xae)]===_0xcffc91){_0x463b90[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'reason':_0x32ea72(0xb3)});continue;}try{await uploadSingleFunction(_0x2c5776[_0x32ea72(0xb5)],_0x333de4,_0xe4eb47,_0x4e7783);const _0x14cc6c=_0xe4eb47[_0x32ea72(0x97)][_0x333de4[_0x32ea72(0xb0)]];_0x2307d7[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'remoteId':_0x14cc6c?.[_0x32ea72(0xc2)]??0x0});}catch(_0x5eb055){_0x15b915[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'error':_0x5eb055 instanceof Error?_0x5eb055[_0x32ea72(0x93)]:String(_0x5eb055)});}}return _0xe4eb47[_0x32ea72(0xaa)]=new Date()[_0x32ea72(0xa4)](),await writeBffLockFile(_0x2c5776['lockFilePath'],_0x1d4c20),{'ok':_0x15b915[_0x32ea72(0xac)]===0x0,'data':{'uploaded':_0x2307d7,'skipped':_0x463b90,'failed':_0x15b915},'message':_0x32ea72(0x9a)+_0x2307d7[_0x32ea72(0xac)]+_0x32ea72(0x9b)+_0x463b90[_0x32ea72(0xac)]+'\x20skipped,\x20'+_0x15b915[_0x32ea72(0xac)]+_0x32ea72(0x9c)};}};async function getTargetFunctions(_0x4e378d,_0x5be06b){const _0x35c55f=a25_0x4a7acb,_0x5803d7=_0x5be06b['str'](_0x35c55f(0xb9)),_0xc7c7cf=_0x5be06b[_0x35c55f(0xa3)](_0x35c55f(0x98)),_0x4e960f=normalizeBffType(_0x5803d7)??undefined;if(_0xc7c7cf&&!_0x4e960f)throw CliErrors['validation'](_0x35c55f(0xbb));const _0x4e9d1b=await scanLocalBffFunctions(_0x4e378d,_0x4e960f);if(_0xc7c7cf){const _0x523162=_0x4e9d1b[_0x35c55f(0xcb)](_0x2fd794=>_0x2fd794[_0x35c55f(0x98)]===_0xc7c7cf);if(_0x523162[_0x35c55f(0xac)]===0x0)throw CliErrors[_0x35c55f(0xc9)]('Local\x20function\x20not\x20found:\x20'+_0x4e960f+'/'+_0xc7c7cf);return _0x523162;}return _0x4e9d1b;}async function buildHookMaps(_0x1a8a24,_0x33e989,_0x3a5730,_0x1cd7da){const _0x3e94e8=a25_0x4a7acb,_0xf514b3=_0x3a5730['some'](_0x456158=>_0x456158[_0x3e94e8(0xb9)]===_0x3e94e8(0xbc));if(!_0xf514b3)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x15af0d=loadAliasMap(_0x33e989),_0x5565cc=new Map(_0x15af0d[_0x3e94e8(0xca)](_0x2a00d2=>[_0x2a00d2[_0x3e94e8(0xa8)],_0x2a00d2[_0x3e94e8(0xb6)]]));for(const _0x2f91a7 of Object['values'](_0x1cd7da[_0x3e94e8(0x97)])){_0x2f91a7['alias']&&_0x2f91a7[_0x3e94e8(0xb6)]&&!_0x5565cc[_0x3e94e8(0xd0)](_0x2f91a7[_0x3e94e8(0xa8)])&&_0x5565cc['set'](_0x2f91a7[_0x3e94e8(0xa8)],_0x2f91a7[_0x3e94e8(0xb6)]);}const _0x153ec2=await listDatasets(_0x1a8a24),_0x98c34e=new Map(_0x153ec2['map'](_0x265c55=>[_0x265c55[_0x3e94e8(0xb1)],_0x265c55['id']]));return{'aliasToDatasetCode':_0x5565cc,'datasetCodeToId':_0x98c34e};}async function uploadSingleFunction(_0x62b542,_0x23c04d,_0x4e7f40,_0xf47861){const _0x1bfb85=a25_0x4a7acb,_0x5dcf3b=await readFile(_0x23c04d[_0x1bfb85(0xa2)],_0x1bfb85(0x9f)),_0x508fb0=await computeFileHash(_0x23c04d['filePath']),_0x41c8c4=_0x4e7f40[_0x1bfb85(0x97)][_0x23c04d[_0x1bfb85(0xb0)]];if(_0x41c8c4?.[_0x1bfb85(0xc2)]&&_0x41c8c4[_0x1bfb85(0xa7)]==null)throw CliErrors[_0x1bfb85(0xc9)](_0x23c04d[_0x1bfb85(0xb0)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3af762=extractScriptDescription(_0x5dcf3b);if(!_0x3af762&&_0x41c8c4?.['remoteId']){const _0x451ec2=await getBffScriptInfo(_0x41c8c4[_0x1bfb85(0xc2)]);_0x3af762=_0x451ec2[_0x1bfb85(0xab)]||undefined;}const _0x25f183={'appCode':_0x62b542,'functionName':_0x23c04d['name'],'scriptType':_0x23c04d[_0x1bfb85(0xb9)],'scriptContent':_0x5dcf3b};if(_0x41c8c4?.[_0x1bfb85(0xc2)])_0x25f183['id']=_0x41c8c4[_0x1bfb85(0xc2)];if(_0x41c8c4?.['version']!=null)_0x25f183[_0x1bfb85(0xa7)]=_0x41c8c4[_0x1bfb85(0xa7)];if(_0x3af762)_0x25f183[_0x1bfb85(0xab)]=_0x3af762;if(_0x23c04d[_0x1bfb85(0xb9)]==='HOOK'){const _0x1ab891=_0x23c04d[_0x1bfb85(0xa8)];if(!_0x1ab891||!_0x23c04d[_0x1bfb85(0x92)]||!_0x23c04d[_0x1bfb85(0x9d)])throw CliErrors[_0x1bfb85(0xc9)](_0x1bfb85(0xa5)+_0x23c04d[_0x1bfb85(0xb0)]);const _0x521ec7=_0xf47861['aliasToDatasetCode'][_0x1bfb85(0xc7)](_0x1ab891)??_0x41c8c4?.['datasetCode']??_0x1ab891,_0x11b76e=_0xf47861['datasetCodeToId'][_0x1bfb85(0xc7)](_0x521ec7);if(!_0x11b76e)throw CliErrors['validation'](_0x1bfb85(0xc5)+_0x1ab891+_0x1bfb85(0xcc)+(_0x1bfb85(0xb4)+CLI_BIN_NAME+_0x1bfb85(0xbe)));_0x25f183[_0x1bfb85(0x8e)]=_0x11b76e,_0x25f183[_0x1bfb85(0x92)]=_0x23c04d[_0x1bfb85(0x92)],_0x25f183[_0x1bfb85(0x9d)]=_0x23c04d[_0x1bfb85(0x9d)];}const _0x7cea19=await saveBffScript(_0x25f183),_0xb6bdab=await getBffScriptInfo(_0x7cea19),_0xbb3277={'hash':_0x508fb0,'remoteId':_0x7cea19,'version':_0xb6bdab[_0x1bfb85(0xa7)]};if(_0x23c04d[_0x1bfb85(0xb9)]===_0x1bfb85(0xbc)){const _0x4b91be=_0x23c04d[_0x1bfb85(0xa8)],_0x465d52=_0xf47861[_0x1bfb85(0xa1)]['get'](_0x4b91be)??_0x41c8c4?.['datasetCode']??_0x4b91be;_0xf47861[_0x1bfb85(0xa1)][_0x1bfb85(0xd0)](_0x4b91be)?_0xbb3277[_0x1bfb85(0xa8)]=_0x4b91be:_0xbb3277[_0x1bfb85(0xa8)]=_0x41c8c4?.[_0x1bfb85(0xa8)],_0xbb3277[_0x1bfb85(0xb6)]=_0x465d52,_0xbb3277[_0x1bfb85(0x92)]=_0x23c04d[_0x1bfb85(0x92)],_0xbb3277[_0x1bfb85(0x9d)]=_0x23c04d[_0x1bfb85(0x9d)];}_0x4e7f40[_0x1bfb85(0x97)][_0x23c04d['lockKey']]=_0xbb3277;}
@@ -1 +1 @@
1
- function a25_0x2435(_0x452ae9,_0x4d5012){_0x452ae9=_0x452ae9-0x18f;const _0x104d5f=a25_0x104d();let _0x2435d8=_0x104d5f[_0x452ae9];return _0x2435d8;}function a25_0x104d(){const _0x1a25f6=['\x20modified,\x20','lockKey','functions','8278072XkDwmR','\x20unchanged','appCode','22685dzfFtA','alias','apiDir','116969PedvLz','402USMnYX','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','lockFilePath','length','bff','remote','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','All\x20BFF\x20scripts\x20are\x20in\x20sync.','299595dEPUjm','has','24276aLMris','datasetCode','hash','512870shvQNg','push','status','bool','54bGPVVQ','888909CRoFcI','scriptsRoot','\x20remote-only','28uActyv','scriptsWorkspaceRoot','map'];a25_0x104d=function(){return _0x1a25f6;};return a25_0x104d();}const a25_0x5996ff=a25_0x2435;(function(_0x54dc0e,_0x5532af){const _0x5a3e3f=a25_0x2435,_0x23bfe9=_0x54dc0e();while(!![]){try{const _0x4d4ea8=-parseInt(_0x5a3e3f(0x1a8))/0x1*(-parseInt(_0x5a3e3f(0x19c))/0x2)+parseInt(_0x5a3e3f(0x18f))/0x3+-parseInt(_0x5a3e3f(0x191))/0x4+-parseInt(_0x5a3e3f(0x1a5))/0x5*(parseInt(_0x5a3e3f(0x1a9))/0x6)+parseInt(_0x5a3e3f(0x199))/0x7+-parseInt(_0x5a3e3f(0x1a2))/0x8+-parseInt(_0x5a3e3f(0x198))/0x9*(-parseInt(_0x5a3e3f(0x194))/0xa);if(_0x4d4ea8===_0x5532af)break;else _0x23bfe9['push'](_0x23bfe9['shift']());}catch(_0x34a095){_0x23bfe9['push'](_0x23bfe9['shift']());}}}(a25_0x104d,0xc9fc5));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a25_0x5996ff(0x1ad),'command':a25_0x5996ff(0x196),'description':a25_0x5996ff(0x1af),'risk':'read','flags':[{'name':a25_0x5996ff(0x1ae),'type':'boolean','description':a25_0x5996ff(0x1aa)}],async 'execute'(_0x5f19b5){const _0x986eac=a25_0x5996ff,_0x409ef6=loadBffProjectConfig(_0x5f19b5[_0x986eac(0x1a4)]),_0x5c1906=await readBffLockFile(_0x409ef6[_0x986eac(0x1ab)]),{appLock:_0x3787bc}=ensureLockScope(_0x5c1906??createEmptyBffLock(),_0x409ef6[_0x986eac(0x1a4)],_0x409ef6[_0x986eac(0x19a)],_0x986eac(0x196),_0x409ef6[_0x986eac(0x1a4)],_0x409ef6[_0x986eac(0x19d)]+'/'+_0x409ef6[_0x986eac(0x1a4)]),_0x4dbc1f=await scanLocalBffFunctions(_0x409ef6),_0x415455=[],_0x6b260c=[],_0x1982f9=[];for(const _0xee1681 of _0x4dbc1f){const _0x21dbc4=await computeFileHash(_0xee1681['filePath']),_0x7c919=_0x3787bc['functions'][_0xee1681['lockKey']];if(!_0x7c919)_0x415455[_0x986eac(0x195)](_0xee1681[_0x986eac(0x1a0)]);else _0x7c919[_0x986eac(0x193)]!==_0x21dbc4?_0x6b260c[_0x986eac(0x195)](_0xee1681['lockKey']):_0x1982f9[_0x986eac(0x195)](_0xee1681[_0x986eac(0x1a0)]);}const _0xa9547d=[];if(_0x5f19b5[_0x986eac(0x197)](_0x986eac(0x1ae))){const _0x3ce6c8=loadAliasMap(_0x5f19b5[_0x986eac(0x1a7)]),_0x259522=new Map(_0x3ce6c8[_0x986eac(0x19e)](_0x22422c=>[_0x22422c[_0x986eac(0x192)],_0x22422c[_0x986eac(0x1a6)]])),[_0x499b74,_0x322d4d]=await Promise['all']([listBffScripts(_0x5f19b5['appCode']),getBffScriptStatistics(_0x5f19b5['appCode'])]),_0x30ea1d=createHookLocationMap(_0x322d4d),_0x439ce1=new Set(_0x4dbc1f['map'](_0x3c576f=>_0x3c576f[_0x986eac(0x1a0)]));for(const _0x47fa09 of _0x499b74){const _0x3fd74d=resolveRemoteScriptTarget(_0x409ef6,_0x47fa09,_0x30ea1d,_0x3787bc[_0x986eac(0x1a1)],_0x259522);_0x3fd74d&&!_0x439ce1[_0x986eac(0x190)](_0x3fd74d[_0x986eac(0x1a0)])&&_0xa9547d['push'](_0x3fd74d[_0x986eac(0x1a0)]);}}const _0x8413ee=_0x415455['length']===0x0&&_0x6b260c['length']===0x0&&_0xa9547d[_0x986eac(0x1ac)]===0x0;return{'ok':!![],'data':{'added':_0x415455,'modified':_0x6b260c,'unchanged':_0x1982f9,'remoteOnly':_0xa9547d},'message':_0x8413ee?_0x986eac(0x1b0):_0x415455[_0x986eac(0x1ac)]+'\x20added,\x20'+_0x6b260c['length']+_0x986eac(0x19f)+_0x1982f9[_0x986eac(0x1ac)]+_0x986eac(0x1a3)+(_0xa9547d[_0x986eac(0x1ac)]>0x0?',\x20'+_0xa9547d[_0x986eac(0x1ac)]+_0x986eac(0x19b):'')};}};
1
+ function a26_0x4b06(){const _0x53a0a8=['apiDir','\x20remote-only','hash','has','alias','length','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','all','1316572LMfKWt','appCode','scriptsRoot','7wSAKIf','\x20modified,\x20','1946157ApWqwq','9676184mPUjNg','5009500HcxSCz','push','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','remote','read','boolean','status','\x20unchanged','50BBMSpG','663849MMLYxo','lockKey','functions','196ZEMCzd','datasetCode','5975436XUABsA','10489WHeYah'];a26_0x4b06=function(){return _0x53a0a8;};return a26_0x4b06();}const a26_0x383af9=a26_0x1260;(function(_0x214f41,_0x6d1cd){const _0x4a54ae=a26_0x1260,_0x406cb1=_0x214f41();while(!![]){try{const _0x4855c4=parseInt(_0x4a54ae(0x104))/0x1*(parseInt(_0x4a54ae(0x101))/0x2)+parseInt(_0x4a54ae(0x112))/0x3+parseInt(_0x4a54ae(0x10d))/0x4+-parseInt(_0x4a54ae(0x114))/0x5+parseInt(_0x4a54ae(0x103))/0x6*(-parseInt(_0x4a54ae(0x110))/0x7)+parseInt(_0x4a54ae(0x113))/0x8+-parseInt(_0x4a54ae(0x11d))/0x9*(parseInt(_0x4a54ae(0x11c))/0xa);if(_0x4855c4===_0x6d1cd)break;else _0x406cb1['push'](_0x406cb1['shift']());}catch(_0x1e5448){_0x406cb1['push'](_0x406cb1['shift']());}}}(a26_0x4b06,0xcf338));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a26_0x1260(_0x26c98c,_0x358e18){_0x26c98c=_0x26c98c-0x100;const _0x4b0652=a26_0x4b06();let _0x1260e4=_0x4b0652[_0x26c98c];return _0x1260e4;}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a26_0x383af9(0x11a),'description':a26_0x383af9(0x116),'risk':a26_0x383af9(0x118),'flags':[{'name':a26_0x383af9(0x117),'type':a26_0x383af9(0x119),'description':a26_0x383af9(0x10b)}],async 'execute'(_0x3e6f3a){const _0x3ca349=a26_0x383af9,_0x2d6ec8=loadBffProjectConfig(_0x3e6f3a['appCode']),_0x41cf97=await readBffLockFile(_0x2d6ec8['lockFilePath']),{appLock:_0x288ec0}=ensureLockScope(_0x41cf97??createEmptyBffLock(),_0x2d6ec8[_0x3ca349(0x10e)],_0x2d6ec8[_0x3ca349(0x10f)],_0x3ca349(0x11a),_0x2d6ec8[_0x3ca349(0x10e)],_0x2d6ec8['scriptsWorkspaceRoot']+'/'+_0x2d6ec8[_0x3ca349(0x10e)]),_0x308186=await scanLocalBffFunctions(_0x2d6ec8),_0x2b3503=[],_0x5040f9=[],_0x101c6a=[];for(const _0x19f2b8 of _0x308186){const _0x332ce1=await computeFileHash(_0x19f2b8['filePath']),_0x119039=_0x288ec0[_0x3ca349(0x100)][_0x19f2b8['lockKey']];if(!_0x119039)_0x2b3503['push'](_0x19f2b8[_0x3ca349(0x11e)]);else _0x119039[_0x3ca349(0x107)]!==_0x332ce1?_0x5040f9[_0x3ca349(0x115)](_0x19f2b8[_0x3ca349(0x11e)]):_0x101c6a[_0x3ca349(0x115)](_0x19f2b8[_0x3ca349(0x11e)]);}const _0x336e47=[];if(_0x3e6f3a['bool'](_0x3ca349(0x117))){const _0x2fee34=loadAliasMap(_0x3e6f3a[_0x3ca349(0x105)]),_0x401c1b=new Map(_0x2fee34['map'](_0x2c96b6=>[_0x2c96b6[_0x3ca349(0x102)],_0x2c96b6[_0x3ca349(0x109)]])),[_0x535e91,_0x661782]=await Promise[_0x3ca349(0x10c)]([listBffScripts(_0x3e6f3a[_0x3ca349(0x10e)]),getBffScriptStatistics(_0x3e6f3a['appCode'])]),_0x1ad41d=createHookLocationMap(_0x661782),_0x524057=new Set(_0x308186['map'](_0x334d0b=>_0x334d0b['lockKey']));for(const _0x358ff7 of _0x535e91){const _0x2ed0dd=resolveRemoteScriptTarget(_0x2d6ec8,_0x358ff7,_0x1ad41d,_0x288ec0[_0x3ca349(0x100)],_0x401c1b);_0x2ed0dd&&!_0x524057[_0x3ca349(0x108)](_0x2ed0dd[_0x3ca349(0x11e)])&&_0x336e47['push'](_0x2ed0dd[_0x3ca349(0x11e)]);}}const _0x331591=_0x2b3503['length']===0x0&&_0x5040f9[_0x3ca349(0x10a)]===0x0&&_0x336e47[_0x3ca349(0x10a)]===0x0;return{'ok':!![],'data':{'added':_0x2b3503,'modified':_0x5040f9,'unchanged':_0x101c6a,'remoteOnly':_0x336e47},'message':_0x331591?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x2b3503[_0x3ca349(0x10a)]+'\x20added,\x20'+_0x5040f9['length']+_0x3ca349(0x111)+_0x101c6a[_0x3ca349(0x10a)]+_0x3ca349(0x11b)+(_0x336e47[_0x3ca349(0x10a)]>0x0?',\x20'+_0x336e47[_0x3ca349(0x10a)]+_0x3ca349(0x106):'')};}};
@@ -1 +1 @@
1
- function a26_0x5667(){const _0xc6fa41=['toString','error','npm\x20run\x20build\x20exited\x20with\x20code\x20','logger','项目构建失败','60639aKwFxb','close','651760HYrzfb','node_modules','npm\x20run\x20build','data','22ChpqVu','info','now','343MjoUHL','4176780kYSEgW','trim','pipe','build','10xDXQPN','npm','1485885FZjFpg','14646FRuTXV','9656mRymcZ','.bin','4FByKvh','2007nRtqDF','项目构建成功','cwd','env','项目构建出错','PATH','success','595659grEVOr','run'];a26_0x5667=function(){return _0xc6fa41;};return a26_0x5667();}(function(_0x34552a,_0x5b54a2){const _0x2b112a=a26_0x3d71,_0x1d7a2e=_0x34552a();while(!![]){try{const _0x33b172=parseInt(_0x2b112a(0x1d1))/0x1*(-parseInt(_0x2b112a(0x1bc))/0x2)+-parseInt(_0x2b112a(0x1ca))/0x3+parseInt(_0x2b112a(0x1c2))/0x4*(parseInt(_0x2b112a(0x1be))/0x5)+parseInt(_0x2b112a(0x1bf))/0x6*(-parseInt(_0x2b112a(0x1b7))/0x7)+parseInt(_0x2b112a(0x1c0))/0x8*(parseInt(_0x2b112a(0x1c3))/0x9)+parseInt(_0x2b112a(0x1d3))/0xa*(-parseInt(_0x2b112a(0x1d7))/0xb)+parseInt(_0x2b112a(0x1b8))/0xc;if(_0x33b172===_0x5b54a2)break;else _0x1d7a2e['push'](_0x1d7a2e['shift']());}catch(_0x489808){_0x1d7a2e['push'](_0x1d7a2e['shift']());}}}(a26_0x5667,0x27b86));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a26_0x3d71(_0x18b149,_0x465c8f){_0x18b149=_0x18b149-0x1b7;const _0x566745=a26_0x5667();let _0x3d710d=_0x566745[_0x18b149];return _0x3d710d;}function runBuild(_0x4e3248){return new Promise((_0x2088ae,_0x2c06a6)=>{const _0x5a5d27=a26_0x3d71,_0x95f63a=Date[_0x5a5d27(0x1d9)]();_0x4e3248[_0x5a5d27(0x1cf)][_0x5a5d27(0x1d8)]('build','开始构建项目',{'command':_0x5a5d27(0x1d5)});let _0x23cb41='';const _0x1361a4=spawn(_0x5a5d27(0x1bd),[_0x5a5d27(0x1cb),_0x5a5d27(0x1bb)],{'stdio':['inherit','inherit',_0x5a5d27(0x1ba)],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x5a5d27(0x1c5)](),_0x5a5d27(0x1d4),_0x5a5d27(0x1c1))+delimiter+process[_0x5a5d27(0x1c6)][_0x5a5d27(0x1c8)]}});_0x1361a4['stderr']?.['on'](_0x5a5d27(0x1d6),_0x1b3884=>{const _0x39f973=_0x5a5d27;_0x23cb41+=_0x1b3884[_0x39f973(0x1cc)]();}),_0x1361a4['on'](_0x5a5d27(0x1d2),_0x511f8d=>{const _0x1f887b=_0x5a5d27,_0x4371e8=Date[_0x1f887b(0x1d9)]()-_0x95f63a;if(_0x511f8d===0x0||_0x511f8d===null)_0x4e3248[_0x1f887b(0x1cf)][_0x1f887b(0x1c9)](_0x1f887b(0x1bb),_0x1f887b(0x1c4),_0x4371e8),_0x2088ae();else{const _0x2a867d={'exitCode':_0x511f8d,'duration':_0x4371e8,'command':'npm\x20run\x20build','cwd':process[_0x1f887b(0x1c5)]()};_0x23cb41[_0x1f887b(0x1b9)]()&&(_0x2a867d['stderr']=_0x23cb41['trim']()),_0x4e3248[_0x1f887b(0x1cf)][_0x1f887b(0x1cd)]('build',_0x1f887b(0x1d0),_0x2a867d),_0x2c06a6(new Error(_0x1f887b(0x1ce)+_0x511f8d));}}),_0x1361a4['on'](_0x5a5d27(0x1cd),_0x25a2e8=>{const _0x3bb6d4=_0x5a5d27,_0x261510=Date['now']()-_0x95f63a;_0x4e3248[_0x3bb6d4(0x1cf)][_0x3bb6d4(0x1cd)]('build',_0x3bb6d4(0x1c7),{'error':_0x25a2e8['message'],'duration':_0x261510,'stderr':_0x23cb41[_0x3bb6d4(0x1b9)]()||undefined}),_0x2c06a6(_0x25a2e8);});});}export const buildCommand={'name':'build','description':'Build\x20project',async 'run'(_0x3df536,_0x3d9703,_0x181f1f){await runBuild(_0x3df536);}};
1
+ function a27_0x2612(_0x351e94,_0x269598){_0x351e94=_0x351e94-0x1ba;const _0x1954c8=a27_0x1954();let _0x2612e4=_0x1954c8[_0x351e94];return _0x2612e4;}const a27_0x215dc4=a27_0x2612;(function(_0x91c726,_0x4f1869){const _0x887580=a27_0x2612,_0xc55e3c=_0x91c726();while(!![]){try{const _0x3d57c6=parseInt(_0x887580(0x1ca))/0x1*(parseInt(_0x887580(0x1d5))/0x2)+parseInt(_0x887580(0x1c2))/0x3+-parseInt(_0x887580(0x1d8))/0x4+parseInt(_0x887580(0x1c3))/0x5*(parseInt(_0x887580(0x1da))/0x6)+parseInt(_0x887580(0x1d3))/0x7+-parseInt(_0x887580(0x1be))/0x8+parseInt(_0x887580(0x1c1))/0x9*(-parseInt(_0x887580(0x1d7))/0xa);if(_0x3d57c6===_0x4f1869)break;else _0xc55e3c['push'](_0xc55e3c['shift']());}catch(_0x18af24){_0xc55e3c['push'](_0xc55e3c['shift']());}}}(a27_0x1954,0xefa6e));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runBuild(_0x162efb){return new Promise((_0xe54b59,_0x13800c)=>{const _0x1af7e0=a27_0x2612,_0x39f512=Date[_0x1af7e0(0x1d0)]();_0x162efb['logger'][_0x1af7e0(0x1d9)]('build',_0x1af7e0(0x1c7),{'command':'npm\x20run\x20build'});let _0x3ab88c='';const _0x38693c=spawn(_0x1af7e0(0x1ce),['run',_0x1af7e0(0x1c0)],{'stdio':[_0x1af7e0(0x1cb),_0x1af7e0(0x1cb),_0x1af7e0(0x1c9)],'shell':!![],'env':{...process[_0x1af7e0(0x1c8)],'PATH':''+join(process[_0x1af7e0(0x1cf)](),'node_modules',_0x1af7e0(0x1c6))+delimiter+process[_0x1af7e0(0x1c8)][_0x1af7e0(0x1d6)]}});_0x38693c['stderr']?.['on']('data',_0x5aab8a=>{const _0x11179a=_0x1af7e0;_0x3ab88c+=_0x5aab8a[_0x11179a(0x1bb)]();}),_0x38693c['on'](_0x1af7e0(0x1cd),_0x2e982b=>{const _0x26dc48=_0x1af7e0,_0x387225=Date[_0x26dc48(0x1d0)]()-_0x39f512;if(_0x2e982b===0x0||_0x2e982b===null)_0x162efb[_0x26dc48(0x1bf)][_0x26dc48(0x1c5)](_0x26dc48(0x1c0),_0x26dc48(0x1d2),_0x387225),_0xe54b59();else{const _0x5698b6={'exitCode':_0x2e982b,'duration':_0x387225,'command':_0x26dc48(0x1cc),'cwd':process[_0x26dc48(0x1cf)]()};_0x3ab88c[_0x26dc48(0x1d4)]()&&(_0x5698b6[_0x26dc48(0x1d1)]=_0x3ab88c[_0x26dc48(0x1d4)]()),_0x162efb[_0x26dc48(0x1bf)][_0x26dc48(0x1bc)](_0x26dc48(0x1c0),_0x26dc48(0x1db),_0x5698b6),_0x13800c(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x2e982b));}}),_0x38693c['on'](_0x1af7e0(0x1bc),_0x4940de=>{const _0x174e8a=_0x1af7e0,_0x54b805=Date[_0x174e8a(0x1d0)]()-_0x39f512;_0x162efb['logger']['error']('build',_0x174e8a(0x1bd),{'error':_0x4940de[_0x174e8a(0x1ba)],'duration':_0x54b805,'stderr':_0x3ab88c['trim']()||undefined}),_0x13800c(_0x4940de);});});}export const buildCommand={'name':a27_0x215dc4(0x1c0),'description':a27_0x215dc4(0x1c4),async 'run'(_0x1cd2d4,_0x36d062,_0x5c3860){await runBuild(_0x1cd2d4);}};function a27_0x1954(){const _0x48b99f=['Build\x20project','success','.bin','开始构建项目','env','pipe','26qHHxcN','inherit','npm\x20run\x20build','close','npm','cwd','now','stderr','项目构建成功','10276084jgWkGW','trim','8794aXFUNW','PATH','90wgkasM','3083464ANnoCM','info','12nFWYHz','项目构建失败','message','toString','error','项目构建出错','15461872DMAaGX','logger','build','121212EKaZYf','2825196Somldg','3205900SCGjRA'];a27_0x1954=function(){return _0x48b99f;};return a27_0x1954();}
@@ -1 +1 @@
1
- function a27_0x50d6(){const _0xdb5630=['290VcxWAv','info','error','yellow','toLowerCase','gray','version','@latest','parse','red','281YZBdtp','7tJARNs','succeed','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Try\x20manually:\x20','pipe','Already\x20up\x20to\x20date\x20(v','green','npm','/latest','607245ijlLml','https://registry.npmjs.org/','46bQUaLu','update','Checking\x20for\x20updates...','cli','Update\x20failed','Current\x20version:\x20','start','utf-8','bun','6586101lmxJVs','31876qDnaxz','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','install','package.json','...','4287784SrClMW','Update\x20available:\x20','stableVersion','2556936SxzLku','Version\x20comparison\x20failed','\x20→\x20','9155700SEUAvi','coerce','Updated\x20to\x20v','json','log','fail'];a27_0x50d6=function(){return _0xdb5630;};return a27_0x50d6();}const a27_0x4171a9=a27_0x73cf;(function(_0x25468f,_0x2f2e73){const _0x1a6b33=a27_0x73cf,_0x5a3ee4=_0x25468f();while(!![]){try{const _0x43824e=-parseInt(_0x1a6b33(0x1a5))/0x1*(-parseInt(_0x1a6b33(0x180))/0x2)+parseInt(_0x1a6b33(0x1af))/0x3+parseInt(_0x1a6b33(0x18a))/0x4*(parseInt(_0x1a6b33(0x19b))/0x5)+parseInt(_0x1a6b33(0x192))/0x6+parseInt(_0x1a6b33(0x1a6))/0x7*(-parseInt(_0x1a6b33(0x18f))/0x8)+-parseInt(_0x1a6b33(0x189))/0x9+parseInt(_0x1a6b33(0x195))/0xa;if(_0x43824e===_0x2f2e73)break;else _0x5a3ee4['push'](_0x5a3ee4['shift']());}catch(_0x50813a){_0x5a3ee4['push'](_0x5a3ee4['shift']());}}}(a27_0x50d6,0xb5e54));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a27_0x4a640f from'chalk';import a27_0x3e46fe from'ora';import a27_0x4f521a from'semver';function a27_0x73cf(_0x4a6d21,_0x236909){_0x4a6d21=_0x4a6d21-0x17f;const _0x50d6d8=a27_0x50d6();let _0x73cfd3=_0x50d6d8[_0x4a6d21];return _0x73cfd3;}import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';function getCurrentVersion(){const _0x4bc3c2=a27_0x73cf;try{const _0x5efb56=resolve(dirname(fileURLToPath(import.meta.url)),'..'),_0x1fc7d3=JSON[_0x4bc3c2(0x1a3)](readFileSync(resolve(_0x5efb56,_0x4bc3c2(0x18d)),_0x4bc3c2(0x187))),_0x246016=_0x1fc7d3[_0x4bc3c2(0x1a1)]||'0.0.0';return BUILD_NUMBER?_0x246016+'+'+BUILD_NUMBER:_0x246016;}catch{return'0.0.0';}}function detectPackageManager(){const _0x4bcca0=a27_0x73cf,_0x24b6c3=process['execPath'][_0x4bcca0(0x19f)]();if(_0x24b6c3['includes'](_0x4bcca0(0x188)))return _0x4bcca0(0x188);return _0x4bcca0(0x1ad);}async function fetchLatestNpmVersion(){const _0x3012a8=a27_0x73cf;try{const _0x54e65f=await fetch(_0x3012a8(0x17f)+NPM_PACKAGE_NAME+_0x3012a8(0x1ae),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x54e65f['ok'])return null;const _0x27c3b3=await _0x54e65f[_0x3012a8(0x198)]();return _0x27c3b3[_0x3012a8(0x1a1)]??null;}catch{return null;}}async function fetchLatestVersion(){const _0x3f3117=a27_0x73cf,_0x41bcb2=await fetchLatestNpmVersion();if(_0x41bcb2)return _0x41bcb2;const _0x1a4fb2=await getCdnConfig();return _0x1a4fb2?.[_0x3f3117(0x183)]?.[_0x3f3117(0x191)]??null;}async function runSelfUpdate(_0x131a24,_0x10c0d6,_0xf59258){const _0xcd6e55=a27_0x73cf,_0x426762=getCurrentVersion();console[_0xcd6e55(0x199)](_0xcd6e55(0x185)+_0x426762);const _0x2a4c4f=a27_0x3e46fe(_0xcd6e55(0x182))[_0xcd6e55(0x186)](),_0x19664a=await fetchLatestVersion();if(!_0x19664a){_0x2a4c4f[_0xcd6e55(0x19a)]('Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)'),console[_0xcd6e55(0x199)](a27_0x4a640f[_0xcd6e55(0x1a0)](_0xcd6e55(0x1a8)+NPM_PACKAGE_NAME+'@latest'));return;}const _0x3fde06=a27_0x4f521a[_0xcd6e55(0x196)](_0x426762),_0x380f71=a27_0x4f521a['coerce'](_0x19664a);if(!_0x3fde06||!_0x380f71){_0x2a4c4f[_0xcd6e55(0x19a)](_0xcd6e55(0x193));return;}if(!a27_0x4f521a['lt'](_0x3fde06,_0x380f71)){_0x2a4c4f[_0xcd6e55(0x1a7)](_0xcd6e55(0x1ab)+_0x19664a+')');return;}_0x2a4c4f[_0xcd6e55(0x19c)](_0xcd6e55(0x190)+a27_0x4a640f[_0xcd6e55(0x19e)](_0x426762)+_0xcd6e55(0x194)+a27_0x4a640f[_0xcd6e55(0x1ac)](_0x19664a));const _0x5a8d6d=detectPackageManager(),_0x57cf8d=a27_0x3e46fe('Updating\x20via\x20'+_0x5a8d6d+_0xcd6e55(0x18e))[_0xcd6e55(0x186)]();try{await execa(_0x5a8d6d,[_0xcd6e55(0x18c),'-g',NPM_PACKAGE_NAME+_0xcd6e55(0x1a2)],{'stdio':_0xcd6e55(0x1aa)}),_0x57cf8d['succeed'](_0xcd6e55(0x197)+_0x19664a),console['log'](a27_0x4a640f[_0xcd6e55(0x1a0)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x4b76dc){_0x57cf8d['fail'](_0xcd6e55(0x184)),console[_0xcd6e55(0x19d)](a27_0x4a640f[_0xcd6e55(0x1a4)]('\x20\x20'+_0x4b76dc['message'])),console[_0xcd6e55(0x199)](a27_0x4a640f[_0xcd6e55(0x1a0)](_0xcd6e55(0x1a9)+_0x5a8d6d+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest'));}}export const updateCommand={'name':a27_0x4171a9(0x181),'description':a27_0x4171a9(0x18b),async 'run'(_0x3d7a54,_0x15850f,_0x49b5b2){await runSelfUpdate(_0x3d7a54,_0x15850f,_0x49b5b2);}};
1
+ const a28_0x36302=a28_0x1ab6;(function(_0x1c2aed,_0x30409c){const _0x709e35=a28_0x1ab6,_0x366f75=_0x1c2aed();while(!![]){try{const _0x44ab3e=-parseInt(_0x709e35(0x1e9))/0x1*(parseInt(_0x709e35(0x1fd))/0x2)+parseInt(_0x709e35(0x1ea))/0x3+-parseInt(_0x709e35(0x1eb))/0x4*(-parseInt(_0x709e35(0x1fa))/0x5)+-parseInt(_0x709e35(0x1ed))/0x6*(parseInt(_0x709e35(0x20c))/0x7)+-parseInt(_0x709e35(0x207))/0x8+parseInt(_0x709e35(0x1ff))/0x9*(-parseInt(_0x709e35(0x201))/0xa)+-parseInt(_0x709e35(0x1f8))/0xb*(-parseInt(_0x709e35(0x203))/0xc);if(_0x44ab3e===_0x30409c)break;else _0x366f75['push'](_0x366f75['shift']());}catch(_0x4a84b0){_0x366f75['push'](_0x366f75['shift']());}}}(a28_0x57b0,0xcd5c7));function a28_0x1ab6(_0x1f3315,_0x56303c){_0x1f3315=_0x1f3315-0x1db;const _0x57b082=a28_0x57b0();let _0x1ab68d=_0x57b082[_0x1f3315];return _0x1ab68d;}import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a28_0x597bd5 from'chalk';import a28_0x46d6d2 from'ora';import a28_0x1f0d96 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';function getCurrentVersion(){const _0xf83fd4=a28_0x1ab6;try{const _0x54b4b1=resolve(dirname(fileURLToPath(import.meta.url)),'..'),_0x2e6a23=JSON[_0xf83fd4(0x1dc)](readFileSync(resolve(_0x54b4b1,_0xf83fd4(0x1ec)),_0xf83fd4(0x1f1))),_0x58b8ca=_0x2e6a23[_0xf83fd4(0x1de)]||_0xf83fd4(0x1ef);return BUILD_NUMBER?_0x58b8ca+'+'+BUILD_NUMBER:_0x58b8ca;}catch{return _0xf83fd4(0x1ef);}}function a28_0x57b0(){const _0x494ef4=['54222rPNHqA','Current\x20version:\x20','0.0.0','timeout','utf-8','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','succeed','toLowerCase','npm','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20Try\x20manually:\x20','183832SDznxx','start','4204645WYUZRz','update','Updated\x20to\x20v','140jnLTkM','includes','11467746SSYkVI','Version\x20comparison\x20failed','10kXokgY','info','516vzHDTq','coerce','@latest','log','6089296nCSgmm','Checking\x20for\x20updates...','gray','install','https://registry.npmjs.org/','140dVDkuJ','yellow','Updating\x20via\x20','parse','fail','version','message','Already\x20up\x20to\x20date\x20(v','execPath','\x20→\x20','stableVersion','bun','pipe','/latest','json','green','8184hBNWsG','3688983dJmnBI','8ciMhqz','package.json'];a28_0x57b0=function(){return _0x494ef4;};return a28_0x57b0();}function detectPackageManager(){const _0xa0a9c5=a28_0x1ab6,_0x50c50f=process[_0xa0a9c5(0x1e1)][_0xa0a9c5(0x1f4)]();if(_0x50c50f[_0xa0a9c5(0x1fe)]('bun'))return _0xa0a9c5(0x1e4);return _0xa0a9c5(0x1f5);}async function fetchLatestNpmVersion(){const _0x5e7031=a28_0x1ab6;try{const _0xa72d00=await fetch(_0x5e7031(0x20b)+NPM_PACKAGE_NAME+_0x5e7031(0x1e6),{'signal':AbortSignal[_0x5e7031(0x1f0)](0x2710)});if(!_0xa72d00['ok'])return null;const _0x435ebd=await _0xa72d00[_0x5e7031(0x1e7)]();return _0x435ebd[_0x5e7031(0x1de)]??null;}catch{return null;}}async function fetchLatestVersion(){const _0x6ae8a0=a28_0x1ab6,_0x261eb2=await fetchLatestNpmVersion();if(_0x261eb2)return _0x261eb2;const _0x1ba47b=await getCdnConfig();return _0x1ba47b?.['cli']?.[_0x6ae8a0(0x1e3)]??null;}async function runSelfUpdate(_0x11f8eb,_0x1031e1,_0x38a3ab){const _0x18454d=a28_0x1ab6,_0x2e6fd2=getCurrentVersion();console['log'](_0x18454d(0x1ee)+_0x2e6fd2);const _0x4d6f6d=a28_0x46d6d2(_0x18454d(0x208))[_0x18454d(0x1f9)](),_0x45e7c3=await fetchLatestVersion();if(!_0x45e7c3){_0x4d6f6d[_0x18454d(0x1dd)]('Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)'),console[_0x18454d(0x206)](a28_0x597bd5[_0x18454d(0x209)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest'));return;}const _0x1c3c04=a28_0x1f0d96[_0x18454d(0x204)](_0x2e6fd2),_0x48b575=a28_0x1f0d96['coerce'](_0x45e7c3);if(!_0x1c3c04||!_0x48b575){_0x4d6f6d[_0x18454d(0x1dd)](_0x18454d(0x200));return;}if(!a28_0x1f0d96['lt'](_0x1c3c04,_0x48b575)){_0x4d6f6d[_0x18454d(0x1f3)](_0x18454d(0x1e0)+_0x45e7c3+')');return;}_0x4d6f6d[_0x18454d(0x202)]('Update\x20available:\x20'+a28_0x597bd5[_0x18454d(0x20d)](_0x2e6fd2)+_0x18454d(0x1e2)+a28_0x597bd5[_0x18454d(0x1e8)](_0x45e7c3));const _0x1dfcc1=detectPackageManager(),_0x2516cd=a28_0x46d6d2(_0x18454d(0x1db)+_0x1dfcc1+'...')[_0x18454d(0x1f9)]();try{await execa(_0x1dfcc1,[_0x18454d(0x20a),'-g',NPM_PACKAGE_NAME+'@latest'],{'stdio':_0x18454d(0x1e5)}),_0x2516cd['succeed'](_0x18454d(0x1fc)+_0x45e7c3),console[_0x18454d(0x206)](a28_0x597bd5['gray'](_0x18454d(0x1f2)));}catch(_0x5c253f){_0x2516cd[_0x18454d(0x1dd)]('Update\x20failed'),console['error'](a28_0x597bd5['red']('\x20\x20'+_0x5c253f[_0x18454d(0x1df)])),console[_0x18454d(0x206)](a28_0x597bd5[_0x18454d(0x209)](_0x18454d(0x1f7)+_0x1dfcc1+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x18454d(0x205)));}}export const updateCommand={'name':a28_0x36302(0x1fb),'description':a28_0x36302(0x1f6),async 'run'(_0xd419ed,_0x28368e,_0xb7c3f){await runSelfUpdate(_0xd419ed,_0x28368e,_0xb7c3f);}};
@@ -1 +1 @@
1
- (function(_0x1be963,_0x20f40e){const _0x4eb224=a28_0xa680,_0x43c67f=_0x1be963();while(!![]){try{const _0x5beaae=-parseInt(_0x4eb224(0x1e7))/0x1+-parseInt(_0x4eb224(0x1ea))/0x2+-parseInt(_0x4eb224(0x1e8))/0x3*(parseInt(_0x4eb224(0x1e9))/0x4)+parseInt(_0x4eb224(0x1e5))/0x5+parseInt(_0x4eb224(0x1e4))/0x6+parseInt(_0x4eb224(0x1e3))/0x7+-parseInt(_0x4eb224(0x1e6))/0x8;if(_0x5beaae===_0x20f40e)break;else _0x43c67f['push'](_0x43c67f['shift']());}catch(_0x44ba23){_0x43c67f['push'](_0x43c67f['shift']());}}}(a28_0x2c50,0x1a84e));function a28_0xa680(_0x8f5ef7,_0x3afc25){_0x8f5ef7=_0x8f5ef7-0x1e3;const _0x2c5092=a28_0x2c50();let _0xa680b=_0x2c5092[_0x8f5ef7];return _0xa680b;}import{codegenSdk}from'./sdk.js';function a28_0x2c50(){const _0x4b8811=['48vbgYuZ','30364DNnBYS','63460MVkczM','279790BCUYMA','1043544xgFZZj','631335wlrQcY','454632xwJDsl','21524sJUxiK'];a28_0x2c50=function(){return _0x4b8811;};return a28_0x2c50();}import{codegenSql}from'./sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ (function(_0xaa54e6,_0xdc1dc0){const _0x1b3ba2=a29_0x3308,_0x631241=_0xaa54e6();while(!![]){try{const _0x325a82=-parseInt(_0x1b3ba2(0x1ee))/0x1*(-parseInt(_0x1b3ba2(0x1e9))/0x2)+-parseInt(_0x1b3ba2(0x1e5))/0x3*(-parseInt(_0x1b3ba2(0x1ef))/0x4)+parseInt(_0x1b3ba2(0x1e6))/0x5*(-parseInt(_0x1b3ba2(0x1ec))/0x6)+-parseInt(_0x1b3ba2(0x1e4))/0x7*(parseInt(_0x1b3ba2(0x1e7))/0x8)+parseInt(_0x1b3ba2(0x1e3))/0x9*(parseInt(_0x1b3ba2(0x1ed))/0xa)+-parseInt(_0x1b3ba2(0x1eb))/0xb+-parseInt(_0x1b3ba2(0x1ea))/0xc*(-parseInt(_0x1b3ba2(0x1e8))/0xd);if(_0x325a82===_0xdc1dc0)break;else _0x631241['push'](_0x631241['shift']());}catch(_0xb8d665){_0x631241['push'](_0x631241['shift']());}}}(a29_0x3ea8,0x6a186));function a29_0x3ea8(){const _0x8bbda6=['6609075UTwHAV','6ccRRVX','847230wzkybA','1GTrgyN','414564htfQgI','9cccvhX','5212249WafiaA','3JEHEkD','3839415RvNPSk','8yftIYM','46631CNGsgj','866596VGfjov','6444BqgESZ'];a29_0x3ea8=function(){return _0x8bbda6;};return a29_0x3ea8();}import{codegenSdk}from'./sdk.js';function a29_0x3308(_0x24c459,_0x3dd120){_0x24c459=_0x24c459-0x1e3;const _0x3ea846=a29_0x3ea8();let _0x33080b=_0x3ea846[_0x24c459];return _0x33080b;}import{codegenSql}from'./sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
@@ -1 +1 @@
1
- function a29_0x35ad(){const _0x1da45a=['Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','466200RXBvoO','sdk','1129302KOoGtQ','23160xGYxDS','169491BXZESm','boolean','2AKhdPr','305955gokAba','168627SzdIBv','skip-imports','string','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','name','573904uffxYf','tableName','Omit\x20import\x20statements\x20from\x20generated\x20code','code','appCode','str','783zBKiFa','read','alias'];a29_0x35ad=function(){return _0x1da45a;};return a29_0x35ad();}const a29_0x1ad5c7=a29_0xe791;(function(_0x1ea589,_0x456ba1){const _0x41f4fa=a29_0xe791,_0x3dfbed=_0x1ea589();while(!![]){try{const _0x58de40=-parseInt(_0x41f4fa(0x117))/0x1*(-parseInt(_0x41f4fa(0x115))/0x2)+parseInt(_0x41f4fa(0x116))/0x3+-parseInt(_0x41f4fa(0x105))/0x4+parseInt(_0x41f4fa(0x10f))/0x5+parseInt(_0x41f4fa(0x111))/0x6+-parseInt(_0x41f4fa(0x113))/0x7+parseInt(_0x41f4fa(0x112))/0x8*(-parseInt(_0x41f4fa(0x10b))/0x9);if(_0x58de40===_0x456ba1)break;else _0x3dfbed['push'](_0x3dfbed['shift']());}catch(_0x362505){_0x3dfbed['push'](_0x3dfbed['shift']());}}}(a29_0x35ad,0x205a3));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a29_0xe791(_0xb5bf7,_0x4a66fc){_0xb5bf7=_0xb5bf7-0x102;const _0x35ad72=a29_0x35ad();let _0xe79103=_0x35ad72[_0xb5bf7];return _0xe79103;}import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':'codegen','command':a29_0x1ad5c7(0x110),'description':a29_0x1ad5c7(0x10e),'risk':a29_0x1ad5c7(0x10c),'flags':[CODE_FLAG_OPTIONAL,{'name':a29_0x1ad5c7(0x10d),'type':a29_0x1ad5c7(0x102),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':a29_0x1ad5c7(0x102),'required':!![],'description':a29_0x1ad5c7(0x103)},{'name':a29_0x1ad5c7(0x118),'type':a29_0x1ad5c7(0x114),'description':a29_0x1ad5c7(0x107)}],async 'execute'(_0x181c65){const _0x136ff0=a29_0x1ad5c7,{dataset:_0x40cb11,operation:_0x50903a}=await getOperationDetail(_0x181c65[_0x136ff0(0x109)],_0x181c65['str'](_0x136ff0(0x108)),_0x181c65[_0x136ff0(0x10a)]('operation')),_0x3b60fa=generateSdkCode(_0x40cb11,_0x50903a,{'includeImports':!_0x181c65['bool'](_0x136ff0(0x118))});return{'ok':!![],'data':{'dataset':{'name':_0x40cb11[_0x136ff0(0x104)],'code':_0x40cb11['code'],'tableName':_0x40cb11[_0x136ff0(0x106)]},'operation':_0x181c65['str']('operation'),'code':_0x3b60fa}};}};
1
+ const a30_0x1a4bf4=a30_0x1e06;(function(_0x108eb6,_0x48d275){const _0x2c7718=a30_0x1e06,_0x2ecf6e=_0x108eb6();while(!![]){try{const _0x282e6c=-parseInt(_0x2c7718(0x6f))/0x1*(-parseInt(_0x2c7718(0x7d))/0x2)+-parseInt(_0x2c7718(0x82))/0x3*(parseInt(_0x2c7718(0x72))/0x4)+parseInt(_0x2c7718(0x6b))/0x5+parseInt(_0x2c7718(0x70))/0x6*(parseInt(_0x2c7718(0x6e))/0x7)+parseInt(_0x2c7718(0x7a))/0x8*(-parseInt(_0x2c7718(0x7c))/0x9)+-parseInt(_0x2c7718(0x7b))/0xa*(-parseInt(_0x2c7718(0x6c))/0xb)+-parseInt(_0x2c7718(0x77))/0xc;if(_0x282e6c===_0x48d275)break;else _0x2ecf6e['push'](_0x2ecf6e['shift']());}catch(_0x54272f){_0x2ecf6e['push'](_0x2ecf6e['shift']());}}}(a30_0x3089,0x91097));function a30_0x3089(){const _0x2e3297=['2073512ooiEWU','9435170KIRQsr','9MbhCYA','2FSEShF','code','string','tableName','appCode','150GXpVeh','read','Omit\x20import\x20statements\x20from\x20generated\x20code','1841345dfyFQx','11HyQlMJ','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','35aQRALk','380379YgkTUB','1383516wWKehS','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','57704jelaIk','name','alias','str','operation','15246420aUDkUa','sdk','boolean'];a30_0x3089=function(){return _0x2e3297;};return a30_0x3089();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a30_0x1e06(_0x51b928,_0x1fa8fb){_0x51b928=_0x51b928-0x6b;const _0x308972=a30_0x3089();let _0x1e0684=_0x308972[_0x51b928];return _0x1e0684;}import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':'codegen','command':a30_0x1a4bf4(0x78),'description':a30_0x1a4bf4(0x71),'risk':a30_0x1a4bf4(0x83),'flags':[CODE_FLAG_OPTIONAL,{'name':a30_0x1a4bf4(0x74),'type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':a30_0x1a4bf4(0x7f),'required':!![],'description':a30_0x1a4bf4(0x6d)},{'name':'skip-imports','type':a30_0x1a4bf4(0x79),'description':a30_0x1a4bf4(0x84)}],async 'execute'(_0x5b2bd7){const _0x351e03=a30_0x1a4bf4,{dataset:_0x5d5b09,operation:_0x1b5345}=await getOperationDetail(_0x5b2bd7[_0x351e03(0x81)],_0x5b2bd7[_0x351e03(0x75)](_0x351e03(0x7e)),_0x5b2bd7[_0x351e03(0x75)](_0x351e03(0x76))),_0x493ce5=generateSdkCode(_0x5d5b09,_0x1b5345,{'includeImports':!_0x5b2bd7['bool']('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x5d5b09[_0x351e03(0x73)],'code':_0x5d5b09['code'],'tableName':_0x5d5b09[_0x351e03(0x80)]},'operation':_0x5b2bd7[_0x351e03(0x75)](_0x351e03(0x76)),'code':_0x493ce5}};}};
@@ -1 +1 @@
1
- const a30_0x294fd9=a30_0x3fb5;(function(_0x3e0c39,_0x3acefa){const _0x349290=a30_0x3fb5,_0x18a611=_0x3e0c39();while(!![]){try{const _0x473a96=parseInt(_0x349290(0xa8))/0x1+-parseInt(_0x349290(0x99))/0x2*(-parseInt(_0x349290(0xa5))/0x3)+parseInt(_0x349290(0xb1))/0x4*(parseInt(_0x349290(0xa1))/0x5)+parseInt(_0x349290(0xaf))/0x6*(-parseInt(_0x349290(0x9b))/0x7)+-parseInt(_0x349290(0xac))/0x8+parseInt(_0x349290(0xad))/0x9*(-parseInt(_0x349290(0x9a))/0xa)+parseInt(_0x349290(0x9c))/0xb;if(_0x473a96===_0x3acefa)break;else _0x18a611['push'](_0x18a611['shift']());}catch(_0x47325b){_0x18a611['push'](_0x18a611['shift']());}}}(a30_0x1599,0x74a4c));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a30_0x3fb5(_0x567015,_0x458f7a){_0x567015=_0x567015-0x98;const _0x1599cd=a30_0x1599();let _0x3fb50f=_0x1599cd[_0x567015];return _0x3fb50f;}function a30_0x1599(){const _0x243551=['bff','6bmBAuJ','sdk','4FiywlY','no-imports','1506KTmBWh','70yElmVI','3598763SPjNPV','5927845jJLFqV','sqlName','target','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','str','3747755wWjTBV','boolean','codegen','bool','3270PTUuGR','appCode','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','610155mAaaRc','string','read','Omit\x20import\x20statements\x20from\x20generated\x20code','7360040OdcfFd','1038195jMxHvy'];a30_0x1599=function(){return _0x243551;};return a30_0x1599();}import{SQLCODE_FLAG}from'../common/flags.js';export const codegenSql={'service':a30_0x294fd9(0xa3),'command':'sql','description':a30_0x294fd9(0x9f),'risk':a30_0x294fd9(0xaa),'flags':[SQLCODE_FLAG,{'name':a30_0x294fd9(0x9e),'type':a30_0x294fd9(0xa9),'description':a30_0x294fd9(0xa7),'default':a30_0x294fd9(0xb0),'enum':[a30_0x294fd9(0xb0),a30_0x294fd9(0xae)]},{'name':a30_0x294fd9(0x98),'type':a30_0x294fd9(0xa2),'description':a30_0x294fd9(0xab)}],async 'execute'(_0x53012){const _0x2a0fe4=a30_0x294fd9,_0x3d2420=await getSqlQueryInfo(_0x53012[_0x2a0fe4(0xa6)],_0x53012[_0x2a0fe4(0xa0)]('sqlcode')),_0x54a17d=_0x53012[_0x2a0fe4(0xa0)](_0x2a0fe4(0x9e))||_0x2a0fe4(0xb0),_0x3b0103=generateSqlCodeTemplate(_0x3d2420,{'target':_0x54a17d,'includeImports':!_0x53012[_0x2a0fe4(0xa4)](_0x2a0fe4(0x98))});return{'ok':!![],'data':{'sqlCode':_0x3d2420['sqlCode'],'sqlName':_0x3d2420[_0x2a0fe4(0x9d)],'target':_0x54a17d,'code':_0x3b0103}};}};
1
+ const a31_0x7968b=a31_0x1979;(function(_0x3973b9,_0x3bb0fb){const _0xff6236=a31_0x1979,_0x69be6e=_0x3973b9();while(!![]){try{const _0x1370ff=parseInt(_0xff6236(0x1bd))/0x1*(-parseInt(_0xff6236(0x1bf))/0x2)+parseInt(_0xff6236(0x1c4))/0x3*(-parseInt(_0xff6236(0x1cd))/0x4)+parseInt(_0xff6236(0x1ba))/0x5*(-parseInt(_0xff6236(0x1bb))/0x6)+parseInt(_0xff6236(0x1c8))/0x7*(parseInt(_0xff6236(0x1c2))/0x8)+-parseInt(_0xff6236(0x1bc))/0x9*(parseInt(_0xff6236(0x1c1))/0xa)+-parseInt(_0xff6236(0x1cc))/0xb*(parseInt(_0xff6236(0x1ca))/0xc)+parseInt(_0xff6236(0x1cb))/0xd;if(_0x1370ff===_0x3bb0fb)break;else _0x69be6e['push'](_0x69be6e['shift']());}catch(_0x43e116){_0x69be6e['push'](_0x69be6e['shift']());}}}(a31_0x1bf8,0x7c1bd));function a31_0x1bf8(){const _0x182229=['no-imports','sqlCode','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sdk','5KSUsrE','671334WXYhaR','11133EqOFAx','5hBcZoA','boolean','177314dogqDO','str','7090hQLegX','30808SQKHcf','string','105MPLKxQ','read','appCode','target','595QcypzT','bool','3107076jAMRkH','33442877CimBdn','11mvERAZ','80044oAenbI','codegen','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query'];a31_0x1bf8=function(){return _0x182229;};return a31_0x1bf8();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../common/flags.js';function a31_0x1979(_0x20b449,_0x3f95df){_0x20b449=_0x20b449-0x1b8;const _0x1bf824=a31_0x1bf8();let _0x197954=_0x1bf824[_0x20b449];return _0x197954;}export const codegenSql={'service':a31_0x7968b(0x1ce),'command':'sql','description':a31_0x7968b(0x1cf),'risk':a31_0x7968b(0x1c5),'flags':[SQLCODE_FLAG,{'name':'target','type':a31_0x7968b(0x1c3),'description':a31_0x7968b(0x1b8),'default':a31_0x7968b(0x1b9),'enum':[a31_0x7968b(0x1b9),'bff']},{'name':a31_0x7968b(0x1d0),'type':a31_0x7968b(0x1be),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x1290f7){const _0x4c0b6c=a31_0x7968b,_0x5870d1=await getSqlQueryInfo(_0x1290f7[_0x4c0b6c(0x1c6)],_0x1290f7[_0x4c0b6c(0x1c0)]('sqlcode')),_0x2fe5c3=_0x1290f7[_0x4c0b6c(0x1c0)](_0x4c0b6c(0x1c7))||_0x4c0b6c(0x1b9),_0x3bf4e0=generateSqlCodeTemplate(_0x5870d1,{'target':_0x2fe5c3,'includeImports':!_0x1290f7[_0x4c0b6c(0x1c9)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x5870d1[_0x4c0b6c(0x1d1)],'sqlName':_0x5870d1['sqlName'],'target':_0x2fe5c3,'code':_0x3bf4e0}};}};