@lovrabet/rabetbase-cli 2.5.2-beta.3 → 2.5.2-beta.5
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 +1 -1
- 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/api/generate-sdk-config-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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/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-restore.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/dataset/user-deleted-field-list.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/table-diff-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/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.d.ts +0 -8
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.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/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.d.ts +4 -0
- 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/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +5 -1
- package/lib/config/project-domain-routing.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.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 +0 -26
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.d.ts +43 -0
- 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/supported-flags.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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.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.d.ts +6 -5
- package/lib/utils/platform.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 +2 -1
- package/skills/rabetbase/SKILL.md +5 -5
- package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
- package/skills/rabetbase/guides/page-development-workflow.md +1 -1
- package/skills/rabetbase/knowledge/components.md +292 -0
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
- package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
- package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
- package/skills/rabetbase/references/rabetbase-run.md +1 -0
- package/skills/rabetbase.manifest.json +5 -4
- package/templates/README.md +10 -4
- package/templates/custom-pages/blank.json +5 -0
- package/templates/custom-pages/dashboard.json +5 -0
- package/templates/custom-pages/onepage.json +5 -0
- package/templates/generate-api/api.ts.tpl +1 -1
- package/lib/commands/page/custom/template.d.ts +0 -8
- package/lib/commands/page/custom/template.js +0 -1
- package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3affd3,_0x3a4e7b){const _0x5e1e1c=a18_0x550d,_0x6b9464=_0x3affd3();while(!![]){try{const _0x24cae3=parseInt(_0x5e1e1c(0x186))/0x1*(-parseInt(_0x5e1e1c(0x18a))/0x2)+parseInt(_0x5e1e1c(0x179))/0x3*(-parseInt(_0x5e1e1c(0x185))/0x4)+parseInt(_0x5e1e1c(0x183))/0x5*(parseInt(_0x5e1e1c(0x184))/0x6)+parseInt(_0x5e1e1c(0x189))/0x7+-parseInt(_0x5e1e1c(0x188))/0x8*(-parseInt(_0x5e1e1c(0x17d))/0x9)+-parseInt(_0x5e1e1c(0x18e))/0xa+parseInt(_0x5e1e1c(0x17a))/0xb*(parseInt(_0x5e1e1c(0x182))/0xc);if(_0x24cae3===_0x3a4e7b)break;else _0x6b9464['push'](_0x6b9464['shift']());}catch(_0x5e1d36){_0x6b9464['push'](_0x6b9464['shift']());}}}(a18_0x17d8,0x49c6c));function a18_0x17d8(){const _0x59167e=['6XmeQky','51804ajeGPU','85141GSoVSr','join','340568UGYXYh','2235492jgFGtd','4WazfPn','length','bool','App\x20\x22','3093200HOUsPk','global','3tWSRNU','5731PFyeco','merged','name','9tCkGsm','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','selectedAppName','filter','validation','1812VkOVvm','1770715mexWmC'];a18_0x17d8=function(){return _0x59167e;};return a18_0x17d8();}import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';function a18_0x550d(_0x28b7b8,_0x45338e){_0x28b7b8=_0x28b7b8-0x178;const _0x17d88a=a18_0x17d8();let _0x550d5c=_0x17d88a[_0x28b7b8];return _0x550d5c;}export function resolveTargetApps(_0x1cdf1a,_0x1b828a){const _0xab76b9=a18_0x550d;if(_0x1b828a)return null;const _0x32ffaf=_0x1cdf1a[_0xab76b9(0x18c)](_0xab76b9(0x178))?_0xab76b9(0x17b):'project';let _0x4ebf25=getMultiAppConfigs(_0x32ffaf);if(!_0x4ebf25||_0x4ebf25[_0xab76b9(0x18b)]===0x0)return null;if(_0x1cdf1a[_0xab76b9(0x17f)]){const _0xe2e73f=_0x4ebf25[_0xab76b9(0x180)](_0x539ede=>_0x539ede[_0xab76b9(0x17c)]===_0x1cdf1a['selectedAppName']);if(_0xe2e73f[_0xab76b9(0x18b)]===0x0){const _0x2e8359=_0x4ebf25['map'](_0x1b902c=>_0x1b902c['name'])[_0xab76b9(0x187)](',\x20');throw CliErrors[_0xab76b9(0x181)](_0xab76b9(0x18d)+_0x1cdf1a[_0xab76b9(0x17f)]+_0xab76b9(0x17e)+_0x2e8359);}_0x4ebf25=_0xe2e73f;}return _0x4ebf25;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x2bc8(){const _0x26a733=['73995rvVEsI','691558iRFqGy','8189140UCCgCv','8fWSVap','3uFUDOu','65HkhGUQ','2486476oFGcgY','4958406JFhaSl','8vioqEA','133026oVUfbv','23859616OgFKRW'];a19_0x2bc8=function(){return _0x26a733;};return a19_0x2bc8();}(function(_0x5d2bf5,_0x31a05c){const _0xcebdcc=a19_0x33d1,_0x97e51d=_0x5d2bf5();while(!![]){try{const _0x24fbce=-parseInt(_0xcebdcc(0xb0))/0x1*(-parseInt(_0xcebdcc(0xb3))/0x2)+parseInt(_0xcebdcc(0xa9))/0x3*(-parseInt(_0xcebdcc(0xab))/0x4)+-parseInt(_0xcebdcc(0xaa))/0x5*(-parseInt(_0xcebdcc(0xae))/0x6)+-parseInt(_0xcebdcc(0xb1))/0x7+parseInt(_0xcebdcc(0xad))/0x8*(-parseInt(_0xcebdcc(0xac))/0x9)+-parseInt(_0xcebdcc(0xb2))/0xa+parseInt(_0xcebdcc(0xaf))/0xb;if(_0x24fbce===_0x31a05c)break;else _0x97e51d['push'](_0x97e51d['shift']());}catch(_0xee1627){_0x97e51d['push'](_0x97e51d['shift']());}}}(a19_0x2bc8,0xa1dd6));function a19_0x33d1(_0x2e3829,_0xa6c2a4){_0x2e3829=_0x2e3829-0xa9;const _0x2bc8fe=a19_0x2bc8();let _0x33d1b3=_0x2bc8fe[_0x2e3829];return _0x33d1b3;}import{appListDefinition}from'../../commands/app/list.js';import{appMembersListDefinition}from'../../commands/app/members-list.js';export const appDefinitions=[appListDefinition,appMembersListDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x41f7(){const _0x4831be=['mergedCli','name','projectPath','1685476xZUkfV','578068gmKzLT','find','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','globalConfig','apps','appcode','globalPath','23293613udIypD','entries','No\x20apps\x20configured','push','5204405tJHszQ','5473436qcQaao','keys','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','optional','validation','merged','defaultApp','project','object','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','bool','7817370OAWlcb','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','\x20in\x20','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','boolean','projectConfig','global','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','length','isCurrent','remote','4961235AkdEqU'];a20_0x41f7=function(){return _0x4831be;};return a20_0x41f7();}const a20_0xf26084=a20_0x472e;(function(_0x5b3c77,_0x40d146){const _0x3aa829=a20_0x472e,_0x578c35=_0x5b3c77();while(!![]){try{const _0x2f0804=parseInt(_0x3aa829(0x10c))/0x1+parseInt(_0x3aa829(0x10b))/0x2+parseInt(_0x3aa829(0x107))/0x3+parseInt(_0x3aa829(0x118))/0x4+parseInt(_0x3aa829(0x117))/0x5+-parseInt(_0x3aa829(0xfc))/0x6+-parseInt(_0x3aa829(0x113))/0x7;if(_0x2f0804===_0x40d146)break;else _0x578c35['push'](_0x578c35['shift']());}catch(_0x385b1c){_0x578c35['push'](_0x578c35['shift']());}}}(a20_0x41f7,0xd04f5));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a20_0x472e(_0x554b1a,_0x3c4e4f){_0x554b1a=_0x554b1a-0xf8;const _0x41f789=a20_0x41f7();let _0x472ead=_0x41f789[_0x554b1a];return _0x472ead;}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(_0x18931c,_0x520e9){const _0x691f32=a20_0x472e,_0x365356=[],_0x575629=_0x18931c[_0x691f32(0x110)]&&typeof _0x18931c[_0x691f32(0x110)]===_0x691f32(0xf9)?_0x18931c[_0x691f32(0x110)]:{},_0x3cc806=_0x18931c['defaultApp']||undefined,_0x5ef27e=_0x3cc806??(Object[_0x691f32(0x119)](_0x575629)[_0x691f32(0x104)]===0x1?Object[_0x691f32(0x119)](_0x575629)[0x0]:undefined);for(const [_0x5e1e6a,_0x41b676]of Object[_0x691f32(0x114)](_0x575629)){if(!_0x41b676||typeof _0x41b676!==_0x691f32(0xf9)||!_0x41b676[_0x691f32(0x111)])continue;_0x365356[_0x691f32(0x116)]({'name':_0x5e1e6a,'appcode':_0x41b676[_0x691f32(0x111)],'named':!![],'definedIn':_0x520e9,'isDefault':_0x5e1e6a===_0x5ef27e,...buildAppProfileListFields(_0x41b676)});}return _0x365356;}function buildMergedItems(_0x427b1e,_0x374bfc){const _0x11e2b5=a20_0x472e,{apps:apps={}}=_0x427b1e,_0x24c8c1=_0x427b1e[_0x11e2b5(0x11e)],_0x1ba566=_0x24c8c1??(Object[_0x11e2b5(0x119)](apps)[_0x11e2b5(0x104)]===0x1?Object[_0x11e2b5(0x119)](apps)[0x0]:undefined),_0xddce34=_0x374bfc[_0x11e2b5(0x10f)][_0x11e2b5(0x110)]&&typeof _0x374bfc['globalConfig']['apps']===_0x11e2b5(0xf9)?_0x374bfc['globalConfig'][_0x11e2b5(0x110)]:{},_0x2fe9ae=_0x374bfc[_0x11e2b5(0x101)][_0x11e2b5(0x110)]&&typeof _0x374bfc[_0x11e2b5(0x101)][_0x11e2b5(0x110)]===_0x11e2b5(0xf9)?_0x374bfc[_0x11e2b5(0x101)]['apps']:{},_0x19f07d=Object['entries'](apps),_0x5efe0e=_0x19f07d['map'](([_0x2b96fa,_0x1f8c25])=>({'name':_0x2b96fa,'appcode':_0x1f8c25[_0x11e2b5(0x111)],'named':!![],'definedIn':appDefinedIn(_0x2b96fa,_0xddce34,_0x2fe9ae),'isDefault':_0x2b96fa===_0x1ba566,...buildAppProfileListFields(_0x1f8c25)}));return _0x5efe0e;}function validateAppListFlags(_0x1d5859){const _0x52b14f=a20_0x472e;if(!_0x1d5859['bool']('remote'))return;if(!_0x1d5859[_0x52b14f(0xfb)]('global')&&!_0x1d5859[_0x52b14f(0xfb)](_0x52b14f(0xf8)))return;throw CliErrors[_0x52b14f(0x11c)](_0x52b14f(0x10e),_0x52b14f(0xfa));}async function execute(_0x166762){const _0x1bb505=a20_0x472e;validateAppListFlags(_0x166762);if(_0x166762['bool'](_0x1bb505(0x106)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x166762)};const _0x316c33=_0x166762[_0x1bb505(0xfb)](_0x1bb505(0x102)),_0x2dd447=_0x166762[_0x1bb505(0xfb)](_0x1bb505(0xf8)),_0x48dcb0=_0x316c33?'global':_0x2dd447?'project':_0x1bb505(0x11d),{config:_0x3d9999,layers:_0x272875}=readRawConfigWithLayers(),_0x3e1e84=resolveDefaultAppSource(_0x272875),{defaultApp:_0x5d4c5c}=_0x3d9999;let _0x5d0991,_0x1cae19;switch(_0x48dcb0){case _0x1bb505(0x102):_0x5d0991=buildItemsFromLayer(_0x272875[_0x1bb505(0x10f)],_0x1bb505(0x102)),_0x1cae19=_0x272875[_0x1bb505(0x112)];break;case _0x1bb505(0xf8):_0x5d0991=buildItemsFromLayer(_0x272875[_0x1bb505(0x101)],_0x1bb505(0xf8)),_0x1cae19=_0x272875['projectPath'];break;default:_0x5d0991=buildMergedItems(_0x3d9999,_0x272875);break;}enrichAppListItemsWithMergedSelection(_0x5d0991,_0x166762[_0x1bb505(0x108)]);if(_0x5d0991[_0x1bb505(0x104)]===0x0){const _0xda7734=_0x48dcb0===_0x1bb505(0x11d)?'':_0x1bb505(0xfe)+_0x48dcb0+'\x20config';return{'ok':!![],'data':[],'message':_0x1bb505(0x115)+_0xda7734+'.\x20Use\x20`'+CLI_BIN_NAME+_0x1bb505(0xff)};}const _0x2347d0=_0x5d0991[_0x1bb505(0x10d)](_0x24ee8a=>_0x24ee8a[_0x1bb505(0x105)]===!![]),_0xb324c5=_0x5d4c5c??_0x2347d0?.[_0x1bb505(0x109)]??null,_0x1a714b=_0x48dcb0===_0x1bb505(0x11d)?{'globalPath':_0x272875['globalPath']??null,'projectPath':_0x272875[_0x1bb505(0x10a)]??null,'defaultApp':_0xb324c5,'defaultAppSource':_0x5d4c5c!=null?_0x3e1e84:null}:{'scope':_0x48dcb0,'configPath':_0x1cae19??null};return{'ok':!![],'data':{'items':_0x5d0991,'meta':_0x1a714b}};}export const appListDefinition={'service':'app','command':'list','description':a20_0xf26084(0x11a),'risk':'read','auth':a20_0xf26084(0x11b),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':a20_0xf26084(0x100),'description':'List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','default':![]},{'name':'global','type':a20_0xf26084(0x100),'description':a20_0xf26084(0x103),'default':![]},{'name':a20_0xf26084(0xf8),'type':a20_0xf26084(0x100),'description':a20_0xf26084(0xfd),'default':![]}],async 'validate'(_0x5d49d4){validateAppListFlags(_0x5d49d4);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x497009=a21_0x5e42;(function(_0x5d30a0,_0x486bd4){const _0x2bbc12=a21_0x5e42,_0xdbfd81=_0x5d30a0();while(!![]){try{const _0x68ac0f=parseInt(_0x2bbc12(0x154))/0x1*(-parseInt(_0x2bbc12(0x150))/0x2)+parseInt(_0x2bbc12(0x15d))/0x3+parseInt(_0x2bbc12(0x156))/0x4*(-parseInt(_0x2bbc12(0x151))/0x5)+-parseInt(_0x2bbc12(0x157))/0x6+-parseInt(_0x2bbc12(0x155))/0x7*(-parseInt(_0x2bbc12(0x15f))/0x8)+-parseInt(_0x2bbc12(0x153))/0x9*(parseInt(_0x2bbc12(0x15c))/0xa)+parseInt(_0x2bbc12(0x14f))/0xb;if(_0x68ac0f===_0x486bd4)break;else _0xdbfd81['push'](_0xdbfd81['shift']());}catch(_0x3656dd){_0xdbfd81['push'](_0xdbfd81['shift']());}}}(a21_0x2766,0x4cb0b));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a21_0x2766(){const _0xf128ea=['20149ShazPl','7NMVLuK','2180CfrmMG','152346dLCbtU','appCode','read','length','app','288020HcLwFB','220710TrQHOW','List\x20application\x20members\x20with\x20their\x20role\x20memberships','817368bSRzWl','13206974LtByLU','46TxOLsG','2090BKuzrq','Found\x20','108vNcCqj'];a21_0x2766=function(){return _0xf128ea;};return a21_0x2766();}import{listRoleUsers}from'../../core/api-client.js';function a21_0x5e42(_0x34e2fa,_0x1c97bf){_0x34e2fa=_0x34e2fa-0x14f;const _0x276604=a21_0x2766();let _0x5e42cb=_0x276604[_0x34e2fa];return _0x5e42cb;}export const appMembersListDefinition={'service':a21_0x497009(0x15b),'command':'members-list','description':a21_0x497009(0x15e),'risk':a21_0x497009(0x159),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x38ac8b){const _0x222159=a21_0x497009,_0x1bb482=projectAppMembers(await listRoleUsers(_0x38ac8b[_0x222159(0x158)]));return{'ok':!![],'data':{'appCode':_0x38ac8b[_0x222159(0x158)],'items':_0x1bb482,'totalCount':_0x1bb482[_0x222159(0x15a)]},'message':_0x222159(0x152)+_0x1bb482[_0x222159(0x15a)]+'\x20application\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ccf8b,_0x2b64a0){const _0x260f0b=a22_0x4b1e,_0x3c7d8e=_0x3ccf8b();while(!![]){try{const _0x1f773f=-parseInt(_0x260f0b(0x1cb))/0x1+-parseInt(_0x260f0b(0x1cf))/0x2*(-parseInt(_0x260f0b(0x1cd))/0x3)+-parseInt(_0x260f0b(0x1c9))/0x4*(-parseInt(_0x260f0b(0x1c2))/0x5)+parseInt(_0x260f0b(0x1c8))/0x6*(parseInt(_0x260f0b(0x1c3))/0x7)+parseInt(_0x260f0b(0x1cc))/0x8+parseInt(_0x260f0b(0x1c4))/0x9+-parseInt(_0x260f0b(0x1c1))/0xa*(parseInt(_0x260f0b(0x1c7))/0xb);if(_0x1f773f===_0x2b64a0)break;else _0x3c7d8e['push'](_0x3c7d8e['shift']());}catch(_0x20723b){_0x3c7d8e['push'](_0x3c7d8e['shift']());}}}(a22_0x2306,0xd353b));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a22_0x4b1e(_0x2a0e3a,_0x2ac76a){_0x2a0e3a=_0x2a0e3a-0x1bf;const _0x230658=a22_0x2306();let _0x4b1e09=_0x230658[_0x2a0e3a];return _0x4b1e09;}function a22_0x2306(){const _0x3da98e=['authRequired','1536436rEGPPp','1062OsBBXQ','875260TemcMx','appDesc','1529175ZKKmbL','6144768fcZoDV','3YdpOBz','cookie','2290732ONANRI','platform','map','230frArjr','30TWNeRa','57169RsFzNf','8418663nVUYfQ','appName'];a22_0x2306=function(){return _0x3da98e;};return a22_0x2306();}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x23a4c3){const _0x4749f7=a22_0x4b1e,_0x5c03c3=_0x23a4c3[_0x4749f7(0x1ce)]||getCookie();if(!_0x5c03c3)throw CliErrors[_0x4749f7(0x1c6)]();return _0x5c03c3;}export async function listRemoteAppDirectory(_0x45a524){const _0x25e299=a22_0x4b1e,_0x577ed9=await withActiveCookie(resolveCookie(_0x45a524),()=>listRemoteApps());return{'items':_0x577ed9[_0x25e299(0x1c0)](_0x4a11d6=>({..._0x4a11d6['id']!=null?{'id':_0x4a11d6['id']}:{},'appCode':_0x4a11d6['appCode'],'appName':_0x4a11d6[_0x25e299(0x1c5)],..._0x4a11d6[_0x25e299(0x1ca)]!=null?{'appDesc':_0x4a11d6[_0x25e299(0x1ca)]}:{}})),'meta':{'source':_0x25e299(0x1bf)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x374f71,_0x33d76c){const _0x34d2aa=a23_0x2e56,_0x4d638d=_0x374f71();while(!![]){try{const _0x3f76f3=-parseInt(_0x34d2aa(0x8f))/0x1*(parseInt(_0x34d2aa(0x9c))/0x2)+-parseInt(_0x34d2aa(0xa9))/0x3+-parseInt(_0x34d2aa(0xab))/0x4+-parseInt(_0x34d2aa(0xae))/0x5+-parseInt(_0x34d2aa(0xb0))/0x6*(-parseInt(_0x34d2aa(0xa3))/0x7)+-parseInt(_0x34d2aa(0x9a))/0x8+parseInt(_0x34d2aa(0x7e))/0x9;if(_0x3f76f3===_0x33d76c)break;else _0x4d638d['push'](_0x4d638d['shift']());}catch(_0x3768e5){_0x4d638d['push'](_0x4d638d['shift']());}}}(a23_0x1e13,0xe60d5));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x54d35b){const _0x48ac14=a23_0x2e56,_0x16f59f=_0x54d35b?.[_0x48ac14(0x86)]();return _0x16f59f?_0x16f59f:null;}function a23_0x1e13(){const _0x44214f=['roleId','prototype','named','roleCode','name','hasOwnProperty','roleKeys','2SFfbFp','userList','applyUserList','displayName','has','roleType','global','push','\x20(global)','projectConfig','object','5246672jOFzsg','appcode','1305662IDsqrH','call','both','defaultApp','PENDING','isCurrent','set','116809uMqHVN','ACTIVE','sort','globalConfig','roles','status','938118AvdqrO','keys','611812oQCvCV','roleName','currentApp','1614780cAKVku','apps','330aFToJV','appCode','24971571nQUuWD','userId','map','length','membershipStatus','values','username','project','trim','nickname'];a23_0x1e13=function(){return _0x44214f;};return a23_0x1e13();}export function projectAppMembers(_0x370bdf){const _0x39283f=a23_0x2e56,_0x2e6cef=new Map(),_0x3824c3=[..._0x370bdf]['sort']((_0x5f4bed,_0x269602)=>_0x5f4bed['id']-_0x269602['id']),_0x1a6c06=(_0x1a562f,_0x53cb2a,_0x408cf9)=>{const _0x496bec=a23_0x2e56;for(const _0x36f7d1 of _0x53cb2a){const _0x1fa91c=Number(_0x36f7d1['userId']);if(!Number['isFinite'](_0x1fa91c)||_0x1fa91c<=0x0)continue;let _0x1fab12=_0x2e6cef['get'](_0x1fa91c);if(!_0x1fab12)_0x1fab12={'userId':_0x1fa91c,'username':nullableText(_0x36f7d1['username']),'displayName':nullableText(_0x36f7d1[_0x496bec(0x87)]),'status':_0x408cf9,'roles':[],'roleKeys':new Set()},_0x2e6cef[_0x496bec(0xa2)](_0x1fa91c,_0x1fab12);else{_0x1fab12[_0x496bec(0x84)]??=nullableText(_0x36f7d1[_0x496bec(0x84)]),_0x1fab12[_0x496bec(0x92)]??=nullableText(_0x36f7d1[_0x496bec(0x87)]);if(_0x408cf9===_0x496bec(0xa4))_0x1fab12[_0x496bec(0xa8)]='ACTIVE';}const _0x1515ec=_0x1a562f['id']+':'+_0x408cf9;if(_0x1fab12[_0x496bec(0x8e)][_0x496bec(0x93)](_0x1515ec))continue;_0x1fab12[_0x496bec(0x8e)]['add'](_0x1515ec),_0x1fab12[_0x496bec(0xa7)][_0x496bec(0x96)]({'roleId':_0x1a562f['id'],'roleCode':_0x1a562f[_0x496bec(0x8b)],'roleName':nullableText(_0x1a562f[_0x496bec(0xac)]),'roleType':nullableText(_0x1a562f[_0x496bec(0x94)]),'membershipStatus':_0x408cf9});}};for(const _0x14fa55 of _0x3824c3){_0x1a6c06(_0x14fa55,_0x14fa55[_0x39283f(0x90)]??[],_0x39283f(0xa4)),_0x1a6c06(_0x14fa55,_0x14fa55[_0x39283f(0x91)]??[],_0x39283f(0xa0));}return[..._0x2e6cef[_0x39283f(0x83)]()][_0x39283f(0x80)](_0x1b7505=>({'userId':_0x1b7505[_0x39283f(0x7f)],'username':_0x1b7505['username'],'displayName':_0x1b7505['displayName'],'status':_0x1b7505[_0x39283f(0xa8)],'roles':_0x1b7505[_0x39283f(0xa7)][_0x39283f(0xa5)]((_0x5c050d,_0x4de610)=>_0x5c050d[_0x39283f(0x88)]-_0x4de610[_0x39283f(0x88)]||(_0x5c050d[_0x39283f(0x82)]===_0x4de610[_0x39283f(0x82)]?0x0:_0x5c050d[_0x39283f(0x82)]===_0x39283f(0xa4)?-0x1:0x1))}))[_0x39283f(0xa5)]((_0x33b2a3,_0x3a6aab)=>_0x33b2a3[_0x39283f(0x7f)]-_0x3a6aab[_0x39283f(0x7f)]);}export function enrichAppListItemsWithMergedSelection(_0x245a27,_0x193411){const _0x3a79e8=a23_0x2e56;if(!_0x193411)return;const _0x593311=_0x193411[_0x3a79e8(0xaf)]&&typeof _0x193411[_0x3a79e8(0xaf)]==='object'?_0x193411[_0x3a79e8(0xaf)]:{},_0x45f728=Object[_0x3a79e8(0xaa)](_0x593311)[_0x3a79e8(0x81)]>0x0;for(const _0x2f53a1 of _0x245a27){_0x2f53a1['isCurrent']=![];}const _0x2f3d47=_0x193411[_0x3a79e8(0x7d)]!=null?String(_0x193411[_0x3a79e8(0x7d)])[_0x3a79e8(0x86)]():'';if(_0x45f728){const _0x2e83c3=_0x193411[_0x3a79e8(0xad)]??_0x193411[_0x3a79e8(0x9f)];if(_0x2e83c3)for(const _0x595ff0 of _0x245a27){_0x595ff0['named']===!![]&&_0x595ff0[_0x3a79e8(0x8c)]===_0x2e83c3&&(_0x595ff0[_0x3a79e8(0xa1)]=!![]);}for(const _0xbcf1b0 of _0x245a27){if(_0xbcf1b0[_0x3a79e8(0x8a)]!==![])continue;if(_0x193411[_0x3a79e8(0x9f)])continue;_0x2f3d47&&String(_0xbcf1b0[_0x3a79e8(0x9b)]??'')[_0x3a79e8(0x86)]()===_0x2f3d47&&(_0xbcf1b0[_0x3a79e8(0xa1)]=!![]);}return;}if(!_0x2f3d47)return;for(const _0x4a82e8 of _0x245a27){String(_0x4a82e8[_0x3a79e8(0x9b)]??'')['trim']()===_0x2f3d47&&(_0x4a82e8['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x18fe85,_0x41bf15,_0x264988){const _0x5a4562=a23_0x2e56;if(_0x41bf15)return _0x5a4562(0x95);const _0x572376=_0x264988[_0x5a4562(0x98)][_0x5a4562(0xaf)]&&typeof _0x264988['projectConfig']['apps']===_0x5a4562(0x99)?_0x264988['projectConfig'][_0x5a4562(0xaf)]:{},_0x4d23ca=_0x264988[_0x5a4562(0xa6)][_0x5a4562(0xaf)]&&typeof _0x264988[_0x5a4562(0xa6)][_0x5a4562(0xaf)]===_0x5a4562(0x99)?_0x264988[_0x5a4562(0xa6)]['apps']:{};if(Object['prototype'][_0x5a4562(0x8d)][_0x5a4562(0x9d)](_0x572376,_0x18fe85))return'project';if(Object[_0x5a4562(0x89)][_0x5a4562(0x8d)][_0x5a4562(0x9d)](_0x4d23ca,_0x18fe85))return'global';return _0x5a4562(0x85);}export function appDefinedIn(_0x33349e,_0x494078,_0x4b9158){const _0x4ac6fd=a23_0x2e56,_0x5f35a4=Object[_0x4ac6fd(0x89)]['hasOwnProperty']['call'](_0x494078,_0x33349e),_0x3f7517=Object[_0x4ac6fd(0x89)][_0x4ac6fd(0x8d)][_0x4ac6fd(0x9d)](_0x4b9158,_0x33349e);if(_0x5f35a4&&_0x3f7517)return _0x4ac6fd(0x9e);if(_0x3f7517)return'project';return'global';}export function resolveDefaultAppSource(_0x4dd04a){const _0x564bf7=a23_0x2e56,_0x4aca3b=_0x4dd04a[_0x564bf7(0x98)][_0x564bf7(0xaf)]&&typeof _0x4dd04a[_0x564bf7(0x98)][_0x564bf7(0xaf)]===_0x564bf7(0x99)?_0x4dd04a[_0x564bf7(0x98)][_0x564bf7(0xaf)]:{};if(_0x564bf7(0x9f)in _0x4dd04a[_0x564bf7(0x98)])return _0x564bf7(0x85);if(Object[_0x564bf7(0xaa)](_0x4aca3b)[_0x564bf7(0x81)]>0x0)return _0x564bf7(0x85);if(Object[_0x564bf7(0xaa)](_0x4dd04a[_0x564bf7(0x98)])[_0x564bf7(0x81)]===0x0&&_0x4dd04a[_0x564bf7(0xa6)][_0x564bf7(0x9f)])return _0x564bf7(0x95);return null;}export function getConfigPath(_0x29557f={}){const _0x3f1104=a23_0x2e56,_0x2a253b=_0x29557f['global']?_0x3f1104(0x95):_0x3f1104(0x85);return resolveWriteConfigPath(_0x2a253b);}function a23_0x2e56(_0x2f1131,_0x457e22){_0x2f1131=_0x2f1131-0x7d;const _0x1e13b1=a23_0x1e13();let _0x2e567e=_0x1e13b1[_0x2f1131];return _0x2e567e;}export function readConfig(_0x3d20c9={}){return readConfigFile(getConfigPath(_0x3d20c9));}export function writeConfig(_0x2f9909,_0x57d770={}){writeConfigFile(getConfigPath(_0x57d770),_0x2f9909);}export function scopeLabel(_0x3c2f88){const _0x42eadf=a23_0x2e56;return _0x3c2f88[_0x42eadf(0x95)]?_0x42eadf(0x97):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0xce1665=a24_0x299b;(function(_0x4d0099,_0x46c5ae){const _0x22c99f=a24_0x299b,_0x4b38fa=_0x4d0099();while(!![]){try{const _0x1002a5=parseInt(_0x22c99f(0xa0))/0x1*(-parseInt(_0x22c99f(0xa1))/0x2)+-parseInt(_0x22c99f(0xb3))/0x3*(parseInt(_0x22c99f(0x9f))/0x4)+parseInt(_0x22c99f(0xa9))/0x5+-parseInt(_0x22c99f(0xb1))/0x6*(-parseInt(_0x22c99f(0xa2))/0x7)+parseInt(_0x22c99f(0xa3))/0x8+-parseInt(_0x22c99f(0xb4))/0x9+-parseInt(_0x22c99f(0xb6))/0xa*(-parseInt(_0x22c99f(0xae))/0xb);if(_0x1002a5===_0x46c5ae)break;else _0x4b38fa['push'](_0x4b38fa['shift']());}catch(_0x37fb70){_0x4b38fa['push'](_0x4b38fa['shift']());}}}(a24_0x3cd0,0x43365));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a24_0x3cd0(){const _0x2fc3e2=['147777AFaSWF','906496GwHeBJ','appCode','appCode:\x20','get','Deleted\x20app\x20config\x20','number','791940kKhSis','/smartapi/app-config/delete','isFinite','validation','high-risk-write','77kVJFdU','delete','app-config','114kaSQtI','POST','227355ukpjjY','1465560nWxZGw','App\x20config\x20key\x20not\x20found:\x20','34110ZNoBNT','12LkvxAl','15595lhjpzs','4voksDF'];a24_0x3cd0=function(){return _0x2fc3e2;};return a24_0x3cd0();}const DELETE_PATH=a24_0xce1665(0xaa);export const appConfigDelete={'service':a24_0xce1665(0xb0),'command':a24_0xce1665(0xaf),'description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a24_0xce1665(0xad),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2c0cfd){readKeyArg(_0x2c0cfd);},async 'dryRun'(_0x28461c){const _0xaf2b95=a24_0xce1665,_0x39725e=readKeyArg(_0x28461c),_0x2ad656=await mustGetByKey(_0x28461c[_0xaf2b95(0xa4)],_0x39725e);return asAppConfigDryRunResult(buildMutationData({'operation':_0xaf2b95(0xaf),'appCode':_0x28461c[_0xaf2b95(0xa4)],'key':_0x39725e,'before':projectAppConfig(_0x2ad656),'after':null,'dryRun':!![]}),{'method':_0xaf2b95(0xb2),'url':DELETE_PATH});},async 'execute'(_0x4951ab){const _0x22ade2=a24_0xce1665,_0x5bb23f=readKeyArg(_0x4951ab),_0x303cfd=await mustGetByKey(_0x4951ab['appCode'],_0x5bb23f);return await withAppConfigApiBoundary(_0x22ade2(0xaf),{'appCode':_0x4951ab[_0x22ade2(0xa4)],'key':_0x5bb23f},()=>deleteAppConfig({'appCode':_0x4951ab[_0x22ade2(0xa4)],'id':requireAppConfigId(_0x303cfd,_0x5bb23f,_0x4951ab[_0x22ade2(0xa4)])})),{'ok':!![],'data':buildMutationData({'operation':'delete','appCode':_0x4951ab[_0x22ade2(0xa4)],'key':_0x5bb23f,'before':projectAppConfig(_0x303cfd),'after':null,'dryRun':![]}),'message':_0x22ade2(0xa7)+_0x5bb23f};}};async function mustGetByKey(_0x377329,_0x48dfcb){const _0x37e861=a24_0xce1665,_0x483d9c=await withAppConfigApiBoundary(_0x37e861(0xa6),{'appCode':_0x377329,'key':_0x48dfcb},()=>getAppConfigByKey(_0x377329,_0x48dfcb));if(!_0x483d9c)throw CliErrors[_0x37e861(0xac)](_0x37e861(0xb5)+_0x48dfcb,_0x37e861(0xa5)+_0x377329);return _0x483d9c;}function a24_0x299b(_0x292f13,_0x577db4){_0x292f13=_0x292f13-0x9f;const _0x3cd07b=a24_0x3cd0();let _0x299baa=_0x3cd07b[_0x292f13];return _0x299baa;}function requireAppConfigId(_0x4b2e1b,_0x2a6ea2,_0x3aa4a4){const _0x3abc29=a24_0xce1665;if(typeof _0x4b2e1b['id']===_0x3abc29(0xa8)&&Number[_0x3abc29(0xab)](_0x4b2e1b['id'])&&_0x4b2e1b['id']>0x0)return _0x4b2e1b['id'];throw CliErrors['apiError']('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x2a6ea2+',\x20appCode='+_0x3aa4a4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x170777=a25_0x4cab;function a25_0x4cab(_0x49ffec,_0x1c73d1){_0x49ffec=_0x49ffec-0x18a;const _0x59b872=a25_0x59b8();let _0x4cabfd=_0x59b872[_0x49ffec];return _0x4cabfd;}(function(_0x2f4b1b,_0x116038){const _0xa6dedc=a25_0x4cab,_0x273f13=_0x2f4b1b();while(!![]){try{const _0xa61b9d=parseInt(_0xa6dedc(0x18f))/0x1*(-parseInt(_0xa6dedc(0x19c))/0x2)+-parseInt(_0xa6dedc(0x195))/0x3+-parseInt(_0xa6dedc(0x193))/0x4*(parseInt(_0xa6dedc(0x19a))/0x5)+parseInt(_0xa6dedc(0x19e))/0x6*(parseInt(_0xa6dedc(0x190))/0x7)+-parseInt(_0xa6dedc(0x18d))/0x8+parseInt(_0xa6dedc(0x18a))/0x9*(parseInt(_0xa6dedc(0x199))/0xa)+parseInt(_0xa6dedc(0x196))/0xb;if(_0xa61b9d===_0x116038)break;else _0x273f13['push'](_0x273f13['shift']());}catch(_0x15ac6f){_0x273f13['push'](_0x273f13['shift']());}}}(a25_0x59b8,0x93a38));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a25_0x59b8(){const _0x3ece66=['1165InTZyb','get','2215470SFsgIG','App\x20config\x20key\x20not\x20found:\x20','6ivpZSn','7655517trAFiI','validation','reveal','6726808hrhVYD','\x20with\x20value\x20redacted','1ddFQzs','6644281PgxOtc','appCode','appCode:\x20','2392DSWwIx','Loaded\x20app\x20config\x20','2828883dTPyuz','20193943MZAsgR','bool','app-config','10AbzQfz'];a25_0x59b8=function(){return _0x3ece66;};return a25_0x59b8();}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':a25_0x170777(0x198),'command':a25_0x170777(0x19b),'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'(_0x11513b){readKeyArg(_0x11513b);},async 'execute'(_0x45c653){const _0x21e882=a25_0x170777,_0x76fd6e=readKeyArg(_0x45c653),_0x4bdb9b=await withAppConfigApiBoundary(_0x21e882(0x19b),{'appCode':_0x45c653[_0x21e882(0x191)],'key':_0x76fd6e},()=>getAppConfigByKey(_0x45c653['appCode'],_0x76fd6e));if(!_0x4bdb9b)throw CliErrors[_0x21e882(0x18b)](_0x21e882(0x19d)+_0x76fd6e,_0x21e882(0x192)+_0x45c653[_0x21e882(0x191)]);const _0x1fdc9e=projectAppConfig(_0x4bdb9b,{'reveal':_0x45c653['bool'](_0x21e882(0x18c))});return{'ok':!![],'data':{'config':_0x1fdc9e},'message':_0x45c653[_0x21e882(0x197)](_0x21e882(0x18c))?_0x21e882(0x194)+_0x76fd6e+'\x20with\x20value\x20revealed':_0x21e882(0x194)+_0x76fd6e+_0x21e882(0x18e)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4eae78,_0xe7138d){const _0x854c3d=a26_0x58d7,_0x5e5c61=_0x4eae78();while(!![]){try{const _0x5a7357=parseInt(_0x854c3d(0xca))/0x1+-parseInt(_0x854c3d(0xd2))/0x2+-parseInt(_0x854c3d(0xc9))/0x3*(-parseInt(_0x854c3d(0xd0))/0x4)+-parseInt(_0x854c3d(0xcf))/0x5*(-parseInt(_0x854c3d(0xcb))/0x6)+parseInt(_0x854c3d(0xc8))/0x7*(-parseInt(_0x854c3d(0xcc))/0x8)+parseInt(_0x854c3d(0xd3))/0x9*(parseInt(_0x854c3d(0xcd))/0xa)+-parseInt(_0x854c3d(0xd1))/0xb*(parseInt(_0x854c3d(0xce))/0xc);if(_0x5a7357===_0xe7138d)break;else _0x5e5c61['push'](_0x5e5c61['shift']());}catch(_0xd14e29){_0x5e5c61['push'](_0x5e5c61['shift']());}}}(a26_0x5d2c,0xd1e59));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';function a26_0x5d2c(){const _0x27e051=['134650eVQWMl','807096uHMxnC','5WOfqbx','12HCbRkF','330vfbcdi','371812eqsNsA','666ECxNAe','21ACheTQ','1483359wuvJjX','994538wDXszF','2316822SnDXKt','2125496QFcTVa'];a26_0x5d2c=function(){return _0x27e051;};return a26_0x5d2c();}function a26_0x58d7(_0x5020d3,_0x406619){_0x5020d3=_0x5020d3-0xc8;const _0x5d2cbf=a26_0x5d2c();let _0x58d73f=_0x5d2cbf[_0x5020d3];return _0x58d73f;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x2bc74d=a27_0x43c0;(function(_0x1227f7,_0x51191f){const _0x39ac32=a27_0x43c0,_0x2c11b7=_0x1227f7();while(!![]){try{const _0x527513=parseInt(_0x39ac32(0x17b))/0x1*(-parseInt(_0x39ac32(0x172))/0x2)+parseInt(_0x39ac32(0x185))/0x3*(parseInt(_0x39ac32(0x179))/0x4)+-parseInt(_0x39ac32(0x187))/0x5+-parseInt(_0x39ac32(0x175))/0x6*(-parseInt(_0x39ac32(0x180))/0x7)+-parseInt(_0x39ac32(0x183))/0x8+-parseInt(_0x39ac32(0x17d))/0x9*(-parseInt(_0x39ac32(0x17f))/0xa)+parseInt(_0x39ac32(0x177))/0xb*(parseInt(_0x39ac32(0x170))/0xc);if(_0x527513===_0x51191f)break;else _0x2c11b7['push'](_0x2c11b7['shift']());}catch(_0x41cb3a){_0x2c11b7['push'](_0x2c11b7['shift']());}}}(a27_0x1e99,0x9153c));function a27_0x1e99(){const _0x1b6fa7=['read','15980kZLxJY','427kpMAcX','Found\x20','length','6111648LcFttA','Filter\x20by\x20exact\x20config\x20key','3ylLWVb','string','5672495MbMDVq','str','19500cQgkPD','key','2TWrGWX','\x20app\x20config(s)','map','15738jiJZQB','appCode','7447szOyoe','trim','2405164QAlKyI','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','37266udguDy','app-config','3771vMmyjq'];a27_0x1e99=function(){return _0x1b6fa7;};return a27_0x1e99();}import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a27_0x43c0(_0x1f0729,_0x1ac22a){_0x1f0729=_0x1f0729-0x16f;const _0x1e9970=a27_0x1e99();let _0x43c049=_0x1e9970[_0x1f0729];return _0x43c049;}import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a27_0x2bc74d(0x17c),'command':'list','description':a27_0x2bc74d(0x17a),'risk':a27_0x2bc74d(0x17e),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':a27_0x2bc74d(0x186),'description':a27_0x2bc74d(0x184)},TAGS_FLAG],async 'validate'(_0x24e782){const _0xf7fb07=a27_0x2bc74d,_0x11d2c5=_0x24e782[_0xf7fb07(0x16f)](_0xf7fb07(0x171))[_0xf7fb07(0x178)]();if(_0x11d2c5)validateKey(_0x11d2c5);readOptionalTags(_0x24e782);},async 'execute'(_0x2d4cce){const _0xb8a4e7=a27_0x2bc74d,_0x13d7ac=_0x2d4cce['str'](_0xb8a4e7(0x171))['trim']()||undefined,_0x3a91f0=readOptionalTags(_0x2d4cce),_0x3d24fd=await withAppConfigApiBoundary('list',{'appCode':_0x2d4cce[_0xb8a4e7(0x176)]},()=>listAppConfigs(_0x2d4cce['appCode'],{'key':_0x13d7ac,'tags':_0x3a91f0})),_0x33742=_0x3d24fd[_0xb8a4e7(0x174)](_0x118bff=>projectAppConfig(_0x118bff));return{'ok':!![],'data':{'appCode':_0x2d4cce[_0xb8a4e7(0x176)],'count':_0x33742[_0xb8a4e7(0x182)],'configs':_0x33742},'message':_0xb8a4e7(0x181)+_0x33742[_0xb8a4e7(0x182)]+_0xb8a4e7(0x173)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x15e3(){const _0x5e060a=['745680Qhjzkx','/smartapi/app-config/update','tags','1306705uSthAE','Updated','728757vFBEfB','get','write','1541365rfMGnX','6Vodhgm','390242ikXprL','update','1734456rrYHoz','file','appCode','create','set','/smartapi/app-config/create','apiError','69615JFRrON','number','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','app-config','isFinite','18HxdsFG'];a28_0x15e3=function(){return _0x5e060a;};return a28_0x15e3();}const a28_0xe249e6=a28_0x4b1d;(function(_0x23d9df,_0x2ed225){const _0x35025b=a28_0x4b1d,_0xb552ad=_0x23d9df();while(!![]){try{const _0x3d89aa=-parseInt(_0x35025b(0x91))/0x1+-parseInt(_0x35025b(0xa1))/0x2+-parseInt(_0x35025b(0x9c))/0x3+parseInt(_0x35025b(0x97))/0x4+parseInt(_0x35025b(0x9a))/0x5+parseInt(_0x35025b(0xa0))/0x6*(-parseInt(_0x35025b(0x9f))/0x7)+-parseInt(_0x35025b(0xa3))/0x8*(-parseInt(_0x35025b(0x96))/0x9);if(_0x3d89aa===_0x2ed225)break;else _0xb552ad['push'](_0xb552ad['shift']());}catch(_0x54af47){_0xb552ad['push'](_0xb552ad['shift']());}}}(a28_0x15e3,0x257b5));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a28_0x4b1d(_0x563ff6,_0x38684c){_0x563ff6=_0x563ff6-0x8c;const _0x15e31b=a28_0x15e3();let _0x4b1d3c=_0x15e31b[_0x563ff6];return _0x4b1d3c;}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=a28_0xe249e6(0x8f),UPDATE_PATH=a28_0xe249e6(0x98);export const appConfigSet={'service':a28_0xe249e6(0x94),'command':a28_0xe249e6(0x8e),'description':a28_0xe249e6(0x93),'risk':a28_0xe249e6(0x9e),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0xe249e6(0xa4),'type':'string','description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x302a3b){readKeyArg(_0x302a3b),readOptionalTags(_0x302a3b),assertSingleValueSource(_0x302a3b);},async 'dryRun'(_0x2762ce){const _0x2850b5=a28_0xe249e6,_0x33648d=readKeyArg(_0x2762ce),_0x11068e=readOptionalTags(_0x2762ce),_0x41877a=assertSingleValueSource(_0x2762ce);await assertValueSourceReadable(_0x41877a);const _0x3b8555=await withAppConfigApiBoundary(_0x2850b5(0x9d),{'appCode':_0x2762ce['appCode'],'key':_0x33648d},()=>getAppConfigByKey(_0x2762ce['appCode'],_0x33648d)),_0x37628f=_0x3b8555?'update':_0x2850b5(0x8d),_0x38268f=_0x3b8555?projectAppConfig(_0x3b8555):null,_0x9f36d4=plannedAppConfig({'appCode':_0x2762ce[_0x2850b5(0x8c)],'key':_0x33648d,'tags':_0x11068e??_0x3b8555?.[_0x2850b5(0x99)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x37628f,'appCode':_0x2762ce['appCode'],'key':_0x33648d,'before':_0x38268f,'after':_0x9f36d4,'dryRun':!![]}),{'method':'POST','url':_0x37628f==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x510d16){const _0xdff45f=a28_0xe249e6,_0x38da0b=readKeyArg(_0x510d16),_0x14b350=readOptionalTags(_0x510d16),_0x520136=await withAppConfigApiBoundary(_0xdff45f(0x9d),{'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b},()=>getAppConfigByKey(_0x510d16['appCode'],_0x38da0b)),_0xd4cb5d=_0x520136?projectAppConfig(_0x520136):null,_0x549d7b=_0x520136?_0xdff45f(0xa2):'create',{value:_0x5259a4,warnings:_0x1ed0a2}=await readAppConfigValue(_0x510d16),_0x3a7dfe={'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b,'value':_0x5259a4,'tags':_0x14b350??_0x520136?.[_0xdff45f(0x99)]??undefined};await withAppConfigApiBoundary(_0x549d7b,{'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b},async()=>{const _0x38c33d=_0xdff45f;_0x520136?await updateAppConfig({..._0x3a7dfe,'id':requireAppConfigId(_0x520136,_0x38da0b,_0x510d16[_0x38c33d(0x8c)])}):await createAppConfig(_0x3a7dfe);});const _0x57972b=await withAppConfigApiBoundary(_0xdff45f(0x9d),{'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b},()=>getAppConfigByKey(_0x510d16[_0xdff45f(0x8c)],_0x38da0b)),_0xd26f28=_0x57972b?projectAppConfig(_0x57972b):plannedAppConfig({'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b,'tags':_0x3a7dfe[_0xdff45f(0x99)],'hasValue':_0x5259a4!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x549d7b,'appCode':_0x510d16[_0xdff45f(0x8c)],'key':_0x38da0b,'before':_0xd4cb5d,'after':_0xd26f28,'dryRun':![],'warnings':_0x1ed0a2}),'message':(_0x549d7b===_0xdff45f(0xa2)?_0xdff45f(0x9b):'Created')+'\x20app\x20config\x20'+_0x38da0b};}};function requireAppConfigId(_0x47f427,_0x48d6a2,_0x2d36f1){const _0x3f19cd=a28_0xe249e6;if(typeof _0x47f427['id']===_0x3f19cd(0x92)&&Number[_0x3f19cd(0x95)](_0x47f427['id'])&&_0x47f427['id']>0x0)return _0x47f427['id'];throw CliErrors[_0x3f19cd(0x90)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x48d6a2+',\x20appCode='+_0x2d36f1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a29_0x34fb(){const _0x36c1f5=['data','string','\x20app\x20config.','1519236NfDKgK','length','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','valueRedacted','utf8','method','105kZiDOM','value','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','bool','args','App\x20config\x20value\x20source\x20is\x20ambiguous.','9LEULaH','Environment\x20variable\x20is\x20not\x20set:\x20','dryRun','value\x20is\x20redacted','before','argument','Config\x20tags\x20for\x20filtering/display\x20metadata','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','140484JMuoGC','gmtCreate','2181496FwkhyW','Read\x20config\x20value\x20from\x20stdin','end','key:\x20','32PDttWi','join','34555JyxFPM','reveal','file','error','flag','setEncoding','str','operation','appCode:\x20','stdin','key','validation','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Missing\x20app-config\x20key.','from-env','env','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','name','appCode','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','hasValue','push','trim','102664YCQlwM','boolean','Missing\x20app-config\x20value\x20source.','86470nZtMDm','tags','after','kind','once','14793900wdlBGF','path','Runtime\x20app-config\x20key','slice','apiError','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'];a29_0x34fb=function(){return _0x36c1f5;};return a29_0x34fb();}const a29_0x48893d=a29_0x2bca;(function(_0x376bd1,_0x390805){const _0x1df6d1=a29_0x2bca,_0x17647a=_0x376bd1();while(!![]){try{const _0x25516f=-parseInt(_0x1df6d1(0x154))/0x1+parseInt(_0x1df6d1(0x151))/0x2+-parseInt(_0x1df6d1(0x11d))/0x3+-parseInt(_0x1df6d1(0x138))/0x4*(parseInt(_0x1df6d1(0x13a))/0x5)+-parseInt(_0x1df6d1(0x132))/0x6*(parseInt(_0x1df6d1(0x124))/0x7)+-parseInt(_0x1df6d1(0x134))/0x8+-parseInt(_0x1df6d1(0x12a))/0x9*(-parseInt(_0x1df6d1(0x114))/0xa);if(_0x25516f===_0x390805)break;else _0x17647a['push'](_0x17647a['shift']());}catch(_0x69b404){_0x17647a['push'](_0x17647a['shift']());}}}(a29_0x34fb,0x3f25f));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x48893d(0x144),'description':a29_0x48893d(0x116),'required':!![]};export const VALUE_ARG={'name':a29_0x48893d(0x125),'description':a29_0x48893d(0x126),'required':![]};export const TAGS_FLAG={'name':a29_0x48893d(0x155),'type':a29_0x48893d(0x11b),'description':a29_0x48893d(0x130)};export const STDIN_FLAG={'name':a29_0x48893d(0x143),'type':'boolean','description':a29_0x48893d(0x135),'default':![]};export const FROM_ENV_FLAG={'name':a29_0x48893d(0x148),'type':'string','description':a29_0x48893d(0x119)};export const REVEAL_FLAG={'name':a29_0x48893d(0x13b),'type':a29_0x48893d(0x152),'description':a29_0x48893d(0x11f),'default':![]};export function readKeyArg(_0x5d6ad6){const _0x3519d3=a29_0x48893d,_0x39955d=_0x5d6ad6[_0x3519d3(0x128)][0x0]?.['trim']()??'';return validateKey(_0x39955d),_0x39955d;}export function readOptionalTags(_0xb4a134){const _0x3c4ef8=a29_0x48893d,_0x226365=_0xb4a134[_0x3c4ef8(0x140)](_0x3c4ef8(0x155))['trim']();if(!_0x226365)return undefined;if(_0x226365['length']>0x20)throw CliErrors[_0x3c4ef8(0x145)](_0x3c4ef8(0x146));return _0x226365;}export function validateKey(_0x4d3e04){const _0x109e3f=a29_0x48893d;if(!_0x4d3e04)throw CliErrors[_0x109e3f(0x145)](_0x109e3f(0x147));if(_0x4d3e04[_0x109e3f(0x11e)]>0x100)throw CliErrors[_0x109e3f(0x145)](_0x109e3f(0x120));}export function projectAppConfig(_0x57c1d7,_0x855add){const _0x422d9a=a29_0x48893d,_0x180ba9=_0x57c1d7[_0x422d9a(0x125)]!==undefined&&_0x57c1d7['value']!==null&&_0x57c1d7[_0x422d9a(0x125)]!=='',_0xdaee33={'appCode':_0x57c1d7['appCode'],'key':_0x57c1d7['key'],'tags':_0x57c1d7[_0x422d9a(0x155)]??undefined,'hasValue':_0x180ba9,'valueRedacted':_0x180ba9&&!_0x855add?.['reveal'],'gmtCreate':_0x57c1d7[_0x422d9a(0x133)],'gmtModified':_0x57c1d7['gmtModified']};return _0x855add?.[_0x422d9a(0x13b)]&&(_0xdaee33[_0x422d9a(0x125)]=_0x57c1d7['value']??'',_0xdaee33[_0x422d9a(0x121)]=![]),_0xdaee33;}export function plannedAppConfig(_0x56c2aa){const _0x31e051=a29_0x48893d,_0x94219d=_0x56c2aa[_0x31e051(0x14e)]??!![];return{'appCode':_0x56c2aa[_0x31e051(0x14c)],'key':_0x56c2aa[_0x31e051(0x144)],'tags':_0x56c2aa[_0x31e051(0x155)]??undefined,'hasValue':_0x94219d,'valueRedacted':_0x94219d};}export function buildMutationData(_0x3d115b){const _0x4d7417=a29_0x48893d;return{'operation':_0x3d115b[_0x4d7417(0x141)],'selector':{'appCode':_0x3d115b['appCode'],'key':_0x3d115b[_0x4d7417(0x144)]},'before':_0x3d115b[_0x4d7417(0x12e)],'after':_0x3d115b[_0x4d7417(0x156)],'dryRun':_0x3d115b[_0x4d7417(0x12c)],'warnings':_0x3d115b['warnings']??[]};}function a29_0x2bca(_0x41e864,_0x83a92){_0x41e864=_0x41e864-0x112;const _0x34fb34=a29_0x34fb();let _0x2bca14=_0x34fb34[_0x41e864];return _0x2bca14;}export async function withAppConfigApiBoundary(_0x227d4f,_0x4183f5,_0x19ffc7){const _0x17e322=a29_0x48893d;try{return await _0x19ffc7();}catch{const _0x32de28=[_0x17e322(0x142)+_0x4183f5[_0x17e322(0x14c)]];if(_0x4183f5[_0x17e322(0x144)])_0x32de28['push'](_0x17e322(0x137)+_0x4183f5[_0x17e322(0x144)]);_0x32de28['push'](_0x17e322(0x12d));throw CliErrors[_0x17e322(0x118)]('Failed\x20to\x20'+_0x227d4f+_0x17e322(0x11c),_0x32de28['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x17dc4d,_0x3c67d7){const _0x4e3209=a29_0x48893d;return Object['defineProperties'](_0x17dc4d,{'method':{'value':_0x3c67d7[_0x4e3209(0x123)],'enumerable':![]},'url':{'value':_0x3c67d7['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x129ab1){const _0x96157d=a29_0x48893d,_0x354189=[];_0x129ab1[_0x96157d(0x128)][_0x96157d(0x11e)]>0x1&&_0x354189[_0x96157d(0x14f)]({'kind':_0x96157d(0x12f),'value':_0x129ab1['args'][_0x96157d(0x117)](0x1)[_0x96157d(0x139)]('\x20')});const _0x44126b=_0x129ab1[_0x96157d(0x13e)](_0x96157d(0x125));_0x44126b!==undefined&&_0x44126b!==null&&_0x354189[_0x96157d(0x14f)]({'kind':_0x96157d(0x12f),'value':String(_0x44126b)});_0x129ab1[_0x96157d(0x127)](_0x96157d(0x143))&&_0x354189[_0x96157d(0x14f)]({'kind':_0x96157d(0x143)});const _0x582c85=_0x129ab1[_0x96157d(0x140)](_0x96157d(0x148))[_0x96157d(0x150)]();_0x582c85&&_0x354189[_0x96157d(0x14f)]({'kind':_0x96157d(0x149),'name':_0x582c85});const _0x13b927=_0x129ab1[_0x96157d(0x140)](_0x96157d(0x13c))['trim']();_0x13b927&&_0x354189[_0x96157d(0x14f)]({'kind':_0x96157d(0x13c),'path':_0x13b927});if(_0x354189[_0x96157d(0x11e)]===0x0)throw CliErrors[_0x96157d(0x145)](_0x96157d(0x153),_0x96157d(0x14a));if(_0x354189[_0x96157d(0x11e)]>0x1)throw CliErrors[_0x96157d(0x145)](_0x96157d(0x129),_0x96157d(0x131));return _0x354189[0x0];}export async function assertValueSourceReadable(_0x5d491e){const _0x50806a=a29_0x48893d;if(_0x5d491e[_0x50806a(0x112)]==='env'&&!(_0x5d491e[_0x50806a(0x14b)]in process.env))throw CliErrors[_0x50806a(0x145)](_0x50806a(0x12b)+_0x5d491e[_0x50806a(0x14b)]);if(_0x5d491e[_0x50806a(0x112)]===_0x50806a(0x13c))try{await access(_0x5d491e[_0x50806a(0x115)]);}catch{throw CliErrors[_0x50806a(0x145)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x5d491e[_0x50806a(0x115)]);}}export async function readAppConfigValue(_0x13b673){const _0x2387e8=a29_0x48893d,_0x4e7245=assertSingleValueSource(_0x13b673),_0x33107d=[];if(_0x4e7245[_0x2387e8(0x112)]==='argument')return _0x33107d[_0x2387e8(0x14f)](_0x2387e8(0x14d)),{'value':_0x4e7245[_0x2387e8(0x125)]??'','source':_0x4e7245[_0x2387e8(0x112)],'warnings':_0x33107d};if(_0x4e7245['kind']===_0x2387e8(0x143))return{'value':await readStdin(),'source':_0x4e7245[_0x2387e8(0x112)],'warnings':_0x33107d};if(_0x4e7245[_0x2387e8(0x112)]===_0x2387e8(0x149)){if(!(_0x4e7245['name']in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x4e7245[_0x2387e8(0x14b)]);return{'value':process.env[_0x4e7245.name]??'','source':_0x4e7245[_0x2387e8(0x112)],'warnings':_0x33107d};}return{'value':await readFile(_0x4e7245[_0x2387e8(0x115)],'utf8'),'source':_0x4e7245[_0x2387e8(0x112)],'warnings':_0x33107d};}function readStdin(){return new Promise((_0x40f14f,_0x1fd3b3)=>{const _0x55802c=a29_0x2bca;let _0x10d3d9='';process['stdin'][_0x55802c(0x13f)](_0x55802c(0x122)),process[_0x55802c(0x143)]['on'](_0x55802c(0x11a),_0x4283db=>{_0x10d3d9+=_0x4283db;}),process[_0x55802c(0x143)][_0x55802c(0x113)](_0x55802c(0x136),()=>_0x40f14f(_0x10d3d9)),process['stdin'][_0x55802c(0x113)](_0x55802c(0x13d),_0x1fd3b3);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x58399a=a30_0xe890;function a30_0x54af(){const _0x27e2ce=['521087efPtaG','bool','6aaJseB','42NtIEQQ','login','log','923228vHzfSH','650038IRMlFJ','758408qmwOlL','13838450tYzXoO','nonInteractive','99qpvSYs','!\x20Not\x20logged\x20in','write','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','../../auth/auth-server-ui.js','1449940WWnJKA','Login\x20via\x20browser','Clear\x20login\x20session','109544KbpHaB','yes','auth','logout','boolean'];a30_0x54af=function(){return _0x27e2ce;};return a30_0x54af();}(function(_0x5bdfd3,_0x28ec43){const _0x2b2172=a30_0xe890,_0x1fcda4=_0x5bdfd3();while(!![]){try{const _0x5cbca8=-parseInt(_0x2b2172(0x99))/0x1+-parseInt(_0x2b2172(0x98))/0x2+-parseInt(_0x2b2172(0xab))/0x3*(-parseInt(_0x2b2172(0x97))/0x4)+parseInt(_0x2b2172(0xa1))/0x5+-parseInt(_0x2b2172(0x94))/0x6*(parseInt(_0x2b2172(0xa9))/0x7)+-parseInt(_0x2b2172(0xa4))/0x8*(parseInt(_0x2b2172(0x9c))/0x9)+parseInt(_0x2b2172(0x9a))/0xa;if(_0x5cbca8===_0x28ec43)break;else _0x1fcda4['push'](_0x1fcda4['shift']());}catch(_0x10915e){_0x1fcda4['push'](_0x1fcda4['shift']());}}}(a30_0x54af,0x5cd96));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a30_0xe890(_0x1cce73,_0x1ce519){_0x1cce73=_0x1cce73-0x94;const _0x54af2b=a30_0x54af();let _0xe89033=_0x54af2b[_0x1cce73];return _0xe89033;}export const authDefinitions=[{'service':a30_0x58399a(0xa6),'command':a30_0x58399a(0x95),'description':a30_0x58399a(0xa2),'risk':a30_0x58399a(0x9e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a30_0x58399a(0xa8),'description':a30_0x58399a(0x9f),'default':![]}],async 'execute'(_0x369799){const _0x3a791f=a30_0x58399a,{runAuthServer:_0x5111d4}=await import(_0x3a791f(0xa0));return await _0x5111d4({'autoYes':_0x369799[_0x3a791f(0xaa)](_0x3a791f(0xa5)),'nonInteractive':_0x369799[_0x3a791f(0x9b)]}),{'ok':!![]};}},{'service':a30_0x58399a(0xa6),'command':a30_0x58399a(0xa7),'description':a30_0x58399a(0xa3),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x47b36a){const _0x3d3eac=a30_0x58399a;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x3d3eac(0x96)]('✓\x20Logged\x20out')):console[_0x3d3eac(0x96)](_0x3d3eac(0x9d)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0xe97cc4=a31_0x1c94;function a31_0x1c94(_0x1d0ddc,_0xc5fe61){_0x1d0ddc=_0x1d0ddc-0x1eb;const _0x2bcbac=a31_0x2bcb();let _0x1c94a4=_0x2bcbac[_0x1d0ddc];return _0x1c94a4;}(function(_0x337959,_0x3ef6c6){const _0x3ae163=a31_0x1c94,_0x75cf41=_0x337959();while(!![]){try{const _0x35b533=-parseInt(_0x3ae163(0x228))/0x1+parseInt(_0x3ae163(0x226))/0x2*(-parseInt(_0x3ae163(0x232))/0x3)+parseInt(_0x3ae163(0x23c))/0x4+parseInt(_0x3ae163(0x1f7))/0x5*(-parseInt(_0x3ae163(0x241))/0x6)+-parseInt(_0x3ae163(0x1fa))/0x7*(parseInt(_0x3ae163(0x244))/0x8)+-parseInt(_0x3ae163(0x1eb))/0x9*(parseInt(_0x3ae163(0x1f2))/0xa)+parseInt(_0x3ae163(0x20e))/0xb;if(_0x35b533===_0x3ef6c6)break;else _0x75cf41['push'](_0x75cf41['shift']());}catch(_0x1b3959){_0x75cf41['push'](_0x75cf41['shift']());}}}(a31_0x2bcb,0x379aa));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a31_0x2bcb(){const _0xfe774a=['type','Function\x20name\x20(valid\x20JS\x20identifier)','Invalid\x20dataset\x20selection.','trim','修改后的响应结果','HOOK','1791TSqbBg','question','No\x20api.ts\x20found.\x20Run\x20`','Available:\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','before','create','8980sHFgje','appCode','map','\x22,\x20params\x20})\x0a','entries','5LhJCeB','File\x20already\x20exists:\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','7xaGKEh','/COMMON/','COMMON','HOOK\x20requires\x20alias/operation/node\x20options.','parseInt',']\x20(','Script\x20description','\x20function:\x20','alias','No\x20datasets\x20found\x20for\x20this\x20app.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','str','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20(HOOK\x20only)','stderr','read','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','includes','Select\x20dataset:','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','16288492lqKEoj','\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','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','close','datasetCode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','datasetId','find','Select\x20operation\x20type:','Select\x20trigger\x20node:','Dataset\x20not\x20found\x20for\x20code\x20\x22','length','/HOOK/','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','functionNode','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','修改后的请求参数','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','after','validation','Available\x20aliases:\x20','description','Operation\x20type\x20\x22','14fqodeq','\x22\x20not\x20found.\x20','241984peiwaV','Alias\x20\x22','当前请求参数','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','ENDPOINT','utf8','\x20api\x20pull`\x20to\x20refresh.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','175278SxVjfn','function-node','operationType','Trigger\x20node\x20(HOOK\x20only)','isInteger','source','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x22\x20not\x20found\x20for\x20dataset\x20','.js','nonInteractive','550184PrayBy','datasetcode','/data/dataset/','\x0a\x20*\x20[平台配置]\x20','.js\x0a\x20*\x20[触发节点]\x20','889242jpficR','Created\x20','\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','3301512aitprO','apiDir','当前响应结果','name','/**\x0a\x20*\x20','operation-type','UNKNOWN','code','scriptsRootDir','join','\x22.\x20','write','string'];a31_0x2bcb=function(){return _0xfe774a;};return a31_0x2bcb();}import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':a31_0xe97cc4(0x1f1),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0xe97cc4(0x209),'flags':[{'name':a31_0xe97cc4(0x251),'type':a31_0xe97cc4(0x250),'required':!![],'enum':[a31_0xe97cc4(0x1fc),a31_0xe97cc4(0x22d),a31_0xe97cc4(0x256)],'description':'Script\x20type'},{'name':a31_0xe97cc4(0x247),'type':a31_0xe97cc4(0x250),'required':!![],'description':a31_0xe97cc4(0x252)},{'name':a31_0xe97cc4(0x224),'type':'string','description':a31_0xe97cc4(0x200)},{'name':a31_0xe97cc4(0x202),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x1ef)},{'name':a31_0xe97cc4(0x23d),'type':a31_0xe97cc4(0x250),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a31_0xe97cc4(0x249),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x207)},{'name':a31_0xe97cc4(0x233),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x235),'enum':[a31_0xe97cc4(0x1f0),a31_0xe97cc4(0x221)]}],async 'validate'(_0x3fd061){const _0x1e5910=a31_0xe97cc4,_0x170561=_0x3fd061[_0x1e5910(0x205)](_0x1e5910(0x247));if(!isValidBffFunctionName(_0x170561))throw CliErrors[_0x1e5910(0x222)]('Invalid\x20function\x20name\x20\x22'+_0x170561+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0xfaa144){const _0x5f56b8=a31_0xe97cc4,_0x3a6b2b=loadBffProjectConfig(_0xfaa144[_0x5f56b8(0x1f3)]),_0x40cb46=_0xfaa144['str']('type'),_0xc4ca46=_0xfaa144[_0x5f56b8(0x205)](_0x5f56b8(0x247)),_0x4f1be7=_0xfaa144['str'](_0x5f56b8(0x224))||undefined,_0x3828e3=_0x40cb46===_0x5f56b8(0x256)?await resolveHookOptions(_0x3a6b2b,_0xfaa144):undefined,_0x246af3=buildFilePath(_0x3a6b2b,_0x40cb46,_0xc4ca46,_0x3828e3);if(await fileExists(_0x246af3))throw CliErrors[_0x5f56b8(0x222)](_0x5f56b8(0x1f8)+_0x246af3);await mkdir(dirname(_0x246af3),{'recursive':!![]});const _0x4efaab=generateTemplate(_0x40cb46,_0xc4ca46,_0xfaa144['appCode'],_0x4f1be7,_0x3828e3);await writeFile(_0x246af3,_0x4efaab,_0x5f56b8(0x22e));const _0x3e354f={'type':_0x40cb46,'name':_0xc4ca46,'path':_0x246af3};if(_0x4f1be7)_0x3e354f[_0x5f56b8(0x224)]=_0x4f1be7;if(_0x3828e3){if(_0x3828e3['alias'])_0x3e354f[_0x5f56b8(0x202)]=_0x3828e3[_0x5f56b8(0x202)];_0x3e354f[_0x5f56b8(0x212)]=_0x3828e3[_0x5f56b8(0x212)],_0x3e354f[_0x5f56b8(0x234)]=_0x3828e3[_0x5f56b8(0x234)],_0x3e354f[_0x5f56b8(0x21d)]=_0x3828e3['functionNode'];}return{'ok':!![],'data':_0x3e354f,'message':_0x5f56b8(0x242)+_0x40cb46+_0x5f56b8(0x201)+_0xc4ca46};}};async function resolveHookOptions(_0x54c3eb,_0xbc3d59){const _0x3cf33e=a31_0xe97cc4,_0x1fa789=loadAliasMap(_0xbc3d59['apiDir'],undefined,resolveApiFilePath(_0xbc3d59[_0x3cf33e(0x245)],_0xbc3d59['appCode'])),_0x245618=_0x1fa789[_0x3cf33e(0x21a)]>0x0;let _0x5c916d,_0xdf60b0,_0x2f1a6a;const _0x202a7a=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x202)),_0x5a756b=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x23d));if(_0x202a7a){const _0x105a25=resolveAlias(_0xbc3d59['apiDir'],_0x202a7a,undefined,resolveApiFilePath(_0xbc3d59[_0x3cf33e(0x245)],_0xbc3d59[_0x3cf33e(0x1f3)]));if(!_0x105a25){const _0x17e661=_0x245618?_0x3cf33e(0x223)+_0x1fa789['map'](_0x39ef01=>_0x39ef01['alias'])[_0x3cf33e(0x24d)](',\x20'):_0x3cf33e(0x1ed)+CLI_BIN_NAME+_0x3cf33e(0x20d);throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x229)+_0x202a7a+_0x3cf33e(0x227)+_0x17e661);}_0x5c916d=_0x202a7a,_0xdf60b0=_0x105a25;}else{if(_0x5a756b){_0xdf60b0=_0x5a756b;const _0x54f6bc=_0x1fa789[_0x3cf33e(0x216)](_0x2136c8=>_0x2136c8['datasetCode']===_0x5a756b);_0x5c916d=_0x54f6bc?.['alias'];}else{if(_0xbc3d59['nonInteractive'])throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x1f9));else{if(_0x245618){const _0x3d8736=_0x1fa789['map'](_0x463d51=>_0x463d51[_0x3cf33e(0x202)]+'\x20('+_0x463d51['tableName']+')'),_0x268b6c=await promptSelect('Select\x20dataset:',_0x3d8736),_0x1d1fb0=_0x1fa789[_0x268b6c];if(!_0x1d1fb0)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x253));_0x5c916d=_0x1d1fb0['alias'],_0xdf60b0=_0x1d1fb0[_0x3cf33e(0x212)];}else{const _0x4cf5e1=await listDatasets(_0xbc3d59[_0x3cf33e(0x1f3)]);if(_0x4cf5e1[_0x3cf33e(0x21a)]===0x0)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x203));const _0x26564c=_0x4cf5e1[_0x3cf33e(0x1f4)](_0x1a5a5c=>_0x1a5a5c[_0x3cf33e(0x247)]+'\x20['+(_0x1a5a5c[_0x3cf33e(0x237)]??_0x3cf33e(0x24a))+_0x3cf33e(0x1ff)+_0x1a5a5c['code']+')'),_0x554f5e=await promptSelect(_0x3cf33e(0x20c),_0x26564c),_0xff6fe8=_0x4cf5e1[_0x554f5e];if(!_0xff6fe8)throw CliErrors['validation'](_0x3cf33e(0x253));_0xdf60b0=_0xff6fe8['code'],_0x5c916d=undefined;}}}}const _0xf0af1c=await listDatasets(_0xbc3d59[_0x3cf33e(0x1f3)]),_0x408ec4=_0xf0af1c[_0x3cf33e(0x216)](_0x3452a9=>_0x3452a9[_0x3cf33e(0x24b)]===_0xdf60b0);if(!_0x408ec4)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x219)+_0xdf60b0+_0x3cf33e(0x24e)+(_0x5c916d?_0x3cf33e(0x204)+CLI_BIN_NAME+_0x3cf33e(0x22f):''));_0x2f1a6a=_0x408ec4['id'];const _0x224a0f=_0x5c916d??_0xdf60b0,_0x3b60e8=await listBffDatasetOperations(_0xbc3d59[_0x3cf33e(0x1f3)],_0x2f1a6a),_0x119c41=_0x3b60e8?Object['keys'](_0x3b60e8):[];if(_0x119c41[_0x3cf33e(0x21a)]===0x0)throw CliErrors[_0x3cf33e(0x222)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x224a0f+'.');let _0x169e79;const _0x4520ca=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x249));if(_0x4520ca){if(!_0x119c41[_0x3cf33e(0x20b)](_0x4520ca))throw CliErrors['validation'](_0x3cf33e(0x225)+_0x4520ca+_0x3cf33e(0x239)+_0x224a0f+'.\x20'+(_0x3cf33e(0x1ee)+_0x119c41['join'](',\x20')));_0x169e79=_0x4520ca;}else{if(_0xbc3d59[_0x3cf33e(0x23b)])throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x22b));const _0x512f71=await promptSelect(_0x3cf33e(0x217),_0x119c41);_0x169e79=_0x119c41[_0x512f71]??_0x119c41[0x0];}let _0x4d2bc6=normalizeHookFunctionNode(_0xbc3d59['str']('function-node'));if(!_0x4d2bc6){if(_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x233)))throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x210));if(_0xbc3d59[_0x3cf33e(0x23b)])throw CliErrors[_0x3cf33e(0x222)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x13b7ef=await promptSelect(_0x3cf33e(0x218),['before',_0x3cf33e(0x221)]);_0x4d2bc6=[_0x3cf33e(0x1f0),_0x3cf33e(0x221)][_0x13b7ef]??_0x3cf33e(0x1f0);}return{'alias':_0x5c916d,'datasetCode':_0xdf60b0,'datasetId':_0x2f1a6a,'operationType':_0x169e79,'functionNode':_0x4d2bc6};}async function promptSelect(_0x16f874,_0x10ca7e){const _0x86efd3=a31_0xe97cc4;if(_0x10ca7e[_0x86efd3(0x21a)]===0x1)return 0x0;for(const [_0x27998a,_0x2fedaa]of _0x10ca7e[_0x86efd3(0x1f6)]()){process['stderr'][_0x86efd3(0x24f)]('\x20\x20'+(_0x27998a+0x1)+'.\x20'+_0x2fedaa+'\x0a');}const _0x2f7a4b=createInterface({'input':process['stdin'],'output':process[_0x86efd3(0x208)]});while(!![]){const _0x961a31=await new Promise(_0x27c279=>{const _0x503efb=_0x86efd3;_0x2f7a4b[_0x503efb(0x1ec)](_0x16f874+'\x20',_0x27c279);}),_0xaf8e26=Number[_0x86efd3(0x1fe)](_0x961a31['trim'](),0xa);if(Number[_0x86efd3(0x236)](_0xaf8e26)&&_0xaf8e26>=0x1&&_0xaf8e26<=_0x10ca7e[_0x86efd3(0x21a)])return _0x2f7a4b[_0x86efd3(0x211)](),_0xaf8e26-0x1;process[_0x86efd3(0x208)][_0x86efd3(0x24f)](_0x86efd3(0x220)+_0x10ca7e[_0x86efd3(0x21a)]+'.\x0a');}}function buildFilePath(_0x175c97,_0x7b0c5,_0x4ca6dc,_0x50d2e6){const _0x1f5b49=a31_0xe97cc4;if(_0x7b0c5===_0x1f5b49(0x256)){if(!_0x50d2e6)throw CliErrors[_0x1f5b49(0x222)](_0x1f5b49(0x1fd));const _0x4e2557=_0x50d2e6[_0x1f5b49(0x202)]??_0x50d2e6['datasetCode'];return join(_0x175c97[_0x1f5b49(0x24c)],'HOOK',_0x4e2557,_0x50d2e6[_0x1f5b49(0x234)],_0x50d2e6[_0x1f5b49(0x21d)],_0x4ca6dc+_0x1f5b49(0x23a));}return join(_0x175c97[_0x1f5b49(0x24c)],_0x7b0c5,_0x4ca6dc+_0x1f5b49(0x23a));}export function generateTemplate(_0xf7c742,_0x4c6f6e,_0x324264,_0x51f6b1,_0x4e0630){const _0x149395=a31_0xe97cc4,_0x4162ae=_0x51f6b1?.[_0x149395(0x254)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x220dda=getAppBaseUrl(_0x324264),_0x159217='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0xf7c742==='COMMON')return'/**\x0a\x20*\x20'+_0x4162ae+_0x149395(0x206)+_0x4c6f6e+_0x149395(0x23f)+_0x220dda+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x324264+_0x149395(0x1fb)+_0x4c6f6e+_0x149395(0x214)+_0x4c6f6e+_0x149395(0x1f5)+_0x159217+_0x149395(0x243)+_0x4c6f6e+_0x149395(0x238);if(_0xf7c742===_0x149395(0x22d))return'/**\x0a\x20*\x20'+_0x4162ae+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x4c6f6e+_0x149395(0x20a)+_0x324264+'/'+_0x4c6f6e+_0x149395(0x23f)+_0x220dda+_0x149395(0x21e)+_0x324264+'/ENDPOINT/'+_0x4c6f6e+'.js\x0a'+_0x159217+_0x149395(0x20f)+_0x4c6f6e+_0x149395(0x238);if(!_0x4e0630)throw CliErrors[_0x149395(0x222)](_0x149395(0x230));const _0x3363ab=_0x4e0630[_0x149395(0x202)]??_0x4e0630[_0x149395(0x212)],_0x1342cd=_0x4e0630['functionNode']===_0x149395(0x1f0)?_0x149395(0x22a):_0x149395(0x246),_0x7a8f09=_0x4e0630['functionNode']===_0x149395(0x1f0)?_0x149395(0x21f):_0x149395(0x255);return _0x149395(0x248)+_0x4162ae+_0x149395(0x22c)+_0x4c6f6e+_0x149395(0x213)+_0x324264+'/'+_0x4e0630[_0x149395(0x212)]+'/'+_0x4e0630['operationType']+_0x149395(0x23f)+_0x220dda+_0x149395(0x23e)+_0x4e0630[_0x149395(0x215)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x324264+_0x149395(0x21b)+_0x3363ab+'/'+_0x4e0630[_0x149395(0x234)]+'/'+_0x4e0630['functionNode']+'/'+_0x4c6f6e+_0x149395(0x240)+_0x4e0630[_0x149395(0x21d)]+'\x0a'+_0x159217+_0x149395(0x231)+_0x1342cd+_0x149395(0x21c)+_0x7a8f09+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4c6f6e+_0x149395(0x238);}
|
|
1
|
+
const a31_0x6e3d6a=a31_0x5f23;(function(_0x288bb4,_0x112125){const _0x20457d=a31_0x5f23,_0x2dc60c=_0x288bb4();while(!![]){try{const _0x56b3d4=parseInt(_0x20457d(0x15b))/0x1+parseInt(_0x20457d(0x14b))/0x2+-parseInt(_0x20457d(0x16d))/0x3+parseInt(_0x20457d(0x162))/0x4+parseInt(_0x20457d(0x169))/0x5+parseInt(_0x20457d(0x158))/0x6+-parseInt(_0x20457d(0x171))/0x7*(parseInt(_0x20457d(0x17f))/0x8);if(_0x56b3d4===_0x112125)break;else _0x2dc60c['push'](_0x2dc60c['shift']());}catch(_0x1f5307){_0x2dc60c['push'](_0x2dc60c['shift']());}}}(a31_0x4a31,0x279f5));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';function a31_0x4a31(){const _0x43d39c=['HOOK','File\x20already\x20exists:\x20','/ENDPOINT/','545655ddtvBV','/data/dataset/','\x22\x20not\x20found\x20for\x20dataset\x20','stdin','2317987ISaKzZ','.js\x0a\x20*\x20[触发节点]\x20','apiDir','scriptsRootDir','\x22\x20not\x20found.\x20','Created\x20','Function\x20name\x20(valid\x20JS\x20identifier)','HOOK\x20requires\x20alias/operation/node\x20options.','\x20function:\x20','stderr','appCode','includes','datasetcode','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','8NMBbjj','Script\x20type','question','Dataset\x20not\x20found\x20for\x20code\x20\x22','Trigger\x20node\x20(HOOK\x20only)','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','operation-type','No\x20api.ts\x20found.\x20Run\x20`','join','bff','/**\x0a\x20*\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x22.\x20','find','Script\x20description','\x22,\x20params\x20})\x0a','\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','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','name','Alias\x20\x22','functionNode','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Select\x20operation\x20type:','UNKNOWN','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','parseInt','\x0a\x20*\x20[平台配置]\x20','length',']\x20(','trim','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','datasetCode','str','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','utf8','nonInteractive','No\x20datasets\x20found\x20for\x20this\x20app.','datasetId','create','ENDPOINT','string','function-node','\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','Select\x20trigger\x20node:','map','validation','operationType','alias','source','before','125156eGJMHN','write','keys','当前请求参数','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Invalid\x20dataset\x20selection.','type','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','当前响应结果','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','Available:\x20','/HOOK/','1904346cbNeRf','Select\x20dataset:','tableName','233526DJPcHj','isInteger','COMMON','after','修改后的响应结果','.js\x0a','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','64828oclVwp','Operation\x20type\x20\x22','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','description','read','/COMMON/','code','228085oMAsqx'];a31_0x4a31=function(){return _0x43d39c;};return a31_0x4a31();}import{dirname,join}from'node:path';function a31_0x5f23(_0x36ca5e,_0x3dfb61){_0x36ca5e=_0x36ca5e-0x132;const _0x4a31cc=a31_0x4a31();let _0x5f237c=_0x4a31cc[_0x36ca5e];return _0x5f237c;}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';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x6e3d6a(0x189),'command':a31_0x6e3d6a(0x13f),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0x6e3d6a(0x166),'flags':[{'name':a31_0x6e3d6a(0x152),'type':'string','required':!![],'enum':[a31_0x6e3d6a(0x15d),'ENDPOINT','HOOK'],'description':a31_0x6e3d6a(0x180)},{'name':'name','type':'string','required':!![],'description':a31_0x6e3d6a(0x177)},{'name':a31_0x6e3d6a(0x165),'type':a31_0x6e3d6a(0x141),'description':a31_0x6e3d6a(0x18e)},{'name':'alias','type':a31_0x6e3d6a(0x141),'description':a31_0x6e3d6a(0x185)},{'name':a31_0x6e3d6a(0x17d),'type':a31_0x6e3d6a(0x141),'description':a31_0x6e3d6a(0x13a)},{'name':'operation-type','type':a31_0x6e3d6a(0x141),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a31_0x6e3d6a(0x142),'type':a31_0x6e3d6a(0x141),'description':a31_0x6e3d6a(0x183),'enum':[a31_0x6e3d6a(0x14a),'after']}],async 'validate'(_0x53ee37){const _0x3f072a=a31_0x6e3d6a,_0x4e64d1=_0x53ee37[_0x3f072a(0x139)](_0x3f072a(0x192));if(!isValidBffFunctionName(_0x4e64d1))throw CliErrors[_0x3f072a(0x146)]('Invalid\x20function\x20name\x20\x22'+_0x4e64d1+_0x3f072a(0x164));},async 'execute'(_0x3d778a){const _0x1209a0=a31_0x6e3d6a,_0x29c8f6=loadBffProjectConfig(_0x3d778a[_0x1209a0(0x17b)]),_0x59b791=_0x3d778a['str'](_0x1209a0(0x152)),_0x1b4edc=_0x3d778a['str'](_0x1209a0(0x192)),_0x1eaec8=_0x3d778a[_0x1209a0(0x139)](_0x1209a0(0x165))||undefined,_0x4f1985=_0x59b791===_0x1209a0(0x16a)?await resolveHookOptions(_0x29c8f6,_0x3d778a):undefined,_0x5029bd=buildFilePath(_0x29c8f6,_0x59b791,_0x1b4edc,_0x4f1985);if(await fileExists(_0x5029bd))throw CliErrors['validation'](_0x1209a0(0x16b)+_0x5029bd);await mkdir(dirname(_0x5029bd),{'recursive':!![]});const _0x3be3de=generateTemplate(_0x59b791,_0x1b4edc,_0x3d778a[_0x1209a0(0x17b)],_0x1eaec8,_0x4f1985);await writeFile(_0x5029bd,_0x3be3de,_0x1209a0(0x13b));const _0x1a6fee={'type':_0x59b791,'name':_0x1b4edc,'path':_0x5029bd};if(_0x1eaec8)_0x1a6fee[_0x1209a0(0x165)]=_0x1eaec8;if(_0x4f1985){if(_0x4f1985['alias'])_0x1a6fee[_0x1209a0(0x148)]=_0x4f1985[_0x1209a0(0x148)];_0x1a6fee[_0x1209a0(0x138)]=_0x4f1985['datasetCode'],_0x1a6fee['operationType']=_0x4f1985[_0x1209a0(0x147)],_0x1a6fee['functionNode']=_0x4f1985['functionNode'];}return{'ok':!![],'data':_0x1a6fee,'message':_0x1209a0(0x176)+_0x59b791+_0x1209a0(0x179)+_0x1b4edc};}};async function resolveHookOptions(_0x562605,_0x4cea96){const _0x534396=a31_0x6e3d6a,_0x760d93=loadAliasMap(_0x4cea96[_0x534396(0x173)],undefined,resolveApiFilePath(_0x4cea96['apiDir'],_0x4cea96[_0x534396(0x17b)])),_0x21f9a8=_0x760d93[_0x534396(0x134)]>0x0;let _0x1ffd11,_0xf784dd,_0x855c21;const _0x55f494=_0x4cea96[_0x534396(0x139)]('alias'),_0x7ddbf2=_0x4cea96[_0x534396(0x139)](_0x534396(0x17d));if(_0x55f494){const _0x28138f=resolveAlias(_0x4cea96['apiDir'],_0x55f494,undefined,resolveApiFilePath(_0x4cea96[_0x534396(0x173)],_0x4cea96[_0x534396(0x17b)]));if(!_0x28138f){const _0x1232e3=_0x21f9a8?'Available\x20aliases:\x20'+_0x760d93[_0x534396(0x145)](_0x58b7f4=>_0x58b7f4[_0x534396(0x148)])[_0x534396(0x188)](',\x20'):_0x534396(0x187)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x534396(0x146)](_0x534396(0x193)+_0x55f494+_0x534396(0x175)+_0x1232e3);}_0x1ffd11=_0x55f494,_0xf784dd=_0x28138f;}else{if(_0x7ddbf2){_0xf784dd=_0x7ddbf2;const _0x2736af=_0x760d93['find'](_0x5811d6=>_0x5811d6[_0x534396(0x138)]===_0x7ddbf2);_0x1ffd11=_0x2736af?.[_0x534396(0x148)];}else{if(_0x4cea96[_0x534396(0x13c)])throw CliErrors[_0x534396(0x146)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x21f9a8){const _0xba67fb=_0x760d93[_0x534396(0x145)](_0x46f998=>_0x46f998[_0x534396(0x148)]+'\x20('+_0x46f998[_0x534396(0x15a)]+')'),_0x48238f=await promptSelect(_0x534396(0x159),_0xba67fb),_0x3244db=_0x760d93[_0x48238f];if(!_0x3244db)throw CliErrors[_0x534396(0x146)](_0x534396(0x151));_0x1ffd11=_0x3244db[_0x534396(0x148)],_0xf784dd=_0x3244db[_0x534396(0x138)];}else{const _0x1c9ca3=await listDatasets(_0x4cea96[_0x534396(0x17b)]);if(_0x1c9ca3[_0x534396(0x134)]===0x0)throw CliErrors['validation'](_0x534396(0x13d));const _0x95dd0d=_0x1c9ca3[_0x534396(0x145)](_0x9ccf96=>_0x9ccf96[_0x534396(0x192)]+'\x20['+(_0x9ccf96[_0x534396(0x149)]??_0x534396(0x197))+_0x534396(0x135)+_0x9ccf96[_0x534396(0x168)]+')'),_0x33d376=await promptSelect(_0x534396(0x159),_0x95dd0d),_0x1f4ab2=_0x1c9ca3[_0x33d376];if(!_0x1f4ab2)throw CliErrors[_0x534396(0x146)](_0x534396(0x151));_0xf784dd=_0x1f4ab2[_0x534396(0x168)],_0x1ffd11=undefined;}}}}const _0x1bef95=await listDatasets(_0x4cea96[_0x534396(0x17b)]),_0x2f9200=_0x1bef95[_0x534396(0x18d)](_0x3c54bb=>_0x3c54bb[_0x534396(0x168)]===_0xf784dd);if(!_0x2f9200)throw CliErrors[_0x534396(0x146)](_0x534396(0x182)+_0xf784dd+_0x534396(0x18c)+(_0x1ffd11?_0x534396(0x191)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x855c21=_0x2f9200['id'];const _0x3a4b06=_0x1ffd11??_0xf784dd,_0x402d20=await listBffDatasetOperations(_0x4cea96['appCode'],_0x855c21),_0x392b68=_0x402d20?Object[_0x534396(0x14d)](_0x402d20):[];if(_0x392b68[_0x534396(0x134)]===0x0)throw CliErrors[_0x534396(0x146)](_0x534396(0x184)+_0x3a4b06+'.');let _0xb58b81;const _0x4b4cbf=_0x4cea96[_0x534396(0x139)](_0x534396(0x186));if(_0x4b4cbf){if(!_0x392b68[_0x534396(0x17c)](_0x4b4cbf))throw CliErrors[_0x534396(0x146)](_0x534396(0x163)+_0x4b4cbf+_0x534396(0x16f)+_0x3a4b06+'.\x20'+(_0x534396(0x156)+_0x392b68['join'](',\x20')));_0xb58b81=_0x4b4cbf;}else{if(_0x4cea96['nonInteractive'])throw CliErrors[_0x534396(0x146)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x39309f=await promptSelect(_0x534396(0x196),_0x392b68);_0xb58b81=_0x392b68[_0x39309f]??_0x392b68[0x0];}let _0x2bc613=normalizeHookFunctionNode(_0x4cea96[_0x534396(0x139)](_0x534396(0x142)));if(!_0x2bc613){if(_0x4cea96['str'](_0x534396(0x142)))throw CliErrors[_0x534396(0x146)](_0x534396(0x17e));if(_0x4cea96[_0x534396(0x13c)])throw CliErrors[_0x534396(0x146)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x3a63f4=await promptSelect(_0x534396(0x144),[_0x534396(0x14a),_0x534396(0x15e)]);_0x2bc613=[_0x534396(0x14a),'after'][_0x3a63f4]??_0x534396(0x14a);}return{'alias':_0x1ffd11,'datasetCode':_0xf784dd,'datasetId':_0x855c21,'operationType':_0xb58b81,'functionNode':_0x2bc613};}async function promptSelect(_0x3b68c8,_0x5df6d0){const _0x556375=a31_0x6e3d6a;if(_0x5df6d0[_0x556375(0x134)]===0x1)return 0x0;for(const [_0x6c5083,_0x42b5ff]of _0x5df6d0['entries']()){process[_0x556375(0x17a)][_0x556375(0x14c)]('\x20\x20'+(_0x6c5083+0x1)+'.\x20'+_0x42b5ff+'\x0a');}const _0x53b16e=createInterface({'input':process[_0x556375(0x170)],'output':process[_0x556375(0x17a)]});while(!![]){const _0x30196c=await new Promise(_0x4a9e11=>{const _0x97b4a2=_0x556375;_0x53b16e[_0x97b4a2(0x181)](_0x3b68c8+'\x20',_0x4a9e11);}),_0x2ef8d8=Number[_0x556375(0x132)](_0x30196c[_0x556375(0x136)](),0xa);if(Number[_0x556375(0x15c)](_0x2ef8d8)&&_0x2ef8d8>=0x1&&_0x2ef8d8<=_0x5df6d0[_0x556375(0x134)])return _0x53b16e['close'](),_0x2ef8d8-0x1;process[_0x556375(0x17a)]['write'](_0x556375(0x195)+_0x5df6d0[_0x556375(0x134)]+'.\x0a');}}function buildFilePath(_0x4187b3,_0x226762,_0x138922,_0x24e7d9){const _0x44fe88=a31_0x6e3d6a;if(_0x226762===_0x44fe88(0x16a)){if(!_0x24e7d9)throw CliErrors[_0x44fe88(0x146)](_0x44fe88(0x178));const _0x290dca=_0x24e7d9[_0x44fe88(0x148)]??_0x24e7d9[_0x44fe88(0x138)];return join(_0x4187b3[_0x44fe88(0x174)],_0x44fe88(0x16a),_0x290dca,_0x24e7d9[_0x44fe88(0x147)],_0x24e7d9[_0x44fe88(0x194)],_0x138922+'.js');}return join(_0x4187b3[_0x44fe88(0x174)],_0x226762,_0x138922+'.js');}export function generateTemplate(_0x5e117e,_0x5bb1be,_0x2d77eb,_0x33f83d,_0xb47ad){const _0x80029a=a31_0x6e3d6a,_0x44f0b0=_0x33f83d?.[_0x80029a(0x136)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x46d8f7=getAppBaseUrl(_0x2d77eb),_0x31c929='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x5e117e===_0x80029a(0x15d))return _0x80029a(0x18a)+_0x44f0b0+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x5bb1be+_0x80029a(0x133)+_0x46d8f7+_0x80029a(0x18b)+_0x2d77eb+_0x80029a(0x167)+_0x5bb1be+_0x80029a(0x161)+_0x5bb1be+_0x80029a(0x18f)+_0x31c929+_0x80029a(0x143)+_0x5bb1be+_0x80029a(0x137);if(_0x5e117e===_0x80029a(0x140))return _0x80029a(0x18a)+_0x44f0b0+_0x80029a(0x198)+_0x5bb1be+_0x80029a(0x155)+_0x2d77eb+'/'+_0x5bb1be+_0x80029a(0x133)+_0x46d8f7+_0x80029a(0x18b)+_0x2d77eb+_0x80029a(0x16c)+_0x5bb1be+_0x80029a(0x160)+_0x31c929+_0x80029a(0x190)+_0x5bb1be+_0x80029a(0x137);if(!_0xb47ad)throw CliErrors[_0x80029a(0x146)](_0x80029a(0x150));const _0x7dbccf=_0xb47ad[_0x80029a(0x148)]??_0xb47ad[_0x80029a(0x138)],_0xf30fb6=_0xb47ad[_0x80029a(0x194)]==='before'?_0x80029a(0x14e):_0x80029a(0x154),_0x514fa6=_0xb47ad[_0x80029a(0x194)]==='before'?'修改后的请求参数':_0x80029a(0x15f);return'/**\x0a\x20*\x20'+_0x44f0b0+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x5bb1be+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x2d77eb+'/'+_0xb47ad[_0x80029a(0x138)]+'/'+_0xb47ad[_0x80029a(0x147)]+_0x80029a(0x133)+_0x46d8f7+_0x80029a(0x16e)+_0xb47ad[_0x80029a(0x13e)]+_0x80029a(0x153)+_0x2d77eb+_0x80029a(0x157)+_0x7dbccf+'/'+_0xb47ad[_0x80029a(0x147)]+'/'+_0xb47ad['functionNode']+'/'+_0x5bb1be+_0x80029a(0x172)+_0xb47ad[_0x80029a(0x194)]+'\x0a'+_0x31c929+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0xf30fb6+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x514fa6+_0x80029a(0x14f)+_0x5bb1be+_0x80029a(0x137);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a32_0x3cad(_0x1d12d7,_0x4e6f8e){_0x1d12d7=_0x1d12d7-0x19b;const _0x1e1d03=a32_0x1e1d();let _0x3cada6=_0x1e1d03[_0x1d12d7];return _0x3cada6;}const a32_0x201ae4=a32_0x3cad;(function(_0xdedad7,_0x4aba21){const _0x22f387=a32_0x3cad,_0x296f0e=_0xdedad7();while(!![]){try{const _0x4250c2=parseInt(_0x22f387(0x1b2))/0x1+-parseInt(_0x22f387(0x1b3))/0x2+parseInt(_0x22f387(0x1b4))/0x3+parseInt(_0x22f387(0x19d))/0x4*(parseInt(_0x22f387(0x19e))/0x5)+parseInt(_0x22f387(0x1b8))/0x6*(parseInt(_0x22f387(0x1a1))/0x7)+parseInt(_0x22f387(0x1cb))/0x8*(parseInt(_0x22f387(0x1a4))/0x9)+parseInt(_0x22f387(0x1bb))/0xa*(-parseInt(_0x22f387(0x1d0))/0xb);if(_0x4250c2===_0x4aba21)break;else _0x296f0e['push'](_0x296f0e['shift']());}catch(_0x353c89){_0x296f0e['push'](_0x296f0e['shift']());}}}(a32_0x1e1d,0x6c633));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';function a32_0x1e1d(){const _0x22afe3=['trashedTo','lastSync','scriptsRoot','Would\x20delete\x20','validation','keys','No\x20lock\x20entry\x20found\x20for\x20\x22','Multiple\x20functions\x20match\x20\x22','stringify','64waYEBe','Backend\x20Function\x20lock\x20file\x20not\x20found.','parse','toISOString','<timestamp>','407MARIkv','scriptsRootDir','appCode','8JWkpiG','657130JJcMpT','\x22\x20not\x20found\x20after\x20ensureLockScope.','target','49xVwlvo','functions','string','306297OLzDQV','startsWith','remoteId','\x20\x20-\x20','POST','delete','bff','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Local\x20delete\x20not\x20settled\x20for\x20','trashDir','includes','apps','replace','join','272394WRfDtO','982546kIkBmF','2074614jspeCq','length','lockFilePath','str','156498dQIiPL','projectRoot','split','201730DrjCLl','map','Deleted\x20','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','high-risk-write','Lock\x20scope\x20for\x20app\x20\x22','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.'];a32_0x1e1d=function(){return _0x22afe3;};return a32_0x1e1d();}export const bffDelete={'service':a32_0x201ae4(0x1aa),'command':'delete','description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a32_0x201ae4(0x1bf),'flags':[{'name':a32_0x201ae4(0x1a0),'type':a32_0x201ae4(0x1a3),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x2b7bb1){const _0x2a2ed0=a32_0x201ae4,_0x4f3288=loadBffProjectConfig(_0x2b7bb1['appCode']),_0x34407b=await readBffLockFile(_0x4f3288[_0x2a2ed0(0x1b6)]);if(!_0x34407b)throw CliErrors['validation'](_0x2a2ed0(0x1c1));},async 'dryRun'(_0x34152a){const _0xbb92b=a32_0x201ae4,_0x44f709=loadBffProjectConfig(_0x34152a[_0xbb92b(0x19c)]),_0x760649=await readBffLockFile(_0x44f709[_0xbb92b(0x1b6)]);if(!_0x760649)throw CliErrors[_0xbb92b(0x1c6)](_0xbb92b(0x1cc));const {appLock:_0x11f316}=ensureLockScope(_0x760649,_0x34152a[_0xbb92b(0x19c)],_0x44f709[_0xbb92b(0x1c4)],_0xbb92b(0x1a9)),_0x4f6692=_0x34152a['str'](_0xbb92b(0x1a0)),_0x51f390=Object[_0xbb92b(0x1c7)](_0x11f316[_0xbb92b(0x1a2)]),_0x33bd2f=resolveDeleteTarget(_0x4f6692,_0x51f390),_0x120088=_0x11f316[_0xbb92b(0x1a2)][_0x33bd2f];if(!_0x120088)throw CliErrors['validation'](_0xbb92b(0x1c8)+_0x33bd2f+'\x22.');const _0x224c40=resolveLocalFilePathFromLockKey(_0x44f709,_0x33bd2f),_0xf31725=relative(_0x44f709['projectRoot'],_0x224c40),_0x2f7d4c=join(_0x44f709[_0xbb92b(0x1ad)],_0xbb92b(0x1cf),_0xf31725);return{'method':_0xbb92b(0x1a8),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x34152a[_0xbb92b(0x19c)],'target':_0x33bd2f,'remoteId':_0x120088[_0xbb92b(0x1a6)],'localFilePath':_0x224c40,'trashedPath':_0x2f7d4c},'description':_0xbb92b(0x1c5)+_0x33bd2f+_0xbb92b(0x1ab)};},async 'execute'(_0x5bb9e1){const _0x482847=a32_0x201ae4,_0x1a1f17=loadBffProjectConfig(_0x5bb9e1[_0x482847(0x19c)]),_0x2dccac=await readBffLockFile(_0x1a1f17[_0x482847(0x1b6)]);if(!_0x2dccac)throw CliErrors[_0x482847(0x1c6)](_0x482847(0x1cc));const {lockData:_0x2a8068,appLock:_0x479d54}=ensureLockScope(_0x2dccac,_0x5bb9e1[_0x482847(0x19c)],_0x1a1f17[_0x482847(0x1c4)],_0x482847(0x1a9)),_0x39b345=JSON[_0x482847(0x1cd)](JSON[_0x482847(0x1ca)](_0x2a8068)),_0x244554=_0x39b345[_0x482847(0x1af)][_0x5bb9e1[_0x482847(0x19c)]];if(!_0x244554)throw new Error(_0x482847(0x1c0)+_0x5bb9e1[_0x482847(0x19c)]+_0x482847(0x19f));const _0x2f17f8=_0x5bb9e1[_0x482847(0x1b7)]('target'),_0x320fca=Object['keys'](_0x244554[_0x482847(0x1a2)]),_0x42f877=resolveDeleteTarget(_0x2f17f8,_0x320fca),_0x2ed70a=_0x244554['functions'][_0x42f877];if(!_0x2ed70a)throw CliErrors[_0x482847(0x1c6)](_0x482847(0x1c8)+_0x42f877+'\x22.');await deleteBffScript(_0x2ed70a[_0x482847(0x1a6)]),delete _0x244554[_0x482847(0x1a2)][_0x42f877],_0x244554[_0x482847(0x1c3)]=new Date()[_0x482847(0x1ce)](),await writeBffLockFile(_0x1a1f17[_0x482847(0x1b6)],_0x39b345);const _0x2a4c09=resolveLocalFilePathFromLockKey(_0x1a1f17,_0x42f877);let _0x4abe30;await fileExists(_0x2a4c09)&&(_0x4abe30=await moveToTrash(_0x1a1f17[_0x482847(0x1b9)],_0x1a1f17[_0x482847(0x1ad)],_0x2a4c09),await cleanupEmptyDirectories(dirname(_0x2a4c09),_0x1a1f17[_0x482847(0x19b)]));await waitForDeleteSettlement(_0x1a1f17[_0x482847(0x1b6)],_0x5bb9e1['appCode'],_0x42f877,_0x2a4c09),await sleep(0x96);const _0x5dffbb={'deleted':_0x42f877,'remoteId':_0x2ed70a['remoteId']};if(_0x4abe30)_0x5dffbb[_0x482847(0x1c2)]=_0x4abe30;return{'ok':!![],'data':_0x5dffbb,'message':_0x482847(0x1bd)+_0x42f877+(_0x4abe30?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x2d8f93,_0x5a0156){const _0x36e875=a32_0x201ae4;if(_0x2d8f93[_0x36e875(0x1ae)]('/')){const _0x55f2f1=_0x5a0156['find'](_0x4854c2=>_0x4854c2===_0x2d8f93);if(!_0x55f2f1)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x2d8f93);return _0x55f2f1;}const _0x39b14e=_0x5a0156['filter'](_0x19dcef=>_0x19dcef[_0x36e875(0x1ba)]('/')['at'](-0x1)===_0x2d8f93);if(_0x39b14e[_0x36e875(0x1b5)]===0x0)throw CliErrors[_0x36e875(0x1c6)]('Function\x20not\x20found:\x20'+_0x2d8f93);if(_0x39b14e[_0x36e875(0x1b5)]>0x1)throw CliErrors[_0x36e875(0x1c6)](_0x36e875(0x1c9)+_0x2d8f93+_0x36e875(0x1be)+_0x39b14e[_0x36e875(0x1bc)](_0x84ce2a=>_0x36e875(0x1a7)+_0x84ce2a)[_0x36e875(0x1b1)]('\x0a'));return _0x39b14e[0x0];}async function moveToTrash(_0x36a8bf,_0x58584e,_0x377dd3){const _0x47b5e9=a32_0x201ae4,_0x5a2c4f=new Date()[_0x47b5e9(0x1ce)]()[_0x47b5e9(0x1b0)](/[:.]/g,'-'),_0x225afd=relative(_0x36a8bf,_0x377dd3),_0x4e8f8c=join(_0x58584e,_0x5a2c4f,_0x225afd);return await mkdir(dirname(_0x4e8f8c),{'recursive':!![]}),await rename(_0x377dd3,_0x4e8f8c),_0x4e8f8c;}async function cleanupEmptyDirectories(_0x33e9da,_0x295ba8){const _0x16b170=a32_0x201ae4;let _0x2a46e9=resolve(_0x33e9da);const _0x2f863a=resolve(_0x295ba8);while(_0x2a46e9[_0x16b170(0x1a5)](''+_0x2f863a+sep)||_0x2a46e9===_0x2f863a){if(_0x2a46e9===_0x2f863a)return;try{const _0x28f429=await readdir(_0x2a46e9);if(_0x28f429['length']>0x0)return;await rmdir(_0x2a46e9);}catch{return;}_0x2a46e9=dirname(_0x2a46e9);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x24b318,_0x1193e4,_0x5af291,_0x31df81){const _0x385098=a32_0x201ae4;for(let _0x4379aa=0x0;_0x4379aa<DELETE_SETTLE_RETRY_COUNT;_0x4379aa+=0x1){const _0x3f3440=await readBffLockFile(_0x24b318),_0x4f7323=!!_0x3f3440?.[_0x385098(0x1af)]?.[_0x1193e4]?.[_0x385098(0x1a2)]?.[_0x5af291],_0xc9880f=await fileExists(_0x31df81);if(!_0x4f7323&&!_0xc9880f)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x385098(0x1ac)+_0x5af291+'.');}
|