@lovrabet/rabetbase-cli 2.1.4 → 2.1.6-beta.0
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/login-success-html.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/generate.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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.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/create.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/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/data/filter.js +1 -0
- package/lib/commands/data/getOne.js +1 -0
- package/lib/commands/data/index.js +1 -0
- package/lib/commands/data/shared.js +1 -0
- 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/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.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/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.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/create.js +1 -1
- package/lib/commands/sql/delete.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 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.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/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.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-alias.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/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.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/params.js +1 -0
- 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/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +4 -4
- package/templates/skill/SKILL.md.tpl +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x376230,_0xef75c2){const _0x36ac7b=a20_0x5388,_0x3174b4=_0x376230();while(!![]){try{const _0x34b2ee=-parseInt(_0x36ac7b(0xdd))/0x1*(-parseInt(_0x36ac7b(0xd8))/0x2)+parseInt(_0x36ac7b(0xdb))/0x3*(-parseInt(_0x36ac7b(0xe2))/0x4)+parseInt(_0x36ac7b(0xda))/0x5*(-parseInt(_0x36ac7b(0xe0))/0x6)+-parseInt(_0x36ac7b(0xdf))/0x7*(-parseInt(_0x36ac7b(0xde))/0x8)+-parseInt(_0x36ac7b(0xdc))/0x9+parseInt(_0x36ac7b(0xd9))/0xa*(-parseInt(_0x36ac7b(0xe1))/0xb)+-parseInt(_0x36ac7b(0xe3))/0xc*(-parseInt(_0x36ac7b(0xd7))/0xd);if(_0x34b2ee===_0xef75c2)break;else _0x3174b4['push'](_0x3174b4['shift']());}catch(_0xf4f667){_0x3174b4['push'](_0x3174b4['shift']());}}}(a20_0x1dcf,0x5c89b));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';function a20_0x1dcf(){const _0x405f3e=['13cUjUgA','146YxQlBV','30gDuinH','77920Xmybrr','83319tbNrnQ','1875114MElZlv','5845LyVMCY','38272RKexhg','259tOGnNC','258mOYjXz','1550868dIAVes','96ALYmGO','20919792rWBYvM'];a20_0x1dcf=function(){return _0x405f3e;};return a20_0x1dcf();}function a20_0x5388(_0x2ed2a3,_0x47c9bc){_0x2ed2a3=_0x2ed2a3-0xd7;const _0x1dcff6=a20_0x1dcf();let _0x53884c=_0x1dcff6[_0x2ed2a3];return _0x53884c;}import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x2b9f47=a21_0x22e1;function a21_0x22e1(_0x4dac0b,_0x152e8b){_0x4dac0b=_0x4dac0b-0x15a;const _0x1f5746=a21_0x1f57();let _0x22e12c=_0x1f5746[_0x4dac0b];return _0x22e12c;}(function(_0xa3d0a,_0x20d4a1){const _0x4f3473=a21_0x22e1,_0x4a4952=_0xa3d0a();while(!![]){try{const _0x2f9b8e=-parseInt(_0x4f3473(0x17a))/0x1+parseInt(_0x4f3473(0x15a))/0x2*(-parseInt(_0x4f3473(0x176))/0x3)+parseInt(_0x4f3473(0x160))/0x4*(-parseInt(_0x4f3473(0x16d))/0x5)+-parseInt(_0x4f3473(0x174))/0x6+-parseInt(_0x4f3473(0x16c))/0x7*(parseInt(_0x4f3473(0x175))/0x8)+-parseInt(_0x4f3473(0x15b))/0x9+-parseInt(_0x4f3473(0x16b))/0xa*(-parseInt(_0x4f3473(0x17c))/0xb);if(_0x2f9b8e===_0x20d4a1)break;else _0x4a4952['push'](_0x4a4952['shift']());}catch(_0x1b135e){_0x4a4952['push'](_0x4a4952['shift']());}}}(a21_0x1f57,0x7d632));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x30d33b,_0x8d57f0){const _0x1aca3f=a21_0x22e1,_0x2ddadd=[],_0x3afede=_0x30d33b['apps']&&typeof _0x30d33b[_0x1aca3f(0x172)]===_0x1aca3f(0x173)?_0x30d33b[_0x1aca3f(0x172)]:{},_0x4bfde4=_0x30d33b[_0x1aca3f(0x15f)]||undefined;for(const [_0x170b51,_0x42c851]of Object[_0x1aca3f(0x15e)](_0x3afede)){if(!_0x42c851||typeof _0x42c851!==_0x1aca3f(0x173)||!_0x42c851[_0x1aca3f(0x165)])continue;_0x2ddadd[_0x1aca3f(0x179)]({'name':_0x170b51,'appcode':_0x42c851[_0x1aca3f(0x165)],'named':!![],'definedIn':_0x8d57f0,'isDefault':_0x170b51===_0x4bfde4,...buildAppProfileListFields(_0x42c851)});}return _0x2ddadd;}function a21_0x1f57(){const _0x14f3cc=['\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','push','438158LMTQcb','boolean','187NpeKrv','map','length','2qckWjf','2577771mvMdVY','find','global','entries','defaultApp','908fUOZOO','\x20in\x20','bool','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','inherit','appcode','\x20config','No\x20apps\x20configured','project','projectPath','projectConfig','2573250bClTij','6229321XNxreO','21020cGRAta','globalPath','app','globalConfig','merged','apps','object','4930854kouoab','8SOYqzP','1411026SVYngy','list'];a21_0x1f57=function(){return _0x14f3cc;};return a21_0x1f57();}function buildMergedItems(_0x33bf60,_0x2b8a70){const _0x3fe0ef=a21_0x22e1,{apps:apps={},defaultApp:_0x46a235}=_0x33bf60,_0x356a94=_0x2b8a70[_0x3fe0ef(0x170)][_0x3fe0ef(0x172)]&&typeof _0x2b8a70[_0x3fe0ef(0x170)][_0x3fe0ef(0x172)]===_0x3fe0ef(0x173)?_0x2b8a70[_0x3fe0ef(0x170)][_0x3fe0ef(0x172)]:{},_0x117b14=_0x2b8a70['projectConfig']['apps']&&typeof _0x2b8a70[_0x3fe0ef(0x16a)][_0x3fe0ef(0x172)]===_0x3fe0ef(0x173)?_0x2b8a70[_0x3fe0ef(0x16a)][_0x3fe0ef(0x172)]:{},_0x997e74=_0x2b8a70['projectConfig'][_0x3fe0ef(0x164)]===![],_0x3547a1=Object[_0x3fe0ef(0x15e)](apps),_0x20ac6f=_0x3547a1[_0x3fe0ef(0x17d)](([_0x25f2b7,_0x4cc9da])=>({'name':_0x25f2b7,'appcode':_0x4cc9da[_0x3fe0ef(0x165)],'named':!![],'definedIn':appDefinedIn(_0x25f2b7,_0x356a94,_0x117b14,_0x997e74),'isDefault':_0x25f2b7===_0x46a235,...buildAppProfileListFields(_0x4cc9da)}));return _0x20ac6f;}async function execute(_0x30ee61){const _0x1894b4=a21_0x22e1,_0x4e3cbd=_0x30ee61[_0x1894b4(0x162)](_0x1894b4(0x15d)),_0x2126df=_0x30ee61[_0x1894b4(0x162)](_0x1894b4(0x168)),_0x12c2ec=_0x4e3cbd?'global':_0x2126df?_0x1894b4(0x168):_0x1894b4(0x171),{config:_0x2d5f2b,layers:_0x2dea52}=readRawConfigWithLayers(),_0x295e49=resolveDefaultAppSource(_0x2dea52),{defaultApp:_0x43ec5b}=_0x2d5f2b;let _0x13c17a,_0x30a0bc;switch(_0x12c2ec){case _0x1894b4(0x15d):_0x13c17a=buildItemsFromLayer(_0x2dea52['globalConfig'],_0x1894b4(0x15d)),_0x30a0bc=_0x2dea52[_0x1894b4(0x16e)];break;case _0x1894b4(0x168):_0x13c17a=buildItemsFromLayer(_0x2dea52['projectConfig'],_0x1894b4(0x168)),_0x30a0bc=_0x2dea52[_0x1894b4(0x169)];break;default:_0x13c17a=buildMergedItems(_0x2d5f2b,_0x2dea52);break;}enrichAppListItemsWithMergedSelection(_0x13c17a,_0x30ee61['mergedCli']);if(_0x13c17a[_0x1894b4(0x17e)]===0x0){const _0x26efd0=_0x12c2ec===_0x1894b4(0x171)?'':_0x1894b4(0x161)+_0x12c2ec+_0x1894b4(0x166);return{'ok':!![],'data':[],'message':_0x1894b4(0x167)+_0x26efd0+'.\x20Use\x20`'+CLI_BIN_NAME+_0x1894b4(0x178)};}const _0x970660=_0x13c17a[_0x1894b4(0x15c)](_0x1088f5=>_0x1088f5['isCurrent']===!![]),_0x237707=_0x43ec5b??_0x970660?.[_0x1894b4(0x165)]??null,_0x2e0898=_0x12c2ec==='merged'?{'globalPath':_0x2dea52[_0x1894b4(0x16e)]??null,'projectPath':_0x2dea52[_0x1894b4(0x169)]??null,'defaultApp':_0x237707,'defaultAppSource':_0x43ec5b!=null?_0x295e49:null}:{'scope':_0x12c2ec,'configPath':_0x30a0bc??null};return{'ok':!![],'data':{'items':_0x13c17a,'meta':_0x2e0898}};}export const appListDefinition={'service':a21_0x2b9f47(0x16f),'command':a21_0x2b9f47(0x177),'description':'List\x20all\x20configured\x20apps','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x2b9f47(0x15d),'type':a21_0x2b9f47(0x17b),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a21_0x2b9f47(0x168),'type':'boolean','description':a21_0x2b9f47(0x163),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a22_0x1869(){const _0xfd33e8=['3627840WTpQtF','Use\x20global\x20config\x20scope','\x20config.','6938919UirxKH','2639346MnxAMO','\x22\x20not\x20found.','77zrMcUu','validation','Usage:\x20','project','apps','remove','projectConfig','keys','app','trim','both','8193710JLUGdj','args','name','6qXDqHb','\x20app\x20remove\x20<name>\x20[--global]','high-risk-write','3635145wbRTuK','3045363SXvQoh','defaultApp','Missing\x20app\x20name.','8wmXCkN','boolean','337710fQIgwT','App\x20\x22','global','bool','globalConfig','1CeuZNg','\x20Note:\x20app\x20\x22','Remove\x20an\x20app\x20from\x20config'];a22_0x1869=function(){return _0xfd33e8;};return a22_0x1869();}const a22_0x23233b=a22_0x5b06;(function(_0x2b353e,_0x6ae551){const _0x56cfc1=a22_0x5b06,_0x5f4b96=_0x2b353e();while(!![]){try{const _0x4896eb=-parseInt(_0x56cfc1(0x17e))/0x1*(parseInt(_0x56cfc1(0x185))/0x2)+parseInt(_0x56cfc1(0x174))/0x3+parseInt(_0x56cfc1(0x181))/0x4+parseInt(_0x56cfc1(0x173))/0x5+-parseInt(_0x56cfc1(0x170))/0x6*(parseInt(_0x56cfc1(0x16d))/0x7)+-parseInt(_0x56cfc1(0x177))/0x8*(-parseInt(_0x56cfc1(0x184))/0x9)+parseInt(_0x56cfc1(0x179))/0xa*(-parseInt(_0x56cfc1(0x162))/0xb);if(_0x4896eb===_0x6ae551)break;else _0x5f4b96['push'](_0x5f4b96['shift']());}catch(_0x34761f){_0x5f4b96['push'](_0x5f4b96['shift']());}}}(a22_0x1869,0xa94fd));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a22_0x5b06(_0xb29763,_0x33bcf3){_0xb29763=_0xb29763-0x162;const _0x1869df=a22_0x1869();let _0x5b068b=_0x1869df[_0xb29763];return _0x5b068b;}async function validateArgs(_0xec7b38){const _0x463ba4=a22_0x5b06,_0x2d059b=_0xec7b38[_0x463ba4(0x16e)][0x0]?.['trim']();if(!_0x2d059b)throw CliErrors[_0x463ba4(0x163)](_0x463ba4(0x176),_0x463ba4(0x164)+CLI_BIN_NAME+_0x463ba4(0x171));}async function execute(_0x55210a){const _0x3ec759=a22_0x5b06,_0x123997=_0x55210a[_0x3ec759(0x16e)][0x0]?.[_0x3ec759(0x16b)]();if(!_0x123997)throw CliErrors['validation']('Missing\x20app\x20name.',_0x3ec759(0x164)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');const _0x29d963=_0x55210a[_0x3ec759(0x17c)](_0x3ec759(0x17b)),{config:_0x2073ba,layers:_0x3c080d}=readRawConfigWithLayers(),_0x47e873=_0x2073ba[_0x3ec759(0x166)]??{};if(!_0x47e873[_0x123997])throw CliErrors[_0x3ec759(0x163)](_0x3ec759(0x17a)+_0x123997+_0x3ec759(0x186));const _0x45110c=_0x3c080d[_0x3ec759(0x17d)][_0x3ec759(0x166)]&&typeof _0x3c080d['globalConfig'][_0x3ec759(0x166)]==='object'?_0x3c080d[_0x3ec759(0x17d)]['apps']:{},_0x1b7d74=_0x3c080d['projectConfig'][_0x3ec759(0x166)]&&typeof _0x3c080d[_0x3ec759(0x168)][_0x3ec759(0x166)]==='object'?_0x3c080d['projectConfig'][_0x3ec759(0x166)]:{},_0x219bbf=appDefinedIn(_0x123997,_0x45110c,_0x1b7d74,_0x3c080d[_0x3ec759(0x168)]['inherit']===![]),_0x40ad24=resolveAppScopeForWrite(_0x123997,_0x29d963,_0x3c080d),_0x2955fc={'global':_0x40ad24==='global'},_0xf90e7c=readConfig(_0x2955fc),_0x203281=_0xf90e7c[_0x3ec759(0x166)];if(!_0x203281||!_0x203281[_0x123997])throw CliErrors[_0x3ec759(0x163)](_0x3ec759(0x17a)+_0x123997+_0x3ec759(0x186));delete _0x203281[_0x123997];let _0x2df2d1='';if(_0xf90e7c[_0x3ec759(0x175)]===_0x123997){const _0x117a9c=Object[_0x3ec759(0x169)](_0x203281);_0xf90e7c[_0x3ec759(0x175)]=_0x117a9c['length']>0x0?_0x117a9c[0x0]:undefined,_0xf90e7c[_0x3ec759(0x175)]?_0x2df2d1='\x20Default\x20app\x20changed\x20to\x20\x22'+_0xf90e7c[_0x3ec759(0x175)]+'\x22.':delete _0xf90e7c['defaultApp'];}Object[_0x3ec759(0x169)](_0x203281)['length']===0x0&&(delete _0xf90e7c[_0x3ec759(0x166)],delete _0xf90e7c[_0x3ec759(0x175)]);writeConfig(_0xf90e7c,_0x2955fc);const _0x1128d6=_0x219bbf===_0x3ec759(0x16c)?_0x3ec759(0x17f)+_0x123997+'\x22\x20still\x20defined\x20in\x20'+(_0x40ad24==='project'?'global':_0x3ec759(0x165))+_0x3ec759(0x183):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x123997+'\x22'+scopeLabel(_0x2955fc)+'.'+_0x2df2d1+_0x1128d6};}export const appRemoveDefinition={'service':a22_0x23233b(0x16a),'command':a22_0x23233b(0x167),'description':a22_0x23233b(0x180),'risk':a22_0x23233b(0x172),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x23233b(0x16f),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a22_0x23233b(0x17b),'type':a22_0x23233b(0x178),'description':a22_0x23233b(0x182),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd12c13,_0x3198d3){const _0x48cb5a=a23_0x37c9,_0x5db972=_0xd12c13();while(!![]){try{const _0x567ee9=parseInt(_0x48cb5a(0x1df))/0x1+parseInt(_0x48cb5a(0x1d1))/0x2+-parseInt(_0x48cb5a(0x1d4))/0x3*(-parseInt(_0x48cb5a(0x1dc))/0x4)+-parseInt(_0x48cb5a(0x1cc))/0x5*(parseInt(_0x48cb5a(0x1de))/0x6)+-parseInt(_0x48cb5a(0x1d7))/0x7*(-parseInt(_0x48cb5a(0x1cb))/0x8)+-parseInt(_0x48cb5a(0x1cd))/0x9*(-parseInt(_0x48cb5a(0x1e6))/0xa)+-parseInt(_0x48cb5a(0x1e8))/0xb;if(_0x567ee9===_0x3198d3)break;else _0x5db972['push'](_0x5db972['shift']());}catch(_0x53f745){_0x5db972['push'](_0x5db972['shift']());}}}(a23_0x5562,0xe627c));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x5c06ae,_0x5438fe){const _0x585062=a23_0x37c9;if(!_0x5438fe)return;const _0x4fb65d=_0x5438fe[_0x585062(0x1d0)]&&typeof _0x5438fe['apps']===_0x585062(0x1e4)?_0x5438fe['apps']:{},_0xcd571b=Object[_0x585062(0x1db)](_0x4fb65d)['length']>0x0;for(const _0x1fde91 of _0x5c06ae){_0x1fde91[_0x585062(0x1d6)]=![];}const _0x25ae89=_0x5438fe[_0x585062(0x1ce)]!=null?String(_0x5438fe[_0x585062(0x1ce)])[_0x585062(0x1d3)]():'';if(_0xcd571b){const _0x27a6ce=_0x5438fe[_0x585062(0x1d9)]??_0x5438fe[_0x585062(0x1e3)];if(_0x27a6ce)for(const _0x51983e of _0x5c06ae){_0x51983e[_0x585062(0x1da)]===!![]&&_0x51983e[_0x585062(0x1cf)]===_0x27a6ce&&(_0x51983e['isCurrent']=!![]);}for(const _0x457bc7 of _0x5c06ae){if(_0x457bc7[_0x585062(0x1da)]!==![])continue;if(_0x5438fe['defaultApp'])continue;_0x25ae89&&String(_0x457bc7[_0x585062(0x1e1)]??'')[_0x585062(0x1d3)]()===_0x25ae89&&(_0x457bc7[_0x585062(0x1d6)]=!![]);}return;}if(!_0x25ae89)return;for(const _0x38088c of _0x5c06ae){String(_0x38088c[_0x585062(0x1e1)]??'')[_0x585062(0x1d3)]()===_0x25ae89&&(_0x38088c[_0x585062(0x1d6)]=!![]);}}export function resolveAppScopeForWrite(_0x301049,_0x244ff1,_0x1bee7b){const _0x4ee98c=a23_0x37c9;if(_0x244ff1)return _0x4ee98c(0x1ea);const _0x41128b=_0x1bee7b[_0x4ee98c(0x1e5)][_0x4ee98c(0x1d0)]&&typeof _0x1bee7b['projectConfig']['apps']===_0x4ee98c(0x1e4)?_0x1bee7b[_0x4ee98c(0x1e5)][_0x4ee98c(0x1d0)]:{},_0x34dfca=_0x1bee7b['globalConfig'][_0x4ee98c(0x1d0)]&&typeof _0x1bee7b[_0x4ee98c(0x1e2)][_0x4ee98c(0x1d0)]===_0x4ee98c(0x1e4)?_0x1bee7b['globalConfig'][_0x4ee98c(0x1d0)]:{};if(Object['prototype'][_0x4ee98c(0x1d8)]['call'](_0x41128b,_0x301049))return'project';if(Object[_0x4ee98c(0x1e9)]['hasOwnProperty'][_0x4ee98c(0x1e0)](_0x34dfca,_0x301049))return'global';return _0x4ee98c(0x1d5);}export function appDefinedIn(_0x14bbe2,_0x343a23,_0x83880f,_0x492d44){const _0x44347d=a23_0x37c9;if(_0x492d44)return Object[_0x44347d(0x1e9)]['hasOwnProperty'][_0x44347d(0x1e0)](_0x83880f,_0x14bbe2)?_0x44347d(0x1d5):_0x44347d(0x1ea);const _0x1c6503=Object[_0x44347d(0x1e9)]['hasOwnProperty']['call'](_0x343a23,_0x14bbe2),_0x2a5255=Object['prototype'][_0x44347d(0x1d8)]['call'](_0x83880f,_0x14bbe2);if(_0x1c6503&&_0x2a5255)return _0x44347d(0x1d2);if(_0x2a5255)return _0x44347d(0x1d5);return _0x44347d(0x1ea);}export function resolveDefaultAppSource(_0x387578){const _0x2d53d8=a23_0x37c9,_0x4d3a57=_0x387578[_0x2d53d8(0x1e5)][_0x2d53d8(0x1d0)]&&typeof _0x387578['projectConfig'][_0x2d53d8(0x1d0)]===_0x2d53d8(0x1e4)?_0x387578['projectConfig'][_0x2d53d8(0x1d0)]:{};if(_0x2d53d8(0x1e3)in _0x387578[_0x2d53d8(0x1e5)])return'project';if(Object[_0x2d53d8(0x1db)](_0x4d3a57)[_0x2d53d8(0x1dd)]>0x0)return _0x2d53d8(0x1d5);if(_0x387578[_0x2d53d8(0x1e5)]['inherit']===![])return null;if(_0x387578['globalConfig'][_0x2d53d8(0x1e3)])return _0x2d53d8(0x1ea);return null;}export function getConfigPath(_0x3d6d38={}){const _0x27836e=a23_0x37c9,_0x2fe9ee=_0x3d6d38[_0x27836e(0x1ea)]?_0x27836e(0x1ea):'project';return resolveWriteConfigPath(_0x2fe9ee);}function a23_0x37c9(_0xf811f7,_0xf5733){_0xf811f7=_0xf811f7-0x1cb;const _0x556284=a23_0x5562();let _0x37c940=_0x556284[_0xf811f7];return _0x37c940;}export function readConfig(_0x381527={}){return readConfigFile(getConfigPath(_0x381527));}export function writeConfig(_0x1b1c88,_0x1921d3={}){writeConfigFile(getConfigPath(_0x1921d3),_0x1b1c88);}export function scopeLabel(_0x242b31){const _0x1c343c=a23_0x37c9;return _0x242b31[_0x1c343c(0x1ea)]?_0x1c343c(0x1e7):'';}function a23_0x5562(){const _0x15cf6c=['globalConfig','defaultApp','object','projectConfig','70ZbYLeK','\x20(global)','3327093qVxYIc','prototype','global','18072OHxBUl','5VAqDvt','1403145nizjMp','appCode','name','apps','1078162EdPVoX','both','trim','50457TYMgUA','project','isCurrent','2226lFKEYa','hasOwnProperty','currentApp','named','keys','96byXgPe','length','10144854TzkETK','183554hEEsEY','call','appcode'];a23_0x5562=function(){return _0x15cf6c;};return a23_0x5562();}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x3b78db=a24_0x766c;(function(_0x51d38d,_0x3113df){const _0x3529f3=a24_0x766c,_0x21d06b=_0x51d38d();while(!![]){try{const _0x425341=-parseInt(_0x3529f3(0x1f9))/0x1*(-parseInt(_0x3529f3(0x1f7))/0x2)+parseInt(_0x3529f3(0x1f4))/0x3+-parseInt(_0x3529f3(0x1ff))/0x4*(-parseInt(_0x3529f3(0x1e9))/0x5)+parseInt(_0x3529f3(0x208))/0x6*(parseInt(_0x3529f3(0x1fc))/0x7)+-parseInt(_0x3529f3(0x1f0))/0x8+-parseInt(_0x3529f3(0x1e7))/0x9+-parseInt(_0x3529f3(0x205))/0xa;if(_0x425341===_0x3113df)break;else _0x21d06b['push'](_0x21d06b['shift']());}catch(_0x5a5a35){_0x21d06b['push'](_0x21d06b['shift']());}}}(a24_0x31cc,0xd58a7));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x1a4463){const _0x227372=a24_0x766c,_0x5c9fd9=_0x1a4463[_0x227372(0x1f6)][0x0]?.['trim']();if(!_0x5c9fd9)throw CliErrors[_0x227372(0x1fb)](_0x227372(0x203),_0x227372(0x1fe)+CLI_BIN_NAME+_0x227372(0x202));}function a24_0x31cc(){const _0x363e0a=['hasOwnProperty','trim','app','bool','Available:\x20','5315776uPAAAB','appcode','object','Default\x20app\x20set\x20to\x20\x22','1854684HySasT','apps','args','82582vNypGK','App\x20profile\x20name\x20to\x20activate','4cquDmk','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','validation','9064195ODLeAr','App\x20\x22','Usage:\x20','59116IxXVyU','prototype','Use\x20`','\x20app\x20use\x20<name>\x20[--global]','Missing\x20app\x20name.','call','6716040vCMBpT','\x22\x20not\x20found.','keys','6UKKrBb','use','global','projectConfig','\x20--appcode\x20<code>`\x20first.','join','boolean','projectPath','\x22\x20(appcode:\x20','length','6256458JqOkBY','\x20app\x20add\x20','280IaUjoX','write'];a24_0x31cc=function(){return _0x363e0a;};return a24_0x31cc();}function a24_0x766c(_0x40d717,_0x44889a){_0x40d717=_0x40d717-0x1e0;const _0x31cce6=a24_0x31cc();let _0x766c6c=_0x31cce6[_0x40d717];return _0x766c6c;}async function execute(_0x200af9){const _0x412847=a24_0x766c,_0x9a164d=_0x200af9[_0x412847(0x1f6)][0x0]?.[_0x412847(0x1ec)]();if(!_0x9a164d)throw CliErrors[_0x412847(0x1fb)](_0x412847(0x203),_0x412847(0x1fe)+CLI_BIN_NAME+_0x412847(0x202));const _0x1d8652=_0x200af9[_0x412847(0x1ee)](_0x412847(0x20a)),{config:_0x56ff91,layers:_0x11160a}=readRawConfigWithLayers(),_0x9e08bc=_0x56ff91[_0x412847(0x1f5)]??{};if(!_0x9e08bc[_0x9a164d]){const _0x24de68=Object[_0x412847(0x207)](_0x9e08bc),_0x4a16e2=_0x24de68[_0x412847(0x1e6)]===0x0?_0x412847(0x201)+CLI_BIN_NAME+_0x412847(0x1e8)+_0x9a164d+_0x412847(0x1e1):_0x412847(0x1ef)+_0x24de68[_0x412847(0x1e2)](',\x20');throw CliErrors[_0x412847(0x1fb)](_0x412847(0x1fd)+_0x9a164d+_0x412847(0x206),_0x4a16e2);}let _0x72d359,_0xe56d69='';if(_0x1d8652)_0x72d359={'global':!![]};else{const _0x4e2fa9=isInProject()&&!!_0x11160a[_0x412847(0x1e4)];_0x72d359={'global':!_0x4e2fa9};if(_0x4e2fa9){const _0x144cb2=_0x11160a[_0x412847(0x1e0)][_0x412847(0x1f5)]&&typeof _0x11160a[_0x412847(0x1e0)][_0x412847(0x1f5)]===_0x412847(0x1f2)?_0x11160a['projectConfig'][_0x412847(0x1f5)]:{};!Object[_0x412847(0x200)][_0x412847(0x1eb)][_0x412847(0x204)](_0x144cb2,_0x9a164d)&&(_0xe56d69='\x0aNote:\x20\x22'+_0x9a164d+_0x412847(0x1fa));}}const _0x58416a=readConfig(_0x72d359);return _0x58416a['defaultApp']=_0x9a164d,writeConfig(_0x58416a,_0x72d359),{'ok':!![],'message':_0x412847(0x1f3)+_0x9a164d+_0x412847(0x1e5)+_0x9e08bc[_0x9a164d][_0x412847(0x1f1)]+')'+scopeLabel(_0x72d359)+_0xe56d69};}export const appUseDefinition={'service':a24_0x3b78db(0x1ed),'command':a24_0x3b78db(0x209),'description':'Switch\x20the\x20default\x20app','risk':a24_0x3b78db(0x1ea),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a24_0x3b78db(0x1f8),'required':!![]}],'flags':[{'name':'global','type':a24_0x3b78db(0x1e3),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0xc519f1=a25_0x4858;(function(_0x5bdbb6,_0xf175bf){const _0x4a7e75=a25_0x4858,_0x2933df=_0x5bdbb6();while(!![]){try{const _0x321078=-parseInt(_0x4a7e75(0x10a))/0x1*(parseInt(_0x4a7e75(0xf8))/0x2)+-parseInt(_0x4a7e75(0x106))/0x3*(-parseInt(_0x4a7e75(0xfb))/0x4)+-parseInt(_0x4a7e75(0x105))/0x5+-parseInt(_0x4a7e75(0x109))/0x6*(-parseInt(_0x4a7e75(0x100))/0x7)+parseInt(_0x4a7e75(0x10e))/0x8*(parseInt(_0x4a7e75(0x10d))/0x9)+-parseInt(_0x4a7e75(0x10b))/0xa*(parseInt(_0x4a7e75(0x107))/0xb)+parseInt(_0x4a7e75(0xfa))/0xc;if(_0x321078===_0xf175bf)break;else _0x2933df['push'](_0x2933df['shift']());}catch(_0x312d55){_0x2933df['push'](_0x2933df['shift']());}}}(a25_0x3912,0x25698));import{unlinkSync,existsSync}from'node:fs';function a25_0x3912(){const _0x3c7e15=['logout','794615amzsHw','310113fpPvRW','11DHlhWc','write','12SFYYqj','2VqgCfT','2999440NjnwqH','Login\x20via\x20browser','776133gORpAt','24PnzxsZ','nonInteractive','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','147304OGOADZ','boolean','2792196TOmkQm','4WjiWye','Clear\x20login\x20session','auth','../../auth/auth-server-ui.js','read','576261kKVZxY','yes','log','login'];a25_0x3912=function(){return _0x3c7e15;};return a25_0x3912();}import{cookieFile}from'../../auth/constant.js';function a25_0x4858(_0x3dea6e,_0x5b0d38){_0x3dea6e=_0x3dea6e-0xf7;const _0x39121e=a25_0x3912();let _0x485885=_0x39121e[_0x3dea6e];return _0x485885;}export const authDefinitions=[{'service':a25_0xc519f1(0xfd),'command':a25_0xc519f1(0x103),'description':a25_0xc519f1(0x10c),'risk':a25_0xc519f1(0xff),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a25_0xc519f1(0x101),'type':a25_0xc519f1(0xf9),'description':a25_0xc519f1(0xf7),'default':![]}],async 'execute'(_0x1a07dd){const _0x121298=a25_0xc519f1,{runAuthServer:_0x334ac}=await import(_0x121298(0xfe));return await _0x334ac({'autoYes':_0x1a07dd['bool']('yes'),'nonInteractive':_0x1a07dd[_0x121298(0x10f)]}),{'ok':!![]};}},{'service':'auth','command':a25_0xc519f1(0x104),'description':a25_0xc519f1(0xfc),'risk':a25_0xc519f1(0x108),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x300c9a){const _0x5ace75=a25_0xc519f1;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5ace75(0x102)]('✓\x20Logged\x20out')):console[_0x5ace75(0x102)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3be201=a26_0x10b1;(function(_0x83c061,_0x1e3d1c){const _0x2e25c3=a26_0x10b1,_0x173c70=_0x83c061();while(!![]){try{const _0x14bc2a=-parseInt(_0x2e25c3(0x18a))/0x1*(parseInt(_0x2e25c3(0x143))/0x2)+parseInt(_0x2e25c3(0x16a))/0x3+-parseInt(_0x2e25c3(0x18e))/0x4*(parseInt(_0x2e25c3(0x184))/0x5)+parseInt(_0x2e25c3(0x18b))/0x6+parseInt(_0x2e25c3(0x16f))/0x7*(-parseInt(_0x2e25c3(0x183))/0x8)+-parseInt(_0x2e25c3(0x14d))/0x9+parseInt(_0x2e25c3(0x190))/0xa;if(_0x14bc2a===_0x1e3d1c)break;else _0x173c70['push'](_0x173c70['shift']());}catch(_0xdbebb8){_0x173c70['push'](_0x173c70['shift']());}}}(a26_0xf334,0x6ebf4));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a26_0xf334(){const _0x3a21bd=['--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','write','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','length','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Script\x20description','parseInt','stdin','alias','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','utf8','COMMON','stderr','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','function-node','\x22\x20not\x20found.\x20','Function\x20name\x20(valid\x20JS\x20identifier)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','5106296VbXGHY','136870HTWiqe','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','close','create','tableName','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','155VKYYCQ','955908CNCBAA','datasetcode','operationType','52NsTspF','\x22.\x20','16438990qCzbFX','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','bff','\x20api\x20pull`\x20to\x20refresh.','\x0a\x20*\x20[触发节点]\x20','appCode','HOOK','Select\x20dataset:','description','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','functionNode','includes','Select\x20operation\x20type:','.js','string','3462hGNUbw','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','nonInteractive','Available\x20aliases:\x20','entries','before','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Invalid\x20function\x20name\x20\x22','Trigger\x20node\x20(HOOK\x20only)','join','6518250aKtDzV','\x20function:\x20','Created\x20','scriptsRootDir','Operation\x20type\x20\x22','find','No\x20operation\x20types\x20found\x20for\x20dataset\x20','keys','name','Dataset\x20not\x20found\x20for\x20code\x20\x22','File\x20already\x20exists:\x20','Script\x20type','datasetCode','\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','validation','after','apiDir','No\x20api.ts\x20found.\x20Run\x20`','question','Available:\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','Invalid\x20dataset\x20selection.','map','trim','code','Operation\x20type\x20(HOOK\x20only)','Select\x20trigger\x20node:','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','1911321glBzzS','str','Alias\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','TODO:\x20add\x20script\x20description','7XGMxgX'];a26_0xf334=function(){return _0x3a21bd;};return a26_0xf334();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a26_0x3be201(0x192),'command':a26_0x3be201(0x187),'description':a26_0x3be201(0x199),'risk':a26_0x3be201(0x171),'flags':[{'name':'type','type':a26_0x3be201(0x142),'required':!![],'enum':[a26_0x3be201(0x17c),a26_0x3be201(0x162),a26_0x3be201(0x196)],'description':a26_0x3be201(0x158)},{'name':a26_0x3be201(0x155),'type':a26_0x3be201(0x142),'required':!![],'description':a26_0x3be201(0x181)},{'name':a26_0x3be201(0x198),'type':'string','description':a26_0x3be201(0x175)},{'name':a26_0x3be201(0x178),'type':a26_0x3be201(0x142),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a26_0x3be201(0x18c),'type':a26_0x3be201(0x142),'description':a26_0x3be201(0x149)},{'name':'operation-type','type':a26_0x3be201(0x142),'description':a26_0x3be201(0x167)},{'name':'function-node','type':a26_0x3be201(0x142),'description':a26_0x3be201(0x14b),'enum':[a26_0x3be201(0x148),'after']}],async 'validate'(_0x40fd15){const _0xa515c5=a26_0x3be201,_0x5ed8c8=_0x40fd15['str']('name');if(!isValidBffFunctionName(_0x5ed8c8))throw CliErrors[_0xa515c5(0x15b)](_0xa515c5(0x14a)+_0x5ed8c8+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x1efb88){const _0x27adec=a26_0x3be201,_0x316302=loadBffProjectConfig(_0x1efb88['appCode']),_0x3edfd7=_0x1efb88[_0x27adec(0x16b)]('type'),_0x28abbc=_0x1efb88['str'](_0x27adec(0x155)),_0x5cf320=_0x1efb88['str'](_0x27adec(0x198))||undefined,_0x35f56d=_0x3edfd7==='HOOK'?await resolveHookOptions(_0x316302,_0x1efb88):undefined,_0x275416=buildFilePath(_0x316302,_0x3edfd7,_0x28abbc,_0x35f56d);if(await fileExists(_0x275416))throw CliErrors['validation'](_0x27adec(0x157)+_0x275416);await mkdir(dirname(_0x275416),{'recursive':!![]});const _0x4b5394=generateTemplate(_0x3edfd7,_0x28abbc,_0x1efb88[_0x27adec(0x195)],_0x5cf320,_0x35f56d);await writeFile(_0x275416,_0x4b5394,_0x27adec(0x17b));const _0x15de42={'type':_0x3edfd7,'name':_0x28abbc,'path':_0x275416};if(_0x5cf320)_0x15de42[_0x27adec(0x198)]=_0x5cf320;if(_0x35f56d){if(_0x35f56d[_0x27adec(0x178)])_0x15de42[_0x27adec(0x178)]=_0x35f56d[_0x27adec(0x178)];_0x15de42[_0x27adec(0x159)]=_0x35f56d[_0x27adec(0x159)],_0x15de42[_0x27adec(0x18d)]=_0x35f56d[_0x27adec(0x18d)],_0x15de42['functionNode']=_0x35f56d[_0x27adec(0x19a)];}return{'ok':!![],'data':_0x15de42,'message':_0x27adec(0x14f)+_0x3edfd7+_0x27adec(0x14e)+_0x28abbc};}};async function resolveHookOptions(_0x3e1ded,_0xbc3cce){const _0x13a070=a26_0x3be201,_0x4367e5=loadAliasMap(_0xbc3cce['apiDir'],undefined,resolveApiFilePath(_0xbc3cce[_0x13a070(0x15d)],_0xbc3cce['appCode'])),_0x9108c=_0x4367e5[_0x13a070(0x173)]>0x0;let _0x2582c2,_0x1a2632,_0x3a9ac5;const _0x11d001=_0xbc3cce['str']('alias'),_0xa24bf4=_0xbc3cce[_0x13a070(0x16b)](_0x13a070(0x18c));if(_0x11d001){const _0x2826e9=resolveAlias(_0xbc3cce[_0x13a070(0x15d)],_0x11d001,undefined,resolveApiFilePath(_0xbc3cce[_0x13a070(0x15d)],_0xbc3cce['appCode']));if(!_0x2826e9){const _0x494771=_0x9108c?_0x13a070(0x146)+_0x4367e5[_0x13a070(0x164)](_0x2723da=>_0x2723da['alias'])[_0x13a070(0x14c)](',\x20'):_0x13a070(0x15e)+CLI_BIN_NAME+_0x13a070(0x169);throw CliErrors['validation'](_0x13a070(0x16c)+_0x11d001+_0x13a070(0x180)+_0x494771);}_0x2582c2=_0x11d001,_0x1a2632=_0x2826e9;}else{if(_0xa24bf4){_0x1a2632=_0xa24bf4;const _0x5f4e5f=_0x4367e5[_0x13a070(0x152)](_0x5e024a=>_0x5e024a['datasetCode']===_0xa24bf4);_0x2582c2=_0x5f4e5f?.[_0x13a070(0x178)];}else{if(_0xbc3cce[_0x13a070(0x145)])throw CliErrors['validation'](_0x13a070(0x170));else{if(_0x9108c){const _0x140dd4=_0x4367e5['map'](_0x36bec6=>_0x36bec6[_0x13a070(0x178)]+'\x20('+_0x36bec6[_0x13a070(0x188)]+')'),_0x2c8ddb=await promptSelect(_0x13a070(0x197),_0x140dd4),_0x16fe36=_0x4367e5[_0x2c8ddb];if(!_0x16fe36)throw CliErrors[_0x13a070(0x15b)](_0x13a070(0x163));_0x2582c2=_0x16fe36[_0x13a070(0x178)],_0x1a2632=_0x16fe36[_0x13a070(0x159)];}else{const _0x1ef0f1=await listDatasets(_0xbc3cce[_0x13a070(0x195)]);if(_0x1ef0f1[_0x13a070(0x173)]===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x2dfb5f=_0x1ef0f1[_0x13a070(0x164)](_0x8ae992=>_0x8ae992[_0x13a070(0x155)]+'\x20('+_0x8ae992[_0x13a070(0x166)]+')'),_0x41d013=await promptSelect(_0x13a070(0x197),_0x2dfb5f),_0x6cc9c5=_0x1ef0f1[_0x41d013];if(!_0x6cc9c5)throw CliErrors[_0x13a070(0x15b)](_0x13a070(0x163));_0x1a2632=_0x6cc9c5['code'],_0x2582c2=undefined;}}}}const _0xfa5eed=await listDatasets(_0xbc3cce[_0x13a070(0x195)]),_0x1ddaa0=_0xfa5eed[_0x13a070(0x152)](_0x51f677=>_0x51f677[_0x13a070(0x166)]===_0x1a2632);if(!_0x1ddaa0)throw CliErrors[_0x13a070(0x15b)](_0x13a070(0x156)+_0x1a2632+_0x13a070(0x18f)+(_0x2582c2?_0x13a070(0x17e)+CLI_BIN_NAME+_0x13a070(0x193):''));_0x3a9ac5=_0x1ddaa0['id'];const _0xfbbafa=_0x2582c2??_0x1a2632,_0x180e33=await listBffDatasetOperations(_0xbc3cce[_0x13a070(0x195)],_0x3a9ac5),_0x5c00ed=_0x180e33?Object[_0x13a070(0x154)](_0x180e33):[];if(_0x5c00ed[_0x13a070(0x173)]===0x0)throw CliErrors[_0x13a070(0x15b)](_0x13a070(0x153)+_0xfbbafa+'.');let _0x1fad6d;const _0x3ead22=_0xbc3cce[_0x13a070(0x16b)]('operation-type');if(_0x3ead22){if(!_0x5c00ed[_0x13a070(0x19b)](_0x3ead22))throw CliErrors['validation'](_0x13a070(0x151)+_0x3ead22+_0x13a070(0x16d)+_0xfbbafa+'.\x20'+(_0x13a070(0x160)+_0x5c00ed['join'](',\x20')));_0x1fad6d=_0x3ead22;}else{if(_0xbc3cce[_0x13a070(0x145)])throw CliErrors['validation'](_0x13a070(0x185));const _0x4afbf4=await promptSelect(_0x13a070(0x140),_0x5c00ed);_0x1fad6d=_0x5c00ed[_0x4afbf4]??_0x5c00ed[0x0];}let _0x21d487=normalizeHookFunctionNode(_0xbc3cce[_0x13a070(0x16b)](_0x13a070(0x17f)));if(!_0x21d487){if(_0xbc3cce[_0x13a070(0x16b)](_0x13a070(0x17f)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0xbc3cce[_0x13a070(0x145)])throw CliErrors[_0x13a070(0x15b)](_0x13a070(0x161));const _0x530f7b=await promptSelect(_0x13a070(0x168),[_0x13a070(0x148),_0x13a070(0x15c)]);_0x21d487=[_0x13a070(0x148),'after'][_0x530f7b]??'before';}return{'alias':_0x2582c2,'datasetCode':_0x1a2632,'datasetId':_0x3a9ac5,'operationType':_0x1fad6d,'functionNode':_0x21d487};}async function promptSelect(_0x4395bb,_0x490ced){const _0x2f7e21=a26_0x3be201;if(_0x490ced[_0x2f7e21(0x173)]===0x1)return 0x0;for(const [_0x156d6b,_0x5eb319]of _0x490ced[_0x2f7e21(0x147)]()){process[_0x2f7e21(0x17d)][_0x2f7e21(0x171)]('\x20\x20'+(_0x156d6b+0x1)+'.\x20'+_0x5eb319+'\x0a');}const _0x219fbf=createInterface({'input':process[_0x2f7e21(0x177)],'output':process['stderr']});while(!![]){const _0x3bc3cf=await new Promise(_0x2853bb=>{const _0x2e4d11=_0x2f7e21;_0x219fbf[_0x2e4d11(0x15f)](_0x4395bb+'\x20',_0x2853bb);}),_0x53125a=Number[_0x2f7e21(0x176)](_0x3bc3cf[_0x2f7e21(0x165)](),0xa);if(Number['isInteger'](_0x53125a)&&_0x53125a>=0x1&&_0x53125a<=_0x490ced[_0x2f7e21(0x173)])return _0x219fbf[_0x2f7e21(0x186)](),_0x53125a-0x1;process[_0x2f7e21(0x17d)][_0x2f7e21(0x171)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x490ced[_0x2f7e21(0x173)]+'.\x0a');}}function a26_0x10b1(_0x5f2444,_0x2536de){_0x5f2444=_0x5f2444-0x140;const _0xf334e8=a26_0xf334();let _0x10b153=_0xf334e8[_0x5f2444];return _0x10b153;}function buildFilePath(_0x4d098b,_0x4e3613,_0x3e462b,_0x137884){const _0x293f77=a26_0x3be201;if(_0x4e3613===_0x293f77(0x196)){if(!_0x137884)throw CliErrors[_0x293f77(0x15b)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x189e8b=_0x137884[_0x293f77(0x178)]??_0x137884[_0x293f77(0x159)];return join(_0x4d098b[_0x293f77(0x150)],'HOOK',_0x189e8b,_0x137884[_0x293f77(0x18d)],_0x137884['functionNode'],_0x3e462b+_0x293f77(0x141));}return join(_0x4d098b[_0x293f77(0x150)],_0x4e3613,_0x3e462b+_0x293f77(0x141));}export function generateTemplate(_0x3c5a2e,_0x2db0b3,_0xc5550,_0x4c015c,_0x2ac850){const _0x2ca4c5=a26_0x3be201,_0x293aec=_0x4c015c?.[_0x2ca4c5(0x165)]()||_0x2ca4c5(0x16e);if(_0x3c5a2e===_0x2ca4c5(0x17c))return _0x2ca4c5(0x174)+_0x293aec+'\x0a\x20*\x20[脚本名称]\x20'+_0x2db0b3+_0x2ca4c5(0x189)+_0x2db0b3+_0x2ca4c5(0x179)+_0x2db0b3+_0x2ca4c5(0x182);if(_0x3c5a2e===_0x2ca4c5(0x162))return _0x2ca4c5(0x17a)+_0x293aec+_0x2ca4c5(0x172)+_0xc5550+'/'+_0x2db0b3+_0x2ca4c5(0x15a)+_0x2db0b3+_0x2ca4c5(0x182);if(!_0x2ac850)throw CliErrors['validation'](_0x2ca4c5(0x144));return _0x2ca4c5(0x191)+_0x293aec+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0xc5550+'/'+_0x2ac850[_0x2ca4c5(0x159)]+'/'+_0x2ac850[_0x2ca4c5(0x18d)]+_0x2ca4c5(0x194)+_0x2ac850[_0x2ca4c5(0x19a)]+'\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'+_0x2db0b3+_0x2ca4c5(0x182);}
|
|
1
|
+
const a26_0x4a974c=a26_0x256a;(function(_0x4cae0f,_0x1d5e70){const _0x3abf29=a26_0x256a,_0x5e8fc2=_0x4cae0f();while(!![]){try{const _0x354f15=-parseInt(_0x3abf29(0x200))/0x1+parseInt(_0x3abf29(0x1e7))/0x2+-parseInt(_0x3abf29(0x1c0))/0x3+-parseInt(_0x3abf29(0x1e1))/0x4*(parseInt(_0x3abf29(0x1f5))/0x5)+parseInt(_0x3abf29(0x1cd))/0x6+parseInt(_0x3abf29(0x1ba))/0x7+parseInt(_0x3abf29(0x1b6))/0x8*(parseInt(_0x3abf29(0x1fd))/0x9);if(_0x354f15===_0x1d5e70)break;else _0x5e8fc2['push'](_0x5e8fc2['shift']());}catch(_0x1545ff){_0x5e8fc2['push'](_0x5e8fc2['shift']());}}}(a26_0xf142,0x89e3b));import{createInterface}from'node:readline';function a26_0x256a(_0x55af53,_0x485585){_0x55af53=_0x55af53-0x1b6;const _0xf142ea=a26_0xf142();let _0x256ad5=_0xf142ea[_0x55af53];return _0x256ad5;}import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a26_0xf142(){const _0x2bab78=['operationType','description','No\x20operation\x20types\x20found\x20for\x20dataset\x20','\x20function:\x20','\x0a\x20*\x20[触发节点]\x20','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','108sMxBWN','length','isInteger','160525HtXCin','question','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','before','str','File\x20already\x20exists:\x20','datasetCode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','string','find','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','bff','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','176936XpEYME','stdin','Operation\x20type\x20\x22','COMMON','5080663GumxvZ','write','nonInteractive','\x0a\x20*\x20[脚本名称]\x20','function-node','datasetcode','2201313btoSGQ','Dataset\x20not\x20found\x20for\x20code\x20\x22','code','Select\x20dataset:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x20api\x20pull`\x20to\x20refresh.','tableName','after','Alias\x20\x22','Invalid\x20dataset\x20selection.','stderr','6509244idcJkt','Operation\x20type\x20(HOOK\x20only)','close','name','Select\x20trigger\x20node:','trim','Invalid\x20function\x20name\x20\x22','validation','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','No\x20datasets\x20found\x20for\x20this\x20app.','.js','utf8','map','Available:\x20','\x22\x20not\x20found.\x20','HOOK','keys','operation-type','includes','4JxblWT','appCode','Script\x20description','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\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','type','1002672jFsGvy','parseInt','Select\x20operation\x20type:','functionNode','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','ENDPOINT','join','scriptsRootDir','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Created\x20','apiDir','alias','TODO:\x20add\x20script\x20description','5591660JHehUp','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.'];a26_0xf142=function(){return _0x2bab78;};return a26_0xf142();}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a26_0x4a974c(0x20c),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a26_0x4a974c(0x1bb),'flags':[{'name':'type','type':a26_0x4a974c(0x209),'required':!![],'enum':[a26_0x4a974c(0x1b9),a26_0x4a974c(0x1ed),a26_0x4a974c(0x1dd)],'description':'Script\x20type'},{'name':a26_0x4a974c(0x1d0),'type':a26_0x4a974c(0x209),'required':!![],'description':a26_0x4a974c(0x1d6)},{'name':a26_0x4a974c(0x1f8),'type':'string','description':a26_0x4a974c(0x1e3)},{'name':a26_0x4a974c(0x1f3),'type':'string','description':a26_0x4a974c(0x20d)},{'name':a26_0x4a974c(0x1bf),'type':a26_0x4a974c(0x209),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a26_0x4a974c(0x1df),'type':a26_0x4a974c(0x209),'description':a26_0x4a974c(0x1ce)},{'name':a26_0x4a974c(0x1be),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a26_0x4a974c(0x1c9)]}],async 'validate'(_0x466312){const _0x1fe7ad=a26_0x4a974c,_0x3bfb6b=_0x466312[_0x1fe7ad(0x204)](_0x1fe7ad(0x1d0));if(!isValidBffFunctionName(_0x3bfb6b))throw CliErrors['validation'](_0x1fe7ad(0x1d3)+_0x3bfb6b+_0x1fe7ad(0x1f0));},async 'execute'(_0x2058f4){const _0x13fcc3=a26_0x4a974c,_0x58065f=loadBffProjectConfig(_0x2058f4['appCode']),_0x3c46c9=_0x2058f4[_0x13fcc3(0x204)](_0x13fcc3(0x1e6)),_0x4d5ff6=_0x2058f4['str'](_0x13fcc3(0x1d0)),_0x4e3cf7=_0x2058f4['str'](_0x13fcc3(0x1f8))||undefined,_0x6a739c=_0x3c46c9===_0x13fcc3(0x1dd)?await resolveHookOptions(_0x58065f,_0x2058f4):undefined,_0x9e0ab=buildFilePath(_0x58065f,_0x3c46c9,_0x4d5ff6,_0x6a739c);if(await fileExists(_0x9e0ab))throw CliErrors[_0x13fcc3(0x1d4)](_0x13fcc3(0x205)+_0x9e0ab);await mkdir(dirname(_0x9e0ab),{'recursive':!![]});const _0x15b8d8=generateTemplate(_0x3c46c9,_0x4d5ff6,_0x2058f4[_0x13fcc3(0x1e2)],_0x4e3cf7,_0x6a739c);await writeFile(_0x9e0ab,_0x15b8d8,_0x13fcc3(0x1d9));const _0x487879={'type':_0x3c46c9,'name':_0x4d5ff6,'path':_0x9e0ab};if(_0x4e3cf7)_0x487879[_0x13fcc3(0x1f8)]=_0x4e3cf7;if(_0x6a739c){if(_0x6a739c[_0x13fcc3(0x1f3)])_0x487879[_0x13fcc3(0x1f3)]=_0x6a739c[_0x13fcc3(0x1f3)];_0x487879['datasetCode']=_0x6a739c[_0x13fcc3(0x206)],_0x487879[_0x13fcc3(0x1f7)]=_0x6a739c[_0x13fcc3(0x1f7)],_0x487879[_0x13fcc3(0x1ea)]=_0x6a739c[_0x13fcc3(0x1ea)];}return{'ok':!![],'data':_0x487879,'message':_0x13fcc3(0x1f1)+_0x3c46c9+_0x13fcc3(0x1fa)+_0x4d5ff6};}};async function resolveHookOptions(_0x5bb905,_0x2e8b67){const _0x303c99=a26_0x4a974c,_0x4c1257=loadAliasMap(_0x2e8b67[_0x303c99(0x1f2)],undefined,resolveApiFilePath(_0x2e8b67[_0x303c99(0x1f2)],_0x2e8b67['appCode'])),_0x429a9b=_0x4c1257[_0x303c99(0x1fe)]>0x0;let _0x36b449,_0x58f19c,_0x16c816;const _0x56b408=_0x2e8b67[_0x303c99(0x204)](_0x303c99(0x1f3)),_0x1c7dd2=_0x2e8b67['str'](_0x303c99(0x1bf));if(_0x56b408){const _0x41b425=resolveAlias(_0x2e8b67[_0x303c99(0x1f2)],_0x56b408,undefined,resolveApiFilePath(_0x2e8b67[_0x303c99(0x1f2)],_0x2e8b67[_0x303c99(0x1e2)]));if(!_0x41b425){const _0x3fd940=_0x429a9b?'Available\x20aliases:\x20'+_0x4c1257[_0x303c99(0x1da)](_0x359ed0=>_0x359ed0[_0x303c99(0x1f3)])['join'](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x303c99(0x1eb);throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1ca)+_0x56b408+_0x303c99(0x1dc)+_0x3fd940);}_0x36b449=_0x56b408,_0x58f19c=_0x41b425;}else{if(_0x1c7dd2){_0x58f19c=_0x1c7dd2;const _0x473eaf=_0x4c1257[_0x303c99(0x20a)](_0x1a33ce=>_0x1a33ce[_0x303c99(0x206)]===_0x1c7dd2);_0x36b449=_0x473eaf?.['alias'];}else{if(_0x2e8b67['nonInteractive'])throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1d5));else{if(_0x429a9b){const _0x33be3c=_0x4c1257['map'](_0x53547c=>_0x53547c[_0x303c99(0x1f3)]+'\x20('+_0x53547c[_0x303c99(0x1c8)]+')'),_0x1e9d14=await promptSelect('Select\x20dataset:',_0x33be3c),_0x22121d=_0x4c1257[_0x1e9d14];if(!_0x22121d)throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1cb));_0x36b449=_0x22121d[_0x303c99(0x1f3)],_0x58f19c=_0x22121d[_0x303c99(0x206)];}else{const _0x96c01a=await listDatasets(_0x2e8b67[_0x303c99(0x1e2)]);if(_0x96c01a[_0x303c99(0x1fe)]===0x0)throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1d7));const _0x1ba5ea=_0x96c01a[_0x303c99(0x1da)](_0x31aa4f=>_0x31aa4f[_0x303c99(0x1d0)]+'\x20('+_0x31aa4f[_0x303c99(0x1c2)]+')'),_0x3857db=await promptSelect(_0x303c99(0x1c3),_0x1ba5ea),_0x34ae2e=_0x96c01a[_0x3857db];if(!_0x34ae2e)throw CliErrors[_0x303c99(0x1d4)]('Invalid\x20dataset\x20selection.');_0x58f19c=_0x34ae2e['code'],_0x36b449=undefined;}}}}const _0x1ece62=await listDatasets(_0x2e8b67[_0x303c99(0x1e2)]),_0x39c213=_0x1ece62['find'](_0x59ad31=>_0x59ad31[_0x303c99(0x1c2)]===_0x58f19c);if(!_0x39c213)throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1c1)+_0x58f19c+'\x22.\x20'+(_0x36b449?_0x303c99(0x202)+CLI_BIN_NAME+_0x303c99(0x1c7):''));_0x16c816=_0x39c213['id'];const _0x595843=_0x36b449??_0x58f19c,_0x11c38d=await listBffDatasetOperations(_0x2e8b67[_0x303c99(0x1e2)],_0x16c816),_0x4253e1=_0x11c38d?Object[_0x303c99(0x1de)](_0x11c38d):[];if(_0x4253e1[_0x303c99(0x1fe)]===0x0)throw CliErrors['validation'](_0x303c99(0x1f9)+_0x595843+'.');let _0x59aca7;const _0x9d1098=_0x2e8b67['str'](_0x303c99(0x1df));if(_0x9d1098){if(!_0x4253e1[_0x303c99(0x1e0)](_0x9d1098))throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1b8)+_0x9d1098+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x595843+'.\x20'+(_0x303c99(0x1db)+_0x4253e1[_0x303c99(0x1ee)](',\x20')));_0x59aca7=_0x9d1098;}else{if(_0x2e8b67['nonInteractive'])throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1f6));const _0x1ae87c=await promptSelect(_0x303c99(0x1e9),_0x4253e1);_0x59aca7=_0x4253e1[_0x1ae87c]??_0x4253e1[0x0];}let _0x4ac934=normalizeHookFunctionNode(_0x2e8b67[_0x303c99(0x204)](_0x303c99(0x1be)));if(!_0x4ac934){if(_0x2e8b67[_0x303c99(0x204)](_0x303c99(0x1be)))throw CliErrors[_0x303c99(0x1d4)](_0x303c99(0x1c6));if(_0x2e8b67[_0x303c99(0x1bc)])throw CliErrors[_0x303c99(0x1d4)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x4a2786=await promptSelect(_0x303c99(0x1d1),['before',_0x303c99(0x1c9)]);_0x4ac934=[_0x303c99(0x203),_0x303c99(0x1c9)][_0x4a2786]??_0x303c99(0x203);}return{'alias':_0x36b449,'datasetCode':_0x58f19c,'datasetId':_0x16c816,'operationType':_0x59aca7,'functionNode':_0x4ac934};}async function promptSelect(_0x153465,_0x4d342c){const _0x303b58=a26_0x4a974c;if(_0x4d342c['length']===0x1)return 0x0;for(const [_0x4ff54b,_0x148bf5]of _0x4d342c['entries']()){process[_0x303b58(0x1cc)][_0x303b58(0x1bb)]('\x20\x20'+(_0x4ff54b+0x1)+'.\x20'+_0x148bf5+'\x0a');}const _0x51746f=createInterface({'input':process[_0x303b58(0x1b7)],'output':process['stderr']});while(!![]){const _0x439c7d=await new Promise(_0x4ec0a7=>{const _0x1d8268=_0x303b58;_0x51746f[_0x1d8268(0x201)](_0x153465+'\x20',_0x4ec0a7);}),_0x25ad72=Number[_0x303b58(0x1e8)](_0x439c7d[_0x303b58(0x1d2)](),0xa);if(Number[_0x303b58(0x1ff)](_0x25ad72)&&_0x25ad72>=0x1&&_0x25ad72<=_0x4d342c[_0x303b58(0x1fe)])return _0x51746f[_0x303b58(0x1cf)](),_0x25ad72-0x1;process[_0x303b58(0x1cc)][_0x303b58(0x1bb)](_0x303b58(0x1c4)+_0x4d342c[_0x303b58(0x1fe)]+'.\x0a');}}function buildFilePath(_0xd1e1db,_0x500ddc,_0x342e72,_0x2de3ff){const _0x1c5e8a=a26_0x4a974c;if(_0x500ddc===_0x1c5e8a(0x1dd)){if(!_0x2de3ff)throw CliErrors[_0x1c5e8a(0x1d4)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x19bc7f=_0x2de3ff[_0x1c5e8a(0x1f3)]??_0x2de3ff[_0x1c5e8a(0x206)];return join(_0xd1e1db[_0x1c5e8a(0x1ef)],_0x1c5e8a(0x1dd),_0x19bc7f,_0x2de3ff[_0x1c5e8a(0x1f7)],_0x2de3ff[_0x1c5e8a(0x1ea)],_0x342e72+_0x1c5e8a(0x1d8));}return join(_0xd1e1db[_0x1c5e8a(0x1ef)],_0x500ddc,_0x342e72+_0x1c5e8a(0x1d8));}export function generateTemplate(_0x1705bc,_0x407bf8,_0x3feda6,_0x4c9f14,_0x102a2f){const _0x14699c=a26_0x4a974c,_0x75b007=_0x4c9f14?.['trim']()||_0x14699c(0x1f4);if(_0x1705bc===_0x14699c(0x1b9))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x75b007+_0x14699c(0x1bd)+_0x407bf8+_0x14699c(0x1ec)+_0x407bf8+_0x14699c(0x1fc)+_0x407bf8+_0x14699c(0x1c5);if(_0x1705bc===_0x14699c(0x1ed))return _0x14699c(0x208)+_0x75b007+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x3feda6+'/'+_0x407bf8+_0x14699c(0x1e5)+_0x407bf8+_0x14699c(0x1c5);if(!_0x102a2f)throw CliErrors[_0x14699c(0x1d4)](_0x14699c(0x20b));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x75b007+_0x14699c(0x207)+_0x3feda6+'/'+_0x102a2f['datasetCode']+'/'+_0x102a2f[_0x14699c(0x1f7)]+_0x14699c(0x1fb)+_0x102a2f[_0x14699c(0x1ea)]+_0x14699c(0x1e4)+_0x407bf8+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x22e844=a27_0x129f;(function(_0x4ac53c,_0x2417aa){const _0xd97a7a=a27_0x129f,_0x50bbf1=_0x4ac53c();while(!![]){try{const _0x2bd1b9=parseInt(_0xd97a7a(0x209))/0x1+-parseInt(_0xd97a7a(0x1f8))/0x2+parseInt(_0xd97a7a(0x1e7))/0x3*(-parseInt(_0xd97a7a(0x1e3))/0x4)+parseInt(_0xd97a7a(0x1ec))/0x5*(parseInt(_0xd97a7a(0x201))/0x6)+parseInt(_0xd97a7a(0x206))/0x7*(parseInt(_0xd97a7a(0x207))/0x8)+-parseInt(_0xd97a7a(0x202))/0x9*(-parseInt(_0xd97a7a(0x1dc))/0xa)+parseInt(_0xd97a7a(0x1e6))/0xb;if(_0x2bd1b9===_0x2417aa)break;else _0x50bbf1['push'](_0x50bbf1['shift']());}catch(_0x3a679a){_0x50bbf1['push'](_0x50bbf1['shift']());}}}(a27_0x9855,0xc4cad));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':a27_0x22e844(0x1ea),'command':a27_0x22e844(0x1f9),'description':a27_0x22e844(0x1e4),'risk':'high-risk-write','flags':[{'name':a27_0x22e844(0x1f1),'type':'string','required':!![],'description':a27_0x22e844(0x208)}],async 'validate'(_0x4c1856){const _0xcd7034=a27_0x22e844,_0x2a4cfa=loadBffProjectConfig(_0x4c1856[_0xcd7034(0x1fd)]),_0x4e50c5=await readBffLockFile(_0x2a4cfa[_0xcd7034(0x1ed)]);if(!_0x4e50c5)throw CliErrors[_0xcd7034(0x1e5)](_0xcd7034(0x205));},async 'dryRun'(_0x4a7817){const _0x2764e1=a27_0x22e844,_0x4b2c29=loadBffProjectConfig(_0x4a7817[_0x2764e1(0x1fd)]),_0x33f4d1=await readBffLockFile(_0x4b2c29[_0x2764e1(0x1ed)]);if(!_0x33f4d1)throw CliErrors[_0x2764e1(0x1e5)](_0x2764e1(0x20a));const {appLock:_0x3574f2}=ensureLockScope(_0x33f4d1,_0x4a7817[_0x2764e1(0x1fd)],_0x4b2c29[_0x2764e1(0x20b)],_0x2764e1(0x1f9)),_0x11f432=_0x4a7817[_0x2764e1(0x1de)]('target'),_0x5bcdbb=Object[_0x2764e1(0x1e1)](_0x3574f2[_0x2764e1(0x1df)]),_0x20eda9=resolveDeleteTarget(_0x11f432,_0x5bcdbb),_0x5797af=_0x3574f2[_0x2764e1(0x1df)][_0x20eda9];if(!_0x5797af)throw CliErrors[_0x2764e1(0x1e5)](_0x2764e1(0x204)+_0x20eda9+'\x22.');const _0x6714fa=resolveLocalFilePathFromLockKey(_0x4b2c29,_0x20eda9),_0x1d3c5c=relative(_0x4b2c29[_0x2764e1(0x1fe)],_0x6714fa),_0x46b66c=join(_0x4b2c29['trashDir'],_0x2764e1(0x1f4),_0x1d3c5c);return{'method':_0x2764e1(0x1fc),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x4a7817[_0x2764e1(0x1fd)],'target':_0x20eda9,'remoteId':_0x5797af[_0x2764e1(0x1e9)],'localFilePath':_0x6714fa,'trashedPath':_0x46b66c},'description':'Would\x20delete\x20'+_0x20eda9+_0x2764e1(0x1ff)};},async 'execute'(_0xf48af1){const _0xaecceb=a27_0x22e844,_0x2e623f=loadBffProjectConfig(_0xf48af1[_0xaecceb(0x1fd)]),_0x56b5f8=await readBffLockFile(_0x2e623f[_0xaecceb(0x1ed)]);if(!_0x56b5f8)throw CliErrors[_0xaecceb(0x1e5)](_0xaecceb(0x20a));const {lockData:_0x75db26,appLock:_0x35637a}=ensureLockScope(_0x56b5f8,_0xf48af1[_0xaecceb(0x1fd)],_0x2e623f[_0xaecceb(0x20b)],_0xaecceb(0x1f9)),_0x332ca9=_0xf48af1['str'](_0xaecceb(0x1f1)),_0x42c738=Object[_0xaecceb(0x1e1)](_0x35637a['functions']),_0x8d3d7e=resolveDeleteTarget(_0x332ca9,_0x42c738),_0x25831a=_0x35637a[_0xaecceb(0x1df)][_0x8d3d7e];if(!_0x25831a)throw CliErrors['validation'](_0xaecceb(0x204)+_0x8d3d7e+'\x22.');await deleteBffScript(_0x25831a['remoteId']),delete _0x35637a[_0xaecceb(0x1df)][_0x8d3d7e],_0x35637a[_0xaecceb(0x1f6)]=new Date()[_0xaecceb(0x1f2)](),await writeBffLockFile(_0x2e623f['lockFilePath'],_0x75db26);const _0x2a87af=resolveLocalFilePathFromLockKey(_0x2e623f,_0x8d3d7e);let _0x11d2c7;await fileExists(_0x2a87af)&&(_0x11d2c7=await moveToTrash(_0x2e623f[_0xaecceb(0x1fe)],_0x2e623f[_0xaecceb(0x200)],_0x2a87af),await cleanupEmptyDirectories(dirname(_0x2a87af),_0x2e623f[_0xaecceb(0x1eb)]));const _0x17d38e={'deleted':_0x8d3d7e,'remoteId':_0x25831a[_0xaecceb(0x1e9)]};if(_0x11d2c7)_0x17d38e[_0xaecceb(0x1f3)]=_0x11d2c7;return{'ok':!![],'data':_0x17d38e,'message':_0xaecceb(0x1e8)+_0x8d3d7e+(_0x11d2c7?_0xaecceb(0x1dd):'')};}};function resolveDeleteTarget(_0x25255f,_0x503ae1){const _0x1025f1=a27_0x22e844;if(_0x25255f[_0x1025f1(0x1f0)]('/')){const _0x350768=_0x503ae1[_0x1025f1(0x1e2)](_0x3722b9=>_0x3722b9===_0x25255f);if(!_0x350768)throw CliErrors[_0x1025f1(0x1e5)](_0x1025f1(0x203)+_0x25255f);return _0x350768;}const _0x705cc7=_0x503ae1['filter'](_0x1b41f5=>_0x1b41f5[_0x1025f1(0x1ef)]('/')['at'](-0x1)===_0x25255f);if(_0x705cc7[_0x1025f1(0x1e0)]===0x0)throw CliErrors['validation'](_0x1025f1(0x203)+_0x25255f);if(_0x705cc7[_0x1025f1(0x1e0)]>0x1)throw CliErrors['validation'](_0x1025f1(0x1f5)+_0x25255f+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x705cc7[_0x1025f1(0x1fb)](_0x541371=>_0x1025f1(0x1fa)+_0x541371)[_0x1025f1(0x1f7)]('\x0a'));return _0x705cc7[0x0];}function a27_0x9855(){const _0x306a88=['projectRoot','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','trashDir','59322Qhfpzx','9RChmJg','Function\x20not\x20found:\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','73311jUfbHA','272fmcRtn','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','229906rPIeJf','BFF\x20lock\x20file\x20not\x20found.','scriptsRoot','3664390XuOmBX','\x20(local\x20file\x20moved\x20to\x20trash)','str','functions','length','keys','find','8yAadzx','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','validation','11580800Maafqx','448350WJGjZB','Deleted\x20','remoteId','bff','scriptsRootDir','45mAMpig','lockFilePath','replace','split','includes','target','toISOString','trashedTo','<timestamp>','Multiple\x20functions\x20match\x20\x22','lastSync','join','1978498euQaKs','delete','\x20\x20-\x20','map','POST','appCode'];a27_0x9855=function(){return _0x306a88;};return a27_0x9855();}function a27_0x129f(_0x4e6891,_0x1e3787){_0x4e6891=_0x4e6891-0x1dc;const _0x985593=a27_0x9855();let _0x129fac=_0x985593[_0x4e6891];return _0x129fac;}async function moveToTrash(_0x39803e,_0x26505e,_0x35995c){const _0x54d2c3=a27_0x22e844,_0x23689d=new Date()[_0x54d2c3(0x1f2)]()[_0x54d2c3(0x1ee)](/[:.]/g,'-'),_0x2c98f5=relative(_0x39803e,_0x35995c),_0x5766bb=join(_0x26505e,_0x23689d,_0x2c98f5);return await mkdir(dirname(_0x5766bb),{'recursive':!![]}),await rename(_0x35995c,_0x5766bb),_0x5766bb;}async function cleanupEmptyDirectories(_0x486fbd,_0xa6e413){let _0x5ab386=resolve(_0x486fbd);const _0x2c588e=resolve(_0xa6e413);while(_0x5ab386['startsWith'](''+_0x2c588e+sep)||_0x5ab386===_0x2c588e){if(_0x5ab386===_0x2c588e)return;try{const _0x31b2d2=await readdir(_0x5ab386);if(_0x31b2d2['length']>0x0)return;await rmdir(_0x5ab386);}catch{return;}_0x5ab386=dirname(_0x5ab386);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x59eac7=a28_0x1910;(function(_0x16c55f,_0x311801){const _0x497bdd=a28_0x1910,_0x28d953=_0x16c55f();while(!![]){try{const _0x31a241=-parseInt(_0x497bdd(0x191))/0x1*(parseInt(_0x497bdd(0x189))/0x2)+parseInt(_0x497bdd(0x199))/0x3*(-parseInt(_0x497bdd(0x187))/0x4)+parseInt(_0x497bdd(0x190))/0x5*(-parseInt(_0x497bdd(0x18a))/0x6)+parseInt(_0x497bdd(0x194))/0x7+-parseInt(_0x497bdd(0x180))/0x8*(-parseInt(_0x497bdd(0x184))/0x9)+parseInt(_0x497bdd(0x18e))/0xa+-parseInt(_0x497bdd(0x186))/0xb;if(_0x31a241===_0x311801)break;else _0x28d953['push'](_0x28d953['shift']());}catch(_0x299b5c){_0x28d953['push'](_0x28d953['shift']());}}}(a28_0x4455,0x9d656));import{getBffScriptInfo}from'../../core/api-client.js';function a28_0x1910(_0x55b0c1,_0x383191){_0x55b0c1=_0x55b0c1-0x180;const _0x445598=a28_0x4455();let _0x191010=_0x445598[_0x55b0c1];return _0x191010;}function a28_0x4455(){const _0x22dd5c=['453117uaJrKI','scriptType','1712qkTeFv','createdTime','verbose','Get\x20BFF\x20script\x20details\x20by\x20ID','47970IjRSit','number','2106500paiioF','32wnjUOv','scriptContent','8794MmAKBT','774FUnsZz','appCode','detail','updatedTime','5716980xYlaQQ','description','4855IGqGKB','163EnNDZM','read','Return\x20full\x20raw\x20script\x20object','8219106yOAjBd','Script\x20ID','(none)','num','boolean'];a28_0x4455=function(){return _0x22dd5c;};return a28_0x4455();}export const bffDetail={'service':'bff','command':a28_0x59eac7(0x18c),'description':a28_0x59eac7(0x183),'risk':a28_0x59eac7(0x192),'flags':[{'name':'id','type':a28_0x59eac7(0x185),'required':!![],'description':a28_0x59eac7(0x195)},{'name':a28_0x59eac7(0x182),'type':a28_0x59eac7(0x198),'description':a28_0x59eac7(0x193)}],async 'execute'(_0x4e5b46){const _0x5de831=a28_0x59eac7,_0x323c87=await getBffScriptInfo(_0x4e5b46[_0x5de831(0x197)]('id')),_0x35e944=_0x4e5b46['bool'](_0x5de831(0x182));if(_0x35e944)return{'ok':!![],'data':_0x323c87};return{'ok':!![],'data':{'id':_0x323c87['id'],'appCode':_0x323c87[_0x5de831(0x18b)],'scriptType':_0x323c87[_0x5de831(0x19a)],'description':_0x323c87[_0x5de831(0x18f)]||_0x5de831(0x196),'createdTime':_0x323c87[_0x5de831(0x181)]??'','updatedTime':_0x323c87[_0x5de831(0x18d)]??'','scriptContent':_0x323c87[_0x5de831(0x188)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d37ec,_0x3f608e){const _0x283c74=a29_0x3284,_0x2a46a6=_0x5d37ec();while(!![]){try{const _0x5d1f78=parseInt(_0x283c74(0x1c4))/0x1*(-parseInt(_0x283c74(0x1c0))/0x2)+parseInt(_0x283c74(0x1bf))/0x3+-parseInt(_0x283c74(0x1c2))/0x4+parseInt(_0x283c74(0x1be))/0x5*(parseInt(_0x283c74(0x1c3))/0x6)+parseInt(_0x283c74(0x1bb))/0x7+-parseInt(_0x283c74(0x1bd))/0x8*(-parseInt(_0x283c74(0x1c1))/0x9)+-parseInt(_0x283c74(0x1bc))/0xa;if(_0x5d1f78===_0x3f608e)break;else _0x2a46a6['push'](_0x2a46a6['shift']());}catch(_0x346775){_0x2a46a6['push'](_0x2a46a6['shift']());}}}(a29_0x213a,0x739a0));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a29_0x3284(_0x15f8d5,_0x33bc6f){_0x15f8d5=_0x15f8d5-0x1bb;const _0x213a4b=a29_0x213a();let _0x328454=_0x213a4b[_0x15f8d5];return _0x328454;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];function a29_0x213a(){const _0x3fd2da=['11727SsLiPx','644692gESYNi','438GEChgs','459257bLFsvA','5880441XjAjrj','8614690kKJHQQ','2408Hishnf','17305BrFMkA','2789223fthQfD','4AhmwHS'];a29_0x213a=function(){return _0x3fd2da;};return a29_0x213a();}
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x5a41ab=a30_0xd9dc;(function(_0x1231a5,_0x3cbb32){const _0x5bd4b8=a30_0xd9dc,_0x4cbd03=_0x1231a5();while(!![]){try{const _0x398914=-parseInt(_0x5bd4b8(0x147))/0x1+parseInt(_0x5bd4b8(0x13a))/0x2+parseInt(_0x5bd4b8(0x149))/0x3+-parseInt(_0x5bd4b8(0x148))/0x4*(parseInt(_0x5bd4b8(0x13b))/0x5)+parseInt(_0x5bd4b8(0x14f))/0x6+-parseInt(_0x5bd4b8(0x14e))/0x7*(-parseInt(_0x5bd4b8(0x150))/0x8)+-parseInt(_0x5bd4b8(0x13c))/0x9*(parseInt(_0x5bd4b8(0x14a))/0xa);if(_0x398914===_0x3cbb32)break;else _0x4cbd03['push'](_0x4cbd03['shift']());}catch(_0x53a275){_0x4cbd03['push'](_0x4cbd03['shift']());}}}(a30_0x43fc,0x70b73));function a30_0xd9dc(_0x508008,_0x3afb44){_0x508008=_0x508008-0x136;const _0x43fc86=a30_0x43fc();let _0xd9dc5e=_0x43fc86[_0x508008];return _0xd9dc5e;}function a30_0x43fc(){const _0x4eea9e=['List\x20BFF\x20scripts','map','1589786GDwuBz','100IwdJGH','2007ConktK','verbose','appCode','(unnamed)','boolean','ENDPOINT','functionName','string','list','COMMON','bff','307825JjTkQK','84520fQBRoO','2154972MpdxnZ','34690XtJKda','scriptType','str','name','14DtZqCs','1673088nhFzgy','694520usIGQF','type','Return\x20full\x20script\x20objects','length'];a30_0x43fc=function(){return _0x4eea9e;};return a30_0x43fc();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a30_0x5a41ab(0x146),'command':a30_0x5a41ab(0x144),'description':a30_0x5a41ab(0x138),'risk':'read','flags':[{'name':a30_0x5a41ab(0x151),'type':a30_0x5a41ab(0x143),'description':'Script\x20type\x20filter','default':a30_0x5a41ab(0x141),'enum':['ENDPOINT',a30_0x5a41ab(0x145)]},{'name':a30_0x5a41ab(0x14d),'type':a30_0x5a41ab(0x143),'description':'Filter\x20by\x20script\x20name'},{'name':a30_0x5a41ab(0x13d),'type':a30_0x5a41ab(0x140),'description':a30_0x5a41ab(0x136)}],async 'execute'(_0x3c6c32){const _0x4a6a56=a30_0x5a41ab,_0x5a4eb1=await listBffScripts(_0x3c6c32[_0x4a6a56(0x13e)],_0x3c6c32['str'](_0x4a6a56(0x151)),{'scriptName':_0x3c6c32[_0x4a6a56(0x14c)](_0x4a6a56(0x14d))||undefined}),_0x47e4a3=_0x3c6c32['bool'](_0x4a6a56(0x13d));return{'ok':!![],'data':_0x47e4a3?_0x5a4eb1:_0x5a4eb1[_0x4a6a56(0x139)](_0x4a774b=>({'id':_0x4a774b['id'],'functionName':_0x4a774b[_0x4a6a56(0x142)]??'','description':_0x4a774b['description']||_0x4a6a56(0x13f),'scriptType':_0x4a774b[_0x4a6a56(0x14b)]})),'message':_0x5a4eb1[_0x4a6a56(0x137)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4f0f1d=a31_0x48a9;(function(_0x1f2c20,_0x54711d){const _0x37c06f=a31_0x48a9,_0x2b85a7=_0x1f2c20();while(!![]){try{const _0xea5a93=parseInt(_0x37c06f(0x159))/0x1*(-parseInt(_0x37c06f(0x15f))/0x2)+parseInt(_0x37c06f(0x197))/0x3*(-parseInt(_0x37c06f(0x171))/0x4)+parseInt(_0x37c06f(0x153))/0x5+-parseInt(_0x37c06f(0x162))/0x6+parseInt(_0x37c06f(0x198))/0x7*(parseInt(_0x37c06f(0x18a))/0x8)+-parseInt(_0x37c06f(0x17a))/0x9+parseInt(_0x37c06f(0x18f))/0xa;if(_0xea5a93===_0x54711d)break;else _0x2b85a7['push'](_0x2b85a7['shift']());}catch(_0xd675e4){_0x2b85a7['push'](_0x2b85a7['shift']());}}}(a31_0x156c,0x3b39c));import{createInterface}from'node:readline';function a31_0x156c(){const _0x41cff5=['nonInteractive','boolean','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','lastSync','scriptsRoot','string','COMMON','write','functionName','appCode','utf8','toISOString','395792sMsrkN','filePath','&type=','functions','question','570340jUzFey','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','No\x20remote\x20BFF\x20scripts\x20found.','stringify','trim','bool','str','yes','99690IjFYME','63FUWtBZ','lockKey','parse','/api/management/library/scripts/list?appCode=','bff','message','validation','push','map','scriptContent','HOOK','alias','2169160GUSccV','stdin','close','conflict','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','functionNode','1pyCIqZ','type','Pull\x20only\x20this\x20script\x20type','all','version','\x20skipped,\x20','948356EKqEkh','Force\x20pull\x20cancelled.','datasetCode','101520ToaSlB','pull','apiDir','unresolvable\x20target\x20path','local\x20unsynced\x20changes','skipped','operationType','Force\x20overwrite\x20local\x20unsynced\x20changes','would_pull','includes','scriptType','length','\x20remote\x20BFF\x20script(s)\x20for\x20pull','Would\x20inspect\x20','lockFilePath','4SGgWwI','hookLocation','ENDPOINT','force','\x20pulled,\x20','cancelled','Pull\x20complete:\x20','hash','Lock\x20scope\x20for\x20app\x20\x22','1522944xcDGmN','toLowerCase','\x20failed','GET'];a31_0x156c=function(){return _0x41cff5;};return a31_0x156c();}import{writeFile}from'node:fs/promises';function a31_0x48a9(_0x21ec27,_0x335759){_0x21ec27=_0x21ec27-0x14e;const _0x156c1e=a31_0x156c();let _0x48a945=_0x156c1e[_0x21ec27];return _0x48a945;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a31_0x4f0f1d(0x19c),'command':a31_0x4f0f1d(0x163),'description':a31_0x4f0f1d(0x190),'risk':a31_0x4f0f1d(0x185),'flags':[{'name':'type','type':a31_0x4f0f1d(0x183),'description':a31_0x4f0f1d(0x15b),'enum':[a31_0x4f0f1d(0x184),a31_0x4f0f1d(0x173),a31_0x4f0f1d(0x151)]},{'name':'force','type':a31_0x4f0f1d(0x17f),'description':a31_0x4f0f1d(0x169)}],async 'dryRun'(_0x32ec69){const _0x21bd59=a31_0x4f0f1d,_0x10350d=loadBffProjectConfig(_0x32ec69[_0x21bd59(0x187)]),_0x26073a=await readBffLockFile(_0x10350d['lockFilePath']),{appLock:_0x54f7a6}=ensureLockScope(_0x26073a??createEmptyBffLock(),_0x32ec69[_0x21bd59(0x187)],_0x10350d['scriptsRoot'],_0x21bd59(0x163)),_0x226874=normalizeBffType(_0x32ec69[_0x21bd59(0x195)]('type'))??undefined,_0x582723=buildDatasetCodeToAliasMap(_0x32ec69[_0x21bd59(0x164)],_0x32ec69['appCode']),[_0x5b90ed,_0x4af1d4]=await Promise[_0x21bd59(0x15c)]([listBffScripts(_0x32ec69[_0x21bd59(0x187)],_0x226874),getBffScriptStatistics(_0x32ec69[_0x21bd59(0x187)])]),_0x5511e7=createHookLocationMap(_0x4af1d4),_0x11831f=[];for(const _0x118477 of _0x5b90ed){const _0x4bd5d3=resolveRemoteScriptTarget(_0x10350d,_0x118477,_0x5511e7,_0x54f7a6[_0x21bd59(0x18d)],_0x582723);if(!_0x4bd5d3){_0x11831f[_0x21bd59(0x14e)]({'scriptType':_0x118477['scriptType'],'functionName':_0x118477[_0x21bd59(0x186)]??'','status':_0x21bd59(0x167),'reason':_0x21bd59(0x165)});continue;}const _0x3f900e=_0x54f7a6['functions'][_0x4bd5d3['lockKey']],_0xa00571=_0x118477[_0x21bd59(0x150)]!=null?computeContentHash(_0x118477[_0x21bd59(0x150)]):undefined,_0x21b7eb=await hasUnsyncedLocalChanges(_0x4bd5d3['filePath'],_0x3f900e,_0xa00571);_0x11831f['push']({'lockKey':_0x4bd5d3[_0x21bd59(0x199)],'filePath':_0x4bd5d3[_0x21bd59(0x18b)],'remoteId':_0x118477['id']??null,'status':_0x21b7eb?_0x21bd59(0x156):_0x21bd59(0x16a)});}return{'method':_0x21bd59(0x17d),'url':_0x21bd59(0x19b)+_0x32ec69[_0x21bd59(0x187)]+(_0x226874?_0x21bd59(0x18c)+_0x226874:''),'body':{'appCode':_0x32ec69[_0x21bd59(0x187)],'filterType':_0x226874??null,'files':_0x11831f},'description':_0x21bd59(0x16f)+_0x11831f['length']+_0x21bd59(0x16e)};},async 'execute'(_0x22ff5f){const _0x2f75bd=a31_0x4f0f1d,_0x968588=loadBffProjectConfig(_0x22ff5f[_0x2f75bd(0x187)]),_0xe26a49=await readBffLockFile(_0x968588[_0x2f75bd(0x170)]),{lockData:_0x4a3885,appLock:_0x2026bc}=ensureLockScope(_0xe26a49??createEmptyBffLock(),_0x22ff5f['appCode'],_0x968588[_0x2f75bd(0x182)],_0x2f75bd(0x163)),_0x222279=normalizeBffType(_0x22ff5f['str'](_0x2f75bd(0x15a)))??undefined;if(_0x22ff5f[_0x2f75bd(0x195)](_0x2f75bd(0x15a))&&!_0x222279)throw CliErrors[_0x2f75bd(0x19e)](_0x2f75bd(0x180));const [_0x4c2730,_0x5c9ebf]=await Promise[_0x2f75bd(0x15c)]([listBffScripts(_0x22ff5f[_0x2f75bd(0x187)],_0x222279),getBffScriptStatistics(_0x22ff5f[_0x2f75bd(0x187)])]);if(_0x4c2730[_0x2f75bd(0x16d)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x2f75bd(0x191)};const _0x454a11=_0x22ff5f[_0x2f75bd(0x194)](_0x2f75bd(0x174));if(_0x454a11&&!_0x22ff5f[_0x2f75bd(0x17e)]){const _0x5b5c1f=await confirmForce();if(!_0x5b5c1f)throw CliErrors[_0x2f75bd(0x176)](_0x2f75bd(0x160));}if(_0x454a11&&_0x22ff5f[_0x2f75bd(0x17e)]){}const _0x1ae269=buildDatasetCodeToAliasMap(_0x22ff5f[_0x2f75bd(0x164)],_0x22ff5f[_0x2f75bd(0x187)]),_0x3d33be=createHookLocationMap(_0x5c9ebf),_0xbc945c=JSON[_0x2f75bd(0x19a)](JSON[_0x2f75bd(0x192)](_0x4a3885)),_0x41444d=_0x22ff5f[_0x2f75bd(0x187)],_0x4a5898=_0xbc945c['apps'][_0x41444d];if(!_0x4a5898)throw new Error(_0x2f75bd(0x179)+_0x41444d+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x12ab26=[],_0xe61175=[],_0x587157=[];for(const _0xae2365 of _0x4c2730){const _0x46fd34=resolveRemoteScriptTarget(_0x968588,_0xae2365,_0x3d33be,_0x2026bc[_0x2f75bd(0x18d)],_0x1ae269);if(!_0x46fd34){_0xe61175[_0x2f75bd(0x14e)]({'lockKey':_0xae2365[_0x2f75bd(0x16c)]+'/'+_0xae2365[_0x2f75bd(0x186)],'reason':_0x2f75bd(0x165)});continue;}const _0x540407=_0x2026bc[_0x2f75bd(0x18d)][_0x46fd34[_0x2f75bd(0x199)]];try{if(!_0xae2365['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0xae2365['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x245202=_0xae2365['scriptContent'],_0x2f5fac=computeContentHash(_0x245202);if(!_0x454a11){const _0x3a95a4=await hasUnsyncedLocalChanges(_0x46fd34[_0x2f75bd(0x18b)],_0x540407,_0x2f5fac);if(_0x3a95a4){_0xe61175[_0x2f75bd(0x14e)]({'lockKey':_0x46fd34[_0x2f75bd(0x199)],'reason':_0x2f75bd(0x166)});continue;}}await ensureParentDirectory(_0x46fd34[_0x2f75bd(0x18b)]),await writeFile(_0x46fd34[_0x2f75bd(0x18b)],_0x245202,_0x2f75bd(0x188));const _0x250f14={'hash':_0x2f5fac,'remoteId':_0xae2365['id'],'version':_0xae2365[_0x2f75bd(0x15d)]};_0x46fd34[_0x2f75bd(0x15a)]===_0x2f75bd(0x151)&&_0x46fd34[_0x2f75bd(0x172)]&&(_0x250f14[_0x2f75bd(0x152)]=_0x46fd34[_0x2f75bd(0x172)][_0x2f75bd(0x152)],_0x250f14[_0x2f75bd(0x161)]=_0x46fd34[_0x2f75bd(0x172)][_0x2f75bd(0x161)],_0x250f14['operationType']=_0x46fd34[_0x2f75bd(0x172)][_0x2f75bd(0x168)],_0x250f14[_0x2f75bd(0x158)]=_0x46fd34['hookLocation'][_0x2f75bd(0x158)]),_0x4a5898[_0x2f75bd(0x18d)][_0x46fd34[_0x2f75bd(0x199)]]=_0x250f14,_0x12ab26[_0x2f75bd(0x14e)]({'lockKey':_0x46fd34[_0x2f75bd(0x199)],'remoteId':_0xae2365['id']});}catch(_0x2ac84c){_0x587157['push']({'lockKey':_0x46fd34[_0x2f75bd(0x199)],'error':_0x2ac84c instanceof Error?_0x2ac84c[_0x2f75bd(0x19d)]:String(_0x2ac84c)});}}return _0x4a5898[_0x2f75bd(0x181)]=new Date()[_0x2f75bd(0x189)](),await writeBffLockFile(_0x968588[_0x2f75bd(0x170)],_0xbc945c),{'ok':_0x587157[_0x2f75bd(0x16d)]===0x0,'data':{'pulled':_0x12ab26,'skipped':_0xe61175,'failed':_0x587157},'message':_0x2f75bd(0x177)+_0x12ab26[_0x2f75bd(0x16d)]+_0x2f75bd(0x175)+_0xe61175['length']+_0x2f75bd(0x15e)+_0x587157['length']+_0x2f75bd(0x17c)};}};async function hasUnsyncedLocalChanges(_0x95186a,_0x171d67,_0x1cdf76){const _0x526902=a31_0x4f0f1d;if(!await fileExists(_0x95186a))return![];const _0x54ca51=await computeFileHash(_0x95186a);if(!_0x171d67)return _0x1cdf76?_0x54ca51!==_0x1cdf76:!![];return _0x54ca51!==_0x171d67[_0x526902(0x178)];}function buildDatasetCodeToAliasMap(_0x5cdcb0,_0x4c3daa){const _0x503b2a=a31_0x4f0f1d,_0x3529fb=loadAliasMap(_0x5cdcb0,undefined,resolveApiFilePath(_0x5cdcb0,_0x4c3daa));return new Map(_0x3529fb[_0x503b2a(0x14f)](_0x5d082c=>[_0x5d082c[_0x503b2a(0x161)],_0x5d082c[_0x503b2a(0x152)]]));}async function confirmForce(){const _0x38351e=a31_0x4f0f1d,_0x529c2a=createInterface({'input':process[_0x38351e(0x154)],'output':process['stderr']}),_0x247125=await new Promise(_0x35644a=>{const _0x44c697=_0x38351e;_0x529c2a[_0x44c697(0x18e)](_0x44c697(0x157),_0x35644a);});return _0x529c2a[_0x38351e(0x155)](),['y',_0x38351e(0x196)][_0x38351e(0x16b)](_0x247125[_0x38351e(0x193)]()[_0x38351e(0x17b)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x3d19fa=a32_0x24d8;(function(_0x2714b2,_0xa37383){const _0x1eeb3c=a32_0x24d8,_0x55ef39=_0x2714b2();while(!![]){try{const _0x49a1d9=-parseInt(_0x1eeb3c(0x10a))/0x1*(parseInt(_0x1eeb3c(0x113))/0x2)+parseInt(_0x1eeb3c(0x12e))/0x3+parseInt(_0x1eeb3c(0x109))/0x4*(parseInt(_0x1eeb3c(0x12f))/0x5)+-parseInt(_0x1eeb3c(0x106))/0x6*(parseInt(_0x1eeb3c(0x133))/0x7)+parseInt(_0x1eeb3c(0x13a))/0x8*(-parseInt(_0x1eeb3c(0x122))/0x9)+parseInt(_0x1eeb3c(0x111))/0xa+-parseInt(_0x1eeb3c(0x130))/0xb*(-parseInt(_0x1eeb3c(0xfa))/0xc);if(_0x49a1d9===_0xa37383)break;else _0x55ef39['push'](_0x55ef39['shift']());}catch(_0xdd68b3){_0x55ef39['push'](_0x55ef39['shift']());}}}(a32_0xf594,0xb61f0));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a32_0x3d19fa(0x12d),'command':'push','description':a32_0x3d19fa(0x11a),'risk':a32_0x3d19fa(0xf6),'flags':[{'name':'type','type':a32_0x3d19fa(0x121),'description':a32_0x3d19fa(0x110),'enum':[a32_0x3d19fa(0x128),a32_0x3d19fa(0xff),'HOOK']},{'name':a32_0x3d19fa(0x103),'type':a32_0x3d19fa(0x121),'description':a32_0x3d19fa(0x108)},{'name':a32_0x3d19fa(0x124),'type':a32_0x3d19fa(0x107),'description':a32_0x3d19fa(0x10b)}],async 'dryRun'(_0x39a1b8){const _0x42ab24=a32_0x3d19fa,_0x96710e=loadBffProjectConfig(_0x39a1b8[_0x42ab24(0x104)]),_0x1b4c30=await readBffLockFile(_0x96710e[_0x42ab24(0x132)]),{appLock:_0x149c37}=ensureLockScope(_0x1b4c30??createEmptyBffLock(),_0x39a1b8[_0x42ab24(0x104)],_0x96710e[_0x42ab24(0x11c)],_0x42ab24(0x129)),_0xfd5947=await getTargetFunctions(_0x96710e,_0x39a1b8),_0x255cd9=_0x39a1b8['bool'](_0x42ab24(0x124)),_0x246004=[];for(const _0x59121d of _0xfd5947){const _0x181225=await computeFileHash(_0x59121d[_0x42ab24(0x13d)]),_0x55d082=_0x149c37[_0x42ab24(0xfc)][_0x59121d[_0x42ab24(0x12b)]],_0x17ef96=!!_0x55d082&&_0x55d082[_0x42ab24(0x10f)]===_0x181225;_0x246004[_0x42ab24(0x129)]({'lockKey':_0x59121d[_0x42ab24(0x12b)],'filePath':_0x59121d[_0x42ab24(0x13d)],'remoteId':_0x55d082?.['remoteId']??null,'mode':_0x55d082?.['remoteId']?_0x42ab24(0x127):_0x42ab24(0x131),'status':!_0x255cd9&&_0x17ef96?'unchanged':_0x42ab24(0x10d)});}return{'method':_0x42ab24(0xfb),'url':_0x42ab24(0xf1),'body':{'appCode':_0x39a1b8[_0x42ab24(0x104)],'force':_0x255cd9,'files':_0x246004},'description':'Would\x20inspect\x20'+_0x246004[_0x42ab24(0x13b)]+_0x42ab24(0xf5)};},async 'execute'(_0xf510b3){const _0x50c836=a32_0x3d19fa,_0x597d2c=loadBffProjectConfig(_0xf510b3[_0x50c836(0x104)]),_0x3b35d9=await readBffLockFile(_0x597d2c[_0x50c836(0x132)]),{lockData:_0x27c97c,appLock:_0x2b0e91}=ensureLockScope(_0x3b35d9??createEmptyBffLock(),_0xf510b3[_0x50c836(0x104)],_0x597d2c[_0x50c836(0x11c)],_0x50c836(0x129)),_0x2220bb=await getTargetFunctions(_0x597d2c,_0xf510b3);if(_0x2220bb[_0x50c836(0x13b)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x50c836(0x119)};const _0x1e4c6d=_0xf510b3[_0x50c836(0x105)](_0x50c836(0x124)),_0x4b470d=await buildHookMaps(_0xf510b3[_0x50c836(0x104)],_0xf510b3['apiDir'],_0x2220bb,_0x2b0e91),_0xdd7fe8=[],_0x272da3=[],_0x1b007d=[];for(const _0x4dda6e of _0x2220bb){const _0x216639=await computeFileHash(_0x4dda6e[_0x50c836(0x13d)]),_0xb7cc7a=_0x2b0e91['functions'][_0x4dda6e[_0x50c836(0x12b)]];if(!_0x1e4c6d&&_0xb7cc7a&&_0xb7cc7a[_0x50c836(0x10f)]===_0x216639){_0x272da3[_0x50c836(0x129)]({'lockKey':_0x4dda6e['lockKey'],'reason':_0x50c836(0x135)});continue;}try{await uploadSingleFunction(_0xf510b3[_0x50c836(0x104)],_0x4dda6e,_0x2b0e91,_0x4b470d);const _0x5d2a98=_0x2b0e91[_0x50c836(0xfc)][_0x4dda6e['lockKey']];_0xdd7fe8[_0x50c836(0x129)]({'lockKey':_0x4dda6e[_0x50c836(0x12b)],'remoteId':_0x5d2a98?.[_0x50c836(0x116)]??0x0});}catch(_0x299f76){_0x1b007d[_0x50c836(0x129)]({'lockKey':_0x4dda6e[_0x50c836(0x12b)],'error':_0x299f76 instanceof Error?_0x299f76[_0x50c836(0x101)]:String(_0x299f76)});}}return _0x2b0e91[_0x50c836(0xf4)]=new Date()[_0x50c836(0x118)](),await writeBffLockFile(_0x597d2c[_0x50c836(0x132)],_0x27c97c),{'ok':_0x1b007d[_0x50c836(0x13b)]===0x0,'data':{'uploaded':_0xdd7fe8,'skipped':_0x272da3,'failed':_0x1b007d},'message':_0x50c836(0x13c)+_0xdd7fe8[_0x50c836(0x13b)]+_0x50c836(0x100)+_0x272da3[_0x50c836(0x13b)]+_0x50c836(0x115)+_0x1b007d[_0x50c836(0x13b)]+'\x20failed'};}};function a32_0xf594(){const _0x5d9140=['set','unchanged','\x22.\x20','has','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','utf8','60776apLcrJ','length','Push\x20complete:\x20','filePath','Incomplete\x20HOOK\x20path:\x20','/api/management/library/scripts/save','version','datasetId','lastSync','\x20local\x20BFF\x20script(s)\x20for\x20push','high-risk-write','HOOK','type','map','12mYEmCK','POST','functions','operationType','datasetCode','ENDPOINT','\x20uploaded,\x20','message','aliasToDatasetCode','name','appCode','bool','13218pfsNXu','boolean','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','4gZvRZS','16350NyJfzD','Force\x20push\x20ignoring\x20hash\x20protection','filter','would_push',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','hash','Push\x20only\x20this\x20script\x20type','5292900hXWwdk','get','40Kywlxo','code','\x20skipped,\x20','remoteId','str','toISOString','No\x20local\x20BFF\x20functions\x20found.','Push\x20local\x20BFF\x20scripts\x20to\x20remote','datasetCodeToId','scriptsRoot','functionNode','values','validation','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','828lzOclz','script','force','Run\x20`','description','update','COMMON','push','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','lockKey','alias','bff','3007086STzZDV','1218535YqdrJd','15252886ADvsFR','create','lockFilePath','4417qJCBCP'];a32_0xf594=function(){return _0x5d9140;};return a32_0xf594();}async function getTargetFunctions(_0x441542,_0x4ed22f){const _0x728d0a=a32_0x3d19fa,_0xe47e20=_0x4ed22f[_0x728d0a(0x117)]('type'),_0x1e2242=_0x4ed22f[_0x728d0a(0x117)](_0x728d0a(0x103)),_0x187dca=normalizeBffType(_0xe47e20)??undefined;if(_0x1e2242&&!_0x187dca)throw CliErrors['validation'](_0x728d0a(0x138));const _0x382af3=await scanLocalBffFunctions(_0x441542,_0x187dca);if(_0x1e2242){const _0x5542ce=_0x382af3[_0x728d0a(0x10c)](_0x458b79=>_0x458b79[_0x728d0a(0x103)]===_0x1e2242);if(_0x5542ce[_0x728d0a(0x13b)]===0x0)throw CliErrors[_0x728d0a(0x11f)]('Local\x20function\x20not\x20found:\x20'+_0x187dca+'/'+_0x1e2242);return _0x5542ce;}return _0x382af3;}function a32_0x24d8(_0x3028b2,_0x466897){_0x3028b2=_0x3028b2-0xf1;const _0xf59433=a32_0xf594();let _0x24d88a=_0xf59433[_0x3028b2];return _0x24d88a;}async function buildHookMaps(_0x326a92,_0x1a4584,_0x65adef,_0x445f9c){const _0x515d84=a32_0x3d19fa,_0x99462f=_0x65adef['some'](_0x7f8f17=>_0x7f8f17[_0x515d84(0xf8)]===_0x515d84(0xf7));if(!_0x99462f)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x4fe448=loadAliasMap(_0x1a4584,undefined,resolveApiFilePath(_0x1a4584,_0x326a92)),_0x238a96=new Map(_0x4fe448[_0x515d84(0xf9)](_0x2d34ac=>[_0x2d34ac[_0x515d84(0x12c)],_0x2d34ac['datasetCode']]));for(const _0x1bb573 of Object[_0x515d84(0x11e)](_0x445f9c[_0x515d84(0xfc)])){_0x1bb573['alias']&&_0x1bb573[_0x515d84(0xfe)]&&!_0x238a96['has'](_0x1bb573[_0x515d84(0x12c)])&&_0x238a96[_0x515d84(0x134)](_0x1bb573[_0x515d84(0x12c)],_0x1bb573['datasetCode']);}const _0x516687=await listDatasets(_0x326a92),_0x1ba2f6=new Map(_0x516687[_0x515d84(0xf9)](_0x232040=>[_0x232040[_0x515d84(0x114)],_0x232040['id']]));return{'aliasToDatasetCode':_0x238a96,'datasetCodeToId':_0x1ba2f6};}async function uploadSingleFunction(_0x42c0c0,_0x581181,_0x22ff24,_0x2c8a75){const _0x3e4632=a32_0x3d19fa,_0x49f066=await readFile(_0x581181[_0x3e4632(0x13d)],_0x3e4632(0x139)),_0xdb22aa=await computeFileHash(_0x581181[_0x3e4632(0x13d)]),_0x11bd06=_0x22ff24[_0x3e4632(0xfc)][_0x581181[_0x3e4632(0x12b)]];if(_0x11bd06?.[_0x3e4632(0x116)]&&_0x11bd06['version']==null)throw CliErrors[_0x3e4632(0x11f)](_0x581181[_0x3e4632(0x12b)]+_0x3e4632(0x10e));let _0x58c578=extractScriptDescription(_0x49f066);if(!_0x58c578&&_0x11bd06?.[_0x3e4632(0x116)]){const _0x198ae3=await getBffScriptInfo(_0x11bd06['remoteId']);_0x58c578=_0x198ae3[_0x3e4632(0x126)]||undefined;}const _0x3e3705={'appCode':_0x42c0c0,'functionName':_0x581181[_0x3e4632(0x103)],'scriptType':_0x581181[_0x3e4632(0xf8)],'scriptContent':_0x49f066};if(_0x11bd06?.[_0x3e4632(0x116)])_0x3e3705['id']=_0x11bd06['remoteId'];if(_0x11bd06?.[_0x3e4632(0xf2)]!=null)_0x3e3705[_0x3e4632(0xf2)]=_0x11bd06['version'];if(_0x58c578)_0x3e3705['description']=_0x58c578;if(_0x581181[_0x3e4632(0xf8)]===_0x3e4632(0xf7)){const _0x31eee2=_0x581181[_0x3e4632(0x12c)];if(!_0x31eee2||!_0x581181['operationType']||!_0x581181[_0x3e4632(0x11d)])throw CliErrors[_0x3e4632(0x11f)](_0x3e4632(0x13e)+_0x581181[_0x3e4632(0x12b)]);const _0x3e3764=_0x2c8a75[_0x3e4632(0x102)][_0x3e4632(0x112)](_0x31eee2)??_0x11bd06?.[_0x3e4632(0xfe)]??_0x31eee2,_0x230a4d=_0x2c8a75[_0x3e4632(0x11b)][_0x3e4632(0x112)](_0x3e3764);if(!_0x230a4d)throw CliErrors['validation'](_0x3e4632(0x120)+_0x31eee2+_0x3e4632(0x136)+(_0x3e4632(0x125)+CLI_BIN_NAME+_0x3e4632(0x12a)));_0x3e3705[_0x3e4632(0xf3)]=_0x230a4d,_0x3e3705[_0x3e4632(0xfd)]=_0x581181[_0x3e4632(0xfd)],_0x3e3705[_0x3e4632(0x11d)]=_0x581181[_0x3e4632(0x11d)];}const _0x33dae6=await saveBffScript(_0x3e3705),_0x4eeb5a=_0x33dae6['id'],_0x191430=_0x33dae6[_0x3e4632(0x123)]??await getBffScriptInfo(_0x4eeb5a),_0x2e403c={'hash':_0xdb22aa,'remoteId':_0x4eeb5a,'version':_0x191430[_0x3e4632(0xf2)]};if(_0x581181[_0x3e4632(0xf8)]===_0x3e4632(0xf7)){const _0x50e155=_0x581181[_0x3e4632(0x12c)],_0x4b7bc6=_0x2c8a75[_0x3e4632(0x102)][_0x3e4632(0x112)](_0x50e155)??_0x11bd06?.[_0x3e4632(0xfe)]??_0x50e155;_0x2c8a75[_0x3e4632(0x102)][_0x3e4632(0x137)](_0x50e155)?_0x2e403c[_0x3e4632(0x12c)]=_0x50e155:_0x2e403c[_0x3e4632(0x12c)]=_0x11bd06?.[_0x3e4632(0x12c)],_0x2e403c['datasetCode']=_0x4b7bc6,_0x2e403c[_0x3e4632(0xfd)]=_0x581181['operationType'],_0x2e403c[_0x3e4632(0x11d)]=_0x581181['functionNode'];}_0x22ff24[_0x3e4632(0xfc)][_0x581181['lockKey']]=_0x2e403c;}
|
|
1
|
+
const a32_0x521383=a32_0x5614;(function(_0x59165a,_0x34188e){const _0x569a93=a32_0x5614,_0x2953da=_0x59165a();while(!![]){try{const _0x20e255=-parseInt(_0x569a93(0x187))/0x1+-parseInt(_0x569a93(0x199))/0x2*(parseInt(_0x569a93(0x1a7))/0x3)+-parseInt(_0x569a93(0x19b))/0x4+parseInt(_0x569a93(0x194))/0x5*(-parseInt(_0x569a93(0x193))/0x6)+parseInt(_0x569a93(0x1b7))/0x7+-parseInt(_0x569a93(0x1b0))/0x8*(-parseInt(_0x569a93(0x1a3))/0x9)+parseInt(_0x569a93(0x1a4))/0xa;if(_0x20e255===_0x34188e)break;else _0x2953da['push'](_0x2953da['shift']());}catch(_0x3da43a){_0x2953da['push'](_0x2953da['shift']());}}}(a32_0x50ea,0x7cdee));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a32_0x50ea(){const _0x1a7ee5=['string','lockKey','lockFilePath','push','some','filePath','/api/management/library/scripts/save','24kkIZTX','name','Push\x20only\x20this\x20script\x20type','COMMON','toISOString','would_push','functions','5189520GjOVSL','appCode','set','lastSync','Incomplete\x20HOOK\x20path:\x20','get','validation','Push\x20complete:\x20','filter','aliasToDatasetCode','datasetCode','script','No\x20local\x20BFF\x20functions\x20found.','datasetCodeToId','bool','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','unchanged','\x22.\x20','remoteId','apiDir','functionNode','high-risk-write','399248pLiNQp','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','hash','operationType','str','utf8','\x20failed','\x20uploaded,\x20','description','length','has','Push\x20local\x20BFF\x20scripts\x20to\x20remote','43854ylDAAS','395HIhIbm','alias','POST','force','\x20local\x20BFF\x20script(s)\x20for\x20push','2Syeviv','HOOK','1476108hXUjYW','map','scriptsRoot','ENDPOINT','type','bff','Would\x20inspect\x20','create','1362735Bjjzhq','9483620ziIYhO',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','boolean','860433JUoSJB','update'];a32_0x50ea=function(){return _0x1a7ee5;};return a32_0x50ea();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a32_0x5614(_0x447bc7,_0x16116e){_0x447bc7=_0x447bc7-0x181;const _0x50ea7e=a32_0x50ea();let _0x5614cf=_0x50ea7e[_0x447bc7];return _0x5614cf;}export const bffPush={'service':a32_0x521383(0x1a0),'command':a32_0x521383(0x1ac),'description':a32_0x521383(0x192),'risk':a32_0x521383(0x186),'flags':[{'name':a32_0x521383(0x19f),'type':a32_0x521383(0x1a9),'description':a32_0x521383(0x1b2),'enum':[a32_0x521383(0x1b3),a32_0x521383(0x19e),a32_0x521383(0x19a)]},{'name':a32_0x521383(0x1b1),'type':a32_0x521383(0x1a9),'description':a32_0x521383(0x188)},{'name':a32_0x521383(0x197),'type':a32_0x521383(0x1a6),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x42e17c){const _0x20e5a2=a32_0x521383,_0x355a3d=loadBffProjectConfig(_0x42e17c[_0x20e5a2(0x1b8)]),_0x6b7153=await readBffLockFile(_0x355a3d['lockFilePath']),{appLock:_0x1e0a6c}=ensureLockScope(_0x6b7153??createEmptyBffLock(),_0x42e17c['appCode'],_0x355a3d[_0x20e5a2(0x19d)],_0x20e5a2(0x1ac)),_0x25d0c4=await getTargetFunctions(_0x355a3d,_0x42e17c),_0x1de61d=_0x42e17c[_0x20e5a2(0x1c5)](_0x20e5a2(0x197)),_0xe7af9f=[];for(const _0x370430 of _0x25d0c4){const _0x540df8=await computeFileHash(_0x370430['filePath']),_0x23185f=_0x1e0a6c[_0x20e5a2(0x1b6)][_0x370430['lockKey']],_0x55e260=!!_0x23185f&&_0x23185f['hash']===_0x540df8;_0xe7af9f['push']({'lockKey':_0x370430['lockKey'],'filePath':_0x370430[_0x20e5a2(0x1ae)],'remoteId':_0x23185f?.['remoteId']??null,'mode':_0x23185f?.[_0x20e5a2(0x183)]?_0x20e5a2(0x1a8):_0x20e5a2(0x1a2),'status':!_0x1de61d&&_0x55e260?_0x20e5a2(0x181):_0x20e5a2(0x1b5)});}return{'method':_0x20e5a2(0x196),'url':_0x20e5a2(0x1af),'body':{'appCode':_0x42e17c['appCode'],'force':_0x1de61d,'files':_0xe7af9f},'description':_0x20e5a2(0x1a1)+_0xe7af9f[_0x20e5a2(0x190)]+_0x20e5a2(0x198)};},async 'execute'(_0x9f930b){const _0x5a890f=a32_0x521383,_0x3ce75b=loadBffProjectConfig(_0x9f930b[_0x5a890f(0x1b8)]),_0x3292e9=await readBffLockFile(_0x3ce75b[_0x5a890f(0x1ab)]),{lockData:_0x274120,appLock:_0x6485e6}=ensureLockScope(_0x3292e9??createEmptyBffLock(),_0x9f930b['appCode'],_0x3ce75b[_0x5a890f(0x19d)],_0x5a890f(0x1ac)),_0x31330c=await getTargetFunctions(_0x3ce75b,_0x9f930b);if(_0x31330c['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x5a890f(0x1c3)};const _0xaffba4=_0x9f930b[_0x5a890f(0x1c5)](_0x5a890f(0x197)),_0x3479d3=await buildHookMaps(_0x9f930b[_0x5a890f(0x1b8)],_0x9f930b[_0x5a890f(0x184)],_0x31330c,_0x6485e6),_0x4d4879=[],_0x296765=[],_0x386c78=[];for(const _0x50a805 of _0x31330c){const _0x1463ed=await computeFileHash(_0x50a805['filePath']),_0x582b58=_0x6485e6[_0x5a890f(0x1b6)][_0x50a805['lockKey']];if(!_0xaffba4&&_0x582b58&&_0x582b58[_0x5a890f(0x189)]===_0x1463ed){_0x296765[_0x5a890f(0x1ac)]({'lockKey':_0x50a805[_0x5a890f(0x1aa)],'reason':_0x5a890f(0x181)});continue;}try{await uploadSingleFunction(_0x9f930b[_0x5a890f(0x1b8)],_0x50a805,_0x6485e6,_0x3479d3);const _0x36b0fc=_0x6485e6[_0x5a890f(0x1b6)][_0x50a805[_0x5a890f(0x1aa)]];_0x4d4879[_0x5a890f(0x1ac)]({'lockKey':_0x50a805['lockKey'],'remoteId':_0x36b0fc?.[_0x5a890f(0x183)]??0x0});}catch(_0x326459){_0x386c78[_0x5a890f(0x1ac)]({'lockKey':_0x50a805['lockKey'],'error':_0x326459 instanceof Error?_0x326459['message']:String(_0x326459)});}}return _0x6485e6[_0x5a890f(0x1ba)]=new Date()[_0x5a890f(0x1b4)](),await writeBffLockFile(_0x3ce75b[_0x5a890f(0x1ab)],_0x274120),{'ok':_0x386c78[_0x5a890f(0x190)]===0x0,'data':{'uploaded':_0x4d4879,'skipped':_0x296765,'failed':_0x386c78},'message':_0x5a890f(0x1be)+_0x4d4879[_0x5a890f(0x190)]+_0x5a890f(0x18e)+_0x296765[_0x5a890f(0x190)]+'\x20skipped,\x20'+_0x386c78[_0x5a890f(0x190)]+_0x5a890f(0x18d)};}};async function getTargetFunctions(_0x6e6973,_0x51c93b){const _0x201a90=a32_0x521383,_0x25b6a5=_0x51c93b[_0x201a90(0x18b)](_0x201a90(0x19f)),_0x3a6951=_0x51c93b['str'](_0x201a90(0x1b1)),_0x7bf089=normalizeBffType(_0x25b6a5)??undefined;if(_0x3a6951&&!_0x7bf089)throw CliErrors[_0x201a90(0x1bd)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x36d7f2=await scanLocalBffFunctions(_0x6e6973,_0x7bf089);if(_0x3a6951){const _0x3a6198=_0x36d7f2[_0x201a90(0x1bf)](_0xbfc970=>_0xbfc970[_0x201a90(0x1b1)]===_0x3a6951);if(_0x3a6198[_0x201a90(0x190)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x7bf089+'/'+_0x3a6951);return _0x3a6198;}return _0x36d7f2;}async function buildHookMaps(_0x2b6a18,_0x5813d9,_0x555034,_0x353064){const _0x368cac=a32_0x521383,_0x2408b9=_0x555034[_0x368cac(0x1ad)](_0x27b36c=>_0x27b36c[_0x368cac(0x19f)]===_0x368cac(0x19a));if(!_0x2408b9)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x14b616=loadAliasMap(_0x5813d9,undefined,resolveApiFilePath(_0x5813d9,_0x2b6a18)),_0x428e63=new Map(_0x14b616[_0x368cac(0x19c)](_0x2ed3aa=>[_0x2ed3aa[_0x368cac(0x195)],_0x2ed3aa[_0x368cac(0x1c1)]]));for(const _0x14747b of Object['values'](_0x353064[_0x368cac(0x1b6)])){_0x14747b['alias']&&_0x14747b['datasetCode']&&!_0x428e63[_0x368cac(0x191)](_0x14747b['alias'])&&_0x428e63[_0x368cac(0x1b9)](_0x14747b[_0x368cac(0x195)],_0x14747b['datasetCode']);}const _0x5764bc=await listDatasets(_0x2b6a18),_0x18f056=new Map(_0x5764bc[_0x368cac(0x19c)](_0x3bd1bd=>[_0x3bd1bd['code'],_0x3bd1bd['id']]));return{'aliasToDatasetCode':_0x428e63,'datasetCodeToId':_0x18f056};}async function uploadSingleFunction(_0xcd8770,_0x32dda3,_0x3227a6,_0x10d2c4){const _0x55c57c=a32_0x521383,_0x205406=await readFile(_0x32dda3['filePath'],_0x55c57c(0x18c)),_0x4c33f4=await computeFileHash(_0x32dda3[_0x55c57c(0x1ae)]),_0xdd2068=_0x3227a6[_0x55c57c(0x1b6)][_0x32dda3['lockKey']];if(_0xdd2068?.[_0x55c57c(0x183)]&&_0xdd2068[_0x55c57c(0x1c7)]==null)throw CliErrors['validation'](_0x32dda3[_0x55c57c(0x1aa)]+_0x55c57c(0x1a5));let _0x56a86f=extractScriptDescription(_0x205406);if(!_0x56a86f&&_0xdd2068?.[_0x55c57c(0x183)]){const _0x18d898=await getBffScriptInfo(_0xdd2068[_0x55c57c(0x183)]);_0x56a86f=_0x18d898[_0x55c57c(0x18f)]||undefined;}const _0x51acbb={'appCode':_0xcd8770,'functionName':_0x32dda3[_0x55c57c(0x1b1)],'scriptType':_0x32dda3[_0x55c57c(0x19f)],'scriptContent':_0x205406};if(_0xdd2068?.[_0x55c57c(0x183)])_0x51acbb['id']=_0xdd2068[_0x55c57c(0x183)];if(_0xdd2068?.[_0x55c57c(0x1c7)]!=null)_0x51acbb[_0x55c57c(0x1c7)]=_0xdd2068[_0x55c57c(0x1c7)];if(_0x56a86f)_0x51acbb['description']=_0x56a86f;if(_0x32dda3[_0x55c57c(0x19f)]===_0x55c57c(0x19a)){const _0x5dbbfa=_0x32dda3[_0x55c57c(0x195)];if(!_0x5dbbfa||!_0x32dda3[_0x55c57c(0x18a)]||!_0x32dda3[_0x55c57c(0x185)])throw CliErrors[_0x55c57c(0x1bd)](_0x55c57c(0x1bb)+_0x32dda3[_0x55c57c(0x1aa)]);const _0x246174=_0x10d2c4[_0x55c57c(0x1c0)][_0x55c57c(0x1bc)](_0x5dbbfa)??_0xdd2068?.[_0x55c57c(0x1c1)]??_0x5dbbfa,_0x2d221d=_0x10d2c4[_0x55c57c(0x1c4)][_0x55c57c(0x1bc)](_0x246174);if(!_0x2d221d)throw CliErrors['validation'](_0x55c57c(0x1c6)+_0x5dbbfa+_0x55c57c(0x182)+('Run\x20`'+CLI_BIN_NAME+_0x55c57c(0x1c8)));_0x51acbb['datasetId']=_0x2d221d,_0x51acbb['operationType']=_0x32dda3['operationType'],_0x51acbb['functionNode']=_0x32dda3[_0x55c57c(0x185)];}const _0x4083c0=await saveBffScript(_0x51acbb),_0x2da0f5=_0x4083c0['id'],_0x49c45e=_0x4083c0[_0x55c57c(0x1c2)]??await getBffScriptInfo(_0x2da0f5),_0x175cd3={'hash':_0x4c33f4,'remoteId':_0x2da0f5,'version':_0x49c45e[_0x55c57c(0x1c7)]};if(_0x32dda3['type']===_0x55c57c(0x19a)){const _0x41adfa=_0x32dda3[_0x55c57c(0x195)],_0x240b91=_0x10d2c4['aliasToDatasetCode'][_0x55c57c(0x1bc)](_0x41adfa)??_0xdd2068?.['datasetCode']??_0x41adfa;_0x10d2c4[_0x55c57c(0x1c0)]['has'](_0x41adfa)?_0x175cd3[_0x55c57c(0x195)]=_0x41adfa:_0x175cd3[_0x55c57c(0x195)]=_0xdd2068?.['alias'],_0x175cd3[_0x55c57c(0x1c1)]=_0x240b91,_0x175cd3['operationType']=_0x32dda3[_0x55c57c(0x18a)],_0x175cd3[_0x55c57c(0x185)]=_0x32dda3[_0x55c57c(0x185)];}_0x3227a6[_0x55c57c(0x1b6)][_0x32dda3['lockKey']]=_0x175cd3;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0x217bcb=a33_0x2e6d;(function(_0x5d2dda,_0x27476d){const _0xdabc0f=a33_0x2e6d,_0x462e4c=_0x5d2dda();while(!![]){try{const _0x44cdff=parseInt(_0xdabc0f(0x72))/0x1+parseInt(_0xdabc0f(0x77))/0x2+parseInt(_0xdabc0f(0x93))/0x3+-parseInt(_0xdabc0f(0x7c))/0x4*(parseInt(_0xdabc0f(0x8c))/0x5)+-parseInt(_0xdabc0f(0x76))/0x6*(parseInt(_0xdabc0f(0x7d))/0x7)+-parseInt(_0xdabc0f(0x84))/0x8*(-parseInt(_0xdabc0f(0x6f))/0x9)+parseInt(_0xdabc0f(0x73))/0xa*(-parseInt(_0xdabc0f(0x8a))/0xb);if(_0x44cdff===_0x27476d)break;else _0x462e4c['push'](_0x462e4c['shift']());}catch(_0x85c32a){_0x462e4c['push'](_0x462e4c['shift']());}}}(a33_0x3bb0,0xcc708));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 a33_0x3bb0(){const _0x4d86c3=['6272538YDRCEq','3082792ZvZUMk','push','datasetCode','appCode','lockFilePath','16148UrrGto','7HEDXff','status','remote','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','length','\x20unchanged','bool','4632MLpcKf','bff','functions','filePath','\x20added,\x20','boolean','319MFSRwb','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','185vPfkQh','all','apiDir','\x20remote-only','scriptsRoot','\x20modified,\x20','hash','1224102HFrOCS','21537JOretF','lockKey','alias','964187VdzhXS','781720XVyZaE','read','All\x20BFF\x20scripts\x20are\x20in\x20sync.'];a33_0x3bb0=function(){return _0x4d86c3;};return a33_0x3bb0();}function a33_0x2e6d(_0x14d856,_0x180c49){_0x14d856=_0x14d856-0x6f;const _0x3bb0b7=a33_0x3bb0();let _0x2e6d29=_0x3bb0b7[_0x14d856];return _0x2e6d29;}export const bffStatus={'service':a33_0x217bcb(0x85),'command':a33_0x217bcb(0x7e),'description':a33_0x217bcb(0x80),'risk':a33_0x217bcb(0x74),'flags':[{'name':a33_0x217bcb(0x7f),'type':a33_0x217bcb(0x89),'description':a33_0x217bcb(0x8b)}],async 'execute'(_0x3c2398){const _0x40d9b4=a33_0x217bcb,_0x17fb4f=loadBffProjectConfig(_0x3c2398['appCode']),_0x198cb8=await readBffLockFile(_0x17fb4f[_0x40d9b4(0x7b)]),{appLock:_0x266895}=ensureLockScope(_0x198cb8??createEmptyBffLock(),_0x3c2398[_0x40d9b4(0x7a)],_0x17fb4f[_0x40d9b4(0x90)],_0x40d9b4(0x7e)),_0xc9b990=await scanLocalBffFunctions(_0x17fb4f),_0xb1d77f=[],_0x110c08=[],_0x3574c3=[];for(const _0x45c70b of _0xc9b990){const _0x3e193b=await computeFileHash(_0x45c70b[_0x40d9b4(0x87)]),_0x37c524=_0x266895[_0x40d9b4(0x86)][_0x45c70b[_0x40d9b4(0x70)]];if(!_0x37c524)_0xb1d77f[_0x40d9b4(0x78)](_0x45c70b[_0x40d9b4(0x70)]);else _0x37c524[_0x40d9b4(0x92)]!==_0x3e193b?_0x110c08['push'](_0x45c70b[_0x40d9b4(0x70)]):_0x3574c3['push'](_0x45c70b[_0x40d9b4(0x70)]);}const _0x3921ac=[];if(_0x3c2398[_0x40d9b4(0x83)]('remote')){const _0x489d59=loadAliasMap(_0x3c2398[_0x40d9b4(0x8e)],undefined,resolveApiFilePath(_0x3c2398['apiDir'],_0x3c2398[_0x40d9b4(0x7a)])),_0x530233=new Map(_0x489d59['map'](_0x3555ed=>[_0x3555ed[_0x40d9b4(0x79)],_0x3555ed[_0x40d9b4(0x71)]])),[_0x2e3fc4,_0x19d508]=await Promise[_0x40d9b4(0x8d)]([listBffScripts(_0x3c2398[_0x40d9b4(0x7a)]),getBffScriptStatistics(_0x3c2398['appCode'])]),_0x492c92=createHookLocationMap(_0x19d508),_0x84338d=new Set(_0xc9b990['map'](_0x4f0de2=>_0x4f0de2[_0x40d9b4(0x70)]));for(const _0x24f128 of _0x2e3fc4){const _0x16d76e=resolveRemoteScriptTarget(_0x17fb4f,_0x24f128,_0x492c92,_0x266895[_0x40d9b4(0x86)],_0x530233);_0x16d76e&&!_0x84338d['has'](_0x16d76e[_0x40d9b4(0x70)])&&_0x3921ac['push'](_0x16d76e[_0x40d9b4(0x70)]);}}const _0x598f44=_0xb1d77f['length']===0x0&&_0x110c08[_0x40d9b4(0x81)]===0x0&&_0x3921ac['length']===0x0;return{'ok':!![],'data':{'added':_0xb1d77f,'modified':_0x110c08,'unchanged':_0x3574c3,'remoteOnly':_0x3921ac},'message':_0x598f44?_0x40d9b4(0x75):_0xb1d77f['length']+_0x40d9b4(0x88)+_0x110c08[_0x40d9b4(0x81)]+_0x40d9b4(0x91)+_0x3574c3['length']+_0x40d9b4(0x82)+(_0x3921ac[_0x40d9b4(0x81)]>0x0?',\x20'+_0x3921ac[_0x40d9b4(0x81)]+_0x40d9b4(0x8f):'')};}};
|