@lovrabet/rabetbase-cli 2.1.6 → 2.1.7-beta.3
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 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/delete.js +1 -0
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -0
- package/lib/commands/dataset/link-delete.js +1 -0
- package/lib/commands/dataset/link-shared.js +1 -0
- package/lib/commands/dataset/link-update.js +1 -0
- 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/issue/index.js +1 -0
- package/lib/commands/issue/report.js +1 -0
- 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/telemetry/send-platform-issue-collect-log.js +1 -0
- 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 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a19_0x40e612=a19_0x26fd;function a19_0x26fd(_0x1788e7,_0x553d13){_0x1788e7=_0x1788e7-0x109;const _0x36796b=a19_0x3679();let _0x26fd34=_0x36796b[_0x1788e7];return _0x26fd34;}function a19_0x3679(){const _0x42290d=['../../core/api-client.js','1809684GuYGMO','appName','15020690JBIJDI','map','1992040KVcIgz','appCode','app','509466LPllXO','411761hvRZUp','379352coScan','10zGgBwE','remote','25SXHXli','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','35848IQXUPK','read','15HPJknd','platform','cookie'];a19_0x3679=function(){return _0x42290d;};return a19_0x3679();}(function(_0x2a7551,_0xaf6ac3){const _0x1c24db=a19_0x26fd,_0x173223=_0x2a7551();while(!![]){try{const _0xbe4380=-parseInt(_0x1c24db(0x111))/0x1*(-parseInt(_0x1c24db(0x10d))/0x2)+-parseInt(_0x1c24db(0x113))/0x3*(parseInt(_0x1c24db(0x10c))/0x4)+parseInt(_0x1c24db(0x10f))/0x5*(-parseInt(_0x1c24db(0x10a))/0x6)+parseInt(_0x1c24db(0x10b))/0x7+-parseInt(_0x1c24db(0x11b))/0x8+-parseInt(_0x1c24db(0x117))/0x9+parseInt(_0x1c24db(0x119))/0xa;if(_0xbe4380===_0xaf6ac3)break;else _0x173223['push'](_0x173223['shift']());}catch(_0x25aa34){_0x173223['push'](_0x173223['shift']());}}}(a19_0x3679,0x5f88a));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x3ddc7b){const _0x4aaba4=a19_0x26fd,{setActiveCookie:_0xdc8a26}=await import(_0x4aaba4(0x116));_0xdc8a26(_0x3ddc7b[_0x4aaba4(0x115)]);const _0x109967=await listRemoteApps();return{'ok':!![],'data':{'items':_0x109967[_0x4aaba4(0x11a)](_0x3625fd=>({..._0x3625fd['id']!=null?{'id':_0x3625fd['id']}:{},'appCode':_0x3625fd[_0x4aaba4(0x11c)],'appName':_0x3625fd[_0x4aaba4(0x118)],..._0x3625fd['appDesc']!=null?{'appDesc':_0x3625fd['appDesc']}:{}})),'meta':{'source':_0x4aaba4(0x114)}}};}export const appRemoteDefinition={'service':a19_0x40e612(0x109),'command':a19_0x40e612(0x10e),'description':a19_0x40e612(0x110),'risk':a19_0x40e612(0x112),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x455514,_0xfc669d){const _0x406e2a=a20_0x1578,_0x4d5dac=_0x455514();while(!![]){try{const _0x2be596=parseInt(_0x406e2a(0x1b1))/0x1*(parseInt(_0x406e2a(0x1b7))/0x2)+-parseInt(_0x406e2a(0x1b0))/0x3*(-parseInt(_0x406e2a(0x1b5))/0x4)+parseInt(_0x406e2a(0x1ae))/0x5+-parseInt(_0x406e2a(0x1b2))/0x6*(-parseInt(_0x406e2a(0x1b4))/0x7)+parseInt(_0x406e2a(0x1b3))/0x8*(parseInt(_0x406e2a(0x1b6))/0x9)+parseInt(_0x406e2a(0x1ba))/0xa*(-parseInt(_0x406e2a(0x1b8))/0xb)+-parseInt(_0x406e2a(0x1b9))/0xc*(parseInt(_0x406e2a(0x1af))/0xd);if(_0x2be596===_0xfc669d)break;else _0x4d5dac['push'](_0x4d5dac['shift']());}catch(_0x2e7cad){_0x4d5dac['push'](_0x4d5dac['shift']());}}}(a20_0x780a,0xa7a3f));function a20_0x1578(_0xa597a8,_0x25ed62){_0xa597a8=_0xa597a8-0x1ae;const _0x780a5b=a20_0x780a();let _0x157877=_0x780a5b[_0xa597a8];return _0x157877;}import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];function a20_0x780a(){const _0x3986ba=['4CHiYza','801MZPrGT','282738dzySmk','7326ewBYAC','13625076ouNtDC','8920ZAcynu','4973680sUClmf','13Znugey','1256262QZgpRp','1toBxem','54SsrjLc','63216SxsnNQ','122899MOsVuA'];a20_0x780a=function(){return _0x3986ba;};return a20_0x780a();}
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x27d040=a21_0x37f7;(function(_0x5e3c88,_0x39b16b){const _0x374816=a21_0x37f7,_0x254b86=_0x5e3c88();while(!![]){try{const _0x2e1838=parseInt(_0x374816(0x19a))/0x1*(parseInt(_0x374816(0x187))/0x2)+-parseInt(_0x374816(0x186))/0x3*(parseInt(_0x374816(0x178))/0x4)+parseInt(_0x374816(0x18c))/0x5+parseInt(_0x374816(0x189))/0x6+-parseInt(_0x374816(0x184))/0x7+-parseInt(_0x374816(0x182))/0x8+parseInt(_0x374816(0x17b))/0x9;if(_0x2e1838===_0x39b16b)break;else _0x254b86['push'](_0x254b86['shift']());}catch(_0x4ebff4){_0x254b86['push'](_0x254b86['shift']());}}}(a21_0x41b7,0xd983f));function a21_0x41b7(){const _0x109b77=['isCurrent','merged','17689851XUNTZq','projectPath','inherit','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','list','List\x20all\x20configured\x20apps','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','13814568wQJkre','global','9669702WzqxYd','globalPath','9OMfJQQ','3530276ugHkIk','entries','805884MomXRH','appcode','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','2220940ejoueK','boolean','project','projectConfig','bool','apps','\x20config','read','No\x20apps\x20configured','app','.\x20Use\x20`','object','globalConfig','\x20in\x20','1CCGtnJ','push','mergedCli','defaultApp','map','413372RcDgwi'];a21_0x41b7=function(){return _0x109b77;};return a21_0x41b7();}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(_0x351e84,_0x2c2b8b){const _0xb2348c=a21_0x37f7,_0x1b2b3c=[],_0x152e88=_0x351e84['apps']&&typeof _0x351e84[_0xb2348c(0x191)]===_0xb2348c(0x197)?_0x351e84[_0xb2348c(0x191)]:{},_0x164d61=_0x351e84[_0xb2348c(0x19d)]||undefined;for(const [_0x487263,_0x393ffb]of Object[_0xb2348c(0x188)](_0x152e88)){if(!_0x393ffb||typeof _0x393ffb!==_0xb2348c(0x197)||!_0x393ffb[_0xb2348c(0x18a)])continue;_0x1b2b3c[_0xb2348c(0x19b)]({'name':_0x487263,'appcode':_0x393ffb['appcode'],'named':!![],'definedIn':_0x2c2b8b,'isDefault':_0x487263===_0x164d61,...buildAppProfileListFields(_0x393ffb)});}return _0x1b2b3c;}function a21_0x37f7(_0x43cbac,_0x1fdd79){_0x43cbac=_0x43cbac-0x177;const _0x41b701=a21_0x41b7();let _0x37f7f1=_0x41b701[_0x43cbac];return _0x37f7f1;}function buildMergedItems(_0x2c8852,_0x2442f1){const _0x3dd223=a21_0x37f7,{apps:apps={},defaultApp:_0x127330}=_0x2c8852,_0x77afc1=_0x2442f1['globalConfig'][_0x3dd223(0x191)]&&typeof _0x2442f1['globalConfig'][_0x3dd223(0x191)]===_0x3dd223(0x197)?_0x2442f1[_0x3dd223(0x198)]['apps']:{},_0x26a5b4=_0x2442f1[_0x3dd223(0x18f)][_0x3dd223(0x191)]&&typeof _0x2442f1[_0x3dd223(0x18f)]['apps']===_0x3dd223(0x197)?_0x2442f1['projectConfig'][_0x3dd223(0x191)]:{},_0x31b2dc=_0x2442f1[_0x3dd223(0x18f)][_0x3dd223(0x17d)]===![],_0x1cb0dc=Object[_0x3dd223(0x188)](apps),_0x341bb1=_0x1cb0dc[_0x3dd223(0x177)](([_0x33f495,_0x5c4acf])=>({'name':_0x33f495,'appcode':_0x5c4acf[_0x3dd223(0x18a)],'named':!![],'definedIn':appDefinedIn(_0x33f495,_0x77afc1,_0x26a5b4,_0x31b2dc),'isDefault':_0x33f495===_0x127330,...buildAppProfileListFields(_0x5c4acf)}));return _0x341bb1;}async function execute(_0x43b4a1){const _0x311117=a21_0x37f7,_0x819272=_0x43b4a1['bool'](_0x311117(0x183)),_0x176af2=_0x43b4a1[_0x311117(0x190)]('project'),_0x4e4344=_0x819272?_0x311117(0x183):_0x176af2?'project':_0x311117(0x17a),{config:_0x307de9,layers:_0x1ef703}=readRawConfigWithLayers(),_0x5a021=resolveDefaultAppSource(_0x1ef703),{defaultApp:_0xed04db}=_0x307de9;let _0x1a136c,_0x4e87de;switch(_0x4e4344){case'global':_0x1a136c=buildItemsFromLayer(_0x1ef703[_0x311117(0x198)],'global'),_0x4e87de=_0x1ef703[_0x311117(0x185)];break;case'project':_0x1a136c=buildItemsFromLayer(_0x1ef703['projectConfig'],_0x311117(0x18e)),_0x4e87de=_0x1ef703[_0x311117(0x17c)];break;default:_0x1a136c=buildMergedItems(_0x307de9,_0x1ef703);break;}enrichAppListItemsWithMergedSelection(_0x1a136c,_0x43b4a1[_0x311117(0x19c)]);if(_0x1a136c['length']===0x0){const _0x1c9b03=_0x4e4344===_0x311117(0x17a)?'':_0x311117(0x199)+_0x4e4344+_0x311117(0x192);return{'ok':!![],'data':[],'message':_0x311117(0x194)+_0x1c9b03+_0x311117(0x196)+CLI_BIN_NAME+_0x311117(0x181)};}const _0x4ac0fb=_0x1a136c['find'](_0x21905e=>_0x21905e[_0x311117(0x179)]===!![]),_0x673b7b=_0xed04db??_0x4ac0fb?.[_0x311117(0x18a)]??null,_0x3ee51a=_0x4e4344===_0x311117(0x17a)?{'globalPath':_0x1ef703[_0x311117(0x185)]??null,'projectPath':_0x1ef703[_0x311117(0x17c)]??null,'defaultApp':_0x673b7b,'defaultAppSource':_0xed04db!=null?_0x5a021:null}:{'scope':_0x4e4344,'configPath':_0x4e87de??null};return{'ok':!![],'data':{'items':_0x1a136c,'meta':_0x3ee51a}};}export const appListDefinition={'service':a21_0x27d040(0x195),'command':a21_0x27d040(0x17f),'description':a21_0x27d040(0x180),'risk':a21_0x27d040(0x193),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'global','type':'boolean','description':a21_0x27d040(0x17e),'default':![]},{'name':a21_0x27d040(0x18e),'type':a21_0x27d040(0x18d),'description':a21_0x27d040(0x18b),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x3744f8=a22_0x443f;function a22_0x45a1(){const _0x143276=['Remove\x20an\x20app\x20from\x20config','Usage:\x20','high-risk-write','6601914mcsfuO','bool','args','apps','\x22\x20still\x20defined\x20in\x20','keys','global','1989FWnWGX','7798532KiKoJd','globalConfig','boolean','project','projectConfig','\x20Default\x20app\x20changed\x20to\x20\x22','App\x20\x22','validation','2448468jJNOBm','defaultApp','\x20config.','\x20app\x20remove\x20<name>\x20[--global]','3612280BrTnUj','44YIslLG','6cMQTIZ','trim','1104054OwWNQY','2849760famFyZ','remove','\x20Note:\x20app\x20\x22','Missing\x20app\x20name.'];a22_0x45a1=function(){return _0x143276;};return a22_0x45a1();}(function(_0xeb5a78,_0x55ba85){const _0x2a1b96=a22_0x443f,_0x2b4e78=_0xeb5a78();while(!![]){try{const _0x14ee74=-parseInt(_0x2a1b96(0x1ec))/0x1+parseInt(_0x2a1b96(0x1e4))/0x2+-parseInt(_0x2a1b96(0x1fb))/0x3*(-parseInt(_0x2a1b96(0x1e9))/0x4)+parseInt(_0x2a1b96(0x1ed))/0x5+-parseInt(_0x2a1b96(0x1ea))/0x6*(-parseInt(_0x2a1b96(0x1fc))/0x7)+-parseInt(_0x2a1b96(0x1e8))/0x8+-parseInt(_0x2a1b96(0x1f4))/0x9;if(_0x14ee74===_0x55ba85)break;else _0x2b4e78['push'](_0x2b4e78['shift']());}catch(_0x46f399){_0x2b4e78['push'](_0x2b4e78['shift']());}}}(a22_0x45a1,0x98ef4));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_0x443f(_0x2181fe,_0x133b80){_0x2181fe=_0x2181fe-0x1e4;const _0x45a168=a22_0x45a1();let _0x443f74=_0x45a168[_0x2181fe];return _0x443f74;}async function validateArgs(_0x2727d3){const _0x561854=a22_0x443f,_0x5df148=_0x2727d3[_0x561854(0x1f6)][0x0]?.[_0x561854(0x1eb)]();if(!_0x5df148)throw CliErrors[_0x561854(0x203)](_0x561854(0x1f0),'Usage:\x20'+CLI_BIN_NAME+_0x561854(0x1e7));}async function execute(_0xc69ff2){const _0x2869a4=a22_0x443f,_0x362913=_0xc69ff2['args'][0x0]?.[_0x2869a4(0x1eb)]();if(!_0x362913)throw CliErrors[_0x2869a4(0x203)](_0x2869a4(0x1f0),_0x2869a4(0x1f2)+CLI_BIN_NAME+_0x2869a4(0x1e7));const _0x524427=_0xc69ff2[_0x2869a4(0x1f5)](_0x2869a4(0x1fa)),{config:_0x4171dc,layers:_0x151cb2}=readRawConfigWithLayers(),_0x2c2dc1=_0x4171dc[_0x2869a4(0x1f7)]??{};if(!_0x2c2dc1[_0x362913])throw CliErrors[_0x2869a4(0x203)](_0x2869a4(0x202)+_0x362913+'\x22\x20not\x20found.');const _0x77d3c6=_0x151cb2[_0x2869a4(0x1fd)]['apps']&&typeof _0x151cb2['globalConfig']['apps']==='object'?_0x151cb2[_0x2869a4(0x1fd)][_0x2869a4(0x1f7)]:{},_0x5bf61a=_0x151cb2[_0x2869a4(0x200)][_0x2869a4(0x1f7)]&&typeof _0x151cb2[_0x2869a4(0x200)][_0x2869a4(0x1f7)]==='object'?_0x151cb2[_0x2869a4(0x200)][_0x2869a4(0x1f7)]:{},_0x2fa16f=appDefinedIn(_0x362913,_0x77d3c6,_0x5bf61a,_0x151cb2[_0x2869a4(0x200)]['inherit']===![]),_0x161faa=resolveAppScopeForWrite(_0x362913,_0x524427,_0x151cb2),_0x1066c2={'global':_0x161faa==='global'},_0x35e8e4=readConfig(_0x1066c2),_0x4ff02a=_0x35e8e4[_0x2869a4(0x1f7)];if(!_0x4ff02a||!_0x4ff02a[_0x362913])throw CliErrors[_0x2869a4(0x203)]('App\x20\x22'+_0x362913+'\x22\x20not\x20found.');delete _0x4ff02a[_0x362913];let _0x1b6094='';if(_0x35e8e4[_0x2869a4(0x1e5)]===_0x362913){const _0x389245=Object[_0x2869a4(0x1f9)](_0x4ff02a);_0x35e8e4[_0x2869a4(0x1e5)]=_0x389245['length']>0x0?_0x389245[0x0]:undefined,_0x35e8e4[_0x2869a4(0x1e5)]?_0x1b6094=_0x2869a4(0x201)+_0x35e8e4[_0x2869a4(0x1e5)]+'\x22.':delete _0x35e8e4[_0x2869a4(0x1e5)];}Object[_0x2869a4(0x1f9)](_0x4ff02a)['length']===0x0&&(delete _0x35e8e4[_0x2869a4(0x1f7)],delete _0x35e8e4[_0x2869a4(0x1e5)]);writeConfig(_0x35e8e4,_0x1066c2);const _0x29db0f=_0x2fa16f==='both'?_0x2869a4(0x1ef)+_0x362913+_0x2869a4(0x1f8)+(_0x161faa===_0x2869a4(0x1ff)?_0x2869a4(0x1fa):_0x2869a4(0x1ff))+_0x2869a4(0x1e6):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x362913+'\x22'+scopeLabel(_0x1066c2)+'.'+_0x1b6094+_0x29db0f};}export const appRemoveDefinition={'service':'app','command':a22_0x3744f8(0x1ee),'description':a22_0x3744f8(0x1f1),'risk':a22_0x3744f8(0x1f3),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a22_0x3744f8(0x1fa),'type':a22_0x3744f8(0x1fe),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15a0d0,_0x571e14){const _0x460d46=a23_0x25d2,_0x51e8d1=_0x15a0d0();while(!![]){try{const _0x2e2be5=parseInt(_0x460d46(0x1c8))/0x1+-parseInt(_0x460d46(0x1cb))/0x2*(parseInt(_0x460d46(0x1dc))/0x3)+-parseInt(_0x460d46(0x1e3))/0x4+parseInt(_0x460d46(0x1d5))/0x5*(-parseInt(_0x460d46(0x1d7))/0x6)+parseInt(_0x460d46(0x1d3))/0x7*(parseInt(_0x460d46(0x1e0))/0x8)+parseInt(_0x460d46(0x1da))/0x9*(-parseInt(_0x460d46(0x1db))/0xa)+parseInt(_0x460d46(0x1d6))/0xb*(parseInt(_0x460d46(0x1c5))/0xc);if(_0x2e2be5===_0x571e14)break;else _0x51e8d1['push'](_0x51e8d1['shift']());}catch(_0x44dd71){_0x51e8d1['push'](_0x51e8d1['shift']());}}}(a23_0xfabd,0xf36f4));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x154914,_0x67bb24){const _0x42e39b=a23_0x25d2;if(!_0x67bb24)return;const _0x328382=_0x67bb24['apps']&&typeof _0x67bb24[_0x42e39b(0x1dd)]===_0x42e39b(0x1c6)?_0x67bb24[_0x42e39b(0x1dd)]:{},_0x5aed1c=Object['keys'](_0x328382)['length']>0x0;for(const _0x1de224 of _0x154914){_0x1de224[_0x42e39b(0x1cd)]=![];}const _0x426c37=_0x67bb24['appCode']!=null?String(_0x67bb24['appCode'])[_0x42e39b(0x1e4)]():'';if(_0x5aed1c){const _0x1c4a39=_0x67bb24[_0x42e39b(0x1c7)]??_0x67bb24['defaultApp'];if(_0x1c4a39)for(const _0x800689 of _0x154914){_0x800689[_0x42e39b(0x1d2)]===!![]&&_0x800689[_0x42e39b(0x1e2)]===_0x1c4a39&&(_0x800689[_0x42e39b(0x1cd)]=!![]);}for(const _0x287a4c of _0x154914){if(_0x287a4c[_0x42e39b(0x1d2)]!==![])continue;if(_0x67bb24[_0x42e39b(0x1e1)])continue;_0x426c37&&String(_0x287a4c['appcode']??'')[_0x42e39b(0x1e4)]()===_0x426c37&&(_0x287a4c[_0x42e39b(0x1cd)]=!![]);}return;}if(!_0x426c37)return;for(const _0x12ca93 of _0x154914){String(_0x12ca93[_0x42e39b(0x1c9)]??'')[_0x42e39b(0x1e4)]()===_0x426c37&&(_0x12ca93[_0x42e39b(0x1cd)]=!![]);}}export function resolveAppScopeForWrite(_0x30e962,_0x4f2e09,_0x561ffc){const _0x5a0d82=a23_0x25d2;if(_0x4f2e09)return _0x5a0d82(0x1df);const _0x23c4c0=_0x561ffc[_0x5a0d82(0x1d1)][_0x5a0d82(0x1dd)]&&typeof _0x561ffc[_0x5a0d82(0x1d1)]['apps']==='object'?_0x561ffc['projectConfig'][_0x5a0d82(0x1dd)]:{},_0x9c1846=_0x561ffc[_0x5a0d82(0x1d4)][_0x5a0d82(0x1dd)]&&typeof _0x561ffc[_0x5a0d82(0x1d4)][_0x5a0d82(0x1dd)]===_0x5a0d82(0x1c6)?_0x561ffc[_0x5a0d82(0x1d4)][_0x5a0d82(0x1dd)]:{};if(Object['prototype'][_0x5a0d82(0x1d0)]['call'](_0x23c4c0,_0x30e962))return _0x5a0d82(0x1d9);if(Object['prototype'][_0x5a0d82(0x1d0)][_0x5a0d82(0x1d8)](_0x9c1846,_0x30e962))return'global';return'project';}export function appDefinedIn(_0x5c69ca,_0x34b3bb,_0x2a39fe,_0x4b45fb){const _0x266ddb=a23_0x25d2;if(_0x4b45fb)return Object['prototype'][_0x266ddb(0x1d0)]['call'](_0x2a39fe,_0x5c69ca)?_0x266ddb(0x1d9):_0x266ddb(0x1df);const _0x5ade76=Object[_0x266ddb(0x1ce)][_0x266ddb(0x1d0)][_0x266ddb(0x1d8)](_0x34b3bb,_0x5c69ca),_0x1b49b1=Object[_0x266ddb(0x1ce)][_0x266ddb(0x1d0)][_0x266ddb(0x1d8)](_0x2a39fe,_0x5c69ca);if(_0x5ade76&&_0x1b49b1)return _0x266ddb(0x1de);if(_0x1b49b1)return'project';return'global';}function a23_0x25d2(_0x27baff,_0x1e0219){_0x27baff=_0x27baff-0x1c5;const _0xfabdaa=a23_0xfabd();let _0x25d24d=_0xfabdaa[_0x27baff];return _0x25d24d;}function a23_0xfabd(){const _0xfae177=['trim','51243636pmxJsW','object','currentApp','381994yboBKy','appcode','\x20(global)','2PgGEJo','length','isCurrent','prototype','inherit','hasOwnProperty','projectConfig','named','5369BwiVwP','globalConfig','65IwAugV','11ygiXWW','709062MhAbVF','call','project','9knLorZ','10472470UIkBLJ','729903iUOZDf','apps','both','global','5576ARtJIm','defaultApp','name','5451756IXRgwD'];a23_0xfabd=function(){return _0xfae177;};return a23_0xfabd();}export function resolveDefaultAppSource(_0x3eec9b){const _0x56a145=a23_0x25d2,_0xbca765=_0x3eec9b[_0x56a145(0x1d1)]['apps']&&typeof _0x3eec9b[_0x56a145(0x1d1)][_0x56a145(0x1dd)]===_0x56a145(0x1c6)?_0x3eec9b[_0x56a145(0x1d1)]['apps']:{};if('defaultApp'in _0x3eec9b[_0x56a145(0x1d1)])return _0x56a145(0x1d9);if(Object['keys'](_0xbca765)[_0x56a145(0x1cc)]>0x0)return _0x56a145(0x1d9);if(_0x3eec9b[_0x56a145(0x1d1)][_0x56a145(0x1cf)]===![])return null;if(_0x3eec9b[_0x56a145(0x1d4)]['defaultApp'])return'global';return null;}export function getConfigPath(_0x145096={}){const _0x9aa683=a23_0x25d2,_0x5a856b=_0x145096['global']?'global':_0x9aa683(0x1d9);return resolveWriteConfigPath(_0x5a856b);}export function readConfig(_0x1a9177={}){return readConfigFile(getConfigPath(_0x1a9177));}export function writeConfig(_0x467067,_0xac1712={}){writeConfigFile(getConfigPath(_0xac1712),_0x467067);}export function scopeLabel(_0x1c4786){const _0x49f19d=a23_0x25d2;return _0x1c4786[_0x49f19d(0x1df)]?_0x49f19d(0x1ca):'';}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x34e56d=a24_0x42d7;(function(_0x260e01,_0x3024b0){const _0x3043c1=a24_0x42d7,_0xb7ff41=_0x260e01();while(!![]){try{const _0x5bce9c=parseInt(_0x3043c1(0x156))/0x1*(parseInt(_0x3043c1(0x15d))/0x2)+parseInt(_0x3043c1(0x144))/0x3*(parseInt(_0x3043c1(0x14f))/0x4)+parseInt(_0x3043c1(0x159))/0x5+-parseInt(_0x3043c1(0x15c))/0x6+-parseInt(_0x3043c1(0x141))/0x7+parseInt(_0x3043c1(0x158))/0x8+-parseInt(_0x3043c1(0x14d))/0x9;if(_0x5bce9c===_0x3024b0)break;else _0xb7ff41['push'](_0xb7ff41['shift']());}catch(_0x139d57){_0xb7ff41['push'](_0xb7ff41['shift']());}}}(a24_0x4eba,0x58476));function a24_0x4eba(){const _0x179129=['Missing\x20app\x20name.','1642416eEeZTK','257780OOsgfO','name','hasOwnProperty','2024970vgVcES','197546GkVmJQ','length','app','apps','\x22\x20not\x20found.','use','Available:\x20','global','object','prototype','App\x20\x22','appcode','3500378dbMsci','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','Usage:\x20','39vvCySn','\x20--appcode\x20<code>`\x20first.','join','bool','projectPath','args','Switch\x20the\x20default\x20app','projectConfig','Use\x20global\x20config\x20scope','2114820GJZiEy','Use\x20`','179884ulIMbq','\x20app\x20use\x20<name>\x20[--global]','App\x20profile\x20name\x20to\x20activate','validation','write','trim','\x0aNote:\x20\x22','6LHwmBB'];a24_0x4eba=function(){return _0x179129;};return a24_0x4eba();}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(_0x21a80a){const _0x368ca9=a24_0x42d7,_0x6aa27e=_0x21a80a[_0x368ca9(0x149)][0x0]?.[_0x368ca9(0x154)]();if(!_0x6aa27e)throw CliErrors[_0x368ca9(0x152)](_0x368ca9(0x157),_0x368ca9(0x143)+CLI_BIN_NAME+_0x368ca9(0x150));}async function execute(_0x1acc90){const _0x1371ef=a24_0x42d7,_0x32f131=_0x1acc90['args'][0x0]?.[_0x1371ef(0x154)]();if(!_0x32f131)throw CliErrors[_0x1371ef(0x152)](_0x1371ef(0x157),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const _0xc53c9c=_0x1acc90[_0x1371ef(0x147)](_0x1371ef(0x13c)),{config:_0x397420,layers:_0x424516}=readRawConfigWithLayers(),_0x4a803f=_0x397420[_0x1371ef(0x160)]??{};if(!_0x4a803f[_0x32f131]){const _0x56e025=Object['keys'](_0x4a803f),_0x1e8155=_0x56e025[_0x1371ef(0x15e)]===0x0?_0x1371ef(0x14e)+CLI_BIN_NAME+'\x20app\x20add\x20'+_0x32f131+_0x1371ef(0x145):_0x1371ef(0x13b)+_0x56e025[_0x1371ef(0x146)](',\x20');throw CliErrors[_0x1371ef(0x152)](_0x1371ef(0x13f)+_0x32f131+_0x1371ef(0x161),_0x1e8155);}let _0x135c82,_0x2b7502='';if(_0xc53c9c)_0x135c82={'global':!![]};else{const _0xc313fd=isInProject()&&!!_0x424516[_0x1371ef(0x148)];_0x135c82={'global':!_0xc313fd};if(_0xc313fd){const _0x147f92=_0x424516[_0x1371ef(0x14b)][_0x1371ef(0x160)]&&typeof _0x424516[_0x1371ef(0x14b)]['apps']===_0x1371ef(0x13d)?_0x424516[_0x1371ef(0x14b)][_0x1371ef(0x160)]:{};!Object[_0x1371ef(0x13e)][_0x1371ef(0x15b)]['call'](_0x147f92,_0x32f131)&&(_0x2b7502=_0x1371ef(0x155)+_0x32f131+_0x1371ef(0x142));}}const _0x30b370=readConfig(_0x135c82);return _0x30b370['defaultApp']=_0x32f131,writeConfig(_0x30b370,_0x135c82),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x32f131+'\x22\x20(appcode:\x20'+_0x4a803f[_0x32f131][_0x1371ef(0x140)]+')'+scopeLabel(_0x135c82)+_0x2b7502};}function a24_0x42d7(_0x36c228,_0x58a2df){_0x36c228=_0x36c228-0x13b;const _0x4eba9e=a24_0x4eba();let _0x42d7cd=_0x4eba9e[_0x36c228];return _0x42d7cd;}export const appUseDefinition={'service':a24_0x34e56d(0x15f),'command':a24_0x34e56d(0x162),'description':a24_0x34e56d(0x14a),'risk':a24_0x34e56d(0x153),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x34e56d(0x15a),'description':a24_0x34e56d(0x151),'required':!![]}],'flags':[{'name':'global','type':'boolean','description':a24_0x34e56d(0x14c),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x2f7225=a25_0x39f5;(function(_0x3c11bd,_0x369f13){const _0x297751=a25_0x39f5,_0x39f420=_0x3c11bd();while(!![]){try{const _0x3ccebc=-parseInt(_0x297751(0xb4))/0x1*(-parseInt(_0x297751(0xac))/0x2)+-parseInt(_0x297751(0xb6))/0x3+parseInt(_0x297751(0xb5))/0x4*(parseInt(_0x297751(0x9e))/0x5)+-parseInt(_0x297751(0xaf))/0x6*(-parseInt(_0x297751(0xaa))/0x7)+-parseInt(_0x297751(0xa9))/0x8*(parseInt(_0x297751(0x9f))/0x9)+parseInt(_0x297751(0xa6))/0xa*(-parseInt(_0x297751(0xa8))/0xb)+parseInt(_0x297751(0xae))/0xc;if(_0x3ccebc===_0x369f13)break;else _0x39f420['push'](_0x39f420['shift']());}catch(_0x516eb8){_0x39f420['push'](_0x39f420['shift']());}}}(a25_0x1790,0xbbb55));import{unlinkSync,existsSync}from'node:fs';function a25_0x1790(){const _0x5ef079=['yes','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','160JklHUR','login','63547VcnmSp','8LEecQx','7DPHeQY','logout','2dLzaYG','../../auth/auth-server-ui.js','2218608EaeEij','289794ERGSsE','nonInteractive','✓\x20Logged\x20out','Clear\x20login\x20session','log','671373hVUukx','60EpRMOh','3794925FHLiRa','496075ChlVni','2398689gtrcdu','!\x20Not\x20logged\x20in','read','auth','bool'];a25_0x1790=function(){return _0x5ef079;};return a25_0x1790();}import{cookieFile}from'../../auth/constant.js';function a25_0x39f5(_0x5a4dd8,_0xef89fe){_0x5a4dd8=_0x5a4dd8-0x9e;const _0x1790ea=a25_0x1790();let _0x39f5e3=_0x1790ea[_0x5a4dd8];return _0x39f5e3;}export const authDefinitions=[{'service':a25_0x2f7225(0xa2),'command':a25_0x2f7225(0xa7),'description':'Login\x20via\x20browser','risk':a25_0x2f7225(0xa1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a25_0x2f7225(0xa4),'type':'boolean','description':a25_0x2f7225(0xa5),'default':![]}],async 'execute'(_0x241e62){const _0x3f8bdf=a25_0x2f7225,{runAuthServer:_0x35fc48}=await import(_0x3f8bdf(0xad));return await _0x35fc48({'autoYes':_0x241e62[_0x3f8bdf(0xa3)](_0x3f8bdf(0xa4)),'nonInteractive':_0x241e62[_0x3f8bdf(0xb0)]}),{'ok':!![]};}},{'service':'auth','command':a25_0x2f7225(0xab),'description':a25_0x2f7225(0xb2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1cdc65){const _0x509c00=a25_0x2f7225;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x509c00(0xb3)](_0x509c00(0xb1))):console[_0x509c00(0xb3)](_0x509c00(0xa0)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a26_0x3596b9=a26_0x1372;(function(_0x419038,_0x4f0e11){const _0x318e53=a26_0x1372,_0x2b2c22=_0x419038();while(!![]){try{const _0xd1460d=parseInt(_0x318e53(0x1f7))/0x1+-parseInt(_0x318e53(0x1dd))/0x2*(-parseInt(_0x318e53(0x1e4))/0x3)+parseInt(_0x318e53(0x1fd))/0x4+parseInt(_0x318e53(0x218))/0x5+parseInt(_0x318e53(0x1cf))/0x6+parseInt(_0x318e53(0x1d0))/0x7*(parseInt(_0x318e53(0x1f6))/0x8)+parseInt(_0x318e53(0x20e))/0x9*(-parseInt(_0x318e53(0x1e3))/0xa);if(_0xd1460d===_0x4f0e11)break;else _0x2b2c22['push'](_0x2b2c22['shift']());}catch(_0xfeb9a4){_0x2b2c22['push'](_0x2b2c22['shift']());}}}(a26_0x4251,0x5020d));import{createInterface}from'node:readline';function a26_0x4251(){const _0x2037bb=['\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','keys','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','map','utf8','create','Script\x20type','685365KUPRSU','No\x20operation\x20types\x20found\x20for\x20dataset\x20','join','\x22\x20not\x20found\x20for\x20dataset\x20','parseInt','Alias\x20\x22','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','after','Available\x20aliases:\x20','operationType','string','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','nonInteractive','length','entries','scriptsRootDir','Invalid\x20function\x20name\x20\x22','name','2314962xZfqSy','8428lOgLJw','stderr','function-node','write','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','alias','\x0a\x20*\x20[触发节点]\x20','.js','includes','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Select\x20dataset:','Operation\x20type\x20(HOOK\x20only)','find','9182MkkxDB','str','HOOK\x20requires\x20alias/operation/node\x20options.','description','.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*\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','10735810hxZojj','156fLsDyd','HOOK','TODO:\x20add\x20script\x20description','File\x20already\x20exists:\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Invalid\x20dataset\x20selection.','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','before','apiDir','tableName','\x20function:\x20','datasetCode','functionNode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20datasets\x20found\x20for\x20this\x20app.','trim','424hVYDLM','51761AivfvR','bff','Function\x20name\x20(valid\x20JS\x20identifier)','No\x20api.ts\x20found.\x20Run\x20`','\x22.\x20','\x22\x20not\x20found.\x20','2098324vzQFnD','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','question','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20not\x20found\x20for\x20code\x20\x22','COMMON','operation-type','stdin','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','validation','Select\x20operation\x20type:','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','close','appCode','9aJketQ','ENDPOINT'];a26_0x4251=function(){return _0x2037bb;};return a26_0x4251();}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';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a26_0x3596b9(0x1f8),'command':a26_0x3596b9(0x216),'description':a26_0x3596b9(0x21e),'risk':'write','flags':[{'name':a26_0x3596b9(0x211),'type':a26_0x3596b9(0x223),'required':!![],'enum':['COMMON',a26_0x3596b9(0x20f),'HOOK'],'description':a26_0x3596b9(0x217)},{'name':a26_0x3596b9(0x1ce),'type':a26_0x3596b9(0x223),'required':!![],'description':a26_0x3596b9(0x1f9)},{'name':a26_0x3596b9(0x1e0),'type':a26_0x3596b9(0x223),'description':'Script\x20description'},{'name':a26_0x3596b9(0x1d5),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1d9)},{'name':'datasetcode','type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1ff)},{'name':a26_0x3596b9(0x204),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1db)},{'name':a26_0x3596b9(0x1d2),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x201),'enum':[a26_0x3596b9(0x1ec),a26_0x3596b9(0x220)]}],async 'validate'(_0xc2f7e7){const _0xe9e50=a26_0x3596b9,_0x2f8069=_0xc2f7e7['str']('name');if(!isValidBffFunctionName(_0x2f8069))throw CliErrors[_0xe9e50(0x207)](_0xe9e50(0x1cd)+_0x2f8069+_0xe9e50(0x20a));},async 'execute'(_0x30fc16){const _0x4b18e0=a26_0x3596b9,_0x3951ee=loadBffProjectConfig(_0x30fc16[_0x4b18e0(0x20d)]),_0x4105c5=_0x30fc16[_0x4b18e0(0x1de)](_0x4b18e0(0x211)),_0x54a8dc=_0x30fc16[_0x4b18e0(0x1de)]('name'),_0x4ebdfc=_0x30fc16[_0x4b18e0(0x1de)](_0x4b18e0(0x1e0))||undefined,_0x402dcb=_0x4105c5===_0x4b18e0(0x1e5)?await resolveHookOptions(_0x3951ee,_0x30fc16):undefined,_0x1f2609=buildFilePath(_0x3951ee,_0x4105c5,_0x54a8dc,_0x402dcb);if(await fileExists(_0x1f2609))throw CliErrors['validation'](_0x4b18e0(0x1e7)+_0x1f2609);await mkdir(dirname(_0x1f2609),{'recursive':!![]});const _0x2cfbd9=generateTemplate(_0x4105c5,_0x54a8dc,_0x30fc16['appCode'],_0x4ebdfc,_0x402dcb);await writeFile(_0x1f2609,_0x2cfbd9,_0x4b18e0(0x215));const _0x3a79d6={'type':_0x4105c5,'name':_0x54a8dc,'path':_0x1f2609};if(_0x4ebdfc)_0x3a79d6[_0x4b18e0(0x1e0)]=_0x4ebdfc;if(_0x402dcb){if(_0x402dcb[_0x4b18e0(0x1d5)])_0x3a79d6[_0x4b18e0(0x1d5)]=_0x402dcb['alias'];_0x3a79d6[_0x4b18e0(0x1f0)]=_0x402dcb[_0x4b18e0(0x1f0)],_0x3a79d6['operationType']=_0x402dcb[_0x4b18e0(0x222)],_0x3a79d6[_0x4b18e0(0x1f1)]=_0x402dcb['functionNode'];}return{'ok':!![],'data':_0x3a79d6,'message':'Created\x20'+_0x4105c5+_0x4b18e0(0x1ef)+_0x54a8dc};}};async function resolveHookOptions(_0x21c539,_0x33f56d){const _0x2d71ff=a26_0x3596b9,_0x38f1de=loadAliasMap(_0x33f56d[_0x2d71ff(0x1ed)],undefined,resolveApiFilePath(_0x33f56d['apiDir'],_0x33f56d[_0x2d71ff(0x20d)])),_0x16b417=_0x38f1de[_0x2d71ff(0x226)]>0x0;let _0x57670b,_0x337ce0,_0x353e0d;const _0x992fcc=_0x33f56d['str'](_0x2d71ff(0x1d5)),_0x1c4f66=_0x33f56d['str']('datasetcode');if(_0x992fcc){const _0x39d3aa=resolveAlias(_0x33f56d[_0x2d71ff(0x1ed)],_0x992fcc,undefined,resolveApiFilePath(_0x33f56d[_0x2d71ff(0x1ed)],_0x33f56d[_0x2d71ff(0x20d)]));if(!_0x39d3aa){const _0x5adf96=_0x16b417?_0x2d71ff(0x221)+_0x38f1de[_0x2d71ff(0x214)](_0x5b0446=>_0x5b0446[_0x2d71ff(0x1d5)])[_0x2d71ff(0x21a)](',\x20'):_0x2d71ff(0x1fa)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0x2d71ff(0x21d)+_0x992fcc+_0x2d71ff(0x1fc)+_0x5adf96);}_0x57670b=_0x992fcc,_0x337ce0=_0x39d3aa;}else{if(_0x1c4f66){_0x337ce0=_0x1c4f66;const _0x171e24=_0x38f1de[_0x2d71ff(0x1dc)](_0x3eec74=>_0x3eec74['datasetCode']===_0x1c4f66);_0x57670b=_0x171e24?.[_0x2d71ff(0x1d5)];}else{if(_0x33f56d[_0x2d71ff(0x225)])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f2));else{if(_0x16b417){const _0xfcd7f1=_0x38f1de[_0x2d71ff(0x214)](_0x1aabce=>_0x1aabce['alias']+'\x20('+_0x1aabce[_0x2d71ff(0x1ee)]+')'),_0x250dc2=await promptSelect(_0x2d71ff(0x1da),_0xfcd7f1),_0x21b53f=_0x38f1de[_0x250dc2];if(!_0x21b53f)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1e9));_0x57670b=_0x21b53f[_0x2d71ff(0x1d5)],_0x337ce0=_0x21b53f[_0x2d71ff(0x1f0)];}else{const _0x5c13d8=await listDatasets(_0x33f56d[_0x2d71ff(0x20d)]);if(_0x5c13d8[_0x2d71ff(0x226)]===0x0)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f4));const _0x12691c=_0x5c13d8[_0x2d71ff(0x214)](_0xc9c576=>_0xc9c576['name']+'\x20('+_0xc9c576[_0x2d71ff(0x20b)]+')'),_0x13325b=await promptSelect(_0x2d71ff(0x1da),_0x12691c),_0x596e1c=_0x5c13d8[_0x13325b];if(!_0x596e1c)throw CliErrors[_0x2d71ff(0x207)]('Invalid\x20dataset\x20selection.');_0x337ce0=_0x596e1c[_0x2d71ff(0x20b)],_0x57670b=undefined;}}}}const _0x471909=await listDatasets(_0x33f56d[_0x2d71ff(0x20d)]),_0x4718c1=_0x471909['find'](_0x26aba1=>_0x26aba1[_0x2d71ff(0x20b)]===_0x337ce0);if(!_0x4718c1)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x202)+_0x337ce0+_0x2d71ff(0x1fb)+(_0x57670b?_0x2d71ff(0x1fe)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x353e0d=_0x4718c1['id'];const _0x27d591=_0x57670b??_0x337ce0,_0x1f9990=await listBffDatasetOperations(_0x33f56d['appCode'],_0x353e0d),_0x152bf5=_0x1f9990?Object[_0x2d71ff(0x212)](_0x1f9990):[];if(_0x152bf5[_0x2d71ff(0x226)]===0x0)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x219)+_0x27d591+'.');let _0x18a4b3;const _0x53e9b0=_0x33f56d[_0x2d71ff(0x1de)](_0x2d71ff(0x204));if(_0x53e9b0){if(!_0x152bf5[_0x2d71ff(0x1d8)](_0x53e9b0))throw CliErrors[_0x2d71ff(0x207)]('Operation\x20type\x20\x22'+_0x53e9b0+_0x2d71ff(0x21b)+_0x27d591+'.\x20'+('Available:\x20'+_0x152bf5[_0x2d71ff(0x21a)](',\x20')));_0x18a4b3=_0x53e9b0;}else{if(_0x33f56d['nonInteractive'])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f3));const _0x433d15=await promptSelect(_0x2d71ff(0x208),_0x152bf5);_0x18a4b3=_0x152bf5[_0x433d15]??_0x152bf5[0x0];}let _0x95c4ba=normalizeHookFunctionNode(_0x33f56d['str'](_0x2d71ff(0x1d2)));if(!_0x95c4ba){if(_0x33f56d[_0x2d71ff(0x1de)](_0x2d71ff(0x1d2)))throw CliErrors['validation'](_0x2d71ff(0x224));if(_0x33f56d[_0x2d71ff(0x225)])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1e8));const _0x236ec5=await promptSelect('Select\x20trigger\x20node:',[_0x2d71ff(0x1ec),_0x2d71ff(0x220)]);_0x95c4ba=['before',_0x2d71ff(0x220)][_0x236ec5]??'before';}return{'alias':_0x57670b,'datasetCode':_0x337ce0,'datasetId':_0x353e0d,'operationType':_0x18a4b3,'functionNode':_0x95c4ba};}async function promptSelect(_0x17ce9a,_0x21cd3d){const _0x568bf3=a26_0x3596b9;if(_0x21cd3d[_0x568bf3(0x226)]===0x1)return 0x0;for(const [_0x5efcc3,_0x52db1c]of _0x21cd3d[_0x568bf3(0x1cb)]()){process[_0x568bf3(0x1d1)][_0x568bf3(0x1d3)]('\x20\x20'+(_0x5efcc3+0x1)+'.\x20'+_0x52db1c+'\x0a');}const _0x1f1646=createInterface({'input':process[_0x568bf3(0x205)],'output':process[_0x568bf3(0x1d1)]});while(!![]){const _0x19ce18=await new Promise(_0x12568a=>{const _0x2c5306=_0x568bf3;_0x1f1646[_0x2c5306(0x200)](_0x17ce9a+'\x20',_0x12568a);}),_0x3bf1e8=Number[_0x568bf3(0x21c)](_0x19ce18[_0x568bf3(0x1f5)](),0xa);if(Number['isInteger'](_0x3bf1e8)&&_0x3bf1e8>=0x1&&_0x3bf1e8<=_0x21cd3d[_0x568bf3(0x226)])return _0x1f1646[_0x568bf3(0x20c)](),_0x3bf1e8-0x1;process[_0x568bf3(0x1d1)][_0x568bf3(0x1d3)](_0x568bf3(0x1eb)+_0x21cd3d[_0x568bf3(0x226)]+'.\x0a');}}function a26_0x1372(_0x162ec3,_0x588454){_0x162ec3=_0x162ec3-0x1cb;const _0x4251fd=a26_0x4251();let _0x137219=_0x4251fd[_0x162ec3];return _0x137219;}function buildFilePath(_0x25810f,_0x31c9e3,_0x59b84b,_0x20447c){const _0x2dd549=a26_0x3596b9;if(_0x31c9e3===_0x2dd549(0x1e5)){if(!_0x20447c)throw CliErrors['validation'](_0x2dd549(0x1df));const _0x1aed5c=_0x20447c[_0x2dd549(0x1d5)]??_0x20447c[_0x2dd549(0x1f0)];return join(_0x25810f['scriptsRootDir'],_0x2dd549(0x1e5),_0x1aed5c,_0x20447c['operationType'],_0x20447c[_0x2dd549(0x1f1)],_0x59b84b+_0x2dd549(0x1d7));}return join(_0x25810f[_0x2dd549(0x1cc)],_0x31c9e3,_0x59b84b+_0x2dd549(0x1d7));}export function generateTemplate(_0x48075d,_0x57d6c7,_0x20b1ee,_0xf6d35e,_0x4e4223){const _0x24c7e0=a26_0x3596b9,_0x420d32=_0xf6d35e?.[_0x24c7e0(0x1f5)]()||_0x24c7e0(0x1e6);if(_0x48075d===_0x24c7e0(0x203))return _0x24c7e0(0x1d4)+_0x420d32+'\x0a\x20*\x20[脚本名称]\x20'+_0x57d6c7+_0x24c7e0(0x206)+_0x57d6c7+_0x24c7e0(0x1e1)+_0x57d6c7+_0x24c7e0(0x213);if(_0x48075d===_0x24c7e0(0x20f))return _0x24c7e0(0x1ea)+_0x420d32+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x20b1ee+'/'+_0x57d6c7+_0x24c7e0(0x210)+_0x57d6c7+_0x24c7e0(0x213);if(!_0x4e4223)throw CliErrors[_0x24c7e0(0x207)](_0x24c7e0(0x209));return _0x24c7e0(0x21f)+_0x420d32+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x20b1ee+'/'+_0x4e4223[_0x24c7e0(0x1f0)]+'/'+_0x4e4223[_0x24c7e0(0x222)]+_0x24c7e0(0x1d6)+_0x4e4223['functionNode']+_0x24c7e0(0x1e2)+_0x57d6c7+_0x24c7e0(0x213);}
|
|
1
|
+
const a26_0x5e7ae8=a26_0x422c;(function(_0xb3faad,_0x2e0c76){const _0x2d0652=a26_0x422c,_0x41b9cc=_0xb3faad();while(!![]){try{const _0x230e02=-parseInt(_0x2d0652(0x120))/0x1+-parseInt(_0x2d0652(0x124))/0x2+parseInt(_0x2d0652(0x125))/0x3+-parseInt(_0x2d0652(0x119))/0x4+parseInt(_0x2d0652(0x134))/0x5+-parseInt(_0x2d0652(0x135))/0x6*(parseInt(_0x2d0652(0x157))/0x7)+parseInt(_0x2d0652(0x104))/0x8*(parseInt(_0x2d0652(0x14a))/0x9);if(_0x230e02===_0x2e0c76)break;else _0x41b9cc['push'](_0x41b9cc['shift']());}catch(_0x1c7f5d){_0x41b9cc['push'](_0x41b9cc['shift']());}}}(a26_0x8f5c,0xbd605));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';function a26_0x8f5c(){const _0x3860b1=['function-node','type','\x22\x20not\x20found\x20for\x20dataset\x20','apiDir','close','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','\x22\x20not\x20found.\x20','map','operationType','\x20function:\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','create','nonInteractive','functionNode','utf8','1258752qtqkem','parseInt','length','No\x20datasets\x20found\x20for\x20this\x20app.','Alias\x20\x22','Select\x20trigger\x20node:','\x0a\x20*\x20[触发节点]\x20','543879oCxIxO','Select\x20dataset:','before','name','1283772duKAkJ','3721146JuSuHp','.js','Invalid\x20function\x20name\x20\x22','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Available\x20aliases:\x20','Trigger\x20node\x20(HOOK\x20only)','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','write','Function\x20name\x20(valid\x20JS\x20identifier)','File\x20already\x20exists:\x20','COMMON','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','after','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','6006270bfmQTs','6PzbIRn','entries','Invalid\x20dataset\x20selection.','question','description','alias','No\x20api.ts\x20found.\x20Run\x20`','join','appCode','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','tableName','bff','.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','trim','operation-type','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','datasetCode','datasetcode','\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','find','22203qoAXfm','str','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','includes','stderr','HOOK','Script\x20description','Operation\x20type\x20\x22','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','validation','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','scriptsRootDir','\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','2004667ihxIbX','code','ENDPOINT','isInteger','string','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','392agZzDj','TODO:\x20add\x20script\x20description','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'];a26_0x8f5c=function(){return _0x3860b1;};return a26_0x8f5c();}import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a26_0x422c(_0x20e98d,_0xabb186){_0x20e98d=_0x20e98d-0x100;const _0x8f5c3=a26_0x8f5c();let _0x422cfa=_0x8f5c3[_0x20e98d];return _0x422cfa;}export const bffCreate={'service':a26_0x5e7ae8(0x141),'command':a26_0x5e7ae8(0x115),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a26_0x5e7ae8(0x12c),'flags':[{'name':a26_0x5e7ae8(0x108),'type':a26_0x5e7ae8(0x102),'required':!![],'enum':['COMMON','ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a26_0x5e7ae8(0x123),'type':a26_0x5e7ae8(0x102),'required':!![],'description':a26_0x5e7ae8(0x12d)},{'name':a26_0x5e7ae8(0x139),'type':'string','description':a26_0x5e7ae8(0x150)},{'name':a26_0x5e7ae8(0x13a),'type':'string','description':a26_0x5e7ae8(0x128)},{'name':a26_0x5e7ae8(0x147),'type':'string','description':a26_0x5e7ae8(0x112)},{'name':a26_0x5e7ae8(0x144),'type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a26_0x5e7ae8(0x107),'type':a26_0x5e7ae8(0x102),'description':a26_0x5e7ae8(0x12a),'enum':[a26_0x5e7ae8(0x122),a26_0x5e7ae8(0x131)]}],async 'validate'(_0x593c2d){const _0x430461=a26_0x5e7ae8,_0x4607d4=_0x593c2d[_0x430461(0x14b)](_0x430461(0x123));if(!isValidBffFunctionName(_0x4607d4))throw CliErrors[_0x430461(0x153)](_0x430461(0x127)+_0x4607d4+_0x430461(0x152));},async 'execute'(_0x3c90d2){const _0xb220d7=a26_0x5e7ae8,_0x33643e=loadBffProjectConfig(_0x3c90d2['appCode']),_0x2ab014=_0x3c90d2[_0xb220d7(0x14b)](_0xb220d7(0x108)),_0x1a11d9=_0x3c90d2[_0xb220d7(0x14b)]('name'),_0x2199ea=_0x3c90d2[_0xb220d7(0x14b)](_0xb220d7(0x139))||undefined,_0x1cc8c9=_0x2ab014===_0xb220d7(0x14f)?await resolveHookOptions(_0x33643e,_0x3c90d2):undefined,_0xd238a5=buildFilePath(_0x33643e,_0x2ab014,_0x1a11d9,_0x1cc8c9);if(await fileExists(_0xd238a5))throw CliErrors[_0xb220d7(0x153)](_0xb220d7(0x12e)+_0xd238a5);await mkdir(dirname(_0xd238a5),{'recursive':!![]});const _0x2b498a=generateTemplate(_0x2ab014,_0x1a11d9,_0x3c90d2[_0xb220d7(0x13d)],_0x2199ea,_0x1cc8c9);await writeFile(_0xd238a5,_0x2b498a,_0xb220d7(0x118));const _0x323397={'type':_0x2ab014,'name':_0x1a11d9,'path':_0xd238a5};if(_0x2199ea)_0x323397[_0xb220d7(0x139)]=_0x2199ea;if(_0x1cc8c9){if(_0x1cc8c9[_0xb220d7(0x13a)])_0x323397[_0xb220d7(0x13a)]=_0x1cc8c9[_0xb220d7(0x13a)];_0x323397['datasetCode']=_0x1cc8c9[_0xb220d7(0x146)],_0x323397[_0xb220d7(0x10f)]=_0x1cc8c9[_0xb220d7(0x10f)],_0x323397[_0xb220d7(0x117)]=_0x1cc8c9[_0xb220d7(0x117)];}return{'ok':!![],'data':_0x323397,'message':'Created\x20'+_0x2ab014+_0xb220d7(0x110)+_0x1a11d9};}};async function resolveHookOptions(_0xf7d349,_0x2e125e){const _0x325e60=a26_0x5e7ae8,_0xb19fcf=loadAliasMap(_0x2e125e[_0x325e60(0x10a)],undefined,resolveApiFilePath(_0x2e125e['apiDir'],_0x2e125e[_0x325e60(0x13d)])),_0x2b95c7=_0xb19fcf['length']>0x0;let _0x15bc96,_0x59fbf2,_0x41babb;const _0x3137d5=_0x2e125e[_0x325e60(0x14b)](_0x325e60(0x13a)),_0x13714f=_0x2e125e['str']('datasetcode');if(_0x3137d5){const _0x23df1d=resolveAlias(_0x2e125e[_0x325e60(0x10a)],_0x3137d5,undefined,resolveApiFilePath(_0x2e125e[_0x325e60(0x10a)],_0x2e125e[_0x325e60(0x13d)]));if(!_0x23df1d){const _0x135e87=_0x2b95c7?_0x325e60(0x129)+_0xb19fcf[_0x325e60(0x10e)](_0x1e3e79=>_0x1e3e79[_0x325e60(0x13a)])[_0x325e60(0x13c)](',\x20'):_0x325e60(0x13b)+CLI_BIN_NAME+_0x325e60(0x130);throw CliErrors[_0x325e60(0x153)](_0x325e60(0x11d)+_0x3137d5+_0x325e60(0x10d)+_0x135e87);}_0x15bc96=_0x3137d5,_0x59fbf2=_0x23df1d;}else{if(_0x13714f){_0x59fbf2=_0x13714f;const _0x5e165f=_0xb19fcf[_0x325e60(0x149)](_0x439c87=>_0x439c87[_0x325e60(0x146)]===_0x13714f);_0x15bc96=_0x5e165f?.[_0x325e60(0x13a)];}else{if(_0x2e125e[_0x325e60(0x116)])throw CliErrors[_0x325e60(0x153)](_0x325e60(0x113));else{if(_0x2b95c7){const _0x148fd2=_0xb19fcf[_0x325e60(0x10e)](_0xab0c01=>_0xab0c01[_0x325e60(0x13a)]+'\x20('+_0xab0c01[_0x325e60(0x140)]+')'),_0x3f6e37=await promptSelect(_0x325e60(0x121),_0x148fd2),_0xf2973e=_0xb19fcf[_0x3f6e37];if(!_0xf2973e)throw CliErrors[_0x325e60(0x153)](_0x325e60(0x137));_0x15bc96=_0xf2973e[_0x325e60(0x13a)],_0x59fbf2=_0xf2973e['datasetCode'];}else{const _0x13765c=await listDatasets(_0x2e125e['appCode']);if(_0x13765c[_0x325e60(0x11b)]===0x0)throw CliErrors['validation'](_0x325e60(0x11c));const _0xabeefd=_0x13765c[_0x325e60(0x10e)](_0x551ed5=>_0x551ed5[_0x325e60(0x123)]+'\x20('+_0x551ed5[_0x325e60(0x158)]+')'),_0x3ac68a=await promptSelect(_0x325e60(0x121),_0xabeefd),_0x202ed0=_0x13765c[_0x3ac68a];if(!_0x202ed0)throw CliErrors[_0x325e60(0x153)]('Invalid\x20dataset\x20selection.');_0x59fbf2=_0x202ed0['code'],_0x15bc96=undefined;}}}}const _0x236db6=await listDatasets(_0x2e125e[_0x325e60(0x13d)]),_0x3ccab1=_0x236db6[_0x325e60(0x149)](_0x1166d6=>_0x1166d6[_0x325e60(0x158)]===_0x59fbf2);if(!_0x3ccab1)throw CliErrors[_0x325e60(0x153)](_0x325e60(0x111)+_0x59fbf2+'\x22.\x20'+(_0x15bc96?_0x325e60(0x13e)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x41babb=_0x3ccab1['id'];const _0x103876=_0x15bc96??_0x59fbf2,_0x12a1df=await listBffDatasetOperations(_0x2e125e[_0x325e60(0x13d)],_0x41babb),_0x3b3641=_0x12a1df?Object['keys'](_0x12a1df):[];if(_0x3b3641['length']===0x0)throw CliErrors[_0x325e60(0x153)](_0x325e60(0x114)+_0x103876+'.');let _0x230643;const _0x5589c2=_0x2e125e[_0x325e60(0x14b)](_0x325e60(0x144));if(_0x5589c2){if(!_0x3b3641[_0x325e60(0x14d)](_0x5589c2))throw CliErrors[_0x325e60(0x153)](_0x325e60(0x151)+_0x5589c2+_0x325e60(0x109)+_0x103876+'.\x20'+('Available:\x20'+_0x3b3641[_0x325e60(0x13c)](',\x20')));_0x230643=_0x5589c2;}else{if(_0x2e125e[_0x325e60(0x116)])throw CliErrors[_0x325e60(0x153)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x3bd4b1=await promptSelect('Select\x20operation\x20type:',_0x3b3641);_0x230643=_0x3b3641[_0x3bd4b1]??_0x3b3641[0x0];}let _0x4776c4=normalizeHookFunctionNode(_0x2e125e['str']('function-node'));if(!_0x4776c4){if(_0x2e125e[_0x325e60(0x14b)](_0x325e60(0x107)))throw CliErrors[_0x325e60(0x153)](_0x325e60(0x132));if(_0x2e125e[_0x325e60(0x116)])throw CliErrors[_0x325e60(0x153)](_0x325e60(0x133));const _0x10eba8=await promptSelect(_0x325e60(0x11e),[_0x325e60(0x122),_0x325e60(0x131)]);_0x4776c4=[_0x325e60(0x122),'after'][_0x10eba8]??'before';}return{'alias':_0x15bc96,'datasetCode':_0x59fbf2,'datasetId':_0x41babb,'operationType':_0x230643,'functionNode':_0x4776c4};}async function promptSelect(_0x364311,_0x3ed81b){const _0x487328=a26_0x5e7ae8;if(_0x3ed81b[_0x487328(0x11b)]===0x1)return 0x0;for(const [_0x4c4594,_0x443b1e]of _0x3ed81b[_0x487328(0x136)]()){process[_0x487328(0x14e)][_0x487328(0x12c)]('\x20\x20'+(_0x4c4594+0x1)+'.\x20'+_0x443b1e+'\x0a');}const _0x4eaa3b=createInterface({'input':process['stdin'],'output':process[_0x487328(0x14e)]});while(!![]){const _0x5f5a5f=await new Promise(_0x5f1110=>{const _0x45bd3f=_0x487328;_0x4eaa3b[_0x45bd3f(0x138)](_0x364311+'\x20',_0x5f1110);}),_0x52874e=Number[_0x487328(0x11a)](_0x5f5a5f[_0x487328(0x143)](),0xa);if(Number[_0x487328(0x101)](_0x52874e)&&_0x52874e>=0x1&&_0x52874e<=_0x3ed81b[_0x487328(0x11b)])return _0x4eaa3b[_0x487328(0x10b)](),_0x52874e-0x1;process[_0x487328(0x14e)][_0x487328(0x12c)](_0x487328(0x10c)+_0x3ed81b[_0x487328(0x11b)]+'.\x0a');}}function buildFilePath(_0x394d3b,_0x165334,_0x23dec5,_0x5e3d25){const _0x171f2e=a26_0x5e7ae8;if(_0x165334===_0x171f2e(0x14f)){if(!_0x5e3d25)throw CliErrors[_0x171f2e(0x153)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x420e45=_0x5e3d25['alias']??_0x5e3d25['datasetCode'];return join(_0x394d3b[_0x171f2e(0x155)],_0x171f2e(0x14f),_0x420e45,_0x5e3d25['operationType'],_0x5e3d25[_0x171f2e(0x117)],_0x23dec5+_0x171f2e(0x126));}return join(_0x394d3b[_0x171f2e(0x155)],_0x165334,_0x23dec5+_0x171f2e(0x126));}export function generateTemplate(_0x398efb,_0x58a2a4,_0x6581fe,_0x261f05,_0x54507f){const _0x56d1d9=a26_0x5e7ae8,_0x4b2df8=_0x261f05?.[_0x56d1d9(0x143)]()||_0x56d1d9(0x105);if(_0x398efb===_0x56d1d9(0x12f))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x4b2df8+'\x0a\x20*\x20[脚本名称]\x20'+_0x58a2a4+_0x56d1d9(0x154)+_0x58a2a4+_0x56d1d9(0x142)+_0x58a2a4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x398efb===_0x56d1d9(0x100))return _0x56d1d9(0x12b)+_0x4b2df8+_0x56d1d9(0x14c)+_0x6581fe+'/'+_0x58a2a4+_0x56d1d9(0x156)+_0x58a2a4+_0x56d1d9(0x13f);if(!_0x54507f)throw CliErrors['validation'](_0x56d1d9(0x103));return _0x56d1d9(0x106)+_0x4b2df8+_0x56d1d9(0x145)+_0x6581fe+'/'+_0x54507f[_0x56d1d9(0x146)]+'/'+_0x54507f['operationType']+_0x56d1d9(0x11f)+_0x54507f[_0x56d1d9(0x117)]+_0x56d1d9(0x148)+_0x58a2a4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x2e77a9=a27_0x6d44;(function(_0x449f6e,_0x5e4074){const _0x5e380c=a27_0x6d44,_0x5dcdbf=_0x449f6e();while(!![]){try{const _0x578348=parseInt(_0x5e380c(0x91))/0x1+parseInt(_0x5e380c(0x7a))/0x2*(-parseInt(_0x5e380c(0x88))/0x3)+parseInt(_0x5e380c(0x78))/0x4*(parseInt(_0x5e380c(0x74))/0x5)+-parseInt(_0x5e380c(0x6f))/0x6+-parseInt(_0x5e380c(0x93))/0x7*(-parseInt(_0x5e380c(0x77))/0x8)+-parseInt(_0x5e380c(0x73))/0x9*(-parseInt(_0x5e380c(0x7b))/0xa)+-parseInt(_0x5e380c(0x83))/0xb*(-parseInt(_0x5e380c(0x82))/0xc);if(_0x578348===_0x5e4074)break;else _0x5dcdbf['push'](_0x5dcdbf['shift']());}catch(_0x125ea3){_0x5dcdbf['push'](_0x5dcdbf['shift']());}}}(a27_0x3319,0x4c626));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';function a27_0x6d44(_0x38e91b,_0x2c28d8){_0x38e91b=_0x38e91b-0x67;const _0x3319e5=a27_0x3319();let _0x6d4447=_0x3319e5[_0x38e91b];return _0x6d4447;}import{CliErrors}from'../../errors.js';export const bffDelete={'service':a27_0x2e77a9(0x71),'command':a27_0x2e77a9(0x7d),'description':a27_0x2e77a9(0x96),'risk':a27_0x2e77a9(0x76),'flags':[{'name':a27_0x2e77a9(0x75),'type':a27_0x2e77a9(0x94),'required':!![],'description':a27_0x2e77a9(0x95)}],async 'validate'(_0x185bff){const _0x200fe5=a27_0x2e77a9,_0x260db1=loadBffProjectConfig(_0x185bff[_0x200fe5(0x87)]),_0x261238=await readBffLockFile(_0x260db1[_0x200fe5(0x97)]);if(!_0x261238)throw CliErrors[_0x200fe5(0x90)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0xfa70c6){const _0xdda66c=a27_0x2e77a9,_0x189567=loadBffProjectConfig(_0xfa70c6[_0xdda66c(0x87)]),_0x522493=await readBffLockFile(_0x189567['lockFilePath']);if(!_0x522493)throw CliErrors[_0xdda66c(0x90)](_0xdda66c(0x72));const {appLock:_0x51a1ef}=ensureLockScope(_0x522493,_0xfa70c6[_0xdda66c(0x87)],_0x189567[_0xdda66c(0x80)],_0xdda66c(0x7d)),_0x34cab4=_0xfa70c6['str'](_0xdda66c(0x75)),_0x33f19b=Object[_0xdda66c(0x8a)](_0x51a1ef[_0xdda66c(0x81)]),_0x255a23=resolveDeleteTarget(_0x34cab4,_0x33f19b),_0x29bbaa=_0x51a1ef[_0xdda66c(0x81)][_0x255a23];if(!_0x29bbaa)throw CliErrors[_0xdda66c(0x90)](_0xdda66c(0x84)+_0x255a23+'\x22.');const _0x1f0d7d=resolveLocalFilePathFromLockKey(_0x189567,_0x255a23),_0x286bec=relative(_0x189567[_0xdda66c(0x68)],_0x1f0d7d),_0x1f55be=join(_0x189567[_0xdda66c(0x70)],_0xdda66c(0x8b),_0x286bec);return{'method':_0xdda66c(0x98),'url':_0xdda66c(0x89),'body':{'appCode':_0xfa70c6[_0xdda66c(0x87)],'target':_0x255a23,'remoteId':_0x29bbaa[_0xdda66c(0x6c)],'localFilePath':_0x1f0d7d,'trashedPath':_0x1f55be},'description':_0xdda66c(0x6b)+_0x255a23+_0xdda66c(0x6d)};},async 'execute'(_0xf10cf){const _0x517511=a27_0x2e77a9,_0x39f63d=loadBffProjectConfig(_0xf10cf[_0x517511(0x87)]),_0x311d8b=await readBffLockFile(_0x39f63d['lockFilePath']);if(!_0x311d8b)throw CliErrors[_0x517511(0x90)](_0x517511(0x72));const {lockData:_0x468e07,appLock:_0x185225}=ensureLockScope(_0x311d8b,_0xf10cf['appCode'],_0x39f63d[_0x517511(0x80)],'delete'),_0x15bd52=_0xf10cf[_0x517511(0x7e)](_0x517511(0x75)),_0x31ae6a=Object[_0x517511(0x8a)](_0x185225[_0x517511(0x81)]),_0xf13f13=resolveDeleteTarget(_0x15bd52,_0x31ae6a),_0x548503=_0x185225[_0x517511(0x81)][_0xf13f13];if(!_0x548503)throw CliErrors[_0x517511(0x90)](_0x517511(0x84)+_0xf13f13+'\x22.');await deleteBffScript(_0x548503[_0x517511(0x6c)]),delete _0x185225[_0x517511(0x81)][_0xf13f13],_0x185225['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x39f63d[_0x517511(0x97)],_0x468e07);const _0x1a495f=resolveLocalFilePathFromLockKey(_0x39f63d,_0xf13f13);let _0x2d7cc1;await fileExists(_0x1a495f)&&(_0x2d7cc1=await moveToTrash(_0x39f63d[_0x517511(0x68)],_0x39f63d['trashDir'],_0x1a495f),await cleanupEmptyDirectories(dirname(_0x1a495f),_0x39f63d[_0x517511(0x92)]));const _0x10f36f={'deleted':_0xf13f13,'remoteId':_0x548503[_0x517511(0x6c)]};if(_0x2d7cc1)_0x10f36f[_0x517511(0x6a)]=_0x2d7cc1;return{'ok':!![],'data':_0x10f36f,'message':_0x517511(0x8e)+_0xf13f13+(_0x2d7cc1?_0x517511(0x86):'')};}};function a27_0x3319(){const _0xa9636b=['functions','16404tItDFK','11fqkVDI','No\x20lock\x20entry\x20found\x20for\x20\x22','Function\x20not\x20found:\x20','\x20(local\x20file\x20moved\x20to\x20trash)','appCode','969087JjpYBB','/api/management/library/scripts/delete','keys','<timestamp>','length','find','Deleted\x20','Multiple\x20functions\x20match\x20\x22','validation','104182klBaev','scriptsRootDir','7fNxhTQ','string','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','lockFilePath','POST','toISOString','projectRoot','includes','trashedTo','Would\x20delete\x20','remoteId','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','join','2169132qNODDu','trashDir','bff','BFF\x20lock\x20file\x20not\x20found.','36nshnHd','28115aSLjWe','target','high-risk-write','4524712CQFlYV','4OaOpOD','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','2mDkQrS','801650ZQumnj','replace','delete','str','map','scriptsRoot'];a27_0x3319=function(){return _0xa9636b;};return a27_0x3319();}function resolveDeleteTarget(_0xc42279,_0x3cbe77){const _0x35c861=a27_0x2e77a9;if(_0xc42279[_0x35c861(0x69)]('/')){const _0x18bbc7=_0x3cbe77[_0x35c861(0x8d)](_0x3583b6=>_0x3583b6===_0xc42279);if(!_0x18bbc7)throw CliErrors['validation'](_0x35c861(0x85)+_0xc42279);return _0x18bbc7;}const _0x397c6d=_0x3cbe77['filter'](_0x3a5678=>_0x3a5678['split']('/')['at'](-0x1)===_0xc42279);if(_0x397c6d[_0x35c861(0x8c)]===0x0)throw CliErrors[_0x35c861(0x90)]('Function\x20not\x20found:\x20'+_0xc42279);if(_0x397c6d[_0x35c861(0x8c)]>0x1)throw CliErrors['validation'](_0x35c861(0x8f)+_0xc42279+_0x35c861(0x79)+_0x397c6d[_0x35c861(0x7f)](_0x575dfc=>'\x20\x20-\x20'+_0x575dfc)[_0x35c861(0x6e)]('\x0a'));return _0x397c6d[0x0];}async function moveToTrash(_0xc06505,_0x50241f,_0x25fd02){const _0x1d28d8=a27_0x2e77a9,_0x3d3292=new Date()[_0x1d28d8(0x67)]()[_0x1d28d8(0x7c)](/[:.]/g,'-'),_0x2e1dff=relative(_0xc06505,_0x25fd02),_0x5aaa40=join(_0x50241f,_0x3d3292,_0x2e1dff);return await mkdir(dirname(_0x5aaa40),{'recursive':!![]}),await rename(_0x25fd02,_0x5aaa40),_0x5aaa40;}async function cleanupEmptyDirectories(_0x22861c,_0x4c94b5){const _0x51af19=a27_0x2e77a9;let _0x2c8415=resolve(_0x22861c);const _0x213def=resolve(_0x4c94b5);while(_0x2c8415['startsWith'](''+_0x213def+sep)||_0x2c8415===_0x213def){if(_0x2c8415===_0x213def)return;try{const _0x26a2f2=await readdir(_0x2c8415);if(_0x26a2f2[_0x51af19(0x8c)]>0x0)return;await rmdir(_0x2c8415);}catch{return;}_0x2c8415=dirname(_0x2c8415);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2def4a=a28_0x208c;function a28_0x208c(_0x164c30,_0x2be5b6){_0x164c30=_0x164c30-0x65;const _0x1a2f7b=a28_0x1a2f();let _0x208ccc=_0x1a2f7b[_0x164c30];return _0x208ccc;}(function(_0x2f5f0e,_0xa21719){const _0x5ae1b5=a28_0x208c,_0x189f00=_0x2f5f0e();while(!![]){try{const _0x3a81f1=parseInt(_0x5ae1b5(0x78))/0x1*(parseInt(_0x5ae1b5(0x72))/0x2)+parseInt(_0x5ae1b5(0x7b))/0x3+parseInt(_0x5ae1b5(0x6b))/0x4*(parseInt(_0x5ae1b5(0x73))/0x5)+parseInt(_0x5ae1b5(0x66))/0x6+parseInt(_0x5ae1b5(0x68))/0x7+-parseInt(_0x5ae1b5(0x71))/0x8*(-parseInt(_0x5ae1b5(0x67))/0x9)+-parseInt(_0x5ae1b5(0x6a))/0xa;if(_0x3a81f1===_0xa21719)break;else _0x189f00['push'](_0x189f00['shift']());}catch(_0x43c6b6){_0x189f00['push'](_0x189f00['shift']());}}}(a28_0x1a2f,0x5427b));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a28_0x2def4a(0x6e),'command':'detail','description':a28_0x2def4a(0x74),'risk':a28_0x2def4a(0x76),'flags':[{'name':'id','type':a28_0x2def4a(0x75),'required':!![],'description':'Script\x20ID'},{'name':a28_0x2def4a(0x6d),'type':a28_0x2def4a(0x6c),'description':a28_0x2def4a(0x70)}],async 'execute'(_0x433d7a){const _0x1e8c3f=a28_0x2def4a,_0x1535b4=await getBffScriptInfo(_0x433d7a[_0x1e8c3f(0x65)]('id')),_0x219ec8=_0x433d7a[_0x1e8c3f(0x79)](_0x1e8c3f(0x6d));if(_0x219ec8)return{'ok':!![],'data':_0x1535b4};return{'ok':!![],'data':{'id':_0x1535b4['id'],'appCode':_0x1535b4[_0x1e8c3f(0x7a)],'scriptType':_0x1535b4[_0x1e8c3f(0x7c)],'description':_0x1535b4['description']||_0x1e8c3f(0x69),'createdTime':_0x1535b4[_0x1e8c3f(0x77)]??'','updatedTime':_0x1535b4[_0x1e8c3f(0x6f)]??'','scriptContent':_0x1535b4[_0x1e8c3f(0x7d)]??''}};}};function a28_0x1a2f(){const _0x4d4617=['bff','updatedTime','Return\x20full\x20raw\x20script\x20object','181024PpjJwK','934274hUBJGG','38075GhzJVj','Get\x20BFF\x20script\x20details\x20by\x20ID','number','read','createdTime','1mRzFlO','bool','appCode','815313fJLMQQ','scriptType','scriptContent','num','2028480HoQIkX','234crRAHf','1849351UkvAtB','(none)','22625450EpBWzG','356OYSPlQ','boolean','verbose'];a28_0x1a2f=function(){return _0x4d4617;};return a28_0x1a2f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19e55a,_0x8abd31){const _0x1871a5=a29_0x47b5,_0x4221af=_0x19e55a();while(!![]){try{const _0x28e0aa=-parseInt(_0x1871a5(0xf6))/0x1+parseInt(_0x1871a5(0xf0))/0x2*(parseInt(_0x1871a5(0xf4))/0x3)+parseInt(_0x1871a5(0xf3))/0x4+-parseInt(_0x1871a5(0xf8))/0x5+-parseInt(_0x1871a5(0xf1))/0x6*(parseInt(_0x1871a5(0xf2))/0x7)+-parseInt(_0x1871a5(0xf7))/0x8+-parseInt(_0x1871a5(0xf9))/0x9*(-parseInt(_0x1871a5(0xf5))/0xa);if(_0x28e0aa===_0x8abd31)break;else _0x4221af['push'](_0x4221af['shift']());}catch(_0xc02f20){_0x4221af['push'](_0x4221af['shift']());}}}(a29_0x44f7,0x3ddbf));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';import{bffPull}from'../../commands/bff/pull.js';function a29_0x44f7(){const _0x484bb7=['165101MuLUFK','1025976vAHdfV','1143375ebxDLD','704277rgBruq','341252dDGnnJ','235776rhOnes','84FdouFq','236140Wjmrvo','3uTGkIn','130HqTnQi'];a29_0x44f7=function(){return _0x484bb7;};return a29_0x44f7();}function a29_0x47b5(_0xe26739,_0x498095){_0xe26739=_0xe26739-0xf0;const _0x44f786=a29_0x44f7();let _0x47b5c5=_0x44f786[_0xe26739];return _0x47b5c5;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a30_0x1129(){const _0x3ded35=['1wYOFrH','7529490TYaeYG','52420FUyCvA','ENDPOINT','type','Script\x20type\x20filter','5753433ADvvVI','No\x20BFF\x20scripts\x20found.','COMMON','scriptType','34140lqAzcI','72040kkxYnB','string','boolean','list','2475704mgFnRB','45LLyJxF','Filter\x20by\x20script\x20name','1090734YDMrbH','(unnamed)','name','verbose','appCode','str','72IEMJxe','560TfTpDf','map','bff','bool','306ySCKmX'];a30_0x1129=function(){return _0x3ded35;};return a30_0x1129();}const a30_0x3e4cf2=a30_0x31bc;function a30_0x31bc(_0x2535cb,_0x179afa){_0x2535cb=_0x2535cb-0xc9;const _0x11291a=a30_0x1129();let _0x31bc9c=_0x11291a[_0x2535cb];return _0x31bc9c;}(function(_0x60bdcd,_0x937af7){const _0x3bad22=a30_0x31bc,_0x6c9e44=_0x60bdcd();while(!![]){try{const _0x473490=parseInt(_0x3bad22(0xde))/0x1*(-parseInt(_0x3bad22(0xd2))/0x2)+-parseInt(_0x3bad22(0xd0))/0x3*(parseInt(_0x3bad22(0xe0))/0x4)+parseInt(_0x3bad22(0xd9))/0x5*(parseInt(_0x3bad22(0xca))/0x6)+parseInt(_0x3bad22(0xe4))/0x7+-parseInt(_0x3bad22(0xcb))/0x8*(-parseInt(_0x3bad22(0xdd))/0x9)+parseInt(_0x3bad22(0xdf))/0xa+-parseInt(_0x3bad22(0xcf))/0xb*(parseInt(_0x3bad22(0xd8))/0xc);if(_0x473490===_0x937af7)break;else _0x6c9e44['push'](_0x6c9e44['shift']());}catch(_0x5ac5cd){_0x6c9e44['push'](_0x6c9e44['shift']());}}}(a30_0x1129,0x68008));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a30_0x3e4cf2(0xdb),'command':a30_0x3e4cf2(0xce),'description':'List\x20BFF\x20scripts','risk':'read','flags':[{'name':a30_0x3e4cf2(0xe2),'type':'string','description':a30_0x3e4cf2(0xe3),'default':a30_0x3e4cf2(0xe1),'enum':['ENDPOINT',a30_0x3e4cf2(0xe6)]},{'name':a30_0x3e4cf2(0xd4),'type':a30_0x3e4cf2(0xcc),'description':a30_0x3e4cf2(0xd1)},{'name':'verbose','type':a30_0x3e4cf2(0xcd),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x57b8b2){const _0x23cb83=a30_0x3e4cf2,_0x2c5863=await listBffScripts(_0x57b8b2[_0x23cb83(0xd6)],_0x57b8b2[_0x23cb83(0xd7)]('type'),{'scriptName':_0x57b8b2['str'](_0x23cb83(0xd4))||undefined}),_0x301b1e=_0x57b8b2[_0x23cb83(0xdc)](_0x23cb83(0xd5));return{'ok':!![],'data':_0x301b1e?_0x2c5863:_0x2c5863[_0x23cb83(0xda)](_0x5d5138=>({'id':_0x5d5138['id'],'functionName':_0x5d5138['functionName']??'','description':_0x5d5138['description']||_0x23cb83(0xd3),'scriptType':_0x5d5138[_0x23cb83(0xc9)]})),'message':_0x2c5863['length']===0x0?_0x23cb83(0xe5):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4980ec=a31_0xf601;(function(_0x28ef0f,_0x1b3490){const _0xf7bc47=a31_0xf601,_0x334a97=_0x28ef0f();while(!![]){try{const _0xaa8256=-parseInt(_0xf7bc47(0x1df))/0x1+parseInt(_0xf7bc47(0x1d4))/0x2+-parseInt(_0xf7bc47(0x1d0))/0x3*(parseInt(_0xf7bc47(0x1a9))/0x4)+parseInt(_0xf7bc47(0x1cb))/0x5*(parseInt(_0xf7bc47(0x1d5))/0x6)+-parseInt(_0xf7bc47(0x1b3))/0x7*(parseInt(_0xf7bc47(0x1ce))/0x8)+parseInt(_0xf7bc47(0x1cc))/0x9+parseInt(_0xf7bc47(0x1c7))/0xa;if(_0xaa8256===_0x1b3490)break;else _0x334a97['push'](_0x334a97['shift']());}catch(_0x1f67e8){_0x334a97['push'](_0x334a97['shift']());}}}(a31_0x15ac,0x30c5c));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a31_0x15ac(){const _0x42850c=['operationType','skipped','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','hookLocation','str','force','lastSync','boolean','&type=','lockKey','conflict','scriptsRoot','appCode','1511980TlySCb','validation','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','parse','1685425CuuKFm','377658XKVeiz','stdin','4080rfPSff','string','345885qIHwAy','\x20pulled,\x20','type','filePath','297248eIOSIg','6aItyou','Would\x20inspect\x20','stderr','Remote\x20script\x20missing\x20id.','datasetCode','hash','map','version','functions','stringify','245957vUpgat','includes','Pull\x20only\x20this\x20script\x20type','COMMON','scriptContent','/api/management/library/scripts/list?appCode=','\x22\x20not\x20found\x20after\x20ensureLockScope.','message','No\x20remote\x20BFF\x20scripts\x20found.','pull','local\x20unsynced\x20changes','scriptType','close','bool','lockFilePath','functionNode','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','unresolvable\x20target\x20path','trim','\x20remote\x20BFF\x20script(s)\x20for\x20pull','question','length','functionName','8Usrfea','HOOK','Pull\x20complete:\x20','Lock\x20scope\x20for\x20app\x20\x22','Force\x20overwrite\x20local\x20unsynced\x20changes','Force\x20pull\x20cancelled.','all','toISOString','alias','apiDir','35KDxmBt','toLowerCase','\x20skipped,\x20','push','cancelled','bff','GET'];a31_0x15ac=function(){return _0x42850c;};return a31_0x15ac();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a31_0xf601(_0x444674,_0x28f68a){_0x444674=_0x444674-0x199;const _0x15ace7=a31_0x15ac();let _0xf60154=_0x15ace7[_0x444674];return _0xf60154;}export const bffPull={'service':a31_0x4980ec(0x1b8),'command':a31_0x4980ec(0x19b),'description':a31_0x4980ec(0x1a2),'risk':'write','flags':[{'name':'type','type':a31_0x4980ec(0x1cf),'description':a31_0x4980ec(0x1e1),'enum':[a31_0x4980ec(0x1e2),'ENDPOINT',a31_0x4980ec(0x1aa)]},{'name':a31_0x4980ec(0x1bf),'type':a31_0x4980ec(0x1c1),'description':a31_0x4980ec(0x1ad)}],async 'dryRun'(_0x3e45a5){const _0x48dbcf=a31_0x4980ec,_0xb9a070=loadBffProjectConfig(_0x3e45a5['appCode']),_0x7f0937=await readBffLockFile(_0xb9a070[_0x48dbcf(0x1a0)]),{appLock:_0x363260}=ensureLockScope(_0x7f0937??createEmptyBffLock(),_0x3e45a5['appCode'],_0xb9a070['scriptsRoot'],_0x48dbcf(0x19b)),_0x1c2a78=normalizeBffType(_0x3e45a5['str'](_0x48dbcf(0x1d2)))??undefined,_0x241f81=buildDatasetCodeToAliasMap(_0x3e45a5[_0x48dbcf(0x1b2)],_0x3e45a5[_0x48dbcf(0x1c6)]),[_0xb14b9d,_0x15655f]=await Promise[_0x48dbcf(0x1af)]([listBffScripts(_0x3e45a5[_0x48dbcf(0x1c6)],_0x1c2a78),getBffScriptStatistics(_0x3e45a5[_0x48dbcf(0x1c6)])]),_0x3e9e48=createHookLocationMap(_0x15655f),_0x6a825a=[];for(const _0x1482b6 of _0xb14b9d){const _0x417a22=resolveRemoteScriptTarget(_0xb9a070,_0x1482b6,_0x3e9e48,_0x363260[_0x48dbcf(0x1dd)],_0x241f81);if(!_0x417a22){_0x6a825a[_0x48dbcf(0x1b6)]({'scriptType':_0x1482b6[_0x48dbcf(0x19d)],'functionName':_0x1482b6[_0x48dbcf(0x1a8)]??'','status':_0x48dbcf(0x1bb),'reason':_0x48dbcf(0x1a3)});continue;}const _0x1f33c9=_0x363260[_0x48dbcf(0x1dd)][_0x417a22[_0x48dbcf(0x1c3)]],_0x3053ab=_0x1482b6['scriptContent']!=null?computeContentHash(_0x1482b6[_0x48dbcf(0x1e3)]):undefined,_0x5d85e1=await hasUnsyncedLocalChanges(_0x417a22[_0x48dbcf(0x1d3)],_0x1f33c9,_0x3053ab);_0x6a825a[_0x48dbcf(0x1b6)]({'lockKey':_0x417a22['lockKey'],'filePath':_0x417a22[_0x48dbcf(0x1d3)],'remoteId':_0x1482b6['id']??null,'status':_0x5d85e1?_0x48dbcf(0x1c4):'would_pull'});}return{'method':_0x48dbcf(0x1b9),'url':_0x48dbcf(0x1e4)+_0x3e45a5[_0x48dbcf(0x1c6)]+(_0x1c2a78?_0x48dbcf(0x1c2)+_0x1c2a78:''),'body':{'appCode':_0x3e45a5[_0x48dbcf(0x1c6)],'filterType':_0x1c2a78??null,'files':_0x6a825a},'description':_0x48dbcf(0x1d6)+_0x6a825a[_0x48dbcf(0x1a7)]+_0x48dbcf(0x1a5)};},async 'execute'(_0x165095){const _0x3658b7=a31_0x4980ec,_0x10874c=loadBffProjectConfig(_0x165095[_0x3658b7(0x1c6)]),_0x21cbde=await readBffLockFile(_0x10874c[_0x3658b7(0x1a0)]),{lockData:_0x28d817,appLock:_0x5850c5}=ensureLockScope(_0x21cbde??createEmptyBffLock(),_0x165095[_0x3658b7(0x1c6)],_0x10874c[_0x3658b7(0x1c5)],'pull'),_0x310286=normalizeBffType(_0x165095[_0x3658b7(0x1be)](_0x3658b7(0x1d2)))??undefined;if(_0x165095[_0x3658b7(0x1be)](_0x3658b7(0x1d2))&&!_0x310286)throw CliErrors[_0x3658b7(0x1c8)](_0x3658b7(0x1c9));const [_0x2f7f30,_0x381530]=await Promise['all']([listBffScripts(_0x165095[_0x3658b7(0x1c6)],_0x310286),getBffScriptStatistics(_0x165095[_0x3658b7(0x1c6)])]);if(_0x2f7f30[_0x3658b7(0x1a7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3658b7(0x19a)};const _0x543181=_0x165095[_0x3658b7(0x19f)](_0x3658b7(0x1bf));if(_0x543181&&!_0x165095['nonInteractive']){const _0xd05ac8=await confirmForce();if(!_0xd05ac8)throw CliErrors[_0x3658b7(0x1b7)](_0x3658b7(0x1ae));}if(_0x543181&&_0x165095['nonInteractive']){}const _0x28e4fb=buildDatasetCodeToAliasMap(_0x165095[_0x3658b7(0x1b2)],_0x165095['appCode']),_0x10e693=createHookLocationMap(_0x381530),_0x2e521b=JSON[_0x3658b7(0x1ca)](JSON[_0x3658b7(0x1de)](_0x28d817)),_0xda75d9=_0x165095[_0x3658b7(0x1c6)],_0x1eab21=_0x2e521b['apps'][_0xda75d9];if(!_0x1eab21)throw new Error(_0x3658b7(0x1ac)+_0xda75d9+_0x3658b7(0x1e5));const _0x5d1bd1=[],_0x3d039c=[],_0x5188df=[];for(const _0x2b9df2 of _0x2f7f30){const _0x5adf52=resolveRemoteScriptTarget(_0x10874c,_0x2b9df2,_0x10e693,_0x5850c5['functions'],_0x28e4fb);if(!_0x5adf52){_0x3d039c[_0x3658b7(0x1b6)]({'lockKey':_0x2b9df2['scriptType']+'/'+_0x2b9df2[_0x3658b7(0x1a8)],'reason':_0x3658b7(0x1a3)});continue;}const _0x5a3fbc=_0x5850c5[_0x3658b7(0x1dd)][_0x5adf52[_0x3658b7(0x1c3)]];try{if(!_0x2b9df2['id'])throw new Error(_0x3658b7(0x1d8));if(_0x2b9df2['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x583b9a=_0x2b9df2[_0x3658b7(0x1e3)],_0x2bf854=computeContentHash(_0x583b9a);if(!_0x543181){const _0x2ae82b=await hasUnsyncedLocalChanges(_0x5adf52[_0x3658b7(0x1d3)],_0x5a3fbc,_0x2bf854);if(_0x2ae82b){_0x3d039c[_0x3658b7(0x1b6)]({'lockKey':_0x5adf52[_0x3658b7(0x1c3)],'reason':_0x3658b7(0x19c)});continue;}}await ensureParentDirectory(_0x5adf52[_0x3658b7(0x1d3)]),await writeFile(_0x5adf52[_0x3658b7(0x1d3)],_0x583b9a,'utf8');const _0xe9cc9c={'hash':_0x2bf854,'remoteId':_0x2b9df2['id'],'version':_0x2b9df2[_0x3658b7(0x1dc)]};_0x5adf52[_0x3658b7(0x1d2)]===_0x3658b7(0x1aa)&&_0x5adf52[_0x3658b7(0x1bd)]&&(_0xe9cc9c['alias']=_0x5adf52[_0x3658b7(0x1bd)][_0x3658b7(0x1b1)],_0xe9cc9c[_0x3658b7(0x1d9)]=_0x5adf52[_0x3658b7(0x1bd)][_0x3658b7(0x1d9)],_0xe9cc9c[_0x3658b7(0x1ba)]=_0x5adf52[_0x3658b7(0x1bd)]['operationType'],_0xe9cc9c[_0x3658b7(0x1a1)]=_0x5adf52['hookLocation'][_0x3658b7(0x1a1)]),_0x1eab21[_0x3658b7(0x1dd)][_0x5adf52[_0x3658b7(0x1c3)]]=_0xe9cc9c,_0x5d1bd1[_0x3658b7(0x1b6)]({'lockKey':_0x5adf52[_0x3658b7(0x1c3)],'remoteId':_0x2b9df2['id']});}catch(_0x269a23){_0x5188df[_0x3658b7(0x1b6)]({'lockKey':_0x5adf52['lockKey'],'error':_0x269a23 instanceof Error?_0x269a23[_0x3658b7(0x199)]:String(_0x269a23)});}}return _0x1eab21[_0x3658b7(0x1c0)]=new Date()[_0x3658b7(0x1b0)](),await writeBffLockFile(_0x10874c[_0x3658b7(0x1a0)],_0x2e521b),{'ok':_0x5188df[_0x3658b7(0x1a7)]===0x0,'data':{'pulled':_0x5d1bd1,'skipped':_0x3d039c,'failed':_0x5188df},'message':_0x3658b7(0x1ab)+_0x5d1bd1[_0x3658b7(0x1a7)]+_0x3658b7(0x1d1)+_0x3d039c['length']+_0x3658b7(0x1b5)+_0x5188df[_0x3658b7(0x1a7)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x4a3893,_0x389741,_0x7060d9){const _0x9b76d1=a31_0x4980ec;if(!await fileExists(_0x4a3893))return![];const _0x12fd6c=await computeFileHash(_0x4a3893);if(!_0x389741)return _0x7060d9?_0x12fd6c!==_0x7060d9:!![];return _0x12fd6c!==_0x389741[_0x9b76d1(0x1da)];}function buildDatasetCodeToAliasMap(_0x2674ad,_0x24009d){const _0x239f21=a31_0x4980ec,_0x133f7f=loadAliasMap(_0x2674ad,undefined,resolveApiFilePath(_0x2674ad,_0x24009d));return new Map(_0x133f7f[_0x239f21(0x1db)](_0x2cf6bd=>[_0x2cf6bd[_0x239f21(0x1d9)],_0x2cf6bd[_0x239f21(0x1b1)]]));}async function confirmForce(){const _0x4094f2=a31_0x4980ec,_0x582440=createInterface({'input':process[_0x4094f2(0x1cd)],'output':process[_0x4094f2(0x1d7)]}),_0x570766=await new Promise(_0x176ea5=>{const _0x176e9d=_0x4094f2;_0x582440[_0x176e9d(0x1a6)](_0x176e9d(0x1bc),_0x176ea5);});return _0x582440[_0x4094f2(0x19e)](),['y','yes'][_0x4094f2(0x1e0)](_0x570766[_0x4094f2(0x1a4)]()[_0x4094f2(0x1b4)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x2a9260=a32_0x2ea1;(function(_0x5d5a24,_0x15fa0e){const _0x56427b=a32_0x2ea1,_0x5039c6=_0x5d5a24();while(!![]){try{const _0x3b5a09=-parseInt(_0x56427b(0x1ab))/0x1*(parseInt(_0x56427b(0x1a4))/0x2)+parseInt(_0x56427b(0x1b1))/0x3*(-parseInt(_0x56427b(0x19c))/0x4)+-parseInt(_0x56427b(0x1a0))/0x5+parseInt(_0x56427b(0x18a))/0x6+-parseInt(_0x56427b(0x1a6))/0x7+-parseInt(_0x56427b(0x1ac))/0x8*(parseInt(_0x56427b(0x1af))/0x9)+parseInt(_0x56427b(0x183))/0xa;if(_0x3b5a09===_0x15fa0e)break;else _0x5039c6['push'](_0x5039c6['shift']());}catch(_0x1eed28){_0x5039c6['push'](_0x5039c6['shift']());}}}(a32_0x4845,0x6e203));import{readFile}from'node:fs/promises';function a32_0x2ea1(_0x5b4e34,_0x80388){_0x5b4e34=_0x5b4e34-0x16d;const _0x4845af=a32_0x4845();let _0x2ea194=_0x4845af[_0x5b4e34];return _0x2ea194;}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';function a32_0x4845(){const _0x4a0455=['Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Cannot\x20resolve\x20dataset\x20for\x20\x22','has','push','5279304iXMSjB','\x20local\x20BFF\x20script(s)\x20for\x20push','str','Run\x20`','datasetCode','Would\x20inspect\x20','Incomplete\x20HOOK\x20path:\x20','force','functions','string','filter',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','description','HOOK','COMMON','Push\x20complete:\x20','unchanged','\x20uploaded,\x20','943252IMxZeC','hash','map','Push\x20local\x20BFF\x20scripts\x20to\x20remote','4167865Wxnobq','create','utf8','length','311294lfWfsn','message','4103113YCCqDs','script','name','functionNode','version','3sdTOBF','16WlBxgT','scriptsRoot','set','186174bxwwIO','bff','6zVurLz','datasetCodeToId','validation','high-risk-write','some','bool','appCode','\x22.\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','/api/management/library/scripts/save','filePath','update','aliasToDatasetCode','code','operationType','remoteId','lockFilePath','toISOString','boolean','Push\x20only\x20this\x20script\x20type','lockKey','\x20skipped,\x20','type','19708620ARZwgq','alias','\x20failed'];a32_0x4845=function(){return _0x4a0455;};return a32_0x4845();}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_0x2a9260(0x1b0),'command':'push','description':a32_0x2a9260(0x19f),'risk':a32_0x2a9260(0x16f),'flags':[{'name':'type','type':a32_0x2a9260(0x193),'description':a32_0x2a9260(0x17f),'enum':[a32_0x2a9260(0x198),'ENDPOINT',a32_0x2a9260(0x197)]},{'name':a32_0x2a9260(0x1a8),'type':'string','description':a32_0x2a9260(0x186)},{'name':a32_0x2a9260(0x191),'type':a32_0x2a9260(0x17e),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x28e841){const _0x20997c=a32_0x2a9260,_0x3f14bc=loadBffProjectConfig(_0x28e841['appCode']),_0x56a6da=await readBffLockFile(_0x3f14bc['lockFilePath']),{appLock:_0x26471b}=ensureLockScope(_0x56a6da??createEmptyBffLock(),_0x28e841[_0x20997c(0x172)],_0x3f14bc[_0x20997c(0x1ad)],'push'),_0x165f53=await getTargetFunctions(_0x3f14bc,_0x28e841),_0x1a1de0=_0x28e841[_0x20997c(0x171)](_0x20997c(0x191)),_0x2ad6e1=[];for(const _0x508b19 of _0x165f53){const _0x4c40bd=await computeFileHash(_0x508b19[_0x20997c(0x176)]),_0x46405f=_0x26471b[_0x20997c(0x192)][_0x508b19[_0x20997c(0x180)]],_0x1757a7=!!_0x46405f&&_0x46405f[_0x20997c(0x19d)]===_0x4c40bd;_0x2ad6e1['push']({'lockKey':_0x508b19[_0x20997c(0x180)],'filePath':_0x508b19[_0x20997c(0x176)],'remoteId':_0x46405f?.[_0x20997c(0x17b)]??null,'mode':_0x46405f?.[_0x20997c(0x17b)]?_0x20997c(0x177):_0x20997c(0x1a1),'status':!_0x1a1de0&&_0x1757a7?_0x20997c(0x19a):'would_push'});}return{'method':'POST','url':_0x20997c(0x175),'body':{'appCode':_0x28e841[_0x20997c(0x172)],'force':_0x1a1de0,'files':_0x2ad6e1},'description':_0x20997c(0x18f)+_0x2ad6e1[_0x20997c(0x1a3)]+_0x20997c(0x18b)};},async 'execute'(_0x3dea98){const _0x3badea=a32_0x2a9260,_0x35b5a1=loadBffProjectConfig(_0x3dea98[_0x3badea(0x172)]),_0x4d0504=await readBffLockFile(_0x35b5a1[_0x3badea(0x17c)]),{lockData:_0x1d844e,appLock:_0x2a47e9}=ensureLockScope(_0x4d0504??createEmptyBffLock(),_0x3dea98['appCode'],_0x35b5a1[_0x3badea(0x1ad)],_0x3badea(0x189)),_0x21fe93=await getTargetFunctions(_0x35b5a1,_0x3dea98);if(_0x21fe93[_0x3badea(0x1a3)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x3fd138=_0x3dea98[_0x3badea(0x171)]('force'),_0x182525=await buildHookMaps(_0x3dea98['appCode'],_0x3dea98['apiDir'],_0x21fe93,_0x2a47e9),_0x345eb5=[],_0x5aa602=[],_0xe7278d=[];for(const _0x3134af of _0x21fe93){const _0x20c8d5=await computeFileHash(_0x3134af[_0x3badea(0x176)]),_0x117dc7=_0x2a47e9['functions'][_0x3134af['lockKey']];if(!_0x3fd138&&_0x117dc7&&_0x117dc7['hash']===_0x20c8d5){_0x5aa602[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x3dea98[_0x3badea(0x172)],_0x3134af,_0x2a47e9,_0x182525);const _0x1b890e=_0x2a47e9[_0x3badea(0x192)][_0x3134af[_0x3badea(0x180)]];_0x345eb5[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'remoteId':_0x1b890e?.[_0x3badea(0x17b)]??0x0});}catch(_0x5e6943){_0xe7278d[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'error':_0x5e6943 instanceof Error?_0x5e6943[_0x3badea(0x1a5)]:String(_0x5e6943)});}}return _0x2a47e9['lastSync']=new Date()[_0x3badea(0x17d)](),await writeBffLockFile(_0x35b5a1[_0x3badea(0x17c)],_0x1d844e),{'ok':_0xe7278d[_0x3badea(0x1a3)]===0x0,'data':{'uploaded':_0x345eb5,'skipped':_0x5aa602,'failed':_0xe7278d},'message':_0x3badea(0x199)+_0x345eb5[_0x3badea(0x1a3)]+_0x3badea(0x19b)+_0x5aa602['length']+_0x3badea(0x181)+_0xe7278d[_0x3badea(0x1a3)]+_0x3badea(0x185)};}};async function getTargetFunctions(_0xe6fafd,_0x144c34){const _0x31f959=a32_0x2a9260,_0x48cee6=_0x144c34[_0x31f959(0x18c)](_0x31f959(0x182)),_0x11c40e=_0x144c34[_0x31f959(0x18c)](_0x31f959(0x1a8)),_0x378ba9=normalizeBffType(_0x48cee6)??undefined;if(_0x11c40e&&!_0x378ba9)throw CliErrors[_0x31f959(0x16e)](_0x31f959(0x174));const _0x43d2da=await scanLocalBffFunctions(_0xe6fafd,_0x378ba9);if(_0x11c40e){const _0xe1258d=_0x43d2da[_0x31f959(0x194)](_0x3e7a44=>_0x3e7a44[_0x31f959(0x1a8)]===_0x11c40e);if(_0xe1258d[_0x31f959(0x1a3)]===0x0)throw CliErrors[_0x31f959(0x16e)]('Local\x20function\x20not\x20found:\x20'+_0x378ba9+'/'+_0x11c40e);return _0xe1258d;}return _0x43d2da;}async function buildHookMaps(_0xc49bab,_0x349f7a,_0x2b845c,_0x3066c5){const _0x13a4cf=a32_0x2a9260,_0x1a43dd=_0x2b845c[_0x13a4cf(0x170)](_0x5b3d4b=>_0x5b3d4b['type']==='HOOK');if(!_0x1a43dd)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x4f0a34=loadAliasMap(_0x349f7a,undefined,resolveApiFilePath(_0x349f7a,_0xc49bab)),_0x82b939=new Map(_0x4f0a34[_0x13a4cf(0x19e)](_0x56f587=>[_0x56f587[_0x13a4cf(0x184)],_0x56f587[_0x13a4cf(0x18e)]]));for(const _0x4f5933 of Object['values'](_0x3066c5[_0x13a4cf(0x192)])){_0x4f5933[_0x13a4cf(0x184)]&&_0x4f5933[_0x13a4cf(0x18e)]&&!_0x82b939[_0x13a4cf(0x188)](_0x4f5933[_0x13a4cf(0x184)])&&_0x82b939[_0x13a4cf(0x1ae)](_0x4f5933[_0x13a4cf(0x184)],_0x4f5933[_0x13a4cf(0x18e)]);}const _0x1acef9=await listDatasets(_0xc49bab),_0x497d3f=new Map(_0x1acef9[_0x13a4cf(0x19e)](_0x44ff8c=>[_0x44ff8c[_0x13a4cf(0x179)],_0x44ff8c['id']]));return{'aliasToDatasetCode':_0x82b939,'datasetCodeToId':_0x497d3f};}async function uploadSingleFunction(_0x1446b3,_0x1d991e,_0x2777d4,_0x4dd07e){const _0x1a0ee3=a32_0x2a9260,_0x1faee7=await readFile(_0x1d991e['filePath'],_0x1a0ee3(0x1a2)),_0x1a89bf=await computeFileHash(_0x1d991e['filePath']),_0x250d66=_0x2777d4['functions'][_0x1d991e[_0x1a0ee3(0x180)]];if(_0x250d66?.[_0x1a0ee3(0x17b)]&&_0x250d66[_0x1a0ee3(0x1aa)]==null)throw CliErrors[_0x1a0ee3(0x16e)](_0x1d991e[_0x1a0ee3(0x180)]+_0x1a0ee3(0x195));let _0x2702f0=extractScriptDescription(_0x1faee7);if(!_0x2702f0&&_0x250d66?.[_0x1a0ee3(0x17b)]){const _0x25c760=await getBffScriptInfo(_0x250d66[_0x1a0ee3(0x17b)]);_0x2702f0=_0x25c760[_0x1a0ee3(0x196)]||undefined;}const _0x4f38b7={'appCode':_0x1446b3,'functionName':_0x1d991e[_0x1a0ee3(0x1a8)],'scriptType':_0x1d991e[_0x1a0ee3(0x182)],'scriptContent':_0x1faee7};if(_0x250d66?.[_0x1a0ee3(0x17b)])_0x4f38b7['id']=_0x250d66['remoteId'];if(_0x250d66?.[_0x1a0ee3(0x1aa)]!=null)_0x4f38b7['version']=_0x250d66[_0x1a0ee3(0x1aa)];if(_0x2702f0)_0x4f38b7[_0x1a0ee3(0x196)]=_0x2702f0;if(_0x1d991e[_0x1a0ee3(0x182)]===_0x1a0ee3(0x197)){const _0x5f381f=_0x1d991e[_0x1a0ee3(0x184)];if(!_0x5f381f||!_0x1d991e[_0x1a0ee3(0x17a)]||!_0x1d991e[_0x1a0ee3(0x1a9)])throw CliErrors[_0x1a0ee3(0x16e)](_0x1a0ee3(0x190)+_0x1d991e[_0x1a0ee3(0x180)]);const _0x57cb5d=_0x4dd07e['aliasToDatasetCode']['get'](_0x5f381f)??_0x250d66?.[_0x1a0ee3(0x18e)]??_0x5f381f,_0x56a7ec=_0x4dd07e[_0x1a0ee3(0x16d)]['get'](_0x57cb5d);if(!_0x56a7ec)throw CliErrors[_0x1a0ee3(0x16e)](_0x1a0ee3(0x187)+_0x5f381f+_0x1a0ee3(0x173)+(_0x1a0ee3(0x18d)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x4f38b7['datasetId']=_0x56a7ec,_0x4f38b7[_0x1a0ee3(0x17a)]=_0x1d991e[_0x1a0ee3(0x17a)],_0x4f38b7[_0x1a0ee3(0x1a9)]=_0x1d991e[_0x1a0ee3(0x1a9)];}const _0x13089=await saveBffScript(_0x4f38b7),_0x118209=_0x13089['id'],_0x170978=_0x13089[_0x1a0ee3(0x1a7)]??await getBffScriptInfo(_0x118209),_0x11f499={'hash':_0x1a89bf,'remoteId':_0x118209,'version':_0x170978[_0x1a0ee3(0x1aa)]};if(_0x1d991e[_0x1a0ee3(0x182)]===_0x1a0ee3(0x197)){const _0x46dc2c=_0x1d991e[_0x1a0ee3(0x184)],_0x44fe92=_0x4dd07e[_0x1a0ee3(0x178)]['get'](_0x46dc2c)??_0x250d66?.[_0x1a0ee3(0x18e)]??_0x46dc2c;_0x4dd07e[_0x1a0ee3(0x178)][_0x1a0ee3(0x188)](_0x46dc2c)?_0x11f499[_0x1a0ee3(0x184)]=_0x46dc2c:_0x11f499[_0x1a0ee3(0x184)]=_0x250d66?.[_0x1a0ee3(0x184)],_0x11f499[_0x1a0ee3(0x18e)]=_0x44fe92,_0x11f499['operationType']=_0x1d991e[_0x1a0ee3(0x17a)],_0x11f499['functionNode']=_0x1d991e[_0x1a0ee3(0x1a9)];}_0x2777d4[_0x1a0ee3(0x192)][_0x1d991e[_0x1a0ee3(0x180)]]=_0x11f499;}
|
|
1
|
+
const a32_0x5a2356=a32_0x537e;(function(_0x54153c,_0x56b05c){const _0x2e1bc1=a32_0x537e,_0x3bea66=_0x54153c();while(!![]){try{const _0x564312=parseInt(_0x2e1bc1(0xf5))/0x1*(-parseInt(_0x2e1bc1(0x100))/0x2)+parseInt(_0x2e1bc1(0xca))/0x3+parseInt(_0x2e1bc1(0xcd))/0x4+parseInt(_0x2e1bc1(0xec))/0x5+-parseInt(_0x2e1bc1(0xc2))/0x6+-parseInt(_0x2e1bc1(0xe8))/0x7*(-parseInt(_0x2e1bc1(0xdc))/0x8)+-parseInt(_0x2e1bc1(0xfe))/0x9;if(_0x564312===_0x56b05c)break;else _0x3bea66['push'](_0x3bea66['shift']());}catch(_0x3f75d1){_0x3bea66['push'](_0x3bea66['shift']());}}}(a32_0xa791,0x29789));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';function a32_0x537e(_0xe694b5,_0x5122f5){_0xe694b5=_0xe694b5-0xb9;const _0xa7916c=a32_0xa791();let _0x537e26=_0xa7916c[_0xe694b5];return _0x537e26;}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_0x5a2356(0xf7),'command':a32_0x5a2356(0xd5),'description':a32_0x5a2356(0xe2),'risk':a32_0x5a2356(0xdd),'flags':[{'name':a32_0x5a2356(0xd9),'type':a32_0x5a2356(0xfa),'description':a32_0x5a2356(0xbf),'enum':[a32_0x5a2356(0xe3),a32_0x5a2356(0xce),a32_0x5a2356(0xea)]},{'name':a32_0x5a2356(0xfc),'type':a32_0x5a2356(0xfa),'description':a32_0x5a2356(0xbb)},{'name':a32_0x5a2356(0xcf),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x12a509){const _0x2b77bb=a32_0x5a2356,_0x5664eb=loadBffProjectConfig(_0x12a509['appCode']),_0x25d57b=await readBffLockFile(_0x5664eb[_0x2b77bb(0xf2)]),{appLock:_0x1f40c3}=ensureLockScope(_0x25d57b??createEmptyBffLock(),_0x12a509['appCode'],_0x5664eb[_0x2b77bb(0xd7)],_0x2b77bb(0xd5)),_0x380d0c=await getTargetFunctions(_0x5664eb,_0x12a509),_0x488eec=_0x12a509['bool']('force'),_0x3e2f6=[];for(const _0x2cd411 of _0x380d0c){const _0x1bf9fe=await computeFileHash(_0x2cd411[_0x2b77bb(0xe9)]),_0x371b47=_0x1f40c3[_0x2b77bb(0xff)][_0x2cd411[_0x2b77bb(0xc4)]],_0x1a3a0b=!!_0x371b47&&_0x371b47[_0x2b77bb(0xd4)]===_0x1bf9fe;_0x3e2f6[_0x2b77bb(0xd5)]({'lockKey':_0x2cd411[_0x2b77bb(0xc4)],'filePath':_0x2cd411['filePath'],'remoteId':_0x371b47?.['remoteId']??null,'mode':_0x371b47?.['remoteId']?_0x2b77bb(0xe6):_0x2b77bb(0xbd),'status':!_0x488eec&&_0x1a3a0b?'unchanged':_0x2b77bb(0xc7)});}return{'method':_0x2b77bb(0xc0),'url':_0x2b77bb(0xd1),'body':{'appCode':_0x12a509[_0x2b77bb(0xeb)],'force':_0x488eec,'files':_0x3e2f6},'description':_0x2b77bb(0xf1)+_0x3e2f6[_0x2b77bb(0xef)]+'\x20local\x20BFF\x20script(s)\x20for\x20push'};},async 'execute'(_0x5b2be1){const _0x266bfb=a32_0x5a2356,_0x5de09e=loadBffProjectConfig(_0x5b2be1[_0x266bfb(0xeb)]),_0x13fc24=await readBffLockFile(_0x5de09e[_0x266bfb(0xf2)]),{lockData:_0x1851e0,appLock:_0xdaab92}=ensureLockScope(_0x13fc24??createEmptyBffLock(),_0x5b2be1[_0x266bfb(0xeb)],_0x5de09e[_0x266bfb(0xd7)],_0x266bfb(0xd5)),_0xfb2398=await getTargetFunctions(_0x5de09e,_0x5b2be1);if(_0xfb2398[_0x266bfb(0xef)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x266bfb(0xcc)};const _0x265137=_0x5b2be1[_0x266bfb(0xbc)](_0x266bfb(0xcf)),_0x263148=await buildHookMaps(_0x5b2be1[_0x266bfb(0xeb)],_0x5b2be1[_0x266bfb(0xe7)],_0xfb2398,_0xdaab92),_0x329997=[],_0x388f5f=[],_0x368544=[];for(const _0x17a2a2 of _0xfb2398){const _0x28876e=await computeFileHash(_0x17a2a2['filePath']),_0x284f04=_0xdaab92['functions'][_0x17a2a2[_0x266bfb(0xc4)]];if(!_0x265137&&_0x284f04&&_0x284f04[_0x266bfb(0xd4)]===_0x28876e){_0x388f5f[_0x266bfb(0xd5)]({'lockKey':_0x17a2a2[_0x266bfb(0xc4)],'reason':_0x266bfb(0xbe)});continue;}try{await uploadSingleFunction(_0x5b2be1['appCode'],_0x17a2a2,_0xdaab92,_0x263148);const _0x14bc3a=_0xdaab92[_0x266bfb(0xff)][_0x17a2a2['lockKey']];_0x329997['push']({'lockKey':_0x17a2a2[_0x266bfb(0xc4)],'remoteId':_0x14bc3a?.['remoteId']??0x0});}catch(_0x4f8ba1){_0x368544[_0x266bfb(0xd5)]({'lockKey':_0x17a2a2[_0x266bfb(0xc4)],'error':_0x4f8ba1 instanceof Error?_0x4f8ba1['message']:String(_0x4f8ba1)});}}return _0xdaab92[_0x266bfb(0xf6)]=new Date()['toISOString'](),await writeBffLockFile(_0x5de09e[_0x266bfb(0xf2)],_0x1851e0),{'ok':_0x368544[_0x266bfb(0xef)]===0x0,'data':{'uploaded':_0x329997,'skipped':_0x388f5f,'failed':_0x368544},'message':_0x266bfb(0xde)+_0x329997[_0x266bfb(0xef)]+_0x266bfb(0xc3)+_0x388f5f[_0x266bfb(0xef)]+_0x266bfb(0xe0)+_0x368544['length']+'\x20failed'};}};async function getTargetFunctions(_0x2de06c,_0x4896fb){const _0x3a75c1=a32_0x5a2356,_0x5c418f=_0x4896fb[_0x3a75c1(0xdb)](_0x3a75c1(0xd9)),_0x56c6f5=_0x4896fb['str'](_0x3a75c1(0xfc)),_0x9f7986=normalizeBffType(_0x5c418f)??undefined;if(_0x56c6f5&&!_0x9f7986)throw CliErrors[_0x3a75c1(0xd6)](_0x3a75c1(0xf9));const _0x1c9743=await scanLocalBffFunctions(_0x2de06c,_0x9f7986);if(_0x56c6f5){const _0x84909f=_0x1c9743[_0x3a75c1(0xee)](_0x45deaf=>_0x45deaf['name']===_0x56c6f5);if(_0x84909f[_0x3a75c1(0xef)]===0x0)throw CliErrors[_0x3a75c1(0xd6)](_0x3a75c1(0xe5)+_0x9f7986+'/'+_0x56c6f5);return _0x84909f;}return _0x1c9743;}async function buildHookMaps(_0x4b645d,_0xa797a,_0x1bb34f,_0x307d03){const _0x5acd6c=a32_0x5a2356,_0x39228d=_0x1bb34f[_0x5acd6c(0xc6)](_0x260374=>_0x260374[_0x5acd6c(0xd9)]===_0x5acd6c(0xea));if(!_0x39228d)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x194b17=loadAliasMap(_0xa797a,undefined,resolveApiFilePath(_0xa797a,_0x4b645d)),_0x144052=new Map(_0x194b17[_0x5acd6c(0xfb)](_0x462dab=>[_0x462dab[_0x5acd6c(0xd8)],_0x462dab[_0x5acd6c(0xc8)]]));for(const _0x6b0f7d of Object[_0x5acd6c(0xb9)](_0x307d03[_0x5acd6c(0xff)])){_0x6b0f7d['alias']&&_0x6b0f7d['datasetCode']&&!_0x144052[_0x5acd6c(0xdf)](_0x6b0f7d[_0x5acd6c(0xd8)])&&_0x144052['set'](_0x6b0f7d[_0x5acd6c(0xd8)],_0x6b0f7d[_0x5acd6c(0xc8)]);}const _0x2cee42=await listDatasets(_0x4b645d),_0x3cb5aa=new Map(_0x2cee42[_0x5acd6c(0xfb)](_0x26cea3=>[_0x26cea3[_0x5acd6c(0xf8)],_0x26cea3['id']]));return{'aliasToDatasetCode':_0x144052,'datasetCodeToId':_0x3cb5aa};}function a32_0xa791(){const _0x5671f0=['lastSync','bff','code','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','string','map','name','Cannot\x20resolve\x20dataset\x20for\x20\x22','1232604fXgVHn','functions','495466kXzzoX','values','description','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','bool','create','unchanged','Push\x20only\x20this\x20script\x20type','POST','datasetId','1011918oMTwRS','\x20uploaded,\x20','lockKey','functionNode','some','would_push','datasetCode','script','226200hYXOQq','operationType','No\x20local\x20BFF\x20functions\x20found.','495260kAPJCb','ENDPOINT','force','Run\x20`','/api/management/library/scripts/save','remoteId',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','hash','push','validation','scriptsRoot','alias','type','utf8','str','1745048nAoJWg','high-risk-write','Push\x20complete:\x20','has','\x20skipped,\x20','datasetCodeToId','Push\x20local\x20BFF\x20scripts\x20to\x20remote','COMMON','Incomplete\x20HOOK\x20path:\x20','Local\x20function\x20not\x20found:\x20','update','apiDir','7rFXymx','filePath','HOOK','appCode','1529305JWozSO','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','filter','length','version','Would\x20inspect\x20','lockFilePath','aliasToDatasetCode','get','1UpZmpR'];a32_0xa791=function(){return _0x5671f0;};return a32_0xa791();}async function uploadSingleFunction(_0x4868eb,_0x272685,_0x5674f0,_0x56e73d){const _0x5ca071=a32_0x5a2356,_0xb8f8c9=await readFile(_0x272685[_0x5ca071(0xe9)],_0x5ca071(0xda)),_0x4168d0=await computeFileHash(_0x272685['filePath']),_0x5b812a=_0x5674f0[_0x5ca071(0xff)][_0x272685[_0x5ca071(0xc4)]];if(_0x5b812a?.['remoteId']&&_0x5b812a['version']==null)throw CliErrors['validation'](_0x272685['lockKey']+_0x5ca071(0xd3));let _0x2a5c56=extractScriptDescription(_0xb8f8c9);if(!_0x2a5c56&&_0x5b812a?.[_0x5ca071(0xd2)]){const _0x3b8a11=await getBffScriptInfo(_0x5b812a[_0x5ca071(0xd2)]);_0x2a5c56=_0x3b8a11[_0x5ca071(0xba)]||undefined;}const _0x20d68c={'appCode':_0x4868eb,'functionName':_0x272685[_0x5ca071(0xfc)],'scriptType':_0x272685[_0x5ca071(0xd9)],'scriptContent':_0xb8f8c9};if(_0x5b812a?.[_0x5ca071(0xd2)])_0x20d68c['id']=_0x5b812a[_0x5ca071(0xd2)];if(_0x5b812a?.[_0x5ca071(0xf0)]!=null)_0x20d68c[_0x5ca071(0xf0)]=_0x5b812a['version'];if(_0x2a5c56)_0x20d68c[_0x5ca071(0xba)]=_0x2a5c56;if(_0x272685[_0x5ca071(0xd9)]===_0x5ca071(0xea)){const _0x56d100=_0x272685[_0x5ca071(0xd8)];if(!_0x56d100||!_0x272685['operationType']||!_0x272685[_0x5ca071(0xc5)])throw CliErrors['validation'](_0x5ca071(0xe4)+_0x272685[_0x5ca071(0xc4)]);const _0x3f8775=_0x56e73d[_0x5ca071(0xf3)][_0x5ca071(0xf4)](_0x56d100)??_0x5b812a?.['datasetCode']??_0x56d100,_0x4616e4=_0x56e73d[_0x5ca071(0xe1)][_0x5ca071(0xf4)](_0x3f8775);if(!_0x4616e4)throw CliErrors[_0x5ca071(0xd6)](_0x5ca071(0xfd)+_0x56d100+'\x22.\x20'+(_0x5ca071(0xd0)+CLI_BIN_NAME+_0x5ca071(0xed)));_0x20d68c[_0x5ca071(0xc1)]=_0x4616e4,_0x20d68c[_0x5ca071(0xcb)]=_0x272685[_0x5ca071(0xcb)],_0x20d68c[_0x5ca071(0xc5)]=_0x272685['functionNode'];}const _0x2ea509=await saveBffScript(_0x20d68c),_0x2efe32=_0x2ea509['id'],_0x1cdbf8=_0x2ea509[_0x5ca071(0xc9)]??await getBffScriptInfo(_0x2efe32),_0x3b878e={'hash':_0x4168d0,'remoteId':_0x2efe32,'version':_0x1cdbf8[_0x5ca071(0xf0)]};if(_0x272685[_0x5ca071(0xd9)]===_0x5ca071(0xea)){const _0x44ac75=_0x272685['alias'],_0x52ee26=_0x56e73d[_0x5ca071(0xf3)][_0x5ca071(0xf4)](_0x44ac75)??_0x5b812a?.['datasetCode']??_0x44ac75;_0x56e73d[_0x5ca071(0xf3)]['has'](_0x44ac75)?_0x3b878e[_0x5ca071(0xd8)]=_0x44ac75:_0x3b878e[_0x5ca071(0xd8)]=_0x5b812a?.[_0x5ca071(0xd8)],_0x3b878e['datasetCode']=_0x52ee26,_0x3b878e['operationType']=_0x272685['operationType'],_0x3b878e[_0x5ca071(0xc5)]=_0x272685['functionNode'];}_0x5674f0[_0x5ca071(0xff)][_0x272685[_0x5ca071(0xc4)]]=_0x3b878e;}
|