@lovrabet/rabetbase-cli 2.4.2 → 2.4.3
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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.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/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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 +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/react-custom-page-workflow.md +9 -3
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +13 -2
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x1d4307=a19_0x441b;(function(_0xc4d978,_0x34183c){const _0x3f0605=a19_0x441b,_0x4e8778=_0xc4d978();while(!![]){try{const _0x3c08f1=parseInt(_0x3f0605(0x1c8))/0x1+-parseInt(_0x3f0605(0x1c9))/0x2*(-parseInt(_0x3f0605(0x1e6))/0x3)+-parseInt(_0x3f0605(0x1e1))/0x4+-parseInt(_0x3f0605(0x1d1))/0x5+-parseInt(_0x3f0605(0x1cc))/0x6*(parseInt(_0x3f0605(0x1e8))/0x7)+parseInt(_0x3f0605(0x1d5))/0x8*(parseInt(_0x3f0605(0x1c7))/0x9)+parseInt(_0x3f0605(0x1dd))/0xa;if(_0x3c08f1===_0x34183c)break;else _0x4e8778['push'](_0x4e8778['shift']());}catch(_0x4d3e3c){_0x4e8778['push'](_0x4e8778['shift']());}}}(a19_0x3dd4,0x8a6ea));import{readRawConfigWithLayers}from'../../context.js';function a19_0x3dd4(){const _0x14ae37=['defaultApp','1052430ztktrt','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','projectConfig','globalPath','271280klDfKQ','boolean','bool','appcode','global','49809OptBMk','project','6209581GdRqun','length','apps','globalConfig','entries','\x20config','isCurrent','mergedCli','9IwNmel','143832Kdicxp','82AYflQg','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','remote','6HVlrnL','projectPath','object','merged','read','1328220eELroM','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','list','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','6862136SHdjhH','optional','inherit','Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.','app','\x20in\x20','validation'];a19_0x3dd4=function(){return _0x14ae37;};return a19_0x3dd4();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x25e44b,_0x448f21){const _0x22027f=a19_0x441b,_0x345862=[],_0x4ee950=_0x25e44b['apps']&&typeof _0x25e44b[_0x22027f(0x1ea)]===_0x22027f(0x1ce)?_0x25e44b[_0x22027f(0x1ea)]:{},_0x37ad80=_0x25e44b[_0x22027f(0x1dc)]||undefined;for(const [_0x1e79e8,_0x228816]of Object['entries'](_0x4ee950)){if(!_0x228816||typeof _0x228816!==_0x22027f(0x1ce)||!_0x228816['appcode'])continue;_0x345862['push']({'name':_0x1e79e8,'appcode':_0x228816[_0x22027f(0x1e4)],'named':!![],'definedIn':_0x448f21,'isDefault':_0x1e79e8===_0x37ad80,...buildAppProfileListFields(_0x228816)});}return _0x345862;}function buildMergedItems(_0x507faa,_0xffbf7b){const _0x4c93a7=a19_0x441b,{apps:apps={},defaultApp:_0x385eab}=_0x507faa,_0x3cc52c=_0xffbf7b['globalConfig']['apps']&&typeof _0xffbf7b['globalConfig'][_0x4c93a7(0x1ea)]==='object'?_0xffbf7b['globalConfig']['apps']:{},_0x2ce3ed=_0xffbf7b[_0x4c93a7(0x1df)][_0x4c93a7(0x1ea)]&&typeof _0xffbf7b[_0x4c93a7(0x1df)][_0x4c93a7(0x1ea)]==='object'?_0xffbf7b['projectConfig']['apps']:{},_0x2fdb62=_0xffbf7b[_0x4c93a7(0x1df)][_0x4c93a7(0x1d7)]===![],_0x250f99=Object[_0x4c93a7(0x1ec)](apps),_0x1e1adb=_0x250f99['map'](([_0x56a514,_0x444a7a])=>({'name':_0x56a514,'appcode':_0x444a7a[_0x4c93a7(0x1e4)],'named':!![],'definedIn':appDefinedIn(_0x56a514,_0x3cc52c,_0x2ce3ed,_0x2fdb62),'isDefault':_0x56a514===_0x385eab,...buildAppProfileListFields(_0x444a7a)}));return _0x1e1adb;}function validateAppListFlags(_0x2775cd){const _0x33f5e7=a19_0x441b;if(!_0x2775cd['bool'](_0x33f5e7(0x1cb)))return;if(!_0x2775cd[_0x33f5e7(0x1e3)](_0x33f5e7(0x1e5))&&!_0x2775cd[_0x33f5e7(0x1e3)](_0x33f5e7(0x1e7)))return;throw CliErrors[_0x33f5e7(0x1db)](_0x33f5e7(0x1de),_0x33f5e7(0x1d8));}function a19_0x441b(_0x14d8c3,_0x2c309d){_0x14d8c3=_0x14d8c3-0x1c5;const _0x3dd4aa=a19_0x3dd4();let _0x441bef=_0x3dd4aa[_0x14d8c3];return _0x441bef;}async function execute(_0x1197cc){const _0x838ed0=a19_0x441b;validateAppListFlags(_0x1197cc);if(_0x1197cc['bool'](_0x838ed0(0x1cb)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x1197cc)};const _0x17c6c2=_0x1197cc[_0x838ed0(0x1e3)](_0x838ed0(0x1e5)),_0x19487c=_0x1197cc['bool'](_0x838ed0(0x1e7)),_0x259e67=_0x17c6c2?'global':_0x19487c?_0x838ed0(0x1e7):_0x838ed0(0x1cf),{config:_0x155655,layers:_0x468137}=readRawConfigWithLayers(),_0x30b653=resolveDefaultAppSource(_0x468137),{defaultApp:_0x19f8ff}=_0x155655;let _0x1034d7,_0x47bb96;switch(_0x259e67){case _0x838ed0(0x1e5):_0x1034d7=buildItemsFromLayer(_0x468137[_0x838ed0(0x1eb)],_0x838ed0(0x1e5)),_0x47bb96=_0x468137[_0x838ed0(0x1e0)];break;case _0x838ed0(0x1e7):_0x1034d7=buildItemsFromLayer(_0x468137[_0x838ed0(0x1df)],_0x838ed0(0x1e7)),_0x47bb96=_0x468137['projectPath'];break;default:_0x1034d7=buildMergedItems(_0x155655,_0x468137);break;}enrichAppListItemsWithMergedSelection(_0x1034d7,_0x1197cc[_0x838ed0(0x1c6)]);if(_0x1034d7[_0x838ed0(0x1e9)]===0x0){const _0x207f9d=_0x259e67===_0x838ed0(0x1cf)?'':_0x838ed0(0x1da)+_0x259e67+_0x838ed0(0x1ed);return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x207f9d+'.\x20Use\x20`'+CLI_BIN_NAME+_0x838ed0(0x1ca)};}const _0x3c8846=_0x1034d7['find'](_0x588e39=>_0x588e39[_0x838ed0(0x1c5)]===!![]),_0x2e18fe=_0x19f8ff??_0x3c8846?.[_0x838ed0(0x1e4)]??null,_0x187167=_0x259e67===_0x838ed0(0x1cf)?{'globalPath':_0x468137[_0x838ed0(0x1e0)]??null,'projectPath':_0x468137[_0x838ed0(0x1cd)]??null,'defaultApp':_0x2e18fe,'defaultAppSource':_0x19f8ff!=null?_0x30b653:null}:{'scope':_0x259e67,'configPath':_0x47bb96??null};return{'ok':!![],'data':{'items':_0x1034d7,'meta':_0x187167}};}export const appListDefinition={'service':a19_0x1d4307(0x1d9),'command':a19_0x1d4307(0x1d3),'description':'List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','risk':a19_0x1d4307(0x1d0),'auth':a19_0x1d4307(0x1d6),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x1d4307(0x1cb),'type':'boolean','description':a19_0x1d4307(0x1d2),'default':![]},{'name':'global','type':a19_0x1d4307(0x1e2),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':'project','type':a19_0x1d4307(0x1e2),'description':a19_0x1d4307(0x1d4),'default':![]}],async 'validate'(_0x5b631a){validateAppListFlags(_0x5b631a);},'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a20_0x2451(_0xcd94a1,_0x3712c8){_0xcd94a1=_0xcd94a1-0x196;const _0x11bba8=a20_0x11bb();let _0x245113=_0x11bba8[_0xcd94a1];return _0x245113;}const a20_0xd8081b=a20_0x2451;(function(_0x1f35e7,_0x40c4ee){const _0x3ccf53=a20_0x2451,_0xa9866=_0x1f35e7();while(!![]){try{const _0x8cc412=parseInt(_0x3ccf53(0x19d))/0x1+-parseInt(_0x3ccf53(0x19e))/0x2*(-parseInt(_0x3ccf53(0x1a5))/0x3)+-parseInt(_0x3ccf53(0x1a6))/0x4*(-parseInt(_0x3ccf53(0x19a))/0x5)+-parseInt(_0x3ccf53(0x1a2))/0x6*(parseInt(_0x3ccf53(0x196))/0x7)+parseInt(_0x3ccf53(0x1a0))/0x8*(-parseInt(_0x3ccf53(0x1a3))/0x9)+-parseInt(_0x3ccf53(0x198))/0xa+parseInt(_0x3ccf53(0x19b))/0xb*(parseInt(_0x3ccf53(0x197))/0xc);if(_0x8cc412===_0x40c4ee)break;else _0xa9866['push'](_0xa9866['shift']());}catch(_0xd4449f){_0xa9866['push'](_0xa9866['shift']());}}}(a20_0x11bb,0x6703c));function a20_0x11bb(){const _0x311033=['2249810fUNzpk','length','1510MkqmPQ','44cuwleS','read','48990UpEcQw','2ZItboA','members-list','1397008xxCpEH','appCode','2295948FHEydD','9uCJzVX','Found\x20','436191cbTrzh','10940JNNrIL','app','7eSxOfP','551568oGZjaP'];a20_0x11bb=function(){return _0x311033;};return a20_0x11bb();}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':a20_0xd8081b(0x1a7),'command':a20_0xd8081b(0x19f),'description':'List\x20application\x20members\x20with\x20their\x20role\x20memberships','risk':a20_0xd8081b(0x19c),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x115166){const _0x578cdb=a20_0xd8081b,_0x58261d=projectAppMembers(await listRoleUsers(_0x115166[_0x578cdb(0x1a1)]));return{'ok':!![],'data':{'appCode':_0x115166[_0x578cdb(0x1a1)],'items':_0x58261d,'totalCount':_0x58261d[_0x578cdb(0x199)]},'message':_0x578cdb(0x1a4)+_0x58261d['length']+'\x20application\x20member(s)'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x220a09,_0x340303){const _0x452454=a21_0x23f5,_0x52c665=_0x220a09();while(!![]){try{const _0x4cff3e=-parseInt(_0x452454(0xf9))/0x1+parseInt(_0x452454(0xfd))/0x2+-parseInt(_0x452454(0x106))/0x3*(-parseInt(_0x452454(0xfc))/0x4)+parseInt(_0x452454(0x100))/0x5*(-parseInt(_0x452454(0x104))/0x6)+-parseInt(_0x452454(0x107))/0x7+-parseInt(_0x452454(0xff))/0x8*(-parseInt(_0x452454(0xfb))/0x9)+parseInt(_0x452454(0xf8))/0xa;if(_0x4cff3e===_0x340303)break;else _0x52c665['push'](_0x52c665['shift']());}catch(_0x34f68e){_0x52c665['push'](_0x52c665['shift']());}}}(a21_0x4dcd,0x238fa));import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';function a21_0x23f5(_0x3a2f47,_0x39d842){_0x3a2f47=_0x3a2f47-0xf8;const _0x4dcdc7=a21_0x4dcd();let _0x23f5df=_0x4dcdc7[_0x3a2f47];return _0x23f5df;}import{withActiveCookie}from'../../utils/with-active-cookie.js';function a21_0x4dcd(){const _0x5d7e2a=['appDesc','18imYmRD','appCode','3EffKwo','361781Ifcrdv','1186520TfGbBw','108785ZnMPzn','cookie','36VLUjWF','190744rJUcHj','250870qubzfu','platform','106664emnpdn','64965vVlYZu','authRequired','appName'];a21_0x4dcd=function(){return _0x5d7e2a;};return a21_0x4dcd();}function resolveCookie(_0x474ecd){const _0x471d19=a21_0x23f5,_0x1438e0=_0x474ecd[_0x471d19(0xfa)]||getCookie();if(!_0x1438e0)throw CliErrors[_0x471d19(0x101)]();return _0x1438e0;}export async function listRemoteAppDirectory(_0x1695af){const _0x1f445e=a21_0x23f5,_0x174a4f=await withActiveCookie(resolveCookie(_0x1695af),()=>listRemoteApps());return{'items':_0x174a4f['map'](_0x468ca9=>({..._0x468ca9['id']!=null?{'id':_0x468ca9['id']}:{},'appCode':_0x468ca9[_0x1f445e(0x105)],'appName':_0x468ca9[_0x1f445e(0x102)],..._0x468ca9[_0x1f445e(0x103)]!=null?{'appDesc':_0x468ca9[_0x1f445e(0x103)]}:{}})),'meta':{'source':_0x1f445e(0xfe)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x583971,_0x13a654){const _0x5113b9=a22_0x2785,_0x515b86=_0x583971();while(!![]){try{const _0x4653b0=-parseInt(_0x5113b9(0x145))/0x1*(parseInt(_0x5113b9(0x132))/0x2)+parseInt(_0x5113b9(0x13d))/0x3+-parseInt(_0x5113b9(0x133))/0x4+parseInt(_0x5113b9(0x155))/0x5*(-parseInt(_0x5113b9(0x15a))/0x6)+parseInt(_0x5113b9(0x130))/0x7+parseInt(_0x5113b9(0x15b))/0x8+parseInt(_0x5113b9(0x14f))/0x9*(parseInt(_0x5113b9(0x149))/0xa);if(_0x4653b0===_0x13a654)break;else _0x515b86['push'](_0x515b86['shift']());}catch(_0x3eefda){_0x515b86['push'](_0x515b86['shift']());}}}(a22_0x1b9a,0x85ab0));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a22_0x1b9a(){const _0x37f508=['object','appcode','status','1vWzmfl','applyUserList','length','roleName','739730BMyXSh','projectConfig','roles','apps','defaultApp','sort','9HzpdNx','globalConfig','call','isCurrent','values','global','160URCEGK','map','\x20(global)','push','isFinite','29976BQVRMO','7142296QvBCpA','hasOwnProperty','roleType','name','keys','currentApp','nickname','project','roleId','named','5967017Tofjgu','ACTIVE','1431516jkwkJm','2636168VqGDMp','appCode','prototype','trim','get','username','set','membershipStatus','roleKeys','has','788955ZrGxtt','PENDING','displayName','add','userId'];a22_0x1b9a=function(){return _0x37f508;};return a22_0x1b9a();}function nullableText(_0x448714){const _0x14f565=a22_0x2785,_0x20a493=_0x448714?.[_0x14f565(0x136)]();return _0x20a493?_0x20a493:null;}export function projectAppMembers(_0x45c2b8){const _0x109bdc=a22_0x2785,_0xebe54a=new Map(),_0x1a1128=[..._0x45c2b8][_0x109bdc(0x14e)]((_0x29c865,_0x2d8baa)=>_0x29c865['id']-_0x2d8baa['id']),_0x2cd96d=(_0x5e66ab,_0x1e8a9e,_0xe9887c)=>{const _0x457876=_0x109bdc;for(const _0x359ba4 of _0x1e8a9e){const _0x5f2492=Number(_0x359ba4[_0x457876(0x141)]);if(!Number[_0x457876(0x159)](_0x5f2492)||_0x5f2492<=0x0)continue;let _0x134157=_0xebe54a[_0x457876(0x137)](_0x5f2492);if(!_0x134157)_0x134157={'userId':_0x5f2492,'username':nullableText(_0x359ba4['username']),'displayName':nullableText(_0x359ba4[_0x457876(0x161)]),'status':_0xe9887c,'roles':[],'roleKeys':new Set()},_0xebe54a[_0x457876(0x139)](_0x5f2492,_0x134157);else{_0x134157[_0x457876(0x138)]??=nullableText(_0x359ba4['username']),_0x134157[_0x457876(0x13f)]??=nullableText(_0x359ba4['nickname']);if(_0xe9887c==='ACTIVE')_0x134157[_0x457876(0x144)]=_0x457876(0x131);}const _0xd98873=_0x5e66ab['id']+':'+_0xe9887c;if(_0x134157[_0x457876(0x13b)][_0x457876(0x13c)](_0xd98873))continue;_0x134157[_0x457876(0x13b)][_0x457876(0x140)](_0xd98873),_0x134157[_0x457876(0x14b)][_0x457876(0x158)]({'roleId':_0x5e66ab['id'],'roleName':nullableText(_0x5e66ab[_0x457876(0x148)]),'roleType':nullableText(_0x5e66ab[_0x457876(0x15d)]),'membershipStatus':_0xe9887c});}};for(const _0x41cbfd of _0x1a1128){_0x2cd96d(_0x41cbfd,_0x41cbfd['userList']??[],_0x109bdc(0x131)),_0x2cd96d(_0x41cbfd,_0x41cbfd[_0x109bdc(0x146)]??[],_0x109bdc(0x13e));}return[..._0xebe54a[_0x109bdc(0x153)]()][_0x109bdc(0x156)](_0x2e6dd5=>({'userId':_0x2e6dd5[_0x109bdc(0x141)],'username':_0x2e6dd5[_0x109bdc(0x138)],'displayName':_0x2e6dd5[_0x109bdc(0x13f)],'status':_0x2e6dd5[_0x109bdc(0x144)],'roles':_0x2e6dd5[_0x109bdc(0x14b)][_0x109bdc(0x14e)]((_0x3f8df7,_0x3d9964)=>_0x3f8df7[_0x109bdc(0x12e)]-_0x3d9964[_0x109bdc(0x12e)]||(_0x3f8df7[_0x109bdc(0x13a)]===_0x3d9964[_0x109bdc(0x13a)]?0x0:_0x3f8df7['membershipStatus']===_0x109bdc(0x131)?-0x1:0x1))}))[_0x109bdc(0x14e)]((_0x58477a,_0x579715)=>_0x58477a[_0x109bdc(0x141)]-_0x579715[_0x109bdc(0x141)]);}export function enrichAppListItemsWithMergedSelection(_0xfb77cc,_0x57b874){const _0x5ac810=a22_0x2785;if(!_0x57b874)return;const _0x52cac1=_0x57b874[_0x5ac810(0x14c)]&&typeof _0x57b874[_0x5ac810(0x14c)]===_0x5ac810(0x142)?_0x57b874['apps']:{},_0x36840d=Object[_0x5ac810(0x15f)](_0x52cac1)[_0x5ac810(0x147)]>0x0;for(const _0x3c4b7f of _0xfb77cc){_0x3c4b7f['isCurrent']=![];}const _0x2dbf23=_0x57b874[_0x5ac810(0x134)]!=null?String(_0x57b874['appCode'])[_0x5ac810(0x136)]():'';if(_0x36840d){const _0x139657=_0x57b874[_0x5ac810(0x160)]??_0x57b874[_0x5ac810(0x14d)];if(_0x139657)for(const _0x1830f1 of _0xfb77cc){_0x1830f1[_0x5ac810(0x12f)]===!![]&&_0x1830f1[_0x5ac810(0x15e)]===_0x139657&&(_0x1830f1['isCurrent']=!![]);}for(const _0x40c779 of _0xfb77cc){if(_0x40c779[_0x5ac810(0x12f)]!==![])continue;if(_0x57b874[_0x5ac810(0x14d)])continue;_0x2dbf23&&String(_0x40c779[_0x5ac810(0x143)]??'')[_0x5ac810(0x136)]()===_0x2dbf23&&(_0x40c779[_0x5ac810(0x152)]=!![]);}return;}if(!_0x2dbf23)return;for(const _0x1f9ccc of _0xfb77cc){String(_0x1f9ccc[_0x5ac810(0x143)]??'')['trim']()===_0x2dbf23&&(_0x1f9ccc['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x1c1e7f,_0x3c4ae5,_0x17d232){const _0x21fd20=a22_0x2785;if(_0x3c4ae5)return _0x21fd20(0x154);const _0x20b15b=_0x17d232['projectConfig'][_0x21fd20(0x14c)]&&typeof _0x17d232[_0x21fd20(0x14a)][_0x21fd20(0x14c)]===_0x21fd20(0x142)?_0x17d232[_0x21fd20(0x14a)]['apps']:{},_0x54c927=_0x17d232[_0x21fd20(0x150)][_0x21fd20(0x14c)]&&typeof _0x17d232[_0x21fd20(0x150)][_0x21fd20(0x14c)]===_0x21fd20(0x142)?_0x17d232['globalConfig'][_0x21fd20(0x14c)]:{};if(Object[_0x21fd20(0x135)][_0x21fd20(0x15c)][_0x21fd20(0x151)](_0x20b15b,_0x1c1e7f))return _0x21fd20(0x12d);if(Object[_0x21fd20(0x135)][_0x21fd20(0x15c)][_0x21fd20(0x151)](_0x54c927,_0x1c1e7f))return _0x21fd20(0x154);return'project';}function a22_0x2785(_0x3a4fdc,_0x3b032d){_0x3a4fdc=_0x3a4fdc-0x12d;const _0x1b9a7e=a22_0x1b9a();let _0x27852d=_0x1b9a7e[_0x3a4fdc];return _0x27852d;}export function appDefinedIn(_0xc69d34,_0x598e89,_0x8b3bde,_0x141914){const _0x597cfa=a22_0x2785;if(_0x141914)return Object['prototype'][_0x597cfa(0x15c)][_0x597cfa(0x151)](_0x8b3bde,_0xc69d34)?_0x597cfa(0x12d):_0x597cfa(0x154);const _0x549812=Object['prototype'][_0x597cfa(0x15c)][_0x597cfa(0x151)](_0x598e89,_0xc69d34),_0x44238b=Object['prototype']['hasOwnProperty'][_0x597cfa(0x151)](_0x8b3bde,_0xc69d34);if(_0x549812&&_0x44238b)return'both';if(_0x44238b)return _0x597cfa(0x12d);return _0x597cfa(0x154);}export function resolveDefaultAppSource(_0x54c20e){const _0x1bffaf=a22_0x2785,_0x3874a3=_0x54c20e['projectConfig']['apps']&&typeof _0x54c20e[_0x1bffaf(0x14a)]['apps']===_0x1bffaf(0x142)?_0x54c20e[_0x1bffaf(0x14a)][_0x1bffaf(0x14c)]:{};if(_0x1bffaf(0x14d)in _0x54c20e[_0x1bffaf(0x14a)])return'project';if(Object[_0x1bffaf(0x15f)](_0x3874a3)['length']>0x0)return _0x1bffaf(0x12d);if(_0x54c20e[_0x1bffaf(0x14a)]['inherit']===![])return null;if(_0x54c20e[_0x1bffaf(0x150)][_0x1bffaf(0x14d)])return _0x1bffaf(0x154);return null;}export function getConfigPath(_0x490645={}){const _0x5c3281=a22_0x2785,_0x314792=_0x490645[_0x5c3281(0x154)]?_0x5c3281(0x154):_0x5c3281(0x12d);return resolveWriteConfigPath(_0x314792);}export function readConfig(_0x5804b6={}){return readConfigFile(getConfigPath(_0x5804b6));}export function writeConfig(_0x354145,_0x5c950a={}){writeConfigFile(getConfigPath(_0x5c950a),_0x354145);}export function scopeLabel(_0x160c9c){const _0x3eec55=a22_0x2785;return _0x160c9c[_0x3eec55(0x154)]?_0x3eec55(0x157):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x4ea155=a23_0x1ab5;(function(_0xfb5ae2,_0x41650b){const _0x297c68=a23_0x1ab5,_0x3197de=_0xfb5ae2();while(!![]){try{const _0x448648=-parseInt(_0x297c68(0x1f4))/0x1*(-parseInt(_0x297c68(0x1e0))/0x2)+-parseInt(_0x297c68(0x1ed))/0x3*(-parseInt(_0x297c68(0x1f2))/0x4)+-parseInt(_0x297c68(0x1ea))/0x5+-parseInt(_0x297c68(0x1f3))/0x6+parseInt(_0x297c68(0x1e8))/0x7+parseInt(_0x297c68(0x1e9))/0x8*(-parseInt(_0x297c68(0x1ee))/0x9)+-parseInt(_0x297c68(0x1e5))/0xa*(-parseInt(_0x297c68(0x1eb))/0xb);if(_0x448648===_0x41650b)break;else _0x3197de['push'](_0x3197de['shift']());}catch(_0x3b00e6){_0x3197de['push'](_0x3197de['shift']());}}}(a23_0x2698,0x3912f));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_0x4ea155(0x1f5);export const appConfigDelete={'service':a23_0x4ea155(0x1e4),'command':a23_0x4ea155(0x1ec),'description':'Delete\x20one\x20runtime\x20app-config\x20key','risk':'high-risk-write','args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x50bac3){readKeyArg(_0x50bac3);},async 'dryRun'(_0x5f9941){const _0x50b5fb=a23_0x4ea155,_0x148759=readKeyArg(_0x5f9941),_0x100ee1=await mustGetByKey(_0x5f9941[_0x50b5fb(0x1e7)],_0x148759);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x5f9941[_0x50b5fb(0x1e7)],'key':_0x148759,'before':projectAppConfig(_0x100ee1),'after':null,'dryRun':!![]}),{'method':_0x50b5fb(0x1e1),'url':DELETE_PATH});},async 'execute'(_0x5586e3){const _0x430577=a23_0x4ea155,_0x1869e3=readKeyArg(_0x5586e3),_0x1ae33e=await mustGetByKey(_0x5586e3[_0x430577(0x1e7)],_0x1869e3);return await withAppConfigApiBoundary(_0x430577(0x1ec),{'appCode':_0x5586e3[_0x430577(0x1e7)],'key':_0x1869e3},()=>deleteAppConfig({'appCode':_0x5586e3[_0x430577(0x1e7)],'id':requireAppConfigId(_0x1ae33e,_0x1869e3,_0x5586e3[_0x430577(0x1e7)])})),{'ok':!![],'data':buildMutationData({'operation':'delete','appCode':_0x5586e3[_0x430577(0x1e7)],'key':_0x1869e3,'before':projectAppConfig(_0x1ae33e),'after':null,'dryRun':![]}),'message':'Deleted\x20app\x20config\x20'+_0x1869e3};}};function a23_0x1ab5(_0x3f810c,_0x49bfe6){_0x3f810c=_0x3f810c-0x1e0;const _0x26988a=a23_0x2698();let _0x1ab56a=_0x26988a[_0x3f810c];return _0x1ab56a;}async function mustGetByKey(_0x4239b7,_0x26cb76){const _0x2ef76d=a23_0x4ea155,_0x194313=await withAppConfigApiBoundary(_0x2ef76d(0x1ef),{'appCode':_0x4239b7,'key':_0x26cb76},()=>getAppConfigByKey(_0x4239b7,_0x26cb76));if(!_0x194313)throw CliErrors[_0x2ef76d(0x1e2)]('App\x20config\x20key\x20not\x20found:\x20'+_0x26cb76,'appCode:\x20'+_0x4239b7);return _0x194313;}function requireAppConfigId(_0x530d5d,_0x30990b,_0x198c73){const _0x2728b6=a23_0x4ea155;if(typeof _0x530d5d['id']===_0x2728b6(0x1f1)&&Number[_0x2728b6(0x1e3)](_0x530d5d['id'])&&_0x530d5d['id']>0x0)return _0x530d5d['id'];throw CliErrors['apiError'](_0x2728b6(0x1f0)+_0x30990b+_0x2728b6(0x1e6)+_0x198c73);}function a23_0x2698(){const _0x506476=['9SHhzLa','/smartapi/app-config/delete','51202tLBZcB','POST','validation','isFinite','app-config','20vwnxjx',',\x20appCode=','appCode','1403549oKTwkd','392HCybEm','1952570mVJUSl','2158970MTtEkT','delete','6KYMvpL','33876ypwaJg','get','App\x20config\x20server\x20id\x20missing\x20for\x20key=','number','232528IKzqIf','785970tcWYJf'];a23_0x2698=function(){return _0x506476;};return a23_0x2698();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x482750=a24_0x4ed7;(function(_0x4ae021,_0x5e141a){const _0x427029=a24_0x4ed7,_0x43e376=_0x4ae021();while(!![]){try{const _0x20cd61=parseInt(_0x427029(0x1fc))/0x1+parseInt(_0x427029(0x1fa))/0x2+parseInt(_0x427029(0x1ef))/0x3+-parseInt(_0x427029(0x1f7))/0x4+-parseInt(_0x427029(0x1f4))/0x5+parseInt(_0x427029(0x1f8))/0x6*(-parseInt(_0x427029(0x1fe))/0x7)+-parseInt(_0x427029(0x1f9))/0x8*(parseInt(_0x427029(0x1ed))/0x9);if(_0x20cd61===_0x5e141a)break;else _0x43e376['push'](_0x43e376['shift']());}catch(_0x2d3ff1){_0x43e376['push'](_0x43e376['shift']());}}}(a24_0x2e8e,0xec2d5));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_0x4ed7(_0x1ff910,_0x5ee5ce){_0x1ff910=_0x1ff910-0x1eb;const _0x2e8e84=a24_0x2e8e();let _0x4ed733=_0x2e8e84[_0x1ff910];return _0x4ed733;}export const appConfigGet={'service':'app-config','command':a24_0x482750(0x1ee),'description':'Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','risk':a24_0x482750(0x1f5),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x5ea8c5){readKeyArg(_0x5ea8c5);},async 'execute'(_0x2ce050){const _0x44d4ed=a24_0x482750,_0x4e2913=readKeyArg(_0x2ce050),_0x4413b3=await withAppConfigApiBoundary('get',{'appCode':_0x2ce050[_0x44d4ed(0x1fd)],'key':_0x4e2913},()=>getAppConfigByKey(_0x2ce050[_0x44d4ed(0x1fd)],_0x4e2913));if(!_0x4413b3)throw CliErrors[_0x44d4ed(0x1fb)](_0x44d4ed(0x1ec)+_0x4e2913,_0x44d4ed(0x1f2)+_0x2ce050[_0x44d4ed(0x1fd)]);const _0x5daf19=projectAppConfig(_0x4413b3,{'reveal':_0x2ce050[_0x44d4ed(0x1f0)](_0x44d4ed(0x1f6))});return{'ok':!![],'data':{'config':_0x5daf19},'message':_0x2ce050[_0x44d4ed(0x1f0)](_0x44d4ed(0x1f6))?_0x44d4ed(0x1eb)+_0x4e2913+_0x44d4ed(0x1f3):'Loaded\x20app\x20config\x20'+_0x4e2913+_0x44d4ed(0x1f1)};}};function a24_0x2e8e(){const _0x24acc8=['5915852OvGmCb','162dsUmNR','10847128jkQjKR','3635394taxqGp','validation','999331wKvQdr','appCode','90006ceqDAw','Loaded\x20app\x20config\x20','App\x20config\x20key\x20not\x20found:\x20','9HAzhcK','get','5158167qbgnJy','bool','\x20with\x20value\x20redacted','appCode:\x20','\x20with\x20value\x20revealed','1935080YcrXsN','read','reveal'];a24_0x2e8e=function(){return _0x24acc8;};return a24_0x2e8e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x145219,_0x38bb59){const _0x52f6a6=a25_0x2a06,_0x3d6be3=_0x145219();while(!![]){try{const _0x368816=-parseInt(_0x52f6a6(0xcc))/0x1+parseInt(_0x52f6a6(0xca))/0x2*(-parseInt(_0x52f6a6(0xce))/0x3)+parseInt(_0x52f6a6(0xd0))/0x4*(parseInt(_0x52f6a6(0xcd))/0x5)+-parseInt(_0x52f6a6(0xcf))/0x6*(parseInt(_0x52f6a6(0xc9))/0x7)+-parseInt(_0x52f6a6(0xd1))/0x8+-parseInt(_0x52f6a6(0xd2))/0x9+-parseInt(_0x52f6a6(0xcb))/0xa*(-parseInt(_0x52f6a6(0xd3))/0xb);if(_0x368816===_0x38bb59)break;else _0x3d6be3['push'](_0x3d6be3['shift']());}catch(_0x2d1219){_0x3d6be3['push'](_0x3d6be3['shift']());}}}(a25_0x3d1b,0xa3cf8));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';function a25_0x3d1b(){const _0x525629=['36tVGJxe','24zymele','5322152GllweO','10347399YiXHop','11ahYctA','537257gwumgP','571630iUOQCo','35958590CUvoGO','961623oPBrFv','736540JZIeuk','6ZUxlEq'];a25_0x3d1b=function(){return _0x525629;};return a25_0x3d1b();}import{appConfigSet}from'../../commands/app-config/set.js';function a25_0x2a06(_0x114e0d,_0x5f20f5){_0x114e0d=_0x114e0d-0xc9;const _0x3d1b5d=a25_0x3d1b();let _0x2a0639=_0x3d1b5d[_0x114e0d];return _0x2a0639;}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x1dddd2=a26_0x4990;(function(_0x46619b,_0x1de65b){const _0x780c5e=a26_0x4990,_0x14b3b4=_0x46619b();while(!![]){try{const _0x3fb0a3=parseInt(_0x780c5e(0xfa))/0x1*(parseInt(_0x780c5e(0xfb))/0x2)+parseInt(_0x780c5e(0xfd))/0x3+-parseInt(_0x780c5e(0xf9))/0x4+parseInt(_0x780c5e(0xf3))/0x5+-parseInt(_0x780c5e(0xf1))/0x6*(-parseInt(_0x780c5e(0xf6))/0x7)+parseInt(_0x780c5e(0xf5))/0x8*(-parseInt(_0x780c5e(0xf4))/0x9)+-parseInt(_0x780c5e(0xf2))/0xa*(-parseInt(_0x780c5e(0xf8))/0xb);if(_0x3fb0a3===_0x1de65b)break;else _0x14b3b4['push'](_0x14b3b4['shift']());}catch(_0x209473){_0x14b3b4['push'](_0x14b3b4['shift']());}}}(a26_0x1f5b,0xda1d2));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_0x1dddd2(0xfc),'command':a26_0x1dddd2(0xfe),'description':a26_0x1dddd2(0xeb),'risk':'read','flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x1dddd2(0xed),'type':'string','description':a26_0x1dddd2(0xef)},TAGS_FLAG],async 'validate'(_0x4f0503){const _0x28576d=a26_0x1dddd2,_0x1dcc19=_0x4f0503['str'](_0x28576d(0xed))['trim']();if(_0x1dcc19)validateKey(_0x1dcc19);readOptionalTags(_0x4f0503);},async 'execute'(_0x3aa3e9){const _0x4632d0=a26_0x1dddd2,_0xc66680=_0x3aa3e9[_0x4632d0(0xf7)]('key')[_0x4632d0(0xec)]()||undefined,_0x44a391=readOptionalTags(_0x3aa3e9),_0x1215dc=await withAppConfigApiBoundary(_0x4632d0(0xfe),{'appCode':_0x3aa3e9[_0x4632d0(0xf0)]},()=>listAppConfigs(_0x3aa3e9[_0x4632d0(0xf0)],{'key':_0xc66680,'tags':_0x44a391})),_0x26c7f8=_0x1215dc[_0x4632d0(0xff)](_0x51f69a=>projectAppConfig(_0x51f69a));return{'ok':!![],'data':{'appCode':_0x3aa3e9[_0x4632d0(0xf0)],'count':_0x26c7f8[_0x4632d0(0xea)],'configs':_0x26c7f8},'message':'Found\x20'+_0x26c7f8[_0x4632d0(0xea)]+_0x4632d0(0xee)};}};function a26_0x4990(_0x50e713,_0x2dd146){_0x50e713=_0x50e713-0xea;const _0x1f5bde=a26_0x1f5b();let _0x499098=_0x1f5bde[_0x50e713];return _0x499098;}function a26_0x1f5b(){const _0x45ec73=['length','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','trim','key','\x20app\x20config(s)','Filter\x20by\x20exact\x20config\x20key','appCode','11274yBPYnm','1630UnepWI','8210555CCGONG','333BBIguL','171736CAhDub','2170WKJepy','str','27049STlxiV','6336692DqMZUA','116141DFnMLW','8mVVwyt','app-config','545592JEnMVU','list','map'];a26_0x1f5b=function(){return _0x45ec73;};return a26_0x1f5b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x3dfa92=a27_0x431c;(function(_0x33101b,_0x3487fc){const _0x4255d3=a27_0x431c,_0x55a9c4=_0x33101b();while(!![]){try{const _0x24fc57=parseInt(_0x4255d3(0x17d))/0x1+parseInt(_0x4255d3(0x183))/0x2*(-parseInt(_0x4255d3(0x177))/0x3)+parseInt(_0x4255d3(0x17c))/0x4*(-parseInt(_0x4255d3(0x17b))/0x5)+parseInt(_0x4255d3(0x181))/0x6+parseInt(_0x4255d3(0x170))/0x7*(-parseInt(_0x4255d3(0x17a))/0x8)+-parseInt(_0x4255d3(0x176))/0x9+parseInt(_0x4255d3(0x173))/0xa;if(_0x24fc57===_0x3487fc)break;else _0x55a9c4['push'](_0x55a9c4['shift']());}catch(_0x1b9473){_0x55a9c4['push'](_0x55a9c4['shift']());}}}(a27_0x3590,0x5500a));function a27_0x3590(){const _0x4c3e95=['tags','8396970jMMOPJ','get','file','2572146OQQBZh','566682wsvakf','App\x20config\x20server\x20id\x20missing\x20for\x20key=','create','55392hLjthP','303005ebnfyf','36QjInks','575356aTDFIi','POST','isFinite','high-risk-write','508620oxKpIf','Updated','2MIHkJF','appCode','Read\x20config\x20value\x20from\x20file',',\x20appCode=','app-config','update','apiError','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','133HyRGZZ','Created'];a27_0x3590=function(){return _0x4c3e95;};return a27_0x3590();}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='/smartapi/app-config/create',UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a27_0x3dfa92(0x187),'command':'set','description':a27_0x3dfa92(0x18a),'risk':a27_0x3dfa92(0x180),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x3dfa92(0x175),'type':'string','description':a27_0x3dfa92(0x185)}],async 'validate'(_0x4be537){readKeyArg(_0x4be537),readOptionalTags(_0x4be537),assertSingleValueSource(_0x4be537);},async 'dryRun'(_0xbe31a7){const _0x336066=a27_0x3dfa92,_0xce6208=readKeyArg(_0xbe31a7),_0x580f46=readOptionalTags(_0xbe31a7),_0x5b6ed8=assertSingleValueSource(_0xbe31a7);await assertValueSourceReadable(_0x5b6ed8);const _0x51abe5=await withAppConfigApiBoundary('get',{'appCode':_0xbe31a7[_0x336066(0x184)],'key':_0xce6208},()=>getAppConfigByKey(_0xbe31a7[_0x336066(0x184)],_0xce6208)),_0x56fd08=_0x51abe5?_0x336066(0x188):_0x336066(0x179),_0x447ff9=_0x51abe5?projectAppConfig(_0x51abe5):null,_0x29dae8=plannedAppConfig({'appCode':_0xbe31a7['appCode'],'key':_0xce6208,'tags':_0x580f46??_0x51abe5?.[_0x336066(0x172)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x56fd08,'appCode':_0xbe31a7[_0x336066(0x184)],'key':_0xce6208,'before':_0x447ff9,'after':_0x29dae8,'dryRun':!![]}),{'method':_0x336066(0x17e),'url':_0x56fd08===_0x336066(0x188)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x21613f){const _0x2dc60b=a27_0x3dfa92,_0x993dc8=readKeyArg(_0x21613f),_0x2c601c=readOptionalTags(_0x21613f),_0x2a57fe=await withAppConfigApiBoundary(_0x2dc60b(0x174),{'appCode':_0x21613f[_0x2dc60b(0x184)],'key':_0x993dc8},()=>getAppConfigByKey(_0x21613f[_0x2dc60b(0x184)],_0x993dc8)),_0x411d17=_0x2a57fe?projectAppConfig(_0x2a57fe):null,_0x956313=_0x2a57fe?_0x2dc60b(0x188):_0x2dc60b(0x179),{value:_0x595149,warnings:_0xf10b30}=await readAppConfigValue(_0x21613f),_0x277dcf={'appCode':_0x21613f['appCode'],'key':_0x993dc8,'value':_0x595149,'tags':_0x2c601c??_0x2a57fe?.[_0x2dc60b(0x172)]??undefined};await withAppConfigApiBoundary(_0x956313,{'appCode':_0x21613f['appCode'],'key':_0x993dc8},async()=>{const _0x532bb0=_0x2dc60b;_0x2a57fe?await updateAppConfig({..._0x277dcf,'id':requireAppConfigId(_0x2a57fe,_0x993dc8,_0x21613f[_0x532bb0(0x184)])}):await createAppConfig(_0x277dcf);});const _0x26dc66=await withAppConfigApiBoundary(_0x2dc60b(0x174),{'appCode':_0x21613f['appCode'],'key':_0x993dc8},()=>getAppConfigByKey(_0x21613f['appCode'],_0x993dc8)),_0xb59ca7=_0x26dc66?projectAppConfig(_0x26dc66):plannedAppConfig({'appCode':_0x21613f[_0x2dc60b(0x184)],'key':_0x993dc8,'tags':_0x277dcf[_0x2dc60b(0x172)],'hasValue':_0x595149!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x956313,'appCode':_0x21613f[_0x2dc60b(0x184)],'key':_0x993dc8,'before':_0x411d17,'after':_0xb59ca7,'dryRun':![],'warnings':_0xf10b30}),'message':(_0x956313===_0x2dc60b(0x188)?_0x2dc60b(0x182):_0x2dc60b(0x171))+'\x20app\x20config\x20'+_0x993dc8};}};function a27_0x431c(_0x2b9774,_0x4dd3a1){_0x2b9774=_0x2b9774-0x170;const _0x3590ca=a27_0x3590();let _0x431c44=_0x3590ca[_0x2b9774];return _0x431c44;}function requireAppConfigId(_0x3b46f9,_0x253986,_0xeb7ba5){const _0x1aab1a=a27_0x3dfa92;if(typeof _0x3b46f9['id']==='number'&&Number[_0x1aab1a(0x17f)](_0x3b46f9['id'])&&_0x3b46f9['id']>0x0)return _0x3b46f9['id'];throw CliErrors[_0x1aab1a(0x189)](_0x1aab1a(0x178)+_0x253986+_0x1aab1a(0x186)+_0xeb7ba5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x5d8f43=a28_0x342c;(function(_0x371b4b,_0x3db3f2){const _0x1a896d=a28_0x342c,_0x3ae362=_0x371b4b();while(!![]){try{const _0x135839=-parseInt(_0x1a896d(0x169))/0x1*(parseInt(_0x1a896d(0x188))/0x2)+parseInt(_0x1a896d(0x14b))/0x3+parseInt(_0x1a896d(0x157))/0x4*(parseInt(_0x1a896d(0x18f))/0x5)+parseInt(_0x1a896d(0x171))/0x6*(-parseInt(_0x1a896d(0x154))/0x7)+parseInt(_0x1a896d(0x179))/0x8*(-parseInt(_0x1a896d(0x14f))/0x9)+-parseInt(_0x1a896d(0x16d))/0xa*(parseInt(_0x1a896d(0x174))/0xb)+parseInt(_0x1a896d(0x14e))/0xc;if(_0x135839===_0x3db3f2)break;else _0x3ae362['push'](_0x3ae362['shift']());}catch(_0x4a324d){_0x3ae362['push'](_0x3ae362['shift']());}}}(a28_0x3bd2,0x772cf));function a28_0x3bd2(){const _0x47605b=['value\x20is\x20redacted','name','7677112pfbaaB','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','reveal','push','operation','value','utf8','\x20app\x20config.','Missing\x20app-config\x20value\x20source.','join','setEncoding','env','key','from-env','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','2vwOfIL','length','validation','stdin','tags','App\x20config\x20value\x20source\x20is\x20ambiguous.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','150NJNbhK','1667874obMHjz','before','data','23106240UewlUb','9spTboV','bool','end','method','path','21slDfyc','Failed\x20to\x20','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','44248QhkqZK','trim','dryRun','Missing\x20app-config\x20key.','boolean','Environment\x20variable\x20is\x20not\x20set:\x20','slice','Read\x20config\x20value\x20from\x20stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','string','gmtModified','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','appCode','args','Runtime\x20app-config\x20key','Value\x20file\x20is\x20not\x20readable:\x20','flag','warnings','740521GCsKcr','Config\x20tags\x20for\x20filtering/display\x20metadata','argument','apiError','3280VAeZCQ','hasValue','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','str','927318UTPkHi','kind','once','5412iMjmUn','after','gmtCreate'];a28_0x3bd2=function(){return _0x47605b;};return a28_0x3bd2();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x5d8f43(0x185),'description':a28_0x5d8f43(0x165),'required':!![]};export const VALUE_ARG={'name':a28_0x5d8f43(0x17e),'description':a28_0x5d8f43(0x18e),'required':![]};export const TAGS_FLAG={'name':'tags','type':a28_0x5d8f43(0x160),'description':a28_0x5d8f43(0x16a)};export const STDIN_FLAG={'name':a28_0x5d8f43(0x18b),'type':a28_0x5d8f43(0x15b),'description':a28_0x5d8f43(0x15e),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':'string','description':a28_0x5d8f43(0x162)};export const REVEAL_FLAG={'name':a28_0x5d8f43(0x17b),'type':'boolean','description':a28_0x5d8f43(0x16f),'default':![]};export function readKeyArg(_0x5d5441){const _0x40d5f6=a28_0x5d8f43,_0x5ae3e6=_0x5d5441['args'][0x0]?.[_0x40d5f6(0x158)]()??'';return validateKey(_0x5ae3e6),_0x5ae3e6;}export function readOptionalTags(_0x354707){const _0xa4a7a6=a28_0x5d8f43,_0x298f64=_0x354707['str'](_0xa4a7a6(0x18c))[_0xa4a7a6(0x158)]();if(!_0x298f64)return undefined;if(_0x298f64[_0xa4a7a6(0x189)]>0x20)throw CliErrors[_0xa4a7a6(0x18a)](_0xa4a7a6(0x156));return _0x298f64;}export function validateKey(_0x2cd29d){const _0x10a376=a28_0x5d8f43;if(!_0x2cd29d)throw CliErrors['validation'](_0x10a376(0x15a));if(_0x2cd29d[_0x10a376(0x189)]>0x100)throw CliErrors['validation']('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x3a5ff6,_0x254f16){const _0x695fe6=a28_0x5d8f43,_0xf7c021=_0x3a5ff6[_0x695fe6(0x17e)]!==undefined&&_0x3a5ff6[_0x695fe6(0x17e)]!==null&&_0x3a5ff6[_0x695fe6(0x17e)]!=='',_0x1e4f9b={'appCode':_0x3a5ff6['appCode'],'key':_0x3a5ff6[_0x695fe6(0x185)],'tags':_0x3a5ff6[_0x695fe6(0x18c)]??undefined,'hasValue':_0xf7c021,'valueRedacted':_0xf7c021&&!_0x254f16?.[_0x695fe6(0x17b)],'gmtCreate':_0x3a5ff6[_0x695fe6(0x176)],'gmtModified':_0x3a5ff6[_0x695fe6(0x161)]};return _0x254f16?.[_0x695fe6(0x17b)]&&(_0x1e4f9b[_0x695fe6(0x17e)]=_0x3a5ff6['value']??'',_0x1e4f9b['valueRedacted']=![]),_0x1e4f9b;}export function plannedAppConfig(_0xb02ecc){const _0x37c625=a28_0x5d8f43,_0x560771=_0xb02ecc[_0x37c625(0x16e)]??!![];return{'appCode':_0xb02ecc['appCode'],'key':_0xb02ecc[_0x37c625(0x185)],'tags':_0xb02ecc['tags']??undefined,'hasValue':_0x560771,'valueRedacted':_0x560771};}export function buildMutationData(_0x1f5e7d){const _0x387867=a28_0x5d8f43;return{'operation':_0x1f5e7d[_0x387867(0x17d)],'selector':{'appCode':_0x1f5e7d[_0x387867(0x163)],'key':_0x1f5e7d[_0x387867(0x185)]},'before':_0x1f5e7d[_0x387867(0x14c)],'after':_0x1f5e7d[_0x387867(0x175)],'dryRun':_0x1f5e7d[_0x387867(0x159)],'warnings':_0x1f5e7d[_0x387867(0x168)]??[]};}export async function withAppConfigApiBoundary(_0x5134e9,_0x2c1c87,_0x2530ca){const _0x343215=a28_0x5d8f43;try{return await _0x2530ca();}catch{const _0x4c16e4=['appCode:\x20'+_0x2c1c87['appCode']];if(_0x2c1c87[_0x343215(0x185)])_0x4c16e4[_0x343215(0x17c)]('key:\x20'+_0x2c1c87['key']);_0x4c16e4[_0x343215(0x17c)](_0x343215(0x177));throw CliErrors[_0x343215(0x16c)](_0x343215(0x155)+_0x5134e9+_0x343215(0x180),_0x4c16e4[_0x343215(0x182)](';\x20')+'.');}}function a28_0x342c(_0x4d30a,_0x37880a){_0x4d30a=_0x4d30a-0x14b;const _0x3bd299=a28_0x3bd2();let _0x342c7b=_0x3bd299[_0x4d30a];return _0x342c7b;}export function asAppConfigDryRunResult(_0x9122dd,_0x5184a5){const _0xb3a1d3=a28_0x5d8f43;return Object['defineProperties'](_0x9122dd,{'method':{'value':_0x5184a5[_0xb3a1d3(0x152)],'enumerable':![]},'url':{'value':_0x5184a5['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x354531){const _0x2aa3c3=a28_0x5d8f43,_0x397390=[];_0x354531['args'][_0x2aa3c3(0x189)]>0x1&&_0x397390[_0x2aa3c3(0x17c)]({'kind':_0x2aa3c3(0x16b),'value':_0x354531[_0x2aa3c3(0x164)][_0x2aa3c3(0x15d)](0x1)[_0x2aa3c3(0x182)]('\x20')});const _0x361b74=_0x354531[_0x2aa3c3(0x167)](_0x2aa3c3(0x17e));_0x361b74!==undefined&&_0x361b74!==null&&_0x397390[_0x2aa3c3(0x17c)]({'kind':'argument','value':String(_0x361b74)});_0x354531[_0x2aa3c3(0x150)](_0x2aa3c3(0x18b))&&_0x397390[_0x2aa3c3(0x17c)]({'kind':'stdin'});const _0x34ae00=_0x354531[_0x2aa3c3(0x170)](_0x2aa3c3(0x186))[_0x2aa3c3(0x158)]();_0x34ae00&&_0x397390[_0x2aa3c3(0x17c)]({'kind':_0x2aa3c3(0x184),'name':_0x34ae00});const _0x599605=_0x354531[_0x2aa3c3(0x170)]('file')['trim']();_0x599605&&_0x397390['push']({'kind':'file','path':_0x599605});if(_0x397390[_0x2aa3c3(0x189)]===0x0)throw CliErrors[_0x2aa3c3(0x18a)](_0x2aa3c3(0x181),_0x2aa3c3(0x15f));if(_0x397390[_0x2aa3c3(0x189)]>0x1)throw CliErrors['validation'](_0x2aa3c3(0x18d),_0x2aa3c3(0x187));return _0x397390[0x0];}export async function assertValueSourceReadable(_0x5aa504){const _0x425f78=a28_0x5d8f43;if(_0x5aa504[_0x425f78(0x172)]===_0x425f78(0x184)&&!(_0x5aa504['name']in process.env))throw CliErrors[_0x425f78(0x18a)](_0x425f78(0x15c)+_0x5aa504['name']);if(_0x5aa504['kind']==='file')try{await access(_0x5aa504[_0x425f78(0x153)]);}catch{throw CliErrors['validation'](_0x425f78(0x166)+_0x5aa504[_0x425f78(0x153)]);}}export async function readAppConfigValue(_0x57bc38){const _0x5af919=a28_0x5d8f43,_0x8f9120=assertSingleValueSource(_0x57bc38),_0x375e8f=[];if(_0x8f9120[_0x5af919(0x172)]===_0x5af919(0x16b))return _0x375e8f['push'](_0x5af919(0x17a)),{'value':_0x8f9120['value']??'','source':_0x8f9120[_0x5af919(0x172)],'warnings':_0x375e8f};if(_0x8f9120[_0x5af919(0x172)]===_0x5af919(0x18b))return{'value':await readStdin(),'source':_0x8f9120['kind'],'warnings':_0x375e8f};if(_0x8f9120[_0x5af919(0x172)]===_0x5af919(0x184)){if(!(_0x8f9120[_0x5af919(0x178)]in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x8f9120['name']);return{'value':process.env[_0x8f9120.name]??'','source':_0x8f9120[_0x5af919(0x172)],'warnings':_0x375e8f};}return{'value':await readFile(_0x8f9120['path'],_0x5af919(0x17f)),'source':_0x8f9120['kind'],'warnings':_0x375e8f};}function readStdin(){return new Promise((_0x4d9ca0,_0x4c86cf)=>{const _0x1d2362=a28_0x342c;let _0x1243bb='';process[_0x1d2362(0x18b)][_0x1d2362(0x183)](_0x1d2362(0x17f)),process[_0x1d2362(0x18b)]['on'](_0x1d2362(0x14d),_0x53ac8c=>{_0x1243bb+=_0x53ac8c;}),process[_0x1d2362(0x18b)][_0x1d2362(0x173)](_0x1d2362(0x151),()=>_0x4d9ca0(_0x1243bb)),process[_0x1d2362(0x18b)][_0x1d2362(0x173)]('error',_0x4c86cf);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x3829(){const _0x53a6fb=['nonInteractive','Login\x20via\x20browser','17576QYVzkk','4468kQiqyJ','bool','../../auth/auth-server-ui.js','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','385068IjPfkM','1788365bNtvXd','✓\x20Logged\x20out','logout','login','1232712QGfJBL','write','log','174ZQnPKI','3nDoWwV','994mfIeal','1030ZCLCAG','92257YGqXQz','auth','yes','1599390FZEkXz','read'];a29_0x3829=function(){return _0x53a6fb;};return a29_0x3829();}const a29_0xdb3d3b=a29_0x527e;function a29_0x527e(_0x5f40f9,_0x5548f5){_0x5f40f9=_0x5f40f9-0x7c;const _0x382910=a29_0x3829();let _0x527e6f=_0x382910[_0x5f40f9];return _0x527e6f;}(function(_0x51f503,_0x40d405){const _0x711274=a29_0x527e,_0x26bf8d=_0x51f503();while(!![]){try{const _0x31bfcc=parseInt(_0x711274(0x7d))/0x1*(-parseInt(_0x711274(0x89))/0x2)+parseInt(_0x711274(0x8a))/0x3*(parseInt(_0x711274(0x81))/0x4)+parseInt(_0x711274(0x82))/0x5+-parseInt(_0x711274(0x90))/0x6+-parseInt(_0x711274(0x8b))/0x7*(parseInt(_0x711274(0x7c))/0x8)+-parseInt(_0x711274(0x86))/0x9+parseInt(_0x711274(0x8c))/0xa*(parseInt(_0x711274(0x8d))/0xb);if(_0x31bfcc===_0x40d405)break;else _0x26bf8d['push'](_0x26bf8d['shift']());}catch(_0x5ec53a){_0x26bf8d['push'](_0x26bf8d['shift']());}}}(a29_0x3829,0x3424a));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0xdb3d3b(0x8e),'command':a29_0xdb3d3b(0x85),'description':a29_0xdb3d3b(0x93),'risk':a29_0xdb3d3b(0x91),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a29_0xdb3d3b(0x8f),'type':'boolean','description':a29_0xdb3d3b(0x80),'default':![]}],async 'execute'(_0x1e132f){const _0x1000e3=a29_0xdb3d3b,{runAuthServer:_0x5792f3}=await import(_0x1000e3(0x7f));return await _0x5792f3({'autoYes':_0x1e132f[_0x1000e3(0x7e)]('yes'),'nonInteractive':_0x1e132f[_0x1000e3(0x92)]}),{'ok':!![]};}},{'service':a29_0xdb3d3b(0x8e),'command':a29_0xdb3d3b(0x84),'description':'Clear\x20login\x20session','risk':a29_0xdb3d3b(0x87),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x832f3a){const _0x479b03=a29_0xdb3d3b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x479b03(0x88)](_0x479b03(0x83))):console[_0x479b03(0x88)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x182d0f=a30_0x58d3;(function(_0x4ef205,_0xa864cb){const _0x29c1cc=a30_0x58d3,_0x5918b5=_0x4ef205();while(!![]){try{const _0x5cfcd9=parseInt(_0x29c1cc(0xc3))/0x1*(-parseInt(_0x29c1cc(0x8e))/0x2)+parseInt(_0x29c1cc(0xa9))/0x3+parseInt(_0x29c1cc(0xb1))/0x4+parseInt(_0x29c1cc(0x90))/0x5*(parseInt(_0x29c1cc(0xbe))/0x6)+parseInt(_0x29c1cc(0xbd))/0x7+parseInt(_0x29c1cc(0xc1))/0x8*(parseInt(_0x29c1cc(0xaf))/0x9)+-parseInt(_0x29c1cc(0x85))/0xa*(parseInt(_0x29c1cc(0xd1))/0xb);if(_0x5cfcd9===_0xa864cb)break;else _0x5918b5['push'](_0x5918b5['shift']());}catch(_0x5e1b32){_0x5918b5['push'](_0x5918b5['shift']());}}}(a30_0x2f27,0x74ce7));import{createInterface}from'node:readline';function a30_0x2f27(){const _0x2679b6=['function-node','\x0a\x20*\x20[触发节点]\x20','\x22\x20not\x20found.\x20','find','Operation\x20type\x20(HOOK\x20only)','\x20api\x20pull`\x20to\x20refresh.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\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','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','isInteger','length','appCode','File\x20already\x20exists:\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.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','map','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1120848DyxRcL','after','Operation\x20type\x20\x22','COMMON','\x20function:\x20','\x22\x20not\x20found\x20for\x20dataset\x20','2844WrnhMW','HOOK\x20requires\x20alias/operation/node\x20options.','3489256aTaeIJ','code','apiDir','name','HOOK','No\x20operation\x20types\x20found\x20for\x20dataset\x20','stderr','question','Invalid\x20function\x20name\x20\x22','join','.js','source','1851857hjrQsW','2007066jwewEp','string','Select\x20dataset:','21048gyeqGs','alias','128ZVSYWH','\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',']\x20(','write','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','validation','datasetCode','Script\x20description','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','nonInteractive','Invalid\x20dataset\x20selection.','utf8','11BFAYFc','\x0a\x20*\x20[脚本名称]\x20','create','str','scriptsRootDir','No\x20api.ts\x20found.\x20Run\x20`','datasetcode','close','operationType','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','parseInt','before','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','15420770xusESY','\x22.\x20','UNKNOWN','Alias\x20\x22','ENDPOINT','includes','tableName','description','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','10248YIIPPl','keys','5QgoUCd','trim','stdin','functionNode','TODO:\x20add\x20script\x20description'];a30_0x2f27=function(){return _0x2679b6;};return a30_0x2f27();}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':'bff','command':a30_0x182d0f(0xd3),'description':a30_0x182d0f(0xcc),'risk':'read','flags':[{'name':'type','type':a30_0x182d0f(0xbf),'required':!![],'enum':[a30_0x182d0f(0xac),a30_0x182d0f(0x89),a30_0x182d0f(0xb5)],'description':'Script\x20type'},{'name':a30_0x182d0f(0xb4),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0xca)},{'name':a30_0x182d0f(0xc2),'type':a30_0x182d0f(0xbf),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0x182d0f(0xd7),'type':'string','description':a30_0x182d0f(0xa5)},{'name':'operation-type','type':a30_0x182d0f(0xbf),'description':a30_0x182d0f(0x99)},{'name':a30_0x182d0f(0x95),'type':a30_0x182d0f(0xbf),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a30_0x182d0f(0x83),'after']}],async 'validate'(_0x235600){const _0x2211c7=a30_0x182d0f,_0x3fe27e=_0x235600[_0x2211c7(0xd4)](_0x2211c7(0xb4));if(!isValidBffFunctionName(_0x3fe27e))throw CliErrors[_0x2211c7(0xc8)](_0x2211c7(0xb9)+_0x3fe27e+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x329bef){const _0x26f627=a30_0x182d0f,_0x239a59=loadBffProjectConfig(_0x329bef['appCode']),_0x1482c4=_0x329bef['str']('type'),_0x38a3e2=_0x329bef['str']('name'),_0x534adf=_0x329bef[_0x26f627(0xd4)](_0x26f627(0x8c))||undefined,_0x3a6c20=_0x1482c4==='HOOK'?await resolveHookOptions(_0x239a59,_0x329bef):undefined,_0x14ee3b=buildFilePath(_0x239a59,_0x1482c4,_0x38a3e2,_0x3a6c20);if(await fileExists(_0x14ee3b))throw CliErrors[_0x26f627(0xc8)](_0x26f627(0xa2)+_0x14ee3b);await mkdir(dirname(_0x14ee3b),{'recursive':!![]});const _0x2fcf0b=generateTemplate(_0x1482c4,_0x38a3e2,_0x329bef[_0x26f627(0xa1)],_0x534adf,_0x3a6c20);await writeFile(_0x14ee3b,_0x2fcf0b,_0x26f627(0xd0));const _0x3d8263={'type':_0x1482c4,'name':_0x38a3e2,'path':_0x14ee3b};if(_0x534adf)_0x3d8263['description']=_0x534adf;if(_0x3a6c20){if(_0x3a6c20[_0x26f627(0xc2)])_0x3d8263[_0x26f627(0xc2)]=_0x3a6c20['alias'];_0x3d8263[_0x26f627(0xc9)]=_0x3a6c20[_0x26f627(0xc9)],_0x3d8263[_0x26f627(0x80)]=_0x3a6c20[_0x26f627(0x80)],_0x3d8263['functionNode']=_0x3a6c20[_0x26f627(0x93)];}return{'ok':!![],'data':_0x3d8263,'message':'Created\x20'+_0x1482c4+_0x26f627(0xad)+_0x38a3e2};}};async function resolveHookOptions(_0x55df3a,_0x1e7d1c){const _0x3a0cc7=a30_0x182d0f,_0x5f2c01=loadAliasMap(_0x1e7d1c[_0x3a0cc7(0xb3)],undefined,resolveApiFilePath(_0x1e7d1c['apiDir'],_0x1e7d1c['appCode'])),_0x52015e=_0x5f2c01[_0x3a0cc7(0xa0)]>0x0;let _0x3b96ee,_0x4766af,_0x32195d;const _0x16928e=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xc2)),_0x2d2342=_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0xd7));if(_0x16928e){const _0x354d11=resolveAlias(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x16928e,undefined,resolveApiFilePath(_0x1e7d1c[_0x3a0cc7(0xb3)],_0x1e7d1c['appCode']));if(!_0x354d11){const _0x11b541=_0x52015e?'Available\x20aliases:\x20'+_0x5f2c01[_0x3a0cc7(0xa7)](_0x5df8ec=>_0x5df8ec[_0x3a0cc7(0xc2)])[_0x3a0cc7(0xba)](',\x20'):_0x3a0cc7(0xd6)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0x88)+_0x16928e+_0x3a0cc7(0x97)+_0x11b541);}_0x3b96ee=_0x16928e,_0x4766af=_0x354d11;}else{if(_0x2d2342){_0x4766af=_0x2d2342;const _0x2f7f12=_0x5f2c01['find'](_0x4944d0=>_0x4944d0['datasetCode']===_0x2d2342);_0x3b96ee=_0x2f7f12?.[_0x3a0cc7(0xc2)];}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xa8));else{if(_0x52015e){const _0x5c7a8b=_0x5f2c01['map'](_0x379170=>_0x379170['alias']+'\x20('+_0x379170[_0x3a0cc7(0x8b)]+')'),_0x12eec3=await promptSelect(_0x3a0cc7(0xc0),_0x5c7a8b),_0x3ff5f9=_0x5f2c01[_0x12eec3];if(!_0x3ff5f9)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x3b96ee=_0x3ff5f9[_0x3a0cc7(0xc2)],_0x4766af=_0x3ff5f9['datasetCode'];}else{const _0x1b4f85=await listDatasets(_0x1e7d1c[_0x3a0cc7(0xa1)]);if(_0x1b4f85[_0x3a0cc7(0xa0)]===0x0)throw CliErrors[_0x3a0cc7(0xc8)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x3db7bc=_0x1b4f85[_0x3a0cc7(0xa7)](_0x2b5f3e=>_0x2b5f3e['name']+'\x20['+(_0x2b5f3e[_0x3a0cc7(0xbc)]??_0x3a0cc7(0x87))+_0x3a0cc7(0xc5)+_0x2b5f3e['code']+')'),_0x28b6d6=await promptSelect(_0x3a0cc7(0xc0),_0x3db7bc),_0x28e6b1=_0x1b4f85[_0x28b6d6];if(!_0x28e6b1)throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcf));_0x4766af=_0x28e6b1[_0x3a0cc7(0xb2)],_0x3b96ee=undefined;}}}}const _0x1a9ba2=await listDatasets(_0x1e7d1c['appCode']),_0x478e9f=_0x1a9ba2[_0x3a0cc7(0x98)](_0x2d54d3=>_0x2d54d3[_0x3a0cc7(0xb2)]===_0x4766af);if(!_0x478e9f)throw CliErrors[_0x3a0cc7(0xc8)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x4766af+_0x3a0cc7(0x86)+(_0x3b96ee?_0x3a0cc7(0x81)+CLI_BIN_NAME+_0x3a0cc7(0x9a):''));_0x32195d=_0x478e9f['id'];const _0x19998c=_0x3b96ee??_0x4766af,_0x1d5f5a=await listBffDatasetOperations(_0x1e7d1c[_0x3a0cc7(0xa1)],_0x32195d),_0x4cd706=_0x1d5f5a?Object[_0x3a0cc7(0x8f)](_0x1d5f5a):[];if(_0x4cd706[_0x3a0cc7(0xa0)]===0x0)throw CliErrors['validation'](_0x3a0cc7(0xb6)+_0x19998c+'.');let _0xe13f7;const _0x3dc887=_0x1e7d1c[_0x3a0cc7(0xd4)]('operation-type');if(_0x3dc887){if(!_0x4cd706[_0x3a0cc7(0x8a)](_0x3dc887))throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xab)+_0x3dc887+_0x3a0cc7(0xae)+_0x19998c+'.\x20'+('Available:\x20'+_0x4cd706[_0x3a0cc7(0xba)](',\x20')));_0xe13f7=_0x3dc887;}else{if(_0x1e7d1c['nonInteractive'])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xcb));const _0x43505f=await promptSelect('Select\x20operation\x20type:',_0x4cd706);_0xe13f7=_0x4cd706[_0x43505f]??_0x4cd706[0x0];}let _0x57c9b5=normalizeHookFunctionNode(_0x1e7d1c['str'](_0x3a0cc7(0x95)));if(!_0x57c9b5){if(_0x1e7d1c[_0x3a0cc7(0xd4)](_0x3a0cc7(0x95)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x1e7d1c[_0x3a0cc7(0xce)])throw CliErrors[_0x3a0cc7(0xc8)](_0x3a0cc7(0xc7));const _0xdcac96=await promptSelect('Select\x20trigger\x20node:',['before',_0x3a0cc7(0xaa)]);_0x57c9b5=[_0x3a0cc7(0x83),_0x3a0cc7(0xaa)][_0xdcac96]??_0x3a0cc7(0x83);}return{'alias':_0x3b96ee,'datasetCode':_0x4766af,'datasetId':_0x32195d,'operationType':_0xe13f7,'functionNode':_0x57c9b5};}function a30_0x58d3(_0x29729e,_0x13a217){_0x29729e=_0x29729e-0x7f;const _0x2f270=a30_0x2f27();let _0x58d33b=_0x2f270[_0x29729e];return _0x58d33b;}async function promptSelect(_0x5654e6,_0x5f060d){const _0x518769=a30_0x182d0f;if(_0x5f060d[_0x518769(0xa0)]===0x1)return 0x0;for(const [_0x52aca3,_0xd9d559]of _0x5f060d['entries']()){process['stderr'][_0x518769(0xc6)]('\x20\x20'+(_0x52aca3+0x1)+'.\x20'+_0xd9d559+'\x0a');}const _0x28d959=createInterface({'input':process[_0x518769(0x92)],'output':process[_0x518769(0xb7)]});while(!![]){const _0x16c70d=await new Promise(_0x27f322=>{const _0x45c0c2=_0x518769;_0x28d959[_0x45c0c2(0xb8)](_0x5654e6+'\x20',_0x27f322);}),_0x4f6b51=Number[_0x518769(0x82)](_0x16c70d[_0x518769(0x91)](),0xa);if(Number[_0x518769(0x9f)](_0x4f6b51)&&_0x4f6b51>=0x1&&_0x4f6b51<=_0x5f060d[_0x518769(0xa0)])return _0x28d959[_0x518769(0x7f)](),_0x4f6b51-0x1;process['stderr'][_0x518769(0xc6)](_0x518769(0x8d)+_0x5f060d[_0x518769(0xa0)]+'.\x0a');}}function buildFilePath(_0x573ae2,_0xff472f,_0x2056e9,_0x3c1ac4){const _0x160312=a30_0x182d0f;if(_0xff472f===_0x160312(0xb5)){if(!_0x3c1ac4)throw CliErrors['validation'](_0x160312(0xb0));const _0x417f8a=_0x3c1ac4[_0x160312(0xc2)]??_0x3c1ac4[_0x160312(0xc9)];return join(_0x573ae2[_0x160312(0xd5)],_0x160312(0xb5),_0x417f8a,_0x3c1ac4[_0x160312(0x80)],_0x3c1ac4[_0x160312(0x93)],_0x2056e9+_0x160312(0xbb));}return join(_0x573ae2[_0x160312(0xd5)],_0xff472f,_0x2056e9+'.js');}export function generateTemplate(_0x3036a5,_0x472179,_0x55fa60,_0x390323,_0x1feb93){const _0x3f3b45=a30_0x182d0f,_0x556f48=_0x390323?.[_0x3f3b45(0x91)]()||_0x3f3b45(0x94);if(_0x3036a5===_0x3f3b45(0xac))return _0x3f3b45(0xa3)+_0x556f48+_0x3f3b45(0xd2)+_0x472179+_0x3f3b45(0x9b)+_0x472179+_0x3f3b45(0xa6)+_0x472179+_0x3f3b45(0x84);if(_0x3036a5===_0x3f3b45(0x89))return _0x3f3b45(0xa4)+_0x556f48+_0x3f3b45(0x9d)+_0x55fa60+'/'+_0x472179+_0x3f3b45(0x9c)+_0x472179+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x1feb93)throw CliErrors[_0x3f3b45(0xc8)](_0x3f3b45(0xcd));return _0x3f3b45(0x9e)+_0x556f48+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x55fa60+'/'+_0x1feb93[_0x3f3b45(0xc9)]+'/'+_0x1feb93[_0x3f3b45(0x80)]+_0x3f3b45(0x96)+_0x1feb93[_0x3f3b45(0x93)]+_0x3f3b45(0xc4)+_0x472179+_0x3f3b45(0x84);}
|
|
1
|
+
const a30_0x4797bc=a30_0x4818;(function(_0x5345fb,_0x3b7757){const _0x526c9c=a30_0x4818,_0xc5c91d=_0x5345fb();while(!![]){try{const _0x22b1f6=parseInt(_0x526c9c(0x18d))/0x1*(parseInt(_0x526c9c(0x1cc))/0x2)+-parseInt(_0x526c9c(0x182))/0x3*(-parseInt(_0x526c9c(0x1c7))/0x4)+parseInt(_0x526c9c(0x19c))/0x5*(parseInt(_0x526c9c(0x197))/0x6)+-parseInt(_0x526c9c(0x1b7))/0x7*(parseInt(_0x526c9c(0x174))/0x8)+-parseInt(_0x526c9c(0x186))/0x9+-parseInt(_0x526c9c(0x19a))/0xa+parseInt(_0x526c9c(0x1c1))/0xb;if(_0x22b1f6===_0x3b7757)break;else _0xc5c91d['push'](_0xc5c91d['shift']());}catch(_0x471e5a){_0xc5c91d['push'](_0xc5c91d['shift']());}}}(a30_0x436f,0x7ef26));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';function a30_0x4818(_0x23f1bd,_0x21522e){_0x23f1bd=_0x23f1bd-0x171;const _0x436f8b=a30_0x436f();let _0x48180c=_0x436f8b[_0x23f1bd];return _0x48180c;}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';function a30_0x436f(){const _0x3675fa=['Operation\x20type\x20\x22','source','\x22\x20not\x20found\x20for\x20dataset\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','Available\x20aliases:\x20','find','53EjDTaD','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20api.ts\x20found.\x20Run\x20`','.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','TODO:\x20add\x20script\x20description','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','string','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','scriptsRootDir','6UZojpi','Select\x20dataset:','functionNode','10179590yEZdzS','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','1132170sZGfbT','\x20api\x20pull`\x20to\x20refresh.','Created\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','name','apiDir','Invalid\x20dataset\x20selection.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','read','datasetcode','COMMON','isInteger','nonInteractive','datasetCode','.js','validation','No\x20datasets\x20found\x20for\x20this\x20app.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','alias',']\x20(','ENDPOINT','\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','\x0a\x20*\x20[脚本名称]\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','No\x20operation\x20types\x20found\x20for\x20dataset\x20','5859637XTBzWH','UNKNOWN','Operation\x20type\x20(HOOK\x20only)','Select\x20trigger\x20node:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Alias\x20\x22','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','map','join','parseInt','22334697nxNchT','HOOK\x20requires\x20alias/operation/node\x20options.','appCode','bff','operationType','function-node','209004YMtEuy','stderr','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','tableName','Trigger\x20node\x20(HOOK\x20only)','18590LzsnbH','trim','before','HOOK','\x22.\x20','close','after','keys','8clMHjH','description','question','Available:\x20','\x22\x20not\x20found.\x20','Invalid\x20function\x20name\x20\x22','includes','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','code','Function\x20name\x20(valid\x20JS\x20identifier)','type','create','stdin','write','21CGAoaJ','Script\x20type','length','str','6662061jwUfvZ'];a30_0x436f=function(){return _0x3675fa;};return a30_0x436f();}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x4797bc(0x1c4),'command':a30_0x4797bc(0x17f),'description':a30_0x4797bc(0x195),'risk':a30_0x4797bc(0x1a6),'flags':[{'name':a30_0x4797bc(0x17e),'type':'string','required':!![],'enum':[a30_0x4797bc(0x1a8),a30_0x4797bc(0x1b2),'HOOK'],'description':a30_0x4797bc(0x183)},{'name':'name','type':a30_0x4797bc(0x193),'required':!![],'description':a30_0x4797bc(0x17d)},{'name':'description','type':a30_0x4797bc(0x193),'description':'Script\x20description'},{'name':a30_0x4797bc(0x1b0),'type':'string','description':a30_0x4797bc(0x1a5)},{'name':a30_0x4797bc(0x1a7),'type':'string','description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':'operation-type','type':a30_0x4797bc(0x193),'description':a30_0x4797bc(0x1b9)},{'name':a30_0x4797bc(0x1c6),'type':a30_0x4797bc(0x193),'description':a30_0x4797bc(0x1cb),'enum':[a30_0x4797bc(0x1ce),a30_0x4797bc(0x172)]}],async 'validate'(_0x4a2cfc){const _0x5ee3d7=a30_0x4797bc,_0x4cf0aa=_0x4a2cfc[_0x5ee3d7(0x185)]('name');if(!isValidBffFunctionName(_0x4cf0aa))throw CliErrors[_0x5ee3d7(0x1ad)](_0x5ee3d7(0x179)+_0x4cf0aa+_0x5ee3d7(0x1a0));},async 'execute'(_0xcd497a){const _0x1b5ee0=a30_0x4797bc,_0x30a85f=loadBffProjectConfig(_0xcd497a[_0x1b5ee0(0x1c3)]),_0x2050d9=_0xcd497a[_0x1b5ee0(0x185)](_0x1b5ee0(0x17e)),_0x5cc0f6=_0xcd497a[_0x1b5ee0(0x185)](_0x1b5ee0(0x1a2)),_0x53d618=_0xcd497a[_0x1b5ee0(0x185)](_0x1b5ee0(0x175))||undefined,_0x18a477=_0x2050d9===_0x1b5ee0(0x1cf)?await resolveHookOptions(_0x30a85f,_0xcd497a):undefined,_0x5b4277=buildFilePath(_0x30a85f,_0x2050d9,_0x5cc0f6,_0x18a477);if(await fileExists(_0x5b4277))throw CliErrors[_0x1b5ee0(0x1ad)]('File\x20already\x20exists:\x20'+_0x5b4277);await mkdir(dirname(_0x5b4277),{'recursive':!![]});const _0x304f29=generateTemplate(_0x2050d9,_0x5cc0f6,_0xcd497a[_0x1b5ee0(0x1c3)],_0x53d618,_0x18a477);await writeFile(_0x5b4277,_0x304f29,'utf8');const _0x59daac={'type':_0x2050d9,'name':_0x5cc0f6,'path':_0x5b4277};if(_0x53d618)_0x59daac[_0x1b5ee0(0x175)]=_0x53d618;if(_0x18a477){if(_0x18a477['alias'])_0x59daac[_0x1b5ee0(0x1b0)]=_0x18a477[_0x1b5ee0(0x1b0)];_0x59daac[_0x1b5ee0(0x1ab)]=_0x18a477['datasetCode'],_0x59daac[_0x1b5ee0(0x1c5)]=_0x18a477[_0x1b5ee0(0x1c5)],_0x59daac[_0x1b5ee0(0x199)]=_0x18a477[_0x1b5ee0(0x199)];}return{'ok':!![],'data':_0x59daac,'message':_0x1b5ee0(0x19e)+_0x2050d9+'\x20function:\x20'+_0x5cc0f6};}};async function resolveHookOptions(_0x20ef6c,_0x513168){const _0x316053=a30_0x4797bc,_0x33bec6=loadAliasMap(_0x513168[_0x316053(0x1a3)],undefined,resolveApiFilePath(_0x513168[_0x316053(0x1a3)],_0x513168['appCode'])),_0x38f620=_0x33bec6[_0x316053(0x184)]>0x0;let _0x4acfbe,_0x17757a,_0x1894b4;const _0x5816a7=_0x513168[_0x316053(0x185)](_0x316053(0x1b0)),_0xcd2f28=_0x513168['str'](_0x316053(0x1a7));if(_0x5816a7){const _0x19f053=resolveAlias(_0x513168[_0x316053(0x1a3)],_0x5816a7,undefined,resolveApiFilePath(_0x513168[_0x316053(0x1a3)],_0x513168['appCode']));if(!_0x19f053){const _0x2080d6=_0x38f620?_0x316053(0x18b)+_0x33bec6[_0x316053(0x1be)](_0x2a0b25=>_0x2a0b25[_0x316053(0x1b0)])[_0x316053(0x1bf)](',\x20'):_0x316053(0x18f)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0x316053(0x1bc)+_0x5816a7+_0x316053(0x178)+_0x2080d6);}_0x4acfbe=_0x5816a7,_0x17757a=_0x19f053;}else{if(_0xcd2f28){_0x17757a=_0xcd2f28;const _0x3d84d2=_0x33bec6[_0x316053(0x18c)](_0x461894=>_0x461894[_0x316053(0x1ab)]===_0xcd2f28);_0x4acfbe=_0x3d84d2?.[_0x316053(0x1b0)];}else{if(_0x513168[_0x316053(0x1aa)])throw CliErrors[_0x316053(0x1ad)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x38f620){const _0x3d0680=_0x33bec6[_0x316053(0x1be)](_0x2c228b=>_0x2c228b['alias']+'\x20('+_0x2c228b[_0x316053(0x1ca)]+')'),_0x585741=await promptSelect(_0x316053(0x198),_0x3d0680),_0x582e4b=_0x33bec6[_0x585741];if(!_0x582e4b)throw CliErrors[_0x316053(0x1ad)]('Invalid\x20dataset\x20selection.');_0x4acfbe=_0x582e4b[_0x316053(0x1b0)],_0x17757a=_0x582e4b[_0x316053(0x1ab)];}else{const _0x54a29e=await listDatasets(_0x513168['appCode']);if(_0x54a29e[_0x316053(0x184)]===0x0)throw CliErrors[_0x316053(0x1ad)](_0x316053(0x1ae));const _0x96f653=_0x54a29e[_0x316053(0x1be)](_0x332037=>_0x332037[_0x316053(0x1a2)]+'\x20['+(_0x332037[_0x316053(0x188)]??_0x316053(0x1b8))+_0x316053(0x1b1)+_0x332037[_0x316053(0x17c)]+')'),_0x4c6eb0=await promptSelect(_0x316053(0x198),_0x96f653),_0x2172cc=_0x54a29e[_0x4c6eb0];if(!_0x2172cc)throw CliErrors[_0x316053(0x1ad)](_0x316053(0x1a4));_0x17757a=_0x2172cc['code'],_0x4acfbe=undefined;}}}}const _0x336193=await listDatasets(_0x513168['appCode']),_0x4b5b90=_0x336193['find'](_0x19d264=>_0x19d264[_0x316053(0x17c)]===_0x17757a);if(!_0x4b5b90)throw CliErrors[_0x316053(0x1ad)](_0x316053(0x1b5)+_0x17757a+_0x316053(0x1d0)+(_0x4acfbe?_0x316053(0x192)+CLI_BIN_NAME+_0x316053(0x19d):''));_0x1894b4=_0x4b5b90['id'];const _0x5d3431=_0x4acfbe??_0x17757a,_0x22481b=await listBffDatasetOperations(_0x513168[_0x316053(0x1c3)],_0x1894b4),_0x5ce87a=_0x22481b?Object[_0x316053(0x173)](_0x22481b):[];if(_0x5ce87a[_0x316053(0x184)]===0x0)throw CliErrors[_0x316053(0x1ad)](_0x316053(0x1b6)+_0x5d3431+'.');let _0x26ce2b;const _0x120277=_0x513168[_0x316053(0x185)]('operation-type');if(_0x120277){if(!_0x5ce87a[_0x316053(0x17a)](_0x120277))throw CliErrors[_0x316053(0x1ad)](_0x316053(0x187)+_0x120277+_0x316053(0x189)+_0x5d3431+'.\x20'+(_0x316053(0x177)+_0x5ce87a[_0x316053(0x1bf)](',\x20')));_0x26ce2b=_0x120277;}else{if(_0x513168[_0x316053(0x1aa)])throw CliErrors['validation'](_0x316053(0x18e));const _0x598f95=await promptSelect('Select\x20operation\x20type:',_0x5ce87a);_0x26ce2b=_0x5ce87a[_0x598f95]??_0x5ce87a[0x0];}let _0x52d0f5=normalizeHookFunctionNode(_0x513168[_0x316053(0x185)](_0x316053(0x1c6)));if(!_0x52d0f5){if(_0x513168[_0x316053(0x185)](_0x316053(0x1c6)))throw CliErrors[_0x316053(0x1ad)](_0x316053(0x17b));if(_0x513168[_0x316053(0x1aa)])throw CliErrors[_0x316053(0x1ad)](_0x316053(0x1af));const _0x4fe209=await promptSelect(_0x316053(0x1ba),[_0x316053(0x1ce),_0x316053(0x172)]);_0x52d0f5=[_0x316053(0x1ce),'after'][_0x4fe209]??_0x316053(0x1ce);}return{'alias':_0x4acfbe,'datasetCode':_0x17757a,'datasetId':_0x1894b4,'operationType':_0x26ce2b,'functionNode':_0x52d0f5};}async function promptSelect(_0x1fadf0,_0x1c2580){const _0x401129=a30_0x4797bc;if(_0x1c2580[_0x401129(0x184)]===0x1)return 0x0;for(const [_0x40b9de,_0x38fb99]of _0x1c2580['entries']()){process['stderr'][_0x401129(0x181)]('\x20\x20'+(_0x40b9de+0x1)+'.\x20'+_0x38fb99+'\x0a');}const _0x31c974=createInterface({'input':process[_0x401129(0x180)],'output':process[_0x401129(0x1c8)]});while(!![]){const _0x5b9f42=await new Promise(_0xb0a44c=>{const _0xe719a4=_0x401129;_0x31c974[_0xe719a4(0x176)](_0x1fadf0+'\x20',_0xb0a44c);}),_0x5b2168=Number[_0x401129(0x1c0)](_0x5b9f42[_0x401129(0x1cd)](),0xa);if(Number[_0x401129(0x1a9)](_0x5b2168)&&_0x5b2168>=0x1&&_0x5b2168<=_0x1c2580['length'])return _0x31c974[_0x401129(0x171)](),_0x5b2168-0x1;process['stderr'][_0x401129(0x181)](_0x401129(0x1bb)+_0x1c2580['length']+'.\x0a');}}function buildFilePath(_0x5da9f7,_0x47cbaa,_0x5c72fd,_0x3fa344){const _0x566a0f=a30_0x4797bc;if(_0x47cbaa===_0x566a0f(0x1cf)){if(!_0x3fa344)throw CliErrors['validation'](_0x566a0f(0x1c2));const _0x1c541c=_0x3fa344[_0x566a0f(0x1b0)]??_0x3fa344[_0x566a0f(0x1ab)];return join(_0x5da9f7[_0x566a0f(0x196)],_0x566a0f(0x1cf),_0x1c541c,_0x3fa344['operationType'],_0x3fa344[_0x566a0f(0x199)],_0x5c72fd+_0x566a0f(0x1ac));}return join(_0x5da9f7[_0x566a0f(0x196)],_0x47cbaa,_0x5c72fd+_0x566a0f(0x1ac));}export function generateTemplate(_0x56723c,_0x27539a,_0x1ef437,_0x215367,_0x27f126){const _0xf3692c=a30_0x4797bc,_0xc56a07=_0x215367?.['trim']()||_0xf3692c(0x191);if(_0x56723c==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0xc56a07+_0xf3692c(0x1b4)+_0x27539a+_0xf3692c(0x1bd)+_0x27539a+_0xf3692c(0x190)+_0x27539a+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x56723c==='ENDPOINT')return _0xf3692c(0x19f)+_0xc56a07+_0xf3692c(0x18a)+_0x1ef437+'/'+_0x27539a+'\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'+_0x27539a+_0xf3692c(0x1c9);if(!_0x27f126)throw CliErrors[_0xf3692c(0x1ad)](_0xf3692c(0x19b));return _0xf3692c(0x194)+_0xc56a07+_0xf3692c(0x1a1)+_0x1ef437+'/'+_0x27f126['datasetCode']+'/'+_0x27f126[_0xf3692c(0x1c5)]+'\x0a\x20*\x20[触发节点]\x20'+_0x27f126[_0xf3692c(0x199)]+_0xf3692c(0x1b3)+_0x27539a+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0x31ffc3=a31_0x1b1a;(function(_0x3b4719,_0x53e1fc){const _0x4ee127=a31_0x1b1a,_0x12fcef=_0x3b4719();while(!![]){try{const _0x4df4a5=parseInt(_0x4ee127(0x203))/0x1+-parseInt(_0x4ee127(0x1f7))/0x2+-parseInt(_0x4ee127(0x1f3))/0x3*(parseInt(_0x4ee127(0x1ec))/0x4)+-parseInt(_0x4ee127(0x205))/0x5+-parseInt(_0x4ee127(0x20a))/0x6*(parseInt(_0x4ee127(0x1f0))/0x7)+-parseInt(_0x4ee127(0x1f1))/0x8+parseInt(_0x4ee127(0x201))/0x9*(parseInt(_0x4ee127(0x1fb))/0xa);if(_0x4df4a5===_0x53e1fc)break;else _0x12fcef['push'](_0x12fcef['shift']());}catch(_0x194b47){_0x12fcef['push'](_0x12fcef['shift']());}}}(a31_0x153d,0x49c63));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a31_0x1b1a(_0x5cd648,_0x387a5b){_0x5cd648=_0x5cd648-0x1e8;const _0x153d8b=a31_0x153d();let _0x1b1af5=_0x153d8b[_0x5cd648];return _0x1b1af5;}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_0x31ffc3(0x1fd),'command':a31_0x31ffc3(0x20c),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a31_0x31ffc3(0x210),'flags':[{'name':'target','type':'string','required':!![],'description':a31_0x31ffc3(0x209)}],async 'validate'(_0x23a3cd){const _0x5c24b1=a31_0x31ffc3,_0xcf4b74=loadBffProjectConfig(_0x23a3cd[_0x5c24b1(0x1eb)]),_0x5dd661=await readBffLockFile(_0xcf4b74['lockFilePath']);if(!_0x5dd661)throw CliErrors['validation'](_0x5c24b1(0x1ff));},async 'dryRun'(_0x3cd9db){const _0x4363b2=a31_0x31ffc3,_0x2f29e3=loadBffProjectConfig(_0x3cd9db[_0x4363b2(0x1eb)]),_0x386951=await readBffLockFile(_0x2f29e3['lockFilePath']);if(!_0x386951)throw CliErrors[_0x4363b2(0x216)](_0x4363b2(0x1f9));const {appLock:_0x3b48ee}=ensureLockScope(_0x386951,_0x3cd9db['appCode'],_0x2f29e3['scriptsRoot'],_0x4363b2(0x20c)),_0x3c4424=_0x3cd9db[_0x4363b2(0x200)](_0x4363b2(0x21a)),_0x13a34e=Object['keys'](_0x3b48ee[_0x4363b2(0x1ef)]),_0xba749=resolveDeleteTarget(_0x3c4424,_0x13a34e),_0x519958=_0x3b48ee[_0x4363b2(0x1ef)][_0xba749];if(!_0x519958)throw CliErrors[_0x4363b2(0x216)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0xba749+'\x22.');const _0x13873d=resolveLocalFilePathFromLockKey(_0x2f29e3,_0xba749),_0x2f4e8c=relative(_0x2f29e3[_0x4363b2(0x1fc)],_0x13873d),_0x3c72b9=join(_0x2f29e3['trashDir'],_0x4363b2(0x20e),_0x2f4e8c);return{'method':_0x4363b2(0x215),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x3cd9db[_0x4363b2(0x1eb)],'target':_0xba749,'remoteId':_0x519958[_0x4363b2(0x207)],'localFilePath':_0x13873d,'trashedPath':_0x3c72b9},'description':'Would\x20delete\x20'+_0xba749+_0x4363b2(0x211)};},async 'execute'(_0x2e1f62){const _0x15b0b6=a31_0x31ffc3,_0x409340=loadBffProjectConfig(_0x2e1f62[_0x15b0b6(0x1eb)]),_0xe6acd8=await readBffLockFile(_0x409340[_0x15b0b6(0x1fa)]);if(!_0xe6acd8)throw CliErrors[_0x15b0b6(0x216)](_0x15b0b6(0x1f9));const {lockData:_0x10851e,appLock:_0x495a40}=ensureLockScope(_0xe6acd8,_0x2e1f62[_0x15b0b6(0x1eb)],_0x409340[_0x15b0b6(0x202)],'delete'),_0x4ae6cf=JSON[_0x15b0b6(0x218)](JSON[_0x15b0b6(0x1f2)](_0x10851e)),_0x226fa0=_0x4ae6cf[_0x15b0b6(0x1ee)][_0x2e1f62['appCode']];if(!_0x226fa0)throw new Error(_0x15b0b6(0x1f5)+_0x2e1f62['appCode']+_0x15b0b6(0x1fe));const _0x1c9a71=_0x2e1f62['str'](_0x15b0b6(0x21a)),_0x18b07e=Object[_0x15b0b6(0x1ea)](_0x226fa0[_0x15b0b6(0x1ef)]),_0x4449e4=resolveDeleteTarget(_0x1c9a71,_0x18b07e),_0x43351b=_0x226fa0[_0x15b0b6(0x1ef)][_0x4449e4];if(!_0x43351b)throw CliErrors[_0x15b0b6(0x216)](_0x15b0b6(0x1f6)+_0x4449e4+'\x22.');await deleteBffScript(_0x43351b[_0x15b0b6(0x207)]),delete _0x226fa0[_0x15b0b6(0x1ef)][_0x4449e4],_0x226fa0[_0x15b0b6(0x20b)]=new Date()[_0x15b0b6(0x212)](),await writeBffLockFile(_0x409340[_0x15b0b6(0x1fa)],_0x4ae6cf);const _0x15f102=resolveLocalFilePathFromLockKey(_0x409340,_0x4449e4);let _0x23752c;await fileExists(_0x15f102)&&(_0x23752c=await moveToTrash(_0x409340[_0x15b0b6(0x1fc)],_0x409340[_0x15b0b6(0x1f4)],_0x15f102),await cleanupEmptyDirectories(dirname(_0x15f102),_0x409340[_0x15b0b6(0x217)]));await waitForDeleteSettlement(_0x409340['lockFilePath'],_0x2e1f62[_0x15b0b6(0x1eb)],_0x4449e4,_0x15f102),await sleep(0x96);const _0x3a69cf={'deleted':_0x4449e4,'remoteId':_0x43351b[_0x15b0b6(0x207)]};if(_0x23752c)_0x3a69cf[_0x15b0b6(0x213)]=_0x23752c;return{'ok':!![],'data':_0x3a69cf,'message':'Deleted\x20'+_0x4449e4+(_0x23752c?_0x15b0b6(0x214):'')};}};function resolveDeleteTarget(_0x58f851,_0x3b3e3f){const _0x313415=a31_0x31ffc3;if(_0x58f851[_0x313415(0x1ed)]('/')){const _0x20d196=_0x3b3e3f[_0x313415(0x206)](_0x5a21b3=>_0x5a21b3===_0x58f851);if(!_0x20d196)throw CliErrors[_0x313415(0x216)](_0x313415(0x219)+_0x58f851);return _0x20d196;}const _0x442f4e=_0x3b3e3f['filter'](_0x58659b=>_0x58659b['split']('/')['at'](-0x1)===_0x58f851);if(_0x442f4e[_0x313415(0x208)]===0x0)throw CliErrors[_0x313415(0x216)](_0x313415(0x219)+_0x58f851);if(_0x442f4e[_0x313415(0x208)]>0x1)throw CliErrors[_0x313415(0x216)]('Multiple\x20functions\x20match\x20\x22'+_0x58f851+_0x313415(0x1e8)+_0x442f4e[_0x313415(0x20f)](_0x823603=>_0x313415(0x204)+_0x823603)[_0x313415(0x20d)]('\x0a'));return _0x442f4e[0x0];}function a31_0x153d(){const _0x70250f=['toISOString','trashedTo','\x20(local\x20file\x20moved\x20to\x20trash)','POST','validation','scriptsRootDir','parse','Function\x20not\x20found:\x20','target','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','replace','keys','appCode','124idVhJx','includes','apps','functions','7qHTWFc','1366288tJgoYR','stringify','24546YUoZZR','trashDir','Lock\x20scope\x20for\x20app\x20\x22','No\x20lock\x20entry\x20found\x20for\x20\x22','353504oMRThO','startsWith','BFF\x20lock\x20file\x20not\x20found.','lockFilePath','260EYgbeu','projectRoot','bff','\x22\x20not\x20found\x20after\x20ensureLockScope.','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','str','380007GfUUaR','scriptsRoot','585824srMBOl','\x20\x20-\x20','2972100MjGNhb','find','remoteId','length','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','1115058lHlIac','lastSync','delete','join','<timestamp>','map','high-risk-write','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'];a31_0x153d=function(){return _0x70250f;};return a31_0x153d();}async function moveToTrash(_0x5e8846,_0x373927,_0x3f99e9){const _0x38d611=a31_0x31ffc3,_0x5e96be=new Date()[_0x38d611(0x212)]()[_0x38d611(0x1e9)](/[:.]/g,'-'),_0x4315f6=relative(_0x5e8846,_0x3f99e9),_0x3f924e=join(_0x373927,_0x5e96be,_0x4315f6);return await mkdir(dirname(_0x3f924e),{'recursive':!![]}),await rename(_0x3f99e9,_0x3f924e),_0x3f924e;}async function cleanupEmptyDirectories(_0x4d9096,_0x18b6ae){const _0x2ca1bb=a31_0x31ffc3;let _0x39bc02=resolve(_0x4d9096);const _0x5afb4d=resolve(_0x18b6ae);while(_0x39bc02[_0x2ca1bb(0x1f8)](''+_0x5afb4d+sep)||_0x39bc02===_0x5afb4d){if(_0x39bc02===_0x5afb4d)return;try{const _0x55b272=await readdir(_0x39bc02);if(_0x55b272[_0x2ca1bb(0x208)]>0x0)return;await rmdir(_0x39bc02);}catch{return;}_0x39bc02=dirname(_0x39bc02);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x53aca6,_0x3ffecc,_0x28b446,_0x4ca18a){const _0x285f52=a31_0x31ffc3;for(let _0x16a2c2=0x0;_0x16a2c2<DELETE_SETTLE_RETRY_COUNT;_0x16a2c2+=0x1){const _0x51bfcc=await readBffLockFile(_0x53aca6),_0x2d3f41=!!_0x51bfcc?.[_0x285f52(0x1ee)]?.[_0x3ffecc]?.[_0x285f52(0x1ef)]?.[_0x28b446],_0x4f4d91=await fileExists(_0x4ca18a);if(!_0x2d3f41&&!_0x4f4d91)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x28b446+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x226e66=a32_0x3ba2;(function(_0x30b8c3,_0x213347){const _0x3ecddb=a32_0x3ba2,_0x3cdd5d=_0x30b8c3();while(!![]){try{const _0x139d1d=parseInt(_0x3ecddb(0xd8))/0x1+-parseInt(_0x3ecddb(0xc0))/0x2*(parseInt(_0x3ecddb(0xd0))/0x3)+parseInt(_0x3ecddb(0xd2))/0x4*(parseInt(_0x3ecddb(0xda))/0x5)+parseInt(_0x3ecddb(0xcb))/0x6+parseInt(_0x3ecddb(0xc1))/0x7*(-parseInt(_0x3ecddb(0xc9))/0x8)+-parseInt(_0x3ecddb(0xcd))/0x9+parseInt(_0x3ecddb(0xce))/0xa*(parseInt(_0x3ecddb(0xc3))/0xb);if(_0x139d1d===_0x213347)break;else _0x3cdd5d['push'](_0x3cdd5d['shift']());}catch(_0x45c4d6){_0x3cdd5d['push'](_0x3cdd5d['shift']());}}}(a32_0x7c22,0x84783));function a32_0x7c22(){const _0x2e20be=['1066495yhCqAr','8irGkBQ','4796309JOBzgl','detail','44jaieHT','boolean','bff','scriptType','Script\x20ID','appCode','8DSBApz','description','435270OcyECo','Get\x20BFF\x20script\x20details\x20by\x20ID','8479062zTrKCB','5029600qsLhbP','(none)','776535VStDPN','verbose','8AlgRSl','Return\x20full\x20raw\x20script\x20object','createdTime','number','scriptContent','read','694297fgoMpc','bool'];a32_0x7c22=function(){return _0x2e20be;};return a32_0x7c22();}import{getBffScriptInfo}from'../../core/api-client.js';function a32_0x3ba2(_0x24d319,_0x3c92f4){_0x24d319=_0x24d319-0xc0;const _0x7c2204=a32_0x7c22();let _0x3ba258=_0x7c2204[_0x24d319];return _0x3ba258;}export const bffDetail={'service':a32_0x226e66(0xc5),'command':a32_0x226e66(0xc2),'description':a32_0x226e66(0xcc),'risk':a32_0x226e66(0xd7),'flags':[{'name':'id','type':a32_0x226e66(0xd5),'required':!![],'description':a32_0x226e66(0xc7)},{'name':a32_0x226e66(0xd1),'type':a32_0x226e66(0xc4),'description':a32_0x226e66(0xd3)}],async 'execute'(_0x43837e){const _0x2b4b3b=a32_0x226e66,_0x114869=await getBffScriptInfo(_0x43837e['num']('id')),_0x5c790f=_0x43837e[_0x2b4b3b(0xd9)](_0x2b4b3b(0xd1));if(_0x5c790f)return{'ok':!![],'data':_0x114869};return{'ok':!![],'data':{'id':_0x114869['id'],'appCode':_0x114869[_0x2b4b3b(0xc8)],'scriptType':_0x114869[_0x2b4b3b(0xc6)],'description':_0x114869[_0x2b4b3b(0xca)]||_0x2b4b3b(0xcf),'createdTime':_0x114869[_0x2b4b3b(0xd4)]??'','updatedTime':_0x114869['updatedTime']??'','scriptContent':_0x114869[_0x2b4b3b(0xd6)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e630d,_0x23dce9){const _0x3f590c=a33_0xb166,_0x4dfc37=_0x4e630d();while(!![]){try{const _0x1b70d4=parseInt(_0x3f590c(0xb2))/0x1*(parseInt(_0x3f590c(0xad))/0x2)+-parseInt(_0x3f590c(0xab))/0x3+parseInt(_0x3f590c(0xae))/0x4+parseInt(_0x3f590c(0xaf))/0x5+-parseInt(_0x3f590c(0xaa))/0x6*(parseInt(_0x3f590c(0xb1))/0x7)+-parseInt(_0x3f590c(0xb0))/0x8+parseInt(_0x3f590c(0xac))/0x9;if(_0x1b70d4===_0x23dce9)break;else _0x4dfc37['push'](_0x4dfc37['shift']());}catch(_0x225f93){_0x4dfc37['push'](_0x4dfc37['shift']());}}}(a33_0xdcd5,0x8cbbf));function a33_0xb166(_0x407de0,_0x15cdde){_0x407de0=_0x407de0-0xaa;const _0xdcd5b8=a33_0xdcd5();let _0xb1664b=_0xdcd5b8[_0x407de0];return _0xb1664b;}import{bffList}from'../../commands/bff/list.js';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';function a33_0xdcd5(){const _0x266e70=['1INaHKy','1550742QuTDHk','2354073PWZkzo','9037350opDjpc','1056282PEzjWC','2042520dDIcpW','1919140jsXECd','2321920HHLOrZ','21qPLsPv'];a33_0xdcd5=function(){return _0x266e70;};return a33_0xdcd5();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|