@lovrabet/rabetbase-cli 2.0.9 → 2.0.11
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 -0
- 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 +2 -2
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a19_0x1cb5(_0x410bc1,_0x40a9a5){_0x410bc1=_0x410bc1-0x1b5;const _0x431ec1=a19_0x431e();let _0x1cb5ab=_0x431ec1[_0x410bc1];return _0x1cb5ab;}const a19_0x349b41=a19_0x1cb5;(function(_0x143d1d,_0x4becf2){const _0x2bfec1=a19_0x1cb5,_0x40c301=_0x143d1d();while(!![]){try{const _0x29d6c2=-parseInt(_0x2bfec1(0x1c4))/0x1+-parseInt(_0x2bfec1(0x1bf))/0x2*(-parseInt(_0x2bfec1(0x1b7))/0x3)+parseInt(_0x2bfec1(0x1b8))/0x4*(-parseInt(_0x2bfec1(0x1c6))/0x5)+-parseInt(_0x2bfec1(0x1bc))/0x6*(-parseInt(_0x2bfec1(0x1c8))/0x7)+-parseInt(_0x2bfec1(0x1bb))/0x8+-parseInt(_0x2bfec1(0x1ba))/0x9+parseInt(_0x2bfec1(0x1c5))/0xa;if(_0x29d6c2===_0x4becf2)break;else _0x40c301['push'](_0x40c301['shift']());}catch(_0x30e0ae){_0x40c301['push'](_0x40c301['shift']());}}}(a19_0x431e,0xd76e8));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';function a19_0x431e(){const _0x44bfc7=['5nvWrBD','entries','7ZhelGE','globalConfig','length','locale','app','riskLevel','apps','accessKey','apiDir','List\x20all\x20configured\x20apps','appcode','2834271TMSWXn','4465724MbATaW','object','13570461xtGtzM','10781720KmAbIq','9502734jsQViA','No\x20apps\x20configured.\x20Use\x20`','list','2gCMNQp','map','projectPath','read','cookie','1451771TuUDse','37776080uSfPdb'];a19_0x431e=function(){return _0x44bfc7;};return a19_0x431e();}async function execute(_0x2f45db){const _0x586c78=a19_0x1cb5,{config:_0x253de6,layers:_0x1f054b}=readRawConfigWithLayers(),{apps:apps={},defaultApp:_0x42c58f,currentApp:_0x374f14}=_0x253de6,_0x28c235=Object[_0x586c78(0x1c7)](apps),_0x1838b8=_0x1f054b[_0x586c78(0x1c9)][_0x586c78(0x1ce)]&&typeof _0x1f054b['globalConfig'][_0x586c78(0x1ce)]===_0x586c78(0x1b9)?_0x1f054b[_0x586c78(0x1c9)][_0x586c78(0x1ce)]:{},_0x3ec5a3=_0x1f054b['projectConfig'][_0x586c78(0x1ce)]&&typeof _0x1f054b['projectConfig'][_0x586c78(0x1ce)]===_0x586c78(0x1b9)?_0x1f054b['projectConfig'][_0x586c78(0x1ce)]:{};if(_0x28c235[_0x586c78(0x1ca)]===0x0){const _0x1d8c2d=_0x253de6[_0x586c78(0x1b6)];if(_0x1d8c2d)return{'ok':!![],'data':{'mode':'single-app','appcode':_0x1d8c2d,'env':_0x253de6['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':_0x586c78(0x1bd)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x41653d=resolveDefaultAppSource(_0x1f054b),_0x2c17f3=_0x28c235[_0x586c78(0x1c0)](([_0x565bbf,_0x6b4bea])=>({'name':_0x565bbf,'appcode':_0x6b4bea[_0x586c78(0x1b6)],'definedIn':appDefinedIn(_0x565bbf,_0x1838b8,_0x3ec5a3),'isDefault':_0x565bbf===_0x42c58f,'isCurrent':_0x565bbf===(_0x374f14??_0x42c58f),'env':_0x6b4bea['env']??null,'apiDir':_0x6b4bea[_0x586c78(0x1d0)]??null,'hasCookie':!!_0x6b4bea[_0x586c78(0x1c3)],'hasAccessKey':!!_0x6b4bea[_0x586c78(0x1cf)],'format':_0x6b4bea['format']??null,'pageSize':_0x6b4bea['pageSize']??null,'riskLevel':_0x6b4bea[_0x586c78(0x1cd)]??null,'locale':_0x6b4bea[_0x586c78(0x1cb)]??null}));return{'ok':!![],'data':{'items':_0x2c17f3,'meta':{'globalPath':_0x1f054b['globalPath']??null,'projectPath':_0x1f054b[_0x586c78(0x1c1)]??null,'defaultApp':_0x42c58f??null,'defaultAppSource':_0x42c58f!=null?_0x41653d:null}}};}export const appListDefinition={'service':a19_0x349b41(0x1cc),'command':a19_0x349b41(0x1be),'description':a19_0x349b41(0x1b5),'risk':a19_0x349b41(0x1c2),'requiresAuth':![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x30935f=a20_0x28e1;(function(_0x575d3c,_0x4768cf){const _0x259dbd=a20_0x28e1,_0x3b295c=_0x575d3c();while(!![]){try{const _0x467893=parseInt(_0x259dbd(0x17b))/0x1*(parseInt(_0x259dbd(0x173))/0x2)+parseInt(_0x259dbd(0x180))/0x3+-parseInt(_0x259dbd(0x181))/0x4*(-parseInt(_0x259dbd(0x187))/0x5)+parseInt(_0x259dbd(0x17a))/0x6*(-parseInt(_0x259dbd(0x17e))/0x7)+parseInt(_0x259dbd(0x179))/0x8*(-parseInt(_0x259dbd(0x174))/0x9)+parseInt(_0x259dbd(0x175))/0xa*(-parseInt(_0x259dbd(0x17d))/0xb)+-parseInt(_0x259dbd(0x184))/0xc*(-parseInt(_0x259dbd(0x188))/0xd);if(_0x467893===_0x4768cf)break;else _0x3b295c['push'](_0x3b295c['shift']());}catch(_0xf8068d){_0x3b295c['push'](_0x3b295c['shift']());}}}(a20_0x206a,0xbb9ce));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x35905c){const _0x259f59=a20_0x28e1,{setActiveCookie:_0x288d71}=await import(_0x259f59(0x185));_0x288d71(_0x35905c[_0x259f59(0x17f)]);const _0x1f1a26=await listRemoteApps(),_0x4760c0=_0x1f1a26[_0x259f59(0x17c)](_0x3385b2=>({..._0x3385b2['id']!=null?{'id':_0x3385b2['id']}:{},'appCode':_0x3385b2[_0x259f59(0x176)],'appName':_0x3385b2[_0x259f59(0x178)],..._0x3385b2[_0x259f59(0x177)]!=null?{'appDesc':_0x3385b2[_0x259f59(0x177)]}:{}}));return{'ok':!![],'data':_0x4760c0};}function a20_0x206a(){const _0x2c982f=['appName','8UXuDYa','18gaeweN','227apPeir','map','174999IjuZaE','1404459PJzqAU','cookie','3660615WHFXNY','4rfJJuN','remote','read','26299788WbuRFk','../../core/api-client.js','List\x20apps\x20available\x20on\x20the\x20platform','3414135kMkbJj','13hQoOYL','1486NRiuqO','13293612mTcBue','890gZPSPT','appCode','appDesc'];a20_0x206a=function(){return _0x2c982f;};return a20_0x206a();}function a20_0x28e1(_0x5f0f69,_0x5cabe5){_0x5f0f69=_0x5f0f69-0x173;const _0x206a3a=a20_0x206a();let _0x28e1f3=_0x206a3a[_0x5f0f69];return _0x28e1f3;}export const appRemoteDefinition={'service':'app','command':a20_0x30935f(0x182),'description':a20_0x30935f(0x186),'risk':a20_0x30935f(0x183),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a21_0x4a77(){const _0x1f6bd8=['bool','2468907NkLqfK','Use\x20global\x20config\x20scope','2603148qyahLm','remove','args','\x20app\x20remove\x20<name>\x20[--global]','\x22\x20still\x20defined\x20in\x20','global','24034440hXQYik','trim','globalConfig','length','\x20config.','7219182ohoCgP','keys','project','2351520pWHKKv','App\x20\x22','boolean','validation','both','apps','projectConfig','Usage:\x20','Removed\x20app\x20\x22','App\x20profile\x20name\x20to\x20remove','\x20Default\x20app\x20changed\x20to\x20\x22','defaultApp','1524255yVSdDJ','app','object','\x20Note:\x20app\x20\x22','\x22\x20not\x20found.','Missing\x20app\x20name.','name','5VfXyqg','4569573oAHKiv'];a21_0x4a77=function(){return _0x1f6bd8;};return a21_0x4a77();}const a21_0xa051b4=a21_0x1d4f;(function(_0x292f5c,_0x3223ad){const _0x2ec24d=a21_0x1d4f,_0x73a9e0=_0x292f5c();while(!![]){try{const _0xc0c1e=-parseInt(_0x2ec24d(0x1dd))/0x1+-parseInt(_0x2ec24d(0x1d1))/0x2+parseInt(_0x2ec24d(0x1bf))/0x3+parseInt(_0x2ec24d(0x1c3))/0x4+-parseInt(_0x2ec24d(0x1be))/0x5*(parseInt(_0x2ec24d(0x1ce))/0x6)+-parseInt(_0x2ec24d(0x1c1))/0x7+parseInt(_0x2ec24d(0x1c9))/0x8;if(_0xc0c1e===_0x3223ad)break;else _0x73a9e0['push'](_0x73a9e0['shift']());}catch(_0x16b498){_0x73a9e0['push'](_0x73a9e0['shift']());}}}(a21_0x4a77,0xe1302));import{CliErrors}from'../../errors.js';function a21_0x1d4f(_0x43f803,_0x410137){_0x43f803=_0x43f803-0x1bc;const _0x4a772f=a21_0x4a77();let _0x1d4f03=_0x4a772f[_0x43f803];return _0x1d4f03;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x3eed70){const _0xa18c1=a21_0x1d4f,_0x32dcec=_0x3eed70[_0xa18c1(0x1c5)][0x0]?.['trim']();if(!_0x32dcec)throw CliErrors[_0xa18c1(0x1d4)](_0xa18c1(0x1bc),_0xa18c1(0x1d8)+CLI_BIN_NAME+_0xa18c1(0x1c6));}async function execute(_0x499fbf){const _0x4c45f5=a21_0x1d4f,_0x58ef3e=_0x499fbf[_0x4c45f5(0x1c5)][0x0]?.[_0x4c45f5(0x1ca)]();if(!_0x58ef3e)throw CliErrors['validation'](_0x4c45f5(0x1bc),_0x4c45f5(0x1d8)+CLI_BIN_NAME+_0x4c45f5(0x1c6));const _0x13ccdd=_0x499fbf[_0x4c45f5(0x1c0)](_0x4c45f5(0x1c8)),{config:_0xdea45a,layers:_0x18488d}=readRawConfigWithLayers(),_0x99ffa1=_0xdea45a['apps']??{};if(!_0x99ffa1[_0x58ef3e])throw CliErrors[_0x4c45f5(0x1d4)](_0x4c45f5(0x1d2)+_0x58ef3e+'\x22\x20not\x20found.');const _0x499540=_0x18488d['globalConfig'][_0x4c45f5(0x1d6)]&&typeof _0x18488d[_0x4c45f5(0x1cb)][_0x4c45f5(0x1d6)]==='object'?_0x18488d[_0x4c45f5(0x1cb)]['apps']:{},_0x570937=_0x18488d[_0x4c45f5(0x1d7)][_0x4c45f5(0x1d6)]&&typeof _0x18488d['projectConfig'][_0x4c45f5(0x1d6)]===_0x4c45f5(0x1df)?_0x18488d['projectConfig'][_0x4c45f5(0x1d6)]:{},_0x5bba59=appDefinedIn(_0x58ef3e,_0x499540,_0x570937),_0xa6c163=resolveAppScopeForWrite(_0x58ef3e,_0x13ccdd,_0x18488d),_0x5372d0={'global':_0xa6c163===_0x4c45f5(0x1c8)},_0x505539=readConfig(_0x5372d0),_0x5b384b=_0x505539['apps'];if(!_0x5b384b||!_0x5b384b[_0x58ef3e])throw CliErrors[_0x4c45f5(0x1d4)](_0x4c45f5(0x1d2)+_0x58ef3e+_0x4c45f5(0x1e1));delete _0x5b384b[_0x58ef3e];let _0x3b7737='';if(_0x505539[_0x4c45f5(0x1dc)]===_0x58ef3e){const _0x5190f7=Object[_0x4c45f5(0x1cf)](_0x5b384b);_0x505539[_0x4c45f5(0x1dc)]=_0x5190f7[_0x4c45f5(0x1cc)]>0x0?_0x5190f7[0x0]:undefined,_0x505539[_0x4c45f5(0x1dc)]?_0x3b7737=_0x4c45f5(0x1db)+_0x505539[_0x4c45f5(0x1dc)]+'\x22.':delete _0x505539[_0x4c45f5(0x1dc)];}Object[_0x4c45f5(0x1cf)](_0x5b384b)[_0x4c45f5(0x1cc)]===0x0&&(delete _0x505539[_0x4c45f5(0x1d6)],delete _0x505539['defaultApp']);writeConfig(_0x505539,_0x5372d0);const _0x1ea85c=_0x5bba59===_0x4c45f5(0x1d5)?_0x4c45f5(0x1e0)+_0x58ef3e+_0x4c45f5(0x1c7)+(_0xa6c163==='project'?_0x4c45f5(0x1c8):_0x4c45f5(0x1d0))+_0x4c45f5(0x1cd):'';return{'ok':!![],'message':_0x4c45f5(0x1d9)+_0x58ef3e+'\x22'+scopeLabel(_0x5372d0)+'.'+_0x3b7737+_0x1ea85c};}export const appRemoveDefinition={'service':a21_0xa051b4(0x1de),'command':a21_0xa051b4(0x1c4),'description':'Remove\x20an\x20app\x20from\x20config','risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0xa051b4(0x1bd),'description':a21_0xa051b4(0x1da),'required':!![]}],'flags':[{'name':a21_0xa051b4(0x1c8),'type':a21_0xa051b4(0x1d3),'description':a21_0xa051b4(0x1c2),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d4cea,_0x5623df){const _0x59b713=a22_0xce6d,_0x9967a3=_0x5d4cea();while(!![]){try{const _0x535468=-parseInt(_0x59b713(0x66))/0x1*(-parseInt(_0x59b713(0x72))/0x2)+-parseInt(_0x59b713(0x81))/0x3+parseInt(_0x59b713(0x80))/0x4+parseInt(_0x59b713(0x84))/0x5*(-parseInt(_0x59b713(0x83))/0x6)+-parseInt(_0x59b713(0x75))/0x7*(parseInt(_0x59b713(0x7a))/0x8)+-parseInt(_0x59b713(0x85))/0x9+parseInt(_0x59b713(0x82))/0xa;if(_0x535468===_0x5623df)break;else _0x9967a3['push'](_0x9967a3['shift']());}catch(_0x51df94){_0x9967a3['push'](_0x9967a3['shift']());}}}(a22_0x2ab6,0xd1d5f));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x2bed85,_0x3ae7e1,_0x22aac9){const _0x4936a0=a22_0xce6d;if(_0x3ae7e1)return _0x4936a0(0x76);const _0x3a32b1=_0x22aac9[_0x4936a0(0x73)][_0x4936a0(0x7b)]&&typeof _0x22aac9[_0x4936a0(0x73)][_0x4936a0(0x7b)]==='object'?_0x22aac9[_0x4936a0(0x73)][_0x4936a0(0x7b)]:{},_0x2c757c=_0x22aac9['globalConfig'][_0x4936a0(0x7b)]&&typeof _0x22aac9[_0x4936a0(0x70)][_0x4936a0(0x7b)]==='object'?_0x22aac9[_0x4936a0(0x70)][_0x4936a0(0x7b)]:{};if(Object[_0x4936a0(0x7c)][_0x4936a0(0x6d)]['call'](_0x3a32b1,_0x2bed85))return'project';if(Object['prototype'][_0x4936a0(0x6d)][_0x4936a0(0x74)](_0x2c757c,_0x2bed85))return _0x4936a0(0x76);return _0x4936a0(0x77);}export function appDefinedIn(_0x5c5a30,_0x3687ff,_0x3d891d){const _0x105629=a22_0xce6d,_0x2e1401=Object['prototype'][_0x105629(0x6d)][_0x105629(0x74)](_0x3687ff,_0x5c5a30),_0x24856b=Object[_0x105629(0x7c)][_0x105629(0x6d)]['call'](_0x3d891d,_0x5c5a30);if(_0x2e1401&&_0x24856b)return _0x105629(0x69);if(_0x24856b)return'project';return _0x105629(0x76);}export function resolveDefaultAppSource(_0x14dbf2){const _0x4509c6=a22_0xce6d,_0x214f98=_0x14dbf2[_0x4509c6(0x73)]['apps']&&typeof _0x14dbf2[_0x4509c6(0x73)][_0x4509c6(0x7b)]===_0x4509c6(0x7d)?_0x14dbf2[_0x4509c6(0x73)][_0x4509c6(0x7b)]:{};if('defaultApp'in _0x14dbf2[_0x4509c6(0x73)])return _0x4509c6(0x77);if(Object[_0x4509c6(0x6e)](_0x214f98)[_0x4509c6(0x65)]>0x0)return _0x4509c6(0x77);if(_0x14dbf2[_0x4509c6(0x70)]['defaultApp'])return'global';return null;}export function getConfigPath(_0x6caa88={}){const _0x4ed68d=a22_0xce6d,_0x55504f=_0x6caa88[_0x4ed68d(0x76)]?'global':_0x4ed68d(0x77);return resolveWriteConfigPath(_0x55504f);}export function readConfig(_0x5344b6={}){return readConfigFile(getConfigPath(_0x5344b6));}export function writeConfig(_0x35be0b,_0x7b2753={}){writeConfigFile(getConfigPath(_0x7b2753),_0x35be0b);}export function scopeLabel(_0x5cd12c){const _0xd7db59=a22_0xce6d;return _0x5cd12c[_0xd7db59(0x76)]?_0xd7db59(0x6f):'';}function a22_0x2ab6(){const _0x511ce1=['hasOwnProperty','keys','\x20(global)','globalConfig','log','6QXfvpa','projectConfig','call','63kllvic','global','project','defaultApp','format','233672buuVai','apps','prototype','object','app','cookie','6372388FtpsPv','238203dQDSNL','13668450WYqYak','24svMDpl','1073765LgqciQ','13098141frBrEa','env','length','185396JFWphz','locale','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','both','accessKey','appcode','pageSize'];a22_0x2ab6=function(){return _0x511ce1;};return a22_0x2ab6();}function a22_0xce6d(_0x506b99,_0x58ca65){_0x506b99=_0x506b99-0x65;const _0x2ab66f=a22_0x2ab6();let _0xce6db4=_0x2ab66f[_0x506b99];return _0xce6db4;}export function migrateLegacySingleApp(_0x4ca29e,_0x4904db){const _0x2db399=a22_0xce6d,_0x1b7905=_0x4ca29e[_0x2db399(0x6b)]||_0x4ca29e[_0x2db399(0x7e)];if(!_0x1b7905)return;const _0xf31696=String(_0x1b7905);if(_0xf31696===_0x4904db)return;const _0x477d7b=[_0x2db399(0x86),'apiDir',_0x2db399(0x7f),_0x2db399(0x6a),_0x2db399(0x79),_0x2db399(0x6c),'riskLevel',_0x2db399(0x67)],_0x518a54={'appcode':_0x1b7905};for(const _0xa4388b of _0x477d7b){if(_0x4ca29e[_0xa4388b]!=null)_0x518a54[_0xa4388b]=_0x4ca29e[_0xa4388b];}_0x4ca29e[_0x2db399(0x7b)][_0xf31696]=_0x518a54,_0x4ca29e[_0x2db399(0x78)]=_0xf31696,delete _0x4ca29e['appcode'],delete _0x4ca29e['app'],console[_0x2db399(0x71)]('Migrated\x20existing\x20app\x20\x22'+_0xf31696+_0x2db399(0x68));}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x1765(_0x53268a,_0x5b1cb6){_0x53268a=_0x53268a-0x130;const _0x26c6fa=a23_0x26c6();let _0x1765e6=_0x26c6fa[_0x53268a];return _0x1765e6;}const a23_0x5fa593=a23_0x1765;(function(_0x5839cb,_0x399d20){const _0x42dfc3=a23_0x1765,_0x5d08e2=_0x5839cb();while(!![]){try{const _0x4d99f1=-parseInt(_0x42dfc3(0x13c))/0x1*(parseInt(_0x42dfc3(0x14f))/0x2)+-parseInt(_0x42dfc3(0x136))/0x3*(parseInt(_0x42dfc3(0x140))/0x4)+parseInt(_0x42dfc3(0x150))/0x5*(-parseInt(_0x42dfc3(0x132))/0x6)+-parseInt(_0x42dfc3(0x134))/0x7*(parseInt(_0x42dfc3(0x148))/0x8)+parseInt(_0x42dfc3(0x149))/0x9+parseInt(_0x42dfc3(0x14a))/0xa*(-parseInt(_0x42dfc3(0x139))/0xb)+parseInt(_0x42dfc3(0x151))/0xc;if(_0x4d99f1===_0x399d20)break;else _0x5d08e2['push'](_0x5d08e2['shift']());}catch(_0x5b1596){_0x5d08e2['push'](_0x5d08e2['shift']());}}}(a23_0x26c6,0x99756));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';async function validateArgs(_0x55fce7){const _0x3d68e6=a23_0x1765,_0xf4f67f=_0x55fce7[_0x3d68e6(0x142)][0x0]?.[_0x3d68e6(0x13b)]();if(!_0xf4f67f)throw CliErrors[_0x3d68e6(0x14d)]('Missing\x20app\x20name.',_0x3d68e6(0x145)+CLI_BIN_NAME+_0x3d68e6(0x135));}async function execute(_0x361c12){const _0x219e77=a23_0x1765,_0x349c90=_0x361c12['args'][0x0]?.[_0x219e77(0x13b)]();if(!_0x349c90)throw CliErrors[_0x219e77(0x14d)](_0x219e77(0x152),'Usage:\x20'+CLI_BIN_NAME+_0x219e77(0x135));const _0x25d6b4=_0x361c12[_0x219e77(0x133)](_0x219e77(0x14c)),{config:_0x12f8d3,layers:_0xfc26cd}=readRawConfigWithLayers(),_0x510f4c=_0x12f8d3[_0x219e77(0x147)]??{};if(!_0x510f4c[_0x349c90]){const _0x2d0d69=Object[_0x219e77(0x144)](_0x510f4c),_0x5121b4=_0x2d0d69[_0x219e77(0x13d)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x219e77(0x14b)+_0x349c90+_0x219e77(0x146):_0x219e77(0x137)+_0x2d0d69[_0x219e77(0x141)](',\x20');throw CliErrors['validation']('App\x20\x22'+_0x349c90+'\x22\x20not\x20found.',_0x5121b4);}const _0x873eed=resolveAppScopeForWrite(_0x349c90,_0x25d6b4,_0xfc26cd),_0x4d4bd0={'global':_0x873eed===_0x219e77(0x14c)},_0x44efc5=readConfig(_0x4d4bd0);return _0x44efc5[_0x219e77(0x131)]=_0x349c90,writeConfig(_0x44efc5,_0x4d4bd0),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x349c90+'\x22\x20(appcode:\x20'+_0x510f4c[_0x349c90][_0x219e77(0x130)]+')'+scopeLabel(_0x4d4bd0)};}function a23_0x26c6(){const _0x3a6ecd=['Available:\x20','use','13534301MsXOig','write','trim','10vBHCmA','length','name','Switch\x20the\x20default\x20app','4ebDKNq','join','args','Use\x20global\x20config\x20scope','keys','Usage:\x20','\x20--appcode\x20<code>`\x20first.','apps','4589472bwoSgv','3758166ipGUgs','10jYugWh','\x20app\x20add\x20','global','validation','boolean','206548AdEPwE','76885ziOldR','45962376YwroYv','Missing\x20app\x20name.','appcode','defaultApp','12SNoZyw','bool','14GjetND','\x20app\x20use\x20<name>\x20[--global]','533859AmXjsc'];a23_0x26c6=function(){return _0x3a6ecd;};return a23_0x26c6();}export const appUseDefinition={'service':'app','command':a23_0x5fa593(0x138),'description':a23_0x5fa593(0x13f),'risk':a23_0x5fa593(0x13a),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x5fa593(0x13e),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':a23_0x5fa593(0x14c),'type':a23_0x5fa593(0x14e),'description':a23_0x5fa593(0x143),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x3805(_0x305ff7,_0x4a1a1f){_0x305ff7=_0x305ff7-0x96;const _0x220275=a24_0x2202();let _0x38056f=_0x220275[_0x305ff7];return _0x38056f;}function a24_0x2202(){const _0x5e3c68=['950CnwKBn','11OnLokt','✓\x20Logged\x20out','2khaFzJ','12ulflPH','132UUDGgL','Clear\x20login\x20session','auth','98zabewa','1333510gOyiFa','9012bcRvQH','login','4287042QOcQfe','142624LhzcZY','188539mRoggn','log','logout','371193GEMHXt','read','91077uPlLvr','../../auth/auth-server-ui.js'];a24_0x2202=function(){return _0x5e3c68;};return a24_0x2202();}const a24_0x4f1e96=a24_0x3805;(function(_0x48c70e,_0x322021){const _0x136b12=a24_0x3805,_0x1ff5c7=_0x48c70e();while(!![]){try{const _0x3f6483=-parseInt(_0x136b12(0xa0))/0x1*(parseInt(_0x136b12(0xa5))/0x2)+-parseInt(_0x136b12(0x9e))/0x3*(-parseInt(_0x136b12(0xa6))/0x4)+parseInt(_0x136b12(0xa2))/0x5*(-parseInt(_0x136b12(0x97))/0x6)+-parseInt(_0x136b12(0xaa))/0x7*(parseInt(_0x136b12(0x9a))/0x8)+parseInt(_0x136b12(0x99))/0x9+-parseInt(_0x136b12(0x96))/0xa*(parseInt(_0x136b12(0xa3))/0xb)+-parseInt(_0x136b12(0xa7))/0xc*(-parseInt(_0x136b12(0x9b))/0xd);if(_0x3f6483===_0x322021)break;else _0x1ff5c7['push'](_0x1ff5c7['shift']());}catch(_0x1bdc70){_0x1ff5c7['push'](_0x1ff5c7['shift']());}}}(a24_0x2202,0x3c770));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a24_0x4f1e96(0xa9),'command':a24_0x4f1e96(0x98),'description':'Login\x20via\x20browser','risk':a24_0x4f1e96(0x9f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xdace72){const _0x6af83c=a24_0x4f1e96,{runAuthServer:_0x60530b}=await import(_0x6af83c(0xa1));return await _0x60530b(),{'ok':!![]};}},{'service':a24_0x4f1e96(0xa9),'command':a24_0x4f1e96(0x9d),'description':a24_0x4f1e96(0xa8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x480bbb){const _0x496982=a24_0x4f1e96;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x496982(0x9c)](_0x496982(0xa4))):console[_0x496982(0x9c)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x6a26f0=a25_0x2991;(function(_0x179f97,_0xfd17b4){const _0x1f950c=a25_0x2991,_0x4d8970=_0x179f97();while(!![]){try{const _0x12f25b=-parseInt(_0x1f950c(0x218))/0x1*(-parseInt(_0x1f950c(0x20f))/0x2)+-parseInt(_0x1f950c(0x20d))/0x3*(-parseInt(_0x1f950c(0x214))/0x4)+parseInt(_0x1f950c(0x1f3))/0x5+-parseInt(_0x1f950c(0x1ff))/0x6*(-parseInt(_0x1f950c(0x211))/0x7)+-parseInt(_0x1f950c(0x1f9))/0x8+parseInt(_0x1f950c(0x203))/0x9+parseInt(_0x1f950c(0x1fe))/0xa*(parseInt(_0x1f950c(0x1f8))/0xb);if(_0x12f25b===_0xfd17b4)break;else _0x4d8970['push'](_0x4d8970['shift']());}catch(_0x3f0b84){_0x4d8970['push'](_0x4d8970['shift']());}}}(a25_0x36aa,0x65587));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a25_0x36aa(){const _0x2c69c2=['20dpwPgL','283764RnoAMO','Would\x20delete\x20','startsWith','/api/management/library/scripts/delete','83403aarwOL','remoteId','str','lastSync','\x20\x20-\x20','length','validation','scriptsRoot','POST','join','3OltlOG','string','342274pJdYFv','functions','14iTcJIF','trashDir','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','116724AXnXBc','Multiple\x20functions\x20match\x20\x22','\x20(local\x20file\x20moved\x20to\x20trash)','bff','1feItau','No\x20lock\x20entry\x20found\x20for\x20\x22','keys','appCode','delete','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','BFF\x20lock\x20file\x20not\x20found.','2012395xLIiqu','lockFilePath','split','projectRoot','<timestamp>','2757733sLzjbW','6343576OezGWV','find','toISOString','Function\x20not\x20found:\x20','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local'];a25_0x36aa=function(){return _0x2c69c2;};return a25_0x36aa();}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';function a25_0x2991(_0x41b29c,_0x242845){_0x41b29c=_0x41b29c-0x1ee;const _0x36aa75=a25_0x36aa();let _0x299104=_0x36aa75[_0x41b29c];return _0x299104;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0x6a26f0(0x217),'command':a25_0x6a26f0(0x1f0),'description':a25_0x6a26f0(0x1fd),'risk':'high-risk-write','flags':[{'name':'target','type':a25_0x6a26f0(0x20e),'required':!![],'description':a25_0x6a26f0(0x1f1)}],async 'validate'(_0x46d9ad){const _0x53dc38=a25_0x6a26f0,_0x28aa5b=loadBffProjectConfig(_0x46d9ad['appCode']),_0x3b1bd9=await readBffLockFile(_0x28aa5b[_0x53dc38(0x1f4)]);if(!_0x3b1bd9)throw CliErrors[_0x53dc38(0x209)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x2433b1){const _0x1ac142=a25_0x6a26f0,_0xe896c1=loadBffProjectConfig(_0x2433b1[_0x1ac142(0x1ef)]),_0x2d79dd=await readBffLockFile(_0xe896c1[_0x1ac142(0x1f4)]);if(!_0x2d79dd)throw CliErrors[_0x1ac142(0x209)](_0x1ac142(0x1f2));const {appLock:_0x50c8a8}=ensureLockScope(_0x2d79dd,_0x2433b1[_0x1ac142(0x1ef)],_0xe896c1[_0x1ac142(0x20a)],_0x1ac142(0x1f0)),_0x5945d0=_0x2433b1[_0x1ac142(0x205)]('target'),_0x25af67=Object[_0x1ac142(0x1ee)](_0x50c8a8[_0x1ac142(0x210)]),_0x3f7772=resolveDeleteTarget(_0x5945d0,_0x25af67),_0x5540ff=_0x50c8a8[_0x1ac142(0x210)][_0x3f7772];if(!_0x5540ff)throw CliErrors[_0x1ac142(0x209)](_0x1ac142(0x219)+_0x3f7772+'\x22.');const _0x221b80=resolveLocalFilePathFromLockKey(_0xe896c1,_0x3f7772),_0x2deba5=relative(_0xe896c1[_0x1ac142(0x1f6)],_0x221b80),_0x4dc9a7=join(_0xe896c1[_0x1ac142(0x212)],_0x1ac142(0x1f7),_0x2deba5);return{'method':_0x1ac142(0x20b),'url':_0x1ac142(0x202),'body':{'appCode':_0x2433b1['appCode'],'target':_0x3f7772,'remoteId':_0x5540ff['remoteId'],'localFilePath':_0x221b80,'trashedPath':_0x4dc9a7},'description':_0x1ac142(0x200)+_0x3f7772+_0x1ac142(0x213)};},async 'execute'(_0x91c82){const _0x10fb5c=a25_0x6a26f0,_0x82db6e=loadBffProjectConfig(_0x91c82[_0x10fb5c(0x1ef)]),_0xc148bc=await readBffLockFile(_0x82db6e[_0x10fb5c(0x1f4)]);if(!_0xc148bc)throw CliErrors[_0x10fb5c(0x209)](_0x10fb5c(0x1f2));const {lockData:_0x2eeaca,appLock:_0x5b817e}=ensureLockScope(_0xc148bc,_0x91c82[_0x10fb5c(0x1ef)],_0x82db6e['scriptsRoot'],_0x10fb5c(0x1f0)),_0x50e355=_0x91c82[_0x10fb5c(0x205)]('target'),_0x96557c=Object['keys'](_0x5b817e[_0x10fb5c(0x210)]),_0x2afa2d=resolveDeleteTarget(_0x50e355,_0x96557c),_0x2b5ba4=_0x5b817e[_0x10fb5c(0x210)][_0x2afa2d];if(!_0x2b5ba4)throw CliErrors[_0x10fb5c(0x209)](_0x10fb5c(0x219)+_0x2afa2d+'\x22.');await deleteBffScript(_0x2b5ba4[_0x10fb5c(0x204)]),delete _0x5b817e['functions'][_0x2afa2d],_0x5b817e[_0x10fb5c(0x206)]=new Date()[_0x10fb5c(0x1fb)](),await writeBffLockFile(_0x82db6e[_0x10fb5c(0x1f4)],_0x2eeaca);const _0x1ea748=resolveLocalFilePathFromLockKey(_0x82db6e,_0x2afa2d);let _0x259afe;await fileExists(_0x1ea748)&&(_0x259afe=await moveToTrash(_0x82db6e[_0x10fb5c(0x1f6)],_0x82db6e['trashDir'],_0x1ea748),await cleanupEmptyDirectories(dirname(_0x1ea748),_0x82db6e['scriptsRootDir']));const _0x1b0484={'deleted':_0x2afa2d,'remoteId':_0x2b5ba4[_0x10fb5c(0x204)]};if(_0x259afe)_0x1b0484['trashedTo']=_0x259afe;return{'ok':!![],'data':_0x1b0484,'message':'Deleted\x20'+_0x2afa2d+(_0x259afe?_0x10fb5c(0x216):'')};}};function resolveDeleteTarget(_0x307089,_0x2c0075){const _0x19a39b=a25_0x6a26f0;if(_0x307089['includes']('/')){const _0x38035e=_0x2c0075[_0x19a39b(0x1fa)](_0x3a3c68=>_0x3a3c68===_0x307089);if(!_0x38035e)throw CliErrors[_0x19a39b(0x209)](_0x19a39b(0x1fc)+_0x307089);return _0x38035e;}const _0x585dd7=_0x2c0075['filter'](_0x269cd8=>_0x269cd8[_0x19a39b(0x1f5)]('/')['at'](-0x1)===_0x307089);if(_0x585dd7['length']===0x0)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x307089);if(_0x585dd7[_0x19a39b(0x208)]>0x1)throw CliErrors[_0x19a39b(0x209)](_0x19a39b(0x215)+_0x307089+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x585dd7['map'](_0x488b22=>_0x19a39b(0x207)+_0x488b22)[_0x19a39b(0x20c)]('\x0a'));return _0x585dd7[0x0];}async function moveToTrash(_0x1d0131,_0x396c83,_0x55bf28){const _0x22a50e=a25_0x6a26f0,_0x24a06f=new Date()[_0x22a50e(0x1fb)]()['replace'](/[:.]/g,'-'),_0x230475=relative(_0x1d0131,_0x55bf28),_0x2ccd1e=join(_0x396c83,_0x24a06f,_0x230475);return await mkdir(dirname(_0x2ccd1e),{'recursive':!![]}),await rename(_0x55bf28,_0x2ccd1e),_0x2ccd1e;}async function cleanupEmptyDirectories(_0x4c58fa,_0x2ee5f3){const _0x403adf=a25_0x6a26f0;let _0x340c34=resolve(_0x4c58fa);const _0xa1aede=resolve(_0x2ee5f3);while(_0x340c34[_0x403adf(0x201)](''+_0xa1aede+sep)||_0x340c34===_0xa1aede){if(_0x340c34===_0xa1aede)return;try{const _0x5086b6=await readdir(_0x340c34);if(_0x5086b6[_0x403adf(0x208)]>0x0)return;await rmdir(_0x340c34);}catch{return;}_0x340c34=dirname(_0x340c34);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x9068bf=a26_0x52a6;(function(_0x5b0189,_0x5427cc){const _0x43f0db=a26_0x52a6,_0xbe1a6b=_0x5b0189();while(!![]){try{const _0x3f0441=parseInt(_0x43f0db(0x96))/0x1*(parseInt(_0x43f0db(0x84))/0x2)+parseInt(_0x43f0db(0x82))/0x3+-parseInt(_0x43f0db(0x97))/0x4+-parseInt(_0x43f0db(0x89))/0x5*(-parseInt(_0x43f0db(0x98))/0x6)+-parseInt(_0x43f0db(0x83))/0x7*(parseInt(_0x43f0db(0x85))/0x8)+parseInt(_0x43f0db(0x94))/0x9*(parseInt(_0x43f0db(0x95))/0xa)+-parseInt(_0x43f0db(0x87))/0xb*(-parseInt(_0x43f0db(0x91))/0xc);if(_0x3f0441===_0x5427cc)break;else _0xbe1a6b['push'](_0xbe1a6b['shift']());}catch(_0x348f22){_0xbe1a6b['push'](_0xbe1a6b['shift']());}}}(a26_0x5a59,0x483e7));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a26_0x9068bf(0x8a),'flags':[{'name':'id','type':a26_0x9068bf(0x8f),'required':!![],'description':a26_0x9068bf(0x88)},{'name':a26_0x9068bf(0x93),'type':a26_0x9068bf(0x9a),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x13688c){const _0x5ec24c=a26_0x9068bf,_0x2155fa=await getBffScriptInfo(_0x13688c[_0x5ec24c(0x99)]('id')),_0x2993ba=_0x13688c[_0x5ec24c(0x8c)]('verbose');if(_0x2993ba)return{'ok':!![],'data':_0x2155fa};return{'ok':!![],'data':{'id':_0x2155fa['id'],'appCode':_0x2155fa[_0x5ec24c(0x8b)],'scriptType':_0x2155fa[_0x5ec24c(0x8d)],'description':_0x2155fa[_0x5ec24c(0x8e)]||_0x5ec24c(0x90),'createdTime':_0x2155fa[_0x5ec24c(0x86)]??'','updatedTime':_0x2155fa[_0x5ec24c(0x92)]??'','scriptContent':_0x2155fa['scriptContent']??''}};}};function a26_0x52a6(_0x2a6bcb,_0x38c224){_0x2a6bcb=_0x2a6bcb-0x82;const _0x5a59f6=a26_0x5a59();let _0x52a62d=_0x5a59f6[_0x2a6bcb];return _0x52a62d;}function a26_0x5a59(){const _0x5a4672=['166zLdPYH','467464UYPLps','createdTime','549769PUFJzi','Script\x20ID','190AMWkCa','read','appCode','bool','scriptType','description','number','(none)','60kaHIdo','updatedTime','verbose','70461jkrvMI','130WjGfsB','4531cOeHjy','1496312LwVWuC','54618SWZwwu','num','boolean','366681xtqfwn','63BSXplV'];a26_0x5a59=function(){return _0x5a4672;};return a26_0x5a59();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e0188,_0xdecf58){const _0x4e7100=a27_0x3611,_0x36ae00=_0x1e0188();while(!![]){try{const _0x1ccf07=-parseInt(_0x4e7100(0x9d))/0x1*(-parseInt(_0x4e7100(0xa2))/0x2)+parseInt(_0x4e7100(0xa4))/0x3+-parseInt(_0x4e7100(0x9a))/0x4*(parseInt(_0x4e7100(0x9c))/0x5)+parseInt(_0x4e7100(0xa3))/0x6*(parseInt(_0x4e7100(0xa1))/0x7)+parseInt(_0x4e7100(0xa5))/0x8+-parseInt(_0x4e7100(0x9e))/0x9*(-parseInt(_0x4e7100(0x9b))/0xa)+-parseInt(_0x4e7100(0x9f))/0xb*(parseInt(_0x4e7100(0xa0))/0xc);if(_0x1ccf07===_0xdecf58)break;else _0x36ae00['push'](_0x36ae00['shift']());}catch(_0x5d34d7){_0x36ae00['push'](_0x36ae00['shift']());}}}(a27_0x4e0a,0x24733));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';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';function a27_0x3611(_0x522f10,_0x5bcc93){_0x522f10=_0x522f10-0x9a;const _0x4e0a29=a27_0x4e0a();let _0x36118f=_0x4e0a29[_0x522f10];return _0x36118f;}function a27_0x4e0a(){const _0x4fc397=['2dOuDaD','138pvRvhB','395502tVAyxw','304632fAxPjM','820RBlbxL','10GrgSiG','4760xsHSiZ','255097FygSEE','66573CCfMWU','51249ZGiGgA','336IocSRn','12936dJagBy'];a27_0x4e0a=function(){return _0x4fc397;};return a27_0x4e0a();}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
|
+
const a28_0x118e6c=a28_0x30b9;function a28_0xd159(){const _0x3c7298=['str','No\x20BFF\x20scripts\x20found.','219571vAoIdI','Script\x20type\x20filter','110mpebNw','(unnamed)','174248njNhbv','List\x20BFF\x20scripts','63TWwEGt','Return\x20full\x20script\x20objects','Filter\x20by\x20script\x20name','name','ENDPOINT','1691135BZJluo','510223dPhlhj','6imlUET','COMMON','672304nPiLAy','functionName','106479qEXRDw','string','boolean','bff','verbose','appCode','list','116OxSKBH','description','length','14187XOFUWa','map','type','scriptType'];a28_0xd159=function(){return _0x3c7298;};return a28_0xd159();}(function(_0xc5b496,_0x2e6300){const _0x3dcf43=a28_0x30b9,_0x51e87f=_0xc5b496();while(!![]){try{const _0x5a9f5c=parseInt(_0x3dcf43(0x120))/0x1+parseInt(_0x3dcf43(0x13f))/0x2+-parseInt(_0x3dcf43(0x12a))/0x3*(parseInt(_0x3dcf43(0x127))/0x4)+parseInt(_0x3dcf43(0x13b))/0x5+-parseInt(_0x3dcf43(0x13d))/0x6*(parseInt(_0x3dcf43(0x13c))/0x7)+-parseInt(_0x3dcf43(0x134))/0x8*(parseInt(_0x3dcf43(0x136))/0x9)+-parseInt(_0x3dcf43(0x132))/0xa*(parseInt(_0x3dcf43(0x130))/0xb);if(_0x5a9f5c===_0x2e6300)break;else _0x51e87f['push'](_0x51e87f['shift']());}catch(_0x54c600){_0x51e87f['push'](_0x51e87f['shift']());}}}(a28_0xd159,0x30886));import{listBffScripts}from'../../core/api-client.js';function a28_0x30b9(_0x4c1f64,_0x48cc34){_0x4c1f64=_0x4c1f64-0x120;const _0xd1590b=a28_0xd159();let _0x30b969=_0xd1590b[_0x4c1f64];return _0x30b969;}export const bffList={'service':a28_0x118e6c(0x123),'command':a28_0x118e6c(0x126),'description':a28_0x118e6c(0x135),'risk':'read','flags':[{'name':a28_0x118e6c(0x12c),'type':a28_0x118e6c(0x121),'description':a28_0x118e6c(0x131),'default':a28_0x118e6c(0x13a),'enum':['ENDPOINT',a28_0x118e6c(0x13e)]},{'name':a28_0x118e6c(0x139),'type':a28_0x118e6c(0x121),'description':a28_0x118e6c(0x138)},{'name':'verbose','type':a28_0x118e6c(0x122),'description':a28_0x118e6c(0x137)}],async 'execute'(_0xa28532){const _0x18aefd=a28_0x118e6c,_0x42a09d=await listBffScripts(_0xa28532[_0x18aefd(0x125)],_0xa28532[_0x18aefd(0x12e)](_0x18aefd(0x12c)),{'scriptName':_0xa28532[_0x18aefd(0x12e)]('name')||undefined}),_0x2783e9=_0xa28532['bool'](_0x18aefd(0x124));return{'ok':!![],'data':_0x2783e9?_0x42a09d:_0x42a09d[_0x18aefd(0x12b)](_0x4dc5ad=>({'id':_0x4dc5ad['id'],'functionName':_0x4dc5ad[_0x18aefd(0x140)]??'','description':_0x4dc5ad[_0x18aefd(0x128)]||_0x18aefd(0x133),'scriptType':_0x4dc5ad[_0x18aefd(0x12d)]})),'message':_0x42a09d[_0x18aefd(0x129)]===0x0?_0x18aefd(0x12f):undefined};}};
|
package/lib/commands/bff/new.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x11450f=a29_0x500f;(function(_0x1601f5,_0x51a92e){const _0x144ff9=a29_0x500f,_0x12ef5b=_0x1601f5();while(!![]){try{const _0x41d3dd=parseInt(_0x144ff9(0x18a))/0x1*(parseInt(_0x144ff9(0x1bd))/0x2)+-parseInt(_0x144ff9(0x1a4))/0x3+parseInt(_0x144ff9(0x185))/0x4*(parseInt(_0x144ff9(0x1a3))/0x5)+-parseInt(_0x144ff9(0x191))/0x6+parseInt(_0x144ff9(0x17b))/0x7+parseInt(_0x144ff9(0x187))/0x8+parseInt(_0x144ff9(0x1b3))/0x9*(-parseInt(_0x144ff9(0x19a))/0xa);if(_0x41d3dd===_0x51a92e)break;else _0x12ef5b['push'](_0x12ef5b['shift']());}catch(_0x19f9d6){_0x12ef5b['push'](_0x12ef5b['shift']());}}}(a29_0x1b9b,0xc06a2));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a29_0x1b9b(){const _0xee1e9d=['Available:\x20','nonInteractive','parseInt','bff','name','alias','functionNode','type','close','File\x20already\x20exists:\x20','251541VxIZln','operation-type','Available\x20aliases:\x20','map','Select\x20trigger\x20node:','datasetCode','string','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','HOOK','760504nungEh','join','Created\x20','.js','Alias\x20\x22','No\x20api.ts\x20found.\x20Run\x20`','length','tableName','str','\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','Script\x20description','apiDir','description','Invalid\x20function\x20name\x20\x22','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','function-node','\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','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','before','Invalid\x20dataset\x20selection.','isInteger','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','4342317dhoaKB','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','COMMON','ENDPOINT','\x20function:\x20','validation','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','265712bxNgbs','stderr','1570952RgUGQA','write','\x20api\x20pull`\x20to\x20refresh.','4mIaEPk','Select\x20operation\x20type:','appCode','\x22\x20not\x20found.\x20','operationType','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','datasetcode','6313722fvIyLS','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','find','after','question','Select\x20dataset:','\x0a\x20*\x20[触发节点]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','50XplADs','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20not\x20found\x20for\x20code\x20\x22','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','code','Operation\x20type\x20\x22','Function\x20name\x20(valid\x20JS\x20identifier)','Script\x20type','No\x20datasets\x20found\x20for\x20this\x20app.','35EreOCI','2467626hlpjCr','Operation\x20type\x20(HOOK\x20only)','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','utf8','TODO:\x20add\x20script\x20description'];a29_0x1b9b=function(){return _0xee1e9d;};return a29_0x1b9b();}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a29_0x500f(_0x36eca0,_0x390c12){_0x36eca0=_0x36eca0-0x16e;const _0x1b9be7=a29_0x1b9b();let _0x500fe2=_0x1b9be7[_0x36eca0];return _0x500fe2;}export const bffNew={'service':a29_0x11450f(0x1ac),'command':'new','description':a29_0x11450f(0x17c),'risk':a29_0x11450f(0x188),'flags':[{'name':a29_0x11450f(0x1b0),'type':a29_0x11450f(0x1b9),'required':!![],'enum':[a29_0x11450f(0x180),'ENDPOINT',a29_0x11450f(0x1bc)],'description':a29_0x11450f(0x1a1)},{'name':'name','type':a29_0x11450f(0x1b9),'required':!![],'description':a29_0x11450f(0x1a0)},{'name':a29_0x11450f(0x171),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x16f)},{'name':a29_0x11450f(0x1ae),'type':'string','description':a29_0x11450f(0x17d)},{'name':a29_0x11450f(0x190),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x192)},{'name':a29_0x11450f(0x1b4),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x1a5)},{'name':a29_0x11450f(0x174),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x19b),'enum':[a29_0x11450f(0x177),a29_0x11450f(0x195)]}],async 'validate'(_0x180efd){const _0x435b81=a29_0x11450f,_0x362920=_0x180efd['str']('name');if(!isValidBffFunctionName(_0x362920))throw CliErrors[_0x435b81(0x183)](_0x435b81(0x172)+_0x362920+_0x435b81(0x184));},async 'execute'(_0x28040e){const _0x1721b4=a29_0x11450f,_0x4184ba=loadBffProjectConfig(_0x28040e[_0x1721b4(0x18c)]),_0x3e1db6=_0x28040e[_0x1721b4(0x1c5)]('type'),_0x427c26=_0x28040e[_0x1721b4(0x1c5)](_0x1721b4(0x1ad)),_0x141ef5=_0x28040e[_0x1721b4(0x1c5)](_0x1721b4(0x171))||undefined,_0x3929ea=_0x3e1db6==='HOOK'?await resolveHookOptions(_0x4184ba,_0x28040e):undefined,_0x52584a=buildFilePath(_0x4184ba,_0x3e1db6,_0x427c26,_0x3929ea);if(await fileExists(_0x52584a))throw CliErrors[_0x1721b4(0x183)](_0x1721b4(0x1b2)+_0x52584a);await mkdir(dirname(_0x52584a),{'recursive':!![]});const _0x4a6dae=generateTemplate(_0x3e1db6,_0x427c26,_0x28040e['appCode'],_0x141ef5,_0x3929ea);await writeFile(_0x52584a,_0x4a6dae,_0x1721b4(0x1a7));const _0x3fc72c={'type':_0x3e1db6,'name':_0x427c26,'path':_0x52584a};if(_0x141ef5)_0x3fc72c[_0x1721b4(0x171)]=_0x141ef5;if(_0x3929ea){if(_0x3929ea['alias'])_0x3fc72c[_0x1721b4(0x1ae)]=_0x3929ea[_0x1721b4(0x1ae)];_0x3fc72c[_0x1721b4(0x1b8)]=_0x3929ea[_0x1721b4(0x1b8)],_0x3fc72c[_0x1721b4(0x18e)]=_0x3929ea[_0x1721b4(0x18e)],_0x3fc72c[_0x1721b4(0x1af)]=_0x3929ea[_0x1721b4(0x1af)];}return{'ok':!![],'data':_0x3fc72c,'message':_0x1721b4(0x1bf)+_0x3e1db6+_0x1721b4(0x182)+_0x427c26};}};async function resolveHookOptions(_0x372722,_0x5db312){const _0x1ff7bd=a29_0x11450f,_0x4fd558=loadAliasMap(_0x5db312[_0x1ff7bd(0x170)],undefined,resolveApiFilePath(_0x5db312[_0x1ff7bd(0x170)],_0x5db312[_0x1ff7bd(0x18c)])),_0x594e1a=_0x4fd558[_0x1ff7bd(0x1c3)]>0x0;let _0x2a5931,_0x187fad,_0x192230;const _0xe55b34=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x1ae)),_0x5eb18b=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x190));if(_0xe55b34){const _0x224ff6=resolveAlias(_0x5db312['apiDir'],_0xe55b34,undefined,resolveApiFilePath(_0x5db312[_0x1ff7bd(0x170)],_0x5db312[_0x1ff7bd(0x18c)]));if(!_0x224ff6){const _0x1e6762=_0x594e1a?_0x1ff7bd(0x1b5)+_0x4fd558['map'](_0xbf01a=>_0xbf01a[_0x1ff7bd(0x1ae)])['join'](',\x20'):_0x1ff7bd(0x1c2)+CLI_BIN_NAME+_0x1ff7bd(0x193);throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1c1)+_0xe55b34+_0x1ff7bd(0x18d)+_0x1e6762);}_0x2a5931=_0xe55b34,_0x187fad=_0x224ff6;}else{if(_0x5eb18b){_0x187fad=_0x5eb18b;const _0x10197a=_0x4fd558[_0x1ff7bd(0x194)](_0x5c91c0=>_0x5c91c0['datasetCode']===_0x5eb18b);_0x2a5931=_0x10197a?.[_0x1ff7bd(0x1ae)];}else{if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x19d));else{if(_0x594e1a){const _0x2963d4=_0x4fd558[_0x1ff7bd(0x1b6)](_0x56a391=>_0x56a391[_0x1ff7bd(0x1ae)]+'\x20('+_0x56a391[_0x1ff7bd(0x1c4)]+')'),_0x12eb25=await promptSelect('Select\x20dataset:',_0x2963d4),_0x2406c7=_0x4fd558[_0x12eb25];if(!_0x2406c7)throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x178));_0x2a5931=_0x2406c7['alias'],_0x187fad=_0x2406c7['datasetCode'];}else{const _0x30c4e2=await listDatasets(_0x5db312[_0x1ff7bd(0x18c)]);if(_0x30c4e2[_0x1ff7bd(0x1c3)]===0x0)throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1a2));const _0x42cffe=_0x30c4e2[_0x1ff7bd(0x1b6)](_0x2e34ab=>_0x2e34ab[_0x1ff7bd(0x1ad)]+'\x20('+_0x2e34ab[_0x1ff7bd(0x19e)]+')'),_0x3b2844=await promptSelect(_0x1ff7bd(0x197),_0x42cffe),_0x40f95d=_0x30c4e2[_0x3b2844];if(!_0x40f95d)throw CliErrors[_0x1ff7bd(0x183)]('Invalid\x20dataset\x20selection.');_0x187fad=_0x40f95d[_0x1ff7bd(0x19e)],_0x2a5931=undefined;}}}}const _0x13d743=await listDatasets(_0x5db312[_0x1ff7bd(0x18c)]),_0x4e55d7=_0x13d743[_0x1ff7bd(0x194)](_0x4ea44e=>_0x4ea44e[_0x1ff7bd(0x19e)]===_0x187fad);if(!_0x4e55d7)throw CliErrors['validation'](_0x1ff7bd(0x19c)+_0x187fad+'\x22.\x20'+(_0x2a5931?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x1ff7bd(0x189):''));_0x192230=_0x4e55d7['id'];const _0x3fbc40=_0x2a5931??_0x187fad,_0x3b0ee7=await listBffDatasetOperations(_0x5db312[_0x1ff7bd(0x18c)],_0x192230),_0x47a56b=_0x3b0ee7?Object['keys'](_0x3b0ee7):[];if(_0x47a56b[_0x1ff7bd(0x1c3)]===0x0)throw CliErrors['validation'](_0x1ff7bd(0x1bb)+_0x3fbc40+'.');let _0x12eb5b;const _0xafc729=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x1b4));if(_0xafc729){if(!_0x47a56b['includes'](_0xafc729))throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x19f)+_0xafc729+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x3fbc40+'.\x20'+(_0x1ff7bd(0x1a9)+_0x47a56b[_0x1ff7bd(0x1be)](',\x20')));_0x12eb5b=_0xafc729;}else{if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x51bfb8=await promptSelect(_0x1ff7bd(0x18b),_0x47a56b);_0x12eb5b=_0x47a56b[_0x51bfb8]??_0x47a56b[0x0];}let _0x516430=normalizeHookFunctionNode(_0x5db312[_0x1ff7bd(0x1c5)]('function-node'));if(!_0x516430){if(_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x174)))throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x18f));if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1ba));const _0x300675=await promptSelect(_0x1ff7bd(0x1b7),[_0x1ff7bd(0x177),_0x1ff7bd(0x195)]);_0x516430=[_0x1ff7bd(0x177),_0x1ff7bd(0x195)][_0x300675]??'before';}return{'alias':_0x2a5931,'datasetCode':_0x187fad,'datasetId':_0x192230,'operationType':_0x12eb5b,'functionNode':_0x516430};}async function promptSelect(_0x45ebec,_0x110d55){const _0x836c4e=a29_0x11450f;if(_0x110d55[_0x836c4e(0x1c3)]===0x1)return 0x0;for(const [_0x22cc05,_0x43ba3a]of _0x110d55['entries']()){process[_0x836c4e(0x186)][_0x836c4e(0x188)]('\x20\x20'+(_0x22cc05+0x1)+'.\x20'+_0x43ba3a+'\x0a');}const _0x3a761c=createInterface({'input':process['stdin'],'output':process[_0x836c4e(0x186)]});while(!![]){const _0x15b4a6=await new Promise(_0x26c14d=>{const _0x38937a=_0x836c4e;_0x3a761c[_0x38937a(0x196)](_0x45ebec+'\x20',_0x26c14d);}),_0x3adcbf=Number[_0x836c4e(0x1ab)](_0x15b4a6['trim'](),0xa);if(Number[_0x836c4e(0x179)](_0x3adcbf)&&_0x3adcbf>=0x1&&_0x3adcbf<=_0x110d55[_0x836c4e(0x1c3)])return _0x3a761c[_0x836c4e(0x1b1)](),_0x3adcbf-0x1;process[_0x836c4e(0x186)][_0x836c4e(0x188)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x110d55['length']+'.\x0a');}}function buildFilePath(_0x4e33ce,_0x4ddae2,_0x12611e,_0x3dd36a){const _0x1ced5f=a29_0x11450f;if(_0x4ddae2===_0x1ced5f(0x1bc)){if(!_0x3dd36a)throw CliErrors[_0x1ced5f(0x183)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x5710f3=_0x3dd36a['alias']??_0x3dd36a[_0x1ced5f(0x1b8)];return join(_0x4e33ce['scriptsRootDir'],'HOOK',_0x5710f3,_0x3dd36a[_0x1ced5f(0x18e)],_0x3dd36a['functionNode'],_0x12611e+'.js');}return join(_0x4e33ce['scriptsRootDir'],_0x4ddae2,_0x12611e+_0x1ced5f(0x1c0));}export function generateTemplate(_0x1f134f,_0x4a413b,_0x49edb3,_0x101082,_0x2a6db9){const _0x48c551=a29_0x11450f,_0x5d1f85=_0x101082?.['trim']()||_0x48c551(0x1a8);if(_0x1f134f===_0x48c551(0x180))return _0x48c551(0x173)+_0x5d1f85+'\x0a\x20*\x20[脚本名称]\x20'+_0x4a413b+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x4a413b+_0x48c551(0x17e)+_0x4a413b+_0x48c551(0x199);if(_0x1f134f===_0x48c551(0x181))return _0x48c551(0x176)+_0x5d1f85+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x49edb3+'/endpoint/'+_0x4a413b+_0x48c551(0x16e)+_0x4a413b+_0x48c551(0x199);if(!_0x2a6db9)throw CliErrors[_0x48c551(0x183)](_0x48c551(0x17a));return _0x48c551(0x1a6)+_0x5d1f85+_0x48c551(0x17f)+_0x49edb3+'/'+_0x2a6db9[_0x48c551(0x1b8)]+'/'+_0x2a6db9[_0x48c551(0x18e)]+_0x48c551(0x198)+_0x2a6db9[_0x48c551(0x1af)]+_0x48c551(0x175)+_0x4a413b+_0x48c551(0x199);}
|
|
1
|
+
const a29_0x47ba9a=a29_0x17a8;(function(_0x49741b,_0x372218){const _0x59ffc3=a29_0x17a8,_0x1d831c=_0x49741b();while(!![]){try{const _0x39c825=parseInt(_0x59ffc3(0x1f7))/0x1*(parseInt(_0x59ffc3(0x20f))/0x2)+parseInt(_0x59ffc3(0x1d1))/0x3+parseInt(_0x59ffc3(0x1fa))/0x4+-parseInt(_0x59ffc3(0x1fe))/0x5*(parseInt(_0x59ffc3(0x1fc))/0x6)+-parseInt(_0x59ffc3(0x1c8))/0x7*(parseInt(_0x59ffc3(0x1d5))/0x8)+-parseInt(_0x59ffc3(0x204))/0x9*(-parseInt(_0x59ffc3(0x1c9))/0xa)+-parseInt(_0x59ffc3(0x1f3))/0xb;if(_0x39c825===_0x372218)break;else _0x1d831c['push'](_0x1d831c['shift']());}catch(_0x5bc5e5){_0x1d831c['push'](_0x1d831c['shift']());}}}(a29_0x1cb8,0xa080e));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';function a29_0x1cb8(){const _0x4e3cb8=['appCode','before','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','scriptsRootDir','\x22\x20not\x20found.\x20','1589637eZrZak','length','find','bff','440KHIBqm','Available:\x20','description','Script\x20description','apiDir','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK','datasetCode','stderr','Invalid\x20function\x20name\x20\x22','after','HOOK\x20requires\x20alias/operation/node\x20options.','entries','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Select\x20operation\x20type:','operation-type','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','write','datasetcode','Invalid\x20dataset\x20selection.','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Available\x20aliases:\x20','/endpoint/','\x0a\x20*\x20[脚本名称]\x20','COMMON','join','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Select\x20trigger\x20node:','30027305SjCwax','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Select\x20dataset:','\x22.\x20','1307417RlZwez','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','close','1740736BBoSNZ','tableName','6tcXKRB','validation','365135ruwTvk','\x0a\x20*\x20[触发节点]\x20','Function\x20name\x20(valid\x20JS\x20identifier)','No\x20datasets\x20found\x20for\x20this\x20app.','ENDPOINT','File\x20already\x20exists:\x20','153477OcBDFm','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','utf8','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','stdin','question','Dataset\x20not\x20found\x20for\x20code\x20\x22','Created\x20','\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','2SAUaLQ','keys','code','new','operationType','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','function-node','alias','name','nonInteractive','.js','string','map','str','functionNode','7273ZUGGZf','730iuwtvb','trim','isInteger'];a29_0x1cb8=function(){return _0x4e3cb8;};return a29_0x1cb8();}import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x47ba9a(0x1d4),'command':a29_0x47ba9a(0x212),'description':a29_0x47ba9a(0x1e6),'risk':a29_0x47ba9a(0x1e7),'flags':[{'name':'type','type':a29_0x47ba9a(0x1c4),'required':!![],'enum':[a29_0x47ba9a(0x1ef),'ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a29_0x47ba9a(0x217),'type':a29_0x47ba9a(0x1c4),'required':!![],'description':a29_0x47ba9a(0x200)},{'name':a29_0x47ba9a(0x1d7),'type':a29_0x47ba9a(0x1c4),'description':a29_0x47ba9a(0x1d8)},{'name':a29_0x47ba9a(0x216),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':'string','description':a29_0x47ba9a(0x214)},{'name':a29_0x47ba9a(0x1e4),'type':a29_0x47ba9a(0x1c4),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a29_0x47ba9a(0x215),'type':a29_0x47ba9a(0x1c4),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a29_0x47ba9a(0x1cd),'after']}],async 'validate'(_0x36516c){const _0x27e33f=a29_0x47ba9a,_0x17ff35=_0x36516c[_0x27e33f(0x1c6)](_0x27e33f(0x217));if(!isValidBffFunctionName(_0x17ff35))throw CliErrors[_0x27e33f(0x1fd)](_0x27e33f(0x1de)+_0x17ff35+_0x27e33f(0x1f8));},async 'execute'(_0x3763b2){const _0xdc8f3b=a29_0x47ba9a,_0x54b70e=loadBffProjectConfig(_0x3763b2[_0xdc8f3b(0x1cc)]),_0x4e6e13=_0x3763b2[_0xdc8f3b(0x1c6)]('type'),_0x437c1d=_0x3763b2[_0xdc8f3b(0x1c6)](_0xdc8f3b(0x217)),_0x4af420=_0x3763b2['str'](_0xdc8f3b(0x1d7))||undefined,_0x24f3e5=_0x4e6e13===_0xdc8f3b(0x1db)?await resolveHookOptions(_0x54b70e,_0x3763b2):undefined,_0x501cfe=buildFilePath(_0x54b70e,_0x4e6e13,_0x437c1d,_0x24f3e5);if(await fileExists(_0x501cfe))throw CliErrors[_0xdc8f3b(0x1fd)](_0xdc8f3b(0x203)+_0x501cfe);await mkdir(dirname(_0x501cfe),{'recursive':!![]});const _0x5e12ef=generateTemplate(_0x4e6e13,_0x437c1d,_0x3763b2[_0xdc8f3b(0x1cc)],_0x4af420,_0x24f3e5);await writeFile(_0x501cfe,_0x5e12ef,_0xdc8f3b(0x206));const _0xa16716={'type':_0x4e6e13,'name':_0x437c1d,'path':_0x501cfe};if(_0x4af420)_0xa16716[_0xdc8f3b(0x1d7)]=_0x4af420;if(_0x24f3e5){if(_0x24f3e5[_0xdc8f3b(0x216)])_0xa16716[_0xdc8f3b(0x216)]=_0x24f3e5[_0xdc8f3b(0x216)];_0xa16716['datasetCode']=_0x24f3e5['datasetCode'],_0xa16716[_0xdc8f3b(0x213)]=_0x24f3e5[_0xdc8f3b(0x213)],_0xa16716[_0xdc8f3b(0x1c7)]=_0x24f3e5['functionNode'];}return{'ok':!![],'data':_0xa16716,'message':_0xdc8f3b(0x20d)+_0x4e6e13+'\x20function:\x20'+_0x437c1d};}};async function resolveHookOptions(_0x26dab3,_0x420e17){const _0x4be36a=a29_0x47ba9a,_0x25c280=loadAliasMap(_0x420e17[_0x4be36a(0x1d9)],undefined,resolveApiFilePath(_0x420e17[_0x4be36a(0x1d9)],_0x420e17[_0x4be36a(0x1cc)])),_0x2a5436=_0x25c280[_0x4be36a(0x1d2)]>0x0;let _0x41607a,_0x230597,_0x32dde4;const _0x48b4e2=_0x420e17[_0x4be36a(0x1c6)](_0x4be36a(0x216)),_0x2e24f3=_0x420e17[_0x4be36a(0x1c6)](_0x4be36a(0x1e8));if(_0x48b4e2){const _0x37395e=resolveAlias(_0x420e17[_0x4be36a(0x1d9)],_0x48b4e2,undefined,resolveApiFilePath(_0x420e17[_0x4be36a(0x1d9)],_0x420e17[_0x4be36a(0x1cc)]));if(!_0x37395e){const _0x27e742=_0x2a5436?_0x4be36a(0x1ec)+_0x25c280[_0x4be36a(0x1c5)](_0x4d0ad7=>_0x4d0ad7[_0x4be36a(0x216)])['join'](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x4be36a(0x207);throw CliErrors['validation']('Alias\x20\x22'+_0x48b4e2+_0x4be36a(0x1d0)+_0x27e742);}_0x41607a=_0x48b4e2,_0x230597=_0x37395e;}else{if(_0x2e24f3){_0x230597=_0x2e24f3;const _0x41c962=_0x25c280[_0x4be36a(0x1d3)](_0x2ef0a3=>_0x2ef0a3[_0x4be36a(0x1dc)]===_0x2e24f3);_0x41607a=_0x41c962?.[_0x4be36a(0x216)];}else{if(_0x420e17['nonInteractive'])throw CliErrors[_0x4be36a(0x1fd)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x2a5436){const _0x1055cd=_0x25c280[_0x4be36a(0x1c5)](_0x10df9c=>_0x10df9c['alias']+'\x20('+_0x10df9c[_0x4be36a(0x1fb)]+')'),_0x9da373=await promptSelect(_0x4be36a(0x1f5),_0x1055cd),_0x11d979=_0x25c280[_0x9da373];if(!_0x11d979)throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x1e9));_0x41607a=_0x11d979[_0x4be36a(0x216)],_0x230597=_0x11d979['datasetCode'];}else{const _0x2f8cb4=await listDatasets(_0x420e17[_0x4be36a(0x1cc)]);if(_0x2f8cb4[_0x4be36a(0x1d2)]===0x0)throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x201));const _0x504746=_0x2f8cb4[_0x4be36a(0x1c5)](_0x118db7=>_0x118db7['name']+'\x20('+_0x118db7[_0x4be36a(0x211)]+')'),_0x179ea8=await promptSelect(_0x4be36a(0x1f5),_0x504746),_0x52b08d=_0x2f8cb4[_0x179ea8];if(!_0x52b08d)throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x1e9));_0x230597=_0x52b08d[_0x4be36a(0x211)],_0x41607a=undefined;}}}}const _0x4ce62e=await listDatasets(_0x420e17[_0x4be36a(0x1cc)]),_0x21cced=_0x4ce62e[_0x4be36a(0x1d3)](_0xce186a=>_0xce186a['code']===_0x230597);if(!_0x21cced)throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x20c)+_0x230597+_0x4be36a(0x1f6)+(_0x41607a?_0x4be36a(0x205)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x32dde4=_0x21cced['id'];const _0x526188=_0x41607a??_0x230597,_0xf7f1b8=await listBffDatasetOperations(_0x420e17[_0x4be36a(0x1cc)],_0x32dde4),_0x106d6f=_0xf7f1b8?Object[_0x4be36a(0x210)](_0xf7f1b8):[];if(_0x106d6f['length']===0x0)throw CliErrors[_0x4be36a(0x1fd)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x526188+'.');let _0x2c27ff;const _0x3152b3=_0x420e17[_0x4be36a(0x1c6)](_0x4be36a(0x1e4));if(_0x3152b3){if(!_0x106d6f['includes'](_0x3152b3))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x3152b3+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x526188+'.\x20'+(_0x4be36a(0x1d6)+_0x106d6f[_0x4be36a(0x1f0)](',\x20')));_0x2c27ff=_0x3152b3;}else{if(_0x420e17[_0x4be36a(0x218)])throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x1da));const _0x260da7=await promptSelect(_0x4be36a(0x1e3),_0x106d6f);_0x2c27ff=_0x106d6f[_0x260da7]??_0x106d6f[0x0];}let _0x538578=normalizeHookFunctionNode(_0x420e17[_0x4be36a(0x1c6)](_0x4be36a(0x215)));if(!_0x538578){if(_0x420e17['str'](_0x4be36a(0x215)))throw CliErrors[_0x4be36a(0x1fd)](_0x4be36a(0x208));if(_0x420e17[_0x4be36a(0x218)])throw CliErrors[_0x4be36a(0x1fd)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x30e8b9=await promptSelect(_0x4be36a(0x1f2),[_0x4be36a(0x1cd),_0x4be36a(0x1df)]);_0x538578=[_0x4be36a(0x1cd),'after'][_0x30e8b9]??'before';}return{'alias':_0x41607a,'datasetCode':_0x230597,'datasetId':_0x32dde4,'operationType':_0x2c27ff,'functionNode':_0x538578};}function a29_0x17a8(_0x2f0162,_0x270d08){_0x2f0162=_0x2f0162-0x1c4;const _0x1cb891=a29_0x1cb8();let _0x17a867=_0x1cb891[_0x2f0162];return _0x17a867;}async function promptSelect(_0x2b5ac2,_0x197b2d){const _0x2e8083=a29_0x47ba9a;if(_0x197b2d[_0x2e8083(0x1d2)]===0x1)return 0x0;for(const [_0x1272c8,_0x4ef992]of _0x197b2d[_0x2e8083(0x1e1)]()){process['stderr'][_0x2e8083(0x1e7)]('\x20\x20'+(_0x1272c8+0x1)+'.\x20'+_0x4ef992+'\x0a');}const _0x4d4746=createInterface({'input':process[_0x2e8083(0x20a)],'output':process['stderr']});while(!![]){const _0x2ef9bc=await new Promise(_0x40fba6=>{const _0x2ed82b=_0x2e8083;_0x4d4746[_0x2ed82b(0x20b)](_0x2b5ac2+'\x20',_0x40fba6);}),_0x26bbe3=Number['parseInt'](_0x2ef9bc[_0x2e8083(0x1ca)](),0xa);if(Number[_0x2e8083(0x1cb)](_0x26bbe3)&&_0x26bbe3>=0x1&&_0x26bbe3<=_0x197b2d[_0x2e8083(0x1d2)])return _0x4d4746[_0x2e8083(0x1f9)](),_0x26bbe3-0x1;process[_0x2e8083(0x1dd)][_0x2e8083(0x1e7)](_0x2e8083(0x209)+_0x197b2d['length']+'.\x0a');}}function buildFilePath(_0x55b377,_0x350a8b,_0x38105f,_0x35e469){const _0x507b59=a29_0x47ba9a;if(_0x350a8b===_0x507b59(0x1db)){if(!_0x35e469)throw CliErrors[_0x507b59(0x1fd)](_0x507b59(0x1e0));const _0x12a912=_0x35e469['alias']??_0x35e469[_0x507b59(0x1dc)];return join(_0x55b377[_0x507b59(0x1cf)],_0x507b59(0x1db),_0x12a912,_0x35e469['operationType'],_0x35e469[_0x507b59(0x1c7)],_0x38105f+_0x507b59(0x219));}return join(_0x55b377[_0x507b59(0x1cf)],_0x350a8b,_0x38105f+'.js');}export function generateTemplate(_0x40f24d,_0x3eb606,_0x55147c,_0x4b89c2,_0x3e577d){const _0x27b6e9=a29_0x47ba9a,_0x50baa4=_0x4b89c2?.[_0x27b6e9(0x1ca)]()||'TODO:\x20add\x20script\x20description';if(_0x40f24d===_0x27b6e9(0x1ef))return _0x27b6e9(0x1e2)+_0x50baa4+_0x27b6e9(0x1ee)+_0x3eb606+_0x27b6e9(0x1f4)+_0x3eb606+'.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'+_0x3eb606+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x40f24d===_0x27b6e9(0x202))return _0x27b6e9(0x1ce)+_0x50baa4+_0x27b6e9(0x1f1)+_0x55147c+_0x27b6e9(0x1ed)+_0x3eb606+_0x27b6e9(0x1eb)+_0x3eb606+_0x27b6e9(0x1e5);if(!_0x3e577d)throw CliErrors[_0x27b6e9(0x1fd)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0x27b6e9(0x1ea)+_0x50baa4+_0x27b6e9(0x1f1)+_0x55147c+'/'+_0x3e577d['datasetCode']+'/'+_0x3e577d['operationType']+_0x27b6e9(0x1ff)+_0x3e577d['functionNode']+_0x27b6e9(0x20e)+_0x3eb606+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x135e60=a30_0xe939;(function(_0x250cd8,_0x23928f){const _0x524b0e=a30_0xe939,_0x2dfc4d=_0x250cd8();while(!![]){try{const _0x589e9c=-parseInt(_0x524b0e(0x155))/0x1*(parseInt(_0x524b0e(0x150))/0x2)+-parseInt(_0x524b0e(0x135))/0x3*(-parseInt(_0x524b0e(0x13f))/0x4)+parseInt(_0x524b0e(0x172))/0x5*(parseInt(_0x524b0e(0x13b))/0x6)+-parseInt(_0x524b0e(0x157))/0x7*(parseInt(_0x524b0e(0x15f))/0x8)+parseInt(_0x524b0e(0x12f))/0x9*(-parseInt(_0x524b0e(0x156))/0xa)+parseInt(_0x524b0e(0x134))/0xb+parseInt(_0x524b0e(0x14b))/0xc*(parseInt(_0x524b0e(0x14d))/0xd);if(_0x589e9c===_0x23928f)break;else _0x2dfc4d['push'](_0x2dfc4d['shift']());}catch(_0x4fd3ba){_0x2dfc4d['push'](_0x2dfc4d['shift']());}}}(a30_0x2b6c,0xeb51d));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a30_0xe939(_0x31bbbc,_0x902a){_0x31bbbc=_0x31bbbc-0x12d;const _0x2b6c69=a30_0x2b6c();let _0xe93927=_0x2b6c69[_0x31bbbc];return _0xe93927;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a30_0x2b6c(){const _0x1d65dd=['functionNode','1454994kzuKif','/api/management/library/scripts/list?appCode=','all','toLowerCase','lockKey','5747500DcNTOI','668532UIPQXX','local\x20unsynced\x20changes','push','apps','operationType','stdin','171222lTmRDV','functions','\x20skipped,\x20','bool','12aUwbTw','Remote\x20script\x20missing\x20id.','lockFilePath','Lock\x20scope\x20for\x20app\x20\x22','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','\x22\x20not\x20found\x20after\x20ensureLockScope.','hash','Pull\x20only\x20this\x20script\x20type','apiDir','force','string','No\x20remote\x20BFF\x20scripts\x20found.','2489808NjnyjJ','\x20pulled,\x20','91agczFg','unresolvable\x20target\x20path','appCode','2062RscXKc','bff','Remote\x20script\x20missing\x20content.','lastSync','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','227icBqfK','110xDbPpn','7AZYMoS','validation','HOOK','hookLocation','str','COMMON','Pull\x20complete:\x20','pull','6469344gjkcXJ','conflict','Force\x20pull\x20cancelled.','write','toISOString','yes','scriptsRoot','scriptType','close','Would\x20inspect\x20','filePath','functionName','utf8','ENDPOINT','scriptContent','type','alias','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','stderr','200KWrHQN','stringify','datasetCode','\x20remote\x20BFF\x20script(s)\x20for\x20pull','length','parse','includes','nonInteractive','question'];a30_0x2b6c=function(){return _0x1d65dd;};return a30_0x2b6c();}import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a30_0x135e60(0x151),'command':a30_0x135e60(0x15e),'description':a30_0x135e60(0x143),'risk':a30_0x135e60(0x162),'flags':[{'name':a30_0x135e60(0x16e),'type':a30_0x135e60(0x149),'description':a30_0x135e60(0x146),'enum':[a30_0x135e60(0x15c),a30_0x135e60(0x16c),a30_0x135e60(0x159)]},{'name':a30_0x135e60(0x148),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x3aa02d){const _0x4a69bd=a30_0x135e60,_0x183e7c=loadBffProjectConfig(_0x3aa02d[_0x4a69bd(0x14f)]),_0x36906d=await readBffLockFile(_0x183e7c[_0x4a69bd(0x141)]),{appLock:_0x274971}=ensureLockScope(_0x36906d??createEmptyBffLock(),_0x3aa02d[_0x4a69bd(0x14f)],_0x183e7c[_0x4a69bd(0x165)],'pull'),_0x375694=normalizeBffType(_0x3aa02d[_0x4a69bd(0x15b)](_0x4a69bd(0x16e)))??undefined,_0x345eec=buildDatasetCodeToAliasMap(_0x3aa02d[_0x4a69bd(0x147)],_0x3aa02d['appCode']),[_0x4d5ed0,_0x4f98ab]=await Promise[_0x4a69bd(0x131)]([listBffScripts(_0x3aa02d[_0x4a69bd(0x14f)],_0x375694),getBffScriptStatistics(_0x3aa02d[_0x4a69bd(0x14f)])]),_0x297ee3=createHookLocationMap(_0x4f98ab),_0x33c00b=[];for(const _0x50c9b8 of _0x4d5ed0){const _0x2e55a8=resolveRemoteScriptTarget(_0x183e7c,_0x50c9b8,_0x297ee3,_0x274971['functions'],_0x345eec);if(!_0x2e55a8){_0x33c00b[_0x4a69bd(0x137)]({'scriptType':_0x50c9b8[_0x4a69bd(0x166)],'functionName':_0x50c9b8[_0x4a69bd(0x16a)]??'','status':'skipped','reason':_0x4a69bd(0x14e)});continue;}const _0x115336=_0x274971[_0x4a69bd(0x13c)][_0x2e55a8[_0x4a69bd(0x133)]],_0x44ba0b=_0x50c9b8[_0x4a69bd(0x16d)]!=null?computeContentHash(_0x50c9b8[_0x4a69bd(0x16d)]):undefined,_0x363fff=await hasUnsyncedLocalChanges(_0x2e55a8[_0x4a69bd(0x169)],_0x115336,_0x44ba0b);_0x33c00b[_0x4a69bd(0x137)]({'lockKey':_0x2e55a8[_0x4a69bd(0x133)],'filePath':_0x2e55a8[_0x4a69bd(0x169)],'remoteId':_0x50c9b8['id']??null,'status':_0x363fff?_0x4a69bd(0x160):'would_pull'});}return{'method':'GET','url':_0x4a69bd(0x130)+_0x3aa02d['appCode']+(_0x375694?'&type='+_0x375694:''),'body':{'appCode':_0x3aa02d['appCode'],'filterType':_0x375694??null,'files':_0x33c00b},'description':_0x4a69bd(0x168)+_0x33c00b['length']+_0x4a69bd(0x175)};},async 'execute'(_0x3759c2){const _0x45ec08=a30_0x135e60,_0x55f6ec=loadBffProjectConfig(_0x3759c2['appCode']),_0x365712=await readBffLockFile(_0x55f6ec['lockFilePath']),{lockData:_0x53ba65,appLock:_0x23b33f}=ensureLockScope(_0x365712??createEmptyBffLock(),_0x3759c2[_0x45ec08(0x14f)],_0x55f6ec['scriptsRoot'],_0x45ec08(0x15e)),_0x374df3=normalizeBffType(_0x3759c2[_0x45ec08(0x15b)]('type'))??undefined;if(_0x3759c2['str'](_0x45ec08(0x16e))&&!_0x374df3)throw CliErrors[_0x45ec08(0x158)](_0x45ec08(0x170));const [_0x1e5989,_0x148334]=await Promise[_0x45ec08(0x131)]([listBffScripts(_0x3759c2['appCode'],_0x374df3),getBffScriptStatistics(_0x3759c2[_0x45ec08(0x14f)])]);if(_0x1e5989[_0x45ec08(0x176)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x45ec08(0x14a)};const _0x4f8270=_0x3759c2[_0x45ec08(0x13e)](_0x45ec08(0x148));if(_0x4f8270&&!_0x3759c2[_0x45ec08(0x179)]){const _0x2d226c=await confirmForce();if(!_0x2d226c)throw CliErrors['cancelled'](_0x45ec08(0x161));}if(_0x4f8270&&_0x3759c2[_0x45ec08(0x179)]){}const _0x465a11=buildDatasetCodeToAliasMap(_0x3759c2['apiDir'],_0x3759c2[_0x45ec08(0x14f)]),_0xace4e7=createHookLocationMap(_0x148334),_0x1306b2=JSON[_0x45ec08(0x177)](JSON[_0x45ec08(0x173)](_0x53ba65)),_0x3f2a73=_0x3759c2[_0x45ec08(0x14f)],_0x2d425b=_0x1306b2[_0x45ec08(0x138)][_0x3f2a73];if(!_0x2d425b)throw new Error(_0x45ec08(0x142)+_0x3f2a73+_0x45ec08(0x144));const _0x34e5df=[],_0x58dce5=[],_0x95f15c=[];for(const _0x1f3167 of _0x1e5989){const _0x3f264e=resolveRemoteScriptTarget(_0x55f6ec,_0x1f3167,_0xace4e7,_0x23b33f['functions'],_0x465a11);if(!_0x3f264e){_0x58dce5[_0x45ec08(0x137)]({'lockKey':_0x1f3167['scriptType']+'/'+_0x1f3167['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x40c230=_0x23b33f[_0x45ec08(0x13c)][_0x3f264e[_0x45ec08(0x133)]];try{if(!_0x1f3167['id'])throw new Error(_0x45ec08(0x140));if(_0x1f3167[_0x45ec08(0x16d)]==null)throw new Error(_0x45ec08(0x152));const _0x3394b6=_0x1f3167[_0x45ec08(0x16d)],_0x4ec10a=computeContentHash(_0x3394b6);if(!_0x4f8270){const _0x4d0ad9=await hasUnsyncedLocalChanges(_0x3f264e['filePath'],_0x40c230,_0x4ec10a);if(_0x4d0ad9){_0x58dce5[_0x45ec08(0x137)]({'lockKey':_0x3f264e[_0x45ec08(0x133)],'reason':_0x45ec08(0x136)});continue;}}await ensureParentDirectory(_0x3f264e['filePath']),await writeFile(_0x3f264e[_0x45ec08(0x169)],_0x3394b6,_0x45ec08(0x16b));const _0xf89a12={'hash':_0x4ec10a,'remoteId':_0x1f3167['id'],'version':_0x1f3167['version']};_0x3f264e[_0x45ec08(0x16e)]===_0x45ec08(0x159)&&_0x3f264e[_0x45ec08(0x15a)]&&(_0xf89a12[_0x45ec08(0x16f)]=_0x3f264e['hookLocation'][_0x45ec08(0x16f)],_0xf89a12[_0x45ec08(0x174)]=_0x3f264e[_0x45ec08(0x15a)][_0x45ec08(0x174)],_0xf89a12[_0x45ec08(0x139)]=_0x3f264e['hookLocation'][_0x45ec08(0x139)],_0xf89a12[_0x45ec08(0x12e)]=_0x3f264e[_0x45ec08(0x15a)]['functionNode']),_0x2d425b[_0x45ec08(0x13c)][_0x3f264e['lockKey']]=_0xf89a12,_0x34e5df[_0x45ec08(0x137)]({'lockKey':_0x3f264e[_0x45ec08(0x133)],'remoteId':_0x1f3167['id']});}catch(_0x567a5f){_0x95f15c['push']({'lockKey':_0x3f264e[_0x45ec08(0x133)],'error':_0x567a5f instanceof Error?_0x567a5f['message']:String(_0x567a5f)});}}return _0x2d425b[_0x45ec08(0x153)]=new Date()[_0x45ec08(0x163)](),await writeBffLockFile(_0x55f6ec[_0x45ec08(0x141)],_0x1306b2),{'ok':_0x95f15c[_0x45ec08(0x176)]===0x0,'data':{'pulled':_0x34e5df,'skipped':_0x58dce5,'failed':_0x95f15c},'message':_0x45ec08(0x15d)+_0x34e5df[_0x45ec08(0x176)]+_0x45ec08(0x14c)+_0x58dce5[_0x45ec08(0x176)]+_0x45ec08(0x13d)+_0x95f15c[_0x45ec08(0x176)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x56f6e0,_0x372a08,_0x1ca765){const _0x3d9749=a30_0x135e60;if(!await fileExists(_0x56f6e0))return![];const _0x20e80b=await computeFileHash(_0x56f6e0);if(!_0x372a08)return _0x1ca765?_0x20e80b!==_0x1ca765:!![];return _0x20e80b!==_0x372a08[_0x3d9749(0x145)];}function buildDatasetCodeToAliasMap(_0x33b0ff,_0x198850){const _0x584739=a30_0x135e60,_0x3ee8bc=loadAliasMap(_0x33b0ff,undefined,resolveApiFilePath(_0x33b0ff,_0x198850));return new Map(_0x3ee8bc['map'](_0x4a4f91=>[_0x4a4f91['datasetCode'],_0x4a4f91[_0x584739(0x16f)]]));}async function confirmForce(){const _0x28c363=a30_0x135e60,_0x2e25b5=createInterface({'input':process[_0x28c363(0x13a)],'output':process[_0x28c363(0x171)]}),_0x478e2a=await new Promise(_0x32e750=>{const _0x2df240=_0x28c363;_0x2e25b5[_0x2df240(0x12d)](_0x2df240(0x154),_0x32e750);});return _0x2e25b5[_0x28c363(0x167)](),['y',_0x28c363(0x164)][_0x28c363(0x178)](_0x478e2a['trim']()[_0x28c363(0x132)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x3bb0db=a31_0x2a90;(function(_0x3f18f4,_0xec4f4){const _0x3451e5=a31_0x2a90,_0x523a47=_0x3f18f4();while(!![]){try{const _0x59b8a4=parseInt(_0x3451e5(0x17f))/0x1+-parseInt(_0x3451e5(0x1c0))/0x2+-parseInt(_0x3451e5(0x18d))/0x3*(parseInt(_0x3451e5(0x19d))/0x4)+parseInt(_0x3451e5(0x1b8))/0x5+parseInt(_0x3451e5(0x18b))/0x6*(-parseInt(_0x3451e5(0x17e))/0x7)+parseInt(_0x3451e5(0x18a))/0x8*(-parseInt(_0x3451e5(0x195))/0x9)+-parseInt(_0x3451e5(0x193))/0xa*(-parseInt(_0x3451e5(0x190))/0xb);if(_0x59b8a4===_0xec4f4)break;else _0x523a47['push'](_0x523a47['shift']());}catch(_0x2d1694){_0x523a47['push'](_0x523a47['shift']());}}}(a31_0x48fb,0x6884b));function a31_0x2a90(_0x50e504,_0x5a9880){_0x50e504=_0x50e504-0x179;const _0x48fb3b=a31_0x48fb();let _0x2a906e=_0x48fb3b[_0x50e504];return _0x2a906e;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a31_0x48fb(){const _0x3ac01c=['\x20skipped,\x20','\x20failed','values','utf8','datasetCodeToId','487134lNFNug','high-risk-write','force','would_push','length','type','functions','scriptsRoot','Force\x20push\x20ignoring\x20hash\x20protection','3318427eJvdRZ','223690YhxYSy','datasetCode','lastSync','hash','name','Run\x20`',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Incomplete\x20HOOK\x20path:\x20','alias','filter','get','41512hIadCY','6NBNgAF','filePath','62232MwSOlO','unchanged','functionNode','34463NdIPDw','Would\x20inspect\x20','push','5970BqfFST','\x20uploaded,\x20','792jPkPLP','code','appCode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','bff','boolean','Local\x20function\x20not\x20found:\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','104cRyqJF','description','has','string','Cannot\x20resolve\x20dataset\x20for\x20\x22','datasetId','Push\x20only\x20this\x20script\x20type','version','create','message','Push\x20complete:\x20','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','No\x20local\x20BFF\x20functions\x20found.','lockKey','map','remoteId','aliasToDatasetCode','COMMON','operationType','HOOK','lockFilePath','POST','\x20local\x20BFF\x20script(s)\x20for\x20push','str','some','update','validation','238100nYGDLO','bool','Push\x20local\x20BFF\x20scripts\x20to\x20remote'];a31_0x48fb=function(){return _0x3ac01c;};return a31_0x48fb();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a31_0x3bb0db(0x199),'command':a31_0x3bb0db(0x192),'description':a31_0x3bb0db(0x1ba),'risk':a31_0x3bb0db(0x1c1),'flags':[{'name':a31_0x3bb0db(0x17a),'type':'string','description':a31_0x3bb0db(0x1a3),'enum':[a31_0x3bb0db(0x1ae),'ENDPOINT',a31_0x3bb0db(0x1b0)]},{'name':a31_0x3bb0db(0x183),'type':a31_0x3bb0db(0x1a0),'description':a31_0x3bb0db(0x1a8)},{'name':'force','type':a31_0x3bb0db(0x19a),'description':a31_0x3bb0db(0x17d)}],async 'dryRun'(_0x4be3a3){const _0x41a281=a31_0x3bb0db,_0x2ba28a=loadBffProjectConfig(_0x4be3a3['appCode']),_0x364139=await readBffLockFile(_0x2ba28a['lockFilePath']),{appLock:_0x2c04e0}=ensureLockScope(_0x364139??createEmptyBffLock(),_0x4be3a3['appCode'],_0x2ba28a[_0x41a281(0x17c)],_0x41a281(0x192)),_0x385c0d=await getTargetFunctions(_0x2ba28a,_0x4be3a3),_0xc78b2a=_0x4be3a3['bool']('force'),_0x3bb8a9=[];for(const _0x5aedfd of _0x385c0d){const _0x15bfe0=await computeFileHash(_0x5aedfd['filePath']),_0x16a172=_0x2c04e0[_0x41a281(0x17b)][_0x5aedfd['lockKey']],_0x42d695=!!_0x16a172&&_0x16a172[_0x41a281(0x182)]===_0x15bfe0;_0x3bb8a9[_0x41a281(0x192)]({'lockKey':_0x5aedfd['lockKey'],'filePath':_0x5aedfd['filePath'],'remoteId':_0x16a172?.['remoteId']??null,'mode':_0x16a172?.[_0x41a281(0x1ac)]?_0x41a281(0x1b6):_0x41a281(0x1a5),'status':!_0xc78b2a&&_0x42d695?_0x41a281(0x18e):_0x41a281(0x1c3)});}return{'method':_0x41a281(0x1b2),'url':'/api/management/library/scripts/save','body':{'appCode':_0x4be3a3[_0x41a281(0x197)],'force':_0xc78b2a,'files':_0x3bb8a9},'description':_0x41a281(0x191)+_0x3bb8a9[_0x41a281(0x179)]+_0x41a281(0x1b3)};},async 'execute'(_0x52604a){const _0xe2598c=a31_0x3bb0db,_0x43b4bc=loadBffProjectConfig(_0x52604a[_0xe2598c(0x197)]),_0x2003d8=await readBffLockFile(_0x43b4bc[_0xe2598c(0x1b1)]),{lockData:_0x252842,appLock:_0x340c96}=ensureLockScope(_0x2003d8??createEmptyBffLock(),_0x52604a['appCode'],_0x43b4bc[_0xe2598c(0x17c)],_0xe2598c(0x192)),_0x12d344=await getTargetFunctions(_0x43b4bc,_0x52604a);if(_0x12d344[_0xe2598c(0x179)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xe2598c(0x1a9)};const _0x2a4d9b=_0x52604a[_0xe2598c(0x1b9)](_0xe2598c(0x1c2)),_0x4c25eb=await buildHookMaps(_0x52604a[_0xe2598c(0x197)],_0x52604a['apiDir'],_0x12d344,_0x340c96),_0x5c1f04=[],_0x4bcc44=[],_0x175119=[];for(const _0x1fe9cb of _0x12d344){const _0x34ff74=await computeFileHash(_0x1fe9cb[_0xe2598c(0x18c)]),_0x2ec89b=_0x340c96[_0xe2598c(0x17b)][_0x1fe9cb['lockKey']];if(!_0x2a4d9b&&_0x2ec89b&&_0x2ec89b[_0xe2598c(0x182)]===_0x34ff74){_0x4bcc44[_0xe2598c(0x192)]({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'reason':_0xe2598c(0x18e)});continue;}try{await uploadSingleFunction(_0x52604a[_0xe2598c(0x197)],_0x1fe9cb,_0x340c96,_0x4c25eb);const _0xb839bf=_0x340c96['functions'][_0x1fe9cb[_0xe2598c(0x1aa)]];_0x5c1f04[_0xe2598c(0x192)]({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'remoteId':_0xb839bf?.[_0xe2598c(0x1ac)]??0x0});}catch(_0x2f694a){_0x175119['push']({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'error':_0x2f694a instanceof Error?_0x2f694a[_0xe2598c(0x1a6)]:String(_0x2f694a)});}}return _0x340c96[_0xe2598c(0x181)]=new Date()['toISOString'](),await writeBffLockFile(_0x43b4bc[_0xe2598c(0x1b1)],_0x252842),{'ok':_0x175119[_0xe2598c(0x179)]===0x0,'data':{'uploaded':_0x5c1f04,'skipped':_0x4bcc44,'failed':_0x175119},'message':_0xe2598c(0x1a7)+_0x5c1f04[_0xe2598c(0x179)]+_0xe2598c(0x194)+_0x4bcc44[_0xe2598c(0x179)]+_0xe2598c(0x1bb)+_0x175119[_0xe2598c(0x179)]+_0xe2598c(0x1bc)};}};async function getTargetFunctions(_0x545955,_0x283667){const _0x146087=a31_0x3bb0db,_0x1942c8=_0x283667[_0x146087(0x1b4)]('type'),_0x46e8c7=_0x283667[_0x146087(0x1b4)](_0x146087(0x183)),_0x44e62c=normalizeBffType(_0x1942c8)??undefined;if(_0x46e8c7&&!_0x44e62c)throw CliErrors[_0x146087(0x1b7)](_0x146087(0x19c));const _0x1fc88b=await scanLocalBffFunctions(_0x545955,_0x44e62c);if(_0x46e8c7){const _0x38aabe=_0x1fc88b[_0x146087(0x188)](_0x32d795=>_0x32d795[_0x146087(0x183)]===_0x46e8c7);if(_0x38aabe[_0x146087(0x179)]===0x0)throw CliErrors[_0x146087(0x1b7)](_0x146087(0x19b)+_0x44e62c+'/'+_0x46e8c7);return _0x38aabe;}return _0x1fc88b;}async function buildHookMaps(_0x37ebfa,_0x5b54b2,_0x4f92aa,_0x56f30e){const _0x5850d5=a31_0x3bb0db,_0x3103cd=_0x4f92aa[_0x5850d5(0x1b5)](_0x40b9fc=>_0x40b9fc[_0x5850d5(0x17a)]===_0x5850d5(0x1b0));if(!_0x3103cd)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x4a0714=loadAliasMap(_0x5b54b2,undefined,resolveApiFilePath(_0x5b54b2,_0x37ebfa)),_0x19b9ac=new Map(_0x4a0714['map'](_0x4e7189=>[_0x4e7189[_0x5850d5(0x187)],_0x4e7189['datasetCode']]));for(const _0x27251c of Object[_0x5850d5(0x1bd)](_0x56f30e[_0x5850d5(0x17b)])){_0x27251c[_0x5850d5(0x187)]&&_0x27251c[_0x5850d5(0x180)]&&!_0x19b9ac[_0x5850d5(0x19f)](_0x27251c['alias'])&&_0x19b9ac['set'](_0x27251c[_0x5850d5(0x187)],_0x27251c[_0x5850d5(0x180)]);}const _0x3e8eb5=await listDatasets(_0x37ebfa),_0x3b705c=new Map(_0x3e8eb5[_0x5850d5(0x1ab)](_0x3aacc4=>[_0x3aacc4[_0x5850d5(0x196)],_0x3aacc4['id']]));return{'aliasToDatasetCode':_0x19b9ac,'datasetCodeToId':_0x3b705c};}async function uploadSingleFunction(_0x322166,_0x15c356,_0x4fe739,_0x4e8908){const _0x1f008c=a31_0x3bb0db,_0x310c74=await readFile(_0x15c356[_0x1f008c(0x18c)],_0x1f008c(0x1be)),_0x12edbe=await computeFileHash(_0x15c356['filePath']),_0x2689c9=_0x4fe739['functions'][_0x15c356[_0x1f008c(0x1aa)]];if(_0x2689c9?.['remoteId']&&_0x2689c9[_0x1f008c(0x1a4)]==null)throw CliErrors[_0x1f008c(0x1b7)](_0x15c356[_0x1f008c(0x1aa)]+_0x1f008c(0x185));let _0xa03458=extractScriptDescription(_0x310c74);if(!_0xa03458&&_0x2689c9?.[_0x1f008c(0x1ac)]){const _0x4fffc4=await getBffScriptInfo(_0x2689c9[_0x1f008c(0x1ac)]);_0xa03458=_0x4fffc4['description']||undefined;}const _0x5432c9={'appCode':_0x322166,'functionName':_0x15c356[_0x1f008c(0x183)],'scriptType':_0x15c356[_0x1f008c(0x17a)],'scriptContent':_0x310c74};if(_0x2689c9?.[_0x1f008c(0x1ac)])_0x5432c9['id']=_0x2689c9[_0x1f008c(0x1ac)];if(_0x2689c9?.[_0x1f008c(0x1a4)]!=null)_0x5432c9[_0x1f008c(0x1a4)]=_0x2689c9[_0x1f008c(0x1a4)];if(_0xa03458)_0x5432c9[_0x1f008c(0x19e)]=_0xa03458;if(_0x15c356[_0x1f008c(0x17a)]===_0x1f008c(0x1b0)){const _0x3c885e=_0x15c356[_0x1f008c(0x187)];if(!_0x3c885e||!_0x15c356[_0x1f008c(0x1af)]||!_0x15c356[_0x1f008c(0x18f)])throw CliErrors[_0x1f008c(0x1b7)](_0x1f008c(0x186)+_0x15c356[_0x1f008c(0x1aa)]);const _0x468862=_0x4e8908[_0x1f008c(0x1ad)][_0x1f008c(0x189)](_0x3c885e)??_0x2689c9?.[_0x1f008c(0x180)]??_0x3c885e,_0x564534=_0x4e8908[_0x1f008c(0x1bf)][_0x1f008c(0x189)](_0x468862);if(!_0x564534)throw CliErrors[_0x1f008c(0x1b7)](_0x1f008c(0x1a1)+_0x3c885e+'\x22.\x20'+(_0x1f008c(0x184)+CLI_BIN_NAME+_0x1f008c(0x198)));_0x5432c9[_0x1f008c(0x1a2)]=_0x564534,_0x5432c9['operationType']=_0x15c356['operationType'],_0x5432c9['functionNode']=_0x15c356[_0x1f008c(0x18f)];}const _0x1436f2=await saveBffScript(_0x5432c9),_0x206fba=await getBffScriptInfo(_0x1436f2),_0x18e495={'hash':_0x12edbe,'remoteId':_0x1436f2,'version':_0x206fba[_0x1f008c(0x1a4)]};if(_0x15c356['type']===_0x1f008c(0x1b0)){const _0x289a05=_0x15c356['alias'],_0x144a05=_0x4e8908[_0x1f008c(0x1ad)]['get'](_0x289a05)??_0x2689c9?.[_0x1f008c(0x180)]??_0x289a05;_0x4e8908['aliasToDatasetCode']['has'](_0x289a05)?_0x18e495[_0x1f008c(0x187)]=_0x289a05:_0x18e495[_0x1f008c(0x187)]=_0x2689c9?.['alias'],_0x18e495[_0x1f008c(0x180)]=_0x144a05,_0x18e495[_0x1f008c(0x1af)]=_0x15c356['operationType'],_0x18e495['functionNode']=_0x15c356[_0x1f008c(0x18f)];}_0x4fe739[_0x1f008c(0x17b)][_0x15c356[_0x1f008c(0x1aa)]]=_0x18e495;}
|
|
1
|
+
const a31_0x481b1e=a31_0x133e;(function(_0x4c3a00,_0x430539){const _0x2b8d4f=a31_0x133e,_0x1164d9=_0x4c3a00();while(!![]){try{const _0x4cfdaa=parseInt(_0x2b8d4f(0x19c))/0x1+parseInt(_0x2b8d4f(0x186))/0x2+-parseInt(_0x2b8d4f(0x17c))/0x3*(parseInt(_0x2b8d4f(0x1b4))/0x4)+-parseInt(_0x2b8d4f(0x17d))/0x5*(-parseInt(_0x2b8d4f(0x17f))/0x6)+parseInt(_0x2b8d4f(0x184))/0x7*(parseInt(_0x2b8d4f(0x1ae))/0x8)+parseInt(_0x2b8d4f(0x196))/0x9+-parseInt(_0x2b8d4f(0x171))/0xa;if(_0x4cfdaa===_0x430539)break;else _0x1164d9['push'](_0x1164d9['shift']());}catch(_0x477e6c){_0x1164d9['push'](_0x1164d9['shift']());}}}(a31_0x2f6c,0xe9774));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_0x2f6c(){const _0x3f078a=['\x20skipped,\x20','string','scriptsRoot','Push\x20local\x20BFF\x20scripts\x20to\x20remote','Force\x20push\x20ignoring\x20hash\x20protection','unchanged','filePath','version','HOOK','type','8837955BBTjeC','lastSync','functionNode','Cannot\x20resolve\x20dataset\x20for\x20\x22','set','hash','1446005SGeMqf','bff','bool','map','alias','appCode','Push\x20complete:\x20','lockKey','No\x20local\x20BFF\x20functions\x20found.','\x20failed','datasetCodeToId','Would\x20inspect\x20','message','filter','update','aliasToDatasetCode','name','Push\x20only\x20this\x20script\x20type','8053744EvXISm','functions','str','\x20uploaded,\x20','has','force','3116lSDEWr','datasetCode','push','lockFilePath','code','apiDir','44506010avLkYO','COMMON','/api/management/library/scripts/save','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','get',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Run\x20`','\x20local\x20BFF\x20script(s)\x20for\x20push','toISOString','boolean','utf8','4317qarrCu','5YHuOSq','Incomplete\x20HOOK\x20path:\x20','8329806rYbUcQ','ENDPOINT','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','7wQDuft','POST','3409678nDNxgc','description','high-risk-write','validation','operationType','remoteId'];a31_0x2f6c=function(){return _0x3f078a;};return a31_0x2f6c();}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_0x133e(_0x447e9d,_0x89b4ac){_0x447e9d=_0x447e9d-0x170;const _0x2f6cdc=a31_0x2f6c();let _0x133efd=_0x2f6cdc[_0x447e9d];return _0x133efd;}export const bffPush={'service':a31_0x481b1e(0x19d),'command':a31_0x481b1e(0x1b6),'description':a31_0x481b1e(0x18f),'risk':a31_0x481b1e(0x188),'flags':[{'name':a31_0x481b1e(0x195),'type':a31_0x481b1e(0x18d),'description':a31_0x481b1e(0x1ad),'enum':[a31_0x481b1e(0x172),a31_0x481b1e(0x180),a31_0x481b1e(0x194)]},{'name':a31_0x481b1e(0x1ac),'type':a31_0x481b1e(0x18d),'description':a31_0x481b1e(0x174)},{'name':a31_0x481b1e(0x1b3),'type':a31_0x481b1e(0x17a),'description':a31_0x481b1e(0x190)}],async 'dryRun'(_0x3f8075){const _0x281339=a31_0x481b1e,_0x4ea64c=loadBffProjectConfig(_0x3f8075[_0x281339(0x1a1)]),_0x3a3333=await readBffLockFile(_0x4ea64c[_0x281339(0x1b7)]),{appLock:_0x11ea89}=ensureLockScope(_0x3a3333??createEmptyBffLock(),_0x3f8075['appCode'],_0x4ea64c[_0x281339(0x18e)],_0x281339(0x1b6)),_0x1745dd=await getTargetFunctions(_0x4ea64c,_0x3f8075),_0x34ad57=_0x3f8075[_0x281339(0x19e)](_0x281339(0x1b3)),_0x375fb2=[];for(const _0x33ee8d of _0x1745dd){const _0x400133=await computeFileHash(_0x33ee8d[_0x281339(0x192)]),_0x151763=_0x11ea89[_0x281339(0x1af)][_0x33ee8d[_0x281339(0x1a3)]],_0x156c80=!!_0x151763&&_0x151763[_0x281339(0x19b)]===_0x400133;_0x375fb2['push']({'lockKey':_0x33ee8d[_0x281339(0x1a3)],'filePath':_0x33ee8d[_0x281339(0x192)],'remoteId':_0x151763?.[_0x281339(0x18b)]??null,'mode':_0x151763?.[_0x281339(0x18b)]?_0x281339(0x1aa):'create','status':!_0x34ad57&&_0x156c80?_0x281339(0x191):'would_push'});}return{'method':_0x281339(0x185),'url':_0x281339(0x173),'body':{'appCode':_0x3f8075[_0x281339(0x1a1)],'force':_0x34ad57,'files':_0x375fb2},'description':_0x281339(0x1a7)+_0x375fb2[_0x281339(0x182)]+_0x281339(0x178)};},async 'execute'(_0x515779){const _0x19c5f7=a31_0x481b1e,_0x4079f9=loadBffProjectConfig(_0x515779[_0x19c5f7(0x1a1)]),_0x1a9c26=await readBffLockFile(_0x4079f9[_0x19c5f7(0x1b7)]),{lockData:_0x5de4f4,appLock:_0x23b265}=ensureLockScope(_0x1a9c26??createEmptyBffLock(),_0x515779[_0x19c5f7(0x1a1)],_0x4079f9[_0x19c5f7(0x18e)],_0x19c5f7(0x1b6)),_0x30d7b4=await getTargetFunctions(_0x4079f9,_0x515779);if(_0x30d7b4['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x19c5f7(0x1a4)};const _0x27b15a=_0x515779['bool'](_0x19c5f7(0x1b3)),_0x1c4810=await buildHookMaps(_0x515779['appCode'],_0x515779[_0x19c5f7(0x170)],_0x30d7b4,_0x23b265),_0x21ac63=[],_0x2e5c05=[],_0x387e48=[];for(const _0x768df4 of _0x30d7b4){const _0x337b2d=await computeFileHash(_0x768df4[_0x19c5f7(0x192)]),_0x58b4b1=_0x23b265[_0x19c5f7(0x1af)][_0x768df4[_0x19c5f7(0x1a3)]];if(!_0x27b15a&&_0x58b4b1&&_0x58b4b1[_0x19c5f7(0x19b)]===_0x337b2d){_0x2e5c05[_0x19c5f7(0x1b6)]({'lockKey':_0x768df4[_0x19c5f7(0x1a3)],'reason':_0x19c5f7(0x191)});continue;}try{await uploadSingleFunction(_0x515779[_0x19c5f7(0x1a1)],_0x768df4,_0x23b265,_0x1c4810);const _0x34cfab=_0x23b265[_0x19c5f7(0x1af)][_0x768df4['lockKey']];_0x21ac63['push']({'lockKey':_0x768df4[_0x19c5f7(0x1a3)],'remoteId':_0x34cfab?.[_0x19c5f7(0x18b)]??0x0});}catch(_0x275b1a){_0x387e48[_0x19c5f7(0x1b6)]({'lockKey':_0x768df4[_0x19c5f7(0x1a3)],'error':_0x275b1a instanceof Error?_0x275b1a[_0x19c5f7(0x1a8)]:String(_0x275b1a)});}}return _0x23b265[_0x19c5f7(0x197)]=new Date()[_0x19c5f7(0x179)](),await writeBffLockFile(_0x4079f9['lockFilePath'],_0x5de4f4),{'ok':_0x387e48[_0x19c5f7(0x182)]===0x0,'data':{'uploaded':_0x21ac63,'skipped':_0x2e5c05,'failed':_0x387e48},'message':_0x19c5f7(0x1a2)+_0x21ac63[_0x19c5f7(0x182)]+_0x19c5f7(0x1b1)+_0x2e5c05['length']+_0x19c5f7(0x18c)+_0x387e48[_0x19c5f7(0x182)]+_0x19c5f7(0x1a5)};}};async function getTargetFunctions(_0x1cde1a,_0x3223bd){const _0x153c88=a31_0x481b1e,_0xbd3114=_0x3223bd[_0x153c88(0x1b0)]('type'),_0x2f95bb=_0x3223bd[_0x153c88(0x1b0)](_0x153c88(0x1ac)),_0x5efc0e=normalizeBffType(_0xbd3114)??undefined;if(_0x2f95bb&&!_0x5efc0e)throw CliErrors[_0x153c88(0x189)](_0x153c88(0x181));const _0x1e317d=await scanLocalBffFunctions(_0x1cde1a,_0x5efc0e);if(_0x2f95bb){const _0x2fa13e=_0x1e317d[_0x153c88(0x1a9)](_0x191f43=>_0x191f43['name']===_0x2f95bb);if(_0x2fa13e['length']===0x0)throw CliErrors[_0x153c88(0x189)]('Local\x20function\x20not\x20found:\x20'+_0x5efc0e+'/'+_0x2f95bb);return _0x2fa13e;}return _0x1e317d;}async function buildHookMaps(_0x2dc9a9,_0x148399,_0xdd1fb,_0x111416){const _0x2e29f9=a31_0x481b1e,_0x56a3d6=_0xdd1fb['some'](_0x24f042=>_0x24f042[_0x2e29f9(0x195)]===_0x2e29f9(0x194));if(!_0x56a3d6)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x12cd0f=loadAliasMap(_0x148399,undefined,resolveApiFilePath(_0x148399,_0x2dc9a9)),_0x277742=new Map(_0x12cd0f[_0x2e29f9(0x19f)](_0x4bd0ec=>[_0x4bd0ec[_0x2e29f9(0x1a0)],_0x4bd0ec[_0x2e29f9(0x1b5)]]));for(const _0x2f0101 of Object['values'](_0x111416[_0x2e29f9(0x1af)])){_0x2f0101[_0x2e29f9(0x1a0)]&&_0x2f0101[_0x2e29f9(0x1b5)]&&!_0x277742[_0x2e29f9(0x1b2)](_0x2f0101[_0x2e29f9(0x1a0)])&&_0x277742[_0x2e29f9(0x19a)](_0x2f0101[_0x2e29f9(0x1a0)],_0x2f0101[_0x2e29f9(0x1b5)]);}const _0x3c55ad=await listDatasets(_0x2dc9a9),_0x402186=new Map(_0x3c55ad[_0x2e29f9(0x19f)](_0x5276e2=>[_0x5276e2[_0x2e29f9(0x1b8)],_0x5276e2['id']]));return{'aliasToDatasetCode':_0x277742,'datasetCodeToId':_0x402186};}async function uploadSingleFunction(_0x41b508,_0x5ce529,_0x309d72,_0x56b365){const _0x3d67e9=a31_0x481b1e,_0x2c17bb=await readFile(_0x5ce529[_0x3d67e9(0x192)],_0x3d67e9(0x17b)),_0x4ae924=await computeFileHash(_0x5ce529[_0x3d67e9(0x192)]),_0x590250=_0x309d72['functions'][_0x5ce529[_0x3d67e9(0x1a3)]];if(_0x590250?.[_0x3d67e9(0x18b)]&&_0x590250[_0x3d67e9(0x193)]==null)throw CliErrors['validation'](_0x5ce529[_0x3d67e9(0x1a3)]+_0x3d67e9(0x176));let _0x24d234=extractScriptDescription(_0x2c17bb);if(!_0x24d234&&_0x590250?.[_0x3d67e9(0x18b)]){const _0x33e7f3=await getBffScriptInfo(_0x590250[_0x3d67e9(0x18b)]);_0x24d234=_0x33e7f3[_0x3d67e9(0x187)]||undefined;}const _0x25ebec={'appCode':_0x41b508,'functionName':_0x5ce529['name'],'scriptType':_0x5ce529[_0x3d67e9(0x195)],'scriptContent':_0x2c17bb};if(_0x590250?.[_0x3d67e9(0x18b)])_0x25ebec['id']=_0x590250['remoteId'];if(_0x590250?.[_0x3d67e9(0x193)]!=null)_0x25ebec['version']=_0x590250['version'];if(_0x24d234)_0x25ebec['description']=_0x24d234;if(_0x5ce529['type']===_0x3d67e9(0x194)){const _0x15a993=_0x5ce529['alias'];if(!_0x15a993||!_0x5ce529['operationType']||!_0x5ce529['functionNode'])throw CliErrors['validation'](_0x3d67e9(0x17e)+_0x5ce529[_0x3d67e9(0x1a3)]);const _0x27360b=_0x56b365[_0x3d67e9(0x1ab)]['get'](_0x15a993)??_0x590250?.[_0x3d67e9(0x1b5)]??_0x15a993,_0x3b6126=_0x56b365[_0x3d67e9(0x1a6)]['get'](_0x27360b);if(!_0x3b6126)throw CliErrors[_0x3d67e9(0x189)](_0x3d67e9(0x199)+_0x15a993+'\x22.\x20'+(_0x3d67e9(0x177)+CLI_BIN_NAME+_0x3d67e9(0x183)));_0x25ebec['datasetId']=_0x3b6126,_0x25ebec[_0x3d67e9(0x18a)]=_0x5ce529[_0x3d67e9(0x18a)],_0x25ebec[_0x3d67e9(0x198)]=_0x5ce529[_0x3d67e9(0x198)];}const _0x291438=await saveBffScript(_0x25ebec),_0x453bd1=await getBffScriptInfo(_0x291438),_0x2d6b20={'hash':_0x4ae924,'remoteId':_0x291438,'version':_0x453bd1[_0x3d67e9(0x193)]};if(_0x5ce529[_0x3d67e9(0x195)]===_0x3d67e9(0x194)){const _0xdc2a70=_0x5ce529[_0x3d67e9(0x1a0)],_0x1c51f5=_0x56b365[_0x3d67e9(0x1ab)][_0x3d67e9(0x175)](_0xdc2a70)??_0x590250?.[_0x3d67e9(0x1b5)]??_0xdc2a70;_0x56b365[_0x3d67e9(0x1ab)][_0x3d67e9(0x1b2)](_0xdc2a70)?_0x2d6b20[_0x3d67e9(0x1a0)]=_0xdc2a70:_0x2d6b20[_0x3d67e9(0x1a0)]=_0x590250?.['alias'],_0x2d6b20['datasetCode']=_0x1c51f5,_0x2d6b20[_0x3d67e9(0x18a)]=_0x5ce529[_0x3d67e9(0x18a)],_0x2d6b20[_0x3d67e9(0x198)]=_0x5ce529['functionNode'];}_0x309d72[_0x3d67e9(0x1af)][_0x5ce529[_0x3d67e9(0x1a3)]]=_0x2d6b20;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x29f478=a32_0x5d7f;function a32_0x94d4(){const _0x52f53b=['8139109fuQvxy','scriptsRoot','bff','read','boolean','lockKey','\x20modified,\x20','datasetCode','\x20unchanged','951147QSnoUr','39272CfGIiu','status','alias','appCode','\x20remote-only','map','377078UWiHGQ','has','remote','31935bFdosn','length','lockFilePath','477QbzHHl','functions','apiDir','All\x20BFF\x20scripts\x20are\x20in\x20sync.','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','6LpTzIC','7swlQSd','765498Hcxesu','hash','filePath','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','6875400CZCrcD','324zJGBMy','push','all'];a32_0x94d4=function(){return _0x52f53b;};return a32_0x94d4();}(function(_0x6b480b,_0x2d3c5f){const _0x3f2230=a32_0x5d7f,_0x3394d6=_0x6b480b();while(!![]){try{const _0x1099e0=parseInt(_0x3f2230(0xd3))/0x1+-parseInt(_0x3f2230(0xb5))/0x2*(parseInt(_0x3f2230(0xc0))/0x3)+parseInt(_0x3f2230(0xc7))/0x4*(-parseInt(_0x3f2230(0xb8))/0x5)+-parseInt(_0x3f2230(0xc2))/0x6*(-parseInt(_0x3f2230(0xc1))/0x7)+-parseInt(_0x3f2230(0xd4))/0x8*(-parseInt(_0x3f2230(0xbb))/0x9)+-parseInt(_0x3f2230(0xc6))/0xa+parseInt(_0x3f2230(0xca))/0xb;if(_0x1099e0===_0x2d3c5f)break;else _0x3394d6['push'](_0x3394d6['shift']());}catch(_0xa19563){_0x3394d6['push'](_0x3394d6['shift']());}}}(a32_0x94d4,0x794dd));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a32_0x5d7f(_0x3ace81,_0x3ab863){_0x3ace81=_0x3ace81-0xb3;const _0x94d447=a32_0x94d4();let _0x5d7f76=_0x94d447[_0x3ace81];return _0x5d7f76;}import{loadAliasMap}from'../../core/alias-resolver.js';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';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a32_0x29f478(0xcc),'command':'status','description':a32_0x29f478(0xc5),'risk':a32_0x29f478(0xcd),'flags':[{'name':a32_0x29f478(0xb7),'type':a32_0x29f478(0xce),'description':a32_0x29f478(0xbf)}],async 'execute'(_0x87f69){const _0x3f849b=a32_0x29f478,_0x189b75=loadBffProjectConfig(_0x87f69[_0x3f849b(0xd7)]),_0x16bbb3=await readBffLockFile(_0x189b75[_0x3f849b(0xba)]),{appLock:_0x38d96f}=ensureLockScope(_0x16bbb3??createEmptyBffLock(),_0x87f69[_0x3f849b(0xd7)],_0x189b75[_0x3f849b(0xcb)],_0x3f849b(0xd5)),_0x5f5764=await scanLocalBffFunctions(_0x189b75),_0x4d58cf=[],_0x20b684=[],_0x1cd768=[];for(const _0x3ad689 of _0x5f5764){const _0x3e1e7e=await computeFileHash(_0x3ad689[_0x3f849b(0xc4)]),_0x588787=_0x38d96f['functions'][_0x3ad689[_0x3f849b(0xcf)]];if(!_0x588787)_0x4d58cf[_0x3f849b(0xc8)](_0x3ad689['lockKey']);else _0x588787[_0x3f849b(0xc3)]!==_0x3e1e7e?_0x20b684[_0x3f849b(0xc8)](_0x3ad689[_0x3f849b(0xcf)]):_0x1cd768[_0x3f849b(0xc8)](_0x3ad689[_0x3f849b(0xcf)]);}const _0x591fa5=[];if(_0x87f69['bool']('remote')){const _0xb7a581=loadAliasMap(_0x87f69[_0x3f849b(0xbd)],undefined,resolveApiFilePath(_0x87f69['apiDir'],_0x87f69[_0x3f849b(0xd7)])),_0x5d19d6=new Map(_0xb7a581['map'](_0x445df1=>[_0x445df1[_0x3f849b(0xd1)],_0x445df1[_0x3f849b(0xd6)]])),[_0x4d1322,_0x4c3c35]=await Promise[_0x3f849b(0xc9)]([listBffScripts(_0x87f69[_0x3f849b(0xd7)]),getBffScriptStatistics(_0x87f69[_0x3f849b(0xd7)])]),_0x7dd504=createHookLocationMap(_0x4c3c35),_0x20de16=new Set(_0x5f5764[_0x3f849b(0xb4)](_0x37b508=>_0x37b508[_0x3f849b(0xcf)]));for(const _0x12664d of _0x4d1322){const _0x86509=resolveRemoteScriptTarget(_0x189b75,_0x12664d,_0x7dd504,_0x38d96f[_0x3f849b(0xbc)],_0x5d19d6);_0x86509&&!_0x20de16[_0x3f849b(0xb6)](_0x86509[_0x3f849b(0xcf)])&&_0x591fa5[_0x3f849b(0xc8)](_0x86509[_0x3f849b(0xcf)]);}}const _0x3372c8=_0x4d58cf[_0x3f849b(0xb9)]===0x0&&_0x20b684[_0x3f849b(0xb9)]===0x0&&_0x591fa5[_0x3f849b(0xb9)]===0x0;return{'ok':!![],'data':{'added':_0x4d58cf,'modified':_0x20b684,'unchanged':_0x1cd768,'remoteOnly':_0x591fa5},'message':_0x3372c8?_0x3f849b(0xbe):_0x4d58cf['length']+'\x20added,\x20'+_0x20b684[_0x3f849b(0xb9)]+_0x3f849b(0xd0)+_0x1cd768[_0x3f849b(0xb9)]+_0x3f849b(0xd2)+(_0x591fa5['length']>0x0?',\x20'+_0x591fa5['length']+_0x3f849b(0xb3):'')};}};
|