@lovrabet/rabetbase-cli 2.5.1-beta.5 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +0 -16
- 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/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -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/types.d.ts +1 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +1 -1
- package/skills/rabetbase/references/rabetbase-database-template.md +36 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +8 -7
- package/skills/rabetbase/references/rabetbase-rule.md +15 -0
- package/skills/rabetbase.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a18_0x27c9(_0xef844d,_0x23d39d){_0xef844d=_0xef844d-0x6e;const _0x476e3b=a18_0x476e();let _0x27c979=_0x476e3b[_0xef844d];return _0x27c979;}(function(_0x4ced8b,_0x58bf38){const _0x27d76e=a18_0x27c9,_0x22121d=_0x4ced8b();while(!![]){try{const _0x3ca5ee=parseInt(_0x27d76e(0x7c))/0x1+-parseInt(_0x27d76e(0x77))/0x2+-parseInt(_0x27d76e(0x7f))/0x3*(parseInt(_0x27d76e(0x7a))/0x4)+parseInt(_0x27d76e(0x6e))/0x5+parseInt(_0x27d76e(0x75))/0x6+-parseInt(_0x27d76e(0x7b))/0x7*(-parseInt(_0x27d76e(0x71))/0x8)+-parseInt(_0x27d76e(0x72))/0x9*(parseInt(_0x27d76e(0x7e))/0xa);if(_0x3ca5ee===_0x58bf38)break;else _0x22121d['push'](_0x22121d['shift']());}catch(_0x4fb667){_0x22121d['push'](_0x22121d['shift']());}}}(a18_0x476e,0xba8af));function a18_0x476e(){const _0x3ca27b=['length','project','8630514CHLYgc','selectedAppName','394570VVTYdG','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','filter','12SMGqUA','48804TqjyYP','1320090fJNgvz','bool','312370eqHqvQ','108126FqXHyW','5299490qaypfs','App\x20\x22','map','896fvKYYk','1017SqbvIL'];a18_0x476e=function(){return _0x3ca27b;};return a18_0x476e();}import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x1c7980,_0x1567de){const _0x431d60=a18_0x27c9;if(_0x1567de)return null;const _0x57b702=_0x1c7980[_0x431d60(0x7d)]('global')?'merged':_0x431d60(0x74);let _0x3c18f7=getMultiAppConfigs(_0x57b702);if(!_0x3c18f7||_0x3c18f7[_0x431d60(0x73)]===0x0)return null;if(_0x1c7980[_0x431d60(0x76)]){const _0x40c3b1=_0x3c18f7[_0x431d60(0x79)](_0x428457=>_0x428457['name']===_0x1c7980['selectedAppName']);if(_0x40c3b1[_0x431d60(0x73)]===0x0){const _0x8f612c=_0x3c18f7[_0x431d60(0x70)](_0x38aa9c=>_0x38aa9c['name'])['join'](',\x20');throw CliErrors['validation'](_0x431d60(0x6f)+_0x1c7980['selectedAppName']+_0x431d60(0x78)+_0x8f612c);}_0x3c18f7=_0x40c3b1;}return _0x3c18f7;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aa502,_0x47fed6){const _0x55dcba=a19_0x511c,_0x5a8158=_0x5aa502();while(!![]){try{const _0xb849a0=parseInt(_0x55dcba(0x8b))/0x1*(parseInt(_0x55dcba(0x92))/0x2)+-parseInt(_0x55dcba(0x8e))/0x3+-parseInt(_0x55dcba(0x8d))/0x4+parseInt(_0x55dcba(0x8c))/0x5*(-parseInt(_0x55dcba(0x8f))/0x6)+parseInt(_0x55dcba(0x90))/0x7+-parseInt(_0x55dcba(0x91))/0x8+parseInt(_0x55dcba(0x93))/0x9;if(_0xb849a0===_0x47fed6)break;else _0x5a8158['push'](_0x5a8158['shift']());}catch(_0x2dcbb2){_0x5a8158['push'](_0x5a8158['shift']());}}}(a19_0x3068,0xc77a2));import{appListDefinition}from'../../commands/app/list.js';function a19_0x511c(_0x2a6ad7,_0x47613a){_0x2a6ad7=_0x2a6ad7-0x8b;const _0x3068e6=a19_0x3068();let _0x511c2a=_0x3068e6[_0x2a6ad7];return _0x511c2a;}import{appMembersListDefinition}from'../../commands/app/members-list.js';export const appDefinitions=[appListDefinition,appMembersListDefinition];function a19_0x3068(){const _0x4ec478=['8622984vfzvBh','1224814CYOKhE','22880970uUAisS','2ppjKpj','1147080OnaYFv','3139804faRKiU','4603104SsAbAG','24XljkRh','9553390gtxFdI'];a19_0x3068=function(){return _0x4ec478;};return a19_0x3068();}
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x4ed543=a20_0x4b5a;function a20_0x4b5a(_0x165196,_0x53fcc7){_0x165196=_0x165196-0x11e;const _0x50bcfb=a20_0x50bc();let _0x4b5ab0=_0x50bcfb[_0x165196];return _0x4b5ab0;}(function(_0x2fe548,_0x581614){const _0x505adc=a20_0x4b5a,_0x105e98=_0x2fe548();while(!![]){try{const _0x560d1f=parseInt(_0x505adc(0x13c))/0x1+-parseInt(_0x505adc(0x11f))/0x2*(parseInt(_0x505adc(0x13e))/0x3)+parseInt(_0x505adc(0x120))/0x4+-parseInt(_0x505adc(0x12d))/0x5*(-parseInt(_0x505adc(0x124))/0x6)+-parseInt(_0x505adc(0x130))/0x7*(parseInt(_0x505adc(0x135))/0x8)+-parseInt(_0x505adc(0x138))/0x9+-parseInt(_0x505adc(0x122))/0xa*(-parseInt(_0x505adc(0x145))/0xb);if(_0x560d1f===_0x581614)break;else _0x105e98['push'](_0x105e98['shift']());}catch(_0x583f07){_0x105e98['push'](_0x105e98['shift']());}}}(a20_0x50bc,0x8c895));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(_0x5e26d0,_0x2deef6){const _0x3b3690=a20_0x4b5a,_0x3f0bcf=[],_0x238717=_0x5e26d0[_0x3b3690(0x127)]&&typeof _0x5e26d0[_0x3b3690(0x127)]===_0x3b3690(0x11e)?_0x5e26d0[_0x3b3690(0x127)]:{},_0x225b9c=_0x5e26d0[_0x3b3690(0x13a)]||undefined,_0x44b906=_0x225b9c??(Object['keys'](_0x238717)[_0x3b3690(0x142)]===0x1?Object['keys'](_0x238717)[0x0]:undefined);for(const [_0x331dd0,_0x258bbe]of Object[_0x3b3690(0x140)](_0x238717)){if(!_0x258bbe||typeof _0x258bbe!==_0x3b3690(0x11e)||!_0x258bbe['appcode'])continue;_0x3f0bcf[_0x3b3690(0x12f)]({'name':_0x331dd0,'appcode':_0x258bbe['appcode'],'named':!![],'definedIn':_0x2deef6,'isDefault':_0x331dd0===_0x44b906,...buildAppProfileListFields(_0x258bbe)});}return _0x3f0bcf;}function buildMergedItems(_0x416321,_0xa19ab2){const _0x1c85b9=a20_0x4b5a,{apps:apps={}}=_0x416321,_0x164937=_0x416321[_0x1c85b9(0x13a)],_0x38a6ed=_0x164937??(Object['keys'](apps)[_0x1c85b9(0x142)]===0x1?Object['keys'](apps)[0x0]:undefined),_0x365ba2=_0xa19ab2['globalConfig']['apps']&&typeof _0xa19ab2['globalConfig'][_0x1c85b9(0x127)]===_0x1c85b9(0x11e)?_0xa19ab2['globalConfig']['apps']:{},_0x3976c9=_0xa19ab2[_0x1c85b9(0x133)]['apps']&&typeof _0xa19ab2['projectConfig'][_0x1c85b9(0x127)]===_0x1c85b9(0x11e)?_0xa19ab2[_0x1c85b9(0x133)][_0x1c85b9(0x127)]:{},_0x5d328c=Object['entries'](apps),_0x2f6752=_0x5d328c[_0x1c85b9(0x144)](([_0x499307,_0x344b90])=>({'name':_0x499307,'appcode':_0x344b90[_0x1c85b9(0x141)],'named':!![],'definedIn':appDefinedIn(_0x499307,_0x365ba2,_0x3976c9),'isDefault':_0x499307===_0x38a6ed,...buildAppProfileListFields(_0x344b90)}));return _0x2f6752;}function a20_0x50bc(){const _0x586916=['49359ecArIj','global','entries','appcode','length','globalConfig','map','33oYEmHY','object','86ewLrjg','1661292pDquYh','\x20in\x20','231340lPyCAo','find','3031530XzMlQq','list','remote','apps','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','globalPath','isCurrent','bool','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','5jkDmTW','mergedCli','push','826KfvXsF','read','project','projectConfig','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','7688faKwFI','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','boolean','757710LmgCUh','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','defaultApp','projectPath','490724YrVaEx','merged'];a20_0x50bc=function(){return _0x586916;};return a20_0x50bc();}function validateAppListFlags(_0x1e3bbd){const _0x312182=a20_0x4b5a;if(!_0x1e3bbd[_0x312182(0x12b)](_0x312182(0x126)))return;if(!_0x1e3bbd[_0x312182(0x12b)]('global')&&!_0x1e3bbd[_0x312182(0x12b)](_0x312182(0x132)))return;throw CliErrors['validation'](_0x312182(0x139),_0x312182(0x136));}async function execute(_0x157934){const _0x210ec1=a20_0x4b5a;validateAppListFlags(_0x157934);if(_0x157934[_0x210ec1(0x12b)](_0x210ec1(0x126)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x157934)};const _0x3de9bd=_0x157934[_0x210ec1(0x12b)](_0x210ec1(0x13f)),_0xc55669=_0x157934[_0x210ec1(0x12b)](_0x210ec1(0x132)),_0x35fe89=_0x3de9bd?_0x210ec1(0x13f):_0xc55669?_0x210ec1(0x132):'merged',{config:_0x145653,layers:_0xe28bb2}=readRawConfigWithLayers(),_0x5235d5=resolveDefaultAppSource(_0xe28bb2),{defaultApp:_0x371682}=_0x145653;let _0x37a6e2,_0x40e88f;switch(_0x35fe89){case _0x210ec1(0x13f):_0x37a6e2=buildItemsFromLayer(_0xe28bb2[_0x210ec1(0x143)],_0x210ec1(0x13f)),_0x40e88f=_0xe28bb2[_0x210ec1(0x129)];break;case _0x210ec1(0x132):_0x37a6e2=buildItemsFromLayer(_0xe28bb2[_0x210ec1(0x133)],_0x210ec1(0x132)),_0x40e88f=_0xe28bb2[_0x210ec1(0x13b)];break;default:_0x37a6e2=buildMergedItems(_0x145653,_0xe28bb2);break;}enrichAppListItemsWithMergedSelection(_0x37a6e2,_0x157934[_0x210ec1(0x12e)]);if(_0x37a6e2[_0x210ec1(0x142)]===0x0){const _0x12ced3=_0x35fe89===_0x210ec1(0x13d)?'':_0x210ec1(0x121)+_0x35fe89+'\x20config';return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x12ced3+'.\x20Use\x20`'+CLI_BIN_NAME+_0x210ec1(0x12c)};}const _0x852a1b=_0x37a6e2[_0x210ec1(0x123)](_0x505d02=>_0x505d02[_0x210ec1(0x12a)]===!![]),_0x437144=_0x371682??_0x852a1b?.['name']??null,_0x283a25=_0x35fe89===_0x210ec1(0x13d)?{'globalPath':_0xe28bb2[_0x210ec1(0x129)]??null,'projectPath':_0xe28bb2[_0x210ec1(0x13b)]??null,'defaultApp':_0x437144,'defaultAppSource':_0x371682!=null?_0x5235d5:null}:{'scope':_0x35fe89,'configPath':_0x40e88f??null};return{'ok':!![],'data':{'items':_0x37a6e2,'meta':_0x283a25}};}export const appListDefinition={'service':'app','command':a20_0x4ed543(0x125),'description':a20_0x4ed543(0x128),'risk':a20_0x4ed543(0x131),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a20_0x4ed543(0x126),'type':a20_0x4ed543(0x137),'description':a20_0x4ed543(0x134),'default':![]},{'name':'global','type':a20_0x4ed543(0x137),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a20_0x4ed543(0x132),'type':a20_0x4ed543(0x137),'description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],async 'validate'(_0x140e9a){validateAppListFlags(_0x140e9a);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x1b911b=a21_0x2af3;function a21_0x2af3(_0x2c9fa6,_0x10ed79){_0x2c9fa6=_0x2c9fa6-0x7b;const _0x2a35de=a21_0x2a35();let _0x2af31f=_0x2a35de[_0x2c9fa6];return _0x2af31f;}(function(_0x57f57b,_0x244248){const _0x1a8121=a21_0x2af3,_0x59d5c0=_0x57f57b();while(!![]){try{const _0x258b3a=parseInt(_0x1a8121(0x83))/0x1*(-parseInt(_0x1a8121(0x81))/0x2)+parseInt(_0x1a8121(0x85))/0x3*(-parseInt(_0x1a8121(0x7b))/0x4)+-parseInt(_0x1a8121(0x86))/0x5*(-parseInt(_0x1a8121(0x87))/0x6)+-parseInt(_0x1a8121(0x89))/0x7+parseInt(_0x1a8121(0x7c))/0x8+parseInt(_0x1a8121(0x8b))/0x9+-parseInt(_0x1a8121(0x8a))/0xa*(parseInt(_0x1a8121(0x84))/0xb);if(_0x258b3a===_0x244248)break;else _0x59d5c0['push'](_0x59d5c0['shift']());}catch(_0x589360){_0x59d5c0['push'](_0x59d5c0['shift']());}}}(a21_0x2a35,0x242da));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a21_0x2a35(){const _0x3d1127=['1281064FQupnM','app','length','appCode','Found\x20','23338nNtphe','read','2EQFuuN','657063REmJzB','17913ptsSLn','468615VrpgMc','6DqnquK','\x20application\x20member(s)','208488vUKvkU','20WTcsxy','709740KdTCXD','8uqKKmB'];a21_0x2a35=function(){return _0x3d1127;};return a21_0x2a35();}export const appMembersListDefinition={'service':a21_0x1b911b(0x7d),'command':'members-list','description':'List\x20application\x20members\x20with\x20their\x20role\x20memberships','risk':a21_0x1b911b(0x82),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x13e50a){const _0x4df810=a21_0x1b911b,_0x3c0599=projectAppMembers(await listRoleUsers(_0x13e50a[_0x4df810(0x7f)]));return{'ok':!![],'data':{'appCode':_0x13e50a['appCode'],'items':_0x3c0599,'totalCount':_0x3c0599[_0x4df810(0x7e)]},'message':_0x4df810(0x80)+_0x3c0599[_0x4df810(0x7e)]+_0x4df810(0x88)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xae3637,_0x5dfa3d){const _0xc32d5=a22_0x41c0,_0x2f09a7=_0xae3637();while(!![]){try{const _0x113c40=-parseInt(_0xc32d5(0x11d))/0x1*(parseInt(_0xc32d5(0x11c))/0x2)+-parseInt(_0xc32d5(0x115))/0x3+parseInt(_0xc32d5(0x111))/0x4+parseInt(_0xc32d5(0x11a))/0x5+parseInt(_0xc32d5(0x117))/0x6+parseInt(_0xc32d5(0x11e))/0x7+-parseInt(_0xc32d5(0x118))/0x8;if(_0x113c40===_0x5dfa3d)break;else _0x2f09a7['push'](_0x2f09a7['shift']());}catch(_0x457c3e){_0x2f09a7['push'](_0x2f09a7['shift']());}}}(a22_0x5782,0x4099f));function a22_0x41c0(_0x405329,_0x498ca0){_0x405329=_0x405329-0x111;const _0x578232=a22_0x5782();let _0x41c0bd=_0x578232[_0x405329];return _0x41c0bd;}import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a22_0x5782(){const _0x191594=['2102984uvnsKm','cookie','2454580WkGKzm','map','388952FquhDm','1ybbWfk','3525942JuTpxt','42272udqeqF','platform','authRequired','appName','1064970jzIIbF','appDesc','430536FlOvna'];a22_0x5782=function(){return _0x191594;};return a22_0x5782();}function resolveCookie(_0x483346){const _0x5bad4b=a22_0x41c0,_0x3ff909=_0x483346[_0x5bad4b(0x119)]||getCookie();if(!_0x3ff909)throw CliErrors[_0x5bad4b(0x113)]();return _0x3ff909;}export async function listRemoteAppDirectory(_0x4b9cf0){const _0x1b6e86=a22_0x41c0,_0x572733=await withActiveCookie(resolveCookie(_0x4b9cf0),()=>listRemoteApps());return{'items':_0x572733[_0x1b6e86(0x11b)](_0x26d88d=>({..._0x26d88d['id']!=null?{'id':_0x26d88d['id']}:{},'appCode':_0x26d88d['appCode'],'appName':_0x26d88d[_0x1b6e86(0x114)],..._0x26d88d[_0x1b6e86(0x116)]!=null?{'appDesc':_0x26d88d[_0x1b6e86(0x116)]}:{}})),'meta':{'source':_0x1b6e86(0x112)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5192d3,_0x3a09a8){const _0x258515=a23_0x5158,_0x29ccb5=_0x5192d3();while(!![]){try{const _0x5a8057=parseInt(_0x258515(0x15e))/0x1*(-parseInt(_0x258515(0x163))/0x2)+parseInt(_0x258515(0x174))/0x3*(-parseInt(_0x258515(0x16f))/0x4)+-parseInt(_0x258515(0x16a))/0x5*(-parseInt(_0x258515(0x17c))/0x6)+parseInt(_0x258515(0x171))/0x7+parseInt(_0x258515(0x169))/0x8+-parseInt(_0x258515(0x15f))/0x9+-parseInt(_0x258515(0x153))/0xa*(-parseInt(_0x258515(0x165))/0xb);if(_0x5a8057===_0x3a09a8)break;else _0x29ccb5['push'](_0x29ccb5['shift']());}catch(_0x47146b){_0x29ccb5['push'](_0x29ccb5['shift']());}}}(a23_0x3919,0x61ad8));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x45dfb4){const _0x5a40b0=_0x45dfb4?.['trim']();return _0x5a40b0?_0x5a40b0:null;}export function projectAppMembers(_0x9b2e8a){const _0x3fc392=a23_0x5158,_0x53548f=new Map(),_0x44edc7=[..._0x9b2e8a][_0x3fc392(0x17b)]((_0x4fafa2,_0x24441c)=>_0x4fafa2['id']-_0x24441c['id']),_0x45ddb3=(_0x21e123,_0x21b3e4,_0x255de8)=>{const _0x565e85=_0x3fc392;for(const _0x4bfc28 of _0x21b3e4){const _0x291238=Number(_0x4bfc28[_0x565e85(0x180)]);if(!Number[_0x565e85(0x159)](_0x291238)||_0x291238<=0x0)continue;let _0x1755b9=_0x53548f[_0x565e85(0x15a)](_0x291238);if(!_0x1755b9)_0x1755b9={'userId':_0x291238,'username':nullableText(_0x4bfc28[_0x565e85(0x178)]),'displayName':nullableText(_0x4bfc28[_0x565e85(0x17f)]),'status':_0x255de8,'roles':[],'roleKeys':new Set()},_0x53548f['set'](_0x291238,_0x1755b9);else{_0x1755b9[_0x565e85(0x178)]??=nullableText(_0x4bfc28['username']),_0x1755b9['displayName']??=nullableText(_0x4bfc28[_0x565e85(0x17f)]);if(_0x255de8===_0x565e85(0x173))_0x1755b9['status']=_0x565e85(0x173);}const _0x4f5c7a=_0x21e123['id']+':'+_0x255de8;if(_0x1755b9[_0x565e85(0x166)][_0x565e85(0x15d)](_0x4f5c7a))continue;_0x1755b9['roleKeys']['add'](_0x4f5c7a),_0x1755b9[_0x565e85(0x179)][_0x565e85(0x175)]({'roleId':_0x21e123['id'],'roleName':nullableText(_0x21e123[_0x565e85(0x170)]),'roleType':nullableText(_0x21e123['roleType']),'membershipStatus':_0x255de8});}};for(const _0x3a3ac9 of _0x44edc7){_0x45ddb3(_0x3a3ac9,_0x3a3ac9['userList']??[],_0x3fc392(0x173)),_0x45ddb3(_0x3a3ac9,_0x3a3ac9[_0x3fc392(0x157)]??[],_0x3fc392(0x17a));}return[..._0x53548f[_0x3fc392(0x160)]()][_0x3fc392(0x172)](_0x390e99=>({'userId':_0x390e99[_0x3fc392(0x180)],'username':_0x390e99[_0x3fc392(0x178)],'displayName':_0x390e99[_0x3fc392(0x155)],'status':_0x390e99[_0x3fc392(0x177)],'roles':_0x390e99[_0x3fc392(0x179)][_0x3fc392(0x17b)]((_0x591454,_0xda9c15)=>_0x591454[_0x3fc392(0x17e)]-_0xda9c15[_0x3fc392(0x17e)]||(_0x591454[_0x3fc392(0x15c)]===_0xda9c15[_0x3fc392(0x15c)]?0x0:_0x591454[_0x3fc392(0x15c)]===_0x3fc392(0x173)?-0x1:0x1))}))[_0x3fc392(0x17b)]((_0x5638c4,_0x424ea1)=>_0x5638c4[_0x3fc392(0x180)]-_0x424ea1[_0x3fc392(0x180)]);}export function enrichAppListItemsWithMergedSelection(_0x49c601,_0x2e4a73){const _0x24f14f=a23_0x5158;if(!_0x2e4a73)return;const _0x1106c4=_0x2e4a73['apps']&&typeof _0x2e4a73[_0x24f14f(0x164)]===_0x24f14f(0x16b)?_0x2e4a73[_0x24f14f(0x164)]:{},_0x4541fa=Object[_0x24f14f(0x158)](_0x1106c4)[_0x24f14f(0x162)]>0x0;for(const _0x16e38d of _0x49c601){_0x16e38d['isCurrent']=![];}const _0x21c60a=_0x2e4a73['appCode']!=null?String(_0x2e4a73[_0x24f14f(0x161)])[_0x24f14f(0x152)]():'';if(_0x4541fa){const _0x4140af=_0x2e4a73[_0x24f14f(0x16e)]??_0x2e4a73[_0x24f14f(0x167)];if(_0x4140af)for(const _0x5d7b88 of _0x49c601){_0x5d7b88[_0x24f14f(0x151)]===!![]&&_0x5d7b88[_0x24f14f(0x183)]===_0x4140af&&(_0x5d7b88[_0x24f14f(0x181)]=!![]);}for(const _0x44cd98 of _0x49c601){if(_0x44cd98[_0x24f14f(0x151)]!==![])continue;if(_0x2e4a73[_0x24f14f(0x167)])continue;_0x21c60a&&String(_0x44cd98['appcode']??'')[_0x24f14f(0x152)]()===_0x21c60a&&(_0x44cd98['isCurrent']=!![]);}return;}if(!_0x21c60a)return;for(const _0x56348e of _0x49c601){String(_0x56348e[_0x24f14f(0x16d)]??'')[_0x24f14f(0x152)]()===_0x21c60a&&(_0x56348e['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x2c84cf,_0x2e7697,_0x28259c){const _0x5e4d11=a23_0x5158;if(_0x2e7697)return _0x5e4d11(0x154);const _0x1e346d=_0x28259c[_0x5e4d11(0x176)][_0x5e4d11(0x164)]&&typeof _0x28259c['projectConfig'][_0x5e4d11(0x164)]===_0x5e4d11(0x16b)?_0x28259c[_0x5e4d11(0x176)]['apps']:{},_0x17cb76=_0x28259c[_0x5e4d11(0x15b)][_0x5e4d11(0x164)]&&typeof _0x28259c['globalConfig'][_0x5e4d11(0x164)]===_0x5e4d11(0x16b)?_0x28259c[_0x5e4d11(0x15b)][_0x5e4d11(0x164)]:{};if(Object[_0x5e4d11(0x16c)]['hasOwnProperty']['call'](_0x1e346d,_0x2c84cf))return _0x5e4d11(0x156);if(Object[_0x5e4d11(0x16c)][_0x5e4d11(0x168)][_0x5e4d11(0x17d)](_0x17cb76,_0x2c84cf))return _0x5e4d11(0x154);return _0x5e4d11(0x156);}export function appDefinedIn(_0xc5f816,_0x5ed57e,_0x509ba1){const _0x430310=a23_0x5158,_0x4d386b=Object[_0x430310(0x16c)][_0x430310(0x168)][_0x430310(0x17d)](_0x5ed57e,_0xc5f816),_0x5b4782=Object['prototype'][_0x430310(0x168)][_0x430310(0x17d)](_0x509ba1,_0xc5f816);if(_0x4d386b&&_0x5b4782)return _0x430310(0x182);if(_0x5b4782)return _0x430310(0x156);return'global';}export function resolveDefaultAppSource(_0x35cf6f){const _0x493f91=a23_0x5158,_0x5b4a4e=_0x35cf6f['projectConfig']['apps']&&typeof _0x35cf6f['projectConfig']['apps']==='object'?_0x35cf6f['projectConfig'][_0x493f91(0x164)]:{};if(_0x493f91(0x167)in _0x35cf6f[_0x493f91(0x176)])return _0x493f91(0x156);if(Object['keys'](_0x5b4a4e)[_0x493f91(0x162)]>0x0)return _0x493f91(0x156);if(Object['keys'](_0x35cf6f[_0x493f91(0x176)])[_0x493f91(0x162)]===0x0&&_0x35cf6f['globalConfig'][_0x493f91(0x167)])return _0x493f91(0x154);return null;}function a23_0x3919(){const _0xffc91d=['3525802yPJcZM','map','ACTIVE','3ZdiunM','push','projectConfig','status','username','roles','PENDING','sort','158514hDMpkY','call','roleId','nickname','userId','isCurrent','both','name','named','trim','10bjxBvR','global','displayName','project','applyUserList','keys','isFinite','get','globalConfig','membershipStatus','has','133LazCvC','6603552zXnqUk','values','appCode','length','3958abJeGX','apps','16570675uanNUf','roleKeys','defaultApp','hasOwnProperty','15648BgFjfd','5ytYZbt','object','prototype','appcode','currentApp','2565852aaNHLe','roleName'];a23_0x3919=function(){return _0xffc91d;};return a23_0x3919();}export function getConfigPath(_0x2d9355={}){const _0x3aced4=a23_0x5158,_0x4517a6=_0x2d9355['global']?_0x3aced4(0x154):_0x3aced4(0x156);return resolveWriteConfigPath(_0x4517a6);}function a23_0x5158(_0x1dee82,_0x25a989){_0x1dee82=_0x1dee82-0x151;const _0x3919a3=a23_0x3919();let _0x51588f=_0x3919a3[_0x1dee82];return _0x51588f;}export function readConfig(_0x319c4f={}){return readConfigFile(getConfigPath(_0x319c4f));}export function writeConfig(_0x46441b,_0x36e9f8={}){writeConfigFile(getConfigPath(_0x36e9f8),_0x46441b);}export function scopeLabel(_0xc2b2a7){const _0x3d6944=a23_0x5158;return _0xc2b2a7[_0x3d6944(0x154)]?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x3aba63=a24_0x1010;(function(_0x2714f3,_0x1018c9){const _0x460677=a24_0x1010,_0x5c5c0d=_0x2714f3();while(!![]){try{const _0x3ed64f=parseInt(_0x460677(0x156))/0x1+-parseInt(_0x460677(0x161))/0x2*(parseInt(_0x460677(0x168))/0x3)+-parseInt(_0x460677(0x159))/0x4+-parseInt(_0x460677(0x169))/0x5+-parseInt(_0x460677(0x15b))/0x6*(parseInt(_0x460677(0x15e))/0x7)+-parseInt(_0x460677(0x155))/0x8+parseInt(_0x460677(0x160))/0x9;if(_0x3ed64f===_0x1018c9)break;else _0x5c5c0d['push'](_0x5c5c0d['shift']());}catch(_0x3e6ede){_0x5c5c0d['push'](_0x5c5c0d['shift']());}}}(a24_0x7928,0xcd554));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a24_0x7928(){const _0x5ea689=['9171128BiAcDy','1116574xSdDhU','App\x20config\x20server\x20id\x20missing\x20for\x20key=','number','816036jsEPdW','validation','78kRGeHj','POST','get','604583JaQccK','Deleted\x20app\x20config\x20','25465113MhGVql','4BbmsBL','app-config','high-risk-write','apiError','App\x20config\x20key\x20not\x20found:\x20','appCode','appCode:\x20','355467WxNctI','1974060Tcmdhk','/smartapi/app-config/delete',',\x20appCode=','delete'];a24_0x7928=function(){return _0x5ea689;};return a24_0x7928();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a24_0x3aba63(0x152);export const appConfigDelete={'service':a24_0x3aba63(0x162),'command':'delete','description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':a24_0x3aba63(0x163),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3eaf54){readKeyArg(_0x3eaf54);},async 'dryRun'(_0x467cfa){const _0xb8d1f=a24_0x3aba63,_0x2244c1=readKeyArg(_0x467cfa),_0xf5b46a=await mustGetByKey(_0x467cfa[_0xb8d1f(0x166)],_0x2244c1);return asAppConfigDryRunResult(buildMutationData({'operation':_0xb8d1f(0x154),'appCode':_0x467cfa['appCode'],'key':_0x2244c1,'before':projectAppConfig(_0xf5b46a),'after':null,'dryRun':!![]}),{'method':_0xb8d1f(0x15c),'url':DELETE_PATH});},async 'execute'(_0x469888){const _0x109785=a24_0x3aba63,_0x21df59=readKeyArg(_0x469888),_0x53a730=await mustGetByKey(_0x469888[_0x109785(0x166)],_0x21df59);return await withAppConfigApiBoundary('delete',{'appCode':_0x469888[_0x109785(0x166)],'key':_0x21df59},()=>deleteAppConfig({'appCode':_0x469888['appCode'],'id':requireAppConfigId(_0x53a730,_0x21df59,_0x469888['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x109785(0x154),'appCode':_0x469888[_0x109785(0x166)],'key':_0x21df59,'before':projectAppConfig(_0x53a730),'after':null,'dryRun':![]}),'message':_0x109785(0x15f)+_0x21df59};}};async function mustGetByKey(_0x1df58c,_0x4fded2){const _0xc2ba4f=a24_0x3aba63,_0x11bf8f=await withAppConfigApiBoundary(_0xc2ba4f(0x15d),{'appCode':_0x1df58c,'key':_0x4fded2},()=>getAppConfigByKey(_0x1df58c,_0x4fded2));if(!_0x11bf8f)throw CliErrors[_0xc2ba4f(0x15a)](_0xc2ba4f(0x165)+_0x4fded2,_0xc2ba4f(0x167)+_0x1df58c);return _0x11bf8f;}function a24_0x1010(_0x5c5785,_0x31c635){_0x5c5785=_0x5c5785-0x152;const _0x79283c=a24_0x7928();let _0x1010ed=_0x79283c[_0x5c5785];return _0x1010ed;}function requireAppConfigId(_0x37529b,_0x62ce0d,_0x22e91a){const _0x3ed440=a24_0x3aba63;if(typeof _0x37529b['id']===_0x3ed440(0x158)&&Number['isFinite'](_0x37529b['id'])&&_0x37529b['id']>0x0)return _0x37529b['id'];throw CliErrors[_0x3ed440(0x164)](_0x3ed440(0x157)+_0x62ce0d+_0x3ed440(0x153)+_0x22e91a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x23cd61=a25_0x4ed6;function a25_0x3e93(){const _0x530fe7=['7004268OYFlJw','16526nORKGh','54066JwOCtd','1452069KDBQkU','1067ghQLBh','reveal','validation','\x20with\x20value\x20revealed','appCode:\x20','Loaded\x20app\x20config\x20','app-config','5ZXolkd','130PwErvA','bool','21SifVKT','100938oOgGvN','appCode','84EMCReN','199568QxereC','8cLbmSY','read','get','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used'];a25_0x3e93=function(){return _0x530fe7;};return a25_0x3e93();}(function(_0x552554,_0x14775f){const _0x238a88=a25_0x4ed6,_0xba40d1=_0x552554();while(!![]){try{const _0x4fb92f=parseInt(_0x238a88(0x1c8))/0x1+parseInt(_0x238a88(0x1de))/0x2*(-parseInt(_0x238a88(0x1d7))/0x3)+-parseInt(_0x238a88(0x1d8))/0x4*(parseInt(_0x238a88(0x1d1))/0x5)+-parseInt(_0x238a88(0x1d5))/0x6*(parseInt(_0x238a88(0x1d4))/0x7)+-parseInt(_0x238a88(0x1d9))/0x8*(parseInt(_0x238a88(0x1c9))/0x9)+-parseInt(_0x238a88(0x1d2))/0xa*(-parseInt(_0x238a88(0x1ca))/0xb)+parseInt(_0x238a88(0x1dd))/0xc;if(_0x4fb92f===_0x14775f)break;else _0xba40d1['push'](_0xba40d1['shift']());}catch(_0x1c68bd){_0xba40d1['push'](_0xba40d1['shift']());}}}(a25_0x3e93,0x23a1e));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a25_0x4ed6(_0x3953ad,_0x528c78){_0x3953ad=_0x3953ad-0x1c8;const _0x3e9350=a25_0x3e93();let _0x4ed67b=_0x3e9350[_0x3953ad];return _0x4ed67b;}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a25_0x23cd61(0x1d0),'command':a25_0x23cd61(0x1db),'description':a25_0x23cd61(0x1dc),'risk':a25_0x23cd61(0x1da),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x169e71){readKeyArg(_0x169e71);},async 'execute'(_0x2db130){const _0x53eada=a25_0x23cd61,_0x5902a1=readKeyArg(_0x2db130),_0x508803=await withAppConfigApiBoundary(_0x53eada(0x1db),{'appCode':_0x2db130[_0x53eada(0x1d6)],'key':_0x5902a1},()=>getAppConfigByKey(_0x2db130[_0x53eada(0x1d6)],_0x5902a1));if(!_0x508803)throw CliErrors[_0x53eada(0x1cc)]('App\x20config\x20key\x20not\x20found:\x20'+_0x5902a1,_0x53eada(0x1ce)+_0x2db130[_0x53eada(0x1d6)]);const _0x4f42ec=projectAppConfig(_0x508803,{'reveal':_0x2db130[_0x53eada(0x1d3)](_0x53eada(0x1cb))});return{'ok':!![],'data':{'config':_0x4f42ec},'message':_0x2db130[_0x53eada(0x1d3)](_0x53eada(0x1cb))?_0x53eada(0x1cf)+_0x5902a1+_0x53eada(0x1cd):_0x53eada(0x1cf)+_0x5902a1+'\x20with\x20value\x20redacted'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3448bf,_0x322b89){const _0x4c8826=a26_0x4804,_0x2db6b9=_0x3448bf();while(!![]){try{const _0x756d05=-parseInt(_0x4c8826(0x6f))/0x1*(-parseInt(_0x4c8826(0x6d))/0x2)+parseInt(_0x4c8826(0x73))/0x3+parseInt(_0x4c8826(0x71))/0x4*(parseInt(_0x4c8826(0x6e))/0x5)+parseInt(_0x4c8826(0x70))/0x6+parseInt(_0x4c8826(0x74))/0x7+-parseInt(_0x4c8826(0x76))/0x8*(-parseInt(_0x4c8826(0x75))/0x9)+-parseInt(_0x4c8826(0x72))/0xa;if(_0x756d05===_0x322b89)break;else _0x2db6b9['push'](_0x2db6b9['shift']());}catch(_0x3e73f4){_0x2db6b9['push'](_0x2db6b9['shift']());}}}(a26_0x2603,0xe8d55));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';import{appConfigSet}from'../../commands/app-config/set.js';function a26_0x4804(_0x351e3e,_0x31b01b){_0x351e3e=_0x351e3e-0x6d;const _0x2603d2=a26_0x2603();let _0x4804ee=_0x2603d2[_0x351e3e];return _0x4804ee;}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];function a26_0x2603(){const _0x5b326a=['8923690JBRWXq','3139gElZNK','10600818uDoQjt','4FiwycV','65402630DekoaF','2143488iUDmuc','8042727QBxnIG','9nldkZl','8821768wBbdFX','622oMdAdL'];a26_0x2603=function(){return _0x5b326a;};return a26_0x2603();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x201be2=a27_0x32f3;(function(_0x55998f,_0x3c46f0){const _0x3dadcf=a27_0x32f3,_0x4d373e=_0x55998f();while(!![]){try{const _0xc784d8=-parseInt(_0x3dadcf(0xe0))/0x1*(-parseInt(_0x3dadcf(0xda))/0x2)+-parseInt(_0x3dadcf(0xde))/0x3*(-parseInt(_0x3dadcf(0xd3))/0x4)+-parseInt(_0x3dadcf(0xd9))/0x5*(parseInt(_0x3dadcf(0xe6))/0x6)+-parseInt(_0x3dadcf(0xdc))/0x7+-parseInt(_0x3dadcf(0xd5))/0x8*(-parseInt(_0x3dadcf(0xe5))/0x9)+-parseInt(_0x3dadcf(0xdd))/0xa+parseInt(_0x3dadcf(0xd4))/0xb;if(_0xc784d8===_0x3c46f0)break;else _0x4d373e['push'](_0x4d373e['shift']());}catch(_0x2cc4ef){_0x4d373e['push'](_0x4d373e['shift']());}}}(a27_0x5887,0x8496f));function a27_0x32f3(_0x180e3f,_0x391657){_0x180e3f=_0x180e3f-0xd3;const _0x588759=a27_0x5887();let _0x32f39f=_0x588759[_0x180e3f];return _0x32f39f;}import{listAppConfigs}from'../../core/api-client.js';function a27_0x5887(){const _0x139ed3=['appCode','trim','map','31180OSzbmj','4PRXnRO','key','1264445qeSjQA','6717170lHDwRh','5937qgaEHJ','str','255804OMWOnS','app-config','Found\x20','string','read','9bAPZhw','456RjmYEy','Filter\x20by\x20exact\x20config\x20key','list','\x20app\x20config(s)','524sXZNMX','11932745pbbwZd','109784lTycnF'];a27_0x5887=function(){return _0x139ed3;};return a27_0x5887();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a27_0x201be2(0xe1),'command':'list','description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':a27_0x201be2(0xe4),'flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':a27_0x201be2(0xe3),'description':a27_0x201be2(0xe7)},TAGS_FLAG],async 'validate'(_0x58b804){const _0x263942=a27_0x201be2,_0x1bcb36=_0x58b804[_0x263942(0xdf)]('key')[_0x263942(0xd7)]();if(_0x1bcb36)validateKey(_0x1bcb36);readOptionalTags(_0x58b804);},async 'execute'(_0xf13ee){const _0x295467=a27_0x201be2,_0x4498eb=_0xf13ee['str'](_0x295467(0xdb))[_0x295467(0xd7)]()||undefined,_0x58caf1=readOptionalTags(_0xf13ee),_0x140c7c=await withAppConfigApiBoundary(_0x295467(0xe8),{'appCode':_0xf13ee[_0x295467(0xd6)]},()=>listAppConfigs(_0xf13ee[_0x295467(0xd6)],{'key':_0x4498eb,'tags':_0x58caf1})),_0x4754f3=_0x140c7c[_0x295467(0xd8)](_0x30a247=>projectAppConfig(_0x30a247));return{'ok':!![],'data':{'appCode':_0xf13ee['appCode'],'count':_0x4754f3['length'],'configs':_0x4754f3},'message':_0x295467(0xe2)+_0x4754f3['length']+_0x295467(0xe9)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x10ac1c=a28_0x5b56;function a28_0x503e(){const _0x56673a=['1078sTEQJI','isFinite','142394mkVNkH','tags','create','\x20app\x20config\x20','4555188QezKEj','/smartapi/app-config/create','get','22722jnqppX','write','appCode','1303916tQMojD','/smartapi/app-config/update','Updated','Created','number','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','12uXHklu',',\x20appCode=','file','set','4328048XzuIyT','apiError','string','2371685gYDzVt','19449KabfEL','update'];a28_0x503e=function(){return _0x56673a;};return a28_0x503e();}(function(_0x41ff53,_0x2ad548){const _0x2db937=a28_0x5b56,_0x9ab86a=_0x41ff53();while(!![]){try{const _0x496c4a=parseInt(_0x2db937(0x109))/0x1*(parseInt(_0x2db937(0x115))/0x2)+parseInt(_0x2db937(0x111))/0x3+-parseInt(_0x2db937(0x11f))/0x4+parseInt(_0x2db937(0x110))/0x5+-parseInt(_0x2db937(0x11c))/0x6*(parseInt(_0x2db937(0x113))/0x7)+parseInt(_0x2db937(0x10d))/0x8+-parseInt(_0x2db937(0x119))/0x9;if(_0x496c4a===_0x2ad548)break;else _0x9ab86a['push'](_0x9ab86a['shift']());}catch(_0x40b704){_0x9ab86a['push'](_0x9ab86a['shift']());}}}(a28_0x503e,0x70851));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a28_0x10ac1c(0x11a),UPDATE_PATH=a28_0x10ac1c(0x104);function a28_0x5b56(_0x398d4f,_0x34bc6e){_0x398d4f=_0x398d4f-0x104;const _0x503e6d=a28_0x503e();let _0x5b5641=_0x503e6d[_0x398d4f];return _0x5b5641;}export const appConfigSet={'service':'app-config','command':a28_0x10ac1c(0x10c),'description':a28_0x10ac1c(0x108),'risk':a28_0x10ac1c(0x11d),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a28_0x10ac1c(0x10b),'type':a28_0x10ac1c(0x10f),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x38dbef){readKeyArg(_0x38dbef),readOptionalTags(_0x38dbef),assertSingleValueSource(_0x38dbef);},async 'dryRun'(_0x3109c6){const _0x2d823e=a28_0x10ac1c,_0x143d92=readKeyArg(_0x3109c6),_0x4cb4ca=readOptionalTags(_0x3109c6),_0x5e7017=assertSingleValueSource(_0x3109c6);await assertValueSourceReadable(_0x5e7017);const _0x1f271d=await withAppConfigApiBoundary(_0x2d823e(0x11b),{'appCode':_0x3109c6[_0x2d823e(0x11e)],'key':_0x143d92},()=>getAppConfigByKey(_0x3109c6['appCode'],_0x143d92)),_0x114dd7=_0x1f271d?_0x2d823e(0x112):_0x2d823e(0x117),_0x5b5b3c=_0x1f271d?projectAppConfig(_0x1f271d):null,_0x1fe762=plannedAppConfig({'appCode':_0x3109c6[_0x2d823e(0x11e)],'key':_0x143d92,'tags':_0x4cb4ca??_0x1f271d?.[_0x2d823e(0x116)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x114dd7,'appCode':_0x3109c6[_0x2d823e(0x11e)],'key':_0x143d92,'before':_0x5b5b3c,'after':_0x1fe762,'dryRun':!![]}),{'method':'POST','url':_0x114dd7===_0x2d823e(0x112)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x35f8ca){const _0x3388d3=a28_0x10ac1c,_0x592d6=readKeyArg(_0x35f8ca),_0x2419eb=readOptionalTags(_0x35f8ca),_0x4a31f2=await withAppConfigApiBoundary('get',{'appCode':_0x35f8ca[_0x3388d3(0x11e)],'key':_0x592d6},()=>getAppConfigByKey(_0x35f8ca[_0x3388d3(0x11e)],_0x592d6)),_0x1f785c=_0x4a31f2?projectAppConfig(_0x4a31f2):null,_0x28d107=_0x4a31f2?_0x3388d3(0x112):_0x3388d3(0x117),{value:_0x2d7d84,warnings:_0x447fb4}=await readAppConfigValue(_0x35f8ca),_0x50db52={'appCode':_0x35f8ca[_0x3388d3(0x11e)],'key':_0x592d6,'value':_0x2d7d84,'tags':_0x2419eb??_0x4a31f2?.[_0x3388d3(0x116)]??undefined};await withAppConfigApiBoundary(_0x28d107,{'appCode':_0x35f8ca[_0x3388d3(0x11e)],'key':_0x592d6},async()=>{const _0x7848a9=_0x3388d3;_0x4a31f2?await updateAppConfig({..._0x50db52,'id':requireAppConfigId(_0x4a31f2,_0x592d6,_0x35f8ca[_0x7848a9(0x11e)])}):await createAppConfig(_0x50db52);});const _0x551c92=await withAppConfigApiBoundary(_0x3388d3(0x11b),{'appCode':_0x35f8ca[_0x3388d3(0x11e)],'key':_0x592d6},()=>getAppConfigByKey(_0x35f8ca[_0x3388d3(0x11e)],_0x592d6)),_0x132210=_0x551c92?projectAppConfig(_0x551c92):plannedAppConfig({'appCode':_0x35f8ca['appCode'],'key':_0x592d6,'tags':_0x50db52[_0x3388d3(0x116)],'hasValue':_0x2d7d84!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x28d107,'appCode':_0x35f8ca['appCode'],'key':_0x592d6,'before':_0x1f785c,'after':_0x132210,'dryRun':![],'warnings':_0x447fb4}),'message':(_0x28d107===_0x3388d3(0x112)?_0x3388d3(0x105):_0x3388d3(0x106))+_0x3388d3(0x118)+_0x592d6};}};function requireAppConfigId(_0x454a33,_0xeb1969,_0x354b74){const _0x15aeed=a28_0x10ac1c;if(typeof _0x454a33['id']===_0x15aeed(0x107)&&Number[_0x15aeed(0x114)](_0x454a33['id'])&&_0x454a33['id']>0x0)return _0x454a33['id'];throw CliErrors[_0x15aeed(0x10e)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0xeb1969+_0x15aeed(0x10a)+_0x354b74);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x1c5e45=a29_0x1763;(function(_0x5b1cc8,_0x2e8614){const _0x47c4a4=a29_0x1763,_0x3641a7=_0x5b1cc8();while(!![]){try{const _0x3bbc62=-parseInt(_0x47c4a4(0x180))/0x1*(-parseInt(_0x47c4a4(0x17f))/0x2)+-parseInt(_0x47c4a4(0x189))/0x3*(-parseInt(_0x47c4a4(0x14a))/0x4)+-parseInt(_0x47c4a4(0x179))/0x5*(parseInt(_0x47c4a4(0x147))/0x6)+-parseInt(_0x47c4a4(0x183))/0x7*(-parseInt(_0x47c4a4(0x184))/0x8)+parseInt(_0x47c4a4(0x174))/0x9*(-parseInt(_0x47c4a4(0x161))/0xa)+-parseInt(_0x47c4a4(0x145))/0xb+parseInt(_0x47c4a4(0x17b))/0xc;if(_0x3bbc62===_0x2e8614)break;else _0x3641a7['push'](_0x3641a7['shift']());}catch(_0x311514){_0x3641a7['push'](_0x3641a7['shift']());}}}(a29_0x3ba0,0x4f284));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a29_0x1c5e45(0x150),'description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a29_0x1c5e45(0x170),'description':a29_0x1c5e45(0x187),'required':![]};export const TAGS_FLAG={'name':a29_0x1c5e45(0x15b),'type':'string','description':a29_0x1c5e45(0x14e)};export const STDIN_FLAG={'name':'stdin','type':'boolean','description':a29_0x1c5e45(0x158),'default':![]};export const FROM_ENV_FLAG={'name':a29_0x1c5e45(0x172),'type':a29_0x1c5e45(0x148),'description':a29_0x1c5e45(0x162)};export const REVEAL_FLAG={'name':a29_0x1c5e45(0x18a),'type':a29_0x1c5e45(0x152),'description':a29_0x1c5e45(0x165),'default':![]};export function readKeyArg(_0x416132){const _0x11d487=a29_0x1c5e45,_0x448994=_0x416132[_0x11d487(0x14f)][0x0]?.['trim']()??'';return validateKey(_0x448994),_0x448994;}export function readOptionalTags(_0x1fb026){const _0x32647d=a29_0x1c5e45,_0x3e991e=_0x1fb026['str'](_0x32647d(0x15b))['trim']();if(!_0x3e991e)return undefined;if(_0x3e991e[_0x32647d(0x14b)]>0x20)throw CliErrors[_0x32647d(0x16a)](_0x32647d(0x186));return _0x3e991e;}function a29_0x1763(_0x11772d,_0x4fed00){_0x11772d=_0x11772d-0x145;const _0x3ba07f=a29_0x3ba0();let _0x17634b=_0x3ba07f[_0x11772d];return _0x17634b;}export function validateKey(_0x4e33b6){const _0x19e28f=a29_0x1c5e45;if(!_0x4e33b6)throw CliErrors['validation'](_0x19e28f(0x15f));if(_0x4e33b6[_0x19e28f(0x14b)]>0x100)throw CliErrors[_0x19e28f(0x16a)](_0x19e28f(0x17a));}export function projectAppConfig(_0x5f05a1,_0x2e6c9c){const _0x1d2135=a29_0x1c5e45,_0x25b5fe=_0x5f05a1[_0x1d2135(0x170)]!==undefined&&_0x5f05a1[_0x1d2135(0x170)]!==null&&_0x5f05a1[_0x1d2135(0x170)]!=='',_0x530862={'appCode':_0x5f05a1['appCode'],'key':_0x5f05a1[_0x1d2135(0x150)],'tags':_0x5f05a1[_0x1d2135(0x15b)]??undefined,'hasValue':_0x25b5fe,'valueRedacted':_0x25b5fe&&!_0x2e6c9c?.[_0x1d2135(0x18a)],'gmtCreate':_0x5f05a1[_0x1d2135(0x163)],'gmtModified':_0x5f05a1[_0x1d2135(0x146)]};return _0x2e6c9c?.[_0x1d2135(0x18a)]&&(_0x530862[_0x1d2135(0x170)]=_0x5f05a1[_0x1d2135(0x170)]??'',_0x530862[_0x1d2135(0x164)]=![]),_0x530862;}function a29_0x3ba0(){const _0x458ba0=['str','validation','stdin','appCode:\x20','value\x20is\x20redacted','path','slice','value','method','from-env','setEncoding','129699rnZEyz','url','flag','data','end','5KXSKWq','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','1594236MABpzT','name','Failed\x20to\x20','file','1376rGnYLY','756QyjbBN','Value\x20file\x20is\x20not\x20readable:\x20','kind','14rsGLbM','2002416AcOgKG','before','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','apiError','9ypnegD','reveal','7116560prkKWW','gmtModified','750882CLSUmC','string','env','711468qciJuL','length','trim','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Config\x20tags\x20for\x20filtering/display\x20metadata','args','key','once','boolean','operation','argument','App\x20config\x20value\x20source\x20is\x20ambiguous.','utf8','warnings','Read\x20config\x20value\x20from\x20stdin','push','Environment\x20variable\x20is\x20not\x20set:\x20','tags','key:\x20','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Missing\x20app-config\x20value\x20source.','Missing\x20app-config\x20key.','dryRun','410oHaYyq','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','gmtCreate','valueRedacted','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','appCode','after'];a29_0x3ba0=function(){return _0x458ba0;};return a29_0x3ba0();}export function plannedAppConfig(_0x55bf92){const _0x2d7f88=a29_0x1c5e45,_0x43a197=_0x55bf92['hasValue']??!![];return{'appCode':_0x55bf92[_0x2d7f88(0x167)],'key':_0x55bf92['key'],'tags':_0x55bf92[_0x2d7f88(0x15b)]??undefined,'hasValue':_0x43a197,'valueRedacted':_0x43a197};}export function buildMutationData(_0x557796){const _0x3c8c7d=a29_0x1c5e45;return{'operation':_0x557796[_0x3c8c7d(0x153)],'selector':{'appCode':_0x557796[_0x3c8c7d(0x167)],'key':_0x557796['key']},'before':_0x557796[_0x3c8c7d(0x185)],'after':_0x557796[_0x3c8c7d(0x168)],'dryRun':_0x557796[_0x3c8c7d(0x160)],'warnings':_0x557796[_0x3c8c7d(0x157)]??[]};}export async function withAppConfigApiBoundary(_0x5d1db6,_0x15bcb5,_0x245b9d){const _0x416def=a29_0x1c5e45;try{return await _0x245b9d();}catch{const _0x89f3e4=[_0x416def(0x16c)+_0x15bcb5[_0x416def(0x167)]];if(_0x15bcb5['key'])_0x89f3e4['push'](_0x416def(0x15c)+_0x15bcb5[_0x416def(0x150)]);_0x89f3e4[_0x416def(0x159)](_0x416def(0x16d));throw CliErrors[_0x416def(0x188)](_0x416def(0x17d)+_0x5d1db6+'\x20app\x20config.',_0x89f3e4['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x484c21,_0x48fc9e){const _0x3af81d=a29_0x1c5e45;return Object['defineProperties'](_0x484c21,{'method':{'value':_0x48fc9e[_0x3af81d(0x171)],'enumerable':![]},'url':{'value':_0x48fc9e[_0x3af81d(0x175)],'enumerable':![]}});}export function assertSingleValueSource(_0x2286a9){const _0x74f8c8=a29_0x1c5e45,_0x3d2dde=[];_0x2286a9[_0x74f8c8(0x14f)][_0x74f8c8(0x14b)]>0x1&&_0x3d2dde[_0x74f8c8(0x159)]({'kind':_0x74f8c8(0x154),'value':_0x2286a9[_0x74f8c8(0x14f)][_0x74f8c8(0x16f)](0x1)['join']('\x20')});const _0x46dab2=_0x2286a9[_0x74f8c8(0x176)](_0x74f8c8(0x170));_0x46dab2!==undefined&&_0x46dab2!==null&&_0x3d2dde['push']({'kind':_0x74f8c8(0x154),'value':String(_0x46dab2)});_0x2286a9['bool'](_0x74f8c8(0x16b))&&_0x3d2dde['push']({'kind':_0x74f8c8(0x16b)});const _0x2be1fe=_0x2286a9[_0x74f8c8(0x169)](_0x74f8c8(0x172))[_0x74f8c8(0x14c)]();_0x2be1fe&&_0x3d2dde['push']({'kind':_0x74f8c8(0x149),'name':_0x2be1fe});const _0xdbef8f=_0x2286a9['str']('file')['trim']();_0xdbef8f&&_0x3d2dde[_0x74f8c8(0x159)]({'kind':_0x74f8c8(0x17e),'path':_0xdbef8f});if(_0x3d2dde['length']===0x0)throw CliErrors[_0x74f8c8(0x16a)](_0x74f8c8(0x15e),_0x74f8c8(0x166));if(_0x3d2dde['length']>0x1)throw CliErrors[_0x74f8c8(0x16a)](_0x74f8c8(0x155),_0x74f8c8(0x15d));return _0x3d2dde[0x0];}export async function assertValueSourceReadable(_0x5d9584){const _0x53ad42=a29_0x1c5e45;if(_0x5d9584['kind']===_0x53ad42(0x149)&&!(_0x5d9584['name']in process.env))throw CliErrors[_0x53ad42(0x16a)](_0x53ad42(0x15a)+_0x5d9584[_0x53ad42(0x17c)]);if(_0x5d9584[_0x53ad42(0x182)]==='file')try{await access(_0x5d9584[_0x53ad42(0x16e)]);}catch{throw CliErrors[_0x53ad42(0x16a)](_0x53ad42(0x181)+_0x5d9584[_0x53ad42(0x16e)]);}}export async function readAppConfigValue(_0x21ee09){const _0x4eb03e=a29_0x1c5e45,_0x1efc3d=assertSingleValueSource(_0x21ee09),_0x419ac6=[];if(_0x1efc3d['kind']==='argument')return _0x419ac6['push'](_0x4eb03e(0x14d)),{'value':_0x1efc3d[_0x4eb03e(0x170)]??'','source':_0x1efc3d['kind'],'warnings':_0x419ac6};if(_0x1efc3d[_0x4eb03e(0x182)]===_0x4eb03e(0x16b))return{'value':await readStdin(),'source':_0x1efc3d[_0x4eb03e(0x182)],'warnings':_0x419ac6};if(_0x1efc3d[_0x4eb03e(0x182)]===_0x4eb03e(0x149)){if(!(_0x1efc3d[_0x4eb03e(0x17c)]in process.env))throw CliErrors[_0x4eb03e(0x16a)](_0x4eb03e(0x15a)+_0x1efc3d[_0x4eb03e(0x17c)]);return{'value':process.env[_0x1efc3d.name]??'','source':_0x1efc3d[_0x4eb03e(0x182)],'warnings':_0x419ac6};}return{'value':await readFile(_0x1efc3d['path'],'utf8'),'source':_0x1efc3d['kind'],'warnings':_0x419ac6};}function readStdin(){return new Promise((_0xfdb7ba,_0x52ba82)=>{const _0xf7dd4b=a29_0x1763;let _0x50b82f='';process[_0xf7dd4b(0x16b)][_0xf7dd4b(0x173)](_0xf7dd4b(0x156)),process[_0xf7dd4b(0x16b)]['on'](_0xf7dd4b(0x177),_0x68b283=>{_0x50b82f+=_0x68b283;}),process[_0xf7dd4b(0x16b)][_0xf7dd4b(0x151)](_0xf7dd4b(0x178),()=>_0xfdb7ba(_0x50b82f)),process[_0xf7dd4b(0x16b)][_0xf7dd4b(0x151)]('error',_0x52ba82);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a30_0x325cfe=a30_0x37c8;(function(_0x49f75b,_0x23e3e5){const _0x34a25a=a30_0x37c8,_0x59a05e=_0x49f75b();while(!![]){try{const _0x579910=parseInt(_0x34a25a(0xff))/0x1*(-parseInt(_0x34a25a(0x105))/0x2)+-parseInt(_0x34a25a(0xfb))/0x3*(parseInt(_0x34a25a(0x10f))/0x4)+parseInt(_0x34a25a(0xfd))/0x5+parseInt(_0x34a25a(0x111))/0x6*(-parseInt(_0x34a25a(0x109))/0x7)+parseInt(_0x34a25a(0xfa))/0x8+parseInt(_0x34a25a(0x106))/0x9*(-parseInt(_0x34a25a(0x10a))/0xa)+parseInt(_0x34a25a(0x10e))/0xb*(parseInt(_0x34a25a(0xfe))/0xc);if(_0x579910===_0x23e3e5)break;else _0x59a05e['push'](_0x59a05e['shift']());}catch(_0xbd1658){_0x59a05e['push'](_0x59a05e['shift']());}}}(a30_0xafca,0x85517));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a30_0xafca(){const _0x5d1194=['6956551MgxZeK','528430jYIEWZ','yes','log','auth','44561vtmQLI','91924AZfiPo','boolean','6QXOrkw','bool','5118336VKQRPd','45kzCgKS','write','650040LFvDGz','6396hveHCN','27KVNUrK','!\x20Not\x20logged\x20in','login','../../auth/auth-server-ui.js','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','logout','34306dlpqUv','99MqRIxJ','nonInteractive','✓\x20Logged\x20out'];a30_0xafca=function(){return _0x5d1194;};return a30_0xafca();}function a30_0x37c8(_0x255e6e,_0x4b523b){_0x255e6e=_0x255e6e-0xfa;const _0xafca9e=a30_0xafca();let _0x37c88c=_0xafca9e[_0x255e6e];return _0x37c88c;}export const authDefinitions=[{'service':a30_0x325cfe(0x10d),'command':a30_0x325cfe(0x101),'description':'Login\x20via\x20browser','risk':a30_0x325cfe(0xfc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a30_0x325cfe(0x110),'description':a30_0x325cfe(0x103),'default':![]}],async 'execute'(_0x54a774){const _0x34664d=a30_0x325cfe,{runAuthServer:_0x38c9b0}=await import(_0x34664d(0x102));return await _0x38c9b0({'autoYes':_0x54a774[_0x34664d(0x112)](_0x34664d(0x10b)),'nonInteractive':_0x54a774[_0x34664d(0x107)]}),{'ok':!![]};}},{'service':a30_0x325cfe(0x10d),'command':a30_0x325cfe(0x104),'description':'Clear\x20login\x20session','risk':a30_0x325cfe(0xfc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x189acd){const _0x28a7d1=a30_0x325cfe;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x28a7d1(0x10c)](_0x28a7d1(0x108))):console[_0x28a7d1(0x10c)](_0x28a7d1(0x100)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x21d038=a31_0x1fff;(function(_0x2cefb7,_0x2c3e41){const _0x1b375f=a31_0x1fff,_0x22ba77=_0x2cefb7();while(!![]){try{const _0x25f060=parseInt(_0x1b375f(0x125))/0x1*(-parseInt(_0x1b375f(0x134))/0x2)+-parseInt(_0x1b375f(0x151))/0x3*(-parseInt(_0x1b375f(0x143))/0x4)+-parseInt(_0x1b375f(0x144))/0x5*(parseInt(_0x1b375f(0x135))/0x6)+-parseInt(_0x1b375f(0x123))/0x7+parseInt(_0x1b375f(0x158))/0x8*(-parseInt(_0x1b375f(0x16a))/0x9)+parseInt(_0x1b375f(0x118))/0xa+-parseInt(_0x1b375f(0x142))/0xb*(-parseInt(_0x1b375f(0x12c))/0xc);if(_0x25f060===_0x2c3e41)break;else _0x22ba77['push'](_0x22ba77['shift']());}catch(_0x4d26cc){_0x22ba77['push'](_0x22ba77['shift']());}}}(a31_0x575a,0x1ad08));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a31_0x575a(){const _0x3b8475=['927XsvNug','/ENDPOINT/','当前请求参数','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','type','Available:\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Invalid\x20dataset\x20selection.','Select\x20operation\x20type:','Select\x20trigger\x20node:','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\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','trim','\x0a\x20*\x20[平台配置]\x20','after','No\x20datasets\x20found\x20for\x20this\x20app.','修改后的请求参数','Created\x20','HOOK\x20requires\x20alias/operation/node\x20options.','stdin','read','\x22.\x20','datasetId','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','code','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','string','.js','Alias\x20\x22','208130FpOMmr','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','No\x20api.ts\x20found.\x20Run\x20`','HOOK','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','appCode','/COMMON/','validation','File\x20already\x20exists:\x20','900676WYGejn','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','2oWjQrK','\x22\x20not\x20found.\x20','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','.js\x0a\x20*\x20[触发节点]\x20','datasetcode','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','entries','102636JdrxbJ','write','Available\x20aliases:\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','Script\x20type','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','apiDir','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','158564dhttCF','6PhIvcB','/HOOK/','nonInteractive','utf8','datasetCode','name','operation-type','keys','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','find','\x20api\x20pull`\x20to\x20refresh.','stderr','description','473roWDrf','372yzlCGY','399790IFshax','isInteger','join','functionNode','Function\x20name\x20(valid\x20JS\x20identifier)','ENDPOINT','function-node','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','bff','COMMON','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','scriptsRootDir','3753kyywRA','question','UNKNOWN','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','operationType','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','includes','2168cHzxEk','map','parseInt',']\x20(','before','str','/**\x0a\x20*\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','length','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20\x22','修改后的响应结果','/data/dataset/','当前响应结果','Operation\x20type\x20(HOOK\x20only)','alias','Select\x20dataset:','Script\x20description'];a31_0x575a=function(){return _0x3b8475;};return a31_0x575a();}import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';function a31_0x1fff(_0x3789bb,_0x559f52){_0x3789bb=_0x3789bb-0x10c;const _0x575abc=a31_0x575a();let _0x1ffff1=_0x575abc[_0x3789bb];return _0x1ffff1;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x21d038(0x14c),'command':'create','description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0x21d038(0x10f),'flags':[{'name':a31_0x21d038(0x16e),'type':a31_0x21d038(0x115),'required':!![],'enum':[a31_0x21d038(0x14d),a31_0x21d038(0x149),a31_0x21d038(0x11b)],'description':a31_0x21d038(0x130)},{'name':a31_0x21d038(0x13a),'type':a31_0x21d038(0x115),'required':!![],'description':a31_0x21d038(0x148)},{'name':'description','type':a31_0x21d038(0x115),'description':a31_0x21d038(0x169)},{'name':'alias','type':a31_0x21d038(0x115),'description':a31_0x21d038(0x131)},{'name':a31_0x21d038(0x129),'type':a31_0x21d038(0x115),'description':a31_0x21d038(0x16d)},{'name':a31_0x21d038(0x13b),'type':a31_0x21d038(0x115),'description':a31_0x21d038(0x166)},{'name':a31_0x21d038(0x14a),'type':a31_0x21d038(0x115),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a31_0x21d038(0x15c),a31_0x21d038(0x178)]}],async 'validate'(_0x27715d){const _0x3aa98d=a31_0x21d038,_0x573e48=_0x27715d['str'](_0x3aa98d(0x13a));if(!isValidBffFunctionName(_0x573e48))throw CliErrors[_0x3aa98d(0x121)]('Invalid\x20function\x20name\x20\x22'+_0x573e48+_0x3aa98d(0x12a));},async 'execute'(_0x339af9){const _0x1fd0ec=a31_0x21d038,_0xbf8f5a=loadBffProjectConfig(_0x339af9['appCode']),_0x291612=_0x339af9['str'](_0x1fd0ec(0x16e)),_0x384d3a=_0x339af9['str'](_0x1fd0ec(0x13a)),_0x26643b=_0x339af9[_0x1fd0ec(0x15d)](_0x1fd0ec(0x141))||undefined,_0xba5820=_0x291612===_0x1fd0ec(0x11b)?await resolveHookOptions(_0xbf8f5a,_0x339af9):undefined,_0x4f54be=buildFilePath(_0xbf8f5a,_0x291612,_0x384d3a,_0xba5820);if(await fileExists(_0x4f54be))throw CliErrors[_0x1fd0ec(0x121)](_0x1fd0ec(0x122)+_0x4f54be);await mkdir(dirname(_0x4f54be),{'recursive':!![]});const _0x2c242f=generateTemplate(_0x291612,_0x384d3a,_0x339af9[_0x1fd0ec(0x11f)],_0x26643b,_0xba5820);await writeFile(_0x4f54be,_0x2c242f,_0x1fd0ec(0x138));const _0x38089a={'type':_0x291612,'name':_0x384d3a,'path':_0x4f54be};if(_0x26643b)_0x38089a['description']=_0x26643b;if(_0xba5820){if(_0xba5820[_0x1fd0ec(0x167)])_0x38089a[_0x1fd0ec(0x167)]=_0xba5820[_0x1fd0ec(0x167)];_0x38089a[_0x1fd0ec(0x139)]=_0xba5820['datasetCode'],_0x38089a[_0x1fd0ec(0x155)]=_0xba5820['operationType'],_0x38089a[_0x1fd0ec(0x147)]=_0xba5820[_0x1fd0ec(0x147)];}return{'ok':!![],'data':_0x38089a,'message':_0x1fd0ec(0x10c)+_0x291612+'\x20function:\x20'+_0x384d3a};}};async function resolveHookOptions(_0x453e44,_0x32c0a1){const _0x3deb0d=a31_0x21d038,_0x493b02=loadAliasMap(_0x32c0a1['apiDir'],undefined,resolveApiFilePath(_0x32c0a1[_0x3deb0d(0x132)],_0x32c0a1[_0x3deb0d(0x11f)])),_0x377467=_0x493b02[_0x3deb0d(0x160)]>0x0;let _0x566a82,_0x1400b5,_0x3eb280;const _0x6512df=_0x32c0a1['str'](_0x3deb0d(0x167)),_0x4fa310=_0x32c0a1[_0x3deb0d(0x15d)](_0x3deb0d(0x129));if(_0x6512df){const _0x3c81a1=resolveAlias(_0x32c0a1[_0x3deb0d(0x132)],_0x6512df,undefined,resolveApiFilePath(_0x32c0a1['apiDir'],_0x32c0a1[_0x3deb0d(0x11f)]));if(!_0x3c81a1){const _0x1ac483=_0x377467?_0x3deb0d(0x12e)+_0x493b02[_0x3deb0d(0x159)](_0x55b3dd=>_0x55b3dd['alias'])[_0x3deb0d(0x146)](',\x20'):_0x3deb0d(0x11a)+CLI_BIN_NAME+_0x3deb0d(0x11e);throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x117)+_0x6512df+_0x3deb0d(0x126)+_0x1ac483);}_0x566a82=_0x6512df,_0x1400b5=_0x3c81a1;}else{if(_0x4fa310){_0x1400b5=_0x4fa310;const _0x289f32=_0x493b02[_0x3deb0d(0x13e)](_0x523c38=>_0x523c38['datasetCode']===_0x4fa310);_0x566a82=_0x289f32?.['alias'];}else{if(_0x32c0a1[_0x3deb0d(0x137)])throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x174));else{if(_0x377467){const _0x41fe19=_0x493b02[_0x3deb0d(0x159)](_0x8c2f52=>_0x8c2f52[_0x3deb0d(0x167)]+'\x20('+_0x8c2f52['tableName']+')'),_0x5abdbf=await promptSelect(_0x3deb0d(0x168),_0x41fe19),_0x4be192=_0x493b02[_0x5abdbf];if(!_0x4be192)throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x171));_0x566a82=_0x4be192[_0x3deb0d(0x167)],_0x1400b5=_0x4be192[_0x3deb0d(0x139)];}else{const _0x451af6=await listDatasets(_0x32c0a1[_0x3deb0d(0x11f)]);if(_0x451af6[_0x3deb0d(0x160)]===0x0)throw CliErrors['validation'](_0x3deb0d(0x179));const _0x116478=_0x451af6[_0x3deb0d(0x159)](_0x1e36c6=>_0x1e36c6[_0x3deb0d(0x13a)]+'\x20['+(_0x1e36c6['source']??_0x3deb0d(0x153))+_0x3deb0d(0x15b)+_0x1e36c6['code']+')'),_0x556d72=await promptSelect(_0x3deb0d(0x168),_0x116478),_0x299e5e=_0x451af6[_0x556d72];if(!_0x299e5e)throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x171));_0x1400b5=_0x299e5e[_0x3deb0d(0x113)],_0x566a82=undefined;}}}}const _0x741272=await listDatasets(_0x32c0a1[_0x3deb0d(0x11f)]),_0x381a0f=_0x741272[_0x3deb0d(0x13e)](_0x5ea4d1=>_0x5ea4d1[_0x3deb0d(0x113)]===_0x1400b5);if(!_0x381a0f)throw CliErrors['validation'](_0x3deb0d(0x12f)+_0x1400b5+_0x3deb0d(0x110)+(_0x566a82?_0x3deb0d(0x170)+CLI_BIN_NAME+_0x3deb0d(0x13f):''));_0x3eb280=_0x381a0f['id'];const _0x5c0477=_0x566a82??_0x1400b5,_0x402dbd=await listBffDatasetOperations(_0x32c0a1[_0x3deb0d(0x11f)],_0x3eb280),_0xa3ad88=_0x402dbd?Object[_0x3deb0d(0x13c)](_0x402dbd):[];if(_0xa3ad88['length']===0x0)throw CliErrors[_0x3deb0d(0x121)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x5c0477+'.');let _0x34bfd1;const _0x17ae03=_0x32c0a1['str'](_0x3deb0d(0x13b));if(_0x17ae03){if(!_0xa3ad88[_0x3deb0d(0x157)](_0x17ae03))throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x162)+_0x17ae03+_0x3deb0d(0x14f)+_0x5c0477+'.\x20'+(_0x3deb0d(0x16f)+_0xa3ad88[_0x3deb0d(0x146)](',\x20')));_0x34bfd1=_0x17ae03;}else{if(_0x32c0a1['nonInteractive'])throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x127));const _0xeddd21=await promptSelect(_0x3deb0d(0x172),_0xa3ad88);_0x34bfd1=_0xa3ad88[_0xeddd21]??_0xa3ad88[0x0];}let _0x4b19c3=normalizeHookFunctionNode(_0x32c0a1[_0x3deb0d(0x15d)](_0x3deb0d(0x14a)));if(!_0x4b19c3){if(_0x32c0a1[_0x3deb0d(0x15d)]('function-node'))throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x15f));if(_0x32c0a1[_0x3deb0d(0x137)])throw CliErrors[_0x3deb0d(0x121)](_0x3deb0d(0x14b));const _0x521438=await promptSelect(_0x3deb0d(0x173),[_0x3deb0d(0x15c),_0x3deb0d(0x178)]);_0x4b19c3=['before',_0x3deb0d(0x178)][_0x521438]??'before';}return{'alias':_0x566a82,'datasetCode':_0x1400b5,'datasetId':_0x3eb280,'operationType':_0x34bfd1,'functionNode':_0x4b19c3};}async function promptSelect(_0x4c5e7d,_0xc65de8){const _0x3b1f30=a31_0x21d038;if(_0xc65de8[_0x3b1f30(0x160)]===0x1)return 0x0;for(const [_0x1e01ea,_0x4c16c6]of _0xc65de8[_0x3b1f30(0x12b)]()){process[_0x3b1f30(0x140)][_0x3b1f30(0x12d)]('\x20\x20'+(_0x1e01ea+0x1)+'.\x20'+_0x4c16c6+'\x0a');}const _0x337541=createInterface({'input':process[_0x3b1f30(0x10e)],'output':process[_0x3b1f30(0x140)]});while(!![]){const _0x5a27b9=await new Promise(_0x361cc3=>{const _0x1c37f4=_0x3b1f30;_0x337541[_0x1c37f4(0x152)](_0x4c5e7d+'\x20',_0x361cc3);}),_0xd68817=Number[_0x3b1f30(0x15a)](_0x5a27b9[_0x3b1f30(0x176)](),0xa);if(Number[_0x3b1f30(0x145)](_0xd68817)&&_0xd68817>=0x1&&_0xd68817<=_0xc65de8[_0x3b1f30(0x160)])return _0x337541['close'](),_0xd68817-0x1;process['stderr'][_0x3b1f30(0x12d)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0xc65de8[_0x3b1f30(0x160)]+'.\x0a');}}function buildFilePath(_0x587641,_0x4ae4a9,_0x253bf1,_0x20bda3){const _0x3eaa96=a31_0x21d038;if(_0x4ae4a9===_0x3eaa96(0x11b)){if(!_0x20bda3)throw CliErrors[_0x3eaa96(0x121)](_0x3eaa96(0x10d));const _0x2f63ec=_0x20bda3['alias']??_0x20bda3[_0x3eaa96(0x139)];return join(_0x587641[_0x3eaa96(0x150)],_0x3eaa96(0x11b),_0x2f63ec,_0x20bda3[_0x3eaa96(0x155)],_0x20bda3[_0x3eaa96(0x147)],_0x253bf1+_0x3eaa96(0x116));}return join(_0x587641[_0x3eaa96(0x150)],_0x4ae4a9,_0x253bf1+_0x3eaa96(0x116));}export function generateTemplate(_0x828223,_0x3cd909,_0xab55e4,_0x4ab1be,_0x55afa3){const _0x4d2108=a31_0x21d038,_0x279a1d=_0x4ab1be?.[_0x4d2108(0x176)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x1b2f3b=getAppBaseUrl(_0xab55e4),_0x11f458=_0x4d2108(0x154);if(_0x828223===_0x4d2108(0x14d))return _0x4d2108(0x15e)+_0x279a1d+_0x4d2108(0x161)+_0x3cd909+_0x4d2108(0x177)+_0x1b2f3b+_0x4d2108(0x11c)+_0xab55e4+_0x4d2108(0x120)+_0x3cd909+_0x4d2108(0x14e)+_0x3cd909+'\x22,\x20params\x20})\x0a'+_0x11f458+'\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'+_0x3cd909+_0x4d2108(0x133);if(_0x828223==='ENDPOINT')return'/**\x0a\x20*\x20'+_0x279a1d+_0x4d2108(0x114)+_0x3cd909+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/'+_0xab55e4+'/'+_0x3cd909+_0x4d2108(0x177)+_0x1b2f3b+_0x4d2108(0x11c)+_0xab55e4+_0x4d2108(0x16b)+_0x3cd909+'.js\x0a'+_0x11f458+_0x4d2108(0x175)+_0x3cd909+_0x4d2108(0x133);if(!_0x55afa3)throw CliErrors[_0x4d2108(0x121)](_0x4d2108(0x156));const _0x35ce97=_0x55afa3[_0x4d2108(0x167)]??_0x55afa3[_0x4d2108(0x139)],_0x4c2069=_0x55afa3[_0x4d2108(0x147)]===_0x4d2108(0x15c)?_0x4d2108(0x16c):_0x4d2108(0x165),_0x204a18=_0x55afa3[_0x4d2108(0x147)]===_0x4d2108(0x15c)?_0x4d2108(0x17a):_0x4d2108(0x163);return'/**\x0a\x20*\x20'+_0x279a1d+_0x4d2108(0x119)+_0x3cd909+_0x4d2108(0x124)+_0xab55e4+'/'+_0x55afa3[_0x4d2108(0x139)]+'/'+_0x55afa3['operationType']+_0x4d2108(0x177)+_0x1b2f3b+_0x4d2108(0x164)+_0x55afa3[_0x4d2108(0x111)]+_0x4d2108(0x112)+_0xab55e4+_0x4d2108(0x136)+_0x35ce97+'/'+_0x55afa3[_0x4d2108(0x155)]+'/'+_0x55afa3[_0x4d2108(0x147)]+'/'+_0x3cd909+_0x4d2108(0x128)+_0x55afa3['functionNode']+'\x0a'+_0x11f458+_0x4d2108(0x13d)+_0x4c2069+_0x4d2108(0x11d)+_0x204a18+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x3cd909+_0x4d2108(0x133);}
|
|
1
|
+
const a31_0x551895=a31_0x57d4;(function(_0x559496,_0x887581){const _0xa4f9cc=a31_0x57d4,_0x271a1b=_0x559496();while(!![]){try{const _0x4f27ac=parseInt(_0xa4f9cc(0x187))/0x1+parseInt(_0xa4f9cc(0x181))/0x2*(parseInt(_0xa4f9cc(0x1c8))/0x3)+-parseInt(_0xa4f9cc(0x172))/0x4+parseInt(_0xa4f9cc(0x190))/0x5+-parseInt(_0xa4f9cc(0x16b))/0x6*(-parseInt(_0xa4f9cc(0x1a1))/0x7)+-parseInt(_0xa4f9cc(0x184))/0x8+parseInt(_0xa4f9cc(0x1b3))/0x9*(parseInt(_0xa4f9cc(0x168))/0xa);if(_0x4f27ac===_0x887581)break;else _0x271a1b['push'](_0x271a1b['shift']());}catch(_0x347872){_0x271a1b['push'](_0x271a1b['shift']());}}}(a31_0x1708,0xb7e5c));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a31_0x57d4(_0x410542,_0x3e35a6){_0x410542=_0x410542-0x161;const _0x1708ed=a31_0x1708();let _0x57d4dc=_0x1708ed[_0x410542];return _0x57d4dc;}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_0x551895(0x19e),'command':a31_0x551895(0x193),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a31_0x551895(0x19a),'flags':[{'name':'type','type':a31_0x551895(0x175),'required':!![],'enum':[a31_0x551895(0x1be),a31_0x551895(0x171),a31_0x551895(0x192)],'description':a31_0x551895(0x1b0)},{'name':'name','type':a31_0x551895(0x175),'required':!![],'description':a31_0x551895(0x1c5)},{'name':a31_0x551895(0x17d),'type':a31_0x551895(0x175),'description':'Script\x20description'},{'name':a31_0x551895(0x177),'type':a31_0x551895(0x175),'description':a31_0x551895(0x1b7)},{'name':a31_0x551895(0x16f),'type':a31_0x551895(0x175),'description':a31_0x551895(0x198)},{'name':'operation-type','type':a31_0x551895(0x175),'description':a31_0x551895(0x1ac)},{'name':'function-node','type':a31_0x551895(0x175),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a31_0x551895(0x1bb),a31_0x551895(0x1c1)]}],async 'validate'(_0x17f89a){const _0xa6927d=a31_0x551895,_0x11251d=_0x17f89a[_0xa6927d(0x1cd)](_0xa6927d(0x16d));if(!isValidBffFunctionName(_0x11251d))throw CliErrors['validation'](_0xa6927d(0x197)+_0x11251d+_0xa6927d(0x1c3));},async 'execute'(_0x3e68c0){const _0x55a107=a31_0x551895,_0x188d83=loadBffProjectConfig(_0x3e68c0[_0x55a107(0x1af)]),_0x5a9368=_0x3e68c0[_0x55a107(0x1cd)](_0x55a107(0x1c2)),_0xff10a1=_0x3e68c0[_0x55a107(0x1cd)](_0x55a107(0x16d)),_0x4b5bee=_0x3e68c0['str'](_0x55a107(0x17d))||undefined,_0x32bcc4=_0x5a9368==='HOOK'?await resolveHookOptions(_0x188d83,_0x3e68c0):undefined,_0x4713b2=buildFilePath(_0x188d83,_0x5a9368,_0xff10a1,_0x32bcc4);if(await fileExists(_0x4713b2))throw CliErrors[_0x55a107(0x16c)](_0x55a107(0x1b2)+_0x4713b2);await mkdir(dirname(_0x4713b2),{'recursive':!![]});const _0xdcba58=generateTemplate(_0x5a9368,_0xff10a1,_0x3e68c0[_0x55a107(0x1af)],_0x4b5bee,_0x32bcc4);await writeFile(_0x4713b2,_0xdcba58,'utf8');const _0x4d4389={'type':_0x5a9368,'name':_0xff10a1,'path':_0x4713b2};if(_0x4b5bee)_0x4d4389[_0x55a107(0x17d)]=_0x4b5bee;if(_0x32bcc4){if(_0x32bcc4['alias'])_0x4d4389[_0x55a107(0x177)]=_0x32bcc4[_0x55a107(0x177)];_0x4d4389[_0x55a107(0x1a5)]=_0x32bcc4[_0x55a107(0x1a5)],_0x4d4389[_0x55a107(0x18b)]=_0x32bcc4[_0x55a107(0x18b)],_0x4d4389[_0x55a107(0x178)]=_0x32bcc4[_0x55a107(0x178)];}return{'ok':!![],'data':_0x4d4389,'message':_0x55a107(0x1bf)+_0x5a9368+_0x55a107(0x17a)+_0xff10a1};}};async function resolveHookOptions(_0x453f02,_0x486824){const _0x9b1c0e=a31_0x551895,_0xfb910e=loadAliasMap(_0x486824[_0x9b1c0e(0x186)],undefined,resolveApiFilePath(_0x486824[_0x9b1c0e(0x186)],_0x486824['appCode'])),_0xd82778=_0xfb910e[_0x9b1c0e(0x196)]>0x0;let _0x30e697,_0x5ee55d,_0x5a8ac3;const _0x3a8489=_0x486824['str'](_0x9b1c0e(0x177)),_0x13315b=_0x486824[_0x9b1c0e(0x1cd)](_0x9b1c0e(0x16f));if(_0x3a8489){const _0x2a0710=resolveAlias(_0x486824[_0x9b1c0e(0x186)],_0x3a8489,undefined,resolveApiFilePath(_0x486824[_0x9b1c0e(0x186)],_0x486824[_0x9b1c0e(0x1af)]));if(!_0x2a0710){const _0x407014=_0xd82778?_0x9b1c0e(0x164)+_0xfb910e['map'](_0x223e8e=>_0x223e8e[_0x9b1c0e(0x177)])[_0x9b1c0e(0x167)](',\x20'):_0x9b1c0e(0x1ae)+CLI_BIN_NAME+_0x9b1c0e(0x1b6);throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x18f)+_0x3a8489+_0x9b1c0e(0x1c7)+_0x407014);}_0x30e697=_0x3a8489,_0x5ee55d=_0x2a0710;}else{if(_0x13315b){_0x5ee55d=_0x13315b;const _0x173064=_0xfb910e[_0x9b1c0e(0x18a)](_0x1879ef=>_0x1879ef[_0x9b1c0e(0x1a5)]===_0x13315b);_0x30e697=_0x173064?.[_0x9b1c0e(0x177)];}else{if(_0x486824[_0x9b1c0e(0x165)])throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x1c0));else{if(_0xd82778){const _0x245343=_0xfb910e[_0x9b1c0e(0x169)](_0x1933f=>_0x1933f[_0x9b1c0e(0x177)]+'\x20('+_0x1933f[_0x9b1c0e(0x17f)]+')'),_0x2b4cac=await promptSelect(_0x9b1c0e(0x17b),_0x245343),_0x440a0e=_0xfb910e[_0x2b4cac];if(!_0x440a0e)throw CliErrors['validation'](_0x9b1c0e(0x1a2));_0x30e697=_0x440a0e[_0x9b1c0e(0x177)],_0x5ee55d=_0x440a0e[_0x9b1c0e(0x1a5)];}else{const _0x2c51af=await listDatasets(_0x486824[_0x9b1c0e(0x1af)]);if(_0x2c51af[_0x9b1c0e(0x196)]===0x0)throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x1cb));const _0xd9f78e=_0x2c51af['map'](_0x3c2c3a=>_0x3c2c3a['name']+'\x20['+(_0x3c2c3a[_0x9b1c0e(0x1c9)]??_0x9b1c0e(0x1a6))+_0x9b1c0e(0x1a8)+_0x3c2c3a[_0x9b1c0e(0x174)]+')'),_0x3be937=await promptSelect(_0x9b1c0e(0x17b),_0xd9f78e),_0x4b0c52=_0x2c51af[_0x3be937];if(!_0x4b0c52)throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x1a2));_0x5ee55d=_0x4b0c52[_0x9b1c0e(0x174)],_0x30e697=undefined;}}}}const _0x878a23=await listDatasets(_0x486824[_0x9b1c0e(0x1af)]),_0x1a9aee=_0x878a23[_0x9b1c0e(0x18a)](_0x5828f5=>_0x5828f5['code']===_0x5ee55d);if(!_0x1a9aee)throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x18d)+_0x5ee55d+_0x9b1c0e(0x194)+(_0x30e697?_0x9b1c0e(0x1cf)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x5a8ac3=_0x1a9aee['id'];const _0x40bb1e=_0x30e697??_0x5ee55d,_0x2e3825=await listBffDatasetOperations(_0x486824['appCode'],_0x5a8ac3),_0x566353=_0x2e3825?Object[_0x9b1c0e(0x182)](_0x2e3825):[];if(_0x566353[_0x9b1c0e(0x196)]===0x0)throw CliErrors[_0x9b1c0e(0x16c)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x40bb1e+'.');let _0xf6ea2;const _0x198afd=_0x486824[_0x9b1c0e(0x1cd)](_0x9b1c0e(0x1c6));if(_0x198afd){if(!_0x566353[_0x9b1c0e(0x195)](_0x198afd))throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x18c)+_0x198afd+_0x9b1c0e(0x1b9)+_0x40bb1e+'.\x20'+('Available:\x20'+_0x566353[_0x9b1c0e(0x167)](',\x20')));_0xf6ea2=_0x198afd;}else{if(_0x486824[_0x9b1c0e(0x165)])throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x1ca));const _0x696b8e=await promptSelect(_0x9b1c0e(0x1c4),_0x566353);_0xf6ea2=_0x566353[_0x696b8e]??_0x566353[0x0];}let _0x681173=normalizeHookFunctionNode(_0x486824[_0x9b1c0e(0x1cd)](_0x9b1c0e(0x17c)));if(!_0x681173){if(_0x486824[_0x9b1c0e(0x1cd)](_0x9b1c0e(0x17c)))throw CliErrors[_0x9b1c0e(0x16c)](_0x9b1c0e(0x1a0));if(_0x486824[_0x9b1c0e(0x165)])throw CliErrors['validation'](_0x9b1c0e(0x1ad));const _0x2decd7=await promptSelect(_0x9b1c0e(0x1aa),[_0x9b1c0e(0x1bb),_0x9b1c0e(0x1c1)]);_0x681173=[_0x9b1c0e(0x1bb),_0x9b1c0e(0x1c1)][_0x2decd7]??_0x9b1c0e(0x1bb);}return{'alias':_0x30e697,'datasetCode':_0x5ee55d,'datasetId':_0x5a8ac3,'operationType':_0xf6ea2,'functionNode':_0x681173};}function a31_0x1708(){const _0x47ec71=['ENDPOINT','5048596pafrTh','datasetId','code','string','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','alias','functionNode','stderr','\x20function:\x20','Select\x20dataset:','function-node','description','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','tableName','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','92840bNYKFI','keys','question','11044752PdexGZ','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','apiDir','1156423LJaiix','当前请求参数','.js\x0a','find','operationType','Operation\x20type\x20\x22','Dataset\x20not\x20found\x20for\x20code\x20\x22','.js','Alias\x20\x22','1306490tmrSJD','\x0a\x20*\x20[平台配置]\x20','HOOK','create','\x22.\x20','includes','length','Invalid\x20function\x20name\x20\x22','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','read','/HOOK/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','修改后的请求参数','bff','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','666827ntSSih','Invalid\x20dataset\x20selection.','scriptsRootDir','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','datasetCode','UNKNOWN','HOOK\x20requires\x20alias/operation/node\x20options.',']\x20(','stdin','Select\x20trigger\x20node:','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','Operation\x20type\x20(HOOK\x20only)','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20api.ts\x20found.\x20Run\x20`','appCode','Script\x20type','/data/dataset/','File\x20already\x20exists:\x20','2512665BKbtvN','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','trim','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','/COMMON/','\x22\x20not\x20found\x20for\x20dataset\x20','\x22,\x20params\x20})\x0a','before','close','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','COMMON','Created\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','after','type','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Select\x20operation\x20type:','Function\x20name\x20(valid\x20JS\x20identifier)','operation-type','\x22\x20not\x20found.\x20','6QyghHp','source','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','str','/**\x0a\x20*\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','parseInt','/ENDPOINT/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','write','Available\x20aliases:\x20','nonInteractive','修改后的响应结果','join','30PPPRSb','map','entries','66pYOiRJ','validation','name','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','datasetcode','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'];a31_0x1708=function(){return _0x47ec71;};return a31_0x1708();}async function promptSelect(_0x258311,_0x5ee207){const _0x58e430=a31_0x551895;if(_0x5ee207[_0x58e430(0x196)]===0x1)return 0x0;for(const [_0x4f9fcc,_0x53ba5c]of _0x5ee207[_0x58e430(0x16a)]()){process[_0x58e430(0x179)][_0x58e430(0x163)]('\x20\x20'+(_0x4f9fcc+0x1)+'.\x20'+_0x53ba5c+'\x0a');}const _0x5a1031=createInterface({'input':process[_0x58e430(0x1a9)],'output':process[_0x58e430(0x179)]});while(!![]){const _0x231d29=await new Promise(_0x2d2488=>{const _0x3031c5=_0x58e430;_0x5a1031[_0x3031c5(0x183)](_0x258311+'\x20',_0x2d2488);}),_0x19766c=Number[_0x58e430(0x1d0)](_0x231d29[_0x58e430(0x1b5)](),0xa);if(Number['isInteger'](_0x19766c)&&_0x19766c>=0x1&&_0x19766c<=_0x5ee207[_0x58e430(0x196)])return _0x5a1031[_0x58e430(0x1bc)](),_0x19766c-0x1;process[_0x58e430(0x179)][_0x58e430(0x163)](_0x58e430(0x17e)+_0x5ee207[_0x58e430(0x196)]+'.\x0a');}}function buildFilePath(_0x49ef55,_0x3aad98,_0x129469,_0x1736ea){const _0x5759c7=a31_0x551895;if(_0x3aad98===_0x5759c7(0x192)){if(!_0x1736ea)throw CliErrors[_0x5759c7(0x16c)](_0x5759c7(0x1a7));const _0x1856ce=_0x1736ea['alias']??_0x1736ea[_0x5759c7(0x1a5)];return join(_0x49ef55[_0x5759c7(0x1a3)],_0x5759c7(0x192),_0x1856ce,_0x1736ea[_0x5759c7(0x18b)],_0x1736ea[_0x5759c7(0x178)],_0x129469+_0x5759c7(0x18e));}return join(_0x49ef55[_0x5759c7(0x1a3)],_0x3aad98,_0x129469+_0x5759c7(0x18e));}export function generateTemplate(_0x11fcc6,_0xc4815c,_0x358d4a,_0x183fb3,_0x4bccc6){const _0x2c4fc1=a31_0x551895,_0x2ac23b=_0x183fb3?.[_0x2c4fc1(0x1b5)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x3c13f4=getAppBaseUrl(_0x358d4a),_0x486d28=_0x2c4fc1(0x1ab);if(_0x11fcc6===_0x2c4fc1(0x1be))return _0x2c4fc1(0x1ce)+_0x2ac23b+_0x2c4fc1(0x19c)+_0xc4815c+'\x0a\x20*\x20[平台配置]\x20'+_0x3c13f4+_0x2c4fc1(0x1bd)+_0x358d4a+_0x2c4fc1(0x1b8)+_0xc4815c+_0x2c4fc1(0x1a4)+_0xc4815c+_0x2c4fc1(0x1ba)+_0x486d28+'\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'+_0xc4815c+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x11fcc6===_0x2c4fc1(0x171))return _0x2c4fc1(0x1ce)+_0x2ac23b+_0x2c4fc1(0x162)+_0xc4815c+_0x2c4fc1(0x185)+_0x358d4a+'/'+_0xc4815c+_0x2c4fc1(0x191)+_0x3c13f4+_0x2c4fc1(0x1bd)+_0x358d4a+_0x2c4fc1(0x161)+_0xc4815c+_0x2c4fc1(0x189)+_0x486d28+'\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'+_0xc4815c+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x4bccc6)throw CliErrors[_0x2c4fc1(0x16c)](_0x2c4fc1(0x19f));const _0x3bbd64=_0x4bccc6['alias']??_0x4bccc6[_0x2c4fc1(0x1a5)],_0x41abff=_0x4bccc6[_0x2c4fc1(0x178)]===_0x2c4fc1(0x1bb)?_0x2c4fc1(0x188):'当前响应结果',_0x54cba4=_0x4bccc6[_0x2c4fc1(0x178)]===_0x2c4fc1(0x1bb)?_0x2c4fc1(0x19d):_0x2c4fc1(0x166);return _0x2c4fc1(0x1ce)+_0x2ac23b+_0x2c4fc1(0x1cc)+_0xc4815c+_0x2c4fc1(0x199)+_0x358d4a+'/'+_0x4bccc6[_0x2c4fc1(0x1a5)]+'/'+_0x4bccc6[_0x2c4fc1(0x18b)]+_0x2c4fc1(0x191)+_0x3c13f4+_0x2c4fc1(0x1b1)+_0x4bccc6[_0x2c4fc1(0x173)]+_0x2c4fc1(0x176)+_0x358d4a+_0x2c4fc1(0x19b)+_0x3bbd64+'/'+_0x4bccc6[_0x2c4fc1(0x18b)]+'/'+_0x4bccc6[_0x2c4fc1(0x178)]+'/'+_0xc4815c+'.js\x0a\x20*\x20[触发节点]\x20'+_0x4bccc6[_0x2c4fc1(0x178)]+'\x0a'+_0x486d28+_0x2c4fc1(0x180)+_0x41abff+_0x2c4fc1(0x170)+_0x54cba4+_0x2c4fc1(0x1b4)+_0xc4815c+_0x2c4fc1(0x16e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x153d(){const _0x10908d=['filter','high-risk-write','43611mkCefX','apps','822YcbsvI','447620YdGbcj','delete','No\x20lock\x20entry\x20found\x20for\x20\x22','projectRoot','join','appCode','length','scriptsRoot','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','trashDir','lockFilePath','Backend\x20Function\x20lock\x20file\x20not\x20found.','trashedTo','split','bff','parse','str','scriptsRootDir','map','string','Function\x20not\x20found:\x20','Deleted\x20','\x20\x20-\x20','562356NlTYxx','9gBmooo','<timestamp>','stringify','lastSync','validation','Multiple\x20functions\x20match\x20\x22','302QvKFEV','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','POST','1251278pKSVYY','5CUeAka','Lock\x20scope\x20for\x20app\x20\x22','Would\x20delete\x20','toISOString','target','remoteId','replace','162328FbaIYd','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','1450206BJqGCB','includes','startsWith','keys','functions'];a32_0x153d=function(){return _0x10908d;};return a32_0x153d();}const a32_0x463673=a32_0x17b1;(function(_0x5754ba,_0x1ed716){const _0x5bf1c1=a32_0x17b1,_0xf0d435=_0x5754ba();while(!![]){try{const _0x500eac=parseInt(_0x5bf1c1(0x116))/0x1+parseInt(_0x5bf1c1(0x138))/0x2*(-parseInt(_0x5bf1c1(0x118))/0x3)+-parseInt(_0x5bf1c1(0x131))/0x4+-parseInt(_0x5bf1c1(0x13c))/0x5*(-parseInt(_0x5bf1c1(0x145))/0x6)+parseInt(_0x5bf1c1(0x13b))/0x7+parseInt(_0x5bf1c1(0x143))/0x8*(-parseInt(_0x5bf1c1(0x132))/0x9)+-parseInt(_0x5bf1c1(0x119))/0xa;if(_0x500eac===_0x1ed716)break;else _0xf0d435['push'](_0xf0d435['shift']());}catch(_0x270201){_0xf0d435['push'](_0xf0d435['shift']());}}}(a32_0x153d,0x34fda));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x463673(0x128),'command':a32_0x463673(0x11a),'description':a32_0x463673(0x144),'risk':a32_0x463673(0x115),'flags':[{'name':a32_0x463673(0x140),'type':a32_0x463673(0x12d),'required':!![],'description':a32_0x463673(0x122)}],async 'validate'(_0x440a26){const _0x46b445=a32_0x463673,_0x2a6154=loadBffProjectConfig(_0x440a26[_0x46b445(0x11e)]),_0x2797be=await readBffLockFile(_0x2a6154[_0x46b445(0x124)]);if(!_0x2797be)throw CliErrors[_0x46b445(0x136)](_0x46b445(0x121));},async 'dryRun'(_0x3a1430){const _0x378578=a32_0x463673,_0x16ee91=loadBffProjectConfig(_0x3a1430[_0x378578(0x11e)]),_0x4fdec3=await readBffLockFile(_0x16ee91[_0x378578(0x124)]);if(!_0x4fdec3)throw CliErrors[_0x378578(0x136)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x560d2f}=ensureLockScope(_0x4fdec3,_0x3a1430[_0x378578(0x11e)],_0x16ee91[_0x378578(0x120)],'delete'),_0xe49fd5=_0x3a1430[_0x378578(0x12a)](_0x378578(0x140)),_0x2bb4dd=Object[_0x378578(0x112)](_0x560d2f[_0x378578(0x113)]),_0x1d3dd7=resolveDeleteTarget(_0xe49fd5,_0x2bb4dd),_0x5f5cb8=_0x560d2f[_0x378578(0x113)][_0x1d3dd7];if(!_0x5f5cb8)throw CliErrors[_0x378578(0x136)](_0x378578(0x11b)+_0x1d3dd7+'\x22.');const _0x446456=resolveLocalFilePathFromLockKey(_0x16ee91,_0x1d3dd7),_0x13c871=relative(_0x16ee91[_0x378578(0x11c)],_0x446456),_0x2c7c1e=join(_0x16ee91[_0x378578(0x123)],_0x378578(0x133),_0x13c871);return{'method':_0x378578(0x13a),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x3a1430[_0x378578(0x11e)],'target':_0x1d3dd7,'remoteId':_0x5f5cb8['remoteId'],'localFilePath':_0x446456,'trashedPath':_0x2c7c1e},'description':_0x378578(0x13e)+_0x1d3dd7+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x3a3750){const _0x474142=a32_0x463673,_0x4305ff=loadBffProjectConfig(_0x3a3750[_0x474142(0x11e)]),_0x50a4b2=await readBffLockFile(_0x4305ff['lockFilePath']);if(!_0x50a4b2)throw CliErrors[_0x474142(0x136)](_0x474142(0x125));const {lockData:_0x17064f,appLock:_0x4db904}=ensureLockScope(_0x50a4b2,_0x3a3750[_0x474142(0x11e)],_0x4305ff[_0x474142(0x120)],_0x474142(0x11a)),_0x582e8c=JSON[_0x474142(0x129)](JSON[_0x474142(0x134)](_0x17064f)),_0x5c3e3c=_0x582e8c[_0x474142(0x117)][_0x3a3750['appCode']];if(!_0x5c3e3c)throw new Error(_0x474142(0x13d)+_0x3a3750['appCode']+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x2522a6=_0x3a3750[_0x474142(0x12a)](_0x474142(0x140)),_0x1c64a4=Object[_0x474142(0x112)](_0x5c3e3c[_0x474142(0x113)]),_0xa643=resolveDeleteTarget(_0x2522a6,_0x1c64a4),_0x189528=_0x5c3e3c['functions'][_0xa643];if(!_0x189528)throw CliErrors['validation'](_0x474142(0x11b)+_0xa643+'\x22.');await deleteBffScript(_0x189528[_0x474142(0x141)]),delete _0x5c3e3c[_0x474142(0x113)][_0xa643],_0x5c3e3c[_0x474142(0x135)]=new Date()[_0x474142(0x13f)](),await writeBffLockFile(_0x4305ff[_0x474142(0x124)],_0x582e8c);const _0x345d5e=resolveLocalFilePathFromLockKey(_0x4305ff,_0xa643);let _0x467db3;await fileExists(_0x345d5e)&&(_0x467db3=await moveToTrash(_0x4305ff['projectRoot'],_0x4305ff[_0x474142(0x123)],_0x345d5e),await cleanupEmptyDirectories(dirname(_0x345d5e),_0x4305ff[_0x474142(0x12b)]));await waitForDeleteSettlement(_0x4305ff[_0x474142(0x124)],_0x3a3750[_0x474142(0x11e)],_0xa643,_0x345d5e),await sleep(0x96);const _0x48ad96={'deleted':_0xa643,'remoteId':_0x189528[_0x474142(0x141)]};if(_0x467db3)_0x48ad96[_0x474142(0x126)]=_0x467db3;return{'ok':!![],'data':_0x48ad96,'message':_0x474142(0x12f)+_0xa643+(_0x467db3?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x25d044,_0x184273){const _0x27ab6c=a32_0x463673;if(_0x25d044[_0x27ab6c(0x110)]('/')){const _0x1c96df=_0x184273['find'](_0x337070=>_0x337070===_0x25d044);if(!_0x1c96df)throw CliErrors[_0x27ab6c(0x136)](_0x27ab6c(0x12e)+_0x25d044);return _0x1c96df;}const _0x12e9f9=_0x184273[_0x27ab6c(0x114)](_0x37fa6e=>_0x37fa6e[_0x27ab6c(0x127)]('/')['at'](-0x1)===_0x25d044);if(_0x12e9f9['length']===0x0)throw CliErrors[_0x27ab6c(0x136)](_0x27ab6c(0x12e)+_0x25d044);if(_0x12e9f9[_0x27ab6c(0x11f)]>0x1)throw CliErrors[_0x27ab6c(0x136)](_0x27ab6c(0x137)+_0x25d044+_0x27ab6c(0x139)+_0x12e9f9[_0x27ab6c(0x12c)](_0x1fe139=>_0x27ab6c(0x130)+_0x1fe139)[_0x27ab6c(0x11d)]('\x0a'));return _0x12e9f9[0x0];}async function moveToTrash(_0x3f6e10,_0xfdd9ed,_0x2590a0){const _0x300e97=a32_0x463673,_0x375af1=new Date()[_0x300e97(0x13f)]()[_0x300e97(0x142)](/[:.]/g,'-'),_0x29ba82=relative(_0x3f6e10,_0x2590a0),_0x192730=join(_0xfdd9ed,_0x375af1,_0x29ba82);return await mkdir(dirname(_0x192730),{'recursive':!![]}),await rename(_0x2590a0,_0x192730),_0x192730;}async function cleanupEmptyDirectories(_0x3591e4,_0x28aff9){const _0x50cbb6=a32_0x463673;let _0x3dc8c2=resolve(_0x3591e4);const _0x37e1c9=resolve(_0x28aff9);while(_0x3dc8c2[_0x50cbb6(0x111)](''+_0x37e1c9+sep)||_0x3dc8c2===_0x37e1c9){if(_0x3dc8c2===_0x37e1c9)return;try{const _0x131558=await readdir(_0x3dc8c2);if(_0x131558[_0x50cbb6(0x11f)]>0x0)return;await rmdir(_0x3dc8c2);}catch{return;}_0x3dc8c2=dirname(_0x3dc8c2);}}function a32_0x17b1(_0xcc2a26,_0xb3781e){_0xcc2a26=_0xcc2a26-0x110;const _0x153d1e=a32_0x153d();let _0x17b105=_0x153d1e[_0xcc2a26];return _0x17b105;}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x48d122,_0x1c68d4,_0x516aaf,_0x4d36d7){const _0x1c8c07=a32_0x463673;for(let _0xa8260a=0x0;_0xa8260a<DELETE_SETTLE_RETRY_COUNT;_0xa8260a+=0x1){const _0x423ef4=await readBffLockFile(_0x48d122),_0x4bf6b0=!!_0x423ef4?.[_0x1c8c07(0x117)]?.[_0x1c68d4]?.[_0x1c8c07(0x113)]?.[_0x516aaf],_0xed5b08=await fileExists(_0x4d36d7);if(!_0x4bf6b0&&!_0xed5b08)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x516aaf+'.');}
|