@lovrabet/rabetbase-cli 2.4.2 → 2.4.3-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.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-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.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/generate.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 -1
- 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/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.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/file/index.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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.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/mutations.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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.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/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.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/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.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-index-auditor.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/error-output.js +1 -1
- package/lib/framework/explicit-yes.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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 +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a19_0x3335(){const _0x274f99=['1532aCAYWr','global','No\x20apps\x20configured','defaultApp','project','projectPath','read','appcode','globalPath','45010PpmzdQ','boolean','969038qEOkfY','700GHVIGu','object','63wZDUfO','optional','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','push','entries','remote','globalConfig','1199128AyRxkI','find','5766TCjJiK','1880835iJxZTD','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','inherit','bool','44SEIdrn','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','apps','308EVlJOK','list','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','projectConfig','app','merged','\x20config','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','\x20in\x20','length','isCurrent','4737XtmRsi'];a19_0x3335=function(){return _0x274f99;};return a19_0x3335();}const a19_0x23a607=a19_0xefc7;(function(_0x3dd017,_0x181771){const _0x52e70e=a19_0xefc7,_0x44cbdc=_0x3dd017();while(!![]){try{const _0x1df114=parseInt(_0x52e70e(0x125))/0x1*(-parseInt(_0x52e70e(0x135))/0x2)+-parseInt(_0x52e70e(0x134))/0x3*(-parseInt(_0x52e70e(0x129))/0x4)+-parseInt(_0x52e70e(0x115))/0x5*(parseInt(_0x52e70e(0x120))/0x6)+-parseInt(_0x52e70e(0x114))/0x7+parseInt(_0x52e70e(0x11e))/0x8+-parseInt(_0x52e70e(0x117))/0x9*(parseInt(_0x52e70e(0x112))/0xa)+parseInt(_0x52e70e(0x121))/0xb;if(_0x1df114===_0x181771)break;else _0x44cbdc['push'](_0x44cbdc['shift']());}catch(_0x41594a){_0x44cbdc['push'](_0x44cbdc['shift']());}}}(a19_0x3335,0x19752));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/remote-directory.js';function buildItemsFromLayer(_0xdd24c2,_0x4ab8d2){const _0x555904=a19_0xefc7,_0x4c6400=[],_0x46bf8b=_0xdd24c2['apps']&&typeof _0xdd24c2[_0x555904(0x128)]===_0x555904(0x116)?_0xdd24c2[_0x555904(0x128)]:{},_0xf6447d=_0xdd24c2[_0x555904(0x138)]||undefined;for(const [_0x3bbecb,_0x2dd58c]of Object[_0x555904(0x11b)](_0x46bf8b)){if(!_0x2dd58c||typeof _0x2dd58c!=='object'||!_0x2dd58c['appcode'])continue;_0x4c6400[_0x555904(0x11a)]({'name':_0x3bbecb,'appcode':_0x2dd58c['appcode'],'named':!![],'definedIn':_0x4ab8d2,'isDefault':_0x3bbecb===_0xf6447d,...buildAppProfileListFields(_0x2dd58c)});}return _0x4c6400;}function buildMergedItems(_0xe666ab,_0xf299c4){const _0x865bd1=a19_0xefc7,{apps:apps={},defaultApp:_0x4f85c4}=_0xe666ab,_0x628f75=_0xf299c4[_0x865bd1(0x11d)][_0x865bd1(0x128)]&&typeof _0xf299c4[_0x865bd1(0x11d)][_0x865bd1(0x128)]===_0x865bd1(0x116)?_0xf299c4[_0x865bd1(0x11d)][_0x865bd1(0x128)]:{},_0x292886=_0xf299c4['projectConfig'][_0x865bd1(0x128)]&&typeof _0xf299c4['projectConfig'][_0x865bd1(0x128)]===_0x865bd1(0x116)?_0xf299c4[_0x865bd1(0x12c)]['apps']:{},_0x3b13de=_0xf299c4[_0x865bd1(0x12c)][_0x865bd1(0x123)]===![],_0x36053a=Object[_0x865bd1(0x11b)](apps),_0x482849=_0x36053a['map'](([_0x1f46e4,_0x410f1b])=>({'name':_0x1f46e4,'appcode':_0x410f1b[_0x865bd1(0x13c)],'named':!![],'definedIn':appDefinedIn(_0x1f46e4,_0x628f75,_0x292886,_0x3b13de),'isDefault':_0x1f46e4===_0x4f85c4,...buildAppProfileListFields(_0x410f1b)}));return _0x482849;}function validateAppListFlags(_0x1b75c1){const _0x3e0105=a19_0xefc7;if(!_0x1b75c1['bool'](_0x3e0105(0x11c)))return;if(!_0x1b75c1[_0x3e0105(0x124)](_0x3e0105(0x136))&&!_0x1b75c1[_0x3e0105(0x124)](_0x3e0105(0x139)))return;throw CliErrors['validation'](_0x3e0105(0x127),_0x3e0105(0x119));}async function execute(_0x156866){const _0x371744=a19_0xefc7;validateAppListFlags(_0x156866);if(_0x156866['bool'](_0x371744(0x11c)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x156866)};const _0x46ced4=_0x156866[_0x371744(0x124)](_0x371744(0x136)),_0x55c760=_0x156866['bool'](_0x371744(0x139)),_0xefb478=_0x46ced4?_0x371744(0x136):_0x55c760?'project':_0x371744(0x12e),{config:_0x2aeab6,layers:_0x5a75c4}=readRawConfigWithLayers(),_0x3173a7=resolveDefaultAppSource(_0x5a75c4),{defaultApp:_0x26b85f}=_0x2aeab6;let _0x267210,_0x4dfef9;switch(_0xefb478){case _0x371744(0x136):_0x267210=buildItemsFromLayer(_0x5a75c4[_0x371744(0x11d)],_0x371744(0x136)),_0x4dfef9=_0x5a75c4['globalPath'];break;case _0x371744(0x139):_0x267210=buildItemsFromLayer(_0x5a75c4[_0x371744(0x12c)],_0x371744(0x139)),_0x4dfef9=_0x5a75c4[_0x371744(0x13a)];break;default:_0x267210=buildMergedItems(_0x2aeab6,_0x5a75c4);break;}enrichAppListItemsWithMergedSelection(_0x267210,_0x156866['mergedCli']);if(_0x267210[_0x371744(0x132)]===0x0){const _0x2ac256=_0xefb478===_0x371744(0x12e)?'':_0x371744(0x131)+_0xefb478+_0x371744(0x12f);return{'ok':!![],'data':[],'message':_0x371744(0x137)+_0x2ac256+'.\x20Use\x20`'+CLI_BIN_NAME+_0x371744(0x126)};}const _0x40935b=_0x267210[_0x371744(0x11f)](_0x3aa946=>_0x3aa946[_0x371744(0x133)]===!![]),_0x1163e9=_0x26b85f??_0x40935b?.[_0x371744(0x13c)]??null,_0x4dfcbd=_0xefb478===_0x371744(0x12e)?{'globalPath':_0x5a75c4[_0x371744(0x13d)]??null,'projectPath':_0x5a75c4[_0x371744(0x13a)]??null,'defaultApp':_0x1163e9,'defaultAppSource':_0x26b85f!=null?_0x3173a7:null}:{'scope':_0xefb478,'configPath':_0x4dfef9??null};return{'ok':!![],'data':{'items':_0x267210,'meta':_0x4dfcbd}};}function a19_0xefc7(_0x4edff2,_0x5cbeb6){_0x4edff2=_0x4edff2-0x112;const _0x333583=a19_0x3335();let _0xefc79=_0x333583[_0x4edff2];return _0xefc79;}export const appListDefinition={'service':a19_0x23a607(0x12d),'command':a19_0x23a607(0x12a),'description':a19_0x23a607(0x130),'risk':a19_0x23a607(0x13b),'auth':a19_0x23a607(0x118),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x23a607(0x11c),'type':'boolean','description':a19_0x23a607(0x12b),'default':![]},{'name':'global','type':'boolean','description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a19_0x23a607(0x139),'type':a19_0x23a607(0x113),'description':a19_0x23a607(0x122),'default':![]}],async 'validate'(_0x50bb1e){validateAppListFlags(_0x50bb1e);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x5c0caa=a20_0x25cd;(function(_0x30f55e,_0x2744d1){const _0x166a9c=a20_0x25cd,_0x3d460c=_0x30f55e();while(!![]){try{const _0xf6a139=-parseInt(_0x166a9c(0xc8))/0x1*(parseInt(_0x166a9c(0xbb))/0x2)+-parseInt(_0x166a9c(0xc1))/0x3+parseInt(_0x166a9c(0xc0))/0x4*(-parseInt(_0x166a9c(0xbd))/0x5)+-parseInt(_0x166a9c(0xc3))/0x6*(-parseInt(_0x166a9c(0xc6))/0x7)+parseInt(_0x166a9c(0xc7))/0x8*(-parseInt(_0x166a9c(0xbc))/0x9)+-parseInt(_0x166a9c(0xbe))/0xa+parseInt(_0x166a9c(0xbf))/0xb*(parseInt(_0x166a9c(0xca))/0xc);if(_0xf6a139===_0x2744d1)break;else _0x3d460c['push'](_0x3d460c['shift']());}catch(_0x25c6c6){_0x3d460c['push'](_0x3d460c['shift']());}}}(a20_0x4053,0xe042c));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a20_0x25cd(_0x28fc27,_0x30355e){_0x28fc27=_0x28fc27-0xbb;const _0x40539c=a20_0x4053();let _0x25cda8=_0x40539c[_0x28fc27];return _0x25cda8;}export const appMembersListDefinition={'service':a20_0x5c0caa(0xc4),'command':a20_0x5c0caa(0xc9),'description':'List\x20application\x20members\x20with\x20their\x20role\x20memberships','risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x329a31){const _0x2e904c=a20_0x5c0caa,_0x27212c=projectAppMembers(await listRoleUsers(_0x329a31[_0x2e904c(0xc2)]));return{'ok':!![],'data':{'appCode':_0x329a31[_0x2e904c(0xc2)],'items':_0x27212c,'totalCount':_0x27212c['length']},'message':_0x2e904c(0xcb)+_0x27212c[_0x2e904c(0xc5)]+'\x20application\x20member(s)'};}};function a20_0x4053(){const _0x137705=['84UoTZCD','Found\x20','1101314nYWACe','5210622CbhBta','5aVxpDz','6096120ZqFbHW','6722903MPVKXx','5417860Xoqknr','2056725pRUcWU','appCode','12ebBEvp','app','length','5521404yrRrgJ','24nTprSm','1yYBJaR','members-list'];a20_0x4053=function(){return _0x137705;};return a20_0x4053();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a21_0x302f(){const _0x36cdbf=['6CEvXDJ','320508eHWpxW','19365GHaOKP','30jmWBJo','10398938OKSowU','944883eIAAAG','223toPIMe','appCode','authRequired','612423lWdaiZ','platform','244pwSyRq','3231312fJuIdI','appDesc','appName','map','5458OMHdii'];a21_0x302f=function(){return _0x36cdbf;};return a21_0x302f();}(function(_0x236ea2,_0x24ef40){const _0x20495d=a21_0x5e25,_0x282d28=_0x236ea2();while(!![]){try{const _0x4b00bc=parseInt(_0x20495d(0x18d))/0x1*(-parseInt(_0x20495d(0x197))/0x2)+parseInt(_0x20495d(0x199))/0x3+parseInt(_0x20495d(0x192))/0x4*(-parseInt(_0x20495d(0x19a))/0x5)+-parseInt(_0x20495d(0x198))/0x6*(-parseInt(_0x20495d(0x190))/0x7)+parseInt(_0x20495d(0x193))/0x8+parseInt(_0x20495d(0x19d))/0x9*(-parseInt(_0x20495d(0x19b))/0xa)+parseInt(_0x20495d(0x19c))/0xb;if(_0x4b00bc===_0x24ef40)break;else _0x282d28['push'](_0x282d28['shift']());}catch(_0x3cc6de){_0x282d28['push'](_0x282d28['shift']());}}}(a21_0x302f,0x5db48));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';function resolveCookie(_0x473e86){const _0x2627a6=a21_0x5e25,_0x36603b=_0x473e86['cookie']||getCookie();if(!_0x36603b)throw CliErrors[_0x2627a6(0x18f)]();return _0x36603b;}function a21_0x5e25(_0x22a6bb,_0xfdad27){_0x22a6bb=_0x22a6bb-0x18d;const _0x302ff0=a21_0x302f();let _0x5e25c2=_0x302ff0[_0x22a6bb];return _0x5e25c2;}export async function listRemoteAppDirectory(_0x420247){const _0x3cde77=a21_0x5e25,_0x4533f2=await withActiveCookie(resolveCookie(_0x420247),()=>listRemoteApps());return{'items':_0x4533f2[_0x3cde77(0x196)](_0xb9a7ba=>({..._0xb9a7ba['id']!=null?{'id':_0xb9a7ba['id']}:{},'appCode':_0xb9a7ba[_0x3cde77(0x18e)],'appName':_0xb9a7ba[_0x3cde77(0x195)],..._0xb9a7ba[_0x3cde77(0x194)]!=null?{'appDesc':_0xb9a7ba['appDesc']}:{}})),'meta':{'source':_0x3cde77(0x191)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38624e,_0x3ade33){const _0x2733b3=a22_0x28a7,_0xb4d223=_0x38624e();while(!![]){try{const _0x2f28b9=parseInt(_0x2733b3(0xb6))/0x1*(parseInt(_0x2733b3(0xc2))/0x2)+parseInt(_0x2733b3(0xca))/0x3*(-parseInt(_0x2733b3(0xc8))/0x4)+parseInt(_0x2733b3(0xdb))/0x5*(parseInt(_0x2733b3(0xd8))/0x6)+-parseInt(_0x2733b3(0xcd))/0x7+parseInt(_0x2733b3(0xba))/0x8*(-parseInt(_0x2733b3(0xb7))/0x9)+parseInt(_0x2733b3(0xc9))/0xa*(parseInt(_0x2733b3(0xc5))/0xb)+-parseInt(_0x2733b3(0xbe))/0xc;if(_0x2f28b9===_0x3ade33)break;else _0xb4d223['push'](_0xb4d223['shift']());}catch(_0x4e52eb){_0xb4d223['push'](_0xb4d223['shift']());}}}(a22_0x5ebf,0x53b6a));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x321c9b){const _0x3d5c30=a22_0x28a7,_0x900d0e=_0x321c9b?.[_0x3d5c30(0xc0)]();return _0x900d0e?_0x900d0e:null;}export function projectAppMembers(_0x25cb60){const _0x522523=a22_0x28a7,_0x19c29b=new Map(),_0x4055b0=[..._0x25cb60][_0x522523(0xaa)]((_0x4d5fbb,_0x5c35bf)=>_0x4d5fbb['id']-_0x5c35bf['id']),_0x1430fe=(_0x37a498,_0x52034a,_0xa64a2d)=>{const _0x51f638=_0x522523;for(const _0x13e18a of _0x52034a){const _0x2c3b48=Number(_0x13e18a[_0x51f638(0xab)]);if(!Number[_0x51f638(0xaf)](_0x2c3b48)||_0x2c3b48<=0x0)continue;let _0x87ead3=_0x19c29b[_0x51f638(0xd5)](_0x2c3b48);if(!_0x87ead3)_0x87ead3={'userId':_0x2c3b48,'username':nullableText(_0x13e18a[_0x51f638(0xd6)]),'displayName':nullableText(_0x13e18a[_0x51f638(0xb9)]),'status':_0xa64a2d,'roles':[],'roleKeys':new Set()},_0x19c29b[_0x51f638(0xdc)](_0x2c3b48,_0x87ead3);else{_0x87ead3[_0x51f638(0xd6)]??=nullableText(_0x13e18a[_0x51f638(0xd6)]),_0x87ead3[_0x51f638(0xd0)]??=nullableText(_0x13e18a[_0x51f638(0xb9)]);if(_0xa64a2d===_0x51f638(0xb0))_0x87ead3[_0x51f638(0xb3)]=_0x51f638(0xb0);}const _0x41d881=_0x37a498['id']+':'+_0xa64a2d;if(_0x87ead3[_0x51f638(0xa8)][_0x51f638(0xb1)](_0x41d881))continue;_0x87ead3[_0x51f638(0xa8)][_0x51f638(0xb2)](_0x41d881),_0x87ead3[_0x51f638(0xcc)][_0x51f638(0xa7)]({'roleId':_0x37a498['id'],'roleName':nullableText(_0x37a498[_0x51f638(0xc1)]),'roleType':nullableText(_0x37a498[_0x51f638(0xcb)]),'membershipStatus':_0xa64a2d});}};for(const _0x1d73dd of _0x4055b0){_0x1430fe(_0x1d73dd,_0x1d73dd['userList']??[],_0x522523(0xb0)),_0x1430fe(_0x1d73dd,_0x1d73dd[_0x522523(0xd9)]??[],_0x522523(0xda));}return[..._0x19c29b[_0x522523(0xd3)]()][_0x522523(0xce)](_0x22c3d1=>({'userId':_0x22c3d1[_0x522523(0xab)],'username':_0x22c3d1[_0x522523(0xd6)],'displayName':_0x22c3d1[_0x522523(0xd0)],'status':_0x22c3d1[_0x522523(0xb3)],'roles':_0x22c3d1[_0x522523(0xcc)]['sort']((_0x410dae,_0x5a0df2)=>_0x410dae[_0x522523(0xac)]-_0x5a0df2[_0x522523(0xac)]||(_0x410dae['membershipStatus']===_0x5a0df2[_0x522523(0xc4)]?0x0:_0x410dae['membershipStatus']==='ACTIVE'?-0x1:0x1))}))[_0x522523(0xaa)]((_0x71d27f,_0x1d9c41)=>_0x71d27f['userId']-_0x1d9c41[_0x522523(0xab)]);}function a22_0x28a7(_0x3d7410,_0x32cc2e){_0x3d7410=_0x3d7410-0xa7;const _0x5ebfb9=a22_0x5ebf();let _0x28a748=_0x5ebfb9[_0x3d7410];return _0x28a748;}export function enrichAppListItemsWithMergedSelection(_0x2a09f7,_0x1dcb32){const _0x5973de=a22_0x28a7;if(!_0x1dcb32)return;const _0x5da654=_0x1dcb32[_0x5973de(0xcf)]&&typeof _0x1dcb32['apps']===_0x5973de(0xb5)?_0x1dcb32['apps']:{},_0x5465c=Object['keys'](_0x5da654)['length']>0x0;for(const _0x7f0b83 of _0x2a09f7){_0x7f0b83['isCurrent']=![];}const _0x3dcb31=_0x1dcb32['appCode']!=null?String(_0x1dcb32[_0x5973de(0xb8)])['trim']():'';if(_0x5465c){const _0x2c458f=_0x1dcb32[_0x5973de(0xd7)]??_0x1dcb32['defaultApp'];if(_0x2c458f)for(const _0x4ba294 of _0x2a09f7){_0x4ba294[_0x5973de(0xbb)]===!![]&&_0x4ba294[_0x5973de(0xad)]===_0x2c458f&&(_0x4ba294[_0x5973de(0xbf)]=!![]);}for(const _0x152915 of _0x2a09f7){if(_0x152915['named']!==![])continue;if(_0x1dcb32[_0x5973de(0xc6)])continue;_0x3dcb31&&String(_0x152915[_0x5973de(0xd4)]??'')['trim']()===_0x3dcb31&&(_0x152915[_0x5973de(0xbf)]=!![]);}return;}if(!_0x3dcb31)return;for(const _0x57fd53 of _0x2a09f7){String(_0x57fd53[_0x5973de(0xd4)]??'')[_0x5973de(0xc0)]()===_0x3dcb31&&(_0x57fd53[_0x5973de(0xbf)]=!![]);}}export function resolveAppScopeForWrite(_0x192dea,_0x22c1c2,_0x496646){const _0x57c164=a22_0x28a7;if(_0x22c1c2)return _0x57c164(0xd2);const _0x214cba=_0x496646[_0x57c164(0xae)][_0x57c164(0xcf)]&&typeof _0x496646[_0x57c164(0xae)][_0x57c164(0xcf)]===_0x57c164(0xb5)?_0x496646['projectConfig'][_0x57c164(0xcf)]:{},_0x476eca=_0x496646[_0x57c164(0xbc)]['apps']&&typeof _0x496646[_0x57c164(0xbc)][_0x57c164(0xcf)]===_0x57c164(0xb5)?_0x496646[_0x57c164(0xbc)][_0x57c164(0xcf)]:{};if(Object['prototype'][_0x57c164(0xc7)][_0x57c164(0xc3)](_0x214cba,_0x192dea))return _0x57c164(0xa9);if(Object[_0x57c164(0xb4)][_0x57c164(0xc7)][_0x57c164(0xc3)](_0x476eca,_0x192dea))return _0x57c164(0xd2);return'project';}function a22_0x5ebf(){const _0x310ac3=['status','prototype','object','1dOwpxv','828513fPghSi','appCode','nickname','8NAyGZK','named','globalConfig','inherit','6204408noaYKx','isCurrent','trim','roleName','891398pkigmL','call','membershipStatus','137236HJxzNX','defaultApp','hasOwnProperty','4gTmXLQ','260nsscWR','829911ziNUqx','roleType','roles','1302483rfvNJz','map','apps','displayName','\x20(global)','global','values','appcode','get','username','currentApp','966918pEtxMY','applyUserList','PENDING','20lFqCro','set','length','push','roleKeys','project','sort','userId','roleId','name','projectConfig','isFinite','ACTIVE','has','add'];a22_0x5ebf=function(){return _0x310ac3;};return a22_0x5ebf();}export function appDefinedIn(_0x4f83db,_0x295eaf,_0x1aa269,_0x1c5259){const _0x4a3759=a22_0x28a7;if(_0x1c5259)return Object[_0x4a3759(0xb4)][_0x4a3759(0xc7)][_0x4a3759(0xc3)](_0x1aa269,_0x4f83db)?_0x4a3759(0xa9):'global';const _0x13fe45=Object['prototype'][_0x4a3759(0xc7)][_0x4a3759(0xc3)](_0x295eaf,_0x4f83db),_0x3bb6bf=Object[_0x4a3759(0xb4)][_0x4a3759(0xc7)][_0x4a3759(0xc3)](_0x1aa269,_0x4f83db);if(_0x13fe45&&_0x3bb6bf)return'both';if(_0x3bb6bf)return'project';return _0x4a3759(0xd2);}export function resolveDefaultAppSource(_0xcf72b4){const _0x4a1134=a22_0x28a7,_0x5f6fc0=_0xcf72b4['projectConfig'][_0x4a1134(0xcf)]&&typeof _0xcf72b4[_0x4a1134(0xae)]['apps']===_0x4a1134(0xb5)?_0xcf72b4[_0x4a1134(0xae)]['apps']:{};if(_0x4a1134(0xc6)in _0xcf72b4['projectConfig'])return _0x4a1134(0xa9);if(Object['keys'](_0x5f6fc0)[_0x4a1134(0xdd)]>0x0)return _0x4a1134(0xa9);if(_0xcf72b4[_0x4a1134(0xae)][_0x4a1134(0xbd)]===![])return null;if(_0xcf72b4[_0x4a1134(0xbc)][_0x4a1134(0xc6)])return'global';return null;}export function getConfigPath(_0x589cb={}){const _0xfbcc89=a22_0x28a7,_0x2d8809=_0x589cb[_0xfbcc89(0xd2)]?_0xfbcc89(0xd2):'project';return resolveWriteConfigPath(_0x2d8809);}export function readConfig(_0xf6122c={}){return readConfigFile(getConfigPath(_0xf6122c));}export function writeConfig(_0x4133a9,_0x54ecfb={}){writeConfigFile(getConfigPath(_0x54ecfb),_0x4133a9);}export function scopeLabel(_0x22b572){const _0x4b800a=a22_0x28a7;return _0x22b572[_0x4b800a(0xd2)]?_0x4b800a(0xd1):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x3cfd3a=a23_0x12ce;(function(_0x17f3af,_0x5e682e){const _0x2f217a=a23_0x12ce,_0x4df1f1=_0x17f3af();while(!![]){try{const _0x38ac0f=parseInt(_0x2f217a(0xd5))/0x1+parseInt(_0x2f217a(0xcd))/0x2*(-parseInt(_0x2f217a(0xd2))/0x3)+-parseInt(_0x2f217a(0xc4))/0x4*(parseInt(_0x2f217a(0xcf))/0x5)+-parseInt(_0x2f217a(0xce))/0x6+parseInt(_0x2f217a(0xd7))/0x7+parseInt(_0x2f217a(0xd6))/0x8+-parseInt(_0x2f217a(0xc7))/0x9*(parseInt(_0x2f217a(0xc5))/0xa);if(_0x38ac0f===_0x5e682e)break;else _0x4df1f1['push'](_0x4df1f1['shift']());}catch(_0x326125){_0x4df1f1['push'](_0x4df1f1['shift']());}}}(a23_0x3d03,0xc6e97));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a23_0x12ce(_0xf3fd43,_0x145d2a){_0xf3fd43=_0xf3fd43-0xc4;const _0x3d0362=a23_0x3d03();let _0x12ce50=_0x3d0362[_0xf3fd43];return _0x12ce50;}import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x3cfd3a(0xd4);function a23_0x3d03(){const _0x2fc108=['157491aQFuCp',',\x20appCode=','delete','appCode:\x20','isFinite','Delete\x20one\x20runtime\x20app-config\x20key','2716144vAsQZs','1590222hMgMNi','2708995IaNiGw','appCode','validation','3enMegZ','Deleted\x20app\x20config\x20','/smartapi/app-config/delete','1367953HJmIxz','8972440KSYuEa','10045623krRnfh','App\x20config\x20server\x20id\x20missing\x20for\x20key=','apiError','high-risk-write','4BYhYmo','540eQmYCp','number'];a23_0x3d03=function(){return _0x2fc108;};return a23_0x3d03();}export const appConfigDelete={'service':'app-config','command':a23_0x3cfd3a(0xc9),'description':a23_0x3cfd3a(0xcc),'risk':a23_0x3cfd3a(0xda),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1752ab){readKeyArg(_0x1752ab);},async 'dryRun'(_0x525021){const _0x49d4a2=a23_0x3cfd3a,_0x313e7b=readKeyArg(_0x525021),_0x924c7e=await mustGetByKey(_0x525021[_0x49d4a2(0xd0)],_0x313e7b);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x525021[_0x49d4a2(0xd0)],'key':_0x313e7b,'before':projectAppConfig(_0x924c7e),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x1b6caa){const _0x3aec14=a23_0x3cfd3a,_0x11b9fe=readKeyArg(_0x1b6caa),_0x51d405=await mustGetByKey(_0x1b6caa[_0x3aec14(0xd0)],_0x11b9fe);return await withAppConfigApiBoundary('delete',{'appCode':_0x1b6caa[_0x3aec14(0xd0)],'key':_0x11b9fe},()=>deleteAppConfig({'appCode':_0x1b6caa[_0x3aec14(0xd0)],'id':requireAppConfigId(_0x51d405,_0x11b9fe,_0x1b6caa[_0x3aec14(0xd0)])})),{'ok':!![],'data':buildMutationData({'operation':_0x3aec14(0xc9),'appCode':_0x1b6caa[_0x3aec14(0xd0)],'key':_0x11b9fe,'before':projectAppConfig(_0x51d405),'after':null,'dryRun':![]}),'message':_0x3aec14(0xd3)+_0x11b9fe};}};async function mustGetByKey(_0x5ec86a,_0x1ba86c){const _0x21f29d=a23_0x3cfd3a,_0x5ad22f=await withAppConfigApiBoundary('get',{'appCode':_0x5ec86a,'key':_0x1ba86c},()=>getAppConfigByKey(_0x5ec86a,_0x1ba86c));if(!_0x5ad22f)throw CliErrors[_0x21f29d(0xd1)]('App\x20config\x20key\x20not\x20found:\x20'+_0x1ba86c,_0x21f29d(0xca)+_0x5ec86a);return _0x5ad22f;}function requireAppConfigId(_0xd697da,_0x33bc88,_0x454ece){const _0x19ca85=a23_0x3cfd3a;if(typeof _0xd697da['id']===_0x19ca85(0xc6)&&Number[_0x19ca85(0xcb)](_0xd697da['id'])&&_0xd697da['id']>0x0)return _0xd697da['id'];throw CliErrors[_0x19ca85(0xd9)](_0x19ca85(0xd8)+_0x33bc88+_0x19ca85(0xc8)+_0x454ece);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x3e7c1b=a24_0x301c;(function(_0x818893,_0x468b5d){const _0x18a1b9=a24_0x301c,_0xb85e38=_0x818893();while(!![]){try{const _0x1bef4b=parseInt(_0x18a1b9(0x117))/0x1*(-parseInt(_0x18a1b9(0x123))/0x2)+parseInt(_0x18a1b9(0x128))/0x3*(-parseInt(_0x18a1b9(0x121))/0x4)+parseInt(_0x18a1b9(0x122))/0x5+parseInt(_0x18a1b9(0x127))/0x6+parseInt(_0x18a1b9(0x125))/0x7+parseInt(_0x18a1b9(0x11e))/0x8+parseInt(_0x18a1b9(0x11d))/0x9*(-parseInt(_0x18a1b9(0x118))/0xa);if(_0x1bef4b===_0x468b5d)break;else _0xb85e38['push'](_0xb85e38['shift']());}catch(_0x4196cf){_0xb85e38['push'](_0xb85e38['shift']());}}}(a24_0x27db,0x44c03));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a24_0x301c(_0x606e58,_0x1da981){_0x606e58=_0x606e58-0x112;const _0x27db3f=a24_0x27db();let _0x301c27=_0x27db3f[_0x606e58];return _0x301c27;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a24_0x3e7c1b(0x11b),'command':a24_0x3e7c1b(0x124),'description':a24_0x3e7c1b(0x115),'risk':a24_0x3e7c1b(0x120),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x3a60ac){readKeyArg(_0x3a60ac);},async 'execute'(_0x484524){const _0x596b77=a24_0x3e7c1b,_0x327f82=readKeyArg(_0x484524),_0x572b97=await withAppConfigApiBoundary('get',{'appCode':_0x484524[_0x596b77(0x113)],'key':_0x327f82},()=>getAppConfigByKey(_0x484524['appCode'],_0x327f82));if(!_0x572b97)throw CliErrors[_0x596b77(0x116)](_0x596b77(0x11f)+_0x327f82,_0x596b77(0x112)+_0x484524[_0x596b77(0x113)]);const _0x1826c1=projectAppConfig(_0x572b97,{'reveal':_0x484524[_0x596b77(0x11a)](_0x596b77(0x114))});return{'ok':!![],'data':{'config':_0x1826c1},'message':_0x484524[_0x596b77(0x11a)](_0x596b77(0x114))?_0x596b77(0x119)+_0x327f82+_0x596b77(0x126):'Loaded\x20app\x20config\x20'+_0x327f82+_0x596b77(0x11c)};}};function a24_0x27db(){const _0x60333e=['appCode:\x20','appCode','reveal','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','validation','1vPdwmi','10xKxlaj','Loaded\x20app\x20config\x20','bool','app-config','\x20with\x20value\x20redacted','1747215JhLoRJ','2163352Wmzplv','App\x20config\x20key\x20not\x20found:\x20','read','103580XnodwO','1140595TXiZXv','227462XjAZiM','get','662480Hzcksl','\x20with\x20value\x20revealed','2929776GWzHoY','57GJxSgG'];a24_0x27db=function(){return _0x60333e;};return a24_0x27db();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x4b65(_0x339473,_0x4386c3){_0x339473=_0x339473-0x119;const _0xda62c4=a25_0xda62();let _0x4b65d5=_0xda62c4[_0x339473];return _0x4b65d5;}(function(_0x5c7080,_0xa72f65){const _0x523e2a=a25_0x4b65,_0x4a55fd=_0x5c7080();while(!![]){try{const _0x1eccee=-parseInt(_0x523e2a(0x11a))/0x1+-parseInt(_0x523e2a(0x120))/0x2+parseInt(_0x523e2a(0x11e))/0x3*(-parseInt(_0x523e2a(0x122))/0x4)+-parseInt(_0x523e2a(0x11f))/0x5+-parseInt(_0x523e2a(0x121))/0x6+-parseInt(_0x523e2a(0x11d))/0x7*(parseInt(_0x523e2a(0x11c))/0x8)+-parseInt(_0x523e2a(0x119))/0x9*(-parseInt(_0x523e2a(0x11b))/0xa);if(_0x1eccee===_0xa72f65)break;else _0x4a55fd['push'](_0x4a55fd['shift']());}catch(_0x208743){_0x4a55fd['push'](_0x4a55fd['shift']());}}}(a25_0xda62,0x2eec8));function a25_0xda62(){const _0x119489=['316630nHUfAF','8NcZYxD','967057xmYZzC','6963bphMdW','79225IzyPYy','754306FkMQuC','123570wNXurB','552oQJFRZ','378cCeaaV','265604nyiXyP'];a25_0xda62=function(){return _0x119489;};return a25_0xda62();}import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x234e5a=a26_0x5a5c;function a26_0x3ac4(){const _0x27fc65=['length','493855hOnRQS','trim','Found\x20','94761HvsGpn','read','app-config','313056jpFhIB','280kQszUd','appCode','list','str','\x20app\x20config(s)','6aHHgse','890348rpmsez','3797269yLEdJi','1007948rzrDRK','Filter\x20by\x20exact\x20config\x20key','string','map','1204800MIwGYE','key'];a26_0x3ac4=function(){return _0x27fc65;};return a26_0x3ac4();}function a26_0x5a5c(_0x286501,_0x432879){_0x286501=_0x286501-0x154;const _0x3ac425=a26_0x3ac4();let _0x5a5c1f=_0x3ac425[_0x286501];return _0x5a5c1f;}(function(_0x29d9d7,_0x4da7bc){const _0x1b59ae=a26_0x5a5c,_0x279d2f=_0x29d9d7();while(!![]){try{const _0x3d12e5=parseInt(_0x1b59ae(0x164))/0x1+-parseInt(_0x1b59ae(0x15b))/0x2+-parseInt(_0x1b59ae(0x154))/0x3+-parseInt(_0x1b59ae(0x15d))/0x4+-parseInt(_0x1b59ae(0x161))/0x5+-parseInt(_0x1b59ae(0x15a))/0x6*(-parseInt(_0x1b59ae(0x15c))/0x7)+parseInt(_0x1b59ae(0x155))/0x8*(parseInt(_0x1b59ae(0x167))/0x9);if(_0x3d12e5===_0x4da7bc)break;else _0x279d2f['push'](_0x279d2f['shift']());}catch(_0x1b6971){_0x279d2f['push'](_0x279d2f['shift']());}}}(a26_0x3ac4,0x5877c));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a26_0x234e5a(0x169),'command':a26_0x234e5a(0x157),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':a26_0x234e5a(0x168),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x234e5a(0x162),'type':a26_0x234e5a(0x15f),'description':a26_0x234e5a(0x15e)},TAGS_FLAG],async 'validate'(_0xe74b32){const _0x30ee5b=a26_0x234e5a,_0x2fbc83=_0xe74b32[_0x30ee5b(0x158)](_0x30ee5b(0x162))[_0x30ee5b(0x165)]();if(_0x2fbc83)validateKey(_0x2fbc83);readOptionalTags(_0xe74b32);},async 'execute'(_0x8b58c6){const _0x1c5254=a26_0x234e5a,_0x44564b=_0x8b58c6[_0x1c5254(0x158)](_0x1c5254(0x162))[_0x1c5254(0x165)]()||undefined,_0x523af5=readOptionalTags(_0x8b58c6),_0x253b55=await withAppConfigApiBoundary('list',{'appCode':_0x8b58c6['appCode']},()=>listAppConfigs(_0x8b58c6[_0x1c5254(0x156)],{'key':_0x44564b,'tags':_0x523af5})),_0x18d18b=_0x253b55[_0x1c5254(0x160)](_0x37c0de=>projectAppConfig(_0x37c0de));return{'ok':!![],'data':{'appCode':_0x8b58c6[_0x1c5254(0x156)],'count':_0x18d18b[_0x1c5254(0x163)],'configs':_0x18d18b},'message':_0x1c5254(0x166)+_0x18d18b[_0x1c5254(0x163)]+_0x1c5254(0x159)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x2221(_0xe0be5e,_0x525832){_0xe0be5e=_0xe0be5e-0xa7;const _0xbf1bc3=a27_0xbf1b();let _0x2221c1=_0xbf1bc3[_0xe0be5e];return _0x2221c1;}const a27_0x360ed4=a27_0x2221;(function(_0x3d0090,_0x218a9e){const _0x4254fd=a27_0x2221,_0x3cb7a5=_0x3d0090();while(!![]){try{const _0x194111=parseInt(_0x4254fd(0xc7))/0x1+parseInt(_0x4254fd(0xa7))/0x2*(parseInt(_0x4254fd(0xbb))/0x3)+parseInt(_0x4254fd(0xbd))/0x4*(-parseInt(_0x4254fd(0xb4))/0x5)+-parseInt(_0x4254fd(0xb3))/0x6+-parseInt(_0x4254fd(0xc3))/0x7*(-parseInt(_0x4254fd(0xad))/0x8)+parseInt(_0x4254fd(0xa9))/0x9*(parseInt(_0x4254fd(0xac))/0xa)+-parseInt(_0x4254fd(0xc5))/0xb;if(_0x194111===_0x218a9e)break;else _0x3cb7a5['push'](_0x3cb7a5['shift']());}catch(_0x31b950){_0x3cb7a5['push'](_0x3cb7a5['shift']());}}}(a27_0xbf1b,0x8bc2b));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';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';function a27_0xbf1b(){const _0x9fa50d=['file','/smartapi/app-config/create',',\x20appCode=','isFinite','\x20app\x20config\x20','tags','3163269zPuwOc','create','12galljp','POST','App\x20config\x20server\x20id\x20missing\x20for\x20key=','apiError','appCode','Read\x20config\x20value\x20from\x20file','4459lHIKuU','high-risk-write','15588672bhDBnB','get','908521uDgZaX','2VzmZfg','update','255276VErbLz','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','/smartapi/app-config/update','110cubRSH','11800fHvWJL','string','Created','Updated','number','app-config','1254366TLjXvO','1693085YjexEb'];a27_0xbf1b=function(){return _0x9fa50d;};return a27_0xbf1b();}const CREATE_PATH=a27_0x360ed4(0xb6),UPDATE_PATH=a27_0x360ed4(0xab);export const appConfigSet={'service':a27_0x360ed4(0xb2),'command':'set','description':a27_0x360ed4(0xaa),'risk':a27_0x360ed4(0xc4),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x360ed4(0xb5),'type':a27_0x360ed4(0xae),'description':a27_0x360ed4(0xc2)}],async 'validate'(_0x2e3f97){readKeyArg(_0x2e3f97),readOptionalTags(_0x2e3f97),assertSingleValueSource(_0x2e3f97);},async 'dryRun'(_0x3cf456){const _0x555b13=a27_0x360ed4,_0x5258bd=readKeyArg(_0x3cf456),_0x3ad45a=readOptionalTags(_0x3cf456),_0x5b50cb=assertSingleValueSource(_0x3cf456);await assertValueSourceReadable(_0x5b50cb);const _0x4a5bf9=await withAppConfigApiBoundary(_0x555b13(0xc6),{'appCode':_0x3cf456['appCode'],'key':_0x5258bd},()=>getAppConfigByKey(_0x3cf456[_0x555b13(0xc1)],_0x5258bd)),_0xc2b8f1=_0x4a5bf9?'update':_0x555b13(0xbc),_0x4fa9dc=_0x4a5bf9?projectAppConfig(_0x4a5bf9):null,_0x20d66a=plannedAppConfig({'appCode':_0x3cf456[_0x555b13(0xc1)],'key':_0x5258bd,'tags':_0x3ad45a??_0x4a5bf9?.[_0x555b13(0xba)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xc2b8f1,'appCode':_0x3cf456['appCode'],'key':_0x5258bd,'before':_0x4fa9dc,'after':_0x20d66a,'dryRun':!![]}),{'method':_0x555b13(0xbe),'url':_0xc2b8f1==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x513b38){const _0x2160f8=a27_0x360ed4,_0x1a59c9=readKeyArg(_0x513b38),_0x2183d7=readOptionalTags(_0x513b38),_0xa03204=await withAppConfigApiBoundary(_0x2160f8(0xc6),{'appCode':_0x513b38[_0x2160f8(0xc1)],'key':_0x1a59c9},()=>getAppConfigByKey(_0x513b38['appCode'],_0x1a59c9)),_0x5a4de7=_0xa03204?projectAppConfig(_0xa03204):null,_0x353ae8=_0xa03204?_0x2160f8(0xa8):'create',{value:_0x4371af,warnings:_0x4052b8}=await readAppConfigValue(_0x513b38),_0x1659b4={'appCode':_0x513b38[_0x2160f8(0xc1)],'key':_0x1a59c9,'value':_0x4371af,'tags':_0x2183d7??_0xa03204?.[_0x2160f8(0xba)]??undefined};await withAppConfigApiBoundary(_0x353ae8,{'appCode':_0x513b38[_0x2160f8(0xc1)],'key':_0x1a59c9},async()=>{const _0x20e9b3=_0x2160f8;_0xa03204?await updateAppConfig({..._0x1659b4,'id':requireAppConfigId(_0xa03204,_0x1a59c9,_0x513b38[_0x20e9b3(0xc1)])}):await createAppConfig(_0x1659b4);});const _0x57f3fa=await withAppConfigApiBoundary('get',{'appCode':_0x513b38['appCode'],'key':_0x1a59c9},()=>getAppConfigByKey(_0x513b38[_0x2160f8(0xc1)],_0x1a59c9)),_0x596ea6=_0x57f3fa?projectAppConfig(_0x57f3fa):plannedAppConfig({'appCode':_0x513b38[_0x2160f8(0xc1)],'key':_0x1a59c9,'tags':_0x1659b4[_0x2160f8(0xba)],'hasValue':_0x4371af!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x353ae8,'appCode':_0x513b38[_0x2160f8(0xc1)],'key':_0x1a59c9,'before':_0x5a4de7,'after':_0x596ea6,'dryRun':![],'warnings':_0x4052b8}),'message':(_0x353ae8===_0x2160f8(0xa8)?_0x2160f8(0xb0):_0x2160f8(0xaf))+_0x2160f8(0xb9)+_0x1a59c9};}};function requireAppConfigId(_0x70a401,_0x15e5c0,_0xaa7bce){const _0x2c8096=a27_0x360ed4;if(typeof _0x70a401['id']===_0x2c8096(0xb1)&&Number[_0x2c8096(0xb8)](_0x70a401['id'])&&_0x70a401['id']>0x0)return _0x70a401['id'];throw CliErrors[_0x2c8096(0xc0)](_0x2c8096(0xbf)+_0x15e5c0+_0x2c8096(0xb7)+_0xaa7bce);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a28_0x4368(){const _0xa2789b=['Environment\x20variable\x20is\x20not\x20set:\x20','argument','Runtime\x20app-config\x20key','16194bJBIKW','after','Config\x20tags\x20for\x20filtering/display\x20metadata','end','defineProperties','str','valueRedacted','22twUfnW','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','4192EvxTTy','name','trim','appCode','before','validation','Missing\x20app-config\x20value\x20source.','string','push','value','utf8','length','file','hasValue','env','App\x20config\x20value\x20source\x20is\x20ambiguous.','method','operation','30241gLVFUC','data','17755243scsXGh','from-env','tags','key','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','flag','join','error','setEncoding','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','8sWgYpT','once','50829276LFmtyd','value\x20is\x20redacted','Value\x20file\x20is\x20not\x20readable:\x20','stdin','2508195tavbRU','3185XGyWHT','slice','path','kind','10TpbBpS','args','key:\x20','bool','boolean','19764OrdBUf','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','4459815RuZgdO','appCode:\x20','dryRun','gmtCreate','Failed\x20to\x20'];a28_0x4368=function(){return _0xa2789b;};return a28_0x4368();}const a28_0x36af7e=a28_0x2ec9;(function(_0x174c3c,_0x51f56c){const _0x45fad6=a28_0x2ec9,_0x4eb6d2=_0x174c3c();while(!![]){try{const _0x99a794=parseInt(_0x45fad6(0x16c))/0x1*(parseInt(_0x45fad6(0x157))/0x2)+-parseInt(_0x45fad6(0x17e))/0x3*(-parseInt(_0x45fad6(0x178))/0x4)+-parseInt(_0x45fad6(0x18a))/0x5+-parseInt(_0x45fad6(0x192))/0x6*(-parseInt(_0x45fad6(0x17f))/0x7)+parseInt(_0x45fad6(0x15a))/0x8*(parseInt(_0x45fad6(0x188))/0x9)+parseInt(_0x45fad6(0x183))/0xa*(parseInt(_0x45fad6(0x16e))/0xb)+-parseInt(_0x45fad6(0x17a))/0xc;if(_0x99a794===_0x51f56c)break;else _0x4eb6d2['push'](_0x4eb6d2['shift']());}catch(_0x262791){_0x4eb6d2['push'](_0x4eb6d2['shift']());}}}(a28_0x4368,0xd4613));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x36af7e(0x171),'description':a28_0x36af7e(0x191),'required':!![]};export const VALUE_ARG={'name':a28_0x36af7e(0x163),'description':a28_0x36af7e(0x159),'required':![]};export const TAGS_FLAG={'name':a28_0x36af7e(0x170),'type':a28_0x36af7e(0x161),'description':a28_0x36af7e(0x194)};export const STDIN_FLAG={'name':a28_0x36af7e(0x17d),'type':a28_0x36af7e(0x187),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a28_0x36af7e(0x16f),'type':a28_0x36af7e(0x161),'description':a28_0x36af7e(0x172)};function a28_0x2ec9(_0x17d297,_0x392fd6){_0x17d297=_0x17d297-0x154;const _0x436820=a28_0x4368();let _0x2ec9c0=_0x436820[_0x17d297];return _0x2ec9c0;}export const REVEAL_FLAG={'name':'reveal','type':a28_0x36af7e(0x187),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x34fb2b){const _0x5f25ef=a28_0x36af7e,_0x1fa34b=_0x34fb2b[_0x5f25ef(0x184)][0x0]?.['trim']()??'';return validateKey(_0x1fa34b),_0x1fa34b;}export function readOptionalTags(_0x95136d){const _0x10c5d5=a28_0x36af7e,_0x33af0e=_0x95136d[_0x10c5d5(0x155)]('tags')[_0x10c5d5(0x15c)]();if(!_0x33af0e)return undefined;if(_0x33af0e[_0x10c5d5(0x165)]>0x20)throw CliErrors['validation'](_0x10c5d5(0x189));return _0x33af0e;}export function validateKey(_0x197a4e){const _0xcd6d7a=a28_0x36af7e;if(!_0x197a4e)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x197a4e[_0xcd6d7a(0x165)]>0x100)throw CliErrors['validation']('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x231043,_0x2f5584){const _0x5ec816=a28_0x36af7e,_0x4e35bd=_0x231043[_0x5ec816(0x163)]!==undefined&&_0x231043[_0x5ec816(0x163)]!==null&&_0x231043[_0x5ec816(0x163)]!=='',_0x19f1d4={'appCode':_0x231043[_0x5ec816(0x15d)],'key':_0x231043[_0x5ec816(0x171)],'tags':_0x231043[_0x5ec816(0x170)]??undefined,'hasValue':_0x4e35bd,'valueRedacted':_0x4e35bd&&!_0x2f5584?.['reveal'],'gmtCreate':_0x231043[_0x5ec816(0x18d)],'gmtModified':_0x231043['gmtModified']};return _0x2f5584?.['reveal']&&(_0x19f1d4[_0x5ec816(0x163)]=_0x231043['value']??'',_0x19f1d4[_0x5ec816(0x156)]=![]),_0x19f1d4;}export function plannedAppConfig(_0xda2ad2){const _0x1b2de6=a28_0x36af7e,_0x54594f=_0xda2ad2[_0x1b2de6(0x167)]??!![];return{'appCode':_0xda2ad2[_0x1b2de6(0x15d)],'key':_0xda2ad2['key'],'tags':_0xda2ad2['tags']??undefined,'hasValue':_0x54594f,'valueRedacted':_0x54594f};}export function buildMutationData(_0x144fcf){const _0x3eb6f9=a28_0x36af7e;return{'operation':_0x144fcf[_0x3eb6f9(0x16b)],'selector':{'appCode':_0x144fcf[_0x3eb6f9(0x15d)],'key':_0x144fcf['key']},'before':_0x144fcf[_0x3eb6f9(0x15e)],'after':_0x144fcf[_0x3eb6f9(0x193)],'dryRun':_0x144fcf[_0x3eb6f9(0x18c)],'warnings':_0x144fcf['warnings']??[]};}export async function withAppConfigApiBoundary(_0x12f4b3,_0x50d250,_0x1f2e06){const _0x2baed0=a28_0x36af7e;try{return await _0x1f2e06();}catch{const _0x3a2b83=[_0x2baed0(0x18b)+_0x50d250[_0x2baed0(0x15d)]];if(_0x50d250[_0x2baed0(0x171)])_0x3a2b83[_0x2baed0(0x162)](_0x2baed0(0x185)+_0x50d250[_0x2baed0(0x171)]);_0x3a2b83[_0x2baed0(0x162)](_0x2baed0(0x17b));throw CliErrors['apiError'](_0x2baed0(0x18e)+_0x12f4b3+'\x20app\x20config.',_0x3a2b83['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x2365c3,_0x362429){const _0x399bb6=a28_0x36af7e;return Object[_0x399bb6(0x154)](_0x2365c3,{'method':{'value':_0x362429[_0x399bb6(0x16a)],'enumerable':![]},'url':{'value':_0x362429['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x5fc50a){const _0x3df0f6=a28_0x36af7e,_0x5b2fa3=[];_0x5fc50a['args'][_0x3df0f6(0x165)]>0x1&&_0x5b2fa3[_0x3df0f6(0x162)]({'kind':_0x3df0f6(0x190),'value':_0x5fc50a[_0x3df0f6(0x184)][_0x3df0f6(0x180)](0x1)[_0x3df0f6(0x174)]('\x20')});const _0xb4f472=_0x5fc50a[_0x3df0f6(0x173)](_0x3df0f6(0x163));_0xb4f472!==undefined&&_0xb4f472!==null&&_0x5b2fa3['push']({'kind':_0x3df0f6(0x190),'value':String(_0xb4f472)});_0x5fc50a[_0x3df0f6(0x186)](_0x3df0f6(0x17d))&&_0x5b2fa3[_0x3df0f6(0x162)]({'kind':_0x3df0f6(0x17d)});const _0x1e4f55=_0x5fc50a['str'](_0x3df0f6(0x16f))['trim']();_0x1e4f55&&_0x5b2fa3[_0x3df0f6(0x162)]({'kind':_0x3df0f6(0x168),'name':_0x1e4f55});const _0xbed968=_0x5fc50a['str'](_0x3df0f6(0x166))[_0x3df0f6(0x15c)]();_0xbed968&&_0x5b2fa3[_0x3df0f6(0x162)]({'kind':'file','path':_0xbed968});if(_0x5b2fa3[_0x3df0f6(0x165)]===0x0)throw CliErrors[_0x3df0f6(0x15f)](_0x3df0f6(0x160),_0x3df0f6(0x177));if(_0x5b2fa3[_0x3df0f6(0x165)]>0x1)throw CliErrors[_0x3df0f6(0x15f)](_0x3df0f6(0x169),_0x3df0f6(0x158));return _0x5b2fa3[0x0];}export async function assertValueSourceReadable(_0x199b78){const _0x4ebcc9=a28_0x36af7e;if(_0x199b78[_0x4ebcc9(0x182)]==='env'&&!(_0x199b78[_0x4ebcc9(0x15b)]in process.env))throw CliErrors[_0x4ebcc9(0x15f)](_0x4ebcc9(0x18f)+_0x199b78['name']);if(_0x199b78[_0x4ebcc9(0x182)]===_0x4ebcc9(0x166))try{await access(_0x199b78[_0x4ebcc9(0x181)]);}catch{throw CliErrors[_0x4ebcc9(0x15f)](_0x4ebcc9(0x17c)+_0x199b78[_0x4ebcc9(0x181)]);}}export async function readAppConfigValue(_0x39b5fa){const _0x1ff401=a28_0x36af7e,_0x11e537=assertSingleValueSource(_0x39b5fa),_0x1de724=[];if(_0x11e537[_0x1ff401(0x182)]===_0x1ff401(0x190))return _0x1de724[_0x1ff401(0x162)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x11e537['value']??'','source':_0x11e537[_0x1ff401(0x182)],'warnings':_0x1de724};if(_0x11e537[_0x1ff401(0x182)]===_0x1ff401(0x17d))return{'value':await readStdin(),'source':_0x11e537['kind'],'warnings':_0x1de724};if(_0x11e537[_0x1ff401(0x182)]===_0x1ff401(0x168)){if(!(_0x11e537[_0x1ff401(0x15b)]in process.env))throw CliErrors[_0x1ff401(0x15f)](_0x1ff401(0x18f)+_0x11e537[_0x1ff401(0x15b)]);return{'value':process.env[_0x11e537.name]??'','source':_0x11e537[_0x1ff401(0x182)],'warnings':_0x1de724};}return{'value':await readFile(_0x11e537[_0x1ff401(0x181)],_0x1ff401(0x164)),'source':_0x11e537[_0x1ff401(0x182)],'warnings':_0x1de724};}function readStdin(){return new Promise((_0x22c46c,_0x1247a3)=>{const _0x54be10=a28_0x2ec9;let _0x17f176='';process[_0x54be10(0x17d)][_0x54be10(0x176)](_0x54be10(0x164)),process[_0x54be10(0x17d)]['on'](_0x54be10(0x16d),_0x4c2a4a=>{_0x17f176+=_0x4c2a4a;}),process[_0x54be10(0x17d)][_0x54be10(0x179)](_0x54be10(0x195),()=>_0x22c46c(_0x17f176)),process[_0x54be10(0x17d)][_0x54be10(0x179)](_0x54be10(0x175),_0x1247a3);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x77a9(){const _0x59cbae=['42944gHPxCf','8152LePwXI','auth','118366etamRd','13352VfHfDg','!\x20Not\x20logged\x20in','read','Login\x20via\x20browser','yes','✓\x20Logged\x20out','boolean','740yfGHAI','4571RzcYXW','login','log','21277665xmsMcc','Clear\x20login\x20session','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','logout','bool','3270150jLpwIF','356157iAWvTJ'];a29_0x77a9=function(){return _0x59cbae;};return a29_0x77a9();}const a29_0x57187e=a29_0x4afe;(function(_0x2e7c53,_0x19f7f4){const _0x5900ab=a29_0x4afe,_0x52eb21=_0x2e7c53();while(!![]){try{const _0x33758a=parseInt(_0x5900ab(0xc0))/0x1+parseInt(_0x5900ab(0xd3))/0x2+parseInt(_0x5900ab(0xd2))/0x3+-parseInt(_0x5900ab(0xbe))/0x4*(parseInt(_0x5900ab(0xc8))/0x5)+-parseInt(_0x5900ab(0xd1))/0x6+-parseInt(_0x5900ab(0xc9))/0x7*(parseInt(_0x5900ab(0xc1))/0x8)+parseInt(_0x5900ab(0xcc))/0x9;if(_0x33758a===_0x19f7f4)break;else _0x52eb21['push'](_0x52eb21['shift']());}catch(_0x4cc8c2){_0x52eb21['push'](_0x52eb21['shift']());}}}(a29_0x77a9,0xa789c));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a29_0x4afe(_0x4fb08b,_0x298285){_0x4fb08b=_0x4fb08b-0xbe;const _0x77a9e1=a29_0x77a9();let _0x4afefb=_0x77a9e1[_0x4fb08b];return _0x4afefb;}export const authDefinitions=[{'service':a29_0x57187e(0xbf),'command':a29_0x57187e(0xca),'description':a29_0x57187e(0xc4),'risk':a29_0x57187e(0xc3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a29_0x57187e(0xc7),'description':a29_0x57187e(0xce),'default':![]}],async 'execute'(_0x217217){const _0xcd9184=a29_0x57187e,{runAuthServer:_0x421588}=await import('../../auth/auth-server-ui.js');return await _0x421588({'autoYes':_0x217217[_0xcd9184(0xd0)](_0xcd9184(0xc5)),'nonInteractive':_0x217217['nonInteractive']}),{'ok':!![]};}},{'service':a29_0x57187e(0xbf),'command':a29_0x57187e(0xcf),'description':a29_0x57187e(0xcd),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x109093){const _0x36e5a7=a29_0x57187e;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x36e5a7(0xcb)](_0x36e5a7(0xc6))):console[_0x36e5a7(0xcb)](_0x36e5a7(0xc2)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x182d0f=a30_0x58d3;(function(_0x4ef205,_0xa864cb){const _0x29c1cc=a30_0x58d3,_0x5918b5=_0x4ef205();while(!![]){try{const _0x5cfcd9=parseInt(_0x29c1cc(0xc3))/0x1*(-parseInt(_0x29c1cc(0x8e))/0x2)+parseInt(_0x29c1cc(0xa9))/0x3+parseInt(_0x29c1cc(0xb1))/0x4+parseInt(_0x29c1cc(0x90))/0x5*(parseInt(_0x29c1cc(0xbe))/0x6)+parseInt(_0x29c1cc(0xbd))/0x7+parseInt(_0x29c1cc(0xc1))/0x8*(parseInt(_0x29c1cc(0xaf))/0x9)+-parseInt(_0x29c1cc(0x85))/0xa*(parseInt(_0x29c1cc(0xd1))/0xb);if(_0x5cfcd9===_0xa864cb)break;else _0x5918b5['push'](_0x5918b5['shift']());}catch(_0x5e1b32){_0x5918b5['push'](_0x5918b5['shift']());}}}(a30_0x2f27,0x74ce7));import{createInterface}from'node:readline';function a30_0x2f27(){const _0x2679b6=['function-node','\x0a\x20*\x20[触发节点]\x20','\x22\x20not\x20found.\x20','find','Operation\x20type\x20(HOOK\x20only)','\x20api\x20pull`\x20to\x20refresh.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\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','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','isInteger','length','appCode','File\x20already\x20exists:\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.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','map','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1120848DyxRcL','after','Operation\x20type\x20\x22','COMMON','\x20function:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','2844WrnhMW','HOOK\x20requires\x20alias/operation/node\x20options.','3489256aTaeIJ','code','apiDir','name','HOOK','No\x20operation\x20types\x20found\x20for\x20dataset\x20','stderr','question','Invalid\x20function\x20name\x20\x22','join','.js','source','1851857hjrQsW','2007066jwewEp','string','Select\x20dataset:','21048gyeqGs','alias','128ZVSYWH','\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',']\x20(','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','validation','datasetCode','Script\x20description','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','nonInteractive','Invalid\x20dataset\x20selection.','utf8','11BFAYFc','\x0a\x20*\x20[脚本名称]\x20','create','str','scriptsRootDir','No\x20api.ts\x20found.\x20Run\x20`','datasetcode','close','operationType','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','parseInt','before','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','15420770xusESY','\x22.\x20','UNKNOWN','Alias\x20\x22','ENDPOINT','includes','tableName','description','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','10248YIIPPl','keys','5QgoUCd','trim','stdin','functionNode','TODO:\x20add\x20script\x20description'];a30_0x2f27=function(){return _0x2679b6;};return a30_0x2f27();}import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':'bff','command':a30_0x182d0f(0xd3),'description':a30_0x182d0f(0xcc),'risk':'read','flags':[{'name':'type','type':a30_0x182d0f(0xbf),'required':!![],'enum':[a30_0x182d0f(0xac),a30_0x182d0f(0x89),a30_0x182d0f(0xb5)],'description':'Script\x20type'},{'name':a30_0x182d0f(0xb4),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0xca)},{'name':a30_0x182d0f(0xc2),'type':a30_0x182d0f(0xbf),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x182d0f(0xd7),'type':'string','description':a30_0x182d0f(0xa5)},{'name':'operation-type','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0x99)},{'name':a30_0x182d0f(0x95),'type':a30_0x182d0f(0xbf),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x182d0f(0x83),'after']}],async 'validate'(_0x235600){const _0x2211c7=a30_0x182d0f,_0x3fe27e=_0x235600[_0x2211c7(0xd4)](_0x2211c7(0xb4));if(!isValidBffFunctionName(_0x3fe27e))throw CliErrors[_0x2211c7(0xc8)](_0x2211c7(0xb9)+_0x3fe27e+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x329bef){const _0x26f627=a30_0x182d0f,_0x239a59=loadBffProjectConfig(_0x329bef['appCode']),_0x1482c4=_0x329bef['str']('type'),_0x38a3e2=_0x329bef['str']('name'),_0x534adf=_0x329bef[_0x26f627(0xd4)](_0x26f627(0x8c))||undefined,_0x3a6c20=_0x1482c4==='HOOK'?await resolveHookOptions(_0x239a59,_0x329bef):undefined,_0x14ee3b=buildFilePath(_0x239a59,_0x1482c4,_0x38a3e2,_0x3a6c20);if(await fileExists(_0x14ee3b))throw CliErrors[_0x26f627(0xc8)](_0x26f627(0xa2)+_0x14ee3b);await mkdir(dirname(_0x14ee3b),{'recursive':!![]});const _0x2fcf0b=generateTemplate(_0x1482c4,_0x38a3e2,_0x329bef[_0x26f627(0xa1)],_0x534adf,_0x3a6c20);await writeFile(_0x14ee3b,_0x2fcf0b,_0x26f627(0xd0));const _0x3d8263={'type':_0x1482c4,'name':_0x38a3e2,'path':_0x14ee3b};if(_0x534adf)_0x3d8263['description']=_0x534adf;if(_0x3a6c20){if(_0x3a6c20[_0x26f627(0xc2)])_0x3d8263[_0x26f627(0xc2)]=_0x3a6c20['alias'];_0x3d8263[_0x26f627(0xc9)]=_0x3a6c20[_0x26f627(0xc9)],_0x3d8263[_0x26f627(0x80)]=_0x3a6c20[_0x26f627(0x80)],_0x3d8263['functionNode']=_0x3a6c20[_0x26f627(0x93)];}return{'ok':!![],'data':_0x3d8263,'message':'Created\x20'+_0x1482c4+_0x26f627(0xad)+_0x38a3e2};}};async function resolveHookOptions(_0x55df3a,_0x1e7d1c){const _0x3a0cc7=a30_0x182d0f,_0x5f2c01=loadAliasMap(_0x1e7d1c[_0x3a0cc7(0xb3)],undefined,resolveApiFilePath(_0x1e7d1c['apiDir'],_0x1e7d1c['appCode'])),_0x52015e=_0x5f2c01[_0x3a0cc7(0xa0)]>0x0;let _0x3b96ee,_0x4766af,_0x32195d;const _0x16928e=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xc2)),_0x2d2342=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xd7));if(_0x16928e){const _0x354d11=resolveAlias(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x16928e,undefined,resolveApiFilePath(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x1e7d1c['appCode']));if(!_0x354d11){const _0x11b541=_0x52015e?'Available\x20aliases:\x20'+_0x5f2c01[_0x3a0cc7(0xa7)](_0x5df8ec=>_0x5df8ec[_0x3a0cc7(0xc2)])[_0x3a0cc7(0xba)](',\x20'):_0x3a0cc7(0xd6)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0x88)+_0x16928e+_0x3a0cc7(0x97)+_0x11b541);}_0x3b96ee=_0x16928e,_0x4766af=_0x354d11;}else{if(_0x2d2342){_0x4766af=_0x2d2342;const _0x2f7f12=_0x5f2c01['find'](_0x4944d0=>_0x4944d0['datasetCode']===_0x2d2342);_0x3b96ee=_0x2f7f12?.[_0x3a0cc7(0xc2)];}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xa8));else{if(_0x52015e){const _0x5c7a8b=_0x5f2c01['map'](_0x379170=>_0x379170['alias']+'\x20('+_0x379170[_0x3a0cc7(0x8b)]+')'),_0x12eec3=await promptSelect(_0x3a0cc7(0xc0),_0x5c7a8b),_0x3ff5f9=_0x5f2c01[_0x12eec3];if(!_0x3ff5f9)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x3b96ee=_0x3ff5f9[_0x3a0cc7(0xc2)],_0x4766af=_0x3ff5f9['datasetCode'];}else{const _0x1b4f85=await listDatasets(_0x1e7d1c[_0x3a0cc7(0xa1)]);if(_0x1b4f85[_0x3a0cc7(0xa0)]===0x0)throw CliErrors[_0x3a0cc7(0xc8)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x3db7bc=_0x1b4f85[_0x3a0cc7(0xa7)](_0x2b5f3e=>_0x2b5f3e['name']+'\x20['+(_0x2b5f3e[_0x3a0cc7(0xbc)]??_0x3a0cc7(0x87))+_0x3a0cc7(0xc5)+_0x2b5f3e['code']+')'),_0x28b6d6=await promptSelect(_0x3a0cc7(0xc0),_0x3db7bc),_0x28e6b1=_0x1b4f85[_0x28b6d6];if(!_0x28e6b1)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x4766af=_0x28e6b1[_0x3a0cc7(0xb2)],_0x3b96ee=undefined;}}}}const _0x1a9ba2=await listDatasets(_0x1e7d1c['appCode']),_0x478e9f=_0x1a9ba2[_0x3a0cc7(0x98)](_0x2d54d3=>_0x2d54d3[_0x3a0cc7(0xb2)]===_0x4766af);if(!_0x478e9f)throw CliErrors[_0x3a0cc7(0xc8)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x4766af+_0x3a0cc7(0x86)+(_0x3b96ee?_0x3a0cc7(0x81)+CLI_BIN_NAME+_0x3a0cc7(0x9a):''));_0x32195d=_0x478e9f['id'];const _0x19998c=_0x3b96ee??_0x4766af,_0x1d5f5a=await listBffDatasetOperations(_0x1e7d1c[_0x3a0cc7(0xa1)],_0x32195d),_0x4cd706=_0x1d5f5a?Object[_0x3a0cc7(0x8f)](_0x1d5f5a):[];if(_0x4cd706[_0x3a0cc7(0xa0)]===0x0)throw CliErrors['validation'](_0x3a0cc7(0xb6)+_0x19998c+'.');let _0xe13f7;const _0x3dc887=_0x1e7d1c[_0x3a0cc7(0xd4)]('operation-type');if(_0x3dc887){if(!_0x4cd706[_0x3a0cc7(0x8a)](_0x3dc887))throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xab)+_0x3dc887+_0x3a0cc7(0xae)+_0x19998c+'.\x20'+('Available:\x20'+_0x4cd706[_0x3a0cc7(0xba)](',\x20')));_0xe13f7=_0x3dc887;}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcb));const _0x43505f=await promptSelect('Select\x20operation\x20type:',_0x4cd706);_0xe13f7=_0x4cd706[_0x43505f]??_0x4cd706[0x0];}let _0x57c9b5=normalizeHookFunctionNode(_0x1e7d1c['str'](_0x3a0cc7(0x95)));if(!_0x57c9b5){if(_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0x95)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x1e7d1c[_0x3a0cc7(0xce)])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xc7));const _0xdcac96=await promptSelect('Select\x20trigger\x20node:',['before',_0x3a0cc7(0xaa)]);_0x57c9b5=[_0x3a0cc7(0x83),_0x3a0cc7(0xaa)][_0xdcac96]??_0x3a0cc7(0x83);}return{'alias':_0x3b96ee,'datasetCode':_0x4766af,'datasetId':_0x32195d,'operationType':_0xe13f7,'functionNode':_0x57c9b5};}function a30_0x58d3(_0x29729e,_0x13a217){_0x29729e=_0x29729e-0x7f;const _0x2f270=a30_0x2f27();let _0x58d33b=_0x2f270[_0x29729e];return _0x58d33b;}async function promptSelect(_0x5654e6,_0x5f060d){const _0x518769=a30_0x182d0f;if(_0x5f060d[_0x518769(0xa0)]===0x1)return 0x0;for(const [_0x52aca3,_0xd9d559]of _0x5f060d['entries']()){process['stderr'][_0x518769(0xc6)]('\x20\x20'+(_0x52aca3+0x1)+'.\x20'+_0xd9d559+'\x0a');}const _0x28d959=createInterface({'input':process[_0x518769(0x92)],'output':process[_0x518769(0xb7)]});while(!![]){const _0x16c70d=await new Promise(_0x27f322=>{const _0x45c0c2=_0x518769;_0x28d959[_0x45c0c2(0xb8)](_0x5654e6+'\x20',_0x27f322);}),_0x4f6b51=Number[_0x518769(0x82)](_0x16c70d[_0x518769(0x91)](),0xa);if(Number[_0x518769(0x9f)](_0x4f6b51)&&_0x4f6b51>=0x1&&_0x4f6b51<=_0x5f060d[_0x518769(0xa0)])return _0x28d959[_0x518769(0x7f)](),_0x4f6b51-0x1;process['stderr'][_0x518769(0xc6)](_0x518769(0x8d)+_0x5f060d[_0x518769(0xa0)]+'.\x0a');}}function buildFilePath(_0x573ae2,_0xff472f,_0x2056e9,_0x3c1ac4){const _0x160312=a30_0x182d0f;if(_0xff472f===_0x160312(0xb5)){if(!_0x3c1ac4)throw CliErrors['validation'](_0x160312(0xb0));const _0x417f8a=_0x3c1ac4[_0x160312(0xc2)]??_0x3c1ac4[_0x160312(0xc9)];return join(_0x573ae2[_0x160312(0xd5)],_0x160312(0xb5),_0x417f8a,_0x3c1ac4[_0x160312(0x80)],_0x3c1ac4[_0x160312(0x93)],_0x2056e9+_0x160312(0xbb));}return join(_0x573ae2[_0x160312(0xd5)],_0xff472f,_0x2056e9+'.js');}export function generateTemplate(_0x3036a5,_0x472179,_0x55fa60,_0x390323,_0x1feb93){const _0x3f3b45=a30_0x182d0f,_0x556f48=_0x390323?.[_0x3f3b45(0x91)]()||_0x3f3b45(0x94);if(_0x3036a5===_0x3f3b45(0xac))return _0x3f3b45(0xa3)+_0x556f48+_0x3f3b45(0xd2)+_0x472179+_0x3f3b45(0x9b)+_0x472179+_0x3f3b45(0xa6)+_0x472179+_0x3f3b45(0x84);if(_0x3036a5===_0x3f3b45(0x89))return _0x3f3b45(0xa4)+_0x556f48+_0x3f3b45(0x9d)+_0x55fa60+'/'+_0x472179+_0x3f3b45(0x9c)+_0x472179+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x1feb93)throw CliErrors[_0x3f3b45(0xc8)](_0x3f3b45(0xcd));return _0x3f3b45(0x9e)+_0x556f48+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x55fa60+'/'+_0x1feb93[_0x3f3b45(0xc9)]+'/'+_0x1feb93[_0x3f3b45(0x80)]+_0x3f3b45(0x96)+_0x1feb93[_0x3f3b45(0x93)]+_0x3f3b45(0xc4)+_0x472179+_0x3f3b45(0x84);}
|
|
1
|
+
const a30_0x10dd0c=a30_0x517f;(function(_0x209b61,_0x43b7fc){const _0x171bc8=a30_0x517f,_0x5bec46=_0x209b61();while(!![]){try{const _0x106a75=-parseInt(_0x171bc8(0x14d))/0x1*(-parseInt(_0x171bc8(0x133))/0x2)+-parseInt(_0x171bc8(0x15e))/0x3+-parseInt(_0x171bc8(0x17b))/0x4*(parseInt(_0x171bc8(0x145))/0x5)+-parseInt(_0x171bc8(0x131))/0x6*(parseInt(_0x171bc8(0x150))/0x7)+-parseInt(_0x171bc8(0x17e))/0x8+parseInt(_0x171bc8(0x183))/0x9*(parseInt(_0x171bc8(0x18c))/0xa)+-parseInt(_0x171bc8(0x182))/0xb*(-parseInt(_0x171bc8(0x14f))/0xc);if(_0x106a75===_0x43b7fc)break;else _0x5bec46['push'](_0x5bec46['shift']());}catch(_0x417af5){_0x5bec46['push'](_0x5bec46['shift']());}}}(a30_0x14a2,0x82e6c));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a30_0x14a2(){const _0x3cb568=['map','stdin','trim','appCode','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','find','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','before','join','operationType','908535qQWuRb','\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','apiDir','str','Select\x20operation\x20type:','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','name','code','TODO:\x20add\x20script\x20description','Dataset\x20not\x20found\x20for\x20code\x20\x22','No\x20datasets\x20found\x20for\x20this\x20app.','nonInteractive','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','Select\x20trigger\x20node:','entries','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','functionNode','length','utf8','Created\x20','scriptsRootDir','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','stderr','Function\x20name\x20(valid\x20JS\x20identifier)','COMMON','Script\x20description','20CXvrwH','close','\x22\x20not\x20found\x20for\x20dataset\x20','137880WMbVSW','function-node','datasetcode','Script\x20type','11cPcbzw','9fAcNra','datasetCode','bff','string','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Alias\x20\x22','Available:\x20','\x20api\x20pull`\x20to\x20refresh.','9003910tEyRwy','after','No\x20api.ts\x20found.\x20Run\x20`','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x0a\x20*\x20[脚本名称]\x20','parseInt','description','write','3102jRLIBf','File\x20already\x20exists:\x20','2OSBHlr','alias','source','\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','\x22\x20not\x20found.\x20','Invalid\x20dataset\x20selection.','UNKNOWN','type','tableName','.js','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','validation','\x0a\x20*\x20[触发节点]\x20','HOOK','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20function:\x20','create','Invalid\x20function\x20name\x20\x22','688200TRwPKT','ENDPOINT','Available\x20aliases:\x20','isInteger','operation-type',']\x20(','keys','Select\x20dataset:','944777PajOTf','read','6721068yjBgOH','11655KQccYu','HOOK\x20requires\x20alias/operation/node\x20options.'];a30_0x14a2=function(){return _0x3cb568;};return a30_0x14a2();}import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a30_0x517f(_0x2c9751,_0x248a63){_0x2c9751=_0x2c9751-0x12d;const _0x14a2f6=a30_0x14a2();let _0x517f90=_0x14a2f6[_0x2c9751];return _0x517f90;}export const bffCreate={'service':a30_0x10dd0c(0x185),'command':a30_0x10dd0c(0x143),'description':a30_0x10dd0c(0x16a),'risk':a30_0x10dd0c(0x14e),'flags':[{'name':a30_0x10dd0c(0x13a),'type':'string','required':!![],'enum':[a30_0x10dd0c(0x179),a30_0x10dd0c(0x146),a30_0x10dd0c(0x140)],'description':a30_0x10dd0c(0x181)},{'name':a30_0x10dd0c(0x164),'type':a30_0x10dd0c(0x186),'required':!![],'description':a30_0x10dd0c(0x178)},{'name':a30_0x10dd0c(0x12f),'type':a30_0x10dd0c(0x186),'description':a30_0x10dd0c(0x17a)},{'name':a30_0x10dd0c(0x134),'type':a30_0x10dd0c(0x186),'description':a30_0x10dd0c(0x187)},{'name':a30_0x10dd0c(0x180),'type':'string','description':a30_0x10dd0c(0x157)},{'name':a30_0x10dd0c(0x149),'type':a30_0x10dd0c(0x186),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a30_0x10dd0c(0x186),'description':a30_0x10dd0c(0x156),'enum':[a30_0x10dd0c(0x15b),a30_0x10dd0c(0x18d)]}],async 'validate'(_0x436a31){const _0x237534=a30_0x10dd0c,_0x472a42=_0x436a31[_0x237534(0x161)]('name');if(!isValidBffFunctionName(_0x472a42))throw CliErrors['validation'](_0x237534(0x144)+_0x472a42+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x32ea86){const _0x52bc32=a30_0x10dd0c,_0x3621d3=loadBffProjectConfig(_0x32ea86[_0x52bc32(0x155)]),_0x1483b0=_0x32ea86['str'](_0x52bc32(0x13a)),_0x190ddf=_0x32ea86[_0x52bc32(0x161)](_0x52bc32(0x164)),_0x2b351e=_0x32ea86[_0x52bc32(0x161)]('description')||undefined,_0x569c00=_0x1483b0===_0x52bc32(0x140)?await resolveHookOptions(_0x3621d3,_0x32ea86):undefined,_0x569030=buildFilePath(_0x3621d3,_0x1483b0,_0x190ddf,_0x569c00);if(await fileExists(_0x569030))throw CliErrors[_0x52bc32(0x13e)](_0x52bc32(0x132)+_0x569030);await mkdir(dirname(_0x569030),{'recursive':!![]});const _0x2fafbf=generateTemplate(_0x1483b0,_0x190ddf,_0x32ea86[_0x52bc32(0x155)],_0x2b351e,_0x569c00);await writeFile(_0x569030,_0x2fafbf,_0x52bc32(0x170));const _0x5ff118={'type':_0x1483b0,'name':_0x190ddf,'path':_0x569030};if(_0x2b351e)_0x5ff118[_0x52bc32(0x12f)]=_0x2b351e;if(_0x569c00){if(_0x569c00[_0x52bc32(0x134)])_0x5ff118[_0x52bc32(0x134)]=_0x569c00[_0x52bc32(0x134)];_0x5ff118[_0x52bc32(0x184)]=_0x569c00[_0x52bc32(0x184)],_0x5ff118[_0x52bc32(0x15d)]=_0x569c00[_0x52bc32(0x15d)],_0x5ff118[_0x52bc32(0x16e)]=_0x569c00[_0x52bc32(0x16e)];}return{'ok':!![],'data':_0x5ff118,'message':_0x52bc32(0x171)+_0x1483b0+_0x52bc32(0x142)+_0x190ddf};}};async function resolveHookOptions(_0x46b012,_0x32ed50){const _0x49e08b=a30_0x10dd0c,_0x2e49b5=loadAliasMap(_0x32ed50[_0x49e08b(0x160)],undefined,resolveApiFilePath(_0x32ed50[_0x49e08b(0x160)],_0x32ed50['appCode'])),_0x3ca610=_0x2e49b5[_0x49e08b(0x16f)]>0x0;let _0x68e597,_0x14a067,_0x42cfb7;const _0x551483=_0x32ed50[_0x49e08b(0x161)](_0x49e08b(0x134)),_0x5a3f0d=_0x32ed50[_0x49e08b(0x161)](_0x49e08b(0x180));if(_0x551483){const _0x203def=resolveAlias(_0x32ed50[_0x49e08b(0x160)],_0x551483,undefined,resolveApiFilePath(_0x32ed50[_0x49e08b(0x160)],_0x32ed50[_0x49e08b(0x155)]));if(!_0x203def){const _0x1acddd=_0x3ca610?_0x49e08b(0x147)+_0x2e49b5[_0x49e08b(0x152)](_0x24a03a=>_0x24a03a[_0x49e08b(0x134)])[_0x49e08b(0x15c)](',\x20'):_0x49e08b(0x18e)+CLI_BIN_NAME+_0x49e08b(0x16d);throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x189)+_0x551483+_0x49e08b(0x137)+_0x1acddd);}_0x68e597=_0x551483,_0x14a067=_0x203def;}else{if(_0x5a3f0d){_0x14a067=_0x5a3f0d;const _0x3a4ee5=_0x2e49b5['find'](_0x4431d3=>_0x4431d3[_0x49e08b(0x184)]===_0x5a3f0d);_0x68e597=_0x3a4ee5?.[_0x49e08b(0x134)];}else{if(_0x32ed50[_0x49e08b(0x169)])throw CliErrors['validation'](_0x49e08b(0x15a));else{if(_0x3ca610){const _0x569f5c=_0x2e49b5[_0x49e08b(0x152)](_0x573f73=>_0x573f73['alias']+'\x20('+_0x573f73[_0x49e08b(0x13b)]+')'),_0x4b7a97=await promptSelect('Select\x20dataset:',_0x569f5c),_0xd85364=_0x2e49b5[_0x4b7a97];if(!_0xd85364)throw CliErrors['validation'](_0x49e08b(0x138));_0x68e597=_0xd85364[_0x49e08b(0x134)],_0x14a067=_0xd85364['datasetCode'];}else{const _0x344aa0=await listDatasets(_0x32ed50[_0x49e08b(0x155)]);if(_0x344aa0[_0x49e08b(0x16f)]===0x0)throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x168));const _0xf37a05=_0x344aa0[_0x49e08b(0x152)](_0x5e22e8=>_0x5e22e8[_0x49e08b(0x164)]+'\x20['+(_0x5e22e8[_0x49e08b(0x135)]??_0x49e08b(0x139))+_0x49e08b(0x14a)+_0x5e22e8[_0x49e08b(0x165)]+')'),_0x26cd39=await promptSelect(_0x49e08b(0x14c),_0xf37a05),_0x240375=_0x344aa0[_0x26cd39];if(!_0x240375)throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x138));_0x14a067=_0x240375[_0x49e08b(0x165)],_0x68e597=undefined;}}}}const _0x35a48d=await listDatasets(_0x32ed50[_0x49e08b(0x155)]),_0x3b1a3d=_0x35a48d[_0x49e08b(0x159)](_0x3ee7f9=>_0x3ee7f9['code']===_0x14a067);if(!_0x3b1a3d)throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x167)+_0x14a067+'\x22.\x20'+(_0x68e597?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x49e08b(0x18b):''));_0x42cfb7=_0x3b1a3d['id'];const _0x50c18a=_0x68e597??_0x14a067,_0x5d04db=await listBffDatasetOperations(_0x32ed50[_0x49e08b(0x155)],_0x42cfb7),_0x517f0f=_0x5d04db?Object[_0x49e08b(0x14b)](_0x5d04db):[];if(_0x517f0f[_0x49e08b(0x16f)]===0x0)throw CliErrors['validation'](_0x49e08b(0x175)+_0x50c18a+'.');let _0x1e3e9a;const _0xb7ee52=_0x32ed50['str']('operation-type');if(_0xb7ee52){if(!_0x517f0f['includes'](_0xb7ee52))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0xb7ee52+_0x49e08b(0x17d)+_0x50c18a+'.\x20'+(_0x49e08b(0x18a)+_0x517f0f['join'](',\x20')));_0x1e3e9a=_0xb7ee52;}else{if(_0x32ed50[_0x49e08b(0x169)])throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x176));const _0x2b4ae9=await promptSelect(_0x49e08b(0x162),_0x517f0f);_0x1e3e9a=_0x517f0f[_0x2b4ae9]??_0x517f0f[0x0];}let _0x26e479=normalizeHookFunctionNode(_0x32ed50[_0x49e08b(0x161)](_0x49e08b(0x17f)));if(!_0x26e479){if(_0x32ed50[_0x49e08b(0x161)]('function-node'))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x32ed50['nonInteractive'])throw CliErrors[_0x49e08b(0x13e)](_0x49e08b(0x163));const _0x109160=await promptSelect(_0x49e08b(0x16b),['before','after']);_0x26e479=[_0x49e08b(0x15b),_0x49e08b(0x18d)][_0x109160]??'before';}return{'alias':_0x68e597,'datasetCode':_0x14a067,'datasetId':_0x42cfb7,'operationType':_0x1e3e9a,'functionNode':_0x26e479};}async function promptSelect(_0x68ef59,_0x14a548){const _0x2f6feb=a30_0x10dd0c;if(_0x14a548[_0x2f6feb(0x16f)]===0x1)return 0x0;for(const [_0xb2199a,_0x3b2c51]of _0x14a548[_0x2f6feb(0x16c)]()){process[_0x2f6feb(0x177)][_0x2f6feb(0x130)]('\x20\x20'+(_0xb2199a+0x1)+'.\x20'+_0x3b2c51+'\x0a');}const _0x2ad8ea=createInterface({'input':process[_0x2f6feb(0x153)],'output':process['stderr']});while(!![]){const _0x217833=await new Promise(_0x332a3a=>{_0x2ad8ea['question'](_0x68ef59+'\x20',_0x332a3a);}),_0x1402a4=Number[_0x2f6feb(0x12e)](_0x217833[_0x2f6feb(0x154)](),0xa);if(Number[_0x2f6feb(0x148)](_0x1402a4)&&_0x1402a4>=0x1&&_0x1402a4<=_0x14a548[_0x2f6feb(0x16f)])return _0x2ad8ea[_0x2f6feb(0x17c)](),_0x1402a4-0x1;process[_0x2f6feb(0x177)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x14a548[_0x2f6feb(0x16f)]+'.\x0a');}}function buildFilePath(_0x4869ff,_0x1dbdcb,_0x1a9158,_0x23ae4d){const _0x35dd37=a30_0x10dd0c;if(_0x1dbdcb==='HOOK'){if(!_0x23ae4d)throw CliErrors[_0x35dd37(0x13e)](_0x35dd37(0x151));const _0x1308d9=_0x23ae4d['alias']??_0x23ae4d['datasetCode'];return join(_0x4869ff['scriptsRootDir'],'HOOK',_0x1308d9,_0x23ae4d[_0x35dd37(0x15d)],_0x23ae4d['functionNode'],_0x1a9158+_0x35dd37(0x13c));}return join(_0x4869ff[_0x35dd37(0x172)],_0x1dbdcb,_0x1a9158+_0x35dd37(0x13c));}export function generateTemplate(_0x1a685f,_0x470c72,_0x5502b5,_0x50c79e,_0x2170ff){const _0xd30adc=a30_0x10dd0c,_0x3afeb6=_0x50c79e?.[_0xd30adc(0x154)]()||_0xd30adc(0x166);if(_0x1a685f===_0xd30adc(0x179))return _0xd30adc(0x141)+_0x3afeb6+_0xd30adc(0x12d)+_0x470c72+_0xd30adc(0x158)+_0x470c72+_0xd30adc(0x173)+_0x470c72+_0xd30adc(0x188);if(_0x1a685f==='ENDPOINT')return _0xd30adc(0x174)+_0x3afeb6+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x5502b5+'/'+_0x470c72+_0xd30adc(0x136)+_0x470c72+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x2170ff)throw CliErrors[_0xd30adc(0x13e)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0xd30adc(0x18f)+_0x3afeb6+_0xd30adc(0x13d)+_0x5502b5+'/'+_0x2170ff[_0xd30adc(0x184)]+'/'+_0x2170ff['operationType']+_0xd30adc(0x13f)+_0x2170ff[_0xd30adc(0x16e)]+_0xd30adc(0x15f)+_0x470c72+_0xd30adc(0x188);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x50be09=a31_0x3cb1;(function(_0xa80a32,_0x5470f5){const _0x740bbd=a31_0x3cb1,_0x264978=_0xa80a32();while(!![]){try{const _0x3bd880=parseInt(_0x740bbd(0x10f))/0x1+parseInt(_0x740bbd(0xeb))/0x2*(parseInt(_0x740bbd(0xfc))/0x3)+-parseInt(_0x740bbd(0x103))/0x4*(parseInt(_0x740bbd(0xf8))/0x5)+-parseInt(_0x740bbd(0xf6))/0x6+-parseInt(_0x740bbd(0x10b))/0x7*(parseInt(_0x740bbd(0x10c))/0x8)+-parseInt(_0x740bbd(0xe5))/0x9*(-parseInt(_0x740bbd(0xf7))/0xa)+parseInt(_0x740bbd(0xf2))/0xb;if(_0x3bd880===_0x5470f5)break;else _0x264978['push'](_0x264978['shift']());}catch(_0x2dd1bc){_0x264978['push'](_0x264978['shift']());}}}(a31_0x30b6,0x82074));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a31_0x30b6(){const _0x440f9f=['filter','8951624YxZcOT','Lock\x20scope\x20for\x20app\x20\x22','appCode','No\x20lock\x20entry\x20found\x20for\x20\x22','499314mrSpNa','10dKlUPN','2303070hlXfkZ','bff','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','validation','15PMHnnL','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockFilePath','Would\x20delete\x20','Function\x20not\x20found:\x20','startsWith','includes','8ZWoSiz','str','trashDir','keys','scriptsRoot','Local\x20delete\x20not\x20settled\x20for\x20','high-risk-write','split','119pkMsDP','403336GZLACc','scriptsRootDir','lastSync','726908hoXWvQ','length','BFF\x20lock\x20file\x20not\x20found.','target','remoteId','Multiple\x20functions\x20match\x20\x22','functions','join','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','replace','apps','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','3181050QOLLWk','projectRoot','parse','toISOString','/api/management/library/scripts/delete','POST','199996hxuwah','\x20(local\x20file\x20moved\x20to\x20trash)','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','string','stringify','delete'];a31_0x30b6=function(){return _0x440f9f;};return a31_0x30b6();}import{CliErrors}from'../../errors.js';function a31_0x3cb1(_0x11fa1e,_0x45eba5){_0x11fa1e=_0x11fa1e-0xdd;const _0x30b694=a31_0x30b6();let _0x3cb1f8=_0x30b694[_0x11fa1e];return _0x3cb1f8;}import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x50be09(0xf9),'command':a31_0x50be09(0xf0),'description':a31_0x50be09(0xe1),'risk':a31_0x50be09(0x109),'flags':[{'name':a31_0x50be09(0x112),'type':a31_0x50be09(0xee),'required':!![],'description':a31_0x50be09(0xe4)}],async 'validate'(_0x430269){const _0x5c32e8=a31_0x50be09,_0x24ad9e=loadBffProjectConfig(_0x430269[_0x5c32e8(0xf4)]),_0x24deea=await readBffLockFile(_0x24ad9e['lockFilePath']);if(!_0x24deea)throw CliErrors[_0x5c32e8(0xfb)](_0x5c32e8(0xed));},async 'dryRun'(_0x3230b9){const _0x8e70f0=a31_0x50be09,_0x5c1657=loadBffProjectConfig(_0x3230b9[_0x8e70f0(0xf4)]),_0x25b3d3=await readBffLockFile(_0x5c1657[_0x8e70f0(0xfe)]);if(!_0x25b3d3)throw CliErrors[_0x8e70f0(0xfb)](_0x8e70f0(0x111));const {appLock:_0x4f5bba}=ensureLockScope(_0x25b3d3,_0x3230b9[_0x8e70f0(0xf4)],_0x5c1657[_0x8e70f0(0x107)],_0x8e70f0(0xf0)),_0x2c0cf9=_0x3230b9[_0x8e70f0(0x104)]('target'),_0x1eb967=Object[_0x8e70f0(0x106)](_0x4f5bba['functions']),_0x3afb70=resolveDeleteTarget(_0x2c0cf9,_0x1eb967),_0x99fe20=_0x4f5bba[_0x8e70f0(0xdf)][_0x3afb70];if(!_0x99fe20)throw CliErrors[_0x8e70f0(0xfb)](_0x8e70f0(0xf5)+_0x3afb70+'\x22.');const _0x5ea881=resolveLocalFilePathFromLockKey(_0x5c1657,_0x3afb70),_0x268c52=relative(_0x5c1657[_0x8e70f0(0xe6)],_0x5ea881),_0x5122dc=join(_0x5c1657['trashDir'],'<timestamp>',_0x268c52);return{'method':_0x8e70f0(0xea),'url':_0x8e70f0(0xe9),'body':{'appCode':_0x3230b9[_0x8e70f0(0xf4)],'target':_0x3afb70,'remoteId':_0x99fe20['remoteId'],'localFilePath':_0x5ea881,'trashedPath':_0x5122dc},'description':_0x8e70f0(0xff)+_0x3afb70+_0x8e70f0(0xfa)};},async 'execute'(_0x3a9c16){const _0x4d6650=a31_0x50be09,_0x39e2a4=loadBffProjectConfig(_0x3a9c16['appCode']),_0x160fa6=await readBffLockFile(_0x39e2a4[_0x4d6650(0xfe)]);if(!_0x160fa6)throw CliErrors[_0x4d6650(0xfb)](_0x4d6650(0x111));const {lockData:_0x109462,appLock:_0x19ccd9}=ensureLockScope(_0x160fa6,_0x3a9c16[_0x4d6650(0xf4)],_0x39e2a4[_0x4d6650(0x107)],_0x4d6650(0xf0)),_0x180fa7=JSON[_0x4d6650(0xe7)](JSON[_0x4d6650(0xef)](_0x109462)),_0x1978d6=_0x180fa7[_0x4d6650(0xe3)][_0x3a9c16['appCode']];if(!_0x1978d6)throw new Error(_0x4d6650(0xf3)+_0x3a9c16[_0x4d6650(0xf4)]+_0x4d6650(0xfd));const _0x14449e=_0x3a9c16[_0x4d6650(0x104)](_0x4d6650(0x112)),_0x4e81f0=Object[_0x4d6650(0x106)](_0x1978d6[_0x4d6650(0xdf)]),_0x38ccb4=resolveDeleteTarget(_0x14449e,_0x4e81f0),_0x10fb7f=_0x1978d6['functions'][_0x38ccb4];if(!_0x10fb7f)throw CliErrors[_0x4d6650(0xfb)](_0x4d6650(0xf5)+_0x38ccb4+'\x22.');await deleteBffScript(_0x10fb7f[_0x4d6650(0xdd)]),delete _0x1978d6[_0x4d6650(0xdf)][_0x38ccb4],_0x1978d6[_0x4d6650(0x10e)]=new Date()[_0x4d6650(0xe8)](),await writeBffLockFile(_0x39e2a4['lockFilePath'],_0x180fa7);const _0x491ba9=resolveLocalFilePathFromLockKey(_0x39e2a4,_0x38ccb4);let _0x28c342;await fileExists(_0x491ba9)&&(_0x28c342=await moveToTrash(_0x39e2a4[_0x4d6650(0xe6)],_0x39e2a4[_0x4d6650(0x105)],_0x491ba9),await cleanupEmptyDirectories(dirname(_0x491ba9),_0x39e2a4[_0x4d6650(0x10d)]));await waitForDeleteSettlement(_0x39e2a4[_0x4d6650(0xfe)],_0x3a9c16[_0x4d6650(0xf4)],_0x38ccb4,_0x491ba9),await sleep(0x96);const _0x2b69d8={'deleted':_0x38ccb4,'remoteId':_0x10fb7f[_0x4d6650(0xdd)]};if(_0x28c342)_0x2b69d8['trashedTo']=_0x28c342;return{'ok':!![],'data':_0x2b69d8,'message':'Deleted\x20'+_0x38ccb4+(_0x28c342?_0x4d6650(0xec):'')};}};function resolveDeleteTarget(_0x2c8964,_0x5d38d5){const _0x3a2f12=a31_0x50be09;if(_0x2c8964[_0x3a2f12(0x102)]('/')){const _0x32014b=_0x5d38d5['find'](_0x30e8e5=>_0x30e8e5===_0x2c8964);if(!_0x32014b)throw CliErrors['validation'](_0x3a2f12(0x100)+_0x2c8964);return _0x32014b;}const _0x4edf34=_0x5d38d5[_0x3a2f12(0xf1)](_0x38ac90=>_0x38ac90[_0x3a2f12(0x10a)]('/')['at'](-0x1)===_0x2c8964);if(_0x4edf34[_0x3a2f12(0x110)]===0x0)throw CliErrors[_0x3a2f12(0xfb)](_0x3a2f12(0x100)+_0x2c8964);if(_0x4edf34[_0x3a2f12(0x110)]>0x1)throw CliErrors[_0x3a2f12(0xfb)](_0x3a2f12(0xde)+_0x2c8964+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x4edf34['map'](_0x5c30e4=>'\x20\x20-\x20'+_0x5c30e4)[_0x3a2f12(0xe0)]('\x0a'));return _0x4edf34[0x0];}async function moveToTrash(_0x46149a,_0x425212,_0x40b582){const _0xc99835=a31_0x50be09,_0x1ece30=new Date()['toISOString']()[_0xc99835(0xe2)](/[:.]/g,'-'),_0xf7f090=relative(_0x46149a,_0x40b582),_0x3638a1=join(_0x425212,_0x1ece30,_0xf7f090);return await mkdir(dirname(_0x3638a1),{'recursive':!![]}),await rename(_0x40b582,_0x3638a1),_0x3638a1;}async function cleanupEmptyDirectories(_0x1882cf,_0x50c3d2){const _0x585e06=a31_0x50be09;let _0x1e3857=resolve(_0x1882cf);const _0x555f09=resolve(_0x50c3d2);while(_0x1e3857[_0x585e06(0x101)](''+_0x555f09+sep)||_0x1e3857===_0x555f09){if(_0x1e3857===_0x555f09)return;try{const _0x274c85=await readdir(_0x1e3857);if(_0x274c85[_0x585e06(0x110)]>0x0)return;await rmdir(_0x1e3857);}catch{return;}_0x1e3857=dirname(_0x1e3857);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x153400,_0x641bee,_0xa1ec58,_0x1f706c){const _0x1ec3be=a31_0x50be09;for(let _0x106ec3=0x0;_0x106ec3<DELETE_SETTLE_RETRY_COUNT;_0x106ec3+=0x1){const _0x1698a7=await readBffLockFile(_0x153400),_0x456395=!!_0x1698a7?.[_0x1ec3be(0xe3)]?.[_0x641bee]?.[_0x1ec3be(0xdf)]?.[_0xa1ec58],_0x514ac2=await fileExists(_0x1f706c);if(!_0x456395&&!_0x514ac2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x1ec3be(0x108)+_0xa1ec58+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0xab3624=a32_0x2d55;function a32_0x2d55(_0x4e0de0,_0x3a5d0f){_0x4e0de0=_0x4e0de0-0x16c;const _0x3f012d=a32_0x3f01();let _0x2d5593=_0x3f012d[_0x4e0de0];return _0x2d5593;}(function(_0xeb24f8,_0x4604df){const _0x3004e5=a32_0x2d55,_0x158715=_0xeb24f8();while(!![]){try{const _0x2fb542=-parseInt(_0x3004e5(0x181))/0x1*(parseInt(_0x3004e5(0x170))/0x2)+parseInt(_0x3004e5(0x179))/0x3*(parseInt(_0x3004e5(0x173))/0x4)+parseInt(_0x3004e5(0x17d))/0x5+-parseInt(_0x3004e5(0x172))/0x6+-parseInt(_0x3004e5(0x17e))/0x7+parseInt(_0x3004e5(0x17a))/0x8*(parseInt(_0x3004e5(0x175))/0x9)+parseInt(_0x3004e5(0x16e))/0xa*(parseInt(_0x3004e5(0x174))/0xb);if(_0x2fb542===_0x4604df)break;else _0x158715['push'](_0x158715['shift']());}catch(_0x28ecf1){_0x158715['push'](_0x158715['shift']());}}}(a32_0x3f01,0xd187a));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0xab3624(0x16d),'command':a32_0xab3624(0x183),'description':a32_0xab3624(0x177),'risk':a32_0xab3624(0x17f),'flags':[{'name':'id','type':a32_0xab3624(0x17b),'required':!![],'description':a32_0xab3624(0x16f)},{'name':a32_0xab3624(0x180),'type':a32_0xab3624(0x16c),'description':a32_0xab3624(0x178)}],async 'execute'(_0x596f7d){const _0x3401bf=a32_0xab3624,_0x47cc0d=await getBffScriptInfo(_0x596f7d['num']('id')),_0x36929a=_0x596f7d[_0x3401bf(0x17c)](_0x3401bf(0x180));if(_0x36929a)return{'ok':!![],'data':_0x47cc0d};return{'ok':!![],'data':{'id':_0x47cc0d['id'],'appCode':_0x47cc0d['appCode'],'scriptType':_0x47cc0d['scriptType'],'description':_0x47cc0d['description']||_0x3401bf(0x176),'createdTime':_0x47cc0d[_0x3401bf(0x182)]??'','updatedTime':_0x47cc0d['updatedTime']??'','scriptContent':_0x47cc0d[_0x3401bf(0x171)]??''}};}};function a32_0x3f01(){const _0x1f8a09=['Get\x20BFF\x20script\x20details\x20by\x20ID','Return\x20full\x20raw\x20script\x20object','1015377cQsWlf','8UtdGwI','number','bool','7749125BrkBtI','7127218lHmbYZ','read','verbose','2188onwOqw','createdTime','detail','boolean','bff','30BpxNLo','Script\x20ID','1126VaPBWJ','scriptContent','8328420Bodhmw','4KstdeF','5109280zWAqjG','10931382DqTaeZ','(none)'];a32_0x3f01=function(){return _0x1f8a09;};return a32_0x3f01();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc02fa9,_0x542676){const _0x4978bf=a33_0x20dd,_0x57e1b4=_0xc02fa9();while(!![]){try{const _0x5ac64a=parseInt(_0x4978bf(0x118))/0x1*(-parseInt(_0x4978bf(0x115))/0x2)+-parseInt(_0x4978bf(0x114))/0x3*(parseInt(_0x4978bf(0x11c))/0x4)+-parseInt(_0x4978bf(0x11e))/0x5*(parseInt(_0x4978bf(0x11b))/0x6)+-parseInt(_0x4978bf(0x11d))/0x7*(parseInt(_0x4978bf(0x119))/0x8)+-parseInt(_0x4978bf(0x11a))/0x9*(parseInt(_0x4978bf(0x113))/0xa)+parseInt(_0x4978bf(0x117))/0xb+parseInt(_0x4978bf(0x112))/0xc*(parseInt(_0x4978bf(0x116))/0xd);if(_0x5ac64a===_0x542676)break;else _0x57e1b4['push'](_0x57e1b4['shift']());}catch(_0x4edde7){_0x57e1b4['push'](_0x57e1b4['shift']());}}}(a33_0x2acf,0x7fb57));function a33_0x2acf(){const _0x5133c8=['456936vwkEZq','30ItwHNm','9QZslPY','516102VEAnsF','1105tdyicd','5412110IPWfTx','2hpeBCk','8lucXeB','1456578uAoktb','131046awMwUB','856844WJKxip','4660621LOaZAd','205AUrzMO'];a33_0x2acf=function(){return _0x5133c8;};return a33_0x2acf();}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a33_0x20dd(_0x723788,_0x364445){_0x723788=_0x723788-0x112;const _0x2acf42=a33_0x2acf();let _0x20dd31=_0x2acf42[_0x723788];return _0x20dd31;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|