@lovrabet/rabetbase-cli 2.3.16-beta.5 → 2.3.16-beta.6
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/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/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.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/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/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/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.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/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.d.ts +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/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/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/copy-directory.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/rules-cdn.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/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x58df36=a19_0x1239;(function(_0x5900b7,_0x268d38){const _0x4556be=a19_0x1239,_0x21c0ed=_0x5900b7();while(!![]){try{const _0x5ab650=-parseInt(_0x4556be(0x1ef))/0x1+-parseInt(_0x4556be(0x1f1))/0x2*(parseInt(_0x4556be(0x1d4))/0x3)+-parseInt(_0x4556be(0x1ee))/0x4*(-parseInt(_0x4556be(0x1f0))/0x5)+parseInt(_0x4556be(0x1dc))/0x6*(-parseInt(_0x4556be(0x1e7))/0x7)+parseInt(_0x4556be(0x1ce))/0x8+parseInt(_0x4556be(0x1e2))/0x9+-parseInt(_0x4556be(0x1d7))/0xa*(parseInt(_0x4556be(0x1d1))/0xb);if(_0x5ab650===_0x268d38)break;else _0x21c0ed['push'](_0x21c0ed['shift']());}catch(_0x9e4f26){_0x21c0ed['push'](_0x21c0ed['shift']());}}}(a19_0x298f,0xd2cba));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x1239(_0x460c11,_0x28d4b6){_0x460c11=_0x460c11-0x1ce;const _0x298fe=a19_0x298f();let _0x1239ab=_0x298fe[_0x460c11];return _0x1239ab;}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(_0x4970f6,_0x4c7a2e){const _0xbe4327=a19_0x1239,_0x5a532d=[],_0x5591e4=_0x4970f6['apps']&&typeof _0x4970f6[_0xbe4327(0x1f2)]==='object'?_0x4970f6[_0xbe4327(0x1f2)]:{},_0x47cb27=_0x4970f6[_0xbe4327(0x1d6)]||undefined;for(const [_0x32f685,_0x3825fd]of Object['entries'](_0x5591e4)){if(!_0x3825fd||typeof _0x3825fd!=='object'||!_0x3825fd[_0xbe4327(0x1e6)])continue;_0x5a532d[_0xbe4327(0x1d5)]({'name':_0x32f685,'appcode':_0x3825fd[_0xbe4327(0x1e6)],'named':!![],'definedIn':_0x4c7a2e,'isDefault':_0x32f685===_0x47cb27,...buildAppProfileListFields(_0x3825fd)});}return _0x5a532d;}function a19_0x298f(){const _0x597585=['Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','boolean','merged','globalPath','6760816NPcgDj','1297287hnXWFK','5HalHTt','46966nXpGrU','apps','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','remote','mergedCli','\x20in\x20','globalConfig','4436072CRmtNe','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','No\x20apps\x20configured','22YRTiOc','bool','object','72qhyoJV','push','defaultApp','2217290eWcPKR','.\x20Use\x20`','read','inherit','global','3148014ygIlpW','length','projectConfig','app','isCurrent','find','13029399jpGxhx','projectPath','project','\x20config','appcode','7gLqVeL','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'];a19_0x298f=function(){return _0x597585;};return a19_0x298f();}function buildMergedItems(_0x485058,_0x165052){const _0x2e3a81=a19_0x1239,{apps:apps={},defaultApp:_0x9bc468}=_0x485058,_0x518516=_0x165052[_0x2e3a81(0x1f7)][_0x2e3a81(0x1f2)]&&typeof _0x165052[_0x2e3a81(0x1f7)][_0x2e3a81(0x1f2)]===_0x2e3a81(0x1d3)?_0x165052[_0x2e3a81(0x1f7)]['apps']:{},_0x2dd6df=_0x165052[_0x2e3a81(0x1de)][_0x2e3a81(0x1f2)]&&typeof _0x165052[_0x2e3a81(0x1de)]['apps']===_0x2e3a81(0x1d3)?_0x165052[_0x2e3a81(0x1de)][_0x2e3a81(0x1f2)]:{},_0x401ef4=_0x165052[_0x2e3a81(0x1de)][_0x2e3a81(0x1da)]===![],_0x473662=Object['entries'](apps),_0xeb8b18=_0x473662['map'](([_0x325abc,_0x175bb8])=>({'name':_0x325abc,'appcode':_0x175bb8['appcode'],'named':!![],'definedIn':appDefinedIn(_0x325abc,_0x518516,_0x2dd6df,_0x401ef4),'isDefault':_0x325abc===_0x9bc468,...buildAppProfileListFields(_0x175bb8)}));return _0xeb8b18;}function validateAppListFlags(_0x286d7d){const _0x2566ef=a19_0x1239;if(!_0x286d7d['bool']('remote'))return;if(!_0x286d7d[_0x2566ef(0x1d2)](_0x2566ef(0x1db))&&!_0x286d7d[_0x2566ef(0x1d2)](_0x2566ef(0x1e4)))return;throw CliErrors['validation']('`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x2d382c){const _0x1c6018=a19_0x1239;validateAppListFlags(_0x2d382c);if(_0x2d382c[_0x1c6018(0x1d2)]('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x2d382c)};const _0x3225c5=_0x2d382c['bool']('global'),_0x18aa7c=_0x2d382c[_0x1c6018(0x1d2)](_0x1c6018(0x1e4)),_0x16482f=_0x3225c5?_0x1c6018(0x1db):_0x18aa7c?_0x1c6018(0x1e4):_0x1c6018(0x1ec),{config:_0x3bed19,layers:_0x1352cd}=readRawConfigWithLayers(),_0x50ee85=resolveDefaultAppSource(_0x1352cd),{defaultApp:_0x2f4fce}=_0x3bed19;let _0xdf719b,_0x450c77;switch(_0x16482f){case'global':_0xdf719b=buildItemsFromLayer(_0x1352cd[_0x1c6018(0x1f7)],_0x1c6018(0x1db)),_0x450c77=_0x1352cd[_0x1c6018(0x1ed)];break;case _0x1c6018(0x1e4):_0xdf719b=buildItemsFromLayer(_0x1352cd['projectConfig'],_0x1c6018(0x1e4)),_0x450c77=_0x1352cd[_0x1c6018(0x1e3)];break;default:_0xdf719b=buildMergedItems(_0x3bed19,_0x1352cd);break;}enrichAppListItemsWithMergedSelection(_0xdf719b,_0x2d382c[_0x1c6018(0x1f5)]);if(_0xdf719b[_0x1c6018(0x1dd)]===0x0){const _0x6a603b=_0x16482f===_0x1c6018(0x1ec)?'':_0x1c6018(0x1f6)+_0x16482f+_0x1c6018(0x1e5);return{'ok':!![],'data':[],'message':_0x1c6018(0x1d0)+_0x6a603b+_0x1c6018(0x1d8)+CLI_BIN_NAME+_0x1c6018(0x1e8)};}const _0x578da6=_0xdf719b[_0x1c6018(0x1e1)](_0x8327e1=>_0x8327e1[_0x1c6018(0x1e0)]===!![]),_0xdda7a5=_0x2f4fce??_0x578da6?.[_0x1c6018(0x1e6)]??null,_0x52e804=_0x16482f===_0x1c6018(0x1ec)?{'globalPath':_0x1352cd[_0x1c6018(0x1ed)]??null,'projectPath':_0x1352cd[_0x1c6018(0x1e3)]??null,'defaultApp':_0xdda7a5,'defaultAppSource':_0x2f4fce!=null?_0x50ee85:null}:{'scope':_0x16482f,'configPath':_0x450c77??null};return{'ok':!![],'data':{'items':_0xdf719b,'meta':_0x52e804}};}export const appListDefinition={'service':a19_0x58df36(0x1df),'command':'list','description':a19_0x58df36(0x1f3),'risk':a19_0x58df36(0x1d9),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x58df36(0x1f4),'type':a19_0x58df36(0x1eb),'description':a19_0x58df36(0x1ea),'default':![]},{'name':'global','type':a19_0x58df36(0x1eb),'description':a19_0x58df36(0x1e9),'default':![]},{'name':'project','type':a19_0x58df36(0x1eb),'description':a19_0x58df36(0x1cf),'default':![]}],async 'validate'(_0x3a5f67){validateAppListFlags(_0x3a5f67);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x1cee4c=a20_0x2ab0;(function(_0x2c142d,_0x2aa22c){const _0x51fe26=a20_0x2ab0,_0x24da05=_0x2c142d();while(!![]){try{const _0x179bbc=parseInt(_0x51fe26(0x142))/0x1+-parseInt(_0x51fe26(0x13e))/0x2+parseInt(_0x51fe26(0x13d))/0x3*(parseInt(_0x51fe26(0x139))/0x4)+-parseInt(_0x51fe26(0x141))/0x5*(parseInt(_0x51fe26(0x140))/0x6)+-parseInt(_0x51fe26(0x135))/0x7+-parseInt(_0x51fe26(0x132))/0x8+parseInt(_0x51fe26(0x13c))/0x9*(parseInt(_0x51fe26(0x13a))/0xa);if(_0x179bbc===_0x2aa22c)break;else _0x24da05['push'](_0x24da05['shift']());}catch(_0x4dbd2b){_0x24da05['push'](_0x24da05['shift']());}}}(a20_0x161a,0x36e7a));function a20_0x161a(){const _0x3550fa=['members-list','158096OrYJjo','5177590jaJozv','Found\x20','9wMQuvN','15FErqSe','862960lgYWQR','length','24xyfnMH','39925VPlAdK','317513pTOmsU','read','2082928VkgkIH','\x20application\x20member(s)','appCode','589512KgpKib','List\x20application\x20members\x20with\x20their\x20role\x20memberships','app'];a20_0x161a=function(){return _0x3550fa;};return a20_0x161a();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';function a20_0x2ab0(_0x102476,_0x29f59b){_0x102476=_0x102476-0x131;const _0x161ab5=a20_0x161a();let _0x2ab0a3=_0x161ab5[_0x102476];return _0x2ab0a3;}import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':a20_0x1cee4c(0x137),'command':a20_0x1cee4c(0x138),'description':a20_0x1cee4c(0x136),'risk':a20_0x1cee4c(0x131),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x1b9b7e){const _0x36e102=a20_0x1cee4c,_0x36f80c=projectAppMembers(await listRoleUsers(_0x1b9b7e[_0x36e102(0x134)]));return{'ok':!![],'data':{'appCode':_0x1b9b7e[_0x36e102(0x134)],'items':_0x36f80c,'totalCount':_0x36f80c[_0x36e102(0x13f)]},'message':_0x36e102(0x13b)+_0x36f80c[_0x36e102(0x13f)]+_0x36e102(0x133)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9bd474,_0x2d69cf){const _0x378d06=a21_0x2094,_0x53baef=_0x9bd474();while(!![]){try{const _0x542567=parseInt(_0x378d06(0xba))/0x1+parseInt(_0x378d06(0xbb))/0x2+-parseInt(_0x378d06(0xb3))/0x3+parseInt(_0x378d06(0xb2))/0x4+-parseInt(_0x378d06(0xb1))/0x5*(-parseInt(_0x378d06(0xb9))/0x6)+-parseInt(_0x378d06(0xb4))/0x7+-parseInt(_0x378d06(0xb6))/0x8*(parseInt(_0x378d06(0xbc))/0x9);if(_0x542567===_0x2d69cf)break;else _0x53baef['push'](_0x53baef['shift']());}catch(_0x11d92c){_0x53baef['push'](_0x53baef['shift']());}}}(a21_0x3480,0xab102));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 a21_0x3480(){const _0x3046b5=['appName','appDesc','6bJFJko','1046185MKpUif','668920pofSTD','693IgwrSX','appCode','561505yoosGI','4596048hBLUIj','1620687iEAgCq','7867524lNHnwo','cookie','28792JlVoXS'];a21_0x3480=function(){return _0x3046b5;};return a21_0x3480();}function a21_0x2094(_0x29a279,_0x353def){_0x29a279=_0x29a279-0xb1;const _0x348007=a21_0x3480();let _0x209416=_0x348007[_0x29a279];return _0x209416;}function resolveCookie(_0x5e8103){const _0xd5ab0f=a21_0x2094,_0x2fa217=_0x5e8103[_0xd5ab0f(0xb5)]||getCookie();if(!_0x2fa217)throw CliErrors['authRequired']();return _0x2fa217;}export async function listRemoteAppDirectory(_0x3fcd08){const _0xc66df9=a21_0x2094,_0xbfd476=await withActiveCookie(resolveCookie(_0x3fcd08),()=>listRemoteApps());return{'items':_0xbfd476['map'](_0x2ed183=>({..._0x2ed183['id']!=null?{'id':_0x2ed183['id']}:{},'appCode':_0x2ed183[_0xc66df9(0xbd)],'appName':_0x2ed183[_0xc66df9(0xb7)],..._0x2ed183[_0xc66df9(0xb8)]!=null?{'appDesc':_0x2ed183[_0xc66df9(0xb8)]}:{}})),'meta':{'source':'platform'}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x2007(_0x5d05be,_0x63bf53){_0x5d05be=_0x5d05be-0x7b;const _0x59a766=a22_0x59a7();let _0x2007b7=_0x59a766[_0x5d05be];return _0x2007b7;}(function(_0x5cd895,_0x4b2c86){const _0x52d067=a22_0x2007,_0x55cf76=_0x5cd895();while(!![]){try{const _0x3760a9=parseInt(_0x52d067(0x86))/0x1*(-parseInt(_0x52d067(0xb2))/0x2)+parseInt(_0x52d067(0xa9))/0x3+parseInt(_0x52d067(0x99))/0x4*(parseInt(_0x52d067(0x83))/0x5)+-parseInt(_0x52d067(0xae))/0x6*(parseInt(_0x52d067(0x8d))/0x7)+parseInt(_0x52d067(0x9f))/0x8*(-parseInt(_0x52d067(0x7b))/0x9)+parseInt(_0x52d067(0x91))/0xa+-parseInt(_0x52d067(0x7c))/0xb*(-parseInt(_0x52d067(0xa8))/0xc);if(_0x3760a9===_0x4b2c86)break;else _0x55cf76['push'](_0x55cf76['shift']());}catch(_0x4ddbd4){_0x55cf76['push'](_0x55cf76['shift']());}}}(a22_0x59a7,0x262eb));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x1ae272){const _0x3b1467=a22_0x2007,_0x4ec8d4=_0x1ae272?.[_0x3b1467(0x89)]();return _0x4ec8d4?_0x4ec8d4:null;}export function projectAppMembers(_0xf72c96){const _0x42d73b=a22_0x2007,_0x4c588a=new Map(),_0x485b8e=[..._0xf72c96]['sort']((_0x3440a2,_0x16ea09)=>_0x3440a2['id']-_0x16ea09['id']),_0x23d15d=(_0x14baf0,_0x32ee1d,_0x36123d)=>{const _0x53c42b=a22_0x2007;for(const _0x377555 of _0x32ee1d){const _0x370f4f=Number(_0x377555[_0x53c42b(0x81)]);if(!Number[_0x53c42b(0x96)](_0x370f4f)||_0x370f4f<=0x0)continue;let _0x259890=_0x4c588a[_0x53c42b(0x7f)](_0x370f4f);if(!_0x259890)_0x259890={'userId':_0x370f4f,'username':nullableText(_0x377555[_0x53c42b(0x97)]),'displayName':nullableText(_0x377555[_0x53c42b(0x7d)]),'status':_0x36123d,'roles':[],'roleKeys':new Set()},_0x4c588a['set'](_0x370f4f,_0x259890);else{_0x259890['username']??=nullableText(_0x377555[_0x53c42b(0x97)]),_0x259890[_0x53c42b(0xa7)]??=nullableText(_0x377555[_0x53c42b(0x7d)]);if(_0x36123d==='ACTIVE')_0x259890[_0x53c42b(0x80)]='ACTIVE';}const _0x528c39=_0x14baf0['id']+':'+_0x36123d;if(_0x259890['roleKeys'][_0x53c42b(0x88)](_0x528c39))continue;_0x259890['roleKeys'][_0x53c42b(0xa2)](_0x528c39),_0x259890[_0x53c42b(0x8a)][_0x53c42b(0x90)]({'roleId':_0x14baf0['id'],'roleName':nullableText(_0x14baf0[_0x53c42b(0xb1)]),'roleType':nullableText(_0x14baf0[_0x53c42b(0xb0)]),'membershipStatus':_0x36123d});}};for(const _0x23949a of _0x485b8e){_0x23d15d(_0x23949a,_0x23949a[_0x42d73b(0xaf)]??[],'ACTIVE'),_0x23d15d(_0x23949a,_0x23949a[_0x42d73b(0x85)]??[],_0x42d73b(0xac));}return[..._0x4c588a[_0x42d73b(0xab)]()][_0x42d73b(0x98)](_0x573cd6=>({'userId':_0x573cd6[_0x42d73b(0x81)],'username':_0x573cd6[_0x42d73b(0x97)],'displayName':_0x573cd6[_0x42d73b(0xa7)],'status':_0x573cd6[_0x42d73b(0x80)],'roles':_0x573cd6[_0x42d73b(0x8a)][_0x42d73b(0xa1)]((_0x4ceeb1,_0x428a67)=>_0x4ceeb1[_0x42d73b(0x9b)]-_0x428a67[_0x42d73b(0x9b)]||(_0x4ceeb1[_0x42d73b(0x9c)]===_0x428a67['membershipStatus']?0x0:_0x4ceeb1[_0x42d73b(0x9c)]===_0x42d73b(0x8f)?-0x1:0x1))}))['sort']((_0x2928d8,_0x13f10d)=>_0x2928d8[_0x42d73b(0x81)]-_0x13f10d[_0x42d73b(0x81)]);}export function enrichAppListItemsWithMergedSelection(_0xd4f30f,_0x1ffeb2){const _0xc34c10=a22_0x2007;if(!_0x1ffeb2)return;const _0xb8b746=_0x1ffeb2[_0xc34c10(0xa5)]&&typeof _0x1ffeb2[_0xc34c10(0xa5)]==='object'?_0x1ffeb2[_0xc34c10(0xa5)]:{},_0x56a5f5=Object[_0xc34c10(0x92)](_0xb8b746)[_0xc34c10(0x87)]>0x0;for(const _0x5a53aa of _0xd4f30f){_0x5a53aa[_0xc34c10(0x9e)]=![];}const _0x5f4a28=_0x1ffeb2[_0xc34c10(0x82)]!=null?String(_0x1ffeb2['appCode'])[_0xc34c10(0x89)]():'';if(_0x56a5f5){const _0x578772=_0x1ffeb2[_0xc34c10(0x84)]??_0x1ffeb2[_0xc34c10(0x95)];if(_0x578772)for(const _0xd35c47 of _0xd4f30f){_0xd35c47['named']===!![]&&_0xd35c47[_0xc34c10(0x93)]===_0x578772&&(_0xd35c47['isCurrent']=!![]);}for(const _0xe315f3 of _0xd4f30f){if(_0xe315f3[_0xc34c10(0xaa)]!==![])continue;if(_0x1ffeb2[_0xc34c10(0x95)])continue;_0x5f4a28&&String(_0xe315f3[_0xc34c10(0xad)]??'')[_0xc34c10(0x89)]()===_0x5f4a28&&(_0xe315f3[_0xc34c10(0x9e)]=!![]);}return;}if(!_0x5f4a28)return;for(const _0xb9e8c0 of _0xd4f30f){String(_0xb9e8c0['appcode']??'')[_0xc34c10(0x89)]()===_0x5f4a28&&(_0xb9e8c0[_0xc34c10(0x9e)]=!![]);}}export function resolveAppScopeForWrite(_0x30cf7f,_0x4c4b4d,_0x83b36c){const _0x5a3abf=a22_0x2007;if(_0x4c4b4d)return _0x5a3abf(0x8c);const _0x2a35ba=_0x83b36c['projectConfig'][_0x5a3abf(0xa5)]&&typeof _0x83b36c[_0x5a3abf(0x9a)][_0x5a3abf(0xa5)]===_0x5a3abf(0xa4)?_0x83b36c[_0x5a3abf(0x9a)][_0x5a3abf(0xa5)]:{},_0x57f1f8=_0x83b36c[_0x5a3abf(0x94)]['apps']&&typeof _0x83b36c[_0x5a3abf(0x94)][_0x5a3abf(0xa5)]==='object'?_0x83b36c['globalConfig'][_0x5a3abf(0xa5)]:{};if(Object[_0x5a3abf(0xa6)]['hasOwnProperty'][_0x5a3abf(0x8e)](_0x2a35ba,_0x30cf7f))return _0x5a3abf(0x9d);if(Object[_0x5a3abf(0xa6)][_0x5a3abf(0x7e)][_0x5a3abf(0x8e)](_0x57f1f8,_0x30cf7f))return'global';return _0x5a3abf(0x9d);}function a22_0x59a7(){const _0xb1cd41=['appcode','611394NxcApH','userList','roleType','roleName','98ERSpYC','382383QNCUtJ','862499znDiIX','nickname','hasOwnProperty','get','status','userId','appCode','137650hZVyJT','currentApp','applyUserList','3974WXYVdD','length','has','trim','roles','both','global','7IoxdHd','call','ACTIVE','push','1648080qGqYLu','keys','name','globalConfig','defaultApp','isFinite','username','map','4nZZJzw','projectConfig','roleId','membershipStatus','project','isCurrent','8klKHSk','\x20(global)','sort','add','inherit','object','apps','prototype','displayName','12nHZlBn','674280XSGrll','named','values','PENDING'];a22_0x59a7=function(){return _0xb1cd41;};return a22_0x59a7();}export function appDefinedIn(_0x595535,_0x2240ea,_0x440267,_0x469ec6){const _0x1c3532=a22_0x2007;if(_0x469ec6)return Object[_0x1c3532(0xa6)][_0x1c3532(0x7e)][_0x1c3532(0x8e)](_0x440267,_0x595535)?_0x1c3532(0x9d):'global';const _0x13b747=Object[_0x1c3532(0xa6)][_0x1c3532(0x7e)][_0x1c3532(0x8e)](_0x2240ea,_0x595535),_0x21ff24=Object[_0x1c3532(0xa6)][_0x1c3532(0x7e)][_0x1c3532(0x8e)](_0x440267,_0x595535);if(_0x13b747&&_0x21ff24)return _0x1c3532(0x8b);if(_0x21ff24)return'project';return'global';}export function resolveDefaultAppSource(_0xd69537){const _0x2723bf=a22_0x2007,_0x22dd4b=_0xd69537[_0x2723bf(0x9a)][_0x2723bf(0xa5)]&&typeof _0xd69537[_0x2723bf(0x9a)][_0x2723bf(0xa5)]==='object'?_0xd69537[_0x2723bf(0x9a)]['apps']:{};if(_0x2723bf(0x95)in _0xd69537[_0x2723bf(0x9a)])return'project';if(Object[_0x2723bf(0x92)](_0x22dd4b)['length']>0x0)return _0x2723bf(0x9d);if(_0xd69537['projectConfig'][_0x2723bf(0xa3)]===![])return null;if(_0xd69537[_0x2723bf(0x94)]['defaultApp'])return'global';return null;}export function getConfigPath(_0x4263b0={}){const _0x36c37b=a22_0x2007,_0x5f2105=_0x4263b0['global']?_0x36c37b(0x8c):_0x36c37b(0x9d);return resolveWriteConfigPath(_0x5f2105);}export function readConfig(_0xf42bb1={}){return readConfigFile(getConfigPath(_0xf42bb1));}export function writeConfig(_0x4d562f,_0x106aab={}){writeConfigFile(getConfigPath(_0x106aab),_0x4d562f);}export function scopeLabel(_0x7e502e){const _0x2e13d6=a22_0x2007;return _0x7e502e[_0x2e13d6(0x8c)]?_0x2e13d6(0xa0):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x6eed3b=a23_0x548d;(function(_0x19696f,_0x452430){const _0x52e5c3=a23_0x548d,_0x32d947=_0x19696f();while(!![]){try{const _0x354b68=-parseInt(_0x52e5c3(0x1f9))/0x1*(-parseInt(_0x52e5c3(0x1fb))/0x2)+-parseInt(_0x52e5c3(0x1fc))/0x3+-parseInt(_0x52e5c3(0x1f6))/0x4*(-parseInt(_0x52e5c3(0x1f5))/0x5)+parseInt(_0x52e5c3(0x1f1))/0x6*(-parseInt(_0x52e5c3(0x1ec))/0x7)+parseInt(_0x52e5c3(0x1f7))/0x8+parseInt(_0x52e5c3(0x201))/0x9*(-parseInt(_0x52e5c3(0x202))/0xa)+-parseInt(_0x52e5c3(0x1f2))/0xb*(parseInt(_0x52e5c3(0x200))/0xc);if(_0x354b68===_0x452430)break;else _0x32d947['push'](_0x32d947['shift']());}catch(_0x147639){_0x32d947['push'](_0x32d947['shift']());}}}(a23_0x2348,0x70931));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';function a23_0x548d(_0x57838d,_0x3c0467){_0x57838d=_0x57838d-0x1ec;const _0x2348c7=a23_0x2348();let _0x548d73=_0x2348c7[_0x57838d];return _0x548d73;}import{CliErrors}from'../../errors.js';function a23_0x2348(){const _0x4847eb=['5049LkLkUe','Deleted\x20app\x20config\x20','app-config','350065hssVSv','20TpYaAa','2568560OQPSay','validation','67447tSVlbK','get','26wvtNkw','484308gMzPOT','apiError','App\x20config\x20server\x20id\x20missing\x20for\x20key=','delete','1956bJTuTf','78669JAfVJs','340bTMeZx','isFinite','7qoeyEY','appCode:\x20','App\x20config\x20key\x20not\x20found:\x20','appCode','Delete\x20one\x20runtime\x20app-config\x20key','3320364RlqTEY'];a23_0x2348=function(){return _0x4847eb;};return a23_0x2348();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH='/smartapi/app-config/delete';export const appConfigDelete={'service':a23_0x6eed3b(0x1f4),'command':a23_0x6eed3b(0x1ff),'description':a23_0x6eed3b(0x1f0),'risk':'high-risk-write','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0xc2d248){readKeyArg(_0xc2d248);},async 'dryRun'(_0x246428){const _0x5cf0e3=a23_0x6eed3b,_0x371a93=readKeyArg(_0x246428),_0x3f87be=await mustGetByKey(_0x246428[_0x5cf0e3(0x1ef)],_0x371a93);return asAppConfigDryRunResult(buildMutationData({'operation':_0x5cf0e3(0x1ff),'appCode':_0x246428[_0x5cf0e3(0x1ef)],'key':_0x371a93,'before':projectAppConfig(_0x3f87be),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x17d621){const _0x3e1dcd=a23_0x6eed3b,_0x19a0f3=readKeyArg(_0x17d621),_0x4a2a4b=await mustGetByKey(_0x17d621[_0x3e1dcd(0x1ef)],_0x19a0f3);return await withAppConfigApiBoundary(_0x3e1dcd(0x1ff),{'appCode':_0x17d621[_0x3e1dcd(0x1ef)],'key':_0x19a0f3},()=>deleteAppConfig({'appCode':_0x17d621['appCode'],'id':requireAppConfigId(_0x4a2a4b,_0x19a0f3,_0x17d621[_0x3e1dcd(0x1ef)])})),{'ok':!![],'data':buildMutationData({'operation':_0x3e1dcd(0x1ff),'appCode':_0x17d621['appCode'],'key':_0x19a0f3,'before':projectAppConfig(_0x4a2a4b),'after':null,'dryRun':![]}),'message':_0x3e1dcd(0x1f3)+_0x19a0f3};}};async function mustGetByKey(_0x165f2c,_0xaf3ae1){const _0x571d66=a23_0x6eed3b,_0x1fe4fa=await withAppConfigApiBoundary(_0x571d66(0x1fa),{'appCode':_0x165f2c,'key':_0xaf3ae1},()=>getAppConfigByKey(_0x165f2c,_0xaf3ae1));if(!_0x1fe4fa)throw CliErrors[_0x571d66(0x1f8)](_0x571d66(0x1ee)+_0xaf3ae1,_0x571d66(0x1ed)+_0x165f2c);return _0x1fe4fa;}function requireAppConfigId(_0x2a7ba3,_0x179e1d,_0x1e5330){const _0x538be9=a23_0x6eed3b;if(typeof _0x2a7ba3['id']==='number'&&Number[_0x538be9(0x203)](_0x2a7ba3['id'])&&_0x2a7ba3['id']>0x0)return _0x2a7ba3['id'];throw CliErrors[_0x538be9(0x1fd)](_0x538be9(0x1fe)+_0x179e1d+',\x20appCode='+_0x1e5330);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x2029f3=a24_0x4ef7;function a24_0x42da(){const _0x3413df=['appCode:\x20','239244TPGMDl','app-config','Loaded\x20app\x20config\x20','35AXFZCz','78DDQqKC','\x20with\x20value\x20redacted','appCode','268Nwtpov','App\x20config\x20key\x20not\x20found:\x20','read','188iEcLdw','14403fJAMMX','13YokkQb','1830hREWWM','get','11UpyanD','2897415LWqAtt','106060QYZftR','validation','57496qfJehM','1403710NpmqDH','10hxIjhK','reveal','bool','\x20with\x20value\x20revealed'];a24_0x42da=function(){return _0x3413df;};return a24_0x42da();}(function(_0x44b9a9,_0x35cf6b){const _0x408bbb=a24_0x4ef7,_0x7b85af=_0x44b9a9();while(!![]){try{const _0x314931=-parseInt(_0x408bbb(0x9a))/0x1*(-parseInt(_0x408bbb(0xa0))/0x2)+parseInt(_0x408bbb(0x9e))/0x3*(-parseInt(_0x408bbb(0x9d))/0x4)+parseInt(_0x408bbb(0xa4))/0x5*(-parseInt(_0x408bbb(0xb1))/0x6)+-parseInt(_0x408bbb(0xb0))/0x7*(-parseInt(_0x408bbb(0xa6))/0x8)+parseInt(_0x408bbb(0xa3))/0x9*(parseInt(_0x408bbb(0xa8))/0xa)+-parseInt(_0x408bbb(0xa2))/0xb*(parseInt(_0x408bbb(0xad))/0xc)+parseInt(_0x408bbb(0x9f))/0xd*(parseInt(_0x408bbb(0xa7))/0xe);if(_0x314931===_0x35cf6b)break;else _0x7b85af['push'](_0x7b85af['shift']());}catch(_0x23ce01){_0x7b85af['push'](_0x7b85af['shift']());}}}(a24_0x42da,0x2c6ff));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a24_0x4ef7(_0x3a76da,_0x422c52){_0x3a76da=_0x3a76da-0x98;const _0x42daa5=a24_0x42da();let _0x4ef7e2=_0x42daa5[_0x3a76da];return _0x4ef7e2;}import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigGet={'service':a24_0x2029f3(0xae),'command':a24_0x2029f3(0xa1),'description':'Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','risk':a24_0x2029f3(0x9c),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x173822){readKeyArg(_0x173822);},async 'execute'(_0x36512a){const _0x35f3dd=a24_0x2029f3,_0x57cf1a=readKeyArg(_0x36512a),_0x188f53=await withAppConfigApiBoundary(_0x35f3dd(0xa1),{'appCode':_0x36512a['appCode'],'key':_0x57cf1a},()=>getAppConfigByKey(_0x36512a['appCode'],_0x57cf1a));if(!_0x188f53)throw CliErrors[_0x35f3dd(0xa5)](_0x35f3dd(0x9b)+_0x57cf1a,_0x35f3dd(0xac)+_0x36512a[_0x35f3dd(0x99)]);const _0x1904ce=projectAppConfig(_0x188f53,{'reveal':_0x36512a[_0x35f3dd(0xaa)](_0x35f3dd(0xa9))});return{'ok':!![],'data':{'config':_0x1904ce},'message':_0x36512a['bool']('reveal')?_0x35f3dd(0xaf)+_0x57cf1a+_0x35f3dd(0xab):_0x35f3dd(0xaf)+_0x57cf1a+_0x35f3dd(0x98)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a25_0x575f(_0xbe31f3,_0x309500){_0xbe31f3=_0xbe31f3-0x173;const _0x8abf4=a25_0x8abf();let _0x575f66=_0x8abf4[_0xbe31f3];return _0x575f66;}(function(_0x51643d,_0x3ca9b0){const _0x495b51=a25_0x575f,_0x27f689=_0x51643d();while(!![]){try{const _0x32ac11=-parseInt(_0x495b51(0x173))/0x1+parseInt(_0x495b51(0x176))/0x2+-parseInt(_0x495b51(0x175))/0x3*(-parseInt(_0x495b51(0x17c))/0x4)+-parseInt(_0x495b51(0x178))/0x5+-parseInt(_0x495b51(0x17b))/0x6+-parseInt(_0x495b51(0x179))/0x7*(parseInt(_0x495b51(0x174))/0x8)+parseInt(_0x495b51(0x17a))/0x9*(parseInt(_0x495b51(0x177))/0xa);if(_0x32ac11===_0x3ca9b0)break;else _0x27f689['push'](_0x27f689['shift']());}catch(_0x334b32){_0x27f689['push'](_0x27f689['shift']());}}}(a25_0x8abf,0xa78c0));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 a25_0x8abf(){const _0x5e381d=['614197jWyVsV','61112msLfvY','16557NOSDTL','932264VXrjsb','7340tPBfeF','1089030AHuAqA','287yfnvzJ','16956tBBNyv','1131618kwWSOR','124GETQbq'];a25_0x8abf=function(){return _0x5e381d;};return a25_0x8abf();}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a26_0x5971(){const _0xb7dc1f=['key','601134NspiRj','780051bZvkQt','1PiZCoJ','appCode','length','string','564568DGiMTV','Filter\x20by\x20exact\x20config\x20key','328RCeCMD','read','14sbnEuo','2709948URzflm','list','map','250WcVWKK','Found\x20','trim','86823oJFraG','4sxIwhK','306805VIHmci','str','62217VvCHaZ','13wYHhGB'];a26_0x5971=function(){return _0xb7dc1f;};return a26_0x5971();}const a26_0x359ee3=a26_0x41fa;(function(_0x125f5d,_0xd2ee87){const _0x5412eb=a26_0x41fa,_0x180e31=_0x125f5d();while(!![]){try{const _0x4b7659=parseInt(_0x5412eb(0x1f8))/0x1*(parseInt(_0x5412eb(0x1fc))/0x2)+parseInt(_0x5412eb(0x1f7))/0x3*(-parseInt(_0x5412eb(0x208))/0x4)+parseInt(_0x5412eb(0x1f1))/0x5+-parseInt(_0x5412eb(0x1f6))/0x6*(-parseInt(_0x5412eb(0x200))/0x7)+-parseInt(_0x5412eb(0x1fe))/0x8*(-parseInt(_0x5412eb(0x1f3))/0x9)+parseInt(_0x5412eb(0x204))/0xa*(-parseInt(_0x5412eb(0x207))/0xb)+parseInt(_0x5412eb(0x201))/0xc*(-parseInt(_0x5412eb(0x1f4))/0xd);if(_0x4b7659===_0xd2ee87)break;else _0x180e31['push'](_0x180e31['shift']());}catch(_0x18c796){_0x180e31['push'](_0x180e31['shift']());}}}(a26_0x5971,0x2339d));import{listAppConfigs}from'../../core/api-client.js';function a26_0x41fa(_0x4761ed,_0xe5de09){_0x4761ed=_0x4761ed-0x1f1;const _0x597132=a26_0x5971();let _0x41fa33=_0x597132[_0x4761ed];return _0x41fa33;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':'app-config','command':a26_0x359ee3(0x202),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':a26_0x359ee3(0x1ff),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x359ee3(0x1f5),'type':a26_0x359ee3(0x1fb),'description':a26_0x359ee3(0x1fd)},TAGS_FLAG],async 'validate'(_0x5f1c28){const _0x5870ef=a26_0x359ee3,_0x42ee24=_0x5f1c28[_0x5870ef(0x1f2)](_0x5870ef(0x1f5))[_0x5870ef(0x206)]();if(_0x42ee24)validateKey(_0x42ee24);readOptionalTags(_0x5f1c28);},async 'execute'(_0x1e1bd1){const _0x41fe42=a26_0x359ee3,_0x4d5a74=_0x1e1bd1[_0x41fe42(0x1f2)]('key')[_0x41fe42(0x206)]()||undefined,_0x56b2c1=readOptionalTags(_0x1e1bd1),_0x5a34b0=await withAppConfigApiBoundary(_0x41fe42(0x202),{'appCode':_0x1e1bd1['appCode']},()=>listAppConfigs(_0x1e1bd1[_0x41fe42(0x1f9)],{'key':_0x4d5a74,'tags':_0x56b2c1})),_0x5cd41a=_0x5a34b0[_0x41fe42(0x203)](_0x4d3ba3=>projectAppConfig(_0x4d3ba3));return{'ok':!![],'data':{'appCode':_0x1e1bd1[_0x41fe42(0x1f9)],'count':_0x5cd41a[_0x41fe42(0x1fa)],'configs':_0x5cd41a},'message':_0x41fe42(0x205)+_0x5cd41a[_0x41fe42(0x1fa)]+'\x20app\x20config(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x3ee6ab=a27_0xb0b6;(function(_0x298ea5,_0x38c37c){const _0x46ce37=a27_0xb0b6,_0x3f82a8=_0x298ea5();while(!![]){try{const _0x52ea52=-parseInt(_0x46ce37(0xa2))/0x1+parseInt(_0x46ce37(0x8e))/0x2*(parseInt(_0x46ce37(0x91))/0x3)+-parseInt(_0x46ce37(0x9b))/0x4*(-parseInt(_0x46ce37(0x95))/0x5)+-parseInt(_0x46ce37(0x8d))/0x6+-parseInt(_0x46ce37(0x98))/0x7*(-parseInt(_0x46ce37(0x99))/0x8)+-parseInt(_0x46ce37(0x89))/0x9*(-parseInt(_0x46ce37(0x9e))/0xa)+-parseInt(_0x46ce37(0x92))/0xb*(parseInt(_0x46ce37(0x9a))/0xc);if(_0x52ea52===_0x38c37c)break;else _0x3f82a8['push'](_0x3f82a8['shift']());}catch(_0x5db083){_0x3f82a8['push'](_0x3f82a8['shift']());}}}(a27_0x3005,0xa4cf7));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a27_0xb0b6(_0x5748a1,_0xc72a24){_0x5748a1=_0x5748a1-0x85;const _0x300555=a27_0x3005();let _0xb0b617=_0x300555[_0x5748a1];return _0xb0b617;}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='/smartapi/app-config/create',UPDATE_PATH=a27_0x3ee6ab(0x8c);export const appConfigSet={'service':a27_0x3ee6ab(0x85),'command':a27_0x3ee6ab(0x8f),'description':a27_0x3ee6ab(0x9d),'risk':a27_0x3ee6ab(0x97),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x3ee6ab(0x90),'type':a27_0x3ee6ab(0x88),'description':a27_0x3ee6ab(0x8b)}],async 'validate'(_0x47f02a){readKeyArg(_0x47f02a),readOptionalTags(_0x47f02a),assertSingleValueSource(_0x47f02a);},async 'dryRun'(_0x1ce813){const _0x280fee=a27_0x3ee6ab,_0x13d074=readKeyArg(_0x1ce813),_0x494357=readOptionalTags(_0x1ce813),_0x5c485b=assertSingleValueSource(_0x1ce813);await assertValueSourceReadable(_0x5c485b);const _0x35203f=await withAppConfigApiBoundary(_0x280fee(0x86),{'appCode':_0x1ce813[_0x280fee(0x96)],'key':_0x13d074},()=>getAppConfigByKey(_0x1ce813[_0x280fee(0x96)],_0x13d074)),_0xab3cc=_0x35203f?_0x280fee(0x93):_0x280fee(0xa0),_0x3fcef7=_0x35203f?projectAppConfig(_0x35203f):null,_0x124768=plannedAppConfig({'appCode':_0x1ce813[_0x280fee(0x96)],'key':_0x13d074,'tags':_0x494357??_0x35203f?.[_0x280fee(0x94)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xab3cc,'appCode':_0x1ce813[_0x280fee(0x96)],'key':_0x13d074,'before':_0x3fcef7,'after':_0x124768,'dryRun':!![]}),{'method':_0x280fee(0xa1),'url':_0xab3cc==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x48693e){const _0x30ff68=a27_0x3ee6ab,_0x4c65f1=readKeyArg(_0x48693e),_0xc1efb2=readOptionalTags(_0x48693e),_0x2b1557=await withAppConfigApiBoundary(_0x30ff68(0x86),{'appCode':_0x48693e[_0x30ff68(0x96)],'key':_0x4c65f1},()=>getAppConfigByKey(_0x48693e[_0x30ff68(0x96)],_0x4c65f1)),_0x1d3094=_0x2b1557?projectAppConfig(_0x2b1557):null,_0x1d7fa6=_0x2b1557?_0x30ff68(0x93):_0x30ff68(0xa0),{value:_0x4817d6,warnings:_0x264238}=await readAppConfigValue(_0x48693e),_0x44838e={'appCode':_0x48693e[_0x30ff68(0x96)],'key':_0x4c65f1,'value':_0x4817d6,'tags':_0xc1efb2??_0x2b1557?.['tags']??undefined};await withAppConfigApiBoundary(_0x1d7fa6,{'appCode':_0x48693e['appCode'],'key':_0x4c65f1},async()=>{_0x2b1557?await updateAppConfig({..._0x44838e,'id':requireAppConfigId(_0x2b1557,_0x4c65f1,_0x48693e['appCode'])}):await createAppConfig(_0x44838e);});const _0x494e39=await withAppConfigApiBoundary('get',{'appCode':_0x48693e[_0x30ff68(0x96)],'key':_0x4c65f1},()=>getAppConfigByKey(_0x48693e[_0x30ff68(0x96)],_0x4c65f1)),_0x519f1b=_0x494e39?projectAppConfig(_0x494e39):plannedAppConfig({'appCode':_0x48693e[_0x30ff68(0x96)],'key':_0x4c65f1,'tags':_0x44838e[_0x30ff68(0x94)],'hasValue':_0x4817d6!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x1d7fa6,'appCode':_0x48693e[_0x30ff68(0x96)],'key':_0x4c65f1,'before':_0x1d3094,'after':_0x519f1b,'dryRun':![],'warnings':_0x264238}),'message':(_0x1d7fa6===_0x30ff68(0x93)?_0x30ff68(0x8a):'Created')+'\x20app\x20config\x20'+_0x4c65f1};}};function requireAppConfigId(_0x3d8c2f,_0x3a65e1,_0x57bbde){const _0x29a75e=a27_0x3ee6ab;if(typeof _0x3d8c2f['id']==='number'&&Number[_0x29a75e(0x87)](_0x3d8c2f['id'])&&_0x3d8c2f['id']>0x0)return _0x3d8c2f['id'];throw CliErrors[_0x29a75e(0xa3)](_0x29a75e(0x9f)+_0x3a65e1+_0x29a75e(0x9c)+_0x57bbde);}function a27_0x3005(){const _0xf0c5d4=['7ICglad','7909000bTCarq','156EjAbLh','24472hlqUES',',\x20appCode=','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','6201990QGdrXK','App\x20config\x20server\x20id\x20missing\x20for\x20key=','create','POST','821200XORPwy','apiError','app-config','get','isFinite','string','9uQqlkq','Updated','Read\x20config\x20value\x20from\x20file','/smartapi/app-config/update','4660002Gaqbqw','30SgkCQw','set','file','259002fvqNIA','1248236ZvpXHV','update','tags','690YSyLiz','appCode','high-risk-write'];a27_0x3005=function(){return _0xf0c5d4;};return a27_0x3005();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x570d2e=a28_0x97b0;(function(_0x5acf81,_0x2409c0){const _0x1d7202=a28_0x97b0,_0x53e9eb=_0x5acf81();while(!![]){try{const _0x38e02c=parseInt(_0x1d7202(0x79))/0x1*(parseInt(_0x1d7202(0xb8))/0x2)+parseInt(_0x1d7202(0x98))/0x3*(parseInt(_0x1d7202(0xb5))/0x4)+parseInt(_0x1d7202(0x9a))/0x5*(parseInt(_0x1d7202(0xb4))/0x6)+-parseInt(_0x1d7202(0x93))/0x7+parseInt(_0x1d7202(0x96))/0x8*(-parseInt(_0x1d7202(0xb6))/0x9)+parseInt(_0x1d7202(0x95))/0xa+-parseInt(_0x1d7202(0xa5))/0xb;if(_0x38e02c===_0x2409c0)break;else _0x53e9eb['push'](_0x53e9eb['shift']());}catch(_0x5d4a7f){_0x53e9eb['push'](_0x53e9eb['shift']());}}}(a28_0x4de2,0x8810c));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a28_0x570d2e(0x82),'required':!![]};export const VALUE_ARG={'name':'value','description':a28_0x570d2e(0xaf),'required':![]};export const TAGS_FLAG={'name':a28_0x570d2e(0x87),'type':a28_0x570d2e(0xb9),'description':a28_0x570d2e(0x94)};export const STDIN_FLAG={'name':a28_0x570d2e(0x88),'type':a28_0x570d2e(0xa1),'description':a28_0x570d2e(0x8a),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x570d2e(0x8c),'type':'string','description':a28_0x570d2e(0xb1)};export const REVEAL_FLAG={'name':a28_0x570d2e(0xad),'type':'boolean','description':a28_0x570d2e(0x97),'default':![]};export function readKeyArg(_0x2c0dd1){const _0x3287aa=a28_0x570d2e,_0x40d246=_0x2c0dd1['args'][0x0]?.[_0x3287aa(0xba)]()??'';return validateKey(_0x40d246),_0x40d246;}function a28_0x4de2(){const _0x6872bd=['\x20app\x20config.','boolean','warnings','bool','value','208747kfwlKx','valueRedacted','defineProperties','env','Failed\x20to\x20','path','Missing\x20app-config\x20key.','gmtCreate','reveal','validation','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Environment\x20variable\x20is\x20not\x20set:\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','flag','end','252AalKUA','144drrdRf','15858DpbfzJ','file','2558EMpRKw','string','trim','appCode','App\x20config\x20value\x20source\x20is\x20ambiguous.','854lXCLvD','method','str','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','length','key:\x20','gmtModified','push','kind','Runtime\x20app-config\x20key','setEncoding','operation','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','url','tags','stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Read\x20config\x20value\x20from\x20stdin','Missing\x20app-config\x20value\x20source.','from-env','value\x20is\x20redacted','dryRun','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','utf8','argument','key','5910604eUmLbn','Config\x20tags\x20for\x20filtering/display\x20metadata','9487090wuRbyH','4064JtGaDw','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','5508FJMCdP','data','24845aeaPGG','hasValue','name','Value\x20file\x20is\x20not\x20readable:\x20','args','once'];a28_0x4de2=function(){return _0x6872bd;};return a28_0x4de2();}export function readOptionalTags(_0x4323f8){const _0x1c005a=a28_0x570d2e,_0x38ecb7=_0x4323f8[_0x1c005a(0x7b)](_0x1c005a(0x87))[_0x1c005a(0xba)]();if(!_0x38ecb7)return undefined;if(_0x38ecb7[_0x1c005a(0x7d)]>0x20)throw CliErrors[_0x1c005a(0xae)](_0x1c005a(0x7c));return _0x38ecb7;}export function validateKey(_0x25094f){const _0x5e802a=a28_0x570d2e;if(!_0x25094f)throw CliErrors[_0x5e802a(0xae)](_0x5e802a(0xab));if(_0x25094f[_0x5e802a(0x7d)]>0x100)throw CliErrors[_0x5e802a(0xae)](_0x5e802a(0x8f));}function a28_0x97b0(_0x580728,_0x213fcc){_0x580728=_0x580728-0x77;const _0x4de2de=a28_0x4de2();let _0x97b00b=_0x4de2de[_0x580728];return _0x97b00b;}export function projectAppConfig(_0x3ead4f,_0x35038b){const _0x244fd2=a28_0x570d2e,_0x165bfb=_0x3ead4f[_0x244fd2(0xa4)]!==undefined&&_0x3ead4f[_0x244fd2(0xa4)]!==null&&_0x3ead4f['value']!=='',_0x55753b={'appCode':_0x3ead4f[_0x244fd2(0x77)],'key':_0x3ead4f[_0x244fd2(0x92)],'tags':_0x3ead4f[_0x244fd2(0x87)]??undefined,'hasValue':_0x165bfb,'valueRedacted':_0x165bfb&&!_0x35038b?.[_0x244fd2(0xad)],'gmtCreate':_0x3ead4f[_0x244fd2(0xac)],'gmtModified':_0x3ead4f[_0x244fd2(0x7f)]};return _0x35038b?.[_0x244fd2(0xad)]&&(_0x55753b[_0x244fd2(0xa4)]=_0x3ead4f[_0x244fd2(0xa4)]??'',_0x55753b[_0x244fd2(0xa6)]=![]),_0x55753b;}export function plannedAppConfig(_0x4a6b80){const _0x8ffc15=a28_0x570d2e,_0x2c111d=_0x4a6b80[_0x8ffc15(0x9b)]??!![];return{'appCode':_0x4a6b80[_0x8ffc15(0x77)],'key':_0x4a6b80[_0x8ffc15(0x92)],'tags':_0x4a6b80[_0x8ffc15(0x87)]??undefined,'hasValue':_0x2c111d,'valueRedacted':_0x2c111d};}export function buildMutationData(_0x46dd66){const _0x3bf67f=a28_0x570d2e;return{'operation':_0x46dd66[_0x3bf67f(0x84)],'selector':{'appCode':_0x46dd66[_0x3bf67f(0x77)],'key':_0x46dd66[_0x3bf67f(0x92)]},'before':_0x46dd66['before'],'after':_0x46dd66['after'],'dryRun':_0x46dd66[_0x3bf67f(0x8e)],'warnings':_0x46dd66[_0x3bf67f(0xa2)]??[]};}export async function withAppConfigApiBoundary(_0x53be6b,_0x250510,_0x3e73ae){const _0x34cbb5=a28_0x570d2e;try{return await _0x3e73ae();}catch{const _0x3af774=['appCode:\x20'+_0x250510['appCode']];if(_0x250510[_0x34cbb5(0x92)])_0x3af774[_0x34cbb5(0x80)](_0x34cbb5(0x7e)+_0x250510['key']);_0x3af774['push'](_0x34cbb5(0x8d));throw CliErrors['apiError'](_0x34cbb5(0xa9)+_0x53be6b+_0x34cbb5(0xa0),_0x3af774['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4d6219,_0x1202ff){const _0x29d0f1=a28_0x570d2e;return Object[_0x29d0f1(0xa7)](_0x4d6219,{'method':{'value':_0x1202ff[_0x29d0f1(0x7a)],'enumerable':![]},'url':{'value':_0x1202ff[_0x29d0f1(0x86)],'enumerable':![]}});}export function assertSingleValueSource(_0x54509a){const _0x453659=a28_0x570d2e,_0x49e7f0=[];_0x54509a[_0x453659(0x9e)]['length']>0x1&&_0x49e7f0[_0x453659(0x80)]({'kind':'argument','value':_0x54509a[_0x453659(0x9e)]['slice'](0x1)['join']('\x20')});const _0x2bc1bd=_0x54509a[_0x453659(0xb2)](_0x453659(0xa4));_0x2bc1bd!==undefined&&_0x2bc1bd!==null&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0x91),'value':String(_0x2bc1bd)});_0x54509a[_0x453659(0xa3)](_0x453659(0x88))&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0x88)});const _0xac0f0e=_0x54509a['str'](_0x453659(0x8c))['trim']();_0xac0f0e&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0xa8),'name':_0xac0f0e});const _0x43b13f=_0x54509a[_0x453659(0x7b)](_0x453659(0xb7))[_0x453659(0xba)]();_0x43b13f&&_0x49e7f0[_0x453659(0x80)]({'kind':_0x453659(0xb7),'path':_0x43b13f});if(_0x49e7f0['length']===0x0)throw CliErrors[_0x453659(0xae)](_0x453659(0x8b),_0x453659(0x89));if(_0x49e7f0[_0x453659(0x7d)]>0x1)throw CliErrors[_0x453659(0xae)](_0x453659(0x78),_0x453659(0x85));return _0x49e7f0[0x0];}export async function assertValueSourceReadable(_0x1e053e){const _0x3970cb=a28_0x570d2e;if(_0x1e053e[_0x3970cb(0x81)]===_0x3970cb(0xa8)&&!(_0x1e053e['name']in process.env))throw CliErrors[_0x3970cb(0xae)](_0x3970cb(0xb0)+_0x1e053e[_0x3970cb(0x9c)]);if(_0x1e053e[_0x3970cb(0x81)]===_0x3970cb(0xb7))try{await access(_0x1e053e[_0x3970cb(0xaa)]);}catch{throw CliErrors[_0x3970cb(0xae)](_0x3970cb(0x9d)+_0x1e053e['path']);}}export async function readAppConfigValue(_0x1f5f26){const _0x1b45ec=a28_0x570d2e,_0x1b9948=assertSingleValueSource(_0x1f5f26),_0x41ec6e=[];if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0x91))return _0x41ec6e['push']('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x1b9948[_0x1b45ec(0xa4)]??'','source':_0x1b9948['kind'],'warnings':_0x41ec6e};if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0x88))return{'value':await readStdin(),'source':_0x1b9948['kind'],'warnings':_0x41ec6e};if(_0x1b9948[_0x1b45ec(0x81)]===_0x1b45ec(0xa8)){if(!(_0x1b9948[_0x1b45ec(0x9c)]in process.env))throw CliErrors[_0x1b45ec(0xae)](_0x1b45ec(0xb0)+_0x1b9948[_0x1b45ec(0x9c)]);return{'value':process.env[_0x1b9948.name]??'','source':_0x1b9948[_0x1b45ec(0x81)],'warnings':_0x41ec6e};}return{'value':await readFile(_0x1b9948[_0x1b45ec(0xaa)],'utf8'),'source':_0x1b9948['kind'],'warnings':_0x41ec6e};}function readStdin(){return new Promise((_0x5a3a38,_0x1c5ed3)=>{const _0x421c4a=a28_0x97b0;let _0x4aa766='';process[_0x421c4a(0x88)][_0x421c4a(0x83)](_0x421c4a(0x90)),process['stdin']['on'](_0x421c4a(0x99),_0x39bb8f=>{_0x4aa766+=_0x39bb8f;}),process[_0x421c4a(0x88)]['once'](_0x421c4a(0xb3),()=>_0x5a3a38(_0x4aa766)),process['stdin'][_0x421c4a(0x9f)]('error',_0x1c5ed3);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0xfb5482=a29_0xa60a;(function(_0x4864df,_0x50167b){const _0x21cfba=a29_0xa60a,_0x146a99=_0x4864df();while(!![]){try{const _0x19d9e5=-parseInt(_0x21cfba(0x119))/0x1*(parseInt(_0x21cfba(0x114))/0x2)+-parseInt(_0x21cfba(0x111))/0x3*(-parseInt(_0x21cfba(0x11e))/0x4)+-parseInt(_0x21cfba(0x115))/0x5+parseInt(_0x21cfba(0x110))/0x6*(-parseInt(_0x21cfba(0x120))/0x7)+parseInt(_0x21cfba(0x10e))/0x8+-parseInt(_0x21cfba(0x10b))/0x9+parseInt(_0x21cfba(0x11b))/0xa;if(_0x19d9e5===_0x50167b)break;else _0x146a99['push'](_0x146a99['shift']());}catch(_0x1008cf){_0x146a99['push'](_0x146a99['shift']());}}}(a29_0x350e,0x67907));function a29_0x350e(){const _0x10db33=['nonInteractive','✓\x20Logged\x20out','read','1346EkYgvZ','yes','13825430Fbzxnl','auth','log','14788sVUMNn','boolean','1186507dbJSMH','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','6280641ufzARy','write','../../auth/auth-server-ui.js','2370160CIslJq','Clear\x20login\x20session','18UsjTfU','171vYBpBr','logout','bool','230jkqNsf','521005zRKfhe'];a29_0x350e=function(){return _0x10db33;};return a29_0x350e();}function a29_0xa60a(_0x3f4a59,_0x314f20){_0x3f4a59=_0x3f4a59-0x10a;const _0x350e10=a29_0x350e();let _0xa60a31=_0x350e10[_0x3f4a59];return _0xa60a31;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':'Login\x20via\x20browser','risk':a29_0xfb5482(0x118),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0xfb5482(0x11a),'type':a29_0xfb5482(0x11f),'description':a29_0xfb5482(0x10a),'default':![]}],async 'execute'(_0x3dc64b){const _0x297ba9=a29_0xfb5482,{runAuthServer:_0x349376}=await import(_0x297ba9(0x10d));return await _0x349376({'autoYes':_0x3dc64b[_0x297ba9(0x113)](_0x297ba9(0x11a)),'nonInteractive':_0x3dc64b[_0x297ba9(0x116)]}),{'ok':!![]};}},{'service':a29_0xfb5482(0x11c),'command':a29_0xfb5482(0x112),'description':a29_0xfb5482(0x10f),'risk':a29_0xfb5482(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x246abb){const _0x2121c5=a29_0xfb5482;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x2121c5(0x117))):console[_0x2121c5(0x11d)](_0x2121c5(0x121)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x102b87=a30_0x143c;function a30_0x143c(_0x13f236,_0x120a18){_0x13f236=_0x13f236-0x178;const _0x57648e=a30_0x5764();let _0x143cde=_0x57648e[_0x13f236];return _0x143cde;}(function(_0x5168d0,_0x1155a5){const _0x2f2e60=a30_0x143c,_0x16a60d=_0x5168d0();while(!![]){try{const _0x51ab7b=parseInt(_0x2f2e60(0x183))/0x1+-parseInt(_0x2f2e60(0x17e))/0x2+-parseInt(_0x2f2e60(0x1d6))/0x3*(parseInt(_0x2f2e60(0x19c))/0x4)+-parseInt(_0x2f2e60(0x1cb))/0x5+-parseInt(_0x2f2e60(0x1ce))/0x6+-parseInt(_0x2f2e60(0x1a1))/0x7*(parseInt(_0x2f2e60(0x1b5))/0x8)+parseInt(_0x2f2e60(0x1c8))/0x9*(parseInt(_0x2f2e60(0x1b2))/0xa);if(_0x51ab7b===_0x1155a5)break;else _0x16a60d['push'](_0x16a60d['shift']());}catch(_0xcf99ea){_0x16a60d['push'](_0x16a60d['shift']());}}}(a30_0x5764,0x51fda));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';function a30_0x5764(){const _0x38e4a9=['alias','COMMON','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Script\x20description','validation','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','ENDPOINT','question','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','create','Select\x20operation\x20type:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','HOOK','parseInt','nonInteractive','stdin','Invalid\x20function\x20name\x20\x22','scriptsRootDir','name','Invalid\x20dataset\x20selection.','910104cMARTT','datasetCode','includes','function-node',']\x20(','28DEKZPT','Operation\x20type\x20(HOOK\x20only)','Function\x20name\x20(valid\x20JS\x20identifier)','join','No\x20datasets\x20found\x20for\x20this\x20app.','HOOK\x20requires\x20alias/operation/node\x20options.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','before','read','Select\x20trigger\x20node:','\x20api\x20pull`\x20to\x20refresh.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','functionNode','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','Operation\x20type\x20\x22','686050PiIQST','.js','entries','1172216epKkjm','apiDir','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','source','File\x20already\x20exists:\x20','bff','operationType','close','operation-type','after','description','datasetcode','\x0a\x20*\x20[脚本名称]\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22\x20not\x20found.\x20','\x22\x20not\x20found\x20for\x20dataset\x20','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','UNKNOWN','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','279FrPQpG','length','string','3316035wbPMXL','Alias\x20\x22','appCode','869190qcFPjG','\x0a\x20*\x20[触发节点]\x20','No\x20api.ts\x20found.\x20Run\x20`','Available:\x20','isInteger','\x20function:\x20','tableName','type','6NdFZgg','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Select\x20dataset:','write','map','str','find','325806QsLcco','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','code','stderr','trim','221214VKXBGP','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','\x22.\x20','TODO:\x20add\x20script\x20description','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'];a30_0x5764=function(){return _0x38e4a9;};return a30_0x5764();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x102b87(0x1ba),'command':a30_0x102b87(0x191),'description':a30_0x102b87(0x1c7),'risk':a30_0x102b87(0x1a9),'flags':[{'name':'type','type':'string','required':!![],'enum':[a30_0x102b87(0x189),a30_0x102b87(0x18e),'HOOK'],'description':'Script\x20type'},{'name':'name','type':a30_0x102b87(0x1ca),'required':!![],'description':a30_0x102b87(0x1a3)},{'name':'description','type':a30_0x102b87(0x1ca),'description':a30_0x102b87(0x18b)},{'name':a30_0x102b87(0x188),'type':a30_0x102b87(0x1ca),'description':a30_0x102b87(0x178)},{'name':a30_0x102b87(0x1c0),'type':a30_0x102b87(0x1ca),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x102b87(0x1bd),'type':a30_0x102b87(0x1ca),'description':a30_0x102b87(0x1a2)},{'name':a30_0x102b87(0x19f),'type':a30_0x102b87(0x1ca),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a30_0x102b87(0x1be)]}],async 'validate'(_0x3952af){const _0x202701=a30_0x102b87,_0x43a092=_0x3952af[_0x202701(0x17c)]('name');if(!isValidBffFunctionName(_0x43a092))throw CliErrors[_0x202701(0x18c)](_0x202701(0x198)+_0x43a092+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x3d024f){const _0xc7f182=a30_0x102b87,_0x1ccdea=loadBffProjectConfig(_0x3d024f[_0xc7f182(0x1cd)]),_0x437bba=_0x3d024f[_0xc7f182(0x17c)](_0xc7f182(0x1d5)),_0x24e1f8=_0x3d024f[_0xc7f182(0x17c)]('name'),_0x4781ef=_0x3d024f['str'](_0xc7f182(0x1bf))||undefined,_0x7699b=_0x437bba===_0xc7f182(0x194)?await resolveHookOptions(_0x1ccdea,_0x3d024f):undefined,_0xb3b62d=buildFilePath(_0x1ccdea,_0x437bba,_0x24e1f8,_0x7699b);if(await fileExists(_0xb3b62d))throw CliErrors[_0xc7f182(0x18c)](_0xc7f182(0x1b9)+_0xb3b62d);await mkdir(dirname(_0xb3b62d),{'recursive':!![]});const _0x16e9b5=generateTemplate(_0x437bba,_0x24e1f8,_0x3d024f[_0xc7f182(0x1cd)],_0x4781ef,_0x7699b);await writeFile(_0xb3b62d,_0x16e9b5,'utf8');const _0x207748={'type':_0x437bba,'name':_0x24e1f8,'path':_0xb3b62d};if(_0x4781ef)_0x207748[_0xc7f182(0x1bf)]=_0x4781ef;if(_0x7699b){if(_0x7699b[_0xc7f182(0x188)])_0x207748[_0xc7f182(0x188)]=_0x7699b[_0xc7f182(0x188)];_0x207748[_0xc7f182(0x19d)]=_0x7699b[_0xc7f182(0x19d)],_0x207748[_0xc7f182(0x1bb)]=_0x7699b[_0xc7f182(0x1bb)],_0x207748[_0xc7f182(0x1ad)]=_0x7699b[_0xc7f182(0x1ad)];}return{'ok':!![],'data':_0x207748,'message':'Created\x20'+_0x437bba+_0xc7f182(0x1d3)+_0x24e1f8};}};async function resolveHookOptions(_0x3e3605,_0x3e84f0){const _0x15fad6=a30_0x102b87,_0xc074ad=loadAliasMap(_0x3e84f0[_0x15fad6(0x1b6)],undefined,resolveApiFilePath(_0x3e84f0['apiDir'],_0x3e84f0['appCode'])),_0x830686=_0xc074ad[_0x15fad6(0x1c9)]>0x0;let _0x58d0e1,_0xcf74ca,_0x14a7f9;const _0x1ec0d4=_0x3e84f0[_0x15fad6(0x17c)]('alias'),_0x5a8e0c=_0x3e84f0[_0x15fad6(0x17c)]('datasetcode');if(_0x1ec0d4){const _0x5ddeab=resolveAlias(_0x3e84f0['apiDir'],_0x1ec0d4,undefined,resolveApiFilePath(_0x3e84f0[_0x15fad6(0x1b6)],_0x3e84f0[_0x15fad6(0x1cd)]));if(!_0x5ddeab){const _0x5d634c=_0x830686?'Available\x20aliases:\x20'+_0xc074ad['map'](_0x2ab6ce=>_0x2ab6ce[_0x15fad6(0x188)])[_0x15fad6(0x1a4)](',\x20'):_0x15fad6(0x1d0)+CLI_BIN_NAME+_0x15fad6(0x1a7);throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x1cc)+_0x1ec0d4+_0x15fad6(0x1c3)+_0x5d634c);}_0x58d0e1=_0x1ec0d4,_0xcf74ca=_0x5ddeab;}else{if(_0x5a8e0c){_0xcf74ca=_0x5a8e0c;const _0x5405ed=_0xc074ad[_0x15fad6(0x17d)](_0x393b74=>_0x393b74[_0x15fad6(0x19d)]===_0x5a8e0c);_0x58d0e1=_0x5405ed?.[_0x15fad6(0x188)];}else{if(_0x3e84f0['nonInteractive'])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x830686){const _0x239c94=_0xc074ad[_0x15fad6(0x17b)](_0xff8819=>_0xff8819[_0x15fad6(0x188)]+'\x20('+_0xff8819[_0x15fad6(0x1d4)]+')'),_0x4040b6=await promptSelect(_0x15fad6(0x179),_0x239c94),_0x4790b4=_0xc074ad[_0x4040b6];if(!_0x4790b4)throw CliErrors[_0x15fad6(0x18c)]('Invalid\x20dataset\x20selection.');_0x58d0e1=_0x4790b4[_0x15fad6(0x188)],_0xcf74ca=_0x4790b4['datasetCode'];}else{const _0x1d23c8=await listDatasets(_0x3e84f0[_0x15fad6(0x1cd)]);if(_0x1d23c8[_0x15fad6(0x1c9)]===0x0)throw CliErrors['validation'](_0x15fad6(0x1a5));const _0x14b55a=_0x1d23c8[_0x15fad6(0x17b)](_0x558726=>_0x558726[_0x15fad6(0x19a)]+'\x20['+(_0x558726[_0x15fad6(0x1b8)]??_0x15fad6(0x1c6))+_0x15fad6(0x1a0)+_0x558726[_0x15fad6(0x180)]+')'),_0x5e0abc=await promptSelect('Select\x20dataset:',_0x14b55a),_0x1a51c1=_0x1d23c8[_0x5e0abc];if(!_0x1a51c1)throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x19b));_0xcf74ca=_0x1a51c1[_0x15fad6(0x180)],_0x58d0e1=undefined;}}}}const _0x1b21b3=await listDatasets(_0x3e84f0[_0x15fad6(0x1cd)]),_0x2b4bb0=_0x1b21b3[_0x15fad6(0x17d)](_0x2e9c65=>_0x2e9c65[_0x15fad6(0x180)]===_0xcf74ca);if(!_0x2b4bb0)throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x1b0)+_0xcf74ca+_0x15fad6(0x185)+(_0x58d0e1?_0x15fad6(0x184)+CLI_BIN_NAME+_0x15fad6(0x1ab):''));_0x14a7f9=_0x2b4bb0['id'];const _0x2a7b5b=_0x58d0e1??_0xcf74ca,_0x4cabcf=await listBffDatasetOperations(_0x3e84f0['appCode'],_0x14a7f9),_0xdfcfbc=_0x4cabcf?Object['keys'](_0x4cabcf):[];if(_0xdfcfbc[_0x15fad6(0x1c9)]===0x0)throw CliErrors[_0x15fad6(0x18c)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x2a7b5b+'.');let _0x45ef16;const _0x2f653e=_0x3e84f0['str'](_0x15fad6(0x1bd));if(_0x2f653e){if(!_0xdfcfbc[_0x15fad6(0x19e)](_0x2f653e))throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x1b1)+_0x2f653e+_0x15fad6(0x1c4)+_0x2a7b5b+'.\x20'+(_0x15fad6(0x1d1)+_0xdfcfbc[_0x15fad6(0x1a4)](',\x20')));_0x45ef16=_0x2f653e;}else{if(_0x3e84f0[_0x15fad6(0x196)])throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x17f));const _0x5670bd=await promptSelect(_0x15fad6(0x192),_0xdfcfbc);_0x45ef16=_0xdfcfbc[_0x5670bd]??_0xdfcfbc[0x0];}let _0x1a910e=normalizeHookFunctionNode(_0x3e84f0[_0x15fad6(0x17c)](_0x15fad6(0x19f)));if(!_0x1a910e){if(_0x3e84f0[_0x15fad6(0x17c)]('function-node'))throw CliErrors[_0x15fad6(0x18c)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x3e84f0['nonInteractive'])throw CliErrors[_0x15fad6(0x18c)](_0x15fad6(0x1ac));const _0x3b0451=await promptSelect(_0x15fad6(0x1aa),[_0x15fad6(0x1a8),'after']);_0x1a910e=[_0x15fad6(0x1a8),_0x15fad6(0x1be)][_0x3b0451]??_0x15fad6(0x1a8);}return{'alias':_0x58d0e1,'datasetCode':_0xcf74ca,'datasetId':_0x14a7f9,'operationType':_0x45ef16,'functionNode':_0x1a910e};}async function promptSelect(_0x1252ef,_0x4560e1){const _0x4fed5e=a30_0x102b87;if(_0x4560e1[_0x4fed5e(0x1c9)]===0x1)return 0x0;for(const [_0x398236,_0x28a103]of _0x4560e1[_0x4fed5e(0x1b4)]()){process['stderr'][_0x4fed5e(0x17a)]('\x20\x20'+(_0x398236+0x1)+'.\x20'+_0x28a103+'\x0a');}const _0x5cf5b9=createInterface({'input':process[_0x4fed5e(0x197)],'output':process[_0x4fed5e(0x181)]});while(!![]){const _0x4052e0=await new Promise(_0x4cb93d=>{const _0x283c5b=_0x4fed5e;_0x5cf5b9[_0x283c5b(0x18f)](_0x1252ef+'\x20',_0x4cb93d);}),_0x451369=Number[_0x4fed5e(0x195)](_0x4052e0['trim'](),0xa);if(Number[_0x4fed5e(0x1d2)](_0x451369)&&_0x451369>=0x1&&_0x451369<=_0x4560e1[_0x4fed5e(0x1c9)])return _0x5cf5b9[_0x4fed5e(0x1bc)](),_0x451369-0x1;process[_0x4fed5e(0x181)][_0x4fed5e(0x17a)](_0x4fed5e(0x193)+_0x4560e1[_0x4fed5e(0x1c9)]+'.\x0a');}}function buildFilePath(_0x56f076,_0x5a730e,_0x3900f8,_0x509991){const _0x1bc53f=a30_0x102b87;if(_0x5a730e===_0x1bc53f(0x194)){if(!_0x509991)throw CliErrors[_0x1bc53f(0x18c)](_0x1bc53f(0x1a6));const _0xf6fb5b=_0x509991[_0x1bc53f(0x188)]??_0x509991['datasetCode'];return join(_0x56f076[_0x1bc53f(0x199)],_0x1bc53f(0x194),_0xf6fb5b,_0x509991[_0x1bc53f(0x1bb)],_0x509991['functionNode'],_0x3900f8+'.js');}return join(_0x56f076['scriptsRootDir'],_0x5a730e,_0x3900f8+_0x1bc53f(0x1b3));}export function generateTemplate(_0x2da1cc,_0x326322,_0x5d2e21,_0x4a9b4e,_0x43ca45){const _0x1ef82f=a30_0x102b87,_0x1c4b1c=_0x4a9b4e?.[_0x1ef82f(0x182)]()||_0x1ef82f(0x186);if(_0x2da1cc===_0x1ef82f(0x189))return _0x1ef82f(0x1c2)+_0x1c4b1c+_0x1ef82f(0x1c1)+_0x326322+_0x1ef82f(0x1ae)+_0x326322+_0x1ef82f(0x187)+_0x326322+_0x1ef82f(0x190);if(_0x2da1cc===_0x1ef82f(0x18e))return _0x1ef82f(0x1b7)+_0x1c4b1c+_0x1ef82f(0x18d)+_0x5d2e21+'/'+_0x326322+_0x1ef82f(0x1c5)+_0x326322+_0x1ef82f(0x190);if(!_0x43ca45)throw CliErrors['validation']('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0x1ef82f(0x1af)+_0x1c4b1c+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x5d2e21+'/'+_0x43ca45[_0x1ef82f(0x19d)]+'/'+_0x43ca45['operationType']+_0x1ef82f(0x1cf)+_0x43ca45[_0x1ef82f(0x1ad)]+_0x1ef82f(0x18a)+_0x326322+_0x1ef82f(0x190);}
|
|
1
|
+
const a30_0x5bb153=a30_0x2ceb;(function(_0x5e0af1,_0x57796f){const _0x3f44bd=a30_0x2ceb,_0x29eadb=_0x5e0af1();while(!![]){try{const _0x42d915=parseInt(_0x3f44bd(0x80))/0x1+parseInt(_0x3f44bd(0xa5))/0x2*(-parseInt(_0x3f44bd(0x81))/0x3)+parseInt(_0x3f44bd(0x8f))/0x4+-parseInt(_0x3f44bd(0xce))/0x5*(parseInt(_0x3f44bd(0xc0))/0x6)+-parseInt(_0x3f44bd(0x9e))/0x7+parseInt(_0x3f44bd(0xa6))/0x8+parseInt(_0x3f44bd(0x72))/0x9*(parseInt(_0x3f44bd(0x7b))/0xa);if(_0x42d915===_0x57796f)break;else _0x29eadb['push'](_0x29eadb['shift']());}catch(_0x430f37){_0x29eadb['push'](_0x29eadb['shift']());}}}(a30_0x3c44,0x4a9c6));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 a30_0x2ceb(_0x3700c1,_0x500db7){_0x3700c1=_0x3700c1-0x72;const _0x3c4441=a30_0x3c44();let _0x2ceb3e=_0x3c4441[_0x3700c1];return _0x2ceb3e;}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a30_0x3c44(){const _0x393467=['/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','3713269UEvTUD','appCode','create','validation','alias','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','apiDir','218YXnxOt','3961352hOPDrt','Select\x20dataset:','function-node','Invalid\x20dataset\x20selection.','datasetcode','str','No\x20api.ts\x20found.\x20Run\x20`','Select\x20operation\x20type:','\x22\x20not\x20found.\x20','find','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','HOOK','string','close','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','before','HOOK\x20requires\x20alias/operation/node\x20options.','write','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Alias\x20\x22','Dataset\x20not\x20found\x20for\x20code\x20\x22','datasetCode','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','isInteger','operation-type','234084kgfnHd','description','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','type','ENDPOINT','scriptsRootDir','File\x20already\x20exists:\x20','keys','includes','\x22.\x20','stderr','nonInteractive','length','join','50DeuaeZ','9LXwZVf','bff',']\x20(','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x20function:\x20','\x0a\x20*\x20[触发节点]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','TODO:\x20add\x20script\x20description','1318310aOKeBi','Function\x20name\x20(valid\x20JS\x20identifier)','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Script\x20description','293898WJWEfr','411mBFqHU','COMMON','map','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Trigger\x20node\x20(HOOK\x20only)','functionNode','trim','\x0a\x20*\x20[脚本名称]\x20','name','Operation\x20type\x20\x22','.js','Invalid\x20function\x20name\x20\x22','parseInt','1280992Dlehqv','after','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','No\x20operation\x20types\x20found\x20for\x20dataset\x20','\x22\x20not\x20found\x20for\x20dataset\x20','utf8','Available:\x20','operationType','Available\x20aliases:\x20','No\x20datasets\x20found\x20for\x20this\x20app.'];a30_0x3c44=function(){return _0x393467;};return a30_0x3c44();}export const bffCreate={'service':a30_0x5bb153(0x73),'command':a30_0x5bb153(0xa0),'description':a30_0x5bb153(0x84),'risk':'read','flags':[{'name':a30_0x5bb153(0xc3),'type':a30_0x5bb153(0xb2),'required':!![],'enum':[a30_0x5bb153(0x82),a30_0x5bb153(0xc4),'HOOK'],'description':'Script\x20type'},{'name':a30_0x5bb153(0x8a),'type':a30_0x5bb153(0xb2),'required':!![],'description':a30_0x5bb153(0x7c)},{'name':a30_0x5bb153(0xc1),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x7f)},{'name':a30_0x5bb153(0xa2),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0xb5)},{'name':a30_0x5bb153(0xaa),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x9d)},{'name':'operation-type','type':a30_0x5bb153(0xb2),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a30_0x5bb153(0xa8),'type':a30_0x5bb153(0xb2),'description':a30_0x5bb153(0x86),'enum':['before',a30_0x5bb153(0x90)]}],async 'validate'(_0x561796){const _0x31d6d4=a30_0x5bb153,_0x337f10=_0x561796[_0x31d6d4(0xab)]('name');if(!isValidBffFunctionName(_0x337f10))throw CliErrors['validation'](_0x31d6d4(0x8d)+_0x337f10+_0x31d6d4(0x93));},async 'execute'(_0x34db0b){const _0x4c082c=a30_0x5bb153,_0x2a2a2f=loadBffProjectConfig(_0x34db0b[_0x4c082c(0x9f)]),_0x5228ae=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0xc3)),_0x5e0635=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0x8a)),_0x17d5d3=_0x34db0b[_0x4c082c(0xab)](_0x4c082c(0xc1))||undefined,_0x136207=_0x5228ae===_0x4c082c(0xb1)?await resolveHookOptions(_0x2a2a2f,_0x34db0b):undefined,_0x457dff=buildFilePath(_0x2a2a2f,_0x5228ae,_0x5e0635,_0x136207);if(await fileExists(_0x457dff))throw CliErrors[_0x4c082c(0xa1)](_0x4c082c(0xc6)+_0x457dff);await mkdir(dirname(_0x457dff),{'recursive':!![]});const _0x265ccd=generateTemplate(_0x5228ae,_0x5e0635,_0x34db0b[_0x4c082c(0x9f)],_0x17d5d3,_0x136207);await writeFile(_0x457dff,_0x265ccd,_0x4c082c(0x97));const _0x3d3765={'type':_0x5228ae,'name':_0x5e0635,'path':_0x457dff};if(_0x17d5d3)_0x3d3765['description']=_0x17d5d3;if(_0x136207){if(_0x136207[_0x4c082c(0xa2)])_0x3d3765[_0x4c082c(0xa2)]=_0x136207[_0x4c082c(0xa2)];_0x3d3765['datasetCode']=_0x136207[_0x4c082c(0xbc)],_0x3d3765[_0x4c082c(0x99)]=_0x136207[_0x4c082c(0x99)],_0x3d3765[_0x4c082c(0x87)]=_0x136207[_0x4c082c(0x87)];}return{'ok':!![],'data':_0x3d3765,'message':'Created\x20'+_0x5228ae+_0x4c082c(0x76)+_0x5e0635};}};async function resolveHookOptions(_0x50504f,_0x3e49f5){const _0x3acff0=a30_0x5bb153,_0x89defe=loadAliasMap(_0x3e49f5['apiDir'],undefined,resolveApiFilePath(_0x3e49f5[_0x3acff0(0xa4)],_0x3e49f5['appCode'])),_0x432ba0=_0x89defe[_0x3acff0(0xcc)]>0x0;let _0x23c660,_0x1681e0,_0x533d25;const _0x36a172=_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xa2)),_0x6bcf91=_0x3e49f5[_0x3acff0(0xab)]('datasetcode');if(_0x36a172){const _0x718b91=resolveAlias(_0x3e49f5[_0x3acff0(0xa4)],_0x36a172,undefined,resolveApiFilePath(_0x3e49f5['apiDir'],_0x3e49f5['appCode']));if(!_0x718b91){const _0x4fa23a=_0x432ba0?_0x3acff0(0x9a)+_0x89defe[_0x3acff0(0x83)](_0x1e6d4a=>_0x1e6d4a[_0x3acff0(0xa2)])[_0x3acff0(0xcd)](',\x20'):_0x3acff0(0xac)+CLI_BIN_NAME+_0x3acff0(0x85);throw CliErrors['validation'](_0x3acff0(0xba)+_0x36a172+_0x3acff0(0xae)+_0x4fa23a);}_0x23c660=_0x36a172,_0x1681e0=_0x718b91;}else{if(_0x6bcf91){_0x1681e0=_0x6bcf91;const _0x4b4b1b=_0x89defe['find'](_0x1f9842=>_0x1f9842['datasetCode']===_0x6bcf91);_0x23c660=_0x4b4b1b?.[_0x3acff0(0xa2)];}else{if(_0x3e49f5['nonInteractive'])throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x79));else{if(_0x432ba0){const _0x3cb5cb=_0x89defe[_0x3acff0(0x83)](_0x2f3079=>_0x2f3079[_0x3acff0(0xa2)]+'\x20('+_0x2f3079['tableName']+')'),_0x57ab8a=await promptSelect(_0x3acff0(0xa7),_0x3cb5cb),_0x4ce7f6=_0x89defe[_0x57ab8a];if(!_0x4ce7f6)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xa9));_0x23c660=_0x4ce7f6[_0x3acff0(0xa2)],_0x1681e0=_0x4ce7f6[_0x3acff0(0xbc)];}else{const _0x594821=await listDatasets(_0x3e49f5[_0x3acff0(0x9f)]);if(_0x594821[_0x3acff0(0xcc)]===0x0)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x9b));const _0x461dc5=_0x594821['map'](_0x2c069b=>_0x2c069b[_0x3acff0(0x8a)]+'\x20['+(_0x2c069b['source']??'UNKNOWN')+_0x3acff0(0x74)+_0x2c069b[_0x3acff0(0x94)]+')'),_0x1da95a=await promptSelect('Select\x20dataset:',_0x461dc5),_0x18252e=_0x594821[_0x1da95a];if(!_0x18252e)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xa9));_0x1681e0=_0x18252e['code'],_0x23c660=undefined;}}}}const _0x10b8c5=await listDatasets(_0x3e49f5[_0x3acff0(0x9f)]),_0x55a2e8=_0x10b8c5[_0x3acff0(0xaf)](_0x18cd19=>_0x18cd19[_0x3acff0(0x94)]===_0x1681e0);if(!_0x55a2e8)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0xbb)+_0x1681e0+_0x3acff0(0xc9)+(_0x23c660?_0x3acff0(0xbd)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x533d25=_0x55a2e8['id'];const _0x55a915=_0x23c660??_0x1681e0,_0x39196f=await listBffDatasetOperations(_0x3e49f5[_0x3acff0(0x9f)],_0x533d25),_0x1f7d50=_0x39196f?Object[_0x3acff0(0xc7)](_0x39196f):[];if(_0x1f7d50[_0x3acff0(0xcc)]===0x0)throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x95)+_0x55a915+'.');let _0x14ae8a;const _0x3f404c=_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xbf));if(_0x3f404c){if(!_0x1f7d50[_0x3acff0(0xc8)](_0x3f404c))throw CliErrors['validation'](_0x3acff0(0x8b)+_0x3f404c+_0x3acff0(0x96)+_0x55a915+'.\x20'+(_0x3acff0(0x98)+_0x1f7d50['join'](',\x20')));_0x14ae8a=_0x3f404c;}else{if(_0x3e49f5[_0x3acff0(0xcb)])throw CliErrors[_0x3acff0(0xa1)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x554aa9=await promptSelect(_0x3acff0(0xad),_0x1f7d50);_0x14ae8a=_0x1f7d50[_0x554aa9]??_0x1f7d50[0x0];}let _0x63158b=normalizeHookFunctionNode(_0x3e49f5[_0x3acff0(0xab)](_0x3acff0(0xa8)));if(!_0x63158b){if(_0x3e49f5[_0x3acff0(0xab)]('function-node'))throw CliErrors['validation'](_0x3acff0(0xb9));if(_0x3e49f5['nonInteractive'])throw CliErrors[_0x3acff0(0xa1)](_0x3acff0(0x75));const _0x361d7b=await promptSelect('Select\x20trigger\x20node:',[_0x3acff0(0xb6),_0x3acff0(0x90)]);_0x63158b=[_0x3acff0(0xb6),_0x3acff0(0x90)][_0x361d7b]??_0x3acff0(0xb6);}return{'alias':_0x23c660,'datasetCode':_0x1681e0,'datasetId':_0x533d25,'operationType':_0x14ae8a,'functionNode':_0x63158b};}async function promptSelect(_0x362896,_0x41ae10){const _0x956f74=a30_0x5bb153;if(_0x41ae10['length']===0x1)return 0x0;for(const [_0x1f5f03,_0x52aceb]of _0x41ae10['entries']()){process['stderr'][_0x956f74(0xb8)]('\x20\x20'+(_0x1f5f03+0x1)+'.\x20'+_0x52aceb+'\x0a');}const _0x228d74=createInterface({'input':process['stdin'],'output':process[_0x956f74(0xca)]});while(!![]){const _0x442132=await new Promise(_0x5a38ec=>{_0x228d74['question'](_0x362896+'\x20',_0x5a38ec);}),_0xee749a=Number[_0x956f74(0x8e)](_0x442132[_0x956f74(0x88)](),0xa);if(Number[_0x956f74(0xbe)](_0xee749a)&&_0xee749a>=0x1&&_0xee749a<=_0x41ae10[_0x956f74(0xcc)])return _0x228d74[_0x956f74(0xb3)](),_0xee749a-0x1;process[_0x956f74(0xca)][_0x956f74(0xb8)](_0x956f74(0x78)+_0x41ae10['length']+'.\x0a');}}function buildFilePath(_0x2128b4,_0x567ed6,_0x1f6ab3,_0x2a3f01){const _0x10feee=a30_0x5bb153;if(_0x567ed6===_0x10feee(0xb1)){if(!_0x2a3f01)throw CliErrors[_0x10feee(0xa1)](_0x10feee(0xb7));const _0x4dfb33=_0x2a3f01[_0x10feee(0xa2)]??_0x2a3f01[_0x10feee(0xbc)];return join(_0x2128b4[_0x10feee(0xc5)],'HOOK',_0x4dfb33,_0x2a3f01['operationType'],_0x2a3f01[_0x10feee(0x87)],_0x1f6ab3+'.js');}return join(_0x2128b4['scriptsRootDir'],_0x567ed6,_0x1f6ab3+_0x10feee(0x8c));}export function generateTemplate(_0x5cad57,_0x3542ee,_0x74fa17,_0x2a3a6d,_0x379ef4){const _0x4743f8=a30_0x5bb153,_0x465a90=_0x2a3a6d?.[_0x4743f8(0x88)]()||_0x4743f8(0x7a);if(_0x5cad57===_0x4743f8(0x82))return _0x4743f8(0x9c)+_0x465a90+_0x4743f8(0x89)+_0x3542ee+_0x4743f8(0x7e)+_0x3542ee+_0x4743f8(0xb0)+_0x3542ee+_0x4743f8(0x7d);if(_0x5cad57===_0x4743f8(0xc4))return _0x4743f8(0xc2)+_0x465a90+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x74fa17+'/'+_0x3542ee+_0x4743f8(0xa3)+_0x3542ee+_0x4743f8(0x7d);if(!_0x379ef4)throw CliErrors[_0x4743f8(0xa1)](_0x4743f8(0xb4));return _0x4743f8(0x92)+_0x465a90+_0x4743f8(0x91)+_0x74fa17+'/'+_0x379ef4[_0x4743f8(0xbc)]+'/'+_0x379ef4[_0x4743f8(0x99)]+_0x4743f8(0x77)+_0x379ef4[_0x4743f8(0x87)]+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x3542ee+_0x4743f8(0x7d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x41e935=a31_0x5185;(function(_0x224397,_0x3dd9b2){const _0x4a9b90=a31_0x5185,_0x219250=_0x224397();while(!![]){try{const _0x2531d0=-parseInt(_0x4a9b90(0xe9))/0x1*(-parseInt(_0x4a9b90(0xe6))/0x2)+-parseInt(_0x4a9b90(0xbf))/0x3+parseInt(_0x4a9b90(0xc4))/0x4+-parseInt(_0x4a9b90(0xe3))/0x5+parseInt(_0x4a9b90(0xcc))/0x6+-parseInt(_0x4a9b90(0xd3))/0x7*(-parseInt(_0x4a9b90(0xde))/0x8)+-parseInt(_0x4a9b90(0xe5))/0x9;if(_0x2531d0===_0x3dd9b2)break;else _0x219250['push'](_0x219250['shift']());}catch(_0x4e1504){_0x219250['push'](_0x219250['shift']());}}}(a31_0x4837,0x5df5c));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a31_0x4837(){const _0x55036b=['delete','projectRoot','trashDir','776lGOniQ','/api/management/library/scripts/delete','Deleted\x20','length','parse','2860005VjKkdy','POST','7285140MwlPUj','18yqXVAO','bff','functions','23683UWbyCR','lastSync','keys','trashedTo','BFF\x20lock\x20file\x20not\x20found.','replace','startsWith','str','stringify','remoteId','93432icuNHp','find','high-risk-write','Lock\x20scope\x20for\x20app\x20\x22','join','2413068jIFQzq','apps','lockFilePath','target','No\x20lock\x20entry\x20found\x20for\x20\x22','\x20(local\x20file\x20moved\x20to\x20trash)','<timestamp>','includes','2441448PDFcAo','scriptsRoot','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x22\x20not\x20found\x20after\x20ensureLockScope.','scriptsRootDir','Function\x20not\x20found:\x20','Local\x20delete\x20not\x20settled\x20for\x20','41433WGpPrK','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','toISOString','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','filter','validation','map','appCode'];a31_0x4837=function(){return _0x55036b;};return a31_0x4837();}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';function a31_0x5185(_0x531ec1,_0x40e83b){_0x531ec1=_0x531ec1-0xb8;const _0x48377e=a31_0x4837();let _0x5185ac=_0x48377e[_0x531ec1];return _0x5185ac;}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x41e935(0xe7),'command':a31_0x41e935(0xdb),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x41e935(0xc1),'flags':[{'name':a31_0x41e935(0xc7),'type':'string','required':!![],'description':a31_0x41e935(0xd6)}],async 'validate'(_0x577ef0){const _0x5663ee=a31_0x41e935,_0x50b5ae=loadBffProjectConfig(_0x577ef0['appCode']),_0x4ebb69=await readBffLockFile(_0x50b5ae[_0x5663ee(0xc6)]);if(!_0x4ebb69)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x382f58){const _0x8eab02=a31_0x41e935,_0x561bcd=loadBffProjectConfig(_0x382f58[_0x8eab02(0xda)]),_0x235278=await readBffLockFile(_0x561bcd[_0x8eab02(0xc6)]);if(!_0x235278)throw CliErrors[_0x8eab02(0xd8)]('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x12229d}=ensureLockScope(_0x235278,_0x382f58[_0x8eab02(0xda)],_0x561bcd[_0x8eab02(0xcd)],'delete'),_0x4a84ac=_0x382f58[_0x8eab02(0xbc)](_0x8eab02(0xc7)),_0x5b5eb6=Object[_0x8eab02(0xeb)](_0x12229d['functions']),_0x4821ce=resolveDeleteTarget(_0x4a84ac,_0x5b5eb6),_0x115757=_0x12229d['functions'][_0x4821ce];if(!_0x115757)throw CliErrors[_0x8eab02(0xd8)](_0x8eab02(0xc8)+_0x4821ce+'\x22.');const _0x31e25f=resolveLocalFilePathFromLockKey(_0x561bcd,_0x4821ce),_0x433dcb=relative(_0x561bcd[_0x8eab02(0xdc)],_0x31e25f),_0x39d5f2=join(_0x561bcd['trashDir'],_0x8eab02(0xca),_0x433dcb);return{'method':_0x8eab02(0xe4),'url':_0x8eab02(0xdf),'body':{'appCode':_0x382f58['appCode'],'target':_0x4821ce,'remoteId':_0x115757[_0x8eab02(0xbe)],'localFilePath':_0x31e25f,'trashedPath':_0x39d5f2},'description':'Would\x20delete\x20'+_0x4821ce+_0x8eab02(0xd4)};},async 'execute'(_0x18d02a){const _0x4b1159=a31_0x41e935,_0x31ddf7=loadBffProjectConfig(_0x18d02a[_0x4b1159(0xda)]),_0x8f01bf=await readBffLockFile(_0x31ddf7[_0x4b1159(0xc6)]);if(!_0x8f01bf)throw CliErrors[_0x4b1159(0xd8)](_0x4b1159(0xb9));const {lockData:_0x4c8835,appLock:_0x2b1813}=ensureLockScope(_0x8f01bf,_0x18d02a[_0x4b1159(0xda)],_0x31ddf7['scriptsRoot'],_0x4b1159(0xdb)),_0x31cdb8=JSON[_0x4b1159(0xe2)](JSON[_0x4b1159(0xbd)](_0x4c8835)),_0x4647bc=_0x31cdb8['apps'][_0x18d02a[_0x4b1159(0xda)]];if(!_0x4647bc)throw new Error(_0x4b1159(0xc2)+_0x18d02a[_0x4b1159(0xda)]+_0x4b1159(0xcf));const _0x1d2e83=_0x18d02a[_0x4b1159(0xbc)](_0x4b1159(0xc7)),_0x34aeb7=Object[_0x4b1159(0xeb)](_0x4647bc[_0x4b1159(0xe8)]),_0x83c984=resolveDeleteTarget(_0x1d2e83,_0x34aeb7),_0x163424=_0x4647bc[_0x4b1159(0xe8)][_0x83c984];if(!_0x163424)throw CliErrors[_0x4b1159(0xd8)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x83c984+'\x22.');await deleteBffScript(_0x163424[_0x4b1159(0xbe)]),delete _0x4647bc[_0x4b1159(0xe8)][_0x83c984],_0x4647bc[_0x4b1159(0xea)]=new Date()['toISOString'](),await writeBffLockFile(_0x31ddf7['lockFilePath'],_0x31cdb8);const _0x45ba9c=resolveLocalFilePathFromLockKey(_0x31ddf7,_0x83c984);let _0x86715;await fileExists(_0x45ba9c)&&(_0x86715=await moveToTrash(_0x31ddf7[_0x4b1159(0xdc)],_0x31ddf7[_0x4b1159(0xdd)],_0x45ba9c),await cleanupEmptyDirectories(dirname(_0x45ba9c),_0x31ddf7[_0x4b1159(0xd0)]));await waitForDeleteSettlement(_0x31ddf7['lockFilePath'],_0x18d02a[_0x4b1159(0xda)],_0x83c984,_0x45ba9c),await sleep(0x96);const _0x47eb37={'deleted':_0x83c984,'remoteId':_0x163424['remoteId']};if(_0x86715)_0x47eb37[_0x4b1159(0xb8)]=_0x86715;return{'ok':!![],'data':_0x47eb37,'message':_0x4b1159(0xe0)+_0x83c984+(_0x86715?_0x4b1159(0xc9):'')};}};function resolveDeleteTarget(_0x207389,_0x560d48){const _0x3d55d6=a31_0x41e935;if(_0x207389[_0x3d55d6(0xcb)]('/')){const _0x4bbb55=_0x560d48[_0x3d55d6(0xc0)](_0x4afef4=>_0x4afef4===_0x207389);if(!_0x4bbb55)throw CliErrors['validation'](_0x3d55d6(0xd1)+_0x207389);return _0x4bbb55;}const _0x4e50bd=_0x560d48[_0x3d55d6(0xd7)](_0x11ef7b=>_0x11ef7b['split']('/')['at'](-0x1)===_0x207389);if(_0x4e50bd[_0x3d55d6(0xe1)]===0x0)throw CliErrors[_0x3d55d6(0xd8)](_0x3d55d6(0xd1)+_0x207389);if(_0x4e50bd['length']>0x1)throw CliErrors[_0x3d55d6(0xd8)]('Multiple\x20functions\x20match\x20\x22'+_0x207389+_0x3d55d6(0xce)+_0x4e50bd[_0x3d55d6(0xd9)](_0x40b8fb=>'\x20\x20-\x20'+_0x40b8fb)[_0x3d55d6(0xc3)]('\x0a'));return _0x4e50bd[0x0];}async function moveToTrash(_0x5bca3c,_0x2b3d86,_0x46027f){const _0x3e8311=a31_0x41e935,_0x40b725=new Date()[_0x3e8311(0xd5)]()[_0x3e8311(0xba)](/[:.]/g,'-'),_0x44dd9e=relative(_0x5bca3c,_0x46027f),_0x59af3d=join(_0x2b3d86,_0x40b725,_0x44dd9e);return await mkdir(dirname(_0x59af3d),{'recursive':!![]}),await rename(_0x46027f,_0x59af3d),_0x59af3d;}async function cleanupEmptyDirectories(_0x3e6ce8,_0x3ea4a4){const _0x4d9bd2=a31_0x41e935;let _0x49f41d=resolve(_0x3e6ce8);const _0x2a4a95=resolve(_0x3ea4a4);while(_0x49f41d[_0x4d9bd2(0xbb)](''+_0x2a4a95+sep)||_0x49f41d===_0x2a4a95){if(_0x49f41d===_0x2a4a95)return;try{const _0x131ebc=await readdir(_0x49f41d);if(_0x131ebc[_0x4d9bd2(0xe1)]>0x0)return;await rmdir(_0x49f41d);}catch{return;}_0x49f41d=dirname(_0x49f41d);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3f7646,_0x4cedbe,_0x26d2bf,_0x4dfa97){const _0x56974e=a31_0x41e935;for(let _0x3f94b2=0x0;_0x3f94b2<DELETE_SETTLE_RETRY_COUNT;_0x3f94b2+=0x1){const _0x4e940f=await readBffLockFile(_0x3f7646),_0x516f82=!!_0x4e940f?.[_0x56974e(0xc5)]?.[_0x4cedbe]?.['functions']?.[_0x26d2bf],_0x2cb427=await fileExists(_0x4dfa97);if(!_0x516f82&&!_0x2cb427)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x56974e(0xd2)+_0x26d2bf+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x9eacc2=a32_0x341f;(function(_0x42921f,_0x40b78a){const _0x82151f=a32_0x341f,_0x4d904e=_0x42921f();while(!![]){try{const _0xa30fd=-parseInt(_0x82151f(0x198))/0x1+-parseInt(_0x82151f(0x18f))/0x2*(parseInt(_0x82151f(0x18a))/0x3)+parseInt(_0x82151f(0x19a))/0x4+parseInt(_0x82151f(0x199))/0x5+-parseInt(_0x82151f(0x18b))/0x6+parseInt(_0x82151f(0x189))/0x7+-parseInt(_0x82151f(0x19f))/0x8*(-parseInt(_0x82151f(0x19d))/0x9);if(_0xa30fd===_0x40b78a)break;else _0x4d904e['push'](_0x4d904e['shift']());}catch(_0x55d7a6){_0x4d904e['push'](_0x4d904e['shift']());}}}(a32_0x2383,0x7c60f));function a32_0x341f(_0x2ea074,_0x14cb4d){_0x2ea074=_0x2ea074-0x189;const _0x238340=a32_0x2383();let _0x341f89=_0x238340[_0x2ea074];return _0x341f89;}import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x2383(){const _0x3ba04f=['2002925yyOknE','118340OCnfhp','Script\x20ID','description','9113733YbFZjI','updatedTime','8XlmdlU','3969126nJaycl','5013wpQlTi','2479062JVytHg','boolean','detail','num','534ZzgNbW','verbose','scriptContent','Return\x20full\x20raw\x20script\x20object','(none)','appCode','bool','scriptType','Get\x20BFF\x20script\x20details\x20by\x20ID','641036FCMeIs'];a32_0x2383=function(){return _0x3ba04f;};return a32_0x2383();}export const bffDetail={'service':'bff','command':a32_0x9eacc2(0x18d),'description':a32_0x9eacc2(0x197),'risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a32_0x9eacc2(0x19b)},{'name':a32_0x9eacc2(0x190),'type':a32_0x9eacc2(0x18c),'description':a32_0x9eacc2(0x192)}],async 'execute'(_0x568ae9){const _0x38f486=a32_0x9eacc2,_0x2ba0fb=await getBffScriptInfo(_0x568ae9[_0x38f486(0x18e)]('id')),_0x18a8db=_0x568ae9[_0x38f486(0x195)](_0x38f486(0x190));if(_0x18a8db)return{'ok':!![],'data':_0x2ba0fb};return{'ok':!![],'data':{'id':_0x2ba0fb['id'],'appCode':_0x2ba0fb[_0x38f486(0x194)],'scriptType':_0x2ba0fb[_0x38f486(0x196)],'description':_0x2ba0fb[_0x38f486(0x19c)]||_0x38f486(0x193),'createdTime':_0x2ba0fb['createdTime']??'','updatedTime':_0x2ba0fb[_0x38f486(0x19e)]??'','scriptContent':_0x2ba0fb[_0x38f486(0x191)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x75be65,_0x324838){const _0x4c3c45=a33_0x20d0,_0x3a930a=_0x75be65();while(!![]){try{const _0x22ac18=-parseInt(_0x4c3c45(0x10b))/0x1+parseInt(_0x4c3c45(0x10d))/0x2+parseInt(_0x4c3c45(0x104))/0x3*(-parseInt(_0x4c3c45(0x10f))/0x4)+-parseInt(_0x4c3c45(0x10a))/0x5*(parseInt(_0x4c3c45(0x10c))/0x6)+-parseInt(_0x4c3c45(0x107))/0x7*(-parseInt(_0x4c3c45(0x105))/0x8)+parseInt(_0x4c3c45(0x108))/0x9*(-parseInt(_0x4c3c45(0x109))/0xa)+-parseInt(_0x4c3c45(0x106))/0xb*(-parseInt(_0x4c3c45(0x10e))/0xc);if(_0x22ac18===_0x324838)break;else _0x3a930a['push'](_0x3a930a['shift']());}catch(_0x38ecc3){_0x3a930a['push'](_0x3a930a['shift']());}}}(a33_0x3e27,0xd587c));import{bffList}from'../../commands/bff/list.js';function a33_0x3e27(){const _0x54fa73=['828ZvAPGL','12iBgCnp','1412514pNJxXJ','991912CvPVAV','520388JHUGiu','7AYFooO','1476198tfaTXX','20sqAlco','605DXjIDm','1406805GTDqxF','1578QMhvOt','1331130CHvbet'];a33_0x3e27=function(){return _0x54fa73;};return a33_0x3e27();}function a33_0x20d0(_0x17eee5,_0x4c19b4){_0x17eee5=_0x17eee5-0x104;const _0x3e27d9=a33_0x3e27();let _0x20d074=_0x3e27d9[_0x17eee5];return _0x20d074;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|