@lovrabet/rabetbase-cli 2.5.2-beta.1 → 2.5.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/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.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 +113 -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.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +11 -5
- 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(_0x38a916,_0x12213d){const _0x3c8035=a19_0x2dbe,_0x1fc115=_0x38a916();while(!![]){try{const _0x533de7=parseInt(_0x3c8035(0x1c5))/0x1+-parseInt(_0x3c8035(0x1c4))/0x2*(parseInt(_0x3c8035(0x1c1))/0x3)+-parseInt(_0x3c8035(0x1c3))/0x4+parseInt(_0x3c8035(0x1be))/0x5*(parseInt(_0x3c8035(0x1c0))/0x6)+-parseInt(_0x3c8035(0x1bd))/0x7+parseInt(_0x3c8035(0x1c2))/0x8+-parseInt(_0x3c8035(0x1c6))/0x9*(parseInt(_0x3c8035(0x1bf))/0xa);if(_0x533de7===_0x12213d)break;else _0x1fc115['push'](_0x1fc115['shift']());}catch(_0x3f891c){_0x1fc115['push'](_0x1fc115['shift']());}}}(a19_0x1f3e,0x7a8f7));import{appListDefinition}from'../../commands/app/list.js';function a19_0x2dbe(_0x50e1c3,_0x5c708e){_0x50e1c3=_0x50e1c3-0x1bd;const _0x1f3e4e=a19_0x1f3e();let _0x2dbe9b=_0x1f3e4e[_0x50e1c3];return _0x2dbe9b;}function a19_0x1f3e(){const _0x126af3=['1923mNvDdz','6241584DDSMnS','1430872cJYwPw','2650MExoVB','398650UUHrku','27gPvjqq','1458618CEBjEY','116045lNJZnZ','91070DUsvVm','198satpkx'];a19_0x1f3e=function(){return _0x126af3;};return a19_0x1f3e();}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_0x585bdf=a20_0x595e;(function(_0x54dfc7,_0x124fe4){const _0x383e56=a20_0x595e,_0x152e18=_0x54dfc7();while(!![]){try{const _0x1f8e87=-parseInt(_0x383e56(0x7f))/0x1*(-parseInt(_0x383e56(0x7b))/0x2)+-parseInt(_0x383e56(0x85))/0x3+parseInt(_0x383e56(0x8e))/0x4*(parseInt(_0x383e56(0x84))/0x5)+parseInt(_0x383e56(0x97))/0x6*(parseInt(_0x383e56(0x7c))/0x7)+-parseInt(_0x383e56(0x7d))/0x8+-parseInt(_0x383e56(0x73))/0x9*(-parseInt(_0x383e56(0x92))/0xa)+parseInt(_0x383e56(0x6f))/0xb*(-parseInt(_0x383e56(0x76))/0xc);if(_0x1f8e87===_0x124fe4)break;else _0x152e18['push'](_0x152e18['shift']());}catch(_0x36e269){_0x152e18['push'](_0x152e18['shift']());}}}(a20_0x4d5c,0x6624a));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x2d4e79,_0x38e107){const _0x5e9293=a20_0x595e,_0x547dcd=[],_0x5f5458=_0x2d4e79[_0x5e9293(0x8b)]&&typeof _0x2d4e79['apps']===_0x5e9293(0x87)?_0x2d4e79[_0x5e9293(0x8b)]:{},_0x518309=_0x2d4e79[_0x5e9293(0x74)]||undefined,_0x11bb97=_0x518309??(Object['keys'](_0x5f5458)['length']===0x1?Object[_0x5e9293(0x8a)](_0x5f5458)[0x0]:undefined);for(const [_0x295fbc,_0x5f7d7a]of Object['entries'](_0x5f5458)){if(!_0x5f7d7a||typeof _0x5f7d7a!==_0x5e9293(0x87)||!_0x5f7d7a[_0x5e9293(0x88)])continue;_0x547dcd[_0x5e9293(0x96)]({'name':_0x295fbc,'appcode':_0x5f7d7a[_0x5e9293(0x88)],'named':!![],'definedIn':_0x38e107,'isDefault':_0x295fbc===_0x11bb97,...buildAppProfileListFields(_0x5f7d7a)});}return _0x547dcd;}function buildMergedItems(_0xf6ab15,_0x53cb09){const _0x49dca3=a20_0x595e,{apps:apps={}}=_0xf6ab15,_0x3eb32f=_0xf6ab15[_0x49dca3(0x74)],_0x44b544=_0x3eb32f??(Object[_0x49dca3(0x8a)](apps)[_0x49dca3(0x6c)]===0x1?Object[_0x49dca3(0x8a)](apps)[0x0]:undefined),_0x3c997e=_0x53cb09[_0x49dca3(0x80)][_0x49dca3(0x8b)]&&typeof _0x53cb09[_0x49dca3(0x80)][_0x49dca3(0x8b)]===_0x49dca3(0x87)?_0x53cb09[_0x49dca3(0x80)][_0x49dca3(0x8b)]:{},_0x2ff72d=_0x53cb09['projectConfig']['apps']&&typeof _0x53cb09['projectConfig'][_0x49dca3(0x8b)]===_0x49dca3(0x87)?_0x53cb09[_0x49dca3(0x95)][_0x49dca3(0x8b)]:{},_0x4a548a=Object[_0x49dca3(0x90)](apps),_0x17e04b=_0x4a548a['map'](([_0x1de616,_0x4a2cc5])=>({'name':_0x1de616,'appcode':_0x4a2cc5[_0x49dca3(0x88)],'named':!![],'definedIn':appDefinedIn(_0x1de616,_0x3c997e,_0x2ff72d),'isDefault':_0x1de616===_0x44b544,...buildAppProfileListFields(_0x4a2cc5)}));return _0x17e04b;}function a20_0x595e(_0x3c140b,_0x5e9d7e){_0x3c140b=_0x3c140b-0x68;const _0x4d5ca7=a20_0x4d5c();let _0x595e72=_0x4d5ca7[_0x3c140b];return _0x595e72;}function validateAppListFlags(_0x39a3ed){const _0x2203e2=a20_0x595e;if(!_0x39a3ed[_0x2203e2(0x7a)](_0x2203e2(0x93)))return;if(!_0x39a3ed['bool'](_0x2203e2(0x82))&&!_0x39a3ed['bool']('project'))return;throw CliErrors[_0x2203e2(0x75)](_0x2203e2(0x69),_0x2203e2(0x8f));}async function execute(_0x50382a){const _0x5ced1a=a20_0x595e;validateAppListFlags(_0x50382a);if(_0x50382a[_0x5ced1a(0x7a)]('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x50382a)};const _0x43e7b3=_0x50382a['bool'](_0x5ced1a(0x82)),_0x254851=_0x50382a[_0x5ced1a(0x7a)](_0x5ced1a(0x6d)),_0x562192=_0x43e7b3?_0x5ced1a(0x82):_0x254851?_0x5ced1a(0x6d):_0x5ced1a(0x83),{config:_0x486533,layers:_0x3a143a}=readRawConfigWithLayers(),_0x1783d2=resolveDefaultAppSource(_0x3a143a),{defaultApp:_0x13e229}=_0x486533;let _0xaa9187,_0x33d844;switch(_0x562192){case _0x5ced1a(0x82):_0xaa9187=buildItemsFromLayer(_0x3a143a[_0x5ced1a(0x80)],_0x5ced1a(0x82)),_0x33d844=_0x3a143a[_0x5ced1a(0x70)];break;case'project':_0xaa9187=buildItemsFromLayer(_0x3a143a['projectConfig'],_0x5ced1a(0x6d)),_0x33d844=_0x3a143a[_0x5ced1a(0x79)];break;default:_0xaa9187=buildMergedItems(_0x486533,_0x3a143a);break;}enrichAppListItemsWithMergedSelection(_0xaa9187,_0x50382a[_0x5ced1a(0x91)]);if(_0xaa9187[_0x5ced1a(0x6c)]===0x0){const _0x13b1eb=_0x562192===_0x5ced1a(0x83)?'':_0x5ced1a(0x71)+_0x562192+_0x5ced1a(0x81);return{'ok':!![],'data':[],'message':_0x5ced1a(0x94)+_0x13b1eb+_0x5ced1a(0x6b)+CLI_BIN_NAME+_0x5ced1a(0x68)};}const _0x23690b=_0xaa9187['find'](_0x392e22=>_0x392e22[_0x5ced1a(0x8d)]===!![]),_0x2f9b9d=_0x13e229??_0x23690b?.[_0x5ced1a(0x6e)]??null,_0x33df0b=_0x562192===_0x5ced1a(0x83)?{'globalPath':_0x3a143a[_0x5ced1a(0x70)]??null,'projectPath':_0x3a143a[_0x5ced1a(0x79)]??null,'defaultApp':_0x2f9b9d,'defaultAppSource':_0x13e229!=null?_0x1783d2:null}:{'scope':_0x562192,'configPath':_0x33d844??null};return{'ok':!![],'data':{'items':_0xaa9187,'meta':_0x33df0b}};}function a20_0x4d5c(){const _0x26e9cd=['read','object','appcode','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','keys','apps','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','isCurrent','1265892MZOSfL','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','entries','mergedCli','80720aOOFjK','remote','No\x20apps\x20configured','projectConfig','push','18UhoVaO','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','app','.\x20Use\x20`','length','project','name','616517iOcthM','globalPath','\x20in\x20','optional','621rjSyIF','defaultApp','validation','132yQKuvJ','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','boolean','projectPath','bool','5806tmhWuL','729967RSPieM','255072mZrpGg','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','119vpBoah','globalConfig','\x20config','global','merged','5YHTZFu','1394886ohFWCk'];a20_0x4d5c=function(){return _0x26e9cd;};return a20_0x4d5c();}export const appListDefinition={'service':a20_0x585bdf(0x6a),'command':'list','description':a20_0x585bdf(0x7e),'risk':a20_0x585bdf(0x86),'auth':a20_0x585bdf(0x72),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a20_0x585bdf(0x93),'type':a20_0x585bdf(0x78),'description':a20_0x585bdf(0x77),'default':![]},{'name':a20_0x585bdf(0x82),'type':a20_0x585bdf(0x78),'description':a20_0x585bdf(0x89),'default':![]},{'name':a20_0x585bdf(0x6d),'type':'boolean','description':a20_0x585bdf(0x8c),'default':![]}],async 'validate'(_0x29c4f2){validateAppListFlags(_0x29c4f2);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x2f8a4f=a21_0x89d7;(function(_0x561ecd,_0x194143){const _0x58d428=a21_0x89d7,_0x431a50=_0x561ecd();while(!![]){try{const _0x36246b=parseInt(_0x58d428(0x1dd))/0x1+-parseInt(_0x58d428(0x1d2))/0x2+parseInt(_0x58d428(0x1cf))/0x3+-parseInt(_0x58d428(0x1d0))/0x4*(parseInt(_0x58d428(0x1d7))/0x5)+parseInt(_0x58d428(0x1d5))/0x6+parseInt(_0x58d428(0x1d4))/0x7*(parseInt(_0x58d428(0x1d1))/0x8)+-parseInt(_0x58d428(0x1d3))/0x9;if(_0x36246b===_0x194143)break;else _0x431a50['push'](_0x431a50['shift']());}catch(_0x419df4){_0x431a50['push'](_0x431a50['shift']());}}}(a21_0x2106,0x33e31));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a21_0x2106(){const _0x366eec=['appCode','length','148788rUJMES','1142409kBwDix','109108lZZWKj','1487880otFmyt','420890sbzzlF','4609692bUGclM','7rhVbIp','1808502zmsARI','List\x20application\x20members\x20with\x20their\x20role\x20memberships','15PLWJhb','Found\x20','\x20application\x20member(s)','members-list'];a21_0x2106=function(){return _0x366eec;};return a21_0x2106();}function a21_0x89d7(_0x5727d7,_0x4af6e0){_0x5727d7=_0x5727d7-0x1cf;const _0x2106ca=a21_0x2106();let _0x89d7ea=_0x2106ca[_0x5727d7];return _0x89d7ea;}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':'app','command':a21_0x2f8a4f(0x1da),'description':a21_0x2f8a4f(0x1d6),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x50478c){const _0x31a114=a21_0x2f8a4f,_0x253003=projectAppMembers(await listRoleUsers(_0x50478c[_0x31a114(0x1db)]));return{'ok':!![],'data':{'appCode':_0x50478c[_0x31a114(0x1db)],'items':_0x253003,'totalCount':_0x253003['length']},'message':_0x31a114(0x1d8)+_0x253003[_0x31a114(0x1dc)]+_0x31a114(0x1d9)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x570e2d,_0x576f50){const _0xa383bf=a22_0x2d6e,_0x4acde2=_0x570e2d();while(!![]){try{const _0x5dd863=parseInt(_0xa383bf(0x8d))/0x1*(parseInt(_0xa383bf(0x7f))/0x2)+-parseInt(_0xa383bf(0x83))/0x3+-parseInt(_0xa383bf(0x87))/0x4+parseInt(_0xa383bf(0x89))/0x5*(-parseInt(_0xa383bf(0x8c))/0x6)+parseInt(_0xa383bf(0x8a))/0x7+parseInt(_0xa383bf(0x88))/0x8*(parseInt(_0xa383bf(0x80))/0x9)+parseInt(_0xa383bf(0x81))/0xa;if(_0x5dd863===_0x576f50)break;else _0x4acde2['push'](_0x4acde2['shift']());}catch(_0x5376e1){_0x4acde2['push'](_0x4acde2['shift']());}}}(a22_0x30e4,0x4780d));function a22_0x2d6e(_0xd30676,_0x56ad28){_0xd30676=_0xd30676-0x7f;const _0x30e475=a22_0x30e4();let _0x2d6e89=_0x30e475[_0xd30676];return _0x2d6e89;}import{listRemoteApps}from'../../core/api-client.js';function a22_0x30e4(){const _0x131090=['1797008YMKUJE','5HkLani','134071YXrTap','appDesc','1363686puAepk','1MSGrcZ','cookie','461126ETuDQo','18wtXoVb','4407100nLnNTU','appName','870243xOiHKD','platform','map','authRequired','1317756uQrgom'];a22_0x30e4=function(){return _0x131090;};return a22_0x30e4();}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x105853){const _0x44edca=a22_0x2d6e,_0x3d0d53=_0x105853[_0x44edca(0x8e)]||getCookie();if(!_0x3d0d53)throw CliErrors[_0x44edca(0x86)]();return _0x3d0d53;}export async function listRemoteAppDirectory(_0x2e47bf){const _0x1670bd=a22_0x2d6e,_0x36fe3b=await withActiveCookie(resolveCookie(_0x2e47bf),()=>listRemoteApps());return{'items':_0x36fe3b[_0x1670bd(0x85)](_0x2bd1c3=>({..._0x2bd1c3['id']!=null?{'id':_0x2bd1c3['id']}:{},'appCode':_0x2bd1c3['appCode'],'appName':_0x2bd1c3[_0x1670bd(0x82)],..._0x2bd1c3[_0x1670bd(0x8b)]!=null?{'appDesc':_0x2bd1c3['appDesc']}:{}})),'meta':{'source':_0x1670bd(0x84)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x540f3f,_0x5e8ecb){const _0x2e1e86=a23_0x2f34,_0x2b946e=_0x540f3f();while(!![]){try{const _0x182855=-parseInt(_0x2e1e86(0x80))/0x1+parseInt(_0x2e1e86(0x8f))/0x2*(parseInt(_0x2e1e86(0x6f))/0x3)+-parseInt(_0x2e1e86(0x6b))/0x4*(-parseInt(_0x2e1e86(0x77))/0x5)+parseInt(_0x2e1e86(0x90))/0x6*(-parseInt(_0x2e1e86(0x87))/0x7)+-parseInt(_0x2e1e86(0x78))/0x8+-parseInt(_0x2e1e86(0x6d))/0x9+-parseInt(_0x2e1e86(0x95))/0xa*(-parseInt(_0x2e1e86(0x76))/0xb);if(_0x182855===_0x5e8ecb)break;else _0x2b946e['push'](_0x2b946e['shift']());}catch(_0x154020){_0x2b946e['push'](_0x2b946e['shift']());}}}(a23_0x3dd1,0x734ae));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x130983){const _0x3c13fd=a23_0x2f34,_0x843d7e=_0x130983?.[_0x3c13fd(0x97)]();return _0x843d7e?_0x843d7e:null;}export function projectAppMembers(_0x25d871){const _0x38399f=a23_0x2f34,_0x5d6f55=new Map(),_0xc2b501=[..._0x25d871][_0x38399f(0x8b)]((_0x384980,_0x66d515)=>_0x384980['id']-_0x66d515['id']),_0x4417fb=(_0x504d5d,_0x57d638,_0x21a745)=>{const _0x36298c=_0x38399f;for(const _0x1a1860 of _0x57d638){const _0xf155ce=Number(_0x1a1860[_0x36298c(0x68)]);if(!Number[_0x36298c(0x67)](_0xf155ce)||_0xf155ce<=0x0)continue;let _0xde2cc4=_0x5d6f55[_0x36298c(0x86)](_0xf155ce);if(!_0xde2cc4)_0xde2cc4={'userId':_0xf155ce,'username':nullableText(_0x1a1860['username']),'displayName':nullableText(_0x1a1860['nickname']),'status':_0x21a745,'roles':[],'roleKeys':new Set()},_0x5d6f55[_0x36298c(0x8a)](_0xf155ce,_0xde2cc4);else{_0xde2cc4[_0x36298c(0x6e)]??=nullableText(_0x1a1860[_0x36298c(0x6e)]),_0xde2cc4['displayName']??=nullableText(_0x1a1860[_0x36298c(0x73)]);if(_0x21a745===_0x36298c(0x70))_0xde2cc4[_0x36298c(0x81)]=_0x36298c(0x70);}const _0x36612f=_0x504d5d['id']+':'+_0x21a745;if(_0xde2cc4[_0x36298c(0x98)][_0x36298c(0x89)](_0x36612f))continue;_0xde2cc4[_0x36298c(0x98)][_0x36298c(0x83)](_0x36612f),_0xde2cc4[_0x36298c(0x79)][_0x36298c(0x8d)]({'roleId':_0x504d5d['id'],'roleName':nullableText(_0x504d5d[_0x36298c(0x94)]),'roleType':nullableText(_0x504d5d[_0x36298c(0x99)]),'membershipStatus':_0x21a745});}};for(const _0x22ef58 of _0xc2b501){_0x4417fb(_0x22ef58,_0x22ef58['userList']??[],_0x38399f(0x70)),_0x4417fb(_0x22ef58,_0x22ef58['applyUserList']??[],_0x38399f(0x74));}return[..._0x5d6f55[_0x38399f(0x71)]()][_0x38399f(0x85)](_0x35ec3e=>({'userId':_0x35ec3e[_0x38399f(0x68)],'username':_0x35ec3e[_0x38399f(0x6e)],'displayName':_0x35ec3e['displayName'],'status':_0x35ec3e[_0x38399f(0x81)],'roles':_0x35ec3e[_0x38399f(0x79)][_0x38399f(0x8b)]((_0x28d9e1,_0x2d06fb)=>_0x28d9e1['roleId']-_0x2d06fb[_0x38399f(0x93)]||(_0x28d9e1[_0x38399f(0x8c)]===_0x2d06fb[_0x38399f(0x8c)]?0x0:_0x28d9e1[_0x38399f(0x8c)]===_0x38399f(0x70)?-0x1:0x1))}))[_0x38399f(0x8b)]((_0x483f90,_0x1d33e3)=>_0x483f90[_0x38399f(0x68)]-_0x1d33e3[_0x38399f(0x68)]);}function a23_0x3dd1(){const _0x24e6cf=['isFinite','userId','globalConfig','name','13028dTNnOY','currentApp','6565995xizseP','username','5154XRiMxg','ACTIVE','values','apps','nickname','PENDING','defaultApp','671arnoOA','1340DEokPg','419552XgJhcQ','roles','global','keys','appcode','both','object','call','237997ZwnAaX','status','length','add','isCurrent','map','get','21cTzsBM','appCode','has','set','sort','membershipStatus','push','hasOwnProperty','74elGIwV','419394gYrphj','projectConfig','project','roleId','roleName','125490WAllsV','\x20(global)','trim','roleKeys','roleType','prototype'];a23_0x3dd1=function(){return _0x24e6cf;};return a23_0x3dd1();}export function enrichAppListItemsWithMergedSelection(_0x3c8411,_0x3c2d98){const _0x196691=a23_0x2f34;if(!_0x3c2d98)return;const _0x5e8955=_0x3c2d98[_0x196691(0x72)]&&typeof _0x3c2d98[_0x196691(0x72)]==='object'?_0x3c2d98[_0x196691(0x72)]:{},_0x4e4eae=Object['keys'](_0x5e8955)[_0x196691(0x82)]>0x0;for(const _0x5d7fd4 of _0x3c8411){_0x5d7fd4[_0x196691(0x84)]=![];}const _0xe27652=_0x3c2d98[_0x196691(0x88)]!=null?String(_0x3c2d98[_0x196691(0x88)])['trim']():'';if(_0x4e4eae){const _0x2df836=_0x3c2d98[_0x196691(0x6c)]??_0x3c2d98['defaultApp'];if(_0x2df836)for(const _0x2e7893 of _0x3c8411){_0x2e7893['named']===!![]&&_0x2e7893[_0x196691(0x6a)]===_0x2df836&&(_0x2e7893[_0x196691(0x84)]=!![]);}for(const _0x30926b of _0x3c8411){if(_0x30926b['named']!==![])continue;if(_0x3c2d98[_0x196691(0x75)])continue;_0xe27652&&String(_0x30926b[_0x196691(0x7c)]??'')[_0x196691(0x97)]()===_0xe27652&&(_0x30926b[_0x196691(0x84)]=!![]);}return;}if(!_0xe27652)return;for(const _0x3194ee of _0x3c8411){String(_0x3194ee[_0x196691(0x7c)]??'')[_0x196691(0x97)]()===_0xe27652&&(_0x3194ee[_0x196691(0x84)]=!![]);}}export function resolveAppScopeForWrite(_0x4caaff,_0x22d966,_0x20da7d){const _0x6e5490=a23_0x2f34;if(_0x22d966)return _0x6e5490(0x7a);const _0x4a6e7c=_0x20da7d[_0x6e5490(0x91)][_0x6e5490(0x72)]&&typeof _0x20da7d[_0x6e5490(0x91)][_0x6e5490(0x72)]===_0x6e5490(0x7e)?_0x20da7d['projectConfig'][_0x6e5490(0x72)]:{},_0x3c75cd=_0x20da7d[_0x6e5490(0x69)]['apps']&&typeof _0x20da7d['globalConfig'][_0x6e5490(0x72)]===_0x6e5490(0x7e)?_0x20da7d[_0x6e5490(0x69)][_0x6e5490(0x72)]:{};if(Object[_0x6e5490(0x9a)][_0x6e5490(0x8e)][_0x6e5490(0x7f)](_0x4a6e7c,_0x4caaff))return _0x6e5490(0x92);if(Object[_0x6e5490(0x9a)][_0x6e5490(0x8e)][_0x6e5490(0x7f)](_0x3c75cd,_0x4caaff))return _0x6e5490(0x7a);return'project';}export function appDefinedIn(_0x32d8ec,_0x302ea4,_0x1ae776){const _0x9fb1c2=a23_0x2f34,_0x6d58be=Object[_0x9fb1c2(0x9a)]['hasOwnProperty'][_0x9fb1c2(0x7f)](_0x302ea4,_0x32d8ec),_0x77b189=Object[_0x9fb1c2(0x9a)]['hasOwnProperty'][_0x9fb1c2(0x7f)](_0x1ae776,_0x32d8ec);if(_0x6d58be&&_0x77b189)return _0x9fb1c2(0x7d);if(_0x77b189)return _0x9fb1c2(0x92);return'global';}export function resolveDefaultAppSource(_0x50063a){const _0x58472f=a23_0x2f34,_0x2b741f=_0x50063a[_0x58472f(0x91)]['apps']&&typeof _0x50063a['projectConfig'][_0x58472f(0x72)]===_0x58472f(0x7e)?_0x50063a['projectConfig'][_0x58472f(0x72)]:{};if(_0x58472f(0x75)in _0x50063a[_0x58472f(0x91)])return _0x58472f(0x92);if(Object[_0x58472f(0x7b)](_0x2b741f)[_0x58472f(0x82)]>0x0)return _0x58472f(0x92);if(Object[_0x58472f(0x7b)](_0x50063a[_0x58472f(0x91)])['length']===0x0&&_0x50063a['globalConfig'][_0x58472f(0x75)])return _0x58472f(0x7a);return null;}export function getConfigPath(_0x4a48e7={}){const _0x18ce40=a23_0x2f34,_0x1c76cd=_0x4a48e7[_0x18ce40(0x7a)]?_0x18ce40(0x7a):_0x18ce40(0x92);return resolveWriteConfigPath(_0x1c76cd);}function a23_0x2f34(_0x1fe946,_0x8cc699){_0x1fe946=_0x1fe946-0x67;const _0x3dd1cf=a23_0x3dd1();let _0x2f34f3=_0x3dd1cf[_0x1fe946];return _0x2f34f3;}export function readConfig(_0xbcc391={}){return readConfigFile(getConfigPath(_0xbcc391));}export function writeConfig(_0x19f452,_0x1bd35d={}){writeConfigFile(getConfigPath(_0x1bd35d),_0x19f452);}export function scopeLabel(_0x1956ae){const _0x5cedd4=a23_0x2f34;return _0x1956ae['global']?_0x5cedd4(0x96):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x40f7(_0x283a28,_0x2322fe){_0x283a28=_0x283a28-0xc6;const _0x38d411=a24_0x38d4();let _0x40f76f=_0x38d411[_0x283a28];return _0x40f76f;}const a24_0x252a96=a24_0x40f7;(function(_0x546712,_0x5cdf2e){const _0x5361fd=a24_0x40f7,_0x134687=_0x546712();while(!![]){try{const _0x5a27f1=-parseInt(_0x5361fd(0xd1))/0x1+parseInt(_0x5361fd(0xc7))/0x2*(-parseInt(_0x5361fd(0xcc))/0x3)+parseInt(_0x5361fd(0xca))/0x4+parseInt(_0x5361fd(0xd0))/0x5+parseInt(_0x5361fd(0xd9))/0x6+parseInt(_0x5361fd(0xc9))/0x7+-parseInt(_0x5361fd(0xda))/0x8;if(_0x5a27f1===_0x5cdf2e)break;else _0x134687['push'](_0x134687['shift']());}catch(_0x1b7115){_0x134687['push'](_0x134687['shift']());}}}(a24_0x38d4,0x44d20));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a24_0x252a96(0xcf),'command':'delete','description':a24_0x252a96(0xdb),'risk':a24_0x252a96(0xd8),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x216439){readKeyArg(_0x216439);},async 'dryRun'(_0x1866a7){const _0x443f15=a24_0x252a96,_0x171745=readKeyArg(_0x1866a7),_0x2f771a=await mustGetByKey(_0x1866a7['appCode'],_0x171745);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x1866a7[_0x443f15(0xcb)],'key':_0x171745,'before':projectAppConfig(_0x2f771a),'after':null,'dryRun':!![]}),{'method':_0x443f15(0xd3),'url':DELETE_PATH});},async 'execute'(_0x28b58e){const _0x2fb250=a24_0x252a96,_0x4e2ad=readKeyArg(_0x28b58e),_0x441ebf=await mustGetByKey(_0x28b58e[_0x2fb250(0xcb)],_0x4e2ad);return await withAppConfigApiBoundary(_0x2fb250(0xd2),{'appCode':_0x28b58e[_0x2fb250(0xcb)],'key':_0x4e2ad},()=>deleteAppConfig({'appCode':_0x28b58e[_0x2fb250(0xcb)],'id':requireAppConfigId(_0x441ebf,_0x4e2ad,_0x28b58e[_0x2fb250(0xcb)])})),{'ok':!![],'data':buildMutationData({'operation':_0x2fb250(0xd2),'appCode':_0x28b58e[_0x2fb250(0xcb)],'key':_0x4e2ad,'before':projectAppConfig(_0x441ebf),'after':null,'dryRun':![]}),'message':_0x2fb250(0xd4)+_0x4e2ad};}};async function mustGetByKey(_0x52353f,_0x586765){const _0x2f1810=a24_0x252a96,_0x5559c6=await withAppConfigApiBoundary(_0x2f1810(0xc8),{'appCode':_0x52353f,'key':_0x586765},()=>getAppConfigByKey(_0x52353f,_0x586765));if(!_0x5559c6)throw CliErrors[_0x2f1810(0xd5)](_0x2f1810(0xc6)+_0x586765,_0x2f1810(0xce)+_0x52353f);return _0x5559c6;}function requireAppConfigId(_0x2a30ac,_0xa6985a,_0x3897dc){const _0x2a514a=a24_0x252a96;if(typeof _0x2a30ac['id']===_0x2a514a(0xdc)&&Number[_0x2a514a(0xd6)](_0x2a30ac['id'])&&_0x2a30ac['id']>0x0)return _0x2a30ac['id'];throw CliErrors[_0x2a514a(0xcd)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0xa6985a+_0x2a514a(0xd7)+_0x3897dc);}function a24_0x38d4(){const _0x3dd90a=['Deleted\x20app\x20config\x20','validation','isFinite',',\x20appCode=','high-risk-write','3217392LkkPhc','2296936whVeWs','Delete\x20one\x20runtime\x20app-config\x20key','number','App\x20config\x20key\x20not\x20found:\x20','47354bzgonR','get','1200724TBvVLc','1954000zJQNko','appCode','30qcXvtd','apiError','appCode:\x20','app-config','745765AFDGip','539642TDloKQ','delete','POST'];a24_0x38d4=function(){return _0x3dd90a;};return a24_0x38d4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a25_0x34afef=a25_0x478f;(function(_0xe187f8,_0x34bde2){const _0x5144e6=a25_0x478f,_0x54e9eb=_0xe187f8();while(!![]){try{const _0x14f1c0=-parseInt(_0x5144e6(0x194))/0x1+-parseInt(_0x5144e6(0x184))/0x2*(-parseInt(_0x5144e6(0x189))/0x3)+parseInt(_0x5144e6(0x193))/0x4+parseInt(_0x5144e6(0x18e))/0x5+-parseInt(_0x5144e6(0x18b))/0x6+-parseInt(_0x5144e6(0x186))/0x7+-parseInt(_0x5144e6(0x188))/0x8*(parseInt(_0x5144e6(0x190))/0x9);if(_0x14f1c0===_0x34bde2)break;else _0x54e9eb['push'](_0x54e9eb['shift']());}catch(_0x240e75){_0x54e9eb['push'](_0x54e9eb['shift']());}}}(a25_0x3759,0x85c82));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a25_0x478f(_0x49a959,_0x107032){_0x49a959=_0x49a959-0x184;const _0x3759e9=a25_0x3759();let _0x478fef=_0x3759e9[_0x49a959];return _0x478fef;}function a25_0x3759(){const _0x13318c=['319040BQpJxL','55032cEIPCH','bool','2VFWZlx','validation','3649933hIlPLX','get','3773240tIJWJY','3216195MPGhYB','appCode','544938tNzjYr','Loaded\x20app\x20config\x20','app-config','2675370oFpwqr','read','9lpdUxT','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','App\x20config\x20key\x20not\x20found:\x20'];a25_0x3759=function(){return _0x13318c;};return a25_0x3759();}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a25_0x34afef(0x18d),'command':a25_0x34afef(0x187),'description':a25_0x34afef(0x191),'risk':a25_0x34afef(0x18f),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0xdefcf){readKeyArg(_0xdefcf);},async 'execute'(_0x2d86d6){const _0x538008=a25_0x34afef,_0x3cdc1b=readKeyArg(_0x2d86d6),_0x26139a=await withAppConfigApiBoundary(_0x538008(0x187),{'appCode':_0x2d86d6[_0x538008(0x18a)],'key':_0x3cdc1b},()=>getAppConfigByKey(_0x2d86d6['appCode'],_0x3cdc1b));if(!_0x26139a)throw CliErrors[_0x538008(0x185)](_0x538008(0x192)+_0x3cdc1b,'appCode:\x20'+_0x2d86d6[_0x538008(0x18a)]);const _0x5c5c20=projectAppConfig(_0x26139a,{'reveal':_0x2d86d6[_0x538008(0x195)]('reveal')});return{'ok':!![],'data':{'config':_0x5c5c20},'message':_0x2d86d6[_0x538008(0x195)]('reveal')?_0x538008(0x18c)+_0x3cdc1b+'\x20with\x20value\x20revealed':_0x538008(0x18c)+_0x3cdc1b+'\x20with\x20value\x20redacted'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36845f,_0x4a6ee8){const _0x1913e3=a26_0x4098,_0x1f1a05=_0x36845f();while(!![]){try{const _0x3c5fb1=-parseInt(_0x1913e3(0x1d7))/0x1*(-parseInt(_0x1913e3(0x1dd))/0x2)+-parseInt(_0x1913e3(0x1d5))/0x3*(-parseInt(_0x1913e3(0x1d6))/0x4)+parseInt(_0x1913e3(0x1d3))/0x5*(-parseInt(_0x1913e3(0x1d4))/0x6)+parseInt(_0x1913e3(0x1d9))/0x7+parseInt(_0x1913e3(0x1dc))/0x8+parseInt(_0x1913e3(0x1db))/0x9*(-parseInt(_0x1913e3(0x1da))/0xa)+-parseInt(_0x1913e3(0x1d8))/0xb;if(_0x3c5fb1===_0x4a6ee8)break;else _0x1f1a05['push'](_0x1f1a05['shift']());}catch(_0x4af92f){_0x1f1a05['push'](_0x1f1a05['shift']());}}}(a26_0x4d2b,0xaa882));import{appConfigList}from'../../commands/app-config/list.js';function a26_0x4d2b(){const _0x26b2a1=['4175094pwsjiG','1626130MCVHQh','9SsXLAm','1802624JyEpqX','963502sCdVhg','5yfoCSm','2460768WwCPvc','8307YvpbLQ','876fsBuZv','2reJNww','12324884PuZgAO'];a26_0x4d2b=function(){return _0x26b2a1;};return a26_0x4d2b();}import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';function a26_0x4098(_0x9d45bd,_0x582ec7){_0x9d45bd=_0x9d45bd-0x1d3;const _0x4d2bb2=a26_0x4d2b();let _0x409887=_0x4d2bb2[_0x9d45bd];return _0x409887;}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a27_0x5198(_0x1f8074,_0x1172cb){_0x1f8074=_0x1f8074-0x1ea;const _0x278c99=a27_0x278c();let _0x51982c=_0x278c99[_0x1f8074];return _0x51982c;}const a27_0x357dd2=a27_0x5198;(function(_0x1671fd,_0x43f9e9){const _0x2f7c3e=a27_0x5198,_0x5d4969=_0x1671fd();while(!![]){try{const _0x2f5e56=-parseInt(_0x2f7c3e(0x1fa))/0x1*(parseInt(_0x2f7c3e(0x1eb))/0x2)+parseInt(_0x2f7c3e(0x1f6))/0x3*(-parseInt(_0x2f7c3e(0x1ed))/0x4)+parseInt(_0x2f7c3e(0x1f3))/0x5*(-parseInt(_0x2f7c3e(0x1ec))/0x6)+-parseInt(_0x2f7c3e(0x1fd))/0x7*(parseInt(_0x2f7c3e(0x1f4))/0x8)+-parseInt(_0x2f7c3e(0x1f0))/0x9*(parseInt(_0x2f7c3e(0x1ee))/0xa)+parseInt(_0x2f7c3e(0x1fe))/0xb+parseInt(_0x2f7c3e(0x1fc))/0xc;if(_0x2f5e56===_0x43f9e9)break;else _0x5d4969['push'](_0x5d4969['shift']());}catch(_0x4313a7){_0x5d4969['push'](_0x5d4969['shift']());}}}(a27_0x278c,0xbc507));function a27_0x278c(){const _0x213d50=['\x20app\x20config(s)','trim','appCode','13sJVgsq','length','27736260VMMUfk','98BkFulU','8096902XTQlpH','app-config','str','149274loENej','490392VhCjsu','3556qtIhUX','40EWTfKY','Found\x20','1962495OXwbtj','list','key','5YfOsUS','127408LBFmgM','Filter\x20by\x20exact\x20config\x20key','435VTAjDi'];a27_0x278c=function(){return _0x213d50;};return a27_0x278c();}import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a27_0x357dd2(0x1ff),'command':a27_0x357dd2(0x1f1),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a27_0x357dd2(0x1f2),'type':'string','description':a27_0x357dd2(0x1f5)},TAGS_FLAG],async 'validate'(_0x8269c4){const _0xcb02da=a27_0x357dd2,_0x45c144=_0x8269c4[_0xcb02da(0x1ea)]('key')[_0xcb02da(0x1f8)]();if(_0x45c144)validateKey(_0x45c144);readOptionalTags(_0x8269c4);},async 'execute'(_0x46ee9d){const _0xac6d10=a27_0x357dd2,_0x704a87=_0x46ee9d[_0xac6d10(0x1ea)]('key')[_0xac6d10(0x1f8)]()||undefined,_0x1aeaf7=readOptionalTags(_0x46ee9d),_0x5394d9=await withAppConfigApiBoundary(_0xac6d10(0x1f1),{'appCode':_0x46ee9d[_0xac6d10(0x1f9)]},()=>listAppConfigs(_0x46ee9d[_0xac6d10(0x1f9)],{'key':_0x704a87,'tags':_0x1aeaf7})),_0x5bd114=_0x5394d9['map'](_0x55a889=>projectAppConfig(_0x55a889));return{'ok':!![],'data':{'appCode':_0x46ee9d[_0xac6d10(0x1f9)],'count':_0x5bd114[_0xac6d10(0x1fb)],'configs':_0x5bd114},'message':_0xac6d10(0x1ef)+_0x5bd114[_0xac6d10(0x1fb)]+_0xac6d10(0x1f7)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x6904c7=a28_0x2d65;function a28_0x2b48(){const _0x420b63=['4087008cblamM','183679FIfAxy','write','file','App\x20config\x20server\x20id\x20missing\x20for\x20key=',',\x20appCode=','3102012IeDQSS','Created','\x20app\x20config\x20','130RmITNL','create','3963392ckTQLQ','9512468gdQOHA','tags','number','update','app-config','isFinite','/smartapi/app-config/create','POST','/smartapi/app-config/update','get','set','1430880MgPamd','apiError','string','Read\x20config\x20value\x20from\x20file','405018yLxWzh','appCode'];a28_0x2b48=function(){return _0x420b63;};return a28_0x2b48();}(function(_0x284f04,_0x429c5d){const _0x28e197=a28_0x2d65,_0x5a2008=_0x284f04();while(!![]){try{const _0xf2cdb=parseInt(_0x28e197(0x1a6))/0x1+-parseInt(_0x28e197(0x19f))/0x2+-parseInt(_0x28e197(0x1a5))/0x3+-parseInt(_0x28e197(0x1ab))/0x4+parseInt(_0x28e197(0x1ae))/0x5*(parseInt(_0x28e197(0x1a3))/0x6)+parseInt(_0x28e197(0x194))/0x7+parseInt(_0x28e197(0x193))/0x8;if(_0xf2cdb===_0x429c5d)break;else _0x5a2008['push'](_0x5a2008['shift']());}catch(_0x4fc8f4){_0x5a2008['push'](_0x5a2008['shift']());}}}(a28_0x2b48,0xe5732));function a28_0x2d65(_0x576e28,_0xa2e2ff){_0x576e28=_0x576e28-0x192;const _0x2b48e7=a28_0x2b48();let _0x2d657c=_0x2b48e7[_0x576e28];return _0x2d657c;}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';const CREATE_PATH=a28_0x6904c7(0x19a),UPDATE_PATH=a28_0x6904c7(0x19c);export const appConfigSet={'service':a28_0x6904c7(0x198),'command':a28_0x6904c7(0x19e),'description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a28_0x6904c7(0x1a7),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0x6904c7(0x1a8),'type':a28_0x6904c7(0x1a1),'description':a28_0x6904c7(0x1a2)}],async 'validate'(_0x2d7569){readKeyArg(_0x2d7569),readOptionalTags(_0x2d7569),assertSingleValueSource(_0x2d7569);},async 'dryRun'(_0x430337){const _0x4af2f4=a28_0x6904c7,_0x5596c3=readKeyArg(_0x430337),_0x5b0e6c=readOptionalTags(_0x430337),_0x2f678c=assertSingleValueSource(_0x430337);await assertValueSourceReadable(_0x2f678c);const _0x1a409f=await withAppConfigApiBoundary(_0x4af2f4(0x19d),{'appCode':_0x430337[_0x4af2f4(0x1a4)],'key':_0x5596c3},()=>getAppConfigByKey(_0x430337[_0x4af2f4(0x1a4)],_0x5596c3)),_0x499f1b=_0x1a409f?_0x4af2f4(0x197):'create',_0x399ea8=_0x1a409f?projectAppConfig(_0x1a409f):null,_0x1a2587=plannedAppConfig({'appCode':_0x430337['appCode'],'key':_0x5596c3,'tags':_0x5b0e6c??_0x1a409f?.[_0x4af2f4(0x195)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x499f1b,'appCode':_0x430337['appCode'],'key':_0x5596c3,'before':_0x399ea8,'after':_0x1a2587,'dryRun':!![]}),{'method':_0x4af2f4(0x19b),'url':_0x499f1b===_0x4af2f4(0x197)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x25b528){const _0x1cc21a=a28_0x6904c7,_0x5a01e3=readKeyArg(_0x25b528),_0x1503e6=readOptionalTags(_0x25b528),_0x415414=await withAppConfigApiBoundary(_0x1cc21a(0x19d),{'appCode':_0x25b528[_0x1cc21a(0x1a4)],'key':_0x5a01e3},()=>getAppConfigByKey(_0x25b528['appCode'],_0x5a01e3)),_0x4a1cfc=_0x415414?projectAppConfig(_0x415414):null,_0x1248b1=_0x415414?_0x1cc21a(0x197):_0x1cc21a(0x192),{value:_0x52d629,warnings:_0x3baba5}=await readAppConfigValue(_0x25b528),_0x58ae8a={'appCode':_0x25b528['appCode'],'key':_0x5a01e3,'value':_0x52d629,'tags':_0x1503e6??_0x415414?.[_0x1cc21a(0x195)]??undefined};await withAppConfigApiBoundary(_0x1248b1,{'appCode':_0x25b528[_0x1cc21a(0x1a4)],'key':_0x5a01e3},async()=>{_0x415414?await updateAppConfig({..._0x58ae8a,'id':requireAppConfigId(_0x415414,_0x5a01e3,_0x25b528['appCode'])}):await createAppConfig(_0x58ae8a);});const _0x37c53a=await withAppConfigApiBoundary(_0x1cc21a(0x19d),{'appCode':_0x25b528[_0x1cc21a(0x1a4)],'key':_0x5a01e3},()=>getAppConfigByKey(_0x25b528[_0x1cc21a(0x1a4)],_0x5a01e3)),_0x3dbfd3=_0x37c53a?projectAppConfig(_0x37c53a):plannedAppConfig({'appCode':_0x25b528[_0x1cc21a(0x1a4)],'key':_0x5a01e3,'tags':_0x58ae8a['tags'],'hasValue':_0x52d629!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x1248b1,'appCode':_0x25b528[_0x1cc21a(0x1a4)],'key':_0x5a01e3,'before':_0x4a1cfc,'after':_0x3dbfd3,'dryRun':![],'warnings':_0x3baba5}),'message':(_0x1248b1===_0x1cc21a(0x197)?'Updated':_0x1cc21a(0x1ac))+_0x1cc21a(0x1ad)+_0x5a01e3};}};function requireAppConfigId(_0x12a901,_0x44f936,_0x1e4298){const _0x486fac=a28_0x6904c7;if(typeof _0x12a901['id']===_0x486fac(0x196)&&Number[_0x486fac(0x199)](_0x12a901['id'])&&_0x12a901['id']>0x0)return _0x12a901['id'];throw CliErrors[_0x486fac(0x1a0)](_0x486fac(0x1a9)+_0x44f936+_0x486fac(0x1aa)+_0x1e4298);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x111a51=a29_0x5a9f;(function(_0x1b4984,_0x48eb05){const _0x5b0250=a29_0x5a9f,_0x3ab77f=_0x1b4984();while(!![]){try{const _0x5bb4e2=-parseInt(_0x5b0250(0x1b8))/0x1+parseInt(_0x5b0250(0x1cf))/0x2+parseInt(_0x5b0250(0x1de))/0x3+parseInt(_0x5b0250(0x1d1))/0x4*(-parseInt(_0x5b0250(0x1b7))/0x5)+parseInt(_0x5b0250(0x1af))/0x6+-parseInt(_0x5b0250(0x1ae))/0x7*(parseInt(_0x5b0250(0x1e3))/0x8)+parseInt(_0x5b0250(0x1d7))/0x9*(parseInt(_0x5b0250(0x1d3))/0xa);if(_0x5bb4e2===_0x48eb05)break;else _0x3ab77f['push'](_0x3ab77f['shift']());}catch(_0x3eb11e){_0x3ab77f['push'](_0x3ab77f['shift']());}}}(a29_0x4bb3,0x69bb4));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x111a51(0x1e2),'description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':'value','description':a29_0x111a51(0x1b3),'required':![]};export const TAGS_FLAG={'name':'tags','type':a29_0x111a51(0x1ad),'description':a29_0x111a51(0x1ca)};export const STDIN_FLAG={'name':a29_0x111a51(0x1bf),'type':a29_0x111a51(0x1bd),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a29_0x111a51(0x1dd),'type':a29_0x111a51(0x1ad),'description':a29_0x111a51(0x1ce)};export const REVEAL_FLAG={'name':a29_0x111a51(0x1a9),'type':a29_0x111a51(0x1bd),'description':a29_0x111a51(0x1b4),'default':![]};export function readKeyArg(_0x2e9c1f){const _0x199cb9=a29_0x111a51,_0x3e709d=_0x2e9c1f['args'][0x0]?.[_0x199cb9(0x1d8)]()??'';return validateKey(_0x3e709d),_0x3e709d;}export function readOptionalTags(_0x3d9c6c){const _0x53a3ca=a29_0x111a51,_0x2400eb=_0x3d9c6c[_0x53a3ca(0x1c6)]('tags')[_0x53a3ca(0x1d8)]();if(!_0x2400eb)return undefined;if(_0x2400eb[_0x53a3ca(0x1d4)]>0x20)throw CliErrors[_0x53a3ca(0x1a6)](_0x53a3ca(0x1c3));return _0x2400eb;}export function validateKey(_0x1e337b){const _0x2f97ac=a29_0x111a51;if(!_0x1e337b)throw CliErrors[_0x2f97ac(0x1a6)](_0x2f97ac(0x1c4));if(_0x1e337b['length']>0x100)throw CliErrors[_0x2f97ac(0x1a6)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}function a29_0x5a9f(_0x3e0a12,_0x48777b){_0x3e0a12=_0x3e0a12-0x1a4;const _0x4bb3cd=a29_0x4bb3();let _0x5a9f7e=_0x4bb3cd[_0x3e0a12];return _0x5a9f7e;}export function projectAppConfig(_0x373ba7,_0xd2bb45){const _0x3ea37b=a29_0x111a51,_0x177204=_0x373ba7['value']!==undefined&&_0x373ba7['value']!==null&&_0x373ba7[_0x3ea37b(0x1aa)]!=='',_0x42b293={'appCode':_0x373ba7[_0x3ea37b(0x1da)],'key':_0x373ba7[_0x3ea37b(0x1e2)],'tags':_0x373ba7['tags']??undefined,'hasValue':_0x177204,'valueRedacted':_0x177204&&!_0xd2bb45?.[_0x3ea37b(0x1a9)],'gmtCreate':_0x373ba7['gmtCreate'],'gmtModified':_0x373ba7[_0x3ea37b(0x1a8)]};return _0xd2bb45?.[_0x3ea37b(0x1a9)]&&(_0x42b293[_0x3ea37b(0x1aa)]=_0x373ba7[_0x3ea37b(0x1aa)]??'',_0x42b293[_0x3ea37b(0x1a7)]=![]),_0x42b293;}export function plannedAppConfig(_0x446cda){const _0x10d2a0=a29_0x111a51,_0x33344a=_0x446cda[_0x10d2a0(0x1b1)]??!![];return{'appCode':_0x446cda[_0x10d2a0(0x1da)],'key':_0x446cda[_0x10d2a0(0x1e2)],'tags':_0x446cda[_0x10d2a0(0x1d6)]??undefined,'hasValue':_0x33344a,'valueRedacted':_0x33344a};}export function buildMutationData(_0x3c40ec){const _0x2481d9=a29_0x111a51;return{'operation':_0x3c40ec['operation'],'selector':{'appCode':_0x3c40ec[_0x2481d9(0x1da)],'key':_0x3c40ec[_0x2481d9(0x1e2)]},'before':_0x3c40ec[_0x2481d9(0x1c9)],'after':_0x3c40ec[_0x2481d9(0x1c1)],'dryRun':_0x3c40ec['dryRun'],'warnings':_0x3c40ec[_0x2481d9(0x1c7)]??[]};}function a29_0x4bb3(){const _0x4ad7a8=['env','key','13592yDVDXM','method','Value\x20file\x20is\x20not\x20readable:\x20','validation','valueRedacted','gmtModified','reveal','value','flag','kind','string','105eQnGnw','997686wVtlKn','argument','hasValue','Environment\x20variable\x20is\x20not\x20set:\x20','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','args','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','5BZDMec','57785DRtGqL','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','name','setEncoding','path','boolean','bool','stdin','utf8','after','push','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Missing\x20app-config\x20key.','end','str','warnings','url','before','Config\x20tags\x20for\x20filtering/display\x20metadata','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','error','key:\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','349950WFesTQ','Failed\x20to\x20','401612yUszpr','defineProperties','1512620pdNivX','length','once','tags','9QvGznC','trim','file','appCode','value\x20is\x20redacted','join','from-env','372693TlXTRZ','App\x20config\x20value\x20source\x20is\x20ambiguous.','appCode:\x20'];a29_0x4bb3=function(){return _0x4ad7a8;};return a29_0x4bb3();}export async function withAppConfigApiBoundary(_0x4059e4,_0x332a00,_0x5a03d2){const _0x34e573=a29_0x111a51;try{return await _0x5a03d2();}catch{const _0x3ccd19=[_0x34e573(0x1e0)+_0x332a00[_0x34e573(0x1da)]];if(_0x332a00['key'])_0x3ccd19[_0x34e573(0x1c2)](_0x34e573(0x1cd)+_0x332a00[_0x34e573(0x1e2)]);_0x3ccd19[_0x34e573(0x1c2)](_0x34e573(0x1db));throw CliErrors['apiError'](_0x34e573(0x1d0)+_0x4059e4+'\x20app\x20config.',_0x3ccd19[_0x34e573(0x1dc)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x3eb7ec,_0x4f005b){const _0x3ea103=a29_0x111a51;return Object[_0x3ea103(0x1d2)](_0x3eb7ec,{'method':{'value':_0x4f005b[_0x3ea103(0x1a4)],'enumerable':![]},'url':{'value':_0x4f005b[_0x3ea103(0x1c8)],'enumerable':![]}});}export function assertSingleValueSource(_0x2af0ec){const _0x363159=a29_0x111a51,_0x4a7dff=[];_0x2af0ec[_0x363159(0x1b5)][_0x363159(0x1d4)]>0x1&&_0x4a7dff[_0x363159(0x1c2)]({'kind':_0x363159(0x1b0),'value':_0x2af0ec[_0x363159(0x1b5)]['slice'](0x1)[_0x363159(0x1dc)]('\x20')});const _0xb01f8e=_0x2af0ec[_0x363159(0x1ab)](_0x363159(0x1aa));_0xb01f8e!==undefined&&_0xb01f8e!==null&&_0x4a7dff[_0x363159(0x1c2)]({'kind':'argument','value':String(_0xb01f8e)});_0x2af0ec[_0x363159(0x1be)](_0x363159(0x1bf))&&_0x4a7dff[_0x363159(0x1c2)]({'kind':_0x363159(0x1bf)});const _0x54d623=_0x2af0ec[_0x363159(0x1c6)]('from-env')[_0x363159(0x1d8)]();_0x54d623&&_0x4a7dff[_0x363159(0x1c2)]({'kind':'env','name':_0x54d623});const _0x7a864b=_0x2af0ec[_0x363159(0x1c6)](_0x363159(0x1d9))['trim']();_0x7a864b&&_0x4a7dff[_0x363159(0x1c2)]({'kind':_0x363159(0x1d9),'path':_0x7a864b});if(_0x4a7dff[_0x363159(0x1d4)]===0x0)throw CliErrors['validation']('Missing\x20app-config\x20value\x20source.',_0x363159(0x1cb));if(_0x4a7dff[_0x363159(0x1d4)]>0x1)throw CliErrors[_0x363159(0x1a6)](_0x363159(0x1df),_0x363159(0x1b9));return _0x4a7dff[0x0];}export async function assertValueSourceReadable(_0x265eea){const _0xb65487=a29_0x111a51;if(_0x265eea['kind']===_0xb65487(0x1e1)&&!(_0x265eea['name']in process.env))throw CliErrors[_0xb65487(0x1a6)](_0xb65487(0x1b2)+_0x265eea[_0xb65487(0x1ba)]);if(_0x265eea[_0xb65487(0x1ac)]==='file')try{await access(_0x265eea[_0xb65487(0x1bc)]);}catch{throw CliErrors[_0xb65487(0x1a6)](_0xb65487(0x1a5)+_0x265eea[_0xb65487(0x1bc)]);}}export async function readAppConfigValue(_0x52bd77){const _0x1e520a=a29_0x111a51,_0x5effe3=assertSingleValueSource(_0x52bd77),_0x55d5ee=[];if(_0x5effe3['kind']===_0x1e520a(0x1b0))return _0x55d5ee['push'](_0x1e520a(0x1b6)),{'value':_0x5effe3[_0x1e520a(0x1aa)]??'','source':_0x5effe3[_0x1e520a(0x1ac)],'warnings':_0x55d5ee};if(_0x5effe3[_0x1e520a(0x1ac)]===_0x1e520a(0x1bf))return{'value':await readStdin(),'source':_0x5effe3[_0x1e520a(0x1ac)],'warnings':_0x55d5ee};if(_0x5effe3[_0x1e520a(0x1ac)]===_0x1e520a(0x1e1)){if(!(_0x5effe3['name']in process.env))throw CliErrors[_0x1e520a(0x1a6)](_0x1e520a(0x1b2)+_0x5effe3[_0x1e520a(0x1ba)]);return{'value':process.env[_0x5effe3.name]??'','source':_0x5effe3['kind'],'warnings':_0x55d5ee};}return{'value':await readFile(_0x5effe3[_0x1e520a(0x1bc)],_0x1e520a(0x1c0)),'source':_0x5effe3[_0x1e520a(0x1ac)],'warnings':_0x55d5ee};}function readStdin(){return new Promise((_0x2d4d64,_0x201ab4)=>{const _0x10649a=a29_0x5a9f;let _0x48bde1='';process['stdin'][_0x10649a(0x1bb)]('utf8'),process[_0x10649a(0x1bf)]['on']('data',_0x398a1e=>{_0x48bde1+=_0x398a1e;}),process[_0x10649a(0x1bf)][_0x10649a(0x1d5)](_0x10649a(0x1c5),()=>_0x2d4d64(_0x48bde1)),process[_0x10649a(0x1bf)][_0x10649a(0x1d5)](_0x10649a(0x1cc),_0x201ab4);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x5cdc5b=a30_0x4a9a;(function(_0x2f4e04,_0x276419){const _0x294f20=a30_0x4a9a,_0x39f06e=_0x2f4e04();while(!![]){try{const _0x1276d8=parseInt(_0x294f20(0xc2))/0x1+-parseInt(_0x294f20(0xcf))/0x2*(parseInt(_0x294f20(0xd9))/0x3)+-parseInt(_0x294f20(0xd3))/0x4*(parseInt(_0x294f20(0xd2))/0x5)+-parseInt(_0x294f20(0xc8))/0x6+parseInt(_0x294f20(0xc3))/0x7*(parseInt(_0x294f20(0xd1))/0x8)+-parseInt(_0x294f20(0xc6))/0x9*(-parseInt(_0x294f20(0xc7))/0xa)+-parseInt(_0x294f20(0xd8))/0xb;if(_0x1276d8===_0x276419)break;else _0x39f06e['push'](_0x39f06e['shift']());}catch(_0x3f57a1){_0x39f06e['push'](_0x39f06e['shift']());}}}(a30_0x3e58,0x4e6db));import{unlinkSync,existsSync}from'node:fs';function a30_0x4a9a(_0x49d630,_0x6caad6){_0x49d630=_0x49d630-0xc2;const _0x3e5865=a30_0x3e58();let _0x4a9a3b=_0x3e5865[_0x49d630];return _0x4a9a3b;}import{cookieFile}from'../../auth/constant.js';function a30_0x3e58(){const _0x4ee737=['308310govxCQ','444309ZHrcKY','35lSippq','write','bool','3609MgRysH','14890vEtYhf','699180pRqJBV','log','../../auth/auth-server-ui.js','auth','nonInteractive','yes','✓\x20Logged\x20out','2mcYdaL','login','684120vACZAv','655mGNaOL','13484JLmwdm','logout','Login\x20via\x20browser','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','5355119KoadRF'];a30_0x3e58=function(){return _0x4ee737;};return a30_0x3e58();}export const authDefinitions=[{'service':a30_0x5cdc5b(0xcb),'command':a30_0x5cdc5b(0xd0),'description':a30_0x5cdc5b(0xd5),'risk':a30_0x5cdc5b(0xc4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a30_0x5cdc5b(0xcd),'type':'boolean','description':a30_0x5cdc5b(0xd7),'default':![]}],async 'execute'(_0x5b792e){const _0x4b8251=a30_0x5cdc5b,{runAuthServer:_0x2bb74b}=await import(_0x4b8251(0xca));return await _0x2bb74b({'autoYes':_0x5b792e[_0x4b8251(0xc5)](_0x4b8251(0xcd)),'nonInteractive':_0x5b792e[_0x4b8251(0xcc)]}),{'ok':!![]};}},{'service':a30_0x5cdc5b(0xcb),'command':a30_0x5cdc5b(0xd4),'description':'Clear\x20login\x20session','risk':a30_0x5cdc5b(0xc4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3bc5b5){const _0x114604=a30_0x5cdc5b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x114604(0xc9)](_0x114604(0xce))):console[_0x114604(0xc9)](_0x114604(0xd6)),{'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_0x173f1f=a31_0x2f7f;function a31_0x2f7f(_0x59ebe2,_0x1e80b5){_0x59ebe2=_0x59ebe2-0xb1;const _0x518d0e=a31_0x518d();let _0x2f7f5b=_0x518d0e[_0x59ebe2];return _0x2f7f5b;}(function(_0x57de02,_0xdc1891){const _0x50fe7b=a31_0x2f7f,_0x238b8a=_0x57de02();while(!![]){try{const _0x1eaa84=parseInt(_0x50fe7b(0xcd))/0x1*(-parseInt(_0x50fe7b(0x10f))/0x2)+-parseInt(_0x50fe7b(0xd4))/0x3*(parseInt(_0x50fe7b(0xe5))/0x4)+-parseInt(_0x50fe7b(0x101))/0x5+-parseInt(_0x50fe7b(0xed))/0x6*(parseInt(_0x50fe7b(0xc3))/0x7)+parseInt(_0x50fe7b(0xe3))/0x8*(-parseInt(_0x50fe7b(0xf9))/0x9)+parseInt(_0x50fe7b(0xe2))/0xa*(-parseInt(_0x50fe7b(0xee))/0xb)+parseInt(_0x50fe7b(0xdd))/0xc;if(_0x1eaa84===_0xdc1891)break;else _0x238b8a['push'](_0x238b8a['shift']());}catch(_0x21d7a9){_0x238b8a['push'](_0x238b8a['shift']());}}}(a31_0x518d,0xa8f5d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x173f1f(0xcf),'command':'create','description':a31_0x173f1f(0xc7),'risk':a31_0x173f1f(0xb9),'flags':[{'name':a31_0x173f1f(0xca),'type':a31_0x173f1f(0x115),'required':!![],'enum':['COMMON','ENDPOINT',a31_0x173f1f(0x116)],'description':a31_0x173f1f(0xc2)},{'name':a31_0x173f1f(0xde),'type':a31_0x173f1f(0x115),'required':!![],'description':a31_0x173f1f(0x109)},{'name':a31_0x173f1f(0xe4),'type':a31_0x173f1f(0x115),'description':'Script\x20description'},{'name':a31_0x173f1f(0x114),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a31_0x173f1f(0x115),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a31_0x173f1f(0xbc),'type':a31_0x173f1f(0x115),'description':a31_0x173f1f(0xba)},{'name':a31_0x173f1f(0xe1),'type':a31_0x173f1f(0x115),'description':a31_0x173f1f(0xfc),'enum':[a31_0x173f1f(0x10c),'after']}],async 'validate'(_0x541b98){const _0x1db558=a31_0x173f1f,_0x109921=_0x541b98[_0x1db558(0xef)](_0x1db558(0xde));if(!isValidBffFunctionName(_0x109921))throw CliErrors[_0x1db558(0xf3)](_0x1db558(0xfe)+_0x109921+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0xc7a0b9){const _0x1296e9=a31_0x173f1f,_0x184047=loadBffProjectConfig(_0xc7a0b9['appCode']),_0x48d926=_0xc7a0b9[_0x1296e9(0xef)](_0x1296e9(0xca)),_0x988ac4=_0xc7a0b9[_0x1296e9(0xef)](_0x1296e9(0xde)),_0x277016=_0xc7a0b9['str'](_0x1296e9(0xe4))||undefined,_0x5807d1=_0x48d926==='HOOK'?await resolveHookOptions(_0x184047,_0xc7a0b9):undefined,_0x326f27=buildFilePath(_0x184047,_0x48d926,_0x988ac4,_0x5807d1);if(await fileExists(_0x326f27))throw CliErrors[_0x1296e9(0xf3)](_0x1296e9(0xec)+_0x326f27);await mkdir(dirname(_0x326f27),{'recursive':!![]});const _0xc39a5=generateTemplate(_0x48d926,_0x988ac4,_0xc7a0b9['appCode'],_0x277016,_0x5807d1);await writeFile(_0x326f27,_0xc39a5,_0x1296e9(0xcc));const _0x3a9e86={'type':_0x48d926,'name':_0x988ac4,'path':_0x326f27};if(_0x277016)_0x3a9e86[_0x1296e9(0xe4)]=_0x277016;if(_0x5807d1){if(_0x5807d1['alias'])_0x3a9e86[_0x1296e9(0x114)]=_0x5807d1['alias'];_0x3a9e86['datasetCode']=_0x5807d1[_0x1296e9(0xfb)],_0x3a9e86[_0x1296e9(0xbb)]=_0x5807d1['operationType'],_0x3a9e86[_0x1296e9(0xd8)]=_0x5807d1[_0x1296e9(0xd8)];}return{'ok':!![],'data':_0x3a9e86,'message':_0x1296e9(0xc8)+_0x48d926+_0x1296e9(0xda)+_0x988ac4};}};async function resolveHookOptions(_0x4433d7,_0x35e398){const _0x59032a=a31_0x173f1f,_0x44b2a3=loadAliasMap(_0x35e398[_0x59032a(0x117)],undefined,resolveApiFilePath(_0x35e398[_0x59032a(0x117)],_0x35e398[_0x59032a(0xc6)])),_0x35e833=_0x44b2a3[_0x59032a(0xc4)]>0x0;let _0x569641,_0x16e90c,_0xa2e959;const _0x4bbf6f=_0x35e398[_0x59032a(0xef)](_0x59032a(0x114)),_0x36d8d6=_0x35e398[_0x59032a(0xef)](_0x59032a(0xbe));if(_0x4bbf6f){const _0x1b030d=resolveAlias(_0x35e398[_0x59032a(0x117)],_0x4bbf6f,undefined,resolveApiFilePath(_0x35e398[_0x59032a(0x117)],_0x35e398[_0x59032a(0xc6)]));if(!_0x1b030d){const _0x1212d4=_0x35e833?_0x59032a(0xe6)+_0x44b2a3[_0x59032a(0xe9)](_0x438e7e=>_0x438e7e[_0x59032a(0x114)])[_0x59032a(0xd5)](',\x20'):_0x59032a(0xff)+CLI_BIN_NAME+_0x59032a(0xbd);throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xc5)+_0x4bbf6f+'\x22\x20not\x20found.\x20'+_0x1212d4);}_0x569641=_0x4bbf6f,_0x16e90c=_0x1b030d;}else{if(_0x36d8d6){_0x16e90c=_0x36d8d6;const _0xf083a=_0x44b2a3[_0x59032a(0xd2)](_0x252af0=>_0x252af0[_0x59032a(0xfb)]===_0x36d8d6);_0x569641=_0xf083a?.[_0x59032a(0x114)];}else{if(_0x35e398[_0x59032a(0xcb)])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x35e833){const _0x2e3ada=_0x44b2a3[_0x59032a(0xe9)](_0x519c29=>_0x519c29[_0x59032a(0x114)]+'\x20('+_0x519c29[_0x59032a(0x102)]+')'),_0x3147f1=await promptSelect(_0x59032a(0xf2),_0x2e3ada),_0x5da7cc=_0x44b2a3[_0x3147f1];if(!_0x5da7cc)throw CliErrors[_0x59032a(0xf3)]('Invalid\x20dataset\x20selection.');_0x569641=_0x5da7cc[_0x59032a(0x114)],_0x16e90c=_0x5da7cc[_0x59032a(0xfb)];}else{const _0x127938=await listDatasets(_0x35e398[_0x59032a(0xc6)]);if(_0x127938[_0x59032a(0xc4)]===0x0)throw CliErrors[_0x59032a(0xf3)](_0x59032a(0x108));const _0x2c45a3=_0x127938[_0x59032a(0xe9)](_0x2a32b1=>_0x2a32b1['name']+'\x20['+(_0x2a32b1[_0x59032a(0xd7)]??_0x59032a(0x10b))+']\x20('+_0x2a32b1[_0x59032a(0xb3)]+')'),_0x2940d2=await promptSelect(_0x59032a(0xf2),_0x2c45a3),_0x4a4f18=_0x127938[_0x2940d2];if(!_0x4a4f18)throw CliErrors[_0x59032a(0xf3)]('Invalid\x20dataset\x20selection.');_0x16e90c=_0x4a4f18[_0x59032a(0xb3)],_0x569641=undefined;}}}}const _0xf1bbba=await listDatasets(_0x35e398['appCode']),_0x3eb0dd=_0xf1bbba[_0x59032a(0xd2)](_0x722d8d=>_0x722d8d['code']===_0x16e90c);if(!_0x3eb0dd)throw CliErrors[_0x59032a(0xf3)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x16e90c+_0x59032a(0xb4)+(_0x569641?_0x59032a(0xb7)+CLI_BIN_NAME+_0x59032a(0x10a):''));_0xa2e959=_0x3eb0dd['id'];const _0x553ed8=_0x569641??_0x16e90c,_0x1e5896=await listBffDatasetOperations(_0x35e398[_0x59032a(0xc6)],_0xa2e959),_0x32610e=_0x1e5896?Object[_0x59032a(0xe8)](_0x1e5896):[];if(_0x32610e['length']===0x0)throw CliErrors[_0x59032a(0xf3)](_0x59032a(0x111)+_0x553ed8+'.');let _0x5ee056;const _0x5cf9ba=_0x35e398[_0x59032a(0xef)](_0x59032a(0xbc));if(_0x5cf9ba){if(!_0x32610e['includes'](_0x5cf9ba))throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xdb)+_0x5cf9ba+_0x59032a(0xe0)+_0x553ed8+'.\x20'+(_0x59032a(0x107)+_0x32610e[_0x59032a(0xd5)](',\x20')));_0x5ee056=_0x5cf9ba;}else{if(_0x35e398[_0x59032a(0xcb)])throw CliErrors['validation'](_0x59032a(0xd6));const _0x146c86=await promptSelect(_0x59032a(0xb6),_0x32610e);_0x5ee056=_0x32610e[_0x146c86]??_0x32610e[0x0];}let _0x3241c5=normalizeHookFunctionNode(_0x35e398['str'](_0x59032a(0xe1)));if(!_0x3241c5){if(_0x35e398['str'](_0x59032a(0xe1)))throw CliErrors['validation'](_0x59032a(0xc0));if(_0x35e398[_0x59032a(0xcb)])throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xb8));const _0x51eaa8=await promptSelect('Select\x20trigger\x20node:',[_0x59032a(0x10c),_0x59032a(0xc1)]);_0x3241c5=[_0x59032a(0x10c),'after'][_0x51eaa8]??_0x59032a(0x10c);}return{'alias':_0x569641,'datasetCode':_0x16e90c,'datasetId':_0xa2e959,'operationType':_0x5ee056,'functionNode':_0x3241c5};}async function promptSelect(_0x4f15e9,_0x21a686){const _0xec0b31=a31_0x173f1f;if(_0x21a686[_0xec0b31(0xc4)]===0x1)return 0x0;for(const [_0x5d87aa,_0x312a43]of _0x21a686[_0xec0b31(0x10e)]()){process['stderr']['write']('\x20\x20'+(_0x5d87aa+0x1)+'.\x20'+_0x312a43+'\x0a');}const _0x482044=createInterface({'input':process[_0xec0b31(0x113)],'output':process[_0xec0b31(0xd9)]});while(!![]){const _0x227cd7=await new Promise(_0x5bb0c4=>{const _0x3f68ac=_0xec0b31;_0x482044[_0x3f68ac(0xbf)](_0x4f15e9+'\x20',_0x5bb0c4);}),_0x29322e=Number[_0xec0b31(0xdf)](_0x227cd7[_0xec0b31(0xf1)](),0xa);if(Number[_0xec0b31(0x10d)](_0x29322e)&&_0x29322e>=0x1&&_0x29322e<=_0x21a686[_0xec0b31(0xc4)])return _0x482044['close'](),_0x29322e-0x1;process[_0xec0b31(0xd9)][_0xec0b31(0xc9)](_0xec0b31(0x110)+_0x21a686[_0xec0b31(0xc4)]+'.\x0a');}}function buildFilePath(_0x112ea9,_0x5bdc4a,_0x292110,_0xd7437d){const _0x30101e=a31_0x173f1f;if(_0x5bdc4a===_0x30101e(0x116)){if(!_0xd7437d)throw CliErrors[_0x30101e(0xf3)](_0x30101e(0x106));const _0x131174=_0xd7437d['alias']??_0xd7437d['datasetCode'];return join(_0x112ea9[_0x30101e(0x105)],_0x30101e(0x116),_0x131174,_0xd7437d[_0x30101e(0xbb)],_0xd7437d[_0x30101e(0xd8)],_0x292110+_0x30101e(0xf5));}return join(_0x112ea9[_0x30101e(0x105)],_0x5bdc4a,_0x292110+'.js');}function a31_0x518d(){const _0x48850d=['No\x20operation\x20types\x20found\x20for\x20dataset\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','stdin','alias','string','HOOK','apiDir','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[平台配置]\x20','code','\x22.\x20','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Select\x20operation\x20type:','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','read','Operation\x20type\x20(HOOK\x20only)','operationType','operation-type','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','datasetcode','question','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','after','Script\x20type','41853XuixXk','length','Alias\x20\x22','appCode','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Created\x20','write','type','nonInteractive','utf8','706925gmvspH','/COMMON/','bff','/data/dataset/','\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','find','/**\x0a\x20*\x20','1369254XJrSRC','join','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','source','functionNode','stderr','\x20function:\x20','Operation\x20type\x20\x22','\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','60142968ydNtwb','name','parseInt','\x22\x20not\x20found\x20for\x20dataset\x20','function-node','171490FMEaet','6320lDdtbD','description','4iKctNM','Available\x20aliases:\x20','datasetId','keys','map','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','File\x20already\x20exists:\x20','948DYMGfq','55urbLdy','str','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','trim','Select\x20dataset:','validation','ENDPOINT','.js','.js\x0a\x20*\x20[触发节点]\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','12573BjhFow','.js\x0a','datasetCode','Trigger\x20node\x20(HOOK\x20only)','COMMON','Invalid\x20function\x20name\x20\x22','No\x20api.ts\x20found.\x20Run\x20`','/ENDPOINT/','5112265XaRANa','tableName','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','scriptsRootDir','HOOK\x20requires\x20alias/operation/node\x20options.','Available:\x20','No\x20datasets\x20found\x20for\x20this\x20app.','Function\x20name\x20(valid\x20JS\x20identifier)','\x20api\x20pull`\x20to\x20refresh.','UNKNOWN','before','isInteger','entries','2IzALyu','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'];a31_0x518d=function(){return _0x48850d;};return a31_0x518d();}export function generateTemplate(_0x2230ef,_0x332acd,_0x59d887,_0x1fd44e,_0x678f99){const _0x5b1d28=a31_0x173f1f,_0x41b360=_0x1fd44e?.[_0x5b1d28(0xf1)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x1accf7=getAppBaseUrl(_0x59d887),_0x1302cf=_0x5b1d28(0xeb);if(_0x2230ef===_0x5b1d28(0xfd))return _0x5b1d28(0xd3)+_0x41b360+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x332acd+_0x5b1d28(0xb2)+_0x1accf7+_0x5b1d28(0x112)+_0x59d887+_0x5b1d28(0xce)+_0x332acd+_0x5b1d28(0x104)+_0x332acd+'\x22,\x20params\x20})\x0a'+_0x1302cf+_0x5b1d28(0xd1)+_0x332acd+_0x5b1d28(0x103);if(_0x2230ef===_0x5b1d28(0xf4))return'/**\x0a\x20*\x20'+_0x41b360+_0x5b1d28(0xea)+_0x332acd+_0x5b1d28(0xf0)+_0x59d887+'/'+_0x332acd+'\x0a\x20*\x20[平台配置]\x20'+_0x1accf7+_0x5b1d28(0x112)+_0x59d887+_0x5b1d28(0x100)+_0x332acd+_0x5b1d28(0xfa)+_0x1302cf+_0x5b1d28(0xdc)+_0x332acd+_0x5b1d28(0x103);if(!_0x678f99)throw CliErrors[_0x5b1d28(0xf3)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x4829d6=_0x678f99['alias']??_0x678f99[_0x5b1d28(0xfb)],_0x5c1d12=_0x678f99['functionNode']===_0x5b1d28(0x10c)?'当前请求参数':'当前响应结果',_0x35a7f8=_0x678f99[_0x5b1d28(0xd8)]===_0x5b1d28(0x10c)?'修改后的请求参数':'修改后的响应结果';return _0x5b1d28(0xd3)+_0x41b360+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x332acd+_0x5b1d28(0xb1)+_0x59d887+'/'+_0x678f99[_0x5b1d28(0xfb)]+'/'+_0x678f99['operationType']+_0x5b1d28(0xb2)+_0x1accf7+_0x5b1d28(0xd0)+_0x678f99[_0x5b1d28(0xe7)]+_0x5b1d28(0xb5)+_0x59d887+'/HOOK/'+_0x4829d6+'/'+_0x678f99[_0x5b1d28(0xbb)]+'/'+_0x678f99['functionNode']+'/'+_0x332acd+_0x5b1d28(0xf6)+_0x678f99[_0x5b1d28(0xd8)]+'\x0a'+_0x1302cf+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x5c1d12+_0x5b1d28(0xf7)+_0x35a7f8+_0x5b1d28(0xf8)+_0x332acd+_0x5b1d28(0x103);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x310b1e=a32_0x1eda;(function(_0x28efe1,_0x524649){const _0x590c1c=a32_0x1eda,_0x2201ea=_0x28efe1();while(!![]){try{const _0x187018=-parseInt(_0x590c1c(0x13b))/0x1*(-parseInt(_0x590c1c(0x149))/0x2)+-parseInt(_0x590c1c(0x13e))/0x3*(-parseInt(_0x590c1c(0x133))/0x4)+parseInt(_0x590c1c(0x134))/0x5+parseInt(_0x590c1c(0x132))/0x6+-parseInt(_0x590c1c(0x145))/0x7+-parseInt(_0x590c1c(0x12c))/0x8+-parseInt(_0x590c1c(0x147))/0x9*(parseInt(_0x590c1c(0x12b))/0xa);if(_0x187018===_0x524649)break;else _0x2201ea['push'](_0x2201ea['shift']());}catch(_0xfd2f44){_0x2201ea['push'](_0x2201ea['shift']());}}}(a32_0x3538,0x83f24));function a32_0x3538(){const _0x545cea=['scriptsRootDir','string','29rOJmUv','/api/management/library/scripts/delete','stringify','3nHonIW','validation','split','Would\x20delete\x20','functions','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','keys','7189679zPsmIO','Deleted\x20','72lQrPVC','apps','65942NvSrUb','length','Backend\x20Function\x20lock\x20file\x20not\x20found.','\x20(local\x20file\x20moved\x20to\x20trash)','target','delete','Local\x20delete\x20not\x20settled\x20for\x20','toISOString','lockFilePath','map','scriptsRoot','\x20\x20-\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','appCode','find','202690DvIwYk','6356344ZpqsRQ','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','projectRoot','includes','remoteId','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','1627692KfFDol','3191704AaOlXI','2494385RIQHxf','trashDir','<timestamp>','Function\x20not\x20found:\x20','str'];a32_0x3538=function(){return _0x545cea;};return a32_0x3538();}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':a32_0x310b1e(0x14e),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[{'name':'target','type':a32_0x310b1e(0x13a),'required':!![],'description':a32_0x310b1e(0x143)}],async 'validate'(_0x1f8bdc){const _0x402595=a32_0x310b1e,_0xaaef2=loadBffProjectConfig(_0x1f8bdc[_0x402595(0x156)]),_0x326168=await readBffLockFile(_0xaaef2['lockFilePath']);if(!_0x326168)throw CliErrors[_0x402595(0x13f)](_0x402595(0x12d));},async 'dryRun'(_0x4238dd){const _0x2dd9af=a32_0x310b1e,_0x4f0811=loadBffProjectConfig(_0x4238dd[_0x2dd9af(0x156)]),_0x5507cd=await readBffLockFile(_0x4f0811[_0x2dd9af(0x151)]);if(!_0x5507cd)throw CliErrors[_0x2dd9af(0x13f)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0xebdc71}=ensureLockScope(_0x5507cd,_0x4238dd[_0x2dd9af(0x156)],_0x4f0811[_0x2dd9af(0x153)],_0x2dd9af(0x14e)),_0xbb6000=_0x4238dd[_0x2dd9af(0x138)]('target'),_0x45db6c=Object['keys'](_0xebdc71[_0x2dd9af(0x142)]),_0x294284=resolveDeleteTarget(_0xbb6000,_0x45db6c),_0x32b1e1=_0xebdc71[_0x2dd9af(0x142)][_0x294284];if(!_0x32b1e1)throw CliErrors[_0x2dd9af(0x13f)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x294284+'\x22.');const _0x59d939=resolveLocalFilePathFromLockKey(_0x4f0811,_0x294284),_0x191c82=relative(_0x4f0811[_0x2dd9af(0x12e)],_0x59d939),_0x44fa12=join(_0x4f0811['trashDir'],_0x2dd9af(0x136),_0x191c82);return{'method':'POST','url':_0x2dd9af(0x13c),'body':{'appCode':_0x4238dd[_0x2dd9af(0x156)],'target':_0x294284,'remoteId':_0x32b1e1[_0x2dd9af(0x130)],'localFilePath':_0x59d939,'trashedPath':_0x44fa12},'description':_0x2dd9af(0x141)+_0x294284+_0x2dd9af(0x131)};},async 'execute'(_0x2cebd7){const _0x329330=a32_0x310b1e,_0x56429a=loadBffProjectConfig(_0x2cebd7[_0x329330(0x156)]),_0x160e7c=await readBffLockFile(_0x56429a[_0x329330(0x151)]);if(!_0x160e7c)throw CliErrors[_0x329330(0x13f)](_0x329330(0x14b));const {lockData:_0x38dff4,appLock:_0x4ca965}=ensureLockScope(_0x160e7c,_0x2cebd7[_0x329330(0x156)],_0x56429a[_0x329330(0x153)],'delete'),_0xba1308=JSON['parse'](JSON[_0x329330(0x13d)](_0x38dff4)),_0x2d0d8a=_0xba1308[_0x329330(0x148)][_0x2cebd7['appCode']];if(!_0x2d0d8a)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x2cebd7[_0x329330(0x156)]+_0x329330(0x155));const _0xff9048=_0x2cebd7[_0x329330(0x138)](_0x329330(0x14d)),_0x2607c2=Object[_0x329330(0x144)](_0x2d0d8a[_0x329330(0x142)]),_0x508d2e=resolveDeleteTarget(_0xff9048,_0x2607c2),_0xcd046c=_0x2d0d8a[_0x329330(0x142)][_0x508d2e];if(!_0xcd046c)throw CliErrors[_0x329330(0x13f)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x508d2e+'\x22.');await deleteBffScript(_0xcd046c[_0x329330(0x130)]),delete _0x2d0d8a[_0x329330(0x142)][_0x508d2e],_0x2d0d8a['lastSync']=new Date()[_0x329330(0x150)](),await writeBffLockFile(_0x56429a[_0x329330(0x151)],_0xba1308);const _0x51c124=resolveLocalFilePathFromLockKey(_0x56429a,_0x508d2e);let _0x2f26f0;await fileExists(_0x51c124)&&(_0x2f26f0=await moveToTrash(_0x56429a['projectRoot'],_0x56429a[_0x329330(0x135)],_0x51c124),await cleanupEmptyDirectories(dirname(_0x51c124),_0x56429a[_0x329330(0x139)]));await waitForDeleteSettlement(_0x56429a[_0x329330(0x151)],_0x2cebd7[_0x329330(0x156)],_0x508d2e,_0x51c124),await sleep(0x96);const _0x4e5849={'deleted':_0x508d2e,'remoteId':_0xcd046c[_0x329330(0x130)]};if(_0x2f26f0)_0x4e5849['trashedTo']=_0x2f26f0;return{'ok':!![],'data':_0x4e5849,'message':_0x329330(0x146)+_0x508d2e+(_0x2f26f0?_0x329330(0x14c):'')};}};function resolveDeleteTarget(_0x50753d,_0x17290b){const _0x2d382=a32_0x310b1e;if(_0x50753d[_0x2d382(0x12f)]('/')){const _0x51e35c=_0x17290b[_0x2d382(0x157)](_0x2ca431=>_0x2ca431===_0x50753d);if(!_0x51e35c)throw CliErrors['validation'](_0x2d382(0x137)+_0x50753d);return _0x51e35c;}const _0x5de1be=_0x17290b['filter'](_0x217e1d=>_0x217e1d[_0x2d382(0x140)]('/')['at'](-0x1)===_0x50753d);if(_0x5de1be['length']===0x0)throw CliErrors[_0x2d382(0x13f)]('Function\x20not\x20found:\x20'+_0x50753d);if(_0x5de1be[_0x2d382(0x14a)]>0x1)throw CliErrors[_0x2d382(0x13f)]('Multiple\x20functions\x20match\x20\x22'+_0x50753d+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x5de1be[_0x2d382(0x152)](_0x2a7879=>_0x2d382(0x154)+_0x2a7879)['join']('\x0a'));return _0x5de1be[0x0];}async function moveToTrash(_0x49eab7,_0x204232,_0x28b4c9){const _0x562baa=a32_0x310b1e,_0x7482c0=new Date()[_0x562baa(0x150)]()['replace'](/[:.]/g,'-'),_0x5d47ae=relative(_0x49eab7,_0x28b4c9),_0xefb1b7=join(_0x204232,_0x7482c0,_0x5d47ae);return await mkdir(dirname(_0xefb1b7),{'recursive':!![]}),await rename(_0x28b4c9,_0xefb1b7),_0xefb1b7;}function a32_0x1eda(_0x33cf89,_0x3863c6){_0x33cf89=_0x33cf89-0x12b;const _0x3538c2=a32_0x3538();let _0x1eda60=_0x3538c2[_0x33cf89];return _0x1eda60;}async function cleanupEmptyDirectories(_0x161c3b,_0x124396){const _0x3e8427=a32_0x310b1e;let _0x5bcc23=resolve(_0x161c3b);const _0x530b78=resolve(_0x124396);while(_0x5bcc23['startsWith'](''+_0x530b78+sep)||_0x5bcc23===_0x530b78){if(_0x5bcc23===_0x530b78)return;try{const _0x1cfd46=await readdir(_0x5bcc23);if(_0x1cfd46[_0x3e8427(0x14a)]>0x0)return;await rmdir(_0x5bcc23);}catch{return;}_0x5bcc23=dirname(_0x5bcc23);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x1b77d5,_0x21b8fa,_0x2f6064,_0x3986fd){const _0x6aed46=a32_0x310b1e;for(let _0x340291=0x0;_0x340291<DELETE_SETTLE_RETRY_COUNT;_0x340291+=0x1){const _0x50aa73=await readBffLockFile(_0x1b77d5),_0x3c74c7=!!_0x50aa73?.[_0x6aed46(0x148)]?.[_0x21b8fa]?.[_0x6aed46(0x142)]?.[_0x2f6064],_0x380463=await fileExists(_0x3986fd);if(!_0x3c74c7&&!_0x380463)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x6aed46(0x14f)+_0x2f6064+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x35102e=a33_0x33d2;(function(_0xc39c05,_0x2bcf68){const _0x583232=a33_0x33d2,_0x53dc7d=_0xc39c05();while(!![]){try{const _0x1c46df=parseInt(_0x583232(0xde))/0x1+parseInt(_0x583232(0xd0))/0x2*(-parseInt(_0x583232(0xd6))/0x3)+parseInt(_0x583232(0xd5))/0x4*(-parseInt(_0x583232(0xe0))/0x5)+-parseInt(_0x583232(0xda))/0x6+-parseInt(_0x583232(0xcf))/0x7*(parseInt(_0x583232(0xcb))/0x8)+-parseInt(_0x583232(0xdc))/0x9+parseInt(_0x583232(0xdf))/0xa*(parseInt(_0x583232(0xce))/0xb);if(_0x1c46df===_0x2bcf68)break;else _0x53dc7d['push'](_0x53dc7d['shift']());}catch(_0x428ecb){_0x53dc7d['push'](_0x53dc7d['shift']());}}}(a33_0xcc7e,0xf2579));function a33_0x33d2(_0x3459e3,_0x2a314e){_0x3459e3=_0x3459e3-0xca;const _0xcc7e4a=a33_0xcc7e();let _0x33d24f=_0xcc7e4a[_0x3459e3];return _0x33d24f;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a33_0x35102e(0xd1),'description':a33_0x35102e(0xd3),'risk':a33_0x35102e(0xe1),'flags':[{'name':'id','type':'number','required':!![],'description':a33_0x35102e(0xd4)},{'name':a33_0x35102e(0xca),'type':'boolean','description':a33_0x35102e(0xe2)}],async 'execute'(_0x1af080){const _0xf66fbb=a33_0x35102e,_0x1324b4=await getBffScriptInfo(_0x1af080[_0xf66fbb(0xcd)]('id')),_0x5693f7=_0x1af080[_0xf66fbb(0xd2)]('verbose');if(_0x5693f7)return{'ok':!![],'data':_0x1324b4};return{'ok':!![],'data':{'id':_0x1324b4['id'],'functionName':_0x1324b4[_0xf66fbb(0xdb)]??'','version':_0x1324b4[_0xf66fbb(0xd8)]??'','updateUserName':_0x1324b4[_0xf66fbb(0xcc)]??'','appCode':_0x1324b4['appCode'],'scriptType':_0x1324b4[_0xf66fbb(0xd7)],'description':_0x1324b4['description']||_0xf66fbb(0xd9),'createdTime':_0x1324b4['createdTime']??'','updatedTime':_0x1324b4['updatedTime']??'','scriptContent':_0x1324b4[_0xf66fbb(0xdd)]??''}};}};function a33_0xcc7e(){const _0x4fac35=['detail','bool','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','Script\x20ID','4ARDGBx','3261dwWkip','scriptType','version','(none)','1498068AYnBoQ','functionName','8152317UJcUAf','scriptContent','1695273CCGJwI','1660SubTQD','4207115fCIPWj','read','Return\x20full\x20raw\x20script\x20object','verbose','782344JAClNj','updateUserName','num','301389dnOlTC','98mwLbUl','3468VOkepS'];a33_0xcc7e=function(){return _0x4fac35;};return a33_0xcc7e();}
|