@lovrabet/rabetbase-cli 2.3.1 → 2.3.2-beta.1
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/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.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-skill/index.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/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -0
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.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/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.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/relation-audit.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/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/commands/workspace/index.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/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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/update-notice.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
package/lib/commands/app/add.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x22f1bc=a18_0x444b;(function(_0x347120,_0x13c92d){const _0x350163=a18_0x444b,_0xdf0a5c=_0x347120();while(!![]){try{const _0xf4f0a9=parseInt(_0x350163(0x17e))/0x1+-parseInt(_0x350163(0x190))/0x2+parseInt(_0x350163(0x18a))/0x3+-parseInt(_0x350163(0x186))/0x4*(-parseInt(_0x350163(0x17a))/0x5)+-parseInt(_0x350163(0x188))/0x6*(parseInt(_0x350163(0x184))/0x7)+parseInt(_0x350163(0x18b))/0x8*(parseInt(_0x350163(0x189))/0x9)+-parseInt(_0x350163(0x181))/0xa*(-parseInt(_0x350163(0x191))/0xb);if(_0xf4f0a9===_0x13c92d)break;else _0xdf0a5c['push'](_0xdf0a5c['shift']());}catch(_0x24f7f1){_0xdf0a5c['push'](_0xdf0a5c['shift']());}}}(a18_0x26a3,0x587a0));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';function a18_0x26a3(){const _0x3dee15=['App\x20code','name','app','global','\x20app\x20add\x20<name>\x20--appcode\x20<code>','\x20Set\x20as\x20default\x20app.','Usage:\x20','2542585HUscTE','flagMissing','bool','write','191010EFoGRW','\x20app\x20\x22','appcode','30avaoyW','Updated','Added','7dRhxsA','Missing\x20app\x20name.','4lxDELl','\x22\x20(appcode:\x20','4097334ulNiFp','9ePDrFG','2093313atwgZc','284920hbUvQT','trim','add','Add\x20or\x20update\x20an\x20app\x20in\x20config','validation','1095990GFcpLa','588027QPsnME','defaultApp','str','args','apps'];a18_0x26a3=function(){return _0x3dee15;};return a18_0x26a3();}function a18_0x444b(_0x392139,_0x1bdf28){_0x392139=_0x392139-0x171;const _0x26a395=a18_0x26a3();let _0x444b72=_0x26a395[_0x392139];return _0x444b72;}async function validateArgs(_0x3e98a4){const _0x9fb33c=a18_0x444b,_0x3100af=_0x3e98a4[_0x9fb33c(0x171)][0x0]?.[_0x9fb33c(0x18c)]();if(!_0x3100af)throw CliErrors[_0x9fb33c(0x18f)](_0x9fb33c(0x185),_0x9fb33c(0x179)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>');}async function execute(_0x258e8f){const _0x1c04aa=a18_0x444b,_0x37cfda=_0x258e8f[_0x1c04aa(0x171)][0x0]?.['trim']();if(!_0x37cfda)throw CliErrors[_0x1c04aa(0x18f)](_0x1c04aa(0x185),'Usage:\x20'+CLI_BIN_NAME+_0x1c04aa(0x177));const _0x2ab117=_0x258e8f['str'](_0x1c04aa(0x180));if(!_0x2ab117)throw CliErrors[_0x1c04aa(0x17b)]('appcode',_0x1c04aa(0x179)+CLI_BIN_NAME+_0x1c04aa(0x177));const _0x10f3e1={'global':_0x258e8f[_0x1c04aa(0x17c)](_0x1c04aa(0x176))},_0x7b7585=readConfig(_0x10f3e1);if(!_0x7b7585[_0x1c04aa(0x172)])_0x7b7585['apps']={};const _0x36cd5f={'appcode':_0x2ab117,...collectAppProfileOverrides(_0xd9098e=>_0x258e8f[_0x1c04aa(0x193)](_0xd9098e))},_0x48b818=_0x7b7585[_0x1c04aa(0x172)],_0x4d38cf=!!_0x48b818[_0x37cfda];_0x48b818[_0x37cfda]=_0x36cd5f;if(!_0x7b7585[_0x1c04aa(0x192)])_0x7b7585[_0x1c04aa(0x192)]=_0x37cfda;writeConfig(_0x7b7585,_0x10f3e1);const _0x106b5=!_0x4d38cf&&_0x7b7585[_0x1c04aa(0x192)]===_0x37cfda?_0x1c04aa(0x178):'',_0x3c072b=(_0x4d38cf?_0x1c04aa(0x182):_0x1c04aa(0x183))+_0x1c04aa(0x17f)+_0x37cfda+_0x1c04aa(0x187)+_0x2ab117+')'+scopeLabel(_0x10f3e1)+'.'+_0x106b5;return{'ok':!![],'message':_0x3c072b};}export const appAddDefinition={'service':a18_0x22f1bc(0x175),'command':a18_0x22f1bc(0x18d),'description':a18_0x22f1bc(0x18e),'risk':a18_0x22f1bc(0x17d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a18_0x22f1bc(0x174),'description':'App\x20profile\x20name','required':!![]}],'flags':[{'name':a18_0x22f1bc(0x180),'type':'string','description':a18_0x22f1bc(0x173),'required':!![]},{'name':a18_0x22f1bc(0x176),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a19_0x263997=a19_0x285f;function a19_0x285f(_0x353201,_0xfd8e4c){_0x353201=_0x353201-0x7a;const _0x4b7a93=a19_0x4b7a();let _0x285f4f=_0x4b7a93[_0x353201];return _0x285f4f;}(function(_0x23291e,_0x512523){const _0x2c9fbe=a19_0x285f,_0x2e08c7=_0x23291e();while(!![]){try{const _0x3e3059=parseInt(_0x2c9fbe(0x7d))/0x1*(parseInt(_0x2c9fbe(0x80))/0x2)+-parseInt(_0x2c9fbe(0x87))/0x3+parseInt(_0x2c9fbe(0x84))/0x4*(parseInt(_0x2c9fbe(0x82))/0x5)+-parseInt(_0x2c9fbe(0x85))/0x6+parseInt(_0x2c9fbe(0x7f))/0x7+-parseInt(_0x2c9fbe(0x7c))/0x8+parseInt(_0x2c9fbe(0x83))/0x9;if(_0x3e3059===_0x512523)break;else _0x2e08c7['push'](_0x2e08c7['shift']());}catch(_0x3ffdd9){_0x2e08c7['push'](_0x2e08c7['shift']());}}}(a19_0x4b7a,0x95df0));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';export const APP_REMOTE_DEPRECATED_MESSAGE='`rabetbase\x20app\x20remote`\x20is\x20deprecated.\x20Use\x20`rabetbase\x20app\x20list\x20--remote`\x20instead.';function resolveCookie(_0x49a16b){const _0x221b23=a19_0x285f,_0x1fa3f3=_0x49a16b[_0x221b23(0x7b)]||getCookie();if(!_0x1fa3f3)throw CliErrors[_0x221b23(0x81)]();return _0x1fa3f3;}function a19_0x4b7a(){const _0x2b2044=['authRequired','95NrOyEA','2805066tXkVZb','241816RbLlRS','4567218BFZylu','remote','3068988iYNgOZ','rabetbase\x20app\x20list\x20--remote','app','Deprecated:\x20use\x20app\x20list\x20--remote','appDesc','cookie','784040PFfXaa','1kkrCnf','read','2058847YeEHmQ','1483310wwJxMT'];a19_0x4b7a=function(){return _0x2b2044;};return a19_0x4b7a();}export async function listRemoteAppDirectory(_0x232e3f){const _0x3604bc=a19_0x285f,_0x51c504=await withActiveCookie(resolveCookie(_0x232e3f),()=>listRemoteApps());return{'items':_0x51c504['map'](_0x2a141f=>({..._0x2a141f['id']!=null?{'id':_0x2a141f['id']}:{},'appCode':_0x2a141f['appCode'],'appName':_0x2a141f['appName'],..._0x2a141f[_0x3604bc(0x7a)]!=null?{'appDesc':_0x2a141f[_0x3604bc(0x7a)]}:{}})),'meta':{'source':'platform'}};}async function execute(_0x101b68){return{'ok':!![],'data':await listRemoteAppDirectory(_0x101b68)};}export const appRemoteDefinition={'service':a19_0x263997(0x89),'command':a19_0x263997(0x86),'description':a19_0x263997(0x8a),'risk':a19_0x263997(0x7e),'auth':'required','requiresAuth':!![],'requiresAppCode':![],'deprecated':{'replacement':a19_0x263997(0x88)},'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d45df,_0x42da96){const _0x2a353d=a20_0x1399,_0x58a724=_0x1d45df();while(!![]){try{const _0x38f042=parseInt(_0x2a353d(0xff))/0x1+-parseInt(_0x2a353d(0x100))/0x2*(-parseInt(_0x2a353d(0xfd))/0x3)+-parseInt(_0x2a353d(0xf8))/0x4*(-parseInt(_0x2a353d(0xfb))/0x5)+parseInt(_0x2a353d(0x102))/0x6*(-parseInt(_0x2a353d(0x101))/0x7)+parseInt(_0x2a353d(0xfc))/0x8*(parseInt(_0x2a353d(0xf7))/0x9)+-parseInt(_0x2a353d(0xfe))/0xa*(-parseInt(_0x2a353d(0xfa))/0xb)+parseInt(_0x2a353d(0x103))/0xc*(-parseInt(_0x2a353d(0xf9))/0xd);if(_0x38f042===_0x42da96)break;else _0x58a724['push'](_0x58a724['shift']());}catch(_0x140fba){_0x58a724['push'](_0x58a724['shift']());}}}(a20_0x57a6,0x5bf6c));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';function a20_0x57a6(){const _0x29c69b=['206557vRyqAQ','1463UtzSva','25QUHWdA','152CencFB','224673YnIBVS','14470KVjsLx','271555bXsdPc','14IBMtcE','7217JxzzxS','1020aeFACK','1104BxPXsE','329769DRyksc','263456txwmzK'];a20_0x57a6=function(){return _0x29c69b;};return a20_0x57a6();}function a20_0x1399(_0x509e5f,_0x5907c4){_0x509e5f=_0x509e5f-0xf7;const _0x57a6d9=a20_0x57a6();let _0x1399d2=_0x57a6d9[_0x509e5f];return _0x1399d2;}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
|
+
function a21_0x3a8c(_0x306829,_0x238e10){_0x306829=_0x306829-0xd5;const _0x556701=a21_0x5567();let _0x3a8c15=_0x556701[_0x306829];return _0x3a8c15;}const a21_0x433d93=a21_0x3a8c;(function(_0x3d9a85,_0x2f88f1){const _0x5c7f8d=a21_0x3a8c,_0x24459e=_0x3d9a85();while(!![]){try{const _0x37a9ae=-parseInt(_0x5c7f8d(0xe5))/0x1*(parseInt(_0x5c7f8d(0xec))/0x2)+parseInt(_0x5c7f8d(0xf5))/0x3+-parseInt(_0x5c7f8d(0xf6))/0x4+-parseInt(_0x5c7f8d(0xe7))/0x5+-parseInt(_0x5c7f8d(0xda))/0x6+-parseInt(_0x5c7f8d(0xf8))/0x7*(parseInt(_0x5c7f8d(0xe1))/0x8)+-parseInt(_0x5c7f8d(0xfa))/0x9*(-parseInt(_0x5c7f8d(0xf0))/0xa);if(_0x37a9ae===_0x2f88f1)break;else _0x24459e['push'](_0x24459e['shift']());}catch(_0x4f197d){_0x24459e['push'](_0x24459e['shift']());}}}(a21_0x5567,0x3d403));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/discover.js';function buildItemsFromLayer(_0x4e45a2,_0x32906f){const _0x3bb6d3=a21_0x3a8c,_0x2c16e5=[],_0x3c5ed2=_0x4e45a2[_0x3bb6d3(0xde)]&&typeof _0x4e45a2[_0x3bb6d3(0xde)]==='object'?_0x4e45a2[_0x3bb6d3(0xde)]:{},_0x5b5e5e=_0x4e45a2['defaultApp']||undefined;for(const [_0x45de1a,_0x14f1af]of Object[_0x3bb6d3(0xe9)](_0x3c5ed2)){if(!_0x14f1af||typeof _0x14f1af!=='object'||!_0x14f1af[_0x3bb6d3(0xf3)])continue;_0x2c16e5[_0x3bb6d3(0xe8)]({'name':_0x45de1a,'appcode':_0x14f1af[_0x3bb6d3(0xf3)],'named':!![],'definedIn':_0x32906f,'isDefault':_0x45de1a===_0x5b5e5e,...buildAppProfileListFields(_0x14f1af)});}return _0x2c16e5;}function buildMergedItems(_0x16a56c,_0x4cc71f){const _0x57e23d=a21_0x3a8c,{apps:apps={},defaultApp:_0xf523b1}=_0x16a56c,_0xc29445=_0x4cc71f[_0x57e23d(0xf2)][_0x57e23d(0xde)]&&typeof _0x4cc71f[_0x57e23d(0xf2)][_0x57e23d(0xde)]==='object'?_0x4cc71f[_0x57e23d(0xf2)][_0x57e23d(0xde)]:{},_0x432e5b=_0x4cc71f['projectConfig'][_0x57e23d(0xde)]&&typeof _0x4cc71f[_0x57e23d(0xe2)][_0x57e23d(0xde)]===_0x57e23d(0xdb)?_0x4cc71f[_0x57e23d(0xe2)][_0x57e23d(0xde)]:{},_0x3ebd1f=_0x4cc71f[_0x57e23d(0xe2)][_0x57e23d(0xee)]===![],_0x1be084=Object[_0x57e23d(0xe9)](apps),_0x407da5=_0x1be084[_0x57e23d(0xd8)](([_0x38ee20,_0x1ee2af])=>({'name':_0x38ee20,'appcode':_0x1ee2af[_0x57e23d(0xf3)],'named':!![],'definedIn':appDefinedIn(_0x38ee20,_0xc29445,_0x432e5b,_0x3ebd1f),'isDefault':_0x38ee20===_0xf523b1,...buildAppProfileListFields(_0x1ee2af)}));return _0x407da5;}function validateAppListFlags(_0x184f6b){const _0x26b1c3=a21_0x3a8c;if(!_0x184f6b[_0x26b1c3(0xef)](_0x26b1c3(0xfb)))return;if(!_0x184f6b[_0x26b1c3(0xef)](_0x26b1c3(0xdd))&&!_0x184f6b[_0x26b1c3(0xef)](_0x26b1c3(0xe4)))return;throw CliErrors[_0x26b1c3(0xfc)](_0x26b1c3(0x100),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x5f3bd0){const _0x8323f4=a21_0x3a8c;validateAppListFlags(_0x5f3bd0);if(_0x5f3bd0['bool'](_0x8323f4(0xfb)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x5f3bd0)};const _0x3661c8=_0x5f3bd0[_0x8323f4(0xef)](_0x8323f4(0xdd)),_0x2f3339=_0x5f3bd0['bool'](_0x8323f4(0xe4)),_0x4630ee=_0x3661c8?_0x8323f4(0xdd):_0x2f3339?_0x8323f4(0xe4):_0x8323f4(0xf1),{config:_0x354596,layers:_0x38bc9b}=readRawConfigWithLayers(),_0x403135=resolveDefaultAppSource(_0x38bc9b),{defaultApp:_0x5873f0}=_0x354596;let _0x756ef3,_0x15c2dd;switch(_0x4630ee){case _0x8323f4(0xdd):_0x756ef3=buildItemsFromLayer(_0x38bc9b[_0x8323f4(0xf2)],_0x8323f4(0xdd)),_0x15c2dd=_0x38bc9b[_0x8323f4(0xf7)];break;case _0x8323f4(0xe4):_0x756ef3=buildItemsFromLayer(_0x38bc9b[_0x8323f4(0xe2)],_0x8323f4(0xe4)),_0x15c2dd=_0x38bc9b[_0x8323f4(0xed)];break;default:_0x756ef3=buildMergedItems(_0x354596,_0x38bc9b);break;}enrichAppListItemsWithMergedSelection(_0x756ef3,_0x5f3bd0[_0x8323f4(0xe3)]);if(_0x756ef3[_0x8323f4(0xd7)]===0x0){const _0x76a6d4=_0x4630ee===_0x8323f4(0xf1)?'':_0x8323f4(0xd6)+_0x4630ee+_0x8323f4(0xd9);return{'ok':!![],'data':[],'message':_0x8323f4(0xfe)+_0x76a6d4+_0x8323f4(0xdf)+CLI_BIN_NAME+_0x8323f4(0xfd)};}const _0x508482=_0x756ef3[_0x8323f4(0xe6)](_0x19cb87=>_0x19cb87[_0x8323f4(0xeb)]===!![]),_0x352433=_0x5873f0??_0x508482?.['appcode']??null,_0x278927=_0x4630ee==='merged'?{'globalPath':_0x38bc9b[_0x8323f4(0xf7)]??null,'projectPath':_0x38bc9b[_0x8323f4(0xed)]??null,'defaultApp':_0x352433,'defaultAppSource':_0x5873f0!=null?_0x403135:null}:{'scope':_0x4630ee,'configPath':_0x15c2dd??null};return{'ok':!![],'data':{'items':_0x756ef3,'meta':_0x278927}};}export const appListDefinition={'service':'app','command':a21_0x433d93(0xf4),'description':a21_0x433d93(0xf9),'risk':'read','auth':a21_0x433d93(0xdc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x433d93(0xfb),'type':a21_0x433d93(0xff),'description':a21_0x433d93(0xd5),'default':![]},{'name':'global','type':a21_0x433d93(0xff),'description':a21_0x433d93(0xe0),'default':![]},{'name':a21_0x433d93(0xe4),'type':a21_0x433d93(0xff),'description':a21_0x433d93(0xea),'default':![]}],async 'validate'(_0x3a366c){validateAppListFlags(_0x3a366c);},'execute':execute};function a21_0x5567(){const _0x26bf1f=['\x20config','1576314ocJeKZ','object','optional','global','apps','.\x20Use\x20`','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','1533096YMEjyK','projectConfig','mergedCli','project','78604lZEFrE','find','1472475jKPGWQ','push','entries','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','isCurrent','10iAqfsR','projectPath','inherit','bool','290gNXRzs','merged','globalConfig','appcode','list','1497132PLDjTc','1244148nFPHpT','globalPath','7pzuJKV','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','373887oSxElQ','remote','validation','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','No\x20apps\x20configured','boolean','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','\x20in\x20','length','map'];a21_0x5567=function(){return _0x26bf1f;};return a21_0x5567();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x17abbe=a22_0x66bb;(function(_0x48140e,_0x55d108){const _0x3d81bd=a22_0x66bb,_0x1d8801=_0x48140e();while(!![]){try{const _0x34059a=parseInt(_0x3d81bd(0x16d))/0x1+-parseInt(_0x3d81bd(0x162))/0x2*(-parseInt(_0x3d81bd(0x14d))/0x3)+-parseInt(_0x3d81bd(0x15d))/0x4+-parseInt(_0x3d81bd(0x164))/0x5*(-parseInt(_0x3d81bd(0x148))/0x6)+-parseInt(_0x3d81bd(0x163))/0x7*(parseInt(_0x3d81bd(0x155))/0x8)+parseInt(_0x3d81bd(0x14f))/0x9*(-parseInt(_0x3d81bd(0x15e))/0xa)+parseInt(_0x3d81bd(0x15c))/0xb*(parseInt(_0x3d81bd(0x16b))/0xc);if(_0x34059a===_0x55d108)break;else _0x1d8801['push'](_0x1d8801['shift']());}catch(_0x51c19c){_0x1d8801['push'](_0x1d8801['shift']());}}}(a22_0x1ebe,0x210d3));import{CliErrors}from'../../errors.js';function a22_0x66bb(_0x239312,_0x38f1eb){_0x239312=_0x239312-0x147;const _0x1ebe5a=a22_0x1ebe();let _0x66bb04=_0x1ebe5a[_0x239312];return _0x66bb04;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a22_0x1ebe(){const _0x40486d=['trim','Missing\x20app\x20name.','keys','project','name','object','6792XrWVeA','Use\x20global\x20config\x20scope','195891MRtpGO','App\x20profile\x20name\x20to\x20remove','Remove\x20an\x20app\x20from\x20config','projectConfig','902202acHgaT','app','boolean','defaultApp','bool','325608RgfPZc','Usage:\x20','171trjUbV','both','inherit','length','globalConfig','apps','824696HguDRO','args','global','\x20Note:\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','\x22\x20not\x20found.','\x20app\x20remove\x20<name>\x20[--global]','2321mpLDAV','969156SgRWxU','52060HaKLWE','validation','\x20config.','App\x20\x22','4EkBMLZ','14tUSAlQ','5icrunV'];a22_0x1ebe=function(){return _0x40486d;};return a22_0x1ebe();}async function validateArgs(_0x15366f){const _0x158950=a22_0x66bb,_0x49b862=_0x15366f[_0x158950(0x156)][0x0]?.[_0x158950(0x165)]();if(!_0x49b862)throw CliErrors[_0x158950(0x15f)](_0x158950(0x166),_0x158950(0x14e)+CLI_BIN_NAME+_0x158950(0x15b));}async function execute(_0x4f7f83){const _0x5654f2=a22_0x66bb,_0x39998e=_0x4f7f83['args'][0x0]?.['trim']();if(!_0x39998e)throw CliErrors['validation'](_0x5654f2(0x166),_0x5654f2(0x14e)+CLI_BIN_NAME+_0x5654f2(0x15b));const _0x19164d=_0x4f7f83[_0x5654f2(0x14c)](_0x5654f2(0x157)),{config:_0x4a721b,layers:_0x407065}=readRawConfigWithLayers(),_0xd6bb37=_0x4a721b[_0x5654f2(0x154)]??{};if(!_0xd6bb37[_0x39998e])throw CliErrors[_0x5654f2(0x15f)](_0x5654f2(0x161)+_0x39998e+_0x5654f2(0x15a));const _0x33a9ab=_0x407065['globalConfig'][_0x5654f2(0x154)]&&typeof _0x407065[_0x5654f2(0x153)][_0x5654f2(0x154)]===_0x5654f2(0x16a)?_0x407065[_0x5654f2(0x153)][_0x5654f2(0x154)]:{},_0x2e620c=_0x407065['projectConfig'][_0x5654f2(0x154)]&&typeof _0x407065['projectConfig'][_0x5654f2(0x154)]===_0x5654f2(0x16a)?_0x407065[_0x5654f2(0x147)][_0x5654f2(0x154)]:{},_0x383b1f=appDefinedIn(_0x39998e,_0x33a9ab,_0x2e620c,_0x407065[_0x5654f2(0x147)][_0x5654f2(0x151)]===![]),_0x5f1bd4=resolveAppScopeForWrite(_0x39998e,_0x19164d,_0x407065),_0x250cd7={'global':_0x5f1bd4===_0x5654f2(0x157)},_0x48fbce=readConfig(_0x250cd7),_0x3e050f=_0x48fbce['apps'];if(!_0x3e050f||!_0x3e050f[_0x39998e])throw CliErrors['validation'](_0x5654f2(0x161)+_0x39998e+_0x5654f2(0x15a));delete _0x3e050f[_0x39998e];let _0x4bfd92='';if(_0x48fbce[_0x5654f2(0x14b)]===_0x39998e){const _0x407246=Object['keys'](_0x3e050f);_0x48fbce[_0x5654f2(0x14b)]=_0x407246[_0x5654f2(0x152)]>0x0?_0x407246[0x0]:undefined,_0x48fbce[_0x5654f2(0x14b)]?_0x4bfd92='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x48fbce[_0x5654f2(0x14b)]+'\x22.':delete _0x48fbce[_0x5654f2(0x14b)];}Object[_0x5654f2(0x167)](_0x3e050f)['length']===0x0&&(delete _0x48fbce[_0x5654f2(0x154)],delete _0x48fbce['defaultApp']);writeConfig(_0x48fbce,_0x250cd7);const _0x5ef96d=_0x383b1f===_0x5654f2(0x150)?_0x5654f2(0x158)+_0x39998e+_0x5654f2(0x159)+(_0x5f1bd4===_0x5654f2(0x168)?_0x5654f2(0x157):_0x5654f2(0x168))+_0x5654f2(0x160):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x39998e+'\x22'+scopeLabel(_0x250cd7)+'.'+_0x4bfd92+_0x5ef96d};}export const appRemoveDefinition={'service':a22_0x17abbe(0x149),'command':'remove','description':a22_0x17abbe(0x16f),'risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x17abbe(0x169),'description':a22_0x17abbe(0x16e),'required':!![]}],'flags':[{'name':a22_0x17abbe(0x157),'type':a22_0x17abbe(0x14a),'description':a22_0x17abbe(0x16c),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14dca6,_0x3f3521){const _0x44846d=a23_0x5128,_0x4b6db4=_0x14dca6();while(!![]){try{const _0x2e4279=-parseInt(_0x44846d(0x1ff))/0x1*(-parseInt(_0x44846d(0x1f1))/0x2)+-parseInt(_0x44846d(0x1ee))/0x3*(parseInt(_0x44846d(0x203))/0x4)+parseInt(_0x44846d(0x1ed))/0x5+parseInt(_0x44846d(0x1f7))/0x6+parseInt(_0x44846d(0x1eb))/0x7*(parseInt(_0x44846d(0x1fa))/0x8)+-parseInt(_0x44846d(0x1e5))/0x9*(parseInt(_0x44846d(0x1f4))/0xa)+parseInt(_0x44846d(0x1e9))/0xb;if(_0x2e4279===_0x3f3521)break;else _0x4b6db4['push'](_0x4b6db4['shift']());}catch(_0x11c36f){_0x4b6db4['push'](_0x4b6db4['shift']());}}}(a23_0x157a,0x65a6c));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x10c28a,_0x25b894){const _0x564653=a23_0x5128;if(!_0x25b894)return;const _0x712424=_0x25b894[_0x564653(0x200)]&&typeof _0x25b894['apps']===_0x564653(0x1f2)?_0x25b894['apps']:{},_0x240671=Object[_0x564653(0x1f3)](_0x712424)[_0x564653(0x1ec)]>0x0;for(const _0x485f44 of _0x10c28a){_0x485f44['isCurrent']=![];}const _0x4eb46f=_0x25b894['appCode']!=null?String(_0x25b894[_0x564653(0x1fe)])['trim']():'';if(_0x240671){const _0x4059d8=_0x25b894[_0x564653(0x201)]??_0x25b894[_0x564653(0x1f6)];if(_0x4059d8)for(const _0x3c5863 of _0x10c28a){_0x3c5863[_0x564653(0x202)]===!![]&&_0x3c5863[_0x564653(0x1fc)]===_0x4059d8&&(_0x3c5863[_0x564653(0x1e6)]=!![]);}for(const _0x40c574 of _0x10c28a){if(_0x40c574[_0x564653(0x202)]!==![])continue;if(_0x25b894['defaultApp'])continue;_0x4eb46f&&String(_0x40c574[_0x564653(0x1ea)]??'')['trim']()===_0x4eb46f&&(_0x40c574[_0x564653(0x1e6)]=!![]);}return;}if(!_0x4eb46f)return;for(const _0x12136d of _0x10c28a){String(_0x12136d['appcode']??'')['trim']()===_0x4eb46f&&(_0x12136d[_0x564653(0x1e6)]=!![]);}}export function resolveAppScopeForWrite(_0x5c8dfe,_0x534609,_0x5e8f77){const _0x32a0bc=a23_0x5128;if(_0x534609)return'global';const _0x469302=_0x5e8f77[_0x32a0bc(0x1f0)][_0x32a0bc(0x200)]&&typeof _0x5e8f77[_0x32a0bc(0x1f0)][_0x32a0bc(0x200)]===_0x32a0bc(0x1f2)?_0x5e8f77[_0x32a0bc(0x1f0)]['apps']:{},_0x3c42d3=_0x5e8f77['globalConfig'][_0x32a0bc(0x200)]&&typeof _0x5e8f77['globalConfig'][_0x32a0bc(0x200)]===_0x32a0bc(0x1f2)?_0x5e8f77[_0x32a0bc(0x1f9)]['apps']:{};if(Object[_0x32a0bc(0x1e8)][_0x32a0bc(0x1f5)][_0x32a0bc(0x1fb)](_0x469302,_0x5c8dfe))return'project';if(Object[_0x32a0bc(0x1e8)][_0x32a0bc(0x1f5)][_0x32a0bc(0x1fb)](_0x3c42d3,_0x5c8dfe))return'global';return _0x32a0bc(0x1fd);}function a23_0x5128(_0xf5c4ff,_0x59dabd){_0xf5c4ff=_0xf5c4ff-0x1e5;const _0x157a78=a23_0x157a();let _0x5128c0=_0x157a78[_0xf5c4ff];return _0x5128c0;}function a23_0x157a(){const _0x507000=['9tviLsk','isCurrent','inherit','prototype','12128589zSsVnQ','appcode','329KgPZGU','length','794535dKDrhE','66EaKzRA','both','projectConfig','335798NaBblF','object','keys','5780210LOEKyy','hasOwnProperty','defaultApp','940410KfqSIJ','global','globalConfig','18248pPyAKm','call','name','project','appCode','1BVRtqS','apps','currentApp','named','127084KbIfzU'];a23_0x157a=function(){return _0x507000;};return a23_0x157a();}export function appDefinedIn(_0x368aea,_0x39fcf2,_0x180446,_0x4077c){const _0x22f142=a23_0x5128;if(_0x4077c)return Object[_0x22f142(0x1e8)]['hasOwnProperty']['call'](_0x180446,_0x368aea)?_0x22f142(0x1fd):_0x22f142(0x1f8);const _0x338eb8=Object['prototype'][_0x22f142(0x1f5)][_0x22f142(0x1fb)](_0x39fcf2,_0x368aea),_0x315fd1=Object[_0x22f142(0x1e8)][_0x22f142(0x1f5)][_0x22f142(0x1fb)](_0x180446,_0x368aea);if(_0x338eb8&&_0x315fd1)return _0x22f142(0x1ef);if(_0x315fd1)return _0x22f142(0x1fd);return _0x22f142(0x1f8);}export function resolveDefaultAppSource(_0x5685dc){const _0x242581=a23_0x5128,_0x227975=_0x5685dc['projectConfig'][_0x242581(0x200)]&&typeof _0x5685dc[_0x242581(0x1f0)][_0x242581(0x200)]===_0x242581(0x1f2)?_0x5685dc[_0x242581(0x1f0)][_0x242581(0x200)]:{};if(_0x242581(0x1f6)in _0x5685dc[_0x242581(0x1f0)])return _0x242581(0x1fd);if(Object['keys'](_0x227975)['length']>0x0)return _0x242581(0x1fd);if(_0x5685dc[_0x242581(0x1f0)][_0x242581(0x1e7)]===![])return null;if(_0x5685dc[_0x242581(0x1f9)][_0x242581(0x1f6)])return'global';return null;}export function getConfigPath(_0x1bdd48={}){const _0x1188cb=a23_0x5128,_0x14f4d6=_0x1bdd48[_0x1188cb(0x1f8)]?_0x1188cb(0x1f8):_0x1188cb(0x1fd);return resolveWriteConfigPath(_0x14f4d6);}export function readConfig(_0xa99a67={}){return readConfigFile(getConfigPath(_0xa99a67));}export function writeConfig(_0x1c7d17,_0x1af3bf={}){writeConfigFile(getConfigPath(_0x1af3bf),_0x1c7d17);}export function scopeLabel(_0x382395){const _0x2e89ca=a23_0x5128;return _0x382395[_0x2e89ca(0x1f8)]?'\x20(global)':'';}
|
package/lib/commands/app/use.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x4ed499=a24_0x3f1f;function a24_0x3f1f(_0x3d161,_0x48f2ec){_0x3d161=_0x3d161-0xdd;const _0x32a824=a24_0x32a8();let _0x3f1ff4=_0x32a824[_0x3d161];return _0x3f1ff4;}(function(_0x4af886,_0x28aba4){const _0x42973a=a24_0x3f1f,_0x4de446=_0x4af886();while(!![]){try{const _0x103be5=parseInt(_0x42973a(0xdf))/0x1+parseInt(_0x42973a(0xf3))/0x2+parseInt(_0x42973a(0x104))/0x3+parseInt(_0x42973a(0xf6))/0x4*(-parseInt(_0x42973a(0x102))/0x5)+-parseInt(_0x42973a(0xde))/0x6+parseInt(_0x42973a(0xdd))/0x7+parseInt(_0x42973a(0xf8))/0x8*(-parseInt(_0x42973a(0xe1))/0x9);if(_0x103be5===_0x28aba4)break;else _0x4de446['push'](_0x4de446['shift']());}catch(_0x38f0c2){_0x4de446['push'](_0x4de446['shift']());}}}(a24_0x32a8,0x569c2));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a24_0x32a8(){const _0x4637e8=['defaultApp','bool','\x20app\x20use\x20<name>\x20[--global]','App\x20\x22','\x22\x20was\x20defined\x20in\x20global\x20config;\x20profile\x20copied\x20into\x20project\x20so\x20the\x20project\x20config\x20self-resolves\x20under\x20the\x20default\x20project-first\x20inherit\x20policy.','validation','name','rabetbase\x20workspace\x20use\x20--app\x20<name>','keys','length','\x20--appcode\x20<code>`\x20first.','projectPath','appcode','global','boolean','994702WrvoOz','use','Usage:\x20','406860eOrHYs','args','176MArajQ','apps','hasOwnProperty','Deprecated:\x20use\x20workspace\x20use','Use\x20global\x20config\x20scope','trim','write','object','join','Available:\x20','5LYNSuT','\x20app\x20add\x20','1367154pKmUPo','4604558VPUScF','810138HMXJxl','136135mnKTbI','globalConfig','472707cvACct','Default\x20app\x20set\x20to\x20\x22','Missing\x20app\x20name.'];a24_0x32a8=function(){return _0x4637e8;};return a24_0x32a8();}import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x408ea8){const _0xaab836=a24_0x3f1f,_0x4f73ed=_0x408ea8[_0xaab836(0xf7)][0x0]?.[_0xaab836(0xfd)]();if(!_0x4f73ed)throw CliErrors['validation'](_0xaab836(0xe3),'Usage:\x20'+CLI_BIN_NAME+_0xaab836(0xe6));}async function execute(_0x4bf4c3){const _0x3697cd=a24_0x3f1f,_0x3baf9f=_0x4bf4c3[_0x3697cd(0xf7)][0x0]?.[_0x3697cd(0xfd)]();if(!_0x3baf9f)throw CliErrors[_0x3697cd(0xe9)](_0x3697cd(0xe3),_0x3697cd(0xf5)+CLI_BIN_NAME+_0x3697cd(0xe6));const _0x47d784=_0x4bf4c3[_0x3697cd(0xe5)](_0x3697cd(0xf1)),{config:_0x37b2ac,layers:_0x5da945}=readRawConfigWithLayers(),_0xc826bc=_0x37b2ac[_0x3697cd(0xf9)]??{},_0x34343c=_0x5da945[_0x3697cd(0xe0)][_0x3697cd(0xf9)]&&typeof _0x5da945[_0x3697cd(0xe0)]['apps']===_0x3697cd(0xff)?_0x5da945[_0x3697cd(0xe0)]['apps']:{},_0x521498={..._0x34343c,..._0xc826bc};if(!_0x521498[_0x3baf9f]){const _0x40171b=Object[_0x3697cd(0xec)](_0x521498),_0x12274a=_0x40171b[_0x3697cd(0xed)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x3697cd(0x103)+_0x3baf9f+_0x3697cd(0xee):_0x3697cd(0x101)+_0x40171b[_0x3697cd(0x100)](',\x20');throw CliErrors[_0x3697cd(0xe9)](_0x3697cd(0xe7)+_0x3baf9f+'\x22\x20not\x20found.',_0x12274a);}let _0x5e9c6f,_0x3caa4c='';if(_0x47d784)_0x5e9c6f={'global':!![]};else{const _0x2a69c9=isInProject()&&!!_0x5da945[_0x3697cd(0xef)];_0x5e9c6f={'global':!_0x2a69c9};}const _0x44f053=readConfig(_0x5e9c6f);_0x44f053[_0x3697cd(0xe4)]=_0x3baf9f;if(!_0x5e9c6f['global']){const _0x3791ce=_0x44f053[_0x3697cd(0xf9)]&&typeof _0x44f053[_0x3697cd(0xf9)]==='object'?_0x44f053[_0x3697cd(0xf9)]:{};!Object['prototype'][_0x3697cd(0xfa)]['call'](_0x3791ce,_0x3baf9f)&&(_0x44f053['apps']={..._0x3791ce,[_0x3baf9f]:_0x521498[_0x3baf9f]},_0x3caa4c='\x0aNote:\x20\x22'+_0x3baf9f+_0x3697cd(0xe8));}return writeConfig(_0x44f053,_0x5e9c6f),{'ok':!![],'message':_0x3697cd(0xe2)+_0x3baf9f+'\x22\x20(appcode:\x20'+_0x521498[_0x3baf9f][_0x3697cd(0xf0)]+')'+scopeLabel(_0x5e9c6f)+_0x3caa4c};}export const appUseDefinition={'service':'app','command':a24_0x4ed499(0xf4),'description':a24_0x4ed499(0xfb),'risk':a24_0x4ed499(0xfe),'requiresAuth':![],'requiresAppCode':![],'deprecated':{'replacement':a24_0x4ed499(0xeb)},'args':[{'name':a24_0x4ed499(0xea),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':'global','type':a24_0x4ed499(0xf2),'description':a24_0x4ed499(0xfc),'default':![]}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x3617cc=a25_0x2c92;(function(_0x51082c,_0x8216f6){const _0x75e4f4=a25_0x2c92,_0x54fc65=_0x51082c();while(!![]){try{const _0x284126=-parseInt(_0x75e4f4(0xc6))/0x1+-parseInt(_0x75e4f4(0xb9))/0x2*(parseInt(_0x75e4f4(0xb8))/0x3)+parseInt(_0x75e4f4(0xba))/0x4*(-parseInt(_0x75e4f4(0xb5))/0x5)+parseInt(_0x75e4f4(0xbe))/0x6*(parseInt(_0x75e4f4(0xc7))/0x7)+-parseInt(_0x75e4f4(0xb4))/0x8+-parseInt(_0x75e4f4(0xb1))/0x9*(-parseInt(_0x75e4f4(0xc3))/0xa)+parseInt(_0x75e4f4(0xb3))/0xb*(parseInt(_0x75e4f4(0xbc))/0xc);if(_0x284126===_0x8216f6)break;else _0x54fc65['push'](_0x54fc65['shift']());}catch(_0x54e646){_0x54fc65['push'](_0x54fc65['shift']());}}}(a25_0x29a7,0x7e20e));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a25_0x2c92(_0x51ae02,_0x3ade6b){_0x51ae02=_0x51ae02-0xae;const _0x29a7b2=a25_0x29a7();let _0x2c92e8=_0x29a7b2[_0x51ae02];return _0x2c92e8;}function a25_0x29a7(){const _0x4ec5a8=['App\x20config\x20key\x20not\x20found:\x20','2388588CXpCUZ','validation','267252peaBuk','app-config','Delete\x20one\x20remote\x20app-config\x20KV\x20by\x20key','Deleted\x20app\x20config\x20','apiError','9420860YIIUmC','appCode','POST','86896ygkJDt','112vBOaJW','number','high-risk-write','appCode:\x20','9zJoGDW','App\x20config\x20server\x20id\x20missing\x20for\x20key=','22Fkuged','1595552kaaDxB','4124615VdJRRU','get','delete','1274913HRWKAM','2diGFpI','4PWGjHM'];a25_0x29a7=function(){return _0x4ec5a8;};return a25_0x29a7();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a25_0x3617cc(0xbf),'command':a25_0x3617cc(0xb7),'description':a25_0x3617cc(0xc0),'risk':a25_0x3617cc(0xaf),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x80bac7){readKeyArg(_0x80bac7);},async 'dryRun'(_0x4d9c2c){const _0x5f5c3c=a25_0x3617cc,_0x53422d=readKeyArg(_0x4d9c2c),_0xc91682=await mustGetByKey(_0x4d9c2c['appCode'],_0x53422d);return asAppConfigDryRunResult(buildMutationData({'operation':_0x5f5c3c(0xb7),'appCode':_0x4d9c2c['appCode'],'key':_0x53422d,'before':projectAppConfig(_0xc91682),'after':null,'dryRun':!![]}),{'method':_0x5f5c3c(0xc5),'url':DELETE_PATH});},async 'execute'(_0xd68ae0){const _0x44626e=a25_0x3617cc,_0x5bda20=readKeyArg(_0xd68ae0),_0x3d3777=await mustGetByKey(_0xd68ae0['appCode'],_0x5bda20);return await withAppConfigApiBoundary(_0x44626e(0xb7),{'appCode':_0xd68ae0[_0x44626e(0xc4)],'key':_0x5bda20},()=>deleteAppConfig({'appCode':_0xd68ae0[_0x44626e(0xc4)],'id':requireAppConfigId(_0x3d3777,_0x5bda20,_0xd68ae0[_0x44626e(0xc4)])})),{'ok':!![],'data':buildMutationData({'operation':_0x44626e(0xb7),'appCode':_0xd68ae0[_0x44626e(0xc4)],'key':_0x5bda20,'before':projectAppConfig(_0x3d3777),'after':null,'dryRun':![]}),'message':_0x44626e(0xc1)+_0x5bda20};}};async function mustGetByKey(_0x567a5c,_0x5151f8){const _0x4dea12=a25_0x3617cc,_0x156040=await withAppConfigApiBoundary(_0x4dea12(0xb6),{'appCode':_0x567a5c,'key':_0x5151f8},()=>getAppConfigByKey(_0x567a5c,_0x5151f8));if(!_0x156040)throw CliErrors[_0x4dea12(0xbd)](_0x4dea12(0xbb)+_0x5151f8,_0x4dea12(0xb0)+_0x567a5c);return _0x156040;}function requireAppConfigId(_0x544d09,_0x5bea03,_0x4f0b69){const _0x9634f6=a25_0x3617cc;if(typeof _0x544d09['id']===_0x9634f6(0xae)&&Number['isFinite'](_0x544d09['id'])&&_0x544d09['id']>0x0)return _0x544d09['id'];throw CliErrors[_0x9634f6(0xc2)](_0x9634f6(0xb2)+_0x5bea03+',\x20appCode='+_0x4f0b69);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x297bb9=a26_0x4183;(function(_0x43fdd1,_0x5b8ffe){const _0x13ab92=a26_0x4183,_0x11048b=_0x43fdd1();while(!![]){try{const _0x56d688=parseInt(_0x13ab92(0xb9))/0x1*(parseInt(_0x13ab92(0xb7))/0x2)+-parseInt(_0x13ab92(0xb8))/0x3*(parseInt(_0x13ab92(0xb4))/0x4)+-parseInt(_0x13ab92(0xb6))/0x5+-parseInt(_0x13ab92(0xa9))/0x6+-parseInt(_0x13ab92(0xaf))/0x7*(-parseInt(_0x13ab92(0xb3))/0x8)+-parseInt(_0x13ab92(0xbb))/0x9+parseInt(_0x13ab92(0xba))/0xa;if(_0x56d688===_0x5b8ffe)break;else _0x11048b['push'](_0x11048b['shift']());}catch(_0x528155){_0x11048b['push'](_0x11048b['shift']());}}}(a26_0x2f7e,0xa879a));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a26_0x2f7e(){const _0x1b1b5c=['3581tkIfnP','29061820kmlGCz','7672869LrHjRD','App\x20config\x20key\x20not\x20found:\x20','\x20with\x20value\x20redacted','5319360vhDbxj','\x20with\x20value\x20revealed','appCode','get','bool','Get\x20one\x20remote\x20app-config\x20KV\x20by\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','21sGIrML','Loaded\x20app\x20config\x20','read','reveal','1145640jjzQvN','870328mVDkaR','app-config','5499255GNKSRD','594RMkVnE','12qGwCOL'];a26_0x2f7e=function(){return _0x1b1b5c;};return a26_0x2f7e();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a26_0x4183(_0x4d627f,_0x2e8eec){_0x4d627f=_0x4d627f-0xa9;const _0x2f7ea1=a26_0x2f7e();let _0x418351=_0x2f7ea1[_0x4d627f];return _0x418351;}export const appConfigGet={'service':a26_0x297bb9(0xb5),'command':a26_0x297bb9(0xac),'description':a26_0x297bb9(0xae),'risk':a26_0x297bb9(0xb1),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x3381e0){readKeyArg(_0x3381e0);},async 'execute'(_0x2786c8){const _0x1ab305=a26_0x297bb9,_0x4f3162=readKeyArg(_0x2786c8),_0x5ad262=await withAppConfigApiBoundary(_0x1ab305(0xac),{'appCode':_0x2786c8[_0x1ab305(0xab)],'key':_0x4f3162},()=>getAppConfigByKey(_0x2786c8['appCode'],_0x4f3162));if(!_0x5ad262)throw CliErrors['validation'](_0x1ab305(0xbc)+_0x4f3162,'appCode:\x20'+_0x2786c8[_0x1ab305(0xab)]);const _0x3654ba=projectAppConfig(_0x5ad262,{'reveal':_0x2786c8[_0x1ab305(0xad)](_0x1ab305(0xb2))});return{'ok':!![],'data':{'config':_0x3654ba},'message':_0x2786c8[_0x1ab305(0xad)](_0x1ab305(0xb2))?_0x1ab305(0xb0)+_0x4f3162+_0x1ab305(0xaa):_0x1ab305(0xb0)+_0x4f3162+_0x1ab305(0xbd)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x50b02f,_0x13e603){const _0x1642ed=a27_0x333a,_0x27c067=_0x50b02f();while(!![]){try{const _0x5036f9=parseInt(_0x1642ed(0x7c))/0x1+-parseInt(_0x1642ed(0x7f))/0x2*(parseInt(_0x1642ed(0x83))/0x3)+-parseInt(_0x1642ed(0x7e))/0x4+-parseInt(_0x1642ed(0x80))/0x5*(-parseInt(_0x1642ed(0x84))/0x6)+parseInt(_0x1642ed(0x81))/0x7+-parseInt(_0x1642ed(0x7b))/0x8*(-parseInt(_0x1642ed(0x82))/0x9)+parseInt(_0x1642ed(0x7d))/0xa*(-parseInt(_0x1642ed(0x7a))/0xb);if(_0x5036f9===_0x13e603)break;else _0x27c067['push'](_0x27c067['shift']());}catch(_0x8093c){_0x27c067['push'](_0x27c067['shift']());}}}(a27_0x29b1,0x612c4));import{appConfigList}from'../../commands/app-config/list.js';function a27_0x29b1(){const _0x114f3b=['48lyGTCp','175dWSdUb','1433194essZVz','171MACNZl','36957NsAePN','76044zzmtNW','77IrIxLi','176064GtkWBt','652187hROchn','421390cRvGcE','2920088yeFMpX'];a27_0x29b1=function(){return _0x114f3b;};return a27_0x29b1();}import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';function a27_0x333a(_0x1cba26,_0x2b8db6){_0x1cba26=_0x1cba26-0x7a;const _0x29b12d=a27_0x29b1();let _0x333af7=_0x29b12d[_0x1cba26];return _0x333af7;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x6716ef=a28_0x1792;(function(_0x1999fa,_0x4a886d){const _0xc82b62=a28_0x1792,_0x528980=_0x1999fa();while(!![]){try{const _0x5a318d=parseInt(_0xc82b62(0x1d2))/0x1*(-parseInt(_0xc82b62(0x1d8))/0x2)+-parseInt(_0xc82b62(0x1c3))/0x3+-parseInt(_0xc82b62(0x1d0))/0x4*(parseInt(_0xc82b62(0x1d4))/0x5)+-parseInt(_0xc82b62(0x1ca))/0x6*(parseInt(_0xc82b62(0x1d5))/0x7)+parseInt(_0xc82b62(0x1d7))/0x8*(parseInt(_0xc82b62(0x1c1))/0x9)+parseInt(_0xc82b62(0x1c9))/0xa*(-parseInt(_0xc82b62(0x1c2))/0xb)+parseInt(_0xc82b62(0x1c7))/0xc*(parseInt(_0xc82b62(0x1c6))/0xd);if(_0x5a318d===_0x4a886d)break;else _0x528980['push'](_0x528980['shift']());}catch(_0x79e5f9){_0x528980['push'](_0x528980['shift']());}}}(a28_0x5857,0x9b47e));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a28_0x5857(){const _0x21fca9=['204PlIprR','str','870AbOPQC','4671678GEuqcM','trim','\x20app\x20config(s)','appCode','key','map','2076fxyPob','read','1usfivd','list','10285mBlVHQ','7QLUlAQ','List\x20remote\x20app-config\x20KV\x20metadata\x20without\x20revealing\x20values','5008VEnOKY','933054QItqmO','string','Filter\x20by\x20exact\x20config\x20key','1872zphKPk','95623jziHFJ','3129438cBJDZN','Found\x20','length','3531398LpnjHU'];a28_0x5857=function(){return _0x21fca9;};return a28_0x5857();}import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a28_0x1792(_0x4ffb7f,_0x397e7f){_0x4ffb7f=_0x4ffb7f-0x1c0;const _0x5857c6=a28_0x5857();let _0x179234=_0x5857c6[_0x4ffb7f];return _0x179234;}export const appConfigList={'service':'app-config','command':a28_0x6716ef(0x1d3),'description':a28_0x6716ef(0x1d6),'risk':a28_0x6716ef(0x1d1),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a28_0x6716ef(0x1ce),'type':a28_0x6716ef(0x1d9),'description':a28_0x6716ef(0x1c0)},TAGS_FLAG],async 'validate'(_0x25baaf){const _0x4d56c0=a28_0x6716ef,_0x13372f=_0x25baaf[_0x4d56c0(0x1c8)]('key')[_0x4d56c0(0x1cb)]();if(_0x13372f)validateKey(_0x13372f);readOptionalTags(_0x25baaf);},async 'execute'(_0x3dbcb8){const _0x2b5dc6=a28_0x6716ef,_0xa6c823=_0x3dbcb8['str'](_0x2b5dc6(0x1ce))[_0x2b5dc6(0x1cb)]()||undefined,_0x88297e=readOptionalTags(_0x3dbcb8),_0x37cdae=await withAppConfigApiBoundary(_0x2b5dc6(0x1d3),{'appCode':_0x3dbcb8[_0x2b5dc6(0x1cd)]},()=>listAppConfigs(_0x3dbcb8[_0x2b5dc6(0x1cd)],{'key':_0xa6c823,'tags':_0x88297e})),_0x45365f=_0x37cdae[_0x2b5dc6(0x1cf)](_0x4762b1=>projectAppConfig(_0x4762b1));return{'ok':!![],'data':{'appCode':_0x3dbcb8[_0x2b5dc6(0x1cd)],'count':_0x45365f['length'],'configs':_0x45365f},'message':_0x2b5dc6(0x1c4)+_0x45365f[_0x2b5dc6(0x1c5)]+_0x2b5dc6(0x1cc)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x479361=a29_0x3cc7;(function(_0x4172ac,_0x40eaf2){const _0x59b103=a29_0x3cc7,_0x19651b=_0x4172ac();while(!![]){try{const _0x5ee2e9=parseInt(_0x59b103(0xdf))/0x1+-parseInt(_0x59b103(0xdb))/0x2+parseInt(_0x59b103(0xca))/0x3+parseInt(_0x59b103(0xcd))/0x4+-parseInt(_0x59b103(0xcf))/0x5*(-parseInt(_0x59b103(0xc6))/0x6)+parseInt(_0x59b103(0xc7))/0x7*(-parseInt(_0x59b103(0xd0))/0x8)+parseInt(_0x59b103(0xce))/0x9*(-parseInt(_0x59b103(0xd6))/0xa);if(_0x5ee2e9===_0x40eaf2)break;else _0x19651b['push'](_0x19651b['shift']());}catch(_0x3ef864){_0x19651b['push'](_0x19651b['shift']());}}}(a29_0x59b0,0x9884c));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a29_0x3cc7(_0x1efc22,_0x330f7b){_0x1efc22=_0x1efc22-0xc6;const _0x59b013=a29_0x59b0();let _0x3cc7f1=_0x59b013[_0x1efc22];return _0x3cc7f1;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a29_0x479361(0xdd),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':'app-config','command':a29_0x479361(0xd7),'description':a29_0x479361(0xd5),'risk':a29_0x479361(0xd1),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a29_0x479361(0xd8),'type':a29_0x479361(0xe1),'description':a29_0x479361(0xd9)}],async 'validate'(_0x29d481){readKeyArg(_0x29d481),readOptionalTags(_0x29d481),assertSingleValueSource(_0x29d481);},async 'dryRun'(_0xed04b){const _0x595260=a29_0x479361,_0x1aef4c=readKeyArg(_0xed04b),_0x12ae8d=readOptionalTags(_0xed04b),_0x11daf2=assertSingleValueSource(_0xed04b);await assertValueSourceReadable(_0x11daf2);const _0x10c33b=await withAppConfigApiBoundary(_0x595260(0xe0),{'appCode':_0xed04b[_0x595260(0xd2)],'key':_0x1aef4c},()=>getAppConfigByKey(_0xed04b[_0x595260(0xd2)],_0x1aef4c)),_0x14377e=_0x10c33b?_0x595260(0xcc):_0x595260(0xc9),_0x4d3009=_0x10c33b?projectAppConfig(_0x10c33b):null,_0x1c24ce=plannedAppConfig({'appCode':_0xed04b[_0x595260(0xd2)],'key':_0x1aef4c,'tags':_0x12ae8d??_0x10c33b?.[_0x595260(0xda)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x14377e,'appCode':_0xed04b['appCode'],'key':_0x1aef4c,'before':_0x4d3009,'after':_0x1c24ce,'dryRun':!![]}),{'method':_0x595260(0xdc),'url':_0x14377e===_0x595260(0xcc)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x28cacc){const _0x443bf4=a29_0x479361,_0x32e654=readKeyArg(_0x28cacc),_0x59a518=readOptionalTags(_0x28cacc),_0x2488b1=await withAppConfigApiBoundary(_0x443bf4(0xe0),{'appCode':_0x28cacc[_0x443bf4(0xd2)],'key':_0x32e654},()=>getAppConfigByKey(_0x28cacc['appCode'],_0x32e654)),_0xdd9d63=_0x2488b1?projectAppConfig(_0x2488b1):null,_0x31fca2=_0x2488b1?'update':_0x443bf4(0xc9),{value:_0x1bc069,warnings:_0x700475}=await readAppConfigValue(_0x28cacc),_0x5ebc5a={'appCode':_0x28cacc[_0x443bf4(0xd2)],'key':_0x32e654,'value':_0x1bc069,'tags':_0x59a518??_0x2488b1?.['tags']??undefined};await withAppConfigApiBoundary(_0x31fca2,{'appCode':_0x28cacc[_0x443bf4(0xd2)],'key':_0x32e654},async()=>{_0x2488b1?await updateAppConfig({..._0x5ebc5a,'id':requireAppConfigId(_0x2488b1,_0x32e654,_0x28cacc['appCode'])}):await createAppConfig(_0x5ebc5a);});const _0x279618=await withAppConfigApiBoundary(_0x443bf4(0xe0),{'appCode':_0x28cacc['appCode'],'key':_0x32e654},()=>getAppConfigByKey(_0x28cacc['appCode'],_0x32e654)),_0x1e7bf6=_0x279618?projectAppConfig(_0x279618):plannedAppConfig({'appCode':_0x28cacc[_0x443bf4(0xd2)],'key':_0x32e654,'tags':_0x5ebc5a[_0x443bf4(0xda)],'hasValue':_0x1bc069!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x31fca2,'appCode':_0x28cacc['appCode'],'key':_0x32e654,'before':_0xdd9d63,'after':_0x1e7bf6,'dryRun':![],'warnings':_0x700475}),'message':(_0x31fca2===_0x443bf4(0xcc)?_0x443bf4(0xc8):'Created')+_0x443bf4(0xd3)+_0x32e654};}};function a29_0x59b0(){const _0x4a98dd=['Read\x20config\x20value\x20from\x20file','tags','2305638nNBZeP','POST','/smartapi/app-config/create','isFinite','635945YjlCKf','get','string','6GyNRsF','1041705LYyelv','Updated','create','2027286HQJvYb','apiError','update','1155520EgRGRe','1638LcDdBs','2564295taTRKZ','8odpuFD','high-risk-write','appCode','\x20app\x20config\x20','App\x20config\x20server\x20id\x20missing\x20for\x20key=','Create\x20or\x20update\x20one\x20remote\x20app-config\x20KV\x20by\x20key','10280ywykKL','set','file'];a29_0x59b0=function(){return _0x4a98dd;};return a29_0x59b0();}function requireAppConfigId(_0x996837,_0x10ecdc,_0x344acf){const _0x526036=a29_0x479361;if(typeof _0x996837['id']==='number'&&Number[_0x526036(0xde)](_0x996837['id'])&&_0x996837['id']>0x0)return _0x996837['id'];throw CliErrors[_0x526036(0xcb)](_0x526036(0xd4)+_0x10ecdc+',\x20appCode='+_0x344acf);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x2c97d=a30_0x49c4;(function(_0x2119ef,_0x68fdfa){const _0x563e38=a30_0x49c4,_0x15be7f=_0x2119ef();while(!![]){try{const _0x100665=-parseInt(_0x563e38(0xb8))/0x1+-parseInt(_0x563e38(0xa1))/0x2+parseInt(_0x563e38(0xa0))/0x3*(parseInt(_0x563e38(0x90))/0x4)+-parseInt(_0x563e38(0x97))/0x5+parseInt(_0x563e38(0x89))/0x6+-parseInt(_0x563e38(0x8c))/0x7*(-parseInt(_0x563e38(0x9b))/0x8)+-parseInt(_0x563e38(0x7d))/0x9;if(_0x100665===_0x68fdfa)break;else _0x15be7f['push'](_0x15be7f['shift']());}catch(_0x4403f7){_0x15be7f['push'](_0x15be7f['shift']());}}}(a30_0x3606,0x75edd));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':'Remote\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a30_0x2c97d(0x80),'description':a30_0x2c97d(0x7f),'required':![]};export const TAGS_FLAG={'name':a30_0x2c97d(0xa5),'type':a30_0x2c97d(0x92),'description':a30_0x2c97d(0x94)};export const STDIN_FLAG={'name':a30_0x2c97d(0xae),'type':a30_0x2c97d(0x84),'description':a30_0x2c97d(0xb6),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a30_0x2c97d(0x92),'description':a30_0x2c97d(0xa8)};export const REVEAL_FLAG={'name':a30_0x2c97d(0x85),'type':a30_0x2c97d(0x84),'description':a30_0x2c97d(0x9e),'default':![]};export function readKeyArg(_0x5932d5){const _0x54a917=a30_0x2c97d,_0x1ac4ef=_0x5932d5[_0x54a917(0xb7)][0x0]?.['trim']()??'';return validateKey(_0x1ac4ef),_0x1ac4ef;}export function readOptionalTags(_0x1f7366){const _0x39f62f=a30_0x2c97d,_0x5e4cbd=_0x1f7366[_0x39f62f(0x7c)](_0x39f62f(0xa5))[_0x39f62f(0x87)]();if(!_0x5e4cbd)return undefined;if(_0x5e4cbd[_0x39f62f(0x96)]>0x20)throw CliErrors['validation'](_0x39f62f(0x99));return _0x5e4cbd;}function a30_0x49c4(_0x57f924,_0x5d7406){_0x57f924=_0x57f924-0x7b;const _0x360635=a30_0x3606();let _0x49c461=_0x360635[_0x57f924];return _0x49c461;}export function validateKey(_0x23fb2d){const _0x53801d=a30_0x2c97d;if(!_0x23fb2d)throw CliErrors['validation'](_0x53801d(0xb3));if(_0x23fb2d[_0x53801d(0x96)]>0x100)throw CliErrors[_0x53801d(0x83)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}function a30_0x3606(){const _0x54f841=['args','139489TpuRFM','key','argument','hasValue','str','5678388fUkUuc','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','value','gmtModified','path','validation','boolean','reveal','appCode:\x20','trim','operation','4464330atQKHF','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','url','3650633AIkQqg','after','App\x20config\x20value\x20source\x20is\x20ambiguous.','Environment\x20variable\x20is\x20not\x20set:\x20','1716508jdgNMy','slice','string','apiError','Config\x20tags\x20for\x20filtering/display\x20metadata','join','length','2375045YiySXU','setEncoding','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','env','8YmMgLo','appCode','value\x20is\x20redacted','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','flag','6nqyANq','790722NnZdIA','key:\x20','utf8','defineProperties','tags','valueRedacted','gmtCreate','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','kind','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Missing\x20app-config\x20value\x20source.','file','data','stdin','dryRun','error','once','\x20app\x20config.','Missing\x20app-config\x20key.','push','name','Read\x20config\x20value\x20from\x20stdin'];a30_0x3606=function(){return _0x54f841;};return a30_0x3606();}export function projectAppConfig(_0x223cb1,_0x5c986e){const _0x424cbd=a30_0x2c97d,_0x5e6ccd=_0x223cb1[_0x424cbd(0x80)]!==undefined&&_0x223cb1[_0x424cbd(0x80)]!==null&&_0x223cb1[_0x424cbd(0x80)]!=='',_0xfee48e={'appCode':_0x223cb1[_0x424cbd(0x9c)],'key':_0x223cb1['key'],'tags':_0x223cb1[_0x424cbd(0xa5)]??undefined,'hasValue':_0x5e6ccd,'valueRedacted':_0x5e6ccd&&!_0x5c986e?.[_0x424cbd(0x85)],'gmtCreate':_0x223cb1[_0x424cbd(0xa7)],'gmtModified':_0x223cb1[_0x424cbd(0x81)]};return _0x5c986e?.[_0x424cbd(0x85)]&&(_0xfee48e[_0x424cbd(0x80)]=_0x223cb1['value']??'',_0xfee48e[_0x424cbd(0xa6)]=![]),_0xfee48e;}export function plannedAppConfig(_0x332017){const _0x1257ef=a30_0x2c97d,_0x5cf4db=_0x332017[_0x1257ef(0x7b)]??!![];return{'appCode':_0x332017['appCode'],'key':_0x332017[_0x1257ef(0xb9)],'tags':_0x332017['tags']??undefined,'hasValue':_0x5cf4db,'valueRedacted':_0x5cf4db};}export function buildMutationData(_0x375823){const _0x3a39d0=a30_0x2c97d;return{'operation':_0x375823[_0x3a39d0(0x88)],'selector':{'appCode':_0x375823[_0x3a39d0(0x9c)],'key':_0x375823['key']},'before':_0x375823['before'],'after':_0x375823[_0x3a39d0(0x8d)],'dryRun':_0x375823[_0x3a39d0(0xaf)],'warnings':_0x375823['warnings']??[]};}export async function withAppConfigApiBoundary(_0x150050,_0x5ec6df,_0x424b2b){const _0x18fee6=a30_0x2c97d;try{return await _0x424b2b();}catch{const _0x15c108=[_0x18fee6(0x86)+_0x5ec6df[_0x18fee6(0x9c)]];if(_0x5ec6df[_0x18fee6(0xb9)])_0x15c108[_0x18fee6(0xb4)](_0x18fee6(0xa2)+_0x5ec6df['key']);_0x15c108['push'](_0x18fee6(0x9d));throw CliErrors[_0x18fee6(0x93)]('Failed\x20to\x20'+_0x150050+_0x18fee6(0xb2),_0x15c108['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0xc22020,_0x1fae8b){const _0x1e80f=a30_0x2c97d;return Object[_0x1e80f(0xa4)](_0xc22020,{'method':{'value':_0x1fae8b['method'],'enumerable':![]},'url':{'value':_0x1fae8b[_0x1e80f(0x8b)],'enumerable':![]}});}export function assertSingleValueSource(_0x5e1fc0){const _0x3825b3=a30_0x2c97d,_0x32391c=[];_0x5e1fc0[_0x3825b3(0xb7)][_0x3825b3(0x96)]>0x1&&_0x32391c[_0x3825b3(0xb4)]({'kind':_0x3825b3(0xba),'value':_0x5e1fc0[_0x3825b3(0xb7)][_0x3825b3(0x91)](0x1)[_0x3825b3(0x95)]('\x20')});const _0x596886=_0x5e1fc0[_0x3825b3(0x9f)](_0x3825b3(0x80));_0x596886!==undefined&&_0x596886!==null&&_0x32391c[_0x3825b3(0xb4)]({'kind':_0x3825b3(0xba),'value':String(_0x596886)});_0x5e1fc0['bool'](_0x3825b3(0xae))&&_0x32391c[_0x3825b3(0xb4)]({'kind':_0x3825b3(0xae)});const _0x56d989=_0x5e1fc0['str']('from-env')['trim']();_0x56d989&&_0x32391c[_0x3825b3(0xb4)]({'kind':_0x3825b3(0x9a),'name':_0x56d989});const _0x2d24c9=_0x5e1fc0[_0x3825b3(0x7c)]('file')['trim']();_0x2d24c9&&_0x32391c[_0x3825b3(0xb4)]({'kind':_0x3825b3(0xac),'path':_0x2d24c9});if(_0x32391c[_0x3825b3(0x96)]===0x0)throw CliErrors[_0x3825b3(0x83)](_0x3825b3(0xab),_0x3825b3(0x8a));if(_0x32391c['length']>0x1)throw CliErrors[_0x3825b3(0x83)](_0x3825b3(0x8e),_0x3825b3(0xaa));return _0x32391c[0x0];}export async function assertValueSourceReadable(_0x8f7214){const _0x515785=a30_0x2c97d;if(_0x8f7214[_0x515785(0xa9)]===_0x515785(0x9a)&&!(_0x8f7214[_0x515785(0xb5)]in process.env))throw CliErrors[_0x515785(0x83)](_0x515785(0x8f)+_0x8f7214['name']);if(_0x8f7214[_0x515785(0xa9)]===_0x515785(0xac))try{await access(_0x8f7214[_0x515785(0x82)]);}catch{throw CliErrors['validation']('Value\x20file\x20is\x20not\x20readable:\x20'+_0x8f7214[_0x515785(0x82)]);}}export async function readAppConfigValue(_0x3ea7c8){const _0x47e14f=a30_0x2c97d,_0x487fea=assertSingleValueSource(_0x3ea7c8),_0x5e2579=[];if(_0x487fea[_0x47e14f(0xa9)]===_0x47e14f(0xba))return _0x5e2579[_0x47e14f(0xb4)](_0x47e14f(0x7e)),{'value':_0x487fea['value']??'','source':_0x487fea[_0x47e14f(0xa9)],'warnings':_0x5e2579};if(_0x487fea['kind']===_0x47e14f(0xae))return{'value':await readStdin(),'source':_0x487fea['kind'],'warnings':_0x5e2579};if(_0x487fea['kind']===_0x47e14f(0x9a)){if(!(_0x487fea[_0x47e14f(0xb5)]in process.env))throw CliErrors[_0x47e14f(0x83)](_0x47e14f(0x8f)+_0x487fea['name']);return{'value':process.env[_0x487fea.name]??'','source':_0x487fea[_0x47e14f(0xa9)],'warnings':_0x5e2579};}return{'value':await readFile(_0x487fea[_0x47e14f(0x82)],_0x47e14f(0xa3)),'source':_0x487fea[_0x47e14f(0xa9)],'warnings':_0x5e2579};}function readStdin(){return new Promise((_0x5a4501,_0x28d960)=>{const _0x171648=a30_0x49c4;let _0x3a5b8c='';process[_0x171648(0xae)][_0x171648(0x98)]('utf8'),process[_0x171648(0xae)]['on'](_0x171648(0xad),_0x4788c2=>{_0x3a5b8c+=_0x4788c2;}),process[_0x171648(0xae)][_0x171648(0xb1)]('end',()=>_0x5a4501(_0x3a5b8c)),process[_0x171648(0xae)][_0x171648(0xb1)](_0x171648(0xb0),_0x28d960);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x568d1c=a31_0x46dc;(function(_0x542f81,_0x8711f1){const _0x1a096f=a31_0x46dc,_0xdfaa87=_0x542f81();while(!![]){try{const _0x2e4d02=-parseInt(_0x1a096f(0x1dc))/0x1*(-parseInt(_0x1a096f(0x1db))/0x2)+parseInt(_0x1a096f(0x1e4))/0x3*(parseInt(_0x1a096f(0x1de))/0x4)+parseInt(_0x1a096f(0x1e7))/0x5+parseInt(_0x1a096f(0x1ea))/0x6+parseInt(_0x1a096f(0x1d8))/0x7+-parseInt(_0x1a096f(0x1e0))/0x8+parseInt(_0x1a096f(0x1ec))/0x9*(-parseInt(_0x1a096f(0x1e5))/0xa);if(_0x2e4d02===_0x8711f1)break;else _0xdfaa87['push'](_0xdfaa87['shift']());}catch(_0xc3afc9){_0xdfaa87['push'](_0xdfaa87['shift']());}}}(a31_0x17ba,0x1f19e));import{unlinkSync,existsSync}from'node:fs';function a31_0x46dc(_0x580dcd,_0x2ef059){_0x580dcd=_0x580dcd-0x1d7;const _0x17ba8c=a31_0x17ba();let _0x46dc4a=_0x17ba8c[_0x580dcd];return _0x46dc4a;}function a31_0x17ba(){const _0x2f9f58=['Login\x20via\x20browser','nonInteractive','622596jhlICA','Clear\x20login\x20session','9tjycoe','login','read','log','610141UVisXL','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','4062ZeonPE','34OfeTBA','../../auth/auth-server-ui.js','12ggjmrB','boolean','1358632fCqehb','auth','yes','write','86367QVCorU','2469590jIzMbM','logout','989140EwqbRC'];a31_0x17ba=function(){return _0x2f9f58;};return a31_0x17ba();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a31_0x568d1c(0x1e1),'command':a31_0x568d1c(0x1ed),'description':a31_0x568d1c(0x1e8),'risk':a31_0x568d1c(0x1ee),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a31_0x568d1c(0x1e2),'type':a31_0x568d1c(0x1df),'description':a31_0x568d1c(0x1da),'default':![]}],async 'execute'(_0x2222e3){const _0x550e39=a31_0x568d1c,{runAuthServer:_0x35f8ce}=await import(_0x550e39(0x1dd));return await _0x35f8ce({'autoYes':_0x2222e3['bool']('yes'),'nonInteractive':_0x2222e3[_0x550e39(0x1e9)]}),{'ok':!![]};}},{'service':a31_0x568d1c(0x1e1),'command':a31_0x568d1c(0x1e6),'description':a31_0x568d1c(0x1eb),'risk':a31_0x568d1c(0x1e3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5e2316){const _0x1b116e=a31_0x568d1c;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1b116e(0x1d7)]('✓\x20Logged\x20out')):console[_0x1b116e(0x1d7)](_0x1b116e(0x1d9)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x16681c=a32_0x5e36;(function(_0x39c496,_0x17783c){const _0x24768e=a32_0x5e36,_0x29fbff=_0x39c496();while(!![]){try{const _0x8b598b=-parseInt(_0x24768e(0x135))/0x1*(parseInt(_0x24768e(0x16c))/0x2)+-parseInt(_0x24768e(0x16f))/0x3+-parseInt(_0x24768e(0x137))/0x4+parseInt(_0x24768e(0x17d))/0x5+-parseInt(_0x24768e(0x172))/0x6*(-parseInt(_0x24768e(0x148))/0x7)+-parseInt(_0x24768e(0x173))/0x8+parseInt(_0x24768e(0x178))/0x9*(parseInt(_0x24768e(0x13d))/0xa);if(_0x8b598b===_0x17783c)break;else _0x29fbff['push'](_0x29fbff['shift']());}catch(_0x2d796f){_0x29fbff['push'](_0x29fbff['shift']());}}}(a32_0x1efa,0x4e69e));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0x1efa(){const _0x4453ea=['before','\x0a\x20*\x20[脚本名称]\x20','333106kTkmum','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','datasetCode','669888MVjncj','Script\x20type','Operation\x20type\x20(HOOK\x20only)','6cEnndj','368304mmyYMV','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','length','trim','11628hOLdUf','after','map',']\x20(','\x22\x20not\x20found.\x20','1071285kJUoZA','Dataset\x20not\x20found\x20for\x20code\x20\x22','parseInt','scriptsRootDir','type','apiDir','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Operation\x20type\x20\x22','TODO:\x20add\x20script\x20description','No\x20operation\x20types\x20found\x20for\x20dataset\x20','write','source','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.js','string','\x22\x20not\x20found\x20for\x20dataset\x20','description','alias','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','appCode','ENDPOINT','Available:\x20','keys','1magsYc','HOOK','638956EBelCS','function-node','Trigger\x20node\x20(HOOK\x20only)','tableName','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','operationType','1760JYamVr','stderr','code','bff','\x22.\x20','\x0a\x20*\x20[触发节点]\x20','Alias\x20\x22','Invalid\x20function\x20name\x20\x22','operation-type','join','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','3326113pKfjQL','Function\x20name\x20(valid\x20JS\x20identifier)','functionNode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20datasets\x20found\x20for\x20this\x20app.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Created\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','find','entries','includes','datasetcode','Script\x20description','question','Invalid\x20dataset\x20selection.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','name','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','File\x20already\x20exists:\x20','validation','stdin','UNKNOWN','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','utf8','str','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Select\x20trigger\x20node:','COMMON','\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','create','nonInteractive','Select\x20dataset:'];a32_0x1efa=function(){return _0x4453ea;};return a32_0x1efa();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a32_0x5e36(_0x33364c,_0x39ac2c){_0x33364c=_0x33364c-0x126;const _0x1efa84=a32_0x1efa();let _0x5e3623=_0x1efa84[_0x33364c];return _0x5e3623;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a32_0x16681c(0x140),'command':a32_0x16681c(0x167),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a32_0x16681c(0x128),'flags':[{'name':a32_0x16681c(0x181),'type':'string','required':!![],'enum':[a32_0x16681c(0x165),a32_0x16681c(0x132),a32_0x16681c(0x136)],'description':a32_0x16681c(0x170)},{'name':a32_0x16681c(0x158),'type':'string','required':!![],'description':a32_0x16681c(0x149)},{'name':a32_0x16681c(0x12e),'type':'string','description':a32_0x16681c(0x154)},{'name':a32_0x16681c(0x12f),'type':a32_0x16681c(0x12c),'description':a32_0x16681c(0x161)},{'name':a32_0x16681c(0x153),'type':a32_0x16681c(0x12c),'description':a32_0x16681c(0x12a)},{'name':a32_0x16681c(0x145),'type':a32_0x16681c(0x12c),'description':a32_0x16681c(0x171)},{'name':a32_0x16681c(0x138),'type':a32_0x16681c(0x12c),'description':a32_0x16681c(0x139),'enum':[a32_0x16681c(0x16a),a32_0x16681c(0x179)]}],async 'validate'(_0xed4457){const _0x1691d0=a32_0x16681c,_0x1d1e15=_0xed4457[_0x1691d0(0x160)](_0x1691d0(0x158));if(!isValidBffFunctionName(_0x1d1e15))throw CliErrors['validation'](_0x1691d0(0x144)+_0x1d1e15+_0x1691d0(0x174));},async 'execute'(_0x3d96d7){const _0x5037a7=a32_0x16681c,_0x52e6a0=loadBffProjectConfig(_0x3d96d7[_0x5037a7(0x131)]),_0x49fab1=_0x3d96d7['str'](_0x5037a7(0x181)),_0x28763a=_0x3d96d7[_0x5037a7(0x160)](_0x5037a7(0x158)),_0x5f0add=_0x3d96d7[_0x5037a7(0x160)](_0x5037a7(0x12e))||undefined,_0xdd3411=_0x49fab1==='HOOK'?await resolveHookOptions(_0x52e6a0,_0x3d96d7):undefined,_0x15f9e9=buildFilePath(_0x52e6a0,_0x49fab1,_0x28763a,_0xdd3411);if(await fileExists(_0x15f9e9))throw CliErrors[_0x5037a7(0x15b)](_0x5037a7(0x15a)+_0x15f9e9);await mkdir(dirname(_0x15f9e9),{'recursive':!![]});const _0x4b30f0=generateTemplate(_0x49fab1,_0x28763a,_0x3d96d7[_0x5037a7(0x131)],_0x5f0add,_0xdd3411);await writeFile(_0x15f9e9,_0x4b30f0,_0x5037a7(0x15f));const _0x17da7a={'type':_0x49fab1,'name':_0x28763a,'path':_0x15f9e9};if(_0x5f0add)_0x17da7a[_0x5037a7(0x12e)]=_0x5f0add;if(_0xdd3411){if(_0xdd3411[_0x5037a7(0x12f)])_0x17da7a['alias']=_0xdd3411[_0x5037a7(0x12f)];_0x17da7a[_0x5037a7(0x16e)]=_0xdd3411[_0x5037a7(0x16e)],_0x17da7a[_0x5037a7(0x13c)]=_0xdd3411[_0x5037a7(0x13c)],_0x17da7a[_0x5037a7(0x14a)]=_0xdd3411[_0x5037a7(0x14a)];}return{'ok':!![],'data':_0x17da7a,'message':_0x5037a7(0x14e)+_0x49fab1+'\x20function:\x20'+_0x28763a};}};async function resolveHookOptions(_0x33d32f,_0x312e7e){const _0x3d26b0=a32_0x16681c,_0x19949a=loadAliasMap(_0x312e7e[_0x3d26b0(0x182)],undefined,resolveApiFilePath(_0x312e7e[_0x3d26b0(0x182)],_0x312e7e[_0x3d26b0(0x131)])),_0x2a6da2=_0x19949a[_0x3d26b0(0x176)]>0x0;let _0x4c9bd1,_0x49f4f3,_0x238d09;const _0x3ceb35=_0x312e7e[_0x3d26b0(0x160)]('alias'),_0x368459=_0x312e7e[_0x3d26b0(0x160)](_0x3d26b0(0x153));if(_0x3ceb35){const _0x19a1cf=resolveAlias(_0x312e7e['apiDir'],_0x3ceb35,undefined,resolveApiFilePath(_0x312e7e[_0x3d26b0(0x182)],_0x312e7e[_0x3d26b0(0x131)]));if(!_0x19a1cf){const _0x332a10=_0x2a6da2?'Available\x20aliases:\x20'+_0x19949a[_0x3d26b0(0x17a)](_0x392c7d=>_0x392c7d[_0x3d26b0(0x12f)])[_0x3d26b0(0x146)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x3d26b0(0x163);throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x143)+_0x3ceb35+_0x3d26b0(0x17c)+_0x332a10);}_0x4c9bd1=_0x3ceb35,_0x49f4f3=_0x19a1cf;}else{if(_0x368459){_0x49f4f3=_0x368459;const _0x137ecf=_0x19949a[_0x3d26b0(0x150)](_0x151e6a=>_0x151e6a['datasetCode']===_0x368459);_0x4c9bd1=_0x137ecf?.[_0x3d26b0(0x12f)];}else{if(_0x312e7e[_0x3d26b0(0x168)])throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x14b));else{if(_0x2a6da2){const _0x16dde6=_0x19949a[_0x3d26b0(0x17a)](_0x2ddfd6=>_0x2ddfd6[_0x3d26b0(0x12f)]+'\x20('+_0x2ddfd6[_0x3d26b0(0x13a)]+')'),_0x2cc16d=await promptSelect(_0x3d26b0(0x169),_0x16dde6),_0x2851af=_0x19949a[_0x2cc16d];if(!_0x2851af)throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x156));_0x4c9bd1=_0x2851af[_0x3d26b0(0x12f)],_0x49f4f3=_0x2851af[_0x3d26b0(0x16e)];}else{const _0x289ab5=await listDatasets(_0x312e7e[_0x3d26b0(0x131)]);if(_0x289ab5[_0x3d26b0(0x176)]===0x0)throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x14c));const _0x57905d=_0x289ab5[_0x3d26b0(0x17a)](_0x5b3a3f=>_0x5b3a3f['name']+'\x20['+(_0x5b3a3f[_0x3d26b0(0x129)]??_0x3d26b0(0x15d))+_0x3d26b0(0x17b)+_0x5b3a3f['code']+')'),_0x5a2db9=await promptSelect(_0x3d26b0(0x169),_0x57905d),_0x492118=_0x289ab5[_0x5a2db9];if(!_0x492118)throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x156));_0x49f4f3=_0x492118['code'],_0x4c9bd1=undefined;}}}}const _0x30c723=await listDatasets(_0x312e7e['appCode']),_0x4b8039=_0x30c723[_0x3d26b0(0x150)](_0x1af3dd=>_0x1af3dd[_0x3d26b0(0x13f)]===_0x49f4f3);if(!_0x4b8039)throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x17e)+_0x49f4f3+_0x3d26b0(0x141)+(_0x4c9bd1?_0x3d26b0(0x157)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x238d09=_0x4b8039['id'];const _0xd6b90b=_0x4c9bd1??_0x49f4f3,_0x44b811=await listBffDatasetOperations(_0x312e7e[_0x3d26b0(0x131)],_0x238d09),_0x583930=_0x44b811?Object[_0x3d26b0(0x134)](_0x44b811):[];if(_0x583930['length']===0x0)throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x127)+_0xd6b90b+'.');let _0x478b7f;const _0x104220=_0x312e7e[_0x3d26b0(0x160)]('operation-type');if(_0x104220){if(!_0x583930[_0x3d26b0(0x152)](_0x104220))throw CliErrors[_0x3d26b0(0x15b)](_0x3d26b0(0x184)+_0x104220+_0x3d26b0(0x12d)+_0xd6b90b+'.\x20'+(_0x3d26b0(0x133)+_0x583930[_0x3d26b0(0x146)](',\x20')));_0x478b7f=_0x104220;}else{if(_0x312e7e[_0x3d26b0(0x168)])throw CliErrors[_0x3d26b0(0x15b)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x88af9f=await promptSelect('Select\x20operation\x20type:',_0x583930);_0x478b7f=_0x583930[_0x88af9f]??_0x583930[0x0];}let _0x17d65d=normalizeHookFunctionNode(_0x312e7e[_0x3d26b0(0x160)](_0x3d26b0(0x138)));if(!_0x17d65d){if(_0x312e7e[_0x3d26b0(0x160)](_0x3d26b0(0x138)))throw CliErrors['validation'](_0x3d26b0(0x16d));if(_0x312e7e[_0x3d26b0(0x168)])throw CliErrors['validation'](_0x3d26b0(0x162));const _0x273a76=await promptSelect(_0x3d26b0(0x164),['before',_0x3d26b0(0x179)]);_0x17d65d=['before','after'][_0x273a76]??'before';}return{'alias':_0x4c9bd1,'datasetCode':_0x49f4f3,'datasetId':_0x238d09,'operationType':_0x478b7f,'functionNode':_0x17d65d};}async function promptSelect(_0x388a3f,_0x15f66c){const _0x10a1b8=a32_0x16681c;if(_0x15f66c[_0x10a1b8(0x176)]===0x1)return 0x0;for(const [_0x5851e5,_0x3f7448]of _0x15f66c[_0x10a1b8(0x151)]()){process['stderr'][_0x10a1b8(0x128)]('\x20\x20'+(_0x5851e5+0x1)+'.\x20'+_0x3f7448+'\x0a');}const _0x252873=createInterface({'input':process[_0x10a1b8(0x15c)],'output':process[_0x10a1b8(0x13e)]});while(!![]){const _0x413501=await new Promise(_0xa54b29=>{const _0x260d20=_0x10a1b8;_0x252873[_0x260d20(0x155)](_0x388a3f+'\x20',_0xa54b29);}),_0x137d07=Number[_0x10a1b8(0x17f)](_0x413501[_0x10a1b8(0x177)](),0xa);if(Number['isInteger'](_0x137d07)&&_0x137d07>=0x1&&_0x137d07<=_0x15f66c[_0x10a1b8(0x176)])return _0x252873['close'](),_0x137d07-0x1;process['stderr'][_0x10a1b8(0x128)](_0x10a1b8(0x14d)+_0x15f66c[_0x10a1b8(0x176)]+'.\x0a');}}function buildFilePath(_0x169f82,_0x12c58c,_0x388103,_0xc489a4){const _0x567eb7=a32_0x16681c;if(_0x12c58c===_0x567eb7(0x136)){if(!_0xc489a4)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x3f5a59=_0xc489a4[_0x567eb7(0x12f)]??_0xc489a4['datasetCode'];return join(_0x169f82[_0x567eb7(0x180)],_0x567eb7(0x136),_0x3f5a59,_0xc489a4[_0x567eb7(0x13c)],_0xc489a4[_0x567eb7(0x14a)],_0x388103+_0x567eb7(0x12b));}return join(_0x169f82[_0x567eb7(0x180)],_0x12c58c,_0x388103+_0x567eb7(0x12b));}export function generateTemplate(_0x3dc911,_0x57563d,_0x54dab9,_0x5849e9,_0x4ed5aa){const _0x16ba92=a32_0x16681c,_0x268409=_0x5849e9?.[_0x16ba92(0x177)]()||_0x16ba92(0x126);if(_0x3dc911==='COMMON')return _0x16ba92(0x147)+_0x268409+_0x16ba92(0x16b)+_0x57563d+_0x16ba92(0x159)+_0x57563d+'.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'+_0x57563d+_0x16ba92(0x15e);if(_0x3dc911===_0x16ba92(0x132))return _0x16ba92(0x14f)+_0x268409+_0x16ba92(0x175)+_0x54dab9+'/'+_0x57563d+'\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'+_0x57563d+_0x16ba92(0x15e);if(!_0x4ed5aa)throw CliErrors['validation'](_0x16ba92(0x13b));return _0x16ba92(0x130)+_0x268409+_0x16ba92(0x183)+_0x54dab9+'/'+_0x4ed5aa['datasetCode']+'/'+_0x4ed5aa[_0x16ba92(0x13c)]+_0x16ba92(0x142)+_0x4ed5aa[_0x16ba92(0x14a)]+_0x16ba92(0x166)+_0x57563d+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
const a32_0x13b156=a32_0x3cbb;(function(_0x3a5112,_0xd33049){const _0x4a48db=a32_0x3cbb,_0x811d28=_0x3a5112();while(!![]){try{const _0x3d211b=-parseInt(_0x4a48db(0x121))/0x1*(parseInt(_0x4a48db(0x138))/0x2)+-parseInt(_0x4a48db(0x160))/0x3+parseInt(_0x4a48db(0x114))/0x4*(parseInt(_0x4a48db(0x15e))/0x5)+-parseInt(_0x4a48db(0x14e))/0x6*(-parseInt(_0x4a48db(0x142))/0x7)+-parseInt(_0x4a48db(0x131))/0x8*(parseInt(_0x4a48db(0x145))/0x9)+-parseInt(_0x4a48db(0x150))/0xa+-parseInt(_0x4a48db(0x13c))/0xb*(-parseInt(_0x4a48db(0x159))/0xc);if(_0x3d211b===_0xd33049)break;else _0x811d28['push'](_0x811d28['shift']());}catch(_0x3b6a15){_0x811d28['push'](_0x811d28['shift']());}}}(a32_0x4de3,0x3f188));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0x4de3(){const _0x38481a=['4937780gNcXZt','\x20function:\x20','Select\x20operation\x20type:','Select\x20trigger\x20node:','length','UNKNOWN','\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','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','2545068iLBbEm','alias','apiDir','join','Created\x20','297535DBKPtY','Invalid\x20function\x20name\x20\x22','242016WrLAQp','str','code','trim','type','.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','function-node','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Available:\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','HOOK','parseInt','utf8','isInteger','4gbFFKh','tableName','bff','\x0a\x20*\x20[触发节点]\x20','string','entries','\x22\x20not\x20found.\x20','\x22\x20not\x20found\x20for\x20dataset\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','ENDPOINT','stderr','File\x20already\x20exists:\x20','\x0a\x20*\x20[脚本名称]\x20','69600jMkOGI','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','functionNode','datasetCode','source','nonInteractive','operation-type','before','No\x20api.ts\x20found.\x20Run\x20`','\x22.\x20','No\x20datasets\x20found\x20for\x20this\x20app.','Alias\x20\x22','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','8XCjksb','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','appCode','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','COMMON','scriptsRootDir','6zmYbld','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','datasetcode','Script\x20type','44ATuTSb','operationType','Script\x20description','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Select\x20dataset:','validation','7kyYxUd','name','question','384939ovxDcl','find','Invalid\x20dataset\x20selection.','after','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','stdin',']\x20(','keys','write','1059588GGnTLe','map'];a32_0x4de3=function(){return _0x38481a;};return a32_0x4de3();}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':a32_0x13b156(0x116),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a32_0x13b156(0x14d),'flags':[{'name':a32_0x13b156(0x164),'type':a32_0x13b156(0x118),'required':!![],'enum':[a32_0x13b156(0x136),a32_0x13b156(0x11d),a32_0x13b156(0x16b)],'description':a32_0x13b156(0x13b)},{'name':'name','type':a32_0x13b156(0x118),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':'string','description':a32_0x13b156(0x13e)},{'name':'alias','type':a32_0x13b156(0x118),'description':a32_0x13b156(0x158)},{'name':'datasetcode','type':a32_0x13b156(0x118),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':'operation-type','type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a32_0x13b156(0x118),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a32_0x13b156(0x12a),a32_0x13b156(0x148)]}],async 'validate'(_0x8bc823){const _0x2f7d82=a32_0x13b156,_0x1d549a=_0x8bc823[_0x2f7d82(0x161)](_0x2f7d82(0x143));if(!isValidBffFunctionName(_0x1d549a))throw CliErrors['validation'](_0x2f7d82(0x15f)+_0x1d549a+_0x2f7d82(0x11c));},async 'execute'(_0x6b0635){const _0x4ca2d1=a32_0x13b156,_0x3ca6d4=loadBffProjectConfig(_0x6b0635[_0x4ca2d1(0x134)]),_0x51c84f=_0x6b0635['str'](_0x4ca2d1(0x164)),_0x4c64e0=_0x6b0635[_0x4ca2d1(0x161)](_0x4ca2d1(0x143)),_0x3c6638=_0x6b0635[_0x4ca2d1(0x161)]('description')||undefined,_0xcfca2=_0x51c84f===_0x4ca2d1(0x16b)?await resolveHookOptions(_0x3ca6d4,_0x6b0635):undefined,_0x5850e6=buildFilePath(_0x3ca6d4,_0x51c84f,_0x4c64e0,_0xcfca2);if(await fileExists(_0x5850e6))throw CliErrors['validation'](_0x4ca2d1(0x11f)+_0x5850e6);await mkdir(dirname(_0x5850e6),{'recursive':!![]});const _0x48a263=generateTemplate(_0x51c84f,_0x4c64e0,_0x6b0635[_0x4ca2d1(0x134)],_0x3c6638,_0xcfca2);await writeFile(_0x5850e6,_0x48a263,_0x4ca2d1(0x112));const _0x4ef666={'type':_0x51c84f,'name':_0x4c64e0,'path':_0x5850e6};if(_0x3c6638)_0x4ef666['description']=_0x3c6638;if(_0xcfca2){if(_0xcfca2['alias'])_0x4ef666['alias']=_0xcfca2['alias'];_0x4ef666[_0x4ca2d1(0x126)]=_0xcfca2[_0x4ca2d1(0x126)],_0x4ef666[_0x4ca2d1(0x13d)]=_0xcfca2['operationType'],_0x4ef666[_0x4ca2d1(0x125)]=_0xcfca2['functionNode'];}return{'ok':!![],'data':_0x4ef666,'message':_0x4ca2d1(0x15d)+_0x51c84f+_0x4ca2d1(0x151)+_0x4c64e0};}};async function resolveHookOptions(_0x457c72,_0x59fa05){const _0x4f07c1=a32_0x13b156,_0x2f9948=loadAliasMap(_0x59fa05[_0x4f07c1(0x15b)],undefined,resolveApiFilePath(_0x59fa05['apiDir'],_0x59fa05[_0x4f07c1(0x134)])),_0x4af066=_0x2f9948[_0x4f07c1(0x154)]>0x0;let _0x203220,_0x34a860,_0x19253e;const _0x210497=_0x59fa05[_0x4f07c1(0x161)](_0x4f07c1(0x15a)),_0x318185=_0x59fa05[_0x4f07c1(0x161)](_0x4f07c1(0x13a));if(_0x210497){const _0x4d2a56=resolveAlias(_0x59fa05[_0x4f07c1(0x15b)],_0x210497,undefined,resolveApiFilePath(_0x59fa05[_0x4f07c1(0x15b)],_0x59fa05[_0x4f07c1(0x134)]));if(!_0x4d2a56){const _0x446213=_0x4af066?'Available\x20aliases:\x20'+_0x2f9948[_0x4f07c1(0x14f)](_0x496819=>_0x496819[_0x4f07c1(0x15a)])[_0x4f07c1(0x15c)](',\x20'):_0x4f07c1(0x12b)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x12e)+_0x210497+_0x4f07c1(0x11a)+_0x446213);}_0x203220=_0x210497,_0x34a860=_0x4d2a56;}else{if(_0x318185){_0x34a860=_0x318185;const _0x1278ce=_0x2f9948[_0x4f07c1(0x146)](_0x3a9eed=>_0x3a9eed[_0x4f07c1(0x126)]===_0x318185);_0x203220=_0x1278ce?.[_0x4f07c1(0x15a)];}else{if(_0x59fa05[_0x4f07c1(0x128)])throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x139));else{if(_0x4af066){const _0x2787e6=_0x2f9948[_0x4f07c1(0x14f)](_0x1f8813=>_0x1f8813[_0x4f07c1(0x15a)]+'\x20('+_0x1f8813[_0x4f07c1(0x115)]+')'),_0x1dc255=await promptSelect(_0x4f07c1(0x140),_0x2787e6),_0x58fb83=_0x2f9948[_0x1dc255];if(!_0x58fb83)throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x147));_0x203220=_0x58fb83['alias'],_0x34a860=_0x58fb83['datasetCode'];}else{const _0x32eba4=await listDatasets(_0x59fa05['appCode']);if(_0x32eba4[_0x4f07c1(0x154)]===0x0)throw CliErrors['validation'](_0x4f07c1(0x12d));const _0x3c7303=_0x32eba4[_0x4f07c1(0x14f)](_0x126736=>_0x126736[_0x4f07c1(0x143)]+'\x20['+(_0x126736[_0x4f07c1(0x127)]??_0x4f07c1(0x155))+_0x4f07c1(0x14b)+_0x126736[_0x4f07c1(0x162)]+')'),_0x195bfb=await promptSelect(_0x4f07c1(0x140),_0x3c7303),_0x3cb932=_0x32eba4[_0x195bfb];if(!_0x3cb932)throw CliErrors['validation'](_0x4f07c1(0x147));_0x34a860=_0x3cb932['code'],_0x203220=undefined;}}}}const _0x174315=await listDatasets(_0x59fa05[_0x4f07c1(0x134)]),_0x48c97a=_0x174315[_0x4f07c1(0x146)](_0x3f8084=>_0x3f8084['code']===_0x34a860);if(!_0x48c97a)throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x122)+_0x34a860+_0x4f07c1(0x12c)+(_0x203220?_0x4f07c1(0x12f)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x19253e=_0x48c97a['id'];const _0x3e2fe7=_0x203220??_0x34a860,_0x41f2e1=await listBffDatasetOperations(_0x59fa05['appCode'],_0x19253e),_0x530ba1=_0x41f2e1?Object[_0x4f07c1(0x14c)](_0x41f2e1):[];if(_0x530ba1[_0x4f07c1(0x154)]===0x0)throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x169)+_0x3e2fe7+'.');let _0x2e7c70;const _0x4e43ae=_0x59fa05[_0x4f07c1(0x161)](_0x4f07c1(0x129));if(_0x4e43ae){if(!_0x530ba1['includes'](_0x4e43ae))throw CliErrors[_0x4f07c1(0x141)]('Operation\x20type\x20\x22'+_0x4e43ae+_0x4f07c1(0x11b)+_0x3e2fe7+'.\x20'+(_0x4f07c1(0x168)+_0x530ba1[_0x4f07c1(0x15c)](',\x20')));_0x2e7c70=_0x4e43ae;}else{if(_0x59fa05[_0x4f07c1(0x128)])throw CliErrors['validation'](_0x4f07c1(0x167));const _0x398ae6=await promptSelect(_0x4f07c1(0x152),_0x530ba1);_0x2e7c70=_0x530ba1[_0x398ae6]??_0x530ba1[0x0];}let _0x836a2c=normalizeHookFunctionNode(_0x59fa05['str']('function-node'));if(!_0x836a2c){if(_0x59fa05[_0x4f07c1(0x161)](_0x4f07c1(0x166)))throw CliErrors['validation'](_0x4f07c1(0x130));if(_0x59fa05['nonInteractive'])throw CliErrors[_0x4f07c1(0x141)](_0x4f07c1(0x157));const _0x56d7cb=await promptSelect(_0x4f07c1(0x153),[_0x4f07c1(0x12a),_0x4f07c1(0x148)]);_0x836a2c=['before',_0x4f07c1(0x148)][_0x56d7cb]??'before';}return{'alias':_0x203220,'datasetCode':_0x34a860,'datasetId':_0x19253e,'operationType':_0x2e7c70,'functionNode':_0x836a2c};}function a32_0x3cbb(_0x118e78,_0xa874c5){_0x118e78=_0x118e78-0x111;const _0x4de31f=a32_0x4de3();let _0x3cbbf8=_0x4de31f[_0x118e78];return _0x3cbbf8;}async function promptSelect(_0x340f8e,_0x105f4c){const _0x59074d=a32_0x13b156;if(_0x105f4c[_0x59074d(0x154)]===0x1)return 0x0;for(const [_0x1b7bea,_0x310b5a]of _0x105f4c[_0x59074d(0x119)]()){process['stderr'][_0x59074d(0x14d)]('\x20\x20'+(_0x1b7bea+0x1)+'.\x20'+_0x310b5a+'\x0a');}const _0x1d8d21=createInterface({'input':process[_0x59074d(0x14a)],'output':process[_0x59074d(0x11e)]});while(!![]){const _0x6d66cc=await new Promise(_0x26a3f5=>{const _0x2cf5ea=_0x59074d;_0x1d8d21[_0x2cf5ea(0x144)](_0x340f8e+'\x20',_0x26a3f5);}),_0x1de195=Number[_0x59074d(0x111)](_0x6d66cc[_0x59074d(0x163)](),0xa);if(Number[_0x59074d(0x113)](_0x1de195)&&_0x1de195>=0x1&&_0x1de195<=_0x105f4c['length'])return _0x1d8d21['close'](),_0x1de195-0x1;process[_0x59074d(0x11e)][_0x59074d(0x14d)](_0x59074d(0x133)+_0x105f4c[_0x59074d(0x154)]+'.\x0a');}}function buildFilePath(_0x4cb907,_0x16e564,_0x20e4eb,_0x177d8c){const _0x475029=a32_0x13b156;if(_0x16e564===_0x475029(0x16b)){if(!_0x177d8c)throw CliErrors[_0x475029(0x141)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x47997c=_0x177d8c[_0x475029(0x15a)]??_0x177d8c[_0x475029(0x126)];return join(_0x4cb907['scriptsRootDir'],_0x475029(0x16b),_0x47997c,_0x177d8c['operationType'],_0x177d8c['functionNode'],_0x20e4eb+'.js');}return join(_0x4cb907[_0x475029(0x137)],_0x16e564,_0x20e4eb+'.js');}export function generateTemplate(_0x492a05,_0x25a39e,_0x11d283,_0x24be91,_0x5ef19c){const _0x367e5e=a32_0x13b156,_0x1d0c37=_0x24be91?.[_0x367e5e(0x163)]()||'TODO:\x20add\x20script\x20description';if(_0x492a05==='COMMON')return _0x367e5e(0x13f)+_0x1d0c37+_0x367e5e(0x120)+_0x25a39e+_0x367e5e(0x124)+_0x25a39e+_0x367e5e(0x165)+_0x25a39e+_0x367e5e(0x135);if(_0x492a05===_0x367e5e(0x11d))return _0x367e5e(0x16a)+_0x1d0c37+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x11d283+'/'+_0x25a39e+_0x367e5e(0x156)+_0x25a39e+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x5ef19c)throw CliErrors[_0x367e5e(0x141)](_0x367e5e(0x132));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x1d0c37+_0x367e5e(0x149)+_0x11d283+'/'+_0x5ef19c[_0x367e5e(0x126)]+'/'+_0x5ef19c[_0x367e5e(0x13d)]+_0x367e5e(0x117)+_0x5ef19c[_0x367e5e(0x125)]+_0x367e5e(0x123)+_0x25a39e+_0x367e5e(0x135);}
|