@lovrabet/rabetbase-cli 2.5.2-beta.1 → 2.5.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +1 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.d.ts +2 -0
- package/lib/commands/deployment/sync-all.js +1 -0
- package/lib/commands/deployment/sync-jobs.d.ts +2 -0
- package/lib/commands/deployment/sync-jobs.js +1 -0
- package/lib/commands/deployment/sync-status.d.ts +2 -0
- package/lib/commands/deployment/sync-status.js +1 -0
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.d.ts +2 -0
- package/lib/commands/instant-api-policy/current.js +1 -0
- package/lib/commands/instant-api-policy/index.d.ts +2 -0
- package/lib/commands/instant-api-policy/index.js +1 -0
- package/lib/commands/instant-api-policy/init.d.ts +2 -0
- package/lib/commands/instant-api-policy/init.js +1 -0
- package/lib/commands/instant-api-policy/publish.d.ts +2 -0
- package/lib/commands/instant-api-policy/publish.js +1 -0
- package/lib/commands/instant-api-policy/pull.d.ts +2 -0
- package/lib/commands/instant-api-policy/pull.js +1 -0
- package/lib/commands/instant-api-policy/revision.d.ts +2 -0
- package/lib/commands/instant-api-policy/revision.js +1 -0
- package/lib/commands/instant-api-policy/revisions.d.ts +2 -0
- package/lib/commands/instant-api-policy/revisions.js +1 -0
- package/lib/commands/instant-api-policy/rollback.d.ts +2 -0
- package/lib/commands/instant-api-policy/rollback.js +1 -0
- package/lib/commands/instant-api-policy/shared.d.ts +82 -0
- package/lib/commands/instant-api-policy/shared.js +1 -0
- package/lib/commands/instant-api-policy/validate.d.ts +2 -0
- package/lib/commands/instant-api-policy/validate.js +1 -0
- 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/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/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.d.ts +3 -7
- 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 +114 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.d.ts +23 -0
- package/lib/core/instant-api-policy/config.js +1 -0
- 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.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- 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 +12 -6
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +41 -5
- package/skills/rabetbase/references/rabetbase-instant-api-policy.md +92 -0
- package/skills/rabetbase.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a18_0x266d(){const _0x2cec32=['length','4277151MijAfY','494278cttOOV','bool','4062LnLfQQ','validation','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','1480227nujnZs','891074pqYmqN','selectedAppName','join','name','4Ngwvxa','3398192yhkQPW','project','merged','map','2725oyINgX','filter','1204929SOKaSQ'];a18_0x266d=function(){return _0x2cec32;};return a18_0x266d();}(function(_0x10d62c,_0x3c3b62){const _0x1842ca=a18_0x1fe8,_0x72a5d0=_0x10d62c();while(!![]){try{const _0x30de0c=-parseInt(_0x1842ca(0x17d))/0x1+parseInt(_0x1842ca(0x183))/0x2+parseInt(_0x1842ca(0x17a))/0x3*(-parseInt(_0x1842ca(0x187))/0x4)+parseInt(_0x1842ca(0x18c))/0x5*(-parseInt(_0x1842ca(0x17f))/0x6)+parseInt(_0x1842ca(0x182))/0x7+parseInt(_0x1842ca(0x188))/0x8+parseInt(_0x1842ca(0x17c))/0x9;if(_0x30de0c===_0x3c3b62)break;else _0x72a5d0['push'](_0x72a5d0['shift']());}catch(_0x7a0569){_0x72a5d0['push'](_0x72a5d0['shift']());}}}(a18_0x266d,0x4751d));import{getMultiAppConfigs}from'../../utils/config.js';function a18_0x1fe8(_0x2e87a4,_0x3a9ca5){_0x2e87a4=_0x2e87a4-0x17a;const _0x266dfe=a18_0x266d();let _0x1fe80e=_0x266dfe[_0x2e87a4];return _0x1fe80e;}import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x1f7713,_0x2c3a10){const _0x3e61b6=a18_0x1fe8;if(_0x2c3a10)return null;const _0x240b3f=_0x1f7713[_0x3e61b6(0x17e)]('global')?_0x3e61b6(0x18a):_0x3e61b6(0x189);let _0x355655=getMultiAppConfigs(_0x240b3f);if(!_0x355655||_0x355655[_0x3e61b6(0x17b)]===0x0)return null;if(_0x1f7713[_0x3e61b6(0x184)]){const _0x4a8270=_0x355655[_0x3e61b6(0x18d)](_0x238771=>_0x238771[_0x3e61b6(0x186)]===_0x1f7713[_0x3e61b6(0x184)]);if(_0x4a8270[_0x3e61b6(0x17b)]===0x0){const _0x30ca9c=_0x355655[_0x3e61b6(0x18b)](_0x5a621d=>_0x5a621d[_0x3e61b6(0x186)])[_0x3e61b6(0x185)](',\x20');throw CliErrors[_0x3e61b6(0x180)]('App\x20\x22'+_0x1f7713[_0x3e61b6(0x184)]+_0x3e61b6(0x181)+_0x30ca9c);}_0x355655=_0x4a8270;}return _0x355655;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8b1678,_0x1a5c15){const _0x351ee9=a19_0x2312,_0x1a81d6=_0x8b1678();while(!![]){try{const _0x27c270=-parseInt(_0x351ee9(0x185))/0x1+parseInt(_0x351ee9(0x183))/0x2+-parseInt(_0x351ee9(0x186))/0x3*(parseInt(_0x351ee9(0x17e))/0x4)+-parseInt(_0x351ee9(0x187))/0x5+parseInt(_0x351ee9(0x181))/0x6*(-parseInt(_0x351ee9(0x182))/0x7)+parseInt(_0x351ee9(0x184))/0x8+parseInt(_0x351ee9(0x180))/0x9*(parseInt(_0x351ee9(0x17f))/0xa);if(_0x27c270===_0x1a5c15)break;else _0x1a81d6['push'](_0x1a81d6['shift']());}catch(_0x59cb05){_0x1a81d6['push'](_0x1a81d6['shift']());}}}(a19_0x34bc,0xc81c3));function a19_0x34bc(){const _0x52257b=['833992jFzMqH','431012dOfomw','2841198WVFslB','6082785ymjrao','4yKvNiz','16370zMpayy','17127lEcwFW','84LwLfil','234731BZFWcM','1328576UiniJn'];a19_0x34bc=function(){return _0x52257b;};return a19_0x34bc();}function a19_0x2312(_0x5a52fd,_0x2f262b){_0x5a52fd=_0x5a52fd-0x17e;const _0x34bc90=a19_0x34bc();let _0x231217=_0x34bc90[_0x5a52fd];return _0x231217;}import{appListDefinition}from'../../commands/app/list.js';import{appMembersListDefinition}from'../../commands/app/members-list.js';export const appDefinitions=[appListDefinition,appMembersListDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x4dd5ee=a20_0xf317;(function(_0x58df5d,_0x465fab){const _0xf20fa7=a20_0xf317,_0x20d09e=_0x58df5d();while(!![]){try{const _0x58e7e9=parseInt(_0xf20fa7(0xe0))/0x1*(parseInt(_0xf20fa7(0xdb))/0x2)+-parseInt(_0xf20fa7(0xd0))/0x3*(parseInt(_0xf20fa7(0xf4))/0x4)+-parseInt(_0xf20fa7(0xed))/0x5+-parseInt(_0xf20fa7(0xec))/0x6+-parseInt(_0xf20fa7(0xd7))/0x7+parseInt(_0xf20fa7(0xcf))/0x8*(-parseInt(_0xf20fa7(0xef))/0x9)+parseInt(_0xf20fa7(0xf1))/0xa;if(_0x58e7e9===_0x465fab)break;else _0x20d09e['push'](_0x20d09e['shift']());}catch(_0x36e5f7){_0x20d09e['push'](_0x20d09e['shift']());}}}(a20_0x4078,0xb13e9));import{readRawConfigWithLayers}from'../../context.js';function a20_0xf317(_0x8933,_0x211cbf){_0x8933=_0x8933-0xca;const _0x40783a=a20_0x4078();let _0xf317b0=_0x40783a[_0x8933];return _0xf317b0;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x4c45fe,_0x20f7b0){const _0x16c08b=a20_0xf317,_0x44ce4a=[],_0x34d85d=_0x4c45fe['apps']&&typeof _0x4c45fe[_0x16c08b(0xd2)]===_0x16c08b(0xe5)?_0x4c45fe['apps']:{},_0x4a1919=_0x4c45fe['defaultApp']||undefined,_0x503f39=_0x4a1919??(Object['keys'](_0x34d85d)[_0x16c08b(0xe4)]===0x1?Object[_0x16c08b(0xe3)](_0x34d85d)[0x0]:undefined);for(const [_0x129ef8,_0x57a9ca]of Object[_0x16c08b(0xd8)](_0x34d85d)){if(!_0x57a9ca||typeof _0x57a9ca!==_0x16c08b(0xe5)||!_0x57a9ca[_0x16c08b(0xea)])continue;_0x44ce4a['push']({'name':_0x129ef8,'appcode':_0x57a9ca[_0x16c08b(0xea)],'named':!![],'definedIn':_0x20f7b0,'isDefault':_0x129ef8===_0x503f39,...buildAppProfileListFields(_0x57a9ca)});}return _0x44ce4a;}function buildMergedItems(_0x142579,_0x5e84bb){const _0x2976b1=a20_0xf317,{apps:apps={}}=_0x142579,_0x5b3061=_0x142579[_0x2976b1(0xdc)],_0x356284=_0x5b3061??(Object['keys'](apps)[_0x2976b1(0xe4)]===0x1?Object[_0x2976b1(0xe3)](apps)[0x0]:undefined),_0x1dca12=_0x5e84bb['globalConfig']['apps']&&typeof _0x5e84bb[_0x2976b1(0xe7)]['apps']==='object'?_0x5e84bb[_0x2976b1(0xe7)][_0x2976b1(0xd2)]:{},_0x291548=_0x5e84bb[_0x2976b1(0xe8)][_0x2976b1(0xd2)]&&typeof _0x5e84bb['projectConfig']['apps']===_0x2976b1(0xe5)?_0x5e84bb[_0x2976b1(0xe8)][_0x2976b1(0xd2)]:{},_0x5d2415=Object[_0x2976b1(0xd8)](apps),_0x23d86a=_0x5d2415['map'](([_0x3f3cf7,_0x480aaf])=>({'name':_0x3f3cf7,'appcode':_0x480aaf[_0x2976b1(0xea)],'named':!![],'definedIn':appDefinedIn(_0x3f3cf7,_0x1dca12,_0x291548),'isDefault':_0x3f3cf7===_0x356284,...buildAppProfileListFields(_0x480aaf)}));return _0x23d86a;}function validateAppListFlags(_0x2e20fc){const _0x1c2ec7=a20_0xf317;if(!_0x2e20fc[_0x1c2ec7(0xe2)](_0x1c2ec7(0xda)))return;if(!_0x2e20fc[_0x1c2ec7(0xe2)](_0x1c2ec7(0xcb))&&!_0x2e20fc['bool'](_0x1c2ec7(0xd9)))return;throw CliErrors[_0x1c2ec7(0xd4)](_0x1c2ec7(0xca),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x38bdf9){const _0x23a0d1=a20_0xf317;validateAppListFlags(_0x38bdf9);if(_0x38bdf9['bool'](_0x23a0d1(0xda)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x38bdf9)};const _0x438ea9=_0x38bdf9[_0x23a0d1(0xe2)](_0x23a0d1(0xcb)),_0x13a721=_0x38bdf9[_0x23a0d1(0xe2)](_0x23a0d1(0xd9)),_0x3de203=_0x438ea9?_0x23a0d1(0xcb):_0x13a721?_0x23a0d1(0xd9):_0x23a0d1(0xd6),{config:_0x1d34d7,layers:_0x5b8769}=readRawConfigWithLayers(),_0x20ec51=resolveDefaultAppSource(_0x5b8769),{defaultApp:_0xd71d86}=_0x1d34d7;let _0x81efc2,_0x4f6c77;switch(_0x3de203){case'global':_0x81efc2=buildItemsFromLayer(_0x5b8769[_0x23a0d1(0xe7)],_0x23a0d1(0xcb)),_0x4f6c77=_0x5b8769['globalPath'];break;case'project':_0x81efc2=buildItemsFromLayer(_0x5b8769[_0x23a0d1(0xe8)],_0x23a0d1(0xd9)),_0x4f6c77=_0x5b8769[_0x23a0d1(0xdf)];break;default:_0x81efc2=buildMergedItems(_0x1d34d7,_0x5b8769);break;}enrichAppListItemsWithMergedSelection(_0x81efc2,_0x38bdf9[_0x23a0d1(0xf3)]);if(_0x81efc2['length']===0x0){const _0x4da054=_0x3de203==='merged'?'':_0x23a0d1(0xd3)+_0x3de203+_0x23a0d1(0xde);return{'ok':!![],'data':[],'message':_0x23a0d1(0xe6)+_0x4da054+_0x23a0d1(0xce)+CLI_BIN_NAME+_0x23a0d1(0xeb)};}const _0x370fb0=_0x81efc2[_0x23a0d1(0xf0)](_0x44e198=>_0x44e198[_0x23a0d1(0xcc)]===!![]),_0x3c823c=_0xd71d86??_0x370fb0?.['name']??null,_0x264dd5=_0x3de203==='merged'?{'globalPath':_0x5b8769[_0x23a0d1(0xcd)]??null,'projectPath':_0x5b8769[_0x23a0d1(0xdf)]??null,'defaultApp':_0x3c823c,'defaultAppSource':_0xd71d86!=null?_0x20ec51:null}:{'scope':_0x3de203,'configPath':_0x4f6c77??null};return{'ok':!![],'data':{'items':_0x81efc2,'meta':_0x264dd5}};}function a20_0x4078(){const _0x32cbca=['.\x20Use\x20`','1392PoYWhM','9JhxJja','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','apps','\x20in\x20','validation','read','merged','3285646AVHcHy','entries','project','remote','2605826YAYGZK','defaultApp','optional','\x20config','projectPath','1GFuAnW','app','bool','keys','length','object','No\x20apps\x20configured','globalConfig','projectConfig','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','appcode','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','2155626QERUPJ','476870eFcEuo','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','42921wBkrEf','find','21972900swpuCj','boolean','mergedCli','1360508xONWlg','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','global','isCurrent','globalPath'];a20_0x4078=function(){return _0x32cbca;};return a20_0x4078();}export const appListDefinition={'service':a20_0x4dd5ee(0xe1),'command':'list','description':a20_0x4dd5ee(0xd1),'risk':a20_0x4dd5ee(0xd5),'auth':a20_0x4dd5ee(0xdd),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a20_0x4dd5ee(0xda),'type':a20_0x4dd5ee(0xf2),'description':'List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','default':![]},{'name':a20_0x4dd5ee(0xcb),'type':a20_0x4dd5ee(0xf2),'description':a20_0x4dd5ee(0xee),'default':![]},{'name':a20_0x4dd5ee(0xd9),'type':a20_0x4dd5ee(0xf2),'description':a20_0x4dd5ee(0xe9),'default':![]}],async 'validate'(_0x18eec4){validateAppListFlags(_0x18eec4);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x4a99c9=a21_0x2b5b;function a21_0x5b75(){const _0x50d762=['Found\x20','6TTvzBC','members-list','184PDtvJE','1816903FvKLYS','\x20application\x20member(s)','6135GkeSVA','5452vXyePw','app','read','List\x20application\x20members\x20with\x20their\x20role\x20memberships','18571810Cdtpxa','length','appCode','74GjPTtD','5613874wQzFdd','2480841AupBMN','131151Fbqcnq','30726MtreDC'];a21_0x5b75=function(){return _0x50d762;};return a21_0x5b75();}(function(_0x249dea,_0x129c4b){const _0x3bc06a=a21_0x2b5b,_0x54ae4e=_0x249dea();while(!![]){try{const _0x5ed7a0=parseInt(_0x3bc06a(0x126))/0x1+-parseInt(_0x3bc06a(0x11d))/0x2*(parseInt(_0x3bc06a(0x120))/0x3)+parseInt(_0x3bc06a(0x116))/0x4*(parseInt(_0x3bc06a(0x115))/0x5)+parseInt(_0x3bc06a(0x123))/0x6*(parseInt(_0x3bc06a(0x11e))/0x7)+parseInt(_0x3bc06a(0x125))/0x8*(-parseInt(_0x3bc06a(0x121))/0x9)+-parseInt(_0x3bc06a(0x11a))/0xa+parseInt(_0x3bc06a(0x11f))/0xb;if(_0x5ed7a0===_0x129c4b)break;else _0x54ae4e['push'](_0x54ae4e['shift']());}catch(_0x53f999){_0x54ae4e['push'](_0x54ae4e['shift']());}}}(a21_0x5b75,0xeb401));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a21_0x2b5b(_0x33112d,_0x10b5e9){_0x33112d=_0x33112d-0x114;const _0x5b7572=a21_0x5b75();let _0x2b5b8d=_0x5b7572[_0x33112d];return _0x2b5b8d;}export const appMembersListDefinition={'service':a21_0x4a99c9(0x117),'command':a21_0x4a99c9(0x124),'description':a21_0x4a99c9(0x119),'risk':a21_0x4a99c9(0x118),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x49b0ea){const _0x495efb=a21_0x4a99c9,_0x3e16a9=projectAppMembers(await listRoleUsers(_0x49b0ea[_0x495efb(0x11c)]));return{'ok':!![],'data':{'appCode':_0x49b0ea['appCode'],'items':_0x3e16a9,'totalCount':_0x3e16a9[_0x495efb(0x11b)]},'message':_0x495efb(0x122)+_0x3e16a9[_0x495efb(0x11b)]+_0x495efb(0x114)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x437a32,_0xf585aa){const _0x38454b=a22_0x2866,_0xe92b80=_0x437a32();while(!![]){try{const _0x111ace=parseInt(_0x38454b(0x129))/0x1+-parseInt(_0x38454b(0x12d))/0x2*(-parseInt(_0x38454b(0x128))/0x3)+parseInt(_0x38454b(0x120))/0x4+-parseInt(_0x38454b(0x131))/0x5*(-parseInt(_0x38454b(0x12f))/0x6)+-parseInt(_0x38454b(0x12e))/0x7*(-parseInt(_0x38454b(0x122))/0x8)+-parseInt(_0x38454b(0x12a))/0x9+parseInt(_0x38454b(0x12b))/0xa*(-parseInt(_0x38454b(0x124))/0xb);if(_0x111ace===_0xf585aa)break;else _0xe92b80['push'](_0xe92b80['shift']());}catch(_0x3ffbd8){_0xe92b80['push'](_0xe92b80['shift']());}}}(a22_0xb72a,0x36d14));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';function a22_0x2866(_0x328d76,_0x12a6bc){_0x328d76=_0x328d76-0x120;const _0xb72a5f=a22_0xb72a();let _0x2866f9=_0xb72a5f[_0x328d76];return _0x2866f9;}import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a22_0xb72a(){const _0xea60fb=['140030OSTRXE','map','76716ngicDm','161oWOJtV','2826nKEYaj','appName','1415NBmqcw','1706224EykobI','appDesc','95240dufzUg','cookie','253QSxUVj','authRequired','appCode','platform','9WwxeIh','9856VmDjBt','3707937oPkKHN'];a22_0xb72a=function(){return _0xea60fb;};return a22_0xb72a();}function resolveCookie(_0x337c09){const _0x4a6b0e=a22_0x2866,_0x2ac079=_0x337c09[_0x4a6b0e(0x123)]||getCookie();if(!_0x2ac079)throw CliErrors[_0x4a6b0e(0x125)]();return _0x2ac079;}export async function listRemoteAppDirectory(_0x4532ce){const _0x3cfd3d=a22_0x2866,_0x55ae32=await withActiveCookie(resolveCookie(_0x4532ce),()=>listRemoteApps());return{'items':_0x55ae32[_0x3cfd3d(0x12c)](_0x42c9e3=>({..._0x42c9e3['id']!=null?{'id':_0x42c9e3['id']}:{},'appCode':_0x42c9e3[_0x3cfd3d(0x126)],'appName':_0x42c9e3[_0x3cfd3d(0x130)],..._0x42c9e3[_0x3cfd3d(0x121)]!=null?{'appDesc':_0x42c9e3[_0x3cfd3d(0x121)]}:{}})),'meta':{'source':_0x3cfd3d(0x127)}};}
|
|
@@ -9,6 +9,7 @@ import type { MergedCliSnapshot } from "../../framework/types.js";
|
|
|
9
9
|
export type AppMembershipStatus = "ACTIVE" | "PENDING";
|
|
10
10
|
export interface AppMemberRoleProjection {
|
|
11
11
|
roleId: number;
|
|
12
|
+
roleCode: string;
|
|
12
13
|
roleName: string | null;
|
|
13
14
|
roleType: string | null;
|
|
14
15
|
membershipStatus: AppMembershipStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a23_0x2921(_0x39af8b,_0x1e27d3){_0x39af8b=_0x39af8b-0x66;const _0x688aec=a23_0x688a();let _0x29210b=_0x688aec[_0x39af8b];return _0x29210b;}(function(_0x53ca55,_0x2d344d){const _0x3088f3=a23_0x2921,_0x8c8a6f=_0x53ca55();while(!![]){try{const _0x304317=-parseInt(_0x3088f3(0x7f))/0x1*(parseInt(_0x3088f3(0x75))/0x2)+parseInt(_0x3088f3(0x6b))/0x3+-parseInt(_0x3088f3(0x81))/0x4*(parseInt(_0x3088f3(0x86))/0x5)+parseInt(_0x3088f3(0x79))/0x6*(-parseInt(_0x3088f3(0x8d))/0x7)+-parseInt(_0x3088f3(0x90))/0x8*(parseInt(_0x3088f3(0x94))/0x9)+parseInt(_0x3088f3(0x71))/0xa*(-parseInt(_0x3088f3(0x6c))/0xb)+parseInt(_0x3088f3(0x8c))/0xc*(parseInt(_0x3088f3(0x69))/0xd);if(_0x304317===_0x2d344d)break;else _0x8c8a6f['push'](_0x8c8a6f['shift']());}catch(_0x3dff4a){_0x8c8a6f['push'](_0x8c8a6f['shift']());}}}(a23_0x688a,0xb9e03));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x5d5885){const _0x4bcd78=a23_0x2921,_0x4a498b=_0x5d5885?.[_0x4bcd78(0x91)]();return _0x4a498b?_0x4a498b:null;}export function projectAppMembers(_0x4c39a2){const _0x14916f=a23_0x2921,_0x30e7cb=new Map(),_0x38aea3=[..._0x4c39a2][_0x14916f(0x7d)]((_0x1a3b45,_0x274ded)=>_0x1a3b45['id']-_0x274ded['id']),_0x1aa588=(_0x48172d,_0xbfa98a,_0x3713ef)=>{const _0x179a73=_0x14916f;for(const _0x2b5ade of _0xbfa98a){const _0x5d2d82=Number(_0x2b5ade[_0x179a73(0x6a)]);if(!Number[_0x179a73(0x8e)](_0x5d2d82)||_0x5d2d82<=0x0)continue;let _0x4600cb=_0x30e7cb['get'](_0x5d2d82);if(!_0x4600cb)_0x4600cb={'userId':_0x5d2d82,'username':nullableText(_0x2b5ade[_0x179a73(0x66)]),'displayName':nullableText(_0x2b5ade[_0x179a73(0x83)]),'status':_0x3713ef,'roles':[],'roleKeys':new Set()},_0x30e7cb[_0x179a73(0x8f)](_0x5d2d82,_0x4600cb);else{_0x4600cb[_0x179a73(0x66)]??=nullableText(_0x2b5ade[_0x179a73(0x66)]),_0x4600cb[_0x179a73(0x6d)]??=nullableText(_0x2b5ade[_0x179a73(0x83)]);if(_0x3713ef==='ACTIVE')_0x4600cb[_0x179a73(0x78)]=_0x179a73(0x99);}const _0x128a7c=_0x48172d['id']+':'+_0x3713ef;if(_0x4600cb[_0x179a73(0x8a)][_0x179a73(0x73)](_0x128a7c))continue;_0x4600cb[_0x179a73(0x8a)][_0x179a73(0x85)](_0x128a7c),_0x4600cb['roles'][_0x179a73(0x87)]({'roleId':_0x48172d['id'],'roleCode':_0x48172d['roleCode'],'roleName':nullableText(_0x48172d[_0x179a73(0x74)]),'roleType':nullableText(_0x48172d[_0x179a73(0x68)]),'membershipStatus':_0x3713ef});}};for(const _0x2d02ad of _0x38aea3){_0x1aa588(_0x2d02ad,_0x2d02ad[_0x14916f(0x67)]??[],_0x14916f(0x99)),_0x1aa588(_0x2d02ad,_0x2d02ad[_0x14916f(0x7b)]??[],_0x14916f(0x84));}return[..._0x30e7cb[_0x14916f(0x88)]()][_0x14916f(0x96)](_0x479237=>({'userId':_0x479237[_0x14916f(0x6a)],'username':_0x479237[_0x14916f(0x66)],'displayName':_0x479237[_0x14916f(0x6d)],'status':_0x479237[_0x14916f(0x78)],'roles':_0x479237['roles']['sort']((_0x17345b,_0x44758a)=>_0x17345b[_0x14916f(0x82)]-_0x44758a['roleId']||(_0x17345b[_0x14916f(0x97)]===_0x44758a[_0x14916f(0x97)]?0x0:_0x17345b[_0x14916f(0x97)]===_0x14916f(0x99)?-0x1:0x1))}))[_0x14916f(0x7d)]((_0x3011d1,_0x435e09)=>_0x3011d1[_0x14916f(0x6a)]-_0x435e09[_0x14916f(0x6a)]);}export function enrichAppListItemsWithMergedSelection(_0x213a2d,_0xd814af){const _0x4682a0=a23_0x2921;if(!_0xd814af)return;const _0x2927ef=_0xd814af[_0x4682a0(0x92)]&&typeof _0xd814af[_0x4682a0(0x92)]==='object'?_0xd814af['apps']:{},_0xdbd369=Object[_0x4682a0(0x7a)](_0x2927ef)['length']>0x0;for(const _0x4003a1 of _0x213a2d){_0x4003a1[_0x4682a0(0x72)]=![];}const _0x28f2dc=_0xd814af[_0x4682a0(0x6f)]!=null?String(_0xd814af[_0x4682a0(0x6f)])[_0x4682a0(0x91)]():'';if(_0xdbd369){const _0x3a9880=_0xd814af[_0x4682a0(0x80)]??_0xd814af['defaultApp'];if(_0x3a9880)for(const _0x56cdd7 of _0x213a2d){_0x56cdd7['named']===!![]&&_0x56cdd7['name']===_0x3a9880&&(_0x56cdd7[_0x4682a0(0x72)]=!![]);}for(const _0x586fe7 of _0x213a2d){if(_0x586fe7[_0x4682a0(0x7e)]!==![])continue;if(_0xd814af[_0x4682a0(0x6e)])continue;_0x28f2dc&&String(_0x586fe7['appcode']??'')['trim']()===_0x28f2dc&&(_0x586fe7[_0x4682a0(0x72)]=!![]);}return;}if(!_0x28f2dc)return;for(const _0x9bc437 of _0x213a2d){String(_0x9bc437['appcode']??'')[_0x4682a0(0x91)]()===_0x28f2dc&&(_0x9bc437[_0x4682a0(0x72)]=!![]);}}export function resolveAppScopeForWrite(_0x5e90d6,_0x35d1fe,_0x5a1adf){const _0x43def5=a23_0x2921;if(_0x35d1fe)return _0x43def5(0x7c);const _0xafc66a=_0x5a1adf[_0x43def5(0x98)][_0x43def5(0x92)]&&typeof _0x5a1adf[_0x43def5(0x98)]['apps']===_0x43def5(0x95)?_0x5a1adf[_0x43def5(0x98)][_0x43def5(0x92)]:{},_0x7e3808=_0x5a1adf[_0x43def5(0x77)]['apps']&&typeof _0x5a1adf['globalConfig']['apps']==='object'?_0x5a1adf[_0x43def5(0x77)][_0x43def5(0x92)]:{};if(Object['prototype']['hasOwnProperty'][_0x43def5(0x93)](_0xafc66a,_0x5e90d6))return _0x43def5(0x76);if(Object['prototype']['hasOwnProperty'][_0x43def5(0x93)](_0x7e3808,_0x5e90d6))return _0x43def5(0x7c);return _0x43def5(0x76);}export function appDefinedIn(_0x319f17,_0x5d7fb8,_0x2a8405){const _0xeb7d7c=a23_0x2921,_0x4446fc=Object[_0xeb7d7c(0x89)][_0xeb7d7c(0x8b)][_0xeb7d7c(0x93)](_0x5d7fb8,_0x319f17),_0x169c7a=Object[_0xeb7d7c(0x89)]['hasOwnProperty'][_0xeb7d7c(0x93)](_0x2a8405,_0x319f17);if(_0x4446fc&&_0x169c7a)return'both';if(_0x169c7a)return _0xeb7d7c(0x76);return _0xeb7d7c(0x7c);}export function resolveDefaultAppSource(_0x5bdbc3){const _0x3b3e15=a23_0x2921,_0x56f6f5=_0x5bdbc3['projectConfig'][_0x3b3e15(0x92)]&&typeof _0x5bdbc3[_0x3b3e15(0x98)][_0x3b3e15(0x92)]===_0x3b3e15(0x95)?_0x5bdbc3['projectConfig'][_0x3b3e15(0x92)]:{};if(_0x3b3e15(0x6e)in _0x5bdbc3[_0x3b3e15(0x98)])return'project';if(Object['keys'](_0x56f6f5)[_0x3b3e15(0x70)]>0x0)return _0x3b3e15(0x76);if(Object[_0x3b3e15(0x7a)](_0x5bdbc3['projectConfig'])['length']===0x0&&_0x5bdbc3[_0x3b3e15(0x77)][_0x3b3e15(0x6e)])return _0x3b3e15(0x7c);return null;}function a23_0x688a(){const _0x5bbfa3=['5ruJmWl','push','values','prototype','roleKeys','hasOwnProperty','12vsNAAG','303324LlKkZS','isFinite','set','2494776AuSBmm','trim','apps','call','27hLVgUR','object','map','membershipStatus','projectConfig','ACTIVE','username','userList','roleType','49235927ErjycU','userId','3092349KdZEQz','1513061kZKyFF','displayName','defaultApp','appCode','length','110doWOTo','isCurrent','has','roleName','1886POERPw','project','globalConfig','status','24hRgGAt','keys','applyUserList','global','sort','named','161QdxHny','currentApp','5132248ahSzah','roleId','nickname','PENDING','add'];a23_0x688a=function(){return _0x5bbfa3;};return a23_0x688a();}export function getConfigPath(_0x288db9={}){const _0x5e551c=a23_0x2921,_0x3df2c8=_0x288db9['global']?_0x5e551c(0x7c):_0x5e551c(0x76);return resolveWriteConfigPath(_0x3df2c8);}export function readConfig(_0x32ff82={}){return readConfigFile(getConfigPath(_0x32ff82));}export function writeConfig(_0x9369dc,_0x5794d5={}){writeConfigFile(getConfigPath(_0x5794d5),_0x9369dc);}export function scopeLabel(_0x1c4e24){const _0x3e83d8=a23_0x2921;return _0x1c4e24[_0x3e83d8(0x7c)]?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x3ec6ca=a24_0x2c28;(function(_0x2e04be,_0x1fb37c){const _0x590e1d=a24_0x2c28,_0x108f9c=_0x2e04be();while(!![]){try{const _0x3657dd=-parseInt(_0x590e1d(0x16e))/0x1*(-parseInt(_0x590e1d(0x163))/0x2)+parseInt(_0x590e1d(0x164))/0x3+parseInt(_0x590e1d(0x15d))/0x4*(parseInt(_0x590e1d(0x170))/0x5)+parseInt(_0x590e1d(0x167))/0x6*(-parseInt(_0x590e1d(0x171))/0x7)+-parseInt(_0x590e1d(0x168))/0x8*(-parseInt(_0x590e1d(0x166))/0x9)+parseInt(_0x590e1d(0x15c))/0xa+-parseInt(_0x590e1d(0x15e))/0xb;if(_0x3657dd===_0x1fb37c)break;else _0x108f9c['push'](_0x108f9c['shift']());}catch(_0x234f66){_0x108f9c['push'](_0x108f9c['shift']());}}}(a24_0x1eb9,0x6c085));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a24_0x3ec6ca(0x172);export const appConfigDelete={'service':a24_0x3ec6ca(0x16a),'command':a24_0x3ec6ca(0x15b),'description':a24_0x3ec6ca(0x165),'risk':a24_0x3ec6ca(0x16b),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2971ef){readKeyArg(_0x2971ef);},async 'dryRun'(_0x3aebd7){const _0x177dea=a24_0x3ec6ca,_0x2aa3b5=readKeyArg(_0x3aebd7),_0x1f94d9=await mustGetByKey(_0x3aebd7[_0x177dea(0x16f)],_0x2aa3b5);return asAppConfigDryRunResult(buildMutationData({'operation':_0x177dea(0x15b),'appCode':_0x3aebd7[_0x177dea(0x16f)],'key':_0x2aa3b5,'before':projectAppConfig(_0x1f94d9),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x6732e6){const _0x39cbe3=a24_0x3ec6ca,_0x4b275c=readKeyArg(_0x6732e6),_0x1aa904=await mustGetByKey(_0x6732e6['appCode'],_0x4b275c);return await withAppConfigApiBoundary('delete',{'appCode':_0x6732e6['appCode'],'key':_0x4b275c},()=>deleteAppConfig({'appCode':_0x6732e6[_0x39cbe3(0x16f)],'id':requireAppConfigId(_0x1aa904,_0x4b275c,_0x6732e6[_0x39cbe3(0x16f)])})),{'ok':!![],'data':buildMutationData({'operation':_0x39cbe3(0x15b),'appCode':_0x6732e6['appCode'],'key':_0x4b275c,'before':projectAppConfig(_0x1aa904),'after':null,'dryRun':![]}),'message':_0x39cbe3(0x173)+_0x4b275c};}};function a24_0x2c28(_0x47b88f,_0x4d51a4){_0x47b88f=_0x47b88f-0x15a;const _0x1eb989=a24_0x1eb9();let _0x2c2888=_0x1eb989[_0x47b88f];return _0x2c2888;}async function mustGetByKey(_0x121c9e,_0x115289){const _0x1ed80b=a24_0x3ec6ca,_0x3756da=await withAppConfigApiBoundary(_0x1ed80b(0x174),{'appCode':_0x121c9e,'key':_0x115289},()=>getAppConfigByKey(_0x121c9e,_0x115289));if(!_0x3756da)throw CliErrors[_0x1ed80b(0x16d)](_0x1ed80b(0x15f)+_0x115289,_0x1ed80b(0x161)+_0x121c9e);return _0x3756da;}function requireAppConfigId(_0x23b506,_0x59c7a3,_0x179790){const _0x21e8e6=a24_0x3ec6ca;if(typeof _0x23b506['id']===_0x21e8e6(0x162)&&Number[_0x21e8e6(0x15a)](_0x23b506['id'])&&_0x23b506['id']>0x0)return _0x23b506['id'];throw CliErrors[_0x21e8e6(0x160)](_0x21e8e6(0x169)+_0x59c7a3+_0x21e8e6(0x16c)+_0x179790);}function a24_0x1eb9(){const _0x307b6f=['number','110GXBbAA','1745625qQWdTs','Delete\x20one\x20runtime\x20app-config\x20key','126JXhyXl','1698KLwmBD','288392FqVhWA','App\x20config\x20server\x20id\x20missing\x20for\x20key=','app-config','high-risk-write',',\x20appCode=','validation','15107PjTOcV','appCode','125640XqjLnr','13930XtZLoz','/smartapi/app-config/delete','Deleted\x20app\x20config\x20','get','isFinite','delete','2458930onZsMu','4xVrXln','13010756aWBDxl','App\x20config\x20key\x20not\x20found:\x20','apiError','appCode:\x20'];a24_0x1eb9=function(){return _0x307b6f;};return a24_0x1eb9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x1956d0=a25_0xee5b;(function(_0x4e8f59,_0x2df467){const _0x542f86=a25_0xee5b,_0x2c078e=_0x4e8f59();while(!![]){try{const _0x249527=parseInt(_0x542f86(0x99))/0x1+-parseInt(_0x542f86(0xa8))/0x2*(parseInt(_0x542f86(0x9a))/0x3)+parseInt(_0x542f86(0x9b))/0x4+-parseInt(_0x542f86(0x9f))/0x5+-parseInt(_0x542f86(0x9e))/0x6+parseInt(_0x542f86(0x9c))/0x7+parseInt(_0x542f86(0xa9))/0x8;if(_0x249527===_0x2df467)break;else _0x2c078e['push'](_0x2c078e['shift']());}catch(_0x536496){_0x2c078e['push'](_0x2c078e['shift']());}}}(a25_0x5a37,0x62e44));function a25_0xee5b(_0x191f97,_0xf70689){_0x191f97=_0x191f97-0x99;const _0x5a37a3=a25_0x5a37();let _0xee5b7b=_0x5a37a3[_0x191f97];return _0xee5b7b;}import{getAppConfigByKey}from'../../core/api-client.js';function a25_0x5a37(){const _0x2ad0bf=['bool','appCode','Loaded\x20app\x20config\x20','7584wfaqLV','7336336jfCtjc','appCode:\x20','\x20with\x20value\x20revealed','App\x20config\x20key\x20not\x20found:\x20','6090EMtRuE','435ysuoxi','651604MMWnWA','5073138ukMAhA','app-config','722286UlSZMv','3677430oJkRdC','validation','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','\x20with\x20value\x20redacted','reveal','get'];a25_0x5a37=function(){return _0x2ad0bf;};return a25_0x5a37();}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_0x1956d0(0x9d),'command':a25_0x1956d0(0xa4),'description':a25_0x1956d0(0xa1),'risk':'read','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x15d04c){readKeyArg(_0x15d04c);},async 'execute'(_0x59d19a){const _0x4755bb=a25_0x1956d0,_0x43b590=readKeyArg(_0x59d19a),_0x17fbbc=await withAppConfigApiBoundary(_0x4755bb(0xa4),{'appCode':_0x59d19a['appCode'],'key':_0x43b590},()=>getAppConfigByKey(_0x59d19a[_0x4755bb(0xa6)],_0x43b590));if(!_0x17fbbc)throw CliErrors[_0x4755bb(0xa0)](_0x4755bb(0xac)+_0x43b590,_0x4755bb(0xaa)+_0x59d19a['appCode']);const _0x2f98fe=projectAppConfig(_0x17fbbc,{'reveal':_0x59d19a[_0x4755bb(0xa5)]('reveal')});return{'ok':!![],'data':{'config':_0x2f98fe},'message':_0x59d19a[_0x4755bb(0xa5)](_0x4755bb(0xa3))?_0x4755bb(0xa7)+_0x43b590+_0x4755bb(0xab):'Loaded\x20app\x20config\x20'+_0x43b590+_0x4755bb(0xa2)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a26_0x4e02(){const _0x2d4929=['12bAPtrN','688jSJSmn','3bMenfr','9003621GwOKVs','469275VBAbAV','488046GBygcH','4697520oDJJNJ','18KIEovk','21123xuFdrP','1150758nBmPbp','853682QAfflE'];a26_0x4e02=function(){return _0x2d4929;};return a26_0x4e02();}function a26_0x2386(_0x17eb34,_0x173eaa){_0x17eb34=_0x17eb34-0x16a;const _0x4e0236=a26_0x4e02();let _0x238605=_0x4e0236[_0x17eb34];return _0x238605;}(function(_0x15b96e,_0x19cb79){const _0x3f65bf=a26_0x2386,_0x158782=_0x15b96e();while(!![]){try{const _0x88ac3=-parseInt(_0x3f65bf(0x171))/0x1+-parseInt(_0x3f65bf(0x16b))/0x2*(-parseInt(_0x3f65bf(0x16e))/0x3)+-parseInt(_0x3f65bf(0x16c))/0x4*(parseInt(_0x3f65bf(0x170))/0x5)+parseInt(_0x3f65bf(0x173))/0x6*(-parseInt(_0x3f65bf(0x16a))/0x7)+parseInt(_0x3f65bf(0x16d))/0x8*(-parseInt(_0x3f65bf(0x174))/0x9)+parseInt(_0x3f65bf(0x172))/0xa+parseInt(_0x3f65bf(0x16f))/0xb;if(_0x88ac3===_0x19cb79)break;else _0x158782['push'](_0x158782['shift']());}catch(_0x1b172f){_0x158782['push'](_0x158782['shift']());}}}(a26_0x4e02,0x3d265));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x7621(){const _0x31cb53=['read','3494EhpfSC','list','trim','367mPMayL','3JXXmLH','5326881CeETrx','1474rYnYuN','10AMuZbQ','6PBRsxJ','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','length','5888130gPJnXv','108963uSVGKw','string','key','map','app-config','Filter\x20by\x20exact\x20config\x20key','1140664NwhJys','appCode','184896GvyQGt','5167068QhYzTl'];a27_0x7621=function(){return _0x31cb53;};return a27_0x7621();}const a27_0x1ca224=a27_0x4ee5;(function(_0x14f838,_0x3230b3){const _0x19ad99=a27_0x4ee5,_0x37b6dc=_0x14f838();while(!![]){try{const _0x21d79b=-parseInt(_0x19ad99(0x1c0))/0x1*(parseInt(_0x19ad99(0x1bd))/0x2)+-parseInt(_0x19ad99(0x1c1))/0x3*(-parseInt(_0x19ad99(0x1d2))/0x4)+-parseInt(_0x19ad99(0x1c8))/0x5+-parseInt(_0x19ad99(0x1c5))/0x6*(parseInt(_0x19ad99(0x1c2))/0x7)+-parseInt(_0x19ad99(0x1cf))/0x8+-parseInt(_0x19ad99(0x1c9))/0x9*(-parseInt(_0x19ad99(0x1c4))/0xa)+parseInt(_0x19ad99(0x1c3))/0xb*(parseInt(_0x19ad99(0x1d1))/0xc);if(_0x21d79b===_0x3230b3)break;else _0x37b6dc['push'](_0x37b6dc['shift']());}catch(_0x2555c6){_0x37b6dc['push'](_0x37b6dc['shift']());}}}(a27_0x7621,0x9dc3d));import{listAppConfigs}from'../../core/api-client.js';function a27_0x4ee5(_0x27da3d,_0x5f2efd){_0x27da3d=_0x27da3d-0x1bd;const _0x7621f=a27_0x7621();let _0x4ee532=_0x7621f[_0x27da3d];return _0x4ee532;}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':a27_0x1ca224(0x1cd),'command':a27_0x1ca224(0x1be),'description':a27_0x1ca224(0x1c6),'risk':a27_0x1ca224(0x1d3),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a27_0x1ca224(0x1cb),'type':a27_0x1ca224(0x1ca),'description':a27_0x1ca224(0x1ce)},TAGS_FLAG],async 'validate'(_0x242ea7){const _0x57f9b7=a27_0x1ca224,_0x577206=_0x242ea7['str'](_0x57f9b7(0x1cb))[_0x57f9b7(0x1bf)]();if(_0x577206)validateKey(_0x577206);readOptionalTags(_0x242ea7);},async 'execute'(_0x130f50){const _0x194290=a27_0x1ca224,_0x409861=_0x130f50['str'](_0x194290(0x1cb))[_0x194290(0x1bf)]()||undefined,_0x46f512=readOptionalTags(_0x130f50),_0x464df4=await withAppConfigApiBoundary(_0x194290(0x1be),{'appCode':_0x130f50[_0x194290(0x1d0)]},()=>listAppConfigs(_0x130f50[_0x194290(0x1d0)],{'key':_0x409861,'tags':_0x46f512})),_0x432397=_0x464df4[_0x194290(0x1cc)](_0x3b0609=>projectAppConfig(_0x3b0609));return{'ok':!![],'data':{'appCode':_0x130f50['appCode'],'count':_0x432397[_0x194290(0x1c7)],'configs':_0x432397},'message':'Found\x20'+_0x432397[_0x194290(0x1c7)]+'\x20app\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x291af9=a28_0x5c86;(function(_0x43bc11,_0x3d8e3b){const _0x2569c7=a28_0x5c86,_0x4bd33d=_0x43bc11();while(!![]){try{const _0x3ef9a4=parseInt(_0x2569c7(0x1b9))/0x1+-parseInt(_0x2569c7(0x1a1))/0x2+parseInt(_0x2569c7(0x1b4))/0x3+-parseInt(_0x2569c7(0x1a4))/0x4+-parseInt(_0x2569c7(0x1a7))/0x5*(-parseInt(_0x2569c7(0x1ba))/0x6)+parseInt(_0x2569c7(0x1a8))/0x7+parseInt(_0x2569c7(0x1b2))/0x8*(-parseInt(_0x2569c7(0x1af))/0x9);if(_0x3ef9a4===_0x3d8e3b)break;else _0x4bd33d['push'](_0x4bd33d['shift']());}catch(_0x552681){_0x4bd33d['push'](_0x4bd33d['shift']());}}}(a28_0x292a,0xa3b4b));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a28_0x292a(){const _0x18b3e6=['number','isFinite','Updated','string','827472yIUXjB','6jCxPax','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','2128050RAEesU',',\x20appCode=','get','2917016lVOTnU','App\x20config\x20server\x20id\x20missing\x20for\x20key=','apiError','2476735PEmiIk','8025416UtrhXD','update','write','tags','/smartapi/app-config/create','set','create','71388ETmXqv','app-config','appCode','152tgPvUJ','/smartapi/app-config/update','435657cPmiuX'];a28_0x292a=function(){return _0x18b3e6;};return a28_0x292a();}const CREATE_PATH=a28_0x291af9(0x1ac),UPDATE_PATH=a28_0x291af9(0x1b3);export const appConfigSet={'service':a28_0x291af9(0x1b0),'command':a28_0x291af9(0x1ad),'description':a28_0x291af9(0x1bb),'risk':a28_0x291af9(0x1aa),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':a28_0x291af9(0x1b8),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x187ff3){readKeyArg(_0x187ff3),readOptionalTags(_0x187ff3),assertSingleValueSource(_0x187ff3);},async 'dryRun'(_0x87b3fe){const _0x4bfe62=a28_0x291af9,_0x4b9a59=readKeyArg(_0x87b3fe),_0x1f72f4=readOptionalTags(_0x87b3fe),_0x1869bf=assertSingleValueSource(_0x87b3fe);await assertValueSourceReadable(_0x1869bf);const _0x5d4fca=await withAppConfigApiBoundary(_0x4bfe62(0x1a3),{'appCode':_0x87b3fe[_0x4bfe62(0x1b1)],'key':_0x4b9a59},()=>getAppConfigByKey(_0x87b3fe[_0x4bfe62(0x1b1)],_0x4b9a59)),_0xd85ff3=_0x5d4fca?'update':_0x4bfe62(0x1ae),_0xf3d731=_0x5d4fca?projectAppConfig(_0x5d4fca):null,_0x2e62c9=plannedAppConfig({'appCode':_0x87b3fe[_0x4bfe62(0x1b1)],'key':_0x4b9a59,'tags':_0x1f72f4??_0x5d4fca?.[_0x4bfe62(0x1ab)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xd85ff3,'appCode':_0x87b3fe[_0x4bfe62(0x1b1)],'key':_0x4b9a59,'before':_0xf3d731,'after':_0x2e62c9,'dryRun':!![]}),{'method':'POST','url':_0xd85ff3===_0x4bfe62(0x1a9)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x486d70){const _0x210904=a28_0x291af9,_0x537e68=readKeyArg(_0x486d70),_0x23027a=readOptionalTags(_0x486d70),_0xd654e9=await withAppConfigApiBoundary(_0x210904(0x1a3),{'appCode':_0x486d70[_0x210904(0x1b1)],'key':_0x537e68},()=>getAppConfigByKey(_0x486d70[_0x210904(0x1b1)],_0x537e68)),_0x39e3ba=_0xd654e9?projectAppConfig(_0xd654e9):null,_0x4d48cb=_0xd654e9?_0x210904(0x1a9):'create',{value:_0x20991d,warnings:_0x30cb5d}=await readAppConfigValue(_0x486d70),_0x5b4107={'appCode':_0x486d70[_0x210904(0x1b1)],'key':_0x537e68,'value':_0x20991d,'tags':_0x23027a??_0xd654e9?.[_0x210904(0x1ab)]??undefined};await withAppConfigApiBoundary(_0x4d48cb,{'appCode':_0x486d70[_0x210904(0x1b1)],'key':_0x537e68},async()=>{_0xd654e9?await updateAppConfig({..._0x5b4107,'id':requireAppConfigId(_0xd654e9,_0x537e68,_0x486d70['appCode'])}):await createAppConfig(_0x5b4107);});const _0x170960=await withAppConfigApiBoundary('get',{'appCode':_0x486d70[_0x210904(0x1b1)],'key':_0x537e68},()=>getAppConfigByKey(_0x486d70[_0x210904(0x1b1)],_0x537e68)),_0x2d8c21=_0x170960?projectAppConfig(_0x170960):plannedAppConfig({'appCode':_0x486d70[_0x210904(0x1b1)],'key':_0x537e68,'tags':_0x5b4107[_0x210904(0x1ab)],'hasValue':_0x20991d!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x4d48cb,'appCode':_0x486d70['appCode'],'key':_0x537e68,'before':_0x39e3ba,'after':_0x2d8c21,'dryRun':![],'warnings':_0x30cb5d}),'message':(_0x4d48cb==='update'?_0x210904(0x1b7):'Created')+'\x20app\x20config\x20'+_0x537e68};}};function a28_0x5c86(_0x37710a,_0x3fbf9a){_0x37710a=_0x37710a-0x1a1;const _0x292ab9=a28_0x292a();let _0x5c86b=_0x292ab9[_0x37710a];return _0x5c86b;}function requireAppConfigId(_0x37d675,_0x4739fb,_0xbb045a){const _0x1c19ac=a28_0x291af9;if(typeof _0x37d675['id']===_0x1c19ac(0x1b5)&&Number[_0x1c19ac(0x1b6)](_0x37d675['id'])&&_0x37d675['id']>0x0)return _0x37d675['id'];throw CliErrors[_0x1c19ac(0x1a6)](_0x1c19ac(0x1a5)+_0x4739fb+_0x1c19ac(0x1a2)+_0xbb045a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x57f825=a29_0x2fa5;function a29_0x4c7c(){const _0x318d4a=['3073105wqYReN','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','string','argument','31528AwfcmP','14UnRpIR','end','\x20app\x20config.','2864250wtcIJP','after','error','setEncoding','str','apiError','Runtime\x20app-config\x20key','file','url','join','key','valueRedacted','length','key:\x20','warnings','Missing\x20app-config\x20value\x20source.','name','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','args','16516220JnhVrj','6094104qpLNwX','trim','utf8','from-env','push','Read\x20config\x20value\x20from\x20stdin','stdin','kind','operation','tags','before','path','gmtModified','826344kUIQBo','gmtCreate','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','4jqXgjC','env','bool','Missing\x20app-config\x20key.','method','boolean','validation','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','once','value\x20is\x20redacted','value','defineProperties','appCode:\x20','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','flag','Failed\x20to\x20','1838990AUAvMC','3lGZOsI','appCode','Value\x20file\x20is\x20not\x20readable:\x20','reveal'];a29_0x4c7c=function(){return _0x318d4a;};return a29_0x4c7c();}(function(_0x4a9ce2,_0x2279f3){const _0x20dc3a=a29_0x2fa5,_0x29c9a3=_0x4a9ce2();while(!![]){try{const _0x248d62=-parseInt(_0x20dc3a(0x130))/0x1+-parseInt(_0x20dc3a(0x127))/0x2*(parseInt(_0x20dc3a(0x128))/0x3)+parseInt(_0x20dc3a(0x117))/0x4*(-parseInt(_0x20dc3a(0x12c))/0x5)+parseInt(_0x20dc3a(0x105))/0x6+parseInt(_0x20dc3a(0x131))/0x7*(-parseInt(_0x20dc3a(0x112))/0x8)+-parseInt(_0x20dc3a(0x134))/0x9+parseInt(_0x20dc3a(0x104))/0xa;if(_0x248d62===_0x2279f3)break;else _0x29c9a3['push'](_0x29c9a3['shift']());}catch(_0xf15245){_0x29c9a3['push'](_0x29c9a3['shift']());}}}(a29_0x4c7c,0x8cd3a));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x57f825(0xfb),'description':a29_0x57f825(0xf7),'required':!![]};export const VALUE_ARG={'name':a29_0x57f825(0x121),'description':a29_0x57f825(0x102),'required':![]};export const TAGS_FLAG={'name':a29_0x57f825(0x10e),'type':a29_0x57f825(0x12e),'description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a29_0x57f825(0x10b),'type':a29_0x57f825(0x11c),'description':a29_0x57f825(0x10a),'default':![]};export const FROM_ENV_FLAG={'name':a29_0x57f825(0x108),'type':a29_0x57f825(0x12e),'description':a29_0x57f825(0x116)};export const REVEAL_FLAG={'name':a29_0x57f825(0x12b),'type':a29_0x57f825(0x11c),'description':a29_0x57f825(0x12d),'default':![]};export function readKeyArg(_0x51d2fb){const _0x47fe39=a29_0x57f825,_0x272676=_0x51d2fb[_0x47fe39(0x103)][0x0]?.['trim']()??'';return validateKey(_0x272676),_0x272676;}export function readOptionalTags(_0x5d90ca){const _0x43311a=a29_0x57f825,_0x349ae8=_0x5d90ca[_0x43311a(0xf5)](_0x43311a(0x10e))[_0x43311a(0x106)]();if(!_0x349ae8)return undefined;if(_0x349ae8[_0x43311a(0xfd)]>0x20)throw CliErrors[_0x43311a(0x11d)](_0x43311a(0x124));return _0x349ae8;}function a29_0x2fa5(_0x105a65,_0x25e151){_0x105a65=_0x105a65-0xf3;const _0x4c7c7a=a29_0x4c7c();let _0x2fa51a=_0x4c7c7a[_0x105a65];return _0x2fa51a;}export function validateKey(_0x5ecabe){const _0x5465e0=a29_0x57f825;if(!_0x5ecabe)throw CliErrors[_0x5465e0(0x11d)](_0x5465e0(0x11a));if(_0x5ecabe['length']>0x100)throw CliErrors[_0x5465e0(0x11d)](_0x5465e0(0x11e));}export function projectAppConfig(_0x20b551,_0x4aad56){const _0x12e230=a29_0x57f825,_0x1e9f47=_0x20b551[_0x12e230(0x121)]!==undefined&&_0x20b551[_0x12e230(0x121)]!==null&&_0x20b551[_0x12e230(0x121)]!=='',_0x40fba5={'appCode':_0x20b551[_0x12e230(0x129)],'key':_0x20b551[_0x12e230(0xfb)],'tags':_0x20b551[_0x12e230(0x10e)]??undefined,'hasValue':_0x1e9f47,'valueRedacted':_0x1e9f47&&!_0x4aad56?.[_0x12e230(0x12b)],'gmtCreate':_0x20b551[_0x12e230(0x113)],'gmtModified':_0x20b551[_0x12e230(0x111)]};return _0x4aad56?.[_0x12e230(0x12b)]&&(_0x40fba5['value']=_0x20b551[_0x12e230(0x121)]??'',_0x40fba5[_0x12e230(0xfc)]=![]),_0x40fba5;}export function plannedAppConfig(_0x452502){const _0x43af5d=a29_0x57f825,_0x3ca4c7=_0x452502['hasValue']??!![];return{'appCode':_0x452502[_0x43af5d(0x129)],'key':_0x452502['key'],'tags':_0x452502[_0x43af5d(0x10e)]??undefined,'hasValue':_0x3ca4c7,'valueRedacted':_0x3ca4c7};}export function buildMutationData(_0x168d41){const _0x4cf840=a29_0x57f825;return{'operation':_0x168d41[_0x4cf840(0x10d)],'selector':{'appCode':_0x168d41[_0x4cf840(0x129)],'key':_0x168d41['key']},'before':_0x168d41[_0x4cf840(0x10f)],'after':_0x168d41[_0x4cf840(0x135)],'dryRun':_0x168d41['dryRun'],'warnings':_0x168d41[_0x4cf840(0xff)]??[]};}export async function withAppConfigApiBoundary(_0x15bf4a,_0x1e5482,_0x17ea9e){const _0x42071d=a29_0x57f825;try{return await _0x17ea9e();}catch{const _0x401586=[_0x42071d(0x123)+_0x1e5482[_0x42071d(0x129)]];if(_0x1e5482['key'])_0x401586[_0x42071d(0x109)](_0x42071d(0xfe)+_0x1e5482['key']);_0x401586['push'](_0x42071d(0x120));throw CliErrors[_0x42071d(0xf6)](_0x42071d(0x126)+_0x15bf4a+_0x42071d(0x133),_0x401586[_0x42071d(0xfa)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x3bc559,_0x4b343a){const _0x41df85=a29_0x57f825;return Object[_0x41df85(0x122)](_0x3bc559,{'method':{'value':_0x4b343a[_0x41df85(0x11b)],'enumerable':![]},'url':{'value':_0x4b343a[_0x41df85(0xf9)],'enumerable':![]}});}export function assertSingleValueSource(_0x4da3c6){const _0x5d5bec=a29_0x57f825,_0x36cff7=[];_0x4da3c6[_0x5d5bec(0x103)][_0x5d5bec(0xfd)]>0x1&&_0x36cff7[_0x5d5bec(0x109)]({'kind':_0x5d5bec(0x12f),'value':_0x4da3c6[_0x5d5bec(0x103)]['slice'](0x1)[_0x5d5bec(0xfa)]('\x20')});const _0x4bd1a0=_0x4da3c6[_0x5d5bec(0x125)](_0x5d5bec(0x121));_0x4bd1a0!==undefined&&_0x4bd1a0!==null&&_0x36cff7[_0x5d5bec(0x109)]({'kind':_0x5d5bec(0x12f),'value':String(_0x4bd1a0)});_0x4da3c6[_0x5d5bec(0x119)](_0x5d5bec(0x10b))&&_0x36cff7[_0x5d5bec(0x109)]({'kind':_0x5d5bec(0x10b)});const _0x2b2d34=_0x4da3c6[_0x5d5bec(0xf5)](_0x5d5bec(0x108))[_0x5d5bec(0x106)]();_0x2b2d34&&_0x36cff7[_0x5d5bec(0x109)]({'kind':'env','name':_0x2b2d34});const _0x3b956c=_0x4da3c6['str'](_0x5d5bec(0xf8))[_0x5d5bec(0x106)]();_0x3b956c&&_0x36cff7[_0x5d5bec(0x109)]({'kind':'file','path':_0x3b956c});if(_0x36cff7[_0x5d5bec(0xfd)]===0x0)throw CliErrors['validation'](_0x5d5bec(0x100),_0x5d5bec(0x115));if(_0x36cff7[_0x5d5bec(0xfd)]>0x1)throw CliErrors['validation']('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 _0x36cff7[0x0];}export async function assertValueSourceReadable(_0x4b9ff3){const _0x6d21a6=a29_0x57f825;if(_0x4b9ff3[_0x6d21a6(0x10c)]===_0x6d21a6(0x118)&&!(_0x4b9ff3[_0x6d21a6(0x101)]in process.env))throw CliErrors[_0x6d21a6(0x11d)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x4b9ff3[_0x6d21a6(0x101)]);if(_0x4b9ff3[_0x6d21a6(0x10c)]===_0x6d21a6(0xf8))try{await access(_0x4b9ff3['path']);}catch{throw CliErrors['validation'](_0x6d21a6(0x12a)+_0x4b9ff3[_0x6d21a6(0x110)]);}}export async function readAppConfigValue(_0x3855e8){const _0xbe864a=a29_0x57f825,_0x12e2ed=assertSingleValueSource(_0x3855e8),_0x3bd610=[];if(_0x12e2ed[_0xbe864a(0x10c)]==='argument')return _0x3bd610[_0xbe864a(0x109)](_0xbe864a(0x114)),{'value':_0x12e2ed[_0xbe864a(0x121)]??'','source':_0x12e2ed[_0xbe864a(0x10c)],'warnings':_0x3bd610};if(_0x12e2ed[_0xbe864a(0x10c)]==='stdin')return{'value':await readStdin(),'source':_0x12e2ed[_0xbe864a(0x10c)],'warnings':_0x3bd610};if(_0x12e2ed[_0xbe864a(0x10c)]===_0xbe864a(0x118)){if(!(_0x12e2ed[_0xbe864a(0x101)]in process.env))throw CliErrors[_0xbe864a(0x11d)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x12e2ed[_0xbe864a(0x101)]);return{'value':process.env[_0x12e2ed.name]??'','source':_0x12e2ed[_0xbe864a(0x10c)],'warnings':_0x3bd610};}return{'value':await readFile(_0x12e2ed[_0xbe864a(0x110)],_0xbe864a(0x107)),'source':_0x12e2ed['kind'],'warnings':_0x3bd610};}function readStdin(){return new Promise((_0x159f49,_0x20479f)=>{const _0xbad56f=a29_0x2fa5;let _0xd65c1='';process[_0xbad56f(0x10b)][_0xbad56f(0xf4)](_0xbad56f(0x107)),process[_0xbad56f(0x10b)]['on']('data',_0x3bedc1=>{_0xd65c1+=_0x3bedc1;}),process[_0xbad56f(0x10b)][_0xbad56f(0x11f)](_0xbad56f(0x132),()=>_0x159f49(_0xd65c1)),process['stdin']['once'](_0xbad56f(0xf3),_0x20479f);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x22f8c3=a30_0x6d91;function a30_0x6d91(_0x3bc742,_0x1d4ccd){_0x3bc742=_0x3bc742-0xcd;const _0x2b4c08=a30_0x2b4c();let _0x6d91ee=_0x2b4c08[_0x3bc742];return _0x6d91ee;}(function(_0x2f5db4,_0x4f1ba5){const _0x55efee=a30_0x6d91,_0x10f5c5=_0x2f5db4();while(!![]){try{const _0x42dbf5=parseInt(_0x55efee(0xe1))/0x1*(parseInt(_0x55efee(0xdb))/0x2)+parseInt(_0x55efee(0xe2))/0x3*(parseInt(_0x55efee(0xd1))/0x4)+-parseInt(_0x55efee(0xdd))/0x5*(-parseInt(_0x55efee(0xce))/0x6)+-parseInt(_0x55efee(0xdf))/0x7*(parseInt(_0x55efee(0xd9))/0x8)+parseInt(_0x55efee(0xcf))/0x9*(-parseInt(_0x55efee(0xd5))/0xa)+-parseInt(_0x55efee(0xd0))/0xb*(-parseInt(_0x55efee(0xdc))/0xc)+-parseInt(_0x55efee(0xd6))/0xd*(parseInt(_0x55efee(0xd7))/0xe);if(_0x42dbf5===_0x4f1ba5)break;else _0x10f5c5['push'](_0x10f5c5['shift']());}catch(_0x3addaa){_0x10f5c5['push'](_0x10f5c5['shift']());}}}(a30_0x2b4c,0x68bff));import{unlinkSync,existsSync}from'node:fs';function a30_0x2b4c(){const _0x4cd50a=['125368nemetV','12AARFOJ','255485cGqJYY','log','70MLBDTP','boolean','13TtIiCW','556806ggHDIU','auth','Login\x20via\x20browser','login','bool','84yehxNl','2007981Xvoepo','562463oogNAz','4zMWIMs','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','Clear\x20login\x20session','write','20DMdHKY','275444nepSxR','266isurJH','yes','391312yJVJdK','✓\x20Logged\x20out'];a30_0x2b4c=function(){return _0x4cd50a;};return a30_0x2b4c();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a30_0x22f8c3(0xe3),'command':a30_0x22f8c3(0xe5),'description':a30_0x22f8c3(0xe4),'risk':a30_0x22f8c3(0xd4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a30_0x22f8c3(0xd8),'type':a30_0x22f8c3(0xe0),'description':a30_0x22f8c3(0xd2),'default':![]}],async 'execute'(_0x1bf981){const _0x4c2ecc=a30_0x22f8c3,{runAuthServer:_0x2f3a74}=await import('../../auth/auth-server-ui.js');return await _0x2f3a74({'autoYes':_0x1bf981[_0x4c2ecc(0xcd)]('yes'),'nonInteractive':_0x1bf981['nonInteractive']}),{'ok':!![]};}},{'service':a30_0x22f8c3(0xe3),'command':'logout','description':a30_0x22f8c3(0xd3),'risk':a30_0x22f8c3(0xd4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4f5fd3){const _0x4f1e89=a30_0x22f8c3;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x4f1e89(0xde)](_0x4f1e89(0xda))):console[_0x4f1e89(0xde)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x34d248=a31_0x2e61;(function(_0x2f99b6,_0x391270){const _0x25004e=a31_0x2e61,_0x3bc2d2=_0x2f99b6();while(!![]){try{const _0x20e46c=-parseInt(_0x25004e(0x157))/0x1+parseInt(_0x25004e(0x16c))/0x2*(-parseInt(_0x25004e(0x164))/0x3)+parseInt(_0x25004e(0x154))/0x4+-parseInt(_0x25004e(0x15d))/0x5+-parseInt(_0x25004e(0x14f))/0x6+-parseInt(_0x25004e(0x130))/0x7*(parseInt(_0x25004e(0x11f))/0x8)+-parseInt(_0x25004e(0x151))/0x9*(-parseInt(_0x25004e(0x16f))/0xa);if(_0x20e46c===_0x391270)break;else _0x3bc2d2['push'](_0x3bc2d2['shift']());}catch(_0x14fdfa){_0x3bc2d2['push'](_0x3bc2d2['shift']());}}}(a31_0x491c,0xece26));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';function a31_0x2e61(_0x2e5cd0,_0x47d130){_0x2e5cd0=_0x2e5cd0-0x10d;const _0x491c57=a31_0x491c();let _0x2e6138=_0x491c57[_0x2e5cd0];return _0x2e6138;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x34d248(0x168),'command':'create','description':a31_0x34d248(0x123),'risk':a31_0x34d248(0x139),'flags':[{'name':a31_0x34d248(0x138),'type':a31_0x34d248(0x111),'required':!![],'enum':[a31_0x34d248(0x14e),a31_0x34d248(0x15a),a31_0x34d248(0x146)],'description':a31_0x34d248(0x118)},{'name':a31_0x34d248(0x152),'type':a31_0x34d248(0x111),'required':!![],'description':a31_0x34d248(0x135)},{'name':a31_0x34d248(0x12d),'type':a31_0x34d248(0x111),'description':a31_0x34d248(0x143)},{'name':a31_0x34d248(0x15f),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a31_0x34d248(0x179),'type':a31_0x34d248(0x111),'description':a31_0x34d248(0x136)},{'name':a31_0x34d248(0x128),'type':'string','description':a31_0x34d248(0x11a)},{'name':a31_0x34d248(0x167),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a31_0x34d248(0x170),'after']}],async 'validate'(_0x35cd09){const _0x2d9971=a31_0x34d248,_0x5dc4ec=_0x35cd09[_0x2d9971(0x174)](_0x2d9971(0x152));if(!isValidBffFunctionName(_0x5dc4ec))throw CliErrors[_0x2d9971(0x141)]('Invalid\x20function\x20name\x20\x22'+_0x5dc4ec+_0x2d9971(0x13c));},async 'execute'(_0x5abe77){const _0x4b0151=a31_0x34d248,_0x337eb3=loadBffProjectConfig(_0x5abe77['appCode']),_0x4793f2=_0x5abe77[_0x4b0151(0x174)](_0x4b0151(0x138)),_0x45c418=_0x5abe77[_0x4b0151(0x174)]('name'),_0x36aeaa=_0x5abe77[_0x4b0151(0x174)]('description')||undefined,_0x2ce6ab=_0x4793f2===_0x4b0151(0x146)?await resolveHookOptions(_0x337eb3,_0x5abe77):undefined,_0x3b657b=buildFilePath(_0x337eb3,_0x4793f2,_0x45c418,_0x2ce6ab);if(await fileExists(_0x3b657b))throw CliErrors[_0x4b0151(0x141)](_0x4b0151(0x11e)+_0x3b657b);await mkdir(dirname(_0x3b657b),{'recursive':!![]});const _0x496883=generateTemplate(_0x4793f2,_0x45c418,_0x5abe77[_0x4b0151(0x12f)],_0x36aeaa,_0x2ce6ab);await writeFile(_0x3b657b,_0x496883,_0x4b0151(0x149));const _0x224d83={'type':_0x4793f2,'name':_0x45c418,'path':_0x3b657b};if(_0x36aeaa)_0x224d83[_0x4b0151(0x12d)]=_0x36aeaa;if(_0x2ce6ab){if(_0x2ce6ab['alias'])_0x224d83[_0x4b0151(0x15f)]=_0x2ce6ab['alias'];_0x224d83[_0x4b0151(0x10e)]=_0x2ce6ab[_0x4b0151(0x10e)],_0x224d83[_0x4b0151(0x11c)]=_0x2ce6ab[_0x4b0151(0x11c)],_0x224d83[_0x4b0151(0x155)]=_0x2ce6ab[_0x4b0151(0x155)];}return{'ok':!![],'data':_0x224d83,'message':_0x4b0151(0x15c)+_0x4793f2+_0x4b0151(0x120)+_0x45c418};}};async function resolveHookOptions(_0x2cedb3,_0x3cf21f){const _0x166a16=a31_0x34d248,_0x3fcbda=loadAliasMap(_0x3cf21f[_0x166a16(0x178)],undefined,resolveApiFilePath(_0x3cf21f[_0x166a16(0x178)],_0x3cf21f[_0x166a16(0x12f)])),_0x21997d=_0x3fcbda[_0x166a16(0x140)]>0x0;let _0x3920aa,_0x5b18c2,_0x4259ea;const _0x3dba9b=_0x3cf21f[_0x166a16(0x174)]('alias'),_0x3b7321=_0x3cf21f[_0x166a16(0x174)]('datasetcode');if(_0x3dba9b){const _0x501de3=resolveAlias(_0x3cf21f[_0x166a16(0x178)],_0x3dba9b,undefined,resolveApiFilePath(_0x3cf21f[_0x166a16(0x178)],_0x3cf21f['appCode']));if(!_0x501de3){const _0x1121ee=_0x21997d?_0x166a16(0x13f)+_0x3fcbda[_0x166a16(0x125)](_0x33cde3=>_0x33cde3[_0x166a16(0x15f)])['join'](',\x20'):_0x166a16(0x13d)+CLI_BIN_NAME+_0x166a16(0x161);throw CliErrors[_0x166a16(0x141)](_0x166a16(0x17a)+_0x3dba9b+_0x166a16(0x13b)+_0x1121ee);}_0x3920aa=_0x3dba9b,_0x5b18c2=_0x501de3;}else{if(_0x3b7321){_0x5b18c2=_0x3b7321;const _0x482abb=_0x3fcbda[_0x166a16(0x144)](_0x42c84d=>_0x42c84d['datasetCode']===_0x3b7321);_0x3920aa=_0x482abb?.['alias'];}else{if(_0x3cf21f[_0x166a16(0x15e)])throw CliErrors[_0x166a16(0x141)](_0x166a16(0x131));else{if(_0x21997d){const _0x315349=_0x3fcbda['map'](_0x1cb195=>_0x1cb195['alias']+'\x20('+_0x1cb195['tableName']+')'),_0x323212=await promptSelect(_0x166a16(0x16e),_0x315349),_0x16ac2b=_0x3fcbda[_0x323212];if(!_0x16ac2b)throw CliErrors[_0x166a16(0x141)](_0x166a16(0x124));_0x3920aa=_0x16ac2b[_0x166a16(0x15f)],_0x5b18c2=_0x16ac2b[_0x166a16(0x10e)];}else{const _0x3ea256=await listDatasets(_0x3cf21f[_0x166a16(0x12f)]);if(_0x3ea256[_0x166a16(0x140)]===0x0)throw CliErrors[_0x166a16(0x141)](_0x166a16(0x116));const _0x3c83cb=_0x3ea256[_0x166a16(0x125)](_0x34cdb1=>_0x34cdb1[_0x166a16(0x152)]+'\x20['+(_0x34cdb1[_0x166a16(0x147)]??_0x166a16(0x115))+_0x166a16(0x142)+_0x34cdb1[_0x166a16(0x16a)]+')'),_0xa13539=await promptSelect(_0x166a16(0x16e),_0x3c83cb),_0x5e9b2a=_0x3ea256[_0xa13539];if(!_0x5e9b2a)throw CliErrors[_0x166a16(0x141)]('Invalid\x20dataset\x20selection.');_0x5b18c2=_0x5e9b2a[_0x166a16(0x16a)],_0x3920aa=undefined;}}}}const _0x4752c1=await listDatasets(_0x3cf21f[_0x166a16(0x12f)]),_0x1cf1b9=_0x4752c1['find'](_0xfbb915=>_0xfbb915[_0x166a16(0x16a)]===_0x5b18c2);if(!_0x1cf1b9)throw CliErrors[_0x166a16(0x141)](_0x166a16(0x113)+_0x5b18c2+_0x166a16(0x15b)+(_0x3920aa?_0x166a16(0x16b)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x4259ea=_0x1cf1b9['id'];const _0x3105b3=_0x3920aa??_0x5b18c2,_0x4803ce=await listBffDatasetOperations(_0x3cf21f[_0x166a16(0x12f)],_0x4259ea),_0x1a9345=_0x4803ce?Object[_0x166a16(0x12a)](_0x4803ce):[];if(_0x1a9345[_0x166a16(0x140)]===0x0)throw CliErrors['validation'](_0x166a16(0x171)+_0x3105b3+'.');let _0x128df6;const _0x828eb0=_0x3cf21f['str'](_0x166a16(0x128));if(_0x828eb0){if(!_0x1a9345[_0x166a16(0x14a)](_0x828eb0))throw CliErrors[_0x166a16(0x141)](_0x166a16(0x160)+_0x828eb0+_0x166a16(0x162)+_0x3105b3+'.\x20'+(_0x166a16(0x14d)+_0x1a9345[_0x166a16(0x176)](',\x20')));_0x128df6=_0x828eb0;}else{if(_0x3cf21f['nonInteractive'])throw CliErrors[_0x166a16(0x141)](_0x166a16(0x148));const _0x5b57fe=await promptSelect(_0x166a16(0x166),_0x1a9345);_0x128df6=_0x1a9345[_0x5b57fe]??_0x1a9345[0x0];}let _0x44f107=normalizeHookFunctionNode(_0x3cf21f[_0x166a16(0x174)](_0x166a16(0x167)));if(!_0x44f107){if(_0x3cf21f[_0x166a16(0x174)](_0x166a16(0x167)))throw CliErrors[_0x166a16(0x141)](_0x166a16(0x172));if(_0x3cf21f[_0x166a16(0x15e)])throw CliErrors[_0x166a16(0x141)](_0x166a16(0x122));const _0xc6fc2e=await promptSelect(_0x166a16(0x137),[_0x166a16(0x170),_0x166a16(0x150)]);_0x44f107=[_0x166a16(0x170),_0x166a16(0x150)][_0xc6fc2e]??'before';}return{'alias':_0x3920aa,'datasetCode':_0x5b18c2,'datasetId':_0x4259ea,'operationType':_0x128df6,'functionNode':_0x44f107};}async function promptSelect(_0x26c3ac,_0x41908c){const _0x389af9=a31_0x34d248;if(_0x41908c[_0x389af9(0x140)]===0x1)return 0x0;for(const [_0x1e3a80,_0x259523]of _0x41908c[_0x389af9(0x10f)]()){process[_0x389af9(0x121)][_0x389af9(0x127)]('\x20\x20'+(_0x1e3a80+0x1)+'.\x20'+_0x259523+'\x0a');}const _0x2b58bb=createInterface({'input':process[_0x389af9(0x129)],'output':process[_0x389af9(0x121)]});while(!![]){const _0x11dfe9=await new Promise(_0x242d01=>{const _0x4bfb4d=_0x389af9;_0x2b58bb[_0x4bfb4d(0x132)](_0x26c3ac+'\x20',_0x242d01);}),_0xc2158d=Number[_0x389af9(0x14b)](_0x11dfe9[_0x389af9(0x145)](),0xa);if(Number['isInteger'](_0xc2158d)&&_0xc2158d>=0x1&&_0xc2158d<=_0x41908c['length'])return _0x2b58bb[_0x389af9(0x14c)](),_0xc2158d-0x1;process['stderr'][_0x389af9(0x127)](_0x389af9(0x119)+_0x41908c[_0x389af9(0x140)]+'.\x0a');}}function a31_0x491c(){const _0x3ba6f9=['validation',']\x20(','Script\x20description','find','trim','HOOK','source','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','includes','parseInt','close','Available:\x20','COMMON','8325120TdkIBV','after','1872099VUQptL','name','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','6096044VVJuCV','functionNode','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','1134995SeRdif','/COMMON/','scriptsRootDir','ENDPOINT','\x22.\x20','Created\x20','1729905JhiAJf','nonInteractive','alias','Operation\x20type\x20\x22','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x22\x20not\x20found\x20for\x20dataset\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','96966NLEqBB','当前请求参数','Select\x20operation\x20type:','function-node','bff','.js','code','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','114rNojGb','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','Select\x20dataset:','270STwLFy','before','No\x20operation\x20types\x20found\x20for\x20dataset\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','str','\x22,\x20params\x20})\x0a','join','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','apiDir','datasetcode','Alias\x20\x22','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','datasetCode','entries','\x0a\x20*\x20[平台配置]\x20','string','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Dataset\x20not\x20found\x20for\x20code\x20\x22','/ENDPOINT/','UNKNOWN','No\x20datasets\x20found\x20for\x20this\x20app.','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','Script\x20type','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Operation\x20type\x20(HOOK\x20only)','当前响应结果','operationType','HOOK\x20requires\x20alias/operation/node\x20options.','File\x20already\x20exists:\x20','160IzZiIJ','\x20function:\x20','stderr','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Invalid\x20dataset\x20selection.','map','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','write','operation-type','stdin','keys','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','datasetId','description','.js\x0a\x20*\x20[触发节点]\x20','appCode','510713sUmtkH','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','question','/HOOK/','/**\x0a\x20*\x20','Function\x20name\x20(valid\x20JS\x20identifier)','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Select\x20trigger\x20node:','type','read','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x22\x20not\x20found.\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','No\x20api.ts\x20found.\x20Run\x20`','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Available\x20aliases:\x20','length'];a31_0x491c=function(){return _0x3ba6f9;};return a31_0x491c();}function buildFilePath(_0x289585,_0x8ac0a9,_0x196e67,_0x2c8720){const _0x319159=a31_0x34d248;if(_0x8ac0a9===_0x319159(0x146)){if(!_0x2c8720)throw CliErrors['validation'](_0x319159(0x11d));const _0x590bcb=_0x2c8720['alias']??_0x2c8720[_0x319159(0x10e)];return join(_0x289585['scriptsRootDir'],_0x319159(0x146),_0x590bcb,_0x2c8720[_0x319159(0x11c)],_0x2c8720[_0x319159(0x155)],_0x196e67+_0x319159(0x169));}return join(_0x289585[_0x319159(0x159)],_0x8ac0a9,_0x196e67+_0x319159(0x169));}export function generateTemplate(_0x1c6547,_0x19b405,_0x51798e,_0x56cfe5,_0xa3dfb1){const _0x465524=a31_0x34d248,_0x9dd8c6=_0x56cfe5?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x4b4af0=getAppBaseUrl(_0x51798e),_0x19f1d6=_0x465524(0x16d);if(_0x1c6547===_0x465524(0x14e))return _0x465524(0x134)+_0x9dd8c6+_0x465524(0x12b)+_0x19b405+_0x465524(0x110)+_0x4b4af0+_0x465524(0x10d)+_0x51798e+_0x465524(0x158)+_0x19b405+_0x465524(0x117)+_0x19b405+_0x465524(0x175)+_0x19f1d6+'\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'+_0x19b405+_0x465524(0x177);if(_0x1c6547===_0x465524(0x15a))return _0x465524(0x134)+_0x9dd8c6+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x19b405+_0x465524(0x126)+_0x51798e+'/'+_0x19b405+_0x465524(0x110)+_0x4b4af0+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x51798e+_0x465524(0x114)+_0x19b405+'.js\x0a'+_0x19f1d6+_0x465524(0x13e)+_0x19b405+_0x465524(0x177);if(!_0xa3dfb1)throw CliErrors['validation'](_0x465524(0x112));const _0x51b016=_0xa3dfb1[_0x465524(0x15f)]??_0xa3dfb1[_0x465524(0x10e)],_0x5c7376=_0xa3dfb1[_0x465524(0x155)]==='before'?_0x465524(0x165):_0x465524(0x11b),_0xc7130c=_0xa3dfb1['functionNode']===_0x465524(0x170)?'修改后的请求参数':'修改后的响应结果';return _0x465524(0x134)+_0x9dd8c6+_0x465524(0x173)+_0x19b405+_0x465524(0x163)+_0x51798e+'/'+_0xa3dfb1[_0x465524(0x10e)]+'/'+_0xa3dfb1[_0x465524(0x11c)]+_0x465524(0x110)+_0x4b4af0+'/data/dataset/'+_0xa3dfb1[_0x465524(0x12c)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x51798e+_0x465524(0x133)+_0x51b016+'/'+_0xa3dfb1[_0x465524(0x11c)]+'/'+_0xa3dfb1[_0x465524(0x155)]+'/'+_0x19b405+_0x465524(0x12e)+_0xa3dfb1[_0x465524(0x155)]+'\x0a'+_0x19f1d6+_0x465524(0x153)+_0x5c7376+_0x465524(0x13a)+_0xc7130c+_0x465524(0x156)+_0x19b405+_0x465524(0x177);}
|
|
1
|
+
const a31_0xe97cc4=a31_0x1c94;function a31_0x1c94(_0x1d0ddc,_0xc5fe61){_0x1d0ddc=_0x1d0ddc-0x1eb;const _0x2bcbac=a31_0x2bcb();let _0x1c94a4=_0x2bcbac[_0x1d0ddc];return _0x1c94a4;}(function(_0x337959,_0x3ef6c6){const _0x3ae163=a31_0x1c94,_0x75cf41=_0x337959();while(!![]){try{const _0x35b533=-parseInt(_0x3ae163(0x228))/0x1+parseInt(_0x3ae163(0x226))/0x2*(-parseInt(_0x3ae163(0x232))/0x3)+parseInt(_0x3ae163(0x23c))/0x4+parseInt(_0x3ae163(0x1f7))/0x5*(-parseInt(_0x3ae163(0x241))/0x6)+-parseInt(_0x3ae163(0x1fa))/0x7*(parseInt(_0x3ae163(0x244))/0x8)+-parseInt(_0x3ae163(0x1eb))/0x9*(parseInt(_0x3ae163(0x1f2))/0xa)+parseInt(_0x3ae163(0x20e))/0xb;if(_0x35b533===_0x3ef6c6)break;else _0x75cf41['push'](_0x75cf41['shift']());}catch(_0x1b3959){_0x75cf41['push'](_0x75cf41['shift']());}}}(a31_0x2bcb,0x379aa));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a31_0x2bcb(){const _0xfe774a=['type','Function\x20name\x20(valid\x20JS\x20identifier)','Invalid\x20dataset\x20selection.','trim','修改后的响应结果','HOOK','1791TSqbBg','question','No\x20api.ts\x20found.\x20Run\x20`','Available:\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','before','create','8980sHFgje','appCode','map','\x22,\x20params\x20})\x0a','entries','5LhJCeB','File\x20already\x20exists:\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','7xaGKEh','/COMMON/','COMMON','HOOK\x20requires\x20alias/operation/node\x20options.','parseInt',']\x20(','Script\x20description','\x20function:\x20','alias','No\x20datasets\x20found\x20for\x20this\x20app.','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','str','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20(HOOK\x20only)','stderr','read','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','includes','Select\x20dataset:','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','16288492lqKEoj','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','close','datasetCode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','datasetId','find','Select\x20operation\x20type:','Select\x20trigger\x20node:','Dataset\x20not\x20found\x20for\x20code\x20\x22','length','/HOOK/','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','functionNode','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','修改后的请求参数','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','after','validation','Available\x20aliases:\x20','description','Operation\x20type\x20\x22','14fqodeq','\x22\x20not\x20found.\x20','241984peiwaV','Alias\x20\x22','当前请求参数','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','ENDPOINT','utf8','\x20api\x20pull`\x20to\x20refresh.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','175278SxVjfn','function-node','operationType','Trigger\x20node\x20(HOOK\x20only)','isInteger','source','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x22\x20not\x20found\x20for\x20dataset\x20','.js','nonInteractive','550184PrayBy','datasetcode','/data/dataset/','\x0a\x20*\x20[平台配置]\x20','.js\x0a\x20*\x20[触发节点]\x20','889242jpficR','Created\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','3301512aitprO','apiDir','当前响应结果','name','/**\x0a\x20*\x20','operation-type','UNKNOWN','code','scriptsRootDir','join','\x22.\x20','write','string'];a31_0x2bcb=function(){return _0xfe774a;};return a31_0x2bcb();}import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':a31_0xe97cc4(0x1f1),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0xe97cc4(0x209),'flags':[{'name':a31_0xe97cc4(0x251),'type':a31_0xe97cc4(0x250),'required':!![],'enum':[a31_0xe97cc4(0x1fc),a31_0xe97cc4(0x22d),a31_0xe97cc4(0x256)],'description':'Script\x20type'},{'name':a31_0xe97cc4(0x247),'type':a31_0xe97cc4(0x250),'required':!![],'description':a31_0xe97cc4(0x252)},{'name':a31_0xe97cc4(0x224),'type':'string','description':a31_0xe97cc4(0x200)},{'name':a31_0xe97cc4(0x202),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x1ef)},{'name':a31_0xe97cc4(0x23d),'type':a31_0xe97cc4(0x250),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a31_0xe97cc4(0x249),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x207)},{'name':a31_0xe97cc4(0x233),'type':a31_0xe97cc4(0x250),'description':a31_0xe97cc4(0x235),'enum':[a31_0xe97cc4(0x1f0),a31_0xe97cc4(0x221)]}],async 'validate'(_0x3fd061){const _0x1e5910=a31_0xe97cc4,_0x170561=_0x3fd061[_0x1e5910(0x205)](_0x1e5910(0x247));if(!isValidBffFunctionName(_0x170561))throw CliErrors[_0x1e5910(0x222)]('Invalid\x20function\x20name\x20\x22'+_0x170561+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0xfaa144){const _0x5f56b8=a31_0xe97cc4,_0x3a6b2b=loadBffProjectConfig(_0xfaa144[_0x5f56b8(0x1f3)]),_0x40cb46=_0xfaa144['str']('type'),_0xc4ca46=_0xfaa144[_0x5f56b8(0x205)](_0x5f56b8(0x247)),_0x4f1be7=_0xfaa144['str'](_0x5f56b8(0x224))||undefined,_0x3828e3=_0x40cb46===_0x5f56b8(0x256)?await resolveHookOptions(_0x3a6b2b,_0xfaa144):undefined,_0x246af3=buildFilePath(_0x3a6b2b,_0x40cb46,_0xc4ca46,_0x3828e3);if(await fileExists(_0x246af3))throw CliErrors[_0x5f56b8(0x222)](_0x5f56b8(0x1f8)+_0x246af3);await mkdir(dirname(_0x246af3),{'recursive':!![]});const _0x4efaab=generateTemplate(_0x40cb46,_0xc4ca46,_0xfaa144['appCode'],_0x4f1be7,_0x3828e3);await writeFile(_0x246af3,_0x4efaab,_0x5f56b8(0x22e));const _0x3e354f={'type':_0x40cb46,'name':_0xc4ca46,'path':_0x246af3};if(_0x4f1be7)_0x3e354f[_0x5f56b8(0x224)]=_0x4f1be7;if(_0x3828e3){if(_0x3828e3['alias'])_0x3e354f[_0x5f56b8(0x202)]=_0x3828e3[_0x5f56b8(0x202)];_0x3e354f[_0x5f56b8(0x212)]=_0x3828e3[_0x5f56b8(0x212)],_0x3e354f[_0x5f56b8(0x234)]=_0x3828e3[_0x5f56b8(0x234)],_0x3e354f[_0x5f56b8(0x21d)]=_0x3828e3['functionNode'];}return{'ok':!![],'data':_0x3e354f,'message':_0x5f56b8(0x242)+_0x40cb46+_0x5f56b8(0x201)+_0xc4ca46};}};async function resolveHookOptions(_0x54c3eb,_0xbc3d59){const _0x3cf33e=a31_0xe97cc4,_0x1fa789=loadAliasMap(_0xbc3d59['apiDir'],undefined,resolveApiFilePath(_0xbc3d59[_0x3cf33e(0x245)],_0xbc3d59['appCode'])),_0x245618=_0x1fa789[_0x3cf33e(0x21a)]>0x0;let _0x5c916d,_0xdf60b0,_0x2f1a6a;const _0x202a7a=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x202)),_0x5a756b=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x23d));if(_0x202a7a){const _0x105a25=resolveAlias(_0xbc3d59['apiDir'],_0x202a7a,undefined,resolveApiFilePath(_0xbc3d59[_0x3cf33e(0x245)],_0xbc3d59[_0x3cf33e(0x1f3)]));if(!_0x105a25){const _0x17e661=_0x245618?_0x3cf33e(0x223)+_0x1fa789['map'](_0x39ef01=>_0x39ef01['alias'])[_0x3cf33e(0x24d)](',\x20'):_0x3cf33e(0x1ed)+CLI_BIN_NAME+_0x3cf33e(0x20d);throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x229)+_0x202a7a+_0x3cf33e(0x227)+_0x17e661);}_0x5c916d=_0x202a7a,_0xdf60b0=_0x105a25;}else{if(_0x5a756b){_0xdf60b0=_0x5a756b;const _0x54f6bc=_0x1fa789[_0x3cf33e(0x216)](_0x2136c8=>_0x2136c8['datasetCode']===_0x5a756b);_0x5c916d=_0x54f6bc?.['alias'];}else{if(_0xbc3d59['nonInteractive'])throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x1f9));else{if(_0x245618){const _0x3d8736=_0x1fa789['map'](_0x463d51=>_0x463d51[_0x3cf33e(0x202)]+'\x20('+_0x463d51['tableName']+')'),_0x268b6c=await promptSelect('Select\x20dataset:',_0x3d8736),_0x1d1fb0=_0x1fa789[_0x268b6c];if(!_0x1d1fb0)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x253));_0x5c916d=_0x1d1fb0['alias'],_0xdf60b0=_0x1d1fb0[_0x3cf33e(0x212)];}else{const _0x4cf5e1=await listDatasets(_0xbc3d59[_0x3cf33e(0x1f3)]);if(_0x4cf5e1[_0x3cf33e(0x21a)]===0x0)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x203));const _0x26564c=_0x4cf5e1[_0x3cf33e(0x1f4)](_0x1a5a5c=>_0x1a5a5c[_0x3cf33e(0x247)]+'\x20['+(_0x1a5a5c[_0x3cf33e(0x237)]??_0x3cf33e(0x24a))+_0x3cf33e(0x1ff)+_0x1a5a5c['code']+')'),_0x554f5e=await promptSelect(_0x3cf33e(0x20c),_0x26564c),_0xff6fe8=_0x4cf5e1[_0x554f5e];if(!_0xff6fe8)throw CliErrors['validation'](_0x3cf33e(0x253));_0xdf60b0=_0xff6fe8['code'],_0x5c916d=undefined;}}}}const _0xf0af1c=await listDatasets(_0xbc3d59[_0x3cf33e(0x1f3)]),_0x408ec4=_0xf0af1c[_0x3cf33e(0x216)](_0x3452a9=>_0x3452a9[_0x3cf33e(0x24b)]===_0xdf60b0);if(!_0x408ec4)throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x219)+_0xdf60b0+_0x3cf33e(0x24e)+(_0x5c916d?_0x3cf33e(0x204)+CLI_BIN_NAME+_0x3cf33e(0x22f):''));_0x2f1a6a=_0x408ec4['id'];const _0x224a0f=_0x5c916d??_0xdf60b0,_0x3b60e8=await listBffDatasetOperations(_0xbc3d59[_0x3cf33e(0x1f3)],_0x2f1a6a),_0x119c41=_0x3b60e8?Object['keys'](_0x3b60e8):[];if(_0x119c41[_0x3cf33e(0x21a)]===0x0)throw CliErrors[_0x3cf33e(0x222)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x224a0f+'.');let _0x169e79;const _0x4520ca=_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x249));if(_0x4520ca){if(!_0x119c41[_0x3cf33e(0x20b)](_0x4520ca))throw CliErrors['validation'](_0x3cf33e(0x225)+_0x4520ca+_0x3cf33e(0x239)+_0x224a0f+'.\x20'+(_0x3cf33e(0x1ee)+_0x119c41['join'](',\x20')));_0x169e79=_0x4520ca;}else{if(_0xbc3d59[_0x3cf33e(0x23b)])throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x22b));const _0x512f71=await promptSelect(_0x3cf33e(0x217),_0x119c41);_0x169e79=_0x119c41[_0x512f71]??_0x119c41[0x0];}let _0x4d2bc6=normalizeHookFunctionNode(_0xbc3d59['str']('function-node'));if(!_0x4d2bc6){if(_0xbc3d59[_0x3cf33e(0x205)](_0x3cf33e(0x233)))throw CliErrors[_0x3cf33e(0x222)](_0x3cf33e(0x210));if(_0xbc3d59[_0x3cf33e(0x23b)])throw CliErrors[_0x3cf33e(0x222)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x13b7ef=await promptSelect(_0x3cf33e(0x218),['before',_0x3cf33e(0x221)]);_0x4d2bc6=[_0x3cf33e(0x1f0),_0x3cf33e(0x221)][_0x13b7ef]??_0x3cf33e(0x1f0);}return{'alias':_0x5c916d,'datasetCode':_0xdf60b0,'datasetId':_0x2f1a6a,'operationType':_0x169e79,'functionNode':_0x4d2bc6};}async function promptSelect(_0x16f874,_0x10ca7e){const _0x86efd3=a31_0xe97cc4;if(_0x10ca7e[_0x86efd3(0x21a)]===0x1)return 0x0;for(const [_0x27998a,_0x2fedaa]of _0x10ca7e[_0x86efd3(0x1f6)]()){process['stderr'][_0x86efd3(0x24f)]('\x20\x20'+(_0x27998a+0x1)+'.\x20'+_0x2fedaa+'\x0a');}const _0x2f7a4b=createInterface({'input':process['stdin'],'output':process[_0x86efd3(0x208)]});while(!![]){const _0x961a31=await new Promise(_0x27c279=>{const _0x503efb=_0x86efd3;_0x2f7a4b[_0x503efb(0x1ec)](_0x16f874+'\x20',_0x27c279);}),_0xaf8e26=Number[_0x86efd3(0x1fe)](_0x961a31['trim'](),0xa);if(Number[_0x86efd3(0x236)](_0xaf8e26)&&_0xaf8e26>=0x1&&_0xaf8e26<=_0x10ca7e[_0x86efd3(0x21a)])return _0x2f7a4b[_0x86efd3(0x211)](),_0xaf8e26-0x1;process[_0x86efd3(0x208)][_0x86efd3(0x24f)](_0x86efd3(0x220)+_0x10ca7e[_0x86efd3(0x21a)]+'.\x0a');}}function buildFilePath(_0x175c97,_0x7b0c5,_0x4ca6dc,_0x50d2e6){const _0x1f5b49=a31_0xe97cc4;if(_0x7b0c5===_0x1f5b49(0x256)){if(!_0x50d2e6)throw CliErrors[_0x1f5b49(0x222)](_0x1f5b49(0x1fd));const _0x4e2557=_0x50d2e6[_0x1f5b49(0x202)]??_0x50d2e6['datasetCode'];return join(_0x175c97[_0x1f5b49(0x24c)],'HOOK',_0x4e2557,_0x50d2e6[_0x1f5b49(0x234)],_0x50d2e6[_0x1f5b49(0x21d)],_0x4ca6dc+_0x1f5b49(0x23a));}return join(_0x175c97[_0x1f5b49(0x24c)],_0x7b0c5,_0x4ca6dc+_0x1f5b49(0x23a));}export function generateTemplate(_0xf7c742,_0x4c6f6e,_0x324264,_0x51f6b1,_0x4e0630){const _0x149395=a31_0xe97cc4,_0x4162ae=_0x51f6b1?.[_0x149395(0x254)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x220dda=getAppBaseUrl(_0x324264),_0x159217='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0xf7c742==='COMMON')return'/**\x0a\x20*\x20'+_0x4162ae+_0x149395(0x206)+_0x4c6f6e+_0x149395(0x23f)+_0x220dda+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x324264+_0x149395(0x1fb)+_0x4c6f6e+_0x149395(0x214)+_0x4c6f6e+_0x149395(0x1f5)+_0x159217+_0x149395(0x243)+_0x4c6f6e+_0x149395(0x238);if(_0xf7c742===_0x149395(0x22d))return'/**\x0a\x20*\x20'+_0x4162ae+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x4c6f6e+_0x149395(0x20a)+_0x324264+'/'+_0x4c6f6e+_0x149395(0x23f)+_0x220dda+_0x149395(0x21e)+_0x324264+'/ENDPOINT/'+_0x4c6f6e+'.js\x0a'+_0x159217+_0x149395(0x20f)+_0x4c6f6e+_0x149395(0x238);if(!_0x4e0630)throw CliErrors[_0x149395(0x222)](_0x149395(0x230));const _0x3363ab=_0x4e0630[_0x149395(0x202)]??_0x4e0630[_0x149395(0x212)],_0x1342cd=_0x4e0630['functionNode']===_0x149395(0x1f0)?_0x149395(0x22a):_0x149395(0x246),_0x7a8f09=_0x4e0630['functionNode']===_0x149395(0x1f0)?_0x149395(0x21f):_0x149395(0x255);return _0x149395(0x248)+_0x4162ae+_0x149395(0x22c)+_0x4c6f6e+_0x149395(0x213)+_0x324264+'/'+_0x4e0630[_0x149395(0x212)]+'/'+_0x4e0630['operationType']+_0x149395(0x23f)+_0x220dda+_0x149395(0x23e)+_0x4e0630[_0x149395(0x215)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x324264+_0x149395(0x21b)+_0x3363ab+'/'+_0x4e0630[_0x149395(0x234)]+'/'+_0x4e0630['functionNode']+'/'+_0x4c6f6e+_0x149395(0x240)+_0x4e0630[_0x149395(0x21d)]+'\x0a'+_0x159217+_0x149395(0x231)+_0x1342cd+_0x149395(0x21c)+_0x7a8f09+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4c6f6e+_0x149395(0x238);}
|