@lovrabet/rabetbase-cli 2.4.6-beta.2 → 2.4.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +3 -3
- package/skills/rabetbase/references/rabetbase-ocr.md +17 -2
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x1faf4a=a19_0x4f68;(function(_0x425dc8,_0x50e380){const _0x36fd0d=a19_0x4f68,_0x163a86=_0x425dc8();while(!![]){try{const _0x92b09b=parseInt(_0x36fd0d(0xf8))/0x1+-parseInt(_0x36fd0d(0xe9))/0x2*(parseInt(_0x36fd0d(0x10c))/0x3)+parseInt(_0x36fd0d(0xff))/0x4+parseInt(_0x36fd0d(0x100))/0x5+-parseInt(_0x36fd0d(0xed))/0x6+-parseInt(_0x36fd0d(0xea))/0x7+-parseInt(_0x36fd0d(0x108))/0x8*(-parseInt(_0x36fd0d(0xee))/0x9);if(_0x92b09b===_0x50e380)break;else _0x163a86['push'](_0x163a86['shift']());}catch(_0x32fe24){_0x163a86['push'](_0x163a86['shift']());}}}(a19_0x955b,0xdd761));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function a19_0x4f68(_0x2c74bf,_0x3112af){_0x2c74bf=_0x2c74bf-0xe7;const _0x955b1e=a19_0x955b();let _0x4f6896=_0x955b1e[_0x2c74bf];return _0x4f6896;}import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function a19_0x955b(){const _0x106143=['6020388mMKFZG','47763HOLsYm','object','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','map','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','\x20config','globalConfig','project','boolean','1338659TQMGVx','global','inherit','\x20in\x20','mergedCli','length','globalPath','1910784ubvJzP','5970985FehALo','defaultApp','appcode','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','remote','projectConfig','isCurrent','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','48JecKHH','bool','apps','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','3gQVdon','merged','app','read','entries','projectPath','1361614XjierL','3157588jxBvKO','optional','No\x20apps\x20configured'];a19_0x955b=function(){return _0x106143;};return a19_0x955b();}function buildItemsFromLayer(_0x2cf9fc,_0x1eabab){const _0x2352e6=a19_0x4f68,_0x49cb8e=[],_0x1413f8=_0x2cf9fc[_0x2352e6(0x10a)]&&typeof _0x2cf9fc['apps']==='object'?_0x2cf9fc[_0x2352e6(0x10a)]:{},_0x4a335b=_0x2cf9fc[_0x2352e6(0x101)]||undefined;for(const [_0x1ef7a7,_0x9cecd5]of Object[_0x2352e6(0xe7)](_0x1413f8)){if(!_0x9cecd5||typeof _0x9cecd5!==_0x2352e6(0xef)||!_0x9cecd5[_0x2352e6(0x102)])continue;_0x49cb8e['push']({'name':_0x1ef7a7,'appcode':_0x9cecd5[_0x2352e6(0x102)],'named':!![],'definedIn':_0x1eabab,'isDefault':_0x1ef7a7===_0x4a335b,...buildAppProfileListFields(_0x9cecd5)});}return _0x49cb8e;}function buildMergedItems(_0x1d8a75,_0xc14668){const _0x41c65d=a19_0x4f68,{apps:apps={},defaultApp:_0x3ffe5d}=_0x1d8a75,_0x5510ac=_0xc14668[_0x41c65d(0xf5)][_0x41c65d(0x10a)]&&typeof _0xc14668[_0x41c65d(0xf5)][_0x41c65d(0x10a)]===_0x41c65d(0xef)?_0xc14668[_0x41c65d(0xf5)][_0x41c65d(0x10a)]:{},_0x18874e=_0xc14668[_0x41c65d(0x105)][_0x41c65d(0x10a)]&&typeof _0xc14668[_0x41c65d(0x105)][_0x41c65d(0x10a)]===_0x41c65d(0xef)?_0xc14668['projectConfig'][_0x41c65d(0x10a)]:{},_0xa16b5f=_0xc14668[_0x41c65d(0x105)][_0x41c65d(0xfa)]===![],_0x28e36f=Object['entries'](apps),_0x40e5d8=_0x28e36f[_0x41c65d(0xf2)](([_0x1c87de,_0xbb3e58])=>({'name':_0x1c87de,'appcode':_0xbb3e58[_0x41c65d(0x102)],'named':!![],'definedIn':appDefinedIn(_0x1c87de,_0x5510ac,_0x18874e,_0xa16b5f),'isDefault':_0x1c87de===_0x3ffe5d,...buildAppProfileListFields(_0xbb3e58)}));return _0x40e5d8;}function validateAppListFlags(_0x1ac39a){const _0x262fb7=a19_0x4f68;if(!_0x1ac39a[_0x262fb7(0x109)](_0x262fb7(0x104)))return;if(!_0x1ac39a[_0x262fb7(0x109)](_0x262fb7(0xf9))&&!_0x1ac39a['bool'](_0x262fb7(0xf6)))return;throw CliErrors['validation']('`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.',_0x262fb7(0x10b));}async function execute(_0x3a22b){const _0x44a58b=a19_0x4f68;validateAppListFlags(_0x3a22b);if(_0x3a22b['bool'](_0x44a58b(0x104)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x3a22b)};const _0x6f4488=_0x3a22b[_0x44a58b(0x109)](_0x44a58b(0xf9)),_0x293314=_0x3a22b[_0x44a58b(0x109)](_0x44a58b(0xf6)),_0x6c626f=_0x6f4488?_0x44a58b(0xf9):_0x293314?_0x44a58b(0xf6):_0x44a58b(0x10d),{config:_0x3da16e,layers:_0x5574d9}=readRawConfigWithLayers(),_0xb95ff7=resolveDefaultAppSource(_0x5574d9),{defaultApp:_0x107f0f}=_0x3da16e;let _0x7cbb67,_0xa496dc;switch(_0x6c626f){case _0x44a58b(0xf9):_0x7cbb67=buildItemsFromLayer(_0x5574d9[_0x44a58b(0xf5)],_0x44a58b(0xf9)),_0xa496dc=_0x5574d9['globalPath'];break;case _0x44a58b(0xf6):_0x7cbb67=buildItemsFromLayer(_0x5574d9[_0x44a58b(0x105)],_0x44a58b(0xf6)),_0xa496dc=_0x5574d9[_0x44a58b(0xe8)];break;default:_0x7cbb67=buildMergedItems(_0x3da16e,_0x5574d9);break;}enrichAppListItemsWithMergedSelection(_0x7cbb67,_0x3a22b[_0x44a58b(0xfc)]);if(_0x7cbb67[_0x44a58b(0xfd)]===0x0){const _0x2b5f8c=_0x6c626f===_0x44a58b(0x10d)?'':_0x44a58b(0xfb)+_0x6c626f+_0x44a58b(0xf4);return{'ok':!![],'data':[],'message':_0x44a58b(0xec)+_0x2b5f8c+'.\x20Use\x20`'+CLI_BIN_NAME+_0x44a58b(0xf0)};}const _0x16ddd8=_0x7cbb67['find'](_0x46ecbf=>_0x46ecbf[_0x44a58b(0x106)]===!![]),_0x1b64d9=_0x107f0f??_0x16ddd8?.['appcode']??null,_0x5be424=_0x6c626f==='merged'?{'globalPath':_0x5574d9[_0x44a58b(0xfe)]??null,'projectPath':_0x5574d9[_0x44a58b(0xe8)]??null,'defaultApp':_0x1b64d9,'defaultAppSource':_0x107f0f!=null?_0xb95ff7:null}:{'scope':_0x6c626f,'configPath':_0xa496dc??null};return{'ok':!![],'data':{'items':_0x7cbb67,'meta':_0x5be424}};}export const appListDefinition={'service':a19_0x1faf4a(0x10e),'command':'list','description':a19_0x1faf4a(0xf1),'risk':a19_0x1faf4a(0x10f),'auth':a19_0x1faf4a(0xeb),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':a19_0x1faf4a(0xf7),'description':a19_0x1faf4a(0xf3),'default':![]},{'name':a19_0x1faf4a(0xf9),'type':a19_0x1faf4a(0xf7),'description':a19_0x1faf4a(0x103),'default':![]},{'name':'project','type':a19_0x1faf4a(0xf7),'description':a19_0x1faf4a(0x107),'default':![]}],async 'validate'(_0x2ea4dd){validateAppListFlags(_0x2ea4dd);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x506585=a20_0x2bec;function a20_0x4462(){const _0x4a3376=['read','724629RquahE','length','members-list','List\x20application\x20members\x20with\x20their\x20role\x20memberships','83525QdWwiP','240740XwBQqm','24002hAYeAN','app','633610IfvaMz','6BqEMMf','2GsalLX','3340OrHyjH','appCode','1575868iXKEcp','\x20application\x20member(s)','Found\x20','40jCHZJZ','473643brfrau'];a20_0x4462=function(){return _0x4a3376;};return a20_0x4462();}(function(_0x195e8e,_0x20ca9b){const _0xf993a4=a20_0x2bec,_0x177f36=_0x195e8e();while(!![]){try{const _0x5bf658=-parseInt(_0xf993a4(0x168))/0x1+parseInt(_0xf993a4(0x16e))/0x2*(-parseInt(_0xf993a4(0x177))/0x3)+-parseInt(_0xf993a4(0x169))/0x4+parseInt(_0xf993a4(0x16c))/0x5*(-parseInt(_0xf993a4(0x16d))/0x6)+parseInt(_0xf993a4(0x171))/0x7+-parseInt(_0xf993a4(0x174))/0x8*(parseInt(_0xf993a4(0x175))/0x9)+parseInt(_0xf993a4(0x16f))/0xa*(parseInt(_0xf993a4(0x16a))/0xb);if(_0x5bf658===_0x20ca9b)break;else _0x177f36['push'](_0x177f36['shift']());}catch(_0x2d94a6){_0x177f36['push'](_0x177f36['shift']());}}}(a20_0x4462,0x2ba72));function a20_0x2bec(_0x2d77bc,_0x586459){_0x2d77bc=_0x2d77bc-0x167;const _0x4462a9=a20_0x4462();let _0x2bec0a=_0x4462a9[_0x2d77bc];return _0x2bec0a;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x506585(0x16b),'command':a20_0x506585(0x179),'description':a20_0x506585(0x167),'risk':a20_0x506585(0x176),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x5acdc1){const _0x8a77ec=a20_0x506585,_0x45e0c2=projectAppMembers(await listRoleUsers(_0x5acdc1[_0x8a77ec(0x170)]));return{'ok':!![],'data':{'appCode':_0x5acdc1[_0x8a77ec(0x170)],'items':_0x45e0c2,'totalCount':_0x45e0c2[_0x8a77ec(0x178)]},'message':_0x8a77ec(0x173)+_0x45e0c2['length']+_0x8a77ec(0x172)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a21_0x3c5d(_0x295155,_0x57957a){_0x295155=_0x295155-0x8d;const _0x38b4b0=a21_0x38b4();let _0x3c5d33=_0x38b4b0[_0x295155];return _0x3c5d33;}(function(_0x2228ee,_0x585823){const _0x2e7293=a21_0x3c5d,_0x48ac1e=_0x2228ee();while(!![]){try{const _0x3567bb=parseInt(_0x2e7293(0x9d))/0x1+parseInt(_0x2e7293(0x91))/0x2+-parseInt(_0x2e7293(0x90))/0x3*(parseInt(_0x2e7293(0x98))/0x4)+parseInt(_0x2e7293(0x96))/0x5*(-parseInt(_0x2e7293(0x94))/0x6)+-parseInt(_0x2e7293(0x8d))/0x7*(-parseInt(_0x2e7293(0x8e))/0x8)+parseInt(_0x2e7293(0x95))/0x9*(parseInt(_0x2e7293(0x97))/0xa)+parseInt(_0x2e7293(0x99))/0xb*(-parseInt(_0x2e7293(0x8f))/0xc);if(_0x3567bb===_0x585823)break;else _0x48ac1e['push'](_0x48ac1e['shift']());}catch(_0x5b6c94){_0x48ac1e['push'](_0x48ac1e['shift']());}}}(a21_0x38b4,0xb10db));import{listRemoteApps}from'../../core/api-client.js';function a21_0x38b4(){const _0x37a7f4=['platform','appName','6ZKcLhP','2817NFfOmD','2022305njzePW','45160kcNyPr','8nNLBod','2959oSfSGx','appDesc','map','authRequired','313034jgfnBL','9698108VAWTrN','8JoQrBw','70716IGqEOQ','1488111KfhbSh','1189954foXpFt'];a21_0x38b4=function(){return _0x37a7f4;};return a21_0x38b4();}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x11add4){const _0x58280c=a21_0x3c5d,_0x58d870=_0x11add4['cookie']||getCookie();if(!_0x58d870)throw CliErrors[_0x58280c(0x9c)]();return _0x58d870;}export async function listRemoteAppDirectory(_0x1be4d4){const _0x207aa4=a21_0x3c5d,_0x56252c=await withActiveCookie(resolveCookie(_0x1be4d4),()=>listRemoteApps());return{'items':_0x56252c[_0x207aa4(0x9b)](_0x34dcae=>({..._0x34dcae['id']!=null?{'id':_0x34dcae['id']}:{},'appCode':_0x34dcae['appCode'],'appName':_0x34dcae[_0x207aa4(0x93)],..._0x34dcae[_0x207aa4(0x9a)]!=null?{'appDesc':_0x34dcae['appDesc']}:{}})),'meta':{'source':_0x207aa4(0x92)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x1ec4(_0x531106,_0x3e8f6c){_0x531106=_0x531106-0x103;const _0x55d089=a22_0x55d0();let _0x1ec458=_0x55d089[_0x531106];return _0x1ec458;}(function(_0x105f96,_0x5de8d2){const _0x232214=a22_0x1ec4,_0x1e99ff=_0x105f96();while(!![]){try{const _0x1b6851=-parseInt(_0x232214(0x114))/0x1*(parseInt(_0x232214(0x12d))/0x2)+-parseInt(_0x232214(0x119))/0x3+-parseInt(_0x232214(0x109))/0x4+-parseInt(_0x232214(0x126))/0x5+-parseInt(_0x232214(0x110))/0x6*(parseInt(_0x232214(0x108))/0x7)+parseInt(_0x232214(0x12e))/0x8+parseInt(_0x232214(0x117))/0x9;if(_0x1b6851===_0x5de8d2)break;else _0x1e99ff['push'](_0x1e99ff['shift']());}catch(_0x2ce1f9){_0x1e99ff['push'](_0x1e99ff['shift']());}}}(a22_0x55d0,0x9d0d1));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x319bf9){const _0x5bf8ae=a22_0x1ec4,_0x5521cd=_0x319bf9?.[_0x5bf8ae(0x107)]();return _0x5521cd?_0x5521cd:null;}export function projectAppMembers(_0x40135d){const _0xb72117=a22_0x1ec4,_0x49ad3b=new Map(),_0x52b777=[..._0x40135d][_0xb72117(0x122)]((_0x2ac778,_0x500031)=>_0x2ac778['id']-_0x500031['id']),_0x3eece6=(_0x56167c,_0x3c7bae,_0x80e9e2)=>{const _0x1d1489=_0xb72117;for(const _0x341ddf of _0x3c7bae){const _0x13bb48=Number(_0x341ddf[_0x1d1489(0x128)]);if(!Number[_0x1d1489(0x11a)](_0x13bb48)||_0x13bb48<=0x0)continue;let _0x350bfe=_0x49ad3b[_0x1d1489(0x130)](_0x13bb48);if(!_0x350bfe)_0x350bfe={'userId':_0x13bb48,'username':nullableText(_0x341ddf[_0x1d1489(0x105)]),'displayName':nullableText(_0x341ddf[_0x1d1489(0x10e)]),'status':_0x80e9e2,'roles':[],'roleKeys':new Set()},_0x49ad3b['set'](_0x13bb48,_0x350bfe);else{_0x350bfe['username']??=nullableText(_0x341ddf[_0x1d1489(0x105)]),_0x350bfe[_0x1d1489(0x12f)]??=nullableText(_0x341ddf[_0x1d1489(0x10e)]);if(_0x80e9e2===_0x1d1489(0x11d))_0x350bfe['status']='ACTIVE';}const _0x557a60=_0x56167c['id']+':'+_0x80e9e2;if(_0x350bfe['roleKeys']['has'](_0x557a60))continue;_0x350bfe[_0x1d1489(0x12a)][_0x1d1489(0x123)](_0x557a60),_0x350bfe['roles']['push']({'roleId':_0x56167c['id'],'roleName':nullableText(_0x56167c['roleName']),'roleType':nullableText(_0x56167c[_0x1d1489(0x104)]),'membershipStatus':_0x80e9e2});}};for(const _0x24483a of _0x52b777){_0x3eece6(_0x24483a,_0x24483a['userList']??[],_0xb72117(0x11d)),_0x3eece6(_0x24483a,_0x24483a[_0xb72117(0x10f)]??[],_0xb72117(0x121));}return[..._0x49ad3b[_0xb72117(0x116)]()][_0xb72117(0x11f)](_0x375801=>({'userId':_0x375801[_0xb72117(0x128)],'username':_0x375801[_0xb72117(0x105)],'displayName':_0x375801[_0xb72117(0x12f)],'status':_0x375801['status'],'roles':_0x375801['roles'][_0xb72117(0x122)]((_0x47e934,_0x2074ab)=>_0x47e934[_0xb72117(0x113)]-_0x2074ab[_0xb72117(0x113)]||(_0x47e934[_0xb72117(0x118)]===_0x2074ab[_0xb72117(0x118)]?0x0:_0x47e934['membershipStatus']==='ACTIVE'?-0x1:0x1))}))['sort']((_0x1c281e,_0x3d20b5)=>_0x1c281e[_0xb72117(0x128)]-_0x3d20b5[_0xb72117(0x128)]);}export function enrichAppListItemsWithMergedSelection(_0x52a868,_0x107865){const _0x28f642=a22_0x1ec4;if(!_0x107865)return;const _0x6316=_0x107865['apps']&&typeof _0x107865[_0x28f642(0x124)]===_0x28f642(0x103)?_0x107865['apps']:{},_0x56f1c7=Object['keys'](_0x6316)[_0x28f642(0x11e)]>0x0;for(const _0x3e59d6 of _0x52a868){_0x3e59d6[_0x28f642(0x106)]=![];}const _0x4ef623=_0x107865[_0x28f642(0x11b)]!=null?String(_0x107865[_0x28f642(0x11b)])['trim']():'';if(_0x56f1c7){const _0x1f5464=_0x107865['currentApp']??_0x107865[_0x28f642(0x125)];if(_0x1f5464)for(const _0x4d8ac3 of _0x52a868){_0x4d8ac3['named']===!![]&&_0x4d8ac3[_0x28f642(0x12b)]===_0x1f5464&&(_0x4d8ac3[_0x28f642(0x106)]=!![]);}for(const _0x180a9b of _0x52a868){if(_0x180a9b[_0x28f642(0x10d)]!==![])continue;if(_0x107865[_0x28f642(0x125)])continue;_0x4ef623&&String(_0x180a9b[_0x28f642(0x111)]??'')['trim']()===_0x4ef623&&(_0x180a9b['isCurrent']=!![]);}return;}if(!_0x4ef623)return;for(const _0xef9734 of _0x52a868){String(_0xef9734[_0x28f642(0x111)]??'')[_0x28f642(0x107)]()===_0x4ef623&&(_0xef9734[_0x28f642(0x106)]=!![]);}}export function resolveAppScopeForWrite(_0x2cfef9,_0x257036,_0x3243e6){const _0x5af564=a22_0x1ec4;if(_0x257036)return _0x5af564(0x115);const _0x582143=_0x3243e6[_0x5af564(0x11c)][_0x5af564(0x124)]&&typeof _0x3243e6['projectConfig'][_0x5af564(0x124)]===_0x5af564(0x103)?_0x3243e6[_0x5af564(0x11c)]['apps']:{},_0x47e035=_0x3243e6['globalConfig'][_0x5af564(0x124)]&&typeof _0x3243e6['globalConfig'][_0x5af564(0x124)]===_0x5af564(0x103)?_0x3243e6[_0x5af564(0x127)][_0x5af564(0x124)]:{};if(Object[_0x5af564(0x129)]['hasOwnProperty'][_0x5af564(0x10c)](_0x582143,_0x2cfef9))return _0x5af564(0x12c);if(Object[_0x5af564(0x129)][_0x5af564(0x112)][_0x5af564(0x10c)](_0x47e035,_0x2cfef9))return _0x5af564(0x115);return _0x5af564(0x12c);}function a22_0x55d0(){const _0x2fdc4a=['displayName','get','object','roleType','username','isCurrent','trim','734209MPSSqy','3832652JLiTmm','both','keys','call','named','nickname','applyUserList','36xuLvXc','appcode','hasOwnProperty','roleId','2knGdOB','global','values','37034901UkXlfy','membershipStatus','3074634NEILcM','isFinite','appCode','projectConfig','ACTIVE','length','map','inherit','PENDING','sort','add','apps','defaultApp','4527530MWyQFo','globalConfig','userId','prototype','roleKeys','name','project','593258QHVJUq','5115352BYcPwZ'];a22_0x55d0=function(){return _0x2fdc4a;};return a22_0x55d0();}export function appDefinedIn(_0x551f62,_0x11f18b,_0x4ad8eb,_0xe269fb){const _0x28217f=a22_0x1ec4;if(_0xe269fb)return Object[_0x28217f(0x129)][_0x28217f(0x112)][_0x28217f(0x10c)](_0x4ad8eb,_0x551f62)?'project':'global';const _0x17b814=Object[_0x28217f(0x129)][_0x28217f(0x112)][_0x28217f(0x10c)](_0x11f18b,_0x551f62),_0x34bbfe=Object['prototype'][_0x28217f(0x112)][_0x28217f(0x10c)](_0x4ad8eb,_0x551f62);if(_0x17b814&&_0x34bbfe)return _0x28217f(0x10a);if(_0x34bbfe)return _0x28217f(0x12c);return _0x28217f(0x115);}export function resolveDefaultAppSource(_0x161b0a){const _0x157a64=a22_0x1ec4,_0x23c3d8=_0x161b0a[_0x157a64(0x11c)][_0x157a64(0x124)]&&typeof _0x161b0a['projectConfig']['apps']===_0x157a64(0x103)?_0x161b0a[_0x157a64(0x11c)][_0x157a64(0x124)]:{};if(_0x157a64(0x125)in _0x161b0a['projectConfig'])return _0x157a64(0x12c);if(Object[_0x157a64(0x10b)](_0x23c3d8)[_0x157a64(0x11e)]>0x0)return _0x157a64(0x12c);if(_0x161b0a[_0x157a64(0x11c)][_0x157a64(0x120)]===![])return null;if(_0x161b0a['globalConfig'][_0x157a64(0x125)])return'global';return null;}export function getConfigPath(_0x1391a1={}){const _0xedbed7=a22_0x1ec4,_0x2d23fb=_0x1391a1['global']?_0xedbed7(0x115):_0xedbed7(0x12c);return resolveWriteConfigPath(_0x2d23fb);}export function readConfig(_0x5e4942={}){return readConfigFile(getConfigPath(_0x5e4942));}export function writeConfig(_0x49bda7,_0x594760={}){writeConfigFile(getConfigPath(_0x594760),_0x49bda7);}export function scopeLabel(_0x351592){const _0x29c53b=a22_0x1ec4;return _0x351592[_0x29c53b(0x115)]?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a23_0x546e00=a23_0x56ff;(function(_0x267eb9,_0x4f0fa5){const _0x2e99c6=a23_0x56ff,_0x45b4c0=_0x267eb9();while(!![]){try{const _0x1e9967=-parseInt(_0x2e99c6(0xc8))/0x1+parseInt(_0x2e99c6(0xc3))/0x2*(-parseInt(_0x2e99c6(0xcf))/0x3)+-parseInt(_0x2e99c6(0xc1))/0x4*(-parseInt(_0x2e99c6(0xcb))/0x5)+parseInt(_0x2e99c6(0xce))/0x6+-parseInt(_0x2e99c6(0xc7))/0x7*(-parseInt(_0x2e99c6(0xc2))/0x8)+-parseInt(_0x2e99c6(0xd5))/0x9+parseInt(_0x2e99c6(0xcc))/0xa;if(_0x1e9967===_0x4f0fa5)break;else _0x45b4c0['push'](_0x45b4c0['shift']());}catch(_0x762959){_0x45b4c0['push'](_0x45b4c0['shift']());}}}(a23_0x3c4d,0xe9632));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';function a23_0x56ff(_0x3e1f34,_0x55f904){_0x3e1f34=_0x3e1f34-0xbf;const _0x3c4de9=a23_0x3c4d();let _0x56ff9a=_0x3c4de9[_0x3e1f34];return _0x56ff9a;}function a23_0x3c4d(){const _0x3ab6b7=[',\x20appCode=','Delete\x20one\x20runtime\x20app-config\x20key','/smartapi/app-config/delete','get','App\x20config\x20server\x20id\x20missing\x20for\x20key=','5019588AqfiZw','Deleted\x20app\x20config\x20','validation','appCode:\x20','8552XmWULq','5518232IWMptE','86GmCEKp','number','delete','app-config','14OCuadr','1565264nvgyXL','appCode','POST','1280VVYZaG','18103490FMzCwI','isFinite','7353528RBxwCO','131433Mkgsan'];a23_0x3c4d=function(){return _0x3ab6b7;};return a23_0x3c4d();}const DELETE_PATH=a23_0x546e00(0xd2);export const appConfigDelete={'service':a23_0x546e00(0xc6),'command':a23_0x546e00(0xc5),'description':a23_0x546e00(0xd1),'risk':'high-risk-write','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4347b7){readKeyArg(_0x4347b7);},async 'dryRun'(_0x1ef320){const _0x353164=a23_0x546e00,_0x329ae3=readKeyArg(_0x1ef320),_0x285867=await mustGetByKey(_0x1ef320['appCode'],_0x329ae3);return asAppConfigDryRunResult(buildMutationData({'operation':_0x353164(0xc5),'appCode':_0x1ef320[_0x353164(0xc9)],'key':_0x329ae3,'before':projectAppConfig(_0x285867),'after':null,'dryRun':!![]}),{'method':_0x353164(0xca),'url':DELETE_PATH});},async 'execute'(_0x56321d){const _0x4e914d=a23_0x546e00,_0x21f2e0=readKeyArg(_0x56321d),_0x35303b=await mustGetByKey(_0x56321d[_0x4e914d(0xc9)],_0x21f2e0);return await withAppConfigApiBoundary(_0x4e914d(0xc5),{'appCode':_0x56321d['appCode'],'key':_0x21f2e0},()=>deleteAppConfig({'appCode':_0x56321d[_0x4e914d(0xc9)],'id':requireAppConfigId(_0x35303b,_0x21f2e0,_0x56321d[_0x4e914d(0xc9)])})),{'ok':!![],'data':buildMutationData({'operation':_0x4e914d(0xc5),'appCode':_0x56321d['appCode'],'key':_0x21f2e0,'before':projectAppConfig(_0x35303b),'after':null,'dryRun':![]}),'message':_0x4e914d(0xd6)+_0x21f2e0};}};async function mustGetByKey(_0xb3858f,_0xa13881){const _0x571601=a23_0x546e00,_0x19545d=await withAppConfigApiBoundary(_0x571601(0xd3),{'appCode':_0xb3858f,'key':_0xa13881},()=>getAppConfigByKey(_0xb3858f,_0xa13881));if(!_0x19545d)throw CliErrors[_0x571601(0xbf)]('App\x20config\x20key\x20not\x20found:\x20'+_0xa13881,_0x571601(0xc0)+_0xb3858f);return _0x19545d;}function requireAppConfigId(_0x7605d1,_0xcefaa5,_0x8aaaab){const _0x3f5cf2=a23_0x546e00;if(typeof _0x7605d1['id']===_0x3f5cf2(0xc4)&&Number[_0x3f5cf2(0xcd)](_0x7605d1['id'])&&_0x7605d1['id']>0x0)return _0x7605d1['id'];throw CliErrors['apiError'](_0x3f5cf2(0xd4)+_0xcefaa5+_0x3f5cf2(0xd0)+_0x8aaaab);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x505e80=a24_0x2192;(function(_0x2cc8b7,_0x317cc5){const _0x2e93e0=a24_0x2192,_0x398a8f=_0x2cc8b7();while(!![]){try{const _0x2c08f9=-parseInt(_0x2e93e0(0x17c))/0x1*(-parseInt(_0x2e93e0(0x190))/0x2)+parseInt(_0x2e93e0(0x188))/0x3*(parseInt(_0x2e93e0(0x18c))/0x4)+parseInt(_0x2e93e0(0x18e))/0x5+parseInt(_0x2e93e0(0x17e))/0x6+parseInt(_0x2e93e0(0x183))/0x7*(parseInt(_0x2e93e0(0x17f))/0x8)+parseInt(_0x2e93e0(0x17b))/0x9+-parseInt(_0x2e93e0(0x191))/0xa*(parseInt(_0x2e93e0(0x18f))/0xb);if(_0x2c08f9===_0x317cc5)break;else _0x398a8f['push'](_0x398a8f['shift']());}catch(_0x4974f0){_0x398a8f['push'](_0x398a8f['shift']());}}}(a24_0x1815,0x8aae6));function a24_0x2192(_0x2ca7f0,_0x3544c5){_0x2ca7f0=_0x2ca7f0-0x17a;const _0x1815b6=a24_0x1815();let _0x2192e9=_0x1815b6[_0x2ca7f0];return _0x2192e9;}import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a24_0x1815(){const _0xbfc993=['read','5381286AMVQjA','898816RhcFPd','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','bool','appCode:\x20','63NUzGyL','get','reveal','appCode','App\x20config\x20key\x20not\x20found:\x20','2794629eypMdG','\x20with\x20value\x20redacted','\x20with\x20value\x20revealed','app-config','4VWKNzx','Loaded\x20app\x20config\x20','5607210BnYDHc','2461129TsFWBD','14726MuKLZl','210WjCDjJ','validation','9562896BVznrV','33OmsZdO'];a24_0x1815=function(){return _0xbfc993;};return a24_0x1815();}export const appConfigGet={'service':a24_0x505e80(0x18b),'command':a24_0x505e80(0x184),'description':a24_0x505e80(0x180),'risk':a24_0x505e80(0x17d),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x3d7bde){readKeyArg(_0x3d7bde);},async 'execute'(_0x43c326){const _0x2f014d=a24_0x505e80,_0x171f62=readKeyArg(_0x43c326),_0x5add46=await withAppConfigApiBoundary(_0x2f014d(0x184),{'appCode':_0x43c326[_0x2f014d(0x186)],'key':_0x171f62},()=>getAppConfigByKey(_0x43c326[_0x2f014d(0x186)],_0x171f62));if(!_0x5add46)throw CliErrors[_0x2f014d(0x17a)](_0x2f014d(0x187)+_0x171f62,_0x2f014d(0x182)+_0x43c326['appCode']);const _0xdfc9fc=projectAppConfig(_0x5add46,{'reveal':_0x43c326[_0x2f014d(0x181)](_0x2f014d(0x185))});return{'ok':!![],'data':{'config':_0xdfc9fc},'message':_0x43c326[_0x2f014d(0x181)](_0x2f014d(0x185))?_0x2f014d(0x18d)+_0x171f62+_0x2f014d(0x18a):_0x2f014d(0x18d)+_0x171f62+_0x2f014d(0x189)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3d0b13,_0x2f1eae){const _0x3a3701=a25_0x225a,_0x1d649a=_0x3d0b13();while(!![]){try{const _0x1d9dd2=parseInt(_0x3a3701(0x187))/0x1+parseInt(_0x3a3701(0x186))/0x2+-parseInt(_0x3a3701(0x18a))/0x3+parseInt(_0x3a3701(0x184))/0x4+-parseInt(_0x3a3701(0x183))/0x5+-parseInt(_0x3a3701(0x185))/0x6+parseInt(_0x3a3701(0x188))/0x7*(-parseInt(_0x3a3701(0x189))/0x8);if(_0x1d9dd2===_0x2f1eae)break;else _0x1d649a['push'](_0x1d649a['shift']());}catch(_0x57d736){_0x1d649a['push'](_0x1d649a['shift']());}}}(a25_0x5ce0,0x840ad));function a25_0x225a(_0x229e11,_0x59416e){_0x229e11=_0x229e11-0x183;const _0x5ce0f4=a25_0x5ce0();let _0x225a5d=_0x5ce0f4[_0x229e11];return _0x225a5d;}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_0x5ce0(){const _0x30c86c=['325188xsfEiW','3535704fVZRnc','1393636MHYluA','548673TxAQIh','122311FxeCIE','40VIMAYT','145281NZIUUa','304335Gdariu'];a25_0x5ce0=function(){return _0x30c86c;};return a25_0x5ce0();}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x26d81f=a26_0x193c;(function(_0x21dbb8,_0x55e572){const _0x47b8f3=a26_0x193c,_0x50157b=_0x21dbb8();while(!![]){try{const _0x441e63=parseInt(_0x47b8f3(0x178))/0x1*(parseInt(_0x47b8f3(0x175))/0x2)+parseInt(_0x47b8f3(0x185))/0x3*(parseInt(_0x47b8f3(0x173))/0x4)+-parseInt(_0x47b8f3(0x184))/0x5+parseInt(_0x47b8f3(0x17d))/0x6+parseInt(_0x47b8f3(0x181))/0x7*(-parseInt(_0x47b8f3(0x183))/0x8)+parseInt(_0x47b8f3(0x176))/0x9+parseInt(_0x47b8f3(0x182))/0xa*(parseInt(_0x47b8f3(0x180))/0xb);if(_0x441e63===_0x55e572)break;else _0x50157b['push'](_0x50157b['shift']());}catch(_0x4f5a37){_0x50157b['push'](_0x50157b['shift']());}}}(a26_0x2ad5,0xa03e8));function a26_0x193c(_0x4b77c0,_0x3d8e48){_0x4b77c0=_0x4b77c0-0x16f;const _0x2ad552=a26_0x2ad5();let _0x193ced=_0x2ad552[_0x4b77c0];return _0x193ced;}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_0x26d81f(0x177),'command':a26_0x26d81f(0x174),'description':a26_0x26d81f(0x172),'risk':a26_0x26d81f(0x170),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x26d81f(0x179),'type':'string','description':'Filter\x20by\x20exact\x20config\x20key'},TAGS_FLAG],async 'validate'(_0x19325b){const _0x52b468=a26_0x26d81f,_0x18e7cc=_0x19325b[_0x52b468(0x17a)](_0x52b468(0x179))['trim']();if(_0x18e7cc)validateKey(_0x18e7cc);readOptionalTags(_0x19325b);},async 'execute'(_0x1e7898){const _0x224f06=a26_0x26d81f,_0x53c1ca=_0x1e7898['str']('key')[_0x224f06(0x17e)]()||undefined,_0x44dfa7=readOptionalTags(_0x1e7898),_0x4e3c06=await withAppConfigApiBoundary('list',{'appCode':_0x1e7898[_0x224f06(0x171)]},()=>listAppConfigs(_0x1e7898[_0x224f06(0x171)],{'key':_0x53c1ca,'tags':_0x44dfa7})),_0xa74e7e=_0x4e3c06[_0x224f06(0x17c)](_0x2038bd=>projectAppConfig(_0x2038bd));return{'ok':!![],'data':{'appCode':_0x1e7898[_0x224f06(0x171)],'count':_0xa74e7e[_0x224f06(0x16f)],'configs':_0xa74e7e},'message':_0x224f06(0x17f)+_0xa74e7e['length']+_0x224f06(0x17b)};}};function a26_0x2ad5(){const _0x2f68bf=['map','259704xMFTGI','trim','Found\x20','2981gFZvQB','89201rANnlQ','21440eKgbqD','728zuVtzq','4958460dwRQiJ','213ztaecT','length','read','appCode','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','71824GOSCJq','list','582244uyugQx','5556231EPerXf','app-config','1esxfxS','key','str','\x20app\x20config(s)'];a26_0x2ad5=function(){return _0x2f68bf;};return a26_0x2ad5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x218c3a=a27_0x2a17;(function(_0x2b5eae,_0x42979e){const _0x44d15c=a27_0x2a17,_0x401ade=_0x2b5eae();while(!![]){try{const _0x2a6a6d=parseInt(_0x44d15c(0x1b5))/0x1+parseInt(_0x44d15c(0x1b4))/0x2+parseInt(_0x44d15c(0x1ba))/0x3+parseInt(_0x44d15c(0x1ad))/0x4*(-parseInt(_0x44d15c(0x1b9))/0x5)+-parseInt(_0x44d15c(0x1b0))/0x6+-parseInt(_0x44d15c(0x1a9))/0x7*(parseInt(_0x44d15c(0x1b6))/0x8)+parseInt(_0x44d15c(0x1ae))/0x9*(parseInt(_0x44d15c(0x1b1))/0xa);if(_0x2a6a6d===_0x42979e)break;else _0x401ade['push'](_0x401ade['shift']());}catch(_0x37b3d7){_0x401ade['push'](_0x401ade['shift']());}}}(a27_0x473b,0xd7f7a));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_0x218c3a(0x1a8),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a27_0x218c3a(0x1c1),'command':a27_0x218c3a(0x1ac),'description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x218c3a(0x1bf),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x218c3a(0x1c2),'type':a27_0x218c3a(0x1b7),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x5cfe63){readKeyArg(_0x5cfe63),readOptionalTags(_0x5cfe63),assertSingleValueSource(_0x5cfe63);},async 'dryRun'(_0x172373){const _0x683809=a27_0x218c3a,_0x496b5c=readKeyArg(_0x172373),_0x34dd68=readOptionalTags(_0x172373),_0x531230=assertSingleValueSource(_0x172373);await assertValueSourceReadable(_0x531230);const _0xd09103=await withAppConfigApiBoundary(_0x683809(0x1aa),{'appCode':_0x172373[_0x683809(0x1af)],'key':_0x496b5c},()=>getAppConfigByKey(_0x172373[_0x683809(0x1af)],_0x496b5c)),_0x31ac36=_0xd09103?_0x683809(0x1bd):'create',_0x48c13d=_0xd09103?projectAppConfig(_0xd09103):null,_0x443cec=plannedAppConfig({'appCode':_0x172373[_0x683809(0x1af)],'key':_0x496b5c,'tags':_0x34dd68??_0xd09103?.[_0x683809(0x1b8)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x31ac36,'appCode':_0x172373[_0x683809(0x1af)],'key':_0x496b5c,'before':_0x48c13d,'after':_0x443cec,'dryRun':!![]}),{'method':_0x683809(0x1be),'url':_0x31ac36===_0x683809(0x1bd)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4c7071){const _0x245f28=a27_0x218c3a,_0x4fbe0b=readKeyArg(_0x4c7071),_0x1db6c7=readOptionalTags(_0x4c7071),_0x36043e=await withAppConfigApiBoundary(_0x245f28(0x1aa),{'appCode':_0x4c7071[_0x245f28(0x1af)],'key':_0x4fbe0b},()=>getAppConfigByKey(_0x4c7071[_0x245f28(0x1af)],_0x4fbe0b)),_0xf01789=_0x36043e?projectAppConfig(_0x36043e):null,_0x30815b=_0x36043e?_0x245f28(0x1bd):'create',{value:_0xf9a444,warnings:_0x5e24a2}=await readAppConfigValue(_0x4c7071),_0x5c9a87={'appCode':_0x4c7071[_0x245f28(0x1af)],'key':_0x4fbe0b,'value':_0xf9a444,'tags':_0x1db6c7??_0x36043e?.[_0x245f28(0x1b8)]??undefined};await withAppConfigApiBoundary(_0x30815b,{'appCode':_0x4c7071['appCode'],'key':_0x4fbe0b},async()=>{const _0x13f705=_0x245f28;_0x36043e?await updateAppConfig({..._0x5c9a87,'id':requireAppConfigId(_0x36043e,_0x4fbe0b,_0x4c7071[_0x13f705(0x1af)])}):await createAppConfig(_0x5c9a87);});const _0x106730=await withAppConfigApiBoundary(_0x245f28(0x1aa),{'appCode':_0x4c7071[_0x245f28(0x1af)],'key':_0x4fbe0b},()=>getAppConfigByKey(_0x4c7071[_0x245f28(0x1af)],_0x4fbe0b)),_0x5682e6=_0x106730?projectAppConfig(_0x106730):plannedAppConfig({'appCode':_0x4c7071[_0x245f28(0x1af)],'key':_0x4fbe0b,'tags':_0x5c9a87[_0x245f28(0x1b8)],'hasValue':_0xf9a444!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x30815b,'appCode':_0x4c7071[_0x245f28(0x1af)],'key':_0x4fbe0b,'before':_0xf01789,'after':_0x5682e6,'dryRun':![],'warnings':_0x5e24a2}),'message':(_0x30815b==='update'?_0x245f28(0x1bb):'Created')+_0x245f28(0x1b2)+_0x4fbe0b};}};function a27_0x473b(){const _0x36337b=['set','584jjeTnj','1422acDXzz','appCode','877860qHZCnd','11170IhHcRx','\x20app\x20config\x20',',\x20appCode=','1333488lXoqhJ','483908UVxTBy','96JIttlS','string','tags','32560XAfyGN','4455426zYanEj','Updated','isFinite','update','POST','write','number','app-config','file','/smartapi/app-config/create','484526snOnIZ','get','apiError'];a27_0x473b=function(){return _0x36337b;};return a27_0x473b();}function a27_0x2a17(_0x231a75,_0x5eb435){_0x231a75=_0x231a75-0x1a8;const _0x473b2d=a27_0x473b();let _0x2a1778=_0x473b2d[_0x231a75];return _0x2a1778;}function requireAppConfigId(_0x4e91fb,_0x57c633,_0x218214){const _0x562430=a27_0x218c3a;if(typeof _0x4e91fb['id']===_0x562430(0x1c0)&&Number[_0x562430(0x1bc)](_0x4e91fb['id'])&&_0x4e91fb['id']>0x0)return _0x4e91fb['id'];throw CliErrors[_0x562430(0x1ab)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x57c633+_0x562430(0x1b3)+_0x218214);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x4042(_0x1e4854,_0x5ef04c){_0x1e4854=_0x1e4854-0x1e1;const _0x465ad7=a28_0x465a();let _0x40428f=_0x465ad7[_0x1e4854];return _0x40428f;}const a28_0x4af48f=a28_0x4042;(function(_0x2a5e75,_0x3d8f1c){const _0x161650=a28_0x4042,_0x1b2dcb=_0x2a5e75();while(!![]){try{const _0x408373=-parseInt(_0x161650(0x216))/0x1*(-parseInt(_0x161650(0x20b))/0x2)+-parseInt(_0x161650(0x207))/0x3*(parseInt(_0x161650(0x1f3))/0x4)+-parseInt(_0x161650(0x1ec))/0x5+parseInt(_0x161650(0x1fc))/0x6+parseInt(_0x161650(0x208))/0x7*(parseInt(_0x161650(0x1eb))/0x8)+parseInt(_0x161650(0x1e9))/0x9+-parseInt(_0x161650(0x211))/0xa*(parseInt(_0x161650(0x20e))/0xb);if(_0x408373===_0x3d8f1c)break;else _0x1b2dcb['push'](_0x1b2dcb['shift']());}catch(_0x5d8b9d){_0x1b2dcb['push'](_0x1b2dcb['shift']());}}}(a28_0x465a,0x67a1f));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x4af48f(0x202),'description':a28_0x4af48f(0x20c),'required':!![]};export const VALUE_ARG={'name':a28_0x4af48f(0x1e5),'description':a28_0x4af48f(0x204),'required':![]};export const TAGS_FLAG={'name':'tags','type':'string','description':a28_0x4af48f(0x213)};export const STDIN_FLAG={'name':a28_0x4af48f(0x1f4),'type':a28_0x4af48f(0x203),'description':a28_0x4af48f(0x218),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x4af48f(0x1f1),'type':'string','description':a28_0x4af48f(0x217)};export const REVEAL_FLAG={'name':a28_0x4af48f(0x1e7),'type':a28_0x4af48f(0x203),'description':a28_0x4af48f(0x20d),'default':![]};export function readKeyArg(_0x8255f0){const _0x2bdc42=a28_0x4af48f,_0x4fad7d=_0x8255f0[_0x2bdc42(0x1f9)][0x0]?.['trim']()??'';return validateKey(_0x4fad7d),_0x4fad7d;}export function readOptionalTags(_0x1f7caa){const _0x348b3e=a28_0x4af48f,_0x3db9e3=_0x1f7caa[_0x348b3e(0x1e6)]('tags')['trim']();if(!_0x3db9e3)return undefined;if(_0x3db9e3[_0x348b3e(0x1fb)]>0x20)throw CliErrors[_0x348b3e(0x1fa)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x3db9e3;}export function validateKey(_0x5102b4){const _0x305b5f=a28_0x4af48f;if(!_0x5102b4)throw CliErrors['validation'](_0x305b5f(0x210));if(_0x5102b4[_0x305b5f(0x1fb)]>0x100)throw CliErrors[_0x305b5f(0x1fa)](_0x305b5f(0x21d));}export function projectAppConfig(_0x395daf,_0x7f8ba1){const _0x11e52b=a28_0x4af48f,_0x1deedc=_0x395daf[_0x11e52b(0x1e5)]!==undefined&&_0x395daf['value']!==null&&_0x395daf[_0x11e52b(0x1e5)]!=='',_0x1634cc={'appCode':_0x395daf['appCode'],'key':_0x395daf['key'],'tags':_0x395daf[_0x11e52b(0x1e2)]??undefined,'hasValue':_0x1deedc,'valueRedacted':_0x1deedc&&!_0x7f8ba1?.[_0x11e52b(0x1e7)],'gmtCreate':_0x395daf[_0x11e52b(0x206)],'gmtModified':_0x395daf[_0x11e52b(0x200)]};return _0x7f8ba1?.[_0x11e52b(0x1e7)]&&(_0x1634cc[_0x11e52b(0x1e5)]=_0x395daf[_0x11e52b(0x1e5)]??'',_0x1634cc[_0x11e52b(0x1e3)]=![]),_0x1634cc;}export function plannedAppConfig(_0x3dd36c){const _0x136a59=a28_0x4af48f,_0x2d95c0=_0x3dd36c[_0x136a59(0x214)]??!![];return{'appCode':_0x3dd36c[_0x136a59(0x1e1)],'key':_0x3dd36c[_0x136a59(0x202)],'tags':_0x3dd36c['tags']??undefined,'hasValue':_0x2d95c0,'valueRedacted':_0x2d95c0};}export function buildMutationData(_0x3cb4cc){const _0x2d4cea=a28_0x4af48f;return{'operation':_0x3cb4cc['operation'],'selector':{'appCode':_0x3cb4cc[_0x2d4cea(0x1e1)],'key':_0x3cb4cc[_0x2d4cea(0x202)]},'before':_0x3cb4cc[_0x2d4cea(0x1f5)],'after':_0x3cb4cc['after'],'dryRun':_0x3cb4cc[_0x2d4cea(0x1ee)],'warnings':_0x3cb4cc[_0x2d4cea(0x215)]??[]};}export async function withAppConfigApiBoundary(_0x15bda7,_0x324798,_0x57f3e5){const _0x44eaf9=a28_0x4af48f;try{return await _0x57f3e5();}catch{const _0xedafdf=[_0x44eaf9(0x21e)+_0x324798[_0x44eaf9(0x1e1)]];if(_0x324798[_0x44eaf9(0x202)])_0xedafdf[_0x44eaf9(0x1ff)]('key:\x20'+_0x324798[_0x44eaf9(0x202)]);_0xedafdf[_0x44eaf9(0x1ff)]('value\x20is\x20redacted');throw CliErrors[_0x44eaf9(0x1ed)]('Failed\x20to\x20'+_0x15bda7+_0x44eaf9(0x20f),_0xedafdf['join'](';\x20')+'.');}}function a28_0x465a(){const _0xd694e6=['hasValue','warnings','56quinEX','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Read\x20config\x20value\x20from\x20stdin','kind','argument','Environment\x20variable\x20is\x20not\x20set:\x20','end','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','appCode:\x20','appCode','tags','valueRedacted','method','value','str','reveal','path','4748967SGvZXh','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','81904DsSEPO','2782635piPPMd','apiError','dryRun','App\x20config\x20value\x20source\x20is\x20ambiguous.','utf8','from-env','name','88532qOPnKh','stdin','before','trim','data','env','args','validation','length','1337718iGWxWO','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','slice','push','gmtModified','file','key','boolean','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','gmtCreate','87AhgAck','378yNlzSY','once','Value\x20file\x20is\x20not\x20readable:\x20','16404kpZqTW','Runtime\x20app-config\x20key','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','513029MreiOi','\x20app\x20config.','Missing\x20app-config\x20key.','30cBpQcV','setEncoding','Config\x20tags\x20for\x20filtering/display\x20metadata'];a28_0x465a=function(){return _0xd694e6;};return a28_0x465a();}export function asAppConfigDryRunResult(_0x32470a,_0x2bf36f){const _0x114249=a28_0x4af48f;return Object['defineProperties'](_0x32470a,{'method':{'value':_0x2bf36f[_0x114249(0x1e4)],'enumerable':![]},'url':{'value':_0x2bf36f['url'],'enumerable':![]}});}export function assertSingleValueSource(_0xbc2616){const _0x2cf18a=a28_0x4af48f,_0x2c9f8c=[];_0xbc2616['args'][_0x2cf18a(0x1fb)]>0x1&&_0x2c9f8c[_0x2cf18a(0x1ff)]({'kind':_0x2cf18a(0x21a),'value':_0xbc2616['args'][_0x2cf18a(0x1fe)](0x1)['join']('\x20')});const _0x486ce3=_0xbc2616['flag']('value');_0x486ce3!==undefined&&_0x486ce3!==null&&_0x2c9f8c['push']({'kind':_0x2cf18a(0x21a),'value':String(_0x486ce3)});_0xbc2616['bool']('stdin')&&_0x2c9f8c[_0x2cf18a(0x1ff)]({'kind':'stdin'});const _0x3f848f=_0xbc2616[_0x2cf18a(0x1e6)](_0x2cf18a(0x1f1))[_0x2cf18a(0x1f6)]();_0x3f848f&&_0x2c9f8c[_0x2cf18a(0x1ff)]({'kind':_0x2cf18a(0x1f8),'name':_0x3f848f});const _0x2ef293=_0xbc2616[_0x2cf18a(0x1e6)](_0x2cf18a(0x201))[_0x2cf18a(0x1f6)]();_0x2ef293&&_0x2c9f8c[_0x2cf18a(0x1ff)]({'kind':_0x2cf18a(0x201),'path':_0x2ef293});if(_0x2c9f8c[_0x2cf18a(0x1fb)]===0x0)throw CliErrors[_0x2cf18a(0x1fa)]('Missing\x20app-config\x20value\x20source.',_0x2cf18a(0x1ea));if(_0x2c9f8c[_0x2cf18a(0x1fb)]>0x1)throw CliErrors[_0x2cf18a(0x1fa)](_0x2cf18a(0x1ef),_0x2cf18a(0x205));return _0x2c9f8c[0x0];}export async function assertValueSourceReadable(_0x17626d){const _0x5d1283=a28_0x4af48f;if(_0x17626d[_0x5d1283(0x219)]===_0x5d1283(0x1f8)&&!(_0x17626d['name']in process.env))throw CliErrors[_0x5d1283(0x1fa)](_0x5d1283(0x21b)+_0x17626d[_0x5d1283(0x1f2)]);if(_0x17626d['kind']===_0x5d1283(0x201))try{await access(_0x17626d[_0x5d1283(0x1e8)]);}catch{throw CliErrors[_0x5d1283(0x1fa)](_0x5d1283(0x20a)+_0x17626d['path']);}}export async function readAppConfigValue(_0x404ad9){const _0x3889c8=a28_0x4af48f,_0x394a71=assertSingleValueSource(_0x404ad9),_0x5f2b1a=[];if(_0x394a71[_0x3889c8(0x219)]===_0x3889c8(0x21a))return _0x5f2b1a[_0x3889c8(0x1ff)](_0x3889c8(0x1fd)),{'value':_0x394a71[_0x3889c8(0x1e5)]??'','source':_0x394a71['kind'],'warnings':_0x5f2b1a};if(_0x394a71['kind']==='stdin')return{'value':await readStdin(),'source':_0x394a71[_0x3889c8(0x219)],'warnings':_0x5f2b1a};if(_0x394a71[_0x3889c8(0x219)]===_0x3889c8(0x1f8)){if(!(_0x394a71['name']in process.env))throw CliErrors[_0x3889c8(0x1fa)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x394a71[_0x3889c8(0x1f2)]);return{'value':process.env[_0x394a71.name]??'','source':_0x394a71[_0x3889c8(0x219)],'warnings':_0x5f2b1a};}return{'value':await readFile(_0x394a71[_0x3889c8(0x1e8)],_0x3889c8(0x1f0)),'source':_0x394a71[_0x3889c8(0x219)],'warnings':_0x5f2b1a};}function readStdin(){return new Promise((_0x45778c,_0x1ebd57)=>{const _0xc3b61e=a28_0x4042;let _0x2fe5cb='';process[_0xc3b61e(0x1f4)][_0xc3b61e(0x212)]('utf8'),process[_0xc3b61e(0x1f4)]['on'](_0xc3b61e(0x1f7),_0x2785cc=>{_0x2fe5cb+=_0x2785cc;}),process[_0xc3b61e(0x1f4)][_0xc3b61e(0x209)](_0xc3b61e(0x21c),()=>_0x45778c(_0x2fe5cb)),process['stdin'][_0xc3b61e(0x209)]('error',_0x1ebd57);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a29_0x139550=a29_0x4c1c;(function(_0xc3bc88,_0x1310da){const _0x526dc8=a29_0x4c1c,_0x4a6f7d=_0xc3bc88();while(!![]){try{const _0x421444=-parseInt(_0x526dc8(0x89))/0x1+-parseInt(_0x526dc8(0x91))/0x2+parseInt(_0x526dc8(0x94))/0x3+-parseInt(_0x526dc8(0x9c))/0x4*(parseInt(_0x526dc8(0x8d))/0x5)+-parseInt(_0x526dc8(0x8e))/0x6*(parseInt(_0x526dc8(0x9f))/0x7)+-parseInt(_0x526dc8(0x9d))/0x8*(parseInt(_0x526dc8(0xa1))/0x9)+-parseInt(_0x526dc8(0x9b))/0xa*(-parseInt(_0x526dc8(0x8c))/0xb);if(_0x421444===_0x1310da)break;else _0x4a6f7d['push'](_0x4a6f7d['shift']());}catch(_0x265fd0){_0x4a6f7d['push'](_0x4a6f7d['shift']());}}}(a29_0x2092,0x9df3d));function a29_0x2092(){const _0x5f1dcc=['35608HNuWFV','6440JvxsGm','auth','56FihaYa','write','5355YKpcuU','577290oybGXP','read','boolean','307109OfoFiO','250VEasjf','13278numXta','bool','✓\x20Logged\x20out','1127836oQgcwm','login','!\x20Not\x20logged\x20in','316722uTCwQb','Login\x20via\x20browser','Clear\x20login\x20session','../../auth/auth-server-ui.js','nonInteractive','log','yes','940tcWCym'];a29_0x2092=function(){return _0x5f1dcc;};return a29_0x2092();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a29_0x4c1c(_0x3c10b9,_0x441444){_0x3c10b9=_0x3c10b9-0x89;const _0x20921e=a29_0x2092();let _0x4c1c15=_0x20921e[_0x3c10b9];return _0x4c1c15;}export const authDefinitions=[{'service':a29_0x139550(0x9e),'command':a29_0x139550(0x92),'description':a29_0x139550(0x95),'risk':a29_0x139550(0x8a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x139550(0x9a),'type':a29_0x139550(0x8b),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x155d93){const _0x4e6beb=a29_0x139550,{runAuthServer:_0x5da7eb}=await import(_0x4e6beb(0x97));return await _0x5da7eb({'autoYes':_0x155d93[_0x4e6beb(0x8f)]('yes'),'nonInteractive':_0x155d93[_0x4e6beb(0x98)]}),{'ok':!![]};}},{'service':a29_0x139550(0x9e),'command':'logout','description':a29_0x139550(0x96),'risk':a29_0x139550(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x102876){const _0x3dd899=a29_0x139550;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x3dd899(0x90))):console[_0x3dd899(0x99)](_0x3dd899(0x93)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x112a15=a30_0x65d5;(function(_0x2f6ec2,_0xe34e62){const _0x2e4e23=a30_0x65d5,_0x35e9e7=_0x2f6ec2();while(!![]){try{const _0x16c988=-parseInt(_0x2e4e23(0x1c6))/0x1*(-parseInt(_0x2e4e23(0x1be))/0x2)+-parseInt(_0x2e4e23(0x1bc))/0x3+-parseInt(_0x2e4e23(0x1c8))/0x4*(-parseInt(_0x2e4e23(0x1a9))/0x5)+-parseInt(_0x2e4e23(0x1b1))/0x6*(-parseInt(_0x2e4e23(0x1ce))/0x7)+-parseInt(_0x2e4e23(0x17d))/0x8*(-parseInt(_0x2e4e23(0x196))/0x9)+-parseInt(_0x2e4e23(0x188))/0xa*(parseInt(_0x2e4e23(0x194))/0xb)+parseInt(_0x2e4e23(0x18f))/0xc*(-parseInt(_0x2e4e23(0x1cf))/0xd);if(_0x16c988===_0xe34e62)break;else _0x35e9e7['push'](_0x35e9e7['shift']());}catch(_0x3ce4ba){_0x35e9e7['push'](_0x35e9e7['shift']());}}}(a30_0x4631,0xbd7e0));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a30_0x65d5(_0xdf9343,_0x4ba907){_0xdf9343=_0xdf9343-0x169;const _0x463176=a30_0x4631();let _0x65d595=_0x463176[_0xdf9343];return _0x65d595;}import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x112a15(0x17e),'command':a30_0x112a15(0x190),'description':a30_0x112a15(0x17a),'risk':a30_0x112a15(0x1ca),'flags':[{'name':'type','type':a30_0x112a15(0x1cb),'required':!![],'enum':['COMMON',a30_0x112a15(0x1ab),'HOOK'],'description':'Script\x20type'},{'name':'name','type':a30_0x112a15(0x1cb),'required':!![],'description':a30_0x112a15(0x1ba)},{'name':a30_0x112a15(0x19e),'type':'string','description':a30_0x112a15(0x16d)},{'name':a30_0x112a15(0x187),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x185)},{'name':a30_0x112a15(0x1b0),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x19a)},{'name':a30_0x112a15(0x183),'type':a30_0x112a15(0x1cb),'description':a30_0x112a15(0x1a7)},{'name':'function-node','type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x112a15(0x198),'after']}],async 'validate'(_0x48a7c5){const _0x5a0335=a30_0x112a15,_0x12c622=_0x48a7c5[_0x5a0335(0x1b4)](_0x5a0335(0x17f));if(!isValidBffFunctionName(_0x12c622))throw CliErrors['validation'](_0x5a0335(0x1ac)+_0x12c622+_0x5a0335(0x189));},async 'execute'(_0x512dbf){const _0x393405=a30_0x112a15,_0x143013=loadBffProjectConfig(_0x512dbf['appCode']),_0xf2edfe=_0x512dbf[_0x393405(0x1b4)]('type'),_0x505e61=_0x512dbf[_0x393405(0x1b4)]('name'),_0x363dd4=_0x512dbf[_0x393405(0x1b4)](_0x393405(0x19e))||undefined,_0x98010e=_0xf2edfe===_0x393405(0x184)?await resolveHookOptions(_0x143013,_0x512dbf):undefined,_0x567c23=buildFilePath(_0x143013,_0xf2edfe,_0x505e61,_0x98010e);if(await fileExists(_0x567c23))throw CliErrors[_0x393405(0x1c0)](_0x393405(0x16b)+_0x567c23);await mkdir(dirname(_0x567c23),{'recursive':!![]});const _0x244ab1=generateTemplate(_0xf2edfe,_0x505e61,_0x512dbf[_0x393405(0x180)],_0x363dd4,_0x98010e);await writeFile(_0x567c23,_0x244ab1,_0x393405(0x1c4));const _0x5c9883={'type':_0xf2edfe,'name':_0x505e61,'path':_0x567c23};if(_0x363dd4)_0x5c9883[_0x393405(0x19e)]=_0x363dd4;if(_0x98010e){if(_0x98010e[_0x393405(0x187)])_0x5c9883['alias']=_0x98010e[_0x393405(0x187)];_0x5c9883['datasetCode']=_0x98010e[_0x393405(0x1ad)],_0x5c9883[_0x393405(0x193)]=_0x98010e[_0x393405(0x193)],_0x5c9883[_0x393405(0x175)]=_0x98010e[_0x393405(0x175)];}return{'ok':!![],'data':_0x5c9883,'message':'Created\x20'+_0xf2edfe+'\x20function:\x20'+_0x505e61};}};function a30_0x4631(){const _0x476108=['9234945ATADUq','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','before','Select\x20dataset:','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Available\x20aliases:\x20','length','UNKNOWN','description','trim','join','scriptsRootDir','parseInt','datasetId','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','/HOOK/','Operation\x20type\x20(HOOK\x20only)','entries','30GeFFmB','No\x20datasets\x20found\x20for\x20this\x20app.','ENDPOINT','Invalid\x20function\x20name\x20\x22','datasetCode','.js','find','datasetcode','246JdxiCH','Select\x20operation\x20type:','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','str','当前响应结果','\x22\x20not\x20found\x20for\x20dataset\x20','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','Select\x20trigger\x20node:','.js\x0a','Function\x20name\x20(valid\x20JS\x20identifier)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','2781747wtIqYw','/**\x0a\x20*\x20','118nFPMAO','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','validation','apiDir','keys','COMMON','utf8','No\x20api.ts\x20found.\x20Run\x20`','4547xmmaOT','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','373676QCTTWl','map','read','string','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','after','229621epbwms','8800142xqENWY','Invalid\x20dataset\x20selection.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','File\x20already\x20exists:\x20','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Script\x20description','Alias\x20\x22','nonInteractive','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','修改后的请求参数','/data/dataset/','/ENDPOINT/','function-node','functionNode','stderr','includes','Operation\x20type\x20\x22','write','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','source','.js\x0a\x20*\x20[触发节点]\x20','8jmNupL','bff','name','appCode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','operation-type','HOOK','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK\x20requires\x20alias/operation/node\x20options.','alias','2048680UAbRWq','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Available:\x20','code','No\x20operation\x20types\x20found\x20for\x20dataset\x20','question','12eNYyuU','create','isInteger','\x0a\x20*\x20[平台配置]\x20','operationType','44CGIHWR','close'];a30_0x4631=function(){return _0x476108;};return a30_0x4631();}async function resolveHookOptions(_0x584ce6,_0x2e7894){const _0xa406ff=a30_0x112a15,_0x17a453=loadAliasMap(_0x2e7894[_0xa406ff(0x1c1)],undefined,resolveApiFilePath(_0x2e7894[_0xa406ff(0x1c1)],_0x2e7894[_0xa406ff(0x180)])),_0x2051ba=_0x17a453[_0xa406ff(0x19c)]>0x0;let _0x582241,_0x1cd279,_0x3e69f9;const _0x3a7d34=_0x2e7894['str'](_0xa406ff(0x187)),_0x5bcaca=_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x1b0));if(_0x3a7d34){const _0x4a1d94=resolveAlias(_0x2e7894[_0xa406ff(0x1c1)],_0x3a7d34,undefined,resolveApiFilePath(_0x2e7894['apiDir'],_0x2e7894['appCode']));if(!_0x4a1d94){const _0x5fb397=_0x2051ba?_0xa406ff(0x19b)+_0x17a453[_0xa406ff(0x1c9)](_0x1db23c=>_0x1db23c[_0xa406ff(0x187)])[_0xa406ff(0x1a0)](',\x20'):_0xa406ff(0x1c5)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0xa406ff(0x16e)+_0x3a7d34+'\x22\x20not\x20found.\x20'+_0x5fb397);}_0x582241=_0x3a7d34,_0x1cd279=_0x4a1d94;}else{if(_0x5bcaca){_0x1cd279=_0x5bcaca;const _0x1cb6bf=_0x17a453[_0xa406ff(0x1af)](_0x10eec7=>_0x10eec7['datasetCode']===_0x5bcaca);_0x582241=_0x1cb6bf?.[_0xa406ff(0x187)];}else{if(_0x2e7894[_0xa406ff(0x16f)])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x181));else{if(_0x2051ba){const _0x496657=_0x17a453[_0xa406ff(0x1c9)](_0x45a4bb=>_0x45a4bb[_0xa406ff(0x187)]+'\x20('+_0x45a4bb['tableName']+')'),_0x405678=await promptSelect(_0xa406ff(0x199),_0x496657),_0x21a022=_0x17a453[_0x405678];if(!_0x21a022)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1d0));_0x582241=_0x21a022[_0xa406ff(0x187)],_0x1cd279=_0x21a022[_0xa406ff(0x1ad)];}else{const _0x540e0d=await listDatasets(_0x2e7894[_0xa406ff(0x180)]);if(_0x540e0d[_0xa406ff(0x19c)]===0x0)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1aa));const _0x4b831b=_0x540e0d[_0xa406ff(0x1c9)](_0x257c06=>_0x257c06['name']+'\x20['+(_0x257c06[_0xa406ff(0x17b)]??_0xa406ff(0x19d))+']\x20('+_0x257c06[_0xa406ff(0x18c)]+')'),_0x5249c5=await promptSelect('Select\x20dataset:',_0x4b831b),_0x47250b=_0x540e0d[_0x5249c5];if(!_0x47250b)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1d0));_0x1cd279=_0x47250b['code'],_0x582241=undefined;}}}}const _0x4689e7=await listDatasets(_0x2e7894[_0xa406ff(0x180)]),_0x2c7758=_0x4689e7[_0xa406ff(0x1af)](_0x40377d=>_0x40377d['code']===_0x1cd279);if(!_0x2c7758)throw CliErrors[_0xa406ff(0x1c0)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x1cd279+'\x22.\x20'+(_0x582241?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x3e69f9=_0x2c7758['id'];const _0x358231=_0x582241??_0x1cd279,_0x378b59=await listBffDatasetOperations(_0x2e7894[_0xa406ff(0x180)],_0x3e69f9),_0x188569=_0x378b59?Object[_0xa406ff(0x1c2)](_0x378b59):[];if(_0x188569[_0xa406ff(0x19c)]===0x0)throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x18d)+_0x358231+'.');let _0x2338af;const _0x4f09c3=_0x2e7894[_0xa406ff(0x1b4)]('operation-type');if(_0x4f09c3){if(!_0x188569[_0xa406ff(0x177)](_0x4f09c3))throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x178)+_0x4f09c3+_0xa406ff(0x1b6)+_0x358231+'.\x20'+(_0xa406ff(0x18b)+_0x188569['join'](',\x20')));_0x2338af=_0x4f09c3;}else{if(_0x2e7894[_0xa406ff(0x16f)])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x1cc));const _0x33fb2b=await promptSelect(_0xa406ff(0x1b2),_0x188569);_0x2338af=_0x188569[_0x33fb2b]??_0x188569[0x0];}let _0x212773=normalizeHookFunctionNode(_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x174)));if(!_0x212773){if(_0x2e7894[_0xa406ff(0x1b4)](_0xa406ff(0x174)))throw CliErrors[_0xa406ff(0x1c0)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2e7894['nonInteractive'])throw CliErrors[_0xa406ff(0x1c0)](_0xa406ff(0x197));const _0x153818=await promptSelect(_0xa406ff(0x1b8),[_0xa406ff(0x198),'after']);_0x212773=[_0xa406ff(0x198),_0xa406ff(0x1cd)][_0x153818]??'before';}return{'alias':_0x582241,'datasetCode':_0x1cd279,'datasetId':_0x3e69f9,'operationType':_0x2338af,'functionNode':_0x212773};}async function promptSelect(_0x4307fb,_0x189af0){const _0x5af6e2=a30_0x112a15;if(_0x189af0[_0x5af6e2(0x19c)]===0x1)return 0x0;for(const [_0x498c13,_0x535228]of _0x189af0[_0x5af6e2(0x1a8)]()){process[_0x5af6e2(0x176)][_0x5af6e2(0x179)]('\x20\x20'+(_0x498c13+0x1)+'.\x20'+_0x535228+'\x0a');}const _0x3bdfb3=createInterface({'input':process['stdin'],'output':process[_0x5af6e2(0x176)]});while(!![]){const _0xa881b9=await new Promise(_0x349e1d=>{const _0xf19227=_0x5af6e2;_0x3bdfb3[_0xf19227(0x18e)](_0x4307fb+'\x20',_0x349e1d);}),_0x3c6ca6=Number[_0x5af6e2(0x1a2)](_0xa881b9[_0x5af6e2(0x19f)](),0xa);if(Number[_0x5af6e2(0x191)](_0x3c6ca6)&&_0x3c6ca6>=0x1&&_0x3c6ca6<=_0x189af0[_0x5af6e2(0x19c)])return _0x3bdfb3[_0x5af6e2(0x195)](),_0x3c6ca6-0x1;process[_0x5af6e2(0x176)][_0x5af6e2(0x179)](_0x5af6e2(0x1bb)+_0x189af0['length']+'.\x0a');}}function buildFilePath(_0x331df0,_0x1f670a,_0xa67667,_0x59d071){const _0x4279d8=a30_0x112a15;if(_0x1f670a===_0x4279d8(0x184)){if(!_0x59d071)throw CliErrors[_0x4279d8(0x1c0)](_0x4279d8(0x186));const _0x41a662=_0x59d071[_0x4279d8(0x187)]??_0x59d071[_0x4279d8(0x1ad)];return join(_0x331df0['scriptsRootDir'],_0x4279d8(0x184),_0x41a662,_0x59d071[_0x4279d8(0x193)],_0x59d071[_0x4279d8(0x175)],_0xa67667+_0x4279d8(0x1ae));}return join(_0x331df0[_0x4279d8(0x1a1)],_0x1f670a,_0xa67667+_0x4279d8(0x1ae));}export function generateTemplate(_0x39e71e,_0x4e7ac6,_0x4dc5dd,_0x1e3fdd,_0x10ec12){const _0x56b316=a30_0x112a15,_0x496b66=_0x1e3fdd?.[_0x56b316(0x19f)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x131e59=getAppBaseUrl(_0x4dc5dd),_0xcd7530='\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x39e71e===_0x56b316(0x1c3))return'/**\x0a\x20*\x20'+_0x496b66+_0x56b316(0x18a)+_0x4e7ac6+_0x56b316(0x192)+_0x131e59+_0x56b316(0x1b3)+_0x4dc5dd+'/COMMON/'+_0x4e7ac6+_0x56b316(0x1b7)+_0x4e7ac6+'\x22,\x20params\x20})\x0a'+_0xcd7530+_0x56b316(0x16a)+_0x4e7ac6+_0x56b316(0x1c7);if(_0x39e71e===_0x56b316(0x1ab))return _0x56b316(0x1bd)+_0x496b66+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x4e7ac6+_0x56b316(0x182)+_0x4dc5dd+'/'+_0x4e7ac6+_0x56b316(0x192)+_0x131e59+_0x56b316(0x1b3)+_0x4dc5dd+_0x56b316(0x173)+_0x4e7ac6+_0x56b316(0x1b9)+_0xcd7530+_0x56b316(0x1bf)+_0x4e7ac6+_0x56b316(0x1c7);if(!_0x10ec12)throw CliErrors[_0x56b316(0x1c0)](_0x56b316(0x169));const _0x665127=_0x10ec12[_0x56b316(0x187)]??_0x10ec12[_0x56b316(0x1ad)],_0x4d207b=_0x10ec12[_0x56b316(0x175)]===_0x56b316(0x198)?'当前请求参数':_0x56b316(0x1b5),_0x15e855=_0x10ec12[_0x56b316(0x175)]===_0x56b316(0x198)?_0x56b316(0x171):'修改后的响应结果';return _0x56b316(0x1bd)+_0x496b66+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x4e7ac6+_0x56b316(0x1a4)+_0x4dc5dd+'/'+_0x10ec12[_0x56b316(0x1ad)]+'/'+_0x10ec12['operationType']+_0x56b316(0x192)+_0x131e59+_0x56b316(0x172)+_0x10ec12[_0x56b316(0x1a3)]+_0x56b316(0x1a5)+_0x4dc5dd+_0x56b316(0x1a6)+_0x665127+'/'+_0x10ec12[_0x56b316(0x193)]+'/'+_0x10ec12['functionNode']+'/'+_0x4e7ac6+_0x56b316(0x17c)+_0x10ec12[_0x56b316(0x175)]+'\x0a'+_0xcd7530+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x4d207b+_0x56b316(0x170)+_0x15e855+_0x56b316(0x16c)+_0x4e7ac6+_0x56b316(0x1c7);}
|
|
1
|
+
const a30_0x29cc49=a30_0x18f4;(function(_0x4f5d8e,_0x38a784){const _0x44af3a=a30_0x18f4,_0x32661a=_0x4f5d8e();while(!![]){try{const _0x52e852=-parseInt(_0x44af3a(0x1ce))/0x1+-parseInt(_0x44af3a(0x1b3))/0x2*(-parseInt(_0x44af3a(0x196))/0x3)+parseInt(_0x44af3a(0x1b5))/0x4+parseInt(_0x44af3a(0x1d6))/0x5+parseInt(_0x44af3a(0x1cc))/0x6+parseInt(_0x44af3a(0x1f0))/0x7+parseInt(_0x44af3a(0x1f5))/0x8*(-parseInt(_0x44af3a(0x1d8))/0x9);if(_0x52e852===_0x38a784)break;else _0x32661a['push'](_0x32661a['shift']());}catch(_0x4f717d){_0x32661a['push'](_0x32661a['shift']());}}}(a30_0xf3f5,0x68ef9));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a30_0xf3f5(){const _0x32b876=['after','/COMMON/','stdin','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','join','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','2676665jTiITy','find','2151tuzjcn','stderr','修改后的请求参数','\x22.\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','question','/ENDPOINT/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','/data/dataset/','utf8','length','.js\x0a\x20*\x20[触发节点]\x20','validation','string','\x20api\x20pull`\x20to\x20refresh.','alias','File\x20already\x20exists:\x20','map','name','before','Available:\x20',']\x20(','Invalid\x20function\x20name\x20\x22','apiDir','5636596xBYvvJ','HOOK\x20requires\x20alias/operation/node\x20options.','create','keys','datasetCode','56464RcEqjA','Alias\x20\x22','nonInteractive','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK','Script\x20description','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','scriptsRootDir','str','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','parseInt','functionNode','source','903djXTgt','appCode','datasetcode','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x20function:\x20','/**\x0a\x20*\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','.js\x0a','entries','No\x20datasets\x20found\x20for\x20this\x20app.','Select\x20trigger\x20node:','Trigger\x20node\x20(HOOK\x20only)','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','close','code','description','.js','includes','\x0a\x20*\x20[平台配置]\x20','Select\x20operation\x20type:','function-node','2Uctgva','bff','2862236KwWMAO','\x22\x20not\x20found.\x20','Operation\x20type\x20(HOOK\x20only)','\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20dataset:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','isInteger','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','trim','Invalid\x20dataset\x20selection.','UNKNOWN','/HOOK/','当前请求参数','operationType','修改后的响应结果','datasetId','Operation\x20type\x20\x22','tableName','operation-type','1220094bELndk','No\x20api.ts\x20found.\x20Run\x20`','143091DhBWWt','Function\x20name\x20(valid\x20JS\x20identifier)'];a30_0xf3f5=function(){return _0x32b876;};return a30_0xf3f5();}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x29cc49(0x1b4),'command':a30_0x29cc49(0x1f2),'description':a30_0x29cc49(0x1d3),'risk':'read','flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON','ENDPOINT',a30_0x29cc49(0x1f9)],'description':a30_0x29cc49(0x18f)},{'name':'name','type':a30_0x29cc49(0x1e5),'required':!![],'description':a30_0x29cc49(0x1cf)},{'name':'description','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1fa)},{'name':'alias','type':'string','description':a30_0x29cc49(0x1f8)},{'name':a30_0x29cc49(0x198),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x19e)},{'name':a30_0x29cc49(0x1cb),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1b7)},{'name':'function-node','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1a4),'enum':['before','after']}],async 'validate'(_0x10a083){const _0x299cdc=a30_0x29cc49,_0x23415b=_0x10a083[_0x299cdc(0x191)](_0x299cdc(0x1ea));if(!isValidBffFunctionName(_0x23415b))throw CliErrors['validation'](_0x299cdc(0x1ee)+_0x23415b+_0x299cdc(0x1a5));},async 'execute'(_0x4a2d4c){const _0x57c74b=a30_0x29cc49,_0x4f14d4=loadBffProjectConfig(_0x4a2d4c[_0x57c74b(0x197)]),_0x52025c=_0x4a2d4c[_0x57c74b(0x191)]('type'),_0x127f1d=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ea)),_0x1d1bed=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ad))||undefined,_0x18ffe8=_0x52025c===_0x57c74b(0x1f9)?await resolveHookOptions(_0x4f14d4,_0x4a2d4c):undefined,_0x4cceed=buildFilePath(_0x4f14d4,_0x52025c,_0x127f1d,_0x18ffe8);if(await fileExists(_0x4cceed))throw CliErrors['validation'](_0x57c74b(0x1e8)+_0x4cceed);await mkdir(dirname(_0x4cceed),{'recursive':!![]});const _0x139b19=generateTemplate(_0x52025c,_0x127f1d,_0x4a2d4c['appCode'],_0x1d1bed,_0x18ffe8);await writeFile(_0x4cceed,_0x139b19,_0x57c74b(0x1e1));const _0x2bbe78={'type':_0x52025c,'name':_0x127f1d,'path':_0x4cceed};if(_0x1d1bed)_0x2bbe78[_0x57c74b(0x1ad)]=_0x1d1bed;if(_0x18ffe8){if(_0x18ffe8[_0x57c74b(0x1e7)])_0x2bbe78[_0x57c74b(0x1e7)]=_0x18ffe8['alias'];_0x2bbe78['datasetCode']=_0x18ffe8[_0x57c74b(0x1f4)],_0x2bbe78[_0x57c74b(0x1c6)]=_0x18ffe8[_0x57c74b(0x1c6)],_0x2bbe78[_0x57c74b(0x194)]=_0x18ffe8['functionNode'];}return{'ok':!![],'data':_0x2bbe78,'message':'Created\x20'+_0x52025c+_0x57c74b(0x19a)+_0x127f1d};}};async function resolveHookOptions(_0xf68755,_0x2f8f68){const _0x465c04=a30_0x29cc49,_0x225aa4=loadAliasMap(_0x2f8f68['apiDir'],undefined,resolveApiFilePath(_0x2f8f68[_0x465c04(0x1ef)],_0x2f8f68['appCode'])),_0x357c2b=_0x225aa4[_0x465c04(0x1e2)]>0x0;let _0x1d7ce9,_0x32dae7,_0x3a5311;const _0x127261=_0x2f8f68[_0x465c04(0x191)]('alias'),_0x2e588c=_0x2f8f68[_0x465c04(0x191)]('datasetcode');if(_0x127261){const _0x2b1115=resolveAlias(_0x2f8f68[_0x465c04(0x1ef)],_0x127261,undefined,resolveApiFilePath(_0x2f8f68['apiDir'],_0x2f8f68[_0x465c04(0x197)]));if(!_0x2b1115){const _0x1bbfb8=_0x357c2b?'Available\x20aliases:\x20'+_0x225aa4[_0x465c04(0x1e9)](_0x1e801f=>_0x1e801f[_0x465c04(0x1e7)])[_0x465c04(0x1d4)](',\x20'):_0x465c04(0x1cd)+CLI_BIN_NAME+_0x465c04(0x1bd);throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1f6)+_0x127261+_0x465c04(0x1b6)+_0x1bbfb8);}_0x1d7ce9=_0x127261,_0x32dae7=_0x2b1115;}else{if(_0x2e588c){_0x32dae7=_0x2e588c;const _0x5266e5=_0x225aa4[_0x465c04(0x1d7)](_0x3acdbe=>_0x3acdbe[_0x465c04(0x1f4)]===_0x2e588c);_0x1d7ce9=_0x5266e5?.[_0x465c04(0x1e7)];}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x18e));else{if(_0x357c2b){const _0x241b17=_0x225aa4['map'](_0x20d90b=>_0x20d90b[_0x465c04(0x1e7)]+'\x20('+_0x20d90b[_0x465c04(0x1ca)]+')'),_0x548451=await promptSelect(_0x465c04(0x1ba),_0x241b17),_0x33faf7=_0x225aa4[_0x548451];if(!_0x33faf7)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c2));_0x1d7ce9=_0x33faf7[_0x465c04(0x1e7)],_0x32dae7=_0x33faf7[_0x465c04(0x1f4)];}else{const _0x4b5d59=await listDatasets(_0x2f8f68[_0x465c04(0x197)]);if(_0x4b5d59['length']===0x0)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1a2));const _0x17ea7d=_0x4b5d59[_0x465c04(0x1e9)](_0x5a9a67=>_0x5a9a67[_0x465c04(0x1ea)]+'\x20['+(_0x5a9a67[_0x465c04(0x195)]??_0x465c04(0x1c3))+_0x465c04(0x1ed)+_0x5a9a67[_0x465c04(0x1ac)]+')'),_0xfcc698=await promptSelect(_0x465c04(0x1ba),_0x17ea7d),_0x2ddc28=_0x4b5d59[_0xfcc698];if(!_0x2ddc28)throw CliErrors[_0x465c04(0x1e4)]('Invalid\x20dataset\x20selection.');_0x32dae7=_0x2ddc28[_0x465c04(0x1ac)],_0x1d7ce9=undefined;}}}}const _0x5b6aa4=await listDatasets(_0x2f8f68['appCode']),_0x270fd6=_0x5b6aa4[_0x465c04(0x1d7)](_0x3a3c41=>_0x3a3c41[_0x465c04(0x1ac)]===_0x32dae7);if(!_0x270fd6)throw CliErrors['validation'](_0x465c04(0x19c)+_0x32dae7+_0x465c04(0x1db)+(_0x1d7ce9?_0x465c04(0x1dc)+CLI_BIN_NAME+_0x465c04(0x1e6):''));_0x3a5311=_0x270fd6['id'];const _0x422ff2=_0x1d7ce9??_0x32dae7,_0xd12c0c=await listBffDatasetOperations(_0x2f8f68[_0x465c04(0x197)],_0x3a5311),_0x348916=_0xd12c0c?Object[_0x465c04(0x1f3)](_0xd12c0c):[];if(_0x348916[_0x465c04(0x1e2)]===0x0)throw CliErrors[_0x465c04(0x1e4)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x422ff2+'.');let _0xa11f2e;const _0x81134f=_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1cb));if(_0x81134f){if(!_0x348916[_0x465c04(0x1af)](_0x81134f))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c9)+_0x81134f+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x422ff2+'.\x20'+(_0x465c04(0x1ec)+_0x348916[_0x465c04(0x1d4)](',\x20')));_0xa11f2e=_0x81134f;}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1bb));const _0xf47528=await promptSelect(_0x465c04(0x1b1),_0x348916);_0xa11f2e=_0x348916[_0xf47528]??_0x348916[0x0];}let _0x16edc4=normalizeHookFunctionNode(_0x2f8f68['str'](_0x465c04(0x1b2)));if(!_0x16edc4){if(_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1b2)))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x192));if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x1a9));const _0x5d504c=await promptSelect(_0x465c04(0x1a3),[_0x465c04(0x1eb),_0x465c04(0x1d0)]);_0x16edc4=[_0x465c04(0x1eb),_0x465c04(0x1d0)][_0x5d504c]??'before';}return{'alias':_0x1d7ce9,'datasetCode':_0x32dae7,'datasetId':_0x3a5311,'operationType':_0xa11f2e,'functionNode':_0x16edc4};}async function promptSelect(_0x518eb8,_0x23009c){const _0x1424ae=a30_0x29cc49;if(_0x23009c[_0x1424ae(0x1e2)]===0x1)return 0x0;for(const [_0x4c67ea,_0x496fe9]of _0x23009c[_0x1424ae(0x1a1)]()){process['stderr'][_0x1424ae(0x1a8)]('\x20\x20'+(_0x4c67ea+0x1)+'.\x20'+_0x496fe9+'\x0a');}const _0x44a8ae=createInterface({'input':process[_0x1424ae(0x1d2)],'output':process[_0x1424ae(0x1d9)]});while(!![]){const _0x23d86c=await new Promise(_0x3e0920=>{const _0x42ea65=_0x1424ae;_0x44a8ae[_0x42ea65(0x1dd)](_0x518eb8+'\x20',_0x3e0920);}),_0x55d800=Number[_0x1424ae(0x193)](_0x23d86c[_0x1424ae(0x1c1)](),0xa);if(Number[_0x1424ae(0x1be)](_0x55d800)&&_0x55d800>=0x1&&_0x55d800<=_0x23009c['length'])return _0x44a8ae[_0x1424ae(0x1ab)](),_0x55d800-0x1;process[_0x1424ae(0x1d9)][_0x1424ae(0x1a8)](_0x1424ae(0x19f)+_0x23009c[_0x1424ae(0x1e2)]+'.\x0a');}}function buildFilePath(_0x20b569,_0x35f8ac,_0x7443f0,_0x5d6708){const _0x43e89e=a30_0x29cc49;if(_0x35f8ac===_0x43e89e(0x1f9)){if(!_0x5d6708)throw CliErrors[_0x43e89e(0x1e4)](_0x43e89e(0x1f1));const _0x54effd=_0x5d6708[_0x43e89e(0x1e7)]??_0x5d6708[_0x43e89e(0x1f4)];return join(_0x20b569[_0x43e89e(0x190)],_0x43e89e(0x1f9),_0x54effd,_0x5d6708['operationType'],_0x5d6708[_0x43e89e(0x194)],_0x7443f0+_0x43e89e(0x1ae));}return join(_0x20b569['scriptsRootDir'],_0x35f8ac,_0x7443f0+_0x43e89e(0x1ae));}function a30_0x18f4(_0x5394f2,_0x1c05ee){_0x5394f2=_0x5394f2-0x18e;const _0xf3f54b=a30_0xf3f5();let _0x18f4a0=_0xf3f54b[_0x5394f2];return _0x18f4a0;}export function generateTemplate(_0x469973,_0x558e99,_0x133c9c,_0x3ed77e,_0x533cfe){const _0x336ad2=a30_0x29cc49,_0x26ed86=_0x3ed77e?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x168f22=getAppBaseUrl(_0x133c9c),_0xdbe475=_0x336ad2(0x1b8);if(_0x469973===_0x336ad2(0x1bf))return _0x336ad2(0x19b)+_0x26ed86+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1d5)+_0x133c9c+_0x336ad2(0x1d1)+_0x558e99+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x558e99+'\x22,\x20params\x20})\x0a'+_0xdbe475+_0x336ad2(0x199)+_0x558e99+_0x336ad2(0x1aa);if(_0x469973===_0x336ad2(0x1bc))return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x1df)+_0x558e99+_0x336ad2(0x1c0)+_0x133c9c+'/'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1de)+_0x558e99+_0x336ad2(0x1a0)+_0xdbe475+_0x336ad2(0x1b9)+_0x558e99+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x533cfe)throw CliErrors[_0x336ad2(0x1e4)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x4628de=_0x533cfe['alias']??_0x533cfe['datasetCode'],_0x8fb47b=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1c5):'当前响应结果',_0x559f05=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1da):_0x336ad2(0x1c7);return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x19d)+_0x558e99+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x133c9c+'/'+_0x533cfe[_0x336ad2(0x1f4)]+'/'+_0x533cfe[_0x336ad2(0x1c6)]+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1e0)+_0x533cfe[_0x336ad2(0x1c8)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1c4)+_0x4628de+'/'+_0x533cfe['operationType']+'/'+_0x533cfe['functionNode']+'/'+_0x558e99+_0x336ad2(0x1e3)+_0x533cfe[_0x336ad2(0x194)]+'\x0a'+_0xdbe475+_0x336ad2(0x1a7)+_0x8fb47b+_0x336ad2(0x1a6)+_0x559f05+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x558e99+_0x336ad2(0x1aa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2222b8=a31_0xd0b5;(function(_0x2445f2,_0x299d32){const _0x4f4385=a31_0xd0b5,_0x492e1f=_0x2445f2();while(!![]){try{const _0x306150=parseInt(_0x4f4385(0xec))/0x1*(-parseInt(_0x4f4385(0xf4))/0x2)+-parseInt(_0x4f4385(0x100))/0x3*(-parseInt(_0x4f4385(0xf8))/0x4)+-parseInt(_0x4f4385(0xf7))/0x5+-parseInt(_0x4f4385(0xfc))/0x6*(-parseInt(_0x4f4385(0xfa))/0x7)+-parseInt(_0x4f4385(0xe7))/0x8*(parseInt(_0x4f4385(0xf3))/0x9)+parseInt(_0x4f4385(0xe3))/0xa*(-parseInt(_0x4f4385(0xe9))/0xb)+-parseInt(_0x4f4385(0xf2))/0xc*(-parseInt(_0x4f4385(0xe8))/0xd);if(_0x306150===_0x299d32)break;else _0x492e1f['push'](_0x492e1f['shift']());}catch(_0x1e99a0){_0x492e1f['push'](_0x492e1f['shift']());}}}(a31_0x28fc,0xbcd98));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a31_0x28fc(){const _0x352373=['9KMAUrJ','10DRqOrj','/api/management/library/scripts/delete','target','4667610bsOczc','4OpVsxt','parse','1969289qeTzFH','map','6QqBuHB','replace','projectRoot','apps','2573517JuweRp','join','stringify','filter','scriptsRootDir','scriptsRoot','validation','\x20\x20-\x20','BFF\x20lock\x20file\x20not\x20found.','startsWith','trashDir','includes','remoteId','string','str','trashedTo','keys','find','appCode','Function\x20not\x20found:\x20','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','delete','280cekoIf','No\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','functions','2733928LXXrZD','13xsWZWr','594814wRqwUj','lockFilePath','POST','130252lLzCIc','Local\x20delete\x20not\x20settled\x20for\x20','length','toISOString','<timestamp>','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','36899484FjULjb'];a31_0x28fc=function(){return _0x352373;};return a31_0x28fc();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':'delete','description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[{'name':a31_0x2222b8(0xf6),'type':a31_0x2222b8(0x10d),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x558f63){const _0x58f110=a31_0x2222b8,_0x3c8510=loadBffProjectConfig(_0x558f63['appCode']),_0x2f1b79=await readBffLockFile(_0x3c8510[_0x58f110(0xea)]);if(!_0x2f1b79)throw CliErrors[_0x58f110(0x106)](_0x58f110(0xf1));},async 'dryRun'(_0x2abdcc){const _0xa45efc=a31_0x2222b8,_0xe2330d=loadBffProjectConfig(_0x2abdcc[_0xa45efc(0xdf)]),_0x9c1d22=await readBffLockFile(_0xe2330d[_0xa45efc(0xea)]);if(!_0x9c1d22)throw CliErrors[_0xa45efc(0x106)](_0xa45efc(0x108));const {appLock:_0x21ad27}=ensureLockScope(_0x9c1d22,_0x2abdcc['appCode'],_0xe2330d[_0xa45efc(0x105)],_0xa45efc(0xe2)),_0x1916fa=_0x2abdcc[_0xa45efc(0x10e)]('target'),_0x4a2351=Object[_0xa45efc(0xdd)](_0x21ad27[_0xa45efc(0xe6)]),_0x49d4fd=resolveDeleteTarget(_0x1916fa,_0x4a2351),_0x280a99=_0x21ad27[_0xa45efc(0xe6)][_0x49d4fd];if(!_0x280a99)throw CliErrors[_0xa45efc(0x106)](_0xa45efc(0xe4)+_0x49d4fd+'\x22.');const _0x38e4f0=resolveLocalFilePathFromLockKey(_0xe2330d,_0x49d4fd),_0x4ca120=relative(_0xe2330d[_0xa45efc(0xfe)],_0x38e4f0),_0x203cda=join(_0xe2330d[_0xa45efc(0x10a)],_0xa45efc(0xf0),_0x4ca120);return{'method':_0xa45efc(0xeb),'url':_0xa45efc(0xf5),'body':{'appCode':_0x2abdcc[_0xa45efc(0xdf)],'target':_0x49d4fd,'remoteId':_0x280a99[_0xa45efc(0x10c)],'localFilePath':_0x38e4f0,'trashedPath':_0x203cda},'description':'Would\x20delete\x20'+_0x49d4fd+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x1bf888){const _0x102ee0=a31_0x2222b8,_0x187190=loadBffProjectConfig(_0x1bf888['appCode']),_0x54397e=await readBffLockFile(_0x187190[_0x102ee0(0xea)]);if(!_0x54397e)throw CliErrors[_0x102ee0(0x106)](_0x102ee0(0x108));const {lockData:_0x1eb54e,appLock:_0x2ee86e}=ensureLockScope(_0x54397e,_0x1bf888[_0x102ee0(0xdf)],_0x187190[_0x102ee0(0x105)],_0x102ee0(0xe2)),_0x3a1fa9=JSON[_0x102ee0(0xf9)](JSON[_0x102ee0(0x102)](_0x1eb54e)),_0x4c3d7c=_0x3a1fa9[_0x102ee0(0xff)][_0x1bf888[_0x102ee0(0xdf)]];if(!_0x4c3d7c)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1bf888['appCode']+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5a451a=_0x1bf888[_0x102ee0(0x10e)]('target'),_0xca4fea=Object['keys'](_0x4c3d7c[_0x102ee0(0xe6)]),_0x38a3cb=resolveDeleteTarget(_0x5a451a,_0xca4fea),_0x5191bd=_0x4c3d7c['functions'][_0x38a3cb];if(!_0x5191bd)throw CliErrors[_0x102ee0(0x106)](_0x102ee0(0xe4)+_0x38a3cb+'\x22.');await deleteBffScript(_0x5191bd[_0x102ee0(0x10c)]),delete _0x4c3d7c[_0x102ee0(0xe6)][_0x38a3cb],_0x4c3d7c[_0x102ee0(0xe5)]=new Date()[_0x102ee0(0xef)](),await writeBffLockFile(_0x187190[_0x102ee0(0xea)],_0x3a1fa9);const _0x3590ed=resolveLocalFilePathFromLockKey(_0x187190,_0x38a3cb);let _0x318a54;await fileExists(_0x3590ed)&&(_0x318a54=await moveToTrash(_0x187190[_0x102ee0(0xfe)],_0x187190[_0x102ee0(0x10a)],_0x3590ed),await cleanupEmptyDirectories(dirname(_0x3590ed),_0x187190[_0x102ee0(0x104)]));await waitForDeleteSettlement(_0x187190[_0x102ee0(0xea)],_0x1bf888[_0x102ee0(0xdf)],_0x38a3cb,_0x3590ed),await sleep(0x96);const _0x445fc6={'deleted':_0x38a3cb,'remoteId':_0x5191bd[_0x102ee0(0x10c)]};if(_0x318a54)_0x445fc6[_0x102ee0(0x10f)]=_0x318a54;return{'ok':!![],'data':_0x445fc6,'message':'Deleted\x20'+_0x38a3cb+(_0x318a54?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x3629eb,_0x218367){const _0x3f07e1=a31_0x2222b8;if(_0x3629eb[_0x3f07e1(0x10b)]('/')){const _0x13d3af=_0x218367[_0x3f07e1(0xde)](_0x27d50c=>_0x27d50c===_0x3629eb);if(!_0x13d3af)throw CliErrors[_0x3f07e1(0x106)](_0x3f07e1(0xe0)+_0x3629eb);return _0x13d3af;}const _0x5047bf=_0x218367[_0x3f07e1(0x103)](_0x562705=>_0x562705['split']('/')['at'](-0x1)===_0x3629eb);if(_0x5047bf['length']===0x0)throw CliErrors[_0x3f07e1(0x106)]('Function\x20not\x20found:\x20'+_0x3629eb);if(_0x5047bf[_0x3f07e1(0xee)]>0x1)throw CliErrors[_0x3f07e1(0x106)]('Multiple\x20functions\x20match\x20\x22'+_0x3629eb+_0x3f07e1(0xe1)+_0x5047bf[_0x3f07e1(0xfb)](_0x501d72=>_0x3f07e1(0x107)+_0x501d72)[_0x3f07e1(0x101)]('\x0a'));return _0x5047bf[0x0];}async function moveToTrash(_0x21db55,_0x2e10d9,_0x172054){const _0x3ad049=a31_0x2222b8,_0x4ae703=new Date()[_0x3ad049(0xef)]()[_0x3ad049(0xfd)](/[:.]/g,'-'),_0x753062=relative(_0x21db55,_0x172054),_0x8b37a3=join(_0x2e10d9,_0x4ae703,_0x753062);return await mkdir(dirname(_0x8b37a3),{'recursive':!![]}),await rename(_0x172054,_0x8b37a3),_0x8b37a3;}async function cleanupEmptyDirectories(_0x2d1430,_0x50d1f4){const _0x4e325d=a31_0x2222b8;let _0x217d98=resolve(_0x2d1430);const _0xfed90e=resolve(_0x50d1f4);while(_0x217d98[_0x4e325d(0x109)](''+_0xfed90e+sep)||_0x217d98===_0xfed90e){if(_0x217d98===_0xfed90e)return;try{const _0x472d92=await readdir(_0x217d98);if(_0x472d92[_0x4e325d(0xee)]>0x0)return;await rmdir(_0x217d98);}catch{return;}_0x217d98=dirname(_0x217d98);}}function a31_0xd0b5(_0x567699,_0x5e637c){_0x567699=_0x567699-0xdd;const _0x28fc1a=a31_0x28fc();let _0xd0b58a=_0x28fc1a[_0x567699];return _0xd0b58a;}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x4f7937,_0x408159,_0x1ad042,_0x2dae39){const _0x34f1c2=a31_0x2222b8;for(let _0x2a56f=0x0;_0x2a56f<DELETE_SETTLE_RETRY_COUNT;_0x2a56f+=0x1){const _0x124144=await readBffLockFile(_0x4f7937),_0x403a45=!!_0x124144?.[_0x34f1c2(0xff)]?.[_0x408159]?.[_0x34f1c2(0xe6)]?.[_0x1ad042],_0x227473=await fileExists(_0x2dae39);if(!_0x403a45&&!_0x227473)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x34f1c2(0xed)+_0x1ad042+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a32_0x2d51(_0x3bef16,_0x759758){_0x3bef16=_0x3bef16-0x1b5;const _0x1a5002=a32_0x1a50();let _0x2d513d=_0x1a5002[_0x3bef16];return _0x2d513d;}const a32_0x2b7944=a32_0x2d51;(function(_0x5f1714,_0x482252){const _0x3cf56f=a32_0x2d51,_0xbd4cfb=_0x5f1714();while(!![]){try{const _0x357270=-parseInt(_0x3cf56f(0x1c5))/0x1+-parseInt(_0x3cf56f(0x1c8))/0x2+-parseInt(_0x3cf56f(0x1c0))/0x3*(parseInt(_0x3cf56f(0x1bb))/0x4)+parseInt(_0x3cf56f(0x1c2))/0x5+parseInt(_0x3cf56f(0x1c9))/0x6*(-parseInt(_0x3cf56f(0x1ca))/0x7)+parseInt(_0x3cf56f(0x1b5))/0x8+-parseInt(_0x3cf56f(0x1cd))/0x9*(-parseInt(_0x3cf56f(0x1b7))/0xa);if(_0x357270===_0x482252)break;else _0xbd4cfb['push'](_0xbd4cfb['shift']());}catch(_0x281f8b){_0xbd4cfb['push'](_0xbd4cfb['shift']());}}}(a32_0x1a50,0x44b8a));function a32_0x1a50(){const _0x42935e=['bool','794995gfmHxj','num','Get\x20BFF\x20script\x20details\x20by\x20ID','531661hMGtQI','appCode','updateUserName','95456DVnMst','6neRlRf','426398QIqLxm','updatedTime','functionName','729lLMWZQ','Return\x20full\x20raw\x20script\x20object','3292744yhgaOe','Script\x20ID','71690uexvtu','number','scriptContent','createdTime','114748mCcaZX','description','read','(none)','version','24nXSKmc'];a32_0x1a50=function(){return _0x42935e;};return a32_0x1a50();}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':a32_0x2b7944(0x1c4),'risk':a32_0x2b7944(0x1bd),'flags':[{'name':'id','type':a32_0x2b7944(0x1b8),'required':!![],'description':a32_0x2b7944(0x1b6)},{'name':'verbose','type':'boolean','description':a32_0x2b7944(0x1ce)}],async 'execute'(_0x278ee2){const _0x106ebb=a32_0x2b7944,_0x476165=await getBffScriptInfo(_0x278ee2[_0x106ebb(0x1c3)]('id')),_0x4ec3d7=_0x278ee2[_0x106ebb(0x1c1)]('verbose');if(_0x4ec3d7)return{'ok':!![],'data':_0x476165};return{'ok':!![],'data':{'id':_0x476165['id'],'functionName':_0x476165[_0x106ebb(0x1cc)]??'','version':_0x476165[_0x106ebb(0x1bf)]??'','updateUserName':_0x476165[_0x106ebb(0x1c7)]??'','appCode':_0x476165[_0x106ebb(0x1c6)],'scriptType':_0x476165['scriptType'],'description':_0x476165[_0x106ebb(0x1bc)]||_0x106ebb(0x1be),'createdTime':_0x476165[_0x106ebb(0x1ba)]??'','updatedTime':_0x476165[_0x106ebb(0x1cb)]??'','scriptContent':_0x476165[_0x106ebb(0x1b9)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x5b4f(_0x1030ee,_0x18d3cb){_0x1030ee=_0x1030ee-0x1d6;const _0x16d732=a33_0x16d7();let _0x5b4f1d=_0x16d732[_0x1030ee];return _0x5b4f1d;}(function(_0x16c976,_0x3feb18){const _0x534cf5=a33_0x5b4f,_0x1d8c94=_0x16c976();while(!![]){try{const _0x422ee2=-parseInt(_0x534cf5(0x1dd))/0x1+parseInt(_0x534cf5(0x1da))/0x2+-parseInt(_0x534cf5(0x1db))/0x3+-parseInt(_0x534cf5(0x1de))/0x4+-parseInt(_0x534cf5(0x1d6))/0x5*(parseInt(_0x534cf5(0x1d8))/0x6)+-parseInt(_0x534cf5(0x1d9))/0x7+-parseInt(_0x534cf5(0x1d7))/0x8*(-parseInt(_0x534cf5(0x1dc))/0x9);if(_0x422ee2===_0x3feb18)break;else _0x1d8c94['push'](_0x1d8c94['shift']());}catch(_0x3eac95){_0x1d8c94['push'](_0x1d8c94['shift']());}}}(a33_0x16d7,0x46b26));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a33_0x16d7(){const _0x2fd44a=['1853236LBjVjg','495320WdTQLF','449460JuvnAu','338265IkMAuv','375858zQFsqQ','936936nWEizW','40VrqJLP','240aLUskc','45732bzAkDn'];a33_0x16d7=function(){return _0x2fd44a;};return a33_0x16d7();}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|