@lovrabet/rabetbase-cli 2.4.5-beta.1 → 2.4.5
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/business-groups.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.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/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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/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/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x1ef661=a19_0x1f09;(function(_0x3cd1fd,_0x3c87a3){const _0x56ff29=a19_0x1f09,_0x360d9d=_0x3cd1fd();while(!![]){try{const _0x15f783=-parseInt(_0x56ff29(0xa9))/0x1*(-parseInt(_0x56ff29(0xb7))/0x2)+parseInt(_0x56ff29(0x97))/0x3+parseInt(_0x56ff29(0xb9))/0x4*(-parseInt(_0x56ff29(0xba))/0x5)+-parseInt(_0x56ff29(0x9a))/0x6+-parseInt(_0x56ff29(0xb1))/0x7+-parseInt(_0x56ff29(0xb5))/0x8+-parseInt(_0x56ff29(0x99))/0x9*(-parseInt(_0x56ff29(0xa5))/0xa);if(_0x15f783===_0x3c87a3)break;else _0x360d9d['push'](_0x360d9d['shift']());}catch(_0x3004ae){_0x360d9d['push'](_0x360d9d['shift']());}}}(a19_0x49b4,0x8f443));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x2b179a,_0xb87c44){const _0x115113=a19_0x1f09,_0x276ac4=[],_0x16d103=_0x2b179a['apps']&&typeof _0x2b179a[_0x115113(0xaf)]===_0x115113(0xa2)?_0x2b179a[_0x115113(0xaf)]:{},_0x529354=_0x2b179a[_0x115113(0xac)]||undefined;for(const [_0x906259,_0xa58c72]of Object[_0x115113(0xa8)](_0x16d103)){if(!_0xa58c72||typeof _0xa58c72!==_0x115113(0xa2)||!_0xa58c72[_0x115113(0xb0)])continue;_0x276ac4[_0x115113(0x9c)]({'name':_0x906259,'appcode':_0xa58c72['appcode'],'named':!![],'definedIn':_0xb87c44,'isDefault':_0x906259===_0x529354,...buildAppProfileListFields(_0xa58c72)});}return _0x276ac4;}function buildMergedItems(_0x4cd62c,_0x5d4e9a){const _0x1860ce=a19_0x1f09,{apps:apps={},defaultApp:_0x5d6f64}=_0x4cd62c,_0x14ffc2=_0x5d4e9a[_0x1860ce(0xb4)][_0x1860ce(0xaf)]&&typeof _0x5d4e9a[_0x1860ce(0xb4)][_0x1860ce(0xaf)]===_0x1860ce(0xa2)?_0x5d4e9a[_0x1860ce(0xb4)][_0x1860ce(0xaf)]:{},_0x49f55a=_0x5d4e9a['projectConfig'][_0x1860ce(0xaf)]&&typeof _0x5d4e9a['projectConfig'][_0x1860ce(0xaf)]===_0x1860ce(0xa2)?_0x5d4e9a['projectConfig'][_0x1860ce(0xaf)]:{},_0x5a519b=_0x5d4e9a[_0x1860ce(0x98)]['inherit']===![],_0x476291=Object['entries'](apps),_0x52b658=_0x476291[_0x1860ce(0xa4)](([_0x41ca8a,_0x4c3687])=>({'name':_0x41ca8a,'appcode':_0x4c3687[_0x1860ce(0xb0)],'named':!![],'definedIn':appDefinedIn(_0x41ca8a,_0x14ffc2,_0x49f55a,_0x5a519b),'isDefault':_0x41ca8a===_0x5d6f64,...buildAppProfileListFields(_0x4c3687)}));return _0x52b658;}function a19_0x1f09(_0x10f39d,_0x280aac){_0x10f39d=_0x10f39d-0x95;const _0x49b437=a19_0x49b4();let _0x1f0902=_0x49b437[_0x10f39d];return _0x1f0902;}function validateAppListFlags(_0x4c18c2){const _0x4a5e16=a19_0x1f09;if(!_0x4c18c2[_0x4a5e16(0x9f)](_0x4a5e16(0xbb)))return;if(!_0x4c18c2[_0x4a5e16(0x9f)](_0x4a5e16(0xa1))&&!_0x4c18c2[_0x4a5e16(0x9f)](_0x4a5e16(0xb6)))return;throw CliErrors[_0x4a5e16(0xae)](_0x4a5e16(0xb8),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}function a19_0x49b4(){const _0x4a3bf9=['globalConfig','1559408qvEjEC','project','6vusRIQ','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','44rDNMZi','475205YDOhII','remote','list','boolean','globalPath','1055538HcmFsO','projectConfig','21267RHsMFi','1578222NyaDYT','.\x20Use\x20`','push','No\x20apps\x20configured','\x20config','bool','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','global','object','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','map','3530mzwSjx','isCurrent','find','entries','362430VVJZpS','optional','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','defaultApp','merged','validation','apps','appcode','1281294HlcdGT','mergedCli','\x20in\x20'];a19_0x49b4=function(){return _0x4a3bf9;};return a19_0x49b4();}async function execute(_0x505d10){const _0x3de357=a19_0x1f09;validateAppListFlags(_0x505d10);if(_0x505d10[_0x3de357(0x9f)](_0x3de357(0xbb)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x505d10)};const _0x3fd5f5=_0x505d10[_0x3de357(0x9f)](_0x3de357(0xa1)),_0x2ee112=_0x505d10[_0x3de357(0x9f)](_0x3de357(0xb6)),_0xd6de3d=_0x3fd5f5?_0x3de357(0xa1):_0x2ee112?'project':'merged',{config:_0x33f6b6,layers:_0x309e71}=readRawConfigWithLayers(),_0x460c66=resolveDefaultAppSource(_0x309e71),{defaultApp:_0x346c35}=_0x33f6b6;let _0x35cbb1,_0x43e10e;switch(_0xd6de3d){case _0x3de357(0xa1):_0x35cbb1=buildItemsFromLayer(_0x309e71[_0x3de357(0xb4)],_0x3de357(0xa1)),_0x43e10e=_0x309e71[_0x3de357(0x96)];break;case _0x3de357(0xb6):_0x35cbb1=buildItemsFromLayer(_0x309e71[_0x3de357(0x98)],_0x3de357(0xb6)),_0x43e10e=_0x309e71['projectPath'];break;default:_0x35cbb1=buildMergedItems(_0x33f6b6,_0x309e71);break;}enrichAppListItemsWithMergedSelection(_0x35cbb1,_0x505d10[_0x3de357(0xb2)]);if(_0x35cbb1['length']===0x0){const _0x548338=_0xd6de3d===_0x3de357(0xad)?'':_0x3de357(0xb3)+_0xd6de3d+_0x3de357(0x9e);return{'ok':!![],'data':[],'message':_0x3de357(0x9d)+_0x548338+_0x3de357(0x9b)+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x4839a1=_0x35cbb1[_0x3de357(0xa7)](_0xb45e12=>_0xb45e12[_0x3de357(0xa6)]===!![]),_0x18bb6c=_0x346c35??_0x4839a1?.[_0x3de357(0xb0)]??null,_0x47c40d=_0xd6de3d===_0x3de357(0xad)?{'globalPath':_0x309e71[_0x3de357(0x96)]??null,'projectPath':_0x309e71['projectPath']??null,'defaultApp':_0x18bb6c,'defaultAppSource':_0x346c35!=null?_0x460c66:null}:{'scope':_0xd6de3d,'configPath':_0x43e10e??null};return{'ok':!![],'data':{'items':_0x35cbb1,'meta':_0x47c40d}};}export const appListDefinition={'service':'app','command':a19_0x1ef661(0xbc),'description':a19_0x1ef661(0xa3),'risk':'read','auth':a19_0x1ef661(0xaa),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x1ef661(0xbb),'type':'boolean','description':a19_0x1ef661(0xa0),'default':![]},{'name':a19_0x1ef661(0xa1),'type':a19_0x1ef661(0x95),'description':a19_0x1ef661(0xab),'default':![]},{'name':a19_0x1ef661(0xb6),'type':a19_0x1ef661(0x95),'description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],async 'validate'(_0xa5bfea){validateAppListFlags(_0xa5bfea);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a20_0x35b4(){const _0x1ef832=['28029726HNgaVP','615344kJohEs','read','1997850DROTfT','app','414588UuNWcT','length','91yIYQaB','55972hEwfrF','\x20application\x20member(s)','Found\x20','2388530skPWUL','5496248gRJTGW','8DPlROy'];a20_0x35b4=function(){return _0x1ef832;};return a20_0x35b4();}const a20_0x327902=a20_0x3e8a;(function(_0x128eff,_0x277cd4){const _0x2afd55=a20_0x3e8a,_0x55e32a=_0x128eff();while(!![]){try{const _0xfdbbd=-parseInt(_0x2afd55(0x1af))/0x1+-parseInt(_0x2afd55(0x1b6))/0x2+parseInt(_0x2afd55(0x1b1))/0x3+parseInt(_0x2afd55(0x1ad))/0x4*(-parseInt(_0x2afd55(0x1ab))/0x5)+parseInt(_0x2afd55(0x1b3))/0x6*(-parseInt(_0x2afd55(0x1b5))/0x7)+-parseInt(_0x2afd55(0x1ac))/0x8+parseInt(_0x2afd55(0x1ae))/0x9;if(_0xfdbbd===_0x277cd4)break;else _0x55e32a['push'](_0x55e32a['shift']());}catch(_0x35af84){_0x55e32a['push'](_0x55e32a['shift']());}}}(a20_0x35b4,0x9195d));function a20_0x3e8a(_0x58dcc6,_0x5cf27e){_0x58dcc6=_0x58dcc6-0x1ab;const _0x35b46f=a20_0x35b4();let _0x3e8a1d=_0x35b46f[_0x58dcc6];return _0x3e8a1d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x327902(0x1b2),'command':'members-list','description':'List\x20application\x20members\x20with\x20their\x20role\x20memberships','risk':a20_0x327902(0x1b0),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x6fa56d){const _0xf7e8f3=a20_0x327902,_0x423b8a=projectAppMembers(await listRoleUsers(_0x6fa56d['appCode']));return{'ok':!![],'data':{'appCode':_0x6fa56d['appCode'],'items':_0x423b8a,'totalCount':_0x423b8a[_0xf7e8f3(0x1b4)]},'message':_0xf7e8f3(0x1b8)+_0x423b8a['length']+_0xf7e8f3(0x1b7)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f9c18,_0x1153ea){const _0xca7186=a21_0x3640,_0xc7a593=_0x5f9c18();while(!![]){try{const _0x455c37=-parseInt(_0xca7186(0x148))/0x1*(parseInt(_0xca7186(0x14e))/0x2)+parseInt(_0xca7186(0x14d))/0x3*(-parseInt(_0xca7186(0x149))/0x4)+parseInt(_0xca7186(0x150))/0x5*(parseInt(_0xca7186(0x156))/0x6)+-parseInt(_0xca7186(0x147))/0x7+-parseInt(_0xca7186(0x151))/0x8*(parseInt(_0xca7186(0x14a))/0x9)+parseInt(_0xca7186(0x154))/0xa+-parseInt(_0xca7186(0x14c))/0xb*(-parseInt(_0xca7186(0x14b))/0xc);if(_0x455c37===_0x1153ea)break;else _0xc7a593['push'](_0xc7a593['shift']());}catch(_0x4193de){_0xc7a593['push'](_0xc7a593['shift']());}}}(a21_0x1019,0x537e0));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a21_0x3640(_0x3dde91,_0x494dab){_0x3dde91=_0x3dde91-0x147;const _0x101971=a21_0x1019();let _0x36409c=_0x101971[_0x3dde91];return _0x36409c;}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x565a90){const _0x45e55b=a21_0x3640,_0x1933ed=_0x565a90[_0x45e55b(0x152)]||getCookie();if(!_0x1933ed)throw CliErrors['authRequired']();return _0x1933ed;}function a21_0x1019(){const _0x379e31=['appName','22818onLilD','2781702VMTrlE','62639YLOWGa','1592HbxVtN','282294xmYcBv','2112708XEGynt','77CmXfsg','4971oOOiHg','20wBFues','appDesc','665vfNvUo','56cORELm','cookie','map','5065960hhHrFA'];a21_0x1019=function(){return _0x379e31;};return a21_0x1019();}export async function listRemoteAppDirectory(_0x1c9dcc){const _0x4af972=a21_0x3640,_0x7d7942=await withActiveCookie(resolveCookie(_0x1c9dcc),()=>listRemoteApps());return{'items':_0x7d7942[_0x4af972(0x153)](_0x42d47c=>({..._0x42d47c['id']!=null?{'id':_0x42d47c['id']}:{},'appCode':_0x42d47c['appCode'],'appName':_0x42d47c[_0x4af972(0x155)],..._0x42d47c[_0x4af972(0x14f)]!=null?{'appDesc':_0x42d47c[_0x4af972(0x14f)]}:{}})),'meta':{'source':'platform'}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x35f1(_0x3eaf34,_0x5c7ac9){_0x3eaf34=_0x3eaf34-0x84;const _0x583b10=a22_0x583b();let _0x35f109=_0x583b10[_0x3eaf34];return _0x35f109;}(function(_0x545b8c,_0x1961df){const _0xaeeb0d=a22_0x35f1,_0x1b00a1=_0x545b8c();while(!![]){try{const _0x34fd2c=-parseInt(_0xaeeb0d(0xac))/0x1+-parseInt(_0xaeeb0d(0x8d))/0x2+-parseInt(_0xaeeb0d(0x9f))/0x3*(parseInt(_0xaeeb0d(0xa5))/0x4)+-parseInt(_0xaeeb0d(0xa1))/0x5*(-parseInt(_0xaeeb0d(0xb6))/0x6)+parseInt(_0xaeeb0d(0xb0))/0x7*(-parseInt(_0xaeeb0d(0xb2))/0x8)+-parseInt(_0xaeeb0d(0xa8))/0x9*(-parseInt(_0xaeeb0d(0x9d))/0xa)+parseInt(_0xaeeb0d(0x98))/0xb*(parseInt(_0xaeeb0d(0x95))/0xc);if(_0x34fd2c===_0x1961df)break;else _0x1b00a1['push'](_0x1b00a1['shift']());}catch(_0x3f96fd){_0x1b00a1['push'](_0x1b00a1['shift']());}}}(a22_0x583b,0xd1b7b));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x18b10a){const _0x57b4c3=_0x18b10a?.['trim']();return _0x57b4c3?_0x57b4c3:null;}export function projectAppMembers(_0x568c79){const _0x3fed60=a22_0x35f1,_0x149e9f=new Map(),_0x20ca60=[..._0x568c79][_0x3fed60(0x9b)]((_0x3efce,_0x2bdd9b)=>_0x3efce['id']-_0x2bdd9b['id']),_0x1c9bbd=(_0x55dcfe,_0x2a015c,_0x95dcfa)=>{const _0x3ad3a1=_0x3fed60;for(const _0x4bf4dd of _0x2a015c){const _0x4ab40e=Number(_0x4bf4dd['userId']);if(!Number[_0x3ad3a1(0xaa)](_0x4ab40e)||_0x4ab40e<=0x0)continue;let _0x5d994f=_0x149e9f[_0x3ad3a1(0xb9)](_0x4ab40e);if(!_0x5d994f)_0x5d994f={'userId':_0x4ab40e,'username':nullableText(_0x4bf4dd['username']),'displayName':nullableText(_0x4bf4dd['nickname']),'status':_0x95dcfa,'roles':[],'roleKeys':new Set()},_0x149e9f[_0x3ad3a1(0xa7)](_0x4ab40e,_0x5d994f);else{_0x5d994f[_0x3ad3a1(0x90)]??=nullableText(_0x4bf4dd[_0x3ad3a1(0x90)]),_0x5d994f[_0x3ad3a1(0xae)]??=nullableText(_0x4bf4dd[_0x3ad3a1(0xa4)]);if(_0x95dcfa===_0x3ad3a1(0x8f))_0x5d994f[_0x3ad3a1(0x97)]=_0x3ad3a1(0x8f);}const _0x1081ea=_0x55dcfe['id']+':'+_0x95dcfa;if(_0x5d994f[_0x3ad3a1(0xa3)][_0x3ad3a1(0xa9)](_0x1081ea))continue;_0x5d994f[_0x3ad3a1(0xa3)][_0x3ad3a1(0x8e)](_0x1081ea),_0x5d994f[_0x3ad3a1(0xb3)][_0x3ad3a1(0x91)]({'roleId':_0x55dcfe['id'],'roleName':nullableText(_0x55dcfe['roleName']),'roleType':nullableText(_0x55dcfe[_0x3ad3a1(0x85)]),'membershipStatus':_0x95dcfa});}};for(const _0x45921f of _0x20ca60){_0x1c9bbd(_0x45921f,_0x45921f[_0x3fed60(0x88)]??[],_0x3fed60(0x8f)),_0x1c9bbd(_0x45921f,_0x45921f[_0x3fed60(0xa2)]??[],'PENDING');}return[..._0x149e9f[_0x3fed60(0x9e)]()][_0x3fed60(0x96)](_0xce601e=>({'userId':_0xce601e[_0x3fed60(0x84)],'username':_0xce601e['username'],'displayName':_0xce601e[_0x3fed60(0xae)],'status':_0xce601e['status'],'roles':_0xce601e['roles'][_0x3fed60(0x9b)]((_0x4c502b,_0x48bb4e)=>_0x4c502b[_0x3fed60(0x99)]-_0x48bb4e[_0x3fed60(0x99)]||(_0x4c502b[_0x3fed60(0xb4)]===_0x48bb4e[_0x3fed60(0xb4)]?0x0:_0x4c502b[_0x3fed60(0xb4)]===_0x3fed60(0x8f)?-0x1:0x1))}))['sort']((_0x143413,_0x45fce7)=>_0x143413['userId']-_0x45fce7[_0x3fed60(0x84)]);}export function enrichAppListItemsWithMergedSelection(_0x3636e1,_0x5b3fba){const _0x9bc23b=a22_0x35f1;if(!_0x5b3fba)return;const _0x3e5c14=_0x5b3fba[_0x9bc23b(0xa6)]&&typeof _0x5b3fba[_0x9bc23b(0xa6)]===_0x9bc23b(0x93)?_0x5b3fba[_0x9bc23b(0xa6)]:{},_0x1064a8=Object[_0x9bc23b(0x86)](_0x3e5c14)[_0x9bc23b(0x94)]>0x0;for(const _0x1c9ff1 of _0x3636e1){_0x1c9ff1['isCurrent']=![];}const _0x20e078=_0x5b3fba[_0x9bc23b(0xb8)]!=null?String(_0x5b3fba[_0x9bc23b(0xb8)])[_0x9bc23b(0xb1)]():'';if(_0x1064a8){const _0x464087=_0x5b3fba['currentApp']??_0x5b3fba[_0x9bc23b(0xa0)];if(_0x464087)for(const _0x1824c8 of _0x3636e1){_0x1824c8[_0x9bc23b(0x92)]===!![]&&_0x1824c8[_0x9bc23b(0x89)]===_0x464087&&(_0x1824c8[_0x9bc23b(0xad)]=!![]);}for(const _0x471db3 of _0x3636e1){if(_0x471db3['named']!==![])continue;if(_0x5b3fba[_0x9bc23b(0xa0)])continue;_0x20e078&&String(_0x471db3['appcode']??'')[_0x9bc23b(0xb1)]()===_0x20e078&&(_0x471db3['isCurrent']=!![]);}return;}if(!_0x20e078)return;for(const _0x41c02a of _0x3636e1){String(_0x41c02a[_0x9bc23b(0x8c)]??'')[_0x9bc23b(0xb1)]()===_0x20e078&&(_0x41c02a[_0x9bc23b(0xad)]=!![]);}}export function resolveAppScopeForWrite(_0x257916,_0x915347,_0x228e2c){const _0x17edab=a22_0x35f1;if(_0x915347)return'global';const _0x5852b4=_0x228e2c['projectConfig'][_0x17edab(0xa6)]&&typeof _0x228e2c[_0x17edab(0x8a)][_0x17edab(0xa6)]===_0x17edab(0x93)?_0x228e2c[_0x17edab(0x8a)][_0x17edab(0xa6)]:{},_0x266cf0=_0x228e2c[_0x17edab(0x8b)][_0x17edab(0xa6)]&&typeof _0x228e2c[_0x17edab(0x8b)]['apps']===_0x17edab(0x93)?_0x228e2c[_0x17edab(0x8b)]['apps']:{};if(Object[_0x17edab(0xb7)][_0x17edab(0x87)][_0x17edab(0xb5)](_0x5852b4,_0x257916))return _0x17edab(0x9a);if(Object[_0x17edab(0xb7)][_0x17edab(0x87)][_0x17edab(0xb5)](_0x266cf0,_0x257916))return'global';return _0x17edab(0x9a);}export function appDefinedIn(_0x384631,_0x271502,_0x5eeb62,_0x272346){const _0x3e6407=a22_0x35f1;if(_0x272346)return Object[_0x3e6407(0xb7)][_0x3e6407(0x87)][_0x3e6407(0xb5)](_0x5eeb62,_0x384631)?_0x3e6407(0x9a):_0x3e6407(0xab);const _0x39b2a7=Object[_0x3e6407(0xb7)]['hasOwnProperty'][_0x3e6407(0xb5)](_0x271502,_0x384631),_0xfd48e6=Object[_0x3e6407(0xb7)][_0x3e6407(0x87)][_0x3e6407(0xb5)](_0x5eeb62,_0x384631);if(_0x39b2a7&&_0xfd48e6)return _0x3e6407(0x9c);if(_0xfd48e6)return _0x3e6407(0x9a);return'global';}export function resolveDefaultAppSource(_0x3b7d86){const _0x3853c8=a22_0x35f1,_0x437895=_0x3b7d86[_0x3853c8(0x8a)]['apps']&&typeof _0x3b7d86['projectConfig'][_0x3853c8(0xa6)]===_0x3853c8(0x93)?_0x3b7d86[_0x3853c8(0x8a)][_0x3853c8(0xa6)]:{};if(_0x3853c8(0xa0)in _0x3b7d86[_0x3853c8(0x8a)])return _0x3853c8(0x9a);if(Object[_0x3853c8(0x86)](_0x437895)[_0x3853c8(0x94)]>0x0)return'project';if(_0x3b7d86[_0x3853c8(0x8a)][_0x3853c8(0xaf)]===![])return null;if(_0x3b7d86['globalConfig'][_0x3853c8(0xa0)])return _0x3853c8(0xab);return null;}export function getConfigPath(_0x5be0d1={}){const _0x2fc1a3=a22_0x35f1,_0x244063=_0x5be0d1[_0x2fc1a3(0xab)]?_0x2fc1a3(0xab):_0x2fc1a3(0x9a);return resolveWriteConfigPath(_0x244063);}export function readConfig(_0x2321f6={}){return readConfigFile(getConfigPath(_0x2321f6));}function a22_0x583b(){const _0x157b6d=['516yvHAFL','apps','set','117qnkHkL','has','isFinite','global','49233KNuqEq','isCurrent','displayName','inherit','245RCzaBh','trim','269104znFfJn','roles','membershipStatus','call','8984082TdjzZr','prototype','appCode','get','userId','roleType','keys','hasOwnProperty','userList','name','projectConfig','globalConfig','appcode','2921432lnLgDW','add','ACTIVE','username','push','named','object','length','12zmamHS','map','status','27837997AaziNI','roleId','project','sort','both','498950AKTAYN','values','26289qFYWEf','defaultApp','5osIAZI','applyUserList','roleKeys','nickname'];a22_0x583b=function(){return _0x157b6d;};return a22_0x583b();}export function writeConfig(_0x237b33,_0x3fb20f={}){writeConfigFile(getConfigPath(_0x3fb20f),_0x237b33);}export function scopeLabel(_0x54d848){return _0x54d848['global']?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x20ffa2=a23_0x5619;(function(_0x27bd96,_0x5f294d){const _0x1db708=a23_0x5619,_0x503909=_0x27bd96();while(!![]){try{const _0x544bb2=parseInt(_0x1db708(0x182))/0x1*(parseInt(_0x1db708(0x192))/0x2)+parseInt(_0x1db708(0x191))/0x3+-parseInt(_0x1db708(0x17b))/0x4+parseInt(_0x1db708(0x179))/0x5*(-parseInt(_0x1db708(0x186))/0x6)+-parseInt(_0x1db708(0x181))/0x7+-parseInt(_0x1db708(0x188))/0x8*(-parseInt(_0x1db708(0x18d))/0x9)+-parseInt(_0x1db708(0x18a))/0xa*(-parseInt(_0x1db708(0x189))/0xb);if(_0x544bb2===_0x5f294d)break;else _0x503909['push'](_0x503909['shift']());}catch(_0x3aeba6){_0x503909['push'](_0x503909['shift']());}}}(a23_0x25ab,0xbb9d3));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x20ffa2(0x185);function a23_0x5619(_0x474134,_0x43cbdd){_0x474134=_0x474134-0x179;const _0x25abe6=a23_0x25ab();let _0x56190c=_0x25abe6[_0x474134];return _0x56190c;}export const appConfigDelete={'service':a23_0x20ffa2(0x18e),'command':'delete','description':a23_0x20ffa2(0x183),'risk':a23_0x20ffa2(0x18f),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4559f2){readKeyArg(_0x4559f2);},async 'dryRun'(_0x423202){const _0x36f8bb=a23_0x20ffa2,_0x4813af=readKeyArg(_0x423202),_0x44dad4=await mustGetByKey(_0x423202[_0x36f8bb(0x17e)],_0x4813af);return asAppConfigDryRunResult(buildMutationData({'operation':_0x36f8bb(0x17a),'appCode':_0x423202[_0x36f8bb(0x17e)],'key':_0x4813af,'before':projectAppConfig(_0x44dad4),'after':null,'dryRun':!![]}),{'method':_0x36f8bb(0x187),'url':DELETE_PATH});},async 'execute'(_0x18a14e){const _0x504086=a23_0x20ffa2,_0x184dad=readKeyArg(_0x18a14e),_0x56b6ee=await mustGetByKey(_0x18a14e[_0x504086(0x17e)],_0x184dad);return await withAppConfigApiBoundary('delete',{'appCode':_0x18a14e[_0x504086(0x17e)],'key':_0x184dad},()=>deleteAppConfig({'appCode':_0x18a14e[_0x504086(0x17e)],'id':requireAppConfigId(_0x56b6ee,_0x184dad,_0x18a14e[_0x504086(0x17e)])})),{'ok':!![],'data':buildMutationData({'operation':'delete','appCode':_0x18a14e[_0x504086(0x17e)],'key':_0x184dad,'before':projectAppConfig(_0x56b6ee),'after':null,'dryRun':![]}),'message':'Deleted\x20app\x20config\x20'+_0x184dad};}};async function mustGetByKey(_0x5e0ec6,_0x1714a4){const _0xe7d1f2=a23_0x20ffa2,_0x3b2c0c=await withAppConfigApiBoundary(_0xe7d1f2(0x190),{'appCode':_0x5e0ec6,'key':_0x1714a4},()=>getAppConfigByKey(_0x5e0ec6,_0x1714a4));if(!_0x3b2c0c)throw CliErrors[_0xe7d1f2(0x18c)](_0xe7d1f2(0x17d)+_0x1714a4,_0xe7d1f2(0x18b)+_0x5e0ec6);return _0x3b2c0c;}function a23_0x25ab(){const _0x599347=['1041090rXjSpZ','appCode:\x20','validation','864rRyPYK','app-config','high-risk-write','get','120375XMuENu','1291794DIoFjm','95pKhAro','delete','1298484bdCCmL','App\x20config\x20server\x20id\x20missing\x20for\x20key=','App\x20config\x20key\x20not\x20found:\x20','appCode','isFinite','apiError','5567947HvdiMb','1zQoelJ','Delete\x20one\x20runtime\x20app-config\x20key','number','/smartapi/app-config/delete','245772CWQiGJ','POST','17576zfLXCO','187gZOQck'];a23_0x25ab=function(){return _0x599347;};return a23_0x25ab();}function requireAppConfigId(_0x59b4f0,_0x387f2c,_0x4e8e61){const _0x777d2=a23_0x20ffa2;if(typeof _0x59b4f0['id']===_0x777d2(0x184)&&Number[_0x777d2(0x17f)](_0x59b4f0['id'])&&_0x59b4f0['id']>0x0)return _0x59b4f0['id'];throw CliErrors[_0x777d2(0x180)](_0x777d2(0x17c)+_0x387f2c+',\x20appCode='+_0x4e8e61);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x2f36(_0x1d666a,_0xb99065){_0x1d666a=_0x1d666a-0xeb;const _0xa9b180=a24_0xa9b1();let _0x2f36f3=_0xa9b180[_0x1d666a];return _0x2f36f3;}function a24_0xa9b1(){const _0x17c334=['674FsuLuT','253065CcnGtK','5469INhvrO','reveal','\x20with\x20value\x20redacted','66dVabTN','app-config','\x20with\x20value\x20revealed','validation','Loaded\x20app\x20config\x20','203607pcdlis','get','bool','477215mtyWOs','2005744sVqppH','1067GbhCUq','36TrEVBB','appCode','appCode:\x20','312809zMhVUC','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','56290fyqNiD'];a24_0xa9b1=function(){return _0x17c334;};return a24_0xa9b1();}const a24_0x5bd822=a24_0x2f36;(function(_0x4e4d3c,_0x350475){const _0x382b9f=a24_0x2f36,_0x5952b2=_0x4e4d3c();while(!![]){try{const _0x5c7a1d=parseInt(_0x382b9f(0xf3))/0x1+-parseInt(_0x382b9f(0xfc))/0x2*(-parseInt(_0x382b9f(0xfe))/0x3)+parseInt(_0x382b9f(0xf6))/0x4*(-parseInt(_0x382b9f(0xfd))/0x5)+parseInt(_0x382b9f(0xeb))/0x6*(parseInt(_0x382b9f(0xf9))/0x7)+-parseInt(_0x382b9f(0xf4))/0x8+-parseInt(_0x382b9f(0xf0))/0x9+-parseInt(_0x382b9f(0xfb))/0xa*(parseInt(_0x382b9f(0xf5))/0xb);if(_0x5c7a1d===_0x350475)break;else _0x5952b2['push'](_0x5952b2['shift']());}catch(_0x466a5c){_0x5952b2['push'](_0x5952b2['shift']());}}}(a24_0xa9b1,0x4b41c));import{getAppConfigByKey}from'../../core/api-client.js';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_0x5bd822(0xec),'command':a24_0x5bd822(0xf1),'description':a24_0x5bd822(0xfa),'risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x383ea7){readKeyArg(_0x383ea7);},async 'execute'(_0x334e46){const _0x350057=a24_0x5bd822,_0x10ca88=readKeyArg(_0x334e46),_0x3f0b73=await withAppConfigApiBoundary(_0x350057(0xf1),{'appCode':_0x334e46[_0x350057(0xf7)],'key':_0x10ca88},()=>getAppConfigByKey(_0x334e46[_0x350057(0xf7)],_0x10ca88));if(!_0x3f0b73)throw CliErrors[_0x350057(0xee)]('App\x20config\x20key\x20not\x20found:\x20'+_0x10ca88,_0x350057(0xf8)+_0x334e46[_0x350057(0xf7)]);const _0x10e2ff=projectAppConfig(_0x3f0b73,{'reveal':_0x334e46['bool'](_0x350057(0xff))});return{'ok':!![],'data':{'config':_0x10e2ff},'message':_0x334e46[_0x350057(0xf2)](_0x350057(0xff))?_0x350057(0xef)+_0x10ca88+_0x350057(0xed):_0x350057(0xef)+_0x10ca88+_0x350057(0x100)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x40a7(_0x362047,_0x3f19e3){_0x362047=_0x362047-0x11a;const _0x209935=a25_0x2099();let _0x40a7cd=_0x209935[_0x362047];return _0x40a7cd;}(function(_0x318b69,_0x3180e1){const _0x1f7e39=a25_0x40a7,_0x50ac96=_0x318b69();while(!![]){try{const _0x461d3c=parseInt(_0x1f7e39(0x11d))/0x1+parseInt(_0x1f7e39(0x11a))/0x2*(parseInt(_0x1f7e39(0x11e))/0x3)+parseInt(_0x1f7e39(0x11f))/0x4*(parseInt(_0x1f7e39(0x11c))/0x5)+parseInt(_0x1f7e39(0x120))/0x6+parseInt(_0x1f7e39(0x121))/0x7+-parseInt(_0x1f7e39(0x11b))/0x8+parseInt(_0x1f7e39(0x122))/0x9*(-parseInt(_0x1f7e39(0x123))/0xa);if(_0x461d3c===_0x3180e1)break;else _0x50ac96['push'](_0x50ac96['shift']());}catch(_0x13c686){_0x50ac96['push'](_0x50ac96['shift']());}}}(a25_0x2099,0x71191));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';function a25_0x2099(){const _0x3af4ec=['254344FduVfX','83365yshWTT','450222yEeqJf','3gBhStL','12eqwUtc','4774242WKrUtO','3791620bchukd','171CnwPsP','1048470OChpgv','1299054MUfPLf'];a25_0x2099=function(){return _0x3af4ec;};return a25_0x2099();}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0x5b7afd=a26_0x19fa;function a26_0x1e0f(){const _0x135d77=['list','138784bsYemF','5193DxNYUs','string','550MxZxQR','key','4456683AvOXDD','app-config','283352icENmZ','399QwuGqP','map','1BvEGmp','3247498XlaOhh','length','3757860ADyBeg','trim','8429562hhqTOW','45sEutTO','appCode','Found\x20','Filter\x20by\x20exact\x20config\x20key','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values'];a26_0x1e0f=function(){return _0x135d77;};return a26_0x1e0f();}(function(_0x2f6df0,_0x23982c){const _0x3cca82=a26_0x19fa,_0x289192=_0x2f6df0();while(!![]){try{const _0x470fd8=parseInt(_0x3cca82(0xa5))/0x1*(-parseInt(_0x3cca82(0xa6))/0x2)+-parseInt(_0x3cca82(0xab))/0x3*(-parseInt(_0x3cca82(0xa2))/0x4)+parseInt(_0x3cca82(0xa8))/0x5+parseInt(_0x3cca82(0xaa))/0x6+-parseInt(_0x3cca82(0xa3))/0x7*(parseInt(_0x3cca82(0xb1))/0x8)+parseInt(_0x3cca82(0xb2))/0x9*(-parseInt(_0x3cca82(0xb4))/0xa)+parseInt(_0x3cca82(0xa0))/0xb;if(_0x470fd8===_0x23982c)break;else _0x289192['push'](_0x289192['shift']());}catch(_0x98c51e){_0x289192['push'](_0x289192['shift']());}}}(a26_0x1e0f,0xef3be));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a26_0x19fa(_0x96feaf,_0x2ddc1d){_0x96feaf=_0x96feaf-0xa0;const _0x1e0f58=a26_0x1e0f();let _0x19fab6=_0x1e0f58[_0x96feaf];return _0x19fab6;}export const appConfigList={'service':a26_0x5b7afd(0xa1),'command':a26_0x5b7afd(0xb0),'description':a26_0x5b7afd(0xaf),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x5b7afd(0xb5),'type':a26_0x5b7afd(0xb3),'description':a26_0x5b7afd(0xae)},TAGS_FLAG],async 'validate'(_0x3767f0){const _0x38a216=_0x3767f0['str']('key')['trim']();if(_0x38a216)validateKey(_0x38a216);readOptionalTags(_0x3767f0);},async 'execute'(_0x593e93){const _0x378600=a26_0x5b7afd,_0x116375=_0x593e93['str'](_0x378600(0xb5))[_0x378600(0xa9)]()||undefined,_0x10c91e=readOptionalTags(_0x593e93),_0x1be6c3=await withAppConfigApiBoundary(_0x378600(0xb0),{'appCode':_0x593e93[_0x378600(0xac)]},()=>listAppConfigs(_0x593e93[_0x378600(0xac)],{'key':_0x116375,'tags':_0x10c91e})),_0x1a8f16=_0x1be6c3[_0x378600(0xa4)](_0x29909f=>projectAppConfig(_0x29909f));return{'ok':!![],'data':{'appCode':_0x593e93['appCode'],'count':_0x1a8f16[_0x378600(0xa7)],'configs':_0x1a8f16},'message':_0x378600(0xad)+_0x1a8f16[_0x378600(0xa7)]+'\x20app\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x16311d=a27_0x19fd;function a27_0x360c(){const _0x17ab88=['App\x20config\x20server\x20id\x20missing\x20for\x20key=','app-config','9657fetxbu','/smartapi/app-config/create','isFinite','Read\x20config\x20value\x20from\x20file','1173180uolyAG','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','712ahWpUS','Created','get','create','set','tags','257157hmdCvF','2007960MLaOxt','appCode','90vpbxEP','2zTRlsz','file',',\x20appCode=','Updated','2257976YMkLud','247997efoQZL','POST','1170RmuZfE','update'];a27_0x360c=function(){return _0x17ab88;};return a27_0x360c();}(function(_0x3a6107,_0x5883dd){const _0x2a00b9=a27_0x19fd,_0x4583ff=_0x3a6107();while(!![]){try{const _0x2dfd17=-parseInt(_0x2a00b9(0x187))/0x1*(-parseInt(_0x2a00b9(0x182))/0x2)+parseInt(_0x2a00b9(0x18d))/0x3+parseInt(_0x2a00b9(0x193))/0x4*(-parseInt(_0x2a00b9(0x189))/0x5)+parseInt(_0x2a00b9(0x191))/0x6+parseInt(_0x2a00b9(0x186))/0x7+-parseInt(_0x2a00b9(0x17f))/0x8+parseInt(_0x2a00b9(0x17e))/0x9*(-parseInt(_0x2a00b9(0x181))/0xa);if(_0x2dfd17===_0x5883dd)break;else _0x4583ff['push'](_0x4583ff['shift']());}catch(_0x566e81){_0x4583ff['push'](_0x4583ff['shift']());}}}(a27_0x360c,0x35976));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a27_0x19fd(_0x30a319,_0x3796be){_0x30a319=_0x30a319-0x17a;const _0x360cf7=a27_0x360c();let _0x19fdc5=_0x360cf7[_0x30a319];return _0x19fdc5;}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';const CREATE_PATH=a27_0x16311d(0x18e),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a27_0x16311d(0x18c),'command':a27_0x16311d(0x17c),'description':a27_0x16311d(0x192),'risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x16311d(0x183),'type':'string','description':a27_0x16311d(0x190)}],async 'validate'(_0x53b3d5){readKeyArg(_0x53b3d5),readOptionalTags(_0x53b3d5),assertSingleValueSource(_0x53b3d5);},async 'dryRun'(_0x55ca7e){const _0x263e66=a27_0x16311d,_0x48c285=readKeyArg(_0x55ca7e),_0x39ee3a=readOptionalTags(_0x55ca7e),_0x4e35a6=assertSingleValueSource(_0x55ca7e);await assertValueSourceReadable(_0x4e35a6);const _0x27c576=await withAppConfigApiBoundary(_0x263e66(0x17a),{'appCode':_0x55ca7e[_0x263e66(0x180)],'key':_0x48c285},()=>getAppConfigByKey(_0x55ca7e['appCode'],_0x48c285)),_0x2fda11=_0x27c576?_0x263e66(0x18a):_0x263e66(0x17b),_0x1abf7e=_0x27c576?projectAppConfig(_0x27c576):null,_0x1aa29e=plannedAppConfig({'appCode':_0x55ca7e['appCode'],'key':_0x48c285,'tags':_0x39ee3a??_0x27c576?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x2fda11,'appCode':_0x55ca7e[_0x263e66(0x180)],'key':_0x48c285,'before':_0x1abf7e,'after':_0x1aa29e,'dryRun':!![]}),{'method':_0x263e66(0x188),'url':_0x2fda11===_0x263e66(0x18a)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x5d48ad){const _0x2de4f5=a27_0x16311d,_0x34e3b0=readKeyArg(_0x5d48ad),_0x4102a3=readOptionalTags(_0x5d48ad),_0x198788=await withAppConfigApiBoundary('get',{'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0},()=>getAppConfigByKey(_0x5d48ad[_0x2de4f5(0x180)],_0x34e3b0)),_0x5c9bb1=_0x198788?projectAppConfig(_0x198788):null,_0x59c1e0=_0x198788?_0x2de4f5(0x18a):_0x2de4f5(0x17b),{value:_0x50e051,warnings:_0x4ce49a}=await readAppConfigValue(_0x5d48ad),_0x418111={'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0,'value':_0x50e051,'tags':_0x4102a3??_0x198788?.[_0x2de4f5(0x17d)]??undefined};await withAppConfigApiBoundary(_0x59c1e0,{'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0},async()=>{const _0x2367fd=_0x2de4f5;_0x198788?await updateAppConfig({..._0x418111,'id':requireAppConfigId(_0x198788,_0x34e3b0,_0x5d48ad[_0x2367fd(0x180)])}):await createAppConfig(_0x418111);});const _0x5156a4=await withAppConfigApiBoundary(_0x2de4f5(0x17a),{'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0},()=>getAppConfigByKey(_0x5d48ad[_0x2de4f5(0x180)],_0x34e3b0)),_0x3d4bf5=_0x5156a4?projectAppConfig(_0x5156a4):plannedAppConfig({'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0,'tags':_0x418111[_0x2de4f5(0x17d)],'hasValue':_0x50e051!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x59c1e0,'appCode':_0x5d48ad[_0x2de4f5(0x180)],'key':_0x34e3b0,'before':_0x5c9bb1,'after':_0x3d4bf5,'dryRun':![],'warnings':_0x4ce49a}),'message':(_0x59c1e0===_0x2de4f5(0x18a)?_0x2de4f5(0x185):_0x2de4f5(0x194))+'\x20app\x20config\x20'+_0x34e3b0};}};function requireAppConfigId(_0x55d5a6,_0x3b97d7,_0x12f4cc){const _0x2bb6f8=a27_0x16311d;if(typeof _0x55d5a6['id']==='number'&&Number[_0x2bb6f8(0x18f)](_0x55d5a6['id'])&&_0x55d5a6['id']>0x0)return _0x55d5a6['id'];throw CliErrors['apiError'](_0x2bb6f8(0x18b)+_0x3b97d7+_0x2bb6f8(0x184)+_0x12f4cc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x210b7e=a28_0x31b0;(function(_0x3d13db,_0x9da302){const _0x59d0fe=a28_0x31b0,_0x3c10be=_0x3d13db();while(!![]){try{const _0x173566=-parseInt(_0x59d0fe(0x121))/0x1+parseInt(_0x59d0fe(0x12d))/0x2*(parseInt(_0x59d0fe(0x111))/0x3)+parseInt(_0x59d0fe(0x10e))/0x4*(parseInt(_0x59d0fe(0x117))/0x5)+-parseInt(_0x59d0fe(0x11c))/0x6+parseInt(_0x59d0fe(0x141))/0x7*(parseInt(_0x59d0fe(0x11f))/0x8)+parseInt(_0x59d0fe(0x130))/0x9+parseInt(_0x59d0fe(0x131))/0xa*(-parseInt(_0x59d0fe(0x118))/0xb);if(_0x173566===_0x9da302)break;else _0x3c10be['push'](_0x3c10be['shift']());}catch(_0xd6a5e8){_0x3c10be['push'](_0x3c10be['shift']());}}}(a28_0x1f8e,0xd5391));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a28_0x210b7e(0x144),'description':a28_0x210b7e(0x12e),'required':![]};export const TAGS_FLAG={'name':a28_0x210b7e(0x11b),'type':'string','description':a28_0x210b7e(0x10c)};export const STDIN_FLAG={'name':a28_0x210b7e(0x133),'type':'boolean','description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a28_0x210b7e(0x125),'type':a28_0x210b7e(0x12f),'description':a28_0x210b7e(0x11a)};export const REVEAL_FLAG={'name':a28_0x210b7e(0x10b),'type':a28_0x210b7e(0x120),'description':a28_0x210b7e(0x13d),'default':![]};function a28_0x31b0(_0x2179cd,_0x35a30e){_0x2179cd=_0x2179cd-0x108;const _0x1f8ef0=a28_0x1f8e();let _0x31b06b=_0x1f8ef0[_0x2179cd];return _0x31b06b;}export function readKeyArg(_0xa656be){const _0x41c213=a28_0x210b7e,_0x2a3efb=_0xa656be[_0x41c213(0x134)][0x0]?.[_0x41c213(0x135)]()??'';return validateKey(_0x2a3efb),_0x2a3efb;}function a28_0x1f8e(){const _0x159f1f=['hasValue','end','validation','slice','reveal','Config\x20tags\x20for\x20filtering/display\x20metadata','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','214004tAhJLP','warnings','path','2411592fVjCmL','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','error','data','join','key','30UZMgin','535216whumQk','after','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','tags','4215402kmRQlT','dryRun','apiError','2047432qFlvIJ','boolean','413207Ziqqkr','setEncoding','env','file','from-env','before','name','appCode','argument','kind','App\x20config\x20value\x20source\x20is\x20ambiguous.','Failed\x20to\x20','4bnQyNX','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','string','1743480BbaqqI','80jFyAfZ','push','stdin','args','trim','utf8','method','defineProperties','Environment\x20variable\x20is\x20not\x20set:\x20','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Missing\x20app-config\x20key.','Value\x20file\x20is\x20not\x20readable:\x20','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','gmtModified','length','str','7WyqZSV','flag','once','value','gmtCreate','Missing\x20app-config\x20value\x20source.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'];a28_0x1f8e=function(){return _0x159f1f;};return a28_0x1f8e();}export function readOptionalTags(_0x48c666){const _0x588f64=a28_0x210b7e,_0x18b59e=_0x48c666[_0x588f64(0x140)]('tags')[_0x588f64(0x135)]();if(!_0x18b59e)return undefined;if(_0x18b59e[_0x588f64(0x13f)]>0x20)throw CliErrors[_0x588f64(0x109)](_0x588f64(0x13a));return _0x18b59e;}export function validateKey(_0x8fac50){const _0x328837=a28_0x210b7e;if(!_0x8fac50)throw CliErrors[_0x328837(0x109)](_0x328837(0x13b));if(_0x8fac50['length']>0x100)throw CliErrors[_0x328837(0x109)](_0x328837(0x112));}export function projectAppConfig(_0x446ca6,_0x3a542f){const _0x53eb47=a28_0x210b7e,_0x3f185f=_0x446ca6[_0x53eb47(0x144)]!==undefined&&_0x446ca6[_0x53eb47(0x144)]!==null&&_0x446ca6[_0x53eb47(0x144)]!=='',_0x54a9a1={'appCode':_0x446ca6[_0x53eb47(0x128)],'key':_0x446ca6[_0x53eb47(0x116)],'tags':_0x446ca6['tags']??undefined,'hasValue':_0x3f185f,'valueRedacted':_0x3f185f&&!_0x3a542f?.[_0x53eb47(0x10b)],'gmtCreate':_0x446ca6[_0x53eb47(0x145)],'gmtModified':_0x446ca6[_0x53eb47(0x13e)]};return _0x3a542f?.[_0x53eb47(0x10b)]&&(_0x54a9a1[_0x53eb47(0x144)]=_0x446ca6['value']??'',_0x54a9a1['valueRedacted']=![]),_0x54a9a1;}export function plannedAppConfig(_0x40bb88){const _0x5c42ea=a28_0x210b7e,_0x4c2a77=_0x40bb88[_0x5c42ea(0x148)]??!![];return{'appCode':_0x40bb88[_0x5c42ea(0x128)],'key':_0x40bb88[_0x5c42ea(0x116)],'tags':_0x40bb88[_0x5c42ea(0x11b)]??undefined,'hasValue':_0x4c2a77,'valueRedacted':_0x4c2a77};}export function buildMutationData(_0x6be69b){const _0x53d3a5=a28_0x210b7e;return{'operation':_0x6be69b['operation'],'selector':{'appCode':_0x6be69b[_0x53d3a5(0x128)],'key':_0x6be69b[_0x53d3a5(0x116)]},'before':_0x6be69b[_0x53d3a5(0x126)],'after':_0x6be69b[_0x53d3a5(0x119)],'dryRun':_0x6be69b[_0x53d3a5(0x11d)],'warnings':_0x6be69b[_0x53d3a5(0x10f)]??[]};}export async function withAppConfigApiBoundary(_0x39e261,_0x1e2787,_0x278ac6){const _0xba3b9a=a28_0x210b7e;try{return await _0x278ac6();}catch{const _0x5c934d=['appCode:\x20'+_0x1e2787[_0xba3b9a(0x128)]];if(_0x1e2787[_0xba3b9a(0x116)])_0x5c934d[_0xba3b9a(0x132)]('key:\x20'+_0x1e2787[_0xba3b9a(0x116)]);_0x5c934d['push']('value\x20is\x20redacted');throw CliErrors[_0xba3b9a(0x11e)](_0xba3b9a(0x12c)+_0x39e261+'\x20app\x20config.',_0x5c934d[_0xba3b9a(0x115)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x5f4749,_0x7d7a82){const _0x269613=a28_0x210b7e;return Object[_0x269613(0x138)](_0x5f4749,{'method':{'value':_0x7d7a82[_0x269613(0x137)],'enumerable':![]},'url':{'value':_0x7d7a82['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x39318a){const _0x188056=a28_0x210b7e,_0x3d5a49=[];_0x39318a['args'][_0x188056(0x13f)]>0x1&&_0x3d5a49[_0x188056(0x132)]({'kind':_0x188056(0x129),'value':_0x39318a[_0x188056(0x134)][_0x188056(0x10a)](0x1)[_0x188056(0x115)]('\x20')});const _0x426c45=_0x39318a[_0x188056(0x142)](_0x188056(0x144));_0x426c45!==undefined&&_0x426c45!==null&&_0x3d5a49['push']({'kind':'argument','value':String(_0x426c45)});_0x39318a['bool'](_0x188056(0x133))&&_0x3d5a49[_0x188056(0x132)]({'kind':_0x188056(0x133)});const _0x184751=_0x39318a[_0x188056(0x140)]('from-env')[_0x188056(0x135)]();_0x184751&&_0x3d5a49[_0x188056(0x132)]({'kind':_0x188056(0x123),'name':_0x184751});const _0x4d7c26=_0x39318a[_0x188056(0x140)](_0x188056(0x124))[_0x188056(0x135)]();_0x4d7c26&&_0x3d5a49['push']({'kind':_0x188056(0x124),'path':_0x4d7c26});if(_0x3d5a49[_0x188056(0x13f)]===0x0)throw CliErrors[_0x188056(0x109)](_0x188056(0x146),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x3d5a49[_0x188056(0x13f)]>0x1)throw CliErrors[_0x188056(0x109)](_0x188056(0x12b),_0x188056(0x10d));return _0x3d5a49[0x0];}export async function assertValueSourceReadable(_0x3147cd){const _0x25aa08=a28_0x210b7e;if(_0x3147cd['kind']===_0x25aa08(0x123)&&!(_0x3147cd[_0x25aa08(0x127)]in process.env))throw CliErrors[_0x25aa08(0x109)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x3147cd[_0x25aa08(0x127)]);if(_0x3147cd[_0x25aa08(0x12a)]===_0x25aa08(0x124))try{await access(_0x3147cd[_0x25aa08(0x110)]);}catch{throw CliErrors['validation'](_0x25aa08(0x13c)+_0x3147cd[_0x25aa08(0x110)]);}}export async function readAppConfigValue(_0x35786b){const _0x577949=a28_0x210b7e,_0x18415d=assertSingleValueSource(_0x35786b),_0x48b63e=[];if(_0x18415d[_0x577949(0x12a)]===_0x577949(0x129))return _0x48b63e[_0x577949(0x132)](_0x577949(0x147)),{'value':_0x18415d[_0x577949(0x144)]??'','source':_0x18415d['kind'],'warnings':_0x48b63e};if(_0x18415d[_0x577949(0x12a)]===_0x577949(0x133))return{'value':await readStdin(),'source':_0x18415d[_0x577949(0x12a)],'warnings':_0x48b63e};if(_0x18415d['kind']===_0x577949(0x123)){if(!(_0x18415d[_0x577949(0x127)]in process.env))throw CliErrors[_0x577949(0x109)](_0x577949(0x139)+_0x18415d['name']);return{'value':process.env[_0x18415d.name]??'','source':_0x18415d[_0x577949(0x12a)],'warnings':_0x48b63e};}return{'value':await readFile(_0x18415d[_0x577949(0x110)],_0x577949(0x136)),'source':_0x18415d[_0x577949(0x12a)],'warnings':_0x48b63e};}function readStdin(){return new Promise((_0x28feea,_0x2db4db)=>{const _0x383dbd=a28_0x31b0;let _0x37273e='';process['stdin'][_0x383dbd(0x122)](_0x383dbd(0x136)),process[_0x383dbd(0x133)]['on'](_0x383dbd(0x114),_0x27d784=>{_0x37273e+=_0x27d784;}),process[_0x383dbd(0x133)][_0x383dbd(0x143)](_0x383dbd(0x108),()=>_0x28feea(_0x37273e)),process[_0x383dbd(0x133)]['once'](_0x383dbd(0x113),_0x2db4db);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x4c963c=a29_0xa705;(function(_0x4d506a,_0x4f51f4){const _0x179b36=a29_0xa705,_0x2cfd0f=_0x4d506a();while(!![]){try{const _0x28ee23=-parseInt(_0x179b36(0x170))/0x1+parseInt(_0x179b36(0x172))/0x2+parseInt(_0x179b36(0x17f))/0x3+parseInt(_0x179b36(0x17d))/0x4+-parseInt(_0x179b36(0x16e))/0x5*(-parseInt(_0x179b36(0x17a))/0x6)+-parseInt(_0x179b36(0x17b))/0x7+-parseInt(_0x179b36(0x176))/0x8;if(_0x28ee23===_0x4f51f4)break;else _0x2cfd0f['push'](_0x2cfd0f['shift']());}catch(_0x1c3bd4){_0x2cfd0f['push'](_0x2cfd0f['shift']());}}}(a29_0x4e47,0xdf1fa));function a29_0x4e47(){const _0x837f5a=['login','yes','21678152KVdMxJ','write','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','bool','64728VFknrL','3126886yEKUMY','Clear\x20login\x20session','4768700ALmSeb','nonInteractive','287145hHbYNP','!\x20Not\x20logged\x20in','log','650HrWLSB','logout','224123QDjXfZ','boolean','3208348PSMFrD','✓\x20Logged\x20out'];a29_0x4e47=function(){return _0x837f5a;};return a29_0x4e47();}import{unlinkSync,existsSync}from'node:fs';function a29_0xa705(_0x5487b2,_0x3a47b5){_0x5487b2=_0x5487b2-0x16c;const _0x4e4799=a29_0x4e47();let _0xa7056d=_0x4e4799[_0x5487b2];return _0xa7056d;}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a29_0x4c963c(0x174),'description':'Login\x20via\x20browser','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x4c963c(0x175),'type':a29_0x4c963c(0x171),'description':a29_0x4c963c(0x178),'default':![]}],async 'execute'(_0x5c60ce){const _0x5b9199=a29_0x4c963c,{runAuthServer:_0x4493a4}=await import('../../auth/auth-server-ui.js');return await _0x4493a4({'autoYes':_0x5c60ce[_0x5b9199(0x179)](_0x5b9199(0x175)),'nonInteractive':_0x5c60ce[_0x5b9199(0x17e)]}),{'ok':!![]};}},{'service':'auth','command':a29_0x4c963c(0x16f),'description':a29_0x4c963c(0x17c),'risk':a29_0x4c963c(0x177),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x243dea){const _0x19b35a=a29_0x4c963c;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x19b35a(0x16d)](_0x19b35a(0x173))):console['log'](_0x19b35a(0x16c)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x23515b=a30_0x1a31;(function(_0x3c71c8,_0x2d3ad9){const _0x42af12=a30_0x1a31,_0x52d986=_0x3c71c8();while(!![]){try{const _0xdcbc02=-parseInt(_0x42af12(0x175))/0x1*(parseInt(_0x42af12(0x19e))/0x2)+-parseInt(_0x42af12(0x179))/0x3*(parseInt(_0x42af12(0x176))/0x4)+-parseInt(_0x42af12(0x198))/0x5+parseInt(_0x42af12(0x158))/0x6*(-parseInt(_0x42af12(0x171))/0x7)+parseInt(_0x42af12(0x16c))/0x8+-parseInt(_0x42af12(0x1a9))/0x9*(parseInt(_0x42af12(0x194))/0xa)+parseInt(_0x42af12(0x185))/0xb*(parseInt(_0x42af12(0x173))/0xc);if(_0xdcbc02===_0x2d3ad9)break;else _0x52d986['push'](_0x52d986['shift']());}catch(_0x201652){_0x52d986['push'](_0x52d986['shift']());}}}(a30_0xfc04,0x2cedf));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_0xfc04(){const _0x2326fa=['.js','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','function-node','scriptsRootDir','description','Created\x20','Function\x20name\x20(valid\x20JS\x20identifier)','COMMON','\x20function:\x20','map','\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','question','datasetcode','Script\x20description','Operation\x20type\x20\x22','81432GqitXS','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Select\x20dataset:','No\x20datasets\x20found\x20for\x20this\x20app.','name','623oTGkXJ','trim','2161428xdElIK','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','17UZtaBh','1177780RTJznE','UNKNOWN','close','3Dhowmj','includes','stderr','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','write','bff','code','Available\x20aliases:\x20','str','\x0a\x20*\x20[触发节点]\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','stdin','44bNGjUW','\x22\x20not\x20found.\x20','length','ENDPOINT','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','create','operationType','isInteger','validation','join','keys','datasetCode','functionNode','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20not\x20found\x20for\x20code\x20\x22','1640evoGyp','nonInteractive','appCode','\x22\x20not\x20found\x20for\x20dataset\x20','88545ZebopP','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Invalid\x20dataset\x20selection.','File\x20already\x20exists:\x20','apiDir','1430zMFGER','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Operation\x20type\x20(HOOK\x20only)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Select\x20operation\x20type:','Available:\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Alias\x20\x22','parseInt','string','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','9216xSIotR','\x0a\x20*\x20[脚本名称]\x20','type','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','tableName','\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','No\x20operation\x20types\x20found\x20for\x20dataset\x20','source','before','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','No\x20api.ts\x20found.\x20Run\x20`','HOOK\x20requires\x20alias/operation/node\x20options.','alias','3666VhNrVe','read','HOOK','after','operation-type'];a30_0xfc04=function(){return _0x2326fa;};return a30_0xfc04();}function a30_0x1a31(_0x5367c4,_0x5c84b1){_0x5367c4=_0x5367c4-0x154;const _0xfc04e5=a30_0xfc04();let _0x1a315a=_0xfc04e5[_0x5367c4];return _0x1a315a;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x23515b(0x17e),'command':a30_0x23515b(0x18a),'description':a30_0x23515b(0x154),'risk':a30_0x23515b(0x159),'flags':[{'name':'type','type':'string','required':!![],'enum':[a30_0x23515b(0x164),a30_0x23515b(0x188),a30_0x23515b(0x15a)],'description':'Script\x20type'},{'name':'name','type':'string','required':!![],'description':a30_0x23515b(0x163)},{'name':a30_0x23515b(0x161),'type':a30_0x23515b(0x1a7),'description':a30_0x23515b(0x16a)},{'name':a30_0x23515b(0x157),'type':'string','description':a30_0x23515b(0x1a4)},{'name':a30_0x23515b(0x169),'type':'string','description':a30_0x23515b(0x19a)},{'name':a30_0x23515b(0x15c),'type':a30_0x23515b(0x1a7),'description':a30_0x23515b(0x1a0)},{'name':a30_0x23515b(0x15f),'type':a30_0x23515b(0x1a7),'description':a30_0x23515b(0x192),'enum':['before','after']}],async 'validate'(_0xeea33a){const _0x1c645d=a30_0x23515b,_0x38b0d5=_0xeea33a['str'](_0x1c645d(0x170));if(!isValidBffFunctionName(_0x38b0d5))throw CliErrors[_0x1c645d(0x18d)]('Invalid\x20function\x20name\x20\x22'+_0x38b0d5+_0x1c645d(0x17c));},async 'execute'(_0x230196){const _0x187003=a30_0x23515b,_0x3e5b3d=loadBffProjectConfig(_0x230196['appCode']),_0x594f08=_0x230196[_0x187003(0x181)](_0x187003(0x1ab)),_0x2bb4ba=_0x230196['str']('name'),_0x3e438a=_0x230196[_0x187003(0x181)]('description')||undefined,_0x116ab4=_0x594f08===_0x187003(0x15a)?await resolveHookOptions(_0x3e5b3d,_0x230196):undefined,_0xa405c1=buildFilePath(_0x3e5b3d,_0x594f08,_0x2bb4ba,_0x116ab4);if(await fileExists(_0xa405c1))throw CliErrors[_0x187003(0x18d)](_0x187003(0x19c)+_0xa405c1);await mkdir(dirname(_0xa405c1),{'recursive':!![]});const _0x208e5a=generateTemplate(_0x594f08,_0x2bb4ba,_0x230196[_0x187003(0x196)],_0x3e438a,_0x116ab4);await writeFile(_0xa405c1,_0x208e5a,'utf8');const _0x30d297={'type':_0x594f08,'name':_0x2bb4ba,'path':_0xa405c1};if(_0x3e438a)_0x30d297['description']=_0x3e438a;if(_0x116ab4){if(_0x116ab4[_0x187003(0x157)])_0x30d297[_0x187003(0x157)]=_0x116ab4['alias'];_0x30d297[_0x187003(0x190)]=_0x116ab4['datasetCode'],_0x30d297[_0x187003(0x18b)]=_0x116ab4[_0x187003(0x18b)],_0x30d297['functionNode']=_0x116ab4[_0x187003(0x191)];}return{'ok':!![],'data':_0x30d297,'message':_0x187003(0x162)+_0x594f08+_0x187003(0x165)+_0x2bb4ba};}};async function resolveHookOptions(_0x4ba182,_0x3ce502){const _0x442f97=a30_0x23515b,_0xf7f7b3=loadAliasMap(_0x3ce502[_0x442f97(0x19d)],undefined,resolveApiFilePath(_0x3ce502[_0x442f97(0x19d)],_0x3ce502['appCode'])),_0x4c9362=_0xf7f7b3[_0x442f97(0x187)]>0x0;let _0x31f942,_0x30f5a5,_0x407ae8;const _0x333d14=_0x3ce502['str'](_0x442f97(0x157)),_0x54a60a=_0x3ce502[_0x442f97(0x181)](_0x442f97(0x169));if(_0x333d14){const _0x4c537c=resolveAlias(_0x3ce502[_0x442f97(0x19d)],_0x333d14,undefined,resolveApiFilePath(_0x3ce502[_0x442f97(0x19d)],_0x3ce502['appCode']));if(!_0x4c537c){const _0xc9b916=_0x4c9362?_0x442f97(0x180)+_0xf7f7b3[_0x442f97(0x166)](_0x1b0f41=>_0x1b0f41[_0x442f97(0x157)])[_0x442f97(0x18e)](',\x20'):_0x442f97(0x155)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x1a5)+_0x333d14+_0x442f97(0x186)+_0xc9b916);}_0x31f942=_0x333d14,_0x30f5a5=_0x4c537c;}else{if(_0x54a60a){_0x30f5a5=_0x54a60a;const _0x147356=_0xf7f7b3['find'](_0x22b1ee=>_0x22b1ee[_0x442f97(0x190)]===_0x54a60a);_0x31f942=_0x147356?.[_0x442f97(0x157)];}else{if(_0x3ce502['nonInteractive'])throw CliErrors[_0x442f97(0x18d)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x4c9362){const _0x5694ce=_0xf7f7b3[_0x442f97(0x166)](_0x53e7af=>_0x53e7af[_0x442f97(0x157)]+'\x20('+_0x53e7af[_0x442f97(0x1ad)]+')'),_0x29256f=await promptSelect(_0x442f97(0x16e),_0x5694ce),_0x4987d4=_0xf7f7b3[_0x29256f];if(!_0x4987d4)throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x19b));_0x31f942=_0x4987d4[_0x442f97(0x157)],_0x30f5a5=_0x4987d4[_0x442f97(0x190)];}else{const _0x3b5833=await listDatasets(_0x3ce502['appCode']);if(_0x3b5833['length']===0x0)throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x16f));const _0x24b560=_0x3b5833['map'](_0x1a5139=>_0x1a5139[_0x442f97(0x170)]+'\x20['+(_0x1a5139[_0x442f97(0x1b0)]??_0x442f97(0x177))+']\x20('+_0x1a5139['code']+')'),_0x5203f4=await promptSelect(_0x442f97(0x16e),_0x24b560),_0x1f1241=_0x3b5833[_0x5203f4];if(!_0x1f1241)throw CliErrors[_0x442f97(0x18d)]('Invalid\x20dataset\x20selection.');_0x30f5a5=_0x1f1241[_0x442f97(0x17f)],_0x31f942=undefined;}}}}const _0x562ff5=await listDatasets(_0x3ce502[_0x442f97(0x196)]),_0x41a077=_0x562ff5['find'](_0x29566e=>_0x29566e['code']===_0x30f5a5);if(!_0x41a077)throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x193)+_0x30f5a5+'\x22.\x20'+(_0x31f942?_0x442f97(0x183)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x407ae8=_0x41a077['id'];const _0x1c8b8e=_0x31f942??_0x30f5a5,_0x8e44b=await listBffDatasetOperations(_0x3ce502['appCode'],_0x407ae8),_0x495fb9=_0x8e44b?Object[_0x442f97(0x18f)](_0x8e44b):[];if(_0x495fb9[_0x442f97(0x187)]===0x0)throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x1af)+_0x1c8b8e+'.');let _0x40f3d7;const _0x558e0f=_0x3ce502['str']('operation-type');if(_0x558e0f){if(!_0x495fb9[_0x442f97(0x17a)](_0x558e0f))throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x16b)+_0x558e0f+_0x442f97(0x197)+_0x1c8b8e+'.\x20'+(_0x442f97(0x1a3)+_0x495fb9[_0x442f97(0x18e)](',\x20')));_0x40f3d7=_0x558e0f;}else{if(_0x3ce502[_0x442f97(0x195)])throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x1ac));const _0x4301d1=await promptSelect(_0x442f97(0x1a2),_0x495fb9);_0x40f3d7=_0x495fb9[_0x4301d1]??_0x495fb9[0x0];}let _0x219ba6=normalizeHookFunctionNode(_0x3ce502['str'](_0x442f97(0x15f)));if(!_0x219ba6){if(_0x3ce502['str'](_0x442f97(0x15f)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x3ce502[_0x442f97(0x195)])throw CliErrors[_0x442f97(0x18d)](_0x442f97(0x189));const _0x341ffd=await promptSelect('Select\x20trigger\x20node:',[_0x442f97(0x1b1),_0x442f97(0x15b)]);_0x219ba6=[_0x442f97(0x1b1),_0x442f97(0x15b)][_0x341ffd]??_0x442f97(0x1b1);}return{'alias':_0x31f942,'datasetCode':_0x30f5a5,'datasetId':_0x407ae8,'operationType':_0x40f3d7,'functionNode':_0x219ba6};}async function promptSelect(_0x5ac42b,_0x53e834){const _0x54e41a=a30_0x23515b;if(_0x53e834['length']===0x1)return 0x0;for(const [_0xdf7318,_0x35349b]of _0x53e834['entries']()){process[_0x54e41a(0x17b)][_0x54e41a(0x17d)]('\x20\x20'+(_0xdf7318+0x1)+'.\x20'+_0x35349b+'\x0a');}const _0x2e80ac=createInterface({'input':process[_0x54e41a(0x184)],'output':process['stderr']});while(!![]){const _0x47be4c=await new Promise(_0x17f883=>{const _0x1901c7=_0x54e41a;_0x2e80ac[_0x1901c7(0x168)](_0x5ac42b+'\x20',_0x17f883);}),_0x5a8577=Number[_0x54e41a(0x1a6)](_0x47be4c[_0x54e41a(0x172)](),0xa);if(Number[_0x54e41a(0x18c)](_0x5a8577)&&_0x5a8577>=0x1&&_0x5a8577<=_0x53e834['length'])return _0x2e80ac[_0x54e41a(0x178)](),_0x5a8577-0x1;process[_0x54e41a(0x17b)][_0x54e41a(0x17d)](_0x54e41a(0x199)+_0x53e834['length']+'.\x0a');}}function buildFilePath(_0x3fafd1,_0x51de42,_0x4e1da9,_0x2823c1){const _0x9b35d5=a30_0x23515b;if(_0x51de42===_0x9b35d5(0x15a)){if(!_0x2823c1)throw CliErrors[_0x9b35d5(0x18d)](_0x9b35d5(0x156));const _0x209f4e=_0x2823c1['alias']??_0x2823c1['datasetCode'];return join(_0x3fafd1[_0x9b35d5(0x160)],_0x9b35d5(0x15a),_0x209f4e,_0x2823c1['operationType'],_0x2823c1[_0x9b35d5(0x191)],_0x4e1da9+_0x9b35d5(0x15d));}return join(_0x3fafd1[_0x9b35d5(0x160)],_0x51de42,_0x4e1da9+'.js');}export function generateTemplate(_0x541b4d,_0x4618af,_0x1caf0a,_0x54a336,_0x576805){const _0x4c10fc=a30_0x23515b,_0x3f0f4c=_0x54a336?.[_0x4c10fc(0x172)]()||'TODO:\x20add\x20script\x20description';if(_0x541b4d===_0x4c10fc(0x164))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x3f0f4c+_0x4c10fc(0x1aa)+_0x4618af+_0x4c10fc(0x15e)+_0x4618af+'.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'+_0x4618af+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x541b4d===_0x4c10fc(0x188))return _0x4c10fc(0x1a8)+_0x3f0f4c+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x1caf0a+'/'+_0x4618af+_0x4c10fc(0x1ae)+_0x4618af+_0x4c10fc(0x16d);if(!_0x576805)throw CliErrors[_0x4c10fc(0x18d)](_0x4c10fc(0x1a1));return _0x4c10fc(0x19f)+_0x3f0f4c+_0x4c10fc(0x174)+_0x1caf0a+'/'+_0x576805[_0x4c10fc(0x190)]+'/'+_0x576805[_0x4c10fc(0x18b)]+_0x4c10fc(0x182)+_0x576805['functionNode']+_0x4c10fc(0x167)+_0x4618af+_0x4c10fc(0x16d);}
|
|
1
|
+
const a30_0x44d0ac=a30_0x4a11;(function(_0x5f50e8,_0x1d8b4f){const _0x1bedc0=a30_0x4a11,_0x4f4efd=_0x5f50e8();while(!![]){try{const _0x14ecff=parseInt(_0x1bedc0(0x185))/0x1*(parseInt(_0x1bedc0(0x183))/0x2)+-parseInt(_0x1bedc0(0x166))/0x3+parseInt(_0x1bedc0(0x18c))/0x4+-parseInt(_0x1bedc0(0x17e))/0x5*(-parseInt(_0x1bedc0(0x1bb))/0x6)+parseInt(_0x1bedc0(0x1b3))/0x7*(-parseInt(_0x1bedc0(0x181))/0x8)+parseInt(_0x1bedc0(0x17c))/0x9+parseInt(_0x1bedc0(0x1a2))/0xa*(-parseInt(_0x1bedc0(0x191))/0xb);if(_0x14ecff===_0x1d8b4f)break;else _0x4f4efd['push'](_0x4f4efd['shift']());}catch(_0x46581){_0x4f4efd['push'](_0x4f4efd['shift']());}}}(a30_0x1bfd,0x9a043));function a30_0x1bfd(){const _0x3381ac=['Invalid\x20function\x20name\x20\x22','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','datasetcode','after','\x20api\x20pull`\x20to\x20refresh.','File\x20already\x20exists:\x20','\x0a\x20*\x20[触发节点]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','before','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Invalid\x20dataset\x20selection.','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','str','functionNode','appCode','69460UwPlVz','stdin','source','alias','tableName','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','question','length',']\x20(','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','validation','apiDir','Select\x20trigger\x20node:','Script\x20type','ENDPOINT','Select\x20operation\x20type:','1603JWnKQL','\x22\x20not\x20found.\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Select\x20dataset:','name','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','join','description','2814ZVtSdS','keys','read','\x22\x20not\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','stderr','650931WvOAEo','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','Trigger\x20node\x20(HOOK\x20only)','trim','\x0a\x20*\x20[脚本名称]\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','operationType','write','\x22.\x20','Operation\x20type\x20(HOOK\x20only)','Available:\x20','HOOK','function-node','code','scriptsRootDir','utf8','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','isInteger','includes','Script\x20description','5262606PUIMzg','datasetCode','11875zAOExC','\x20function:\x20','string','28400vfcIly','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','88636rTeCmN','UNKNOWN','1gSzdDe','.js','No\x20datasets\x20found\x20for\x20this\x20app.','bff','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','HOOK\x20requires\x20alias/operation/node\x20options.','Available\x20aliases:\x20','2144180YVpdnH','map','nonInteractive','operation-type','No\x20api.ts\x20found.\x20Run\x20`','979TaxBMR'];a30_0x1bfd=function(){return _0x3381ac;};return a30_0x1bfd();}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x44d0ac(0x188),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a30_0x44d0ac(0x1bd),'flags':[{'name':'type','type':'string','required':!![],'enum':[a30_0x44d0ac(0x19d),'ENDPOINT',a30_0x44d0ac(0x173)],'description':a30_0x44d0ac(0x1b0)},{'name':'name','type':a30_0x44d0ac(0x180),'required':!![],'description':a30_0x44d0ac(0x169)},{'name':a30_0x44d0ac(0x1ba),'type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x17b)},{'name':'alias','type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x167)},{'name':a30_0x44d0ac(0x194),'type':'string','description':a30_0x44d0ac(0x1b5)},{'name':'operation-type','type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x171)},{'name':a30_0x44d0ac(0x174),'type':'string','description':a30_0x44d0ac(0x16a),'enum':['before',a30_0x44d0ac(0x195)]}],async 'validate'(_0x427c17){const _0x2f2095=a30_0x44d0ac,_0x196cb8=_0x427c17[_0x2f2095(0x19f)](_0x2f2095(0x1b7));if(!isValidBffFunctionName(_0x196cb8))throw CliErrors['validation'](_0x2f2095(0x192)+_0x196cb8+_0x2f2095(0x1a7));},async 'execute'(_0x3f4c93){const _0x371941=a30_0x44d0ac,_0x340085=loadBffProjectConfig(_0x3f4c93[_0x371941(0x1a1)]),_0xbf93b0=_0x3f4c93[_0x371941(0x19f)]('type'),_0xda4755=_0x3f4c93[_0x371941(0x19f)](_0x371941(0x1b7)),_0x7c036c=_0x3f4c93[_0x371941(0x19f)](_0x371941(0x1ba))||undefined,_0x4d2a82=_0xbf93b0===_0x371941(0x173)?await resolveHookOptions(_0x340085,_0x3f4c93):undefined,_0x4de679=buildFilePath(_0x340085,_0xbf93b0,_0xda4755,_0x4d2a82);if(await fileExists(_0x4de679))throw CliErrors[_0x371941(0x1ad)](_0x371941(0x197)+_0x4de679);await mkdir(dirname(_0x4de679),{'recursive':!![]});const _0x331273=generateTemplate(_0xbf93b0,_0xda4755,_0x3f4c93['appCode'],_0x7c036c,_0x4d2a82);await writeFile(_0x4de679,_0x331273,_0x371941(0x177));const _0x46d1cc={'type':_0xbf93b0,'name':_0xda4755,'path':_0x4de679};if(_0x7c036c)_0x46d1cc[_0x371941(0x1ba)]=_0x7c036c;if(_0x4d2a82){if(_0x4d2a82[_0x371941(0x1a5)])_0x46d1cc['alias']=_0x4d2a82[_0x371941(0x1a5)];_0x46d1cc[_0x371941(0x17d)]=_0x4d2a82['datasetCode'],_0x46d1cc[_0x371941(0x16e)]=_0x4d2a82['operationType'],_0x46d1cc[_0x371941(0x1a0)]=_0x4d2a82[_0x371941(0x1a0)];}return{'ok':!![],'data':_0x46d1cc,'message':'Created\x20'+_0xbf93b0+_0x371941(0x17f)+_0xda4755};}};function a30_0x4a11(_0x3b12f9,_0x1e7ebc){_0x3b12f9=_0x3b12f9-0x166;const _0x1bfd0d=a30_0x1bfd();let _0x4a1179=_0x1bfd0d[_0x3b12f9];return _0x4a1179;}async function resolveHookOptions(_0x5c295a,_0x5730d8){const _0x4ebc77=a30_0x44d0ac,_0xc6c714=loadAliasMap(_0x5730d8[_0x4ebc77(0x1ae)],undefined,resolveApiFilePath(_0x5730d8[_0x4ebc77(0x1ae)],_0x5730d8[_0x4ebc77(0x1a1)])),_0x5cd568=_0xc6c714[_0x4ebc77(0x1aa)]>0x0;let _0x41dece,_0x5f3270,_0x3884a6;const _0x482329=_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x1a5)),_0x39fc16=_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x194));if(_0x482329){const _0x551500=resolveAlias(_0x5730d8['apiDir'],_0x482329,undefined,resolveApiFilePath(_0x5730d8[_0x4ebc77(0x1ae)],_0x5730d8['appCode']));if(!_0x551500){const _0x23a92f=_0x5cd568?_0x4ebc77(0x18b)+_0xc6c714[_0x4ebc77(0x18d)](_0x31b171=>_0x31b171[_0x4ebc77(0x1a5)])[_0x4ebc77(0x1b9)](',\x20'):_0x4ebc77(0x190)+CLI_BIN_NAME+_0x4ebc77(0x193);throw CliErrors[_0x4ebc77(0x1ad)]('Alias\x20\x22'+_0x482329+_0x4ebc77(0x1b4)+_0x23a92f);}_0x41dece=_0x482329,_0x5f3270=_0x551500;}else{if(_0x39fc16){_0x5f3270=_0x39fc16;const _0x2d7708=_0xc6c714['find'](_0x2776e6=>_0x2776e6['datasetCode']===_0x39fc16);_0x41dece=_0x2d7708?.[_0x4ebc77(0x1a5)];}else{if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x168));else{if(_0x5cd568){const _0x370404=_0xc6c714[_0x4ebc77(0x18d)](_0x498db3=>_0x498db3[_0x4ebc77(0x1a5)]+'\x20('+_0x498db3[_0x4ebc77(0x1a6)]+')'),_0x525ab1=await promptSelect(_0x4ebc77(0x1b6),_0x370404),_0x2610db=_0xc6c714[_0x525ab1];if(!_0x2610db)throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x19c));_0x41dece=_0x2610db[_0x4ebc77(0x1a5)],_0x5f3270=_0x2610db[_0x4ebc77(0x17d)];}else{const _0x12d4f0=await listDatasets(_0x5730d8[_0x4ebc77(0x1a1)]);if(_0x12d4f0[_0x4ebc77(0x1aa)]===0x0)throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x187));const _0x2d63e5=_0x12d4f0['map'](_0xd901de=>_0xd901de[_0x4ebc77(0x1b7)]+'\x20['+(_0xd901de[_0x4ebc77(0x1a4)]??_0x4ebc77(0x184))+_0x4ebc77(0x1ab)+_0xd901de[_0x4ebc77(0x175)]+')'),_0x1b5f29=await promptSelect('Select\x20dataset:',_0x2d63e5),_0x55a2e8=_0x12d4f0[_0x1b5f29];if(!_0x55a2e8)throw CliErrors['validation'](_0x4ebc77(0x19c));_0x5f3270=_0x55a2e8[_0x4ebc77(0x175)],_0x41dece=undefined;}}}}const _0x17df3e=await listDatasets(_0x5730d8[_0x4ebc77(0x1a1)]),_0x1a7a0a=_0x17df3e['find'](_0x35bdae=>_0x35bdae['code']===_0x5f3270);if(!_0x1a7a0a)throw CliErrors['validation']('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x5f3270+_0x4ebc77(0x170)+(_0x41dece?_0x4ebc77(0x1b8)+CLI_BIN_NAME+_0x4ebc77(0x196):''));_0x3884a6=_0x1a7a0a['id'];const _0x2f533d=_0x41dece??_0x5f3270,_0xd005b2=await listBffDatasetOperations(_0x5730d8[_0x4ebc77(0x1a1)],_0x3884a6),_0x5643fb=_0xd005b2?Object[_0x4ebc77(0x1bc)](_0xd005b2):[];if(_0x5643fb[_0x4ebc77(0x1aa)]===0x0)throw CliErrors[_0x4ebc77(0x1ad)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x2f533d+'.');let _0x2d6ad0;const _0x9de5cb=_0x5730d8['str'](_0x4ebc77(0x18f));if(_0x9de5cb){if(!_0x5643fb[_0x4ebc77(0x17a)](_0x9de5cb))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x9de5cb+_0x4ebc77(0x1be)+_0x2f533d+'.\x20'+(_0x4ebc77(0x172)+_0x5643fb[_0x4ebc77(0x1b9)](',\x20')));_0x2d6ad0=_0x9de5cb;}else{if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x46a1e1=await promptSelect(_0x4ebc77(0x1b2),_0x5643fb);_0x2d6ad0=_0x5643fb[_0x46a1e1]??_0x5643fb[0x0];}let _0x308577=normalizeHookFunctionNode(_0x5730d8['str'](_0x4ebc77(0x174)));if(!_0x308577){if(_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x174)))throw CliErrors['validation'](_0x4ebc77(0x19b));if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x16d));const _0x5e549d=await promptSelect(_0x4ebc77(0x1af),[_0x4ebc77(0x19a),_0x4ebc77(0x195)]);_0x308577=[_0x4ebc77(0x19a),_0x4ebc77(0x195)][_0x5e549d]??_0x4ebc77(0x19a);}return{'alias':_0x41dece,'datasetCode':_0x5f3270,'datasetId':_0x3884a6,'operationType':_0x2d6ad0,'functionNode':_0x308577};}async function promptSelect(_0x14def4,_0x2de609){const _0x573b87=a30_0x44d0ac;if(_0x2de609[_0x573b87(0x1aa)]===0x1)return 0x0;for(const [_0x2e1e4,_0x3a4ed2]of _0x2de609['entries']()){process[_0x573b87(0x1c0)][_0x573b87(0x16f)]('\x20\x20'+(_0x2e1e4+0x1)+'.\x20'+_0x3a4ed2+'\x0a');}const _0x5584d4=createInterface({'input':process[_0x573b87(0x1a3)],'output':process[_0x573b87(0x1c0)]});while(!![]){const _0x5a6ab2=await new Promise(_0x209593=>{const _0x11a006=_0x573b87;_0x5584d4[_0x11a006(0x1a9)](_0x14def4+'\x20',_0x209593);}),_0xc7e02f=Number['parseInt'](_0x5a6ab2[_0x573b87(0x16b)](),0xa);if(Number[_0x573b87(0x179)](_0xc7e02f)&&_0xc7e02f>=0x1&&_0xc7e02f<=_0x2de609['length'])return _0x5584d4['close'](),_0xc7e02f-0x1;process[_0x573b87(0x1c0)][_0x573b87(0x16f)](_0x573b87(0x182)+_0x2de609[_0x573b87(0x1aa)]+'.\x0a');}}function buildFilePath(_0x3fd8e0,_0x4b92f9,_0x3cf99a,_0x4c5ba5){const _0x4c3e7e=a30_0x44d0ac;if(_0x4b92f9==='HOOK'){if(!_0x4c5ba5)throw CliErrors['validation'](_0x4c3e7e(0x18a));const _0x2096ae=_0x4c5ba5['alias']??_0x4c5ba5['datasetCode'];return join(_0x3fd8e0[_0x4c3e7e(0x176)],'HOOK',_0x2096ae,_0x4c5ba5[_0x4c3e7e(0x16e)],_0x4c5ba5[_0x4c3e7e(0x1a0)],_0x3cf99a+_0x4c3e7e(0x186));}return join(_0x3fd8e0[_0x4c3e7e(0x176)],_0x4b92f9,_0x3cf99a+_0x4c3e7e(0x186));}export function generateTemplate(_0x554255,_0xc7fae4,_0x11dd8d,_0x542d20,_0x382981){const _0x2f8c45=a30_0x44d0ac,_0xc02712=_0x542d20?.[_0x2f8c45(0x16b)]()||'TODO:\x20add\x20script\x20description';if(_0x554255===_0x2f8c45(0x19d))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0xc02712+_0x2f8c45(0x16c)+_0xc7fae4+_0x2f8c45(0x178)+_0xc7fae4+'.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'+_0xc7fae4+_0x2f8c45(0x199);if(_0x554255===_0x2f8c45(0x1b1))return _0x2f8c45(0x1bf)+_0xc02712+_0x2f8c45(0x19e)+_0x11dd8d+'/'+_0xc7fae4+'\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'+_0xc7fae4+_0x2f8c45(0x199);if(!_0x382981)throw CliErrors[_0x2f8c45(0x1ad)](_0x2f8c45(0x1a8));return _0x2f8c45(0x189)+_0xc02712+_0x2f8c45(0x1ac)+_0x11dd8d+'/'+_0x382981[_0x2f8c45(0x17d)]+'/'+_0x382981['operationType']+_0x2f8c45(0x198)+_0x382981[_0x2f8c45(0x1a0)]+'\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'+_0xc7fae4+_0x2f8c45(0x199);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x345c42=a31_0x4936;(function(_0x23c3e9,_0x38f8fd){const _0x3f8157=a31_0x4936,_0x12d13f=_0x23c3e9();while(!![]){try{const _0x51af05=parseInt(_0x3f8157(0x184))/0x1*(parseInt(_0x3f8157(0x162))/0x2)+parseInt(_0x3f8157(0x188))/0x3*(-parseInt(_0x3f8157(0x161))/0x4)+-parseInt(_0x3f8157(0x187))/0x5*(parseInt(_0x3f8157(0x18e))/0x6)+-parseInt(_0x3f8157(0x167))/0x7+-parseInt(_0x3f8157(0x15c))/0x8+-parseInt(_0x3f8157(0x16b))/0x9+parseInt(_0x3f8157(0x181))/0xa*(parseInt(_0x3f8157(0x17e))/0xb);if(_0x51af05===_0x38f8fd)break;else _0x12d13f['push'](_0x12d13f['shift']());}catch(_0x50e081){_0x12d13f['push'](_0x12d13f['shift']());}}}(a31_0x26f5,0xc8b78));function a31_0x4936(_0x552817,_0x623231){_0x552817=_0x552817-0x15b;const _0x26f519=a31_0x26f5();let _0x49366e=_0x26f519[_0x552817];return _0x49366e;}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_0x345c42(0x163),'command':'delete','description':a31_0x345c42(0x16f),'risk':a31_0x345c42(0x191),'flags':[{'name':a31_0x345c42(0x186),'type':a31_0x345c42(0x190),'required':!![],'description':a31_0x345c42(0x17c)}],async 'validate'(_0x4faca4){const _0x170256=a31_0x345c42,_0xd71c4f=loadBffProjectConfig(_0x4faca4[_0x170256(0x17b)]),_0x4c1a6f=await readBffLockFile(_0xd71c4f[_0x170256(0x169)]);if(!_0x4c1a6f)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x1a7454){const _0x2ce2b3=a31_0x345c42,_0x3711cc=loadBffProjectConfig(_0x1a7454['appCode']),_0x2a1d28=await readBffLockFile(_0x3711cc[_0x2ce2b3(0x169)]);if(!_0x2a1d28)throw CliErrors['validation'](_0x2ce2b3(0x171));const {appLock:_0x2cd1ee}=ensureLockScope(_0x2a1d28,_0x1a7454[_0x2ce2b3(0x17b)],_0x3711cc[_0x2ce2b3(0x172)],_0x2ce2b3(0x18c)),_0x3da11f=_0x1a7454[_0x2ce2b3(0x185)](_0x2ce2b3(0x186)),_0x58408b=Object[_0x2ce2b3(0x176)](_0x2cd1ee[_0x2ce2b3(0x175)]),_0x28a419=resolveDeleteTarget(_0x3da11f,_0x58408b),_0x5f0361=_0x2cd1ee[_0x2ce2b3(0x175)][_0x28a419];if(!_0x5f0361)throw CliErrors[_0x2ce2b3(0x173)](_0x2ce2b3(0x189)+_0x28a419+'\x22.');const _0x4c1a3d=resolveLocalFilePathFromLockKey(_0x3711cc,_0x28a419),_0x1ccb70=relative(_0x3711cc['projectRoot'],_0x4c1a3d),_0x2173a3=join(_0x3711cc[_0x2ce2b3(0x15f)],_0x2ce2b3(0x17f),_0x1ccb70);return{'method':_0x2ce2b3(0x18a),'url':_0x2ce2b3(0x17a),'body':{'appCode':_0x1a7454[_0x2ce2b3(0x17b)],'target':_0x28a419,'remoteId':_0x5f0361[_0x2ce2b3(0x15e)],'localFilePath':_0x4c1a3d,'trashedPath':_0x2173a3},'description':_0x2ce2b3(0x18b)+_0x28a419+_0x2ce2b3(0x16d)};},async 'execute'(_0x3bffa9){const _0x5b7253=a31_0x345c42,_0x155221=loadBffProjectConfig(_0x3bffa9['appCode']),_0x4f6f0d=await readBffLockFile(_0x155221['lockFilePath']);if(!_0x4f6f0d)throw CliErrors[_0x5b7253(0x173)](_0x5b7253(0x171));const {lockData:_0x4963aa,appLock:_0x3b40aa}=ensureLockScope(_0x4f6f0d,_0x3bffa9[_0x5b7253(0x17b)],_0x155221['scriptsRoot'],'delete'),_0x16998d=JSON[_0x5b7253(0x166)](JSON[_0x5b7253(0x182)](_0x4963aa)),_0x542340=_0x16998d[_0x5b7253(0x164)][_0x3bffa9[_0x5b7253(0x17b)]];if(!_0x542340)throw new Error(_0x5b7253(0x183)+_0x3bffa9[_0x5b7253(0x17b)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x187fb4=_0x3bffa9[_0x5b7253(0x185)](_0x5b7253(0x186)),_0x140fb6=Object[_0x5b7253(0x176)](_0x542340[_0x5b7253(0x175)]),_0x48e595=resolveDeleteTarget(_0x187fb4,_0x140fb6),_0x108884=_0x542340[_0x5b7253(0x175)][_0x48e595];if(!_0x108884)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x48e595+'\x22.');await deleteBffScript(_0x108884[_0x5b7253(0x15e)]),delete _0x542340[_0x5b7253(0x175)][_0x48e595],_0x542340['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x155221['lockFilePath'],_0x16998d);const _0x39dec6=resolveLocalFilePathFromLockKey(_0x155221,_0x48e595);let _0x3ef0b0;await fileExists(_0x39dec6)&&(_0x3ef0b0=await moveToTrash(_0x155221[_0x5b7253(0x179)],_0x155221[_0x5b7253(0x15f)],_0x39dec6),await cleanupEmptyDirectories(dirname(_0x39dec6),_0x155221[_0x5b7253(0x16c)]));await waitForDeleteSettlement(_0x155221[_0x5b7253(0x169)],_0x3bffa9['appCode'],_0x48e595,_0x39dec6),await sleep(0x96);const _0x44a330={'deleted':_0x48e595,'remoteId':_0x108884[_0x5b7253(0x15e)]};if(_0x3ef0b0)_0x44a330['trashedTo']=_0x3ef0b0;return{'ok':!![],'data':_0x44a330,'message':_0x5b7253(0x16e)+_0x48e595+(_0x3ef0b0?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x5acf45,_0x3e67e3){const _0x471aa4=a31_0x345c42;if(_0x5acf45[_0x471aa4(0x18f)]('/')){const _0x252c77=_0x3e67e3[_0x471aa4(0x16a)](_0xd84567=>_0xd84567===_0x5acf45);if(!_0x252c77)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x5acf45);return _0x252c77;}const _0x192202=_0x3e67e3[_0x471aa4(0x168)](_0x5af033=>_0x5af033[_0x471aa4(0x177)]('/')['at'](-0x1)===_0x5acf45);if(_0x192202[_0x471aa4(0x174)]===0x0)throw CliErrors['validation'](_0x471aa4(0x15d)+_0x5acf45);if(_0x192202[_0x471aa4(0x174)]>0x1)throw CliErrors[_0x471aa4(0x173)](_0x471aa4(0x17d)+_0x5acf45+_0x471aa4(0x180)+_0x192202[_0x471aa4(0x178)](_0x33af5d=>_0x471aa4(0x15b)+_0x33af5d)[_0x471aa4(0x170)]('\x0a'));return _0x192202[0x0];}async function moveToTrash(_0xc80075,_0x1bcb6d,_0x5597c6){const _0x33e4b0=a31_0x345c42,_0x3a824a=new Date()[_0x33e4b0(0x18d)]()['replace'](/[:.]/g,'-'),_0x3ff447=relative(_0xc80075,_0x5597c6),_0x4dab10=join(_0x1bcb6d,_0x3a824a,_0x3ff447);return await mkdir(dirname(_0x4dab10),{'recursive':!![]}),await rename(_0x5597c6,_0x4dab10),_0x4dab10;}async function cleanupEmptyDirectories(_0x599ad1,_0x4064e0){const _0x492a19=a31_0x345c42;let _0x3cfc69=resolve(_0x599ad1);const _0x452283=resolve(_0x4064e0);while(_0x3cfc69[_0x492a19(0x165)](''+_0x452283+sep)||_0x3cfc69===_0x452283){if(_0x3cfc69===_0x452283)return;try{const _0x422980=await readdir(_0x3cfc69);if(_0x422980[_0x492a19(0x174)]>0x0)return;await rmdir(_0x3cfc69);}catch{return;}_0x3cfc69=dirname(_0x3cfc69);}}function a31_0x26f5(){const _0x386605=['7697682IUcAfz','scriptsRootDir','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Deleted\x20','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','join','BFF\x20lock\x20file\x20not\x20found.','scriptsRoot','validation','length','functions','keys','split','map','projectRoot','/api/management/library/scripts/delete','appCode','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Multiple\x20functions\x20match\x20\x22','27516973FKewWu','<timestamp>','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','10ClInmf','stringify','Lock\x20scope\x20for\x20app\x20\x22','532333EBsZzB','str','target','5wtHres','12003QAGvOn','No\x20lock\x20entry\x20found\x20for\x20\x22','POST','Would\x20delete\x20','delete','toISOString','1830462ONGxvn','includes','string','high-risk-write','\x20\x20-\x20','979296vHxmcb','Function\x20not\x20found:\x20','remoteId','trashDir','Local\x20delete\x20not\x20settled\x20for\x20','700SclMTD','2HyAdLp','bff','apps','startsWith','parse','1601446HLPcyr','filter','lockFilePath','find'];a31_0x26f5=function(){return _0x386605;};return a31_0x26f5();}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x445439,_0x4d500f,_0x236805,_0x112cee){const _0x40124d=a31_0x345c42;for(let _0x59f037=0x0;_0x59f037<DELETE_SETTLE_RETRY_COUNT;_0x59f037+=0x1){const _0x1ec208=await readBffLockFile(_0x445439),_0x1beecd=!!_0x1ec208?.[_0x40124d(0x164)]?.[_0x4d500f]?.[_0x40124d(0x175)]?.[_0x236805],_0x3343ba=await fileExists(_0x112cee);if(!_0x1beecd&&!_0x3343ba)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x40124d(0x160)+_0x236805+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x41e948=a32_0x49ea;function a32_0x49ea(_0xbb0e2c,_0x46d1dd){_0xbb0e2c=_0xbb0e2c-0xda;const _0x7821fe=a32_0x7821();let _0x49eacd=_0x7821fe[_0xbb0e2c];return _0x49eacd;}function a32_0x7821(){const _0x10eb7c=['(none)','100LSvOlm','Return\x20full\x20raw\x20script\x20object','Script\x20ID','760DXktvy','read','scriptType','1263218WOPBEt','39378UjnHsg','bff','42168zWhWfZ','version','45451klugDa','verbose','description','328aLqiNy','updateUserName','9268452KTjvKI','boolean','551620ZhbnYg','updatedTime','scriptContent','num','126HjlGBM','Get\x20BFF\x20script\x20details\x20by\x20ID','696967MdQjtj','detail'];a32_0x7821=function(){return _0x10eb7c;};return a32_0x7821();}(function(_0x4ce83e,_0x2ea250){const _0x33a957=a32_0x49ea,_0x12d4aa=_0x4ce83e();while(!![]){try{const _0x379492=parseInt(_0x33a957(0xe8))/0x1+-parseInt(_0x33a957(0xe6))/0x2*(parseInt(_0x33a957(0xf4))/0x3)+parseInt(_0x33a957(0xe2))/0x4+-parseInt(_0x33a957(0xee))/0x5*(-parseInt(_0x33a957(0xf2))/0x6)+parseInt(_0x33a957(0xdb))/0x7*(-parseInt(_0x33a957(0xde))/0x8)+-parseInt(_0x33a957(0xe0))/0x9+-parseInt(_0x33a957(0xeb))/0xa*(-parseInt(_0x33a957(0xf1))/0xb);if(_0x379492===_0x2ea250)break;else _0x12d4aa['push'](_0x12d4aa['shift']());}catch(_0x9d949e){_0x12d4aa['push'](_0x12d4aa['shift']());}}}(a32_0x7821,0xc321b));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x41e948(0xf3),'command':a32_0x41e948(0xe9),'description':a32_0x41e948(0xe7),'risk':a32_0x41e948(0xef),'flags':[{'name':'id','type':'number','required':!![],'description':a32_0x41e948(0xed)},{'name':'verbose','type':a32_0x41e948(0xe1),'description':a32_0x41e948(0xec)}],async 'execute'(_0x489e79){const _0x21a2ec=a32_0x41e948,_0x289c85=await getBffScriptInfo(_0x489e79[_0x21a2ec(0xe5)]('id')),_0x4fc413=_0x489e79['bool'](_0x21a2ec(0xdc));if(_0x4fc413)return{'ok':!![],'data':_0x289c85};return{'ok':!![],'data':{'id':_0x289c85['id'],'functionName':_0x289c85['functionName']??'','version':_0x289c85[_0x21a2ec(0xda)]??'','updateUserName':_0x289c85[_0x21a2ec(0xdf)]??'','appCode':_0x289c85['appCode'],'scriptType':_0x289c85[_0x21a2ec(0xf0)],'description':_0x289c85[_0x21a2ec(0xdd)]||_0x21a2ec(0xea),'createdTime':_0x289c85['createdTime']??'','updatedTime':_0x289c85[_0x21a2ec(0xe3)]??'','scriptContent':_0x289c85[_0x21a2ec(0xe4)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfa4d16,_0x3cafcb){const _0x235c2b=a33_0x893a,_0x57a201=_0xfa4d16();while(!![]){try{const _0xb8bf0c=-parseInt(_0x235c2b(0x90))/0x1*(-parseInt(_0x235c2b(0x94))/0x2)+parseInt(_0x235c2b(0x93))/0x3+-parseInt(_0x235c2b(0x8e))/0x4+-parseInt(_0x235c2b(0x95))/0x5+-parseInt(_0x235c2b(0x8f))/0x6+-parseInt(_0x235c2b(0x91))/0x7*(-parseInt(_0x235c2b(0x92))/0x8)+parseInt(_0x235c2b(0x8d))/0x9;if(_0xb8bf0c===_0x3cafcb)break;else _0x57a201['push'](_0x57a201['shift']());}catch(_0x50c59f){_0x57a201['push'](_0x57a201['shift']());}}}(a33_0x23f0,0x4f5be));import{bffList}from'../../commands/bff/list.js';function a33_0x23f0(){const _0x477f83=['2036202YlhQWh','4xjJhvE','7IgbCGB','1397544qWrfgi','390582wmrDLE','63244UgbsSb','285645nXMiVe','4041027ahhcJT','635312toTuRF'];a33_0x23f0=function(){return _0x477f83;};return a33_0x23f0();}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_0x893a(_0x84db45,_0x5d9db4){_0x84db45=_0x84db45-0x8d;const _0x23f014=a33_0x23f0();let _0x893a6=_0x23f014[_0x84db45];return _0x893a6;}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|