@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x51126c=a19_0x1531;(function(_0x537e20,_0x55b230){const _0x40cda2=a19_0x1531,_0x1ddab4=_0x537e20();while(!![]){try{const _0x463baa=-parseInt(_0x40cda2(0x174))/0x1*(parseInt(_0x40cda2(0x182))/0x2)+parseInt(_0x40cda2(0x196))/0x3*(-parseInt(_0x40cda2(0x183))/0x4)+parseInt(_0x40cda2(0x18b))/0x5+parseInt(_0x40cda2(0x17f))/0x6*(parseInt(_0x40cda2(0x185))/0x7)+parseInt(_0x40cda2(0x19b))/0x8*(-parseInt(_0x40cda2(0x176))/0x9)+parseInt(_0x40cda2(0x187))/0xa*(-parseInt(_0x40cda2(0x191))/0xb)+parseInt(_0x40cda2(0x19d))/0xc*(parseInt(_0x40cda2(0x199))/0xd);if(_0x463baa===_0x55b230)break;else _0x1ddab4['push'](_0x1ddab4['shift']());}catch(_0xcfff0){_0x1ddab4['push'](_0x1ddab4['shift']());}}}(a19_0x4187,0x8a1e5));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x1531(_0x19d5e3,_0x598919){_0x19d5e3=_0x19d5e3-0x172;const _0x4187c9=a19_0x4187();let _0x153161=_0x4187c9[_0x19d5e3];return _0x153161;}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(_0x414d35,_0x31ec10){const _0x278ae4=a19_0x1531,_0x5828ba=[],_0x5ae912=_0x414d35[_0x278ae4(0x189)]&&typeof _0x414d35[_0x278ae4(0x189)]==='object'?_0x414d35[_0x278ae4(0x189)]:{},_0x3111ad=_0x414d35[_0x278ae4(0x18a)]||undefined;for(const [_0x1d9cbd,_0x4ff2d0]of Object[_0x278ae4(0x198)](_0x5ae912)){if(!_0x4ff2d0||typeof _0x4ff2d0!==_0x278ae4(0x18c)||!_0x4ff2d0[_0x278ae4(0x175)])continue;_0x5828ba['push']({'name':_0x1d9cbd,'appcode':_0x4ff2d0[_0x278ae4(0x175)],'named':!![],'definedIn':_0x31ec10,'isDefault':_0x1d9cbd===_0x3111ad,...buildAppProfileListFields(_0x4ff2d0)});}return _0x5828ba;}function buildMergedItems(_0x3d34a5,_0x389faa){const _0x362b45=a19_0x1531,{apps:apps={},defaultApp:_0x48b691}=_0x3d34a5,_0x4a9779=_0x389faa[_0x362b45(0x188)][_0x362b45(0x189)]&&typeof _0x389faa[_0x362b45(0x188)][_0x362b45(0x189)]===_0x362b45(0x18c)?_0x389faa['globalConfig']['apps']:{},_0x3210a3=_0x389faa[_0x362b45(0x180)][_0x362b45(0x189)]&&typeof _0x389faa[_0x362b45(0x180)][_0x362b45(0x189)]===_0x362b45(0x18c)?_0x389faa['projectConfig'][_0x362b45(0x189)]:{},_0x1ed5cb=_0x389faa[_0x362b45(0x180)][_0x362b45(0x19c)]===![],_0x43f256=Object[_0x362b45(0x198)](apps),_0x17c9d6=_0x43f256[_0x362b45(0x172)](([_0x380d40,_0x5ed331])=>({'name':_0x380d40,'appcode':_0x5ed331['appcode'],'named':!![],'definedIn':appDefinedIn(_0x380d40,_0x4a9779,_0x3210a3,_0x1ed5cb),'isDefault':_0x380d40===_0x48b691,...buildAppProfileListFields(_0x5ed331)}));return _0x17c9d6;}function a19_0x4187(){const _0x109ab7=['global','merged','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','validation','2878863gOrRUX','find','entries','1678378RcnIwW','isCurrent','2831848EgWwtf','inherit','276pNgZgV','list','\x20in\x20','map','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','2PnYdEj','appcode','27NmUyVO','mergedCli','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','No\x20apps\x20configured','boolean','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','globalPath','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','798QPKQyK','projectConfig','\x20config','716546ewBRPc','4FxAoHd','bool','10213pQuDKa','optional','113840YbFXfW','globalConfig','apps','defaultApp','2352470jvTJAp','object','project','length','.\x20Use\x20`','remote','319oPjddk'];a19_0x4187=function(){return _0x109ab7;};return a19_0x4187();}function validateAppListFlags(_0x1fb0cc){const _0x5348be=a19_0x1531;if(!_0x1fb0cc[_0x5348be(0x184)](_0x5348be(0x190)))return;if(!_0x1fb0cc[_0x5348be(0x184)](_0x5348be(0x192))&&!_0x1fb0cc[_0x5348be(0x184)](_0x5348be(0x18d)))return;throw CliErrors[_0x5348be(0x195)](_0x5348be(0x194),_0x5348be(0x178));}async function execute(_0x319108){const _0x3ad98f=a19_0x1531;validateAppListFlags(_0x319108);if(_0x319108['bool']('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x319108)};const _0x1a2b84=_0x319108[_0x3ad98f(0x184)](_0x3ad98f(0x192)),_0x14dc0b=_0x319108[_0x3ad98f(0x184)](_0x3ad98f(0x18d)),_0x1851a2=_0x1a2b84?'global':_0x14dc0b?_0x3ad98f(0x18d):'merged',{config:_0x9c1294,layers:_0x47cbd7}=readRawConfigWithLayers(),_0x3f3bb8=resolveDefaultAppSource(_0x47cbd7),{defaultApp:_0x5c78b1}=_0x9c1294;let _0xc40d14,_0x5c7b8c;switch(_0x1851a2){case _0x3ad98f(0x192):_0xc40d14=buildItemsFromLayer(_0x47cbd7['globalConfig'],_0x3ad98f(0x192)),_0x5c7b8c=_0x47cbd7['globalPath'];break;case'project':_0xc40d14=buildItemsFromLayer(_0x47cbd7[_0x3ad98f(0x180)],_0x3ad98f(0x18d)),_0x5c7b8c=_0x47cbd7['projectPath'];break;default:_0xc40d14=buildMergedItems(_0x9c1294,_0x47cbd7);break;}enrichAppListItemsWithMergedSelection(_0xc40d14,_0x319108[_0x3ad98f(0x177)]);if(_0xc40d14[_0x3ad98f(0x18e)]===0x0){const _0x38612e=_0x1851a2===_0x3ad98f(0x193)?'':_0x3ad98f(0x19f)+_0x1851a2+_0x3ad98f(0x181);return{'ok':!![],'data':[],'message':_0x3ad98f(0x179)+_0x38612e+_0x3ad98f(0x18f)+CLI_BIN_NAME+_0x3ad98f(0x17b)};}const _0x3063fe=_0xc40d14[_0x3ad98f(0x197)](_0x1b0cd3=>_0x1b0cd3[_0x3ad98f(0x19a)]===!![]),_0x586b46=_0x5c78b1??_0x3063fe?.[_0x3ad98f(0x175)]??null,_0x11859b=_0x1851a2===_0x3ad98f(0x193)?{'globalPath':_0x47cbd7[_0x3ad98f(0x17d)]??null,'projectPath':_0x47cbd7['projectPath']??null,'defaultApp':_0x586b46,'defaultAppSource':_0x5c78b1!=null?_0x3f3bb8:null}:{'scope':_0x1851a2,'configPath':_0x5c7b8c??null};return{'ok':!![],'data':{'items':_0xc40d14,'meta':_0x11859b}};}export const appListDefinition={'service':'app','command':a19_0x51126c(0x19e),'description':a19_0x51126c(0x17c),'risk':'read','auth':a19_0x51126c(0x186),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':a19_0x51126c(0x17a),'description':a19_0x51126c(0x173),'default':![]},{'name':'global','type':a19_0x51126c(0x17a),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a19_0x51126c(0x18d),'type':'boolean','description':a19_0x51126c(0x17e),'default':![]}],async 'validate'(_0x35dd33){validateAppListFlags(_0x35dd33);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x578d6f=a20_0x3b55;(function(_0x3fd5f2,_0x293d25){const _0x2a1af6=a20_0x3b55,_0x2d97c0=_0x3fd5f2();while(!![]){try{const _0x52fdff=-parseInt(_0x2a1af6(0x79))/0x1+-parseInt(_0x2a1af6(0x78))/0x2+parseInt(_0x2a1af6(0x7a))/0x3*(-parseInt(_0x2a1af6(0x74))/0x4)+-parseInt(_0x2a1af6(0x7b))/0x5+parseInt(_0x2a1af6(0x73))/0x6+parseInt(_0x2a1af6(0x77))/0x7*(-parseInt(_0x2a1af6(0x72))/0x8)+parseInt(_0x2a1af6(0x75))/0x9;if(_0x52fdff===_0x293d25)break;else _0x2d97c0['push'](_0x2d97c0['shift']());}catch(_0x530d15){_0x2d97c0['push'](_0x2d97c0['shift']());}}}(a20_0x26bd,0x2f9bb));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a20_0x3b55(_0x3ec4d5,_0x73e0dc){_0x3ec4d5=_0x3ec4d5-0x71;const _0x26bdfe=a20_0x26bd();let _0x3b55c1=_0x26bdfe[_0x3ec4d5];return _0x3b55c1;}function a20_0x26bd(){const _0x22d471=['493160PjWKkn','2059662rBNQpn','58532rxWWRN','7647084aaEjnO','List\x20application\x20members\x20with\x20their\x20role\x20memberships','14wFMScs','538298SxvdTh','130556cxMoWS','33OobIfY','1569960ADoPYg','members-list','appCode','length','app'];a20_0x26bd=function(){return _0x22d471;};return a20_0x26bd();}import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x578d6f(0x71),'command':a20_0x578d6f(0x7c),'description':a20_0x578d6f(0x76),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1d3a49){const _0x21a49b=a20_0x578d6f,_0x26846a=projectAppMembers(await listRoleUsers(_0x1d3a49[_0x21a49b(0x7d)]));return{'ok':!![],'data':{'appCode':_0x1d3a49[_0x21a49b(0x7d)],'items':_0x26846a,'totalCount':_0x26846a[_0x21a49b(0x7e)]},'message':'Found\x20'+_0x26846a[_0x21a49b(0x7e)]+'\x20application\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b13af,_0x5f30e1){const _0x44a9b6=a21_0x495c,_0x5373eb=_0x4b13af();while(!![]){try{const _0x1a0d78=-parseInt(_0x44a9b6(0xbd))/0x1*(parseInt(_0x44a9b6(0xba))/0x2)+-parseInt(_0x44a9b6(0xb2))/0x3+-parseInt(_0x44a9b6(0xb1))/0x4*(parseInt(_0x44a9b6(0xbc))/0x5)+-parseInt(_0x44a9b6(0xb3))/0x6*(-parseInt(_0x44a9b6(0xbe))/0x7)+parseInt(_0x44a9b6(0xb8))/0x8*(-parseInt(_0x44a9b6(0xb9))/0x9)+-parseInt(_0x44a9b6(0xb4))/0xa*(parseInt(_0x44a9b6(0xbb))/0xb)+parseInt(_0x44a9b6(0xb5))/0xc;if(_0x1a0d78===_0x5f30e1)break;else _0x5373eb['push'](_0x5373eb['shift']());}catch(_0x367f88){_0x5373eb['push'](_0x5373eb['shift']());}}}(a21_0x4837,0x44aea));import{listRemoteApps}from'../../core/api-client.js';function a21_0x495c(_0x99efc,_0xb25170){_0x99efc=_0x99efc-0xaf;const _0x483775=a21_0x4837();let _0x495c13=_0x483775[_0x99efc];return _0x495c13;}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x218c45){const _0x3cd0c1=a21_0x495c,_0x24b230=_0x218c45[_0x3cd0c1(0xb0)]||getCookie();if(!_0x24b230)throw CliErrors['authRequired']();return _0x24b230;}export async function listRemoteAppDirectory(_0x16929c){const _0x4f77a5=a21_0x495c,_0x215ff8=await withActiveCookie(resolveCookie(_0x16929c),()=>listRemoteApps());return{'items':_0x215ff8[_0x4f77a5(0xaf)](_0x48d7c3=>({..._0x48d7c3['id']!=null?{'id':_0x48d7c3['id']}:{},'appCode':_0x48d7c3[_0x4f77a5(0xb6)],'appName':_0x48d7c3['appName'],..._0x48d7c3[_0x4f77a5(0xbf)]!=null?{'appDesc':_0x48d7c3['appDesc']}:{}})),'meta':{'source':_0x4f77a5(0xb7)}};}function a21_0x4837(){const _0x49a836=['712cRhnOw','17712GJmkyo','332nrplCe','803rbkkih','937790WHjbET','587AYfkab','3896305EnuskD','appDesc','map','cookie','4ZnkEoK','1678287hawLAE','6SFendB','55690pBFWeA','13809900nIvqFU','appCode','platform'];a21_0x4837=function(){return _0x49a836;};return a21_0x4837();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x326800,_0x51414b){const _0x41a6a0=a22_0x5bcf,_0x54ddce=_0x326800();while(!![]){try{const _0xfb70ec=-parseInt(_0x41a6a0(0xa8))/0x1+parseInt(_0x41a6a0(0xad))/0x2+parseInt(_0x41a6a0(0xb2))/0x3+parseInt(_0x41a6a0(0xc9))/0x4+parseInt(_0x41a6a0(0xa2))/0x5+-parseInt(_0x41a6a0(0xab))/0x6*(parseInt(_0x41a6a0(0xb0))/0x7)+parseInt(_0x41a6a0(0xc3))/0x8;if(_0xfb70ec===_0x51414b)break;else _0x54ddce['push'](_0x54ddce['shift']());}catch(_0x5636cb){_0x54ddce['push'](_0x54ddce['shift']());}}}(a22_0x5332,0xe461c));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a22_0x5332(){const _0x37150d=['781760pzwgJh','keys','roleId','projectConfig','isCurrent','prototype','1738356yZSBLT','hasOwnProperty','trim','ACTIVE','project','both','roles','inherit','742840vzDDTt','defaultApp','get','roleName','has','appcode','1788234OohKtn','membershipStatus','userId','10812EqglJL','status','3162392UDsGZI','globalConfig','roleType','1687uuious','currentApp','2687685NlzSan','sort','push','add','username','length','PENDING','\x20(global)','nickname','roleKeys','call','displayName','apps','name','object','global','named'];a22_0x5332=function(){return _0x37150d;};return a22_0x5332();}function nullableText(_0x3ba90f){const _0x44f7ee=_0x3ba90f?.['trim']();return _0x44f7ee?_0x44f7ee:null;}export function projectAppMembers(_0x21984a){const _0x1fda8d=a22_0x5bcf,_0x3ae854=new Map(),_0xdf384=[..._0x21984a]['sort']((_0x54b545,_0xa9399)=>_0x54b545['id']-_0xa9399['id']),_0x5daf01=(_0x489849,_0xa82a11,_0x24d54a)=>{const _0x136840=a22_0x5bcf;for(const _0x2bcbca of _0xa82a11){const _0x940ca8=Number(_0x2bcbca['userId']);if(!Number['isFinite'](_0x940ca8)||_0x940ca8<=0x0)continue;let _0x32b29a=_0x3ae854[_0x136840(0xa4)](_0x940ca8);if(!_0x32b29a)_0x32b29a={'userId':_0x940ca8,'username':nullableText(_0x2bcbca[_0x136840(0xb6)]),'displayName':nullableText(_0x2bcbca[_0x136840(0xba)]),'status':_0x24d54a,'roles':[],'roleKeys':new Set()},_0x3ae854['set'](_0x940ca8,_0x32b29a);else{_0x32b29a[_0x136840(0xb6)]??=nullableText(_0x2bcbca[_0x136840(0xb6)]),_0x32b29a[_0x136840(0xbd)]??=nullableText(_0x2bcbca['nickname']);if(_0x24d54a==='ACTIVE')_0x32b29a[_0x136840(0xac)]='ACTIVE';}const _0x24b641=_0x489849['id']+':'+_0x24d54a;if(_0x32b29a[_0x136840(0xbb)][_0x136840(0xa6)](_0x24b641))continue;_0x32b29a[_0x136840(0xbb)][_0x136840(0xb5)](_0x24b641),_0x32b29a[_0x136840(0xa0)][_0x136840(0xb4)]({'roleId':_0x489849['id'],'roleName':nullableText(_0x489849[_0x136840(0xa5)]),'roleType':nullableText(_0x489849[_0x136840(0xaf)]),'membershipStatus':_0x24d54a});}};for(const _0xb2af0a of _0xdf384){_0x5daf01(_0xb2af0a,_0xb2af0a['userList']??[],_0x1fda8d(0xcc)),_0x5daf01(_0xb2af0a,_0xb2af0a['applyUserList']??[],_0x1fda8d(0xb8));}return[..._0x3ae854['values']()]['map'](_0x11dcb4=>({'userId':_0x11dcb4['userId'],'username':_0x11dcb4[_0x1fda8d(0xb6)],'displayName':_0x11dcb4[_0x1fda8d(0xbd)],'status':_0x11dcb4[_0x1fda8d(0xac)],'roles':_0x11dcb4[_0x1fda8d(0xa0)][_0x1fda8d(0xb3)]((_0x1c29a3,_0xb637c2)=>_0x1c29a3[_0x1fda8d(0xc5)]-_0xb637c2['roleId']||(_0x1c29a3[_0x1fda8d(0xa9)]===_0xb637c2[_0x1fda8d(0xa9)]?0x0:_0x1c29a3[_0x1fda8d(0xa9)]===_0x1fda8d(0xcc)?-0x1:0x1))}))[_0x1fda8d(0xb3)]((_0x18894b,_0xe83ab7)=>_0x18894b[_0x1fda8d(0xaa)]-_0xe83ab7[_0x1fda8d(0xaa)]);}export function enrichAppListItemsWithMergedSelection(_0xaee20b,_0x41045e){const _0x4c0792=a22_0x5bcf;if(!_0x41045e)return;const _0x42a0c9=_0x41045e['apps']&&typeof _0x41045e[_0x4c0792(0xbe)]===_0x4c0792(0xc0)?_0x41045e[_0x4c0792(0xbe)]:{},_0xd958d0=Object[_0x4c0792(0xc4)](_0x42a0c9)[_0x4c0792(0xb7)]>0x0;for(const _0x48ec44 of _0xaee20b){_0x48ec44[_0x4c0792(0xc7)]=![];}const _0x3cdd01=_0x41045e['appCode']!=null?String(_0x41045e['appCode'])[_0x4c0792(0xcb)]():'';if(_0xd958d0){const _0x468c11=_0x41045e[_0x4c0792(0xb1)]??_0x41045e[_0x4c0792(0xa3)];if(_0x468c11)for(const _0x1fbcfb of _0xaee20b){_0x1fbcfb[_0x4c0792(0xc2)]===!![]&&_0x1fbcfb[_0x4c0792(0xbf)]===_0x468c11&&(_0x1fbcfb[_0x4c0792(0xc7)]=!![]);}for(const _0x2a5ef4 of _0xaee20b){if(_0x2a5ef4['named']!==![])continue;if(_0x41045e[_0x4c0792(0xa3)])continue;_0x3cdd01&&String(_0x2a5ef4[_0x4c0792(0xa7)]??'')[_0x4c0792(0xcb)]()===_0x3cdd01&&(_0x2a5ef4[_0x4c0792(0xc7)]=!![]);}return;}if(!_0x3cdd01)return;for(const _0x206e30 of _0xaee20b){String(_0x206e30[_0x4c0792(0xa7)]??'')['trim']()===_0x3cdd01&&(_0x206e30[_0x4c0792(0xc7)]=!![]);}}export function resolveAppScopeForWrite(_0x3a3da3,_0x12f57d,_0xe6e92e){const _0x619573=a22_0x5bcf;if(_0x12f57d)return _0x619573(0xc1);const _0x149e6c=_0xe6e92e[_0x619573(0xc6)][_0x619573(0xbe)]&&typeof _0xe6e92e[_0x619573(0xc6)][_0x619573(0xbe)]==='object'?_0xe6e92e[_0x619573(0xc6)]['apps']:{},_0xefbfd5=_0xe6e92e[_0x619573(0xae)]['apps']&&typeof _0xe6e92e[_0x619573(0xae)][_0x619573(0xbe)]===_0x619573(0xc0)?_0xe6e92e[_0x619573(0xae)][_0x619573(0xbe)]:{};if(Object['prototype'][_0x619573(0xca)][_0x619573(0xbc)](_0x149e6c,_0x3a3da3))return _0x619573(0xcd);if(Object[_0x619573(0xc8)]['hasOwnProperty']['call'](_0xefbfd5,_0x3a3da3))return _0x619573(0xc1);return _0x619573(0xcd);}export function appDefinedIn(_0x5d4b36,_0x56f1cb,_0x37d943,_0x30738b){const _0x4317e2=a22_0x5bcf;if(_0x30738b)return Object[_0x4317e2(0xc8)][_0x4317e2(0xca)][_0x4317e2(0xbc)](_0x37d943,_0x5d4b36)?_0x4317e2(0xcd):_0x4317e2(0xc1);const _0x248022=Object[_0x4317e2(0xc8)]['hasOwnProperty'][_0x4317e2(0xbc)](_0x56f1cb,_0x5d4b36),_0x5d9d75=Object['prototype'][_0x4317e2(0xca)][_0x4317e2(0xbc)](_0x37d943,_0x5d4b36);if(_0x248022&&_0x5d9d75)return _0x4317e2(0xce);if(_0x5d9d75)return _0x4317e2(0xcd);return'global';}export function resolveDefaultAppSource(_0x236c23){const _0x4721f9=a22_0x5bcf,_0x24c48e=_0x236c23[_0x4721f9(0xc6)]['apps']&&typeof _0x236c23[_0x4721f9(0xc6)][_0x4721f9(0xbe)]===_0x4721f9(0xc0)?_0x236c23[_0x4721f9(0xc6)][_0x4721f9(0xbe)]:{};if('defaultApp'in _0x236c23[_0x4721f9(0xc6)])return _0x4721f9(0xcd);if(Object[_0x4721f9(0xc4)](_0x24c48e)['length']>0x0)return _0x4721f9(0xcd);if(_0x236c23[_0x4721f9(0xc6)][_0x4721f9(0xa1)]===![])return null;if(_0x236c23['globalConfig']['defaultApp'])return _0x4721f9(0xc1);return null;}export function getConfigPath(_0x5b169b={}){const _0x5e247c=a22_0x5bcf,_0x48967e=_0x5b169b[_0x5e247c(0xc1)]?_0x5e247c(0xc1):_0x5e247c(0xcd);return resolveWriteConfigPath(_0x48967e);}export function readConfig(_0x4580b2={}){return readConfigFile(getConfigPath(_0x4580b2));}export function writeConfig(_0x3d8e80,_0x1a81bf={}){writeConfigFile(getConfigPath(_0x1a81bf),_0x3d8e80);}function a22_0x5bcf(_0xf348f7,_0x50bdb1){_0xf348f7=_0xf348f7-0xa0;const _0x53322b=a22_0x5332();let _0x5bcf82=_0x53322b[_0xf348f7];return _0x5bcf82;}export function scopeLabel(_0xc48918){const _0x4589aa=a22_0x5bcf;return _0xc48918[_0x4589aa(0xc1)]?_0x4589aa(0xb9):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a23_0x850111=a23_0x3569;function a23_0x172d(){const _0x5587f6=['app-config','POST','1027915hXCCRf','isFinite','high-risk-write','validation','1192980UWqLTz','App\x20config\x20server\x20id\x20missing\x20for\x20key=','708339bbpafY','delete','3213891PaZwhL','appCode','3022TlOkSM','apiError','4zUOrov','37wdsgNX','8ukVXUT','Deleted\x20app\x20config\x20','number','714500LAQMza','688374dsAkmf'];a23_0x172d=function(){return _0x5587f6;};return a23_0x172d();}(function(_0x502a9c,_0x2cbe75){const _0x55b39a=a23_0x3569,_0x1981da=_0x502a9c();while(!![]){try{const _0x5a3f0a=-parseInt(_0x55b39a(0xb0))/0x1*(-parseInt(_0x55b39a(0xad))/0x2)+-parseInt(_0x55b39a(0xa9))/0x3+parseInt(_0x55b39a(0xaf))/0x4*(-parseInt(_0x55b39a(0xb4))/0x5)+-parseInt(_0x55b39a(0xb5))/0x6+parseInt(_0x55b39a(0xb8))/0x7+parseInt(_0x55b39a(0xb1))/0x8*(parseInt(_0x55b39a(0xab))/0x9)+parseInt(_0x55b39a(0xa7))/0xa;if(_0x5a3f0a===_0x2cbe75)break;else _0x1981da['push'](_0x1981da['shift']());}catch(_0x33a0fa){_0x1981da['push'](_0x1981da['shift']());}}}(a23_0x172d,0x2d43f));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='/smartapi/app-config/delete';export const appConfigDelete={'service':a23_0x850111(0xb6),'command':a23_0x850111(0xaa),'description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a23_0x850111(0xba),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1f364e){readKeyArg(_0x1f364e);},async 'dryRun'(_0x377c28){const _0x1916e5=a23_0x850111,_0x393012=readKeyArg(_0x377c28),_0x101cd1=await mustGetByKey(_0x377c28['appCode'],_0x393012);return asAppConfigDryRunResult(buildMutationData({'operation':_0x1916e5(0xaa),'appCode':_0x377c28[_0x1916e5(0xac)],'key':_0x393012,'before':projectAppConfig(_0x101cd1),'after':null,'dryRun':!![]}),{'method':_0x1916e5(0xb7),'url':DELETE_PATH});},async 'execute'(_0x387c8b){const _0x5a20e1=a23_0x850111,_0x3b4f48=readKeyArg(_0x387c8b),_0x3d02d4=await mustGetByKey(_0x387c8b[_0x5a20e1(0xac)],_0x3b4f48);return await withAppConfigApiBoundary(_0x5a20e1(0xaa),{'appCode':_0x387c8b[_0x5a20e1(0xac)],'key':_0x3b4f48},()=>deleteAppConfig({'appCode':_0x387c8b[_0x5a20e1(0xac)],'id':requireAppConfigId(_0x3d02d4,_0x3b4f48,_0x387c8b[_0x5a20e1(0xac)])})),{'ok':!![],'data':buildMutationData({'operation':_0x5a20e1(0xaa),'appCode':_0x387c8b[_0x5a20e1(0xac)],'key':_0x3b4f48,'before':projectAppConfig(_0x3d02d4),'after':null,'dryRun':![]}),'message':_0x5a20e1(0xb2)+_0x3b4f48};}};function a23_0x3569(_0x30f070,_0xe1a041){_0x30f070=_0x30f070-0xa6;const _0x172d44=a23_0x172d();let _0x3569f3=_0x172d44[_0x30f070];return _0x3569f3;}async function mustGetByKey(_0x227ae2,_0x58af72){const _0x83c8bc=a23_0x850111,_0x159075=await withAppConfigApiBoundary('get',{'appCode':_0x227ae2,'key':_0x58af72},()=>getAppConfigByKey(_0x227ae2,_0x58af72));if(!_0x159075)throw CliErrors[_0x83c8bc(0xa6)]('App\x20config\x20key\x20not\x20found:\x20'+_0x58af72,'appCode:\x20'+_0x227ae2);return _0x159075;}function requireAppConfigId(_0x4ac952,_0x118fa1,_0x48a860){const _0x1b518e=a23_0x850111;if(typeof _0x4ac952['id']===_0x1b518e(0xb3)&&Number[_0x1b518e(0xb9)](_0x4ac952['id'])&&_0x4ac952['id']>0x0)return _0x4ac952['id'];throw CliErrors[_0x1b518e(0xae)](_0x1b518e(0xa8)+_0x118fa1+',\x20appCode='+_0x48a860);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x20dd(){const _0x203c3f=['\x20with\x20value\x20revealed','56077frLCCM','Loaded\x20app\x20config\x20','3277324ODxdAf','appCode:\x20','1886330jeHUxZ','appCode','774561eAMqpc','2cHGNaf','bool','210auJjuR','2393576WTaSLa','App\x20config\x20key\x20not\x20found:\x20','4063545xPljYi','app-config','198950oeUwqR','get','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','reveal','read','\x20with\x20value\x20redacted'];a24_0x20dd=function(){return _0x203c3f;};return a24_0x20dd();}const a24_0x3faa4f=a24_0x3baf;(function(_0x575cd1,_0x1a81cb){const _0x42cd38=a24_0x3baf,_0x50010a=_0x575cd1();while(!![]){try{const _0x4923c2=-parseInt(_0x42cd38(0x9a))/0x1*(-parseInt(_0x42cd38(0xa1))/0x2)+parseInt(_0x42cd38(0x99))/0x3+parseInt(_0x42cd38(0x95))/0x4+-parseInt(_0x42cd38(0x97))/0x5+parseInt(_0x42cd38(0x9c))/0x6*(parseInt(_0x42cd38(0x93))/0x7)+-parseInt(_0x42cd38(0x9d))/0x8+-parseInt(_0x42cd38(0x9f))/0x9;if(_0x4923c2===_0x1a81cb)break;else _0x50010a['push'](_0x50010a['shift']());}catch(_0x2a5657){_0x50010a['push'](_0x50010a['shift']());}}}(a24_0x20dd,0x68b55));import{getAppConfigByKey}from'../../core/api-client.js';function a24_0x3baf(_0x26bd4a,_0x5a6ecd){_0x26bd4a=_0x26bd4a-0x8d;const _0x20dde3=a24_0x20dd();let _0x3bafc9=_0x20dde3[_0x26bd4a];return _0x3bafc9;}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_0x3faa4f(0xa0),'command':'get','description':a24_0x3faa4f(0x8e),'risk':a24_0x3faa4f(0x90),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x446dec){readKeyArg(_0x446dec);},async 'execute'(_0x484671){const _0x40926c=a24_0x3faa4f,_0x1f963c=readKeyArg(_0x484671),_0x281193=await withAppConfigApiBoundary(_0x40926c(0x8d),{'appCode':_0x484671[_0x40926c(0x98)],'key':_0x1f963c},()=>getAppConfigByKey(_0x484671[_0x40926c(0x98)],_0x1f963c));if(!_0x281193)throw CliErrors['validation'](_0x40926c(0x9e)+_0x1f963c,_0x40926c(0x96)+_0x484671[_0x40926c(0x98)]);const _0x5b5b4f=projectAppConfig(_0x281193,{'reveal':_0x484671[_0x40926c(0x9b)](_0x40926c(0x8f))});return{'ok':!![],'data':{'config':_0x5b5b4f},'message':_0x484671[_0x40926c(0x9b)](_0x40926c(0x8f))?_0x40926c(0x94)+_0x1f963c+_0x40926c(0x92):_0x40926c(0x94)+_0x1f963c+_0x40926c(0x91)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3529a9,_0x923013){const _0x35a807=a25_0x31f3,_0x219982=_0x3529a9();while(!![]){try{const _0x426da5=parseInt(_0x35a807(0x87))/0x1+parseInt(_0x35a807(0x89))/0x2+-parseInt(_0x35a807(0x8d))/0x3+parseInt(_0x35a807(0x8b))/0x4*(parseInt(_0x35a807(0x86))/0x5)+parseInt(_0x35a807(0x8a))/0x6+-parseInt(_0x35a807(0x88))/0x7*(parseInt(_0x35a807(0x85))/0x8)+parseInt(_0x35a807(0x8e))/0x9*(-parseInt(_0x35a807(0x8c))/0xa);if(_0x426da5===_0x923013)break;else _0x219982['push'](_0x219982['shift']());}catch(_0x119942){_0x219982['push'](_0x219982['shift']());}}}(a25_0xc58e,0xea89d));function a25_0xc58e(){const _0x20769e=['42MmPBtZ','1148080MRLVhg','3845772EMvlWE','5518636agyvKT','70lOJxuj','5254950ExJnQe','1182519irOtea','456944BMoLDv','5xjiPbN','1380103TYiTVH'];a25_0xc58e=function(){return _0x20769e;};return a25_0xc58e();}import{appConfigList}from'../../commands/app-config/list.js';function a25_0x31f3(_0xca21de,_0x534555){_0xca21de=_0xca21de-0x85;const _0xc58ec6=a25_0xc58e();let _0x31f3fb=_0xc58ec6[_0xca21de];return _0x31f3fb;}import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x168703=a26_0x187d;(function(_0x4db62c,_0x3f1869){const _0x446a09=a26_0x187d,_0x2fd362=_0x4db62c();while(!![]){try{const _0x389457=-parseInt(_0x446a09(0x1a8))/0x1+parseInt(_0x446a09(0x1aa))/0x2+-parseInt(_0x446a09(0x1b3))/0x3+parseInt(_0x446a09(0x1a6))/0x4+-parseInt(_0x446a09(0x1a3))/0x5*(-parseInt(_0x446a09(0x1ad))/0x6)+-parseInt(_0x446a09(0x1a5))/0x7+parseInt(_0x446a09(0x1a1))/0x8;if(_0x389457===_0x3f1869)break;else _0x2fd362['push'](_0x2fd362['shift']());}catch(_0x5d0c16){_0x2fd362['push'](_0x2fd362['shift']());}}}(a26_0x3f1e,0x80bee));import{listAppConfigs}from'../../core/api-client.js';function a26_0x187d(_0x115af1,_0x56ade0){_0x115af1=_0x115af1-0x1a0;const _0x3f1ea1=a26_0x3f1e();let _0x187db3=_0x3f1ea1[_0x115af1];return _0x187db3;}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_0x168703(0x1ab),'command':a26_0x168703(0x1a4),'description':a26_0x168703(0x1b1),'risk':a26_0x168703(0x1a0),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x168703(0x1a9),'type':a26_0x168703(0x1a7),'description':'Filter\x20by\x20exact\x20config\x20key'},TAGS_FLAG],async 'validate'(_0x110dda){const _0x1acb18=a26_0x168703,_0x33afef=_0x110dda[_0x1acb18(0x1ae)](_0x1acb18(0x1a9))['trim']();if(_0x33afef)validateKey(_0x33afef);readOptionalTags(_0x110dda);},async 'execute'(_0x28a8ce){const _0x55b251=a26_0x168703,_0x28ca7d=_0x28a8ce[_0x55b251(0x1ae)](_0x55b251(0x1a9))[_0x55b251(0x1ac)]()||undefined,_0x17c47f=readOptionalTags(_0x28a8ce),_0x5222a2=await withAppConfigApiBoundary(_0x55b251(0x1a4),{'appCode':_0x28a8ce[_0x55b251(0x1b2)]},()=>listAppConfigs(_0x28a8ce[_0x55b251(0x1b2)],{'key':_0x28ca7d,'tags':_0x17c47f})),_0xc46343=_0x5222a2[_0x55b251(0x1af)](_0x26556a=>projectAppConfig(_0x26556a));return{'ok':!![],'data':{'appCode':_0x28a8ce[_0x55b251(0x1b2)],'count':_0xc46343[_0x55b251(0x1a2)],'configs':_0xc46343},'message':'Found\x20'+_0xc46343[_0x55b251(0x1a2)]+_0x55b251(0x1b0)};}};function a26_0x3f1e(){const _0x5a60a2=['map','\x20app\x20config(s)','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','appCode','2606448uojfRj','read','13752072dLQMgt','length','5EnJCUs','list','6100262RdQmNS','7544slNzYE','string','190641eXizvW','key','540536jduyrR','app-config','trim','2802612kWFqMZ','str'];a26_0x3f1e=function(){return _0x5a60a2;};return a26_0x3f1e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x38a9a1=a27_0x9bbb;(function(_0x29eac3,_0x4590c6){const _0x485236=a27_0x9bbb,_0x105847=_0x29eac3();while(!![]){try{const _0x47c147=-parseInt(_0x485236(0x1c1))/0x1+-parseInt(_0x485236(0x1c7))/0x2+parseInt(_0x485236(0x1bb))/0x3*(parseInt(_0x485236(0x1cf))/0x4)+-parseInt(_0x485236(0x1c5))/0x5+parseInt(_0x485236(0x1c9))/0x6+-parseInt(_0x485236(0x1cd))/0x7*(parseInt(_0x485236(0x1bc))/0x8)+parseInt(_0x485236(0x1ba))/0x9*(parseInt(_0x485236(0x1d0))/0xa);if(_0x47c147===_0x4590c6)break;else _0x105847['push'](_0x105847['shift']());}catch(_0x1a2524){_0x105847['push'](_0x105847['shift']());}}}(a27_0x5624,0xaa22b));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a27_0x5624(){const _0x186e82=['Updated','update',',\x20appCode=','number','3765zWIWtR','/smartapi/app-config/update','file','/smartapi/app-config/create','3696860CnpHkp','\x20app\x20config\x20','477734vyZESc','App\x20config\x20server\x20id\x20missing\x20for\x20key=','4143654phtUYX','appCode','POST','create','18277LkRqUV','tags','324QJxhPQ','430iYvJkI','get','high-risk-write','376002HWsStJ','18129kyGcVH','3976nfsIIy'];a27_0x5624=function(){return _0x186e82;};return a27_0x5624();}const CREATE_PATH=a27_0x38a9a1(0x1c4),UPDATE_PATH=a27_0x38a9a1(0x1c2);export const appConfigSet={'service':'app-config','command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x38a9a1(0x1b9),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x38a9a1(0x1c3),'type':'string','description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x2c2d8b){readKeyArg(_0x2c2d8b),readOptionalTags(_0x2c2d8b),assertSingleValueSource(_0x2c2d8b);},async 'dryRun'(_0x3d2def){const _0x4174e7=a27_0x38a9a1,_0x5270ab=readKeyArg(_0x3d2def),_0x166c2e=readOptionalTags(_0x3d2def),_0x196511=assertSingleValueSource(_0x3d2def);await assertValueSourceReadable(_0x196511);const _0x557185=await withAppConfigApiBoundary(_0x4174e7(0x1d1),{'appCode':_0x3d2def[_0x4174e7(0x1ca)],'key':_0x5270ab},()=>getAppConfigByKey(_0x3d2def[_0x4174e7(0x1ca)],_0x5270ab)),_0x2a04f4=_0x557185?_0x4174e7(0x1be):_0x4174e7(0x1cc),_0x1db40d=_0x557185?projectAppConfig(_0x557185):null,_0x2555ec=plannedAppConfig({'appCode':_0x3d2def[_0x4174e7(0x1ca)],'key':_0x5270ab,'tags':_0x166c2e??_0x557185?.[_0x4174e7(0x1ce)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x2a04f4,'appCode':_0x3d2def[_0x4174e7(0x1ca)],'key':_0x5270ab,'before':_0x1db40d,'after':_0x2555ec,'dryRun':!![]}),{'method':_0x4174e7(0x1cb),'url':_0x2a04f4==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4c7714){const _0x3e3516=a27_0x38a9a1,_0x497fa6=readKeyArg(_0x4c7714),_0x1ffccc=readOptionalTags(_0x4c7714),_0x49a9ff=await withAppConfigApiBoundary(_0x3e3516(0x1d1),{'appCode':_0x4c7714['appCode'],'key':_0x497fa6},()=>getAppConfigByKey(_0x4c7714[_0x3e3516(0x1ca)],_0x497fa6)),_0x2ad809=_0x49a9ff?projectAppConfig(_0x49a9ff):null,_0x86e2d5=_0x49a9ff?'update':_0x3e3516(0x1cc),{value:_0x5be9db,warnings:_0x4c440f}=await readAppConfigValue(_0x4c7714),_0x3be358={'appCode':_0x4c7714[_0x3e3516(0x1ca)],'key':_0x497fa6,'value':_0x5be9db,'tags':_0x1ffccc??_0x49a9ff?.['tags']??undefined};await withAppConfigApiBoundary(_0x86e2d5,{'appCode':_0x4c7714[_0x3e3516(0x1ca)],'key':_0x497fa6},async()=>{const _0x256e10=_0x3e3516;_0x49a9ff?await updateAppConfig({..._0x3be358,'id':requireAppConfigId(_0x49a9ff,_0x497fa6,_0x4c7714[_0x256e10(0x1ca)])}):await createAppConfig(_0x3be358);});const _0x28c507=await withAppConfigApiBoundary(_0x3e3516(0x1d1),{'appCode':_0x4c7714[_0x3e3516(0x1ca)],'key':_0x497fa6},()=>getAppConfigByKey(_0x4c7714['appCode'],_0x497fa6)),_0x277d6d=_0x28c507?projectAppConfig(_0x28c507):plannedAppConfig({'appCode':_0x4c7714[_0x3e3516(0x1ca)],'key':_0x497fa6,'tags':_0x3be358[_0x3e3516(0x1ce)],'hasValue':_0x5be9db!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x86e2d5,'appCode':_0x4c7714[_0x3e3516(0x1ca)],'key':_0x497fa6,'before':_0x2ad809,'after':_0x277d6d,'dryRun':![],'warnings':_0x4c440f}),'message':(_0x86e2d5===_0x3e3516(0x1be)?_0x3e3516(0x1bd):'Created')+_0x3e3516(0x1c6)+_0x497fa6};}};function a27_0x9bbb(_0x23d349,_0x59a01b){_0x23d349=_0x23d349-0x1b9;const _0x562425=a27_0x5624();let _0x9bbbe=_0x562425[_0x23d349];return _0x9bbbe;}function requireAppConfigId(_0x4a5e28,_0x17ff26,_0x34f4f3){const _0x3d61b1=a27_0x38a9a1;if(typeof _0x4a5e28['id']===_0x3d61b1(0x1c0)&&Number['isFinite'](_0x4a5e28['id'])&&_0x4a5e28['id']>0x0)return _0x4a5e28['id'];throw CliErrors['apiError'](_0x3d61b1(0x1c8)+_0x17ff26+_0x3d61b1(0x1bf)+_0x34f4f3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4983d2=a28_0x40a2;function a28_0x40a2(_0x2a1d11,_0x4553da){_0x2a1d11=_0x2a1d11-0x168;const _0x3d7f5b=a28_0x3d7f();let _0x40a2ca=_0x3d7f5b[_0x2a1d11];return _0x40a2ca;}(function(_0x9ad88e,_0x17bac2){const _0x5a0fc4=a28_0x40a2,_0x1b9cb8=_0x9ad88e();while(!![]){try{const _0x59ffc8=-parseInt(_0x5a0fc4(0x18c))/0x1+-parseInt(_0x5a0fc4(0x16d))/0x2*(parseInt(_0x5a0fc4(0x194))/0x3)+parseInt(_0x5a0fc4(0x17f))/0x4+-parseInt(_0x5a0fc4(0x172))/0x5+-parseInt(_0x5a0fc4(0x171))/0x6*(parseInt(_0x5a0fc4(0x170))/0x7)+parseInt(_0x5a0fc4(0x179))/0x8*(-parseInt(_0x5a0fc4(0x197))/0x9)+parseInt(_0x5a0fc4(0x190))/0xa;if(_0x59ffc8===_0x17bac2)break;else _0x1b9cb8['push'](_0x1b9cb8['shift']());}catch(_0x55206e){_0x1b9cb8['push'](_0x1b9cb8['shift']());}}}(a28_0x3d7f,0x267b7));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x4983d2(0x193),'description':a28_0x4983d2(0x1a1),'required':!![]};export const VALUE_ARG={'name':a28_0x4983d2(0x18d),'description':a28_0x4983d2(0x178),'required':![]};export const TAGS_FLAG={'name':a28_0x4983d2(0x16f),'type':'string','description':a28_0x4983d2(0x177)};export const STDIN_FLAG={'name':a28_0x4983d2(0x198),'type':a28_0x4983d2(0x19f),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a28_0x4983d2(0x191),'type':'string','description':a28_0x4983d2(0x18f)};export const REVEAL_FLAG={'name':'reveal','type':a28_0x4983d2(0x19f),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x5c4f56){const _0x1b11ab=a28_0x4983d2,_0x5b9933=_0x5c4f56[_0x1b11ab(0x1a5)][0x0]?.[_0x1b11ab(0x16a)]()??'';return validateKey(_0x5b9933),_0x5b9933;}export function readOptionalTags(_0x1ec57f){const _0x497222=a28_0x4983d2,_0x4af392=_0x1ec57f['str'](_0x497222(0x16f))['trim']();if(!_0x4af392)return undefined;if(_0x4af392[_0x497222(0x187)]>0x20)throw CliErrors[_0x497222(0x19a)](_0x497222(0x176));return _0x4af392;}export function validateKey(_0x1f4527){const _0x29f34e=a28_0x4983d2;if(!_0x1f4527)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x1f4527[_0x29f34e(0x187)]>0x100)throw CliErrors[_0x29f34e(0x19a)](_0x29f34e(0x1a0));}export function projectAppConfig(_0x4c53d5,_0x2ca4fa){const _0x4f5663=a28_0x4983d2,_0x4bd8ad=_0x4c53d5[_0x4f5663(0x18d)]!==undefined&&_0x4c53d5['value']!==null&&_0x4c53d5[_0x4f5663(0x18d)]!=='',_0x51f1d0={'appCode':_0x4c53d5[_0x4f5663(0x183)],'key':_0x4c53d5['key'],'tags':_0x4c53d5[_0x4f5663(0x16f)]??undefined,'hasValue':_0x4bd8ad,'valueRedacted':_0x4bd8ad&&!_0x2ca4fa?.[_0x4f5663(0x181)],'gmtCreate':_0x4c53d5[_0x4f5663(0x19e)],'gmtModified':_0x4c53d5['gmtModified']};return _0x2ca4fa?.[_0x4f5663(0x181)]&&(_0x51f1d0[_0x4f5663(0x18d)]=_0x4c53d5[_0x4f5663(0x18d)]??'',_0x51f1d0['valueRedacted']=![]),_0x51f1d0;}function a28_0x3d7f(){const _0x5b2dbe=['value','join','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','8151120ZVIQSS','from-env','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','key','33846DGchuL','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','once','98244NfNyWb','stdin','kind','validation','end','utf8','App\x20config\x20value\x20source\x20is\x20ambiguous.','gmtCreate','boolean','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Runtime\x20app-config\x20key','bool','name','appCode:\x20','args','Environment\x20variable\x20is\x20not\x20set:\x20','value\x20is\x20redacted','trim','env','file','52GWEiIR','dryRun','tags','833GhBfpj','11190DfHwpd','321760DSHstA','method','Missing\x20app-config\x20value\x20source.','Value\x20file\x20is\x20not\x20readable:\x20','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Config\x20tags\x20for\x20filtering/display\x20metadata','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','48ldkeQy','push','path','\x20app\x20config.','flag','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','629684zzikNC','defineProperties','reveal','key:\x20','appCode','warnings','data','str','length','argument','apiError','Failed\x20to\x20','error','169795SRqkVL'];a28_0x3d7f=function(){return _0x5b2dbe;};return a28_0x3d7f();}export function plannedAppConfig(_0x4e79e1){const _0x228ed3=a28_0x4983d2,_0xe23e6=_0x4e79e1['hasValue']??!![];return{'appCode':_0x4e79e1[_0x228ed3(0x183)],'key':_0x4e79e1[_0x228ed3(0x193)],'tags':_0x4e79e1[_0x228ed3(0x16f)]??undefined,'hasValue':_0xe23e6,'valueRedacted':_0xe23e6};}export function buildMutationData(_0x40bdcb){const _0x31cd80=a28_0x4983d2;return{'operation':_0x40bdcb['operation'],'selector':{'appCode':_0x40bdcb[_0x31cd80(0x183)],'key':_0x40bdcb[_0x31cd80(0x193)]},'before':_0x40bdcb['before'],'after':_0x40bdcb['after'],'dryRun':_0x40bdcb[_0x31cd80(0x16e)],'warnings':_0x40bdcb[_0x31cd80(0x184)]??[]};}export async function withAppConfigApiBoundary(_0x33c448,_0x296968,_0x5d3fd1){const _0x1291f8=a28_0x4983d2;try{return await _0x5d3fd1();}catch{const _0xc667b0=[_0x1291f8(0x1a4)+_0x296968[_0x1291f8(0x183)]];if(_0x296968[_0x1291f8(0x193)])_0xc667b0[_0x1291f8(0x17a)](_0x1291f8(0x182)+_0x296968[_0x1291f8(0x193)]);_0xc667b0['push'](_0x1291f8(0x169));throw CliErrors[_0x1291f8(0x189)](_0x1291f8(0x18a)+_0x33c448+_0x1291f8(0x17c),_0xc667b0[_0x1291f8(0x18e)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x270d32,_0x9fb4a5){const _0x2f6b5c=a28_0x4983d2;return Object[_0x2f6b5c(0x180)](_0x270d32,{'method':{'value':_0x9fb4a5[_0x2f6b5c(0x173)],'enumerable':![]},'url':{'value':_0x9fb4a5['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x22229d){const _0x23150b=a28_0x4983d2,_0x51aeee=[];_0x22229d[_0x23150b(0x1a5)][_0x23150b(0x187)]>0x1&&_0x51aeee[_0x23150b(0x17a)]({'kind':_0x23150b(0x188),'value':_0x22229d[_0x23150b(0x1a5)]['slice'](0x1)[_0x23150b(0x18e)]('\x20')});const _0x2e0e76=_0x22229d[_0x23150b(0x17d)](_0x23150b(0x18d));_0x2e0e76!==undefined&&_0x2e0e76!==null&&_0x51aeee['push']({'kind':_0x23150b(0x188),'value':String(_0x2e0e76)});_0x22229d[_0x23150b(0x1a2)](_0x23150b(0x198))&&_0x51aeee[_0x23150b(0x17a)]({'kind':_0x23150b(0x198)});const _0x393440=_0x22229d[_0x23150b(0x186)](_0x23150b(0x191))[_0x23150b(0x16a)]();_0x393440&&_0x51aeee[_0x23150b(0x17a)]({'kind':_0x23150b(0x16b),'name':_0x393440});const _0x39c74a=_0x22229d[_0x23150b(0x186)]('file')[_0x23150b(0x16a)]();_0x39c74a&&_0x51aeee[_0x23150b(0x17a)]({'kind':'file','path':_0x39c74a});if(_0x51aeee[_0x23150b(0x187)]===0x0)throw CliErrors['validation'](_0x23150b(0x174),_0x23150b(0x17e));if(_0x51aeee[_0x23150b(0x187)]>0x1)throw CliErrors['validation'](_0x23150b(0x19d),_0x23150b(0x195));return _0x51aeee[0x0];}export async function assertValueSourceReadable(_0x3a5288){const _0x9a8caa=a28_0x4983d2;if(_0x3a5288[_0x9a8caa(0x199)]===_0x9a8caa(0x16b)&&!(_0x3a5288['name']in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x3a5288[_0x9a8caa(0x1a3)]);if(_0x3a5288[_0x9a8caa(0x199)]===_0x9a8caa(0x16c))try{await access(_0x3a5288['path']);}catch{throw CliErrors['validation'](_0x9a8caa(0x175)+_0x3a5288['path']);}}export async function readAppConfigValue(_0x2ef3d2){const _0x3ac69e=a28_0x4983d2,_0x1ee3d8=assertSingleValueSource(_0x2ef3d2),_0x3da0f1=[];if(_0x1ee3d8[_0x3ac69e(0x199)]==='argument')return _0x3da0f1[_0x3ac69e(0x17a)](_0x3ac69e(0x192)),{'value':_0x1ee3d8[_0x3ac69e(0x18d)]??'','source':_0x1ee3d8['kind'],'warnings':_0x3da0f1};if(_0x1ee3d8[_0x3ac69e(0x199)]===_0x3ac69e(0x198))return{'value':await readStdin(),'source':_0x1ee3d8[_0x3ac69e(0x199)],'warnings':_0x3da0f1};if(_0x1ee3d8[_0x3ac69e(0x199)]===_0x3ac69e(0x16b)){if(!(_0x1ee3d8[_0x3ac69e(0x1a3)]in process.env))throw CliErrors['validation'](_0x3ac69e(0x168)+_0x1ee3d8[_0x3ac69e(0x1a3)]);return{'value':process.env[_0x1ee3d8.name]??'','source':_0x1ee3d8[_0x3ac69e(0x199)],'warnings':_0x3da0f1};}return{'value':await readFile(_0x1ee3d8[_0x3ac69e(0x17b)],'utf8'),'source':_0x1ee3d8[_0x3ac69e(0x199)],'warnings':_0x3da0f1};}function readStdin(){return new Promise((_0x2fc207,_0x2a6acf)=>{const _0x5a1e2e=a28_0x40a2;let _0x5d1573='';process[_0x5a1e2e(0x198)]['setEncoding'](_0x5a1e2e(0x19c)),process[_0x5a1e2e(0x198)]['on'](_0x5a1e2e(0x185),_0x595e7e=>{_0x5d1573+=_0x595e7e;}),process['stdin'][_0x5a1e2e(0x196)](_0x5a1e2e(0x19b),()=>_0x2fc207(_0x5d1573)),process[_0x5a1e2e(0x198)][_0x5a1e2e(0x196)](_0x5a1e2e(0x18b),_0x2a6acf);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x4f459=a29_0x2071;function a29_0x2071(_0x355f91,_0x2567d9){_0x355f91=_0x355f91-0xde;const _0x5cdd87=a29_0x5cdd();let _0x2071ee=_0x5cdd87[_0x355f91];return _0x2071ee;}(function(_0x25afe6,_0x36edfa){const _0x173881=a29_0x2071,_0x5d1eda=_0x25afe6();while(!![]){try{const _0x2b3716=-parseInt(_0x173881(0xe3))/0x1+-parseInt(_0x173881(0xee))/0x2+-parseInt(_0x173881(0xe5))/0x3*(parseInt(_0x173881(0xed))/0x4)+-parseInt(_0x173881(0xde))/0x5+-parseInt(_0x173881(0xe2))/0x6*(parseInt(_0x173881(0xeb))/0x7)+-parseInt(_0x173881(0xf0))/0x8+parseInt(_0x173881(0xf2))/0x9;if(_0x2b3716===_0x36edfa)break;else _0x5d1eda['push'](_0x5d1eda['shift']());}catch(_0x48eccc){_0x5d1eda['push'](_0x5d1eda['shift']());}}}(a29_0x5cdd,0xd35c2));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0x4f459(0xf1),'command':a29_0x4f459(0xe1),'description':a29_0x4f459(0xec),'risk':a29_0x4f459(0xe0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x4f459(0xef),'type':a29_0x4f459(0xe6),'description':a29_0x4f459(0xe8),'default':![]}],async 'execute'(_0x50bf43){const _0xa0576c=a29_0x4f459,{runAuthServer:_0x5065ec}=await import('../../auth/auth-server-ui.js');return await _0x5065ec({'autoYes':_0x50bf43[_0xa0576c(0xe4)](_0xa0576c(0xef)),'nonInteractive':_0x50bf43['nonInteractive']}),{'ok':!![]};}},{'service':a29_0x4f459(0xf1),'command':a29_0x4f459(0xea),'description':a29_0x4f459(0xe7),'risk':a29_0x4f459(0xe9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x691bb3){const _0xcbf81c=a29_0x4f459;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console['log'](_0xcbf81c(0xdf)),{'ok':!![]};}}];function a29_0x5cdd(){const _0x4c4a5e=['read','login','24yPXvjS','643213GdESRp','bool','9nwssKE','boolean','Clear\x20login\x20session','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','write','logout','650048xfoKZE','Login\x20via\x20browser','946820jdcAej','2536144IpmBkw','yes','8527944ZGJcet','auth','50932251pIjdqh','3672800tzLMbE','!\x20Not\x20logged\x20in'];a29_0x5cdd=function(){return _0x4c4a5e;};return a29_0x5cdd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x1fbc69=a30_0x8070;(function(_0x2023c3,_0xecaa1f){const _0x231fc7=a30_0x8070,_0x5d901e=_0x2023c3();while(!![]){try{const _0x14b496=-parseInt(_0x231fc7(0xc1))/0x1+-parseInt(_0x231fc7(0x89))/0x2*(-parseInt(_0x231fc7(0xa3))/0x3)+parseInt(_0x231fc7(0xa7))/0x4+parseInt(_0x231fc7(0x72))/0x5*(parseInt(_0x231fc7(0xb5))/0x6)+-parseInt(_0x231fc7(0xc8))/0x7+-parseInt(_0x231fc7(0xc9))/0x8*(-parseInt(_0x231fc7(0x85))/0x9)+parseInt(_0x231fc7(0xbe))/0xa*(-parseInt(_0x231fc7(0xa1))/0xb);if(_0x14b496===_0xecaa1f)break;else _0x5d901e['push'](_0x5d901e['shift']());}catch(_0x1bec1d){_0x5d901e['push'](_0x5d901e['shift']());}}}(a30_0x3974,0xb703d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a30_0x3974(){const _0x4bf50e=['Select\x20dataset:','create','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','length','trim','File\x20already\x20exists:\x20','before','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x20function:\x20','datasetcode','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','4169uSFlMf','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','156JZXaNq','operationType','appCode','parseInt','3621200GiOZAv','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','description','source','HOOK','write','str','TODO:\x20add\x20script\x20description','ENDPOINT','nonInteractive','No\x20datasets\x20found\x20for\x20this\x20app.','Invalid\x20dataset\x20selection.','Select\x20trigger\x20node:','find','74808axFxXV','Alias\x20\x22','\x22\x20not\x20found.\x20','alias','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','UNKNOWN','apiDir','code','78290XDyaMZ','No\x20operation\x20types\x20found\x20for\x20dataset\x20','bff','185752YNeIWC','string','type','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','validation','1219596KyEFVB','5661360ouLekI','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22.\x20','name',']\x20(','470SBbvHv','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','function-node','question','\x22\x20not\x20found\x20for\x20dataset\x20','isInteger','operation-type','HOOK\x20requires\x20alias/operation/node\x20options.','join','datasetCode','Script\x20description','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Script\x20type','Available\x20aliases:\x20','utf8','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','.js','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','18dlXjll','\x0a\x20*\x20[触发节点]\x20','\x20api\x20pull`\x20to\x20refresh.','Available:\x20','22468ImHyVi','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','functionNode','stderr','map','Operation\x20type\x20\x22','Invalid\x20function\x20name\x20\x22','Created\x20','Trigger\x20node\x20(HOOK\x20only)','read','after','Operation\x20type\x20(HOOK\x20only)'];a30_0x3974=function(){return _0x4bf50e;};return a30_0x3974();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a30_0x8070(_0x5c80dc,_0x3ce30b){_0x5c80dc=_0x5c80dc-0x71;const _0x39746b=a30_0x3974();let _0x80707f=_0x39746b[_0x5c80dc];return _0x80707f;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x1fbc69(0xc0),'command':a30_0x1fbc69(0x96),'description':a30_0x1fbc69(0xc4),'risk':a30_0x1fbc69(0x92),'flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON',a30_0x1fbc69(0xaf),'HOOK'],'description':a30_0x1fbc69(0x7f)},{'name':a30_0x1fbc69(0xcc),'type':a30_0x1fbc69(0xc2),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x1fbc69(0xa9),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x7d)},{'name':a30_0x1fbc69(0xb8),'type':a30_0x1fbc69(0xc2),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x1fbc69(0x9f),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x73)},{'name':a30_0x1fbc69(0x79),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x94)},{'name':a30_0x1fbc69(0x75),'type':a30_0x1fbc69(0xc2),'description':a30_0x1fbc69(0x91),'enum':[a30_0x1fbc69(0x9c),'after']}],async 'validate'(_0x56408c){const _0x1eadca=a30_0x1fbc69,_0x34d052=_0x56408c[_0x1eadca(0xad)](_0x1eadca(0xcc));if(!isValidBffFunctionName(_0x34d052))throw CliErrors[_0x1eadca(0xc7)](_0x1eadca(0x8f)+_0x34d052+_0x1eadca(0x9d));},async 'execute'(_0x294699){const _0x387e4b=a30_0x1fbc69,_0x179062=loadBffProjectConfig(_0x294699[_0x387e4b(0xa5)]),_0x441226=_0x294699[_0x387e4b(0xad)](_0x387e4b(0xc3)),_0x333d0d=_0x294699[_0x387e4b(0xad)](_0x387e4b(0xcc)),_0x21a018=_0x294699['str'](_0x387e4b(0xa9))||undefined,_0x2167ed=_0x441226===_0x387e4b(0xab)?await resolveHookOptions(_0x179062,_0x294699):undefined,_0x513681=buildFilePath(_0x179062,_0x441226,_0x333d0d,_0x2167ed);if(await fileExists(_0x513681))throw CliErrors[_0x387e4b(0xc7)](_0x387e4b(0x9b)+_0x513681);await mkdir(dirname(_0x513681),{'recursive':!![]});const _0x44c6ed=generateTemplate(_0x441226,_0x333d0d,_0x294699[_0x387e4b(0xa5)],_0x21a018,_0x2167ed);await writeFile(_0x513681,_0x44c6ed,_0x387e4b(0x81));const _0x4e9f44={'type':_0x441226,'name':_0x333d0d,'path':_0x513681};if(_0x21a018)_0x4e9f44[_0x387e4b(0xa9)]=_0x21a018;if(_0x2167ed){if(_0x2167ed[_0x387e4b(0xb8)])_0x4e9f44[_0x387e4b(0xb8)]=_0x2167ed['alias'];_0x4e9f44[_0x387e4b(0x7c)]=_0x2167ed['datasetCode'],_0x4e9f44[_0x387e4b(0xa4)]=_0x2167ed[_0x387e4b(0xa4)],_0x4e9f44[_0x387e4b(0x8b)]=_0x2167ed[_0x387e4b(0x8b)];}return{'ok':!![],'data':_0x4e9f44,'message':_0x387e4b(0x90)+_0x441226+_0x387e4b(0x9e)+_0x333d0d};}};async function resolveHookOptions(_0x319e3b,_0x55adb6){const _0xfd5a0f=a30_0x1fbc69,_0x4c398e=loadAliasMap(_0x55adb6[_0xfd5a0f(0xbc)],undefined,resolveApiFilePath(_0x55adb6[_0xfd5a0f(0xbc)],_0x55adb6['appCode'])),_0xad0479=_0x4c398e['length']>0x0;let _0x37a94e,_0xd146c,_0x1e14da;const _0x36c368=_0x55adb6['str'](_0xfd5a0f(0xb8)),_0x3a0078=_0x55adb6[_0xfd5a0f(0xad)]('datasetcode');if(_0x36c368){const _0x2b2b01=resolveAlias(_0x55adb6[_0xfd5a0f(0xbc)],_0x36c368,undefined,resolveApiFilePath(_0x55adb6[_0xfd5a0f(0xbc)],_0x55adb6[_0xfd5a0f(0xa5)]));if(!_0x2b2b01){const _0x5ad3b9=_0xad0479?_0xfd5a0f(0x80)+_0x4c398e[_0xfd5a0f(0x8d)](_0x3534a3=>_0x3534a3[_0xfd5a0f(0xb8)])[_0xfd5a0f(0x7b)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0xfd5a0f(0x98);throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xb6)+_0x36c368+_0xfd5a0f(0xb7)+_0x5ad3b9);}_0x37a94e=_0x36c368,_0xd146c=_0x2b2b01;}else{if(_0x3a0078){_0xd146c=_0x3a0078;const _0xe0a62d=_0x4c398e['find'](_0x38071b=>_0x38071b['datasetCode']===_0x3a0078);_0x37a94e=_0xe0a62d?.[_0xfd5a0f(0xb8)];}else{if(_0x55adb6[_0xfd5a0f(0xb0)])throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x8a));else{if(_0xad0479){const _0x193c98=_0x4c398e[_0xfd5a0f(0x8d)](_0x1a044e=>_0x1a044e[_0xfd5a0f(0xb8)]+'\x20('+_0x1a044e['tableName']+')'),_0x545aaf=await promptSelect(_0xfd5a0f(0x95),_0x193c98),_0x44a3cf=_0x4c398e[_0x545aaf];if(!_0x44a3cf)throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xb2));_0x37a94e=_0x44a3cf['alias'],_0xd146c=_0x44a3cf[_0xfd5a0f(0x7c)];}else{const _0x499dd8=await listDatasets(_0x55adb6[_0xfd5a0f(0xa5)]);if(_0x499dd8[_0xfd5a0f(0x99)]===0x0)throw CliErrors['validation'](_0xfd5a0f(0xb1));const _0x404d04=_0x499dd8[_0xfd5a0f(0x8d)](_0x55c182=>_0x55c182[_0xfd5a0f(0xcc)]+'\x20['+(_0x55c182[_0xfd5a0f(0xaa)]??_0xfd5a0f(0xbb))+_0xfd5a0f(0x71)+_0x55c182[_0xfd5a0f(0xbd)]+')'),_0x43d794=await promptSelect('Select\x20dataset:',_0x404d04),_0x1f74e5=_0x499dd8[_0x43d794];if(!_0x1f74e5)throw CliErrors[_0xfd5a0f(0xc7)]('Invalid\x20dataset\x20selection.');_0xd146c=_0x1f74e5['code'],_0x37a94e=undefined;}}}}const _0x4f4b22=await listDatasets(_0x55adb6[_0xfd5a0f(0xa5)]),_0x3751eb=_0x4f4b22[_0xfd5a0f(0xb4)](_0x17fa37=>_0x17fa37[_0xfd5a0f(0xbd)]===_0xd146c);if(!_0x3751eb)throw CliErrors[_0xfd5a0f(0xc7)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0xd146c+_0xfd5a0f(0xcb)+(_0x37a94e?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0xfd5a0f(0x87):''));_0x1e14da=_0x3751eb['id'];const _0x575cc5=_0x37a94e??_0xd146c,_0x4fc620=await listBffDatasetOperations(_0x55adb6[_0xfd5a0f(0xa5)],_0x1e14da),_0x5e2126=_0x4fc620?Object['keys'](_0x4fc620):[];if(_0x5e2126[_0xfd5a0f(0x99)]===0x0)throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0xbf)+_0x575cc5+'.');let _0x5bb3e3;const _0x2d4bfa=_0x55adb6[_0xfd5a0f(0xad)](_0xfd5a0f(0x79));if(_0x2d4bfa){if(!_0x5e2126['includes'](_0x2d4bfa))throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x8e)+_0x2d4bfa+_0xfd5a0f(0x77)+_0x575cc5+'.\x20'+(_0xfd5a0f(0x88)+_0x5e2126[_0xfd5a0f(0x7b)](',\x20')));_0x5bb3e3=_0x2d4bfa;}else{if(_0x55adb6['nonInteractive'])throw CliErrors[_0xfd5a0f(0xc7)](_0xfd5a0f(0x97));const _0x258380=await promptSelect('Select\x20operation\x20type:',_0x5e2126);_0x5bb3e3=_0x5e2126[_0x258380]??_0x5e2126[0x0];}let _0x39932f=normalizeHookFunctionNode(_0x55adb6[_0xfd5a0f(0xad)](_0xfd5a0f(0x75)));if(!_0x39932f){if(_0x55adb6['str'](_0xfd5a0f(0x75)))throw CliErrors['validation'](_0xfd5a0f(0xba));if(_0x55adb6[_0xfd5a0f(0xb0)])throw CliErrors[_0xfd5a0f(0xc7)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x36cb80=await promptSelect(_0xfd5a0f(0xb3),['before','after']);_0x39932f=[_0xfd5a0f(0x9c),_0xfd5a0f(0x93)][_0x36cb80]??_0xfd5a0f(0x9c);}return{'alias':_0x37a94e,'datasetCode':_0xd146c,'datasetId':_0x1e14da,'operationType':_0x5bb3e3,'functionNode':_0x39932f};}async function promptSelect(_0x22eac5,_0x365ab6){const _0x4a108e=a30_0x1fbc69;if(_0x365ab6[_0x4a108e(0x99)]===0x1)return 0x0;for(const [_0x2c4752,_0x37ae50]of _0x365ab6['entries']()){process[_0x4a108e(0x8c)][_0x4a108e(0xac)]('\x20\x20'+(_0x2c4752+0x1)+'.\x20'+_0x37ae50+'\x0a');}const _0xeba671=createInterface({'input':process['stdin'],'output':process[_0x4a108e(0x8c)]});while(!![]){const _0x45650b=await new Promise(_0x120dbc=>{const _0x55a97d=_0x4a108e;_0xeba671[_0x55a97d(0x76)](_0x22eac5+'\x20',_0x120dbc);}),_0x1c6b26=Number[_0x4a108e(0xa6)](_0x45650b[_0x4a108e(0x9a)](),0xa);if(Number[_0x4a108e(0x78)](_0x1c6b26)&&_0x1c6b26>=0x1&&_0x1c6b26<=_0x365ab6[_0x4a108e(0x99)])return _0xeba671['close'](),_0x1c6b26-0x1;process[_0x4a108e(0x8c)][_0x4a108e(0xac)](_0x4a108e(0xa2)+_0x365ab6[_0x4a108e(0x99)]+'.\x0a');}}function buildFilePath(_0x44e155,_0x29ff3e,_0x4c36cc,_0x2fd425){const _0x30dedf=a30_0x1fbc69;if(_0x29ff3e==='HOOK'){if(!_0x2fd425)throw CliErrors['validation'](_0x30dedf(0x7a));const _0x30c407=_0x2fd425[_0x30dedf(0xb8)]??_0x2fd425[_0x30dedf(0x7c)];return join(_0x44e155['scriptsRootDir'],_0x30dedf(0xab),_0x30c407,_0x2fd425[_0x30dedf(0xa4)],_0x2fd425[_0x30dedf(0x8b)],_0x4c36cc+_0x30dedf(0x83));}return join(_0x44e155['scriptsRootDir'],_0x29ff3e,_0x4c36cc+_0x30dedf(0x83));}export function generateTemplate(_0x8409f1,_0x179d4a,_0x2166b5,_0x3be789,_0x1b063b){const _0x4774a2=a30_0x1fbc69,_0x1b5ae7=_0x3be789?.[_0x4774a2(0x9a)]()||_0x4774a2(0xae);if(_0x8409f1==='COMMON')return _0x4774a2(0xa0)+_0x1b5ae7+'\x0a\x20*\x20[脚本名称]\x20'+_0x179d4a+_0x4774a2(0x7e)+_0x179d4a+_0x4774a2(0xa8)+_0x179d4a+_0x4774a2(0x82);if(_0x8409f1==='ENDPOINT')return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x1b5ae7+_0x4774a2(0xc6)+_0x2166b5+'/'+_0x179d4a+_0x4774a2(0xb9)+_0x179d4a+_0x4774a2(0x82);if(!_0x1b063b)throw CliErrors[_0x4774a2(0xc7)](_0x4774a2(0x84));return _0x4774a2(0x74)+_0x1b5ae7+_0x4774a2(0xc5)+_0x2166b5+'/'+_0x1b063b[_0x4774a2(0x7c)]+'/'+_0x1b063b[_0x4774a2(0xa4)]+_0x4774a2(0x86)+_0x1b063b['functionNode']+_0x4774a2(0xca)+_0x179d4a+_0x4774a2(0x82);}
|
|
1
|
+
const a30_0x182d0f=a30_0x58d3;(function(_0x4ef205,_0xa864cb){const _0x29c1cc=a30_0x58d3,_0x5918b5=_0x4ef205();while(!![]){try{const _0x5cfcd9=parseInt(_0x29c1cc(0xc3))/0x1*(-parseInt(_0x29c1cc(0x8e))/0x2)+parseInt(_0x29c1cc(0xa9))/0x3+parseInt(_0x29c1cc(0xb1))/0x4+parseInt(_0x29c1cc(0x90))/0x5*(parseInt(_0x29c1cc(0xbe))/0x6)+parseInt(_0x29c1cc(0xbd))/0x7+parseInt(_0x29c1cc(0xc1))/0x8*(parseInt(_0x29c1cc(0xaf))/0x9)+-parseInt(_0x29c1cc(0x85))/0xa*(parseInt(_0x29c1cc(0xd1))/0xb);if(_0x5cfcd9===_0xa864cb)break;else _0x5918b5['push'](_0x5918b5['shift']());}catch(_0x5e1b32){_0x5918b5['push'](_0x5918b5['shift']());}}}(a30_0x2f27,0x74ce7));import{createInterface}from'node:readline';function a30_0x2f27(){const _0x2679b6=['function-node','\x0a\x20*\x20[触发节点]\x20','\x22\x20not\x20found.\x20','find','Operation\x20type\x20(HOOK\x20only)','\x20api\x20pull`\x20to\x20refresh.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','isInteger','length','appCode','File\x20already\x20exists:\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','map','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1120848DyxRcL','after','Operation\x20type\x20\x22','COMMON','\x20function:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','2844WrnhMW','HOOK\x20requires\x20alias/operation/node\x20options.','3489256aTaeIJ','code','apiDir','name','HOOK','No\x20operation\x20types\x20found\x20for\x20dataset\x20','stderr','question','Invalid\x20function\x20name\x20\x22','join','.js','source','1851857hjrQsW','2007066jwewEp','string','Select\x20dataset:','21048gyeqGs','alias','128ZVSYWH','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20',']\x20(','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','validation','datasetCode','Script\x20description','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','nonInteractive','Invalid\x20dataset\x20selection.','utf8','11BFAYFc','\x0a\x20*\x20[脚本名称]\x20','create','str','scriptsRootDir','No\x20api.ts\x20found.\x20Run\x20`','datasetcode','close','operationType','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','parseInt','before','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','15420770xusESY','\x22.\x20','UNKNOWN','Alias\x20\x22','ENDPOINT','includes','tableName','description','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','10248YIIPPl','keys','5QgoUCd','trim','stdin','functionNode','TODO:\x20add\x20script\x20description'];a30_0x2f27=function(){return _0x2679b6;};return a30_0x2f27();}import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':'bff','command':a30_0x182d0f(0xd3),'description':a30_0x182d0f(0xcc),'risk':'read','flags':[{'name':'type','type':a30_0x182d0f(0xbf),'required':!![],'enum':[a30_0x182d0f(0xac),a30_0x182d0f(0x89),a30_0x182d0f(0xb5)],'description':'Script\x20type'},{'name':a30_0x182d0f(0xb4),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0xca)},{'name':a30_0x182d0f(0xc2),'type':a30_0x182d0f(0xbf),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x182d0f(0xd7),'type':'string','description':a30_0x182d0f(0xa5)},{'name':'operation-type','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0x99)},{'name':a30_0x182d0f(0x95),'type':a30_0x182d0f(0xbf),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x182d0f(0x83),'after']}],async 'validate'(_0x235600){const _0x2211c7=a30_0x182d0f,_0x3fe27e=_0x235600[_0x2211c7(0xd4)](_0x2211c7(0xb4));if(!isValidBffFunctionName(_0x3fe27e))throw CliErrors[_0x2211c7(0xc8)](_0x2211c7(0xb9)+_0x3fe27e+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x329bef){const _0x26f627=a30_0x182d0f,_0x239a59=loadBffProjectConfig(_0x329bef['appCode']),_0x1482c4=_0x329bef['str']('type'),_0x38a3e2=_0x329bef['str']('name'),_0x534adf=_0x329bef[_0x26f627(0xd4)](_0x26f627(0x8c))||undefined,_0x3a6c20=_0x1482c4==='HOOK'?await resolveHookOptions(_0x239a59,_0x329bef):undefined,_0x14ee3b=buildFilePath(_0x239a59,_0x1482c4,_0x38a3e2,_0x3a6c20);if(await fileExists(_0x14ee3b))throw CliErrors[_0x26f627(0xc8)](_0x26f627(0xa2)+_0x14ee3b);await mkdir(dirname(_0x14ee3b),{'recursive':!![]});const _0x2fcf0b=generateTemplate(_0x1482c4,_0x38a3e2,_0x329bef[_0x26f627(0xa1)],_0x534adf,_0x3a6c20);await writeFile(_0x14ee3b,_0x2fcf0b,_0x26f627(0xd0));const _0x3d8263={'type':_0x1482c4,'name':_0x38a3e2,'path':_0x14ee3b};if(_0x534adf)_0x3d8263['description']=_0x534adf;if(_0x3a6c20){if(_0x3a6c20[_0x26f627(0xc2)])_0x3d8263[_0x26f627(0xc2)]=_0x3a6c20['alias'];_0x3d8263[_0x26f627(0xc9)]=_0x3a6c20[_0x26f627(0xc9)],_0x3d8263[_0x26f627(0x80)]=_0x3a6c20[_0x26f627(0x80)],_0x3d8263['functionNode']=_0x3a6c20[_0x26f627(0x93)];}return{'ok':!![],'data':_0x3d8263,'message':'Created\x20'+_0x1482c4+_0x26f627(0xad)+_0x38a3e2};}};async function resolveHookOptions(_0x55df3a,_0x1e7d1c){const _0x3a0cc7=a30_0x182d0f,_0x5f2c01=loadAliasMap(_0x1e7d1c[_0x3a0cc7(0xb3)],undefined,resolveApiFilePath(_0x1e7d1c['apiDir'],_0x1e7d1c['appCode'])),_0x52015e=_0x5f2c01[_0x3a0cc7(0xa0)]>0x0;let _0x3b96ee,_0x4766af,_0x32195d;const _0x16928e=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xc2)),_0x2d2342=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xd7));if(_0x16928e){const _0x354d11=resolveAlias(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x16928e,undefined,resolveApiFilePath(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x1e7d1c['appCode']));if(!_0x354d11){const _0x11b541=_0x52015e?'Available\x20aliases:\x20'+_0x5f2c01[_0x3a0cc7(0xa7)](_0x5df8ec=>_0x5df8ec[_0x3a0cc7(0xc2)])[_0x3a0cc7(0xba)](',\x20'):_0x3a0cc7(0xd6)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0x88)+_0x16928e+_0x3a0cc7(0x97)+_0x11b541);}_0x3b96ee=_0x16928e,_0x4766af=_0x354d11;}else{if(_0x2d2342){_0x4766af=_0x2d2342;const _0x2f7f12=_0x5f2c01['find'](_0x4944d0=>_0x4944d0['datasetCode']===_0x2d2342);_0x3b96ee=_0x2f7f12?.[_0x3a0cc7(0xc2)];}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xa8));else{if(_0x52015e){const _0x5c7a8b=_0x5f2c01['map'](_0x379170=>_0x379170['alias']+'\x20('+_0x379170[_0x3a0cc7(0x8b)]+')'),_0x12eec3=await promptSelect(_0x3a0cc7(0xc0),_0x5c7a8b),_0x3ff5f9=_0x5f2c01[_0x12eec3];if(!_0x3ff5f9)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x3b96ee=_0x3ff5f9[_0x3a0cc7(0xc2)],_0x4766af=_0x3ff5f9['datasetCode'];}else{const _0x1b4f85=await listDatasets(_0x1e7d1c[_0x3a0cc7(0xa1)]);if(_0x1b4f85[_0x3a0cc7(0xa0)]===0x0)throw CliErrors[_0x3a0cc7(0xc8)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x3db7bc=_0x1b4f85[_0x3a0cc7(0xa7)](_0x2b5f3e=>_0x2b5f3e['name']+'\x20['+(_0x2b5f3e[_0x3a0cc7(0xbc)]??_0x3a0cc7(0x87))+_0x3a0cc7(0xc5)+_0x2b5f3e['code']+')'),_0x28b6d6=await promptSelect(_0x3a0cc7(0xc0),_0x3db7bc),_0x28e6b1=_0x1b4f85[_0x28b6d6];if(!_0x28e6b1)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x4766af=_0x28e6b1[_0x3a0cc7(0xb2)],_0x3b96ee=undefined;}}}}const _0x1a9ba2=await listDatasets(_0x1e7d1c['appCode']),_0x478e9f=_0x1a9ba2[_0x3a0cc7(0x98)](_0x2d54d3=>_0x2d54d3[_0x3a0cc7(0xb2)]===_0x4766af);if(!_0x478e9f)throw CliErrors[_0x3a0cc7(0xc8)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x4766af+_0x3a0cc7(0x86)+(_0x3b96ee?_0x3a0cc7(0x81)+CLI_BIN_NAME+_0x3a0cc7(0x9a):''));_0x32195d=_0x478e9f['id'];const _0x19998c=_0x3b96ee??_0x4766af,_0x1d5f5a=await listBffDatasetOperations(_0x1e7d1c[_0x3a0cc7(0xa1)],_0x32195d),_0x4cd706=_0x1d5f5a?Object[_0x3a0cc7(0x8f)](_0x1d5f5a):[];if(_0x4cd706[_0x3a0cc7(0xa0)]===0x0)throw CliErrors['validation'](_0x3a0cc7(0xb6)+_0x19998c+'.');let _0xe13f7;const _0x3dc887=_0x1e7d1c[_0x3a0cc7(0xd4)]('operation-type');if(_0x3dc887){if(!_0x4cd706[_0x3a0cc7(0x8a)](_0x3dc887))throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xab)+_0x3dc887+_0x3a0cc7(0xae)+_0x19998c+'.\x20'+('Available:\x20'+_0x4cd706[_0x3a0cc7(0xba)](',\x20')));_0xe13f7=_0x3dc887;}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcb));const _0x43505f=await promptSelect('Select\x20operation\x20type:',_0x4cd706);_0xe13f7=_0x4cd706[_0x43505f]??_0x4cd706[0x0];}let _0x57c9b5=normalizeHookFunctionNode(_0x1e7d1c['str'](_0x3a0cc7(0x95)));if(!_0x57c9b5){if(_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0x95)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x1e7d1c[_0x3a0cc7(0xce)])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xc7));const _0xdcac96=await promptSelect('Select\x20trigger\x20node:',['before',_0x3a0cc7(0xaa)]);_0x57c9b5=[_0x3a0cc7(0x83),_0x3a0cc7(0xaa)][_0xdcac96]??_0x3a0cc7(0x83);}return{'alias':_0x3b96ee,'datasetCode':_0x4766af,'datasetId':_0x32195d,'operationType':_0xe13f7,'functionNode':_0x57c9b5};}function a30_0x58d3(_0x29729e,_0x13a217){_0x29729e=_0x29729e-0x7f;const _0x2f270=a30_0x2f27();let _0x58d33b=_0x2f270[_0x29729e];return _0x58d33b;}async function promptSelect(_0x5654e6,_0x5f060d){const _0x518769=a30_0x182d0f;if(_0x5f060d[_0x518769(0xa0)]===0x1)return 0x0;for(const [_0x52aca3,_0xd9d559]of _0x5f060d['entries']()){process['stderr'][_0x518769(0xc6)]('\x20\x20'+(_0x52aca3+0x1)+'.\x20'+_0xd9d559+'\x0a');}const _0x28d959=createInterface({'input':process[_0x518769(0x92)],'output':process[_0x518769(0xb7)]});while(!![]){const _0x16c70d=await new Promise(_0x27f322=>{const _0x45c0c2=_0x518769;_0x28d959[_0x45c0c2(0xb8)](_0x5654e6+'\x20',_0x27f322);}),_0x4f6b51=Number[_0x518769(0x82)](_0x16c70d[_0x518769(0x91)](),0xa);if(Number[_0x518769(0x9f)](_0x4f6b51)&&_0x4f6b51>=0x1&&_0x4f6b51<=_0x5f060d[_0x518769(0xa0)])return _0x28d959[_0x518769(0x7f)](),_0x4f6b51-0x1;process['stderr'][_0x518769(0xc6)](_0x518769(0x8d)+_0x5f060d[_0x518769(0xa0)]+'.\x0a');}}function buildFilePath(_0x573ae2,_0xff472f,_0x2056e9,_0x3c1ac4){const _0x160312=a30_0x182d0f;if(_0xff472f===_0x160312(0xb5)){if(!_0x3c1ac4)throw CliErrors['validation'](_0x160312(0xb0));const _0x417f8a=_0x3c1ac4[_0x160312(0xc2)]??_0x3c1ac4[_0x160312(0xc9)];return join(_0x573ae2[_0x160312(0xd5)],_0x160312(0xb5),_0x417f8a,_0x3c1ac4[_0x160312(0x80)],_0x3c1ac4[_0x160312(0x93)],_0x2056e9+_0x160312(0xbb));}return join(_0x573ae2[_0x160312(0xd5)],_0xff472f,_0x2056e9+'.js');}export function generateTemplate(_0x3036a5,_0x472179,_0x55fa60,_0x390323,_0x1feb93){const _0x3f3b45=a30_0x182d0f,_0x556f48=_0x390323?.[_0x3f3b45(0x91)]()||_0x3f3b45(0x94);if(_0x3036a5===_0x3f3b45(0xac))return _0x3f3b45(0xa3)+_0x556f48+_0x3f3b45(0xd2)+_0x472179+_0x3f3b45(0x9b)+_0x472179+_0x3f3b45(0xa6)+_0x472179+_0x3f3b45(0x84);if(_0x3036a5===_0x3f3b45(0x89))return _0x3f3b45(0xa4)+_0x556f48+_0x3f3b45(0x9d)+_0x55fa60+'/'+_0x472179+_0x3f3b45(0x9c)+_0x472179+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x1feb93)throw CliErrors[_0x3f3b45(0xc8)](_0x3f3b45(0xcd));return _0x3f3b45(0x9e)+_0x556f48+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x55fa60+'/'+_0x1feb93[_0x3f3b45(0xc9)]+'/'+_0x1feb93[_0x3f3b45(0x80)]+_0x3f3b45(0x96)+_0x1feb93[_0x3f3b45(0x93)]+_0x3f3b45(0xc4)+_0x472179+_0x3f3b45(0x84);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0xd3ff(_0x143a65,_0x1df890){_0x143a65=_0x143a65-0x133;const _0x536d1=a31_0x536d();let _0xd3ffcb=_0x536d1[_0x143a65];return _0xd3ffcb;}const a31_0x2914ad=a31_0xd3ff;(function(_0x1a7ed2,_0x45e37d){const _0x5a8a5d=a31_0xd3ff,_0x3c5286=_0x1a7ed2();while(!![]){try{const _0x2e809f=-parseInt(_0x5a8a5d(0x140))/0x1*(-parseInt(_0x5a8a5d(0x137))/0x2)+parseInt(_0x5a8a5d(0x145))/0x3*(-parseInt(_0x5a8a5d(0x168))/0x4)+-parseInt(_0x5a8a5d(0x133))/0x5*(parseInt(_0x5a8a5d(0x13f))/0x6)+parseInt(_0x5a8a5d(0x159))/0x7*(parseInt(_0x5a8a5d(0x15d))/0x8)+-parseInt(_0x5a8a5d(0x149))/0x9*(parseInt(_0x5a8a5d(0x155))/0xa)+parseInt(_0x5a8a5d(0x14a))/0xb+-parseInt(_0x5a8a5d(0x14b))/0xc*(parseInt(_0x5a8a5d(0x142))/0xd);if(_0x2e809f===_0x45e37d)break;else _0x3c5286['push'](_0x3c5286['shift']());}catch(_0x185833){_0x3c5286['push'](_0x3c5286['shift']());}}}(a31_0x536d,0x5359e));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x2914ad(0x163),'command':'delete','description':a31_0x2914ad(0x158),'risk':a31_0x2914ad(0x15b),'flags':[{'name':'target','type':a31_0x2914ad(0x15f),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x5525bb){const _0x4cb410=a31_0x2914ad,_0x4a2311=loadBffProjectConfig(_0x5525bb[_0x4cb410(0x167)]),_0x29e70e=await readBffLockFile(_0x4a2311['lockFilePath']);if(!_0x29e70e)throw CliErrors['validation'](_0x4cb410(0x154));},async 'dryRun'(_0xc83d04){const _0x398240=a31_0x2914ad,_0x1a2746=loadBffProjectConfig(_0xc83d04[_0x398240(0x167)]),_0x8091cf=await readBffLockFile(_0x1a2746[_0x398240(0x14e)]);if(!_0x8091cf)throw CliErrors[_0x398240(0x151)](_0x398240(0x13c));const {appLock:_0x52dd9f}=ensureLockScope(_0x8091cf,_0xc83d04[_0x398240(0x167)],_0x1a2746['scriptsRoot'],_0x398240(0x164)),_0x23561c=_0xc83d04[_0x398240(0x153)]('target'),_0x383055=Object['keys'](_0x52dd9f[_0x398240(0x162)]),_0x33f8fd=resolveDeleteTarget(_0x23561c,_0x383055),_0x4ca223=_0x52dd9f[_0x398240(0x162)][_0x33f8fd];if(!_0x4ca223)throw CliErrors[_0x398240(0x151)](_0x398240(0x15a)+_0x33f8fd+'\x22.');const _0x4fa0e8=resolveLocalFilePathFromLockKey(_0x1a2746,_0x33f8fd),_0xa3757b=relative(_0x1a2746[_0x398240(0x138)],_0x4fa0e8),_0x2814ae=join(_0x1a2746[_0x398240(0x14c)],_0x398240(0x143),_0xa3757b);return{'method':_0x398240(0x13a),'url':'/api/management/library/scripts/delete','body':{'appCode':_0xc83d04[_0x398240(0x167)],'target':_0x33f8fd,'remoteId':_0x4ca223[_0x398240(0x147)],'localFilePath':_0x4fa0e8,'trashedPath':_0x2814ae},'description':'Would\x20delete\x20'+_0x33f8fd+_0x398240(0x136)};},async 'execute'(_0x517b06){const _0x3bee2c=a31_0x2914ad,_0x8cdec2=loadBffProjectConfig(_0x517b06[_0x3bee2c(0x167)]),_0x549f27=await readBffLockFile(_0x8cdec2[_0x3bee2c(0x14e)]);if(!_0x549f27)throw CliErrors[_0x3bee2c(0x151)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x2c76e0,appLock:_0x4fb000}=ensureLockScope(_0x549f27,_0x517b06[_0x3bee2c(0x167)],_0x8cdec2[_0x3bee2c(0x13e)],_0x3bee2c(0x164)),_0x229279=JSON[_0x3bee2c(0x157)](JSON[_0x3bee2c(0x14f)](_0x2c76e0)),_0x9055df=_0x229279[_0x3bee2c(0x166)][_0x517b06['appCode']];if(!_0x9055df)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x517b06[_0x3bee2c(0x167)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x2b7c22=_0x517b06[_0x3bee2c(0x153)](_0x3bee2c(0x134)),_0x41b883=Object[_0x3bee2c(0x14d)](_0x9055df[_0x3bee2c(0x162)]),_0x28be8c=resolveDeleteTarget(_0x2b7c22,_0x41b883),_0x1f65a9=_0x9055df[_0x3bee2c(0x162)][_0x28be8c];if(!_0x1f65a9)throw CliErrors['validation'](_0x3bee2c(0x15a)+_0x28be8c+'\x22.');await deleteBffScript(_0x1f65a9[_0x3bee2c(0x147)]),delete _0x9055df[_0x3bee2c(0x162)][_0x28be8c],_0x9055df['lastSync']=new Date()[_0x3bee2c(0x15c)](),await writeBffLockFile(_0x8cdec2[_0x3bee2c(0x14e)],_0x229279);const _0xb8fde4=resolveLocalFilePathFromLockKey(_0x8cdec2,_0x28be8c);let _0xc26d3d;await fileExists(_0xb8fde4)&&(_0xc26d3d=await moveToTrash(_0x8cdec2[_0x3bee2c(0x138)],_0x8cdec2[_0x3bee2c(0x14c)],_0xb8fde4),await cleanupEmptyDirectories(dirname(_0xb8fde4),_0x8cdec2[_0x3bee2c(0x141)]));await waitForDeleteSettlement(_0x8cdec2[_0x3bee2c(0x14e)],_0x517b06[_0x3bee2c(0x167)],_0x28be8c,_0xb8fde4),await sleep(0x96);const _0x246b0c={'deleted':_0x28be8c,'remoteId':_0x1f65a9[_0x3bee2c(0x147)]};if(_0xc26d3d)_0x246b0c[_0x3bee2c(0x13b)]=_0xc26d3d;return{'ok':!![],'data':_0x246b0c,'message':_0x3bee2c(0x152)+_0x28be8c+(_0xc26d3d?_0x3bee2c(0x139):'')};}};function resolveDeleteTarget(_0x312bc8,_0x1b841a){const _0x98185c=a31_0x2914ad;if(_0x312bc8['includes']('/')){const _0x4a1b90=_0x1b841a['find'](_0x2feec3=>_0x2feec3===_0x312bc8);if(!_0x4a1b90)throw CliErrors[_0x98185c(0x151)](_0x98185c(0x156)+_0x312bc8);return _0x4a1b90;}const _0x324a58=_0x1b841a[_0x98185c(0x15e)](_0x59f2dc=>_0x59f2dc[_0x98185c(0x13d)]('/')['at'](-0x1)===_0x312bc8);if(_0x324a58['length']===0x0)throw CliErrors[_0x98185c(0x151)]('Function\x20not\x20found:\x20'+_0x312bc8);if(_0x324a58[_0x98185c(0x148)]>0x1)throw CliErrors[_0x98185c(0x151)](_0x98185c(0x161)+_0x312bc8+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x324a58[_0x98185c(0x160)](_0x2ab350=>_0x98185c(0x135)+_0x2ab350)[_0x98185c(0x146)]('\x0a'));return _0x324a58[0x0];}async function moveToTrash(_0x39de0d,_0x355efa,_0x353010){const _0x5e5327=a31_0x2914ad,_0x4ebd94=new Date()[_0x5e5327(0x15c)]()[_0x5e5327(0x150)](/[:.]/g,'-'),_0xe527ad=relative(_0x39de0d,_0x353010),_0x1aa717=join(_0x355efa,_0x4ebd94,_0xe527ad);return await mkdir(dirname(_0x1aa717),{'recursive':!![]}),await rename(_0x353010,_0x1aa717),_0x1aa717;}async function cleanupEmptyDirectories(_0x5b4ccb,_0x2cb996){const _0x79c00a=a31_0x2914ad;let _0x3eea66=resolve(_0x5b4ccb);const _0x2aa89c=resolve(_0x2cb996);while(_0x3eea66[_0x79c00a(0x165)](''+_0x2aa89c+sep)||_0x3eea66===_0x2aa89c){if(_0x3eea66===_0x2aa89c)return;try{const _0x193e6f=await readdir(_0x3eea66);if(_0x193e6f[_0x79c00a(0x148)]>0x0)return;await rmdir(_0x3eea66);}catch{return;}_0x3eea66=dirname(_0x3eea66);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x5d53cd,_0x358e2a,_0x29216b,_0x109f87){const _0x227ae1=a31_0x2914ad;for(let _0x17f442=0x0;_0x17f442<DELETE_SETTLE_RETRY_COUNT;_0x17f442+=0x1){const _0x4f2f79=await readBffLockFile(_0x5d53cd),_0xfd4d08=!!_0x4f2f79?.[_0x227ae1(0x166)]?.[_0x358e2a]?.[_0x227ae1(0x162)]?.[_0x29216b],_0x4dd5b8=await fileExists(_0x109f87);if(!_0xfd4d08&&!_0x4dd5b8)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x227ae1(0x144)+_0x29216b+'.');}function a31_0x536d(){const _0x11cf56=['bff','delete','startsWith','apps','appCode','1466936qXkqbo','32275eYYnwX','target','\x20\x20-\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','6jyccZD','projectRoot','\x20(local\x20file\x20moved\x20to\x20trash)','POST','trashedTo','BFF\x20lock\x20file\x20not\x20found.','split','scriptsRoot','120fGHRhC','204339JDTYHE','scriptsRootDir','13NvVqEB','<timestamp>','Local\x20delete\x20not\x20settled\x20for\x20','3ySwFMk','join','remoteId','length','45XSpgmO','3344924tjLHas','8066508PdedbW','trashDir','keys','lockFilePath','stringify','replace','validation','Deleted\x20','str','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','102680RfQXKY','Function\x20not\x20found:\x20','parse','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','238tkfEsJ','No\x20lock\x20entry\x20found\x20for\x20\x22','high-risk-write','toISOString','151456RzIrnt','filter','string','map','Multiple\x20functions\x20match\x20\x22','functions'];a31_0x536d=function(){return _0x11cf56;};return a31_0x536d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x1038d1=a32_0x3d02;function a32_0x392c(){const _0x1d4f23=['detail','verbose','266kYNBtr','number','scriptType','scriptContent','1933995rbiZnY','bff','367343FxBryE','read','updatedTime','5769xNIwOr','description','3683076WhnYuT','122656ldYvYi','5797236eIXSSy','appCode','41350HcKGyJ','Return\x20full\x20raw\x20script\x20object','Script\x20ID','num','684QPRRLs','4473zmeOPu','createdTime'];a32_0x392c=function(){return _0x1d4f23;};return a32_0x392c();}(function(_0x1857e5,_0xc4bbbb){const _0x82e1dd=a32_0x3d02,_0x45c67d=_0x1857e5();while(!![]){try{const _0x5c23be=-parseInt(_0x82e1dd(0x1fa))/0x1+parseInt(_0x82e1dd(0x207))/0x2*(parseInt(_0x82e1dd(0x208))/0x3)+-parseInt(_0x82e1dd(0x1ff))/0x4+parseInt(_0x82e1dd(0x1f8))/0x5+-parseInt(_0x82e1dd(0x201))/0x6+parseInt(_0x82e1dd(0x1f4))/0x7*(-parseInt(_0x82e1dd(0x200))/0x8)+-parseInt(_0x82e1dd(0x1fd))/0x9*(-parseInt(_0x82e1dd(0x203))/0xa);if(_0x5c23be===_0xc4bbbb)break;else _0x45c67d['push'](_0x45c67d['shift']());}catch(_0xfbd49b){_0x45c67d['push'](_0x45c67d['shift']());}}}(a32_0x392c,0xad6b2));import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x3d02(_0x3e2b6c,_0xf3b672){_0x3e2b6c=_0x3e2b6c-0x1f3;const _0x392cca=a32_0x392c();let _0x3d020d=_0x392cca[_0x3e2b6c];return _0x3d020d;}export const bffDetail={'service':a32_0x1038d1(0x1f9),'command':a32_0x1038d1(0x20a),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a32_0x1038d1(0x1fb),'flags':[{'name':'id','type':a32_0x1038d1(0x1f5),'required':!![],'description':a32_0x1038d1(0x205)},{'name':a32_0x1038d1(0x1f3),'type':'boolean','description':a32_0x1038d1(0x204)}],async 'execute'(_0x75dc95){const _0x3cbb45=a32_0x1038d1,_0x3a9455=await getBffScriptInfo(_0x75dc95[_0x3cbb45(0x206)]('id')),_0x273962=_0x75dc95['bool']('verbose');if(_0x273962)return{'ok':!![],'data':_0x3a9455};return{'ok':!![],'data':{'id':_0x3a9455['id'],'appCode':_0x3a9455[_0x3cbb45(0x202)],'scriptType':_0x3a9455[_0x3cbb45(0x1f6)],'description':_0x3a9455[_0x3cbb45(0x1fe)]||'(none)','createdTime':_0x3a9455[_0x3cbb45(0x209)]??'','updatedTime':_0x3a9455[_0x3cbb45(0x1fc)]??'','scriptContent':_0x3a9455[_0x3cbb45(0x1f7)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cf444,_0x504b37){const _0x240fca=a33_0xb687,_0x4a5354=_0x1cf444();while(!![]){try{const _0xa58177=-parseInt(_0x240fca(0x1b4))/0x1*(-parseInt(_0x240fca(0x1b7))/0x2)+-parseInt(_0x240fca(0x1b5))/0x3*(-parseInt(_0x240fca(0x1b8))/0x4)+-parseInt(_0x240fca(0x1b2))/0x5*(-parseInt(_0x240fca(0x1b1))/0x6)+-parseInt(_0x240fca(0x1b9))/0x7*(parseInt(_0x240fca(0x1b0))/0x8)+-parseInt(_0x240fca(0x1b6))/0x9+-parseInt(_0x240fca(0x1ae))/0xa*(-parseInt(_0x240fca(0x1af))/0xb)+-parseInt(_0x240fca(0x1b3))/0xc*(parseInt(_0x240fca(0x1ad))/0xd);if(_0xa58177===_0x504b37)break;else _0x4a5354['push'](_0x4a5354['shift']());}catch(_0x3d2b03){_0x4a5354['push'](_0x4a5354['shift']());}}}(a33_0x3ee4,0x5e159));function a33_0x3ee4(){const _0x18be06=['531820nveafF','1029077BxlTCE','363662dnexGf','89140pIqwrq','418dqCqVY','24oiexGw','103524IHNzbS','35qElrvL','156aBrZSa','17yTjDar','15stQqAQ','827370VvREBm','18554oeJEnA'];a33_0x3ee4=function(){return _0x18be06;};return a33_0x3ee4();}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';function a33_0xb687(_0x1454f9,_0x2dcf64){_0x1454f9=_0x1454f9-0x1ad;const _0x3ee492=a33_0x3ee4();let _0xb6870b=_0x3ee492[_0x1454f9];return _0xb6870b;}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|