@lovrabet/rabetbase-cli 2.4.4-beta.1 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/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/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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
|
+
function a19_0x20e8(_0x17ef45,_0x182bb0){_0x17ef45=_0x17ef45-0x94;const _0x1bbe67=a19_0x1bbe();let _0x20e8bf=_0x1bbe67[_0x17ef45];return _0x20e8bf;}const a19_0xad0714=a19_0x20e8;(function(_0x27dafe,_0x39bc90){const _0x3aa3c2=a19_0x20e8,_0x1444e3=_0x27dafe();while(!![]){try{const _0x3ddcde=parseInt(_0x3aa3c2(0x9a))/0x1+-parseInt(_0x3aa3c2(0xb8))/0x2*(parseInt(_0x3aa3c2(0xb3))/0x3)+-parseInt(_0x3aa3c2(0xbe))/0x4*(parseInt(_0x3aa3c2(0xb6))/0x5)+-parseInt(_0x3aa3c2(0xaf))/0x6*(parseInt(_0x3aa3c2(0xbd))/0x7)+-parseInt(_0x3aa3c2(0xbc))/0x8*(parseInt(_0x3aa3c2(0x99))/0x9)+-parseInt(_0x3aa3c2(0x96))/0xa*(-parseInt(_0x3aa3c2(0xb1))/0xb)+parseInt(_0x3aa3c2(0xa3))/0xc;if(_0x3ddcde===_0x39bc90)break;else _0x1444e3['push'](_0x1444e3['shift']());}catch(_0x15902f){_0x1444e3['push'](_0x1444e3['shift']());}}}(a19_0x1bbe,0x9ca54));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a19_0x1bbe(){const _0xc18c41=['find','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','projectConfig','isCurrent','defaultApp','boolean','read','map','\x20in\x20','remote','object','666gzajpx','global','11OqYcnQ','entries','3mixRmF','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','projectPath','1270350eRdxwX','merged','2179820RYZCIQ','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','.\x20Use\x20`','bool','360JbSPgs','7910QUNgIE','4TxsmWZ','length','No\x20apps\x20configured','list','mergedCli','9013990kZUPxC','app','globalConfig','78579RpUvsX','1255136ukbOgy','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','inherit','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','apps','project','\x20config','globalPath','appcode','4168680BPzHjz'];a19_0x1bbe=function(){return _0xc18c41;};return a19_0x1bbe();}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(_0x12eabf,_0x5bb8b0){const _0x5340fb=a19_0x20e8,_0x150243=[],_0x4ac5ed=_0x12eabf['apps']&&typeof _0x12eabf[_0x5340fb(0x9e)]===_0x5340fb(0xae)?_0x12eabf[_0x5340fb(0x9e)]:{},_0x47b828=_0x12eabf[_0x5340fb(0xa8)]||undefined;for(const [_0x378500,_0x3b3054]of Object[_0x5340fb(0xb2)](_0x4ac5ed)){if(!_0x3b3054||typeof _0x3b3054!==_0x5340fb(0xae)||!_0x3b3054['appcode'])continue;_0x150243['push']({'name':_0x378500,'appcode':_0x3b3054[_0x5340fb(0xa2)],'named':!![],'definedIn':_0x5bb8b0,'isDefault':_0x378500===_0x47b828,...buildAppProfileListFields(_0x3b3054)});}return _0x150243;}function buildMergedItems(_0x298e6e,_0xa44e55){const _0x1d2c09=a19_0x20e8,{apps:apps={},defaultApp:_0x5efe0b}=_0x298e6e,_0x547fde=_0xa44e55[_0x1d2c09(0x98)][_0x1d2c09(0x9e)]&&typeof _0xa44e55['globalConfig'][_0x1d2c09(0x9e)]===_0x1d2c09(0xae)?_0xa44e55['globalConfig']['apps']:{},_0x4a46eb=_0xa44e55[_0x1d2c09(0xa6)][_0x1d2c09(0x9e)]&&typeof _0xa44e55[_0x1d2c09(0xa6)]['apps']===_0x1d2c09(0xae)?_0xa44e55['projectConfig']['apps']:{},_0x28e6e3=_0xa44e55[_0x1d2c09(0xa6)][_0x1d2c09(0x9c)]===![],_0x50b6f9=Object[_0x1d2c09(0xb2)](apps),_0x261722=_0x50b6f9[_0x1d2c09(0xab)](([_0x47e854,_0x1d9b58])=>({'name':_0x47e854,'appcode':_0x1d9b58[_0x1d2c09(0xa2)],'named':!![],'definedIn':appDefinedIn(_0x47e854,_0x547fde,_0x4a46eb,_0x28e6e3),'isDefault':_0x47e854===_0x5efe0b,...buildAppProfileListFields(_0x1d9b58)}));return _0x261722;}function validateAppListFlags(_0x5b3194){const _0xd90afc=a19_0x20e8;if(!_0x5b3194[_0xd90afc(0xbb)](_0xd90afc(0xad)))return;if(!_0x5b3194[_0xd90afc(0xbb)](_0xd90afc(0xb0))&&!_0x5b3194[_0xd90afc(0xbb)](_0xd90afc(0x9f)))return;throw CliErrors['validation'](_0xd90afc(0xb4),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x250dd4){const _0x524955=a19_0x20e8;validateAppListFlags(_0x250dd4);if(_0x250dd4[_0x524955(0xbb)]('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x250dd4)};const _0x53ec1b=_0x250dd4[_0x524955(0xbb)](_0x524955(0xb0)),_0xaf8bb6=_0x250dd4[_0x524955(0xbb)](_0x524955(0x9f)),_0x1a2fc9=_0x53ec1b?'global':_0xaf8bb6?_0x524955(0x9f):_0x524955(0xb7),{config:_0x166a52,layers:_0x46c079}=readRawConfigWithLayers(),_0x32ddf8=resolveDefaultAppSource(_0x46c079),{defaultApp:_0x15b31c}=_0x166a52;let _0x384369,_0x1cd015;switch(_0x1a2fc9){case _0x524955(0xb0):_0x384369=buildItemsFromLayer(_0x46c079['globalConfig'],_0x524955(0xb0)),_0x1cd015=_0x46c079[_0x524955(0xa1)];break;case _0x524955(0x9f):_0x384369=buildItemsFromLayer(_0x46c079['projectConfig'],_0x524955(0x9f)),_0x1cd015=_0x46c079['projectPath'];break;default:_0x384369=buildMergedItems(_0x166a52,_0x46c079);break;}enrichAppListItemsWithMergedSelection(_0x384369,_0x250dd4[_0x524955(0x95)]);if(_0x384369[_0x524955(0xbf)]===0x0){const _0x2b976c=_0x1a2fc9==='merged'?'':_0x524955(0xac)+_0x1a2fc9+_0x524955(0xa0);return{'ok':!![],'data':[],'message':_0x524955(0xc0)+_0x2b976c+_0x524955(0xba)+CLI_BIN_NAME+_0x524955(0xa5)};}const _0x138959=_0x384369[_0x524955(0xa4)](_0x50799c=>_0x50799c[_0x524955(0xa7)]===!![]),_0xa6d38d=_0x15b31c??_0x138959?.['appcode']??null,_0x3d6ebe=_0x1a2fc9===_0x524955(0xb7)?{'globalPath':_0x46c079[_0x524955(0xa1)]??null,'projectPath':_0x46c079[_0x524955(0xb5)]??null,'defaultApp':_0xa6d38d,'defaultAppSource':_0x15b31c!=null?_0x32ddf8:null}:{'scope':_0x1a2fc9,'configPath':_0x1cd015??null};return{'ok':!![],'data':{'items':_0x384369,'meta':_0x3d6ebe}};}export const appListDefinition={'service':a19_0xad0714(0x97),'command':a19_0xad0714(0x94),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a19_0xad0714(0xaa),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0xad0714(0xad),'type':a19_0xad0714(0xa9),'description':a19_0xad0714(0x9d),'default':![]},{'name':a19_0xad0714(0xb0),'type':a19_0xad0714(0xa9),'description':a19_0xad0714(0xb9),'default':![]},{'name':a19_0xad0714(0x9f),'type':'boolean','description':a19_0xad0714(0x9b),'default':![]}],async 'validate'(_0x316593){validateAppListFlags(_0x316593);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a20_0x5e96c6=a20_0x3712;function a20_0x1d0c(){const _0x3a37a1=['Found\x20','members-list','appCode','1317020kEykjH','app','164521oFsQHQ','569955GjPGTN','1355976bkzinP','List\x20application\x20members\x20with\x20their\x20role\x20memberships','length','23675pWavcr','14XVvVVi','5uesGmm','read','697530zTVUQk','56txiDBo','\x20application\x20member(s)','621252rvhkjx'];a20_0x1d0c=function(){return _0x3a37a1;};return a20_0x1d0c();}(function(_0x2d7284,_0x535f89){const _0x348410=a20_0x3712,_0x39611a=_0x2d7284();while(!![]){try{const _0x2fe103=-parseInt(_0x348410(0xc5))/0x1*(-parseInt(_0x348410(0xb4))/0x2)+-parseInt(_0x348410(0xc1))/0x3+-parseInt(_0x348410(0xba))/0x4*(parseInt(_0x348410(0xb5))/0x5)+-parseInt(_0x348410(0xb7))/0x6+parseInt(_0x348410(0xc0))/0x7*(parseInt(_0x348410(0xb8))/0x8)+parseInt(_0x348410(0xc2))/0x9+parseInt(_0x348410(0xbe))/0xa;if(_0x2fe103===_0x535f89)break;else _0x39611a['push'](_0x39611a['shift']());}catch(_0x841ca9){_0x39611a['push'](_0x39611a['shift']());}}}(a20_0x1d0c,0x24e13));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a20_0x3712(_0x526e6c,_0x512752){_0x526e6c=_0x526e6c-0xb4;const _0x1d0c2b=a20_0x1d0c();let _0x3712b1=_0x1d0c2b[_0x526e6c];return _0x3712b1;}export const appMembersListDefinition={'service':a20_0x5e96c6(0xbf),'command':a20_0x5e96c6(0xbc),'description':a20_0x5e96c6(0xc3),'risk':a20_0x5e96c6(0xb6),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x122b39){const _0x3c1040=a20_0x5e96c6,_0x514261=projectAppMembers(await listRoleUsers(_0x122b39[_0x3c1040(0xbd)]));return{'ok':!![],'data':{'appCode':_0x122b39[_0x3c1040(0xbd)],'items':_0x514261,'totalCount':_0x514261['length']},'message':_0x3c1040(0xbb)+_0x514261[_0x3c1040(0xc4)]+_0x3c1040(0xb9)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x149dd9,_0xbfacfa){const _0x13ba41=a21_0x304e,_0x21e35b=_0x149dd9();while(!![]){try{const _0x391be0=parseInt(_0x13ba41(0x1e8))/0x1+-parseInt(_0x13ba41(0x1f1))/0x2*(-parseInt(_0x13ba41(0x1ed))/0x3)+parseInt(_0x13ba41(0x1e3))/0x4+-parseInt(_0x13ba41(0x1e4))/0x5*(parseInt(_0x13ba41(0x1ec))/0x6)+parseInt(_0x13ba41(0x1ef))/0x7*(parseInt(_0x13ba41(0x1ee))/0x8)+parseInt(_0x13ba41(0x1e9))/0x9*(parseInt(_0x13ba41(0x1e5))/0xa)+-parseInt(_0x13ba41(0x1ea))/0xb*(parseInt(_0x13ba41(0x1f0))/0xc);if(_0x391be0===_0xbfacfa)break;else _0x21e35b['push'](_0x21e35b['shift']());}catch(_0x255f52){_0x21e35b['push'](_0x21e35b['shift']());}}}(a21_0x3bba,0x791f4));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';function a21_0x3bba(){const _0x590296=['25494MWEQVg','41752WifuCS','497WkEVck','216WuUykA','32zOltbh','3516168zgQPSz','295rofUiI','20XSZIKb','cookie','platform','773010slelSA','197217hHvzRf','735713JvGgrI','appDesc','51090mLlsmD'];a21_0x3bba=function(){return _0x590296;};return a21_0x3bba();}import{CliErrors}from'../../errors.js';function a21_0x304e(_0x133edf,_0x229f94){_0x133edf=_0x133edf-0x1e3;const _0x3bba94=a21_0x3bba();let _0x304efe=_0x3bba94[_0x133edf];return _0x304efe;}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x17cca0){const _0x48522d=a21_0x304e,_0x387cd5=_0x17cca0[_0x48522d(0x1e6)]||getCookie();if(!_0x387cd5)throw CliErrors['authRequired']();return _0x387cd5;}export async function listRemoteAppDirectory(_0x5b0503){const _0x21e76c=a21_0x304e,_0x693b9a=await withActiveCookie(resolveCookie(_0x5b0503),()=>listRemoteApps());return{'items':_0x693b9a['map'](_0x351224=>({..._0x351224['id']!=null?{'id':_0x351224['id']}:{},'appCode':_0x351224['appCode'],'appName':_0x351224['appName'],..._0x351224[_0x21e76c(0x1eb)]!=null?{'appDesc':_0x351224[_0x21e76c(0x1eb)]}:{}})),'meta':{'source':_0x21e76c(0x1e7)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18ba1e,_0x5b7cf0){const _0x57faa7=a22_0x5a87,_0x2d9924=_0x18ba1e();while(!![]){try{const _0xbf155e=-parseInt(_0x57faa7(0x1bf))/0x1*(parseInt(_0x57faa7(0x1a7))/0x2)+-parseInt(_0x57faa7(0x194))/0x3*(parseInt(_0x57faa7(0x19f))/0x4)+-parseInt(_0x57faa7(0x198))/0x5+-parseInt(_0x57faa7(0x1be))/0x6+parseInt(_0x57faa7(0x19c))/0x7+parseInt(_0x57faa7(0x1b5))/0x8*(parseInt(_0x57faa7(0x1c1))/0x9)+parseInt(_0x57faa7(0x1b4))/0xa*(parseInt(_0x57faa7(0x1b2))/0xb);if(_0xbf155e===_0x5b7cf0)break;else _0x2d9924['push'](_0x2d9924['shift']());}catch(_0x3b42c9){_0x2d9924['push'](_0x2d9924['shift']());}}}(a22_0x5524,0x70420));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x5486ec){const _0x5dc557=a22_0x5a87,_0x4104ec=_0x5486ec?.[_0x5dc557(0x195)]();return _0x4104ec?_0x4104ec:null;}export function projectAppMembers(_0xaaa7f1){const _0x597092=a22_0x5a87,_0xf2ba54=new Map(),_0x9f6419=[..._0xaaa7f1][_0x597092(0x196)]((_0x57962e,_0xdf5769)=>_0x57962e['id']-_0xdf5769['id']),_0x7d3417=(_0x4b7003,_0x1c37cb,_0x5ab8c4)=>{const _0x3d83c5=_0x597092;for(const _0x1c223b of _0x1c37cb){const _0x4d6d1b=Number(_0x1c223b[_0x3d83c5(0x1ae)]);if(!Number['isFinite'](_0x4d6d1b)||_0x4d6d1b<=0x0)continue;let _0x1eec18=_0xf2ba54[_0x3d83c5(0x1c2)](_0x4d6d1b);if(!_0x1eec18)_0x1eec18={'userId':_0x4d6d1b,'username':nullableText(_0x1c223b[_0x3d83c5(0x1a1)]),'displayName':nullableText(_0x1c223b[_0x3d83c5(0x1c0)]),'status':_0x5ab8c4,'roles':[],'roleKeys':new Set()},_0xf2ba54['set'](_0x4d6d1b,_0x1eec18);else{_0x1eec18['username']??=nullableText(_0x1c223b[_0x3d83c5(0x1a1)]),_0x1eec18[_0x3d83c5(0x1a3)]??=nullableText(_0x1c223b['nickname']);if(_0x5ab8c4===_0x3d83c5(0x1a2))_0x1eec18[_0x3d83c5(0x1bc)]=_0x3d83c5(0x1a2);}const _0xcf9931=_0x4b7003['id']+':'+_0x5ab8c4;if(_0x1eec18[_0x3d83c5(0x1b9)]['has'](_0xcf9931))continue;_0x1eec18['roleKeys'][_0x3d83c5(0x1c3)](_0xcf9931),_0x1eec18[_0x3d83c5(0x1c5)][_0x3d83c5(0x1b8)]({'roleId':_0x4b7003['id'],'roleName':nullableText(_0x4b7003[_0x3d83c5(0x1a0)]),'roleType':nullableText(_0x4b7003['roleType']),'membershipStatus':_0x5ab8c4});}};for(const _0x1ec202 of _0x9f6419){_0x7d3417(_0x1ec202,_0x1ec202[_0x597092(0x1ab)]??[],'ACTIVE'),_0x7d3417(_0x1ec202,_0x1ec202[_0x597092(0x1ba)]??[],_0x597092(0x199));}return[..._0xf2ba54['values']()][_0x597092(0x197)](_0x36d21c=>({'userId':_0x36d21c['userId'],'username':_0x36d21c[_0x597092(0x1a1)],'displayName':_0x36d21c[_0x597092(0x1a3)],'status':_0x36d21c[_0x597092(0x1bc)],'roles':_0x36d21c[_0x597092(0x1c5)]['sort']((_0x14afce,_0x4c56d9)=>_0x14afce[_0x597092(0x19d)]-_0x4c56d9[_0x597092(0x19d)]||(_0x14afce['membershipStatus']===_0x4c56d9[_0x597092(0x1bd)]?0x0:_0x14afce[_0x597092(0x1bd)]===_0x597092(0x1a2)?-0x1:0x1))}))[_0x597092(0x196)]((_0x305fb0,_0x42b97d)=>_0x305fb0[_0x597092(0x1ae)]-_0x42b97d[_0x597092(0x1ae)]);}export function enrichAppListItemsWithMergedSelection(_0x17d547,_0x5d3aef){const _0x4c47c7=a22_0x5a87;if(!_0x5d3aef)return;const _0x5a7bb2=_0x5d3aef[_0x4c47c7(0x1ad)]&&typeof _0x5d3aef['apps']===_0x4c47c7(0x1c6)?_0x5d3aef[_0x4c47c7(0x1ad)]:{},_0x31884a=Object[_0x4c47c7(0x19e)](_0x5a7bb2)[_0x4c47c7(0x1ac)]>0x0;for(const _0x5c58f8 of _0x17d547){_0x5c58f8[_0x4c47c7(0x1a5)]=![];}const _0x420819=_0x5d3aef[_0x4c47c7(0x1b7)]!=null?String(_0x5d3aef['appCode'])[_0x4c47c7(0x195)]():'';if(_0x31884a){const _0x4bcf0a=_0x5d3aef[_0x4c47c7(0x1b6)]??_0x5d3aef[_0x4c47c7(0x19b)];if(_0x4bcf0a)for(const _0x1dbb74 of _0x17d547){_0x1dbb74[_0x4c47c7(0x19a)]===!![]&&_0x1dbb74[_0x4c47c7(0x1aa)]===_0x4bcf0a&&(_0x1dbb74[_0x4c47c7(0x1a5)]=!![]);}for(const _0x2ba336 of _0x17d547){if(_0x2ba336[_0x4c47c7(0x19a)]!==![])continue;if(_0x5d3aef[_0x4c47c7(0x19b)])continue;_0x420819&&String(_0x2ba336[_0x4c47c7(0x1a4)]??'')[_0x4c47c7(0x195)]()===_0x420819&&(_0x2ba336[_0x4c47c7(0x1a5)]=!![]);}return;}if(!_0x420819)return;for(const _0xa7dbc1 of _0x17d547){String(_0xa7dbc1[_0x4c47c7(0x1a4)]??'')[_0x4c47c7(0x195)]()===_0x420819&&(_0xa7dbc1[_0x4c47c7(0x1a5)]=!![]);}}export function resolveAppScopeForWrite(_0x4d315b,_0x4367ee,_0x18821e){const _0x288c63=a22_0x5a87;if(_0x4367ee)return _0x288c63(0x1b3);const _0x377714=_0x18821e[_0x288c63(0x1af)]['apps']&&typeof _0x18821e[_0x288c63(0x1af)][_0x288c63(0x1ad)]===_0x288c63(0x1c6)?_0x18821e['projectConfig']['apps']:{},_0x334ba9=_0x18821e['globalConfig'][_0x288c63(0x1ad)]&&typeof _0x18821e[_0x288c63(0x1a8)][_0x288c63(0x1ad)]==='object'?_0x18821e['globalConfig']['apps']:{};if(Object[_0x288c63(0x1c4)][_0x288c63(0x1a9)][_0x288c63(0x1c7)](_0x377714,_0x4d315b))return'project';if(Object[_0x288c63(0x1c4)][_0x288c63(0x1a9)]['call'](_0x334ba9,_0x4d315b))return'global';return _0x288c63(0x1b1);}export function appDefinedIn(_0x53e96b,_0x53fe93,_0x29d2d5,_0x4dca9e){const _0x219d3c=a22_0x5a87;if(_0x4dca9e)return Object[_0x219d3c(0x1c4)][_0x219d3c(0x1a9)]['call'](_0x29d2d5,_0x53e96b)?_0x219d3c(0x1b1):_0x219d3c(0x1b3);const _0x270b24=Object[_0x219d3c(0x1c4)][_0x219d3c(0x1a9)][_0x219d3c(0x1c7)](_0x53fe93,_0x53e96b),_0x34d2b1=Object[_0x219d3c(0x1c4)][_0x219d3c(0x1a9)][_0x219d3c(0x1c7)](_0x29d2d5,_0x53e96b);if(_0x270b24&&_0x34d2b1)return _0x219d3c(0x1b0);if(_0x34d2b1)return _0x219d3c(0x1b1);return'global';}export function resolveDefaultAppSource(_0x4e33a9){const _0x187e36=a22_0x5a87,_0x4ebf52=_0x4e33a9[_0x187e36(0x1af)][_0x187e36(0x1ad)]&&typeof _0x4e33a9[_0x187e36(0x1af)][_0x187e36(0x1ad)]===_0x187e36(0x1c6)?_0x4e33a9[_0x187e36(0x1af)][_0x187e36(0x1ad)]:{};if(_0x187e36(0x19b)in _0x4e33a9[_0x187e36(0x1af)])return'project';if(Object[_0x187e36(0x19e)](_0x4ebf52)[_0x187e36(0x1ac)]>0x0)return _0x187e36(0x1b1);if(_0x4e33a9[_0x187e36(0x1af)][_0x187e36(0x1bb)]===![])return null;if(_0x4e33a9['globalConfig']['defaultApp'])return _0x187e36(0x1b3);return null;}function a22_0x5a87(_0x2a35d4,_0x5520c4){_0x2a35d4=_0x2a35d4-0x194;const _0x552455=a22_0x5524();let _0x5a873b=_0x552455[_0x2a35d4];return _0x5a873b;}export function getConfigPath(_0x2f1bdb={}){const _0x2385c7=a22_0x5a87,_0x28e343=_0x2f1bdb[_0x2385c7(0x1b3)]?_0x2385c7(0x1b3):_0x2385c7(0x1b1);return resolveWriteConfigPath(_0x28e343);}function a22_0x5524(){const _0x5b3059=['hasOwnProperty','name','userList','length','apps','userId','projectConfig','both','project','33AcHiDR','global','327010NBWgqd','426168ZOzRDx','currentApp','appCode','push','roleKeys','applyUserList','inherit','status','membershipStatus','1094856HWFsCs','1RkuqIX','nickname','144pZbEHC','get','add','prototype','roles','object','call','21prJHzf','trim','sort','map','1929810BXYxgg','PENDING','named','defaultApp','6359129VlHTph','roleId','keys','338248ZHsuRe','roleName','username','ACTIVE','displayName','appcode','isCurrent','\x20(global)','477412fcNjLP','globalConfig'];a22_0x5524=function(){return _0x5b3059;};return a22_0x5524();}export function readConfig(_0x27c8bc={}){return readConfigFile(getConfigPath(_0x27c8bc));}export function writeConfig(_0x30e1be,_0x94c3c1={}){writeConfigFile(getConfigPath(_0x94c3c1),_0x30e1be);}export function scopeLabel(_0x387bf6){const _0x475d3f=a22_0x5a87;return _0x387bf6[_0x475d3f(0x1b3)]?_0x475d3f(0x1a6):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x1929(){const _0x1e2ec9=['appCode','appCode:\x20','7826994jCkgtm','isFinite','21CdFuyS','App\x20config\x20server\x20id\x20missing\x20for\x20key=','apiError','9397335jqanxr','1025016zHWhET','POST','66966lqlPrO','delete','number','16LFpuaQ','validation','App\x20config\x20key\x20not\x20found:\x20','Deleted\x20app\x20config\x20','69353000wdDyOE',',\x20appCode=','high-risk-write','Delete\x20one\x20runtime\x20app-config\x20key','542444VTqGRz','21fsPGye','430870trnxlD'];a23_0x1929=function(){return _0x1e2ec9;};return a23_0x1929();}const a23_0x53841f=a23_0x42c7;(function(_0x3f68de,_0x5ebd3e){const _0x3c7446=a23_0x42c7,_0x1118ca=_0x3f68de();while(!![]){try{const _0x2076c2=-parseInt(_0x3c7446(0x1e7))/0x1+parseInt(_0x3c7446(0x1de))/0x2*(-parseInt(_0x3c7446(0x1dd))/0x3)+parseInt(_0x3c7446(0x1dc))/0x4+-parseInt(_0x3c7446(0x1e6))/0x5+-parseInt(_0x3c7446(0x1d1))/0x6*(-parseInt(_0x3c7446(0x1e3))/0x7)+parseInt(_0x3c7446(0x1d4))/0x8*(-parseInt(_0x3c7446(0x1e1))/0x9)+parseInt(_0x3c7446(0x1d8))/0xa;if(_0x2076c2===_0x5ebd3e)break;else _0x1118ca['push'](_0x1118ca['shift']());}catch(_0x46abd5){_0x1118ca['push'](_0x1118ca['shift']());}}}(a23_0x1929,0xe88d6));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';function a23_0x42c7(_0x1d1f2e,_0xd15dc9){_0x1d1f2e=_0x1d1f2e-0x1d1;const _0x1929c9=a23_0x1929();let _0x42c770=_0x1929c9[_0x1d1f2e];return _0x42c770;}export const appConfigDelete={'service':'app-config','command':a23_0x53841f(0x1d2),'description':a23_0x53841f(0x1db),'risk':a23_0x53841f(0x1da),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3128a0){readKeyArg(_0x3128a0);},async 'dryRun'(_0x4cc5f0){const _0x375096=a23_0x53841f,_0xfcb8a5=readKeyArg(_0x4cc5f0),_0x2577cb=await mustGetByKey(_0x4cc5f0[_0x375096(0x1df)],_0xfcb8a5);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x4cc5f0[_0x375096(0x1df)],'key':_0xfcb8a5,'before':projectAppConfig(_0x2577cb),'after':null,'dryRun':!![]}),{'method':_0x375096(0x1e8),'url':DELETE_PATH});},async 'execute'(_0x2bbeac){const _0x414c53=a23_0x53841f,_0x272684=readKeyArg(_0x2bbeac),_0x568b6c=await mustGetByKey(_0x2bbeac[_0x414c53(0x1df)],_0x272684);return await withAppConfigApiBoundary(_0x414c53(0x1d2),{'appCode':_0x2bbeac['appCode'],'key':_0x272684},()=>deleteAppConfig({'appCode':_0x2bbeac[_0x414c53(0x1df)],'id':requireAppConfigId(_0x568b6c,_0x272684,_0x2bbeac[_0x414c53(0x1df)])})),{'ok':!![],'data':buildMutationData({'operation':_0x414c53(0x1d2),'appCode':_0x2bbeac[_0x414c53(0x1df)],'key':_0x272684,'before':projectAppConfig(_0x568b6c),'after':null,'dryRun':![]}),'message':_0x414c53(0x1d7)+_0x272684};}};async function mustGetByKey(_0x2679d8,_0x3b9ece){const _0x58e5a3=a23_0x53841f,_0x1dc529=await withAppConfigApiBoundary('get',{'appCode':_0x2679d8,'key':_0x3b9ece},()=>getAppConfigByKey(_0x2679d8,_0x3b9ece));if(!_0x1dc529)throw CliErrors[_0x58e5a3(0x1d5)](_0x58e5a3(0x1d6)+_0x3b9ece,_0x58e5a3(0x1e0)+_0x2679d8);return _0x1dc529;}function requireAppConfigId(_0x3f1018,_0x26e608,_0x5c8fa0){const _0x8e4c21=a23_0x53841f;if(typeof _0x3f1018['id']===_0x8e4c21(0x1d3)&&Number[_0x8e4c21(0x1e2)](_0x3f1018['id'])&&_0x3f1018['id']>0x0)return _0x3f1018['id'];throw CliErrors[_0x8e4c21(0x1e5)](_0x8e4c21(0x1e4)+_0x26e608+_0x8e4c21(0x1d9)+_0x5c8fa0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xa17269=a24_0x289a;(function(_0xcf40c0,_0x5601b2){const _0x37b9fe=a24_0x289a,_0x599a10=_0xcf40c0();while(!![]){try{const _0x250aff=parseInt(_0x37b9fe(0x9f))/0x1+-parseInt(_0x37b9fe(0xa5))/0x2+-parseInt(_0x37b9fe(0xab))/0x3*(parseInt(_0x37b9fe(0xac))/0x4)+-parseInt(_0x37b9fe(0xa9))/0x5*(parseInt(_0x37b9fe(0xa0))/0x6)+parseInt(_0x37b9fe(0xb2))/0x7+parseInt(_0x37b9fe(0xa8))/0x8*(parseInt(_0x37b9fe(0xae))/0x9)+parseInt(_0x37b9fe(0xb5))/0xa*(parseInt(_0x37b9fe(0xb4))/0xb);if(_0x250aff===_0x5601b2)break;else _0x599a10['push'](_0x599a10['shift']());}catch(_0x5a020c){_0x599a10['push'](_0x599a10['shift']());}}}(a24_0xd3ce,0x7357f));import{getAppConfigByKey}from'../../core/api-client.js';function a24_0x289a(_0x3fb38e,_0x5d6ab6){_0x3fb38e=_0x3fb38e-0x9f;const _0xd3cea4=a24_0xd3ce();let _0x289ac3=_0xd3cea4[_0x3fb38e];return _0x289ac3;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a24_0xd3ce(){const _0x5693b1=['348051xJewLq','6LZdDyw','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','validation','get','app-config','1871380fYXbBT','\x20with\x20value\x20revealed','Loaded\x20app\x20config\x20','8GLebuu','1437690vSVumg','reveal','75ejmTkS','60752vuZIrK','\x20with\x20value\x20redacted','1093104pIQVIH','read','App\x20config\x20key\x20not\x20found:\x20','appCode','1541869pWfdom','appCode:\x20','231PkvSuk','659810MQjAnB'];a24_0xd3ce=function(){return _0x5693b1;};return a24_0xd3ce();}export const appConfigGet={'service':a24_0xa17269(0xa4),'command':a24_0xa17269(0xa3),'description':a24_0xa17269(0xa1),'risk':a24_0xa17269(0xaf),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x40b522){readKeyArg(_0x40b522);},async 'execute'(_0x535a3d){const _0x43cd2c=a24_0xa17269,_0x4d053e=readKeyArg(_0x535a3d),_0x122073=await withAppConfigApiBoundary(_0x43cd2c(0xa3),{'appCode':_0x535a3d[_0x43cd2c(0xb1)],'key':_0x4d053e},()=>getAppConfigByKey(_0x535a3d[_0x43cd2c(0xb1)],_0x4d053e));if(!_0x122073)throw CliErrors[_0x43cd2c(0xa2)](_0x43cd2c(0xb0)+_0x4d053e,_0x43cd2c(0xb3)+_0x535a3d[_0x43cd2c(0xb1)]);const _0x4e36bf=projectAppConfig(_0x122073,{'reveal':_0x535a3d['bool'](_0x43cd2c(0xaa))});return{'ok':!![],'data':{'config':_0x4e36bf},'message':_0x535a3d['bool']('reveal')?_0x43cd2c(0xa7)+_0x4d053e+_0x43cd2c(0xa6):_0x43cd2c(0xa7)+_0x4d053e+_0x43cd2c(0xad)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x2088(){const _0x3b0bba=['2093727BLZXcU','953250doFLDG','1836870rTazFg','673300BXpmRM','4EnHgqB','3746094EQKPaN','19363760GWkggh','128118GExHxf'];a25_0x2088=function(){return _0x3b0bba;};return a25_0x2088();}(function(_0x244d84,_0x270387){const _0x3aea6b=a25_0x3cbf,_0x46750a=_0x244d84();while(!![]){try{const _0x1f2ca9=-parseInt(_0x3aea6b(0x1f1))/0x1+parseInt(_0x3aea6b(0x1f5))/0x2+parseInt(_0x3aea6b(0x1f6))/0x3*(-parseInt(_0x3aea6b(0x1f2))/0x4)+parseInt(_0x3aea6b(0x1f7))/0x5+-parseInt(_0x3aea6b(0x1f3))/0x6+-parseInt(_0x3aea6b(0x1f0))/0x7+parseInt(_0x3aea6b(0x1f4))/0x8;if(_0x1f2ca9===_0x270387)break;else _0x46750a['push'](_0x46750a['shift']());}catch(_0x3838ec){_0x46750a['push'](_0x46750a['shift']());}}}(a25_0x2088,0x65dbb));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';function a25_0x3cbf(_0x36ebfc,_0xe84cb2){_0x36ebfc=_0x36ebfc-0x1f0;const _0x208815=a25_0x2088();let _0x3cbf80=_0x208815[_0x36ebfc];return _0x3cbf80;}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a26_0x46fa(_0x219c34,_0xf7cb2a){_0x219c34=_0x219c34-0xad;const _0x1eb106=a26_0x1eb1();let _0x46fa5a=_0x1eb106[_0x219c34];return _0x46fa5a;}const a26_0x1f1b78=a26_0x46fa;(function(_0x59e24f,_0x17078f){const _0x539630=a26_0x46fa,_0x1cc744=_0x59e24f();while(!![]){try{const _0x55f168=-parseInt(_0x539630(0xae))/0x1*(-parseInt(_0x539630(0xc2))/0x2)+parseInt(_0x539630(0xbe))/0x3*(-parseInt(_0x539630(0xbc))/0x4)+-parseInt(_0x539630(0xb0))/0x5+parseInt(_0x539630(0xc4))/0x6*(parseInt(_0x539630(0xc0))/0x7)+-parseInt(_0x539630(0xb8))/0x8+parseInt(_0x539630(0xbf))/0x9*(-parseInt(_0x539630(0xad))/0xa)+parseInt(_0x539630(0xc5))/0xb*(parseInt(_0x539630(0xb6))/0xc);if(_0x55f168===_0x17078f)break;else _0x1cc744['push'](_0x1cc744['shift']());}catch(_0x3884de){_0x1cc744['push'](_0x1cc744['shift']());}}}(a26_0x1eb1,0x6b072));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a26_0x1f1b78(0xb2),'command':a26_0x1f1b78(0xbd),'description':a26_0x1f1b78(0xc3),'risk':a26_0x1f1b78(0xb3),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':a26_0x1f1b78(0xb9),'description':a26_0x1f1b78(0xb1)},TAGS_FLAG],async 'validate'(_0x14a79f){const _0x54a798=a26_0x1f1b78,_0x95438b=_0x14a79f[_0x54a798(0xba)](_0x54a798(0xb4))[_0x54a798(0xc1)]();if(_0x95438b)validateKey(_0x95438b);readOptionalTags(_0x14a79f);},async 'execute'(_0x53ab90){const _0x2f4b0e=a26_0x1f1b78,_0x1a5142=_0x53ab90[_0x2f4b0e(0xba)]('key')[_0x2f4b0e(0xc1)]()||undefined,_0x1a5a7f=readOptionalTags(_0x53ab90),_0x3ec03b=await withAppConfigApiBoundary(_0x2f4b0e(0xbd),{'appCode':_0x53ab90[_0x2f4b0e(0xbb)]},()=>listAppConfigs(_0x53ab90[_0x2f4b0e(0xbb)],{'key':_0x1a5142,'tags':_0x1a5a7f})),_0x4d7a6c=_0x3ec03b['map'](_0x4bab7b=>projectAppConfig(_0x4bab7b));return{'ok':!![],'data':{'appCode':_0x53ab90[_0x2f4b0e(0xbb)],'count':_0x4d7a6c[_0x2f4b0e(0xb7)],'configs':_0x4d7a6c},'message':_0x2f4b0e(0xb5)+_0x4d7a6c[_0x2f4b0e(0xb7)]+_0x2f4b0e(0xaf)};}};function a26_0x1eb1(){const _0x6ef4de=['177318fTXapL','11DHOfsW','32440FAEXfc','76063kQohUv','\x20app\x20config(s)','3333450OFAflg','Filter\x20by\x20exact\x20config\x20key','app-config','read','key','Found\x20','14025372NLJFiB','length','1051864ZcJNor','string','str','appCode','4jGWMSd','list','365289slEPgb','1161txOmlV','126ldwMOm','trim','2jnrMsn','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values'];a26_0x1eb1=function(){return _0x6ef4de;};return a26_0x1eb1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x45ca28=a27_0x4162;function a27_0x2867(){const _0x45dbf0=['number','/smartapi/app-config/create','4185290OtIDWi','appCode','7cxNupk','10064Dmjleo','1279770uBCGnG','Read\x20config\x20value\x20from\x20file','2097VIveYs','App\x20config\x20server\x20id\x20missing\x20for\x20key=','\x20app\x20config\x20','150aDQsVZ','tags','6298848xhiWXZ','create','string','Updated','1670ZAZjZW','18682644GTMEqp','get','8smllls','file','11RqqWpL','/smartapi/app-config/update','2724328SjOTSw','update','write','app-config'];a27_0x2867=function(){return _0x45dbf0;};return a27_0x2867();}(function(_0x180b8e,_0x1fd66e){const _0x1963e9=a27_0x4162,_0x2c9d13=_0x180b8e();while(!![]){try{const _0x49e5e6=parseInt(_0x1963e9(0x1f9))/0x1*(-parseInt(_0x1963e9(0x1ff))/0x2)+parseInt(_0x1963e9(0x1fa))/0x3*(-parseInt(_0x1963e9(0x1ec))/0x4)+-parseInt(_0x1963e9(0x1f6))/0x5+parseInt(_0x1963e9(0x1e5))/0x6+-parseInt(_0x1963e9(0x1f8))/0x7*(-parseInt(_0x1963e9(0x1f0))/0x8)+parseInt(_0x1963e9(0x1fc))/0x9*(parseInt(_0x1963e9(0x1e9))/0xa)+-parseInt(_0x1963e9(0x1ee))/0xb*(-parseInt(_0x1963e9(0x1ea))/0xc);if(_0x49e5e6===_0x1fd66e)break;else _0x2c9d13['push'](_0x2c9d13['shift']());}catch(_0x17eea6){_0x2c9d13['push'](_0x2c9d13['shift']());}}}(a27_0x2867,0x841b5));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a27_0x45ca28(0x1f5),UPDATE_PATH=a27_0x45ca28(0x1ef);function a27_0x4162(_0x3a88b0,_0x86f574){_0x3a88b0=_0x3a88b0-0x1e5;const _0x2867cc=a27_0x2867();let _0x41624e=_0x2867cc[_0x3a88b0];return _0x41624e;}export const appConfigSet={'service':a27_0x45ca28(0x1f3),'command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x45ca28(0x1f2),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x45ca28(0x1ed),'type':a27_0x45ca28(0x1e7),'description':a27_0x45ca28(0x1fb)}],async 'validate'(_0x342474){readKeyArg(_0x342474),readOptionalTags(_0x342474),assertSingleValueSource(_0x342474);},async 'dryRun'(_0x504f4f){const _0x43bf8d=a27_0x45ca28,_0x7a408a=readKeyArg(_0x504f4f),_0x418817=readOptionalTags(_0x504f4f),_0x2260ff=assertSingleValueSource(_0x504f4f);await assertValueSourceReadable(_0x2260ff);const _0x262545=await withAppConfigApiBoundary(_0x43bf8d(0x1eb),{'appCode':_0x504f4f[_0x43bf8d(0x1f7)],'key':_0x7a408a},()=>getAppConfigByKey(_0x504f4f[_0x43bf8d(0x1f7)],_0x7a408a)),_0x6e543=_0x262545?_0x43bf8d(0x1f1):_0x43bf8d(0x1e6),_0xf9010f=_0x262545?projectAppConfig(_0x262545):null,_0x10f361=plannedAppConfig({'appCode':_0x504f4f['appCode'],'key':_0x7a408a,'tags':_0x418817??_0x262545?.[_0x43bf8d(0x200)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x6e543,'appCode':_0x504f4f[_0x43bf8d(0x1f7)],'key':_0x7a408a,'before':_0xf9010f,'after':_0x10f361,'dryRun':!![]}),{'method':'POST','url':_0x6e543===_0x43bf8d(0x1f1)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4146dc){const _0x189a8b=a27_0x45ca28,_0x39964f=readKeyArg(_0x4146dc),_0x2ebd91=readOptionalTags(_0x4146dc),_0x41f846=await withAppConfigApiBoundary(_0x189a8b(0x1eb),{'appCode':_0x4146dc[_0x189a8b(0x1f7)],'key':_0x39964f},()=>getAppConfigByKey(_0x4146dc[_0x189a8b(0x1f7)],_0x39964f)),_0x20bfed=_0x41f846?projectAppConfig(_0x41f846):null,_0x5600c0=_0x41f846?_0x189a8b(0x1f1):'create',{value:_0x54bee7,warnings:_0x1652d3}=await readAppConfigValue(_0x4146dc),_0x24893b={'appCode':_0x4146dc[_0x189a8b(0x1f7)],'key':_0x39964f,'value':_0x54bee7,'tags':_0x2ebd91??_0x41f846?.[_0x189a8b(0x200)]??undefined};await withAppConfigApiBoundary(_0x5600c0,{'appCode':_0x4146dc[_0x189a8b(0x1f7)],'key':_0x39964f},async()=>{const _0x2381dc=_0x189a8b;_0x41f846?await updateAppConfig({..._0x24893b,'id':requireAppConfigId(_0x41f846,_0x39964f,_0x4146dc[_0x2381dc(0x1f7)])}):await createAppConfig(_0x24893b);});const _0x33393b=await withAppConfigApiBoundary('get',{'appCode':_0x4146dc[_0x189a8b(0x1f7)],'key':_0x39964f},()=>getAppConfigByKey(_0x4146dc[_0x189a8b(0x1f7)],_0x39964f)),_0x44e163=_0x33393b?projectAppConfig(_0x33393b):plannedAppConfig({'appCode':_0x4146dc['appCode'],'key':_0x39964f,'tags':_0x24893b[_0x189a8b(0x200)],'hasValue':_0x54bee7!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x5600c0,'appCode':_0x4146dc[_0x189a8b(0x1f7)],'key':_0x39964f,'before':_0x20bfed,'after':_0x44e163,'dryRun':![],'warnings':_0x1652d3}),'message':(_0x5600c0===_0x189a8b(0x1f1)?_0x189a8b(0x1e8):'Created')+_0x189a8b(0x1fe)+_0x39964f};}};function requireAppConfigId(_0x6559b8,_0x5ca043,_0x1a2252){const _0xbd524f=a27_0x45ca28;if(typeof _0x6559b8['id']===_0xbd524f(0x1f4)&&Number['isFinite'](_0x6559b8['id'])&&_0x6559b8['id']>0x0)return _0x6559b8['id'];throw CliErrors['apiError'](_0xbd524f(0x1fd)+_0x5ca043+',\x20appCode='+_0x1a2252);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x24d80d=a28_0xd413;(function(_0x5550c9,_0x353a34){const _0xeb4ae=a28_0xd413,_0x20af3c=_0x5550c9();while(!![]){try{const _0x50c792=-parseInt(_0xeb4ae(0x95))/0x1+parseInt(_0xeb4ae(0xb2))/0x2*(parseInt(_0xeb4ae(0xbe))/0x3)+-parseInt(_0xeb4ae(0xb3))/0x4+-parseInt(_0xeb4ae(0x9a))/0x5*(-parseInt(_0xeb4ae(0xba))/0x6)+parseInt(_0xeb4ae(0xb5))/0x7+-parseInt(_0xeb4ae(0xa4))/0x8+-parseInt(_0xeb4ae(0xb1))/0x9*(parseInt(_0xeb4ae(0xbc))/0xa);if(_0x50c792===_0x353a34)break;else _0x20af3c['push'](_0x20af3c['shift']());}catch(_0x17c92c){_0x20af3c['push'](_0x20af3c['shift']());}}}(a28_0x1626,0xd1bd3));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x24d80d(0xb4),'description':a28_0x24d80d(0xa1),'required':!![]};export const VALUE_ARG={'name':'value','description':a28_0x24d80d(0xa6),'required':![]};export const TAGS_FLAG={'name':a28_0x24d80d(0x90),'type':a28_0x24d80d(0xcc),'description':a28_0x24d80d(0x94)};export const STDIN_FLAG={'name':a28_0x24d80d(0xa9),'type':a28_0x24d80d(0xa8),'description':a28_0x24d80d(0xaf),'default':![]};function a28_0x1626(){const _0xe119fc=['apiError','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','7609016UUAIXA','Missing\x20app-config\x20key.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','value\x20is\x20redacted','boolean','stdin','name','gmtCreate','once','method','args','Read\x20config\x20value\x20from\x20stdin','kind','9ZYJWwp','110038xVoaFd','3963144RxoBEC','key','8458373vmfFDM','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','\x20app\x20config.','hasValue','data','12xDIica','push','661690SvHriu','gmtModified','75ERreHv','value','Environment\x20variable\x20is\x20not\x20set:\x20','length','end','Missing\x20app-config\x20value\x20source.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','warnings','from-env','operation','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Value\x20file\x20is\x20not\x20readable:\x20','appCode','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','string','after','utf8','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','join','flag','argument','url','file','reveal','tags','str','trim','error','Config\x20tags\x20for\x20filtering/display\x20metadata','1000771AzaBef','before','dryRun','validation','valueRedacted','3210325rdCwBf','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','bool','slice','env','path','App\x20config\x20value\x20source\x20is\x20ambiguous.','Runtime\x20app-config\x20key'];a28_0x1626=function(){return _0xe119fc;};return a28_0x1626();}export const FROM_ENV_FLAG={'name':'from-env','type':'string','description':a28_0x24d80d(0xcf)};export const REVEAL_FLAG={'name':a28_0x24d80d(0x8f),'type':a28_0x24d80d(0xa8),'description':a28_0x24d80d(0x9b),'default':![]};export function readKeyArg(_0x2f9ab1){const _0x2992b5=a28_0x24d80d,_0x5bd5c9=_0x2f9ab1[_0x2992b5(0xae)][0x0]?.[_0x2992b5(0x92)]()??'';return validateKey(_0x5bd5c9),_0x5bd5c9;}export function readOptionalTags(_0x48f448){const _0x5a6be3=a28_0x24d80d,_0x35e05a=_0x48f448[_0x5a6be3(0x91)]('tags')['trim']();if(!_0x35e05a)return undefined;if(_0x35e05a[_0x5a6be3(0xc1)]>0x20)throw CliErrors[_0x5a6be3(0x98)](_0x5a6be3(0xa3));return _0x35e05a;}function a28_0xd413(_0x313af2,_0xa6783d){_0x313af2=_0x313af2-0x8d;const _0x162636=a28_0x1626();let _0xd413bc=_0x162636[_0x313af2];return _0xd413bc;}export function validateKey(_0x435d21){const _0x266f89=a28_0x24d80d;if(!_0x435d21)throw CliErrors[_0x266f89(0x98)](_0x266f89(0xa5));if(_0x435d21[_0x266f89(0xc1)]>0x100)throw CliErrors[_0x266f89(0x98)](_0x266f89(0xb6));}export function projectAppConfig(_0x14fe94,_0x17d05c){const _0xc4ab00=a28_0x24d80d,_0x36472f=_0x14fe94[_0xc4ab00(0xbf)]!==undefined&&_0x14fe94[_0xc4ab00(0xbf)]!==null&&_0x14fe94[_0xc4ab00(0xbf)]!=='',_0x2cc2fb={'appCode':_0x14fe94[_0xc4ab00(0xca)],'key':_0x14fe94[_0xc4ab00(0xb4)],'tags':_0x14fe94[_0xc4ab00(0x90)]??undefined,'hasValue':_0x36472f,'valueRedacted':_0x36472f&&!_0x17d05c?.[_0xc4ab00(0x8f)],'gmtCreate':_0x14fe94[_0xc4ab00(0xab)],'gmtModified':_0x14fe94[_0xc4ab00(0xbd)]};return _0x17d05c?.[_0xc4ab00(0x8f)]&&(_0x2cc2fb[_0xc4ab00(0xbf)]=_0x14fe94[_0xc4ab00(0xbf)]??'',_0x2cc2fb[_0xc4ab00(0x99)]=![]),_0x2cc2fb;}export function plannedAppConfig(_0x5e1245){const _0x3cc410=a28_0x24d80d,_0x28b91a=_0x5e1245[_0x3cc410(0xb8)]??!![];return{'appCode':_0x5e1245[_0x3cc410(0xca)],'key':_0x5e1245[_0x3cc410(0xb4)],'tags':_0x5e1245['tags']??undefined,'hasValue':_0x28b91a,'valueRedacted':_0x28b91a};}export function buildMutationData(_0x1f352a){const _0x271b3f=a28_0x24d80d;return{'operation':_0x1f352a[_0x271b3f(0xc7)],'selector':{'appCode':_0x1f352a['appCode'],'key':_0x1f352a[_0x271b3f(0xb4)]},'before':_0x1f352a[_0x271b3f(0x96)],'after':_0x1f352a[_0x271b3f(0xcd)],'dryRun':_0x1f352a[_0x271b3f(0x97)],'warnings':_0x1f352a[_0x271b3f(0xc5)]??[]};}export async function withAppConfigApiBoundary(_0x23ead6,_0x33cbb3,_0x1ae1a3){const _0x2b7f2c=a28_0x24d80d;try{return await _0x1ae1a3();}catch{const _0x2e5f47=['appCode:\x20'+_0x33cbb3[_0x2b7f2c(0xca)]];if(_0x33cbb3[_0x2b7f2c(0xb4)])_0x2e5f47[_0x2b7f2c(0xbb)]('key:\x20'+_0x33cbb3[_0x2b7f2c(0xb4)]);_0x2e5f47[_0x2b7f2c(0xbb)](_0x2b7f2c(0xa7));throw CliErrors[_0x2b7f2c(0xa2)]('Failed\x20to\x20'+_0x23ead6+_0x2b7f2c(0xb7),_0x2e5f47[_0x2b7f2c(0xd0)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x43d5e6,_0x42df8d){const _0x535145=a28_0x24d80d;return Object['defineProperties'](_0x43d5e6,{'method':{'value':_0x42df8d[_0x535145(0xad)],'enumerable':![]},'url':{'value':_0x42df8d[_0x535145(0x8d)],'enumerable':![]}});}export function assertSingleValueSource(_0xb55595){const _0x721bc2=a28_0x24d80d,_0x2666cd=[];_0xb55595[_0x721bc2(0xae)][_0x721bc2(0xc1)]>0x1&&_0x2666cd[_0x721bc2(0xbb)]({'kind':_0x721bc2(0xd2),'value':_0xb55595[_0x721bc2(0xae)][_0x721bc2(0x9d)](0x1)[_0x721bc2(0xd0)]('\x20')});const _0x237a0a=_0xb55595[_0x721bc2(0xd1)]('value');_0x237a0a!==undefined&&_0x237a0a!==null&&_0x2666cd[_0x721bc2(0xbb)]({'kind':_0x721bc2(0xd2),'value':String(_0x237a0a)});_0xb55595[_0x721bc2(0x9c)]('stdin')&&_0x2666cd[_0x721bc2(0xbb)]({'kind':_0x721bc2(0xa9)});const _0x15c213=_0xb55595[_0x721bc2(0x91)](_0x721bc2(0xc6))[_0x721bc2(0x92)]();_0x15c213&&_0x2666cd['push']({'kind':_0x721bc2(0x9e),'name':_0x15c213});const _0x6611d2=_0xb55595['str']('file')[_0x721bc2(0x92)]();_0x6611d2&&_0x2666cd[_0x721bc2(0xbb)]({'kind':_0x721bc2(0x8e),'path':_0x6611d2});if(_0x2666cd['length']===0x0)throw CliErrors[_0x721bc2(0x98)](_0x721bc2(0xc3),_0x721bc2(0xc8));if(_0x2666cd[_0x721bc2(0xc1)]>0x1)throw CliErrors[_0x721bc2(0x98)](_0x721bc2(0xa0),_0x721bc2(0xc4));return _0x2666cd[0x0];}export async function assertValueSourceReadable(_0x34983c){const _0x2eaa2b=a28_0x24d80d;if(_0x34983c[_0x2eaa2b(0xb0)]==='env'&&!(_0x34983c['name']in process.env))throw CliErrors[_0x2eaa2b(0x98)](_0x2eaa2b(0xc0)+_0x34983c[_0x2eaa2b(0xaa)]);if(_0x34983c[_0x2eaa2b(0xb0)]===_0x2eaa2b(0x8e))try{await access(_0x34983c['path']);}catch{throw CliErrors[_0x2eaa2b(0x98)](_0x2eaa2b(0xc9)+_0x34983c[_0x2eaa2b(0x9f)]);}}export async function readAppConfigValue(_0x5c252f){const _0x50c5bd=a28_0x24d80d,_0x24a641=assertSingleValueSource(_0x5c252f),_0x59553e=[];if(_0x24a641[_0x50c5bd(0xb0)]===_0x50c5bd(0xd2))return _0x59553e['push'](_0x50c5bd(0xcb)),{'value':_0x24a641[_0x50c5bd(0xbf)]??'','source':_0x24a641[_0x50c5bd(0xb0)],'warnings':_0x59553e};if(_0x24a641[_0x50c5bd(0xb0)]===_0x50c5bd(0xa9))return{'value':await readStdin(),'source':_0x24a641[_0x50c5bd(0xb0)],'warnings':_0x59553e};if(_0x24a641['kind']===_0x50c5bd(0x9e)){if(!(_0x24a641[_0x50c5bd(0xaa)]in process.env))throw CliErrors['validation'](_0x50c5bd(0xc0)+_0x24a641['name']);return{'value':process.env[_0x24a641.name]??'','source':_0x24a641['kind'],'warnings':_0x59553e};}return{'value':await readFile(_0x24a641[_0x50c5bd(0x9f)],_0x50c5bd(0xce)),'source':_0x24a641[_0x50c5bd(0xb0)],'warnings':_0x59553e};}function readStdin(){return new Promise((_0x3a61e2,_0x549563)=>{const _0x4ea217=a28_0xd413;let _0xb03b43='';process[_0x4ea217(0xa9)]['setEncoding'](_0x4ea217(0xce)),process['stdin']['on'](_0x4ea217(0xb9),_0x10d14c=>{_0xb03b43+=_0x10d14c;}),process[_0x4ea217(0xa9)][_0x4ea217(0xac)](_0x4ea217(0xc2),()=>_0x3a61e2(_0xb03b43)),process['stdin'][_0x4ea217(0xac)](_0x4ea217(0x93),_0x549563);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x4da05e=a29_0x4cc2;(function(_0xf378f9,_0x3a426e){const _0x2bfcd5=a29_0x4cc2,_0x49ba6e=_0xf378f9();while(!![]){try{const _0x1bea58=-parseInt(_0x2bfcd5(0x1de))/0x1*(-parseInt(_0x2bfcd5(0x1d8))/0x2)+-parseInt(_0x2bfcd5(0x1e1))/0x3*(parseInt(_0x2bfcd5(0x1d5))/0x4)+-parseInt(_0x2bfcd5(0x1e7))/0x5*(-parseInt(_0x2bfcd5(0x1e2))/0x6)+-parseInt(_0x2bfcd5(0x1d7))/0x7+parseInt(_0x2bfcd5(0x1d6))/0x8+parseInt(_0x2bfcd5(0x1e8))/0x9*(parseInt(_0x2bfcd5(0x1e6))/0xa)+-parseInt(_0x2bfcd5(0x1dc))/0xb;if(_0x1bea58===_0x3a426e)break;else _0x49ba6e['push'](_0x49ba6e['shift']());}catch(_0x453962){_0x49ba6e['push'](_0x49ba6e['shift']());}}}(a29_0x522a,0xbc9ca));function a29_0x4cc2(_0x5788dd,_0x13162e){_0x5788dd=_0x5788dd-0x1d2;const _0x522a5c=a29_0x522a();let _0x4cc21b=_0x522a5c[_0x5788dd];return _0x4cc21b;}function a29_0x522a(){const _0xa4b27c=['38532xnVJlK','6zGbBuD','Login\x20via\x20browser','../../auth/auth-server-ui.js','log','906980BGmbHe','3755560JIlzcD','81dvaxuW','yes','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','read','write','356KbbcZQ','11147856bJXALt','928067GucvuU','4804AvIBri','Clear\x20login\x20session','nonInteractive','auth','20132079FazUXF','bool','382TLoYik','boolean','logout'];a29_0x522a=function(){return _0xa4b27c;};return a29_0x522a();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0x4da05e(0x1db),'command':'login','description':a29_0x4da05e(0x1e3),'risk':a29_0x4da05e(0x1d3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x4da05e(0x1e9),'type':a29_0x4da05e(0x1df),'description':a29_0x4da05e(0x1d2),'default':![]}],async 'execute'(_0x491593){const _0x240a1d=a29_0x4da05e,{runAuthServer:_0x1dfb84}=await import(_0x240a1d(0x1e4));return await _0x1dfb84({'autoYes':_0x491593[_0x240a1d(0x1dd)](_0x240a1d(0x1e9)),'nonInteractive':_0x491593[_0x240a1d(0x1da)]}),{'ok':!![]};}},{'service':a29_0x4da05e(0x1db),'command':a29_0x4da05e(0x1e0),'description':a29_0x4da05e(0x1d9),'risk':a29_0x4da05e(0x1d4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2c9417){const _0x3f6b2c=a29_0x4da05e;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x3f6b2c(0x1e5)]('✓\x20Logged\x20out')):console[_0x3f6b2c(0x1e5)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x5cb832=a30_0x24b3;(function(_0x127678,_0x13172e){const _0x1a633c=a30_0x24b3,_0x5585bf=_0x127678();while(!![]){try{const _0x34b1c8=parseInt(_0x1a633c(0x216))/0x1+-parseInt(_0x1a633c(0x238))/0x2*(-parseInt(_0x1a633c(0x210))/0x3)+parseInt(_0x1a633c(0x206))/0x4*(-parseInt(_0x1a633c(0x22e))/0x5)+-parseInt(_0x1a633c(0x203))/0x6*(parseInt(_0x1a633c(0x201))/0x7)+-parseInt(_0x1a633c(0x21e))/0x8*(-parseInt(_0x1a633c(0x220))/0x9)+-parseInt(_0x1a633c(0x209))/0xa+parseInt(_0x1a633c(0x245))/0xb*(parseInt(_0x1a633c(0x207))/0xc);if(_0x34b1c8===_0x13172e)break;else _0x5585bf['push'](_0x5585bf['shift']());}catch(_0x15b902){_0x5585bf['push'](_0x5585bf['shift']());}}}(a30_0x2ff1,0x8298a));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a30_0x2ff1(){const _0xcc01c3=['\x20function:\x20','139202TJQcfr','trim','108wjpGux','name','question','76vGnWkf','12947196zCgyqR','utf8','1961030HWUgJJ','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','parseInt','Operation\x20type\x20(HOOK\x20only)','ENDPOINT','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','description','3aCUywO','nonInteractive','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','code','stderr','Script\x20type','90006cKCDaL','write','File\x20already\x20exists:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','includes','Alias\x20\x22','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','apiDir','16TbQdFN','length','1235727IbBskB','Invalid\x20dataset\x20selection.','join','tableName','read','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','operationType','find','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Operation\x20type\x20\x22','operation-type','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','HOOK\x20requires\x20alias/operation/node\x20options.','type','281330JRtQcT','Select\x20trigger\x20node:','alias','bff','str','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[触发节点]\x20','close','keys','No\x20operation\x20types\x20found\x20for\x20dataset\x20','1428964xETeDq','appCode','stdin','source','functionNode','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Script\x20description','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK','Created\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','string','No\x20api.ts\x20found.\x20Run\x20`','11gawxch','validation','datasetCode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.',']\x20(','map','function-node','Available:\x20','after','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','COMMON','create','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Select\x20operation\x20type:','UNKNOWN','Invalid\x20function\x20name\x20\x22','TODO:\x20add\x20script\x20description','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','before'];a30_0x2ff1=function(){return _0xcc01c3;};return a30_0x2ff1();}import{fileExists}from'../../core/bff/file-system.js';function a30_0x24b3(_0x43cd42,_0x3ef6fe){_0x43cd42=_0x43cd42-0x1f4;const _0x2ff10c=a30_0x2ff1();let _0x24b36c=_0x2ff10c[_0x43cd42];return _0x24b36c;}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x5cb832(0x231),'command':a30_0x5cb832(0x1f8),'description':a30_0x5cb832(0x1fe),'risk':a30_0x5cb832(0x224),'flags':[{'name':a30_0x5cb832(0x22d),'type':a30_0x5cb832(0x243),'required':!![],'enum':[a30_0x5cb832(0x1f7),'ENDPOINT','HOOK'],'description':a30_0x5cb832(0x215)},{'name':a30_0x5cb832(0x204),'type':a30_0x5cb832(0x243),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x5cb832(0x20f),'type':'string','description':a30_0x5cb832(0x23e)},{'name':a30_0x5cb832(0x230),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':'string','description':a30_0x5cb832(0x233)},{'name':a30_0x5cb832(0x22a),'type':a30_0x5cb832(0x243),'description':a30_0x5cb832(0x20c)},{'name':a30_0x5cb832(0x24b),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x5cb832(0x1ff),a30_0x5cb832(0x1f5)]}],async 'validate'(_0x2cb2f9){const _0x5de8fa=a30_0x5cb832,_0x2c499f=_0x2cb2f9[_0x5de8fa(0x232)](_0x5de8fa(0x204));if(!isValidBffFunctionName(_0x2c499f))throw CliErrors[_0x5de8fa(0x246)](_0x5de8fa(0x1fc)+_0x2c499f+_0x5de8fa(0x242));},async 'execute'(_0x592b02){const _0x2c2177=a30_0x5cb832,_0x3daf3a=loadBffProjectConfig(_0x592b02[_0x2c2177(0x239)]),_0x2e2885=_0x592b02['str'](_0x2c2177(0x22d)),_0x330fee=_0x592b02[_0x2c2177(0x232)](_0x2c2177(0x204)),_0x178445=_0x592b02[_0x2c2177(0x232)]('description')||undefined,_0x3028c9=_0x2e2885===_0x2c2177(0x240)?await resolveHookOptions(_0x3daf3a,_0x592b02):undefined,_0x1208a7=buildFilePath(_0x3daf3a,_0x2e2885,_0x330fee,_0x3028c9);if(await fileExists(_0x1208a7))throw CliErrors[_0x2c2177(0x246)](_0x2c2177(0x218)+_0x1208a7);await mkdir(dirname(_0x1208a7),{'recursive':!![]});const _0x29adb6=generateTemplate(_0x2e2885,_0x330fee,_0x592b02[_0x2c2177(0x239)],_0x178445,_0x3028c9);await writeFile(_0x1208a7,_0x29adb6,_0x2c2177(0x208));const _0x21fee4={'type':_0x2e2885,'name':_0x330fee,'path':_0x1208a7};if(_0x178445)_0x21fee4[_0x2c2177(0x20f)]=_0x178445;if(_0x3028c9){if(_0x3028c9[_0x2c2177(0x230)])_0x21fee4[_0x2c2177(0x230)]=_0x3028c9[_0x2c2177(0x230)];_0x21fee4['datasetCode']=_0x3028c9['datasetCode'],_0x21fee4[_0x2c2177(0x226)]=_0x3028c9['operationType'],_0x21fee4['functionNode']=_0x3028c9['functionNode'];}return{'ok':!![],'data':_0x21fee4,'message':_0x2c2177(0x241)+_0x2e2885+_0x2c2177(0x200)+_0x330fee};}};async function resolveHookOptions(_0x4b00d7,_0x62b78c){const _0x58170a=a30_0x5cb832,_0x41eab8=loadAliasMap(_0x62b78c[_0x58170a(0x21d)],undefined,resolveApiFilePath(_0x62b78c[_0x58170a(0x21d)],_0x62b78c[_0x58170a(0x239)])),_0x5cafef=_0x41eab8[_0x58170a(0x21f)]>0x0;let _0x81e432,_0x51aaf5,_0x1e2480;const _0x1a391b=_0x62b78c[_0x58170a(0x232)]('alias'),_0x181983=_0x62b78c[_0x58170a(0x232)]('datasetcode');if(_0x1a391b){const _0x125e34=resolveAlias(_0x62b78c['apiDir'],_0x1a391b,undefined,resolveApiFilePath(_0x62b78c[_0x58170a(0x21d)],_0x62b78c['appCode']));if(!_0x125e34){const _0x23f6c4=_0x5cafef?'Available\x20aliases:\x20'+_0x41eab8[_0x58170a(0x24a)](_0x20c166=>_0x20c166['alias'])[_0x58170a(0x222)](',\x20'):_0x58170a(0x244)+CLI_BIN_NAME+_0x58170a(0x1f9);throw CliErrors[_0x58170a(0x246)](_0x58170a(0x21b)+_0x1a391b+'\x22\x20not\x20found.\x20'+_0x23f6c4);}_0x81e432=_0x1a391b,_0x51aaf5=_0x125e34;}else{if(_0x181983){_0x51aaf5=_0x181983;const _0x28d861=_0x41eab8['find'](_0x3fcd25=>_0x3fcd25[_0x58170a(0x247)]===_0x181983);_0x81e432=_0x28d861?.[_0x58170a(0x230)];}else{if(_0x62b78c[_0x58170a(0x211)])throw CliErrors['validation'](_0x58170a(0x248));else{if(_0x5cafef){const _0x1b2b4c=_0x41eab8[_0x58170a(0x24a)](_0x1e58ed=>_0x1e58ed['alias']+'\x20('+_0x1e58ed[_0x58170a(0x223)]+')'),_0x29268f=await promptSelect('Select\x20dataset:',_0x1b2b4c),_0xe091b7=_0x41eab8[_0x29268f];if(!_0xe091b7)throw CliErrors[_0x58170a(0x246)](_0x58170a(0x221));_0x81e432=_0xe091b7[_0x58170a(0x230)],_0x51aaf5=_0xe091b7[_0x58170a(0x247)];}else{const _0xd11320=await listDatasets(_0x62b78c[_0x58170a(0x239)]);if(_0xd11320['length']===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x59eb35=_0xd11320[_0x58170a(0x24a)](_0x14df69=>_0x14df69[_0x58170a(0x204)]+'\x20['+(_0x14df69[_0x58170a(0x23b)]??_0x58170a(0x1fb))+_0x58170a(0x249)+_0x14df69[_0x58170a(0x213)]+')'),_0x526028=await promptSelect('Select\x20dataset:',_0x59eb35),_0x2ef2a0=_0xd11320[_0x526028];if(!_0x2ef2a0)throw CliErrors[_0x58170a(0x246)](_0x58170a(0x221));_0x51aaf5=_0x2ef2a0[_0x58170a(0x213)],_0x81e432=undefined;}}}}const _0x20ebc0=await listDatasets(_0x62b78c[_0x58170a(0x239)]),_0x57b1bc=_0x20ebc0[_0x58170a(0x227)](_0xdffb7=>_0xdffb7['code']===_0x51aaf5);if(!_0x57b1bc)throw CliErrors[_0x58170a(0x246)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x51aaf5+'\x22.\x20'+(_0x81e432?_0x58170a(0x228)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1e2480=_0x57b1bc['id'];const _0x4f69c9=_0x81e432??_0x51aaf5,_0x7840e0=await listBffDatasetOperations(_0x62b78c[_0x58170a(0x239)],_0x1e2480),_0x31a908=_0x7840e0?Object[_0x58170a(0x236)](_0x7840e0):[];if(_0x31a908[_0x58170a(0x21f)]===0x0)throw CliErrors[_0x58170a(0x246)](_0x58170a(0x237)+_0x4f69c9+'.');let _0x1fc73e;const _0x5df032=_0x62b78c['str'](_0x58170a(0x22a));if(_0x5df032){if(!_0x31a908[_0x58170a(0x21a)](_0x5df032))throw CliErrors[_0x58170a(0x246)](_0x58170a(0x229)+_0x5df032+_0x58170a(0x219)+_0x4f69c9+'.\x20'+(_0x58170a(0x1f4)+_0x31a908['join'](',\x20')));_0x1fc73e=_0x5df032;}else{if(_0x62b78c['nonInteractive'])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xcdcb27=await promptSelect(_0x58170a(0x1fa),_0x31a908);_0x1fc73e=_0x31a908[_0xcdcb27]??_0x31a908[0x0];}let _0x4c9253=normalizeHookFunctionNode(_0x62b78c['str'](_0x58170a(0x24b)));if(!_0x4c9253){if(_0x62b78c['str'](_0x58170a(0x24b)))throw CliErrors[_0x58170a(0x246)](_0x58170a(0x225));if(_0x62b78c[_0x58170a(0x211)])throw CliErrors['validation'](_0x58170a(0x23f));const _0x20203a=await promptSelect(_0x58170a(0x22f),[_0x58170a(0x1ff),_0x58170a(0x1f5)]);_0x4c9253=['before','after'][_0x20203a]??'before';}return{'alias':_0x81e432,'datasetCode':_0x51aaf5,'datasetId':_0x1e2480,'operationType':_0x1fc73e,'functionNode':_0x4c9253};}async function promptSelect(_0x3b6f67,_0x523f23){const _0x591da7=a30_0x5cb832;if(_0x523f23[_0x591da7(0x21f)]===0x1)return 0x0;for(const [_0x28c293,_0xa9c876]of _0x523f23['entries']()){process[_0x591da7(0x214)][_0x591da7(0x217)]('\x20\x20'+(_0x28c293+0x1)+'.\x20'+_0xa9c876+'\x0a');}const _0x3e7f9b=createInterface({'input':process[_0x591da7(0x23a)],'output':process[_0x591da7(0x214)]});while(!![]){const _0x44d32a=await new Promise(_0x4658a7=>{const _0x4415e9=_0x591da7;_0x3e7f9b[_0x4415e9(0x205)](_0x3b6f67+'\x20',_0x4658a7);}),_0x4f6a05=Number[_0x591da7(0x20b)](_0x44d32a[_0x591da7(0x202)](),0xa);if(Number['isInteger'](_0x4f6a05)&&_0x4f6a05>=0x1&&_0x4f6a05<=_0x523f23[_0x591da7(0x21f)])return _0x3e7f9b[_0x591da7(0x235)](),_0x4f6a05-0x1;process[_0x591da7(0x214)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x523f23[_0x591da7(0x21f)]+'.\x0a');}}function buildFilePath(_0x25d204,_0x17fed7,_0x440f22,_0x550c74){const _0x3113ea=a30_0x5cb832;if(_0x17fed7===_0x3113ea(0x240)){if(!_0x550c74)throw CliErrors[_0x3113ea(0x246)](_0x3113ea(0x22c));const _0x570418=_0x550c74[_0x3113ea(0x230)]??_0x550c74[_0x3113ea(0x247)];return join(_0x25d204['scriptsRootDir'],_0x3113ea(0x240),_0x570418,_0x550c74[_0x3113ea(0x226)],_0x550c74[_0x3113ea(0x23c)],_0x440f22+'.js');}return join(_0x25d204['scriptsRootDir'],_0x17fed7,_0x440f22+'.js');}export function generateTemplate(_0xdcb278,_0x350590,_0x5100cc,_0x3c29d8,_0x28627a){const _0x279ed8=a30_0x5cb832,_0x377ce6=_0x3c29d8?.[_0x279ed8(0x202)]()||_0x279ed8(0x1fd);if(_0xdcb278===_0x279ed8(0x1f7))return _0x279ed8(0x20e)+_0x377ce6+'\x0a\x20*\x20[脚本名称]\x20'+_0x350590+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x350590+'.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x350590+_0x279ed8(0x20a);if(_0xdcb278===_0x279ed8(0x20d))return _0x279ed8(0x212)+_0x377ce6+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x5100cc+'/'+_0x350590+_0x279ed8(0x21c)+_0x350590+_0x279ed8(0x20a);if(!_0x28627a)throw CliErrors[_0x279ed8(0x246)](_0x279ed8(0x1f6));return _0x279ed8(0x23d)+_0x377ce6+_0x279ed8(0x22b)+_0x5100cc+'/'+_0x28627a[_0x279ed8(0x247)]+'/'+_0x28627a[_0x279ed8(0x226)]+_0x279ed8(0x234)+_0x28627a[_0x279ed8(0x23c)]+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x350590+_0x279ed8(0x20a);}
|
|
1
|
+
const a30_0x423b92=a30_0x53b1;(function(_0x16a0a2,_0x2f0beb){const _0x514540=a30_0x53b1,_0x173d2e=_0x16a0a2();while(!![]){try{const _0x4757f4=parseInt(_0x514540(0x1de))/0x1*(parseInt(_0x514540(0x190))/0x2)+parseInt(_0x514540(0x1d0))/0x3+parseInt(_0x514540(0x1ba))/0x4+parseInt(_0x514540(0x1e4))/0x5*(parseInt(_0x514540(0x1c5))/0x6)+parseInt(_0x514540(0x1a9))/0x7+parseInt(_0x514540(0x1e3))/0x8*(parseInt(_0x514540(0x199))/0x9)+-parseInt(_0x514540(0x19a))/0xa;if(_0x4757f4===_0x2f0beb)break;else _0x173d2e['push'](_0x173d2e['shift']());}catch(_0x397e62){_0x173d2e['push'](_0x173d2e['shift']());}}}(a30_0x1942,0x1e754));import{createInterface}from'node:readline';function a30_0x1942(){const _0x446d91=['/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20',']\x20(','utf8','Invalid\x20dataset\x20selection.','appCode','tableName','ENDPOINT','type','string','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','224336MvcEJf','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','validation','Select\x20dataset:','trim','before','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','stderr','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','str','474MobvZV','parseInt','HOOK\x20requires\x20alias/operation/node\x20options.','Invalid\x20function\x20name\x20\x22','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','entries','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Trigger\x20node\x20(HOOK\x20only)','\x0a\x20*\x20[脚本名称]\x20','Available:\x20','length','82179zUTson','HOOK','Script\x20type','\x22.\x20','Select\x20operation\x20type:','\x22\x20not\x20found.\x20','create','after','\x20function:\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','functionNode','isInteger','No\x20operation\x20types\x20found\x20for\x20dataset\x20','681ldVMgP','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','name','code','function-node','264EvrUSc','830iJPTpR','keys','\x22\x20not\x20found\x20for\x20dataset\x20','scriptsRootDir','datasetcode','Created\x20','Alias\x20\x22','Operation\x20type\x20\x22','nonInteractive','map','.js','302rkKcQk','Dataset\x20not\x20found\x20for\x20code\x20\x22','datasetCode','alias','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','read','42156tAePyK','3195170yqzCEx','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20api\x20pull`\x20to\x20refresh.','operation-type','Script\x20description','Select\x20trigger\x20node:','description','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','join','No\x20api.ts\x20found.\x20Run\x20`','operationType','Available\x20aliases:\x20','TODO:\x20add\x20script\x20description','includes','source','631953UGZHIm','Operation\x20type\x20(HOOK\x20only)','apiDir','UNKNOWN','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','close','find'];a30_0x1942=function(){return _0x446d91;};return a30_0x1942();}import{mkdir,writeFile}from'node:fs/promises';function a30_0x53b1(_0x1d2791,_0x24c782){_0x1d2791=_0x1d2791-0x186;const _0x1942f6=a30_0x1942();let _0x53b13e=_0x1942f6[_0x1d2791];return _0x53b13e;}import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':'bff','command':a30_0x423b92(0x1d6),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a30_0x423b92(0x198),'flags':[{'name':a30_0x423b92(0x1b7),'type':a30_0x423b92(0x1b8),'required':!![],'enum':['COMMON',a30_0x423b92(0x1b6),a30_0x423b92(0x1d1)],'description':a30_0x423b92(0x1d2)},{'name':a30_0x423b92(0x1e0),'type':a30_0x423b92(0x1b8),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x423b92(0x1a0),'type':'string','description':a30_0x423b92(0x19e)},{'name':'alias','type':a30_0x423b92(0x1b8),'description':a30_0x423b92(0x194)},{'name':a30_0x423b92(0x189),'type':a30_0x423b92(0x1b8),'description':a30_0x423b92(0x1bb)},{'name':a30_0x423b92(0x19d),'type':a30_0x423b92(0x1b8),'description':a30_0x423b92(0x1aa)},{'name':a30_0x423b92(0x1e2),'type':a30_0x423b92(0x1b8),'description':a30_0x423b92(0x1cc),'enum':[a30_0x423b92(0x1bf),a30_0x423b92(0x1d7)]}],async 'validate'(_0x43b9fb){const _0x446a3a=a30_0x423b92,_0x4aa5d0=_0x43b9fb[_0x446a3a(0x1c4)](_0x446a3a(0x1e0));if(!isValidBffFunctionName(_0x4aa5d0))throw CliErrors['validation'](_0x446a3a(0x1c8)+_0x4aa5d0+_0x446a3a(0x1df));},async 'execute'(_0x5c5088){const _0x31a7e0=a30_0x423b92,_0x14986e=loadBffProjectConfig(_0x5c5088['appCode']),_0x7dd97f=_0x5c5088[_0x31a7e0(0x1c4)](_0x31a7e0(0x1b7)),_0x9f69c4=_0x5c5088[_0x31a7e0(0x1c4)]('name'),_0x42186e=_0x5c5088['str'](_0x31a7e0(0x1a0))||undefined,_0x194815=_0x7dd97f==='HOOK'?await resolveHookOptions(_0x14986e,_0x5c5088):undefined,_0x626afe=buildFilePath(_0x14986e,_0x7dd97f,_0x9f69c4,_0x194815);if(await fileExists(_0x626afe))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x626afe);await mkdir(dirname(_0x626afe),{'recursive':!![]});const _0x46d22f=generateTemplate(_0x7dd97f,_0x9f69c4,_0x5c5088['appCode'],_0x42186e,_0x194815);await writeFile(_0x626afe,_0x46d22f,_0x31a7e0(0x1b2));const _0x423d9b={'type':_0x7dd97f,'name':_0x9f69c4,'path':_0x626afe};if(_0x42186e)_0x423d9b['description']=_0x42186e;if(_0x194815){if(_0x194815['alias'])_0x423d9b[_0x31a7e0(0x193)]=_0x194815[_0x31a7e0(0x193)];_0x423d9b[_0x31a7e0(0x192)]=_0x194815['datasetCode'],_0x423d9b[_0x31a7e0(0x1a4)]=_0x194815['operationType'],_0x423d9b[_0x31a7e0(0x1db)]=_0x194815['functionNode'];}return{'ok':!![],'data':_0x423d9b,'message':_0x31a7e0(0x18a)+_0x7dd97f+_0x31a7e0(0x1d8)+_0x9f69c4};}};async function resolveHookOptions(_0x23f191,_0x21c236){const _0x31bc08=a30_0x423b92,_0x135e8d=loadAliasMap(_0x21c236[_0x31bc08(0x1ab)],undefined,resolveApiFilePath(_0x21c236[_0x31bc08(0x1ab)],_0x21c236[_0x31bc08(0x1b4)])),_0x47f531=_0x135e8d[_0x31bc08(0x1cf)]>0x0;let _0x5a640b,_0x39fe3b,_0x56039f;const _0x119ea5=_0x21c236[_0x31bc08(0x1c4)](_0x31bc08(0x193)),_0x1b0609=_0x21c236[_0x31bc08(0x1c4)](_0x31bc08(0x189));if(_0x119ea5){const _0x49b678=resolveAlias(_0x21c236[_0x31bc08(0x1ab)],_0x119ea5,undefined,resolveApiFilePath(_0x21c236['apiDir'],_0x21c236[_0x31bc08(0x1b4)]));if(!_0x49b678){const _0x14b72a=_0x47f531?_0x31bc08(0x1a5)+_0x135e8d['map'](_0x263c5d=>_0x263c5d[_0x31bc08(0x193)])['join'](',\x20'):_0x31bc08(0x1a3)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x18b)+_0x119ea5+_0x31bc08(0x1d5)+_0x14b72a);}_0x5a640b=_0x119ea5,_0x39fe3b=_0x49b678;}else{if(_0x1b0609){_0x39fe3b=_0x1b0609;const _0x5021f5=_0x135e8d[_0x31bc08(0x1af)](_0x34cecb=>_0x34cecb[_0x31bc08(0x192)]===_0x1b0609);_0x5a640b=_0x5021f5?.[_0x31bc08(0x193)];}else{if(_0x21c236[_0x31bc08(0x18d)])throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x19b));else{if(_0x47f531){const _0x44c1ae=_0x135e8d[_0x31bc08(0x18e)](_0x30c85e=>_0x30c85e[_0x31bc08(0x193)]+'\x20('+_0x30c85e[_0x31bc08(0x1b5)]+')'),_0x463da9=await promptSelect(_0x31bc08(0x1bd),_0x44c1ae),_0x3a879e=_0x135e8d[_0x463da9];if(!_0x3a879e)throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x1b3));_0x5a640b=_0x3a879e['alias'],_0x39fe3b=_0x3a879e[_0x31bc08(0x192)];}else{const _0x2329ad=await listDatasets(_0x21c236[_0x31bc08(0x1b4)]);if(_0x2329ad[_0x31bc08(0x1cf)]===0x0)throw CliErrors[_0x31bc08(0x1bc)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x3a6329=_0x2329ad[_0x31bc08(0x18e)](_0x2d2007=>_0x2d2007[_0x31bc08(0x1e0)]+'\x20['+(_0x2d2007[_0x31bc08(0x1a8)]??_0x31bc08(0x1ac))+_0x31bc08(0x1b1)+_0x2d2007['code']+')'),_0x2be1fa=await promptSelect(_0x31bc08(0x1bd),_0x3a6329),_0x4350ab=_0x2329ad[_0x2be1fa];if(!_0x4350ab)throw CliErrors[_0x31bc08(0x1bc)]('Invalid\x20dataset\x20selection.');_0x39fe3b=_0x4350ab[_0x31bc08(0x1e1)],_0x5a640b=undefined;}}}}const _0x3a644f=await listDatasets(_0x21c236[_0x31bc08(0x1b4)]),_0x25d73e=_0x3a644f[_0x31bc08(0x1af)](_0x39bc83=>_0x39bc83['code']===_0x39fe3b);if(!_0x25d73e)throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x191)+_0x39fe3b+_0x31bc08(0x1d3)+(_0x5a640b?_0x31bc08(0x195)+CLI_BIN_NAME+_0x31bc08(0x19c):''));_0x56039f=_0x25d73e['id'];const _0x417837=_0x5a640b??_0x39fe3b,_0x497cf3=await listBffDatasetOperations(_0x21c236[_0x31bc08(0x1b4)],_0x56039f),_0x465c6d=_0x497cf3?Object[_0x31bc08(0x186)](_0x497cf3):[];if(_0x465c6d[_0x31bc08(0x1cf)]===0x0)throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x1dd)+_0x417837+'.');let _0xbcf110;const _0x3bfe34=_0x21c236[_0x31bc08(0x1c4)]('operation-type');if(_0x3bfe34){if(!_0x465c6d[_0x31bc08(0x1a7)](_0x3bfe34))throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x18c)+_0x3bfe34+_0x31bc08(0x187)+_0x417837+'.\x20'+(_0x31bc08(0x1ce)+_0x465c6d[_0x31bc08(0x1a2)](',\x20')));_0xbcf110=_0x3bfe34;}else{if(_0x21c236[_0x31bc08(0x18d)])throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x1a1));const _0x1ed111=await promptSelect(_0x31bc08(0x1d4),_0x465c6d);_0xbcf110=_0x465c6d[_0x1ed111]??_0x465c6d[0x0];}let _0x34849c=normalizeHookFunctionNode(_0x21c236[_0x31bc08(0x1c4)]('function-node'));if(!_0x34849c){if(_0x21c236[_0x31bc08(0x1c4)](_0x31bc08(0x1e2)))throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x1d9));if(_0x21c236[_0x31bc08(0x18d)])throw CliErrors[_0x31bc08(0x1bc)](_0x31bc08(0x1c2));const _0x3c7368=await promptSelect(_0x31bc08(0x19f),[_0x31bc08(0x1bf),_0x31bc08(0x1d7)]);_0x34849c=[_0x31bc08(0x1bf),'after'][_0x3c7368]??'before';}return{'alias':_0x5a640b,'datasetCode':_0x39fe3b,'datasetId':_0x56039f,'operationType':_0xbcf110,'functionNode':_0x34849c};}async function promptSelect(_0x357e1d,_0x193cd4){const _0x86ad44=a30_0x423b92;if(_0x193cd4[_0x86ad44(0x1cf)]===0x1)return 0x0;for(const [_0x3e0b40,_0x2bfe8d]of _0x193cd4[_0x86ad44(0x1ca)]()){process['stderr']['write']('\x20\x20'+(_0x3e0b40+0x1)+'.\x20'+_0x2bfe8d+'\x0a');}const _0x131c4a=createInterface({'input':process['stdin'],'output':process[_0x86ad44(0x1c1)]});while(!![]){const _0x59a603=await new Promise(_0x42f998=>{_0x131c4a['question'](_0x357e1d+'\x20',_0x42f998);}),_0x463b96=Number[_0x86ad44(0x1c6)](_0x59a603[_0x86ad44(0x1be)](),0xa);if(Number[_0x86ad44(0x1dc)](_0x463b96)&&_0x463b96>=0x1&&_0x463b96<=_0x193cd4['length'])return _0x131c4a[_0x86ad44(0x1ae)](),_0x463b96-0x1;process[_0x86ad44(0x1c1)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x193cd4[_0x86ad44(0x1cf)]+'.\x0a');}}function buildFilePath(_0xd0e909,_0x1e17f4,_0x2082d9,_0x26dedc){const _0x32f946=a30_0x423b92;if(_0x1e17f4==='HOOK'){if(!_0x26dedc)throw CliErrors[_0x32f946(0x1bc)](_0x32f946(0x1c7));const _0x50abfb=_0x26dedc[_0x32f946(0x193)]??_0x26dedc[_0x32f946(0x192)];return join(_0xd0e909[_0x32f946(0x188)],_0x32f946(0x1d1),_0x50abfb,_0x26dedc[_0x32f946(0x1a4)],_0x26dedc[_0x32f946(0x1db)],_0x2082d9+_0x32f946(0x18f));}return join(_0xd0e909[_0x32f946(0x188)],_0x1e17f4,_0x2082d9+_0x32f946(0x18f));}export function generateTemplate(_0x150ab5,_0x4f11f3,_0x5babf5,_0x394a9a,_0x4dd9b0){const _0x5427b4=a30_0x423b92,_0x436f0f=_0x394a9a?.[_0x5427b4(0x1be)]()||_0x5427b4(0x1a6);if(_0x150ab5===_0x5427b4(0x196))return _0x5427b4(0x1da)+_0x436f0f+_0x5427b4(0x1cd)+_0x4f11f3+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x4f11f3+_0x5427b4(0x1c0)+_0x4f11f3+_0x5427b4(0x1b9);if(_0x150ab5==='ENDPOINT')return _0x5427b4(0x1b0)+_0x436f0f+_0x5427b4(0x197)+_0x5babf5+'/'+_0x4f11f3+_0x5427b4(0x1ad)+_0x4f11f3+_0x5427b4(0x1b9);if(!_0x4dd9b0)throw CliErrors[_0x5427b4(0x1bc)](_0x5427b4(0x1c3));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x436f0f+_0x5427b4(0x1cb)+_0x5babf5+'/'+_0x4dd9b0[_0x5427b4(0x192)]+'/'+_0x4dd9b0['operationType']+'\x0a\x20*\x20[触发节点]\x20'+_0x4dd9b0['functionNode']+_0x5427b4(0x1c9)+_0x4f11f3+_0x5427b4(0x1b9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x4925d4=a31_0x3df8;(function(_0x140d5d,_0x2f8d79){const _0x31319a=a31_0x3df8,_0x17cf8d=_0x140d5d();while(!![]){try{const _0xa3602e=parseInt(_0x31319a(0xe2))/0x1*(-parseInt(_0x31319a(0xe6))/0x2)+-parseInt(_0x31319a(0xba))/0x3+-parseInt(_0x31319a(0xc8))/0x4+-parseInt(_0x31319a(0xcc))/0x5+-parseInt(_0x31319a(0xbb))/0x6*(parseInt(_0x31319a(0xc1))/0x7)+-parseInt(_0x31319a(0xcf))/0x8+parseInt(_0x31319a(0xd9))/0x9;if(_0xa3602e===_0x2f8d79)break;else _0x17cf8d['push'](_0x17cf8d['shift']());}catch(_0x254cc9){_0x17cf8d['push'](_0x17cf8d['shift']());}}}(a31_0x26fc,0xa1b9e));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a31_0x3df8(_0x108c52,_0x226ae2){_0x108c52=_0x108c52-0xb2;const _0x26fcd3=a31_0x26fc();let _0x3df80b=_0x26fcd3[_0x108c52];return _0x3df80b;}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_0x4925d4(0xb5),'command':a31_0x4925d4(0xb2),'description':a31_0x4925d4(0xdb),'risk':a31_0x4925d4(0xc7),'flags':[{'name':a31_0x4925d4(0xc4),'type':a31_0x4925d4(0xe5),'required':!![],'description':a31_0x4925d4(0xe8)}],async 'validate'(_0x2746e9){const _0x287d5d=a31_0x4925d4,_0x259704=loadBffProjectConfig(_0x2746e9['appCode']),_0x11f6bd=await readBffLockFile(_0x259704['lockFilePath']);if(!_0x11f6bd)throw CliErrors[_0x287d5d(0xd6)](_0x287d5d(0xbe));},async 'dryRun'(_0x54226f){const _0x4cfa9d=a31_0x4925d4,_0x2fc531=loadBffProjectConfig(_0x54226f[_0x4cfa9d(0xc0)]),_0x5325b0=await readBffLockFile(_0x2fc531[_0x4cfa9d(0xd1)]);if(!_0x5325b0)throw CliErrors[_0x4cfa9d(0xd6)](_0x4cfa9d(0xde));const {appLock:_0x255e8e}=ensureLockScope(_0x5325b0,_0x54226f[_0x4cfa9d(0xc0)],_0x2fc531['scriptsRoot'],_0x4cfa9d(0xb2)),_0x1f6190=_0x54226f[_0x4cfa9d(0xb8)](_0x4cfa9d(0xc4)),_0x5c05c9=Object[_0x4cfa9d(0xbf)](_0x255e8e[_0x4cfa9d(0xe0)]),_0x529a5a=resolveDeleteTarget(_0x1f6190,_0x5c05c9),_0x362eac=_0x255e8e[_0x4cfa9d(0xe0)][_0x529a5a];if(!_0x362eac)throw CliErrors['validation'](_0x4cfa9d(0xdd)+_0x529a5a+'\x22.');const _0x49c3f3=resolveLocalFilePathFromLockKey(_0x2fc531,_0x529a5a),_0x3e1838=relative(_0x2fc531[_0x4cfa9d(0xe1)],_0x49c3f3),_0x432831=join(_0x2fc531[_0x4cfa9d(0xc2)],_0x4cfa9d(0xb3),_0x3e1838);return{'method':'POST','url':_0x4cfa9d(0xb4),'body':{'appCode':_0x54226f[_0x4cfa9d(0xc0)],'target':_0x529a5a,'remoteId':_0x362eac[_0x4cfa9d(0xbd)],'localFilePath':_0x49c3f3,'trashedPath':_0x432831},'description':_0x4cfa9d(0xd2)+_0x529a5a+_0x4cfa9d(0xdf)};},async 'execute'(_0x56093a){const _0x33b410=a31_0x4925d4,_0x5a9da7=loadBffProjectConfig(_0x56093a['appCode']),_0x575589=await readBffLockFile(_0x5a9da7[_0x33b410(0xd1)]);if(!_0x575589)throw CliErrors['validation'](_0x33b410(0xde));const {lockData:_0x346630,appLock:_0x1dd51a}=ensureLockScope(_0x575589,_0x56093a['appCode'],_0x5a9da7[_0x33b410(0xb9)],'delete'),_0x1f4200=JSON[_0x33b410(0xb7)](JSON[_0x33b410(0xd0)](_0x346630)),_0x538643=_0x1f4200[_0x33b410(0xda)][_0x56093a[_0x33b410(0xc0)]];if(!_0x538643)throw new Error(_0x33b410(0xe7)+_0x56093a[_0x33b410(0xc0)]+_0x33b410(0xdc));const _0x22d3fc=_0x56093a['str'](_0x33b410(0xc4)),_0xdde61c=Object[_0x33b410(0xbf)](_0x538643[_0x33b410(0xe0)]),_0x1cd5c7=resolveDeleteTarget(_0x22d3fc,_0xdde61c),_0x10da58=_0x538643[_0x33b410(0xe0)][_0x1cd5c7];if(!_0x10da58)throw CliErrors[_0x33b410(0xd6)](_0x33b410(0xdd)+_0x1cd5c7+'\x22.');await deleteBffScript(_0x10da58[_0x33b410(0xbd)]),delete _0x538643[_0x33b410(0xe0)][_0x1cd5c7],_0x538643[_0x33b410(0xcb)]=new Date()['toISOString'](),await writeBffLockFile(_0x5a9da7[_0x33b410(0xd1)],_0x1f4200);const _0x1dacaa=resolveLocalFilePathFromLockKey(_0x5a9da7,_0x1cd5c7);let _0x38223c;await fileExists(_0x1dacaa)&&(_0x38223c=await moveToTrash(_0x5a9da7[_0x33b410(0xe1)],_0x5a9da7['trashDir'],_0x1dacaa),await cleanupEmptyDirectories(dirname(_0x1dacaa),_0x5a9da7[_0x33b410(0xe4)]));await waitForDeleteSettlement(_0x5a9da7[_0x33b410(0xd1)],_0x56093a[_0x33b410(0xc0)],_0x1cd5c7,_0x1dacaa),await sleep(0x96);const _0x2ec68a={'deleted':_0x1cd5c7,'remoteId':_0x10da58[_0x33b410(0xbd)]};if(_0x38223c)_0x2ec68a[_0x33b410(0xce)]=_0x38223c;return{'ok':!![],'data':_0x2ec68a,'message':'Deleted\x20'+_0x1cd5c7+(_0x38223c?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0xa836cc,_0x219255){const _0x376256=a31_0x4925d4;if(_0xa836cc[_0x376256(0xd7)]('/')){const _0x2f4ea6=_0x219255[_0x376256(0xd3)](_0x5f2371=>_0x5f2371===_0xa836cc);if(!_0x2f4ea6)throw CliErrors[_0x376256(0xd6)](_0x376256(0xc9)+_0xa836cc);return _0x2f4ea6;}const _0x40dea7=_0x219255['filter'](_0x80228c=>_0x80228c[_0x376256(0xc6)]('/')['at'](-0x1)===_0xa836cc);if(_0x40dea7[_0x376256(0xd4)]===0x0)throw CliErrors[_0x376256(0xd6)]('Function\x20not\x20found:\x20'+_0xa836cc);if(_0x40dea7[_0x376256(0xd4)]>0x1)throw CliErrors[_0x376256(0xd6)](_0x376256(0xd5)+_0xa836cc+_0x376256(0xc3)+_0x40dea7[_0x376256(0xc5)](_0x4db8bf=>_0x376256(0xca)+_0x4db8bf)[_0x376256(0xcd)]('\x0a'));return _0x40dea7[0x0];}async function moveToTrash(_0x47c814,_0x790f8b,_0x2f927a){const _0x2f3750=a31_0x4925d4,_0x369dcb=new Date()[_0x2f3750(0xd8)]()[_0x2f3750(0xb6)](/[:.]/g,'-'),_0x5ab790=relative(_0x47c814,_0x2f927a),_0x3e099a=join(_0x790f8b,_0x369dcb,_0x5ab790);return await mkdir(dirname(_0x3e099a),{'recursive':!![]}),await rename(_0x2f927a,_0x3e099a),_0x3e099a;}async function cleanupEmptyDirectories(_0x5e4417,_0x954167){const _0x3ff2e1=a31_0x4925d4;let _0x29c436=resolve(_0x5e4417);const _0x2258df=resolve(_0x954167);while(_0x29c436[_0x3ff2e1(0xbc)](''+_0x2258df+sep)||_0x29c436===_0x2258df){if(_0x29c436===_0x2258df)return;try{const _0x112ea6=await readdir(_0x29c436);if(_0x112ea6[_0x3ff2e1(0xd4)]>0x0)return;await rmdir(_0x29c436);}catch{return;}_0x29c436=dirname(_0x29c436);}}function a31_0x26fc(){const _0x3d7d6c=['length','Multiple\x20functions\x20match\x20\x22','validation','includes','toISOString','70338888tJzjvn','apps','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','\x22\x20not\x20found\x20after\x20ensureLockScope.','No\x20lock\x20entry\x20found\x20for\x20\x22','BFF\x20lock\x20file\x20not\x20found.','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','functions','projectRoot','6LhOMpQ','Local\x20delete\x20not\x20settled\x20for\x20','scriptsRootDir','string','413398fkJYMY','Lock\x20scope\x20for\x20app\x20\x22','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','delete','<timestamp>','/api/management/library/scripts/delete','bff','replace','parse','str','scriptsRoot','3870345wEEYjn','81078UsZniK','startsWith','remoteId','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','keys','appCode','679XlidWt','trashDir','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','target','map','split','high-risk-write','5079600jQgktj','Function\x20not\x20found:\x20','\x20\x20-\x20','lastSync','3795920ScMyNs','join','trashedTo','10262784xVQPHC','stringify','lockFilePath','Would\x20delete\x20','find'];a31_0x26fc=function(){return _0x3d7d6c;};return a31_0x26fc();}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3d3d12,_0x3286ca,_0x54b4ac,_0x31ffe2){const _0x4e5319=a31_0x4925d4;for(let _0x428a95=0x0;_0x428a95<DELETE_SETTLE_RETRY_COUNT;_0x428a95+=0x1){const _0x435f52=await readBffLockFile(_0x3d3d12),_0x5914b1=!!_0x435f52?.['apps']?.[_0x3286ca]?.[_0x4e5319(0xe0)]?.[_0x54b4ac],_0x4dd546=await fileExists(_0x31ffe2);if(!_0x5914b1&&!_0x4dd546)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4e5319(0xe3)+_0x54b4ac+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0xd644(){const _0x40cc19=['2352wtHPEI','verbose','bff','7370aBOTSc','number','2112255gvVWGP','Script\x20ID','1439yrdlpZ','23926NvBZfh','905pwRDqr','num','scriptContent','6050NyLSoT','6776316jrxzaf','1458993nWWHdH','Return\x20full\x20raw\x20script\x20object','detail','createdTime','1378IXpjEc','updatedTime','8556TFqBBR','bool','4ZBfaxj','(none)','Get\x20BFF\x20script\x20details\x20by\x20ID'];a32_0xd644=function(){return _0x40cc19;};return a32_0xd644();}const a32_0x16dd44=a32_0x335f;(function(_0x18d8d3,_0x4e626a){const _0x1f8632=a32_0x335f,_0x3f47c0=_0x18d8d3();while(!![]){try{const _0x37bebb=-parseInt(_0x1f8632(0x9c))/0x1*(parseInt(_0x1f8632(0xa7))/0x2)+parseInt(_0x1f8632(0xa3))/0x3*(parseInt(_0x1f8632(0xab))/0x4)+-parseInt(_0x1f8632(0x9e))/0x5*(parseInt(_0x1f8632(0xa9))/0x6)+parseInt(_0x1f8632(0x9d))/0x7*(parseInt(_0x1f8632(0xae))/0x8)+parseInt(_0x1f8632(0x9a))/0x9+-parseInt(_0x1f8632(0xa1))/0xa*(parseInt(_0x1f8632(0xb1))/0xb)+parseInt(_0x1f8632(0xa2))/0xc;if(_0x37bebb===_0x4e626a)break;else _0x3f47c0['push'](_0x3f47c0['shift']());}catch(_0x1cb7eb){_0x3f47c0['push'](_0x3f47c0['shift']());}}}(a32_0xd644,0x9b324));function a32_0x335f(_0x2e81b4,_0x34120b){_0x2e81b4=_0x2e81b4-0x9a;const _0xd64486=a32_0xd644();let _0x335faa=_0xd64486[_0x2e81b4];return _0x335faa;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x16dd44(0xb0),'command':a32_0x16dd44(0xa5),'description':a32_0x16dd44(0xad),'risk':'read','flags':[{'name':'id','type':a32_0x16dd44(0xb2),'required':!![],'description':a32_0x16dd44(0x9b)},{'name':a32_0x16dd44(0xaf),'type':'boolean','description':a32_0x16dd44(0xa4)}],async 'execute'(_0x46f7b2){const _0x2da3aa=a32_0x16dd44,_0x45e5fb=await getBffScriptInfo(_0x46f7b2[_0x2da3aa(0x9f)]('id')),_0x80bc7d=_0x46f7b2[_0x2da3aa(0xaa)](_0x2da3aa(0xaf));if(_0x80bc7d)return{'ok':!![],'data':_0x45e5fb};return{'ok':!![],'data':{'id':_0x45e5fb['id'],'appCode':_0x45e5fb['appCode'],'scriptType':_0x45e5fb['scriptType'],'description':_0x45e5fb['description']||_0x2da3aa(0xac),'createdTime':_0x45e5fb[_0x2da3aa(0xa6)]??'','updatedTime':_0x45e5fb[_0x2da3aa(0xa8)]??'','scriptContent':_0x45e5fb[_0x2da3aa(0xa0)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1531c9,_0xf99727){const _0x4f2025=a33_0x1a2c,_0x3b8607=_0x1531c9();while(!![]){try{const _0x3bc91c=-parseInt(_0x4f2025(0x7b))/0x1+-parseInt(_0x4f2025(0x79))/0x2*(parseInt(_0x4f2025(0x81))/0x3)+-parseInt(_0x4f2025(0x7f))/0x4+parseInt(_0x4f2025(0x7c))/0x5*(-parseInt(_0x4f2025(0x7d))/0x6)+parseInt(_0x4f2025(0x7a))/0x7*(-parseInt(_0x4f2025(0x7e))/0x8)+-parseInt(_0x4f2025(0x80))/0x9+-parseInt(_0x4f2025(0x83))/0xa*(-parseInt(_0x4f2025(0x82))/0xb);if(_0x3bc91c===_0xf99727)break;else _0x3b8607['push'](_0x3b8607['shift']());}catch(_0x4906be){_0x3b8607['push'](_0x3b8607['shift']());}}}(a33_0x5461,0x54381));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a33_0x1a2c(_0x34e6cb,_0x1a7349){_0x34e6cb=_0x34e6cb-0x79;const _0x546171=a33_0x5461();let _0x1a2cec=_0x546171[_0x34e6cb];return _0x1a2cec;}function a33_0x5461(){const _0x54b76d=['946505EXsKvC','353480RiYeqZ','408980Huufwd','24UOcFAD','16IwPgeW','2092024hEivDK','4080087VfNwAz','3iVbNTX','22etKSkd','12147950dguNum','314372HpUvxm'];a33_0x5461=function(){return _0x54b76d;};return a33_0x5461();}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|