@lovrabet/rabetbase-cli 2.4.6-beta.3 → 2.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/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 +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x54eea4=a19_0x4196;(function(_0x5534b8,_0x3146c2){const _0x167e11=a19_0x4196,_0x47d87c=_0x5534b8();while(!![]){try{const _0x33dce4=-parseInt(_0x167e11(0xd7))/0x1+parseInt(_0x167e11(0xd4))/0x2*(-parseInt(_0x167e11(0xdb))/0x3)+-parseInt(_0x167e11(0xe6))/0x4+-parseInt(_0x167e11(0xcb))/0x5*(parseInt(_0x167e11(0xc7))/0x6)+-parseInt(_0x167e11(0xdc))/0x7*(parseInt(_0x167e11(0xcf))/0x8)+-parseInt(_0x167e11(0xc9))/0x9*(-parseInt(_0x167e11(0xef))/0xa)+-parseInt(_0x167e11(0xe7))/0xb*(-parseInt(_0x167e11(0xe0))/0xc);if(_0x33dce4===_0x3146c2)break;else _0x47d87c['push'](_0x47d87c['shift']());}catch(_0x37d420){_0x47d87c['push'](_0x47d87c['shift']());}}}(a19_0x3c87,0x5a3a8));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a19_0x4196(_0x3aaabc,_0x341949){_0x3aaabc=_0x3aaabc-0xc7;const _0x3c875f=a19_0x3c87();let _0x4196e4=_0x3c875f[_0x3aaabc];return _0x4196e4;}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(_0x1cc04b,_0x5b9c84){const _0x1e5f27=a19_0x4196,_0x157566=[],_0x5a6cc1=_0x1cc04b[_0x1e5f27(0xca)]&&typeof _0x1cc04b[_0x1e5f27(0xca)]===_0x1e5f27(0xdf)?_0x1cc04b['apps']:{},_0x3a6118=_0x1cc04b[_0x1e5f27(0xd0)]||undefined;for(const [_0x1786d6,_0x347bda]of Object[_0x1e5f27(0xcc)](_0x5a6cc1)){if(!_0x347bda||typeof _0x347bda!=='object'||!_0x347bda[_0x1e5f27(0xd1)])continue;_0x157566[_0x1e5f27(0xe2)]({'name':_0x1786d6,'appcode':_0x347bda[_0x1e5f27(0xd1)],'named':!![],'definedIn':_0x5b9c84,'isDefault':_0x1786d6===_0x3a6118,...buildAppProfileListFields(_0x347bda)});}return _0x157566;}function a19_0x3c87(){const _0x411e8c=['24AXaxxi','defaultApp','appcode','merged','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','796370xwHFDF','mergedCli','global','39151uJigTy','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','list','app','3JvIIEo','670103inbyBx','\x20in\x20','bool','object','744AurUNj','remote','push','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','globalPath','read','150776ibDTGu','290389DndQco','globalConfig','project','projectConfig','boolean','projectPath','optional','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','10eiONXG','validation','35472DOaexG','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','989127ScGLNi','apps','520zCceQg','entries','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','.\x20Use\x20`'];a19_0x3c87=function(){return _0x411e8c;};return a19_0x3c87();}function buildMergedItems(_0x4c0763,_0x3374f6){const _0x1e43d0=a19_0x4196,{apps:apps={},defaultApp:_0x5a76ce}=_0x4c0763,_0x388561=_0x3374f6[_0x1e43d0(0xe8)][_0x1e43d0(0xca)]&&typeof _0x3374f6[_0x1e43d0(0xe8)][_0x1e43d0(0xca)]===_0x1e43d0(0xdf)?_0x3374f6[_0x1e43d0(0xe8)][_0x1e43d0(0xca)]:{},_0x188d45=_0x3374f6[_0x1e43d0(0xea)][_0x1e43d0(0xca)]&&typeof _0x3374f6[_0x1e43d0(0xea)][_0x1e43d0(0xca)]===_0x1e43d0(0xdf)?_0x3374f6[_0x1e43d0(0xea)][_0x1e43d0(0xca)]:{},_0x1addcc=_0x3374f6['projectConfig']['inherit']===![],_0x3c66fa=Object['entries'](apps),_0x3d1e9d=_0x3c66fa['map'](([_0x503ebc,_0x262cfe])=>({'name':_0x503ebc,'appcode':_0x262cfe[_0x1e43d0(0xd1)],'named':!![],'definedIn':appDefinedIn(_0x503ebc,_0x388561,_0x188d45,_0x1addcc),'isDefault':_0x503ebc===_0x5a76ce,...buildAppProfileListFields(_0x262cfe)}));return _0x3d1e9d;}function validateAppListFlags(_0x3fe0d5){const _0x9231c7=a19_0x4196;if(!_0x3fe0d5[_0x9231c7(0xde)](_0x9231c7(0xe1)))return;if(!_0x3fe0d5[_0x9231c7(0xde)](_0x9231c7(0xd6))&&!_0x3fe0d5['bool']('project'))return;throw CliErrors[_0x9231c7(0xf0)](_0x9231c7(0xe3),_0x9231c7(0xd8));}async function execute(_0x3375ff){const _0x24e3f6=a19_0x4196;validateAppListFlags(_0x3375ff);if(_0x3375ff[_0x24e3f6(0xde)](_0x24e3f6(0xe1)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x3375ff)};const _0x4d14d3=_0x3375ff[_0x24e3f6(0xde)](_0x24e3f6(0xd6)),_0x409f49=_0x3375ff['bool']('project'),_0x53453f=_0x4d14d3?_0x24e3f6(0xd6):_0x409f49?_0x24e3f6(0xe9):_0x24e3f6(0xd2),{config:_0x36a921,layers:_0x7422c8}=readRawConfigWithLayers(),_0x5ce174=resolveDefaultAppSource(_0x7422c8),{defaultApp:_0x231c4b}=_0x36a921;let _0x4cfd8b,_0x4468c6;switch(_0x53453f){case _0x24e3f6(0xd6):_0x4cfd8b=buildItemsFromLayer(_0x7422c8['globalConfig'],_0x24e3f6(0xd6)),_0x4468c6=_0x7422c8[_0x24e3f6(0xe4)];break;case _0x24e3f6(0xe9):_0x4cfd8b=buildItemsFromLayer(_0x7422c8[_0x24e3f6(0xea)],_0x24e3f6(0xe9)),_0x4468c6=_0x7422c8[_0x24e3f6(0xec)];break;default:_0x4cfd8b=buildMergedItems(_0x36a921,_0x7422c8);break;}enrichAppListItemsWithMergedSelection(_0x4cfd8b,_0x3375ff[_0x24e3f6(0xd5)]);if(_0x4cfd8b['length']===0x0){const _0x4ef7d4=_0x53453f==='merged'?'':_0x24e3f6(0xdd)+_0x53453f+'\x20config';return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x4ef7d4+_0x24e3f6(0xce)+CLI_BIN_NAME+_0x24e3f6(0xcd)};}const _0x2b4057=_0x4cfd8b['find'](_0x4ddaa3=>_0x4ddaa3['isCurrent']===!![]),_0x2edd81=_0x231c4b??_0x2b4057?.[_0x24e3f6(0xd1)]??null,_0x537c75=_0x53453f==='merged'?{'globalPath':_0x7422c8[_0x24e3f6(0xe4)]??null,'projectPath':_0x7422c8[_0x24e3f6(0xec)]??null,'defaultApp':_0x2edd81,'defaultAppSource':_0x231c4b!=null?_0x5ce174:null}:{'scope':_0x53453f,'configPath':_0x4468c6??null};return{'ok':!![],'data':{'items':_0x4cfd8b,'meta':_0x537c75}};}export const appListDefinition={'service':a19_0x54eea4(0xda),'command':a19_0x54eea4(0xd9),'description':a19_0x54eea4(0xd3),'risk':a19_0x54eea4(0xe5),'auth':a19_0x54eea4(0xed),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x54eea4(0xe1),'type':'boolean','description':a19_0x54eea4(0xc8),'default':![]},{'name':a19_0x54eea4(0xd6),'type':a19_0x54eea4(0xeb),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a19_0x54eea4(0xe9),'type':a19_0x54eea4(0xeb),'description':a19_0x54eea4(0xee),'default':![]}],async 'validate'(_0xc99bcd){validateAppListFlags(_0xc99bcd);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x4e58(_0x3a09c4,_0x5a1470){_0x3a09c4=_0x3a09c4-0x8a;const _0x7cf848=a20_0x7cf8();let _0x4e58ab=_0x7cf848[_0x3a09c4];return _0x4e58ab;}const a20_0x1b5ae5=a20_0x4e58;function a20_0x7cf8(){const _0x468e24=['1095VUKNOi','3128488XXPiup','length','\x20application\x20member(s)','3688540PVyJZG','appCode','members-list','Found\x20','7265209tiypkD','app','15040gVUbFv','345625sIVewi','read','5212698JPhkuv','List\x20application\x20members\x20with\x20their\x20role\x20memberships','4564935SrvhXY','2jMQWKr'];a20_0x7cf8=function(){return _0x468e24;};return a20_0x7cf8();}(function(_0x337211,_0x2af246){const _0x57b22f=a20_0x4e58,_0x40086e=_0x337211();while(!![]){try{const _0x583a44=parseInt(_0x57b22f(0x95))/0x1*(-parseInt(_0x57b22f(0x9a))/0x2)+parseInt(_0x57b22f(0x8a))/0x3*(parseInt(_0x57b22f(0x94))/0x4)+parseInt(_0x57b22f(0x8e))/0x5+parseInt(_0x57b22f(0x97))/0x6+-parseInt(_0x57b22f(0x92))/0x7+-parseInt(_0x57b22f(0x8b))/0x8+-parseInt(_0x57b22f(0x99))/0x9;if(_0x583a44===_0x2af246)break;else _0x40086e['push'](_0x40086e['shift']());}catch(_0x2bc04c){_0x40086e['push'](_0x40086e['shift']());}}}(a20_0x7cf8,0xaa30f));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x1b5ae5(0x93),'command':a20_0x1b5ae5(0x90),'description':a20_0x1b5ae5(0x98),'risk':a20_0x1b5ae5(0x96),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x4c1454){const _0x31b3a6=a20_0x1b5ae5,_0x2c1e27=projectAppMembers(await listRoleUsers(_0x4c1454['appCode']));return{'ok':!![],'data':{'appCode':_0x4c1454[_0x31b3a6(0x8f)],'items':_0x2c1e27,'totalCount':_0x2c1e27[_0x31b3a6(0x8c)]},'message':_0x31b3a6(0x91)+_0x2c1e27[_0x31b3a6(0x8c)]+_0x31b3a6(0x8d)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x19e14f,_0xbbc0c){const _0x10dcd6=a21_0x35f7,_0x29ee21=_0x19e14f();while(!![]){try{const _0x2db8f8=-parseInt(_0x10dcd6(0x14c))/0x1*(parseInt(_0x10dcd6(0x14f))/0x2)+-parseInt(_0x10dcd6(0x157))/0x3+parseInt(_0x10dcd6(0x14b))/0x4*(parseInt(_0x10dcd6(0x153))/0x5)+parseInt(_0x10dcd6(0x152))/0x6+parseInt(_0x10dcd6(0x156))/0x7+parseInt(_0x10dcd6(0x14d))/0x8*(-parseInt(_0x10dcd6(0x14e))/0x9)+-parseInt(_0x10dcd6(0x151))/0xa;if(_0x2db8f8===_0xbbc0c)break;else _0x29ee21['push'](_0x29ee21['shift']());}catch(_0x2647a1){_0x29ee21['push'](_0x29ee21['shift']());}}}(a21_0xfb5c,0xa6770));function a21_0x35f7(_0x1adee8,_0x2558b3){_0x1adee8=_0x1adee8-0x14b;const _0xfb5caf=a21_0xfb5c();let _0x35f7af=_0xfb5caf[_0x1adee8];return _0x35f7af;}import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a21_0xfb5c(){const _0x335747=['map','428KIDDIc','1paZECa','24RVoJoU','475290LyCqeL','1931536WVsUOz','authRequired','8797530YeLLlm','4861230vWhuHY','50335XybXKW','appName','appDesc','8937292EYDoZY','1435017XmyFMA'];a21_0xfb5c=function(){return _0x335747;};return a21_0xfb5c();}function resolveCookie(_0x7496f4){const _0x41f5fa=a21_0x35f7,_0x5b3969=_0x7496f4['cookie']||getCookie();if(!_0x5b3969)throw CliErrors[_0x41f5fa(0x150)]();return _0x5b3969;}export async function listRemoteAppDirectory(_0x32aef2){const _0x4be0bf=a21_0x35f7,_0x2941fa=await withActiveCookie(resolveCookie(_0x32aef2),()=>listRemoteApps());return{'items':_0x2941fa[_0x4be0bf(0x158)](_0x556d11=>({..._0x556d11['id']!=null?{'id':_0x556d11['id']}:{},'appCode':_0x556d11['appCode'],'appName':_0x556d11[_0x4be0bf(0x154)],..._0x556d11[_0x4be0bf(0x155)]!=null?{'appDesc':_0x556d11[_0x4be0bf(0x155)]}:{}})),'meta':{'source':'platform'}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x338e55,_0x50b97b){const _0x1a8612=a22_0x464e,_0x36a999=_0x338e55();while(!![]){try{const _0x16d07c=parseInt(_0x1a8612(0x9e))/0x1*(-parseInt(_0x1a8612(0xc0))/0x2)+parseInt(_0x1a8612(0xb6))/0x3*(-parseInt(_0x1a8612(0xbe))/0x4)+parseInt(_0x1a8612(0xbc))/0x5*(-parseInt(_0x1a8612(0xb1))/0x6)+-parseInt(_0x1a8612(0x92))/0x7+-parseInt(_0x1a8612(0x8d))/0x8*(-parseInt(_0x1a8612(0xac))/0x9)+parseInt(_0x1a8612(0xa8))/0xa*(-parseInt(_0x1a8612(0x91))/0xb)+parseInt(_0x1a8612(0x95))/0xc*(parseInt(_0x1a8612(0xad))/0xd);if(_0x16d07c===_0x50b97b)break;else _0x36a999['push'](_0x36a999['shift']());}catch(_0x214572){_0x36a999['push'](_0x36a999['shift']());}}}(a22_0x43de,0x58074));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x57f986){const _0x4a7891=a22_0x464e,_0x5209b3=_0x57f986?.[_0x4a7891(0xab)]();return _0x5209b3?_0x5209b3:null;}export function projectAppMembers(_0x397c8f){const _0x1e8f19=a22_0x464e,_0x4adc15=new Map(),_0x3bc760=[..._0x397c8f][_0x1e8f19(0x90)]((_0x53219a,_0x2cb0f5)=>_0x53219a['id']-_0x2cb0f5['id']),_0xc43123=(_0x1e7b75,_0x4f0b6a,_0x5f5290)=>{const _0x47a006=_0x1e8f19;for(const _0x3c8369 of _0x4f0b6a){const _0x1ddbc2=Number(_0x3c8369[_0x47a006(0xc3)]);if(!Number[_0x47a006(0x94)](_0x1ddbc2)||_0x1ddbc2<=0x0)continue;let _0x3177f0=_0x4adc15[_0x47a006(0xa4)](_0x1ddbc2);if(!_0x3177f0)_0x3177f0={'userId':_0x1ddbc2,'username':nullableText(_0x3c8369[_0x47a006(0xa2)]),'displayName':nullableText(_0x3c8369[_0x47a006(0xbf)]),'status':_0x5f5290,'roles':[],'roleKeys':new Set()},_0x4adc15[_0x47a006(0xa3)](_0x1ddbc2,_0x3177f0);else{_0x3177f0['username']??=nullableText(_0x3c8369[_0x47a006(0xa2)]),_0x3177f0[_0x47a006(0xbb)]??=nullableText(_0x3c8369[_0x47a006(0xbf)]);if(_0x5f5290===_0x47a006(0x97))_0x3177f0[_0x47a006(0x9a)]='ACTIVE';}const _0x485662=_0x1e7b75['id']+':'+_0x5f5290;if(_0x3177f0[_0x47a006(0xbd)][_0x47a006(0x9b)](_0x485662))continue;_0x3177f0['roleKeys'][_0x47a006(0xa9)](_0x485662),_0x3177f0['roles']['push']({'roleId':_0x1e7b75['id'],'roleName':nullableText(_0x1e7b75[_0x47a006(0xb3)]),'roleType':nullableText(_0x1e7b75[_0x47a006(0xaf)]),'membershipStatus':_0x5f5290});}};for(const _0x3fa761 of _0x3bc760){_0xc43123(_0x3fa761,_0x3fa761[_0x1e8f19(0xaa)]??[],_0x1e8f19(0x97)),_0xc43123(_0x3fa761,_0x3fa761[_0x1e8f19(0xb8)]??[],_0x1e8f19(0x93));}return[..._0x4adc15[_0x1e8f19(0xb7)]()][_0x1e8f19(0x8f)](_0x6da77b=>({'userId':_0x6da77b['userId'],'username':_0x6da77b[_0x1e8f19(0xa2)],'displayName':_0x6da77b[_0x1e8f19(0xbb)],'status':_0x6da77b[_0x1e8f19(0x9a)],'roles':_0x6da77b[_0x1e8f19(0xb0)]['sort']((_0x4d98ea,_0x295e0d)=>_0x4d98ea['roleId']-_0x295e0d[_0x1e8f19(0xb9)]||(_0x4d98ea['membershipStatus']===_0x295e0d[_0x1e8f19(0x96)]?0x0:_0x4d98ea[_0x1e8f19(0x96)]==='ACTIVE'?-0x1:0x1))}))[_0x1e8f19(0x90)]((_0x1c4334,_0x59701f)=>_0x1c4334['userId']-_0x59701f[_0x1e8f19(0xc3)]);}export function enrichAppListItemsWithMergedSelection(_0x532b00,_0x30280e){const _0x487247=a22_0x464e;if(!_0x30280e)return;const _0x16df78=_0x30280e[_0x487247(0xa6)]&&typeof _0x30280e[_0x487247(0xa6)]===_0x487247(0xa1)?_0x30280e[_0x487247(0xa6)]:{},_0x1bd8d6=Object['keys'](_0x16df78)['length']>0x0;for(const _0x492d3f of _0x532b00){_0x492d3f[_0x487247(0xa0)]=![];}const _0x253c26=_0x30280e['appCode']!=null?String(_0x30280e['appCode'])[_0x487247(0xab)]():'';if(_0x1bd8d6){const _0x4fa6f3=_0x30280e['currentApp']??_0x30280e[_0x487247(0x98)];if(_0x4fa6f3)for(const _0x13def9 of _0x532b00){_0x13def9[_0x487247(0xb4)]===!![]&&_0x13def9[_0x487247(0xa5)]===_0x4fa6f3&&(_0x13def9[_0x487247(0xa0)]=!![]);}for(const _0x40cd1a of _0x532b00){if(_0x40cd1a[_0x487247(0xb4)]!==![])continue;if(_0x30280e[_0x487247(0x98)])continue;_0x253c26&&String(_0x40cd1a[_0x487247(0x99)]??'')[_0x487247(0xab)]()===_0x253c26&&(_0x40cd1a[_0x487247(0xa0)]=!![]);}return;}if(!_0x253c26)return;for(const _0x38b153 of _0x532b00){String(_0x38b153[_0x487247(0x99)]??'')['trim']()===_0x253c26&&(_0x38b153[_0x487247(0xa0)]=!![]);}}function a22_0x43de(){const _0x185081=['roleId','keys','displayName','50ZfUIaL','roleKeys','228876EYFdBm','nickname','247438DPyezV','global','both','userId','project','80KAiWyw','call','map','sort','1630255vrsNaZ','1117123IvCLnM','PENDING','isFinite','8526036WxBgZo','membershipStatus','ACTIVE','defaultApp','appcode','status','has','\x20(global)','globalConfig','3ugcMuV','hasOwnProperty','isCurrent','object','username','set','get','name','apps','inherit','10ypdiwC','add','userList','trim','544752rlSTpW','13LaZTKo','prototype','roleType','roles','97098QquyGj','length','roleName','named','projectConfig','6gZiQxg','values','applyUserList'];a22_0x43de=function(){return _0x185081;};return a22_0x43de();}export function resolveAppScopeForWrite(_0x18eb10,_0x5eece7,_0x409bea){const _0x495ed2=a22_0x464e;if(_0x5eece7)return _0x495ed2(0xc1);const _0x2720c8=_0x409bea[_0x495ed2(0xb5)][_0x495ed2(0xa6)]&&typeof _0x409bea[_0x495ed2(0xb5)][_0x495ed2(0xa6)]===_0x495ed2(0xa1)?_0x409bea[_0x495ed2(0xb5)]['apps']:{},_0x50247c=_0x409bea[_0x495ed2(0x9d)][_0x495ed2(0xa6)]&&typeof _0x409bea[_0x495ed2(0x9d)][_0x495ed2(0xa6)]==='object'?_0x409bea[_0x495ed2(0x9d)][_0x495ed2(0xa6)]:{};if(Object[_0x495ed2(0xae)]['hasOwnProperty'][_0x495ed2(0x8e)](_0x2720c8,_0x18eb10))return _0x495ed2(0x8c);if(Object[_0x495ed2(0xae)]['hasOwnProperty'][_0x495ed2(0x8e)](_0x50247c,_0x18eb10))return _0x495ed2(0xc1);return _0x495ed2(0x8c);}export function appDefinedIn(_0x1bf7dc,_0x48d442,_0x5e614d,_0x116a26){const _0x33e785=a22_0x464e;if(_0x116a26)return Object[_0x33e785(0xae)][_0x33e785(0x9f)][_0x33e785(0x8e)](_0x5e614d,_0x1bf7dc)?_0x33e785(0x8c):'global';const _0x443cb4=Object[_0x33e785(0xae)][_0x33e785(0x9f)][_0x33e785(0x8e)](_0x48d442,_0x1bf7dc),_0x549799=Object['prototype'][_0x33e785(0x9f)][_0x33e785(0x8e)](_0x5e614d,_0x1bf7dc);if(_0x443cb4&&_0x549799)return _0x33e785(0xc2);if(_0x549799)return _0x33e785(0x8c);return _0x33e785(0xc1);}function a22_0x464e(_0x2f0c0d,_0x4cc487){_0x2f0c0d=_0x2f0c0d-0x8c;const _0x43de32=a22_0x43de();let _0x464ea4=_0x43de32[_0x2f0c0d];return _0x464ea4;}export function resolveDefaultAppSource(_0x514a48){const _0x5d8707=a22_0x464e,_0x10d564=_0x514a48[_0x5d8707(0xb5)][_0x5d8707(0xa6)]&&typeof _0x514a48[_0x5d8707(0xb5)][_0x5d8707(0xa6)]===_0x5d8707(0xa1)?_0x514a48[_0x5d8707(0xb5)]['apps']:{};if(_0x5d8707(0x98)in _0x514a48[_0x5d8707(0xb5)])return _0x5d8707(0x8c);if(Object[_0x5d8707(0xba)](_0x10d564)[_0x5d8707(0xb2)]>0x0)return _0x5d8707(0x8c);if(_0x514a48['projectConfig'][_0x5d8707(0xa7)]===![])return null;if(_0x514a48['globalConfig']['defaultApp'])return'global';return null;}export function getConfigPath(_0x257fbf={}){const _0x4018ce=a22_0x464e,_0x165241=_0x257fbf[_0x4018ce(0xc1)]?_0x4018ce(0xc1):_0x4018ce(0x8c);return resolveWriteConfigPath(_0x165241);}export function readConfig(_0x2ed173={}){return readConfigFile(getConfigPath(_0x2ed173));}export function writeConfig(_0x343243,_0x2e87c5={}){writeConfigFile(getConfigPath(_0x2e87c5),_0x343243);}export function scopeLabel(_0x3a7cd0){const _0x522b63=a22_0x464e;return _0x3a7cd0[_0x522b63(0xc1)]?_0x522b63(0x9c):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x19230c=a23_0x448f;(function(_0x5b57fa,_0x16db7b){const _0x3e98b5=a23_0x448f,_0x32bd6f=_0x5b57fa();while(!![]){try{const _0x4681d6=parseInt(_0x3e98b5(0x198))/0x1*(parseInt(_0x3e98b5(0x1a3))/0x2)+-parseInt(_0x3e98b5(0x192))/0x3*(-parseInt(_0x3e98b5(0x18f))/0x4)+-parseInt(_0x3e98b5(0x1a2))/0x5*(-parseInt(_0x3e98b5(0x1a7))/0x6)+-parseInt(_0x3e98b5(0x1a1))/0x7*(-parseInt(_0x3e98b5(0x1a0))/0x8)+-parseInt(_0x3e98b5(0x199))/0x9*(parseInt(_0x3e98b5(0x1a8))/0xa)+parseInt(_0x3e98b5(0x1a4))/0xb*(-parseInt(_0x3e98b5(0x19a))/0xc)+-parseInt(_0x3e98b5(0x18e))/0xd;if(_0x4681d6===_0x16db7b)break;else _0x32bd6f['push'](_0x32bd6f['shift']());}catch(_0x87e233){_0x32bd6f['push'](_0x32bd6f['shift']());}}}(a23_0x41a4,0xa2018));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a23_0x448f(_0xb58514,_0x3e3ba2){_0xb58514=_0xb58514-0x18e;const _0x41a4e0=a23_0x41a4();let _0x448f70=_0x41a4e0[_0xb58514];return _0x448f70;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x19230c(0x19e);function a23_0x41a4(){const _0x4119e0=['isFinite','/smartapi/app-config/delete','apiError','4965344YCkKlc','14QvjbfM','2960YXTcMD','28716XGwuEP','1012GoAqMo','App\x20config\x20key\x20not\x20found:\x20','get','8526VCtdJy','26710vwyOfE','23141950dEukQx','4336420kmoNbW','App\x20config\x20server\x20id\x20missing\x20for\x20key=','POST','3bUGgin','Delete\x20one\x20runtime\x20app-config\x20key','app-config','delete','appCode','number','14MevCwl','9vuUFat','120168UGYyWn',',\x20appCode=','appCode:\x20'];a23_0x41a4=function(){return _0x4119e0;};return a23_0x41a4();}export const appConfigDelete={'service':a23_0x19230c(0x194),'command':a23_0x19230c(0x195),'description':a23_0x19230c(0x193),'risk':'high-risk-write','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4ab56f){readKeyArg(_0x4ab56f);},async 'dryRun'(_0x3910dd){const _0x5f5c38=a23_0x19230c,_0x3082bb=readKeyArg(_0x3910dd),_0x29e6d0=await mustGetByKey(_0x3910dd[_0x5f5c38(0x196)],_0x3082bb);return asAppConfigDryRunResult(buildMutationData({'operation':_0x5f5c38(0x195),'appCode':_0x3910dd[_0x5f5c38(0x196)],'key':_0x3082bb,'before':projectAppConfig(_0x29e6d0),'after':null,'dryRun':!![]}),{'method':_0x5f5c38(0x191),'url':DELETE_PATH});},async 'execute'(_0x529ab9){const _0x794fd7=a23_0x19230c,_0x41fc10=readKeyArg(_0x529ab9),_0x27edff=await mustGetByKey(_0x529ab9[_0x794fd7(0x196)],_0x41fc10);return await withAppConfigApiBoundary(_0x794fd7(0x195),{'appCode':_0x529ab9[_0x794fd7(0x196)],'key':_0x41fc10},()=>deleteAppConfig({'appCode':_0x529ab9[_0x794fd7(0x196)],'id':requireAppConfigId(_0x27edff,_0x41fc10,_0x529ab9['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x794fd7(0x195),'appCode':_0x529ab9['appCode'],'key':_0x41fc10,'before':projectAppConfig(_0x27edff),'after':null,'dryRun':![]}),'message':'Deleted\x20app\x20config\x20'+_0x41fc10};}};async function mustGetByKey(_0x202f49,_0xbf15a5){const _0x233912=a23_0x19230c,_0x1e92c2=await withAppConfigApiBoundary(_0x233912(0x1a6),{'appCode':_0x202f49,'key':_0xbf15a5},()=>getAppConfigByKey(_0x202f49,_0xbf15a5));if(!_0x1e92c2)throw CliErrors['validation'](_0x233912(0x1a5)+_0xbf15a5,_0x233912(0x19c)+_0x202f49);return _0x1e92c2;}function requireAppConfigId(_0x4f7abf,_0x5eae29,_0x82d2a1){const _0xdfb896=a23_0x19230c;if(typeof _0x4f7abf['id']===_0xdfb896(0x197)&&Number[_0xdfb896(0x19d)](_0x4f7abf['id'])&&_0x4f7abf['id']>0x0)return _0x4f7abf['id'];throw CliErrors[_0xdfb896(0x19f)](_0xdfb896(0x190)+_0x5eae29+_0xdfb896(0x19b)+_0x82d2a1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x4188e5=a24_0x121c;(function(_0x43947c,_0x171446){const _0x5dc0ae=a24_0x121c,_0x4d9550=_0x43947c();while(!![]){try{const _0x36defe=-parseInt(_0x5dc0ae(0x1f4))/0x1*(-parseInt(_0x5dc0ae(0x1f5))/0x2)+-parseInt(_0x5dc0ae(0x1fe))/0x3+-parseInt(_0x5dc0ae(0x1ee))/0x4+-parseInt(_0x5dc0ae(0x1fa))/0x5+-parseInt(_0x5dc0ae(0x1fb))/0x6+parseInt(_0x5dc0ae(0x1f7))/0x7*(-parseInt(_0x5dc0ae(0x1f8))/0x8)+parseInt(_0x5dc0ae(0x1f9))/0x9;if(_0x36defe===_0x171446)break;else _0x4d9550['push'](_0x4d9550['shift']());}catch(_0x3d2f7a){_0x4d9550['push'](_0x4d9550['shift']());}}}(a24_0x5477,0xba082));import{getAppConfigByKey}from'../../core/api-client.js';function a24_0x5477(){const _0x285670=['2146068RLStFv','reveal','\x20with\x20value\x20redacted','918668YSfETV','appCode','appCode:\x20','bool','get','validation','1410942GcxFeX','2TSWymk','app-config','77slmIME','250888rTvhuK','20287854rHyish','1862555RcaQvO','7443942spQYzQ','Loaded\x20app\x20config\x20','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used'];a24_0x5477=function(){return _0x285670;};return a24_0x5477();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a24_0x121c(_0x20e2fd,_0x470e19){_0x20e2fd=_0x20e2fd-0x1ec;const _0x5477f1=a24_0x5477();let _0x121c90=_0x5477f1[_0x20e2fd];return _0x121c90;}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a24_0x4188e5(0x1f6),'command':'get','description':a24_0x4188e5(0x1fd),'risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x44362d){readKeyArg(_0x44362d);},async 'execute'(_0x5b0226){const _0x44f989=a24_0x4188e5,_0x9ba388=readKeyArg(_0x5b0226),_0x3630ef=await withAppConfigApiBoundary(_0x44f989(0x1f2),{'appCode':_0x5b0226[_0x44f989(0x1ef)],'key':_0x9ba388},()=>getAppConfigByKey(_0x5b0226['appCode'],_0x9ba388));if(!_0x3630ef)throw CliErrors[_0x44f989(0x1f3)]('App\x20config\x20key\x20not\x20found:\x20'+_0x9ba388,_0x44f989(0x1f0)+_0x5b0226[_0x44f989(0x1ef)]);const _0x10ae58=projectAppConfig(_0x3630ef,{'reveal':_0x5b0226[_0x44f989(0x1f1)](_0x44f989(0x1ec))});return{'ok':!![],'data':{'config':_0x10ae58},'message':_0x5b0226[_0x44f989(0x1f1)](_0x44f989(0x1ec))?_0x44f989(0x1fc)+_0x9ba388+'\x20with\x20value\x20revealed':_0x44f989(0x1fc)+_0x9ba388+_0x44f989(0x1ed)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x20a38a,_0x32e3b5){const _0x285385=a25_0x2b7a,_0x3bcaf9=_0x20a38a();while(!![]){try{const _0x906225=-parseInt(_0x285385(0xf9))/0x1+-parseInt(_0x285385(0xfb))/0x2+parseInt(_0x285385(0xf6))/0x3+-parseInt(_0x285385(0xf5))/0x4+-parseInt(_0x285385(0xf4))/0x5*(parseInt(_0x285385(0xf7))/0x6)+-parseInt(_0x285385(0xf8))/0x7*(-parseInt(_0x285385(0xfa))/0x8)+parseInt(_0x285385(0xfc))/0x9;if(_0x906225===_0x32e3b5)break;else _0x3bcaf9['push'](_0x3bcaf9['shift']());}catch(_0x31a00e){_0x3bcaf9['push'](_0x3bcaf9['shift']());}}}(a25_0x3224,0x376fb));function a25_0x3224(){const _0x404e0b=['286075WjaOyu','1353976vwBsKN','43356VsmbaJ','36NgjaxE','315014qWeFVy','294tadTRH','8ZhYmLZ','277406RHrYKi','8895546LpDweA'];a25_0x3224=function(){return _0x404e0b;};return a25_0x3224();}import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';function a25_0x2b7a(_0x4b1a85,_0xe0cb7a){_0x4b1a85=_0x4b1a85-0xf4;const _0x32248a=a25_0x3224();let _0x2b7af0=_0x32248a[_0x4b1a85];return _0x2b7af0;}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_0x447546=a26_0x5a56;(function(_0x3ce713,_0x2032ca){const _0x2fbf7b=a26_0x5a56,_0xdd1deb=_0x3ce713();while(!![]){try{const _0x12c865=parseInt(_0x2fbf7b(0x199))/0x1*(-parseInt(_0x2fbf7b(0x18f))/0x2)+-parseInt(_0x2fbf7b(0x191))/0x3*(-parseInt(_0x2fbf7b(0x197))/0x4)+-parseInt(_0x2fbf7b(0x198))/0x5*(parseInt(_0x2fbf7b(0x19a))/0x6)+-parseInt(_0x2fbf7b(0x195))/0x7+-parseInt(_0x2fbf7b(0x196))/0x8*(parseInt(_0x2fbf7b(0x187))/0x9)+-parseInt(_0x2fbf7b(0x18a))/0xa*(-parseInt(_0x2fbf7b(0x188))/0xb)+parseInt(_0x2fbf7b(0x19b))/0xc*(parseInt(_0x2fbf7b(0x193))/0xd);if(_0x12c865===_0x2032ca)break;else _0xdd1deb['push'](_0xdd1deb['shift']());}catch(_0x42e095){_0xdd1deb['push'](_0xdd1deb['shift']());}}}(a26_0xb566,0x7925e));import{listAppConfigs}from'../../core/api-client.js';function a26_0xb566(){const _0x248598=['26PYDBdD','Found\x20','2032576zwMfGr','3688cBPadJ','44OUgzsx','559365PEgULW','50qVyaLB','12ZBzAXR','10037352QTSLLI','\x20app\x20config(s)','5391OTomGN','319cQNdTA','length','89080siULGq','str','Filter\x20by\x20exact\x20config\x20key','key','appCode','38216qqukdS','string','84723UrXQgm','trim'];a26_0xb566=function(){return _0x248598;};return a26_0xb566();}function a26_0x5a56(_0x247c44,_0x4e8597){_0x247c44=_0x247c44-0x186;const _0xb566a1=a26_0xb566();let _0x5a56d1=_0xb566a1[_0x247c44];return _0x5a56d1;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':'list','description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x447546(0x18d),'type':a26_0x447546(0x190),'description':a26_0x447546(0x18c)},TAGS_FLAG],async 'validate'(_0x48aa0f){const _0x272589=a26_0x447546,_0xd9dc79=_0x48aa0f[_0x272589(0x18b)](_0x272589(0x18d))[_0x272589(0x192)]();if(_0xd9dc79)validateKey(_0xd9dc79);readOptionalTags(_0x48aa0f);},async 'execute'(_0x29dd5d){const _0x3e66ae=a26_0x447546,_0x5dd27f=_0x29dd5d[_0x3e66ae(0x18b)]('key')[_0x3e66ae(0x192)]()||undefined,_0x38b559=readOptionalTags(_0x29dd5d),_0x503b6d=await withAppConfigApiBoundary('list',{'appCode':_0x29dd5d['appCode']},()=>listAppConfigs(_0x29dd5d[_0x3e66ae(0x18e)],{'key':_0x5dd27f,'tags':_0x38b559})),_0x32c258=_0x503b6d['map'](_0x5633a3=>projectAppConfig(_0x5633a3));return{'ok':!![],'data':{'appCode':_0x29dd5d['appCode'],'count':_0x32c258[_0x3e66ae(0x189)],'configs':_0x32c258},'message':_0x3e66ae(0x194)+_0x32c258[_0x3e66ae(0x189)]+_0x3e66ae(0x186)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x60f8e5=a27_0x322e;(function(_0x1efdaf,_0x37bb68){const _0x152899=a27_0x322e,_0x24e649=_0x1efdaf();while(!![]){try{const _0x9cda3b=parseInt(_0x152899(0xd6))/0x1*(parseInt(_0x152899(0xc3))/0x2)+-parseInt(_0x152899(0xd3))/0x3+-parseInt(_0x152899(0xcb))/0x4+parseInt(_0x152899(0xd2))/0x5+parseInt(_0x152899(0xce))/0x6*(-parseInt(_0x152899(0xcd))/0x7)+-parseInt(_0x152899(0xc1))/0x8*(parseInt(_0x152899(0xc7))/0x9)+parseInt(_0x152899(0xd4))/0xa;if(_0x9cda3b===_0x37bb68)break;else _0x24e649['push'](_0x24e649['shift']());}catch(_0x16b159){_0x24e649['push'](_0x24e649['shift']());}}}(a27_0x5337,0x3410c));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a27_0x322e(_0x153dc1,_0xafdab4){_0x153dc1=_0x153dc1-0xc0;const _0x533783=a27_0x5337();let _0x322e24=_0x533783[_0x153dc1];return _0x322e24;}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_0x5337(){const _0x14c736=['\x20app\x20config\x20','1838485mxBSae','251817VGBpCs','1806190oxZWNA','/smartapi/app-config/create','7IcDmPn','app-config','update','Created','App\x20config\x20server\x20id\x20missing\x20for\x20key=','isFinite','502448DZcfUW','POST','119726yaskwQ','get','appCode','tags','9MlGPfF','/smartapi/app-config/update','string','file','1189376MnWqTq','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','542514xduPEr','24eyYkrC','create','number'];a27_0x5337=function(){return _0x14c736;};return a27_0x5337();}const CREATE_PATH=a27_0x60f8e5(0xd5),UPDATE_PATH=a27_0x60f8e5(0xc8);export const appConfigSet={'service':a27_0x60f8e5(0xd7),'command':'set','description':a27_0x60f8e5(0xcc),'risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x60f8e5(0xca),'type':a27_0x60f8e5(0xc9),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x5c6e33){readKeyArg(_0x5c6e33),readOptionalTags(_0x5c6e33),assertSingleValueSource(_0x5c6e33);},async 'dryRun'(_0x11f7d5){const _0x1d2635=a27_0x60f8e5,_0x40d486=readKeyArg(_0x11f7d5),_0x5c9f22=readOptionalTags(_0x11f7d5),_0x555221=assertSingleValueSource(_0x11f7d5);await assertValueSourceReadable(_0x555221);const _0x46dd19=await withAppConfigApiBoundary(_0x1d2635(0xc4),{'appCode':_0x11f7d5['appCode'],'key':_0x40d486},()=>getAppConfigByKey(_0x11f7d5[_0x1d2635(0xc5)],_0x40d486)),_0x3357fe=_0x46dd19?_0x1d2635(0xd8):_0x1d2635(0xcf),_0xe0e276=_0x46dd19?projectAppConfig(_0x46dd19):null,_0x404381=plannedAppConfig({'appCode':_0x11f7d5['appCode'],'key':_0x40d486,'tags':_0x5c9f22??_0x46dd19?.[_0x1d2635(0xc6)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x3357fe,'appCode':_0x11f7d5[_0x1d2635(0xc5)],'key':_0x40d486,'before':_0xe0e276,'after':_0x404381,'dryRun':!![]}),{'method':_0x1d2635(0xc2),'url':_0x3357fe===_0x1d2635(0xd8)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x49c609){const _0x2b9fb2=a27_0x60f8e5,_0x31dcc1=readKeyArg(_0x49c609),_0x4bec78=readOptionalTags(_0x49c609),_0x21a124=await withAppConfigApiBoundary(_0x2b9fb2(0xc4),{'appCode':_0x49c609[_0x2b9fb2(0xc5)],'key':_0x31dcc1},()=>getAppConfigByKey(_0x49c609[_0x2b9fb2(0xc5)],_0x31dcc1)),_0x8f67ab=_0x21a124?projectAppConfig(_0x21a124):null,_0x38f566=_0x21a124?_0x2b9fb2(0xd8):_0x2b9fb2(0xcf),{value:_0x3be10c,warnings:_0x24f860}=await readAppConfigValue(_0x49c609),_0x23845d={'appCode':_0x49c609['appCode'],'key':_0x31dcc1,'value':_0x3be10c,'tags':_0x4bec78??_0x21a124?.[_0x2b9fb2(0xc6)]??undefined};await withAppConfigApiBoundary(_0x38f566,{'appCode':_0x49c609[_0x2b9fb2(0xc5)],'key':_0x31dcc1},async()=>{const _0x5ef0e2=_0x2b9fb2;_0x21a124?await updateAppConfig({..._0x23845d,'id':requireAppConfigId(_0x21a124,_0x31dcc1,_0x49c609[_0x5ef0e2(0xc5)])}):await createAppConfig(_0x23845d);});const _0x4a5814=await withAppConfigApiBoundary(_0x2b9fb2(0xc4),{'appCode':_0x49c609[_0x2b9fb2(0xc5)],'key':_0x31dcc1},()=>getAppConfigByKey(_0x49c609[_0x2b9fb2(0xc5)],_0x31dcc1)),_0xcaa26f=_0x4a5814?projectAppConfig(_0x4a5814):plannedAppConfig({'appCode':_0x49c609[_0x2b9fb2(0xc5)],'key':_0x31dcc1,'tags':_0x23845d[_0x2b9fb2(0xc6)],'hasValue':_0x3be10c!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x38f566,'appCode':_0x49c609[_0x2b9fb2(0xc5)],'key':_0x31dcc1,'before':_0x8f67ab,'after':_0xcaa26f,'dryRun':![],'warnings':_0x24f860}),'message':(_0x38f566===_0x2b9fb2(0xd8)?'Updated':_0x2b9fb2(0xd9))+_0x2b9fb2(0xd1)+_0x31dcc1};}};function requireAppConfigId(_0x4e8577,_0x2ee5dc,_0x33f7ac){const _0x3c4b18=a27_0x60f8e5;if(typeof _0x4e8577['id']===_0x3c4b18(0xd0)&&Number[_0x3c4b18(0xc0)](_0x4e8577['id'])&&_0x4e8577['id']>0x0)return _0x4e8577['id'];throw CliErrors['apiError'](_0x3c4b18(0xda)+_0x2ee5dc+',\x20appCode='+_0x33f7ac);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x2256b3=a28_0xc393;(function(_0x107e87,_0x34c814){const _0x4d24ec=a28_0xc393,_0x28953e=_0x107e87();while(!![]){try{const _0x5564cc=parseInt(_0x4d24ec(0x139))/0x1+-parseInt(_0x4d24ec(0x162))/0x2*(parseInt(_0x4d24ec(0x14b))/0x3)+-parseInt(_0x4d24ec(0x160))/0x4+-parseInt(_0x4d24ec(0x164))/0x5*(parseInt(_0x4d24ec(0x135))/0x6)+parseInt(_0x4d24ec(0x146))/0x7*(-parseInt(_0x4d24ec(0x148))/0x8)+-parseInt(_0x4d24ec(0x144))/0x9*(parseInt(_0x4d24ec(0x138))/0xa)+parseInt(_0x4d24ec(0x13c))/0xb;if(_0x5564cc===_0x34c814)break;else _0x28953e['push'](_0x28953e['shift']());}catch(_0x32baa8){_0x28953e['push'](_0x28953e['shift']());}}}(a28_0x6d98,0x1e024));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x2256b3(0x136),'description':a28_0x2256b3(0x147),'required':!![]};export const VALUE_ARG={'name':a28_0x2256b3(0x13b),'description':a28_0x2256b3(0x13a),'required':![]};export const TAGS_FLAG={'name':a28_0x2256b3(0x168),'type':a28_0x2256b3(0x14e),'description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a28_0x2256b3(0x13d),'type':a28_0x2256b3(0x16e),'description':a28_0x2256b3(0x169),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a28_0x2256b3(0x14e),'description':a28_0x2256b3(0x154)};export const REVEAL_FLAG={'name':a28_0x2256b3(0x16d),'type':a28_0x2256b3(0x16e),'description':a28_0x2256b3(0x141),'default':![]};export function readKeyArg(_0x53d804){const _0x316251=_0x53d804['args'][0x0]?.['trim']()??'';return validateKey(_0x316251),_0x316251;}export function readOptionalTags(_0x4973ee){const _0x2913d2=a28_0x2256b3,_0x24d4c6=_0x4973ee['str'](_0x2913d2(0x168))[_0x2913d2(0x14c)]();if(!_0x24d4c6)return undefined;if(_0x24d4c6['length']>0x20)throw CliErrors[_0x2913d2(0x16a)](_0x2913d2(0x165));return _0x24d4c6;}export function validateKey(_0x46ca1b){const _0x1ce771=a28_0x2256b3;if(!_0x46ca1b)throw CliErrors[_0x1ce771(0x16a)]('Missing\x20app-config\x20key.');if(_0x46ca1b[_0x1ce771(0x163)]>0x100)throw CliErrors[_0x1ce771(0x16a)](_0x1ce771(0x174));}export function projectAppConfig(_0x5d47dc,_0x18a543){const _0x36c450=a28_0x2256b3,_0x5b73e2=_0x5d47dc[_0x36c450(0x13b)]!==undefined&&_0x5d47dc[_0x36c450(0x13b)]!==null&&_0x5d47dc[_0x36c450(0x13b)]!=='',_0x5f0153={'appCode':_0x5d47dc[_0x36c450(0x151)],'key':_0x5d47dc[_0x36c450(0x136)],'tags':_0x5d47dc['tags']??undefined,'hasValue':_0x5b73e2,'valueRedacted':_0x5b73e2&&!_0x18a543?.['reveal'],'gmtCreate':_0x5d47dc[_0x36c450(0x132)],'gmtModified':_0x5d47dc[_0x36c450(0x175)]};return _0x18a543?.['reveal']&&(_0x5f0153[_0x36c450(0x13b)]=_0x5d47dc['value']??'',_0x5f0153[_0x36c450(0x142)]=![]),_0x5f0153;}function a28_0x6d98(){const _0x11b6ea=['Failed\x20to\x20','join','defineProperties','error','url','App\x20config\x20value\x20source\x20is\x20ambiguous.','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','\x20app\x20config.','data','472192KSZDyq','flag','6tihuYK','length','5oGKnst','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','str','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','tags','Read\x20config\x20value\x20from\x20stdin','validation','path','once','reveal','boolean','Environment\x20variable\x20is\x20not\x20set:\x20','name','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','args','setEncoding','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','gmtModified','gmtCreate','utf8','hasValue','144546nImcYL','key','argument','41890BDYjNg','202324DKxtpf','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','value','4996321aSmssj','stdin','appCode:\x20','end','before','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','valueRedacted','slice','117wMZysj','method','62517mcvfFd','Runtime\x20app-config\x20key','152dntFUU','file','warnings','167334DqJATd','trim','from-env','string','push','Missing\x20app-config\x20value\x20source.','appCode','value\x20is\x20redacted','apiError','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','kind','env'];a28_0x6d98=function(){return _0x11b6ea;};return a28_0x6d98();}export function plannedAppConfig(_0x4c5d27){const _0x319754=a28_0x2256b3,_0x2a7cd0=_0x4c5d27[_0x319754(0x134)]??!![];return{'appCode':_0x4c5d27['appCode'],'key':_0x4c5d27[_0x319754(0x136)],'tags':_0x4c5d27[_0x319754(0x168)]??undefined,'hasValue':_0x2a7cd0,'valueRedacted':_0x2a7cd0};}function a28_0xc393(_0x4f3f0c,_0x5337ed){_0x4f3f0c=_0x4f3f0c-0x132;const _0x6d982f=a28_0x6d98();let _0xc393db=_0x6d982f[_0x4f3f0c];return _0xc393db;}export function buildMutationData(_0x1c7324){const _0xfe42d8=a28_0x2256b3;return{'operation':_0x1c7324['operation'],'selector':{'appCode':_0x1c7324[_0xfe42d8(0x151)],'key':_0x1c7324[_0xfe42d8(0x136)]},'before':_0x1c7324[_0xfe42d8(0x140)],'after':_0x1c7324['after'],'dryRun':_0x1c7324['dryRun'],'warnings':_0x1c7324[_0xfe42d8(0x14a)]??[]};}export async function withAppConfigApiBoundary(_0x2805dc,_0x3b3d60,_0x4fdb61){const _0x4b1117=a28_0x2256b3;try{return await _0x4fdb61();}catch{const _0x287e5f=[_0x4b1117(0x13e)+_0x3b3d60[_0x4b1117(0x151)]];if(_0x3b3d60[_0x4b1117(0x136)])_0x287e5f[_0x4b1117(0x14f)]('key:\x20'+_0x3b3d60['key']);_0x287e5f[_0x4b1117(0x14f)](_0x4b1117(0x152));throw CliErrors[_0x4b1117(0x153)](_0x4b1117(0x157)+_0x2805dc+_0x4b1117(0x15e),_0x287e5f[_0x4b1117(0x158)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x1b905d,_0x5b6e0a){const _0x2a24d5=a28_0x2256b3;return Object[_0x2a24d5(0x159)](_0x1b905d,{'method':{'value':_0x5b6e0a[_0x2a24d5(0x145)],'enumerable':![]},'url':{'value':_0x5b6e0a[_0x2a24d5(0x15b)],'enumerable':![]}});}export function assertSingleValueSource(_0x59e85e){const _0x3184c0=a28_0x2256b3,_0x2e2956=[];_0x59e85e['args'][_0x3184c0(0x163)]>0x1&&_0x2e2956[_0x3184c0(0x14f)]({'kind':_0x3184c0(0x137),'value':_0x59e85e[_0x3184c0(0x172)][_0x3184c0(0x143)](0x1)['join']('\x20')});const _0x407bac=_0x59e85e[_0x3184c0(0x161)](_0x3184c0(0x13b));_0x407bac!==undefined&&_0x407bac!==null&&_0x2e2956['push']({'kind':_0x3184c0(0x137),'value':String(_0x407bac)});_0x59e85e['bool'](_0x3184c0(0x13d))&&_0x2e2956['push']({'kind':_0x3184c0(0x13d)});const _0x2a77ab=_0x59e85e[_0x3184c0(0x166)](_0x3184c0(0x14d))[_0x3184c0(0x14c)]();_0x2a77ab&&_0x2e2956[_0x3184c0(0x14f)]({'kind':_0x3184c0(0x156),'name':_0x2a77ab});const _0x53f0a0=_0x59e85e[_0x3184c0(0x166)](_0x3184c0(0x149))[_0x3184c0(0x14c)]();_0x53f0a0&&_0x2e2956[_0x3184c0(0x14f)]({'kind':_0x3184c0(0x149),'path':_0x53f0a0});if(_0x2e2956['length']===0x0)throw CliErrors[_0x3184c0(0x16a)](_0x3184c0(0x150),_0x3184c0(0x15d));if(_0x2e2956['length']>0x1)throw CliErrors[_0x3184c0(0x16a)](_0x3184c0(0x15c),_0x3184c0(0x167));return _0x2e2956[0x0];}export async function assertValueSourceReadable(_0x1bae36){const _0x270811=a28_0x2256b3;if(_0x1bae36[_0x270811(0x155)]==='env'&&!(_0x1bae36[_0x270811(0x170)]in process.env))throw CliErrors[_0x270811(0x16a)](_0x270811(0x16f)+_0x1bae36['name']);if(_0x1bae36[_0x270811(0x155)]===_0x270811(0x149))try{await access(_0x1bae36[_0x270811(0x16b)]);}catch{throw CliErrors[_0x270811(0x16a)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x1bae36[_0x270811(0x16b)]);}}export async function readAppConfigValue(_0x1380e8){const _0x5bc916=a28_0x2256b3,_0x9d3ca8=assertSingleValueSource(_0x1380e8),_0x4335a4=[];if(_0x9d3ca8['kind']==='argument')return _0x4335a4[_0x5bc916(0x14f)](_0x5bc916(0x171)),{'value':_0x9d3ca8['value']??'','source':_0x9d3ca8['kind'],'warnings':_0x4335a4};if(_0x9d3ca8['kind']===_0x5bc916(0x13d))return{'value':await readStdin(),'source':_0x9d3ca8[_0x5bc916(0x155)],'warnings':_0x4335a4};if(_0x9d3ca8[_0x5bc916(0x155)]==='env'){if(!(_0x9d3ca8[_0x5bc916(0x170)]in process.env))throw CliErrors[_0x5bc916(0x16a)](_0x5bc916(0x16f)+_0x9d3ca8[_0x5bc916(0x170)]);return{'value':process.env[_0x9d3ca8.name]??'','source':_0x9d3ca8[_0x5bc916(0x155)],'warnings':_0x4335a4};}return{'value':await readFile(_0x9d3ca8[_0x5bc916(0x16b)],_0x5bc916(0x133)),'source':_0x9d3ca8[_0x5bc916(0x155)],'warnings':_0x4335a4};}function readStdin(){return new Promise((_0x3b3142,_0x3a641f)=>{const _0x89708e=a28_0xc393;let _0x1437ed='';process['stdin'][_0x89708e(0x173)](_0x89708e(0x133)),process[_0x89708e(0x13d)]['on'](_0x89708e(0x15f),_0xcb64ff=>{_0x1437ed+=_0xcb64ff;}),process['stdin'][_0x89708e(0x16c)](_0x89708e(0x13f),()=>_0x3b3142(_0x1437ed)),process[_0x89708e(0x13d)][_0x89708e(0x16c)](_0x89708e(0x15a),_0x3a641f);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x46896b=a29_0x29fe;function a29_0x29fe(_0x54359c,_0x3f58af){_0x54359c=_0x54359c-0x13d;const _0x1a693c=a29_0x1a69();let _0x29fe88=_0x1a693c[_0x54359c];return _0x29fe88;}function a29_0x1a69(){const _0xbdc82b=['../../auth/auth-server-ui.js','nonInteractive','349746qcENfV','12arqkdq','log','5707134LWLooe','bool','Login\x20via\x20browser','5605845QwKHve','10665072aWWEXn','write','6836555uvbJSW','login','logout','10vIpFbQ','boolean','177626BjraEi','4fVyDZu','435534mHgcHt','!\x20Not\x20logged\x20in','119KwAnJC'];a29_0x1a69=function(){return _0xbdc82b;};return a29_0x1a69();}(function(_0x2f73b6,_0x468cc3){const _0x5612a2=a29_0x29fe,_0x342d79=_0x2f73b6();while(!![]){try{const _0x317dfb=-parseInt(_0x5612a2(0x147))/0x1*(-parseInt(_0x5612a2(0x148))/0x2)+-parseInt(_0x5612a2(0x149))/0x3*(-parseInt(_0x5612a2(0x14f))/0x4)+-parseInt(_0x5612a2(0x13f))/0x5+parseInt(_0x5612a2(0x14e))/0x6*(parseInt(_0x5612a2(0x14b))/0x7)+parseInt(_0x5612a2(0x140))/0x8+-parseInt(_0x5612a2(0x151))/0x9+-parseInt(_0x5612a2(0x145))/0xa*(parseInt(_0x5612a2(0x142))/0xb);if(_0x317dfb===_0x468cc3)break;else _0x342d79['push'](_0x342d79['shift']());}catch(_0x2010f1){_0x342d79['push'](_0x342d79['shift']());}}}(a29_0x1a69,0xb4313));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a29_0x46896b(0x143),'description':a29_0x46896b(0x13e),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a29_0x46896b(0x146),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x1b622e){const _0x59de7e=a29_0x46896b,{runAuthServer:_0x8328f8}=await import(_0x59de7e(0x14c));return await _0x8328f8({'autoYes':_0x1b622e[_0x59de7e(0x13d)]('yes'),'nonInteractive':_0x1b622e[_0x59de7e(0x14d)]}),{'ok':!![]};}},{'service':'auth','command':a29_0x46896b(0x144),'description':'Clear\x20login\x20session','risk':a29_0x46896b(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x119b26){const _0xc951ef=a29_0x46896b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0xc951ef(0x150)]('✓\x20Logged\x20out')):console[_0xc951ef(0x150)](_0xc951ef(0x14a)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x29cc49=a30_0x18f4;(function(_0x4f5d8e,_0x38a784){const _0x44af3a=a30_0x18f4,_0x32661a=_0x4f5d8e();while(!![]){try{const _0x52e852=-parseInt(_0x44af3a(0x1ce))/0x1+-parseInt(_0x44af3a(0x1b3))/0x2*(-parseInt(_0x44af3a(0x196))/0x3)+parseInt(_0x44af3a(0x1b5))/0x4+parseInt(_0x44af3a(0x1d6))/0x5+parseInt(_0x44af3a(0x1cc))/0x6+parseInt(_0x44af3a(0x1f0))/0x7+parseInt(_0x44af3a(0x1f5))/0x8*(-parseInt(_0x44af3a(0x1d8))/0x9);if(_0x52e852===_0x38a784)break;else _0x32661a['push'](_0x32661a['shift']());}catch(_0x4f717d){_0x32661a['push'](_0x32661a['shift']());}}}(a30_0xf3f5,0x68ef9));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';function a30_0xf3f5(){const _0x32b876=['after','/COMMON/','stdin','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','join','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','2676665jTiITy','find','2151tuzjcn','stderr','修改后的请求参数','\x22.\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','question','/ENDPOINT/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','/data/dataset/','utf8','length','.js\x0a\x20*\x20[触发节点]\x20','validation','string','\x20api\x20pull`\x20to\x20refresh.','alias','File\x20already\x20exists:\x20','map','name','before','Available:\x20',']\x20(','Invalid\x20function\x20name\x20\x22','apiDir','5636596xBYvvJ','HOOK\x20requires\x20alias/operation/node\x20options.','create','keys','datasetCode','56464RcEqjA','Alias\x20\x22','nonInteractive','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK','Script\x20description','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','scriptsRootDir','str','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','parseInt','functionNode','source','903djXTgt','appCode','datasetcode','\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','\x20function:\x20','/**\x0a\x20*\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','.js\x0a','entries','No\x20datasets\x20found\x20for\x20this\x20app.','Select\x20trigger\x20node:','Trigger\x20node\x20(HOOK\x20only)','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','close','code','description','.js','includes','\x0a\x20*\x20[平台配置]\x20','Select\x20operation\x20type:','function-node','2Uctgva','bff','2862236KwWMAO','\x22\x20not\x20found.\x20','Operation\x20type\x20(HOOK\x20only)','\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','\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','Select\x20dataset:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','isInteger','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','trim','Invalid\x20dataset\x20selection.','UNKNOWN','/HOOK/','当前请求参数','operationType','修改后的响应结果','datasetId','Operation\x20type\x20\x22','tableName','operation-type','1220094bELndk','No\x20api.ts\x20found.\x20Run\x20`','143091DhBWWt','Function\x20name\x20(valid\x20JS\x20identifier)'];a30_0xf3f5=function(){return _0x32b876;};return a30_0xf3f5();}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';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x29cc49(0x1b4),'command':a30_0x29cc49(0x1f2),'description':a30_0x29cc49(0x1d3),'risk':'read','flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON','ENDPOINT',a30_0x29cc49(0x1f9)],'description':a30_0x29cc49(0x18f)},{'name':'name','type':a30_0x29cc49(0x1e5),'required':!![],'description':a30_0x29cc49(0x1cf)},{'name':'description','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1fa)},{'name':'alias','type':'string','description':a30_0x29cc49(0x1f8)},{'name':a30_0x29cc49(0x198),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x19e)},{'name':a30_0x29cc49(0x1cb),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1b7)},{'name':'function-node','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1a4),'enum':['before','after']}],async 'validate'(_0x10a083){const _0x299cdc=a30_0x29cc49,_0x23415b=_0x10a083[_0x299cdc(0x191)](_0x299cdc(0x1ea));if(!isValidBffFunctionName(_0x23415b))throw CliErrors['validation'](_0x299cdc(0x1ee)+_0x23415b+_0x299cdc(0x1a5));},async 'execute'(_0x4a2d4c){const _0x57c74b=a30_0x29cc49,_0x4f14d4=loadBffProjectConfig(_0x4a2d4c[_0x57c74b(0x197)]),_0x52025c=_0x4a2d4c[_0x57c74b(0x191)]('type'),_0x127f1d=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ea)),_0x1d1bed=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ad))||undefined,_0x18ffe8=_0x52025c===_0x57c74b(0x1f9)?await resolveHookOptions(_0x4f14d4,_0x4a2d4c):undefined,_0x4cceed=buildFilePath(_0x4f14d4,_0x52025c,_0x127f1d,_0x18ffe8);if(await fileExists(_0x4cceed))throw CliErrors['validation'](_0x57c74b(0x1e8)+_0x4cceed);await mkdir(dirname(_0x4cceed),{'recursive':!![]});const _0x139b19=generateTemplate(_0x52025c,_0x127f1d,_0x4a2d4c['appCode'],_0x1d1bed,_0x18ffe8);await writeFile(_0x4cceed,_0x139b19,_0x57c74b(0x1e1));const _0x2bbe78={'type':_0x52025c,'name':_0x127f1d,'path':_0x4cceed};if(_0x1d1bed)_0x2bbe78[_0x57c74b(0x1ad)]=_0x1d1bed;if(_0x18ffe8){if(_0x18ffe8[_0x57c74b(0x1e7)])_0x2bbe78[_0x57c74b(0x1e7)]=_0x18ffe8['alias'];_0x2bbe78['datasetCode']=_0x18ffe8[_0x57c74b(0x1f4)],_0x2bbe78[_0x57c74b(0x1c6)]=_0x18ffe8[_0x57c74b(0x1c6)],_0x2bbe78[_0x57c74b(0x194)]=_0x18ffe8['functionNode'];}return{'ok':!![],'data':_0x2bbe78,'message':'Created\x20'+_0x52025c+_0x57c74b(0x19a)+_0x127f1d};}};async function resolveHookOptions(_0xf68755,_0x2f8f68){const _0x465c04=a30_0x29cc49,_0x225aa4=loadAliasMap(_0x2f8f68['apiDir'],undefined,resolveApiFilePath(_0x2f8f68[_0x465c04(0x1ef)],_0x2f8f68['appCode'])),_0x357c2b=_0x225aa4[_0x465c04(0x1e2)]>0x0;let _0x1d7ce9,_0x32dae7,_0x3a5311;const _0x127261=_0x2f8f68[_0x465c04(0x191)]('alias'),_0x2e588c=_0x2f8f68[_0x465c04(0x191)]('datasetcode');if(_0x127261){const _0x2b1115=resolveAlias(_0x2f8f68[_0x465c04(0x1ef)],_0x127261,undefined,resolveApiFilePath(_0x2f8f68['apiDir'],_0x2f8f68[_0x465c04(0x197)]));if(!_0x2b1115){const _0x1bbfb8=_0x357c2b?'Available\x20aliases:\x20'+_0x225aa4[_0x465c04(0x1e9)](_0x1e801f=>_0x1e801f[_0x465c04(0x1e7)])[_0x465c04(0x1d4)](',\x20'):_0x465c04(0x1cd)+CLI_BIN_NAME+_0x465c04(0x1bd);throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1f6)+_0x127261+_0x465c04(0x1b6)+_0x1bbfb8);}_0x1d7ce9=_0x127261,_0x32dae7=_0x2b1115;}else{if(_0x2e588c){_0x32dae7=_0x2e588c;const _0x5266e5=_0x225aa4[_0x465c04(0x1d7)](_0x3acdbe=>_0x3acdbe[_0x465c04(0x1f4)]===_0x2e588c);_0x1d7ce9=_0x5266e5?.[_0x465c04(0x1e7)];}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x18e));else{if(_0x357c2b){const _0x241b17=_0x225aa4['map'](_0x20d90b=>_0x20d90b[_0x465c04(0x1e7)]+'\x20('+_0x20d90b[_0x465c04(0x1ca)]+')'),_0x548451=await promptSelect(_0x465c04(0x1ba),_0x241b17),_0x33faf7=_0x225aa4[_0x548451];if(!_0x33faf7)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c2));_0x1d7ce9=_0x33faf7[_0x465c04(0x1e7)],_0x32dae7=_0x33faf7[_0x465c04(0x1f4)];}else{const _0x4b5d59=await listDatasets(_0x2f8f68[_0x465c04(0x197)]);if(_0x4b5d59['length']===0x0)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1a2));const _0x17ea7d=_0x4b5d59[_0x465c04(0x1e9)](_0x5a9a67=>_0x5a9a67[_0x465c04(0x1ea)]+'\x20['+(_0x5a9a67[_0x465c04(0x195)]??_0x465c04(0x1c3))+_0x465c04(0x1ed)+_0x5a9a67[_0x465c04(0x1ac)]+')'),_0xfcc698=await promptSelect(_0x465c04(0x1ba),_0x17ea7d),_0x2ddc28=_0x4b5d59[_0xfcc698];if(!_0x2ddc28)throw CliErrors[_0x465c04(0x1e4)]('Invalid\x20dataset\x20selection.');_0x32dae7=_0x2ddc28[_0x465c04(0x1ac)],_0x1d7ce9=undefined;}}}}const _0x5b6aa4=await listDatasets(_0x2f8f68['appCode']),_0x270fd6=_0x5b6aa4[_0x465c04(0x1d7)](_0x3a3c41=>_0x3a3c41[_0x465c04(0x1ac)]===_0x32dae7);if(!_0x270fd6)throw CliErrors['validation'](_0x465c04(0x19c)+_0x32dae7+_0x465c04(0x1db)+(_0x1d7ce9?_0x465c04(0x1dc)+CLI_BIN_NAME+_0x465c04(0x1e6):''));_0x3a5311=_0x270fd6['id'];const _0x422ff2=_0x1d7ce9??_0x32dae7,_0xd12c0c=await listBffDatasetOperations(_0x2f8f68[_0x465c04(0x197)],_0x3a5311),_0x348916=_0xd12c0c?Object[_0x465c04(0x1f3)](_0xd12c0c):[];if(_0x348916[_0x465c04(0x1e2)]===0x0)throw CliErrors[_0x465c04(0x1e4)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x422ff2+'.');let _0xa11f2e;const _0x81134f=_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1cb));if(_0x81134f){if(!_0x348916[_0x465c04(0x1af)](_0x81134f))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c9)+_0x81134f+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x422ff2+'.\x20'+(_0x465c04(0x1ec)+_0x348916[_0x465c04(0x1d4)](',\x20')));_0xa11f2e=_0x81134f;}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1bb));const _0xf47528=await promptSelect(_0x465c04(0x1b1),_0x348916);_0xa11f2e=_0x348916[_0xf47528]??_0x348916[0x0];}let _0x16edc4=normalizeHookFunctionNode(_0x2f8f68['str'](_0x465c04(0x1b2)));if(!_0x16edc4){if(_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1b2)))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x192));if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x1a9));const _0x5d504c=await promptSelect(_0x465c04(0x1a3),[_0x465c04(0x1eb),_0x465c04(0x1d0)]);_0x16edc4=[_0x465c04(0x1eb),_0x465c04(0x1d0)][_0x5d504c]??'before';}return{'alias':_0x1d7ce9,'datasetCode':_0x32dae7,'datasetId':_0x3a5311,'operationType':_0xa11f2e,'functionNode':_0x16edc4};}async function promptSelect(_0x518eb8,_0x23009c){const _0x1424ae=a30_0x29cc49;if(_0x23009c[_0x1424ae(0x1e2)]===0x1)return 0x0;for(const [_0x4c67ea,_0x496fe9]of _0x23009c[_0x1424ae(0x1a1)]()){process['stderr'][_0x1424ae(0x1a8)]('\x20\x20'+(_0x4c67ea+0x1)+'.\x20'+_0x496fe9+'\x0a');}const _0x44a8ae=createInterface({'input':process[_0x1424ae(0x1d2)],'output':process[_0x1424ae(0x1d9)]});while(!![]){const _0x23d86c=await new Promise(_0x3e0920=>{const _0x42ea65=_0x1424ae;_0x44a8ae[_0x42ea65(0x1dd)](_0x518eb8+'\x20',_0x3e0920);}),_0x55d800=Number[_0x1424ae(0x193)](_0x23d86c[_0x1424ae(0x1c1)](),0xa);if(Number[_0x1424ae(0x1be)](_0x55d800)&&_0x55d800>=0x1&&_0x55d800<=_0x23009c['length'])return _0x44a8ae[_0x1424ae(0x1ab)](),_0x55d800-0x1;process[_0x1424ae(0x1d9)][_0x1424ae(0x1a8)](_0x1424ae(0x19f)+_0x23009c[_0x1424ae(0x1e2)]+'.\x0a');}}function buildFilePath(_0x20b569,_0x35f8ac,_0x7443f0,_0x5d6708){const _0x43e89e=a30_0x29cc49;if(_0x35f8ac===_0x43e89e(0x1f9)){if(!_0x5d6708)throw CliErrors[_0x43e89e(0x1e4)](_0x43e89e(0x1f1));const _0x54effd=_0x5d6708[_0x43e89e(0x1e7)]??_0x5d6708[_0x43e89e(0x1f4)];return join(_0x20b569[_0x43e89e(0x190)],_0x43e89e(0x1f9),_0x54effd,_0x5d6708['operationType'],_0x5d6708[_0x43e89e(0x194)],_0x7443f0+_0x43e89e(0x1ae));}return join(_0x20b569['scriptsRootDir'],_0x35f8ac,_0x7443f0+_0x43e89e(0x1ae));}function a30_0x18f4(_0x5394f2,_0x1c05ee){_0x5394f2=_0x5394f2-0x18e;const _0xf3f54b=a30_0xf3f5();let _0x18f4a0=_0xf3f54b[_0x5394f2];return _0x18f4a0;}export function generateTemplate(_0x469973,_0x558e99,_0x133c9c,_0x3ed77e,_0x533cfe){const _0x336ad2=a30_0x29cc49,_0x26ed86=_0x3ed77e?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x168f22=getAppBaseUrl(_0x133c9c),_0xdbe475=_0x336ad2(0x1b8);if(_0x469973===_0x336ad2(0x1bf))return _0x336ad2(0x19b)+_0x26ed86+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1d5)+_0x133c9c+_0x336ad2(0x1d1)+_0x558e99+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x558e99+'\x22,\x20params\x20})\x0a'+_0xdbe475+_0x336ad2(0x199)+_0x558e99+_0x336ad2(0x1aa);if(_0x469973===_0x336ad2(0x1bc))return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x1df)+_0x558e99+_0x336ad2(0x1c0)+_0x133c9c+'/'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1de)+_0x558e99+_0x336ad2(0x1a0)+_0xdbe475+_0x336ad2(0x1b9)+_0x558e99+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x533cfe)throw CliErrors[_0x336ad2(0x1e4)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x4628de=_0x533cfe['alias']??_0x533cfe['datasetCode'],_0x8fb47b=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1c5):'当前响应结果',_0x559f05=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1da):_0x336ad2(0x1c7);return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x19d)+_0x558e99+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x133c9c+'/'+_0x533cfe[_0x336ad2(0x1f4)]+'/'+_0x533cfe[_0x336ad2(0x1c6)]+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1e0)+_0x533cfe[_0x336ad2(0x1c8)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1c4)+_0x4628de+'/'+_0x533cfe['operationType']+'/'+_0x533cfe['functionNode']+'/'+_0x558e99+_0x336ad2(0x1e3)+_0x533cfe[_0x336ad2(0x194)]+'\x0a'+_0xdbe475+_0x336ad2(0x1a7)+_0x8fb47b+_0x336ad2(0x1a6)+_0x559f05+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x558e99+_0x336ad2(0x1aa);}
|
|
1
|
+
const a30_0x2de095=a30_0x2438;(function(_0x934b9f,_0x86a485){const _0x2ad1b6=a30_0x2438,_0x36bb3d=_0x934b9f();while(!![]){try{const _0x5b7eb3=parseInt(_0x2ad1b6(0xff))/0x1*(-parseInt(_0x2ad1b6(0xc1))/0x2)+parseInt(_0x2ad1b6(0xf8))/0x3+-parseInt(_0x2ad1b6(0xd5))/0x4+-parseInt(_0x2ad1b6(0xf2))/0x5*(parseInt(_0x2ad1b6(0xfb))/0x6)+parseInt(_0x2ad1b6(0xea))/0x7+parseInt(_0x2ad1b6(0xe2))/0x8*(-parseInt(_0x2ad1b6(0xc2))/0x9)+parseInt(_0x2ad1b6(0xcd))/0xa*(parseInt(_0x2ad1b6(0xba))/0xb);if(_0x5b7eb3===_0x86a485)break;else _0x36bb3d['push'](_0x36bb3d['shift']());}catch(_0x130b46){_0x36bb3d['push'](_0x36bb3d['shift']());}}}(a30_0x3214,0xb195d));import{createInterface}from'node:readline';function a30_0x2438(_0x3eded5,_0x49308a){_0x3eded5=_0x3eded5-0xaf;const _0x3214a8=a30_0x3214();let _0x243859=_0x3214a8[_0x3eded5];return _0x243859;}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';function a30_0x3214(){const _0x1e7ab0=['appCode','Invalid\x20function\x20name\x20\x22','Alias\x20\x22','function-node','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','before','No\x20operation\x20types\x20found\x20for\x20dataset\x20','ENDPOINT','source','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Available\x20aliases:\x20','.js','str','Trigger\x20node\x20(HOOK\x20only)','/data/dataset/','38995UudyTG','Function\x20name\x20(valid\x20JS\x20identifier)','create','close','File\x20already\x20exists:\x20','Operation\x20type\x20(HOOK\x20only)','\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','2536818SPBdLs','153tYvaQC','join','Select\x20operation\x20type:','trim','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','parseInt','validation','\x22\x20not\x20found.\x20','UNKNOWN',']\x20(','4810gPPxbt','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','stdin','/**\x0a\x20*\x20','functionNode','Created\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','422792yBMaBb','after','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','alias','operation-type','\x22\x20not\x20found\x20for\x20dataset\x20','nonInteractive','Invalid\x20dataset\x20selection.','code','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x20[平台配置]\x20','map','find','511040IFSxIx','修改后的响应结果','datasetcode','stderr','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','.js\x0a\x20*\x20[触发节点]\x20','bff','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','10081190DiKKhP','Operation\x20type\x20\x22','length','isInteger','apiDir','datasetId','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Select\x20dataset:','2756260OutHxw','tableName','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x22.\x20','No\x20api.ts\x20found.\x20Run\x20`','3433935PlzSiE','utf8','entries','12PJnlBL','COMMON','/ENDPOINT/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','1RvAryj','datasetCode','.js\x0a','Select\x20trigger\x20node:','description','当前响应结果','operationType','scriptsRootDir','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\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','/HOOK/','read','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','type','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','question','write','\x22,\x20params\x20})\x0a','string','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','/COMMON/','HOOK','name'];a30_0x3214=function(){return _0x1e7ab0;};return a30_0x3214();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x2de095(0xe8),'command':a30_0x2de095(0xbc),'description':a30_0x2de095(0xc6),'risk':a30_0x2de095(0x10a),'flags':[{'name':a30_0x2de095(0x10c),'type':'string','required':!![],'enum':[a30_0x2de095(0xfc),a30_0x2de095(0xb2),a30_0x2de095(0x114)],'description':'Script\x20type'},{'name':'name','type':'string','required':!![],'description':a30_0x2de095(0xbb)},{'name':a30_0x2de095(0x103),'type':a30_0x2de095(0x111),'description':'Script\x20description'},{'name':a30_0x2de095(0xd8),'type':a30_0x2de095(0x111),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':'string','description':a30_0x2de095(0xaf)},{'name':a30_0x2de095(0xd9),'type':a30_0x2de095(0x111),'description':a30_0x2de095(0xbf)},{'name':'function-node','type':a30_0x2de095(0x111),'description':a30_0x2de095(0xb8),'enum':[a30_0x2de095(0xb0),a30_0x2de095(0xd6)]}],async 'validate'(_0xad4b6b){const _0x1cd310=a30_0x2de095,_0x2e720b=_0xad4b6b[_0x1cd310(0xb7)](_0x1cd310(0x115));if(!isValidBffFunctionName(_0x2e720b))throw CliErrors[_0x1cd310(0xc9)](_0x1cd310(0x117)+_0x2e720b+_0x1cd310(0x107));},async 'execute'(_0x3db051){const _0x43bb1d=a30_0x2de095,_0x193193=loadBffProjectConfig(_0x3db051['appCode']),_0x5538ad=_0x3db051[_0x43bb1d(0xb7)](_0x43bb1d(0x10c)),_0x1116d2=_0x3db051[_0x43bb1d(0xb7)](_0x43bb1d(0x115)),_0x5dd4b3=_0x3db051[_0x43bb1d(0xb7)]('description')||undefined,_0x23b92e=_0x5538ad===_0x43bb1d(0x114)?await resolveHookOptions(_0x193193,_0x3db051):undefined,_0x8e9e2b=buildFilePath(_0x193193,_0x5538ad,_0x1116d2,_0x23b92e);if(await fileExists(_0x8e9e2b))throw CliErrors[_0x43bb1d(0xc9)](_0x43bb1d(0xbe)+_0x8e9e2b);await mkdir(dirname(_0x8e9e2b),{'recursive':!![]});const _0x34933d=generateTemplate(_0x5538ad,_0x1116d2,_0x3db051[_0x43bb1d(0x116)],_0x5dd4b3,_0x23b92e);await writeFile(_0x8e9e2b,_0x34933d,_0x43bb1d(0xf9));const _0x56b54e={'type':_0x5538ad,'name':_0x1116d2,'path':_0x8e9e2b};if(_0x5dd4b3)_0x56b54e[_0x43bb1d(0x103)]=_0x5dd4b3;if(_0x23b92e){if(_0x23b92e['alias'])_0x56b54e[_0x43bb1d(0xd8)]=_0x23b92e[_0x43bb1d(0xd8)];_0x56b54e[_0x43bb1d(0x100)]=_0x23b92e[_0x43bb1d(0x100)],_0x56b54e['operationType']=_0x23b92e[_0x43bb1d(0x105)],_0x56b54e[_0x43bb1d(0xd2)]=_0x23b92e['functionNode'];}return{'ok':!![],'data':_0x56b54e,'message':_0x43bb1d(0xd3)+_0x5538ad+'\x20function:\x20'+_0x1116d2};}};async function resolveHookOptions(_0xd69c62,_0x1cfbf0){const _0x213c77=a30_0x2de095,_0x4f95d7=loadAliasMap(_0x1cfbf0[_0x213c77(0xee)],undefined,resolveApiFilePath(_0x1cfbf0[_0x213c77(0xee)],_0x1cfbf0[_0x213c77(0x116)])),_0x1763af=_0x4f95d7[_0x213c77(0xec)]>0x0;let _0x10b32b,_0x1688ad,_0x514fa6;const _0x202ab8=_0x1cfbf0['str'](_0x213c77(0xd8)),_0x8f4441=_0x1cfbf0[_0x213c77(0xb7)](_0x213c77(0xe4));if(_0x202ab8){const _0xd794a0=resolveAlias(_0x1cfbf0['apiDir'],_0x202ab8,undefined,resolveApiFilePath(_0x1cfbf0[_0x213c77(0xee)],_0x1cfbf0['appCode']));if(!_0xd794a0){const _0x3d2972=_0x1763af?_0x213c77(0xb5)+_0x4f95d7[_0x213c77(0xe0)](_0x213dea=>_0x213dea[_0x213c77(0xd8)])[_0x213c77(0xc3)](',\x20'):_0x213c77(0xf7)+CLI_BIN_NAME+_0x213c77(0xf0);throw CliErrors[_0x213c77(0xc9)](_0x213c77(0x118)+_0x202ab8+_0x213c77(0xca)+_0x3d2972);}_0x10b32b=_0x202ab8,_0x1688ad=_0xd794a0;}else{if(_0x8f4441){_0x1688ad=_0x8f4441;const _0x83b40c=_0x4f95d7[_0x213c77(0xe1)](_0x4bdf4f=>_0x4bdf4f['datasetCode']===_0x8f4441);_0x10b32b=_0x83b40c?.[_0x213c77(0xd8)];}else{if(_0x1cfbf0['nonInteractive'])throw CliErrors[_0x213c77(0xc9)](_0x213c77(0xd4));else{if(_0x1763af){const _0x365812=_0x4f95d7[_0x213c77(0xe0)](_0x5036b0=>_0x5036b0['alias']+'\x20('+_0x5036b0[_0x213c77(0xf3)]+')'),_0x145361=await promptSelect(_0x213c77(0xf1),_0x365812),_0x374e6e=_0x4f95d7[_0x145361];if(!_0x374e6e)throw CliErrors[_0x213c77(0xc9)]('Invalid\x20dataset\x20selection.');_0x10b32b=_0x374e6e[_0x213c77(0xd8)],_0x1688ad=_0x374e6e['datasetCode'];}else{const _0x21c9f0=await listDatasets(_0x1cfbf0[_0x213c77(0x116)]);if(_0x21c9f0['length']===0x0)throw CliErrors[_0x213c77(0xc9)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x39c7ea=_0x21c9f0[_0x213c77(0xe0)](_0xc8f1ac=>_0xc8f1ac[_0x213c77(0x115)]+'\x20['+(_0xc8f1ac[_0x213c77(0xb3)]??_0x213c77(0xcb))+_0x213c77(0xcc)+_0xc8f1ac[_0x213c77(0xdd)]+')'),_0x245190=await promptSelect(_0x213c77(0xf1),_0x39c7ea),_0x3ae997=_0x21c9f0[_0x245190];if(!_0x3ae997)throw CliErrors[_0x213c77(0xc9)](_0x213c77(0xdc));_0x1688ad=_0x3ae997[_0x213c77(0xdd)],_0x10b32b=undefined;}}}}const _0x3c0735=await listDatasets(_0x1cfbf0[_0x213c77(0x116)]),_0x1cf604=_0x3c0735[_0x213c77(0xe1)](_0x37df92=>_0x37df92[_0x213c77(0xdd)]===_0x1688ad);if(!_0x1cf604)throw CliErrors['validation']('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x1688ad+_0x213c77(0xf6)+(_0x10b32b?_0x213c77(0xcf)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x514fa6=_0x1cf604['id'];const _0x49bed5=_0x10b32b??_0x1688ad,_0x335e44=await listBffDatasetOperations(_0x1cfbf0['appCode'],_0x514fa6),_0x4b112e=_0x335e44?Object['keys'](_0x335e44):[];if(_0x4b112e[_0x213c77(0xec)]===0x0)throw CliErrors[_0x213c77(0xc9)](_0x213c77(0xb1)+_0x49bed5+'.');let _0x6ca1cb;const _0x4e2fc4=_0x1cfbf0[_0x213c77(0xb7)]('operation-type');if(_0x4e2fc4){if(!_0x4b112e['includes'](_0x4e2fc4))throw CliErrors[_0x213c77(0xc9)](_0x213c77(0xeb)+_0x4e2fc4+_0x213c77(0xda)+_0x49bed5+'.\x20'+('Available:\x20'+_0x4b112e['join'](',\x20')));_0x6ca1cb=_0x4e2fc4;}else{if(_0x1cfbf0['nonInteractive'])throw CliErrors['validation'](_0x213c77(0xe6));const _0x4b3da2=await promptSelect(_0x213c77(0xc4),_0x4b112e);_0x6ca1cb=_0x4b112e[_0x4b3da2]??_0x4b112e[0x0];}let _0x5aa1d8=normalizeHookFunctionNode(_0x1cfbf0['str']('function-node'));if(!_0x5aa1d8){if(_0x1cfbf0['str'](_0x213c77(0x119)))throw CliErrors['validation'](_0x213c77(0xf5));if(_0x1cfbf0[_0x213c77(0xdb)])throw CliErrors[_0x213c77(0xc9)](_0x213c77(0xe9));const _0x106fb3=await promptSelect(_0x213c77(0x102),[_0x213c77(0xb0),_0x213c77(0xd6)]);_0x5aa1d8=[_0x213c77(0xb0),_0x213c77(0xd6)][_0x106fb3]??_0x213c77(0xb0);}return{'alias':_0x10b32b,'datasetCode':_0x1688ad,'datasetId':_0x514fa6,'operationType':_0x6ca1cb,'functionNode':_0x5aa1d8};}async function promptSelect(_0x4fd647,_0xcff714){const _0x211cb4=a30_0x2de095;if(_0xcff714[_0x211cb4(0xec)]===0x1)return 0x0;for(const [_0x3def8b,_0x1cfb91]of _0xcff714[_0x211cb4(0xfa)]()){process[_0x211cb4(0xe5)][_0x211cb4(0x10f)]('\x20\x20'+(_0x3def8b+0x1)+'.\x20'+_0x1cfb91+'\x0a');}const _0x2bf6d7=createInterface({'input':process[_0x211cb4(0xd0)],'output':process['stderr']});while(!![]){const _0x1586cd=await new Promise(_0x10a8a3=>{const _0x5a661a=_0x211cb4;_0x2bf6d7[_0x5a661a(0x10e)](_0x4fd647+'\x20',_0x10a8a3);}),_0x136c88=Number[_0x211cb4(0xc8)](_0x1586cd['trim'](),0xa);if(Number[_0x211cb4(0xed)](_0x136c88)&&_0x136c88>=0x1&&_0x136c88<=_0xcff714[_0x211cb4(0xec)])return _0x2bf6d7[_0x211cb4(0xbd)](),_0x136c88-0x1;process[_0x211cb4(0xe5)][_0x211cb4(0x10f)](_0x211cb4(0xce)+_0xcff714[_0x211cb4(0xec)]+'.\x0a');}}function buildFilePath(_0x96d88,_0x1b85b1,_0x19885f,_0x4c0891){const _0x2b4c57=a30_0x2de095;if(_0x1b85b1===_0x2b4c57(0x114)){if(!_0x4c0891)throw CliErrors[_0x2b4c57(0xc9)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x24e38c=_0x4c0891[_0x2b4c57(0xd8)]??_0x4c0891[_0x2b4c57(0x100)];return join(_0x96d88[_0x2b4c57(0x106)],'HOOK',_0x24e38c,_0x4c0891[_0x2b4c57(0x105)],_0x4c0891[_0x2b4c57(0xd2)],_0x19885f+_0x2b4c57(0xb6));}return join(_0x96d88[_0x2b4c57(0x106)],_0x1b85b1,_0x19885f+_0x2b4c57(0xb6));}export function generateTemplate(_0x221325,_0xbf5234,_0x37efce,_0x1734ae,_0x6151a4){const _0x43a11d=a30_0x2de095,_0x1154b8=_0x1734ae?.[_0x43a11d(0xc5)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x5b8555=getAppBaseUrl(_0x37efce),_0xb06ebf='\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x221325===_0x43a11d(0xfc))return _0x43a11d(0xd1)+_0x1154b8+_0x43a11d(0x112)+_0xbf5234+_0x43a11d(0xdf)+_0x5b8555+_0x43a11d(0xf4)+_0x37efce+_0x43a11d(0x113)+_0xbf5234+_0x43a11d(0x10b)+_0xbf5234+_0x43a11d(0x110)+_0xb06ebf+_0x43a11d(0xc0)+_0xbf5234+_0x43a11d(0xd7);if(_0x221325==='ENDPOINT')return _0x43a11d(0xd1)+_0x1154b8+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0xbf5234+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/'+_0x37efce+'/'+_0xbf5234+_0x43a11d(0xdf)+_0x5b8555+_0x43a11d(0xf4)+_0x37efce+_0x43a11d(0xfd)+_0xbf5234+_0x43a11d(0x101)+_0xb06ebf+_0x43a11d(0x108)+_0xbf5234+_0x43a11d(0xd7);if(!_0x6151a4)throw CliErrors[_0x43a11d(0xc9)](_0x43a11d(0xb4));const _0x73c05d=_0x6151a4['alias']??_0x6151a4[_0x43a11d(0x100)],_0x4d1c84=_0x6151a4['functionNode']==='before'?'当前请求参数':_0x43a11d(0x104),_0x507abe=_0x6151a4[_0x43a11d(0xd2)]===_0x43a11d(0xb0)?'修改后的请求参数':_0x43a11d(0xe3);return _0x43a11d(0xd1)+_0x1154b8+_0x43a11d(0xfe)+_0xbf5234+_0x43a11d(0x10d)+_0x37efce+'/'+_0x6151a4[_0x43a11d(0x100)]+'/'+_0x6151a4[_0x43a11d(0x105)]+_0x43a11d(0xdf)+_0x5b8555+_0x43a11d(0xb9)+_0x6151a4[_0x43a11d(0xef)]+_0x43a11d(0xde)+_0x37efce+_0x43a11d(0x109)+_0x73c05d+'/'+_0x6151a4[_0x43a11d(0x105)]+'/'+_0x6151a4['functionNode']+'/'+_0xbf5234+_0x43a11d(0xe7)+_0x6151a4[_0x43a11d(0xd2)]+'\x0a'+_0xb06ebf+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x4d1c84+_0x43a11d(0xc7)+_0x507abe+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0xbf5234+_0x43a11d(0xd7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x1b10(){const _0x490e52=['keys','Would\x20delete\x20','Lock\x20scope\x20for\x20app\x20\x22','lockFilePath','scriptsRoot','appCode','remoteId','map','3ANTjZv','510Jypboy','295556RsEtbu','apps','high-risk-write','bff','projectRoot','trashedTo','Local\x20delete\x20not\x20settled\x20for\x20','12236SbybiM','startsWith','str','POST','\x20\x20-\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','replace','functions','239780gfHWSS','93423VFdFjF','scriptsRootDir','<timestamp>','delete','2168HAzmhG','stringify','trashDir','124556dbDBRn','parse','\x20(local\x20file\x20moved\x20to\x20trash)','7767KlBNmN','35mOrFSj','No\x20lock\x20entry\x20found\x20for\x20\x22','74532UDoHuH','target','length','BFF\x20lock\x20file\x20not\x20found.','lastSync','validation','toISOString','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','Function\x20not\x20found:\x20','Multiple\x20functions\x20match\x20\x22','/api/management/library/scripts/delete','split','join'];a31_0x1b10=function(){return _0x490e52;};return a31_0x1b10();}function a31_0x4f42(_0x320f31,_0x2788e9){_0x320f31=_0x320f31-0x7e;const _0x1b103f=a31_0x1b10();let _0x4f4217=_0x1b103f[_0x320f31];return _0x4f4217;}const a31_0x591153=a31_0x4f42;(function(_0x3459da,_0x28e421){const _0x103abf=a31_0x4f42,_0x5476a9=_0x3459da();while(!![]){try{const _0x162346=-parseInt(_0x103abf(0x88))/0x1+parseInt(_0x103abf(0x99))/0x2+parseInt(_0x103abf(0x7f))/0x3*(-parseInt(_0x103abf(0x81))/0x4)+-parseInt(_0x103abf(0x91))/0x5+-parseInt(_0x103abf(0x9f))/0x6*(-parseInt(_0x103abf(0x9d))/0x7)+-parseInt(_0x103abf(0x96))/0x8*(parseInt(_0x103abf(0x9c))/0x9)+parseInt(_0x103abf(0x80))/0xa*(parseInt(_0x103abf(0x92))/0xb);if(_0x162346===_0x28e421)break;else _0x5476a9['push'](_0x5476a9['shift']());}catch(_0x52016b){_0x5476a9['push'](_0x5476a9['shift']());}}}(a31_0x1b10,0x2e489));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_0x591153(0x84),'command':a31_0x591153(0x95),'description':a31_0x591153(0xa6),'risk':a31_0x591153(0x83),'flags':[{'name':'target','type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0xfabc2e){const _0x4967a8=a31_0x591153,_0x11a682=loadBffProjectConfig(_0xfabc2e[_0x4967a8(0xb1)]),_0x2349f3=await readBffLockFile(_0x11a682['lockFilePath']);if(!_0x2349f3)throw CliErrors[_0x4967a8(0xa4)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x151947){const _0x48281e=a31_0x591153,_0x2d904e=loadBffProjectConfig(_0x151947[_0x48281e(0xb1)]),_0xc0283a=await readBffLockFile(_0x2d904e['lockFilePath']);if(!_0xc0283a)throw CliErrors[_0x48281e(0xa4)](_0x48281e(0xa2));const {appLock:_0x430adc}=ensureLockScope(_0xc0283a,_0x151947[_0x48281e(0xb1)],_0x2d904e[_0x48281e(0xb0)],_0x48281e(0x95)),_0x2f83ef=_0x151947[_0x48281e(0x8a)](_0x48281e(0xa0)),_0x4c312b=Object[_0x48281e(0xac)](_0x430adc[_0x48281e(0x90)]),_0x11bda9=resolveDeleteTarget(_0x2f83ef,_0x4c312b),_0x285e8e=_0x430adc['functions'][_0x11bda9];if(!_0x285e8e)throw CliErrors[_0x48281e(0xa4)](_0x48281e(0x9e)+_0x11bda9+'\x22.');const _0x1a7392=resolveLocalFilePathFromLockKey(_0x2d904e,_0x11bda9),_0x1731ca=relative(_0x2d904e['projectRoot'],_0x1a7392),_0x38b9b9=join(_0x2d904e[_0x48281e(0x98)],_0x48281e(0x94),_0x1731ca);return{'method':_0x48281e(0x8b),'url':_0x48281e(0xa9),'body':{'appCode':_0x151947['appCode'],'target':_0x11bda9,'remoteId':_0x285e8e[_0x48281e(0xb2)],'localFilePath':_0x1a7392,'trashedPath':_0x38b9b9},'description':_0x48281e(0xad)+_0x11bda9+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x39c608){const _0x241b1f=a31_0x591153,_0x571400=loadBffProjectConfig(_0x39c608[_0x241b1f(0xb1)]),_0x2f4c24=await readBffLockFile(_0x571400['lockFilePath']);if(!_0x2f4c24)throw CliErrors[_0x241b1f(0xa4)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x17f747,appLock:_0x55673c}=ensureLockScope(_0x2f4c24,_0x39c608[_0x241b1f(0xb1)],_0x571400[_0x241b1f(0xb0)],_0x241b1f(0x95)),_0x9a3fae=JSON[_0x241b1f(0x9a)](JSON[_0x241b1f(0x97)](_0x17f747)),_0x5db9f2=_0x9a3fae[_0x241b1f(0x82)][_0x39c608['appCode']];if(!_0x5db9f2)throw new Error(_0x241b1f(0xae)+_0x39c608['appCode']+_0x241b1f(0x8d));const _0x3779ae=_0x39c608['str'](_0x241b1f(0xa0)),_0x9f1f23=Object[_0x241b1f(0xac)](_0x5db9f2['functions']),_0x4a02b6=resolveDeleteTarget(_0x3779ae,_0x9f1f23),_0x25ddd9=_0x5db9f2[_0x241b1f(0x90)][_0x4a02b6];if(!_0x25ddd9)throw CliErrors[_0x241b1f(0xa4)](_0x241b1f(0x9e)+_0x4a02b6+'\x22.');await deleteBffScript(_0x25ddd9[_0x241b1f(0xb2)]),delete _0x5db9f2['functions'][_0x4a02b6],_0x5db9f2[_0x241b1f(0xa3)]=new Date()['toISOString'](),await writeBffLockFile(_0x571400['lockFilePath'],_0x9a3fae);const _0x54f9c0=resolveLocalFilePathFromLockKey(_0x571400,_0x4a02b6);let _0x3b6700;await fileExists(_0x54f9c0)&&(_0x3b6700=await moveToTrash(_0x571400[_0x241b1f(0x85)],_0x571400[_0x241b1f(0x98)],_0x54f9c0),await cleanupEmptyDirectories(dirname(_0x54f9c0),_0x571400[_0x241b1f(0x93)]));await waitForDeleteSettlement(_0x571400[_0x241b1f(0xaf)],_0x39c608[_0x241b1f(0xb1)],_0x4a02b6,_0x54f9c0),await sleep(0x96);const _0x18ecf6={'deleted':_0x4a02b6,'remoteId':_0x25ddd9[_0x241b1f(0xb2)]};if(_0x3b6700)_0x18ecf6[_0x241b1f(0x86)]=_0x3b6700;return{'ok':!![],'data':_0x18ecf6,'message':'Deleted\x20'+_0x4a02b6+(_0x3b6700?_0x241b1f(0x9b):'')};}};function resolveDeleteTarget(_0x498052,_0x2844a6){const _0x74919c=a31_0x591153;if(_0x498052['includes']('/')){const _0x3cea1b=_0x2844a6['find'](_0x3d084f=>_0x3d084f===_0x498052);if(!_0x3cea1b)throw CliErrors[_0x74919c(0xa4)](_0x74919c(0xa7)+_0x498052);return _0x3cea1b;}const _0xae7b0a=_0x2844a6['filter'](_0x224d67=>_0x224d67[_0x74919c(0xaa)]('/')['at'](-0x1)===_0x498052);if(_0xae7b0a[_0x74919c(0xa1)]===0x0)throw CliErrors[_0x74919c(0xa4)]('Function\x20not\x20found:\x20'+_0x498052);if(_0xae7b0a[_0x74919c(0xa1)]>0x1)throw CliErrors[_0x74919c(0xa4)](_0x74919c(0xa8)+_0x498052+_0x74919c(0x8e)+_0xae7b0a[_0x74919c(0x7e)](_0xb2cf6f=>_0x74919c(0x8c)+_0xb2cf6f)[_0x74919c(0xab)]('\x0a'));return _0xae7b0a[0x0];}async function moveToTrash(_0x5bb1e2,_0x557e5b,_0x284e73){const _0x1fcb97=a31_0x591153,_0x5f2851=new Date()[_0x1fcb97(0xa5)]()[_0x1fcb97(0x8f)](/[:.]/g,'-'),_0x152195=relative(_0x5bb1e2,_0x284e73),_0x3149c6=join(_0x557e5b,_0x5f2851,_0x152195);return await mkdir(dirname(_0x3149c6),{'recursive':!![]}),await rename(_0x284e73,_0x3149c6),_0x3149c6;}async function cleanupEmptyDirectories(_0x5aed06,_0x4946c2){const _0x3577c4=a31_0x591153;let _0x206006=resolve(_0x5aed06);const _0x3a34e0=resolve(_0x4946c2);while(_0x206006[_0x3577c4(0x89)](''+_0x3a34e0+sep)||_0x206006===_0x3a34e0){if(_0x206006===_0x3a34e0)return;try{const _0x564dfd=await readdir(_0x206006);if(_0x564dfd[_0x3577c4(0xa1)]>0x0)return;await rmdir(_0x206006);}catch{return;}_0x206006=dirname(_0x206006);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x53d52b,_0x44e2c8,_0x4071c3,_0xfa0d23){const _0x433abf=a31_0x591153;for(let _0x4868f3=0x0;_0x4868f3<DELETE_SETTLE_RETRY_COUNT;_0x4868f3+=0x1){const _0x5cc90d=await readBffLockFile(_0x53d52b),_0x173b0b=!!_0x5cc90d?.[_0x433abf(0x82)]?.[_0x44e2c8]?.['functions']?.[_0x4071c3],_0x10fb60=await fileExists(_0xfa0d23);if(!_0x173b0b&&!_0x10fb60)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x433abf(0x87)+_0x4071c3+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a32_0x2551(_0x5587ee,_0x5c99e6){_0x5587ee=_0x5587ee-0x1ce;const _0x232d67=a32_0x232d();let _0x2551e5=_0x232d67[_0x5587ee];return _0x2551e5;}const a32_0xf1d5d7=a32_0x2551;(function(_0x3240de,_0xd0c8d3){const _0x46ec52=a32_0x2551,_0x5b41fc=_0x3240de();while(!![]){try{const _0x1d2a34=parseInt(_0x46ec52(0x1d8))/0x1+parseInt(_0x46ec52(0x1dc))/0x2+-parseInt(_0x46ec52(0x1e0))/0x3+-parseInt(_0x46ec52(0x1d1))/0x4*(parseInt(_0x46ec52(0x1df))/0x5)+-parseInt(_0x46ec52(0x1d3))/0x6+-parseInt(_0x46ec52(0x1e4))/0x7+parseInt(_0x46ec52(0x1de))/0x8;if(_0x1d2a34===_0xd0c8d3)break;else _0x5b41fc['push'](_0x5b41fc['shift']());}catch(_0x38e8d4){_0x5b41fc['push'](_0x5b41fc['shift']());}}}(a32_0x232d,0xd8592));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0xf1d5d7(0x1cf),'command':a32_0xf1d5d7(0x1db),'description':a32_0xf1d5d7(0x1e5),'risk':a32_0xf1d5d7(0x1dd),'flags':[{'name':'id','type':a32_0xf1d5d7(0x1d7),'required':!![],'description':a32_0xf1d5d7(0x1d0)},{'name':a32_0xf1d5d7(0x1d4),'type':a32_0xf1d5d7(0x1d2),'description':a32_0xf1d5d7(0x1d9)}],async 'execute'(_0x337fa7){const _0x28e98c=a32_0xf1d5d7,_0x17678d=await getBffScriptInfo(_0x337fa7[_0x28e98c(0x1d5)]('id')),_0x2ce81e=_0x337fa7[_0x28e98c(0x1ce)](_0x28e98c(0x1d4));if(_0x2ce81e)return{'ok':!![],'data':_0x17678d};return{'ok':!![],'data':{'id':_0x17678d['id'],'functionName':_0x17678d[_0x28e98c(0x1da)]??'','version':_0x17678d[_0x28e98c(0x1e2)]??'','updateUserName':_0x17678d['updateUserName']??'','appCode':_0x17678d[_0x28e98c(0x1d6)],'scriptType':_0x17678d['scriptType'],'description':_0x17678d['description']||_0x28e98c(0x1e1),'createdTime':_0x17678d['createdTime']??'','updatedTime':_0x17678d['updatedTime']??'','scriptContent':_0x17678d[_0x28e98c(0x1e3)]??''}};}};function a32_0x232d(){const _0x1a3065=['bool','bff','Script\x20ID','1993948HyCjFM','boolean','3798846XmtFpj','verbose','num','appCode','number','1205210CuOdwX','Return\x20full\x20raw\x20script\x20object','functionName','detail','841788NkQrnh','read','28677568fJkzZh','15vQaQkA','4228803gvlnYg','(none)','version','scriptContent','5505045VWHQvS','Get\x20BFF\x20script\x20details\x20by\x20ID'];a32_0x232d=function(){return _0x1a3065;};return a32_0x232d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2f72dd,_0xdd84){const _0x1f1282=a33_0x45aa,_0x3a8f9c=_0x2f72dd();while(!![]){try{const _0x13d5bf=-parseInt(_0x1f1282(0x99))/0x1+-parseInt(_0x1f1282(0x9e))/0x2+parseInt(_0x1f1282(0x9b))/0x3*(parseInt(_0x1f1282(0x96))/0x4)+parseInt(_0x1f1282(0x95))/0x5*(parseInt(_0x1f1282(0x9c))/0x6)+-parseInt(_0x1f1282(0x94))/0x7*(parseInt(_0x1f1282(0x9d))/0x8)+-parseInt(_0x1f1282(0x97))/0x9*(parseInt(_0x1f1282(0x9a))/0xa)+parseInt(_0x1f1282(0x98))/0xb*(parseInt(_0x1f1282(0x93))/0xc);if(_0x13d5bf===_0xdd84)break;else _0x3a8f9c['push'](_0x3a8f9c['shift']());}catch(_0xe9615d){_0x3a8f9c['push'](_0x3a8f9c['shift']());}}}(a33_0x5b46,0xa53f6));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a33_0x45aa(_0x2e6fbc,_0x4fe3f9){_0x2e6fbc=_0x2e6fbc-0x93;const _0x5b462c=a33_0x5b46();let _0x45aa0e=_0x5b462c[_0x2e6fbc];return _0x45aa0e;}function a33_0x5b46(){const _0x3d3168=['28PZVzec','21615Jfsbjf','4gbBSuT','838089SxTaDX','11kzlaxo','97551KaakUY','70cEuuyK','1931934dszbgw','798cuSrwc','2468488XNAXlo','573190tDdfip','20737848epGDRA'];a33_0x5b46=function(){return _0x3d3168;};return a33_0x5b46();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|