@lovrabet/rabetbase-cli 2.0.10 → 2.0.12
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.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +1 -1
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x584327=a19_0x31cf;function a19_0x31cf(_0x1d8f3d,_0x598abf){_0x1d8f3d=_0x1d8f3d-0x1be;const _0x56fb4c=a19_0x56fb();let _0x31cf5b=_0x56fb4c[_0x1d8f3d];return _0x31cf5b;}(function(_0x27227a,_0x37a425){const _0x136875=a19_0x31cf,_0x31e9b3=_0x27227a();while(!![]){try{const _0x2fe3eb=parseInt(_0x136875(0x1c6))/0x1+parseInt(_0x136875(0x1cd))/0x2+-parseInt(_0x136875(0x1db))/0x3+-parseInt(_0x136875(0x1cc))/0x4*(parseInt(_0x136875(0x1c5))/0x5)+parseInt(_0x136875(0x1d6))/0x6*(-parseInt(_0x136875(0x1c1))/0x7)+-parseInt(_0x136875(0x1be))/0x8+-parseInt(_0x136875(0x1c9))/0x9*(-parseInt(_0x136875(0x1c0))/0xa);if(_0x2fe3eb===_0x37a425)break;else _0x31e9b3['push'](_0x31e9b3['shift']());}catch(_0x4c5ad8){_0x31e9b3['push'](_0x31e9b3['shift']());}}}(a19_0x56fb,0xc1795));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';async function execute(_0x643cb8){const _0x12949b=a19_0x31cf,{config:_0x415043,layers:_0x505158}=readRawConfigWithLayers(),{apps:apps={},defaultApp:_0x1f094b,currentApp:_0x85fdcb}=_0x415043,_0x3ca4a2=Object[_0x12949b(0x1dd)](apps),_0x37bda7=_0x505158[_0x12949b(0x1cf)][_0x12949b(0x1cb)]&&typeof _0x505158[_0x12949b(0x1cf)][_0x12949b(0x1cb)]===_0x12949b(0x1ca)?_0x505158[_0x12949b(0x1cf)][_0x12949b(0x1cb)]:{},_0x1e787f=_0x505158[_0x12949b(0x1d8)][_0x12949b(0x1cb)]&&typeof _0x505158[_0x12949b(0x1d8)][_0x12949b(0x1cb)]===_0x12949b(0x1ca)?_0x505158[_0x12949b(0x1d8)]['apps']:{};if(_0x3ca4a2[_0x12949b(0x1c7)]===0x0){const _0x1e1b58=_0x415043[_0x12949b(0x1d5)];if(_0x1e1b58)return{'ok':!![],'data':{'mode':_0x12949b(0x1dc),'appcode':_0x1e1b58,'env':_0x415043['env']},'message':'Single-app\x20mode.\x20Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.'};return{'ok':!![],'data':[],'message':_0x12949b(0x1d2)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x3bc171=resolveDefaultAppSource(_0x505158),_0x1b1b2c=_0x505158['projectConfig'][_0x12949b(0x1d4)]===![],_0x14f96d=_0x3ca4a2[_0x12949b(0x1c4)](([_0x27980c,_0x45ac09])=>({'name':_0x27980c,'appcode':_0x45ac09['appcode'],'definedIn':appDefinedIn(_0x27980c,_0x37bda7,_0x1e787f,_0x1b1b2c),'isDefault':_0x27980c===_0x1f094b,'isCurrent':_0x27980c===(_0x85fdcb??_0x1f094b),'env':_0x45ac09[_0x12949b(0x1d7)]??null,'apiDir':_0x45ac09[_0x12949b(0x1de)]??null,'hasCookie':!!_0x45ac09[_0x12949b(0x1bf)],'hasAccessKey':!!_0x45ac09[_0x12949b(0x1c3)],'format':_0x45ac09[_0x12949b(0x1ce)]??null,'pageSize':_0x45ac09[_0x12949b(0x1d0)]??null,'riskLevel':_0x45ac09['riskLevel']??null,'locale':_0x45ac09[_0x12949b(0x1d3)]??null}));return{'ok':!![],'data':{'items':_0x14f96d,'meta':{'globalPath':_0x505158[_0x12949b(0x1c8)]??null,'projectPath':_0x505158['projectPath']??null,'defaultApp':_0x1f094b??null,'defaultAppSource':_0x1f094b!=null?_0x3bc171:null}}};}export const appListDefinition={'service':a19_0x584327(0x1d9),'command':a19_0x584327(0x1d1),'description':a19_0x584327(0x1c2),'risk':a19_0x584327(0x1da),'requiresAuth':![],'requiresAppCode':![],'flags':[],'execute':execute};function a19_0x56fb(){const _0x45356b=['419316ZlGsEr','format','globalConfig','pageSize','list','No\x20apps\x20configured.\x20Use\x20`','locale','inherit','appcode','122712gCltNq','env','projectConfig','app','read','4675890ndoGad','single-app','entries','apiDir','8461816TBevqP','cookie','17481790LmUnQh','119UQtDmM','List\x20all\x20configured\x20apps','accessKey','map','760570dgPDEt','202608HEfoXl','length','globalPath','18pQnrgl','object','apps','4krztcw'];a19_0x56fb=function(){return _0x45356b;};return a19_0x56fb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a20_0x5edc7c=a20_0x9ff5;(function(_0x2f4cbd,_0x4227b2){const _0x33e7c7=a20_0x9ff5,_0x236512=_0x2f4cbd();while(!![]){try{const _0x6adcbe=parseInt(_0x33e7c7(0xe9))/0x1+-parseInt(_0x33e7c7(0xe7))/0x2*(-parseInt(_0x33e7c7(0xf7))/0x3)+-parseInt(_0x33e7c7(0xef))/0x4*(parseInt(_0x33e7c7(0xf2))/0x5)+parseInt(_0x33e7c7(0xea))/0x6+parseInt(_0x33e7c7(0xeb))/0x7*(-parseInt(_0x33e7c7(0xf0))/0x8)+parseInt(_0x33e7c7(0xf6))/0x9*(parseInt(_0x33e7c7(0xf5))/0xa)+parseInt(_0x33e7c7(0xee))/0xb;if(_0x6adcbe===_0x4227b2)break;else _0x236512['push'](_0x236512['shift']());}catch(_0x5aba6a){_0x236512['push'](_0x236512['shift']());}}}(a20_0x50a9,0xd18da));function a20_0x50a9(){const _0x28ee47=['app','8418278pioyGa','56aHqBOW','12746480tYvLtg','read','596495txKnWs','appDesc','../../core/api-client.js','10yOTqjG','9467613bfbEYC','3fUdvRB','appCode','map','3218638zNNlMW','cookie','620044pWFDGq','451248TKsHBD','7IMJxXR','appName'];a20_0x50a9=function(){return _0x28ee47;};return a20_0x50a9();}function a20_0x9ff5(_0x19fbb6,_0x49c038){_0x19fbb6=_0x19fbb6-0xe7;const _0x50a910=a20_0x50a9();let _0x9ff5df=_0x50a910[_0x19fbb6];return _0x9ff5df;}import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x17aa8a){const _0x4aea53=a20_0x9ff5,{setActiveCookie:_0x5b242f}=await import(_0x4aea53(0xf4));_0x5b242f(_0x17aa8a[_0x4aea53(0xe8)]);const _0x5f076f=await listRemoteApps(),_0x21e3ba=_0x5f076f[_0x4aea53(0xf9)](_0x5468=>({..._0x5468['id']!=null?{'id':_0x5468['id']}:{},'appCode':_0x5468[_0x4aea53(0xf8)],'appName':_0x5468[_0x4aea53(0xec)],..._0x5468[_0x4aea53(0xf3)]!=null?{'appDesc':_0x5468[_0x4aea53(0xf3)]}:{}}));return{'ok':!![],'data':_0x21e3ba};}export const appRemoteDefinition={'service':a20_0x5edc7c(0xed),'command':'remote','description':'List\x20apps\x20available\x20on\x20the\x20platform','risk':a20_0x5edc7c(0xf1),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a21_0x5d53(_0x106b84,_0x5493d1){_0x106b84=_0x106b84-0x144;const _0x3e34bc=a21_0x3e34();let _0x5d5319=_0x3e34bc[_0x106b84];return _0x5d5319;}const a21_0x29adaa=a21_0x5d53;(function(_0x165b89,_0x2d351a){const _0x161d3e=a21_0x5d53,_0x5c2a7c=_0x165b89();while(!![]){try{const _0x1f284f=-parseInt(_0x161d3e(0x156))/0x1*(-parseInt(_0x161d3e(0x160))/0x2)+parseInt(_0x161d3e(0x15c))/0x3*(-parseInt(_0x161d3e(0x149))/0x4)+-parseInt(_0x161d3e(0x166))/0x5+parseInt(_0x161d3e(0x164))/0x6*(-parseInt(_0x161d3e(0x14b))/0x7)+-parseInt(_0x161d3e(0x145))/0x8+-parseInt(_0x161d3e(0x15f))/0x9+-parseInt(_0x161d3e(0x14c))/0xa*(-parseInt(_0x161d3e(0x161))/0xb);if(_0x1f284f===_0x2d351a)break;else _0x5c2a7c['push'](_0x5c2a7c['shift']());}catch(_0x50dd52){_0x5c2a7c['push'](_0x5c2a7c['shift']());}}}(a21_0x3e34,0x85ecf));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a21_0x3e34(){const _0x407322=['\x22\x20not\x20found.','remove','1221642kZCmiJ','10RmjDvZ','935FLZOkR','high-risk-write','defaultApp','12fjprSY','both','3506175BYsCJr','object','app','projectConfig','5256400qHmWlU','bool','App\x20\x22','\x20config.','840vvyvAL','project','3288068aVEdNA','336170cmxsYo','boolean','keys','name','\x22\x20still\x20defined\x20in\x20','\x20app\x20remove\x20<name>\x20[--global]','Usage:\x20','validation','length','apps','31427vCqimP','globalConfig','global','App\x20profile\x20name\x20to\x20remove','Missing\x20app\x20name.','trim','465MUHfUg'];a21_0x3e34=function(){return _0x407322;};return a21_0x3e34();}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x4f7c08){const _0x41f8c2=a21_0x5d53,_0x21fe53=_0x4f7c08['args'][0x0]?.[_0x41f8c2(0x15b)]();if(!_0x21fe53)throw CliErrors[_0x41f8c2(0x153)](_0x41f8c2(0x15a),_0x41f8c2(0x152)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');}async function execute(_0x1be940){const _0x17e4b3=a21_0x5d53,_0x362f65=_0x1be940['args'][0x0]?.['trim']();if(!_0x362f65)throw CliErrors[_0x17e4b3(0x153)](_0x17e4b3(0x15a),_0x17e4b3(0x152)+CLI_BIN_NAME+_0x17e4b3(0x151));const _0x5f23b9=_0x1be940[_0x17e4b3(0x146)](_0x17e4b3(0x158)),{config:_0x4c7f59,layers:_0x2aa680}=readRawConfigWithLayers(),_0x39c579=_0x4c7f59['apps']??{};if(!_0x39c579[_0x362f65])throw CliErrors[_0x17e4b3(0x153)](_0x17e4b3(0x147)+_0x362f65+_0x17e4b3(0x15d));const _0x50718c=_0x2aa680[_0x17e4b3(0x157)]['apps']&&typeof _0x2aa680[_0x17e4b3(0x157)]['apps']===_0x17e4b3(0x167)?_0x2aa680['globalConfig'][_0x17e4b3(0x155)]:{},_0x4abb79=_0x2aa680[_0x17e4b3(0x144)][_0x17e4b3(0x155)]&&typeof _0x2aa680[_0x17e4b3(0x144)][_0x17e4b3(0x155)]===_0x17e4b3(0x167)?_0x2aa680['projectConfig'][_0x17e4b3(0x155)]:{},_0x722df7=appDefinedIn(_0x362f65,_0x50718c,_0x4abb79,_0x2aa680[_0x17e4b3(0x144)]['inherit']===![]),_0x23c566=resolveAppScopeForWrite(_0x362f65,_0x5f23b9,_0x2aa680),_0xbe12a2={'global':_0x23c566===_0x17e4b3(0x158)},_0x5a0dfb=readConfig(_0xbe12a2),_0x21de3a=_0x5a0dfb['apps'];if(!_0x21de3a||!_0x21de3a[_0x362f65])throw CliErrors[_0x17e4b3(0x153)]('App\x20\x22'+_0x362f65+'\x22\x20not\x20found.');delete _0x21de3a[_0x362f65];let _0x2a60d8='';if(_0x5a0dfb['defaultApp']===_0x362f65){const _0x2f817e=Object[_0x17e4b3(0x14e)](_0x21de3a);_0x5a0dfb[_0x17e4b3(0x163)]=_0x2f817e[_0x17e4b3(0x154)]>0x0?_0x2f817e[0x0]:undefined,_0x5a0dfb['defaultApp']?_0x2a60d8='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x5a0dfb[_0x17e4b3(0x163)]+'\x22.':delete _0x5a0dfb['defaultApp'];}Object['keys'](_0x21de3a)[_0x17e4b3(0x154)]===0x0&&(delete _0x5a0dfb['apps'],delete _0x5a0dfb[_0x17e4b3(0x163)]);writeConfig(_0x5a0dfb,_0xbe12a2);const _0x1cd23c=_0x722df7===_0x17e4b3(0x165)?'\x20Note:\x20app\x20\x22'+_0x362f65+_0x17e4b3(0x150)+(_0x23c566==='project'?_0x17e4b3(0x158):_0x17e4b3(0x14a))+_0x17e4b3(0x148):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x362f65+'\x22'+scopeLabel(_0xbe12a2)+'.'+_0x2a60d8+_0x1cd23c};}export const appRemoveDefinition={'service':a21_0x29adaa(0x168),'command':a21_0x29adaa(0x15e),'description':'Remove\x20an\x20app\x20from\x20config','risk':a21_0x29adaa(0x162),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x29adaa(0x14f),'description':a21_0x29adaa(0x159),'required':!![]}],'flags':[{'name':a21_0x29adaa(0x158),'type':a21_0x29adaa(0x14d),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1569e7,_0x3b8279){const _0x3aadd2=a22_0x4ed5,_0x113f7b=_0x1569e7();while(!![]){try{const _0x159287=parseInt(_0x3aadd2(0x183))/0x1+-parseInt(_0x3aadd2(0x164))/0x2+parseInt(_0x3aadd2(0x170))/0x3+-parseInt(_0x3aadd2(0x16d))/0x4+-parseInt(_0x3aadd2(0x182))/0x5*(parseInt(_0x3aadd2(0x175))/0x6)+parseInt(_0x3aadd2(0x165))/0x7*(parseInt(_0x3aadd2(0x179))/0x8)+parseInt(_0x3aadd2(0x181))/0x9*(parseInt(_0x3aadd2(0x16a))/0xa);if(_0x159287===_0x3b8279)break;else _0x113f7b['push'](_0x113f7b['shift']());}catch(_0x1a56bb){_0x113f7b['push'](_0x113f7b['shift']());}}}(a22_0xc374,0xccc4d));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a22_0x4ed5(_0x2296d3,_0x409e55){_0x2296d3=_0x2296d3-0x164;const _0xc37476=a22_0xc374();let _0x4ed508=_0xc37476[_0x2296d3];return _0x4ed508;}export function resolveAppScopeForWrite(_0x42e208,_0x317c4a,_0x49fb3e){const _0x9cd761=a22_0x4ed5;if(_0x317c4a)return _0x9cd761(0x17b);const _0x5d7d82=_0x49fb3e['projectConfig']['apps']&&typeof _0x49fb3e[_0x9cd761(0x166)][_0x9cd761(0x16f)]==='object'?_0x49fb3e['projectConfig']['apps']:{},_0x3e5062=_0x49fb3e[_0x9cd761(0x17e)][_0x9cd761(0x16f)]&&typeof _0x49fb3e[_0x9cd761(0x17e)][_0x9cd761(0x16f)]===_0x9cd761(0x185)?_0x49fb3e['globalConfig'][_0x9cd761(0x16f)]:{};if(Object[_0x9cd761(0x17c)]['hasOwnProperty'][_0x9cd761(0x16c)](_0x5d7d82,_0x42e208))return _0x9cd761(0x177);if(Object[_0x9cd761(0x17c)][_0x9cd761(0x169)][_0x9cd761(0x16c)](_0x3e5062,_0x42e208))return _0x9cd761(0x17b);return _0x9cd761(0x177);}export function appDefinedIn(_0x370492,_0x598c98,_0x109dbc,_0x28760c){const _0x4ac21e=a22_0x4ed5;if(_0x28760c)return Object[_0x4ac21e(0x17c)][_0x4ac21e(0x169)]['call'](_0x109dbc,_0x370492)?'project':'global';const _0x391976=Object['prototype'][_0x4ac21e(0x169)]['call'](_0x598c98,_0x370492),_0x5a2842=Object['prototype'][_0x4ac21e(0x169)][_0x4ac21e(0x16c)](_0x109dbc,_0x370492);if(_0x391976&&_0x5a2842)return'both';if(_0x5a2842)return _0x4ac21e(0x177);return _0x4ac21e(0x17b);}export function resolveDefaultAppSource(_0x48c89d){const _0x579c4e=a22_0x4ed5,_0x196b25=_0x48c89d[_0x579c4e(0x166)][_0x579c4e(0x16f)]&&typeof _0x48c89d[_0x579c4e(0x166)][_0x579c4e(0x16f)]==='object'?_0x48c89d[_0x579c4e(0x166)][_0x579c4e(0x16f)]:{};if('defaultApp'in _0x48c89d['projectConfig'])return _0x579c4e(0x177);if(Object[_0x579c4e(0x168)](_0x196b25)['length']>0x0)return _0x579c4e(0x177);if(_0x48c89d['projectConfig'][_0x579c4e(0x17d)]===![])return null;if(_0x48c89d[_0x579c4e(0x17e)][_0x579c4e(0x180)])return _0x579c4e(0x17b);return null;}function a22_0xc374(){const _0x5038af=['riskLevel','keys','hasOwnProperty','10lseLsO','app','call','912048obaiwx','\x20(global)','apps','673425GlkcKr','log','cookie','format','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','6345114qdgkdb','locale','project','appcode','8IrLlro','Migrated\x20existing\x20app\x20\x22','global','prototype','inherit','globalConfig','accessKey','defaultApp','15308847bONwgm','5SUBhqJ','431634oXmRDh','env','object','1900868vdaqOd','5023242kzdrmz','projectConfig'];a22_0xc374=function(){return _0x5038af;};return a22_0xc374();}export function getConfigPath(_0x12ae43={}){const _0x32471c=a22_0x4ed5,_0x35fa6c=_0x12ae43['global']?_0x32471c(0x17b):'project';return resolveWriteConfigPath(_0x35fa6c);}export function readConfig(_0x49d4ba={}){return readConfigFile(getConfigPath(_0x49d4ba));}export function writeConfig(_0x2e04f8,_0x3cf2bb={}){writeConfigFile(getConfigPath(_0x3cf2bb),_0x2e04f8);}export function scopeLabel(_0x444a61){const _0x273ee9=a22_0x4ed5;return _0x444a61['global']?_0x273ee9(0x16e):'';}export function migrateLegacySingleApp(_0x538da2,_0x344159){const _0x2ddb4d=a22_0x4ed5,_0x17a7cf=_0x538da2[_0x2ddb4d(0x178)]||_0x538da2[_0x2ddb4d(0x16b)];if(!_0x17a7cf)return;const _0x5db0c7=String(_0x17a7cf);if(_0x5db0c7===_0x344159)return;const _0x3fc64f=[_0x2ddb4d(0x184),'apiDir',_0x2ddb4d(0x172),_0x2ddb4d(0x17f),_0x2ddb4d(0x173),'pageSize',_0x2ddb4d(0x167),_0x2ddb4d(0x176)],_0x2c445c={'appcode':_0x17a7cf};for(const _0x4544f4 of _0x3fc64f){if(_0x538da2[_0x4544f4]!=null)_0x2c445c[_0x4544f4]=_0x538da2[_0x4544f4];}_0x538da2[_0x2ddb4d(0x16f)][_0x5db0c7]=_0x2c445c,_0x538da2[_0x2ddb4d(0x180)]=_0x5db0c7,delete _0x538da2['appcode'],delete _0x538da2[_0x2ddb4d(0x16b)],console[_0x2ddb4d(0x171)](_0x2ddb4d(0x17a)+_0x5db0c7+_0x2ddb4d(0x174));}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x9ecebc=a23_0x44db;(function(_0x2c8495,_0x14a14f){const _0x543ddd=a23_0x44db,_0x36ddf4=_0x2c8495();while(!![]){try{const _0x4de1f0=parseInt(_0x543ddd(0x14c))/0x1*(-parseInt(_0x543ddd(0x148))/0x2)+-parseInt(_0x543ddd(0x14f))/0x3+-parseInt(_0x543ddd(0x161))/0x4+parseInt(_0x543ddd(0x157))/0x5*(-parseInt(_0x543ddd(0x15f))/0x6)+-parseInt(_0x543ddd(0x146))/0x7*(-parseInt(_0x543ddd(0x14e))/0x8)+-parseInt(_0x543ddd(0x154))/0x9*(-parseInt(_0x543ddd(0x14a))/0xa)+parseInt(_0x543ddd(0x158))/0xb*(parseInt(_0x543ddd(0x159))/0xc);if(_0x4de1f0===_0x14a14f)break;else _0x36ddf4['push'](_0x36ddf4['shift']());}catch(_0x5a877f){_0x36ddf4['push'](_0x36ddf4['shift']());}}}(a23_0x442b,0x73791));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';function a23_0x44db(_0x2176ad,_0x1b4b99){_0x2176ad=_0x2176ad-0x146;const _0x442b10=a23_0x442b();let _0x44dbfb=_0x442b10[_0x2176ad];return _0x44dbfb;}function a23_0x442b(){const _0x122cc9=['\x20app\x20use\x20<name>\x20[--global]','boolean','6HqtJuP','Default\x20app\x20set\x20to\x20\x22','2977760wSrPrX','Use\x20`','write','Use\x20global\x20config\x20scope','7kOysYg','validation','2gVdiKa','keys','16090AAirLZ','Usage:\x20','584053cNiGQe','trim','2881048BjmlgG','2056542ATyKoK','\x20app\x20add\x20','\x22\x20not\x20found.','global','Missing\x20app\x20name.','1773JqUgEY','name','join','3611375gbFgyn','5570741rEZgTo','60JPGXay','args','\x22\x20(appcode:\x20','Switch\x20the\x20default\x20app'];a23_0x442b=function(){return _0x122cc9;};return a23_0x442b();}async function validateArgs(_0x13ab7e){const _0x4255dd=a23_0x44db,_0x448ee1=_0x13ab7e[_0x4255dd(0x15a)][0x0]?.[_0x4255dd(0x14d)]();if(!_0x448ee1)throw CliErrors[_0x4255dd(0x147)](_0x4255dd(0x153),_0x4255dd(0x14b)+CLI_BIN_NAME+_0x4255dd(0x15d));}async function execute(_0xb5d013){const _0x3e3199=a23_0x44db,_0x57a3cf=_0xb5d013[_0x3e3199(0x15a)][0x0]?.[_0x3e3199(0x14d)]();if(!_0x57a3cf)throw CliErrors[_0x3e3199(0x147)](_0x3e3199(0x153),_0x3e3199(0x14b)+CLI_BIN_NAME+_0x3e3199(0x15d));const _0x3ff64f=_0xb5d013['bool'](_0x3e3199(0x152)),{config:_0x1a66b6,layers:_0x5b07fa}=readRawConfigWithLayers(),_0x340e16=_0x1a66b6['apps']??{};if(!_0x340e16[_0x57a3cf]){const _0x44239b=Object[_0x3e3199(0x149)](_0x340e16),_0x4bfc51=_0x44239b['length']===0x0?_0x3e3199(0x162)+CLI_BIN_NAME+_0x3e3199(0x150)+_0x57a3cf+'\x20--appcode\x20<code>`\x20first.':'Available:\x20'+_0x44239b[_0x3e3199(0x156)](',\x20');throw CliErrors[_0x3e3199(0x147)]('App\x20\x22'+_0x57a3cf+_0x3e3199(0x151),_0x4bfc51);}const _0x13bc57=resolveAppScopeForWrite(_0x57a3cf,_0x3ff64f,_0x5b07fa),_0x2dfa54={'global':_0x13bc57==='global'},_0x1312b1=readConfig(_0x2dfa54);return _0x1312b1['defaultApp']=_0x57a3cf,writeConfig(_0x1312b1,_0x2dfa54),{'ok':!![],'message':_0x3e3199(0x160)+_0x57a3cf+_0x3e3199(0x15b)+_0x340e16[_0x57a3cf]['appcode']+')'+scopeLabel(_0x2dfa54)};}export const appUseDefinition={'service':'app','command':'use','description':a23_0x9ecebc(0x15c),'risk':a23_0x9ecebc(0x163),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x9ecebc(0x155),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':a23_0x9ecebc(0x152),'type':a23_0x9ecebc(0x15e),'description':a23_0x9ecebc(0x164),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x465b(_0x5469fe,_0x1eba55){_0x5469fe=_0x5469fe-0x17a;const _0x455940=a24_0x4559();let _0x465b6a=_0x455940[_0x5469fe];return _0x465b6a;}const a24_0x2e19a3=a24_0x465b;function a24_0x4559(){const _0x461e53=['!\x20Not\x20logged\x20in','../../auth/auth-server-ui.js','5914770akqHgV','write','4BifTgm','logout','643139rDUqIg','1648816lbTJud','922860dwenRy','log','login','4107992TqDniM','794078eHIdAw','✓\x20Logged\x20out','read','322488YtlFaJ','Login\x20via\x20browser','Clear\x20login\x20session'];a24_0x4559=function(){return _0x461e53;};return a24_0x4559();}(function(_0xd4b9f6,_0x598339){const _0x4bbe22=a24_0x465b,_0x2f64e9=_0xd4b9f6();while(!![]){try{const _0x467528=parseInt(_0x4bbe22(0x189))/0x1+-parseInt(_0x4bbe22(0x17d))/0x2+parseInt(_0x4bbe22(0x180))/0x3*(-parseInt(_0x4bbe22(0x187))/0x4)+parseInt(_0x4bbe22(0x18b))/0x5+parseInt(_0x4bbe22(0x185))/0x6+-parseInt(_0x4bbe22(0x17c))/0x7+-parseInt(_0x4bbe22(0x18a))/0x8;if(_0x467528===_0x598339)break;else _0x2f64e9['push'](_0x2f64e9['shift']());}catch(_0x190090){_0x2f64e9['push'](_0x2f64e9['shift']());}}}(a24_0x4559,0x7dfad));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a24_0x2e19a3(0x17b),'description':a24_0x2e19a3(0x181),'risk':a24_0x2e19a3(0x17f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x13b04b){const _0x30e9cf=a24_0x2e19a3,{runAuthServer:_0x578223}=await import(_0x30e9cf(0x184));return await _0x578223(),{'ok':!![]};}},{'service':'auth','command':a24_0x2e19a3(0x188),'description':a24_0x2e19a3(0x182),'risk':a24_0x2e19a3(0x186),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x590ae8){const _0x3ca524=a24_0x2e19a3;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x3ca524(0x17a)](_0x3ca524(0x17e))):console['log'](_0x3ca524(0x183)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x349a86=a25_0x2f79;function a25_0x2f79(_0x12e3a1,_0x57d200){_0x12e3a1=_0x12e3a1-0x66;const _0x25e04f=a25_0x25e0();let _0x2f7962=_0x25e04f[_0x12e3a1];return _0x2f7962;}(function(_0x2e01e6,_0xbda4b3){const _0x3501d5=a25_0x2f79,_0x47d12b=_0x2e01e6();while(!![]){try{const _0x319314=parseInt(_0x3501d5(0x6a))/0x1+parseInt(_0x3501d5(0x67))/0x2+-parseInt(_0x3501d5(0x7e))/0x3+-parseInt(_0x3501d5(0x88))/0x4+parseInt(_0x3501d5(0x6d))/0x5+-parseInt(_0x3501d5(0x90))/0x6*(parseInt(_0x3501d5(0x81))/0x7)+-parseInt(_0x3501d5(0x85))/0x8*(-parseInt(_0x3501d5(0x84))/0x9);if(_0x319314===_0xbda4b3)break;else _0x47d12b['push'](_0x47d12b['shift']());}catch(_0x45aed2){_0x47d12b['push'](_0x47d12b['shift']());}}}(a25_0x25e0,0xda0c0));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':'bff','command':a25_0x349a86(0x6b),'description':a25_0x349a86(0x6f),'risk':a25_0x349a86(0x6c),'flags':[{'name':a25_0x349a86(0x78),'type':a25_0x349a86(0x69),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x438145){const _0x4fe5=a25_0x349a86,_0x49d67d=loadBffProjectConfig(_0x438145['appCode']),_0x58c683=await readBffLockFile(_0x49d67d[_0x4fe5(0x76)]);if(!_0x58c683)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x5721bf){const _0x5b6c4e=a25_0x349a86,_0x43ff72=loadBffProjectConfig(_0x5721bf[_0x5b6c4e(0x6e)]),_0x200619=await readBffLockFile(_0x43ff72[_0x5b6c4e(0x76)]);if(!_0x200619)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x36f1cd}=ensureLockScope(_0x200619,_0x5721bf[_0x5b6c4e(0x6e)],_0x43ff72[_0x5b6c4e(0x7c)],_0x5b6c4e(0x6b)),_0x36c3d1=_0x5721bf['str'](_0x5b6c4e(0x78)),_0x10cc86=Object['keys'](_0x36f1cd[_0x5b6c4e(0x87)]),_0x37e2d0=resolveDeleteTarget(_0x36c3d1,_0x10cc86),_0x26ebf7=_0x36f1cd['functions'][_0x37e2d0];if(!_0x26ebf7)throw CliErrors[_0x5b6c4e(0x70)](_0x5b6c4e(0x7a)+_0x37e2d0+'\x22.');const _0x20952d=resolveLocalFilePathFromLockKey(_0x43ff72,_0x37e2d0),_0x289e63=relative(_0x43ff72[_0x5b6c4e(0x77)],_0x20952d),_0x470390=join(_0x43ff72[_0x5b6c4e(0x79)],_0x5b6c4e(0x8a),_0x289e63);return{'method':_0x5b6c4e(0x7d),'url':_0x5b6c4e(0x8f),'body':{'appCode':_0x5721bf[_0x5b6c4e(0x6e)],'target':_0x37e2d0,'remoteId':_0x26ebf7[_0x5b6c4e(0x8c)],'localFilePath':_0x20952d,'trashedPath':_0x470390},'description':_0x5b6c4e(0x75)+_0x37e2d0+_0x5b6c4e(0x68)};},async 'execute'(_0x5777bd){const _0x1b9478=a25_0x349a86,_0x49d384=loadBffProjectConfig(_0x5777bd[_0x1b9478(0x6e)]),_0x97fe84=await readBffLockFile(_0x49d384[_0x1b9478(0x76)]);if(!_0x97fe84)throw CliErrors[_0x1b9478(0x70)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x410bae,appLock:_0x115a53}=ensureLockScope(_0x97fe84,_0x5777bd['appCode'],_0x49d384[_0x1b9478(0x7c)],_0x1b9478(0x6b)),_0x700ee3=_0x5777bd[_0x1b9478(0x83)]('target'),_0x112e48=Object['keys'](_0x115a53[_0x1b9478(0x87)]),_0x12f101=resolveDeleteTarget(_0x700ee3,_0x112e48),_0x1a635b=_0x115a53[_0x1b9478(0x87)][_0x12f101];if(!_0x1a635b)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x12f101+'\x22.');await deleteBffScript(_0x1a635b[_0x1b9478(0x8c)]),delete _0x115a53[_0x1b9478(0x87)][_0x12f101],_0x115a53[_0x1b9478(0x73)]=new Date()[_0x1b9478(0x71)](),await writeBffLockFile(_0x49d384['lockFilePath'],_0x410bae);const _0x2235b4=resolveLocalFilePathFromLockKey(_0x49d384,_0x12f101);let _0x4b88df;await fileExists(_0x2235b4)&&(_0x4b88df=await moveToTrash(_0x49d384[_0x1b9478(0x77)],_0x49d384[_0x1b9478(0x79)],_0x2235b4),await cleanupEmptyDirectories(dirname(_0x2235b4),_0x49d384['scriptsRootDir']));const _0x32f646={'deleted':_0x12f101,'remoteId':_0x1a635b['remoteId']};if(_0x4b88df)_0x32f646['trashedTo']=_0x4b88df;return{'ok':!![],'data':_0x32f646,'message':_0x1b9478(0x7b)+_0x12f101+(_0x4b88df?_0x1b9478(0x82):'')};}};function resolveDeleteTarget(_0x4b1c27,_0x56c44a){const _0xc79193=a25_0x349a86;if(_0x4b1c27['includes']('/')){const _0x4048a3=_0x56c44a[_0xc79193(0x8e)](_0x15030d=>_0x15030d===_0x4b1c27);if(!_0x4048a3)throw CliErrors['validation'](_0xc79193(0x86)+_0x4b1c27);return _0x4048a3;}const _0x2d5a08=_0x56c44a[_0xc79193(0x74)](_0x4dcf3e=>_0x4dcf3e[_0xc79193(0x89)]('/')['at'](-0x1)===_0x4b1c27);if(_0x2d5a08[_0xc79193(0x66)]===0x0)throw CliErrors['validation'](_0xc79193(0x86)+_0x4b1c27);if(_0x2d5a08[_0xc79193(0x66)]>0x1)throw CliErrors[_0xc79193(0x70)]('Multiple\x20functions\x20match\x20\x22'+_0x4b1c27+_0xc79193(0x8b)+_0x2d5a08[_0xc79193(0x8d)](_0x438040=>_0xc79193(0x72)+_0x438040)[_0xc79193(0x80)]('\x0a'));return _0x2d5a08[0x0];}async function moveToTrash(_0x1c8a00,_0x1210a3,_0x419d57){const _0x5d68b4=a25_0x349a86,_0x3b636a=new Date()[_0x5d68b4(0x71)]()[_0x5d68b4(0x7f)](/[:.]/g,'-'),_0x503aa2=relative(_0x1c8a00,_0x419d57),_0x3f7f58=join(_0x1210a3,_0x3b636a,_0x503aa2);return await mkdir(dirname(_0x3f7f58),{'recursive':!![]}),await rename(_0x419d57,_0x3f7f58),_0x3f7f58;}async function cleanupEmptyDirectories(_0x315740,_0x402ba1){const _0x1025a6=a25_0x349a86;let _0x19cebb=resolve(_0x315740);const _0x50d338=resolve(_0x402ba1);while(_0x19cebb['startsWith'](''+_0x50d338+sep)||_0x19cebb===_0x50d338){if(_0x19cebb===_0x50d338)return;try{const _0x52668e=await readdir(_0x19cebb);if(_0x52668e[_0x1025a6(0x66)]>0x0)return;await rmdir(_0x19cebb);}catch{return;}_0x19cebb=dirname(_0x19cebb);}}function a25_0x25e0(){const _0x351868=['target','trashDir','No\x20lock\x20entry\x20found\x20for\x20\x22','Deleted\x20','scriptsRoot','POST','2592402RbFAbD','replace','join','2804557WjVSHa','\x20(local\x20file\x20moved\x20to\x20trash)','str','27TZsaGb','536528QNQnYG','Function\x20not\x20found:\x20','functions','2042860IRuehf','split','<timestamp>','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','remoteId','map','find','/api/management/library/scripts/delete','18zHGEVe','length','1708938TpgMms','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','string','1674022ZrwNfw','delete','high-risk-write','3701165sHESyq','appCode','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','validation','toISOString','\x20\x20-\x20','lastSync','filter','Would\x20delete\x20','lockFilePath','projectRoot'];a25_0x25e0=function(){return _0x351868;};return a25_0x25e0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x576da2=a26_0x413d;function a26_0x1ece(){const _0x2883c6=['3968GRTGLY','bff','num','33HfwXKx','updatedTime','appCode','Get\x20BFF\x20script\x20details\x20by\x20ID','number','scriptType','read','(none)','verbose','509265hoxmmJ','1967220ymMjVv','100542ooGKFf','66FfahTW','644mmStbK','317508qQCpRw','93hzrYJB','detail','Script\x20ID','bool','611442jJIctO','2764472HCpJZu','description','boolean'];a26_0x1ece=function(){return _0x2883c6;};return a26_0x1ece();}(function(_0x3f5ed2,_0x24b5fc){const _0x2775bd=a26_0x413d,_0x8de353=_0x3f5ed2();while(!![]){try{const _0x345dfb=parseInt(_0x2775bd(0x173))/0x1+parseInt(_0x2775bd(0x170))/0x2*(parseInt(_0x2775bd(0x174))/0x3)+parseInt(_0x2775bd(0x179))/0x4+parseInt(_0x2775bd(0x16e))/0x5*(-parseInt(_0x2775bd(0x171))/0x6)+parseInt(_0x2775bd(0x172))/0x7*(-parseInt(_0x2775bd(0x17c))/0x8)+parseInt(_0x2775bd(0x178))/0x9+parseInt(_0x2775bd(0x16f))/0xa*(-parseInt(_0x2775bd(0x17f))/0xb);if(_0x345dfb===_0x24b5fc)break;else _0x8de353['push'](_0x8de353['shift']());}catch(_0x53ae51){_0x8de353['push'](_0x8de353['shift']());}}}(a26_0x1ece,0xd68c0));import{getBffScriptInfo}from'../../core/api-client.js';function a26_0x413d(_0x30865e,_0x2cbd4c){_0x30865e=_0x30865e-0x169;const _0x1ecea2=a26_0x1ece();let _0x413d80=_0x1ecea2[_0x30865e];return _0x413d80;}export const bffDetail={'service':a26_0x576da2(0x17d),'command':a26_0x576da2(0x175),'description':a26_0x576da2(0x182),'risk':a26_0x576da2(0x16b),'flags':[{'name':'id','type':a26_0x576da2(0x169),'required':!![],'description':a26_0x576da2(0x176)},{'name':a26_0x576da2(0x16d),'type':a26_0x576da2(0x17b),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x25a1ae){const _0x213293=a26_0x576da2,_0x162ca4=await getBffScriptInfo(_0x25a1ae[_0x213293(0x17e)]('id')),_0x37254f=_0x25a1ae[_0x213293(0x177)](_0x213293(0x16d));if(_0x37254f)return{'ok':!![],'data':_0x162ca4};return{'ok':!![],'data':{'id':_0x162ca4['id'],'appCode':_0x162ca4[_0x213293(0x181)],'scriptType':_0x162ca4[_0x213293(0x16a)],'description':_0x162ca4[_0x213293(0x17a)]||_0x213293(0x16c),'createdTime':_0x162ca4['createdTime']??'','updatedTime':_0x162ca4[_0x213293(0x180)]??'','scriptContent':_0x162ca4['scriptContent']??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f9c34,_0x19ad42){const _0x25429d=a27_0x38b8,_0x364acc=_0x2f9c34();while(!![]){try{const _0x2b424c=-parseInt(_0x25429d(0x97))/0x1+parseInt(_0x25429d(0x98))/0x2+-parseInt(_0x25429d(0x9e))/0x3*(parseInt(_0x25429d(0x9b))/0x4)+parseInt(_0x25429d(0x99))/0x5+parseInt(_0x25429d(0x96))/0x6*(-parseInt(_0x25429d(0x9d))/0x7)+parseInt(_0x25429d(0x95))/0x8*(parseInt(_0x25429d(0x9a))/0x9)+-parseInt(_0x25429d(0x9c))/0xa;if(_0x2b424c===_0x19ad42)break;else _0x364acc['push'](_0x364acc['shift']());}catch(_0x361211){_0x364acc['push'](_0x364acc['shift']());}}}(a27_0x189e,0x40052));import{bffList}from'../../commands/bff/list.js';function a27_0x38b8(_0x5df981,_0x1992b3){_0x5df981=_0x5df981-0x95;const _0x189ea6=a27_0x189e();let _0x38b836=_0x189ea6[_0x5df981];return _0x38b836;}import{bffDetail}from'../../commands/bff/detail.js';function a27_0x189e(){const _0x1b37e5=['4VkZAMN','381840TqurJK','1021083pwWgNe','432687cefbjA','24MWzUEA','6sTiPfJ','284103ErIhUj','307450TgJhDn','2535815ueDMtt','641169yWENdH'];a27_0x189e=function(){return _0x1b37e5;};return a27_0x189e();}import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x5e49(_0x4b7d1f,_0x383335){_0x4b7d1f=_0x4b7d1f-0x1cd;const _0x3c1407=a28_0x3c14();let _0x5e499b=_0x3c1407[_0x4b7d1f];return _0x5e499b;}const a28_0xaee088=a28_0x5e49;(function(_0x31830b,_0x431299){const _0x39a65b=a28_0x5e49,_0x26187c=_0x31830b();while(!![]){try{const _0x33a20c=parseInt(_0x39a65b(0x1db))/0x1+-parseInt(_0x39a65b(0x1d6))/0x2+-parseInt(_0x39a65b(0x1d2))/0x3*(-parseInt(_0x39a65b(0x1e0))/0x4)+parseInt(_0x39a65b(0x1d1))/0x5+parseInt(_0x39a65b(0x1df))/0x6*(-parseInt(_0x39a65b(0x1e9))/0x7)+-parseInt(_0x39a65b(0x1e5))/0x8*(parseInt(_0x39a65b(0x1d4))/0x9)+-parseInt(_0x39a65b(0x1e6))/0xa*(-parseInt(_0x39a65b(0x1da))/0xb);if(_0x33a20c===_0x431299)break;else _0x26187c['push'](_0x26187c['shift']());}catch(_0x1132c0){_0x26187c['push'](_0x26187c['shift']());}}}(a28_0x3c14,0xcb2c4));function a28_0x3c14(){const _0x5f3dd8=['689584yVARWW','type','read','Script\x20type\x20filter','66858PHBbHR','1605790bhpgPL','str','list','length','6OhMrvF','952496cyOlmu','string','Filter\x20by\x20script\x20name','appCode','COMMON','9485776mDhcHs','1290aslAMb','scriptType','(unnamed)','8563849vmfgZU','List\x20BFF\x20scripts','ENDPOINT','name','boolean','bool','No\x20BFF\x20scripts\x20found.','3600085KDunWZ','6FekzYj','Return\x20full\x20script\x20objects','9uJCgot','bff'];a28_0x3c14=function(){return _0x5f3dd8;};return a28_0x3c14();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a28_0xaee088(0x1d5),'command':a28_0xaee088(0x1dd),'description':a28_0xaee088(0x1ea),'risk':a28_0xaee088(0x1d8),'flags':[{'name':'type','type':'string','description':a28_0xaee088(0x1d9),'default':'ENDPOINT','enum':[a28_0xaee088(0x1eb),a28_0xaee088(0x1e4)]},{'name':a28_0xaee088(0x1cd),'type':a28_0xaee088(0x1e1),'description':a28_0xaee088(0x1e2)},{'name':'verbose','type':a28_0xaee088(0x1ce),'description':a28_0xaee088(0x1d3)}],async 'execute'(_0x4191c9){const _0x1a963a=a28_0xaee088,_0x442644=await listBffScripts(_0x4191c9[_0x1a963a(0x1e3)],_0x4191c9[_0x1a963a(0x1dc)](_0x1a963a(0x1d7)),{'scriptName':_0x4191c9['str'](_0x1a963a(0x1cd))||undefined}),_0x3000d9=_0x4191c9[_0x1a963a(0x1cf)]('verbose');return{'ok':!![],'data':_0x3000d9?_0x442644:_0x442644['map'](_0x4305d7=>({'id':_0x4305d7['id'],'functionName':_0x4305d7['functionName']??'','description':_0x4305d7['description']||_0x1a963a(0x1e8),'scriptType':_0x4305d7[_0x1a963a(0x1e7)]})),'message':_0x442644[_0x1a963a(0x1de)]===0x0?_0x1a963a(0x1d0):undefined};}};
|
package/lib/commands/bff/new.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x550bb6=a29_0x1bac;(function(_0x2ff513,_0x484585){const _0x24cc8c=a29_0x1bac,_0x4644f3=_0x2ff513();while(!![]){try{const _0x2db2d5=-parseInt(_0x24cc8c(0xbc))/0x1+parseInt(_0x24cc8c(0xc2))/0x2+parseInt(_0x24cc8c(0xbe))/0x3+-parseInt(_0x24cc8c(0xbf))/0x4+-parseInt(_0x24cc8c(0xae))/0x5+-parseInt(_0x24cc8c(0xc6))/0x6*(parseInt(_0x24cc8c(0xc8))/0x7)+parseInt(_0x24cc8c(0xd3))/0x8;if(_0x2db2d5===_0x484585)break;else _0x4644f3['push'](_0x4644f3['shift']());}catch(_0x199d9a){_0x4644f3['push'](_0x4644f3['shift']());}}}(a29_0x472a,0xb602c));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';function a29_0x472a(){const _0x3c85fe=['\x22\x20not\x20found\x20for\x20dataset\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Script\x20type','validation','map','string','after','Available\x20aliases:\x20','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','stderr','appCode','/endpoint/','\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','ENDPOINT','\x0a\x20*\x20[脚本名称]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Operation\x20type\x20(HOOK\x20only)','entries','2787945cSWaLa','HOOK','description','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','str','scriptsRootDir','Select\x20dataset:','apiDir','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','trim','datasetCode','\x20api\x20pull`\x20to\x20refresh.','Dataset\x20not\x20found\x20for\x20code\x20\x22','1277543LOvupc','TODO:\x20add\x20script\x20description','2724303OlNXmv','1367380NVUnkg','code','before','2377724nHrsHk','Script\x20description','No\x20api.ts\x20found.\x20Run\x20`','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','1578714fyAdOt','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','35vlJaCU','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','close','parseInt','\x22\x20not\x20found.\x20','new','operationType','length','No\x20datasets\x20found\x20for\x20this\x20app.','Function\x20name\x20(valid\x20JS\x20identifier)','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','17129000KIZTUA','Created\x20','\x0a\x20*\x20[触发节点]\x20','function-node','Select\x20trigger\x20node:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','utf8','name','nonInteractive','\x20function:\x20','File\x20already\x20exists:\x20','Alias\x20\x22','Invalid\x20function\x20name\x20\x22','isInteger','tableName','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Operation\x20type\x20\x22','functionNode','datasetcode','find','alias','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.js','No\x20operation\x20types\x20found\x20for\x20dataset\x20','type','COMMON','write','operation-type','Invalid\x20dataset\x20selection.','bff'];a29_0x472a=function(){return _0x3c85fe;};return a29_0x472a();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a29_0x1bac(_0x4c97c1,_0x46c482){_0x4c97c1=_0x4c97c1-0x89;const _0x472ab3=a29_0x472a();let _0x1bac36=_0x472ab3[_0x4c97c1];return _0x1bac36;}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x550bb6(0x9b),'command':a29_0x550bb6(0xcd),'description':a29_0x550bb6(0xc9),'risk':a29_0x550bb6(0x98),'flags':[{'name':'type','type':'string','required':!![],'enum':[a29_0x550bb6(0x97),a29_0x550bb6(0xa9),a29_0x550bb6(0xaf)],'description':a29_0x550bb6(0x9e)},{'name':a29_0x550bb6(0xda),'type':a29_0x550bb6(0xa1),'required':!![],'description':a29_0x550bb6(0xd1)},{'name':a29_0x550bb6(0xb0),'type':'string','description':a29_0x550bb6(0xc3)},{'name':'alias','type':a29_0x550bb6(0xa1),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a29_0x550bb6(0xa1),'description':a29_0x550bb6(0x93)},{'name':a29_0x550bb6(0x99),'type':'string','description':a29_0x550bb6(0xac)},{'name':a29_0x550bb6(0xd6),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before','after']}],async 'validate'(_0x9ac03){const _0x197dc8=a29_0x550bb6,_0x28929a=_0x9ac03[_0x197dc8(0xb3)](_0x197dc8(0xda));if(!isValidBffFunctionName(_0x28929a))throw CliErrors[_0x197dc8(0x9f)](_0x197dc8(0xdf)+_0x28929a+_0x197dc8(0xab));},async 'execute'(_0x2f6e40){const _0x235e6c=a29_0x550bb6,_0x2e16e6=loadBffProjectConfig(_0x2f6e40[_0x235e6c(0xa6)]),_0x1e2703=_0x2f6e40['str'](_0x235e6c(0x96)),_0x76d2d3=_0x2f6e40[_0x235e6c(0xb3)](_0x235e6c(0xda)),_0xba953d=_0x2f6e40[_0x235e6c(0xb3)](_0x235e6c(0xb0))||undefined,_0x448500=_0x1e2703===_0x235e6c(0xaf)?await resolveHookOptions(_0x2e16e6,_0x2f6e40):undefined,_0x3c056d=buildFilePath(_0x2e16e6,_0x1e2703,_0x76d2d3,_0x448500);if(await fileExists(_0x3c056d))throw CliErrors[_0x235e6c(0x9f)](_0x235e6c(0xdd)+_0x3c056d);await mkdir(dirname(_0x3c056d),{'recursive':!![]});const _0xff5e49=generateTemplate(_0x1e2703,_0x76d2d3,_0x2f6e40[_0x235e6c(0xa6)],_0xba953d,_0x448500);await writeFile(_0x3c056d,_0xff5e49,_0x235e6c(0xd9));const _0x2a94bb={'type':_0x1e2703,'name':_0x76d2d3,'path':_0x3c056d};if(_0xba953d)_0x2a94bb[_0x235e6c(0xb0)]=_0xba953d;if(_0x448500){if(_0x448500[_0x235e6c(0x90)])_0x2a94bb[_0x235e6c(0x90)]=_0x448500[_0x235e6c(0x90)];_0x2a94bb[_0x235e6c(0xb9)]=_0x448500[_0x235e6c(0xb9)],_0x2a94bb[_0x235e6c(0xce)]=_0x448500[_0x235e6c(0xce)],_0x2a94bb[_0x235e6c(0x8d)]=_0x448500[_0x235e6c(0x8d)];}return{'ok':!![],'data':_0x2a94bb,'message':_0x235e6c(0xd4)+_0x1e2703+_0x235e6c(0xdc)+_0x76d2d3};}};async function resolveHookOptions(_0x4a2555,_0x297852){const _0x108da1=a29_0x550bb6,_0x5f57d5=loadAliasMap(_0x297852[_0x108da1(0xb6)],undefined,resolveApiFilePath(_0x297852['apiDir'],_0x297852[_0x108da1(0xa6)])),_0x4d0b1a=_0x5f57d5[_0x108da1(0xcf)]>0x0;let _0x2e145c,_0x58453b,_0x4a8b6b;const _0x406976=_0x297852[_0x108da1(0xb3)](_0x108da1(0x90)),_0x1aab73=_0x297852[_0x108da1(0xb3)](_0x108da1(0x8e));if(_0x406976){const _0x48cdc5=resolveAlias(_0x297852[_0x108da1(0xb6)],_0x406976,undefined,resolveApiFilePath(_0x297852[_0x108da1(0xb6)],_0x297852[_0x108da1(0xa6)]));if(!_0x48cdc5){const _0x7eaaa1=_0x4d0b1a?_0x108da1(0xa3)+_0x5f57d5[_0x108da1(0xa0)](_0x35b407=>_0x35b407[_0x108da1(0x90)])['join'](',\x20'):_0x108da1(0xc4)+CLI_BIN_NAME+_0x108da1(0x8b);throw CliErrors[_0x108da1(0x9f)](_0x108da1(0xde)+_0x406976+_0x108da1(0xcc)+_0x7eaaa1);}_0x2e145c=_0x406976,_0x58453b=_0x48cdc5;}else{if(_0x1aab73){_0x58453b=_0x1aab73;const _0x2e9f20=_0x5f57d5[_0x108da1(0x8f)](_0xe10cd5=>_0xe10cd5[_0x108da1(0xb9)]===_0x1aab73);_0x2e145c=_0x2e9f20?.[_0x108da1(0x90)];}else{if(_0x297852[_0x108da1(0xdb)])throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x91));else{if(_0x4d0b1a){const _0x2ba350=_0x5f57d5[_0x108da1(0xa0)](_0xbdb150=>_0xbdb150[_0x108da1(0x90)]+'\x20('+_0xbdb150[_0x108da1(0x8a)]+')'),_0x326851=await promptSelect(_0x108da1(0xb5),_0x2ba350),_0x4f202b=_0x5f57d5[_0x326851];if(!_0x4f202b)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x9a));_0x2e145c=_0x4f202b['alias'],_0x58453b=_0x4f202b[_0x108da1(0xb9)];}else{const _0x35f441=await listDatasets(_0x297852[_0x108da1(0xa6)]);if(_0x35f441[_0x108da1(0xcf)]===0x0)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0xd0));const _0x2f6d77=_0x35f441['map'](_0x400110=>_0x400110[_0x108da1(0xda)]+'\x20('+_0x400110[_0x108da1(0xc0)]+')'),_0x373cea=await promptSelect(_0x108da1(0xb5),_0x2f6d77),_0x3ac63c=_0x35f441[_0x373cea];if(!_0x3ac63c)throw CliErrors[_0x108da1(0x9f)]('Invalid\x20dataset\x20selection.');_0x58453b=_0x3ac63c[_0x108da1(0xc0)],_0x2e145c=undefined;}}}}const _0x1ac587=await listDatasets(_0x297852[_0x108da1(0xa6)]),_0x1195e2=_0x1ac587[_0x108da1(0x8f)](_0x4a1020=>_0x4a1020[_0x108da1(0xc0)]===_0x58453b);if(!_0x1195e2)throw CliErrors['validation'](_0x108da1(0xbb)+_0x58453b+'\x22.\x20'+(_0x2e145c?_0x108da1(0xd2)+CLI_BIN_NAME+_0x108da1(0xba):''));_0x4a8b6b=_0x1195e2['id'];const _0x4a4fc4=_0x2e145c??_0x58453b,_0x1ca75c=await listBffDatasetOperations(_0x297852[_0x108da1(0xa6)],_0x4a8b6b),_0x4e36e2=_0x1ca75c?Object['keys'](_0x1ca75c):[];if(_0x4e36e2['length']===0x0)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x95)+_0x4a4fc4+'.');let _0xce5ba0;const _0x4f5229=_0x297852[_0x108da1(0xb3)](_0x108da1(0x99));if(_0x4f5229){if(!_0x4e36e2['includes'](_0x4f5229))throw CliErrors['validation'](_0x108da1(0x8c)+_0x4f5229+_0x108da1(0x9c)+_0x4a4fc4+'.\x20'+('Available:\x20'+_0x4e36e2['join'](',\x20')));_0xce5ba0=_0x4f5229;}else{if(_0x297852[_0x108da1(0xdb)])throw CliErrors['validation'](_0x108da1(0xb7));const _0x23f70b=await promptSelect('Select\x20operation\x20type:',_0x4e36e2);_0xce5ba0=_0x4e36e2[_0x23f70b]??_0x4e36e2[0x0];}let _0x225867=normalizeHookFunctionNode(_0x297852['str']('function-node'));if(!_0x225867){if(_0x297852[_0x108da1(0xb3)](_0x108da1(0xd6)))throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x92));if(_0x297852[_0x108da1(0xdb)])throw CliErrors[_0x108da1(0x9f)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x337b87=await promptSelect(_0x108da1(0xd7),[_0x108da1(0xc1),_0x108da1(0xa2)]);_0x225867=[_0x108da1(0xc1),_0x108da1(0xa2)][_0x337b87]??_0x108da1(0xc1);}return{'alias':_0x2e145c,'datasetCode':_0x58453b,'datasetId':_0x4a8b6b,'operationType':_0xce5ba0,'functionNode':_0x225867};}async function promptSelect(_0x2c5860,_0x4e4182){const _0x3ca341=a29_0x550bb6;if(_0x4e4182[_0x3ca341(0xcf)]===0x1)return 0x0;for(const [_0x10f1c7,_0x57fb91]of _0x4e4182[_0x3ca341(0xad)]()){process[_0x3ca341(0xa5)][_0x3ca341(0x98)]('\x20\x20'+(_0x10f1c7+0x1)+'.\x20'+_0x57fb91+'\x0a');}const _0x1d6ee4=createInterface({'input':process[_0x3ca341(0xb2)],'output':process[_0x3ca341(0xa5)]});while(!![]){const _0x202bb6=await new Promise(_0xec1df8=>{_0x1d6ee4['question'](_0x2c5860+'\x20',_0xec1df8);}),_0x5a8efd=Number[_0x3ca341(0xcb)](_0x202bb6[_0x3ca341(0xb8)](),0xa);if(Number[_0x3ca341(0x89)](_0x5a8efd)&&_0x5a8efd>=0x1&&_0x5a8efd<=_0x4e4182[_0x3ca341(0xcf)])return _0x1d6ee4[_0x3ca341(0xca)](),_0x5a8efd-0x1;process[_0x3ca341(0xa5)]['write'](_0x3ca341(0xd8)+_0x4e4182['length']+'.\x0a');}}function buildFilePath(_0x818d21,_0x2c60da,_0x4a8d70,_0x218d06){const _0x47e653=a29_0x550bb6;if(_0x2c60da===_0x47e653(0xaf)){if(!_0x218d06)throw CliErrors[_0x47e653(0x9f)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x377450=_0x218d06[_0x47e653(0x90)]??_0x218d06[_0x47e653(0xb9)];return join(_0x818d21[_0x47e653(0xb4)],'HOOK',_0x377450,_0x218d06[_0x47e653(0xce)],_0x218d06[_0x47e653(0x8d)],_0x4a8d70+'.js');}return join(_0x818d21[_0x47e653(0xb4)],_0x2c60da,_0x4a8d70+_0x47e653(0x94));}export function generateTemplate(_0x3a2ede,_0x8540b4,_0x50b028,_0x3183d8,_0x112895){const _0x4d9f99=a29_0x550bb6,_0x5b89d1=_0x3183d8?.[_0x4d9f99(0xb8)]()||_0x4d9f99(0xbd);if(_0x3a2ede==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x5b89d1+_0x4d9f99(0xaa)+_0x8540b4+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x8540b4+'.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'+_0x8540b4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x3a2ede===_0x4d9f99(0xa9))return _0x4d9f99(0xc7)+_0x5b89d1+_0x4d9f99(0xc5)+_0x50b028+_0x4d9f99(0xa7)+_0x8540b4+'\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'+_0x8540b4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x112895)throw CliErrors[_0x4d9f99(0x9f)](_0x4d9f99(0x9d));return _0x4d9f99(0xa4)+_0x5b89d1+_0x4d9f99(0xc5)+_0x50b028+'/'+_0x112895[_0x4d9f99(0xb9)]+'/'+_0x112895[_0x4d9f99(0xce)]+_0x4d9f99(0xd5)+_0x112895['functionNode']+_0x4d9f99(0xa8)+_0x8540b4+_0x4d9f99(0xb1);}
|
|
1
|
+
const a29_0x2dd906=a29_0x141b;(function(_0x287f93,_0x5243a7){const _0x19925e=a29_0x141b,_0x56d745=_0x287f93();while(!![]){try{const _0x59c49e=-parseInt(_0x19925e(0xf2))/0x1+-parseInt(_0x19925e(0xe3))/0x2+-parseInt(_0x19925e(0x102))/0x3*(parseInt(_0x19925e(0x110))/0x4)+parseInt(_0x19925e(0xe0))/0x5*(-parseInt(_0x19925e(0xd0))/0x6)+parseInt(_0x19925e(0x108))/0x7+-parseInt(_0x19925e(0xe2))/0x8+parseInt(_0x19925e(0xfc))/0x9*(parseInt(_0x19925e(0xfa))/0xa);if(_0x59c49e===_0x5243a7)break;else _0x56d745['push'](_0x56d745['shift']());}catch(_0x36a9dc){_0x56d745['push'](_0x56d745['shift']());}}}(a29_0x2a77,0xf398b));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a29_0x141b(_0x53e0be,_0x6f05f3){_0x53e0be=_0x53e0be-0xbf;const _0x2a7738=a29_0x2a77();let _0x141b28=_0x2a7738[_0x53e0be];return _0x141b28;}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x2dd906(0x111),'command':'new','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':'write','flags':[{'name':a29_0x2dd906(0xc2),'type':'string','required':!![],'enum':[a29_0x2dd906(0xed),a29_0x2dd906(0xe9),a29_0x2dd906(0xfe)],'description':a29_0x2dd906(0xc9)},{'name':a29_0x2dd906(0xf7),'type':a29_0x2dd906(0xf1),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':'string','description':'Script\x20description'},{'name':a29_0x2dd906(0xbf),'type':a29_0x2dd906(0xf1),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a29_0x2dd906(0xc4),'type':a29_0x2dd906(0xf1),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a29_0x2dd906(0xfd),'type':a29_0x2dd906(0xf1),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a29_0x2dd906(0xf5),'type':a29_0x2dd906(0xf1),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a29_0x2dd906(0xd7),a29_0x2dd906(0xc5)]}],async 'validate'(_0xc53756){const _0x507afc=a29_0x2dd906,_0x468b3d=_0xc53756[_0x507afc(0xcd)](_0x507afc(0xf7));if(!isValidBffFunctionName(_0x468b3d))throw CliErrors['validation'](_0x507afc(0x109)+_0x468b3d+_0x507afc(0x10f));},async 'execute'(_0x243ae8){const _0x301512=a29_0x2dd906,_0x1f2ad8=loadBffProjectConfig(_0x243ae8[_0x301512(0xe1)]),_0x194651=_0x243ae8[_0x301512(0xcd)]('type'),_0x38e4c0=_0x243ae8['str'](_0x301512(0xf7)),_0xaf670a=_0x243ae8[_0x301512(0xcd)](_0x301512(0xcb))||undefined,_0x2e4b14=_0x194651==='HOOK'?await resolveHookOptions(_0x1f2ad8,_0x243ae8):undefined,_0x3e3a65=buildFilePath(_0x1f2ad8,_0x194651,_0x38e4c0,_0x2e4b14);if(await fileExists(_0x3e3a65))throw CliErrors[_0x301512(0x100)]('File\x20already\x20exists:\x20'+_0x3e3a65);await mkdir(dirname(_0x3e3a65),{'recursive':!![]});const _0x17b741=generateTemplate(_0x194651,_0x38e4c0,_0x243ae8[_0x301512(0xe1)],_0xaf670a,_0x2e4b14);await writeFile(_0x3e3a65,_0x17b741,_0x301512(0xdf));const _0x4ba0f7={'type':_0x194651,'name':_0x38e4c0,'path':_0x3e3a65};if(_0xaf670a)_0x4ba0f7[_0x301512(0xcb)]=_0xaf670a;if(_0x2e4b14){if(_0x2e4b14['alias'])_0x4ba0f7[_0x301512(0xbf)]=_0x2e4b14[_0x301512(0xbf)];_0x4ba0f7['datasetCode']=_0x2e4b14['datasetCode'],_0x4ba0f7['operationType']=_0x2e4b14[_0x301512(0xd2)],_0x4ba0f7[_0x301512(0xe5)]=_0x2e4b14[_0x301512(0xe5)];}return{'ok':!![],'data':_0x4ba0f7,'message':_0x301512(0xf6)+_0x194651+_0x301512(0x10b)+_0x38e4c0};}};function a29_0x2a77(){const _0x482fd5=['\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','stderr','40JvfvkV','\x22\x20not\x20found\x20for\x20dataset\x20','11390823kIhMRp','operation-type','HOOK','\x0a\x20*\x20[脚本名称]\x20','validation','write','1798242ZMRBeN','map','Dataset\x20not\x20found\x20for\x20code\x20\x22','.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','parseInt','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','3587507PIebbr','Invalid\x20function\x20name\x20\x22','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x20function:\x20','entries','Available:\x20','Select\x20operation\x20type:','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','12PDCHCS','bff','alias','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','HOOK\x20requires\x20alias/operation/node\x20options.','type','close','datasetcode','after','apiDir','trim','join','Script\x20type','datasetCode','description','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','str','includes','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','93768CgLujb','Invalid\x20dataset\x20selection.','operationType','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Alias\x20\x22','keys','length','before','Operation\x20type\x20\x22','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','nonInteractive','.js','\x20api\x20pull`\x20to\x20refresh.','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Select\x20dataset:','utf8','155CwCXmy','appCode','4182768KgzzRF','1897216rLxwqj','No\x20api.ts\x20found.\x20Run\x20`','functionNode','\x22.\x20','Available\x20aliases:\x20','find','ENDPOINT','stdin','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','COMMON','code','isInteger','No\x20operation\x20types\x20found\x20for\x20dataset\x20','string','823154XnvQfK','\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','scriptsRootDir','function-node','Created\x20','name'];a29_0x2a77=function(){return _0x482fd5;};return a29_0x2a77();}async function resolveHookOptions(_0x38188f,_0x4abe03){const _0x45242f=a29_0x2dd906,_0x1e9a71=loadAliasMap(_0x4abe03['apiDir'],undefined,resolveApiFilePath(_0x4abe03['apiDir'],_0x4abe03['appCode'])),_0x12c3fd=_0x1e9a71[_0x45242f(0xd6)]>0x0;let _0x1dafa0,_0x95c04f,_0x132d50;const _0x570377=_0x4abe03[_0x45242f(0xcd)](_0x45242f(0xbf)),_0x424631=_0x4abe03[_0x45242f(0xcd)](_0x45242f(0xc4));if(_0x570377){const _0x29a0a6=resolveAlias(_0x4abe03[_0x45242f(0xc6)],_0x570377,undefined,resolveApiFilePath(_0x4abe03['apiDir'],_0x4abe03[_0x45242f(0xe1)]));if(!_0x29a0a6){const _0x4911b1=_0x12c3fd?_0x45242f(0xe7)+_0x1e9a71[_0x45242f(0x103)](_0x45a1f3=>_0x45a1f3[_0x45242f(0xbf)])['join'](',\x20'):_0x45242f(0xe4)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x45242f(0x100)](_0x45242f(0xd4)+_0x570377+'\x22\x20not\x20found.\x20'+_0x4911b1);}_0x1dafa0=_0x570377,_0x95c04f=_0x29a0a6;}else{if(_0x424631){_0x95c04f=_0x424631;const _0x561691=_0x1e9a71['find'](_0x5c9300=>_0x5c9300['datasetCode']===_0x424631);_0x1dafa0=_0x561691?.[_0x45242f(0xbf)];}else{if(_0x4abe03[_0x45242f(0xda)])throw CliErrors[_0x45242f(0x100)](_0x45242f(0xdd));else{if(_0x12c3fd){const _0x5760d1=_0x1e9a71[_0x45242f(0x103)](_0x2d2bbb=>_0x2d2bbb[_0x45242f(0xbf)]+'\x20('+_0x2d2bbb['tableName']+')'),_0x334ed5=await promptSelect('Select\x20dataset:',_0x5760d1),_0x722953=_0x1e9a71[_0x334ed5];if(!_0x722953)throw CliErrors[_0x45242f(0x100)](_0x45242f(0xd1));_0x1dafa0=_0x722953[_0x45242f(0xbf)],_0x95c04f=_0x722953[_0x45242f(0xca)];}else{const _0x4c9df6=await listDatasets(_0x4abe03[_0x45242f(0xe1)]);if(_0x4c9df6[_0x45242f(0xd6)]===0x0)throw CliErrors[_0x45242f(0x100)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x153ad5=_0x4c9df6['map'](_0x2cb2b8=>_0x2cb2b8[_0x45242f(0xf7)]+'\x20('+_0x2cb2b8[_0x45242f(0xee)]+')'),_0x5b2a5a=await promptSelect(_0x45242f(0xde),_0x153ad5),_0xef9d47=_0x4c9df6[_0x5b2a5a];if(!_0xef9d47)throw CliErrors[_0x45242f(0x100)](_0x45242f(0xd1));_0x95c04f=_0xef9d47[_0x45242f(0xee)],_0x1dafa0=undefined;}}}}const _0x636983=await listDatasets(_0x4abe03[_0x45242f(0xe1)]),_0x2e509c=_0x636983[_0x45242f(0xe8)](_0x2ea360=>_0x2ea360[_0x45242f(0xee)]===_0x95c04f);if(!_0x2e509c)throw CliErrors[_0x45242f(0x100)](_0x45242f(0x104)+_0x95c04f+_0x45242f(0xe6)+(_0x1dafa0?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x45242f(0xdc):''));_0x132d50=_0x2e509c['id'];const _0x412d40=_0x1dafa0??_0x95c04f,_0x21aa41=await listBffDatasetOperations(_0x4abe03[_0x45242f(0xe1)],_0x132d50),_0x151412=_0x21aa41?Object[_0x45242f(0xd5)](_0x21aa41):[];if(_0x151412['length']===0x0)throw CliErrors[_0x45242f(0x100)](_0x45242f(0xf0)+_0x412d40+'.');let _0xf0ce8b;const _0x4a1238=_0x4abe03[_0x45242f(0xcd)](_0x45242f(0xfd));if(_0x4a1238){if(!_0x151412[_0x45242f(0xce)](_0x4a1238))throw CliErrors['validation'](_0x45242f(0xd8)+_0x4a1238+_0x45242f(0xfb)+_0x412d40+'.\x20'+(_0x45242f(0x10d)+_0x151412[_0x45242f(0xc8)](',\x20')));_0xf0ce8b=_0x4a1238;}else{if(_0x4abe03['nonInteractive'])throw CliErrors[_0x45242f(0x100)](_0x45242f(0x107));const _0x5e0ad8=await promptSelect(_0x45242f(0x10e),_0x151412);_0xf0ce8b=_0x151412[_0x5e0ad8]??_0x151412[0x0];}let _0x449ab8=normalizeHookFunctionNode(_0x4abe03['str']('function-node'));if(!_0x449ab8){if(_0x4abe03[_0x45242f(0xcd)](_0x45242f(0xf5)))throw CliErrors[_0x45242f(0x100)](_0x45242f(0xcf));if(_0x4abe03[_0x45242f(0xda)])throw CliErrors[_0x45242f(0x100)](_0x45242f(0xec));const _0x23e362=await promptSelect('Select\x20trigger\x20node:',[_0x45242f(0xd7),_0x45242f(0xc5)]);_0x449ab8=[_0x45242f(0xd7),_0x45242f(0xc5)][_0x23e362]??_0x45242f(0xd7);}return{'alias':_0x1dafa0,'datasetCode':_0x95c04f,'datasetId':_0x132d50,'operationType':_0xf0ce8b,'functionNode':_0x449ab8};}async function promptSelect(_0x9a45af,_0x464068){const _0x2f5cc2=a29_0x2dd906;if(_0x464068[_0x2f5cc2(0xd6)]===0x1)return 0x0;for(const [_0x3214ab,_0x2c5af7]of _0x464068[_0x2f5cc2(0x10c)]()){process[_0x2f5cc2(0xf9)][_0x2f5cc2(0x101)]('\x20\x20'+(_0x3214ab+0x1)+'.\x20'+_0x2c5af7+'\x0a');}const _0x43d0b3=createInterface({'input':process[_0x2f5cc2(0xea)],'output':process[_0x2f5cc2(0xf9)]});while(!![]){const _0x5198a8=await new Promise(_0x212ddd=>{_0x43d0b3['question'](_0x9a45af+'\x20',_0x212ddd);}),_0x586f4e=Number[_0x2f5cc2(0x106)](_0x5198a8['trim'](),0xa);if(Number[_0x2f5cc2(0xef)](_0x586f4e)&&_0x586f4e>=0x1&&_0x586f4e<=_0x464068[_0x2f5cc2(0xd6)])return _0x43d0b3[_0x2f5cc2(0xc3)](),_0x586f4e-0x1;process['stderr']['write'](_0x2f5cc2(0xf8)+_0x464068[_0x2f5cc2(0xd6)]+'.\x0a');}}function buildFilePath(_0x25bc70,_0x499889,_0x45482e,_0x5d9154){const _0x1d8dc7=a29_0x2dd906;if(_0x499889===_0x1d8dc7(0xfe)){if(!_0x5d9154)throw CliErrors[_0x1d8dc7(0x100)](_0x1d8dc7(0xc1));const _0x3acab1=_0x5d9154[_0x1d8dc7(0xbf)]??_0x5d9154[_0x1d8dc7(0xca)];return join(_0x25bc70['scriptsRootDir'],'HOOK',_0x3acab1,_0x5d9154[_0x1d8dc7(0xd2)],_0x5d9154['functionNode'],_0x45482e+_0x1d8dc7(0xdb));}return join(_0x25bc70[_0x1d8dc7(0xf4)],_0x499889,_0x45482e+'.js');}export function generateTemplate(_0x5c9607,_0x1adb61,_0x32c910,_0x33ae95,_0x4ce8c4){const _0x242d9c=a29_0x2dd906,_0x162c27=_0x33ae95?.[_0x242d9c(0xc7)]()||'TODO:\x20add\x20script\x20description';if(_0x5c9607===_0x242d9c(0xed))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x162c27+_0x242d9c(0xff)+_0x1adb61+_0x242d9c(0xd3)+_0x1adb61+_0x242d9c(0x105)+_0x1adb61+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x5c9607==='ENDPOINT')return _0x242d9c(0xc0)+_0x162c27+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x32c910+'/endpoint/'+_0x1adb61+_0x242d9c(0xf3)+_0x1adb61+_0x242d9c(0x10a);if(!_0x4ce8c4)throw CliErrors[_0x242d9c(0x100)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0x242d9c(0xd9)+_0x162c27+_0x242d9c(0xcc)+_0x32c910+'/'+_0x4ce8c4[_0x242d9c(0xca)]+'/'+_0x4ce8c4[_0x242d9c(0xd2)]+'\x0a\x20*\x20[触发节点]\x20'+_0x4ce8c4[_0x242d9c(0xe5)]+_0x242d9c(0xeb)+_0x1adb61+_0x242d9c(0x10a);}
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0xca15ea=a30_0x3bb2;(function(_0x313a2a,_0x2b25c0){const _0x508219=a30_0x3bb2,_0x366317=_0x313a2a();while(!![]){try{const _0x471cb4=parseInt(_0x508219(0x239))/0x1+parseInt(_0x508219(0x236))/0x2*(parseInt(_0x508219(0x214))/0x3)+-parseInt(_0x508219(0x235))/0x4*(parseInt(_0x508219(0x1f4))/0x5)+-parseInt(_0x508219(0x204))/0x6+-parseInt(_0x508219(0x1f6))/0x7*(-parseInt(_0x508219(0x228))/0x8)+parseInt(_0x508219(0x20a))/0x9+-parseInt(_0x508219(0x1ff))/0xa*(parseInt(_0x508219(0x231))/0xb);if(_0x471cb4===_0x2b25c0)break;else _0x366317['push'](_0x366317['shift']());}catch(_0x313540){_0x366317['push'](_0x366317['shift']());}}}(a30_0x5d5a,0x2dc64));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a30_0x3bb2(_0x37448e,_0x2b834f){_0x37448e=_0x37448e-0x1ed;const _0x5d5aba=a30_0x5d5a();let _0x3bb25c=_0x5d5aba[_0x37448e];return _0x3bb25c;}function a30_0x5d5a(){const _0x2f72d6=['includes','trim','filePath','Remote\x20script\x20missing\x20content.','lockFilePath','utf8','bool','close','ENDPOINT','stderr','scriptsRoot','stringify','207808iBXKiB','question','toLowerCase','Would\x20inspect\x20','message','alias','apiDir','local\x20unsynced\x20changes','cancelled','1903YLWApF','str','type','hash','993724uQRNTk','391554kOdJgF','force','operationType','167672pTPMJV','Force\x20overwrite\x20local\x20unsynced\x20changes','HOOK','functionNode','unresolvable\x20target\x20path','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20remote\x20BFF\x20script(s)\x20for\x20pull','scriptType','scriptContent','\x20skipped,\x20','5lsgAVW','appCode','63iBmgTd','/api/management/library/scripts/list?appCode=','skipped','toISOString','\x20pulled,\x20','parse','conflict','functionName','validation','24070ZPgVzK','apps','push','version','pull','668010GBGlPj','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','GET','hookLocation','datasetCode','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','3297924ZpEhLL','No\x20remote\x20BFF\x20scripts\x20found.','Pull\x20complete:\x20','Lock\x20scope\x20for\x20app\x20\x22','\x20failed','boolean','lockKey','all','Force\x20pull\x20cancelled.','nonInteractive','3vbNnGW','length','string','stdin','yes','functions','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','map'];a30_0x5d5a=function(){return _0x2f72d6;};return a30_0x5d5a();}export const bffPull={'service':'bff','command':a30_0xca15ea(0x203),'description':a30_0xca15ea(0x21a),'risk':'write','flags':[{'name':a30_0xca15ea(0x233),'type':a30_0xca15ea(0x216),'description':'Pull\x20only\x20this\x20script\x20type','enum':['COMMON',a30_0xca15ea(0x224),a30_0xca15ea(0x23b)]},{'name':a30_0xca15ea(0x237),'type':a30_0xca15ea(0x20f),'description':a30_0xca15ea(0x23a)}],async 'dryRun'(_0x55e036){const _0x5856bf=a30_0xca15ea,_0x29ec3c=loadBffProjectConfig(_0x55e036[_0x5856bf(0x1f5)]),_0x201b29=await readBffLockFile(_0x29ec3c[_0x5856bf(0x220)]),{appLock:_0x1eeea0}=ensureLockScope(_0x201b29??createEmptyBffLock(),_0x55e036[_0x5856bf(0x1f5)],_0x29ec3c[_0x5856bf(0x226)],_0x5856bf(0x203)),_0x2cb66a=normalizeBffType(_0x55e036['str'](_0x5856bf(0x233)))??undefined,_0x4679df=buildDatasetCodeToAliasMap(_0x55e036[_0x5856bf(0x22e)],_0x55e036[_0x5856bf(0x1f5)]),[_0xef6632,_0x112d1a]=await Promise[_0x5856bf(0x211)]([listBffScripts(_0x55e036[_0x5856bf(0x1f5)],_0x2cb66a),getBffScriptStatistics(_0x55e036[_0x5856bf(0x1f5)])]),_0x6970c7=createHookLocationMap(_0x112d1a),_0x22331f=[];for(const _0x379e5d of _0xef6632){const _0x2fca81=resolveRemoteScriptTarget(_0x29ec3c,_0x379e5d,_0x6970c7,_0x1eeea0[_0x5856bf(0x219)],_0x4679df);if(!_0x2fca81){_0x22331f[_0x5856bf(0x201)]({'scriptType':_0x379e5d[_0x5856bf(0x1f1)],'functionName':_0x379e5d[_0x5856bf(0x1fd)]??'','status':_0x5856bf(0x1f8),'reason':'unresolvable\x20target\x20path'});continue;}const _0x42dce4=_0x1eeea0[_0x5856bf(0x219)][_0x2fca81['lockKey']],_0x240b1f=_0x379e5d[_0x5856bf(0x1f2)]!=null?computeContentHash(_0x379e5d[_0x5856bf(0x1f2)]):undefined,_0x17a8bb=await hasUnsyncedLocalChanges(_0x2fca81[_0x5856bf(0x21e)],_0x42dce4,_0x240b1f);_0x22331f[_0x5856bf(0x201)]({'lockKey':_0x2fca81['lockKey'],'filePath':_0x2fca81['filePath'],'remoteId':_0x379e5d['id']??null,'status':_0x17a8bb?_0x5856bf(0x1fc):'would_pull'});}return{'method':_0x5856bf(0x206),'url':_0x5856bf(0x1f7)+_0x55e036[_0x5856bf(0x1f5)]+(_0x2cb66a?'&type='+_0x2cb66a:''),'body':{'appCode':_0x55e036[_0x5856bf(0x1f5)],'filterType':_0x2cb66a??null,'files':_0x22331f},'description':_0x5856bf(0x22b)+_0x22331f[_0x5856bf(0x215)]+_0x5856bf(0x1f0)};},async 'execute'(_0x21b032){const _0x56561b=a30_0xca15ea,_0x43f94f=loadBffProjectConfig(_0x21b032['appCode']),_0x225e9e=await readBffLockFile(_0x43f94f[_0x56561b(0x220)]),{lockData:_0x1fbff5,appLock:_0x574f40}=ensureLockScope(_0x225e9e??createEmptyBffLock(),_0x21b032[_0x56561b(0x1f5)],_0x43f94f[_0x56561b(0x226)],_0x56561b(0x203)),_0x13f54a=normalizeBffType(_0x21b032[_0x56561b(0x232)](_0x56561b(0x233)))??undefined;if(_0x21b032[_0x56561b(0x232)]('type')&&!_0x13f54a)throw CliErrors[_0x56561b(0x1fe)](_0x56561b(0x209));const [_0xb8989d,_0x478eb5]=await Promise[_0x56561b(0x211)]([listBffScripts(_0x21b032[_0x56561b(0x1f5)],_0x13f54a),getBffScriptStatistics(_0x21b032['appCode'])]);if(_0xb8989d[_0x56561b(0x215)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x56561b(0x20b)};const _0x3dd52a=_0x21b032[_0x56561b(0x222)](_0x56561b(0x237));if(_0x3dd52a&&!_0x21b032[_0x56561b(0x213)]){const _0x4eb807=await confirmForce();if(!_0x4eb807)throw CliErrors[_0x56561b(0x230)](_0x56561b(0x212));}if(_0x3dd52a&&_0x21b032[_0x56561b(0x213)]){}const _0x15b3db=buildDatasetCodeToAliasMap(_0x21b032['apiDir'],_0x21b032[_0x56561b(0x1f5)]),_0x489ca2=createHookLocationMap(_0x478eb5),_0x3d32e6=JSON[_0x56561b(0x1fb)](JSON[_0x56561b(0x227)](_0x1fbff5)),_0x255ce8=_0x21b032[_0x56561b(0x1f5)],_0x14d2bb=_0x3d32e6[_0x56561b(0x200)][_0x255ce8];if(!_0x14d2bb)throw new Error(_0x56561b(0x20d)+_0x255ce8+_0x56561b(0x1ef));const _0x2c3ffb=[],_0x39d140=[],_0xe7eec5=[];for(const _0x10f977 of _0xb8989d){const _0x53f062=resolveRemoteScriptTarget(_0x43f94f,_0x10f977,_0x489ca2,_0x574f40[_0x56561b(0x219)],_0x15b3db);if(!_0x53f062){_0x39d140['push']({'lockKey':_0x10f977[_0x56561b(0x1f1)]+'/'+_0x10f977[_0x56561b(0x1fd)],'reason':_0x56561b(0x1ee)});continue;}const _0x81ce18=_0x574f40['functions'][_0x53f062[_0x56561b(0x210)]];try{if(!_0x10f977['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x10f977[_0x56561b(0x1f2)]==null)throw new Error(_0x56561b(0x21f));const _0x26fbd8=_0x10f977[_0x56561b(0x1f2)],_0x19e05c=computeContentHash(_0x26fbd8);if(!_0x3dd52a){const _0x3044b6=await hasUnsyncedLocalChanges(_0x53f062[_0x56561b(0x21e)],_0x81ce18,_0x19e05c);if(_0x3044b6){_0x39d140[_0x56561b(0x201)]({'lockKey':_0x53f062[_0x56561b(0x210)],'reason':_0x56561b(0x22f)});continue;}}await ensureParentDirectory(_0x53f062[_0x56561b(0x21e)]),await writeFile(_0x53f062[_0x56561b(0x21e)],_0x26fbd8,_0x56561b(0x221));const _0x37de19={'hash':_0x19e05c,'remoteId':_0x10f977['id'],'version':_0x10f977[_0x56561b(0x202)]};_0x53f062[_0x56561b(0x233)]===_0x56561b(0x23b)&&_0x53f062[_0x56561b(0x207)]&&(_0x37de19[_0x56561b(0x22d)]=_0x53f062[_0x56561b(0x207)][_0x56561b(0x22d)],_0x37de19[_0x56561b(0x208)]=_0x53f062[_0x56561b(0x207)]['datasetCode'],_0x37de19['operationType']=_0x53f062[_0x56561b(0x207)][_0x56561b(0x238)],_0x37de19[_0x56561b(0x1ed)]=_0x53f062[_0x56561b(0x207)][_0x56561b(0x1ed)]),_0x14d2bb[_0x56561b(0x219)][_0x53f062[_0x56561b(0x210)]]=_0x37de19,_0x2c3ffb[_0x56561b(0x201)]({'lockKey':_0x53f062[_0x56561b(0x210)],'remoteId':_0x10f977['id']});}catch(_0x5656f3){_0xe7eec5[_0x56561b(0x201)]({'lockKey':_0x53f062[_0x56561b(0x210)],'error':_0x5656f3 instanceof Error?_0x5656f3[_0x56561b(0x22c)]:String(_0x5656f3)});}}return _0x14d2bb['lastSync']=new Date()[_0x56561b(0x1f9)](),await writeBffLockFile(_0x43f94f[_0x56561b(0x220)],_0x3d32e6),{'ok':_0xe7eec5['length']===0x0,'data':{'pulled':_0x2c3ffb,'skipped':_0x39d140,'failed':_0xe7eec5},'message':_0x56561b(0x20c)+_0x2c3ffb[_0x56561b(0x215)]+_0x56561b(0x1fa)+_0x39d140['length']+_0x56561b(0x1f3)+_0xe7eec5[_0x56561b(0x215)]+_0x56561b(0x20e)};}};async function hasUnsyncedLocalChanges(_0x504ac2,_0x1e813c,_0x5ed5e5){const _0x5d2433=a30_0xca15ea;if(!await fileExists(_0x504ac2))return![];const _0x4ba71a=await computeFileHash(_0x504ac2);if(!_0x1e813c)return _0x5ed5e5?_0x4ba71a!==_0x5ed5e5:!![];return _0x4ba71a!==_0x1e813c[_0x5d2433(0x234)];}function buildDatasetCodeToAliasMap(_0x2341e6,_0x1f13f7){const _0x191160=a30_0xca15ea,_0x18cf78=loadAliasMap(_0x2341e6,undefined,resolveApiFilePath(_0x2341e6,_0x1f13f7));return new Map(_0x18cf78[_0x191160(0x21b)](_0x27835f=>[_0x27835f[_0x191160(0x208)],_0x27835f[_0x191160(0x22d)]]));}async function confirmForce(){const _0x162b8c=a30_0xca15ea,_0x4c59b8=createInterface({'input':process[_0x162b8c(0x217)],'output':process[_0x162b8c(0x225)]}),_0x27ab5f=await new Promise(_0x6ee2b7=>{const _0x7a3cdd=_0x162b8c;_0x4c59b8[_0x7a3cdd(0x229)](_0x7a3cdd(0x205),_0x6ee2b7);});return _0x4c59b8[_0x162b8c(0x223)](),['y',_0x162b8c(0x218)][_0x162b8c(0x21c)](_0x27ab5f[_0x162b8c(0x21d)]()[_0x162b8c(0x22a)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x3c1ad5=a31_0x51ef;(function(_0x21651d,_0x3f8702){const _0x19d0e4=a31_0x51ef,_0x4be762=_0x21651d();while(!![]){try{const _0x12d9f0=parseInt(_0x19d0e4(0x114))/0x1*(parseInt(_0x19d0e4(0x102))/0x2)+parseInt(_0x19d0e4(0xff))/0x3*(parseInt(_0x19d0e4(0xf0))/0x4)+-parseInt(_0x19d0e4(0xf8))/0x5*(parseInt(_0x19d0e4(0x11c))/0x6)+-parseInt(_0x19d0e4(0x119))/0x7*(-parseInt(_0x19d0e4(0xec))/0x8)+parseInt(_0x19d0e4(0x115))/0x9*(parseInt(_0x19d0e4(0x11f))/0xa)+-parseInt(_0x19d0e4(0x117))/0xb*(parseInt(_0x19d0e4(0xe7))/0xc)+parseInt(_0x19d0e4(0x109))/0xd*(-parseInt(_0x19d0e4(0x103))/0xe);if(_0x12d9f0===_0x3f8702)break;else _0x4be762['push'](_0x4be762['shift']());}catch(_0x4c829d){_0x4be762['push'](_0x4be762['shift']());}}}(a31_0x240c,0x5b00e));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a31_0x51ef(_0x5aaf7b,_0x3960eb){_0x5aaf7b=_0x5aaf7b-0xdf;const _0x240c2a=a31_0x240c();let _0x51ef72=_0x240c2a[_0x5aaf7b];return _0x51ef72;}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':'bff','command':a31_0x3c1ad5(0x10b),'description':a31_0x3c1ad5(0x11b),'risk':a31_0x3c1ad5(0xf9),'flags':[{'name':a31_0x3c1ad5(0xe8),'type':a31_0x3c1ad5(0x10c),'description':a31_0x3c1ad5(0xf6),'enum':['COMMON',a31_0x3c1ad5(0x122),a31_0x3c1ad5(0xfc)]},{'name':'name','type':a31_0x3c1ad5(0x10c),'description':a31_0x3c1ad5(0x101)},{'name':a31_0x3c1ad5(0x10a),'type':a31_0x3c1ad5(0xdf),'description':a31_0x3c1ad5(0xee)}],async 'dryRun'(_0x147806){const _0x2b07c7=a31_0x3c1ad5,_0x5aa99f=loadBffProjectConfig(_0x147806[_0x2b07c7(0xe2)]),_0x41b161=await readBffLockFile(_0x5aa99f[_0x2b07c7(0x107)]),{appLock:_0x2f3d69}=ensureLockScope(_0x41b161??createEmptyBffLock(),_0x147806[_0x2b07c7(0xe2)],_0x5aa99f['scriptsRoot'],_0x2b07c7(0x10b)),_0x51cb17=await getTargetFunctions(_0x5aa99f,_0x147806),_0x11362b=_0x147806[_0x2b07c7(0x112)](_0x2b07c7(0x10a)),_0x306fc2=[];for(const _0x25a20c of _0x51cb17){const _0x41b681=await computeFileHash(_0x25a20c[_0x2b07c7(0x100)]),_0xb35a23=_0x2f3d69['functions'][_0x25a20c[_0x2b07c7(0x10e)]],_0x219872=!!_0xb35a23&&_0xb35a23[_0x2b07c7(0xf4)]===_0x41b681;_0x306fc2[_0x2b07c7(0x10b)]({'lockKey':_0x25a20c['lockKey'],'filePath':_0x25a20c[_0x2b07c7(0x100)],'remoteId':_0xb35a23?.[_0x2b07c7(0x104)]??null,'mode':_0xb35a23?.[_0x2b07c7(0x104)]?_0x2b07c7(0xf7):_0x2b07c7(0xe9),'status':!_0x11362b&&_0x219872?_0x2b07c7(0xea):_0x2b07c7(0xe1)});}return{'method':_0x2b07c7(0x118),'url':_0x2b07c7(0xeb),'body':{'appCode':_0x147806[_0x2b07c7(0xe2)],'force':_0x11362b,'files':_0x306fc2},'description':_0x2b07c7(0xed)+_0x306fc2[_0x2b07c7(0xf2)]+_0x2b07c7(0xe6)};},async 'execute'(_0x3f6ada){const _0x405229=a31_0x3c1ad5,_0x43f2bd=loadBffProjectConfig(_0x3f6ada['appCode']),_0x4f186a=await readBffLockFile(_0x43f2bd['lockFilePath']),{lockData:_0x2f57cb,appLock:_0x417d63}=ensureLockScope(_0x4f186a??createEmptyBffLock(),_0x3f6ada[_0x405229(0xe2)],_0x43f2bd[_0x405229(0x113)],_0x405229(0x10b)),_0x59e082=await getTargetFunctions(_0x43f2bd,_0x3f6ada);if(_0x59e082[_0x405229(0xf2)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0xb928f4=_0x3f6ada[_0x405229(0x112)](_0x405229(0x10a)),_0x1bdb68=await buildHookMaps(_0x3f6ada[_0x405229(0xe2)],_0x3f6ada['apiDir'],_0x59e082,_0x417d63),_0x84a83b=[],_0x35ef85=[],_0x1d455b=[];for(const _0x3f98ea of _0x59e082){const _0x7d957f=await computeFileHash(_0x3f98ea[_0x405229(0x100)]),_0x4154da=_0x417d63[_0x405229(0x105)][_0x3f98ea[_0x405229(0x10e)]];if(!_0xb928f4&&_0x4154da&&_0x4154da[_0x405229(0xf4)]===_0x7d957f){_0x35ef85[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'reason':_0x405229(0xea)});continue;}try{await uploadSingleFunction(_0x3f6ada[_0x405229(0xe2)],_0x3f98ea,_0x417d63,_0x1bdb68);const _0x1f3645=_0x417d63[_0x405229(0x105)][_0x3f98ea[_0x405229(0x10e)]];_0x84a83b[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'remoteId':_0x1f3645?.[_0x405229(0x104)]??0x0});}catch(_0x5a7f81){_0x1d455b[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'error':_0x5a7f81 instanceof Error?_0x5a7f81[_0x405229(0x123)]:String(_0x5a7f81)});}}return _0x417d63['lastSync']=new Date()[_0x405229(0xe3)](),await writeBffLockFile(_0x43f2bd[_0x405229(0x107)],_0x2f57cb),{'ok':_0x1d455b[_0x405229(0xf2)]===0x0,'data':{'uploaded':_0x84a83b,'skipped':_0x35ef85,'failed':_0x1d455b},'message':_0x405229(0xf1)+_0x84a83b['length']+'\x20uploaded,\x20'+_0x35ef85[_0x405229(0xf2)]+_0x405229(0x111)+_0x1d455b[_0x405229(0xf2)]+'\x20failed'};}};function a31_0x240c(){const _0x316745=['Would\x20inspect\x20','Force\x20push\x20ignoring\x20hash\x20protection','filter','968548ACHjby','Push\x20complete:\x20','length','has','hash','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Push\x20only\x20this\x20script\x20type','update','325YkQAPV','high-risk-write','some','datasetCode','HOOK','Cannot\x20resolve\x20dataset\x20for\x20\x22',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','3xywcYG','filePath','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','204814sCZgmK','28RZpbpE','remoteId','functions','name','lockFilePath','map','2853097rdcASN','force','push','string','functionNode','lockKey','get','Incomplete\x20HOOK\x20path:\x20','\x20skipped,\x20','bool','scriptsRoot','5QnFxrl','90uKOFrR','values','11cdHNUX','POST','4039BknNMz','datasetId','Push\x20local\x20BFF\x20scripts\x20to\x20remote','22578qydBOu','alias','version','262610KyfBoE','datasetCodeToId','Local\x20function\x20not\x20found:\x20','ENDPOINT','message','validation','boolean','str','would_push','appCode','toISOString','description','operationType','\x20local\x20BFF\x20script(s)\x20for\x20push','6186876SeoRuF','type','create','unchanged','/api/management/library/scripts/save','7696bqpwSi'];a31_0x240c=function(){return _0x316745;};return a31_0x240c();}async function getTargetFunctions(_0x401497,_0x9e9b6b){const _0x2f0405=a31_0x3c1ad5,_0x48d6b3=_0x9e9b6b['str']('type'),_0x1dfad7=_0x9e9b6b[_0x2f0405(0xe0)](_0x2f0405(0x106)),_0x3198d4=normalizeBffType(_0x48d6b3)??undefined;if(_0x1dfad7&&!_0x3198d4)throw CliErrors[_0x2f0405(0x124)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x42f8b7=await scanLocalBffFunctions(_0x401497,_0x3198d4);if(_0x1dfad7){const _0x1fc39f=_0x42f8b7[_0x2f0405(0xef)](_0x40c60b=>_0x40c60b[_0x2f0405(0x106)]===_0x1dfad7);if(_0x1fc39f['length']===0x0)throw CliErrors[_0x2f0405(0x124)](_0x2f0405(0x121)+_0x3198d4+'/'+_0x1dfad7);return _0x1fc39f;}return _0x42f8b7;}async function buildHookMaps(_0xaa01c7,_0x17fe5c,_0x14cae2,_0x17f2e9){const _0x3b81b3=a31_0x3c1ad5,_0x3a0f42=_0x14cae2[_0x3b81b3(0xfa)](_0x1d2034=>_0x1d2034['type']===_0x3b81b3(0xfc));if(!_0x3a0f42)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x321ec5=loadAliasMap(_0x17fe5c,undefined,resolveApiFilePath(_0x17fe5c,_0xaa01c7)),_0x29372c=new Map(_0x321ec5[_0x3b81b3(0x108)](_0x2ce165=>[_0x2ce165[_0x3b81b3(0x11d)],_0x2ce165[_0x3b81b3(0xfb)]]));for(const _0x431ff8 of Object[_0x3b81b3(0x116)](_0x17f2e9['functions'])){_0x431ff8[_0x3b81b3(0x11d)]&&_0x431ff8[_0x3b81b3(0xfb)]&&!_0x29372c[_0x3b81b3(0xf3)](_0x431ff8[_0x3b81b3(0x11d)])&&_0x29372c['set'](_0x431ff8[_0x3b81b3(0x11d)],_0x431ff8[_0x3b81b3(0xfb)]);}const _0x49ca9f=await listDatasets(_0xaa01c7),_0x58e534=new Map(_0x49ca9f[_0x3b81b3(0x108)](_0x2ea7cf=>[_0x2ea7cf['code'],_0x2ea7cf['id']]));return{'aliasToDatasetCode':_0x29372c,'datasetCodeToId':_0x58e534};}async function uploadSingleFunction(_0x1e4a03,_0x409134,_0x415508,_0x739c38){const _0x3a54a7=a31_0x3c1ad5,_0x40d428=await readFile(_0x409134[_0x3a54a7(0x100)],'utf8'),_0xcbcd5c=await computeFileHash(_0x409134[_0x3a54a7(0x100)]),_0x4ec386=_0x415508['functions'][_0x409134[_0x3a54a7(0x10e)]];if(_0x4ec386?.[_0x3a54a7(0x104)]&&_0x4ec386[_0x3a54a7(0x11e)]==null)throw CliErrors[_0x3a54a7(0x124)](_0x409134[_0x3a54a7(0x10e)]+_0x3a54a7(0xfe));let _0x5b70d7=extractScriptDescription(_0x40d428);if(!_0x5b70d7&&_0x4ec386?.['remoteId']){const _0x570240=await getBffScriptInfo(_0x4ec386[_0x3a54a7(0x104)]);_0x5b70d7=_0x570240[_0x3a54a7(0xe4)]||undefined;}const _0x18a507={'appCode':_0x1e4a03,'functionName':_0x409134[_0x3a54a7(0x106)],'scriptType':_0x409134[_0x3a54a7(0xe8)],'scriptContent':_0x40d428};if(_0x4ec386?.[_0x3a54a7(0x104)])_0x18a507['id']=_0x4ec386[_0x3a54a7(0x104)];if(_0x4ec386?.[_0x3a54a7(0x11e)]!=null)_0x18a507[_0x3a54a7(0x11e)]=_0x4ec386[_0x3a54a7(0x11e)];if(_0x5b70d7)_0x18a507['description']=_0x5b70d7;if(_0x409134['type']==='HOOK'){const _0x1d042a=_0x409134['alias'];if(!_0x1d042a||!_0x409134['operationType']||!_0x409134['functionNode'])throw CliErrors['validation'](_0x3a54a7(0x110)+_0x409134[_0x3a54a7(0x10e)]);const _0x303652=_0x739c38['aliasToDatasetCode']['get'](_0x1d042a)??_0x4ec386?.[_0x3a54a7(0xfb)]??_0x1d042a,_0xf4c3d3=_0x739c38[_0x3a54a7(0x120)][_0x3a54a7(0x10f)](_0x303652);if(!_0xf4c3d3)throw CliErrors[_0x3a54a7(0x124)](_0x3a54a7(0xfd)+_0x1d042a+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x3a54a7(0xf5)));_0x18a507[_0x3a54a7(0x11a)]=_0xf4c3d3,_0x18a507[_0x3a54a7(0xe5)]=_0x409134[_0x3a54a7(0xe5)],_0x18a507[_0x3a54a7(0x10d)]=_0x409134['functionNode'];}const _0x2af3d3=await saveBffScript(_0x18a507),_0x2ec014=await getBffScriptInfo(_0x2af3d3),_0x4df43f={'hash':_0xcbcd5c,'remoteId':_0x2af3d3,'version':_0x2ec014[_0x3a54a7(0x11e)]};if(_0x409134[_0x3a54a7(0xe8)]===_0x3a54a7(0xfc)){const _0x3bf89a=_0x409134[_0x3a54a7(0x11d)],_0x20a8c3=_0x739c38['aliasToDatasetCode'][_0x3a54a7(0x10f)](_0x3bf89a)??_0x4ec386?.[_0x3a54a7(0xfb)]??_0x3bf89a;_0x739c38['aliasToDatasetCode'][_0x3a54a7(0xf3)](_0x3bf89a)?_0x4df43f['alias']=_0x3bf89a:_0x4df43f[_0x3a54a7(0x11d)]=_0x4ec386?.[_0x3a54a7(0x11d)],_0x4df43f['datasetCode']=_0x20a8c3,_0x4df43f[_0x3a54a7(0xe5)]=_0x409134[_0x3a54a7(0xe5)],_0x4df43f[_0x3a54a7(0x10d)]=_0x409134[_0x3a54a7(0x10d)];}_0x415508[_0x3a54a7(0x105)][_0x409134[_0x3a54a7(0x10e)]]=_0x4df43f;}
|
|
1
|
+
const a31_0x5c70a6=a31_0xf08a;(function(_0x14f291,_0x3f6a55){const _0xd72b32=a31_0xf08a,_0x3f2184=_0x14f291();while(!![]){try{const _0x44b5e7=-parseInt(_0xd72b32(0x1c7))/0x1*(-parseInt(_0xd72b32(0x194))/0x2)+-parseInt(_0xd72b32(0x1c2))/0x3*(parseInt(_0xd72b32(0x1ae))/0x4)+-parseInt(_0xd72b32(0x1b7))/0x5+-parseInt(_0xd72b32(0x1c6))/0x6*(-parseInt(_0xd72b32(0x19c))/0x7)+parseInt(_0xd72b32(0x1b1))/0x8*(-parseInt(_0xd72b32(0x1a2))/0x9)+-parseInt(_0xd72b32(0x1bf))/0xa*(parseInt(_0xd72b32(0x199))/0xb)+-parseInt(_0xd72b32(0x184))/0xc*(-parseInt(_0xd72b32(0x18d))/0xd);if(_0x44b5e7===_0x3f6a55)break;else _0x3f2184['push'](_0x3f2184['shift']());}catch(_0x4014d5){_0x3f2184['push'](_0x3f2184['shift']());}}}(a31_0x4db4,0xa532b));function a31_0xf08a(_0x15f3c2,_0x371ceb){_0x15f3c2=_0x15f3c2-0x180;const _0x4db4c1=a31_0x4db4();let _0xf08a0=_0x4db4c1[_0x15f3c2];return _0xf08a0;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a31_0x4db4(){const _0x445065=['would_push','alias','name','Run\x20`','Push\x20complete:\x20','ENDPOINT','123206lkgNub','apiDir','toISOString','Cannot\x20resolve\x20dataset\x20for\x20\x22','code','1760lUsyIX','Push\x20local\x20BFF\x20scripts\x20to\x20remote','set','3861501GLMPgz','POST','HOOK','create','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','appCode','180zSWQNC',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Force\x20push\x20ignoring\x20hash\x20protection','description','string','/api/management/library/scripts/save','No\x20local\x20BFF\x20functions\x20found.','length','version','unchanged','push','utf8','3584516MsxypS','\x20failed','\x22.\x20','134800kNlidL','\x20skipped,\x20','force','\x20local\x20BFF\x20script(s)\x20for\x20push','get','lockKey','5436955deesXB','str','operationType','functionNode','lockFilePath','validation','datasetCode','\x20uploaded,\x20','36960Advfry','COMMON','bool','3YDSLUc','lastSync','Local\x20function\x20not\x20found:\x20','bff','6ptylfu','8TeIuTH','some','has','datasetCodeToId','values','Incomplete\x20HOOK\x20path:\x20','remoteId','datasetId','type','functions','filter','1524nhkkzz','scriptsRoot','update','boolean','high-risk-write','aliasToDatasetCode','hash','message','filePath','260416lhBhbI'];a31_0x4db4=function(){return _0x445065;};return a31_0x4db4();}export const bffPush={'service':a31_0x5c70a6(0x1c5),'command':a31_0x5c70a6(0x1ac),'description':a31_0x5c70a6(0x19a),'risk':a31_0x5c70a6(0x188),'flags':[{'name':a31_0x5c70a6(0x181),'type':a31_0x5c70a6(0x1a6),'description':'Push\x20only\x20this\x20script\x20type','enum':[a31_0x5c70a6(0x1c0),a31_0x5c70a6(0x193),a31_0x5c70a6(0x19e)]},{'name':a31_0x5c70a6(0x190),'type':a31_0x5c70a6(0x1a6),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a31_0x5c70a6(0x1b3),'type':a31_0x5c70a6(0x187),'description':a31_0x5c70a6(0x1a4)}],async 'dryRun'(_0x2fd8e1){const _0x2dcdea=a31_0x5c70a6,_0x1a34a5=loadBffProjectConfig(_0x2fd8e1[_0x2dcdea(0x1a1)]),_0x3084fc=await readBffLockFile(_0x1a34a5[_0x2dcdea(0x1bb)]),{appLock:_0x2387e9}=ensureLockScope(_0x3084fc??createEmptyBffLock(),_0x2fd8e1[_0x2dcdea(0x1a1)],_0x1a34a5['scriptsRoot'],'push'),_0x21bed5=await getTargetFunctions(_0x1a34a5,_0x2fd8e1),_0x5273c1=_0x2fd8e1[_0x2dcdea(0x1c1)](_0x2dcdea(0x1b3)),_0x239bed=[];for(const _0x5c9212 of _0x21bed5){const _0x4ca812=await computeFileHash(_0x5c9212[_0x2dcdea(0x18c)]),_0x3a57e5=_0x2387e9['functions'][_0x5c9212[_0x2dcdea(0x1b6)]],_0xaac1b5=!!_0x3a57e5&&_0x3a57e5['hash']===_0x4ca812;_0x239bed[_0x2dcdea(0x1ac)]({'lockKey':_0x5c9212[_0x2dcdea(0x1b6)],'filePath':_0x5c9212[_0x2dcdea(0x18c)],'remoteId':_0x3a57e5?.[_0x2dcdea(0x1cd)]??null,'mode':_0x3a57e5?.['remoteId']?_0x2dcdea(0x186):_0x2dcdea(0x19f),'status':!_0x5273c1&&_0xaac1b5?'unchanged':_0x2dcdea(0x18e)});}return{'method':_0x2dcdea(0x19d),'url':_0x2dcdea(0x1a7),'body':{'appCode':_0x2fd8e1[_0x2dcdea(0x1a1)],'force':_0x5273c1,'files':_0x239bed},'description':'Would\x20inspect\x20'+_0x239bed[_0x2dcdea(0x1a9)]+_0x2dcdea(0x1b4)};},async 'execute'(_0x34363b){const _0x238c06=a31_0x5c70a6,_0xfeb754=loadBffProjectConfig(_0x34363b['appCode']),_0xbc5c35=await readBffLockFile(_0xfeb754[_0x238c06(0x1bb)]),{lockData:_0x22d91b,appLock:_0x382117}=ensureLockScope(_0xbc5c35??createEmptyBffLock(),_0x34363b[_0x238c06(0x1a1)],_0xfeb754[_0x238c06(0x185)],_0x238c06(0x1ac)),_0x8d8072=await getTargetFunctions(_0xfeb754,_0x34363b);if(_0x8d8072[_0x238c06(0x1a9)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x238c06(0x1a8)};const _0x13440f=_0x34363b[_0x238c06(0x1c1)](_0x238c06(0x1b3)),_0x1415d2=await buildHookMaps(_0x34363b[_0x238c06(0x1a1)],_0x34363b[_0x238c06(0x195)],_0x8d8072,_0x382117),_0x1aab74=[],_0x2255e8=[],_0x5e95bc=[];for(const _0x2e7970 of _0x8d8072){const _0x2c1025=await computeFileHash(_0x2e7970['filePath']),_0x4d08a1=_0x382117[_0x238c06(0x182)][_0x2e7970[_0x238c06(0x1b6)]];if(!_0x13440f&&_0x4d08a1&&_0x4d08a1[_0x238c06(0x18a)]===_0x2c1025){_0x2255e8[_0x238c06(0x1ac)]({'lockKey':_0x2e7970[_0x238c06(0x1b6)],'reason':_0x238c06(0x1ab)});continue;}try{await uploadSingleFunction(_0x34363b[_0x238c06(0x1a1)],_0x2e7970,_0x382117,_0x1415d2);const _0x367010=_0x382117[_0x238c06(0x182)][_0x2e7970['lockKey']];_0x1aab74[_0x238c06(0x1ac)]({'lockKey':_0x2e7970[_0x238c06(0x1b6)],'remoteId':_0x367010?.[_0x238c06(0x1cd)]??0x0});}catch(_0x2b3f23){_0x5e95bc['push']({'lockKey':_0x2e7970[_0x238c06(0x1b6)],'error':_0x2b3f23 instanceof Error?_0x2b3f23[_0x238c06(0x18b)]:String(_0x2b3f23)});}}return _0x382117[_0x238c06(0x1c3)]=new Date()[_0x238c06(0x196)](),await writeBffLockFile(_0xfeb754[_0x238c06(0x1bb)],_0x22d91b),{'ok':_0x5e95bc[_0x238c06(0x1a9)]===0x0,'data':{'uploaded':_0x1aab74,'skipped':_0x2255e8,'failed':_0x5e95bc},'message':_0x238c06(0x192)+_0x1aab74['length']+_0x238c06(0x1be)+_0x2255e8['length']+_0x238c06(0x1b2)+_0x5e95bc[_0x238c06(0x1a9)]+_0x238c06(0x1af)};}};async function getTargetFunctions(_0x5ef6e4,_0x2ed0f3){const _0x20767e=a31_0x5c70a6,_0x17a78e=_0x2ed0f3['str'](_0x20767e(0x181)),_0x4fd8fd=_0x2ed0f3[_0x20767e(0x1b8)](_0x20767e(0x190)),_0x47da63=normalizeBffType(_0x17a78e)??undefined;if(_0x4fd8fd&&!_0x47da63)throw CliErrors[_0x20767e(0x1bc)](_0x20767e(0x1a0));const _0x230d4b=await scanLocalBffFunctions(_0x5ef6e4,_0x47da63);if(_0x4fd8fd){const _0x548e78=_0x230d4b[_0x20767e(0x183)](_0x2d5a51=>_0x2d5a51['name']===_0x4fd8fd);if(_0x548e78[_0x20767e(0x1a9)]===0x0)throw CliErrors[_0x20767e(0x1bc)](_0x20767e(0x1c4)+_0x47da63+'/'+_0x4fd8fd);return _0x548e78;}return _0x230d4b;}async function buildHookMaps(_0x2770c3,_0xaedf23,_0x354d89,_0x3e05fb){const _0x438bfe=a31_0x5c70a6,_0x4de63b=_0x354d89[_0x438bfe(0x1c8)](_0x5760fd=>_0x5760fd['type']==='HOOK');if(!_0x4de63b)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x21b82=loadAliasMap(_0xaedf23,undefined,resolveApiFilePath(_0xaedf23,_0x2770c3)),_0xa2f33e=new Map(_0x21b82['map'](_0x1b30ad=>[_0x1b30ad[_0x438bfe(0x18f)],_0x1b30ad[_0x438bfe(0x1bd)]]));for(const _0x194301 of Object[_0x438bfe(0x1cb)](_0x3e05fb['functions'])){_0x194301['alias']&&_0x194301['datasetCode']&&!_0xa2f33e[_0x438bfe(0x1c9)](_0x194301['alias'])&&_0xa2f33e[_0x438bfe(0x19b)](_0x194301[_0x438bfe(0x18f)],_0x194301[_0x438bfe(0x1bd)]);}const _0x42379a=await listDatasets(_0x2770c3),_0x85c8a4=new Map(_0x42379a['map'](_0x3dcf07=>[_0x3dcf07[_0x438bfe(0x198)],_0x3dcf07['id']]));return{'aliasToDatasetCode':_0xa2f33e,'datasetCodeToId':_0x85c8a4};}async function uploadSingleFunction(_0x154de9,_0x1e0101,_0x2cdf16,_0x4d685f){const _0x4d664a=a31_0x5c70a6,_0x286c4d=await readFile(_0x1e0101[_0x4d664a(0x18c)],_0x4d664a(0x1ad)),_0x1aae03=await computeFileHash(_0x1e0101[_0x4d664a(0x18c)]),_0x491db5=_0x2cdf16[_0x4d664a(0x182)][_0x1e0101[_0x4d664a(0x1b6)]];if(_0x491db5?.[_0x4d664a(0x1cd)]&&_0x491db5[_0x4d664a(0x1aa)]==null)throw CliErrors[_0x4d664a(0x1bc)](_0x1e0101['lockKey']+_0x4d664a(0x1a3));let _0x327c36=extractScriptDescription(_0x286c4d);if(!_0x327c36&&_0x491db5?.['remoteId']){const _0x5e9977=await getBffScriptInfo(_0x491db5[_0x4d664a(0x1cd)]);_0x327c36=_0x5e9977[_0x4d664a(0x1a5)]||undefined;}const _0x347ea2={'appCode':_0x154de9,'functionName':_0x1e0101[_0x4d664a(0x190)],'scriptType':_0x1e0101[_0x4d664a(0x181)],'scriptContent':_0x286c4d};if(_0x491db5?.['remoteId'])_0x347ea2['id']=_0x491db5[_0x4d664a(0x1cd)];if(_0x491db5?.[_0x4d664a(0x1aa)]!=null)_0x347ea2[_0x4d664a(0x1aa)]=_0x491db5[_0x4d664a(0x1aa)];if(_0x327c36)_0x347ea2[_0x4d664a(0x1a5)]=_0x327c36;if(_0x1e0101[_0x4d664a(0x181)]==='HOOK'){const _0x5cb722=_0x1e0101[_0x4d664a(0x18f)];if(!_0x5cb722||!_0x1e0101['operationType']||!_0x1e0101[_0x4d664a(0x1ba)])throw CliErrors['validation'](_0x4d664a(0x1cc)+_0x1e0101['lockKey']);const _0x27314b=_0x4d685f['aliasToDatasetCode']['get'](_0x5cb722)??_0x491db5?.[_0x4d664a(0x1bd)]??_0x5cb722,_0x12717d=_0x4d685f[_0x4d664a(0x1ca)][_0x4d664a(0x1b5)](_0x27314b);if(!_0x12717d)throw CliErrors[_0x4d664a(0x1bc)](_0x4d664a(0x197)+_0x5cb722+_0x4d664a(0x1b0)+(_0x4d664a(0x191)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x347ea2[_0x4d664a(0x180)]=_0x12717d,_0x347ea2[_0x4d664a(0x1b9)]=_0x1e0101[_0x4d664a(0x1b9)],_0x347ea2[_0x4d664a(0x1ba)]=_0x1e0101['functionNode'];}const _0x1d7fff=await saveBffScript(_0x347ea2),_0xadf21=await getBffScriptInfo(_0x1d7fff),_0x3889d9={'hash':_0x1aae03,'remoteId':_0x1d7fff,'version':_0xadf21[_0x4d664a(0x1aa)]};if(_0x1e0101[_0x4d664a(0x181)]===_0x4d664a(0x19e)){const _0x6b993f=_0x1e0101[_0x4d664a(0x18f)],_0xa2c3a0=_0x4d685f[_0x4d664a(0x189)]['get'](_0x6b993f)??_0x491db5?.['datasetCode']??_0x6b993f;_0x4d685f[_0x4d664a(0x189)]['has'](_0x6b993f)?_0x3889d9[_0x4d664a(0x18f)]=_0x6b993f:_0x3889d9[_0x4d664a(0x18f)]=_0x491db5?.[_0x4d664a(0x18f)],_0x3889d9['datasetCode']=_0xa2c3a0,_0x3889d9[_0x4d664a(0x1b9)]=_0x1e0101['operationType'],_0x3889d9[_0x4d664a(0x1ba)]=_0x1e0101['functionNode'];}_0x2cdf16['functions'][_0x1e0101[_0x4d664a(0x1b6)]]=_0x3889d9;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x2032eb=a32_0x1727;(function(_0x5861d2,_0xc197e3){const _0x9aa66f=a32_0x1727,_0x212cba=_0x5861d2();while(!![]){try{const _0x58f2b1=parseInt(_0x9aa66f(0xff))/0x1*(parseInt(_0x9aa66f(0xfb))/0x2)+parseInt(_0x9aa66f(0xf8))/0x3*(-parseInt(_0x9aa66f(0x107))/0x4)+parseInt(_0x9aa66f(0x111))/0x5*(-parseInt(_0x9aa66f(0x105))/0x6)+parseInt(_0x9aa66f(0x110))/0x7+-parseInt(_0x9aa66f(0x112))/0x8*(parseInt(_0x9aa66f(0x10d))/0x9)+-parseInt(_0x9aa66f(0x10f))/0xa+parseInt(_0x9aa66f(0x11a))/0xb;if(_0x58f2b1===_0xc197e3)break;else _0x212cba['push'](_0x212cba['shift']());}catch(_0x1d45d9){_0x212cba['push'](_0x212cba['shift']());}}}(a32_0x3ff4,0x3ca46));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a32_0x3ff4(){const _0x443dd6=['11514547CaggNI','6SmaoXe','alias','map','4fosQnC','scriptsRoot','\x20modified,\x20','bool','50458TrXQpy','functions','boolean','lockFilePath','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','status','798ZufQmQ','lockKey','445972pdduHI','\x20added,\x20','datasetCode','hash','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','length','20394sLnOZB','bff','2530910JNYGDz','517349HcAOQR','14515Qpckpc','392FvfWnk','All\x20BFF\x20scripts\x20are\x20in\x20sync.','apiDir','push','remote','\x20remote-only','appCode','has'];a32_0x3ff4=function(){return _0x443dd6;};return a32_0x3ff4();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a32_0x1727(_0x16b8f1,_0x14b1f7){_0x16b8f1=_0x16b8f1-0xf8;const _0x3ff4da=a32_0x3ff4();let _0x172724=_0x3ff4da[_0x16b8f1];return _0x172724;}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a32_0x2032eb(0x10e),'command':a32_0x2032eb(0x104),'description':a32_0x2032eb(0x10b),'risk':'read','flags':[{'name':a32_0x2032eb(0x116),'type':a32_0x2032eb(0x101),'description':a32_0x2032eb(0x103)}],async 'execute'(_0x24cead){const _0x40fe0f=a32_0x2032eb,_0x42e65f=loadBffProjectConfig(_0x24cead['appCode']),_0x3161ce=await readBffLockFile(_0x42e65f[_0x40fe0f(0x102)]),{appLock:_0x4a10d3}=ensureLockScope(_0x3161ce??createEmptyBffLock(),_0x24cead[_0x40fe0f(0x118)],_0x42e65f[_0x40fe0f(0xfc)],_0x40fe0f(0x104)),_0x27879d=await scanLocalBffFunctions(_0x42e65f),_0x514392=[],_0x5b7f2b=[],_0xfb4b08=[];for(const _0x3c12d1 of _0x27879d){const _0x29ed5d=await computeFileHash(_0x3c12d1['filePath']),_0x1035a5=_0x4a10d3[_0x40fe0f(0x100)][_0x3c12d1[_0x40fe0f(0x106)]];if(!_0x1035a5)_0x514392[_0x40fe0f(0x115)](_0x3c12d1[_0x40fe0f(0x106)]);else _0x1035a5[_0x40fe0f(0x10a)]!==_0x29ed5d?_0x5b7f2b[_0x40fe0f(0x115)](_0x3c12d1[_0x40fe0f(0x106)]):_0xfb4b08[_0x40fe0f(0x115)](_0x3c12d1[_0x40fe0f(0x106)]);}const _0x22e760=[];if(_0x24cead[_0x40fe0f(0xfe)](_0x40fe0f(0x116))){const _0x2fbf84=loadAliasMap(_0x24cead['apiDir'],undefined,resolveApiFilePath(_0x24cead[_0x40fe0f(0x114)],_0x24cead[_0x40fe0f(0x118)])),_0x59b573=new Map(_0x2fbf84[_0x40fe0f(0xfa)](_0xe89974=>[_0xe89974[_0x40fe0f(0x109)],_0xe89974[_0x40fe0f(0xf9)]])),[_0x323425,_0x59032e]=await Promise['all']([listBffScripts(_0x24cead[_0x40fe0f(0x118)]),getBffScriptStatistics(_0x24cead[_0x40fe0f(0x118)])]),_0x59feb6=createHookLocationMap(_0x59032e),_0x7db605=new Set(_0x27879d['map'](_0x11c2e3=>_0x11c2e3[_0x40fe0f(0x106)]));for(const _0x43afcd of _0x323425){const _0x270c50=resolveRemoteScriptTarget(_0x42e65f,_0x43afcd,_0x59feb6,_0x4a10d3[_0x40fe0f(0x100)],_0x59b573);_0x270c50&&!_0x7db605[_0x40fe0f(0x119)](_0x270c50['lockKey'])&&_0x22e760[_0x40fe0f(0x115)](_0x270c50[_0x40fe0f(0x106)]);}}const _0x20ee49=_0x514392['length']===0x0&&_0x5b7f2b[_0x40fe0f(0x10c)]===0x0&&_0x22e760[_0x40fe0f(0x10c)]===0x0;return{'ok':!![],'data':{'added':_0x514392,'modified':_0x5b7f2b,'unchanged':_0xfb4b08,'remoteOnly':_0x22e760},'message':_0x20ee49?_0x40fe0f(0x113):_0x514392[_0x40fe0f(0x10c)]+_0x40fe0f(0x108)+_0x5b7f2b[_0x40fe0f(0x10c)]+_0x40fe0f(0xfd)+_0xfb4b08[_0x40fe0f(0x10c)]+'\x20unchanged'+(_0x22e760[_0x40fe0f(0x10c)]>0x0?',\x20'+_0x22e760[_0x40fe0f(0x10c)]+_0x40fe0f(0x117):'')};}};
|