@lovrabet/rabetbase-cli 2.5.2-beta.5 → 2.5.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/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/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/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.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.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.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 -17
- 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.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.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +5 -6
- package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +56 -0
- package/skills/rabetbase.manifest.json +4 -4
- package/lib/commands/deployment/auto-sync.d.ts +0 -20
- package/lib/commands/deployment/auto-sync.js +0 -1
- package/lib/commands/deployment/sync.d.ts +0 -2
- package/lib/commands/deployment/sync.js +0 -1
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +0 -100
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cd0f5,_0x43b14d){const _0x2ff4de=a18_0x1c1d,_0x506869=_0x1cd0f5();while(!![]){try{const _0x556e81=parseInt(_0x2ff4de(0x1a9))/0x1*(-parseInt(_0x2ff4de(0x1a4))/0x2)+-parseInt(_0x2ff4de(0x1ae))/0x3*(-parseInt(_0x2ff4de(0x1ab))/0x4)+-parseInt(_0x2ff4de(0x1a8))/0x5+parseInt(_0x2ff4de(0x1b1))/0x6*(-parseInt(_0x2ff4de(0x1b0))/0x7)+-parseInt(_0x2ff4de(0x1aa))/0x8*(parseInt(_0x2ff4de(0x1b8))/0x9)+-parseInt(_0x2ff4de(0x1b7))/0xa*(-parseInt(_0x2ff4de(0x1b5))/0xb)+parseInt(_0x2ff4de(0x1ac))/0xc*(parseInt(_0x2ff4de(0x1a7))/0xd);if(_0x556e81===_0x43b14d)break;else _0x506869['push'](_0x506869['shift']());}catch(_0x5ec52d){_0x506869['push'](_0x506869['shift']());}}}(a18_0x4b03,0x309df));function a18_0x1c1d(_0x158f31,_0x463c30){_0x158f31=_0x158f31-0x1a3;const _0x4b0393=a18_0x4b03();let _0x1c1d4c=_0x4b0393[_0x158f31];return _0x1c1d4c;}import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x59999e,_0x30e4b7){const _0x435598=a18_0x1c1d;if(_0x30e4b7)return null;const _0x34a603=_0x59999e[_0x435598(0x1ad)]('global')?'merged':'project';let _0x4c57e8=getMultiAppConfigs(_0x34a603);if(!_0x4c57e8||_0x4c57e8[_0x435598(0x1b4)]===0x0)return null;if(_0x59999e['selectedAppName']){const _0x27f858=_0x4c57e8[_0x435598(0x1b3)](_0xd9e14f=>_0xd9e14f[_0x435598(0x1af)]===_0x59999e['selectedAppName']);if(_0x27f858['length']===0x0){const _0x5235e3=_0x4c57e8[_0x435598(0x1a5)](_0x48ecd4=>_0x48ecd4[_0x435598(0x1af)])['join'](',\x20');throw CliErrors[_0x435598(0x1b6)](_0x435598(0x1b2)+_0x59999e[_0x435598(0x1a6)]+_0x435598(0x1a3)+_0x5235e3);}_0x4c57e8=_0x27f858;}return _0x4c57e8;}function a18_0x4b03(){const _0x59c61b=['569232QnYTxn','104fXJPzZ','314340CUBnpg','bool','15402NCByMf','name','7PdUCre','1222356XpxSpR','App\x20\x22','filter','length','517oSbClZ','validation','32630JZCppH','9mGUJcP','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','166862OxcbLz','map','selectedAppName','325CbjVUJ','1504215NSKbph','2xNHygD'];a18_0x4b03=function(){return _0x59c61b;};return a18_0x4b03();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c5527,_0x2b7f56){const _0x4a84b7=a19_0x25f8,_0x1955f8=_0x4c5527();while(!![]){try{const _0x4fcb25=-parseInt(_0x4a84b7(0x164))/0x1+parseInt(_0x4a84b7(0x166))/0x2+parseInt(_0x4a84b7(0x168))/0x3+-parseInt(_0x4a84b7(0x162))/0x4*(-parseInt(_0x4a84b7(0x165))/0x5)+-parseInt(_0x4a84b7(0x16a))/0x6*(-parseInt(_0x4a84b7(0x167))/0x7)+parseInt(_0x4a84b7(0x161))/0x8+-parseInt(_0x4a84b7(0x169))/0x9*(parseInt(_0x4a84b7(0x163))/0xa);if(_0x4fcb25===_0x2b7f56)break;else _0x1955f8['push'](_0x1955f8['shift']());}catch(_0x4ad5c4){_0x1955f8['push'](_0x1955f8['shift']());}}}(a19_0xe29e,0x53611));function a19_0x25f8(_0x12e0ed,_0x560f84){_0x12e0ed=_0x12e0ed-0x161;const _0xe29e4f=a19_0xe29e();let _0x25f8d5=_0xe29e4f[_0x12e0ed];return _0x25f8d5;}function a19_0xe29e(){const _0x43d529=['80MypCHR','299215bHSCRl','1201045vRwiWW','116420GZTtiJ','1610EDWDDX','1678365ehPSgz','580707hWkXap','2370tacpQY','1665568pOlygX','4UJBQJZ'];a19_0xe29e=function(){return _0x43d529;};return a19_0xe29e();}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
|
-
function
|
|
1
|
+
function a20_0x17af(){const _0x12ac94=['mergedCli','merged','10vDOCSx','\x20config','globalPath','apps','1374400fhSjNm','270063JUdMPw','328633DuDRZR','boolean','18NKgtLX','\x20in\x20','project','projectConfig','push','validation','read','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','projectPath','name','503934DMHRZL','list','isCurrent','28408kkVRRL','global','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','globalConfig','3831676GeEfDu','No\x20apps\x20configured','remote','map','9etIhGP','object','length','appcode','bool','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','defaultApp','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','22900361iqXptu','keys','.\x20Use\x20`','35nFHDLg','find','app'];a20_0x17af=function(){return _0x12ac94;};return a20_0x17af();}const a20_0x2fe76f=a20_0x3c82;(function(_0x2c8eb7,_0xf627f5){const _0x555579=a20_0x3c82,_0x4f29fe=_0x2c8eb7();while(!![]){try{const _0x473edb=parseInt(_0x555579(0x13c))/0x1+parseInt(_0x555579(0x13e))/0x2*(-parseInt(_0x555579(0x13b))/0x3)+-parseInt(_0x555579(0x122))/0x4+parseInt(_0x555579(0x13a))/0x5+parseInt(_0x555579(0x148))/0x6*(-parseInt(_0x555579(0x131))/0x7)+-parseInt(_0x555579(0x14b))/0x8*(parseInt(_0x555579(0x126))/0x9)+-parseInt(_0x555579(0x136))/0xa*(-parseInt(_0x555579(0x12e))/0xb);if(_0x473edb===_0xf627f5)break;else _0x4f29fe['push'](_0x4f29fe['shift']());}catch(_0x4ea642){_0x4f29fe['push'](_0x4f29fe['shift']());}}}(a20_0x17af,0x788c0));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a20_0x3c82(_0x2830a2,_0x2c02c1){_0x2830a2=_0x2830a2-0x121;const _0x17af2b=a20_0x17af();let _0x3c82ff=_0x17af2b[_0x2830a2];return _0x3c82ff;}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(_0x57f823,_0xa89193){const _0x1fff1a=a20_0x3c82,_0x34648b=[],_0x3147f6=_0x57f823[_0x1fff1a(0x139)]&&typeof _0x57f823['apps']===_0x1fff1a(0x127)?_0x57f823[_0x1fff1a(0x139)]:{},_0x54cb77=_0x57f823[_0x1fff1a(0x12c)]||undefined,_0x4e8f10=_0x54cb77??(Object[_0x1fff1a(0x12f)](_0x3147f6)[_0x1fff1a(0x128)]===0x1?Object['keys'](_0x3147f6)[0x0]:undefined);for(const [_0x390bab,_0x390961]of Object['entries'](_0x3147f6)){if(!_0x390961||typeof _0x390961!==_0x1fff1a(0x127)||!_0x390961[_0x1fff1a(0x129)])continue;_0x34648b[_0x1fff1a(0x142)]({'name':_0x390bab,'appcode':_0x390961[_0x1fff1a(0x129)],'named':!![],'definedIn':_0xa89193,'isDefault':_0x390bab===_0x4e8f10,...buildAppProfileListFields(_0x390961)});}return _0x34648b;}function buildMergedItems(_0x57d11c,_0x788e66){const _0x1013f1=a20_0x3c82,{apps:apps={}}=_0x57d11c,_0x2d2343=_0x57d11c[_0x1013f1(0x12c)],_0x4666db=_0x2d2343??(Object['keys'](apps)[_0x1013f1(0x128)]===0x1?Object[_0x1013f1(0x12f)](apps)[0x0]:undefined),_0x131c30=_0x788e66['globalConfig'][_0x1013f1(0x139)]&&typeof _0x788e66['globalConfig'][_0x1013f1(0x139)]===_0x1013f1(0x127)?_0x788e66[_0x1013f1(0x121)]['apps']:{},_0x51a329=_0x788e66[_0x1013f1(0x141)][_0x1013f1(0x139)]&&typeof _0x788e66[_0x1013f1(0x141)][_0x1013f1(0x139)]==='object'?_0x788e66[_0x1013f1(0x141)]['apps']:{},_0x23af41=Object['entries'](apps),_0x5a7497=_0x23af41[_0x1013f1(0x125)](([_0x2eea56,_0x1dd6ad])=>({'name':_0x2eea56,'appcode':_0x1dd6ad[_0x1013f1(0x129)],'named':!![],'definedIn':appDefinedIn(_0x2eea56,_0x131c30,_0x51a329),'isDefault':_0x2eea56===_0x4666db,...buildAppProfileListFields(_0x1dd6ad)}));return _0x5a7497;}function validateAppListFlags(_0x342287){const _0x4baf05=a20_0x3c82;if(!_0x342287[_0x4baf05(0x12a)]('remote'))return;if(!_0x342287[_0x4baf05(0x12a)](_0x4baf05(0x14c))&&!_0x342287['bool']('project'))return;throw CliErrors[_0x4baf05(0x143)](_0x4baf05(0x12b),_0x4baf05(0x12d));}async function execute(_0x572082){const _0x46dcd9=a20_0x3c82;validateAppListFlags(_0x572082);if(_0x572082[_0x46dcd9(0x12a)](_0x46dcd9(0x124)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x572082)};const _0x197b17=_0x572082['bool']('global'),_0x30c301=_0x572082[_0x46dcd9(0x12a)]('project'),_0x4eacb4=_0x197b17?_0x46dcd9(0x14c):_0x30c301?_0x46dcd9(0x140):_0x46dcd9(0x135),{config:_0x1cb99f,layers:_0x6cfe4d}=readRawConfigWithLayers(),_0x4c9ab6=resolveDefaultAppSource(_0x6cfe4d),{defaultApp:_0x4d4547}=_0x1cb99f;let _0x3f188,_0xfcee09;switch(_0x4eacb4){case _0x46dcd9(0x14c):_0x3f188=buildItemsFromLayer(_0x6cfe4d[_0x46dcd9(0x121)],_0x46dcd9(0x14c)),_0xfcee09=_0x6cfe4d[_0x46dcd9(0x138)];break;case _0x46dcd9(0x140):_0x3f188=buildItemsFromLayer(_0x6cfe4d['projectConfig'],_0x46dcd9(0x140)),_0xfcee09=_0x6cfe4d['projectPath'];break;default:_0x3f188=buildMergedItems(_0x1cb99f,_0x6cfe4d);break;}enrichAppListItemsWithMergedSelection(_0x3f188,_0x572082[_0x46dcd9(0x134)]);if(_0x3f188['length']===0x0){const _0x32803f=_0x4eacb4==='merged'?'':_0x46dcd9(0x13f)+_0x4eacb4+_0x46dcd9(0x137);return{'ok':!![],'data':[],'message':_0x46dcd9(0x123)+_0x32803f+_0x46dcd9(0x130)+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x248b9e=_0x3f188[_0x46dcd9(0x132)](_0x4e693b=>_0x4e693b[_0x46dcd9(0x14a)]===!![]),_0x4c2ce1=_0x4d4547??_0x248b9e?.[_0x46dcd9(0x147)]??null,_0x3bb4ec=_0x4eacb4===_0x46dcd9(0x135)?{'globalPath':_0x6cfe4d[_0x46dcd9(0x138)]??null,'projectPath':_0x6cfe4d[_0x46dcd9(0x146)]??null,'defaultApp':_0x4c2ce1,'defaultAppSource':_0x4d4547!=null?_0x4c9ab6:null}:{'scope':_0x4eacb4,'configPath':_0xfcee09??null};return{'ok':!![],'data':{'items':_0x3f188,'meta':_0x3bb4ec}};}export const appListDefinition={'service':a20_0x2fe76f(0x133),'command':a20_0x2fe76f(0x149),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a20_0x2fe76f(0x144),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a20_0x2fe76f(0x124),'type':'boolean','description':a20_0x2fe76f(0x145),'default':![]},{'name':a20_0x2fe76f(0x14c),'type':a20_0x2fe76f(0x13d),'description':a20_0x2fe76f(0x14d),'default':![]},{'name':a20_0x2fe76f(0x140),'type':a20_0x2fe76f(0x13d),'description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],async 'validate'(_0x8c22c0){validateAppListFlags(_0x8c22c0);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x1ed4dd=a21_0x30c2;(function(_0x5dcb05,_0x5b0873){const _0xe85c5e=a21_0x30c2,_0x5b28ba=_0x5dcb05();while(!![]){try{const _0x14ab1c=parseInt(_0xe85c5e(0xd6))/0x1+parseInt(_0xe85c5e(0xd4))/0x2+parseInt(_0xe85c5e(0xd5))/0x3+parseInt(_0xe85c5e(0xc8))/0x4*(parseInt(_0xe85c5e(0xc9))/0x5)+-parseInt(_0xe85c5e(0xca))/0x6+-parseInt(_0xe85c5e(0xce))/0x7*(parseInt(_0xe85c5e(0xd0))/0x8)+parseInt(_0xe85c5e(0xcb))/0x9*(-parseInt(_0xe85c5e(0xd1))/0xa);if(_0x14ab1c===_0x5b0873)break;else _0x5b28ba['push'](_0x5b28ba['shift']());}catch(_0x3b1ee9){_0x5b28ba['push'](_0x5b28ba['shift']());}}}(a21_0x210d,0x29104));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a21_0x210d(){const _0x717bfb=['91734VSFfNJ','length','44fcAvLF','45470lLNfid','1140492pHXGKj','432aajKoO','\x20application\x20member(s)','List\x20application\x20members\x20with\x20their\x20role\x20memberships','105bZYLSR','read','33064AgmliJ','14230PMZwsf','appCode','Found\x20','184416OjKSfZ','613803rxrXLj'];a21_0x210d=function(){return _0x717bfb;};return a21_0x210d();}function a21_0x30c2(_0x3c1cbc,_0x297df5){_0x3c1cbc=_0x3c1cbc-0xc7;const _0x210dfa=a21_0x210d();let _0x30c247=_0x210dfa[_0x3c1cbc];return _0x30c247;}import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':'app','command':'members-list','description':a21_0x1ed4dd(0xcd),'risk':a21_0x1ed4dd(0xcf),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x5004ae){const _0x512dd7=a21_0x1ed4dd,_0x247a0a=projectAppMembers(await listRoleUsers(_0x5004ae[_0x512dd7(0xd2)]));return{'ok':!![],'data':{'appCode':_0x5004ae[_0x512dd7(0xd2)],'items':_0x247a0a,'totalCount':_0x247a0a[_0x512dd7(0xc7)]},'message':_0x512dd7(0xd3)+_0x247a0a['length']+_0x512dd7(0xcc)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x50bb(_0x101553,_0x23d563){_0x101553=_0x101553-0x7b;const _0x3e9473=a22_0x3e94();let _0x50bb14=_0x3e9473[_0x101553];return _0x50bb14;}(function(_0x228d60,_0x1218c5){const _0x1b7710=a22_0x50bb,_0x34c1b9=_0x228d60();while(!![]){try{const _0x140542=parseInt(_0x1b7710(0x7c))/0x1*(-parseInt(_0x1b7710(0x8a))/0x2)+-parseInt(_0x1b7710(0x7f))/0x3+parseInt(_0x1b7710(0x88))/0x4+parseInt(_0x1b7710(0x7d))/0x5*(parseInt(_0x1b7710(0x7b))/0x6)+parseInt(_0x1b7710(0x86))/0x7*(parseInt(_0x1b7710(0x8b))/0x8)+-parseInt(_0x1b7710(0x85))/0x9*(parseInt(_0x1b7710(0x80))/0xa)+parseInt(_0x1b7710(0x82))/0xb;if(_0x140542===_0x1218c5)break;else _0x34c1b9['push'](_0x34c1b9['shift']());}catch(_0x422261){_0x34c1b9['push'](_0x34c1b9['shift']());}}}(a22_0x3e94,0x9cc2f));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x4e398a){const _0x410e2a=a22_0x50bb,_0x3f3034=_0x4e398a[_0x410e2a(0x89)]||getCookie();if(!_0x3f3034)throw CliErrors[_0x410e2a(0x84)]();return _0x3f3034;}function a22_0x3e94(){const _0x547a85=['appCode','2135157NpRRev','1630LnQchP','appDesc','14707528UbrAFf','map','authRequired','18990ZkSOpZ','30884qXKsjf','platform','3321220SDOxtq','cookie','874wLUWNW','256lYDteZ','1170210pHrvof','1844ViCtnL','5bvzIcy'];a22_0x3e94=function(){return _0x547a85;};return a22_0x3e94();}export async function listRemoteAppDirectory(_0x2728dc){const _0xfc0869=a22_0x50bb,_0x17fc8b=await withActiveCookie(resolveCookie(_0x2728dc),()=>listRemoteApps());return{'items':_0x17fc8b[_0xfc0869(0x83)](_0x13a205=>({..._0x13a205['id']!=null?{'id':_0x13a205['id']}:{},'appCode':_0x13a205[_0xfc0869(0x7e)],'appName':_0x13a205['appName'],..._0x13a205[_0xfc0869(0x81)]!=null?{'appDesc':_0x13a205['appDesc']}:{}})),'meta':{'source':_0xfc0869(0x87)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x303ee3,_0x2223af){const _0x30e53e=a23_0xc6f0,_0x4de572=_0x303ee3();while(!![]){try{const _0x6e3d46=parseInt(_0x30e53e(0xbc))/0x1+parseInt(_0x30e53e(0xdd))/0x2+-parseInt(_0x30e53e(0xc0))/0x3+parseInt(_0x30e53e(0xd0))/0x4+-parseInt(_0x30e53e(0xcf))/0x5+parseInt(_0x30e53e(0xe9))/0x6*(parseInt(_0x30e53e(0xd1))/0x7)+-parseInt(_0x30e53e(0xca))/0x8;if(_0x6e3d46===_0x2223af)break;else _0x4de572['push'](_0x4de572['shift']());}catch(_0x305478){_0x4de572['push'](_0x4de572['shift']());}}}(a23_0x41be,0xea106));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a23_0xc6f0(_0x48511d,_0x595983){_0x48511d=_0x48511d-0xb9;const _0x41bef8=a23_0x41be();let _0xc6f0fd=_0x41bef8[_0x48511d];return _0xc6f0fd;}function a23_0x41be(){const _0x53527b=['sort','status','30KduaUf','apps','defaultApp','map','named','1479030OHUjSX','globalConfig','isCurrent','keys','5264484wPriBu','PENDING','get','\x20(global)','add','displayName','roleId','prototype','projectConfig','hasOwnProperty','370616VVBrow','project','membershipStatus','appCode','username','7121310PsRAmV','4983836sZVeNd','1850009BIbKSC','roleCode','applyUserList','appcode','global','userId','nickname','name','length','roles','roleName','isFinite','275438XDSsfp','has','trim','roleType','both','userList','object','call','ACTIVE','roleKeys'];a23_0x41be=function(){return _0x53527b;};return a23_0x41be();}function nullableText(_0x122b13){const _0x159fc6=a23_0xc6f0,_0x4582b0=_0x122b13?.[_0x159fc6(0xdf)]();return _0x4582b0?_0x4582b0:null;}export function projectAppMembers(_0x3b8dca){const _0x4d6cf2=a23_0xc6f0,_0x23e221=new Map(),_0x16d205=[..._0x3b8dca]['sort']((_0x533481,_0x1671cd)=>_0x533481['id']-_0x1671cd['id']),_0x2360ad=(_0x5ecdb6,_0x2d2c44,_0x5ef257)=>{const _0x56a2f1=a23_0xc6f0;for(const _0x3e98ed of _0x2d2c44){const _0x1f2796=Number(_0x3e98ed['userId']);if(!Number[_0x56a2f1(0xdc)](_0x1f2796)||_0x1f2796<=0x0)continue;let _0x5a5b67=_0x23e221[_0x56a2f1(0xc2)](_0x1f2796);if(!_0x5a5b67)_0x5a5b67={'userId':_0x1f2796,'username':nullableText(_0x3e98ed[_0x56a2f1(0xce)]),'displayName':nullableText(_0x3e98ed[_0x56a2f1(0xd7)]),'status':_0x5ef257,'roles':[],'roleKeys':new Set()},_0x23e221['set'](_0x1f2796,_0x5a5b67);else{_0x5a5b67[_0x56a2f1(0xce)]??=nullableText(_0x3e98ed['username']),_0x5a5b67['displayName']??=nullableText(_0x3e98ed[_0x56a2f1(0xd7)]);if(_0x5ef257===_0x56a2f1(0xe5))_0x5a5b67['status']='ACTIVE';}const _0x2280fd=_0x5ecdb6['id']+':'+_0x5ef257;if(_0x5a5b67['roleKeys'][_0x56a2f1(0xde)](_0x2280fd))continue;_0x5a5b67[_0x56a2f1(0xe6)][_0x56a2f1(0xc4)](_0x2280fd),_0x5a5b67[_0x56a2f1(0xda)]['push']({'roleId':_0x5ecdb6['id'],'roleCode':_0x5ecdb6[_0x56a2f1(0xd2)],'roleName':nullableText(_0x5ecdb6[_0x56a2f1(0xdb)]),'roleType':nullableText(_0x5ecdb6[_0x56a2f1(0xe0)]),'membershipStatus':_0x5ef257});}};for(const _0x3f10af of _0x16d205){_0x2360ad(_0x3f10af,_0x3f10af[_0x4d6cf2(0xe2)]??[],'ACTIVE'),_0x2360ad(_0x3f10af,_0x3f10af[_0x4d6cf2(0xd3)]??[],_0x4d6cf2(0xc1));}return[..._0x23e221['values']()][_0x4d6cf2(0xba)](_0x4b54fd=>({'userId':_0x4b54fd[_0x4d6cf2(0xd6)],'username':_0x4b54fd[_0x4d6cf2(0xce)],'displayName':_0x4b54fd[_0x4d6cf2(0xc5)],'status':_0x4b54fd[_0x4d6cf2(0xe8)],'roles':_0x4b54fd[_0x4d6cf2(0xda)][_0x4d6cf2(0xe7)]((_0x14509e,_0x38c510)=>_0x14509e[_0x4d6cf2(0xc6)]-_0x38c510[_0x4d6cf2(0xc6)]||(_0x14509e['membershipStatus']===_0x38c510['membershipStatus']?0x0:_0x14509e[_0x4d6cf2(0xcc)]===_0x4d6cf2(0xe5)?-0x1:0x1))}))[_0x4d6cf2(0xe7)]((_0x151bee,_0x8b9a33)=>_0x151bee[_0x4d6cf2(0xd6)]-_0x8b9a33[_0x4d6cf2(0xd6)]);}export function enrichAppListItemsWithMergedSelection(_0x16613b,_0x36b162){const _0x331c08=a23_0xc6f0;if(!_0x36b162)return;const _0x13b085=_0x36b162['apps']&&typeof _0x36b162[_0x331c08(0xea)]===_0x331c08(0xe3)?_0x36b162[_0x331c08(0xea)]:{},_0x5ccf5b=Object[_0x331c08(0xbf)](_0x13b085)[_0x331c08(0xd9)]>0x0;for(const _0x150f5d of _0x16613b){_0x150f5d[_0x331c08(0xbe)]=![];}const _0x2ea8b0=_0x36b162[_0x331c08(0xcd)]!=null?String(_0x36b162[_0x331c08(0xcd)])['trim']():'';if(_0x5ccf5b){const _0x484110=_0x36b162['currentApp']??_0x36b162[_0x331c08(0xb9)];if(_0x484110)for(const _0x3e9c06 of _0x16613b){_0x3e9c06[_0x331c08(0xbb)]===!![]&&_0x3e9c06[_0x331c08(0xd8)]===_0x484110&&(_0x3e9c06[_0x331c08(0xbe)]=!![]);}for(const _0x1dd473 of _0x16613b){if(_0x1dd473[_0x331c08(0xbb)]!==![])continue;if(_0x36b162[_0x331c08(0xb9)])continue;_0x2ea8b0&&String(_0x1dd473[_0x331c08(0xd4)]??'')[_0x331c08(0xdf)]()===_0x2ea8b0&&(_0x1dd473['isCurrent']=!![]);}return;}if(!_0x2ea8b0)return;for(const _0x42b844 of _0x16613b){String(_0x42b844[_0x331c08(0xd4)]??'')[_0x331c08(0xdf)]()===_0x2ea8b0&&(_0x42b844['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x376ff3,_0x3887d4,_0x2a4d9b){const _0x4d75f2=a23_0xc6f0;if(_0x3887d4)return'global';const _0x5f2020=_0x2a4d9b['projectConfig'][_0x4d75f2(0xea)]&&typeof _0x2a4d9b[_0x4d75f2(0xc8)][_0x4d75f2(0xea)]===_0x4d75f2(0xe3)?_0x2a4d9b[_0x4d75f2(0xc8)][_0x4d75f2(0xea)]:{},_0xeeeb7b=_0x2a4d9b[_0x4d75f2(0xbd)][_0x4d75f2(0xea)]&&typeof _0x2a4d9b[_0x4d75f2(0xbd)][_0x4d75f2(0xea)]===_0x4d75f2(0xe3)?_0x2a4d9b[_0x4d75f2(0xbd)]['apps']:{};if(Object[_0x4d75f2(0xc7)][_0x4d75f2(0xc9)][_0x4d75f2(0xe4)](_0x5f2020,_0x376ff3))return _0x4d75f2(0xcb);if(Object[_0x4d75f2(0xc7)][_0x4d75f2(0xc9)]['call'](_0xeeeb7b,_0x376ff3))return'global';return'project';}export function appDefinedIn(_0x34e316,_0x334115,_0x31bbd2){const _0x4b94b0=a23_0xc6f0,_0x214914=Object['prototype']['hasOwnProperty'][_0x4b94b0(0xe4)](_0x334115,_0x34e316),_0x46528a=Object['prototype'][_0x4b94b0(0xc9)][_0x4b94b0(0xe4)](_0x31bbd2,_0x34e316);if(_0x214914&&_0x46528a)return _0x4b94b0(0xe1);if(_0x46528a)return _0x4b94b0(0xcb);return _0x4b94b0(0xd5);}export function resolveDefaultAppSource(_0xbed4cb){const _0x50dc83=a23_0xc6f0,_0x4d29f2=_0xbed4cb[_0x50dc83(0xc8)][_0x50dc83(0xea)]&&typeof _0xbed4cb[_0x50dc83(0xc8)]['apps']===_0x50dc83(0xe3)?_0xbed4cb[_0x50dc83(0xc8)][_0x50dc83(0xea)]:{};if(_0x50dc83(0xb9)in _0xbed4cb[_0x50dc83(0xc8)])return _0x50dc83(0xcb);if(Object['keys'](_0x4d29f2)[_0x50dc83(0xd9)]>0x0)return _0x50dc83(0xcb);if(Object['keys'](_0xbed4cb['projectConfig'])[_0x50dc83(0xd9)]===0x0&&_0xbed4cb[_0x50dc83(0xbd)][_0x50dc83(0xb9)])return'global';return null;}export function getConfigPath(_0x23cc74={}){const _0x1f5c5a=a23_0xc6f0,_0x1ea92e=_0x23cc74[_0x1f5c5a(0xd5)]?_0x1f5c5a(0xd5):_0x1f5c5a(0xcb);return resolveWriteConfigPath(_0x1ea92e);}export function readConfig(_0x963c16={}){return readConfigFile(getConfigPath(_0x963c16));}export function writeConfig(_0x43f1f6,_0x363d56={}){writeConfigFile(getConfigPath(_0x363d56),_0x43f1f6);}export function scopeLabel(_0x11bc80){const _0x22a00c=a23_0xc6f0;return _0x11bc80[_0x22a00c(0xd5)]?_0x22a00c(0xc3):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x1a5de8=a24_0x4ea0;(function(_0x53e3c5,_0x52a140){const _0x496eb3=a24_0x4ea0,_0x2b7b0f=_0x53e3c5();while(!![]){try{const _0x468cec=parseInt(_0x496eb3(0x107))/0x1+parseInt(_0x496eb3(0x10f))/0x2*(-parseInt(_0x496eb3(0x102))/0x3)+-parseInt(_0x496eb3(0x114))/0x4*(-parseInt(_0x496eb3(0x116))/0x5)+parseInt(_0x496eb3(0x112))/0x6+-parseInt(_0x496eb3(0x110))/0x7+parseInt(_0x496eb3(0x115))/0x8*(-parseInt(_0x496eb3(0x10a))/0x9)+parseInt(_0x496eb3(0x100))/0xa*(parseInt(_0x496eb3(0x109))/0xb);if(_0x468cec===_0x52a140)break;else _0x2b7b0f['push'](_0x2b7b0f['shift']());}catch(_0x4b568a){_0x2b7b0f['push'](_0x2b7b0f['shift']());}}}(a24_0x32aa,0x86205));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a24_0x4ea0(_0x5a9529,_0x2729e6){_0x5a9529=_0x5a9529-0x100;const _0x32aad8=a24_0x32aa();let _0x4ea093=_0x32aad8[_0x5a9529];return _0x4ea093;}import{CliErrors}from'../../errors.js';function a24_0x32aa(){const _0x2d34cc=['20aRILAN','validation','2678709QpQwXx','app-config','get','Delete\x20one\x20runtime\x20app-config\x20key','App\x20config\x20key\x20not\x20found:\x20','605777qhgsBo',',\x20appCode=','2688015cHOMeC','110097IyVIsB','isFinite','apiError','Deleted\x20app\x20config\x20','appCode','2iIjgXQ','757148lZjpRJ','high-risk-write','311352QTpEYo','delete','342812narsMf','16zxijiT','25BPtJDU'];a24_0x32aa=function(){return _0x2d34cc;};return a24_0x32aa();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a24_0x1a5de8(0x103),'command':a24_0x1a5de8(0x113),'description':a24_0x1a5de8(0x105),'risk':a24_0x1a5de8(0x111),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x112497){readKeyArg(_0x112497);},async 'dryRun'(_0x6fa679){const _0x4b56ce=a24_0x1a5de8,_0x501d2f=readKeyArg(_0x6fa679),_0x14dcec=await mustGetByKey(_0x6fa679['appCode'],_0x501d2f);return asAppConfigDryRunResult(buildMutationData({'operation':_0x4b56ce(0x113),'appCode':_0x6fa679['appCode'],'key':_0x501d2f,'before':projectAppConfig(_0x14dcec),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x29eff2){const _0x2d92a6=a24_0x1a5de8,_0x2af6db=readKeyArg(_0x29eff2),_0x3ace1=await mustGetByKey(_0x29eff2[_0x2d92a6(0x10e)],_0x2af6db);return await withAppConfigApiBoundary('delete',{'appCode':_0x29eff2[_0x2d92a6(0x10e)],'key':_0x2af6db},()=>deleteAppConfig({'appCode':_0x29eff2['appCode'],'id':requireAppConfigId(_0x3ace1,_0x2af6db,_0x29eff2[_0x2d92a6(0x10e)])})),{'ok':!![],'data':buildMutationData({'operation':_0x2d92a6(0x113),'appCode':_0x29eff2['appCode'],'key':_0x2af6db,'before':projectAppConfig(_0x3ace1),'after':null,'dryRun':![]}),'message':_0x2d92a6(0x10d)+_0x2af6db};}};async function mustGetByKey(_0x4b3357,_0x4b9d9d){const _0x359356=a24_0x1a5de8,_0x4f29aa=await withAppConfigApiBoundary(_0x359356(0x104),{'appCode':_0x4b3357,'key':_0x4b9d9d},()=>getAppConfigByKey(_0x4b3357,_0x4b9d9d));if(!_0x4f29aa)throw CliErrors[_0x359356(0x101)](_0x359356(0x106)+_0x4b9d9d,'appCode:\x20'+_0x4b3357);return _0x4f29aa;}function requireAppConfigId(_0x13eaa7,_0x1a4b4e,_0x156ed0){const _0x5c5e90=a24_0x1a5de8;if(typeof _0x13eaa7['id']==='number'&&Number[_0x5c5e90(0x10b)](_0x13eaa7['id'])&&_0x13eaa7['id']>0x0)return _0x13eaa7['id'];throw CliErrors[_0x5c5e90(0x10c)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x1a4b4e+_0x5c5e90(0x108)+_0x156ed0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x276cd6=a25_0x3776;function a25_0x3776(_0x370a32,_0x50d2b3){_0x370a32=_0x370a32-0x80;const _0x5e922a=a25_0x5e92();let _0x377656=_0x5e922a[_0x370a32];return _0x377656;}(function(_0x3ba377,_0x203163){const _0x412260=a25_0x3776,_0x354536=_0x3ba377();while(!![]){try{const _0x9ef9f=-parseInt(_0x412260(0x89))/0x1+parseInt(_0x412260(0x83))/0x2*(-parseInt(_0x412260(0x81))/0x3)+-parseInt(_0x412260(0x8c))/0x4*(parseInt(_0x412260(0x84))/0x5)+-parseInt(_0x412260(0x8f))/0x6+-parseInt(_0x412260(0x85))/0x7+parseInt(_0x412260(0x8e))/0x8*(parseInt(_0x412260(0x88))/0x9)+parseInt(_0x412260(0x8a))/0xa;if(_0x9ef9f===_0x203163)break;else _0x354536['push'](_0x354536['shift']());}catch(_0x510657){_0x354536['push'](_0x354536['shift']());}}}(a25_0x5e92,0x40682));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a25_0x276cd6(0x91),'command':a25_0x276cd6(0x87),'description':a25_0x276cd6(0x90),'risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x2fd2dc){readKeyArg(_0x2fd2dc);},async 'execute'(_0x1c3410){const _0x2a68e5=a25_0x276cd6,_0x4322d5=readKeyArg(_0x1c3410),_0x5e4580=await withAppConfigApiBoundary(_0x2a68e5(0x87),{'appCode':_0x1c3410[_0x2a68e5(0x80)],'key':_0x4322d5},()=>getAppConfigByKey(_0x1c3410[_0x2a68e5(0x80)],_0x4322d5));if(!_0x5e4580)throw CliErrors[_0x2a68e5(0x82)]('App\x20config\x20key\x20not\x20found:\x20'+_0x4322d5,_0x2a68e5(0x8b)+_0x1c3410[_0x2a68e5(0x80)]);const _0x5318a4=projectAppConfig(_0x5e4580,{'reveal':_0x1c3410['bool'](_0x2a68e5(0x8d))});return{'ok':!![],'data':{'config':_0x5318a4},'message':_0x1c3410['bool'](_0x2a68e5(0x8d))?_0x2a68e5(0x86)+_0x4322d5+'\x20with\x20value\x20revealed':_0x2a68e5(0x86)+_0x4322d5+_0x2a68e5(0x92)};}};function a25_0x5e92(){const _0x5b6f19=['3455893lhdsyA','Loaded\x20app\x20config\x20','get','1116MBFDhk','213998GnBAnl','11185780NHqjSR','appCode:\x20','2972kEqpld','reveal','12144VKIxdL','85482fkVpGs','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','app-config','\x20with\x20value\x20redacted','appCode','28989gZHDZB','validation','40DPAUnv','860gmhBki'];a25_0x5e92=function(){return _0x5b6f19;};return a25_0x5e92();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a26_0x2a2c(){const _0x156805=['4481720joWgDw','367640CFtEkb','3380PCNUWh','3ERqBZV','73422wSIxix','2275062dlJKju','1906996oEtkYY','2390026VSaUxh','248294MgWKxR','5HLntiW'];a26_0x2a2c=function(){return _0x156805;};return a26_0x2a2c();}(function(_0x41bd4b,_0x28046a){const _0x2ae2b9=a26_0x5ad6,_0x306164=_0x41bd4b();while(!![]){try{const _0x125d20=parseInt(_0x2ae2b9(0xf8))/0x1+parseInt(_0x2ae2b9(0xf7))/0x2*(-parseInt(_0x2ae2b9(0xf3))/0x3)+-parseInt(_0x2ae2b9(0xfa))/0x4+-parseInt(_0x2ae2b9(0xf9))/0x5*(parseInt(_0x2ae2b9(0xf5))/0x6)+parseInt(_0x2ae2b9(0xf6))/0x7+parseInt(_0x2ae2b9(0xfb))/0x8+-parseInt(_0x2ae2b9(0xf4))/0x9*(-parseInt(_0x2ae2b9(0xfc))/0xa);if(_0x125d20===_0x28046a)break;else _0x306164['push'](_0x306164['shift']());}catch(_0x13dc65){_0x306164['push'](_0x306164['shift']());}}}(a26_0x2a2c,0x99ad5));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_0x5ad6(_0x4b9d5d,_0x5a687d){_0x4b9d5d=_0x4b9d5d-0xf3;const _0x2a2ce9=a26_0x2a2c();let _0x5ad6d2=_0x2a2ce9[_0x4b9d5d];return _0x5ad6d2;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x3dd4de=a27_0x31d7;(function(_0x580b21,_0x57b984){const _0x434104=a27_0x31d7,_0xa0d7b2=_0x580b21();while(!![]){try{const _0x4041e6=-parseInt(_0x434104(0x17a))/0x1+-parseInt(_0x434104(0x189))/0x2*(-parseInt(_0x434104(0x18d))/0x3)+parseInt(_0x434104(0x18e))/0x4*(-parseInt(_0x434104(0x186))/0x5)+parseInt(_0x434104(0x188))/0x6+-parseInt(_0x434104(0x17d))/0x7*(parseInt(_0x434104(0x17e))/0x8)+-parseInt(_0x434104(0x18b))/0x9*(parseInt(_0x434104(0x184))/0xa)+-parseInt(_0x434104(0x17b))/0xb*(-parseInt(_0x434104(0x180))/0xc);if(_0x4041e6===_0x57b984)break;else _0xa0d7b2['push'](_0xa0d7b2['shift']());}catch(_0x20e001){_0xa0d7b2['push'](_0xa0d7b2['shift']());}}}(a27_0x9602,0x50bd7));function a27_0x9602(){const _0x6478d7=['2811660AxosMp','23306qgFwaZ','trim','9hndaCo','read','69XdIzxq','33992iawHkk','length','str','622479fTlqFd','13497OmXVii','map','161350Tgojus','64qHTJuv','key','6972bBsBeu','list','Filter\x20by\x20exact\x20config\x20key','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','3034280fNMdIU','appCode','5fEafKZ','Found\x20'];a27_0x9602=function(){return _0x6478d7;};return a27_0x9602();}import{listAppConfigs}from'../../core/api-client.js';function a27_0x31d7(_0xf653e6,_0x5cbf8f){_0xf653e6=_0xf653e6-0x178;const _0x96025a=a27_0x9602();let _0x31d79d=_0x96025a[_0xf653e6];return _0x31d79d;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':a27_0x3dd4de(0x181),'description':a27_0x3dd4de(0x183),'risk':a27_0x3dd4de(0x18c),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a27_0x3dd4de(0x17f),'type':'string','description':a27_0x3dd4de(0x182)},TAGS_FLAG],async 'validate'(_0x26df3f){const _0x44e7fa=a27_0x3dd4de,_0x454ae9=_0x26df3f[_0x44e7fa(0x179)](_0x44e7fa(0x17f))[_0x44e7fa(0x18a)]();if(_0x454ae9)validateKey(_0x454ae9);readOptionalTags(_0x26df3f);},async 'execute'(_0x3612cf){const _0x5b3f1e=a27_0x3dd4de,_0x5e51a0=_0x3612cf['str'](_0x5b3f1e(0x17f))[_0x5b3f1e(0x18a)]()||undefined,_0x2622d3=readOptionalTags(_0x3612cf),_0x38f9c2=await withAppConfigApiBoundary(_0x5b3f1e(0x181),{'appCode':_0x3612cf[_0x5b3f1e(0x185)]},()=>listAppConfigs(_0x3612cf[_0x5b3f1e(0x185)],{'key':_0x5e51a0,'tags':_0x2622d3})),_0x26ffe6=_0x38f9c2[_0x5b3f1e(0x17c)](_0x1cce40=>projectAppConfig(_0x1cce40));return{'ok':!![],'data':{'appCode':_0x3612cf[_0x5b3f1e(0x185)],'count':_0x26ffe6[_0x5b3f1e(0x178)],'configs':_0x26ffe6},'message':_0x5b3f1e(0x187)+_0x26ffe6[_0x5b3f1e(0x178)]+'\x20app\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0x5ed0d0=a28_0x2665;(function(_0x2eaa76,_0x3d1cc8){const _0x5dc7a1=a28_0x2665,_0x187da9=_0x2eaa76();while(!![]){try{const _0x5c71a6=-parseInt(_0x5dc7a1(0x128))/0x1+-parseInt(_0x5dc7a1(0x13c))/0x2*(-parseInt(_0x5dc7a1(0x13f))/0x3)+-parseInt(_0x5dc7a1(0x144))/0x4+-parseInt(_0x5dc7a1(0x12b))/0x5*(parseInt(_0x5dc7a1(0x129))/0x6)+parseInt(_0x5dc7a1(0x134))/0x7*(-parseInt(_0x5dc7a1(0x145))/0x8)+parseInt(_0x5dc7a1(0x13e))/0x9*(parseInt(_0x5dc7a1(0x138))/0xa)+-parseInt(_0x5dc7a1(0x132))/0xb*(-parseInt(_0x5dc7a1(0x12e))/0xc);if(_0x5c71a6===_0x3d1cc8)break;else _0x187da9['push'](_0x187da9['shift']());}catch(_0x42cda5){_0x187da9['push'](_0x187da9['shift']());}}}(a28_0x4b88,0x326e6));function a28_0x4b88(){const _0x541b58=['tags','2275Igythp','set',',\x20appCode=','apiError','10OnpcWC','/smartapi/app-config/create','POST','create','18raMOBS','get','1531053YgcMRg','95835OWQCIr','\x20app\x20config\x20','appCode','app-config','file','728328vvfVID','8080lWmiTL','178841tjFczv','76500BqWYMy','write','20LDBtnS','Created','Updated','102972pKiqBP','/smartapi/app-config/update','update','isFinite','627lBjRVE'];a28_0x4b88=function(){return _0x541b58;};return a28_0x4b88();}import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a28_0x2665(_0x3d60d5,_0x53ba84){_0x3d60d5=_0x3d60d5-0x128;const _0x4b88c1=a28_0x4b88();let _0x266586=_0x4b88c1[_0x3d60d5];return _0x266586;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a28_0x5ed0d0(0x139),UPDATE_PATH=a28_0x5ed0d0(0x12f);export const appConfigSet={'service':a28_0x5ed0d0(0x142),'command':a28_0x5ed0d0(0x135),'description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a28_0x5ed0d0(0x12a),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0x5ed0d0(0x143),'type':'string','description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x823bbd){readKeyArg(_0x823bbd),readOptionalTags(_0x823bbd),assertSingleValueSource(_0x823bbd);},async 'dryRun'(_0x318d4e){const _0x3123e6=a28_0x5ed0d0,_0x209fa6=readKeyArg(_0x318d4e),_0xf05d29=readOptionalTags(_0x318d4e),_0x1da69c=assertSingleValueSource(_0x318d4e);await assertValueSourceReadable(_0x1da69c);const _0x27ac31=await withAppConfigApiBoundary(_0x3123e6(0x13d),{'appCode':_0x318d4e[_0x3123e6(0x141)],'key':_0x209fa6},()=>getAppConfigByKey(_0x318d4e[_0x3123e6(0x141)],_0x209fa6)),_0x4fa0ba=_0x27ac31?_0x3123e6(0x130):'create',_0x30d43d=_0x27ac31?projectAppConfig(_0x27ac31):null,_0x5ce59e=plannedAppConfig({'appCode':_0x318d4e[_0x3123e6(0x141)],'key':_0x209fa6,'tags':_0xf05d29??_0x27ac31?.[_0x3123e6(0x133)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x4fa0ba,'appCode':_0x318d4e[_0x3123e6(0x141)],'key':_0x209fa6,'before':_0x30d43d,'after':_0x5ce59e,'dryRun':!![]}),{'method':_0x3123e6(0x13a),'url':_0x4fa0ba===_0x3123e6(0x130)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x3a16d4){const _0x412e01=a28_0x5ed0d0,_0x2229bb=readKeyArg(_0x3a16d4),_0x34efcb=readOptionalTags(_0x3a16d4),_0x144a0a=await withAppConfigApiBoundary('get',{'appCode':_0x3a16d4[_0x412e01(0x141)],'key':_0x2229bb},()=>getAppConfigByKey(_0x3a16d4['appCode'],_0x2229bb)),_0x2a03b8=_0x144a0a?projectAppConfig(_0x144a0a):null,_0x5ac6cd=_0x144a0a?_0x412e01(0x130):_0x412e01(0x13b),{value:_0x35fd51,warnings:_0x24cd48}=await readAppConfigValue(_0x3a16d4),_0x49db86={'appCode':_0x3a16d4['appCode'],'key':_0x2229bb,'value':_0x35fd51,'tags':_0x34efcb??_0x144a0a?.[_0x412e01(0x133)]??undefined};await withAppConfigApiBoundary(_0x5ac6cd,{'appCode':_0x3a16d4[_0x412e01(0x141)],'key':_0x2229bb},async()=>{const _0x593505=_0x412e01;_0x144a0a?await updateAppConfig({..._0x49db86,'id':requireAppConfigId(_0x144a0a,_0x2229bb,_0x3a16d4[_0x593505(0x141)])}):await createAppConfig(_0x49db86);});const _0x228f31=await withAppConfigApiBoundary('get',{'appCode':_0x3a16d4[_0x412e01(0x141)],'key':_0x2229bb},()=>getAppConfigByKey(_0x3a16d4[_0x412e01(0x141)],_0x2229bb)),_0x6dc9f4=_0x228f31?projectAppConfig(_0x228f31):plannedAppConfig({'appCode':_0x3a16d4[_0x412e01(0x141)],'key':_0x2229bb,'tags':_0x49db86['tags'],'hasValue':_0x35fd51!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x5ac6cd,'appCode':_0x3a16d4[_0x412e01(0x141)],'key':_0x2229bb,'before':_0x2a03b8,'after':_0x6dc9f4,'dryRun':![],'warnings':_0x24cd48}),'message':(_0x5ac6cd===_0x412e01(0x130)?_0x412e01(0x12d):_0x412e01(0x12c))+_0x412e01(0x140)+_0x2229bb};}};function requireAppConfigId(_0x186eea,_0x43a300,_0x39ade2){const _0x5ca1a1=a28_0x5ed0d0;if(typeof _0x186eea['id']==='number'&&Number[_0x5ca1a1(0x131)](_0x186eea['id'])&&_0x186eea['id']>0x0)return _0x186eea['id'];throw CliErrors[_0x5ca1a1(0x137)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x43a300+_0x5ca1a1(0x136)+_0x39ade2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a29_0x2bec51=a29_0x3ccd;(function(_0x419810,_0x22d4f6){const _0x90d6c8=a29_0x3ccd,_0x5b8279=_0x419810();while(!![]){try{const _0x358022=parseInt(_0x90d6c8(0x90))/0x1+-parseInt(_0x90d6c8(0x9b))/0x2*(-parseInt(_0x90d6c8(0xad))/0x3)+-parseInt(_0x90d6c8(0xa3))/0x4*(-parseInt(_0x90d6c8(0xba))/0x5)+parseInt(_0x90d6c8(0xac))/0x6+parseInt(_0x90d6c8(0xaa))/0x7+-parseInt(_0x90d6c8(0x8b))/0x8+parseInt(_0x90d6c8(0x93))/0x9*(-parseInt(_0x90d6c8(0xb2))/0xa);if(_0x358022===_0x22d4f6)break;else _0x5b8279['push'](_0x5b8279['shift']());}catch(_0x42fab3){_0x5b8279['push'](_0x5b8279['shift']());}}}(a29_0x3721,0x5339e));function a29_0x3721(){const _0x331057=['valueRedacted','kind','file','setEncoding','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','tags','key:\x20','value\x20is\x20redacted','18888iTvCnV','end','slice','bool','once','327456hMMxFI','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','dryRun','170505JqFIKX','gmtModified','value','env','Read\x20config\x20value\x20from\x20stdin','path','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','apiError','134rjHDvw','gmtCreate','appCode','stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','reveal','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','args','1632628wAgBTA','Environment\x20variable\x20is\x20not\x20set:\x20','validation','argument','Value\x20file\x20is\x20not\x20readable:\x20','push','flag','4541054AKiXHk','\x20app\x20config.','1176582NYJHYZ','7377gNxhgJ','str','Missing\x20app-config\x20key.','name','key','740IJleVs','utf8','length','after','defineProperties','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Failed\x20to\x20','operation','5osYTlT','warnings','join','string','trim','method','from-env','appCode:\x20'];a29_0x3721=function(){return _0x331057;};return a29_0x3721();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':'value','description':a29_0x2bec51(0xa1),'required':![]};export const TAGS_FLAG={'name':a29_0x2bec51(0x88),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a29_0x2bec51(0x9e),'type':'boolean','description':a29_0x2bec51(0x97),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a29_0x2bec51(0x7e),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a29_0x2bec51(0xa0),'type':'boolean','description':a29_0x2bec51(0x87),'default':![]};export function readKeyArg(_0x5e7845){const _0x315c96=_0x5e7845['args'][0x0]?.['trim']()??'';return validateKey(_0x315c96),_0x315c96;}export function readOptionalTags(_0x383848){const _0x4ad210=a29_0x2bec51,_0x19ff61=_0x383848['str']('tags')[_0x4ad210(0x7f)]();if(!_0x19ff61)return undefined;if(_0x19ff61[_0x4ad210(0xb4)]>0x20)throw CliErrors[_0x4ad210(0xa5)](_0x4ad210(0xb7));return _0x19ff61;}export function validateKey(_0x5de19a){const _0x17095b=a29_0x2bec51;if(!_0x5de19a)throw CliErrors[_0x17095b(0xa5)](_0x17095b(0xaf));if(_0x5de19a[_0x17095b(0xb4)]>0x100)throw CliErrors[_0x17095b(0xa5)](_0x17095b(0x91));}export function projectAppConfig(_0xce15d1,_0x396dfe){const _0xfb2343=a29_0x2bec51,_0x17609=_0xce15d1[_0xfb2343(0x95)]!==undefined&&_0xce15d1['value']!==null&&_0xce15d1['value']!=='',_0x240860={'appCode':_0xce15d1['appCode'],'key':_0xce15d1['key'],'tags':_0xce15d1[_0xfb2343(0x88)]??undefined,'hasValue':_0x17609,'valueRedacted':_0x17609&&!_0x396dfe?.[_0xfb2343(0xa0)],'gmtCreate':_0xce15d1[_0xfb2343(0x9c)],'gmtModified':_0xce15d1[_0xfb2343(0x94)]};return _0x396dfe?.[_0xfb2343(0xa0)]&&(_0x240860[_0xfb2343(0x95)]=_0xce15d1[_0xfb2343(0x95)]??'',_0x240860[_0xfb2343(0x83)]=![]),_0x240860;}export function plannedAppConfig(_0x472413){const _0x276822=a29_0x2bec51,_0x578302=_0x472413['hasValue']??!![];return{'appCode':_0x472413[_0x276822(0x9d)],'key':_0x472413[_0x276822(0xb1)],'tags':_0x472413['tags']??undefined,'hasValue':_0x578302,'valueRedacted':_0x578302};}function a29_0x3ccd(_0x5b80fc,_0x14a76b){_0x5b80fc=_0x5b80fc-0x7c;const _0x3721ed=a29_0x3721();let _0x3ccdb9=_0x3721ed[_0x5b80fc];return _0x3ccdb9;}export function buildMutationData(_0x5b0d0e){const _0x27e090=a29_0x2bec51;return{'operation':_0x5b0d0e[_0x27e090(0xb9)],'selector':{'appCode':_0x5b0d0e[_0x27e090(0x9d)],'key':_0x5b0d0e[_0x27e090(0xb1)]},'before':_0x5b0d0e['before'],'after':_0x5b0d0e[_0x27e090(0xb5)],'dryRun':_0x5b0d0e[_0x27e090(0x92)],'warnings':_0x5b0d0e[_0x27e090(0x7c)]??[]};}export async function withAppConfigApiBoundary(_0x419188,_0x457179,_0x2ad556){const _0x4c2844=a29_0x2bec51;try{return await _0x2ad556();}catch{const _0x28f3d2=[_0x4c2844(0x82)+_0x457179[_0x4c2844(0x9d)]];if(_0x457179['key'])_0x28f3d2[_0x4c2844(0xa8)](_0x4c2844(0x89)+_0x457179['key']);_0x28f3d2[_0x4c2844(0xa8)](_0x4c2844(0x8a));throw CliErrors[_0x4c2844(0x9a)](_0x4c2844(0xb8)+_0x419188+_0x4c2844(0xab),_0x28f3d2['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0xd70bb,_0x37c74b){const _0x315b25=a29_0x2bec51;return Object[_0x315b25(0xb6)](_0xd70bb,{'method':{'value':_0x37c74b[_0x315b25(0x80)],'enumerable':![]},'url':{'value':_0x37c74b['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x5c17ec){const _0x3ddc93=a29_0x2bec51,_0x353e02=[];_0x5c17ec[_0x3ddc93(0xa2)][_0x3ddc93(0xb4)]>0x1&&_0x353e02[_0x3ddc93(0xa8)]({'kind':_0x3ddc93(0xa6),'value':_0x5c17ec['args'][_0x3ddc93(0x8d)](0x1)[_0x3ddc93(0x7d)]('\x20')});const _0x4255b4=_0x5c17ec[_0x3ddc93(0xa9)](_0x3ddc93(0x95));_0x4255b4!==undefined&&_0x4255b4!==null&&_0x353e02[_0x3ddc93(0xa8)]({'kind':_0x3ddc93(0xa6),'value':String(_0x4255b4)});_0x5c17ec[_0x3ddc93(0x8e)](_0x3ddc93(0x9e))&&_0x353e02[_0x3ddc93(0xa8)]({'kind':'stdin'});const _0x185a57=_0x5c17ec[_0x3ddc93(0xae)](_0x3ddc93(0x81))['trim']();_0x185a57&&_0x353e02[_0x3ddc93(0xa8)]({'kind':_0x3ddc93(0x96),'name':_0x185a57});const _0x483453=_0x5c17ec['str'](_0x3ddc93(0x85))['trim']();_0x483453&&_0x353e02['push']({'kind':_0x3ddc93(0x85),'path':_0x483453});if(_0x353e02[_0x3ddc93(0xb4)]===0x0)throw CliErrors[_0x3ddc93(0xa5)]('Missing\x20app-config\x20value\x20source.',_0x3ddc93(0x9f));if(_0x353e02[_0x3ddc93(0xb4)]>0x1)throw CliErrors[_0x3ddc93(0xa5)]('App\x20config\x20value\x20source\x20is\x20ambiguous.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');return _0x353e02[0x0];}export async function assertValueSourceReadable(_0xb431eb){const _0x1e8a71=a29_0x2bec51;if(_0xb431eb['kind']===_0x1e8a71(0x96)&&!(_0xb431eb[_0x1e8a71(0xb0)]in process.env))throw CliErrors['validation'](_0x1e8a71(0xa4)+_0xb431eb['name']);if(_0xb431eb[_0x1e8a71(0x84)]===_0x1e8a71(0x85))try{await access(_0xb431eb[_0x1e8a71(0x98)]);}catch{throw CliErrors['validation'](_0x1e8a71(0xa7)+_0xb431eb[_0x1e8a71(0x98)]);}}export async function readAppConfigValue(_0x495655){const _0x2627cd=a29_0x2bec51,_0x33e0ef=assertSingleValueSource(_0x495655),_0x32278b=[];if(_0x33e0ef[_0x2627cd(0x84)]===_0x2627cd(0xa6))return _0x32278b['push'](_0x2627cd(0x99)),{'value':_0x33e0ef[_0x2627cd(0x95)]??'','source':_0x33e0ef[_0x2627cd(0x84)],'warnings':_0x32278b};if(_0x33e0ef[_0x2627cd(0x84)]==='stdin')return{'value':await readStdin(),'source':_0x33e0ef[_0x2627cd(0x84)],'warnings':_0x32278b};if(_0x33e0ef[_0x2627cd(0x84)]==='env'){if(!(_0x33e0ef[_0x2627cd(0xb0)]in process.env))throw CliErrors['validation'](_0x2627cd(0xa4)+_0x33e0ef[_0x2627cd(0xb0)]);return{'value':process.env[_0x33e0ef.name]??'','source':_0x33e0ef['kind'],'warnings':_0x32278b};}return{'value':await readFile(_0x33e0ef[_0x2627cd(0x98)],_0x2627cd(0xb3)),'source':_0x33e0ef[_0x2627cd(0x84)],'warnings':_0x32278b};}function readStdin(){return new Promise((_0x4a7f8e,_0x3456ba)=>{const _0x259bb0=a29_0x3ccd;let _0x1f7107='';process[_0x259bb0(0x9e)][_0x259bb0(0x86)](_0x259bb0(0xb3)),process[_0x259bb0(0x9e)]['on']('data',_0x1ca7ce=>{_0x1f7107+=_0x1ca7ce;}),process[_0x259bb0(0x9e)][_0x259bb0(0x8f)](_0x259bb0(0x8c),()=>_0x4a7f8e(_0x1f7107)),process[_0x259bb0(0x9e)][_0x259bb0(0x8f)]('error',_0x3456ba);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x3a557b=a30_0x55b9;(function(_0x35929c,_0x2932ab){const _0x1d5502=a30_0x55b9,_0x556fc1=_0x35929c();while(!![]){try{const _0x3fe321=parseInt(_0x1d5502(0xfc))/0x1+parseInt(_0x1d5502(0x108))/0x2*(-parseInt(_0x1d5502(0x107))/0x3)+-parseInt(_0x1d5502(0x101))/0x4*(parseInt(_0x1d5502(0xf8))/0x5)+parseInt(_0x1d5502(0xfa))/0x6+-parseInt(_0x1d5502(0x100))/0x7+-parseInt(_0x1d5502(0xf6))/0x8+parseInt(_0x1d5502(0x105))/0x9;if(_0x3fe321===_0x2932ab)break;else _0x556fc1['push'](_0x556fc1['shift']());}catch(_0x3ff5cd){_0x556fc1['push'](_0x556fc1['shift']());}}}(a30_0x1a5a,0x6dddb));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a30_0x1a5a(){const _0x4d7e1a=['log','543yjYgSk','9746PWDMbb','nonInteractive','write','5048336ItgqjG','Clear\x20login\x20session','125cdssMS','✓\x20Logged\x20out','4000284gYvByU','boolean','99299YnzOVV','bool','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','1634227FGKqES','53148OBIxMW','logout','../../auth/auth-server-ui.js','auth','15864201sTKzQx'];a30_0x1a5a=function(){return _0x4d7e1a;};return a30_0x1a5a();}function a30_0x55b9(_0x4d87bf,_0x126f9f){_0x4d87bf=_0x4d87bf-0xf4;const _0x1a5a9c=a30_0x1a5a();let _0x55b911=_0x1a5a9c[_0x4d87bf];return _0x55b911;}export const authDefinitions=[{'service':a30_0x3a557b(0x104),'command':'login','description':'Login\x20via\x20browser','risk':a30_0x3a557b(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a30_0x3a557b(0xfb),'description':a30_0x3a557b(0xff),'default':![]}],async 'execute'(_0x15e0fd){const _0x518ef8=a30_0x3a557b,{runAuthServer:_0x50181c}=await import(_0x518ef8(0x103));return await _0x50181c({'autoYes':_0x15e0fd[_0x518ef8(0xfd)]('yes'),'nonInteractive':_0x15e0fd[_0x518ef8(0xf4)]}),{'ok':!![]};}},{'service':a30_0x3a557b(0x104),'command':a30_0x3a557b(0x102),'description':a30_0x3a557b(0xf7),'risk':a30_0x3a557b(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2257b1){const _0x1adebe=a30_0x3a557b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1adebe(0x106)](_0x1adebe(0xf9))):console[_0x1adebe(0x106)](_0x1adebe(0xfe)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a31_0x4f7967=a31_0x2695;(function(_0xc5694a,_0x4676b4){const _0x1d79e1=a31_0x2695,_0x4f3d4c=_0xc5694a();while(!![]){try{const _0x596066=parseInt(_0x1d79e1(0x168))/0x1+-parseInt(_0x1d79e1(0x1a9))/0x2*(-parseInt(_0x1d79e1(0x172))/0x3)+-parseInt(_0x1d79e1(0x18c))/0x4*(-parseInt(_0x1d79e1(0x185))/0x5)+-parseInt(_0x1d79e1(0x17b))/0x6+parseInt(_0x1d79e1(0x19a))/0x7*(-parseInt(_0x1d79e1(0x19c))/0x8)+parseInt(_0x1d79e1(0x182))/0x9+-parseInt(_0x1d79e1(0x173))/0xa;if(_0x596066===_0x4676b4)break;else _0x4f3d4c['push'](_0x4f3d4c['shift']());}catch(_0x50c5ea){_0x4f3d4c['push'](_0x4f3d4c['shift']());}}}(a31_0x17eb,0xca32f));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x4f7967(0x19d),'command':a31_0x4f7967(0x16a),'description':a31_0x4f7967(0x1a1),'risk':a31_0x4f7967(0x1aa),'flags':[{'name':a31_0x4f7967(0x169),'type':a31_0x4f7967(0x167),'required':!![],'enum':[a31_0x4f7967(0x1ac),'ENDPOINT',a31_0x4f7967(0x1af)],'description':a31_0x4f7967(0x1b3)},{'name':a31_0x4f7967(0x19f),'type':a31_0x4f7967(0x167),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a31_0x4f7967(0x167),'description':a31_0x4f7967(0x16c)},{'name':a31_0x4f7967(0x1b1),'type':a31_0x4f7967(0x167),'description':a31_0x4f7967(0x199)},{'name':'datasetcode','type':'string','description':a31_0x4f7967(0x1bc)},{'name':'operation-type','type':a31_0x4f7967(0x167),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':'string','description':a31_0x4f7967(0x18a),'enum':['before',a31_0x4f7967(0x1b4)]}],async 'validate'(_0x61b134){const _0x35c96d=a31_0x4f7967,_0x2c627f=_0x61b134[_0x35c96d(0x186)]('name');if(!isValidBffFunctionName(_0x2c627f))throw CliErrors['validation'](_0x35c96d(0x1b6)+_0x2c627f+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x489f7c){const _0x3b8a93=a31_0x4f7967,_0x82006f=loadBffProjectConfig(_0x489f7c[_0x3b8a93(0x16d)]),_0xf4d9fe=_0x489f7c['str'](_0x3b8a93(0x169)),_0x3a045e=_0x489f7c[_0x3b8a93(0x186)](_0x3b8a93(0x19f)),_0x7bda50=_0x489f7c[_0x3b8a93(0x186)](_0x3b8a93(0x1bd))||undefined,_0x28f7e7=_0xf4d9fe===_0x3b8a93(0x1af)?await resolveHookOptions(_0x82006f,_0x489f7c):undefined,_0x38ad48=buildFilePath(_0x82006f,_0xf4d9fe,_0x3a045e,_0x28f7e7);if(await fileExists(_0x38ad48))throw CliErrors[_0x3b8a93(0x188)]('File\x20already\x20exists:\x20'+_0x38ad48);await mkdir(dirname(_0x38ad48),{'recursive':!![]});const _0x1928e5=generateTemplate(_0xf4d9fe,_0x3a045e,_0x489f7c[_0x3b8a93(0x16d)],_0x7bda50,_0x28f7e7);await writeFile(_0x38ad48,_0x1928e5,_0x3b8a93(0x17e));const _0x5df0d4={'type':_0xf4d9fe,'name':_0x3a045e,'path':_0x38ad48};if(_0x7bda50)_0x5df0d4['description']=_0x7bda50;if(_0x28f7e7){if(_0x28f7e7[_0x3b8a93(0x1b1)])_0x5df0d4[_0x3b8a93(0x1b1)]=_0x28f7e7[_0x3b8a93(0x1b1)];_0x5df0d4['datasetCode']=_0x28f7e7['datasetCode'],_0x5df0d4[_0x3b8a93(0x1a0)]=_0x28f7e7['operationType'],_0x5df0d4['functionNode']=_0x28f7e7[_0x3b8a93(0x17a)];}return{'ok':!![],'data':_0x5df0d4,'message':'Created\x20'+_0xf4d9fe+'\x20function:\x20'+_0x3a045e};}};async function resolveHookOptions(_0x10a311,_0x45df31){const _0xeb75c3=a31_0x4f7967,_0x2e8970=loadAliasMap(_0x45df31['apiDir'],undefined,resolveApiFilePath(_0x45df31[_0xeb75c3(0x195)],_0x45df31[_0xeb75c3(0x16d)])),_0x3cfabf=_0x2e8970[_0xeb75c3(0x1c2)]>0x0;let _0x28483c,_0x40300a,_0x17587c;const _0x17a092=_0x45df31[_0xeb75c3(0x186)](_0xeb75c3(0x1b1)),_0x4bdd73=_0x45df31[_0xeb75c3(0x186)](_0xeb75c3(0x181));if(_0x17a092){const _0xb94374=resolveAlias(_0x45df31[_0xeb75c3(0x195)],_0x17a092,undefined,resolveApiFilePath(_0x45df31[_0xeb75c3(0x195)],_0x45df31[_0xeb75c3(0x16d)]));if(!_0xb94374){const _0x4efda2=_0x3cfabf?_0xeb75c3(0x1b5)+_0x2e8970[_0xeb75c3(0x18d)](_0x2b264b=>_0x2b264b['alias'])[_0xeb75c3(0x1c9)](',\x20'):_0xeb75c3(0x18f)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x1be)+_0x17a092+_0xeb75c3(0x196)+_0x4efda2);}_0x28483c=_0x17a092,_0x40300a=_0xb94374;}else{if(_0x4bdd73){_0x40300a=_0x4bdd73;const _0x5c6d6e=_0x2e8970[_0xeb75c3(0x194)](_0x3b29eb=>_0x3b29eb[_0xeb75c3(0x183)]===_0x4bdd73);_0x28483c=_0x5c6d6e?.[_0xeb75c3(0x1b1)];}else{if(_0x45df31['nonInteractive'])throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x1a6));else{if(_0x3cfabf){const _0x2966dd=_0x2e8970[_0xeb75c3(0x18d)](_0xfec5c8=>_0xfec5c8['alias']+'\x20('+_0xfec5c8[_0xeb75c3(0x1b0)]+')'),_0x28eaf4=await promptSelect('Select\x20dataset:',_0x2966dd),_0x4348ab=_0x2e8970[_0x28eaf4];if(!_0x4348ab)throw CliErrors['validation'](_0xeb75c3(0x1c3));_0x28483c=_0x4348ab[_0xeb75c3(0x1b1)],_0x40300a=_0x4348ab['datasetCode'];}else{const _0x1ab4f5=await listDatasets(_0x45df31[_0xeb75c3(0x16d)]);if(_0x1ab4f5['length']===0x0)throw CliErrors[_0xeb75c3(0x188)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x37342b=_0x1ab4f5[_0xeb75c3(0x18d)](_0x4ce2e3=>_0x4ce2e3[_0xeb75c3(0x19f)]+'\x20['+(_0x4ce2e3[_0xeb75c3(0x1a3)]??_0xeb75c3(0x1b9))+_0xeb75c3(0x1a7)+_0x4ce2e3[_0xeb75c3(0x16f)]+')'),_0x163cce=await promptSelect('Select\x20dataset:',_0x37342b),_0x230fc1=_0x1ab4f5[_0x163cce];if(!_0x230fc1)throw CliErrors['validation'](_0xeb75c3(0x1c3));_0x40300a=_0x230fc1[_0xeb75c3(0x16f)],_0x28483c=undefined;}}}}const _0x1737fb=await listDatasets(_0x45df31[_0xeb75c3(0x16d)]),_0x36f298=_0x1737fb[_0xeb75c3(0x194)](_0x5d4d1a=>_0x5d4d1a[_0xeb75c3(0x16f)]===_0x40300a);if(!_0x36f298)throw CliErrors[_0xeb75c3(0x188)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x40300a+'\x22.\x20'+(_0x28483c?_0xeb75c3(0x179)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x17587c=_0x36f298['id'];const _0x574640=_0x28483c??_0x40300a,_0x101119=await listBffDatasetOperations(_0x45df31[_0xeb75c3(0x16d)],_0x17587c),_0xbfffb2=_0x101119?Object[_0xeb75c3(0x193)](_0x101119):[];if(_0xbfffb2['length']===0x0)throw CliErrors[_0xeb75c3(0x188)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x574640+'.');let _0x313f57;const _0x5302f0=_0x45df31[_0xeb75c3(0x186)](_0xeb75c3(0x176));if(_0x5302f0){if(!_0xbfffb2[_0xeb75c3(0x198)](_0x5302f0))throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x1c0)+_0x5302f0+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x574640+'.\x20'+(_0xeb75c3(0x1c5)+_0xbfffb2[_0xeb75c3(0x1c9)](',\x20')));_0x313f57=_0x5302f0;}else{if(_0x45df31[_0xeb75c3(0x187)])throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x178));const _0x56439e=await promptSelect('Select\x20operation\x20type:',_0xbfffb2);_0x313f57=_0xbfffb2[_0x56439e]??_0xbfffb2[0x0];}let _0x4ba1f6=normalizeHookFunctionNode(_0x45df31[_0xeb75c3(0x186)](_0xeb75c3(0x1a4)));if(!_0x4ba1f6){if(_0x45df31[_0xeb75c3(0x186)]('function-node'))throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x1cc));if(_0x45df31[_0xeb75c3(0x187)])throw CliErrors[_0xeb75c3(0x188)](_0xeb75c3(0x1a8));const _0x15db58=await promptSelect(_0xeb75c3(0x177),['before',_0xeb75c3(0x1b4)]);_0x4ba1f6=[_0xeb75c3(0x1bb),'after'][_0x15db58]??_0xeb75c3(0x1bb);}return{'alias':_0x28483c,'datasetCode':_0x40300a,'datasetId':_0x17587c,'operationType':_0x313f57,'functionNode':_0x4ba1f6};}async function promptSelect(_0x3a1470,_0x1d0e49){const _0x37b2ba=a31_0x4f7967;if(_0x1d0e49[_0x37b2ba(0x1c2)]===0x1)return 0x0;for(const [_0x2ae09f,_0x80838]of _0x1d0e49['entries']()){process[_0x37b2ba(0x16b)][_0x37b2ba(0x1b7)]('\x20\x20'+(_0x2ae09f+0x1)+'.\x20'+_0x80838+'\x0a');}const _0x23d44a=createInterface({'input':process[_0x37b2ba(0x1ab)],'output':process[_0x37b2ba(0x16b)]});while(!![]){const _0x216256=await new Promise(_0x3b104f=>{const _0x86e403=_0x37b2ba;_0x23d44a[_0x86e403(0x189)](_0x3a1470+'\x20',_0x3b104f);}),_0x435bbf=Number[_0x37b2ba(0x192)](_0x216256[_0x37b2ba(0x1a5)](),0xa);if(Number['isInteger'](_0x435bbf)&&_0x435bbf>=0x1&&_0x435bbf<=_0x1d0e49[_0x37b2ba(0x1c2)])return _0x23d44a[_0x37b2ba(0x170)](),_0x435bbf-0x1;process[_0x37b2ba(0x16b)][_0x37b2ba(0x1b7)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x1d0e49[_0x37b2ba(0x1c2)]+'.\x0a');}}function buildFilePath(_0x2ccc7c,_0xb9df13,_0x2ba355,_0x2e3081){const _0x4e5e60=a31_0x4f7967;if(_0xb9df13===_0x4e5e60(0x1af)){if(!_0x2e3081)throw CliErrors[_0x4e5e60(0x188)](_0x4e5e60(0x1a2));const _0x479f92=_0x2e3081[_0x4e5e60(0x1b1)]??_0x2e3081[_0x4e5e60(0x183)];return join(_0x2ccc7c[_0x4e5e60(0x1ba)],'HOOK',_0x479f92,_0x2e3081['operationType'],_0x2e3081['functionNode'],_0x2ba355+'.js');}return join(_0x2ccc7c['scriptsRootDir'],_0xb9df13,_0x2ba355+_0x4e5e60(0x1c7));}export function generateTemplate(_0x42e8b1,_0x397caa,_0x5df18d,_0x1fce1d,_0x1c0607){const _0x3fcee5=a31_0x4f7967,_0x189a6c=_0x1fce1d?.[_0x3fcee5(0x1a5)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x5b0837=getAppBaseUrl(_0x5df18d),_0x690197='\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(_0x42e8b1===_0x3fcee5(0x1ac))return'/**\x0a\x20*\x20'+_0x189a6c+_0x3fcee5(0x1c8)+_0x397caa+'\x0a\x20*\x20[平台配置]\x20'+_0x5b0837+_0x3fcee5(0x1ca)+_0x5df18d+_0x3fcee5(0x19b)+_0x397caa+_0x3fcee5(0x1c1)+_0x397caa+_0x3fcee5(0x1cb)+_0x690197+'\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'+_0x397caa+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x42e8b1===_0x3fcee5(0x174))return'/**\x0a\x20*\x20'+_0x189a6c+_0x3fcee5(0x1b8)+_0x397caa+_0x3fcee5(0x17f)+_0x5df18d+'/'+_0x397caa+_0x3fcee5(0x19e)+_0x5b0837+_0x3fcee5(0x1ca)+_0x5df18d+_0x3fcee5(0x197)+_0x397caa+_0x3fcee5(0x171)+_0x690197+_0x3fcee5(0x184)+_0x397caa+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x1c0607)throw CliErrors[_0x3fcee5(0x188)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x53ee64=_0x1c0607[_0x3fcee5(0x1b1)]??_0x1c0607[_0x3fcee5(0x183)],_0x5392fe=_0x1c0607[_0x3fcee5(0x17a)]==='before'?_0x3fcee5(0x1c4):_0x3fcee5(0x1c6),_0x559352=_0x1c0607[_0x3fcee5(0x17a)]===_0x3fcee5(0x1bb)?_0x3fcee5(0x191):_0x3fcee5(0x17d);return _0x3fcee5(0x1b2)+_0x189a6c+_0x3fcee5(0x1ae)+_0x397caa+_0x3fcee5(0x17c)+_0x5df18d+'/'+_0x1c0607['datasetCode']+'/'+_0x1c0607['operationType']+_0x3fcee5(0x19e)+_0x5b0837+_0x3fcee5(0x1bf)+_0x1c0607[_0x3fcee5(0x18e)]+_0x3fcee5(0x190)+_0x5df18d+_0x3fcee5(0x180)+_0x53ee64+'/'+_0x1c0607[_0x3fcee5(0x1a0)]+'/'+_0x1c0607['functionNode']+'/'+_0x397caa+_0x3fcee5(0x18b)+_0x1c0607[_0x3fcee5(0x17a)]+'\x0a'+_0x690197+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x5392fe+_0x3fcee5(0x1ad)+_0x559352+_0x3fcee5(0x16e)+_0x397caa+_0x3fcee5(0x175);}function a31_0x2695(_0x1646ca,_0x42187a){_0x1646ca=_0x1646ca-0x167;const _0x17eba3=a31_0x17eb();let _0x2695c9=_0x17eba3[_0x1646ca];return _0x2695c9;}function a31_0x17eb(){const _0x4bbc87=['3504bAbbsb','bff','\x0a\x20*\x20[平台配置]\x20','name','operationType','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','HOOK\x20requires\x20alias/operation/node\x20options.','source','function-node','trim','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.',']\x20(','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','68IQqQHp','read','stdin','COMMON','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','HOOK','tableName','alias','/**\x0a\x20*\x20','Script\x20type','after','Available\x20aliases:\x20','Invalid\x20function\x20name\x20\x22','write','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','UNKNOWN','scriptsRootDir','before','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','description','Alias\x20\x22','/data/dataset/','Operation\x20type\x20\x22','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','length','Invalid\x20dataset\x20selection.','当前请求参数','Available:\x20','当前响应结果','.js','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','join','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x22,\x20params\x20})\x0a','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','string','716121pmXGps','type','create','stderr','Script\x20description','appCode','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','code','close','.js\x0a','33795OgiWxd','7507270pmXQim','ENDPOINT','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','operation-type','Select\x20trigger\x20node:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','functionNode','7187712rzvSzS','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','修改后的响应结果','utf8','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','/HOOK/','datasetcode','8459055AJpqpW','datasetCode','\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','2846575IFVCFE','str','nonInteractive','validation','question','Trigger\x20node\x20(HOOK\x20only)','.js\x0a\x20*\x20[触发节点]\x20','8hYmfWK','map','datasetId','No\x20api.ts\x20found.\x20Run\x20`','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','修改后的请求参数','parseInt','keys','find','apiDir','\x22\x20not\x20found.\x20','/ENDPOINT/','includes','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','6405PoANBK','/COMMON/'];a31_0x17eb=function(){return _0x4bbc87;};return a31_0x17eb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a32_0x518c9a=a32_0x2524;function a32_0x3d4c(){const _0xe94cd1=['\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','str','includes','stringify','Backend\x20Function\x20lock\x20file\x20not\x20found.','1mUnDiD','replace','filter','toISOString','join','<timestamp>','POST','appCode','length','4020TVESIS','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','bff','parse','startsWith','target','368450uooLII','functions','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','Deleted\x20','map','trashDir','Local\x20delete\x20not\x20settled\x20for\x20','561022enPOoX','projectRoot','scriptsRoot','delete','string','536490WRqxmn','lastSync','validation','\x20(local\x20file\x20moved\x20to\x20trash)','Function\x20not\x20found:\x20','7849215HPldLl','split','high-risk-write','\x22\x20not\x20found\x20after\x20ensureLockScope.','1816410LibHUe','lockFilePath','2153176NKSkLF','300CwHGrW','keys','Lock\x20scope\x20for\x20app\x20\x22','/api/management/library/scripts/delete','find','No\x20lock\x20entry\x20found\x20for\x20\x22','\x20\x20-\x20','apps'];a32_0x3d4c=function(){return _0xe94cd1;};return a32_0x3d4c();}(function(_0x29a31a,_0x519e15){const _0x3c5e2b=a32_0x2524,_0x1059ac=_0x29a31a();while(!![]){try{const _0x5cec15=parseInt(_0x3c5e2b(0xd5))/0x1*(parseInt(_0x3c5e2b(0xb0))/0x2)+-parseInt(_0x3c5e2b(0xbc))/0x3+parseInt(_0x3c5e2b(0xaa))/0x4*(-parseInt(_0x3c5e2b(0xc8))/0x5)+-parseInt(_0x3c5e2b(0xc5))/0x6+-parseInt(_0x3c5e2b(0xb7))/0x7+-parseInt(_0x3c5e2b(0xc7))/0x8+parseInt(_0x3c5e2b(0xc1))/0x9;if(_0x5cec15===_0x519e15)break;else _0x1059ac['push'](_0x1059ac['shift']());}catch(_0x4a2fcb){_0x1059ac['push'](_0x1059ac['shift']());}}}(a32_0x3d4c,0x28552));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a32_0x2524(_0x5c77a8,_0x314278){_0x5c77a8=_0x5c77a8-0xa8;const _0x3d4c89=a32_0x3d4c();let _0x2524e8=_0x3d4c89[_0x5c77a8];return _0x2524e8;}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x518c9a(0xac),'command':'delete','description':a32_0x518c9a(0xb2),'risk':a32_0x518c9a(0xc3),'flags':[{'name':a32_0x518c9a(0xaf),'type':a32_0x518c9a(0xbb),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x48c591){const _0x177bd2=a32_0x518c9a,_0x91fed3=loadBffProjectConfig(_0x48c591[_0x177bd2(0xa8)]),_0x13b79a=await readBffLockFile(_0x91fed3[_0x177bd2(0xc6)]);if(!_0x13b79a)throw CliErrors[_0x177bd2(0xbe)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x4aa68f){const _0x3929ba=a32_0x518c9a,_0xfae67e=loadBffProjectConfig(_0x4aa68f[_0x3929ba(0xa8)]),_0x1d730b=await readBffLockFile(_0xfae67e[_0x3929ba(0xc6)]);if(!_0x1d730b)throw CliErrors['validation'](_0x3929ba(0xd4));const {appLock:_0x4ff8f2}=ensureLockScope(_0x1d730b,_0x4aa68f[_0x3929ba(0xa8)],_0xfae67e[_0x3929ba(0xb9)],_0x3929ba(0xba)),_0x46233b=_0x4aa68f['str'](_0x3929ba(0xaf)),_0x2e378c=Object[_0x3929ba(0xc9)](_0x4ff8f2[_0x3929ba(0xb1)]),_0x8cd9ed=resolveDeleteTarget(_0x46233b,_0x2e378c),_0xbe23d9=_0x4ff8f2['functions'][_0x8cd9ed];if(!_0xbe23d9)throw CliErrors[_0x3929ba(0xbe)](_0x3929ba(0xcd)+_0x8cd9ed+'\x22.');const _0x12b8b5=resolveLocalFilePathFromLockKey(_0xfae67e,_0x8cd9ed),_0x232bb2=relative(_0xfae67e[_0x3929ba(0xb8)],_0x12b8b5),_0x400bfe=join(_0xfae67e[_0x3929ba(0xb5)],_0x3929ba(0xda),_0x232bb2);return{'method':_0x3929ba(0xdb),'url':_0x3929ba(0xcb),'body':{'appCode':_0x4aa68f['appCode'],'target':_0x8cd9ed,'remoteId':_0xbe23d9['remoteId'],'localFilePath':_0x12b8b5,'trashedPath':_0x400bfe},'description':'Would\x20delete\x20'+_0x8cd9ed+_0x3929ba(0xab)};},async 'execute'(_0x3cbed5){const _0x513b52=a32_0x518c9a,_0x5fc340=loadBffProjectConfig(_0x3cbed5['appCode']),_0x4e3fa8=await readBffLockFile(_0x5fc340[_0x513b52(0xc6)]);if(!_0x4e3fa8)throw CliErrors['validation']('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x5db2c8,appLock:_0x511313}=ensureLockScope(_0x4e3fa8,_0x3cbed5['appCode'],_0x5fc340[_0x513b52(0xb9)],'delete'),_0x204bd1=JSON[_0x513b52(0xad)](JSON[_0x513b52(0xd3)](_0x5db2c8)),_0x4bbb3f=_0x204bd1[_0x513b52(0xcf)][_0x3cbed5['appCode']];if(!_0x4bbb3f)throw new Error(_0x513b52(0xca)+_0x3cbed5['appCode']+_0x513b52(0xc4));const _0x2b2ea4=_0x3cbed5[_0x513b52(0xd1)](_0x513b52(0xaf)),_0x363b04=Object['keys'](_0x4bbb3f[_0x513b52(0xb1)]),_0x3a7c0b=resolveDeleteTarget(_0x2b2ea4,_0x363b04),_0x20e978=_0x4bbb3f[_0x513b52(0xb1)][_0x3a7c0b];if(!_0x20e978)throw CliErrors['validation'](_0x513b52(0xcd)+_0x3a7c0b+'\x22.');await deleteBffScript(_0x20e978['remoteId']),delete _0x4bbb3f[_0x513b52(0xb1)][_0x3a7c0b],_0x4bbb3f[_0x513b52(0xbd)]=new Date()[_0x513b52(0xd8)](),await writeBffLockFile(_0x5fc340[_0x513b52(0xc6)],_0x204bd1);const _0x2dc97a=resolveLocalFilePathFromLockKey(_0x5fc340,_0x3a7c0b);let _0x260a7e;await fileExists(_0x2dc97a)&&(_0x260a7e=await moveToTrash(_0x5fc340['projectRoot'],_0x5fc340[_0x513b52(0xb5)],_0x2dc97a),await cleanupEmptyDirectories(dirname(_0x2dc97a),_0x5fc340['scriptsRootDir']));await waitForDeleteSettlement(_0x5fc340[_0x513b52(0xc6)],_0x3cbed5['appCode'],_0x3a7c0b,_0x2dc97a),await sleep(0x96);const _0x56cbd5={'deleted':_0x3a7c0b,'remoteId':_0x20e978['remoteId']};if(_0x260a7e)_0x56cbd5['trashedTo']=_0x260a7e;return{'ok':!![],'data':_0x56cbd5,'message':_0x513b52(0xb3)+_0x3a7c0b+(_0x260a7e?_0x513b52(0xbf):'')};}};function resolveDeleteTarget(_0x156baa,_0x431e35){const _0x27cf77=a32_0x518c9a;if(_0x156baa[_0x27cf77(0xd2)]('/')){const _0x261ab6=_0x431e35[_0x27cf77(0xcc)](_0x48314d=>_0x48314d===_0x156baa);if(!_0x261ab6)throw CliErrors[_0x27cf77(0xbe)]('Function\x20not\x20found:\x20'+_0x156baa);return _0x261ab6;}const _0x4d5011=_0x431e35[_0x27cf77(0xd7)](_0x3c7744=>_0x3c7744[_0x27cf77(0xc2)]('/')['at'](-0x1)===_0x156baa);if(_0x4d5011[_0x27cf77(0xa9)]===0x0)throw CliErrors[_0x27cf77(0xbe)](_0x27cf77(0xc0)+_0x156baa);if(_0x4d5011[_0x27cf77(0xa9)]>0x1)throw CliErrors[_0x27cf77(0xbe)]('Multiple\x20functions\x20match\x20\x22'+_0x156baa+_0x27cf77(0xd0)+_0x4d5011[_0x27cf77(0xb4)](_0x4bdc76=>_0x27cf77(0xce)+_0x4bdc76)[_0x27cf77(0xd9)]('\x0a'));return _0x4d5011[0x0];}async function moveToTrash(_0x267834,_0x3cfbf4,_0x4bb552){const _0x5ccb8a=a32_0x518c9a,_0x3a9d90=new Date()[_0x5ccb8a(0xd8)]()[_0x5ccb8a(0xd6)](/[:.]/g,'-'),_0x1bf20e=relative(_0x267834,_0x4bb552),_0x96d206=join(_0x3cfbf4,_0x3a9d90,_0x1bf20e);return await mkdir(dirname(_0x96d206),{'recursive':!![]}),await rename(_0x4bb552,_0x96d206),_0x96d206;}async function cleanupEmptyDirectories(_0x301695,_0x16dc4e){const _0x2cecd2=a32_0x518c9a;let _0x166f18=resolve(_0x301695);const _0x33edd8=resolve(_0x16dc4e);while(_0x166f18[_0x2cecd2(0xae)](''+_0x33edd8+sep)||_0x166f18===_0x33edd8){if(_0x166f18===_0x33edd8)return;try{const _0x513aeb=await readdir(_0x166f18);if(_0x513aeb['length']>0x0)return;await rmdir(_0x166f18);}catch{return;}_0x166f18=dirname(_0x166f18);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x907900,_0xa80edf,_0x43eb53,_0x18f3b3){const _0x130642=a32_0x518c9a;for(let _0x2ea3a8=0x0;_0x2ea3a8<DELETE_SETTLE_RETRY_COUNT;_0x2ea3a8+=0x1){const _0x200c79=await readBffLockFile(_0x907900),_0x5134ac=!!_0x200c79?.[_0x130642(0xcf)]?.[_0xa80edf]?.[_0x130642(0xb1)]?.[_0x43eb53],_0x437e0f=await fileExists(_0x18f3b3);if(!_0x5134ac&&!_0x437e0f)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x130642(0xb6)+_0x43eb53+'.');}
|