@lovrabet/rabetbase-cli 2.0.6 → 2.0.8

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 (149) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/logout.js +1 -1
  11. package/lib/cli-flags.js +1 -1
  12. package/lib/cli.js +1 -1
  13. package/lib/commands/api/doc.js +1 -1
  14. package/lib/commands/api/index.js +1 -1
  15. package/lib/commands/api/list.js +1 -1
  16. package/lib/commands/api/pull.js +1 -1
  17. package/lib/commands/api/shared.js +1 -1
  18. package/lib/commands/app/add.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/remote.js +1 -1
  22. package/lib/commands/app/remove.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app/use.js +1 -1
  25. package/lib/commands/auth/index.js +1 -1
  26. package/lib/commands/bff/delete.js +1 -1
  27. package/lib/commands/bff/detail.js +1 -1
  28. package/lib/commands/bff/index.js +1 -1
  29. package/lib/commands/bff/list.js +1 -1
  30. package/lib/commands/bff/new.js +1 -1
  31. package/lib/commands/bff/pull.js +1 -1
  32. package/lib/commands/bff/push.js +1 -1
  33. package/lib/commands/bff/status.js +1 -1
  34. package/lib/commands/cli-update.js +1 -1
  35. package/lib/commands/codegen/index.js +1 -1
  36. package/lib/commands/codegen/sdk.js +1 -1
  37. package/lib/commands/codegen/sql.js +1 -1
  38. package/lib/commands/common/app-selector.js +1 -1
  39. package/lib/commands/common/flags.js +1 -1
  40. package/lib/commands/common/validate.js +1 -1
  41. package/lib/commands/config/get.js +1 -1
  42. package/lib/commands/config/index.js +1 -1
  43. package/lib/commands/config/list.js +1 -1
  44. package/lib/commands/config/set.js +1 -1
  45. package/lib/commands/config/shared.js +1 -1
  46. package/lib/commands/dataset/detail.js +1 -1
  47. package/lib/commands/dataset/index.js +1 -1
  48. package/lib/commands/dataset/links.js +1 -1
  49. package/lib/commands/dataset/list.js +1 -1
  50. package/lib/commands/dataset/operations.js +1 -1
  51. package/lib/commands/doctor.js +1 -1
  52. package/lib/commands/init/index.js +1 -1
  53. package/lib/commands/logs/index.js +1 -1
  54. package/lib/commands/menu/index.js +1 -1
  55. package/lib/commands/menu/shared/compare-table.js +1 -1
  56. package/lib/commands/menu/shared/index.js +1 -1
  57. package/lib/commands/menu/shared/inquirer.js +1 -1
  58. package/lib/commands/menu/shared/local-pages.js +1 -1
  59. package/lib/commands/menu/shared/logic.js +1 -1
  60. package/lib/commands/menu/shared/service.js +1 -1
  61. package/lib/commands/menu/shared/sync-core.js +1 -1
  62. package/lib/commands/menu/shared/update-core.js +1 -1
  63. package/lib/commands/menu/shared/valid-url.js +1 -1
  64. package/lib/commands/menu/sync.js +1 -1
  65. package/lib/commands/menu/update.js +1 -1
  66. package/lib/commands/project/create/enhanced-guided-create.js +1 -0
  67. package/lib/commands/project/create/format-elapsed.js +1 -0
  68. package/lib/commands/project/create/main.js +1 -0
  69. package/lib/commands/project/create/non-interactive.js +1 -0
  70. package/lib/commands/project/create/project-template-path.js +1 -0
  71. package/lib/commands/project/create/use-copy-project-template.js +1 -0
  72. package/lib/commands/project/create/use-format-code.js +1 -0
  73. package/lib/commands/project/create/use-install-dependencies.js +1 -0
  74. package/lib/commands/project/index.js +1 -1
  75. package/lib/commands/project/init.js +1 -0
  76. package/lib/commands/project/upgrade.js +1 -0
  77. package/lib/commands/registry.js +1 -1
  78. package/lib/commands/run/index.js +1 -1
  79. package/lib/commands/schema.js +1 -0
  80. package/lib/commands/skill/index.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/sql/list.js +1 -1
  85. package/lib/commands/sql/save.js +1 -1
  86. package/lib/commands/sql/validate.js +1 -1
  87. package/lib/constant/cli.js +1 -1
  88. package/lib/constant/domain.js +1 -1
  89. package/lib/constant/env.js +1 -1
  90. package/lib/context.js +1 -1
  91. package/lib/core/alias-resolver.js +1 -1
  92. package/lib/core/api-client.js +1 -1
  93. package/lib/core/bff/config.js +1 -1
  94. package/lib/core/bff/file-system.js +1 -1
  95. package/lib/core/bff/hash.js +1 -1
  96. package/lib/core/bff/lock.js +1 -1
  97. package/lib/core/bff/utils.js +1 -1
  98. package/lib/core/db-resolver.js +1 -1
  99. package/lib/core/sql-validator.js +1 -1
  100. package/lib/errors.js +1 -1
  101. package/lib/framework/build-all-flags.js +1 -0
  102. package/lib/framework/flags.js +1 -1
  103. package/lib/framework/help.js +1 -1
  104. package/lib/framework/index.js +1 -1
  105. package/lib/framework/output.js +1 -1
  106. package/lib/framework/response.js +1 -1
  107. package/lib/framework/runner.js +1 -1
  108. package/lib/framework/schema-export.js +1 -0
  109. package/lib/framework/types.js +1 -1
  110. package/lib/generated/build-info.js +1 -1
  111. package/lib/help.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-command-trace.js +1 -1
  115. package/lib/telemetry/cli-help-trace.js +1 -1
  116. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  117. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  118. package/lib/telemetry/send-cli-trace-log.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/apply-jq-filter.js +1 -0
  121. package/lib/utils/cdn-config.js +1 -1
  122. package/lib/utils/check-sdk-version.js +1 -1
  123. package/lib/utils/cli-version-check.js +1 -1
  124. package/lib/utils/config.js +1 -1
  125. package/lib/utils/copy-directory.js +1 -1
  126. package/lib/utils/file-utils.js +1 -1
  127. package/lib/utils/guides-cdn.js +1 -1
  128. package/lib/utils/http-client.js +1 -1
  129. package/lib/utils/is-non-interactive.js +1 -1
  130. package/lib/utils/logger.js +1 -1
  131. package/lib/utils/platform.js +1 -1
  132. package/lib/utils/rules-cdn.js +1 -1
  133. package/lib/utils/sleep.js +1 -1
  134. package/lib/utils/template-replacer.js +1 -1
  135. package/lib/utils/version.js +1 -1
  136. package/lib/utils/with-active-cookie.js +1 -1
  137. package/package.json +4 -2
  138. package/lib/commands/build.js +0 -1
  139. package/lib/commands/preview.js +0 -1
  140. package/lib/commands/project-upgrade.js +0 -1
  141. package/lib/commands/start.js +0 -1
  142. package/lib/create-app/enhanced-guided-create.js +0 -1
  143. package/lib/create-app/format-elapsed.js +0 -1
  144. package/lib/create-app/main.js +0 -1
  145. package/lib/create-app/non-interactive.js +0 -1
  146. package/lib/create-app/use-copy-project-template.js +0 -1
  147. package/lib/create-app/use-format-code.js +0 -1
  148. package/lib/create-app/use-install-dependencies.js +0 -1
  149. package/lib/init/main.js +0 -1
