@lovrabet/rabetbase-cli 2.4.5 → 2.4.6-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/README.md +3 -2
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/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/{standard-page-status.d.ts → create.d.ts} +1 -1
- package/lib/commands/page/create.js +1 -0
- package/lib/commands/page/{react → custom}/detail.d.ts +1 -1
- package/lib/commands/page/custom/detail.js +1 -0
- package/lib/commands/page/{react → custom}/list.d.ts +1 -1
- package/lib/commands/page/custom/list.js +1 -0
- package/lib/commands/page/{react → custom}/publish.d.ts +1 -1
- package/lib/commands/page/custom/publish.js +1 -0
- package/lib/commands/page/{react → custom}/shared.d.ts +15 -15
- package/lib/commands/page/custom/shared.js +1 -0
- package/lib/commands/page/{react → custom}/syntax.d.ts +2 -2
- package/lib/commands/page/custom/syntax.js +1 -0
- package/lib/commands/page/custom/template.js +1 -0
- package/lib/commands/page/{react → custom}/update.d.ts +1 -1
- package/lib/commands/page/custom/update.js +1 -0
- package/lib/commands/page/data-list-status.d.ts +2 -0
- package/lib/commands/page/data-list-status.js +1 -0
- 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.d.ts +18 -18
- 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 +43 -43
- 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.d.ts +3 -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 +34 -34
- package/skills/rabetbase/guides/backend-function.md +63 -18
- package/skills/rabetbase/guides/bff-creation-workflow.md +2 -0
- package/skills/rabetbase/guides/{react-custom-page-workflow.md → custom-page-workflow.md} +45 -45
- package/skills/rabetbase/guides/page-development-workflow.md +22 -22
- package/skills/rabetbase/knowledge/{react-page → custom-page}/components.md +2 -2
- package/skills/rabetbase/knowledge/{react-page → custom-page}/generation-standards.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +6 -6
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-create.md +2 -0
- package/skills/rabetbase/references/{rabetbase-standard-page-status.md → rabetbase-data-list-status.md} +6 -6
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +1 -1
- package/skills/rabetbase/references/rabetbase-menu-list.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-create.md +31 -0
- package/skills/rabetbase/references/{rabetbase-page-react-detail.md → rabetbase-page-custom-detail.md} +5 -5
- package/skills/rabetbase/references/{rabetbase-page-react-list.md → rabetbase-page-custom-list.md} +4 -4
- package/skills/rabetbase/references/{rabetbase-page-react-publish.md → rabetbase-page-custom-publish.md} +6 -6
- package/skills/rabetbase/references/{rabetbase-page-react-update.md → rabetbase-page-custom-update.md} +6 -6
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -4
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +4 -4
- package/skills/rabetbase/references/rabetbase-page-pull.md +2 -2
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-restore.md +7 -7
- package/skills/rabetbase/references/rabetbase-page-sync.md +3 -3
- package/skills/rabetbase.manifest.json +12 -12
- package/lib/commands/page/react/create.d.ts +0 -2
- package/lib/commands/page/react/create.js +0 -1
- package/lib/commands/page/react/detail.js +0 -1
- package/lib/commands/page/react/list.js +0 -1
- package/lib/commands/page/react/publish.js +0 -1
- package/lib/commands/page/react/shared.js +0 -1
- package/lib/commands/page/react/syntax.js +0 -1
- package/lib/commands/page/react/template.js +0 -1
- package/lib/commands/page/react/update.js +0 -1
- package/lib/commands/page/standard-page-status.js +0 -1
- package/skills/rabetbase/references/rabetbase-page-react-create.md +0 -29
- /package/lib/commands/page/{react → custom}/template.d.ts +0 -0
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x17d4d6=a19_0x3d0a;function a19_0x9bcd(){const _0xc1191d=['merged','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','No\x20apps\x20configured','length','mergedCli','optional','bool','defaultApp','inherit','find','56080cnMUze','boolean','remote','.\x20Use\x20`','globalConfig','73510wXPJvY','\x20in\x20','12432hgNchS','push','148DMxwaT','858663qfsbAg','entries','list','global','read','object','30CvVOOD','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','app','1847010UVNkkN','validation','75LofKxD','371578AmskEG','globalPath','1424aPjvrp','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','projectConfig','3702660ousIHL','appcode','\x20config','project','apps'];a19_0x9bcd=function(){return _0xc1191d;};return a19_0x9bcd();}(function(_0x6213d0,_0x254ff9){const _0x3977ba=a19_0x3d0a,_0x22aa78=_0x6213d0();while(!![]){try{const _0x184d0c=parseInt(_0x3977ba(0x203))/0x1+parseInt(_0x3977ba(0x1eb))/0x2*(-parseInt(_0x3977ba(0x202))/0x3)+-parseInt(_0x3977ba(0x1f4))/0x4*(-parseInt(_0x3977ba(0x1f0))/0x5)+-parseInt(_0x3977ba(0x208))/0x6+parseInt(_0x3977ba(0x1f2))/0x7*(parseInt(_0x3977ba(0x205))/0x8)+-parseInt(_0x3977ba(0x1f5))/0x9*(-parseInt(_0x3977ba(0x1fb))/0xa)+parseInt(_0x3977ba(0x200))/0xb;if(_0x184d0c===_0x254ff9)break;else _0x22aa78['push'](_0x22aa78['shift']());}catch(_0x21ba51){_0x22aa78['push'](_0x22aa78['shift']());}}}(a19_0x9bcd,0x59c55));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x294051,_0xe09076){const _0x4467de=a19_0x3d0a,_0x5d2e77=[],_0x192fcc=_0x294051[_0x4467de(0x20c)]&&typeof _0x294051['apps']===_0x4467de(0x1fa)?_0x294051['apps']:{},_0x2b066e=_0x294051[_0x4467de(0x1e8)]||undefined;for(const [_0x30eb6d,_0x22cafc]of Object[_0x4467de(0x1f6)](_0x192fcc)){if(!_0x22cafc||typeof _0x22cafc!==_0x4467de(0x1fa)||!_0x22cafc[_0x4467de(0x209)])continue;_0x5d2e77[_0x4467de(0x1f3)]({'name':_0x30eb6d,'appcode':_0x22cafc[_0x4467de(0x209)],'named':!![],'definedIn':_0xe09076,'isDefault':_0x30eb6d===_0x2b066e,...buildAppProfileListFields(_0x22cafc)});}return _0x5d2e77;}function buildMergedItems(_0x1aa4ae,_0x236004){const _0x3dba17=a19_0x3d0a,{apps:apps={},defaultApp:_0x3f0ada}=_0x1aa4ae,_0x3b60e4=_0x236004[_0x3dba17(0x1ef)][_0x3dba17(0x20c)]&&typeof _0x236004[_0x3dba17(0x1ef)]['apps']===_0x3dba17(0x1fa)?_0x236004[_0x3dba17(0x1ef)][_0x3dba17(0x20c)]:{},_0x149760=_0x236004[_0x3dba17(0x207)]['apps']&&typeof _0x236004[_0x3dba17(0x207)][_0x3dba17(0x20c)]===_0x3dba17(0x1fa)?_0x236004[_0x3dba17(0x207)][_0x3dba17(0x20c)]:{},_0x1a5c18=_0x236004['projectConfig'][_0x3dba17(0x1e9)]===![],_0x69e555=Object[_0x3dba17(0x1f6)](apps),_0x3310d5=_0x69e555['map'](([_0x43c91d,_0x41da9a])=>({'name':_0x43c91d,'appcode':_0x41da9a[_0x3dba17(0x209)],'named':!![],'definedIn':appDefinedIn(_0x43c91d,_0x3b60e4,_0x149760,_0x1a5c18),'isDefault':_0x43c91d===_0x3f0ada,...buildAppProfileListFields(_0x41da9a)}));return _0x3310d5;}function a19_0x3d0a(_0xd96a4f,_0x3e57d7){_0xd96a4f=_0xd96a4f-0x1e6;const _0x9bcd4b=a19_0x9bcd();let _0x3d0a18=_0x9bcd4b[_0xd96a4f];return _0x3d0a18;}function validateAppListFlags(_0x26fbb6){const _0x2aa015=a19_0x3d0a;if(!_0x26fbb6['bool'](_0x2aa015(0x1ed)))return;if(!_0x26fbb6[_0x2aa015(0x1e7)]('global')&&!_0x26fbb6[_0x2aa015(0x1e7)]('project'))return;throw CliErrors[_0x2aa015(0x201)](_0x2aa015(0x206),'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(_0x3b6352){const _0x2af4c7=a19_0x3d0a;validateAppListFlags(_0x3b6352);if(_0x3b6352['bool'](_0x2af4c7(0x1ed)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x3b6352)};const _0x2c23d5=_0x3b6352[_0x2af4c7(0x1e7)]('global'),_0x3ef9fb=_0x3b6352['bool']('project'),_0x1d0553=_0x2c23d5?'global':_0x3ef9fb?_0x2af4c7(0x20b):_0x2af4c7(0x20d),{config:_0x17b61b,layers:_0x310843}=readRawConfigWithLayers(),_0x1d75df=resolveDefaultAppSource(_0x310843),{defaultApp:_0x3db5db}=_0x17b61b;let _0x4ad13a,_0xaba244;switch(_0x1d0553){case'global':_0x4ad13a=buildItemsFromLayer(_0x310843[_0x2af4c7(0x1ef)],_0x2af4c7(0x1f8)),_0xaba244=_0x310843[_0x2af4c7(0x204)];break;case _0x2af4c7(0x20b):_0x4ad13a=buildItemsFromLayer(_0x310843['projectConfig'],'project'),_0xaba244=_0x310843['projectPath'];break;default:_0x4ad13a=buildMergedItems(_0x17b61b,_0x310843);break;}enrichAppListItemsWithMergedSelection(_0x4ad13a,_0x3b6352[_0x2af4c7(0x211)]);if(_0x4ad13a[_0x2af4c7(0x210)]===0x0){const _0x51d4e5=_0x1d0553===_0x2af4c7(0x20d)?'':_0x2af4c7(0x1f1)+_0x1d0553+_0x2af4c7(0x20a);return{'ok':!![],'data':[],'message':_0x2af4c7(0x20f)+_0x51d4e5+_0x2af4c7(0x1ee)+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x663694=_0x4ad13a[_0x2af4c7(0x1ea)](_0x1a85eb=>_0x1a85eb['isCurrent']===!![]),_0x38f552=_0x3db5db??_0x663694?.[_0x2af4c7(0x209)]??null,_0x280afa=_0x1d0553===_0x2af4c7(0x20d)?{'globalPath':_0x310843['globalPath']??null,'projectPath':_0x310843['projectPath']??null,'defaultApp':_0x38f552,'defaultAppSource':_0x3db5db!=null?_0x1d75df:null}:{'scope':_0x1d0553,'configPath':_0xaba244??null};return{'ok':!![],'data':{'items':_0x4ad13a,'meta':_0x280afa}};}export const appListDefinition={'service':a19_0x17d4d6(0x1ff),'command':a19_0x17d4d6(0x1f7),'description':a19_0x17d4d6(0x1fc),'risk':a19_0x17d4d6(0x1f9),'auth':a19_0x17d4d6(0x1e6),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x17d4d6(0x1ed),'type':a19_0x17d4d6(0x1ec),'description':a19_0x17d4d6(0x1fe),'default':![]},{'name':a19_0x17d4d6(0x1f8),'type':'boolean','description':a19_0x17d4d6(0x1fd),'default':![]},{'name':a19_0x17d4d6(0x20b),'type':'boolean','description':a19_0x17d4d6(0x20e),'default':![]}],async 'validate'(_0x550945){validateAppListFlags(_0x550945);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a20_0x3242(){const _0x42e96f=['581496woSVfb','22txCFsp','List\x20application\x20members\x20with\x20their\x20role\x20memberships','1428580EJXjwI','\x20application\x20member(s)','17437LoRBvo','appCode','34150SHkAFG','members-list','length','read','45fRmcDi','4CrUiSs','app','762FenhTD','260808SiexTD','884307kTnFVT','288441nhMmem'];a20_0x3242=function(){return _0x42e96f;};return a20_0x3242();}const a20_0x38e798=a20_0x150a;function a20_0x150a(_0x10d5db,_0x5c4e79){_0x10d5db=_0x10d5db-0x86;const _0x3242b7=a20_0x3242();let _0x150aec=_0x3242b7[_0x10d5db];return _0x150aec;}(function(_0x441317,_0x5ed5a5){const _0xe224df=a20_0x150a,_0x45591d=_0x441317();while(!![]){try{const _0x353187=parseInt(_0xe224df(0x87))/0x1+-parseInt(_0xe224df(0x88))/0x2+parseInt(_0xe224df(0x86))/0x3*(parseInt(_0xe224df(0x94))/0x4)+parseInt(_0xe224df(0x8f))/0x5+-parseInt(_0xe224df(0x96))/0x6*(-parseInt(_0xe224df(0x8d))/0x7)+-parseInt(_0xe224df(0x97))/0x8*(parseInt(_0xe224df(0x93))/0x9)+-parseInt(_0xe224df(0x8b))/0xa*(parseInt(_0xe224df(0x89))/0xb);if(_0x353187===_0x5ed5a5)break;else _0x45591d['push'](_0x45591d['shift']());}catch(_0x293771){_0x45591d['push'](_0x45591d['shift']());}}}(a20_0x3242,0x28c10));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x38e798(0x95),'command':a20_0x38e798(0x90),'description':a20_0x38e798(0x8a),'risk':a20_0x38e798(0x92),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x46f0b5){const _0x2f28fe=a20_0x38e798,_0x480a92=projectAppMembers(await listRoleUsers(_0x46f0b5[_0x2f28fe(0x8e)]));return{'ok':!![],'data':{'appCode':_0x46f0b5[_0x2f28fe(0x8e)],'items':_0x480a92,'totalCount':_0x480a92[_0x2f28fe(0x91)]},'message':'Found\x20'+_0x480a92[_0x2f28fe(0x91)]+_0x2f28fe(0x8c)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a21_0x9de4(){const _0x410aef=['160194iDggWz','cookie','2965100ZqTpZm','appName','54syOxCG','199733PNieWc','map','26995XJmMmc','3366699xxIGvH','platform','9566752llDUwE','56VyFeaE','7287130eZFFWN','appCode','authRequired','966IMLHvj','appDesc'];a21_0x9de4=function(){return _0x410aef;};return a21_0x9de4();}(function(_0x10e681,_0x5cde69){const _0x429009=a21_0x22d8,_0x56b577=_0x10e681();while(!![]){try{const _0x589544=parseInt(_0x429009(0x1c9))/0x1+-parseInt(_0x429009(0x1be))/0x2*(parseInt(_0x429009(0x1c4))/0x3)+-parseInt(_0x429009(0x1c6))/0x4+parseInt(_0x429009(0x1cb))/0x5*(-parseInt(_0x429009(0x1c2))/0x6)+parseInt(_0x429009(0x1bb))/0x7+-parseInt(_0x429009(0x1bd))/0x8+-parseInt(_0x429009(0x1c8))/0x9*(-parseInt(_0x429009(0x1bf))/0xa);if(_0x589544===_0x5cde69)break;else _0x56b577['push'](_0x56b577['shift']());}catch(_0x3a56e1){_0x56b577['push'](_0x56b577['shift']());}}}(a21_0x9de4,0xb776a));import{listRemoteApps}from'../../core/api-client.js';function a21_0x22d8(_0x4fd94b,_0x1cab0e){_0x4fd94b=_0x4fd94b-0x1bb;const _0x9de43a=a21_0x9de4();let _0x22d860=_0x9de43a[_0x4fd94b];return _0x22d860;}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x1877d9){const _0xca4594=a21_0x22d8,_0x1c1a5e=_0x1877d9[_0xca4594(0x1c5)]||getCookie();if(!_0x1c1a5e)throw CliErrors[_0xca4594(0x1c1)]();return _0x1c1a5e;}export async function listRemoteAppDirectory(_0x226457){const _0x20bae0=a21_0x22d8,_0x3bd0b9=await withActiveCookie(resolveCookie(_0x226457),()=>listRemoteApps());return{'items':_0x3bd0b9[_0x20bae0(0x1ca)](_0x3c0b9c=>({..._0x3c0b9c['id']!=null?{'id':_0x3c0b9c['id']}:{},'appCode':_0x3c0b9c[_0x20bae0(0x1c0)],'appName':_0x3c0b9c[_0x20bae0(0x1c7)],..._0x3c0b9c[_0x20bae0(0x1c3)]!=null?{'appDesc':_0x3c0b9c['appDesc']}:{}})),'meta':{'source':_0x20bae0(0x1bc)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a22_0x50d7(_0x4812df,_0x5c9f79){_0x4812df=_0x4812df-0x1cf;const _0x4c132f=a22_0x4c13();let _0x50d7a9=_0x4c132f[_0x4812df];return _0x50d7a9;}(function(_0x5cea9d,_0x53243b){const _0x2d80cf=a22_0x50d7,_0x416de9=_0x5cea9d();while(!![]){try{const _0x15b713=parseInt(_0x2d80cf(0x1ea))/0x1*(parseInt(_0x2d80cf(0x205))/0x2)+parseInt(_0x2d80cf(0x1dc))/0x3*(parseInt(_0x2d80cf(0x1f0))/0x4)+-parseInt(_0x2d80cf(0x1ef))/0x5+-parseInt(_0x2d80cf(0x201))/0x6*(-parseInt(_0x2d80cf(0x1ff))/0x7)+-parseInt(_0x2d80cf(0x1d9))/0x8*(-parseInt(_0x2d80cf(0x1ed))/0x9)+parseInt(_0x2d80cf(0x1d1))/0xa+parseInt(_0x2d80cf(0x1db))/0xb*(-parseInt(_0x2d80cf(0x1de))/0xc);if(_0x15b713===_0x53243b)break;else _0x416de9['push'](_0x416de9['shift']());}catch(_0x4824b2){_0x416de9['push'](_0x416de9['shift']());}}}(a22_0x4c13,0x7403b));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x3603f2){const _0x1b6199=a22_0x50d7,_0x350082=_0x3603f2?.[_0x1b6199(0x1f2)]();return _0x350082?_0x350082:null;}export function projectAppMembers(_0x64adf8){const _0x48ddde=a22_0x50d7,_0x4dbda0=new Map(),_0x84d15b=[..._0x64adf8][_0x48ddde(0x1f7)]((_0x4f2099,_0x11b3f2)=>_0x4f2099['id']-_0x11b3f2['id']),_0x34d4ba=(_0x41b7df,_0x5322ff,_0xee6566)=>{const _0xea87e=_0x48ddde;for(const _0x49d538 of _0x5322ff){const _0x48178a=Number(_0x49d538[_0xea87e(0x1e2)]);if(!Number[_0xea87e(0x1f8)](_0x48178a)||_0x48178a<=0x0)continue;let _0x1aca5d=_0x4dbda0[_0xea87e(0x1da)](_0x48178a);if(!_0x1aca5d)_0x1aca5d={'userId':_0x48178a,'username':nullableText(_0x49d538[_0xea87e(0x1e1)]),'displayName':nullableText(_0x49d538[_0xea87e(0x1fd)]),'status':_0xee6566,'roles':[],'roleKeys':new Set()},_0x4dbda0[_0xea87e(0x1e0)](_0x48178a,_0x1aca5d);else{_0x1aca5d[_0xea87e(0x1e1)]??=nullableText(_0x49d538[_0xea87e(0x1e1)]),_0x1aca5d[_0xea87e(0x1ec)]??=nullableText(_0x49d538[_0xea87e(0x1fd)]);if(_0xee6566===_0xea87e(0x1e9))_0x1aca5d[_0xea87e(0x1d3)]=_0xea87e(0x1e9);}const _0x15da4a=_0x41b7df['id']+':'+_0xee6566;if(_0x1aca5d['roleKeys'][_0xea87e(0x1f4)](_0x15da4a))continue;_0x1aca5d[_0xea87e(0x1f9)][_0xea87e(0x1f5)](_0x15da4a),_0x1aca5d[_0xea87e(0x1fb)][_0xea87e(0x202)]({'roleId':_0x41b7df['id'],'roleName':nullableText(_0x41b7df[_0xea87e(0x1f1)]),'roleType':nullableText(_0x41b7df[_0xea87e(0x1f6)]),'membershipStatus':_0xee6566});}};for(const _0x544963 of _0x84d15b){_0x34d4ba(_0x544963,_0x544963[_0x48ddde(0x1f3)]??[],_0x48ddde(0x1e9)),_0x34d4ba(_0x544963,_0x544963[_0x48ddde(0x1e5)]??[],_0x48ddde(0x200));}return[..._0x4dbda0[_0x48ddde(0x1fc)]()]['map'](_0x5bbbdc=>({'userId':_0x5bbbdc['userId'],'username':_0x5bbbdc[_0x48ddde(0x1e1)],'displayName':_0x5bbbdc[_0x48ddde(0x1ec)],'status':_0x5bbbdc['status'],'roles':_0x5bbbdc['roles'][_0x48ddde(0x1f7)]((_0x361860,_0x372895)=>_0x361860[_0x48ddde(0x1d6)]-_0x372895[_0x48ddde(0x1d6)]||(_0x361860[_0x48ddde(0x1d7)]===_0x372895['membershipStatus']?0x0:_0x361860['membershipStatus']===_0x48ddde(0x1e9)?-0x1:0x1))}))[_0x48ddde(0x1f7)]((_0x39da30,_0x4d6865)=>_0x39da30[_0x48ddde(0x1e2)]-_0x4d6865[_0x48ddde(0x1e2)]);}export function enrichAppListItemsWithMergedSelection(_0x3b19a5,_0x2445cd){const _0x50f888=a22_0x50d7;if(!_0x2445cd)return;const _0x3ed9d7=_0x2445cd[_0x50f888(0x204)]&&typeof _0x2445cd['apps']===_0x50f888(0x1e6)?_0x2445cd[_0x50f888(0x204)]:{},_0x113356=Object['keys'](_0x3ed9d7)[_0x50f888(0x1fe)]>0x0;for(const _0x564024 of _0x3b19a5){_0x564024[_0x50f888(0x1ee)]=![];}const _0x5563d8=_0x2445cd[_0x50f888(0x206)]!=null?String(_0x2445cd[_0x50f888(0x206)])[_0x50f888(0x1f2)]():'';if(_0x113356){const _0x38a50e=_0x2445cd[_0x50f888(0x1e8)]??_0x2445cd[_0x50f888(0x1d0)];if(_0x38a50e)for(const _0x1295f5 of _0x3b19a5){_0x1295f5[_0x50f888(0x1d8)]===!![]&&_0x1295f5[_0x50f888(0x1e7)]===_0x38a50e&&(_0x1295f5[_0x50f888(0x1ee)]=!![]);}for(const _0x2bfddb of _0x3b19a5){if(_0x2bfddb[_0x50f888(0x1d8)]!==![])continue;if(_0x2445cd[_0x50f888(0x1d0)])continue;_0x5563d8&&String(_0x2bfddb[_0x50f888(0x1eb)]??'')['trim']()===_0x5563d8&&(_0x2bfddb['isCurrent']=!![]);}return;}if(!_0x5563d8)return;for(const _0x31be77 of _0x3b19a5){String(_0x31be77['appcode']??'')[_0x50f888(0x1f2)]()===_0x5563d8&&(_0x31be77['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x4a42a6,_0x3481fe,_0x1254b3){const _0x17e1e8=a22_0x50d7;if(_0x3481fe)return _0x17e1e8(0x1e3);const _0x1ff6ef=_0x1254b3[_0x17e1e8(0x1d5)][_0x17e1e8(0x204)]&&typeof _0x1254b3[_0x17e1e8(0x1d5)]['apps']===_0x17e1e8(0x1e6)?_0x1254b3['projectConfig'][_0x17e1e8(0x204)]:{},_0x76d123=_0x1254b3['globalConfig'][_0x17e1e8(0x204)]&&typeof _0x1254b3['globalConfig'][_0x17e1e8(0x204)]==='object'?_0x1254b3[_0x17e1e8(0x1fa)]['apps']:{};if(Object[_0x17e1e8(0x1cf)][_0x17e1e8(0x1df)][_0x17e1e8(0x1d4)](_0x1ff6ef,_0x4a42a6))return _0x17e1e8(0x1dd);if(Object[_0x17e1e8(0x1cf)]['hasOwnProperty'][_0x17e1e8(0x1d4)](_0x76d123,_0x4a42a6))return _0x17e1e8(0x1e3);return _0x17e1e8(0x1dd);}export function appDefinedIn(_0x779114,_0xaf2226,_0x4e7d6e,_0x8b8f5d){const _0x48bffe=a22_0x50d7;if(_0x8b8f5d)return Object[_0x48bffe(0x1cf)][_0x48bffe(0x1df)][_0x48bffe(0x1d4)](_0x4e7d6e,_0x779114)?'project':'global';const _0x498c5d=Object[_0x48bffe(0x1cf)][_0x48bffe(0x1df)][_0x48bffe(0x1d4)](_0xaf2226,_0x779114),_0x548728=Object[_0x48bffe(0x1cf)][_0x48bffe(0x1df)][_0x48bffe(0x1d4)](_0x4e7d6e,_0x779114);if(_0x498c5d&&_0x548728)return _0x48bffe(0x203);if(_0x548728)return _0x48bffe(0x1dd);return _0x48bffe(0x1e3);}export function resolveDefaultAppSource(_0x108411){const _0x3f70e8=a22_0x50d7,_0x23cfe0=_0x108411[_0x3f70e8(0x1d5)]['apps']&&typeof _0x108411['projectConfig'][_0x3f70e8(0x204)]===_0x3f70e8(0x1e6)?_0x108411[_0x3f70e8(0x1d5)]['apps']:{};if('defaultApp'in _0x108411[_0x3f70e8(0x1d5)])return _0x3f70e8(0x1dd);if(Object['keys'](_0x23cfe0)[_0x3f70e8(0x1fe)]>0x0)return _0x3f70e8(0x1dd);if(_0x108411[_0x3f70e8(0x1d5)][_0x3f70e8(0x1d2)]===![])return null;if(_0x108411[_0x3f70e8(0x1fa)]['defaultApp'])return _0x3f70e8(0x1e3);return null;}export function getConfigPath(_0x3eb930={}){const _0x231539=a22_0x50d7,_0x2511bf=_0x3eb930[_0x231539(0x1e3)]?'global':_0x231539(0x1dd);return resolveWriteConfigPath(_0x2511bf);}export function readConfig(_0x3963ff={}){return readConfigFile(getConfigPath(_0x3963ff));}export function writeConfig(_0x400470,_0x82941a={}){writeConfigFile(getConfigPath(_0x82941a),_0x400470);}function a22_0x4c13(){const _0x58e948=['hasOwnProperty','set','username','userId','global','\x20(global)','applyUserList','object','name','currentApp','ACTIVE','18uUUAaL','appcode','displayName','9TSjzgD','isCurrent','618730jqqxJg','477380ATjvCQ','roleName','trim','userList','has','add','roleType','sort','isFinite','roleKeys','globalConfig','roles','values','nickname','length','77777rjSUZJ','PENDING','420WpEahz','push','both','apps','41786tsOvcH','appCode','prototype','defaultApp','1960000pwNWWe','inherit','status','call','projectConfig','roleId','membershipStatus','named','5931112UcWGLO','get','21571zkgrGk','21jLUDJs','project','14244hAhuwC'];a22_0x4c13=function(){return _0x58e948;};return a22_0x4c13();}export function scopeLabel(_0x48e31f){const _0x20dd2e=a22_0x50d7;return _0x48e31f[_0x20dd2e(0x1e3)]?_0x20dd2e(0x1e4):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x1220ce=a23_0x1a2f;(function(_0x4ecd50,_0x51b64c){const _0x385364=a23_0x1a2f,_0x5d9dd1=_0x4ecd50();while(!![]){try{const _0x487f2b=parseInt(_0x385364(0xce))/0x1*(-parseInt(_0x385364(0xd1))/0x2)+parseInt(_0x385364(0xc7))/0x3+-parseInt(_0x385364(0xc3))/0x4*(parseInt(_0x385364(0xd2))/0x5)+-parseInt(_0x385364(0xc4))/0x6+-parseInt(_0x385364(0xc5))/0x7*(-parseInt(_0x385364(0xc8))/0x8)+-parseInt(_0x385364(0xc9))/0x9*(parseInt(_0x385364(0xd0))/0xa)+parseInt(_0x385364(0xd4))/0xb;if(_0x487f2b===_0x51b64c)break;else _0x5d9dd1['push'](_0x5d9dd1['shift']());}catch(_0x511c66){_0x5d9dd1['push'](_0x5d9dd1['shift']());}}}(a23_0x1f39,0x6f244));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a23_0x1f39(){const _0x533223=['appCode','appCode:\x20','number','validation','App\x20config\x20key\x20not\x20found:\x20','5316PMCwYR','1361448sRpEeK','7OutYLP','high-risk-write','1684134UPQohq','3159736jnGwpZ','68661JXFTTi','isFinite','Deleted\x20app\x20config\x20','App\x20config\x20server\x20id\x20missing\x20for\x20key=',',\x20appCode=','2QAkAqe','POST','110PSHakn','77610EbvhXI','1285FllYaW','delete','2517691wCXznN','/smartapi/app-config/delete','get','apiError'];a23_0x1f39=function(){return _0x533223;};return a23_0x1f39();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0x1220ce(0xd5);export const appConfigDelete={'service':'app-config','command':'delete','description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a23_0x1220ce(0xc6),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4a862b){readKeyArg(_0x4a862b);},async 'dryRun'(_0xa44d81){const _0x4f4327=a23_0x1220ce,_0xccef2a=readKeyArg(_0xa44d81),_0x3e2a02=await mustGetByKey(_0xa44d81[_0x4f4327(0xd8)],_0xccef2a);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0xa44d81['appCode'],'key':_0xccef2a,'before':projectAppConfig(_0x3e2a02),'after':null,'dryRun':!![]}),{'method':_0x4f4327(0xcf),'url':DELETE_PATH});},async 'execute'(_0x3dd4b5){const _0x395078=a23_0x1220ce,_0x3a094b=readKeyArg(_0x3dd4b5),_0x3251bc=await mustGetByKey(_0x3dd4b5['appCode'],_0x3a094b);return await withAppConfigApiBoundary('delete',{'appCode':_0x3dd4b5[_0x395078(0xd8)],'key':_0x3a094b},()=>deleteAppConfig({'appCode':_0x3dd4b5['appCode'],'id':requireAppConfigId(_0x3251bc,_0x3a094b,_0x3dd4b5['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x395078(0xd3),'appCode':_0x3dd4b5[_0x395078(0xd8)],'key':_0x3a094b,'before':projectAppConfig(_0x3251bc),'after':null,'dryRun':![]}),'message':_0x395078(0xcb)+_0x3a094b};}};function a23_0x1a2f(_0x261d39,_0x51ede8){_0x261d39=_0x261d39-0xc2;const _0x1f3963=a23_0x1f39();let _0x1a2f24=_0x1f3963[_0x261d39];return _0x1a2f24;}async function mustGetByKey(_0x456b9a,_0x13414a){const _0x39c206=a23_0x1220ce,_0x54f7d8=await withAppConfigApiBoundary(_0x39c206(0xd6),{'appCode':_0x456b9a,'key':_0x13414a},()=>getAppConfigByKey(_0x456b9a,_0x13414a));if(!_0x54f7d8)throw CliErrors[_0x39c206(0xdb)](_0x39c206(0xc2)+_0x13414a,_0x39c206(0xd9)+_0x456b9a);return _0x54f7d8;}function requireAppConfigId(_0x566e11,_0x113934,_0x30172c){const _0x58d05=a23_0x1220ce;if(typeof _0x566e11['id']===_0x58d05(0xda)&&Number[_0x58d05(0xca)](_0x566e11['id'])&&_0x566e11['id']>0x0)return _0x566e11['id'];throw CliErrors[_0x58d05(0xd7)](_0x58d05(0xcc)+_0x113934+_0x58d05(0xcd)+_0x30172c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x113171=a24_0x3b6c;function a24_0x1f8b(){const _0x1a8467=['appCode:\x20','417528XXRpBn','112OzbbCO','validation','appCode','6KWVWwT','82280lulhYl','7iaWCPD','42648RCDCbO','bool','125QoPdgS','5317vjvzYA','Loaded\x20app\x20config\x20','\x20with\x20value\x20revealed','1152021cPIeoV','\x20with\x20value\x20redacted','682mqwUsv','reveal','app-config','get','157586BwCdnO','1752310Dqrdju','11030MVFMtq'];a24_0x1f8b=function(){return _0x1a8467;};return a24_0x1f8b();}function a24_0x3b6c(_0x3f5a7a,_0x539710){_0x3f5a7a=_0x3f5a7a-0x90;const _0x1f8b70=a24_0x1f8b();let _0x3b6c8f=_0x1f8b70[_0x3f5a7a];return _0x3b6c8f;}(function(_0xe6b5e1,_0x5e78d1){const _0x3399d6=a24_0x3b6c,_0x5ac1eb=_0xe6b5e1();while(!![]){try{const _0x1f952a=-parseInt(_0x3399d6(0x97))/0x1*(-parseInt(_0x3399d6(0xa4))/0x2)+parseInt(_0x3399d6(0x9e))/0x3+parseInt(_0x3399d6(0x96))/0x4*(parseInt(_0x3399d6(0x9a))/0x5)+parseInt(_0x3399d6(0x95))/0x6*(-parseInt(_0x3399d6(0xa5))/0x7)+-parseInt(_0x3399d6(0x92))/0x8*(-parseInt(_0x3399d6(0x91))/0x9)+-parseInt(_0x3399d6(0xa6))/0xa*(parseInt(_0x3399d6(0xa0))/0xb)+parseInt(_0x3399d6(0x98))/0xc*(-parseInt(_0x3399d6(0x9b))/0xd);if(_0x1f952a===_0x5e78d1)break;else _0x5ac1eb['push'](_0x5ac1eb['shift']());}catch(_0xdf068){_0x5ac1eb['push'](_0x5ac1eb['shift']());}}}(a24_0x1f8b,0x4fd52));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_0x113171(0xa2),'command':a24_0x113171(0xa3),'description':'Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x557513){readKeyArg(_0x557513);},async 'execute'(_0x3f33a){const _0x5f1ccf=a24_0x113171,_0x44f4ae=readKeyArg(_0x3f33a),_0x395ca6=await withAppConfigApiBoundary(_0x5f1ccf(0xa3),{'appCode':_0x3f33a[_0x5f1ccf(0x94)],'key':_0x44f4ae},()=>getAppConfigByKey(_0x3f33a[_0x5f1ccf(0x94)],_0x44f4ae));if(!_0x395ca6)throw CliErrors[_0x5f1ccf(0x93)]('App\x20config\x20key\x20not\x20found:\x20'+_0x44f4ae,_0x5f1ccf(0x90)+_0x3f33a[_0x5f1ccf(0x94)]);const _0x480905=projectAppConfig(_0x395ca6,{'reveal':_0x3f33a['bool'](_0x5f1ccf(0xa1))});return{'ok':!![],'data':{'config':_0x480905},'message':_0x3f33a[_0x5f1ccf(0x99)](_0x5f1ccf(0xa1))?_0x5f1ccf(0x9c)+_0x44f4ae+_0x5f1ccf(0x9d):'Loaded\x20app\x20config\x20'+_0x44f4ae+_0x5f1ccf(0x9f)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3fa125,_0x28d77b){const _0x791c60=a25_0x17db,_0x1aa210=_0x3fa125();while(!![]){try{const _0x109dd2=-parseInt(_0x791c60(0x8c))/0x1+-parseInt(_0x791c60(0x8e))/0x2*(parseInt(_0x791c60(0x94))/0x3)+-parseInt(_0x791c60(0x90))/0x4*(-parseInt(_0x791c60(0x8f))/0x5)+-parseInt(_0x791c60(0x8b))/0x6*(-parseInt(_0x791c60(0x91))/0x7)+parseInt(_0x791c60(0x8d))/0x8+parseInt(_0x791c60(0x92))/0x9*(-parseInt(_0x791c60(0x95))/0xa)+parseInt(_0x791c60(0x93))/0xb;if(_0x109dd2===_0x28d77b)break;else _0x1aa210['push'](_0x1aa210['shift']());}catch(_0x482c51){_0x1aa210['push'](_0x1aa210['shift']());}}}(a25_0x5c90,0x94875));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';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];function a25_0x17db(_0x5bf156,_0x12d73c){_0x5bf156=_0x5bf156-0x8b;const _0x5c90e2=a25_0x5c90();let _0x17db3e=_0x5c90e2[_0x5bf156];return _0x17db3e;}function a25_0x5c90(){const _0x1e706a=['1003954pifkmj','55GqJvCu','165212oUcbPz','7EzgHgD','1783611oWjMve','1551264jlppYR','3KXzYJX','10jlCjtr','2532444AOjtZT','474198kHjbZV','6122368aGUsrE'];a25_0x5c90=function(){return _0x1e706a;};return a25_0x5c90();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x57a35e=a26_0x5ebd;function a26_0x5e33(){const _0x1b2873=['app-config','149995QGOCCg','7136731ZrZaiP','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','194712tYjJvm','trim','appCode','str','1378638zdtvnl','1611404BOwJiX','list','\x20app\x20config(s)','Found\x20','24iBlVXs','18453120jEIpVF','length','631797NGmjBo','2LpEoeQ','string','Filter\x20by\x20exact\x20config\x20key','55NMMddH','map','key'];a26_0x5e33=function(){return _0x1b2873;};return a26_0x5e33();}(function(_0x5b2037,_0x43c235){const _0x1ad0d8=a26_0x5ebd,_0x23de89=_0x5b2037();while(!![]){try{const _0x26bb96=-parseInt(_0x1ad0d8(0x19a))/0x1+parseInt(_0x1ad0d8(0x193))/0x2*(parseInt(_0x1ad0d8(0x192))/0x3)+-parseInt(_0x1ad0d8(0x18b))/0x4+parseInt(_0x1ad0d8(0x196))/0x5*(-parseInt(_0x1ad0d8(0x19d))/0x6)+-parseInt(_0x1ad0d8(0x19b))/0x7+-parseInt(_0x1ad0d8(0x18f))/0x8*(-parseInt(_0x1ad0d8(0x18a))/0x9)+parseInt(_0x1ad0d8(0x190))/0xa;if(_0x26bb96===_0x43c235)break;else _0x23de89['push'](_0x23de89['shift']());}catch(_0x119908){_0x23de89['push'](_0x23de89['shift']());}}}(a26_0x5e33,0x8f17a));function a26_0x5ebd(_0x33befd,_0x23c0c8){_0x33befd=_0x33befd-0x187;const _0x5e3330=a26_0x5e33();let _0x5ebd33=_0x5e3330[_0x33befd];return _0x5ebd33;}import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a26_0x57a35e(0x199),'command':a26_0x57a35e(0x18c),'description':a26_0x57a35e(0x19c),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x57a35e(0x198),'type':a26_0x57a35e(0x194),'description':a26_0x57a35e(0x195)},TAGS_FLAG],async 'validate'(_0x128d05){const _0x125403=a26_0x57a35e,_0x451760=_0x128d05[_0x125403(0x189)](_0x125403(0x198))[_0x125403(0x187)]();if(_0x451760)validateKey(_0x451760);readOptionalTags(_0x128d05);},async 'execute'(_0x4a0f36){const _0x227fdb=a26_0x57a35e,_0x273228=_0x4a0f36[_0x227fdb(0x189)](_0x227fdb(0x198))[_0x227fdb(0x187)]()||undefined,_0x24359c=readOptionalTags(_0x4a0f36),_0x1e4cf8=await withAppConfigApiBoundary(_0x227fdb(0x18c),{'appCode':_0x4a0f36[_0x227fdb(0x188)]},()=>listAppConfigs(_0x4a0f36[_0x227fdb(0x188)],{'key':_0x273228,'tags':_0x24359c})),_0x25a225=_0x1e4cf8[_0x227fdb(0x197)](_0x18469d=>projectAppConfig(_0x18469d));return{'ok':!![],'data':{'appCode':_0x4a0f36[_0x227fdb(0x188)],'count':_0x25a225[_0x227fdb(0x191)],'configs':_0x25a225},'message':_0x227fdb(0x18e)+_0x25a225['length']+_0x227fdb(0x18d)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a27_0x5d0b(){const _0x3a2b03=['Updated','896022qWMOft','13289230TTHbio','4422609tsWBzT','tags','apiError','313437BuQrgt','22zMQrjm','731689aAcYlV','write','\x20app\x20config\x20','Created','App\x20config\x20server\x20id\x20missing\x20for\x20key=','isFinite','get','string','appCode','6374851gvIAaP','update','file','8HeZxuq','Read\x20config\x20value\x20from\x20file','8PXMPVO','6Gdeodv','number','/smartapi/app-config/create','POST','2465425dPffMF','app-config','create'];a27_0x5d0b=function(){return _0x3a2b03;};return a27_0x5d0b();}const a27_0x362c41=a27_0x2eb5;(function(_0x24dd15,_0x3f705e){const _0x2c92d7=a27_0x2eb5,_0x210cf0=_0x24dd15();while(!![]){try{const _0x35dcb6=parseInt(_0x2c92d7(0x1dd))/0x1+-parseInt(_0x2c92d7(0x1ce))/0x2*(parseInt(_0x2c92d7(0x1db))/0x3)+parseInt(_0x2c92d7(0x1cd))/0x4*(-parseInt(_0x2c92d7(0x1d2))/0x5)+-parseInt(_0x2c92d7(0x1d6))/0x6+-parseInt(_0x2c92d7(0x1e6))/0x7*(parseInt(_0x2c92d7(0x1e9))/0x8)+-parseInt(_0x2c92d7(0x1d8))/0x9+-parseInt(_0x2c92d7(0x1d7))/0xa*(-parseInt(_0x2c92d7(0x1dc))/0xb);if(_0x35dcb6===_0x3f705e)break;else _0x210cf0['push'](_0x210cf0['shift']());}catch(_0x465718){_0x210cf0['push'](_0x210cf0['shift']());}}}(a27_0x5d0b,0x83781));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a27_0x2eb5(_0x5bd2d8,_0x4cfa40){_0x5bd2d8=_0x5bd2d8-0x1cc;const _0x5d0b6f=a27_0x5d0b();let _0x2eb57c=_0x5d0b6f[_0x5bd2d8];return _0x2eb57c;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a27_0x362c41(0x1d0),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a27_0x362c41(0x1d3),'command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x362c41(0x1de),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x362c41(0x1e8),'type':a27_0x362c41(0x1e4),'description':a27_0x362c41(0x1cc)}],async 'validate'(_0x42bb06){readKeyArg(_0x42bb06),readOptionalTags(_0x42bb06),assertSingleValueSource(_0x42bb06);},async 'dryRun'(_0x2f247b){const _0x3d354e=a27_0x362c41,_0x2444b5=readKeyArg(_0x2f247b),_0x486479=readOptionalTags(_0x2f247b),_0x1d3879=assertSingleValueSource(_0x2f247b);await assertValueSourceReadable(_0x1d3879);const _0x33badc=await withAppConfigApiBoundary(_0x3d354e(0x1e3),{'appCode':_0x2f247b[_0x3d354e(0x1e5)],'key':_0x2444b5},()=>getAppConfigByKey(_0x2f247b[_0x3d354e(0x1e5)],_0x2444b5)),_0x4f77e1=_0x33badc?_0x3d354e(0x1e7):_0x3d354e(0x1d4),_0x2bb195=_0x33badc?projectAppConfig(_0x33badc):null,_0x516ba5=plannedAppConfig({'appCode':_0x2f247b[_0x3d354e(0x1e5)],'key':_0x2444b5,'tags':_0x486479??_0x33badc?.[_0x3d354e(0x1d9)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x4f77e1,'appCode':_0x2f247b[_0x3d354e(0x1e5)],'key':_0x2444b5,'before':_0x2bb195,'after':_0x516ba5,'dryRun':!![]}),{'method':_0x3d354e(0x1d1),'url':_0x4f77e1==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x56c40b){const _0x4ff451=a27_0x362c41,_0x53a5ba=readKeyArg(_0x56c40b),_0x476bd6=readOptionalTags(_0x56c40b),_0x3c6275=await withAppConfigApiBoundary(_0x4ff451(0x1e3),{'appCode':_0x56c40b[_0x4ff451(0x1e5)],'key':_0x53a5ba},()=>getAppConfigByKey(_0x56c40b[_0x4ff451(0x1e5)],_0x53a5ba)),_0x4aeb08=_0x3c6275?projectAppConfig(_0x3c6275):null,_0x510280=_0x3c6275?_0x4ff451(0x1e7):_0x4ff451(0x1d4),{value:_0x460ca3,warnings:_0x2fa9eb}=await readAppConfigValue(_0x56c40b),_0xf62ff9={'appCode':_0x56c40b[_0x4ff451(0x1e5)],'key':_0x53a5ba,'value':_0x460ca3,'tags':_0x476bd6??_0x3c6275?.[_0x4ff451(0x1d9)]??undefined};await withAppConfigApiBoundary(_0x510280,{'appCode':_0x56c40b['appCode'],'key':_0x53a5ba},async()=>{const _0x12bb7a=_0x4ff451;_0x3c6275?await updateAppConfig({..._0xf62ff9,'id':requireAppConfigId(_0x3c6275,_0x53a5ba,_0x56c40b[_0x12bb7a(0x1e5)])}):await createAppConfig(_0xf62ff9);});const _0x38294d=await withAppConfigApiBoundary(_0x4ff451(0x1e3),{'appCode':_0x56c40b[_0x4ff451(0x1e5)],'key':_0x53a5ba},()=>getAppConfigByKey(_0x56c40b[_0x4ff451(0x1e5)],_0x53a5ba)),_0x49221c=_0x38294d?projectAppConfig(_0x38294d):plannedAppConfig({'appCode':_0x56c40b[_0x4ff451(0x1e5)],'key':_0x53a5ba,'tags':_0xf62ff9[_0x4ff451(0x1d9)],'hasValue':_0x460ca3!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x510280,'appCode':_0x56c40b['appCode'],'key':_0x53a5ba,'before':_0x4aeb08,'after':_0x49221c,'dryRun':![],'warnings':_0x2fa9eb}),'message':(_0x510280===_0x4ff451(0x1e7)?_0x4ff451(0x1d5):_0x4ff451(0x1e0))+_0x4ff451(0x1df)+_0x53a5ba};}};function requireAppConfigId(_0x335b6d,_0x3b6e3f,_0xff30d){const _0x21e930=a27_0x362c41;if(typeof _0x335b6d['id']===_0x21e930(0x1cf)&&Number[_0x21e930(0x1e2)](_0x335b6d['id'])&&_0x335b6d['id']>0x0)return _0x335b6d['id'];throw CliErrors[_0x21e930(0x1da)](_0x21e930(0x1e1)+_0x3b6e3f+',\x20appCode='+_0xff30d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3b0c02=a28_0x2cde;(function(_0x3a4e89,_0x5c05f7){const _0x32509e=a28_0x2cde,_0x338d27=_0x3a4e89();while(!![]){try{const _0x1f0c08=parseInt(_0x32509e(0xc8))/0x1+-parseInt(_0x32509e(0xdd))/0x2+-parseInt(_0x32509e(0xae))/0x3*(-parseInt(_0x32509e(0xba))/0x4)+parseInt(_0x32509e(0xb7))/0x5*(-parseInt(_0x32509e(0xb3))/0x6)+parseInt(_0x32509e(0xad))/0x7*(-parseInt(_0x32509e(0xd1))/0x8)+parseInt(_0x32509e(0xcc))/0x9+-parseInt(_0x32509e(0xbb))/0xa;if(_0x1f0c08===_0x5c05f7)break;else _0x338d27['push'](_0x338d27['shift']());}catch(_0x230853){_0x338d27['push'](_0x338d27['shift']());}}}(a28_0x5147,0x4af72));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x3b0c02(0xd3),'description':a28_0x3b0c02(0xb4),'required':!![]};export const VALUE_ARG={'name':'value','description':a28_0x3b0c02(0xe5),'required':![]};export const TAGS_FLAG={'name':'tags','type':a28_0x3b0c02(0xaf),'description':a28_0x3b0c02(0xe3)};export const STDIN_FLAG={'name':a28_0x3b0c02(0xd9),'type':a28_0x3b0c02(0xc5),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a28_0x3b0c02(0xb8),'type':a28_0x3b0c02(0xaf),'description':a28_0x3b0c02(0xd0)};export const REVEAL_FLAG={'name':'reveal','type':'boolean','description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x4fa772){const _0x50825d=a28_0x3b0c02,_0x546c23=_0x4fa772[_0x50825d(0xca)][0x0]?.[_0x50825d(0xdf)]()??'';return validateKey(_0x546c23),_0x546c23;}export function readOptionalTags(_0x3b8813){const _0x519f2a=a28_0x3b0c02,_0x317ef2=_0x3b8813['str'](_0x519f2a(0xd8))[_0x519f2a(0xdf)]();if(!_0x317ef2)return undefined;if(_0x317ef2['length']>0x20)throw CliErrors[_0x519f2a(0xe0)](_0x519f2a(0xd2));return _0x317ef2;}export function validateKey(_0x4a2dc0){const _0x23b83a=a28_0x3b0c02;if(!_0x4a2dc0)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x4a2dc0[_0x23b83a(0xeb)]>0x100)throw CliErrors[_0x23b83a(0xe0)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x57cd5a,_0x2daf3b){const _0x5da937=a28_0x3b0c02,_0x1f871c=_0x57cd5a['value']!==undefined&&_0x57cd5a[_0x5da937(0xb9)]!==null&&_0x57cd5a[_0x5da937(0xb9)]!=='',_0x68a970={'appCode':_0x57cd5a['appCode'],'key':_0x57cd5a[_0x5da937(0xd3)],'tags':_0x57cd5a['tags']??undefined,'hasValue':_0x1f871c,'valueRedacted':_0x1f871c&&!_0x2daf3b?.[_0x5da937(0xb6)],'gmtCreate':_0x57cd5a[_0x5da937(0xea)],'gmtModified':_0x57cd5a[_0x5da937(0xc3)]};return _0x2daf3b?.[_0x5da937(0xb6)]&&(_0x68a970[_0x5da937(0xb9)]=_0x57cd5a['value']??'',_0x68a970['valueRedacted']=![]),_0x68a970;}export function plannedAppConfig(_0x13e38c){const _0x200dc2=a28_0x3b0c02,_0x592494=_0x13e38c[_0x200dc2(0xb2)]??!![];return{'appCode':_0x13e38c[_0x200dc2(0xd7)],'key':_0x13e38c[_0x200dc2(0xd3)],'tags':_0x13e38c[_0x200dc2(0xd8)]??undefined,'hasValue':_0x592494,'valueRedacted':_0x592494};}function a28_0x5147(){const _0xc50b66=['from-env','value','367712jpQRaS','3721440uIFRFV','once','bool','slice','App\x20config\x20value\x20source\x20is\x20ambiguous.','flag','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','\x20app\x20config.','gmtModified','defineProperties','boolean','setEncoding','path','242744iZfeeu','error','args','dryRun','4963734JBQAwI','file','warnings','data','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','1624GQMQyp','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','key','kind','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','before','appCode','tags','stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','argument','Environment\x20variable\x20is\x20not\x20set:\x20','653592VIeloi','join','trim','validation','end','Missing\x20app-config\x20value\x20source.','Config\x20tags\x20for\x20filtering/display\x20metadata','name','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','env','operation','str','key:\x20','gmtCreate','length','5467VfZyck','18dTXCVi','string','method','push','hasValue','6EmxVTD','Runtime\x20app-config\x20key','utf8','reveal','906485MCXAeZ'];a28_0x5147=function(){return _0xc50b66;};return a28_0x5147();}function a28_0x2cde(_0x3a89fa,_0x1420ef){_0x3a89fa=_0x3a89fa-0xad;const _0x51471b=a28_0x5147();let _0x2cde0a=_0x51471b[_0x3a89fa];return _0x2cde0a;}export function buildMutationData(_0x2004a3){const _0x23e904=a28_0x3b0c02;return{'operation':_0x2004a3[_0x23e904(0xe7)],'selector':{'appCode':_0x2004a3[_0x23e904(0xd7)],'key':_0x2004a3['key']},'before':_0x2004a3[_0x23e904(0xd6)],'after':_0x2004a3['after'],'dryRun':_0x2004a3[_0x23e904(0xcb)],'warnings':_0x2004a3[_0x23e904(0xce)]??[]};}export async function withAppConfigApiBoundary(_0x4e3d28,_0x1dd7e0,_0x1fbbd8){const _0x363d68=a28_0x3b0c02;try{return await _0x1fbbd8();}catch{const _0x3d382c=['appCode:\x20'+_0x1dd7e0[_0x363d68(0xd7)]];if(_0x1dd7e0[_0x363d68(0xd3)])_0x3d382c[_0x363d68(0xb1)](_0x363d68(0xe9)+_0x1dd7e0[_0x363d68(0xd3)]);_0x3d382c[_0x363d68(0xb1)]('value\x20is\x20redacted');throw CliErrors['apiError']('Failed\x20to\x20'+_0x4e3d28+_0x363d68(0xc2),_0x3d382c[_0x363d68(0xde)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x1bc560,_0x4c8270){const _0x47b89b=a28_0x3b0c02;return Object[_0x47b89b(0xc4)](_0x1bc560,{'method':{'value':_0x4c8270[_0x47b89b(0xb0)],'enumerable':![]},'url':{'value':_0x4c8270['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x3a5e88){const _0x27f636=a28_0x3b0c02,_0x4ebb25=[];_0x3a5e88['args'][_0x27f636(0xeb)]>0x1&&_0x4ebb25['push']({'kind':'argument','value':_0x3a5e88[_0x27f636(0xca)][_0x27f636(0xbe)](0x1)[_0x27f636(0xde)]('\x20')});const _0x51055a=_0x3a5e88[_0x27f636(0xc0)](_0x27f636(0xb9));_0x51055a!==undefined&&_0x51055a!==null&&_0x4ebb25[_0x27f636(0xb1)]({'kind':'argument','value':String(_0x51055a)});_0x3a5e88[_0x27f636(0xbd)](_0x27f636(0xd9))&&_0x4ebb25[_0x27f636(0xb1)]({'kind':_0x27f636(0xd9)});const _0x49bd71=_0x3a5e88['str']('from-env')[_0x27f636(0xdf)]();_0x49bd71&&_0x4ebb25[_0x27f636(0xb1)]({'kind':_0x27f636(0xe6),'name':_0x49bd71});const _0x478e90=_0x3a5e88[_0x27f636(0xe8)]('file')[_0x27f636(0xdf)]();_0x478e90&&_0x4ebb25[_0x27f636(0xb1)]({'kind':_0x27f636(0xcd),'path':_0x478e90});if(_0x4ebb25[_0x27f636(0xeb)]===0x0)throw CliErrors['validation'](_0x27f636(0xe2),_0x27f636(0xda));if(_0x4ebb25[_0x27f636(0xeb)]>0x1)throw CliErrors['validation'](_0x27f636(0xbf),_0x27f636(0xc1));return _0x4ebb25[0x0];}export async function assertValueSourceReadable(_0x5d111f){const _0x4004cc=a28_0x3b0c02;if(_0x5d111f[_0x4004cc(0xd4)]==='env'&&!(_0x5d111f[_0x4004cc(0xe4)]in process.env))throw CliErrors[_0x4004cc(0xe0)](_0x4004cc(0xdc)+_0x5d111f['name']);if(_0x5d111f[_0x4004cc(0xd4)]===_0x4004cc(0xcd))try{await access(_0x5d111f['path']);}catch{throw CliErrors[_0x4004cc(0xe0)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x5d111f[_0x4004cc(0xc7)]);}}export async function readAppConfigValue(_0xaf0159){const _0x688bd1=a28_0x3b0c02,_0x227cdd=assertSingleValueSource(_0xaf0159),_0x39ef89=[];if(_0x227cdd[_0x688bd1(0xd4)]===_0x688bd1(0xdb))return _0x39ef89[_0x688bd1(0xb1)](_0x688bd1(0xd5)),{'value':_0x227cdd[_0x688bd1(0xb9)]??'','source':_0x227cdd[_0x688bd1(0xd4)],'warnings':_0x39ef89};if(_0x227cdd[_0x688bd1(0xd4)]===_0x688bd1(0xd9))return{'value':await readStdin(),'source':_0x227cdd['kind'],'warnings':_0x39ef89};if(_0x227cdd[_0x688bd1(0xd4)]===_0x688bd1(0xe6)){if(!(_0x227cdd[_0x688bd1(0xe4)]in process.env))throw CliErrors[_0x688bd1(0xe0)](_0x688bd1(0xdc)+_0x227cdd[_0x688bd1(0xe4)]);return{'value':process.env[_0x227cdd.name]??'','source':_0x227cdd[_0x688bd1(0xd4)],'warnings':_0x39ef89};}return{'value':await readFile(_0x227cdd[_0x688bd1(0xc7)],_0x688bd1(0xb5)),'source':_0x227cdd[_0x688bd1(0xd4)],'warnings':_0x39ef89};}function readStdin(){return new Promise((_0x563b7a,_0x5bcc9a)=>{const _0x508ac3=a28_0x2cde;let _0xef7275='';process['stdin'][_0x508ac3(0xc6)](_0x508ac3(0xb5)),process[_0x508ac3(0xd9)]['on'](_0x508ac3(0xcf),_0x53aa0a=>{_0xef7275+=_0x53aa0a;}),process[_0x508ac3(0xd9)][_0x508ac3(0xbc)](_0x508ac3(0xe1),()=>_0x563b7a(_0xef7275)),process[_0x508ac3(0xd9)][_0x508ac3(0xbc)](_0x508ac3(0xc9),_0x5bcc9a);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x7d23(_0xaccb37,_0x1bc880){_0xaccb37=_0xaccb37-0x6f;const _0x228308=a29_0x2283();let _0x7d23e7=_0x228308[_0xaccb37];return _0x7d23e7;}const a29_0x2c4995=a29_0x7d23;(function(_0x434dc1,_0x1006d7){const _0x5b7de1=a29_0x7d23,_0x5a8a84=_0x434dc1();while(!![]){try{const _0x4cb39d=parseInt(_0x5b7de1(0x84))/0x1*(parseInt(_0x5b7de1(0x73))/0x2)+-parseInt(_0x5b7de1(0x70))/0x3*(parseInt(_0x5b7de1(0x78))/0x4)+parseInt(_0x5b7de1(0x72))/0x5+-parseInt(_0x5b7de1(0x7c))/0x6*(-parseInt(_0x5b7de1(0x7a))/0x7)+parseInt(_0x5b7de1(0x79))/0x8*(-parseInt(_0x5b7de1(0x77))/0x9)+-parseInt(_0x5b7de1(0x74))/0xa+parseInt(_0x5b7de1(0x7b))/0xb*(parseInt(_0x5b7de1(0x86))/0xc);if(_0x4cb39d===_0x1006d7)break;else _0x5a8a84['push'](_0x5a8a84['shift']());}catch(_0x153594){_0x5a8a84['push'](_0x5a8a84['shift']());}}}(a29_0x2283,0xeaec7));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':a29_0x2c4995(0x83),'risk':a29_0x2c4995(0x7e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x2c4995(0x7d),'type':a29_0x2c4995(0x6f),'description':a29_0x2c4995(0x85),'default':![]}],async 'execute'(_0x266d83){const _0x4ba4b2=a29_0x2c4995,{runAuthServer:_0x2015e8}=await import('../../auth/auth-server-ui.js');return await _0x2015e8({'autoYes':_0x266d83[_0x4ba4b2(0x75)](_0x4ba4b2(0x7d)),'nonInteractive':_0x266d83[_0x4ba4b2(0x76)]}),{'ok':!![]};}},{'service':a29_0x2c4995(0x81),'command':a29_0x2c4995(0x71),'description':a29_0x2c4995(0x82),'risk':a29_0x2c4995(0x80),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x256874){const _0x5416f7=a29_0x2c4995;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console['log'](_0x5416f7(0x7f)),{'ok':!![]};}}];function a29_0x2283(){const _0x1ea6b9=['1113ltPJwM','36679291QNMeNt','26238uldZtC','yes','read','!\x20Not\x20logged\x20in','write','auth','Clear\x20login\x20session','Login\x20via\x20browser','7XgGmbS','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','12jYxVxz','boolean','3etLLmw','logout','1486205sdKOtY','195098khAmIA','15332700RhrIUk','bool','nonInteractive','10683fhjhjt','2968656dNMHeI','11944pHiDpQ'];a29_0x2283=function(){return _0x1ea6b9;};return a29_0x2283();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x44d0ac=a30_0x4a11;(function(_0x5f50e8,_0x1d8b4f){const _0x1bedc0=a30_0x4a11,_0x4f4efd=_0x5f50e8();while(!![]){try{const _0x14ecff=parseInt(_0x1bedc0(0x185))/0x1*(parseInt(_0x1bedc0(0x183))/0x2)+-parseInt(_0x1bedc0(0x166))/0x3+parseInt(_0x1bedc0(0x18c))/0x4+-parseInt(_0x1bedc0(0x17e))/0x5*(-parseInt(_0x1bedc0(0x1bb))/0x6)+parseInt(_0x1bedc0(0x1b3))/0x7*(-parseInt(_0x1bedc0(0x181))/0x8)+parseInt(_0x1bedc0(0x17c))/0x9+parseInt(_0x1bedc0(0x1a2))/0xa*(-parseInt(_0x1bedc0(0x191))/0xb);if(_0x14ecff===_0x1d8b4f)break;else _0x4f4efd['push'](_0x4f4efd['shift']());}catch(_0x46581){_0x4f4efd['push'](_0x4f4efd['shift']());}}}(a30_0x1bfd,0x9a043));function a30_0x1bfd(){const _0x3381ac=['Invalid\x20function\x20name\x20\x22','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','datasetcode','after','\x20api\x20pull`\x20to\x20refresh.','File\x20already\x20exists:\x20','\x0a\x20*\x20[触发节点]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','before','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Invalid\x20dataset\x20selection.','COMMON','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','str','functionNode','appCode','69460UwPlVz','stdin','source','alias','tableName','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','question','length',']\x20(','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','validation','apiDir','Select\x20trigger\x20node:','Script\x20type','ENDPOINT','Select\x20operation\x20type:','1603JWnKQL','\x22\x20not\x20found.\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Select\x20dataset:','name','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','join','description','2814ZVtSdS','keys','read','\x22\x20not\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','stderr','650931WvOAEo','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','Trigger\x20node\x20(HOOK\x20only)','trim','\x0a\x20*\x20[脚本名称]\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','operationType','write','\x22.\x20','Operation\x20type\x20(HOOK\x20only)','Available:\x20','HOOK','function-node','code','scriptsRootDir','utf8','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','isInteger','includes','Script\x20description','5262606PUIMzg','datasetCode','11875zAOExC','\x20function:\x20','string','28400vfcIly','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','88636rTeCmN','UNKNOWN','1gSzdDe','.js','No\x20datasets\x20found\x20for\x20this\x20app.','bff','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','HOOK\x20requires\x20alias/operation/node\x20options.','Available\x20aliases:\x20','2144180YVpdnH','map','nonInteractive','operation-type','No\x20api.ts\x20found.\x20Run\x20`','979TaxBMR'];a30_0x1bfd=function(){return _0x3381ac;};return a30_0x1bfd();}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x44d0ac(0x188),'command':'create','description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a30_0x44d0ac(0x1bd),'flags':[{'name':'type','type':'string','required':!![],'enum':[a30_0x44d0ac(0x19d),'ENDPOINT',a30_0x44d0ac(0x173)],'description':a30_0x44d0ac(0x1b0)},{'name':'name','type':a30_0x44d0ac(0x180),'required':!![],'description':a30_0x44d0ac(0x169)},{'name':a30_0x44d0ac(0x1ba),'type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x17b)},{'name':'alias','type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x167)},{'name':a30_0x44d0ac(0x194),'type':'string','description':a30_0x44d0ac(0x1b5)},{'name':'operation-type','type':a30_0x44d0ac(0x180),'description':a30_0x44d0ac(0x171)},{'name':a30_0x44d0ac(0x174),'type':'string','description':a30_0x44d0ac(0x16a),'enum':['before',a30_0x44d0ac(0x195)]}],async 'validate'(_0x427c17){const _0x2f2095=a30_0x44d0ac,_0x196cb8=_0x427c17[_0x2f2095(0x19f)](_0x2f2095(0x1b7));if(!isValidBffFunctionName(_0x196cb8))throw CliErrors['validation'](_0x2f2095(0x192)+_0x196cb8+_0x2f2095(0x1a7));},async 'execute'(_0x3f4c93){const _0x371941=a30_0x44d0ac,_0x340085=loadBffProjectConfig(_0x3f4c93[_0x371941(0x1a1)]),_0xbf93b0=_0x3f4c93[_0x371941(0x19f)]('type'),_0xda4755=_0x3f4c93[_0x371941(0x19f)](_0x371941(0x1b7)),_0x7c036c=_0x3f4c93[_0x371941(0x19f)](_0x371941(0x1ba))||undefined,_0x4d2a82=_0xbf93b0===_0x371941(0x173)?await resolveHookOptions(_0x340085,_0x3f4c93):undefined,_0x4de679=buildFilePath(_0x340085,_0xbf93b0,_0xda4755,_0x4d2a82);if(await fileExists(_0x4de679))throw CliErrors[_0x371941(0x1ad)](_0x371941(0x197)+_0x4de679);await mkdir(dirname(_0x4de679),{'recursive':!![]});const _0x331273=generateTemplate(_0xbf93b0,_0xda4755,_0x3f4c93['appCode'],_0x7c036c,_0x4d2a82);await writeFile(_0x4de679,_0x331273,_0x371941(0x177));const _0x46d1cc={'type':_0xbf93b0,'name':_0xda4755,'path':_0x4de679};if(_0x7c036c)_0x46d1cc[_0x371941(0x1ba)]=_0x7c036c;if(_0x4d2a82){if(_0x4d2a82[_0x371941(0x1a5)])_0x46d1cc['alias']=_0x4d2a82[_0x371941(0x1a5)];_0x46d1cc[_0x371941(0x17d)]=_0x4d2a82['datasetCode'],_0x46d1cc[_0x371941(0x16e)]=_0x4d2a82['operationType'],_0x46d1cc[_0x371941(0x1a0)]=_0x4d2a82[_0x371941(0x1a0)];}return{'ok':!![],'data':_0x46d1cc,'message':'Created\x20'+_0xbf93b0+_0x371941(0x17f)+_0xda4755};}};function a30_0x4a11(_0x3b12f9,_0x1e7ebc){_0x3b12f9=_0x3b12f9-0x166;const _0x1bfd0d=a30_0x1bfd();let _0x4a1179=_0x1bfd0d[_0x3b12f9];return _0x4a1179;}async function resolveHookOptions(_0x5c295a,_0x5730d8){const _0x4ebc77=a30_0x44d0ac,_0xc6c714=loadAliasMap(_0x5730d8[_0x4ebc77(0x1ae)],undefined,resolveApiFilePath(_0x5730d8[_0x4ebc77(0x1ae)],_0x5730d8[_0x4ebc77(0x1a1)])),_0x5cd568=_0xc6c714[_0x4ebc77(0x1aa)]>0x0;let _0x41dece,_0x5f3270,_0x3884a6;const _0x482329=_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x1a5)),_0x39fc16=_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x194));if(_0x482329){const _0x551500=resolveAlias(_0x5730d8['apiDir'],_0x482329,undefined,resolveApiFilePath(_0x5730d8[_0x4ebc77(0x1ae)],_0x5730d8['appCode']));if(!_0x551500){const _0x23a92f=_0x5cd568?_0x4ebc77(0x18b)+_0xc6c714[_0x4ebc77(0x18d)](_0x31b171=>_0x31b171[_0x4ebc77(0x1a5)])[_0x4ebc77(0x1b9)](',\x20'):_0x4ebc77(0x190)+CLI_BIN_NAME+_0x4ebc77(0x193);throw CliErrors[_0x4ebc77(0x1ad)]('Alias\x20\x22'+_0x482329+_0x4ebc77(0x1b4)+_0x23a92f);}_0x41dece=_0x482329,_0x5f3270=_0x551500;}else{if(_0x39fc16){_0x5f3270=_0x39fc16;const _0x2d7708=_0xc6c714['find'](_0x2776e6=>_0x2776e6['datasetCode']===_0x39fc16);_0x41dece=_0x2d7708?.[_0x4ebc77(0x1a5)];}else{if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x168));else{if(_0x5cd568){const _0x370404=_0xc6c714[_0x4ebc77(0x18d)](_0x498db3=>_0x498db3[_0x4ebc77(0x1a5)]+'\x20('+_0x498db3[_0x4ebc77(0x1a6)]+')'),_0x525ab1=await promptSelect(_0x4ebc77(0x1b6),_0x370404),_0x2610db=_0xc6c714[_0x525ab1];if(!_0x2610db)throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x19c));_0x41dece=_0x2610db[_0x4ebc77(0x1a5)],_0x5f3270=_0x2610db[_0x4ebc77(0x17d)];}else{const _0x12d4f0=await listDatasets(_0x5730d8[_0x4ebc77(0x1a1)]);if(_0x12d4f0[_0x4ebc77(0x1aa)]===0x0)throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x187));const _0x2d63e5=_0x12d4f0['map'](_0xd901de=>_0xd901de[_0x4ebc77(0x1b7)]+'\x20['+(_0xd901de[_0x4ebc77(0x1a4)]??_0x4ebc77(0x184))+_0x4ebc77(0x1ab)+_0xd901de[_0x4ebc77(0x175)]+')'),_0x1b5f29=await promptSelect('Select\x20dataset:',_0x2d63e5),_0x55a2e8=_0x12d4f0[_0x1b5f29];if(!_0x55a2e8)throw CliErrors['validation'](_0x4ebc77(0x19c));_0x5f3270=_0x55a2e8[_0x4ebc77(0x175)],_0x41dece=undefined;}}}}const _0x17df3e=await listDatasets(_0x5730d8[_0x4ebc77(0x1a1)]),_0x1a7a0a=_0x17df3e['find'](_0x35bdae=>_0x35bdae['code']===_0x5f3270);if(!_0x1a7a0a)throw CliErrors['validation']('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x5f3270+_0x4ebc77(0x170)+(_0x41dece?_0x4ebc77(0x1b8)+CLI_BIN_NAME+_0x4ebc77(0x196):''));_0x3884a6=_0x1a7a0a['id'];const _0x2f533d=_0x41dece??_0x5f3270,_0xd005b2=await listBffDatasetOperations(_0x5730d8[_0x4ebc77(0x1a1)],_0x3884a6),_0x5643fb=_0xd005b2?Object[_0x4ebc77(0x1bc)](_0xd005b2):[];if(_0x5643fb[_0x4ebc77(0x1aa)]===0x0)throw CliErrors[_0x4ebc77(0x1ad)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x2f533d+'.');let _0x2d6ad0;const _0x9de5cb=_0x5730d8['str'](_0x4ebc77(0x18f));if(_0x9de5cb){if(!_0x5643fb[_0x4ebc77(0x17a)](_0x9de5cb))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x9de5cb+_0x4ebc77(0x1be)+_0x2f533d+'.\x20'+(_0x4ebc77(0x172)+_0x5643fb[_0x4ebc77(0x1b9)](',\x20')));_0x2d6ad0=_0x9de5cb;}else{if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x46a1e1=await promptSelect(_0x4ebc77(0x1b2),_0x5643fb);_0x2d6ad0=_0x5643fb[_0x46a1e1]??_0x5643fb[0x0];}let _0x308577=normalizeHookFunctionNode(_0x5730d8['str'](_0x4ebc77(0x174)));if(!_0x308577){if(_0x5730d8[_0x4ebc77(0x19f)](_0x4ebc77(0x174)))throw CliErrors['validation'](_0x4ebc77(0x19b));if(_0x5730d8[_0x4ebc77(0x18e)])throw CliErrors[_0x4ebc77(0x1ad)](_0x4ebc77(0x16d));const _0x5e549d=await promptSelect(_0x4ebc77(0x1af),[_0x4ebc77(0x19a),_0x4ebc77(0x195)]);_0x308577=[_0x4ebc77(0x19a),_0x4ebc77(0x195)][_0x5e549d]??_0x4ebc77(0x19a);}return{'alias':_0x41dece,'datasetCode':_0x5f3270,'datasetId':_0x3884a6,'operationType':_0x2d6ad0,'functionNode':_0x308577};}async function promptSelect(_0x14def4,_0x2de609){const _0x573b87=a30_0x44d0ac;if(_0x2de609[_0x573b87(0x1aa)]===0x1)return 0x0;for(const [_0x2e1e4,_0x3a4ed2]of _0x2de609['entries']()){process[_0x573b87(0x1c0)][_0x573b87(0x16f)]('\x20\x20'+(_0x2e1e4+0x1)+'.\x20'+_0x3a4ed2+'\x0a');}const _0x5584d4=createInterface({'input':process[_0x573b87(0x1a3)],'output':process[_0x573b87(0x1c0)]});while(!![]){const _0x5a6ab2=await new Promise(_0x209593=>{const _0x11a006=_0x573b87;_0x5584d4[_0x11a006(0x1a9)](_0x14def4+'\x20',_0x209593);}),_0xc7e02f=Number['parseInt'](_0x5a6ab2[_0x573b87(0x16b)](),0xa);if(Number[_0x573b87(0x179)](_0xc7e02f)&&_0xc7e02f>=0x1&&_0xc7e02f<=_0x2de609['length'])return _0x5584d4['close'](),_0xc7e02f-0x1;process[_0x573b87(0x1c0)][_0x573b87(0x16f)](_0x573b87(0x182)+_0x2de609[_0x573b87(0x1aa)]+'.\x0a');}}function buildFilePath(_0x3fd8e0,_0x4b92f9,_0x3cf99a,_0x4c5ba5){const _0x4c3e7e=a30_0x44d0ac;if(_0x4b92f9==='HOOK'){if(!_0x4c5ba5)throw CliErrors['validation'](_0x4c3e7e(0x18a));const _0x2096ae=_0x4c5ba5['alias']??_0x4c5ba5['datasetCode'];return join(_0x3fd8e0[_0x4c3e7e(0x176)],'HOOK',_0x2096ae,_0x4c5ba5[_0x4c3e7e(0x16e)],_0x4c5ba5[_0x4c3e7e(0x1a0)],_0x3cf99a+_0x4c3e7e(0x186));}return join(_0x3fd8e0[_0x4c3e7e(0x176)],_0x4b92f9,_0x3cf99a+_0x4c3e7e(0x186));}export function generateTemplate(_0x554255,_0xc7fae4,_0x11dd8d,_0x542d20,_0x382981){const _0x2f8c45=a30_0x44d0ac,_0xc02712=_0x542d20?.[_0x2f8c45(0x16b)]()||'TODO:\x20add\x20script\x20description';if(_0x554255===_0x2f8c45(0x19d))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0xc02712+_0x2f8c45(0x16c)+_0xc7fae4+_0x2f8c45(0x178)+_0xc7fae4+'.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0xc7fae4+_0x2f8c45(0x199);if(_0x554255===_0x2f8c45(0x1b1))return _0x2f8c45(0x1bf)+_0xc02712+_0x2f8c45(0x19e)+_0x11dd8d+'/'+_0xc7fae4+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0xc7fae4+_0x2f8c45(0x199);if(!_0x382981)throw CliErrors[_0x2f8c45(0x1ad)](_0x2f8c45(0x1a8));return _0x2f8c45(0x189)+_0xc02712+_0x2f8c45(0x1ac)+_0x11dd8d+'/'+_0x382981[_0x2f8c45(0x17d)]+'/'+_0x382981['operationType']+_0x2f8c45(0x198)+_0x382981[_0x2f8c45(0x1a0)]+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0xc7fae4+_0x2f8c45(0x199);}
|
|
1
|
+
const a30_0x3b6fd3=a30_0x304e;(function(_0x3c3a72,_0x353438){const _0x2fdc80=a30_0x304e,_0x456061=_0x3c3a72();while(!![]){try{const _0x2d590e=parseInt(_0x2fdc80(0xf8))/0x1*(-parseInt(_0x2fdc80(0xcc))/0x2)+-parseInt(_0x2fdc80(0x100))/0x3*(parseInt(_0x2fdc80(0xfd))/0x4)+-parseInt(_0x2fdc80(0xf0))/0x5*(-parseInt(_0x2fdc80(0xf5))/0x6)+-parseInt(_0x2fdc80(0x114))/0x7*(parseInt(_0x2fdc80(0xcf))/0x8)+-parseInt(_0x2fdc80(0x106))/0x9+-parseInt(_0x2fdc80(0xd7))/0xa+parseInt(_0x2fdc80(0xf7))/0xb;if(_0x2d590e===_0x353438)break;else _0x456061['push'](_0x456061['shift']());}catch(_0x54e266){_0x456061['push'](_0x456061['shift']());}}}(a30_0x3223,0x811a0));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a30_0x3223(){const _0x57aae7=['--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Available\x20aliases:\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','question','string','scriptsRootDir','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','length','trim','No\x20datasets\x20found\x20for\x20this\x20app.','read','\x0a\x20*\x20[平台配置]\x20','functionNode','Select\x20dataset:','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','alias','/data/dataset/','create','stderr','/HOOK/','apiDir','HOOK\x20requires\x20alias/operation/node\x20options.','\x22\x20not\x20found.\x20','5450AqBDUe','code','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','1521944XfUIEt','str','appCode','No\x20api.ts\x20found.\x20Run\x20`','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','operationType','Function\x20name\x20(valid\x20JS\x20identifier)','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','10346920RunuWt','Select\x20trigger\x20node:','.js\x0a\x20*\x20[触发节点]\x20','修改后的请求参数','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x20function:\x20','type','isInteger','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','当前请求参数','Operation\x20type\x20\x22','description','after','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20*\x20[依赖数据集]\x20无(如有依赖,填写数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20类型与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','source','ENDPOINT','stdin','HOOK','/ENDPOINT/','before','function-node','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','name','3154245lXYgWN','当前响应结果','join','datasetCode','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','6pMfygV','datasetcode','27633056UNgMmR','60kssXWY','write','validation','Alias\x20\x22','tableName','97072OLGDsg','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','datasetId','66QmqDec','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Script\x20description','nonInteractive','File\x20already\x20exists:\x20',']\x20(','2801952gtseuX','COMMON','bff','find','close','Trigger\x20node\x20(HOOK\x20only)','修改后的响应结果','/**\x0a\x20*\x20','/COMMON/','\x22,\x20params\x20})\x0a','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','map','UNKNOWN','operation-type','21FkJard','\x20api\x20pull`\x20to\x20refresh.','Invalid\x20dataset\x20selection.'];a30_0x3223=function(){return _0x57aae7;};return a30_0x3223();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a30_0x3b6fd3(0x108),'command':a30_0x3b6fd3(0xc6),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a30_0x3b6fd3(0xbf),'flags':[{'name':a30_0x3b6fd3(0xdd),'type':a30_0x3b6fd3(0xb8),'required':!![],'enum':['COMMON','ENDPOINT',a30_0x3b6fd3(0xea)],'description':a30_0x3b6fd3(0xbb)},{'name':a30_0x3b6fd3(0xef),'type':a30_0x3b6fd3(0xb8),'required':!![],'description':a30_0x3b6fd3(0xd5)},{'name':a30_0x3b6fd3(0xe2),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0x102)},{'name':a30_0x3b6fd3(0xc4),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0xdb)},{'name':a30_0x3b6fd3(0xf6),'type':a30_0x3b6fd3(0xb8),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x3b6fd3(0x113),'type':a30_0x3b6fd3(0xb8),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a30_0x3b6fd3(0xed),'type':a30_0x3b6fd3(0xb8),'description':a30_0x3b6fd3(0x10b),'enum':['before',a30_0x3b6fd3(0xe3)]}],async 'validate'(_0x59d188){const _0x449527=a30_0x3b6fd3,_0x1bce1d=_0x59d188[_0x449527(0xd0)](_0x449527(0xef));if(!isValidBffFunctionName(_0x1bce1d))throw CliErrors[_0x449527(0xfa)]('Invalid\x20function\x20name\x20\x22'+_0x1bce1d+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x103d3c){const _0xdaf5d4=a30_0x3b6fd3,_0x5396db=loadBffProjectConfig(_0x103d3c[_0xdaf5d4(0xd1)]),_0x276566=_0x103d3c['str']('type'),_0x4e18ee=_0x103d3c[_0xdaf5d4(0xd0)](_0xdaf5d4(0xef)),_0x5416d6=_0x103d3c[_0xdaf5d4(0xd0)]('description')||undefined,_0x3c5dc8=_0x276566==='HOOK'?await resolveHookOptions(_0x5396db,_0x103d3c):undefined,_0x6ff50b=buildFilePath(_0x5396db,_0x276566,_0x4e18ee,_0x3c5dc8);if(await fileExists(_0x6ff50b))throw CliErrors[_0xdaf5d4(0xfa)](_0xdaf5d4(0x104)+_0x6ff50b);await mkdir(dirname(_0x6ff50b),{'recursive':!![]});const _0x3212e4=generateTemplate(_0x276566,_0x4e18ee,_0x103d3c['appCode'],_0x5416d6,_0x3c5dc8);await writeFile(_0x6ff50b,_0x3212e4,'utf8');const _0x196e75={'type':_0x276566,'name':_0x4e18ee,'path':_0x6ff50b};if(_0x5416d6)_0x196e75['description']=_0x5416d6;if(_0x3c5dc8){if(_0x3c5dc8[_0xdaf5d4(0xc4)])_0x196e75['alias']=_0x3c5dc8[_0xdaf5d4(0xc4)];_0x196e75['datasetCode']=_0x3c5dc8[_0xdaf5d4(0xf3)],_0x196e75[_0xdaf5d4(0xd4)]=_0x3c5dc8['operationType'],_0x196e75['functionNode']=_0x3c5dc8[_0xdaf5d4(0xc1)];}return{'ok':!![],'data':_0x196e75,'message':'Created\x20'+_0x276566+_0xdaf5d4(0xdc)+_0x4e18ee};}};async function resolveHookOptions(_0x58f2f5,_0x20ff16){const _0x76d373=a30_0x3b6fd3,_0x54c44a=loadAliasMap(_0x20ff16[_0x76d373(0xc9)],undefined,resolveApiFilePath(_0x20ff16[_0x76d373(0xc9)],_0x20ff16[_0x76d373(0xd1)])),_0xed26b=_0x54c44a[_0x76d373(0xbc)]>0x0;let _0x1014e9,_0x3107a5,_0x2f719c;const _0xa0d2fd=_0x20ff16['str'](_0x76d373(0xc4)),_0x4682d9=_0x20ff16[_0x76d373(0xd0)](_0x76d373(0xf6));if(_0xa0d2fd){const _0x4d1a21=resolveAlias(_0x20ff16['apiDir'],_0xa0d2fd,undefined,resolveApiFilePath(_0x20ff16[_0x76d373(0xc9)],_0x20ff16[_0x76d373(0xd1)]));if(!_0x4d1a21){const _0x45608d=_0xed26b?_0x76d373(0x118)+_0x54c44a[_0x76d373(0x111)](_0x145a65=>_0x145a65[_0x76d373(0xc4)])[_0x76d373(0xf2)](',\x20'):_0x76d373(0xd2)+CLI_BIN_NAME+_0x76d373(0xce);throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xfb)+_0xa0d2fd+_0x76d373(0xcb)+_0x45608d);}_0x1014e9=_0xa0d2fd,_0x3107a5=_0x4d1a21;}else{if(_0x4682d9){_0x3107a5=_0x4682d9;const _0x2e7df0=_0x54c44a[_0x76d373(0x109)](_0x1f4448=>_0x1f4448['datasetCode']===_0x4682d9);_0x1014e9=_0x2e7df0?.[_0x76d373(0xc4)];}else{if(_0x20ff16['nonInteractive'])throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xe4));else{if(_0xed26b){const _0x356be9=_0x54c44a[_0x76d373(0x111)](_0x36ce56=>_0x36ce56['alias']+'\x20('+_0x36ce56[_0x76d373(0xfc)]+')'),_0x4e4db8=await promptSelect(_0x76d373(0xc2),_0x356be9),_0x5a880e=_0x54c44a[_0x4e4db8];if(!_0x5a880e)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x116));_0x1014e9=_0x5a880e[_0x76d373(0xc4)],_0x3107a5=_0x5a880e['datasetCode'];}else{const _0x197370=await listDatasets(_0x20ff16[_0x76d373(0xd1)]);if(_0x197370['length']===0x0)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xbe));const _0x43bc0d=_0x197370[_0x76d373(0x111)](_0x22b818=>_0x22b818[_0x76d373(0xef)]+'\x20['+(_0x22b818[_0x76d373(0xe7)]??_0x76d373(0x112))+_0x76d373(0x105)+_0x22b818[_0x76d373(0xcd)]+')'),_0x2d4071=await promptSelect('Select\x20dataset:',_0x43bc0d),_0x4f1869=_0x197370[_0x2d4071];if(!_0x4f1869)throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x116));_0x3107a5=_0x4f1869[_0x76d373(0xcd)],_0x1014e9=undefined;}}}}const _0x1cdeaa=await listDatasets(_0x20ff16[_0x76d373(0xd1)]),_0x2e696b=_0x1cdeaa[_0x76d373(0x109)](_0x506692=>_0x506692[_0x76d373(0xcd)]===_0x3107a5);if(!_0x2e696b)throw CliErrors[_0x76d373(0xfa)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x3107a5+'\x22.\x20'+(_0x1014e9?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x76d373(0x115):''));_0x2f719c=_0x2e696b['id'];const _0x4b6f0b=_0x1014e9??_0x3107a5,_0x364171=await listBffDatasetOperations(_0x20ff16[_0x76d373(0xd1)],_0x2f719c),_0x13d758=_0x364171?Object['keys'](_0x364171):[];if(_0x13d758['length']===0x0)throw CliErrors[_0x76d373(0xfa)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x4b6f0b+'.');let _0x380d04;const _0x3acd58=_0x20ff16[_0x76d373(0xd0)](_0x76d373(0x113));if(_0x3acd58){if(!_0x13d758['includes'](_0x3acd58))throw CliErrors[_0x76d373(0xfa)](_0x76d373(0xe1)+_0x3acd58+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x4b6f0b+'.\x20'+('Available:\x20'+_0x13d758['join'](',\x20')));_0x380d04=_0x3acd58;}else{if(_0x20ff16['nonInteractive'])throw CliErrors['validation'](_0x76d373(0xba));const _0x14b03f=await promptSelect('Select\x20operation\x20type:',_0x13d758);_0x380d04=_0x13d758[_0x14b03f]??_0x13d758[0x0];}let _0x28b7a5=normalizeHookFunctionNode(_0x20ff16[_0x76d373(0xd0)](_0x76d373(0xed)));if(!_0x28b7a5){if(_0x20ff16['str']('function-node'))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x20ff16[_0x76d373(0x103)])throw CliErrors[_0x76d373(0xfa)](_0x76d373(0x117));const _0x806277=await promptSelect(_0x76d373(0xd8),[_0x76d373(0xec),_0x76d373(0xe3)]);_0x28b7a5=['before',_0x76d373(0xe3)][_0x806277]??_0x76d373(0xec);}return{'alias':_0x1014e9,'datasetCode':_0x3107a5,'datasetId':_0x2f719c,'operationType':_0x380d04,'functionNode':_0x28b7a5};}async function promptSelect(_0x34e87f,_0x36f571){const _0x4b7d1c=a30_0x3b6fd3;if(_0x36f571['length']===0x1)return 0x0;for(const [_0x4239bd,_0x3ec8c4]of _0x36f571['entries']()){process[_0x4b7d1c(0xc7)]['write']('\x20\x20'+(_0x4239bd+0x1)+'.\x20'+_0x3ec8c4+'\x0a');}const _0x5c1de2=createInterface({'input':process[_0x4b7d1c(0xe9)],'output':process[_0x4b7d1c(0xc7)]});while(!![]){const _0x234f77=await new Promise(_0x1437ec=>{const _0x52d3c1=_0x4b7d1c;_0x5c1de2[_0x52d3c1(0x11a)](_0x34e87f+'\x20',_0x1437ec);}),_0x4eed71=Number['parseInt'](_0x234f77['trim'](),0xa);if(Number[_0x4b7d1c(0xde)](_0x4eed71)&&_0x4eed71>=0x1&&_0x4eed71<=_0x36f571['length'])return _0x5c1de2[_0x4b7d1c(0x10a)](),_0x4eed71-0x1;process[_0x4b7d1c(0xc7)][_0x4b7d1c(0xf9)](_0x4b7d1c(0x119)+_0x36f571['length']+'.\x0a');}}function a30_0x304e(_0x2be7c6,_0x6face9){_0x2be7c6=_0x2be7c6-0xb8;const _0x322397=a30_0x3223();let _0x304e32=_0x322397[_0x2be7c6];return _0x304e32;}function buildFilePath(_0x27602a,_0x306abe,_0x52a69f,_0x47fb1a){const _0x28f1f=a30_0x3b6fd3;if(_0x306abe===_0x28f1f(0xea)){if(!_0x47fb1a)throw CliErrors[_0x28f1f(0xfa)](_0x28f1f(0xca));const _0x5f37a3=_0x47fb1a[_0x28f1f(0xc4)]??_0x47fb1a[_0x28f1f(0xf3)];return join(_0x27602a['scriptsRootDir'],'HOOK',_0x5f37a3,_0x47fb1a[_0x28f1f(0xd4)],_0x47fb1a[_0x28f1f(0xc1)],_0x52a69f+'.js');}return join(_0x27602a[_0x28f1f(0xb9)],_0x306abe,_0x52a69f+'.js');}export function generateTemplate(_0x49a51c,_0x55e92a,_0x55efa9,_0x2d190f,_0x1a6c57){const _0xdb21f=a30_0x3b6fd3,_0x155805=_0x2d190f?.[_0xdb21f(0xbd)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x253207=getAppBaseUrl(_0x55efa9),_0x46ae0d=_0xdb21f(0xe5);if(_0x49a51c===_0xdb21f(0x107))return _0xdb21f(0x10d)+_0x155805+_0xdb21f(0x110)+_0x55e92a+_0xdb21f(0xc0)+_0x253207+_0xdb21f(0xd6)+_0x55efa9+_0xdb21f(0x10e)+_0x55e92a+_0xdb21f(0xd3)+_0x55e92a+_0xdb21f(0x10f)+_0x46ae0d+_0xdb21f(0xdf)+_0x55e92a+_0xdb21f(0xe6);if(_0x49a51c===_0xdb21f(0xe8))return _0xdb21f(0x10d)+_0x155805+_0xdb21f(0xc3)+_0x55e92a+_0xdb21f(0xee)+_0x55efa9+'/'+_0x55e92a+'\x0a\x20*\x20[平台配置]\x20'+_0x253207+_0xdb21f(0xd6)+_0x55efa9+_0xdb21f(0xeb)+_0x55e92a+'.js\x0a'+_0x46ae0d+_0xdb21f(0x101)+_0x55e92a+_0xdb21f(0xe6);if(!_0x1a6c57)throw CliErrors[_0xdb21f(0xfa)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x163f52=_0x1a6c57[_0xdb21f(0xc4)]??_0x1a6c57[_0xdb21f(0xf3)],_0xc013d8=_0x1a6c57['functionNode']===_0xdb21f(0xec)?_0xdb21f(0xe0):_0xdb21f(0xf1),_0x284b00=_0x1a6c57[_0xdb21f(0xc1)]===_0xdb21f(0xec)?_0xdb21f(0xda):_0xdb21f(0x10c);return'/**\x0a\x20*\x20'+_0x155805+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x55e92a+_0xdb21f(0xfe)+_0x55efa9+'/'+_0x1a6c57[_0xdb21f(0xf3)]+'/'+_0x1a6c57[_0xdb21f(0xd4)]+'\x0a\x20*\x20[平台配置]\x20'+_0x253207+_0xdb21f(0xc5)+_0x1a6c57[_0xdb21f(0xff)]+_0xdb21f(0xf4)+_0x55efa9+_0xdb21f(0xc8)+_0x163f52+'/'+_0x1a6c57[_0xdb21f(0xd4)]+'/'+_0x1a6c57['functionNode']+'/'+_0x55e92a+_0xdb21f(0xd9)+_0x1a6c57['functionNode']+'\x0a'+_0x46ae0d+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0xc013d8+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x284b00+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x55e92a+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x315e(_0x5d6706,_0x551e2b){_0x5d6706=_0x5d6706-0x98;const _0x214c2c=a31_0x214c();let _0x315e66=_0x214c2c[_0x5d6706];return _0x315e66;}const a31_0x5b1168=a31_0x315e;(function(_0xff048b,_0x58e84e){const _0x1f3847=a31_0x315e,_0xd6f667=_0xff048b();while(!![]){try{const _0x31b9ed=parseInt(_0x1f3847(0xc4))/0x1+parseInt(_0x1f3847(0xc2))/0x2*(-parseInt(_0x1f3847(0xb1))/0x3)+-parseInt(_0x1f3847(0xbc))/0x4*(parseInt(_0x1f3847(0x9c))/0x5)+-parseInt(_0x1f3847(0xce))/0x6+-parseInt(_0x1f3847(0x99))/0x7+parseInt(_0x1f3847(0xc0))/0x8*(parseInt(_0x1f3847(0xaa))/0x9)+-parseInt(_0x1f3847(0xae))/0xa*(-parseInt(_0x1f3847(0xbf))/0xb);if(_0x31b9ed===_0x58e84e)break;else _0xd6f667['push'](_0xd6f667['shift']());}catch(_0x354685){_0xd6f667['push'](_0xd6f667['shift']());}}}(a31_0x214c,0xc2b30));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_0x5b1168(0x9e),'command':a31_0x5b1168(0xc8),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x5b1168(0xa4),'flags':[{'name':a31_0x5b1168(0xa3),'type':a31_0x5b1168(0x9f),'required':!![],'description':a31_0x5b1168(0xbd)}],async 'validate'(_0x1b3f5b){const _0x883146=a31_0x5b1168,_0x5069e7=loadBffProjectConfig(_0x1b3f5b['appCode']),_0x27ae82=await readBffLockFile(_0x5069e7[_0x883146(0xb6)]);if(!_0x27ae82)throw CliErrors[_0x883146(0xbe)](_0x883146(0xbb));},async 'dryRun'(_0x271484){const _0x16f4ee=a31_0x5b1168,_0x479c26=loadBffProjectConfig(_0x271484[_0x16f4ee(0xac)]),_0x25a6c7=await readBffLockFile(_0x479c26['lockFilePath']);if(!_0x25a6c7)throw CliErrors[_0x16f4ee(0xbe)](_0x16f4ee(0xc6));const {appLock:_0x3ee5f9}=ensureLockScope(_0x25a6c7,_0x271484[_0x16f4ee(0xac)],_0x479c26[_0x16f4ee(0x98)],_0x16f4ee(0xc8)),_0x575050=_0x271484[_0x16f4ee(0xca)](_0x16f4ee(0xa3)),_0x208551=Object[_0x16f4ee(0xa2)](_0x3ee5f9[_0x16f4ee(0xc7)]),_0x32b905=resolveDeleteTarget(_0x575050,_0x208551),_0x411447=_0x3ee5f9[_0x16f4ee(0xc7)][_0x32b905];if(!_0x411447)throw CliErrors['validation'](_0x16f4ee(0xba)+_0x32b905+'\x22.');const _0x440a5e=resolveLocalFilePathFromLockKey(_0x479c26,_0x32b905),_0x525eac=relative(_0x479c26[_0x16f4ee(0x9b)],_0x440a5e),_0x2c0dbc=join(_0x479c26[_0x16f4ee(0xa1)],_0x16f4ee(0xaf),_0x525eac);return{'method':_0x16f4ee(0xa8),'url':_0x16f4ee(0xa6),'body':{'appCode':_0x271484['appCode'],'target':_0x32b905,'remoteId':_0x411447['remoteId'],'localFilePath':_0x440a5e,'trashedPath':_0x2c0dbc},'description':'Would\x20delete\x20'+_0x32b905+_0x16f4ee(0xad)};},async 'execute'(_0x5431b0){const _0x1a3a0e=a31_0x5b1168,_0xd558b5=loadBffProjectConfig(_0x5431b0[_0x1a3a0e(0xac)]),_0x3033ee=await readBffLockFile(_0xd558b5[_0x1a3a0e(0xb6)]);if(!_0x3033ee)throw CliErrors[_0x1a3a0e(0xbe)](_0x1a3a0e(0xc6));const {lockData:_0x22f401,appLock:_0x92e660}=ensureLockScope(_0x3033ee,_0x5431b0['appCode'],_0xd558b5[_0x1a3a0e(0x98)],_0x1a3a0e(0xc8)),_0x40fb52=JSON[_0x1a3a0e(0xb0)](JSON[_0x1a3a0e(0xb2)](_0x22f401)),_0x3ea4d5=_0x40fb52[_0x1a3a0e(0xc5)][_0x5431b0[_0x1a3a0e(0xac)]];if(!_0x3ea4d5)throw new Error(_0x1a3a0e(0xcb)+_0x5431b0[_0x1a3a0e(0xac)]+_0x1a3a0e(0x9a));const _0x4ddebf=_0x5431b0[_0x1a3a0e(0xca)]('target'),_0xe05882=Object[_0x1a3a0e(0xa2)](_0x3ea4d5[_0x1a3a0e(0xc7)]),_0x1a9dda=resolveDeleteTarget(_0x4ddebf,_0xe05882),_0x2ea661=_0x3ea4d5['functions'][_0x1a9dda];if(!_0x2ea661)throw CliErrors[_0x1a3a0e(0xbe)](_0x1a3a0e(0xba)+_0x1a9dda+'\x22.');await deleteBffScript(_0x2ea661['remoteId']),delete _0x3ea4d5[_0x1a3a0e(0xc7)][_0x1a9dda],_0x3ea4d5[_0x1a3a0e(0xb3)]=new Date()[_0x1a3a0e(0xcd)](),await writeBffLockFile(_0xd558b5['lockFilePath'],_0x40fb52);const _0x38ef46=resolveLocalFilePathFromLockKey(_0xd558b5,_0x1a9dda);let _0x5c913d;await fileExists(_0x38ef46)&&(_0x5c913d=await moveToTrash(_0xd558b5[_0x1a3a0e(0x9b)],_0xd558b5[_0x1a3a0e(0xa1)],_0x38ef46),await cleanupEmptyDirectories(dirname(_0x38ef46),_0xd558b5[_0x1a3a0e(0xa5)]));await waitForDeleteSettlement(_0xd558b5[_0x1a3a0e(0xb6)],_0x5431b0[_0x1a3a0e(0xac)],_0x1a9dda,_0x38ef46),await sleep(0x96);const _0x4e30a9={'deleted':_0x1a9dda,'remoteId':_0x2ea661[_0x1a3a0e(0xb8)]};if(_0x5c913d)_0x4e30a9['trashedTo']=_0x5c913d;return{'ok':!![],'data':_0x4e30a9,'message':'Deleted\x20'+_0x1a9dda+(_0x5c913d?_0x1a3a0e(0xa0):'')};}};function resolveDeleteTarget(_0x169e7e,_0x1201cc){const _0x4bb2e2=a31_0x5b1168;if(_0x169e7e['includes']('/')){const _0x3e4259=_0x1201cc['find'](_0x548bd3=>_0x548bd3===_0x169e7e);if(!_0x3e4259)throw CliErrors[_0x4bb2e2(0xbe)](_0x4bb2e2(0xa9)+_0x169e7e);return _0x3e4259;}const _0x206f26=_0x1201cc[_0x4bb2e2(0xcc)](_0x968b34=>_0x968b34[_0x4bb2e2(0xab)]('/')['at'](-0x1)===_0x169e7e);if(_0x206f26['length']===0x0)throw CliErrors['validation'](_0x4bb2e2(0xa9)+_0x169e7e);if(_0x206f26[_0x4bb2e2(0xa7)]>0x1)throw CliErrors[_0x4bb2e2(0xbe)](_0x4bb2e2(0xc3)+_0x169e7e+_0x4bb2e2(0xb4)+_0x206f26[_0x4bb2e2(0xb5)](_0x59053f=>_0x4bb2e2(0xb7)+_0x59053f)[_0x4bb2e2(0xc1)]('\x0a'));return _0x206f26[0x0];}function a31_0x214c(){const _0x52f618=['\x22\x20not\x20found\x20after\x20ensureLockScope.','projectRoot','15KJfvvY','replace','bff','string','\x20(local\x20file\x20moved\x20to\x20trash)','trashDir','keys','target','high-risk-write','scriptsRootDir','/api/management/library/scripts/delete','length','POST','Function\x20not\x20found:\x20','9qoeyOJ','split','appCode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','230WqMmax','<timestamp>','parse','60786hgIGkY','stringify','lastSync','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','map','lockFilePath','\x20\x20-\x20','remoteId','startsWith','No\x20lock\x20entry\x20found\x20for\x20\x22','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','1071068kfFVLz','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','validation','705397bogMgv','12231472kKQcWA','join','138GXPHmd','Multiple\x20functions\x20match\x20\x22','725230rEmxMO','apps','BFF\x20lock\x20file\x20not\x20found.','functions','delete','Local\x20delete\x20not\x20settled\x20for\x20','str','Lock\x20scope\x20for\x20app\x20\x22','filter','toISOString','3773928SMoiOh','scriptsRoot','708610FMZuXe'];a31_0x214c=function(){return _0x52f618;};return a31_0x214c();}async function moveToTrash(_0x34a2d3,_0x16640e,_0x19a9fe){const _0x5dbc9e=a31_0x5b1168,_0x1cca80=new Date()[_0x5dbc9e(0xcd)]()[_0x5dbc9e(0x9d)](/[:.]/g,'-'),_0x415636=relative(_0x34a2d3,_0x19a9fe),_0x23bb6d=join(_0x16640e,_0x1cca80,_0x415636);return await mkdir(dirname(_0x23bb6d),{'recursive':!![]}),await rename(_0x19a9fe,_0x23bb6d),_0x23bb6d;}async function cleanupEmptyDirectories(_0x771f7,_0x41983e){const _0x14e8aa=a31_0x5b1168;let _0x2bbda0=resolve(_0x771f7);const _0x525a22=resolve(_0x41983e);while(_0x2bbda0[_0x14e8aa(0xb9)](''+_0x525a22+sep)||_0x2bbda0===_0x525a22){if(_0x2bbda0===_0x525a22)return;try{const _0x159841=await readdir(_0x2bbda0);if(_0x159841['length']>0x0)return;await rmdir(_0x2bbda0);}catch{return;}_0x2bbda0=dirname(_0x2bbda0);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x2404a7,_0x528a80,_0x249805,_0x1cc324){const _0x10e784=a31_0x5b1168;for(let _0x3e61b1=0x0;_0x3e61b1<DELETE_SETTLE_RETRY_COUNT;_0x3e61b1+=0x1){const _0x424346=await readBffLockFile(_0x2404a7),_0xb37d54=!!_0x424346?.[_0x10e784(0xc5)]?.[_0x528a80]?.['functions']?.[_0x249805],_0x82bc4a=await fileExists(_0x1cc324);if(!_0xb37d54&&!_0x82bc4a)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x10e784(0xc9)+_0x249805+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x5afb(){const _0x4ee55a=['28444XdPYsF','number','2885376HkfcXO','scriptType','updateUserName','487094srzDtq','read','createdTime','Return\x20full\x20raw\x20script\x20object','Get\x20BFF\x20script\x20details\x20by\x20ID','verbose','11250UZvsQW','(none)','816JpEeBS','946952ZPQnzZ','2064097rbbqnn','appCode','description','functionName','version','scriptContent','boolean','746391PBGBOO','Script\x20ID','bool','updatedTime'];a32_0x5afb=function(){return _0x4ee55a;};return a32_0x5afb();}const a32_0x3974cb=a32_0x5c4f;(function(_0x1427b1,_0x10f7b3){const _0x4ec1e7=a32_0x5c4f,_0x4bd25e=_0x1427b1();while(!![]){try{const _0x23b882=parseInt(_0x4ec1e7(0x1ef))/0x1+-parseInt(_0x4ec1e7(0x1f4))/0x2+parseInt(_0x4ec1e7(0x1eb))/0x3+-parseInt(_0x4ec1e7(0x1fd))/0x4+parseInt(_0x4ec1e7(0x1fa))/0x5*(parseInt(_0x4ec1e7(0x1fc))/0x6)+-parseInt(_0x4ec1e7(0x1fe))/0x7+parseInt(_0x4ec1e7(0x1f1))/0x8;if(_0x23b882===_0x10f7b3)break;else _0x4bd25e['push'](_0x4bd25e['shift']());}catch(_0x56bc99){_0x4bd25e['push'](_0x4bd25e['shift']());}}}(a32_0x5afb,0x29335));import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x5c4f(_0x110c75,_0x27b1ed){_0x110c75=_0x110c75-0x1e9;const _0x5afb3a=a32_0x5afb();let _0x5c4fc8=_0x5afb3a[_0x110c75];return _0x5c4fc8;}export const bffDetail={'service':'bff','command':'detail','description':a32_0x3974cb(0x1f8),'risk':a32_0x3974cb(0x1f5),'flags':[{'name':'id','type':a32_0x3974cb(0x1f0),'required':!![],'description':a32_0x3974cb(0x1ec)},{'name':a32_0x3974cb(0x1f9),'type':a32_0x3974cb(0x1ea),'description':a32_0x3974cb(0x1f7)}],async 'execute'(_0x227310){const _0x1bb760=a32_0x3974cb,_0x589a80=await getBffScriptInfo(_0x227310['num']('id')),_0x369222=_0x227310[_0x1bb760(0x1ed)]('verbose');if(_0x369222)return{'ok':!![],'data':_0x589a80};return{'ok':!![],'data':{'id':_0x589a80['id'],'functionName':_0x589a80[_0x1bb760(0x201)]??'','version':_0x589a80[_0x1bb760(0x202)]??'','updateUserName':_0x589a80[_0x1bb760(0x1f3)]??'','appCode':_0x589a80[_0x1bb760(0x1ff)],'scriptType':_0x589a80[_0x1bb760(0x1f2)],'description':_0x589a80[_0x1bb760(0x200)]||_0x1bb760(0x1fb),'createdTime':_0x589a80[_0x1bb760(0x1f6)]??'','updatedTime':_0x589a80[_0x1bb760(0x1ee)]??'','scriptContent':_0x589a80[_0x1bb760(0x1e9)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a85a4,_0x26026e){const _0xf37f56=a33_0x32be,_0x3f8a30=_0x3a85a4();while(!![]){try{const _0x5a45ce=parseInt(_0xf37f56(0x121))/0x1*(parseInt(_0xf37f56(0x11e))/0x2)+parseInt(_0xf37f56(0x11d))/0x3+parseInt(_0xf37f56(0x11f))/0x4*(parseInt(_0xf37f56(0x11a))/0x5)+-parseInt(_0xf37f56(0x123))/0x6*(parseInt(_0xf37f56(0x11c))/0x7)+parseInt(_0xf37f56(0x122))/0x8+-parseInt(_0xf37f56(0x120))/0x9+-parseInt(_0xf37f56(0x11b))/0xa;if(_0x5a45ce===_0x26026e)break;else _0x3f8a30['push'](_0x3f8a30['shift']());}catch(_0x476a0c){_0x3f8a30['push'](_0x3f8a30['shift']());}}}(a33_0x28d1,0x9b6ef));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a33_0x32be(_0x32f0db,_0xfae5f8){_0x32f0db=_0x32f0db-0x11a;const _0x28d163=a33_0x28d1();let _0x32be5e=_0x28d163[_0x32f0db];return _0x32be5e;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];function a33_0x28d1(){const _0x53709f=['1837778ZBVHvE','20DLVXWF','5955309MUyTjE','1dHlIpr','5841136sDjgqg','1092282gwjQQN','1156300PiytBj','6200740wVOEPc','35GBfDVc','70002uxtOCc'];a33_0x28d1=function(){return _0x53709f;};return a33_0x28d1();}
|