@lovrabet/rabetbase-cli 2.5.0-beta.3 → 2.5.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- 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-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.d.ts +13 -0
- package/lib/commands/db/table-diff-shared.js +1 -0
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/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/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.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/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 +1 -7
- 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/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/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 +6 -6
- package/skills/rabetbase/guides/database-connection-workflow.md +9 -9
- package/skills/rabetbase/references/rabetbase-config.md +2 -3
- package/skills/rabetbase/references/rabetbase-db-analyze.md +2 -2
- package/skills/rabetbase/references/rabetbase-db-diff-refresh.md +4 -3
- package/skills/rabetbase/references/rabetbase-db-diff.md +7 -22
- package/skills/rabetbase/references/rabetbase-db-tables.md +14 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x346a47,_0x141b91){const _0x1c7a2f=a18_0x59cc,_0x788f9c=_0x346a47();while(!![]){try{const _0x387fb3=-parseInt(_0x1c7a2f(0xeb))/0x1*(-parseInt(_0x1c7a2f(0xed))/0x2)+-parseInt(_0x1c7a2f(0xf0))/0x3+parseInt(_0x1c7a2f(0xee))/0x4*(parseInt(_0x1c7a2f(0xe8))/0x5)+parseInt(_0x1c7a2f(0xf1))/0x6+parseInt(_0x1c7a2f(0xf3))/0x7+-parseInt(_0x1c7a2f(0xec))/0x8*(-parseInt(_0x1c7a2f(0xf2))/0x9)+-parseInt(_0x1c7a2f(0xe7))/0xa*(parseInt(_0x1c7a2f(0xe6))/0xb);if(_0x387fb3===_0x141b91)break;else _0x788f9c['push'](_0x788f9c['shift']());}catch(_0x263337){_0x788f9c['push'](_0x788f9c['shift']());}}}(a18_0x3c7b,0xede52));import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';function a18_0x3c7b(){const _0x1a106b=['selectedAppName','11xBasRn','21573040eVNlwI','33820UKHUMd','merged','project','1774ciFJLV','8xUGmcY','622wqtxVt','452TGxsnB','global','3465339kCzFSC','7257276lJLmoc','13514751bWABoe','1817228BmvIWE','bool','filter','map','length','name','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','validation'];a18_0x3c7b=function(){return _0x1a106b;};return a18_0x3c7b();}function a18_0x59cc(_0x415460,_0x1144ed){_0x415460=_0x415460-0xe0;const _0x3c7b4c=a18_0x3c7b();let _0x59ccd4=_0x3c7b4c[_0x415460];return _0x59ccd4;}export function resolveTargetApps(_0x73d452,_0x2e2f32){const _0x5e7166=a18_0x59cc;if(_0x2e2f32)return null;const _0x47f3b2=_0x73d452[_0x5e7166(0xf4)](_0x5e7166(0xef))?_0x5e7166(0xe9):_0x5e7166(0xea);let _0x581c75=getMultiAppConfigs(_0x47f3b2);if(!_0x581c75||_0x581c75['length']===0x0)return null;if(_0x73d452[_0x5e7166(0xe5)]){const _0x68f6f3=_0x581c75[_0x5e7166(0xf5)](_0x2ecfa7=>_0x2ecfa7[_0x5e7166(0xe2)]===_0x73d452[_0x5e7166(0xe5)]);if(_0x68f6f3[_0x5e7166(0xe1)]===0x0){const _0x39de9e=_0x581c75[_0x5e7166(0xe0)](_0x529bf4=>_0x529bf4[_0x5e7166(0xe2)])['join'](',\x20');throw CliErrors[_0x5e7166(0xe4)]('App\x20\x22'+_0x73d452[_0x5e7166(0xe5)]+_0x5e7166(0xe3)+_0x39de9e);}_0x581c75=_0x68f6f3;}return _0x581c75;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x6653d5,_0x476c7c){const _0x1f75ef=a19_0xac3e,_0x5b64e8=_0x6653d5();while(!![]){try{const _0x4b6042=parseInt(_0x1f75ef(0x168))/0x1+parseInt(_0x1f75ef(0x16d))/0x2*(parseInt(_0x1f75ef(0x165))/0x3)+parseInt(_0x1f75ef(0x16c))/0x4+parseInt(_0x1f75ef(0x167))/0x5+-parseInt(_0x1f75ef(0x169))/0x6+-parseInt(_0x1f75ef(0x166))/0x7*(-parseInt(_0x1f75ef(0x16b))/0x8)+-parseInt(_0x1f75ef(0x16a))/0x9;if(_0x4b6042===_0x476c7c)break;else _0x5b64e8['push'](_0x5b64e8['shift']());}catch(_0x3f0e5d){_0x5b64e8['push'](_0x5b64e8['shift']());}}}(a19_0x4279,0x7c65d));import{appListDefinition}from'../../commands/app/list.js';function a19_0x4279(){const _0x2bde0d=['2504076bvdQVz','17771238giClmo','8JqguJB','2703580VNiGdT','10Kpzzuc','13647GaMFPK','4734254zcousu','4043160EYdCYn','717867QihghA'];a19_0x4279=function(){return _0x2bde0d;};return a19_0x4279();}import{appMembersListDefinition}from'../../commands/app/members-list.js';function a19_0xac3e(_0x58b9f1,_0x10fc8a){_0x58b9f1=_0x58b9f1-0x165;const _0x427930=a19_0x4279();let _0xac3ea=_0x427930[_0x58b9f1];return _0xac3ea;}export const appDefinitions=[appListDefinition,appMembersListDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x35dc54=a20_0x4514;(function(_0x37a906,_0x3d797b){const _0x439a88=a20_0x4514,_0x5bd7a8=_0x37a906();while(!![]){try{const _0x4c7b35=parseInt(_0x439a88(0x13e))/0x1+parseInt(_0x439a88(0x126))/0x2*(parseInt(_0x439a88(0x136))/0x3)+-parseInt(_0x439a88(0x13d))/0x4*(-parseInt(_0x439a88(0x14d))/0x5)+parseInt(_0x439a88(0x131))/0x6+-parseInt(_0x439a88(0x139))/0x7*(-parseInt(_0x439a88(0x14f))/0x8)+parseInt(_0x439a88(0x144))/0x9+-parseInt(_0x439a88(0x129))/0xa;if(_0x4c7b35===_0x3d797b)break;else _0x5bd7a8['push'](_0x5bd7a8['shift']());}catch(_0x1918a7){_0x5bd7a8['push'](_0x5bd7a8['shift']());}}}(a20_0x2993,0x7d139));function a20_0x4514(_0x526871,_0x11ab7e){_0x526871=_0x526871-0x126;const _0x29930b=a20_0x2993();let _0x4514b8=_0x29930b[_0x526871];return _0x4514b8;}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(_0x39e401,_0x362870){const _0x7650d7=a20_0x4514,_0x15569d=[],_0xf304e0=_0x39e401[_0x7650d7(0x14c)]&&typeof _0x39e401[_0x7650d7(0x14c)]===_0x7650d7(0x138)?_0x39e401[_0x7650d7(0x14c)]:{},_0x4fb02e=_0x39e401[_0x7650d7(0x134)]||undefined,_0x921f03=_0x4fb02e??(Object['keys'](_0xf304e0)[_0x7650d7(0x132)]===0x1?Object[_0x7650d7(0x148)](_0xf304e0)[0x0]:undefined);for(const [_0x836e19,_0x172fd8]of Object['entries'](_0xf304e0)){if(!_0x172fd8||typeof _0x172fd8!==_0x7650d7(0x138)||!_0x172fd8[_0x7650d7(0x12e)])continue;_0x15569d[_0x7650d7(0x13b)]({'name':_0x836e19,'appcode':_0x172fd8[_0x7650d7(0x12e)],'named':!![],'definedIn':_0x362870,'isDefault':_0x836e19===_0x921f03,...buildAppProfileListFields(_0x172fd8)});}return _0x15569d;}function buildMergedItems(_0x348999,_0x4a1f02){const _0x2220b2=a20_0x4514,{apps:apps={}}=_0x348999,_0x43b2d5=_0x348999[_0x2220b2(0x134)],_0x43aeb2=_0x43b2d5??(Object[_0x2220b2(0x148)](apps)[_0x2220b2(0x132)]===0x1?Object[_0x2220b2(0x148)](apps)[0x0]:undefined),_0x5a17e7=_0x4a1f02['globalConfig'][_0x2220b2(0x14c)]&&typeof _0x4a1f02[_0x2220b2(0x133)]['apps']===_0x2220b2(0x138)?_0x4a1f02[_0x2220b2(0x133)][_0x2220b2(0x14c)]:{},_0x56ccf4=_0x4a1f02[_0x2220b2(0x14e)][_0x2220b2(0x14c)]&&typeof _0x4a1f02[_0x2220b2(0x14e)][_0x2220b2(0x14c)]===_0x2220b2(0x138)?_0x4a1f02[_0x2220b2(0x14e)]['apps']:{},_0x25ee46=Object['entries'](apps),_0x223989=_0x25ee46[_0x2220b2(0x12b)](([_0x2ea93d,_0x3b7e26])=>({'name':_0x2ea93d,'appcode':_0x3b7e26[_0x2220b2(0x12e)],'named':!![],'definedIn':appDefinedIn(_0x2ea93d,_0x5a17e7,_0x56ccf4),'isDefault':_0x2ea93d===_0x43aeb2,...buildAppProfileListFields(_0x3b7e26)}));return _0x223989;}function validateAppListFlags(_0x199cbe){const _0x316dc0=a20_0x4514;if(!_0x199cbe[_0x316dc0(0x140)](_0x316dc0(0x13a)))return;if(!_0x199cbe[_0x316dc0(0x140)](_0x316dc0(0x12f))&&!_0x199cbe['bool']('project'))return;throw CliErrors[_0x316dc0(0x130)](_0x316dc0(0x142),_0x316dc0(0x145));}async function execute(_0xffa9b0){const _0xc2535b=a20_0x4514;validateAppListFlags(_0xffa9b0);if(_0xffa9b0[_0xc2535b(0x140)](_0xc2535b(0x13a)))return{'ok':!![],'data':await listRemoteAppDirectory(_0xffa9b0)};const _0x412a74=_0xffa9b0[_0xc2535b(0x140)]('global'),_0x74b3b0=_0xffa9b0[_0xc2535b(0x140)](_0xc2535b(0x146)),_0x46b78b=_0x412a74?_0xc2535b(0x12f):_0x74b3b0?_0xc2535b(0x146):_0xc2535b(0x149),{config:_0x47f538,layers:_0xcad55c}=readRawConfigWithLayers(),_0xded4cd=resolveDefaultAppSource(_0xcad55c),{defaultApp:_0x42788d}=_0x47f538;let _0xe78d3a,_0x32ea5f;switch(_0x46b78b){case'global':_0xe78d3a=buildItemsFromLayer(_0xcad55c[_0xc2535b(0x133)],_0xc2535b(0x12f)),_0x32ea5f=_0xcad55c[_0xc2535b(0x137)];break;case _0xc2535b(0x146):_0xe78d3a=buildItemsFromLayer(_0xcad55c['projectConfig'],_0xc2535b(0x146)),_0x32ea5f=_0xcad55c[_0xc2535b(0x13c)];break;default:_0xe78d3a=buildMergedItems(_0x47f538,_0xcad55c);break;}enrichAppListItemsWithMergedSelection(_0xe78d3a,_0xffa9b0['mergedCli']);if(_0xe78d3a[_0xc2535b(0x132)]===0x0){const _0x5d7857=_0x46b78b===_0xc2535b(0x149)?'':_0xc2535b(0x14a)+_0x46b78b+_0xc2535b(0x150);return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x5d7857+_0xc2535b(0x141)+CLI_BIN_NAME+_0xc2535b(0x151)};}const _0x47c6bd=_0xe78d3a[_0xc2535b(0x12d)](_0x1ecb81=>_0x1ecb81[_0xc2535b(0x12a)]===!![]),_0x394f8b=_0x42788d??_0x47c6bd?.[_0xc2535b(0x13f)]??null,_0x24529e=_0x46b78b==='merged'?{'globalPath':_0xcad55c['globalPath']??null,'projectPath':_0xcad55c[_0xc2535b(0x13c)]??null,'defaultApp':_0x394f8b,'defaultAppSource':_0x42788d!=null?_0xded4cd:null}:{'scope':_0x46b78b,'configPath':_0x32ea5f??null};return{'ok':!![],'data':{'items':_0xe78d3a,'meta':_0x24529e}};}function a20_0x2993(){const _0x261885=['global','validation','5977788GblbEK','length','globalConfig','defaultApp','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','3RfUPpn','globalPath','object','14287jasSFi','remote','push','projectPath','16000aaKQxv','739367zeyQBb','name','bool','.\x20Use\x20`','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','list','1299447VkZycH','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','project','optional','keys','merged','\x20in\x20','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','apps','335kpybqa','projectConfig','3976CuUjBH','\x20config','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','read','565798mfhxXt','app','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','29330110YLdhrb','isCurrent','map','boolean','find','appcode'];a20_0x2993=function(){return _0x261885;};return a20_0x2993();}export const appListDefinition={'service':a20_0x35dc54(0x127),'command':a20_0x35dc54(0x143),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a20_0x35dc54(0x152),'auth':a20_0x35dc54(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':'boolean','description':a20_0x35dc54(0x135),'default':![]},{'name':a20_0x35dc54(0x12f),'type':a20_0x35dc54(0x12c),'description':a20_0x35dc54(0x14b),'default':![]},{'name':a20_0x35dc54(0x146),'type':a20_0x35dc54(0x12c),'description':a20_0x35dc54(0x128),'default':![]}],async 'validate'(_0x28dafb){validateAppListFlags(_0x28dafb);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a21_0x4834(_0x168cda,_0x491d78){_0x168cda=_0x168cda-0xdb;const _0x2fada8=a21_0x2fad();let _0x483455=_0x2fada8[_0x168cda];return _0x483455;}function a21_0x2fad(){const _0x4af157=['1306197nQybdt','4831128kvDhZj','329792Zemmet','Found\x20','1842cGGKYW','\x20application\x20member(s)','48740wOTFCY','length','15646464CnqEnT','6vPljQF','members-list','141793WQWMnL','4ENkoyt','List\x20application\x20members\x20with\x20their\x20role\x20memberships','10445KyqUas','245sKWavZ','1276kZnhLw','read','app','appCode'];a21_0x2fad=function(){return _0x4af157;};return a21_0x2fad();}const a21_0x24429d=a21_0x4834;(function(_0x4a63f9,_0x7b357){const _0x1d6445=a21_0x4834,_0x1eb76f=_0x4a63f9();while(!![]){try{const _0x2ffeb4=-parseInt(_0x1d6445(0xe6))/0x1*(-parseInt(_0x1d6445(0xe4))/0x2)+-parseInt(_0x1d6445(0xdb))/0x3*(parseInt(_0x1d6445(0xe7))/0x4)+-parseInt(_0x1d6445(0xe9))/0x5*(-parseInt(_0x1d6445(0xdf))/0x6)+-parseInt(_0x1d6445(0xea))/0x7*(-parseInt(_0x1d6445(0xdd))/0x8)+-parseInt(_0x1d6445(0xdc))/0x9+-parseInt(_0x1d6445(0xe1))/0xa*(-parseInt(_0x1d6445(0xeb))/0xb)+-parseInt(_0x1d6445(0xe3))/0xc;if(_0x2ffeb4===_0x7b357)break;else _0x1eb76f['push'](_0x1eb76f['shift']());}catch(_0x2e75da){_0x1eb76f['push'](_0x1eb76f['shift']());}}}(a21_0x2fad,0xc308f));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a21_0x24429d(0xed),'command':a21_0x24429d(0xe5),'description':a21_0x24429d(0xe8),'risk':a21_0x24429d(0xec),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x128834){const _0x1d225a=a21_0x24429d,_0x564068=projectAppMembers(await listRoleUsers(_0x128834[_0x1d225a(0xee)]));return{'ok':!![],'data':{'appCode':_0x128834[_0x1d225a(0xee)],'items':_0x564068,'totalCount':_0x564068[_0x1d225a(0xe2)]},'message':_0x1d225a(0xde)+_0x564068[_0x1d225a(0xe2)]+_0x1d225a(0xe0)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x2834(){const _0x301897=['2018648GzPqMb','1879119dtbvKH','map','52yFpfUQ','2164372CSurbT','129523thMmEP','appName','cookie','37932nnbQhI','platform','983690FSAIUE','5SfcsQO','499506sqxbml','appDesc'];a22_0x2834=function(){return _0x301897;};return a22_0x2834();}(function(_0x4e1285,_0x2b591a){const _0x2693aa=a22_0x402f,_0x1d6614=_0x4e1285();while(!![]){try{const _0x37dfe7=parseInt(_0x2693aa(0x152))/0x1+parseInt(_0x2693aa(0x149))/0x2+parseInt(_0x2693aa(0x155))/0x3*(-parseInt(_0x2693aa(0x150))/0x4)+-parseInt(_0x2693aa(0x14a))/0x5*(-parseInt(_0x2693aa(0x14b))/0x6)+-parseInt(_0x2693aa(0x151))/0x7+parseInt(_0x2693aa(0x14d))/0x8+-parseInt(_0x2693aa(0x14e))/0x9;if(_0x37dfe7===_0x2b591a)break;else _0x1d6614['push'](_0x1d6614['shift']());}catch(_0x444c1f){_0x1d6614['push'](_0x1d6614['shift']());}}}(a22_0x2834,0x4309f));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a22_0x402f(_0x3f57ef,_0xf1d7bf){_0x3f57ef=_0x3f57ef-0x148;const _0x2834b1=a22_0x2834();let _0x402fed=_0x2834b1[_0x3f57ef];return _0x402fed;}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x8ea60a){const _0x405da8=a22_0x402f,_0x3d9443=_0x8ea60a[_0x405da8(0x154)]||getCookie();if(!_0x3d9443)throw CliErrors['authRequired']();return _0x3d9443;}export async function listRemoteAppDirectory(_0x5b5512){const _0x565284=a22_0x402f,_0xeefba4=await withActiveCookie(resolveCookie(_0x5b5512),()=>listRemoteApps());return{'items':_0xeefba4[_0x565284(0x14f)](_0x5461ed=>({..._0x5461ed['id']!=null?{'id':_0x5461ed['id']}:{},'appCode':_0x5461ed['appCode'],'appName':_0x5461ed[_0x565284(0x153)],..._0x5461ed[_0x565284(0x14c)]!=null?{'appDesc':_0x5461ed['appDesc']}:{}})),'meta':{'source':_0x565284(0x148)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9ea66a,_0x22d15a){const _0xc87d1a=a23_0x1af9,_0x4ae990=_0x9ea66a();while(!![]){try{const _0x4a8b76=-parseInt(_0xc87d1a(0xe8))/0x1*(-parseInt(_0xc87d1a(0xd0))/0x2)+parseInt(_0xc87d1a(0xdd))/0x3+-parseInt(_0xc87d1a(0xce))/0x4*(parseInt(_0xc87d1a(0xef))/0x5)+-parseInt(_0xc87d1a(0xe5))/0x6+parseInt(_0xc87d1a(0xfe))/0x7*(parseInt(_0xc87d1a(0xf6))/0x8)+parseInt(_0xc87d1a(0xf2))/0x9+parseInt(_0xc87d1a(0xe4))/0xa*(-parseInt(_0xc87d1a(0xd6))/0xb);if(_0x4a8b76===_0x22d15a)break;else _0x4ae990['push'](_0x4ae990['shift']());}catch(_0x395eda){_0x4ae990['push'](_0x4ae990['shift']());}}}(a23_0x3768,0xa5638));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x549849){const _0x47c971=a23_0x1af9,_0x1b5df4=_0x549849?.[_0x47c971(0xeb)]();return _0x1b5df4?_0x1b5df4:null;}export function projectAppMembers(_0x1c9a38){const _0x2e6477=a23_0x1af9,_0x1da74c=new Map(),_0x25f2e0=[..._0x1c9a38][_0x2e6477(0xd3)]((_0x31f0df,_0x50480e)=>_0x31f0df['id']-_0x50480e['id']),_0x417f3d=(_0x413723,_0x58811a,_0x2e3b1e)=>{const _0x13dbd3=_0x2e6477;for(const _0x1d0f36 of _0x58811a){const _0x41fbae=Number(_0x1d0f36[_0x13dbd3(0xe6)]);if(!Number['isFinite'](_0x41fbae)||_0x41fbae<=0x0)continue;let _0x356167=_0x1da74c['get'](_0x41fbae);if(!_0x356167)_0x356167={'userId':_0x41fbae,'username':nullableText(_0x1d0f36[_0x13dbd3(0xd1)]),'displayName':nullableText(_0x1d0f36['nickname']),'status':_0x2e3b1e,'roles':[],'roleKeys':new Set()},_0x1da74c[_0x13dbd3(0xee)](_0x41fbae,_0x356167);else{_0x356167[_0x13dbd3(0xd1)]??=nullableText(_0x1d0f36['username']),_0x356167['displayName']??=nullableText(_0x1d0f36[_0x13dbd3(0xd7)]);if(_0x2e3b1e===_0x13dbd3(0xcc))_0x356167[_0x13dbd3(0xdf)]='ACTIVE';}const _0x3a87f3=_0x413723['id']+':'+_0x2e3b1e;if(_0x356167['roleKeys'][_0x13dbd3(0xcf)](_0x3a87f3))continue;_0x356167[_0x13dbd3(0xd5)][_0x13dbd3(0xd2)](_0x3a87f3),_0x356167[_0x13dbd3(0xfb)]['push']({'roleId':_0x413723['id'],'roleName':nullableText(_0x413723['roleName']),'roleType':nullableText(_0x413723[_0x13dbd3(0xea)]),'membershipStatus':_0x2e3b1e});}};for(const _0x4ae526 of _0x25f2e0){_0x417f3d(_0x4ae526,_0x4ae526[_0x2e6477(0xf3)]??[],_0x2e6477(0xcc)),_0x417f3d(_0x4ae526,_0x4ae526[_0x2e6477(0xe9)]??[],_0x2e6477(0xdb));}return[..._0x1da74c[_0x2e6477(0xfa)]()][_0x2e6477(0xed)](_0x11aff8=>({'userId':_0x11aff8[_0x2e6477(0xe6)],'username':_0x11aff8[_0x2e6477(0xd1)],'displayName':_0x11aff8[_0x2e6477(0xdc)],'status':_0x11aff8[_0x2e6477(0xdf)],'roles':_0x11aff8['roles'][_0x2e6477(0xd3)]((_0x3f4a08,_0x1787b5)=>_0x3f4a08[_0x2e6477(0xe3)]-_0x1787b5[_0x2e6477(0xe3)]||(_0x3f4a08['membershipStatus']===_0x1787b5[_0x2e6477(0xf7)]?0x0:_0x3f4a08[_0x2e6477(0xf7)]===_0x2e6477(0xcc)?-0x1:0x1))}))[_0x2e6477(0xd3)]((_0x5ebdc5,_0x43d542)=>_0x5ebdc5[_0x2e6477(0xe6)]-_0x43d542[_0x2e6477(0xe6)]);}export function enrichAppListItemsWithMergedSelection(_0x2e8d68,_0x494fc6){const _0x41eca1=a23_0x1af9;if(!_0x494fc6)return;const _0x5e7daf=_0x494fc6[_0x41eca1(0xf1)]&&typeof _0x494fc6[_0x41eca1(0xf1)]==='object'?_0x494fc6[_0x41eca1(0xf1)]:{},_0xf00219=Object['keys'](_0x5e7daf)[_0x41eca1(0xec)]>0x0;for(const _0xd22950 of _0x2e8d68){_0xd22950[_0x41eca1(0xd9)]=![];}const _0x5a1649=_0x494fc6['appCode']!=null?String(_0x494fc6[_0x41eca1(0xe7)])['trim']():'';if(_0xf00219){const _0x51ecfa=_0x494fc6[_0x41eca1(0xf4)]??_0x494fc6['defaultApp'];if(_0x51ecfa)for(const _0x3043fe of _0x2e8d68){_0x3043fe[_0x41eca1(0xde)]===!![]&&_0x3043fe[_0x41eca1(0xe1)]===_0x51ecfa&&(_0x3043fe['isCurrent']=!![]);}for(const _0x116e30 of _0x2e8d68){if(_0x116e30[_0x41eca1(0xde)]!==![])continue;if(_0x494fc6[_0x41eca1(0xf0)])continue;_0x5a1649&&String(_0x116e30[_0x41eca1(0xda)]??'')[_0x41eca1(0xeb)]()===_0x5a1649&&(_0x116e30['isCurrent']=!![]);}return;}if(!_0x5a1649)return;for(const _0x4e7ac9 of _0x2e8d68){String(_0x4e7ac9[_0x41eca1(0xda)]??'')[_0x41eca1(0xeb)]()===_0x5a1649&&(_0x4e7ac9[_0x41eca1(0xd9)]=!![]);}}export function resolveAppScopeForWrite(_0x520644,_0x165264,_0x5090fc){const _0xb13d9f=a23_0x1af9;if(_0x165264)return _0xb13d9f(0xf9);const _0x278f70=_0x5090fc[_0xb13d9f(0xfd)]['apps']&&typeof _0x5090fc[_0xb13d9f(0xfd)][_0xb13d9f(0xf1)]==='object'?_0x5090fc[_0xb13d9f(0xfd)][_0xb13d9f(0xf1)]:{},_0x3490f0=_0x5090fc[_0xb13d9f(0xf5)]['apps']&&typeof _0x5090fc[_0xb13d9f(0xf5)][_0xb13d9f(0xf1)]===_0xb13d9f(0xcd)?_0x5090fc[_0xb13d9f(0xf5)][_0xb13d9f(0xf1)]:{};if(Object[_0xb13d9f(0xe2)]['hasOwnProperty'][_0xb13d9f(0xfc)](_0x278f70,_0x520644))return'project';if(Object[_0xb13d9f(0xe2)][_0xb13d9f(0xe0)][_0xb13d9f(0xfc)](_0x3490f0,_0x520644))return _0xb13d9f(0xf9);return'project';}export function appDefinedIn(_0xa28f22,_0x4de30c,_0x13fb20){const _0x89efb6=a23_0x1af9,_0x1f1129=Object[_0x89efb6(0xe2)][_0x89efb6(0xe0)][_0x89efb6(0xfc)](_0x4de30c,_0xa28f22),_0x2c15dc=Object[_0x89efb6(0xe2)][_0x89efb6(0xe0)][_0x89efb6(0xfc)](_0x13fb20,_0xa28f22);if(_0x1f1129&&_0x2c15dc)return _0x89efb6(0xd4);if(_0x2c15dc)return'project';return _0x89efb6(0xf9);}export function resolveDefaultAppSource(_0x3a2957){const _0x5126f0=a23_0x1af9,_0x26123b=_0x3a2957['projectConfig'][_0x5126f0(0xf1)]&&typeof _0x3a2957[_0x5126f0(0xfd)][_0x5126f0(0xf1)]==='object'?_0x3a2957[_0x5126f0(0xfd)][_0x5126f0(0xf1)]:{};if('defaultApp'in _0x3a2957[_0x5126f0(0xfd)])return _0x5126f0(0xf8);if(Object[_0x5126f0(0xd8)](_0x26123b)[_0x5126f0(0xec)]>0x0)return _0x5126f0(0xf8);if(Object['keys'](_0x3a2957[_0x5126f0(0xfd)])[_0x5126f0(0xec)]===0x0&&_0x3a2957[_0x5126f0(0xf5)][_0x5126f0(0xf0)])return'global';return null;}export function getConfigPath(_0xcb6393={}){const _0x2be74b=a23_0x1af9,_0x1c3516=_0xcb6393[_0x2be74b(0xf9)]?_0x2be74b(0xf9):_0x2be74b(0xf8);return resolveWriteConfigPath(_0x1c3516);}export function readConfig(_0x25e300={}){return readConfigFile(getConfigPath(_0x25e300));}function a23_0x1af9(_0x5813e2,_0x1ab74e){_0x5813e2=_0x5813e2-0xcc;const _0x376855=a23_0x3768();let _0x1af917=_0x376855[_0x5813e2];return _0x1af917;}export function writeConfig(_0x2f1a04,_0x567d66={}){writeConfigFile(getConfigPath(_0x567d66),_0x2f1a04);}function a23_0x3768(){const _0x24383c=['status','hasOwnProperty','name','prototype','roleId','30RFSkuD','4689174vypqOL','userId','appCode','690143ZHhJjp','applyUserList','roleType','trim','length','map','set','265nWSoDY','defaultApp','apps','8450820amAtAc','userList','currentApp','globalConfig','8eAqxaa','membershipStatus','project','global','values','roles','call','projectConfig','855799LjDiwl','ACTIVE','object','11188hsFPkW','has','2AVWIDg','username','add','sort','both','roleKeys','4926757pKwWuE','nickname','keys','isCurrent','appcode','PENDING','displayName','3598449ikToYL','named'];a23_0x3768=function(){return _0x24383c;};return a23_0x3768();}export function scopeLabel(_0xa44c5c){return _0xa44c5c['global']?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x16028c=a24_0x6613;(function(_0x41b231,_0x4de065){const _0x58bfb2=a24_0x6613,_0x5ba4fa=_0x41b231();while(!![]){try{const _0x27152d=-parseInt(_0x58bfb2(0x92))/0x1+-parseInt(_0x58bfb2(0x80))/0x2+parseInt(_0x58bfb2(0x84))/0x3*(parseInt(_0x58bfb2(0x85))/0x4)+parseInt(_0x58bfb2(0x82))/0x5+-parseInt(_0x58bfb2(0x88))/0x6+-parseInt(_0x58bfb2(0x7e))/0x7+parseInt(_0x58bfb2(0x8b))/0x8;if(_0x27152d===_0x4de065)break;else _0x5ba4fa['push'](_0x5ba4fa['shift']());}catch(_0xd8f7bc){_0x5ba4fa['push'](_0x5ba4fa['shift']());}}}(a24_0x4b82,0x2e436));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a24_0x6613(_0x2388be,_0x113416){_0x2388be=_0x2388be-0x7c;const _0x4b8282=a24_0x4b82();let _0x661378=_0x4b8282[_0x2388be];return _0x661378;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a24_0x16028c(0x8c);export const appConfigDelete={'service':'app-config','command':'delete','description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a24_0x16028c(0x7c),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x52837e){readKeyArg(_0x52837e);},async 'dryRun'(_0x5081be){const _0xa3b81a=a24_0x16028c,_0x46a84a=readKeyArg(_0x5081be),_0x287b04=await mustGetByKey(_0x5081be[_0xa3b81a(0x7d)],_0x46a84a);return asAppConfigDryRunResult(buildMutationData({'operation':_0xa3b81a(0x90),'appCode':_0x5081be[_0xa3b81a(0x7d)],'key':_0x46a84a,'before':projectAppConfig(_0x287b04),'after':null,'dryRun':!![]}),{'method':_0xa3b81a(0x83),'url':DELETE_PATH});},async 'execute'(_0x492a17){const _0x110050=a24_0x16028c,_0x186b98=readKeyArg(_0x492a17),_0x337193=await mustGetByKey(_0x492a17['appCode'],_0x186b98);return await withAppConfigApiBoundary(_0x110050(0x90),{'appCode':_0x492a17['appCode'],'key':_0x186b98},()=>deleteAppConfig({'appCode':_0x492a17['appCode'],'id':requireAppConfigId(_0x337193,_0x186b98,_0x492a17[_0x110050(0x7d)])})),{'ok':!![],'data':buildMutationData({'operation':'delete','appCode':_0x492a17[_0x110050(0x7d)],'key':_0x186b98,'before':projectAppConfig(_0x337193),'after':null,'dryRun':![]}),'message':_0x110050(0x81)+_0x186b98};}};async function mustGetByKey(_0x19d89e,_0xd01240){const _0xf7e240=a24_0x16028c,_0x5b3f53=await withAppConfigApiBoundary(_0xf7e240(0x8d),{'appCode':_0x19d89e,'key':_0xd01240},()=>getAppConfigByKey(_0x19d89e,_0xd01240));if(!_0x5b3f53)throw CliErrors[_0xf7e240(0x89)](_0xf7e240(0x87)+_0xd01240,_0xf7e240(0x8a)+_0x19d89e);return _0x5b3f53;}function a24_0x4b82(){const _0x2a90da=['App\x20config\x20server\x20id\x20missing\x20for\x20key=','474298rQHTKU','Deleted\x20app\x20config\x20','189220LghMUZ','POST','228639EjHNuh','4ZKdvot','number','App\x20config\x20key\x20not\x20found:\x20','1248912puzOIW','validation','appCode:\x20','6960952rCnRgt','/smartapi/app-config/delete','get',',\x20appCode=','isFinite','delete','apiError','287273oFnZxu','high-risk-write','appCode','434756jaNjFN'];a24_0x4b82=function(){return _0x2a90da;};return a24_0x4b82();}function requireAppConfigId(_0x55d7dc,_0x92fa92,_0x136003){const _0xd46db9=a24_0x16028c;if(typeof _0x55d7dc['id']===_0xd46db9(0x86)&&Number[_0xd46db9(0x8f)](_0x55d7dc['id'])&&_0x55d7dc['id']>0x0)return _0x55d7dc['id'];throw CliErrors[_0xd46db9(0x91)](_0xd46db9(0x7f)+_0x92fa92+_0xd46db9(0x8e)+_0x136003);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x4e021a=a25_0x266e;(function(_0x499d1e,_0x36ede6){const _0x3f383c=a25_0x266e,_0x25d1f5=_0x499d1e();while(!![]){try{const _0x540bdf=parseInt(_0x3f383c(0x173))/0x1+-parseInt(_0x3f383c(0x166))/0x2*(-parseInt(_0x3f383c(0x16a))/0x3)+-parseInt(_0x3f383c(0x169))/0x4+-parseInt(_0x3f383c(0x174))/0x5*(-parseInt(_0x3f383c(0x172))/0x6)+-parseInt(_0x3f383c(0x16e))/0x7+parseInt(_0x3f383c(0x16b))/0x8+-parseInt(_0x3f383c(0x16d))/0x9*(parseInt(_0x3f383c(0x16f))/0xa);if(_0x540bdf===_0x36ede6)break;else _0x25d1f5['push'](_0x25d1f5['shift']());}catch(_0x58f219){_0x25d1f5['push'](_0x25d1f5['shift']());}}}(a25_0x24c7,0x55744));import{getAppConfigByKey}from'../../core/api-client.js';function a25_0x266e(_0x4c4011,_0x269fc3){_0x4c4011=_0x4c4011-0x166;const _0x24c796=a25_0x24c7();let _0x266ee2=_0x24c796[_0x4c4011];return _0x266ee2;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a25_0x24c7(){const _0x10f9da=['138HaUIxL','4623000HpfuGy','reveal','5564826Ekqytw','1881726tQjwHA','10vrKjsL','\x20with\x20value\x20redacted','validation','1442424kgonfG','470620AGBVgF','5nyKrFK','get','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','\x20with\x20value\x20revealed','appCode','read','9070FKYKdS','app-config','App\x20config\x20key\x20not\x20found:\x20','1041428qkvAeu'];a25_0x24c7=function(){return _0x10f9da;};return a25_0x24c7();}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a25_0x4e021a(0x167),'command':'get','description':a25_0x4e021a(0x176),'risk':a25_0x4e021a(0x179),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x5f523d){readKeyArg(_0x5f523d);},async 'execute'(_0x462830){const _0x46ae7d=a25_0x4e021a,_0x3c00d9=readKeyArg(_0x462830),_0x5cc8f5=await withAppConfigApiBoundary(_0x46ae7d(0x175),{'appCode':_0x462830[_0x46ae7d(0x178)],'key':_0x3c00d9},()=>getAppConfigByKey(_0x462830['appCode'],_0x3c00d9));if(!_0x5cc8f5)throw CliErrors[_0x46ae7d(0x171)](_0x46ae7d(0x168)+_0x3c00d9,'appCode:\x20'+_0x462830['appCode']);const _0x52a035=projectAppConfig(_0x5cc8f5,{'reveal':_0x462830['bool'](_0x46ae7d(0x16c))});return{'ok':!![],'data':{'config':_0x52a035},'message':_0x462830['bool'](_0x46ae7d(0x16c))?'Loaded\x20app\x20config\x20'+_0x3c00d9+_0x46ae7d(0x177):'Loaded\x20app\x20config\x20'+_0x3c00d9+_0x46ae7d(0x170)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaf1add,_0x272fff){const _0x3902f0=a26_0xe1b2,_0x148abf=_0xaf1add();while(!![]){try{const _0x3e7e09=parseInt(_0x3902f0(0x113))/0x1*(parseInt(_0x3902f0(0x110))/0x2)+parseInt(_0x3902f0(0x111))/0x3*(-parseInt(_0x3902f0(0x10c))/0x4)+-parseInt(_0x3902f0(0x10f))/0x5*(parseInt(_0x3902f0(0x10b))/0x6)+-parseInt(_0x3902f0(0x112))/0x7+parseInt(_0x3902f0(0x10d))/0x8+-parseInt(_0x3902f0(0x10e))/0x9+-parseInt(_0x3902f0(0x114))/0xa*(-parseInt(_0x3902f0(0x10a))/0xb);if(_0x3e7e09===_0x272fff)break;else _0x148abf['push'](_0x148abf['shift']());}catch(_0x3a223d){_0x148abf['push'](_0x148abf['shift']());}}}(a26_0xbe74,0x6f3f3));function a26_0xbe74(){const _0x24a4ec=['5386766BznNpq','255475DwwQnQ','18060mFFeKS','13431EMKCqe','66yecmhV','24nQaZjp','2701728hlEjbS','4119768MKTiVD','338990qlKSyK','2AvKKmQ','184791oINZxu'];a26_0xbe74=function(){return _0x24a4ec;};return a26_0xbe74();}import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';function a26_0xe1b2(_0x21053f,_0x7ca8d5){_0x21053f=_0x21053f-0x10a;const _0xbe7450=a26_0xbe74();let _0xe1b26e=_0xbe7450[_0x21053f];return _0xe1b26e;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x50102a=a27_0x35a9;function a27_0x4815(){const _0x54ccfc=['1253RtIKlF','7132908KYpUez','8618985xvOnZz','length','416nyIUWp','trim','12550308PBuvDX','appCode','app-config','576NhQQqm','map','Found\x20','11692VerIAu','key','171389BQsGAU','str','37340yHjuha','Filter\x20by\x20exact\x20config\x20key','10NAhOqn','31952MAyJMN','list','read','22ZDNBQl'];a27_0x4815=function(){return _0x54ccfc;};return a27_0x4815();}(function(_0x924627,_0x8c9f14){const _0x499865=a27_0x35a9,_0xdde824=_0x924627();while(!![]){try{const _0x15bb92=parseInt(_0x499865(0x11f))/0x1+parseInt(_0x499865(0x11d))/0x2*(-parseInt(_0x499865(0x131))/0x3)+-parseInt(_0x499865(0x12c))/0x4*(-parseInt(_0x499865(0x121))/0x5)+-parseInt(_0x499865(0x129))/0x6+parseInt(_0x499865(0x128))/0x7*(-parseInt(_0x499865(0x124))/0x8)+-parseInt(_0x499865(0x12a))/0x9*(-parseInt(_0x499865(0x123))/0xa)+-parseInt(_0x499865(0x127))/0xb*(-parseInt(_0x499865(0x12e))/0xc);if(_0x15bb92===_0x8c9f14)break;else _0xdde824['push'](_0xdde824['shift']());}catch(_0x44cf05){_0xdde824['push'](_0xdde824['shift']());}}}(a27_0x4815,0xed204));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';function a27_0x35a9(_0x39c2fd,_0x10ea16){_0x39c2fd=_0x39c2fd-0x11d;const _0x481546=a27_0x4815();let _0x35a9a6=_0x481546[_0x39c2fd];return _0x35a9a6;}export const appConfigList={'service':a27_0x50102a(0x130),'command':a27_0x50102a(0x125),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':a27_0x50102a(0x126),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a27_0x50102a(0x11e),'type':'string','description':a27_0x50102a(0x122)},TAGS_FLAG],async 'validate'(_0x9e715){const _0x4c0c0f=a27_0x50102a,_0x3f4498=_0x9e715[_0x4c0c0f(0x120)]('key')[_0x4c0c0f(0x12d)]();if(_0x3f4498)validateKey(_0x3f4498);readOptionalTags(_0x9e715);},async 'execute'(_0x470e49){const _0x1f403d=a27_0x50102a,_0x6ae03f=_0x470e49[_0x1f403d(0x120)](_0x1f403d(0x11e))['trim']()||undefined,_0x312fca=readOptionalTags(_0x470e49),_0x228516=await withAppConfigApiBoundary(_0x1f403d(0x125),{'appCode':_0x470e49['appCode']},()=>listAppConfigs(_0x470e49[_0x1f403d(0x12f)],{'key':_0x6ae03f,'tags':_0x312fca})),_0x308088=_0x228516[_0x1f403d(0x132)](_0x32930c=>projectAppConfig(_0x32930c));return{'ok':!![],'data':{'appCode':_0x470e49[_0x1f403d(0x12f)],'count':_0x308088[_0x1f403d(0x12b)],'configs':_0x308088},'message':_0x1f403d(0x133)+_0x308088[_0x1f403d(0x12b)]+'\x20app\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0xe00e65=a28_0x2b4a;(function(_0x59662c,_0x3e2b3a){const _0x2838cf=a28_0x2b4a,_0x31a075=_0x59662c();while(!![]){try{const _0x29815c=parseInt(_0x2838cf(0x12e))/0x1+parseInt(_0x2838cf(0x137))/0x2*(parseInt(_0x2838cf(0x139))/0x3)+parseInt(_0x2838cf(0x125))/0x4*(parseInt(_0x2838cf(0x122))/0x5)+parseInt(_0x2838cf(0x135))/0x6+parseInt(_0x2838cf(0x129))/0x7+-parseInt(_0x2838cf(0x121))/0x8*(-parseInt(_0x2838cf(0x12c))/0x9)+parseInt(_0x2838cf(0x120))/0xa*(-parseInt(_0x2838cf(0x128))/0xb);if(_0x29815c===_0x3e2b3a)break;else _0x31a075['push'](_0x31a075['shift']());}catch(_0x2e89f9){_0x31a075['push'](_0x31a075['shift']());}}}(a28_0x47ca,0x5a0b7));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a28_0x47ca(){const _0x2f7c75=['/smartapi/app-config/create','15267604mvAyrA','12026UYKqkm','tags','get','104697CaIObY','Updated','528628QtPkub','Read\x20config\x20value\x20from\x20file','App\x20config\x20server\x20id\x20missing\x20for\x20key=','string','POST','appCode','file','1049844ASerQi',',\x20appCode=','33578tcHjHb','set','117CjzqBc','/smartapi/app-config/update','\x20app\x20config\x20','write','apiError','isFinite','10HZZaNS','56SSccCl','425tKQcPr','update','create','14836WiQWYu','Created'];a28_0x47ca=function(){return _0x2f7c75;};return a28_0x47ca();}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_0xe00e65(0x127),UPDATE_PATH=a28_0xe00e65(0x11b);function a28_0x2b4a(_0x52973b,_0x401d5d){_0x52973b=_0x52973b-0x11b;const _0x47cafe=a28_0x47ca();let _0x2b4a98=_0x47cafe[_0x52973b];return _0x2b4a98;}export const appConfigSet={'service':'app-config','command':a28_0xe00e65(0x138),'description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a28_0xe00e65(0x11d),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0xe00e65(0x134),'type':a28_0xe00e65(0x131),'description':a28_0xe00e65(0x12f)}],async 'validate'(_0x5b6f95){readKeyArg(_0x5b6f95),readOptionalTags(_0x5b6f95),assertSingleValueSource(_0x5b6f95);},async 'dryRun'(_0x46fbed){const _0x107194=a28_0xe00e65,_0x57e2ad=readKeyArg(_0x46fbed),_0x36ec06=readOptionalTags(_0x46fbed),_0x36ed5b=assertSingleValueSource(_0x46fbed);await assertValueSourceReadable(_0x36ed5b);const _0x4e3f6d=await withAppConfigApiBoundary(_0x107194(0x12b),{'appCode':_0x46fbed[_0x107194(0x133)],'key':_0x57e2ad},()=>getAppConfigByKey(_0x46fbed['appCode'],_0x57e2ad)),_0x2ef997=_0x4e3f6d?_0x107194(0x123):'create',_0xf4268a=_0x4e3f6d?projectAppConfig(_0x4e3f6d):null,_0x44f179=plannedAppConfig({'appCode':_0x46fbed['appCode'],'key':_0x57e2ad,'tags':_0x36ec06??_0x4e3f6d?.[_0x107194(0x12a)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x2ef997,'appCode':_0x46fbed[_0x107194(0x133)],'key':_0x57e2ad,'before':_0xf4268a,'after':_0x44f179,'dryRun':!![]}),{'method':_0x107194(0x132),'url':_0x2ef997===_0x107194(0x123)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x527727){const _0x3d651b=a28_0xe00e65,_0x5ee183=readKeyArg(_0x527727),_0x116cb8=readOptionalTags(_0x527727),_0x10b507=await withAppConfigApiBoundary(_0x3d651b(0x12b),{'appCode':_0x527727[_0x3d651b(0x133)],'key':_0x5ee183},()=>getAppConfigByKey(_0x527727[_0x3d651b(0x133)],_0x5ee183)),_0xb5a3ec=_0x10b507?projectAppConfig(_0x10b507):null,_0x461176=_0x10b507?_0x3d651b(0x123):_0x3d651b(0x124),{value:_0x4ecf8d,warnings:_0x7181f1}=await readAppConfigValue(_0x527727),_0x2077e1={'appCode':_0x527727['appCode'],'key':_0x5ee183,'value':_0x4ecf8d,'tags':_0x116cb8??_0x10b507?.[_0x3d651b(0x12a)]??undefined};await withAppConfigApiBoundary(_0x461176,{'appCode':_0x527727[_0x3d651b(0x133)],'key':_0x5ee183},async()=>{const _0x3333b3=_0x3d651b;_0x10b507?await updateAppConfig({..._0x2077e1,'id':requireAppConfigId(_0x10b507,_0x5ee183,_0x527727[_0x3333b3(0x133)])}):await createAppConfig(_0x2077e1);});const _0x47fb0f=await withAppConfigApiBoundary(_0x3d651b(0x12b),{'appCode':_0x527727[_0x3d651b(0x133)],'key':_0x5ee183},()=>getAppConfigByKey(_0x527727[_0x3d651b(0x133)],_0x5ee183)),_0x33d29a=_0x47fb0f?projectAppConfig(_0x47fb0f):plannedAppConfig({'appCode':_0x527727[_0x3d651b(0x133)],'key':_0x5ee183,'tags':_0x2077e1[_0x3d651b(0x12a)],'hasValue':_0x4ecf8d!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x461176,'appCode':_0x527727[_0x3d651b(0x133)],'key':_0x5ee183,'before':_0xb5a3ec,'after':_0x33d29a,'dryRun':![],'warnings':_0x7181f1}),'message':(_0x461176===_0x3d651b(0x123)?_0x3d651b(0x12d):_0x3d651b(0x126))+_0x3d651b(0x11c)+_0x5ee183};}};function requireAppConfigId(_0x276270,_0x34ebfd,_0x2e6270){const _0x378b71=a28_0xe00e65;if(typeof _0x276270['id']==='number'&&Number[_0x378b71(0x11f)](_0x276270['id'])&&_0x276270['id']>0x0)return _0x276270['id'];throw CliErrors[_0x378b71(0x11e)](_0x378b71(0x130)+_0x34ebfd+_0x378b71(0x136)+_0x2e6270);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x13b7b4=a29_0x2527;(function(_0x39b777,_0x2733fe){const _0xb468cf=a29_0x2527,_0x592a09=_0x39b777();while(!![]){try{const _0x410cd5=parseInt(_0xb468cf(0x1de))/0x1+-parseInt(_0xb468cf(0x1db))/0x2*(-parseInt(_0xb468cf(0x1e2))/0x3)+parseInt(_0xb468cf(0x1e1))/0x4+-parseInt(_0xb468cf(0x1d0))/0x5*(-parseInt(_0xb468cf(0x1f2))/0x6)+parseInt(_0xb468cf(0x1fe))/0x7*(-parseInt(_0xb468cf(0x1eb))/0x8)+parseInt(_0xb468cf(0x1fa))/0x9+-parseInt(_0xb468cf(0x1cf))/0xa*(parseInt(_0xb468cf(0x1d2))/0xb);if(_0x410cd5===_0x2733fe)break;else _0x592a09['push'](_0x592a09['shift']());}catch(_0x29810b){_0x592a09['push'](_0x592a09['shift']());}}}(a29_0x1854,0x1975d));import{access,readFile}from'node:fs/promises';function a29_0x1854(){const _0x2e3b5b=['Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','152549bkHsec','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','792504imlDAR','3aVoUOH','flag','validation','trim','boolean','setEncoding','appCode:\x20','Failed\x20to\x20','Environment\x20variable\x20is\x20not\x20set:\x20','8ztkScR','argument','App\x20config\x20value\x20source\x20is\x20ambiguous.','gmtCreate','tags','kind','file','1050XfpXXC','slice','path','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','before','value\x20is\x20redacted','after','push','578601DQzDtC','gmtModified','length','end','765002htuzHE','args','operation','name','appCode','once','stdin','defineProperties','string','bool','utf8','reveal','valueRedacted','apiError','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','\x20app\x20config.','Read\x20config\x20value\x20from\x20stdin','140YAXyQr','2580JtuoLR','from-env','390775sDwbqj','method','value','str','key','join','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','warnings','env','411314MHvcKX','key:\x20'];a29_0x1854=function(){return _0x2e3b5b;};return a29_0x1854();}import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x13b7b4(0x1d6),'description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a29_0x13b7b4(0x1d4),'description':a29_0x13b7b4(0x1d8),'required':![]};function a29_0x2527(_0x166eec,_0x37e1ea){_0x166eec=_0x166eec-0x1c9;const _0x1854f9=a29_0x1854();let _0x252711=_0x1854f9[_0x166eec];return _0x252711;}export const TAGS_FLAG={'name':a29_0x13b7b4(0x1ef),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a29_0x13b7b4(0x204),'type':'boolean','description':a29_0x13b7b4(0x1ce),'default':![]};export const FROM_ENV_FLAG={'name':a29_0x13b7b4(0x1d1),'type':a29_0x13b7b4(0x206),'description':a29_0x13b7b4(0x1f5)};export const REVEAL_FLAG={'name':'reveal','type':a29_0x13b7b4(0x1e6),'description':a29_0x13b7b4(0x1e0),'default':![]};export function readKeyArg(_0x165431){const _0x2ad6c7=_0x165431['args'][0x0]?.['trim']()??'';return validateKey(_0x2ad6c7),_0x2ad6c7;}export function readOptionalTags(_0x5e7380){const _0x4fa338=a29_0x13b7b4,_0x4188ca=_0x5e7380['str'](_0x4fa338(0x1ef))[_0x4fa338(0x1e5)]();if(!_0x4188ca)return undefined;if(_0x4188ca[_0x4fa338(0x1fc)]>0x20)throw CliErrors['validation']('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x4188ca;}export function validateKey(_0xeb6b26){const _0x58082b=a29_0x13b7b4;if(!_0xeb6b26)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0xeb6b26['length']>0x100)throw CliErrors[_0x58082b(0x1e4)](_0x58082b(0x1cc));}export function projectAppConfig(_0x4e86c8,_0x5f46b9){const _0x54f43c=a29_0x13b7b4,_0x4f3053=_0x4e86c8['value']!==undefined&&_0x4e86c8[_0x54f43c(0x1d4)]!==null&&_0x4e86c8[_0x54f43c(0x1d4)]!=='',_0x386e1f={'appCode':_0x4e86c8[_0x54f43c(0x202)],'key':_0x4e86c8[_0x54f43c(0x1d6)],'tags':_0x4e86c8[_0x54f43c(0x1ef)]??undefined,'hasValue':_0x4f3053,'valueRedacted':_0x4f3053&&!_0x5f46b9?.[_0x54f43c(0x1c9)],'gmtCreate':_0x4e86c8[_0x54f43c(0x1ee)],'gmtModified':_0x4e86c8[_0x54f43c(0x1fb)]};return _0x5f46b9?.[_0x54f43c(0x1c9)]&&(_0x386e1f[_0x54f43c(0x1d4)]=_0x4e86c8[_0x54f43c(0x1d4)]??'',_0x386e1f[_0x54f43c(0x1ca)]=![]),_0x386e1f;}export function plannedAppConfig(_0x104882){const _0x5c3cce=a29_0x13b7b4,_0x37be2a=_0x104882['hasValue']??!![];return{'appCode':_0x104882[_0x5c3cce(0x202)],'key':_0x104882['key'],'tags':_0x104882[_0x5c3cce(0x1ef)]??undefined,'hasValue':_0x37be2a,'valueRedacted':_0x37be2a};}export function buildMutationData(_0x34c599){const _0x28e62f=a29_0x13b7b4;return{'operation':_0x34c599[_0x28e62f(0x200)],'selector':{'appCode':_0x34c599[_0x28e62f(0x202)],'key':_0x34c599['key']},'before':_0x34c599[_0x28e62f(0x1f6)],'after':_0x34c599[_0x28e62f(0x1f8)],'dryRun':_0x34c599['dryRun'],'warnings':_0x34c599[_0x28e62f(0x1d9)]??[]};}export async function withAppConfigApiBoundary(_0x475c16,_0x4c034f,_0x35dd96){const _0x1f5623=a29_0x13b7b4;try{return await _0x35dd96();}catch{const _0x4ae492=[_0x1f5623(0x1e8)+_0x4c034f['appCode']];if(_0x4c034f[_0x1f5623(0x1d6)])_0x4ae492[_0x1f5623(0x1f9)](_0x1f5623(0x1dc)+_0x4c034f['key']);_0x4ae492[_0x1f5623(0x1f9)](_0x1f5623(0x1f7));throw CliErrors[_0x1f5623(0x1cb)](_0x1f5623(0x1e9)+_0x475c16+_0x1f5623(0x1cd),_0x4ae492[_0x1f5623(0x1d7)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x51cbd1,_0x3596e0){const _0x5221d2=a29_0x13b7b4;return Object[_0x5221d2(0x205)](_0x51cbd1,{'method':{'value':_0x3596e0[_0x5221d2(0x1d3)],'enumerable':![]},'url':{'value':_0x3596e0['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x189b50){const _0x48670f=a29_0x13b7b4,_0x669f88=[];_0x189b50[_0x48670f(0x1ff)][_0x48670f(0x1fc)]>0x1&&_0x669f88[_0x48670f(0x1f9)]({'kind':_0x48670f(0x1ec),'value':_0x189b50[_0x48670f(0x1ff)][_0x48670f(0x1f3)](0x1)[_0x48670f(0x1d7)]('\x20')});const _0x64576=_0x189b50[_0x48670f(0x1e3)]('value');_0x64576!==undefined&&_0x64576!==null&&_0x669f88['push']({'kind':_0x48670f(0x1ec),'value':String(_0x64576)});_0x189b50[_0x48670f(0x207)](_0x48670f(0x204))&&_0x669f88[_0x48670f(0x1f9)]({'kind':'stdin'});const _0x3cc109=_0x189b50[_0x48670f(0x1d5)](_0x48670f(0x1d1))[_0x48670f(0x1e5)]();_0x3cc109&&_0x669f88[_0x48670f(0x1f9)]({'kind':'env','name':_0x3cc109});const _0x46a498=_0x189b50['str'](_0x48670f(0x1f1))['trim']();_0x46a498&&_0x669f88[_0x48670f(0x1f9)]({'kind':_0x48670f(0x1f1),'path':_0x46a498});if(_0x669f88['length']===0x0)throw CliErrors['validation']('Missing\x20app-config\x20value\x20source.',_0x48670f(0x1dd));if(_0x669f88[_0x48670f(0x1fc)]>0x1)throw CliErrors[_0x48670f(0x1e4)](_0x48670f(0x1ed),_0x48670f(0x1df));return _0x669f88[0x0];}export async function assertValueSourceReadable(_0x54c31a){const _0x504e9a=a29_0x13b7b4;if(_0x54c31a[_0x504e9a(0x1f0)]===_0x504e9a(0x1da)&&!(_0x54c31a[_0x504e9a(0x201)]in process.env))throw CliErrors[_0x504e9a(0x1e4)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x54c31a[_0x504e9a(0x201)]);if(_0x54c31a[_0x504e9a(0x1f0)]===_0x504e9a(0x1f1))try{await access(_0x54c31a['path']);}catch{throw CliErrors[_0x504e9a(0x1e4)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x54c31a[_0x504e9a(0x1f4)]);}}export async function readAppConfigValue(_0x5dd612){const _0x2d9b8a=a29_0x13b7b4,_0xef1719=assertSingleValueSource(_0x5dd612),_0x2a403a=[];if(_0xef1719[_0x2d9b8a(0x1f0)]===_0x2d9b8a(0x1ec))return _0x2a403a[_0x2d9b8a(0x1f9)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0xef1719['value']??'','source':_0xef1719[_0x2d9b8a(0x1f0)],'warnings':_0x2a403a};if(_0xef1719[_0x2d9b8a(0x1f0)]===_0x2d9b8a(0x204))return{'value':await readStdin(),'source':_0xef1719[_0x2d9b8a(0x1f0)],'warnings':_0x2a403a};if(_0xef1719[_0x2d9b8a(0x1f0)]==='env'){if(!(_0xef1719[_0x2d9b8a(0x201)]in process.env))throw CliErrors[_0x2d9b8a(0x1e4)](_0x2d9b8a(0x1ea)+_0xef1719[_0x2d9b8a(0x201)]);return{'value':process.env[_0xef1719.name]??'','source':_0xef1719[_0x2d9b8a(0x1f0)],'warnings':_0x2a403a};}return{'value':await readFile(_0xef1719[_0x2d9b8a(0x1f4)],_0x2d9b8a(0x208)),'source':_0xef1719[_0x2d9b8a(0x1f0)],'warnings':_0x2a403a};}function readStdin(){return new Promise((_0x4f8418,_0x24e465)=>{const _0x345681=a29_0x2527;let _0x106fb2='';process[_0x345681(0x204)][_0x345681(0x1e7)](_0x345681(0x208)),process[_0x345681(0x204)]['on']('data',_0x303c5f=>{_0x106fb2+=_0x303c5f;}),process[_0x345681(0x204)]['once'](_0x345681(0x1fd),()=>_0x4f8418(_0x106fb2)),process[_0x345681(0x204)][_0x345681(0x203)]('error',_0x24e465);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a30_0xbdc9(_0x343fa4,_0x2a3722){_0x343fa4=_0x343fa4-0xce;const _0x39923a=a30_0x3992();let _0xbdc9d6=_0x39923a[_0x343fa4];return _0xbdc9d6;}const a30_0x78b56e=a30_0xbdc9;(function(_0x333378,_0x4ad8ac){const _0x438d17=a30_0xbdc9,_0x5b4b00=_0x333378();while(!![]){try{const _0x332d9f=parseInt(_0x438d17(0xd7))/0x1+parseInt(_0x438d17(0xd8))/0x2*(-parseInt(_0x438d17(0xd6))/0x3)+-parseInt(_0x438d17(0xd2))/0x4+parseInt(_0x438d17(0xd4))/0x5*(parseInt(_0x438d17(0xd0))/0x6)+-parseInt(_0x438d17(0xdf))/0x7+parseInt(_0x438d17(0xe3))/0x8*(parseInt(_0x438d17(0xe1))/0x9)+parseInt(_0x438d17(0xce))/0xa;if(_0x332d9f===_0x4ad8ac)break;else _0x5b4b00['push'](_0x5b4b00['shift']());}catch(_0x539b38){_0x5b4b00['push'](_0x5b4b00['shift']());}}}(a30_0x3992,0x5751a));function a30_0x3992(){const _0x5b4f92=['6936870ZPHfkL','!\x20Not\x20logged\x20in','6852INyWVG','logout','2108160knkzCX','yes','2130neRBek','../../auth/auth-server-ui.js','19956DgtHBK','481508qiDJsg','200LxgoGf','nonInteractive','auth','write','log','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','Login\x20via\x20browser','4389280nupkvc','login','4637259VnWxPq','Clear\x20login\x20session','8XppkdN'];a30_0x3992=function(){return _0x5b4f92;};return a30_0x3992();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a30_0x78b56e(0xe0),'description':a30_0x78b56e(0xde),'risk':a30_0x78b56e(0xdb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a30_0x78b56e(0xd3),'type':'boolean','description':a30_0x78b56e(0xdd),'default':![]}],async 'execute'(_0x430866){const _0x50594c=a30_0x78b56e,{runAuthServer:_0x25a25f}=await import(_0x50594c(0xd5));return await _0x25a25f({'autoYes':_0x430866['bool'](_0x50594c(0xd3)),'nonInteractive':_0x430866[_0x50594c(0xd9)]}),{'ok':!![]};}},{'service':a30_0x78b56e(0xda),'command':a30_0x78b56e(0xd1),'description':a30_0x78b56e(0xe2),'risk':a30_0x78b56e(0xdb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x990cae){const _0x50ec60=a30_0x78b56e;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console[_0x50ec60(0xdc)](_0x50ec60(0xcf)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x862ec=a31_0x48a1;(function(_0x409ebd,_0x5ea4cc){const _0x129b16=a31_0x48a1,_0x525a1e=_0x409ebd();while(!![]){try{const _0x43249d=parseInt(_0x129b16(0x14b))/0x1*(parseInt(_0x129b16(0x10e))/0x2)+-parseInt(_0x129b16(0x157))/0x3*(parseInt(_0x129b16(0x12d))/0x4)+-parseInt(_0x129b16(0x102))/0x5*(parseInt(_0x129b16(0x13c))/0x6)+-parseInt(_0x129b16(0x135))/0x7*(parseInt(_0x129b16(0x147))/0x8)+parseInt(_0x129b16(0x132))/0x9+-parseInt(_0x129b16(0x11e))/0xa*(parseInt(_0x129b16(0x104))/0xb)+parseInt(_0x129b16(0x14a))/0xc;if(_0x43249d===_0x5ea4cc)break;else _0x525a1e['push'](_0x525a1e['shift']());}catch(_0x2e005d){_0x525a1e['push'](_0x525a1e['shift']());}}}(a31_0x1881,0xb5e0f));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';function a31_0x48a1(_0x16ad2d,_0x2013d1){_0x16ad2d=_0x16ad2d-0xf7;const _0x18813e=a31_0x1881();let _0x48a1c5=_0x18813e[_0x16ad2d];return _0x48a1c5;}import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':'create','description':a31_0x862ec(0x10c),'risk':a31_0x862ec(0x13f),'flags':[{'name':'type','type':'string','required':!![],'enum':[a31_0x862ec(0x10a),'ENDPOINT',a31_0x862ec(0x133)],'description':a31_0x862ec(0x11a)},{'name':a31_0x862ec(0x15e),'type':a31_0x862ec(0x105),'required':!![],'description':a31_0x862ec(0x12f)},{'name':a31_0x862ec(0x130),'type':a31_0x862ec(0x105),'description':a31_0x862ec(0xf9)},{'name':a31_0x862ec(0x118),'type':a31_0x862ec(0x105),'description':a31_0x862ec(0x148)},{'name':a31_0x862ec(0x142),'type':'string','description':a31_0x862ec(0x12a)},{'name':a31_0x862ec(0x124),'type':a31_0x862ec(0x105),'description':a31_0x862ec(0x13e)},{'name':a31_0x862ec(0x12c),'type':a31_0x862ec(0x105),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a31_0x862ec(0x15b)]}],async 'validate'(_0x35633a){const _0x9c5dae=a31_0x862ec,_0x4477a9=_0x35633a['str'](_0x9c5dae(0x15e));if(!isValidBffFunctionName(_0x4477a9))throw CliErrors[_0x9c5dae(0xf8)](_0x9c5dae(0x141)+_0x4477a9+_0x9c5dae(0x149));},async 'execute'(_0x236440){const _0x3bc020=a31_0x862ec,_0x557ec1=loadBffProjectConfig(_0x236440[_0x3bc020(0x15c)]),_0x194c21=_0x236440[_0x3bc020(0x151)](_0x3bc020(0x13a)),_0xc22526=_0x236440['str'](_0x3bc020(0x15e)),_0x140e94=_0x236440[_0x3bc020(0x151)](_0x3bc020(0x130))||undefined,_0x24b058=_0x194c21===_0x3bc020(0x133)?await resolveHookOptions(_0x557ec1,_0x236440):undefined,_0x10d52f=buildFilePath(_0x557ec1,_0x194c21,_0xc22526,_0x24b058);if(await fileExists(_0x10d52f))throw CliErrors[_0x3bc020(0xf8)](_0x3bc020(0x110)+_0x10d52f);await mkdir(dirname(_0x10d52f),{'recursive':!![]});const _0x59f3c1=generateTemplate(_0x194c21,_0xc22526,_0x236440[_0x3bc020(0x15c)],_0x140e94,_0x24b058);await writeFile(_0x10d52f,_0x59f3c1,'utf8');const _0x6e776c={'type':_0x194c21,'name':_0xc22526,'path':_0x10d52f};if(_0x140e94)_0x6e776c[_0x3bc020(0x130)]=_0x140e94;if(_0x24b058){if(_0x24b058[_0x3bc020(0x118)])_0x6e776c[_0x3bc020(0x118)]=_0x24b058['alias'];_0x6e776c['datasetCode']=_0x24b058['datasetCode'],_0x6e776c['operationType']=_0x24b058[_0x3bc020(0x144)],_0x6e776c[_0x3bc020(0x13b)]=_0x24b058[_0x3bc020(0x13b)];}return{'ok':!![],'data':_0x6e776c,'message':'Created\x20'+_0x194c21+_0x3bc020(0x11f)+_0xc22526};}};async function resolveHookOptions(_0x2382c2,_0x2dd4e3){const _0x23a4fb=a31_0x862ec,_0x55ca8c=loadAliasMap(_0x2dd4e3['apiDir'],undefined,resolveApiFilePath(_0x2dd4e3[_0x23a4fb(0x140)],_0x2dd4e3[_0x23a4fb(0x15c)])),_0x4e9526=_0x55ca8c[_0x23a4fb(0x112)]>0x0;let _0x2d160f,_0x59eb7d,_0x340546;const _0x1271a2=_0x2dd4e3[_0x23a4fb(0x151)](_0x23a4fb(0x118)),_0x31b45d=_0x2dd4e3[_0x23a4fb(0x151)](_0x23a4fb(0x142));if(_0x1271a2){const _0x3be177=resolveAlias(_0x2dd4e3[_0x23a4fb(0x140)],_0x1271a2,undefined,resolveApiFilePath(_0x2dd4e3[_0x23a4fb(0x140)],_0x2dd4e3[_0x23a4fb(0x15c)]));if(!_0x3be177){const _0x1d77d8=_0x4e9526?'Available\x20aliases:\x20'+_0x55ca8c[_0x23a4fb(0x159)](_0x14259f=>_0x14259f[_0x23a4fb(0x118)])[_0x23a4fb(0x10f)](',\x20'):_0x23a4fb(0x160)+CLI_BIN_NAME+_0x23a4fb(0x10b);throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x155)+_0x1271a2+_0x23a4fb(0x139)+_0x1d77d8);}_0x2d160f=_0x1271a2,_0x59eb7d=_0x3be177;}else{if(_0x31b45d){_0x59eb7d=_0x31b45d;const _0x291b62=_0x55ca8c[_0x23a4fb(0x154)](_0x437589=>_0x437589[_0x23a4fb(0x126)]===_0x31b45d);_0x2d160f=_0x291b62?.[_0x23a4fb(0x118)];}else{if(_0x2dd4e3['nonInteractive'])throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x136));else{if(_0x4e9526){const _0x45b0d0=_0x55ca8c[_0x23a4fb(0x159)](_0x2e2857=>_0x2e2857['alias']+'\x20('+_0x2e2857[_0x23a4fb(0x145)]+')'),_0xbc5a1=await promptSelect(_0x23a4fb(0xfb),_0x45b0d0),_0x461f71=_0x55ca8c[_0xbc5a1];if(!_0x461f71)throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x146));_0x2d160f=_0x461f71[_0x23a4fb(0x118)],_0x59eb7d=_0x461f71['datasetCode'];}else{const _0x18c7b2=await listDatasets(_0x2dd4e3['appCode']);if(_0x18c7b2['length']===0x0)throw CliErrors['validation'](_0x23a4fb(0x121));const _0x571f7e=_0x18c7b2[_0x23a4fb(0x159)](_0x8b0b5b=>_0x8b0b5b[_0x23a4fb(0x15e)]+'\x20['+(_0x8b0b5b[_0x23a4fb(0x116)]??'UNKNOWN')+']\x20('+_0x8b0b5b['code']+')'),_0x2cd5fe=await promptSelect(_0x23a4fb(0xfb),_0x571f7e),_0x10d0f8=_0x18c7b2[_0x2cd5fe];if(!_0x10d0f8)throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x146));_0x59eb7d=_0x10d0f8[_0x23a4fb(0x150)],_0x2d160f=undefined;}}}}const _0x212a65=await listDatasets(_0x2dd4e3[_0x23a4fb(0x15c)]),_0xb7ff55=_0x212a65['find'](_0x222dbd=>_0x222dbd[_0x23a4fb(0x150)]===_0x59eb7d);if(!_0xb7ff55)throw CliErrors[_0x23a4fb(0xf8)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x59eb7d+_0x23a4fb(0x101)+(_0x2d160f?_0x23a4fb(0xfc)+CLI_BIN_NAME+_0x23a4fb(0xfa):''));_0x340546=_0xb7ff55['id'];const _0x4251d9=_0x2d160f??_0x59eb7d,_0x489ed9=await listBffDatasetOperations(_0x2dd4e3[_0x23a4fb(0x15c)],_0x340546),_0x5695b0=_0x489ed9?Object[_0x23a4fb(0x14f)](_0x489ed9):[];if(_0x5695b0[_0x23a4fb(0x112)]===0x0)throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x122)+_0x4251d9+'.');let _0x42f4c9;const _0x462cef=_0x2dd4e3[_0x23a4fb(0x151)](_0x23a4fb(0x124));if(_0x462cef){if(!_0x5695b0[_0x23a4fb(0x143)](_0x462cef))throw CliErrors[_0x23a4fb(0xf8)](_0x23a4fb(0x108)+_0x462cef+_0x23a4fb(0x128)+_0x4251d9+'.\x20'+(_0x23a4fb(0x111)+_0x5695b0[_0x23a4fb(0x10f)](',\x20')));_0x42f4c9=_0x462cef;}else{if(_0x2dd4e3[_0x23a4fb(0x106)])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5c543e=await promptSelect(_0x23a4fb(0x10d),_0x5695b0);_0x42f4c9=_0x5695b0[_0x5c543e]??_0x5695b0[0x0];}let _0x476a55=normalizeHookFunctionNode(_0x2dd4e3[_0x23a4fb(0x151)](_0x23a4fb(0x12c)));if(!_0x476a55){if(_0x2dd4e3[_0x23a4fb(0x151)](_0x23a4fb(0x12c)))throw CliErrors[_0x23a4fb(0xf8)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2dd4e3['nonInteractive'])throw CliErrors['validation'](_0x23a4fb(0x119));const _0x3ccc8e=await promptSelect(_0x23a4fb(0x123),['before',_0x23a4fb(0x15b)]);_0x476a55=[_0x23a4fb(0x120),'after'][_0x3ccc8e]??'before';}return{'alias':_0x2d160f,'datasetCode':_0x59eb7d,'datasetId':_0x340546,'operationType':_0x42f4c9,'functionNode':_0x476a55};}async function promptSelect(_0x643579,_0x428f07){const _0x3a4ee0=a31_0x862ec;if(_0x428f07['length']===0x1)return 0x0;for(const [_0x3b0d30,_0x3eb9f9]of _0x428f07[_0x3a4ee0(0xfe)]()){process['stderr'][_0x3a4ee0(0xff)]('\x20\x20'+(_0x3b0d30+0x1)+'.\x20'+_0x3eb9f9+'\x0a');}const _0x5b28fa=createInterface({'input':process[_0x3a4ee0(0xf7)],'output':process[_0x3a4ee0(0x14e)]});while(!![]){const _0x441a30=await new Promise(_0x2508f0=>{const _0x25246f=_0x3a4ee0;_0x5b28fa[_0x25246f(0x15d)](_0x643579+'\x20',_0x2508f0);}),_0x19dd5a=Number[_0x3a4ee0(0x152)](_0x441a30[_0x3a4ee0(0x115)](),0xa);if(Number[_0x3a4ee0(0x153)](_0x19dd5a)&&_0x19dd5a>=0x1&&_0x19dd5a<=_0x428f07['length'])return _0x5b28fa[_0x3a4ee0(0x11b)](),_0x19dd5a-0x1;process[_0x3a4ee0(0x14e)][_0x3a4ee0(0xff)](_0x3a4ee0(0x11d)+_0x428f07['length']+'.\x0a');}}function a31_0x1881(){const _0x1aa26c=['COMMON','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Select\x20operation\x20type:','622194JSDLoj','join','File\x20already\x20exists:\x20','Available:\x20','length','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x22,\x20params\x20})\x0a','trim','source','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','alias','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','close','\x0a\x20*\x20[平台配置]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','2925410RZKosN','\x20function:\x20','before','No\x20datasets\x20found\x20for\x20this\x20app.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Select\x20trigger\x20node:','operation-type','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','datasetCode','/ENDPOINT/','\x22\x20not\x20found\x20for\x20dataset\x20','ENDPOINT','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','function-node','1505464lPtapU','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Function\x20name\x20(valid\x20JS\x20identifier)','description','/HOOK/','8327097zivjLP','HOOK','.js','3073854aLvNOn','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','修改后的请求参数','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x22\x20not\x20found.\x20','type','functionNode','30RGHHBp','/COMMON/','Operation\x20type\x20(HOOK\x20only)','read','apiDir','Invalid\x20function\x20name\x20\x22','datasetcode','includes','operationType','tableName','Invalid\x20dataset\x20selection.','24bxGXHN','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','33339360fSVaXe','1zMHoLW','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','stderr','keys','code','str','parseInt','isInteger','find','Alias\x20\x22','.js\x0a\x20*\x20[触发节点]\x20','6awLMVa','当前请求参数','map','\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','after','appCode','question','name','HOOK\x20requires\x20alias/operation/node\x20options.','No\x20api.ts\x20found.\x20Run\x20`','stdin','validation','Script\x20description','\x20api\x20pull`\x20to\x20refresh.','Select\x20dataset:','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','当前响应结果','entries','write','/**\x0a\x20*\x20','\x22.\x20','614455gSvdvD','\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','22EAexGV','string','nonInteractive','scriptsRootDir','Operation\x20type\x20\x22','修改后的响应结果'];a31_0x1881=function(){return _0x1aa26c;};return a31_0x1881();}function buildFilePath(_0x2d4157,_0x446cd3,_0x2eefcf,_0x317917){const _0x34d8e7=a31_0x862ec;if(_0x446cd3==='HOOK'){if(!_0x317917)throw CliErrors[_0x34d8e7(0xf8)](_0x34d8e7(0x15f));const _0x3cd651=_0x317917[_0x34d8e7(0x118)]??_0x317917[_0x34d8e7(0x126)];return join(_0x2d4157[_0x34d8e7(0x107)],'HOOK',_0x3cd651,_0x317917[_0x34d8e7(0x144)],_0x317917[_0x34d8e7(0x13b)],_0x2eefcf+_0x34d8e7(0x134));}return join(_0x2d4157[_0x34d8e7(0x107)],_0x446cd3,_0x2eefcf+_0x34d8e7(0x134));}export function generateTemplate(_0x1472ad,_0x4d5344,_0x52fcfe,_0x4ecf93,_0x3e6d4c){const _0x47b1dc=a31_0x862ec,_0x32e189=_0x4ecf93?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x3785b7=getAppBaseUrl(_0x52fcfe),_0x25482f='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x1472ad===_0x47b1dc(0x10a))return _0x47b1dc(0x100)+_0x32e189+_0x47b1dc(0x12e)+_0x4d5344+_0x47b1dc(0x11c)+_0x3785b7+_0x47b1dc(0x117)+_0x52fcfe+_0x47b1dc(0x13d)+_0x4d5344+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x4d5344+_0x47b1dc(0x114)+_0x25482f+_0x47b1dc(0x15a)+_0x4d5344+_0x47b1dc(0x113);if(_0x1472ad===_0x47b1dc(0x129))return _0x47b1dc(0x100)+_0x32e189+_0x47b1dc(0x138)+_0x4d5344+_0x47b1dc(0x14c)+_0x52fcfe+'/'+_0x4d5344+_0x47b1dc(0x11c)+_0x3785b7+_0x47b1dc(0x117)+_0x52fcfe+_0x47b1dc(0x127)+_0x4d5344+'.js\x0a'+_0x25482f+_0x47b1dc(0x103)+_0x4d5344+_0x47b1dc(0x113);if(!_0x3e6d4c)throw CliErrors[_0x47b1dc(0xf8)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x3c5809=_0x3e6d4c['alias']??_0x3e6d4c[_0x47b1dc(0x126)],_0x1af9e7=_0x3e6d4c[_0x47b1dc(0x13b)]==='before'?_0x47b1dc(0x158):_0x47b1dc(0xfd),_0xb3f646=_0x3e6d4c[_0x47b1dc(0x13b)]===_0x47b1dc(0x120)?_0x47b1dc(0x137):_0x47b1dc(0x109);return'/**\x0a\x20*\x20'+_0x32e189+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x4d5344+_0x47b1dc(0x12b)+_0x52fcfe+'/'+_0x3e6d4c[_0x47b1dc(0x126)]+'/'+_0x3e6d4c['operationType']+'\x0a\x20*\x20[平台配置]\x20'+_0x3785b7+'/data/dataset/'+_0x3e6d4c['datasetId']+_0x47b1dc(0x125)+_0x52fcfe+_0x47b1dc(0x131)+_0x3c5809+'/'+_0x3e6d4c[_0x47b1dc(0x144)]+'/'+_0x3e6d4c[_0x47b1dc(0x13b)]+'/'+_0x4d5344+_0x47b1dc(0x156)+_0x3e6d4c['functionNode']+'\x0a'+_0x25482f+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x1af9e7+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0xb3f646+_0x47b1dc(0x14d)+_0x4d5344+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
function a31_0x2e5e(_0x30a515,_0x38612a){_0x30a515=_0x30a515-0x1c6;const _0x1ea9ab=a31_0x1ea9();let _0x2e5ebb=_0x1ea9ab[_0x30a515];return _0x2e5ebb;}const a31_0x51863f=a31_0x2e5e;(function(_0x127173,_0x56fb59){const _0xafc6fd=a31_0x2e5e,_0x4d359e=_0x127173();while(!![]){try{const _0x487440=parseInt(_0xafc6fd(0x1d9))/0x1*(parseInt(_0xafc6fd(0x227))/0x2)+parseInt(_0xafc6fd(0x20e))/0x3*(parseInt(_0xafc6fd(0x20f))/0x4)+-parseInt(_0xafc6fd(0x1e4))/0x5*(-parseInt(_0xafc6fd(0x1d8))/0x6)+parseInt(_0xafc6fd(0x21e))/0x7*(-parseInt(_0xafc6fd(0x221))/0x8)+-parseInt(_0xafc6fd(0x1e0))/0x9*(parseInt(_0xafc6fd(0x1d6))/0xa)+parseInt(_0xafc6fd(0x1ff))/0xb+-parseInt(_0xafc6fd(0x1c6))/0xc*(parseInt(_0xafc6fd(0x1f7))/0xd);if(_0x487440===_0x56fb59)break;else _0x4d359e['push'](_0x4d359e['shift']());}catch(_0x5c236a){_0x4d359e['push'](_0x4d359e['shift']());}}}(a31_0x1ea9,0xda789));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';function a31_0x1ea9(){const _0x2306db=['functionNode','80925EKlKee','stdin','before','appCode','code','function-node','after','COMMON','17236197gHCJty','\x22\x20not\x20found\x20for\x20dataset\x20','datasetId','Operation\x20type\x20(HOOK\x20only)','Available\x20aliases:\x20','\x22,\x20params\x20})\x0a','Select\x20trigger\x20node:','scriptsRootDir','.js','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','operationType','name','Dataset\x20not\x20found\x20for\x20code\x20\x22','No\x20operation\x20types\x20found\x20for\x20dataset\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无(如有通知或外部调用,说明影响与失败策略)','388791RDlnRv','40qURhny','datasetcode','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','validation','修改后的响应结果','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','Operation\x20type\x20\x22','/ENDPOINT/','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Invalid\x20dataset\x20selection.','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','Select\x20operation\x20type:','question','entries','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','2445583lOoLkH','apiDir','修改后的请求参数','24JdPmlA','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','string','tableName','.js\x0a\x20*\x20[触发节点]\x20','1148rFRftl','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x20function:\x20','/HOOK/','nonInteractive','No\x20api.ts\x20found.\x20Run\x20`','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22\x20not\x20found.\x20','stderr','length','\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','3228vCohBS','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','write','Script\x20description','/**\x0a\x20*\x20','str','isInteger','map','No\x20datasets\x20found\x20for\x20this\x20app.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','HOOK','parseInt','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Invalid\x20function\x20name\x20\x22','operation-type','read','2935340BfBYQd','\x0a\x20*\x20[平台配置]\x20','46236srbbaW','2086hoBWUR','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','Created\x20','ENDPOINT','source','\x20api\x20pull`\x20to\x20refresh.','.js\x0a','45EENPIc','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\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','665OsYFIc','description','keys','\x22.\x20','close','alias','Available:\x20','join','type','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','find','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','当前响应结果',']\x20(','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','datasetCode','Alias\x20\x22','UNKNOWN'];a31_0x1ea9=function(){return _0x2306db;};return a31_0x1ea9();}import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':'create','description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0x51863f(0x1d5),'flags':[{'name':a31_0x51863f(0x1ec),'type':a31_0x51863f(0x224),'required':!![],'enum':[a31_0x51863f(0x1fe),a31_0x51863f(0x1dc),a31_0x51863f(0x1d0)],'description':'Script\x20type'},{'name':a31_0x51863f(0x20a),'type':a31_0x51863f(0x224),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a31_0x51863f(0x1e5),'type':a31_0x51863f(0x224),'description':a31_0x51863f(0x1c9)},{'name':a31_0x51863f(0x1e9),'type':a31_0x51863f(0x224),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a31_0x51863f(0x210),'type':a31_0x51863f(0x224),'description':a31_0x51863f(0x208)},{'name':a31_0x51863f(0x1d4),'type':a31_0x51863f(0x224),'description':a31_0x51863f(0x202)},{'name':a31_0x51863f(0x1fc),'type':a31_0x51863f(0x224),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a31_0x51863f(0x1f9),a31_0x51863f(0x1fd)]}],async 'validate'(_0x5875fa){const _0x2f48b5=a31_0x51863f,_0x208a8d=_0x5875fa['str'](_0x2f48b5(0x20a));if(!isValidBffFunctionName(_0x208a8d))throw CliErrors['validation'](_0x2f48b5(0x1d3)+_0x208a8d+_0x2f48b5(0x21d));},async 'execute'(_0x53316d){const _0xdd2fee=a31_0x51863f,_0x2b7e34=loadBffProjectConfig(_0x53316d[_0xdd2fee(0x1fa)]),_0x720717=_0x53316d[_0xdd2fee(0x1cb)](_0xdd2fee(0x1ec)),_0x42390b=_0x53316d[_0xdd2fee(0x1cb)](_0xdd2fee(0x20a)),_0x5c9bc0=_0x53316d['str'](_0xdd2fee(0x1e5))||undefined,_0x14f3e7=_0x720717===_0xdd2fee(0x1d0)?await resolveHookOptions(_0x2b7e34,_0x53316d):undefined,_0x6abb87=buildFilePath(_0x2b7e34,_0x720717,_0x42390b,_0x14f3e7);if(await fileExists(_0x6abb87))throw CliErrors[_0xdd2fee(0x212)]('File\x20already\x20exists:\x20'+_0x6abb87);await mkdir(dirname(_0x6abb87),{'recursive':!![]});const _0x5c5d43=generateTemplate(_0x720717,_0x42390b,_0x53316d['appCode'],_0x5c9bc0,_0x14f3e7);await writeFile(_0x6abb87,_0x5c5d43,'utf8');const _0x3628a8={'type':_0x720717,'name':_0x42390b,'path':_0x6abb87};if(_0x5c9bc0)_0x3628a8[_0xdd2fee(0x1e5)]=_0x5c9bc0;if(_0x14f3e7){if(_0x14f3e7[_0xdd2fee(0x1e9)])_0x3628a8[_0xdd2fee(0x1e9)]=_0x14f3e7[_0xdd2fee(0x1e9)];_0x3628a8[_0xdd2fee(0x1f3)]=_0x14f3e7[_0xdd2fee(0x1f3)],_0x3628a8['operationType']=_0x14f3e7[_0xdd2fee(0x209)],_0x3628a8[_0xdd2fee(0x1f6)]=_0x14f3e7['functionNode'];}return{'ok':!![],'data':_0x3628a8,'message':_0xdd2fee(0x1db)+_0x720717+_0xdd2fee(0x229)+_0x42390b};}};async function resolveHookOptions(_0xa773af,_0x27c6db){const _0x214d4b=a31_0x51863f,_0x2b20fa=loadAliasMap(_0x27c6db['apiDir'],undefined,resolveApiFilePath(_0x27c6db[_0x214d4b(0x21f)],_0x27c6db['appCode'])),_0x3978df=_0x2b20fa['length']>0x0;let _0x328ac3,_0x33aa17,_0x45b06d;const _0x3a9878=_0x27c6db[_0x214d4b(0x1cb)](_0x214d4b(0x1e9)),_0x59cce1=_0x27c6db[_0x214d4b(0x1cb)](_0x214d4b(0x210));if(_0x3a9878){const _0xfdc0c=resolveAlias(_0x27c6db[_0x214d4b(0x21f)],_0x3a9878,undefined,resolveApiFilePath(_0x27c6db[_0x214d4b(0x21f)],_0x27c6db[_0x214d4b(0x1fa)]));if(!_0xfdc0c){const _0x5efc93=_0x3978df?_0x214d4b(0x203)+_0x2b20fa[_0x214d4b(0x1cd)](_0x1ec527=>_0x1ec527[_0x214d4b(0x1e9)])[_0x214d4b(0x1eb)](',\x20'):_0x214d4b(0x22c)+CLI_BIN_NAME+_0x214d4b(0x1cf);throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x1f4)+_0x3a9878+_0x214d4b(0x22e)+_0x5efc93);}_0x328ac3=_0x3a9878,_0x33aa17=_0xfdc0c;}else{if(_0x59cce1){_0x33aa17=_0x59cce1;const _0x32b8f5=_0x2b20fa['find'](_0x4f2e71=>_0x4f2e71[_0x214d4b(0x1f3)]===_0x59cce1);_0x328ac3=_0x32b8f5?.[_0x214d4b(0x1e9)];}else{if(_0x27c6db[_0x214d4b(0x22b)])throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x1c7));else{if(_0x3978df){const _0x5a8a11=_0x2b20fa['map'](_0x265ec4=>_0x265ec4[_0x214d4b(0x1e9)]+'\x20('+_0x265ec4[_0x214d4b(0x225)]+')'),_0x4b83a8=await promptSelect('Select\x20dataset:',_0x5a8a11),_0x56b9ec=_0x2b20fa[_0x4b83a8];if(!_0x56b9ec)throw CliErrors['validation'](_0x214d4b(0x218));_0x328ac3=_0x56b9ec[_0x214d4b(0x1e9)],_0x33aa17=_0x56b9ec[_0x214d4b(0x1f3)];}else{const _0x4692be=await listDatasets(_0x27c6db['appCode']);if(_0x4692be[_0x214d4b(0x230)]===0x0)throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x1ce));const _0x214dd3=_0x4692be[_0x214d4b(0x1cd)](_0x496d90=>_0x496d90[_0x214d4b(0x20a)]+'\x20['+(_0x496d90[_0x214d4b(0x1dd)]??_0x214d4b(0x1f5))+_0x214d4b(0x1f1)+_0x496d90[_0x214d4b(0x1fb)]+')'),_0x12b7cf=await promptSelect('Select\x20dataset:',_0x214dd3),_0x45924a=_0x4692be[_0x12b7cf];if(!_0x45924a)throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x218));_0x33aa17=_0x45924a['code'],_0x328ac3=undefined;}}}}const _0x4b15cf=await listDatasets(_0x27c6db['appCode']),_0x3342df=_0x4b15cf[_0x214d4b(0x1ee)](_0x5c13c5=>_0x5c13c5[_0x214d4b(0x1fb)]===_0x33aa17);if(!_0x3342df)throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x20b)+_0x33aa17+_0x214d4b(0x1e7)+(_0x328ac3?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x214d4b(0x1de):''));_0x45b06d=_0x3342df['id'];const _0x421541=_0x328ac3??_0x33aa17,_0x3954c8=await listBffDatasetOperations(_0x27c6db['appCode'],_0x45b06d),_0xa6ad19=_0x3954c8?Object[_0x214d4b(0x1e6)](_0x3954c8):[];if(_0xa6ad19[_0x214d4b(0x230)]===0x0)throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x20c)+_0x421541+'.');let _0xcd8250;const _0x19c6d1=_0x27c6db[_0x214d4b(0x1cb)](_0x214d4b(0x1d4));if(_0x19c6d1){if(!_0xa6ad19['includes'](_0x19c6d1))throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x215)+_0x19c6d1+_0x214d4b(0x200)+_0x421541+'.\x20'+(_0x214d4b(0x1ea)+_0xa6ad19[_0x214d4b(0x1eb)](',\x20')));_0xcd8250=_0x19c6d1;}else{if(_0x27c6db[_0x214d4b(0x22b)])throw CliErrors[_0x214d4b(0x212)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x100d0e=await promptSelect(_0x214d4b(0x21a),_0xa6ad19);_0xcd8250=_0xa6ad19[_0x100d0e]??_0xa6ad19[0x0];}let _0x47f82d=normalizeHookFunctionNode(_0x27c6db[_0x214d4b(0x1cb)](_0x214d4b(0x1fc)));if(!_0x47f82d){if(_0x27c6db[_0x214d4b(0x1cb)](_0x214d4b(0x1fc)))throw CliErrors['validation'](_0x214d4b(0x217));if(_0x27c6db[_0x214d4b(0x22b)])throw CliErrors[_0x214d4b(0x212)](_0x214d4b(0x22d));const _0x4350de=await promptSelect(_0x214d4b(0x205),[_0x214d4b(0x1f9),_0x214d4b(0x1fd)]);_0x47f82d=['before','after'][_0x4350de]??'before';}return{'alias':_0x328ac3,'datasetCode':_0x33aa17,'datasetId':_0x45b06d,'operationType':_0xcd8250,'functionNode':_0x47f82d};}async function promptSelect(_0x5c6f25,_0x2c5522){const _0x59bb30=a31_0x51863f;if(_0x2c5522['length']===0x1)return 0x0;for(const [_0x25e60f,_0x1c5692]of _0x2c5522[_0x59bb30(0x21c)]()){process['stderr'][_0x59bb30(0x1c8)]('\x20\x20'+(_0x25e60f+0x1)+'.\x20'+_0x1c5692+'\x0a');}const _0x15d2cc=createInterface({'input':process[_0x59bb30(0x1f8)],'output':process[_0x59bb30(0x22f)]});while(!![]){const _0x4b9a0=await new Promise(_0x55d603=>{const _0x555ccc=_0x59bb30;_0x15d2cc[_0x555ccc(0x21b)](_0x5c6f25+'\x20',_0x55d603);}),_0x5ac5b7=Number[_0x59bb30(0x1d1)](_0x4b9a0['trim'](),0xa);if(Number[_0x59bb30(0x1cc)](_0x5ac5b7)&&_0x5ac5b7>=0x1&&_0x5ac5b7<=_0x2c5522[_0x59bb30(0x230)])return _0x15d2cc[_0x59bb30(0x1e8)](),_0x5ac5b7-0x1;process['stderr'][_0x59bb30(0x1c8)](_0x59bb30(0x1e1)+_0x2c5522[_0x59bb30(0x230)]+'.\x0a');}}function buildFilePath(_0x456bf8,_0x1430c2,_0x1d6cd9,_0xfa6a7){const _0x381ae3=a31_0x51863f;if(_0x1430c2===_0x381ae3(0x1d0)){if(!_0xfa6a7)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x1e39a5=_0xfa6a7[_0x381ae3(0x1e9)]??_0xfa6a7[_0x381ae3(0x1f3)];return join(_0x456bf8[_0x381ae3(0x206)],_0x381ae3(0x1d0),_0x1e39a5,_0xfa6a7[_0x381ae3(0x209)],_0xfa6a7[_0x381ae3(0x1f6)],_0x1d6cd9+_0x381ae3(0x207));}return join(_0x456bf8[_0x381ae3(0x206)],_0x1430c2,_0x1d6cd9+_0x381ae3(0x207));}export function generateTemplate(_0xe3d58f,_0x1244a9,_0xd88fc0,_0x3073f8,_0x350dbc){const _0x5c022f=a31_0x51863f,_0x4815bd=_0x3073f8?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x346a0b=getAppBaseUrl(_0xd88fc0),_0x35ea03=_0x5c022f(0x20d);if(_0xe3d58f===_0x5c022f(0x1fe))return'/**\x0a\x20*\x20'+_0x4815bd+_0x5c022f(0x1d2)+_0x1244a9+_0x5c022f(0x1d7)+_0x346a0b+_0x5c022f(0x228)+_0xd88fc0+'/COMMON/'+_0x1244a9+_0x5c022f(0x214)+_0x1244a9+_0x5c022f(0x204)+_0x35ea03+_0x5c022f(0x231)+_0x1244a9+_0x5c022f(0x223);if(_0xe3d58f==='ENDPOINT')return _0x5c022f(0x1ca)+_0x4815bd+_0x5c022f(0x1ed)+_0x1244a9+_0x5c022f(0x1ef)+_0xd88fc0+'/'+_0x1244a9+_0x5c022f(0x1d7)+_0x346a0b+_0x5c022f(0x228)+_0xd88fc0+_0x5c022f(0x216)+_0x1244a9+_0x5c022f(0x1df)+_0x35ea03+_0x5c022f(0x1e3)+_0x1244a9+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x350dbc)throw CliErrors[_0x5c022f(0x212)](_0x5c022f(0x211));const _0x54cb3=_0x350dbc[_0x5c022f(0x1e9)]??_0x350dbc[_0x5c022f(0x1f3)],_0xf88e3d=_0x350dbc[_0x5c022f(0x1f6)]==='before'?_0x5c022f(0x1e2):_0x5c022f(0x1f0),_0x1a5773=_0x350dbc[_0x5c022f(0x1f6)]===_0x5c022f(0x1f9)?_0x5c022f(0x220):_0x5c022f(0x213);return _0x5c022f(0x1ca)+_0x4815bd+_0x5c022f(0x222)+_0x1244a9+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0xd88fc0+'/'+_0x350dbc['datasetCode']+'/'+_0x350dbc[_0x5c022f(0x209)]+_0x5c022f(0x1d7)+_0x346a0b+'/data/dataset/'+_0x350dbc[_0x5c022f(0x201)]+_0x5c022f(0x1f2)+_0xd88fc0+_0x5c022f(0x22a)+_0x54cb3+'/'+_0x350dbc[_0x5c022f(0x209)]+'/'+_0x350dbc[_0x5c022f(0x1f6)]+'/'+_0x1244a9+_0x5c022f(0x226)+_0x350dbc[_0x5c022f(0x1f6)]+'\x0a'+_0x35ea03+_0x5c022f(0x1da)+_0xf88e3d+_0x5c022f(0x219)+_0x1a5773+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x1244a9+_0x5c022f(0x223);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x59fbc0=a32_0xdb2d;(function(_0x404d1f,_0xd017d5){const _0x3ac58e=a32_0xdb2d,_0x533fbc=_0x404d1f();while(!![]){try{const _0x1692a1=parseInt(_0x3ac58e(0x206))/0x1+-parseInt(_0x3ac58e(0x21e))/0x2*(-parseInt(_0x3ac58e(0x1f2))/0x3)+parseInt(_0x3ac58e(0x21c))/0x4*(parseInt(_0x3ac58e(0x1ee))/0x5)+parseInt(_0x3ac58e(0x1ef))/0x6*(parseInt(_0x3ac58e(0x218))/0x7)+parseInt(_0x3ac58e(0x1f1))/0x8*(parseInt(_0x3ac58e(0x1fc))/0x9)+-parseInt(_0x3ac58e(0x1f5))/0xa+-parseInt(_0x3ac58e(0x203))/0xb;if(_0x1692a1===_0xd017d5)break;else _0x533fbc['push'](_0x533fbc['shift']());}catch(_0x450604){_0x533fbc['push'](_0x533fbc['shift']());}}}(a32_0x538b,0x7f3ff));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';function a32_0xdb2d(_0x1c20fd,_0x2e9e26){_0x1c20fd=_0x1c20fd-0x1e7;const _0x538b6a=a32_0x538b();let _0xdb2d90=_0x538b6a[_0x1c20fd];return _0xdb2d90;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a32_0x538b(){const _0x4f8fd7=['validation','find','2234130vXRgEA','Function\x20not\x20found:\x20','appCode','scriptsRootDir','filter','Would\x20delete\x20','join','254034FvSwzH','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','map','length','/api/management/library/scripts/delete','target','string','25045592FQsRao','projectRoot','str','45696KotryI','lastSync','functions','No\x20lock\x20entry\x20found\x20for\x20\x22','trashedTo','split','keys','Local\x20delete\x20not\x20settled\x20for\x20','trashDir','\x22\x20not\x20found\x20after\x20ensureLockScope.','replace','Multiple\x20functions\x20match\x20\x22','scriptsRoot','toISOString','bff','startsWith','lockFilePath','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','63aCBgvw','<timestamp>','apps','high-risk-write','8OnXDub','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','46rFjNFS','remoteId','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','stringify','includes','\x20(local\x20file\x20moved\x20to\x20trash)','parse','Backend\x20Function\x20lock\x20file\x20not\x20found.','Deleted\x20','2173515zCzGpO','327210jvWjED','delete','248zvtJZd','96597rboJeI'];a32_0x538b=function(){return _0x4f8fd7;};return a32_0x538b();}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x59fbc0(0x214),'command':'delete','description':a32_0x59fbc0(0x1fd),'risk':a32_0x59fbc0(0x21b),'flags':[{'name':a32_0x59fbc0(0x201),'type':a32_0x59fbc0(0x202),'required':!![],'description':a32_0x59fbc0(0x1e7)}],async 'validate'(_0x4ac8b1){const _0xdcff17=a32_0x59fbc0,_0x5e30d9=loadBffProjectConfig(_0x4ac8b1[_0xdcff17(0x1f7)]),_0x5f455c=await readBffLockFile(_0x5e30d9[_0xdcff17(0x216)]);if(!_0x5f455c)throw CliErrors[_0xdcff17(0x1f3)](_0xdcff17(0x217));},async 'dryRun'(_0x1c513b){const _0x135161=a32_0x59fbc0,_0xc61ce9=loadBffProjectConfig(_0x1c513b[_0x135161(0x1f7)]),_0x72354a=await readBffLockFile(_0xc61ce9[_0x135161(0x216)]);if(!_0x72354a)throw CliErrors['validation'](_0x135161(0x1ec));const {appLock:_0x4cba17}=ensureLockScope(_0x72354a,_0x1c513b['appCode'],_0xc61ce9[_0x135161(0x212)],_0x135161(0x1f0)),_0x288e1e=_0x1c513b[_0x135161(0x205)](_0x135161(0x201)),_0x1688a2=Object[_0x135161(0x20c)](_0x4cba17[_0x135161(0x208)]),_0x53293c=resolveDeleteTarget(_0x288e1e,_0x1688a2),_0x146bbf=_0x4cba17[_0x135161(0x208)][_0x53293c];if(!_0x146bbf)throw CliErrors[_0x135161(0x1f3)](_0x135161(0x209)+_0x53293c+'\x22.');const _0x15b382=resolveLocalFilePathFromLockKey(_0xc61ce9,_0x53293c),_0x4fa6b9=relative(_0xc61ce9[_0x135161(0x204)],_0x15b382),_0x5d85b7=join(_0xc61ce9[_0x135161(0x20e)],_0x135161(0x219),_0x4fa6b9);return{'method':'POST','url':_0x135161(0x200),'body':{'appCode':_0x1c513b[_0x135161(0x1f7)],'target':_0x53293c,'remoteId':_0x146bbf[_0x135161(0x21f)],'localFilePath':_0x15b382,'trashedPath':_0x5d85b7},'description':_0x135161(0x1fa)+_0x53293c+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x2c2063){const _0x551972=a32_0x59fbc0,_0x3ac073=loadBffProjectConfig(_0x2c2063[_0x551972(0x1f7)]),_0x8a207b=await readBffLockFile(_0x3ac073[_0x551972(0x216)]);if(!_0x8a207b)throw CliErrors['validation']('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x429df4,appLock:_0x40460}=ensureLockScope(_0x8a207b,_0x2c2063[_0x551972(0x1f7)],_0x3ac073[_0x551972(0x212)],_0x551972(0x1f0)),_0x5bcd2a=JSON[_0x551972(0x1eb)](JSON[_0x551972(0x1e8)](_0x429df4)),_0x464109=_0x5bcd2a['apps'][_0x2c2063[_0x551972(0x1f7)]];if(!_0x464109)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x2c2063[_0x551972(0x1f7)]+_0x551972(0x20f));const _0x14b9d1=_0x2c2063[_0x551972(0x205)]('target'),_0x531639=Object[_0x551972(0x20c)](_0x464109[_0x551972(0x208)]),_0x467a34=resolveDeleteTarget(_0x14b9d1,_0x531639),_0x6316cb=_0x464109[_0x551972(0x208)][_0x467a34];if(!_0x6316cb)throw CliErrors[_0x551972(0x1f3)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x467a34+'\x22.');await deleteBffScript(_0x6316cb[_0x551972(0x21f)]),delete _0x464109[_0x551972(0x208)][_0x467a34],_0x464109[_0x551972(0x207)]=new Date()[_0x551972(0x213)](),await writeBffLockFile(_0x3ac073[_0x551972(0x216)],_0x5bcd2a);const _0x1c90db=resolveLocalFilePathFromLockKey(_0x3ac073,_0x467a34);let _0x4e1a9d;await fileExists(_0x1c90db)&&(_0x4e1a9d=await moveToTrash(_0x3ac073[_0x551972(0x204)],_0x3ac073[_0x551972(0x20e)],_0x1c90db),await cleanupEmptyDirectories(dirname(_0x1c90db),_0x3ac073[_0x551972(0x1f8)]));await waitForDeleteSettlement(_0x3ac073[_0x551972(0x216)],_0x2c2063[_0x551972(0x1f7)],_0x467a34,_0x1c90db),await sleep(0x96);const _0x13d273={'deleted':_0x467a34,'remoteId':_0x6316cb['remoteId']};if(_0x4e1a9d)_0x13d273[_0x551972(0x20a)]=_0x4e1a9d;return{'ok':!![],'data':_0x13d273,'message':_0x551972(0x1ed)+_0x467a34+(_0x4e1a9d?_0x551972(0x1ea):'')};}};function resolveDeleteTarget(_0x77b370,_0x574767){const _0x353363=a32_0x59fbc0;if(_0x77b370[_0x353363(0x1e9)]('/')){const _0x49e993=_0x574767[_0x353363(0x1f4)](_0x20d7de=>_0x20d7de===_0x77b370);if(!_0x49e993)throw CliErrors[_0x353363(0x1f3)](_0x353363(0x1f6)+_0x77b370);return _0x49e993;}const _0x190ea6=_0x574767[_0x353363(0x1f9)](_0x318fb4=>_0x318fb4[_0x353363(0x20b)]('/')['at'](-0x1)===_0x77b370);if(_0x190ea6[_0x353363(0x1ff)]===0x0)throw CliErrors[_0x353363(0x1f3)](_0x353363(0x1f6)+_0x77b370);if(_0x190ea6[_0x353363(0x1ff)]>0x1)throw CliErrors['validation'](_0x353363(0x211)+_0x77b370+_0x353363(0x21d)+_0x190ea6[_0x353363(0x1fe)](_0x57077e=>'\x20\x20-\x20'+_0x57077e)[_0x353363(0x1fb)]('\x0a'));return _0x190ea6[0x0];}async function moveToTrash(_0x2fb527,_0x38251d,_0x2e70ea){const _0x1a4c57=a32_0x59fbc0,_0x126074=new Date()['toISOString']()[_0x1a4c57(0x210)](/[:.]/g,'-'),_0x368512=relative(_0x2fb527,_0x2e70ea),_0xe18dcf=join(_0x38251d,_0x126074,_0x368512);return await mkdir(dirname(_0xe18dcf),{'recursive':!![]}),await rename(_0x2e70ea,_0xe18dcf),_0xe18dcf;}async function cleanupEmptyDirectories(_0x2da3db,_0x59fd9f){const _0x6c6b98=a32_0x59fbc0;let _0xdcec3c=resolve(_0x2da3db);const _0x4ddbd8=resolve(_0x59fd9f);while(_0xdcec3c[_0x6c6b98(0x215)](''+_0x4ddbd8+sep)||_0xdcec3c===_0x4ddbd8){if(_0xdcec3c===_0x4ddbd8)return;try{const _0x385791=await readdir(_0xdcec3c);if(_0x385791[_0x6c6b98(0x1ff)]>0x0)return;await rmdir(_0xdcec3c);}catch{return;}_0xdcec3c=dirname(_0xdcec3c);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0xa6e843,_0x5e33ad,_0x156f3f,_0x43970a){const _0x5926f7=a32_0x59fbc0;for(let _0x25fb8d=0x0;_0x25fb8d<DELETE_SETTLE_RETRY_COUNT;_0x25fb8d+=0x1){const _0x54c3b8=await readBffLockFile(_0xa6e843),_0x33433b=!!_0x54c3b8?.[_0x5926f7(0x21a)]?.[_0x5e33ad]?.[_0x5926f7(0x208)]?.[_0x156f3f],_0x3c0dab=await fileExists(_0x43970a);if(!_0x33433b&&!_0x3c0dab)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x5926f7(0x20d)+_0x156f3f+'.');}
|