@lovrabet/rabetbase-cli 2.3.16-beta.1 → 2.3.16-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- 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 -0
- 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 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.js +1 -0
- 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 -0
- package/lib/commands/tenant/members-list.js +1 -0
- package/lib/commands/tenant/shared.js +1 -0
- 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.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/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 +2 -2
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +1 -1
- package/templates/projects/sub-app-react-demo/README.md +1 -1
- package/templates/projects/sub-app-react-demo/docs/quick-start.md +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +1 -1
- package/lib/commands/app/add.js +0 -1
- package/lib/commands/app/remove.js +0 -1
- package/lib/commands/project/init.js +0 -1
- package/lib/commands/sql/save.js +0 -1
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x59ef08=a19_0x165c;(function(_0x497c6d,_0x55baf3){const _0x39ffdb=a19_0x165c,_0x4fa01e=_0x497c6d();while(!![]){try{const _0x4b1176=-parseInt(_0x39ffdb(0x144))/0x1*(parseInt(_0x39ffdb(0x13f))/0x2)+parseInt(_0x39ffdb(0x162))/0x3+-parseInt(_0x39ffdb(0x153))/0x4*(-parseInt(_0x39ffdb(0x142))/0x5)+parseInt(_0x39ffdb(0x13c))/0x6*(-parseInt(_0x39ffdb(0x14b))/0x7)+parseInt(_0x39ffdb(0x141))/0x8+-parseInt(_0x39ffdb(0x148))/0x9*(parseInt(_0x39ffdb(0x14e))/0xa)+-parseInt(_0x39ffdb(0x158))/0xb*(parseInt(_0x39ffdb(0x15f))/0xc);if(_0x4b1176===_0x55baf3)break;else _0x4fa01e['push'](_0x4fa01e['shift']());}catch(_0x97fb98){_0x4fa01e['push'](_0x4fa01e['shift']());}}}(a19_0x5477,0xc3941));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x4ac953,_0x4075c3){const _0x5b5f8c=a19_0x165c,_0x53a1d2=[],_0x1a33ba=_0x4ac953['apps']&&typeof _0x4ac953[_0x5b5f8c(0x15e)]==='object'?_0x4ac953[_0x5b5f8c(0x15e)]:{},_0x2312bb=_0x4ac953[_0x5b5f8c(0x13d)]||undefined;for(const [_0x536499,_0x5d36dc]of Object[_0x5b5f8c(0x14d)](_0x1a33ba)){if(!_0x5d36dc||typeof _0x5d36dc!==_0x5b5f8c(0x157)||!_0x5d36dc[_0x5b5f8c(0x14a)])continue;_0x53a1d2[_0x5b5f8c(0x15d)]({'name':_0x536499,'appcode':_0x5d36dc[_0x5b5f8c(0x14a)],'named':!![],'definedIn':_0x4075c3,'isDefault':_0x536499===_0x2312bb,...buildAppProfileListFields(_0x5d36dc)});}return _0x53a1d2;}function buildMergedItems(_0x450c09,_0x1ca86e){const _0x23cdfc=a19_0x165c,{apps:apps={},defaultApp:_0x20c3e3}=_0x450c09,_0x3b2db7=_0x1ca86e[_0x23cdfc(0x165)][_0x23cdfc(0x15e)]&&typeof _0x1ca86e[_0x23cdfc(0x165)][_0x23cdfc(0x15e)]===_0x23cdfc(0x157)?_0x1ca86e[_0x23cdfc(0x165)][_0x23cdfc(0x15e)]:{},_0x116320=_0x1ca86e[_0x23cdfc(0x15b)][_0x23cdfc(0x15e)]&&typeof _0x1ca86e[_0x23cdfc(0x15b)][_0x23cdfc(0x15e)]===_0x23cdfc(0x157)?_0x1ca86e['projectConfig'][_0x23cdfc(0x15e)]:{},_0x1d6bad=_0x1ca86e[_0x23cdfc(0x15b)]['inherit']===![],_0x23a7c2=Object[_0x23cdfc(0x14d)](apps),_0x44e346=_0x23a7c2[_0x23cdfc(0x13e)](([_0x26878d,_0x257293])=>({'name':_0x26878d,'appcode':_0x257293[_0x23cdfc(0x14a)],'named':!![],'definedIn':appDefinedIn(_0x26878d,_0x3b2db7,_0x116320,_0x1d6bad),'isDefault':_0x26878d===_0x20c3e3,...buildAppProfileListFields(_0x257293)}));return _0x44e346;}function a19_0x5477(){const _0x238a50=['List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','\x20in\x20','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','object','301477AcKnYk','globalPath','project','projectConfig','global','push','apps','228aijRfz','isCurrent','find','395343bLavim','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','globalConfig','boolean','18odInhZ','defaultApp','map','1402RQHOCQ','validation','11614792YvfeJZ','795OCWuGs','merged','1432IWMkfg','No\x20apps\x20configured','remote','projectPath','307143uKDjoJ','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','appcode','1424542VnCPqs','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','entries','70paoKBr','optional','read','bool','.\x20Use\x20`','40036sjfxvu'];a19_0x5477=function(){return _0x238a50;};return a19_0x5477();}function validateAppListFlags(_0x85f6f4){const _0x1d8fef=a19_0x165c;if(!_0x85f6f4[_0x1d8fef(0x151)]('remote'))return;if(!_0x85f6f4[_0x1d8fef(0x151)](_0x1d8fef(0x15c))&&!_0x85f6f4[_0x1d8fef(0x151)](_0x1d8fef(0x15a)))return;throw CliErrors[_0x1d8fef(0x140)](_0x1d8fef(0x164),_0x1d8fef(0x14c));}function a19_0x165c(_0x1b730a,_0x3484a1){_0x1b730a=_0x1b730a-0x13b;const _0x5477af=a19_0x5477();let _0x165c6c=_0x5477af[_0x1b730a];return _0x165c6c;}async function execute(_0x2b03ed){const _0x1442ca=a19_0x165c;validateAppListFlags(_0x2b03ed);if(_0x2b03ed[_0x1442ca(0x151)](_0x1442ca(0x146)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x2b03ed)};const _0xecbdc=_0x2b03ed[_0x1442ca(0x151)](_0x1442ca(0x15c)),_0x3c3371=_0x2b03ed['bool'](_0x1442ca(0x15a)),_0x309d01=_0xecbdc?'global':_0x3c3371?'project':_0x1442ca(0x143),{config:_0x17187e,layers:_0x33bf16}=readRawConfigWithLayers(),_0x5bf5d6=resolveDefaultAppSource(_0x33bf16),{defaultApp:_0x35d69d}=_0x17187e;let _0x405510,_0x39496c;switch(_0x309d01){case'global':_0x405510=buildItemsFromLayer(_0x33bf16[_0x1442ca(0x165)],_0x1442ca(0x15c)),_0x39496c=_0x33bf16['globalPath'];break;case _0x1442ca(0x15a):_0x405510=buildItemsFromLayer(_0x33bf16[_0x1442ca(0x15b)],_0x1442ca(0x15a)),_0x39496c=_0x33bf16[_0x1442ca(0x147)];break;default:_0x405510=buildMergedItems(_0x17187e,_0x33bf16);break;}enrichAppListItemsWithMergedSelection(_0x405510,_0x2b03ed['mergedCli']);if(_0x405510['length']===0x0){const _0x5726c1=_0x309d01===_0x1442ca(0x143)?'':_0x1442ca(0x155)+_0x309d01+'\x20config';return{'ok':!![],'data':[],'message':_0x1442ca(0x145)+_0x5726c1+_0x1442ca(0x152)+CLI_BIN_NAME+_0x1442ca(0x149)};}const _0x53b421=_0x405510[_0x1442ca(0x161)](_0xdc9922=>_0xdc9922[_0x1442ca(0x160)]===!![]),_0x48dfa1=_0x35d69d??_0x53b421?.[_0x1442ca(0x14a)]??null,_0x4cf98b=_0x309d01==='merged'?{'globalPath':_0x33bf16[_0x1442ca(0x159)]??null,'projectPath':_0x33bf16[_0x1442ca(0x147)]??null,'defaultApp':_0x48dfa1,'defaultAppSource':_0x35d69d!=null?_0x5bf5d6:null}:{'scope':_0x309d01,'configPath':_0x39496c??null};return{'ok':!![],'data':{'items':_0x405510,'meta':_0x4cf98b}};}export const appListDefinition={'service':'app','command':'list','description':a19_0x59ef08(0x154),'risk':a19_0x59ef08(0x150),'auth':a19_0x59ef08(0x14f),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x59ef08(0x146),'type':a19_0x59ef08(0x13b),'description':'List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','default':![]},{'name':a19_0x59ef08(0x15c),'type':a19_0x59ef08(0x13b),'description':a19_0x59ef08(0x156),'default':![]},{'name':a19_0x59ef08(0x15a),'type':a19_0x59ef08(0x13b),'description':a19_0x59ef08(0x163),'default':![]}],async 'validate'(_0x46448a){validateAppListFlags(_0x46448a);},'execute':execute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a20_0x23e95c=a20_0x39e3;function a20_0x39e3(_0x3ea95e,_0x3ec0cc){_0x3ea95e=_0x3ea95e-0xa7;const _0x6c555a=a20_0x6c55();let _0x39e3e=_0x6c555a[_0x3ea95e];return _0x39e3e;}(function(_0x2c00f4,_0x140f6f){const _0x300d5c=a20_0x39e3,_0xe63596=_0x2c00f4();while(!![]){try{const _0x5e8b40=-parseInt(_0x300d5c(0xa9))/0x1*(parseInt(_0x300d5c(0xa8))/0x2)+parseInt(_0x300d5c(0xb0))/0x3+-parseInt(_0x300d5c(0xab))/0x4+parseInt(_0x300d5c(0xb6))/0x5*(-parseInt(_0x300d5c(0xaa))/0x6)+-parseInt(_0x300d5c(0xae))/0x7+parseInt(_0x300d5c(0xb1))/0x8*(parseInt(_0x300d5c(0xad))/0x9)+parseInt(_0x300d5c(0xb7))/0xa;if(_0x5e8b40===_0x140f6f)break;else _0xe63596['push'](_0xe63596['shift']());}catch(_0x55e63e){_0xe63596['push'](_0xe63596['shift']());}}}(a20_0x6c55,0x39e7c));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a20_0x6c55(){const _0x12c68c=['1070730dHmynQ','30928yZXjdg','members-list','length','read','Found\x20','202090kZfdPD','5457780qfspIK','\x20application\x20member(s)','13654ICfNwA','4QdyWap','18QnQKSR','1549200ikOeaD','List\x20application\x20members\x20with\x20their\x20role\x20memberships','135fADgrb','1313452fhHSJy','app'];a20_0x6c55=function(){return _0x12c68c;};return a20_0x6c55();}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x23e95c(0xaf),'command':a20_0x23e95c(0xb2),'description':a20_0x23e95c(0xac),'risk':a20_0x23e95c(0xb4),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x2fdaf3){const _0x46b01c=a20_0x23e95c,_0x30501b=projectAppMembers(await listRoleUsers(_0x2fdaf3['appCode']));return{'ok':!![],'data':{'appCode':_0x2fdaf3['appCode'],'items':_0x30501b,'totalCount':_0x30501b[_0x46b01c(0xb3)]},'message':_0x46b01c(0xb5)+_0x30501b['length']+_0x46b01c(0xa7)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1979eb,_0xfd7c48){const _0x7cb447=a21_0x1e02,_0x1ceb0c=_0x1979eb();while(!![]){try{const _0x57cdfe=parseInt(_0x7cb447(0x85))/0x1*(-parseInt(_0x7cb447(0x88))/0x2)+parseInt(_0x7cb447(0x81))/0x3+parseInt(_0x7cb447(0x86))/0x4+parseInt(_0x7cb447(0x7f))/0x5*(-parseInt(_0x7cb447(0x7d))/0x6)+-parseInt(_0x7cb447(0x87))/0x7+parseInt(_0x7cb447(0x83))/0x8*(-parseInt(_0x7cb447(0x7e))/0x9)+parseInt(_0x7cb447(0x80))/0xa*(parseInt(_0x7cb447(0x8b))/0xb);if(_0x57cdfe===_0xfd7c48)break;else _0x1ceb0c['push'](_0x1ceb0c['shift']());}catch(_0x3f3423){_0x1ceb0c['push'](_0x1ceb0c['shift']());}}}(a21_0x3de6,0xacc4c));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 a21_0x3de6(){const _0x12ebc8=['cookie','8qVnXjW','appDesc','762122XDNCls','2720536kclTPG','6806114tOlkbH','2fBrOXh','map','appCode','11XdXMMw','platform','132OKgaqd','5190894iAZsqT','85615zrcllU','22368270zMFECn','1435785ujejbB'];a21_0x3de6=function(){return _0x12ebc8;};return a21_0x3de6();}function resolveCookie(_0x35e9ff){const _0x5c09b9=a21_0x1e02,_0x1c9e60=_0x35e9ff[_0x5c09b9(0x82)]||getCookie();if(!_0x1c9e60)throw CliErrors['authRequired']();return _0x1c9e60;}function a21_0x1e02(_0x3f2f45,_0x3cc9bf){_0x3f2f45=_0x3f2f45-0x7d;const _0x3de6a4=a21_0x3de6();let _0x1e0264=_0x3de6a4[_0x3f2f45];return _0x1e0264;}export async function listRemoteAppDirectory(_0x2c5215){const _0x530189=a21_0x1e02,_0x412534=await withActiveCookie(resolveCookie(_0x2c5215),()=>listRemoteApps());return{'items':_0x412534[_0x530189(0x89)](_0x364042=>({..._0x364042['id']!=null?{'id':_0x364042['id']}:{},'appCode':_0x364042[_0x530189(0x8a)],'appName':_0x364042['appName'],..._0x364042[_0x530189(0x84)]!=null?{'appDesc':_0x364042['appDesc']}:{}})),'meta':{'source':_0x530189(0x8c)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x658017,_0x940b4b){const _0x3d0a21=a22_0x376e,_0x3f5ee4=_0x658017();while(!![]){try{const _0xdbb67e=-parseInt(_0x3d0a21(0x1bb))/0x1+-parseInt(_0x3d0a21(0x1d6))/0x2*(parseInt(_0x3d0a21(0x1da))/0x3)+-parseInt(_0x3d0a21(0x1d0))/0x4+parseInt(_0x3d0a21(0x1c8))/0x5+parseInt(_0x3d0a21(0x1cb))/0x6*(parseInt(_0x3d0a21(0x1af))/0x7)+-parseInt(_0x3d0a21(0x1b9))/0x8+parseInt(_0x3d0a21(0x1ba))/0x9*(parseInt(_0x3d0a21(0x1d9))/0xa);if(_0xdbb67e===_0x940b4b)break;else _0x3f5ee4['push'](_0x3f5ee4['shift']());}catch(_0x2c1b66){_0x3f5ee4['push'](_0x3f5ee4['shift']());}}}(a22_0x1705,0x40f48));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x8c9913){const _0x712564=a22_0x376e,_0x1ace57=_0x8c9913?.[_0x712564(0x1c9)]();return _0x1ace57?_0x1ace57:null;}function a22_0x376e(_0x574d42,_0x47a16c){_0x574d42=_0x574d42-0x1ae;const _0x1705c3=a22_0x1705();let _0x376e36=_0x1705c3[_0x574d42];return _0x376e36;}export function projectAppMembers(_0x1adb19){const _0x2ba8b5=a22_0x376e,_0x1580bd=new Map(),_0x5684b8=[..._0x1adb19][_0x2ba8b5(0x1b7)]((_0x40fe44,_0x135d27)=>_0x40fe44['id']-_0x135d27['id']),_0x374549=(_0x25f781,_0x3f7d96,_0x565caa)=>{const _0x8f7928=_0x2ba8b5;for(const _0x4e79e2 of _0x3f7d96){const _0x42d88a=Number(_0x4e79e2[_0x8f7928(0x1b1)]);if(!Number['isFinite'](_0x42d88a)||_0x42d88a<=0x0)continue;let _0x584aea=_0x1580bd[_0x8f7928(0x1cc)](_0x42d88a);if(!_0x584aea)_0x584aea={'userId':_0x42d88a,'username':nullableText(_0x4e79e2[_0x8f7928(0x1de)]),'displayName':nullableText(_0x4e79e2[_0x8f7928(0x1ca)]),'status':_0x565caa,'roles':[],'roleKeys':new Set()},_0x1580bd['set'](_0x42d88a,_0x584aea);else{_0x584aea[_0x8f7928(0x1de)]??=nullableText(_0x4e79e2['username']),_0x584aea['displayName']??=nullableText(_0x4e79e2[_0x8f7928(0x1ca)]);if(_0x565caa===_0x8f7928(0x1c6))_0x584aea[_0x8f7928(0x1c7)]=_0x8f7928(0x1c6);}const _0x428955=_0x25f781['id']+':'+_0x565caa;if(_0x584aea[_0x8f7928(0x1cf)]['has'](_0x428955))continue;_0x584aea['roleKeys'][_0x8f7928(0x1b4)](_0x428955),_0x584aea[_0x8f7928(0x1be)][_0x8f7928(0x1c0)]({'roleId':_0x25f781['id'],'roleName':nullableText(_0x25f781[_0x8f7928(0x1c2)]),'roleType':nullableText(_0x25f781[_0x8f7928(0x1ce)]),'membershipStatus':_0x565caa});}};for(const _0x2f7e98 of _0x5684b8){_0x374549(_0x2f7e98,_0x2f7e98['userList']??[],_0x2ba8b5(0x1c6)),_0x374549(_0x2f7e98,_0x2f7e98[_0x2ba8b5(0x1c4)]??[],_0x2ba8b5(0x1b3));}return[..._0x1580bd[_0x2ba8b5(0x1d7)]()][_0x2ba8b5(0x1b6)](_0x1e7a5d=>({'userId':_0x1e7a5d[_0x2ba8b5(0x1b1)],'username':_0x1e7a5d['username'],'displayName':_0x1e7a5d[_0x2ba8b5(0x1b2)],'status':_0x1e7a5d[_0x2ba8b5(0x1c7)],'roles':_0x1e7a5d[_0x2ba8b5(0x1be)][_0x2ba8b5(0x1b7)]((_0x3a892e,_0x277bc3)=>_0x3a892e[_0x2ba8b5(0x1d2)]-_0x277bc3['roleId']||(_0x3a892e['membershipStatus']===_0x277bc3['membershipStatus']?0x0:_0x3a892e[_0x2ba8b5(0x1d1)]===_0x2ba8b5(0x1c6)?-0x1:0x1))}))[_0x2ba8b5(0x1b7)]((_0x4d5535,_0x122b7f)=>_0x4d5535[_0x2ba8b5(0x1b1)]-_0x122b7f[_0x2ba8b5(0x1b1)]);}export function enrichAppListItemsWithMergedSelection(_0x550370,_0x4bd086){const _0x57dc37=a22_0x376e;if(!_0x4bd086)return;const _0x32152d=_0x4bd086[_0x57dc37(0x1ae)]&&typeof _0x4bd086[_0x57dc37(0x1ae)]===_0x57dc37(0x1d5)?_0x4bd086[_0x57dc37(0x1ae)]:{},_0x554753=Object['keys'](_0x32152d)[_0x57dc37(0x1b5)]>0x0;for(const _0x39cc9f of _0x550370){_0x39cc9f[_0x57dc37(0x1db)]=![];}const _0x349f81=_0x4bd086['appCode']!=null?String(_0x4bd086[_0x57dc37(0x1cd)])[_0x57dc37(0x1c9)]():'';if(_0x554753){const _0x365e03=_0x4bd086[_0x57dc37(0x1c3)]??_0x4bd086['defaultApp'];if(_0x365e03)for(const _0x569803 of _0x550370){_0x569803['named']===!![]&&_0x569803['name']===_0x365e03&&(_0x569803[_0x57dc37(0x1db)]=!![]);}for(const _0x1655c6 of _0x550370){if(_0x1655c6[_0x57dc37(0x1bf)]!==![])continue;if(_0x4bd086['defaultApp'])continue;_0x349f81&&String(_0x1655c6['appcode']??'')['trim']()===_0x349f81&&(_0x1655c6['isCurrent']=!![]);}return;}if(!_0x349f81)return;for(const _0x239788 of _0x550370){String(_0x239788['appcode']??'')['trim']()===_0x349f81&&(_0x239788['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x56747f,_0x303d16,_0x184fdc){const _0x47ca8b=a22_0x376e;if(_0x303d16)return _0x47ca8b(0x1b8);const _0x4e2fe9=_0x184fdc[_0x47ca8b(0x1d3)][_0x47ca8b(0x1ae)]&&typeof _0x184fdc[_0x47ca8b(0x1d3)][_0x47ca8b(0x1ae)]===_0x47ca8b(0x1d5)?_0x184fdc[_0x47ca8b(0x1d3)][_0x47ca8b(0x1ae)]:{},_0x598654=_0x184fdc[_0x47ca8b(0x1dc)][_0x47ca8b(0x1ae)]&&typeof _0x184fdc['globalConfig'][_0x47ca8b(0x1ae)]===_0x47ca8b(0x1d5)?_0x184fdc[_0x47ca8b(0x1dc)][_0x47ca8b(0x1ae)]:{};if(Object[_0x47ca8b(0x1b0)][_0x47ca8b(0x1bd)]['call'](_0x4e2fe9,_0x56747f))return _0x47ca8b(0x1c1);if(Object[_0x47ca8b(0x1b0)][_0x47ca8b(0x1bd)][_0x47ca8b(0x1d4)](_0x598654,_0x56747f))return _0x47ca8b(0x1b8);return _0x47ca8b(0x1c1);}function a22_0x1705(){const _0x118def=['roleId','projectConfig','call','object','2KUijia','values','defaultApp','359110xmRcHP','1174626oMHWGI','isCurrent','globalConfig','\x20(global)','username','apps','11963nanXOX','prototype','userId','displayName','PENDING','add','length','map','sort','global','833608wpAdgS','45WBlbQQ','10533OPkWIX','keys','hasOwnProperty','roles','named','push','project','roleName','currentApp','applyUserList','both','ACTIVE','status','2287890WsfQLg','trim','nickname','708LfegtT','get','appCode','roleType','roleKeys','265852YbIdBD','membershipStatus'];a22_0x1705=function(){return _0x118def;};return a22_0x1705();}export function appDefinedIn(_0x196a8d,_0x59c883,_0x30c0ab,_0x5680e6){const _0x4c73fd=a22_0x376e;if(_0x5680e6)return Object[_0x4c73fd(0x1b0)][_0x4c73fd(0x1bd)][_0x4c73fd(0x1d4)](_0x30c0ab,_0x196a8d)?_0x4c73fd(0x1c1):_0x4c73fd(0x1b8);const _0xe46d8b=Object[_0x4c73fd(0x1b0)][_0x4c73fd(0x1bd)]['call'](_0x59c883,_0x196a8d),_0x2fc77b=Object[_0x4c73fd(0x1b0)][_0x4c73fd(0x1bd)][_0x4c73fd(0x1d4)](_0x30c0ab,_0x196a8d);if(_0xe46d8b&&_0x2fc77b)return _0x4c73fd(0x1c5);if(_0x2fc77b)return _0x4c73fd(0x1c1);return _0x4c73fd(0x1b8);}export function resolveDefaultAppSource(_0x5bc3e9){const _0x5c6d2f=a22_0x376e,_0x5ce280=_0x5bc3e9[_0x5c6d2f(0x1d3)][_0x5c6d2f(0x1ae)]&&typeof _0x5bc3e9[_0x5c6d2f(0x1d3)][_0x5c6d2f(0x1ae)]===_0x5c6d2f(0x1d5)?_0x5bc3e9['projectConfig'][_0x5c6d2f(0x1ae)]:{};if('defaultApp'in _0x5bc3e9['projectConfig'])return _0x5c6d2f(0x1c1);if(Object[_0x5c6d2f(0x1bc)](_0x5ce280)['length']>0x0)return _0x5c6d2f(0x1c1);if(_0x5bc3e9[_0x5c6d2f(0x1d3)]['inherit']===![])return null;if(_0x5bc3e9['globalConfig'][_0x5c6d2f(0x1d8)])return _0x5c6d2f(0x1b8);return null;}export function getConfigPath(_0x5d44f3={}){const _0x420c95=a22_0x376e,_0x5112ad=_0x5d44f3[_0x420c95(0x1b8)]?_0x420c95(0x1b8):'project';return resolveWriteConfigPath(_0x5112ad);}export function readConfig(_0x5484ab={}){return readConfigFile(getConfigPath(_0x5484ab));}export function writeConfig(_0x1c7679,_0x280606={}){writeConfigFile(getConfigPath(_0x280606),_0x1c7679);}export function scopeLabel(_0x5cb008){const _0x418e28=a22_0x376e;return _0x5cb008[_0x418e28(0x1b8)]?_0x418e28(0x1dd):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x3645ad=a23_0x3bc6;function a23_0x4972(){const _0x319ac3=['43672KprOqm','App\x20config\x20server\x20id\x20missing\x20for\x20key=','Delete\x20one\x20runtime\x20app-config\x20key','apiError','1755971EMWzsV','appCode:\x20','validation','isFinite','186452NZVeUX','App\x20config\x20key\x20not\x20found:\x20','780EcdTvO','/smartapi/app-config/delete','690wRSuJu','appCode','1659776PLgRIa','app-config','high-risk-write','1114218CetTdc','642SPvGDH','number','Deleted\x20app\x20config\x20','1955NBgKtm'];a23_0x4972=function(){return _0x319ac3;};return a23_0x4972();}function a23_0x3bc6(_0x54eb01,_0x261baf){_0x54eb01=_0x54eb01-0x150;const _0x4972cc=a23_0x4972();let _0x3bc677=_0x4972cc[_0x54eb01];return _0x3bc677;}(function(_0x360f1a,_0x16beae){const _0xc950ed=a23_0x3bc6,_0x4cfdbd=_0x360f1a();while(!![]){try{const _0x5c03c1=-parseInt(_0xc950ed(0x158))/0x1+parseInt(_0xc950ed(0x160))/0x2+parseInt(_0xc950ed(0x154))/0x3*(-parseInt(_0xc950ed(0x162))/0x4)+-parseInt(_0xc950ed(0x157))/0x5*(parseInt(_0xc950ed(0x164))/0x6)+parseInt(_0xc950ed(0x15c))/0x7+-parseInt(_0xc950ed(0x150))/0x8+parseInt(_0xc950ed(0x153))/0x9;if(_0x5c03c1===_0x16beae)break;else _0x4cfdbd['push'](_0x4cfdbd['shift']());}catch(_0xa2d167){_0x4cfdbd['push'](_0x4cfdbd['shift']());}}}(a23_0x4972,0x1fbfa));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x3645ad(0x163);export const appConfigDelete={'service':a23_0x3645ad(0x151),'command':'delete','description':a23_0x3645ad(0x15a),'risk':a23_0x3645ad(0x152),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x54b78c){readKeyArg(_0x54b78c);},async 'dryRun'(_0x220929){const _0x5564e0=a23_0x3645ad,_0x39844f=readKeyArg(_0x220929),_0x3c76d2=await mustGetByKey(_0x220929[_0x5564e0(0x165)],_0x39844f);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x220929[_0x5564e0(0x165)],'key':_0x39844f,'before':projectAppConfig(_0x3c76d2),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x55b25b){const _0x4f32b8=a23_0x3645ad,_0x455176=readKeyArg(_0x55b25b),_0x2b1509=await mustGetByKey(_0x55b25b['appCode'],_0x455176);return await withAppConfigApiBoundary('delete',{'appCode':_0x55b25b['appCode'],'key':_0x455176},()=>deleteAppConfig({'appCode':_0x55b25b[_0x4f32b8(0x165)],'id':requireAppConfigId(_0x2b1509,_0x455176,_0x55b25b['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':'delete','appCode':_0x55b25b[_0x4f32b8(0x165)],'key':_0x455176,'before':projectAppConfig(_0x2b1509),'after':null,'dryRun':![]}),'message':_0x4f32b8(0x156)+_0x455176};}};async function mustGetByKey(_0x53b107,_0x4c6e8d){const _0x36b44e=a23_0x3645ad,_0x584a53=await withAppConfigApiBoundary('get',{'appCode':_0x53b107,'key':_0x4c6e8d},()=>getAppConfigByKey(_0x53b107,_0x4c6e8d));if(!_0x584a53)throw CliErrors[_0x36b44e(0x15e)](_0x36b44e(0x161)+_0x4c6e8d,_0x36b44e(0x15d)+_0x53b107);return _0x584a53;}function requireAppConfigId(_0x388128,_0xbd9db4,_0x27d491){const _0x35970b=a23_0x3645ad;if(typeof _0x388128['id']===_0x35970b(0x155)&&Number[_0x35970b(0x15f)](_0x388128['id'])&&_0x388128['id']>0x0)return _0x388128['id'];throw CliErrors[_0x35970b(0x15b)](_0x35970b(0x159)+_0xbd9db4+',\x20appCode='+_0x27d491);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x37c650=a24_0x41e4;(function(_0x1ec105,_0x57ab43){const _0x395bc5=a24_0x41e4,_0x11fa55=_0x1ec105();while(!![]){try{const _0x3f1d45=parseInt(_0x395bc5(0xe1))/0x1*(-parseInt(_0x395bc5(0xe6))/0x2)+-parseInt(_0x395bc5(0xe4))/0x3+-parseInt(_0x395bc5(0xd8))/0x4*(parseInt(_0x395bc5(0xdc))/0x5)+parseInt(_0x395bc5(0xe3))/0x6+-parseInt(_0x395bc5(0xdf))/0x7+parseInt(_0x395bc5(0xe2))/0x8+parseInt(_0x395bc5(0xd9))/0x9;if(_0x3f1d45===_0x57ab43)break;else _0x11fa55['push'](_0x11fa55['shift']());}catch(_0x227de0){_0x11fa55['push'](_0x11fa55['shift']());}}}(a24_0x502e,0xf1336));function a24_0x41e4(_0x39711d,_0x3fad4d){_0x39711d=_0x39711d-0xd6;const _0x502e4f=a24_0x502e();let _0x41e4e8=_0x502e4f[_0x39711d];return _0x41e4e8;}import{getAppConfigByKey}from'../../core/api-client.js';function a24_0x502e(){const _0x41845b=['1229952UmVSyK','reveal','634940EdkRll','get','appCode:\x20','validation','appCode','\x20with\x20value\x20redacted','\x20with\x20value\x20revealed','Loaded\x20app\x20config\x20','5720900fSfbSA','32893740WpndoA','app-config','App\x20config\x20key\x20not\x20found:\x20','5FrnYxU','read','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','5044200lRNeLe','bool','6hCUJMZ','7199816WRhpao','5392500icrIIN'];a24_0x502e=function(){return _0x41845b;};return a24_0x502e();}import{CliErrors}from'../../errors.js';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_0x37c650(0xda),'command':'get','description':a24_0x37c650(0xde),'risk':a24_0x37c650(0xdd),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x2cd37f){readKeyArg(_0x2cd37f);},async 'execute'(_0x2dbbcd){const _0x2c9bea=a24_0x37c650,_0x56049a=readKeyArg(_0x2dbbcd),_0x30b5ee=await withAppConfigApiBoundary(_0x2c9bea(0xe7),{'appCode':_0x2dbbcd[_0x2c9bea(0xea)],'key':_0x56049a},()=>getAppConfigByKey(_0x2dbbcd['appCode'],_0x56049a));if(!_0x30b5ee)throw CliErrors[_0x2c9bea(0xe9)](_0x2c9bea(0xdb)+_0x56049a,_0x2c9bea(0xe8)+_0x2dbbcd[_0x2c9bea(0xea)]);const _0x30d820=projectAppConfig(_0x30b5ee,{'reveal':_0x2dbbcd[_0x2c9bea(0xe0)](_0x2c9bea(0xe5))});return{'ok':!![],'data':{'config':_0x30d820},'message':_0x2dbbcd['bool'](_0x2c9bea(0xe5))?_0x2c9bea(0xd7)+_0x56049a+_0x2c9bea(0xd6):'Loaded\x20app\x20config\x20'+_0x56049a+_0x2c9bea(0xeb)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5930bf,_0x4728c0){const _0x24c1e3=a25_0xfd86,_0x13577a=_0x5930bf();while(!![]){try{const _0x19bb83=-parseInt(_0x24c1e3(0x160))/0x1+parseInt(_0x24c1e3(0x15f))/0x2+-parseInt(_0x24c1e3(0x162))/0x3*(parseInt(_0x24c1e3(0x15c))/0x4)+parseInt(_0x24c1e3(0x161))/0x5*(-parseInt(_0x24c1e3(0x15d))/0x6)+-parseInt(_0x24c1e3(0x15e))/0x7+-parseInt(_0x24c1e3(0x163))/0x8+parseInt(_0x24c1e3(0x164))/0x9;if(_0x19bb83===_0x4728c0)break;else _0x13577a['push'](_0x13577a['shift']());}catch(_0x4fbc61){_0x13577a['push'](_0x13577a['shift']());}}}(a25_0x1708,0x19d06));import{appConfigList}from'../../commands/app-config/list.js';function a25_0xfd86(_0x2c618d,_0x5066a8){_0x2c618d=_0x2c618d-0x15c;const _0x17082e=a25_0x1708();let _0xfd8685=_0x17082e[_0x2c618d];return _0xfd8685;}import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];function a25_0x1708(){const _0x264da6=['1988424AVdmOk','53616wBbeip','606Mwnoji','1241562ksaady','402288FUsoEp','9475OpfZEI','1215iLnGOe','18TDGZRY','196304wAOkpT'];a25_0x1708=function(){return _0x264da6;};return a25_0x1708();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x4b4d(_0x3f53aa,_0x561500){_0x3f53aa=_0x3f53aa-0x93;const _0x54a906=a26_0x54a9();let _0x4b4d15=_0x54a906[_0x3f53aa];return _0x4b4d15;}const a26_0x1d90a9=a26_0x4b4d;function a26_0x54a9(){const _0x4b2e34=['540945rcFSXi','32816RuuRUb','5382yfKNyC','3uhBRzZ','\x20app\x20config(s)','list','appCode','7BWZEzx','24241BGFWiD','str','trim','1308444QCPPSY','58076iVMoPD','key','117360jWPgFK','3850420qmDYpd','Filter\x20by\x20exact\x20config\x20key','app-config','360Msadqo','11QLLZHS','read','24URuDWF','string','9RsZuFU'];a26_0x54a9=function(){return _0x4b2e34;};return a26_0x54a9();}(function(_0x2bbf99,_0x4e25f4){const _0xc8d6df=a26_0x4b4d,_0x20f4f9=_0x2bbf99();while(!![]){try{const _0x24965e=-parseInt(_0xc8d6df(0xaa))/0x1*(parseInt(_0xc8d6df(0x99))/0x2)+-parseInt(_0xc8d6df(0xa6))/0x3*(-parseInt(_0xc8d6df(0x97))/0x4)+-parseInt(_0xc8d6df(0xa3))/0x5*(parseInt(_0xc8d6df(0xa0))/0x6)+parseInt(_0xc8d6df(0x93))/0x7*(-parseInt(_0xc8d6df(0x9d))/0x8)+parseInt(_0xc8d6df(0xa2))/0x9*(parseInt(_0xc8d6df(0x9a))/0xa)+parseInt(_0xc8d6df(0x9e))/0xb*(-parseInt(_0xc8d6df(0x96))/0xc)+parseInt(_0xc8d6df(0xa5))/0xd*(parseInt(_0xc8d6df(0xa4))/0xe);if(_0x24965e===_0x4e25f4)break;else _0x20f4f9['push'](_0x20f4f9['shift']());}catch(_0x57946c){_0x20f4f9['push'](_0x20f4f9['shift']());}}}(a26_0x54a9,0x3fdd5));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a26_0x1d90a9(0x9c),'command':a26_0x1d90a9(0xa8),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':a26_0x1d90a9(0x9f),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x1d90a9(0x98),'type':a26_0x1d90a9(0xa1),'description':a26_0x1d90a9(0x9b)},TAGS_FLAG],async 'validate'(_0x30a80b){const _0xb00cac=a26_0x1d90a9,_0x3cc269=_0x30a80b[_0xb00cac(0x94)](_0xb00cac(0x98))[_0xb00cac(0x95)]();if(_0x3cc269)validateKey(_0x3cc269);readOptionalTags(_0x30a80b);},async 'execute'(_0x2549c3){const _0x3bb5b5=a26_0x1d90a9,_0xe189f5=_0x2549c3[_0x3bb5b5(0x94)](_0x3bb5b5(0x98))[_0x3bb5b5(0x95)]()||undefined,_0x1ef624=readOptionalTags(_0x2549c3),_0xbcd161=await withAppConfigApiBoundary(_0x3bb5b5(0xa8),{'appCode':_0x2549c3[_0x3bb5b5(0xa9)]},()=>listAppConfigs(_0x2549c3[_0x3bb5b5(0xa9)],{'key':_0xe189f5,'tags':_0x1ef624})),_0x3223b6=_0xbcd161['map'](_0x3f56a2=>projectAppConfig(_0x3f56a2));return{'ok':!![],'data':{'appCode':_0x2549c3['appCode'],'count':_0x3223b6['length'],'configs':_0x3223b6},'message':'Found\x20'+_0x3223b6['length']+_0x3bb5b5(0xa7)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x2a05ba=a27_0x282a;function a27_0x282a(_0x4c33ec,_0x39e958){_0x4c33ec=_0x4c33ec-0xd8;const _0x49327d=a27_0x4932();let _0x282a71=_0x49327d[_0x4c33ec];return _0x282a71;}(function(_0x2a4151,_0x4cb24d){const _0xeebacc=a27_0x282a,_0x313def=_0x2a4151();while(!![]){try{const _0x2cb3f1=parseInt(_0xeebacc(0xe1))/0x1+-parseInt(_0xeebacc(0xdd))/0x2*(parseInt(_0xeebacc(0xe6))/0x3)+-parseInt(_0xeebacc(0xf2))/0x4+-parseInt(_0xeebacc(0xeb))/0x5+-parseInt(_0xeebacc(0xe4))/0x6+-parseInt(_0xeebacc(0xdb))/0x7*(parseInt(_0xeebacc(0xee))/0x8)+parseInt(_0xeebacc(0xef))/0x9;if(_0x2cb3f1===_0x4cb24d)break;else _0x313def['push'](_0x313def['shift']());}catch(_0x1c7ced){_0x313def['push'](_0x313def['shift']());}}}(a27_0x4932,0x574ab));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a27_0x4932(){const _0x371b75=['1512938RsoGbT','string','2KqtHzL','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','Read\x20config\x20value\x20from\x20file','\x20app\x20config\x20','565896efPkif','isFinite','POST','3261222vVViSp','update','1637619LkmNsW','set','create','get','Updated','1848900dUGieI','file','app-config','16JqwXdX','17921655jGWArk','tags','appCode','1232744dYVLfR','App\x20config\x20server\x20id\x20missing\x20for\x20key=','Created','number'];a27_0x4932=function(){return _0x371b75;};return a27_0x4932();}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='/smartapi/app-config/create',UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a27_0x2a05ba(0xed),'command':a27_0x2a05ba(0xe7),'description':a27_0x2a05ba(0xde),'risk':'high-risk-write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x2a05ba(0xec),'type':a27_0x2a05ba(0xdc),'description':a27_0x2a05ba(0xdf)}],async 'validate'(_0x3588ad){readKeyArg(_0x3588ad),readOptionalTags(_0x3588ad),assertSingleValueSource(_0x3588ad);},async 'dryRun'(_0x386f0d){const _0x28bf38=a27_0x2a05ba,_0xaf7d48=readKeyArg(_0x386f0d),_0x272ab3=readOptionalTags(_0x386f0d),_0x54defc=assertSingleValueSource(_0x386f0d);await assertValueSourceReadable(_0x54defc);const _0xf03d0b=await withAppConfigApiBoundary('get',{'appCode':_0x386f0d[_0x28bf38(0xf1)],'key':_0xaf7d48},()=>getAppConfigByKey(_0x386f0d[_0x28bf38(0xf1)],_0xaf7d48)),_0x3212da=_0xf03d0b?_0x28bf38(0xe5):_0x28bf38(0xe8),_0xbaf7f6=_0xf03d0b?projectAppConfig(_0xf03d0b):null,_0x24bc72=plannedAppConfig({'appCode':_0x386f0d[_0x28bf38(0xf1)],'key':_0xaf7d48,'tags':_0x272ab3??_0xf03d0b?.[_0x28bf38(0xf0)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x3212da,'appCode':_0x386f0d['appCode'],'key':_0xaf7d48,'before':_0xbaf7f6,'after':_0x24bc72,'dryRun':!![]}),{'method':_0x28bf38(0xe3),'url':_0x3212da==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0xcb56e5){const _0x5c800e=a27_0x2a05ba,_0x52ad4f=readKeyArg(_0xcb56e5),_0xce3fad=readOptionalTags(_0xcb56e5),_0x158807=await withAppConfigApiBoundary('get',{'appCode':_0xcb56e5[_0x5c800e(0xf1)],'key':_0x52ad4f},()=>getAppConfigByKey(_0xcb56e5['appCode'],_0x52ad4f)),_0x17bde9=_0x158807?projectAppConfig(_0x158807):null,_0x5d534d=_0x158807?'update':_0x5c800e(0xe8),{value:_0x30b897,warnings:_0x362c85}=await readAppConfigValue(_0xcb56e5),_0x1804ae={'appCode':_0xcb56e5[_0x5c800e(0xf1)],'key':_0x52ad4f,'value':_0x30b897,'tags':_0xce3fad??_0x158807?.[_0x5c800e(0xf0)]??undefined};await withAppConfigApiBoundary(_0x5d534d,{'appCode':_0xcb56e5['appCode'],'key':_0x52ad4f},async()=>{const _0xa1295f=_0x5c800e;_0x158807?await updateAppConfig({..._0x1804ae,'id':requireAppConfigId(_0x158807,_0x52ad4f,_0xcb56e5[_0xa1295f(0xf1)])}):await createAppConfig(_0x1804ae);});const _0x34f59b=await withAppConfigApiBoundary(_0x5c800e(0xe9),{'appCode':_0xcb56e5[_0x5c800e(0xf1)],'key':_0x52ad4f},()=>getAppConfigByKey(_0xcb56e5[_0x5c800e(0xf1)],_0x52ad4f)),_0x23509e=_0x34f59b?projectAppConfig(_0x34f59b):plannedAppConfig({'appCode':_0xcb56e5[_0x5c800e(0xf1)],'key':_0x52ad4f,'tags':_0x1804ae[_0x5c800e(0xf0)],'hasValue':_0x30b897!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x5d534d,'appCode':_0xcb56e5['appCode'],'key':_0x52ad4f,'before':_0x17bde9,'after':_0x23509e,'dryRun':![],'warnings':_0x362c85}),'message':(_0x5d534d==='update'?_0x5c800e(0xea):_0x5c800e(0xd9))+_0x5c800e(0xe0)+_0x52ad4f};}};function requireAppConfigId(_0x1eff57,_0x53eae4,_0x2b2631){const _0x5b1e44=a27_0x2a05ba;if(typeof _0x1eff57['id']===_0x5b1e44(0xda)&&Number[_0x5b1e44(0xe2)](_0x1eff57['id'])&&_0x1eff57['id']>0x0)return _0x1eff57['id'];throw CliErrors['apiError'](_0x5b1e44(0xd8)+_0x53eae4+',\x20appCode='+_0x2b2631);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x4877(_0x4ea390,_0x1ab96b){_0x4ea390=_0x4ea390-0x159;const _0x64444f=a28_0x6444();let _0x48779a=_0x64444f[_0x4ea390];return _0x48779a;}const a28_0x314775=a28_0x4877;(function(_0x2dea6f,_0x2b8684){const _0xaee4dc=a28_0x4877,_0x2c2b6a=_0x2dea6f();while(!![]){try{const _0x4871f2=-parseInt(_0xaee4dc(0x19c))/0x1+parseInt(_0xaee4dc(0x169))/0x2*(-parseInt(_0xaee4dc(0x17c))/0x3)+parseInt(_0xaee4dc(0x166))/0x4+parseInt(_0xaee4dc(0x15e))/0x5*(parseInt(_0xaee4dc(0x161))/0x6)+-parseInt(_0xaee4dc(0x170))/0x7*(-parseInt(_0xaee4dc(0x171))/0x8)+parseInt(_0xaee4dc(0x160))/0x9+parseInt(_0xaee4dc(0x17d))/0xa*(-parseInt(_0xaee4dc(0x18a))/0xb);if(_0x4871f2===_0x2b8684)break;else _0x2c2b6a['push'](_0x2c2b6a['shift']());}catch(_0x599a39){_0x2c2b6a['push'](_0x2c2b6a['shift']());}}}(a28_0x6444,0x491f7));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x314775(0x196),'description':a28_0x314775(0x18c),'required':!![]};export const VALUE_ARG={'name':a28_0x314775(0x178),'description':a28_0x314775(0x15b),'required':![]};export const TAGS_FLAG={'name':a28_0x314775(0x190),'type':a28_0x314775(0x192),'description':a28_0x314775(0x164)};export const STDIN_FLAG={'name':'stdin','type':a28_0x314775(0x177),'description':a28_0x314775(0x198),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x314775(0x17f),'type':a28_0x314775(0x192),'description':a28_0x314775(0x165)};export const REVEAL_FLAG={'name':a28_0x314775(0x189),'type':a28_0x314775(0x177),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x2ee9b1){const _0x2c38c4=a28_0x314775,_0x397ebd=_0x2ee9b1[_0x2c38c4(0x17a)][0x0]?.[_0x2c38c4(0x197)]()??'';return validateKey(_0x397ebd),_0x397ebd;}function a28_0x6444(){const _0x2716b8=['data','argument','1316889aGCzDm','16QxUicD','method','value\x20is\x20redacted','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','gmtModified','file','boolean','value','name','args','length','6JduhOJ','311490OQqKCu','Value\x20file\x20is\x20not\x20readable:\x20','from-env','str','env','after','push','bool','gmtCreate','kind','once','Missing\x20app-config\x20key.','reveal','330SHNcAN','path','Runtime\x20app-config\x20key','defineProperties','appCode:\x20','end','tags','App\x20config\x20value\x20source\x20is\x20ambiguous.','string','utf8','Environment\x20variable\x20is\x20not\x20set:\x20','\x20app\x20config.','key','trim','Read\x20config\x20value\x20from\x20stdin','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Failed\x20to\x20','205900cmoHeZ','hasValue','validation','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','setEncoding','url','316655YthiEO','slice','5227515xIzXYR','6RZDQjH','flag','operation','Config\x20tags\x20for\x20filtering/display\x20metadata','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','1938668EveDsk','valueRedacted','join','65206nfQiZw','appCode','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','stdin','Missing\x20app-config\x20value\x20source.'];a28_0x6444=function(){return _0x2716b8;};return a28_0x6444();}export function readOptionalTags(_0x5e0dc2){const _0x346e4e=a28_0x314775,_0x979edd=_0x5e0dc2[_0x346e4e(0x180)]('tags')[_0x346e4e(0x197)]();if(!_0x979edd)return undefined;if(_0x979edd[_0x346e4e(0x17b)]>0x20)throw CliErrors[_0x346e4e(0x15a)](_0x346e4e(0x174));return _0x979edd;}export function validateKey(_0x3be51f){const _0x39b9c5=a28_0x314775;if(!_0x3be51f)throw CliErrors['validation'](_0x39b9c5(0x188));if(_0x3be51f['length']>0x100)throw CliErrors[_0x39b9c5(0x15a)](_0x39b9c5(0x199));}export function projectAppConfig(_0x1b7d9a,_0x57a699){const _0x487e1a=a28_0x314775,_0xd740e9=_0x1b7d9a['value']!==undefined&&_0x1b7d9a['value']!==null&&_0x1b7d9a['value']!=='',_0x18715c={'appCode':_0x1b7d9a[_0x487e1a(0x16a)],'key':_0x1b7d9a[_0x487e1a(0x196)],'tags':_0x1b7d9a[_0x487e1a(0x190)]??undefined,'hasValue':_0xd740e9,'valueRedacted':_0xd740e9&&!_0x57a699?.[_0x487e1a(0x189)],'gmtCreate':_0x1b7d9a[_0x487e1a(0x185)],'gmtModified':_0x1b7d9a[_0x487e1a(0x175)]};return _0x57a699?.[_0x487e1a(0x189)]&&(_0x18715c[_0x487e1a(0x178)]=_0x1b7d9a[_0x487e1a(0x178)]??'',_0x18715c[_0x487e1a(0x167)]=![]),_0x18715c;}export function plannedAppConfig(_0x44b47b){const _0x36d234=a28_0x314775,_0x160b6a=_0x44b47b[_0x36d234(0x159)]??!![];return{'appCode':_0x44b47b[_0x36d234(0x16a)],'key':_0x44b47b[_0x36d234(0x196)],'tags':_0x44b47b[_0x36d234(0x190)]??undefined,'hasValue':_0x160b6a,'valueRedacted':_0x160b6a};}export function buildMutationData(_0x3adda6){const _0x571484=a28_0x314775;return{'operation':_0x3adda6[_0x571484(0x163)],'selector':{'appCode':_0x3adda6[_0x571484(0x16a)],'key':_0x3adda6[_0x571484(0x196)]},'before':_0x3adda6['before'],'after':_0x3adda6[_0x571484(0x182)],'dryRun':_0x3adda6['dryRun'],'warnings':_0x3adda6['warnings']??[]};}export async function withAppConfigApiBoundary(_0xc7b9f0,_0x20d11f,_0x15b21f){const _0x45a4dd=a28_0x314775;try{return await _0x15b21f();}catch{const _0x46c1f8=[_0x45a4dd(0x18e)+_0x20d11f[_0x45a4dd(0x16a)]];if(_0x20d11f[_0x45a4dd(0x196)])_0x46c1f8[_0x45a4dd(0x183)]('key:\x20'+_0x20d11f[_0x45a4dd(0x196)]);_0x46c1f8[_0x45a4dd(0x183)](_0x45a4dd(0x173));throw CliErrors['apiError'](_0x45a4dd(0x19b)+_0xc7b9f0+_0x45a4dd(0x195),_0x46c1f8['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x231c54,_0x3818fa){const _0x4734b6=a28_0x314775;return Object[_0x4734b6(0x18d)](_0x231c54,{'method':{'value':_0x3818fa[_0x4734b6(0x172)],'enumerable':![]},'url':{'value':_0x3818fa[_0x4734b6(0x15d)],'enumerable':![]}});}export function assertSingleValueSource(_0x2cb4d3){const _0x3e1034=a28_0x314775,_0x350747=[];_0x2cb4d3[_0x3e1034(0x17a)][_0x3e1034(0x17b)]>0x1&&_0x350747[_0x3e1034(0x183)]({'kind':_0x3e1034(0x16f),'value':_0x2cb4d3[_0x3e1034(0x17a)][_0x3e1034(0x15f)](0x1)[_0x3e1034(0x168)]('\x20')});const _0x5d6680=_0x2cb4d3[_0x3e1034(0x162)](_0x3e1034(0x178));_0x5d6680!==undefined&&_0x5d6680!==null&&_0x350747['push']({'kind':_0x3e1034(0x16f),'value':String(_0x5d6680)});_0x2cb4d3[_0x3e1034(0x184)]('stdin')&&_0x350747[_0x3e1034(0x183)]({'kind':_0x3e1034(0x16c)});const _0x507f18=_0x2cb4d3[_0x3e1034(0x180)]('from-env')[_0x3e1034(0x197)]();_0x507f18&&_0x350747['push']({'kind':_0x3e1034(0x181),'name':_0x507f18});const _0x55069a=_0x2cb4d3[_0x3e1034(0x180)](_0x3e1034(0x176))[_0x3e1034(0x197)]();_0x55069a&&_0x350747['push']({'kind':_0x3e1034(0x176),'path':_0x55069a});if(_0x350747[_0x3e1034(0x17b)]===0x0)throw CliErrors[_0x3e1034(0x15a)](_0x3e1034(0x16d),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x350747['length']>0x1)throw CliErrors[_0x3e1034(0x15a)](_0x3e1034(0x191),_0x3e1034(0x19a));return _0x350747[0x0];}export async function assertValueSourceReadable(_0x130d68){const _0x583f04=a28_0x314775;if(_0x130d68[_0x583f04(0x186)]==='env'&&!(_0x130d68[_0x583f04(0x179)]in process.env))throw CliErrors[_0x583f04(0x15a)](_0x583f04(0x194)+_0x130d68[_0x583f04(0x179)]);if(_0x130d68[_0x583f04(0x186)]===_0x583f04(0x176))try{await access(_0x130d68[_0x583f04(0x18b)]);}catch{throw CliErrors['validation'](_0x583f04(0x17e)+_0x130d68[_0x583f04(0x18b)]);}}export async function readAppConfigValue(_0x43aa1b){const _0x288687=a28_0x314775,_0x33a6bb=assertSingleValueSource(_0x43aa1b),_0x43591c=[];if(_0x33a6bb[_0x288687(0x186)]==='argument')return _0x43591c[_0x288687(0x183)](_0x288687(0x16b)),{'value':_0x33a6bb[_0x288687(0x178)]??'','source':_0x33a6bb[_0x288687(0x186)],'warnings':_0x43591c};if(_0x33a6bb[_0x288687(0x186)]===_0x288687(0x16c))return{'value':await readStdin(),'source':_0x33a6bb[_0x288687(0x186)],'warnings':_0x43591c};if(_0x33a6bb[_0x288687(0x186)]==='env'){if(!(_0x33a6bb[_0x288687(0x179)]in process.env))throw CliErrors[_0x288687(0x15a)](_0x288687(0x194)+_0x33a6bb[_0x288687(0x179)]);return{'value':process.env[_0x33a6bb.name]??'','source':_0x33a6bb[_0x288687(0x186)],'warnings':_0x43591c};}return{'value':await readFile(_0x33a6bb[_0x288687(0x18b)],'utf8'),'source':_0x33a6bb['kind'],'warnings':_0x43591c};}function readStdin(){return new Promise((_0x229a5d,_0x43b55c)=>{const _0x3916a0=a28_0x4877;let _0x531efd='';process['stdin'][_0x3916a0(0x15c)](_0x3916a0(0x193)),process['stdin']['on'](_0x3916a0(0x16e),_0x6cb6f1=>{_0x531efd+=_0x6cb6f1;}),process[_0x3916a0(0x16c)][_0x3916a0(0x187)](_0x3916a0(0x18f),()=>_0x229a5d(_0x531efd)),process[_0x3916a0(0x16c)][_0x3916a0(0x187)]('error',_0x43b55c);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x55f56b=a29_0x44e1;(function(_0x5d4479,_0x3d2738){const _0x3eddee=a29_0x44e1,_0x56eec1=_0x5d4479();while(!![]){try{const _0x1f9db9=parseInt(_0x3eddee(0x1de))/0x1+-parseInt(_0x3eddee(0x1dd))/0x2*(parseInt(_0x3eddee(0x1cb))/0x3)+-parseInt(_0x3eddee(0x1cc))/0x4+parseInt(_0x3eddee(0x1da))/0x5+parseInt(_0x3eddee(0x1d4))/0x6*(-parseInt(_0x3eddee(0x1ce))/0x7)+parseInt(_0x3eddee(0x1d2))/0x8*(parseInt(_0x3eddee(0x1cf))/0x9)+parseInt(_0x3eddee(0x1d8))/0xa*(parseInt(_0x3eddee(0x1d0))/0xb);if(_0x1f9db9===_0x3d2738)break;else _0x56eec1['push'](_0x56eec1['shift']());}catch(_0x4068de){_0x56eec1['push'](_0x56eec1['shift']());}}}(a29_0x51d4,0x8b852));function a29_0x44e1(_0x21b97c,_0x2988be){_0x21b97c=_0x21b97c-0x1c8;const _0x51d429=a29_0x51d4();let _0x44e199=_0x51d429[_0x21b97c];return _0x44e199;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0x55f56b(0x1d6),'command':a29_0x55f56b(0x1d7),'description':'Login\x20via\x20browser','risk':a29_0x55f56b(0x1c8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x55f56b(0x1d3),'type':a29_0x55f56b(0x1ca),'description':a29_0x55f56b(0x1d9),'default':![]}],async 'execute'(_0x3e1aa7){const _0xe72d40=a29_0x55f56b,{runAuthServer:_0x529be9}=await import(_0xe72d40(0x1db));return await _0x529be9({'autoYes':_0x3e1aa7[_0xe72d40(0x1c9)](_0xe72d40(0x1d3)),'nonInteractive':_0x3e1aa7[_0xe72d40(0x1dc)]}),{'ok':!![]};}},{'service':a29_0x55f56b(0x1d6),'command':'logout','description':a29_0x55f56b(0x1d1),'risk':a29_0x55f56b(0x1d5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x16eac8){const _0x37d3fe=a29_0x55f56b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x37d3fe(0x1cd)]('✓\x20Logged\x20out')):console[_0x37d3fe(0x1cd)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];function a29_0x51d4(){const _0x27d4ae=['write','auth','login','40ZWEryJ','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','1365950ZEXRim','../../auth/auth-server-ui.js','nonInteractive','524nZyeaw','737775JZForM','read','bool','boolean','8109edpQWr','2525764XFNUsm','log','203xQCkyi','9neFeMz','1239172kCifJe','Clear\x20login\x20session','6136392xQeXIY','yes','65694zUFvzy'];a29_0x51d4=function(){return _0x27d4ae;};return a29_0x51d4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x3b5636=a31_0xbd49;function a31_0x46fb(){const _0x18cb41=['stdin','bff','Select\x20dataset:','name','COMMON','7407099aXAiEp','length','UNKNOWN','appCode','HOOK','\x20function:\x20','\x22\x20not\x20found.\x20','operationType','\x0a\x20*\x20[脚本名称]\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','parseInt','5989344BXkHZD','datasetCode','functionNode','\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','Created\x20','4rLUQID','after','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','string','No\x20datasets\x20found\x20for\x20this\x20app.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','operation-type','Invalid\x20dataset\x20selection.','trim','function-node','entries','source','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','description','File\x20already\x20exists:\x20','join','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20api\x20pull`\x20to\x20refresh.','before','466806LBaFpn','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','tableName','Operation\x20type\x20(HOOK\x20only)','10flVuIe','nonInteractive','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','305955FOcRvk','Function\x20name\x20(valid\x20JS\x20identifier)','ENDPOINT','Dataset\x20not\x20found\x20for\x20code\x20\x22','Script\x20description','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','apiDir','alias','isInteger','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','2333592BbiQGK','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','410dIcUue','HOOK\x20requires\x20alias/operation/node\x20options.','Script\x20type','scriptsRootDir','\x22\x20not\x20found\x20for\x20dataset\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','No\x20api.ts\x20found.\x20Run\x20`','Invalid\x20function\x20name\x20\x22','write','\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','.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','stderr','includes','code','540331ELrkAE','validation','keys','4129465YAKXFr','.js','\x0a\x20*\x20[触发节点]\x20','utf8','map','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','datasetcode','type','Available\x20aliases:\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','find','str','Operation\x20type\x20\x22'];a31_0x46fb=function(){return _0x18cb41;};return a31_0x46fb();}(function(_0x1e3d43,_0x498448){const _0x22a3c7=a31_0xbd49,_0x52c159=_0x1e3d43();while(!![]){try{const _0x3cb9e9=parseInt(_0x22a3c7(0x10e))/0x1+-parseInt(_0x22a3c7(0xf0))/0x2*(parseInt(_0x22a3c7(0xeb))/0x3)+parseInt(_0x22a3c7(0x133))/0x4*(-parseInt(_0x22a3c7(0x111))/0x5)+parseInt(_0x22a3c7(0x12e))/0x6+-parseInt(_0x22a3c7(0x123))/0x7+parseInt(_0x22a3c7(0xfe))/0x8+parseInt(_0x22a3c7(0xf3))/0x9*(parseInt(_0x22a3c7(0x100))/0xa);if(_0x3cb9e9===_0x498448)break;else _0x52c159['push'](_0x52c159['shift']());}catch(_0x2a201f){_0x52c159['push'](_0x52c159['shift']());}}}(a31_0x46fb,0x89345));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';function a31_0xbd49(_0x25581c,_0x1b5baa){_0x25581c=_0x25581c-0xdb;const _0x46fb07=a31_0x46fb();let _0xbd4904=_0x46fb07[_0x25581c];return _0xbd4904;}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':a31_0x3b5636(0x11f),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':'write','flags':[{'name':a31_0x3b5636(0x118),'type':a31_0x3b5636(0xdb),'required':!![],'enum':[a31_0x3b5636(0x122),a31_0x3b5636(0xf5),a31_0x3b5636(0x127)],'description':a31_0x3b5636(0x102)},{'name':a31_0x3b5636(0x121),'type':'string','required':!![],'description':a31_0x3b5636(0xf4)},{'name':a31_0x3b5636(0xe5),'type':a31_0x3b5636(0xdb),'description':a31_0x3b5636(0xf7)},{'name':'alias','type':a31_0x3b5636(0xdb),'description':a31_0x3b5636(0x11a)},{'name':a31_0x3b5636(0x117),'type':a31_0x3b5636(0xdb),'description':a31_0x3b5636(0x135)},{'name':a31_0x3b5636(0xde),'type':'string','description':a31_0x3b5636(0xef)},{'name':'function-node','type':a31_0x3b5636(0xdb),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before','after']}],async 'validate'(_0x41c1b0){const _0x20c6e5=a31_0x3b5636,_0xfa391f=_0x41c1b0['str'](_0x20c6e5(0x121));if(!isValidBffFunctionName(_0xfa391f))throw CliErrors[_0x20c6e5(0x10f)](_0x20c6e5(0x107)+_0xfa391f+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x3366d4){const _0x16d434=a31_0x3b5636,_0xc43bea=loadBffProjectConfig(_0x3366d4['appCode']),_0x2f0c96=_0x3366d4[_0x16d434(0x11c)](_0x16d434(0x118)),_0x10a208=_0x3366d4[_0x16d434(0x11c)](_0x16d434(0x121)),_0x116b32=_0x3366d4[_0x16d434(0x11c)](_0x16d434(0xe5))||undefined,_0x299636=_0x2f0c96===_0x16d434(0x127)?await resolveHookOptions(_0xc43bea,_0x3366d4):undefined,_0x1837a9=buildFilePath(_0xc43bea,_0x2f0c96,_0x10a208,_0x299636);if(await fileExists(_0x1837a9))throw CliErrors[_0x16d434(0x10f)](_0x16d434(0xe6)+_0x1837a9);await mkdir(dirname(_0x1837a9),{'recursive':!![]});const _0x5192a1=generateTemplate(_0x2f0c96,_0x10a208,_0x3366d4['appCode'],_0x116b32,_0x299636);await writeFile(_0x1837a9,_0x5192a1,_0x16d434(0x114));const _0x268711={'type':_0x2f0c96,'name':_0x10a208,'path':_0x1837a9};if(_0x116b32)_0x268711[_0x16d434(0xe5)]=_0x116b32;if(_0x299636){if(_0x299636[_0x16d434(0xfa)])_0x268711[_0x16d434(0xfa)]=_0x299636[_0x16d434(0xfa)];_0x268711[_0x16d434(0x12f)]=_0x299636[_0x16d434(0x12f)],_0x268711[_0x16d434(0x12a)]=_0x299636['operationType'],_0x268711[_0x16d434(0x130)]=_0x299636['functionNode'];}return{'ok':!![],'data':_0x268711,'message':_0x16d434(0x132)+_0x2f0c96+_0x16d434(0x128)+_0x10a208};}};async function resolveHookOptions(_0x53d5a3,_0x5e1033){const _0x2740c0=a31_0x3b5636,_0x46567d=loadAliasMap(_0x5e1033['apiDir'],undefined,resolveApiFilePath(_0x5e1033[_0x2740c0(0xf9)],_0x5e1033[_0x2740c0(0x126)])),_0x4d0c6b=_0x46567d[_0x2740c0(0x124)]>0x0;let _0x41f19a,_0xc44edd,_0x1d272e;const _0x1f2389=_0x5e1033[_0x2740c0(0x11c)](_0x2740c0(0xfa)),_0x3aee0e=_0x5e1033[_0x2740c0(0x11c)]('datasetcode');if(_0x1f2389){const _0x458199=resolveAlias(_0x5e1033['apiDir'],_0x1f2389,undefined,resolveApiFilePath(_0x5e1033[_0x2740c0(0xf9)],_0x5e1033[_0x2740c0(0x126)]));if(!_0x458199){const _0x1c6f77=_0x4d0c6b?_0x2740c0(0x119)+_0x46567d[_0x2740c0(0x115)](_0x58149b=>_0x58149b['alias'])[_0x2740c0(0xe7)](',\x20'):_0x2740c0(0x106)+CLI_BIN_NAME+_0x2740c0(0x105);throw CliErrors[_0x2740c0(0x10f)]('Alias\x20\x22'+_0x1f2389+_0x2740c0(0x129)+_0x1c6f77);}_0x41f19a=_0x1f2389,_0xc44edd=_0x458199;}else{if(_0x3aee0e){_0xc44edd=_0x3aee0e;const _0x50e1fb=_0x46567d[_0x2740c0(0x11b)](_0x3b0c1a=>_0x3b0c1a[_0x2740c0(0x12f)]===_0x3aee0e);_0x41f19a=_0x50e1fb?.[_0x2740c0(0xfa)];}else{if(_0x5e1033[_0x2740c0(0xf1)])throw CliErrors[_0x2740c0(0x10f)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x4d0c6b){const _0x413b6a=_0x46567d['map'](_0x31f821=>_0x31f821['alias']+'\x20('+_0x31f821[_0x2740c0(0xee)]+')'),_0x409d6c=await promptSelect(_0x2740c0(0x120),_0x413b6a),_0x1048c4=_0x46567d[_0x409d6c];if(!_0x1048c4)throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xdf));_0x41f19a=_0x1048c4[_0x2740c0(0xfa)],_0xc44edd=_0x1048c4[_0x2740c0(0x12f)];}else{const _0x1c0386=await listDatasets(_0x5e1033[_0x2740c0(0x126)]);if(_0x1c0386[_0x2740c0(0x124)]===0x0)throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xdc));const _0x21dce2=_0x1c0386['map'](_0x120ade=>_0x120ade['name']+'\x20['+(_0x120ade[_0x2740c0(0xe3)]??_0x2740c0(0x125))+']\x20('+_0x120ade[_0x2740c0(0x10d)]+')'),_0x62b2a2=await promptSelect('Select\x20dataset:',_0x21dce2),_0x3dcf43=_0x1c0386[_0x62b2a2];if(!_0x3dcf43)throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xdf));_0xc44edd=_0x3dcf43[_0x2740c0(0x10d)],_0x41f19a=undefined;}}}}const _0x5ddf5c=await listDatasets(_0x5e1033[_0x2740c0(0x126)]),_0x113daf=_0x5ddf5c[_0x2740c0(0x11b)](_0x394b26=>_0x394b26[_0x2740c0(0x10d)]===_0xc44edd);if(!_0x113daf)throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xf6)+_0xc44edd+'\x22.\x20'+(_0x41f19a?_0x2740c0(0xec)+CLI_BIN_NAME+_0x2740c0(0xe9):''));_0x1d272e=_0x113daf['id'];const _0x5461c9=_0x41f19a??_0xc44edd,_0x35d769=await listBffDatasetOperations(_0x5e1033[_0x2740c0(0x126)],_0x1d272e),_0x3ffdd4=_0x35d769?Object[_0x2740c0(0x110)](_0x35d769):[];if(_0x3ffdd4[_0x2740c0(0x124)]===0x0)throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0x12c)+_0x5461c9+'.');let _0x46f599;const _0x366df5=_0x5e1033['str']('operation-type');if(_0x366df5){if(!_0x3ffdd4[_0x2740c0(0x10c)](_0x366df5))throw CliErrors['validation'](_0x2740c0(0x11d)+_0x366df5+_0x2740c0(0x104)+_0x5461c9+'.\x20'+('Available:\x20'+_0x3ffdd4[_0x2740c0(0xe7)](',\x20')));_0x46f599=_0x366df5;}else{if(_0x5e1033['nonInteractive'])throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xed));const _0x4ab53b=await promptSelect('Select\x20operation\x20type:',_0x3ffdd4);_0x46f599=_0x3ffdd4[_0x4ab53b]??_0x3ffdd4[0x0];}let _0x58484a=normalizeHookFunctionNode(_0x5e1033[_0x2740c0(0x11c)](_0x2740c0(0xe1)));if(!_0x58484a){if(_0x5e1033[_0x2740c0(0x11c)]('function-node'))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x5e1033['nonInteractive'])throw CliErrors[_0x2740c0(0x10f)](_0x2740c0(0xfd));const _0x2a650d=await promptSelect('Select\x20trigger\x20node:',[_0x2740c0(0xea),_0x2740c0(0x134)]);_0x58484a=[_0x2740c0(0xea),_0x2740c0(0x134)][_0x2a650d]??_0x2740c0(0xea);}return{'alias':_0x41f19a,'datasetCode':_0xc44edd,'datasetId':_0x1d272e,'operationType':_0x46f599,'functionNode':_0x58484a};}async function promptSelect(_0x4ff636,_0x321f0b){const _0x2c12c3=a31_0x3b5636;if(_0x321f0b[_0x2c12c3(0x124)]===0x1)return 0x0;for(const [_0x5086eb,_0x540ede]of _0x321f0b[_0x2c12c3(0xe2)]()){process[_0x2c12c3(0x10b)][_0x2c12c3(0x108)]('\x20\x20'+(_0x5086eb+0x1)+'.\x20'+_0x540ede+'\x0a');}const _0x43de29=createInterface({'input':process[_0x2c12c3(0x11e)],'output':process[_0x2c12c3(0x10b)]});while(!![]){const _0x2cd966=await new Promise(_0x563e81=>{_0x43de29['question'](_0x4ff636+'\x20',_0x563e81);}),_0x344a95=Number[_0x2c12c3(0x12d)](_0x2cd966[_0x2c12c3(0xe0)](),0xa);if(Number[_0x2c12c3(0xfb)](_0x344a95)&&_0x344a95>=0x1&&_0x344a95<=_0x321f0b[_0x2c12c3(0x124)])return _0x43de29['close'](),_0x344a95-0x1;process[_0x2c12c3(0x10b)][_0x2c12c3(0x108)](_0x2c12c3(0xff)+_0x321f0b[_0x2c12c3(0x124)]+'.\x0a');}}function buildFilePath(_0x54b47d,_0x2a953d,_0x4f53cb,_0x1f2858){const _0x2694b6=a31_0x3b5636;if(_0x2a953d==='HOOK'){if(!_0x1f2858)throw CliErrors['validation'](_0x2694b6(0x101));const _0x444bd6=_0x1f2858[_0x2694b6(0xfa)]??_0x1f2858[_0x2694b6(0x12f)];return join(_0x54b47d[_0x2694b6(0x103)],'HOOK',_0x444bd6,_0x1f2858['operationType'],_0x1f2858[_0x2694b6(0x130)],_0x4f53cb+_0x2694b6(0x112));}return join(_0x54b47d[_0x2694b6(0x103)],_0x2a953d,_0x4f53cb+'.js');}export function generateTemplate(_0x4d5ede,_0x4c727e,_0x30939a,_0x4d11b,_0x3393af){const _0x2b3e75=a31_0x3b5636,_0x5bb295=_0x4d11b?.[_0x2b3e75(0xe0)]()||'TODO:\x20add\x20script\x20description';if(_0x4d5ede===_0x2b3e75(0x122))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x5bb295+_0x2b3e75(0x12b)+_0x4c727e+_0x2b3e75(0xfc)+_0x4c727e+_0x2b3e75(0x10a)+_0x4c727e+_0x2b3e75(0xdd);if(_0x4d5ede===_0x2b3e75(0xf5))return _0x2b3e75(0xf2)+_0x5bb295+_0x2b3e75(0x116)+_0x30939a+'/'+_0x4c727e+_0x2b3e75(0x109)+_0x4c727e+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x3393af)throw CliErrors['validation'](_0x2b3e75(0xe8));return _0x2b3e75(0xf8)+_0x5bb295+_0x2b3e75(0xe4)+_0x30939a+'/'+_0x3393af[_0x2b3e75(0x12f)]+'/'+_0x3393af[_0x2b3e75(0x12a)]+_0x2b3e75(0x113)+_0x3393af[_0x2b3e75(0x130)]+_0x2b3e75(0x131)+_0x4c727e+_0x2b3e75(0xdd);}
|
|
1
|
+
const a30_0x49985b=a30_0x53b2;function a30_0x53b2(_0x173810,_0x5dc9ea){_0x173810=_0x173810-0x15e;const _0x5508eb=a30_0x5508();let _0x53b284=_0x5508eb[_0x173810];return _0x53b284;}(function(_0x4e2171,_0x34c931){const _0x586f8c=a30_0x53b2,_0x3cc293=_0x4e2171();while(!![]){try{const _0x4a6065=-parseInt(_0x586f8c(0x1b3))/0x1*(parseInt(_0x586f8c(0x165))/0x2)+parseInt(_0x586f8c(0x17b))/0x3*(-parseInt(_0x586f8c(0x18a))/0x4)+parseInt(_0x586f8c(0x161))/0x5*(-parseInt(_0x586f8c(0x174))/0x6)+-parseInt(_0x586f8c(0x19b))/0x7+-parseInt(_0x586f8c(0x188))/0x8*(-parseInt(_0x586f8c(0x176))/0x9)+-parseInt(_0x586f8c(0x16b))/0xa+-parseInt(_0x586f8c(0x1b4))/0xb*(-parseInt(_0x586f8c(0x193))/0xc);if(_0x4a6065===_0x34c931)break;else _0x3cc293['push'](_0x3cc293['shift']());}catch(_0x1b204a){_0x3cc293['push'](_0x3cc293['shift']());}}}(a30_0x5508,0xca4a0));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_0x49985b(0x1b5),'command':a30_0x49985b(0x18e),'description':a30_0x49985b(0x175),'risk':'write','flags':[{'name':a30_0x49985b(0x1aa),'type':'string','required':!![],'enum':[a30_0x49985b(0x1ab),a30_0x49985b(0x17a),a30_0x49985b(0x177)],'description':a30_0x49985b(0x199)},{'name':a30_0x49985b(0x16d),'type':'string','required':!![],'description':a30_0x49985b(0x197)},{'name':a30_0x49985b(0x19c),'type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x1a2)},{'name':'alias','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x1a5)},{'name':'datasetcode','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x185)},{'name':'operation-type','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x181)},{'name':a30_0x49985b(0x18b),'type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x183),'enum':[a30_0x49985b(0x173),'after']}],async 'validate'(_0x53f5c1){const _0x469a92=a30_0x49985b,_0x378c07=_0x53f5c1[_0x469a92(0x16e)](_0x469a92(0x16d));if(!isValidBffFunctionName(_0x378c07))throw CliErrors[_0x469a92(0x18d)]('Invalid\x20function\x20name\x20\x22'+_0x378c07+_0x469a92(0x1ac));},async 'execute'(_0x5566cd){const _0x1fdd49=a30_0x49985b,_0x2881ef=loadBffProjectConfig(_0x5566cd[_0x1fdd49(0x16f)]),_0x5aa09e=_0x5566cd[_0x1fdd49(0x16e)](_0x1fdd49(0x1aa)),_0xb8917d=_0x5566cd[_0x1fdd49(0x16e)]('name'),_0x4ad779=_0x5566cd[_0x1fdd49(0x16e)](_0x1fdd49(0x19c))||undefined,_0x49b1c0=_0x5aa09e==='HOOK'?await resolveHookOptions(_0x2881ef,_0x5566cd):undefined,_0x43772a=buildFilePath(_0x2881ef,_0x5aa09e,_0xb8917d,_0x49b1c0);if(await fileExists(_0x43772a))throw CliErrors[_0x1fdd49(0x18d)](_0x1fdd49(0x172)+_0x43772a);await mkdir(dirname(_0x43772a),{'recursive':!![]});const _0x237aba=generateTemplate(_0x5aa09e,_0xb8917d,_0x5566cd[_0x1fdd49(0x16f)],_0x4ad779,_0x49b1c0);await writeFile(_0x43772a,_0x237aba,_0x1fdd49(0x1b1));const _0x1890ea={'type':_0x5aa09e,'name':_0xb8917d,'path':_0x43772a};if(_0x4ad779)_0x1890ea[_0x1fdd49(0x19c)]=_0x4ad779;if(_0x49b1c0){if(_0x49b1c0[_0x1fdd49(0x1a6)])_0x1890ea['alias']=_0x49b1c0[_0x1fdd49(0x1a6)];_0x1890ea[_0x1fdd49(0x1b0)]=_0x49b1c0[_0x1fdd49(0x1b0)],_0x1890ea[_0x1fdd49(0x17f)]=_0x49b1c0[_0x1fdd49(0x17f)],_0x1890ea[_0x1fdd49(0x1ad)]=_0x49b1c0[_0x1fdd49(0x1ad)];}return{'ok':!![],'data':_0x1890ea,'message':_0x1fdd49(0x180)+_0x5aa09e+'\x20function:\x20'+_0xb8917d};}};async function resolveHookOptions(_0x5586fe,_0x15bb88){const _0x452f7d=a30_0x49985b,_0x5b359b=loadAliasMap(_0x15bb88['apiDir'],undefined,resolveApiFilePath(_0x15bb88[_0x452f7d(0x192)],_0x15bb88[_0x452f7d(0x16f)])),_0x3e897d=_0x5b359b[_0x452f7d(0x189)]>0x0;let _0x192513,_0x1ec5d2,_0x489325;const _0x156267=_0x15bb88['str'](_0x452f7d(0x1a6)),_0x3bab2e=_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x1a1));if(_0x156267){const _0x33c664=resolveAlias(_0x15bb88[_0x452f7d(0x192)],_0x156267,undefined,resolveApiFilePath(_0x15bb88['apiDir'],_0x15bb88['appCode']));if(!_0x33c664){const _0x4d5d58=_0x3e897d?_0x452f7d(0x1a0)+_0x5b359b['map'](_0x735d18=>_0x735d18[_0x452f7d(0x1a6)])['join'](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x452f7d(0x1b2);throw CliErrors['validation']('Alias\x20\x22'+_0x156267+_0x452f7d(0x18f)+_0x4d5d58);}_0x192513=_0x156267,_0x1ec5d2=_0x33c664;}else{if(_0x3bab2e){_0x1ec5d2=_0x3bab2e;const _0x23f625=_0x5b359b['find'](_0x325b73=>_0x325b73[_0x452f7d(0x1b0)]===_0x3bab2e);_0x192513=_0x23f625?.[_0x452f7d(0x1a6)];}else{if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x169));else{if(_0x3e897d){const _0x275e6e=_0x5b359b['map'](_0x249e04=>_0x249e04[_0x452f7d(0x1a6)]+'\x20('+_0x249e04['tableName']+')'),_0x3cfbce=await promptSelect(_0x452f7d(0x16c),_0x275e6e),_0x2b7feb=_0x5b359b[_0x3cfbce];if(!_0x2b7feb)throw CliErrors['validation'](_0x452f7d(0x170));_0x192513=_0x2b7feb[_0x452f7d(0x1a6)],_0x1ec5d2=_0x2b7feb['datasetCode'];}else{const _0x546c22=await listDatasets(_0x15bb88['appCode']);if(_0x546c22[_0x452f7d(0x189)]===0x0)throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x162));const _0x3377d1=_0x546c22[_0x452f7d(0x160)](_0x8d19b9=>_0x8d19b9[_0x452f7d(0x16d)]+'\x20['+(_0x8d19b9[_0x452f7d(0x190)]??'UNKNOWN')+_0x452f7d(0x1b7)+_0x8d19b9[_0x452f7d(0x19a)]+')'),_0x140e2a=await promptSelect(_0x452f7d(0x16c),_0x3377d1),_0x1e9476=_0x546c22[_0x140e2a];if(!_0x1e9476)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x1ec5d2=_0x1e9476[_0x452f7d(0x19a)],_0x192513=undefined;}}}}const _0x369644=await listDatasets(_0x15bb88[_0x452f7d(0x16f)]),_0x4e9bfb=_0x369644[_0x452f7d(0x17c)](_0x21218f=>_0x21218f[_0x452f7d(0x19a)]===_0x1ec5d2);if(!_0x4e9bfb)throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x19f)+_0x1ec5d2+_0x452f7d(0x186)+(_0x192513?_0x452f7d(0x196)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x489325=_0x4e9bfb['id'];const _0x5e7215=_0x192513??_0x1ec5d2,_0x5f5441=await listBffDatasetOperations(_0x15bb88['appCode'],_0x489325),_0x32232f=_0x5f5441?Object['keys'](_0x5f5441):[];if(_0x32232f['length']===0x0)throw CliErrors[_0x452f7d(0x18d)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x5e7215+'.');let _0x5c43d4;const _0x52da10=_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x184));if(_0x52da10){if(!_0x32232f[_0x452f7d(0x15f)](_0x52da10))throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x1a8)+_0x52da10+_0x452f7d(0x195)+_0x5e7215+'.\x20'+(_0x452f7d(0x167)+_0x32232f['join'](',\x20')));_0x5c43d4=_0x52da10;}else{if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x1a9));const _0x5e778c=await promptSelect('Select\x20operation\x20type:',_0x32232f);_0x5c43d4=_0x32232f[_0x5e778c]??_0x32232f[0x0];}let _0x3c09ec=normalizeHookFunctionNode(_0x15bb88['str'](_0x452f7d(0x18b)));if(!_0x3c09ec){if(_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x18b)))throw CliErrors['validation'](_0x452f7d(0x179));if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x16a));const _0x47649a=await promptSelect(_0x452f7d(0x191),[_0x452f7d(0x173),_0x452f7d(0x1a7)]);_0x3c09ec=[_0x452f7d(0x173),_0x452f7d(0x1a7)][_0x47649a]??_0x452f7d(0x173);}return{'alias':_0x192513,'datasetCode':_0x1ec5d2,'datasetId':_0x489325,'operationType':_0x5c43d4,'functionNode':_0x3c09ec};}async function promptSelect(_0x9f14a5,_0x53462a){const _0x5e324c=a30_0x49985b;if(_0x53462a['length']===0x1)return 0x0;for(const [_0x132344,_0x29f49a]of _0x53462a['entries']()){process[_0x5e324c(0x171)][_0x5e324c(0x1a3)]('\x20\x20'+(_0x132344+0x1)+'.\x20'+_0x29f49a+'\x0a');}const _0x41b261=createInterface({'input':process[_0x5e324c(0x187)],'output':process['stderr']});while(!![]){const _0x22931a=await new Promise(_0x273f66=>{const _0x81805c=_0x5e324c;_0x41b261[_0x81805c(0x1b6)](_0x9f14a5+'\x20',_0x273f66);}),_0x486de6=Number[_0x5e324c(0x19d)](_0x22931a[_0x5e324c(0x18c)](),0xa);if(Number[_0x5e324c(0x164)](_0x486de6)&&_0x486de6>=0x1&&_0x486de6<=_0x53462a[_0x5e324c(0x189)])return _0x41b261[_0x5e324c(0x1bd)](),_0x486de6-0x1;process[_0x5e324c(0x171)]['write'](_0x5e324c(0x1ae)+_0x53462a[_0x5e324c(0x189)]+'.\x0a');}}function a30_0x5508(){const _0x417929=['45AcVMpJ','find','string','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','operationType','Created\x20','Operation\x20type\x20(HOOK\x20only)','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Trigger\x20node\x20(HOOK\x20only)','operation-type','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x22.\x20','stdin','8hQhjBF','length','16860kKmtaV','function-node','trim','validation','create','\x22\x20not\x20found.\x20','source','Select\x20trigger\x20node:','apiDir','12qLmNvf','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22\x20not\x20found\x20for\x20dataset\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Function\x20name\x20(valid\x20JS\x20identifier)','nonInteractive','Script\x20type','code','7895706bMKxuO','description','parseInt','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Dataset\x20not\x20found\x20for\x20code\x20\x22','Available\x20aliases:\x20','datasetcode','Script\x20description','write','.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','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','alias','after','Operation\x20type\x20\x22','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','type','COMMON','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','functionNode','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','\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','datasetCode','utf8','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','1031686bcoIcD','52518829WqcSwE','bff','question',']\x20(','TODO:\x20add\x20script\x20description','\x0a\x20*\x20[触发节点]\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','.js','scriptsRootDir','close','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','includes','map','413790NfpOdj','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x20[脚本名称]\x20','isInteger','2bwZBgm','\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','Available:\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','13629410EDJjxb','Select\x20dataset:','name','str','appCode','Invalid\x20dataset\x20selection.','stderr','File\x20already\x20exists:\x20','before','78OxlXDu','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','6442209ReQcKE','HOOK','HOOK\x20requires\x20alias/operation/node\x20options.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','ENDPOINT'];a30_0x5508=function(){return _0x417929;};return a30_0x5508();}function buildFilePath(_0x1af05b,_0x91a7c7,_0x3e3bb1,_0x3b4bac){const _0x31cfd3=a30_0x49985b;if(_0x91a7c7===_0x31cfd3(0x177)){if(!_0x3b4bac)throw CliErrors['validation'](_0x31cfd3(0x178));const _0x39e3cd=_0x3b4bac['alias']??_0x3b4bac[_0x31cfd3(0x1b0)];return join(_0x1af05b[_0x31cfd3(0x1bc)],_0x31cfd3(0x177),_0x39e3cd,_0x3b4bac[_0x31cfd3(0x17f)],_0x3b4bac[_0x31cfd3(0x1ad)],_0x3e3bb1+'.js');}return join(_0x1af05b[_0x31cfd3(0x1bc)],_0x91a7c7,_0x3e3bb1+_0x31cfd3(0x1bb));}export function generateTemplate(_0x51b2f8,_0xb5f9f5,_0x30290c,_0x2e8fb4,_0x2c874b){const _0x11c988=a30_0x49985b,_0x2824b5=_0x2e8fb4?.['trim']()||_0x11c988(0x1b8);if(_0x51b2f8===_0x11c988(0x1ab))return _0x11c988(0x1ba)+_0x2824b5+_0x11c988(0x163)+_0xb5f9f5+_0x11c988(0x19e)+_0xb5f9f5+_0x11c988(0x1a4)+_0xb5f9f5+_0x11c988(0x168);if(_0x51b2f8===_0x11c988(0x17a))return _0x11c988(0x182)+_0x2824b5+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x30290c+'/'+_0xb5f9f5+_0x11c988(0x1af)+_0xb5f9f5+_0x11c988(0x168);if(!_0x2c874b)throw CliErrors['validation'](_0x11c988(0x17e));return _0x11c988(0x194)+_0x2824b5+_0x11c988(0x15e)+_0x30290c+'/'+_0x2c874b[_0x11c988(0x1b0)]+'/'+_0x2c874b['operationType']+_0x11c988(0x1b9)+_0x2c874b[_0x11c988(0x1ad)]+_0x11c988(0x166)+_0xb5f9f5+_0x11c988(0x168);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2d64a6=a31_0x4951;(function(_0x467d59,_0xff1e78){const _0x2354ee=a31_0x4951,_0x1a37ca=_0x467d59();while(!![]){try{const _0x46883e=parseInt(_0x2354ee(0x1a5))/0x1*(parseInt(_0x2354ee(0x1c5))/0x2)+parseInt(_0x2354ee(0x1c6))/0x3*(parseInt(_0x2354ee(0x1a2))/0x4)+parseInt(_0x2354ee(0x1b2))/0x5*(parseInt(_0x2354ee(0x1b5))/0x6)+parseInt(_0x2354ee(0x1a0))/0x7*(parseInt(_0x2354ee(0x199))/0x8)+parseInt(_0x2354ee(0x1b3))/0x9*(-parseInt(_0x2354ee(0x1c2))/0xa)+-parseInt(_0x2354ee(0x1a6))/0xb+-parseInt(_0x2354ee(0x1b0))/0xc;if(_0x46883e===_0xff1e78)break;else _0x1a37ca['push'](_0x1a37ca['shift']());}catch(_0x27346d){_0x1a37ca['push'](_0x1a37ca['shift']());}}}(a31_0x5d54,0xa18fc));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a31_0x4951(_0x549da2,_0x590b05){_0x549da2=_0x549da2-0x194;const _0x5d5482=a31_0x5d54();let _0x4951ec=_0x5d5482[_0x549da2];return _0x4951ec;}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a31_0x5d54(){const _0x5f4fd8=['36909PHaAzC','str','11574jXcPay','lockFilePath','startsWith','filter','\x20(local\x20file\x20moved\x20to\x20trash)','toISOString','replace','trashedTo','delete','length','functions','target','validation','1130YESLFx','Deleted\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','116966JrHCna','417gFcEbV','remoteId','POST','projectRoot','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','join','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','5816ORjXNY','scriptsRootDir','Local\x20delete\x20not\x20settled\x20for\x20','apps','scriptsRoot','<timestamp>','Function\x20not\x20found:\x20','7385JeUrOV','trashDir','37588vuHawN','map','BFF\x20lock\x20file\x20not\x20found.','7bovCxK','8703596gsewQg','/api/management/library/scripts/delete','find','keys','No\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','bff','\x22\x20not\x20found\x20after\x20ensureLockScope.','stringify','appCode','10590000axotJa','split','820MfUrUy'];a31_0x5d54=function(){return _0x5f4fd8;};return a31_0x5d54();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x2d64a6(0x1ac),'command':'delete','description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[{'name':'target','type':'string','required':!![],'description':a31_0x2d64a6(0x196)}],async 'validate'(_0x13c18b){const _0xebf5a0=a31_0x2d64a6,_0x19ff57=loadBffProjectConfig(_0x13c18b[_0xebf5a0(0x1af)]),_0x48b1d0=await readBffLockFile(_0x19ff57[_0xebf5a0(0x1b6)]);if(!_0x48b1d0)throw CliErrors[_0xebf5a0(0x1c1)](_0xebf5a0(0x198));},async 'dryRun'(_0x19400b){const _0x22696d=a31_0x2d64a6,_0x803b02=loadBffProjectConfig(_0x19400b[_0x22696d(0x1af)]),_0x442bf6=await readBffLockFile(_0x803b02[_0x22696d(0x1b6)]);if(!_0x442bf6)throw CliErrors['validation'](_0x22696d(0x1a4));const {appLock:_0x26fafc}=ensureLockScope(_0x442bf6,_0x19400b['appCode'],_0x803b02[_0x22696d(0x19d)],_0x22696d(0x1bd)),_0x24f041=_0x19400b[_0x22696d(0x1b4)](_0x22696d(0x1c0)),_0xb3e18f=Object[_0x22696d(0x1a9)](_0x26fafc[_0x22696d(0x1bf)]),_0x59fbac=resolveDeleteTarget(_0x24f041,_0xb3e18f),_0x56ec7b=_0x26fafc[_0x22696d(0x1bf)][_0x59fbac];if(!_0x56ec7b)throw CliErrors['validation'](_0x22696d(0x1aa)+_0x59fbac+'\x22.');const _0x5b9d46=resolveLocalFilePathFromLockKey(_0x803b02,_0x59fbac),_0x1a69b8=relative(_0x803b02[_0x22696d(0x195)],_0x5b9d46),_0x1659f4=join(_0x803b02[_0x22696d(0x1a1)],_0x22696d(0x19e),_0x1a69b8);return{'method':_0x22696d(0x194),'url':_0x22696d(0x1a7),'body':{'appCode':_0x19400b['appCode'],'target':_0x59fbac,'remoteId':_0x56ec7b[_0x22696d(0x1c7)],'localFilePath':_0x5b9d46,'trashedPath':_0x1659f4},'description':'Would\x20delete\x20'+_0x59fbac+_0x22696d(0x1c4)};},async 'execute'(_0x13d211){const _0x117daf=a31_0x2d64a6,_0x1ddcfa=loadBffProjectConfig(_0x13d211[_0x117daf(0x1af)]),_0x5827ce=await readBffLockFile(_0x1ddcfa['lockFilePath']);if(!_0x5827ce)throw CliErrors[_0x117daf(0x1c1)](_0x117daf(0x1a4));const {lockData:_0x3f70a4,appLock:_0x1b35c2}=ensureLockScope(_0x5827ce,_0x13d211[_0x117daf(0x1af)],_0x1ddcfa[_0x117daf(0x19d)],'delete'),_0xbfb729=JSON['parse'](JSON[_0x117daf(0x1ae)](_0x3f70a4)),_0x47fc9d=_0xbfb729[_0x117daf(0x19c)][_0x13d211[_0x117daf(0x1af)]];if(!_0x47fc9d)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x13d211['appCode']+_0x117daf(0x1ad));const _0x4f42d3=_0x13d211[_0x117daf(0x1b4)](_0x117daf(0x1c0)),_0x1c32b5=Object[_0x117daf(0x1a9)](_0x47fc9d[_0x117daf(0x1bf)]),_0x19519e=resolveDeleteTarget(_0x4f42d3,_0x1c32b5),_0x2b05d9=_0x47fc9d[_0x117daf(0x1bf)][_0x19519e];if(!_0x2b05d9)throw CliErrors['validation'](_0x117daf(0x1aa)+_0x19519e+'\x22.');await deleteBffScript(_0x2b05d9[_0x117daf(0x1c7)]),delete _0x47fc9d['functions'][_0x19519e],_0x47fc9d[_0x117daf(0x1ab)]=new Date()[_0x117daf(0x1ba)](),await writeBffLockFile(_0x1ddcfa[_0x117daf(0x1b6)],_0xbfb729);const _0x3301e0=resolveLocalFilePathFromLockKey(_0x1ddcfa,_0x19519e);let _0x35bb1f;await fileExists(_0x3301e0)&&(_0x35bb1f=await moveToTrash(_0x1ddcfa[_0x117daf(0x195)],_0x1ddcfa[_0x117daf(0x1a1)],_0x3301e0),await cleanupEmptyDirectories(dirname(_0x3301e0),_0x1ddcfa[_0x117daf(0x19a)]));await waitForDeleteSettlement(_0x1ddcfa[_0x117daf(0x1b6)],_0x13d211[_0x117daf(0x1af)],_0x19519e,_0x3301e0),await sleep(0x96);const _0x3ec660={'deleted':_0x19519e,'remoteId':_0x2b05d9[_0x117daf(0x1c7)]};if(_0x35bb1f)_0x3ec660[_0x117daf(0x1bc)]=_0x35bb1f;return{'ok':!![],'data':_0x3ec660,'message':_0x117daf(0x1c3)+_0x19519e+(_0x35bb1f?_0x117daf(0x1b9):'')};}};function resolveDeleteTarget(_0x394c83,_0x20c399){const _0x43f3d8=a31_0x2d64a6;if(_0x394c83['includes']('/')){const _0x45d542=_0x20c399[_0x43f3d8(0x1a8)](_0x2f3625=>_0x2f3625===_0x394c83);if(!_0x45d542)throw CliErrors[_0x43f3d8(0x1c1)](_0x43f3d8(0x19f)+_0x394c83);return _0x45d542;}const _0x431dec=_0x20c399[_0x43f3d8(0x1b8)](_0x310e9b=>_0x310e9b[_0x43f3d8(0x1b1)]('/')['at'](-0x1)===_0x394c83);if(_0x431dec[_0x43f3d8(0x1be)]===0x0)throw CliErrors[_0x43f3d8(0x1c1)](_0x43f3d8(0x19f)+_0x394c83);if(_0x431dec[_0x43f3d8(0x1be)]>0x1)throw CliErrors[_0x43f3d8(0x1c1)]('Multiple\x20functions\x20match\x20\x22'+_0x394c83+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x431dec[_0x43f3d8(0x1a3)](_0x544bf0=>'\x20\x20-\x20'+_0x544bf0)[_0x43f3d8(0x197)]('\x0a'));return _0x431dec[0x0];}async function moveToTrash(_0x2ead8f,_0x35c763,_0x3cc70f){const _0x43494d=a31_0x2d64a6,_0x29e24b=new Date()[_0x43494d(0x1ba)]()[_0x43494d(0x1bb)](/[:.]/g,'-'),_0x51a057=relative(_0x2ead8f,_0x3cc70f),_0x5cc082=join(_0x35c763,_0x29e24b,_0x51a057);return await mkdir(dirname(_0x5cc082),{'recursive':!![]}),await rename(_0x3cc70f,_0x5cc082),_0x5cc082;}async function cleanupEmptyDirectories(_0x37ca89,_0x3fb8fd){const _0x30cd87=a31_0x2d64a6;let _0x44a4b4=resolve(_0x37ca89);const _0x36449b=resolve(_0x3fb8fd);while(_0x44a4b4[_0x30cd87(0x1b7)](''+_0x36449b+sep)||_0x44a4b4===_0x36449b){if(_0x44a4b4===_0x36449b)return;try{const _0x2ec4d2=await readdir(_0x44a4b4);if(_0x2ec4d2[_0x30cd87(0x1be)]>0x0)return;await rmdir(_0x44a4b4);}catch{return;}_0x44a4b4=dirname(_0x44a4b4);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x52ad92,_0x1f58dd,_0x28cfe6,_0x3a1ec1){const _0x18a436=a31_0x2d64a6;for(let _0x23e4c7=0x0;_0x23e4c7<DELETE_SETTLE_RETRY_COUNT;_0x23e4c7+=0x1){const _0x569510=await readBffLockFile(_0x52ad92),_0x7a1c4f=!!_0x569510?.[_0x18a436(0x19c)]?.[_0x1f58dd]?.[_0x18a436(0x1bf)]?.[_0x28cfe6],_0x397153=await fileExists(_0x3a1ec1);if(!_0x7a1c4f&&!_0x397153)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x18a436(0x19b)+_0x28cfe6+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a32_0x10e839=a32_0x209a;function a32_0x209a(_0x3c7d96,_0xe8ef2a){_0x3c7d96=_0x3c7d96-0x1eb;const _0x567b96=a32_0x567b();let _0x209adf=_0x567b96[_0x3c7d96];return _0x209adf;}(function(_0x5a64bb,_0x130e49){const _0x236369=a32_0x209a,_0xb79eb8=_0x5a64bb();while(!![]){try{const _0x426908=parseInt(_0x236369(0x1f5))/0x1*(-parseInt(_0x236369(0x201))/0x2)+-parseInt(_0x236369(0x1f1))/0x3*(parseInt(_0x236369(0x202))/0x4)+-parseInt(_0x236369(0x1eb))/0x5+-parseInt(_0x236369(0x1f6))/0x6+-parseInt(_0x236369(0x1ee))/0x7+parseInt(_0x236369(0x1f0))/0x8*(parseInt(_0x236369(0x1ed))/0x9)+parseInt(_0x236369(0x1fc))/0xa*(parseInt(_0x236369(0x1ff))/0xb);if(_0x426908===_0x130e49)break;else _0xb79eb8['push'](_0xb79eb8['shift']());}catch(_0xa66da4){_0xb79eb8['push'](_0xb79eb8['shift']());}}}(a32_0x567b,0x73602));function a32_0x567b(){const _0x32b385=['5492myYqRC','4380800MLVGSh','Script\x20ID','4820337eZtTrr','21490zjsVec','updatedTime','8UuKzoa','1629odysbS','(none)','number','appCode','1CRLeHm','1323366hUDyWw','num','Get\x20BFF\x20script\x20details\x20by\x20ID','detail','bff','createdTime','100HVWPOi','Return\x20full\x20raw\x20script\x20object','verbose','2378948yTAmHm','read','760730lRIMrO'];a32_0x567b=function(){return _0x32b385;};return a32_0x567b();}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x10e839(0x1fa),'command':a32_0x10e839(0x1f9),'description':a32_0x10e839(0x1f8),'risk':a32_0x10e839(0x200),'flags':[{'name':'id','type':a32_0x10e839(0x1f3),'required':!![],'description':a32_0x10e839(0x1ec)},{'name':'verbose','type':'boolean','description':a32_0x10e839(0x1fd)}],async 'execute'(_0x350f5a){const _0x2a39b9=a32_0x10e839,_0xbb9e1=await getBffScriptInfo(_0x350f5a[_0x2a39b9(0x1f7)]('id')),_0xe29f35=_0x350f5a['bool'](_0x2a39b9(0x1fe));if(_0xe29f35)return{'ok':!![],'data':_0xbb9e1};return{'ok':!![],'data':{'id':_0xbb9e1['id'],'appCode':_0xbb9e1[_0x2a39b9(0x1f4)],'scriptType':_0xbb9e1['scriptType'],'description':_0xbb9e1['description']||_0x2a39b9(0x1f2),'createdTime':_0xbb9e1[_0x2a39b9(0x1fb)]??'','updatedTime':_0xbb9e1[_0x2a39b9(0x1ef)]??'','scriptContent':_0xbb9e1['scriptContent']??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a33_0x1ad1(){const _0x4d191e=['14989vAfsrh','849000yGHjKF','7792pVUPig','419592RbaKqN','8aTKRBf','3171830XGSZfS','1085013xwhuuP','1498068Qdvope','52JxOWwH','91eaVAnq','30nqRZhy'];a33_0x1ad1=function(){return _0x4d191e;};return a33_0x1ad1();}(function(_0x29fb38,_0x49b0e1){const _0x4291e9=a33_0x56a1,_0x4a5279=_0x29fb38();while(!![]){try{const _0x135943=-parseInt(_0x4291e9(0x10f))/0x1*(-parseInt(_0x4291e9(0x10c))/0x2)+-parseInt(_0x4291e9(0x107))/0x3*(parseInt(_0x4291e9(0x108))/0x4)+parseInt(_0x4291e9(0x109))/0x5+-parseInt(_0x4291e9(0x110))/0x6+-parseInt(_0x4291e9(0x10d))/0x7*(-parseInt(_0x4291e9(0x106))/0x8)+parseInt(_0x4291e9(0x10a))/0x9*(-parseInt(_0x4291e9(0x10e))/0xa)+parseInt(_0x4291e9(0x10b))/0xb;if(_0x135943===_0x49b0e1)break;else _0x4a5279['push'](_0x4a5279['shift']());}catch(_0x3a246){_0x4a5279['push'](_0x4a5279['shift']());}}}(a33_0x1ad1,0x5f38f));function a33_0x56a1(_0x52f561,_0x26a773){_0x52f561=_0x52f561-0x106;const _0x1ad19e=a33_0x1ad1();let _0x56a1c3=_0x1ad19e[_0x52f561];return _0x56a1c3;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x29916e=a34_0x1e3f;(function(_0x3abd26,_0x2ead58){const _0x5de506=a34_0x1e3f,_0x12301e=_0x3abd26();while(!![]){try{const _0x2f395c=-parseInt(_0x5de506(0x17a))/0x1*(parseInt(_0x5de506(0x174))/0x2)+parseInt(_0x5de506(0x178))/0x3*(parseInt(_0x5de506(0x17f))/0x4)+parseInt(_0x5de506(0x181))/0x5+parseInt(_0x5de506(0x175))/0x6*(parseInt(_0x5de506(0x184))/0x7)+-parseInt(_0x5de506(0x17c))/0x8+-parseInt(_0x5de506(0x16c))/0x9+parseInt(_0x5de506(0x17e))/0xa;if(_0x2f395c===_0x2ead58)break;else _0x12301e['push'](_0x12301e['shift']());}catch(_0x194bce){_0x12301e['push'](_0x12301e['shift']());}}}(a34_0x1c61,0xc44ec));function a34_0x1e3f(_0x3607fd,_0x130109){_0x3607fd=_0x3607fd-0x169;const _0x1c6103=a34_0x1c61();let _0x1e3f2e=_0x1c6103[_0x3607fd];return _0x1e3f2e;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a34_0x29916e(0x177),'command':a34_0x29916e(0x182),'description':'List\x20BFF\x20scripts','risk':'read','flags':[{'name':'type','type':a34_0x29916e(0x169),'description':a34_0x29916e(0x170),'default':a34_0x29916e(0x176),'enum':[a34_0x29916e(0x176),'COMMON']},{'name':a34_0x29916e(0x16a),'type':a34_0x29916e(0x169),'description':a34_0x29916e(0x171)},{'name':'verbose','type':a34_0x29916e(0x180),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x4e79c7){const _0xf1743a=a34_0x29916e,_0x3ec5d0=await listBffScripts(_0x4e79c7[_0xf1743a(0x16d)],_0x4e79c7['str'](_0xf1743a(0x16b)),{'scriptName':_0x4e79c7[_0xf1743a(0x16e)](_0xf1743a(0x16a))||undefined}),_0x32f22c=_0x4e79c7[_0xf1743a(0x16f)](_0xf1743a(0x172));return{'ok':!![],'data':_0x32f22c?_0x3ec5d0:_0x3ec5d0[_0xf1743a(0x183)](_0x498413=>({'id':_0x498413['id'],'functionName':_0x498413[_0xf1743a(0x17b)]??'','description':_0x498413['description']||_0xf1743a(0x17d),'scriptType':_0x498413['scriptType']})),'message':_0x3ec5d0[_0xf1743a(0x173)]===0x0?_0xf1743a(0x179):undefined};}};function a34_0x1c61(){const _0x3395c2=['1883697TcRqfh','No\x20BFF\x20scripts\x20found.','370037RbUSkf','functionName','11359032ZphOEX','(unnamed)','11698040VuUHXb','8VUByUQ','boolean','4359775PPvQKW','list','map','63pidqYb','string','name','type','3414411iDgaNE','appCode','str','bool','Script\x20type\x20filter','Filter\x20by\x20script\x20name','verbose','length','8vpDoPW','523950wnwmum','ENDPOINT','bff'];a34_0x1c61=function(){return _0x3395c2;};return a34_0x1c61();}
|