@lovrabet/rabetbase-cli 2.0.11 → 2.0.13
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/pull.js +1 -0
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +1 -1
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0x5de91e=a19_0x4efd;(function(_0x4b756c,_0xf022a7){const _0x38cd9a=a19_0x4efd,_0x52826f=_0x4b756c();while(!![]){try{const _0x2d885f=parseInt(_0x38cd9a(0x97))/0x1*(parseInt(_0x38cd9a(0x82))/0x2)+parseInt(_0x38cd9a(0x98))/0x3+parseInt(_0x38cd9a(0x80))/0x4*(-parseInt(_0x38cd9a(0x88))/0x5)+-parseInt(_0x38cd9a(0x8a))/0x6+-parseInt(_0x38cd9a(0x96))/0x7*(parseInt(_0x38cd9a(0x7d))/0x8)+-parseInt(_0x38cd9a(0x7c))/0x9*(parseInt(_0x38cd9a(0x84))/0xa)+parseInt(_0x38cd9a(0x8b))/0xb;if(_0x2d885f===_0xf022a7)break;else _0x52826f['push'](_0x52826f['shift']());}catch(_0x9cecde){_0x52826f['push'](_0x52826f['shift']());}}}(a19_0x6900,0xca40b));function a19_0x4efd(_0x30a361,_0x2340ac){_0x30a361=_0x30a361-0x7c;const _0x69000a=a19_0x6900();let _0x4efdc9=_0x69000a[_0x30a361];return _0x4efdc9;}import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';function a19_0x6900(){const _0x3dfe33=['inherit','apps','riskLevel','2176443IZNnnV','8SmgyaF','map','No\x20apps\x20configured.\x20Use\x20`','618232aORLZa','format','3017466QrkXku','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','30JOqSjm','locale','appcode','list','40mYeggZ','cookie','4385850qZcCYx','23871320EcRtyn','globalPath','pageSize','List\x20all\x20configured\x20apps','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','env','length','globalConfig','projectConfig','object','projectPath','10272311njjAvU','1MSZTii','3929901DhIZKZ'];a19_0x6900=function(){return _0x3dfe33;};return a19_0x6900();}async function execute(_0x531157){const _0x4b6dae=a19_0x4efd,{config:_0x4008dd,layers:_0x33cdba}=readRawConfigWithLayers(),{apps:apps={},defaultApp:_0x301ad4,currentApp:_0x2eca58}=_0x4008dd,_0x1ef8bb=Object['entries'](apps),_0x5f0a29=_0x33cdba[_0x4b6dae(0x92)]['apps']&&typeof _0x33cdba[_0x4b6dae(0x92)][_0x4b6dae(0x9a)]==='object'?_0x33cdba[_0x4b6dae(0x92)][_0x4b6dae(0x9a)]:{},_0x23eb20=_0x33cdba[_0x4b6dae(0x93)]['apps']&&typeof _0x33cdba['projectConfig'][_0x4b6dae(0x9a)]===_0x4b6dae(0x94)?_0x33cdba['projectConfig'][_0x4b6dae(0x9a)]:{};if(_0x1ef8bb[_0x4b6dae(0x91)]===0x0){const _0x34733a=_0x4008dd[_0x4b6dae(0x86)];if(_0x34733a)return{'ok':!![],'data':{'mode':'single-app','appcode':_0x34733a,'env':_0x4008dd[_0x4b6dae(0x90)]},'message':'Single-app\x20mode.\x20Use\x20`'+CLI_BIN_NAME+_0x4b6dae(0x83)};return{'ok':!![],'data':[],'message':_0x4b6dae(0x7f)+CLI_BIN_NAME+_0x4b6dae(0x8f)};}const _0x525b9b=resolveDefaultAppSource(_0x33cdba),_0x2f9dc8=_0x33cdba[_0x4b6dae(0x93)][_0x4b6dae(0x99)]===![],_0x2c2742=_0x1ef8bb[_0x4b6dae(0x7e)](([_0x5573b8,_0xe99353])=>({'name':_0x5573b8,'appcode':_0xe99353[_0x4b6dae(0x86)],'definedIn':appDefinedIn(_0x5573b8,_0x5f0a29,_0x23eb20,_0x2f9dc8),'isDefault':_0x5573b8===_0x301ad4,'isCurrent':_0x5573b8===(_0x2eca58??_0x301ad4),'env':_0xe99353['env']??null,'apiDir':_0xe99353['apiDir']??null,'hasCookie':!!_0xe99353[_0x4b6dae(0x89)],'hasAccessKey':!!_0xe99353['accessKey'],'format':_0xe99353[_0x4b6dae(0x81)]??null,'pageSize':_0xe99353[_0x4b6dae(0x8d)]??null,'riskLevel':_0xe99353[_0x4b6dae(0x9b)]??null,'locale':_0xe99353[_0x4b6dae(0x85)]??null}));return{'ok':!![],'data':{'items':_0x2c2742,'meta':{'globalPath':_0x33cdba[_0x4b6dae(0x8c)]??null,'projectPath':_0x33cdba[_0x4b6dae(0x95)]??null,'defaultApp':_0x301ad4??null,'defaultAppSource':_0x301ad4!=null?_0x525b9b:null}}};}export const appListDefinition={'service':'app','command':a19_0x5de91e(0x87),'description':a19_0x5de91e(0x8e),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x564391=a20_0x40d0;function a20_0x5cfc(){const _0x2b2bb0=['182220UhGbTi','269211VAgbhH','read','42ESFrLU','2064460jVBodP','1058120elzoKl','cookie','appDesc','appName','remote','../../core/api-client.js','map','576468BSjqvd','List\x20apps\x20available\x20on\x20the\x20platform','2355408DfnzMl','1953973DwiqFW'];a20_0x5cfc=function(){return _0x2b2bb0;};return a20_0x5cfc();}(function(_0x3e2047,_0x72a7c9){const _0x5919c5=a20_0x40d0,_0x35fd8e=_0x3e2047();while(!![]){try{const _0x131f9b=-parseInt(_0x5919c5(0x184))/0x1+parseInt(_0x5919c5(0x178))/0x2+-parseInt(_0x5919c5(0x17f))/0x3+parseInt(_0x5919c5(0x177))/0x4+parseInt(_0x5919c5(0x183))/0x5*(parseInt(_0x5919c5(0x176))/0x6)+-parseInt(_0x5919c5(0x182))/0x7+-parseInt(_0x5919c5(0x181))/0x8;if(_0x131f9b===_0x72a7c9)break;else _0x35fd8e['push'](_0x35fd8e['shift']());}catch(_0x5ef57c){_0x35fd8e['push'](_0x35fd8e['shift']());}}}(a20_0x5cfc,0x40c87));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x54bc09){const _0x456b6f=a20_0x40d0,{setActiveCookie:_0x5eb046}=await import(_0x456b6f(0x17d));_0x5eb046(_0x54bc09[_0x456b6f(0x179)]);const _0x561108=await listRemoteApps(),_0x3ebfb3=_0x561108[_0x456b6f(0x17e)](_0x77b974=>({..._0x77b974['id']!=null?{'id':_0x77b974['id']}:{},'appCode':_0x77b974['appCode'],'appName':_0x77b974[_0x456b6f(0x17b)],..._0x77b974[_0x456b6f(0x17a)]!=null?{'appDesc':_0x77b974['appDesc']}:{}}));return{'ok':!![],'data':_0x3ebfb3};}function a20_0x40d0(_0x26d66f,_0x1176ab){_0x26d66f=_0x26d66f-0x175;const _0x5cfce0=a20_0x5cfc();let _0x40d040=_0x5cfce0[_0x26d66f];return _0x40d040;}export const appRemoteDefinition={'service':'app','command':a20_0x564391(0x17c),'description':a20_0x564391(0x180),'risk':a20_0x564391(0x175),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x11a8f3=a21_0x2b07;(function(_0xbe7050,_0x54466e){const _0x16877f=a21_0x2b07,_0x580fc0=_0xbe7050();while(!![]){try{const _0x24a3b8=-parseInt(_0x16877f(0x1a6))/0x1+parseInt(_0x16877f(0x1b4))/0x2+parseInt(_0x16877f(0x1b8))/0x3+parseInt(_0x16877f(0x1b5))/0x4*(parseInt(_0x16877f(0x1c1))/0x5)+parseInt(_0x16877f(0x1aa))/0x6+parseInt(_0x16877f(0x1bd))/0x7+-parseInt(_0x16877f(0x1c3))/0x8*(parseInt(_0x16877f(0x1a4))/0x9);if(_0x24a3b8===_0x54466e)break;else _0x580fc0['push'](_0x580fc0['shift']());}catch(_0x3bc0da){_0x580fc0['push'](_0x580fc0['shift']());}}}(a21_0x580d,0x2434d));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a21_0x2b07(_0x3b52d8,_0x11bcfa){_0x3b52d8=_0x3b52d8-0x1a3;const _0x580d2f=a21_0x580d();let _0x2b074b=_0x580d2f[_0x3b52d8];return _0x2b074b;}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x332b51){const _0x2ffbd7=a21_0x2b07,_0xf3c0fb=_0x332b51[_0x2ffbd7(0x1a9)][0x0]?.[_0x2ffbd7(0x1ac)]();if(!_0xf3c0fb)throw CliErrors[_0x2ffbd7(0x1c5)](_0x2ffbd7(0x1c0),_0x2ffbd7(0x1c8)+CLI_BIN_NAME+_0x2ffbd7(0x1ba));}function a21_0x580d(){const _0x4fe09b=['name','defaultApp','274057hPiTNH','App\x20profile\x20name\x20to\x20remove','projectConfig','Missing\x20app\x20name.','85QpZltJ','project','48zcjosS','\x20Default\x20app\x20changed\x20to\x20\x22','validation','remove','high-risk-write','Usage:\x20','object','globalConfig','853191WVdush','app','105176GvXKOv','keys','global','args','377868lkECij','bool','trim','inherit','Removed\x20app\x20\x22','App\x20\x22','\x22\x20not\x20found.','length','apps','\x20Note:\x20app\x20\x22','464214acJJZO','56216ucjvvz','boolean','Use\x20global\x20config\x20scope','747351OPsliI','\x22\x20still\x20defined\x20in\x20','\x20app\x20remove\x20<name>\x20[--global]'];a21_0x580d=function(){return _0x4fe09b;};return a21_0x580d();}async function execute(_0xef40f2){const _0x47cfbb=a21_0x2b07,_0x966f22=_0xef40f2[_0x47cfbb(0x1a9)][0x0]?.['trim']();if(!_0x966f22)throw CliErrors['validation'](_0x47cfbb(0x1c0),'Usage:\x20'+CLI_BIN_NAME+_0x47cfbb(0x1ba));const _0x45cdf1=_0xef40f2[_0x47cfbb(0x1ab)](_0x47cfbb(0x1a8)),{config:_0x107fec,layers:_0x36853b}=readRawConfigWithLayers(),_0x21f2b2=_0x107fec['apps']??{};if(!_0x21f2b2[_0x966f22])throw CliErrors[_0x47cfbb(0x1c5)]('App\x20\x22'+_0x966f22+_0x47cfbb(0x1b0));const _0x350598=_0x36853b[_0x47cfbb(0x1a3)][_0x47cfbb(0x1b2)]&&typeof _0x36853b[_0x47cfbb(0x1a3)][_0x47cfbb(0x1b2)]===_0x47cfbb(0x1c9)?_0x36853b[_0x47cfbb(0x1a3)][_0x47cfbb(0x1b2)]:{},_0x26936a=_0x36853b[_0x47cfbb(0x1bf)]['apps']&&typeof _0x36853b[_0x47cfbb(0x1bf)][_0x47cfbb(0x1b2)]===_0x47cfbb(0x1c9)?_0x36853b['projectConfig'][_0x47cfbb(0x1b2)]:{},_0x28e29d=appDefinedIn(_0x966f22,_0x350598,_0x26936a,_0x36853b[_0x47cfbb(0x1bf)][_0x47cfbb(0x1ad)]===![]),_0x381d0c=resolveAppScopeForWrite(_0x966f22,_0x45cdf1,_0x36853b),_0x2d23a9={'global':_0x381d0c===_0x47cfbb(0x1a8)},_0x27d36c=readConfig(_0x2d23a9),_0x516cc6=_0x27d36c[_0x47cfbb(0x1b2)];if(!_0x516cc6||!_0x516cc6[_0x966f22])throw CliErrors[_0x47cfbb(0x1c5)](_0x47cfbb(0x1af)+_0x966f22+'\x22\x20not\x20found.');delete _0x516cc6[_0x966f22];let _0x4b52d9='';if(_0x27d36c[_0x47cfbb(0x1bc)]===_0x966f22){const _0x213ee5=Object[_0x47cfbb(0x1a7)](_0x516cc6);_0x27d36c[_0x47cfbb(0x1bc)]=_0x213ee5[_0x47cfbb(0x1b1)]>0x0?_0x213ee5[0x0]:undefined,_0x27d36c[_0x47cfbb(0x1bc)]?_0x4b52d9=_0x47cfbb(0x1c4)+_0x27d36c[_0x47cfbb(0x1bc)]+'\x22.':delete _0x27d36c[_0x47cfbb(0x1bc)];}Object[_0x47cfbb(0x1a7)](_0x516cc6)[_0x47cfbb(0x1b1)]===0x0&&(delete _0x27d36c['apps'],delete _0x27d36c[_0x47cfbb(0x1bc)]);writeConfig(_0x27d36c,_0x2d23a9);const _0x4bf680=_0x28e29d==='both'?_0x47cfbb(0x1b3)+_0x966f22+_0x47cfbb(0x1b9)+(_0x381d0c==='project'?_0x47cfbb(0x1a8):_0x47cfbb(0x1c2))+'\x20config.':'';return{'ok':!![],'message':_0x47cfbb(0x1ae)+_0x966f22+'\x22'+scopeLabel(_0x2d23a9)+'.'+_0x4b52d9+_0x4bf680};}export const appRemoveDefinition={'service':a21_0x11a8f3(0x1a5),'command':a21_0x11a8f3(0x1c6),'description':'Remove\x20an\x20app\x20from\x20config','risk':a21_0x11a8f3(0x1c7),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x11a8f3(0x1bb),'description':a21_0x11a8f3(0x1be),'required':!![]}],'flags':[{'name':a21_0x11a8f3(0x1a8),'type':a21_0x11a8f3(0x1b6),'description':a21_0x11a8f3(0x1b7),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x176b87,_0x59a0c9){const _0x21c17c=a22_0x268f,_0x1dcbe3=_0x176b87();while(!![]){try{const _0x3858b1=parseInt(_0x21c17c(0xbb))/0x1*(parseInt(_0x21c17c(0xb5))/0x2)+parseInt(_0x21c17c(0xd1))/0x3*(parseInt(_0x21c17c(0xc3))/0x4)+parseInt(_0x21c17c(0xd3))/0x5*(parseInt(_0x21c17c(0xc1))/0x6)+parseInt(_0x21c17c(0xb8))/0x7*(parseInt(_0x21c17c(0xcf))/0x8)+parseInt(_0x21c17c(0xc9))/0x9*(-parseInt(_0x21c17c(0xbd))/0xa)+-parseInt(_0x21c17c(0xc8))/0xb*(-parseInt(_0x21c17c(0xb9))/0xc)+-parseInt(_0x21c17c(0xbe))/0xd;if(_0x3858b1===_0x59a0c9)break;else _0x1dcbe3['push'](_0x1dcbe3['shift']());}catch(_0x6e1b7){_0x1dcbe3['push'](_0x1dcbe3['shift']());}}}(a22_0x2835,0x567ab));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x1e1f25,_0x1f310c,_0x24fdc4){const _0x40c446=a22_0x268f;if(_0x1f310c)return _0x40c446(0xd4);const _0xbec410=_0x24fdc4['projectConfig']['apps']&&typeof _0x24fdc4[_0x40c446(0xc7)][_0x40c446(0xba)]===_0x40c446(0xd6)?_0x24fdc4['projectConfig'][_0x40c446(0xba)]:{},_0xa9a7e=_0x24fdc4[_0x40c446(0xcc)]['apps']&&typeof _0x24fdc4[_0x40c446(0xcc)][_0x40c446(0xba)]===_0x40c446(0xd6)?_0x24fdc4[_0x40c446(0xcc)][_0x40c446(0xba)]:{};if(Object['prototype']['hasOwnProperty'][_0x40c446(0xbf)](_0xbec410,_0x1e1f25))return _0x40c446(0xb2);if(Object[_0x40c446(0xcd)][_0x40c446(0xd0)][_0x40c446(0xbf)](_0xa9a7e,_0x1e1f25))return _0x40c446(0xd4);return _0x40c446(0xb2);}export function appDefinedIn(_0x156036,_0x319479,_0x3725f2,_0x4fab63){const _0x365dc8=a22_0x268f;if(_0x4fab63)return Object[_0x365dc8(0xcd)][_0x365dc8(0xd0)]['call'](_0x3725f2,_0x156036)?'project':'global';const _0x1bd305=Object[_0x365dc8(0xcd)][_0x365dc8(0xd0)][_0x365dc8(0xbf)](_0x319479,_0x156036),_0x5e5fa2=Object[_0x365dc8(0xcd)][_0x365dc8(0xd0)][_0x365dc8(0xbf)](_0x3725f2,_0x156036);if(_0x1bd305&&_0x5e5fa2)return'both';if(_0x5e5fa2)return'project';return _0x365dc8(0xd4);}function a22_0x2835(){const _0x3bce1f=['pageSize','34366XIfvRM','riskLevel','format','161hyMyDt','12HEVUqK','apps','2yraPaA','appcode','240rkLmlB','7572227qYzEYq','call','defaultApp','2639064QTbywY','app','10576ZyTnAv','length','inherit','env','projectConfig','1107271AjdWuK','189963RSboUt','accessKey','log','globalConfig','prototype','keys','245032HSjkBE','hasOwnProperty','186vQlWNg','Migrated\x20existing\x20app\x20\x22','5GzmsKk','global','cookie','object','project','locale'];a22_0x2835=function(){return _0x3bce1f;};return a22_0x2835();}function a22_0x268f(_0x5de346,_0x271d89){_0x5de346=_0x5de346-0xb2;const _0x283533=a22_0x2835();let _0x268f45=_0x283533[_0x5de346];return _0x268f45;}export function resolveDefaultAppSource(_0x343f6d){const _0x2fc924=a22_0x268f,_0x27f541=_0x343f6d[_0x2fc924(0xc7)][_0x2fc924(0xba)]&&typeof _0x343f6d[_0x2fc924(0xc7)]['apps']===_0x2fc924(0xd6)?_0x343f6d[_0x2fc924(0xc7)][_0x2fc924(0xba)]:{};if(_0x2fc924(0xc0)in _0x343f6d[_0x2fc924(0xc7)])return'project';if(Object[_0x2fc924(0xce)](_0x27f541)[_0x2fc924(0xc4)]>0x0)return _0x2fc924(0xb2);if(_0x343f6d[_0x2fc924(0xc7)][_0x2fc924(0xc5)]===![])return null;if(_0x343f6d[_0x2fc924(0xcc)][_0x2fc924(0xc0)])return'global';return null;}export function getConfigPath(_0x3a39a5={}){const _0x15caf4=a22_0x268f,_0x37f02a=_0x3a39a5[_0x15caf4(0xd4)]?_0x15caf4(0xd4):_0x15caf4(0xb2);return resolveWriteConfigPath(_0x37f02a);}export function readConfig(_0x42648c={}){return readConfigFile(getConfigPath(_0x42648c));}export function writeConfig(_0x305391,_0x3e11b0={}){writeConfigFile(getConfigPath(_0x3e11b0),_0x305391);}export function scopeLabel(_0x38624b){const _0x2ab448=a22_0x268f;return _0x38624b[_0x2ab448(0xd4)]?'\x20(global)':'';}export function migrateLegacySingleApp(_0x3fba4b,_0x47ea71){const _0x511473=a22_0x268f,_0x492df7=_0x3fba4b[_0x511473(0xbc)]||_0x3fba4b['app'];if(!_0x492df7)return;const _0x569f9f=String(_0x492df7);if(_0x569f9f===_0x47ea71)return;const _0x565af3=[_0x511473(0xc6),'apiDir',_0x511473(0xd5),_0x511473(0xca),_0x511473(0xb7),_0x511473(0xb4),_0x511473(0xb6),_0x511473(0xb3)],_0x3a2920={'appcode':_0x492df7};for(const _0x2b1ad5 of _0x565af3){if(_0x3fba4b[_0x2b1ad5]!=null)_0x3a2920[_0x2b1ad5]=_0x3fba4b[_0x2b1ad5];}_0x3fba4b[_0x511473(0xba)][_0x569f9f]=_0x3a2920,_0x3fba4b[_0x511473(0xc0)]=_0x569f9f,delete _0x3fba4b[_0x511473(0xbc)],delete _0x3fba4b[_0x511473(0xc2)],console[_0x511473(0xcb)](_0x511473(0xd2)+_0x569f9f+'\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).');}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0xd0197b=a23_0x1429;(function(_0x49e120,_0x2250af){const _0xaaf98f=a23_0x1429,_0x59d998=_0x49e120();while(!![]){try{const _0x2baa81=parseInt(_0xaaf98f(0x18a))/0x1+-parseInt(_0xaaf98f(0x17a))/0x2+-parseInt(_0xaaf98f(0x18e))/0x3*(-parseInt(_0xaaf98f(0x190))/0x4)+parseInt(_0xaaf98f(0x198))/0x5*(-parseInt(_0xaaf98f(0x18c))/0x6)+-parseInt(_0xaaf98f(0x189))/0x7*(parseInt(_0xaaf98f(0x18d))/0x8)+parseInt(_0xaaf98f(0x177))/0x9*(-parseInt(_0xaaf98f(0x176))/0xa)+parseInt(_0xaaf98f(0x175))/0xb*(parseInt(_0xaaf98f(0x184))/0xc);if(_0x2baa81===_0x2250af)break;else _0x59d998['push'](_0x59d998['shift']());}catch(_0x56f380){_0x59d998['push'](_0x59d998['shift']());}}}(a23_0x1dc5,0x8a934));import{CliErrors}from'../../errors.js';function a23_0x1dc5(){const _0x28fbb6=['170bpCnMY','Use\x20`','2745358GHUdrY','440HIUyoG','69921QebKFT','defaultApp','App\x20profile\x20name\x20to\x20activate','269974yBEjef','Switch\x20the\x20default\x20app','trim','\x22\x20not\x20found.','Available:\x20','\x20--appcode\x20<code>`\x20first.','write','Missing\x20app\x20name.','Usage:\x20','\x20app\x20add\x20','96YssBHY','join','keys','use','name','14EqtMsy','514608Bojmfm','length','170952rSvHPn','4329680mcPLJU','27wjWNeb','boolean','259708nfJQnB','\x20app\x20use\x20<name>\x20[--global]','global','Default\x20app\x20set\x20to\x20\x22','app','args','validation','Use\x20global\x20config\x20scope'];a23_0x1dc5=function(){return _0x28fbb6;};return a23_0x1dc5();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a23_0x1429(_0x369eda,_0x28e911){_0x369eda=_0x369eda-0x174;const _0x1dc50a=a23_0x1dc5();let _0x1429e9=_0x1dc50a[_0x369eda];return _0x1429e9;}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';async function validateArgs(_0x3e5e0d){const _0x5eb1f8=a23_0x1429,_0x582b83=_0x3e5e0d[_0x5eb1f8(0x195)][0x0]?.[_0x5eb1f8(0x17c)]();if(!_0x582b83)throw CliErrors[_0x5eb1f8(0x196)](_0x5eb1f8(0x181),_0x5eb1f8(0x182)+CLI_BIN_NAME+_0x5eb1f8(0x191));}async function execute(_0x4974c9){const _0x14e830=a23_0x1429,_0x562c05=_0x4974c9[_0x14e830(0x195)][0x0]?.[_0x14e830(0x17c)]();if(!_0x562c05)throw CliErrors[_0x14e830(0x196)]('Missing\x20app\x20name.',_0x14e830(0x182)+CLI_BIN_NAME+_0x14e830(0x191));const _0x61569f=_0x4974c9['bool'](_0x14e830(0x192)),{config:_0x50272a,layers:_0xfa91cf}=readRawConfigWithLayers(),_0x53a7bd=_0x50272a['apps']??{};if(!_0x53a7bd[_0x562c05]){const _0xfe78b9=Object[_0x14e830(0x186)](_0x53a7bd),_0x3f8786=_0xfe78b9[_0x14e830(0x18b)]===0x0?_0x14e830(0x174)+CLI_BIN_NAME+_0x14e830(0x183)+_0x562c05+_0x14e830(0x17f):_0x14e830(0x17e)+_0xfe78b9[_0x14e830(0x185)](',\x20');throw CliErrors[_0x14e830(0x196)]('App\x20\x22'+_0x562c05+_0x14e830(0x17d),_0x3f8786);}const _0x562841=resolveAppScopeForWrite(_0x562c05,_0x61569f,_0xfa91cf),_0xdc16e1={'global':_0x562841==='global'},_0x5c37cd=readConfig(_0xdc16e1);return _0x5c37cd[_0x14e830(0x178)]=_0x562c05,writeConfig(_0x5c37cd,_0xdc16e1),{'ok':!![],'message':_0x14e830(0x193)+_0x562c05+'\x22\x20(appcode:\x20'+_0x53a7bd[_0x562c05]['appcode']+')'+scopeLabel(_0xdc16e1)};}export const appUseDefinition={'service':a23_0xd0197b(0x194),'command':a23_0xd0197b(0x187),'description':a23_0xd0197b(0x17b),'risk':a23_0xd0197b(0x180),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0xd0197b(0x188),'description':a23_0xd0197b(0x179),'required':!![]}],'flags':[{'name':a23_0xd0197b(0x192),'type':a23_0xd0197b(0x18f),'description':a23_0xd0197b(0x197),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x471036=a24_0x6ade;function a24_0x5de1(){const _0x4c83f1=['Login\x20via\x20browser','write','580683aSbeOz','5237120BBzjcW','login','828112DOUalx','1768095ghzcWo','auth','4739psxALd','read','4156ASFiuH','!\x20Not\x20logged\x20in','logout','log','✓\x20Logged\x20out','86dyuLNn','6hCUPeB','385ElYcBt','37429dXcFEU'];a24_0x5de1=function(){return _0x4c83f1;};return a24_0x5de1();}(function(_0x179dbd,_0x2f6a23){const _0x2c9335=a24_0x6ade,_0x4892a1=_0x179dbd();while(!![]){try{const _0x3731d5=-parseInt(_0x2c9335(0x193))/0x1*(parseInt(_0x2c9335(0x187))/0x2)+-parseInt(_0x2c9335(0x18d))/0x3+parseInt(_0x2c9335(0x195))/0x4*(-parseInt(_0x2c9335(0x189))/0x5)+-parseInt(_0x2c9335(0x188))/0x6*(-parseInt(_0x2c9335(0x18a))/0x7)+-parseInt(_0x2c9335(0x190))/0x8+parseInt(_0x2c9335(0x191))/0x9+parseInt(_0x2c9335(0x18e))/0xa;if(_0x3731d5===_0x2f6a23)break;else _0x4892a1['push'](_0x4892a1['shift']());}catch(_0x3f769c){_0x4892a1['push'](_0x4892a1['shift']());}}}(a24_0x5de1,0x23513));function a24_0x6ade(_0x171f44,_0x41c11f){_0x171f44=_0x171f44-0x183;const _0x5de13a=a24_0x5de1();let _0x6ade1e=_0x5de13a[_0x171f44];return _0x6ade1e;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a24_0x471036(0x18f),'description':a24_0x471036(0x18b),'risk':a24_0x471036(0x194),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x37e6f0){const {runAuthServer:_0x555a74}=await import('../../auth/auth-server-ui.js');return await _0x555a74(),{'ok':!![]};}},{'service':a24_0x471036(0x192),'command':a24_0x471036(0x184),'description':'Clear\x20login\x20session','risk':a24_0x471036(0x18c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x428af8){const _0x3a9dd5=a24_0x471036;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x3a9dd5(0x186))):console[_0x3a9dd5(0x185)](_0x3a9dd5(0x183)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x4337(_0x177854,_0xb51de8){_0x177854=_0x177854-0xa2;const _0x13b1b0=a25_0x13b1();let _0x433798=_0x13b1b0[_0x177854];return _0x433798;}function a25_0x13b1(){const _0x2429c9=['83gJbnuQ','find','5892380QXCBtz','POST','scriptsRoot','BFF\x20lock\x20file\x20not\x20found.','remoteId','length','23258455dTMELx','join','toISOString','7097202FmrLqj','6LWiAwZ','delete','Multiple\x20functions\x20match\x20\x22','keys','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','projectRoot','includes','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','map','scriptsRootDir','startsWith','high-risk-write','lockFilePath','bff','752421PtEQNy','20fucdUG','trashDir','trashedTo','str','3190McjWaL','10551933RUCeSf','Would\x20delete\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','target','filter','validation','Function\x20not\x20found:\x20','10365744rstJFR','replace','functions','\x20\x20-\x20','20jHgKze'];a25_0x13b1=function(){return _0x2429c9;};return a25_0x13b1();}const a25_0x1bab50=a25_0x4337;(function(_0x5555bb,_0x34bbb4){const _0x20bbce=a25_0x4337,_0x5ad95b=_0x5555bb();while(!![]){try{const _0xc6eee7=parseInt(_0x20bbce(0xa3))/0x1*(parseInt(_0x20bbce(0xc3))/0x2)+parseInt(_0x20bbce(0xbe))/0x3*(parseInt(_0x20bbce(0xa2))/0x4)+-parseInt(_0x20bbce(0xa5))/0x5+parseInt(_0x20bbce(0xaf))/0x6*(-parseInt(_0x20bbce(0xae))/0x7)+-parseInt(_0x20bbce(0xcb))/0x8+-parseInt(_0x20bbce(0xc4))/0x9+-parseInt(_0x20bbce(0xbf))/0xa*(-parseInt(_0x20bbce(0xab))/0xb);if(_0xc6eee7===_0x34bbb4)break;else _0x5ad95b['push'](_0x5ad95b['shift']());}catch(_0x294392){_0x5ad95b['push'](_0x5ad95b['shift']());}}}(a25_0x13b1,0xe9159));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0x1bab50(0xbd),'command':a25_0x1bab50(0xb0),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a25_0x1bab50(0xbb),'flags':[{'name':a25_0x1bab50(0xc7),'type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x2c4845){const _0x26819d=a25_0x1bab50,_0x3cae79=loadBffProjectConfig(_0x2c4845[_0x26819d(0xb7)]),_0x5316a3=await readBffLockFile(_0x3cae79[_0x26819d(0xbc)]);if(!_0x5316a3)throw CliErrors[_0x26819d(0xc9)](_0x26819d(0xb3));},async 'dryRun'(_0xb2d88e){const _0x30131f=a25_0x1bab50,_0x161430=loadBffProjectConfig(_0xb2d88e[_0x30131f(0xb7)]),_0x49b362=await readBffLockFile(_0x161430[_0x30131f(0xbc)]);if(!_0x49b362)throw CliErrors[_0x30131f(0xc9)](_0x30131f(0xa8));const {appLock:_0x212b49}=ensureLockScope(_0x49b362,_0xb2d88e[_0x30131f(0xb7)],_0x161430[_0x30131f(0xa7)],_0x30131f(0xb0)),_0x465681=_0xb2d88e[_0x30131f(0xc2)](_0x30131f(0xc7)),_0x230502=Object[_0x30131f(0xb2)](_0x212b49['functions']),_0x49bf57=resolveDeleteTarget(_0x465681,_0x230502),_0x14b5a0=_0x212b49[_0x30131f(0xcd)][_0x49bf57];if(!_0x14b5a0)throw CliErrors[_0x30131f(0xc9)](_0x30131f(0xc6)+_0x49bf57+'\x22.');const _0x4c21e5=resolveLocalFilePathFromLockKey(_0x161430,_0x49bf57),_0x863276=relative(_0x161430['projectRoot'],_0x4c21e5),_0x2e3062=join(_0x161430['trashDir'],'<timestamp>',_0x863276);return{'method':_0x30131f(0xa6),'url':'/api/management/library/scripts/delete','body':{'appCode':_0xb2d88e[_0x30131f(0xb7)],'target':_0x49bf57,'remoteId':_0x14b5a0[_0x30131f(0xa9)],'localFilePath':_0x4c21e5,'trashedPath':_0x2e3062},'description':_0x30131f(0xc5)+_0x49bf57+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x4b1807){const _0x2319d4=a25_0x1bab50,_0x5a4095=loadBffProjectConfig(_0x4b1807[_0x2319d4(0xb7)]),_0x401a49=await readBffLockFile(_0x5a4095[_0x2319d4(0xbc)]);if(!_0x401a49)throw CliErrors[_0x2319d4(0xc9)](_0x2319d4(0xa8));const {lockData:_0xab4ca2,appLock:_0x4d8a18}=ensureLockScope(_0x401a49,_0x4b1807[_0x2319d4(0xb7)],_0x5a4095[_0x2319d4(0xa7)],_0x2319d4(0xb0)),_0x2a84f9=_0x4b1807[_0x2319d4(0xc2)]('target'),_0x471322=Object['keys'](_0x4d8a18[_0x2319d4(0xcd)]),_0x221571=resolveDeleteTarget(_0x2a84f9,_0x471322),_0x599bcb=_0x4d8a18[_0x2319d4(0xcd)][_0x221571];if(!_0x599bcb)throw CliErrors[_0x2319d4(0xc9)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x221571+'\x22.');await deleteBffScript(_0x599bcb[_0x2319d4(0xa9)]),delete _0x4d8a18['functions'][_0x221571],_0x4d8a18['lastSync']=new Date()[_0x2319d4(0xad)](),await writeBffLockFile(_0x5a4095[_0x2319d4(0xbc)],_0xab4ca2);const _0x560d40=resolveLocalFilePathFromLockKey(_0x5a4095,_0x221571);let _0xcb3278;await fileExists(_0x560d40)&&(_0xcb3278=await moveToTrash(_0x5a4095[_0x2319d4(0xb4)],_0x5a4095[_0x2319d4(0xc0)],_0x560d40),await cleanupEmptyDirectories(dirname(_0x560d40),_0x5a4095[_0x2319d4(0xb9)]));const _0x448d34={'deleted':_0x221571,'remoteId':_0x599bcb[_0x2319d4(0xa9)]};if(_0xcb3278)_0x448d34[_0x2319d4(0xc1)]=_0xcb3278;return{'ok':!![],'data':_0x448d34,'message':'Deleted\x20'+_0x221571+(_0xcb3278?_0x2319d4(0xb6):'')};}};function resolveDeleteTarget(_0x424932,_0xdebf7e){const _0x1b36f0=a25_0x1bab50;if(_0x424932[_0x1b36f0(0xb5)]('/')){const _0x21cffa=_0xdebf7e[_0x1b36f0(0xa4)](_0x3d8508=>_0x3d8508===_0x424932);if(!_0x21cffa)throw CliErrors[_0x1b36f0(0xc9)]('Function\x20not\x20found:\x20'+_0x424932);return _0x21cffa;}const _0x32d650=_0xdebf7e[_0x1b36f0(0xc8)](_0x2a4871=>_0x2a4871['split']('/')['at'](-0x1)===_0x424932);if(_0x32d650[_0x1b36f0(0xaa)]===0x0)throw CliErrors[_0x1b36f0(0xc9)](_0x1b36f0(0xca)+_0x424932);if(_0x32d650[_0x1b36f0(0xaa)]>0x1)throw CliErrors[_0x1b36f0(0xc9)](_0x1b36f0(0xb1)+_0x424932+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x32d650[_0x1b36f0(0xb8)](_0x95be92=>_0x1b36f0(0xce)+_0x95be92)[_0x1b36f0(0xac)]('\x0a'));return _0x32d650[0x0];}async function moveToTrash(_0x59fc6e,_0x222d10,_0x51f93c){const _0xee305e=a25_0x1bab50,_0x4887a8=new Date()[_0xee305e(0xad)]()[_0xee305e(0xcc)](/[:.]/g,'-'),_0x357bef=relative(_0x59fc6e,_0x51f93c),_0x4a8bc8=join(_0x222d10,_0x4887a8,_0x357bef);return await mkdir(dirname(_0x4a8bc8),{'recursive':!![]}),await rename(_0x51f93c,_0x4a8bc8),_0x4a8bc8;}async function cleanupEmptyDirectories(_0x17c64f,_0x1b5a97){const _0x3944e7=a25_0x1bab50;let _0x484215=resolve(_0x17c64f);const _0x1610d9=resolve(_0x1b5a97);while(_0x484215[_0x3944e7(0xba)](''+_0x1610d9+sep)||_0x484215===_0x1610d9){if(_0x484215===_0x1610d9)return;try{const _0x33ad35=await readdir(_0x484215);if(_0x33ad35[_0x3944e7(0xaa)]>0x0)return;await rmdir(_0x484215);}catch{return;}_0x484215=dirname(_0x484215);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x5a1e(_0xdcc971,_0x29aaa9){_0xdcc971=_0xdcc971-0xc9;const _0x25d662=a26_0x25d6();let _0x5a1e2e=_0x25d662[_0xdcc971];return _0x5a1e2e;}function a26_0x25d6(){const _0x3e6c10=['1145298dcCfkX','verbose','num','684sRIByZ','6380NRnPkK','(none)','detail','createdTime','192WvMKCF','read','6815WovyKk','10905XKxcdI','843748fAVQvw','appCode','Return\x20full\x20raw\x20script\x20object','7AKkGSD','8390jceXDA','1279860QSEmzw','104697KjxkRr'];a26_0x25d6=function(){return _0x3e6c10;};return a26_0x25d6();}const a26_0x526018=a26_0x5a1e;(function(_0x286f0c,_0x525919){const _0x1b3744=a26_0x5a1e,_0x544fc1=_0x286f0c();while(!![]){try{const _0x50b416=parseInt(_0x1b3744(0xd8))/0x1+parseInt(_0x1b3744(0xd9))/0x2+parseInt(_0x1b3744(0xcb))/0x3+parseInt(_0x1b3744(0xd0))/0x4*(-parseInt(_0x1b3744(0xd7))/0x5)+-parseInt(_0x1b3744(0xcd))/0x6*(parseInt(_0x1b3744(0xc9))/0x7)+parseInt(_0x1b3744(0xd5))/0x8*(parseInt(_0x1b3744(0xcc))/0x9)+parseInt(_0x1b3744(0xca))/0xa*(-parseInt(_0x1b3744(0xd1))/0xb);if(_0x50b416===_0x525919)break;else _0x544fc1['push'](_0x544fc1['shift']());}catch(_0x49bb3a){_0x544fc1['push'](_0x544fc1['shift']());}}}(a26_0x25d6,0x37aaf));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a26_0x526018(0xd3),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a26_0x526018(0xd6),'flags':[{'name':'id','type':'number','required':!![],'description':'Script\x20ID'},{'name':a26_0x526018(0xce),'type':'boolean','description':a26_0x526018(0xdb)}],async 'execute'(_0x93da44){const _0x2b571d=a26_0x526018,_0x1a50ea=await getBffScriptInfo(_0x93da44[_0x2b571d(0xcf)]('id')),_0x1972b8=_0x93da44['bool'](_0x2b571d(0xce));if(_0x1972b8)return{'ok':!![],'data':_0x1a50ea};return{'ok':!![],'data':{'id':_0x1a50ea['id'],'appCode':_0x1a50ea[_0x2b571d(0xda)],'scriptType':_0x1a50ea['scriptType'],'description':_0x1a50ea['description']||_0x2b571d(0xd2),'createdTime':_0x1a50ea[_0x2b571d(0xd4)]??'','updatedTime':_0x1a50ea['updatedTime']??'','scriptContent':_0x1a50ea['scriptContent']??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5646d6,_0x51360e){const _0x146e14=a27_0x4bd5,_0x2abd24=_0x5646d6();while(!![]){try{const _0x15ff52=-parseInt(_0x146e14(0x1b7))/0x1*(parseInt(_0x146e14(0x1b6))/0x2)+-parseInt(_0x146e14(0x1ba))/0x3+-parseInt(_0x146e14(0x1b8))/0x4+-parseInt(_0x146e14(0x1b9))/0x5+parseInt(_0x146e14(0x1b4))/0x6*(parseInt(_0x146e14(0x1b5))/0x7)+parseInt(_0x146e14(0x1bb))/0x8*(parseInt(_0x146e14(0x1b1))/0x9)+-parseInt(_0x146e14(0x1b2))/0xa*(-parseInt(_0x146e14(0x1b3))/0xb);if(_0x15ff52===_0x51360e)break;else _0x2abd24['push'](_0x2abd24['shift']());}catch(_0x543a7c){_0x2abd24['push'](_0x2abd24['shift']());}}}(a27_0x14d7,0x23111));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a27_0x4bd5(_0x2c351b,_0x36add5){_0x2c351b=_0x2c351b-0x1b1;const _0x14d737=a27_0x14d7();let _0x4bd5a1=_0x14d737[_0x2c351b];return _0x4bd5a1;}import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';function a27_0x14d7(){const _0x5f2200=['659349Buvfmc','248dQhiOO','46071CagYsr','30aTctBi','3251314zYSQwb','14898LKQMlp','28QpdNSG','25210mqydsC','20BLazPk','936764NUQART','1028180pGGdVX'];a27_0x14d7=function(){return _0x5f2200;};return a27_0x14d7();}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x532a90=a28_0x127a;(function(_0x23615d,_0x1789f9){const _0x211529=a28_0x127a,_0x37fbe4=_0x23615d();while(!![]){try{const _0x1db378=parseInt(_0x211529(0x17a))/0x1*(parseInt(_0x211529(0x17c))/0x2)+-parseInt(_0x211529(0x181))/0x3*(parseInt(_0x211529(0x180))/0x4)+parseInt(_0x211529(0x188))/0x5*(parseInt(_0x211529(0x187))/0x6)+-parseInt(_0x211529(0x18b))/0x7+-parseInt(_0x211529(0x186))/0x8+parseInt(_0x211529(0x184))/0x9+parseInt(_0x211529(0x189))/0xa;if(_0x1db378===_0x1789f9)break;else _0x37fbe4['push'](_0x37fbe4['shift']());}catch(_0xc70d97){_0x37fbe4['push'](_0x37fbe4['shift']());}}}(a28_0x4853,0xee23c));import{listBffScripts}from'../../core/api-client.js';function a28_0x127a(_0xea807b,_0x595ca3){_0xea807b=_0xea807b-0x177;const _0x485322=a28_0x4853();let _0x127af1=_0x485322[_0xea807b];return _0x127af1;}function a28_0x4853(){const _0x37b6f9=['name','read','4gYoXwW','219867rKVXpP','verbose','scriptType','5525919YuFQwi','Return\x20full\x20script\x20objects','14101328CDLNfw','318exNotl','182230txxNjv','7769580NFFMps','(unnamed)','10031448irtzAx','No\x20BFF\x20scripts\x20found.','ENDPOINT','type','length','List\x20BFF\x20scripts','boolean','str','5298SAhVlG','appCode','348fZJaFw','description'];a28_0x4853=function(){return _0x37b6f9;};return a28_0x4853();}export const bffList={'service':'bff','command':'list','description':a28_0x532a90(0x177),'risk':a28_0x532a90(0x17f),'flags':[{'name':'type','type':'string','description':'Script\x20type\x20filter','default':a28_0x532a90(0x18d),'enum':[a28_0x532a90(0x18d),'COMMON']},{'name':'name','type':'string','description':'Filter\x20by\x20script\x20name'},{'name':a28_0x532a90(0x182),'type':a28_0x532a90(0x178),'description':a28_0x532a90(0x185)}],async 'execute'(_0x175b71){const _0x2af040=a28_0x532a90,_0x38c41f=await listBffScripts(_0x175b71[_0x2af040(0x17b)],_0x175b71[_0x2af040(0x179)](_0x2af040(0x18e)),{'scriptName':_0x175b71[_0x2af040(0x179)](_0x2af040(0x17e))||undefined}),_0x25f2a9=_0x175b71['bool'](_0x2af040(0x182));return{'ok':!![],'data':_0x25f2a9?_0x38c41f:_0x38c41f['map'](_0x17fff8=>({'id':_0x17fff8['id'],'functionName':_0x17fff8['functionName']??'','description':_0x17fff8[_0x2af040(0x17d)]||_0x2af040(0x18a),'scriptType':_0x17fff8[_0x2af040(0x183)]})),'message':_0x38c41f[_0x2af040(0x18f)]===0x0?_0x2af040(0x18c):undefined};}};
|
package/lib/commands/bff/new.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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';}
|
|
1
|
+
const a29_0x296fa4=a29_0x5148;(function(_0x25e7f3,_0x20bb70){const _0x122ea4=a29_0x5148,_0x225faf=_0x25e7f3();while(!![]){try{const _0x10ad25=-parseInt(_0x122ea4(0x10d))/0x1*(-parseInt(_0x122ea4(0xc3))/0x2)+-parseInt(_0x122ea4(0xbe))/0x3+-parseInt(_0x122ea4(0xbc))/0x4+-parseInt(_0x122ea4(0x10f))/0x5*(parseInt(_0x122ea4(0xbf))/0x6)+parseInt(_0x122ea4(0xee))/0x7+-parseInt(_0x122ea4(0x10b))/0x8*(parseInt(_0x122ea4(0xf7))/0x9)+parseInt(_0x122ea4(0x108))/0xa;if(_0x10ad25===_0x20bb70)break;else _0x225faf['push'](_0x225faf['shift']());}catch(_0x2b806b){_0x225faf['push'](_0x225faf['shift']());}}}(a29_0x1e53,0x777e2));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';function a29_0x1e53(){const _0x17532a=['type','6479410MbCNZq','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','length','appCode','Available\x20aliases:\x20','\x20function:\x20','code','function-node','string','2645109AaJkFB','\x20api\x20pull`\x20to\x20refresh.','join','Select\x20dataset:','datasetcode','Dataset\x20not\x20found\x20for\x20code\x20\x22','utf8','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','alias','\x22.\x20','\x22\x20not\x20found.\x20','description','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','No\x20datasets\x20found\x20for\x20this\x20app.','isInteger','\x0a\x20*\x20[脚本名称]\x20','10677300VzSqHd','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','functionNode','8BBJjrx','Operation\x20type\x20\x22','113434lQkGQX','apiDir','3739370KkxxHP','File\x20already\x20exists:\x20','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','includes','validation','2429844mqFlQa','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','584952ofeqIZ','6TxyHMm','parseInt','operation-type','operationType','6jUPLuq','HOOK','ENDPOINT','Operation\x20type\x20(HOOK\x20only)','name','stderr','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','trim','Available:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','Select\x20operation\x20type:','nonInteractive','COMMON','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','HOOK\x20requires\x20alias/operation/node\x20options.','before','map','bff','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','after','\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','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','datasetCode','.js','keys','str','write','\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','question','scriptsRootDir','\x0a\x20*\x20[触发节点]\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20api.ts\x20found.\x20Run\x20`','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','TODO:\x20add\x20script\x20description','Script\x20description','find','Select\x20trigger\x20node:'];a29_0x1e53=function(){return _0x17532a;};return a29_0x1e53();}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_0x296fa4(0xd5),'command':'new','description':a29_0x296fa4(0x111),'risk':'write','flags':[{'name':'type','type':'string','required':!![],'enum':[a29_0x296fa4(0xd0),a29_0x296fa4(0xc5),a29_0x296fa4(0xc4)],'description':'Script\x20type'},{'name':a29_0x296fa4(0xc7),'type':a29_0x296fa4(0xf6),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a29_0x296fa4(0x103),'type':a29_0x296fa4(0xf6),'description':a29_0x296fa4(0xea)},{'name':a29_0x296fa4(0x100),'type':'string','description':a29_0x296fa4(0xe5)},{'name':a29_0x296fa4(0xfb),'type':a29_0x296fa4(0xf6),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':'operation-type','type':'string','description':a29_0x296fa4(0xc6)},{'name':a29_0x296fa4(0xf5),'type':a29_0x296fa4(0xf6),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a29_0x296fa4(0xd3),a29_0x296fa4(0xd7)]}],async 'validate'(_0x161f39){const _0x5a4921=a29_0x296fa4,_0x4e986d=_0x161f39[_0x5a4921(0xde)](_0x5a4921(0xc7));if(!isValidBffFunctionName(_0x4e986d))throw CliErrors[_0x5a4921(0x113)]('Invalid\x20function\x20name\x20\x22'+_0x4e986d+_0x5a4921(0xd9));},async 'execute'(_0x2d25b1){const _0x11c070=a29_0x296fa4,_0x5e346a=loadBffProjectConfig(_0x2d25b1[_0x11c070(0xf1)]),_0xe873b4=_0x2d25b1[_0x11c070(0xde)](_0x11c070(0xed)),_0x4d5ac7=_0x2d25b1[_0x11c070(0xde)](_0x11c070(0xc7)),_0x75edd5=_0x2d25b1[_0x11c070(0xde)](_0x11c070(0x103))||undefined,_0x3ee16f=_0xe873b4===_0x11c070(0xc4)?await resolveHookOptions(_0x5e346a,_0x2d25b1):undefined,_0xf307dd=buildFilePath(_0x5e346a,_0xe873b4,_0x4d5ac7,_0x3ee16f);if(await fileExists(_0xf307dd))throw CliErrors[_0x11c070(0x113)](_0x11c070(0x110)+_0xf307dd);await mkdir(dirname(_0xf307dd),{'recursive':!![]});const _0x51f130=generateTemplate(_0xe873b4,_0x4d5ac7,_0x2d25b1[_0x11c070(0xf1)],_0x75edd5,_0x3ee16f);await writeFile(_0xf307dd,_0x51f130,_0x11c070(0xfd));const _0x7781f0={'type':_0xe873b4,'name':_0x4d5ac7,'path':_0xf307dd};if(_0x75edd5)_0x7781f0[_0x11c070(0x103)]=_0x75edd5;if(_0x3ee16f){if(_0x3ee16f['alias'])_0x7781f0[_0x11c070(0x100)]=_0x3ee16f[_0x11c070(0x100)];_0x7781f0['datasetCode']=_0x3ee16f[_0x11c070(0xdb)],_0x7781f0[_0x11c070(0xc2)]=_0x3ee16f[_0x11c070(0xc2)],_0x7781f0[_0x11c070(0x10a)]=_0x3ee16f[_0x11c070(0x10a)];}return{'ok':!![],'data':_0x7781f0,'message':'Created\x20'+_0xe873b4+_0x11c070(0xf3)+_0x4d5ac7};}};async function resolveHookOptions(_0x542dd8,_0x5c3acc){const _0x42f31a=a29_0x296fa4,_0xb3ef11=loadAliasMap(_0x5c3acc['apiDir'],undefined,resolveApiFilePath(_0x5c3acc[_0x42f31a(0x10e)],_0x5c3acc[_0x42f31a(0xf1)])),_0x4269d6=_0xb3ef11[_0x42f31a(0xf0)]>0x0;let _0x45a4e1,_0x3018af,_0x58fb21;const _0x54cd7d=_0x5c3acc[_0x42f31a(0xde)](_0x42f31a(0x100)),_0x1beeba=_0x5c3acc[_0x42f31a(0xde)](_0x42f31a(0xfb));if(_0x54cd7d){const _0x42719b=resolveAlias(_0x5c3acc[_0x42f31a(0x10e)],_0x54cd7d,undefined,resolveApiFilePath(_0x5c3acc[_0x42f31a(0x10e)],_0x5c3acc[_0x42f31a(0xf1)]));if(!_0x42719b){const _0x4e58ee=_0x4269d6?_0x42f31a(0xf2)+_0xb3ef11['map'](_0x514e05=>_0x514e05[_0x42f31a(0x100)])['join'](',\x20'):_0x42f31a(0xe7)+CLI_BIN_NAME+_0x42f31a(0xd1);throw CliErrors[_0x42f31a(0x113)]('Alias\x20\x22'+_0x54cd7d+_0x42f31a(0x102)+_0x4e58ee);}_0x45a4e1=_0x54cd7d,_0x3018af=_0x42719b;}else{if(_0x1beeba){_0x3018af=_0x1beeba;const _0x2cee08=_0xb3ef11[_0x42f31a(0xeb)](_0xf8d1f3=>_0xf8d1f3[_0x42f31a(0xdb)]===_0x1beeba);_0x45a4e1=_0x2cee08?.['alias'];}else{if(_0x5c3acc[_0x42f31a(0xcf)])throw CliErrors['validation'](_0x42f31a(0xe8));else{if(_0x4269d6){const _0x14da2f=_0xb3ef11['map'](_0x298b55=>_0x298b55[_0x42f31a(0x100)]+'\x20('+_0x298b55['tableName']+')'),_0x25196e=await promptSelect(_0x42f31a(0xfa),_0x14da2f),_0x11ac84=_0xb3ef11[_0x25196e];if(!_0x11ac84)throw CliErrors[_0x42f31a(0x113)]('Invalid\x20dataset\x20selection.');_0x45a4e1=_0x11ac84[_0x42f31a(0x100)],_0x3018af=_0x11ac84['datasetCode'];}else{const _0x584788=await listDatasets(_0x5c3acc[_0x42f31a(0xf1)]);if(_0x584788['length']===0x0)throw CliErrors[_0x42f31a(0x113)](_0x42f31a(0x105));const _0x5014c2=_0x584788[_0x42f31a(0xd4)](_0x443c9a=>_0x443c9a[_0x42f31a(0xc7)]+'\x20('+_0x443c9a['code']+')'),_0x474936=await promptSelect('Select\x20dataset:',_0x5014c2),_0x6d1711=_0x584788[_0x474936];if(!_0x6d1711)throw CliErrors[_0x42f31a(0x113)]('Invalid\x20dataset\x20selection.');_0x3018af=_0x6d1711[_0x42f31a(0xf4)],_0x45a4e1=undefined;}}}}const _0x1deb0d=await listDatasets(_0x5c3acc['appCode']),_0x3bc969=_0x1deb0d[_0x42f31a(0xeb)](_0x13b499=>_0x13b499[_0x42f31a(0xf4)]===_0x3018af);if(!_0x3bc969)throw CliErrors[_0x42f31a(0x113)](_0x42f31a(0xfc)+_0x3018af+_0x42f31a(0x101)+(_0x45a4e1?_0x42f31a(0xfe)+CLI_BIN_NAME+_0x42f31a(0xf8):''));_0x58fb21=_0x3bc969['id'];const _0x3b2e61=_0x45a4e1??_0x3018af,_0x4cb242=await listBffDatasetOperations(_0x5c3acc[_0x42f31a(0xf1)],_0x58fb21),_0x3ce697=_0x4cb242?Object[_0x42f31a(0xdd)](_0x4cb242):[];if(_0x3ce697[_0x42f31a(0xf0)]===0x0)throw CliErrors[_0x42f31a(0x113)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x3b2e61+'.');let _0x5b88d9;const _0x5221ba=_0x5c3acc['str'](_0x42f31a(0xc1));if(_0x5221ba){if(!_0x3ce697[_0x42f31a(0x112)](_0x5221ba))throw CliErrors[_0x42f31a(0x113)](_0x42f31a(0x10c)+_0x5221ba+_0x42f31a(0xcd)+_0x3b2e61+'.\x20'+(_0x42f31a(0xcc)+_0x3ce697[_0x42f31a(0xf9)](',\x20')));_0x5b88d9=_0x5221ba;}else{if(_0x5c3acc['nonInteractive'])throw CliErrors[_0x42f31a(0x113)](_0x42f31a(0xe6));const _0x2dce16=await promptSelect(_0x42f31a(0xce),_0x3ce697);_0x5b88d9=_0x3ce697[_0x2dce16]??_0x3ce697[0x0];}let _0x44ff9d=normalizeHookFunctionNode(_0x5c3acc[_0x42f31a(0xde)](_0x42f31a(0xf5)));if(!_0x44ff9d){if(_0x5c3acc[_0x42f31a(0xde)](_0x42f31a(0xf5)))throw CliErrors['validation'](_0x42f31a(0xef));if(_0x5c3acc[_0x42f31a(0xcf)])throw CliErrors['validation'](_0x42f31a(0xbd));const _0x1aec1c=await promptSelect(_0x42f31a(0xec),[_0x42f31a(0xd3),_0x42f31a(0xd7)]);_0x44ff9d=[_0x42f31a(0xd3),_0x42f31a(0xd7)][_0x1aec1c]??_0x42f31a(0xd3);}return{'alias':_0x45a4e1,'datasetCode':_0x3018af,'datasetId':_0x58fb21,'operationType':_0x5b88d9,'functionNode':_0x44ff9d};}async function promptSelect(_0x2e14ed,_0x494262){const _0x58ca8d=a29_0x296fa4;if(_0x494262[_0x58ca8d(0xf0)]===0x1)return 0x0;for(const [_0x2d3028,_0x3aff42]of _0x494262['entries']()){process[_0x58ca8d(0xc8)]['write']('\x20\x20'+(_0x2d3028+0x1)+'.\x20'+_0x3aff42+'\x0a');}const _0x5316a4=createInterface({'input':process['stdin'],'output':process[_0x58ca8d(0xc8)]});while(!![]){const _0x31ecd6=await new Promise(_0x354301=>{const _0x3f69cd=_0x58ca8d;_0x5316a4[_0x3f69cd(0xe1)](_0x2e14ed+'\x20',_0x354301);}),_0x1ae790=Number[_0x58ca8d(0xc0)](_0x31ecd6[_0x58ca8d(0xcb)](),0xa);if(Number[_0x58ca8d(0x106)](_0x1ae790)&&_0x1ae790>=0x1&&_0x1ae790<=_0x494262[_0x58ca8d(0xf0)])return _0x5316a4['close'](),_0x1ae790-0x1;process['stderr'][_0x58ca8d(0xdf)](_0x58ca8d(0x109)+_0x494262[_0x58ca8d(0xf0)]+'.\x0a');}}function buildFilePath(_0x293ac4,_0x3c5dc3,_0x54b66a,_0x21b596){const _0x12c20d=a29_0x296fa4;if(_0x3c5dc3==='HOOK'){if(!_0x21b596)throw CliErrors[_0x12c20d(0x113)](_0x12c20d(0xd2));const _0x3ee708=_0x21b596[_0x12c20d(0x100)]??_0x21b596['datasetCode'];return join(_0x293ac4[_0x12c20d(0xe2)],'HOOK',_0x3ee708,_0x21b596['operationType'],_0x21b596['functionNode'],_0x54b66a+_0x12c20d(0xdc));}return join(_0x293ac4[_0x12c20d(0xe2)],_0x3c5dc3,_0x54b66a+_0x12c20d(0xdc));}function a29_0x5148(_0xf2ea50,_0x35ba8d){_0xf2ea50=_0xf2ea50-0xbc;const _0x1e53d3=a29_0x1e53();let _0x5148ed=_0x1e53d3[_0xf2ea50];return _0x5148ed;}export function generateTemplate(_0x2c1329,_0x14d145,_0x1ec564,_0x4acefa,_0x4bb816){const _0x45f90e=a29_0x296fa4,_0x2a9f93=_0x4acefa?.[_0x45f90e(0xcb)]()||_0x45f90e(0xe9);if(_0x2c1329===_0x45f90e(0xd0))return _0x45f90e(0xd6)+_0x2a9f93+_0x45f90e(0x107)+_0x14d145+_0x45f90e(0xda)+_0x14d145+'.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'+_0x14d145+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x2c1329===_0x45f90e(0xc5))return _0x45f90e(0xe4)+_0x2a9f93+_0x45f90e(0x104)+_0x1ec564+'/endpoint/'+_0x14d145+_0x45f90e(0xe0)+_0x14d145+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x4bb816)throw CliErrors['validation'](_0x45f90e(0xc9));return _0x45f90e(0xff)+_0x2a9f93+_0x45f90e(0x104)+_0x1ec564+'/'+_0x4bb816[_0x45f90e(0xdb)]+'/'+_0x4bb816[_0x45f90e(0xc2)]+_0x45f90e(0xe3)+_0x4bb816[_0x45f90e(0x10a)]+_0x45f90e(0xd8)+_0x14d145+_0x45f90e(0xca);}
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x5c956f=a30_0x22c8;(function(_0x55bef8,_0x5610b8){const _0x6adf09=a30_0x22c8,_0x46322d=_0x55bef8();while(!![]){try{const _0x40585b=parseInt(_0x6adf09(0xd7))/0x1+parseInt(_0x6adf09(0xe0))/0x2+parseInt(_0x6adf09(0xac))/0x3*(parseInt(_0x6adf09(0xd0))/0x4)+-parseInt(_0x6adf09(0xd9))/0x5+parseInt(_0x6adf09(0xb4))/0x6+-parseInt(_0x6adf09(0xcf))/0x7*(parseInt(_0x6adf09(0xa6))/0x8)+parseInt(_0x6adf09(0xc8))/0x9*(-parseInt(_0x6adf09(0xe1))/0xa);if(_0x40585b===_0x5610b8)break;else _0x46322d['push'](_0x46322d['shift']());}catch(_0x35194c){_0x46322d['push'](_0x46322d['shift']());}}}(a30_0x15f1,0x84898));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a30_0x22c8(_0x1bc3c9,_0x536ac9){_0x1bc3c9=_0x1bc3c9-0xa3;const _0x15f113=a30_0x15f1();let _0x22c8d8=_0x15f113[_0x1bc3c9];return _0x22c8d8;}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a30_0x15f1(){const _0x19c1a3=['9xVSYth','functions','utf8','functionName','type','bff','pull','434Ypcmlp','4JmrXDK','validation','question','scriptContent','all','Force\x20overwrite\x20local\x20unsynced\x20changes','toISOString','1080978UaSyeQ','yes','3787565DOqMly','toLowerCase','force','would_pull','Pull\x20complete:\x20','appCode','HOOK','977564FVzzet','6705250Agaqxy','\x20failed','length','hash','bool','apiDir','Pull\x20only\x20this\x20script\x20type','Would\x20inspect\x20','message','filePath','cancelled','write','60584RyqMxn','boolean','ENDPOINT','GET','\x20pulled,\x20','Lock\x20scope\x20for\x20app\x20\x22','1505226zJeiep','lockFilePath','lockKey','Force\x20pull\x20cancelled.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','alias','\x20remote\x20BFF\x20script(s)\x20for\x20pull','push','2213604XNYSOo','scriptType','datasetCode','includes','Remote\x20script\x20missing\x20content.','map','hookLocation','stdin','\x20skipped,\x20','stringify','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','operationType','stderr','conflict','str','scriptsRoot','functionNode','Remote\x20script\x20missing\x20id.','nonInteractive','/api/management/library/scripts/list?appCode='];a30_0x15f1=function(){return _0x19c1a3;};return a30_0x15f1();}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_0x5c956f(0xcd),'command':a30_0x5c956f(0xce),'description':a30_0x5c956f(0xbe),'risk':a30_0x5c956f(0xa5),'flags':[{'name':a30_0x5c956f(0xcc),'type':'string','description':a30_0x5c956f(0xe7),'enum':['COMMON',a30_0x5c956f(0xa8),'HOOK']},{'name':'force','type':a30_0x5c956f(0xa7),'description':a30_0x5c956f(0xd5)}],async 'dryRun'(_0x4e7465){const _0x183c3e=a30_0x5c956f,_0x58615b=loadBffProjectConfig(_0x4e7465[_0x183c3e(0xde)]),_0x4ec251=await readBffLockFile(_0x58615b[_0x183c3e(0xad)]),{appLock:_0xb208a0}=ensureLockScope(_0x4ec251??createEmptyBffLock(),_0x4e7465[_0x183c3e(0xde)],_0x58615b[_0x183c3e(0xc3)],_0x183c3e(0xce)),_0x247d3d=normalizeBffType(_0x4e7465['str']('type'))??undefined,_0x36a28a=buildDatasetCodeToAliasMap(_0x4e7465[_0x183c3e(0xe6)],_0x4e7465[_0x183c3e(0xde)]),[_0x2c00d1,_0x35fd54]=await Promise[_0x183c3e(0xd4)]([listBffScripts(_0x4e7465[_0x183c3e(0xde)],_0x247d3d),getBffScriptStatistics(_0x4e7465[_0x183c3e(0xde)])]),_0x9fd09c=createHookLocationMap(_0x35fd54),_0x3a87d0=[];for(const _0x4d8136 of _0x2c00d1){const _0x428146=resolveRemoteScriptTarget(_0x58615b,_0x4d8136,_0x9fd09c,_0xb208a0['functions'],_0x36a28a);if(!_0x428146){_0x3a87d0[_0x183c3e(0xb3)]({'scriptType':_0x4d8136['scriptType'],'functionName':_0x4d8136['functionName']??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x35b724=_0xb208a0[_0x183c3e(0xc9)][_0x428146[_0x183c3e(0xae)]],_0x28512f=_0x4d8136[_0x183c3e(0xd3)]!=null?computeContentHash(_0x4d8136[_0x183c3e(0xd3)]):undefined,_0x45f1eb=await hasUnsyncedLocalChanges(_0x428146[_0x183c3e(0xa3)],_0x35b724,_0x28512f);_0x3a87d0['push']({'lockKey':_0x428146[_0x183c3e(0xae)],'filePath':_0x428146[_0x183c3e(0xa3)],'remoteId':_0x4d8136['id']??null,'status':_0x45f1eb?_0x183c3e(0xc1):_0x183c3e(0xdc)});}return{'method':_0x183c3e(0xa9),'url':_0x183c3e(0xc7)+_0x4e7465['appCode']+(_0x247d3d?'&type='+_0x247d3d:''),'body':{'appCode':_0x4e7465[_0x183c3e(0xde)],'filterType':_0x247d3d??null,'files':_0x3a87d0},'description':_0x183c3e(0xe8)+_0x3a87d0['length']+_0x183c3e(0xb2)};},async 'execute'(_0x4a84b9){const _0xb6a392=a30_0x5c956f,_0x3b9c4e=loadBffProjectConfig(_0x4a84b9[_0xb6a392(0xde)]),_0x450ddd=await readBffLockFile(_0x3b9c4e[_0xb6a392(0xad)]),{lockData:_0x933adf,appLock:_0x568414}=ensureLockScope(_0x450ddd??createEmptyBffLock(),_0x4a84b9[_0xb6a392(0xde)],_0x3b9c4e[_0xb6a392(0xc3)],_0xb6a392(0xce)),_0x2ea98c=normalizeBffType(_0x4a84b9[_0xb6a392(0xc2)](_0xb6a392(0xcc)))??undefined;if(_0x4a84b9['str']('type')&&!_0x2ea98c)throw CliErrors[_0xb6a392(0xd1)](_0xb6a392(0xb0));const [_0x3d672e,_0x4dac8f]=await Promise[_0xb6a392(0xd4)]([listBffScripts(_0x4a84b9[_0xb6a392(0xde)],_0x2ea98c),getBffScriptStatistics(_0x4a84b9[_0xb6a392(0xde)])]);if(_0x3d672e[_0xb6a392(0xe3)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x2d230b=_0x4a84b9[_0xb6a392(0xe5)](_0xb6a392(0xdb));if(_0x2d230b&&!_0x4a84b9['nonInteractive']){const _0x2916d9=await confirmForce();if(!_0x2916d9)throw CliErrors[_0xb6a392(0xa4)](_0xb6a392(0xaf));}if(_0x2d230b&&_0x4a84b9[_0xb6a392(0xc6)]){}const _0x1b009b=buildDatasetCodeToAliasMap(_0x4a84b9[_0xb6a392(0xe6)],_0x4a84b9[_0xb6a392(0xde)]),_0xce7fca=createHookLocationMap(_0x4dac8f),_0x50c443=JSON['parse'](JSON[_0xb6a392(0xbd)](_0x933adf)),_0xf9adeb=_0x4a84b9[_0xb6a392(0xde)],_0x13772b=_0x50c443['apps'][_0xf9adeb];if(!_0x13772b)throw new Error(_0xb6a392(0xab)+_0xf9adeb+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x284a32=[],_0x42cd71=[],_0x1f84a3=[];for(const _0x6e0f20 of _0x3d672e){const _0x5484e6=resolveRemoteScriptTarget(_0x3b9c4e,_0x6e0f20,_0xce7fca,_0x568414[_0xb6a392(0xc9)],_0x1b009b);if(!_0x5484e6){_0x42cd71[_0xb6a392(0xb3)]({'lockKey':_0x6e0f20[_0xb6a392(0xb5)]+'/'+_0x6e0f20[_0xb6a392(0xcb)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x552968=_0x568414['functions'][_0x5484e6[_0xb6a392(0xae)]];try{if(!_0x6e0f20['id'])throw new Error(_0xb6a392(0xc5));if(_0x6e0f20[_0xb6a392(0xd3)]==null)throw new Error(_0xb6a392(0xb8));const _0x30f4ef=_0x6e0f20[_0xb6a392(0xd3)],_0x3f9acf=computeContentHash(_0x30f4ef);if(!_0x2d230b){const _0x5aed56=await hasUnsyncedLocalChanges(_0x5484e6['filePath'],_0x552968,_0x3f9acf);if(_0x5aed56){_0x42cd71[_0xb6a392(0xb3)]({'lockKey':_0x5484e6[_0xb6a392(0xae)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x5484e6['filePath']),await writeFile(_0x5484e6[_0xb6a392(0xa3)],_0x30f4ef,_0xb6a392(0xca));const _0x181960={'hash':_0x3f9acf,'remoteId':_0x6e0f20['id'],'version':_0x6e0f20['version']};_0x5484e6[_0xb6a392(0xcc)]===_0xb6a392(0xdf)&&_0x5484e6['hookLocation']&&(_0x181960[_0xb6a392(0xb1)]=_0x5484e6[_0xb6a392(0xba)][_0xb6a392(0xb1)],_0x181960[_0xb6a392(0xb6)]=_0x5484e6[_0xb6a392(0xba)]['datasetCode'],_0x181960['operationType']=_0x5484e6[_0xb6a392(0xba)][_0xb6a392(0xbf)],_0x181960[_0xb6a392(0xc4)]=_0x5484e6[_0xb6a392(0xba)][_0xb6a392(0xc4)]),_0x13772b['functions'][_0x5484e6[_0xb6a392(0xae)]]=_0x181960,_0x284a32[_0xb6a392(0xb3)]({'lockKey':_0x5484e6[_0xb6a392(0xae)],'remoteId':_0x6e0f20['id']});}catch(_0x193f83){_0x1f84a3['push']({'lockKey':_0x5484e6['lockKey'],'error':_0x193f83 instanceof Error?_0x193f83[_0xb6a392(0xe9)]:String(_0x193f83)});}}return _0x13772b['lastSync']=new Date()[_0xb6a392(0xd6)](),await writeBffLockFile(_0x3b9c4e[_0xb6a392(0xad)],_0x50c443),{'ok':_0x1f84a3[_0xb6a392(0xe3)]===0x0,'data':{'pulled':_0x284a32,'skipped':_0x42cd71,'failed':_0x1f84a3},'message':_0xb6a392(0xdd)+_0x284a32[_0xb6a392(0xe3)]+_0xb6a392(0xaa)+_0x42cd71[_0xb6a392(0xe3)]+_0xb6a392(0xbc)+_0x1f84a3[_0xb6a392(0xe3)]+_0xb6a392(0xe2)};}};async function hasUnsyncedLocalChanges(_0x5cbb52,_0x5e58d2,_0x6467a7){const _0x29ae55=a30_0x5c956f;if(!await fileExists(_0x5cbb52))return![];const _0x4af5e5=await computeFileHash(_0x5cbb52);if(!_0x5e58d2)return _0x6467a7?_0x4af5e5!==_0x6467a7:!![];return _0x4af5e5!==_0x5e58d2[_0x29ae55(0xe4)];}function buildDatasetCodeToAliasMap(_0x489afb,_0x43905a){const _0x31566b=a30_0x5c956f,_0x286fc6=loadAliasMap(_0x489afb,undefined,resolveApiFilePath(_0x489afb,_0x43905a));return new Map(_0x286fc6[_0x31566b(0xb9)](_0x25afa4=>[_0x25afa4['datasetCode'],_0x25afa4[_0x31566b(0xb1)]]));}async function confirmForce(){const _0x4f4bc3=a30_0x5c956f,_0x5b5e11=createInterface({'input':process[_0x4f4bc3(0xbb)],'output':process[_0x4f4bc3(0xc0)]}),_0x409d23=await new Promise(_0x50c85c=>{const _0x5582d7=_0x4f4bc3;_0x5b5e11[_0x5582d7(0xd2)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x50c85c);});return _0x5b5e11['close'](),['y',_0x4f4bc3(0xd8)][_0x4f4bc3(0xb7)](_0x409d23['trim']()[_0x4f4bc3(0xda)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
const a31_0x475ffb=a31_0xf72e;(function(_0x1098b9,_0x1d18b9){const _0x3c96d2=a31_0xf72e,_0x212549=_0x1098b9();while(!![]){try{const _0x56ba08=parseInt(_0x3c96d2(0x165))/0x1+parseInt(_0x3c96d2(0x149))/0x2+parseInt(_0x3c96d2(0x158))/0x3+-parseInt(_0x3c96d2(0x175))/0x4+parseInt(_0x3c96d2(0x172))/0x5*(-parseInt(_0x3c96d2(0x179))/0x6)+parseInt(_0x3c96d2(0x177))/0x7*(-parseInt(_0x3c96d2(0x14f))/0x8)+-parseInt(_0x3c96d2(0x16c))/0x9*(parseInt(_0x3c96d2(0x168))/0xa);if(_0x56ba08===_0x1d18b9)break;else _0x212549['push'](_0x212549['shift']());}catch(_0x52cb74){_0x212549['push'](_0x212549['shift']());}}}(a31_0x4362,0x71e55));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a31_0x4362(){const _0x4c4a55=['functionNode','push','description','would_push','remoteId','some','operationType','Push\x20complete:\x20','Run\x20`','force','763056IjIFOZ','POST','hash','create','name','filter','313464lcCqlI','\x20failed','get','map','datasetCodeToId','toISOString','Force\x20push\x20ignoring\x20hash\x20protection','bool','version','2596596KBfeiV','str','high-risk-write','Push\x20local\x20BFF\x20scripts\x20to\x20remote','has','No\x20local\x20BFF\x20functions\x20found.',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','update','apiDir','Cannot\x20resolve\x20dataset\x20for\x20\x22','filePath','Push\x20only\x20this\x20script\x20type','boolean','354080ZBnTyZ','alias','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','4986290brxdjK','scriptsRoot','\x20skipped,\x20','message','9sIQQes','values','code','Incomplete\x20HOOK\x20path:\x20','functions','utf8','131240KOWCGc','unchanged','datasetCode','343680QFzxJK','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','42FNrbJq','bff','72STLDDA','aliasToDatasetCode','lockKey','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','ENDPOINT','type','length','\x22.\x20','set','HOOK','appCode','validation','Local\x20function\x20not\x20found:\x20'];a31_0x4362=function(){return _0x4c4a55;};return a31_0x4362();}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';function a31_0xf72e(_0xb0eba5,_0x3ce2e9){_0xb0eba5=_0xb0eba5-0x134;const _0x436205=a31_0x4362();let _0xf72eda=_0x436205[_0xb0eba5];return _0xf72eda;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a31_0x475ffb(0x178),'command':a31_0x475ffb(0x140),'description':a31_0x475ffb(0x15b),'risk':a31_0x475ffb(0x15a),'flags':[{'name':a31_0x475ffb(0x137),'type':'string','description':a31_0x475ffb(0x163),'enum':['COMMON',a31_0x475ffb(0x136),a31_0x475ffb(0x13b)]},{'name':'name','type':'string','description':a31_0x475ffb(0x135)},{'name':a31_0x475ffb(0x148),'type':a31_0x475ffb(0x164),'description':a31_0x475ffb(0x155)}],async 'dryRun'(_0x31aee5){const _0x31e33a=a31_0x475ffb,_0x276db3=loadBffProjectConfig(_0x31aee5[_0x31e33a(0x13c)]),_0x3df681=await readBffLockFile(_0x276db3['lockFilePath']),{appLock:_0x3ae29b}=ensureLockScope(_0x3df681??createEmptyBffLock(),_0x31aee5[_0x31e33a(0x13c)],_0x276db3['scriptsRoot'],'push'),_0x11f9f0=await getTargetFunctions(_0x276db3,_0x31aee5),_0x2d4c5d=_0x31aee5[_0x31e33a(0x156)](_0x31e33a(0x148)),_0x42d866=[];for(const _0x123d2b of _0x11f9f0){const _0x468940=await computeFileHash(_0x123d2b[_0x31e33a(0x162)]),_0x324d1b=_0x3ae29b[_0x31e33a(0x170)][_0x123d2b['lockKey']],_0x953226=!!_0x324d1b&&_0x324d1b[_0x31e33a(0x14b)]===_0x468940;_0x42d866['push']({'lockKey':_0x123d2b[_0x31e33a(0x134)],'filePath':_0x123d2b[_0x31e33a(0x162)],'remoteId':_0x324d1b?.[_0x31e33a(0x143)]??null,'mode':_0x324d1b?.[_0x31e33a(0x143)]?_0x31e33a(0x15f):_0x31e33a(0x14c),'status':!_0x2d4c5d&&_0x953226?_0x31e33a(0x173):_0x31e33a(0x142)});}return{'method':_0x31e33a(0x14a),'url':'/api/management/library/scripts/save','body':{'appCode':_0x31aee5['appCode'],'force':_0x2d4c5d,'files':_0x42d866},'description':'Would\x20inspect\x20'+_0x42d866['length']+'\x20local\x20BFF\x20script(s)\x20for\x20push'};},async 'execute'(_0x269761){const _0x3ba629=a31_0x475ffb,_0x3a812e=loadBffProjectConfig(_0x269761['appCode']),_0x3f7055=await readBffLockFile(_0x3a812e['lockFilePath']),{lockData:_0x23a286,appLock:_0x257d0f}=ensureLockScope(_0x3f7055??createEmptyBffLock(),_0x269761[_0x3ba629(0x13c)],_0x3a812e[_0x3ba629(0x169)],_0x3ba629(0x140)),_0x336e94=await getTargetFunctions(_0x3a812e,_0x269761);if(_0x336e94[_0x3ba629(0x138)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x3ba629(0x15d)};const _0x447deb=_0x269761[_0x3ba629(0x156)]('force'),_0x2386ab=await buildHookMaps(_0x269761['appCode'],_0x269761[_0x3ba629(0x160)],_0x336e94,_0x257d0f),_0x15ece5=[],_0x142b9e=[],_0x161101=[];for(const _0x3f8add of _0x336e94){const _0x20d458=await computeFileHash(_0x3f8add[_0x3ba629(0x162)]),_0x36a310=_0x257d0f['functions'][_0x3f8add[_0x3ba629(0x134)]];if(!_0x447deb&&_0x36a310&&_0x36a310[_0x3ba629(0x14b)]===_0x20d458){_0x142b9e[_0x3ba629(0x140)]({'lockKey':_0x3f8add[_0x3ba629(0x134)],'reason':_0x3ba629(0x173)});continue;}try{await uploadSingleFunction(_0x269761['appCode'],_0x3f8add,_0x257d0f,_0x2386ab);const _0x49dfb3=_0x257d0f['functions'][_0x3f8add[_0x3ba629(0x134)]];_0x15ece5[_0x3ba629(0x140)]({'lockKey':_0x3f8add[_0x3ba629(0x134)],'remoteId':_0x49dfb3?.['remoteId']??0x0});}catch(_0x287dd5){_0x161101[_0x3ba629(0x140)]({'lockKey':_0x3f8add['lockKey'],'error':_0x287dd5 instanceof Error?_0x287dd5[_0x3ba629(0x16b)]:String(_0x287dd5)});}}return _0x257d0f['lastSync']=new Date()[_0x3ba629(0x154)](),await writeBffLockFile(_0x3a812e['lockFilePath'],_0x23a286),{'ok':_0x161101[_0x3ba629(0x138)]===0x0,'data':{'uploaded':_0x15ece5,'skipped':_0x142b9e,'failed':_0x161101},'message':_0x3ba629(0x146)+_0x15ece5[_0x3ba629(0x138)]+'\x20uploaded,\x20'+_0x142b9e[_0x3ba629(0x138)]+_0x3ba629(0x16a)+_0x161101[_0x3ba629(0x138)]+_0x3ba629(0x150)};}};async function getTargetFunctions(_0x4cf85e,_0xe46630){const _0x17a020=a31_0x475ffb,_0x17ddcc=_0xe46630[_0x17a020(0x159)]('type'),_0x7880ef=_0xe46630[_0x17a020(0x159)](_0x17a020(0x14d)),_0xb94227=normalizeBffType(_0x17ddcc)??undefined;if(_0x7880ef&&!_0xb94227)throw CliErrors['validation'](_0x17a020(0x176));const _0x7e719b=await scanLocalBffFunctions(_0x4cf85e,_0xb94227);if(_0x7880ef){const _0x4199a0=_0x7e719b[_0x17a020(0x14e)](_0x56457e=>_0x56457e[_0x17a020(0x14d)]===_0x7880ef);if(_0x4199a0[_0x17a020(0x138)]===0x0)throw CliErrors['validation'](_0x17a020(0x13e)+_0xb94227+'/'+_0x7880ef);return _0x4199a0;}return _0x7e719b;}async function buildHookMaps(_0x3019f2,_0x3b0c97,_0xf085b4,_0x2e1942){const _0x32a570=a31_0x475ffb,_0x4dc8c8=_0xf085b4[_0x32a570(0x144)](_0x103e2d=>_0x103e2d[_0x32a570(0x137)]==='HOOK');if(!_0x4dc8c8)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x40c4d4=loadAliasMap(_0x3b0c97,undefined,resolveApiFilePath(_0x3b0c97,_0x3019f2)),_0x4aff3e=new Map(_0x40c4d4['map'](_0x4ad50f=>[_0x4ad50f[_0x32a570(0x166)],_0x4ad50f[_0x32a570(0x174)]]));for(const _0x3927ee of Object[_0x32a570(0x16d)](_0x2e1942[_0x32a570(0x170)])){_0x3927ee['alias']&&_0x3927ee['datasetCode']&&!_0x4aff3e[_0x32a570(0x15c)](_0x3927ee[_0x32a570(0x166)])&&_0x4aff3e[_0x32a570(0x13a)](_0x3927ee['alias'],_0x3927ee[_0x32a570(0x174)]);}const _0x3a5714=await listDatasets(_0x3019f2),_0x363906=new Map(_0x3a5714[_0x32a570(0x152)](_0x1a5993=>[_0x1a5993[_0x32a570(0x16e)],_0x1a5993['id']]));return{'aliasToDatasetCode':_0x4aff3e,'datasetCodeToId':_0x363906};}async function uploadSingleFunction(_0x5ad117,_0xdd06a4,_0x5add4b,_0x4d9bba){const _0x5f4264=a31_0x475ffb,_0x18c8a6=await readFile(_0xdd06a4[_0x5f4264(0x162)],_0x5f4264(0x171)),_0x5c05bf=await computeFileHash(_0xdd06a4[_0x5f4264(0x162)]),_0x1ada32=_0x5add4b[_0x5f4264(0x170)][_0xdd06a4[_0x5f4264(0x134)]];if(_0x1ada32?.['remoteId']&&_0x1ada32[_0x5f4264(0x157)]==null)throw CliErrors[_0x5f4264(0x13d)](_0xdd06a4[_0x5f4264(0x134)]+_0x5f4264(0x15e));let _0x571312=extractScriptDescription(_0x18c8a6);if(!_0x571312&&_0x1ada32?.['remoteId']){const _0x22153f=await getBffScriptInfo(_0x1ada32[_0x5f4264(0x143)]);_0x571312=_0x22153f[_0x5f4264(0x141)]||undefined;}const _0x4bd8c7={'appCode':_0x5ad117,'functionName':_0xdd06a4['name'],'scriptType':_0xdd06a4[_0x5f4264(0x137)],'scriptContent':_0x18c8a6};if(_0x1ada32?.[_0x5f4264(0x143)])_0x4bd8c7['id']=_0x1ada32[_0x5f4264(0x143)];if(_0x1ada32?.[_0x5f4264(0x157)]!=null)_0x4bd8c7[_0x5f4264(0x157)]=_0x1ada32['version'];if(_0x571312)_0x4bd8c7[_0x5f4264(0x141)]=_0x571312;if(_0xdd06a4[_0x5f4264(0x137)]===_0x5f4264(0x13b)){const _0x32ff48=_0xdd06a4[_0x5f4264(0x166)];if(!_0x32ff48||!_0xdd06a4[_0x5f4264(0x145)]||!_0xdd06a4[_0x5f4264(0x13f)])throw CliErrors[_0x5f4264(0x13d)](_0x5f4264(0x16f)+_0xdd06a4['lockKey']);const _0x3e0c9b=_0x4d9bba[_0x5f4264(0x17a)][_0x5f4264(0x151)](_0x32ff48)??_0x1ada32?.['datasetCode']??_0x32ff48,_0x2f84d3=_0x4d9bba[_0x5f4264(0x153)][_0x5f4264(0x151)](_0x3e0c9b);if(!_0x2f84d3)throw CliErrors[_0x5f4264(0x13d)](_0x5f4264(0x161)+_0x32ff48+_0x5f4264(0x139)+(_0x5f4264(0x147)+CLI_BIN_NAME+_0x5f4264(0x167)));_0x4bd8c7['datasetId']=_0x2f84d3,_0x4bd8c7[_0x5f4264(0x145)]=_0xdd06a4[_0x5f4264(0x145)],_0x4bd8c7[_0x5f4264(0x13f)]=_0xdd06a4['functionNode'];}const _0x3d00bf=await saveBffScript(_0x4bd8c7),_0x3cc6b1=await getBffScriptInfo(_0x3d00bf),_0x4ddf33={'hash':_0x5c05bf,'remoteId':_0x3d00bf,'version':_0x3cc6b1[_0x5f4264(0x157)]};if(_0xdd06a4[_0x5f4264(0x137)]==='HOOK'){const _0xd32441=_0xdd06a4[_0x5f4264(0x166)],_0x16b0ab=_0x4d9bba[_0x5f4264(0x17a)][_0x5f4264(0x151)](_0xd32441)??_0x1ada32?.[_0x5f4264(0x174)]??_0xd32441;_0x4d9bba[_0x5f4264(0x17a)][_0x5f4264(0x15c)](_0xd32441)?_0x4ddf33['alias']=_0xd32441:_0x4ddf33[_0x5f4264(0x166)]=_0x1ada32?.[_0x5f4264(0x166)],_0x4ddf33[_0x5f4264(0x174)]=_0x16b0ab,_0x4ddf33['operationType']=_0xdd06a4['operationType'],_0x4ddf33[_0x5f4264(0x13f)]=_0xdd06a4['functionNode'];}_0x5add4b[_0x5f4264(0x170)][_0xdd06a4['lockKey']]=_0x4ddf33;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x368644=a32_0x17ba;(function(_0x4079c6,_0xae3d9e){const _0x5d7fe8=a32_0x17ba,_0x55b5c4=_0x4079c6();while(!![]){try{const _0x47b596=-parseInt(_0x5d7fe8(0x1d2))/0x1+parseInt(_0x5d7fe8(0x1bc))/0x2*(parseInt(_0x5d7fe8(0x1d4))/0x3)+-parseInt(_0x5d7fe8(0x1d5))/0x4+parseInt(_0x5d7fe8(0x1cc))/0x5*(-parseInt(_0x5d7fe8(0x1bb))/0x6)+parseInt(_0x5d7fe8(0x1c6))/0x7*(-parseInt(_0x5d7fe8(0x1c7))/0x8)+parseInt(_0x5d7fe8(0x1c9))/0x9+parseInt(_0x5d7fe8(0x1cd))/0xa;if(_0x47b596===_0xae3d9e)break;else _0x55b5c4['push'](_0x55b5c4['shift']());}catch(_0x3a812b){_0x55b5c4['push'](_0x55b5c4['shift']());}}}(a32_0x2f82,0x8db16));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';function a32_0x17ba(_0x3a68e9,_0x26152a){_0x3a68e9=_0x3a68e9-0x1ba;const _0x2f823c=a32_0x2f82();let _0x17baa8=_0x2f823c[_0x3a68e9];return _0x17baa8;}export const bffStatus={'service':a32_0x368644(0x1d6),'command':a32_0x368644(0x1ca),'description':a32_0x368644(0x1ba),'risk':a32_0x368644(0x1c5),'flags':[{'name':a32_0x368644(0x1c1),'type':a32_0x368644(0x1ce),'description':a32_0x368644(0x1d9)}],async 'execute'(_0x2b31b7){const _0x3096a6=a32_0x368644,_0x36ce87=loadBffProjectConfig(_0x2b31b7[_0x3096a6(0x1c8)]),_0x3d998c=await readBffLockFile(_0x36ce87['lockFilePath']),{appLock:_0x3a2b68}=ensureLockScope(_0x3d998c??createEmptyBffLock(),_0x2b31b7[_0x3096a6(0x1c8)],_0x36ce87[_0x3096a6(0x1cb)],_0x3096a6(0x1ca)),_0x3a5cf1=await scanLocalBffFunctions(_0x36ce87),_0x21271e=[],_0xdb922e=[],_0x898af8=[];for(const _0x388b37 of _0x3a5cf1){const _0x380855=await computeFileHash(_0x388b37[_0x3096a6(0x1d8)]),_0x4cef44=_0x3a2b68[_0x3096a6(0x1d3)][_0x388b37[_0x3096a6(0x1be)]];if(!_0x4cef44)_0x21271e['push'](_0x388b37[_0x3096a6(0x1be)]);else _0x4cef44['hash']!==_0x380855?_0xdb922e[_0x3096a6(0x1c2)](_0x388b37[_0x3096a6(0x1be)]):_0x898af8[_0x3096a6(0x1c2)](_0x388b37['lockKey']);}const _0xd0cc07=[];if(_0x2b31b7['bool'](_0x3096a6(0x1c1))){const _0x126ecf=loadAliasMap(_0x2b31b7['apiDir'],undefined,resolveApiFilePath(_0x2b31b7['apiDir'],_0x2b31b7['appCode'])),_0x1e1682=new Map(_0x126ecf['map'](_0x25c1cb=>[_0x25c1cb[_0x3096a6(0x1d7)],_0x25c1cb[_0x3096a6(0x1bd)]])),[_0x118ccf,_0x4de732]=await Promise['all']([listBffScripts(_0x2b31b7['appCode']),getBffScriptStatistics(_0x2b31b7[_0x3096a6(0x1c8)])]),_0x3e23ce=createHookLocationMap(_0x4de732),_0x1df5b3=new Set(_0x3a5cf1[_0x3096a6(0x1c3)](_0x444691=>_0x444691[_0x3096a6(0x1be)]));for(const _0x276d00 of _0x118ccf){const _0x51b3bd=resolveRemoteScriptTarget(_0x36ce87,_0x276d00,_0x3e23ce,_0x3a2b68['functions'],_0x1e1682);_0x51b3bd&&!_0x1df5b3[_0x3096a6(0x1cf)](_0x51b3bd['lockKey'])&&_0xd0cc07[_0x3096a6(0x1c2)](_0x51b3bd[_0x3096a6(0x1be)]);}}const _0x3e7e7a=_0x21271e[_0x3096a6(0x1c4)]===0x0&&_0xdb922e[_0x3096a6(0x1c4)]===0x0&&_0xd0cc07['length']===0x0;return{'ok':!![],'data':{'added':_0x21271e,'modified':_0xdb922e,'unchanged':_0x898af8,'remoteOnly':_0xd0cc07},'message':_0x3e7e7a?_0x3096a6(0x1c0):_0x21271e[_0x3096a6(0x1c4)]+'\x20added,\x20'+_0xdb922e[_0x3096a6(0x1c4)]+_0x3096a6(0x1bf)+_0x898af8[_0x3096a6(0x1c4)]+_0x3096a6(0x1d0)+(_0xd0cc07[_0x3096a6(0x1c4)]>0x0?',\x20'+_0xd0cc07['length']+_0x3096a6(0x1d1):'')};}};function a32_0x2f82(){const _0x390b74=['144SIAbFF','436964QsKYqo','alias','lockKey','\x20modified,\x20','All\x20BFF\x20scripts\x20are\x20in\x20sync.','remote','push','map','length','read','20363ubsKpH','1096RjWzVC','appCode','9869688gHfWZR','status','scriptsRoot','233195NLICrQ','25589360LGenxT','boolean','has','\x20unchanged','\x20remote-only','976140nZhnXP','functions','3mMEgIc','3198668WkkOmw','bff','datasetCode','filePath','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file'];a32_0x2f82=function(){return _0x390b74;};return a32_0x2f82();}
|