@lovrabet/rabetbase-cli 2.5.2-beta.2 → 2.5.2-beta.4
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 +2 -2
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.d.ts +1 -0
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.d.ts +0 -8
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.d.ts +4 -0
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.d.ts +3 -7
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +5 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +1 -26
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.d.ts +43 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.d.ts +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.d.ts +1 -3
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/rabetbase/SKILL.md +6 -6
- package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
- package/skills/rabetbase/guides/page-development-workflow.md +1 -1
- package/skills/rabetbase/knowledge/components.md +292 -0
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
- package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
- package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
- package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
- package/skills/rabetbase/references/rabetbase-run.md +1 -0
- package/skills/rabetbase.manifest.json +5 -4
- package/templates/README.md +10 -4
- package/templates/custom-pages/blank.json +5 -0
- package/templates/custom-pages/dashboard.json +5 -0
- package/templates/custom-pages/onepage.json +5 -0
- package/templates/generate-api/api.ts.tpl +1 -1
- package/lib/commands/page/custom/template.d.ts +0 -8
- package/lib/commands/page/custom/template.js +0 -1
- package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
package/lib/commands/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a17_0x49fb(_0x2bace9,_0x2ad0f5){_0x2bace9=_0x2bace9-0x138;const _0x1f757a=a17_0x1f75();let _0x49fb04=_0x1f757a[_0x2bace9];return _0x49fb04;}const a17_0x348738=a17_0x49fb;(function(_0x37310b,_0x2a12e3){const _0x316728=a17_0x49fb,_0x5b67f7=_0x37310b();while(!![]){try{const _0xa3fa04=parseInt(_0x316728(0x173))/0x1*(parseInt(_0x316728(0x156))/0x2)+parseInt(_0x316728(0x140))/0x3*(parseInt(_0x316728(0x145))/0x4)+-parseInt(_0x316728(0x14d))/0x5*(-parseInt(_0x316728(0x14a))/0x6)+-parseInt(_0x316728(0x16b))/0x7*(parseInt(_0x316728(0x16d))/0x8)+parseInt(_0x316728(0x153))/0x9+parseInt(_0x316728(0x162))/0xa+-parseInt(_0x316728(0x161))/0xb;if(_0xa3fa04===_0x2a12e3)break;else _0x5b67f7['push'](_0x5b67f7['shift']());}catch(_0x5d329d){_0x5b67f7['push'](_0x5b67f7['shift']());}}}(a17_0x1f75,0xd2a2e));import a17_0x5058c0 from'ora';import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../core/api-client.js';import{generateApiFile}from'../../api/generate-api-file.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{DEFAULT_API_DIR}from'../../constant/paths.js';import{resolveTargetApps}from'../../commands/api/shared.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a17_0x1f75(){const _0x7f9b86=['files','495900OgMiCi','Existing\x20TypeScript\x20was\x20not\x20updated.\x20Merge\x20data.models\x20into\x20it\x20(see\x20skills/rabetbase/guides/sdk-client-generation.md),\x20or\x20rerun\x20with\x20--force\x20--yes\x20to\x20replace\x20api.ts\x20and\x20client.ts.','str','force','apiFilePath','1887756BRkpHv','bool','apiDir','20emdvLj','join','\x20failed','Output\x20directory\x20(default:\x20','string','start','1270242EAKFkI','sdkConfigPath','Pulling\x20','10874agrEgY','appcode','models','global','\x20dataset\x20fact(s)\x20and\x20replaced\x20the\x20TypeScript\x20scaffold\x20with\x20','api','modelCount','configName','...','boolean','\x20\x20•\x20','13978008kSgJjE','3181500lrWMlE','push','read','needsAgentMerge','\x20app(s)\x20failed','message','env','fail','validation','63lvwkmp','output','1183808Lsjkwd','overwritten','includes','Review\x20local\x20customizations,\x20then\x20rerun\x20with\x20--force\x20--yes.','yes','Replace\x20existing\x20api.ts\x20and\x20client.ts;\x20requires\x20--yes\x20and\x20discards\x20local\x20customizations','253eKiica','name','split','rawFlags','succeed','\x20model(s)','cookie','\x20dataset\x20fact(s)\x20and\x20refreshed\x20sdk-config.ts.\x20','client','isDefault','Pulling\x20API\x20config\x20for\x20','Resolve\x20apps\x20from\x20merged\x20global+project\x20config\x20(default:\x20project\x20apps\x20only)','Failed:\x20','action','Fetched\x20','9vHQYdS','--force\x20requires\x20--yes\x20because\x20it\x20replaces\x20existing\x20api.ts\x20and\x20client.ts.','appCode','clientFilePath'];a17_0x1f75=function(){return _0x7f9b86;};return a17_0x1f75();}import{getSdkClientRoutingConfig}from'../../constant/domain.js';import{CliErrors}from'../../errors.js';const EXISTING_TS_HINT=a17_0x348738(0x146);function toPullData(_0x2c340f){const _0x2bad3e=a17_0x348738;return{'appCode':_0x2c340f[_0x2bad3e(0x142)],'configName':_0x2c340f[_0x2bad3e(0x15d)],'isDefaultConfig':_0x2c340f['isDefaultConfig'],'models':_0x2c340f[_0x2bad3e(0x158)],'sdkRouting':_0x2c340f['sdkRouting'],'files':_0x2c340f['files'],'needsAgentMerge':_0x2c340f['needsAgentMerge'],'apiFilePath':_0x2c340f[_0x2bad3e(0x149)],'clientFilePath':_0x2c340f['clientFilePath'],'sdkConfigPath':_0x2c340f[_0x2bad3e(0x154)],'datasetCount':_0x2c340f[_0x2bad3e(0x15c)],'modelCount':_0x2c340f['modelCount']};}function describePull(_0x333a6e){const _0x58bc26=a17_0x348738;if(_0x333a6e[_0x58bc26(0x165)])return'Fetched\x20'+_0x333a6e['modelCount']+_0x58bc26(0x138)+EXISTING_TS_HINT;if(_0x333a6e[_0x58bc26(0x144)][_0x58bc26(0x15b)][_0x58bc26(0x13e)]===_0x58bc26(0x16e)||_0x333a6e['files'][_0x58bc26(0x139)][_0x58bc26(0x13e)]===_0x58bc26(0x16e))return _0x58bc26(0x13f)+_0x333a6e['modelCount']+_0x58bc26(0x15a)+_0x333a6e['modelCount']+_0x58bc26(0x178);return _0x58bc26(0x13f)+_0x333a6e[_0x58bc26(0x15c)]+'\x20dataset\x20fact(s)\x20and\x20wrote\x20a\x20scaffold\x20with\x20'+_0x333a6e['modelCount']+_0x58bc26(0x178);}export const apiPull={'service':a17_0x348738(0x15b),'command':'pull','description':'Pull\x20dataset\x20facts,\x20refresh\x20sdk-config.ts,\x20and\x20write\x20API\x20scaffold\x20if\x20missing\x20('+DEFAULT_API_DIR+'/)','risk':a17_0x348738(0x164),'requiresAppCode':!![],'hasFormat':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a17_0x348738(0x16c),'type':a17_0x348738(0x151),'description':a17_0x348738(0x150)+DEFAULT_API_DIR+'/)'},{'name':a17_0x348738(0x159),'type':a17_0x348738(0x15f),'description':a17_0x348738(0x13c),'default':![]},{'name':a17_0x348738(0x148),'type':'boolean','description':a17_0x348738(0x172),'default':![]}],async 'validate'(_0x59f376){const _0x16a270=a17_0x348738;if(_0x59f376[_0x16a270(0x14b)](_0x16a270(0x148))&&!_0x59f376['bool'](_0x16a270(0x171)))throw CliErrors[_0x16a270(0x16a)](_0x16a270(0x141),_0x16a270(0x170));},async 'execute'(_0x4349d1){const _0x44bdc5=a17_0x348738,_0xa5fc9f=_0x4349d1['rawFlags'][_0x44bdc5(0x157)]?String(_0x4349d1[_0x44bdc5(0x176)][_0x44bdc5(0x157)]):undefined,_0x91864e=_0x4349d1[_0x44bdc5(0x147)](_0x44bdc5(0x16c))||undefined,_0xe3bb57=_0x4349d1[_0x44bdc5(0x14b)](_0x44bdc5(0x148)),_0xdc99ea=resolveTargetApps(_0x4349d1,_0xa5fc9f);if(_0xdc99ea){let _0x3ac974=0x0,_0x4fd234=0x0;const _0x2f4e60=[];for(const _0x1a25be of _0xdc99ea){const _0x1890e6=_0x1a25be['cookie']||_0x4349d1[_0x44bdc5(0x179)],_0x184247=_0x1a25be[_0x44bdc5(0x168)]||'production';initEnv(_0x184247);const _0x4cd5af=_0x1a25be[_0x44bdc5(0x14c)]||_0x91864e||_0x4349d1['apiDir']||DEFAULT_API_DIR,_0x1afdad=_0x1a25be[_0x44bdc5(0x13a)]?'':_0x1a25be[_0x44bdc5(0x174)]||_0x1a25be[_0x44bdc5(0x157)],_0x2dfe4c=a17_0x5058c0(_0x44bdc5(0x155)+_0x1a25be['name']+'\x20('+_0x1a25be[_0x44bdc5(0x157)]+')...')[_0x44bdc5(0x152)]();try{const {configArray:_0x4f4394}=await fetchModelList(_0x1a25be[_0x44bdc5(0x157)],_0x1890e6),_0x2be5a2=await generateApiFile(_0x4f4394,_0x1afdad,_0x1a25be[_0x44bdc5(0x157)],_0x1a25be[_0x44bdc5(0x13a)],_0x184247,_0x4cd5af,_0x1a25be[_0x44bdc5(0x174)],getSdkClientRoutingConfig(),{'overwriteTypescript':_0xe3bb57});_0x2dfe4c['succeed'](_0x1a25be[_0x44bdc5(0x174)]+':\x20'+describePull(_0x2be5a2)),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x2be5a2[_0x44bdc5(0x154)]),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x2be5a2[_0x44bdc5(0x149)]),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x2be5a2[_0x44bdc5(0x143)]),_0x2f4e60[_0x44bdc5(0x163)](toPullData(_0x2be5a2)),_0x3ac974++;}catch(_0x2f440c){_0x2dfe4c['fail'](_0x1a25be[_0x44bdc5(0x174)]+':\x20'+(_0x2f440c instanceof Error?_0x2f440c['message']:String(_0x2f440c))),_0x4fd234++;}}writeCliSideChannelLine('');if(_0x4fd234>0x0)writeCliSideChannelLine('!\x20'+_0x4fd234+_0x44bdc5(0x166));return{'ok':_0x4fd234===0x0,'message':'Done:\x20'+_0x3ac974+'\x20succeeded,\x20'+_0x4fd234+_0x44bdc5(0x14f),'data':{'apps':_0x2f4e60,'succeeded':_0x3ac974,'failed':_0x4fd234}};}const _0x4b28c6=_0xa5fc9f&&_0xa5fc9f[_0x44bdc5(0x16f)]('-')?_0xa5fc9f[_0x44bdc5(0x175)]('-')['slice'](0x1)[_0x44bdc5(0x14e)]('-'):'',_0x50d468=_0x91864e||_0x4349d1[_0x44bdc5(0x14c)]||DEFAULT_API_DIR,_0x392322=!_0xa5fc9f,_0x5d7013=a17_0x5058c0(_0x44bdc5(0x13b)+_0x4349d1[_0x44bdc5(0x142)]+_0x44bdc5(0x15e))['start']();try{const {configArray:_0x2e94f4}=await fetchModelList(_0x4349d1[_0x44bdc5(0x142)],_0x4349d1[_0x44bdc5(0x179)]),_0x22b205=await generateApiFile(_0x2e94f4,_0x4b28c6,_0x4349d1[_0x44bdc5(0x142)],_0x392322,getEnv(),_0x50d468,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':_0xe3bb57});return _0x5d7013[_0x44bdc5(0x177)](describePull(_0x22b205)),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x22b205['sdkConfigPath']),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x22b205['apiFilePath']),writeCliSideChannelLine(_0x44bdc5(0x160)+_0x22b205[_0x44bdc5(0x143)]),{'ok':!![],'message':describePull(_0x22b205),'data':toPullData(_0x22b205)};}catch(_0xc112f3){_0x5d7013[_0x44bdc5(0x169)](_0x44bdc5(0x13d)+(_0xc112f3 instanceof Error?_0xc112f3[_0x44bdc5(0x167)]:String(_0xc112f3)));throw _0xc112f3;}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x708741,_0x2d11d3){const _0x3910f0=a18_0x26f2,_0x2e660d=_0x708741();while(!![]){try{const _0x279bf4=-parseInt(_0x3910f0(0x12e))/0x1+-parseInt(_0x3910f0(0x131))/0x2*(parseInt(_0x3910f0(0x13b))/0x3)+-parseInt(_0x3910f0(0x13c))/0x4+parseInt(_0x3910f0(0x130))/0x5+parseInt(_0x3910f0(0x134))/0x6+-parseInt(_0x3910f0(0x12b))/0x7*(parseInt(_0x3910f0(0x139))/0x8)+parseInt(_0x3910f0(0x137))/0x9;if(_0x279bf4===_0x2d11d3)break;else _0x2e660d['push'](_0x2e660d['shift']());}catch(_0x1db7a9){_0x2e660d['push'](_0x2e660d['shift']());}}}(a18_0x5181,0x522f6));function a18_0x5181(){const _0x4d2409=['4727610NMBeqE','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','32rlEMuz','join','174OGANvd','510868kAkawA','validation','bool','378987UXBNSL','name','global','234986ynAMsv','map','367300JGecmw','9206giaIuA','filter','App\x20\x22','3504726WXLTKM','selectedAppName','merged'];a18_0x5181=function(){return _0x4d2409;};return a18_0x5181();}function a18_0x26f2(_0xde4a55,_0x5365c2){_0xde4a55=_0xde4a55-0x129;const _0x5181b3=a18_0x5181();let _0x26f223=_0x5181b3[_0xde4a55];return _0x26f223;}import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x21a181,_0x2ef3d1){const _0x307210=a18_0x26f2;if(_0x2ef3d1)return null;const _0x4ff971=_0x21a181[_0x307210(0x12a)](_0x307210(0x12d))?_0x307210(0x136):'project';let _0xf18097=getMultiAppConfigs(_0x4ff971);if(!_0xf18097||_0xf18097['length']===0x0)return null;if(_0x21a181[_0x307210(0x135)]){const _0x2fae44=_0xf18097[_0x307210(0x132)](_0x30e1ce=>_0x30e1ce[_0x307210(0x12c)]===_0x21a181['selectedAppName']);if(_0x2fae44['length']===0x0){const _0x18913c=_0xf18097[_0x307210(0x12f)](_0xd94440=>_0xd94440[_0x307210(0x12c)])[_0x307210(0x13a)](',\x20');throw CliErrors[_0x307210(0x129)](_0x307210(0x133)+_0x21a181[_0x307210(0x135)]+_0x307210(0x138)+_0x18913c);}_0xf18097=_0x2fae44;}return _0xf18097;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1bbc30,_0x2ed5e4){const _0x2761dc=a19_0x149b,_0x3a2ce3=_0x1bbc30();while(!![]){try{const _0x3760c8=parseInt(_0x2761dc(0x1f3))/0x1*(-parseInt(_0x2761dc(0x1f1))/0x2)+-parseInt(_0x2761dc(0x1f7))/0x3+parseInt(_0x2761dc(0x1f2))/0x4*(parseInt(_0x2761dc(0x1f0))/0x5)+parseInt(_0x2761dc(0x1fa))/0x6+parseInt(_0x2761dc(0x1f5))/0x7*(-parseInt(_0x2761dc(0x1f4))/0x8)+parseInt(_0x2761dc(0x1f6))/0x9+-parseInt(_0x2761dc(0x1f8))/0xa*(-parseInt(_0x2761dc(0x1f9))/0xb);if(_0x3760c8===_0x2ed5e4)break;else _0x3a2ce3['push'](_0x3a2ce3['shift']());}catch(_0x307aae){_0x3a2ce3['push'](_0x3a2ce3['shift']());}}}(a19_0x2b87,0x67106));import{appListDefinition}from'../../commands/app/list.js';function a19_0x149b(_0x51efbd,_0x1ed0cc){_0x51efbd=_0x51efbd-0x1f0;const _0x2b87bc=a19_0x2b87();let _0x149b15=_0x2b87bc[_0x51efbd];return _0x149b15;}function a19_0x2b87(){const _0x3de128=['49cbyxWH','2899521vAEyet','61125UEvILE','100QUoBmC','563299YiIWyH','531618Ktqtwx','1045alkPII','1241338hEHNvc','6876BaHEwY','1wZYcop','250216YFuONB'];a19_0x2b87=function(){return _0x3de128;};return a19_0x2b87();}import{appMembersListDefinition}from'../../commands/app/members-list.js';export const appDefinitions=[appListDefinition,appMembersListDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0xd24926=a20_0x2ae0;function a20_0x107b(){const _0x22a31c=['Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','isCurrent','110jMtLwr','605580VhceME','length','bool','find','3032795pYQKwm','read','\x20in\x20','appcode','14WbrEKP','1185237DtZfUh','defaultApp','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','globalPath','mergedCli','1IOoHsC','push','global','name','822444aKVkiR','\x20config','entries','keys','203GIbWPF','6vWxHff','globalConfig','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','apps','project','No\x20apps\x20configured','map','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','remote','projectConfig','boolean','12BcGsEJ','287127ejedeA','470AqWsdc','11825281tMFMJM','merged','object','7016ztpJmI','optional','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','.\x20Use\x20`'];a20_0x107b=function(){return _0x22a31c;};return a20_0x107b();}(function(_0x125779,_0x4b2746){const _0x4bf3ba=a20_0x2ae0,_0x365822=_0x125779();while(!![]){try{const _0x4fd63b=parseInt(_0x4bf3ba(0x11a))/0x1*(parseInt(_0x4bf3ba(0x10c))/0x2)+-parseInt(_0x4bf3ba(0x115))/0x3*(-parseInt(_0x4bf3ba(0xff))/0x4)+parseInt(_0x4bf3ba(0x110))/0x5*(-parseInt(_0x4bf3ba(0x123))/0x6)+-parseInt(_0x4bf3ba(0x122))/0x7*(parseInt(_0x4bf3ba(0x105))/0x8)+-parseInt(_0x4bf3ba(0x100))/0x9*(parseInt(_0x4bf3ba(0x101))/0xa)+parseInt(_0x4bf3ba(0x10b))/0xb*(parseInt(_0x4bf3ba(0x11e))/0xc)+-parseInt(_0x4bf3ba(0x102))/0xd*(-parseInt(_0x4bf3ba(0x114))/0xe);if(_0x4fd63b===_0x4b2746)break;else _0x365822['push'](_0x365822['shift']());}catch(_0x551e10){_0x365822['push'](_0x365822['shift']());}}}(a20_0x107b,0xe8531));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(_0x3af082,_0x9a0bb9){const _0x2c7f84=a20_0x2ae0,_0x4e62ac=[],_0x2bda16=_0x3af082[_0x2c7f84(0xf7)]&&typeof _0x3af082[_0x2c7f84(0xf7)]===_0x2c7f84(0x104)?_0x3af082[_0x2c7f84(0xf7)]:{},_0x51e756=_0x3af082['defaultApp']||undefined,_0x43b456=_0x51e756??(Object[_0x2c7f84(0x121)](_0x2bda16)[_0x2c7f84(0x10d)]===0x1?Object['keys'](_0x2bda16)[0x0]:undefined);for(const [_0x5b678e,_0x9880b0]of Object['entries'](_0x2bda16)){if(!_0x9880b0||typeof _0x9880b0!==_0x2c7f84(0x104)||!_0x9880b0['appcode'])continue;_0x4e62ac[_0x2c7f84(0x11b)]({'name':_0x5b678e,'appcode':_0x9880b0[_0x2c7f84(0x113)],'named':!![],'definedIn':_0x9a0bb9,'isDefault':_0x5b678e===_0x43b456,...buildAppProfileListFields(_0x9880b0)});}return _0x4e62ac;}function buildMergedItems(_0x2ebeb9,_0x48d3df){const _0x4c3a87=a20_0x2ae0,{apps:apps={}}=_0x2ebeb9,_0x496150=_0x2ebeb9[_0x4c3a87(0x116)],_0x21a97e=_0x496150??(Object[_0x4c3a87(0x121)](apps)[_0x4c3a87(0x10d)]===0x1?Object['keys'](apps)[0x0]:undefined),_0x49fffa=_0x48d3df[_0x4c3a87(0x124)][_0x4c3a87(0xf7)]&&typeof _0x48d3df['globalConfig'][_0x4c3a87(0xf7)]===_0x4c3a87(0x104)?_0x48d3df[_0x4c3a87(0x124)][_0x4c3a87(0xf7)]:{},_0x4072a0=_0x48d3df[_0x4c3a87(0xfd)][_0x4c3a87(0xf7)]&&typeof _0x48d3df['projectConfig'][_0x4c3a87(0xf7)]===_0x4c3a87(0x104)?_0x48d3df[_0x4c3a87(0xfd)][_0x4c3a87(0xf7)]:{},_0x1e4d81=Object[_0x4c3a87(0x120)](apps),_0x52baa3=_0x1e4d81[_0x4c3a87(0xfa)](([_0x5025f7,_0x4d5bfc])=>({'name':_0x5025f7,'appcode':_0x4d5bfc[_0x4c3a87(0x113)],'named':!![],'definedIn':appDefinedIn(_0x5025f7,_0x49fffa,_0x4072a0),'isDefault':_0x5025f7===_0x21a97e,...buildAppProfileListFields(_0x4d5bfc)}));return _0x52baa3;}function a20_0x2ae0(_0x4658c7,_0x4f87e9){_0x4658c7=_0x4658c7-0xf7;const _0x107bba=a20_0x107b();let _0x2ae006=_0x107bba[_0x4658c7];return _0x2ae006;}function validateAppListFlags(_0x3e07d8){const _0x4e1638=a20_0x2ae0;if(!_0x3e07d8['bool'](_0x4e1638(0xfc)))return;if(!_0x3e07d8[_0x4e1638(0x10e)](_0x4e1638(0x11c))&&!_0x3e07d8['bool'](_0x4e1638(0xf8)))return;throw CliErrors['validation'](_0x4e1638(0xfb),_0x4e1638(0x109));}async function execute(_0x203067){const _0x2ddf41=a20_0x2ae0;validateAppListFlags(_0x203067);if(_0x203067['bool'](_0x2ddf41(0xfc)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x203067)};const _0x2404ce=_0x203067['bool'](_0x2ddf41(0x11c)),_0x1d9a90=_0x203067[_0x2ddf41(0x10e)](_0x2ddf41(0xf8)),_0x29b157=_0x2404ce?_0x2ddf41(0x11c):_0x1d9a90?_0x2ddf41(0xf8):'merged',{config:_0x34cc2f,layers:_0x6f4675}=readRawConfigWithLayers(),_0x236641=resolveDefaultAppSource(_0x6f4675),{defaultApp:_0x5cc28a}=_0x34cc2f;let _0x4c2e56,_0x165619;switch(_0x29b157){case _0x2ddf41(0x11c):_0x4c2e56=buildItemsFromLayer(_0x6f4675[_0x2ddf41(0x124)],'global'),_0x165619=_0x6f4675[_0x2ddf41(0x118)];break;case _0x2ddf41(0xf8):_0x4c2e56=buildItemsFromLayer(_0x6f4675[_0x2ddf41(0xfd)],'project'),_0x165619=_0x6f4675['projectPath'];break;default:_0x4c2e56=buildMergedItems(_0x34cc2f,_0x6f4675);break;}enrichAppListItemsWithMergedSelection(_0x4c2e56,_0x203067[_0x2ddf41(0x119)]);if(_0x4c2e56[_0x2ddf41(0x10d)]===0x0){const _0x48f107=_0x29b157===_0x2ddf41(0x103)?'':_0x2ddf41(0x112)+_0x29b157+_0x2ddf41(0x11f);return{'ok':!![],'data':[],'message':_0x2ddf41(0xf9)+_0x48f107+_0x2ddf41(0x108)+CLI_BIN_NAME+'\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x3d692d=_0x4c2e56[_0x2ddf41(0x10f)](_0xde95ba=>_0xde95ba[_0x2ddf41(0x10a)]===!![]),_0xa8a259=_0x5cc28a??_0x3d692d?.[_0x2ddf41(0x11d)]??null,_0x5e21aa=_0x29b157===_0x2ddf41(0x103)?{'globalPath':_0x6f4675[_0x2ddf41(0x118)]??null,'projectPath':_0x6f4675['projectPath']??null,'defaultApp':_0xa8a259,'defaultAppSource':_0x5cc28a!=null?_0x236641:null}:{'scope':_0x29b157,'configPath':_0x165619??null};return{'ok':!![],'data':{'items':_0x4c2e56,'meta':_0x5e21aa}};}export const appListDefinition={'service':'app','command':'list','description':a20_0xd24926(0x126),'risk':a20_0xd24926(0x111),'auth':a20_0xd24926(0x106),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':a20_0xd24926(0xfe),'description':a20_0xd24926(0x107),'default':![]},{'name':a20_0xd24926(0x11c),'type':'boolean','description':a20_0xd24926(0x117),'default':![]},{'name':a20_0xd24926(0xf8),'type':'boolean','description':a20_0xd24926(0x125),'default':![]}],async 'validate'(_0x338a21){validateAppListFlags(_0x338a21);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x372d7a=a21_0x3d29;(function(_0x46ada3,_0x3a06bb){const _0x5e3474=a21_0x3d29,_0x2b33b4=_0x46ada3();while(!![]){try{const _0xa514bc=-parseInt(_0x5e3474(0xb2))/0x1+-parseInt(_0x5e3474(0xb3))/0x2+parseInt(_0x5e3474(0xb0))/0x3+parseInt(_0x5e3474(0xb1))/0x4+-parseInt(_0x5e3474(0xa8))/0x5+parseInt(_0x5e3474(0xaa))/0x6*(parseInt(_0x5e3474(0xa7))/0x7)+parseInt(_0x5e3474(0xad))/0x8;if(_0xa514bc===_0x3a06bb)break;else _0x2b33b4['push'](_0x2b33b4['shift']());}catch(_0x1f10a0){_0x2b33b4['push'](_0x2b33b4['shift']());}}}(a21_0x4df4,0x57359));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a21_0x3d29(_0x46e9de,_0x16f8d5){_0x46e9de=_0x46e9de-0xa7;const _0x4df466=a21_0x4df4();let _0x3d2993=_0x4df466[_0x46e9de];return _0x3d2993;}import{projectAppMembers}from'../../commands/app/shared.js';function a21_0x4df4(){const _0x2f6d8a=['746970ieTXIy','288722lIedKs','1781495DKsJFF','length','30AQBRQr','List\x20application\x20members\x20with\x20their\x20role\x20memberships','app','2195520xkUKOT','\x20application\x20member(s)','appCode','176391xHbkYQ','2400884nYFswj','52695TwttzZ'];a21_0x4df4=function(){return _0x2f6d8a;};return a21_0x4df4();}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a21_0x372d7a(0xac),'command':'members-list','description':a21_0x372d7a(0xab),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x152fee){const _0xc249b7=a21_0x372d7a,_0x2995a7=projectAppMembers(await listRoleUsers(_0x152fee[_0xc249b7(0xaf)]));return{'ok':!![],'data':{'appCode':_0x152fee[_0xc249b7(0xaf)],'items':_0x2995a7,'totalCount':_0x2995a7[_0xc249b7(0xa9)]},'message':'Found\x20'+_0x2995a7[_0xc249b7(0xa9)]+_0xc249b7(0xae)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7aeff3,_0x4c857e){const _0x242384=a22_0x7a8b,_0x54cf81=_0x7aeff3();while(!![]){try{const _0x15d748=-parseInt(_0x242384(0x1a1))/0x1*(-parseInt(_0x242384(0x196))/0x2)+parseInt(_0x242384(0x194))/0x3+parseInt(_0x242384(0x19c))/0x4+parseInt(_0x242384(0x1a0))/0x5*(parseInt(_0x242384(0x19d))/0x6)+parseInt(_0x242384(0x197))/0x7*(parseInt(_0x242384(0x19f))/0x8)+parseInt(_0x242384(0x198))/0x9+parseInt(_0x242384(0x1a2))/0xa*(-parseInt(_0x242384(0x19b))/0xb);if(_0x15d748===_0x4c857e)break;else _0x54cf81['push'](_0x54cf81['shift']());}catch(_0x3ad5af){_0x54cf81['push'](_0x54cf81['shift']());}}}(a22_0x11bf,0x96889));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';function a22_0x7a8b(_0x582d54,_0x436f86){_0x582d54=_0x582d54-0x193;const _0x11bfc7=a22_0x11bf();let _0x7a8b17=_0x11bfc7[_0x582d54];return _0x7a8b17;}import{CliErrors}from'../../errors.js';function a22_0x11bf(){const _0x213324=['5NKWxzX','18873ytsZGm','20PFLacG','platform','1016223NPGtJL','appName','8dIGkuO','5502mtOHSU','10117251KPKNKq','appDesc','authRequired','18969599NpEwPy','3615224CfZilu','6849642Yjbszl','map','4904oRyssT'];a22_0x11bf=function(){return _0x213324;};return a22_0x11bf();}import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x1e1845){const _0x310fb6=a22_0x7a8b,_0x3b7162=_0x1e1845['cookie']||getCookie();if(!_0x3b7162)throw CliErrors[_0x310fb6(0x19a)]();return _0x3b7162;}export async function listRemoteAppDirectory(_0x4d85bc){const _0x352186=a22_0x7a8b,_0x39f561=await withActiveCookie(resolveCookie(_0x4d85bc),()=>listRemoteApps());return{'items':_0x39f561[_0x352186(0x19e)](_0x2215cf=>({..._0x2215cf['id']!=null?{'id':_0x2215cf['id']}:{},'appCode':_0x2215cf['appCode'],'appName':_0x2215cf[_0x352186(0x195)],..._0x2215cf['appDesc']!=null?{'appDesc':_0x2215cf[_0x352186(0x199)]}:{}})),'meta':{'source':_0x352186(0x193)}};}
|
|
@@ -9,6 +9,7 @@ import type { MergedCliSnapshot } from "../../framework/types.js";
|
|
|
9
9
|
export type AppMembershipStatus = "ACTIVE" | "PENDING";
|
|
10
10
|
export interface AppMemberRoleProjection {
|
|
11
11
|
roleId: number;
|
|
12
|
+
roleCode: string;
|
|
12
13
|
roleName: string | null;
|
|
13
14
|
roleType: string | null;
|
|
14
15
|
membershipStatus: AppMembershipStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x599395,_0x23c51e){const _0xd95f93=a23_0x1334,_0x5be4cf=_0x599395();while(!![]){try{const _0x1b008c=-parseInt(_0xd95f93(0x12e))/0x1+parseInt(_0xd95f93(0x125))/0x2+-parseInt(_0xd95f93(0x137))/0x3*(-parseInt(_0xd95f93(0x134))/0x4)+parseInt(_0xd95f93(0x11e))/0x5*(parseInt(_0xd95f93(0x131))/0x6)+-parseInt(_0xd95f93(0x144))/0x7+-parseInt(_0xd95f93(0x141))/0x8+parseInt(_0xd95f93(0x140))/0x9;if(_0x1b008c===_0x23c51e)break;else _0x5be4cf['push'](_0x5be4cf['shift']());}catch(_0xb5eca2){_0x5be4cf['push'](_0x5be4cf['shift']());}}}(a23_0x5a2d,0x994c0));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x41ae53){const _0x4dd441=_0x41ae53?.['trim']();return _0x4dd441?_0x4dd441:null;}function a23_0x5a2d(){const _0x27a61d=['16520922HeyRgB','1398248UMBmft','hasOwnProperty','nickname','8396654nOoXXb','applyUserList','currentApp','appcode','trim','get','username','length','project','roleCode','apps','7035wXKxNi','map','object','roleKeys','userList','\x20(global)','PENDING','291716XfiAWL','add','has','roleName','roles','keys','appCode','membershipStatus','defaultApp','1250316JCBJyp','isCurrent','userId','2538PTgoOH','prototype','projectConfig','450564nPeymI','name','globalConfig','18wQuUgm','global','sort','status','named','isFinite','ACTIVE','roleId','call'];a23_0x5a2d=function(){return _0x27a61d;};return a23_0x5a2d();}export function projectAppMembers(_0x21de03){const _0x17dede=a23_0x1334,_0x2f1ba6=new Map(),_0x4a762d=[..._0x21de03][_0x17dede(0x139)]((_0x4e7b37,_0x4239d0)=>_0x4e7b37['id']-_0x4239d0['id']),_0x3777fb=(_0x4cfa11,_0x2766a0,_0x2efb4a)=>{const _0x23305f=_0x17dede;for(const _0x35ce11 of _0x2766a0){const _0x2259f2=Number(_0x35ce11['userId']);if(!Number[_0x23305f(0x13c)](_0x2259f2)||_0x2259f2<=0x0)continue;let _0x54a616=_0x2f1ba6[_0x23305f(0x149)](_0x2259f2);if(!_0x54a616)_0x54a616={'userId':_0x2259f2,'username':nullableText(_0x35ce11[_0x23305f(0x14a)]),'displayName':nullableText(_0x35ce11[_0x23305f(0x143)]),'status':_0x2efb4a,'roles':[],'roleKeys':new Set()},_0x2f1ba6['set'](_0x2259f2,_0x54a616);else{_0x54a616['username']??=nullableText(_0x35ce11[_0x23305f(0x14a)]),_0x54a616['displayName']??=nullableText(_0x35ce11[_0x23305f(0x143)]);if(_0x2efb4a===_0x23305f(0x13d))_0x54a616['status']=_0x23305f(0x13d);}const _0x3a3a80=_0x4cfa11['id']+':'+_0x2efb4a;if(_0x54a616[_0x23305f(0x121)][_0x23305f(0x127)](_0x3a3a80))continue;_0x54a616['roleKeys'][_0x23305f(0x126)](_0x3a3a80),_0x54a616[_0x23305f(0x129)]['push']({'roleId':_0x4cfa11['id'],'roleCode':_0x4cfa11[_0x23305f(0x14d)],'roleName':nullableText(_0x4cfa11[_0x23305f(0x128)]),'roleType':nullableText(_0x4cfa11['roleType']),'membershipStatus':_0x2efb4a});}};for(const _0x3df013 of _0x4a762d){_0x3777fb(_0x3df013,_0x3df013[_0x17dede(0x122)]??[],_0x17dede(0x13d)),_0x3777fb(_0x3df013,_0x3df013[_0x17dede(0x145)]??[],_0x17dede(0x124));}return[..._0x2f1ba6['values']()][_0x17dede(0x11f)](_0x46a83c=>({'userId':_0x46a83c[_0x17dede(0x130)],'username':_0x46a83c[_0x17dede(0x14a)],'displayName':_0x46a83c['displayName'],'status':_0x46a83c[_0x17dede(0x13a)],'roles':_0x46a83c[_0x17dede(0x129)]['sort']((_0xd7bd1a,_0x477d40)=>_0xd7bd1a[_0x17dede(0x13e)]-_0x477d40[_0x17dede(0x13e)]||(_0xd7bd1a[_0x17dede(0x12c)]===_0x477d40[_0x17dede(0x12c)]?0x0:_0xd7bd1a['membershipStatus']===_0x17dede(0x13d)?-0x1:0x1))}))[_0x17dede(0x139)]((_0x36a544,_0xfa4c86)=>_0x36a544[_0x17dede(0x130)]-_0xfa4c86[_0x17dede(0x130)]);}export function enrichAppListItemsWithMergedSelection(_0x59f11e,_0x4e3720){const _0x2838b0=a23_0x1334;if(!_0x4e3720)return;const _0x3198f=_0x4e3720[_0x2838b0(0x14e)]&&typeof _0x4e3720[_0x2838b0(0x14e)]===_0x2838b0(0x120)?_0x4e3720[_0x2838b0(0x14e)]:{},_0x42d2a1=Object[_0x2838b0(0x12a)](_0x3198f)['length']>0x0;for(const _0x2f016c of _0x59f11e){_0x2f016c[_0x2838b0(0x12f)]=![];}const _0x3eae67=_0x4e3720[_0x2838b0(0x12b)]!=null?String(_0x4e3720[_0x2838b0(0x12b)])[_0x2838b0(0x148)]():'';if(_0x42d2a1){const _0x21b207=_0x4e3720[_0x2838b0(0x146)]??_0x4e3720['defaultApp'];if(_0x21b207)for(const _0x1d6473 of _0x59f11e){_0x1d6473[_0x2838b0(0x13b)]===!![]&&_0x1d6473[_0x2838b0(0x135)]===_0x21b207&&(_0x1d6473['isCurrent']=!![]);}for(const _0x3f205f of _0x59f11e){if(_0x3f205f['named']!==![])continue;if(_0x4e3720['defaultApp'])continue;_0x3eae67&&String(_0x3f205f[_0x2838b0(0x147)]??'')[_0x2838b0(0x148)]()===_0x3eae67&&(_0x3f205f[_0x2838b0(0x12f)]=!![]);}return;}if(!_0x3eae67)return;for(const _0x14dd77 of _0x59f11e){String(_0x14dd77[_0x2838b0(0x147)]??'')[_0x2838b0(0x148)]()===_0x3eae67&&(_0x14dd77[_0x2838b0(0x12f)]=!![]);}}export function resolveAppScopeForWrite(_0x482f05,_0x5da56a,_0x5f1849){const _0x27f95f=a23_0x1334;if(_0x5da56a)return'global';const _0x956435=_0x5f1849[_0x27f95f(0x133)][_0x27f95f(0x14e)]&&typeof _0x5f1849[_0x27f95f(0x133)][_0x27f95f(0x14e)]===_0x27f95f(0x120)?_0x5f1849[_0x27f95f(0x133)]['apps']:{},_0x523396=_0x5f1849[_0x27f95f(0x136)][_0x27f95f(0x14e)]&&typeof _0x5f1849[_0x27f95f(0x136)]['apps']===_0x27f95f(0x120)?_0x5f1849[_0x27f95f(0x136)][_0x27f95f(0x14e)]:{};if(Object[_0x27f95f(0x132)][_0x27f95f(0x142)][_0x27f95f(0x13f)](_0x956435,_0x482f05))return _0x27f95f(0x14c);if(Object[_0x27f95f(0x132)][_0x27f95f(0x142)][_0x27f95f(0x13f)](_0x523396,_0x482f05))return _0x27f95f(0x138);return _0x27f95f(0x14c);}export function appDefinedIn(_0x42df2a,_0x479a34,_0x388aea){const _0x374428=a23_0x1334,_0x19a186=Object['prototype'][_0x374428(0x142)]['call'](_0x479a34,_0x42df2a),_0x586c02=Object[_0x374428(0x132)][_0x374428(0x142)]['call'](_0x388aea,_0x42df2a);if(_0x19a186&&_0x586c02)return'both';if(_0x586c02)return _0x374428(0x14c);return _0x374428(0x138);}export function resolveDefaultAppSource(_0xaab8dd){const _0x29cd86=a23_0x1334,_0x394139=_0xaab8dd['projectConfig']['apps']&&typeof _0xaab8dd[_0x29cd86(0x133)][_0x29cd86(0x14e)]===_0x29cd86(0x120)?_0xaab8dd[_0x29cd86(0x133)]['apps']:{};if(_0x29cd86(0x12d)in _0xaab8dd['projectConfig'])return _0x29cd86(0x14c);if(Object[_0x29cd86(0x12a)](_0x394139)[_0x29cd86(0x14b)]>0x0)return'project';if(Object[_0x29cd86(0x12a)](_0xaab8dd[_0x29cd86(0x133)])[_0x29cd86(0x14b)]===0x0&&_0xaab8dd[_0x29cd86(0x136)]['defaultApp'])return _0x29cd86(0x138);return null;}function a23_0x1334(_0x3e114f,_0x19a53d){_0x3e114f=_0x3e114f-0x11e;const _0x5a2d4a=a23_0x5a2d();let _0x13346a=_0x5a2d4a[_0x3e114f];return _0x13346a;}export function getConfigPath(_0x18eccb={}){const _0x10016e=a23_0x1334,_0x2ce089=_0x18eccb['global']?'global':_0x10016e(0x14c);return resolveWriteConfigPath(_0x2ce089);}export function readConfig(_0xd04dec={}){return readConfigFile(getConfigPath(_0xd04dec));}export function writeConfig(_0x5b98f8,_0x339024={}){writeConfigFile(getConfigPath(_0x339024),_0x5b98f8);}export function scopeLabel(_0x2b763a){const _0x159c31=a23_0x1334;return _0x2b763a[_0x159c31(0x138)]?_0x159c31(0x123):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x3c5125=a24_0x46ff;(function(_0x51993e,_0x2b2090){const _0x2011cc=a24_0x46ff,_0x3f1213=_0x51993e();while(!![]){try{const _0x50714e=parseInt(_0x2011cc(0x133))/0x1+-parseInt(_0x2011cc(0x12b))/0x2+parseInt(_0x2011cc(0x12c))/0x3+-parseInt(_0x2011cc(0x129))/0x4*(-parseInt(_0x2011cc(0x131))/0x5)+-parseInt(_0x2011cc(0x12a))/0x6+-parseInt(_0x2011cc(0x12d))/0x7+-parseInt(_0x2011cc(0x134))/0x8;if(_0x50714e===_0x2b2090)break;else _0x3f1213['push'](_0x3f1213['shift']());}catch(_0x58105e){_0x3f1213['push'](_0x3f1213['shift']());}}}(a24_0x1c83,0x47b66));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a24_0x1c83(){const _0x9daadc=['get','1710365IEJKHz','number','391590iWdSiA','2069328tNUmQX','delete','appCode:\x20',',\x20appCode=','apiError','high-risk-write','App\x20config\x20key\x20not\x20found:\x20','/smartapi/app-config/delete','POST','4XSvRFa','551412VZWzkx','680864sxrHQA','816129NsXmgr','146804gQtMts','Deleted\x20app\x20config\x20','appCode'];a24_0x1c83=function(){return _0x9daadc;};return a24_0x1c83();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a24_0x46ff(_0x5d9f4f,_0x2d6cf7){_0x5d9f4f=_0x5d9f4f-0x122;const _0x1c8389=a24_0x1c83();let _0x46fffc=_0x1c8389[_0x5d9f4f];return _0x46fffc;}import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a24_0x3c5125(0x127);export const appConfigDelete={'service':'app-config','command':a24_0x3c5125(0x135),'description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a24_0x3c5125(0x125),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x328f88){readKeyArg(_0x328f88);},async 'dryRun'(_0x30b4ba){const _0x5d629e=a24_0x3c5125,_0x57bca9=readKeyArg(_0x30b4ba),_0x34edee=await mustGetByKey(_0x30b4ba[_0x5d629e(0x12f)],_0x57bca9);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x30b4ba['appCode'],'key':_0x57bca9,'before':projectAppConfig(_0x34edee),'after':null,'dryRun':!![]}),{'method':_0x5d629e(0x128),'url':DELETE_PATH});},async 'execute'(_0x2f8597){const _0x10dfac=a24_0x3c5125,_0x282574=readKeyArg(_0x2f8597),_0x2c2bd4=await mustGetByKey(_0x2f8597[_0x10dfac(0x12f)],_0x282574);return await withAppConfigApiBoundary('delete',{'appCode':_0x2f8597[_0x10dfac(0x12f)],'key':_0x282574},()=>deleteAppConfig({'appCode':_0x2f8597[_0x10dfac(0x12f)],'id':requireAppConfigId(_0x2c2bd4,_0x282574,_0x2f8597['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x10dfac(0x135),'appCode':_0x2f8597[_0x10dfac(0x12f)],'key':_0x282574,'before':projectAppConfig(_0x2c2bd4),'after':null,'dryRun':![]}),'message':_0x10dfac(0x12e)+_0x282574};}};async function mustGetByKey(_0x54f0df,_0x2f6734){const _0x842344=a24_0x3c5125,_0xaabea=await withAppConfigApiBoundary(_0x842344(0x130),{'appCode':_0x54f0df,'key':_0x2f6734},()=>getAppConfigByKey(_0x54f0df,_0x2f6734));if(!_0xaabea)throw CliErrors['validation'](_0x842344(0x126)+_0x2f6734,_0x842344(0x122)+_0x54f0df);return _0xaabea;}function requireAppConfigId(_0x222179,_0x47b2c2,_0x44bc17){const _0x3b13e9=a24_0x3c5125;if(typeof _0x222179['id']===_0x3b13e9(0x132)&&Number['isFinite'](_0x222179['id'])&&_0x222179['id']>0x0)return _0x222179['id'];throw CliErrors[_0x3b13e9(0x124)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x47b2c2+_0x3b13e9(0x123)+_0x44bc17);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x115d12=a25_0x1a33;(function(_0x2d9042,_0x5903dd){const _0x30ee99=a25_0x1a33,_0x2b5c2b=_0x2d9042();while(!![]){try{const _0x2e5586=-parseInt(_0x30ee99(0x1c3))/0x1*(parseInt(_0x30ee99(0x1ba))/0x2)+-parseInt(_0x30ee99(0x1ca))/0x3+parseInt(_0x30ee99(0x1c1))/0x4+parseInt(_0x30ee99(0x1c2))/0x5+parseInt(_0x30ee99(0x1bc))/0x6*(parseInt(_0x30ee99(0x1bf))/0x7)+parseInt(_0x30ee99(0x1c5))/0x8*(parseInt(_0x30ee99(0x1b9))/0x9)+parseInt(_0x30ee99(0x1bd))/0xa;if(_0x2e5586===_0x5903dd)break;else _0x2b5c2b['push'](_0x2b5c2b['shift']());}catch(_0x2b2d7c){_0x2b5c2b['push'](_0x2b5c2b['shift']());}}}(a25_0x4eca,0xd56ba));function a25_0x1a33(_0xa91449,_0x3e24a5){_0xa91449=_0xa91449-0x1b8;const _0x4eca21=a25_0x4eca();let _0x1a3344=_0x4eca21[_0xa91449];return _0x1a3344;}import{getAppConfigByKey}from'../../core/api-client.js';function a25_0x4eca(){const _0x2c37d9=['read','27DehHVO','2uSepuI','bool','5621274KJGgkV','6416190dhfOkv','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','7sVuznK','validation','3106680aCJRFE','7374810hUHqzO','1492219USvYvm','get','528672Wcwnnz','\x20with\x20value\x20redacted','App\x20config\x20key\x20not\x20found:\x20','appCode','Loaded\x20app\x20config\x20','4985979SOpann','\x20with\x20value\x20revealed','reveal'];a25_0x4eca=function(){return _0x2c37d9;};return a25_0x4eca();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':'app-config','command':a25_0x115d12(0x1c4),'description':a25_0x115d12(0x1be),'risk':a25_0x115d12(0x1b8),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x25e220){readKeyArg(_0x25e220);},async 'execute'(_0x2a9a05){const _0x346e0f=a25_0x115d12,_0x1f7fdb=readKeyArg(_0x2a9a05),_0x34a442=await withAppConfigApiBoundary(_0x346e0f(0x1c4),{'appCode':_0x2a9a05[_0x346e0f(0x1c8)],'key':_0x1f7fdb},()=>getAppConfigByKey(_0x2a9a05['appCode'],_0x1f7fdb));if(!_0x34a442)throw CliErrors[_0x346e0f(0x1c0)](_0x346e0f(0x1c7)+_0x1f7fdb,'appCode:\x20'+_0x2a9a05[_0x346e0f(0x1c8)]);const _0x38924d=projectAppConfig(_0x34a442,{'reveal':_0x2a9a05[_0x346e0f(0x1bb)](_0x346e0f(0x1cc))});return{'ok':!![],'data':{'config':_0x38924d},'message':_0x2a9a05[_0x346e0f(0x1bb)](_0x346e0f(0x1cc))?_0x346e0f(0x1c9)+_0x1f7fdb+_0x346e0f(0x1cb):_0x346e0f(0x1c9)+_0x1f7fdb+_0x346e0f(0x1c6)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a26_0x36b0(){const _0xb0e3f1=['1110714NDjyqO','4ScNpac','2DUYxXA','346890vuWexG','271272nFCnha','8bKSWYr','189013kNvIQu','126TZGUCu','109194dklnJA','3925340aSODSt','3729124PDVXvA'];a26_0x36b0=function(){return _0xb0e3f1;};return a26_0x36b0();}(function(_0x48fc31,_0x35d774){const _0x37eb36=a26_0xa6c9,_0x2d5994=_0x48fc31();while(!![]){try{const _0x43bca5=parseInt(_0x37eb36(0x14b))/0x1*(-parseInt(_0x37eb36(0x152))/0x2)+-parseInt(_0x37eb36(0x14d))/0x3*(-parseInt(_0x37eb36(0x151))/0x4)+parseInt(_0x37eb36(0x14e))/0x5+-parseInt(_0x37eb36(0x154))/0x6+parseInt(_0x37eb36(0x14f))/0x7*(parseInt(_0x37eb36(0x155))/0x8)+parseInt(_0x37eb36(0x14c))/0x9*(-parseInt(_0x37eb36(0x153))/0xa)+-parseInt(_0x37eb36(0x150))/0xb;if(_0x43bca5===_0x35d774)break;else _0x2d5994['push'](_0x2d5994['shift']());}catch(_0x4119d8){_0x2d5994['push'](_0x2d5994['shift']());}}}(a26_0x36b0,0x82369));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_0xa6c9(_0x3b52ca,_0x392fb1){_0x3b52ca=_0x3b52ca-0x14b;const _0x36b0bc=a26_0x36b0();let _0xa6c95c=_0x36b0bc[_0x3b52ca];return _0xa6c95c;}export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x791323=a27_0xbd1e;(function(_0x300899,_0x3b9430){const _0x1ea17d=a27_0xbd1e,_0x24c28e=_0x300899();while(!![]){try{const _0xaf0667=parseInt(_0x1ea17d(0x1d2))/0x1+parseInt(_0x1ea17d(0x1cb))/0x2*(-parseInt(_0x1ea17d(0x1c2))/0x3)+-parseInt(_0x1ea17d(0x1d1))/0x4+parseInt(_0x1ea17d(0x1d0))/0x5+parseInt(_0x1ea17d(0x1ca))/0x6*(parseInt(_0x1ea17d(0x1c7))/0x7)+-parseInt(_0x1ea17d(0x1c6))/0x8+parseInt(_0x1ea17d(0x1cd))/0x9*(parseInt(_0x1ea17d(0x1c3))/0xa);if(_0xaf0667===_0x3b9430)break;else _0x24c28e['push'](_0x24c28e['shift']());}catch(_0x19fcd5){_0x24c28e['push'](_0x24c28e['shift']());}}}(a27_0x2eaa,0x9fdcd));function a27_0xbd1e(_0x5ba6bf,_0x3c67b1){_0x5ba6bf=_0x5ba6bf-0x1c2;const _0x2eaa4c=a27_0x2eaa();let _0xbd1e46=_0x2eaa4c[_0x5ba6bf];return _0xbd1e46;}import{listAppConfigs}from'../../core/api-client.js';function a27_0x2eaa(){const _0x2d1601=['2130490MQSSAT','key','map','3416456DbSTLi','7mDMtLV','str','\x20app\x20config(s)','5392302eCBrOT','713680iRcKQb','appCode','45LoOUwu','trim','string','1312065QzPxOZ','4148160uBUsGA','249359gJmWsM','length','list','3qYJLAl'];a27_0x2eaa=function(){return _0x2d1601;};return a27_0x2eaa();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':'list','description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':a27_0x791323(0x1cf),'description':'Filter\x20by\x20exact\x20config\x20key'},TAGS_FLAG],async 'validate'(_0x3087f4){const _0x214897=a27_0x791323,_0x532c8f=_0x3087f4[_0x214897(0x1c8)](_0x214897(0x1c4))[_0x214897(0x1ce)]();if(_0x532c8f)validateKey(_0x532c8f);readOptionalTags(_0x3087f4);},async 'execute'(_0x32abce){const _0x5461ba=a27_0x791323,_0x305976=_0x32abce[_0x5461ba(0x1c8)](_0x5461ba(0x1c4))[_0x5461ba(0x1ce)]()||undefined,_0x780f6d=readOptionalTags(_0x32abce),_0x322832=await withAppConfigApiBoundary(_0x5461ba(0x1d4),{'appCode':_0x32abce[_0x5461ba(0x1cc)]},()=>listAppConfigs(_0x32abce[_0x5461ba(0x1cc)],{'key':_0x305976,'tags':_0x780f6d})),_0x5654e1=_0x322832[_0x5461ba(0x1c5)](_0x398b4d=>projectAppConfig(_0x398b4d));return{'ok':!![],'data':{'appCode':_0x32abce[_0x5461ba(0x1cc)],'count':_0x5654e1[_0x5461ba(0x1d3)],'configs':_0x5654e1},'message':'Found\x20'+_0x5654e1[_0x5461ba(0x1d3)]+_0x5461ba(0x1c9)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x21667e=a28_0x58f8;(function(_0x416302,_0x17f399){const _0x3840bc=a28_0x58f8,_0x2c2590=_0x416302();while(!![]){try{const _0x398b2c=-parseInt(_0x3840bc(0x1b1))/0x1*(-parseInt(_0x3840bc(0x1aa))/0x2)+-parseInt(_0x3840bc(0x1bb))/0x3+parseInt(_0x3840bc(0x1b9))/0x4+-parseInt(_0x3840bc(0x1ad))/0x5+parseInt(_0x3840bc(0x1af))/0x6+-parseInt(_0x3840bc(0x1b2))/0x7+-parseInt(_0x3840bc(0x1ba))/0x8*(-parseInt(_0x3840bc(0x1bd))/0x9);if(_0x398b2c===_0x17f399)break;else _0x2c2590['push'](_0x2c2590['shift']());}catch(_0x470652){_0x2c2590['push'](_0x2c2590['shift']());}}}(a28_0xec27,0x42527));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a28_0xec27(){const _0x32012b=['379660ldYZgN','1272rYjerJ','1187202SzWDVb','\x20app\x20config\x20','38088QWGaSi',',\x20appCode=','number','file','Updated','update','/smartapi/app-config/update','8LVfBkU','App\x20config\x20server\x20id\x20missing\x20for\x20key=','create','334025DgLWbg','Read\x20config\x20value\x20from\x20file','556170ETyVEi','set','74731iJIKFB','2976596PZdCcm','tags','app-config','POST','appCode','get','apiError'];a28_0xec27=function(){return _0x32012b;};return a28_0xec27();}const CREATE_PATH='/smartapi/app-config/create',UPDATE_PATH=a28_0x21667e(0x1a9);export const appConfigSet={'service':a28_0x21667e(0x1b4),'command':a28_0x21667e(0x1b0),'description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0x21667e(0x1c0),'type':'string','description':a28_0x21667e(0x1ae)}],async 'validate'(_0x46d208){readKeyArg(_0x46d208),readOptionalTags(_0x46d208),assertSingleValueSource(_0x46d208);},async 'dryRun'(_0x3c6169){const _0x266493=a28_0x21667e,_0x7dff2b=readKeyArg(_0x3c6169),_0x1a84c7=readOptionalTags(_0x3c6169),_0xc7691a=assertSingleValueSource(_0x3c6169);await assertValueSourceReadable(_0xc7691a);const _0x5b16f9=await withAppConfigApiBoundary(_0x266493(0x1b7),{'appCode':_0x3c6169[_0x266493(0x1b6)],'key':_0x7dff2b},()=>getAppConfigByKey(_0x3c6169[_0x266493(0x1b6)],_0x7dff2b)),_0x47fa45=_0x5b16f9?_0x266493(0x1a8):'create',_0x3b22e4=_0x5b16f9?projectAppConfig(_0x5b16f9):null,_0xc46b5=plannedAppConfig({'appCode':_0x3c6169['appCode'],'key':_0x7dff2b,'tags':_0x1a84c7??_0x5b16f9?.[_0x266493(0x1b3)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x47fa45,'appCode':_0x3c6169['appCode'],'key':_0x7dff2b,'before':_0x3b22e4,'after':_0xc46b5,'dryRun':!![]}),{'method':_0x266493(0x1b5),'url':_0x47fa45===_0x266493(0x1a8)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x3c9cda){const _0x43a929=a28_0x21667e,_0x3eac62=readKeyArg(_0x3c9cda),_0x58edb3=readOptionalTags(_0x3c9cda),_0x2a5df5=await withAppConfigApiBoundary(_0x43a929(0x1b7),{'appCode':_0x3c9cda[_0x43a929(0x1b6)],'key':_0x3eac62},()=>getAppConfigByKey(_0x3c9cda[_0x43a929(0x1b6)],_0x3eac62)),_0x406c14=_0x2a5df5?projectAppConfig(_0x2a5df5):null,_0x234175=_0x2a5df5?_0x43a929(0x1a8):_0x43a929(0x1ac),{value:_0x4ed1c2,warnings:_0x162495}=await readAppConfigValue(_0x3c9cda),_0x50aea8={'appCode':_0x3c9cda['appCode'],'key':_0x3eac62,'value':_0x4ed1c2,'tags':_0x58edb3??_0x2a5df5?.[_0x43a929(0x1b3)]??undefined};await withAppConfigApiBoundary(_0x234175,{'appCode':_0x3c9cda['appCode'],'key':_0x3eac62},async()=>{const _0xc2c0d1=_0x43a929;_0x2a5df5?await updateAppConfig({..._0x50aea8,'id':requireAppConfigId(_0x2a5df5,_0x3eac62,_0x3c9cda[_0xc2c0d1(0x1b6)])}):await createAppConfig(_0x50aea8);});const _0x3c17a5=await withAppConfigApiBoundary(_0x43a929(0x1b7),{'appCode':_0x3c9cda['appCode'],'key':_0x3eac62},()=>getAppConfigByKey(_0x3c9cda[_0x43a929(0x1b6)],_0x3eac62)),_0x498161=_0x3c17a5?projectAppConfig(_0x3c17a5):plannedAppConfig({'appCode':_0x3c9cda[_0x43a929(0x1b6)],'key':_0x3eac62,'tags':_0x50aea8[_0x43a929(0x1b3)],'hasValue':_0x4ed1c2!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x234175,'appCode':_0x3c9cda[_0x43a929(0x1b6)],'key':_0x3eac62,'before':_0x406c14,'after':_0x498161,'dryRun':![],'warnings':_0x162495}),'message':(_0x234175===_0x43a929(0x1a8)?_0x43a929(0x1a7):'Created')+_0x43a929(0x1bc)+_0x3eac62};}};function a28_0x58f8(_0x11081b,_0xcd19ee){_0x11081b=_0x11081b-0x1a7;const _0xec275c=a28_0xec27();let _0x58f863=_0xec275c[_0x11081b];return _0x58f863;}function requireAppConfigId(_0x59f17f,_0x337439,_0x5bb3ab){const _0x2432ed=a28_0x21667e;if(typeof _0x59f17f['id']===_0x2432ed(0x1bf)&&Number['isFinite'](_0x59f17f['id'])&&_0x59f17f['id']>0x0)return _0x59f17f['id'];throw CliErrors[_0x2432ed(0x1b8)](_0x2432ed(0x1ab)+_0x337439+_0x2432ed(0x1be)+_0x5bb3ab);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x196be5=a29_0x57eb;(function(_0x1d9789,_0x463bb1){const _0x5ce877=a29_0x57eb,_0x4ec1fc=_0x1d9789();while(!![]){try{const _0x4ed8f2=-parseInt(_0x5ce877(0x106))/0x1*(-parseInt(_0x5ce877(0x100))/0x2)+parseInt(_0x5ce877(0xff))/0x3+-parseInt(_0x5ce877(0xdc))/0x4+parseInt(_0x5ce877(0xe8))/0x5*(parseInt(_0x5ce877(0x109))/0x6)+parseInt(_0x5ce877(0xef))/0x7+parseInt(_0x5ce877(0x103))/0x8+parseInt(_0x5ce877(0xe5))/0x9*(-parseInt(_0x5ce877(0xf2))/0xa);if(_0x4ed8f2===_0x463bb1)break;else _0x4ec1fc['push'](_0x4ec1fc['shift']());}catch(_0x47cbba){_0x4ec1fc['push'](_0x4ec1fc['shift']());}}}(a29_0x3aa9,0x6ff86));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x196be5(0xea),'description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a29_0x196be5(0xde),'description':a29_0x196be5(0x107),'required':![]};export const TAGS_FLAG={'name':a29_0x196be5(0xfb),'type':a29_0x196be5(0xfc),'description':a29_0x196be5(0xed)};export const STDIN_FLAG={'name':'stdin','type':'boolean','description':a29_0x196be5(0xf8),'default':![]};export const FROM_ENV_FLAG={'name':a29_0x196be5(0xfa),'type':a29_0x196be5(0xfc),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a29_0x196be5(0xf1),'type':a29_0x196be5(0x115),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x5322e9){const _0xc9259b=a29_0x196be5,_0x39f954=_0x5322e9[_0xc9259b(0x111)][0x0]?.[_0xc9259b(0x112)]()??'';return validateKey(_0x39f954),_0x39f954;}export function readOptionalTags(_0x4961ec){const _0x253546=a29_0x196be5,_0x314feb=_0x4961ec[_0x253546(0x114)](_0x253546(0xfb))[_0x253546(0x112)]();if(!_0x314feb)return undefined;if(_0x314feb['length']>0x20)throw CliErrors[_0x253546(0x101)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x314feb;}function a29_0x57eb(_0x51d801,_0x58be0b){_0x51d801=_0x51d801-0xdc;const _0x3aa941=a29_0x3aa9();let _0x57eb3c=_0x3aa941[_0x51d801];return _0x57eb3c;}export function validateKey(_0xd0bc2){const _0x1409e0=a29_0x196be5;if(!_0xd0bc2)throw CliErrors[_0x1409e0(0x101)](_0x1409e0(0x10c));if(_0xd0bc2[_0x1409e0(0x102)]>0x100)throw CliErrors[_0x1409e0(0x101)](_0x1409e0(0xe3));}export function projectAppConfig(_0x507254,_0x18d21e){const _0x55ef19=a29_0x196be5,_0x53a27c=_0x507254[_0x55ef19(0xde)]!==undefined&&_0x507254['value']!==null&&_0x507254[_0x55ef19(0xde)]!=='',_0x4fac23={'appCode':_0x507254[_0x55ef19(0x104)],'key':_0x507254['key'],'tags':_0x507254[_0x55ef19(0xfb)]??undefined,'hasValue':_0x53a27c,'valueRedacted':_0x53a27c&&!_0x18d21e?.[_0x55ef19(0xf1)],'gmtCreate':_0x507254[_0x55ef19(0xfe)],'gmtModified':_0x507254['gmtModified']};return _0x18d21e?.[_0x55ef19(0xf1)]&&(_0x4fac23['value']=_0x507254[_0x55ef19(0xde)]??'',_0x4fac23[_0x55ef19(0x116)]=![]),_0x4fac23;}export function plannedAppConfig(_0x30034e){const _0x3925f3=a29_0x196be5,_0x221bd9=_0x30034e[_0x3925f3(0x10b)]??!![];return{'appCode':_0x30034e[_0x3925f3(0x104)],'key':_0x30034e[_0x3925f3(0xea)],'tags':_0x30034e[_0x3925f3(0xfb)]??undefined,'hasValue':_0x221bd9,'valueRedacted':_0x221bd9};}export function buildMutationData(_0x536d6a){const _0x1b3534=a29_0x196be5;return{'operation':_0x536d6a[_0x1b3534(0xf5)],'selector':{'appCode':_0x536d6a[_0x1b3534(0x104)],'key':_0x536d6a['key']},'before':_0x536d6a[_0x1b3534(0xe6)],'after':_0x536d6a[_0x1b3534(0x110)],'dryRun':_0x536d6a['dryRun'],'warnings':_0x536d6a['warnings']??[]};}export async function withAppConfigApiBoundary(_0x7f9e78,_0x17033e,_0x26f47d){const _0x33ac37=a29_0x196be5;try{return await _0x26f47d();}catch{const _0x1176ed=['appCode:\x20'+_0x17033e['appCode']];if(_0x17033e[_0x33ac37(0xea)])_0x1176ed['push'](_0x33ac37(0x10d)+_0x17033e[_0x33ac37(0xea)]);_0x1176ed[_0x33ac37(0xdd)](_0x33ac37(0xe1));throw CliErrors['apiError'](_0x33ac37(0x105)+_0x7f9e78+'\x20app\x20config.',_0x1176ed[_0x33ac37(0xe9)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x707a9,_0x543a90){const _0x2f1490=a29_0x196be5;return Object[_0x2f1490(0xec)](_0x707a9,{'method':{'value':_0x543a90['method'],'enumerable':![]},'url':{'value':_0x543a90['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x3e5cf7){const _0x5e20dc=a29_0x196be5,_0x4cfee0=[];_0x3e5cf7[_0x5e20dc(0x111)][_0x5e20dc(0x102)]>0x1&&_0x4cfee0['push']({'kind':_0x5e20dc(0xee),'value':_0x3e5cf7[_0x5e20dc(0x111)][_0x5e20dc(0xe2)](0x1)[_0x5e20dc(0xe9)]('\x20')});const _0x3803c0=_0x3e5cf7[_0x5e20dc(0xf7)](_0x5e20dc(0xde));_0x3803c0!==undefined&&_0x3803c0!==null&&_0x4cfee0[_0x5e20dc(0xdd)]({'kind':_0x5e20dc(0xee),'value':String(_0x3803c0)});_0x3e5cf7['bool']('stdin')&&_0x4cfee0[_0x5e20dc(0xdd)]({'kind':_0x5e20dc(0xdf)});const _0x6e3ed7=_0x3e5cf7[_0x5e20dc(0x114)]('from-env')[_0x5e20dc(0x112)]();_0x6e3ed7&&_0x4cfee0[_0x5e20dc(0xdd)]({'kind':'env','name':_0x6e3ed7});const _0x303476=_0x3e5cf7[_0x5e20dc(0x114)]('file')['trim']();_0x303476&&_0x4cfee0[_0x5e20dc(0xdd)]({'kind':'file','path':_0x303476});if(_0x4cfee0[_0x5e20dc(0x102)]===0x0)throw CliErrors[_0x5e20dc(0x101)]('Missing\x20app-config\x20value\x20source.',_0x5e20dc(0xf6));if(_0x4cfee0[_0x5e20dc(0x102)]>0x1)throw CliErrors[_0x5e20dc(0x101)](_0x5e20dc(0xf3),_0x5e20dc(0xe7));return _0x4cfee0[0x0];}function a29_0x3aa9(){const _0x25ed51=['file','kind','after','args','trim','name','str','boolean','valueRedacted','1347636NFGpLP','push','value','stdin','path','value\x20is\x20redacted','slice','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','23283AoksBK','before','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','866570RkYxRj','join','key','env','defineProperties','Config\x20tags\x20for\x20filtering/display\x20metadata','argument','1766814JLcKLj','utf8','reveal','4870XCYuNp','App\x20config\x20value\x20source\x20is\x20ambiguous.','Environment\x20variable\x20is\x20not\x20set:\x20','operation','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','flag','Read\x20config\x20value\x20from\x20stdin','Value\x20file\x20is\x20not\x20readable:\x20','from-env','tags','string','once','gmtCreate','2327028KqUPym','1138MNYodG','validation','length','544104fVjUjO','appCode','Failed\x20to\x20','163kvqzZG','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','data','30WmMmHm','error','hasValue','Missing\x20app-config\x20key.','key:\x20'];a29_0x3aa9=function(){return _0x25ed51;};return a29_0x3aa9();}export async function assertValueSourceReadable(_0x41e062){const _0x7d0658=a29_0x196be5;if(_0x41e062[_0x7d0658(0x10f)]==='env'&&!(_0x41e062[_0x7d0658(0x113)]in process.env))throw CliErrors[_0x7d0658(0x101)](_0x7d0658(0xf4)+_0x41e062['name']);if(_0x41e062[_0x7d0658(0x10f)]===_0x7d0658(0x10e))try{await access(_0x41e062['path']);}catch{throw CliErrors[_0x7d0658(0x101)](_0x7d0658(0xf9)+_0x41e062['path']);}}export async function readAppConfigValue(_0x18c5c2){const _0x451851=a29_0x196be5,_0x43a0f6=assertSingleValueSource(_0x18c5c2),_0x4f03c5=[];if(_0x43a0f6[_0x451851(0x10f)]==='argument')return _0x4f03c5[_0x451851(0xdd)](_0x451851(0xe4)),{'value':_0x43a0f6[_0x451851(0xde)]??'','source':_0x43a0f6['kind'],'warnings':_0x4f03c5};if(_0x43a0f6[_0x451851(0x10f)]===_0x451851(0xdf))return{'value':await readStdin(),'source':_0x43a0f6[_0x451851(0x10f)],'warnings':_0x4f03c5};if(_0x43a0f6[_0x451851(0x10f)]===_0x451851(0xeb)){if(!(_0x43a0f6[_0x451851(0x113)]in process.env))throw CliErrors[_0x451851(0x101)](_0x451851(0xf4)+_0x43a0f6[_0x451851(0x113)]);return{'value':process.env[_0x43a0f6.name]??'','source':_0x43a0f6[_0x451851(0x10f)],'warnings':_0x4f03c5};}return{'value':await readFile(_0x43a0f6[_0x451851(0xe0)],_0x451851(0xf0)),'source':_0x43a0f6[_0x451851(0x10f)],'warnings':_0x4f03c5};}function readStdin(){return new Promise((_0x21415e,_0x507571)=>{const _0x591b1b=a29_0x57eb;let _0x3d3eb8='';process[_0x591b1b(0xdf)]['setEncoding']('utf8'),process[_0x591b1b(0xdf)]['on'](_0x591b1b(0x108),_0x57a8ab=>{_0x3d3eb8+=_0x57a8ab;}),process['stdin'][_0x591b1b(0xfd)]('end',()=>_0x21415e(_0x3d3eb8)),process['stdin'][_0x591b1b(0xfd)](_0x591b1b(0x10a),_0x507571);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x4cfcca=a30_0x42c5;(function(_0x31dbf9,_0x3d6d3e){const _0x2f30a2=a30_0x42c5,_0x4745ed=_0x31dbf9();while(!![]){try{const _0x4656d3=parseInt(_0x2f30a2(0x8a))/0x1*(-parseInt(_0x2f30a2(0x83))/0x2)+-parseInt(_0x2f30a2(0x91))/0x3*(-parseInt(_0x2f30a2(0x93))/0x4)+-parseInt(_0x2f30a2(0x84))/0x5+-parseInt(_0x2f30a2(0x98))/0x6+-parseInt(_0x2f30a2(0x8d))/0x7+-parseInt(_0x2f30a2(0x8c))/0x8+parseInt(_0x2f30a2(0x99))/0x9*(parseInt(_0x2f30a2(0x85))/0xa);if(_0x4656d3===_0x3d6d3e)break;else _0x4745ed['push'](_0x4745ed['shift']());}catch(_0x56aea7){_0x4745ed['push'](_0x4745ed['shift']());}}}(a30_0x4acb,0x4fc30));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a30_0x42c5(_0x541573,_0x4f5ddb){_0x541573=_0x541573-0x83;const _0x4acb97=a30_0x4acb();let _0x42c54f=_0x4acb97[_0x541573];return _0x42c54f;}export const authDefinitions=[{'service':'auth','command':a30_0x4cfcca(0x96),'description':a30_0x4cfcca(0x8e),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a30_0x4cfcca(0x92),'type':a30_0x4cfcca(0x8b),'description':a30_0x4cfcca(0x8f),'default':![]}],async 'execute'(_0x3da558){const _0x32862a=a30_0x4cfcca,{runAuthServer:_0x4ae562}=await import(_0x32862a(0x88));return await _0x4ae562({'autoYes':_0x3da558[_0x32862a(0x95)](_0x32862a(0x92)),'nonInteractive':_0x3da558[_0x32862a(0x87)]}),{'ok':!![]};}},{'service':a30_0x4cfcca(0x9a),'command':a30_0x4cfcca(0x90),'description':a30_0x4cfcca(0x89),'risk':a30_0x4cfcca(0x97),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x552d6e){const _0x1a7678=a30_0x4cfcca;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console[_0x1a7678(0x94)](_0x1a7678(0x86)),{'ok':!![]};}}];function a30_0x4acb(){const _0x3fd81b=['938mpbJkY','2085685vuKJBJ','370mVYxyG','!\x20Not\x20logged\x20in','nonInteractive','../../auth/auth-server-ui.js','Clear\x20login\x20session','361EXHwtf','boolean','3704648kkrvOK','2842007CsXbxQ','Login\x20via\x20browser','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','logout','1101XTzIRm','yes','4236BuiAAP','log','bool','login','write','1583238FAtiAq','403164MDgoAt','auth'];a30_0x4acb=function(){return _0x3fd81b;};return a30_0x4acb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x173f1f=a31_0x2f7f;function a31_0x2f7f(_0x59ebe2,_0x1e80b5){_0x59ebe2=_0x59ebe2-0xb1;const _0x518d0e=a31_0x518d();let _0x2f7f5b=_0x518d0e[_0x59ebe2];return _0x2f7f5b;}(function(_0x57de02,_0xdc1891){const _0x50fe7b=a31_0x2f7f,_0x238b8a=_0x57de02();while(!![]){try{const _0x1eaa84=parseInt(_0x50fe7b(0xcd))/0x1*(-parseInt(_0x50fe7b(0x10f))/0x2)+-parseInt(_0x50fe7b(0xd4))/0x3*(parseInt(_0x50fe7b(0xe5))/0x4)+-parseInt(_0x50fe7b(0x101))/0x5+-parseInt(_0x50fe7b(0xed))/0x6*(parseInt(_0x50fe7b(0xc3))/0x7)+parseInt(_0x50fe7b(0xe3))/0x8*(-parseInt(_0x50fe7b(0xf9))/0x9)+parseInt(_0x50fe7b(0xe2))/0xa*(-parseInt(_0x50fe7b(0xee))/0xb)+parseInt(_0x50fe7b(0xdd))/0xc;if(_0x1eaa84===_0xdc1891)break;else _0x238b8a['push'](_0x238b8a['shift']());}catch(_0x21d7a9){_0x238b8a['push'](_0x238b8a['shift']());}}}(a31_0x518d,0xa8f5d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x173f1f(0xcf),'command':'create','description':a31_0x173f1f(0xc7),'risk':a31_0x173f1f(0xb9),'flags':[{'name':a31_0x173f1f(0xca),'type':a31_0x173f1f(0x115),'required':!![],'enum':['COMMON','ENDPOINT',a31_0x173f1f(0x116)],'description':a31_0x173f1f(0xc2)},{'name':a31_0x173f1f(0xde),'type':a31_0x173f1f(0x115),'required':!![],'description':a31_0x173f1f(0x109)},{'name':a31_0x173f1f(0xe4),'type':a31_0x173f1f(0x115),'description':'Script\x20description'},{'name':a31_0x173f1f(0x114),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a31_0x173f1f(0x115),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a31_0x173f1f(0xbc),'type':a31_0x173f1f(0x115),'description':a31_0x173f1f(0xba)},{'name':a31_0x173f1f(0xe1),'type':a31_0x173f1f(0x115),'description':a31_0x173f1f(0xfc),'enum':[a31_0x173f1f(0x10c),'after']}],async 'validate'(_0x541b98){const _0x1db558=a31_0x173f1f,_0x109921=_0x541b98[_0x1db558(0xef)](_0x1db558(0xde));if(!isValidBffFunctionName(_0x109921))throw CliErrors[_0x1db558(0xf3)](_0x1db558(0xfe)+_0x109921+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0xc7a0b9){const _0x1296e9=a31_0x173f1f,_0x184047=loadBffProjectConfig(_0xc7a0b9['appCode']),_0x48d926=_0xc7a0b9[_0x1296e9(0xef)](_0x1296e9(0xca)),_0x988ac4=_0xc7a0b9[_0x1296e9(0xef)](_0x1296e9(0xde)),_0x277016=_0xc7a0b9['str'](_0x1296e9(0xe4))||undefined,_0x5807d1=_0x48d926==='HOOK'?await resolveHookOptions(_0x184047,_0xc7a0b9):undefined,_0x326f27=buildFilePath(_0x184047,_0x48d926,_0x988ac4,_0x5807d1);if(await fileExists(_0x326f27))throw CliErrors[_0x1296e9(0xf3)](_0x1296e9(0xec)+_0x326f27);await mkdir(dirname(_0x326f27),{'recursive':!![]});const _0xc39a5=generateTemplate(_0x48d926,_0x988ac4,_0xc7a0b9['appCode'],_0x277016,_0x5807d1);await writeFile(_0x326f27,_0xc39a5,_0x1296e9(0xcc));const _0x3a9e86={'type':_0x48d926,'name':_0x988ac4,'path':_0x326f27};if(_0x277016)_0x3a9e86[_0x1296e9(0xe4)]=_0x277016;if(_0x5807d1){if(_0x5807d1['alias'])_0x3a9e86[_0x1296e9(0x114)]=_0x5807d1['alias'];_0x3a9e86['datasetCode']=_0x5807d1[_0x1296e9(0xfb)],_0x3a9e86[_0x1296e9(0xbb)]=_0x5807d1['operationType'],_0x3a9e86[_0x1296e9(0xd8)]=_0x5807d1[_0x1296e9(0xd8)];}return{'ok':!![],'data':_0x3a9e86,'message':_0x1296e9(0xc8)+_0x48d926+_0x1296e9(0xda)+_0x988ac4};}};async function resolveHookOptions(_0x4433d7,_0x35e398){const _0x59032a=a31_0x173f1f,_0x44b2a3=loadAliasMap(_0x35e398[_0x59032a(0x117)],undefined,resolveApiFilePath(_0x35e398[_0x59032a(0x117)],_0x35e398[_0x59032a(0xc6)])),_0x35e833=_0x44b2a3[_0x59032a(0xc4)]>0x0;let _0x569641,_0x16e90c,_0xa2e959;const _0x4bbf6f=_0x35e398[_0x59032a(0xef)](_0x59032a(0x114)),_0x36d8d6=_0x35e398[_0x59032a(0xef)](_0x59032a(0xbe));if(_0x4bbf6f){const _0x1b030d=resolveAlias(_0x35e398[_0x59032a(0x117)],_0x4bbf6f,undefined,resolveApiFilePath(_0x35e398[_0x59032a(0x117)],_0x35e398[_0x59032a(0xc6)]));if(!_0x1b030d){const _0x1212d4=_0x35e833?_0x59032a(0xe6)+_0x44b2a3[_0x59032a(0xe9)](_0x438e7e=>_0x438e7e[_0x59032a(0x114)])[_0x59032a(0xd5)](',\x20'):_0x59032a(0xff)+CLI_BIN_NAME+_0x59032a(0xbd);throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xc5)+_0x4bbf6f+'\x22\x20not\x20found.\x20'+_0x1212d4);}_0x569641=_0x4bbf6f,_0x16e90c=_0x1b030d;}else{if(_0x36d8d6){_0x16e90c=_0x36d8d6;const _0xf083a=_0x44b2a3[_0x59032a(0xd2)](_0x252af0=>_0x252af0[_0x59032a(0xfb)]===_0x36d8d6);_0x569641=_0xf083a?.[_0x59032a(0x114)];}else{if(_0x35e398[_0x59032a(0xcb)])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x35e833){const _0x2e3ada=_0x44b2a3[_0x59032a(0xe9)](_0x519c29=>_0x519c29[_0x59032a(0x114)]+'\x20('+_0x519c29[_0x59032a(0x102)]+')'),_0x3147f1=await promptSelect(_0x59032a(0xf2),_0x2e3ada),_0x5da7cc=_0x44b2a3[_0x3147f1];if(!_0x5da7cc)throw CliErrors[_0x59032a(0xf3)]('Invalid\x20dataset\x20selection.');_0x569641=_0x5da7cc[_0x59032a(0x114)],_0x16e90c=_0x5da7cc[_0x59032a(0xfb)];}else{const _0x127938=await listDatasets(_0x35e398[_0x59032a(0xc6)]);if(_0x127938[_0x59032a(0xc4)]===0x0)throw CliErrors[_0x59032a(0xf3)](_0x59032a(0x108));const _0x2c45a3=_0x127938[_0x59032a(0xe9)](_0x2a32b1=>_0x2a32b1['name']+'\x20['+(_0x2a32b1[_0x59032a(0xd7)]??_0x59032a(0x10b))+']\x20('+_0x2a32b1[_0x59032a(0xb3)]+')'),_0x2940d2=await promptSelect(_0x59032a(0xf2),_0x2c45a3),_0x4a4f18=_0x127938[_0x2940d2];if(!_0x4a4f18)throw CliErrors[_0x59032a(0xf3)]('Invalid\x20dataset\x20selection.');_0x16e90c=_0x4a4f18[_0x59032a(0xb3)],_0x569641=undefined;}}}}const _0xf1bbba=await listDatasets(_0x35e398['appCode']),_0x3eb0dd=_0xf1bbba[_0x59032a(0xd2)](_0x722d8d=>_0x722d8d['code']===_0x16e90c);if(!_0x3eb0dd)throw CliErrors[_0x59032a(0xf3)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x16e90c+_0x59032a(0xb4)+(_0x569641?_0x59032a(0xb7)+CLI_BIN_NAME+_0x59032a(0x10a):''));_0xa2e959=_0x3eb0dd['id'];const _0x553ed8=_0x569641??_0x16e90c,_0x1e5896=await listBffDatasetOperations(_0x35e398[_0x59032a(0xc6)],_0xa2e959),_0x32610e=_0x1e5896?Object[_0x59032a(0xe8)](_0x1e5896):[];if(_0x32610e['length']===0x0)throw CliErrors[_0x59032a(0xf3)](_0x59032a(0x111)+_0x553ed8+'.');let _0x5ee056;const _0x5cf9ba=_0x35e398[_0x59032a(0xef)](_0x59032a(0xbc));if(_0x5cf9ba){if(!_0x32610e['includes'](_0x5cf9ba))throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xdb)+_0x5cf9ba+_0x59032a(0xe0)+_0x553ed8+'.\x20'+(_0x59032a(0x107)+_0x32610e[_0x59032a(0xd5)](',\x20')));_0x5ee056=_0x5cf9ba;}else{if(_0x35e398[_0x59032a(0xcb)])throw CliErrors['validation'](_0x59032a(0xd6));const _0x146c86=await promptSelect(_0x59032a(0xb6),_0x32610e);_0x5ee056=_0x32610e[_0x146c86]??_0x32610e[0x0];}let _0x3241c5=normalizeHookFunctionNode(_0x35e398['str'](_0x59032a(0xe1)));if(!_0x3241c5){if(_0x35e398['str'](_0x59032a(0xe1)))throw CliErrors['validation'](_0x59032a(0xc0));if(_0x35e398[_0x59032a(0xcb)])throw CliErrors[_0x59032a(0xf3)](_0x59032a(0xb8));const _0x51eaa8=await promptSelect('Select\x20trigger\x20node:',[_0x59032a(0x10c),_0x59032a(0xc1)]);_0x3241c5=[_0x59032a(0x10c),'after'][_0x51eaa8]??_0x59032a(0x10c);}return{'alias':_0x569641,'datasetCode':_0x16e90c,'datasetId':_0xa2e959,'operationType':_0x5ee056,'functionNode':_0x3241c5};}async function promptSelect(_0x4f15e9,_0x21a686){const _0xec0b31=a31_0x173f1f;if(_0x21a686[_0xec0b31(0xc4)]===0x1)return 0x0;for(const [_0x5d87aa,_0x312a43]of _0x21a686[_0xec0b31(0x10e)]()){process['stderr']['write']('\x20\x20'+(_0x5d87aa+0x1)+'.\x20'+_0x312a43+'\x0a');}const _0x482044=createInterface({'input':process[_0xec0b31(0x113)],'output':process[_0xec0b31(0xd9)]});while(!![]){const _0x227cd7=await new Promise(_0x5bb0c4=>{const _0x3f68ac=_0xec0b31;_0x482044[_0x3f68ac(0xbf)](_0x4f15e9+'\x20',_0x5bb0c4);}),_0x29322e=Number[_0xec0b31(0xdf)](_0x227cd7[_0xec0b31(0xf1)](),0xa);if(Number[_0xec0b31(0x10d)](_0x29322e)&&_0x29322e>=0x1&&_0x29322e<=_0x21a686[_0xec0b31(0xc4)])return _0x482044['close'](),_0x29322e-0x1;process[_0xec0b31(0xd9)][_0xec0b31(0xc9)](_0xec0b31(0x110)+_0x21a686[_0xec0b31(0xc4)]+'.\x0a');}}function buildFilePath(_0x112ea9,_0x5bdc4a,_0x292110,_0xd7437d){const _0x30101e=a31_0x173f1f;if(_0x5bdc4a===_0x30101e(0x116)){if(!_0xd7437d)throw CliErrors[_0x30101e(0xf3)](_0x30101e(0x106));const _0x131174=_0xd7437d['alias']??_0xd7437d['datasetCode'];return join(_0x112ea9[_0x30101e(0x105)],_0x30101e(0x116),_0x131174,_0xd7437d[_0x30101e(0xbb)],_0xd7437d[_0x30101e(0xd8)],_0x292110+_0x30101e(0xf5));}return join(_0x112ea9[_0x30101e(0x105)],_0x5bdc4a,_0x292110+'.js');}function a31_0x518d(){const _0x48850d=['No\x20operation\x20types\x20found\x20for\x20dataset\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','stdin','alias','string','HOOK','apiDir','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[平台配置]\x20','code','\x22.\x20','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Select\x20operation\x20type:','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','read','Operation\x20type\x20(HOOK\x20only)','operationType','operation-type','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','datasetcode','question','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','after','Script\x20type','41853XuixXk','length','Alias\x20\x22','appCode','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Created\x20','write','type','nonInteractive','utf8','706925gmvspH','/COMMON/','bff','/data/dataset/','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','find','/**\x0a\x20*\x20','1369254XJrSRC','join','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','source','functionNode','stderr','\x20function:\x20','Operation\x20type\x20\x22','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','60142968ydNtwb','name','parseInt','\x22\x20not\x20found\x20for\x20dataset\x20','function-node','171490FMEaet','6320lDdtbD','description','4iKctNM','Available\x20aliases:\x20','datasetId','keys','map','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','File\x20already\x20exists:\x20','948DYMGfq','55urbLdy','str','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','trim','Select\x20dataset:','validation','ENDPOINT','.js','.js\x0a\x20*\x20[触发节点]\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','12573BjhFow','.js\x0a','datasetCode','Trigger\x20node\x20(HOOK\x20only)','COMMON','Invalid\x20function\x20name\x20\x22','No\x20api.ts\x20found.\x20Run\x20`','/ENDPOINT/','5112265XaRANa','tableName','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','scriptsRootDir','HOOK\x20requires\x20alias/operation/node\x20options.','Available:\x20','No\x20datasets\x20found\x20for\x20this\x20app.','Function\x20name\x20(valid\x20JS\x20identifier)','\x20api\x20pull`\x20to\x20refresh.','UNKNOWN','before','isInteger','entries','2IzALyu','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'];a31_0x518d=function(){return _0x48850d;};return a31_0x518d();}export function generateTemplate(_0x2230ef,_0x332acd,_0x59d887,_0x1fd44e,_0x678f99){const _0x5b1d28=a31_0x173f1f,_0x41b360=_0x1fd44e?.[_0x5b1d28(0xf1)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x1accf7=getAppBaseUrl(_0x59d887),_0x1302cf=_0x5b1d28(0xeb);if(_0x2230ef===_0x5b1d28(0xfd))return _0x5b1d28(0xd3)+_0x41b360+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x332acd+_0x5b1d28(0xb2)+_0x1accf7+_0x5b1d28(0x112)+_0x59d887+_0x5b1d28(0xce)+_0x332acd+_0x5b1d28(0x104)+_0x332acd+'\x22,\x20params\x20})\x0a'+_0x1302cf+_0x5b1d28(0xd1)+_0x332acd+_0x5b1d28(0x103);if(_0x2230ef===_0x5b1d28(0xf4))return'/**\x0a\x20*\x20'+_0x41b360+_0x5b1d28(0xea)+_0x332acd+_0x5b1d28(0xf0)+_0x59d887+'/'+_0x332acd+'\x0a\x20*\x20[平台配置]\x20'+_0x1accf7+_0x5b1d28(0x112)+_0x59d887+_0x5b1d28(0x100)+_0x332acd+_0x5b1d28(0xfa)+_0x1302cf+_0x5b1d28(0xdc)+_0x332acd+_0x5b1d28(0x103);if(!_0x678f99)throw CliErrors[_0x5b1d28(0xf3)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x4829d6=_0x678f99['alias']??_0x678f99[_0x5b1d28(0xfb)],_0x5c1d12=_0x678f99['functionNode']===_0x5b1d28(0x10c)?'当前请求参数':'当前响应结果',_0x35a7f8=_0x678f99[_0x5b1d28(0xd8)]===_0x5b1d28(0x10c)?'修改后的请求参数':'修改后的响应结果';return _0x5b1d28(0xd3)+_0x41b360+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x332acd+_0x5b1d28(0xb1)+_0x59d887+'/'+_0x678f99[_0x5b1d28(0xfb)]+'/'+_0x678f99['operationType']+_0x5b1d28(0xb2)+_0x1accf7+_0x5b1d28(0xd0)+_0x678f99[_0x5b1d28(0xe7)]+_0x5b1d28(0xb5)+_0x59d887+'/HOOK/'+_0x4829d6+'/'+_0x678f99[_0x5b1d28(0xbb)]+'/'+_0x678f99['functionNode']+'/'+_0x332acd+_0x5b1d28(0xf6)+_0x678f99[_0x5b1d28(0xd8)]+'\x0a'+_0x1302cf+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x5c1d12+_0x5b1d28(0xf7)+_0x35a7f8+_0x5b1d28(0xf8)+_0x332acd+_0x5b1d28(0x103);}
|
|
1
|
+
const a31_0x29d81d=a31_0x41ed;(function(_0x26a293,_0xbe2c85){const _0x434c99=a31_0x41ed,_0x5b240a=_0x26a293();while(!![]){try{const _0x141bcc=-parseInt(_0x434c99(0x1d5))/0x1+parseInt(_0x434c99(0x1c2))/0x2*(-parseInt(_0x434c99(0x1de))/0x3)+parseInt(_0x434c99(0x1d6))/0x4+parseInt(_0x434c99(0x1c9))/0x5*(parseInt(_0x434c99(0x1b3))/0x6)+parseInt(_0x434c99(0x1fd))/0x7*(parseInt(_0x434c99(0x1c1))/0x8)+-parseInt(_0x434c99(0x209))/0x9+parseInt(_0x434c99(0x1d0))/0xa;if(_0x141bcc===_0xbe2c85)break;else _0x5b240a['push'](_0x5b240a['shift']());}catch(_0x45a244){_0x5b240a['push'](_0x5b240a['shift']());}}}(a31_0x3548,0xd43e5));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a31_0x3548(){const _0x3164ed=['map','name','stdin','datasetcode','Dataset\x20not\x20found\x20for\x20code\x20\x22','keys','修改后的响应结果','/ENDPOINT/','Available\x20aliases:\x20','read','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','close','validation','functionNode','.js','3371606VlLLIO','/data/dataset/','HOOK\x20requires\x20alias/operation/node\x20options.','当前响应结果','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x22\x20not\x20found.\x20','Select\x20operation\x20type:','No\x20api.ts\x20found.\x20Run\x20`','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','appCode','346347CgFBJZ','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20to\x20refresh.','Alias\x20\x22','Invalid\x20function\x20name\x20\x22','alias','HOOK','\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','type','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Operation\x20type\x20\x22','write','/**\x0a\x20*\x20','join','code','/COMMON/','Operation\x20type\x20(HOOK\x20only)','question','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','tableName','2076822tYFHXS','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','stderr','utf8','after','description','apiDir','Trigger\x20node\x20(HOOK\x20only)','No\x20operation\x20types\x20found\x20for\x20dataset\x20','\x20function:\x20','ENDPOINT','datasetId','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','operationType','8rAKOSe','710908Lubdip','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Select\x20dataset:','.js\x0a\x20*\x20[触发节点]\x20','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','File\x20already\x20exists:\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','5IzOWvR','COMMON','create','scriptsRootDir','datasetCode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','operation-type','9874970UXtIzY','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','find','entries','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','666064QBRSBQ','456232BowTYI','\x22\x20not\x20found\x20for\x20dataset\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','修改后的请求参数','trim','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','length',']\x20(','3EUUpXP','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','includes','str','Invalid\x20dataset\x20selection.','string','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','before','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','当前请求参数','Created\x20','\x22,\x20params\x20})\x0a','.js\x0a','function-node','isInteger','\x0a\x20*\x20[平台配置]\x20'];a31_0x3548=function(){return _0x3164ed;};return a31_0x3548();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':a31_0x29d81d(0x1cb),'description':a31_0x29d81d(0x1c6),'risk':a31_0x29d81d(0x1f7),'flags':[{'name':a31_0x29d81d(0x212),'type':a31_0x29d81d(0x1e3),'required':!![],'enum':[a31_0x29d81d(0x1ca),'ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':'name','type':a31_0x29d81d(0x1e3),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a31_0x29d81d(0x1e3),'description':'Script\x20description'},{'name':a31_0x29d81d(0x20f),'type':a31_0x29d81d(0x1e3),'description':a31_0x29d81d(0x20a)},{'name':a31_0x29d81d(0x1f1),'type':a31_0x29d81d(0x1e3),'description':a31_0x29d81d(0x20b)},{'name':a31_0x29d81d(0x1cf),'type':'string','description':a31_0x29d81d(0x1af)},{'name':a31_0x29d81d(0x1eb),'type':a31_0x29d81d(0x1e3),'description':a31_0x29d81d(0x1ba),'enum':[a31_0x29d81d(0x1e5),a31_0x29d81d(0x1b7)]}],async 'validate'(_0x734527){const _0x2cf137=a31_0x29d81d,_0x1836dc=_0x734527[_0x2cf137(0x1e1)]('name');if(!isValidBffFunctionName(_0x1836dc))throw CliErrors[_0x2cf137(0x1fa)](_0x2cf137(0x20e)+_0x1836dc+_0x2cf137(0x201));},async 'execute'(_0x25ad61){const _0x335182=a31_0x29d81d,_0xd7fcf5=loadBffProjectConfig(_0x25ad61[_0x335182(0x208)]),_0x5a2558=_0x25ad61[_0x335182(0x1e1)]('type'),_0x171f4d=_0x25ad61[_0x335182(0x1e1)](_0x335182(0x1ef)),_0x4cf877=_0x25ad61[_0x335182(0x1e1)](_0x335182(0x1b8))||undefined,_0x33c011=_0x5a2558===_0x335182(0x210)?await resolveHookOptions(_0xd7fcf5,_0x25ad61):undefined,_0x4398b2=buildFilePath(_0xd7fcf5,_0x5a2558,_0x171f4d,_0x33c011);if(await fileExists(_0x4398b2))throw CliErrors[_0x335182(0x1fa)](_0x335182(0x1c7)+_0x4398b2);await mkdir(dirname(_0x4398b2),{'recursive':!![]});const _0x462cd8=generateTemplate(_0x5a2558,_0x171f4d,_0x25ad61['appCode'],_0x4cf877,_0x33c011);await writeFile(_0x4398b2,_0x462cd8,_0x335182(0x1b6));const _0x31486e={'type':_0x5a2558,'name':_0x171f4d,'path':_0x4398b2};if(_0x4cf877)_0x31486e['description']=_0x4cf877;if(_0x33c011){if(_0x33c011[_0x335182(0x20f)])_0x31486e['alias']=_0x33c011[_0x335182(0x20f)];_0x31486e['datasetCode']=_0x33c011['datasetCode'],_0x31486e[_0x335182(0x1c0)]=_0x33c011[_0x335182(0x1c0)],_0x31486e[_0x335182(0x1fb)]=_0x33c011[_0x335182(0x1fb)];}return{'ok':!![],'data':_0x31486e,'message':_0x335182(0x1e8)+_0x5a2558+_0x335182(0x1bc)+_0x171f4d};}};async function resolveHookOptions(_0x5d7bf6,_0x4eaffd){const _0x1bcb96=a31_0x29d81d,_0x4dfea1=loadAliasMap(_0x4eaffd[_0x1bcb96(0x1b9)],undefined,resolveApiFilePath(_0x4eaffd[_0x1bcb96(0x1b9)],_0x4eaffd[_0x1bcb96(0x208)])),_0x330376=_0x4dfea1[_0x1bcb96(0x1dc)]>0x0;let _0x1987f8,_0x254b31,_0x324d27;const _0x4f17a2=_0x4eaffd[_0x1bcb96(0x1e1)](_0x1bcb96(0x20f)),_0x4bc6b0=_0x4eaffd[_0x1bcb96(0x1e1)](_0x1bcb96(0x1f1));if(_0x4f17a2){const _0xb2d51d=resolveAlias(_0x4eaffd['apiDir'],_0x4f17a2,undefined,resolveApiFilePath(_0x4eaffd['apiDir'],_0x4eaffd[_0x1bcb96(0x208)]));if(!_0xb2d51d){const _0x2f0c9f=_0x330376?_0x1bcb96(0x1f6)+_0x4dfea1[_0x1bcb96(0x1ee)](_0x49e330=>_0x49e330[_0x1bcb96(0x20f)])[_0x1bcb96(0x1ac)](',\x20'):_0x1bcb96(0x206)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x20d)+_0x4f17a2+_0x1bcb96(0x204)+_0x2f0c9f);}_0x1987f8=_0x4f17a2,_0x254b31=_0xb2d51d;}else{if(_0x4bc6b0){_0x254b31=_0x4bc6b0;const _0x36d403=_0x4dfea1['find'](_0x2cfe9f=>_0x2cfe9f[_0x1bcb96(0x1cd)]===_0x4bc6b0);_0x1987f8=_0x36d403?.[_0x1bcb96(0x20f)];}else{if(_0x4eaffd['nonInteractive'])throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1f8));else{if(_0x330376){const _0x1d52c6=_0x4dfea1[_0x1bcb96(0x1ee)](_0x533458=>_0x533458[_0x1bcb96(0x20f)]+'\x20('+_0x533458[_0x1bcb96(0x1b2)]+')'),_0xea8aa0=await promptSelect(_0x1bcb96(0x1c4),_0x1d52c6),_0x3e8c58=_0x4dfea1[_0xea8aa0];if(!_0x3e8c58)throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1e2));_0x1987f8=_0x3e8c58[_0x1bcb96(0x20f)],_0x254b31=_0x3e8c58[_0x1bcb96(0x1cd)];}else{const _0x2d8861=await listDatasets(_0x4eaffd[_0x1bcb96(0x208)]);if(_0x2d8861[_0x1bcb96(0x1dc)]===0x0)throw CliErrors[_0x1bcb96(0x1fa)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x48a6d5=_0x2d8861[_0x1bcb96(0x1ee)](_0x3a4b61=>_0x3a4b61['name']+'\x20['+(_0x3a4b61['source']??'UNKNOWN')+_0x1bcb96(0x1dd)+_0x3a4b61[_0x1bcb96(0x1ad)]+')'),_0x61b556=await promptSelect(_0x1bcb96(0x1c4),_0x48a6d5),_0x157e34=_0x2d8861[_0x61b556];if(!_0x157e34)throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1e2));_0x254b31=_0x157e34[_0x1bcb96(0x1ad)],_0x1987f8=undefined;}}}}const _0x3551ba=await listDatasets(_0x4eaffd[_0x1bcb96(0x208)]),_0x177e2e=_0x3551ba[_0x1bcb96(0x1d2)](_0x12d616=>_0x12d616['code']===_0x254b31);if(!_0x177e2e)throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1f2)+_0x254b31+'\x22.\x20'+(_0x1987f8?_0x1bcb96(0x1db)+CLI_BIN_NAME+_0x1bcb96(0x20c):''));_0x324d27=_0x177e2e['id'];const _0x469a52=_0x1987f8??_0x254b31,_0x22568e=await listBffDatasetOperations(_0x4eaffd[_0x1bcb96(0x208)],_0x324d27),_0x5d7869=_0x22568e?Object[_0x1bcb96(0x1f3)](_0x22568e):[];if(_0x5d7869[_0x1bcb96(0x1dc)]===0x0)throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1bb)+_0x469a52+'.');let _0x16f72a;const _0x13a369=_0x4eaffd[_0x1bcb96(0x1e1)](_0x1bcb96(0x1cf));if(_0x13a369){if(!_0x5d7869[_0x1bcb96(0x1e0)](_0x13a369))throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1a9)+_0x13a369+_0x1bcb96(0x1d7)+_0x469a52+'.\x20'+('Available:\x20'+_0x5d7869[_0x1bcb96(0x1ac)](',\x20')));_0x16f72a=_0x13a369;}else{if(_0x4eaffd['nonInteractive'])throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x1b1));const _0x3c3bf1=await promptSelect(_0x1bcb96(0x205),_0x5d7869);_0x16f72a=_0x5d7869[_0x3c3bf1]??_0x5d7869[0x0];}let _0x4017c9=normalizeHookFunctionNode(_0x4eaffd[_0x1bcb96(0x1e1)](_0x1bcb96(0x1eb)));if(!_0x4017c9){if(_0x4eaffd[_0x1bcb96(0x1e1)](_0x1bcb96(0x1eb)))throw CliErrors[_0x1bcb96(0x1fa)](_0x1bcb96(0x203));if(_0x4eaffd['nonInteractive'])throw CliErrors['validation'](_0x1bcb96(0x1c3));const _0x4677d8=await promptSelect('Select\x20trigger\x20node:',[_0x1bcb96(0x1e5),_0x1bcb96(0x1b7)]);_0x4017c9=[_0x1bcb96(0x1e5),_0x1bcb96(0x1b7)][_0x4677d8]??_0x1bcb96(0x1e5);}return{'alias':_0x1987f8,'datasetCode':_0x254b31,'datasetId':_0x324d27,'operationType':_0x16f72a,'functionNode':_0x4017c9};}async function promptSelect(_0x1640a4,_0x17c725){const _0x12617a=a31_0x29d81d;if(_0x17c725[_0x12617a(0x1dc)]===0x1)return 0x0;for(const [_0x4a3e82,_0x1f6427]of _0x17c725[_0x12617a(0x1d3)]()){process[_0x12617a(0x1b5)][_0x12617a(0x1aa)]('\x20\x20'+(_0x4a3e82+0x1)+'.\x20'+_0x1f6427+'\x0a');}const _0xcb5f09=createInterface({'input':process[_0x12617a(0x1f0)],'output':process[_0x12617a(0x1b5)]});while(!![]){const _0x3155ad=await new Promise(_0x204a61=>{const _0x4c7007=_0x12617a;_0xcb5f09[_0x4c7007(0x1b0)](_0x1640a4+'\x20',_0x204a61);}),_0x229d70=Number['parseInt'](_0x3155ad['trim'](),0xa);if(Number[_0x12617a(0x1ec)](_0x229d70)&&_0x229d70>=0x1&&_0x229d70<=_0x17c725[_0x12617a(0x1dc)])return _0xcb5f09[_0x12617a(0x1f9)](),_0x229d70-0x1;process[_0x12617a(0x1b5)][_0x12617a(0x1aa)](_0x12617a(0x1bf)+_0x17c725[_0x12617a(0x1dc)]+'.\x0a');}}function buildFilePath(_0x17a07a,_0x4593c2,_0x699272,_0x290b32){const _0x26a3c2=a31_0x29d81d;if(_0x4593c2===_0x26a3c2(0x210)){if(!_0x290b32)throw CliErrors[_0x26a3c2(0x1fa)](_0x26a3c2(0x1ff));const _0x1655d1=_0x290b32[_0x26a3c2(0x20f)]??_0x290b32['datasetCode'];return join(_0x17a07a['scriptsRootDir'],'HOOK',_0x1655d1,_0x290b32[_0x26a3c2(0x1c0)],_0x290b32[_0x26a3c2(0x1fb)],_0x699272+'.js');}return join(_0x17a07a[_0x26a3c2(0x1cc)],_0x4593c2,_0x699272+_0x26a3c2(0x1fc));}function a31_0x41ed(_0x3c1a5c,_0x3c4d16){_0x3c1a5c=_0x3c1a5c-0x1a9;const _0x3548ed=a31_0x3548();let _0x41ed04=_0x3548ed[_0x3c1a5c];return _0x41ed04;}export function generateTemplate(_0x2955fa,_0x5e8dd0,_0x4f2311,_0x4b86bd,_0x176389){const _0x31f070=a31_0x29d81d,_0x28d019=_0x4b86bd?.[_0x31f070(0x1da)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x94be69=getAppBaseUrl(_0x4f2311),_0x2d50b4='\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(_0x2955fa===_0x31f070(0x1ca))return'/**\x0a\x20*\x20'+_0x28d019+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x5e8dd0+_0x31f070(0x1ed)+_0x94be69+_0x31f070(0x1e4)+_0x4f2311+_0x31f070(0x1ae)+_0x5e8dd0+_0x31f070(0x207)+_0x5e8dd0+_0x31f070(0x1e9)+_0x2d50b4+_0x31f070(0x211)+_0x5e8dd0+_0x31f070(0x1d4);if(_0x2955fa===_0x31f070(0x1bd))return'/**\x0a\x20*\x20'+_0x28d019+_0x31f070(0x1b4)+_0x5e8dd0+_0x31f070(0x202)+_0x4f2311+'/'+_0x5e8dd0+'\x0a\x20*\x20[平台配置]\x20'+_0x94be69+_0x31f070(0x1e4)+_0x4f2311+_0x31f070(0x1f5)+_0x5e8dd0+_0x31f070(0x1ea)+_0x2d50b4+'\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'+_0x5e8dd0+_0x31f070(0x1d4);if(!_0x176389)throw CliErrors[_0x31f070(0x1fa)](_0x31f070(0x213));const _0x557883=_0x176389[_0x31f070(0x20f)]??_0x176389[_0x31f070(0x1cd)],_0xff4762=_0x176389[_0x31f070(0x1fb)]===_0x31f070(0x1e5)?_0x31f070(0x1e7):_0x31f070(0x200),_0x499e34=_0x176389[_0x31f070(0x1fb)]===_0x31f070(0x1e5)?_0x31f070(0x1d9):_0x31f070(0x1f4);return _0x31f070(0x1ab)+_0x28d019+_0x31f070(0x1ce)+_0x5e8dd0+_0x31f070(0x1df)+_0x4f2311+'/'+_0x176389[_0x31f070(0x1cd)]+'/'+_0x176389[_0x31f070(0x1c0)]+'\x0a\x20*\x20[平台配置]\x20'+_0x94be69+_0x31f070(0x1fe)+_0x176389[_0x31f070(0x1be)]+_0x31f070(0x1d1)+_0x4f2311+'/HOOK/'+_0x557883+'/'+_0x176389[_0x31f070(0x1c0)]+'/'+_0x176389['functionNode']+'/'+_0x5e8dd0+_0x31f070(0x1c5)+_0x176389[_0x31f070(0x1fb)]+'\x0a'+_0x2d50b4+_0x31f070(0x1c8)+_0xff4762+_0x31f070(0x1d8)+_0x499e34+_0x31f070(0x1e6)+_0x5e8dd0+_0x31f070(0x1d4);}
|