@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.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 +1 -1
- 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
|
+
const a19_0x4a24f0=a19_0x5d01;(function(_0x2af49d,_0x412e10){const _0x3ce239=a19_0x5d01,_0x5dd718=_0x2af49d();while(!![]){try{const _0x248e81=parseInt(_0x3ce239(0x111))/0x1*(parseInt(_0x3ce239(0xf8))/0x2)+parseInt(_0x3ce239(0x108))/0x3*(-parseInt(_0x3ce239(0xfb))/0x4)+parseInt(_0x3ce239(0xf5))/0x5+-parseInt(_0x3ce239(0x109))/0x6*(parseInt(_0x3ce239(0xfd))/0x7)+-parseInt(_0x3ce239(0x11f))/0x8+parseInt(_0x3ce239(0x10d))/0x9*(-parseInt(_0x3ce239(0x112))/0xa)+parseInt(_0x3ce239(0x10c))/0xb*(parseInt(_0x3ce239(0x113))/0xc);if(_0x248e81===_0x412e10)break;else _0x5dd718['push'](_0x5dd718['shift']());}catch(_0x37fcba){_0x5dd718['push'](_0x5dd718['shift']());}}}(a19_0x1d08,0x3ac7d));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a19_0x5d01(_0x1e3fe4,_0x378996){_0x1e3fe4=_0x1e3fe4-0xf3;const _0x1d0848=a19_0x1d08();let _0x5d01df=_0x1d0848[_0x1e3fe4];return _0x5d01df;}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(_0x38fa32,_0x3215c2){const _0x78222d=a19_0x5d01,_0x14e649=[],_0xbe5a25=_0x38fa32[_0x78222d(0xf4)]&&typeof _0x38fa32['apps']===_0x78222d(0xfe)?_0x38fa32[_0x78222d(0xf4)]:{},_0x2a8603=_0x38fa32['defaultApp']||undefined;for(const [_0x412e84,_0x334cdb]of Object['entries'](_0xbe5a25)){if(!_0x334cdb||typeof _0x334cdb!=='object'||!_0x334cdb['appcode'])continue;_0x14e649[_0x78222d(0x114)]({'name':_0x412e84,'appcode':_0x334cdb[_0x78222d(0x100)],'named':!![],'definedIn':_0x3215c2,'isDefault':_0x412e84===_0x2a8603,...buildAppProfileListFields(_0x334cdb)});}return _0x14e649;}function a19_0x1d08(){const _0x1be367=['7wPCJtc','object','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','appcode','entries','list','globalConfig','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','isCurrent','projectPath','map','1181841yrIenL','1638996UXRvSe','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','boolean','616xIfdbq','261GYDARA','.\x20Use\x20`','inherit','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','230047xNoUyo','142190PuZZwg','261912ybLHAX','push','mergedCli','\x20config','global','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','optional','validation','remote','length','app','2880512iAolyq','globalPath','projectConfig','merged','apps','1139950uqmcFX','project','bool','2lnwQav','No\x20apps\x20configured','\x20in\x20','4tICEQR','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json'];a19_0x1d08=function(){return _0x1be367;};return a19_0x1d08();}function buildMergedItems(_0xea9b2d,_0x5d821f){const _0x3def7f=a19_0x5d01,{apps:apps={},defaultApp:_0x19effd}=_0xea9b2d,_0x377237=_0x5d821f[_0x3def7f(0x103)][_0x3def7f(0xf4)]&&typeof _0x5d821f['globalConfig']['apps']==='object'?_0x5d821f['globalConfig'][_0x3def7f(0xf4)]:{},_0x53408e=_0x5d821f[_0x3def7f(0x121)][_0x3def7f(0xf4)]&&typeof _0x5d821f['projectConfig'][_0x3def7f(0xf4)]===_0x3def7f(0xfe)?_0x5d821f[_0x3def7f(0x121)][_0x3def7f(0xf4)]:{},_0x43c54b=_0x5d821f['projectConfig'][_0x3def7f(0x10f)]===![],_0x5c0380=Object[_0x3def7f(0x101)](apps),_0x4a0fe2=_0x5c0380[_0x3def7f(0x107)](([_0x40542c,_0x3a198b])=>({'name':_0x40542c,'appcode':_0x3a198b['appcode'],'named':!![],'definedIn':appDefinedIn(_0x40542c,_0x377237,_0x53408e,_0x43c54b),'isDefault':_0x40542c===_0x19effd,...buildAppProfileListFields(_0x3a198b)}));return _0x4a0fe2;}function validateAppListFlags(_0x39e258){const _0x150000=a19_0x5d01;if(!_0x39e258[_0x150000(0xf7)](_0x150000(0x11c)))return;if(!_0x39e258['bool'](_0x150000(0x117))&&!_0x39e258['bool'](_0x150000(0xf6)))return;throw CliErrors[_0x150000(0x11b)](_0x150000(0x119),_0x150000(0x118));}async function execute(_0x3da09e){const _0x5ca41e=a19_0x5d01;validateAppListFlags(_0x3da09e);if(_0x3da09e[_0x5ca41e(0xf7)]('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x3da09e)};const _0x2add98=_0x3da09e[_0x5ca41e(0xf7)](_0x5ca41e(0x117)),_0x48d3d8=_0x3da09e[_0x5ca41e(0xf7)]('project'),_0xc443d1=_0x2add98?'global':_0x48d3d8?_0x5ca41e(0xf6):'merged',{config:_0x4a8092,layers:_0x276da1}=readRawConfigWithLayers(),_0x1258af=resolveDefaultAppSource(_0x276da1),{defaultApp:_0x1a5d41}=_0x4a8092;let _0x26a275,_0xa75efa;switch(_0xc443d1){case _0x5ca41e(0x117):_0x26a275=buildItemsFromLayer(_0x276da1[_0x5ca41e(0x103)],_0x5ca41e(0x117)),_0xa75efa=_0x276da1[_0x5ca41e(0x120)];break;case _0x5ca41e(0xf6):_0x26a275=buildItemsFromLayer(_0x276da1[_0x5ca41e(0x121)],_0x5ca41e(0xf6)),_0xa75efa=_0x276da1[_0x5ca41e(0x106)];break;default:_0x26a275=buildMergedItems(_0x4a8092,_0x276da1);break;}enrichAppListItemsWithMergedSelection(_0x26a275,_0x3da09e[_0x5ca41e(0x115)]);if(_0x26a275[_0x5ca41e(0x11d)]===0x0){const _0x239742=_0xc443d1===_0x5ca41e(0xf3)?'':_0x5ca41e(0xfa)+_0xc443d1+_0x5ca41e(0x116);return{'ok':!![],'data':[],'message':_0x5ca41e(0xf9)+_0x239742+_0x5ca41e(0x10e)+CLI_BIN_NAME+_0x5ca41e(0x10a)};}const _0x1350e8=_0x26a275['find'](_0x4acde9=>_0x4acde9[_0x5ca41e(0x105)]===!![]),_0x4b4280=_0x1a5d41??_0x1350e8?.[_0x5ca41e(0x100)]??null,_0x5f14a5=_0xc443d1==='merged'?{'globalPath':_0x276da1[_0x5ca41e(0x120)]??null,'projectPath':_0x276da1['projectPath']??null,'defaultApp':_0x4b4280,'defaultAppSource':_0x1a5d41!=null?_0x1258af:null}:{'scope':_0xc443d1,'configPath':_0xa75efa??null};return{'ok':!![],'data':{'items':_0x26a275,'meta':_0x5f14a5}};}export const appListDefinition={'service':a19_0x4a24f0(0x11e),'command':a19_0x4a24f0(0x102),'description':a19_0x4a24f0(0xff),'risk':'read','auth':a19_0x4a24f0(0x11a),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x4a24f0(0x11c),'type':a19_0x4a24f0(0x10b),'description':a19_0x4a24f0(0x110),'default':![]},{'name':a19_0x4a24f0(0x117),'type':'boolean','description':a19_0x4a24f0(0x104),'default':![]},{'name':a19_0x4a24f0(0xf6),'type':a19_0x4a24f0(0x10b),'description':a19_0x4a24f0(0xfc),'default':![]}],async 'validate'(_0x2e3863){validateAppListFlags(_0x2e3863);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x32863e=a20_0x410f;function a20_0x410f(_0x54bf26,_0x32cf38){_0x54bf26=_0x54bf26-0x1c1;const _0x1d45d0=a20_0x1d45();let _0x410fc3=_0x1d45d0[_0x54bf26];return _0x410fc3;}(function(_0x559e9d,_0x21a80f){const _0xb0cd9b=a20_0x410f,_0x3adee7=_0x559e9d();while(!![]){try{const _0x305760=-parseInt(_0xb0cd9b(0x1c3))/0x1*(-parseInt(_0xb0cd9b(0x1c1))/0x2)+parseInt(_0xb0cd9b(0x1c8))/0x3*(parseInt(_0xb0cd9b(0x1c9))/0x4)+-parseInt(_0xb0cd9b(0x1cb))/0x5+parseInt(_0xb0cd9b(0x1ce))/0x6+-parseInt(_0xb0cd9b(0x1cd))/0x7+-parseInt(_0xb0cd9b(0x1c7))/0x8*(parseInt(_0xb0cd9b(0x1cc))/0x9)+parseInt(_0xb0cd9b(0x1c5))/0xa;if(_0x305760===_0x21a80f)break;else _0x3adee7['push'](_0x3adee7['shift']());}catch(_0x53a263){_0x3adee7['push'](_0x3adee7['shift']());}}}(a20_0x1d45,0x34dda));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a20_0x1d45(){const _0x4206e9=['5817060wnzUPE','appCode','7128PrNioP','3mfbGHe','1620536Pbvkvb','List\x20application\x20members\x20with\x20their\x20role\x20memberships','2033860FGDHUt','2133GJxepj','2591876bQLizD','738396RXMriP','length','63226QwkNJf','members-list','3KpTJOJ','app'];a20_0x1d45=function(){return _0x4206e9;};return a20_0x1d45();}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x32863e(0x1c4),'command':a20_0x32863e(0x1c2),'description':a20_0x32863e(0x1ca),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x3aa155){const _0x3bd4fe=a20_0x32863e,_0x519b00=projectAppMembers(await listRoleUsers(_0x3aa155['appCode']));return{'ok':!![],'data':{'appCode':_0x3aa155[_0x3bd4fe(0x1c6)],'items':_0x519b00,'totalCount':_0x519b00[_0x3bd4fe(0x1cf)]},'message':'Found\x20'+_0x519b00[_0x3bd4fe(0x1cf)]+'\x20application\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29dcc3,_0x4d0df0){const _0x45514b=a21_0x1b86,_0x4630a3=_0x29dcc3();while(!![]){try{const _0xadcc4f=-parseInt(_0x45514b(0x1e7))/0x1+parseInt(_0x45514b(0x1e1))/0x2+parseInt(_0x45514b(0x1dc))/0x3+-parseInt(_0x45514b(0x1e2))/0x4*(-parseInt(_0x45514b(0x1de))/0x5)+parseInt(_0x45514b(0x1df))/0x6*(parseInt(_0x45514b(0x1e0))/0x7)+parseInt(_0x45514b(0x1e4))/0x8*(parseInt(_0x45514b(0x1db))/0x9)+-parseInt(_0x45514b(0x1dd))/0xa;if(_0xadcc4f===_0x4d0df0)break;else _0x4630a3['push'](_0x4630a3['shift']());}catch(_0x368af5){_0x4630a3['push'](_0x4630a3['shift']());}}}(a21_0x565a,0x8a613));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(_0x4512b9){const _0x4da170=a21_0x1b86,_0x796a37=_0x4512b9[_0x4da170(0x1e8)]||getCookie();if(!_0x796a37)throw CliErrors[_0x4da170(0x1e3)]();return _0x796a37;}export async function listRemoteAppDirectory(_0x502d52){const _0x29bbb6=a21_0x1b86,_0x3d201c=await withActiveCookie(resolveCookie(_0x502d52),()=>listRemoteApps());return{'items':_0x3d201c[_0x29bbb6(0x1da)](_0x2c35b8=>({..._0x2c35b8['id']!=null?{'id':_0x2c35b8['id']}:{},'appCode':_0x2c35b8['appCode'],'appName':_0x2c35b8['appName'],..._0x2c35b8[_0x29bbb6(0x1e6)]!=null?{'appDesc':_0x2c35b8[_0x29bbb6(0x1e6)]}:{}})),'meta':{'source':_0x29bbb6(0x1e5)}};}function a21_0x1b86(_0x3fa15b,_0x56eda4){_0x3fa15b=_0x3fa15b-0x1da;const _0x565a15=a21_0x565a();let _0x1b8632=_0x565a15[_0x3fa15b];return _0x1b8632;}function a21_0x565a(){const _0x57d12c=['66910AdnMRQ','266412IMSDKS','77hSKgQV','1290824YhznGN','44EwdMLe','authRequired','64gokAEP','platform','appDesc','750253PbMcQK','cookie','map','1076796VvvDXG','3221163toDlEU','19948530bvjvKQ'];a21_0x565a=function(){return _0x57d12c;};return a21_0x565a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0xb824(){const _0x56b6c2=['ACTIVE','460YxRiVs','isFinite','inherit','keys','displayName','membershipStatus','userId','16473DEcsJz','hasOwnProperty','values','139706aIpBUA','project','object','appcode','isCurrent','userList','\x20(global)','roleKeys','defaultApp','roles','244004OmDqoF','apps','status','username','roleId','3208544OVvvvH','both','appCode','named','36qdDFhX','call','currentApp','150000evbDOu','length','applyUserList','286384zwTCyc','projectConfig','prototype','get','120ALZyaL','global','trim','175110lrvLIm','push','globalConfig','sort'];a22_0xb824=function(){return _0x56b6c2;};return a22_0xb824();}(function(_0x5e1ead,_0x5af5d0){const _0x30ff97=a22_0x2347,_0x18cc03=_0x5e1ead();while(!![]){try{const _0x576e01=-parseInt(_0x30ff97(0x1d5))/0x1+parseInt(_0x30ff97(0x1f5))/0x2+parseInt(_0x30ff97(0x1e8))/0x3*(parseInt(_0x30ff97(0x1e1))/0x4)+-parseInt(_0x30ff97(0x1d2))/0x5+parseInt(_0x30ff97(0x1d9))/0x6*(parseInt(_0x30ff97(0x1eb))/0x7)+-parseInt(_0x30ff97(0x1fa))/0x8+-parseInt(_0x30ff97(0x1fe))/0x9*(parseInt(_0x30ff97(0x1dc))/0xa);if(_0x576e01===_0x5af5d0)break;else _0x18cc03['push'](_0x18cc03['shift']());}catch(_0xa97bd0){_0x18cc03['push'](_0x18cc03['shift']());}}}(a22_0xb824,0x5924b));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x125bdd){const _0x4f5ea2=_0x125bdd?.['trim']();return _0x4f5ea2?_0x4f5ea2:null;}export function projectAppMembers(_0x1ff80f){const _0xc3c817=a22_0x2347,_0x39b1cc=new Map(),_0xa15e07=[..._0x1ff80f]['sort']((_0x4535fa,_0x16563a)=>_0x4535fa['id']-_0x16563a['id']),_0x5391a3=(_0x5124cc,_0x3761f9,_0x50a42c)=>{const _0x20c566=a22_0x2347;for(const _0x74189b of _0x3761f9){const _0x10ac1c=Number(_0x74189b[_0x20c566(0x1e7)]);if(!Number[_0x20c566(0x1e2)](_0x10ac1c)||_0x10ac1c<=0x0)continue;let _0x3e2c62=_0x39b1cc[_0x20c566(0x1d8)](_0x10ac1c);if(!_0x3e2c62)_0x3e2c62={'userId':_0x10ac1c,'username':nullableText(_0x74189b[_0x20c566(0x1f8)]),'displayName':nullableText(_0x74189b['nickname']),'status':_0x50a42c,'roles':[],'roleKeys':new Set()},_0x39b1cc['set'](_0x10ac1c,_0x3e2c62);else{_0x3e2c62[_0x20c566(0x1f8)]??=nullableText(_0x74189b[_0x20c566(0x1f8)]),_0x3e2c62[_0x20c566(0x1e5)]??=nullableText(_0x74189b['nickname']);if(_0x50a42c===_0x20c566(0x1e0))_0x3e2c62[_0x20c566(0x1f7)]=_0x20c566(0x1e0);}const _0x518c7a=_0x5124cc['id']+':'+_0x50a42c;if(_0x3e2c62[_0x20c566(0x1f2)]['has'](_0x518c7a))continue;_0x3e2c62[_0x20c566(0x1f2)]['add'](_0x518c7a),_0x3e2c62[_0x20c566(0x1f4)][_0x20c566(0x1dd)]({'roleId':_0x5124cc['id'],'roleName':nullableText(_0x5124cc['roleName']),'roleType':nullableText(_0x5124cc['roleType']),'membershipStatus':_0x50a42c});}};for(const _0x16075b of _0xa15e07){_0x5391a3(_0x16075b,_0x16075b[_0xc3c817(0x1f0)]??[],_0xc3c817(0x1e0)),_0x5391a3(_0x16075b,_0x16075b[_0xc3c817(0x1d4)]??[],'PENDING');}return[..._0x39b1cc[_0xc3c817(0x1ea)]()]['map'](_0x482230=>({'userId':_0x482230[_0xc3c817(0x1e7)],'username':_0x482230['username'],'displayName':_0x482230[_0xc3c817(0x1e5)],'status':_0x482230[_0xc3c817(0x1f7)],'roles':_0x482230[_0xc3c817(0x1f4)][_0xc3c817(0x1df)]((_0x41a50e,_0x4e611f)=>_0x41a50e[_0xc3c817(0x1f9)]-_0x4e611f[_0xc3c817(0x1f9)]||(_0x41a50e['membershipStatus']===_0x4e611f[_0xc3c817(0x1e6)]?0x0:_0x41a50e[_0xc3c817(0x1e6)]==='ACTIVE'?-0x1:0x1))}))[_0xc3c817(0x1df)]((_0x22a616,_0x941a66)=>_0x22a616[_0xc3c817(0x1e7)]-_0x941a66[_0xc3c817(0x1e7)]);}export function enrichAppListItemsWithMergedSelection(_0x2ac8cf,_0x5bcdda){const _0x2555a9=a22_0x2347;if(!_0x5bcdda)return;const _0x39695a=_0x5bcdda[_0x2555a9(0x1f6)]&&typeof _0x5bcdda[_0x2555a9(0x1f6)]===_0x2555a9(0x1ed)?_0x5bcdda['apps']:{},_0xc8142f=Object[_0x2555a9(0x1e4)](_0x39695a)['length']>0x0;for(const _0x49bed6 of _0x2ac8cf){_0x49bed6[_0x2555a9(0x1ef)]=![];}const _0x5b8d29=_0x5bcdda[_0x2555a9(0x1fc)]!=null?String(_0x5bcdda[_0x2555a9(0x1fc)])[_0x2555a9(0x1db)]():'';if(_0xc8142f){const _0x2746e7=_0x5bcdda[_0x2555a9(0x200)]??_0x5bcdda[_0x2555a9(0x1f3)];if(_0x2746e7)for(const _0x4184de of _0x2ac8cf){_0x4184de[_0x2555a9(0x1fd)]===!![]&&_0x4184de['name']===_0x2746e7&&(_0x4184de[_0x2555a9(0x1ef)]=!![]);}for(const _0x56e81b of _0x2ac8cf){if(_0x56e81b[_0x2555a9(0x1fd)]!==![])continue;if(_0x5bcdda[_0x2555a9(0x1f3)])continue;_0x5b8d29&&String(_0x56e81b[_0x2555a9(0x1ee)]??'')[_0x2555a9(0x1db)]()===_0x5b8d29&&(_0x56e81b[_0x2555a9(0x1ef)]=!![]);}return;}if(!_0x5b8d29)return;for(const _0x13ba3e of _0x2ac8cf){String(_0x13ba3e[_0x2555a9(0x1ee)]??'')[_0x2555a9(0x1db)]()===_0x5b8d29&&(_0x13ba3e[_0x2555a9(0x1ef)]=!![]);}}export function resolveAppScopeForWrite(_0x32e703,_0x3b991a,_0x3e6837){const _0x1ce488=a22_0x2347;if(_0x3b991a)return'global';const _0x2e6484=_0x3e6837['projectConfig'][_0x1ce488(0x1f6)]&&typeof _0x3e6837[_0x1ce488(0x1d6)][_0x1ce488(0x1f6)]===_0x1ce488(0x1ed)?_0x3e6837[_0x1ce488(0x1d6)][_0x1ce488(0x1f6)]:{},_0x2a2454=_0x3e6837[_0x1ce488(0x1de)]['apps']&&typeof _0x3e6837['globalConfig']['apps']==='object'?_0x3e6837['globalConfig']['apps']:{};if(Object['prototype'][_0x1ce488(0x1e9)][_0x1ce488(0x1ff)](_0x2e6484,_0x32e703))return _0x1ce488(0x1ec);if(Object[_0x1ce488(0x1d7)][_0x1ce488(0x1e9)][_0x1ce488(0x1ff)](_0x2a2454,_0x32e703))return _0x1ce488(0x1da);return _0x1ce488(0x1ec);}function a22_0x2347(_0x260df3,_0x5c0cb7){_0x260df3=_0x260df3-0x1d2;const _0xb82452=a22_0xb824();let _0x234739=_0xb82452[_0x260df3];return _0x234739;}export function appDefinedIn(_0xd084f2,_0x187467,_0x45c520,_0x475efc){const _0x3ca3c9=a22_0x2347;if(_0x475efc)return Object['prototype'][_0x3ca3c9(0x1e9)]['call'](_0x45c520,_0xd084f2)?'project':_0x3ca3c9(0x1da);const _0x28875b=Object[_0x3ca3c9(0x1d7)][_0x3ca3c9(0x1e9)][_0x3ca3c9(0x1ff)](_0x187467,_0xd084f2),_0x387d14=Object[_0x3ca3c9(0x1d7)][_0x3ca3c9(0x1e9)][_0x3ca3c9(0x1ff)](_0x45c520,_0xd084f2);if(_0x28875b&&_0x387d14)return _0x3ca3c9(0x1fb);if(_0x387d14)return _0x3ca3c9(0x1ec);return'global';}export function resolveDefaultAppSource(_0x3527d8){const _0x173f5d=a22_0x2347,_0x179ff3=_0x3527d8[_0x173f5d(0x1d6)]['apps']&&typeof _0x3527d8[_0x173f5d(0x1d6)][_0x173f5d(0x1f6)]==='object'?_0x3527d8[_0x173f5d(0x1d6)][_0x173f5d(0x1f6)]:{};if(_0x173f5d(0x1f3)in _0x3527d8['projectConfig'])return _0x173f5d(0x1ec);if(Object[_0x173f5d(0x1e4)](_0x179ff3)[_0x173f5d(0x1d3)]>0x0)return _0x173f5d(0x1ec);if(_0x3527d8[_0x173f5d(0x1d6)][_0x173f5d(0x1e3)]===![])return null;if(_0x3527d8['globalConfig']['defaultApp'])return _0x173f5d(0x1da);return null;}export function getConfigPath(_0x4f8382={}){const _0x2fc36e=a22_0x2347,_0x5e3665=_0x4f8382[_0x2fc36e(0x1da)]?_0x2fc36e(0x1da):_0x2fc36e(0x1ec);return resolveWriteConfigPath(_0x5e3665);}export function readConfig(_0x17d5cb={}){return readConfigFile(getConfigPath(_0x17d5cb));}export function writeConfig(_0x919baf,_0xced862={}){writeConfigFile(getConfigPath(_0xced862),_0x919baf);}export function scopeLabel(_0x1261fb){const _0x3def2f=a22_0x2347;return _0x1261fb['global']?_0x3def2f(0x1f1):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a23_0x48e937=a23_0x5686;function a23_0x5686(_0x4311f0,_0x4e9d37){_0x4311f0=_0x4311f0-0x180;const _0x298e37=a23_0x298e();let _0x56867a=_0x298e37[_0x4311f0];return _0x56867a;}(function(_0x28d6b2,_0x35f23b){const _0x44ad0b=a23_0x5686,_0x590b1b=_0x28d6b2();while(!![]){try{const _0x5491d6=parseInt(_0x44ad0b(0x18b))/0x1+-parseInt(_0x44ad0b(0x186))/0x2*(parseInt(_0x44ad0b(0x193))/0x3)+parseInt(_0x44ad0b(0x183))/0x4*(-parseInt(_0x44ad0b(0x195))/0x5)+parseInt(_0x44ad0b(0x194))/0x6*(-parseInt(_0x44ad0b(0x189))/0x7)+parseInt(_0x44ad0b(0x18e))/0x8*(parseInt(_0x44ad0b(0x18d))/0x9)+-parseInt(_0x44ad0b(0x18c))/0xa*(-parseInt(_0x44ad0b(0x188))/0xb)+-parseInt(_0x44ad0b(0x197))/0xc*(parseInt(_0x44ad0b(0x185))/0xd);if(_0x5491d6===_0x35f23b)break;else _0x590b1b['push'](_0x590b1b['shift']());}catch(_0x445081){_0x590b1b['push'](_0x590b1b['shift']());}}}(a23_0x298e,0x64ce4));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a23_0x298e(){const _0x5cd4d5=['210280siVQjt','high-risk-write','2521506xGHAmY','26252WZJzdV','get','363coXrbb','45633swWmms','App\x20config\x20key\x20not\x20found:\x20','508135akHbfZ','170960PYTuVW','111168NIQWoW','152XJRlvf','appCode:\x20','appCode','/smartapi/app-config/delete','Delete\x20one\x20runtime\x20app-config\x20key','3HOoOFd','342yyyKXI','30uzXSJw','validation','12FsMbsx','Deleted\x20app\x20config\x20','delete','app-config'];a23_0x298e=function(){return _0x5cd4d5;};return a23_0x298e();}import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x48e937(0x191);export const appConfigDelete={'service':a23_0x48e937(0x182),'command':a23_0x48e937(0x181),'description':a23_0x48e937(0x192),'risk':a23_0x48e937(0x184),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x518421){readKeyArg(_0x518421);},async 'dryRun'(_0x56faf2){const _0x1aa8dd=a23_0x48e937,_0x5165bb=readKeyArg(_0x56faf2),_0xdb0b4d=await mustGetByKey(_0x56faf2[_0x1aa8dd(0x190)],_0x5165bb);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x56faf2['appCode'],'key':_0x5165bb,'before':projectAppConfig(_0xdb0b4d),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x4fde49){const _0x1bc095=a23_0x48e937,_0x1b820e=readKeyArg(_0x4fde49),_0x3fa7db=await mustGetByKey(_0x4fde49[_0x1bc095(0x190)],_0x1b820e);return await withAppConfigApiBoundary('delete',{'appCode':_0x4fde49[_0x1bc095(0x190)],'key':_0x1b820e},()=>deleteAppConfig({'appCode':_0x4fde49[_0x1bc095(0x190)],'id':requireAppConfigId(_0x3fa7db,_0x1b820e,_0x4fde49[_0x1bc095(0x190)])})),{'ok':!![],'data':buildMutationData({'operation':_0x1bc095(0x181),'appCode':_0x4fde49[_0x1bc095(0x190)],'key':_0x1b820e,'before':projectAppConfig(_0x3fa7db),'after':null,'dryRun':![]}),'message':_0x1bc095(0x180)+_0x1b820e};}};async function mustGetByKey(_0x3efd9f,_0x1f3623){const _0x56f61a=a23_0x48e937,_0x313122=await withAppConfigApiBoundary(_0x56f61a(0x187),{'appCode':_0x3efd9f,'key':_0x1f3623},()=>getAppConfigByKey(_0x3efd9f,_0x1f3623));if(!_0x313122)throw CliErrors[_0x56f61a(0x196)](_0x56f61a(0x18a)+_0x1f3623,_0x56f61a(0x18f)+_0x3efd9f);return _0x313122;}function requireAppConfigId(_0x29c70f,_0x215163,_0xfcbf4){if(typeof _0x29c70f['id']==='number'&&Number['isFinite'](_0x29c70f['id'])&&_0x29c70f['id']>0x0)return _0x29c70f['id'];throw CliErrors['apiError']('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x215163+',\x20appCode='+_0xfcbf4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1d2de7=a24_0x171c;function a24_0x1d3f(){const _0x139c3d=['4038700KUnFmz','app-config','bool','appCode:\x20','3195408XBExpq','reveal','2320107vCtvkf','\x20with\x20value\x20redacted','1rTKsPE','appCode','6568338OjpcQS','App\x20config\x20key\x20not\x20found:\x20','get','1293696LpqGBF','600634aHEsXy','validation','246186DMeJsp'];a24_0x1d3f=function(){return _0x139c3d;};return a24_0x1d3f();}(function(_0x25b115,_0x11ced1){const _0x54b447=a24_0x171c,_0x3f51fd=_0x25b115();while(!![]){try{const _0x783d70=parseInt(_0x54b447(0x8d))/0x1*(-parseInt(_0x54b447(0x82))/0x2)+parseInt(_0x54b447(0x8b))/0x3+parseInt(_0x54b447(0x81))/0x4+-parseInt(_0x54b447(0x85))/0x5+-parseInt(_0x54b447(0x84))/0x6+parseInt(_0x54b447(0x8f))/0x7+-parseInt(_0x54b447(0x89))/0x8;if(_0x783d70===_0x11ced1)break;else _0x3f51fd['push'](_0x3f51fd['shift']());}catch(_0x2227b6){_0x3f51fd['push'](_0x3f51fd['shift']());}}}(a24_0x1d3f,0x76cd5));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a24_0x171c(_0xe5256f,_0x18dca1){_0xe5256f=_0xe5256f-0x7f;const _0x1d3fa8=a24_0x1d3f();let _0x171cb5=_0x1d3fa8[_0xe5256f];return _0x171cb5;}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_0x1d2de7(0x86),'command':a24_0x1d2de7(0x80),'description':'Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x267fbf){readKeyArg(_0x267fbf);},async 'execute'(_0x536bb6){const _0x2fbcae=a24_0x1d2de7,_0xb296a3=readKeyArg(_0x536bb6),_0x2f944e=await withAppConfigApiBoundary(_0x2fbcae(0x80),{'appCode':_0x536bb6[_0x2fbcae(0x8e)],'key':_0xb296a3},()=>getAppConfigByKey(_0x536bb6[_0x2fbcae(0x8e)],_0xb296a3));if(!_0x2f944e)throw CliErrors[_0x2fbcae(0x83)](_0x2fbcae(0x7f)+_0xb296a3,_0x2fbcae(0x88)+_0x536bb6[_0x2fbcae(0x8e)]);const _0x121bf7=projectAppConfig(_0x2f944e,{'reveal':_0x536bb6[_0x2fbcae(0x87)]('reveal')});return{'ok':!![],'data':{'config':_0x121bf7},'message':_0x536bb6['bool'](_0x2fbcae(0x8a))?'Loaded\x20app\x20config\x20'+_0xb296a3+'\x20with\x20value\x20revealed':'Loaded\x20app\x20config\x20'+_0xb296a3+_0x2fbcae(0x8c)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13c63d,_0x306e40){const _0xeff34e=a25_0x5b74,_0xc2aa2c=_0x13c63d();while(!![]){try{const _0x68986d=parseInt(_0xeff34e(0x1e6))/0x1*(parseInt(_0xeff34e(0x1dc))/0x2)+parseInt(_0xeff34e(0x1e1))/0x3+-parseInt(_0xeff34e(0x1e0))/0x4*(parseInt(_0xeff34e(0x1e2))/0x5)+-parseInt(_0xeff34e(0x1dd))/0x6*(-parseInt(_0xeff34e(0x1df))/0x7)+parseInt(_0xeff34e(0x1de))/0x8*(parseInt(_0xeff34e(0x1e4))/0x9)+-parseInt(_0xeff34e(0x1e7))/0xa+parseInt(_0xeff34e(0x1e3))/0xb*(parseInt(_0xeff34e(0x1e5))/0xc);if(_0x68986d===_0x306e40)break;else _0xc2aa2c['push'](_0xc2aa2c['shift']());}catch(_0x2b80f3){_0xc2aa2c['push'](_0xc2aa2c['shift']());}}}(a25_0x4b83,0x88824));function a25_0x4b83(){const _0x28f761=['1424256DswKyV','2809068qKNJBj','15KYhJQT','11xlCnAG','4055193QskzFH','10205880gRbFJY','345DMMNGG','9899050JEAmen','1182VQqIMr','1055514QzZwGF','8qIjnNL','7fJJCaS'];a25_0x4b83=function(){return _0x28f761;};return a25_0x4b83();}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';function a25_0x5b74(_0x5b52fb,_0x401c54){_0x5b52fb=_0x5b52fb-0x1dc;const _0x4b83aa=a25_0x4b83();let _0x5b74c8=_0x4b83aa[_0x5b52fb];return _0x5b74c8;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x103fb3=a26_0x3ad6;(function(_0x16d839,_0x3d62f4){const _0x4ea89a=a26_0x3ad6,_0x10a87b=_0x16d839();while(!![]){try{const _0x5b59c8=parseInt(_0x4ea89a(0x1d6))/0x1*(parseInt(_0x4ea89a(0x1e2))/0x2)+-parseInt(_0x4ea89a(0x1db))/0x3+parseInt(_0x4ea89a(0x1d0))/0x4*(-parseInt(_0x4ea89a(0x1d7))/0x5)+-parseInt(_0x4ea89a(0x1df))/0x6*(-parseInt(_0x4ea89a(0x1da))/0x7)+parseInt(_0x4ea89a(0x1d1))/0x8+-parseInt(_0x4ea89a(0x1e0))/0x9*(parseInt(_0x4ea89a(0x1e5))/0xa)+parseInt(_0x4ea89a(0x1e1))/0xb*(parseInt(_0x4ea89a(0x1d2))/0xc);if(_0x5b59c8===_0x3d62f4)break;else _0x10a87b['push'](_0x10a87b['shift']());}catch(_0x19e476){_0x10a87b['push'](_0x10a87b['shift']());}}}(a26_0x1d19,0xd5cf2));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';function a26_0x3ad6(_0x296fa3,_0x4b06f2){_0x296fa3=_0x296fa3-0x1cf;const _0x1d19e9=a26_0x1d19();let _0x3ad638=_0x1d19e9[_0x296fa3];return _0x3ad638;}function a26_0x1d19(){const _0x4373b5=['623odYkpr','5215581lVwPOe','\x20app\x20config(s)','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','read','61518sYEKbI','63bhqOgh','2113078eNxDvQ','16316uqpGky','key','app-config','845820kRaUPr','map','list','trim','string','796476UZktRk','7000032xiKjlg','60xihyqZ','Filter\x20by\x20exact\x20config\x20key','length','Found\x20','105rhOjhC','10IllMLn','str','appCode'];a26_0x1d19=function(){return _0x4373b5;};return a26_0x1d19();}export const appConfigList={'service':a26_0x103fb3(0x1e4),'command':a26_0x103fb3(0x1e7),'description':a26_0x103fb3(0x1dd),'risk':a26_0x103fb3(0x1de),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x103fb3(0x1e3),'type':a26_0x103fb3(0x1cf),'description':a26_0x103fb3(0x1d3)},TAGS_FLAG],async 'validate'(_0x17abb4){const _0x33e603=a26_0x103fb3,_0x472eb9=_0x17abb4[_0x33e603(0x1d8)](_0x33e603(0x1e3))[_0x33e603(0x1e8)]();if(_0x472eb9)validateKey(_0x472eb9);readOptionalTags(_0x17abb4);},async 'execute'(_0x24d4f8){const _0x4c7d07=a26_0x103fb3,_0x4f680b=_0x24d4f8[_0x4c7d07(0x1d8)](_0x4c7d07(0x1e3))[_0x4c7d07(0x1e8)]()||undefined,_0xb89d03=readOptionalTags(_0x24d4f8),_0x40b321=await withAppConfigApiBoundary('list',{'appCode':_0x24d4f8[_0x4c7d07(0x1d9)]},()=>listAppConfigs(_0x24d4f8[_0x4c7d07(0x1d9)],{'key':_0x4f680b,'tags':_0xb89d03})),_0x366f7e=_0x40b321[_0x4c7d07(0x1e6)](_0x56664d=>projectAppConfig(_0x56664d));return{'ok':!![],'data':{'appCode':_0x24d4f8[_0x4c7d07(0x1d9)],'count':_0x366f7e[_0x4c7d07(0x1d4)],'configs':_0x366f7e},'message':_0x4c7d07(0x1d5)+_0x366f7e[_0x4c7d07(0x1d4)]+_0x4c7d07(0x1dc)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x50cd(){const _0x370ab6=['POST','file','App\x20config\x20server\x20id\x20missing\x20for\x20key=','number','apiError','1690hsLATr','Created','Updated','1652400lYwsHk','112RzQxwg','high-risk-write','/smartapi/app-config/update','tags','66hyyNbX','isFinite','get','appCode','app-config','/smartapi/app-config/create','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','create','Read\x20config\x20value\x20from\x20file','5704mViCmv','133580OInOSb','117944vhufGA','3239256FZGALh','41061mKcFpg','set','506628NnhORw','string','update','341dPocuN',',\x20appCode='];a27_0x50cd=function(){return _0x370ab6;};return a27_0x50cd();}const a27_0x2f0593=a27_0x55d4;(function(_0xc0977b,_0x2b73e4){const _0x4a7389=a27_0x55d4,_0x5a24f9=_0xc0977b();while(!![]){try{const _0x4ef267=-parseInt(_0x4a7389(0x100))/0x1+parseInt(_0x4a7389(0x112))/0x2*(parseInt(_0x4a7389(0xfe))/0x3)+parseInt(_0x4a7389(0xfa))/0x4*(-parseInt(_0x4a7389(0x10a))/0x5)+parseInt(_0x4a7389(0xfd))/0x6+parseInt(_0x4a7389(0x10e))/0x7*(-parseInt(_0x4a7389(0xfc))/0x8)+parseInt(_0x4a7389(0x10d))/0x9+parseInt(_0x4a7389(0xfb))/0xa*(parseInt(_0x4a7389(0x103))/0xb);if(_0x4ef267===_0x2b73e4)break;else _0x5a24f9['push'](_0x5a24f9['shift']());}catch(_0xb3e4b0){_0x5a24f9['push'](_0x5a24f9['shift']());}}}(a27_0x50cd,0x590c5));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a27_0x55d4(_0x321b75,_0x53bfa5){_0x321b75=_0x321b75-0xf5;const _0x50cdf2=a27_0x50cd();let _0x55d4b5=_0x50cdf2[_0x321b75];return _0x55d4b5;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a27_0x2f0593(0xf6),UPDATE_PATH=a27_0x2f0593(0x110);export const appConfigSet={'service':a27_0x2f0593(0xf5),'command':a27_0x2f0593(0xff),'description':a27_0x2f0593(0xf7),'risk':a27_0x2f0593(0x10f),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x2f0593(0x106),'type':a27_0x2f0593(0x101),'description':a27_0x2f0593(0xf9)}],async 'validate'(_0x29df65){readKeyArg(_0x29df65),readOptionalTags(_0x29df65),assertSingleValueSource(_0x29df65);},async 'dryRun'(_0x31314b){const _0x10cfa6=a27_0x2f0593,_0x49629d=readKeyArg(_0x31314b),_0x217188=readOptionalTags(_0x31314b),_0x457d1b=assertSingleValueSource(_0x31314b);await assertValueSourceReadable(_0x457d1b);const _0x374ee9=await withAppConfigApiBoundary('get',{'appCode':_0x31314b['appCode'],'key':_0x49629d},()=>getAppConfigByKey(_0x31314b['appCode'],_0x49629d)),_0x564a96=_0x374ee9?'update':_0x10cfa6(0xf8),_0x2561f3=_0x374ee9?projectAppConfig(_0x374ee9):null,_0x5591b1=plannedAppConfig({'appCode':_0x31314b[_0x10cfa6(0x115)],'key':_0x49629d,'tags':_0x217188??_0x374ee9?.[_0x10cfa6(0x111)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x564a96,'appCode':_0x31314b[_0x10cfa6(0x115)],'key':_0x49629d,'before':_0x2561f3,'after':_0x5591b1,'dryRun':!![]}),{'method':_0x10cfa6(0x105),'url':_0x564a96==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x47b5d9){const _0x2a5838=a27_0x2f0593,_0x593ff2=readKeyArg(_0x47b5d9),_0x8777c1=readOptionalTags(_0x47b5d9),_0x412692=await withAppConfigApiBoundary(_0x2a5838(0x114),{'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2},()=>getAppConfigByKey(_0x47b5d9['appCode'],_0x593ff2)),_0x57aed6=_0x412692?projectAppConfig(_0x412692):null,_0x86a835=_0x412692?_0x2a5838(0x102):_0x2a5838(0xf8),{value:_0xee5878,warnings:_0x149e92}=await readAppConfigValue(_0x47b5d9),_0x978a58={'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2,'value':_0xee5878,'tags':_0x8777c1??_0x412692?.['tags']??undefined};await withAppConfigApiBoundary(_0x86a835,{'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2},async()=>{const _0x518fbe=_0x2a5838;_0x412692?await updateAppConfig({..._0x978a58,'id':requireAppConfigId(_0x412692,_0x593ff2,_0x47b5d9[_0x518fbe(0x115)])}):await createAppConfig(_0x978a58);});const _0x957331=await withAppConfigApiBoundary(_0x2a5838(0x114),{'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2},()=>getAppConfigByKey(_0x47b5d9[_0x2a5838(0x115)],_0x593ff2)),_0x58e399=_0x957331?projectAppConfig(_0x957331):plannedAppConfig({'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2,'tags':_0x978a58['tags'],'hasValue':_0xee5878!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x86a835,'appCode':_0x47b5d9[_0x2a5838(0x115)],'key':_0x593ff2,'before':_0x57aed6,'after':_0x58e399,'dryRun':![],'warnings':_0x149e92}),'message':(_0x86a835===_0x2a5838(0x102)?_0x2a5838(0x10c):_0x2a5838(0x10b))+'\x20app\x20config\x20'+_0x593ff2};}};function requireAppConfigId(_0x40ce2a,_0x337b27,_0x3027bd){const _0x4bccdf=a27_0x2f0593;if(typeof _0x40ce2a['id']===_0x4bccdf(0x108)&&Number[_0x4bccdf(0x113)](_0x40ce2a['id'])&&_0x40ce2a['id']>0x0)return _0x40ce2a['id'];throw CliErrors[_0x4bccdf(0x109)](_0x4bccdf(0x107)+_0x337b27+_0x4bccdf(0x104)+_0x3027bd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xa62cae=a28_0x26e5;(function(_0x669d29,_0x4170f2){const _0x6f325d=a28_0x26e5,_0x215428=_0x669d29();while(!![]){try{const _0x59222e=-parseInt(_0x6f325d(0x90))/0x1*(parseInt(_0x6f325d(0xad))/0x2)+parseInt(_0x6f325d(0x82))/0x3+parseInt(_0x6f325d(0x89))/0x4+-parseInt(_0x6f325d(0x9d))/0x5+-parseInt(_0x6f325d(0x7b))/0x6*(-parseInt(_0x6f325d(0x80))/0x7)+parseInt(_0x6f325d(0x8e))/0x8*(-parseInt(_0x6f325d(0x79))/0x9)+-parseInt(_0x6f325d(0x96))/0xa*(-parseInt(_0x6f325d(0xab))/0xb);if(_0x59222e===_0x4170f2)break;else _0x215428['push'](_0x215428['shift']());}catch(_0x3085c8){_0x215428['push'](_0x215428['shift']());}}}(a28_0x391f,0xc84c4));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':'value','description':a28_0xa62cae(0xa9),'required':![]};export const TAGS_FLAG={'name':a28_0xa62cae(0xb9),'type':a28_0xa62cae(0x84),'description':a28_0xa62cae(0x7e)};export const STDIN_FLAG={'name':a28_0xa62cae(0xb6),'type':'boolean','description':'Read\x20config\x20value\x20from\x20stdin','default':![]};function a28_0x26e5(_0x115581,_0x10828b){_0x115581=_0x115581-0x78;const _0x391f24=a28_0x391f();let _0x26e54b=_0x391f24[_0x115581];return _0x26e54b;}export const FROM_ENV_FLAG={'name':a28_0xa62cae(0x8f),'type':a28_0xa62cae(0x84),'description':a28_0xa62cae(0xa0)};export const REVEAL_FLAG={'name':a28_0xa62cae(0x93),'type':a28_0xa62cae(0x94),'description':a28_0xa62cae(0xa3),'default':![]};export function readKeyArg(_0x1fc840){const _0x1a6b53=a28_0xa62cae,_0x50a83a=_0x1fc840[_0x1a6b53(0x97)][0x0]?.[_0x1a6b53(0xac)]()??'';return validateKey(_0x50a83a),_0x50a83a;}export function readOptionalTags(_0x5261e5){const _0x2c5c31=a28_0xa62cae,_0x5a2f5a=_0x5261e5['str'](_0x2c5c31(0xb9))[_0x2c5c31(0xac)]();if(!_0x5a2f5a)return undefined;if(_0x5a2f5a['length']>0x20)throw CliErrors[_0x2c5c31(0xb1)](_0x2c5c31(0x81));return _0x5a2f5a;}export function validateKey(_0x3c7c39){const _0x3625a4=a28_0xa62cae;if(!_0x3c7c39)throw CliErrors[_0x3625a4(0xb1)](_0x3625a4(0xa4));if(_0x3c7c39[_0x3625a4(0xba)]>0x100)throw CliErrors['validation'](_0x3625a4(0x7c));}export function projectAppConfig(_0x4696a4,_0x24b4a8){const _0x37d0e2=a28_0xa62cae,_0xefc470=_0x4696a4[_0x37d0e2(0x78)]!==undefined&&_0x4696a4[_0x37d0e2(0x78)]!==null&&_0x4696a4[_0x37d0e2(0x78)]!=='',_0x3b4750={'appCode':_0x4696a4[_0x37d0e2(0xa5)],'key':_0x4696a4[_0x37d0e2(0xae)],'tags':_0x4696a4[_0x37d0e2(0xb9)]??undefined,'hasValue':_0xefc470,'valueRedacted':_0xefc470&&!_0x24b4a8?.[_0x37d0e2(0x93)],'gmtCreate':_0x4696a4[_0x37d0e2(0x7d)],'gmtModified':_0x4696a4[_0x37d0e2(0x98)]};return _0x24b4a8?.['reveal']&&(_0x3b4750[_0x37d0e2(0x78)]=_0x4696a4['value']??'',_0x3b4750[_0x37d0e2(0x9a)]=![]),_0x3b4750;}function a28_0x391f(){const _0x341ed2=['Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','apiError','584463rmHlSQ','trim','364kxKtZE','key','Missing\x20app-config\x20value\x20source.','warnings','validation','Value\x20file\x20is\x20not\x20readable:\x20','after','file','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','stdin','dryRun','hasValue','tags','length','value','45TMRbPF','once','19758pAgCdH','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','gmtCreate','Config\x20tags\x20for\x20filtering/display\x20metadata','push','504sXStTh','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','1051278sLskbV','data','string','before','value\x20is\x20redacted','setEncoding','error','4660576ksTgTx','App\x20config\x20value\x20source\x20is\x20ambiguous.','key:\x20','slice','defineProperties','1970008dZGwrK','from-env','3714KdOEBg','bool','\x20app\x20config.','reveal','boolean','method','410fHbHRG','args','gmtModified','Environment\x20variable\x20is\x20not\x20set:\x20','valueRedacted','kind','env','6017480PusFyA','operation','Failed\x20to\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','path','name','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','Missing\x20app-config\x20key.','appCode','flag','argument','end'];a28_0x391f=function(){return _0x341ed2;};return a28_0x391f();}export function plannedAppConfig(_0x5e350d){const _0x11fbf8=a28_0xa62cae,_0x1eb320=_0x5e350d[_0x11fbf8(0xb8)]??!![];return{'appCode':_0x5e350d[_0x11fbf8(0xa5)],'key':_0x5e350d[_0x11fbf8(0xae)],'tags':_0x5e350d['tags']??undefined,'hasValue':_0x1eb320,'valueRedacted':_0x1eb320};}export function buildMutationData(_0x30c8f3){const _0x5ce2e7=a28_0xa62cae;return{'operation':_0x30c8f3[_0x5ce2e7(0x9e)],'selector':{'appCode':_0x30c8f3[_0x5ce2e7(0xa5)],'key':_0x30c8f3[_0x5ce2e7(0xae)]},'before':_0x30c8f3[_0x5ce2e7(0x85)],'after':_0x30c8f3[_0x5ce2e7(0xb3)],'dryRun':_0x30c8f3[_0x5ce2e7(0xb7)],'warnings':_0x30c8f3[_0x5ce2e7(0xb0)]??[]};}export async function withAppConfigApiBoundary(_0x3ae50d,_0x2148e5,_0x4f270d){const _0x5e63a2=a28_0xa62cae;try{return await _0x4f270d();}catch{const _0x13b393=['appCode:\x20'+_0x2148e5[_0x5e63a2(0xa5)]];if(_0x2148e5['key'])_0x13b393[_0x5e63a2(0x7f)](_0x5e63a2(0x8b)+_0x2148e5[_0x5e63a2(0xae)]);_0x13b393['push'](_0x5e63a2(0x86));throw CliErrors[_0x5e63a2(0xaa)](_0x5e63a2(0x9f)+_0x3ae50d+_0x5e63a2(0x92),_0x13b393['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x56e37a,_0x1e87b6){const _0xd81c5a=a28_0xa62cae;return Object[_0xd81c5a(0x8d)](_0x56e37a,{'method':{'value':_0x1e87b6[_0xd81c5a(0x95)],'enumerable':![]},'url':{'value':_0x1e87b6['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x12a329){const _0x3035ed=a28_0xa62cae,_0x1a4296=[];_0x12a329[_0x3035ed(0x97)][_0x3035ed(0xba)]>0x1&&_0x1a4296[_0x3035ed(0x7f)]({'kind':_0x3035ed(0xa7),'value':_0x12a329[_0x3035ed(0x97)][_0x3035ed(0x8c)](0x1)['join']('\x20')});const _0x4bf595=_0x12a329[_0x3035ed(0xa6)](_0x3035ed(0x78));_0x4bf595!==undefined&&_0x4bf595!==null&&_0x1a4296[_0x3035ed(0x7f)]({'kind':_0x3035ed(0xa7),'value':String(_0x4bf595)});_0x12a329[_0x3035ed(0x91)]('stdin')&&_0x1a4296[_0x3035ed(0x7f)]({'kind':_0x3035ed(0xb6)});const _0x1c38dd=_0x12a329['str']('from-env')[_0x3035ed(0xac)]();_0x1c38dd&&_0x1a4296[_0x3035ed(0x7f)]({'kind':_0x3035ed(0x9c),'name':_0x1c38dd});const _0x4eec2d=_0x12a329['str']('file')[_0x3035ed(0xac)]();_0x4eec2d&&_0x1a4296[_0x3035ed(0x7f)]({'kind':_0x3035ed(0xb4),'path':_0x4eec2d});if(_0x1a4296[_0x3035ed(0xba)]===0x0)throw CliErrors['validation'](_0x3035ed(0xaf),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x1a4296[_0x3035ed(0xba)]>0x1)throw CliErrors[_0x3035ed(0xb1)](_0x3035ed(0x8a),_0x3035ed(0xb5));return _0x1a4296[0x0];}export async function assertValueSourceReadable(_0x241ed6){const _0x3394c8=a28_0xa62cae;if(_0x241ed6['kind']===_0x3394c8(0x9c)&&!(_0x241ed6[_0x3394c8(0xa2)]in process.env))throw CliErrors[_0x3394c8(0xb1)](_0x3394c8(0x99)+_0x241ed6[_0x3394c8(0xa2)]);if(_0x241ed6[_0x3394c8(0x9b)]===_0x3394c8(0xb4))try{await access(_0x241ed6['path']);}catch{throw CliErrors[_0x3394c8(0xb1)](_0x3394c8(0xb2)+_0x241ed6[_0x3394c8(0xa1)]);}}export async function readAppConfigValue(_0x41b97b){const _0x198c5e=a28_0xa62cae,_0x1edcf1=assertSingleValueSource(_0x41b97b),_0x2eee2a=[];if(_0x1edcf1[_0x198c5e(0x9b)]===_0x198c5e(0xa7))return _0x2eee2a[_0x198c5e(0x7f)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x1edcf1['value']??'','source':_0x1edcf1['kind'],'warnings':_0x2eee2a};if(_0x1edcf1[_0x198c5e(0x9b)]==='stdin')return{'value':await readStdin(),'source':_0x1edcf1['kind'],'warnings':_0x2eee2a};if(_0x1edcf1[_0x198c5e(0x9b)]===_0x198c5e(0x9c)){if(!(_0x1edcf1[_0x198c5e(0xa2)]in process.env))throw CliErrors[_0x198c5e(0xb1)](_0x198c5e(0x99)+_0x1edcf1[_0x198c5e(0xa2)]);return{'value':process.env[_0x1edcf1.name]??'','source':_0x1edcf1[_0x198c5e(0x9b)],'warnings':_0x2eee2a};}return{'value':await readFile(_0x1edcf1[_0x198c5e(0xa1)],'utf8'),'source':_0x1edcf1[_0x198c5e(0x9b)],'warnings':_0x2eee2a};}function readStdin(){return new Promise((_0x3844bc,_0x3b83b5)=>{const _0x11feaf=a28_0x26e5;let _0x57f1e5='';process[_0x11feaf(0xb6)][_0x11feaf(0x87)]('utf8'),process[_0x11feaf(0xb6)]['on'](_0x11feaf(0x83),_0x327680=>{_0x57f1e5+=_0x327680;}),process['stdin'][_0x11feaf(0x7a)](_0x11feaf(0xa8),()=>_0x3844bc(_0x57f1e5)),process[_0x11feaf(0xb6)]['once'](_0x11feaf(0x88),_0x3b83b5);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0xff7f(){const _0x1be581=['read','Login\x20via\x20browser','✓\x20Logged\x20out','32572renoGh','676694yHHNtH','5557041ZwahjU','4490832EPQUQu','nonInteractive','123bsHtmH','write','boolean','1OPMWLN','3270223TWgVfu','56OQWiGU','6PUGXjO','logout','log','login','auth','yes','10ymexEC','57127cDyYWi','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','1274725pqUVAs'];a29_0xff7f=function(){return _0x1be581;};return a29_0xff7f();}const a29_0x3b036a=a29_0x24db;(function(_0x7df287,_0x1a0c03){const _0x11c8f4=a29_0x24db,_0x403061=_0x7df287();while(!![]){try{const _0x539421=-parseInt(_0x11c8f4(0x1f2))/0x1*(-parseInt(_0x11c8f4(0x1eb))/0x2)+parseInt(_0x11c8f4(0x1ef))/0x3*(-parseInt(_0x11c8f4(0x1ea))/0x4)+parseInt(_0x11c8f4(0x1e6))/0x5*(-parseInt(_0x11c8f4(0x1f5))/0x6)+-parseInt(_0x11c8f4(0x1e4))/0x7*(parseInt(_0x11c8f4(0x1f4))/0x8)+parseInt(_0x11c8f4(0x1ec))/0x9+-parseInt(_0x11c8f4(0x1e3))/0xa*(parseInt(_0x11c8f4(0x1f3))/0xb)+parseInt(_0x11c8f4(0x1ed))/0xc;if(_0x539421===_0x1a0c03)break;else _0x403061['push'](_0x403061['shift']());}catch(_0x5f1068){_0x403061['push'](_0x403061['shift']());}}}(a29_0xff7f,0x5e6f4));import{unlinkSync,existsSync}from'node:fs';function a29_0x24db(_0x13dac0,_0x1a8acf){_0x13dac0=_0x13dac0-0x1e3;const _0xff7ff9=a29_0xff7f();let _0x24dbcc=_0xff7ff9[_0x13dac0];return _0x24dbcc;}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0x3b036a(0x1f9),'command':a29_0x3b036a(0x1f8),'description':a29_0x3b036a(0x1e8),'risk':a29_0x3b036a(0x1e7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x3b036a(0x1fa),'type':a29_0x3b036a(0x1f1),'description':a29_0x3b036a(0x1e5),'default':![]}],async 'execute'(_0x1d3795){const _0x1dda60=a29_0x3b036a,{runAuthServer:_0x1a8dfa}=await import('../../auth/auth-server-ui.js');return await _0x1a8dfa({'autoYes':_0x1d3795['bool']('yes'),'nonInteractive':_0x1d3795[_0x1dda60(0x1ee)]}),{'ok':!![]};}},{'service':a29_0x3b036a(0x1f9),'command':a29_0x3b036a(0x1f6),'description':'Clear\x20login\x20session','risk':a29_0x3b036a(0x1f0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x32791b){const _0x17530d=a29_0x3b036a;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x17530d(0x1f7)](_0x17530d(0x1e9))):console[_0x17530d(0x1f7)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x1fbc69=a30_0x8070;(function(_0x2023c3,_0xecaa1f){const _0x231fc7=a30_0x8070,_0x5d901e=_0x2023c3();while(!![]){try{const _0x14b496=-parseInt(_0x231fc7(0xc1))/0x1+-parseInt(_0x231fc7(0x89))/0x2*(-parseInt(_0x231fc7(0xa3))/0x3)+parseInt(_0x231fc7(0xa7))/0x4+parseInt(_0x231fc7(0x72))/0x5*(parseInt(_0x231fc7(0xb5))/0x6)+-parseInt(_0x231fc7(0xc8))/0x7+-parseInt(_0x231fc7(0xc9))/0x8*(-parseInt(_0x231fc7(0x85))/0x9)+parseInt(_0x231fc7(0xbe))/0xa*(-parseInt(_0x231fc7(0xa1))/0xb);if(_0x14b496===_0xecaa1f)break;else _0x5d901e['push'](_0x5d901e['shift']());}catch(_0x1bec1d){_0x5d901e['push'](_0x5d901e['shift']());}}}(a30_0x3974,0xb703d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a30_0x3974(){const _0x4bf50e=['Select\x20dataset:','create','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','length','trim','File\x20already\x20exists:\x20','before','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x20function:\x20','datasetcode','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','4169uSFlMf','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','156JZXaNq','operationType','appCode','parseInt','3621200GiOZAv','.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','description','source','HOOK','write','str','TODO:\x20add\x20script\x20description','ENDPOINT','nonInteractive','No\x20datasets\x20found\x20for\x20this\x20app.','Invalid\x20dataset\x20selection.','Select\x20trigger\x20node:','find','74808axFxXV','Alias\x20\x22','\x22\x20not\x20found.\x20','alias','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','UNKNOWN','apiDir','code','78290XDyaMZ','No\x20operation\x20types\x20found\x20for\x20dataset\x20','bff','185752YNeIWC','string','type','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','validation','1219596KyEFVB','5661360ouLekI','\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','\x22.\x20','name',']\x20(','470SBbvHv','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','function-node','question','\x22\x20not\x20found\x20for\x20dataset\x20','isInteger','operation-type','HOOK\x20requires\x20alias/operation/node\x20options.','join','datasetCode','Script\x20description','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Script\x20type','Available\x20aliases:\x20','utf8','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','.js','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','18dlXjll','\x0a\x20*\x20[触发节点]\x20','\x20api\x20pull`\x20to\x20refresh.','Available:\x20','22468ImHyVi','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','functionNode','stderr','map','Operation\x20type\x20\x22','Invalid\x20function\x20name\x20\x22','Created\x20','Trigger\x20node\x20(HOOK\x20only)','read','after','Operation\x20type\x20(HOOK\x20only)'];a30_0x3974=function(){return _0x4bf50e;};return a30_0x3974();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a30_0x8070(_0x5c80dc,_0x3ce30b){_0x5c80dc=_0x5c80dc-0x71;const _0x39746b=a30_0x3974();let _0x80707f=_0x39746b[_0x5c80dc];return _0x80707f;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x1fbc69(0xc0),'command':a30_0x1fbc69(0x96),'description':a30_0x1fbc69(0xc4),'risk':a30_0x1fbc69(0x92),'flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON',a30_0x1fbc69(0xaf),'HOOK'],'description':a30_0x1fbc69(0x7f)},{'name':a30_0x1fbc69(0xcc),'type':a30_0x1fbc69(0xc2),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x1fbc69(0xa9),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x7d)},{'name':a30_0x1fbc69(0xb8),'type':a30_0x1fbc69(0xc2),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x1fbc69(0x9f),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x73)},{'name':a30_0x1fbc69(0x79),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x94)},{'name':a30_0x1fbc69(0x75),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x91),'enum':[a30_0x1fbc69(0x9c),'after']}],async 'validate'(_0x56408c){const _0x1eadca=a30_0x1fbc69,_0x34d052=_0x56408c[_0x1eadca(0xad)](_0x1eadca(0xcc));if(!isValidBffFunctionName(_0x34d052))throw CliErrors[_0x1eadca(0xc7)](_0x1eadca(0x8f)+_0x34d052+_0x1eadca(0x9d));},async 'execute'(_0x294699){const _0x387e4b=a30_0x1fbc69,_0x179062=loadBffProjectConfig(_0x294699[_0x387e4b(0xa5)]),_0x441226=_0x294699[_0x387e4b(0xad)](_0x387e4b(0xc3)),_0x333d0d=_0x294699[_0x387e4b(0xad)](_0x387e4b(0xcc)),_0x21a018=_0x294699['str'](_0x387e4b(0xa9))||undefined,_0x2167ed=_0x441226===_0x387e4b(0xab)?await resolveHookOptions(_0x179062,_0x294699):undefined,_0x513681=buildFilePath(_0x179062,_0x441226,_0x333d0d,_0x2167ed);if(await fileExists(_0x513681))throw CliErrors[_0x387e4b(0xc7)](_0x387e4b(0x9b)+_0x513681);await mkdir(dirname(_0x513681),{'recursive':!![]});const _0x44c6ed=generateTemplate(_0x441226,_0x333d0d,_0x294699[_0x387e4b(0xa5)],_0x21a018,_0x2167ed);await writeFile(_0x513681,_0x44c6ed,_0x387e4b(0x81));const _0x4e9f44={'type':_0x441226,'name':_0x333d0d,'path':_0x513681};if(_0x21a018)_0x4e9f44[_0x387e4b(0xa9)]=_0x21a018;if(_0x2167ed){if(_0x2167ed[_0x387e4b(0xb8)])_0x4e9f44[_0x387e4b(0xb8)]=_0x2167ed['alias'];_0x4e9f44[_0x387e4b(0x7c)]=_0x2167ed['datasetCode'],_0x4e9f44[_0x387e4b(0xa4)]=_0x2167ed[_0x387e4b(0xa4)],_0x4e9f44[_0x387e4b(0x8b)]=_0x2167ed[_0x387e4b(0x8b)];}return{'ok':!![],'data':_0x4e9f44,'message':_0x387e4b(0x90)+_0x441226+_0x387e4b(0x9e)+_0x333d0d};}};async function resolveHookOptions(_0x319e3b,_0x55adb6){const _0xfd5a0f=a30_0x1fbc69,_0x4c398e=loadAliasMap(_0x55adb6[_0xfd5a0f(0xbc)],undefined,resolveApiFilePath(_0x55adb6[_0xfd5a0f(0xbc)],_0x55adb6['appCode'])),_0xad0479=_0x4c398e['length']>0x0;let _0x37a94e,_0xd146c,_0x1e14da;const _0x36c368=_0x55adb6['str'](_0xfd5a0f(0xb8)),_0x3a0078=_0x55adb6[_0xfd5a0f(0xad)]('datasetcode');if(_0x36c368){const _0x2b2b01=resolveAlias(_0x55adb6[_0xfd5a0f(0xbc)],_0x36c368,undefined,resolveApiFilePath(_0x55adb6[_0xfd5a0f(0xbc)],_0x55adb6[_0xfd5a0f(0xa5)]));if(!_0x2b2b01){const _0x5ad3b9=_0xad0479?_0xfd5a0f(0x80)+_0x4c398e[_0xfd5a0f(0x8d)](_0x3534a3=>_0x3534a3[_0xfd5a0f(0xb8)])[_0xfd5a0f(0x7b)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0xfd5a0f(0x98);throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xb6)+_0x36c368+_0xfd5a0f(0xb7)+_0x5ad3b9);}_0x37a94e=_0x36c368,_0xd146c=_0x2b2b01;}else{if(_0x3a0078){_0xd146c=_0x3a0078;const _0xe0a62d=_0x4c398e['find'](_0x38071b=>_0x38071b['datasetCode']===_0x3a0078);_0x37a94e=_0xe0a62d?.[_0xfd5a0f(0xb8)];}else{if(_0x55adb6[_0xfd5a0f(0xb0)])throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x8a));else{if(_0xad0479){const _0x193c98=_0x4c398e[_0xfd5a0f(0x8d)](_0x1a044e=>_0x1a044e[_0xfd5a0f(0xb8)]+'\x20('+_0x1a044e['tableName']+')'),_0x545aaf=await promptSelect(_0xfd5a0f(0x95),_0x193c98),_0x44a3cf=_0x4c398e[_0x545aaf];if(!_0x44a3cf)throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xb2));_0x37a94e=_0x44a3cf['alias'],_0xd146c=_0x44a3cf[_0xfd5a0f(0x7c)];}else{const _0x499dd8=await listDatasets(_0x55adb6[_0xfd5a0f(0xa5)]);if(_0x499dd8[_0xfd5a0f(0x99)]===0x0)throw CliErrors['validation'](_0xfd5a0f(0xb1));const _0x404d04=_0x499dd8[_0xfd5a0f(0x8d)](_0x55c182=>_0x55c182[_0xfd5a0f(0xcc)]+'\x20['+(_0x55c182[_0xfd5a0f(0xaa)]??_0xfd5a0f(0xbb))+_0xfd5a0f(0x71)+_0x55c182[_0xfd5a0f(0xbd)]+')'),_0x43d794=await promptSelect('Select\x20dataset:',_0x404d04),_0x1f74e5=_0x499dd8[_0x43d794];if(!_0x1f74e5)throw CliErrors[_0xfd5a0f(0xc7)]('Invalid\x20dataset\x20selection.');_0xd146c=_0x1f74e5['code'],_0x37a94e=undefined;}}}}const _0x4f4b22=await listDatasets(_0x55adb6[_0xfd5a0f(0xa5)]),_0x3751eb=_0x4f4b22[_0xfd5a0f(0xb4)](_0x17fa37=>_0x17fa37[_0xfd5a0f(0xbd)]===_0xd146c);if(!_0x3751eb)throw CliErrors[_0xfd5a0f(0xc7)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0xd146c+_0xfd5a0f(0xcb)+(_0x37a94e?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0xfd5a0f(0x87):''));_0x1e14da=_0x3751eb['id'];const _0x575cc5=_0x37a94e??_0xd146c,_0x4fc620=await listBffDatasetOperations(_0x55adb6[_0xfd5a0f(0xa5)],_0x1e14da),_0x5e2126=_0x4fc620?Object['keys'](_0x4fc620):[];if(_0x5e2126[_0xfd5a0f(0x99)]===0x0)throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xbf)+_0x575cc5+'.');let _0x5bb3e3;const _0x2d4bfa=_0x55adb6[_0xfd5a0f(0xad)](_0xfd5a0f(0x79));if(_0x2d4bfa){if(!_0x5e2126['includes'](_0x2d4bfa))throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x8e)+_0x2d4bfa+_0xfd5a0f(0x77)+_0x575cc5+'.\x20'+(_0xfd5a0f(0x88)+_0x5e2126[_0xfd5a0f(0x7b)](',\x20')));_0x5bb3e3=_0x2d4bfa;}else{if(_0x55adb6['nonInteractive'])throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x97));const _0x258380=await promptSelect('Select\x20operation\x20type:',_0x5e2126);_0x5bb3e3=_0x5e2126[_0x258380]??_0x5e2126[0x0];}let _0x39932f=normalizeHookFunctionNode(_0x55adb6[_0xfd5a0f(0xad)](_0xfd5a0f(0x75)));if(!_0x39932f){if(_0x55adb6['str'](_0xfd5a0f(0x75)))throw CliErrors['validation'](_0xfd5a0f(0xba));if(_0x55adb6[_0xfd5a0f(0xb0)])throw CliErrors[_0xfd5a0f(0xc7)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x36cb80=await promptSelect(_0xfd5a0f(0xb3),['before','after']);_0x39932f=[_0xfd5a0f(0x9c),_0xfd5a0f(0x93)][_0x36cb80]??_0xfd5a0f(0x9c);}return{'alias':_0x37a94e,'datasetCode':_0xd146c,'datasetId':_0x1e14da,'operationType':_0x5bb3e3,'functionNode':_0x39932f};}async function promptSelect(_0x22eac5,_0x365ab6){const _0x4a108e=a30_0x1fbc69;if(_0x365ab6[_0x4a108e(0x99)]===0x1)return 0x0;for(const [_0x2c4752,_0x37ae50]of _0x365ab6['entries']()){process[_0x4a108e(0x8c)][_0x4a108e(0xac)]('\x20\x20'+(_0x2c4752+0x1)+'.\x20'+_0x37ae50+'\x0a');}const _0xeba671=createInterface({'input':process['stdin'],'output':process[_0x4a108e(0x8c)]});while(!![]){const _0x45650b=await new Promise(_0x120dbc=>{const _0x55a97d=_0x4a108e;_0xeba671[_0x55a97d(0x76)](_0x22eac5+'\x20',_0x120dbc);}),_0x1c6b26=Number[_0x4a108e(0xa6)](_0x45650b[_0x4a108e(0x9a)](),0xa);if(Number[_0x4a108e(0x78)](_0x1c6b26)&&_0x1c6b26>=0x1&&_0x1c6b26<=_0x365ab6[_0x4a108e(0x99)])return _0xeba671['close'](),_0x1c6b26-0x1;process[_0x4a108e(0x8c)][_0x4a108e(0xac)](_0x4a108e(0xa2)+_0x365ab6[_0x4a108e(0x99)]+'.\x0a');}}function buildFilePath(_0x44e155,_0x29ff3e,_0x4c36cc,_0x2fd425){const _0x30dedf=a30_0x1fbc69;if(_0x29ff3e==='HOOK'){if(!_0x2fd425)throw CliErrors['validation'](_0x30dedf(0x7a));const _0x30c407=_0x2fd425[_0x30dedf(0xb8)]??_0x2fd425[_0x30dedf(0x7c)];return join(_0x44e155['scriptsRootDir'],_0x30dedf(0xab),_0x30c407,_0x2fd425[_0x30dedf(0xa4)],_0x2fd425[_0x30dedf(0x8b)],_0x4c36cc+_0x30dedf(0x83));}return join(_0x44e155['scriptsRootDir'],_0x29ff3e,_0x4c36cc+_0x30dedf(0x83));}export function generateTemplate(_0x8409f1,_0x179d4a,_0x2166b5,_0x3be789,_0x1b063b){const _0x4774a2=a30_0x1fbc69,_0x1b5ae7=_0x3be789?.[_0x4774a2(0x9a)]()||_0x4774a2(0xae);if(_0x8409f1==='COMMON')return _0x4774a2(0xa0)+_0x1b5ae7+'\x0a\x20*\x20[脚本名称]\x20'+_0x179d4a+_0x4774a2(0x7e)+_0x179d4a+_0x4774a2(0xa8)+_0x179d4a+_0x4774a2(0x82);if(_0x8409f1==='ENDPOINT')return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x1b5ae7+_0x4774a2(0xc6)+_0x2166b5+'/'+_0x179d4a+_0x4774a2(0xb9)+_0x179d4a+_0x4774a2(0x82);if(!_0x1b063b)throw CliErrors[_0x4774a2(0xc7)](_0x4774a2(0x84));return _0x4774a2(0x74)+_0x1b5ae7+_0x4774a2(0xc5)+_0x2166b5+'/'+_0x1b063b[_0x4774a2(0x7c)]+'/'+_0x1b063b[_0x4774a2(0xa4)]+_0x4774a2(0x86)+_0x1b063b['functionNode']+_0x4774a2(0xca)+_0x179d4a+_0x4774a2(0x82);}
|
|
1
|
+
const a30_0x153172=a30_0xdc98;function a30_0xdc98(_0xadef04,_0x4dda56){_0xadef04=_0xadef04-0x1c5;const _0x418384=a30_0x4183();let _0xdc9897=_0x418384[_0xadef04];return _0xdc9897;}function a30_0x4183(){const _0x1e6a93=['operation-type','2622410jEFWSW','keys','question','\x20function:\x20','HOOK','Operation\x20type\x20\x22','\x0a\x20*\x20[脚本名称]\x20','alias','entries','bff','\x22\x20not\x20found.\x20','operationType','datasetcode','12JYgMyW','Created\x20','tableName','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','type','760972GOrtAH','COMMON','str','Script\x20description','trim','validation','Select\x20trigger\x20node:','Select\x20dataset:','source','Operation\x20type\x20(HOOK\x20only)','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','utf8','description','Invalid\x20function\x20name\x20\x22','string','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','appCode','find','\x20api\x20pull`\x20to\x20refresh.','map','functionNode','stderr','Function\x20name\x20(valid\x20JS\x20identifier)','join','before','Available:\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22\x20not\x20found\x20for\x20dataset\x20','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20',']\x20(','HOOK\x20requires\x20alias/operation/node\x20options.','length','Dataset\x20not\x20found\x20for\x20code\x20\x22','function-node','read','apiDir','\x22.\x20','nonInteractive','\x0a\x20*\x20[触发节点]\x20','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','6HnFlda','write','code','datasetCode','Alias\x20\x22','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','8651qsvAFi','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','983612rTcuQU','UNKNOWN','6iffCOt','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','isInteger','58cvNRBK','96420hCsGbt','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','scriptsRootDir','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','name','352zLoshR','includes','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Trigger\x20node\x20(HOOK\x20only)','TODO:\x20add\x20script\x20description','Invalid\x20dataset\x20selection.','1064TOpRki','.js','create','37062TOvLks','11817611YbgZhU'];a30_0x4183=function(){return _0x1e6a93;};return a30_0x4183();}(function(_0x4360c0,_0x434107){const _0x305d26=a30_0xdc98,_0x3d442a=_0x4360c0();while(!![]){try{const _0x19dd57=parseInt(_0x305d26(0x220))/0x1*(-parseInt(_0x305d26(0x1cb))/0x2)+-parseInt(_0x305d26(0x218))/0x3*(parseInt(_0x305d26(0x1ef))/0x4)+-parseInt(_0x305d26(0x1dd))/0x5*(-parseInt(_0x305d26(0x1c8))/0x6)+-parseInt(_0x305d26(0x1c6))/0x7+-parseInt(_0x305d26(0x1d7))/0x8*(parseInt(_0x305d26(0x1da))/0x9)+-parseInt(_0x305d26(0x1cc))/0xa*(-parseInt(_0x305d26(0x1d1))/0xb)+-parseInt(_0x305d26(0x1ea))/0xc*(-parseInt(_0x305d26(0x1db))/0xd);if(_0x19dd57===_0x434107)break;else _0x3d442a['push'](_0x3d442a['shift']());}catch(_0x3e896e){_0x3d442a['push'](_0x3d442a['shift']());}}}(a30_0x4183,0x67262));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x153172(0x1e6),'command':a30_0x153172(0x1d9),'description':a30_0x153172(0x1f9),'risk':a30_0x153172(0x212),'flags':[{'name':'type','type':a30_0x153172(0x1fd),'required':!![],'enum':[a30_0x153172(0x1f0),'ENDPOINT',a30_0x153172(0x1e1)],'description':'Script\x20type'},{'name':a30_0x153172(0x1d0),'type':'string','required':!![],'description':a30_0x153172(0x206)},{'name':a30_0x153172(0x1fb),'type':a30_0x153172(0x1fd),'description':a30_0x153172(0x1f2)},{'name':a30_0x153172(0x1e4),'type':a30_0x153172(0x1fd),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x153172(0x1e9),'type':a30_0x153172(0x1fd),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x153172(0x1dc),'type':a30_0x153172(0x1fd),'description':a30_0x153172(0x1f8)},{'name':a30_0x153172(0x211),'type':a30_0x153172(0x1fd),'description':a30_0x153172(0x1d4),'enum':[a30_0x153172(0x208),'after']}],async 'validate'(_0x3ce014){const _0x129a7a=a30_0x153172,_0x7ec43b=_0x3ce014[_0x129a7a(0x1f1)](_0x129a7a(0x1d0));if(!isValidBffFunctionName(_0x7ec43b))throw CliErrors[_0x129a7a(0x1f4)](_0x129a7a(0x1fc)+_0x7ec43b+_0x129a7a(0x21f));},async 'execute'(_0x5beecc){const _0x2044d6=a30_0x153172,_0x4a2f98=loadBffProjectConfig(_0x5beecc[_0x2044d6(0x200)]),_0x29e28b=_0x5beecc[_0x2044d6(0x1f1)](_0x2044d6(0x1ee)),_0x195f42=_0x5beecc[_0x2044d6(0x1f1)](_0x2044d6(0x1d0)),_0x3213e9=_0x5beecc[_0x2044d6(0x1f1)]('description')||undefined,_0x55b8f1=_0x29e28b==='HOOK'?await resolveHookOptions(_0x4a2f98,_0x5beecc):undefined,_0xa7927d=buildFilePath(_0x4a2f98,_0x29e28b,_0x195f42,_0x55b8f1);if(await fileExists(_0xa7927d))throw CliErrors[_0x2044d6(0x1f4)]('File\x20already\x20exists:\x20'+_0xa7927d);await mkdir(dirname(_0xa7927d),{'recursive':!![]});const _0x19b0ba=generateTemplate(_0x29e28b,_0x195f42,_0x5beecc[_0x2044d6(0x200)],_0x3213e9,_0x55b8f1);await writeFile(_0xa7927d,_0x19b0ba,_0x2044d6(0x1fa));const _0x2da724={'type':_0x29e28b,'name':_0x195f42,'path':_0xa7927d};if(_0x3213e9)_0x2da724[_0x2044d6(0x1fb)]=_0x3213e9;if(_0x55b8f1){if(_0x55b8f1[_0x2044d6(0x1e4)])_0x2da724[_0x2044d6(0x1e4)]=_0x55b8f1['alias'];_0x2da724[_0x2044d6(0x21b)]=_0x55b8f1[_0x2044d6(0x21b)],_0x2da724[_0x2044d6(0x1e8)]=_0x55b8f1[_0x2044d6(0x1e8)],_0x2da724[_0x2044d6(0x204)]=_0x55b8f1[_0x2044d6(0x204)];}return{'ok':!![],'data':_0x2da724,'message':_0x2044d6(0x1eb)+_0x29e28b+_0x2044d6(0x1e0)+_0x195f42};}};async function resolveHookOptions(_0xe4d8a1,_0x526983){const _0x512415=a30_0x153172,_0xfe614a=loadAliasMap(_0x526983[_0x512415(0x213)],undefined,resolveApiFilePath(_0x526983[_0x512415(0x213)],_0x526983['appCode'])),_0x4f1ec0=_0xfe614a['length']>0x0;let _0x5c089b,_0x1bdac5,_0x3b7fd3;const _0x3ee2af=_0x526983[_0x512415(0x1f1)](_0x512415(0x1e4)),_0x3b5b78=_0x526983[_0x512415(0x1f1)](_0x512415(0x1e9));if(_0x3ee2af){const _0x45dbc8=resolveAlias(_0x526983[_0x512415(0x213)],_0x3ee2af,undefined,resolveApiFilePath(_0x526983[_0x512415(0x213)],_0x526983[_0x512415(0x200)]));if(!_0x45dbc8){const _0x2d53ef=_0x4f1ec0?'Available\x20aliases:\x20'+_0xfe614a[_0x512415(0x203)](_0x8079c3=>_0x8079c3[_0x512415(0x1e4)])[_0x512415(0x207)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x512415(0x1f4)](_0x512415(0x21c)+_0x3ee2af+_0x512415(0x1e7)+_0x2d53ef);}_0x5c089b=_0x3ee2af,_0x1bdac5=_0x45dbc8;}else{if(_0x3b5b78){_0x1bdac5=_0x3b5b78;const _0x53ade9=_0xfe614a['find'](_0x4cfe2d=>_0x4cfe2d[_0x512415(0x21b)]===_0x3b5b78);_0x5c089b=_0x53ade9?.[_0x512415(0x1e4)];}else{if(_0x526983[_0x512415(0x215)])throw CliErrors['validation'](_0x512415(0x1ed));else{if(_0x4f1ec0){const _0x218a51=_0xfe614a[_0x512415(0x203)](_0x561f7c=>_0x561f7c[_0x512415(0x1e4)]+'\x20('+_0x561f7c[_0x512415(0x1ec)]+')'),_0x35dedc=await promptSelect('Select\x20dataset:',_0x218a51),_0x3ac7ac=_0xfe614a[_0x35dedc];if(!_0x3ac7ac)throw CliErrors[_0x512415(0x1f4)]('Invalid\x20dataset\x20selection.');_0x5c089b=_0x3ac7ac[_0x512415(0x1e4)],_0x1bdac5=_0x3ac7ac[_0x512415(0x21b)];}else{const _0xdeaaec=await listDatasets(_0x526983[_0x512415(0x200)]);if(_0xdeaaec[_0x512415(0x20f)]===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x1c45c1=_0xdeaaec[_0x512415(0x203)](_0x4abd15=>_0x4abd15[_0x512415(0x1d0)]+'\x20['+(_0x4abd15[_0x512415(0x1f7)]??_0x512415(0x1c7))+_0x512415(0x20d)+_0x4abd15['code']+')'),_0x35d6b1=await promptSelect(_0x512415(0x1f6),_0x1c45c1),_0x183c71=_0xdeaaec[_0x35d6b1];if(!_0x183c71)throw CliErrors[_0x512415(0x1f4)](_0x512415(0x1d6));_0x1bdac5=_0x183c71['code'],_0x5c089b=undefined;}}}}const _0x449cd7=await listDatasets(_0x526983[_0x512415(0x200)]),_0xae2c65=_0x449cd7[_0x512415(0x201)](_0x2b58d3=>_0x2b58d3[_0x512415(0x21a)]===_0x1bdac5);if(!_0xae2c65)throw CliErrors['validation'](_0x512415(0x210)+_0x1bdac5+_0x512415(0x214)+(_0x5c089b?_0x512415(0x21e)+CLI_BIN_NAME+_0x512415(0x202):''));_0x3b7fd3=_0xae2c65['id'];const _0x1d3cb0=_0x5c089b??_0x1bdac5,_0x5a1010=await listBffDatasetOperations(_0x526983[_0x512415(0x200)],_0x3b7fd3),_0x1a8318=_0x5a1010?Object[_0x512415(0x1de)](_0x5a1010):[];if(_0x1a8318['length']===0x0)throw CliErrors[_0x512415(0x1f4)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x1d3cb0+'.');let _0x490807;const _0x1fb5a6=_0x526983[_0x512415(0x1f1)](_0x512415(0x1dc));if(_0x1fb5a6){if(!_0x1a8318[_0x512415(0x1d2)](_0x1fb5a6))throw CliErrors['validation'](_0x512415(0x1e2)+_0x1fb5a6+_0x512415(0x20b)+_0x1d3cb0+'.\x20'+(_0x512415(0x209)+_0x1a8318[_0x512415(0x207)](',\x20')));_0x490807=_0x1fb5a6;}else{if(_0x526983[_0x512415(0x215)])throw CliErrors[_0x512415(0x1f4)](_0x512415(0x217));const _0x21d199=await promptSelect('Select\x20operation\x20type:',_0x1a8318);_0x490807=_0x1a8318[_0x21d199]??_0x1a8318[0x0];}let _0x1f71c5=normalizeHookFunctionNode(_0x526983[_0x512415(0x1f1)](_0x512415(0x211)));if(!_0x1f71c5){if(_0x526983['str'](_0x512415(0x211)))throw CliErrors[_0x512415(0x1f4)](_0x512415(0x1d3));if(_0x526983[_0x512415(0x215)])throw CliErrors[_0x512415(0x1f4)](_0x512415(0x21d));const _0x4b37c0=await promptSelect(_0x512415(0x1f5),[_0x512415(0x208),'after']);_0x1f71c5=['before','after'][_0x4b37c0]??'before';}return{'alias':_0x5c089b,'datasetCode':_0x1bdac5,'datasetId':_0x3b7fd3,'operationType':_0x490807,'functionNode':_0x1f71c5};}async function promptSelect(_0x23f93a,_0x5de25d){const _0x53e0ae=a30_0x153172;if(_0x5de25d['length']===0x1)return 0x0;for(const [_0x16226f,_0x437f54]of _0x5de25d[_0x53e0ae(0x1e5)]()){process[_0x53e0ae(0x205)][_0x53e0ae(0x219)]('\x20\x20'+(_0x16226f+0x1)+'.\x20'+_0x437f54+'\x0a');}const _0x12b3a9=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0xb29623=await new Promise(_0x41a8ff=>{const _0x25eb30=_0x53e0ae;_0x12b3a9[_0x25eb30(0x1df)](_0x23f93a+'\x20',_0x41a8ff);}),_0x567109=Number['parseInt'](_0xb29623[_0x53e0ae(0x1f3)](),0xa);if(Number[_0x53e0ae(0x1ca)](_0x567109)&&_0x567109>=0x1&&_0x567109<=_0x5de25d[_0x53e0ae(0x20f)])return _0x12b3a9['close'](),_0x567109-0x1;process[_0x53e0ae(0x205)][_0x53e0ae(0x219)](_0x53e0ae(0x1c9)+_0x5de25d[_0x53e0ae(0x20f)]+'.\x0a');}}function buildFilePath(_0x2553af,_0xa3049e,_0x2d2469,_0x5b9f53){const _0x28a2e9=a30_0x153172;if(_0xa3049e===_0x28a2e9(0x1e1)){if(!_0x5b9f53)throw CliErrors['validation'](_0x28a2e9(0x20e));const _0x44634f=_0x5b9f53[_0x28a2e9(0x1e4)]??_0x5b9f53['datasetCode'];return join(_0x2553af[_0x28a2e9(0x1ce)],_0x28a2e9(0x1e1),_0x44634f,_0x5b9f53[_0x28a2e9(0x1e8)],_0x5b9f53[_0x28a2e9(0x204)],_0x2d2469+_0x28a2e9(0x1d8));}return join(_0x2553af[_0x28a2e9(0x1ce)],_0xa3049e,_0x2d2469+_0x28a2e9(0x1d8));}export function generateTemplate(_0x31f107,_0x10c7b5,_0x18935a,_0x24c8dd,_0x32d4cb){const _0x3c6857=a30_0x153172,_0x2fb507=_0x24c8dd?.[_0x3c6857(0x1f3)]()||_0x3c6857(0x1d5);if(_0x31f107===_0x3c6857(0x1f0))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x2fb507+_0x3c6857(0x1e3)+_0x10c7b5+_0x3c6857(0x1cd)+_0x10c7b5+_0x3c6857(0x20c)+_0x10c7b5+_0x3c6857(0x1fe);if(_0x31f107==='ENDPOINT')return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x2fb507+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x18935a+'/'+_0x10c7b5+_0x3c6857(0x1cf)+_0x10c7b5+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x32d4cb)throw CliErrors[_0x3c6857(0x1f4)](_0x3c6857(0x20a));return _0x3c6857(0x1c5)+_0x2fb507+_0x3c6857(0x1ff)+_0x18935a+'/'+_0x32d4cb[_0x3c6857(0x21b)]+'/'+_0x32d4cb[_0x3c6857(0x1e8)]+_0x3c6857(0x216)+_0x32d4cb[_0x3c6857(0x204)]+'\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'+_0x10c7b5+_0x3c6857(0x1fe);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2b668e=a31_0xdb80;(function(_0x2076b4,_0x22963d){const _0x3ce7d0=a31_0xdb80,_0x1903e0=_0x2076b4();while(!![]){try{const _0x3df482=-parseInt(_0x3ce7d0(0x7f))/0x1*(-parseInt(_0x3ce7d0(0x76))/0x2)+-parseInt(_0x3ce7d0(0x8e))/0x3*(-parseInt(_0x3ce7d0(0x7a))/0x4)+parseInt(_0x3ce7d0(0x79))/0x5*(parseInt(_0x3ce7d0(0x78))/0x6)+-parseInt(_0x3ce7d0(0x80))/0x7*(-parseInt(_0x3ce7d0(0x89))/0x8)+-parseInt(_0x3ce7d0(0x99))/0x9+parseInt(_0x3ce7d0(0xa1))/0xa+-parseInt(_0x3ce7d0(0x7d))/0xb;if(_0x3df482===_0x22963d)break;else _0x1903e0['push'](_0x1903e0['shift']());}catch(_0x55e460){_0x1903e0['push'](_0x1903e0['shift']());}}}(a31_0x4556,0xf38f5));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a31_0x4556(){const _0x16546e=['lockFilePath','Lock\x20scope\x20for\x20app\x20\x22','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','startsWith','trashDir','target','1096070SQMqhz','BFF\x20lock\x20file\x20not\x20found.','includes','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','toISOString','join','functions','6TojNRp','str','4075518YrQYCT','10SWuzLt','2592428xKCwVy','scriptsRootDir','validation','54649441lNkGDs','Function\x20not\x20found:\x20','566459yrmnou','1533KrWiXU','<timestamp>','projectRoot','string','Local\x20delete\x20not\x20settled\x20for\x20','high-risk-write','\x22\x20not\x20found\x20after\x20ensureLockScope.','delete','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','65864vuJQYX','lastSync','remoteId','map','POST','9jYZYOs','appCode','Deleted\x20','find','/api/management/library/scripts/delete','apps','length','Multiple\x20functions\x20match\x20\x22','replace','No\x20lock\x20entry\x20found\x20for\x20\x22','keys','8541774KjajQH','scriptsRoot'];a31_0x4556=function(){return _0x16546e;};return a31_0x4556();}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';function a31_0xdb80(_0x4b6156,_0x544c80){_0x4b6156=_0x4b6156-0x75;const _0x4556fa=a31_0x4556();let _0xdb806a=_0x4556fa[_0x4b6156];return _0xdb806a;}export const bffDelete={'service':'bff','command':'delete','description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x2b668e(0x85),'flags':[{'name':a31_0x2b668e(0xa0),'type':a31_0x2b668e(0x83),'required':!![],'description':a31_0x2b668e(0xa4)}],async 'validate'(_0x32cbf5){const _0x5882e6=a31_0x2b668e,_0x4c7a40=loadBffProjectConfig(_0x32cbf5['appCode']),_0x4a4bcd=await readBffLockFile(_0x4c7a40[_0x5882e6(0x9b)]);if(!_0x4a4bcd)throw CliErrors[_0x5882e6(0x7c)](_0x5882e6(0x9d));},async 'dryRun'(_0x111327){const _0x48d6bc=a31_0x2b668e,_0x590d46=loadBffProjectConfig(_0x111327[_0x48d6bc(0x8f)]),_0x403ef8=await readBffLockFile(_0x590d46[_0x48d6bc(0x9b)]);if(!_0x403ef8)throw CliErrors['validation'](_0x48d6bc(0xa2));const {appLock:_0x590237}=ensureLockScope(_0x403ef8,_0x111327[_0x48d6bc(0x8f)],_0x590d46[_0x48d6bc(0x9a)],_0x48d6bc(0x87)),_0x3d452c=_0x111327[_0x48d6bc(0x77)](_0x48d6bc(0xa0)),_0x428274=Object[_0x48d6bc(0x98)](_0x590237['functions']),_0x432105=resolveDeleteTarget(_0x3d452c,_0x428274),_0x715b6c=_0x590237['functions'][_0x432105];if(!_0x715b6c)throw CliErrors[_0x48d6bc(0x7c)](_0x48d6bc(0x97)+_0x432105+'\x22.');const _0x40958d=resolveLocalFilePathFromLockKey(_0x590d46,_0x432105),_0x56c775=relative(_0x590d46[_0x48d6bc(0x82)],_0x40958d),_0x3eb67c=join(_0x590d46[_0x48d6bc(0x9f)],_0x48d6bc(0x81),_0x56c775);return{'method':_0x48d6bc(0x8d),'url':_0x48d6bc(0x92),'body':{'appCode':_0x111327[_0x48d6bc(0x8f)],'target':_0x432105,'remoteId':_0x715b6c[_0x48d6bc(0x8b)],'localFilePath':_0x40958d,'trashedPath':_0x3eb67c},'description':'Would\x20delete\x20'+_0x432105+_0x48d6bc(0x88)};},async 'execute'(_0x5dd870){const _0x467b86=a31_0x2b668e,_0x5b9b62=loadBffProjectConfig(_0x5dd870['appCode']),_0x4e8474=await readBffLockFile(_0x5b9b62[_0x467b86(0x9b)]);if(!_0x4e8474)throw CliErrors['validation'](_0x467b86(0xa2));const {lockData:_0x1537da,appLock:_0x1f4cb3}=ensureLockScope(_0x4e8474,_0x5dd870[_0x467b86(0x8f)],_0x5b9b62[_0x467b86(0x9a)],'delete'),_0x5929ce=JSON['parse'](JSON['stringify'](_0x1537da)),_0x53c772=_0x5929ce['apps'][_0x5dd870[_0x467b86(0x8f)]];if(!_0x53c772)throw new Error(_0x467b86(0x9c)+_0x5dd870[_0x467b86(0x8f)]+_0x467b86(0x86));const _0xac5650=_0x5dd870['str'](_0x467b86(0xa0)),_0x265e2e=Object[_0x467b86(0x98)](_0x53c772[_0x467b86(0x75)]),_0x42edad=resolveDeleteTarget(_0xac5650,_0x265e2e),_0x29e95d=_0x53c772['functions'][_0x42edad];if(!_0x29e95d)throw CliErrors[_0x467b86(0x7c)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x42edad+'\x22.');await deleteBffScript(_0x29e95d['remoteId']),delete _0x53c772[_0x467b86(0x75)][_0x42edad],_0x53c772[_0x467b86(0x8a)]=new Date()[_0x467b86(0xa5)](),await writeBffLockFile(_0x5b9b62[_0x467b86(0x9b)],_0x5929ce);const _0x2ed5d7=resolveLocalFilePathFromLockKey(_0x5b9b62,_0x42edad);let _0x570531;await fileExists(_0x2ed5d7)&&(_0x570531=await moveToTrash(_0x5b9b62[_0x467b86(0x82)],_0x5b9b62[_0x467b86(0x9f)],_0x2ed5d7),await cleanupEmptyDirectories(dirname(_0x2ed5d7),_0x5b9b62[_0x467b86(0x7b)]));await waitForDeleteSettlement(_0x5b9b62[_0x467b86(0x9b)],_0x5dd870['appCode'],_0x42edad,_0x2ed5d7),await sleep(0x96);const _0x1582fc={'deleted':_0x42edad,'remoteId':_0x29e95d[_0x467b86(0x8b)]};if(_0x570531)_0x1582fc['trashedTo']=_0x570531;return{'ok':!![],'data':_0x1582fc,'message':_0x467b86(0x90)+_0x42edad+(_0x570531?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x451bc7,_0xf5d2a1){const _0x24d2f3=a31_0x2b668e;if(_0x451bc7[_0x24d2f3(0xa3)]('/')){const _0xffaa98=_0xf5d2a1[_0x24d2f3(0x91)](_0xd057a0=>_0xd057a0===_0x451bc7);if(!_0xffaa98)throw CliErrors[_0x24d2f3(0x7c)]('Function\x20not\x20found:\x20'+_0x451bc7);return _0xffaa98;}const _0x1ade7b=_0xf5d2a1['filter'](_0x327833=>_0x327833['split']('/')['at'](-0x1)===_0x451bc7);if(_0x1ade7b[_0x24d2f3(0x94)]===0x0)throw CliErrors['validation'](_0x24d2f3(0x7e)+_0x451bc7);if(_0x1ade7b[_0x24d2f3(0x94)]>0x1)throw CliErrors[_0x24d2f3(0x7c)](_0x24d2f3(0x95)+_0x451bc7+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x1ade7b[_0x24d2f3(0x8c)](_0x3d3b2c=>'\x20\x20-\x20'+_0x3d3b2c)[_0x24d2f3(0xa6)]('\x0a'));return _0x1ade7b[0x0];}async function moveToTrash(_0x2ed966,_0x154caa,_0x280bf1){const _0x20e380=a31_0x2b668e,_0x233925=new Date()[_0x20e380(0xa5)]()[_0x20e380(0x96)](/[:.]/g,'-'),_0x3b7732=relative(_0x2ed966,_0x280bf1),_0x4e19db=join(_0x154caa,_0x233925,_0x3b7732);return await mkdir(dirname(_0x4e19db),{'recursive':!![]}),await rename(_0x280bf1,_0x4e19db),_0x4e19db;}async function cleanupEmptyDirectories(_0x28136c,_0x3c9775){const _0x1692f5=a31_0x2b668e;let _0x443852=resolve(_0x28136c);const _0x25dd83=resolve(_0x3c9775);while(_0x443852[_0x1692f5(0x9e)](''+_0x25dd83+sep)||_0x443852===_0x25dd83){if(_0x443852===_0x25dd83)return;try{const _0xb04143=await readdir(_0x443852);if(_0xb04143[_0x1692f5(0x94)]>0x0)return;await rmdir(_0x443852);}catch{return;}_0x443852=dirname(_0x443852);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0xc73ce6,_0x379a01,_0x3dee6f,_0x4a20a0){const _0x4194dc=a31_0x2b668e;for(let _0x23c948=0x0;_0x23c948<DELETE_SETTLE_RETRY_COUNT;_0x23c948+=0x1){const _0x29782f=await readBffLockFile(_0xc73ce6),_0x56ecd5=!!_0x29782f?.[_0x4194dc(0x93)]?.[_0x379a01]?.[_0x4194dc(0x75)]?.[_0x3dee6f],_0xe64cc7=await fileExists(_0x4a20a0);if(!_0x56ecd5&&!_0xe64cc7)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4194dc(0x84)+_0x3dee6f+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x403e67=a32_0x1589;(function(_0x67fd2b,_0x257a7d){const _0x34c270=a32_0x1589,_0x3dbe52=_0x67fd2b();while(!![]){try{const _0x1fc4e7=parseInt(_0x34c270(0xb3))/0x1*(-parseInt(_0x34c270(0xab))/0x2)+-parseInt(_0x34c270(0xb8))/0x3+parseInt(_0x34c270(0xb6))/0x4*(parseInt(_0x34c270(0xa7))/0x5)+parseInt(_0x34c270(0xad))/0x6*(-parseInt(_0x34c270(0xbd))/0x7)+parseInt(_0x34c270(0xb7))/0x8*(-parseInt(_0x34c270(0xa5))/0x9)+-parseInt(_0x34c270(0xac))/0xa*(-parseInt(_0x34c270(0xbe))/0xb)+parseInt(_0x34c270(0xb0))/0xc;if(_0x1fc4e7===_0x257a7d)break;else _0x3dbe52['push'](_0x3dbe52['shift']());}catch(_0x379b01){_0x3dbe52['push'](_0x3dbe52['shift']());}}}(a32_0x20f3,0x66a64));function a32_0x1589(_0x4a14c8,_0x1aa8aa){_0x4a14c8=_0x4a14c8-0xa5;const _0x20f3ce=a32_0x20f3();let _0x158926=_0x20f3ce[_0x4a14c8];return _0x158926;}import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x20f3(){const _0x3232ed=['17071188shfcen','(none)','Script\x20ID','719063adVoNv','createdTime','description','739360MNpROT','136KcnluX','1252095QvuaZP','Return\x20full\x20raw\x20script\x20object','num','bff','read','4441087SZRWVe','7051YmpUWc','69633zedxAl','scriptContent','20DLLNJX','number','updatedTime','detail','2IeOXCa','2510ZYVpmL','6tMlzrh','appCode','bool'];a32_0x20f3=function(){return _0x3232ed;};return a32_0x20f3();}export const bffDetail={'service':a32_0x403e67(0xbb),'command':a32_0x403e67(0xaa),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a32_0x403e67(0xbc),'flags':[{'name':'id','type':a32_0x403e67(0xa8),'required':!![],'description':a32_0x403e67(0xb2)},{'name':'verbose','type':'boolean','description':a32_0x403e67(0xb9)}],async 'execute'(_0x1782bb){const _0x530a2d=a32_0x403e67,_0x5dc638=await getBffScriptInfo(_0x1782bb[_0x530a2d(0xba)]('id')),_0x4a494f=_0x1782bb[_0x530a2d(0xaf)]('verbose');if(_0x4a494f)return{'ok':!![],'data':_0x5dc638};return{'ok':!![],'data':{'id':_0x5dc638['id'],'appCode':_0x5dc638[_0x530a2d(0xae)],'scriptType':_0x5dc638['scriptType'],'description':_0x5dc638[_0x530a2d(0xb5)]||_0x530a2d(0xb1),'createdTime':_0x5dc638[_0x530a2d(0xb4)]??'','updatedTime':_0x5dc638[_0x530a2d(0xa9)]??'','scriptContent':_0x5dc638[_0x530a2d(0xa6)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5acdcd,_0x1e6eaa){const _0x5ab49b=a33_0x347e,_0x5f5389=_0x5acdcd();while(!![]){try{const _0x1d2029=-parseInt(_0x5ab49b(0x1b7))/0x1+parseInt(_0x5ab49b(0x1bc))/0x2*(-parseInt(_0x5ab49b(0x1b4))/0x3)+-parseInt(_0x5ab49b(0x1bd))/0x4*(parseInt(_0x5ab49b(0x1bb))/0x5)+parseInt(_0x5ab49b(0x1be))/0x6+-parseInt(_0x5ab49b(0x1b9))/0x7+parseInt(_0x5ab49b(0x1ba))/0x8*(-parseInt(_0x5ab49b(0x1b6))/0x9)+parseInt(_0x5ab49b(0x1b8))/0xa*(parseInt(_0x5ab49b(0x1b5))/0xb);if(_0x1d2029===_0x1e6eaa)break;else _0x5f5389['push'](_0x5f5389['shift']());}catch(_0x58a6df){_0x5f5389['push'](_0x5f5389['shift']());}}}(a33_0x5f21,0x9efa3));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a33_0x5f21(){const _0xa2eddc=['120806IbZmml','4644548ghHkYD','5013336SPvitT','57FQfEOa','143QoAkkw','981OKkokL','553961fAxcGb','2890310LJmGlp','954044YiPAcU','69192iJlTXJ','5ZAwzDM'];a33_0x5f21=function(){return _0xa2eddc;};return a33_0x5f21();}function a33_0x347e(_0x5855dc,_0x5a147a){_0x5855dc=_0x5855dc-0x1b4;const _0x5f21b4=a33_0x5f21();let _0x347ea5=_0x5f21b4[_0x5855dc];return _0x347ea5;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|