@lovrabet/rabetbase-cli 2.0.2-beta.8 → 2.0.2-beta.9

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 (133) 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/app.js +1 -1
  18. package/lib/commands/auth.js +1 -1
  19. package/lib/commands/bff/delete.js +1 -1
  20. package/lib/commands/bff/detail.js +1 -1
  21. package/lib/commands/bff/index.js +1 -1
  22. package/lib/commands/bff/list.js +1 -1
  23. package/lib/commands/bff/new.js +1 -1
  24. package/lib/commands/bff/pull.js +1 -1
  25. package/lib/commands/bff/push.js +1 -1
  26. package/lib/commands/bff/status.js +1 -1
  27. package/lib/commands/build.js +1 -1
  28. package/lib/commands/cli-update.js +1 -1
  29. package/lib/commands/codegen/index.js +1 -1
  30. package/lib/commands/codegen/sdk.js +1 -1
  31. package/lib/commands/codegen/sql.js +1 -1
  32. package/lib/commands/common/flags.js +1 -1
  33. package/lib/commands/config.js +1 -1
  34. package/lib/commands/create.js +1 -1
  35. package/lib/commands/dataset/detail.js +1 -1
  36. package/lib/commands/dataset/index.js +1 -1
  37. package/lib/commands/dataset/links.js +1 -1
  38. package/lib/commands/dataset/list.js +1 -1
  39. package/lib/commands/dataset/operations.js +1 -1
  40. package/lib/commands/doctor.js +1 -1
  41. package/lib/commands/init.js +1 -1
  42. package/lib/commands/logout.js +1 -1
  43. package/lib/commands/logs.js +1 -1
  44. package/lib/commands/menu/index.js +1 -1
  45. package/lib/commands/menu/shared/compare-table.js +1 -1
  46. package/lib/commands/menu/shared/index.js +1 -1
  47. package/lib/commands/menu/shared/inquirer.js +1 -1
  48. package/lib/commands/menu/shared/local-pages.js +1 -1
  49. package/lib/commands/menu/shared/logic.js +1 -1
  50. package/lib/commands/menu/shared/service.js +1 -1
  51. package/lib/commands/menu/shared/sync-core.js +1 -1
  52. package/lib/commands/menu/shared/update-core.js +1 -1
  53. package/lib/commands/menu/shared/valid-url.js +1 -1
  54. package/lib/commands/menu/sync.js +1 -1
  55. package/lib/commands/menu/update.js +1 -1
  56. package/lib/commands/preview.js +1 -1
  57. package/lib/commands/project-upgrade.js +1 -1
  58. package/lib/commands/registry.js +1 -1
  59. package/lib/commands/run.js +1 -1
  60. package/lib/commands/skill.js +1 -1
  61. package/lib/commands/sql/detail.js +1 -1
  62. package/lib/commands/sql/exec.js +1 -1
  63. package/lib/commands/sql/index.js +1 -1
  64. package/lib/commands/sql/list.js +1 -1
  65. package/lib/commands/sql/save.js +1 -1
  66. package/lib/commands/sql/validate.js +1 -1
  67. package/lib/commands/start.js +1 -1
  68. package/lib/config/config-help.js +1 -1
  69. package/lib/config/main.js +1 -1
  70. package/lib/constant/cli.js +1 -1
  71. package/lib/constant/domain.js +1 -1
  72. package/lib/constant/env.js +1 -1
  73. package/lib/context.js +1 -1
  74. package/lib/core/alias-resolver.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/bff/config.js +1 -1
  77. package/lib/core/bff/file-system.js +1 -1
  78. package/lib/core/bff/hash.js +1 -1
  79. package/lib/core/bff/lock.js +1 -1
  80. package/lib/core/bff/utils.js +1 -1
  81. package/lib/core/db-resolver.js +1 -1
  82. package/lib/core/sql-validator.js +1 -1
  83. package/lib/create-app/enhanced-guided-create.js +1 -1
  84. package/lib/create-app/format-elapsed.js +1 -1
  85. package/lib/create-app/main.js +1 -1
  86. package/lib/create-app/non-interactive.js +1 -1
  87. package/lib/create-app/task-finished.js +1 -1
  88. package/lib/create-app/task-loading.js +1 -1
  89. package/lib/create-app/task-running.js +1 -1
  90. package/lib/create-app/task-time.js +1 -1
  91. package/lib/create-app/use-copy-project-template.js +1 -1
  92. package/lib/create-app/use-format-code.js +1 -1
  93. package/lib/create-app/use-install-dependencies.js +1 -1
  94. package/lib/errors.js +1 -1
  95. package/lib/framework/flags.js +1 -1
  96. package/lib/framework/help.js +1 -1
  97. package/lib/framework/index.js +1 -1
  98. package/lib/framework/output.js +1 -1
  99. package/lib/framework/response.js +1 -1
  100. package/lib/framework/runner.js +1 -1
  101. package/lib/generated/build-info.js +1 -1
  102. package/lib/help.js +1 -1
  103. package/lib/init/main.js +1 -1
  104. package/lib/skills/main.js +1 -1
  105. package/lib/skills/npx-skills-add.js +1 -1
  106. package/lib/telemetry/cli-help-trace.js +1 -1
  107. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  108. package/lib/utils/ai_config.js +1 -1
  109. package/lib/utils/cdn-config.js +1 -1
  110. package/lib/utils/check-sdk-version.js +1 -1
  111. package/lib/utils/cli-version-check.js +1 -1
  112. package/lib/utils/config.js +1 -1
  113. package/lib/utils/copy-directory.js +1 -1
  114. package/lib/utils/file-utils.js +1 -1
  115. package/lib/utils/guides-cdn.js +1 -1
  116. package/lib/utils/http-client.js +1 -1
  117. package/lib/utils/logger.js +1 -1
  118. package/lib/utils/platform.js +1 -0
  119. package/lib/utils/rules-cdn.js +1 -1
  120. package/lib/utils/sleep.js +1 -1
  121. package/lib/utils/template-replacer.js +1 -1
  122. package/package.json +2 -2
  123. package/lib/ai-setup/config.js +0 -1
  124. package/lib/commands/mcp.js +0 -1
  125. package/lib/mcp/McpInstallUI.js +0 -1
  126. package/lib/mcp/claude.js +0 -1
  127. package/lib/mcp/cursor.js +0 -1
  128. package/lib/mcp/main.js +0 -1
  129. package/lib/mcp/mcp-install-non-interactive.js +0 -1
  130. package/lib/mcp/mcp-installer.js +0 -1
  131. package/lib/telemetry/otel-logger-version.js +0 -1
  132. package/lib/ui/IDESelector.js +0 -1
  133. package/lib/ui/useIDESelection.js +0 -1