@@ -1 +1 @@
1
- function a20_0x4aaf(_0x76b161,_0x22820f){_0x76b161=_0x76b161-0xce;const _0x20c4f1=a20_0x20c4();let _0x4aaf8b=_0x20c4f1[_0x76b161];return _0x4aaf8b;}const a20_0x134343=a20_0x4aaf;(function(_0x5d1f2c,_0x18090b){const _0x486a98=a20_0x4aaf,_0x31e75c=_0x5d1f2c();while(!![]){try{const _0x3455c=-parseInt(_0x486a98(0xdb))/0x1*(-parseInt(_0x486a98(0xd8))/0x2)+parseInt(_0x486a98(0xd4))/0x3+-parseInt(_0x486a98(0xdd))/0x4*(-parseInt(_0x486a98(0xd0))/0x5)+parseInt(_0x486a98(0xd2))/0x6+-parseInt(_0x486a98(0xd1))/0x7*(parseInt(_0x486a98(0xce))/0x8)+parseInt(_0x486a98(0xd9))/0x9+-parseInt(_0x486a98(0xcf))/0xa;if(_0x3455c===_0x18090b)break;else _0x31e75c['push'](_0x31e75c['shift']());}catch(_0x4173ff){_0x31e75c['push'](_0x31e75c['shift']());}}}(a20_0x20c4,0x922c7));import{listRemoteApps}from'../../core/api-client.js';function a20_0x20c4(){const _0x5914f6=['713786DarRSN','9383112AVHgqJ','appDesc','1yfSMuF','remote','8uQocFM','map','8BwPDCP','12911960RVXRfG','2373465GCvbvj','7399658gAqSva','845886ottAHW','appName','1371567uNyGQC','../../core/api-client.js','appCode','cookie'];a20_0x20c4=function(){return _0x5914f6;};return a20_0x20c4();}async function execute(_0x286efa){const _0x5a7e2d=a20_0x4aaf,{setActiveCookie:_0x4799e1}=await import(_0x5a7e2d(0xd5));_0x4799e1(_0x286efa[_0x5a7e2d(0xd7)]);const _0x3f0de1=await listRemoteApps(),_0x2ee3a7=_0x3f0de1[_0x5a7e2d(0xde)](_0x156f60=>({..._0x156f60['id']!=null?{'id':_0x156f60['id']}:{},'appCode':_0x156f60[_0x5a7e2d(0xd6)],'appName':_0x156f60[_0x5a7e2d(0xd3)],..._0x156f60['appDesc']!=null?{'appDesc':_0x156f60[_0x5a7e2d(0xda)]}:{}}));return{'ok':!![],'data':_0x2ee3a7};}export const appRemoteDefinition={'service':'app','command':a20_0x134343(0xdc),'description':'List\x20apps\x20available\x20on\x20the\x20platform','risk':'read','requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
1
+ function a20_0x1d16(_0x11b483,_0x2e5cfd){_0x11b483=_0x11b483-0x88;const _0x7db397=a20_0x7db3();let _0x1d1682=_0x7db397[_0x11b483];return _0x1d1682;}const a20_0x2db5e1=a20_0x1d16;(function(_0xf24f21,_0x5e7129){const _0x30c11f=a20_0x1d16,_0x33d2b2=_0xf24f21();while(!![]){try{const _0x56b6f2=-parseInt(_0x30c11f(0x89))/0x1+-parseInt(_0x30c11f(0x93))/0x2+parseInt(_0x30c11f(0x90))/0x3+parseInt(_0x30c11f(0x8f))/0x4+parseInt(_0x30c11f(0x95))/0x5+-parseInt(_0x30c11f(0x88))/0x6*(parseInt(_0x30c11f(0x8d))/0x7)+parseInt(_0x30c11f(0x94))/0x8;if(_0x56b6f2===_0x5e7129)break;else _0x33d2b2['push'](_0x33d2b2['shift']());}catch(_0x41d56e){_0x33d2b2['push'](_0x33d2b2['shift']());}}}(a20_0x7db3,0x1dee3));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x562f14){const _0x3aa685=a20_0x1d16,{setActiveCookie:_0x2a2462}=await import('../../core/api-client.js');_0x2a2462(_0x562f14[_0x3aa685(0x8c)]);const _0x16acc9=await listRemoteApps(),_0x409005=_0x16acc9['map'](_0x50fa9a=>({..._0x50fa9a['id']!=null?{'id':_0x50fa9a['id']}:{},'appCode':_0x50fa9a['appCode'],'appName':_0x50fa9a[_0x3aa685(0x8b)],..._0x50fa9a['appDesc']!=null?{'appDesc':_0x50fa9a[_0x3aa685(0x91)]}:{}}));return{'ok':!![],'data':_0x409005};}function a20_0x7db3(){const _0x3c9ee2=['281376cPBrvm','381714ZBwlRC','appDesc','List\x20apps\x20available\x20on\x20the\x20platform','68936VFGuRv','1004888BUJYre','61415mCtzuQ','12042oMNyQl','148308APHxBT','read','appName','cookie','105pEYvFl','app'];a20_0x7db3=function(){return _0x3c9ee2;};return a20_0x7db3();}export const appRemoteDefinition={'service':a20_0x2db5e1(0x8e),'command':'remote','description':a20_0x2db5e1(0x92),'risk':a20_0x2db5e1(0x8a),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a21_0x120bfe=a21_0x4c4b;(function(_0xc9e532,_0x36db65){const _0x19c25e=a21_0x4c4b,_0x12de36=_0xc9e532();while(!![]){try{const _0x2b1409=parseInt(_0x19c25e(0x1f8))/0x1+-parseInt(_0x19c25e(0x1f2))/0x2+-parseInt(_0x19c25e(0x1f7))/0x3*(-parseInt(_0x19c25e(0x1ef))/0x4)+parseInt(_0x19c25e(0x1f3))/0x5*(-parseInt(_0x19c25e(0x1fb))/0x6)+parseInt(_0x19c25e(0x1fd))/0x7*(parseInt(_0x19c25e(0x1e7))/0x8)+parseInt(_0x19c25e(0x1ee))/0x9+-parseInt(_0x19c25e(0x1f5))/0xa;if(_0x2b1409===_0x36db65)break;else _0x12de36['push'](_0x12de36['shift']());}catch(_0x2e39ca){_0x12de36['push'](_0x12de36['shift']());}}}(a21_0x4ff0,0x24480));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readConfig,writeConfig}from'./shared.js';function a21_0x4ff0(){const _0x3498ab=['18144uDbuZJ','215843sDMXYr','str','\x20app\x20remove\x20--name\x20<name>','88710WxrbEx','apps','1364426QpQYPr','write','remove','Usage:\x20','keys','bool','validation','App\x20\x22','8GyQcui','defaultApp','string','\x20Default\x20app\x20changed\x20to\x20\x22','Remove\x20an\x20app\x20from\x20config','App\x20name\x20to\x20remove','length','2610324eIzLDa','36NLmpjA','Removed\x20app\x20\x22','\x22\x20not\x20found.','145462zPcRAm','65uOfdAq','global','3416850DbjezR','name'];a21_0x4ff0=function(){return _0x3498ab;};return a21_0x4ff0();}function a21_0x4c4b(_0x4817dc,_0x11c3df){_0x4817dc=_0x4817dc-0x1e2;const _0x4ff0b8=a21_0x4ff0();let _0x4c4bd2=_0x4ff0b8[_0x4817dc];return _0x4c4bd2;}async function execute(_0x3d0956){const _0x36b6e9=a21_0x4c4b,_0x300b83=_0x3d0956[_0x36b6e9(0x1f9)](_0x36b6e9(0x1f6));if(!_0x300b83)throw CliErrors[_0x36b6e9(0x1e5)]('Missing\x20app\x20name.',_0x36b6e9(0x1e2)+CLI_BIN_NAME+_0x36b6e9(0x1fa));const _0x517f38={'global':_0x3d0956[_0x36b6e9(0x1e4)]('global')},_0x1a0cf6=readConfig(_0x517f38),_0x576e5c=_0x1a0cf6[_0x36b6e9(0x1fc)];if(!_0x576e5c||!_0x576e5c[_0x300b83])throw CliErrors['validation'](_0x36b6e9(0x1e6)+_0x300b83+_0x36b6e9(0x1f1));delete _0x576e5c[_0x300b83];let _0x3ef798='';if(_0x1a0cf6[_0x36b6e9(0x1e8)]===_0x300b83){const _0x12f780=Object[_0x36b6e9(0x1e3)](_0x576e5c);_0x1a0cf6['defaultApp']=_0x12f780[_0x36b6e9(0x1ed)]>0x0?_0x12f780[0x0]:undefined,_0x1a0cf6[_0x36b6e9(0x1e8)]?_0x3ef798=_0x36b6e9(0x1ea)+_0x1a0cf6[_0x36b6e9(0x1e8)]+'\x22.':delete _0x1a0cf6[_0x36b6e9(0x1e8)];}return Object[_0x36b6e9(0x1e3)](_0x576e5c)['length']===0x0&&(delete _0x1a0cf6[_0x36b6e9(0x1fc)],delete _0x1a0cf6[_0x36b6e9(0x1e8)]),writeConfig(_0x1a0cf6,_0x517f38),{'ok':!![],'message':_0x36b6e9(0x1f0)+_0x300b83+'\x22.'+_0x3ef798};}export const appRemoveDefinition={'service':'app','command':a21_0x120bfe(0x1ff),'description':a21_0x120bfe(0x1eb),'risk':a21_0x120bfe(0x1fe),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'name','type':a21_0x120bfe(0x1e9),'description':a21_0x120bfe(0x1ec),'required':!![]},{'name':a21_0x120bfe(0x1f4),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]}],'execute':execute};
1
+ const a21_0x4d0689=a21_0x1633;(function(_0x3566e2,_0x4ad33a){const _0x25c8e3=a21_0x1633,_0x2b7bf4=_0x3566e2();while(!![]){try{const _0x4c2b5e=-parseInt(_0x25c8e3(0x135))/0x1+-parseInt(_0x25c8e3(0x130))/0x2*(parseInt(_0x25c8e3(0x14b))/0x3)+parseInt(_0x25c8e3(0x12e))/0x4+-parseInt(_0x25c8e3(0x129))/0x5+-parseInt(_0x25c8e3(0x143))/0x6*(-parseInt(_0x25c8e3(0x147))/0x7)+-parseInt(_0x25c8e3(0x13a))/0x8+-parseInt(_0x25c8e3(0x12d))/0x9*(-parseInt(_0x25c8e3(0x134))/0xa);if(_0x4c2b5e===_0x4ad33a)break;else _0x2b7bf4['push'](_0x2b7bf4['shift']());}catch(_0x5e991e){_0x2b7bf4['push'](_0x2b7bf4['shift']());}}}(a21_0x315d,0x85a23));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a21_0x315d(){const _0x4a6b4d=['projectConfig','\x20Default\x20app\x20changed\x20to\x20\x22','App\x20profile\x20name\x20to\x20remove','Usage:\x20','boolean','6oBedcZ','defaultApp','validation','name','103971rIVisS','\x20config.','keys','apps','3144rPmdQe','global','5061580pMIDxh','Remove\x20an\x20app\x20from\x20config','trim','app','21136806tNwQSH','2768712UIRPjP','args','1082eGSuvl','\x20app\x20remove\x20<name>\x20[--global]','length','object','10PYmvcb','733078SYnCLW','\x22\x20not\x20found.','Use\x20global\x20config\x20scope','Missing\x20app\x20name.','project','1566720gYMrKn','remove','Removed\x20app\x20\x22','\x20Note:\x20app\x20\x22'];a21_0x315d=function(){return _0x4a6b4d;};return a21_0x315d();}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'./shared.js';async function validateArgs(_0x584409){const _0xa706aa=a21_0x1633,_0x5e365f=_0x584409[_0xa706aa(0x12f)][0x0]?.[_0xa706aa(0x12b)]();if(!_0x5e365f)throw CliErrors[_0xa706aa(0x145)](_0xa706aa(0x138),_0xa706aa(0x141)+CLI_BIN_NAME+_0xa706aa(0x131));}async function execute(_0x5bde00){const _0x2ea80d=a21_0x1633,_0x257840=_0x5bde00[_0x2ea80d(0x12f)][0x0]?.[_0x2ea80d(0x12b)]();if(!_0x257840)throw CliErrors[_0x2ea80d(0x145)](_0x2ea80d(0x138),'Usage:\x20'+CLI_BIN_NAME+_0x2ea80d(0x131));const _0x34895f=_0x5bde00['bool']('global'),{config:_0x59850d,layers:_0x3965af}=readRawConfigWithLayers(),_0x9da8fd=_0x59850d[_0x2ea80d(0x14a)]??{};if(!_0x9da8fd[_0x257840])throw CliErrors['validation']('App\x20\x22'+_0x257840+'\x22\x20not\x20found.');const _0x4654a4=_0x3965af['globalConfig'][_0x2ea80d(0x14a)]&&typeof _0x3965af['globalConfig'][_0x2ea80d(0x14a)]===_0x2ea80d(0x133)?_0x3965af['globalConfig'][_0x2ea80d(0x14a)]:{},_0x14dbb1=_0x3965af[_0x2ea80d(0x13e)][_0x2ea80d(0x14a)]&&typeof _0x3965af[_0x2ea80d(0x13e)][_0x2ea80d(0x14a)]==='object'?_0x3965af[_0x2ea80d(0x13e)][_0x2ea80d(0x14a)]:{},_0x1f3da8=appDefinedIn(_0x257840,_0x4654a4,_0x14dbb1),_0xd7b1f5=resolveAppScopeForWrite(_0x257840,_0x34895f,_0x3965af),_0x15701c={'global':_0xd7b1f5===_0x2ea80d(0x14c)},_0x3e175d=readConfig(_0x15701c),_0x230d1d=_0x3e175d[_0x2ea80d(0x14a)];if(!_0x230d1d||!_0x230d1d[_0x257840])throw CliErrors[_0x2ea80d(0x145)]('App\x20\x22'+_0x257840+_0x2ea80d(0x136));delete _0x230d1d[_0x257840];let _0x3b25b7='';if(_0x3e175d[_0x2ea80d(0x144)]===_0x257840){const _0x487a3e=Object['keys'](_0x230d1d);_0x3e175d['defaultApp']=_0x487a3e[_0x2ea80d(0x132)]>0x0?_0x487a3e[0x0]:undefined,_0x3e175d['defaultApp']?_0x3b25b7=_0x2ea80d(0x13f)+_0x3e175d[_0x2ea80d(0x144)]+'\x22.':delete _0x3e175d[_0x2ea80d(0x144)];}Object[_0x2ea80d(0x149)](_0x230d1d)['length']===0x0&&(delete _0x3e175d[_0x2ea80d(0x14a)],delete _0x3e175d[_0x2ea80d(0x144)]);writeConfig(_0x3e175d,_0x15701c);const _0x2c45fc=_0x1f3da8==='both'?_0x2ea80d(0x13d)+_0x257840+'\x22\x20still\x20defined\x20in\x20'+(_0xd7b1f5===_0x2ea80d(0x139)?'global':_0x2ea80d(0x139))+_0x2ea80d(0x148):'';return{'ok':!![],'message':_0x2ea80d(0x13c)+_0x257840+'\x22'+scopeLabel(_0x15701c)+'.'+_0x3b25b7+_0x2c45fc};}function a21_0x1633(_0x20b99c,_0x1abb6c){_0x20b99c=_0x20b99c-0x129;const _0x315d77=a21_0x315d();let _0x1633c1=_0x315d77[_0x20b99c];return _0x1633c1;}export const appRemoveDefinition={'service':a21_0x4d0689(0x12c),'command':a21_0x4d0689(0x13b),'description':a21_0x4d0689(0x12a),'risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x4d0689(0x146),'description':a21_0x4d0689(0x140),'required':!![]}],'flags':[{'name':a21_0x4d0689(0x14c),'type':a21_0x4d0689(0x142),'description':a21_0x4d0689(0x137),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x2975a2,_0x4adb0c){const _0x4e2a56=a22_0x1a4f,_0x139a71=_0x2975a2();while(!![]){try{const _0x72944f=-parseInt(_0x4e2a56(0xc4))/0x1*(parseInt(_0x4e2a56(0xd1))/0x2)+parseInt(_0x4e2a56(0xd5))/0x3*(parseInt(_0x4e2a56(0xcf))/0x4)+-parseInt(_0x4e2a56(0xd9))/0x5+parseInt(_0x4e2a56(0xd3))/0x6*(parseInt(_0x4e2a56(0xc8))/0x7)+-parseInt(_0x4e2a56(0xce))/0x8+parseInt(_0x4e2a56(0xd0))/0x9+parseInt(_0x4e2a56(0xd8))/0xa;if(_0x72944f===_0x4adb0c)break;else _0x139a71['push'](_0x139a71['shift']());}catch(_0x576a10){_0x139a71['push'](_0x139a71['shift']());}}}(a22_0x1fd6,0x680db));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a22_0x1fd6(){const _0x5cda54=['600245McdMBN','apiDir','defaultApp','349637hzXOJA','pageSize','cookie','apps','7GrmJuF','log','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','global','riskLevel','Migrated\x20existing\x20app\x20\x22','4558640wvRHui','90260UCbyxM','1159749RsyuAj','2heixVx','format','4291674vLJtmL','\x20(global)','69xxrpxv','appcode','app','1025840cINQCa'];a22_0x1fd6=function(){return _0x5cda54;};return a22_0x1fd6();}export function getConfigPath(_0x43c1cc={}){const _0x342b0a=a22_0x1a4f,_0x47f68e=_0x43c1cc[_0x342b0a(0xcb)]?'global':'project';return resolveWriteConfigPath(_0x47f68e);}export function readConfig(_0x4d012f={}){return readConfigFile(getConfigPath(_0x4d012f));}function a22_0x1a4f(_0x164e10,_0x5a3f11){_0x164e10=_0x164e10-0xc2;const _0x1fd6a7=a22_0x1fd6();let _0x1a4feb=_0x1fd6a7[_0x164e10];return _0x1a4feb;}export function writeConfig(_0xb22c0d,_0x136285={}){writeConfigFile(getConfigPath(_0x136285),_0xb22c0d);}export function scopeLabel(_0x3f5881){const _0x567b16=a22_0x1a4f;return _0x3f5881[_0x567b16(0xcb)]?_0x567b16(0xd4):'';}export function migrateLegacySingleApp(_0x27bce9,_0x2f606e){const _0x2d5e5d=a22_0x1a4f,_0x62ecdd=_0x27bce9[_0x2d5e5d(0xd6)]||_0x27bce9[_0x2d5e5d(0xd7)];if(!_0x62ecdd)return;const _0x2e7a4d=String(_0x62ecdd);if(_0x2e7a4d===_0x2f606e)return;const _0x6bf56c=['env',_0x2d5e5d(0xc2),_0x2d5e5d(0xc6),'accessKey',_0x2d5e5d(0xd2),_0x2d5e5d(0xc5),_0x2d5e5d(0xcc),'locale'],_0x343d3f={'appcode':_0x62ecdd};for(const _0x5a92a0 of _0x6bf56c){if(_0x27bce9[_0x5a92a0]!=null)_0x343d3f[_0x5a92a0]=_0x27bce9[_0x5a92a0];}_0x27bce9[_0x2d5e5d(0xc7)][_0x2e7a4d]=_0x343d3f,_0x27bce9[_0x2d5e5d(0xc3)]=_0x2e7a4d,delete _0x27bce9[_0x2d5e5d(0xd6)],delete _0x27bce9[_0x2d5e5d(0xd7)],console[_0x2d5e5d(0xc9)](_0x2d5e5d(0xcd)+_0x2e7a4d+_0x2d5e5d(0xca));}
1
+ (function(_0x568b68,_0x480820){const _0x1095e5=a22_0x2924,_0x46a89a=_0x568b68();while(!![]){try{const _0x1dcbe9=parseInt(_0x1095e5(0x1fd))/0x1*(-parseInt(_0x1095e5(0x1ef))/0x2)+parseInt(_0x1095e5(0x1f8))/0x3*(-parseInt(_0x1095e5(0x1f1))/0x4)+parseInt(_0x1095e5(0x1fb))/0x5+parseInt(_0x1095e5(0x205))/0x6*(parseInt(_0x1095e5(0x1ec))/0x7)+-parseInt(_0x1095e5(0x1ff))/0x8*(parseInt(_0x1095e5(0x1f5))/0x9)+parseInt(_0x1095e5(0x200))/0xa+parseInt(_0x1095e5(0x20d))/0xb*(parseInt(_0x1095e5(0x1f7))/0xc);if(_0x1dcbe9===_0x480820)break;else _0x46a89a['push'](_0x46a89a['shift']());}catch(_0x2282c2){_0x46a89a['push'](_0x46a89a['shift']());}}}(a22_0x3d44,0x6fa02));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a22_0x2924(_0x213be9,_0x16730e){_0x213be9=_0x213be9-0x1ea;const _0x3d4442=a22_0x3d44();let _0x292467=_0x3d4442[_0x213be9];return _0x292467;}export function resolveAppScopeForWrite(_0x179b70,_0x3cfd06,_0x4f0999){const _0x2c31ce=a22_0x2924;if(_0x3cfd06)return _0x2c31ce(0x1f3);const _0x7c0b4e=_0x4f0999[_0x2c31ce(0x1fc)][_0x2c31ce(0x1ed)]&&typeof _0x4f0999[_0x2c31ce(0x1fc)][_0x2c31ce(0x1ed)]===_0x2c31ce(0x1ea)?_0x4f0999[_0x2c31ce(0x1fc)][_0x2c31ce(0x1ed)]:{},_0x4f6827=_0x4f0999[_0x2c31ce(0x20b)][_0x2c31ce(0x1ed)]&&typeof _0x4f0999[_0x2c31ce(0x20b)][_0x2c31ce(0x1ed)]===_0x2c31ce(0x1ea)?_0x4f0999[_0x2c31ce(0x20b)][_0x2c31ce(0x1ed)]:{};if(Object['prototype'][_0x2c31ce(0x203)]['call'](_0x7c0b4e,_0x179b70))return _0x2c31ce(0x204);if(Object[_0x2c31ce(0x201)][_0x2c31ce(0x203)][_0x2c31ce(0x202)](_0x4f6827,_0x179b70))return'global';return _0x2c31ce(0x204);}export function appDefinedIn(_0x2c107b,_0xe420e3,_0x352f41){const _0x1389ac=a22_0x2924,_0x2ff079=Object['prototype']['hasOwnProperty'][_0x1389ac(0x202)](_0xe420e3,_0x2c107b),_0x5c208a=Object['prototype'][_0x1389ac(0x203)]['call'](_0x352f41,_0x2c107b);if(_0x2ff079&&_0x5c208a)return _0x1389ac(0x20a);if(_0x5c208a)return'project';return _0x1389ac(0x1f3);}export function resolveDefaultAppSource(_0x1df96e){const _0x48e512=a22_0x2924,_0x56ead0=_0x1df96e[_0x48e512(0x1fc)][_0x48e512(0x1ed)]&&typeof _0x1df96e[_0x48e512(0x1fc)][_0x48e512(0x1ed)]===_0x48e512(0x1ea)?_0x1df96e[_0x48e512(0x1fc)]['apps']:{};if(_0x48e512(0x1ee)in _0x1df96e[_0x48e512(0x1fc)])return _0x48e512(0x204);if(Object[_0x48e512(0x20c)](_0x56ead0)[_0x48e512(0x1eb)]>0x0)return _0x48e512(0x204);if(_0x1df96e[_0x48e512(0x20b)]['defaultApp'])return _0x48e512(0x1f3);return null;}export function getConfigPath(_0x4490e7={}){const _0x425ae7=a22_0x2924,_0x2a411b=_0x4490e7[_0x425ae7(0x1f3)]?_0x425ae7(0x1f3):'project';return resolveWriteConfigPath(_0x2a411b);}function a22_0x3d44(){const _0x1b8c82=['hasOwnProperty','project','174FhoXfS','apiDir','riskLevel','env','appcode','both','globalConfig','keys','55bwKCpa','object','length','126147pDdouA','apps','defaultApp','806248ivGTZy','locale','976092FXlhPF','accessKey','global','format','103311JHXgkr','cookie','3341688UAfXtO','3eoZGIB','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','\x20(global)','1486310wrUJfx','projectConfig','2UnZRLa','app','584YPbLLD','1332150eBpxMY','prototype','call'];a22_0x3d44=function(){return _0x1b8c82;};return a22_0x3d44();}export function readConfig(_0x51c5a5={}){return readConfigFile(getConfigPath(_0x51c5a5));}export function writeConfig(_0x2386c1,_0x4a124d={}){writeConfigFile(getConfigPath(_0x4a124d),_0x2386c1);}export function scopeLabel(_0x158300){const _0x2887cf=a22_0x2924;return _0x158300['global']?_0x2887cf(0x1fa):'';}export function migrateLegacySingleApp(_0x511750,_0x17ccde){const _0x4de2bf=a22_0x2924,_0x54a1f1=_0x511750[_0x4de2bf(0x209)]||_0x511750[_0x4de2bf(0x1fe)];if(!_0x54a1f1)return;const _0x2b4366=String(_0x54a1f1);if(_0x2b4366===_0x17ccde)return;const _0x443046=[_0x4de2bf(0x208),_0x4de2bf(0x206),_0x4de2bf(0x1f6),_0x4de2bf(0x1f2),_0x4de2bf(0x1f4),'pageSize',_0x4de2bf(0x207),_0x4de2bf(0x1f0)],_0x5969e4={'appcode':_0x54a1f1};for(const _0x2fd863 of _0x443046){if(_0x511750[_0x2fd863]!=null)_0x5969e4[_0x2fd863]=_0x511750[_0x2fd863];}_0x511750[_0x4de2bf(0x1ed)][_0x2b4366]=_0x5969e4,_0x511750[_0x4de2bf(0x1ee)]=_0x2b4366,delete _0x511750[_0x4de2bf(0x209)],delete _0x511750[_0x4de2bf(0x1fe)],console['log']('Migrated\x20existing\x20app\x20\x22'+_0x2b4366+_0x4de2bf(0x1f9));}
@@ -1 +1 @@
1
- const a23_0x4fe6d9=a23_0x20c6;(function(_0x4a2d9a,_0xdef073){const _0x4bf566=a23_0x20c6,_0x681f3d=_0x4a2d9a();while(!![]){try{const _0x40837e=-parseInt(_0x4bf566(0x1bc))/0x1+parseInt(_0x4bf566(0x1b7))/0x2*(-parseInt(_0x4bf566(0x1ce))/0x3)+-parseInt(_0x4bf566(0x1cd))/0x4+parseInt(_0x4bf566(0x1ca))/0x5+parseInt(_0x4bf566(0x1c4))/0x6*(-parseInt(_0x4bf566(0x1b6))/0x7)+parseInt(_0x4bf566(0x1c8))/0x8+parseInt(_0x4bf566(0x1cc))/0x9;if(_0x40837e===_0xdef073)break;else _0x681f3d['push'](_0x681f3d['shift']());}catch(_0x5228fe){_0x681f3d['push'](_0x681f3d['shift']());}}}(a23_0x19d6,0x21c3c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readConfig,writeConfig,scopeLabel}from'./shared.js';function a23_0x20c6(_0x12117a,_0x4bbe46){_0x12117a=_0x12117a-0x1b0;const _0x19d62e=a23_0x19d6();let _0x20c688=_0x19d62e[_0x12117a];return _0x20c688;}async function execute(_0x1478c3){const _0xdb75a9=a23_0x20c6,_0x407608=_0x1478c3[_0xdb75a9(0x1be)](_0xdb75a9(0x1ba));if(!_0x407608)throw CliErrors[_0xdb75a9(0x1c1)](_0xdb75a9(0x1c5),_0xdb75a9(0x1b4)+CLI_BIN_NAME+_0xdb75a9(0x1b9));const _0x4331c9={'global':_0x1478c3[_0xdb75a9(0x1c2)](_0xdb75a9(0x1d0))},_0x506bc2=readConfig(_0x4331c9),_0x4ced0f=_0x506bc2[_0xdb75a9(0x1cf)]??{};if(!_0x4ced0f[_0x407608]){const _0x40d806=Object[_0xdb75a9(0x1b0)](_0x4ced0f),_0x5c0a67=_0x40d806['length']===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20--name\x20'+_0x407608+_0xdb75a9(0x1c0):_0xdb75a9(0x1cb)+_0x40d806[_0xdb75a9(0x1bb)](',\x20');throw CliErrors[_0xdb75a9(0x1c1)](_0xdb75a9(0x1bf)+_0x407608+_0xdb75a9(0x1b1),_0x5c0a67);}return _0x506bc2[_0xdb75a9(0x1b3)]=_0x407608,writeConfig(_0x506bc2,_0x4331c9),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x407608+_0xdb75a9(0x1bd)+_0x4ced0f[_0x407608]['appcode']+')'+scopeLabel(_0x4331c9)};}export const appUseDefinition={'service':a23_0x4fe6d9(0x1b2),'command':a23_0x4fe6d9(0x1b5),'description':a23_0x4fe6d9(0x1b8),'risk':a23_0x4fe6d9(0x1c7),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a23_0x4fe6d9(0x1ba),'type':a23_0x4fe6d9(0x1c6),'description':'App\x20name\x20to\x20activate','required':!![]},{'name':a23_0x4fe6d9(0x1d0),'type':a23_0x4fe6d9(0x1c9),'description':a23_0x4fe6d9(0x1c3),'default':![]}],'execute':execute};function a23_0x19d6(){const _0x527eb5=['608296OwVDJU','141nrHxAK','apps','global','keys','\x22\x20not\x20found.','app','defaultApp','Usage:\x20','use','7JpVOHu','1894Egnhtw','Switch\x20the\x20default\x20app','\x20app\x20use\x20--name\x20<name>','name','join','175352opxnvg','\x22\x20(appcode:\x20','str','App\x20\x22','\x20--appcode\x20<code>`\x20first.','validation','bool','Use\x20global\x20config\x20scope','960456qdxRUd','Missing\x20app\x20name.','string','write','422440QXvEhK','boolean','1014380ohSzwP','Available:\x20','3731670lFYAFE'];a23_0x19d6=function(){return _0x527eb5;};return a23_0x19d6();}
1
+ const a23_0x239e64=a23_0x53b2;(function(_0x45f31f,_0x1a9c00){const _0x30df98=a23_0x53b2,_0x137aa1=_0x45f31f();while(!![]){try{const _0x15fe44=-parseInt(_0x30df98(0x1e8))/0x1+parseInt(_0x30df98(0x1e3))/0x2*(parseInt(_0x30df98(0x1f4))/0x3)+-parseInt(_0x30df98(0x1fa))/0x4*(-parseInt(_0x30df98(0x1de))/0x5)+parseInt(_0x30df98(0x1ee))/0x6+parseInt(_0x30df98(0x1ef))/0x7*(parseInt(_0x30df98(0x1e2))/0x8)+parseInt(_0x30df98(0x1e7))/0x9*(parseInt(_0x30df98(0x1ea))/0xa)+parseInt(_0x30df98(0x1f6))/0xb*(-parseInt(_0x30df98(0x1e9))/0xc);if(_0x15fe44===_0x1a9c00)break;else _0x137aa1['push'](_0x137aa1['shift']());}catch(_0x1397c7){_0x137aa1['push'](_0x137aa1['shift']());}}}(a23_0x5a4a,0x621a8));import{CliErrors}from'../../errors.js';function a23_0x5a4a(){const _0xa5cad6=['Usage:\x20','91398FFJXfV','global','642455SWeoaY','length','\x20app\x20use\x20<name>\x20[--global]','Missing\x20app\x20name.','772xutbYJ','join','Use\x20`','bool','Switch\x20the\x20default\x20app','App\x20\x22','name','apps','9185leeNPF','\x22\x20not\x20found.','appcode','Use\x20global\x20config\x20scope','967912QXZCRo','42ylvDQt','defaultApp','validation','app','171pusgBV','651393gTapAT','132RztQLB','21130fhDxHt','args','boolean','\x20--appcode\x20<code>`\x20first.','1789434ArWuaL','21AuBCeL','\x22\x20(appcode:\x20','Default\x20app\x20set\x20to\x20\x22','trim'];a23_0x5a4a=function(){return _0xa5cad6;};return a23_0x5a4a();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'./shared.js';async function validateArgs(_0x224c74){const _0x2e6425=a23_0x53b2,_0x5c053f=_0x224c74[_0x2e6425(0x1eb)][0x0]?.[_0x2e6425(0x1f2)]();if(!_0x5c053f)throw CliErrors['validation'](_0x2e6425(0x1f9),_0x2e6425(0x1f3)+CLI_BIN_NAME+_0x2e6425(0x1f8));}async function execute(_0x3de035){const _0x3f3ffa=a23_0x53b2,_0x494701=_0x3de035[_0x3f3ffa(0x1eb)][0x0]?.[_0x3f3ffa(0x1f2)]();if(!_0x494701)throw CliErrors[_0x3f3ffa(0x1e5)](_0x3f3ffa(0x1f9),_0x3f3ffa(0x1f3)+CLI_BIN_NAME+_0x3f3ffa(0x1f8));const _0x41dd81=_0x3de035[_0x3f3ffa(0x1fd)](_0x3f3ffa(0x1f5)),{config:_0x1b0a21,layers:_0x5f13ba}=readRawConfigWithLayers(),_0x2a7e1e=_0x1b0a21[_0x3f3ffa(0x201)]??{};if(!_0x2a7e1e[_0x494701]){const _0x15e1da=Object['keys'](_0x2a7e1e),_0x31d3e4=_0x15e1da[_0x3f3ffa(0x1f7)]===0x0?_0x3f3ffa(0x1fc)+CLI_BIN_NAME+'\x20app\x20add\x20'+_0x494701+_0x3f3ffa(0x1ed):'Available:\x20'+_0x15e1da[_0x3f3ffa(0x1fb)](',\x20');throw CliErrors[_0x3f3ffa(0x1e5)](_0x3f3ffa(0x1ff)+_0x494701+_0x3f3ffa(0x1df),_0x31d3e4);}const _0x23ce62=resolveAppScopeForWrite(_0x494701,_0x41dd81,_0x5f13ba),_0x185d1c={'global':_0x23ce62===_0x3f3ffa(0x1f5)},_0x5da4b4=readConfig(_0x185d1c);return _0x5da4b4[_0x3f3ffa(0x1e4)]=_0x494701,writeConfig(_0x5da4b4,_0x185d1c),{'ok':!![],'message':_0x3f3ffa(0x1f1)+_0x494701+_0x3f3ffa(0x1f0)+_0x2a7e1e[_0x494701][_0x3f3ffa(0x1e0)]+')'+scopeLabel(_0x185d1c)};}function a23_0x53b2(_0x21ec34,_0x2c6638){_0x21ec34=_0x21ec34-0x1de;const _0x5a4a1b=a23_0x5a4a();let _0x53b231=_0x5a4a1b[_0x21ec34];return _0x53b231;}export const appUseDefinition={'service':a23_0x239e64(0x1e6),'command':'use','description':a23_0x239e64(0x1fe),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x239e64(0x200),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':a23_0x239e64(0x1f5),'type':a23_0x239e64(0x1ec),'description':a23_0x239e64(0x1e1),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- const a24_0x41a90a=a24_0x54c3;(function(_0x54b6e6,_0x28257b){const _0x515ea6=a24_0x54c3,_0x49be02=_0x54b6e6();while(!![]){try{const _0x3da910=-parseInt(_0x515ea6(0x9b))/0x1+parseInt(_0x515ea6(0xa7))/0x2+parseInt(_0x515ea6(0xa2))/0x3+-parseInt(_0x515ea6(0xa3))/0x4+-parseInt(_0x515ea6(0x9d))/0x5+parseInt(_0x515ea6(0xa5))/0x6+parseInt(_0x515ea6(0xa1))/0x7*(-parseInt(_0x515ea6(0x9c))/0x8);if(_0x3da910===_0x28257b)break;else _0x49be02['push'](_0x49be02['shift']());}catch(_0x55b232){_0x49be02['push'](_0x49be02['shift']());}}}(a24_0x49fb,0x5b691));function a24_0x49fb(){const _0x2a9a77=['15169KevKAU','1244778dBDsJZ','2252980FmzYXl','login','3883026viKTMG','✓\x20Logged\x20out','1396276rKXXen','logout','write','../../auth/auth-server-ui.js','auth','Clear\x20login\x20session','232299IXXZzi','2024aTErdp','210115PmbJzd','Login\x20via\x20browser','log','read'];a24_0x49fb=function(){return _0x2a9a77;};return a24_0x49fb();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a24_0x54c3(_0x3f0789,_0x2677d5){_0x3f0789=_0x3f0789-0x99;const _0x49fbb8=a24_0x49fb();let _0x54c3ec=_0x49fbb8[_0x3f0789];return _0x54c3ec;}export const authDefinitions=[{'service':a24_0x41a90a(0x99),'command':a24_0x41a90a(0xa4),'description':a24_0x41a90a(0x9e),'risk':a24_0x41a90a(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x13f537){const _0x1b3b31=a24_0x41a90a,{runAuthServer:_0x12b101}=await import(_0x1b3b31(0xaa));return await _0x12b101(),{'ok':!![]};}},{'service':'auth','command':a24_0x41a90a(0xa8),'description':a24_0x41a90a(0x9a),'risk':a24_0x41a90a(0xa9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x29f5f7){const _0x74759f=a24_0x41a90a;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x74759f(0x9f)](_0x74759f(0xa6))):console[_0x74759f(0x9f)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
1
+ function a24_0xce23(){const _0x1d8823=['✓\x20Logged\x20out','log','30540HtGLAm','5584072LSIBhU','../../auth/auth-server-ui.js','3076632ZvEQAW','9713403fUvMqX','1553zUtWyb','252190qHLWme','583rTNStR','1218kzGRng','5rpXyex','login','write','!\x20Not\x20logged\x20in','32067zgjWUw','1906gtRIoY'];a24_0xce23=function(){return _0x1d8823;};return a24_0xce23();}const a24_0x592572=a24_0x2eb9;function a24_0x2eb9(_0x179f84,_0x2106b8){_0x179f84=_0x179f84-0x1ee;const _0xce23df=a24_0xce23();let _0x2eb9f3=_0xce23df[_0x179f84];return _0x2eb9f3;}(function(_0x12c303,_0x116e02){const _0x442eaf=a24_0x2eb9,_0x3d65a7=_0x12c303();while(!![]){try{const _0x4c7c50=parseInt(_0x442eaf(0x1fa))/0x1*(parseInt(_0x442eaf(0x1f2))/0x2)+parseInt(_0x442eaf(0x1f5))/0x3+parseInt(_0x442eaf(0x1f8))/0x4*(parseInt(_0x442eaf(0x1fe))/0x5)+-parseInt(_0x442eaf(0x1fd))/0x6*(parseInt(_0x442eaf(0x1f1))/0x7)+-parseInt(_0x442eaf(0x1f6))/0x8+-parseInt(_0x442eaf(0x1f9))/0x9+-parseInt(_0x442eaf(0x1fb))/0xa*(-parseInt(_0x442eaf(0x1fc))/0xb);if(_0x4c7c50===_0x116e02)break;else _0x3d65a7['push'](_0x3d65a7['shift']());}catch(_0x46e650){_0x3d65a7['push'](_0x3d65a7['shift']());}}}(a24_0xce23,0xd8f9f));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a24_0x592572(0x1ee),'description':'Login\x20via\x20browser','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x61be92){const _0x29881e=a24_0x592572,{runAuthServer:_0x2adf66}=await import(_0x29881e(0x1f7));return await _0x2adf66(),{'ok':!![]};}},{'service':'auth','command':'logout','description':'Clear\x20login\x20session','risk':a24_0x592572(0x1ef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x28f5eb){const _0x5eea47=a24_0x592572;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5eea47(0x1f4)](_0x5eea47(0x1f3))):console['log'](_0x5eea47(0x1f0)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a25_0x4b64(){const _0x4a2280=['split','No\x20lock\x20entry\x20found\x20for\x20\x22','2184889CosIml','projectRoot','toISOString','Deleted\x20','string','str','trashDir','keys','lockFilePath','/api/management/library/scripts/delete','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','appCode','high-risk-write','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','11NygwBo','5rIVpAl','\x20(local\x20file\x20moved\x20to\x20trash)','63396DoPieV','join','5450484tkfsAF','140NNiRde','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','lastSync','scriptsRootDir','20778AnjxTp','delete','validation','BFF\x20lock\x20file\x20not\x20found.','remoteId','filter','target','functions','8zsiFGp','258167jujEZn','length','996TgrDXK','3715770sLMXFz','8944983gneRsE','POST','30hDCPnl','\x20\x20-\x20','Function\x20not\x20found:\x20','replace','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','find'];a25_0x4b64=function(){return _0x4a2280;};return a25_0x4b64();}const a25_0x40235e=a25_0x1b15;(function(_0x615c3f,_0x32a357){const _0x247d34=a25_0x1b15,_0x230362=_0x615c3f();while(!![]){try{const _0x12b49c=parseInt(_0x247d34(0x16c))/0x1*(-parseInt(_0x247d34(0x14b))/0x2)+-parseInt(_0x247d34(0x165))/0x3*(parseInt(_0x247d34(0x168))/0x4)+parseInt(_0x247d34(0x163))/0x5*(parseInt(_0x247d34(0x167))/0x6)+parseInt(_0x247d34(0x154))/0x7*(-parseInt(_0x247d34(0x174))/0x8)+-parseInt(_0x247d34(0x149))/0x9+parseInt(_0x247d34(0x148))/0xa*(parseInt(_0x247d34(0x162))/0xb)+-parseInt(_0x247d34(0x147))/0xc*(-parseInt(_0x247d34(0x145))/0xd);if(_0x12b49c===_0x32a357)break;else _0x230362['push'](_0x230362['shift']());}catch(_0x59f1d6){_0x230362['push'](_0x230362['shift']());}}}(a25_0x4b64,0x8b668));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a25_0x1b15(_0x2462b8,_0x409b77){_0x2462b8=_0x2462b8-0x145;const _0x4b64b9=a25_0x4b64();let _0x1b15cb=_0x4b64b9[_0x2462b8];return _0x1b15cb;}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':'bff','command':a25_0x40235e(0x16d),'description':a25_0x40235e(0x161),'risk':a25_0x40235e(0x160),'flags':[{'name':'target','type':a25_0x40235e(0x158),'required':!![],'description':a25_0x40235e(0x150)}],async 'validate'(_0x8ca3a1){const _0x120ce9=a25_0x40235e,_0xf78b58=loadBffProjectConfig(_0x8ca3a1[_0x120ce9(0x15f)]),_0x3c2d1c=await readBffLockFile(_0xf78b58['lockFilePath']);if(!_0x3c2d1c)throw CliErrors['validation'](_0x120ce9(0x14f));},async 'dryRun'(_0x33bc7b){const _0x2e5603=a25_0x40235e,_0x2f04d6=loadBffProjectConfig(_0x33bc7b[_0x2e5603(0x15f)]),_0x41e5f1=await readBffLockFile(_0x2f04d6[_0x2e5603(0x15c)]);if(!_0x41e5f1)throw CliErrors[_0x2e5603(0x16e)](_0x2e5603(0x16f));const {appLock:_0x507d0e}=ensureLockScope(_0x41e5f1,_0x33bc7b['appCode'],_0x2f04d6['scriptsRoot'],_0x2e5603(0x16d)),_0x6ef69=_0x33bc7b[_0x2e5603(0x159)](_0x2e5603(0x172)),_0x47b068=Object['keys'](_0x507d0e[_0x2e5603(0x173)]),_0x153041=resolveDeleteTarget(_0x6ef69,_0x47b068),_0x13c4ad=_0x507d0e['functions'][_0x153041];if(!_0x13c4ad)throw CliErrors[_0x2e5603(0x16e)](_0x2e5603(0x153)+_0x153041+'\x22.');const _0x144386=resolveLocalFilePathFromLockKey(_0x2f04d6,_0x153041),_0x2f9dba=relative(_0x2f04d6[_0x2e5603(0x155)],_0x144386),_0x17a898=join(_0x2f04d6[_0x2e5603(0x15a)],'<timestamp>',_0x2f9dba);return{'method':_0x2e5603(0x14a),'url':_0x2e5603(0x15d),'body':{'appCode':_0x33bc7b[_0x2e5603(0x15f)],'target':_0x153041,'remoteId':_0x13c4ad['remoteId'],'localFilePath':_0x144386,'trashedPath':_0x17a898},'description':'Would\x20delete\x20'+_0x153041+_0x2e5603(0x15e)};},async 'execute'(_0x3e9a73){const _0x383942=a25_0x40235e,_0x477904=loadBffProjectConfig(_0x3e9a73[_0x383942(0x15f)]),_0x4adfc4=await readBffLockFile(_0x477904['lockFilePath']);if(!_0x4adfc4)throw CliErrors[_0x383942(0x16e)](_0x383942(0x16f));const {lockData:_0x3e21ed,appLock:_0x12cc41}=ensureLockScope(_0x4adfc4,_0x3e9a73['appCode'],_0x477904['scriptsRoot'],_0x383942(0x16d)),_0x594a27=_0x3e9a73[_0x383942(0x159)]('target'),_0x2b979f=Object[_0x383942(0x15b)](_0x12cc41[_0x383942(0x173)]),_0xab4b9=resolveDeleteTarget(_0x594a27,_0x2b979f),_0x455e07=_0x12cc41[_0x383942(0x173)][_0xab4b9];if(!_0x455e07)throw CliErrors[_0x383942(0x16e)](_0x383942(0x153)+_0xab4b9+'\x22.');await deleteBffScript(_0x455e07[_0x383942(0x170)]),delete _0x12cc41['functions'][_0xab4b9],_0x12cc41[_0x383942(0x16a)]=new Date()[_0x383942(0x156)](),await writeBffLockFile(_0x477904[_0x383942(0x15c)],_0x3e21ed);const _0x1ea145=resolveLocalFilePathFromLockKey(_0x477904,_0xab4b9);let _0x1d1962;await fileExists(_0x1ea145)&&(_0x1d1962=await moveToTrash(_0x477904[_0x383942(0x155)],_0x477904[_0x383942(0x15a)],_0x1ea145),await cleanupEmptyDirectories(dirname(_0x1ea145),_0x477904[_0x383942(0x16b)]));const _0x3a2bcc={'deleted':_0xab4b9,'remoteId':_0x455e07[_0x383942(0x170)]};if(_0x1d1962)_0x3a2bcc['trashedTo']=_0x1d1962;return{'ok':!![],'data':_0x3a2bcc,'message':_0x383942(0x157)+_0xab4b9+(_0x1d1962?_0x383942(0x164):'')};}};function resolveDeleteTarget(_0x528305,_0x302b67){const _0x47fcbf=a25_0x40235e;if(_0x528305['includes']('/')){const _0x45b2dd=_0x302b67[_0x47fcbf(0x151)](_0x4aab32=>_0x4aab32===_0x528305);if(!_0x45b2dd)throw CliErrors[_0x47fcbf(0x16e)](_0x47fcbf(0x14d)+_0x528305);return _0x45b2dd;}const _0x301d0f=_0x302b67[_0x47fcbf(0x171)](_0x13a28=>_0x13a28[_0x47fcbf(0x152)]('/')['at'](-0x1)===_0x528305);if(_0x301d0f[_0x47fcbf(0x146)]===0x0)throw CliErrors['validation'](_0x47fcbf(0x14d)+_0x528305);if(_0x301d0f['length']>0x1)throw CliErrors['validation']('Multiple\x20functions\x20match\x20\x22'+_0x528305+_0x47fcbf(0x169)+_0x301d0f['map'](_0x3361f5=>_0x47fcbf(0x14c)+_0x3361f5)[_0x47fcbf(0x166)]('\x0a'));return _0x301d0f[0x0];}async function moveToTrash(_0x38dd1d,_0x176ceb,_0x2196b5){const _0x697367=a25_0x40235e,_0xcaf7be=new Date()['toISOString']()[_0x697367(0x14e)](/[:.]/g,'-'),_0x48ab5a=relative(_0x38dd1d,_0x2196b5),_0x4a16b7=join(_0x176ceb,_0xcaf7be,_0x48ab5a);return await mkdir(dirname(_0x4a16b7),{'recursive':!![]}),await rename(_0x2196b5,_0x4a16b7),_0x4a16b7;}async function cleanupEmptyDirectories(_0x57585e,_0x579a14){const _0x37c1f0=a25_0x40235e;let _0x504a6b=resolve(_0x57585e);const _0x5dd984=resolve(_0x579a14);while(_0x504a6b['startsWith'](''+_0x5dd984+sep)||_0x504a6b===_0x5dd984){if(_0x504a6b===_0x5dd984)return;try{const _0x4ee538=await readdir(_0x504a6b);if(_0x4ee538[_0x37c1f0(0x146)]>0x0)return;await rmdir(_0x504a6b);}catch{return;}_0x504a6b=dirname(_0x504a6b);}}
1
+ const a25_0xdd4b87=a25_0x4e0f;(function(_0x11fff9,_0x5eee7b){const _0x461b89=a25_0x4e0f,_0x44be59=_0x11fff9();while(!![]){try{const _0x1c2199=-parseInt(_0x461b89(0xca))/0x1*(parseInt(_0x461b89(0xb8))/0x2)+-parseInt(_0x461b89(0xa8))/0x3*(-parseInt(_0x461b89(0xc9))/0x4)+-parseInt(_0x461b89(0xad))/0x5*(parseInt(_0x461b89(0xb1))/0x6)+parseInt(_0x461b89(0xbf))/0x7*(-parseInt(_0x461b89(0xa9))/0x8)+parseInt(_0x461b89(0x9c))/0x9+-parseInt(_0x461b89(0x9b))/0xa*(-parseInt(_0x461b89(0xb6))/0xb)+parseInt(_0x461b89(0xaf))/0xc;if(_0x1c2199===_0x5eee7b)break;else _0x44be59['push'](_0x44be59['shift']());}catch(_0x2eb8b4){_0x44be59['push'](_0x44be59['shift']());}}}(a25_0x4823,0xb7d62));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a25_0x4e0f(_0x586679,_0x2613b7){_0x586679=_0x586679-0x9b;const _0x482320=a25_0x4823();let _0x4e0f86=_0x482320[_0x586679];return _0x4e0f86;}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a25_0x4823(){const _0x5879b9=['lockFilePath','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','42581fUKJEq','lastSync','trashedTo','Function\x20not\x20found:\x20','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','scriptsRoot','POST','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','BFF\x20lock\x20file\x20not\x20found.','functions','339632qZlKlL','4483DJPlcK','split','\x20\x20-\x20','20sIDhuq','5001057yOflto','delete','<timestamp>','filter','toISOString','string','Would\x20delete\x20','remoteId','appCode','scriptsRootDir','map','Deleted\x20','45CrPvAy','1016xMKhPl','validation','\x20(local\x20file\x20moved\x20to\x20trash)','/api/management/library/scripts/delete','70tKCyon','No\x20lock\x20entry\x20found\x20for\x20\x22','18782640oKWDBK','replace','517146vSszfL','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','bff','str','high-risk-write','746185CQHkUC','target','356piaDKG','trashDir','length','projectRoot','find'];a25_0x4823=function(){return _0x5879b9;};return a25_0x4823();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0xdd4b87(0xb3),'command':a25_0xdd4b87(0x9d),'description':a25_0xdd4b87(0xc3),'risk':a25_0xdd4b87(0xb5),'flags':[{'name':a25_0xdd4b87(0xb7),'type':a25_0xdd4b87(0xa1),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x3b930e){const _0x2cd9c6=a25_0xdd4b87,_0x32372c=loadBffProjectConfig(_0x3b930e[_0x2cd9c6(0xa4)]),_0x2b25ad=await readBffLockFile(_0x32372c['lockFilePath']);if(!_0x2b25ad)throw CliErrors[_0x2cd9c6(0xaa)](_0x2cd9c6(0xb2));},async 'dryRun'(_0x5a2bae){const _0x4c727d=a25_0xdd4b87,_0x1c52de=loadBffProjectConfig(_0x5a2bae['appCode']),_0x99d7cc=await readBffLockFile(_0x1c52de[_0x4c727d(0xbd)]);if(!_0x99d7cc)throw CliErrors[_0x4c727d(0xaa)]('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x130563}=ensureLockScope(_0x99d7cc,_0x5a2bae['appCode'],_0x1c52de[_0x4c727d(0xc4)],_0x4c727d(0x9d)),_0x3747bb=_0x5a2bae['str'](_0x4c727d(0xb7)),_0x561ff8=Object['keys'](_0x130563[_0x4c727d(0xc8)]),_0x4a278a=resolveDeleteTarget(_0x3747bb,_0x561ff8),_0x115f6b=_0x130563[_0x4c727d(0xc8)][_0x4a278a];if(!_0x115f6b)throw CliErrors[_0x4c727d(0xaa)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4a278a+'\x22.');const _0x1980a8=resolveLocalFilePathFromLockKey(_0x1c52de,_0x4a278a),_0x4c6eb6=relative(_0x1c52de[_0x4c727d(0xbb)],_0x1980a8),_0xd34e6d=join(_0x1c52de[_0x4c727d(0xb9)],_0x4c727d(0x9e),_0x4c6eb6);return{'method':_0x4c727d(0xc5),'url':_0x4c727d(0xac),'body':{'appCode':_0x5a2bae[_0x4c727d(0xa4)],'target':_0x4a278a,'remoteId':_0x115f6b[_0x4c727d(0xa3)],'localFilePath':_0x1980a8,'trashedPath':_0xd34e6d},'description':_0x4c727d(0xa2)+_0x4a278a+_0x4c727d(0xc6)};},async 'execute'(_0x201752){const _0x230981=a25_0xdd4b87,_0x3fc93b=loadBffProjectConfig(_0x201752[_0x230981(0xa4)]),_0x27d1aa=await readBffLockFile(_0x3fc93b[_0x230981(0xbd)]);if(!_0x27d1aa)throw CliErrors['validation'](_0x230981(0xc7));const {lockData:_0x5ab009,appLock:_0x218af3}=ensureLockScope(_0x27d1aa,_0x201752['appCode'],_0x3fc93b['scriptsRoot'],_0x230981(0x9d)),_0x1aa66e=_0x201752[_0x230981(0xb4)](_0x230981(0xb7)),_0x4076d6=Object['keys'](_0x218af3[_0x230981(0xc8)]),_0x521fb9=resolveDeleteTarget(_0x1aa66e,_0x4076d6),_0xf98b47=_0x218af3[_0x230981(0xc8)][_0x521fb9];if(!_0xf98b47)throw CliErrors[_0x230981(0xaa)](_0x230981(0xae)+_0x521fb9+'\x22.');await deleteBffScript(_0xf98b47[_0x230981(0xa3)]),delete _0x218af3[_0x230981(0xc8)][_0x521fb9],_0x218af3[_0x230981(0xc0)]=new Date()[_0x230981(0xa0)](),await writeBffLockFile(_0x3fc93b['lockFilePath'],_0x5ab009);const _0x33d944=resolveLocalFilePathFromLockKey(_0x3fc93b,_0x521fb9);let _0x555cf4;await fileExists(_0x33d944)&&(_0x555cf4=await moveToTrash(_0x3fc93b[_0x230981(0xbb)],_0x3fc93b[_0x230981(0xb9)],_0x33d944),await cleanupEmptyDirectories(dirname(_0x33d944),_0x3fc93b[_0x230981(0xa5)]));const _0x381f4a={'deleted':_0x521fb9,'remoteId':_0xf98b47[_0x230981(0xa3)]};if(_0x555cf4)_0x381f4a[_0x230981(0xc1)]=_0x555cf4;return{'ok':!![],'data':_0x381f4a,'message':_0x230981(0xa7)+_0x521fb9+(_0x555cf4?_0x230981(0xab):'')};}};function resolveDeleteTarget(_0x28528e,_0x5a5715){const _0x26261e=a25_0xdd4b87;if(_0x28528e['includes']('/')){const _0x3c0c4f=_0x5a5715[_0x26261e(0xbc)](_0x54546e=>_0x54546e===_0x28528e);if(!_0x3c0c4f)throw CliErrors['validation'](_0x26261e(0xc2)+_0x28528e);return _0x3c0c4f;}const _0x2bc858=_0x5a5715[_0x26261e(0x9f)](_0x244404=>_0x244404[_0x26261e(0xcb)]('/')['at'](-0x1)===_0x28528e);if(_0x2bc858[_0x26261e(0xba)]===0x0)throw CliErrors[_0x26261e(0xaa)](_0x26261e(0xc2)+_0x28528e);if(_0x2bc858[_0x26261e(0xba)]>0x1)throw CliErrors[_0x26261e(0xaa)]('Multiple\x20functions\x20match\x20\x22'+_0x28528e+_0x26261e(0xbe)+_0x2bc858[_0x26261e(0xa6)](_0x233d51=>_0x26261e(0xcc)+_0x233d51)['join']('\x0a'));return _0x2bc858[0x0];}async function moveToTrash(_0x1d162a,_0x3e53e5,_0x32531b){const _0x542cf7=a25_0xdd4b87,_0x601d96=new Date()[_0x542cf7(0xa0)]()[_0x542cf7(0xb0)](/[:.]/g,'-'),_0x269dc1=relative(_0x1d162a,_0x32531b),_0x49d723=join(_0x3e53e5,_0x601d96,_0x269dc1);return await mkdir(dirname(_0x49d723),{'recursive':!![]}),await rename(_0x32531b,_0x49d723),_0x49d723;}async function cleanupEmptyDirectories(_0x5bb919,_0x1058a0){const _0x544ff2=a25_0xdd4b87;let _0x2c9226=resolve(_0x5bb919);const _0x49c7a5=resolve(_0x1058a0);while(_0x2c9226['startsWith'](''+_0x49c7a5+sep)||_0x2c9226===_0x49c7a5){if(_0x2c9226===_0x49c7a5)return;try{const _0x17c772=await readdir(_0x2c9226);if(_0x17c772[_0x544ff2(0xba)]>0x0)return;await rmdir(_0x2c9226);}catch{return;}_0x2c9226=dirname(_0x2c9226);}}
@@ -1 +1 @@
1
- const a26_0x4574c3=a26_0x1fd8;(function(_0x45ca68,_0x4bb276){const _0x125f58=a26_0x1fd8,_0x64e430=_0x45ca68();while(!![]){try{const _0x405d2b=parseInt(_0x125f58(0x82))/0x1+parseInt(_0x125f58(0x90))/0x2*(-parseInt(_0x125f58(0x91))/0x3)+parseInt(_0x125f58(0x8d))/0x4+-parseInt(_0x125f58(0x8b))/0x5+-parseInt(_0x125f58(0x8e))/0x6+parseInt(_0x125f58(0x83))/0x7+parseInt(_0x125f58(0x80))/0x8*(parseInt(_0x125f58(0x89))/0x9);if(_0x405d2b===_0x4bb276)break;else _0x64e430['push'](_0x64e430['shift']());}catch(_0x447bb3){_0x64e430['push'](_0x64e430['shift']());}}}(a26_0x5ecf,0x9474f));function a26_0x5ecf(){const _0x2d8708=['4049346USDNLS','num','number','appCode','Script\x20ID','boolean','9TmsFKv','Return\x20full\x20raw\x20script\x20object','4918205sUOHxE','(none)','4183264hidzXi','4907568qNgrzW','verbose','2eJWIxb','1230279CXYzHC','createdTime','1404392ockRYo','scriptType','1019898dbvrVb'];a26_0x5ecf=function(){return _0x2d8708;};return a26_0x5ecf();}function a26_0x1fd8(_0x2eb792,_0x20d6ca){_0x2eb792=_0x2eb792-0x7f;const _0x5ecfd9=a26_0x5ecf();let _0x1fd898=_0x5ecfd9[_0x2eb792];return _0x1fd898;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':'read','flags':[{'name':'id','type':a26_0x4574c3(0x85),'required':!![],'description':a26_0x4574c3(0x87)},{'name':a26_0x4574c3(0x8f),'type':a26_0x4574c3(0x88),'description':a26_0x4574c3(0x8a)}],async 'execute'(_0x2c0535){const _0x71df2f=a26_0x4574c3,_0x47e028=await getBffScriptInfo(_0x2c0535[_0x71df2f(0x84)]('id')),_0x4bde6b=_0x2c0535['bool'](_0x71df2f(0x8f));if(_0x4bde6b)return{'ok':!![],'data':_0x47e028};return{'ok':!![],'data':{'id':_0x47e028['id'],'appCode':_0x47e028[_0x71df2f(0x86)],'scriptType':_0x47e028[_0x71df2f(0x81)],'description':_0x47e028['description']||_0x71df2f(0x8c),'createdTime':_0x47e028[_0x71df2f(0x7f)]??'','updatedTime':_0x47e028['updatedTime']??'','scriptContent':_0x47e028['scriptContent']??''}};}};
1
+ const a26_0x107f8d=a26_0x1bac;function a26_0x1bac(_0x194b92,_0xc93a1d){_0x194b92=_0x194b92-0x82;const _0x121997=a26_0x1219();let _0x1bacb6=_0x121997[_0x194b92];return _0x1bacb6;}(function(_0x474ee0,_0x4abbff){const _0x316c3d=a26_0x1bac,_0x4c841a=_0x474ee0();while(!![]){try{const _0x58ddc3=-parseInt(_0x316c3d(0x85))/0x1+-parseInt(_0x316c3d(0x96))/0x2*(parseInt(_0x316c3d(0x91))/0x3)+-parseInt(_0x316c3d(0x84))/0x4*(parseInt(_0x316c3d(0x8b))/0x5)+-parseInt(_0x316c3d(0x86))/0x6*(-parseInt(_0x316c3d(0x8c))/0x7)+parseInt(_0x316c3d(0x8a))/0x8+parseInt(_0x316c3d(0x94))/0x9+-parseInt(_0x316c3d(0x83))/0xa;if(_0x58ddc3===_0x4abbff)break;else _0x4c841a['push'](_0x4c841a['shift']());}catch(_0xa4cb9b){_0x4c841a['push'](_0x4c841a['shift']());}}}(a26_0x1219,0x71769));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a26_0x107f8d(0x92),'command':a26_0x107f8d(0x89),'description':a26_0x107f8d(0x8f),'risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a26_0x107f8d(0x95)},{'name':a26_0x107f8d(0x88),'type':'boolean','description':a26_0x107f8d(0x87)}],async 'execute'(_0x42c9d2){const _0x43a3aa=a26_0x107f8d,_0x460eb7=await getBffScriptInfo(_0x42c9d2['num']('id')),_0x1f5913=_0x42c9d2['bool'](_0x43a3aa(0x88));if(_0x1f5913)return{'ok':!![],'data':_0x460eb7};return{'ok':!![],'data':{'id':_0x460eb7['id'],'appCode':_0x460eb7[_0x43a3aa(0x90)],'scriptType':_0x460eb7[_0x43a3aa(0x8e)],'description':_0x460eb7[_0x43a3aa(0x82)]||_0x43a3aa(0x93),'createdTime':_0x460eb7[_0x43a3aa(0x8d)]??'','updatedTime':_0x460eb7['updatedTime']??'','scriptContent':_0x460eb7[_0x43a3aa(0x97)]??''}};}};function a26_0x1219(){const _0x2ee521=['2393155QDoDPx','1057QaeAhr','createdTime','scriptType','Get\x20BFF\x20script\x20details\x20by\x20ID','appCode','1191RFDLpC','bff','(none)','7325199nBWjeg','Script\x20ID','3058kgIuIA','scriptContent','description','263480oKJGHg','4sXNGem','323764dQtgBj','34710pFkEIH','Return\x20full\x20raw\x20script\x20object','verbose','detail','1704440XHesci'];a26_0x1219=function(){return _0x2ee521;};return a26_0x1219();}
@@ -1 +1 @@
1
- function a27_0x5902(_0x765e1d,_0x37eb7e){_0x765e1d=_0x765e1d-0x1cd;const _0x2dc7df=a27_0x2dc7();let _0x5902e4=_0x2dc7df[_0x765e1d];return _0x5902e4;}(function(_0x448f2e,_0x1a366e){const _0x543479=a27_0x5902,_0xa7d762=_0x448f2e();while(!![]){try{const _0x191b71=parseInt(_0x543479(0x1ce))/0x1+parseInt(_0x543479(0x1d0))/0x2+parseInt(_0x543479(0x1d1))/0x3+-parseInt(_0x543479(0x1d3))/0x4*(-parseInt(_0x543479(0x1d2))/0x5)+parseInt(_0x543479(0x1cd))/0x6+parseInt(_0x543479(0x1cf))/0x7+-parseInt(_0x543479(0x1d4))/0x8;if(_0x191b71===_0x1a366e)break;else _0xa7d762['push'](_0xa7d762['shift']());}catch(_0x44d2d1){_0xa7d762['push'](_0xa7d762['shift']());}}}(a27_0x2dc7,0x95051));import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';function a27_0x2dc7(){const _0x4f2cb6=['362454kMikcn','7848211fbUAYa','2002624JLwcEr','927996AJrFVl','10zjtccn','962704GQaRWC','23710936hNwKYm','1791774BSdUQk'];a27_0x2dc7=function(){return _0x4f2cb6;};return a27_0x2dc7();}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
+ (function(_0x40df0e,_0x3ca057){const _0x41a38e=a27_0x3c89,_0x3aa9e2=_0x40df0e();while(!![]){try{const _0xd5feca=parseInt(_0x41a38e(0x7d))/0x1*(-parseInt(_0x41a38e(0x7b))/0x2)+parseInt(_0x41a38e(0x7a))/0x3+parseInt(_0x41a38e(0x7e))/0x4*(parseInt(_0x41a38e(0x79))/0x5)+parseInt(_0x41a38e(0x7c))/0x6*(parseInt(_0x41a38e(0x82))/0x7)+-parseInt(_0x41a38e(0x81))/0x8*(parseInt(_0x41a38e(0x78))/0x9)+parseInt(_0x41a38e(0x7f))/0xa+parseInt(_0x41a38e(0x80))/0xb;if(_0xd5feca===_0x3ca057)break;else _0x3aa9e2['push'](_0x3aa9e2['shift']());}catch(_0x7f9d50){_0x3aa9e2['push'](_0x3aa9e2['shift']());}}}(a27_0x2074,0xb24e8));import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';function a27_0x3c89(_0x190f8c,_0x2d7a3f){_0x190f8c=_0x190f8c-0x78;const _0x20744d=a27_0x2074();let _0x3c89d8=_0x20744d[_0x190f8c];return _0x3c89d8;}import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';function a27_0x2074(){const _0xa43cd7=['10768560OudALy','3274073XncyIU','213736HFUcur','4952962jTPKQj','288UIMPpe','255AlEtIw','1900599ZlKBxR','484jDvVuB','6qqHPwL','5826VKxWDY','21928IpgqEp'];a27_0x2074=function(){return _0xa43cd7;};return a27_0x2074();}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- function a28_0x5396(){const _0x38adf4=['bool','string','Return\x20full\x20script\x20objects','3894580zSylGG','ENDPOINT','List\x20BFF\x20scripts','5863280KOjuTR','verbose','691966MDpRJO','list','description','str','7uyuoaH','(unnamed)','859802bgwers','3jbUQiC','type','351896EylnSP','Filter\x20by\x20script\x20name','867595cclkWk','18OPLRzr','appCode','boolean','map','3185214VlnnYE','Script\x20type\x20filter'];a28_0x5396=function(){return _0x38adf4;};return a28_0x5396();}const a28_0x5e4de1=a28_0x23c9;function a28_0x23c9(_0x2540d4,_0x5a0278){_0x2540d4=_0x2540d4-0xe1;const _0x5396f9=a28_0x5396();let _0x23c9ae=_0x5396f9[_0x2540d4];return _0x23c9ae;}(function(_0x3b6ef5,_0x1f9a1b){const _0x14041c=a28_0x23c9,_0x5952c7=_0x3b6ef5();while(!![]){try{const _0x4f7115=-parseInt(_0x14041c(0xec))/0x1+-parseInt(_0x14041c(0xf2))/0x2*(-parseInt(_0x14041c(0xf3))/0x3)+-parseInt(_0x14041c(0xf5))/0x4+parseInt(_0x14041c(0xf7))/0x5+-parseInt(_0x14041c(0xe2))/0x6*(-parseInt(_0x14041c(0xf0))/0x7)+-parseInt(_0x14041c(0xea))/0x8+parseInt(_0x14041c(0xf8))/0x9*(parseInt(_0x14041c(0xe7))/0xa);if(_0x4f7115===_0x1f9a1b)break;else _0x5952c7['push'](_0x5952c7['shift']());}catch(_0x195e0a){_0x5952c7['push'](_0x5952c7['shift']());}}}(a28_0x5396,0x61be3));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a28_0x5e4de1(0xed),'description':a28_0x5e4de1(0xe9),'risk':'read','flags':[{'name':'type','type':a28_0x5e4de1(0xe5),'description':a28_0x5e4de1(0xe3),'default':'ENDPOINT','enum':[a28_0x5e4de1(0xe8),'COMMON']},{'name':'name','type':'string','description':a28_0x5e4de1(0xf6)},{'name':a28_0x5e4de1(0xeb),'type':a28_0x5e4de1(0xfa),'description':a28_0x5e4de1(0xe6)}],async 'execute'(_0x1f48f3){const _0x511244=a28_0x5e4de1,_0x9bd68=await listBffScripts(_0x1f48f3[_0x511244(0xf9)],_0x1f48f3[_0x511244(0xef)](_0x511244(0xf4)),{'scriptName':_0x1f48f3[_0x511244(0xef)]('name')||undefined}),_0x1fbd16=_0x1f48f3[_0x511244(0xe4)](_0x511244(0xeb));return{'ok':!![],'data':_0x1fbd16?_0x9bd68:_0x9bd68[_0x511244(0xe1)](_0x2325a8=>({'id':_0x2325a8['id'],'functionName':_0x2325a8['functionName']??'','description':_0x2325a8[_0x511244(0xee)]||_0x511244(0xf1),'scriptType':_0x2325a8['scriptType']})),'message':_0x9bd68['length']===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
1
+ const a28_0x5714ef=a28_0x4251;(function(_0x277262,_0x185a64){const _0x524cea=a28_0x4251,_0x40bba4=_0x277262();while(!![]){try{const _0x2d5c4b=-parseInt(_0x524cea(0x1b2))/0x1+-parseInt(_0x524cea(0x1be))/0x2*(parseInt(_0x524cea(0x1b9))/0x3)+-parseInt(_0x524cea(0x1bc))/0x4+-parseInt(_0x524cea(0x1c5))/0x5*(parseInt(_0x524cea(0x1bb))/0x6)+-parseInt(_0x524cea(0x1c8))/0x7+parseInt(_0x524cea(0x1c2))/0x8+parseInt(_0x524cea(0x1c7))/0x9;if(_0x2d5c4b===_0x185a64)break;else _0x40bba4['push'](_0x40bba4['shift']());}catch(_0x5aab61){_0x40bba4['push'](_0x40bba4['shift']());}}}(a28_0x4125,0x5f9dc));function a28_0x4125(){const _0x977129=['14829921nURXla','1674120xAHxsy','name','appCode','List\x20BFF\x20scripts','404653ipiKAi','description','COMMON','Script\x20type\x20filter','map','verbose','(unnamed)','345BvgFdA','read','1624908VYzrwA','2745504iSIkwF','string','3698zdJgRW','ENDPOINT','length','Filter\x20by\x20script\x20name','4460136zkiSSb','boolean','list','5GVqWBD','type'];a28_0x4125=function(){return _0x977129;};return a28_0x4125();}import{listBffScripts}from'../../core/api-client.js';function a28_0x4251(_0x22aef1,_0x2a62d7){_0x22aef1=_0x22aef1-0x1b0;const _0x412565=a28_0x4125();let _0x42515e=_0x412565[_0x22aef1];return _0x42515e;}export const bffList={'service':'bff','command':a28_0x5714ef(0x1c4),'description':a28_0x5714ef(0x1b1),'risk':a28_0x5714ef(0x1ba),'flags':[{'name':'type','type':'string','description':a28_0x5714ef(0x1b5),'default':a28_0x5714ef(0x1bf),'enum':[a28_0x5714ef(0x1bf),a28_0x5714ef(0x1b4)]},{'name':a28_0x5714ef(0x1c9),'type':a28_0x5714ef(0x1bd),'description':a28_0x5714ef(0x1c1)},{'name':a28_0x5714ef(0x1b7),'type':a28_0x5714ef(0x1c3),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x17f8a1){const _0x2e8770=a28_0x5714ef,_0x2c3e95=await listBffScripts(_0x17f8a1[_0x2e8770(0x1b0)],_0x17f8a1['str'](_0x2e8770(0x1c6)),{'scriptName':_0x17f8a1['str'](_0x2e8770(0x1c9))||undefined}),_0x35d335=_0x17f8a1['bool'](_0x2e8770(0x1b7));return{'ok':!![],'data':_0x35d335?_0x2c3e95:_0x2c3e95[_0x2e8770(0x1b6)](_0x2e15c2=>({'id':_0x2e15c2['id'],'functionName':_0x2e15c2['functionName']??'','description':_0x2e15c2[_0x2e8770(0x1b3)]||_0x2e8770(0x1b8),'scriptType':_0x2e15c2['scriptType']})),'message':_0x2c3e95[_0x2e8770(0x1c0)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
@@ -1 +1 @@
1
- function a29_0x3501(_0x5bdba3,_0x36d238){_0x5bdba3=_0x5bdba3-0x72;const _0x869290=a29_0x8692();let _0x3501e5=_0x869290[_0x5bdba3];return _0x3501e5;}const a29_0x166eee=a29_0x3501;(function(_0x186b17,_0x36f113){const _0x3c0699=a29_0x3501,_0x271a45=_0x186b17();while(!![]){try{const _0xe3f100=-parseInt(_0x3c0699(0xb8))/0x1*(parseInt(_0x3c0699(0xbf))/0x2)+parseInt(_0x3c0699(0x84))/0x3*(parseInt(_0x3c0699(0x88))/0x4)+-parseInt(_0x3c0699(0xa5))/0x5+parseInt(_0x3c0699(0x98))/0x6+-parseInt(_0x3c0699(0x96))/0x7*(parseInt(_0x3c0699(0xb3))/0x8)+parseInt(_0x3c0699(0x99))/0x9*(parseInt(_0x3c0699(0xbc))/0xa)+parseInt(_0x3c0699(0xad))/0xb;if(_0xe3f100===_0x36f113)break;else _0x271a45['push'](_0x271a45['shift']());}catch(_0x2715f7){_0x271a45['push'](_0x271a45['shift']());}}}(a29_0x8692,0x57969));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a29_0x8692(){const _0x556b1f=['No\x20api.ts\x20found.\x20Run\x20`','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','trim','stderr','\x0a\x20*\x20[触发节点]\x20','54527YUQgXX','\x22.\x20','validation','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','alias','75536oPAEKO','scriptsRootDir','ENDPOINT','function-node','includes','141787aWSALw','\x20function:\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','nonInteractive','4710QHeLMk','HOOK','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','4hKhIaw','Script\x20type','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x20[脚本名称]\x20','description','datasetCode','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','code','appCode','No\x20datasets\x20found\x20for\x20this\x20app.','stdin','before','map','keys','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','length','Created\x20','Available\x20aliases:\x20','apiDir','string','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','name','join','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Invalid\x20function\x20name\x20\x22','bff','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','/endpoint/','856230qBpPKP','question','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','4ARnlOR','File\x20already\x20exists:\x20','after','Function\x20name\x20(valid\x20JS\x20identifier)','\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','Invalid\x20dataset\x20selection.','Script\x20description','operation-type','\x22\x20not\x20found\x20for\x20dataset\x20','close','operationType','datasetcode','find','write','259NrojLE','Alias\x20\x22','3387978XmTyIh','2619GVSxEG','Operation\x20type\x20\x22','\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','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','type','tableName','Select\x20dataset:','.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','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','COMMON','functionNode','2010oXEbZx','str','new'];a29_0x8692=function(){return _0x556b1f;};return a29_0x8692();}import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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':a29_0x166eee(0x81),'command':a29_0x166eee(0xa7),'description':a29_0x166eee(0xa9),'risk':a29_0x166eee(0x95),'flags':[{'name':a29_0x166eee(0x9d),'type':'string','required':!![],'enum':[a29_0x166eee(0xa3),a29_0x166eee(0xb5),a29_0x166eee(0xbd)],'description':a29_0x166eee(0xc0)},{'name':a29_0x166eee(0x7d),'type':a29_0x166eee(0x7b),'required':!![],'description':a29_0x166eee(0x8b)},{'name':a29_0x166eee(0xc3),'type':'string','description':a29_0x166eee(0x8e)},{'name':'alias','type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a29_0x166eee(0x93),'type':a29_0x166eee(0x7b),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a29_0x166eee(0x8f),'type':a29_0x166eee(0x7b),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a29_0x166eee(0xb6),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a29_0x166eee(0x73),'after']}],async 'validate'(_0x1f6ab5){const _0x5dc447=a29_0x166eee,_0x4c0e39=_0x1f6ab5[_0x5dc447(0xa6)](_0x5dc447(0x7d));if(!isValidBffFunctionName(_0x4c0e39))throw CliErrors[_0x5dc447(0xaf)](_0x5dc447(0x80)+_0x4c0e39+_0x5dc447(0x7f));},async 'execute'(_0x579fd1){const _0x1310fe=a29_0x166eee,_0x5772be=loadBffProjectConfig(_0x579fd1[_0x1310fe(0xc7)]),_0x2b78ab=_0x579fd1[_0x1310fe(0xa6)](_0x1310fe(0x9d)),_0x2aee08=_0x579fd1['str'](_0x1310fe(0x7d)),_0x55e3cd=_0x579fd1[_0x1310fe(0xa6)](_0x1310fe(0xc3))||undefined,_0x30af0d=_0x2b78ab===_0x1310fe(0xbd)?await resolveHookOptions(_0x5772be,_0x579fd1):undefined,_0x156946=buildFilePath(_0x5772be,_0x2b78ab,_0x2aee08,_0x30af0d);if(await fileExists(_0x156946))throw CliErrors[_0x1310fe(0xaf)](_0x1310fe(0x89)+_0x156946);await mkdir(dirname(_0x156946),{'recursive':!![]});const _0x581b8c=generateTemplate(_0x2b78ab,_0x2aee08,_0x579fd1['appCode'],_0x55e3cd,_0x30af0d);await writeFile(_0x156946,_0x581b8c,'utf8');const _0x5b6131={'type':_0x2b78ab,'name':_0x2aee08,'path':_0x156946};if(_0x55e3cd)_0x5b6131[_0x1310fe(0xc3)]=_0x55e3cd;if(_0x30af0d){if(_0x30af0d['alias'])_0x5b6131[_0x1310fe(0xb2)]=_0x30af0d['alias'];_0x5b6131[_0x1310fe(0xc4)]=_0x30af0d[_0x1310fe(0xc4)],_0x5b6131['operationType']=_0x30af0d[_0x1310fe(0x92)],_0x5b6131[_0x1310fe(0xa4)]=_0x30af0d['functionNode'];}return{'ok':!![],'data':_0x5b6131,'message':_0x1310fe(0x78)+_0x2b78ab+_0x1310fe(0xb9)+_0x2aee08};}};async function resolveHookOptions(_0x54ecc1,_0x92cff8){const _0xe2717=a29_0x166eee,_0x573142=loadAliasMap(_0x92cff8['apiDir'],undefined,resolveApiFilePath(_0x92cff8[_0xe2717(0x7a)],_0x92cff8[_0xe2717(0xc7)])),_0x7e07f0=_0x573142[_0xe2717(0x77)]>0x0;let _0x5e81ed,_0x28ab6b,_0x9885fc;const _0x56b610=_0x92cff8[_0xe2717(0xa6)](_0xe2717(0xb2)),_0x33ad0f=_0x92cff8[_0xe2717(0xa6)]('datasetcode');if(_0x56b610){const _0x130575=resolveAlias(_0x92cff8[_0xe2717(0x7a)],_0x56b610,undefined,resolveApiFilePath(_0x92cff8[_0xe2717(0x7a)],_0x92cff8[_0xe2717(0xc7)]));if(!_0x130575){const _0x5f509e=_0x7e07f0?_0xe2717(0x79)+_0x573142[_0xe2717(0x74)](_0x30b7b6=>_0x30b7b6['alias'])[_0xe2717(0x7e)](',\x20'):_0xe2717(0xa8)+CLI_BIN_NAME+_0xe2717(0x9c);throw CliErrors[_0xe2717(0xaf)](_0xe2717(0x97)+_0x56b610+'\x22\x20not\x20found.\x20'+_0x5f509e);}_0x5e81ed=_0x56b610,_0x28ab6b=_0x130575;}else{if(_0x33ad0f){_0x28ab6b=_0x33ad0f;const _0x2d64f2=_0x573142[_0xe2717(0x94)](_0x45c1ff=>_0x45c1ff['datasetCode']===_0x33ad0f);_0x5e81ed=_0x2d64f2?.['alias'];}else{if(_0x92cff8[_0xe2717(0xbb)])throw CliErrors[_0xe2717(0xaf)](_0xe2717(0xb1));else{if(_0x7e07f0){const _0x293070=_0x573142[_0xe2717(0x74)](_0x1045cd=>_0x1045cd[_0xe2717(0xb2)]+'\x20('+_0x1045cd[_0xe2717(0x9e)]+')'),_0x4541b4=await promptSelect(_0xe2717(0x9f),_0x293070),_0xa90fcd=_0x573142[_0x4541b4];if(!_0xa90fcd)throw CliErrors[_0xe2717(0xaf)]('Invalid\x20dataset\x20selection.');_0x5e81ed=_0xa90fcd['alias'],_0x28ab6b=_0xa90fcd[_0xe2717(0xc4)];}else{const _0x5aa09e=await listDatasets(_0x92cff8[_0xe2717(0xc7)]);if(_0x5aa09e[_0xe2717(0x77)]===0x0)throw CliErrors['validation'](_0xe2717(0xc8));const _0x16a82b=_0x5aa09e['map'](_0x201b3a=>_0x201b3a['name']+'\x20('+_0x201b3a[_0xe2717(0xc6)]+')'),_0x56767d=await promptSelect('Select\x20dataset:',_0x16a82b),_0x5c3ed2=_0x5aa09e[_0x56767d];if(!_0x5c3ed2)throw CliErrors[_0xe2717(0xaf)](_0xe2717(0x8d));_0x28ab6b=_0x5c3ed2[_0xe2717(0xc6)],_0x5e81ed=undefined;}}}}const _0x468135=await listDatasets(_0x92cff8['appCode']),_0x421801=_0x468135[_0xe2717(0x94)](_0x19b58e=>_0x19b58e[_0xe2717(0xc6)]===_0x28ab6b);if(!_0x421801)throw CliErrors[_0xe2717(0xaf)](_0xe2717(0xc1)+_0x28ab6b+_0xe2717(0xae)+(_0x5e81ed?_0xe2717(0xb0)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x9885fc=_0x421801['id'];const _0x27b158=_0x5e81ed??_0x28ab6b,_0x217a55=await listBffDatasetOperations(_0x92cff8[_0xe2717(0xc7)],_0x9885fc),_0x134939=_0x217a55?Object[_0xe2717(0x75)](_0x217a55):[];if(_0x134939[_0xe2717(0x77)]===0x0)throw CliErrors['validation']('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x27b158+'.');let _0xeb6729;const _0x3fdc43=_0x92cff8[_0xe2717(0xa6)](_0xe2717(0x8f));if(_0x3fdc43){if(!_0x134939[_0xe2717(0xb7)](_0x3fdc43))throw CliErrors['validation'](_0xe2717(0x9a)+_0x3fdc43+_0xe2717(0x90)+_0x27b158+'.\x20'+('Available:\x20'+_0x134939[_0xe2717(0x7e)](',\x20')));_0xeb6729=_0x3fdc43;}else{if(_0x92cff8[_0xe2717(0xbb)])throw CliErrors['validation'](_0xe2717(0x7c));const _0x152806=await promptSelect('Select\x20operation\x20type:',_0x134939);_0xeb6729=_0x134939[_0x152806]??_0x134939[0x0];}let _0x46d930=normalizeHookFunctionNode(_0x92cff8[_0xe2717(0xa6)]('function-node'));if(!_0x46d930){if(_0x92cff8[_0xe2717(0xa6)](_0xe2717(0xb6)))throw CliErrors[_0xe2717(0xaf)](_0xe2717(0x76));if(_0x92cff8[_0xe2717(0xbb)])throw CliErrors[_0xe2717(0xaf)](_0xe2717(0x87));const _0x2d659c=await promptSelect('Select\x20trigger\x20node:',['before',_0xe2717(0x8a)]);_0x46d930=['before',_0xe2717(0x8a)][_0x2d659c]??_0xe2717(0x73);}return{'alias':_0x5e81ed,'datasetCode':_0x28ab6b,'datasetId':_0x9885fc,'operationType':_0xeb6729,'functionNode':_0x46d930};}async function promptSelect(_0x4d2bcd,_0x2d9fbb){const _0x10eafd=a29_0x166eee;if(_0x2d9fbb[_0x10eafd(0x77)]===0x1)return 0x0;for(const [_0x198216,_0x2c6ca3]of _0x2d9fbb['entries']()){process['stderr'][_0x10eafd(0x95)]('\x20\x20'+(_0x198216+0x1)+'.\x20'+_0x2c6ca3+'\x0a');}const _0x3f2008=createInterface({'input':process[_0x10eafd(0x72)],'output':process[_0x10eafd(0xab)]});while(!![]){const _0x21fbda=await new Promise(_0x54cd1e=>{const _0x455b67=_0x10eafd;_0x3f2008[_0x455b67(0x85)](_0x4d2bcd+'\x20',_0x54cd1e);}),_0x339b0c=Number['parseInt'](_0x21fbda['trim'](),0xa);if(Number['isInteger'](_0x339b0c)&&_0x339b0c>=0x1&&_0x339b0c<=_0x2d9fbb[_0x10eafd(0x77)])return _0x3f2008[_0x10eafd(0x91)](),_0x339b0c-0x1;process[_0x10eafd(0xab)]['write'](_0x10eafd(0x82)+_0x2d9fbb[_0x10eafd(0x77)]+'.\x0a');}}function buildFilePath(_0x1a7b34,_0x34768c,_0x5c52ca,_0x5940f5){const _0x132f0b=a29_0x166eee;if(_0x34768c==='HOOK'){if(!_0x5940f5)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x532e2c=_0x5940f5[_0x132f0b(0xb2)]??_0x5940f5[_0x132f0b(0xc4)];return join(_0x1a7b34['scriptsRootDir'],_0x132f0b(0xbd),_0x532e2c,_0x5940f5[_0x132f0b(0x92)],_0x5940f5['functionNode'],_0x5c52ca+'.js');}return join(_0x1a7b34[_0x132f0b(0xb4)],_0x34768c,_0x5c52ca+'.js');}export function generateTemplate(_0x1cf6d3,_0x40262a,_0x157c1b,_0x58bb5a,_0x360ce6){const _0x40645b=a29_0x166eee,_0x554e29=_0x58bb5a?.[_0x40645b(0xaa)]()||'TODO:\x20add\x20script\x20description';if(_0x1cf6d3===_0x40645b(0xa3))return _0x40645b(0xba)+_0x554e29+_0x40645b(0xc2)+_0x40262a+_0x40645b(0xa2)+_0x40262a+_0x40645b(0xa0)+_0x40262a+_0x40645b(0xbe);if(_0x1cf6d3===_0x40645b(0xb5))return _0x40645b(0xc5)+_0x554e29+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x157c1b+_0x40645b(0x83)+_0x40262a+_0x40645b(0x8c)+_0x40262a+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x360ce6)throw CliErrors[_0x40645b(0xaf)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0x40645b(0x86)+_0x554e29+_0x40645b(0xa1)+_0x157c1b+'/'+_0x360ce6['datasetCode']+'/'+_0x360ce6[_0x40645b(0x92)]+_0x40645b(0xac)+_0x360ce6[_0x40645b(0xa4)]+_0x40645b(0x9b)+_0x40262a+_0x40645b(0xbe);}
1
+ const a29_0x148bc3=a29_0x10df;(function(_0x1be716,_0xc079e4){const _0x1d601d=a29_0x10df,_0x32351f=_0x1be716();while(!![]){try{const _0x5afedf=parseInt(_0x1d601d(0xcc))/0x1+-parseInt(_0x1d601d(0xec))/0x2*(parseInt(_0x1d601d(0x10b))/0x3)+-parseInt(_0x1d601d(0x107))/0x4*(-parseInt(_0x1d601d(0xed))/0x5)+parseInt(_0x1d601d(0xda))/0x6*(-parseInt(_0x1d601d(0xf4))/0x7)+-parseInt(_0x1d601d(0x10a))/0x8*(parseInt(_0x1d601d(0xd6))/0x9)+-parseInt(_0x1d601d(0xfe))/0xa*(parseInt(_0x1d601d(0xf1))/0xb)+parseInt(_0x1d601d(0x110))/0xc;if(_0x5afedf===_0xc079e4)break;else _0x32351f['push'](_0x32351f['shift']());}catch(_0x3ffd3c){_0x32351f['push'](_0x32351f['shift']());}}}(a29_0x5b04,0xc45ed));import{createInterface}from'node:readline';function a29_0x5b04(){const _0x177235=['226900onhBds','apiDir','ENDPOINT','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','No\x20datasets\x20found\x20for\x20this\x20app.','Operation\x20type\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','stderr','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x0a\x20*\x20[脚本名称]\x20','279HfjfWI','map','validation','after','11370lfTxsz','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','operationType','Script\x20type','datasetCode','Select\x20dataset:','stdin','string','includes','.js','new','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','tableName','functionNode','Invalid\x20function\x20name\x20\x22','before','2FNpZek','5084265WiaPAS','HOOK\x20requires\x20alias/operation/node\x20options.','No\x20api.ts\x20found.\x20Run\x20`','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','33eGvAys','code','Trigger\x20node\x20(HOOK\x20only)','5012mxpcyU','HOOK','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','write','Invalid\x20dataset\x20selection.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','name','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','/endpoint/','length','3848030wjtqbW','scriptsRootDir','alias','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','datasetcode','str','nonInteractive','4UHoASK','function-node','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','210928XfvqWc','1794189zwrSaQ','\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','trim','\x0a\x20*\x20[触发节点]\x20','Select\x20trigger\x20node:','41846616LYiWwZ','appCode','keys','operation-type','find','join','.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','Dataset\x20not\x20found\x20for\x20code\x20\x22','description','entries','\x22\x20not\x20found.\x20','type','bff','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.'];a29_0x5b04=function(){return _0x177235;};return a29_0x5b04();}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{resolveApiFilePath}from'../../context.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 a29_0x10df(_0x44a897,_0x54027a){_0x44a897=_0x44a897-0xc6;const _0x5b046b=a29_0x5b04();let _0x10dfff=_0x5b046b[_0x44a897];return _0x10dfff;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x148bc3(0xca),'command':a29_0x148bc3(0xe6),'description':a29_0x148bc3(0xcf),'risk':a29_0x148bc3(0xf7),'flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON',a29_0x148bc3(0xce),a29_0x148bc3(0xf5)],'description':a29_0x148bc3(0xdf)},{'name':a29_0x148bc3(0xfa),'type':a29_0x148bc3(0xe3),'required':!![],'description':a29_0x148bc3(0x103)},{'name':'description','type':'string','description':'Script\x20description'},{'name':a29_0x148bc3(0x100),'type':a29_0x148bc3(0xe3),'description':a29_0x148bc3(0xf9)},{'name':a29_0x148bc3(0x104),'type':'string','description':a29_0x148bc3(0xdd)},{'name':a29_0x148bc3(0x113),'type':a29_0x148bc3(0xe3),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a29_0x148bc3(0x108),'type':a29_0x148bc3(0xe3),'description':a29_0x148bc3(0xf3),'enum':['before',a29_0x148bc3(0xd9)]}],async 'validate'(_0x188845){const _0x5f11ad=a29_0x148bc3,_0x1afbef=_0x188845[_0x5f11ad(0x105)]('name');if(!isValidBffFunctionName(_0x1afbef))throw CliErrors[_0x5f11ad(0xd8)](_0x5f11ad(0xea)+_0x1afbef+_0x5f11ad(0x101));},async 'execute'(_0x583fd7){const _0x3d93fb=a29_0x148bc3,_0x55aaf4=loadBffProjectConfig(_0x583fd7[_0x3d93fb(0x111)]),_0x34251a=_0x583fd7['str'](_0x3d93fb(0xc9)),_0x4711b4=_0x583fd7['str'](_0x3d93fb(0xfa)),_0x57958f=_0x583fd7[_0x3d93fb(0x105)](_0x3d93fb(0xc6))||undefined,_0x186a4e=_0x34251a==='HOOK'?await resolveHookOptions(_0x55aaf4,_0x583fd7):undefined,_0x50daf8=buildFilePath(_0x55aaf4,_0x34251a,_0x4711b4,_0x186a4e);if(await fileExists(_0x50daf8))throw CliErrors[_0x3d93fb(0xd8)]('File\x20already\x20exists:\x20'+_0x50daf8);await mkdir(dirname(_0x50daf8),{'recursive':!![]});const _0x4e6716=generateTemplate(_0x34251a,_0x4711b4,_0x583fd7[_0x3d93fb(0x111)],_0x57958f,_0x186a4e);await writeFile(_0x50daf8,_0x4e6716,'utf8');const _0x54293a={'type':_0x34251a,'name':_0x4711b4,'path':_0x50daf8};if(_0x57958f)_0x54293a[_0x3d93fb(0xc6)]=_0x57958f;if(_0x186a4e){if(_0x186a4e['alias'])_0x54293a[_0x3d93fb(0x100)]=_0x186a4e['alias'];_0x54293a['datasetCode']=_0x186a4e[_0x3d93fb(0xe0)],_0x54293a[_0x3d93fb(0xde)]=_0x186a4e[_0x3d93fb(0xde)],_0x54293a[_0x3d93fb(0xe9)]=_0x186a4e['functionNode'];}return{'ok':!![],'data':_0x54293a,'message':'Created\x20'+_0x34251a+'\x20function:\x20'+_0x4711b4};}};async function resolveHookOptions(_0x42d99f,_0x36a520){const _0x43d02c=a29_0x148bc3,_0x5520a4=loadAliasMap(_0x36a520[_0x43d02c(0xcd)],undefined,resolveApiFilePath(_0x36a520['apiDir'],_0x36a520[_0x43d02c(0x111)])),_0x5bfa77=_0x5520a4[_0x43d02c(0xfd)]>0x0;let _0xffaa8c,_0x2b92ba,_0x404019;const _0x423373=_0x36a520[_0x43d02c(0x105)](_0x43d02c(0x100)),_0x24f551=_0x36a520[_0x43d02c(0x105)](_0x43d02c(0x104));if(_0x423373){const _0x41a2b6=resolveAlias(_0x36a520[_0x43d02c(0xcd)],_0x423373,undefined,resolveApiFilePath(_0x36a520[_0x43d02c(0xcd)],_0x36a520['appCode']));if(!_0x41a2b6){const _0x2c2973=_0x5bfa77?'Available\x20aliases:\x20'+_0x5520a4[_0x43d02c(0xd7)](_0x4d8f28=>_0x4d8f28['alias'])[_0x43d02c(0x115)](',\x20'):_0x43d02c(0xef)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x43d02c(0xd8)]('Alias\x20\x22'+_0x423373+_0x43d02c(0xc8)+_0x2c2973);}_0xffaa8c=_0x423373,_0x2b92ba=_0x41a2b6;}else{if(_0x24f551){_0x2b92ba=_0x24f551;const _0x598c53=_0x5520a4[_0x43d02c(0x114)](_0x3b393a=>_0x3b393a[_0x43d02c(0xe0)]===_0x24f551);_0xffaa8c=_0x598c53?.[_0x43d02c(0x100)];}else{if(_0x36a520[_0x43d02c(0x106)])throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0x102));else{if(_0x5bfa77){const _0x5be4df=_0x5520a4['map'](_0x2aebb9=>_0x2aebb9['alias']+'\x20('+_0x2aebb9[_0x43d02c(0xe8)]+')'),_0x34b7de=await promptSelect(_0x43d02c(0xe1),_0x5be4df),_0x4fe32e=_0x5520a4[_0x34b7de];if(!_0x4fe32e)throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0xf8));_0xffaa8c=_0x4fe32e[_0x43d02c(0x100)],_0x2b92ba=_0x4fe32e[_0x43d02c(0xe0)];}else{const _0x4e704a=await listDatasets(_0x36a520[_0x43d02c(0x111)]);if(_0x4e704a[_0x43d02c(0xfd)]===0x0)throw CliErrors['validation'](_0x43d02c(0xd0));const _0x58aaf7=_0x4e704a[_0x43d02c(0xd7)](_0x847a0b=>_0x847a0b[_0x43d02c(0xfa)]+'\x20('+_0x847a0b['code']+')'),_0x552ba8=await promptSelect(_0x43d02c(0xe1),_0x58aaf7),_0x249089=_0x4e704a[_0x552ba8];if(!_0x249089)throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0xf8));_0x2b92ba=_0x249089[_0x43d02c(0xf2)],_0xffaa8c=undefined;}}}}const _0xb843ee=await listDatasets(_0x36a520[_0x43d02c(0x111)]),_0x1e37b1=_0xb843ee['find'](_0x30bbe1=>_0x30bbe1[_0x43d02c(0xf2)]===_0x2b92ba);if(!_0x1e37b1)throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0x117)+_0x2b92ba+'\x22.\x20'+(_0xffaa8c?_0x43d02c(0xdc)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x404019=_0x1e37b1['id'];const _0x27482a=_0xffaa8c??_0x2b92ba,_0x4334b4=await listBffDatasetOperations(_0x36a520[_0x43d02c(0x111)],_0x404019),_0x31af5f=_0x4334b4?Object[_0x43d02c(0x112)](_0x4334b4):[];if(_0x31af5f[_0x43d02c(0xfd)]===0x0)throw CliErrors['validation']('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x27482a+'.');let _0x243614;const _0x552778=_0x36a520[_0x43d02c(0x105)]('operation-type');if(_0x552778){if(!_0x31af5f[_0x43d02c(0xe4)](_0x552778))throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0xd1)+_0x552778+_0x43d02c(0xd2)+_0x27482a+'.\x20'+('Available:\x20'+_0x31af5f[_0x43d02c(0x115)](',\x20')));_0x243614=_0x552778;}else{if(_0x36a520[_0x43d02c(0x106)])throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0x109));const _0x4cff18=await promptSelect('Select\x20operation\x20type:',_0x31af5f);_0x243614=_0x31af5f[_0x4cff18]??_0x31af5f[0x0];}let _0x5929b2=normalizeHookFunctionNode(_0x36a520['str'](_0x43d02c(0x108)));if(!_0x5929b2){if(_0x36a520[_0x43d02c(0x105)]('function-node'))throw CliErrors['validation'](_0x43d02c(0xe7));if(_0x36a520[_0x43d02c(0x106)])throw CliErrors[_0x43d02c(0xd8)](_0x43d02c(0xcb));const _0x19afa8=await promptSelect(_0x43d02c(0x10f),['before',_0x43d02c(0xd9)]);_0x5929b2=[_0x43d02c(0xeb),_0x43d02c(0xd9)][_0x19afa8]??'before';}return{'alias':_0xffaa8c,'datasetCode':_0x2b92ba,'datasetId':_0x404019,'operationType':_0x243614,'functionNode':_0x5929b2};}async function promptSelect(_0x48615d,_0x899b1e){const _0xe4d234=a29_0x148bc3;if(_0x899b1e[_0xe4d234(0xfd)]===0x1)return 0x0;for(const [_0x6b6e0a,_0x1e7799]of _0x899b1e[_0xe4d234(0xc7)]()){process[_0xe4d234(0xd3)][_0xe4d234(0xf7)]('\x20\x20'+(_0x6b6e0a+0x1)+'.\x20'+_0x1e7799+'\x0a');}const _0x1019ad=createInterface({'input':process[_0xe4d234(0xe2)],'output':process[_0xe4d234(0xd3)]});while(!![]){const _0x20f416=await new Promise(_0x5cbc89=>{_0x1019ad['question'](_0x48615d+'\x20',_0x5cbc89);}),_0x1de874=Number['parseInt'](_0x20f416[_0xe4d234(0x10d)](),0xa);if(Number['isInteger'](_0x1de874)&&_0x1de874>=0x1&&_0x1de874<=_0x899b1e[_0xe4d234(0xfd)])return _0x1019ad['close'](),_0x1de874-0x1;process[_0xe4d234(0xd3)]['write'](_0xe4d234(0xf6)+_0x899b1e[_0xe4d234(0xfd)]+'.\x0a');}}function buildFilePath(_0x42dc64,_0x1d3d95,_0x2628f9,_0x2bd089){const _0x5c257c=a29_0x148bc3;if(_0x1d3d95===_0x5c257c(0xf5)){if(!_0x2bd089)throw CliErrors[_0x5c257c(0xd8)](_0x5c257c(0xee));const _0x2bb0dd=_0x2bd089[_0x5c257c(0x100)]??_0x2bd089['datasetCode'];return join(_0x42dc64['scriptsRootDir'],_0x5c257c(0xf5),_0x2bb0dd,_0x2bd089['operationType'],_0x2bd089['functionNode'],_0x2628f9+_0x5c257c(0xe5));}return join(_0x42dc64[_0x5c257c(0xff)],_0x1d3d95,_0x2628f9+'.js');}export function generateTemplate(_0x25ea3c,_0x8cb2b3,_0x40d4cb,_0x1b4c16,_0x48af37){const _0x3f58ca=a29_0x148bc3,_0x17bf82=_0x1b4c16?.[_0x3f58ca(0x10d)]()||'TODO:\x20add\x20script\x20description';if(_0x25ea3c==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x17bf82+_0x3f58ca(0xd5)+_0x8cb2b3+_0x3f58ca(0xd4)+_0x8cb2b3+_0x3f58ca(0x116)+_0x8cb2b3+_0x3f58ca(0xfb);if(_0x25ea3c===_0x3f58ca(0xce))return _0x3f58ca(0xf0)+_0x17bf82+_0x3f58ca(0xdb)+_0x40d4cb+_0x3f58ca(0xfc)+_0x8cb2b3+_0x3f58ca(0x10c)+_0x8cb2b3+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x48af37)throw CliErrors['validation']('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x17bf82+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x40d4cb+'/'+_0x48af37[_0x3f58ca(0xe0)]+'/'+_0x48af37[_0x3f58ca(0xde)]+_0x3f58ca(0x10e)+_0x48af37[_0x3f58ca(0xe9)]+'\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'+_0x8cb2b3+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
@@ -1 +1 @@
1
- const a30_0x5f3016=a30_0x2366;(function(_0x378cce,_0x4b4a6a){const _0x516336=a30_0x2366,_0x31a3b3=_0x378cce();while(!![]){try{const _0x1b326b=parseInt(_0x516336(0x1c8))/0x1+parseInt(_0x516336(0x1bd))/0x2*(parseInt(_0x516336(0x1d4))/0x3)+-parseInt(_0x516336(0x1cf))/0x4+-parseInt(_0x516336(0x1d2))/0x5+-parseInt(_0x516336(0x1bf))/0x6+parseInt(_0x516336(0x1d1))/0x7+parseInt(_0x516336(0x1d5))/0x8*(parseInt(_0x516336(0x1d3))/0x9);if(_0x1b326b===_0x4b4a6a)break;else _0x31a3b3['push'](_0x31a3b3['shift']());}catch(_0x4178f3){_0x31a3b3['push'](_0x31a3b3['shift']());}}}(a30_0x4142,0x232da));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{resolveApiFilePath}from'../../context.js';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';function a30_0x4142(){const _0x39764a=['scriptsRoot','lockFilePath','hookLocation','lastSync','COMMON','nonInteractive','300228pOFuXG','pull','390761OghSRF','871855kXyNGQ','2755179GqbKGH','93eEdEDr','8cqDkJN','GET','force','\x20remote\x20BFF\x20script(s)\x20for\x20pull','\x20skipped,\x20','scriptType','length','skipped','would_pull','stringify','functions','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','Pull\x20complete:\x20','ENDPOINT','question','datasetCode','message','operationType','yes','HOOK','bool','filePath','&type=','/api/management/library/scripts/list?appCode=','apps','lockKey','apiDir','unresolvable\x20target\x20path','boolean','type','appCode','alias','functionName','all','bff','No\x20remote\x20BFF\x20scripts\x20found.','toISOString','stdin','Force\x20pull\x20cancelled.','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20failed','close','\x20pulled,\x20','string','write','5410xJjpur','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','1678620rcViFR','utf8','Force\x20overwrite\x20local\x20unsynced\x20changes','push','str','scriptContent','stderr','Pull\x20only\x20this\x20script\x20type','version','227479BaeSCW'];a30_0x4142=function(){return _0x39764a;};return a30_0x4142();}export const bffPull={'service':a30_0x5f3016(0x1f7),'command':a30_0x5f3016(0x1d0),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a30_0x5f3016(0x1bc),'flags':[{'name':a30_0x5f3016(0x1f2),'type':a30_0x5f3016(0x1bb),'description':a30_0x5f3016(0x1c6),'enum':[a30_0x5f3016(0x1cd),a30_0x5f3016(0x1e2),a30_0x5f3016(0x1e8)]},{'name':a30_0x5f3016(0x1d7),'type':a30_0x5f3016(0x1f1),'description':a30_0x5f3016(0x1c1)}],async 'dryRun'(_0x57f370){const _0x33060b=a30_0x5f3016,_0xd16549=loadBffProjectConfig(_0x57f370[_0x33060b(0x1f3)]),_0x5cab49=await readBffLockFile(_0xd16549['lockFilePath']),{appLock:_0x58bde5}=ensureLockScope(_0x5cab49??createEmptyBffLock(),_0x57f370[_0x33060b(0x1f3)],_0xd16549['scriptsRoot'],_0x33060b(0x1d0)),_0x522240=normalizeBffType(_0x57f370[_0x33060b(0x1c3)]('type'))??undefined,_0x5a30e0=buildDatasetCodeToAliasMap(_0x57f370[_0x33060b(0x1ef)],_0x57f370['appCode']),[_0x3f7fb3,_0x48f684]=await Promise[_0x33060b(0x1f6)]([listBffScripts(_0x57f370[_0x33060b(0x1f3)],_0x522240),getBffScriptStatistics(_0x57f370[_0x33060b(0x1f3)])]),_0x60b60e=createHookLocationMap(_0x48f684),_0x4871e3=[];for(const _0x36a265 of _0x3f7fb3){const _0xb0af39=resolveRemoteScriptTarget(_0xd16549,_0x36a265,_0x60b60e,_0x58bde5['functions'],_0x5a30e0);if(!_0xb0af39){_0x4871e3[_0x33060b(0x1c2)]({'scriptType':_0x36a265[_0x33060b(0x1da)],'functionName':_0x36a265[_0x33060b(0x1f5)]??'','status':_0x33060b(0x1dc),'reason':_0x33060b(0x1f0)});continue;}const _0x53152d=_0x58bde5[_0x33060b(0x1df)][_0xb0af39[_0x33060b(0x1ee)]],_0x242f4f=_0x36a265[_0x33060b(0x1c4)]!=null?computeContentHash(_0x36a265[_0x33060b(0x1c4)]):undefined,_0x1e3f0d=await hasUnsyncedLocalChanges(_0xb0af39[_0x33060b(0x1ea)],_0x53152d,_0x242f4f);_0x4871e3[_0x33060b(0x1c2)]({'lockKey':_0xb0af39['lockKey'],'filePath':_0xb0af39['filePath'],'remoteId':_0x36a265['id']??null,'status':_0x1e3f0d?'conflict':_0x33060b(0x1dd)});}return{'method':_0x33060b(0x1d6),'url':_0x33060b(0x1ec)+_0x57f370[_0x33060b(0x1f3)]+(_0x522240?_0x33060b(0x1eb)+_0x522240:''),'body':{'appCode':_0x57f370['appCode'],'filterType':_0x522240??null,'files':_0x4871e3},'description':'Would\x20inspect\x20'+_0x4871e3[_0x33060b(0x1db)]+_0x33060b(0x1d8)};},async 'execute'(_0x51b52d){const _0x11e8ac=a30_0x5f3016,_0x2a1dfd=loadBffProjectConfig(_0x51b52d[_0x11e8ac(0x1f3)]),_0x12dc67=await readBffLockFile(_0x2a1dfd[_0x11e8ac(0x1ca)]),{lockData:_0x274d9b,appLock:_0x3f0af8}=ensureLockScope(_0x12dc67??createEmptyBffLock(),_0x51b52d[_0x11e8ac(0x1f3)],_0x2a1dfd[_0x11e8ac(0x1c9)],_0x11e8ac(0x1d0)),_0x262d98=normalizeBffType(_0x51b52d[_0x11e8ac(0x1c3)](_0x11e8ac(0x1f2)))??undefined;if(_0x51b52d['str'](_0x11e8ac(0x1f2))&&!_0x262d98)throw CliErrors['validation'](_0x11e8ac(0x1e0));const [_0x1613aa,_0x569d16]=await Promise[_0x11e8ac(0x1f6)]([listBffScripts(_0x51b52d[_0x11e8ac(0x1f3)],_0x262d98),getBffScriptStatistics(_0x51b52d[_0x11e8ac(0x1f3)])]);if(_0x1613aa[_0x11e8ac(0x1db)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x11e8ac(0x1f8)};const _0x10bd27=_0x51b52d[_0x11e8ac(0x1e9)](_0x11e8ac(0x1d7));if(_0x10bd27&&!_0x51b52d[_0x11e8ac(0x1ce)]){const _0x2ce1ca=await confirmForce();if(!_0x2ce1ca)throw CliErrors['cancelled'](_0x11e8ac(0x1fb));}if(_0x10bd27&&_0x51b52d[_0x11e8ac(0x1ce)]){}const _0x369df5=buildDatasetCodeToAliasMap(_0x51b52d['apiDir'],_0x51b52d['appCode']),_0xcd300c=createHookLocationMap(_0x569d16),_0x2163b3=JSON['parse'](JSON[_0x11e8ac(0x1de)](_0x274d9b)),_0x21cf28=_0x51b52d[_0x11e8ac(0x1f3)],_0x4e8fb6=_0x2163b3[_0x11e8ac(0x1ed)][_0x21cf28];if(!_0x4e8fb6)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x21cf28+_0x11e8ac(0x1b7));const _0x58612b=[],_0x7e8a7=[],_0x1eeda9=[];for(const _0x51b4f2 of _0x1613aa){const _0x3e8480=resolveRemoteScriptTarget(_0x2a1dfd,_0x51b4f2,_0xcd300c,_0x3f0af8[_0x11e8ac(0x1df)],_0x369df5);if(!_0x3e8480){_0x7e8a7['push']({'lockKey':_0x51b4f2[_0x11e8ac(0x1da)]+'/'+_0x51b4f2[_0x11e8ac(0x1f5)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x446bee=_0x3f0af8['functions'][_0x3e8480[_0x11e8ac(0x1ee)]];try{if(!_0x51b4f2['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x51b4f2['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x495c9f=_0x51b4f2[_0x11e8ac(0x1c4)],_0x5f1dd7=computeContentHash(_0x495c9f);if(!_0x10bd27){const _0x5d2722=await hasUnsyncedLocalChanges(_0x3e8480['filePath'],_0x446bee,_0x5f1dd7);if(_0x5d2722){_0x7e8a7[_0x11e8ac(0x1c2)]({'lockKey':_0x3e8480['lockKey'],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x3e8480[_0x11e8ac(0x1ea)]),await writeFile(_0x3e8480[_0x11e8ac(0x1ea)],_0x495c9f,_0x11e8ac(0x1c0));const _0x19b119={'hash':_0x5f1dd7,'remoteId':_0x51b4f2['id'],'version':_0x51b4f2[_0x11e8ac(0x1c7)]};_0x3e8480['type']===_0x11e8ac(0x1e8)&&_0x3e8480['hookLocation']&&(_0x19b119[_0x11e8ac(0x1f4)]=_0x3e8480['hookLocation'][_0x11e8ac(0x1f4)],_0x19b119[_0x11e8ac(0x1e4)]=_0x3e8480[_0x11e8ac(0x1cb)][_0x11e8ac(0x1e4)],_0x19b119[_0x11e8ac(0x1e6)]=_0x3e8480[_0x11e8ac(0x1cb)][_0x11e8ac(0x1e6)],_0x19b119['functionNode']=_0x3e8480[_0x11e8ac(0x1cb)]['functionNode']),_0x4e8fb6[_0x11e8ac(0x1df)][_0x3e8480[_0x11e8ac(0x1ee)]]=_0x19b119,_0x58612b['push']({'lockKey':_0x3e8480[_0x11e8ac(0x1ee)],'remoteId':_0x51b4f2['id']});}catch(_0x5ca625){_0x1eeda9[_0x11e8ac(0x1c2)]({'lockKey':_0x3e8480[_0x11e8ac(0x1ee)],'error':_0x5ca625 instanceof Error?_0x5ca625[_0x11e8ac(0x1e5)]:String(_0x5ca625)});}}return _0x4e8fb6[_0x11e8ac(0x1cc)]=new Date()[_0x11e8ac(0x1f9)](),await writeBffLockFile(_0x2a1dfd[_0x11e8ac(0x1ca)],_0x2163b3),{'ok':_0x1eeda9[_0x11e8ac(0x1db)]===0x0,'data':{'pulled':_0x58612b,'skipped':_0x7e8a7,'failed':_0x1eeda9},'message':_0x11e8ac(0x1e1)+_0x58612b[_0x11e8ac(0x1db)]+_0x11e8ac(0x1ba)+_0x7e8a7[_0x11e8ac(0x1db)]+_0x11e8ac(0x1d9)+_0x1eeda9[_0x11e8ac(0x1db)]+_0x11e8ac(0x1b8)};}};async function hasUnsyncedLocalChanges(_0x2a25f7,_0xd6a33,_0x42ab2d){if(!await fileExists(_0x2a25f7))return![];const _0x2e64e4=await computeFileHash(_0x2a25f7);if(!_0xd6a33)return _0x42ab2d?_0x2e64e4!==_0x42ab2d:!![];return _0x2e64e4!==_0xd6a33['hash'];}function buildDatasetCodeToAliasMap(_0xb5cbe6,_0x34f37c){const _0xf211=a30_0x5f3016,_0x2c6dbb=loadAliasMap(_0xb5cbe6,undefined,resolveApiFilePath(_0xb5cbe6,_0x34f37c));return new Map(_0x2c6dbb['map'](_0x5402b0=>[_0x5402b0[_0xf211(0x1e4)],_0x5402b0[_0xf211(0x1f4)]]));}function a30_0x2366(_0x2aa91a,_0x4faa07){_0x2aa91a=_0x2aa91a-0x1b7;const _0x414237=a30_0x4142();let _0x236693=_0x414237[_0x2aa91a];return _0x236693;}async function confirmForce(){const _0xad9eb0=a30_0x5f3016,_0x48e30f=createInterface({'input':process[_0xad9eb0(0x1fa)],'output':process[_0xad9eb0(0x1c5)]}),_0x434680=await new Promise(_0x4b06b8=>{const _0x26b67f=_0xad9eb0;_0x48e30f[_0x26b67f(0x1e3)](_0x26b67f(0x1be),_0x4b06b8);});return _0x48e30f[_0xad9eb0(0x1b9)](),['y',_0xad9eb0(0x1e7)]['includes'](_0x434680['trim']()['toLowerCase']());}
1
+ const a30_0x222e80=a30_0x5b78;(function(_0x305bef,_0x233707){const _0x298010=a30_0x5b78,_0x3ee075=_0x305bef();while(!![]){try{const _0xebeec1=parseInt(_0x298010(0x1a2))/0x1+parseInt(_0x298010(0x1db))/0x2+parseInt(_0x298010(0x1d7))/0x3+-parseInt(_0x298010(0x1d0))/0x4*(-parseInt(_0x298010(0x1b6))/0x5)+parseInt(_0x298010(0x1a3))/0x6+-parseInt(_0x298010(0x1d2))/0x7+parseInt(_0x298010(0x1cb))/0x8*(-parseInt(_0x298010(0x19a))/0x9);if(_0xebeec1===_0x233707)break;else _0x3ee075['push'](_0x3ee075['shift']());}catch(_0x27c335){_0x3ee075['push'](_0x3ee075['shift']());}}}(a30_0x5810,0x9d273));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{resolveApiFilePath}from'../../context.js';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':a30_0x222e80(0x1dd),'command':'pull','description':a30_0x222e80(0x1b7),'risk':a30_0x222e80(0x1d6),'flags':[{'name':a30_0x222e80(0x1a9),'type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a30_0x222e80(0x1b1),a30_0x222e80(0x1b9),a30_0x222e80(0x1e1)]},{'name':a30_0x222e80(0x19d),'type':a30_0x222e80(0x1bb),'description':a30_0x222e80(0x1c7)}],async 'dryRun'(_0xd2d26){const _0x1bc43a=a30_0x222e80,_0x1788d7=loadBffProjectConfig(_0xd2d26['appCode']),_0x56a154=await readBffLockFile(_0x1788d7['lockFilePath']),{appLock:_0x2b77e9}=ensureLockScope(_0x56a154??createEmptyBffLock(),_0xd2d26[_0x1bc43a(0x1a5)],_0x1788d7[_0x1bc43a(0x1df)],_0x1bc43a(0x1ce)),_0x5a9aa4=normalizeBffType(_0xd2d26[_0x1bc43a(0x1d4)]('type'))??undefined,_0x36714d=buildDatasetCodeToAliasMap(_0xd2d26[_0x1bc43a(0x1cf)],_0xd2d26[_0x1bc43a(0x1a5)]),[_0x5cf490,_0x5bb380]=await Promise[_0x1bc43a(0x19e)]([listBffScripts(_0xd2d26[_0x1bc43a(0x1a5)],_0x5a9aa4),getBffScriptStatistics(_0xd2d26[_0x1bc43a(0x1a5)])]),_0x50087c=createHookLocationMap(_0x5bb380),_0xfd0f3a=[];for(const _0x31e030 of _0x5cf490){const _0x91bf17=resolveRemoteScriptTarget(_0x1788d7,_0x31e030,_0x50087c,_0x2b77e9[_0x1bc43a(0x1cc)],_0x36714d);if(!_0x91bf17){_0xfd0f3a['push']({'scriptType':_0x31e030[_0x1bc43a(0x1de)],'functionName':_0x31e030['functionName']??'','status':_0x1bc43a(0x1dc),'reason':'unresolvable\x20target\x20path'});continue;}const _0x150de7=_0x2b77e9[_0x1bc43a(0x1cc)][_0x91bf17[_0x1bc43a(0x1af)]],_0x3f7091=_0x31e030['scriptContent']!=null?computeContentHash(_0x31e030[_0x1bc43a(0x1d5)]):undefined,_0x534c64=await hasUnsyncedLocalChanges(_0x91bf17['filePath'],_0x150de7,_0x3f7091);_0xfd0f3a[_0x1bc43a(0x1a1)]({'lockKey':_0x91bf17[_0x1bc43a(0x1af)],'filePath':_0x91bf17[_0x1bc43a(0x1be)],'remoteId':_0x31e030['id']??null,'status':_0x534c64?_0x1bc43a(0x1cd):_0x1bc43a(0x1c4)});}return{'method':_0x1bc43a(0x1c5),'url':'/api/management/library/scripts/list?appCode='+_0xd2d26[_0x1bc43a(0x1a5)]+(_0x5a9aa4?'&type='+_0x5a9aa4:''),'body':{'appCode':_0xd2d26[_0x1bc43a(0x1a5)],'filterType':_0x5a9aa4??null,'files':_0xfd0f3a},'description':_0x1bc43a(0x199)+_0xfd0f3a['length']+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x4302b7){const _0x321e8a=a30_0x222e80,_0x31d09d=loadBffProjectConfig(_0x4302b7[_0x321e8a(0x1a5)]),_0x19a3c8=await readBffLockFile(_0x31d09d[_0x321e8a(0x1ad)]),{lockData:_0x307378,appLock:_0x20e152}=ensureLockScope(_0x19a3c8??createEmptyBffLock(),_0x4302b7[_0x321e8a(0x1a5)],_0x31d09d[_0x321e8a(0x1df)],_0x321e8a(0x1ce)),_0x1e1e08=normalizeBffType(_0x4302b7[_0x321e8a(0x1d4)](_0x321e8a(0x1a9)))??undefined;if(_0x4302b7['str'](_0x321e8a(0x1a9))&&!_0x1e1e08)throw CliErrors['validation'](_0x321e8a(0x1a7));const [_0x47e975,_0xa46fee]=await Promise['all']([listBffScripts(_0x4302b7[_0x321e8a(0x1a5)],_0x1e1e08),getBffScriptStatistics(_0x4302b7[_0x321e8a(0x1a5)])]);if(_0x47e975[_0x321e8a(0x1c0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x321e8a(0x1a0)};const _0x580be1=_0x4302b7[_0x321e8a(0x1b0)](_0x321e8a(0x19d));if(_0x580be1&&!_0x4302b7[_0x321e8a(0x1bc)]){const _0x5dbae0=await confirmForce();if(!_0x5dbae0)throw CliErrors[_0x321e8a(0x1bd)](_0x321e8a(0x1b2));}if(_0x580be1&&_0x4302b7[_0x321e8a(0x1bc)]){}const _0xaf2b53=buildDatasetCodeToAliasMap(_0x4302b7[_0x321e8a(0x1cf)],_0x4302b7[_0x321e8a(0x1a5)]),_0x3b9187=createHookLocationMap(_0xa46fee),_0x4ad371=JSON[_0x321e8a(0x1c2)](JSON[_0x321e8a(0x1ab)](_0x307378)),_0x52501d=_0x4302b7[_0x321e8a(0x1a5)],_0x6fa57d=_0x4ad371[_0x321e8a(0x1ac)][_0x52501d];if(!_0x6fa57d)throw new Error(_0x321e8a(0x1b5)+_0x52501d+_0x321e8a(0x1d9));const _0x13d448=[],_0x3917da=[],_0x89fb7d=[];for(const _0xa02e4d of _0x47e975){const _0xfa6cc2=resolveRemoteScriptTarget(_0x31d09d,_0xa02e4d,_0x3b9187,_0x20e152[_0x321e8a(0x1cc)],_0xaf2b53);if(!_0xfa6cc2){_0x3917da['push']({'lockKey':_0xa02e4d[_0x321e8a(0x1de)]+'/'+_0xa02e4d[_0x321e8a(0x1c8)],'reason':_0x321e8a(0x1c1)});continue;}const _0x4e6cbb=_0x20e152[_0x321e8a(0x1cc)][_0xfa6cc2['lockKey']];try{if(!_0xa02e4d['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0xa02e4d['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x494a08=_0xa02e4d[_0x321e8a(0x1d5)],_0xe4a94d=computeContentHash(_0x494a08);if(!_0x580be1){const _0x54b728=await hasUnsyncedLocalChanges(_0xfa6cc2[_0x321e8a(0x1be)],_0x4e6cbb,_0xe4a94d);if(_0x54b728){_0x3917da[_0x321e8a(0x1a1)]({'lockKey':_0xfa6cc2[_0x321e8a(0x1af)],'reason':_0x321e8a(0x1a4)});continue;}}await ensureParentDirectory(_0xfa6cc2[_0x321e8a(0x1be)]),await writeFile(_0xfa6cc2[_0x321e8a(0x1be)],_0x494a08,_0x321e8a(0x1aa));const _0x6daf55={'hash':_0xe4a94d,'remoteId':_0xa02e4d['id'],'version':_0xa02e4d[_0x321e8a(0x1e0)]};_0xfa6cc2[_0x321e8a(0x1a9)]==='HOOK'&&_0xfa6cc2[_0x321e8a(0x1c9)]&&(_0x6daf55[_0x321e8a(0x1ba)]=_0xfa6cc2[_0x321e8a(0x1c9)]['alias'],_0x6daf55[_0x321e8a(0x1b3)]=_0xfa6cc2[_0x321e8a(0x1c9)][_0x321e8a(0x1b3)],_0x6daf55['operationType']=_0xfa6cc2[_0x321e8a(0x1c9)][_0x321e8a(0x1c3)],_0x6daf55[_0x321e8a(0x1c6)]=_0xfa6cc2[_0x321e8a(0x1c9)]['functionNode']),_0x6fa57d[_0x321e8a(0x1cc)][_0xfa6cc2['lockKey']]=_0x6daf55,_0x13d448[_0x321e8a(0x1a1)]({'lockKey':_0xfa6cc2['lockKey'],'remoteId':_0xa02e4d['id']});}catch(_0x4a6bb9){_0x89fb7d['push']({'lockKey':_0xfa6cc2[_0x321e8a(0x1af)],'error':_0x4a6bb9 instanceof Error?_0x4a6bb9[_0x321e8a(0x19b)]:String(_0x4a6bb9)});}}return _0x6fa57d[_0x321e8a(0x1b8)]=new Date()['toISOString'](),await writeBffLockFile(_0x31d09d[_0x321e8a(0x1ad)],_0x4ad371),{'ok':_0x89fb7d[_0x321e8a(0x1c0)]===0x0,'data':{'pulled':_0x13d448,'skipped':_0x3917da,'failed':_0x89fb7d},'message':_0x321e8a(0x19c)+_0x13d448['length']+_0x321e8a(0x1d3)+_0x3917da[_0x321e8a(0x1c0)]+_0x321e8a(0x1da)+_0x89fb7d[_0x321e8a(0x1c0)]+_0x321e8a(0x1b4)};}};async function hasUnsyncedLocalChanges(_0x4c1689,_0x148004,_0x76f011){const _0x23d5d0=a30_0x222e80;if(!await fileExists(_0x4c1689))return![];const _0x2fae5f=await computeFileHash(_0x4c1689);if(!_0x148004)return _0x76f011?_0x2fae5f!==_0x76f011:!![];return _0x2fae5f!==_0x148004[_0x23d5d0(0x1a6)];}function buildDatasetCodeToAliasMap(_0x1079fe,_0xf3a005){const _0x45ef42=a30_0x222e80,_0x26f937=loadAliasMap(_0x1079fe,undefined,resolveApiFilePath(_0x1079fe,_0xf3a005));return new Map(_0x26f937[_0x45ef42(0x1a8)](_0x187dab=>[_0x187dab['datasetCode'],_0x187dab[_0x45ef42(0x1ba)]]));}async function confirmForce(){const _0x2297b8=a30_0x222e80,_0x2f151f=createInterface({'input':process[_0x2297b8(0x1ae)],'output':process['stderr']}),_0x25bbd1=await new Promise(_0x4aebfe=>{const _0x77a5ba=_0x2297b8;_0x2f151f[_0x77a5ba(0x1ca)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x4aebfe);});return _0x2f151f[_0x2297b8(0x1bf)](),['y','yes'][_0x2297b8(0x19f)](_0x25bbd1[_0x2297b8(0x1d1)]()[_0x2297b8(0x1d8)]());}function a30_0x5b78(_0x57ce98,_0x1edc89){_0x57ce98=_0x57ce98-0x199;const _0x581009=a30_0x5810();let _0x5b7855=_0x581009[_0x57ce98];return _0x5b7855;}function a30_0x5810(){const _0x3465af=['nonInteractive','cancelled','filePath','close','length','unresolvable\x20target\x20path','parse','operationType','would_pull','GET','functionNode','Force\x20overwrite\x20local\x20unsynced\x20changes','functionName','hookLocation','question','2655888NSvgqA','functions','conflict','pull','apiDir','12BmlQLs','trim','1897623NKJTRr','\x20pulled,\x20','str','scriptContent','write','1027971ZGLqNU','toLowerCase','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20skipped,\x20','866548tgFJXJ','skipped','bff','scriptType','scriptsRoot','version','HOOK','Would\x20inspect\x20','63ZeLBpE','message','Pull\x20complete:\x20','force','all','includes','No\x20remote\x20BFF\x20scripts\x20found.','push','155788EIuzCa','7662966jfvloS','local\x20unsynced\x20changes','appCode','hash','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','map','type','utf8','stringify','apps','lockFilePath','stdin','lockKey','bool','COMMON','Force\x20pull\x20cancelled.','datasetCode','\x20failed','Lock\x20scope\x20for\x20app\x20\x22','1716350mbCQyc','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','lastSync','ENDPOINT','alias','boolean'];a30_0x5810=function(){return _0x3465af;};return a30_0x5810();}
@@ -1 +1 @@
1
- const a31_0x1e5aee=a31_0x1453;(function(_0x359e57,_0x1369fa){const _0x3c7204=a31_0x1453,_0x294598=_0x359e57();while(!![]){try{const _0xf81189=parseInt(_0x3c7204(0x173))/0x1+-parseInt(_0x3c7204(0x172))/0x2+parseInt(_0x3c7204(0x167))/0x3*(parseInt(_0x3c7204(0x183))/0x4)+-parseInt(_0x3c7204(0x16d))/0x5*(parseInt(_0x3c7204(0x15e))/0x6)+-parseInt(_0x3c7204(0x149))/0x7+parseInt(_0x3c7204(0x182))/0x8+parseInt(_0x3c7204(0x178))/0x9;if(_0xf81189===_0x1369fa)break;else _0x294598['push'](_0x294598['shift']());}catch(_0x47c48e){_0x294598['push'](_0x294598['shift']());}}}(a31_0x9fe3,0x48509));function a31_0x1453(_0x4091da,_0x40fb8a){_0x4091da=_0x4091da-0x147;const _0x9fe353=a31_0x9fe3();let _0x145316=_0x9fe353[_0x4091da];return _0x145316;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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';import{CLI_BIN_NAME}from'../../constant/cli.js';function a31_0x9fe3(){const _0x314bbf=['apiDir','aliasToDatasetCode','remoteId','scriptsRoot','bool','159051TWQOws','unchanged','\x20failed','Local\x20function\x20not\x20found:\x20','ENDPOINT','force','558185UyYDQS','No\x20local\x20BFF\x20functions\x20found.','Push\x20local\x20BFF\x20scripts\x20to\x20remote','\x20local\x20BFF\x20script(s)\x20for\x20push','get','677150HUFMGg','77356tUFbXM','create','operationType','code','Would\x20inspect\x20','12116565HAQhUM','\x20uploaded,\x20','bff','type','\x20skipped,\x20','update','/api/management/library/scripts/save','validation','alias','length','584856RAobMk','4PxlrQi','lastSync','POST','Run\x20`','functionNode','name','push','Push\x20only\x20this\x20script\x20type','HOOK','version','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','2497628oPYfpt','Push\x20complete:\x20','description','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','values','has','filePath','lockFilePath','string','Cannot\x20resolve\x20dataset\x20for\x20\x22','utf8','some','datasetCodeToId','appCode','lockKey','high-risk-write','hash','message','set','str','datasetCode','30pasQny','filter','functions','map'];a31_0x9fe3=function(){return _0x314bbf;};return a31_0x9fe3();}export const bffPush={'service':a31_0x1e5aee(0x17a),'command':a31_0x1e5aee(0x189),'description':a31_0x1e5aee(0x16f),'risk':a31_0x1e5aee(0x158),'flags':[{'name':'type','type':'string','description':a31_0x1e5aee(0x18a),'enum':['COMMON',a31_0x1e5aee(0x16b),'HOOK']},{'name':a31_0x1e5aee(0x188),'type':a31_0x1e5aee(0x151),'description':a31_0x1e5aee(0x14c)},{'name':a31_0x1e5aee(0x16c),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x33e869){const _0x4708b0=a31_0x1e5aee,_0x2c15d7=loadBffProjectConfig(_0x33e869[_0x4708b0(0x156)]),_0x3c20af=await readBffLockFile(_0x2c15d7[_0x4708b0(0x150)]),{appLock:_0x5bef30}=ensureLockScope(_0x3c20af??createEmptyBffLock(),_0x33e869[_0x4708b0(0x156)],_0x2c15d7[_0x4708b0(0x165)],_0x4708b0(0x189)),_0x7fcf08=await getTargetFunctions(_0x2c15d7,_0x33e869),_0x4a370b=_0x33e869['bool'](_0x4708b0(0x16c)),_0x8324b6=[];for(const _0x2d2522 of _0x7fcf08){const _0x569472=await computeFileHash(_0x2d2522[_0x4708b0(0x14f)]),_0x345f9f=_0x5bef30['functions'][_0x2d2522['lockKey']],_0x39a183=!!_0x345f9f&&_0x345f9f[_0x4708b0(0x159)]===_0x569472;_0x8324b6[_0x4708b0(0x189)]({'lockKey':_0x2d2522[_0x4708b0(0x157)],'filePath':_0x2d2522[_0x4708b0(0x14f)],'remoteId':_0x345f9f?.[_0x4708b0(0x164)]??null,'mode':_0x345f9f?.['remoteId']?_0x4708b0(0x17d):_0x4708b0(0x174),'status':!_0x4a370b&&_0x39a183?_0x4708b0(0x168):'would_push'});}return{'method':_0x4708b0(0x185),'url':_0x4708b0(0x17e),'body':{'appCode':_0x33e869['appCode'],'force':_0x4a370b,'files':_0x8324b6},'description':_0x4708b0(0x177)+_0x8324b6[_0x4708b0(0x181)]+_0x4708b0(0x170)};},async 'execute'(_0x10ad24){const _0x4c5240=a31_0x1e5aee,_0x3782e3=loadBffProjectConfig(_0x10ad24[_0x4c5240(0x156)]),_0x4efe49=await readBffLockFile(_0x3782e3[_0x4c5240(0x150)]),{lockData:_0x4304a4,appLock:_0x4e748a}=ensureLockScope(_0x4efe49??createEmptyBffLock(),_0x10ad24[_0x4c5240(0x156)],_0x3782e3[_0x4c5240(0x165)],_0x4c5240(0x189)),_0x3c271e=await getTargetFunctions(_0x3782e3,_0x10ad24);if(_0x3c271e[_0x4c5240(0x181)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x4c5240(0x16e)};const _0x40e229=_0x10ad24[_0x4c5240(0x166)](_0x4c5240(0x16c)),_0x8133ca=await buildHookMaps(_0x10ad24['appCode'],_0x10ad24[_0x4c5240(0x162)],_0x3c271e,_0x4e748a),_0x5ece4c=[],_0x5b0de4=[],_0x26e999=[];for(const _0x5aa655 of _0x3c271e){const _0xbd5c40=await computeFileHash(_0x5aa655[_0x4c5240(0x14f)]),_0x16c3af=_0x4e748a[_0x4c5240(0x160)][_0x5aa655[_0x4c5240(0x157)]];if(!_0x40e229&&_0x16c3af&&_0x16c3af[_0x4c5240(0x159)]===_0xbd5c40){_0x5b0de4[_0x4c5240(0x189)]({'lockKey':_0x5aa655[_0x4c5240(0x157)],'reason':_0x4c5240(0x168)});continue;}try{await uploadSingleFunction(_0x10ad24[_0x4c5240(0x156)],_0x5aa655,_0x4e748a,_0x8133ca);const _0xad56bb=_0x4e748a[_0x4c5240(0x160)][_0x5aa655[_0x4c5240(0x157)]];_0x5ece4c[_0x4c5240(0x189)]({'lockKey':_0x5aa655[_0x4c5240(0x157)],'remoteId':_0xad56bb?.[_0x4c5240(0x164)]??0x0});}catch(_0xa210ce){_0x26e999[_0x4c5240(0x189)]({'lockKey':_0x5aa655[_0x4c5240(0x157)],'error':_0xa210ce instanceof Error?_0xa210ce[_0x4c5240(0x15a)]:String(_0xa210ce)});}}return _0x4e748a[_0x4c5240(0x184)]=new Date()['toISOString'](),await writeBffLockFile(_0x3782e3[_0x4c5240(0x150)],_0x4304a4),{'ok':_0x26e999[_0x4c5240(0x181)]===0x0,'data':{'uploaded':_0x5ece4c,'skipped':_0x5b0de4,'failed':_0x26e999},'message':_0x4c5240(0x14a)+_0x5ece4c[_0x4c5240(0x181)]+_0x4c5240(0x179)+_0x5b0de4[_0x4c5240(0x181)]+_0x4c5240(0x17c)+_0x26e999[_0x4c5240(0x181)]+_0x4c5240(0x169)};}};async function getTargetFunctions(_0x283a5e,_0x265192){const _0x40db79=a31_0x1e5aee,_0x24a79a=_0x265192[_0x40db79(0x15c)]('type'),_0x2d8f57=_0x265192['str'](_0x40db79(0x188)),_0x448c3c=normalizeBffType(_0x24a79a)??undefined;if(_0x2d8f57&&!_0x448c3c)throw CliErrors[_0x40db79(0x17f)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4cd7a0=await scanLocalBffFunctions(_0x283a5e,_0x448c3c);if(_0x2d8f57){const _0x505eaf=_0x4cd7a0[_0x40db79(0x15f)](_0x1afe82=>_0x1afe82[_0x40db79(0x188)]===_0x2d8f57);if(_0x505eaf[_0x40db79(0x181)]===0x0)throw CliErrors['validation'](_0x40db79(0x16a)+_0x448c3c+'/'+_0x2d8f57);return _0x505eaf;}return _0x4cd7a0;}async function buildHookMaps(_0x53722a,_0x4cddab,_0x3bbeb2,_0xf2f169){const _0x3d612f=a31_0x1e5aee,_0x126803=_0x3bbeb2[_0x3d612f(0x154)](_0x38e559=>_0x38e559[_0x3d612f(0x17b)]==='HOOK');if(!_0x126803)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x2121aa=loadAliasMap(_0x4cddab,undefined,resolveApiFilePath(_0x4cddab,_0x53722a)),_0x16eab3=new Map(_0x2121aa[_0x3d612f(0x161)](_0x4f7533=>[_0x4f7533[_0x3d612f(0x180)],_0x4f7533[_0x3d612f(0x15d)]]));for(const _0x114a4a of Object[_0x3d612f(0x14d)](_0xf2f169[_0x3d612f(0x160)])){_0x114a4a['alias']&&_0x114a4a[_0x3d612f(0x15d)]&&!_0x16eab3[_0x3d612f(0x14e)](_0x114a4a['alias'])&&_0x16eab3[_0x3d612f(0x15b)](_0x114a4a[_0x3d612f(0x180)],_0x114a4a[_0x3d612f(0x15d)]);}const _0x41b7e7=await listDatasets(_0x53722a),_0x33c661=new Map(_0x41b7e7[_0x3d612f(0x161)](_0x1c440b=>[_0x1c440b[_0x3d612f(0x176)],_0x1c440b['id']]));return{'aliasToDatasetCode':_0x16eab3,'datasetCodeToId':_0x33c661};}async function uploadSingleFunction(_0x53b66a,_0x2632c9,_0x5bc058,_0x367b6d){const _0x4a14e8=a31_0x1e5aee,_0x43df12=await readFile(_0x2632c9[_0x4a14e8(0x14f)],_0x4a14e8(0x153)),_0x51cae0=await computeFileHash(_0x2632c9[_0x4a14e8(0x14f)]),_0xe84e0b=_0x5bc058[_0x4a14e8(0x160)][_0x2632c9[_0x4a14e8(0x157)]];if(_0xe84e0b?.[_0x4a14e8(0x164)]&&_0xe84e0b[_0x4a14e8(0x147)]==null)throw CliErrors[_0x4a14e8(0x17f)](_0x2632c9[_0x4a14e8(0x157)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x2cb1d1=extractScriptDescription(_0x43df12);if(!_0x2cb1d1&&_0xe84e0b?.['remoteId']){const _0x1f0b57=await getBffScriptInfo(_0xe84e0b[_0x4a14e8(0x164)]);_0x2cb1d1=_0x1f0b57[_0x4a14e8(0x14b)]||undefined;}const _0x4aa874={'appCode':_0x53b66a,'functionName':_0x2632c9[_0x4a14e8(0x188)],'scriptType':_0x2632c9['type'],'scriptContent':_0x43df12};if(_0xe84e0b?.[_0x4a14e8(0x164)])_0x4aa874['id']=_0xe84e0b[_0x4a14e8(0x164)];if(_0xe84e0b?.[_0x4a14e8(0x147)]!=null)_0x4aa874['version']=_0xe84e0b[_0x4a14e8(0x147)];if(_0x2cb1d1)_0x4aa874[_0x4a14e8(0x14b)]=_0x2cb1d1;if(_0x2632c9[_0x4a14e8(0x17b)]===_0x4a14e8(0x18b)){const _0x146cf1=_0x2632c9[_0x4a14e8(0x180)];if(!_0x146cf1||!_0x2632c9[_0x4a14e8(0x175)]||!_0x2632c9[_0x4a14e8(0x187)])throw CliErrors[_0x4a14e8(0x17f)]('Incomplete\x20HOOK\x20path:\x20'+_0x2632c9['lockKey']);const _0x2b8e28=_0x367b6d[_0x4a14e8(0x163)]['get'](_0x146cf1)??_0xe84e0b?.[_0x4a14e8(0x15d)]??_0x146cf1,_0x5c7c6b=_0x367b6d[_0x4a14e8(0x155)]['get'](_0x2b8e28);if(!_0x5c7c6b)throw CliErrors['validation'](_0x4a14e8(0x152)+_0x146cf1+'\x22.\x20'+(_0x4a14e8(0x186)+CLI_BIN_NAME+_0x4a14e8(0x148)));_0x4aa874['datasetId']=_0x5c7c6b,_0x4aa874[_0x4a14e8(0x175)]=_0x2632c9['operationType'],_0x4aa874[_0x4a14e8(0x187)]=_0x2632c9[_0x4a14e8(0x187)];}const _0xcbafa3=await saveBffScript(_0x4aa874),_0x108651=await getBffScriptInfo(_0xcbafa3),_0x13d31b={'hash':_0x51cae0,'remoteId':_0xcbafa3,'version':_0x108651[_0x4a14e8(0x147)]};if(_0x2632c9[_0x4a14e8(0x17b)]===_0x4a14e8(0x18b)){const _0x3b1b9a=_0x2632c9[_0x4a14e8(0x180)],_0x16b879=_0x367b6d['aliasToDatasetCode'][_0x4a14e8(0x171)](_0x3b1b9a)??_0xe84e0b?.[_0x4a14e8(0x15d)]??_0x3b1b9a;_0x367b6d[_0x4a14e8(0x163)][_0x4a14e8(0x14e)](_0x3b1b9a)?_0x13d31b[_0x4a14e8(0x180)]=_0x3b1b9a:_0x13d31b[_0x4a14e8(0x180)]=_0xe84e0b?.['alias'],_0x13d31b['datasetCode']=_0x16b879,_0x13d31b['operationType']=_0x2632c9[_0x4a14e8(0x175)],_0x13d31b[_0x4a14e8(0x187)]=_0x2632c9['functionNode'];}_0x5bc058[_0x4a14e8(0x160)][_0x2632c9[_0x4a14e8(0x157)]]=_0x13d31b;}
1
+ const a31_0x11b2ce=a31_0x5b21;(function(_0xbed07e,_0x5bde8e){const _0x392537=a31_0x5b21,_0x5396e9=_0xbed07e();while(!![]){try{const _0x9572c=-parseInt(_0x392537(0x140))/0x1*(-parseInt(_0x392537(0x142))/0x2)+-parseInt(_0x392537(0x14b))/0x3*(-parseInt(_0x392537(0x162))/0x4)+-parseInt(_0x392537(0x136))/0x5*(-parseInt(_0x392537(0x165))/0x6)+-parseInt(_0x392537(0x157))/0x7*(parseInt(_0x392537(0x161))/0x8)+-parseInt(_0x392537(0x141))/0x9*(parseInt(_0x392537(0x13c))/0xa)+parseInt(_0x392537(0x139))/0xb*(-parseInt(_0x392537(0x152))/0xc)+parseInt(_0x392537(0x131))/0xd*(parseInt(_0x392537(0x168))/0xe);if(_0x9572c===_0x5bde8e)break;else _0x5396e9['push'](_0x5396e9['shift']());}catch(_0x3aa2b3){_0x5396e9['push'](_0x5396e9['shift']());}}}(a31_0x5939,0x684e1));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a31_0x5939(){const _0x3e3bb3=['Cannot\x20resolve\x20dataset\x20for\x20\x22','aliasToDatasetCode','operationType','message','length','filePath','107136hfqnPD','toISOString','Local\x20function\x20not\x20found:\x20','Run\x20`','create','7mMuEVM','Push\x20complete:\x20','lastSync','Incomplete\x20HOOK\x20path:\x20','\x20skipped,\x20','type','scriptsRoot','version','Push\x20only\x20this\x20script\x20type','has','6831192Faroxr','1991172vvLMAp','boolean','string','472218THrtPV','datasetCode','alias','288204zZcvcF','filter','name','Push\x20local\x20BFF\x20scripts\x20to\x20remote','force','appCode','apiDir','update','validation','datasetId','bff','ENDPOINT',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','hash','Would\x20inspect\x20','remoteId','str','functionNode','POST','high-risk-write','HOOK','unchanged','182oxyyCD','would_push','bool','COMMON','lockFilePath','35zffFJJ','description','\x20uploaded,\x20','1045zUrDpu','set','functions','239150CqNbAc','code','datasetCodeToId','get','48017FtqnxF','9bOMwXA','34vMQCdw','map','\x20failed','\x20local\x20BFF\x20script(s)\x20for\x20push','No\x20local\x20BFF\x20functions\x20found.','lockKey','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','push','some','3OQVRru'];a31_0x5939=function(){return _0x3e3bb3;};return a31_0x5939();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a31_0x11b2ce(0x125),'command':a31_0x11b2ce(0x149),'description':a31_0x11b2ce(0x11e),'risk':a31_0x11b2ce(0x12e),'flags':[{'name':'type','type':a31_0x11b2ce(0x164),'description':a31_0x11b2ce(0x15f),'enum':[a31_0x11b2ce(0x134),a31_0x11b2ce(0x126),a31_0x11b2ce(0x12f)]},{'name':a31_0x11b2ce(0x11d),'type':'string','description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a31_0x11b2ce(0x11f),'type':a31_0x11b2ce(0x163),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x346750){const _0x14e8ed=a31_0x11b2ce,_0x19798a=loadBffProjectConfig(_0x346750[_0x14e8ed(0x120)]),_0x36cacb=await readBffLockFile(_0x19798a[_0x14e8ed(0x135)]),{appLock:_0x40349f}=ensureLockScope(_0x36cacb??createEmptyBffLock(),_0x346750[_0x14e8ed(0x120)],_0x19798a['scriptsRoot'],'push'),_0x4c79ae=await getTargetFunctions(_0x19798a,_0x346750),_0x162c5d=_0x346750[_0x14e8ed(0x133)]('force'),_0x2b3b8f=[];for(const _0x3a1eda of _0x4c79ae){const _0x4d50ba=await computeFileHash(_0x3a1eda[_0x14e8ed(0x151)]),_0x4d36de=_0x40349f[_0x14e8ed(0x13b)][_0x3a1eda[_0x14e8ed(0x147)]],_0x1b2db8=!!_0x4d36de&&_0x4d36de[_0x14e8ed(0x128)]===_0x4d50ba;_0x2b3b8f[_0x14e8ed(0x149)]({'lockKey':_0x3a1eda[_0x14e8ed(0x147)],'filePath':_0x3a1eda[_0x14e8ed(0x151)],'remoteId':_0x4d36de?.[_0x14e8ed(0x12a)]??null,'mode':_0x4d36de?.[_0x14e8ed(0x12a)]?_0x14e8ed(0x122):_0x14e8ed(0x156),'status':!_0x162c5d&&_0x1b2db8?_0x14e8ed(0x130):_0x14e8ed(0x132)});}return{'method':_0x14e8ed(0x12d),'url':'/api/management/library/scripts/save','body':{'appCode':_0x346750['appCode'],'force':_0x162c5d,'files':_0x2b3b8f},'description':_0x14e8ed(0x129)+_0x2b3b8f['length']+_0x14e8ed(0x145)};},async 'execute'(_0x10fb97){const _0x42c6e5=a31_0x11b2ce,_0x27b507=loadBffProjectConfig(_0x10fb97[_0x42c6e5(0x120)]),_0x386598=await readBffLockFile(_0x27b507[_0x42c6e5(0x135)]),{lockData:_0x2a2c4d,appLock:_0x562bbe}=ensureLockScope(_0x386598??createEmptyBffLock(),_0x10fb97['appCode'],_0x27b507[_0x42c6e5(0x15d)],_0x42c6e5(0x149)),_0x13274e=await getTargetFunctions(_0x27b507,_0x10fb97);if(_0x13274e[_0x42c6e5(0x150)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x42c6e5(0x146)};const _0x5b36e6=_0x10fb97[_0x42c6e5(0x133)]('force'),_0x3826ee=await buildHookMaps(_0x10fb97[_0x42c6e5(0x120)],_0x10fb97[_0x42c6e5(0x121)],_0x13274e,_0x562bbe),_0x2e4511=[],_0xf1576c=[],_0xb6b087=[];for(const _0x272ee3 of _0x13274e){const _0x498b98=await computeFileHash(_0x272ee3[_0x42c6e5(0x151)]),_0x2362c3=_0x562bbe[_0x42c6e5(0x13b)][_0x272ee3[_0x42c6e5(0x147)]];if(!_0x5b36e6&&_0x2362c3&&_0x2362c3['hash']===_0x498b98){_0xf1576c[_0x42c6e5(0x149)]({'lockKey':_0x272ee3[_0x42c6e5(0x147)],'reason':_0x42c6e5(0x130)});continue;}try{await uploadSingleFunction(_0x10fb97[_0x42c6e5(0x120)],_0x272ee3,_0x562bbe,_0x3826ee);const _0x3bbf33=_0x562bbe[_0x42c6e5(0x13b)][_0x272ee3['lockKey']];_0x2e4511[_0x42c6e5(0x149)]({'lockKey':_0x272ee3[_0x42c6e5(0x147)],'remoteId':_0x3bbf33?.[_0x42c6e5(0x12a)]??0x0});}catch(_0x46192b){_0xb6b087[_0x42c6e5(0x149)]({'lockKey':_0x272ee3[_0x42c6e5(0x147)],'error':_0x46192b instanceof Error?_0x46192b[_0x42c6e5(0x14f)]:String(_0x46192b)});}}return _0x562bbe[_0x42c6e5(0x159)]=new Date()[_0x42c6e5(0x153)](),await writeBffLockFile(_0x27b507[_0x42c6e5(0x135)],_0x2a2c4d),{'ok':_0xb6b087['length']===0x0,'data':{'uploaded':_0x2e4511,'skipped':_0xf1576c,'failed':_0xb6b087},'message':_0x42c6e5(0x158)+_0x2e4511[_0x42c6e5(0x150)]+_0x42c6e5(0x138)+_0xf1576c[_0x42c6e5(0x150)]+_0x42c6e5(0x15b)+_0xb6b087[_0x42c6e5(0x150)]+_0x42c6e5(0x144)};}};async function getTargetFunctions(_0x3e8ffe,_0xdd2a09){const _0x3f8422=a31_0x11b2ce,_0x713a59=_0xdd2a09['str'](_0x3f8422(0x15c)),_0x42ca8d=_0xdd2a09[_0x3f8422(0x12b)]('name'),_0x4fe330=normalizeBffType(_0x713a59)??undefined;if(_0x42ca8d&&!_0x4fe330)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x59fb5e=await scanLocalBffFunctions(_0x3e8ffe,_0x4fe330);if(_0x42ca8d){const _0x390504=_0x59fb5e[_0x3f8422(0x11c)](_0x216c49=>_0x216c49[_0x3f8422(0x11d)]===_0x42ca8d);if(_0x390504[_0x3f8422(0x150)]===0x0)throw CliErrors[_0x3f8422(0x123)](_0x3f8422(0x154)+_0x4fe330+'/'+_0x42ca8d);return _0x390504;}return _0x59fb5e;}function a31_0x5b21(_0x420e06,_0x4219c3){_0x420e06=_0x420e06-0x11c;const _0x593910=a31_0x5939();let _0x5b2103=_0x593910[_0x420e06];return _0x5b2103;}async function buildHookMaps(_0x7bbfbe,_0x1937aa,_0x349be2,_0x1d296c){const _0x311057=a31_0x11b2ce,_0x12a011=_0x349be2[_0x311057(0x14a)](_0x3845e1=>_0x3845e1['type']==='HOOK');if(!_0x12a011)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x350042=loadAliasMap(_0x1937aa,undefined,resolveApiFilePath(_0x1937aa,_0x7bbfbe)),_0x43362c=new Map(_0x350042[_0x311057(0x143)](_0xeb0b24=>[_0xeb0b24['alias'],_0xeb0b24[_0x311057(0x166)]]));for(const _0x60462a of Object['values'](_0x1d296c[_0x311057(0x13b)])){_0x60462a[_0x311057(0x167)]&&_0x60462a['datasetCode']&&!_0x43362c[_0x311057(0x160)](_0x60462a[_0x311057(0x167)])&&_0x43362c[_0x311057(0x13a)](_0x60462a['alias'],_0x60462a[_0x311057(0x166)]);}const _0x209c50=await listDatasets(_0x7bbfbe),_0x5e5887=new Map(_0x209c50['map'](_0x2efd6f=>[_0x2efd6f[_0x311057(0x13d)],_0x2efd6f['id']]));return{'aliasToDatasetCode':_0x43362c,'datasetCodeToId':_0x5e5887};}async function uploadSingleFunction(_0x379ec5,_0x3b6788,_0x1c5a9d,_0x298ecd){const _0x36b6dd=a31_0x11b2ce,_0x56b648=await readFile(_0x3b6788[_0x36b6dd(0x151)],'utf8'),_0x1580e5=await computeFileHash(_0x3b6788[_0x36b6dd(0x151)]),_0x353346=_0x1c5a9d[_0x36b6dd(0x13b)][_0x3b6788[_0x36b6dd(0x147)]];if(_0x353346?.['remoteId']&&_0x353346[_0x36b6dd(0x15e)]==null)throw CliErrors[_0x36b6dd(0x123)](_0x3b6788[_0x36b6dd(0x147)]+_0x36b6dd(0x127));let _0x3835ed=extractScriptDescription(_0x56b648);if(!_0x3835ed&&_0x353346?.[_0x36b6dd(0x12a)]){const _0x2f590=await getBffScriptInfo(_0x353346[_0x36b6dd(0x12a)]);_0x3835ed=_0x2f590[_0x36b6dd(0x137)]||undefined;}const _0x4216c4={'appCode':_0x379ec5,'functionName':_0x3b6788[_0x36b6dd(0x11d)],'scriptType':_0x3b6788[_0x36b6dd(0x15c)],'scriptContent':_0x56b648};if(_0x353346?.[_0x36b6dd(0x12a)])_0x4216c4['id']=_0x353346[_0x36b6dd(0x12a)];if(_0x353346?.['version']!=null)_0x4216c4[_0x36b6dd(0x15e)]=_0x353346[_0x36b6dd(0x15e)];if(_0x3835ed)_0x4216c4[_0x36b6dd(0x137)]=_0x3835ed;if(_0x3b6788[_0x36b6dd(0x15c)]===_0x36b6dd(0x12f)){const _0x18d676=_0x3b6788[_0x36b6dd(0x167)];if(!_0x18d676||!_0x3b6788[_0x36b6dd(0x14e)]||!_0x3b6788[_0x36b6dd(0x12c)])throw CliErrors[_0x36b6dd(0x123)](_0x36b6dd(0x15a)+_0x3b6788[_0x36b6dd(0x147)]);const _0x25971c=_0x298ecd[_0x36b6dd(0x14d)]['get'](_0x18d676)??_0x353346?.[_0x36b6dd(0x166)]??_0x18d676,_0x1e2209=_0x298ecd[_0x36b6dd(0x13e)][_0x36b6dd(0x13f)](_0x25971c);if(!_0x1e2209)throw CliErrors[_0x36b6dd(0x123)](_0x36b6dd(0x14c)+_0x18d676+'\x22.\x20'+(_0x36b6dd(0x155)+CLI_BIN_NAME+_0x36b6dd(0x148)));_0x4216c4[_0x36b6dd(0x124)]=_0x1e2209,_0x4216c4[_0x36b6dd(0x14e)]=_0x3b6788[_0x36b6dd(0x14e)],_0x4216c4['functionNode']=_0x3b6788[_0x36b6dd(0x12c)];}const _0x2bb8a9=await saveBffScript(_0x4216c4),_0x8cf15d=await getBffScriptInfo(_0x2bb8a9),_0x3ac9b2={'hash':_0x1580e5,'remoteId':_0x2bb8a9,'version':_0x8cf15d[_0x36b6dd(0x15e)]};if(_0x3b6788[_0x36b6dd(0x15c)]===_0x36b6dd(0x12f)){const _0x5f3873=_0x3b6788[_0x36b6dd(0x167)],_0x1cd918=_0x298ecd['aliasToDatasetCode'][_0x36b6dd(0x13f)](_0x5f3873)??_0x353346?.[_0x36b6dd(0x166)]??_0x5f3873;_0x298ecd[_0x36b6dd(0x14d)][_0x36b6dd(0x160)](_0x5f3873)?_0x3ac9b2[_0x36b6dd(0x167)]=_0x5f3873:_0x3ac9b2[_0x36b6dd(0x167)]=_0x353346?.[_0x36b6dd(0x167)],_0x3ac9b2[_0x36b6dd(0x166)]=_0x1cd918,_0x3ac9b2[_0x36b6dd(0x14e)]=_0x3b6788[_0x36b6dd(0x14e)],_0x3ac9b2[_0x36b6dd(0x12c)]=_0x3b6788[_0x36b6dd(0x12c)];}_0x1c5a9d['functions'][_0x3b6788[_0x36b6dd(0x147)]]=_0x3ac9b2;}
@@ -1 +1 @@
1
- const a32_0x2285cb=a32_0x32f6;(function(_0x4579b3,_0x44642d){const _0x58927b=a32_0x32f6,_0x5c20b0=_0x4579b3();while(!![]){try{const _0x128e46=-parseInt(_0x58927b(0xc0))/0x1*(-parseInt(_0x58927b(0xc8))/0x2)+-parseInt(_0x58927b(0xc1))/0x3*(-parseInt(_0x58927b(0xdb))/0x4)+-parseInt(_0x58927b(0xd5))/0x5+-parseInt(_0x58927b(0xc2))/0x6+-parseInt(_0x58927b(0xce))/0x7*(parseInt(_0x58927b(0xc3))/0x8)+-parseInt(_0x58927b(0xcf))/0x9*(-parseInt(_0x58927b(0xcc))/0xa)+parseInt(_0x58927b(0xd9))/0xb*(parseInt(_0x58927b(0xd7))/0xc);if(_0x128e46===_0x44642d)break;else _0x5c20b0['push'](_0x5c20b0['shift']());}catch(_0x7d267d){_0x5c20b0['push'](_0x5c20b0['shift']());}}}(a32_0x2964,0xcdaa7));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a32_0x32f6(_0x5b96fb,_0x19cc0d){_0x5b96fb=_0x5b96fb-0xbf;const _0x2964e4=a32_0x2964();let _0x32f61c=_0x2964e4[_0x5b96fb];return _0x32f61c;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0x2964(){const _0x316652=['datasetCode','\x20unchanged','\x20modified,\x20','push','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','hash','lockKey','length','28918nLLszv','3yUgVBv','603390hJdcHt','8JNcbQz','status','bff','filePath','All\x20BFF\x20scripts\x20are\x20in\x20sync.','4QiYOCB','appCode','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','2745160xnfMRW','remote','3584434ZKRENL','18bwjOrR','has','all','bool','read','map','3347640UTOCBW','apiDir','12zrEScd','functions','3016937bNTqnk','boolean','4973708EizmCu'];a32_0x2964=function(){return _0x316652;};return a32_0x2964();}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':a32_0x2285cb(0xc5),'command':a32_0x2285cb(0xc4),'description':a32_0x2285cb(0xca),'risk':a32_0x2285cb(0xd3),'flags':[{'name':a32_0x2285cb(0xcd),'type':a32_0x2285cb(0xda),'description':a32_0x2285cb(0xe0)}],async 'execute'(_0x4cac63){const _0x5c514a=a32_0x2285cb,_0xe8af1c=loadBffProjectConfig(_0x4cac63[_0x5c514a(0xc9)]),_0x3ad593=await readBffLockFile(_0xe8af1c[_0x5c514a(0xcb)]),{appLock:_0x52698e}=ensureLockScope(_0x3ad593??createEmptyBffLock(),_0x4cac63[_0x5c514a(0xc9)],_0xe8af1c['scriptsRoot'],_0x5c514a(0xc4)),_0x356634=await scanLocalBffFunctions(_0xe8af1c),_0x288551=[],_0x157acc=[],_0x183e95=[];for(const _0x468b2f of _0x356634){const _0x435e65=await computeFileHash(_0x468b2f[_0x5c514a(0xc6)]),_0x3e34be=_0x52698e[_0x5c514a(0xd8)][_0x468b2f['lockKey']];if(!_0x3e34be)_0x288551[_0x5c514a(0xdf)](_0x468b2f[_0x5c514a(0xe2)]);else _0x3e34be[_0x5c514a(0xe1)]!==_0x435e65?_0x157acc[_0x5c514a(0xdf)](_0x468b2f[_0x5c514a(0xe2)]):_0x183e95[_0x5c514a(0xdf)](_0x468b2f[_0x5c514a(0xe2)]);}const _0x95f68=[];if(_0x4cac63[_0x5c514a(0xd2)](_0x5c514a(0xcd))){const _0x2f983c=loadAliasMap(_0x4cac63[_0x5c514a(0xd6)],undefined,resolveApiFilePath(_0x4cac63[_0x5c514a(0xd6)],_0x4cac63[_0x5c514a(0xc9)])),_0x4e7f50=new Map(_0x2f983c[_0x5c514a(0xd4)](_0x54f3ba=>[_0x54f3ba[_0x5c514a(0xdc)],_0x54f3ba['alias']])),[_0x21ddc2,_0x26481d]=await Promise[_0x5c514a(0xd1)]([listBffScripts(_0x4cac63[_0x5c514a(0xc9)]),getBffScriptStatistics(_0x4cac63['appCode'])]),_0x457fd4=createHookLocationMap(_0x26481d),_0x1d078b=new Set(_0x356634['map'](_0x1c2e74=>_0x1c2e74[_0x5c514a(0xe2)]));for(const _0x1ea74c of _0x21ddc2){const _0x3107e7=resolveRemoteScriptTarget(_0xe8af1c,_0x1ea74c,_0x457fd4,_0x52698e[_0x5c514a(0xd8)],_0x4e7f50);_0x3107e7&&!_0x1d078b[_0x5c514a(0xd0)](_0x3107e7[_0x5c514a(0xe2)])&&_0x95f68[_0x5c514a(0xdf)](_0x3107e7[_0x5c514a(0xe2)]);}}const _0x5c3724=_0x288551['length']===0x0&&_0x157acc[_0x5c514a(0xbf)]===0x0&&_0x95f68[_0x5c514a(0xbf)]===0x0;return{'ok':!![],'data':{'added':_0x288551,'modified':_0x157acc,'unchanged':_0x183e95,'remoteOnly':_0x95f68},'message':_0x5c3724?_0x5c514a(0xc7):_0x288551[_0x5c514a(0xbf)]+'\x20added,\x20'+_0x157acc[_0x5c514a(0xbf)]+_0x5c514a(0xde)+_0x183e95['length']+_0x5c514a(0xdd)+(_0x95f68['length']>0x0?',\x20'+_0x95f68[_0x5c514a(0xbf)]+'\x20remote-only':'')};}};
1
+ const a32_0x4e2b0d=a32_0x2900;(function(_0x16bd4e,_0x277ae7){const _0x842ddf=a32_0x2900,_0x3c179b=_0x16bd4e();while(!![]){try{const _0x2af239=-parseInt(_0x842ddf(0x69))/0x1*(parseInt(_0x842ddf(0x6b))/0x2)+-parseInt(_0x842ddf(0x75))/0x3*(parseInt(_0x842ddf(0x74))/0x4)+parseInt(_0x842ddf(0x78))/0x5*(parseInt(_0x842ddf(0x76))/0x6)+-parseInt(_0x842ddf(0x82))/0x7*(-parseInt(_0x842ddf(0x80))/0x8)+parseInt(_0x842ddf(0x67))/0x9+-parseInt(_0x842ddf(0x79))/0xa+parseInt(_0x842ddf(0x6c))/0xb;if(_0x2af239===_0x277ae7)break;else _0x3c179b['push'](_0x3c179b['shift']());}catch(_0x418e27){_0x3c179b['push'](_0x3c179b['shift']());}}}(a32_0x29e4,0x6db82));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0x29e4(){const _0x3a77b2=['14oWStle','push','2034864SGchay','filePath','7243NUiKRG','\x20modified,\x20','66mucnJM','11827552bUmouF','status','appCode','boolean','lockFilePath','functions','bff','datasetCode','4HqrMcm','2174685AtMZzy','114XFhXNc','scriptsRoot','44565TnQcGW','4777850HojslA','length','map','\x20unchanged','read','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','lockKey','1681736OPhJNL','remote'];a32_0x29e4=function(){return _0x3a77b2;};return a32_0x29e4();}function a32_0x2900(_0x23122c,_0x1ee6d4){_0x23122c=_0x23122c-0x67;const _0x29e469=a32_0x29e4();let _0x290044=_0x29e469[_0x23122c];return _0x290044;}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':a32_0x4e2b0d(0x72),'command':a32_0x4e2b0d(0x6d),'description':a32_0x4e2b0d(0x7e),'risk':a32_0x4e2b0d(0x7d),'flags':[{'name':a32_0x4e2b0d(0x81),'type':a32_0x4e2b0d(0x6f),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x3d952a){const _0x38d060=a32_0x4e2b0d,_0x3a9af5=loadBffProjectConfig(_0x3d952a[_0x38d060(0x6e)]),_0x418abe=await readBffLockFile(_0x3a9af5[_0x38d060(0x70)]),{appLock:_0xda6c99}=ensureLockScope(_0x418abe??createEmptyBffLock(),_0x3d952a['appCode'],_0x3a9af5[_0x38d060(0x77)],_0x38d060(0x6d)),_0x2d228c=await scanLocalBffFunctions(_0x3a9af5),_0x3ab716=[],_0x1cba4c=[],_0x4ad3e5=[];for(const _0x1cc9ed of _0x2d228c){const _0x507711=await computeFileHash(_0x1cc9ed[_0x38d060(0x68)]),_0x3e2ce7=_0xda6c99['functions'][_0x1cc9ed[_0x38d060(0x7f)]];if(!_0x3e2ce7)_0x3ab716[_0x38d060(0x83)](_0x1cc9ed['lockKey']);else _0x3e2ce7['hash']!==_0x507711?_0x1cba4c['push'](_0x1cc9ed['lockKey']):_0x4ad3e5['push'](_0x1cc9ed[_0x38d060(0x7f)]);}const _0x490574=[];if(_0x3d952a['bool']('remote')){const _0x39a1d9=loadAliasMap(_0x3d952a['apiDir'],undefined,resolveApiFilePath(_0x3d952a['apiDir'],_0x3d952a[_0x38d060(0x6e)])),_0x48a6bd=new Map(_0x39a1d9[_0x38d060(0x7b)](_0x356c2b=>[_0x356c2b[_0x38d060(0x73)],_0x356c2b['alias']])),[_0x1401e6,_0x20e535]=await Promise['all']([listBffScripts(_0x3d952a[_0x38d060(0x6e)]),getBffScriptStatistics(_0x3d952a['appCode'])]),_0x4593f8=createHookLocationMap(_0x20e535),_0x5b1462=new Set(_0x2d228c[_0x38d060(0x7b)](_0x310119=>_0x310119[_0x38d060(0x7f)]));for(const _0x1e7348 of _0x1401e6){const _0x50bf89=resolveRemoteScriptTarget(_0x3a9af5,_0x1e7348,_0x4593f8,_0xda6c99[_0x38d060(0x71)],_0x48a6bd);_0x50bf89&&!_0x5b1462['has'](_0x50bf89[_0x38d060(0x7f)])&&_0x490574['push'](_0x50bf89['lockKey']);}}const _0x454b0f=_0x3ab716[_0x38d060(0x7a)]===0x0&&_0x1cba4c[_0x38d060(0x7a)]===0x0&&_0x490574[_0x38d060(0x7a)]===0x0;return{'ok':!![],'data':{'added':_0x3ab716,'modified':_0x1cba4c,'unchanged':_0x4ad3e5,'remoteOnly':_0x490574},'message':_0x454b0f?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x3ab716[_0x38d060(0x7a)]+'\x20added,\x20'+_0x1cba4c[_0x38d060(0x7a)]+_0x38d060(0x6a)+_0x4ad3e5[_0x38d060(0x7a)]+_0x38d060(0x7c)+(_0x490574[_0x38d060(0x7a)]>0x0?',\x20'+_0x490574[_0x38d060(0x7a)]+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- const a34_0xa9c1c7=a34_0x2d29;(function(_0x4b0297,_0x59d621){const _0x55930a=a34_0x2d29,_0x1ab0f5=_0x4b0297();while(!![]){try{const _0x2a04e2=-parseInt(_0x55930a(0x140))/0x1*(-parseInt(_0x55930a(0x124))/0x2)+parseInt(_0x55930a(0x12f))/0x3*(parseInt(_0x55930a(0x143))/0x4)+-parseInt(_0x55930a(0x145))/0x5*(-parseInt(_0x55930a(0x138))/0x6)+parseInt(_0x55930a(0x11e))/0x7*(parseInt(_0x55930a(0x12a))/0x8)+parseInt(_0x55930a(0x135))/0x9*(-parseInt(_0x55930a(0x11a))/0xa)+-parseInt(_0x55930a(0x118))/0xb+-parseInt(_0x55930a(0x13d))/0xc;if(_0x2a04e2===_0x59d621)break;else _0x1ab0f5['push'](_0x1ab0f5['shift']());}catch(_0x34b9b3){_0x1ab0f5['push'](_0x1ab0f5['shift']());}}}(a34_0xd118,0xcba61));import a34_0x41c5f6 from'chalk';import a34_0x553286 from'ora';import a34_0x34e004 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x2e11f0=a34_0x2d29;return GIT_COMMIT!==_0x2e11f0(0x13f)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3432e6=a34_0x2d29,_0x3f21d1=process[_0x3432e6(0x120)][_0x3432e6(0x13c)]();if(_0x3f21d1[_0x3432e6(0x136)](_0x3432e6(0x129)))return _0x3432e6(0x129);return _0x3432e6(0x144);}function a34_0xd118(){const _0x1cc7c7=['toLowerCase','20354040UilsZW','gray','unknown','1MtGgnB','pipe','succeed','272IhPsGt','npm','155EjKyuC','/latest','Checking\x20for\x20updates...','info','Unable\x20to\x20check\x20for\x20updates','coerce','12869703uxaZtY','\x20install\x20-g\x20','171040OHxXga','version','run','fail','2078853XjQMAu','Updating\x20via\x20','execPath','update','json','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','544916pSCIgb','\x20→\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','red','https://registry.npmjs.org/','bun','40cOSgGq','Updated\x20to\x20v','log','message','start','37998uCZpWU','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','@latest','...','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','error','99jhBAff','includes','green','245766txJeTt','Current\x20version:\x20','Version\x20comparison\x20failed','\x20\x20Try\x20manually:\x20'];a34_0xd118=function(){return _0x1cc7c7;};return a34_0xd118();}async function fetchLatestNpmVersion(){const _0x24ff3a=a34_0x2d29;try{const _0x456c92=await fetch(_0x24ff3a(0x128)+NPM_PACKAGE_NAME+_0x24ff3a(0x146),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x456c92['ok'])return null;const _0xd53ece=await _0x456c92[_0x24ff3a(0x122)]();return _0xd53ece[_0x24ff3a(0x11b)]??null;}catch{return null;}}function a34_0x2d29(_0x257731,_0x1e792d){_0x257731=_0x257731-0x117;const _0xd118a8=a34_0xd118();let _0x2d2954=_0xd118a8[_0x257731];return _0x2d2954;}async function fetchLatestVersion(){const _0x5e6c1a=await fetchLatestNpmVersion();if(_0x5e6c1a)return _0x5e6c1a;const _0x4bbc85=await getCdnConfig();return _0x4bbc85?.['cli']?.['stableVersion']??null;}async function execute(_0x3c66c2){const _0xd57313=a34_0x2d29,_0x1faafe=getCurrentVersion();console[_0xd57313(0x12c)](_0xd57313(0x139)+_0x1faafe);const _0x571195=a34_0x553286(_0xd57313(0x147))[_0xd57313(0x12e)](),_0x5b9e73=await fetchLatestVersion();if(!_0x5b9e73)return _0x571195['fail'](_0xd57313(0x133)),console['log'](a34_0x41c5f6['gray'](_0xd57313(0x130)+NPM_PACKAGE_NAME+_0xd57313(0x131))),{'ok':![],'message':_0xd57313(0x149)};const _0x41ac7a=a34_0x34e004[_0xd57313(0x117)](_0x1faafe),_0x50b7fd=a34_0x34e004[_0xd57313(0x117)](_0x5b9e73);if(!_0x41ac7a||!_0x50b7fd)return _0x571195['fail'](_0xd57313(0x13a)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!a34_0x34e004['lt'](_0x41ac7a,_0x50b7fd))return _0x571195['succeed']('Already\x20up\x20to\x20date\x20(v'+_0x5b9e73+')'),{'ok':!![]};_0x571195[_0xd57313(0x148)]('Update\x20available:\x20'+a34_0x41c5f6['yellow'](_0x1faafe)+_0xd57313(0x125)+a34_0x41c5f6[_0xd57313(0x137)](_0x5b9e73));const _0x518850=detectPackageManager(),_0x31c1ba=_0x518850===_0xd57313(0x144)?resolveNpmBin(_0xd57313(0x144)):_0x518850,_0x52989e=a34_0x553286(_0xd57313(0x11f)+_0x518850+_0xd57313(0x132))[_0xd57313(0x12e)]();try{return await execa(_0x31c1ba,['install','-g',NPM_PACKAGE_NAME+'@latest'],{'stdio':_0xd57313(0x141)}),_0x52989e[_0xd57313(0x142)](_0xd57313(0x12b)+_0x5b9e73),console[_0xd57313(0x12c)](a34_0x41c5f6['gray'](_0xd57313(0x123))),{'ok':!![]};}catch(_0x46bba5){return _0x52989e[_0xd57313(0x11d)]('Update\x20failed'),console[_0xd57313(0x134)](a34_0x41c5f6[_0xd57313(0x127)]('\x20\x20'+_0x46bba5[_0xd57313(0x12d)])),console[_0xd57313(0x12c)](a34_0x41c5f6[_0xd57313(0x13e)](_0xd57313(0x13b)+_0x518850+_0xd57313(0x119)+NPM_PACKAGE_NAME+_0xd57313(0x131))),{'ok':![],'message':_0x46bba5[_0xd57313(0x12d)]};}}export const updateDefinition={'service':a34_0xa9c1c7(0x121),'command':a34_0xa9c1c7(0x11c),'description':a34_0xa9c1c7(0x126),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
1
+ const a33_0x10c441=a33_0x3489;(function(_0x16f080,_0x2266f7){const _0x5c2fcc=a33_0x3489,_0x315ab9=_0x16f080();while(!![]){try{const _0x4642a0=parseInt(_0x5c2fcc(0x1ef))/0x1*(parseInt(_0x5c2fcc(0x1be))/0x2)+-parseInt(_0x5c2fcc(0x1d7))/0x3*(parseInt(_0x5c2fcc(0x1d8))/0x4)+-parseInt(_0x5c2fcc(0x1f0))/0x5*(parseInt(_0x5c2fcc(0x1d5))/0x6)+parseInt(_0x5c2fcc(0x1d2))/0x7+-parseInt(_0x5c2fcc(0x1c5))/0x8+parseInt(_0x5c2fcc(0x1c4))/0x9+parseInt(_0x5c2fcc(0x1ce))/0xa*(-parseInt(_0x5c2fcc(0x1de))/0xb);if(_0x4642a0===_0x2266f7)break;else _0x315ab9['push'](_0x315ab9['shift']());}catch(_0x4a32e3){_0x315ab9['push'](_0x315ab9['shift']());}}}(a33_0x1490,0xdb3e1));import a33_0x403ef5 from'chalk';import a33_0x9debc3 from'ora';import a33_0x4d7306 from'semver';function a33_0x1490(){const _0x4b4934=['7002anGSGf','Update\x20available:\x20','3VYoDxc','3972404DnoJfZ','Updating\x20via\x20','run','slice','succeed','message','77VulcGZ','toLowerCase','bun','red','fail','Current\x20version:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Checking\x20for\x20updates...','timeout','start','...','cli','install','info','log','https://registry.npmjs.org/','Updated\x20to\x20v','551Dlxazd','1810PFnLbu','Unable\x20to\x20check\x20for\x20updates','green','6490BPoOmQ','npm','Update\x20failed','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','update','14164092BFAJyY','9355744qNBDJD','json','\x20→\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Version\x20comparison\x20failed','yellow','Already\x20up\x20to\x20date\x20(v','@latest','\x20\x20Try\x20manually:\x20','1400290eOwwfo','coerce','error','version','7710220LRDfCO','stableVersion','gray'];a33_0x1490=function(){return _0x4b4934;};return a33_0x1490();}import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function a33_0x3489(_0x1313dc,_0x5d1091){_0x1313dc=_0x1313dc-0x1be;const _0x14904d=a33_0x1490();let _0x3489cf=_0x14904d[_0x1313dc];return _0x3489cf;}import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x4d3469=a33_0x3489;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4d3469(0x1db)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x19f763=a33_0x3489,_0x1fb85f=process['execPath'][_0x19f763(0x1df)]();if(_0x1fb85f['includes']('bun'))return _0x19f763(0x1e0);return'npm';}async function fetchLatestNpmVersion(){const _0x157838=a33_0x3489;try{const _0x1e93df=await fetch(_0x157838(0x1ed)+NPM_PACKAGE_NAME+'/latest',{'signal':AbortSignal[_0x157838(0x1e6)](0x2710)});if(!_0x1e93df['ok'])return null;const _0x184447=await _0x1e93df[_0x157838(0x1c6)]();return _0x184447[_0x157838(0x1d1)]??null;}catch{return null;}}async function fetchLatestVersion(){const _0x39bee9=a33_0x3489,_0x36883c=await fetchLatestNpmVersion();if(_0x36883c)return _0x36883c;const _0x49e630=await getCdnConfig();return _0x49e630?.[_0x39bee9(0x1e9)]?.[_0x39bee9(0x1d3)]??null;}async function execute(_0x810edc){const _0x74d9f0=a33_0x3489,_0x300a0b=getCurrentVersion();console[_0x74d9f0(0x1ec)](_0x74d9f0(0x1e3)+_0x300a0b);const _0x4d3e02=a33_0x9debc3(_0x74d9f0(0x1e5))['start'](),_0x34b55a=await fetchLatestVersion();if(!_0x34b55a)return _0x4d3e02[_0x74d9f0(0x1e2)](_0x74d9f0(0x1c8)),console[_0x74d9f0(0x1ec)](a33_0x403ef5[_0x74d9f0(0x1d4)](_0x74d9f0(0x1c1)+NPM_PACKAGE_NAME+_0x74d9f0(0x1cc))),{'ok':![],'message':_0x74d9f0(0x1f1)};const _0xc8ede=a33_0x4d7306[_0x74d9f0(0x1cf)](_0x300a0b),_0x3196f2=a33_0x4d7306[_0x74d9f0(0x1cf)](_0x34b55a);if(!_0xc8ede||!_0x3196f2)return _0x4d3e02[_0x74d9f0(0x1e2)](_0x74d9f0(0x1c9)),{'ok':![],'message':_0x74d9f0(0x1c9)};if(!a33_0x4d7306['lt'](_0xc8ede,_0x3196f2))return _0x4d3e02['succeed'](_0x74d9f0(0x1cb)+_0x34b55a+')'),{'ok':!![]};_0x4d3e02[_0x74d9f0(0x1eb)](_0x74d9f0(0x1d6)+a33_0x403ef5[_0x74d9f0(0x1ca)](_0x300a0b)+_0x74d9f0(0x1c7)+a33_0x403ef5[_0x74d9f0(0x1f2)](_0x34b55a));const _0xe64077=detectPackageManager(),_0x281824=_0xe64077===_0x74d9f0(0x1bf)?resolveNpmBin(_0x74d9f0(0x1bf)):_0xe64077,_0x30008e=a33_0x9debc3(_0x74d9f0(0x1d9)+_0xe64077+_0x74d9f0(0x1e8))[_0x74d9f0(0x1e7)]();try{return await execa(_0x281824,[_0x74d9f0(0x1ea),'-g',NPM_PACKAGE_NAME+_0x74d9f0(0x1cc)],{'stdio':'pipe'}),_0x30008e[_0x74d9f0(0x1dc)](_0x74d9f0(0x1ee)+_0x34b55a),console[_0x74d9f0(0x1ec)](a33_0x403ef5['gray'](_0x74d9f0(0x1c2))),{'ok':!![]};}catch(_0x203914){return _0x30008e['fail'](_0x74d9f0(0x1c0)),console[_0x74d9f0(0x1d0)](a33_0x403ef5[_0x74d9f0(0x1e1)]('\x20\x20'+_0x203914[_0x74d9f0(0x1dd)])),console[_0x74d9f0(0x1ec)](a33_0x403ef5[_0x74d9f0(0x1d4)](_0x74d9f0(0x1cd)+_0xe64077+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x74d9f0(0x1cc))),{'ok':![],'message':_0x203914[_0x74d9f0(0x1dd)]};}}export const updateDefinition={'service':a33_0x10c441(0x1c3),'command':a33_0x10c441(0x1da),'description':a33_0x10c441(0x1e4),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a35_0x2f10(){const _0x505929=['1646860dTpyvf','76140ftnXCT','983630nKOEnZ','652NcVKkw','28rSmrFu','5493uqxbAS','18bUZtOO','144656EonThI','454026TUfVnC','261802nTynsA'];a35_0x2f10=function(){return _0x505929;};return a35_0x2f10();}(function(_0x236695,_0x41cff9){const _0x3df97a=a35_0x2442,_0x28430f=_0x236695();while(!![]){try{const _0x46c862=parseInt(_0x3df97a(0x12a))/0x1+-parseInt(_0x3df97a(0x12b))/0x2+-parseInt(_0x3df97a(0x127))/0x3*(parseInt(_0x3df97a(0x12f))/0x4)+parseInt(_0x3df97a(0x12c))/0x5+-parseInt(_0x3df97a(0x12d))/0x6*(-parseInt(_0x3df97a(0x130))/0x7)+parseInt(_0x3df97a(0x129))/0x8*(-parseInt(_0x3df97a(0x128))/0x9)+-parseInt(_0x3df97a(0x12e))/0xa;if(_0x46c862===_0x41cff9)break;else _0x28430f['push'](_0x28430f['shift']());}catch(_0xf79ae8){_0x28430f['push'](_0x28430f['shift']());}}}(a35_0x2f10,0x41fc5));import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';function a35_0x2442(_0x11eb9c,_0x3c4ea6){_0x11eb9c=_0x11eb9c-0x127;const _0x2f1033=a35_0x2f10();let _0x244297=_0x2f1033[_0x11eb9c];return _0x244297;}export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ (function(_0x30b467,_0x5aa0e6){const _0xf5bfc7=a34_0x5279,_0x57df93=_0x30b467();while(!![]){try{const _0x238bda=-parseInt(_0xf5bfc7(0x11f))/0x1+parseInt(_0xf5bfc7(0x120))/0x2*(parseInt(_0xf5bfc7(0x11a))/0x3)+parseInt(_0xf5bfc7(0x116))/0x4*(parseInt(_0xf5bfc7(0x121))/0x5)+parseInt(_0xf5bfc7(0x119))/0x6*(-parseInt(_0xf5bfc7(0x11c))/0x7)+parseInt(_0xf5bfc7(0x117))/0x8*(parseInt(_0xf5bfc7(0x118))/0x9)+-parseInt(_0xf5bfc7(0x11b))/0xa*(parseInt(_0xf5bfc7(0x11e))/0xb)+parseInt(_0xf5bfc7(0x122))/0xc*(parseInt(_0xf5bfc7(0x11d))/0xd);if(_0x238bda===_0x5aa0e6)break;else _0x57df93['push'](_0x57df93['shift']());}catch(_0x14135e){_0x57df93['push'](_0x57df93['shift']());}}}(a34_0x1bc5,0xb8b5f));import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';function a34_0x5279(_0x3a246d,_0x4a7e73){_0x3a246d=_0x3a246d-0x116;const _0x1bc5c0=a34_0x1bc5();let _0x52791e=_0x1bc5c0[_0x3a246d];return _0x52791e;}export const codegenDefinitions=[codegenSdk,codegenSql];function a34_0x1bc5(){const _0x43b35f=['336EDsJsG','3364408ySEfka','27UZuJJj','3264036ngbBrI','3CFKVaF','4143110pYQTnc','7bxEuHl','1365gdpxid','22yIbcok','877659hiZNky','529922RDHBrI','18160wIopGP','134304lpUIYp'];a34_0x1bc5=function(){return _0x43b35f;};return a34_0x1bc5();}
@@ -1 +1 @@
1
- const a36_0x59246d=a36_0x10f3;(function(_0xd1154b,_0x29599e){const _0x472958=a36_0x10f3,_0x2f6556=_0xd1154b();while(!![]){try{const _0x55ec26=-parseInt(_0x472958(0xa1))/0x1*(-parseInt(_0x472958(0x87))/0x2)+parseInt(_0x472958(0x97))/0x3+parseInt(_0x472958(0x9e))/0x4+-parseInt(_0x472958(0x91))/0x5*(-parseInt(_0x472958(0x9c))/0x6)+parseInt(_0x472958(0x9b))/0x7+-parseInt(_0x472958(0x90))/0x8+-parseInt(_0x472958(0x8a))/0x9*(parseInt(_0x472958(0xa0))/0xa);if(_0x55ec26===_0x29599e)break;else _0x2f6556['push'](_0x2f6556['shift']());}catch(_0x1a724a){_0x2f6556['push'](_0x2f6556['shift']());}}}(a36_0x12b3,0xb6a21));function a36_0x10f3(_0xd3287d,_0x4196c9){_0xd3287d=_0xd3287d-0x86;const _0x12b308=a36_0x12b3();let _0x10f379=_0x12b308[_0xd3287d];return _0x10f379;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':a36_0x59246d(0x9a),'command':a36_0x59246d(0x8f),'description':a36_0x59246d(0x96),'risk':a36_0x59246d(0x88),'flags':[CODE_FLAG_OPTIONAL,{'name':a36_0x59246d(0x92),'type':a36_0x59246d(0x86),'description':a36_0x59246d(0x8e)},{'name':a36_0x59246d(0x94),'type':a36_0x59246d(0x86),'required':!![],'description':a36_0x59246d(0x89)},{'name':a36_0x59246d(0x8b),'type':a36_0x59246d(0x9d),'description':a36_0x59246d(0x99)}],async 'execute'(_0x33482b){const _0x1c9db8=a36_0x59246d,{dataset:_0x4c4a18,operation:_0x4892fd}=await getOperationDetail(_0x33482b[_0x1c9db8(0x8d)],_0x33482b[_0x1c9db8(0x9f)](_0x1c9db8(0x98)),_0x33482b['str'](_0x1c9db8(0x94))),_0x314785=generateSdkCode(_0x4c4a18,_0x4892fd,{'includeImports':!_0x33482b[_0x1c9db8(0x8c)](_0x1c9db8(0x8b))});return{'ok':!![],'data':{'dataset':{'name':_0x4c4a18[_0x1c9db8(0x95)],'code':_0x4c4a18['code'],'tableName':_0x4c4a18[_0x1c9db8(0x93)]},'operation':_0x33482b[_0x1c9db8(0x9f)]('operation'),'code':_0x314785}};}};function a36_0x12b3(){const _0x215021=['5859217iIscHl','138VWhXfb','boolean','2161144HDLyaD','str','14350zESGGQ','988CqRuVh','string','1780LBKIIG','read','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','14571EwzCAC','skip-imports','bool','appCode','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','sdk','8267728Welpaj','241095XppKBX','alias','tableName','operation','name','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','2217366DggoIx','code','Omit\x20import\x20statements\x20from\x20generated\x20code','codegen'];a36_0x12b3=function(){return _0x215021;};return a36_0x12b3();}
1
+ function a35_0xf70f(){const _0x15be36=['sdk','3152268LBsImv','155352LLDQqH','skip-imports','tableName','operation','appCode','40dooFUZ','436462lLuMYa','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','1340805ieEuiD','796sontra','read','code','boolean','alias','8370RyXmsg','56RIgGll','Omit\x20import\x20statements\x20from\x20generated\x20code','2eszwiX','1872891osZuhU','2644840lJdybc','string','name','str'];a35_0xf70f=function(){return _0x15be36;};return a35_0xf70f();}const a35_0x3bb73b=a35_0x3f6c;function a35_0x3f6c(_0x51f0b9,_0x8dd3fc){_0x51f0b9=_0x51f0b9-0xac;const _0xf70fd7=a35_0xf70f();let _0x3f6ce6=_0xf70fd7[_0x51f0b9];return _0x3f6ce6;}(function(_0x21a0bf,_0xf6ee64){const _0x50ff63=a35_0x3f6c,_0x142cc3=_0x21a0bf();while(!![]){try{const _0x1787b4=-parseInt(_0x50ff63(0xb8))/0x1+parseInt(_0x50ff63(0xc3))/0x2*(-parseInt(_0x50ff63(0xba))/0x3)+parseInt(_0x50ff63(0xbb))/0x4*(-parseInt(_0x50ff63(0xc0))/0x5)+parseInt(_0x50ff63(0xb1))/0x6+parseInt(_0x50ff63(0xc1))/0x7*(-parseInt(_0x50ff63(0xb2))/0x8)+parseInt(_0x50ff63(0xc4))/0x9+parseInt(_0x50ff63(0xb7))/0xa*(parseInt(_0x50ff63(0xac))/0xb);if(_0x1787b4===_0xf6ee64)break;else _0x142cc3['push'](_0x142cc3['shift']());}catch(_0x270929){_0x142cc3['push'](_0x142cc3['shift']());}}}(a35_0xf70f,0x4ef22));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':'codegen','command':a35_0x3bb73b(0xb0),'description':a35_0x3bb73b(0xb9),'risk':a35_0x3bb73b(0xbc),'flags':[CODE_FLAG_OPTIONAL,{'name':a35_0x3bb73b(0xbf),'type':a35_0x3bb73b(0xad),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a35_0x3bb73b(0xb5),'type':a35_0x3bb73b(0xad),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':'skip-imports','type':a35_0x3bb73b(0xbe),'description':a35_0x3bb73b(0xc2)}],async 'execute'(_0x1f16f0){const _0x5c661e=a35_0x3bb73b,{dataset:_0x45f543,operation:_0x21fd30}=await getOperationDetail(_0x1f16f0[_0x5c661e(0xb6)],_0x1f16f0['str'](_0x5c661e(0xbd)),_0x1f16f0['str'](_0x5c661e(0xb5))),_0x5b95cd=generateSdkCode(_0x45f543,_0x21fd30,{'includeImports':!_0x1f16f0['bool'](_0x5c661e(0xb3))});return{'ok':!![],'data':{'dataset':{'name':_0x45f543[_0x5c661e(0xae)],'code':_0x45f543[_0x5c661e(0xbd)],'tableName':_0x45f543[_0x5c661e(0xb4)]},'operation':_0x1f16f0[_0x5c661e(0xaf)](_0x5c661e(0xb5)),'code':_0x5b95cd}};}};