@lovrabet/rabetbase-cli 2.3.16-beta.3 → 2.3.16-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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.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.js +1 -1
- package/lib/help.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/page/react/create.js +0 -1
- package/lib/commands/page/react/detail.js +0 -1
- package/lib/commands/page/react/list.js +0 -1
- package/lib/commands/page/react/publish.js +0 -1
- package/lib/commands/page/react/shared.js +0 -1
- package/lib/commands/page/react/syntax.js +0 -1
- package/lib/commands/page/react/template.js +0 -1
- package/lib/commands/page/react/update.js +0 -1
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4bb9a2=a19_0x144b;(function(_0x2dfb07,_0x197715){const _0x638665=a19_0x144b,_0x2f58fa=_0x2dfb07();while(!![]){try{const _0x139340=-parseInt(_0x638665(0x20a))/0x1+parseInt(_0x638665(0x1f0))/0x2+parseInt(_0x638665(0x1fb))/0x3+parseInt(_0x638665(0x1fa))/0x4*(parseInt(_0x638665(0x1fd))/0x5)+-parseInt(_0x638665(0x1fe))/0x6+parseInt(_0x638665(0x1e7))/0x7+parseInt(_0x638665(0x20d))/0x8;if(_0x139340===_0x197715)break;else _0x2f58fa['push'](_0x2f58fa['shift']());}catch(_0x5db2f3){_0x2f58fa['push'](_0x2f58fa['shift']());}}}(a19_0x215a,0x2d88b));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';function a19_0x144b(_0xc89f19,_0x1616bd){_0xc89f19=_0xc89f19-0x1e7;const _0x215aa5=a19_0x215a();let _0x144b2a=_0x215aa5[_0xc89f19];return _0x144b2a;}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x113b49,_0x6b5064){const _0xcb92b1=a19_0x144b,_0x1484df=[],_0x5e8c0f=_0x113b49[_0xcb92b1(0x1ea)]&&typeof _0x113b49[_0xcb92b1(0x1ea)]==='object'?_0x113b49[_0xcb92b1(0x1ea)]:{},_0x5ddc50=_0x113b49[_0xcb92b1(0x207)]||undefined;for(const [_0x838b7d,_0x4ec124]of Object[_0xcb92b1(0x20b)](_0x5e8c0f)){if(!_0x4ec124||typeof _0x4ec124!==_0xcb92b1(0x210)||!_0x4ec124[_0xcb92b1(0x1f1)])continue;_0x1484df['push']({'name':_0x838b7d,'appcode':_0x4ec124[_0xcb92b1(0x1f1)],'named':!![],'definedIn':_0x6b5064,'isDefault':_0x838b7d===_0x5ddc50,...buildAppProfileListFields(_0x4ec124)});}return _0x1484df;}function a19_0x215a(){const _0x2cc862=['app','1532216ERyQTv','projectConfig','\x20config','object','168728shbVlG','global','length','apps','bool','\x20in\x20','.\x20Use\x20`','list','mergedCli','73576PHHkyE','appcode','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','globalPath','projectPath','remote','boolean','read','map','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','64yALZzi','424845ngHTOo','isCurrent','53925zcWcOs','504324FLXVXo','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','project','No\x20apps\x20configured','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','merged','validation','defaultApp','inherit','globalConfig','296033XkCHMB','entries'];a19_0x215a=function(){return _0x2cc862;};return a19_0x215a();}function buildMergedItems(_0x56d6a3,_0x549cb5){const _0x1956cf=a19_0x144b,{apps:apps={},defaultApp:_0x11d122}=_0x56d6a3,_0x370aa4=_0x549cb5['globalConfig'][_0x1956cf(0x1ea)]&&typeof _0x549cb5[_0x1956cf(0x209)][_0x1956cf(0x1ea)]===_0x1956cf(0x210)?_0x549cb5[_0x1956cf(0x209)][_0x1956cf(0x1ea)]:{},_0x366dac=_0x549cb5[_0x1956cf(0x20e)]['apps']&&typeof _0x549cb5[_0x1956cf(0x20e)][_0x1956cf(0x1ea)]===_0x1956cf(0x210)?_0x549cb5[_0x1956cf(0x20e)][_0x1956cf(0x1ea)]:{},_0x11fdde=_0x549cb5[_0x1956cf(0x20e)][_0x1956cf(0x208)]===![],_0x4a9a1f=Object[_0x1956cf(0x20b)](apps),_0x484deb=_0x4a9a1f[_0x1956cf(0x1f8)](([_0x45b390,_0x11a325])=>({'name':_0x45b390,'appcode':_0x11a325['appcode'],'named':!![],'definedIn':appDefinedIn(_0x45b390,_0x370aa4,_0x366dac,_0x11fdde),'isDefault':_0x45b390===_0x11d122,...buildAppProfileListFields(_0x11a325)}));return _0x484deb;}function validateAppListFlags(_0x32523d){const _0x422de6=a19_0x144b;if(!_0x32523d['bool'](_0x422de6(0x1f5)))return;if(!_0x32523d[_0x422de6(0x1eb)](_0x422de6(0x1e8))&&!_0x32523d[_0x422de6(0x1eb)](_0x422de6(0x202)))return;throw CliErrors[_0x422de6(0x206)](_0x422de6(0x1f2),_0x422de6(0x1ff));}async function execute(_0x3781ba){const _0x4724eb=a19_0x144b;validateAppListFlags(_0x3781ba);if(_0x3781ba[_0x4724eb(0x1eb)]('remote'))return{'ok':!![],'data':await listRemoteAppDirectory(_0x3781ba)};const _0x39181b=_0x3781ba[_0x4724eb(0x1eb)](_0x4724eb(0x1e8)),_0x4d1714=_0x3781ba['bool']('project'),_0x5c5692=_0x39181b?'global':_0x4d1714?_0x4724eb(0x202):_0x4724eb(0x205),{config:_0xd552d4,layers:_0xfed0d4}=readRawConfigWithLayers(),_0x3af776=resolveDefaultAppSource(_0xfed0d4),{defaultApp:_0x468484}=_0xd552d4;let _0x4db60e,_0x47b7c5;switch(_0x5c5692){case _0x4724eb(0x1e8):_0x4db60e=buildItemsFromLayer(_0xfed0d4[_0x4724eb(0x209)],'global'),_0x47b7c5=_0xfed0d4[_0x4724eb(0x1f3)];break;case _0x4724eb(0x202):_0x4db60e=buildItemsFromLayer(_0xfed0d4[_0x4724eb(0x20e)],'project'),_0x47b7c5=_0xfed0d4[_0x4724eb(0x1f4)];break;default:_0x4db60e=buildMergedItems(_0xd552d4,_0xfed0d4);break;}enrichAppListItemsWithMergedSelection(_0x4db60e,_0x3781ba[_0x4724eb(0x1ef)]);if(_0x4db60e[_0x4724eb(0x1e9)]===0x0){const _0x1fd3a7=_0x5c5692===_0x4724eb(0x205)?'':_0x4724eb(0x1ec)+_0x5c5692+_0x4724eb(0x20f);return{'ok':!![],'data':[],'message':_0x4724eb(0x203)+_0x1fd3a7+_0x4724eb(0x1ed)+CLI_BIN_NAME+_0x4724eb(0x204)};}const _0x230f1e=_0x4db60e['find'](_0x505316=>_0x505316[_0x4724eb(0x1fc)]===!![]),_0x38e056=_0x468484??_0x230f1e?.[_0x4724eb(0x1f1)]??null,_0xcb8407=_0x5c5692==='merged'?{'globalPath':_0xfed0d4[_0x4724eb(0x1f3)]??null,'projectPath':_0xfed0d4[_0x4724eb(0x1f4)]??null,'defaultApp':_0x38e056,'defaultAppSource':_0x468484!=null?_0x3af776:null}:{'scope':_0x5c5692,'configPath':_0x47b7c5??null};return{'ok':!![],'data':{'items':_0x4db60e,'meta':_0xcb8407}};}export const appListDefinition={'service':a19_0x4bb9a2(0x20c),'command':a19_0x4bb9a2(0x1ee),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a19_0x4bb9a2(0x1f7),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x4bb9a2(0x1f5),'type':a19_0x4bb9a2(0x1f6),'description':a19_0x4bb9a2(0x1f9),'default':![]},{'name':a19_0x4bb9a2(0x1e8),'type':a19_0x4bb9a2(0x1f6),'description':a19_0x4bb9a2(0x200),'default':![]},{'name':'project','type':'boolean','description':a19_0x4bb9a2(0x201),'default':![]}],async 'validate'(_0xf03274){validateAppListFlags(_0xf03274);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a20_0x4d02e4=a20_0x1863;(function(_0x4dfb47,_0x364212){const _0x47e038=a20_0x1863,_0x41ada8=_0x4dfb47();while(!![]){try{const _0x53c2e0=-parseInt(_0x47e038(0x10f))/0x1+-parseInt(_0x47e038(0x108))/0x2*(-parseInt(_0x47e038(0x10c))/0x3)+-parseInt(_0x47e038(0x10e))/0x4+-parseInt(_0x47e038(0x109))/0x5+parseInt(_0x47e038(0x107))/0x6+parseInt(_0x47e038(0x10a))/0x7+parseInt(_0x47e038(0x104))/0x8;if(_0x53c2e0===_0x364212)break;else _0x41ada8['push'](_0x41ada8['shift']());}catch(_0x3d31c0){_0x41ada8['push'](_0x41ada8['shift']());}}}(a20_0x419c,0x453ce));function a20_0x1863(_0x3d8d6c,_0x4f8a7a){_0x3d8d6c=_0x3d8d6c-0x104;const _0x419cc1=a20_0x419c();let _0x186317=_0x419cc1[_0x3d8d6c];return _0x186317;}function a20_0x419c(){const _0x5d2b8e=['2ASngqW','830210oilUNn','148533CxQWTK','length','1109187pxtLId','\x20application\x20member(s)','1744552sJbQWr','285326CqnTeL','List\x20application\x20members\x20with\x20their\x20role\x20memberships','Found\x20','2819256roVVUh','appCode','members-list','2566494ovHnTQ'];a20_0x419c=function(){return _0x5d2b8e;};return a20_0x419c();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';export const appMembersListDefinition={'service':'app','command':a20_0x4d02e4(0x106),'description':a20_0x4d02e4(0x110),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0xde949a){const _0x2aa320=a20_0x4d02e4,_0x24713e=projectAppMembers(await listRoleUsers(_0xde949a[_0x2aa320(0x105)]));return{'ok':!![],'data':{'appCode':_0xde949a['appCode'],'items':_0x24713e,'totalCount':_0x24713e[_0x2aa320(0x10b)]},'message':_0x2aa320(0x111)+_0x24713e[_0x2aa320(0x10b)]+_0x2aa320(0x10d)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf138ad,_0x492bd5){const _0x2504e2=a21_0x59c0,_0x51618e=_0xf138ad();while(!![]){try{const _0x337d0b=parseInt(_0x2504e2(0x1f1))/0x1*(parseInt(_0x2504e2(0x1ef))/0x2)+-parseInt(_0x2504e2(0x1f2))/0x3+-parseInt(_0x2504e2(0x1f6))/0x4*(parseInt(_0x2504e2(0x1f7))/0x5)+-parseInt(_0x2504e2(0x1fa))/0x6*(parseInt(_0x2504e2(0x1f9))/0x7)+-parseInt(_0x2504e2(0x1f8))/0x8+-parseInt(_0x2504e2(0x1ed))/0x9+-parseInt(_0x2504e2(0x1f4))/0xa*(-parseInt(_0x2504e2(0x1fb))/0xb);if(_0x337d0b===_0x492bd5)break;else _0x51618e['push'](_0x51618e['shift']());}catch(_0x3b2cb4){_0x51618e['push'](_0x51618e['shift']());}}}(a21_0x130e,0xded47));import{listRemoteApps}from'../../core/api-client.js';function a21_0x59c0(_0x3eb590,_0x2b0a9f){_0x3eb590=_0x3eb590-0x1ed;const _0x130ef6=a21_0x130e();let _0x59c0e8=_0x130ef6[_0x3eb590];return _0x59c0e8;}import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x11524e){const _0x4e00e3=a21_0x59c0,_0x1a8184=_0x11524e[_0x4e00e3(0x1fd)]||getCookie();if(!_0x1a8184)throw CliErrors[_0x4e00e3(0x1f0)]();return _0x1a8184;}function a21_0x130e(){const _0x1f6d47=['9222672KeeJrS','210vnZwOv','362478awfjbg','61413374dHYCXT','platform','cookie','map','7180281YjjtoD','appCode','2194dBRIiA','authRequired','778FkvBGI','5162025EcAxhK','appName','10ByqoYy','appDesc','1076OPEKtA','745PJwqjj'];a21_0x130e=function(){return _0x1f6d47;};return a21_0x130e();}export async function listRemoteAppDirectory(_0x370568){const _0x39f4c1=a21_0x59c0,_0x347511=await withActiveCookie(resolveCookie(_0x370568),()=>listRemoteApps());return{'items':_0x347511[_0x39f4c1(0x1fe)](_0x5ac7d6=>({..._0x5ac7d6['id']!=null?{'id':_0x5ac7d6['id']}:{},'appCode':_0x5ac7d6[_0x39f4c1(0x1ee)],'appName':_0x5ac7d6[_0x39f4c1(0x1f3)],..._0x5ac7d6['appDesc']!=null?{'appDesc':_0x5ac7d6[_0x39f4c1(0x1f5)]}:{}})),'meta':{'source':_0x39f4c1(0x1fc)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x81dacb,_0x4b7b1c){const _0xbe1a9a=a22_0x40df,_0x4613c7=_0x81dacb();while(!![]){try{const _0x1eb6dc=-parseInt(_0xbe1a9a(0xdd))/0x1*(-parseInt(_0xbe1a9a(0xca))/0x2)+parseInt(_0xbe1a9a(0xcd))/0x3*(parseInt(_0xbe1a9a(0xf2))/0x4)+-parseInt(_0xbe1a9a(0xe7))/0x5*(parseInt(_0xbe1a9a(0xea))/0x6)+-parseInt(_0xbe1a9a(0xf1))/0x7+-parseInt(_0xbe1a9a(0xe2))/0x8+parseInt(_0xbe1a9a(0xc7))/0x9*(parseInt(_0xbe1a9a(0xc3))/0xa)+parseInt(_0xbe1a9a(0xd0))/0xb;if(_0x1eb6dc===_0x4b7b1c)break;else _0x4613c7['push'](_0x4613c7['shift']());}catch(_0x3231de){_0x4613c7['push'](_0x4613c7['shift']());}}}(a22_0x3840,0xa9002));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x5e411c){const _0x49e5b8=a22_0x40df,_0x4a329e=_0x5e411c?.[_0x49e5b8(0xe4)]();return _0x4a329e?_0x4a329e:null;}export function projectAppMembers(_0x2506bb){const _0x2749b7=a22_0x40df,_0x4e637b=new Map(),_0x2248c2=[..._0x2506bb][_0x2749b7(0xd1)]((_0x34cd5d,_0x1b0197)=>_0x34cd5d['id']-_0x1b0197['id']),_0x158edc=(_0x489837,_0x1dec2d,_0x86dcca)=>{const _0x201c68=_0x2749b7;for(const _0x2a9608 of _0x1dec2d){const _0x2ac275=Number(_0x2a9608[_0x201c68(0xd8)]);if(!Number['isFinite'](_0x2ac275)||_0x2ac275<=0x0)continue;let _0xfae4d9=_0x4e637b['get'](_0x2ac275);if(!_0xfae4d9)_0xfae4d9={'userId':_0x2ac275,'username':nullableText(_0x2a9608['username']),'displayName':nullableText(_0x2a9608[_0x201c68(0xc4)]),'status':_0x86dcca,'roles':[],'roleKeys':new Set()},_0x4e637b[_0x201c68(0xeb)](_0x2ac275,_0xfae4d9);else{_0xfae4d9[_0x201c68(0xdf)]??=nullableText(_0x2a9608['username']),_0xfae4d9[_0x201c68(0xe9)]??=nullableText(_0x2a9608[_0x201c68(0xc4)]);if(_0x86dcca==='ACTIVE')_0xfae4d9[_0x201c68(0xd4)]=_0x201c68(0xc9);}const _0x397916=_0x489837['id']+':'+_0x86dcca;if(_0xfae4d9[_0x201c68(0xcf)]['has'](_0x397916))continue;_0xfae4d9[_0x201c68(0xcf)]['add'](_0x397916),_0xfae4d9[_0x201c68(0xc5)][_0x201c68(0xd5)]({'roleId':_0x489837['id'],'roleName':nullableText(_0x489837[_0x201c68(0xe0)]),'roleType':nullableText(_0x489837['roleType']),'membershipStatus':_0x86dcca});}};for(const _0x39e744 of _0x2248c2){_0x158edc(_0x39e744,_0x39e744[_0x2749b7(0xda)]??[],_0x2749b7(0xc9)),_0x158edc(_0x39e744,_0x39e744[_0x2749b7(0xc2)]??[],'PENDING');}return[..._0x4e637b[_0x2749b7(0xe3)]()][_0x2749b7(0xd9)](_0x27ffe7=>({'userId':_0x27ffe7[_0x2749b7(0xd8)],'username':_0x27ffe7[_0x2749b7(0xdf)],'displayName':_0x27ffe7[_0x2749b7(0xe9)],'status':_0x27ffe7[_0x2749b7(0xd4)],'roles':_0x27ffe7['roles'][_0x2749b7(0xd1)]((_0x47d753,_0x2ff55d)=>_0x47d753[_0x2749b7(0xde)]-_0x2ff55d[_0x2749b7(0xde)]||(_0x47d753[_0x2749b7(0xd2)]===_0x2ff55d['membershipStatus']?0x0:_0x47d753[_0x2749b7(0xd2)]===_0x2749b7(0xc9)?-0x1:0x1))}))[_0x2749b7(0xd1)]((_0x576d5d,_0x558125)=>_0x576d5d[_0x2749b7(0xd8)]-_0x558125['userId']);}export function enrichAppListItemsWithMergedSelection(_0x32a120,_0x5e147c){const _0x47f515=a22_0x40df;if(!_0x5e147c)return;const _0x32ea5c=_0x5e147c['apps']&&typeof _0x5e147c[_0x47f515(0xf0)]===_0x47f515(0xed)?_0x5e147c[_0x47f515(0xf0)]:{},_0x1ad9ad=Object[_0x47f515(0xe8)](_0x32ea5c)[_0x47f515(0xe6)]>0x0;for(const _0x5499a3 of _0x32a120){_0x5499a3[_0x47f515(0xc6)]=![];}const _0x34e194=_0x5e147c[_0x47f515(0xdc)]!=null?String(_0x5e147c[_0x47f515(0xdc)])[_0x47f515(0xe4)]():'';if(_0x1ad9ad){const _0x263ef9=_0x5e147c[_0x47f515(0xd6)]??_0x5e147c[_0x47f515(0xef)];if(_0x263ef9)for(const _0x21fd91 of _0x32a120){_0x21fd91[_0x47f515(0xec)]===!![]&&_0x21fd91[_0x47f515(0xe1)]===_0x263ef9&&(_0x21fd91[_0x47f515(0xc6)]=!![]);}for(const _0x480b75 of _0x32a120){if(_0x480b75['named']!==![])continue;if(_0x5e147c['defaultApp'])continue;_0x34e194&&String(_0x480b75['appcode']??'')[_0x47f515(0xe4)]()===_0x34e194&&(_0x480b75[_0x47f515(0xc6)]=!![]);}return;}if(!_0x34e194)return;for(const _0x2c9d47 of _0x32a120){String(_0x2c9d47[_0x47f515(0xdb)]??'')[_0x47f515(0xe4)]()===_0x34e194&&(_0x2c9d47[_0x47f515(0xc6)]=!![]);}}export function resolveAppScopeForWrite(_0x1f3ba2,_0x10a731,_0x213e94){const _0x1f9e8f=a22_0x40df;if(_0x10a731)return _0x1f9e8f(0xc8);const _0x1b493c=_0x213e94['projectConfig'][_0x1f9e8f(0xf0)]&&typeof _0x213e94[_0x1f9e8f(0xe5)][_0x1f9e8f(0xf0)]===_0x1f9e8f(0xed)?_0x213e94[_0x1f9e8f(0xe5)][_0x1f9e8f(0xf0)]:{},_0x4960df=_0x213e94[_0x1f9e8f(0xd7)]['apps']&&typeof _0x213e94[_0x1f9e8f(0xd7)][_0x1f9e8f(0xf0)]===_0x1f9e8f(0xed)?_0x213e94[_0x1f9e8f(0xd7)][_0x1f9e8f(0xf0)]:{};if(Object[_0x1f9e8f(0xcc)][_0x1f9e8f(0xd3)][_0x1f9e8f(0xce)](_0x1b493c,_0x1f3ba2))return _0x1f9e8f(0xcb);if(Object[_0x1f9e8f(0xcc)][_0x1f9e8f(0xd3)][_0x1f9e8f(0xce)](_0x4960df,_0x1f3ba2))return'global';return _0x1f9e8f(0xcb);}export function appDefinedIn(_0x10f533,_0x1045b7,_0x57163d,_0x3408b6){const _0x318bbb=a22_0x40df;if(_0x3408b6)return Object[_0x318bbb(0xcc)][_0x318bbb(0xd3)][_0x318bbb(0xce)](_0x57163d,_0x10f533)?_0x318bbb(0xcb):'global';const _0x1e6cba=Object['prototype'][_0x318bbb(0xd3)]['call'](_0x1045b7,_0x10f533),_0x42f675=Object['prototype'][_0x318bbb(0xd3)][_0x318bbb(0xce)](_0x57163d,_0x10f533);if(_0x1e6cba&&_0x42f675)return _0x318bbb(0xf4);if(_0x42f675)return _0x318bbb(0xcb);return _0x318bbb(0xc8);}export function resolveDefaultAppSource(_0x2dc5ac){const _0x3a4d43=a22_0x40df,_0x3430b5=_0x2dc5ac[_0x3a4d43(0xe5)][_0x3a4d43(0xf0)]&&typeof _0x2dc5ac[_0x3a4d43(0xe5)][_0x3a4d43(0xf0)]===_0x3a4d43(0xed)?_0x2dc5ac['projectConfig']['apps']:{};if(_0x3a4d43(0xef)in _0x2dc5ac[_0x3a4d43(0xe5)])return _0x3a4d43(0xcb);if(Object['keys'](_0x3430b5)[_0x3a4d43(0xe6)]>0x0)return _0x3a4d43(0xcb);if(_0x2dc5ac['projectConfig'][_0x3a4d43(0xf3)]===![])return null;if(_0x2dc5ac[_0x3a4d43(0xd7)][_0x3a4d43(0xef)])return _0x3a4d43(0xc8);return null;}export function getConfigPath(_0x4be729={}){const _0x20ccf4=a22_0x40df,_0x1e80b0=_0x4be729[_0x20ccf4(0xc8)]?_0x20ccf4(0xc8):_0x20ccf4(0xcb);return resolveWriteConfigPath(_0x1e80b0);}function a22_0x3840(){const _0x89346e=['appcode','appCode','899017XOIvOy','roleId','username','roleName','name','7880936yvuNaa','values','trim','projectConfig','length','22760tNDDMn','keys','displayName','1548QRXYHB','set','named','object','\x20(global)','defaultApp','apps','3441438nlOYBZ','1684eyheLd','inherit','both','applyUserList','8730NZAwMe','nickname','roles','isCurrent','1539qLrjec','global','ACTIVE','2dltvWA','project','prototype','327FDxtlx','call','roleKeys','24741244jTqorx','sort','membershipStatus','hasOwnProperty','status','push','currentApp','globalConfig','userId','map','userList'];a22_0x3840=function(){return _0x89346e;};return a22_0x3840();}function a22_0x40df(_0x4056e4,_0x34b32c){_0x4056e4=_0x4056e4-0xc2;const _0x384015=a22_0x3840();let _0x40df92=_0x384015[_0x4056e4];return _0x40df92;}export function readConfig(_0x245b0e={}){return readConfigFile(getConfigPath(_0x245b0e));}export function writeConfig(_0x1cdd8d,_0x1db04f={}){writeConfigFile(getConfigPath(_0x1db04f),_0x1cdd8d);}export function scopeLabel(_0xf3f5d0){const _0x40321c=a22_0x40df;return _0xf3f5d0[_0x40321c(0xc8)]?_0x40321c(0xee):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0xa8717c=a23_0x44b2;function a23_0x44b2(_0x208ec9,_0x3a3dff){_0x208ec9=_0x208ec9-0x15d;const _0x29f012=a23_0x29f0();let _0x44b2c3=_0x29f012[_0x208ec9];return _0x44b2c3;}function a23_0x29f0(){const _0x179966=['get','3628404pezRkp','App\x20config\x20server\x20id\x20missing\x20for\x20key=','validation','appCode:\x20','/smartapi/app-config/delete','1747126VNcOWQ',',\x20appCode=','delete','high-risk-write','app-config','8586389HLXoqs','POST','Deleted\x20app\x20config\x20','8322978hDZdcK','868595Mlmeek','isFinite','4vUUltZ','Delete\x20one\x20runtime\x20app-config\x20key','24ijyDyX','appCode','App\x20config\x20key\x20not\x20found:\x20','3gAGDoV','number','13182300qvAlKC','616480iTMBOY'];a23_0x29f0=function(){return _0x179966;};return a23_0x29f0();}(function(_0x2c7e0d,_0x22e41a){const _0xa6628c=a23_0x44b2,_0x1af35b=_0x2c7e0d();while(!![]){try{const _0xca418b=-parseInt(_0xa6628c(0x16b))/0x1+-parseInt(_0xa6628c(0x172))/0x2*(parseInt(_0xa6628c(0x168))/0x3)+-parseInt(_0xa6628c(0x163))/0x4*(parseInt(_0xa6628c(0x161))/0x5)+-parseInt(_0xa6628c(0x160))/0x6+parseInt(_0xa6628c(0x15d))/0x7+-parseInt(_0xa6628c(0x165))/0x8*(-parseInt(_0xa6628c(0x16d))/0x9)+parseInt(_0xa6628c(0x16a))/0xa;if(_0xca418b===_0x22e41a)break;else _0x1af35b['push'](_0x1af35b['shift']());}catch(_0xa3d1df){_0x1af35b['push'](_0x1af35b['shift']());}}}(a23_0x29f0,0xabba8));import{deleteAppConfig,getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asAppConfigDryRunResult,buildMutationData,KEY_ARG,projectAppConfig,readKeyArg,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const DELETE_PATH=a23_0xa8717c(0x171);export const appConfigDelete={'service':a23_0xa8717c(0x176),'command':a23_0xa8717c(0x174),'description':a23_0xa8717c(0x164),'risk':a23_0xa8717c(0x175),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3bb3f9){readKeyArg(_0x3bb3f9);},async 'dryRun'(_0x235701){const _0x60ccdd=a23_0xa8717c,_0x157d21=readKeyArg(_0x235701),_0x5ed5e8=await mustGetByKey(_0x235701['appCode'],_0x157d21);return asAppConfigDryRunResult(buildMutationData({'operation':_0x60ccdd(0x174),'appCode':_0x235701[_0x60ccdd(0x166)],'key':_0x157d21,'before':projectAppConfig(_0x5ed5e8),'after':null,'dryRun':!![]}),{'method':_0x60ccdd(0x15e),'url':DELETE_PATH});},async 'execute'(_0x4f368c){const _0x5f2cc6=a23_0xa8717c,_0x44f484=readKeyArg(_0x4f368c),_0x6dda81=await mustGetByKey(_0x4f368c[_0x5f2cc6(0x166)],_0x44f484);return await withAppConfigApiBoundary(_0x5f2cc6(0x174),{'appCode':_0x4f368c[_0x5f2cc6(0x166)],'key':_0x44f484},()=>deleteAppConfig({'appCode':_0x4f368c[_0x5f2cc6(0x166)],'id':requireAppConfigId(_0x6dda81,_0x44f484,_0x4f368c['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x5f2cc6(0x174),'appCode':_0x4f368c['appCode'],'key':_0x44f484,'before':projectAppConfig(_0x6dda81),'after':null,'dryRun':![]}),'message':_0x5f2cc6(0x15f)+_0x44f484};}};async function mustGetByKey(_0x4db259,_0x1e9452){const _0x507f98=a23_0xa8717c,_0x332a60=await withAppConfigApiBoundary(_0x507f98(0x16c),{'appCode':_0x4db259,'key':_0x1e9452},()=>getAppConfigByKey(_0x4db259,_0x1e9452));if(!_0x332a60)throw CliErrors[_0x507f98(0x16f)](_0x507f98(0x167)+_0x1e9452,_0x507f98(0x170)+_0x4db259);return _0x332a60;}function requireAppConfigId(_0x53ff60,_0x646d0f,_0x302f4a){const _0x36a36a=a23_0xa8717c;if(typeof _0x53ff60['id']===_0x36a36a(0x169)&&Number[_0x36a36a(0x162)](_0x53ff60['id'])&&_0x53ff60['id']>0x0)return _0x53ff60['id'];throw CliErrors['apiError'](_0x36a36a(0x16e)+_0x646d0f+_0x36a36a(0x173)+_0x302f4a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x2576(){const _0x10ecce=['read','App\x20config\x20key\x20not\x20found:\x20','reveal','462988aUUeer','4pwamRu','7391616lHplmS','4177728tYuRWh','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','bool','245520kHdbvH','5239254FAMBVs','10YeVwDQ','Loaded\x20app\x20config\x20','appCode:\x20','7975527JydvXt','\x20with\x20value\x20revealed','\x20with\x20value\x20redacted','appCode','140YvJykR','419918KaJGNW'];a24_0x2576=function(){return _0x10ecce;};return a24_0x2576();}const a24_0x14da07=a24_0xaeb1;(function(_0x4346e6,_0x1467df){const _0xbdf9e9=a24_0xaeb1,_0x1de653=_0x4346e6();while(!![]){try{const _0x1e37fb=-parseInt(_0xbdf9e9(0x1d8))/0x1*(-parseInt(_0xbdf9e9(0x1dd))/0x2)+-parseInt(_0xbdf9e9(0x1df))/0x3+-parseInt(_0xbdf9e9(0x1dc))/0x4*(-parseInt(_0xbdf9e9(0x1d0))/0x5)+parseInt(_0xbdf9e9(0x1cf))/0x6+-parseInt(_0xbdf9e9(0x1d3))/0x7+parseInt(_0xbdf9e9(0x1de))/0x8+-parseInt(_0xbdf9e9(0x1ce))/0x9*(-parseInt(_0xbdf9e9(0x1d7))/0xa);if(_0x1e37fb===_0x1467df)break;else _0x1de653['push'](_0x1de653['shift']());}catch(_0x51834c){_0x1de653['push'](_0x1de653['shift']());}}}(a24_0x2576,0xaf68a));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{KEY_ARG,projectAppConfig,readKeyArg,REVEAL_FLAG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a24_0xaeb1(_0x250d1e,_0x785cde){_0x250d1e=_0x250d1e-0x1cd;const _0x2576ce=a24_0x2576();let _0xaeb15f=_0x2576ce[_0x250d1e];return _0xaeb15f;}export const appConfigGet={'service':'app-config','command':'get','description':a24_0x14da07(0x1e0),'risk':a24_0x14da07(0x1d9),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x1313cf){readKeyArg(_0x1313cf);},async 'execute'(_0x5a96f7){const _0x5bcd4a=a24_0x14da07,_0xd8abeb=readKeyArg(_0x5a96f7),_0x488b0a=await withAppConfigApiBoundary('get',{'appCode':_0x5a96f7['appCode'],'key':_0xd8abeb},()=>getAppConfigByKey(_0x5a96f7[_0x5bcd4a(0x1d6)],_0xd8abeb));if(!_0x488b0a)throw CliErrors['validation'](_0x5bcd4a(0x1da)+_0xd8abeb,_0x5bcd4a(0x1d2)+_0x5a96f7[_0x5bcd4a(0x1d6)]);const _0x49df47=projectAppConfig(_0x488b0a,{'reveal':_0x5a96f7[_0x5bcd4a(0x1cd)](_0x5bcd4a(0x1db))});return{'ok':!![],'data':{'config':_0x49df47},'message':_0x5a96f7[_0x5bcd4a(0x1cd)](_0x5bcd4a(0x1db))?_0x5bcd4a(0x1d1)+_0xd8abeb+_0x5bcd4a(0x1d4):_0x5bcd4a(0x1d1)+_0xd8abeb+_0x5bcd4a(0x1d5)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x9d232e,_0x186b06){const _0x38e5ec=a25_0x1c44,_0x14233e=_0x9d232e();while(!![]){try{const _0x1f2058=-parseInt(_0x38e5ec(0x1de))/0x1*(parseInt(_0x38e5ec(0x1d9))/0x2)+parseInt(_0x38e5ec(0x1e2))/0x3+-parseInt(_0x38e5ec(0x1e3))/0x4+parseInt(_0x38e5ec(0x1da))/0x5*(parseInt(_0x38e5ec(0x1dd))/0x6)+parseInt(_0x38e5ec(0x1db))/0x7*(-parseInt(_0x38e5ec(0x1df))/0x8)+-parseInt(_0x38e5ec(0x1e0))/0x9*(-parseInt(_0x38e5ec(0x1e1))/0xa)+-parseInt(_0x38e5ec(0x1e4))/0xb*(-parseInt(_0x38e5ec(0x1dc))/0xc);if(_0x1f2058===_0x186b06)break;else _0x14233e['push'](_0x14233e['shift']());}catch(_0x51c328){_0x14233e['push'](_0x14233e['shift']());}}}(a25_0x5ee3,0xf2b4a));import{appConfigList}from'../../commands/app-config/list.js';function a25_0x5ee3(){const _0x5a08e0=['743419WAogQR','40LAWXxF','18TaKvti','1426190eXeXEl','2943273plFKRe','5343020LirDiy','30371kgBQDq','2ipeuUW','30OaZxpZ','2577610AeftbQ','10476szAhJR','1237764GrNGeE'];a25_0x5ee3=function(){return _0x5a08e0;};return a25_0x5ee3();}import{appConfigGet}from'../../commands/app-config/get.js';function a25_0x1c44(_0x49122c,_0x302513){_0x49122c=_0x49122c-0x1d9;const _0x5ee397=a25_0x5ee3();let _0x1c449e=_0x5ee397[_0x49122c];return _0x1c449e;}import{appConfigSet}from'../../commands/app-config/set.js';import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a26_0xb3ed77=a26_0x127b;(function(_0x10e8b8,_0x17403a){const _0x3e6fd1=a26_0x127b,_0x1abd2a=_0x10e8b8();while(!![]){try{const _0x26fb83=-parseInt(_0x3e6fd1(0x11f))/0x1+-parseInt(_0x3e6fd1(0x11b))/0x2+parseInt(_0x3e6fd1(0x121))/0x3+parseInt(_0x3e6fd1(0x125))/0x4+parseInt(_0x3e6fd1(0x123))/0x5*(-parseInt(_0x3e6fd1(0x122))/0x6)+parseInt(_0x3e6fd1(0x119))/0x7*(parseInt(_0x3e6fd1(0x12a))/0x8)+-parseInt(_0x3e6fd1(0x127))/0x9*(parseInt(_0x3e6fd1(0x120))/0xa);if(_0x26fb83===_0x17403a)break;else _0x1abd2a['push'](_0x1abd2a['shift']());}catch(_0x2d0515){_0x1abd2a['push'](_0x1abd2a['shift']());}}}(a26_0x5844,0xb50d4));import{listAppConfigs}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{projectAppConfig,readOptionalTags,TAGS_FLAG,validateKey,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';export const appConfigList={'service':a26_0xb3ed77(0x12b),'command':a26_0xb3ed77(0x12c),'description':'List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':'key','type':a26_0xb3ed77(0x11e),'description':'Filter\x20by\x20exact\x20config\x20key'},TAGS_FLAG],async 'validate'(_0x551ae5){const _0x2c37d4=a26_0xb3ed77,_0x131bff=_0x551ae5[_0x2c37d4(0x11c)](_0x2c37d4(0x11d))[_0x2c37d4(0x124)]();if(_0x131bff)validateKey(_0x131bff);readOptionalTags(_0x551ae5);},async 'execute'(_0x5626eb){const _0x11e346=a26_0xb3ed77,_0x4c8459=_0x5626eb[_0x11e346(0x11c)](_0x11e346(0x11d))['trim']()||undefined,_0x87f903=readOptionalTags(_0x5626eb),_0x1ef7cd=await withAppConfigApiBoundary('list',{'appCode':_0x5626eb[_0x11e346(0x128)]},()=>listAppConfigs(_0x5626eb['appCode'],{'key':_0x4c8459,'tags':_0x87f903})),_0x8cb499=_0x1ef7cd['map'](_0xa139a6=>projectAppConfig(_0xa139a6));return{'ok':!![],'data':{'appCode':_0x5626eb['appCode'],'count':_0x8cb499[_0x11e346(0x129)],'configs':_0x8cb499},'message':_0x11e346(0x11a)+_0x8cb499[_0x11e346(0x129)]+_0x11e346(0x126)};}};function a26_0x127b(_0x2488c1,_0x375ca1){_0x2488c1=_0x2488c1-0x119;const _0x5844aa=a26_0x5844();let _0x127bdf=_0x5844aa[_0x2488c1];return _0x127bdf;}function a26_0x5844(){const _0x2d293c=['list','203lYKzow','Found\x20','1286878DRGvJD','str','key','string','268909kwUljy','1435630MHyISV','3307761GRwgVM','1848606wuBcFq','10qYFNjD','trim','5215704UQcQhD','\x20app\x20config(s)','72nviKiW','appCode','length','279208lGnxWm','app-config'];a26_0x5844=function(){return _0x2d293c;};return a26_0x5844();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x45e000=a27_0x3786;(function(_0x41f96f,_0x2c1bc8){const _0xc5c21=a27_0x3786,_0x5756a4=_0x41f96f();while(!![]){try{const _0x11dde7=parseInt(_0xc5c21(0x1a8))/0x1+-parseInt(_0xc5c21(0x1b9))/0x2+-parseInt(_0xc5c21(0x1b5))/0x3*(-parseInt(_0xc5c21(0x1c4))/0x4)+-parseInt(_0xc5c21(0x1bb))/0x5+-parseInt(_0xc5c21(0x1bc))/0x6*(parseInt(_0xc5c21(0x1c0))/0x7)+-parseInt(_0xc5c21(0x1ab))/0x8*(parseInt(_0xc5c21(0x1c1))/0x9)+parseInt(_0xc5c21(0x1ba))/0xa*(parseInt(_0xc5c21(0x1b8))/0xb);if(_0x11dde7===_0x2c1bc8)break;else _0x5756a4['push'](_0x5756a4['shift']());}catch(_0x552b62){_0x5756a4['push'](_0x5756a4['shift']());}}}(a27_0x2028,0xbf4da));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a27_0x45e000(0x1aa),UPDATE_PATH=a27_0x45e000(0x1c2);export const appConfigSet={'service':a27_0x45e000(0x1b3),'command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a27_0x45e000(0x1bd),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x45e000(0x1bf),'type':a27_0x45e000(0x1af),'description':a27_0x45e000(0x1b6)}],async 'validate'(_0x258db5){readKeyArg(_0x258db5),readOptionalTags(_0x258db5),assertSingleValueSource(_0x258db5);},async 'dryRun'(_0x2ac68f){const _0x4daa9c=a27_0x45e000,_0x1d8d86=readKeyArg(_0x2ac68f),_0x994014=readOptionalTags(_0x2ac68f),_0x37cf6b=assertSingleValueSource(_0x2ac68f);await assertValueSourceReadable(_0x37cf6b);const _0xe8f27a=await withAppConfigApiBoundary(_0x4daa9c(0x1ad),{'appCode':_0x2ac68f[_0x4daa9c(0x1ac)],'key':_0x1d8d86},()=>getAppConfigByKey(_0x2ac68f['appCode'],_0x1d8d86)),_0xbfc128=_0xe8f27a?_0x4daa9c(0x1b1):_0x4daa9c(0x1be),_0x2bafef=_0xe8f27a?projectAppConfig(_0xe8f27a):null,_0xeadfd8=plannedAppConfig({'appCode':_0x2ac68f[_0x4daa9c(0x1ac)],'key':_0x1d8d86,'tags':_0x994014??_0xe8f27a?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xbfc128,'appCode':_0x2ac68f[_0x4daa9c(0x1ac)],'key':_0x1d8d86,'before':_0x2bafef,'after':_0xeadfd8,'dryRun':!![]}),{'method':_0x4daa9c(0x1b2),'url':_0xbfc128===_0x4daa9c(0x1b1)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x3aa7b1){const _0x32a463=a27_0x45e000,_0x5c02a7=readKeyArg(_0x3aa7b1),_0x5a959c=readOptionalTags(_0x3aa7b1),_0xe35d2a=await withAppConfigApiBoundary(_0x32a463(0x1ad),{'appCode':_0x3aa7b1['appCode'],'key':_0x5c02a7},()=>getAppConfigByKey(_0x3aa7b1[_0x32a463(0x1ac)],_0x5c02a7)),_0x1a7ac2=_0xe35d2a?projectAppConfig(_0xe35d2a):null,_0x2586dc=_0xe35d2a?_0x32a463(0x1b1):_0x32a463(0x1be),{value:_0x614f85,warnings:_0x5b0305}=await readAppConfigValue(_0x3aa7b1),_0x48ff1a={'appCode':_0x3aa7b1[_0x32a463(0x1ac)],'key':_0x5c02a7,'value':_0x614f85,'tags':_0x5a959c??_0xe35d2a?.[_0x32a463(0x1a9)]??undefined};await withAppConfigApiBoundary(_0x2586dc,{'appCode':_0x3aa7b1['appCode'],'key':_0x5c02a7},async()=>{const _0x451bc5=_0x32a463;_0xe35d2a?await updateAppConfig({..._0x48ff1a,'id':requireAppConfigId(_0xe35d2a,_0x5c02a7,_0x3aa7b1[_0x451bc5(0x1ac)])}):await createAppConfig(_0x48ff1a);});const _0x3704e3=await withAppConfigApiBoundary(_0x32a463(0x1ad),{'appCode':_0x3aa7b1[_0x32a463(0x1ac)],'key':_0x5c02a7},()=>getAppConfigByKey(_0x3aa7b1[_0x32a463(0x1ac)],_0x5c02a7)),_0x1f3d70=_0x3704e3?projectAppConfig(_0x3704e3):plannedAppConfig({'appCode':_0x3aa7b1[_0x32a463(0x1ac)],'key':_0x5c02a7,'tags':_0x48ff1a[_0x32a463(0x1a9)],'hasValue':_0x614f85!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x2586dc,'appCode':_0x3aa7b1['appCode'],'key':_0x5c02a7,'before':_0x1a7ac2,'after':_0x1f3d70,'dryRun':![],'warnings':_0x5b0305}),'message':(_0x2586dc===_0x32a463(0x1b1)?'Updated':_0x32a463(0x1b7))+'\x20app\x20config\x20'+_0x5c02a7};}};function a27_0x2028(){const _0x321471=['update','POST','app-config',',\x20appCode=','52566PlUkfa','Read\x20config\x20value\x20from\x20file','Created','33jnCkAh','479284quShbT','6330010LJGqvc','3894925EFvmTD','3492396SyYCig','high-risk-write','create','file','14LDlcGb','18ybfIoG','/smartapi/app-config/update','App\x20config\x20server\x20id\x20missing\x20for\x20key=','164yKTsYJ','651694OwkOHQ','tags','/smartapi/app-config/create','1211048GTzjXZ','appCode','get','isFinite','string','number'];a27_0x2028=function(){return _0x321471;};return a27_0x2028();}function a27_0x3786(_0x3c8bb9,_0xec6d5d){_0x3c8bb9=_0x3c8bb9-0x1a8;const _0x2028dd=a27_0x2028();let _0x37863a=_0x2028dd[_0x3c8bb9];return _0x37863a;}function requireAppConfigId(_0x454633,_0x7657f7,_0x349bfa){const _0x19c660=a27_0x45e000;if(typeof _0x454633['id']===_0x19c660(0x1b0)&&Number[_0x19c660(0x1ae)](_0x454633['id'])&&_0x454633['id']>0x0)return _0x454633['id'];throw CliErrors['apiError'](_0x19c660(0x1c3)+_0x7657f7+_0x19c660(0x1b4)+_0x349bfa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a28_0xb42c3b=a28_0x5d0d;(function(_0x74823,_0x49fcda){const _0x523a76=a28_0x5d0d,_0x5e75a3=_0x74823();while(!![]){try{const _0x285a82=-parseInt(_0x523a76(0x74))/0x1*(-parseInt(_0x523a76(0x79))/0x2)+-parseInt(_0x523a76(0x9b))/0x3*(-parseInt(_0x523a76(0x97))/0x4)+-parseInt(_0x523a76(0x8e))/0x5*(parseInt(_0x523a76(0x83))/0x6)+parseInt(_0x523a76(0xa0))/0x7+-parseInt(_0x523a76(0xa2))/0x8*(parseInt(_0x523a76(0x69))/0x9)+parseInt(_0x523a76(0x76))/0xa*(parseInt(_0x523a76(0xaa))/0xb)+-parseInt(_0x523a76(0x77))/0xc;if(_0x285a82===_0x49fcda)break;else _0x5e75a3['push'](_0x5e75a3['shift']());}catch(_0x4d6890){_0x5e75a3['push'](_0x5e75a3['shift']());}}}(a28_0xed1a,0x59168));function a28_0xed1a(){const _0x556ac4=['Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','hasValue','Runtime\x20app-config\x20key','operation','push','file','env','30899wmdXNr','url','219474TexyPe','key','from-env','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Failed\x20to\x20','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Missing\x20app-config\x20key.','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','length','tags','boolean','99726OtDUYH','appCode','1690XFvxJx','627816ECQCSS','reveal','4dvWWiR','apiError','path','once','key:\x20','Environment\x20variable\x20is\x20not\x20set:\x20','value\x20is\x20redacted','App\x20config\x20value\x20source\x20is\x20ambiguous.','args','value','42HNyoHU','trim','validation','slice','end','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','kind','bool','gmtCreate','appCode:\x20','gmtModified','185395DWGbvQ','valueRedacted','setEncoding','string','name','error','before','Config\x20tags\x20for\x20filtering/display\x20metadata','Missing\x20app-config\x20value\x20source.','8452OTEmiX','argument','Value\x20file\x20is\x20not\x20readable:\x20','str','69IIvXRs','join','stdin','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','flag','3945571iCyyNI','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','200mkwyxu'];a28_0xed1a=function(){return _0x556ac4;};return a28_0xed1a();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0xb42c3b(0x6a),'description':a28_0xb42c3b(0xa5),'required':!![]};export const VALUE_ARG={'name':a28_0xb42c3b(0x82),'description':a28_0xb42c3b(0x6e),'required':![]};export const TAGS_FLAG={'name':a28_0xb42c3b(0x72),'type':a28_0xb42c3b(0x91),'description':a28_0xb42c3b(0x95)};export const STDIN_FLAG={'name':a28_0xb42c3b(0x9d),'type':a28_0xb42c3b(0x73),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a28_0xb42c3b(0x6b),'type':a28_0xb42c3b(0x91),'description':a28_0xb42c3b(0x6c)};export const REVEAL_FLAG={'name':a28_0xb42c3b(0x78),'type':a28_0xb42c3b(0x73),'description':a28_0xb42c3b(0xa3),'default':![]};export function readKeyArg(_0x273e59){const _0x35ff97=a28_0xb42c3b,_0x12f829=_0x273e59[_0x35ff97(0x81)][0x0]?.['trim']()??'';return validateKey(_0x12f829),_0x12f829;}function a28_0x5d0d(_0x5e7dca,_0x2671bb){_0x5e7dca=_0x5e7dca-0x68;const _0xed1a39=a28_0xed1a();let _0x5d0d66=_0xed1a39[_0x5e7dca];return _0x5d0d66;}export function readOptionalTags(_0x2164cb){const _0xeba83d=a28_0xb42c3b,_0x3c7adb=_0x2164cb['str'](_0xeba83d(0x72))[_0xeba83d(0x84)]();if(!_0x3c7adb)return undefined;if(_0x3c7adb[_0xeba83d(0x71)]>0x20)throw CliErrors[_0xeba83d(0x85)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x3c7adb;}export function validateKey(_0x3516b5){const _0x27cb3a=a28_0xb42c3b;if(!_0x3516b5)throw CliErrors[_0x27cb3a(0x85)](_0x27cb3a(0x6f));if(_0x3516b5['length']>0x100)throw CliErrors['validation'](_0x27cb3a(0x9e));}export function projectAppConfig(_0x105a37,_0x34e5c6){const _0x1b0071=a28_0xb42c3b,_0x382ea4=_0x105a37['value']!==undefined&&_0x105a37[_0x1b0071(0x82)]!==null&&_0x105a37[_0x1b0071(0x82)]!=='',_0x1bff5d={'appCode':_0x105a37[_0x1b0071(0x75)],'key':_0x105a37['key'],'tags':_0x105a37[_0x1b0071(0x72)]??undefined,'hasValue':_0x382ea4,'valueRedacted':_0x382ea4&&!_0x34e5c6?.[_0x1b0071(0x78)],'gmtCreate':_0x105a37[_0x1b0071(0x8b)],'gmtModified':_0x105a37[_0x1b0071(0x8d)]};return _0x34e5c6?.[_0x1b0071(0x78)]&&(_0x1bff5d[_0x1b0071(0x82)]=_0x105a37[_0x1b0071(0x82)]??'',_0x1bff5d[_0x1b0071(0x8f)]=![]),_0x1bff5d;}export function plannedAppConfig(_0x57dddd){const _0x514b10=a28_0xb42c3b,_0x33b42f=_0x57dddd[_0x514b10(0xa4)]??!![];return{'appCode':_0x57dddd[_0x514b10(0x75)],'key':_0x57dddd['key'],'tags':_0x57dddd[_0x514b10(0x72)]??undefined,'hasValue':_0x33b42f,'valueRedacted':_0x33b42f};}export function buildMutationData(_0x17631e){const _0x146ca3=a28_0xb42c3b;return{'operation':_0x17631e[_0x146ca3(0xa6)],'selector':{'appCode':_0x17631e[_0x146ca3(0x75)],'key':_0x17631e[_0x146ca3(0x6a)]},'before':_0x17631e[_0x146ca3(0x94)],'after':_0x17631e['after'],'dryRun':_0x17631e['dryRun'],'warnings':_0x17631e['warnings']??[]};}export async function withAppConfigApiBoundary(_0x24eeae,_0x1f9f94,_0x11c6b1){const _0x235088=a28_0xb42c3b;try{return await _0x11c6b1();}catch{const _0xaf607e=[_0x235088(0x8c)+_0x1f9f94['appCode']];if(_0x1f9f94[_0x235088(0x6a)])_0xaf607e[_0x235088(0xa7)](_0x235088(0x7d)+_0x1f9f94[_0x235088(0x6a)]);_0xaf607e[_0x235088(0xa7)](_0x235088(0x7f));throw CliErrors[_0x235088(0x7a)](_0x235088(0x6d)+_0x24eeae+'\x20app\x20config.',_0xaf607e[_0x235088(0x9c)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x420317,_0x1f1da6){const _0x2147b3=a28_0xb42c3b;return Object['defineProperties'](_0x420317,{'method':{'value':_0x1f1da6['method'],'enumerable':![]},'url':{'value':_0x1f1da6[_0x2147b3(0x68)],'enumerable':![]}});}export function assertSingleValueSource(_0x4f62fc){const _0x526338=a28_0xb42c3b,_0x2f7a88=[];_0x4f62fc[_0x526338(0x81)][_0x526338(0x71)]>0x1&&_0x2f7a88[_0x526338(0xa7)]({'kind':_0x526338(0x98),'value':_0x4f62fc[_0x526338(0x81)][_0x526338(0x86)](0x1)[_0x526338(0x9c)]('\x20')});const _0x29263c=_0x4f62fc[_0x526338(0x9f)](_0x526338(0x82));_0x29263c!==undefined&&_0x29263c!==null&&_0x2f7a88[_0x526338(0xa7)]({'kind':_0x526338(0x98),'value':String(_0x29263c)});_0x4f62fc[_0x526338(0x8a)](_0x526338(0x9d))&&_0x2f7a88['push']({'kind':_0x526338(0x9d)});const _0x4dc4c9=_0x4f62fc['str'](_0x526338(0x6b))[_0x526338(0x84)]();_0x4dc4c9&&_0x2f7a88[_0x526338(0xa7)]({'kind':'env','name':_0x4dc4c9});const _0x6376f=_0x4f62fc[_0x526338(0x9a)](_0x526338(0xa8))[_0x526338(0x84)]();_0x6376f&&_0x2f7a88[_0x526338(0xa7)]({'kind':_0x526338(0xa8),'path':_0x6376f});if(_0x2f7a88[_0x526338(0x71)]===0x0)throw CliErrors[_0x526338(0x85)](_0x526338(0x96),_0x526338(0x70));if(_0x2f7a88[_0x526338(0x71)]>0x1)throw CliErrors[_0x526338(0x85)](_0x526338(0x80),_0x526338(0xa1));return _0x2f7a88[0x0];}export async function assertValueSourceReadable(_0x4bb8a5){const _0x19c3c5=a28_0xb42c3b;if(_0x4bb8a5[_0x19c3c5(0x89)]===_0x19c3c5(0xa9)&&!(_0x4bb8a5[_0x19c3c5(0x92)]in process.env))throw CliErrors[_0x19c3c5(0x85)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x4bb8a5[_0x19c3c5(0x92)]);if(_0x4bb8a5[_0x19c3c5(0x89)]===_0x19c3c5(0xa8))try{await access(_0x4bb8a5['path']);}catch{throw CliErrors[_0x19c3c5(0x85)](_0x19c3c5(0x99)+_0x4bb8a5['path']);}}export async function readAppConfigValue(_0x178634){const _0x53a56d=a28_0xb42c3b,_0x2d9a80=assertSingleValueSource(_0x178634),_0x336fa4=[];if(_0x2d9a80[_0x53a56d(0x89)]===_0x53a56d(0x98))return _0x336fa4[_0x53a56d(0xa7)](_0x53a56d(0x88)),{'value':_0x2d9a80[_0x53a56d(0x82)]??'','source':_0x2d9a80['kind'],'warnings':_0x336fa4};if(_0x2d9a80[_0x53a56d(0x89)]===_0x53a56d(0x9d))return{'value':await readStdin(),'source':_0x2d9a80['kind'],'warnings':_0x336fa4};if(_0x2d9a80[_0x53a56d(0x89)]===_0x53a56d(0xa9)){if(!(_0x2d9a80[_0x53a56d(0x92)]in process.env))throw CliErrors[_0x53a56d(0x85)](_0x53a56d(0x7e)+_0x2d9a80[_0x53a56d(0x92)]);return{'value':process.env[_0x2d9a80.name]??'','source':_0x2d9a80['kind'],'warnings':_0x336fa4};}return{'value':await readFile(_0x2d9a80[_0x53a56d(0x7b)],'utf8'),'source':_0x2d9a80[_0x53a56d(0x89)],'warnings':_0x336fa4};}function readStdin(){return new Promise((_0x1d2c9a,_0x16dddb)=>{const _0x1c3405=a28_0x5d0d;let _0x5a89d9='';process[_0x1c3405(0x9d)][_0x1c3405(0x90)]('utf8'),process[_0x1c3405(0x9d)]['on']('data',_0xe50f7e=>{_0x5a89d9+=_0xe50f7e;}),process['stdin']['once'](_0x1c3405(0x87),()=>_0x1d2c9a(_0x5a89d9)),process['stdin'][_0x1c3405(0x7c)](_0x1c3405(0x93),_0x16dddb);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x5b3984=a29_0x38a9;(function(_0x5781a6,_0x19d18f){const _0x1aac49=a29_0x38a9,_0x39030a=_0x5781a6();while(!![]){try{const _0x1ab9e1=parseInt(_0x1aac49(0x148))/0x1+parseInt(_0x1aac49(0x13e))/0x2+-parseInt(_0x1aac49(0x13d))/0x3*(parseInt(_0x1aac49(0x14a))/0x4)+-parseInt(_0x1aac49(0x144))/0x5+-parseInt(_0x1aac49(0x152))/0x6+parseInt(_0x1aac49(0x140))/0x7+-parseInt(_0x1aac49(0x145))/0x8;if(_0x1ab9e1===_0x19d18f)break;else _0x39030a['push'](_0x39030a['shift']());}catch(_0xe22261){_0x39030a['push'](_0x39030a['shift']());}}}(a29_0x57ac,0xc6b54));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a29_0x38a9(_0x408538,_0x4b6a4d){_0x408538=_0x408538-0x13c;const _0x57ac59=a29_0x57ac();let _0x38a921=_0x57ac59[_0x408538];return _0x38a921;}function a29_0x57ac(){const _0x245745=['../../auth/auth-server-ui.js','1327920irQGWD','log','3qQekOs','2229634ipVPnF','boolean','8931944riCLVz','Clear\x20login\x20session','login','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','4548515vRARKQ','9680048HGondi','yes','logout','984471xJRGyg','nonInteractive','881372JzJbXB','Login\x20via\x20browser','!\x20Not\x20logged\x20in','auth','bool','write','✓\x20Logged\x20out'];a29_0x57ac=function(){return _0x245745;};return a29_0x57ac();}export const authDefinitions=[{'service':a29_0x5b3984(0x14d),'command':a29_0x5b3984(0x142),'description':a29_0x5b3984(0x14b),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0x5b3984(0x146),'type':a29_0x5b3984(0x13f),'description':a29_0x5b3984(0x143),'default':![]}],async 'execute'(_0x834e34){const _0x2720fe=a29_0x5b3984,{runAuthServer:_0x4f179a}=await import(_0x2720fe(0x151));return await _0x4f179a({'autoYes':_0x834e34[_0x2720fe(0x14e)](_0x2720fe(0x146)),'nonInteractive':_0x834e34[_0x2720fe(0x149)]}),{'ok':!![]};}},{'service':a29_0x5b3984(0x14d),'command':a29_0x5b3984(0x147),'description':a29_0x5b3984(0x141),'risk':a29_0x5b3984(0x14f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x111362){const _0xf05646=a29_0x5b3984;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0xf05646(0x13c)](_0xf05646(0x150))):console[_0xf05646(0x13c)](_0xf05646(0x14c)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x49985b=a30_0x53b2;function a30_0x53b2(_0x173810,_0x5dc9ea){_0x173810=_0x173810-0x15e;const _0x5508eb=a30_0x5508();let _0x53b284=_0x5508eb[_0x173810];return _0x53b284;}(function(_0x4e2171,_0x34c931){const _0x586f8c=a30_0x53b2,_0x3cc293=_0x4e2171();while(!![]){try{const _0x4a6065=-parseInt(_0x586f8c(0x1b3))/0x1*(parseInt(_0x586f8c(0x165))/0x2)+parseInt(_0x586f8c(0x17b))/0x3*(-parseInt(_0x586f8c(0x18a))/0x4)+parseInt(_0x586f8c(0x161))/0x5*(-parseInt(_0x586f8c(0x174))/0x6)+-parseInt(_0x586f8c(0x19b))/0x7+-parseInt(_0x586f8c(0x188))/0x8*(-parseInt(_0x586f8c(0x176))/0x9)+-parseInt(_0x586f8c(0x16b))/0xa+-parseInt(_0x586f8c(0x1b4))/0xb*(-parseInt(_0x586f8c(0x193))/0xc);if(_0x4a6065===_0x34c931)break;else _0x3cc293['push'](_0x3cc293['shift']());}catch(_0x1b204a){_0x3cc293['push'](_0x3cc293['shift']());}}}(a30_0x5508,0xca4a0));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{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_0x49985b(0x1b5),'command':a30_0x49985b(0x18e),'description':a30_0x49985b(0x175),'risk':'write','flags':[{'name':a30_0x49985b(0x1aa),'type':'string','required':!![],'enum':[a30_0x49985b(0x1ab),a30_0x49985b(0x17a),a30_0x49985b(0x177)],'description':a30_0x49985b(0x199)},{'name':a30_0x49985b(0x16d),'type':'string','required':!![],'description':a30_0x49985b(0x197)},{'name':a30_0x49985b(0x19c),'type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x1a2)},{'name':'alias','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x1a5)},{'name':'datasetcode','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x185)},{'name':'operation-type','type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x181)},{'name':a30_0x49985b(0x18b),'type':a30_0x49985b(0x17d),'description':a30_0x49985b(0x183),'enum':[a30_0x49985b(0x173),'after']}],async 'validate'(_0x53f5c1){const _0x469a92=a30_0x49985b,_0x378c07=_0x53f5c1[_0x469a92(0x16e)](_0x469a92(0x16d));if(!isValidBffFunctionName(_0x378c07))throw CliErrors[_0x469a92(0x18d)]('Invalid\x20function\x20name\x20\x22'+_0x378c07+_0x469a92(0x1ac));},async 'execute'(_0x5566cd){const _0x1fdd49=a30_0x49985b,_0x2881ef=loadBffProjectConfig(_0x5566cd[_0x1fdd49(0x16f)]),_0x5aa09e=_0x5566cd[_0x1fdd49(0x16e)](_0x1fdd49(0x1aa)),_0xb8917d=_0x5566cd[_0x1fdd49(0x16e)]('name'),_0x4ad779=_0x5566cd[_0x1fdd49(0x16e)](_0x1fdd49(0x19c))||undefined,_0x49b1c0=_0x5aa09e==='HOOK'?await resolveHookOptions(_0x2881ef,_0x5566cd):undefined,_0x43772a=buildFilePath(_0x2881ef,_0x5aa09e,_0xb8917d,_0x49b1c0);if(await fileExists(_0x43772a))throw CliErrors[_0x1fdd49(0x18d)](_0x1fdd49(0x172)+_0x43772a);await mkdir(dirname(_0x43772a),{'recursive':!![]});const _0x237aba=generateTemplate(_0x5aa09e,_0xb8917d,_0x5566cd[_0x1fdd49(0x16f)],_0x4ad779,_0x49b1c0);await writeFile(_0x43772a,_0x237aba,_0x1fdd49(0x1b1));const _0x1890ea={'type':_0x5aa09e,'name':_0xb8917d,'path':_0x43772a};if(_0x4ad779)_0x1890ea[_0x1fdd49(0x19c)]=_0x4ad779;if(_0x49b1c0){if(_0x49b1c0[_0x1fdd49(0x1a6)])_0x1890ea['alias']=_0x49b1c0[_0x1fdd49(0x1a6)];_0x1890ea[_0x1fdd49(0x1b0)]=_0x49b1c0[_0x1fdd49(0x1b0)],_0x1890ea[_0x1fdd49(0x17f)]=_0x49b1c0[_0x1fdd49(0x17f)],_0x1890ea[_0x1fdd49(0x1ad)]=_0x49b1c0[_0x1fdd49(0x1ad)];}return{'ok':!![],'data':_0x1890ea,'message':_0x1fdd49(0x180)+_0x5aa09e+'\x20function:\x20'+_0xb8917d};}};async function resolveHookOptions(_0x5586fe,_0x15bb88){const _0x452f7d=a30_0x49985b,_0x5b359b=loadAliasMap(_0x15bb88['apiDir'],undefined,resolveApiFilePath(_0x15bb88[_0x452f7d(0x192)],_0x15bb88[_0x452f7d(0x16f)])),_0x3e897d=_0x5b359b[_0x452f7d(0x189)]>0x0;let _0x192513,_0x1ec5d2,_0x489325;const _0x156267=_0x15bb88['str'](_0x452f7d(0x1a6)),_0x3bab2e=_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x1a1));if(_0x156267){const _0x33c664=resolveAlias(_0x15bb88[_0x452f7d(0x192)],_0x156267,undefined,resolveApiFilePath(_0x15bb88['apiDir'],_0x15bb88['appCode']));if(!_0x33c664){const _0x4d5d58=_0x3e897d?_0x452f7d(0x1a0)+_0x5b359b['map'](_0x735d18=>_0x735d18[_0x452f7d(0x1a6)])['join'](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x452f7d(0x1b2);throw CliErrors['validation']('Alias\x20\x22'+_0x156267+_0x452f7d(0x18f)+_0x4d5d58);}_0x192513=_0x156267,_0x1ec5d2=_0x33c664;}else{if(_0x3bab2e){_0x1ec5d2=_0x3bab2e;const _0x23f625=_0x5b359b['find'](_0x325b73=>_0x325b73[_0x452f7d(0x1b0)]===_0x3bab2e);_0x192513=_0x23f625?.[_0x452f7d(0x1a6)];}else{if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x169));else{if(_0x3e897d){const _0x275e6e=_0x5b359b['map'](_0x249e04=>_0x249e04[_0x452f7d(0x1a6)]+'\x20('+_0x249e04['tableName']+')'),_0x3cfbce=await promptSelect(_0x452f7d(0x16c),_0x275e6e),_0x2b7feb=_0x5b359b[_0x3cfbce];if(!_0x2b7feb)throw CliErrors['validation'](_0x452f7d(0x170));_0x192513=_0x2b7feb[_0x452f7d(0x1a6)],_0x1ec5d2=_0x2b7feb['datasetCode'];}else{const _0x546c22=await listDatasets(_0x15bb88['appCode']);if(_0x546c22[_0x452f7d(0x189)]===0x0)throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x162));const _0x3377d1=_0x546c22[_0x452f7d(0x160)](_0x8d19b9=>_0x8d19b9[_0x452f7d(0x16d)]+'\x20['+(_0x8d19b9[_0x452f7d(0x190)]??'UNKNOWN')+_0x452f7d(0x1b7)+_0x8d19b9[_0x452f7d(0x19a)]+')'),_0x140e2a=await promptSelect(_0x452f7d(0x16c),_0x3377d1),_0x1e9476=_0x546c22[_0x140e2a];if(!_0x1e9476)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x1ec5d2=_0x1e9476[_0x452f7d(0x19a)],_0x192513=undefined;}}}}const _0x369644=await listDatasets(_0x15bb88[_0x452f7d(0x16f)]),_0x4e9bfb=_0x369644[_0x452f7d(0x17c)](_0x21218f=>_0x21218f[_0x452f7d(0x19a)]===_0x1ec5d2);if(!_0x4e9bfb)throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x19f)+_0x1ec5d2+_0x452f7d(0x186)+(_0x192513?_0x452f7d(0x196)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x489325=_0x4e9bfb['id'];const _0x5e7215=_0x192513??_0x1ec5d2,_0x5f5441=await listBffDatasetOperations(_0x15bb88['appCode'],_0x489325),_0x32232f=_0x5f5441?Object['keys'](_0x5f5441):[];if(_0x32232f['length']===0x0)throw CliErrors[_0x452f7d(0x18d)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x5e7215+'.');let _0x5c43d4;const _0x52da10=_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x184));if(_0x52da10){if(!_0x32232f[_0x452f7d(0x15f)](_0x52da10))throw CliErrors[_0x452f7d(0x18d)](_0x452f7d(0x1a8)+_0x52da10+_0x452f7d(0x195)+_0x5e7215+'.\x20'+(_0x452f7d(0x167)+_0x32232f['join'](',\x20')));_0x5c43d4=_0x52da10;}else{if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x1a9));const _0x5e778c=await promptSelect('Select\x20operation\x20type:',_0x32232f);_0x5c43d4=_0x32232f[_0x5e778c]??_0x32232f[0x0];}let _0x3c09ec=normalizeHookFunctionNode(_0x15bb88['str'](_0x452f7d(0x18b)));if(!_0x3c09ec){if(_0x15bb88[_0x452f7d(0x16e)](_0x452f7d(0x18b)))throw CliErrors['validation'](_0x452f7d(0x179));if(_0x15bb88[_0x452f7d(0x198)])throw CliErrors['validation'](_0x452f7d(0x16a));const _0x47649a=await promptSelect(_0x452f7d(0x191),[_0x452f7d(0x173),_0x452f7d(0x1a7)]);_0x3c09ec=[_0x452f7d(0x173),_0x452f7d(0x1a7)][_0x47649a]??_0x452f7d(0x173);}return{'alias':_0x192513,'datasetCode':_0x1ec5d2,'datasetId':_0x489325,'operationType':_0x5c43d4,'functionNode':_0x3c09ec};}async function promptSelect(_0x9f14a5,_0x53462a){const _0x5e324c=a30_0x49985b;if(_0x53462a['length']===0x1)return 0x0;for(const [_0x132344,_0x29f49a]of _0x53462a['entries']()){process[_0x5e324c(0x171)][_0x5e324c(0x1a3)]('\x20\x20'+(_0x132344+0x1)+'.\x20'+_0x29f49a+'\x0a');}const _0x41b261=createInterface({'input':process[_0x5e324c(0x187)],'output':process['stderr']});while(!![]){const _0x22931a=await new Promise(_0x273f66=>{const _0x81805c=_0x5e324c;_0x41b261[_0x81805c(0x1b6)](_0x9f14a5+'\x20',_0x273f66);}),_0x486de6=Number[_0x5e324c(0x19d)](_0x22931a[_0x5e324c(0x18c)](),0xa);if(Number[_0x5e324c(0x164)](_0x486de6)&&_0x486de6>=0x1&&_0x486de6<=_0x53462a[_0x5e324c(0x189)])return _0x41b261[_0x5e324c(0x1bd)](),_0x486de6-0x1;process[_0x5e324c(0x171)]['write'](_0x5e324c(0x1ae)+_0x53462a[_0x5e324c(0x189)]+'.\x0a');}}function a30_0x5508(){const _0x417929=['45AcVMpJ','find','string','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','operationType','Created\x20','Operation\x20type\x20(HOOK\x20only)','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Trigger\x20node\x20(HOOK\x20only)','operation-type','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x22.\x20','stdin','8hQhjBF','length','16860kKmtaV','function-node','trim','validation','create','\x22\x20not\x20found.\x20','source','Select\x20trigger\x20node:','apiDir','12qLmNvf','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22\x20not\x20found\x20for\x20dataset\x20','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Function\x20name\x20(valid\x20JS\x20identifier)','nonInteractive','Script\x20type','code','7895706bMKxuO','description','parseInt','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Dataset\x20not\x20found\x20for\x20code\x20\x22','Available\x20aliases:\x20','datasetcode','Script\x20description','write','.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','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','alias','after','Operation\x20type\x20\x22','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','type','COMMON','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','functionNode','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\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','datasetCode','utf8','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','1031686bcoIcD','52518829WqcSwE','bff','question',']\x20(','TODO:\x20add\x20script\x20description','\x0a\x20*\x20[触发节点]\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','.js','scriptsRootDir','close','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','includes','map','413790NfpOdj','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x20[脚本名称]\x20','isInteger','2bwZBgm','\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','Available:\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','13629410EDJjxb','Select\x20dataset:','name','str','appCode','Invalid\x20dataset\x20selection.','stderr','File\x20already\x20exists:\x20','before','78OxlXDu','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','6442209ReQcKE','HOOK','HOOK\x20requires\x20alias/operation/node\x20options.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','ENDPOINT'];a30_0x5508=function(){return _0x417929;};return a30_0x5508();}function buildFilePath(_0x1af05b,_0x91a7c7,_0x3e3bb1,_0x3b4bac){const _0x31cfd3=a30_0x49985b;if(_0x91a7c7===_0x31cfd3(0x177)){if(!_0x3b4bac)throw CliErrors['validation'](_0x31cfd3(0x178));const _0x39e3cd=_0x3b4bac['alias']??_0x3b4bac[_0x31cfd3(0x1b0)];return join(_0x1af05b[_0x31cfd3(0x1bc)],_0x31cfd3(0x177),_0x39e3cd,_0x3b4bac[_0x31cfd3(0x17f)],_0x3b4bac[_0x31cfd3(0x1ad)],_0x3e3bb1+'.js');}return join(_0x1af05b[_0x31cfd3(0x1bc)],_0x91a7c7,_0x3e3bb1+_0x31cfd3(0x1bb));}export function generateTemplate(_0x51b2f8,_0xb5f9f5,_0x30290c,_0x2e8fb4,_0x2c874b){const _0x11c988=a30_0x49985b,_0x2824b5=_0x2e8fb4?.['trim']()||_0x11c988(0x1b8);if(_0x51b2f8===_0x11c988(0x1ab))return _0x11c988(0x1ba)+_0x2824b5+_0x11c988(0x163)+_0xb5f9f5+_0x11c988(0x19e)+_0xb5f9f5+_0x11c988(0x1a4)+_0xb5f9f5+_0x11c988(0x168);if(_0x51b2f8===_0x11c988(0x17a))return _0x11c988(0x182)+_0x2824b5+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x30290c+'/'+_0xb5f9f5+_0x11c988(0x1af)+_0xb5f9f5+_0x11c988(0x168);if(!_0x2c874b)throw CliErrors['validation'](_0x11c988(0x17e));return _0x11c988(0x194)+_0x2824b5+_0x11c988(0x15e)+_0x30290c+'/'+_0x2c874b[_0x11c988(0x1b0)]+'/'+_0x2c874b['operationType']+_0x11c988(0x1b9)+_0x2c874b[_0x11c988(0x1ad)]+_0x11c988(0x166)+_0xb5f9f5+_0x11c988(0x168);}
|
|
1
|
+
const a30_0x3474b0=a30_0x40e2;(function(_0x151c01,_0x36bb5e){const _0x513ee2=a30_0x40e2,_0x327572=_0x151c01();while(!![]){try{const _0x2a7b5c=parseInt(_0x513ee2(0x108))/0x1*(parseInt(_0x513ee2(0xf5))/0x2)+parseInt(_0x513ee2(0x122))/0x3*(parseInt(_0x513ee2(0x13f))/0x4)+-parseInt(_0x513ee2(0x12e))/0x5+-parseInt(_0x513ee2(0x112))/0x6+parseInt(_0x513ee2(0x10f))/0x7*(parseInt(_0x513ee2(0xef))/0x8)+-parseInt(_0x513ee2(0x136))/0x9+-parseInt(_0x513ee2(0x110))/0xa*(parseInt(_0x513ee2(0x140))/0xb);if(_0x2a7b5c===_0x36bb5e)break;else _0x327572['push'](_0x327572['shift']());}catch(_0x5c5887){_0x327572['push'](_0x327572['shift']());}}}(a30_0x2898,0xb647a));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_0x2898(){const _0x576e18=['parseInt','Invalid\x20dataset\x20selection.','ENDPOINT','code','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x0a\x20*\x20[脚本名称]\x20','str','94675dNyeJM','apiDir','question','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','operation-type','appCode','after','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','11762631cCBzDs','HOOK\x20requires\x20alias/operation/node\x20options.','stderr','string','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Trigger\x20node\x20(HOOK\x20only)','No\x20datasets\x20found\x20for\x20this\x20app.','scriptsRootDir','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','5567612WZxEmK','231bEGqDm','validation','\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','alias','join','Operation\x20type\x20\x22','8241272lQyumE','\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','\x20api\x20pull`\x20to\x20refresh.','bff','description','type','8kyUSyG','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x20function:\x20','Operation\x20type\x20(HOOK\x20only)','Select\x20dataset:','operationType','before','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','includes','Script\x20description','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Script\x20type','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','.js','\x0a\x20*\x20[触发节点]\x20','name','UNKNOWN','HOOK','234564ZyRayM','nonInteractive','Invalid\x20function\x20name\x20\x22','read','map','Select\x20trigger\x20node:','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','7VsPomq','596280pqroPI','Available\x20aliases:\x20','213708hdhONm','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','isInteger','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','length','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','find','trim','\x22.\x20','functionNode','datasetcode','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','write','\x22\x20not\x20found.\x20','create','datasetCode','3jlhJva','.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','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Function\x20name\x20(valid\x20JS\x20identifier)',']\x20('];a30_0x2898=function(){return _0x576e18;};return a30_0x2898();}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a30_0x40e2(_0x30e503,_0x5cb380){_0x30e503=_0x30e503-0xea;const _0x289819=a30_0x2898();let _0x40e2eb=_0x289819[_0x30e503];return _0x40e2eb;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x3474b0(0xf2),'command':a30_0x3474b0(0x120),'description':a30_0x3474b0(0xf6),'risk':a30_0x3474b0(0x10b),'flags':[{'name':a30_0x3474b0(0xf4),'type':a30_0x3474b0(0x139),'required':!![],'enum':['COMMON',a30_0x3474b0(0x129),a30_0x3474b0(0x107)],'description':a30_0x3474b0(0x101)},{'name':a30_0x3474b0(0x105),'type':a30_0x3474b0(0x139),'required':!![],'description':a30_0x3474b0(0x125)},{'name':a30_0x3474b0(0xf3),'type':a30_0x3474b0(0x139),'description':a30_0x3474b0(0xfe)},{'name':a30_0x3474b0(0xec),'type':a30_0x3474b0(0x139),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x3474b0(0x11c),'type':a30_0x3474b0(0x139),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a30_0x3474b0(0x132),'type':'string','description':a30_0x3474b0(0xf8)},{'name':'function-node','type':'string','description':a30_0x3474b0(0x13b),'enum':[a30_0x3474b0(0xfb),a30_0x3474b0(0x134)]}],async 'validate'(_0x100f85){const _0x25703a=a30_0x3474b0,_0x33ae00=_0x100f85['str']('name');if(!isValidBffFunctionName(_0x33ae00))throw CliErrors['validation'](_0x25703a(0x10a)+_0x33ae00+_0x25703a(0x131));},async 'execute'(_0x435f8e){const _0x368b29=a30_0x3474b0,_0x2551b0=loadBffProjectConfig(_0x435f8e[_0x368b29(0x133)]),_0x103d6c=_0x435f8e['str'](_0x368b29(0xf4)),_0x49e77c=_0x435f8e[_0x368b29(0x12d)]('name'),_0x3d9382=_0x435f8e[_0x368b29(0x12d)](_0x368b29(0xf3))||undefined,_0x507220=_0x103d6c===_0x368b29(0x107)?await resolveHookOptions(_0x2551b0,_0x435f8e):undefined,_0x7eefa8=buildFilePath(_0x2551b0,_0x103d6c,_0x49e77c,_0x507220);if(await fileExists(_0x7eefa8))throw CliErrors[_0x368b29(0xea)]('File\x20already\x20exists:\x20'+_0x7eefa8);await mkdir(dirname(_0x7eefa8),{'recursive':!![]});const _0x30d304=generateTemplate(_0x103d6c,_0x49e77c,_0x435f8e['appCode'],_0x3d9382,_0x507220);await writeFile(_0x7eefa8,_0x30d304,'utf8');const _0x405b91={'type':_0x103d6c,'name':_0x49e77c,'path':_0x7eefa8};if(_0x3d9382)_0x405b91[_0x368b29(0xf3)]=_0x3d9382;if(_0x507220){if(_0x507220['alias'])_0x405b91[_0x368b29(0xec)]=_0x507220[_0x368b29(0xec)];_0x405b91[_0x368b29(0x121)]=_0x507220[_0x368b29(0x121)],_0x405b91[_0x368b29(0xfa)]=_0x507220['operationType'],_0x405b91[_0x368b29(0x11b)]=_0x507220[_0x368b29(0x11b)];}return{'ok':!![],'data':_0x405b91,'message':'Created\x20'+_0x103d6c+_0x368b29(0xf7)+_0x49e77c};}};async function resolveHookOptions(_0x3cd519,_0x33a54f){const _0x40b058=a30_0x3474b0,_0x2079c7=loadAliasMap(_0x33a54f[_0x40b058(0x12f)],undefined,resolveApiFilePath(_0x33a54f[_0x40b058(0x12f)],_0x33a54f[_0x40b058(0x133)])),_0x38061d=_0x2079c7[_0x40b058(0x116)]>0x0;let _0x4a653f,_0xddcb59,_0x257280;const _0x930ac2=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0xec)),_0x1e1a62=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0x11c));if(_0x930ac2){const _0x4d7f27=resolveAlias(_0x33a54f[_0x40b058(0x12f)],_0x930ac2,undefined,resolveApiFilePath(_0x33a54f[_0x40b058(0x12f)],_0x33a54f['appCode']));if(!_0x4d7f27){const _0x4adaf1=_0x38061d?_0x40b058(0x111)+_0x2079c7[_0x40b058(0x10c)](_0x3ccb38=>_0x3ccb38['alias'])[_0x40b058(0xed)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x40b058(0x113);throw CliErrors[_0x40b058(0xea)]('Alias\x20\x22'+_0x930ac2+_0x40b058(0x11f)+_0x4adaf1);}_0x4a653f=_0x930ac2,_0xddcb59=_0x4d7f27;}else{if(_0x1e1a62){_0xddcb59=_0x1e1a62;const _0x5f1084=_0x2079c7[_0x40b058(0x118)](_0x289450=>_0x289450[_0x40b058(0x121)]===_0x1e1a62);_0x4a653f=_0x5f1084?.['alias'];}else{if(_0x33a54f['nonInteractive'])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x100));else{if(_0x38061d){const _0x162185=_0x2079c7[_0x40b058(0x10c)](_0x133fbb=>_0x133fbb['alias']+'\x20('+_0x133fbb['tableName']+')'),_0x55d99c=await promptSelect(_0x40b058(0xf9),_0x162185),_0x4d75d6=_0x2079c7[_0x55d99c];if(!_0x4d75d6)throw CliErrors[_0x40b058(0xea)]('Invalid\x20dataset\x20selection.');_0x4a653f=_0x4d75d6[_0x40b058(0xec)],_0xddcb59=_0x4d75d6[_0x40b058(0x121)];}else{const _0x5409b2=await listDatasets(_0x33a54f[_0x40b058(0x133)]);if(_0x5409b2[_0x40b058(0x116)]===0x0)throw CliErrors[_0x40b058(0xea)](_0x40b058(0x13c));const _0x19d629=_0x5409b2[_0x40b058(0x10c)](_0x5a44b1=>_0x5a44b1[_0x40b058(0x105)]+'\x20['+(_0x5a44b1['source']??_0x40b058(0x106))+_0x40b058(0x126)+_0x5a44b1[_0x40b058(0x12a)]+')'),_0x18e1cd=await promptSelect('Select\x20dataset:',_0x19d629),_0x4954db=_0x5409b2[_0x18e1cd];if(!_0x4954db)throw CliErrors[_0x40b058(0xea)](_0x40b058(0x128));_0xddcb59=_0x4954db['code'],_0x4a653f=undefined;}}}}const _0x518192=await listDatasets(_0x33a54f[_0x40b058(0x133)]),_0x155c3b=_0x518192[_0x40b058(0x118)](_0x15f370=>_0x15f370[_0x40b058(0x12a)]===_0xddcb59);if(!_0x155c3b)throw CliErrors[_0x40b058(0xea)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0xddcb59+_0x40b058(0x11a)+(_0x4a653f?_0x40b058(0x102)+CLI_BIN_NAME+_0x40b058(0xf1):''));_0x257280=_0x155c3b['id'];const _0x11338c=_0x4a653f??_0xddcb59,_0x55f859=await listBffDatasetOperations(_0x33a54f[_0x40b058(0x133)],_0x257280),_0x107c24=_0x55f859?Object['keys'](_0x55f859):[];if(_0x107c24[_0x40b058(0x116)]===0x0)throw CliErrors[_0x40b058(0xea)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x11338c+'.');let _0x5eabf8;const _0x239e5d=_0x33a54f[_0x40b058(0x12d)](_0x40b058(0x132));if(_0x239e5d){if(!_0x107c24[_0x40b058(0xfd)](_0x239e5d))throw CliErrors[_0x40b058(0xea)](_0x40b058(0xee)+_0x239e5d+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x11338c+'.\x20'+('Available:\x20'+_0x107c24[_0x40b058(0xed)](',\x20')));_0x5eabf8=_0x239e5d;}else{if(_0x33a54f[_0x40b058(0x109)])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x135));const _0x26cef9=await promptSelect('Select\x20operation\x20type:',_0x107c24);_0x5eabf8=_0x107c24[_0x26cef9]??_0x107c24[0x0];}let _0x1eb4c6=normalizeHookFunctionNode(_0x33a54f[_0x40b058(0x12d)]('function-node'));if(!_0x1eb4c6){if(_0x33a54f['str']('function-node'))throw CliErrors[_0x40b058(0xea)](_0x40b058(0xfc));if(_0x33a54f['nonInteractive'])throw CliErrors[_0x40b058(0xea)](_0x40b058(0x10e));const _0x682fd7=await promptSelect(_0x40b058(0x10d),[_0x40b058(0xfb),_0x40b058(0x134)]);_0x1eb4c6=[_0x40b058(0xfb),_0x40b058(0x134)][_0x682fd7]??_0x40b058(0xfb);}return{'alias':_0x4a653f,'datasetCode':_0xddcb59,'datasetId':_0x257280,'operationType':_0x5eabf8,'functionNode':_0x1eb4c6};}async function promptSelect(_0x1d4df6,_0x4c1bdc){const _0x566272=a30_0x3474b0;if(_0x4c1bdc['length']===0x1)return 0x0;for(const [_0x5b037a,_0x5825e3]of _0x4c1bdc['entries']()){process[_0x566272(0x138)][_0x566272(0x11e)]('\x20\x20'+(_0x5b037a+0x1)+'.\x20'+_0x5825e3+'\x0a');}const _0x69b7b8=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x2b2c53=await new Promise(_0x3e74b0=>{const _0x1622ba=_0x566272;_0x69b7b8[_0x1622ba(0x130)](_0x1d4df6+'\x20',_0x3e74b0);}),_0x7a5078=Number[_0x566272(0x127)](_0x2b2c53[_0x566272(0x119)](),0xa);if(Number[_0x566272(0x114)](_0x7a5078)&&_0x7a5078>=0x1&&_0x7a5078<=_0x4c1bdc[_0x566272(0x116)])return _0x69b7b8['close'](),_0x7a5078-0x1;process['stderr'][_0x566272(0x11e)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x4c1bdc[_0x566272(0x116)]+'.\x0a');}}function buildFilePath(_0x340946,_0x43f20b,_0x5b2561,_0x1c712c){const _0x3a5114=a30_0x3474b0;if(_0x43f20b==='HOOK'){if(!_0x1c712c)throw CliErrors['validation'](_0x3a5114(0x137));const _0x1f3a1e=_0x1c712c[_0x3a5114(0xec)]??_0x1c712c['datasetCode'];return join(_0x340946[_0x3a5114(0x13d)],_0x3a5114(0x107),_0x1f3a1e,_0x1c712c[_0x3a5114(0xfa)],_0x1c712c[_0x3a5114(0x11b)],_0x5b2561+'.js');}return join(_0x340946[_0x3a5114(0x13d)],_0x43f20b,_0x5b2561+_0x3a5114(0x103));}export function generateTemplate(_0x34aa63,_0x466942,_0x38d3fc,_0x124ceb,_0x3fa669){const _0x23419e=a30_0x3474b0,_0x9a890f=_0x124ceb?.['trim']()||'TODO:\x20add\x20script\x20description';if(_0x34aa63==='COMMON')return _0x23419e(0x124)+_0x9a890f+_0x23419e(0x12c)+_0x466942+_0x23419e(0x12b)+_0x466942+_0x23419e(0x123)+_0x466942+_0x23419e(0x13a);if(_0x34aa63===_0x23419e(0x129))return _0x23419e(0xff)+_0x9a890f+_0x23419e(0x117)+_0x38d3fc+'/'+_0x466942+_0x23419e(0xeb)+_0x466942+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x3fa669)throw CliErrors[_0x23419e(0xea)](_0x23419e(0x115));return _0x23419e(0x11d)+_0x9a890f+_0x23419e(0x13e)+_0x38d3fc+'/'+_0x3fa669[_0x23419e(0x121)]+'/'+_0x3fa669['operationType']+_0x23419e(0x104)+_0x3fa669[_0x23419e(0x11b)]+_0x23419e(0xf0)+_0x466942+_0x23419e(0x13a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a31_0x590a(){const _0x580c81=['\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','functions','34656ijCaoU','validation','\x22\x20not\x20found\x20after\x20ensureLockScope.','240qSwFhz','<timestamp>','bff','Function\x20not\x20found:\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','scriptsRootDir','includes','Multiple\x20functions\x20match\x20\x22','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','1368860BRoqAe','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','/api/management/library/scripts/delete','delete','lastSync','remoteId','18vasefG','appCode','join','\x20\x20-\x20','1819755XvFoAz','Lock\x20scope\x20for\x20app\x20\x22','BFF\x20lock\x20file\x20not\x20found.','stringify','340098VgDPHp','54296RuIRCj','replace','48643oGNHUm','str','length','apps','scriptsRoot','split','Local\x20delete\x20not\x20settled\x20for\x20','15304bblZRd','keys','POST','projectRoot','target','map','trashDir','\x20(local\x20file\x20moved\x20to\x20trash)','high-risk-write','lockFilePath','2kKYSog','trashedTo','parse'];a31_0x590a=function(){return _0x580c81;};return a31_0x590a();}const a31_0x25ea0c=a31_0x42a8;(function(_0x26390e,_0x23552e){const _0x2ca57d=a31_0x42a8,_0x3c4775=_0x26390e();while(!![]){try{const _0x2b81e5=parseInt(_0x2ca57d(0xd7))/0x1+parseInt(_0x2ca57d(0xd2))/0x2*(-parseInt(_0x2ca57d(0xf1))/0x3)+-parseInt(_0x2ca57d(0xc8))/0x4*(parseInt(_0x2ca57d(0xda))/0x5)+parseInt(_0x2ca57d(0xe9))/0x6*(parseInt(_0x2ca57d(0xf4))/0x7)+parseInt(_0x2ca57d(0xf2))/0x8+parseInt(_0x2ca57d(0xed))/0x9+parseInt(_0x2ca57d(0xe3))/0xa;if(_0x2b81e5===_0x23552e)break;else _0x3c4775['push'](_0x3c4775['shift']());}catch(_0xfd9052){_0x3c4775['push'](_0x3c4775['shift']());}}}(a31_0x590a,0x197a5));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a31_0x42a8(_0x58e429,_0x2bdb4d){_0x58e429=_0x58e429-0xc5;const _0x590af6=a31_0x590a();let _0x42a85e=_0x590af6[_0x58e429];return _0x42a85e;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a31_0x25ea0c(0xdc),'command':a31_0x25ea0c(0xe6),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x25ea0c(0xd0),'flags':[{'name':a31_0x25ea0c(0xcc),'type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x4a2ad7){const _0x3a582e=a31_0x25ea0c,_0xc16985=loadBffProjectConfig(_0x4a2ad7[_0x3a582e(0xea)]),_0x3a29a5=await readBffLockFile(_0xc16985['lockFilePath']);if(!_0x3a29a5)throw CliErrors['validation'](_0x3a582e(0xe4));},async 'dryRun'(_0x3da544){const _0x2ca126=a31_0x25ea0c,_0x2f04c2=loadBffProjectConfig(_0x3da544['appCode']),_0xdb417e=await readBffLockFile(_0x2f04c2[_0x2ca126(0xd1)]);if(!_0xdb417e)throw CliErrors[_0x2ca126(0xd8)](_0x2ca126(0xef));const {appLock:_0x2f60e3}=ensureLockScope(_0xdb417e,_0x3da544[_0x2ca126(0xea)],_0x2f04c2[_0x2ca126(0xc5)],'delete'),_0x184fda=_0x3da544['str']('target'),_0x1d60a7=Object[_0x2ca126(0xc9)](_0x2f60e3[_0x2ca126(0xd6)]),_0x4e9234=resolveDeleteTarget(_0x184fda,_0x1d60a7),_0x207a04=_0x2f60e3['functions'][_0x4e9234];if(!_0x207a04)throw CliErrors[_0x2ca126(0xd8)](_0x2ca126(0xde)+_0x4e9234+'\x22.');const _0x2040b8=resolveLocalFilePathFromLockKey(_0x2f04c2,_0x4e9234),_0x37e6de=relative(_0x2f04c2[_0x2ca126(0xcb)],_0x2040b8),_0x1f08e0=join(_0x2f04c2['trashDir'],_0x2ca126(0xdb),_0x37e6de);return{'method':_0x2ca126(0xca),'url':_0x2ca126(0xe5),'body':{'appCode':_0x3da544[_0x2ca126(0xea)],'target':_0x4e9234,'remoteId':_0x207a04[_0x2ca126(0xe8)],'localFilePath':_0x2040b8,'trashedPath':_0x1f08e0},'description':'Would\x20delete\x20'+_0x4e9234+_0x2ca126(0xd5)};},async 'execute'(_0x780d96){const _0x4967a0=a31_0x25ea0c,_0x47773a=loadBffProjectConfig(_0x780d96[_0x4967a0(0xea)]),_0x5843da=await readBffLockFile(_0x47773a[_0x4967a0(0xd1)]);if(!_0x5843da)throw CliErrors[_0x4967a0(0xd8)](_0x4967a0(0xef));const {lockData:_0xa9f05e,appLock:_0x4e420c}=ensureLockScope(_0x5843da,_0x780d96[_0x4967a0(0xea)],_0x47773a['scriptsRoot'],_0x4967a0(0xe6)),_0x34b05c=JSON[_0x4967a0(0xd4)](JSON[_0x4967a0(0xf0)](_0xa9f05e)),_0x583748=_0x34b05c[_0x4967a0(0xf7)][_0x780d96[_0x4967a0(0xea)]];if(!_0x583748)throw new Error(_0x4967a0(0xee)+_0x780d96['appCode']+_0x4967a0(0xd9));const _0x4be4f2=_0x780d96[_0x4967a0(0xf5)](_0x4967a0(0xcc)),_0x1f230a=Object['keys'](_0x583748[_0x4967a0(0xd6)]),_0xb41c8=resolveDeleteTarget(_0x4be4f2,_0x1f230a),_0x449996=_0x583748[_0x4967a0(0xd6)][_0xb41c8];if(!_0x449996)throw CliErrors['validation'](_0x4967a0(0xde)+_0xb41c8+'\x22.');await deleteBffScript(_0x449996[_0x4967a0(0xe8)]),delete _0x583748[_0x4967a0(0xd6)][_0xb41c8],_0x583748[_0x4967a0(0xe7)]=new Date()['toISOString'](),await writeBffLockFile(_0x47773a[_0x4967a0(0xd1)],_0x34b05c);const _0x2caac4=resolveLocalFilePathFromLockKey(_0x47773a,_0xb41c8);let _0x178989;await fileExists(_0x2caac4)&&(_0x178989=await moveToTrash(_0x47773a[_0x4967a0(0xcb)],_0x47773a[_0x4967a0(0xce)],_0x2caac4),await cleanupEmptyDirectories(dirname(_0x2caac4),_0x47773a[_0x4967a0(0xdf)]));await waitForDeleteSettlement(_0x47773a[_0x4967a0(0xd1)],_0x780d96[_0x4967a0(0xea)],_0xb41c8,_0x2caac4),await sleep(0x96);const _0x5d2ef4={'deleted':_0xb41c8,'remoteId':_0x449996['remoteId']};if(_0x178989)_0x5d2ef4[_0x4967a0(0xd3)]=_0x178989;return{'ok':!![],'data':_0x5d2ef4,'message':'Deleted\x20'+_0xb41c8+(_0x178989?_0x4967a0(0xcf):'')};}};function resolveDeleteTarget(_0x55eecc,_0xd48abf){const _0x4c5118=a31_0x25ea0c;if(_0x55eecc[_0x4c5118(0xe0)]('/')){const _0x3b190e=_0xd48abf['find'](_0x4cbdbf=>_0x4cbdbf===_0x55eecc);if(!_0x3b190e)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x55eecc);return _0x3b190e;}const _0x536522=_0xd48abf['filter'](_0x4cc5b9=>_0x4cc5b9[_0x4c5118(0xc6)]('/')['at'](-0x1)===_0x55eecc);if(_0x536522[_0x4c5118(0xf6)]===0x0)throw CliErrors['validation'](_0x4c5118(0xdd)+_0x55eecc);if(_0x536522[_0x4c5118(0xf6)]>0x1)throw CliErrors[_0x4c5118(0xd8)](_0x4c5118(0xe1)+_0x55eecc+_0x4c5118(0xe2)+_0x536522[_0x4c5118(0xcd)](_0x768873=>_0x4c5118(0xec)+_0x768873)[_0x4c5118(0xeb)]('\x0a'));return _0x536522[0x0];}async function moveToTrash(_0x1e88b9,_0x17be73,_0x3df13a){const _0x386cec=a31_0x25ea0c,_0xf38315=new Date()['toISOString']()[_0x386cec(0xf3)](/[:.]/g,'-'),_0x116961=relative(_0x1e88b9,_0x3df13a),_0x317a07=join(_0x17be73,_0xf38315,_0x116961);return await mkdir(dirname(_0x317a07),{'recursive':!![]}),await rename(_0x3df13a,_0x317a07),_0x317a07;}async function cleanupEmptyDirectories(_0x46f2d3,_0x180e7c){const _0x4f91ce=a31_0x25ea0c;let _0x3e5317=resolve(_0x46f2d3);const _0x3d7c85=resolve(_0x180e7c);while(_0x3e5317['startsWith'](''+_0x3d7c85+sep)||_0x3e5317===_0x3d7c85){if(_0x3e5317===_0x3d7c85)return;try{const _0x3901a5=await readdir(_0x3e5317);if(_0x3901a5[_0x4f91ce(0xf6)]>0x0)return;await rmdir(_0x3e5317);}catch{return;}_0x3e5317=dirname(_0x3e5317);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x144e19,_0x24249a,_0x1c430c,_0x46ce8d){const _0x1ff84b=a31_0x25ea0c;for(let _0x26ca8a=0x0;_0x26ca8a<DELETE_SETTLE_RETRY_COUNT;_0x26ca8a+=0x1){const _0x3cb6af=await readBffLockFile(_0x144e19),_0x430deb=!!_0x3cb6af?.[_0x1ff84b(0xf7)]?.[_0x24249a]?.[_0x1ff84b(0xd6)]?.[_0x1c430c],_0x5318be=await fileExists(_0x46ce8d);if(!_0x430deb&&!_0x5318be)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x1ff84b(0xc7)+_0x1c430c+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x13cf(_0x295901,_0x589a84){_0x295901=_0x295901-0xb5;const _0x525390=a32_0x5253();let _0x13cff1=_0x525390[_0x295901];return _0x13cff1;}function a32_0x5253(){const _0x4e009d=['5psrzYw','2559784piQhLC','3062838qyoORm','17399294fWcolz','updatedTime','Return\x20full\x20raw\x20script\x20object','1438mvdQBC','read','detail','createdTime','14787jbCevp','4030UoTqaf','129SpAeQA','boolean','scriptContent','3645834CBNHMy','verbose','6226312IRHAHL','(none)','bff','num','7sRWMcM','scriptType','appCode'];a32_0x5253=function(){return _0x4e009d;};return a32_0x5253();}const a32_0x45ca73=a32_0x13cf;(function(_0x4341b0,_0x279e74){const _0x45ea9a=a32_0x13cf,_0x3ac7e4=_0x4341b0();while(!![]){try{const _0x26d25f=parseInt(_0x45ea9a(0xbd))/0x1*(parseInt(_0x45ea9a(0xb7))/0x2)+-parseInt(_0x45ea9a(0xcb))/0x3+parseInt(_0x45ea9a(0xca))/0x4+parseInt(_0x45ea9a(0xc9))/0x5*(-parseInt(_0x45ea9a(0xc0))/0x6)+parseInt(_0x45ea9a(0xc6))/0x7*(-parseInt(_0x45ea9a(0xc2))/0x8)+parseInt(_0x45ea9a(0xbb))/0x9*(parseInt(_0x45ea9a(0xbc))/0xa)+parseInt(_0x45ea9a(0xcc))/0xb;if(_0x26d25f===_0x279e74)break;else _0x3ac7e4['push'](_0x3ac7e4['shift']());}catch(_0x4f62d4){_0x3ac7e4['push'](_0x3ac7e4['shift']());}}}(a32_0x5253,0x8b16a));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x45ca73(0xc4),'command':a32_0x45ca73(0xb9),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a32_0x45ca73(0xb8),'flags':[{'name':'id','type':'number','required':!![],'description':'Script\x20ID'},{'name':a32_0x45ca73(0xc1),'type':a32_0x45ca73(0xbe),'description':a32_0x45ca73(0xb6)}],async 'execute'(_0xef052a){const _0x477010=a32_0x45ca73,_0x10f8a2=await getBffScriptInfo(_0xef052a[_0x477010(0xc5)]('id')),_0x28f981=_0xef052a['bool'](_0x477010(0xc1));if(_0x28f981)return{'ok':!![],'data':_0x10f8a2};return{'ok':!![],'data':{'id':_0x10f8a2['id'],'appCode':_0x10f8a2[_0x477010(0xc8)],'scriptType':_0x10f8a2[_0x477010(0xc7)],'description':_0x10f8a2['description']||_0x477010(0xc3),'createdTime':_0x10f8a2[_0x477010(0xba)]??'','updatedTime':_0x10f8a2[_0x477010(0xb5)]??'','scriptContent':_0x10f8a2[_0x477010(0xbf)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x14805e,_0x282713){const _0x4f2b47=a33_0x13eb,_0x178001=_0x14805e();while(!![]){try{const _0x44d379=parseInt(_0x4f2b47(0x12b))/0x1*(-parseInt(_0x4f2b47(0x12f))/0x2)+-parseInt(_0x4f2b47(0x131))/0x3*(parseInt(_0x4f2b47(0x12d))/0x4)+parseInt(_0x4f2b47(0x130))/0x5+-parseInt(_0x4f2b47(0x128))/0x6+parseInt(_0x4f2b47(0x12a))/0x7*(parseInt(_0x4f2b47(0x12c))/0x8)+-parseInt(_0x4f2b47(0x129))/0x9*(parseInt(_0x4f2b47(0x12e))/0xa)+-parseInt(_0x4f2b47(0x127))/0xb*(-parseInt(_0x4f2b47(0x132))/0xc);if(_0x44d379===_0x282713)break;else _0x178001['push'](_0x178001['shift']());}catch(_0x2343ca){_0x178001['push'](_0x178001['shift']());}}}(a33_0x233e,0x3ed56));function a33_0x233e(){const _0x433c4a=['15XVhMpJ','4164bIXqHy','26653kNkpMt','583728fbzvBW','80541LstbbV','7zSwuaW','21397OjWZQd','477592VwLktE','67036GxBiXF','510CZspyL','2xtEKiB','78825FAtzmN'];a33_0x233e=function(){return _0x433c4a;};return a33_0x233e();}import{bffList}from'../../commands/bff/list.js';function a33_0x13eb(_0x5a61ec,_0x9955b3){_0x5a61ec=_0x5a61ec-0x127;const _0x233e9e=a33_0x233e();let _0x13eb0=_0x233e9e[_0x5a61ec];return _0x13eb0;}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];
|