@@ -1 +1 @@
1
- const a18_0x4a53d5=a18_0xc1dc;(function(_0x2b12aa,_0x6b588a){const _0x1f3391=a18_0xc1dc,_0x3cdbec=_0x2b12aa();while(!![]){try{const _0x35dfd2=-parseInt(_0x1f3391(0x1fc))/0x1*(parseInt(_0x1f3391(0x1fb))/0x2)+-parseInt(_0x1f3391(0x1f4))/0x3+parseInt(_0x1f3391(0x1f2))/0x4+parseInt(_0x1f3391(0x1fd))/0x5*(-parseInt(_0x1f3391(0x1f5))/0x6)+-parseInt(_0x1f3391(0x1f9))/0x7*(-parseInt(_0x1f3391(0x1fa))/0x8)+-parseInt(_0x1f3391(0x1f6))/0x9*(parseInt(_0x1f3391(0x1f8))/0xa)+parseInt(_0x1f3391(0x1f7))/0xb;if(_0x35dfd2===_0x6b588a)break;else _0x3cdbec['push'](_0x3cdbec['shift']());}catch(_0x40cc73){_0x3cdbec['push'](_0x3cdbec['shift']());}}}(a18_0x5e0c,0x6c746));import{jsx as a18_0x3b4127}from'react/jsx-runtime';import{render}from'ink';function a18_0xc1dc(_0x27c27a,_0x49b7ed){_0x27c27a=_0x27c27a-0x1f2;const _0x5e0c50=a18_0x5e0c();let _0xc1dc4a=_0x5e0c50[_0x27c27a];return _0xc1dc4a;}import{AuthServer}from'../auth/auth-server-ui.js';function a18_0x5e0c(){const _0x249aa8=['6812674ZoskLl','759070LYWOvc','2087197QExjnw','8bVMfqi','26pDbQRJ','15929dPCQhO','3830UQFxsx','2349236ZcaWKG','auth','1752LmCMJq','3708oiaaxm','45KEUFsY'];a18_0x5e0c=function(){return _0x249aa8;};return a18_0x5e0c();}export const authCommand={'name':a18_0x4a53d5(0x1f3),'description':'Authenticate\x20with\x20rabetbase',async 'run'(_0x48740e,_0x12e17f,_0x253e02){render(a18_0x3b4127(AuthServer,{}));}};
1
+ const a17_0x388261=a17_0x2899;(function(_0x12076f,_0x356f4c){const _0xf058ae=a17_0x2899,_0x2f5801=_0x12076f();while(!![]){try{const _0x3e7c25=-parseInt(_0xf058ae(0x17f))/0x1*(-parseInt(_0xf058ae(0x183))/0x2)+parseInt(_0xf058ae(0x17d))/0x3+parseInt(_0xf058ae(0x180))/0x4+-parseInt(_0xf058ae(0x181))/0x5*(parseInt(_0xf058ae(0x17e))/0x6)+-parseInt(_0xf058ae(0x17b))/0x7*(parseInt(_0xf058ae(0x178))/0x8)+parseInt(_0xf058ae(0x177))/0x9*(parseInt(_0xf058ae(0x17a))/0xa)+parseInt(_0xf058ae(0x182))/0xb*(parseInt(_0xf058ae(0x179))/0xc);if(_0x3e7c25===_0x356f4c)break;else _0x2f5801['push'](_0x2f5801['shift']());}catch(_0x1ab689){_0x2f5801['push'](_0x2f5801['shift']());}}}(a17_0x1024,0xcd2cd));function a17_0x1024(){const _0x459af1=['945636YJwaoz','17JPqXVp','806160ekbcge','45qyEhEW','8811YWCKnR','154534uoBvBy','350820gZoRPN','58496jXfKIV','348QirZuj','170MKkxHr','798QCbJVz','Authenticate\x20with\x20rabetbase','2674353PKOcGm'];a17_0x1024=function(){return _0x459af1;};return a17_0x1024();}import{jsx as a17_0x1dd226}from'react/jsx-runtime';import{render}from'ink';function a17_0x2899(_0x1ca6c3,_0x26d358){_0x1ca6c3=_0x1ca6c3-0x177;const _0x10240a=a17_0x1024();let _0x2899e1=_0x10240a[_0x1ca6c3];return _0x2899e1;}import{AuthServer}from'../auth/auth-server-ui.js';export const authCommand={'name':'auth','description':a17_0x388261(0x17c),async 'run'(_0x229b14,_0x5df990,_0x248d00){render(a17_0x1dd226(AuthServer,{}));}};
@@ -1 +1 @@
1
- const a19_0x410418=a19_0x52e2;(function(_0x545008,_0x391854){const _0x2617a7=a19_0x52e2,_0x16dd90=_0x545008();while(!![]){try{const _0x280320=parseInt(_0x2617a7(0xf0))/0x1+-parseInt(_0x2617a7(0xd7))/0x2*(parseInt(_0x2617a7(0xdc))/0x3)+parseInt(_0x2617a7(0xe0))/0x4+parseInt(_0x2617a7(0xf6))/0x5+parseInt(_0x2617a7(0xd8))/0x6+-parseInt(_0x2617a7(0xe7))/0x7*(-parseInt(_0x2617a7(0xe9))/0x8)+-parseInt(_0x2617a7(0xdf))/0x9*(parseInt(_0x2617a7(0xef))/0xa);if(_0x280320===_0x391854)break;else _0x16dd90['push'](_0x16dd90['shift']());}catch(_0x69a1d9){_0x16dd90['push'](_0x16dd90['shift']());}}}(a19_0x29be,0xb5433));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a19_0x29be(){const _0x36d2b5=['delete','1808048PdlnGV','toISOString','replace','string','Deleted\x20','find','20WaJTwN','992025THyldg','lockFilePath','scriptsWorkspaceRoot','trashDir','keys','remoteId','6768365LOQQMb','No\x20lock\x20entry\x20found\x20for\x20\x22','bff','trashedTo','Function\x20not\x20found:\x20','length','high-risk-write','validation','join','Multiple\x20functions\x20match\x20\x22','25078usNKou','2126694ShngZd','scriptsRootDir','lastSync','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','300rdWihv','functions','str','5748534HosbKr','486576vIDQaj','appCode','filter','BFF\x20lock\x20file\x20not\x20found.','projectRoot','target','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','14qoDHfE'];a19_0x29be=function(){return _0x36d2b5;};return a19_0x29be();}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a19_0x410418(0xf8),'command':a19_0x410418(0xe8),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a19_0x410418(0xd3),'flags':[{'name':a19_0x410418(0xe5),'type':a19_0x410418(0xec),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x4739b1){const _0x3175eb=a19_0x410418,_0x248730=loadBffProjectConfig(_0x4739b1[_0x3175eb(0xe1)]),_0x21bc2c=await readBffLockFile(_0x248730[_0x3175eb(0xf1)]);if(!_0x21bc2c)throw CliErrors[_0x3175eb(0xd4)](_0x3175eb(0xe6));},async 'execute'(_0x2d99ca){const _0x4dadc3=a19_0x410418,_0x395d23=loadBffProjectConfig(_0x2d99ca[_0x4dadc3(0xe1)]),_0x84848=await readBffLockFile(_0x395d23[_0x4dadc3(0xf1)]);if(!_0x84848)throw CliErrors[_0x4dadc3(0xd4)](_0x4dadc3(0xe3));const {lockData:_0x395c69,appLock:_0xb6bf97}=ensureLockScope(_0x84848,_0x395d23[_0x4dadc3(0xe1)],_0x395d23['scriptsRoot'],'delete',_0x395d23['appCode'],_0x395d23[_0x4dadc3(0xf2)]+'/'+_0x395d23['appCode']),_0x295747=_0x2d99ca[_0x4dadc3(0xde)](_0x4dadc3(0xe5)),_0x37a78d=Object[_0x4dadc3(0xf4)](_0xb6bf97[_0x4dadc3(0xdd)]),_0x547c3e=resolveDeleteTarget(_0x295747,_0x37a78d),_0x713755=_0xb6bf97[_0x4dadc3(0xdd)][_0x547c3e];if(!_0x713755)throw CliErrors[_0x4dadc3(0xd4)](_0x4dadc3(0xf7)+_0x547c3e+'\x22.');await deleteBffScript(_0x713755[_0x4dadc3(0xf5)]),delete _0xb6bf97[_0x4dadc3(0xdd)][_0x547c3e],_0xb6bf97[_0x4dadc3(0xda)]=new Date()[_0x4dadc3(0xea)](),await writeBffLockFile(_0x395d23[_0x4dadc3(0xf1)],_0x395c69);const _0x588eaf=resolveLocalFilePathFromLockKey(_0x395d23,_0x547c3e);let _0x2412e2;await fileExists(_0x588eaf)&&(_0x2412e2=await moveToTrash(_0x395d23[_0x4dadc3(0xe4)],_0x395d23[_0x4dadc3(0xf3)],_0x588eaf),await cleanupEmptyDirectories(dirname(_0x588eaf),_0x395d23[_0x4dadc3(0xd9)]));const _0x50d53a={'deleted':_0x547c3e,'remoteId':_0x713755['remoteId']};if(_0x2412e2)_0x50d53a[_0x4dadc3(0xd0)]=_0x2412e2;return{'ok':!![],'data':_0x50d53a,'message':_0x4dadc3(0xed)+_0x547c3e+(_0x2412e2?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x5b42df,_0x509ef4){const _0x31cc11=a19_0x410418;if(_0x5b42df['includes']('/')){const _0x46a1ef=_0x509ef4[_0x31cc11(0xee)](_0x399f69=>_0x399f69===_0x5b42df);if(!_0x46a1ef)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd1)+_0x5b42df);return _0x46a1ef;}const _0x590a55=_0x509ef4[_0x31cc11(0xe2)](_0x18a63b=>_0x18a63b['split']('/')['at'](-0x1)===_0x5b42df);if(_0x590a55[_0x31cc11(0xd2)]===0x0)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd1)+_0x5b42df);if(_0x590a55[_0x31cc11(0xd2)]>0x1)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd6)+_0x5b42df+_0x31cc11(0xdb)+_0x590a55['map'](_0x296628=>'\x20\x20-\x20'+_0x296628)[_0x31cc11(0xd5)]('\x0a'));return _0x590a55[0x0];}async function moveToTrash(_0x2e0105,_0x3f4a51,_0x3a5ec3){const _0x5efd6f=a19_0x410418,_0x5304b3=new Date()[_0x5efd6f(0xea)]()[_0x5efd6f(0xeb)](/[:.]/g,'-'),_0x3d6309=relative(_0x2e0105,_0x3a5ec3),_0x1a55ef=join(_0x3f4a51,_0x5304b3,_0x3d6309);return await mkdir(dirname(_0x1a55ef),{'recursive':!![]}),await rename(_0x3a5ec3,_0x1a55ef),_0x1a55ef;}function a19_0x52e2(_0x2afe84,_0x1e423d){_0x2afe84=_0x2afe84-0xd0;const _0x29beb2=a19_0x29be();let _0x52e294=_0x29beb2[_0x2afe84];return _0x52e294;}async function cleanupEmptyDirectories(_0x695da1,_0x2f80d2){const _0xcc5046=a19_0x410418;let _0x9c0759=resolve(_0x695da1);const _0x343e9e=resolve(_0x2f80d2);while(_0x9c0759['startsWith'](''+_0x343e9e+sep)||_0x9c0759===_0x343e9e){if(_0x9c0759===_0x343e9e)return;try{const _0x4c2215=await readdir(_0x9c0759);if(_0x4c2215[_0xcc5046(0xd2)]>0x0)return;await rmdir(_0x9c0759);}catch{return;}_0x9c0759=dirname(_0x9c0759);}}
1
+ const a18_0x3df8be=a18_0x3ba5;(function(_0x2785b7,_0x2c6798){const _0x24eac1=a18_0x3ba5,_0x5add58=_0x2785b7();while(!![]){try{const _0x108798=parseInt(_0x24eac1(0x14d))/0x1*(parseInt(_0x24eac1(0x141))/0x2)+-parseInt(_0x24eac1(0x154))/0x3*(-parseInt(_0x24eac1(0x153))/0x4)+parseInt(_0x24eac1(0x13f))/0x5+-parseInt(_0x24eac1(0x13e))/0x6*(-parseInt(_0x24eac1(0x15c))/0x7)+-parseInt(_0x24eac1(0x14f))/0x8+parseInt(_0x24eac1(0x147))/0x9+-parseInt(_0x24eac1(0x139))/0xa;if(_0x108798===_0x2c6798)break;else _0x5add58['push'](_0x5add58['shift']());}catch(_0x56d79d){_0x5add58['push'](_0x5add58['shift']());}}}(a18_0x18bc,0x5337e));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';function a18_0x18bc(){const _0xb65c00=['map','scriptsWorkspaceRoot','validation','No\x20lock\x20entry\x20found\x20for\x20\x22','Deleted\x20','find','projectRoot','177695SeCaqI','\x20(local\x20file\x20moved\x20to\x20trash)','Function\x20not\x20found:\x20','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','join','7065600uMFtRC','startsWith','BFF\x20lock\x20file\x20not\x20found.','delete','keys','54BJnOUa','2855190hggDSb','target','355194liGCgy','split','remoteId','lastSync','length','Multiple\x20functions\x20match\x20\x22','3727881IwZAfM','appCode','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x20\x20-\x20','functions','high-risk-write','1gSzHOR','lockFilePath','3417144cbiqSd','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','toISOString','replace','32QXrWmx','31221xOpdMt'];a18_0x18bc=function(){return _0xb65c00;};return a18_0x18bc();}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':a18_0x3df8be(0x13c),'description':a18_0x3df8be(0x150),'risk':a18_0x3df8be(0x14c),'flags':[{'name':'target','type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x7d2b62){const _0xe45a2a=a18_0x3df8be,_0x3f6f74=loadBffProjectConfig(_0x7d2b62[_0xe45a2a(0x148)]),_0x13f50e=await readBffLockFile(_0x3f6f74[_0xe45a2a(0x14e)]);if(!_0x13f50e)throw CliErrors[_0xe45a2a(0x157)](_0xe45a2a(0x137));},async 'execute'(_0x930fc3){const _0x24fc51=a18_0x3df8be,_0x453a37=loadBffProjectConfig(_0x930fc3[_0x24fc51(0x148)]),_0x47f4be=await readBffLockFile(_0x453a37[_0x24fc51(0x14e)]);if(!_0x47f4be)throw CliErrors[_0x24fc51(0x157)](_0x24fc51(0x13b));const {lockData:_0x1ad027,appLock:_0x5e43a7}=ensureLockScope(_0x47f4be,_0x453a37[_0x24fc51(0x148)],_0x453a37['scriptsRoot'],'delete',_0x453a37[_0x24fc51(0x148)],_0x453a37[_0x24fc51(0x156)]+'/'+_0x453a37[_0x24fc51(0x148)]),_0x10c1ab=_0x930fc3['str'](_0x24fc51(0x140)),_0x5614da=Object[_0x24fc51(0x13d)](_0x5e43a7[_0x24fc51(0x14b)]),_0x53ea59=resolveDeleteTarget(_0x10c1ab,_0x5614da),_0x21cbd6=_0x5e43a7[_0x24fc51(0x14b)][_0x53ea59];if(!_0x21cbd6)throw CliErrors[_0x24fc51(0x157)](_0x24fc51(0x158)+_0x53ea59+'\x22.');await deleteBffScript(_0x21cbd6['remoteId']),delete _0x5e43a7['functions'][_0x53ea59],_0x5e43a7[_0x24fc51(0x144)]=new Date()[_0x24fc51(0x151)](),await writeBffLockFile(_0x453a37[_0x24fc51(0x14e)],_0x1ad027);const _0x2600f9=resolveLocalFilePathFromLockKey(_0x453a37,_0x53ea59);let _0x39434e;await fileExists(_0x2600f9)&&(_0x39434e=await moveToTrash(_0x453a37[_0x24fc51(0x15b)],_0x453a37['trashDir'],_0x2600f9),await cleanupEmptyDirectories(dirname(_0x2600f9),_0x453a37['scriptsRootDir']));const _0x4be77b={'deleted':_0x53ea59,'remoteId':_0x21cbd6[_0x24fc51(0x143)]};if(_0x39434e)_0x4be77b['trashedTo']=_0x39434e;return{'ok':!![],'data':_0x4be77b,'message':_0x24fc51(0x159)+_0x53ea59+(_0x39434e?_0x24fc51(0x15d):'')};}};function a18_0x3ba5(_0x217ffc,_0x8d14a){_0x217ffc=_0x217ffc-0x137;const _0x18bc3d=a18_0x18bc();let _0x3ba53a=_0x18bc3d[_0x217ffc];return _0x3ba53a;}function resolveDeleteTarget(_0x1c4703,_0x3d4866){const _0x230e4e=a18_0x3df8be;if(_0x1c4703['includes']('/')){const _0x339568=_0x3d4866[_0x230e4e(0x15a)](_0x4aff2c=>_0x4aff2c===_0x1c4703);if(!_0x339568)throw CliErrors[_0x230e4e(0x157)]('Function\x20not\x20found:\x20'+_0x1c4703);return _0x339568;}const _0x4d316d=_0x3d4866['filter'](_0x2c1c21=>_0x2c1c21[_0x230e4e(0x142)]('/')['at'](-0x1)===_0x1c4703);if(_0x4d316d['length']===0x0)throw CliErrors[_0x230e4e(0x157)](_0x230e4e(0x15e)+_0x1c4703);if(_0x4d316d[_0x230e4e(0x145)]>0x1)throw CliErrors['validation'](_0x230e4e(0x146)+_0x1c4703+_0x230e4e(0x149)+_0x4d316d[_0x230e4e(0x155)](_0x21f962=>_0x230e4e(0x14a)+_0x21f962)[_0x230e4e(0x138)]('\x0a'));return _0x4d316d[0x0];}async function moveToTrash(_0x2302af,_0x145f3b,_0x482055){const _0x2dfbac=a18_0x3df8be,_0xb34f3d=new Date()[_0x2dfbac(0x151)]()[_0x2dfbac(0x152)](/[:.]/g,'-'),_0x351fc0=relative(_0x2302af,_0x482055),_0x5373f3=join(_0x145f3b,_0xb34f3d,_0x351fc0);return await mkdir(dirname(_0x5373f3),{'recursive':!![]}),await rename(_0x482055,_0x5373f3),_0x5373f3;}async function cleanupEmptyDirectories(_0x76c303,_0x4ece66){const _0x5b08f8=a18_0x3df8be;let _0x2d22d4=resolve(_0x76c303);const _0xb30b5f=resolve(_0x4ece66);while(_0x2d22d4[_0x5b08f8(0x13a)](''+_0xb30b5f+sep)||_0x2d22d4===_0xb30b5f){if(_0x2d22d4===_0xb30b5f)return;try{const _0x59d1f2=await readdir(_0x2d22d4);if(_0x59d1f2[_0x5b08f8(0x145)]>0x0)return;await rmdir(_0x2d22d4);}catch{return;}_0x2d22d4=dirname(_0x2d22d4);}}
@@ -1 +1 @@
1
- const a20_0x3fb87d=a20_0x4129;(function(_0x5354d3,_0x3004fe){const _0x327b17=a20_0x4129,_0x1e13e1=_0x5354d3();while(!![]){try{const _0x7ab906=parseInt(_0x327b17(0xad))/0x1+-parseInt(_0x327b17(0xae))/0x2+-parseInt(_0x327b17(0xb8))/0x3+parseInt(_0x327b17(0xb3))/0x4*(-parseInt(_0x327b17(0xab))/0x5)+parseInt(_0x327b17(0xbf))/0x6*(parseInt(_0x327b17(0xb0))/0x7)+parseInt(_0x327b17(0xb2))/0x8*(parseInt(_0x327b17(0xa8))/0x9)+parseInt(_0x327b17(0xbc))/0xa;if(_0x7ab906===_0x3004fe)break;else _0x1e13e1['push'](_0x1e13e1['shift']());}catch(_0x2a7d1d){_0x1e13e1['push'](_0x1e13e1['shift']());}}}(a20_0x2333,0xdd26e));function a20_0x2333(){const _0x5262e7=['250216NuprHv','15676nMIojR','description','createdTime','bool','bff','1000323qTPDEO','scriptType','Script\x20ID','scriptContent','9919060tqGraw','verbose','(none)','44862JengqV','number','387ckJSLa','Get\x20BFF\x20script\x20details\x20by\x20ID','detail','840wAHEph','num','805629wDFmvZ','3536330tKjpKn','boolean','490oKAkcl','updatedTime'];a20_0x2333=function(){return _0x5262e7;};return a20_0x2333();}function a20_0x4129(_0x4c13a3,_0x320b0a){_0x4c13a3=_0x4c13a3-0xa8;const _0x2333b0=a20_0x2333();let _0x4129f7=_0x2333b0[_0x4c13a3];return _0x4129f7;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a20_0x3fb87d(0xb7),'command':a20_0x3fb87d(0xaa),'description':a20_0x3fb87d(0xa9),'risk':'read','flags':[{'name':'id','type':a20_0x3fb87d(0xc0),'required':!![],'description':a20_0x3fb87d(0xba)},{'name':a20_0x3fb87d(0xbd),'type':a20_0x3fb87d(0xaf),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x148048){const _0x3e8e2a=a20_0x3fb87d,_0xbcdf8d=await getBffScriptInfo(_0x148048[_0x3e8e2a(0xac)]('id')),_0x50fd86=_0x148048[_0x3e8e2a(0xb6)](_0x3e8e2a(0xbd));if(_0x50fd86)return{'ok':!![],'data':_0xbcdf8d};return{'ok':!![],'data':{'id':_0xbcdf8d['id'],'appCode':_0xbcdf8d['appCode'],'scriptType':_0xbcdf8d[_0x3e8e2a(0xb9)],'description':_0xbcdf8d[_0x3e8e2a(0xb4)]||_0x3e8e2a(0xbe),'createdTime':_0xbcdf8d[_0x3e8e2a(0xb5)]??'','updatedTime':_0xbcdf8d[_0x3e8e2a(0xb1)]??'','scriptContent':_0xbcdf8d[_0x3e8e2a(0xbb)]??''}};}};
1
+ const a19_0x23d2bb=a19_0x61df;(function(_0x1fffb2,_0x25632b){const _0x28d3f9=a19_0x61df,_0x3b42b8=_0x1fffb2();while(!![]){try{const _0x1f9154=parseInt(_0x28d3f9(0x8a))/0x1+parseInt(_0x28d3f9(0x96))/0x2+parseInt(_0x28d3f9(0x98))/0x3+parseInt(_0x28d3f9(0x86))/0x4+-parseInt(_0x28d3f9(0x91))/0x5*(parseInt(_0x28d3f9(0x89))/0x6)+parseInt(_0x28d3f9(0x85))/0x7*(parseInt(_0x28d3f9(0x83))/0x8)+-parseInt(_0x28d3f9(0x8c))/0x9*(parseInt(_0x28d3f9(0x84))/0xa);if(_0x1f9154===_0x25632b)break;else _0x3b42b8['push'](_0x3b42b8['shift']());}catch(_0x2b4969){_0x3b42b8['push'](_0x3b42b8['shift']());}}}(a19_0x103d,0x934c8));function a19_0x61df(_0x3b3efb,_0x3e5cc0){_0x3b3efb=_0x3b3efb-0x83;const _0x103d20=a19_0x103d();let _0x61df67=_0x103d20[_0x3b3efb];return _0x61df67;}import{getBffScriptInfo}from'../../core/api-client.js';function a19_0x103d(){const _0x304490=['appCode','read','6NnKueq','704494GZKgfI','(none)','16171371QclzlV','bff','boolean','description','bool','3092285BernGx','scriptType','Get\x20BFF\x20script\x20details\x20by\x20ID','Return\x20full\x20raw\x20script\x20object','verbose','579084BqhOrq','scriptContent','3452031VuMWkS','updatedTime','createdTime','8zUUtyq','10yReqoB','5682593kIbCcX','248400jxpPqg'];a19_0x103d=function(){return _0x304490;};return a19_0x103d();}export const bffDetail={'service':a19_0x23d2bb(0x8d),'command':'detail','description':a19_0x23d2bb(0x93),'risk':a19_0x23d2bb(0x88),'flags':[{'name':'id','type':'number','required':!![],'description':'Script\x20ID'},{'name':a19_0x23d2bb(0x95),'type':a19_0x23d2bb(0x8e),'description':a19_0x23d2bb(0x94)}],async 'execute'(_0x2ba2a6){const _0x4f93f7=a19_0x23d2bb,_0x27fe8e=await getBffScriptInfo(_0x2ba2a6['num']('id')),_0x290aec=_0x2ba2a6[_0x4f93f7(0x90)]('verbose');if(_0x290aec)return{'ok':!![],'data':_0x27fe8e};return{'ok':!![],'data':{'id':_0x27fe8e['id'],'appCode':_0x27fe8e[_0x4f93f7(0x87)],'scriptType':_0x27fe8e[_0x4f93f7(0x92)],'description':_0x27fe8e[_0x4f93f7(0x8f)]||_0x4f93f7(0x8b),'createdTime':_0x27fe8e[_0x4f93f7(0x9a)]??'','updatedTime':_0x27fe8e[_0x4f93f7(0x99)]??'','scriptContent':_0x27fe8e[_0x4f93f7(0x97)]??''}};}};
@@ -1 +1 @@
1
- function a21_0x1c01(_0x445e8a,_0x3ebf93){_0x445e8a=_0x445e8a-0xf2;const _0x4dd069=a21_0x4dd0();let _0x1c01ef=_0x4dd069[_0x445e8a];return _0x1c01ef;}(function(_0x1d36f2,_0x3e313c){const _0x31e9f0=a21_0x1c01,_0x5cb2f6=_0x1d36f2();while(!![]){try{const _0xe48877=parseInt(_0x31e9f0(0xf4))/0x1*(-parseInt(_0x31e9f0(0xf5))/0x2)+parseInt(_0x31e9f0(0xf2))/0x3+parseInt(_0x31e9f0(0xfa))/0x4*(-parseInt(_0x31e9f0(0xf3))/0x5)+-parseInt(_0x31e9f0(0xf6))/0x6+-parseInt(_0x31e9f0(0xf9))/0x7*(parseInt(_0x31e9f0(0xf7))/0x8)+-parseInt(_0x31e9f0(0xfb))/0x9+parseInt(_0x31e9f0(0xf8))/0xa;if(_0xe48877===_0x3e313c)break;else _0x5cb2f6['push'](_0x5cb2f6['shift']());}catch(_0x133817){_0x5cb2f6['push'](_0x5cb2f6['shift']());}}}(a21_0x4dd0,0xe1626));function a21_0x4dd0(){const _0x20020e=['87390KCppMp','4183736MosTHP','12896050fglMcc','7jKEdEq','1105172NaPoKp','4504626ynorUe','4446369rafzSo','10YXLjks','6141yXExmh','84GfTfUV'];a21_0x4dd0=function(){return _0x20020e;};return a21_0x4dd0();}import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ (function(_0x278b88,_0x433b4a){const _0x5cd1db=a20_0x2d5c,_0x1eeab1=_0x278b88();while(!![]){try{const _0x195431=-parseInt(_0x5cd1db(0x96))/0x1+parseInt(_0x5cd1db(0x90))/0x2+-parseInt(_0x5cd1db(0x98))/0x3*(parseInt(_0x5cd1db(0x95))/0x4)+-parseInt(_0x5cd1db(0x92))/0x5*(parseInt(_0x5cd1db(0x94))/0x6)+parseInt(_0x5cd1db(0x97))/0x7+-parseInt(_0x5cd1db(0x93))/0x8+parseInt(_0x5cd1db(0x91))/0x9;if(_0x195431===_0x433b4a)break;else _0x1eeab1['push'](_0x1eeab1['shift']());}catch(_0xc82079){_0x1eeab1['push'](_0x1eeab1['shift']());}}}(a20_0x2be4,0xde797));function a20_0x2be4(){const _0x9d6f94=['6647669HdHzhc','42765SQiuQF','1228570YvGQBP','7395228XQSKCr','5eYnCSg','7399248iGRDXt','726126aDrlTW','48nrnQIS','257402btQvLy'];a20_0x2be4=function(){return _0x9d6f94;};return a20_0x2be4();}import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';function a20_0x2d5c(_0x390a27,_0x55dddf){_0x390a27=_0x390a27-0x90;const _0x2be474=a20_0x2be4();let _0x2d5cd2=_0x2be474[_0x390a27];return _0x2d5cd2;}import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a22_0x3f0660=a22_0x12a1;(function(_0x18f36b,_0x592f76){const _0x426657=a22_0x12a1,_0x204bc6=_0x18f36b();while(!![]){try{const _0x826bdf=parseInt(_0x426657(0x1f4))/0x1*(-parseInt(_0x426657(0x1e6))/0x2)+parseInt(_0x426657(0x1fd))/0x3*(-parseInt(_0x426657(0x1df))/0x4)+-parseInt(_0x426657(0x1f3))/0x5*(parseInt(_0x426657(0x1ff))/0x6)+parseInt(_0x426657(0x1ec))/0x7+parseInt(_0x426657(0x1fe))/0x8*(-parseInt(_0x426657(0x1e0))/0x9)+-parseInt(_0x426657(0x1f9))/0xa*(-parseInt(_0x426657(0x1f7))/0xb)+parseInt(_0x426657(0x1f0))/0xc;if(_0x826bdf===_0x592f76)break;else _0x204bc6['push'](_0x204bc6['shift']());}catch(_0x4859a2){_0x204bc6['push'](_0x204bc6['shift']());}}}(a22_0x385e,0xd4afc));import{listBffScripts}from'../../core/api-client.js';function a22_0x12a1(_0x232d0f,_0x2b2acf){_0x232d0f=_0x232d0f-0x1de;const _0x385e3c=a22_0x385e();let _0x12a104=_0x385e3c[_0x232d0f];return _0x12a104;}function a22_0x385e(){const _0x4b7654=['boolean','List\x20BFF\x20scripts','93049WkAljC','type','580JUxEpZ','read','functionName','Script\x20type\x20filter','105801KtvsLf','8706008tMmyOw','4045506dkhafb','(unnamed)','12zdqDQR','9VspzzT','verbose','No\x20BFF\x20scripts\x20found.','ENDPOINT','bff','Filter\x20by\x20script\x20name','2302bFFPWL','bool','list','name','Return\x20full\x20script\x20objects','COMMON','2654120HImeOf','map','length','description','38554824SHtyAq','str','string','5GFcdcO','1167RXFtxt'];a22_0x385e=function(){return _0x4b7654;};return a22_0x385e();}export const bffList={'service':a22_0x3f0660(0x1e4),'command':a22_0x3f0660(0x1e8),'description':a22_0x3f0660(0x1f6),'risk':a22_0x3f0660(0x1fa),'flags':[{'name':a22_0x3f0660(0x1f8),'type':a22_0x3f0660(0x1f2),'description':a22_0x3f0660(0x1fc),'default':a22_0x3f0660(0x1e3),'enum':['ENDPOINT',a22_0x3f0660(0x1eb)]},{'name':a22_0x3f0660(0x1e9),'type':'string','description':a22_0x3f0660(0x1e5)},{'name':a22_0x3f0660(0x1e1),'type':a22_0x3f0660(0x1f5),'description':a22_0x3f0660(0x1ea)}],async 'execute'(_0x2833ee){const _0x5ada99=a22_0x3f0660,_0x2f2373=await listBffScripts(_0x2833ee['appCode'],_0x2833ee[_0x5ada99(0x1f1)](_0x5ada99(0x1f8)),{'scriptName':_0x2833ee[_0x5ada99(0x1f1)](_0x5ada99(0x1e9))||undefined}),_0x232e7f=_0x2833ee[_0x5ada99(0x1e7)](_0x5ada99(0x1e1));return{'ok':!![],'data':_0x232e7f?_0x2f2373:_0x2f2373[_0x5ada99(0x1ed)](_0x2c7122=>({'id':_0x2c7122['id'],'functionName':_0x2c7122[_0x5ada99(0x1fb)]??'','description':_0x2c7122[_0x5ada99(0x1ef)]||_0x5ada99(0x1de),'scriptType':_0x2c7122['scriptType']})),'message':_0x2f2373[_0x5ada99(0x1ee)]===0x0?_0x5ada99(0x1e2):undefined};}};
1
+ function a21_0x96c2(_0x15eda4,_0x44f258){_0x15eda4=_0x15eda4-0xa1;const _0x3fe2ce=a21_0x3fe2();let _0x96c244=_0x3fe2ce[_0x15eda4];return _0x96c244;}const a21_0x39e205=a21_0x96c2;(function(_0x1654de,_0x2582f7){const _0x8a4da4=a21_0x96c2,_0x2c0986=_0x1654de();while(!![]){try{const _0xe9b937=-parseInt(_0x8a4da4(0xaa))/0x1*(-parseInt(_0x8a4da4(0xae))/0x2)+parseInt(_0x8a4da4(0xb6))/0x3+parseInt(_0x8a4da4(0xa3))/0x4+parseInt(_0x8a4da4(0xb3))/0x5+parseInt(_0x8a4da4(0xad))/0x6*(-parseInt(_0x8a4da4(0xab))/0x7)+parseInt(_0x8a4da4(0xb5))/0x8+-parseInt(_0x8a4da4(0xb4))/0x9;if(_0xe9b937===_0x2582f7)break;else _0x2c0986['push'](_0x2c0986['shift']());}catch(_0x1c6022){_0x2c0986['push'](_0x2c0986['shift']());}}}(a21_0x3fe2,0x4804c));function a21_0x3fe2(){const _0x5cee32=['Script\x20type\x20filter','ENDPOINT','scriptType','Return\x20full\x20script\x20objects','boolean','11172sNEMMO','List\x20BFF\x20scripts','(unnamed)','bff','length','string','verbose','1IFWLvJ','42UPzdKE','map','452604CVScTd','79400JwZchb','name','Filter\x20by\x20script\x20name','read','appCode','1055840vopkdI','4247712vrkxjD','3602408byyaNT','1546794qhkmUV','bool','str'];a21_0x3fe2=function(){return _0x5cee32;};return a21_0x3fe2();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a21_0x39e205(0xa6),'command':'list','description':a21_0x39e205(0xa4),'risk':a21_0x39e205(0xb1),'flags':[{'name':'type','type':'string','description':a21_0x39e205(0xb9),'default':a21_0x39e205(0xba),'enum':['ENDPOINT','COMMON']},{'name':a21_0x39e205(0xaf),'type':a21_0x39e205(0xa8),'description':a21_0x39e205(0xb0)},{'name':a21_0x39e205(0xa9),'type':a21_0x39e205(0xa2),'description':a21_0x39e205(0xa1)}],async 'execute'(_0x5b651e){const _0xf9954e=a21_0x39e205,_0x361c0a=await listBffScripts(_0x5b651e[_0xf9954e(0xb2)],_0x5b651e[_0xf9954e(0xb8)]('type'),{'scriptName':_0x5b651e['str'](_0xf9954e(0xaf))||undefined}),_0x365a55=_0x5b651e[_0xf9954e(0xb7)](_0xf9954e(0xa9));return{'ok':!![],'data':_0x365a55?_0x361c0a:_0x361c0a[_0xf9954e(0xac)](_0x413241=>({'id':_0x413241['id'],'functionName':_0x413241['functionName']??'','description':_0x413241['description']||_0xf9954e(0xa5),'scriptType':_0x413241[_0xf9954e(0xbb)]})),'message':_0x361c0a[_0xf9954e(0xa7)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
@@ -1 +1 @@
1
- const a23_0x266c6a=a23_0x244c;function a23_0x1854(){const _0xa17af1=['2715327xzpwWn','\x22\x20not\x20found\x20for\x20dataset\x20','str','nonInteractive','datasetcode','description','question','Script\x20description','TODO:\x20add\x20script\x20description','38856cRCQYe','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','isInteger','File\x20already\x20exists:\x20','function-node','stdin','.js','HOOK','keys','496143qJEvAe','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x22.\x20','.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','Trigger\x20node\x20(HOOK\x20only)','parseInt','Select\x20operation\x20type:','operationType','write','Script\x20type','\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','Dataset\x20not\x20found\x20for\x20code\x20\x22','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','450BEqxKK','after','ENDPOINT','Available:\x20','map','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Alias\x20\x22','2537208xqsRPN','scriptsRootDir','Created\x20','Operation\x20type\x20(HOOK\x20only)','datasetCode','COMMON','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','type','No\x20operation\x20types\x20found\x20for\x20dataset\x20','468buwpNH','429aXOSwQ','Select\x20dataset:','4YJLlYl','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','string','No\x20api.ts\x20found.\x20Run\x20`','Invalid\x20dataset\x20selection.','includes','HOOK\x20requires\x20alias/operation/node\x20options.','\x20function:\x20','functionNode','trim','stderr','Available\x20aliases:\x20','name','14bXZpJW','before','\x22\x20not\x20found.\x20','Select\x20trigger\x20node:','772488oSxtit','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','alias','apiDir','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','appCode','\x0a\x20*\x20[触发节点]\x20','operation-type','69672NhtVej','\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','length','code','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','find','\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','130530NEnsBJ','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Function\x20name\x20(valid\x20JS\x20identifier)','new','validation'];a23_0x1854=function(){return _0xa17af1;};return a23_0x1854();}(function(_0x4f5696,_0x1ae804){const _0x190412=a23_0x244c,_0x2daaad=_0x4f5696();while(!![]){try{const _0x5577d3=parseInt(_0x190412(0x174))/0x1+parseInt(_0x190412(0x14a))/0x2+parseInt(_0x190412(0x162))/0x3*(-parseInt(_0x190412(0x139))/0x4)+parseInt(_0x190412(0x181))/0x5*(-parseInt(_0x190412(0x16b))/0x6)+parseInt(_0x190412(0x146))/0x7*(parseInt(_0x190412(0x188))/0x8)+-parseInt(_0x190412(0x136))/0x9*(-parseInt(_0x190412(0x15c))/0xa)+parseInt(_0x190412(0x137))/0xb*(-parseInt(_0x190412(0x152))/0xc);if(_0x5577d3===_0x1ae804)break;else _0x2daaad['push'](_0x2daaad['shift']());}catch(_0x19c2be){_0x2daaad['push'](_0x2daaad['shift']());}}}(a23_0x1854,0x75726));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a23_0x244c(_0x2ad630,_0x19883c){_0x2ad630=_0x2ad630-0x132;const _0x1854c5=a23_0x1854();let _0x244cd2=_0x1854c5[_0x2ad630];return _0x244cd2;}export const bffNew={'service':'bff','command':a23_0x266c6a(0x160),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a23_0x266c6a(0x17c),'flags':[{'name':a23_0x266c6a(0x134),'type':a23_0x266c6a(0x13b),'required':!![],'enum':[a23_0x266c6a(0x132),a23_0x266c6a(0x183),a23_0x266c6a(0x172)],'description':a23_0x266c6a(0x17d)},{'name':a23_0x266c6a(0x145),'type':'string','required':!![],'description':a23_0x266c6a(0x15f)},{'name':a23_0x266c6a(0x167),'type':'string','description':a23_0x266c6a(0x169)},{'name':'alias','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x175)},{'name':'datasetcode','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x15a)},{'name':'operation-type','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x18b)},{'name':a23_0x266c6a(0x16f),'type':'string','description':a23_0x266c6a(0x178),'enum':[a23_0x266c6a(0x147),'after']}],async 'validate'(_0x35b13d){const _0x4d44d6=a23_0x266c6a,_0x57495e=_0x35b13d[_0x4d44d6(0x164)](_0x4d44d6(0x145));if(!isValidBffFunctionName(_0x57495e))throw CliErrors['validation']('Invalid\x20function\x20name\x20\x22'+_0x57495e+_0x4d44d6(0x14e));},async 'execute'(_0x305544){const _0x1891e4=a23_0x266c6a,_0x3e8107=loadBffProjectConfig(_0x305544['appCode']),_0x44dc11=_0x305544[_0x1891e4(0x164)](_0x1891e4(0x134)),_0x4fa0fb=_0x305544[_0x1891e4(0x164)](_0x1891e4(0x145)),_0x168af9=_0x305544['str'](_0x1891e4(0x167))||undefined,_0x4224de=_0x44dc11===_0x1891e4(0x172)?await resolveHookOptions(_0x3e8107,_0x305544):undefined,_0x1afe0d=buildFilePath(_0x3e8107,_0x44dc11,_0x4fa0fb,_0x4224de);if(await fileExists(_0x1afe0d))throw CliErrors[_0x1891e4(0x161)](_0x1891e4(0x16e)+_0x1afe0d);await mkdir(dirname(_0x1afe0d),{'recursive':!![]});const _0x1af3d7=generateTemplate(_0x44dc11,_0x4fa0fb,_0x3e8107,_0x168af9,_0x4224de);await writeFile(_0x1afe0d,_0x1af3d7,_0x1891e4(0x157));const _0x2430e5={'type':_0x44dc11,'name':_0x4fa0fb,'path':_0x1afe0d};if(_0x168af9)_0x2430e5[_0x1891e4(0x167)]=_0x168af9;if(_0x4224de){if(_0x4224de[_0x1891e4(0x14c)])_0x2430e5[_0x1891e4(0x14c)]=_0x4224de[_0x1891e4(0x14c)];_0x2430e5['datasetCode']=_0x4224de['datasetCode'],_0x2430e5[_0x1891e4(0x17b)]=_0x4224de['operationType'],_0x2430e5[_0x1891e4(0x141)]=_0x4224de[_0x1891e4(0x141)];}return{'ok':!![],'data':_0x2430e5,'message':_0x1891e4(0x18a)+_0x44dc11+_0x1891e4(0x140)+_0x4fa0fb};}};async function resolveHookOptions(_0x3473f8,_0x56f1db){const _0x510faa=a23_0x266c6a,_0x44c0cd=loadAliasMap(_0x56f1db[_0x510faa(0x14d)]),_0x467381=_0x44c0cd[_0x510faa(0x154)]>0x0;let _0x339731,_0x557468,_0x1c0838;const _0x65be3c=_0x56f1db[_0x510faa(0x164)](_0x510faa(0x14c)),_0x52f226=_0x56f1db['str'](_0x510faa(0x166));if(_0x65be3c){const _0x257a97=resolveAlias(_0x56f1db[_0x510faa(0x14d)],_0x65be3c);if(!_0x257a97){const _0x38d6d7=_0x467381?_0x510faa(0x144)+_0x44c0cd[_0x510faa(0x185)](_0x319454=>_0x319454[_0x510faa(0x14c)])['join'](',\x20'):_0x510faa(0x13c)+CLI_BIN_NAME+_0x510faa(0x15b);throw CliErrors[_0x510faa(0x161)](_0x510faa(0x187)+_0x65be3c+_0x510faa(0x148)+_0x38d6d7);}_0x339731=_0x65be3c,_0x557468=_0x257a97;}else{if(_0x52f226){_0x557468=_0x52f226;const _0x1ea7e3=_0x44c0cd[_0x510faa(0x158)](_0x352bb5=>_0x352bb5[_0x510faa(0x18c)]===_0x52f226);_0x339731=_0x1ea7e3?.[_0x510faa(0x14c)];}else{if(_0x56f1db[_0x510faa(0x165)])throw CliErrors[_0x510faa(0x161)](_0x510faa(0x16c));else{if(_0x467381){const _0x56a2ec=_0x44c0cd[_0x510faa(0x185)](_0x40f6e2=>_0x40f6e2[_0x510faa(0x14c)]+'\x20('+_0x40f6e2['tableName']+')'),_0x100aeb=await promptSelect(_0x510faa(0x138),_0x56a2ec),_0x43fe82=_0x44c0cd[_0x100aeb];if(!_0x43fe82)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x13d));_0x339731=_0x43fe82[_0x510faa(0x14c)],_0x557468=_0x43fe82[_0x510faa(0x18c)];}else{const _0xdc390e=await listDatasets(_0x3473f8[_0x510faa(0x14f)]);if(_0xdc390e[_0x510faa(0x154)]===0x0)throw CliErrors[_0x510faa(0x161)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x2c03dc=_0xdc390e['map'](_0x26274b=>_0x26274b[_0x510faa(0x145)]+'\x20('+_0x26274b[_0x510faa(0x155)]+')'),_0xd30ea6=await promptSelect(_0x510faa(0x138),_0x2c03dc),_0x3b8d44=_0xdc390e[_0xd30ea6];if(!_0x3b8d44)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x13d));_0x557468=_0x3b8d44[_0x510faa(0x155)],_0x339731=undefined;}}}}const _0x205ee9=await listDatasets(_0x3473f8[_0x510faa(0x14f)]),_0x581ec9=_0x205ee9[_0x510faa(0x158)](_0x3ac5b5=>_0x3ac5b5[_0x510faa(0x155)]===_0x557468);if(!_0x581ec9)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x17f)+_0x557468+_0x510faa(0x176)+(_0x339731?_0x510faa(0x14b)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1c0838=_0x581ec9['id'];const _0x44373a=_0x339731??_0x557468,_0x422b23=await listBffDatasetOperations(_0x3473f8[_0x510faa(0x14f)],_0x1c0838),_0x4e0bb9=_0x422b23?Object[_0x510faa(0x173)](_0x422b23):[];if(_0x4e0bb9['length']===0x0)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x135)+_0x44373a+'.');let _0x39d658;const _0x2688fb=_0x56f1db['str'](_0x510faa(0x151));if(_0x2688fb){if(!_0x4e0bb9[_0x510faa(0x13e)](_0x2688fb))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x2688fb+_0x510faa(0x163)+_0x44373a+'.\x20'+(_0x510faa(0x184)+_0x4e0bb9['join'](',\x20')));_0x39d658=_0x2688fb;}else{if(_0x56f1db[_0x510faa(0x165)])throw CliErrors[_0x510faa(0x161)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xfe041f=await promptSelect(_0x510faa(0x17a),_0x4e0bb9);_0x39d658=_0x4e0bb9[_0xfe041f]??_0x4e0bb9[0x0];}let _0xadf71f=normalizeHookFunctionNode(_0x56f1db[_0x510faa(0x164)](_0x510faa(0x16f)));if(!_0xadf71f){if(_0x56f1db[_0x510faa(0x164)](_0x510faa(0x16f)))throw CliErrors['validation'](_0x510faa(0x180));if(_0x56f1db[_0x510faa(0x165)])throw CliErrors['validation'](_0x510faa(0x156));const _0x5e0866=await promptSelect(_0x510faa(0x149),[_0x510faa(0x147),_0x510faa(0x182)]);_0xadf71f=[_0x510faa(0x147),_0x510faa(0x182)][_0x5e0866]??_0x510faa(0x147);}return{'alias':_0x339731,'datasetCode':_0x557468,'datasetId':_0x1c0838,'operationType':_0x39d658,'functionNode':_0xadf71f};}async function promptSelect(_0x2b7287,_0x466c8e){const _0x3eba1a=a23_0x266c6a;if(_0x466c8e[_0x3eba1a(0x154)]===0x1)return 0x0;for(const [_0x43d7da,_0x468128]of _0x466c8e['entries']()){process[_0x3eba1a(0x143)][_0x3eba1a(0x17c)]('\x20\x20'+(_0x43d7da+0x1)+'.\x20'+_0x468128+'\x0a');}const _0x1a0f98=createInterface({'input':process[_0x3eba1a(0x170)],'output':process[_0x3eba1a(0x143)]});while(!![]){const _0x23fac0=await new Promise(_0xcf2d17=>{const _0x5f3ab7=_0x3eba1a;_0x1a0f98[_0x5f3ab7(0x168)](_0x2b7287+'\x20',_0xcf2d17);}),_0x5bc4a3=Number[_0x3eba1a(0x179)](_0x23fac0[_0x3eba1a(0x142)](),0xa);if(Number[_0x3eba1a(0x16d)](_0x5bc4a3)&&_0x5bc4a3>=0x1&&_0x5bc4a3<=_0x466c8e[_0x3eba1a(0x154)])return _0x1a0f98['close'](),_0x5bc4a3-0x1;process[_0x3eba1a(0x143)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x466c8e[_0x3eba1a(0x154)]+'.\x0a');}}function buildFilePath(_0x278f5d,_0x145381,_0x184426,_0x4b301f){const _0x49c54a=a23_0x266c6a;if(_0x145381==='HOOK'){if(!_0x4b301f)throw CliErrors['validation'](_0x49c54a(0x13f));const _0x203539=_0x4b301f[_0x49c54a(0x14c)]??_0x4b301f[_0x49c54a(0x18c)];return join(_0x278f5d[_0x49c54a(0x189)],_0x49c54a(0x172),_0x203539,_0x4b301f[_0x49c54a(0x17b)],_0x4b301f[_0x49c54a(0x141)],_0x184426+_0x49c54a(0x171));}return join(_0x278f5d[_0x49c54a(0x189)],_0x145381,_0x184426+_0x49c54a(0x171));}function generateTemplate(_0x414a3c,_0x45cd57,_0x4d72aa,_0x3002c9,_0x4f313b){const _0x617214=a23_0x266c6a,_0x56bc51=_0x3002c9?.[_0x617214(0x142)]()||_0x617214(0x16a);if(_0x414a3c==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x56bc51+_0x617214(0x159)+_0x45cd57+_0x617214(0x15e)+_0x45cd57+_0x617214(0x177)+_0x45cd57+_0x617214(0x133);if(_0x414a3c==='ENDPOINT')return _0x617214(0x186)+_0x56bc51+_0x617214(0x15d)+_0x4d72aa['appCode']+'/endpoint/'+_0x45cd57+_0x617214(0x153)+_0x45cd57+_0x617214(0x133);if(!_0x4f313b)throw CliErrors[_0x617214(0x161)](_0x617214(0x13a));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x56bc51+_0x617214(0x15d)+_0x4d72aa[_0x617214(0x14f)]+'/'+_0x4f313b['datasetCode']+'/'+_0x4f313b['operationType']+_0x617214(0x150)+_0x4f313b[_0x617214(0x141)]+_0x617214(0x17e)+_0x45cd57+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';}
1
+ const a22_0x4615d1=a22_0x5ea9;(function(_0x4e899d,_0x586ce2){const _0x22046b=a22_0x5ea9,_0x5bea0c=_0x4e899d();while(!![]){try{const _0x4189ec=parseInt(_0x22046b(0x208))/0x1*(parseInt(_0x22046b(0x22a))/0x2)+parseInt(_0x22046b(0x1f0))/0x3+-parseInt(_0x22046b(0x232))/0x4+-parseInt(_0x22046b(0x20c))/0x5+-parseInt(_0x22046b(0x1e8))/0x6+parseInt(_0x22046b(0x1f6))/0x7*(-parseInt(_0x22046b(0x1f7))/0x8)+parseInt(_0x22046b(0x1f5))/0x9*(parseInt(_0x22046b(0x207))/0xa);if(_0x4189ec===_0x586ce2)break;else _0x5bea0c['push'](_0x5bea0c['shift']());}catch(_0x2584a6){_0x5bea0c['push'](_0x5bea0c['shift']());}}}(a22_0x564d,0x2a239));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';function a22_0x564d(){const _0x2988dc=['after','validation','TODO:\x20add\x20script\x20description','functionNode','function-node','type','10XCkBlf','7103ItVyrT','datasetCode','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','includes','202570shxBNt','HOOK','apiDir','datasetcode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Select\x20operation\x20type:','Alias\x20\x22','before','alias','map','tableName','\x20api\x20pull`\x20to\x20refresh.','bff','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','.js','.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','Operation\x20type\x20\x22','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','write','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[触发节点]\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','find','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','trim','\x20function:\x20','str','scriptsRootDir','parseInt','58HjdSXF','ENDPOINT','name','Script\x20description','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','Script\x20type','close','Select\x20trigger\x20node:','826248WnmxCf','question','appCode','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','stderr','Available\x20aliases:\x20','HOOK\x20requires\x20alias/operation/node\x20options.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','operationType','join','isInteger','nonInteractive','572988bVyABL','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Invalid\x20function\x20name\x20\x22','description','File\x20already\x20exists:\x20','Select\x20dataset:','Dataset\x20not\x20found\x20for\x20code\x20\x22','code','65847LLOUwj','Invalid\x20dataset\x20selection.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','entries','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','4810653RcJqLR','576982QsbQdI','24iIFqZF','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','No\x20datasets\x20found\x20for\x20this\x20app.','operation-type','string','Trigger\x20node\x20(HOOK\x20only)','Created\x20','\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','Available:\x20','length'];a22_0x564d=function(){return _0x2988dc;};return a22_0x564d();}import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a22_0x5ea9(_0x53a8e1,_0x3d4dde){_0x53a8e1=_0x53a8e1-0x1e2;const _0x564d5e=a22_0x564d();let _0x5ea97e=_0x564d5e[_0x53a8e1];return _0x5ea97e;}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':a22_0x4615d1(0x218),'command':'new','description':a22_0x4615d1(0x22e),'risk':a22_0x4615d1(0x21e),'flags':[{'name':a22_0x4615d1(0x206),'type':a22_0x4615d1(0x1fb),'required':!![],'enum':['COMMON',a22_0x4615d1(0x22b),a22_0x4615d1(0x20d)],'description':a22_0x4615d1(0x22f)},{'name':a22_0x4615d1(0x22c),'type':a22_0x4615d1(0x1fb),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a22_0x4615d1(0x1eb),'type':a22_0x4615d1(0x1fb),'description':a22_0x4615d1(0x22d)},{'name':'alias','type':a22_0x4615d1(0x1fb),'description':a22_0x4615d1(0x222)},{'name':'datasetcode','type':a22_0x4615d1(0x1fb),'description':a22_0x4615d1(0x220)},{'name':a22_0x4615d1(0x1fa),'type':a22_0x4615d1(0x1fb),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a22_0x4615d1(0x205),'type':a22_0x4615d1(0x1fb),'description':a22_0x4615d1(0x1fc),'enum':[a22_0x4615d1(0x213),a22_0x4615d1(0x201)]}],async 'validate'(_0x1d5046){const _0x174385=a22_0x4615d1,_0x2f9b44=_0x1d5046[_0x174385(0x227)](_0x174385(0x22c));if(!isValidBffFunctionName(_0x2f9b44))throw CliErrors[_0x174385(0x202)](_0x174385(0x1ea)+_0x2f9b44+_0x174385(0x1e9));},async 'execute'(_0x9f09dc){const _0x401398=a22_0x4615d1,_0x85b4d0=loadBffProjectConfig(_0x9f09dc[_0x401398(0x234)]),_0x4cd57e=_0x9f09dc[_0x401398(0x227)]('type'),_0x4df151=_0x9f09dc[_0x401398(0x227)]('name'),_0x2a007f=_0x9f09dc[_0x401398(0x227)](_0x401398(0x1eb))||undefined,_0xcfeeaa=_0x4cd57e==='HOOK'?await resolveHookOptions(_0x85b4d0,_0x9f09dc):undefined,_0x385f55=buildFilePath(_0x85b4d0,_0x4cd57e,_0x4df151,_0xcfeeaa);if(await fileExists(_0x385f55))throw CliErrors[_0x401398(0x202)](_0x401398(0x1ec)+_0x385f55);await mkdir(dirname(_0x385f55),{'recursive':!![]});const _0x170871=generateTemplate(_0x4cd57e,_0x4df151,_0x85b4d0,_0x2a007f,_0xcfeeaa);await writeFile(_0x385f55,_0x170871,'utf8');const _0x13bc56={'type':_0x4cd57e,'name':_0x4df151,'path':_0x385f55};if(_0x2a007f)_0x13bc56[_0x401398(0x1eb)]=_0x2a007f;if(_0xcfeeaa){if(_0xcfeeaa[_0x401398(0x214)])_0x13bc56[_0x401398(0x214)]=_0xcfeeaa[_0x401398(0x214)];_0x13bc56['datasetCode']=_0xcfeeaa[_0x401398(0x209)],_0x13bc56[_0x401398(0x1e4)]=_0xcfeeaa[_0x401398(0x1e4)],_0x13bc56[_0x401398(0x204)]=_0xcfeeaa[_0x401398(0x204)];}return{'ok':!![],'data':_0x13bc56,'message':_0x401398(0x1fd)+_0x4cd57e+_0x401398(0x226)+_0x4df151};}};async function resolveHookOptions(_0x524f22,_0xe831e){const _0x48c942=a22_0x4615d1,_0x5398b3=loadAliasMap(_0xe831e[_0x48c942(0x20e)]),_0x408bf7=_0x5398b3[_0x48c942(0x200)]>0x0;let _0x11d53b,_0x24880e,_0x438f78;const _0x3c302c=_0xe831e[_0x48c942(0x227)](_0x48c942(0x214)),_0x5d8b6b=_0xe831e[_0x48c942(0x227)](_0x48c942(0x20f));if(_0x3c302c){const _0x597b1d=resolveAlias(_0xe831e['apiDir'],_0x3c302c);if(!_0x597b1d){const _0x4fe115=_0x408bf7?_0x48c942(0x237)+_0x5398b3['map'](_0x18d583=>_0x18d583[_0x48c942(0x214)])[_0x48c942(0x1e5)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x48c942(0x21d);throw CliErrors[_0x48c942(0x202)](_0x48c942(0x212)+_0x3c302c+'\x22\x20not\x20found.\x20'+_0x4fe115);}_0x11d53b=_0x3c302c,_0x24880e=_0x597b1d;}else{if(_0x5d8b6b){_0x24880e=_0x5d8b6b;const _0x1d9bbe=_0x5398b3[_0x48c942(0x223)](_0x16f1fd=>_0x16f1fd[_0x48c942(0x209)]===_0x5d8b6b);_0x11d53b=_0x1d9bbe?.[_0x48c942(0x214)];}else{if(_0xe831e[_0x48c942(0x1e7)])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x408bf7){const _0xd58ebe=_0x5398b3[_0x48c942(0x215)](_0x426229=>_0x426229[_0x48c942(0x214)]+'\x20('+_0x426229[_0x48c942(0x216)]+')'),_0x3f6b07=await promptSelect(_0x48c942(0x1ed),_0xd58ebe),_0x51201e=_0x5398b3[_0x3f6b07];if(!_0x51201e)throw CliErrors[_0x48c942(0x202)]('Invalid\x20dataset\x20selection.');_0x11d53b=_0x51201e[_0x48c942(0x214)],_0x24880e=_0x51201e[_0x48c942(0x209)];}else{const _0x4a4e94=await listDatasets(_0x524f22[_0x48c942(0x234)]);if(_0x4a4e94['length']===0x0)throw CliErrors[_0x48c942(0x202)](_0x48c942(0x1f9));const _0x48df63=_0x4a4e94['map'](_0x2ff9a4=>_0x2ff9a4[_0x48c942(0x22c)]+'\x20('+_0x2ff9a4[_0x48c942(0x1ef)]+')'),_0x21b01d=await promptSelect(_0x48c942(0x1ed),_0x48df63),_0x269105=_0x4a4e94[_0x21b01d];if(!_0x269105)throw CliErrors[_0x48c942(0x202)](_0x48c942(0x1f1));_0x24880e=_0x269105['code'],_0x11d53b=undefined;}}}}const _0x5b6f39=await listDatasets(_0x524f22[_0x48c942(0x234)]),_0x3a1176=_0x5b6f39[_0x48c942(0x223)](_0x4a614a=>_0x4a614a[_0x48c942(0x1ef)]===_0x24880e);if(!_0x3a1176)throw CliErrors[_0x48c942(0x202)](_0x48c942(0x1ee)+_0x24880e+'\x22.\x20'+(_0x11d53b?_0x48c942(0x21f)+CLI_BIN_NAME+_0x48c942(0x217):''));_0x438f78=_0x3a1176['id'];const _0x34328f=_0x11d53b??_0x24880e,_0x4865de=await listBffDatasetOperations(_0x524f22[_0x48c942(0x234)],_0x438f78),_0x2caa9f=_0x4865de?Object['keys'](_0x4865de):[];if(_0x2caa9f[_0x48c942(0x200)]===0x0)throw CliErrors[_0x48c942(0x202)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x34328f+'.');let _0x428877;const _0x3ddb80=_0xe831e[_0x48c942(0x227)]('operation-type');if(_0x3ddb80){if(!_0x2caa9f[_0x48c942(0x20b)](_0x3ddb80))throw CliErrors[_0x48c942(0x202)](_0x48c942(0x21c)+_0x3ddb80+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x34328f+'.\x20'+(_0x48c942(0x1ff)+_0x2caa9f['join'](',\x20')));_0x428877=_0x3ddb80;}else{if(_0xe831e[_0x48c942(0x1e7)])throw CliErrors[_0x48c942(0x202)](_0x48c942(0x1f2));const _0x5bf765=await promptSelect(_0x48c942(0x211),_0x2caa9f);_0x428877=_0x2caa9f[_0x5bf765]??_0x2caa9f[0x0];}let _0x1363cf=normalizeHookFunctionNode(_0xe831e['str'](_0x48c942(0x205)));if(!_0x1363cf){if(_0xe831e[_0x48c942(0x227)](_0x48c942(0x205)))throw CliErrors[_0x48c942(0x202)](_0x48c942(0x1f8));if(_0xe831e[_0x48c942(0x1e7)])throw CliErrors['validation'](_0x48c942(0x224));const _0x137a35=await promptSelect(_0x48c942(0x231),[_0x48c942(0x213),_0x48c942(0x201)]);_0x1363cf=['before',_0x48c942(0x201)][_0x137a35]??'before';}return{'alias':_0x11d53b,'datasetCode':_0x24880e,'datasetId':_0x438f78,'operationType':_0x428877,'functionNode':_0x1363cf};}async function promptSelect(_0x23f8ee,_0x1acdb3){const _0x49defc=a22_0x4615d1;if(_0x1acdb3[_0x49defc(0x200)]===0x1)return 0x0;for(const [_0xf09872,_0x546516]of _0x1acdb3[_0x49defc(0x1f3)]()){process[_0x49defc(0x236)][_0x49defc(0x21e)]('\x20\x20'+(_0xf09872+0x1)+'.\x20'+_0x546516+'\x0a');}const _0xe6fe06=createInterface({'input':process['stdin'],'output':process[_0x49defc(0x236)]});while(!![]){const _0x22636d=await new Promise(_0x47daa2=>{const _0x1694a2=_0x49defc;_0xe6fe06[_0x1694a2(0x233)](_0x23f8ee+'\x20',_0x47daa2);}),_0x1a72dc=Number[_0x49defc(0x229)](_0x22636d['trim'](),0xa);if(Number[_0x49defc(0x1e6)](_0x1a72dc)&&_0x1a72dc>=0x1&&_0x1a72dc<=_0x1acdb3[_0x49defc(0x200)])return _0xe6fe06[_0x49defc(0x230)](),_0x1a72dc-0x1;process['stderr'][_0x49defc(0x21e)](_0x49defc(0x1e2)+_0x1acdb3[_0x49defc(0x200)]+'.\x0a');}}function buildFilePath(_0x75bdc3,_0x5dd687,_0x13e6b2,_0x41db16){const _0xec1347=a22_0x4615d1;if(_0x5dd687===_0xec1347(0x20d)){if(!_0x41db16)throw CliErrors[_0xec1347(0x202)](_0xec1347(0x238));const _0x108ce9=_0x41db16[_0xec1347(0x214)]??_0x41db16[_0xec1347(0x209)];return join(_0x75bdc3[_0xec1347(0x228)],_0xec1347(0x20d),_0x108ce9,_0x41db16[_0xec1347(0x1e4)],_0x41db16[_0xec1347(0x204)],_0x13e6b2+'.js');}return join(_0x75bdc3['scriptsRootDir'],_0x5dd687,_0x13e6b2+_0xec1347(0x21a));}function generateTemplate(_0xc6e93e,_0x543ec3,_0xf8194a,_0x2d4343,_0x40f5bf){const _0xef5e41=a22_0x4615d1,_0x4418cc=_0x2d4343?.[_0xef5e41(0x225)]()||_0xef5e41(0x203);if(_0xc6e93e==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x4418cc+'\x0a\x20*\x20[脚本名称]\x20'+_0x543ec3+_0xef5e41(0x235)+_0x543ec3+_0xef5e41(0x21b)+_0x543ec3+_0xef5e41(0x219);if(_0xc6e93e==='ENDPOINT')return _0xef5e41(0x1f4)+_0x4418cc+_0xef5e41(0x210)+_0xf8194a[_0xef5e41(0x234)]+'/endpoint/'+_0x543ec3+_0xef5e41(0x1fe)+_0x543ec3+_0xef5e41(0x219);if(!_0x40f5bf)throw CliErrors[_0xef5e41(0x202)](_0xef5e41(0x1e3));return _0xef5e41(0x20a)+_0x4418cc+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0xf8194a['appCode']+'/'+_0x40f5bf[_0xef5e41(0x209)]+'/'+_0x40f5bf['operationType']+_0xef5e41(0x221)+_0x40f5bf[_0xef5e41(0x204)]+'\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'+_0x543ec3+_0xef5e41(0x219);}
@@ -1 +1 @@
1
- const a24_0x33e56c=a24_0x4304;(function(_0xb25d04,_0x49c7ca){const _0x1541c9=a24_0x4304,_0x51e820=_0xb25d04();while(!![]){try{const _0x53a00d=parseInt(_0x1541c9(0x102))/0x1+-parseInt(_0x1541c9(0x103))/0x2*(parseInt(_0x1541c9(0x12b))/0x3)+parseInt(_0x1541c9(0x11d))/0x4*(parseInt(_0x1541c9(0x10c))/0x5)+-parseInt(_0x1541c9(0x108))/0x6+-parseInt(_0x1541c9(0x12d))/0x7+parseInt(_0x1541c9(0x114))/0x8+-parseInt(_0x1541c9(0xee))/0x9*(-parseInt(_0x1541c9(0x12e))/0xa);if(_0x53a00d===_0x49c7ca)break;else _0x51e820['push'](_0x51e820['shift']());}catch(_0x4aed41){_0x51e820['push'](_0x51e820['shift']());}}}(a24_0x3039,0xe7c65));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a24_0x4304(_0x473ca4,_0x395cff){_0x473ca4=_0x473ca4-0xea;const _0x30396c=a24_0x3039();let _0x43042a=_0x30396c[_0x473ca4];return _0x43042a;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';function a24_0x3039(){const _0x29c5fa=['lockFilePath','ENDPOINT','filePath','aliases','Force\x20pull\x20cancelled.','859216gJcnCa','datasetCode','bff','functionName','stdin','bool','push','scriptsWorkspaceRoot','functionNode','12pgkoUS','version','scriptType','appCode','Remote\x20script\x20missing\x20id.','validation','hash','HOOK','type','utf8','force','string','/api/management/library/scripts/list','local\x20unsynced\x20changes','249TsWGjP','scriptContent','5834178zYkBoB','3263290mJSEaQ','apps','nonInteractive','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','GET','boolean','\x20pulled,\x20','yes','fromEntries','54kLHUTb','close','functions','COMMON','pull','length','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','str','alias','Pull\x20complete:\x20','lockKey','hookLocation','apiDir','toLowerCase','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lastSync','unresolvable\x20target\x20path','scriptsRoot','\x20file(s)','695589MTRebR','1852vmVEPC','operationType','all','toISOString','stderr','10743240qhsXJa','\x20failed','write','includes','1482060POOETm','Remote\x20script\x20missing\x20content.','map'];a24_0x3039=function(){return _0x29c5fa;};return a24_0x3039();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a24_0x33e56c(0x116),'command':'pull','description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a24_0x33e56c(0x10a),'flags':[{'name':a24_0x33e56c(0x125),'type':a24_0x33e56c(0x128),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a24_0x33e56c(0xf1),a24_0x33e56c(0x110),'HOOK']},{'name':a24_0x33e56c(0x127),'type':a24_0x33e56c(0xea),'description':a24_0x33e56c(0xf4)}],async 'dryRun'(_0x4c3da2){const _0x4a35c8=a24_0x33e56c,_0x3b2546=loadBffProjectConfig(_0x4c3da2[_0x4a35c8(0x120)]),_0x19b71c=await readBffLockFile(_0x3b2546[_0x4a35c8(0x10f)]),{appLock:_0x2404d2}=ensureLockScope(_0x19b71c??createEmptyBffLock(),_0x3b2546[_0x4a35c8(0x120)],_0x3b2546[_0x4a35c8(0x100)],_0x4a35c8(0xf2),_0x3b2546[_0x4a35c8(0x120)],_0x3b2546[_0x4a35c8(0x11b)]+'/'+_0x3b2546[_0x4a35c8(0x120)]),_0x4d0748=buildDatasetCodeToAliasMap(_0x4c3da2[_0x4a35c8(0xfb)]),_0x6b9b10=normalizeBffType(_0x4c3da2[_0x4a35c8(0xf6)](_0x4a35c8(0x125)))??undefined,[_0x18bc5e,_0x4b7199]=await Promise['all']([listBffScripts(_0x4c3da2[_0x4a35c8(0x120)],_0x6b9b10),getBffScriptStatistics(_0x4c3da2[_0x4a35c8(0x120)])]),_0x4d6541=createHookLocationMap(_0x4b7199),_0x4b1891=[];for(const _0x2119d8 of _0x18bc5e){const _0x10d780=resolveRemoteScriptTarget(_0x3b2546,_0x2119d8,_0x4d6541,_0x2404d2[_0x4a35c8(0xf0)],_0x4d0748);if(_0x10d780)_0x4b1891[_0x4a35c8(0x11a)](_0x10d780[_0x4a35c8(0xf9)]);}return{'method':_0x4a35c8(0x132),'url':_0x4a35c8(0x129),'body':{'scripts':_0x4b1891,'appCode':_0x4c3da2['appCode']},'description':'Would\x20pull\x20'+_0x4b1891[_0x4a35c8(0xf3)]+_0x4a35c8(0x101)};},async 'execute'(_0x18e9ec){const _0x1e9995=a24_0x33e56c,_0x255cf9=loadBffProjectConfig(_0x18e9ec['appCode']),_0x51bf39=await readBffLockFile(_0x255cf9[_0x1e9995(0x10f)]),{lockData:_0x3a0a3a,appLock:_0x4e9eda}=ensureLockScope(_0x51bf39??createEmptyBffLock(),_0x255cf9[_0x1e9995(0x120)],_0x255cf9[_0x1e9995(0x100)],_0x1e9995(0xf2),_0x255cf9[_0x1e9995(0x120)],_0x255cf9[_0x1e9995(0x11b)]+'/'+_0x255cf9['appCode']),_0x7d026d=normalizeBffType(_0x18e9ec[_0x1e9995(0xf6)](_0x1e9995(0x125)))??undefined;if(_0x18e9ec['str'](_0x1e9995(0x125))&&!_0x7d026d)throw CliErrors[_0x1e9995(0x122)](_0x1e9995(0x131));const [_0x126dc4,_0x36285f]=await Promise[_0x1e9995(0x105)]([listBffScripts(_0x18e9ec[_0x1e9995(0x120)],_0x7d026d),getBffScriptStatistics(_0x18e9ec['appCode'])]);if(_0x126dc4[_0x1e9995(0xf3)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x184655=_0x18e9ec[_0x1e9995(0x119)](_0x1e9995(0x127));if(_0x184655&&!_0x18e9ec[_0x1e9995(0x130)]){const _0x26bd42=await confirmForce();if(!_0x26bd42)throw CliErrors['cancelled'](_0x1e9995(0x113));}if(_0x184655&&_0x18e9ec[_0x1e9995(0x130)]){}const _0x176600=buildDatasetCodeToAliasMap(_0x18e9ec[_0x1e9995(0xfb)]),_0x3c64a1=createHookLocationMap(_0x36285f),_0x46dd87=cloneLockData(_0x3a0a3a),_0x3bdb84=_0x46dd87[_0x1e9995(0x12f)][_0x255cf9[_0x1e9995(0x120)]],_0x39f0ea=[],_0xa5030e=[],_0xb09124=[];for(const _0x3d1c66 of _0x126dc4){const _0x4b45ba=resolveRemoteScriptTarget(_0x255cf9,_0x3d1c66,_0x3c64a1,_0x4e9eda[_0x1e9995(0xf0)],_0x176600);if(!_0x4b45ba){_0xa5030e[_0x1e9995(0x11a)]({'lockKey':_0x3d1c66[_0x1e9995(0x11f)]+'/'+_0x3d1c66[_0x1e9995(0x117)],'reason':_0x1e9995(0xff)});continue;}const _0x2bb4d9=_0x4e9eda[_0x1e9995(0xf0)][_0x4b45ba[_0x1e9995(0xf9)]];try{if(!_0x184655){const _0x591c9a=await hasUnsyncedLocalChanges(_0x4b45ba[_0x1e9995(0x111)],_0x2bb4d9);if(_0x591c9a){_0xa5030e[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba[_0x1e9995(0xf9)],'reason':_0x1e9995(0x12a)});continue;}}if(!_0x3d1c66['id'])throw new Error(_0x1e9995(0x121));if(_0x3d1c66[_0x1e9995(0x12c)]==null)throw new Error(_0x1e9995(0x10d));const _0x41e71b=_0x3d1c66['scriptContent'];await ensureParentDirectory(_0x4b45ba['filePath']),await writeFile(_0x4b45ba[_0x1e9995(0x111)],_0x41e71b,_0x1e9995(0x126));const _0x3c35ad={'hash':computeContentHash(_0x41e71b),'remoteId':_0x3d1c66['id'],'version':_0x3d1c66[_0x1e9995(0x11e)]};_0x4b45ba['type']===_0x1e9995(0x124)&&_0x4b45ba[_0x1e9995(0xfa)]&&(_0x3c35ad[_0x1e9995(0xf7)]=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0xf7)],_0x3c35ad[_0x1e9995(0x115)]=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0x115)],_0x3c35ad['operationType']=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0x104)],_0x3c35ad[_0x1e9995(0x11c)]=_0x4b45ba[_0x1e9995(0xfa)]['functionNode']),_0x3bdb84[_0x1e9995(0xf0)][_0x4b45ba['lockKey']]=_0x3c35ad,_0x39f0ea[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba[_0x1e9995(0xf9)],'remoteId':_0x3d1c66['id']});}catch(_0xd8fa00){_0xb09124[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba['lockKey'],'error':_0xd8fa00 instanceof Error?_0xd8fa00['message']:String(_0xd8fa00)});}}return _0x3bdb84[_0x1e9995(0xfe)]=new Date()[_0x1e9995(0x106)](),await writeBffLockFile(_0x255cf9['lockFilePath'],_0x46dd87),{'ok':_0xb09124[_0x1e9995(0xf3)]===0x0,'data':{'pulled':_0x39f0ea,'skipped':_0xa5030e,'failed':_0xb09124},'message':_0x1e9995(0xf8)+_0x39f0ea[_0x1e9995(0xf3)]+_0x1e9995(0xeb)+_0xa5030e['length']+'\x20skipped,\x20'+_0xb09124[_0x1e9995(0xf3)]+_0x1e9995(0x109)};}};async function hasUnsyncedLocalChanges(_0x421aa7,_0x419f30){const _0x5b7c54=a24_0x33e56c;if(!await fileExists(_0x421aa7))return![];const _0x51239e=await computeFileHash(_0x421aa7);if(!_0x419f30)return!![];return _0x51239e!==_0x419f30[_0x5b7c54(0x123)];}function cloneLockData(_0x246630){const _0x2f3abc=a24_0x33e56c;return{'aliases':{..._0x246630[_0x2f3abc(0x112)]},'apps':Object[_0x2f3abc(0xed)](Object['entries'](_0x246630[_0x2f3abc(0x12f)])[_0x2f3abc(0x10e)](([_0x9abd1d,_0x7dbaa9])=>[_0x9abd1d,{'scriptsRoot':_0x7dbaa9[_0x2f3abc(0x100)],'lastSync':_0x7dbaa9[_0x2f3abc(0xfe)],'functions':{..._0x7dbaa9['functions']}}]))};}function buildDatasetCodeToAliasMap(_0x5307f2){const _0x57c0ee=a24_0x33e56c,_0x511b34=loadAliasMap(_0x5307f2);return new Map(_0x511b34[_0x57c0ee(0x10e)](_0x15a866=>[_0x15a866['datasetCode'],_0x15a866[_0x57c0ee(0xf7)]]));}async function confirmForce(){const _0x581720=a24_0x33e56c,_0x20bfab=createInterface({'input':process[_0x581720(0x118)],'output':process[_0x581720(0x107)]}),_0x4005e1=await new Promise(_0x55210f=>{const _0x46d1bc=_0x581720;_0x20bfab['question'](_0x46d1bc(0xfd),_0x55210f);});return _0x20bfab[_0x581720(0xef)](),['y',_0x581720(0xec)][_0x581720(0x10b)](_0x4005e1[_0x581720(0xf5)]()[_0x581720(0xfc)]());}
1
+ const a23_0x54a8d3=a23_0x5c1a;(function(_0x20931d,_0xc2bbcf){const _0x5c93e9=a23_0x5c1a,_0x2c07d0=_0x20931d();while(!![]){try{const _0xaddf18=-parseInt(_0x5c93e9(0x83))/0x1+-parseInt(_0x5c93e9(0xa0))/0x2*(parseInt(_0x5c93e9(0x76))/0x3)+parseInt(_0x5c93e9(0xab))/0x4+parseInt(_0x5c93e9(0xa3))/0x5*(parseInt(_0x5c93e9(0x88))/0x6)+parseInt(_0x5c93e9(0x9b))/0x7*(parseInt(_0x5c93e9(0x92))/0x8)+parseInt(_0x5c93e9(0x80))/0x9+-parseInt(_0x5c93e9(0x77))/0xa;if(_0xaddf18===_0xc2bbcf)break;else _0x2c07d0['push'](_0x2c07d0['shift']());}catch(_0x57dbd2){_0x2c07d0['push'](_0x2c07d0['shift']());}}}(a23_0x3b1e,0x774f9));function a23_0x3b1e(){const _0x3ad343=['nonInteractive','version','operationType','filePath','functionNode','3020180fOOQBU','alias','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','close','Remote\x20script\x20missing\x20id.','force','length','\x20file(s)','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','6INhjcO','5442850rHGHZA','type','functions','scriptContent','COMMON','pull','Force\x20pull\x20cancelled.','scriptsWorkspaceRoot','entries','3267441bRkJHw','str','apps','403984LxOCSQ','Force\x20overwrite\x20local\x20unsynced\x20changes','scriptsRoot','message','toISOString','330doHsoV','fromEntries','toLowerCase','lastSync','stdin','local\x20unsynced\x20changes','bff','Pull\x20complete:\x20','appCode','lockFilePath','1518240SyvzLT','lockKey','trim','push','write','utf8','yes','GET','hookLocation','21LUarRt','\x20skipped,\x20','stderr','hash','/api/management/library/scripts/list','567048rrUJbk','Remote\x20script\x20missing\x20content.','HOOK','28780mtNxGF','apiDir','map'];a23_0x3b1e=function(){return _0x3ad343;};return a23_0x3b1e();}import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a23_0x54a8d3(0x8e),'command':'pull','description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a23_0x54a8d3(0x96),'flags':[{'name':'type','type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a23_0x54a8d3(0x7b),'ENDPOINT','HOOK']},{'name':a23_0x54a8d3(0xb0),'type':'boolean','description':a23_0x54a8d3(0x84)}],async 'dryRun'(_0x150b7f){const _0x28b1eb=a23_0x54a8d3,_0x26a4e8=loadBffProjectConfig(_0x150b7f[_0x28b1eb(0x90)]),_0x1e414c=await readBffLockFile(_0x26a4e8[_0x28b1eb(0x91)]),{appLock:_0x2da30a}=ensureLockScope(_0x1e414c??createEmptyBffLock(),_0x26a4e8[_0x28b1eb(0x90)],_0x26a4e8['scriptsRoot'],_0x28b1eb(0x7c),_0x26a4e8[_0x28b1eb(0x90)],_0x26a4e8[_0x28b1eb(0x7e)]+'/'+_0x26a4e8['appCode']),_0x100852=buildDatasetCodeToAliasMap(_0x150b7f[_0x28b1eb(0xa4)]),_0xce221e=normalizeBffType(_0x150b7f[_0x28b1eb(0x81)](_0x28b1eb(0x78)))??undefined,[_0x587f58,_0x4cda19]=await Promise['all']([listBffScripts(_0x150b7f['appCode'],_0xce221e),getBffScriptStatistics(_0x150b7f['appCode'])]),_0x4a96a7=createHookLocationMap(_0x4cda19),_0x5776c7=[];for(const _0x20b07e of _0x587f58){const _0x253c7e=resolveRemoteScriptTarget(_0x26a4e8,_0x20b07e,_0x4a96a7,_0x2da30a[_0x28b1eb(0x79)],_0x100852);if(_0x253c7e)_0x5776c7[_0x28b1eb(0x95)](_0x253c7e[_0x28b1eb(0x93)]);}return{'method':_0x28b1eb(0x99),'url':_0x28b1eb(0x9f),'body':{'scripts':_0x5776c7,'appCode':_0x150b7f['appCode']},'description':'Would\x20pull\x20'+_0x5776c7['length']+_0x28b1eb(0x74)};},async 'execute'(_0xb6a8f6){const _0x79c2e9=a23_0x54a8d3,_0x2cb93b=loadBffProjectConfig(_0xb6a8f6[_0x79c2e9(0x90)]),_0x3eb43e=await readBffLockFile(_0x2cb93b[_0x79c2e9(0x91)]),{lockData:_0x5b7e70,appLock:_0x2eace4}=ensureLockScope(_0x3eb43e??createEmptyBffLock(),_0x2cb93b['appCode'],_0x2cb93b[_0x79c2e9(0x85)],'pull',_0x2cb93b[_0x79c2e9(0x90)],_0x2cb93b[_0x79c2e9(0x7e)]+'/'+_0x2cb93b[_0x79c2e9(0x90)]),_0x4a1930=normalizeBffType(_0xb6a8f6[_0x79c2e9(0x81)](_0x79c2e9(0x78)))??undefined;if(_0xb6a8f6[_0x79c2e9(0x81)](_0x79c2e9(0x78))&&!_0x4a1930)throw CliErrors['validation'](_0x79c2e9(0xad));const [_0x400f44,_0x5a1cf1]=await Promise['all']([listBffScripts(_0xb6a8f6[_0x79c2e9(0x90)],_0x4a1930),getBffScriptStatistics(_0xb6a8f6[_0x79c2e9(0x90)])]);if(_0x400f44[_0x79c2e9(0x73)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x4898b1=_0xb6a8f6['bool'](_0x79c2e9(0xb0));if(_0x4898b1&&!_0xb6a8f6['nonInteractive']){const _0x36d6d1=await confirmForce();if(!_0x36d6d1)throw CliErrors['cancelled'](_0x79c2e9(0x7d));}if(_0x4898b1&&_0xb6a8f6[_0x79c2e9(0xa6)]){}const _0x1ff0ab=buildDatasetCodeToAliasMap(_0xb6a8f6[_0x79c2e9(0xa4)]),_0x44ba34=createHookLocationMap(_0x5a1cf1),_0x31172a=cloneLockData(_0x5b7e70),_0x137e44=_0x31172a[_0x79c2e9(0x82)][_0x2cb93b[_0x79c2e9(0x90)]],_0x3466e6=[],_0x24c71a=[],_0x474c3a=[];for(const _0x3b8d92 of _0x400f44){const _0x297bcf=resolveRemoteScriptTarget(_0x2cb93b,_0x3b8d92,_0x44ba34,_0x2eace4[_0x79c2e9(0x79)],_0x1ff0ab);if(!_0x297bcf){_0x24c71a[_0x79c2e9(0x95)]({'lockKey':_0x3b8d92['scriptType']+'/'+_0x3b8d92['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2bb423=_0x2eace4[_0x79c2e9(0x79)][_0x297bcf[_0x79c2e9(0x93)]];try{if(!_0x4898b1){const _0x14c23b=await hasUnsyncedLocalChanges(_0x297bcf[_0x79c2e9(0xa9)],_0x2bb423);if(_0x14c23b){_0x24c71a[_0x79c2e9(0x95)]({'lockKey':_0x297bcf[_0x79c2e9(0x93)],'reason':_0x79c2e9(0x8d)});continue;}}if(!_0x3b8d92['id'])throw new Error(_0x79c2e9(0xaf));if(_0x3b8d92[_0x79c2e9(0x7a)]==null)throw new Error(_0x79c2e9(0xa1));const _0x305c1a=_0x3b8d92[_0x79c2e9(0x7a)];await ensureParentDirectory(_0x297bcf[_0x79c2e9(0xa9)]),await writeFile(_0x297bcf[_0x79c2e9(0xa9)],_0x305c1a,_0x79c2e9(0x97));const _0x5ca2bc={'hash':computeContentHash(_0x305c1a),'remoteId':_0x3b8d92['id'],'version':_0x3b8d92[_0x79c2e9(0xa7)]};_0x297bcf[_0x79c2e9(0x78)]===_0x79c2e9(0xa2)&&_0x297bcf[_0x79c2e9(0x9a)]&&(_0x5ca2bc[_0x79c2e9(0xac)]=_0x297bcf['hookLocation'][_0x79c2e9(0xac)],_0x5ca2bc['datasetCode']=_0x297bcf[_0x79c2e9(0x9a)]['datasetCode'],_0x5ca2bc[_0x79c2e9(0xa8)]=_0x297bcf['hookLocation']['operationType'],_0x5ca2bc[_0x79c2e9(0xaa)]=_0x297bcf[_0x79c2e9(0x9a)][_0x79c2e9(0xaa)]),_0x137e44['functions'][_0x297bcf[_0x79c2e9(0x93)]]=_0x5ca2bc,_0x3466e6[_0x79c2e9(0x95)]({'lockKey':_0x297bcf[_0x79c2e9(0x93)],'remoteId':_0x3b8d92['id']});}catch(_0x4d9c22){_0x474c3a[_0x79c2e9(0x95)]({'lockKey':_0x297bcf['lockKey'],'error':_0x4d9c22 instanceof Error?_0x4d9c22[_0x79c2e9(0x86)]:String(_0x4d9c22)});}}return _0x137e44[_0x79c2e9(0x8b)]=new Date()[_0x79c2e9(0x87)](),await writeBffLockFile(_0x2cb93b[_0x79c2e9(0x91)],_0x31172a),{'ok':_0x474c3a[_0x79c2e9(0x73)]===0x0,'data':{'pulled':_0x3466e6,'skipped':_0x24c71a,'failed':_0x474c3a},'message':_0x79c2e9(0x8f)+_0x3466e6['length']+'\x20pulled,\x20'+_0x24c71a[_0x79c2e9(0x73)]+_0x79c2e9(0x9c)+_0x474c3a[_0x79c2e9(0x73)]+'\x20failed'};}};function a23_0x5c1a(_0x3899a7,_0x2729d0){_0x3899a7=_0x3899a7-0x73;const _0x3b1e8d=a23_0x3b1e();let _0x5c1ab5=_0x3b1e8d[_0x3899a7];return _0x5c1ab5;}async function hasUnsyncedLocalChanges(_0x5dd5ba,_0x5a757f){const _0x32fa34=a23_0x54a8d3;if(!await fileExists(_0x5dd5ba))return![];const _0x98f76c=await computeFileHash(_0x5dd5ba);if(!_0x5a757f)return!![];return _0x98f76c!==_0x5a757f[_0x32fa34(0x9e)];}function cloneLockData(_0x5dbee9){const _0xf5ff43=a23_0x54a8d3;return{'aliases':{..._0x5dbee9['aliases']},'apps':Object[_0xf5ff43(0x89)](Object[_0xf5ff43(0x7f)](_0x5dbee9['apps'])[_0xf5ff43(0xa5)](([_0x46847c,_0x5dfdbe])=>[_0x46847c,{'scriptsRoot':_0x5dfdbe[_0xf5ff43(0x85)],'lastSync':_0x5dfdbe['lastSync'],'functions':{..._0x5dfdbe[_0xf5ff43(0x79)]}}]))};}function buildDatasetCodeToAliasMap(_0x130b96){const _0x559b57=a23_0x54a8d3,_0x11b530=loadAliasMap(_0x130b96);return new Map(_0x11b530[_0x559b57(0xa5)](_0x543727=>[_0x543727['datasetCode'],_0x543727[_0x559b57(0xac)]]));}async function confirmForce(){const _0x3290d2=a23_0x54a8d3,_0x120e59=createInterface({'input':process[_0x3290d2(0x8c)],'output':process[_0x3290d2(0x9d)]}),_0x1bab3d=await new Promise(_0x5e6027=>{const _0x321ea6=_0x3290d2;_0x120e59['question'](_0x321ea6(0x75),_0x5e6027);});return _0x120e59[_0x3290d2(0xae)](),['y',_0x3290d2(0x98)]['includes'](_0x1bab3d[_0x3290d2(0x94)]()[_0x3290d2(0x8a)]());}
@@ -1 +1 @@
1
- const a25_0x1823de=a25_0x82c4;(function(_0x358452,_0x4f56c5){const _0x565cc5=a25_0x82c4,_0x4ee78b=_0x358452();while(!![]){try{const _0x44ed8f=-parseInt(_0x565cc5(0x122))/0x1*(-parseInt(_0x565cc5(0x121))/0x2)+-parseInt(_0x565cc5(0x130))/0x3*(parseInt(_0x565cc5(0xf7))/0x4)+parseInt(_0x565cc5(0x123))/0x5*(-parseInt(_0x565cc5(0x126))/0x6)+parseInt(_0x565cc5(0x108))/0x7+parseInt(_0x565cc5(0x10c))/0x8*(parseInt(_0x565cc5(0x129))/0x9)+parseInt(_0x565cc5(0x115))/0xa+-parseInt(_0x565cc5(0x114))/0xb*(-parseInt(_0x565cc5(0x125))/0xc);if(_0x44ed8f===_0x4f56c5)break;else _0x4ee78b['push'](_0x4ee78b['shift']());}catch(_0xd9dc8c){_0x4ee78b['push'](_0x4ee78b['shift']());}}}(a25_0x2f99,0x1f011));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x2f99(){const _0x11d608=['filter','unchanged','has','1179416cXrFFv','get','name','scriptsWorkspaceRoot','8aZZgYh','hash','Would\x20push\x20','functionNode','lockFilePath','\x22.\x20','functions','COMMON','1762233MrmVvC','1686830FYggQD','lastSync','datasetCodeToId','Push\x20local\x20BFF\x20scripts\x20to\x20remote','map','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','set','Push\x20complete:\x20','alias','code','2294auqVTN','30xbKrwJ','1256565VoZRRN','operationType','12lcMxsr','6iqRRTb','Incomplete\x20HOOK\x20path:\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','89793XwJlQl','No\x20local\x20BFF\x20functions\x20found.','remoteId','Run\x20`','high-risk-write','type','message','765VpWYeV','str','aliasToDatasetCode','appCode','Force\x20push\x20ignoring\x20hash\x20protection','lockKey','\x20failed','POST','ENDPOINT','filePath','toISOString','validation','\x20file(s)','description','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','force','2564hAUJQm','push','HOOK','boolean','values','some','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Push\x20only\x20this\x20script\x20type','length','scriptsRoot','version','datasetCode','\x20skipped,\x20','bool'];a25_0x2f99=function(){return _0x11d608;};return a25_0x2f99();}function a25_0x82c4(_0x7288aa,_0x351992){_0x7288aa=_0x7288aa-0xf7;const _0x2f99b7=a25_0x2f99();let _0x82c42f=_0x2f99b7[_0x7288aa];return _0x82c42f;}export const bffPush={'service':'bff','command':a25_0x1823de(0xf8),'description':a25_0x1823de(0x118),'risk':a25_0x1823de(0x12d),'flags':[{'name':a25_0x1823de(0x12e),'type':'string','description':a25_0x1823de(0xfe),'enum':[a25_0x1823de(0x113),a25_0x1823de(0x138),a25_0x1823de(0xf9)]},{'name':a25_0x1823de(0x10a),'type':a25_0x1823de(0x11b),'description':a25_0x1823de(0xfd)},{'name':a25_0x1823de(0x13f),'type':a25_0x1823de(0xfa),'description':a25_0x1823de(0x134)}],async 'dryRun'(_0x1e3e6b){const _0x4651c8=a25_0x1823de,_0x2f5bfa=loadBffProjectConfig(_0x1e3e6b[_0x4651c8(0x133)]),_0x10139d=await readBffLockFile(_0x2f5bfa[_0x4651c8(0x110)]),{appLock:_0x5ab78b}=ensureLockScope(_0x10139d??createEmptyBffLock(),_0x2f5bfa[_0x4651c8(0x133)],_0x2f5bfa['scriptsRoot'],'push',_0x2f5bfa[_0x4651c8(0x133)],_0x2f5bfa[_0x4651c8(0x10b)]+'/'+_0x2f5bfa['appCode']),_0x83aed2=await getTargetFunctions(_0x2f5bfa,_0x1e3e6b),_0x30315a=_0x1e3e6b[_0x4651c8(0x104)]('force'),_0x51f2cb=[];for(const _0x320e0c of _0x83aed2){const _0x2eaf8a=await computeFileHash(_0x320e0c['filePath']),_0x49fc65=_0x5ab78b[_0x4651c8(0x112)][_0x320e0c[_0x4651c8(0x135)]];if(!_0x30315a&&_0x49fc65&&_0x49fc65[_0x4651c8(0x10d)]===_0x2eaf8a)continue;_0x51f2cb['push'](_0x320e0c[_0x4651c8(0x135)]);}return{'method':_0x4651c8(0x137),'url':'/api/management/library/scripts/save','body':{'files':_0x51f2cb,'appCode':_0x1e3e6b[_0x4651c8(0x133)]},'description':_0x4651c8(0x10e)+_0x51f2cb['length']+_0x4651c8(0x13c)};},async 'execute'(_0x1324bf){const _0x2bdc39=a25_0x1823de,_0x3e866e=loadBffProjectConfig(_0x1324bf[_0x2bdc39(0x133)]),_0x4c10ef=await readBffLockFile(_0x3e866e[_0x2bdc39(0x110)]),{lockData:_0x57fdb5,appLock:_0x7e36ec}=ensureLockScope(_0x4c10ef??createEmptyBffLock(),_0x3e866e[_0x2bdc39(0x133)],_0x3e866e[_0x2bdc39(0x100)],_0x2bdc39(0xf8),_0x3e866e[_0x2bdc39(0x133)],_0x3e866e[_0x2bdc39(0x10b)]+'/'+_0x3e866e[_0x2bdc39(0x133)]),_0x9318a9=await getTargetFunctions(_0x3e866e,_0x1324bf);if(_0x9318a9[_0x2bdc39(0xff)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2bdc39(0x12a)};const _0x502278=_0x1324bf['bool']('force'),_0x2f8836=await buildHookMaps(_0x3e866e[_0x2bdc39(0x133)],_0x1324bf['apiDir'],_0x9318a9,_0x7e36ec),_0x22fec7=[],_0x56f18d=[],_0x3b3009=[];for(const _0x4b4ea8 of _0x9318a9){const _0x57af9c=await computeFileHash(_0x4b4ea8[_0x2bdc39(0x139)]),_0xc56ae3=_0x7e36ec[_0x2bdc39(0x112)][_0x4b4ea8['lockKey']];if(!_0x502278&&_0xc56ae3&&_0xc56ae3[_0x2bdc39(0x10d)]===_0x57af9c){_0x56f18d[_0x2bdc39(0xf8)]({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'reason':_0x2bdc39(0x106)});continue;}try{await uploadSingleFunction(_0x3e866e[_0x2bdc39(0x133)],_0x4b4ea8,_0x7e36ec,_0x2f8836);const _0x5ea7f5=_0x7e36ec[_0x2bdc39(0x112)][_0x4b4ea8[_0x2bdc39(0x135)]];_0x22fec7[_0x2bdc39(0xf8)]({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'remoteId':_0x5ea7f5?.[_0x2bdc39(0x12b)]??0x0});}catch(_0x4f51ad){_0x3b3009['push']({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'error':_0x4f51ad instanceof Error?_0x4f51ad[_0x2bdc39(0x12f)]:String(_0x4f51ad)});}}return _0x7e36ec[_0x2bdc39(0x116)]=new Date()[_0x2bdc39(0x13a)](),await writeBffLockFile(_0x3e866e[_0x2bdc39(0x110)],_0x57fdb5),{'ok':_0x3b3009['length']===0x0,'data':{'uploaded':_0x22fec7,'skipped':_0x56f18d,'failed':_0x3b3009},'message':_0x2bdc39(0x11e)+_0x22fec7[_0x2bdc39(0xff)]+'\x20uploaded,\x20'+_0x56f18d['length']+_0x2bdc39(0x103)+_0x3b3009[_0x2bdc39(0xff)]+_0x2bdc39(0x136)};}};async function getTargetFunctions(_0x33fba5,_0x4b8431){const _0x4500a9=a25_0x1823de,_0x5692c2=_0x4b8431[_0x4500a9(0x131)](_0x4500a9(0x12e)),_0x4f0d2f=_0x4b8431[_0x4500a9(0x131)]('name'),_0x1b4bb9=normalizeBffType(_0x5692c2)??undefined;if(_0x4f0d2f&&!_0x1b4bb9)throw CliErrors[_0x4500a9(0x13b)](_0x4500a9(0x13e));const _0x28bdac=await scanLocalBffFunctions(_0x33fba5,_0x1b4bb9);if(_0x4f0d2f){const _0x11961f=_0x28bdac[_0x4500a9(0x105)](_0x509d41=>_0x509d41[_0x4500a9(0x10a)]===_0x4f0d2f);if(_0x11961f[_0x4500a9(0xff)]===0x0)throw CliErrors[_0x4500a9(0x13b)]('Local\x20function\x20not\x20found:\x20'+_0x1b4bb9+'/'+_0x4f0d2f);return _0x11961f;}return _0x28bdac;}async function buildHookMaps(_0x544170,_0x53551e,_0xfd6130,_0x641e77){const _0x110a4b=a25_0x1823de,_0x40f5cb=_0xfd6130[_0x110a4b(0xfc)](_0x263429=>_0x263429['type']===_0x110a4b(0xf9));if(!_0x40f5cb)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x266a67=loadAliasMap(_0x53551e),_0xb96ea3=new Map(_0x266a67[_0x110a4b(0x119)](_0x155b31=>[_0x155b31[_0x110a4b(0x11f)],_0x155b31['datasetCode']]));for(const _0x5927c1 of Object[_0x110a4b(0xfb)](_0x641e77[_0x110a4b(0x112)])){_0x5927c1[_0x110a4b(0x11f)]&&_0x5927c1[_0x110a4b(0x102)]&&!_0xb96ea3['has'](_0x5927c1['alias'])&&_0xb96ea3[_0x110a4b(0x11d)](_0x5927c1['alias'],_0x5927c1['datasetCode']);}const _0x48ce5d=await listDatasets(_0x544170),_0x2b699c=new Map(_0x48ce5d['map'](_0x2b4f9e=>[_0x2b4f9e[_0x110a4b(0x120)],_0x2b4f9e['id']]));return{'aliasToDatasetCode':_0xb96ea3,'datasetCodeToId':_0x2b699c};}async function uploadSingleFunction(_0x3a0c64,_0x407652,_0x10c505,_0x365b4b){const _0x4c9ce9=a25_0x1823de,_0x574765=await readFile(_0x407652[_0x4c9ce9(0x139)],'utf8'),_0x354f53=await computeFileHash(_0x407652[_0x4c9ce9(0x139)]),_0x5effa3=_0x10c505['functions'][_0x407652[_0x4c9ce9(0x135)]];if(_0x5effa3?.[_0x4c9ce9(0x12b)]&&_0x5effa3['version']==null)throw CliErrors['validation'](_0x407652[_0x4c9ce9(0x135)]+_0x4c9ce9(0x128));let _0x805787=extractScriptDescription(_0x574765);if(!_0x805787&&_0x5effa3?.[_0x4c9ce9(0x12b)]){const _0x8efa37=await getBffScriptInfo(_0x5effa3[_0x4c9ce9(0x12b)]);_0x805787=_0x8efa37[_0x4c9ce9(0x13d)]||undefined;}const _0x42274c={'appCode':_0x3a0c64,'functionName':_0x407652['name'],'scriptType':_0x407652[_0x4c9ce9(0x12e)],'scriptContent':_0x574765};if(_0x5effa3?.[_0x4c9ce9(0x12b)])_0x42274c['id']=_0x5effa3['remoteId'];if(_0x5effa3?.[_0x4c9ce9(0x101)]!=null)_0x42274c[_0x4c9ce9(0x101)]=_0x5effa3[_0x4c9ce9(0x101)];if(_0x805787)_0x42274c[_0x4c9ce9(0x13d)]=_0x805787;if(_0x407652[_0x4c9ce9(0x12e)]===_0x4c9ce9(0xf9)){const _0x41c508=_0x407652[_0x4c9ce9(0x11f)];if(!_0x41c508||!_0x407652[_0x4c9ce9(0x124)]||!_0x407652[_0x4c9ce9(0x10f)])throw CliErrors[_0x4c9ce9(0x13b)](_0x4c9ce9(0x127)+_0x407652[_0x4c9ce9(0x135)]);const _0x32af16=_0x365b4b[_0x4c9ce9(0x132)][_0x4c9ce9(0x109)](_0x41c508)??_0x5effa3?.['datasetCode']??_0x41c508,_0x3531eb=_0x365b4b[_0x4c9ce9(0x117)][_0x4c9ce9(0x109)](_0x32af16);if(!_0x3531eb)throw CliErrors['validation'](_0x4c9ce9(0x11a)+_0x41c508+_0x4c9ce9(0x111)+(_0x4c9ce9(0x12c)+CLI_BIN_NAME+_0x4c9ce9(0x11c)));_0x42274c['datasetId']=_0x3531eb,_0x42274c[_0x4c9ce9(0x124)]=_0x407652[_0x4c9ce9(0x124)],_0x42274c['functionNode']=_0x407652[_0x4c9ce9(0x10f)];}const _0x293874=await saveBffScript(_0x42274c),_0x31e918=await getBffScriptInfo(_0x293874),_0x310f68={'hash':_0x354f53,'remoteId':_0x293874,'version':_0x31e918['version']};if(_0x407652[_0x4c9ce9(0x12e)]===_0x4c9ce9(0xf9)){const _0x5cde02=_0x407652[_0x4c9ce9(0x11f)],_0x1b17d5=_0x365b4b[_0x4c9ce9(0x132)][_0x4c9ce9(0x109)](_0x5cde02)??_0x5effa3?.[_0x4c9ce9(0x102)]??_0x5cde02;_0x365b4b['aliasToDatasetCode'][_0x4c9ce9(0x107)](_0x5cde02)?_0x310f68[_0x4c9ce9(0x11f)]=_0x5cde02:_0x310f68[_0x4c9ce9(0x11f)]=_0x5effa3?.[_0x4c9ce9(0x11f)],_0x310f68[_0x4c9ce9(0x102)]=_0x1b17d5,_0x310f68[_0x4c9ce9(0x124)]=_0x407652[_0x4c9ce9(0x124)],_0x310f68[_0x4c9ce9(0x10f)]=_0x407652[_0x4c9ce9(0x10f)];}_0x10c505[_0x4c9ce9(0x112)][_0x407652[_0x4c9ce9(0x135)]]=_0x310f68;}
1
+ const a24_0x20e35d=a24_0x1e59;(function(_0x3c07f2,_0x2b16b9){const _0x3bb523=a24_0x1e59,_0x350304=_0x3c07f2();while(!![]){try{const _0x209111=parseInt(_0x3bb523(0x1cb))/0x1*(-parseInt(_0x3bb523(0x1c0))/0x2)+parseInt(_0x3bb523(0x1c6))/0x3*(-parseInt(_0x3bb523(0x1b3))/0x4)+parseInt(_0x3bb523(0x1c2))/0x5+parseInt(_0x3bb523(0x1c9))/0x6*(parseInt(_0x3bb523(0x1ca))/0x7)+parseInt(_0x3bb523(0x1de))/0x8*(-parseInt(_0x3bb523(0x1a2))/0x9)+-parseInt(_0x3bb523(0x1e1))/0xa*(parseInt(_0x3bb523(0x1bc))/0xb)+parseInt(_0x3bb523(0x1c7))/0xc;if(_0x209111===_0x2b16b9)break;else _0x350304['push'](_0x350304['shift']());}catch(_0x43e870){_0x350304['push'](_0x350304['shift']());}}}(a24_0x5a94,0x5e79e));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a24_0x20e35d(0x1cc),'command':a24_0x20e35d(0x1b5),'description':a24_0x20e35d(0x1b7),'risk':a24_0x20e35d(0x1a7),'flags':[{'name':'type','type':a24_0x20e35d(0x1b2),'description':a24_0x20e35d(0x1e2),'enum':[a24_0x20e35d(0x1b6),a24_0x20e35d(0x1d6),'HOOK']},{'name':a24_0x20e35d(0x1df),'type':'string','description':a24_0x20e35d(0x1d0)},{'name':a24_0x20e35d(0x1dc),'type':a24_0x20e35d(0x1a3),'description':a24_0x20e35d(0x19f)}],async 'dryRun'(_0x5efde6){const _0x171bef=a24_0x20e35d,_0x3d7a9c=loadBffProjectConfig(_0x5efde6[_0x171bef(0x1a8)]),_0x3698a7=await readBffLockFile(_0x3d7a9c[_0x171bef(0x1ae)]),{appLock:_0x14ddb1}=ensureLockScope(_0x3698a7??createEmptyBffLock(),_0x3d7a9c[_0x171bef(0x1a8)],_0x3d7a9c['scriptsRoot'],_0x171bef(0x1b5),_0x3d7a9c[_0x171bef(0x1a8)],_0x3d7a9c[_0x171bef(0x1c1)]+'/'+_0x3d7a9c[_0x171bef(0x1a8)]),_0x509342=await getTargetFunctions(_0x3d7a9c,_0x5efde6),_0x329118=_0x5efde6[_0x171bef(0x1d2)]('force'),_0x46d220=[];for(const _0x2203a2 of _0x509342){const _0x133edd=await computeFileHash(_0x2203a2[_0x171bef(0x1a6)]),_0x235759=_0x14ddb1[_0x171bef(0x1be)][_0x2203a2[_0x171bef(0x1ab)]];if(!_0x329118&&_0x235759&&_0x235759[_0x171bef(0x1c5)]===_0x133edd)continue;_0x46d220[_0x171bef(0x1b5)](_0x2203a2[_0x171bef(0x1ab)]);}return{'method':_0x171bef(0x1d9),'url':_0x171bef(0x1aa),'body':{'files':_0x46d220,'appCode':_0x5efde6[_0x171bef(0x1a8)]},'description':_0x171bef(0x1a0)+_0x46d220['length']+_0x171bef(0x1af)};},async 'execute'(_0x5b854f){const _0x1ed315=a24_0x20e35d,_0x207a4e=loadBffProjectConfig(_0x5b854f['appCode']),_0x4399ac=await readBffLockFile(_0x207a4e[_0x1ed315(0x1ae)]),{lockData:_0x4b5005,appLock:_0x244ac3}=ensureLockScope(_0x4399ac??createEmptyBffLock(),_0x207a4e['appCode'],_0x207a4e['scriptsRoot'],_0x1ed315(0x1b5),_0x207a4e[_0x1ed315(0x1a8)],_0x207a4e['scriptsWorkspaceRoot']+'/'+_0x207a4e[_0x1ed315(0x1a8)]),_0x7bd6cd=await getTargetFunctions(_0x207a4e,_0x5b854f);if(_0x7bd6cd['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0xbe196b=_0x5b854f[_0x1ed315(0x1d2)](_0x1ed315(0x1dc)),_0x3e04b1=await buildHookMaps(_0x207a4e[_0x1ed315(0x1a8)],_0x5b854f[_0x1ed315(0x1e4)],_0x7bd6cd,_0x244ac3),_0xd79434=[],_0x3968b5=[],_0x777f1=[];for(const _0x28f6fa of _0x7bd6cd){const _0x27bd76=await computeFileHash(_0x28f6fa[_0x1ed315(0x1a6)]),_0x571ef4=_0x244ac3[_0x1ed315(0x1be)][_0x28f6fa[_0x1ed315(0x1ab)]];if(!_0xbe196b&&_0x571ef4&&_0x571ef4['hash']===_0x27bd76){_0x3968b5['push']({'lockKey':_0x28f6fa[_0x1ed315(0x1ab)],'reason':_0x1ed315(0x1d3)});continue;}try{await uploadSingleFunction(_0x207a4e[_0x1ed315(0x1a8)],_0x28f6fa,_0x244ac3,_0x3e04b1);const _0x26a515=_0x244ac3[_0x1ed315(0x1be)][_0x28f6fa['lockKey']];_0xd79434[_0x1ed315(0x1b5)]({'lockKey':_0x28f6fa[_0x1ed315(0x1ab)],'remoteId':_0x26a515?.[_0x1ed315(0x1b4)]??0x0});}catch(_0x30f539){_0x777f1[_0x1ed315(0x1b5)]({'lockKey':_0x28f6fa[_0x1ed315(0x1ab)],'error':_0x30f539 instanceof Error?_0x30f539[_0x1ed315(0x1c4)]:String(_0x30f539)});}}return _0x244ac3['lastSync']=new Date()[_0x1ed315(0x1b8)](),await writeBffLockFile(_0x207a4e[_0x1ed315(0x1ae)],_0x4b5005),{'ok':_0x777f1[_0x1ed315(0x1b1)]===0x0,'data':{'uploaded':_0xd79434,'skipped':_0x3968b5,'failed':_0x777f1},'message':_0x1ed315(0x1d4)+_0xd79434[_0x1ed315(0x1b1)]+_0x1ed315(0x1db)+_0x3968b5['length']+_0x1ed315(0x1c8)+_0x777f1['length']+_0x1ed315(0x1d5)};}};async function getTargetFunctions(_0x3102c2,_0x354aaf){const _0x21ec09=a24_0x20e35d,_0x538dd9=_0x354aaf['str']('type'),_0x4d84b8=_0x354aaf[_0x21ec09(0x1ac)]('name'),_0x3a2229=normalizeBffType(_0x538dd9)??undefined;if(_0x4d84b8&&!_0x3a2229)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x3a8747=await scanLocalBffFunctions(_0x3102c2,_0x3a2229);if(_0x4d84b8){const _0x5bd98f=_0x3a8747[_0x21ec09(0x1a5)](_0x35b740=>_0x35b740[_0x21ec09(0x1df)]===_0x4d84b8);if(_0x5bd98f[_0x21ec09(0x1b1)]===0x0)throw CliErrors[_0x21ec09(0x1cf)](_0x21ec09(0x1d1)+_0x3a2229+'/'+_0x4d84b8);return _0x5bd98f;}return _0x3a8747;}async function buildHookMaps(_0x313f86,_0x5570d7,_0xe5d9c6,_0x3b8ee3){const _0x3da270=a24_0x20e35d,_0x5b79b5=_0xe5d9c6['some'](_0x5058c5=>_0x5058c5[_0x3da270(0x1ba)]===_0x3da270(0x1ad));if(!_0x5b79b5)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x2cd474=loadAliasMap(_0x5570d7),_0x383b3b=new Map(_0x2cd474['map'](_0x1803cc=>[_0x1803cc[_0x3da270(0x1bb)],_0x1803cc['datasetCode']]));for(const _0x307979 of Object[_0x3da270(0x1b9)](_0x3b8ee3['functions'])){_0x307979[_0x3da270(0x1bb)]&&_0x307979[_0x3da270(0x1a1)]&&!_0x383b3b[_0x3da270(0x1e0)](_0x307979[_0x3da270(0x1bb)])&&_0x383b3b['set'](_0x307979[_0x3da270(0x1bb)],_0x307979[_0x3da270(0x1a1)]);}const _0x1cd7b3=await listDatasets(_0x313f86),_0x402de2=new Map(_0x1cd7b3[_0x3da270(0x1c3)](_0x451c03=>[_0x451c03['code'],_0x451c03['id']]));return{'aliasToDatasetCode':_0x383b3b,'datasetCodeToId':_0x402de2};}function a24_0x1e59(_0x3758e0,_0x2b1670){_0x3758e0=_0x3758e0-0x19f;const _0x5a942f=a24_0x5a94();let _0x1e59ef=_0x5a942f[_0x3758e0];return _0x1e59ef;}async function uploadSingleFunction(_0x524472,_0x412db5,_0x39758a,_0x3561a2){const _0x345e9f=a24_0x20e35d,_0x56f927=await readFile(_0x412db5['filePath'],_0x345e9f(0x1b0)),_0x2d2964=await computeFileHash(_0x412db5['filePath']),_0x3b54ae=_0x39758a[_0x345e9f(0x1be)][_0x412db5['lockKey']];if(_0x3b54ae?.[_0x345e9f(0x1b4)]&&_0x3b54ae[_0x345e9f(0x1a4)]==null)throw CliErrors[_0x345e9f(0x1cf)](_0x412db5[_0x345e9f(0x1ab)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3d691d=extractScriptDescription(_0x56f927);if(!_0x3d691d&&_0x3b54ae?.['remoteId']){const _0xbb968c=await getBffScriptInfo(_0x3b54ae[_0x345e9f(0x1b4)]);_0x3d691d=_0xbb968c[_0x345e9f(0x1d8)]||undefined;}const _0x5b50e8={'appCode':_0x524472,'functionName':_0x412db5[_0x345e9f(0x1df)],'scriptType':_0x412db5[_0x345e9f(0x1ba)],'scriptContent':_0x56f927};if(_0x3b54ae?.[_0x345e9f(0x1b4)])_0x5b50e8['id']=_0x3b54ae[_0x345e9f(0x1b4)];if(_0x3b54ae?.['version']!=null)_0x5b50e8[_0x345e9f(0x1a4)]=_0x3b54ae['version'];if(_0x3d691d)_0x5b50e8['description']=_0x3d691d;if(_0x412db5['type']===_0x345e9f(0x1ad)){const _0x30903f=_0x412db5[_0x345e9f(0x1bb)];if(!_0x30903f||!_0x412db5[_0x345e9f(0x1cd)]||!_0x412db5['functionNode'])throw CliErrors[_0x345e9f(0x1cf)](_0x345e9f(0x1dd)+_0x412db5[_0x345e9f(0x1ab)]);const _0x53d6ae=_0x3561a2['aliasToDatasetCode']['get'](_0x30903f)??_0x3b54ae?.[_0x345e9f(0x1a1)]??_0x30903f,_0x28358a=_0x3561a2[_0x345e9f(0x1d7)]['get'](_0x53d6ae);if(!_0x28358a)throw CliErrors[_0x345e9f(0x1cf)](_0x345e9f(0x1ce)+_0x30903f+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x345e9f(0x1bd)));_0x5b50e8[_0x345e9f(0x1e3)]=_0x28358a,_0x5b50e8[_0x345e9f(0x1cd)]=_0x412db5['operationType'],_0x5b50e8[_0x345e9f(0x1bf)]=_0x412db5[_0x345e9f(0x1bf)];}const _0x545d20=await saveBffScript(_0x5b50e8),_0xbc9b84=await getBffScriptInfo(_0x545d20),_0xda3092={'hash':_0x2d2964,'remoteId':_0x545d20,'version':_0xbc9b84[_0x345e9f(0x1a4)]};if(_0x412db5['type']===_0x345e9f(0x1ad)){const _0x37da2a=_0x412db5[_0x345e9f(0x1bb)],_0x269a78=_0x3561a2[_0x345e9f(0x1da)][_0x345e9f(0x1a9)](_0x37da2a)??_0x3b54ae?.[_0x345e9f(0x1a1)]??_0x37da2a;_0x3561a2['aliasToDatasetCode'][_0x345e9f(0x1e0)](_0x37da2a)?_0xda3092[_0x345e9f(0x1bb)]=_0x37da2a:_0xda3092[_0x345e9f(0x1bb)]=_0x3b54ae?.['alias'],_0xda3092['datasetCode']=_0x269a78,_0xda3092[_0x345e9f(0x1cd)]=_0x412db5[_0x345e9f(0x1cd)],_0xda3092['functionNode']=_0x412db5[_0x345e9f(0x1bf)];}_0x39758a[_0x345e9f(0x1be)][_0x412db5[_0x345e9f(0x1ab)]]=_0xda3092;}function a24_0x5a94(){const _0x4f2207=['\x20uploaded,\x20','force','Incomplete\x20HOOK\x20path:\x20','320IguGfK','name','has','10NONLPq','Push\x20only\x20this\x20script\x20type','datasetId','apiDir','Force\x20push\x20ignoring\x20hash\x20protection','Would\x20push\x20','datasetCode','146682XSWOyJ','boolean','version','filter','filePath','high-risk-write','appCode','get','/api/management/library/scripts/save','lockKey','str','HOOK','lockFilePath','\x20file(s)','utf8','length','string','4ZMwXCo','remoteId','push','COMMON','Push\x20local\x20BFF\x20scripts\x20to\x20remote','toISOString','values','type','alias','7719503MgByIB','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','functions','functionNode','320PxpcQh','scriptsWorkspaceRoot','176340USwoqK','map','message','hash','329007WOOvqq','27691068LiDVFT','\x20skipped,\x20','7122EOKUUT','1099xeHJLd','4243EqwMhb','bff','operationType','Cannot\x20resolve\x20dataset\x20for\x20\x22','validation','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Local\x20function\x20not\x20found:\x20','bool','unchanged','Push\x20complete:\x20','\x20failed','ENDPOINT','datasetCodeToId','description','POST','aliasToDatasetCode'];a24_0x5a94=function(){return _0x4f2207;};return a24_0x5a94();}
@@ -1 +1 @@
1
- const a26_0x55bd1c=a26_0x93e6;(function(_0x8797df,_0x522825){const _0x491faa=a26_0x93e6,_0x2b94f5=_0x8797df();while(!![]){try{const _0x49cdeb=parseInt(_0x491faa(0x13c))/0x1+parseInt(_0x491faa(0x13d))/0x2*(-parseInt(_0x491faa(0x147))/0x3)+-parseInt(_0x491faa(0x145))/0x4*(-parseInt(_0x491faa(0x132))/0x5)+-parseInt(_0x491faa(0x141))/0x6+parseInt(_0x491faa(0x131))/0x7*(parseInt(_0x491faa(0x130))/0x8)+parseInt(_0x491faa(0x128))/0x9+-parseInt(_0x491faa(0x140))/0xa;if(_0x49cdeb===_0x522825)break;else _0x2b94f5['push'](_0x2b94f5['shift']());}catch(_0x5e8886){_0x2b94f5['push'](_0x2b94f5['shift']());}}}(a26_0xc8d9,0x1c941));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a26_0x93e6(_0x34743a,_0x19744e){_0x34743a=_0x34743a-0x128;const _0xc8d9bb=a26_0xc8d9();let _0x93e67c=_0xc8d9bb[_0x34743a];return _0x93e67c;}import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a26_0x55bd1c(0x143),'command':a26_0x55bd1c(0x13f),'description':a26_0x55bd1c(0x136),'risk':a26_0x55bd1c(0x149),'flags':[{'name':'remote','type':a26_0x55bd1c(0x12c),'description':a26_0x55bd1c(0x138)}],async 'execute'(_0x1bc213){const _0x558be7=a26_0x55bd1c,_0x201c99=loadBffProjectConfig(_0x1bc213['appCode']),_0x140d34=await readBffLockFile(_0x201c99['lockFilePath']),{appLock:_0x220ee7}=ensureLockScope(_0x140d34??createEmptyBffLock(),_0x201c99[_0x558be7(0x134)],_0x201c99[_0x558be7(0x135)],_0x558be7(0x13f),_0x201c99[_0x558be7(0x134)],_0x201c99[_0x558be7(0x12b)]+'/'+_0x201c99[_0x558be7(0x134)]),_0x421ba5=await scanLocalBffFunctions(_0x201c99),_0x439be7=[],_0x24e13f=[],_0x1345a5=[];for(const _0x2379e4 of _0x421ba5){const _0x2e73dc=await computeFileHash(_0x2379e4[_0x558be7(0x142)]),_0x286a1e=_0x220ee7[_0x558be7(0x133)][_0x2379e4[_0x558be7(0x12f)]];if(!_0x286a1e)_0x439be7[_0x558be7(0x13b)](_0x2379e4[_0x558be7(0x12f)]);else _0x286a1e[_0x558be7(0x137)]!==_0x2e73dc?_0x24e13f[_0x558be7(0x13b)](_0x2379e4[_0x558be7(0x12f)]):_0x1345a5[_0x558be7(0x13b)](_0x2379e4['lockKey']);}const _0x8b70bc=[];if(_0x1bc213['bool']('remote')){const _0x6c865a=loadAliasMap(_0x1bc213[_0x558be7(0x144)]),_0x3878d8=new Map(_0x6c865a[_0x558be7(0x13e)](_0x221085=>[_0x221085[_0x558be7(0x12d)],_0x221085[_0x558be7(0x13a)]])),[_0x1cee6e,_0x42b685]=await Promise[_0x558be7(0x148)]([listBffScripts(_0x1bc213[_0x558be7(0x134)]),getBffScriptStatistics(_0x1bc213[_0x558be7(0x134)])]),_0x489673=createHookLocationMap(_0x42b685),_0x2fe44f=new Set(_0x421ba5[_0x558be7(0x13e)](_0x28abb7=>_0x28abb7[_0x558be7(0x12f)]));for(const _0xd884a0 of _0x1cee6e){const _0x192f03=resolveRemoteScriptTarget(_0x201c99,_0xd884a0,_0x489673,_0x220ee7[_0x558be7(0x133)],_0x3878d8);_0x192f03&&!_0x2fe44f['has'](_0x192f03[_0x558be7(0x12f)])&&_0x8b70bc[_0x558be7(0x13b)](_0x192f03[_0x558be7(0x12f)]);}}const _0x354471=_0x439be7['length']===0x0&&_0x24e13f[_0x558be7(0x139)]===0x0&&_0x8b70bc[_0x558be7(0x139)]===0x0;return{'ok':!![],'data':{'added':_0x439be7,'modified':_0x24e13f,'unchanged':_0x1345a5,'remoteOnly':_0x8b70bc},'message':_0x354471?_0x558be7(0x146):_0x439be7[_0x558be7(0x139)]+_0x558be7(0x129)+_0x24e13f[_0x558be7(0x139)]+'\x20modified,\x20'+_0x1345a5[_0x558be7(0x139)]+_0x558be7(0x12e)+(_0x8b70bc[_0x558be7(0x139)]>0x0?',\x20'+_0x8b70bc['length']+_0x558be7(0x12a):'')};}};function a26_0xc8d9(){const _0x171819=['Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','length','alias','push','89214iNlFFe','352508hXJSUA','map','status','681850aWIzqq','607386FzMjkq','filePath','bff','apiDir','4kSUGhk','All\x20BFF\x20scripts\x20are\x20in\x20sync.','3tcHBKr','all','read','1068282NMGAqP','\x20added,\x20','\x20remote-only','scriptsWorkspaceRoot','boolean','datasetCode','\x20unchanged','lockKey','659992qHWEIl','7QhNDsO','861580rFxyak','functions','appCode','scriptsRoot','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','hash'];a26_0xc8d9=function(){return _0x171819;};return a26_0xc8d9();}
1
+ const a25_0x5e1137=a25_0xc735;(function(_0x475267,_0x114abe){const _0x1a0356=a25_0xc735,_0x222ad0=_0x475267();while(!![]){try{const _0x2c4107=parseInt(_0x1a0356(0xfb))/0x1*(parseInt(_0x1a0356(0x100))/0x2)+-parseInt(_0x1a0356(0xf6))/0x3+-parseInt(_0x1a0356(0x105))/0x4*(-parseInt(_0x1a0356(0x107))/0x5)+-parseInt(_0x1a0356(0xf7))/0x6+parseInt(_0x1a0356(0xf0))/0x7+-parseInt(_0x1a0356(0xf2))/0x8+parseInt(_0x1a0356(0x104))/0x9*(parseInt(_0x1a0356(0xf8))/0xa);if(_0x2c4107===_0x114abe)break;else _0x222ad0['push'](_0x222ad0['shift']());}catch(_0x466442){_0x222ad0['push'](_0x222ad0['shift']());}}}(a25_0x2b10,0xc4e9d));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a25_0xc735(_0x3e7784,_0x46644c){_0x3e7784=_0x3e7784-0xea;const _0x2b106e=a25_0x2b10();let _0xc7352f=_0x2b106e[_0x3e7784];return _0xc7352f;}import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';function a25_0x2b10(){const _0xc92733=['12950JUBeOt','all','bff','length','4716234wwNdwB','4NqqVDp','lockKey','356165QnmxlT','has','remote','\x20modified,\x20','lockFilePath','scriptsRoot','appCode','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','571543hCrPNy','status','11021376anUleD','push','read','scriptsWorkspaceRoot','2924280hWBSfC','1102938dGaKtt','50QjzHRj','\x20added,\x20','functions','88xbNOwp','datasetCode','hash','\x20remote-only','map'];a25_0x2b10=function(){return _0xc92733;};return a25_0x2b10();}export const bffStatus={'service':a25_0x5e1137(0x102),'command':a25_0x5e1137(0xf1),'description':a25_0x5e1137(0xef),'risk':a25_0x5e1137(0xf4),'flags':[{'name':a25_0x5e1137(0xea),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x5efb06){const _0x52d0fc=a25_0x5e1137,_0x2a2d49=loadBffProjectConfig(_0x5efb06[_0x52d0fc(0xee)]),_0x35a6b7=await readBffLockFile(_0x2a2d49[_0x52d0fc(0xec)]),{appLock:_0x3f7c68}=ensureLockScope(_0x35a6b7??createEmptyBffLock(),_0x2a2d49[_0x52d0fc(0xee)],_0x2a2d49[_0x52d0fc(0xed)],_0x52d0fc(0xf1),_0x2a2d49[_0x52d0fc(0xee)],_0x2a2d49[_0x52d0fc(0xf5)]+'/'+_0x2a2d49[_0x52d0fc(0xee)]),_0x539c6e=await scanLocalBffFunctions(_0x2a2d49),_0x2f3483=[],_0x18e577=[],_0x240afe=[];for(const _0x747900 of _0x539c6e){const _0x19e976=await computeFileHash(_0x747900['filePath']),_0x17fe3d=_0x3f7c68['functions'][_0x747900[_0x52d0fc(0x106)]];if(!_0x17fe3d)_0x2f3483[_0x52d0fc(0xf3)](_0x747900[_0x52d0fc(0x106)]);else _0x17fe3d[_0x52d0fc(0xfd)]!==_0x19e976?_0x18e577[_0x52d0fc(0xf3)](_0x747900[_0x52d0fc(0x106)]):_0x240afe[_0x52d0fc(0xf3)](_0x747900['lockKey']);}const _0x137a3c=[];if(_0x5efb06['bool'](_0x52d0fc(0xea))){const _0x4b68a1=loadAliasMap(_0x5efb06['apiDir']),_0xc31e6a=new Map(_0x4b68a1[_0x52d0fc(0xff)](_0x301d4b=>[_0x301d4b[_0x52d0fc(0xfc)],_0x301d4b['alias']])),[_0x3d6d17,_0x72d59d]=await Promise[_0x52d0fc(0x101)]([listBffScripts(_0x5efb06[_0x52d0fc(0xee)]),getBffScriptStatistics(_0x5efb06[_0x52d0fc(0xee)])]),_0x404457=createHookLocationMap(_0x72d59d),_0x798040=new Set(_0x539c6e[_0x52d0fc(0xff)](_0x47bf2a=>_0x47bf2a[_0x52d0fc(0x106)]));for(const _0x382787 of _0x3d6d17){const _0x21c5bc=resolveRemoteScriptTarget(_0x2a2d49,_0x382787,_0x404457,_0x3f7c68[_0x52d0fc(0xfa)],_0xc31e6a);_0x21c5bc&&!_0x798040[_0x52d0fc(0x108)](_0x21c5bc[_0x52d0fc(0x106)])&&_0x137a3c[_0x52d0fc(0xf3)](_0x21c5bc['lockKey']);}}const _0x2191d1=_0x2f3483[_0x52d0fc(0x103)]===0x0&&_0x18e577[_0x52d0fc(0x103)]===0x0&&_0x137a3c[_0x52d0fc(0x103)]===0x0;return{'ok':!![],'data':{'added':_0x2f3483,'modified':_0x18e577,'unchanged':_0x240afe,'remoteOnly':_0x137a3c},'message':_0x2191d1?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x2f3483['length']+_0x52d0fc(0xf9)+_0x18e577[_0x52d0fc(0x103)]+_0x52d0fc(0xeb)+_0x240afe[_0x52d0fc(0x103)]+'\x20unchanged'+(_0x137a3c[_0x52d0fc(0x103)]>0x0?',\x20'+_0x137a3c[_0x52d0fc(0x103)]+_0x52d0fc(0xfe):'')};}};
@@ -1 +1 @@
1
- const a27_0x1609a8=a27_0x4cad;(function(_0xe2d7de,_0x593cc1){const _0x25d5be=a27_0x4cad,_0x51c277=_0xe2d7de();while(!![]){try{const _0x1aec48=-parseInt(_0x25d5be(0xf6))/0x1+parseInt(_0x25d5be(0x106))/0x2+parseInt(_0x25d5be(0xfa))/0x3*(-parseInt(_0x25d5be(0xfb))/0x4)+-parseInt(_0x25d5be(0x108))/0x5*(parseInt(_0x25d5be(0xf1))/0x6)+-parseInt(_0x25d5be(0xee))/0x7+parseInt(_0x25d5be(0xf3))/0x8+-parseInt(_0x25d5be(0x10b))/0x9*(-parseInt(_0x25d5be(0x101))/0xa);if(_0x1aec48===_0x593cc1)break;else _0x51c277['push'](_0x51c277['shift']());}catch(_0x3544a5){_0x51c277['push'](_0x51c277['shift']());}}}(a27_0x2b31,0x90aac));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a27_0x2b31(){const _0x12ca2e=['build','pipe','toString','3576181Tchaor','env','npm\x20run\x20build','18RxnklB','message','6336368ciTSVg','success','PATH','546407hUnuua','logger','data','项目构建失败','141glNvSP','99768wEhzRH','node_modules','cwd','stderr','项目构建成功','npm\x20run\x20build\x20exited\x20with\x20code\x20','10CnIRta','error','inherit','close','开始构建项目','1283848fIbWdk','now','354395EmSOXf','Build\x20project','项目构建出错','14407083cQXTrV','info','trim'];a27_0x2b31=function(){return _0x12ca2e;};return a27_0x2b31();}function runBuild(_0x1490f7){return new Promise((_0x163920,_0x4bc8b3)=>{const _0x3fdf6c=a27_0x4cad,_0x3e0e8f=Date['now']();_0x1490f7[_0x3fdf6c(0xf7)][_0x3fdf6c(0x10c)](_0x3fdf6c(0x10e),_0x3fdf6c(0x105),{'command':_0x3fdf6c(0xf0)});let _0x43c6b0='';const _0x8dd7bf=spawn('npm',['run',_0x3fdf6c(0x10e)],{'stdio':['inherit',_0x3fdf6c(0x103),_0x3fdf6c(0x10f)],'shell':!![],'env':{...process[_0x3fdf6c(0xef)],'PATH':''+join(process[_0x3fdf6c(0xfd)](),_0x3fdf6c(0xfc),'.bin')+delimiter+process['env'][_0x3fdf6c(0xf5)]}});_0x8dd7bf[_0x3fdf6c(0xfe)]?.['on'](_0x3fdf6c(0xf8),_0x4bcc22=>{const _0x19104c=_0x3fdf6c;_0x43c6b0+=_0x4bcc22[_0x19104c(0xed)]();}),_0x8dd7bf['on'](_0x3fdf6c(0x104),_0xddc62c=>{const _0x97e2b1=_0x3fdf6c,_0x4354cf=Date[_0x97e2b1(0x107)]()-_0x3e0e8f;if(_0xddc62c===0x0||_0xddc62c===null)_0x1490f7['logger'][_0x97e2b1(0xf4)](_0x97e2b1(0x10e),_0x97e2b1(0xff),_0x4354cf),_0x163920();else{const _0x3192ec={'exitCode':_0xddc62c,'duration':_0x4354cf,'command':_0x97e2b1(0xf0),'cwd':process['cwd']()};_0x43c6b0[_0x97e2b1(0x10d)]()&&(_0x3192ec[_0x97e2b1(0xfe)]=_0x43c6b0[_0x97e2b1(0x10d)]()),_0x1490f7[_0x97e2b1(0xf7)][_0x97e2b1(0x102)](_0x97e2b1(0x10e),_0x97e2b1(0xf9),_0x3192ec),_0x4bc8b3(new Error(_0x97e2b1(0x100)+_0xddc62c));}}),_0x8dd7bf['on'](_0x3fdf6c(0x102),_0x3a4ec0=>{const _0x1b3454=_0x3fdf6c,_0x124dcb=Date['now']()-_0x3e0e8f;_0x1490f7[_0x1b3454(0xf7)][_0x1b3454(0x102)](_0x1b3454(0x10e),_0x1b3454(0x10a),{'error':_0x3a4ec0[_0x1b3454(0xf2)],'duration':_0x124dcb,'stderr':_0x43c6b0[_0x1b3454(0x10d)]()||undefined}),_0x4bc8b3(_0x3a4ec0);});});}function a27_0x4cad(_0x1e5ad1,_0x3f7bfa){_0x1e5ad1=_0x1e5ad1-0xed;const _0x2b315e=a27_0x2b31();let _0x4cad8e=_0x2b315e[_0x1e5ad1];return _0x4cad8e;}export const buildCommand={'name':a27_0x1609a8(0x10e),'description':a27_0x1609a8(0x109),async 'run'(_0x16adad,_0x118604,_0x594037){await runBuild(_0x16adad);}};
1
+ const a26_0x3427b1=a26_0x328e;(function(_0x312785,_0x4eb7d6){const _0x31f0b0=a26_0x328e,_0xcc3cfb=_0x312785();while(!![]){try{const _0x22d2ab=-parseInt(_0x31f0b0(0x80))/0x1*(-parseInt(_0x31f0b0(0x9e))/0x2)+parseInt(_0x31f0b0(0x93))/0x3*(-parseInt(_0x31f0b0(0xa0))/0x4)+-parseInt(_0x31f0b0(0x9a))/0x5*(-parseInt(_0x31f0b0(0x8a))/0x6)+parseInt(_0x31f0b0(0x83))/0x7+parseInt(_0x31f0b0(0x99))/0x8*(parseInt(_0x31f0b0(0x97))/0x9)+-parseInt(_0x31f0b0(0x8b))/0xa*(-parseInt(_0x31f0b0(0x9c))/0xb)+-parseInt(_0x31f0b0(0x8c))/0xc;if(_0x22d2ab===_0x4eb7d6)break;else _0xcc3cfb['push'](_0xcc3cfb['shift']());}catch(_0x1053bb){_0xcc3cfb['push'](_0xcc3cfb['shift']());}}}(a26_0x41f4,0x42457));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a26_0x41f4(){const _0x1e6436=['80277WBdNzI','inherit','success','logger','1357074mWljUW','now','16vovwjA','507260LbecED','node_modules','2093179uFSccE','info','320466fSgzKO','项目构建出错','48WBuWAy','项目构建成功','message','2OFtAFZ','npm\x20run\x20build\x20exited\x20with\x20code\x20','项目构建失败','3385389DjmpUU','npm\x20run\x20build','run','close','toString','开始构建项目','error','12TCiBFt','20VmXvYO','13159104pkOPeQ','cwd','trim','.bin','pipe','build','env'];a26_0x41f4=function(){return _0x1e6436;};return a26_0x41f4();}function runBuild(_0x475997){return new Promise((_0x3d76a3,_0x21d126)=>{const _0x3c85e9=a26_0x328e,_0x4b286a=Date[_0x3c85e9(0x98)]();_0x475997['logger'][_0x3c85e9(0x9d)](_0x3c85e9(0x91),_0x3c85e9(0x88),{'command':_0x3c85e9(0x84)});let _0x4e8edb='';const _0x392bb4=spawn('npm',[_0x3c85e9(0x85),_0x3c85e9(0x91)],{'stdio':[_0x3c85e9(0x94),_0x3c85e9(0x94),_0x3c85e9(0x90)],'shell':!![],'env':{...process[_0x3c85e9(0x92)],'PATH':''+join(process['cwd'](),_0x3c85e9(0x9b),_0x3c85e9(0x8f))+delimiter+process[_0x3c85e9(0x92)]['PATH']}});_0x392bb4['stderr']?.['on']('data',_0x180807=>{const _0x430f00=_0x3c85e9;_0x4e8edb+=_0x180807[_0x430f00(0x87)]();}),_0x392bb4['on'](_0x3c85e9(0x86),_0x4552ba=>{const _0x1ad6b5=_0x3c85e9,_0x1be25f=Date[_0x1ad6b5(0x98)]()-_0x4b286a;if(_0x4552ba===0x0||_0x4552ba===null)_0x475997[_0x1ad6b5(0x96)][_0x1ad6b5(0x95)](_0x1ad6b5(0x91),_0x1ad6b5(0x7e),_0x1be25f),_0x3d76a3();else{const _0x4bdfbf={'exitCode':_0x4552ba,'duration':_0x1be25f,'command':_0x1ad6b5(0x84),'cwd':process[_0x1ad6b5(0x8d)]()};_0x4e8edb[_0x1ad6b5(0x8e)]()&&(_0x4bdfbf['stderr']=_0x4e8edb[_0x1ad6b5(0x8e)]()),_0x475997[_0x1ad6b5(0x96)][_0x1ad6b5(0x89)](_0x1ad6b5(0x91),_0x1ad6b5(0x82),_0x4bdfbf),_0x21d126(new Error(_0x1ad6b5(0x81)+_0x4552ba));}}),_0x392bb4['on'](_0x3c85e9(0x89),_0xa2462c=>{const _0x2c1a16=_0x3c85e9,_0x49b70c=Date[_0x2c1a16(0x98)]()-_0x4b286a;_0x475997['logger']['error']('build',_0x2c1a16(0x9f),{'error':_0xa2462c[_0x2c1a16(0x7f)],'duration':_0x49b70c,'stderr':_0x4e8edb[_0x2c1a16(0x8e)]()||undefined}),_0x21d126(_0xa2462c);});});}function a26_0x328e(_0x219619,_0x2d4080){_0x219619=_0x219619-0x7e;const _0x41f41a=a26_0x41f4();let _0x328ed1=_0x41f41a[_0x219619];return _0x328ed1;}export const buildCommand={'name':a26_0x3427b1(0x91),'description':'Build\x20project',async 'run'(_0x3b656a,_0x41e021,_0x290b2b){await runBuild(_0x3b656a);}};
@@ -1 +1 @@
1
- (function(_0x49ca24,_0x20ceea){const _0xb7076b=a28_0x10f6,_0x4a9228=_0x49ca24();while(!![]){try{const _0x3beb22=-parseInt(_0xb7076b(0x169))/0x1+parseInt(_0xb7076b(0x15a))/0x2+-parseInt(_0xb7076b(0x16a))/0x3+-parseInt(_0xb7076b(0x14f))/0x4*(-parseInt(_0xb7076b(0x166))/0x5)+-parseInt(_0xb7076b(0x16d))/0x6+parseInt(_0xb7076b(0x148))/0x7*(parseInt(_0xb7076b(0x152))/0x8)+parseInt(_0xb7076b(0x160))/0x9*(parseInt(_0xb7076b(0x15c))/0xa);if(_0x3beb22===_0x20ceea)break;else _0x4a9228['push'](_0x4a9228['shift']());}catch(_0x58fc31){_0x4a9228['push'](_0x4a9228['shift']());}}}(a28_0x40fd,0x53466));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a28_0x1d7028 from'chalk';import a28_0x84aac4 from'ora';import a28_0x297e8d from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';function a28_0x10f6(_0x339752,_0x3b12f9){_0x339752=_0x339752-0x145;const _0x40fdea=a28_0x40fd();let _0x10f674=_0x40fdea[_0x339752];return _0x10f674;}function getCurrentVersion(){const _0x516b17=a28_0x10f6;try{const _0x394f4f=resolve(dirname(fileURLToPath(import.meta.url)),'..'),_0xfa1bde=JSON[_0x516b17(0x158)](readFileSync(resolve(_0x394f4f,'package.json'),_0x516b17(0x14a))),_0x514fa8=_0xfa1bde['version']||_0x516b17(0x145);return BUILD_NUMBER?_0x514fa8+'+'+BUILD_NUMBER:_0x514fa8;}catch{return'0.0.0';}}function detectPackageManager(){const _0x55a7e1=a28_0x10f6,_0x45310f=process[_0x55a7e1(0x15d)][_0x55a7e1(0x149)]();if(_0x45310f[_0x55a7e1(0x154)]('bun'))return'bun';return _0x55a7e1(0x165);}async function fetchLatestNpmVersion(){const _0x5b1d37=a28_0x10f6;try{const _0x6e0512=await fetch(_0x5b1d37(0x150)+NPM_PACKAGE_NAME+'/latest',{'signal':AbortSignal['timeout'](0x2710)});if(!_0x6e0512['ok'])return null;const _0x275409=await _0x6e0512[_0x5b1d37(0x16e)]();return _0x275409['version']??null;}catch{return null;}}function a28_0x40fd(){const _0x56fcf8=['483096pEjJsB','red','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','4020018QPGesV','json','Updated\x20to\x20v','error','\x20install\x20-g\x20','green','0.0.0','stableVersion','coerce','3227FtoHWe','toLowerCase','utf-8','pipe','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Version\x20comparison\x20failed','cli','1124128EdxeIQ','https://registry.npmjs.org/','Update\x20available:\x20','4024TFmODT','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','includes','succeed','\x20→\x20','\x20\x20Try\x20manually:\x20','parse','@latest','157416vEzpju','fail','30qigWBs','execPath','Current\x20version:\x20','...','2561427TdOdgG','Checking\x20for\x20updates...','Updating\x20via\x20','Update\x20failed','gray','npm','10aVpPSP','info','log','554335HFMSdv'];a28_0x40fd=function(){return _0x56fcf8;};return a28_0x40fd();}async function fetchLatestVersion(){const _0x4ec6c9=a28_0x10f6,_0x58c810=await fetchLatestNpmVersion();if(_0x58c810)return _0x58c810;const _0x50ec96=await getCdnConfig();return _0x50ec96?.[_0x4ec6c9(0x14e)]?.[_0x4ec6c9(0x146)]??null;}async function runSelfUpdate(_0x563ab8,_0x3cefe6,_0xe5319){const _0x145b47=a28_0x10f6,_0x6a61b6=getCurrentVersion();console[_0x145b47(0x168)](_0x145b47(0x15e)+_0x6a61b6);const _0x1b8777=a28_0x84aac4(_0x145b47(0x161))['start'](),_0x2b6ef3=await fetchLatestVersion();if(!_0x2b6ef3){_0x1b8777[_0x145b47(0x15b)](_0x145b47(0x16c)),console[_0x145b47(0x168)](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x14c)+NPM_PACKAGE_NAME+_0x145b47(0x159)));return;}const _0x191ac0=a28_0x297e8d[_0x145b47(0x147)](_0x6a61b6),_0x539e5e=a28_0x297e8d[_0x145b47(0x147)](_0x2b6ef3);if(!_0x191ac0||!_0x539e5e){_0x1b8777['fail'](_0x145b47(0x14d));return;}if(!a28_0x297e8d['lt'](_0x191ac0,_0x539e5e)){_0x1b8777['succeed']('Already\x20up\x20to\x20date\x20(v'+_0x2b6ef3+')');return;}_0x1b8777[_0x145b47(0x167)](_0x145b47(0x151)+a28_0x1d7028['yellow'](_0x6a61b6)+_0x145b47(0x156)+a28_0x1d7028[_0x145b47(0x172)](_0x2b6ef3));const _0x373337=detectPackageManager(),_0x5a2c3f=a28_0x84aac4(_0x145b47(0x162)+_0x373337+_0x145b47(0x15f))['start']();try{await execa(_0x373337,['install','-g',NPM_PACKAGE_NAME+_0x145b47(0x159)],{'stdio':_0x145b47(0x14b)}),_0x5a2c3f[_0x145b47(0x155)](_0x145b47(0x16f)+_0x2b6ef3),console['log'](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x153)));}catch(_0x27e89d){_0x5a2c3f[_0x145b47(0x15b)](_0x145b47(0x163)),console[_0x145b47(0x170)](a28_0x1d7028[_0x145b47(0x16b)]('\x20\x20'+_0x27e89d['message'])),console['log'](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x157)+_0x373337+_0x145b47(0x171)+NPM_PACKAGE_NAME+'@latest'));}}export const updateCommand={'name':'update','description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',async 'run'(_0x38ce7b,_0x2680bc,_0x3bd8f){await runSelfUpdate(_0x38ce7b,_0x2680bc,_0x3bd8f);}};
1
+ (function(_0x4d97aa,_0x4b225e){const _0x36ab8a=a27_0x2037,_0x3040ac=_0x4d97aa();while(!![]){try{const _0x3a1055=parseInt(_0x36ab8a(0x12e))/0x1*(parseInt(_0x36ab8a(0x143))/0x2)+parseInt(_0x36ab8a(0x12b))/0x3*(-parseInt(_0x36ab8a(0x146))/0x4)+parseInt(_0x36ab8a(0x138))/0x5+-parseInt(_0x36ab8a(0x125))/0x6*(parseInt(_0x36ab8a(0x145))/0x7)+parseInt(_0x36ab8a(0x131))/0x8*(parseInt(_0x36ab8a(0x136))/0x9)+-parseInt(_0x36ab8a(0x14f))/0xa*(parseInt(_0x36ab8a(0x137))/0xb)+-parseInt(_0x36ab8a(0x14d))/0xc*(-parseInt(_0x36ab8a(0x151))/0xd);if(_0x3a1055===_0x4b225e)break;else _0x3040ac['push'](_0x3040ac['shift']());}catch(_0xe5ec89){_0x3040ac['push'](_0x3040ac['shift']());}}}(a27_0x4b89,0xdf92c));import{readFileSync}from'node:fs';function a27_0x2037(_0x4b60da,_0x487076){_0x4b60da=_0x4b60da-0x122;const _0x4b89c0=a27_0x4b89();let _0x2037ef=_0x4b89c0[_0x4b60da];return _0x2037ef;}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a27_0x337c44 from'chalk';import a27_0x55baa1 from'ora';import a27_0x30583a from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';function a27_0x4b89(){const _0x5c1e39=['\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','fail','/latest','npm','Already\x20up\x20to\x20date\x20(v','12VWdQFa','Updated\x20to\x20v','52980YJEaqz','cli','24397607cEaFGt','yellow','coerce','bun','Checking\x20for\x20updates...','succeed','execPath','package.json','green','8491080jXEcFp','message','0.0.0','pipe','...','gray','5424891tYeSZj','\x20\x20Try\x20manually:\x20','error','1XodDiF','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','start','16RZTiOq','stableVersion','install','red','log','5118975leLlDD','473BYgvlZ','5222280FxfoYB','parse','../..','Update\x20failed','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Update\x20available:\x20','version','timeout','Current\x20version:\x20','@latest','https://registry.npmjs.org/','616604Uwtegc','Version\x20comparison\x20failed','7PSjFoT','4CsdVGb','includes'];a27_0x4b89=function(){return _0x5c1e39;};return a27_0x4b89();}import{getCdnConfig}from'../utils/cdn-config.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x1b3cdc=a27_0x2037;try{const _0x179aed=resolve(dirname(fileURLToPath(import.meta.url)),_0x1b3cdc(0x13a)),_0x5234a7=JSON[_0x1b3cdc(0x139)](readFileSync(resolve(_0x179aed,_0x1b3cdc(0x123)),'utf-8')),_0x335afc=_0x5234a7[_0x1b3cdc(0x13e)]||_0x1b3cdc(0x127);return BUILD_NUMBER?_0x335afc+'+'+BUILD_NUMBER:_0x335afc;}catch{return'0.0.0';}}function detectPackageManager(){const _0x46383d=a27_0x2037,_0x28d7d4=process[_0x46383d(0x122)]['toLowerCase']();if(_0x28d7d4[_0x46383d(0x147)](_0x46383d(0x154)))return'bun';return _0x46383d(0x14b);}async function fetchLatestNpmVersion(){const _0x12d95d=a27_0x2037;try{const _0x8b07de=await fetch(_0x12d95d(0x142)+NPM_PACKAGE_NAME+_0x12d95d(0x14a),{'signal':AbortSignal[_0x12d95d(0x13f)](0x2710)});if(!_0x8b07de['ok'])return null;const _0x5b77b9=await _0x8b07de['json']();return _0x5b77b9['version']??null;}catch{return null;}}async function fetchLatestVersion(){const _0x17c0af=a27_0x2037,_0x30c7b8=await fetchLatestNpmVersion();if(_0x30c7b8)return _0x30c7b8;const _0x5a0619=await getCdnConfig();return _0x5a0619?.[_0x17c0af(0x150)]?.[_0x17c0af(0x132)]??null;}async function runSelfUpdate(_0x35f48a,_0x5f6801,_0x1e82ec){const _0x43aa60=a27_0x2037,_0x4f9c80=getCurrentVersion();console[_0x43aa60(0x135)](_0x43aa60(0x140)+_0x4f9c80);const _0xa763bb=a27_0x55baa1(_0x43aa60(0x155))[_0x43aa60(0x130)](),_0x51ef06=await fetchLatestVersion();if(!_0x51ef06){_0xa763bb[_0x43aa60(0x149)](_0x43aa60(0x12f)),console[_0x43aa60(0x135)](a27_0x337c44[_0x43aa60(0x12a)](_0x43aa60(0x148)+NPM_PACKAGE_NAME+_0x43aa60(0x141)));return;}const _0x1a92f6=a27_0x30583a[_0x43aa60(0x153)](_0x4f9c80),_0x28d293=a27_0x30583a[_0x43aa60(0x153)](_0x51ef06);if(!_0x1a92f6||!_0x28d293){_0xa763bb[_0x43aa60(0x149)](_0x43aa60(0x144));return;}if(!a27_0x30583a['lt'](_0x1a92f6,_0x28d293)){_0xa763bb[_0x43aa60(0x156)](_0x43aa60(0x14c)+_0x51ef06+')');return;}_0xa763bb['info'](_0x43aa60(0x13d)+a27_0x337c44[_0x43aa60(0x152)](_0x4f9c80)+'\x20→\x20'+a27_0x337c44[_0x43aa60(0x124)](_0x51ef06));const _0x1cea7b=detectPackageManager(),_0x455e2d=_0x1cea7b===_0x43aa60(0x14b)?resolveNpmBin(_0x43aa60(0x14b)):_0x1cea7b,_0x525c03=a27_0x55baa1('Updating\x20via\x20'+_0x1cea7b+_0x43aa60(0x129))[_0x43aa60(0x130)]();try{await execa(_0x455e2d,[_0x43aa60(0x133),'-g',NPM_PACKAGE_NAME+_0x43aa60(0x141)],{'stdio':_0x43aa60(0x128)}),_0x525c03[_0x43aa60(0x156)](_0x43aa60(0x14e)+_0x51ef06),console[_0x43aa60(0x135)](a27_0x337c44[_0x43aa60(0x12a)](_0x43aa60(0x13c)));}catch(_0x4f2254){_0x525c03[_0x43aa60(0x149)](_0x43aa60(0x13b)),console[_0x43aa60(0x12d)](a27_0x337c44[_0x43aa60(0x134)]('\x20\x20'+_0x4f2254[_0x43aa60(0x126)])),console['log'](a27_0x337c44[_0x43aa60(0x12a)](_0x43aa60(0x12c)+_0x1cea7b+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x43aa60(0x141)));}}export const updateCommand={'name':'update','description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',async 'run'(_0x93def0,_0x56f43d,_0x1bdc91){await runSelfUpdate(_0x93def0,_0x56f43d,_0x1bdc91);}};
@@ -1 +1 @@
1
- function a29_0x229f(){const _0x4089c3=['22925860XdwudJ','3306828RgdXqH','2135gXZydh','2UydYUL','1445096kNXpWB','10240LmRdLC','5718OoHDad','3147237ReRfms','92311EsXMae','98eXTIkU'];a29_0x229f=function(){return _0x4089c3;};return a29_0x229f();}(function(_0x21bb31,_0x190893){const _0x3419a3=a29_0x49b9,_0x20b6f2=_0x21bb31();while(!![]){try{const _0x3facbf=-parseInt(_0x3419a3(0x1d9))/0x1*(parseInt(_0x3419a3(0x1d4))/0x2)+-parseInt(_0x3419a3(0x1d2))/0x3+-parseInt(_0x3419a3(0x1d5))/0x4+parseInt(_0x3419a3(0x1d3))/0x5*(-parseInt(_0x3419a3(0x1d7))/0x6)+-parseInt(_0x3419a3(0x1d0))/0x7*(parseInt(_0x3419a3(0x1d6))/0x8)+parseInt(_0x3419a3(0x1d8))/0x9+parseInt(_0x3419a3(0x1d1))/0xa;if(_0x3facbf===_0x190893)break;else _0x20b6f2['push'](_0x20b6f2['shift']());}catch(_0x5423d2){_0x20b6f2['push'](_0x20b6f2['shift']());}}}(a29_0x229f,0xa183f));function a29_0x49b9(_0x3152dc,_0xd42fea){_0x3152dc=_0x3152dc-0x1d0;const _0x229f15=a29_0x229f();let _0x49b91a=_0x229f15[_0x3152dc];return _0x49b91a;}import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ (function(_0x3922cf,_0xa77c64){const _0x57c088=a28_0x3f5e,_0x5768f4=_0x3922cf();while(!![]){try{const _0xeb123c=parseInt(_0x57c088(0x15c))/0x1*(parseInt(_0x57c088(0x15b))/0x2)+parseInt(_0x57c088(0x164))/0x3+-parseInt(_0x57c088(0x15f))/0x4*(-parseInt(_0x57c088(0x15e))/0x5)+parseInt(_0x57c088(0x160))/0x6*(-parseInt(_0x57c088(0x15d))/0x7)+parseInt(_0x57c088(0x162))/0x8+parseInt(_0x57c088(0x161))/0x9+-parseInt(_0x57c088(0x163))/0xa;if(_0xeb123c===_0xa77c64)break;else _0x5768f4['push'](_0x5768f4['shift']());}catch(_0x2f3094){_0x5768f4['push'](_0x5768f4['shift']());}}}(a28_0x1956,0xea8b4));function a28_0x3f5e(_0x34818a,_0x28a9b4){_0x34818a=_0x34818a-0x15b;const _0x19562d=a28_0x1956();let _0x3f5e1f=_0x19562d[_0x34818a];return _0x3f5e1f;}import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';function a28_0x1956(){const _0x437f9d=['10602KblghK','13652622ajiaWh','1821632KZXiPb','25464960mXAWTo','4012533NHFyxN','92sFiJxe','14567zHZXSZ','1995SzCEgE','107720iETuov','48kIYQYK'];a28_0x1956=function(){return _0x437f9d;};return a28_0x1956();}export const codegenDefinitions=[codegenSdk,codegenSql];
@@ -1 +1 @@
1
- const a30_0x37db90=a30_0x46e4;function a30_0x46e4(_0x4b49bf,_0x489a77){_0x4b49bf=_0x4b49bf-0xdd;const _0x3ca41a=a30_0x3ca4();let _0x46e445=_0x3ca41a[_0x4b49bf];return _0x46e445;}(function(_0x2dacb6,_0x48a312){const _0x12b37e=a30_0x46e4,_0xf940a9=_0x2dacb6();while(!![]){try{const _0x545a12=-parseInt(_0x12b37e(0xf3))/0x1*(-parseInt(_0x12b37e(0xde))/0x2)+parseInt(_0x12b37e(0xf4))/0x3+parseInt(_0x12b37e(0xf8))/0x4*(parseInt(_0x12b37e(0xf2))/0x5)+-parseInt(_0x12b37e(0xe6))/0x6+-parseInt(_0x12b37e(0xe2))/0x7*(-parseInt(_0x12b37e(0xdd))/0x8)+parseInt(_0x12b37e(0xed))/0x9*(parseInt(_0x12b37e(0xf0))/0xa)+-parseInt(_0x12b37e(0xee))/0xb*(parseInt(_0x12b37e(0xea))/0xc);if(_0x545a12===_0x48a312)break;else _0xf940a9['push'](_0xf940a9['shift']());}catch(_0x1d35e4){_0xf940a9['push'](_0xf940a9['shift']());}}}(a30_0x3ca4,0x41ce4));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':a30_0x37db90(0xef),'command':a30_0x37db90(0xe8),'description':a30_0x37db90(0xe5),'risk':a30_0x37db90(0xf7),'flags':[CODE_FLAG_OPTIONAL,{'name':a30_0x37db90(0xe0),'type':a30_0x37db90(0xec),'description':a30_0x37db90(0xf6)},{'name':'operation','type':a30_0x37db90(0xec),'required':!![],'description':a30_0x37db90(0xf1)},{'name':'skip-imports','type':a30_0x37db90(0xdf),'description':a30_0x37db90(0xf5)}],async 'execute'(_0x1eced3){const _0x1c277a=a30_0x37db90,{dataset:_0xe12874,operation:_0x1556a7}=await getOperationDetail(_0x1eced3['appCode'],_0x1eced3[_0x1c277a(0xe3)](_0x1c277a(0xe9)),_0x1eced3['str'](_0x1c277a(0xe4))),_0x3023a1=generateSdkCode(_0xe12874,_0x1556a7,{'includeImports':!_0x1eced3[_0x1c277a(0xe7)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0xe12874[_0x1c277a(0xeb)],'code':_0xe12874[_0x1c277a(0xe9)],'tableName':_0xe12874[_0x1c277a(0xe1)]},'operation':_0x1eced3[_0x1c277a(0xe3)]('operation'),'code':_0x3023a1}};}};function a30_0x3ca4(){const _0x2f9fbe=['sdk','code','108njMQlD','name','string','6309mRrFyT','555511sXOIRV','codegen','2950poLDbr','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','860aKrwHT','21FwOsJD','946710VmIcNx','Omit\x20import\x20statements\x20from\x20generated\x20code','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','read','5752QuElmS','32IABUrY','31134Gujuiv','boolean','alias','tableName','140819QRGdEZ','str','operation','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','2718162kCEroW','bool'];a30_0x3ca4=function(){return _0x2f9fbe;};return a30_0x3ca4();}
1
+ const a29_0x1fa197=a29_0x5375;function a29_0x5375(_0xef3055,_0x310a99){_0xef3055=_0xef3055-0xd8;const _0x42dedd=a29_0x42de();let _0x5375d6=_0x42dedd[_0xef3055];return _0x5375d6;}(function(_0x127c6d,_0x5c1470){const _0x4ec7be=a29_0x5375,_0x529737=_0x127c6d();while(!![]){try{const _0x28771e=parseInt(_0x4ec7be(0xea))/0x1+-parseInt(_0x4ec7be(0xe0))/0x2*(-parseInt(_0x4ec7be(0xdc))/0x3)+-parseInt(_0x4ec7be(0xe9))/0x4*(parseInt(_0x4ec7be(0xdf))/0x5)+-parseInt(_0x4ec7be(0xde))/0x6+-parseInt(_0x4ec7be(0xe1))/0x7+parseInt(_0x4ec7be(0xe7))/0x8+parseInt(_0x4ec7be(0xda))/0x9;if(_0x28771e===_0x5c1470)break;else _0x529737['push'](_0x529737['shift']());}catch(_0x11cecc){_0x529737['push'](_0x529737['shift']());}}}(a29_0x42de,0x3b0e2));function a29_0x42de(){const _0x24299c=['boolean','244AlECdE','87599lZEXbg','str','string','operation','sdk','Omit\x20import\x20statements\x20from\x20generated\x20code','2256498HEPbzP','code','177cuMwKc','bool','1879782rqDCmR','14475pcphif','12206EwIfQP','1212827whTVLb','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','tableName','alias','skip-imports','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','1653160MMyVqJ'];a29_0x42de=function(){return _0x24299c;};return a29_0x42de();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../common/flags.js';export const codegenSdk={'service':'codegen','command':a29_0x1fa197(0xd8),'description':a29_0x1fa197(0xe6),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a29_0x1fa197(0xe4),'type':a29_0x1fa197(0xec),'description':a29_0x1fa197(0xe2)},{'name':a29_0x1fa197(0xed),'type':a29_0x1fa197(0xec),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a29_0x1fa197(0xe5),'type':a29_0x1fa197(0xe8),'description':a29_0x1fa197(0xd9)}],async 'execute'(_0x8af2a5){const _0x59db43=a29_0x1fa197,{dataset:_0x12eb92,operation:_0x1f65b5}=await getOperationDetail(_0x8af2a5['appCode'],_0x8af2a5[_0x59db43(0xeb)](_0x59db43(0xdb)),_0x8af2a5[_0x59db43(0xeb)]('operation')),_0x1e2ba1=generateSdkCode(_0x12eb92,_0x1f65b5,{'includeImports':!_0x8af2a5[_0x59db43(0xdd)](_0x59db43(0xe5))});return{'ok':!![],'data':{'dataset':{'name':_0x12eb92['name'],'code':_0x12eb92['code'],'tableName':_0x12eb92[_0x59db43(0xe3)]},'operation':_0x8af2a5[_0x59db43(0xeb)]('operation'),'code':_0x1e2ba1}};}};
@@ -1 +1 @@
1
- const a31_0x424e71=a31_0x1cd0;function a31_0x39d4(){const _0x49ee78=['23627529DNNbtJ','21572BFPWUJ','sqlName','boolean','appCode','Omit\x20import\x20statements\x20from\x20generated\x20code','codegen','16caDItS','2986180sJQaSW','target','no-imports','sqlCode','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','2895685dLLMml','1704249dzZTrc','7jNCyeB','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sql','str','sdk','2478510wItsQG','read','bool','sqlcode','9762784XICAUV'];a31_0x39d4=function(){return _0x49ee78;};return a31_0x39d4();}(function(_0x52dca9,_0x4bfe2){const _0x4b29ef=a31_0x1cd0,_0x4f2ca1=_0x52dca9();while(!![]){try{const _0x496f8d=-parseInt(_0x4b29ef(0x1d6))/0x1*(-parseInt(_0x4b29ef(0x1dc))/0x2)+-parseInt(_0x4b29ef(0x1ca))/0x3+parseInt(_0x4b29ef(0x1dd))/0x4+-parseInt(_0x4b29ef(0x1c9))/0x5+-parseInt(_0x4b29ef(0x1d0))/0x6+-parseInt(_0x4b29ef(0x1cb))/0x7*(parseInt(_0x4b29ef(0x1d4))/0x8)+parseInt(_0x4b29ef(0x1d5))/0x9;if(_0x496f8d===_0x4bfe2)break;else _0x4f2ca1['push'](_0x4f2ca1['shift']());}catch(_0x38f011){_0x4f2ca1['push'](_0x4f2ca1['shift']());}}}(a31_0x39d4,0xba765));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../common/flags.js';function a31_0x1cd0(_0x3ca368,_0x5c25c6){_0x3ca368=_0x3ca368-0x1c7;const _0x39d478=a31_0x39d4();let _0x1cd03b=_0x39d478[_0x3ca368];return _0x1cd03b;}export const codegenSql={'service':a31_0x424e71(0x1db),'command':a31_0x424e71(0x1cd),'description':a31_0x424e71(0x1c8),'risk':a31_0x424e71(0x1d1),'flags':[SQLCODE_FLAG,{'name':a31_0x424e71(0x1de),'type':'string','description':a31_0x424e71(0x1cc),'default':'sdk','enum':[a31_0x424e71(0x1cf),'bff']},{'name':a31_0x424e71(0x1df),'type':a31_0x424e71(0x1d8),'description':a31_0x424e71(0x1da)}],async 'execute'(_0x3d0d4f){const _0x37fa4d=a31_0x424e71,_0x4de2eb=await getSqlQueryInfo(_0x3d0d4f[_0x37fa4d(0x1d9)],_0x3d0d4f['str'](_0x37fa4d(0x1d3))),_0x5af427=_0x3d0d4f[_0x37fa4d(0x1ce)]('target')||_0x37fa4d(0x1cf),_0x356717=generateSqlCodeTemplate(_0x4de2eb,{'target':_0x5af427,'includeImports':!_0x3d0d4f[_0x37fa4d(0x1d2)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x4de2eb[_0x37fa4d(0x1c7)],'sqlName':_0x4de2eb[_0x37fa4d(0x1d7)],'target':_0x5af427,'code':_0x356717}};}};
1
+ const a30_0x271f90=a30_0x45e7;function a30_0x45e7(_0x2def6b,_0x3c820e){_0x2def6b=_0x2def6b-0xfc;const _0x2c036b=a30_0x2c03();let _0x45e7db=_0x2c036b[_0x2def6b];return _0x45e7db;}(function(_0x4f27ba,_0x110af9){const _0x4eee1b=a30_0x45e7,_0x5e229e=_0x4f27ba();while(!![]){try{const _0x25000c=-parseInt(_0x4eee1b(0x112))/0x1*(parseInt(_0x4eee1b(0x10a))/0x2)+parseInt(_0x4eee1b(0xfd))/0x3*(parseInt(_0x4eee1b(0x100))/0x4)+-parseInt(_0x4eee1b(0x107))/0x5*(-parseInt(_0x4eee1b(0x110))/0x6)+-parseInt(_0x4eee1b(0x101))/0x7*(-parseInt(_0x4eee1b(0x114))/0x8)+parseInt(_0x4eee1b(0x109))/0x9*(-parseInt(_0x4eee1b(0xff))/0xa)+parseInt(_0x4eee1b(0xfe))/0xb+-parseInt(_0x4eee1b(0x113))/0xc*(parseInt(_0x4eee1b(0x103))/0xd);if(_0x25000c===_0x110af9)break;else _0x5e229e['push'](_0x5e229e['shift']());}catch(_0x1a738a){_0x5e229e['push'](_0x5e229e['shift']());}}}(a30_0x2c03,0xbd3c4));function a30_0x2c03(){const _0x20ddcf=['bool','20WIWVou','str','149067WMyare','2654UgXdwk','boolean','sdk','sql','string','bff','1578066fsaARZ','appCode','273zVszRv','10335012cyreBs','8072840ciaSBO','no-imports','sqlCode','sqlcode','239898mIXYpY','4581797DrQKPy','590fIuZJr','68yVNbuX','7dUPGrA','target','26uBNEeR','Omit\x20import\x20statements\x20from\x20generated\x20code','Code\x20target:\x20sdk\x20(default)\x20or\x20bff'];a30_0x2c03=function(){return _0x20ddcf;};return a30_0x2c03();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../common/flags.js';export const codegenSql={'service':'codegen','command':a30_0x271f90(0x10d),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':'read','flags':[SQLCODE_FLAG,{'name':'target','type':a30_0x271f90(0x10e),'description':a30_0x271f90(0x105),'default':a30_0x271f90(0x10c),'enum':['sdk',a30_0x271f90(0x10f)]},{'name':a30_0x271f90(0x115),'type':a30_0x271f90(0x10b),'description':a30_0x271f90(0x104)}],async 'execute'(_0x5242d4){const _0x56e35b=a30_0x271f90,_0x94b5a=await getSqlQueryInfo(_0x5242d4[_0x56e35b(0x111)],_0x5242d4[_0x56e35b(0x108)](_0x56e35b(0xfc))),_0x5a6da1=_0x5242d4['str'](_0x56e35b(0x102))||_0x56e35b(0x10c),_0x5c5586=generateSqlCodeTemplate(_0x94b5a,{'target':_0x5a6da1,'includeImports':!_0x5242d4[_0x56e35b(0x106)](_0x56e35b(0x115))});return{'ok':!![],'data':{'sqlCode':_0x94b5a[_0x56e35b(0x116)],'sqlName':_0x94b5a['sqlName'],'target':_0x5a6da1,'code':_0x5c5586}};}};
@@ -1 +1 @@
1
- function a32_0x3018(_0x2076aa,_0x362ff9){_0x2076aa=_0x2076aa-0xaa;const _0x2d6291=a32_0x2d62();let _0x3018ee=_0x2d6291[_0x2076aa];return _0x3018ee;}function a32_0x2d62(){const _0x3f5280=['202640KlXNkK','175CYNDKf','27DSXOeR','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','3693045JYTULU','1354430qToRtN','2432436bBJnNL','sqlcode','1441884ztCGMM','15019917UrMPRn','5QzTtaM','code','26UTAOes','96878UOxFYk','Dataset\x20code\x20(32-char\x20hex\x20UUID)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','string','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)'];a32_0x2d62=function(){return _0x3f5280;};return a32_0x2d62();}const a32_0x515fdb=a32_0x3018;(function(_0x11bce3,_0x325be4){const _0x16f642=a32_0x3018,_0x2a6592=_0x11bce3();while(!![]){try{const _0x69c2b4=-parseInt(_0x16f642(0xad))/0x1*(parseInt(_0x16f642(0xac))/0x2)+parseInt(_0x16f642(0xb6))/0x3+parseInt(_0x16f642(0xba))/0x4*(-parseInt(_0x16f642(0xaa))/0x5)+-parseInt(_0x16f642(0xb8))/0x6+parseInt(_0x16f642(0xb3))/0x7*(parseInt(_0x16f642(0xb2))/0x8)+parseInt(_0x16f642(0xb4))/0x9*(-parseInt(_0x16f642(0xb7))/0xa)+parseInt(_0x16f642(0xbb))/0xb;if(_0x69c2b4===_0x325be4)break;else _0x2a6592['push'](_0x2a6592['shift']());}catch(_0x37e65e){_0x2a6592['push'](_0x2a6592['shift']());}}}(a32_0x2d62,0xc2d8c));export const CODE_FLAG={'name':'code','type':a32_0x515fdb(0xb0),'required':!![],'description':a32_0x515fdb(0xae),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a32_0x515fdb(0xb5)}};export const CODE_FLAG_OPTIONAL={'name':a32_0x515fdb(0xab),'type':'string','required':![],'description':a32_0x515fdb(0xae),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a32_0x515fdb(0xb5)}};export const SQLCODE_FLAG={'name':a32_0x515fdb(0xb9),'type':a32_0x515fdb(0xb0),'required':!![],'description':a32_0x515fdb(0xb1),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const SQLCODE_FLAG_OPTIONAL={'name':'sqlcode','type':a32_0x515fdb(0xb0),'required':![],'description':a32_0x515fdb(0xb1),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a32_0x515fdb(0xaf)}};
1
+ function a31_0x2cb8(){const _0x2a39a4=['2436264DUOsRG','sqlcode','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','string','Dataset\x20code\x20(32-char\x20hex\x20UUID)','18640WlMyxV','15KvnecI','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','8614360zSXmGF','24364cbCocj','508770iuxTdc','108954jdIqcS','119368TnlMPd','20umUmEU','14uPHYMk','code'];a31_0x2cb8=function(){return _0x2a39a4;};return a31_0x2cb8();}const a31_0x3b426b=a31_0xf953;(function(_0x105191,_0x5ecc5c){const _0xb458f4=a31_0xf953,_0x3f7233=_0x105191();while(!![]){try{const _0x567f5f=-parseInt(_0xb458f4(0x17e))/0x1+-parseInt(_0xb458f4(0x184))/0x2*(parseInt(_0xb458f4(0x17f))/0x3)+parseInt(_0xb458f4(0x182))/0x4*(parseInt(_0xb458f4(0x186))/0x5)+-parseInt(_0xb458f4(0x183))/0x6*(parseInt(_0xb458f4(0x187))/0x7)+-parseInt(_0xb458f4(0x185))/0x8+-parseInt(_0xb458f4(0x189))/0x9+parseInt(_0xb458f4(0x181))/0xa;if(_0x567f5f===_0x5ecc5c)break;else _0x3f7233['push'](_0x3f7233['shift']());}catch(_0x24f71a){_0x3f7233['push'](_0x3f7233['shift']());}}}(a31_0x2cb8,0x22130));export const CODE_FLAG={'name':a31_0x3b426b(0x188),'type':a31_0x3b426b(0x18d),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'}};function a31_0xf953(_0x1639f9,_0x4a394f){_0x1639f9=_0x1639f9-0x17d;const _0x2cb8e5=a31_0x2cb8();let _0xf95326=_0x2cb8e5[_0x1639f9];return _0xf95326;}export const CODE_FLAG_OPTIONAL={'name':a31_0x3b426b(0x188),'type':'string','required':![],'description':a31_0x3b426b(0x17d),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a31_0x3b426b(0x180)}};export const SQLCODE_FLAG={'name':a31_0x3b426b(0x18a),'type':a31_0x3b426b(0x18d),'required':!![],'description':a31_0x3b426b(0x18b),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a31_0x3b426b(0x18c)}};export const SQLCODE_FLAG_OPTIONAL={'name':a31_0x3b426b(0x18a),'type':'string','required':![],'description':a31_0x3b426b(0x18b),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a31_0x3b426b(0x18c)}};
@@ -1 +1 @@
1
- const a33_0x55efc0=a33_0x2760;(function(_0x299af9,_0x3d3bef){const _0x13d70a=a33_0x2760,_0x12c001=_0x299af9();while(!![]){try{const _0x26fa3e=-parseInt(_0x13d70a(0x19b))/0x1+-parseInt(_0x13d70a(0x1a3))/0x2*(-parseInt(_0x13d70a(0x19e))/0x3)+-parseInt(_0x13d70a(0x1a2))/0x4+parseInt(_0x13d70a(0x19a))/0x5+parseInt(_0x13d70a(0x19c))/0x6+parseInt(_0x13d70a(0x19d))/0x7+-parseInt(_0x13d70a(0x1a0))/0x8;if(_0x26fa3e===_0x3d3bef)break;else _0x12c001['push'](_0x12c001['shift']());}catch(_0x4392d9){_0x12c001['push'](_0x12c001['shift']());}}}(a33_0x1c0f,0x3c01b));import{jsx as a33_0x33887f}from'react/jsx-runtime';import{render}from'ink';function a33_0x1c0f(){const _0x2aaede=['6045792bsXafu','Manage\x20project\x20configuration','687524qLxslq','186094rapvlB','752770FmThZI','331463eYNsjc','2553552QPiRxk','3244318TwYOQy','15LxsNVc','config'];a33_0x1c0f=function(){return _0x2aaede;};return a33_0x1c0f();}import{Config}from'../config/main.js';function a33_0x2760(_0x19dd74,_0x2be23b){_0x19dd74=_0x19dd74-0x19a;const _0x1c0f24=a33_0x1c0f();let _0x276073=_0x1c0f24[_0x19dd74];return _0x276073;}export const configCommand={'name':'config','description':a33_0x55efc0(0x1a1),async 'run'(_0x46388b,_0x1ac60f,_0x3ab5b2){const _0x1e9d6c=a33_0x55efc0,_0x1ecf07={'input':[_0x1e9d6c(0x19f),..._0x1ac60f],'flags':_0x3ab5b2,'pkg':{},'help':'','updateNotifier':undefined,'showHelp':()=>{},'showVersion':()=>{}};render(a33_0x33887f(Config,{'cli':_0x1ecf07}));}};
1
+ const a32_0x7535c4=a32_0x1e80;function a32_0x36bc(){const _0x194139=['7049207LrqpEt','369035kLEhNY','1796530FYtxch','129157VGINRT','2730807WFZvgn','config','325NRcdZV','Manage\x20project\x20configuration','102WvARHD','716DleZze','8TYVpII','9717SYHIzs','16ypeOJF'];a32_0x36bc=function(){return _0x194139;};return a32_0x36bc();}function a32_0x1e80(_0x248b6d,_0x5b695e){_0x248b6d=_0x248b6d-0xb1;const _0x36bc3d=a32_0x36bc();let _0x1e805c=_0x36bc3d[_0x248b6d];return _0x1e805c;}(function(_0x58db16,_0x13aee4){const _0x317b69=a32_0x1e80,_0x394845=_0x58db16();while(!![]){try{const _0x590942=-parseInt(_0x317b69(0xb5))/0x1*(-parseInt(_0x317b69(0xbb))/0x2)+parseInt(_0x317b69(0xba))/0x3*(-parseInt(_0x317b69(0xb8))/0x4)+parseInt(_0x317b69(0xbd))/0x5+parseInt(_0x317b69(0xb7))/0x6*(-parseInt(_0x317b69(0xb2))/0x7)+-parseInt(_0x317b69(0xb9))/0x8*(-parseInt(_0x317b69(0xb3))/0x9)+parseInt(_0x317b69(0xb1))/0xa+parseInt(_0x317b69(0xbc))/0xb;if(_0x590942===_0x13aee4)break;else _0x394845['push'](_0x394845['shift']());}catch(_0x1c33a9){_0x394845['push'](_0x394845['shift']());}}}(a32_0x36bc,0x4aeb8));import{jsx as a32_0x398017}from'react/jsx-runtime';import{render}from'ink';import{Config}from'../config/main.js';export const configCommand={'name':'config','description':a32_0x7535c4(0xb6),async 'run'(_0x32ebb6,_0x495d82,_0xff0f02){const _0x1587df=a32_0x7535c4,_0x1960f6={'input':[_0x1587df(0xb4),..._0x495d82],'flags':_0xff0f02,'pkg':{},'help':'','updateNotifier':undefined,'showHelp':()=>{},'showVersion':()=>{}};render(a32_0x398017(Config,{'cli':_0x1960f6}));}};
@@ -1 +1 @@
1
- const a34_0x215dc3=a34_0x2fd2;(function(_0x2978bc,_0x2d82a3){const _0x262cc8=a34_0x2fd2,_0x362b57=_0x2978bc();while(!![]){try{const _0x481054=-parseInt(_0x262cc8(0x1f8))/0x1*(parseInt(_0x262cc8(0x1fd))/0x2)+-parseInt(_0x262cc8(0x1eb))/0x3*(-parseInt(_0x262cc8(0x1f4))/0x4)+-parseInt(_0x262cc8(0x1ef))/0x5+parseInt(_0x262cc8(0x1f0))/0x6*(-parseInt(_0x262cc8(0x1f9))/0x7)+-parseInt(_0x262cc8(0x1ff))/0x8*(-parseInt(_0x262cc8(0x1ee))/0x9)+parseInt(_0x262cc8(0x1fe))/0xa+parseInt(_0x262cc8(0x1f5))/0xb*(parseInt(_0x262cc8(0x1e9))/0xc);if(_0x481054===_0x2d82a3)break;else _0x362b57['push'](_0x362b57['shift']());}catch(_0x38e8dd){_0x362b57['push'](_0x362b57['shift']());}}}(a34_0x3a24,0x80ec6));import{jsx as a34_0x1e1d11}from'react/jsx-runtime';function a34_0x3a24(){const _0x2da4a0=['446rEwYsI','5561230caMYCa','110648XRqhPm','auth','180qyfhlz','Create\x20a\x20new\x20project','201UpyKak','cookie','nonInteractive','81HDwnEW','1645505xpXQPX','12Soguit','非交互模式创建项目:\x20','info','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','22476UHrpAW','282975pCbXTb','logger','validation','1699HHsCVl','724157HbcdEo','trim','create','env'];a34_0x3a24=function(){return _0x2da4a0;};return a34_0x3a24();}function a34_0x2fd2(_0x210ce3,_0x267218){_0x210ce3=_0x210ce3-0x1e9;const _0x3a245a=a34_0x3a24();let _0x2fd224=_0x3a245a[_0x210ce3];return _0x2fd224;}import{render}from'ink';import{CreateApp}from'../create-app/main.js';import{CliErrors}from'../errors.js';export const createCommand={'name':'create','description':a34_0x215dc3(0x1ea),async 'run'(_0x115674,_0x44b745,_0x1b6fc3){const _0x1f0d8b=a34_0x215dc3,_0x278622=_0x44b745[0x0]?.[_0x1f0d8b(0x1fa)](),_0x235165=_0x1b6fc3[_0x1f0d8b(0x1fc)];if(_0x115674['nonInteractive']&&_0x278622){_0x115674[_0x1f0d8b(0x1f6)][_0x1f0d8b(0x1f2)](_0x1f0d8b(0x1fb),_0x1f0d8b(0x1f1)+_0x278622);const {createProjectNonInteractive:_0x144a10}=await import('../create-app/non-interactive.js');await _0x144a10(_0x278622,_0x235165);}else{if(_0x115674[_0x1f0d8b(0x1ed)]&&!_0x278622)throw CliErrors[_0x1f0d8b(0x1f7)](_0x1f0d8b(0x1f3),'Usage:\x20rabetbase\x20create\x20<project-name>\x20--ci');else render(a34_0x1e1d11(CreateApp,{'projectCode':_0x278622,'env':_0x235165,'cookie':_0x115674[_0x1f0d8b(0x200)][_0x1f0d8b(0x1ec)]}));}}};
1
+ const a33_0x10c7ba=a33_0x1fbb;(function(_0x378fc7,_0x3ab089){const _0x160ef5=a33_0x1fbb,_0x539cc3=_0x378fc7();while(!![]){try{const _0x4f97eb=-parseInt(_0x160ef5(0x125))/0x1+parseInt(_0x160ef5(0x11a))/0x2*(-parseInt(_0x160ef5(0x115))/0x3)+-parseInt(_0x160ef5(0x126))/0x4*(-parseInt(_0x160ef5(0x11c))/0x5)+parseInt(_0x160ef5(0x119))/0x6*(parseInt(_0x160ef5(0x12a))/0x7)+-parseInt(_0x160ef5(0x11f))/0x8+-parseInt(_0x160ef5(0x11b))/0x9*(-parseInt(_0x160ef5(0x116))/0xa)+-parseInt(_0x160ef5(0x128))/0xb*(-parseInt(_0x160ef5(0x124))/0xc);if(_0x4f97eb===_0x3ab089)break;else _0x539cc3['push'](_0x539cc3['shift']());}catch(_0x28ab6d){_0x539cc3['push'](_0x539cc3['shift']());}}}(a33_0x24ef,0x33dc3));function a33_0x1fbb(_0x46d3ed,_0x26a153){_0x46d3ed=_0x46d3ed-0x114;const _0x24ef86=a33_0x24ef();let _0x1fbbfd=_0x24ef86[_0x46d3ed];return _0x1fbbfd;}import{jsx as a33_0x51ad7b}from'react/jsx-runtime';function a33_0x24ef(){const _0x33716a=['info','logger','60CeOZvw','2006xLbpIb','3604329UTrgmY','2135ldbvea','cookie','../create-app/non-interactive.js','1059216wjeplv','validation','create','trim','Usage:\x20rabetbase\x20create\x20<project-name>\x20--ci','588PlRWeG','385889jXtIlm','44wohJKp','nonInteractive','148071OoiTfA','Create\x20a\x20new\x20project','60340ufqSuP','auth','1257SnKCeN','10KtgRzC'];a33_0x24ef=function(){return _0x33716a;};return a33_0x24ef();}import{render}from'ink';import{CreateApp}from'../create-app/main.js';import{CliErrors}from'../errors.js';export const createCommand={'name':a33_0x10c7ba(0x121),'description':a33_0x10c7ba(0x129),async 'run'(_0x543fc1,_0x3e0ef7,_0x56bde8){const _0x4a93d6=a33_0x10c7ba,_0x290980=_0x3e0ef7[0x0]?.[_0x4a93d6(0x122)](),_0x1db384=_0x56bde8['env'];if(_0x543fc1[_0x4a93d6(0x127)]&&_0x290980){_0x543fc1[_0x4a93d6(0x118)][_0x4a93d6(0x117)](_0x4a93d6(0x121),'非交互模式创建项目:\x20'+_0x290980);const {createProjectNonInteractive:_0x5d8a8a}=await import(_0x4a93d6(0x11e));await _0x5d8a8a(_0x290980,_0x1db384);}else{if(_0x543fc1[_0x4a93d6(0x127)]&&!_0x290980)throw CliErrors[_0x4a93d6(0x120)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x4a93d6(0x123));else render(a33_0x51ad7b(CreateApp,{'projectCode':_0x290980,'env':_0x1db384,'cookie':_0x543fc1[_0x4a93d6(0x114)][_0x4a93d6(0x11d)]}));}}};