@lovrabet/rabetbase-cli 2.1.7-beta.4 → 2.1.7-beta.5
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 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a19_0x53213a=a19_0x3a99;(function(_0x5d0fe1,_0x1f8195){const _0x1d9dcc=a19_0x3a99,_0x1d37c0=_0x5d0fe1();while(!![]){try{const _0x1e1a1c=-parseInt(_0x1d9dcc(0x1b3))/0x1*(parseInt(_0x1d9dcc(0x1ac))/0x2)+-parseInt(_0x1d9dcc(0x1be))/0x3*(-parseInt(_0x1d9dcc(0x1ad))/0x4)+-parseInt(_0x1d9dcc(0x1af))/0x5+parseInt(_0x1d9dcc(0x1ab))/0x6+-parseInt(_0x1d9dcc(0x1b6))/0x7*(-parseInt(_0x1d9dcc(0x1bb))/0x8)+-parseInt(_0x1d9dcc(0x1b4))/0x9*(parseInt(_0x1d9dcc(0x1ae))/0xa)+parseInt(_0x1d9dcc(0x1ba))/0xb;if(_0x1e1a1c===_0x1f8195)break;else _0x1d37c0['push'](_0x1d37c0['shift']());}catch(_0x4a78d9){_0x1d37c0['push'](_0x1d37c0['shift']());}}}(a19_0x2add,0xdd92c));import{listRemoteApps}from'../../core/api-client.js';function a19_0x2add(){const _0x49912a=['327292fTvYwj','11024EnryWq','10jbhHPs','5418000HznuRD','appName','appCode','read','8VWEfTc','943065FHyQVH','platform','28483LeaSGR','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','remote','map','20049766WQqfMN','96uqrXQl','cookie','appDesc','438jZawto','../../core/api-client.js','6787242iFIYmJ'];a19_0x2add=function(){return _0x49912a;};return a19_0x2add();}function a19_0x3a99(_0x290ac9,_0x45fa08){_0x290ac9=_0x290ac9-0x1ab;const _0x2adde7=a19_0x2add();let _0x3a9936=_0x2adde7[_0x290ac9];return _0x3a9936;}async function execute(_0x1db2ec){const _0x17a6be=a19_0x3a99,{setActiveCookie:_0xb46e0c}=await import(_0x17a6be(0x1bf));_0xb46e0c(_0x1db2ec[_0x17a6be(0x1bc)]);const _0x33cc29=await listRemoteApps();return{'ok':!![],'data':{'items':_0x33cc29[_0x17a6be(0x1b9)](_0x419588=>({..._0x419588['id']!=null?{'id':_0x419588['id']}:{},'appCode':_0x419588[_0x17a6be(0x1b1)],'appName':_0x419588[_0x17a6be(0x1b0)],..._0x419588[_0x17a6be(0x1bd)]!=null?{'appDesc':_0x419588[_0x17a6be(0x1bd)]}:{}})),'meta':{'source':_0x17a6be(0x1b5)}}};}export const appRemoteDefinition={'service':'app','command':a19_0x53213a(0x1b8),'description':a19_0x53213a(0x1b7),'risk':a19_0x53213a(0x1b2),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x23b7(){const _0xd784f1=['3124kFeIxT','23083125EujrkT','674tTatzq','39228MMUjMo','12BtXldG','316ZQqBXq','8070534xkMlTM','10zCvGgV','1049224OlJUZY','64JGPvCw','1851445zltvMt','21JLsPZm','177267yrRivE'];a20_0x23b7=function(){return _0xd784f1;};return a20_0x23b7();}(function(_0x5af35b,_0x371f49){const _0x1398c4=a20_0x5ce3,_0x53db22=_0x5af35b();while(!![]){try{const _0x4aeb48=parseInt(_0x1398c4(0xde))/0x1*(parseInt(_0x1398c4(0xe8))/0x2)+-parseInt(_0x1398c4(0xe5))/0x3*(parseInt(_0x1398c4(0xe2))/0x4)+parseInt(_0x1398c4(0xe3))/0x5*(-parseInt(_0x1398c4(0xdd))/0x6)+parseInt(_0x1398c4(0xe4))/0x7*(parseInt(_0x1398c4(0xe1))/0x8)+parseInt(_0x1398c4(0xdf))/0x9*(parseInt(_0x1398c4(0xe0))/0xa)+parseInt(_0x1398c4(0xe6))/0xb*(-parseInt(_0x1398c4(0xe9))/0xc)+parseInt(_0x1398c4(0xe7))/0xd;if(_0x4aeb48===_0x371f49)break;else _0x53db22['push'](_0x53db22['shift']());}catch(_0x5c761a){_0x53db22['push'](_0x53db22['shift']());}}}(a20_0x23b7,0x88350));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';function a20_0x5ce3(_0xa2453,_0x10013a){_0xa2453=_0xa2453-0xdd;const _0x23b72f=a20_0x23b7();let _0x5ce3fa=_0x23b72f[_0xa2453];return _0x5ce3fa;}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];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x21c4ca=a21_0x5472;(function(_0x3120e0,_0x5e399c){const _0x430d2a=a21_0x5472,_0x3467a0=_0x3120e0();while(!![]){try{const _0x51dfc4=parseInt(_0x430d2a(0x1f9))/0x1*(parseInt(_0x430d2a(0x211))/0x2)+parseInt(_0x430d2a(0x1f1))/0x3*(parseInt(_0x430d2a(0x1ec))/0x4)+-parseInt(_0x430d2a(0x1f2))/0x5+parseInt(_0x430d2a(0x201))/0x6*(parseInt(_0x430d2a(0x208))/0x7)+parseInt(_0x430d2a(0x1ff))/0x8+parseInt(_0x430d2a(0x203))/0x9*(-parseInt(_0x430d2a(0x1f8))/0xa)+-parseInt(_0x430d2a(0x1fe))/0xb*(parseInt(_0x430d2a(0x1f4))/0xc);if(_0x51dfc4===_0x5e399c)break;else _0x3467a0['push'](_0x3467a0['shift']());}catch(_0x2be58d){_0x3467a0['push'](_0x3467a0['shift']());}}}(a21_0x3161,0xc4b21));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';function a21_0x5472(_0x25a860,_0x39e4ba){_0x25a860=_0x25a860-0x1ec;const _0x316106=a21_0x3161();let _0x5472c1=_0x316106[_0x25a860];return _0x5472c1;}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x26fcfb,_0x1bb3de){const _0x3f2011=a21_0x5472,_0x4332af=[],_0x335c34=_0x26fcfb[_0x3f2011(0x20a)]&&typeof _0x26fcfb[_0x3f2011(0x20a)]==='object'?_0x26fcfb['apps']:{},_0x2a14ec=_0x26fcfb[_0x3f2011(0x1fc)]||undefined;for(const [_0x144719,_0x328eb9]of Object[_0x3f2011(0x202)](_0x335c34)){if(!_0x328eb9||typeof _0x328eb9!==_0x3f2011(0x20d)||!_0x328eb9['appcode'])continue;_0x4332af[_0x3f2011(0x207)]({'name':_0x144719,'appcode':_0x328eb9[_0x3f2011(0x214)],'named':!![],'definedIn':_0x1bb3de,'isDefault':_0x144719===_0x2a14ec,...buildAppProfileListFields(_0x328eb9)});}return _0x4332af;}function buildMergedItems(_0xea55ae,_0xa5c603){const _0xfd099=a21_0x5472,{apps:apps={},defaultApp:_0x48a8f9}=_0xea55ae,_0x3600cb=_0xa5c603['globalConfig'][_0xfd099(0x20a)]&&typeof _0xa5c603[_0xfd099(0x212)][_0xfd099(0x20a)]===_0xfd099(0x20d)?_0xa5c603[_0xfd099(0x212)][_0xfd099(0x20a)]:{},_0x14d64d=_0xa5c603[_0xfd099(0x1fb)][_0xfd099(0x20a)]&&typeof _0xa5c603[_0xfd099(0x1fb)][_0xfd099(0x20a)]===_0xfd099(0x20d)?_0xa5c603[_0xfd099(0x1fb)]['apps']:{},_0x35b2ab=_0xa5c603[_0xfd099(0x1fb)][_0xfd099(0x20e)]===![],_0x287dac=Object[_0xfd099(0x202)](apps),_0x5c6bea=_0x287dac[_0xfd099(0x1f5)](([_0x53c2bb,_0x5ae2f4])=>({'name':_0x53c2bb,'appcode':_0x5ae2f4['appcode'],'named':!![],'definedIn':appDefinedIn(_0x53c2bb,_0x3600cb,_0x14d64d,_0x35b2ab),'isDefault':_0x53c2bb===_0x48a8f9,...buildAppProfileListFields(_0x5ae2f4)}));return _0x5c6bea;}function a21_0x3161(){const _0x4e6c37=['entries','1503OlJrxC','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','merged','No\x20apps\x20configured','push','14wyLXra','global','apps','length','app','object','inherit','\x20in\x20','read','1966oRVLgc','globalConfig','globalPath','appcode','\x20config','6772vACUfo','boolean','projectPath','find','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','2853XpSKpA','5118820MXheFn','project','600jHzbWk','map','isCurrent','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','84520tBDqZY','398NLxpxy','bool','projectConfig','defaultApp','List\x20all\x20configured\x20apps','91652KpNKdZ','11280176ggOVia','.\x20Use\x20`','738642TCTaan'];a21_0x3161=function(){return _0x4e6c37;};return a21_0x3161();}async function execute(_0x535b37){const _0x366ec9=a21_0x5472,_0x27f2ff=_0x535b37[_0x366ec9(0x1fa)](_0x366ec9(0x209)),_0x1773cc=_0x535b37[_0x366ec9(0x1fa)]('project'),_0x439b02=_0x27f2ff?_0x366ec9(0x209):_0x1773cc?_0x366ec9(0x1f3):_0x366ec9(0x205),{config:_0x2fec8c,layers:_0x187ce8}=readRawConfigWithLayers(),_0x2d5823=resolveDefaultAppSource(_0x187ce8),{defaultApp:_0x3d85a6}=_0x2fec8c;let _0x19fc54,_0x4a3b0f;switch(_0x439b02){case _0x366ec9(0x209):_0x19fc54=buildItemsFromLayer(_0x187ce8[_0x366ec9(0x212)],'global'),_0x4a3b0f=_0x187ce8[_0x366ec9(0x213)];break;case _0x366ec9(0x1f3):_0x19fc54=buildItemsFromLayer(_0x187ce8['projectConfig'],'project'),_0x4a3b0f=_0x187ce8[_0x366ec9(0x1ee)];break;default:_0x19fc54=buildMergedItems(_0x2fec8c,_0x187ce8);break;}enrichAppListItemsWithMergedSelection(_0x19fc54,_0x535b37['mergedCli']);if(_0x19fc54[_0x366ec9(0x20b)]===0x0){const _0x11358a=_0x439b02===_0x366ec9(0x205)?'':_0x366ec9(0x20f)+_0x439b02+_0x366ec9(0x215);return{'ok':!![],'data':[],'message':_0x366ec9(0x206)+_0x11358a+_0x366ec9(0x200)+CLI_BIN_NAME+_0x366ec9(0x1f0)};}const _0x25b569=_0x19fc54[_0x366ec9(0x1ef)](_0x4e034d=>_0x4e034d[_0x366ec9(0x1f6)]===!![]),_0x4b2037=_0x3d85a6??_0x25b569?.[_0x366ec9(0x214)]??null,_0x333fd7=_0x439b02===_0x366ec9(0x205)?{'globalPath':_0x187ce8[_0x366ec9(0x213)]??null,'projectPath':_0x187ce8[_0x366ec9(0x1ee)]??null,'defaultApp':_0x4b2037,'defaultAppSource':_0x3d85a6!=null?_0x2d5823:null}:{'scope':_0x439b02,'configPath':_0x4a3b0f??null};return{'ok':!![],'data':{'items':_0x19fc54,'meta':_0x333fd7}};}export const appListDefinition={'service':a21_0x21c4ca(0x20c),'command':'list','description':a21_0x21c4ca(0x1fd),'risk':a21_0x21c4ca(0x210),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x21c4ca(0x209),'type':a21_0x21c4ca(0x1ed),'description':a21_0x21c4ca(0x204),'default':![]},{'name':'project','type':a21_0x21c4ca(0x1ed),'description':a21_0x21c4ca(0x1f7),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a22_0x384971=a22_0xe179;(function(_0x43449b,_0x592bcc){const _0x9363d5=a22_0xe179,_0x1f39d7=_0x43449b();while(!![]){try{const _0x450429=-parseInt(_0x9363d5(0x121))/0x1*(parseInt(_0x9363d5(0x136))/0x2)+parseInt(_0x9363d5(0x12b))/0x3+parseInt(_0x9363d5(0x11a))/0x4+-parseInt(_0x9363d5(0x138))/0x5+-parseInt(_0x9363d5(0x127))/0x6*(-parseInt(_0x9363d5(0x124))/0x7)+parseInt(_0x9363d5(0x117))/0x8*(-parseInt(_0x9363d5(0x12d))/0x9)+-parseInt(_0x9363d5(0x119))/0xa;if(_0x450429===_0x592bcc)break;else _0x1f39d7['push'](_0x1f39d7['shift']());}catch(_0x55213a){_0x1f39d7['push'](_0x1f39d7['shift']());}}}(a22_0x4c9d,0x78a51));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';async function validateArgs(_0x20c8e9){const _0x3f92ec=a22_0xe179,_0x442aa9=_0x20c8e9[_0x3f92ec(0x125)][0x0]?.['trim']();if(!_0x442aa9)throw CliErrors['validation']('Missing\x20app\x20name.',_0x3f92ec(0x135)+CLI_BIN_NAME+_0x3f92ec(0x137));}function a22_0x4c9d(){const _0x5bd6b2=['35196SPFHUS','defaultApp','\x22\x20still\x20defined\x20in\x20','Removed\x20app\x20\x22','2646957WmnPfL','Use\x20global\x20config\x20scope','75249pbDElB','both','bool','name','\x20Note:\x20app\x20\x22','project','Remove\x20an\x20app\x20from\x20config','App\x20\x22','Usage:\x20','2QIsWmT','\x20app\x20remove\x20<name>\x20[--global]','932530EdDixF','boolean','\x22\x20not\x20found.','\x20config.','projectConfig','object','56Vgaevh','remove','3300280ouOBNl','239568FUEVFf','global','high-risk-write','\x20Default\x20app\x20changed\x20to\x20\x22','App\x20profile\x20name\x20to\x20remove','inherit','length','705961LTqjEb','trim','globalConfig','994paecUb','args','apps'];a22_0x4c9d=function(){return _0x5bd6b2;};return a22_0x4c9d();}async function execute(_0x48baf1){const _0x2f9bd5=a22_0xe179,_0x4eb70f=_0x48baf1[_0x2f9bd5(0x125)][0x0]?.[_0x2f9bd5(0x122)]();if(!_0x4eb70f)throw CliErrors['validation']('Missing\x20app\x20name.',_0x2f9bd5(0x135)+CLI_BIN_NAME+_0x2f9bd5(0x137));const _0x2ae976=_0x48baf1[_0x2f9bd5(0x12f)]('global'),{config:_0x5d9bf6,layers:_0x452142}=readRawConfigWithLayers(),_0xb4b5e7=_0x5d9bf6[_0x2f9bd5(0x126)]??{};if(!_0xb4b5e7[_0x4eb70f])throw CliErrors['validation'](_0x2f9bd5(0x134)+_0x4eb70f+_0x2f9bd5(0x13a));const _0x4a15bf=_0x452142[_0x2f9bd5(0x123)]['apps']&&typeof _0x452142[_0x2f9bd5(0x123)][_0x2f9bd5(0x126)]===_0x2f9bd5(0x13d)?_0x452142[_0x2f9bd5(0x123)]['apps']:{},_0x429bfe=_0x452142[_0x2f9bd5(0x13c)][_0x2f9bd5(0x126)]&&typeof _0x452142[_0x2f9bd5(0x13c)]['apps']==='object'?_0x452142['projectConfig']['apps']:{},_0x1a276e=appDefinedIn(_0x4eb70f,_0x4a15bf,_0x429bfe,_0x452142[_0x2f9bd5(0x13c)][_0x2f9bd5(0x11f)]===![]),_0x1c45c9=resolveAppScopeForWrite(_0x4eb70f,_0x2ae976,_0x452142),_0xa7665c={'global':_0x1c45c9===_0x2f9bd5(0x11b)},_0x104dee=readConfig(_0xa7665c),_0xf0bebc=_0x104dee[_0x2f9bd5(0x126)];if(!_0xf0bebc||!_0xf0bebc[_0x4eb70f])throw CliErrors['validation']('App\x20\x22'+_0x4eb70f+'\x22\x20not\x20found.');delete _0xf0bebc[_0x4eb70f];let _0x127c1b='';if(_0x104dee['defaultApp']===_0x4eb70f){const _0x16a5fe=Object['keys'](_0xf0bebc);_0x104dee[_0x2f9bd5(0x128)]=_0x16a5fe[_0x2f9bd5(0x120)]>0x0?_0x16a5fe[0x0]:undefined,_0x104dee[_0x2f9bd5(0x128)]?_0x127c1b=_0x2f9bd5(0x11d)+_0x104dee[_0x2f9bd5(0x128)]+'\x22.':delete _0x104dee[_0x2f9bd5(0x128)];}Object['keys'](_0xf0bebc)[_0x2f9bd5(0x120)]===0x0&&(delete _0x104dee[_0x2f9bd5(0x126)],delete _0x104dee[_0x2f9bd5(0x128)]);writeConfig(_0x104dee,_0xa7665c);const _0x14217b=_0x1a276e===_0x2f9bd5(0x12e)?_0x2f9bd5(0x131)+_0x4eb70f+_0x2f9bd5(0x129)+(_0x1c45c9===_0x2f9bd5(0x132)?_0x2f9bd5(0x11b):_0x2f9bd5(0x132))+_0x2f9bd5(0x13b):'';return{'ok':!![],'message':_0x2f9bd5(0x12a)+_0x4eb70f+'\x22'+scopeLabel(_0xa7665c)+'.'+_0x127c1b+_0x14217b};}function a22_0xe179(_0x488a2b,_0x111942){_0x488a2b=_0x488a2b-0x117;const _0x4c9d59=a22_0x4c9d();let _0xe179ee=_0x4c9d59[_0x488a2b];return _0xe179ee;}export const appRemoveDefinition={'service':'app','command':a22_0x384971(0x118),'description':a22_0x384971(0x133),'risk':a22_0x384971(0x11c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x384971(0x130),'description':a22_0x384971(0x11e),'required':!![]}],'flags':[{'name':'global','type':a22_0x384971(0x139),'description':a22_0x384971(0x12c),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a23_0x15b4(_0x1b2e6c,_0x8ce26){_0x1b2e6c=_0x1b2e6c-0x6b;const _0x682108=a23_0x6821();let _0x15b4cd=_0x682108[_0x1b2e6c];return _0x15b4cd;}(function(_0x273255,_0x163411){const _0x5eb96b=a23_0x15b4,_0x5cec04=_0x273255();while(!![]){try{const _0x3bbfff=-parseInt(_0x5eb96b(0x6f))/0x1+-parseInt(_0x5eb96b(0x76))/0x2*(-parseInt(_0x5eb96b(0x85))/0x3)+-parseInt(_0x5eb96b(0x84))/0x4*(parseInt(_0x5eb96b(0x74))/0x5)+-parseInt(_0x5eb96b(0x7e))/0x6*(-parseInt(_0x5eb96b(0x89))/0x7)+parseInt(_0x5eb96b(0x73))/0x8+parseInt(_0x5eb96b(0x88))/0x9+parseInt(_0x5eb96b(0x70))/0xa*(-parseInt(_0x5eb96b(0x7a))/0xb);if(_0x3bbfff===_0x163411)break;else _0x5cec04['push'](_0x5cec04['shift']());}catch(_0x3f3d50){_0x5cec04['push'](_0x5cec04['shift']());}}}(a23_0x6821,0x55da4));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x224b2a,_0x6e3bac){const _0x193903=a23_0x15b4;if(!_0x6e3bac)return;const _0x5a763e=_0x6e3bac[_0x193903(0x82)]&&typeof _0x6e3bac[_0x193903(0x82)]==='object'?_0x6e3bac[_0x193903(0x82)]:{},_0x4b3860=Object[_0x193903(0x86)](_0x5a763e)[_0x193903(0x6e)]>0x0;for(const _0x4f3588 of _0x224b2a){_0x4f3588[_0x193903(0x83)]=![];}const _0x5068f0=_0x6e3bac[_0x193903(0x6b)]!=null?String(_0x6e3bac[_0x193903(0x6b)])[_0x193903(0x71)]():'';if(_0x4b3860){const _0x55ba63=_0x6e3bac[_0x193903(0x77)]??_0x6e3bac['defaultApp'];if(_0x55ba63)for(const _0x294642 of _0x224b2a){_0x294642[_0x193903(0x75)]===!![]&&_0x294642[_0x193903(0x80)]===_0x55ba63&&(_0x294642[_0x193903(0x83)]=!![]);}for(const _0x2ec861 of _0x224b2a){if(_0x2ec861[_0x193903(0x75)]!==![])continue;if(_0x6e3bac[_0x193903(0x72)])continue;_0x5068f0&&String(_0x2ec861[_0x193903(0x7d)]??'')['trim']()===_0x5068f0&&(_0x2ec861[_0x193903(0x83)]=!![]);}return;}if(!_0x5068f0)return;for(const _0x4719e2 of _0x224b2a){String(_0x4719e2[_0x193903(0x7d)]??'')['trim']()===_0x5068f0&&(_0x4719e2[_0x193903(0x83)]=!![]);}}function a23_0x6821(){const _0xa44e44=['hasOwnProperty','call','length','132382ioLDct','41190zlJhkw','trim','defaultApp','1766168cspxcu','5mWCPTW','named','6258JcJgSQ','currentApp','globalConfig','projectConfig','1177PxnQvg','project','\x20(global)','appcode','4007202MiyBrb','global','name','object','apps','isCurrent','967540CVpWwh','258YGUeVn','keys','prototype','80280IrSOdL','7rJFrDG','appCode'];a23_0x6821=function(){return _0xa44e44;};return a23_0x6821();}export function resolveAppScopeForWrite(_0x338b92,_0x505d6c,_0x19e0d6){const _0x35380e=a23_0x15b4;if(_0x505d6c)return _0x35380e(0x7f);const _0x41d6e2=_0x19e0d6[_0x35380e(0x79)]['apps']&&typeof _0x19e0d6[_0x35380e(0x79)]['apps']==='object'?_0x19e0d6['projectConfig'][_0x35380e(0x82)]:{},_0x2381f7=_0x19e0d6[_0x35380e(0x78)][_0x35380e(0x82)]&&typeof _0x19e0d6['globalConfig'][_0x35380e(0x82)]===_0x35380e(0x81)?_0x19e0d6['globalConfig'][_0x35380e(0x82)]:{};if(Object[_0x35380e(0x87)]['hasOwnProperty'][_0x35380e(0x6d)](_0x41d6e2,_0x338b92))return _0x35380e(0x7b);if(Object[_0x35380e(0x87)][_0x35380e(0x6c)][_0x35380e(0x6d)](_0x2381f7,_0x338b92))return _0x35380e(0x7f);return _0x35380e(0x7b);}export function appDefinedIn(_0x4093f5,_0x2a010c,_0x4eb9bc,_0x4acac8){const _0x148951=a23_0x15b4;if(_0x4acac8)return Object[_0x148951(0x87)][_0x148951(0x6c)][_0x148951(0x6d)](_0x4eb9bc,_0x4093f5)?'project':_0x148951(0x7f);const _0x2fa07d=Object[_0x148951(0x87)]['hasOwnProperty'][_0x148951(0x6d)](_0x2a010c,_0x4093f5),_0x284aed=Object[_0x148951(0x87)]['hasOwnProperty']['call'](_0x4eb9bc,_0x4093f5);if(_0x2fa07d&&_0x284aed)return'both';if(_0x284aed)return _0x148951(0x7b);return _0x148951(0x7f);}export function resolveDefaultAppSource(_0x4d043a){const _0x49c897=a23_0x15b4,_0x2ebec3=_0x4d043a[_0x49c897(0x79)]['apps']&&typeof _0x4d043a[_0x49c897(0x79)][_0x49c897(0x82)]===_0x49c897(0x81)?_0x4d043a[_0x49c897(0x79)]['apps']:{};if('defaultApp'in _0x4d043a['projectConfig'])return _0x49c897(0x7b);if(Object[_0x49c897(0x86)](_0x2ebec3)[_0x49c897(0x6e)]>0x0)return _0x49c897(0x7b);if(_0x4d043a[_0x49c897(0x79)]['inherit']===![])return null;if(_0x4d043a['globalConfig'][_0x49c897(0x72)])return _0x49c897(0x7f);return null;}export function getConfigPath(_0x3194ae={}){const _0x78da30=a23_0x15b4,_0x70079=_0x3194ae[_0x78da30(0x7f)]?_0x78da30(0x7f):'project';return resolveWriteConfigPath(_0x70079);}export function readConfig(_0x5aa660={}){return readConfigFile(getConfigPath(_0x5aa660));}export function writeConfig(_0x235b8c,_0x187b12={}){writeConfigFile(getConfigPath(_0x187b12),_0x235b8c);}export function scopeLabel(_0x16e282){const _0x5adc8e=a23_0x15b4;return _0x16e282['global']?_0x5adc8e(0x7c):'';}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x24a55a=a24_0x5a02;(function(_0x2d308f,_0x560a6b){const _0x5314e6=a24_0x5a02,_0x234e2a=_0x2d308f();while(!![]){try{const _0x472b0a=-parseInt(_0x5314e6(0x133))/0x1*(-parseInt(_0x5314e6(0x138))/0x2)+-parseInt(_0x5314e6(0x14b))/0x3*(parseInt(_0x5314e6(0x12d))/0x4)+-parseInt(_0x5314e6(0x137))/0x5*(parseInt(_0x5314e6(0x144))/0x6)+-parseInt(_0x5314e6(0x140))/0x7*(parseInt(_0x5314e6(0x145))/0x8)+-parseInt(_0x5314e6(0x132))/0x9+parseInt(_0x5314e6(0x147))/0xa+-parseInt(_0x5314e6(0x149))/0xb*(-parseInt(_0x5314e6(0x128))/0xc);if(_0x472b0a===_0x560a6b)break;else _0x234e2a['push'](_0x234e2a['shift']());}catch(_0x15c74b){_0x234e2a['push'](_0x234e2a['shift']());}}}(a24_0x1ad5,0x9b5eb));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';function a24_0x1ad5(){const _0x271e61=['\x20--appcode\x20<code>`\x20first.','trim','30WbnBTm','490712AtLSCj','\x20app\x20use\x20<name>\x20[--global]','10179760IbLRrI','object','81455CnLsPr','use','48Qltsnn','keys','args','Use\x20global\x20config\x20scope','24OYpbSg','App\x20profile\x20name\x20to\x20activate','App\x20\x22','length','call','44916entznD','global','join','\x22\x20not\x20found.','Switch\x20the\x20default\x20app','9374157iyodnE','1313ayVWDp','validation','Missing\x20app\x20name.','Usage:\x20','65740vCXinU','1450HwQgfs','projectPath','app','appcode','prototype','apps','\x20app\x20add\x20','write','7hBvrJk','boolean'];a24_0x1ad5=function(){return _0x271e61;};return a24_0x1ad5();}import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';function a24_0x5a02(_0x1720f9,_0x1a10ad){_0x1720f9=_0x1720f9-0x127;const _0x1ad5f9=a24_0x1ad5();let _0x5a026e=_0x1ad5f9[_0x1720f9];return _0x5a026e;}async function validateArgs(_0xa23d03){const _0x1bfdde=a24_0x5a02,_0x33c213=_0xa23d03[_0x1bfdde(0x14d)][0x0]?.[_0x1bfdde(0x143)]();if(!_0x33c213)throw CliErrors['validation'](_0x1bfdde(0x135),_0x1bfdde(0x136)+CLI_BIN_NAME+_0x1bfdde(0x146));}async function execute(_0x5ef0f6){const _0x5c6b22=a24_0x5a02,_0xc1ce5b=_0x5ef0f6['args'][0x0]?.[_0x5c6b22(0x143)]();if(!_0xc1ce5b)throw CliErrors[_0x5c6b22(0x134)](_0x5c6b22(0x135),_0x5c6b22(0x136)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const _0x400504=_0x5ef0f6['bool'](_0x5c6b22(0x12e)),{config:_0x5d0a16,layers:_0x1eb9f3}=readRawConfigWithLayers(),_0x5f3a64=_0x5d0a16[_0x5c6b22(0x13d)]??{};if(!_0x5f3a64[_0xc1ce5b]){const _0x1af3de=Object[_0x5c6b22(0x14c)](_0x5f3a64),_0x9d23=_0x1af3de[_0x5c6b22(0x12b)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x5c6b22(0x13e)+_0xc1ce5b+_0x5c6b22(0x142):'Available:\x20'+_0x1af3de[_0x5c6b22(0x12f)](',\x20');throw CliErrors[_0x5c6b22(0x134)](_0x5c6b22(0x12a)+_0xc1ce5b+_0x5c6b22(0x130),_0x9d23);}let _0x825f2f,_0x4b9bb5='';if(_0x400504)_0x825f2f={'global':!![]};else{const _0x2cade1=isInProject()&&!!_0x1eb9f3[_0x5c6b22(0x139)];_0x825f2f={'global':!_0x2cade1};if(_0x2cade1){const _0x67930c=_0x1eb9f3['projectConfig']['apps']&&typeof _0x1eb9f3['projectConfig'][_0x5c6b22(0x13d)]===_0x5c6b22(0x148)?_0x1eb9f3['projectConfig'][_0x5c6b22(0x13d)]:{};!Object[_0x5c6b22(0x13c)]['hasOwnProperty'][_0x5c6b22(0x12c)](_0x67930c,_0xc1ce5b)&&(_0x4b9bb5='\x0aNote:\x20\x22'+_0xc1ce5b+'\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.');}}const _0x31379f=readConfig(_0x825f2f);return _0x31379f['defaultApp']=_0xc1ce5b,writeConfig(_0x31379f,_0x825f2f),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0xc1ce5b+'\x22\x20(appcode:\x20'+_0x5f3a64[_0xc1ce5b][_0x5c6b22(0x13b)]+')'+scopeLabel(_0x825f2f)+_0x4b9bb5};}export const appUseDefinition={'service':a24_0x24a55a(0x13a),'command':a24_0x24a55a(0x14a),'description':a24_0x24a55a(0x131),'risk':a24_0x24a55a(0x13f),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a24_0x24a55a(0x129),'required':!![]}],'flags':[{'name':a24_0x24a55a(0x12e),'type':a24_0x24a55a(0x141),'description':a24_0x24a55a(0x127),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a25_0x487b(){const _0x3e3b8b=['logout','auth','../../auth/auth-server-ui.js','write','4HiAGTN','boolean','Clear\x20login\x20session','4567959pUNyrj','2EzxdTs','read','yes','665378ITyZMw','bool','8581050jtHXia','3057315Trgtcu','!\x20Not\x20logged\x20in','3936792DEyTXP','818721IjHFUq','log','nonInteractive','1246854JPvjog','40VAigmq','48uuOYXA'];a25_0x487b=function(){return _0x3e3b8b;};return a25_0x487b();}const a25_0x10726a=a25_0x1ac9;(function(_0x281efa,_0x176516){const _0x2250cf=a25_0x1ac9,_0x421d0a=_0x281efa();while(!![]){try{const _0x539418=-parseInt(_0x2250cf(0x100))/0x1+parseInt(_0x2250cf(0xf4))/0x2*(parseInt(_0x2250cf(0xfc))/0x3)+parseInt(_0x2250cf(0xf0))/0x4*(parseInt(_0x2250cf(0xfa))/0x5)+parseInt(_0x2250cf(0x102))/0x6*(-parseInt(_0x2250cf(0xf7))/0x7)+-parseInt(_0x2250cf(0x101))/0x8*(parseInt(_0x2250cf(0xfd))/0x9)+parseInt(_0x2250cf(0xf9))/0xa+parseInt(_0x2250cf(0xf3))/0xb;if(_0x539418===_0x176516)break;else _0x421d0a['push'](_0x421d0a['shift']());}catch(_0x5d4010){_0x421d0a['push'](_0x421d0a['shift']());}}}(a25_0x487b,0xb36fa));function a25_0x1ac9(_0x4973db,_0x4251c9){_0x4973db=_0x4973db-0xed;const _0x487b0f=a25_0x487b();let _0x1ac9e8=_0x487b0f[_0x4973db];return _0x1ac9e8;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a25_0x10726a(0xed),'command':'login','description':'Login\x20via\x20browser','risk':a25_0x10726a(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a25_0x10726a(0xf6),'type':a25_0x10726a(0xf1),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0xbaa911){const _0xffd414=a25_0x10726a,{runAuthServer:_0x59eef1}=await import(_0xffd414(0xee));return await _0x59eef1({'autoYes':_0xbaa911[_0xffd414(0xf8)](_0xffd414(0xf6)),'nonInteractive':_0xbaa911[_0xffd414(0xff)]}),{'ok':!![]};}},{'service':a25_0x10726a(0xed),'command':a25_0x10726a(0x103),'description':a25_0x10726a(0xf2),'risk':a25_0x10726a(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x193173){const _0x1bcf75=a25_0x10726a;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1bcf75(0xfe)]('✓\x20Logged\x20out')):console[_0x1bcf75(0xfe)](_0x1bcf75(0xfb)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a26_0x30f1(){const _0x37ae01=['COMMON','trim','after','functionNode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','length','operationType','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','bff','alias','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','4620gfYByI','type','File\x20already\x20exists:\x20','apiDir','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','name','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','create','str','5083904efxtmm','\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','Trigger\x20node\x20(HOOK\x20only)','.js','No\x20api.ts\x20found.\x20Run\x20`','Invalid\x20dataset\x20selection.','ENDPOINT','Select\x20dataset:','code','before','isInteger','.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','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','15658146lkHwBN','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Operation\x20type\x20\x22','118317eEshgK','9300NTYumb','datasetcode','datasetCode','Available\x20aliases:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','76855GpKshB','scriptsRootDir','function-node','validation','HOOK','description','Function\x20name\x20(valid\x20JS\x20identifier)','\x20function:\x20','stderr','164zKJMvm','appCode','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\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','nonInteractive','string','join','parseInt','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','map','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Alias\x20\x22','720748oktSSN','No\x20datasets\x20found\x20for\x20this\x20app.','operation-type','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','\x22\x20not\x20found.\x20','Available:\x20','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','9947288uTGTrD','\x20api\x20pull`\x20to\x20refresh.','close','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','write','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Script\x20type','find'];a26_0x30f1=function(){return _0x37ae01;};return a26_0x30f1();}const a26_0x490b47=a26_0x128f;(function(_0x1da032,_0x514c23){const _0x295dcf=a26_0x128f,_0x344ae6=_0x1da032();while(!![]){try{const _0x407006=parseInt(_0x295dcf(0x12c))/0x1+parseInt(_0x295dcf(0xee))/0x2+-parseInt(_0x295dcf(0x125))/0x3*(-parseInt(_0x295dcf(0xe2))/0x4)+parseInt(_0x295dcf(0x126))/0x5*(-parseInt(_0x295dcf(0x10b))/0x6)+parseInt(_0x295dcf(0x114))/0x7+parseInt(_0x295dcf(0xf6))/0x8+-parseInt(_0x295dcf(0x122))/0x9;if(_0x407006===_0x514c23)break;else _0x344ae6['push'](_0x344ae6['shift']());}catch(_0x2f9932){_0x344ae6['push'](_0x344ae6['shift']());}}}(a26_0x30f1,0xcffcd));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a26_0x128f(_0x59f90a,_0x2b8b2e){_0x59f90a=_0x59f90a-0xda;const _0x30f11b=a26_0x30f1();let _0x128f4f=_0x30f11b[_0x59f90a];return _0x128f4f;}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_0x490b47(0x108),'command':a26_0x490b47(0x112),'description':a26_0x490b47(0xfa),'risk':'write','flags':[{'name':a26_0x490b47(0x10c),'type':'string','required':!![],'enum':[a26_0x490b47(0xff),a26_0x490b47(0x11a),a26_0x490b47(0xdd)],'description':a26_0x490b47(0xfd)},{'name':'name','type':a26_0x490b47(0xe7),'required':!![],'description':a26_0x490b47(0xdf)},{'name':a26_0x490b47(0xde),'type':a26_0x490b47(0xe7),'description':'Script\x20description'},{'name':a26_0x490b47(0x109),'type':a26_0x490b47(0xe7),'description':a26_0x490b47(0x107)},{'name':'datasetcode','type':'string','description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':'operation-type','type':a26_0x490b47(0xe7),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a26_0x490b47(0xdb),'type':a26_0x490b47(0xe7),'description':a26_0x490b47(0x116),'enum':[a26_0x490b47(0x11d),a26_0x490b47(0x101)]}],async 'validate'(_0x1140c1){const _0x438784=a26_0x490b47,_0x436915=_0x1140c1[_0x438784(0x113)](_0x438784(0x110));if(!isValidBffFunctionName(_0x436915))throw CliErrors[_0x438784(0xdc)]('Invalid\x20function\x20name\x20\x22'+_0x436915+_0x438784(0x111));},async 'execute'(_0x14029b){const _0x5016e8=a26_0x490b47,_0x5df287=loadBffProjectConfig(_0x14029b[_0x5016e8(0xe3)]),_0x2fb1cf=_0x14029b[_0x5016e8(0x113)]('type'),_0xb7b951=_0x14029b[_0x5016e8(0x113)](_0x5016e8(0x110)),_0x343b79=_0x14029b['str'](_0x5016e8(0xde))||undefined,_0x5dc177=_0x2fb1cf==='HOOK'?await resolveHookOptions(_0x5df287,_0x14029b):undefined,_0x4a6d79=buildFilePath(_0x5df287,_0x2fb1cf,_0xb7b951,_0x5dc177);if(await fileExists(_0x4a6d79))throw CliErrors[_0x5016e8(0xdc)](_0x5016e8(0x10d)+_0x4a6d79);await mkdir(dirname(_0x4a6d79),{'recursive':!![]});const _0x305468=generateTemplate(_0x2fb1cf,_0xb7b951,_0x14029b[_0x5016e8(0xe3)],_0x343b79,_0x5dc177);await writeFile(_0x4a6d79,_0x305468,_0x5016e8(0x104));const _0x57850d={'type':_0x2fb1cf,'name':_0xb7b951,'path':_0x4a6d79};if(_0x343b79)_0x57850d[_0x5016e8(0xde)]=_0x343b79;if(_0x5dc177){if(_0x5dc177['alias'])_0x57850d['alias']=_0x5dc177['alias'];_0x57850d['datasetCode']=_0x5dc177['datasetCode'],_0x57850d['operationType']=_0x5dc177[_0x5016e8(0x106)],_0x57850d['functionNode']=_0x5dc177[_0x5016e8(0x102)];}return{'ok':!![],'data':_0x57850d,'message':'Created\x20'+_0x2fb1cf+_0x5016e8(0xe0)+_0xb7b951};}};async function resolveHookOptions(_0x52dfbf,_0x4982c1){const _0x280dc6=a26_0x490b47,_0x387141=loadAliasMap(_0x4982c1['apiDir'],undefined,resolveApiFilePath(_0x4982c1[_0x280dc6(0x10e)],_0x4982c1[_0x280dc6(0xe3)])),_0x3b54d2=_0x387141[_0x280dc6(0x105)]>0x0;let _0x44d002,_0x322823,_0x404a09;const _0x544b78=_0x4982c1['str']('alias'),_0x40acc7=_0x4982c1[_0x280dc6(0x113)](_0x280dc6(0x127));if(_0x544b78){const _0x4f2599=resolveAlias(_0x4982c1[_0x280dc6(0x10e)],_0x544b78,undefined,resolveApiFilePath(_0x4982c1[_0x280dc6(0x10e)],_0x4982c1[_0x280dc6(0xe3)]));if(!_0x4f2599){const _0x41eae8=_0x3b54d2?_0x280dc6(0x129)+_0x387141[_0x280dc6(0xeb)](_0x10df1f=>_0x10df1f['alias'])[_0x280dc6(0xe8)](',\x20'):_0x280dc6(0x118)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0xed)+_0x544b78+_0x280dc6(0xf3)+_0x41eae8);}_0x44d002=_0x544b78,_0x322823=_0x4f2599;}else{if(_0x40acc7){_0x322823=_0x40acc7;const _0x3e922b=_0x387141[_0x280dc6(0xfe)](_0x43d7d8=>_0x43d7d8[_0x280dc6(0x128)]===_0x40acc7);_0x44d002=_0x3e922b?.['alias'];}else{if(_0x4982c1[_0x280dc6(0xe6)])throw CliErrors['validation'](_0x280dc6(0x103));else{if(_0x3b54d2){const _0x401ae5=_0x387141[_0x280dc6(0xeb)](_0x2be684=>_0x2be684[_0x280dc6(0x109)]+'\x20('+_0x2be684['tableName']+')'),_0x14cc48=await promptSelect(_0x280dc6(0x11b),_0x401ae5),_0x61fc7=_0x387141[_0x14cc48];if(!_0x61fc7)throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0x119));_0x44d002=_0x61fc7[_0x280dc6(0x109)],_0x322823=_0x61fc7['datasetCode'];}else{const _0x2d034e=await listDatasets(_0x4982c1['appCode']);if(_0x2d034e[_0x280dc6(0x105)]===0x0)throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0xef));const _0x32d514=_0x2d034e[_0x280dc6(0xeb)](_0x29ebc9=>_0x29ebc9[_0x280dc6(0x110)]+'\x20('+_0x29ebc9[_0x280dc6(0x11c)]+')'),_0x3f0553=await promptSelect('Select\x20dataset:',_0x32d514),_0x1edc30=_0x2d034e[_0x3f0553];if(!_0x1edc30)throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0x119));_0x322823=_0x1edc30[_0x280dc6(0x11c)],_0x44d002=undefined;}}}}const _0x56f1bd=await listDatasets(_0x4982c1[_0x280dc6(0xe3)]),_0x383c7c=_0x56f1bd[_0x280dc6(0xfe)](_0x1b17d7=>_0x1b17d7[_0x280dc6(0x11c)]===_0x322823);if(!_0x383c7c)throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0x12b)+_0x322823+'\x22.\x20'+(_0x44d002?_0x280dc6(0x121)+CLI_BIN_NAME+_0x280dc6(0xf7):''));_0x404a09=_0x383c7c['id'];const _0x289e41=_0x44d002??_0x322823,_0x4e5ef6=await listBffDatasetOperations(_0x4982c1['appCode'],_0x404a09),_0x4ebc98=_0x4e5ef6?Object['keys'](_0x4e5ef6):[];if(_0x4ebc98[_0x280dc6(0x105)]===0x0)throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0xec)+_0x289e41+'.');let _0x39a1ec;const _0x13dfb3=_0x4982c1[_0x280dc6(0x113)](_0x280dc6(0xf0));if(_0x13dfb3){if(!_0x4ebc98['includes'](_0x13dfb3))throw CliErrors['validation'](_0x280dc6(0x124)+_0x13dfb3+_0x280dc6(0x12a)+_0x289e41+'.\x20'+(_0x280dc6(0xf4)+_0x4ebc98[_0x280dc6(0xe8)](',\x20')));_0x39a1ec=_0x13dfb3;}else{if(_0x4982c1[_0x280dc6(0xe6)])throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0x120));const _0x5b64cb=await promptSelect('Select\x20operation\x20type:',_0x4ebc98);_0x39a1ec=_0x4ebc98[_0x5b64cb]??_0x4ebc98[0x0];}let _0x2c4a30=normalizeHookFunctionNode(_0x4982c1[_0x280dc6(0x113)]('function-node'));if(!_0x2c4a30){if(_0x4982c1['str']('function-node'))throw CliErrors[_0x280dc6(0xdc)](_0x280dc6(0x123));if(_0x4982c1[_0x280dc6(0xe6)])throw CliErrors[_0x280dc6(0xdc)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5837c7=await promptSelect('Select\x20trigger\x20node:',['before',_0x280dc6(0x101)]);_0x2c4a30=[_0x280dc6(0x11d),_0x280dc6(0x101)][_0x5837c7]??_0x280dc6(0x11d);}return{'alias':_0x44d002,'datasetCode':_0x322823,'datasetId':_0x404a09,'operationType':_0x39a1ec,'functionNode':_0x2c4a30};}async function promptSelect(_0x476b37,_0x5dc616){const _0x5bd357=a26_0x490b47;if(_0x5dc616[_0x5bd357(0x105)]===0x1)return 0x0;for(const [_0x58766e,_0x19d24c]of _0x5dc616['entries']()){process['stderr'][_0x5bd357(0xfb)]('\x20\x20'+(_0x58766e+0x1)+'.\x20'+_0x19d24c+'\x0a');}const _0x3ce4de=createInterface({'input':process[_0x5bd357(0xf2)],'output':process[_0x5bd357(0xe1)]});while(!![]){const _0x33bc24=await new Promise(_0x46541b=>{_0x3ce4de['question'](_0x476b37+'\x20',_0x46541b);}),_0x5c3e23=Number[_0x5bd357(0xe9)](_0x33bc24[_0x5bd357(0x100)](),0xa);if(Number[_0x5bd357(0x11e)](_0x5c3e23)&&_0x5c3e23>=0x1&&_0x5c3e23<=_0x5dc616[_0x5bd357(0x105)])return _0x3ce4de[_0x5bd357(0xf8)](),_0x5c3e23-0x1;process[_0x5bd357(0xe1)][_0x5bd357(0xfb)](_0x5bd357(0x10a)+_0x5dc616[_0x5bd357(0x105)]+'.\x0a');}}function buildFilePath(_0x428c89,_0x60b844,_0x1051d2,_0x38cf15){const _0x307729=a26_0x490b47;if(_0x60b844===_0x307729(0xdd)){if(!_0x38cf15)throw CliErrors[_0x307729(0xdc)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x57307e=_0x38cf15[_0x307729(0x109)]??_0x38cf15[_0x307729(0x128)];return join(_0x428c89['scriptsRootDir'],'HOOK',_0x57307e,_0x38cf15[_0x307729(0x106)],_0x38cf15[_0x307729(0x102)],_0x1051d2+_0x307729(0x117));}return join(_0x428c89[_0x307729(0xda)],_0x60b844,_0x1051d2+_0x307729(0x117));}export function generateTemplate(_0x9ea2fe,_0x577ca5,_0x103b0a,_0x2126a0,_0x5bf44a){const _0x139b6f=a26_0x490b47,_0x384468=_0x2126a0?.[_0x139b6f(0x100)]()||'TODO:\x20add\x20script\x20description';if(_0x9ea2fe===_0x139b6f(0xff))return _0x139b6f(0x10f)+_0x384468+'\x0a\x20*\x20[脚本名称]\x20'+_0x577ca5+_0x139b6f(0xfc)+_0x577ca5+_0x139b6f(0x11f)+_0x577ca5+_0x139b6f(0xf1);if(_0x9ea2fe===_0x139b6f(0x11a))return _0x139b6f(0xea)+_0x384468+_0x139b6f(0xf9)+_0x103b0a+'/'+_0x577ca5+_0x139b6f(0x115)+_0x577ca5+_0x139b6f(0xf1);if(!_0x5bf44a)throw CliErrors[_0x139b6f(0xdc)](_0x139b6f(0xe4));return _0x139b6f(0xf5)+_0x384468+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x103b0a+'/'+_0x5bf44a[_0x139b6f(0x128)]+'/'+_0x5bf44a[_0x139b6f(0x106)]+'\x0a\x20*\x20[触发节点]\x20'+_0x5bf44a[_0x139b6f(0x102)]+_0x139b6f(0xe5)+_0x577ca5+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
const a26_0x5dc2dd=a26_0x1f26;(function(_0x38a838,_0x2b54f4){const _0x4e6234=a26_0x1f26,_0x111a2e=_0x38a838();while(!![]){try{const _0x351fc6=parseInt(_0x4e6234(0x14d))/0x1*(parseInt(_0x4e6234(0x17e))/0x2)+-parseInt(_0x4e6234(0x18b))/0x3*(parseInt(_0x4e6234(0x184))/0x4)+-parseInt(_0x4e6234(0x157))/0x5*(-parseInt(_0x4e6234(0x14e))/0x6)+parseInt(_0x4e6234(0x148))/0x7*(parseInt(_0x4e6234(0x175))/0x8)+parseInt(_0x4e6234(0x17b))/0x9+parseInt(_0x4e6234(0x149))/0xa+-parseInt(_0x4e6234(0x189))/0xb;if(_0x351fc6===_0x2b54f4)break;else _0x111a2e['push'](_0x111a2e['shift']());}catch(_0x16cd32){_0x111a2e['push'](_0x111a2e['shift']());}}}(a26_0x5ccb,0xd0649));function a26_0x1f26(_0xb6c314,_0x46286a){_0xb6c314=_0xb6c314-0x13e;const _0x5ccbb0=a26_0x5ccb();let _0x1f2619=_0x5ccbb0[_0xb6c314];return _0x1f2619;}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a26_0x5ccb(){const _0x4137b4=['tableName','1knGndR','12780QKaaHa','\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','name','Invalid\x20function\x20name\x20\x22','Operation\x20type\x20(HOOK\x20only)','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','COMMON','write','No\x20datasets\x20found\x20for\x20this\x20app.','130uNCVCl','string','find','after','\x0a\x20*\x20[触发节点]\x20','isInteger','Select\x20operation\x20type:','Alias\x20\x22','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','stderr','apiDir','join','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','HOOK\x20requires\x20alias/operation/node\x20options.','create','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','length','\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','datasetCode','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20\x22','code','operation-type','description','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','parseInt','Available\x20aliases:\x20','Select\x20dataset:','6107656CfsXLN','validation','includes','Select\x20trigger\x20node:','\x22.\x20','\x20function:\x20','6550119CJSwTb','alias','Invalid\x20dataset\x20selection.','2693836YRawKG','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','operationType','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','str','before','548RKilvj','scriptsRootDir','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK','18893787VDJZga','Script\x20type','18339oFEPBK','question','datasetcode','No\x20operation\x20types\x20found\x20for\x20dataset\x20','close','functionNode','ENDPOINT','Available:\x20','utf8','map','bff','stdin','appCode','nonInteractive','trim','File\x20already\x20exists:\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22\x20not\x20found\x20for\x20dataset\x20','\x22\x20not\x20found.\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','function-node','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','7ErrGCM','5151290FmvjmB','Trigger\x20node\x20(HOOK\x20only)','keys'];a26_0x5ccb=function(){return _0x4137b4;};return a26_0x5ccb();}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_0x5dc2dd(0x195),'command':a26_0x5dc2dd(0x165),'description':a26_0x5dc2dd(0x144),'risk':a26_0x5dc2dd(0x155),'flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON',a26_0x5dc2dd(0x191),a26_0x5dc2dd(0x188)],'description':a26_0x5dc2dd(0x18a)},{'name':'name','type':a26_0x5dc2dd(0x158),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a26_0x5dc2dd(0x170),'type':a26_0x5dc2dd(0x158),'description':'Script\x20description'},{'name':'alias','type':a26_0x5dc2dd(0x158),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a26_0x5dc2dd(0x18d),'type':a26_0x5dc2dd(0x158),'description':a26_0x5dc2dd(0x15f)},{'name':a26_0x5dc2dd(0x16f),'type':'string','description':a26_0x5dc2dd(0x152)},{'name':a26_0x5dc2dd(0x146),'type':a26_0x5dc2dd(0x158),'description':a26_0x5dc2dd(0x14a),'enum':[a26_0x5dc2dd(0x183),'after']}],async 'validate'(_0x3cf762){const _0x367721=a26_0x5dc2dd,_0x25acb9=_0x3cf762[_0x367721(0x182)](_0x367721(0x150));if(!isValidBffFunctionName(_0x25acb9))throw CliErrors['validation'](_0x367721(0x151)+_0x25acb9+_0x367721(0x16b));},async 'execute'(_0x3659ac){const _0x3268d9=a26_0x5dc2dd,_0xfa34e9=loadBffProjectConfig(_0x3659ac['appCode']),_0x2eca1d=_0x3659ac[_0x3268d9(0x182)]('type'),_0x2c3dc3=_0x3659ac['str'](_0x3268d9(0x150)),_0x29a83c=_0x3659ac[_0x3268d9(0x182)](_0x3268d9(0x170))||undefined,_0x16b330=_0x2eca1d===_0x3268d9(0x188)?await resolveHookOptions(_0xfa34e9,_0x3659ac):undefined,_0x48a70d=buildFilePath(_0xfa34e9,_0x2eca1d,_0x2c3dc3,_0x16b330);if(await fileExists(_0x48a70d))throw CliErrors[_0x3268d9(0x176)](_0x3268d9(0x13f)+_0x48a70d);await mkdir(dirname(_0x48a70d),{'recursive':!![]});const _0x251c5e=generateTemplate(_0x2eca1d,_0x2c3dc3,_0x3659ac[_0x3268d9(0x197)],_0x29a83c,_0x16b330);await writeFile(_0x48a70d,_0x251c5e,_0x3268d9(0x193));const _0x42ceaa={'type':_0x2eca1d,'name':_0x2c3dc3,'path':_0x48a70d};if(_0x29a83c)_0x42ceaa['description']=_0x29a83c;if(_0x16b330){if(_0x16b330[_0x3268d9(0x17c)])_0x42ceaa[_0x3268d9(0x17c)]=_0x16b330[_0x3268d9(0x17c)];_0x42ceaa[_0x3268d9(0x169)]=_0x16b330[_0x3268d9(0x169)],_0x42ceaa['operationType']=_0x16b330['operationType'],_0x42ceaa['functionNode']=_0x16b330[_0x3268d9(0x190)];}return{'ok':!![],'data':_0x42ceaa,'message':'Created\x20'+_0x2eca1d+_0x3268d9(0x17a)+_0x2c3dc3};}};async function resolveHookOptions(_0x152d55,_0x33ad79){const _0x586761=a26_0x5dc2dd,_0x1f6b0c=loadAliasMap(_0x33ad79[_0x586761(0x161)],undefined,resolveApiFilePath(_0x33ad79[_0x586761(0x161)],_0x33ad79[_0x586761(0x197)])),_0x2a4942=_0x1f6b0c[_0x586761(0x167)]>0x0;let _0x3b6556,_0x5103df,_0xf83685;const _0x5d9fd4=_0x33ad79[_0x586761(0x182)]('alias'),_0x458882=_0x33ad79[_0x586761(0x182)](_0x586761(0x18d));if(_0x5d9fd4){const _0x1babdb=resolveAlias(_0x33ad79[_0x586761(0x161)],_0x5d9fd4,undefined,resolveApiFilePath(_0x33ad79['apiDir'],_0x33ad79[_0x586761(0x197)]));if(!_0x1babdb){const _0x578913=_0x2a4942?_0x586761(0x173)+_0x1f6b0c[_0x586761(0x194)](_0x22bcb5=>_0x22bcb5['alias'])[_0x586761(0x162)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x586761(0x163);throw CliErrors[_0x586761(0x176)](_0x586761(0x15e)+_0x5d9fd4+_0x586761(0x142)+_0x578913);}_0x3b6556=_0x5d9fd4,_0x5103df=_0x1babdb;}else{if(_0x458882){_0x5103df=_0x458882;const _0x2b50fa=_0x1f6b0c[_0x586761(0x159)](_0x10bc9b=>_0x10bc9b[_0x586761(0x169)]===_0x458882);_0x3b6556=_0x2b50fa?.['alias'];}else{if(_0x33ad79[_0x586761(0x198)])throw CliErrors[_0x586761(0x176)](_0x586761(0x187));else{if(_0x2a4942){const _0x56ab08=_0x1f6b0c[_0x586761(0x194)](_0xf7d270=>_0xf7d270[_0x586761(0x17c)]+'\x20('+_0xf7d270[_0x586761(0x14c)]+')'),_0x4d9593=await promptSelect(_0x586761(0x174),_0x56ab08),_0x25b174=_0x1f6b0c[_0x4d9593];if(!_0x25b174)throw CliErrors[_0x586761(0x176)](_0x586761(0x17d));_0x3b6556=_0x25b174[_0x586761(0x17c)],_0x5103df=_0x25b174[_0x586761(0x169)];}else{const _0x4fb2bb=await listDatasets(_0x33ad79['appCode']);if(_0x4fb2bb[_0x586761(0x167)]===0x0)throw CliErrors[_0x586761(0x176)](_0x586761(0x156));const _0x441fe3=_0x4fb2bb[_0x586761(0x194)](_0x442c33=>_0x442c33[_0x586761(0x150)]+'\x20('+_0x442c33[_0x586761(0x16e)]+')'),_0x26754c=await promptSelect(_0x586761(0x174),_0x441fe3),_0xf6f27f=_0x4fb2bb[_0x26754c];if(!_0xf6f27f)throw CliErrors[_0x586761(0x176)]('Invalid\x20dataset\x20selection.');_0x5103df=_0xf6f27f[_0x586761(0x16e)],_0x3b6556=undefined;}}}}const _0x39a11c=await listDatasets(_0x33ad79['appCode']),_0x330e5b=_0x39a11c[_0x586761(0x159)](_0x64ad83=>_0x64ad83['code']===_0x5103df);if(!_0x330e5b)throw CliErrors[_0x586761(0x176)](_0x586761(0x16a)+_0x5103df+_0x586761(0x179)+(_0x3b6556?_0x586761(0x181)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0xf83685=_0x330e5b['id'];const _0x1ac797=_0x3b6556??_0x5103df,_0xbc342f=await listBffDatasetOperations(_0x33ad79[_0x586761(0x197)],_0xf83685),_0x3d5444=_0xbc342f?Object[_0x586761(0x14b)](_0xbc342f):[];if(_0x3d5444[_0x586761(0x167)]===0x0)throw CliErrors[_0x586761(0x176)](_0x586761(0x18e)+_0x1ac797+'.');let _0xc80b31;const _0x5c37b6=_0x33ad79[_0x586761(0x182)](_0x586761(0x16f));if(_0x5c37b6){if(!_0x3d5444[_0x586761(0x177)](_0x5c37b6))throw CliErrors['validation'](_0x586761(0x16d)+_0x5c37b6+_0x586761(0x141)+_0x1ac797+'.\x20'+(_0x586761(0x192)+_0x3d5444[_0x586761(0x162)](',\x20')));_0xc80b31=_0x5c37b6;}else{if(_0x33ad79['nonInteractive'])throw CliErrors[_0x586761(0x176)](_0x586761(0x153));const _0x1d60a7=await promptSelect(_0x586761(0x15d),_0x3d5444);_0xc80b31=_0x3d5444[_0x1d60a7]??_0x3d5444[0x0];}let _0x32daac=normalizeHookFunctionNode(_0x33ad79[_0x586761(0x182)](_0x586761(0x146)));if(!_0x32daac){if(_0x33ad79[_0x586761(0x182)](_0x586761(0x146)))throw CliErrors[_0x586761(0x176)](_0x586761(0x143));if(_0x33ad79[_0x586761(0x198)])throw CliErrors[_0x586761(0x176)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x310c2a=await promptSelect(_0x586761(0x178),[_0x586761(0x183),_0x586761(0x15a)]);_0x32daac=[_0x586761(0x183),'after'][_0x310c2a]??_0x586761(0x183);}return{'alias':_0x3b6556,'datasetCode':_0x5103df,'datasetId':_0xf83685,'operationType':_0xc80b31,'functionNode':_0x32daac};}async function promptSelect(_0x4b4f97,_0x37cec8){const _0x26419a=a26_0x5dc2dd;if(_0x37cec8[_0x26419a(0x167)]===0x1)return 0x0;for(const [_0x3f7e6c,_0x1dd158]of _0x37cec8['entries']()){process[_0x26419a(0x160)][_0x26419a(0x155)]('\x20\x20'+(_0x3f7e6c+0x1)+'.\x20'+_0x1dd158+'\x0a');}const _0x2a95fd=createInterface({'input':process[_0x26419a(0x196)],'output':process[_0x26419a(0x160)]});while(!![]){const _0x2ed256=await new Promise(_0x28ffd8=>{const _0x3e94a8=_0x26419a;_0x2a95fd[_0x3e94a8(0x18c)](_0x4b4f97+'\x20',_0x28ffd8);}),_0x4f2ffd=Number[_0x26419a(0x172)](_0x2ed256[_0x26419a(0x13e)](),0xa);if(Number[_0x26419a(0x15c)](_0x4f2ffd)&&_0x4f2ffd>=0x1&&_0x4f2ffd<=_0x37cec8[_0x26419a(0x167)])return _0x2a95fd[_0x26419a(0x18f)](),_0x4f2ffd-0x1;process[_0x26419a(0x160)][_0x26419a(0x155)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x37cec8['length']+'.\x0a');}}function buildFilePath(_0x557660,_0xefee05,_0x476b8c,_0x44da9f){const _0x26b518=a26_0x5dc2dd;if(_0xefee05===_0x26b518(0x188)){if(!_0x44da9f)throw CliErrors['validation'](_0x26b518(0x164));const _0x3a291d=_0x44da9f[_0x26b518(0x17c)]??_0x44da9f[_0x26b518(0x169)];return join(_0x557660[_0x26b518(0x185)],_0x26b518(0x188),_0x3a291d,_0x44da9f['operationType'],_0x44da9f['functionNode'],_0x476b8c+'.js');}return join(_0x557660[_0x26b518(0x185)],_0xefee05,_0x476b8c+'.js');}export function generateTemplate(_0x13673c,_0x53e7bc,_0x582eb9,_0x316b96,_0x14cbf9){const _0x4d0464=a26_0x5dc2dd,_0xdc371=_0x316b96?.['trim']()||'TODO:\x20add\x20script\x20description';if(_0x13673c===_0x4d0464(0x154))return _0x4d0464(0x17f)+_0xdc371+_0x4d0464(0x16c)+_0x53e7bc+_0x4d0464(0x186)+_0x53e7bc+'.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'+_0x53e7bc+_0x4d0464(0x171);if(_0x13673c===_0x4d0464(0x191))return _0x4d0464(0x147)+_0xdc371+_0x4d0464(0x145)+_0x582eb9+'/'+_0x53e7bc+_0x4d0464(0x14f)+_0x53e7bc+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x14cbf9)throw CliErrors[_0x4d0464(0x176)](_0x4d0464(0x140));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0xdc371+_0x4d0464(0x166)+_0x582eb9+'/'+_0x14cbf9[_0x4d0464(0x169)]+'/'+_0x14cbf9[_0x4d0464(0x180)]+_0x4d0464(0x15b)+_0x14cbf9['functionNode']+_0x4d0464(0x168)+_0x53e7bc+_0x4d0464(0x171);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a27_0x316209=a27_0x5f04;(function(_0x334dd4,_0x28795f){const _0x59412d=a27_0x5f04,_0x4daeef=_0x334dd4();while(!![]){try{const _0x3f8a3e=parseInt(_0x59412d(0xc3))/0x1*(-parseInt(_0x59412d(0xb6))/0x2)+parseInt(_0x59412d(0xae))/0x3*(parseInt(_0x59412d(0xce))/0x4)+parseInt(_0x59412d(0xb2))/0x5*(parseInt(_0x59412d(0xcb))/0x6)+parseInt(_0x59412d(0xbc))/0x7+parseInt(_0x59412d(0xbf))/0x8+parseInt(_0x59412d(0xb0))/0x9*(-parseInt(_0x59412d(0xcd))/0xa)+-parseInt(_0x59412d(0xd3))/0xb;if(_0x3f8a3e===_0x28795f)break;else _0x4daeef['push'](_0x4daeef['shift']());}catch(_0x109919){_0x4daeef['push'](_0x4daeef['shift']());}}}(a27_0x206c,0xa0392));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a27_0x5f04(_0x3c68b6,_0x375281){_0x3c68b6=_0x3c68b6-0xa8;const _0x206c38=a27_0x206c();let _0x5f0439=_0x206c38[_0x3c68b6];return _0x5f0439;}import{dirname,join,relative,resolve,sep}from'node:path';function a27_0x206c(){const _0x32cf29=['BFF\x20lock\x20file\x20not\x20found.','string','appCode','POST','trashedTo','startsWith','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','includes','1706535Aueyvm','\x20(local\x20file\x20moved\x20to\x20trash)','126fFsEXv','Multiple\x20functions\x20match\x20\x22','6136975kgXMKx','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','Function\x20not\x20found:\x20','Deleted\x20','4OAzUxS','lastSync','bff','toISOString','No\x20lock\x20entry\x20found\x20for\x20\x22','keys','847595UBaota','find','target','7962136IrfBvV','\x20\x20-\x20','replace','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','353469LFDQnD','Would\x20delete\x20','filter','remoteId','length','projectRoot','high-risk-write','map','6fPUvwS','/api/management/library/scripts/delete','769480fBnwPK','4xBdbKf','str','join','delete','scriptsRoot','5193188KYUAHz','validation','functions'];a27_0x206c=function(){return _0x32cf29;};return a27_0x206c();}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a27_0x316209(0xb8),'command':a27_0x316209(0xd1),'description':a27_0x316209(0xb3),'risk':a27_0x316209(0xc9),'flags':[{'name':a27_0x316209(0xbe),'type':a27_0x316209(0xd7),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x4ed699){const _0x7846da=a27_0x316209,_0x4da494=loadBffProjectConfig(_0x4ed699[_0x7846da(0xd8)]),_0x31f021=await readBffLockFile(_0x4da494[_0x7846da(0xab)]);if(!_0x31f021)throw CliErrors['validation'](_0x7846da(0xc2));},async 'dryRun'(_0x56c3d1){const _0x20c805=a27_0x316209,_0x422e9c=loadBffProjectConfig(_0x56c3d1[_0x20c805(0xd8)]),_0x1df746=await readBffLockFile(_0x422e9c[_0x20c805(0xab)]);if(!_0x1df746)throw CliErrors['validation'](_0x20c805(0xd6));const {appLock:_0x5c6b00}=ensureLockScope(_0x1df746,_0x56c3d1['appCode'],_0x422e9c[_0x20c805(0xd2)],_0x20c805(0xd1)),_0x1bd7de=_0x56c3d1[_0x20c805(0xcf)](_0x20c805(0xbe)),_0xd79378=Object[_0x20c805(0xbb)](_0x5c6b00[_0x20c805(0xd5)]),_0x1c3bf9=resolveDeleteTarget(_0x1bd7de,_0xd79378),_0x37a4b0=_0x5c6b00['functions'][_0x1c3bf9];if(!_0x37a4b0)throw CliErrors[_0x20c805(0xd4)](_0x20c805(0xba)+_0x1c3bf9+'\x22.');const _0x3018d6=resolveLocalFilePathFromLockKey(_0x422e9c,_0x1c3bf9),_0x496601=relative(_0x422e9c[_0x20c805(0xc8)],_0x3018d6),_0x262899=join(_0x422e9c['trashDir'],'<timestamp>',_0x496601);return{'method':_0x20c805(0xa8),'url':_0x20c805(0xcc),'body':{'appCode':_0x56c3d1[_0x20c805(0xd8)],'target':_0x1c3bf9,'remoteId':_0x37a4b0[_0x20c805(0xc6)],'localFilePath':_0x3018d6,'trashedPath':_0x262899},'description':_0x20c805(0xc4)+_0x1c3bf9+_0x20c805(0xac)};},async 'execute'(_0x20b0bd){const _0x55f775=a27_0x316209,_0x18fd28=loadBffProjectConfig(_0x20b0bd[_0x55f775(0xd8)]),_0x3278d0=await readBffLockFile(_0x18fd28[_0x55f775(0xab)]);if(!_0x3278d0)throw CliErrors['validation'](_0x55f775(0xd6));const {lockData:_0x341434,appLock:_0x295c78}=ensureLockScope(_0x3278d0,_0x20b0bd[_0x55f775(0xd8)],_0x18fd28[_0x55f775(0xd2)],_0x55f775(0xd1)),_0x51fda6=_0x20b0bd[_0x55f775(0xcf)](_0x55f775(0xbe)),_0x4cd544=Object['keys'](_0x295c78['functions']),_0x1e0b89=resolveDeleteTarget(_0x51fda6,_0x4cd544),_0x367d72=_0x295c78[_0x55f775(0xd5)][_0x1e0b89];if(!_0x367d72)throw CliErrors[_0x55f775(0xd4)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x1e0b89+'\x22.');await deleteBffScript(_0x367d72[_0x55f775(0xc6)]),delete _0x295c78[_0x55f775(0xd5)][_0x1e0b89],_0x295c78[_0x55f775(0xb7)]=new Date()[_0x55f775(0xb9)](),await writeBffLockFile(_0x18fd28['lockFilePath'],_0x341434);const _0x11eb1b=resolveLocalFilePathFromLockKey(_0x18fd28,_0x1e0b89);let _0x185dd9;await fileExists(_0x11eb1b)&&(_0x185dd9=await moveToTrash(_0x18fd28['projectRoot'],_0x18fd28['trashDir'],_0x11eb1b),await cleanupEmptyDirectories(dirname(_0x11eb1b),_0x18fd28['scriptsRootDir']));const _0x592ee7={'deleted':_0x1e0b89,'remoteId':_0x367d72['remoteId']};if(_0x185dd9)_0x592ee7[_0x55f775(0xa9)]=_0x185dd9;return{'ok':!![],'data':_0x592ee7,'message':_0x55f775(0xb5)+_0x1e0b89+(_0x185dd9?_0x55f775(0xaf):'')};}};function resolveDeleteTarget(_0x432b38,_0x42bb8d){const _0x30d135=a27_0x316209;if(_0x432b38[_0x30d135(0xad)]('/')){const _0x2b7988=_0x42bb8d[_0x30d135(0xbd)](_0x18cd01=>_0x18cd01===_0x432b38);if(!_0x2b7988)throw CliErrors[_0x30d135(0xd4)](_0x30d135(0xb4)+_0x432b38);return _0x2b7988;}const _0x1be576=_0x42bb8d[_0x30d135(0xc5)](_0x10c5e2=>_0x10c5e2['split']('/')['at'](-0x1)===_0x432b38);if(_0x1be576[_0x30d135(0xc7)]===0x0)throw CliErrors[_0x30d135(0xd4)](_0x30d135(0xb4)+_0x432b38);if(_0x1be576[_0x30d135(0xc7)]>0x1)throw CliErrors[_0x30d135(0xd4)](_0x30d135(0xb1)+_0x432b38+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x1be576[_0x30d135(0xca)](_0x57c65d=>_0x30d135(0xc0)+_0x57c65d)[_0x30d135(0xd0)]('\x0a'));return _0x1be576[0x0];}async function moveToTrash(_0x3821f1,_0x575aa0,_0x57c17e){const _0xf14ec4=a27_0x316209,_0x3480b0=new Date()['toISOString']()[_0xf14ec4(0xc1)](/[:.]/g,'-'),_0x3ea525=relative(_0x3821f1,_0x57c17e),_0x42db3c=join(_0x575aa0,_0x3480b0,_0x3ea525);return await mkdir(dirname(_0x42db3c),{'recursive':!![]}),await rename(_0x57c17e,_0x42db3c),_0x42db3c;}async function cleanupEmptyDirectories(_0x4b72c7,_0x180082){const _0x71d00f=a27_0x316209;let _0x431d83=resolve(_0x4b72c7);const _0x1a59de=resolve(_0x180082);while(_0x431d83[_0x71d00f(0xaa)](''+_0x1a59de+sep)||_0x431d83===_0x1a59de){if(_0x431d83===_0x1a59de)return;try{const _0x52e775=await readdir(_0x431d83);if(_0x52e775[_0x71d00f(0xc7)]>0x0)return;await rmdir(_0x431d83);}catch{return;}_0x431d83=dirname(_0x431d83);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x2b5be3=a28_0xdbca;(function(_0x177172,_0xc5d97){const _0x411009=a28_0xdbca,_0x249bad=_0x177172();while(!![]){try{const _0x2aa51a=-parseInt(_0x411009(0xe5))/0x1*(parseInt(_0x411009(0xef))/0x2)+-parseInt(_0x411009(0xfb))/0x3+parseInt(_0x411009(0xf0))/0x4*(parseInt(_0x411009(0xf2))/0x5)+parseInt(_0x411009(0xed))/0x6+-parseInt(_0x411009(0xea))/0x7+parseInt(_0x411009(0xf3))/0x8*(parseInt(_0x411009(0xec))/0x9)+parseInt(_0x411009(0xe6))/0xa;if(_0x2aa51a===_0xc5d97)break;else _0x249bad['push'](_0x249bad['shift']());}catch(_0x697786){_0x249bad['push'](_0x249bad['shift']());}}}(a28_0x3e73,0x1b5b7));import{getBffScriptInfo}from'../../core/api-client.js';function a28_0x3e73(){const _0x122d25=['Return\x20full\x20raw\x20script\x20object','createdTime','scriptType','335568bksTDq','5dlxsNY','1480420FlKLii','read','verbose','detail','1086057HvmdRy','num','18ZcwcLy','484992tICKOo','(none)','76366DEEBcr','51012kCAQRz','appCode','75ZzHGMz','599232ChaTCW','number','scriptContent','boolean','description'];a28_0x3e73=function(){return _0x122d25;};return a28_0x3e73();}function a28_0xdbca(_0x46c363,_0x1b9a73){_0x46c363=_0x46c363-0xe5;const _0x3e73ab=a28_0x3e73();let _0xdbca21=_0x3e73ab[_0x46c363];return _0xdbca21;}export const bffDetail={'service':'bff','command':a28_0x2b5be3(0xe9),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a28_0x2b5be3(0xe7),'flags':[{'name':'id','type':a28_0x2b5be3(0xf4),'required':!![],'description':'Script\x20ID'},{'name':a28_0x2b5be3(0xe8),'type':a28_0x2b5be3(0xf6),'description':a28_0x2b5be3(0xf8)}],async 'execute'(_0x515cea){const _0x569ef7=a28_0x2b5be3,_0x3c4d16=await getBffScriptInfo(_0x515cea[_0x569ef7(0xeb)]('id')),_0x4926ce=_0x515cea['bool'](_0x569ef7(0xe8));if(_0x4926ce)return{'ok':!![],'data':_0x3c4d16};return{'ok':!![],'data':{'id':_0x3c4d16['id'],'appCode':_0x3c4d16[_0x569ef7(0xf1)],'scriptType':_0x3c4d16[_0x569ef7(0xfa)],'description':_0x3c4d16[_0x569ef7(0xf7)]||_0x569ef7(0xee),'createdTime':_0x3c4d16[_0x569ef7(0xf9)]??'','updatedTime':_0x3c4d16['updatedTime']??'','scriptContent':_0x3c4d16[_0x569ef7(0xf5)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x541e12,_0x4ce811){const _0x446f65=a29_0x1ab1,_0x3b5c35=_0x541e12();while(!![]){try{const _0x97c72b=parseInt(_0x446f65(0x1b9))/0x1*(parseInt(_0x446f65(0x1b6))/0x2)+parseInt(_0x446f65(0x1b1))/0x3+parseInt(_0x446f65(0x1b5))/0x4*(parseInt(_0x446f65(0x1b2))/0x5)+parseInt(_0x446f65(0x1b0))/0x6*(parseInt(_0x446f65(0x1b4))/0x7)+-parseInt(_0x446f65(0x1af))/0x8+-parseInt(_0x446f65(0x1b3))/0x9+-parseInt(_0x446f65(0x1b7))/0xa*(parseInt(_0x446f65(0x1b8))/0xb);if(_0x97c72b===_0x4ce811)break;else _0x3b5c35['push'](_0x3b5c35['shift']());}catch(_0x1266e8){_0x3b5c35['push'](_0x3b5c35['shift']());}}}(a29_0x3c87,0x5dc16));import{bffList}from'../../commands/bff/list.js';function a29_0x3c87(){const _0x328b59=['3720015iVEjOz','14ctrYBs','14892zTgPfV','884IObKDK','13670jUXCFD','1067dNrLzB','993oiOMxw','5882888SzBBsz','344766ENORZz','2016525JreBYC','590MBnRsW'];a29_0x3c87=function(){return _0x328b59;};return a29_0x3c87();}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_0x1ab1(_0x3b32da,_0x73bf3c){_0x3b32da=_0x3b32da-0x1af;const _0x3c8701=a29_0x3c87();let _0x1ab112=_0x3c8701[_0x3b32da];return _0x1ab112;}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
|
-
|
|
1
|
+
const a30_0x78ccc=a30_0x3f2e;(function(_0x424631,_0x13032e){const _0x4c1928=a30_0x3f2e,_0x1d119b=_0x424631();while(!![]){try{const _0x422c7f=-parseInt(_0x4c1928(0x1b4))/0x1+-parseInt(_0x4c1928(0x19e))/0x2*(parseInt(_0x4c1928(0x1a4))/0x3)+parseInt(_0x4c1928(0x1b0))/0x4*(parseInt(_0x4c1928(0x1a6))/0x5)+parseInt(_0x4c1928(0x1ae))/0x6*(-parseInt(_0x4c1928(0x1b2))/0x7)+-parseInt(_0x4c1928(0x197))/0x8*(-parseInt(_0x4c1928(0x1a7))/0x9)+parseInt(_0x4c1928(0x1a9))/0xa*(-parseInt(_0x4c1928(0x199))/0xb)+-parseInt(_0x4c1928(0x1a0))/0xc*(-parseInt(_0x4c1928(0x1a3))/0xd);if(_0x422c7f===_0x13032e)break;else _0x1d119b['push'](_0x1d119b['shift']());}catch(_0x35b17f){_0x1d119b['push'](_0x1d119b['shift']());}}}(a30_0x2d10,0x261ee));function a30_0x2d10(){const _0x209622=['name','31402QVvFdW','List\x20BFF\x20scripts','273533TaYjOp','description','type','functionName','1079080bTsgUR','str','3707ZocSgn','string','length','list','Return\x20full\x20script\x20objects','40fTzSru','scriptType','84VvkaWh','ENDPOINT','Filter\x20by\x20script\x20name','1179269ZEiQCb','20112YUbzoP','(unnamed)','15yDoBDA','9UufGtf','map','7340AHDvAP','appCode','boolean','No\x20BFF\x20scripts\x20found.','verbose','78aPzMGQ','COMMON','132740CIClLi'];a30_0x2d10=function(){return _0x209622;};return a30_0x2d10();}import{listBffScripts}from'../../core/api-client.js';function a30_0x3f2e(_0xe833ab,_0x1e5522){_0xe833ab=_0xe833ab-0x195;const _0x2d100a=a30_0x2d10();let _0x3f2eae=_0x2d100a[_0xe833ab];return _0x3f2eae;}export const bffList={'service':'bff','command':a30_0x78ccc(0x19c),'description':a30_0x78ccc(0x1b3),'risk':'read','flags':[{'name':a30_0x78ccc(0x195),'type':a30_0x78ccc(0x19a),'description':'Script\x20type\x20filter','default':a30_0x78ccc(0x1a1),'enum':['ENDPOINT',a30_0x78ccc(0x1af)]},{'name':a30_0x78ccc(0x1b1),'type':a30_0x78ccc(0x19a),'description':a30_0x78ccc(0x1a2)},{'name':a30_0x78ccc(0x1ad),'type':a30_0x78ccc(0x1ab),'description':a30_0x78ccc(0x19d)}],async 'execute'(_0x497128){const _0x6c9b57=a30_0x78ccc,_0x48e07d=await listBffScripts(_0x497128[_0x6c9b57(0x1aa)],_0x497128[_0x6c9b57(0x198)](_0x6c9b57(0x195)),{'scriptName':_0x497128[_0x6c9b57(0x198)]('name')||undefined}),_0x34d6d9=_0x497128['bool'](_0x6c9b57(0x1ad));return{'ok':!![],'data':_0x34d6d9?_0x48e07d:_0x48e07d[_0x6c9b57(0x1a8)](_0x350eda=>({'id':_0x350eda['id'],'functionName':_0x350eda[_0x6c9b57(0x196)]??'','description':_0x350eda[_0x6c9b57(0x1b5)]||_0x6c9b57(0x1a5),'scriptType':_0x350eda[_0x6c9b57(0x19f)]})),'message':_0x48e07d[_0x6c9b57(0x19b)]===0x0?_0x6c9b57(0x1ac):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4a63bb=a31_0x181e;(function(_0x5ce1db,_0x237a5d){const _0x18b183=a31_0x181e,_0x2aaade=_0x5ce1db();while(!![]){try{const _0x1bdaac=parseInt(_0x18b183(0x6f))/0x1*(-parseInt(_0x18b183(0x8e))/0x2)+-parseInt(_0x18b183(0x9b))/0x3*(parseInt(_0x18b183(0x7b))/0x4)+-parseInt(_0x18b183(0xa7))/0x5+-parseInt(_0x18b183(0x8b))/0x6*(parseInt(_0x18b183(0x7d))/0x7)+-parseInt(_0x18b183(0xa4))/0x8+parseInt(_0x18b183(0x7f))/0x9+parseInt(_0x18b183(0x73))/0xa;if(_0x1bdaac===_0x237a5d)break;else _0x2aaade['push'](_0x2aaade['shift']());}catch(_0x54a51c){_0x2aaade['push'](_0x2aaade['shift']());}}}(a31_0x2f35,0x27e21));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a31_0x181e(_0x3dffcf,_0x4656c7){_0x3dffcf=_0x3dffcf-0x6a;const _0x2f35d5=a31_0x2f35();let _0x181ef5=_0x2f35d5[_0x3dffcf];return _0x181ef5;}import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a31_0x4a63bb(0x96),'command':a31_0x4a63bb(0x77),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a31_0x4a63bb(0x6c),'flags':[{'name':a31_0x4a63bb(0x91),'type':'string','description':a31_0x4a63bb(0xa2),'enum':[a31_0x4a63bb(0x87),a31_0x4a63bb(0xae),a31_0x4a63bb(0x82)]},{'name':'force','type':a31_0x4a63bb(0x95),'description':a31_0x4a63bb(0x88)}],async 'dryRun'(_0x2ddeb5){const _0x2bf1c7=a31_0x4a63bb,_0x5eaae1=loadBffProjectConfig(_0x2ddeb5[_0x2bf1c7(0xa1)]),_0x43fd4c=await readBffLockFile(_0x5eaae1[_0x2bf1c7(0x74)]),{appLock:_0x382c70}=ensureLockScope(_0x43fd4c??createEmptyBffLock(),_0x2ddeb5[_0x2bf1c7(0xa1)],_0x5eaae1[_0x2bf1c7(0x8c)],_0x2bf1c7(0x77)),_0x54a6c5=normalizeBffType(_0x2ddeb5[_0x2bf1c7(0x76)](_0x2bf1c7(0x91)))??undefined,_0x2ed74b=buildDatasetCodeToAliasMap(_0x2ddeb5[_0x2bf1c7(0xb1)],_0x2ddeb5[_0x2bf1c7(0xa1)]),[_0x4a4db8,_0x4387f7]=await Promise[_0x2bf1c7(0xa8)]([listBffScripts(_0x2ddeb5[_0x2bf1c7(0xa1)],_0x54a6c5),getBffScriptStatistics(_0x2ddeb5[_0x2bf1c7(0xa1)])]),_0x2e6eba=createHookLocationMap(_0x4387f7),_0x1c8ad5=[];for(const _0x1b5a3d of _0x4a4db8){const _0x555ea4=resolveRemoteScriptTarget(_0x5eaae1,_0x1b5a3d,_0x2e6eba,_0x382c70[_0x2bf1c7(0x9a)],_0x2ed74b);if(!_0x555ea4){_0x1c8ad5[_0x2bf1c7(0x93)]({'scriptType':_0x1b5a3d['scriptType'],'functionName':_0x1b5a3d[_0x2bf1c7(0xa9)]??'','status':_0x2bf1c7(0x70),'reason':_0x2bf1c7(0x85)});continue;}const _0x5ea7ce=_0x382c70[_0x2bf1c7(0x9a)][_0x555ea4[_0x2bf1c7(0x6d)]],_0x1040d5=_0x1b5a3d['scriptContent']!=null?computeContentHash(_0x1b5a3d['scriptContent']):undefined,_0x455fa7=await hasUnsyncedLocalChanges(_0x555ea4[_0x2bf1c7(0xa0)],_0x5ea7ce,_0x1040d5);_0x1c8ad5[_0x2bf1c7(0x93)]({'lockKey':_0x555ea4[_0x2bf1c7(0x6d)],'filePath':_0x555ea4[_0x2bf1c7(0xa0)],'remoteId':_0x1b5a3d['id']??null,'status':_0x455fa7?_0x2bf1c7(0xa5):_0x2bf1c7(0x6a)});}return{'method':'GET','url':_0x2bf1c7(0x71)+_0x2ddeb5['appCode']+(_0x54a6c5?_0x2bf1c7(0x6e)+_0x54a6c5:''),'body':{'appCode':_0x2ddeb5['appCode'],'filterType':_0x54a6c5??null,'files':_0x1c8ad5},'description':_0x2bf1c7(0x9e)+_0x1c8ad5[_0x2bf1c7(0x6b)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x58b582){const _0x11770a=a31_0x4a63bb,_0x108a94=loadBffProjectConfig(_0x58b582['appCode']),_0x4c258a=await readBffLockFile(_0x108a94[_0x11770a(0x74)]),{lockData:_0x30a36d,appLock:_0x5e1d23}=ensureLockScope(_0x4c258a??createEmptyBffLock(),_0x58b582[_0x11770a(0xa1)],_0x108a94[_0x11770a(0x8c)],_0x11770a(0x77)),_0x3d538f=normalizeBffType(_0x58b582['str'](_0x11770a(0x91)))??undefined;if(_0x58b582['str'](_0x11770a(0x91))&&!_0x3d538f)throw CliErrors['validation'](_0x11770a(0x7e));const [_0x46cbec,_0x85e691]=await Promise[_0x11770a(0xa8)]([listBffScripts(_0x58b582['appCode'],_0x3d538f),getBffScriptStatistics(_0x58b582[_0x11770a(0xa1)])]);if(_0x46cbec[_0x11770a(0x6b)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x11770a(0xa3)};const _0x10bfdf=_0x58b582[_0x11770a(0x8f)](_0x11770a(0xb3));if(_0x10bfdf&&!_0x58b582[_0x11770a(0x80)]){const _0x2cdde1=await confirmForce();if(!_0x2cdde1)throw CliErrors[_0x11770a(0x81)]('Force\x20pull\x20cancelled.');}if(_0x10bfdf&&_0x58b582[_0x11770a(0x80)]){}const _0x321fc7=buildDatasetCodeToAliasMap(_0x58b582[_0x11770a(0xb1)],_0x58b582[_0x11770a(0xa1)]),_0x42a107=createHookLocationMap(_0x85e691),_0x282277=JSON[_0x11770a(0x79)](JSON[_0x11770a(0xb5)](_0x30a36d)),_0x8ada73=_0x58b582['appCode'],_0x2dffe1=_0x282277[_0x11770a(0xb2)][_0x8ada73];if(!_0x2dffe1)throw new Error(_0x11770a(0x83)+_0x8ada73+_0x11770a(0x94));const _0x3afa45=[],_0x446de4=[],_0x453f3a=[];for(const _0x3299c8 of _0x46cbec){const _0x5331dc=resolveRemoteScriptTarget(_0x108a94,_0x3299c8,_0x42a107,_0x5e1d23[_0x11770a(0x9a)],_0x321fc7);if(!_0x5331dc){_0x446de4[_0x11770a(0x93)]({'lockKey':_0x3299c8[_0x11770a(0xab)]+'/'+_0x3299c8[_0x11770a(0xa9)],'reason':_0x11770a(0x85)});continue;}const _0x4c63d1=_0x5e1d23['functions'][_0x5331dc['lockKey']];try{if(!_0x3299c8['id'])throw new Error(_0x11770a(0x86));if(_0x3299c8['scriptContent']==null)throw new Error(_0x11770a(0x7c));const _0x39a2c9=_0x3299c8[_0x11770a(0x9f)],_0x144ab8=computeContentHash(_0x39a2c9);if(!_0x10bfdf){const _0x1e2e4b=await hasUnsyncedLocalChanges(_0x5331dc[_0x11770a(0xa0)],_0x4c63d1,_0x144ab8);if(_0x1e2e4b){_0x446de4['push']({'lockKey':_0x5331dc[_0x11770a(0x6d)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x5331dc['filePath']),await writeFile(_0x5331dc['filePath'],_0x39a2c9,_0x11770a(0x8d));const _0xef54f7={'hash':_0x144ab8,'remoteId':_0x3299c8['id'],'version':_0x3299c8[_0x11770a(0xac)]};_0x5331dc[_0x11770a(0x91)]==='HOOK'&&_0x5331dc[_0x11770a(0x84)]&&(_0xef54f7['alias']=_0x5331dc[_0x11770a(0x84)][_0x11770a(0x89)],_0xef54f7[_0x11770a(0x92)]=_0x5331dc[_0x11770a(0x84)][_0x11770a(0x92)],_0xef54f7['operationType']=_0x5331dc['hookLocation'][_0x11770a(0x97)],_0xef54f7[_0x11770a(0x9c)]=_0x5331dc[_0x11770a(0x84)][_0x11770a(0x9c)]),_0x2dffe1['functions'][_0x5331dc[_0x11770a(0x6d)]]=_0xef54f7,_0x3afa45[_0x11770a(0x93)]({'lockKey':_0x5331dc[_0x11770a(0x6d)],'remoteId':_0x3299c8['id']});}catch(_0xa50987){_0x453f3a[_0x11770a(0x93)]({'lockKey':_0x5331dc['lockKey'],'error':_0xa50987 instanceof Error?_0xa50987[_0x11770a(0x7a)]:String(_0xa50987)});}}return _0x2dffe1[_0x11770a(0x75)]=new Date()[_0x11770a(0xb4)](),await writeBffLockFile(_0x108a94[_0x11770a(0x74)],_0x282277),{'ok':_0x453f3a['length']===0x0,'data':{'pulled':_0x3afa45,'skipped':_0x446de4,'failed':_0x453f3a},'message':'Pull\x20complete:\x20'+_0x3afa45[_0x11770a(0x6b)]+_0x11770a(0xa6)+_0x446de4['length']+_0x11770a(0x99)+_0x453f3a['length']+_0x11770a(0xad)};}};async function hasUnsyncedLocalChanges(_0x363fb4,_0x3dc404,_0x5e0477){const _0x1bf98b=a31_0x4a63bb;if(!await fileExists(_0x363fb4))return![];const _0x377f55=await computeFileHash(_0x363fb4);if(!_0x3dc404)return _0x5e0477?_0x377f55!==_0x5e0477:!![];return _0x377f55!==_0x3dc404[_0x1bf98b(0x78)];}function buildDatasetCodeToAliasMap(_0x55519f,_0x46d5d2){const _0x3a9db9=a31_0x4a63bb,_0x898803=loadAliasMap(_0x55519f,undefined,resolveApiFilePath(_0x55519f,_0x46d5d2));return new Map(_0x898803[_0x3a9db9(0x8a)](_0x1b88ad=>[_0x1b88ad[_0x3a9db9(0x92)],_0x1b88ad[_0x3a9db9(0x89)]]));}async function confirmForce(){const _0x3bf190=a31_0x4a63bb,_0x450e22=createInterface({'input':process[_0x3bf190(0x98)],'output':process[_0x3bf190(0xaa)]}),_0x59d737=await new Promise(_0x45c581=>{const _0x395cfd=_0x3bf190;_0x450e22[_0x395cfd(0x9d)](_0x395cfd(0x72),_0x45c581);});return _0x450e22[_0x3bf190(0xaf)](),['y',_0x3bf190(0xb0)]['includes'](_0x59d737['trim']()[_0x3bf190(0x90)]());}function a31_0x2f35(){const _0x4cf57d=['skipped','/api/management/library/scripts/list?appCode=','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','6559890mzceib','lockFilePath','lastSync','str','pull','hash','parse','message','8ugYDtS','Remote\x20script\x20missing\x20content.','6811RNFsBK','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','1734966WWPgKT','nonInteractive','cancelled','HOOK','Lock\x20scope\x20for\x20app\x20\x22','hookLocation','unresolvable\x20target\x20path','Remote\x20script\x20missing\x20id.','COMMON','Force\x20overwrite\x20local\x20unsynced\x20changes','alias','map','1434AuSrJi','scriptsRoot','utf8','6MBtWhv','bool','toLowerCase','type','datasetCode','push','\x22\x20not\x20found\x20after\x20ensureLockScope.','boolean','bff','operationType','stdin','\x20skipped,\x20','functions','103029JHaLdH','functionNode','question','Would\x20inspect\x20','scriptContent','filePath','appCode','Pull\x20only\x20this\x20script\x20type','No\x20remote\x20BFF\x20scripts\x20found.','1002488lfEhys','conflict','\x20pulled,\x20','484095XMZAkk','all','functionName','stderr','scriptType','version','\x20failed','ENDPOINT','close','yes','apiDir','apps','force','toISOString','stringify','would_pull','length','write','lockKey','&type=','54013caUuSp'];a31_0x2f35=function(){return _0x4cf57d;};return a31_0x2f35();}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x185b03=a32_0x7e91;(function(_0x298363,_0x30f35a){const _0x52dd63=a32_0x7e91,_0x38a73f=_0x298363();while(!![]){try{const _0x3104c7=-parseInt(_0x52dd63(0xf7))/0x1*(parseInt(_0x52dd63(0xd7))/0x2)+parseInt(_0x52dd63(0xd6))/0x3*(-parseInt(_0x52dd63(0x107))/0x4)+-parseInt(_0x52dd63(0xd4))/0x5+parseInt(_0x52dd63(0x106))/0x6+-parseInt(_0x52dd63(0xf8))/0x7+parseInt(_0x52dd63(0xec))/0x8+-parseInt(_0x52dd63(0x10f))/0x9*(-parseInt(_0x52dd63(0x109))/0xa);if(_0x3104c7===_0x30f35a)break;else _0x38a73f['push'](_0x38a73f['shift']());}catch(_0x6737dd){_0x38a73f['push'](_0x38a73f['shift']());}}}(a32_0x5b22,0x9034b));import{readFile}from'node:fs/promises';function a32_0x7e91(_0xf458ae,_0x40ff3d){_0xf458ae=_0xf458ae-0xcf;const _0x5b2227=a32_0x5b22();let _0x7e913=_0x5b2227[_0xf458ae];return _0x7e913;}import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a32_0x5b22(){const _0x4fbb6a=['Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','alias','unchanged','ENDPOINT','36ybRlvm','name','push',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','type','script','version','\x20local\x20BFF\x20script(s)\x20for\x20push','lockFilePath','COMMON','5196220NknRDa','functionNode','3PVNvnn','430clQfYm','force','operationType','map','hash','filePath','scriptsRoot','string','datasetCode','functions','description','Push\x20local\x20BFF\x20scripts\x20to\x20remote','HOOK','POST','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','\x20uploaded,\x20','would_push','datasetId','bff','Local\x20function\x20not\x20found:\x20','remoteId','7783624uajdUx','validation','get','Push\x20complete:\x20','boolean','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','Incomplete\x20HOOK\x20path:\x20','Run\x20`','Cannot\x20resolve\x20dataset\x20for\x20\x22','\x20skipped,\x20','Force\x20push\x20ignoring\x20hash\x20protection','3278mDEcyT','1158108CUJzhL','update','message','appCode','values','length','lockKey','has','str','set','toISOString','/api/management/library/scripts/save','create','bool','1403790quNgeo','2852468nhHXmn','aliasToDatasetCode','5015810tNzaba','apiDir'];a32_0x5b22=function(){return _0x4fbb6a;};return a32_0x5b22();}export const bffPush={'service':a32_0x185b03(0xe9),'command':'push','description':a32_0x185b03(0xe2),'risk':'high-risk-write','flags':[{'name':a32_0x185b03(0x113),'type':'string','description':'Push\x20only\x20this\x20script\x20type','enum':[a32_0x185b03(0xd3),a32_0x185b03(0x10e),a32_0x185b03(0xe3)]},{'name':a32_0x185b03(0x110),'type':a32_0x185b03(0xde),'description':a32_0x185b03(0x10b)},{'name':'force','type':a32_0x185b03(0xf0),'description':a32_0x185b03(0xf6)}],async 'dryRun'(_0x3ad171){const _0x27e469=a32_0x185b03,_0x1eca51=loadBffProjectConfig(_0x3ad171[_0x27e469(0xfb)]),_0x332b9d=await readBffLockFile(_0x1eca51[_0x27e469(0xd2)]),{appLock:_0x714aca}=ensureLockScope(_0x332b9d??createEmptyBffLock(),_0x3ad171['appCode'],_0x1eca51['scriptsRoot'],_0x27e469(0x111)),_0x23be3e=await getTargetFunctions(_0x1eca51,_0x3ad171),_0x267a38=_0x3ad171['bool']('force'),_0x2fc905=[];for(const _0x4b3d92 of _0x23be3e){const _0x12211f=await computeFileHash(_0x4b3d92[_0x27e469(0xdc)]),_0x37ed7d=_0x714aca[_0x27e469(0xe0)][_0x4b3d92['lockKey']],_0x1f4458=!!_0x37ed7d&&_0x37ed7d[_0x27e469(0xdb)]===_0x12211f;_0x2fc905[_0x27e469(0x111)]({'lockKey':_0x4b3d92[_0x27e469(0xfe)],'filePath':_0x4b3d92[_0x27e469(0xdc)],'remoteId':_0x37ed7d?.[_0x27e469(0xeb)]??null,'mode':_0x37ed7d?.['remoteId']?_0x27e469(0xf9):_0x27e469(0x104),'status':!_0x267a38&&_0x1f4458?_0x27e469(0x10d):_0x27e469(0xe7)});}return{'method':_0x27e469(0xe4),'url':_0x27e469(0x103),'body':{'appCode':_0x3ad171['appCode'],'force':_0x267a38,'files':_0x2fc905},'description':'Would\x20inspect\x20'+_0x2fc905[_0x27e469(0xfd)]+_0x27e469(0xd1)};},async 'execute'(_0x364924){const _0x386a8a=a32_0x185b03,_0x4a2107=loadBffProjectConfig(_0x364924[_0x386a8a(0xfb)]),_0x4286dc=await readBffLockFile(_0x4a2107['lockFilePath']),{lockData:_0x345ac8,appLock:_0x2364b9}=ensureLockScope(_0x4286dc??createEmptyBffLock(),_0x364924['appCode'],_0x4a2107[_0x386a8a(0xdd)],_0x386a8a(0x111)),_0x394612=await getTargetFunctions(_0x4a2107,_0x364924);if(_0x394612['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0xeabcb4=_0x364924[_0x386a8a(0x105)](_0x386a8a(0xd8)),_0x456347=await buildHookMaps(_0x364924['appCode'],_0x364924[_0x386a8a(0x10a)],_0x394612,_0x2364b9),_0x1b98f6=[],_0x57376a=[],_0xe8ea79=[];for(const _0x21985e of _0x394612){const _0x1f9aa5=await computeFileHash(_0x21985e[_0x386a8a(0xdc)]),_0x45e5f1=_0x2364b9[_0x386a8a(0xe0)][_0x21985e['lockKey']];if(!_0xeabcb4&&_0x45e5f1&&_0x45e5f1[_0x386a8a(0xdb)]===_0x1f9aa5){_0x57376a[_0x386a8a(0x111)]({'lockKey':_0x21985e[_0x386a8a(0xfe)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x364924['appCode'],_0x21985e,_0x2364b9,_0x456347);const _0x10d36b=_0x2364b9['functions'][_0x21985e[_0x386a8a(0xfe)]];_0x1b98f6[_0x386a8a(0x111)]({'lockKey':_0x21985e['lockKey'],'remoteId':_0x10d36b?.[_0x386a8a(0xeb)]??0x0});}catch(_0x2c8c53){_0xe8ea79['push']({'lockKey':_0x21985e[_0x386a8a(0xfe)],'error':_0x2c8c53 instanceof Error?_0x2c8c53[_0x386a8a(0xfa)]:String(_0x2c8c53)});}}return _0x2364b9['lastSync']=new Date()[_0x386a8a(0x102)](),await writeBffLockFile(_0x4a2107[_0x386a8a(0xd2)],_0x345ac8),{'ok':_0xe8ea79[_0x386a8a(0xfd)]===0x0,'data':{'uploaded':_0x1b98f6,'skipped':_0x57376a,'failed':_0xe8ea79},'message':_0x386a8a(0xef)+_0x1b98f6[_0x386a8a(0xfd)]+_0x386a8a(0xe6)+_0x57376a[_0x386a8a(0xfd)]+_0x386a8a(0xf5)+_0xe8ea79['length']+'\x20failed'};}};async function getTargetFunctions(_0x2fbbc8,_0x12c432){const _0x4a4a93=a32_0x185b03,_0x58969d=_0x12c432[_0x4a4a93(0x100)](_0x4a4a93(0x113)),_0x285b5e=_0x12c432[_0x4a4a93(0x100)](_0x4a4a93(0x110)),_0x8955e2=normalizeBffType(_0x58969d)??undefined;if(_0x285b5e&&!_0x8955e2)throw CliErrors['validation'](_0x4a4a93(0xf1));const _0x12ea19=await scanLocalBffFunctions(_0x2fbbc8,_0x8955e2);if(_0x285b5e){const _0x3b08aa=_0x12ea19['filter'](_0x384820=>_0x384820[_0x4a4a93(0x110)]===_0x285b5e);if(_0x3b08aa[_0x4a4a93(0xfd)]===0x0)throw CliErrors[_0x4a4a93(0xed)](_0x4a4a93(0xea)+_0x8955e2+'/'+_0x285b5e);return _0x3b08aa;}return _0x12ea19;}async function buildHookMaps(_0x5192bf,_0x39a87d,_0x1d9cbe,_0x4e4cb7){const _0x338c08=a32_0x185b03,_0x5d1b5a=_0x1d9cbe['some'](_0x200cd4=>_0x200cd4[_0x338c08(0x113)]===_0x338c08(0xe3));if(!_0x5d1b5a)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x20f4ac=loadAliasMap(_0x39a87d,undefined,resolveApiFilePath(_0x39a87d,_0x5192bf)),_0x3b0abd=new Map(_0x20f4ac['map'](_0x14e40c=>[_0x14e40c[_0x338c08(0x10c)],_0x14e40c[_0x338c08(0xdf)]]));for(const _0x4c4a05 of Object[_0x338c08(0xfc)](_0x4e4cb7['functions'])){_0x4c4a05[_0x338c08(0x10c)]&&_0x4c4a05['datasetCode']&&!_0x3b0abd[_0x338c08(0xff)](_0x4c4a05[_0x338c08(0x10c)])&&_0x3b0abd[_0x338c08(0x101)](_0x4c4a05[_0x338c08(0x10c)],_0x4c4a05['datasetCode']);}const _0x4b2012=await listDatasets(_0x5192bf),_0x448fb8=new Map(_0x4b2012[_0x338c08(0xda)](_0x374cb8=>[_0x374cb8['code'],_0x374cb8['id']]));return{'aliasToDatasetCode':_0x3b0abd,'datasetCodeToId':_0x448fb8};}async function uploadSingleFunction(_0x1ef898,_0x1e057a,_0x522453,_0x4b0230){const _0x3ec668=a32_0x185b03,_0x1bbf78=await readFile(_0x1e057a[_0x3ec668(0xdc)],'utf8'),_0x3e2d77=await computeFileHash(_0x1e057a[_0x3ec668(0xdc)]),_0x571843=_0x522453['functions'][_0x1e057a[_0x3ec668(0xfe)]];if(_0x571843?.[_0x3ec668(0xeb)]&&_0x571843[_0x3ec668(0xd0)]==null)throw CliErrors[_0x3ec668(0xed)](_0x1e057a[_0x3ec668(0xfe)]+_0x3ec668(0x112));let _0x5d5461=extractScriptDescription(_0x1bbf78);if(!_0x5d5461&&_0x571843?.[_0x3ec668(0xeb)]){const _0x31d1fa=await getBffScriptInfo(_0x571843['remoteId']);_0x5d5461=_0x31d1fa[_0x3ec668(0xe1)]||undefined;}const _0x40ba69={'appCode':_0x1ef898,'functionName':_0x1e057a[_0x3ec668(0x110)],'scriptType':_0x1e057a['type'],'scriptContent':_0x1bbf78};if(_0x571843?.[_0x3ec668(0xeb)])_0x40ba69['id']=_0x571843[_0x3ec668(0xeb)];if(_0x571843?.[_0x3ec668(0xd0)]!=null)_0x40ba69[_0x3ec668(0xd0)]=_0x571843[_0x3ec668(0xd0)];if(_0x5d5461)_0x40ba69['description']=_0x5d5461;if(_0x1e057a[_0x3ec668(0x113)]===_0x3ec668(0xe3)){const _0x6b63db=_0x1e057a[_0x3ec668(0x10c)];if(!_0x6b63db||!_0x1e057a['operationType']||!_0x1e057a[_0x3ec668(0xd5)])throw CliErrors[_0x3ec668(0xed)](_0x3ec668(0xf2)+_0x1e057a[_0x3ec668(0xfe)]);const _0x365f79=_0x4b0230['aliasToDatasetCode'][_0x3ec668(0xee)](_0x6b63db)??_0x571843?.[_0x3ec668(0xdf)]??_0x6b63db,_0x5d016e=_0x4b0230['datasetCodeToId'][_0x3ec668(0xee)](_0x365f79);if(!_0x5d016e)throw CliErrors[_0x3ec668(0xed)](_0x3ec668(0xf4)+_0x6b63db+'\x22.\x20'+(_0x3ec668(0xf3)+CLI_BIN_NAME+_0x3ec668(0xe5)));_0x40ba69[_0x3ec668(0xe8)]=_0x5d016e,_0x40ba69['operationType']=_0x1e057a['operationType'],_0x40ba69[_0x3ec668(0xd5)]=_0x1e057a['functionNode'];}const _0xf1e3c5=await saveBffScript(_0x40ba69),_0x3ea91c=_0xf1e3c5['id'],_0xcbeb1a=_0xf1e3c5[_0x3ec668(0xcf)]??await getBffScriptInfo(_0x3ea91c),_0x54b53c={'hash':_0x3e2d77,'remoteId':_0x3ea91c,'version':_0xcbeb1a[_0x3ec668(0xd0)]};if(_0x1e057a[_0x3ec668(0x113)]==='HOOK'){const _0x158324=_0x1e057a['alias'],_0x25d4bc=_0x4b0230[_0x3ec668(0x108)]['get'](_0x158324)??_0x571843?.[_0x3ec668(0xdf)]??_0x158324;_0x4b0230['aliasToDatasetCode'][_0x3ec668(0xff)](_0x158324)?_0x54b53c['alias']=_0x158324:_0x54b53c[_0x3ec668(0x10c)]=_0x571843?.[_0x3ec668(0x10c)],_0x54b53c[_0x3ec668(0xdf)]=_0x25d4bc,_0x54b53c[_0x3ec668(0xd9)]=_0x1e057a['operationType'],_0x54b53c[_0x3ec668(0xd5)]=_0x1e057a['functionNode'];}_0x522453[_0x3ec668(0xe0)][_0x1e057a[_0x3ec668(0xfe)]]=_0x54b53c;}
|
|
1
|
+
const a32_0x365b4d=a32_0x5f59;(function(_0x2a09ed,_0x47138a){const _0x3628b7=a32_0x5f59,_0x52e5b2=_0x2a09ed();while(!![]){try{const _0x5018d4=-parseInt(_0x3628b7(0x9b))/0x1*(parseInt(_0x3628b7(0x82))/0x2)+-parseInt(_0x3628b7(0x8c))/0x3+-parseInt(_0x3628b7(0x81))/0x4+parseInt(_0x3628b7(0xa2))/0x5+-parseInt(_0x3628b7(0x83))/0x6+-parseInt(_0x3628b7(0xad))/0x7*(parseInt(_0x3628b7(0xb7))/0x8)+parseInt(_0x3628b7(0x75))/0x9*(parseInt(_0x3628b7(0xa4))/0xa);if(_0x5018d4===_0x47138a)break;else _0x52e5b2['push'](_0x52e5b2['shift']());}catch(_0x50f957){_0x52e5b2['push'](_0x52e5b2['shift']());}}}(a32_0x1591,0x1ea3f));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';function a32_0x1591(){const _0x2c4a09=['datasetCode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','validation','datasetCodeToId','type','Cannot\x20resolve\x20dataset\x20for\x20\x22','9667gfyxIo','remoteId','POST','set','string','description','aliasToDatasetCode','Local\x20function\x20not\x20found:\x20','lastSync','functionNode','1128yvECZY','bff','datasetId','alias','operationType','6675507ZQDSLs','apiDir','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','has','Run\x20`','lockKey','map','bool','values','script','some','ENDPOINT','437260rLzDEH','3106MMSjBz','179058XpRoKV','name','message','code','update','Would\x20inspect\x20','would_push','create','get','481977wFjDmz','\x20failed','\x22.\x20','appCode','Push\x20complete:\x20','Incomplete\x20HOOK\x20path:\x20','push','\x20uploaded,\x20','/api/management/library/scripts/save','lockFilePath','functions','toISOString','version','No\x20local\x20BFF\x20functions\x20found.','filePath','103NrisRN','force','\x20skipped,\x20','hash','filter','scriptsRoot','unchanged','191385pnQqno','length','10ZFTRjp','HOOK','high-risk-write'];a32_0x1591=function(){return _0x2c4a09;};return a32_0x1591();}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a32_0x5f59(_0x19f88f,_0x5d025f){_0x19f88f=_0x19f88f-0x74;const _0x159179=a32_0x1591();let _0x5f591c=_0x159179[_0x19f88f];return _0x5f591c;}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a32_0x365b4d(0xb8),'command':'push','description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a32_0x365b4d(0xa6),'flags':[{'name':a32_0x365b4d(0xab),'type':a32_0x365b4d(0xb1),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON',a32_0x365b4d(0x80),a32_0x365b4d(0xa5)]},{'name':'name','type':a32_0x365b4d(0xb1),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a32_0x365b4d(0x9c),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x50e052){const _0x5d6da8=a32_0x365b4d,_0x46aa96=loadBffProjectConfig(_0x50e052[_0x5d6da8(0x8f)]),_0x446cb6=await readBffLockFile(_0x46aa96[_0x5d6da8(0x95)]),{appLock:_0x3116c6}=ensureLockScope(_0x446cb6??createEmptyBffLock(),_0x50e052[_0x5d6da8(0x8f)],_0x46aa96[_0x5d6da8(0xa0)],_0x5d6da8(0x92)),_0xe7f0b8=await getTargetFunctions(_0x46aa96,_0x50e052),_0x1a618c=_0x50e052['bool']('force'),_0x31215a=[];for(const _0x6b644d of _0xe7f0b8){const _0xbc7237=await computeFileHash(_0x6b644d[_0x5d6da8(0x9a)]),_0x15c3e2=_0x3116c6[_0x5d6da8(0x96)][_0x6b644d['lockKey']],_0x554338=!!_0x15c3e2&&_0x15c3e2[_0x5d6da8(0x9e)]===_0xbc7237;_0x31215a['push']({'lockKey':_0x6b644d[_0x5d6da8(0x7a)],'filePath':_0x6b644d[_0x5d6da8(0x9a)],'remoteId':_0x15c3e2?.[_0x5d6da8(0xae)]??null,'mode':_0x15c3e2?.[_0x5d6da8(0xae)]?_0x5d6da8(0x87):_0x5d6da8(0x8a),'status':!_0x1a618c&&_0x554338?_0x5d6da8(0xa1):_0x5d6da8(0x89)});}return{'method':_0x5d6da8(0xaf),'url':_0x5d6da8(0x94),'body':{'appCode':_0x50e052[_0x5d6da8(0x8f)],'force':_0x1a618c,'files':_0x31215a},'description':_0x5d6da8(0x88)+_0x31215a[_0x5d6da8(0xa3)]+'\x20local\x20BFF\x20script(s)\x20for\x20push'};},async 'execute'(_0x4d3b61){const _0x54ef6c=a32_0x365b4d,_0x4c805c=loadBffProjectConfig(_0x4d3b61[_0x54ef6c(0x8f)]),_0x47d472=await readBffLockFile(_0x4c805c[_0x54ef6c(0x95)]),{lockData:_0x38112a,appLock:_0x42ad36}=ensureLockScope(_0x47d472??createEmptyBffLock(),_0x4d3b61[_0x54ef6c(0x8f)],_0x4c805c['scriptsRoot'],_0x54ef6c(0x92)),_0xd6c88b=await getTargetFunctions(_0x4c805c,_0x4d3b61);if(_0xd6c88b['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x54ef6c(0x99)};const _0x276025=_0x4d3b61[_0x54ef6c(0x7c)](_0x54ef6c(0x9c)),_0x3cc557=await buildHookMaps(_0x4d3b61[_0x54ef6c(0x8f)],_0x4d3b61[_0x54ef6c(0x76)],_0xd6c88b,_0x42ad36),_0x292c1f=[],_0x24f06b=[],_0x4bd4f1=[];for(const _0x505508 of _0xd6c88b){const _0x552f76=await computeFileHash(_0x505508['filePath']),_0x202177=_0x42ad36['functions'][_0x505508[_0x54ef6c(0x7a)]];if(!_0x276025&&_0x202177&&_0x202177[_0x54ef6c(0x9e)]===_0x552f76){_0x24f06b[_0x54ef6c(0x92)]({'lockKey':_0x505508['lockKey'],'reason':_0x54ef6c(0xa1)});continue;}try{await uploadSingleFunction(_0x4d3b61['appCode'],_0x505508,_0x42ad36,_0x3cc557);const _0x17b149=_0x42ad36[_0x54ef6c(0x96)][_0x505508[_0x54ef6c(0x7a)]];_0x292c1f[_0x54ef6c(0x92)]({'lockKey':_0x505508[_0x54ef6c(0x7a)],'remoteId':_0x17b149?.[_0x54ef6c(0xae)]??0x0});}catch(_0x238cbd){_0x4bd4f1[_0x54ef6c(0x92)]({'lockKey':_0x505508['lockKey'],'error':_0x238cbd instanceof Error?_0x238cbd[_0x54ef6c(0x85)]:String(_0x238cbd)});}}return _0x42ad36[_0x54ef6c(0xb5)]=new Date()[_0x54ef6c(0x97)](),await writeBffLockFile(_0x4c805c[_0x54ef6c(0x95)],_0x38112a),{'ok':_0x4bd4f1[_0x54ef6c(0xa3)]===0x0,'data':{'uploaded':_0x292c1f,'skipped':_0x24f06b,'failed':_0x4bd4f1},'message':_0x54ef6c(0x90)+_0x292c1f['length']+_0x54ef6c(0x93)+_0x24f06b[_0x54ef6c(0xa3)]+_0x54ef6c(0x9d)+_0x4bd4f1['length']+_0x54ef6c(0x8d)};}};async function getTargetFunctions(_0x3442d7,_0x3a7768){const _0x575d5b=a32_0x365b4d,_0x31d664=_0x3a7768['str'](_0x575d5b(0xab)),_0x50291b=_0x3a7768['str'](_0x575d5b(0x84)),_0x584f42=normalizeBffType(_0x31d664)??undefined;if(_0x50291b&&!_0x584f42)throw CliErrors[_0x575d5b(0xa9)](_0x575d5b(0x77));const _0x5ec8d7=await scanLocalBffFunctions(_0x3442d7,_0x584f42);if(_0x50291b){const _0x4e72d=_0x5ec8d7[_0x575d5b(0x9f)](_0xae4ee=>_0xae4ee[_0x575d5b(0x84)]===_0x50291b);if(_0x4e72d[_0x575d5b(0xa3)]===0x0)throw CliErrors[_0x575d5b(0xa9)](_0x575d5b(0xb4)+_0x584f42+'/'+_0x50291b);return _0x4e72d;}return _0x5ec8d7;}async function buildHookMaps(_0x5b4d00,_0x100e26,_0x348724,_0x972808){const _0x1a97f6=a32_0x365b4d,_0x36ec5f=_0x348724[_0x1a97f6(0x7f)](_0x2c2920=>_0x2c2920[_0x1a97f6(0xab)]===_0x1a97f6(0xa5));if(!_0x36ec5f)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0xefaf8d=loadAliasMap(_0x100e26,undefined,resolveApiFilePath(_0x100e26,_0x5b4d00)),_0x4cfe46=new Map(_0xefaf8d[_0x1a97f6(0x7b)](_0x21a977=>[_0x21a977[_0x1a97f6(0xba)],_0x21a977[_0x1a97f6(0xa7)]]));for(const _0x1e3876 of Object[_0x1a97f6(0x7d)](_0x972808[_0x1a97f6(0x96)])){_0x1e3876[_0x1a97f6(0xba)]&&_0x1e3876['datasetCode']&&!_0x4cfe46[_0x1a97f6(0x78)](_0x1e3876['alias'])&&_0x4cfe46[_0x1a97f6(0xb0)](_0x1e3876['alias'],_0x1e3876[_0x1a97f6(0xa7)]);}const _0xf4fe03=await listDatasets(_0x5b4d00),_0x527335=new Map(_0xf4fe03[_0x1a97f6(0x7b)](_0xb5aed6=>[_0xb5aed6[_0x1a97f6(0x86)],_0xb5aed6['id']]));return{'aliasToDatasetCode':_0x4cfe46,'datasetCodeToId':_0x527335};}async function uploadSingleFunction(_0x21a398,_0x1fae8c,_0x5b2746,_0x429684){const _0x3c7179=a32_0x365b4d,_0x1f0a80=await readFile(_0x1fae8c['filePath'],'utf8'),_0x580d59=await computeFileHash(_0x1fae8c[_0x3c7179(0x9a)]),_0x5a0700=_0x5b2746[_0x3c7179(0x96)][_0x1fae8c[_0x3c7179(0x7a)]];if(_0x5a0700?.['remoteId']&&_0x5a0700[_0x3c7179(0x98)]==null)throw CliErrors['validation'](_0x1fae8c[_0x3c7179(0x7a)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x41c7a2=extractScriptDescription(_0x1f0a80);if(!_0x41c7a2&&_0x5a0700?.[_0x3c7179(0xae)]){const _0x5b6afa=await getBffScriptInfo(_0x5a0700['remoteId']);_0x41c7a2=_0x5b6afa[_0x3c7179(0xb2)]||undefined;}const _0x360b57={'appCode':_0x21a398,'functionName':_0x1fae8c[_0x3c7179(0x84)],'scriptType':_0x1fae8c['type'],'scriptContent':_0x1f0a80};if(_0x5a0700?.['remoteId'])_0x360b57['id']=_0x5a0700['remoteId'];if(_0x5a0700?.['version']!=null)_0x360b57[_0x3c7179(0x98)]=_0x5a0700[_0x3c7179(0x98)];if(_0x41c7a2)_0x360b57[_0x3c7179(0xb2)]=_0x41c7a2;if(_0x1fae8c[_0x3c7179(0xab)]===_0x3c7179(0xa5)){const _0x27ea63=_0x1fae8c['alias'];if(!_0x27ea63||!_0x1fae8c['operationType']||!_0x1fae8c[_0x3c7179(0xb6)])throw CliErrors[_0x3c7179(0xa9)](_0x3c7179(0x91)+_0x1fae8c[_0x3c7179(0x7a)]);const _0xa296ff=_0x429684['aliasToDatasetCode'][_0x3c7179(0x8b)](_0x27ea63)??_0x5a0700?.[_0x3c7179(0xa7)]??_0x27ea63,_0x24c611=_0x429684[_0x3c7179(0xaa)][_0x3c7179(0x8b)](_0xa296ff);if(!_0x24c611)throw CliErrors['validation'](_0x3c7179(0xac)+_0x27ea63+_0x3c7179(0x8e)+(_0x3c7179(0x79)+CLI_BIN_NAME+_0x3c7179(0xa8)));_0x360b57[_0x3c7179(0xb9)]=_0x24c611,_0x360b57['operationType']=_0x1fae8c[_0x3c7179(0x74)],_0x360b57[_0x3c7179(0xb6)]=_0x1fae8c[_0x3c7179(0xb6)];}const _0x1f0139=await saveBffScript(_0x360b57),_0x4952fa=_0x1f0139['id'],_0x4f8549=_0x1f0139[_0x3c7179(0x7e)]??await getBffScriptInfo(_0x4952fa),_0x38588f={'hash':_0x580d59,'remoteId':_0x4952fa,'version':_0x4f8549[_0x3c7179(0x98)]};if(_0x1fae8c[_0x3c7179(0xab)]===_0x3c7179(0xa5)){const _0x382e8a=_0x1fae8c[_0x3c7179(0xba)],_0x4f040d=_0x429684[_0x3c7179(0xb3)][_0x3c7179(0x8b)](_0x382e8a)??_0x5a0700?.[_0x3c7179(0xa7)]??_0x382e8a;_0x429684[_0x3c7179(0xb3)]['has'](_0x382e8a)?_0x38588f[_0x3c7179(0xba)]=_0x382e8a:_0x38588f[_0x3c7179(0xba)]=_0x5a0700?.['alias'],_0x38588f['datasetCode']=_0x4f040d,_0x38588f[_0x3c7179(0x74)]=_0x1fae8c[_0x3c7179(0x74)],_0x38588f[_0x3c7179(0xb6)]=_0x1fae8c[_0x3c7179(0xb6)];}_0x5b2746['functions'][_0x1fae8c[_0x3c7179(0x7a)]]=_0x38588f;}
|