@lovrabet/rabetbase-cli 2.4.6-beta.3 → 2.4.7-beta.1
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/search.d.ts +2 -0
- package/lib/commands/kb/search.js +1 -0
- 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.d.ts +16 -0
- 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 +4 -4
- package/skills/rabetbase/references/rabetbase-kb.md +13 -3
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x24942d=a19_0x3d45;(function(_0x4c7495,_0x54a2b0){const _0x51843e=a19_0x3d45,_0x5c4e9a=_0x4c7495();while(!![]){try{const _0x4e9916=parseInt(_0x51843e(0xdd))/0x1*(-parseInt(_0x51843e(0xee))/0x2)+-parseInt(_0x51843e(0xe4))/0x3+-parseInt(_0x51843e(0xd8))/0x4*(parseInt(_0x51843e(0xd5))/0x5)+parseInt(_0x51843e(0xd9))/0x6+-parseInt(_0x51843e(0xcf))/0x7*(parseInt(_0x51843e(0xf0))/0x8)+parseInt(_0x51843e(0xf4))/0x9*(-parseInt(_0x51843e(0xe8))/0xa)+-parseInt(_0x51843e(0xef))/0xb*(-parseInt(_0x51843e(0xeb))/0xc);if(_0x4e9916===_0x54a2b0)break;else _0x5c4e9a['push'](_0x5c4e9a['shift']());}catch(_0x524274){_0x5c4e9a['push'](_0x5c4e9a['shift']());}}}(a19_0x3776,0xf1509));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';function a19_0x3776(){const _0x5a823a=['boolean','bool','global','length','find','4036770raEoBx','object','projectPath','project','1309030hyAgib','merged','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','2316hpSzpN','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','remote','1002PfXKJb','387365JooaOE','776616GAHItp','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','No\x20apps\x20configured','validation','117ULORqA','entries','read','mergedCli','\x20config','.\x20Use\x20`','14zgrzOn','globalConfig','isCurrent','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','projectConfig','appcode','5TCNeHk','app','defaultApp','6803756qZPYXE','373224MvKgkQ','list','apps','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','1852IMeGGF','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'];a19_0x3776=function(){return _0x5a823a;};return a19_0x3776();}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function a19_0x3d45(_0x511be5,_0x3a4b55){_0x511be5=_0x511be5-0xcf;const _0x3776ac=a19_0x3776();let _0x3d4598=_0x3776ac[_0x511be5];return _0x3d4598;}function buildItemsFromLayer(_0x199458,_0x41bcd7){const _0x3a45c9=a19_0x3d45,_0x1564a8=[],_0x25e0c3=_0x199458['apps']&&typeof _0x199458[_0x3a45c9(0xdb)]===_0x3a45c9(0xe5)?_0x199458[_0x3a45c9(0xdb)]:{},_0x1cd806=_0x199458[_0x3a45c9(0xd7)]||undefined;for(const [_0x5b27d5,_0x3332df]of Object[_0x3a45c9(0xf5)](_0x25e0c3)){if(!_0x3332df||typeof _0x3332df!==_0x3a45c9(0xe5)||!_0x3332df[_0x3a45c9(0xd4)])continue;_0x1564a8['push']({'name':_0x5b27d5,'appcode':_0x3332df['appcode'],'named':!![],'definedIn':_0x41bcd7,'isDefault':_0x5b27d5===_0x1cd806,...buildAppProfileListFields(_0x3332df)});}return _0x1564a8;}function buildMergedItems(_0x52ac78,_0x3c9e42){const _0x7a9ff=a19_0x3d45,{apps:apps={},defaultApp:_0x110c52}=_0x52ac78,_0x1a0424=_0x3c9e42[_0x7a9ff(0xd0)][_0x7a9ff(0xdb)]&&typeof _0x3c9e42[_0x7a9ff(0xd0)][_0x7a9ff(0xdb)]===_0x7a9ff(0xe5)?_0x3c9e42[_0x7a9ff(0xd0)]['apps']:{},_0xece964=_0x3c9e42[_0x7a9ff(0xd3)][_0x7a9ff(0xdb)]&&typeof _0x3c9e42['projectConfig'][_0x7a9ff(0xdb)]===_0x7a9ff(0xe5)?_0x3c9e42[_0x7a9ff(0xd3)]['apps']:{},_0x90c04=_0x3c9e42[_0x7a9ff(0xd3)]['inherit']===![],_0x3c3e10=Object[_0x7a9ff(0xf5)](apps),_0x54c994=_0x3c3e10['map'](([_0x371473,_0x1385d4])=>({'name':_0x371473,'appcode':_0x1385d4['appcode'],'named':!![],'definedIn':appDefinedIn(_0x371473,_0x1a0424,_0xece964,_0x90c04),'isDefault':_0x371473===_0x110c52,...buildAppProfileListFields(_0x1385d4)}));return _0x54c994;}function validateAppListFlags(_0x491ace){const _0x4ec55d=a19_0x3d45;if(!_0x491ace[_0x4ec55d(0xe0)](_0x4ec55d(0xed)))return;if(!_0x491ace[_0x4ec55d(0xe0)]('global')&&!_0x491ace[_0x4ec55d(0xe0)]('project'))return;throw CliErrors[_0x4ec55d(0xf3)](_0x4ec55d(0xec),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0xa033f2){const _0x4cc3db=a19_0x3d45;validateAppListFlags(_0xa033f2);if(_0xa033f2[_0x4cc3db(0xe0)](_0x4cc3db(0xed)))return{'ok':!![],'data':await listRemoteAppDirectory(_0xa033f2)};const _0xe2a0eb=_0xa033f2['bool']('global'),_0x32e77c=_0xa033f2[_0x4cc3db(0xe0)]('project'),_0x1f33e4=_0xe2a0eb?_0x4cc3db(0xe1):_0x32e77c?'project':_0x4cc3db(0xe9),{config:_0x979840,layers:_0x53baab}=readRawConfigWithLayers(),_0x1fa973=resolveDefaultAppSource(_0x53baab),{defaultApp:_0x4ce3f9}=_0x979840;let _0x52e923,_0x5b6723;switch(_0x1f33e4){case _0x4cc3db(0xe1):_0x52e923=buildItemsFromLayer(_0x53baab[_0x4cc3db(0xd0)],_0x4cc3db(0xe1)),_0x5b6723=_0x53baab['globalPath'];break;case _0x4cc3db(0xe7):_0x52e923=buildItemsFromLayer(_0x53baab['projectConfig'],_0x4cc3db(0xe7)),_0x5b6723=_0x53baab['projectPath'];break;default:_0x52e923=buildMergedItems(_0x979840,_0x53baab);break;}enrichAppListItemsWithMergedSelection(_0x52e923,_0xa033f2[_0x4cc3db(0xf7)]);if(_0x52e923[_0x4cc3db(0xe2)]===0x0){const _0x427a17=_0x1f33e4==='merged'?'':'\x20in\x20'+_0x1f33e4+_0x4cc3db(0xf8);return{'ok':!![],'data':[],'message':_0x4cc3db(0xf2)+_0x427a17+_0x4cc3db(0xf9)+CLI_BIN_NAME+_0x4cc3db(0xde)};}const _0x53978e=_0x52e923[_0x4cc3db(0xe3)](_0x3848ed=>_0x3848ed[_0x4cc3db(0xd1)]===!![]),_0x4bfe0d=_0x4ce3f9??_0x53978e?.['appcode']??null,_0x201f5e=_0x1f33e4==='merged'?{'globalPath':_0x53baab['globalPath']??null,'projectPath':_0x53baab[_0x4cc3db(0xe6)]??null,'defaultApp':_0x4bfe0d,'defaultAppSource':_0x4ce3f9!=null?_0x1fa973:null}:{'scope':_0x1f33e4,'configPath':_0x5b6723??null};return{'ok':!![],'data':{'items':_0x52e923,'meta':_0x201f5e}};}export const appListDefinition={'service':a19_0x24942d(0xd6),'command':a19_0x24942d(0xda),'description':a19_0x24942d(0xd2),'risk':a19_0x24942d(0xf6),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x24942d(0xed),'type':a19_0x24942d(0xdf),'description':a19_0x24942d(0xdc),'default':![]},{'name':'global','type':a19_0x24942d(0xdf),'description':a19_0x24942d(0xf1),'default':![]},{'name':a19_0x24942d(0xe7),'type':a19_0x24942d(0xdf),'description':a19_0x24942d(0xea),'default':![]}],async 'validate'(_0x489fec){validateAppListFlags(_0x489fec);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x25a336=a20_0x3869;(function(_0x34f782,_0x251549){const _0x28c86c=a20_0x3869,_0x5c1481=_0x34f782();while(!![]){try{const _0x221764=parseInt(_0x28c86c(0x1de))/0x1+-parseInt(_0x28c86c(0x1d9))/0x2+-parseInt(_0x28c86c(0x1d5))/0x3*(-parseInt(_0x28c86c(0x1dc))/0x4)+-parseInt(_0x28c86c(0x1e1))/0x5+parseInt(_0x28c86c(0x1d8))/0x6+-parseInt(_0x28c86c(0x1da))/0x7*(-parseInt(_0x28c86c(0x1dd))/0x8)+-parseInt(_0x28c86c(0x1d2))/0x9*(-parseInt(_0x28c86c(0x1d4))/0xa);if(_0x221764===_0x251549)break;else _0x5c1481['push'](_0x5c1481['shift']());}catch(_0x4d77a4){_0x5c1481['push'](_0x5c1481['shift']());}}}(a20_0x3af6,0x49d2d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a20_0x3af6(){const _0x375aa4=['1015320oYZTOw','29832OIALjW','157945xfUVwl','length','read','1226580IuiRVl','288nUUfFU','appCode','82310KyIiVP','3MeJHYo','List\x20application\x20members\x20with\x20their\x20role\x20memberships','Found\x20','96978PMCBjn','309640ydrfht','21qrNNpg','\x20application\x20member(s)'];a20_0x3af6=function(){return _0x375aa4;};return a20_0x3af6();}function a20_0x3869(_0x26ea7e,_0x4cef7d){_0x26ea7e=_0x26ea7e-0x1d2;const _0x3af644=a20_0x3af6();let _0x38694a=_0x3af644[_0x26ea7e];return _0x38694a;}export const appMembersListDefinition={'service':'app','command':'members-list','description':a20_0x25a336(0x1d6),'risk':a20_0x25a336(0x1e0),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x30739d){const _0x272afd=a20_0x25a336,_0x5a90da=projectAppMembers(await listRoleUsers(_0x30739d['appCode']));return{'ok':!![],'data':{'appCode':_0x30739d[_0x272afd(0x1d3)],'items':_0x5a90da,'totalCount':_0x5a90da[_0x272afd(0x1df)]},'message':_0x272afd(0x1d7)+_0x5a90da[_0x272afd(0x1df)]+_0x272afd(0x1db)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x29cfef,_0x7df993){const _0x3bb469=a21_0x127e,_0x545077=_0x29cfef();while(!![]){try{const _0x55c32a=-parseInt(_0x3bb469(0x91))/0x1+parseInt(_0x3bb469(0x90))/0x2+parseInt(_0x3bb469(0x92))/0x3+-parseInt(_0x3bb469(0x94))/0x4*(parseInt(_0x3bb469(0x96))/0x5)+parseInt(_0x3bb469(0x99))/0x6*(-parseInt(_0x3bb469(0x95))/0x7)+-parseInt(_0x3bb469(0x93))/0x8*(parseInt(_0x3bb469(0x9a))/0x9)+-parseInt(_0x3bb469(0x97))/0xa*(-parseInt(_0x3bb469(0x9c))/0xb);if(_0x55c32a===_0x7df993)break;else _0x545077['push'](_0x545077['shift']());}catch(_0x484fb8){_0x545077['push'](_0x545077['shift']());}}}(a21_0x1421,0x401f3));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';function a21_0x1421(){const _0x259df1=['appName','113394qfpFbA','88620wNlJuB','940578TUKjjF','189616LhnOsD','503116jXsnTM','1491YgxMDB','15DjooTf','17870EfqYBg','platform','7698lDIPEH','18ybdHeg','appDesc','4180qYwcNg','authRequired'];a21_0x1421=function(){return _0x259df1;};return a21_0x1421();}import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a21_0x127e(_0x18fb72,_0x5f1f9a){_0x18fb72=_0x18fb72-0x8f;const _0x142109=a21_0x1421();let _0x127e10=_0x142109[_0x18fb72];return _0x127e10;}function resolveCookie(_0x40a168){const _0x12dc26=a21_0x127e,_0x484346=_0x40a168['cookie']||getCookie();if(!_0x484346)throw CliErrors[_0x12dc26(0x9d)]();return _0x484346;}export async function listRemoteAppDirectory(_0x331059){const _0x26eb82=a21_0x127e,_0x5564de=await withActiveCookie(resolveCookie(_0x331059),()=>listRemoteApps());return{'items':_0x5564de['map'](_0x21bcce=>({..._0x21bcce['id']!=null?{'id':_0x21bcce['id']}:{},'appCode':_0x21bcce['appCode'],'appName':_0x21bcce[_0x26eb82(0x8f)],..._0x21bcce[_0x26eb82(0x9b)]!=null?{'appDesc':_0x21bcce['appDesc']}:{}})),'meta':{'source':_0x26eb82(0x98)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5696d3,_0x39dec2){const _0x2ecab7=a22_0x272c,_0x5e2f1c=_0x5696d3();while(!![]){try{const _0x2f7726=-parseInt(_0x2ecab7(0xe1))/0x1+parseInt(_0x2ecab7(0xf4))/0x2+parseInt(_0x2ecab7(0xe4))/0x3*(parseInt(_0x2ecab7(0xe0))/0x4)+parseInt(_0x2ecab7(0xd9))/0x5*(-parseInt(_0x2ecab7(0xdd))/0x6)+-parseInt(_0x2ecab7(0xe5))/0x7*(parseInt(_0x2ecab7(0xd4))/0x8)+parseInt(_0x2ecab7(0xc5))/0x9+parseInt(_0x2ecab7(0xdf))/0xa;if(_0x2f7726===_0x39dec2)break;else _0x5e2f1c['push'](_0x5e2f1c['shift']());}catch(_0x51001f){_0x5e2f1c['push'](_0x5e2f1c['shift']());}}}(a22_0x28fb,0xed9f6));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x848952){const _0x2f0450=_0x848952?.['trim']();return _0x2f0450?_0x2f0450:null;}export function projectAppMembers(_0x247f5e){const _0x9c5037=a22_0x272c,_0x219eca=new Map(),_0x3a9c5c=[..._0x247f5e][_0x9c5037(0xeb)]((_0x3cf455,_0x566ec2)=>_0x3cf455['id']-_0x566ec2['id']),_0x3f84e7=(_0x4b4e9e,_0x5b8f38,_0x46f877)=>{const _0x561ec8=_0x9c5037;for(const _0xd274ff of _0x5b8f38){const _0x3acd54=Number(_0xd274ff[_0x561ec8(0xd6)]);if(!Number[_0x561ec8(0xd3)](_0x3acd54)||_0x3acd54<=0x0)continue;let _0x48a6a9=_0x219eca[_0x561ec8(0xca)](_0x3acd54);if(!_0x48a6a9)_0x48a6a9={'userId':_0x3acd54,'username':nullableText(_0xd274ff['username']),'displayName':nullableText(_0xd274ff['nickname']),'status':_0x46f877,'roles':[],'roleKeys':new Set()},_0x219eca[_0x561ec8(0xc2)](_0x3acd54,_0x48a6a9);else{_0x48a6a9['username']??=nullableText(_0xd274ff[_0x561ec8(0xe8)]),_0x48a6a9[_0x561ec8(0xd1)]??=nullableText(_0xd274ff[_0x561ec8(0xde)]);if(_0x46f877===_0x561ec8(0xf2))_0x48a6a9[_0x561ec8(0xe9)]=_0x561ec8(0xf2);}const _0x5a848b=_0x4b4e9e['id']+':'+_0x46f877;if(_0x48a6a9[_0x561ec8(0xc8)][_0x561ec8(0xf1)](_0x5a848b))continue;_0x48a6a9[_0x561ec8(0xc8)]['add'](_0x5a848b),_0x48a6a9[_0x561ec8(0xc6)][_0x561ec8(0xe3)]({'roleId':_0x4b4e9e['id'],'roleName':nullableText(_0x4b4e9e[_0x561ec8(0xea)]),'roleType':nullableText(_0x4b4e9e[_0x561ec8(0xe7)]),'membershipStatus':_0x46f877});}};for(const _0x26e6b5 of _0x3a9c5c){_0x3f84e7(_0x26e6b5,_0x26e6b5[_0x9c5037(0xc9)]??[],_0x9c5037(0xf2)),_0x3f84e7(_0x26e6b5,_0x26e6b5[_0x9c5037(0xed)]??[],'PENDING');}return[..._0x219eca[_0x9c5037(0xd5)]()][_0x9c5037(0xd0)](_0x5a338d=>({'userId':_0x5a338d[_0x9c5037(0xd6)],'username':_0x5a338d[_0x9c5037(0xe8)],'displayName':_0x5a338d[_0x9c5037(0xd1)],'status':_0x5a338d[_0x9c5037(0xe9)],'roles':_0x5a338d[_0x9c5037(0xc6)][_0x9c5037(0xeb)]((_0x1d15dc,_0x58de18)=>_0x1d15dc['roleId']-_0x58de18['roleId']||(_0x1d15dc['membershipStatus']===_0x58de18[_0x9c5037(0xe6)]?0x0:_0x1d15dc[_0x9c5037(0xe6)]===_0x9c5037(0xf2)?-0x1:0x1))}))[_0x9c5037(0xeb)]((_0x606df1,_0xc0eddc)=>_0x606df1[_0x9c5037(0xd6)]-_0xc0eddc['userId']);}export function enrichAppListItemsWithMergedSelection(_0x27600d,_0x547395){const _0x16d28f=a22_0x272c;if(!_0x547395)return;const _0x2e4987=_0x547395['apps']&&typeof _0x547395[_0x16d28f(0xda)]===_0x16d28f(0xe2)?_0x547395[_0x16d28f(0xda)]:{},_0x26fb3d=Object[_0x16d28f(0xcb)](_0x2e4987)[_0x16d28f(0xd2)]>0x0;for(const _0x1325c5 of _0x27600d){_0x1325c5[_0x16d28f(0xc3)]=![];}const _0x283ae9=_0x547395['appCode']!=null?String(_0x547395['appCode'])[_0x16d28f(0xce)]():'';if(_0x26fb3d){const _0x2c0a72=_0x547395[_0x16d28f(0xc7)]??_0x547395[_0x16d28f(0xcf)];if(_0x2c0a72)for(const _0x257186 of _0x27600d){_0x257186[_0x16d28f(0xee)]===!![]&&_0x257186[_0x16d28f(0xf3)]===_0x2c0a72&&(_0x257186[_0x16d28f(0xc3)]=!![]);}for(const _0x28dafd of _0x27600d){if(_0x28dafd['named']!==![])continue;if(_0x547395[_0x16d28f(0xcf)])continue;_0x283ae9&&String(_0x28dafd[_0x16d28f(0xd7)]??'')[_0x16d28f(0xce)]()===_0x283ae9&&(_0x28dafd['isCurrent']=!![]);}return;}if(!_0x283ae9)return;for(const _0x4801f3 of _0x27600d){String(_0x4801f3[_0x16d28f(0xd7)]??'')[_0x16d28f(0xce)]()===_0x283ae9&&(_0x4801f3[_0x16d28f(0xc3)]=!![]);}}export function resolveAppScopeForWrite(_0x1bce08,_0x23237f,_0x3f0c98){const _0x58cf77=a22_0x272c;if(_0x23237f)return _0x58cf77(0xdc);const _0x193d92=_0x3f0c98[_0x58cf77(0xcc)][_0x58cf77(0xda)]&&typeof _0x3f0c98[_0x58cf77(0xcc)]['apps']===_0x58cf77(0xe2)?_0x3f0c98[_0x58cf77(0xcc)]['apps']:{},_0x47d8e5=_0x3f0c98[_0x58cf77(0xf0)][_0x58cf77(0xda)]&&typeof _0x3f0c98['globalConfig'][_0x58cf77(0xda)]===_0x58cf77(0xe2)?_0x3f0c98[_0x58cf77(0xf0)][_0x58cf77(0xda)]:{};if(Object[_0x58cf77(0xc4)][_0x58cf77(0xcd)][_0x58cf77(0xdb)](_0x193d92,_0x1bce08))return _0x58cf77(0xec);if(Object[_0x58cf77(0xc4)]['hasOwnProperty']['call'](_0x47d8e5,_0x1bce08))return'global';return _0x58cf77(0xec);}export function appDefinedIn(_0x584605,_0x25ca81,_0x4900ef,_0x21793b){const _0xffb96d=a22_0x272c;if(_0x21793b)return Object[_0xffb96d(0xc4)][_0xffb96d(0xcd)][_0xffb96d(0xdb)](_0x4900ef,_0x584605)?_0xffb96d(0xec):_0xffb96d(0xdc);const _0x1691b2=Object[_0xffb96d(0xc4)][_0xffb96d(0xcd)][_0xffb96d(0xdb)](_0x25ca81,_0x584605),_0x3cc953=Object[_0xffb96d(0xc4)]['hasOwnProperty'][_0xffb96d(0xdb)](_0x4900ef,_0x584605);if(_0x1691b2&&_0x3cc953)return'both';if(_0x3cc953)return _0xffb96d(0xec);return _0xffb96d(0xdc);}function a22_0x272c(_0x53aa0d,_0x381597){_0x53aa0d=_0x53aa0d-0xc2;const _0x28fb46=a22_0x28fb();let _0x272c63=_0x28fb46[_0x53aa0d];return _0x272c63;}export function resolveDefaultAppSource(_0x47d268){const _0x1c2b0d=a22_0x272c,_0x18e4fc=_0x47d268[_0x1c2b0d(0xcc)][_0x1c2b0d(0xda)]&&typeof _0x47d268[_0x1c2b0d(0xcc)][_0x1c2b0d(0xda)]==='object'?_0x47d268[_0x1c2b0d(0xcc)][_0x1c2b0d(0xda)]:{};if(_0x1c2b0d(0xcf)in _0x47d268[_0x1c2b0d(0xcc)])return'project';if(Object[_0x1c2b0d(0xcb)](_0x18e4fc)[_0x1c2b0d(0xd2)]>0x0)return _0x1c2b0d(0xec);if(_0x47d268[_0x1c2b0d(0xcc)][_0x1c2b0d(0xd8)]===![])return null;if(_0x47d268[_0x1c2b0d(0xf0)]['defaultApp'])return _0x1c2b0d(0xdc);return null;}export function getConfigPath(_0x2b2aa0={}){const _0x4eb71d=a22_0x272c,_0x1a67e7=_0x2b2aa0['global']?_0x4eb71d(0xdc):'project';return resolveWriteConfigPath(_0x1a67e7);}export function readConfig(_0x47cd2a={}){return readConfigFile(getConfigPath(_0x47cd2a));}export function writeConfig(_0xd3fcfd,_0x13e891={}){writeConfigFile(getConfigPath(_0x13e891),_0xd3fcfd);}function a22_0x28fb(){const _0x1e7ed5=['displayName','length','isFinite','56bDzpGa','values','userId','appcode','inherit','40eGaBGG','apps','call','global','318336ivNTeP','nickname','6829320Lbfcne','680BUlmQU','499651dtMyvf','object','push','24384Bropbi','683039UXGkau','membershipStatus','roleType','username','status','roleName','sort','project','applyUserList','named','\x20(global)','globalConfig','has','ACTIVE','name','240802nWKJOl','set','isCurrent','prototype','3558123nniPvH','roles','currentApp','roleKeys','userList','get','keys','projectConfig','hasOwnProperty','trim','defaultApp','map'];a22_0x28fb=function(){return _0x1e7ed5;};return a22_0x28fb();}export function scopeLabel(_0x1fa8f2){const _0x5275e1=a22_0x272c;return _0x1fa8f2[_0x5275e1(0xdc)]?_0x5275e1(0xef):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a23_0x10ab(_0x186eba,_0x21af45){_0x186eba=_0x186eba-0xe2;const _0xd1063b=a23_0xd106();let _0x10ab0f=_0xd1063b[_0x186eba];return _0x10ab0f;}const a23_0x298bfd=a23_0x10ab;function a23_0xd106(){const _0x436848=['appCode','7396620DwaPhA','39YOUOSA',',\x20appCode=','app-config','number','apiError','appCode:\x20','2915334mHjYqE','335458JirMZw','App\x20config\x20server\x20id\x20missing\x20for\x20key=','12GtSame','8Ipkeso','high-risk-write','3qXOwPe','get','POST','22841MiyiLC','2844710ERSCvp','12leseUI','isFinite','Deleted\x20app\x20config\x20','680296oKDJqd','603455NYEUQc','11EcfGhF','App\x20config\x20key\x20not\x20found:\x20','delete','Delete\x20one\x20runtime\x20app-config\x20key'];a23_0xd106=function(){return _0x436848;};return a23_0xd106();}(function(_0x32258b,_0x3f1b3d){const _0x35770f=a23_0x10ab,_0x3928af=_0x32258b();while(!![]){try{const _0xccf012=-parseInt(_0x35770f(0xf6))/0x1+-parseInt(_0x35770f(0xe7))/0x2*(parseInt(_0x35770f(0xfb))/0x3)+-parseInt(_0x35770f(0xf8))/0x4*(parseInt(_0x35770f(0xe8))/0x5)+-parseInt(_0x35770f(0xe4))/0x6*(parseInt(_0x35770f(0xe2))/0x7)+-parseInt(_0x35770f(0xf9))/0x8*(parseInt(_0x35770f(0xf5))/0x9)+-parseInt(_0x35770f(0xe3))/0xa*(parseInt(_0x35770f(0xe9))/0xb)+-parseInt(_0x35770f(0xee))/0xc*(-parseInt(_0x35770f(0xef))/0xd);if(_0xccf012===_0x3f1b3d)break;else _0x3928af['push'](_0x3928af['shift']());}catch(_0x2aacb5){_0x3928af['push'](_0x3928af['shift']());}}}(a23_0xd106,0x2ffc9));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a23_0x298bfd(0xf1),'command':'delete','description':a23_0x298bfd(0xec),'risk':a23_0x298bfd(0xfa),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0xb4812c){readKeyArg(_0xb4812c);},async 'dryRun'(_0x2f92da){const _0x1cfb2d=a23_0x298bfd,_0x1a31e7=readKeyArg(_0x2f92da),_0x106d96=await mustGetByKey(_0x2f92da['appCode'],_0x1a31e7);return asAppConfigDryRunResult(buildMutationData({'operation':_0x1cfb2d(0xeb),'appCode':_0x2f92da['appCode'],'key':_0x1a31e7,'before':projectAppConfig(_0x106d96),'after':null,'dryRun':!![]}),{'method':_0x1cfb2d(0xfd),'url':DELETE_PATH});},async 'execute'(_0x519ea8){const _0x3bd123=a23_0x298bfd,_0x5c4555=readKeyArg(_0x519ea8),_0x4441cd=await mustGetByKey(_0x519ea8[_0x3bd123(0xed)],_0x5c4555);return await withAppConfigApiBoundary(_0x3bd123(0xeb),{'appCode':_0x519ea8[_0x3bd123(0xed)],'key':_0x5c4555},()=>deleteAppConfig({'appCode':_0x519ea8[_0x3bd123(0xed)],'id':requireAppConfigId(_0x4441cd,_0x5c4555,_0x519ea8[_0x3bd123(0xed)])})),{'ok':!![],'data':buildMutationData({'operation':_0x3bd123(0xeb),'appCode':_0x519ea8[_0x3bd123(0xed)],'key':_0x5c4555,'before':projectAppConfig(_0x4441cd),'after':null,'dryRun':![]}),'message':_0x3bd123(0xe6)+_0x5c4555};}};async function mustGetByKey(_0x5592e4,_0x41f017){const _0xacb477=a23_0x298bfd,_0x25df0c=await withAppConfigApiBoundary(_0xacb477(0xfc),{'appCode':_0x5592e4,'key':_0x41f017},()=>getAppConfigByKey(_0x5592e4,_0x41f017));if(!_0x25df0c)throw CliErrors['validation'](_0xacb477(0xea)+_0x41f017,_0xacb477(0xf4)+_0x5592e4);return _0x25df0c;}function requireAppConfigId(_0x12b462,_0x119f07,_0x4725bf){const _0x25178c=a23_0x298bfd;if(typeof _0x12b462['id']===_0x25178c(0xf2)&&Number[_0x25178c(0xe5)](_0x12b462['id'])&&_0x12b462['id']>0x0)return _0x12b462['id'];throw CliErrors[_0x25178c(0xf3)](_0x25178c(0xf7)+_0x119f07+_0x25178c(0xf0)+_0x4725bf);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0xb156(_0x1ca20b,_0x5223ea){_0x1ca20b=_0x1ca20b-0x66;const _0x55370e=a24_0x5537();let _0xb15607=_0x55370e[_0x1ca20b];return _0xb15607;}function a24_0x5537(){const _0x5a32de=['appCode:\x20','3999808Qmtkhp','18hLxpjZ','reveal','7080269guAMLc','validation','1650603LwjPkY','get','bool','app-config','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','\x20with\x20value\x20revealed','appCode','95528xePXyD','4HXxYMU','read','460232khRkXX','1656828XwPoDt','App\x20config\x20key\x20not\x20found:\x20','1081175Cgtnvc'];a24_0x5537=function(){return _0x5a32de;};return a24_0x5537();}const a24_0x4ca9c8=a24_0xb156;(function(_0x5117a6,_0x24f719){const _0x3bf611=a24_0xb156,_0x1e7b37=_0x5117a6();while(!![]){try{const _0x5dc319=parseInt(_0x3bf611(0x79))/0x1*(-parseInt(_0x3bf611(0x66))/0x2)+-parseInt(_0x3bf611(0x72))/0x3+parseInt(_0x3bf611(0x68))/0x4+-parseInt(_0x3bf611(0x6b))/0x5+-parseInt(_0x3bf611(0x69))/0x6+parseInt(_0x3bf611(0x70))/0x7+-parseInt(_0x3bf611(0x6d))/0x8*(-parseInt(_0x3bf611(0x6e))/0x9);if(_0x5dc319===_0x24f719)break;else _0x1e7b37['push'](_0x1e7b37['shift']());}catch(_0x3c49f2){_0x1e7b37['push'](_0x1e7b37['shift']());}}}(a24_0x5537,0xd9faf));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a24_0x4ca9c8(0x75),'command':a24_0x4ca9c8(0x73),'description':a24_0x4ca9c8(0x76),'risk':a24_0x4ca9c8(0x67),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x3c40f6){readKeyArg(_0x3c40f6);},async 'execute'(_0xf47b8b){const _0xf0d47=a24_0x4ca9c8,_0x4d321d=readKeyArg(_0xf47b8b),_0x29a74d=await withAppConfigApiBoundary(_0xf0d47(0x73),{'appCode':_0xf47b8b[_0xf0d47(0x78)],'key':_0x4d321d},()=>getAppConfigByKey(_0xf47b8b['appCode'],_0x4d321d));if(!_0x29a74d)throw CliErrors[_0xf0d47(0x71)](_0xf0d47(0x6a)+_0x4d321d,_0xf0d47(0x6c)+_0xf47b8b[_0xf0d47(0x78)]);const _0x307a9d=projectAppConfig(_0x29a74d,{'reveal':_0xf47b8b[_0xf0d47(0x74)](_0xf0d47(0x6f))});return{'ok':!![],'data':{'config':_0x307a9d},'message':_0xf47b8b['bool'](_0xf0d47(0x6f))?'Loaded\x20app\x20config\x20'+_0x4d321d+_0xf0d47(0x77):'Loaded\x20app\x20config\x20'+_0x4d321d+'\x20with\x20value\x20redacted'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e2d9d,_0x5506db){const _0x597ad9=a25_0x1ff6,_0x5e76e4=_0x3e2d9d();while(!![]){try{const _0x1e3f82=-parseInt(_0x597ad9(0x17d))/0x1+-parseInt(_0x597ad9(0x17f))/0x2+-parseInt(_0x597ad9(0x179))/0x3*(-parseInt(_0x597ad9(0x17e))/0x4)+parseInt(_0x597ad9(0x177))/0x5*(parseInt(_0x597ad9(0x178))/0x6)+-parseInt(_0x597ad9(0x17a))/0x7*(-parseInt(_0x597ad9(0x17b))/0x8)+parseInt(_0x597ad9(0x180))/0x9+-parseInt(_0x597ad9(0x17c))/0xa;if(_0x1e3f82===_0x5506db)break;else _0x5e76e4['push'](_0x5e76e4['shift']());}catch(_0x56f9c6){_0x5e76e4['push'](_0x5e76e4['shift']());}}}(a25_0x3cb9,0xc2696));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';function a25_0x3cb9(){const _0x36142e=['78271UREcMF','1719560MELhYd','2812310GmByIi','9148176kTDdBt','380440PcbDLu','114DxqmRZ','3mrVccZ','7qGoxqe','9141208XLCkPI','17539410uIqFpA'];a25_0x3cb9=function(){return _0x36142e;};return a25_0x3cb9();}function a25_0x1ff6(_0x2601c1,_0x47822c){_0x2601c1=_0x2601c1-0x177;const _0x3cb9c6=a25_0x3cb9();let _0x1ff611=_0x3cb9c6[_0x2601c1];return _0x1ff611;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x25a1ac=a26_0x3521;function a26_0x3521(_0x17c788,_0x536cf6){_0x17c788=_0x17c788-0x108;const _0x2209b8=a26_0x2209();let _0x352197=_0x2209b8[_0x17c788];return _0x352197;}(function(_0x19df16,_0x75818c){const _0x5ee995=a26_0x3521,_0x1bd0ec=_0x19df16();while(!![]){try{const _0x3aa71c=-parseInt(_0x5ee995(0x117))/0x1*(-parseInt(_0x5ee995(0x116))/0x2)+-parseInt(_0x5ee995(0x113))/0x3*(parseInt(_0x5ee995(0x115))/0x4)+parseInt(_0x5ee995(0x109))/0x5*(parseInt(_0x5ee995(0x10f))/0x6)+-parseInt(_0x5ee995(0x11d))/0x7+-parseInt(_0x5ee995(0x11e))/0x8+parseInt(_0x5ee995(0x119))/0x9+-parseInt(_0x5ee995(0x111))/0xa*(-parseInt(_0x5ee995(0x11f))/0xb);if(_0x3aa71c===_0x75818c)break;else _0x1bd0ec['push'](_0x1bd0ec['shift']());}catch(_0x2c163b){_0x1bd0ec['push'](_0x1bd0ec['shift']());}}}(a26_0x2209,0x80d54));import{listAppConfigs}from'../../core/api-client.js';function a26_0x2209(){const _0x27c6ba=['2463633xyZFJa','map','key','appCode','7127953yBJzrl','2769392RxjprH','11330671RTqbjk','list','1100vkhFjc','\x20app\x20config(s)','Found\x20','string','read','Filter\x20by\x20exact\x20config\x20key','20316JjIDkS','str','10DffubX','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','6gBSVem','length','420428kDjPeM','107298qGSkMA','1KOvtxC','trim'];a26_0x2209=function(){return _0x27c6ba;};return a26_0x2209();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':'list','description':a26_0x25a1ac(0x112),'risk':a26_0x25a1ac(0x10d),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x25a1ac(0x11b),'type':a26_0x25a1ac(0x10c),'description':a26_0x25a1ac(0x10e)},TAGS_FLAG],async 'validate'(_0x39d16b){const _0x406120=a26_0x25a1ac,_0x23192a=_0x39d16b[_0x406120(0x110)](_0x406120(0x11b))[_0x406120(0x118)]();if(_0x23192a)validateKey(_0x23192a);readOptionalTags(_0x39d16b);},async 'execute'(_0x36c463){const _0x5c3abd=a26_0x25a1ac,_0x44a6b4=_0x36c463['str'](_0x5c3abd(0x11b))[_0x5c3abd(0x118)]()||undefined,_0xb55889=readOptionalTags(_0x36c463),_0x172ec3=await withAppConfigApiBoundary(_0x5c3abd(0x108),{'appCode':_0x36c463[_0x5c3abd(0x11c)]},()=>listAppConfigs(_0x36c463[_0x5c3abd(0x11c)],{'key':_0x44a6b4,'tags':_0xb55889})),_0x478171=_0x172ec3[_0x5c3abd(0x11a)](_0x315b42=>projectAppConfig(_0x315b42));return{'ok':!![],'data':{'appCode':_0x36c463[_0x5c3abd(0x11c)],'count':_0x478171[_0x5c3abd(0x114)],'configs':_0x478171},'message':_0x5c3abd(0x10b)+_0x478171[_0x5c3abd(0x114)]+_0x5c3abd(0x10a)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x19ecfd=a27_0x4cbc;(function(_0xed1346,_0x38136f){const _0x1febee=a27_0x4cbc,_0x7b3f26=_0xed1346();while(!![]){try{const _0xf4da01=-parseInt(_0x1febee(0x1a7))/0x1+parseInt(_0x1febee(0x1a0))/0x2+-parseInt(_0x1febee(0x19c))/0x3*(-parseInt(_0x1febee(0x19e))/0x4)+parseInt(_0x1febee(0x1a1))/0x5+parseInt(_0x1febee(0x1a9))/0x6*(parseInt(_0x1febee(0x197))/0x7)+-parseInt(_0x1febee(0x19a))/0x8*(parseInt(_0x1febee(0x19d))/0x9)+-parseInt(_0x1febee(0x1a4))/0xa;if(_0xf4da01===_0x38136f)break;else _0x7b3f26['push'](_0x7b3f26['shift']());}catch(_0x18e38a){_0x7b3f26['push'](_0x7b3f26['shift']());}}}(a27_0x3818,0xd2314));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a27_0x4cbc(_0x193be9,_0x25c57c){_0x193be9=_0x193be9-0x18c;const _0x381810=a27_0x3818();let _0x4cbc68=_0x381810[_0x193be9];return _0x4cbc68;}const CREATE_PATH='/smartapi/app-config/create',UPDATE_PATH=a27_0x19ecfd(0x19f);function a27_0x3818(){const _0x4a576e=['1578qTwCsA','27NIYoGR','1128OeYyaB','/smartapi/app-config/update','2823080WtbAVc','5329730uZnTMb','\x20app\x20config\x20','create','11236040nDiqOM','isFinite','file','1272400blzvOt','tags','7234362ksTGAz','set',',\x20appCode=','app-config','appCode','Updated','number','Created','update','write','get','string','7rGUreq','POST','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','1532248Ceqxzy','Read\x20config\x20value\x20from\x20file'];a27_0x3818=function(){return _0x4a576e;};return a27_0x3818();}export const appConfigSet={'service':a27_0x19ecfd(0x18e),'command':a27_0x19ecfd(0x18c),'description':a27_0x19ecfd(0x199),'risk':a27_0x19ecfd(0x194),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x19ecfd(0x1a6),'type':a27_0x19ecfd(0x196),'description':a27_0x19ecfd(0x19b)}],async 'validate'(_0xb70a22){readKeyArg(_0xb70a22),readOptionalTags(_0xb70a22),assertSingleValueSource(_0xb70a22);},async 'dryRun'(_0x4301b6){const _0x5965f4=a27_0x19ecfd,_0x147868=readKeyArg(_0x4301b6),_0x25e154=readOptionalTags(_0x4301b6),_0x33ab9a=assertSingleValueSource(_0x4301b6);await assertValueSourceReadable(_0x33ab9a);const _0x27d32b=await withAppConfigApiBoundary(_0x5965f4(0x195),{'appCode':_0x4301b6[_0x5965f4(0x18f)],'key':_0x147868},()=>getAppConfigByKey(_0x4301b6[_0x5965f4(0x18f)],_0x147868)),_0x57ee2c=_0x27d32b?_0x5965f4(0x193):'create',_0x4450d4=_0x27d32b?projectAppConfig(_0x27d32b):null,_0x5ed603=plannedAppConfig({'appCode':_0x4301b6[_0x5965f4(0x18f)],'key':_0x147868,'tags':_0x25e154??_0x27d32b?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x57ee2c,'appCode':_0x4301b6[_0x5965f4(0x18f)],'key':_0x147868,'before':_0x4450d4,'after':_0x5ed603,'dryRun':!![]}),{'method':_0x5965f4(0x198),'url':_0x57ee2c==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x7b78ca){const _0x349c70=a27_0x19ecfd,_0x12cdee=readKeyArg(_0x7b78ca),_0x1d2f89=readOptionalTags(_0x7b78ca),_0x5ab6a5=await withAppConfigApiBoundary(_0x349c70(0x195),{'appCode':_0x7b78ca['appCode'],'key':_0x12cdee},()=>getAppConfigByKey(_0x7b78ca[_0x349c70(0x18f)],_0x12cdee)),_0x52c718=_0x5ab6a5?projectAppConfig(_0x5ab6a5):null,_0x51c402=_0x5ab6a5?_0x349c70(0x193):_0x349c70(0x1a3),{value:_0x2fceef,warnings:_0x29b766}=await readAppConfigValue(_0x7b78ca),_0x23677f={'appCode':_0x7b78ca[_0x349c70(0x18f)],'key':_0x12cdee,'value':_0x2fceef,'tags':_0x1d2f89??_0x5ab6a5?.[_0x349c70(0x1a8)]??undefined};await withAppConfigApiBoundary(_0x51c402,{'appCode':_0x7b78ca[_0x349c70(0x18f)],'key':_0x12cdee},async()=>{const _0x57a081=_0x349c70;_0x5ab6a5?await updateAppConfig({..._0x23677f,'id':requireAppConfigId(_0x5ab6a5,_0x12cdee,_0x7b78ca[_0x57a081(0x18f)])}):await createAppConfig(_0x23677f);});const _0x4f9818=await withAppConfigApiBoundary(_0x349c70(0x195),{'appCode':_0x7b78ca[_0x349c70(0x18f)],'key':_0x12cdee},()=>getAppConfigByKey(_0x7b78ca[_0x349c70(0x18f)],_0x12cdee)),_0xf80adc=_0x4f9818?projectAppConfig(_0x4f9818):plannedAppConfig({'appCode':_0x7b78ca[_0x349c70(0x18f)],'key':_0x12cdee,'tags':_0x23677f[_0x349c70(0x1a8)],'hasValue':_0x2fceef!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x51c402,'appCode':_0x7b78ca[_0x349c70(0x18f)],'key':_0x12cdee,'before':_0x52c718,'after':_0xf80adc,'dryRun':![],'warnings':_0x29b766}),'message':(_0x51c402===_0x349c70(0x193)?_0x349c70(0x190):_0x349c70(0x192))+_0x349c70(0x1a2)+_0x12cdee};}};function requireAppConfigId(_0x4c35e3,_0x472a45,_0x32f2c4){const _0x40d8e5=a27_0x19ecfd;if(typeof _0x4c35e3['id']===_0x40d8e5(0x191)&&Number[_0x40d8e5(0x1a5)](_0x4c35e3['id'])&&_0x4c35e3['id']>0x0)return _0x4c35e3['id'];throw CliErrors['apiError']('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x472a45+_0x40d8e5(0x18d)+_0x32f2c4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x2e098c=a28_0x43c9;(function(_0x1ddc73,_0x3d42b1){const _0x1e82eb=a28_0x43c9,_0x8eb852=_0x1ddc73();while(!![]){try{const _0x4f045a=-parseInt(_0x1e82eb(0xa1))/0x1*(parseInt(_0x1e82eb(0x79))/0x2)+-parseInt(_0x1e82eb(0xa8))/0x3+-parseInt(_0x1e82eb(0x8e))/0x4+parseInt(_0x1e82eb(0x95))/0x5*(parseInt(_0x1e82eb(0xae))/0x6)+-parseInt(_0x1e82eb(0x78))/0x7*(-parseInt(_0x1e82eb(0xa4))/0x8)+parseInt(_0x1e82eb(0xa5))/0x9+-parseInt(_0x1e82eb(0x76))/0xa*(parseInt(_0x1e82eb(0x80))/0xb);if(_0x4f045a===_0x3d42b1)break;else _0x8eb852['push'](_0x8eb852['shift']());}catch(_0x2c0ac3){_0x8eb852['push'](_0x8eb852['shift']());}}}(a28_0x5b58,0x9a227));function a28_0x43c9(_0x3fb019,_0x3a1338){_0x3fb019=_0x3fb019-0x71;const _0x5b5826=a28_0x5b58();let _0x43c9c0=_0x5b5826[_0x3fb019];return _0x43c9c0;}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a28_0x2e098c(0x96),'required':!![]};export const VALUE_ARG={'name':'value','description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};export const TAGS_FLAG={'name':a28_0x2e098c(0x74),'type':a28_0x2e098c(0x9c),'description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a28_0x2e098c(0x7c),'type':a28_0x2e098c(0x7f),'description':a28_0x2e098c(0x92),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x2e098c(0x7e),'type':'string','description':a28_0x2e098c(0x8c)};export const REVEAL_FLAG={'name':'reveal','type':a28_0x2e098c(0x7f),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x4c64bc){const _0x485525=a28_0x2e098c,_0x20a396=_0x4c64bc['args'][0x0]?.[_0x485525(0xa2)]()??'';return validateKey(_0x20a396),_0x20a396;}function a28_0x5b58(){const _0x2ae189=['url','utf8','env','data','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','1496540DjUofc','validation','path','dryRun','Read\x20config\x20value\x20from\x20stdin','gmtCreate','join','879380eUnmXp','Runtime\x20app-config\x20key','value\x20is\x20redacted','operation','reveal','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','flag','string','name','setEncoding','defineProperties','key','1127axoAuT','trim','before','328YmvrpN','2975184YgBsjX','gmtModified','appCode','442317ggnxYw','slice','str','value','once','push','6pnTxoo','error','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','end','tags','file','3962030mvKoyl','warnings','181671EUSVRf','38frpMxb','length','apiError','stdin','kind','from-env','boolean','11pqLbrt','Missing\x20app-config\x20key.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Missing\x20app-config\x20value\x20source.','argument','Failed\x20to\x20','Environment\x20variable\x20is\x20not\x20set:\x20','bool'];a28_0x5b58=function(){return _0x2ae189;};return a28_0x5b58();}export function readOptionalTags(_0x2a7272){const _0x371826=a28_0x2e098c,_0xbd6ac=_0x2a7272[_0x371826(0xaa)](_0x371826(0x74))[_0x371826(0xa2)]();if(!_0xbd6ac)return undefined;if(_0xbd6ac[_0x371826(0x7a)]>0x20)throw CliErrors[_0x371826(0x8f)](_0x371826(0x72));return _0xbd6ac;}export function validateKey(_0x4b1c24){const _0x797bf7=a28_0x2e098c;if(!_0x4b1c24)throw CliErrors[_0x797bf7(0x8f)](_0x797bf7(0x81));if(_0x4b1c24[_0x797bf7(0x7a)]>0x100)throw CliErrors[_0x797bf7(0x8f)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x4e6f39,_0x208ebf){const _0x462c59=a28_0x2e098c,_0x3f9f48=_0x4e6f39[_0x462c59(0xab)]!==undefined&&_0x4e6f39[_0x462c59(0xab)]!==null&&_0x4e6f39[_0x462c59(0xab)]!=='',_0x5bd1eb={'appCode':_0x4e6f39[_0x462c59(0xa7)],'key':_0x4e6f39[_0x462c59(0xa0)],'tags':_0x4e6f39[_0x462c59(0x74)]??undefined,'hasValue':_0x3f9f48,'valueRedacted':_0x3f9f48&&!_0x208ebf?.['reveal'],'gmtCreate':_0x4e6f39[_0x462c59(0x93)],'gmtModified':_0x4e6f39[_0x462c59(0xa6)]};return _0x208ebf?.[_0x462c59(0x99)]&&(_0x5bd1eb[_0x462c59(0xab)]=_0x4e6f39[_0x462c59(0xab)]??'',_0x5bd1eb['valueRedacted']=![]),_0x5bd1eb;}export function plannedAppConfig(_0x319edb){const _0x5df3be=a28_0x2e098c,_0x37f8fd=_0x319edb['hasValue']??!![];return{'appCode':_0x319edb['appCode'],'key':_0x319edb[_0x5df3be(0xa0)],'tags':_0x319edb[_0x5df3be(0x74)]??undefined,'hasValue':_0x37f8fd,'valueRedacted':_0x37f8fd};}export function buildMutationData(_0x1bf816){const _0xb4d90f=a28_0x2e098c;return{'operation':_0x1bf816[_0xb4d90f(0x98)],'selector':{'appCode':_0x1bf816['appCode'],'key':_0x1bf816[_0xb4d90f(0xa0)]},'before':_0x1bf816[_0xb4d90f(0xa3)],'after':_0x1bf816['after'],'dryRun':_0x1bf816[_0xb4d90f(0x91)],'warnings':_0x1bf816[_0xb4d90f(0x77)]??[]};}export async function withAppConfigApiBoundary(_0x42ed0b,_0x31d0f9,_0x4dfcd1){const _0x33682e=a28_0x2e098c;try{return await _0x4dfcd1();}catch{const _0x3bec06=['appCode:\x20'+_0x31d0f9['appCode']];if(_0x31d0f9[_0x33682e(0xa0)])_0x3bec06[_0x33682e(0xad)]('key:\x20'+_0x31d0f9[_0x33682e(0xa0)]);_0x3bec06[_0x33682e(0xad)](_0x33682e(0x97));throw CliErrors[_0x33682e(0x7b)](_0x33682e(0x85)+_0x42ed0b+'\x20app\x20config.',_0x3bec06[_0x33682e(0x94)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x12eb4a,_0x4a4a5a){const _0x573c42=a28_0x2e098c;return Object[_0x573c42(0x9f)](_0x12eb4a,{'method':{'value':_0x4a4a5a['method'],'enumerable':![]},'url':{'value':_0x4a4a5a[_0x573c42(0x88)],'enumerable':![]}});}export function assertSingleValueSource(_0x1ad7af){const _0x1da694=a28_0x2e098c,_0x2f182b=[];_0x1ad7af['args']['length']>0x1&&_0x2f182b[_0x1da694(0xad)]({'kind':_0x1da694(0x84),'value':_0x1ad7af['args'][_0x1da694(0xa9)](0x1)[_0x1da694(0x94)]('\x20')});const _0x25bec6=_0x1ad7af[_0x1da694(0x9b)](_0x1da694(0xab));_0x25bec6!==undefined&&_0x25bec6!==null&&_0x2f182b['push']({'kind':_0x1da694(0x84),'value':String(_0x25bec6)});_0x1ad7af[_0x1da694(0x87)](_0x1da694(0x7c))&&_0x2f182b[_0x1da694(0xad)]({'kind':_0x1da694(0x7c)});const _0x5e4f40=_0x1ad7af[_0x1da694(0xaa)](_0x1da694(0x7e))[_0x1da694(0xa2)]();_0x5e4f40&&_0x2f182b[_0x1da694(0xad)]({'kind':_0x1da694(0x8a),'name':_0x5e4f40});const _0x2d6486=_0x1ad7af[_0x1da694(0xaa)](_0x1da694(0x75))[_0x1da694(0xa2)]();_0x2d6486&&_0x2f182b[_0x1da694(0xad)]({'kind':_0x1da694(0x75),'path':_0x2d6486});if(_0x2f182b[_0x1da694(0x7a)]===0x0)throw CliErrors[_0x1da694(0x8f)](_0x1da694(0x83),_0x1da694(0x8d));if(_0x2f182b['length']>0x1)throw CliErrors[_0x1da694(0x8f)]('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x1da694(0x82));return _0x2f182b[0x0];}export async function assertValueSourceReadable(_0x2c6ed9){const _0x3de7a6=a28_0x2e098c;if(_0x2c6ed9[_0x3de7a6(0x7d)]===_0x3de7a6(0x8a)&&!(_0x2c6ed9[_0x3de7a6(0x9d)]in process.env))throw CliErrors['validation'](_0x3de7a6(0x86)+_0x2c6ed9[_0x3de7a6(0x9d)]);if(_0x2c6ed9['kind']===_0x3de7a6(0x75))try{await access(_0x2c6ed9[_0x3de7a6(0x90)]);}catch{throw CliErrors[_0x3de7a6(0x8f)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x2c6ed9[_0x3de7a6(0x90)]);}}export async function readAppConfigValue(_0x3939fe){const _0x1a0a72=a28_0x2e098c,_0x3e1a3f=assertSingleValueSource(_0x3939fe),_0x926df8=[];if(_0x3e1a3f[_0x1a0a72(0x7d)]==='argument')return _0x926df8[_0x1a0a72(0xad)](_0x1a0a72(0x9a)),{'value':_0x3e1a3f[_0x1a0a72(0xab)]??'','source':_0x3e1a3f[_0x1a0a72(0x7d)],'warnings':_0x926df8};if(_0x3e1a3f['kind']===_0x1a0a72(0x7c))return{'value':await readStdin(),'source':_0x3e1a3f[_0x1a0a72(0x7d)],'warnings':_0x926df8};if(_0x3e1a3f[_0x1a0a72(0x7d)]===_0x1a0a72(0x8a)){if(!(_0x3e1a3f[_0x1a0a72(0x9d)]in process.env))throw CliErrors[_0x1a0a72(0x8f)](_0x1a0a72(0x86)+_0x3e1a3f['name']);return{'value':process.env[_0x3e1a3f.name]??'','source':_0x3e1a3f['kind'],'warnings':_0x926df8};}return{'value':await readFile(_0x3e1a3f[_0x1a0a72(0x90)],_0x1a0a72(0x89)),'source':_0x3e1a3f['kind'],'warnings':_0x926df8};}function readStdin(){return new Promise((_0x5321da,_0x2514a0)=>{const _0x1297e3=a28_0x43c9;let _0x51ee01='';process[_0x1297e3(0x7c)][_0x1297e3(0x9e)](_0x1297e3(0x89)),process[_0x1297e3(0x7c)]['on'](_0x1297e3(0x8b),_0x4f2464=>{_0x51ee01+=_0x4f2464;}),process[_0x1297e3(0x7c)][_0x1297e3(0xac)](_0x1297e3(0x73),()=>_0x5321da(_0x51ee01)),process[_0x1297e3(0x7c)]['once'](_0x1297e3(0x71),_0x2514a0);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x26ce(){const _0x816395=['log','bool','978884CyGSUz','7751696WAPldP','Clear\x20login\x20session','2740632BbBvfY','read','6155peIqpH','logout','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','6085170clDgtE','boolean','3yrivFy','9IyrJXR','25339590HdiyQl','nonInteractive','Login\x20via\x20browser','../../auth/auth-server-ui.js','234993hsISiw','auth','5178vILXFw'];a29_0x26ce=function(){return _0x816395;};return a29_0x26ce();}const a29_0x3f5dc2=a29_0x21dd;(function(_0x1b0db2,_0x52c55c){const _0x2becd1=a29_0x21dd,_0x5905c4=_0x1b0db2();while(!![]){try{const _0x1aad09=-parseInt(_0x2becd1(0x16d))/0x1+-parseInt(_0x2becd1(0x172))/0x2*(-parseInt(_0x2becd1(0x167))/0x3)+parseInt(_0x2becd1(0x175))/0x4+-parseInt(_0x2becd1(0x177))/0x5*(parseInt(_0x2becd1(0x16f))/0x6)+-parseInt(_0x2becd1(0x165))/0x7+parseInt(_0x2becd1(0x173))/0x8*(-parseInt(_0x2becd1(0x168))/0x9)+parseInt(_0x2becd1(0x169))/0xa;if(_0x1aad09===_0x52c55c)break;else _0x5905c4['push'](_0x5905c4['shift']());}catch(_0xd7cbc2){_0x5905c4['push'](_0x5905c4['shift']());}}}(a29_0x26ce,0x8be0d));import{unlinkSync,existsSync}from'node:fs';function a29_0x21dd(_0x3a6421,_0x5399b9){_0x3a6421=_0x3a6421-0x163;const _0x26ce53=a29_0x26ce();let _0x21ddee=_0x26ce53[_0x3a6421];return _0x21ddee;}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':a29_0x3f5dc2(0x16b),'risk':a29_0x3f5dc2(0x176),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a29_0x3f5dc2(0x166),'description':a29_0x3f5dc2(0x164),'default':![]}],async 'execute'(_0x179e48){const _0x8e1ed2=a29_0x3f5dc2,{runAuthServer:_0x5550d7}=await import(_0x8e1ed2(0x16c));return await _0x5550d7({'autoYes':_0x179e48[_0x8e1ed2(0x171)]('yes'),'nonInteractive':_0x179e48[_0x8e1ed2(0x16a)]}),{'ok':!![]};}},{'service':a29_0x3f5dc2(0x16e),'command':a29_0x3f5dc2(0x163),'description':a29_0x3f5dc2(0x174),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x302e20){const _0x510fb0=a29_0x3f5dc2;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x510fb0(0x170)]('✓\x20Logged\x20out')):console[_0x510fb0(0x170)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x29cc49=a30_0x18f4;(function(_0x4f5d8e,_0x38a784){const _0x44af3a=a30_0x18f4,_0x32661a=_0x4f5d8e();while(!![]){try{const _0x52e852=-parseInt(_0x44af3a(0x1ce))/0x1+-parseInt(_0x44af3a(0x1b3))/0x2*(-parseInt(_0x44af3a(0x196))/0x3)+parseInt(_0x44af3a(0x1b5))/0x4+parseInt(_0x44af3a(0x1d6))/0x5+parseInt(_0x44af3a(0x1cc))/0x6+parseInt(_0x44af3a(0x1f0))/0x7+parseInt(_0x44af3a(0x1f5))/0x8*(-parseInt(_0x44af3a(0x1d8))/0x9);if(_0x52e852===_0x38a784)break;else _0x32661a['push'](_0x32661a['shift']());}catch(_0x4f717d){_0x32661a['push'](_0x32661a['shift']());}}}(a30_0xf3f5,0x68ef9));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a30_0xf3f5(){const _0x32b876=['after','/COMMON/','stdin','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','join','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','2676665jTiITy','find','2151tuzjcn','stderr','修改后的请求参数','\x22.\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','question','/ENDPOINT/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','/data/dataset/','utf8','length','.js\x0a\x20*\x20[触发节点]\x20','validation','string','\x20api\x20pull`\x20to\x20refresh.','alias','File\x20already\x20exists:\x20','map','name','before','Available:\x20',']\x20(','Invalid\x20function\x20name\x20\x22','apiDir','5636596xBYvvJ','HOOK\x20requires\x20alias/operation/node\x20options.','create','keys','datasetCode','56464RcEqjA','Alias\x20\x22','nonInteractive','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK','Script\x20description','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','scriptsRootDir','str','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','parseInt','functionNode','source','903djXTgt','appCode','datasetcode','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x20function:\x20','/**\x0a\x20*\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','.js\x0a','entries','No\x20datasets\x20found\x20for\x20this\x20app.','Select\x20trigger\x20node:','Trigger\x20node\x20(HOOK\x20only)','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','close','code','description','.js','includes','\x0a\x20*\x20[平台配置]\x20','Select\x20operation\x20type:','function-node','2Uctgva','bff','2862236KwWMAO','\x22\x20not\x20found.\x20','Operation\x20type\x20(HOOK\x20only)','\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20dataset:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','isInteger','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','trim','Invalid\x20dataset\x20selection.','UNKNOWN','/HOOK/','当前请求参数','operationType','修改后的响应结果','datasetId','Operation\x20type\x20\x22','tableName','operation-type','1220094bELndk','No\x20api.ts\x20found.\x20Run\x20`','143091DhBWWt','Function\x20name\x20(valid\x20JS\x20identifier)'];a30_0xf3f5=function(){return _0x32b876;};return a30_0xf3f5();}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x29cc49(0x1b4),'command':a30_0x29cc49(0x1f2),'description':a30_0x29cc49(0x1d3),'risk':'read','flags':[{'name':'type','type':'string','required':!![],'enum':['COMMON','ENDPOINT',a30_0x29cc49(0x1f9)],'description':a30_0x29cc49(0x18f)},{'name':'name','type':a30_0x29cc49(0x1e5),'required':!![],'description':a30_0x29cc49(0x1cf)},{'name':'description','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1fa)},{'name':'alias','type':'string','description':a30_0x29cc49(0x1f8)},{'name':a30_0x29cc49(0x198),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x19e)},{'name':a30_0x29cc49(0x1cb),'type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1b7)},{'name':'function-node','type':a30_0x29cc49(0x1e5),'description':a30_0x29cc49(0x1a4),'enum':['before','after']}],async 'validate'(_0x10a083){const _0x299cdc=a30_0x29cc49,_0x23415b=_0x10a083[_0x299cdc(0x191)](_0x299cdc(0x1ea));if(!isValidBffFunctionName(_0x23415b))throw CliErrors['validation'](_0x299cdc(0x1ee)+_0x23415b+_0x299cdc(0x1a5));},async 'execute'(_0x4a2d4c){const _0x57c74b=a30_0x29cc49,_0x4f14d4=loadBffProjectConfig(_0x4a2d4c[_0x57c74b(0x197)]),_0x52025c=_0x4a2d4c[_0x57c74b(0x191)]('type'),_0x127f1d=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ea)),_0x1d1bed=_0x4a2d4c[_0x57c74b(0x191)](_0x57c74b(0x1ad))||undefined,_0x18ffe8=_0x52025c===_0x57c74b(0x1f9)?await resolveHookOptions(_0x4f14d4,_0x4a2d4c):undefined,_0x4cceed=buildFilePath(_0x4f14d4,_0x52025c,_0x127f1d,_0x18ffe8);if(await fileExists(_0x4cceed))throw CliErrors['validation'](_0x57c74b(0x1e8)+_0x4cceed);await mkdir(dirname(_0x4cceed),{'recursive':!![]});const _0x139b19=generateTemplate(_0x52025c,_0x127f1d,_0x4a2d4c['appCode'],_0x1d1bed,_0x18ffe8);await writeFile(_0x4cceed,_0x139b19,_0x57c74b(0x1e1));const _0x2bbe78={'type':_0x52025c,'name':_0x127f1d,'path':_0x4cceed};if(_0x1d1bed)_0x2bbe78[_0x57c74b(0x1ad)]=_0x1d1bed;if(_0x18ffe8){if(_0x18ffe8[_0x57c74b(0x1e7)])_0x2bbe78[_0x57c74b(0x1e7)]=_0x18ffe8['alias'];_0x2bbe78['datasetCode']=_0x18ffe8[_0x57c74b(0x1f4)],_0x2bbe78[_0x57c74b(0x1c6)]=_0x18ffe8[_0x57c74b(0x1c6)],_0x2bbe78[_0x57c74b(0x194)]=_0x18ffe8['functionNode'];}return{'ok':!![],'data':_0x2bbe78,'message':'Created\x20'+_0x52025c+_0x57c74b(0x19a)+_0x127f1d};}};async function resolveHookOptions(_0xf68755,_0x2f8f68){const _0x465c04=a30_0x29cc49,_0x225aa4=loadAliasMap(_0x2f8f68['apiDir'],undefined,resolveApiFilePath(_0x2f8f68[_0x465c04(0x1ef)],_0x2f8f68['appCode'])),_0x357c2b=_0x225aa4[_0x465c04(0x1e2)]>0x0;let _0x1d7ce9,_0x32dae7,_0x3a5311;const _0x127261=_0x2f8f68[_0x465c04(0x191)]('alias'),_0x2e588c=_0x2f8f68[_0x465c04(0x191)]('datasetcode');if(_0x127261){const _0x2b1115=resolveAlias(_0x2f8f68[_0x465c04(0x1ef)],_0x127261,undefined,resolveApiFilePath(_0x2f8f68['apiDir'],_0x2f8f68[_0x465c04(0x197)]));if(!_0x2b1115){const _0x1bbfb8=_0x357c2b?'Available\x20aliases:\x20'+_0x225aa4[_0x465c04(0x1e9)](_0x1e801f=>_0x1e801f[_0x465c04(0x1e7)])[_0x465c04(0x1d4)](',\x20'):_0x465c04(0x1cd)+CLI_BIN_NAME+_0x465c04(0x1bd);throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1f6)+_0x127261+_0x465c04(0x1b6)+_0x1bbfb8);}_0x1d7ce9=_0x127261,_0x32dae7=_0x2b1115;}else{if(_0x2e588c){_0x32dae7=_0x2e588c;const _0x5266e5=_0x225aa4[_0x465c04(0x1d7)](_0x3acdbe=>_0x3acdbe[_0x465c04(0x1f4)]===_0x2e588c);_0x1d7ce9=_0x5266e5?.[_0x465c04(0x1e7)];}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x18e));else{if(_0x357c2b){const _0x241b17=_0x225aa4['map'](_0x20d90b=>_0x20d90b[_0x465c04(0x1e7)]+'\x20('+_0x20d90b[_0x465c04(0x1ca)]+')'),_0x548451=await promptSelect(_0x465c04(0x1ba),_0x241b17),_0x33faf7=_0x225aa4[_0x548451];if(!_0x33faf7)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c2));_0x1d7ce9=_0x33faf7[_0x465c04(0x1e7)],_0x32dae7=_0x33faf7[_0x465c04(0x1f4)];}else{const _0x4b5d59=await listDatasets(_0x2f8f68[_0x465c04(0x197)]);if(_0x4b5d59['length']===0x0)throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1a2));const _0x17ea7d=_0x4b5d59[_0x465c04(0x1e9)](_0x5a9a67=>_0x5a9a67[_0x465c04(0x1ea)]+'\x20['+(_0x5a9a67[_0x465c04(0x195)]??_0x465c04(0x1c3))+_0x465c04(0x1ed)+_0x5a9a67[_0x465c04(0x1ac)]+')'),_0xfcc698=await promptSelect(_0x465c04(0x1ba),_0x17ea7d),_0x2ddc28=_0x4b5d59[_0xfcc698];if(!_0x2ddc28)throw CliErrors[_0x465c04(0x1e4)]('Invalid\x20dataset\x20selection.');_0x32dae7=_0x2ddc28[_0x465c04(0x1ac)],_0x1d7ce9=undefined;}}}}const _0x5b6aa4=await listDatasets(_0x2f8f68['appCode']),_0x270fd6=_0x5b6aa4[_0x465c04(0x1d7)](_0x3a3c41=>_0x3a3c41[_0x465c04(0x1ac)]===_0x32dae7);if(!_0x270fd6)throw CliErrors['validation'](_0x465c04(0x19c)+_0x32dae7+_0x465c04(0x1db)+(_0x1d7ce9?_0x465c04(0x1dc)+CLI_BIN_NAME+_0x465c04(0x1e6):''));_0x3a5311=_0x270fd6['id'];const _0x422ff2=_0x1d7ce9??_0x32dae7,_0xd12c0c=await listBffDatasetOperations(_0x2f8f68[_0x465c04(0x197)],_0x3a5311),_0x348916=_0xd12c0c?Object[_0x465c04(0x1f3)](_0xd12c0c):[];if(_0x348916[_0x465c04(0x1e2)]===0x0)throw CliErrors[_0x465c04(0x1e4)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x422ff2+'.');let _0xa11f2e;const _0x81134f=_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1cb));if(_0x81134f){if(!_0x348916[_0x465c04(0x1af)](_0x81134f))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1c9)+_0x81134f+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x422ff2+'.\x20'+(_0x465c04(0x1ec)+_0x348916[_0x465c04(0x1d4)](',\x20')));_0xa11f2e=_0x81134f;}else{if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x1bb));const _0xf47528=await promptSelect(_0x465c04(0x1b1),_0x348916);_0xa11f2e=_0x348916[_0xf47528]??_0x348916[0x0];}let _0x16edc4=normalizeHookFunctionNode(_0x2f8f68['str'](_0x465c04(0x1b2)));if(!_0x16edc4){if(_0x2f8f68[_0x465c04(0x191)](_0x465c04(0x1b2)))throw CliErrors[_0x465c04(0x1e4)](_0x465c04(0x192));if(_0x2f8f68[_0x465c04(0x1f7)])throw CliErrors['validation'](_0x465c04(0x1a9));const _0x5d504c=await promptSelect(_0x465c04(0x1a3),[_0x465c04(0x1eb),_0x465c04(0x1d0)]);_0x16edc4=[_0x465c04(0x1eb),_0x465c04(0x1d0)][_0x5d504c]??'before';}return{'alias':_0x1d7ce9,'datasetCode':_0x32dae7,'datasetId':_0x3a5311,'operationType':_0xa11f2e,'functionNode':_0x16edc4};}async function promptSelect(_0x518eb8,_0x23009c){const _0x1424ae=a30_0x29cc49;if(_0x23009c[_0x1424ae(0x1e2)]===0x1)return 0x0;for(const [_0x4c67ea,_0x496fe9]of _0x23009c[_0x1424ae(0x1a1)]()){process['stderr'][_0x1424ae(0x1a8)]('\x20\x20'+(_0x4c67ea+0x1)+'.\x20'+_0x496fe9+'\x0a');}const _0x44a8ae=createInterface({'input':process[_0x1424ae(0x1d2)],'output':process[_0x1424ae(0x1d9)]});while(!![]){const _0x23d86c=await new Promise(_0x3e0920=>{const _0x42ea65=_0x1424ae;_0x44a8ae[_0x42ea65(0x1dd)](_0x518eb8+'\x20',_0x3e0920);}),_0x55d800=Number[_0x1424ae(0x193)](_0x23d86c[_0x1424ae(0x1c1)](),0xa);if(Number[_0x1424ae(0x1be)](_0x55d800)&&_0x55d800>=0x1&&_0x55d800<=_0x23009c['length'])return _0x44a8ae[_0x1424ae(0x1ab)](),_0x55d800-0x1;process[_0x1424ae(0x1d9)][_0x1424ae(0x1a8)](_0x1424ae(0x19f)+_0x23009c[_0x1424ae(0x1e2)]+'.\x0a');}}function buildFilePath(_0x20b569,_0x35f8ac,_0x7443f0,_0x5d6708){const _0x43e89e=a30_0x29cc49;if(_0x35f8ac===_0x43e89e(0x1f9)){if(!_0x5d6708)throw CliErrors[_0x43e89e(0x1e4)](_0x43e89e(0x1f1));const _0x54effd=_0x5d6708[_0x43e89e(0x1e7)]??_0x5d6708[_0x43e89e(0x1f4)];return join(_0x20b569[_0x43e89e(0x190)],_0x43e89e(0x1f9),_0x54effd,_0x5d6708['operationType'],_0x5d6708[_0x43e89e(0x194)],_0x7443f0+_0x43e89e(0x1ae));}return join(_0x20b569['scriptsRootDir'],_0x35f8ac,_0x7443f0+_0x43e89e(0x1ae));}function a30_0x18f4(_0x5394f2,_0x1c05ee){_0x5394f2=_0x5394f2-0x18e;const _0xf3f54b=a30_0xf3f5();let _0x18f4a0=_0xf3f54b[_0x5394f2];return _0x18f4a0;}export function generateTemplate(_0x469973,_0x558e99,_0x133c9c,_0x3ed77e,_0x533cfe){const _0x336ad2=a30_0x29cc49,_0x26ed86=_0x3ed77e?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x168f22=getAppBaseUrl(_0x133c9c),_0xdbe475=_0x336ad2(0x1b8);if(_0x469973===_0x336ad2(0x1bf))return _0x336ad2(0x19b)+_0x26ed86+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1d5)+_0x133c9c+_0x336ad2(0x1d1)+_0x558e99+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x558e99+'\x22,\x20params\x20})\x0a'+_0xdbe475+_0x336ad2(0x199)+_0x558e99+_0x336ad2(0x1aa);if(_0x469973===_0x336ad2(0x1bc))return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x1df)+_0x558e99+_0x336ad2(0x1c0)+_0x133c9c+'/'+_0x558e99+_0x336ad2(0x1b0)+_0x168f22+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1de)+_0x558e99+_0x336ad2(0x1a0)+_0xdbe475+_0x336ad2(0x1b9)+_0x558e99+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x533cfe)throw CliErrors[_0x336ad2(0x1e4)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x4628de=_0x533cfe['alias']??_0x533cfe['datasetCode'],_0x8fb47b=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1c5):'当前响应结果',_0x559f05=_0x533cfe[_0x336ad2(0x194)]===_0x336ad2(0x1eb)?_0x336ad2(0x1da):_0x336ad2(0x1c7);return _0x336ad2(0x19b)+_0x26ed86+_0x336ad2(0x19d)+_0x558e99+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x133c9c+'/'+_0x533cfe[_0x336ad2(0x1f4)]+'/'+_0x533cfe[_0x336ad2(0x1c6)]+_0x336ad2(0x1b0)+_0x168f22+_0x336ad2(0x1e0)+_0x533cfe[_0x336ad2(0x1c8)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x133c9c+_0x336ad2(0x1c4)+_0x4628de+'/'+_0x533cfe['operationType']+'/'+_0x533cfe['functionNode']+'/'+_0x558e99+_0x336ad2(0x1e3)+_0x533cfe[_0x336ad2(0x194)]+'\x0a'+_0xdbe475+_0x336ad2(0x1a7)+_0x8fb47b+_0x336ad2(0x1a6)+_0x559f05+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x558e99+_0x336ad2(0x1aa);}
|
|
1
|
+
const a30_0x5308de=a30_0x58c3;(function(_0x5eaa3f,_0x2a6251){const _0x1103eb=a30_0x58c3,_0x3bc0f1=_0x5eaa3f();while(!![]){try{const _0xa937a=parseInt(_0x1103eb(0xfd))/0x1+parseInt(_0x1103eb(0xb0))/0x2*(-parseInt(_0x1103eb(0xbc))/0x3)+parseInt(_0x1103eb(0xdb))/0x4+-parseInt(_0x1103eb(0xc4))/0x5+parseInt(_0x1103eb(0xe2))/0x6*(-parseInt(_0x1103eb(0xcc))/0x7)+parseInt(_0x1103eb(0xbe))/0x8*(-parseInt(_0x1103eb(0xd1))/0x9)+parseInt(_0x1103eb(0xa8))/0xa;if(_0xa937a===_0x2a6251)break;else _0x3bc0f1['push'](_0x3bc0f1['shift']());}catch(_0x170d28){_0x3bc0f1['push'](_0x3bc0f1['shift']());}}}(a30_0xa4ab,0x468ae));function a30_0x58c3(_0x14c888,_0x4aa9cb){_0x14c888=_0x14c888-0xa8;const _0xa4abde=a30_0xa4ab();let _0x58c391=_0xa4abde[_0x14c888];return _0x58c391;}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a30_0xa4ab(){const _0x52b9d5=['length','\x20api\x20pull`\x20to\x20refresh.','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','1969170Qqunqi','\x0a\x20*\x20[平台配置]\x20','functionNode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','/data/dataset/','map','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','7kxjPPF','apiDir','stderr','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','\x22.\x20','3951FEgphd','join','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)',']\x20(','alias','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','validation','datasetId','trim','Select\x20dataset:','869392jdRwds','find','当前请求参数','scriptsRootDir','nonInteractive','No\x20datasets\x20found\x20for\x20this\x20app.','ENDPOINT','2324406nzogis','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','source','Select\x20trigger\x20node:','keys','str','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','修改后的响应结果','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','operation-type','Invalid\x20function\x20name\x20\x22','datasetcode','HOOK','/**\x0a\x20*\x20','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','.js','Alias\x20\x22','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','parseInt','appCode','entries','description','/COMMON/','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Trigger\x20node\x20(HOOK\x20only)','161097vjLPmG','Available\x20aliases:\x20','code','datasetCode','type','Invalid\x20dataset\x20selection.','close','after','\x22\x20not\x20found\x20for\x20dataset\x20','Script\x20description','operationType','No\x20api.ts\x20found.\x20Run\x20`','write','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Created\x20','utf8','COMMON','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','12399850NrSMXU','Function\x20name\x20(valid\x20JS\x20identifier)','string','bff','Operation\x20type\x20(HOOK\x20only)','stdin','isInteger','/ENDPOINT/','13466cfXPxo','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','HOOK\x20requires\x20alias/operation/node\x20options.','Operation\x20type\x20\x22','\x22,\x20params\x20})\x0a','当前响应结果','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Dataset\x20not\x20found\x20for\x20code\x20\x22','before','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','UNKNOWN','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','159MmqIxj','name','3488wyGLWb','\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','.js\x0a\x20*\x20[触发节点]\x20'];a30_0xa4ab=function(){return _0x52b9d5;};return a30_0xa4ab();}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_0x5308de(0xab),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':'read','flags':[{'name':a30_0x5308de(0x101),'type':a30_0x5308de(0xaa),'required':!![],'enum':[a30_0x5308de(0x10d),'ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a30_0x5308de(0xbd),'type':a30_0x5308de(0xaa),'required':!![],'description':a30_0x5308de(0xa9)},{'name':a30_0x5308de(0xf9),'type':a30_0x5308de(0xaa),'description':a30_0x5308de(0x106)},{'name':a30_0x5308de(0xd5),'type':a30_0x5308de(0xaa),'description':a30_0x5308de(0xd3)},{'name':a30_0x5308de(0xee),'type':'string','description':a30_0x5308de(0xe8)},{'name':a30_0x5308de(0xec),'type':a30_0x5308de(0xaa),'description':a30_0x5308de(0xac)},{'name':'function-node','type':a30_0x5308de(0xaa),'description':a30_0x5308de(0xfc),'enum':[a30_0x5308de(0xb8),a30_0x5308de(0x104)]}],async 'validate'(_0xd6abab){const _0x2cf079=a30_0x5308de,_0xf075d8=_0xd6abab[_0x2cf079(0xe7)](_0x2cf079(0xbd));if(!isValidBffFunctionName(_0xf075d8))throw CliErrors[_0x2cf079(0xd7)](_0x2cf079(0xed)+_0xf075d8+_0x2cf079(0xcb));},async 'execute'(_0xf7363c){const _0x2f9430=a30_0x5308de,_0x92cff4=loadBffProjectConfig(_0xf7363c[_0x2f9430(0xf7)]),_0x5d0641=_0xf7363c['str'](_0x2f9430(0x101)),_0x3039ea=_0xf7363c[_0x2f9430(0xe7)](_0x2f9430(0xbd)),_0x1b3587=_0xf7363c[_0x2f9430(0xe7)](_0x2f9430(0xf9))||undefined,_0x1d2c9a=_0x5d0641===_0x2f9430(0xef)?await resolveHookOptions(_0x92cff4,_0xf7363c):undefined,_0x12e31d=buildFilePath(_0x92cff4,_0x5d0641,_0x3039ea,_0x1d2c9a);if(await fileExists(_0x12e31d))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x12e31d);await mkdir(dirname(_0x12e31d),{'recursive':!![]});const _0x2b1aa0=generateTemplate(_0x5d0641,_0x3039ea,_0xf7363c[_0x2f9430(0xf7)],_0x1b3587,_0x1d2c9a);await writeFile(_0x12e31d,_0x2b1aa0,_0x2f9430(0x10c));const _0x275b6e={'type':_0x5d0641,'name':_0x3039ea,'path':_0x12e31d};if(_0x1b3587)_0x275b6e[_0x2f9430(0xf9)]=_0x1b3587;if(_0x1d2c9a){if(_0x1d2c9a['alias'])_0x275b6e['alias']=_0x1d2c9a['alias'];_0x275b6e[_0x2f9430(0x100)]=_0x1d2c9a[_0x2f9430(0x100)],_0x275b6e[_0x2f9430(0x107)]=_0x1d2c9a['operationType'],_0x275b6e[_0x2f9430(0xc6)]=_0x1d2c9a[_0x2f9430(0xc6)];}return{'ok':!![],'data':_0x275b6e,'message':_0x2f9430(0x10b)+_0x5d0641+'\x20function:\x20'+_0x3039ea};}};async function resolveHookOptions(_0x2da768,_0x6fb653){const _0x52c5de=a30_0x5308de,_0x643331=loadAliasMap(_0x6fb653[_0x52c5de(0xcd)],undefined,resolveApiFilePath(_0x6fb653[_0x52c5de(0xcd)],_0x6fb653[_0x52c5de(0xf7)])),_0x4d6479=_0x643331['length']>0x0;let _0x585b38,_0x297f12,_0x49c109;const _0x13cb46=_0x6fb653[_0x52c5de(0xe7)](_0x52c5de(0xd5)),_0x1acc3c=_0x6fb653[_0x52c5de(0xe7)](_0x52c5de(0xee));if(_0x13cb46){const _0x10c5b9=resolveAlias(_0x6fb653[_0x52c5de(0xcd)],_0x13cb46,undefined,resolveApiFilePath(_0x6fb653['apiDir'],_0x6fb653[_0x52c5de(0xf7)]));if(!_0x10c5b9){const _0x23100e=_0x4d6479?_0x52c5de(0xfe)+_0x643331[_0x52c5de(0xca)](_0x19767e=>_0x19767e[_0x52c5de(0xd5)])[_0x52c5de(0xd2)](',\x20'):_0x52c5de(0x108)+CLI_BIN_NAME+_0x52c5de(0xc8);throw CliErrors['validation'](_0x52c5de(0xf4)+_0x13cb46+'\x22\x20not\x20found.\x20'+_0x23100e);}_0x585b38=_0x13cb46,_0x297f12=_0x10c5b9;}else{if(_0x1acc3c){_0x297f12=_0x1acc3c;const _0x5c150e=_0x643331[_0x52c5de(0xdc)](_0x40310d=>_0x40310d[_0x52c5de(0x100)]===_0x1acc3c);_0x585b38=_0x5c150e?.['alias'];}else{if(_0x6fb653[_0x52c5de(0xdf)])throw CliErrors[_0x52c5de(0xd7)](_0x52c5de(0xe9));else{if(_0x4d6479){const _0x5c6df1=_0x643331[_0x52c5de(0xca)](_0x392b23=>_0x392b23['alias']+'\x20('+_0x392b23['tableName']+')'),_0x5178d5=await promptSelect(_0x52c5de(0xda),_0x5c6df1),_0x2684be=_0x643331[_0x5178d5];if(!_0x2684be)throw CliErrors['validation'](_0x52c5de(0x102));_0x585b38=_0x2684be[_0x52c5de(0xd5)],_0x297f12=_0x2684be[_0x52c5de(0x100)];}else{const _0x48f0a2=await listDatasets(_0x6fb653[_0x52c5de(0xf7)]);if(_0x48f0a2[_0x52c5de(0xc1)]===0x0)throw CliErrors['validation'](_0x52c5de(0xe0));const _0x4c9e1d=_0x48f0a2[_0x52c5de(0xca)](_0x27b0e1=>_0x27b0e1[_0x52c5de(0xbd)]+'\x20['+(_0x27b0e1[_0x52c5de(0xe4)]??_0x52c5de(0xba))+_0x52c5de(0xd4)+_0x27b0e1[_0x52c5de(0xff)]+')'),_0x491c57=await promptSelect(_0x52c5de(0xda),_0x4c9e1d),_0x14563e=_0x48f0a2[_0x491c57];if(!_0x14563e)throw CliErrors[_0x52c5de(0xd7)](_0x52c5de(0x102));_0x297f12=_0x14563e[_0x52c5de(0xff)],_0x585b38=undefined;}}}}const _0x5cf3ec=await listDatasets(_0x6fb653[_0x52c5de(0xf7)]),_0x21ce78=_0x5cf3ec['find'](_0x9a1907=>_0x9a1907[_0x52c5de(0xff)]===_0x297f12);if(!_0x21ce78)throw CliErrors[_0x52c5de(0xd7)](_0x52c5de(0xb7)+_0x297f12+_0x52c5de(0xd0)+(_0x585b38?_0x52c5de(0xcf)+CLI_BIN_NAME+_0x52c5de(0xc2):''));_0x49c109=_0x21ce78['id'];const _0x53d687=_0x585b38??_0x297f12,_0xfb0bb7=await listBffDatasetOperations(_0x6fb653[_0x52c5de(0xf7)],_0x49c109),_0x1c9224=_0xfb0bb7?Object[_0x52c5de(0xe6)](_0xfb0bb7):[];if(_0x1c9224[_0x52c5de(0xc1)]===0x0)throw CliErrors['validation']('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x53d687+'.');let _0x5da2be;const _0x36168e=_0x6fb653['str'](_0x52c5de(0xec));if(_0x36168e){if(!_0x1c9224['includes'](_0x36168e))throw CliErrors[_0x52c5de(0xd7)](_0x52c5de(0xb3)+_0x36168e+_0x52c5de(0x105)+_0x53d687+'.\x20'+('Available:\x20'+_0x1c9224['join'](',\x20')));_0x5da2be=_0x36168e;}else{if(_0x6fb653[_0x52c5de(0xdf)])throw CliErrors['validation'](_0x52c5de(0xfb));const _0x52351e=await promptSelect('Select\x20operation\x20type:',_0x1c9224);_0x5da2be=_0x1c9224[_0x52351e]??_0x1c9224[0x0];}let _0x329764=normalizeHookFunctionNode(_0x6fb653[_0x52c5de(0xe7)]('function-node'));if(!_0x329764){if(_0x6fb653[_0x52c5de(0xe7)]('function-node'))throw CliErrors[_0x52c5de(0xd7)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x6fb653[_0x52c5de(0xdf)])throw CliErrors[_0x52c5de(0xd7)](_0x52c5de(0xb9));const _0x176812=await promptSelect(_0x52c5de(0xe5),['before',_0x52c5de(0x104)]);_0x329764=[_0x52c5de(0xb8),'after'][_0x176812]??_0x52c5de(0xb8);}return{'alias':_0x585b38,'datasetCode':_0x297f12,'datasetId':_0x49c109,'operationType':_0x5da2be,'functionNode':_0x329764};}async function promptSelect(_0x3e66da,_0x45c1eb){const _0x22cdc4=a30_0x5308de;if(_0x45c1eb['length']===0x1)return 0x0;for(const [_0x3d4799,_0x38cb26]of _0x45c1eb[_0x22cdc4(0xf8)]()){process[_0x22cdc4(0xce)][_0x22cdc4(0x109)]('\x20\x20'+(_0x3d4799+0x1)+'.\x20'+_0x38cb26+'\x0a');}const _0x4f1bc7=createInterface({'input':process[_0x22cdc4(0xad)],'output':process[_0x22cdc4(0xce)]});while(!![]){const _0x370fc8=await new Promise(_0x2bfaac=>{_0x4f1bc7['question'](_0x3e66da+'\x20',_0x2bfaac);}),_0x152a01=Number[_0x22cdc4(0xf6)](_0x370fc8['trim'](),0xa);if(Number[_0x22cdc4(0xae)](_0x152a01)&&_0x152a01>=0x1&&_0x152a01<=_0x45c1eb[_0x22cdc4(0xc1)])return _0x4f1bc7[_0x22cdc4(0x103)](),_0x152a01-0x1;process[_0x22cdc4(0xce)][_0x22cdc4(0x109)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x45c1eb[_0x22cdc4(0xc1)]+'.\x0a');}}function buildFilePath(_0x21e9f4,_0x584f4d,_0x421ade,_0x4e0105){const _0x1d15cf=a30_0x5308de;if(_0x584f4d===_0x1d15cf(0xef)){if(!_0x4e0105)throw CliErrors[_0x1d15cf(0xd7)](_0x1d15cf(0xb2));const _0x36d9b0=_0x4e0105['alias']??_0x4e0105[_0x1d15cf(0x100)];return join(_0x21e9f4[_0x1d15cf(0xde)],_0x1d15cf(0xef),_0x36d9b0,_0x4e0105['operationType'],_0x4e0105['functionNode'],_0x421ade+_0x1d15cf(0xf3));}return join(_0x21e9f4[_0x1d15cf(0xde)],_0x584f4d,_0x421ade+'.js');}export function generateTemplate(_0x3b6c73,_0x155276,_0x147189,_0x3e6bf2,_0x2f00fa){const _0x576642=a30_0x5308de,_0x391dad=_0x3e6bf2?.[_0x576642(0xd9)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x410588=getAppBaseUrl(_0x147189),_0x5b7849='\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x3b6c73==='COMMON')return'/**\x0a\x20*\x20'+_0x391dad+_0x576642(0x10e)+_0x155276+_0x576642(0xc5)+_0x410588+_0x576642(0xb6)+_0x147189+_0x576642(0xfa)+_0x155276+_0x576642(0xc3)+_0x155276+_0x576642(0xb4)+_0x5b7849+_0x576642(0xbf)+_0x155276+_0x576642(0xd6);if(_0x3b6c73===_0x576642(0xe1))return'/**\x0a\x20*\x20'+_0x391dad+_0x576642(0xe3)+_0x155276+_0x576642(0xf2)+_0x147189+'/'+_0x155276+_0x576642(0xc5)+_0x410588+_0x576642(0xb6)+_0x147189+_0x576642(0xaf)+_0x155276+'.js\x0a'+_0x5b7849+'\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'+_0x155276+_0x576642(0xd6);if(!_0x2f00fa)throw CliErrors['validation'](_0x576642(0x10a));const _0x5cf7d3=_0x2f00fa['alias']??_0x2f00fa['datasetCode'],_0x2143a7=_0x2f00fa[_0x576642(0xc6)]===_0x576642(0xb8)?_0x576642(0xdd):_0x576642(0xb5),_0x59b1fe=_0x2f00fa[_0x576642(0xc6)]===_0x576642(0xb8)?'修改后的请求参数':_0x576642(0xea);return _0x576642(0xf0)+_0x391dad+_0x576642(0xbb)+_0x155276+_0x576642(0xc7)+_0x147189+'/'+_0x2f00fa['datasetCode']+'/'+_0x2f00fa[_0x576642(0x107)]+_0x576642(0xc5)+_0x410588+_0x576642(0xc9)+_0x2f00fa[_0x576642(0xd8)]+_0x576642(0xf1)+_0x147189+'/HOOK/'+_0x5cf7d3+'/'+_0x2f00fa['operationType']+'/'+_0x2f00fa[_0x576642(0xc6)]+'/'+_0x155276+_0x576642(0xc0)+_0x2f00fa[_0x576642(0xc6)]+'\x0a'+_0x5b7849+_0x576642(0xeb)+_0x2143a7+_0x576642(0xf5)+_0x59b1fe+_0x576642(0xb1)+_0x155276+_0x576642(0xd6);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x4f8e(){const _0x342192=['4867593ckDlMi','503306BQWBeB','target','1240fIkBBR','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','replace','keys','Deleted\x20','BFF\x20lock\x20file\x20not\x20found.','scriptsRootDir','length','<timestamp>','delete','bff','Multiple\x20functions\x20match\x20\x22','136675xxrQdK','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Would\x20delete\x20','lockFilePath','validation','\x22\x20not\x20found\x20after\x20ensureLockScope.','trashedTo','Lock\x20scope\x20for\x20app\x20\x22','lastSync','str','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','functions','POST','map','5912501bBldeX','2SIZMQx','468uIQZZn','4645560nWdraf','scriptsRoot','string','trashDir','high-risk-write','remoteId','57928vJwtRa','join','4gRaJmN','No\x20lock\x20entry\x20found\x20for\x20\x22','apps','/api/management/library/scripts/delete','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','split','filter','includes','Local\x20delete\x20not\x20settled\x20for\x20','Function\x20not\x20found:\x20','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','6917635LvLgmV','projectRoot','\x20\x20-\x20','appCode','stringify'];a31_0x4f8e=function(){return _0x342192;};return a31_0x4f8e();}const a31_0xa9305a=a31_0x20a2;(function(_0x189d2e,_0xb91b5e){const _0x38bf07=a31_0x20a2,_0x49ea59=_0x189d2e();while(!![]){try{const _0x1ba5d0=-parseInt(_0x38bf07(0x177))/0x1*(parseInt(_0x38bf07(0x15a))/0x2)+parseInt(_0x38bf07(0x159))/0x3*(parseInt(_0x38bf07(0x181))/0x4)+-parseInt(_0x38bf07(0x154))/0x5+-parseInt(_0x38bf07(0x179))/0x6+parseInt(_0x38bf07(0x176))/0x7+parseInt(_0x38bf07(0x17f))/0x8*(-parseInt(_0x38bf07(0x178))/0x9)+-parseInt(_0x38bf07(0x15c))/0xa*(-parseInt(_0x38bf07(0x168))/0xb);if(_0x1ba5d0===_0xb91b5e)break;else _0x49ea59['push'](_0x49ea59['shift']());}catch(_0x22e3d3){_0x49ea59['push'](_0x49ea59['shift']());}}}(a31_0x4f8e,0xece09));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0xa9305a(0x166),'command':a31_0xa9305a(0x165),'description':a31_0xa9305a(0x153),'risk':a31_0xa9305a(0x17d),'flags':[{'name':a31_0xa9305a(0x15b),'type':a31_0xa9305a(0x17b),'required':!![],'description':a31_0xa9305a(0x172)}],async 'validate'(_0x1973a9){const _0x3e1eb7=a31_0xa9305a,_0xdfa15a=loadBffProjectConfig(_0x1973a9[_0x3e1eb7(0x157)]),_0x4da39c=await readBffLockFile(_0xdfa15a[_0x3e1eb7(0x16b)]);if(!_0x4da39c)throw CliErrors[_0x3e1eb7(0x16c)](_0x3e1eb7(0x15d));},async 'dryRun'(_0xa4d3e6){const _0x5753ba=a31_0xa9305a,_0x1bfdf4=loadBffProjectConfig(_0xa4d3e6['appCode']),_0x4af6b7=await readBffLockFile(_0x1bfdf4['lockFilePath']);if(!_0x4af6b7)throw CliErrors['validation'](_0x5753ba(0x161));const {appLock:_0x1b731c}=ensureLockScope(_0x4af6b7,_0xa4d3e6[_0x5753ba(0x157)],_0x1bfdf4[_0x5753ba(0x17a)],_0x5753ba(0x165)),_0x160983=_0xa4d3e6[_0x5753ba(0x171)](_0x5753ba(0x15b)),_0x4fd3b7=Object[_0x5753ba(0x15f)](_0x1b731c['functions']),_0x5531d8=resolveDeleteTarget(_0x160983,_0x4fd3b7),_0x27b89f=_0x1b731c[_0x5753ba(0x173)][_0x5531d8];if(!_0x27b89f)throw CliErrors['validation'](_0x5753ba(0x182)+_0x5531d8+'\x22.');const _0x3e1d0c=resolveLocalFilePathFromLockKey(_0x1bfdf4,_0x5531d8),_0x3e1f02=relative(_0x1bfdf4[_0x5753ba(0x155)],_0x3e1d0c),_0x44eb73=join(_0x1bfdf4[_0x5753ba(0x17c)],_0x5753ba(0x164),_0x3e1f02);return{'method':_0x5753ba(0x174),'url':_0x5753ba(0x184),'body':{'appCode':_0xa4d3e6[_0x5753ba(0x157)],'target':_0x5531d8,'remoteId':_0x27b89f[_0x5753ba(0x17e)],'localFilePath':_0x3e1d0c,'trashedPath':_0x44eb73},'description':_0x5753ba(0x16a)+_0x5531d8+_0x5753ba(0x169)};},async 'execute'(_0x12ef15){const _0x361b5f=a31_0xa9305a,_0x2fd58c=loadBffProjectConfig(_0x12ef15['appCode']),_0x1b10ef=await readBffLockFile(_0x2fd58c['lockFilePath']);if(!_0x1b10ef)throw CliErrors['validation'](_0x361b5f(0x161));const {lockData:_0x22afe2,appLock:_0x148771}=ensureLockScope(_0x1b10ef,_0x12ef15[_0x361b5f(0x157)],_0x2fd58c[_0x361b5f(0x17a)],'delete'),_0x1c3539=JSON['parse'](JSON[_0x361b5f(0x158)](_0x22afe2)),_0x5a27e9=_0x1c3539['apps'][_0x12ef15[_0x361b5f(0x157)]];if(!_0x5a27e9)throw new Error(_0x361b5f(0x16f)+_0x12ef15[_0x361b5f(0x157)]+_0x361b5f(0x16d));const _0x2e095e=_0x12ef15[_0x361b5f(0x171)](_0x361b5f(0x15b)),_0x56cbbf=Object[_0x361b5f(0x15f)](_0x5a27e9[_0x361b5f(0x173)]),_0x2ebbbc=resolveDeleteTarget(_0x2e095e,_0x56cbbf),_0xc89e6f=_0x5a27e9[_0x361b5f(0x173)][_0x2ebbbc];if(!_0xc89e6f)throw CliErrors[_0x361b5f(0x16c)](_0x361b5f(0x182)+_0x2ebbbc+'\x22.');await deleteBffScript(_0xc89e6f[_0x361b5f(0x17e)]),delete _0x5a27e9[_0x361b5f(0x173)][_0x2ebbbc],_0x5a27e9[_0x361b5f(0x170)]=new Date()['toISOString'](),await writeBffLockFile(_0x2fd58c[_0x361b5f(0x16b)],_0x1c3539);const _0xc66095=resolveLocalFilePathFromLockKey(_0x2fd58c,_0x2ebbbc);let _0x471e5e;await fileExists(_0xc66095)&&(_0x471e5e=await moveToTrash(_0x2fd58c[_0x361b5f(0x155)],_0x2fd58c[_0x361b5f(0x17c)],_0xc66095),await cleanupEmptyDirectories(dirname(_0xc66095),_0x2fd58c[_0x361b5f(0x162)]));await waitForDeleteSettlement(_0x2fd58c[_0x361b5f(0x16b)],_0x12ef15[_0x361b5f(0x157)],_0x2ebbbc,_0xc66095),await sleep(0x96);const _0xca6bf1={'deleted':_0x2ebbbc,'remoteId':_0xc89e6f['remoteId']};if(_0x471e5e)_0xca6bf1[_0x361b5f(0x16e)]=_0x471e5e;return{'ok':!![],'data':_0xca6bf1,'message':_0x361b5f(0x160)+_0x2ebbbc+(_0x471e5e?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0xb406d2,_0x109ba1){const _0x2aa82f=a31_0xa9305a;if(_0xb406d2[_0x2aa82f(0x188)]('/')){const _0x46a2b7=_0x109ba1['find'](_0x15f962=>_0x15f962===_0xb406d2);if(!_0x46a2b7)throw CliErrors['validation'](_0x2aa82f(0x152)+_0xb406d2);return _0x46a2b7;}const _0x1e182d=_0x109ba1[_0x2aa82f(0x187)](_0x59df7c=>_0x59df7c[_0x2aa82f(0x186)]('/')['at'](-0x1)===_0xb406d2);if(_0x1e182d['length']===0x0)throw CliErrors[_0x2aa82f(0x16c)]('Function\x20not\x20found:\x20'+_0xb406d2);if(_0x1e182d[_0x2aa82f(0x163)]>0x1)throw CliErrors[_0x2aa82f(0x16c)](_0x2aa82f(0x167)+_0xb406d2+_0x2aa82f(0x185)+_0x1e182d[_0x2aa82f(0x175)](_0x2532c4=>_0x2aa82f(0x156)+_0x2532c4)[_0x2aa82f(0x180)]('\x0a'));return _0x1e182d[0x0];}async function moveToTrash(_0x448e95,_0x4490ca,_0x3ecbd2){const _0x19975a=a31_0xa9305a,_0x40bd6f=new Date()['toISOString']()[_0x19975a(0x15e)](/[:.]/g,'-'),_0x201cbf=relative(_0x448e95,_0x3ecbd2),_0x29c13a=join(_0x4490ca,_0x40bd6f,_0x201cbf);return await mkdir(dirname(_0x29c13a),{'recursive':!![]}),await rename(_0x3ecbd2,_0x29c13a),_0x29c13a;}async function cleanupEmptyDirectories(_0x3c2582,_0x4c062e){const _0x84bcd3=a31_0xa9305a;let _0x21b03f=resolve(_0x3c2582);const _0x37e48d=resolve(_0x4c062e);while(_0x21b03f['startsWith'](''+_0x37e48d+sep)||_0x21b03f===_0x37e48d){if(_0x21b03f===_0x37e48d)return;try{const _0x59e41c=await readdir(_0x21b03f);if(_0x59e41c[_0x84bcd3(0x163)]>0x0)return;await rmdir(_0x21b03f);}catch{return;}_0x21b03f=dirname(_0x21b03f);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;function a31_0x20a2(_0x354c45,_0xef7da3){_0x354c45=_0x354c45-0x152;const _0x4f8ecd=a31_0x4f8e();let _0x20a2b2=_0x4f8ecd[_0x354c45];return _0x20a2b2;}async function waitForDeleteSettlement(_0x2a2f47,_0x5ccd9e,_0x5c0a42,_0x8c30d8){const _0x44698c=a31_0xa9305a;for(let _0x49d39c=0x0;_0x49d39c<DELETE_SETTLE_RETRY_COUNT;_0x49d39c+=0x1){const _0x56dd49=await readBffLockFile(_0x2a2f47),_0x29dc88=!!_0x56dd49?.[_0x44698c(0x183)]?.[_0x5ccd9e]?.['functions']?.[_0x5c0a42],_0x1398fe=await fileExists(_0x8c30d8);if(!_0x29dc88&&!_0x1398fe)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x44698c(0x189)+_0x5c0a42+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x2c9f42=a32_0x1fd7;(function(_0x25ee81,_0x55b5d0){const _0x5cf025=a32_0x1fd7,_0x18dc14=_0x25ee81();while(!![]){try{const _0x40b663=parseInt(_0x5cf025(0x132))/0x1+-parseInt(_0x5cf025(0x13c))/0x2+-parseInt(_0x5cf025(0x135))/0x3+parseInt(_0x5cf025(0x13d))/0x4+parseInt(_0x5cf025(0x139))/0x5+parseInt(_0x5cf025(0x131))/0x6+-parseInt(_0x5cf025(0x133))/0x7;if(_0x40b663===_0x55b5d0)break;else _0x18dc14['push'](_0x18dc14['shift']());}catch(_0x14b034){_0x18dc14['push'](_0x18dc14['shift']());}}}(a32_0x1de1,0x648af));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x2c9f42(0x137),'command':a32_0x2c9f42(0x130),'description':a32_0x2c9f42(0x13e),'risk':a32_0x2c9f42(0x13f),'flags':[{'name':'id','type':a32_0x2c9f42(0x13a),'required':!![],'description':a32_0x2c9f42(0x143)},{'name':a32_0x2c9f42(0x142),'type':a32_0x2c9f42(0x12f),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0xe2dd2e){const _0x4a79ec=a32_0x2c9f42,_0x100c9b=await getBffScriptInfo(_0xe2dd2e[_0x4a79ec(0x144)]('id')),_0x3e8d82=_0xe2dd2e[_0x4a79ec(0x140)]('verbose');if(_0x3e8d82)return{'ok':!![],'data':_0x100c9b};return{'ok':!![],'data':{'id':_0x100c9b['id'],'functionName':_0x100c9b['functionName']??'','version':_0x100c9b[_0x4a79ec(0x134)]??'','updateUserName':_0x100c9b['updateUserName']??'','appCode':_0x100c9b['appCode'],'scriptType':_0x100c9b[_0x4a79ec(0x141)],'description':_0x100c9b[_0x4a79ec(0x136)]||_0x4a79ec(0x13b),'createdTime':_0x100c9b['createdTime']??'','updatedTime':_0x100c9b[_0x4a79ec(0x12e)]??'','scriptContent':_0x100c9b[_0x4a79ec(0x138)]??''}};}};function a32_0x1fd7(_0x3f6a0a,_0x3b5d47){_0x3f6a0a=_0x3f6a0a-0x12e;const _0x1de1bf=a32_0x1de1();let _0x1fd701=_0x1de1bf[_0x3f6a0a];return _0x1fd701;}function a32_0x1de1(){const _0x2f0288=['description','bff','scriptContent','1334365DJfjIe','number','(none)','877128wytSFB','2105296sSCDxM','Get\x20BFF\x20script\x20details\x20by\x20ID','read','bool','scriptType','verbose','Script\x20ID','num','updatedTime','boolean','detail','359568onJkQf','773891JsTZTx','4313806fZCHnF','version','481113hKaFig'];a32_0x1de1=function(){return _0x2f0288;};return a32_0x1de1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4ca716,_0x781986){const _0x222fc7=a33_0x3557,_0x234251=_0x4ca716();while(!![]){try{const _0x56c294=-parseInt(_0x222fc7(0xad))/0x1*(-parseInt(_0x222fc7(0xb1))/0x2)+parseInt(_0x222fc7(0xa8))/0x3*(-parseInt(_0x222fc7(0xaf))/0x4)+-parseInt(_0x222fc7(0xb0))/0x5+parseInt(_0x222fc7(0xae))/0x6+parseInt(_0x222fc7(0xaa))/0x7+parseInt(_0x222fc7(0xa9))/0x8*(parseInt(_0x222fc7(0xac))/0x9)+-parseInt(_0x222fc7(0xab))/0xa;if(_0x56c294===_0x781986)break;else _0x234251['push'](_0x234251['shift']());}catch(_0x2ab076){_0x234251['push'](_0x234251['shift']());}}}(a33_0x4cdf,0xc4c3d));function a33_0x4cdf(){const _0x3829c2=['45354SIQbis','145104BfiyZt','494081gAKkMY','2516630WAMUZV','18EQJyER','260887vQQkMz','4638072Pjhbop','4iCIrBq','4253445AybxWB','8PwMrba'];a33_0x4cdf=function(){return _0x3829c2;};return a33_0x4cdf();}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a33_0x3557(_0x2d1b91,_0x29d641){_0x2d1b91=_0x2d1b91-0xa8;const _0x4cdf74=a33_0x4cdf();let _0x355777=_0x4cdf74[_0x2d1b91];return _0x355777;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|