@lovrabet/rabetbase-cli 2.4.6-beta.1 → 2.4.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/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.d.ts +8 -7
- 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/types.d.ts +17 -2
- 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/menu/visibility-update.d.ts +2 -0
- package/lib/commands/menu/visibility-update.js +1 -0
- 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/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/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/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 +3 -2
- package/skills/rabetbase/references/rabetbase-menu-list.md +3 -1
- package/skills/rabetbase/references/rabetbase-menu-visibility-update.md +59 -0
- package/skills/rabetbase.manifest.json +4 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x137dd6=a19_0x223f;(function(_0x13363d,_0x1f68f8){const _0x4a7172=a19_0x223f,_0x2d1b7c=_0x13363d();while(!![]){try{const _0xcbb7de=parseInt(_0x4a7172(0x10b))/0x1*(parseInt(_0x4a7172(0xee))/0x2)+parseInt(_0x4a7172(0xf5))/0x3+parseInt(_0x4a7172(0x105))/0x4+-parseInt(_0x4a7172(0xe6))/0x5*(parseInt(_0x4a7172(0x103))/0x6)+parseInt(_0x4a7172(0xfd))/0x7+parseInt(_0x4a7172(0xea))/0x8*(-parseInt(_0x4a7172(0xe2))/0x9)+parseInt(_0x4a7172(0xe5))/0xa;if(_0xcbb7de===_0x1f68f8)break;else _0x2d1b7c['push'](_0x2d1b7c['shift']());}catch(_0x46e031){_0x2d1b7c['push'](_0x2d1b7c['shift']());}}}(a19_0x8fbc,0xbe472));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(_0x4cf0ef,_0x139a61){const _0x477138=a19_0x223f,_0x3234ca=[],_0x5af40f=_0x4cf0ef[_0x477138(0x102)]&&typeof _0x4cf0ef[_0x477138(0x102)]===_0x477138(0x104)?_0x4cf0ef[_0x477138(0x102)]:{},_0x57611e=_0x4cf0ef['defaultApp']||undefined;for(const [_0x316fe9,_0xd741fb]of Object[_0x477138(0xfc)](_0x5af40f)){if(!_0xd741fb||typeof _0xd741fb!==_0x477138(0x104)||!_0xd741fb[_0x477138(0xe1)])continue;_0x3234ca[_0x477138(0x101)]({'name':_0x316fe9,'appcode':_0xd741fb[_0x477138(0xe1)],'named':!![],'definedIn':_0x139a61,'isDefault':_0x316fe9===_0x57611e,...buildAppProfileListFields(_0xd741fb)});}return _0x3234ca;}function buildMergedItems(_0x382da7,_0x438bfa){const _0x22ba9c=a19_0x223f,{apps:apps={},defaultApp:_0x1021cd}=_0x382da7,_0x3d4edb=_0x438bfa[_0x22ba9c(0x109)][_0x22ba9c(0x102)]&&typeof _0x438bfa[_0x22ba9c(0x109)][_0x22ba9c(0x102)]===_0x22ba9c(0x104)?_0x438bfa['globalConfig'][_0x22ba9c(0x102)]:{},_0x3d14c1=_0x438bfa[_0x22ba9c(0xf9)]['apps']&&typeof _0x438bfa[_0x22ba9c(0xf9)]['apps']===_0x22ba9c(0x104)?_0x438bfa[_0x22ba9c(0xf9)]['apps']:{},_0x959715=_0x438bfa[_0x22ba9c(0xf9)][_0x22ba9c(0xe9)]===![],_0x428f9a=Object['entries'](apps),_0x4865ea=_0x428f9a[_0x22ba9c(0x106)](([_0x501e99,_0x4ad90e])=>({'name':_0x501e99,'appcode':_0x4ad90e[_0x22ba9c(0xe1)],'named':!![],'definedIn':appDefinedIn(_0x501e99,_0x3d4edb,_0x3d14c1,_0x959715),'isDefault':_0x501e99===_0x1021cd,...buildAppProfileListFields(_0x4ad90e)}));return _0x4865ea;}function validateAppListFlags(_0x15e1ab){const _0x513cf7=a19_0x223f;if(!_0x15e1ab[_0x513cf7(0xf7)](_0x513cf7(0xe7)))return;if(!_0x15e1ab[_0x513cf7(0xf7)](_0x513cf7(0xf8))&&!_0x15e1ab[_0x513cf7(0xf7)](_0x513cf7(0xed)))return;throw CliErrors[_0x513cf7(0xf0)](_0x513cf7(0xe4),_0x513cf7(0xf3));}function a19_0x8fbc(){const _0x34ebc1=['length','push','apps','6527820xgdVzL','object','886076OhqYdF','map','.\x20Use\x20`','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','globalConfig','\x20config','811MJMtVk','isCurrent','appcode','4509ZdOIrM','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','4309850YmxzuL','5ZXYxcj','remote','read','inherit','10984uaqFHL','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','list','project','1750mXDOjO','No\x20apps\x20configured','validation','optional','find','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','projectPath','113865PPAoST','boolean','bool','global','projectConfig','mergedCli','globalPath','entries','8085959rZdYxc','app','merged'];a19_0x8fbc=function(){return _0x34ebc1;};return a19_0x8fbc();}function a19_0x223f(_0x1781c9,_0x53ff1e){_0x1781c9=_0x1781c9-0xe1;const _0x8fbcbe=a19_0x8fbc();let _0x223f1b=_0x8fbcbe[_0x1781c9];return _0x223f1b;}async function execute(_0x57f303){const _0x102933=a19_0x223f;validateAppListFlags(_0x57f303);if(_0x57f303[_0x102933(0xf7)](_0x102933(0xe7)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x57f303)};const _0x3f4ab1=_0x57f303[_0x102933(0xf7)]('global'),_0x1f188f=_0x57f303[_0x102933(0xf7)](_0x102933(0xed)),_0x46a60d=_0x3f4ab1?_0x102933(0xf8):_0x1f188f?_0x102933(0xed):_0x102933(0xff),{config:_0x323fbb,layers:_0x322b2b}=readRawConfigWithLayers(),_0x484592=resolveDefaultAppSource(_0x322b2b),{defaultApp:_0x5813d1}=_0x323fbb;let _0x5a40cd,_0x1dc4f5;switch(_0x46a60d){case _0x102933(0xf8):_0x5a40cd=buildItemsFromLayer(_0x322b2b[_0x102933(0x109)],_0x102933(0xf8)),_0x1dc4f5=_0x322b2b[_0x102933(0xfb)];break;case'project':_0x5a40cd=buildItemsFromLayer(_0x322b2b[_0x102933(0xf9)],_0x102933(0xed)),_0x1dc4f5=_0x322b2b[_0x102933(0xf4)];break;default:_0x5a40cd=buildMergedItems(_0x323fbb,_0x322b2b);break;}enrichAppListItemsWithMergedSelection(_0x5a40cd,_0x57f303[_0x102933(0xfa)]);if(_0x5a40cd[_0x102933(0x100)]===0x0){const _0x53fd20=_0x46a60d===_0x102933(0xff)?'':'\x20in\x20'+_0x46a60d+_0x102933(0x10a);return{'ok':!![],'data':[],'message':_0x102933(0xef)+_0x53fd20+_0x102933(0x107)+CLI_BIN_NAME+_0x102933(0xe3)};}const _0x302274=_0x5a40cd[_0x102933(0xf2)](_0x424eff=>_0x424eff[_0x102933(0x10c)]===!![]),_0x205bfd=_0x5813d1??_0x302274?.[_0x102933(0xe1)]??null,_0x5cf1d8=_0x46a60d===_0x102933(0xff)?{'globalPath':_0x322b2b[_0x102933(0xfb)]??null,'projectPath':_0x322b2b[_0x102933(0xf4)]??null,'defaultApp':_0x205bfd,'defaultAppSource':_0x5813d1!=null?_0x484592:null}:{'scope':_0x46a60d,'configPath':_0x1dc4f5??null};return{'ok':!![],'data':{'items':_0x5a40cd,'meta':_0x5cf1d8}};}export const appListDefinition={'service':a19_0x137dd6(0xfe),'command':a19_0x137dd6(0xec),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a19_0x137dd6(0xe8),'auth':a19_0x137dd6(0xf1),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x137dd6(0xe7),'type':a19_0x137dd6(0xf6),'description':'List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','default':![]},{'name':a19_0x137dd6(0xf8),'type':a19_0x137dd6(0xf6),'description':a19_0x137dd6(0x108),'default':![]},{'name':'project','type':a19_0x137dd6(0xf6),'description':a19_0x137dd6(0xeb),'default':![]}],async 'validate'(_0x272c4b){validateAppListFlags(_0x272c4b);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a20_0x2cf89e=a20_0x16a8;function a20_0x3e6b(){const _0x1a2874=['2152660URSSWF','app','2476104IDMxGZ','5293752Sxxdbe','length','2DJWBXN','\x20application\x20member(s)','163220LlNSRv','29836940PGeINP','members-list','1937604fvdqRl','9WPRSDG','43266zxihbf','Found\x20','appCode','427AWbHib'];a20_0x3e6b=function(){return _0x1a2874;};return a20_0x3e6b();}(function(_0x3ceeb1,_0x3d9161){const _0x475616=a20_0x16a8,_0x2c4783=_0x3ceeb1();while(!![]){try{const _0x344ce1=parseInt(_0x475616(0x1a0))/0x1+parseInt(_0x475616(0x19e))/0x2*(-parseInt(_0x475616(0x1a3))/0x3)+-parseInt(_0x475616(0x19b))/0x4+-parseInt(_0x475616(0x199))/0x5+-parseInt(_0x475616(0x1a5))/0x6*(parseInt(_0x475616(0x198))/0x7)+parseInt(_0x475616(0x19c))/0x8*(-parseInt(_0x475616(0x1a4))/0x9)+parseInt(_0x475616(0x1a1))/0xa;if(_0x344ce1===_0x3d9161)break;else _0x2c4783['push'](_0x2c4783['shift']());}catch(_0x52a632){_0x2c4783['push'](_0x2c4783['shift']());}}}(a20_0x3e6b,0x556ca));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a20_0x16a8(_0x1dd384,_0x39b699){_0x1dd384=_0x1dd384-0x196;const _0x3e6bcf=a20_0x3e6b();let _0x16a83b=_0x3e6bcf[_0x1dd384];return _0x16a83b;}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x2cf89e(0x19a),'command':a20_0x2cf89e(0x1a2),'description':'List\x20application\x20members\x20with\x20their\x20role\x20memberships','risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x30ecdc){const _0x1ee3e2=a20_0x2cf89e,_0x4e882a=projectAppMembers(await listRoleUsers(_0x30ecdc[_0x1ee3e2(0x197)]));return{'ok':!![],'data':{'appCode':_0x30ecdc[_0x1ee3e2(0x197)],'items':_0x4e882a,'totalCount':_0x4e882a[_0x1ee3e2(0x19d)]},'message':_0x1ee3e2(0x196)+_0x4e882a['length']+_0x1ee3e2(0x19f)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5a8ad9,_0x2769f4){const _0x493ef4=a21_0x6afd,_0x389d4e=_0x5a8ad9();while(!![]){try{const _0x14fe38=parseInt(_0x493ef4(0xe3))/0x1+parseInt(_0x493ef4(0xd1))/0x2*(-parseInt(_0x493ef4(0xe1))/0x3)+parseInt(_0x493ef4(0xdc))/0x4+-parseInt(_0x493ef4(0xde))/0x5*(-parseInt(_0x493ef4(0xd6))/0x6)+-parseInt(_0x493ef4(0xd7))/0x7*(parseInt(_0x493ef4(0xd9))/0x8)+parseInt(_0x493ef4(0xe2))/0x9*(parseInt(_0x493ef4(0xd2))/0xa)+parseInt(_0x493ef4(0xe0))/0xb*(-parseInt(_0x493ef4(0xd5))/0xc);if(_0x14fe38===_0x2769f4)break;else _0x389d4e['push'](_0x389d4e['shift']());}catch(_0x5c1919){_0x389d4e['push'](_0x389d4e['shift']());}}}(a21_0x2e0d,0xbb423));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a21_0x6afd(_0x4b846c,_0x18855b){_0x4b846c=_0x4b846c-0xd1;const _0x2e0dd5=a21_0x2e0d();let _0x6afd05=_0x2e0dd5[_0x4b846c];return _0x6afd05;}function a21_0x2e0d(){const _0x545e2b=['16LVkAPe','platform','appCode','5240644PPiukA','appName','7050090CqtxdM','authRequired','22HhUnLY','292884arulAq','9jPqbvP','1304594kiaSwK','20sQsUYQ','6567440NcQlJP','map','cookie','10321188plRoGA','6bkahUC','4263098VZdDNl','appDesc'];a21_0x2e0d=function(){return _0x545e2b;};return a21_0x2e0d();}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x229d42){const _0x5a9ef3=a21_0x6afd,_0x574c52=_0x229d42[_0x5a9ef3(0xd4)]||getCookie();if(!_0x574c52)throw CliErrors[_0x5a9ef3(0xdf)]();return _0x574c52;}export async function listRemoteAppDirectory(_0x4695bd){const _0xe46ac7=a21_0x6afd,_0x39e896=await withActiveCookie(resolveCookie(_0x4695bd),()=>listRemoteApps());return{'items':_0x39e896[_0xe46ac7(0xd3)](_0x29aa46=>({..._0x29aa46['id']!=null?{'id':_0x29aa46['id']}:{},'appCode':_0x29aa46[_0xe46ac7(0xdb)],'appName':_0x29aa46[_0xe46ac7(0xdd)],..._0x29aa46['appDesc']!=null?{'appDesc':_0x29aa46[_0xe46ac7(0xd8)]}:{}})),'meta':{'source':_0xe46ac7(0xda)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55396d,_0x289829){const _0x491ee6=a22_0x1d54,_0x2740e1=_0x55396d();while(!![]){try{const _0x284f2f=-parseInt(_0x491ee6(0x1a3))/0x1+parseInt(_0x491ee6(0x18b))/0x2+-parseInt(_0x491ee6(0x197))/0x3+-parseInt(_0x491ee6(0x18c))/0x4*(parseInt(_0x491ee6(0x174))/0x5)+parseInt(_0x491ee6(0x18f))/0x6*(parseInt(_0x491ee6(0x1a2))/0x7)+-parseInt(_0x491ee6(0x17f))/0x8*(-parseInt(_0x491ee6(0x17d))/0x9)+parseInt(_0x491ee6(0x1a4))/0xa;if(_0x284f2f===_0x289829)break;else _0x2740e1['push'](_0x2740e1['shift']());}catch(_0x40ba18){_0x2740e1['push'](_0x2740e1['shift']());}}}(a22_0x49d6,0xc2237));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0xe6dc53){const _0x340474=a22_0x1d54,_0x9a068d=_0xe6dc53?.[_0x340474(0x190)]();return _0x9a068d?_0x9a068d:null;}export function projectAppMembers(_0x276d61){const _0x501871=a22_0x1d54,_0x3e773a=new Map(),_0x4b500f=[..._0x276d61][_0x501871(0x181)]((_0x27abd5,_0x2bd6a4)=>_0x27abd5['id']-_0x2bd6a4['id']),_0x2677f4=(_0x8a4508,_0x3f8923,_0x87191b)=>{const _0x60467f=_0x501871;for(const _0x122ecf of _0x3f8923){const _0x547bf6=Number(_0x122ecf[_0x60467f(0x17a)]);if(!Number[_0x60467f(0x196)](_0x547bf6)||_0x547bf6<=0x0)continue;let _0x5d4e85=_0x3e773a[_0x60467f(0x191)](_0x547bf6);if(!_0x5d4e85)_0x5d4e85={'userId':_0x547bf6,'username':nullableText(_0x122ecf['username']),'displayName':nullableText(_0x122ecf['nickname']),'status':_0x87191b,'roles':[],'roleKeys':new Set()},_0x3e773a['set'](_0x547bf6,_0x5d4e85);else{_0x5d4e85[_0x60467f(0x176)]??=nullableText(_0x122ecf['username']),_0x5d4e85[_0x60467f(0x189)]??=nullableText(_0x122ecf[_0x60467f(0x192)]);if(_0x87191b===_0x60467f(0x17b))_0x5d4e85['status']=_0x60467f(0x17b);}const _0x129272=_0x8a4508['id']+':'+_0x87191b;if(_0x5d4e85[_0x60467f(0x185)][_0x60467f(0x180)](_0x129272))continue;_0x5d4e85[_0x60467f(0x185)]['add'](_0x129272),_0x5d4e85[_0x60467f(0x195)][_0x60467f(0x18d)]({'roleId':_0x8a4508['id'],'roleName':nullableText(_0x8a4508[_0x60467f(0x183)]),'roleType':nullableText(_0x8a4508[_0x60467f(0x17e)]),'membershipStatus':_0x87191b});}};for(const _0x4cacc2 of _0x4b500f){_0x2677f4(_0x4cacc2,_0x4cacc2[_0x501871(0x193)]??[],_0x501871(0x17b)),_0x2677f4(_0x4cacc2,_0x4cacc2[_0x501871(0x177)]??[],_0x501871(0x178));}return[..._0x3e773a[_0x501871(0x182)]()][_0x501871(0x1a5)](_0x4cba7f=>({'userId':_0x4cba7f[_0x501871(0x17a)],'username':_0x4cba7f[_0x501871(0x176)],'displayName':_0x4cba7f[_0x501871(0x189)],'status':_0x4cba7f[_0x501871(0x19c)],'roles':_0x4cba7f[_0x501871(0x195)][_0x501871(0x181)]((_0x5acfa2,_0x4283ec)=>_0x5acfa2['roleId']-_0x4283ec['roleId']||(_0x5acfa2[_0x501871(0x175)]===_0x4283ec[_0x501871(0x175)]?0x0:_0x5acfa2[_0x501871(0x175)]===_0x501871(0x17b)?-0x1:0x1))}))['sort']((_0x5e5439,_0x16a3e6)=>_0x5e5439[_0x501871(0x17a)]-_0x16a3e6[_0x501871(0x17a)]);}export function enrichAppListItemsWithMergedSelection(_0x496553,_0x4b9d33){const _0x344735=a22_0x1d54;if(!_0x4b9d33)return;const _0x2106d4=_0x4b9d33[_0x344735(0x1a0)]&&typeof _0x4b9d33[_0x344735(0x1a0)]===_0x344735(0x186)?_0x4b9d33[_0x344735(0x1a0)]:{},_0x46804c=Object[_0x344735(0x198)](_0x2106d4)[_0x344735(0x18a)]>0x0;for(const _0x447252 of _0x496553){_0x447252['isCurrent']=![];}const _0xeea5db=_0x4b9d33[_0x344735(0x194)]!=null?String(_0x4b9d33[_0x344735(0x194)])[_0x344735(0x190)]():'';if(_0x46804c){const _0x3439fb=_0x4b9d33['currentApp']??_0x4b9d33[_0x344735(0x188)];if(_0x3439fb)for(const _0x24397c of _0x496553){_0x24397c[_0x344735(0x17c)]===!![]&&_0x24397c[_0x344735(0x1a6)]===_0x3439fb&&(_0x24397c[_0x344735(0x1a1)]=!![]);}for(const _0x4a1053 of _0x496553){if(_0x4a1053['named']!==![])continue;if(_0x4b9d33['defaultApp'])continue;_0xeea5db&&String(_0x4a1053[_0x344735(0x187)]??'')[_0x344735(0x190)]()===_0xeea5db&&(_0x4a1053[_0x344735(0x1a1)]=!![]);}return;}if(!_0xeea5db)return;for(const _0x45cfd2 of _0x496553){String(_0x45cfd2[_0x344735(0x187)]??'')[_0x344735(0x190)]()===_0xeea5db&&(_0x45cfd2[_0x344735(0x1a1)]=!![]);}}function a22_0x49d6(){const _0x5e76ae=['project','\x20(global)','apps','isCurrent','259dTWMzu','1032621aClyVx','4857740GjXiyl','map','name','both','770825qoMbIL','membershipStatus','username','applyUserList','PENDING','call','userId','ACTIVE','named','36ApMsCU','roleType','2777168UyhFnY','has','sort','values','roleName','projectConfig','roleKeys','object','appcode','defaultApp','displayName','length','681568lATTlj','16luQAer','push','hasOwnProperty','213018YwBLtN','trim','get','nickname','userList','appCode','roles','isFinite','3252843lkXtTR','keys','inherit','global','prototype','status','globalConfig'];a22_0x49d6=function(){return _0x5e76ae;};return a22_0x49d6();}function a22_0x1d54(_0x1cee2c,_0x38bde2){_0x1cee2c=_0x1cee2c-0x174;const _0x49d672=a22_0x49d6();let _0x1d54b1=_0x49d672[_0x1cee2c];return _0x1d54b1;}export function resolveAppScopeForWrite(_0x4fc638,_0x49b21a,_0xe78bfe){const _0x56eba0=a22_0x1d54;if(_0x49b21a)return _0x56eba0(0x19a);const _0x568232=_0xe78bfe[_0x56eba0(0x184)]['apps']&&typeof _0xe78bfe[_0x56eba0(0x184)]['apps']===_0x56eba0(0x186)?_0xe78bfe[_0x56eba0(0x184)][_0x56eba0(0x1a0)]:{},_0x4fd93a=_0xe78bfe[_0x56eba0(0x19d)]['apps']&&typeof _0xe78bfe[_0x56eba0(0x19d)][_0x56eba0(0x1a0)]===_0x56eba0(0x186)?_0xe78bfe[_0x56eba0(0x19d)][_0x56eba0(0x1a0)]:{};if(Object[_0x56eba0(0x19b)][_0x56eba0(0x18e)]['call'](_0x568232,_0x4fc638))return _0x56eba0(0x19e);if(Object[_0x56eba0(0x19b)][_0x56eba0(0x18e)][_0x56eba0(0x179)](_0x4fd93a,_0x4fc638))return _0x56eba0(0x19a);return'project';}export function appDefinedIn(_0x5ab426,_0x4b2c06,_0x5d741a,_0x4eb7a1){const _0x3897e9=a22_0x1d54;if(_0x4eb7a1)return Object[_0x3897e9(0x19b)][_0x3897e9(0x18e)][_0x3897e9(0x179)](_0x5d741a,_0x5ab426)?_0x3897e9(0x19e):'global';const _0x717a63=Object[_0x3897e9(0x19b)][_0x3897e9(0x18e)][_0x3897e9(0x179)](_0x4b2c06,_0x5ab426),_0x394374=Object['prototype']['hasOwnProperty'][_0x3897e9(0x179)](_0x5d741a,_0x5ab426);if(_0x717a63&&_0x394374)return _0x3897e9(0x1a7);if(_0x394374)return _0x3897e9(0x19e);return _0x3897e9(0x19a);}export function resolveDefaultAppSource(_0x1cd1bc){const _0x26617a=a22_0x1d54,_0x8364d6=_0x1cd1bc['projectConfig'][_0x26617a(0x1a0)]&&typeof _0x1cd1bc[_0x26617a(0x184)][_0x26617a(0x1a0)]==='object'?_0x1cd1bc['projectConfig']['apps']:{};if('defaultApp'in _0x1cd1bc[_0x26617a(0x184)])return'project';if(Object['keys'](_0x8364d6)['length']>0x0)return _0x26617a(0x19e);if(_0x1cd1bc['projectConfig'][_0x26617a(0x199)]===![])return null;if(_0x1cd1bc['globalConfig'][_0x26617a(0x188)])return'global';return null;}export function getConfigPath(_0x2c6a61={}){const _0x513e52=a22_0x1d54,_0x23c507=_0x2c6a61['global']?'global':_0x513e52(0x19e);return resolveWriteConfigPath(_0x23c507);}export function readConfig(_0x1feb31={}){return readConfigFile(getConfigPath(_0x1feb31));}export function writeConfig(_0x108f8b,_0x4cae35={}){writeConfigFile(getConfigPath(_0x4cae35),_0x108f8b);}export function scopeLabel(_0x39ef59){const _0x53c4de=a22_0x1d54;return _0x39ef59[_0x53c4de(0x19a)]?_0x53c4de(0x19f):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x2546(_0x4ea22c,_0x1e6f2c){_0x4ea22c=_0x4ea22c-0x16d;const _0x6dacbb=a23_0x6dac();let _0x254620=_0x6dacbb[_0x4ea22c];return _0x254620;}const a23_0x47c766=a23_0x2546;(function(_0x1ee595,_0x4db16b){const _0x448ab5=a23_0x2546,_0x21ba68=_0x1ee595();while(!![]){try{const _0x24b1ac=parseInt(_0x448ab5(0x180))/0x1+parseInt(_0x448ab5(0x16f))/0x2*(-parseInt(_0x448ab5(0x178))/0x3)+parseInt(_0x448ab5(0x17b))/0x4+parseInt(_0x448ab5(0x17f))/0x5*(parseInt(_0x448ab5(0x17d))/0x6)+parseInt(_0x448ab5(0x17c))/0x7*(parseInt(_0x448ab5(0x170))/0x8)+parseInt(_0x448ab5(0x171))/0x9*(-parseInt(_0x448ab5(0x172))/0xa)+-parseInt(_0x448ab5(0x175))/0xb;if(_0x24b1ac===_0x4db16b)break;else _0x21ba68['push'](_0x21ba68['shift']());}catch(_0x4ef708){_0x21ba68['push'](_0x21ba68['shift']());}}}(a23_0x6dac,0x8cf4d));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a23_0x6dac(){const _0x3af7d5=['7ETzQYo','4235622ROQcPB','Deleted\x20app\x20config\x20','5WwfTyO','870278cwdaQc','high-risk-write','app-config','number','App\x20config\x20key\x20not\x20found:\x20','680114QMsMox','16696sbxNFJ','243396iHUDgx','340pRHwRs','Delete\x20one\x20runtime\x20app-config\x20key','appCode:\x20','6520492NcDpnX','isFinite','apiError','3HPqbTe','appCode','delete','3405520IgaqVg'];a23_0x6dac=function(){return _0x3af7d5;};return a23_0x6dac();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a23_0x47c766(0x182),'command':a23_0x47c766(0x17a),'description':a23_0x47c766(0x173),'risk':a23_0x47c766(0x181),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4977e5){readKeyArg(_0x4977e5);},async 'dryRun'(_0x1240c7){const _0x58207b=a23_0x47c766,_0x3b9a70=readKeyArg(_0x1240c7),_0x2cb9d1=await mustGetByKey(_0x1240c7[_0x58207b(0x179)],_0x3b9a70);return asAppConfigDryRunResult(buildMutationData({'operation':_0x58207b(0x17a),'appCode':_0x1240c7[_0x58207b(0x179)],'key':_0x3b9a70,'before':projectAppConfig(_0x2cb9d1),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x1d117d){const _0x123a31=a23_0x47c766,_0x40d5d3=readKeyArg(_0x1d117d),_0x26b27d=await mustGetByKey(_0x1d117d['appCode'],_0x40d5d3);return await withAppConfigApiBoundary(_0x123a31(0x17a),{'appCode':_0x1d117d[_0x123a31(0x179)],'key':_0x40d5d3},()=>deleteAppConfig({'appCode':_0x1d117d[_0x123a31(0x179)],'id':requireAppConfigId(_0x26b27d,_0x40d5d3,_0x1d117d[_0x123a31(0x179)])})),{'ok':!![],'data':buildMutationData({'operation':_0x123a31(0x17a),'appCode':_0x1d117d[_0x123a31(0x179)],'key':_0x40d5d3,'before':projectAppConfig(_0x26b27d),'after':null,'dryRun':![]}),'message':_0x123a31(0x17e)+_0x40d5d3};}};async function mustGetByKey(_0x3db02a,_0x5b3acc){const _0x31e2a9=a23_0x47c766,_0x4814f7=await withAppConfigApiBoundary('get',{'appCode':_0x3db02a,'key':_0x5b3acc},()=>getAppConfigByKey(_0x3db02a,_0x5b3acc));if(!_0x4814f7)throw CliErrors['validation'](_0x31e2a9(0x16e)+_0x5b3acc,_0x31e2a9(0x174)+_0x3db02a);return _0x4814f7;}function requireAppConfigId(_0x21f2bd,_0x56c63d,_0x306d54){const _0x2e2406=a23_0x47c766;if(typeof _0x21f2bd['id']===_0x2e2406(0x16d)&&Number[_0x2e2406(0x176)](_0x21f2bd['id'])&&_0x21f2bd['id']>0x0)return _0x21f2bd['id'];throw CliErrors[_0x2e2406(0x177)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x56c63d+',\x20appCode='+_0x306d54);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a24_0x3643(){const _0x72f8da=['2FubZgF','2513680roUyxz','reveal','98790UqBTTL','bool','12ZyqqYX','9210157WxfAhs','\x20with\x20value\x20redacted','Loaded\x20app\x20config\x20','read','\x20with\x20value\x20revealed','get','App\x20config\x20key\x20not\x20found:\x20','501893WsuIvL','80984PhSWxP','6jhLwAo','1393671XLUMAW','appCode','1415665xnGmRj','504CUCNcF','603XNegzH'];a24_0x3643=function(){return _0x72f8da;};return a24_0x3643();}const a24_0xf2439d=a24_0x514f;(function(_0x60371b,_0x4dfd4f){const _0x3a3ff4=a24_0x514f,_0x1726ff=_0x60371b();while(!![]){try{const _0x5cfddd=-parseInt(_0x3a3ff4(0xe2))/0x1+parseInt(_0x3a3ff4(0xd5))/0x2*(parseInt(_0x3a3ff4(0xe5))/0x3)+-parseInt(_0x3a3ff4(0xd6))/0x4+parseInt(_0x3a3ff4(0xe7))/0x5*(parseInt(_0x3a3ff4(0xe4))/0x6)+-parseInt(_0x3a3ff4(0xd3))/0x7*(parseInt(_0x3a3ff4(0xe3))/0x8)+-parseInt(_0x3a3ff4(0xd4))/0x9*(-parseInt(_0x3a3ff4(0xd8))/0xa)+parseInt(_0x3a3ff4(0xdb))/0xb*(parseInt(_0x3a3ff4(0xda))/0xc);if(_0x5cfddd===_0x4dfd4f)break;else _0x1726ff['push'](_0x1726ff['shift']());}catch(_0x2c1f51){_0x1726ff['push'](_0x1726ff['shift']());}}}(a24_0x3643,0x5ea75));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a24_0x514f(_0x56ae44,_0xfdbdf7){_0x56ae44=_0x56ae44-0xd3;const _0x364308=a24_0x3643();let _0x514f67=_0x364308[_0x56ae44];return _0x514f67;}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':'app-config','command':a24_0xf2439d(0xe0),'description':'Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','risk':a24_0xf2439d(0xde),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x2b80e3){readKeyArg(_0x2b80e3);},async 'execute'(_0x34946b){const _0x39bfb8=a24_0xf2439d,_0x34e00d=readKeyArg(_0x34946b),_0x4b8078=await withAppConfigApiBoundary(_0x39bfb8(0xe0),{'appCode':_0x34946b[_0x39bfb8(0xe6)],'key':_0x34e00d},()=>getAppConfigByKey(_0x34946b['appCode'],_0x34e00d));if(!_0x4b8078)throw CliErrors['validation'](_0x39bfb8(0xe1)+_0x34e00d,'appCode:\x20'+_0x34946b['appCode']);const _0x4a7e44=projectAppConfig(_0x4b8078,{'reveal':_0x34946b[_0x39bfb8(0xd9)](_0x39bfb8(0xd7))});return{'ok':!![],'data':{'config':_0x4a7e44},'message':_0x34946b[_0x39bfb8(0xd9)]('reveal')?_0x39bfb8(0xdd)+_0x34e00d+_0x39bfb8(0xdf):_0x39bfb8(0xdd)+_0x34e00d+_0x39bfb8(0xdc)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0xd2f9(){const _0x100a58=['49932817nOBWnV','10GrzlAY','4030FqUIeP','19222dzoYCz','19422sklIrQ','3354712yCKeQi','1028980kjKSav','830176wcWvWM','30UYCtWd','708807prnPqF','2440GEXMmd'];a25_0xd2f9=function(){return _0x100a58;};return a25_0xd2f9();}(function(_0x62b6f,_0x196d5f){const _0x51c62a=a25_0x350f,_0x2c9905=_0x62b6f();while(!![]){try{const _0x6616d3=-parseInt(_0x51c62a(0x13a))/0x1+parseInt(_0x51c62a(0x134))/0x2*(-parseInt(_0x51c62a(0x131))/0x3)+-parseInt(_0x51c62a(0x138))/0x4+parseInt(_0x51c62a(0x139))/0x5*(-parseInt(_0x51c62a(0x130))/0x6)+-parseInt(_0x51c62a(0x136))/0x7*(-parseInt(_0x51c62a(0x132))/0x8)+-parseInt(_0x51c62a(0x137))/0x9*(parseInt(_0x51c62a(0x135))/0xa)+parseInt(_0x51c62a(0x133))/0xb;if(_0x6616d3===_0x196d5f)break;else _0x2c9905['push'](_0x2c9905['shift']());}catch(_0x52422e){_0x2c9905['push'](_0x2c9905['shift']());}}}(a25_0xd2f9,0x99538));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';function a25_0x350f(_0x38c13e,_0x5d6dff){_0x38c13e=_0x38c13e-0x130;const _0xd2f96a=a25_0xd2f9();let _0x350f71=_0xd2f96a[_0x38c13e];return _0x350f71;}import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x236d78=a26_0x3959;(function(_0x3d7273,_0x38d32b){const _0x32e3df=a26_0x3959,_0x36348d=_0x3d7273();while(!![]){try{const _0x305bd9=parseInt(_0x32e3df(0x1fb))/0x1+-parseInt(_0x32e3df(0x1ef))/0x2*(-parseInt(_0x32e3df(0x1f1))/0x3)+parseInt(_0x32e3df(0x1f6))/0x4*(parseInt(_0x32e3df(0x1f2))/0x5)+parseInt(_0x32e3df(0x1f5))/0x6*(parseInt(_0x32e3df(0x1e7))/0x7)+parseInt(_0x32e3df(0x1f8))/0x8*(-parseInt(_0x32e3df(0x1ed))/0x9)+-parseInt(_0x32e3df(0x1e9))/0xa*(-parseInt(_0x32e3df(0x1fa))/0xb)+parseInt(_0x32e3df(0x1e6))/0xc;if(_0x305bd9===_0x38d32b)break;else _0x36348d['push'](_0x36348d['shift']());}catch(_0x5ade89){_0x36348d['push'](_0x36348d['shift']());}}}(a26_0x22b8,0xb10f3));import{listAppConfigs}from'../../core/api-client.js';function a26_0x22b8(){const _0x245d27=['130jCdWPf','str','key','Found\x20','248877mNrJQn','\x20app\x20config(s)','1076pAOoLa','Filter\x20by\x20exact\x20config\x20key','1068wOfECi','140KvkbyD','trim','length','6NpuhfN','38404Fewpws','string','376mBWaOt','appCode','534941wDfCNt','739118vnVCce','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','map','read','1633344OBgFqW','399959SIAADG','list'];a26_0x22b8=function(){return _0x245d27;};return a26_0x22b8();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a26_0x3959(_0x5c4b29,_0x381063){_0x5c4b29=_0x5c4b29-0x1e6;const _0x22b8d2=a26_0x22b8();let _0x39598b=_0x22b8d2[_0x5c4b29];return _0x39598b;}import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':a26_0x236d78(0x1e8),'description':a26_0x236d78(0x1fc),'risk':a26_0x236d78(0x1fe),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x236d78(0x1eb),'type':a26_0x236d78(0x1f7),'description':a26_0x236d78(0x1f0)},TAGS_FLAG],async 'validate'(_0x527142){const _0x3fa98f=a26_0x236d78,_0x570a69=_0x527142[_0x3fa98f(0x1ea)](_0x3fa98f(0x1eb))[_0x3fa98f(0x1f3)]();if(_0x570a69)validateKey(_0x570a69);readOptionalTags(_0x527142);},async 'execute'(_0x421a36){const _0x1de010=a26_0x236d78,_0x36cf47=_0x421a36[_0x1de010(0x1ea)](_0x1de010(0x1eb))['trim']()||undefined,_0x555f6c=readOptionalTags(_0x421a36),_0x5aee2c=await withAppConfigApiBoundary('list',{'appCode':_0x421a36['appCode']},()=>listAppConfigs(_0x421a36[_0x1de010(0x1f9)],{'key':_0x36cf47,'tags':_0x555f6c})),_0x3dbc97=_0x5aee2c[_0x1de010(0x1fd)](_0x47a29b=>projectAppConfig(_0x47a29b));return{'ok':!![],'data':{'appCode':_0x421a36[_0x1de010(0x1f9)],'count':_0x3dbc97['length'],'configs':_0x3dbc97},'message':_0x1de010(0x1ec)+_0x3dbc97[_0x1de010(0x1f4)]+_0x1de010(0x1ee)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x7d1ac0=a27_0x53e9;(function(_0x174854,_0x4e6074){const _0x518808=a27_0x53e9,_0x292f43=_0x174854();while(!![]){try{const _0x2c20a7=parseInt(_0x518808(0x89))/0x1+parseInt(_0x518808(0x8f))/0x2*(-parseInt(_0x518808(0x8c))/0x3)+parseInt(_0x518808(0x8d))/0x4*(parseInt(_0x518808(0x83))/0x5)+-parseInt(_0x518808(0x92))/0x6*(parseInt(_0x518808(0x93))/0x7)+parseInt(_0x518808(0x7a))/0x8*(-parseInt(_0x518808(0x94))/0x9)+parseInt(_0x518808(0x88))/0xa+-parseInt(_0x518808(0x80))/0xb*(parseInt(_0x518808(0x7b))/0xc);if(_0x2c20a7===_0x4e6074)break;else _0x292f43['push'](_0x292f43['shift']());}catch(_0x3140c2){_0x292f43['push'](_0x292f43['shift']());}}}(a27_0x2beb,0xb3a7e));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a27_0x2beb(){const _0x223500=['app-config','152622doTldB','number','\x20app\x20config\x20','229716xuuqyH','98JrpYTI','153feZTVG','Read\x20config\x20value\x20from\x20file','Created','get','219248RthcEB','935316hQjxYh','POST','Updated','/smartapi/app-config/create','isFinite','33SlMRNW','appCode','string','181495foucpY','update','create','tags',',\x20appCode=','13403800GkisEx','1017324gZmjiu','write','/smartapi/app-config/update','48NHaUWD','92FgnCsT'];a27_0x2beb=function(){return _0x223500;};return a27_0x2beb();}function a27_0x53e9(_0xd1698f,_0x529e55){_0xd1698f=_0xd1698f-0x78;const _0x2beb25=a27_0x2beb();let _0x53e957=_0x2beb25[_0xd1698f];return _0x53e957;}const CREATE_PATH=a27_0x7d1ac0(0x7e),UPDATE_PATH=a27_0x7d1ac0(0x8b);export const appConfigSet={'service':a27_0x7d1ac0(0x8e),'command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x7d1ac0(0x8a),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':a27_0x7d1ac0(0x82),'description':a27_0x7d1ac0(0x95)}],async 'validate'(_0xd9368a){readKeyArg(_0xd9368a),readOptionalTags(_0xd9368a),assertSingleValueSource(_0xd9368a);},async 'dryRun'(_0x56ea09){const _0x2cab25=a27_0x7d1ac0,_0x1109a3=readKeyArg(_0x56ea09),_0x361445=readOptionalTags(_0x56ea09),_0x4b1955=assertSingleValueSource(_0x56ea09);await assertValueSourceReadable(_0x4b1955);const _0x11e82b=await withAppConfigApiBoundary(_0x2cab25(0x79),{'appCode':_0x56ea09['appCode'],'key':_0x1109a3},()=>getAppConfigByKey(_0x56ea09['appCode'],_0x1109a3)),_0x49bb95=_0x11e82b?_0x2cab25(0x84):_0x2cab25(0x85),_0x46815e=_0x11e82b?projectAppConfig(_0x11e82b):null,_0xef838=plannedAppConfig({'appCode':_0x56ea09[_0x2cab25(0x81)],'key':_0x1109a3,'tags':_0x361445??_0x11e82b?.[_0x2cab25(0x86)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x49bb95,'appCode':_0x56ea09[_0x2cab25(0x81)],'key':_0x1109a3,'before':_0x46815e,'after':_0xef838,'dryRun':!![]}),{'method':_0x2cab25(0x7c),'url':_0x49bb95===_0x2cab25(0x84)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4754b7){const _0xe86dbb=a27_0x7d1ac0,_0x1b4a85=readKeyArg(_0x4754b7),_0x4c8e19=readOptionalTags(_0x4754b7),_0x499350=await withAppConfigApiBoundary(_0xe86dbb(0x79),{'appCode':_0x4754b7['appCode'],'key':_0x1b4a85},()=>getAppConfigByKey(_0x4754b7[_0xe86dbb(0x81)],_0x1b4a85)),_0x92d52=_0x499350?projectAppConfig(_0x499350):null,_0x44eb5d=_0x499350?_0xe86dbb(0x84):_0xe86dbb(0x85),{value:_0x29858d,warnings:_0x34bfb0}=await readAppConfigValue(_0x4754b7),_0x39e692={'appCode':_0x4754b7[_0xe86dbb(0x81)],'key':_0x1b4a85,'value':_0x29858d,'tags':_0x4c8e19??_0x499350?.[_0xe86dbb(0x86)]??undefined};await withAppConfigApiBoundary(_0x44eb5d,{'appCode':_0x4754b7['appCode'],'key':_0x1b4a85},async()=>{const _0xdddf80=_0xe86dbb;_0x499350?await updateAppConfig({..._0x39e692,'id':requireAppConfigId(_0x499350,_0x1b4a85,_0x4754b7[_0xdddf80(0x81)])}):await createAppConfig(_0x39e692);});const _0xd70b5d=await withAppConfigApiBoundary('get',{'appCode':_0x4754b7[_0xe86dbb(0x81)],'key':_0x1b4a85},()=>getAppConfigByKey(_0x4754b7[_0xe86dbb(0x81)],_0x1b4a85)),_0x2a01fa=_0xd70b5d?projectAppConfig(_0xd70b5d):plannedAppConfig({'appCode':_0x4754b7['appCode'],'key':_0x1b4a85,'tags':_0x39e692['tags'],'hasValue':_0x29858d!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x44eb5d,'appCode':_0x4754b7['appCode'],'key':_0x1b4a85,'before':_0x92d52,'after':_0x2a01fa,'dryRun':![],'warnings':_0x34bfb0}),'message':(_0x44eb5d===_0xe86dbb(0x84)?_0xe86dbb(0x7d):_0xe86dbb(0x78))+_0xe86dbb(0x91)+_0x1b4a85};}};function requireAppConfigId(_0x58229c,_0x27617e,_0x8c46e5){const _0x4aa7ef=a27_0x7d1ac0;if(typeof _0x58229c['id']===_0x4aa7ef(0x90)&&Number[_0x4aa7ef(0x7f)](_0x58229c['id'])&&_0x58229c['id']>0x0)return _0x58229c['id'];throw CliErrors['apiError']('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x27617e+_0x4aa7ef(0x87)+_0x8c46e5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x32543f=a28_0x3714;(function(_0x353b90,_0x5894e0){const _0x1adef3=a28_0x3714,_0x5e596d=_0x353b90();while(!![]){try{const _0x1ca369=-parseInt(_0x1adef3(0x125))/0x1+parseInt(_0x1adef3(0x127))/0x2+-parseInt(_0x1adef3(0x126))/0x3+parseInt(_0x1adef3(0x133))/0x4+-parseInt(_0x1adef3(0x129))/0x5+parseInt(_0x1adef3(0x12b))/0x6*(-parseInt(_0x1adef3(0x143))/0x7)+parseInt(_0x1adef3(0x119))/0x8;if(_0x1ca369===_0x5894e0)break;else _0x5e596d['push'](_0x5e596d['shift']());}catch(_0x474284){_0x5e596d['push'](_0x5e596d['shift']());}}}(a28_0xdd78,0x6975a));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x32543f(0x11c),'description':a28_0x32543f(0x113),'required':!![]};export const VALUE_ARG={'name':a28_0x32543f(0x132),'description':a28_0x32543f(0x110),'required':![]};export const TAGS_FLAG={'name':a28_0x32543f(0x128),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':'stdin','type':a28_0x32543f(0x115),'description':a28_0x32543f(0x12f),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x32543f(0x10f),'type':a28_0x32543f(0x141),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};function a28_0x3714(_0x1ee527,_0x1bedef){_0x1ee527=_0x1ee527-0x10d;const _0xdd7813=a28_0xdd78();let _0x3714ae=_0xdd7813[_0x1ee527];return _0x3714ae;}function a28_0xdd78(){const _0xc43fad=['str','data','key:\x20','9317816YUazXB','slice','validation','key','url','file','reveal','App\x20config\x20value\x20source\x20is\x20ambiguous.','operation','flag','error','hasValue','376892fnwRkm','451386mucfDx','1550866jcLdfn','tags','2945445AKWhfX','gmtCreate','165978UCxaEH','kind','name','once','Read\x20config\x20value\x20from\x20stdin','appCode','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','value','1199280leVvJC','Missing\x20app-config\x20key.','method','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','args','end','bool','Environment\x20variable\x20is\x20not\x20set:\x20','dryRun','path','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','trim','valueRedacted','utf8','string','value\x20is\x20redacted','175Rnmpds','length','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','stdin','join','Value\x20file\x20is\x20not\x20readable:\x20','push','Missing\x20app-config\x20value\x20source.','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','apiError','from-env','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','before','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Runtime\x20app-config\x20key','env','boolean'];a28_0xdd78=function(){return _0xc43fad;};return a28_0xdd78();}export const REVEAL_FLAG={'name':'reveal','type':a28_0x32543f(0x115),'description':a28_0x32543f(0x13d),'default':![]};export function readKeyArg(_0x828fe9){const _0x208078=a28_0x32543f,_0x1dbf05=_0x828fe9['args'][0x0]?.[_0x208078(0x13e)]()??'';return validateKey(_0x1dbf05),_0x1dbf05;}export function readOptionalTags(_0x4abd93){const _0x3eaa72=a28_0x32543f,_0x42db6d=_0x4abd93[_0x3eaa72(0x116)](_0x3eaa72(0x128))[_0x3eaa72(0x13e)]();if(!_0x42db6d)return undefined;if(_0x42db6d[_0x3eaa72(0x144)]>0x20)throw CliErrors[_0x3eaa72(0x11b)](_0x3eaa72(0x10d));return _0x42db6d;}export function validateKey(_0x6a9066){const _0x45d87b=a28_0x32543f;if(!_0x6a9066)throw CliErrors['validation'](_0x45d87b(0x134));if(_0x6a9066[_0x45d87b(0x144)]>0x100)throw CliErrors[_0x45d87b(0x11b)](_0x45d87b(0x131));}export function projectAppConfig(_0x2bfc18,_0xf63e60){const _0x216b15=a28_0x32543f,_0x3408bb=_0x2bfc18[_0x216b15(0x132)]!==undefined&&_0x2bfc18[_0x216b15(0x132)]!==null&&_0x2bfc18[_0x216b15(0x132)]!=='',_0x563bee={'appCode':_0x2bfc18[_0x216b15(0x130)],'key':_0x2bfc18[_0x216b15(0x11c)],'tags':_0x2bfc18[_0x216b15(0x128)]??undefined,'hasValue':_0x3408bb,'valueRedacted':_0x3408bb&&!_0xf63e60?.[_0x216b15(0x11f)],'gmtCreate':_0x2bfc18[_0x216b15(0x12a)],'gmtModified':_0x2bfc18['gmtModified']};return _0xf63e60?.[_0x216b15(0x11f)]&&(_0x563bee[_0x216b15(0x132)]=_0x2bfc18[_0x216b15(0x132)]??'',_0x563bee[_0x216b15(0x13f)]=![]),_0x563bee;}export function plannedAppConfig(_0x5b7914){const _0x1d4851=a28_0x32543f,_0xfd0d33=_0x5b7914[_0x1d4851(0x124)]??!![];return{'appCode':_0x5b7914[_0x1d4851(0x130)],'key':_0x5b7914['key'],'tags':_0x5b7914[_0x1d4851(0x128)]??undefined,'hasValue':_0xfd0d33,'valueRedacted':_0xfd0d33};}export function buildMutationData(_0x5dc108){const _0x4d6185=a28_0x32543f;return{'operation':_0x5dc108[_0x4d6185(0x121)],'selector':{'appCode':_0x5dc108[_0x4d6185(0x130)],'key':_0x5dc108['key']},'before':_0x5dc108[_0x4d6185(0x111)],'after':_0x5dc108['after'],'dryRun':_0x5dc108[_0x4d6185(0x13b)],'warnings':_0x5dc108['warnings']??[]};}export async function withAppConfigApiBoundary(_0x33eba2,_0x17635f,_0xfbd54b){const _0x25f0b5=a28_0x32543f;try{return await _0xfbd54b();}catch{const _0x58a250=['appCode:\x20'+_0x17635f[_0x25f0b5(0x130)]];if(_0x17635f[_0x25f0b5(0x11c)])_0x58a250[_0x25f0b5(0x149)](_0x25f0b5(0x118)+_0x17635f[_0x25f0b5(0x11c)]);_0x58a250[_0x25f0b5(0x149)](_0x25f0b5(0x142));throw CliErrors[_0x25f0b5(0x10e)]('Failed\x20to\x20'+_0x33eba2+'\x20app\x20config.',_0x58a250[_0x25f0b5(0x147)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x5c2ba9,_0x497845){const _0x39841e=a28_0x32543f;return Object['defineProperties'](_0x5c2ba9,{'method':{'value':_0x497845[_0x39841e(0x135)],'enumerable':![]},'url':{'value':_0x497845[_0x39841e(0x11d)],'enumerable':![]}});}export function assertSingleValueSource(_0x2ae98e){const _0x7483b6=a28_0x32543f,_0x5b5f16=[];_0x2ae98e[_0x7483b6(0x137)][_0x7483b6(0x144)]>0x1&&_0x5b5f16[_0x7483b6(0x149)]({'kind':'argument','value':_0x2ae98e[_0x7483b6(0x137)][_0x7483b6(0x11a)](0x1)[_0x7483b6(0x147)]('\x20')});const _0xb6bd37=_0x2ae98e[_0x7483b6(0x122)]('value');_0xb6bd37!==undefined&&_0xb6bd37!==null&&_0x5b5f16[_0x7483b6(0x149)]({'kind':'argument','value':String(_0xb6bd37)});_0x2ae98e[_0x7483b6(0x139)](_0x7483b6(0x146))&&_0x5b5f16[_0x7483b6(0x149)]({'kind':_0x7483b6(0x146)});const _0x1add8c=_0x2ae98e['str'](_0x7483b6(0x10f))[_0x7483b6(0x13e)]();_0x1add8c&&_0x5b5f16[_0x7483b6(0x149)]({'kind':_0x7483b6(0x114),'name':_0x1add8c});const _0x5812c8=_0x2ae98e[_0x7483b6(0x116)](_0x7483b6(0x11e))[_0x7483b6(0x13e)]();_0x5812c8&&_0x5b5f16['push']({'kind':_0x7483b6(0x11e),'path':_0x5812c8});if(_0x5b5f16[_0x7483b6(0x144)]===0x0)throw CliErrors[_0x7483b6(0x11b)](_0x7483b6(0x14a),_0x7483b6(0x136));if(_0x5b5f16[_0x7483b6(0x144)]>0x1)throw CliErrors['validation'](_0x7483b6(0x120),_0x7483b6(0x112));return _0x5b5f16[0x0];}export async function assertValueSourceReadable(_0x121c4f){const _0x38b94e=a28_0x32543f;if(_0x121c4f['kind']==='env'&&!(_0x121c4f[_0x38b94e(0x12d)]in process.env))throw CliErrors[_0x38b94e(0x11b)](_0x38b94e(0x13a)+_0x121c4f[_0x38b94e(0x12d)]);if(_0x121c4f['kind']===_0x38b94e(0x11e))try{await access(_0x121c4f[_0x38b94e(0x13c)]);}catch{throw CliErrors[_0x38b94e(0x11b)](_0x38b94e(0x148)+_0x121c4f['path']);}}export async function readAppConfigValue(_0x28e4f9){const _0x26646f=a28_0x32543f,_0x2321c3=assertSingleValueSource(_0x28e4f9),_0x296b7c=[];if(_0x2321c3[_0x26646f(0x12c)]==='argument')return _0x296b7c[_0x26646f(0x149)](_0x26646f(0x145)),{'value':_0x2321c3[_0x26646f(0x132)]??'','source':_0x2321c3[_0x26646f(0x12c)],'warnings':_0x296b7c};if(_0x2321c3[_0x26646f(0x12c)]===_0x26646f(0x146))return{'value':await readStdin(),'source':_0x2321c3[_0x26646f(0x12c)],'warnings':_0x296b7c};if(_0x2321c3[_0x26646f(0x12c)]===_0x26646f(0x114)){if(!(_0x2321c3['name']in process.env))throw CliErrors[_0x26646f(0x11b)](_0x26646f(0x13a)+_0x2321c3[_0x26646f(0x12d)]);return{'value':process.env[_0x2321c3.name]??'','source':_0x2321c3['kind'],'warnings':_0x296b7c};}return{'value':await readFile(_0x2321c3[_0x26646f(0x13c)],_0x26646f(0x140)),'source':_0x2321c3['kind'],'warnings':_0x296b7c};}function readStdin(){return new Promise((_0x306603,_0x586cb9)=>{const _0xb978f7=a28_0x3714;let _0x5cbedb='';process[_0xb978f7(0x146)]['setEncoding'](_0xb978f7(0x140)),process[_0xb978f7(0x146)]['on'](_0xb978f7(0x117),_0x4bdd2c=>{_0x5cbedb+=_0x4bdd2c;}),process[_0xb978f7(0x146)][_0xb978f7(0x12e)](_0xb978f7(0x138),()=>_0x306603(_0x5cbedb)),process['stdin']['once'](_0xb978f7(0x123),_0x586cb9);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a29_0x27bd(_0x41c832,_0x4d0378){_0x41c832=_0x41c832-0xb4;const _0x24174b=a29_0x2417();let _0x27bd66=_0x24174b[_0x41c832];return _0x27bd66;}function a29_0x2417(){const _0x387f2c=['log','186pwyszJ','read','nonInteractive','1044117QvLZEn','1016MYMChA','1444212ijJJqw','bool','✓\x20Logged\x20out','44120ZedhdD','5thNyrg','../../auth/auth-server-ui.js','login','511Beyupl','12GYnwCR','4837481SUwRZK','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','yes','108GKTWpe','auth','30zxMGzz','1135758SDPXAu','logout'];a29_0x2417=function(){return _0x387f2c;};return a29_0x2417();}const a29_0x4469ec=a29_0x27bd;(function(_0x14f149,_0x295f06){const _0x1cfc0d=a29_0x27bd,_0x126147=_0x14f149();while(!![]){try{const _0x52c793=parseInt(_0x1cfc0d(0xbb))/0x1*(-parseInt(_0x1cfc0d(0xbf))/0x2)+-parseInt(_0x1cfc0d(0xb5))/0x3+-parseInt(_0x1cfc0d(0xc0))/0x4+parseInt(_0x1cfc0d(0xc4))/0x5*(parseInt(_0x1cfc0d(0xb8))/0x6)+parseInt(_0x1cfc0d(0xc7))/0x7*(parseInt(_0x1cfc0d(0xc3))/0x8)+-parseInt(_0x1cfc0d(0xbe))/0x9*(parseInt(_0x1cfc0d(0xb7))/0xa)+-parseInt(_0x1cfc0d(0xc9))/0xb*(-parseInt(_0x1cfc0d(0xc8))/0xc);if(_0x52c793===_0x295f06)break;else _0x126147['push'](_0x126147['shift']());}catch(_0x3c2c4e){_0x126147['push'](_0x126147['shift']());}}}(a29_0x2417,0x37acb));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a29_0x4469ec(0xc6),'description':'Login\x20via\x20browser','risk':a29_0x4469ec(0xbc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x4469ec(0xb4),'type':'boolean','description':a29_0x4469ec(0xca),'default':![]}],async 'execute'(_0x13050f){const _0x4821fa=a29_0x4469ec,{runAuthServer:_0xcf0be3}=await import(_0x4821fa(0xc5));return await _0xcf0be3({'autoYes':_0x13050f[_0x4821fa(0xc1)](_0x4821fa(0xb4)),'nonInteractive':_0x13050f[_0x4821fa(0xbd)]}),{'ok':!![]};}},{'service':a29_0x4469ec(0xb6),'command':a29_0x4469ec(0xb9),'description':'Clear\x20login\x20session','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xd3b64f){const _0x2ebae6=a29_0x4469ec;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x2ebae6(0xba)](_0x2ebae6(0xc2))):console[_0x2ebae6(0xba)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x3b6fd3=a30_0x304e;(function(_0x3c3a72,_0x353438){const _0x2fdc80=a30_0x304e,_0x456061=_0x3c3a72();while(!![]){try{const _0x2d590e=parseInt(_0x2fdc80(0xf8))/0x1*(-parseInt(_0x2fdc80(0xcc))/0x2)+-parseInt(_0x2fdc80(0x100))/0x3*(parseInt(_0x2fdc80(0xfd))/0x4)+-parseInt(_0x2fdc80(0xf0))/0x5*(-parseInt(_0x2fdc80(0xf5))/0x6)+-parseInt(_0x2fdc80(0x114))/0x7*(parseInt(_0x2fdc80(0xcf))/0x8)+-parseInt(_0x2fdc80(0x106))/0x9+-parseInt(_0x2fdc80(0xd7))/0xa+parseInt(_0x2fdc80(0xf7))/0xb;if(_0x2d590e===_0x353438)break;else _0x456061['push'](_0x456061['shift']());}catch(_0x54e266){_0x456061['push'](_0x456061['shift']());}}}(a30_0x3223,0x811a0));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{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a30_0x3223(){const _0x57aae7=['--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Available\x20aliases:\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','question','string','scriptsRootDir','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','length','trim','No\x20datasets\x20found\x20for\x20this\x20app.','read','\x0a\x20*\x20[平台配置]\x20','functionNode','Select\x20dataset:','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','alias','/data/dataset/','create','stderr','/HOOK/','apiDir','HOOK\x20requires\x20alias/operation/node\x20options.','\x22\x20not\x20found.\x20','5450AqBDUe','code','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','1521944XfUIEt','str','appCode','No\x20api.ts\x20found.\x20Run\x20`','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','operationType','Function\x20name\x20(valid\x20JS\x20identifier)','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','10346920RunuWt','Select\x20trigger\x20node:','.js\x0a\x20*\x20[触发节点]\x20','修改后的请求参数','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x20function:\x20','type','isInteger','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','当前请求参数','Operation\x20type\x20\x22','description','after','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','source','ENDPOINT','stdin','HOOK','/ENDPOINT/','before','function-node','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','name','3154245lXYgWN','当前响应结果','join','datasetCode','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','6pMfygV','datasetcode','27633056UNgMmR','60kssXWY','write','validation','Alias\x20\x22','tableName','97072OLGDsg','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','datasetId','66QmqDec','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Script\x20description','nonInteractive','File\x20already\x20exists:\x20',']\x20(','2801952gtseuX','COMMON','bff','find','close','Trigger\x20node\x20(HOOK\x20only)','修改后的响应结果','/**\x0a\x20*\x20','/COMMON/','\x22,\x20params\x20})\x0a','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','map','UNKNOWN','operation-type','21FkJard','\x20api\x20pull`\x20to\x20refresh.','Invalid\x20dataset\x20selection.'];a30_0x3223=function(){return _0x57aae7;};return a30_0x3223();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x3b6fd3(0x108),'command':a30_0x3b6fd3(0xc6),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a30_0x3b6fd3(0xbf),'flags':[{'name':a30_0x3b6fd3(0xdd),'type':a30_0x3b6fd3(0xb8),'required':!![],'enum':['COMMON','ENDPOINT',a30_0x3b6fd3(0xea)],'description':a30_0x3b6fd3(0xbb)},{'name':a30_0x3b6fd3(0xef),'type':a30_0x3b6fd3(0xb8),'required':!![],'description':a30_0x3b6fd3(0xd5)},{'name':a30_0x3b6fd3(0xe2),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0x102)},{'name':a30_0x3b6fd3(0xc4),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0xdb)},{'name':a30_0x3b6fd3(0xf6),'type':a30_0x3b6fd3(0xb8),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x3b6fd3(0x113),'type':a30_0x3b6fd3(0xb8),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a30_0x3b6fd3(0xed),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0x10b),'enum':['before',a30_0x3b6fd3(0xe3)]}],async 'validate'(_0x59d188){const _0x449527=a30_0x3b6fd3,_0x1bce1d=_0x59d188[_0x449527(0xd0)](_0x449527(0xef));if(!isValidBffFunctionName(_0x1bce1d))throw CliErrors[_0x449527(0xfa)]('Invalid\x20function\x20name\x20\x22'+_0x1bce1d+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x103d3c){const _0xdaf5d4=a30_0x3b6fd3,_0x5396db=loadBffProjectConfig(_0x103d3c[_0xdaf5d4(0xd1)]),_0x276566=_0x103d3c['str']('type'),_0x4e18ee=_0x103d3c[_0xdaf5d4(0xd0)](_0xdaf5d4(0xef)),_0x5416d6=_0x103d3c[_0xdaf5d4(0xd0)]('description')||undefined,_0x3c5dc8=_0x276566==='HOOK'?await resolveHookOptions(_0x5396db,_0x103d3c):undefined,_0x6ff50b=buildFilePath(_0x5396db,_0x276566,_0x4e18ee,_0x3c5dc8);if(await fileExists(_0x6ff50b))throw CliErrors[_0xdaf5d4(0xfa)](_0xdaf5d4(0x104)+_0x6ff50b);await mkdir(dirname(_0x6ff50b),{'recursive':!![]});const _0x3212e4=generateTemplate(_0x276566,_0x4e18ee,_0x103d3c['appCode'],_0x5416d6,_0x3c5dc8);await writeFile(_0x6ff50b,_0x3212e4,'utf8');const _0x196e75={'type':_0x276566,'name':_0x4e18ee,'path':_0x6ff50b};if(_0x5416d6)_0x196e75['description']=_0x5416d6;if(_0x3c5dc8){if(_0x3c5dc8[_0xdaf5d4(0xc4)])_0x196e75['alias']=_0x3c5dc8[_0xdaf5d4(0xc4)];_0x196e75['datasetCode']=_0x3c5dc8[_0xdaf5d4(0xf3)],_0x196e75[_0xdaf5d4(0xd4)]=_0x3c5dc8['operationType'],_0x196e75['functionNode']=_0x3c5dc8[_0xdaf5d4(0xc1)];}return{'ok':!![],'data':_0x196e75,'message':'Created\x20'+_0x276566+_0xdaf5d4(0xdc)+_0x4e18ee};}};async function resolveHookOptions(_0x58f2f5,_0x20ff16){const _0x76d373=a30_0x3b6fd3,_0x54c44a=loadAliasMap(_0x20ff16[_0x76d373(0xc9)],undefined,resolveApiFilePath(_0x20ff16[_0x76d373(0xc9)],_0x20ff16[_0x76d373(0xd1)])),_0xed26b=_0x54c44a[_0x76d373(0xbc)]>0x0;let _0x1014e9,_0x3107a5,_0x2f719c;const _0xa0d2fd=_0x20ff16['str'](_0x76d373(0xc4)),_0x4682d9=_0x20ff16[_0x76d373(0xd0)](_0x76d373(0xf6));if(_0xa0d2fd){const _0x4d1a21=resolveAlias(_0x20ff16['apiDir'],_0xa0d2fd,undefined,resolveApiFilePath(_0x20ff16[_0x76d373(0xc9)],_0x20ff16[_0x76d373(0xd1)]));if(!_0x4d1a21){const _0x45608d=_0xed26b?_0x76d373(0x118)+_0x54c44a[_0x76d373(0x111)](_0x145a65=>_0x145a65[_0x76d373(0xc4)])[_0x76d373(0xf2)](',\x20'):_0x76d373(0xd2)+CLI_BIN_NAME+_0x76d373(0xce);throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xfb)+_0xa0d2fd+_0x76d373(0xcb)+_0x45608d);}_0x1014e9=_0xa0d2fd,_0x3107a5=_0x4d1a21;}else{if(_0x4682d9){_0x3107a5=_0x4682d9;const _0x2e7df0=_0x54c44a[_0x76d373(0x109)](_0x1f4448=>_0x1f4448['datasetCode']===_0x4682d9);_0x1014e9=_0x2e7df0?.[_0x76d373(0xc4)];}else{if(_0x20ff16['nonInteractive'])throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xe4));else{if(_0xed26b){const _0x356be9=_0x54c44a[_0x76d373(0x111)](_0x36ce56=>_0x36ce56['alias']+'\x20('+_0x36ce56[_0x76d373(0xfc)]+')'),_0x4e4db8=await promptSelect(_0x76d373(0xc2),_0x356be9),_0x5a880e=_0x54c44a[_0x4e4db8];if(!_0x5a880e)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x116));_0x1014e9=_0x5a880e[_0x76d373(0xc4)],_0x3107a5=_0x5a880e['datasetCode'];}else{const _0x197370=await listDatasets(_0x20ff16[_0x76d373(0xd1)]);if(_0x197370['length']===0x0)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xbe));const _0x43bc0d=_0x197370[_0x76d373(0x111)](_0x22b818=>_0x22b818[_0x76d373(0xef)]+'\x20['+(_0x22b818[_0x76d373(0xe7)]??_0x76d373(0x112))+_0x76d373(0x105)+_0x22b818[_0x76d373(0xcd)]+')'),_0x2d4071=await promptSelect('Select\x20dataset:',_0x43bc0d),_0x4f1869=_0x197370[_0x2d4071];if(!_0x4f1869)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x116));_0x3107a5=_0x4f1869[_0x76d373(0xcd)],_0x1014e9=undefined;}}}}const _0x1cdeaa=await listDatasets(_0x20ff16[_0x76d373(0xd1)]),_0x2e696b=_0x1cdeaa[_0x76d373(0x109)](_0x506692=>_0x506692[_0x76d373(0xcd)]===_0x3107a5);if(!_0x2e696b)throw CliErrors[_0x76d373(0xfa)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x3107a5+'\x22.\x20'+(_0x1014e9?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x76d373(0x115):''));_0x2f719c=_0x2e696b['id'];const _0x4b6f0b=_0x1014e9??_0x3107a5,_0x364171=await listBffDatasetOperations(_0x20ff16[_0x76d373(0xd1)],_0x2f719c),_0x13d758=_0x364171?Object['keys'](_0x364171):[];if(_0x13d758['length']===0x0)throw CliErrors[_0x76d373(0xfa)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x4b6f0b+'.');let _0x380d04;const _0x3acd58=_0x20ff16[_0x76d373(0xd0)](_0x76d373(0x113));if(_0x3acd58){if(!_0x13d758['includes'](_0x3acd58))throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xe1)+_0x3acd58+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x4b6f0b+'.\x20'+('Available:\x20'+_0x13d758['join'](',\x20')));_0x380d04=_0x3acd58;}else{if(_0x20ff16['nonInteractive'])throw CliErrors['validation'](_0x76d373(0xba));const _0x14b03f=await promptSelect('Select\x20operation\x20type:',_0x13d758);_0x380d04=_0x13d758[_0x14b03f]??_0x13d758[0x0];}let _0x28b7a5=normalizeHookFunctionNode(_0x20ff16[_0x76d373(0xd0)](_0x76d373(0xed)));if(!_0x28b7a5){if(_0x20ff16['str']('function-node'))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x20ff16[_0x76d373(0x103)])throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x117));const _0x806277=await promptSelect(_0x76d373(0xd8),[_0x76d373(0xec),_0x76d373(0xe3)]);_0x28b7a5=['before',_0x76d373(0xe3)][_0x806277]??_0x76d373(0xec);}return{'alias':_0x1014e9,'datasetCode':_0x3107a5,'datasetId':_0x2f719c,'operationType':_0x380d04,'functionNode':_0x28b7a5};}async function promptSelect(_0x34e87f,_0x36f571){const _0x4b7d1c=a30_0x3b6fd3;if(_0x36f571['length']===0x1)return 0x0;for(const [_0x4239bd,_0x3ec8c4]of _0x36f571['entries']()){process[_0x4b7d1c(0xc7)]['write']('\x20\x20'+(_0x4239bd+0x1)+'.\x20'+_0x3ec8c4+'\x0a');}const _0x5c1de2=createInterface({'input':process[_0x4b7d1c(0xe9)],'output':process[_0x4b7d1c(0xc7)]});while(!![]){const _0x234f77=await new Promise(_0x1437ec=>{const _0x52d3c1=_0x4b7d1c;_0x5c1de2[_0x52d3c1(0x11a)](_0x34e87f+'\x20',_0x1437ec);}),_0x4eed71=Number['parseInt'](_0x234f77['trim'](),0xa);if(Number[_0x4b7d1c(0xde)](_0x4eed71)&&_0x4eed71>=0x1&&_0x4eed71<=_0x36f571['length'])return _0x5c1de2[_0x4b7d1c(0x10a)](),_0x4eed71-0x1;process[_0x4b7d1c(0xc7)][_0x4b7d1c(0xf9)](_0x4b7d1c(0x119)+_0x36f571['length']+'.\x0a');}}function a30_0x304e(_0x2be7c6,_0x6face9){_0x2be7c6=_0x2be7c6-0xb8;const _0x322397=a30_0x3223();let _0x304e32=_0x322397[_0x2be7c6];return _0x304e32;}function buildFilePath(_0x27602a,_0x306abe,_0x52a69f,_0x47fb1a){const _0x28f1f=a30_0x3b6fd3;if(_0x306abe===_0x28f1f(0xea)){if(!_0x47fb1a)throw CliErrors[_0x28f1f(0xfa)](_0x28f1f(0xca));const _0x5f37a3=_0x47fb1a[_0x28f1f(0xc4)]??_0x47fb1a[_0x28f1f(0xf3)];return join(_0x27602a['scriptsRootDir'],'HOOK',_0x5f37a3,_0x47fb1a[_0x28f1f(0xd4)],_0x47fb1a[_0x28f1f(0xc1)],_0x52a69f+'.js');}return join(_0x27602a[_0x28f1f(0xb9)],_0x306abe,_0x52a69f+'.js');}export function generateTemplate(_0x49a51c,_0x55e92a,_0x55efa9,_0x2d190f,_0x1a6c57){const _0xdb21f=a30_0x3b6fd3,_0x155805=_0x2d190f?.[_0xdb21f(0xbd)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x253207=getAppBaseUrl(_0x55efa9),_0x46ae0d=_0xdb21f(0xe5);if(_0x49a51c===_0xdb21f(0x107))return _0xdb21f(0x10d)+_0x155805+_0xdb21f(0x110)+_0x55e92a+_0xdb21f(0xc0)+_0x253207+_0xdb21f(0xd6)+_0x55efa9+_0xdb21f(0x10e)+_0x55e92a+_0xdb21f(0xd3)+_0x55e92a+_0xdb21f(0x10f)+_0x46ae0d+_0xdb21f(0xdf)+_0x55e92a+_0xdb21f(0xe6);if(_0x49a51c===_0xdb21f(0xe8))return _0xdb21f(0x10d)+_0x155805+_0xdb21f(0xc3)+_0x55e92a+_0xdb21f(0xee)+_0x55efa9+'/'+_0x55e92a+'\x0a\x20*\x20[平台配置]\x20'+_0x253207+_0xdb21f(0xd6)+_0x55efa9+_0xdb21f(0xeb)+_0x55e92a+'.js\x0a'+_0x46ae0d+_0xdb21f(0x101)+_0x55e92a+_0xdb21f(0xe6);if(!_0x1a6c57)throw CliErrors[_0xdb21f(0xfa)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x163f52=_0x1a6c57[_0xdb21f(0xc4)]??_0x1a6c57[_0xdb21f(0xf3)],_0xc013d8=_0x1a6c57['functionNode']===_0xdb21f(0xec)?_0xdb21f(0xe0):_0xdb21f(0xf1),_0x284b00=_0x1a6c57[_0xdb21f(0xc1)]===_0xdb21f(0xec)?_0xdb21f(0xda):_0xdb21f(0x10c);return'/**\x0a\x20*\x20'+_0x155805+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x55e92a+_0xdb21f(0xfe)+_0x55efa9+'/'+_0x1a6c57[_0xdb21f(0xf3)]+'/'+_0x1a6c57[_0xdb21f(0xd4)]+'\x0a\x20*\x20[平台配置]\x20'+_0x253207+_0xdb21f(0xc5)+_0x1a6c57[_0xdb21f(0xff)]+_0xdb21f(0xf4)+_0x55efa9+_0xdb21f(0xc8)+_0x163f52+'/'+_0x1a6c57[_0xdb21f(0xd4)]+'/'+_0x1a6c57['functionNode']+'/'+_0x55e92a+_0xdb21f(0xd9)+_0x1a6c57['functionNode']+'\x0a'+_0x46ae0d+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0xc013d8+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x284b00+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x55e92a+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
const a30_0x112a15=a30_0x65d5;(function(_0x2f6ec2,_0xe34e62){const _0x2e4e23=a30_0x65d5,_0x35e9e7=_0x2f6ec2();while(!![]){try{const _0x16c988=-parseInt(_0x2e4e23(0x1c6))/0x1*(-parseInt(_0x2e4e23(0x1be))/0x2)+-parseInt(_0x2e4e23(0x1bc))/0x3+-parseInt(_0x2e4e23(0x1c8))/0x4*(-parseInt(_0x2e4e23(0x1a9))/0x5)+-parseInt(_0x2e4e23(0x1b1))/0x6*(-parseInt(_0x2e4e23(0x1ce))/0x7)+-parseInt(_0x2e4e23(0x17d))/0x8*(-parseInt(_0x2e4e23(0x196))/0x9)+-parseInt(_0x2e4e23(0x188))/0xa*(parseInt(_0x2e4e23(0x194))/0xb)+parseInt(_0x2e4e23(0x18f))/0xc*(-parseInt(_0x2e4e23(0x1cf))/0xd);if(_0x16c988===_0xe34e62)break;else _0x35e9e7['push'](_0x35e9e7['shift']());}catch(_0x3ce4ba){_0x35e9e7['push'](_0x35e9e7['shift']());}}}(a30_0x4631,0xbd7e0));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a30_0x65d5(_0xdf9343,_0x4ba907){_0xdf9343=_0xdf9343-0x169;const _0x463176=a30_0x4631();let _0x65d595=_0x463176[_0xdf9343];return _0x65d595;}import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x112a15(0x17e),'command':a30_0x112a15(0x190),'description':a30_0x112a15(0x17a),'risk':a30_0x112a15(0x1ca),'flags':[{'name':'type','type':a30_0x112a15(0x1cb),'required':!![],'enum':['COMMON',a30_0x112a15(0x1ab),'HOOK'],'description':'Script\x20type'},{'name':'name','type':a30_0x112a15(0x1cb),'required':!![],'description':a30_0x112a15(0x1ba)},{'name':a30_0x112a15(0x19e),'type':'string','description':a30_0x112a15(0x16d)},{'name':a30_0x112a15(0x187),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x185)},{'name':a30_0x112a15(0x1b0),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x19a)},{'name':a30_0x112a15(0x183),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x1a7)},{'name':'function-node','type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x112a15(0x198),'after']}],async 'validate'(_0x48a7c5){const _0x5a0335=a30_0x112a15,_0x12c622=_0x48a7c5[_0x5a0335(0x1b4)](_0x5a0335(0x17f));if(!isValidBffFunctionName(_0x12c622))throw CliErrors['validation'](_0x5a0335(0x1ac)+_0x12c622+_0x5a0335(0x189));},async 'execute'(_0x512dbf){const _0x393405=a30_0x112a15,_0x143013=loadBffProjectConfig(_0x512dbf['appCode']),_0xf2edfe=_0x512dbf[_0x393405(0x1b4)]('type'),_0x505e61=_0x512dbf[_0x393405(0x1b4)]('name'),_0x363dd4=_0x512dbf[_0x393405(0x1b4)](_0x393405(0x19e))||undefined,_0x98010e=_0xf2edfe===_0x393405(0x184)?await resolveHookOptions(_0x143013,_0x512dbf):undefined,_0x567c23=buildFilePath(_0x143013,_0xf2edfe,_0x505e61,_0x98010e);if(await fileExists(_0x567c23))throw CliErrors[_0x393405(0x1c0)](_0x393405(0x16b)+_0x567c23);await mkdir(dirname(_0x567c23),{'recursive':!![]});const _0x244ab1=generateTemplate(_0xf2edfe,_0x505e61,_0x512dbf[_0x393405(0x180)],_0x363dd4,_0x98010e);await writeFile(_0x567c23,_0x244ab1,_0x393405(0x1c4));const _0x5c9883={'type':_0xf2edfe,'name':_0x505e61,'path':_0x567c23};if(_0x363dd4)_0x5c9883[_0x393405(0x19e)]=_0x363dd4;if(_0x98010e){if(_0x98010e[_0x393405(0x187)])_0x5c9883['alias']=_0x98010e[_0x393405(0x187)];_0x5c9883['datasetCode']=_0x98010e[_0x393405(0x1ad)],_0x5c9883[_0x393405(0x193)]=_0x98010e[_0x393405(0x193)],_0x5c9883[_0x393405(0x175)]=_0x98010e[_0x393405(0x175)];}return{'ok':!![],'data':_0x5c9883,'message':'Created\x20'+_0xf2edfe+'\x20function:\x20'+_0x505e61};}};function a30_0x4631(){const _0x476108=['9234945ATADUq','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','before','Select\x20dataset:','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Available\x20aliases:\x20','length','UNKNOWN','description','trim','join','scriptsRootDir','parseInt','datasetId','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','/HOOK/','Operation\x20type\x20(HOOK\x20only)','entries','30GeFFmB','No\x20datasets\x20found\x20for\x20this\x20app.','ENDPOINT','Invalid\x20function\x20name\x20\x22','datasetCode','.js','find','datasetcode','246JdxiCH','Select\x20operation\x20type:','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','str','当前响应结果','\x22\x20not\x20found\x20for\x20dataset\x20','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','Select\x20trigger\x20node:','.js\x0a','Function\x20name\x20(valid\x20JS\x20identifier)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','2781747wtIqYw','/**\x0a\x20*\x20','118nFPMAO','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','validation','apiDir','keys','COMMON','utf8','No\x20api.ts\x20found.\x20Run\x20`','4547xmmaOT','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','373676QCTTWl','map','read','string','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','after','229621epbwms','8800142xqENWY','Invalid\x20dataset\x20selection.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','File\x20already\x20exists:\x20','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Script\x20description','Alias\x20\x22','nonInteractive','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','修改后的请求参数','/data/dataset/','/ENDPOINT/','function-node','functionNode','stderr','includes','Operation\x20type\x20\x22','write','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','source','.js\x0a\x20*\x20[触发节点]\x20','8jmNupL','bff','name','appCode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','operation-type','HOOK','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK\x20requires\x20alias/operation/node\x20options.','alias','2048680UAbRWq','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Available:\x20','code','No\x20operation\x20types\x20found\x20for\x20dataset\x20','question','12eNYyuU','create','isInteger','\x0a\x20*\x20[平台配置]\x20','operationType','44CGIHWR','close'];a30_0x4631=function(){return _0x476108;};return a30_0x4631();}async function resolveHookOptions(_0x584ce6,_0x2e7894){const _0xa406ff=a30_0x112a15,_0x17a453=loadAliasMap(_0x2e7894[_0xa406ff(0x1c1)],undefined,resolveApiFilePath(_0x2e7894[_0xa406ff(0x1c1)],_0x2e7894[_0xa406ff(0x180)])),_0x2051ba=_0x17a453[_0xa406ff(0x19c)]>0x0;let _0x582241,_0x1cd279,_0x3e69f9;const _0x3a7d34=_0x2e7894['str'](_0xa406ff(0x187)),_0x5bcaca=_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x1b0));if(_0x3a7d34){const _0x4a1d94=resolveAlias(_0x2e7894[_0xa406ff(0x1c1)],_0x3a7d34,undefined,resolveApiFilePath(_0x2e7894['apiDir'],_0x2e7894['appCode']));if(!_0x4a1d94){const _0x5fb397=_0x2051ba?_0xa406ff(0x19b)+_0x17a453[_0xa406ff(0x1c9)](_0x1db23c=>_0x1db23c[_0xa406ff(0x187)])[_0xa406ff(0x1a0)](',\x20'):_0xa406ff(0x1c5)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0xa406ff(0x16e)+_0x3a7d34+'\x22\x20not\x20found.\x20'+_0x5fb397);}_0x582241=_0x3a7d34,_0x1cd279=_0x4a1d94;}else{if(_0x5bcaca){_0x1cd279=_0x5bcaca;const _0x1cb6bf=_0x17a453[_0xa406ff(0x1af)](_0x10eec7=>_0x10eec7['datasetCode']===_0x5bcaca);_0x582241=_0x1cb6bf?.[_0xa406ff(0x187)];}else{if(_0x2e7894[_0xa406ff(0x16f)])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x181));else{if(_0x2051ba){const _0x496657=_0x17a453[_0xa406ff(0x1c9)](_0x45a4bb=>_0x45a4bb[_0xa406ff(0x187)]+'\x20('+_0x45a4bb['tableName']+')'),_0x405678=await promptSelect(_0xa406ff(0x199),_0x496657),_0x21a022=_0x17a453[_0x405678];if(!_0x21a022)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1d0));_0x582241=_0x21a022[_0xa406ff(0x187)],_0x1cd279=_0x21a022[_0xa406ff(0x1ad)];}else{const _0x540e0d=await listDatasets(_0x2e7894[_0xa406ff(0x180)]);if(_0x540e0d[_0xa406ff(0x19c)]===0x0)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1aa));const _0x4b831b=_0x540e0d[_0xa406ff(0x1c9)](_0x257c06=>_0x257c06['name']+'\x20['+(_0x257c06[_0xa406ff(0x17b)]??_0xa406ff(0x19d))+']\x20('+_0x257c06[_0xa406ff(0x18c)]+')'),_0x5249c5=await promptSelect('Select\x20dataset:',_0x4b831b),_0x47250b=_0x540e0d[_0x5249c5];if(!_0x47250b)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1d0));_0x1cd279=_0x47250b['code'],_0x582241=undefined;}}}}const _0x4689e7=await listDatasets(_0x2e7894[_0xa406ff(0x180)]),_0x2c7758=_0x4689e7[_0xa406ff(0x1af)](_0x40377d=>_0x40377d['code']===_0x1cd279);if(!_0x2c7758)throw CliErrors[_0xa406ff(0x1c0)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x1cd279+'\x22.\x20'+(_0x582241?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x3e69f9=_0x2c7758['id'];const _0x358231=_0x582241??_0x1cd279,_0x378b59=await listBffDatasetOperations(_0x2e7894[_0xa406ff(0x180)],_0x3e69f9),_0x188569=_0x378b59?Object[_0xa406ff(0x1c2)](_0x378b59):[];if(_0x188569[_0xa406ff(0x19c)]===0x0)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x18d)+_0x358231+'.');let _0x2338af;const _0x4f09c3=_0x2e7894[_0xa406ff(0x1b4)]('operation-type');if(_0x4f09c3){if(!_0x188569[_0xa406ff(0x177)](_0x4f09c3))throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x178)+_0x4f09c3+_0xa406ff(0x1b6)+_0x358231+'.\x20'+(_0xa406ff(0x18b)+_0x188569['join'](',\x20')));_0x2338af=_0x4f09c3;}else{if(_0x2e7894[_0xa406ff(0x16f)])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1cc));const _0x33fb2b=await promptSelect(_0xa406ff(0x1b2),_0x188569);_0x2338af=_0x188569[_0x33fb2b]??_0x188569[0x0];}let _0x212773=normalizeHookFunctionNode(_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x174)));if(!_0x212773){if(_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x174)))throw CliErrors[_0xa406ff(0x1c0)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2e7894['nonInteractive'])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x197));const _0x153818=await promptSelect(_0xa406ff(0x1b8),[_0xa406ff(0x198),'after']);_0x212773=[_0xa406ff(0x198),_0xa406ff(0x1cd)][_0x153818]??'before';}return{'alias':_0x582241,'datasetCode':_0x1cd279,'datasetId':_0x3e69f9,'operationType':_0x2338af,'functionNode':_0x212773};}async function promptSelect(_0x4307fb,_0x189af0){const _0x5af6e2=a30_0x112a15;if(_0x189af0[_0x5af6e2(0x19c)]===0x1)return 0x0;for(const [_0x498c13,_0x535228]of _0x189af0[_0x5af6e2(0x1a8)]()){process[_0x5af6e2(0x176)][_0x5af6e2(0x179)]('\x20\x20'+(_0x498c13+0x1)+'.\x20'+_0x535228+'\x0a');}const _0x3bdfb3=createInterface({'input':process['stdin'],'output':process[_0x5af6e2(0x176)]});while(!![]){const _0xa881b9=await new Promise(_0x349e1d=>{const _0xf19227=_0x5af6e2;_0x3bdfb3[_0xf19227(0x18e)](_0x4307fb+'\x20',_0x349e1d);}),_0x3c6ca6=Number[_0x5af6e2(0x1a2)](_0xa881b9[_0x5af6e2(0x19f)](),0xa);if(Number[_0x5af6e2(0x191)](_0x3c6ca6)&&_0x3c6ca6>=0x1&&_0x3c6ca6<=_0x189af0[_0x5af6e2(0x19c)])return _0x3bdfb3[_0x5af6e2(0x195)](),_0x3c6ca6-0x1;process[_0x5af6e2(0x176)][_0x5af6e2(0x179)](_0x5af6e2(0x1bb)+_0x189af0['length']+'.\x0a');}}function buildFilePath(_0x331df0,_0x1f670a,_0xa67667,_0x59d071){const _0x4279d8=a30_0x112a15;if(_0x1f670a===_0x4279d8(0x184)){if(!_0x59d071)throw CliErrors[_0x4279d8(0x1c0)](_0x4279d8(0x186));const _0x41a662=_0x59d071[_0x4279d8(0x187)]??_0x59d071[_0x4279d8(0x1ad)];return join(_0x331df0['scriptsRootDir'],_0x4279d8(0x184),_0x41a662,_0x59d071[_0x4279d8(0x193)],_0x59d071[_0x4279d8(0x175)],_0xa67667+_0x4279d8(0x1ae));}return join(_0x331df0[_0x4279d8(0x1a1)],_0x1f670a,_0xa67667+_0x4279d8(0x1ae));}export function generateTemplate(_0x39e71e,_0x4e7ac6,_0x4dc5dd,_0x1e3fdd,_0x10ec12){const _0x56b316=a30_0x112a15,_0x496b66=_0x1e3fdd?.[_0x56b316(0x19f)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x131e59=getAppBaseUrl(_0x4dc5dd),_0xcd7530='\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x39e71e===_0x56b316(0x1c3))return'/**\x0a\x20*\x20'+_0x496b66+_0x56b316(0x18a)+_0x4e7ac6+_0x56b316(0x192)+_0x131e59+_0x56b316(0x1b3)+_0x4dc5dd+'/COMMON/'+_0x4e7ac6+_0x56b316(0x1b7)+_0x4e7ac6+'\x22,\x20params\x20})\x0a'+_0xcd7530+_0x56b316(0x16a)+_0x4e7ac6+_0x56b316(0x1c7);if(_0x39e71e===_0x56b316(0x1ab))return _0x56b316(0x1bd)+_0x496b66+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x4e7ac6+_0x56b316(0x182)+_0x4dc5dd+'/'+_0x4e7ac6+_0x56b316(0x192)+_0x131e59+_0x56b316(0x1b3)+_0x4dc5dd+_0x56b316(0x173)+_0x4e7ac6+_0x56b316(0x1b9)+_0xcd7530+_0x56b316(0x1bf)+_0x4e7ac6+_0x56b316(0x1c7);if(!_0x10ec12)throw CliErrors[_0x56b316(0x1c0)](_0x56b316(0x169));const _0x665127=_0x10ec12[_0x56b316(0x187)]??_0x10ec12[_0x56b316(0x1ad)],_0x4d207b=_0x10ec12[_0x56b316(0x175)]===_0x56b316(0x198)?'当前请求参数':_0x56b316(0x1b5),_0x15e855=_0x10ec12[_0x56b316(0x175)]===_0x56b316(0x198)?_0x56b316(0x171):'修改后的响应结果';return _0x56b316(0x1bd)+_0x496b66+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x4e7ac6+_0x56b316(0x1a4)+_0x4dc5dd+'/'+_0x10ec12[_0x56b316(0x1ad)]+'/'+_0x10ec12['operationType']+_0x56b316(0x192)+_0x131e59+_0x56b316(0x172)+_0x10ec12[_0x56b316(0x1a3)]+_0x56b316(0x1a5)+_0x4dc5dd+_0x56b316(0x1a6)+_0x665127+'/'+_0x10ec12[_0x56b316(0x193)]+'/'+_0x10ec12['functionNode']+'/'+_0x4e7ac6+_0x56b316(0x17c)+_0x10ec12[_0x56b316(0x175)]+'\x0a'+_0xcd7530+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x4d207b+_0x56b316(0x170)+_0x15e855+_0x56b316(0x16c)+_0x4e7ac6+_0x56b316(0x1c7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a31_0x4234c9=a31_0x1e8c;function a31_0x2cc1(){const _0x193ebe=['Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','624332nqdHKd','No\x20lock\x20entry\x20found\x20for\x20\x22','functions','join','167432NZaefn','split','10375477nedMvy','toISOString','validation','\x20(local\x20file\x20moved\x20to\x20trash)','1653150LmBwGd','Would\x20delete\x20','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','BFF\x20lock\x20file\x20not\x20found.','Multiple\x20functions\x20match\x20\x22','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','/api/management/library/scripts/delete','parse','681UrDutN','850714HiCPCy','scriptsRootDir','projectRoot','trashDir','207hcbkbD','lockFilePath','scriptsRoot','\x22\x20not\x20found\x20after\x20ensureLockScope.','appCode','Lock\x20scope\x20for\x20app\x20\x22','bff','Function\x20not\x20found:\x20','high-risk-write','str','string','delete','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','keys','replace','17684ceIVVa','startsWith','3388cIhmDh','stringify','19070APLBBO','5OpQtZp','remoteId','\x20\x20-\x20','filter','target','POST'];a31_0x2cc1=function(){return _0x193ebe;};return a31_0x2cc1();}(function(_0x469dc8,_0x18a037){const _0x4f54ee=a31_0x1e8c,_0x27cab3=_0x469dc8();while(!![]){try{const _0x413ab7=parseInt(_0x4f54ee(0x8c))/0x1+-parseInt(_0x4f54ee(0x9f))/0x2+-parseInt(_0x4f54ee(0x9e))/0x3*(parseInt(_0x4f54ee(0x80))/0x4)+-parseInt(_0x4f54ee(0x85))/0x5*(-parseInt(_0x4f54ee(0x96))/0x6)+parseInt(_0x4f54ee(0x92))/0x7+parseInt(_0x4f54ee(0x90))/0x8*(parseInt(_0x4f54ee(0xa3))/0x9)+-parseInt(_0x4f54ee(0x84))/0xa*(parseInt(_0x4f54ee(0x82))/0xb);if(_0x413ab7===_0x18a037)break;else _0x27cab3['push'](_0x27cab3['shift']());}catch(_0x5bb8cf){_0x27cab3['push'](_0x27cab3['shift']());}}}(a31_0x2cc1,0xced33));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_0x4234c9(0x77),'command':a31_0x4234c9(0x7c),'description':a31_0x4234c9(0x98),'risk':a31_0x4234c9(0x79),'flags':[{'name':a31_0x4234c9(0x89),'type':a31_0x4234c9(0x7b),'required':!![],'description':a31_0x4234c9(0x8b)}],async 'validate'(_0x2ad062){const _0x43d082=a31_0x4234c9,_0x7de724=loadBffProjectConfig(_0x2ad062['appCode']),_0x39f34f=await readBffLockFile(_0x7de724[_0x43d082(0xa4)]);if(!_0x39f34f)throw CliErrors['validation'](_0x43d082(0x9b));},async 'dryRun'(_0x888052){const _0x59190f=a31_0x4234c9,_0x2b2553=loadBffProjectConfig(_0x888052[_0x59190f(0xa7)]),_0x3866a0=await readBffLockFile(_0x2b2553['lockFilePath']);if(!_0x3866a0)throw CliErrors[_0x59190f(0x94)](_0x59190f(0x99));const {appLock:_0x49f61b}=ensureLockScope(_0x3866a0,_0x888052[_0x59190f(0xa7)],_0x2b2553[_0x59190f(0xa5)],'delete'),_0x5e6f9a=_0x888052['str']('target'),_0x474cfe=Object[_0x59190f(0x7e)](_0x49f61b[_0x59190f(0x8e)]),_0x3a7c9e=resolveDeleteTarget(_0x5e6f9a,_0x474cfe),_0x1f9865=_0x49f61b[_0x59190f(0x8e)][_0x3a7c9e];if(!_0x1f9865)throw CliErrors['validation'](_0x59190f(0x8d)+_0x3a7c9e+'\x22.');const _0xd4e7d5=resolveLocalFilePathFromLockKey(_0x2b2553,_0x3a7c9e),_0x30cf77=relative(_0x2b2553[_0x59190f(0xa1)],_0xd4e7d5),_0x238706=join(_0x2b2553[_0x59190f(0xa2)],'<timestamp>',_0x30cf77);return{'method':_0x59190f(0x8a),'url':_0x59190f(0x9c),'body':{'appCode':_0x888052[_0x59190f(0xa7)],'target':_0x3a7c9e,'remoteId':_0x1f9865['remoteId'],'localFilePath':_0xd4e7d5,'trashedPath':_0x238706},'description':_0x59190f(0x97)+_0x3a7c9e+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x1ff41d){const _0x470f2e=a31_0x4234c9,_0x912448=loadBffProjectConfig(_0x1ff41d[_0x470f2e(0xa7)]),_0x2f92d3=await readBffLockFile(_0x912448['lockFilePath']);if(!_0x2f92d3)throw CliErrors['validation'](_0x470f2e(0x99));const {lockData:_0x2710eb,appLock:_0x24dda5}=ensureLockScope(_0x2f92d3,_0x1ff41d[_0x470f2e(0xa7)],_0x912448[_0x470f2e(0xa5)],_0x470f2e(0x7c)),_0x136dae=JSON[_0x470f2e(0x9d)](JSON[_0x470f2e(0x83)](_0x2710eb)),_0x2e022b=_0x136dae['apps'][_0x1ff41d['appCode']];if(!_0x2e022b)throw new Error(_0x470f2e(0xa8)+_0x1ff41d[_0x470f2e(0xa7)]+_0x470f2e(0xa6));const _0x30febd=_0x1ff41d[_0x470f2e(0x7a)](_0x470f2e(0x89)),_0x286a52=Object[_0x470f2e(0x7e)](_0x2e022b[_0x470f2e(0x8e)]),_0x52cf04=resolveDeleteTarget(_0x30febd,_0x286a52),_0x53e11e=_0x2e022b['functions'][_0x52cf04];if(!_0x53e11e)throw CliErrors[_0x470f2e(0x94)](_0x470f2e(0x8d)+_0x52cf04+'\x22.');await deleteBffScript(_0x53e11e[_0x470f2e(0x86)]),delete _0x2e022b[_0x470f2e(0x8e)][_0x52cf04],_0x2e022b['lastSync']=new Date()[_0x470f2e(0x93)](),await writeBffLockFile(_0x912448[_0x470f2e(0xa4)],_0x136dae);const _0x452fe8=resolveLocalFilePathFromLockKey(_0x912448,_0x52cf04);let _0x5ea966;await fileExists(_0x452fe8)&&(_0x5ea966=await moveToTrash(_0x912448[_0x470f2e(0xa1)],_0x912448[_0x470f2e(0xa2)],_0x452fe8),await cleanupEmptyDirectories(dirname(_0x452fe8),_0x912448[_0x470f2e(0xa0)]));await waitForDeleteSettlement(_0x912448['lockFilePath'],_0x1ff41d[_0x470f2e(0xa7)],_0x52cf04,_0x452fe8),await sleep(0x96);const _0x76e567={'deleted':_0x52cf04,'remoteId':_0x53e11e[_0x470f2e(0x86)]};if(_0x5ea966)_0x76e567['trashedTo']=_0x5ea966;return{'ok':!![],'data':_0x76e567,'message':'Deleted\x20'+_0x52cf04+(_0x5ea966?_0x470f2e(0x95):'')};}};function resolveDeleteTarget(_0x301e6d,_0x7719c7){const _0x590823=a31_0x4234c9;if(_0x301e6d['includes']('/')){const _0x5ed51c=_0x7719c7['find'](_0x2abbbe=>_0x2abbbe===_0x301e6d);if(!_0x5ed51c)throw CliErrors[_0x590823(0x94)]('Function\x20not\x20found:\x20'+_0x301e6d);return _0x5ed51c;}const _0x580d00=_0x7719c7[_0x590823(0x88)](_0x8e2ba2=>_0x8e2ba2[_0x590823(0x91)]('/')['at'](-0x1)===_0x301e6d);if(_0x580d00['length']===0x0)throw CliErrors[_0x590823(0x94)](_0x590823(0x78)+_0x301e6d);if(_0x580d00['length']>0x1)throw CliErrors[_0x590823(0x94)](_0x590823(0x9a)+_0x301e6d+_0x590823(0x7d)+_0x580d00['map'](_0x2ab09a=>_0x590823(0x87)+_0x2ab09a)[_0x590823(0x8f)]('\x0a'));return _0x580d00[0x0];}function a31_0x1e8c(_0x222cbb,_0x1340e7){_0x222cbb=_0x222cbb-0x77;const _0x2cc1f9=a31_0x2cc1();let _0x1e8c13=_0x2cc1f9[_0x222cbb];return _0x1e8c13;}async function moveToTrash(_0x3fc3dd,_0x9fdb09,_0x4e3292){const _0x80a712=a31_0x4234c9,_0x3824ed=new Date()[_0x80a712(0x93)]()[_0x80a712(0x7f)](/[:.]/g,'-'),_0x391651=relative(_0x3fc3dd,_0x4e3292),_0x256296=join(_0x9fdb09,_0x3824ed,_0x391651);return await mkdir(dirname(_0x256296),{'recursive':!![]}),await rename(_0x4e3292,_0x256296),_0x256296;}async function cleanupEmptyDirectories(_0x11954e,_0x2df689){const _0xcca306=a31_0x4234c9;let _0x392724=resolve(_0x11954e);const _0x2f63c8=resolve(_0x2df689);while(_0x392724[_0xcca306(0x81)](''+_0x2f63c8+sep)||_0x392724===_0x2f63c8){if(_0x392724===_0x2f63c8)return;try{const _0x34cfec=await readdir(_0x392724);if(_0x34cfec['length']>0x0)return;await rmdir(_0x392724);}catch{return;}_0x392724=dirname(_0x392724);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x22eddd,_0x5f3e9f,_0x5ce06a,_0x185ccd){const _0x2b1a12=a31_0x4234c9;for(let _0x1d4b4c=0x0;_0x1d4b4c<DELETE_SETTLE_RETRY_COUNT;_0x1d4b4c+=0x1){const _0x324a74=await readBffLockFile(_0x22eddd),_0xc6d0a=!!_0x324a74?.['apps']?.[_0x5f3e9f]?.[_0x2b1a12(0x8e)]?.[_0x5ce06a],_0x1c8af7=await fileExists(_0x185ccd);if(!_0xc6d0a&&!_0x1c8af7)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x5ce06a+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x137997=a32_0x4e8d;(function(_0x5edcc7,_0x299d28){const _0x488613=a32_0x4e8d,_0xd5c78c=_0x5edcc7();while(!![]){try{const _0x5e2b9b=parseInt(_0x488613(0x140))/0x1+-parseInt(_0x488613(0x13b))/0x2+parseInt(_0x488613(0x138))/0x3+-parseInt(_0x488613(0x12b))/0x4+-parseInt(_0x488613(0x129))/0x5+parseInt(_0x488613(0x12e))/0x6*(parseInt(_0x488613(0x135))/0x7)+-parseInt(_0x488613(0x132))/0x8;if(_0x5e2b9b===_0x299d28)break;else _0xd5c78c['push'](_0xd5c78c['shift']());}catch(_0x41b104){_0xd5c78c['push'](_0xd5c78c['shift']());}}}(a32_0x15b6,0x95691));function a32_0x4e8d(_0x22d4ff,_0x6f9aaa){_0x22d4ff=_0x22d4ff-0x129;const _0x15b628=a32_0x15b6();let _0x4e8db7=_0x15b628[_0x22d4ff];return _0x4e8db7;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x137997(0x13d),'command':a32_0x137997(0x139),'description':a32_0x137997(0x13a),'risk':a32_0x137997(0x12c),'flags':[{'name':'id','type':a32_0x137997(0x13e),'required':!![],'description':a32_0x137997(0x136)},{'name':a32_0x137997(0x13f),'type':a32_0x137997(0x12a),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0xe8d907){const _0x2994c4=a32_0x137997,_0x2d6eac=await getBffScriptInfo(_0xe8d907[_0x2994c4(0x130)]('id')),_0x2f953b=_0xe8d907[_0x2994c4(0x13c)](_0x2994c4(0x13f));if(_0x2f953b)return{'ok':!![],'data':_0x2d6eac};return{'ok':!![],'data':{'id':_0x2d6eac['id'],'functionName':_0x2d6eac['functionName']??'','version':_0x2d6eac['version']??'','updateUserName':_0x2d6eac[_0x2994c4(0x12f)]??'','appCode':_0x2d6eac[_0x2994c4(0x133)],'scriptType':_0x2d6eac[_0x2994c4(0x134)],'description':_0x2d6eac['description']||'(none)','createdTime':_0x2d6eac[_0x2994c4(0x12d)]??'','updatedTime':_0x2d6eac[_0x2994c4(0x131)]??'','scriptContent':_0x2d6eac[_0x2994c4(0x137)]??''}};}};function a32_0x15b6(){const _0x3a9312=['bff','number','verbose','323259PZoAEs','3782135YzmyQV','boolean','476516LRFKeR','read','createdTime','6966516rNuLJr','updateUserName','num','updatedTime','857008RhTgsl','appCode','scriptType','7dmnnnA','Script\x20ID','scriptContent','3012348DnsOZY','detail','Get\x20BFF\x20script\x20details\x20by\x20ID','1787588REgVqd','bool'];a32_0x15b6=function(){return _0x3a9312;};return a32_0x15b6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a33_0x3277(_0x14fefd,_0x41d6c2){_0x14fefd=_0x14fefd-0x18e;const _0x22436d=a33_0x2243();let _0x3277cd=_0x22436d[_0x14fefd];return _0x3277cd;}(function(_0x55887d,_0xd33b4f){const _0x2af046=a33_0x3277,_0x4c7e6a=_0x55887d();while(!![]){try{const _0x5a0f06=-parseInt(_0x2af046(0x196))/0x1*(parseInt(_0x2af046(0x18e))/0x2)+parseInt(_0x2af046(0x18f))/0x3+-parseInt(_0x2af046(0x197))/0x4+-parseInt(_0x2af046(0x191))/0x5*(-parseInt(_0x2af046(0x190))/0x6)+parseInt(_0x2af046(0x193))/0x7+parseInt(_0x2af046(0x192))/0x8+parseInt(_0x2af046(0x195))/0x9*(-parseInt(_0x2af046(0x194))/0xa);if(_0x5a0f06===_0xd33b4f)break;else _0x4c7e6a['push'](_0x4c7e6a['shift']());}catch(_0x39a587){_0x4c7e6a['push'](_0x4c7e6a['shift']());}}}(a33_0x2243,0xd148e));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];function a33_0x2243(){const _0x662cef=['30Oxutye','4942089JSjaVE','17jRNTwD','5567680WVNMEi','39502nGlDSX','2942757zyNvSY','5493678tiDxXF','5zcdwQY','9836944mXwVnN','7742910JieSaU'];a33_0x2243=function(){return _0x662cef;};return a33_0x2243();}
|