@lovrabet/rabetbase-cli 2.3.15 → 2.3.16-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- 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 -0
- 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 -0
- package/lib/commands/kb/delete.js +1 -0
- package/lib/commands/kb/detail.js +1 -0
- package/lib/commands/kb/index.js +1 -0
- package/lib/commands/kb/list.js +1 -0
- package/lib/commands/kb/shared.js +1 -0
- package/lib/commands/kb/update.js +1 -0
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.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/save.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 -0
- package/lib/commands/tenant/members-list.js +1 -0
- package/lib/commands/tenant/shared.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -0
- 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 +2 -2
- package/lib/commands/app/add.js +0 -1
- package/lib/commands/app/remove.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5050f2,_0x1b887a){const _0x5932e2=a18_0x9402,_0x532df2=_0x5050f2();while(!![]){try{const _0x4a3c08=parseInt(_0x5932e2(0x9f))/0x1*(-parseInt(_0x5932e2(0xa7))/0x2)+-parseInt(_0x5932e2(0xa6))/0x3+-parseInt(_0x5932e2(0xa3))/0x4*(-parseInt(_0x5932e2(0xa0))/0x5)+-parseInt(_0x5932e2(0x9e))/0x6+-parseInt(_0x5932e2(0xa1))/0x7*(-parseInt(_0x5932e2(0xa2))/0x8)+-parseInt(_0x5932e2(0xa5))/0x9*(-parseInt(_0x5932e2(0xa4))/0xa)+parseInt(_0x5932e2(0xa8))/0xb;if(_0x4a3c08===_0x1b887a)break;else _0x532df2['push'](_0x532df2['shift']());}catch(_0x1251d3){_0x532df2['push'](_0x532df2['shift']());}}}(a18_0x3f9a,0x9ced6));function a18_0x9402(_0x10ad37,_0x164cae){_0x10ad37=_0x10ad37-0x9e;const _0x3f9a05=a18_0x3f9a();let _0x940264=_0x3f9a05[_0x10ad37];return _0x940264;}import{appListDefinition}from'../../commands/app/list.js';function a18_0x3f9a(){const _0x519df2=['1091064fVRKHw','38mQUxqf','11478489KoMknG','7599480klSBdR','19615wOFowA','6091805RKiRty','7cJyqsE','2709832fbClRa','4CrSnNQ','225690PfDHzB','18rdQwMm'];a18_0x3f9a=function(){return _0x519df2;};return a18_0x3f9a();}import{appMembersListDefinition}from'../../commands/app/members-list.js';export const appDefinitions=[appListDefinition,appMembersListDefinition];
|
package/lib/commands/app/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x3443f1=a19_0x4ea1;(function(_0x46d8b1,_0x73b98c){const _0x15ff4d=a19_0x4ea1,_0x139972=_0x46d8b1();while(!![]){try{const _0x276317=parseInt(_0x15ff4d(0x147))/0x1*(-parseInt(_0x15ff4d(0x135))/0x2)+parseInt(_0x15ff4d(0x140))/0x3*(parseInt(_0x15ff4d(0x129))/0x4)+-parseInt(_0x15ff4d(0x144))/0x5+-parseInt(_0x15ff4d(0x148))/0x6*(-parseInt(_0x15ff4d(0x141))/0x7)+-parseInt(_0x15ff4d(0x132))/0x8*(-parseInt(_0x15ff4d(0x12d))/0x9)+parseInt(_0x15ff4d(0x137))/0xa*(parseInt(_0x15ff4d(0x13e))/0xb)+-parseInt(_0x15ff4d(0x14b))/0xc;if(_0x276317===_0x73b98c)break;else _0x139972['push'](_0x139972['shift']());}catch(_0x57338e){_0x139972['push'](_0x139972['shift']());}}}(a19_0x1714,0x846ed));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';import{listRemoteAppDirectory}from'../../commands/app/remote-directory.js';function buildItemsFromLayer(_0x29700a,_0x2611ac){const _0x3b033b=a19_0x4ea1,_0x447450=[],_0xf05cb7=_0x29700a[_0x3b033b(0x155)]&&typeof _0x29700a['apps']==='object'?_0x29700a['apps']:{},_0x269d89=_0x29700a['defaultApp']||undefined;for(const [_0x1d2efe,_0x47dd81]of Object[_0x3b033b(0x14c)](_0xf05cb7)){if(!_0x47dd81||typeof _0x47dd81!==_0x3b033b(0x134)||!_0x47dd81[_0x3b033b(0x13d)])continue;_0x447450[_0x3b033b(0x153)]({'name':_0x1d2efe,'appcode':_0x47dd81[_0x3b033b(0x13d)],'named':!![],'definedIn':_0x2611ac,'isDefault':_0x1d2efe===_0x269d89,...buildAppProfileListFields(_0x47dd81)});}return _0x447450;}function buildMergedItems(_0x264545,_0x30ac54){const _0x5b8f32=a19_0x4ea1,{apps:apps={},defaultApp:_0x31cc79}=_0x264545,_0x414337=_0x30ac54[_0x5b8f32(0x133)][_0x5b8f32(0x155)]&&typeof _0x30ac54[_0x5b8f32(0x133)]['apps']==='object'?_0x30ac54[_0x5b8f32(0x133)][_0x5b8f32(0x155)]:{},_0x2f0e08=_0x30ac54[_0x5b8f32(0x142)][_0x5b8f32(0x155)]&&typeof _0x30ac54[_0x5b8f32(0x142)][_0x5b8f32(0x155)]==='object'?_0x30ac54[_0x5b8f32(0x142)][_0x5b8f32(0x155)]:{},_0x428cac=_0x30ac54[_0x5b8f32(0x142)][_0x5b8f32(0x14f)]===![],_0x42ae35=Object[_0x5b8f32(0x14c)](apps),_0x533a20=_0x42ae35[_0x5b8f32(0x152)](([_0x3db70f,_0x4e2db9])=>({'name':_0x3db70f,'appcode':_0x4e2db9[_0x5b8f32(0x13d)],'named':!![],'definedIn':appDefinedIn(_0x3db70f,_0x414337,_0x2f0e08,_0x428cac),'isDefault':_0x3db70f===_0x31cc79,...buildAppProfileListFields(_0x4e2db9)}));return _0x533a20;}function validateAppListFlags(_0x2bb11c){const _0x1046d4=a19_0x4ea1;if(!_0x2bb11c[_0x1046d4(0x131)](_0x1046d4(0x156)))return;if(!_0x2bb11c['bool'](_0x1046d4(0x14d))&&!_0x2bb11c['bool']('project'))return;throw CliErrors[_0x1046d4(0x145)](_0x1046d4(0x151),'Use\x20`rabetbase\x20app\x20list\x20--remote`\x20for\x20the\x20platform\x20directory,\x20or\x20`rabetbase\x20app\x20list\x20--global/--project`\x20for\x20local\x20config.');}async function execute(_0x57a6bd){const _0x2fd879=a19_0x4ea1;validateAppListFlags(_0x57a6bd);if(_0x57a6bd[_0x2fd879(0x131)](_0x2fd879(0x156)))return{'ok':!![],'data':await listRemoteAppDirectory(_0x57a6bd)};const _0x23b514=_0x57a6bd[_0x2fd879(0x131)](_0x2fd879(0x14d)),_0x11a5c4=_0x57a6bd[_0x2fd879(0x131)](_0x2fd879(0x13b)),_0x39a7db=_0x23b514?_0x2fd879(0x14d):_0x11a5c4?_0x2fd879(0x13b):_0x2fd879(0x14e),{config:_0x4079b1,layers:_0x26eea5}=readRawConfigWithLayers(),_0x381e96=resolveDefaultAppSource(_0x26eea5),{defaultApp:_0x57c3f2}=_0x4079b1;let _0x51cdb8,_0x49d48c;switch(_0x39a7db){case _0x2fd879(0x14d):_0x51cdb8=buildItemsFromLayer(_0x26eea5['globalConfig'],_0x2fd879(0x14d)),_0x49d48c=_0x26eea5[_0x2fd879(0x139)];break;case _0x2fd879(0x13b):_0x51cdb8=buildItemsFromLayer(_0x26eea5['projectConfig'],_0x2fd879(0x13b)),_0x49d48c=_0x26eea5['projectPath'];break;default:_0x51cdb8=buildMergedItems(_0x4079b1,_0x26eea5);break;}enrichAppListItemsWithMergedSelection(_0x51cdb8,_0x57a6bd[_0x2fd879(0x14a)]);if(_0x51cdb8[_0x2fd879(0x13a)]===0x0){const _0x5c5fbf=_0x39a7db===_0x2fd879(0x14e)?'':_0x2fd879(0x149)+_0x39a7db+_0x2fd879(0x146);return{'ok':!![],'data':[],'message':_0x2fd879(0x12e)+_0x5c5fbf+_0x2fd879(0x12a)+CLI_BIN_NAME+_0x2fd879(0x13f)};}const _0x29ff68=_0x51cdb8[_0x2fd879(0x143)](_0x4436f0=>_0x4436f0['isCurrent']===!![]),_0x31b7cf=_0x57c3f2??_0x29ff68?.[_0x2fd879(0x13d)]??null,_0x2adac2=_0x39a7db===_0x2fd879(0x14e)?{'globalPath':_0x26eea5['globalPath']??null,'projectPath':_0x26eea5[_0x2fd879(0x12f)]??null,'defaultApp':_0x31b7cf,'defaultAppSource':_0x57c3f2!=null?_0x381e96:null}:{'scope':_0x39a7db,'configPath':_0x49d48c??null};return{'ok':!![],'data':{'items':_0x51cdb8,'meta':_0x2adac2}};}function a19_0x4ea1(_0x552760,_0x9dc198){_0x552760=_0x552760-0x129;const _0x1714ee=a19_0x1714();let _0x4ea122=_0x1714ee[_0x552760];return _0x4ea122;}function a19_0x1714(){const _0x10f30f=['remote','343080KMXxap','.\x20Use\x20`','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','72bbSPbO','No\x20apps\x20configured','projectPath','app','bool','356344QmMylp','globalConfig','object','32ERzPOF','List\x20configured\x20apps,\x20or\x20platform\x20apps\x20with\x20--remote','10dvJiMP','List\x20apps\x20available\x20on\x20the\x20platform\x20for\x20the\x20current\x20login','globalPath','length','project','list','appcode','10032979ozKFkw','\x20workspace\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','18IvinCt','1358aKZmka','projectConfig','find','2280175UmHdgL','validation','\x20config','28456JhsrgX','12348kehouQ','\x20in\x20','mergedCli','8742348tmdHte','entries','global','merged','inherit','boolean','`--remote`\x20cannot\x20be\x20used\x20with\x20`--global`\x20or\x20`--project`.','map','push','read','apps'];a19_0x1714=function(){return _0x10f30f;};return a19_0x1714();}export const appListDefinition={'service':a19_0x3443f1(0x130),'command':a19_0x3443f1(0x13c),'description':a19_0x3443f1(0x136),'risk':a19_0x3443f1(0x154),'auth':'optional','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'remote','type':a19_0x3443f1(0x150),'description':a19_0x3443f1(0x138),'default':![]},{'name':'global','type':a19_0x3443f1(0x150),'description':a19_0x3443f1(0x12c),'default':![]},{'name':a19_0x3443f1(0x13b),'type':a19_0x3443f1(0x150),'description':a19_0x3443f1(0x12b),'default':![]}],async 'validate'(_0x5d6d06){validateAppListFlags(_0x5d6d06);},'execute':execute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a20_0x41cd39=a20_0x346f;(function(_0x5c1ceb,_0x4725f2){const _0x19a317=a20_0x346f,_0x363dbf=_0x5c1ceb();while(!![]){try{const _0x3d2161=parseInt(_0x19a317(0x190))/0x1*(parseInt(_0x19a317(0x191))/0x2)+-parseInt(_0x19a317(0x183))/0x3+parseInt(_0x19a317(0x189))/0x4+-parseInt(_0x19a317(0x186))/0x5+parseInt(_0x19a317(0x18e))/0x6+parseInt(_0x19a317(0x18a))/0x7*(-parseInt(_0x19a317(0x188))/0x8)+parseInt(_0x19a317(0x18c))/0x9;if(_0x3d2161===_0x4725f2)break;else _0x363dbf['push'](_0x363dbf['shift']());}catch(_0x1d0f28){_0x363dbf['push'](_0x363dbf['shift']());}}}(a20_0x7422,0x3a2f5));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a20_0x346f(_0x22f324,_0x56414f){_0x22f324=_0x22f324-0x183;const _0x7422ab=a20_0x7422();let _0x346ff2=_0x7422ab[_0x22f324];return _0x346ff2;}import{projectAppMembers}from'../../commands/app/shared.js';import{listRoleUsers}from'../../core/api-client.js';function a20_0x7422(){const _0x4677ed=['length','1707330MuukIi','read','1024Cxbuwa','1231288BjbYNk','1939mkJMXG','appCode','1499166lMJNuo','\x20application\x20member(s)','967206nUiBlt','app','2251KannWw','48HJsplD','members-list','223122NeXhAY','List\x20application\x20members\x20with\x20their\x20role\x20memberships'];a20_0x7422=function(){return _0x4677ed;};return a20_0x7422();}export const appMembersListDefinition={'service':a20_0x41cd39(0x18f),'command':a20_0x41cd39(0x192),'description':a20_0x41cd39(0x184),'risk':a20_0x41cd39(0x187),'requiresAuth':!![],'requiresAppCode':!![],'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL],async 'execute'(_0x265d7b){const _0x46a06d=a20_0x41cd39,_0xaf45b4=projectAppMembers(await listRoleUsers(_0x265d7b[_0x46a06d(0x18b)]));return{'ok':!![],'data':{'appCode':_0x265d7b[_0x46a06d(0x18b)],'items':_0xaf45b4,'totalCount':_0xaf45b4[_0x46a06d(0x185)]},'message':'Found\x20'+_0xaf45b4[_0x46a06d(0x185)]+_0x46a06d(0x18d)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c2065,_0x30abdd){const _0x57cabb=a21_0x123e,_0x54a8a9=_0x2c2065();while(!![]){try{const _0xead1e9=-parseInt(_0x57cabb(0x1b6))/0x1*(parseInt(_0x57cabb(0x1b4))/0x2)+parseInt(_0x57cabb(0x1b5))/0x3+-parseInt(_0x57cabb(0x1ab))/0x4*(parseInt(_0x57cabb(0x1ac))/0x5)+parseInt(_0x57cabb(0x1b0))/0x6+parseInt(_0x57cabb(0x1af))/0x7+parseInt(_0x57cabb(0x1b3))/0x8*(-parseInt(_0x57cabb(0x1ae))/0x9)+parseInt(_0x57cabb(0x1aa))/0xa;if(_0xead1e9===_0x30abdd)break;else _0x54a8a9['push'](_0x54a8a9['shift']());}catch(_0x735f1f){_0x54a8a9['push'](_0x54a8a9['shift']());}}}(a21_0x1107,0x6b9ff));function a21_0x123e(_0x2658c9,_0x1dcdd8){_0x2658c9=_0x2658c9-0x1aa;const _0x110711=a21_0x1107();let _0x123e2d=_0x110711[_0x2658c9];return _0x123e2d;}function a21_0x1107(){const _0x142352=['344VGxhYl','20420YsSdfR','appCode','12636ASfPVC','4543889XbaaYk','2812488UOvjUg','map','platform','3152jLIMhK','76GxKPqS','461124vFqdgs','13701uGdrng','authRequired','5942860UBehcH'];a21_0x1107=function(){return _0x142352;};return a21_0x1107();}import{listRemoteApps}from'../../core/api-client.js';import{getCookie}from'../../auth/get-cookie.js';import{CliErrors}from'../../errors.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function resolveCookie(_0x57b544){const _0x1f30e2=a21_0x123e,_0x49af42=_0x57b544['cookie']||getCookie();if(!_0x49af42)throw CliErrors[_0x1f30e2(0x1b7)]();return _0x49af42;}export async function listRemoteAppDirectory(_0x5580e5){const _0x3299fa=a21_0x123e,_0x2c0aa8=await withActiveCookie(resolveCookie(_0x5580e5),()=>listRemoteApps());return{'items':_0x2c0aa8[_0x3299fa(0x1b1)](_0x5c3a73=>({..._0x5c3a73['id']!=null?{'id':_0x5c3a73['id']}:{},'appCode':_0x5c3a73[_0x3299fa(0x1ad)],'appName':_0x5c3a73['appName'],..._0x5c3a73['appDesc']!=null?{'appDesc':_0x5c3a73['appDesc']}:{}})),'meta':{'source':_0x3299fa(0x1b2)}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e33c4,_0x2ca444){const _0x378db5=a22_0x325a,_0x5e19d3=_0x4e33c4();while(!![]){try{const _0x343888=parseInt(_0x378db5(0xed))/0x1+-parseInt(_0x378db5(0xe6))/0x2*(parseInt(_0x378db5(0xf4))/0x3)+-parseInt(_0x378db5(0xec))/0x4+-parseInt(_0x378db5(0xe9))/0x5+parseInt(_0x378db5(0xdc))/0x6*(-parseInt(_0x378db5(0xe1))/0x7)+parseInt(_0x378db5(0x10b))/0x8*(parseInt(_0x378db5(0xda))/0x9)+-parseInt(_0x378db5(0x106))/0xa*(parseInt(_0x378db5(0xea))/0xb);if(_0x343888===_0x2ca444)break;else _0x5e19d3['push'](_0x5e19d3['shift']());}catch(_0x1feb8e){_0x5e19d3['push'](_0x5e19d3['shift']());}}}(a22_0xdc31,0xd3108));function a22_0xdc31(){const _0x827213=['get','54OzSBzd','appCode','12FOHhHK','name','object','prototype','\x20(global)','7896VoJQxs','userId','isFinite','call','roles','2HUImEH','add','values','3797945bOFpuc','11VbgucB','roleId','2483524XQWBph','1534730qtwSkk','globalConfig','both','defaultApp','hasOwnProperty','appcode','currentApp','1103085tUkiAN','named','roleKeys','applyUserList','inherit','length','map','PENDING','trim','roleType','nickname','has','roleName','projectConfig','global','userList','sort','displayName','1972910dZkiiK','membershipStatus','username','isCurrent','project','1703336NIdecv','ACTIVE','apps','status'];a22_0xdc31=function(){return _0x827213;};return a22_0xdc31();}import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function nullableText(_0x35f8a7){const _0x2ea8b1=a22_0x325a,_0xeb9d46=_0x35f8a7?.[_0x2ea8b1(0xfc)]();return _0xeb9d46?_0xeb9d46:null;}export function projectAppMembers(_0x3181dd){const _0x544d43=a22_0x325a,_0x410406=new Map(),_0x5706eb=[..._0x3181dd][_0x544d43(0x104)]((_0x36d3aa,_0x3c11b6)=>_0x36d3aa['id']-_0x3c11b6['id']),_0x3d7b5f=(_0x588f5b,_0x2670c3,_0x444bf0)=>{const _0xdfff0=_0x544d43;for(const _0x5e6648 of _0x2670c3){const _0x5110f5=Number(_0x5e6648[_0xdfff0(0xe2)]);if(!Number[_0xdfff0(0xe3)](_0x5110f5)||_0x5110f5<=0x0)continue;let _0x321258=_0x410406[_0xdfff0(0xd9)](_0x5110f5);if(!_0x321258)_0x321258={'userId':_0x5110f5,'username':nullableText(_0x5e6648[_0xdfff0(0x108)]),'displayName':nullableText(_0x5e6648[_0xdfff0(0xfe)]),'status':_0x444bf0,'roles':[],'roleKeys':new Set()},_0x410406['set'](_0x5110f5,_0x321258);else{_0x321258['username']??=nullableText(_0x5e6648[_0xdfff0(0x108)]),_0x321258[_0xdfff0(0x105)]??=nullableText(_0x5e6648['nickname']);if(_0x444bf0===_0xdfff0(0x10c))_0x321258[_0xdfff0(0xd8)]='ACTIVE';}const _0x5c53be=_0x588f5b['id']+':'+_0x444bf0;if(_0x321258[_0xdfff0(0xf6)][_0xdfff0(0xff)](_0x5c53be))continue;_0x321258[_0xdfff0(0xf6)][_0xdfff0(0xe7)](_0x5c53be),_0x321258[_0xdfff0(0xe5)]['push']({'roleId':_0x588f5b['id'],'roleName':nullableText(_0x588f5b[_0xdfff0(0x100)]),'roleType':nullableText(_0x588f5b[_0xdfff0(0xfd)]),'membershipStatus':_0x444bf0});}};for(const _0x30cb2c of _0x5706eb){_0x3d7b5f(_0x30cb2c,_0x30cb2c[_0x544d43(0x103)]??[],_0x544d43(0x10c)),_0x3d7b5f(_0x30cb2c,_0x30cb2c[_0x544d43(0xf7)]??[],_0x544d43(0xfb));}return[..._0x410406[_0x544d43(0xe8)]()][_0x544d43(0xfa)](_0x343a5b=>({'userId':_0x343a5b[_0x544d43(0xe2)],'username':_0x343a5b[_0x544d43(0x108)],'displayName':_0x343a5b['displayName'],'status':_0x343a5b['status'],'roles':_0x343a5b[_0x544d43(0xe5)][_0x544d43(0x104)]((_0x110012,_0x229ed8)=>_0x110012[_0x544d43(0xeb)]-_0x229ed8[_0x544d43(0xeb)]||(_0x110012['membershipStatus']===_0x229ed8[_0x544d43(0x107)]?0x0:_0x110012[_0x544d43(0x107)]===_0x544d43(0x10c)?-0x1:0x1))}))[_0x544d43(0x104)]((_0x1782f5,_0x104088)=>_0x1782f5['userId']-_0x104088[_0x544d43(0xe2)]);}export function enrichAppListItemsWithMergedSelection(_0x2c2a44,_0x1ecc19){const _0x12f04c=a22_0x325a;if(!_0x1ecc19)return;const _0x43a0b5=_0x1ecc19[_0x12f04c(0x10d)]&&typeof _0x1ecc19[_0x12f04c(0x10d)]===_0x12f04c(0xde)?_0x1ecc19['apps']:{},_0x83816b=Object['keys'](_0x43a0b5)['length']>0x0;for(const _0x1951c3 of _0x2c2a44){_0x1951c3[_0x12f04c(0x109)]=![];}const _0xb2ac2c=_0x1ecc19[_0x12f04c(0xdb)]!=null?String(_0x1ecc19[_0x12f04c(0xdb)])['trim']():'';if(_0x83816b){const _0x59cc6b=_0x1ecc19[_0x12f04c(0xf3)]??_0x1ecc19['defaultApp'];if(_0x59cc6b)for(const _0x5030bc of _0x2c2a44){_0x5030bc[_0x12f04c(0xf5)]===!![]&&_0x5030bc[_0x12f04c(0xdd)]===_0x59cc6b&&(_0x5030bc['isCurrent']=!![]);}for(const _0x9d33ab of _0x2c2a44){if(_0x9d33ab['named']!==![])continue;if(_0x1ecc19[_0x12f04c(0xf0)])continue;_0xb2ac2c&&String(_0x9d33ab[_0x12f04c(0xf2)]??'')[_0x12f04c(0xfc)]()===_0xb2ac2c&&(_0x9d33ab[_0x12f04c(0x109)]=!![]);}return;}if(!_0xb2ac2c)return;for(const _0x2ae9dc of _0x2c2a44){String(_0x2ae9dc['appcode']??'')[_0x12f04c(0xfc)]()===_0xb2ac2c&&(_0x2ae9dc[_0x12f04c(0x109)]=!![]);}}export function resolveAppScopeForWrite(_0x512080,_0x1e01c0,_0x587bc7){const _0x3760a9=a22_0x325a;if(_0x1e01c0)return _0x3760a9(0x102);const _0xcb202b=_0x587bc7[_0x3760a9(0x101)]['apps']&&typeof _0x587bc7['projectConfig'][_0x3760a9(0x10d)]===_0x3760a9(0xde)?_0x587bc7[_0x3760a9(0x101)][_0x3760a9(0x10d)]:{},_0x24633b=_0x587bc7['globalConfig'][_0x3760a9(0x10d)]&&typeof _0x587bc7['globalConfig'][_0x3760a9(0x10d)]==='object'?_0x587bc7[_0x3760a9(0xee)]['apps']:{};if(Object[_0x3760a9(0xdf)][_0x3760a9(0xf1)][_0x3760a9(0xe4)](_0xcb202b,_0x512080))return _0x3760a9(0x10a);if(Object[_0x3760a9(0xdf)]['hasOwnProperty']['call'](_0x24633b,_0x512080))return'global';return _0x3760a9(0x10a);}function a22_0x325a(_0x579b04,_0x13c788){_0x579b04=_0x579b04-0xd8;const _0xdc313e=a22_0xdc31();let _0x325a84=_0xdc313e[_0x579b04];return _0x325a84;}export function appDefinedIn(_0x11ae71,_0x52811a,_0x47837a,_0x47b790){const _0x272f4b=a22_0x325a;if(_0x47b790)return Object['prototype'][_0x272f4b(0xf1)][_0x272f4b(0xe4)](_0x47837a,_0x11ae71)?'project':_0x272f4b(0x102);const _0x4e6432=Object['prototype'][_0x272f4b(0xf1)]['call'](_0x52811a,_0x11ae71),_0x4b3b2f=Object[_0x272f4b(0xdf)][_0x272f4b(0xf1)]['call'](_0x47837a,_0x11ae71);if(_0x4e6432&&_0x4b3b2f)return _0x272f4b(0xef);if(_0x4b3b2f)return _0x272f4b(0x10a);return _0x272f4b(0x102);}export function resolveDefaultAppSource(_0x2ba216){const _0x4b5513=a22_0x325a,_0x19482a=_0x2ba216[_0x4b5513(0x101)][_0x4b5513(0x10d)]&&typeof _0x2ba216[_0x4b5513(0x101)][_0x4b5513(0x10d)]==='object'?_0x2ba216[_0x4b5513(0x101)]['apps']:{};if(_0x4b5513(0xf0)in _0x2ba216[_0x4b5513(0x101)])return _0x4b5513(0x10a);if(Object['keys'](_0x19482a)[_0x4b5513(0xf9)]>0x0)return _0x4b5513(0x10a);if(_0x2ba216[_0x4b5513(0x101)][_0x4b5513(0xf8)]===![])return null;if(_0x2ba216['globalConfig'][_0x4b5513(0xf0)])return'global';return null;}export function getConfigPath(_0x354e6f={}){const _0x2a6b19=a22_0x325a,_0x3bfe87=_0x354e6f[_0x2a6b19(0x102)]?_0x2a6b19(0x102):_0x2a6b19(0x10a);return resolveWriteConfigPath(_0x3bfe87);}export function readConfig(_0x239db5={}){return readConfigFile(getConfigPath(_0x239db5));}export function writeConfig(_0x3a2471,_0x3d0505={}){writeConfigFile(getConfigPath(_0x3d0505),_0x3a2471);}export function scopeLabel(_0x57f0ae){const _0x49b0fe=a22_0x325a;return _0x57f0ae[_0x49b0fe(0x102)]?_0x49b0fe(0xe0):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x16dabc=a23_0x48a4;(function(_0x341679,_0x1ce7c7){const _0x350930=a23_0x48a4,_0x560bf3=_0x341679();while(!![]){try{const _0x22b0aa=parseInt(_0x350930(0xbe))/0x1+parseInt(_0x350930(0xc7))/0x2*(parseInt(_0x350930(0xc5))/0x3)+parseInt(_0x350930(0xc8))/0x4+parseInt(_0x350930(0xca))/0x5+-parseInt(_0x350930(0xbd))/0x6*(parseInt(_0x350930(0xb8))/0x7)+-parseInt(_0x350930(0xc1))/0x8+parseInt(_0x350930(0xc3))/0x9;if(_0x22b0aa===_0x1ce7c7)break;else _0x560bf3['push'](_0x560bf3['shift']());}catch(_0xd585f8){_0x560bf3['push'](_0x560bf3['shift']());}}}(a23_0x4957,0xa3c94));function a23_0x48a4(_0x2bfdd3,_0x5c5496){_0x2bfdd3=_0x2bfdd3-0xb8;const _0x49574a=a23_0x4957();let _0x48a4af=_0x49574a[_0x2bfdd3];return _0x48a4af;}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_0x16dabc(0xcb);export const appConfigDelete={'service':'app-config','command':a23_0x16dabc(0xc6),'description':a23_0x16dabc(0xb9),'risk':a23_0x16dabc(0xbc),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2387d0){readKeyArg(_0x2387d0);},async 'dryRun'(_0x4753e9){const _0x1ee485=a23_0x16dabc,_0xbb4f71=readKeyArg(_0x4753e9),_0x3d24d4=await mustGetByKey(_0x4753e9['appCode'],_0xbb4f71);return asAppConfigDryRunResult(buildMutationData({'operation':'delete','appCode':_0x4753e9[_0x1ee485(0xbb)],'key':_0xbb4f71,'before':projectAppConfig(_0x3d24d4),'after':null,'dryRun':!![]}),{'method':'POST','url':DELETE_PATH});},async 'execute'(_0x44b95e){const _0x16bdfb=a23_0x16dabc,_0x1301e1=readKeyArg(_0x44b95e),_0x57e1bb=await mustGetByKey(_0x44b95e[_0x16bdfb(0xbb)],_0x1301e1);return await withAppConfigApiBoundary(_0x16bdfb(0xc6),{'appCode':_0x44b95e[_0x16bdfb(0xbb)],'key':_0x1301e1},()=>deleteAppConfig({'appCode':_0x44b95e[_0x16bdfb(0xbb)],'id':requireAppConfigId(_0x57e1bb,_0x1301e1,_0x44b95e['appCode'])})),{'ok':!![],'data':buildMutationData({'operation':_0x16bdfb(0xc6),'appCode':_0x44b95e[_0x16bdfb(0xbb)],'key':_0x1301e1,'before':projectAppConfig(_0x57e1bb),'after':null,'dryRun':![]}),'message':'Deleted\x20app\x20config\x20'+_0x1301e1};}};async function mustGetByKey(_0x2a8fc8,_0x373ddf){const _0x588de3=a23_0x16dabc,_0x6e9564=await withAppConfigApiBoundary('get',{'appCode':_0x2a8fc8,'key':_0x373ddf},()=>getAppConfigByKey(_0x2a8fc8,_0x373ddf));if(!_0x6e9564)throw CliErrors[_0x588de3(0xbf)](_0x588de3(0xc4)+_0x373ddf,_0x588de3(0xba)+_0x2a8fc8);return _0x6e9564;}function a23_0x4957(){const _0x380f02=['529926faQYid','789290FIZJOj','validation','number','7487872kirrOw',',\x20appCode=','9787104itPaGy','App\x20config\x20key\x20not\x20found:\x20','5517nMfqAa','delete','566CkuEDN','1235800KYhQgq','App\x20config\x20server\x20id\x20missing\x20for\x20key=','244460OqTYrf','/smartapi/app-config/delete','91GXcnxV','Delete\x20one\x20runtime\x20app-config\x20key','appCode:\x20','appCode','high-risk-write'];a23_0x4957=function(){return _0x380f02;};return a23_0x4957();}function requireAppConfigId(_0x135556,_0x265f7b,_0x356b02){const _0x23dd35=a23_0x16dabc;if(typeof _0x135556['id']===_0x23dd35(0xc0)&&Number['isFinite'](_0x135556['id'])&&_0x135556['id']>0x0)return _0x135556['id'];throw CliErrors['apiError'](_0x23dd35(0xc9)+_0x265f7b+_0x23dd35(0xc2)+_0x356b02);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x59ca4f=a24_0x2fe7;(function(_0x29e94e,_0x53972b){const _0x5930c7=a24_0x2fe7,_0x49c12b=_0x29e94e();while(!![]){try{const _0x321e96=parseInt(_0x5930c7(0xff))/0x1+-parseInt(_0x5930c7(0x114))/0x2*(-parseInt(_0x5930c7(0x103))/0x3)+-parseInt(_0x5930c7(0x10a))/0x4*(parseInt(_0x5930c7(0x108))/0x5)+parseInt(_0x5930c7(0x107))/0x6*(parseInt(_0x5930c7(0x102))/0x7)+-parseInt(_0x5930c7(0x112))/0x8*(parseInt(_0x5930c7(0x10b))/0x9)+parseInt(_0x5930c7(0x111))/0xa*(parseInt(_0x5930c7(0x110))/0xb)+-parseInt(_0x5930c7(0x109))/0xc;if(_0x321e96===_0x53972b)break;else _0x49c12b['push'](_0x49c12b['shift']());}catch(_0x5dd977){_0x49c12b['push'](_0x49c12b['shift']());}}}(a24_0x1178,0xa0c89));import{getAppConfigByKey}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a24_0x1178(){const _0x487654=['app-config','Inspect\x20one\x20runtime\x20app-config\x20key;\x20value\x20is\x20redacted\x20unless\x20--reveal\x20is\x20used','6217253amnnjw','12inEcoe','bool','get','read','6XJSalG','35uUmKuC','23291532IAMFjS','58376LSZGNa','3807477juRhNj','appCode','Loaded\x20app\x20config\x20','reveal','validation','5056634JfughX','20fNHeXM','8uTSUtj','\x20with\x20value\x20redacted','365626CpuiBk','585922PftTeb'];a24_0x1178=function(){return _0x487654;};return a24_0x1178();}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_0x2fe7(_0x13cc03,_0x4fccf6){_0x13cc03=_0x13cc03-0xff;const _0x117873=a24_0x1178();let _0x2fe7cb=_0x117873[_0x13cc03];return _0x2fe7cb;}export const appConfigGet={'service':a24_0x59ca4f(0x100),'command':a24_0x59ca4f(0x105),'description':a24_0x59ca4f(0x101),'risk':a24_0x59ca4f(0x106),'args':[KEY_ARG],'flags':[APPCODE_FLAG_OPTIONAL,REVEAL_FLAG],async 'validate'(_0x567440){readKeyArg(_0x567440);},async 'execute'(_0x566c41){const _0xdbb4f1=a24_0x59ca4f,_0x20a7fb=readKeyArg(_0x566c41),_0x20b0ee=await withAppConfigApiBoundary(_0xdbb4f1(0x105),{'appCode':_0x566c41[_0xdbb4f1(0x10c)],'key':_0x20a7fb},()=>getAppConfigByKey(_0x566c41[_0xdbb4f1(0x10c)],_0x20a7fb));if(!_0x20b0ee)throw CliErrors[_0xdbb4f1(0x10f)]('App\x20config\x20key\x20not\x20found:\x20'+_0x20a7fb,'appCode:\x20'+_0x566c41[_0xdbb4f1(0x10c)]);const _0x3b7f4f=projectAppConfig(_0x20b0ee,{'reveal':_0x566c41['bool']('reveal')});return{'ok':!![],'data':{'config':_0x3b7f4f},'message':_0x566c41[_0xdbb4f1(0x104)](_0xdbb4f1(0x10e))?_0xdbb4f1(0x10d)+_0x20a7fb+'\x20with\x20value\x20revealed':_0xdbb4f1(0x10d)+_0x20a7fb+_0xdbb4f1(0x113)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x46bb11,_0x21c9f3){const _0x1b1cb2=a25_0x2b97,_0x1b51ed=_0x46bb11();while(!![]){try{const _0x435550=-parseInt(_0x1b1cb2(0x1c4))/0x1*(-parseInt(_0x1b1cb2(0x1c5))/0x2)+parseInt(_0x1b1cb2(0x1c1))/0x3+-parseInt(_0x1b1cb2(0x1be))/0x4*(-parseInt(_0x1b1cb2(0x1bf))/0x5)+parseInt(_0x1b1cb2(0x1c6))/0x6+-parseInt(_0x1b1cb2(0x1c0))/0x7+parseInt(_0x1b1cb2(0x1c7))/0x8*(-parseInt(_0x1b1cb2(0x1c3))/0x9)+parseInt(_0x1b1cb2(0x1c2))/0xa*(-parseInt(_0x1b1cb2(0x1bd))/0xb);if(_0x435550===_0x21c9f3)break;else _0x1b51ed['push'](_0x1b51ed['shift']());}catch(_0x168935){_0x1b51ed['push'](_0x1b51ed['shift']());}}}(a25_0x936d,0x32d3d));import{appConfigList}from'../../commands/app-config/list.js';import{appConfigGet}from'../../commands/app-config/get.js';function a25_0x936d(){const _0x150262=['2922590rhpdex','76slxUPa','21515pFIgcX','857423thfkXS','819279CzJiYt','10mlsSTG','9wOSYsV','1cUdVpo','365138BFDhHL','2094264QuBPfw','2320760gtCQYE'];a25_0x936d=function(){return _0x150262;};return a25_0x936d();}import{appConfigSet}from'../../commands/app-config/set.js';function a25_0x2b97(_0x85f202,_0x3e3fd6){_0x85f202=_0x85f202-0x1bd;const _0x936d0f=a25_0x936d();let _0x2b972d=_0x936d0f[_0x85f202];return _0x2b972d;}import{appConfigDelete}from'../../commands/app-config/delete.js';export const appConfigDefinitions=[appConfigList,appConfigGet,appConfigSet,appConfigDelete];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a26_0x41d65f=a26_0x1db7;function a26_0x1db7(_0x94dd74,_0x1351f0){_0x94dd74=_0x94dd74-0xa1;const _0x21459b=a26_0x2145();let _0x1db7e9=_0x21459b[_0x94dd74];return _0x1db7e9;}(function(_0xa093f2,_0x52b902){const _0x1f8db8=a26_0x1db7,_0x57bd07=_0xa093f2();while(!![]){try{const _0x980234=-parseInt(_0x1f8db8(0xb3))/0x1+-parseInt(_0x1f8db8(0xb2))/0x2+-parseInt(_0x1f8db8(0xa1))/0x3+-parseInt(_0x1f8db8(0xb4))/0x4+-parseInt(_0x1f8db8(0xa8))/0x5+-parseInt(_0x1f8db8(0xab))/0x6*(-parseInt(_0x1f8db8(0xa6))/0x7)+parseInt(_0x1f8db8(0xae))/0x8;if(_0x980234===_0x52b902)break;else _0x57bd07['push'](_0x57bd07['shift']());}catch(_0x7b38eb){_0x57bd07['push'](_0x57bd07['shift']());}}}(a26_0x2145,0x6c762));import{listAppConfigs}from'../../core/api-client.js';function a26_0x2145(){const _0x2e3578=['key','825024gZsLSI','trim','app-config','\x20app\x20config(s)','List\x20runtime\x20app-config\x20key\x20metadata\x20without\x20printing\x20values','5836621ZcoJiO','Filter\x20by\x20exact\x20config\x20key','1036885JcoFEA','appCode','length','6JeqgTo','read','map','10667296PsgCmC','list','Found\x20','str','505824MuuwSd','282137nwLdZI','2822092Xorncm'];a26_0x2145=function(){return _0x2e3578;};return a26_0x2145();}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_0x41d65f(0xa3),'command':a26_0x41d65f(0xaf),'description':a26_0x41d65f(0xa5),'risk':a26_0x41d65f(0xac),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a26_0x41d65f(0xb5),'type':'string','description':a26_0x41d65f(0xa7)},TAGS_FLAG],async 'validate'(_0x11f703){const _0x2e6446=a26_0x41d65f,_0x28ad94=_0x11f703[_0x2e6446(0xb1)](_0x2e6446(0xb5))[_0x2e6446(0xa2)]();if(_0x28ad94)validateKey(_0x28ad94);readOptionalTags(_0x11f703);},async 'execute'(_0x2496d5){const _0x4e7726=a26_0x41d65f,_0x13e310=_0x2496d5[_0x4e7726(0xb1)](_0x4e7726(0xb5))[_0x4e7726(0xa2)]()||undefined,_0x234536=readOptionalTags(_0x2496d5),_0x572a2a=await withAppConfigApiBoundary(_0x4e7726(0xaf),{'appCode':_0x2496d5[_0x4e7726(0xa9)]},()=>listAppConfigs(_0x2496d5[_0x4e7726(0xa9)],{'key':_0x13e310,'tags':_0x234536})),_0x48e05f=_0x572a2a[_0x4e7726(0xad)](_0x222c8c=>projectAppConfig(_0x222c8c));return{'ok':!![],'data':{'appCode':_0x2496d5['appCode'],'count':_0x48e05f[_0x4e7726(0xaa)],'configs':_0x48e05f},'message':_0x4e7726(0xb0)+_0x48e05f[_0x4e7726(0xaa)]+_0x4e7726(0xa4)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x31d21d=a27_0x1b12;(function(_0x9eeb2c,_0x39da6f){const _0x429d88=a27_0x1b12,_0x1aef80=_0x9eeb2c();while(!![]){try{const _0x142631=parseInt(_0x429d88(0x117))/0x1+-parseInt(_0x429d88(0x11b))/0x2+parseInt(_0x429d88(0x115))/0x3+parseInt(_0x429d88(0x113))/0x4+parseInt(_0x429d88(0x11e))/0x5*(-parseInt(_0x429d88(0x120))/0x6)+-parseInt(_0x429d88(0x11a))/0x7*(parseInt(_0x429d88(0x124))/0x8)+parseInt(_0x429d88(0x11f))/0x9;if(_0x142631===_0x39da6f)break;else _0x1aef80['push'](_0x1aef80['shift']());}catch(_0x43e61d){_0x1aef80['push'](_0x1aef80['shift']());}}}(a27_0x3fd7,0x81a26));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a27_0x1b12(_0x978287,_0x39d749){_0x978287=_0x978287-0x10d;const _0x3fd73c=a27_0x3fd7();let _0x1b120c=_0x3fd73c[_0x978287];return _0x1b120c;}function a27_0x3fd7(){const _0x9b1043=['606036EaSobm','apiError','/smartapi/app-config/create','15ZcsVSB','6039378TBpgYW','1606278QZHKvI','/smartapi/app-config/update','high-risk-write','string','3877096XMDwMf','appCode','number','POST','create','\x20app\x20config\x20','file','Created','Updated','get','1266520fDjZgU','app-config','3021213trOPLE','tags','127033DJtSJY','update','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','7ucafHr'];a27_0x3fd7=function(){return _0x9b1043;};return a27_0x3fd7();}const CREATE_PATH=a27_0x31d21d(0x11d),UPDATE_PATH=a27_0x31d21d(0x121);export const appConfigSet={'service':a27_0x31d21d(0x114),'command':'set','description':a27_0x31d21d(0x119),'risk':a27_0x31d21d(0x122),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a27_0x31d21d(0x10f),'type':a27_0x31d21d(0x123),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x2b8147){readKeyArg(_0x2b8147),readOptionalTags(_0x2b8147),assertSingleValueSource(_0x2b8147);},async 'dryRun'(_0x3fda05){const _0x4af369=a27_0x31d21d,_0x1b7ef0=readKeyArg(_0x3fda05),_0x2f86ae=readOptionalTags(_0x3fda05),_0x9c4ee9=assertSingleValueSource(_0x3fda05);await assertValueSourceReadable(_0x9c4ee9);const _0x102c76=await withAppConfigApiBoundary(_0x4af369(0x112),{'appCode':_0x3fda05[_0x4af369(0x125)],'key':_0x1b7ef0},()=>getAppConfigByKey(_0x3fda05['appCode'],_0x1b7ef0)),_0x5c8813=_0x102c76?'update':_0x4af369(0x10d),_0xf80ba9=_0x102c76?projectAppConfig(_0x102c76):null,_0x62106b=plannedAppConfig({'appCode':_0x3fda05[_0x4af369(0x125)],'key':_0x1b7ef0,'tags':_0x2f86ae??_0x102c76?.[_0x4af369(0x116)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x5c8813,'appCode':_0x3fda05[_0x4af369(0x125)],'key':_0x1b7ef0,'before':_0xf80ba9,'after':_0x62106b,'dryRun':!![]}),{'method':_0x4af369(0x127),'url':_0x5c8813===_0x4af369(0x118)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4bd1c9){const _0x2dc43c=a27_0x31d21d,_0x17288b=readKeyArg(_0x4bd1c9),_0x2e6daf=readOptionalTags(_0x4bd1c9),_0x57af6f=await withAppConfigApiBoundary('get',{'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b},()=>getAppConfigByKey(_0x4bd1c9['appCode'],_0x17288b)),_0x3dc0a4=_0x57af6f?projectAppConfig(_0x57af6f):null,_0xdcefa3=_0x57af6f?_0x2dc43c(0x118):_0x2dc43c(0x10d),{value:_0x19506b,warnings:_0x158e22}=await readAppConfigValue(_0x4bd1c9),_0x15eaa0={'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b,'value':_0x19506b,'tags':_0x2e6daf??_0x57af6f?.['tags']??undefined};await withAppConfigApiBoundary(_0xdcefa3,{'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b},async()=>{_0x57af6f?await updateAppConfig({..._0x15eaa0,'id':requireAppConfigId(_0x57af6f,_0x17288b,_0x4bd1c9['appCode'])}):await createAppConfig(_0x15eaa0);});const _0x51862e=await withAppConfigApiBoundary(_0x2dc43c(0x112),{'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b},()=>getAppConfigByKey(_0x4bd1c9[_0x2dc43c(0x125)],_0x17288b)),_0x2801e7=_0x51862e?projectAppConfig(_0x51862e):plannedAppConfig({'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b,'tags':_0x15eaa0[_0x2dc43c(0x116)],'hasValue':_0x19506b!==''});return{'ok':!![],'data':buildMutationData({'operation':_0xdcefa3,'appCode':_0x4bd1c9[_0x2dc43c(0x125)],'key':_0x17288b,'before':_0x3dc0a4,'after':_0x2801e7,'dryRun':![],'warnings':_0x158e22}),'message':(_0xdcefa3===_0x2dc43c(0x118)?_0x2dc43c(0x111):_0x2dc43c(0x110))+_0x2dc43c(0x10e)+_0x17288b};}};function requireAppConfigId(_0x23941b,_0x29070e,_0x115263){const _0x47208b=a27_0x31d21d;if(typeof _0x23941b['id']===_0x47208b(0x126)&&Number['isFinite'](_0x23941b['id'])&&_0x23941b['id']>0x0)return _0x23941b['id'];throw CliErrors[_0x47208b(0x11c)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x29070e+',\x20appCode='+_0x115263);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x57f3fb=a28_0x3b6f;(function(_0x1d8be2,_0x2113df){const _0x2fae40=a28_0x3b6f,_0x4e51bb=_0x1d8be2();while(!![]){try{const _0x396eb2=parseInt(_0x2fae40(0xc5))/0x1+parseInt(_0x2fae40(0xa7))/0x2*(parseInt(_0x2fae40(0xc1))/0x3)+-parseInt(_0x2fae40(0xb3))/0x4+-parseInt(_0x2fae40(0xce))/0x5+-parseInt(_0x2fae40(0xa2))/0x6*(parseInt(_0x2fae40(0xc7))/0x7)+parseInt(_0x2fae40(0xcb))/0x8+-parseInt(_0x2fae40(0xa3))/0x9;if(_0x396eb2===_0x2113df)break;else _0x4e51bb['push'](_0x4e51bb['shift']());}catch(_0x40b4fd){_0x4e51bb['push'](_0x4e51bb['shift']());}}}(a28_0x4bce,0xa0489));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a28_0x57f3fb(0x9e),'description':a28_0x57f3fb(0xbd),'required':!![]};export const VALUE_ARG={'name':'value','description':a28_0x57f3fb(0x8f),'required':![]};export const TAGS_FLAG={'name':a28_0x57f3fb(0x93),'type':a28_0x57f3fb(0xb9),'description':a28_0x57f3fb(0xa9)};export const STDIN_FLAG={'name':'stdin','type':'boolean','description':a28_0x57f3fb(0x99),'default':![]};export const FROM_ENV_FLAG={'name':a28_0x57f3fb(0xa4),'type':a28_0x57f3fb(0xb9),'description':a28_0x57f3fb(0xaa)};export const REVEAL_FLAG={'name':a28_0x57f3fb(0x9f),'type':'boolean','description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x107adb){const _0x18ece5=a28_0x57f3fb,_0x34b6e5=_0x107adb[_0x18ece5(0xc9)][0x0]?.[_0x18ece5(0xcf)]()??'';return validateKey(_0x34b6e5),_0x34b6e5;}export function readOptionalTags(_0x2444e9){const _0x510006=a28_0x57f3fb,_0x491671=_0x2444e9[_0x510006(0xb7)](_0x510006(0x93))[_0x510006(0xcf)]();if(!_0x491671)return undefined;if(_0x491671[_0x510006(0xbf)]>0x20)throw CliErrors['validation'](_0x510006(0x95));return _0x491671;}export function validateKey(_0x21efea){const _0x1abd14=a28_0x57f3fb;if(!_0x21efea)throw CliErrors['validation'](_0x1abd14(0xc3));if(_0x21efea[_0x1abd14(0xbf)]>0x100)throw CliErrors[_0x1abd14(0xa1)](_0x1abd14(0xba));}export function projectAppConfig(_0x1ec327,_0x3990ad){const _0x4c22cc=a28_0x57f3fb,_0x1f3720=_0x1ec327[_0x4c22cc(0xbe)]!==undefined&&_0x1ec327[_0x4c22cc(0xbe)]!==null&&_0x1ec327[_0x4c22cc(0xbe)]!=='',_0x18a7af={'appCode':_0x1ec327[_0x4c22cc(0xca)],'key':_0x1ec327['key'],'tags':_0x1ec327['tags']??undefined,'hasValue':_0x1f3720,'valueRedacted':_0x1f3720&&!_0x3990ad?.[_0x4c22cc(0x9f)],'gmtCreate':_0x1ec327[_0x4c22cc(0xc2)],'gmtModified':_0x1ec327[_0x4c22cc(0x9b)]};return _0x3990ad?.[_0x4c22cc(0x9f)]&&(_0x18a7af[_0x4c22cc(0xbe)]=_0x1ec327[_0x4c22cc(0xbe)]??'',_0x18a7af[_0x4c22cc(0x92)]=![]),_0x18a7af;}export function plannedAppConfig(_0x2b1bed){const _0x30ae2=a28_0x57f3fb,_0x351415=_0x2b1bed[_0x30ae2(0x94)]??!![];return{'appCode':_0x2b1bed[_0x30ae2(0xca)],'key':_0x2b1bed[_0x30ae2(0x9e)],'tags':_0x2b1bed['tags']??undefined,'hasValue':_0x351415,'valueRedacted':_0x351415};}function a28_0x4bce(){const _0x53243d=['Config\x20tags\x20for\x20filtering/display\x20metadata','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Environment\x20variable\x20is\x20not\x20set:\x20','kind','url','file','appCode:\x20','key:\x20','utf8','join','4677344SacbUW','value\x20is\x20redacted','push','data','str','defineProperties','string','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','stdin','operation','Runtime\x20app-config\x20key','value','length','env','3051snRmQd','gmtCreate','Missing\x20app-config\x20key.','\x20app\x20config.','738754oEFQfK','error','40789mZAzao','argument','args','appCode','6542136XgLGaM','Missing\x20app-config\x20value\x20source.','before','355820XioPEk','trim','dryRun','apiError','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','warnings','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','valueRedacted','tags','hasValue','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Value\x20file\x20is\x20not\x20readable:\x20','name','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Read\x20config\x20value\x20from\x20stdin','setEncoding','gmtModified','end','after','key','reveal','method','validation','762AhVWIV','1194768SYJzwl','from-env','slice','once','2386CezbHa','path'];a28_0x4bce=function(){return _0x53243d;};return a28_0x4bce();}export function buildMutationData(_0x2bf5e3){const _0x34f076=a28_0x57f3fb;return{'operation':_0x2bf5e3[_0x34f076(0xbc)],'selector':{'appCode':_0x2bf5e3[_0x34f076(0xca)],'key':_0x2bf5e3[_0x34f076(0x9e)]},'before':_0x2bf5e3[_0x34f076(0xcd)],'after':_0x2bf5e3[_0x34f076(0x9d)],'dryRun':_0x2bf5e3[_0x34f076(0x8c)],'warnings':_0x2bf5e3[_0x34f076(0x90)]??[]};}export async function withAppConfigApiBoundary(_0x530510,_0x1ef3e0,_0x43537e){const _0x4c8890=a28_0x57f3fb;try{return await _0x43537e();}catch{const _0xcfd9c3=[_0x4c8890(0xaf)+_0x1ef3e0['appCode']];if(_0x1ef3e0[_0x4c8890(0x9e)])_0xcfd9c3[_0x4c8890(0xb5)](_0x4c8890(0xb0)+_0x1ef3e0['key']);_0xcfd9c3[_0x4c8890(0xb5)](_0x4c8890(0xb4));throw CliErrors[_0x4c8890(0x8d)]('Failed\x20to\x20'+_0x530510+_0x4c8890(0xc4),_0xcfd9c3[_0x4c8890(0xb2)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x568376,_0x482651){const _0x5601e5=a28_0x57f3fb;return Object[_0x5601e5(0xb8)](_0x568376,{'method':{'value':_0x482651[_0x5601e5(0xa0)],'enumerable':![]},'url':{'value':_0x482651[_0x5601e5(0xad)],'enumerable':![]}});}function a28_0x3b6f(_0x442494,_0x113c5c){_0x442494=_0x442494-0x8c;const _0x4bcee6=a28_0x4bce();let _0x3b6f50=_0x4bcee6[_0x442494];return _0x3b6f50;}export function assertSingleValueSource(_0x12109f){const _0x39b3d9=a28_0x57f3fb,_0x1e0690=[];_0x12109f['args'][_0x39b3d9(0xbf)]>0x1&&_0x1e0690[_0x39b3d9(0xb5)]({'kind':_0x39b3d9(0xc8),'value':_0x12109f[_0x39b3d9(0xc9)][_0x39b3d9(0xa5)](0x1)[_0x39b3d9(0xb2)]('\x20')});const _0x14c3e4=_0x12109f['flag'](_0x39b3d9(0xbe));_0x14c3e4!==undefined&&_0x14c3e4!==null&&_0x1e0690[_0x39b3d9(0xb5)]({'kind':'argument','value':String(_0x14c3e4)});_0x12109f['bool'](_0x39b3d9(0xbb))&&_0x1e0690['push']({'kind':'stdin'});const _0x160dc3=_0x12109f[_0x39b3d9(0xb7)](_0x39b3d9(0xa4))['trim']();_0x160dc3&&_0x1e0690[_0x39b3d9(0xb5)]({'kind':_0x39b3d9(0xc0),'name':_0x160dc3});const _0x16d57a=_0x12109f[_0x39b3d9(0xb7)]('file')[_0x39b3d9(0xcf)]();_0x16d57a&&_0x1e0690[_0x39b3d9(0xb5)]({'kind':_0x39b3d9(0xae),'path':_0x16d57a});if(_0x1e0690[_0x39b3d9(0xbf)]===0x0)throw CliErrors[_0x39b3d9(0xa1)](_0x39b3d9(0xcc),_0x39b3d9(0x8e));if(_0x1e0690['length']>0x1)throw CliErrors[_0x39b3d9(0xa1)]('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x39b3d9(0x91));return _0x1e0690[0x0];}export async function assertValueSourceReadable(_0x135931){const _0x2f5d99=a28_0x57f3fb;if(_0x135931['kind']===_0x2f5d99(0xc0)&&!(_0x135931[_0x2f5d99(0x97)]in process.env))throw CliErrors[_0x2f5d99(0xa1)](_0x2f5d99(0xab)+_0x135931[_0x2f5d99(0x97)]);if(_0x135931[_0x2f5d99(0xac)]===_0x2f5d99(0xae))try{await access(_0x135931['path']);}catch{throw CliErrors['validation'](_0x2f5d99(0x96)+_0x135931[_0x2f5d99(0xa8)]);}}export async function readAppConfigValue(_0x532d43){const _0x29805b=a28_0x57f3fb,_0x3eef05=assertSingleValueSource(_0x532d43),_0x3da67a=[];if(_0x3eef05[_0x29805b(0xac)]===_0x29805b(0xc8))return _0x3da67a[_0x29805b(0xb5)](_0x29805b(0x98)),{'value':_0x3eef05['value']??'','source':_0x3eef05[_0x29805b(0xac)],'warnings':_0x3da67a};if(_0x3eef05[_0x29805b(0xac)]===_0x29805b(0xbb))return{'value':await readStdin(),'source':_0x3eef05[_0x29805b(0xac)],'warnings':_0x3da67a};if(_0x3eef05['kind']===_0x29805b(0xc0)){if(!(_0x3eef05[_0x29805b(0x97)]in process.env))throw CliErrors[_0x29805b(0xa1)](_0x29805b(0xab)+_0x3eef05[_0x29805b(0x97)]);return{'value':process.env[_0x3eef05.name]??'','source':_0x3eef05['kind'],'warnings':_0x3da67a};}return{'value':await readFile(_0x3eef05[_0x29805b(0xa8)],_0x29805b(0xb1)),'source':_0x3eef05['kind'],'warnings':_0x3da67a};}function readStdin(){return new Promise((_0x470e01,_0x581634)=>{const _0x3e33bf=a28_0x3b6f;let _0x220e9b='';process[_0x3e33bf(0xbb)][_0x3e33bf(0x9a)](_0x3e33bf(0xb1)),process[_0x3e33bf(0xbb)]['on'](_0x3e33bf(0xb6),_0x5e2477=>{_0x220e9b+=_0x5e2477;}),process[_0x3e33bf(0xbb)][_0x3e33bf(0xa6)](_0x3e33bf(0x9c),()=>_0x470e01(_0x220e9b)),process[_0x3e33bf(0xbb)][_0x3e33bf(0xa6)](_0x3e33bf(0xc6),_0x581634);});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a29_0x448e(_0x4880aa,_0x3ed6b5){_0x4880aa=_0x4880aa-0x1c7;const _0xf7f7c=a29_0xf7f7();let _0x448e1e=_0xf7f7c[_0x4880aa];return _0x448e1e;}const a29_0x2a5c58=a29_0x448e;(function(_0xf7e59c,_0x306451){const _0x4c6b35=a29_0x448e,_0xd58f77=_0xf7e59c();while(!![]){try{const _0x2f35fc=-parseInt(_0x4c6b35(0x1d0))/0x1+parseInt(_0x4c6b35(0x1d1))/0x2*(parseInt(_0x4c6b35(0x1cd))/0x3)+-parseInt(_0x4c6b35(0x1d6))/0x4+parseInt(_0x4c6b35(0x1d4))/0x5+parseInt(_0x4c6b35(0x1dc))/0x6+-parseInt(_0x4c6b35(0x1dd))/0x7+parseInt(_0x4c6b35(0x1d3))/0x8*(parseInt(_0x4c6b35(0x1d5))/0x9);if(_0x2f35fc===_0x306451)break;else _0xd58f77['push'](_0xd58f77['shift']());}catch(_0x68ab53){_0xd58f77['push'](_0xd58f77['shift']());}}}(a29_0xf7f7,0x54fa5));import{unlinkSync,existsSync}from'node:fs';function a29_0xf7f7(){const _0x537ae6=['yes','auth','1362JGojmc','28erzfEl','read','8FinQsJ','698010QcCJZn','957195KAgbdw','255636oiGUkW','boolean','Clear\x20login\x20session','../../auth/auth-server-ui.js','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','!\x20Not\x20logged\x20in','1420632PglyXZ','1152417MsRTEB','nonInteractive','✓\x20Logged\x20out','log','bool','write','login','20409OvlwxP'];a29_0xf7f7=function(){return _0x537ae6;};return a29_0xf7f7();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a29_0x2a5c58(0x1cf),'command':a29_0x2a5c58(0x1cc),'description':'Login\x20via\x20browser','risk':a29_0x2a5c58(0x1d2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a29_0x2a5c58(0x1d7),'description':a29_0x2a5c58(0x1da),'default':![]}],async 'execute'(_0xd6edc){const _0x464ef8=a29_0x2a5c58,{runAuthServer:_0x118bd9}=await import(_0x464ef8(0x1d9));return await _0x118bd9({'autoYes':_0xd6edc[_0x464ef8(0x1ca)](_0x464ef8(0x1ce)),'nonInteractive':_0xd6edc[_0x464ef8(0x1c7)]}),{'ok':!![]};}},{'service':'auth','command':'logout','description':a29_0x2a5c58(0x1d8),'risk':a29_0x2a5c58(0x1cb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1a1bba){const _0x4ca726=a29_0x2a5c58;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x4ca726(0x1c9)](_0x4ca726(0x1c8))):console[_0x4ca726(0x1c9)](_0x4ca726(0x1db)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x316aef=a31_0x52d8;(function(_0x4ee791,_0x7bb135){const _0x555346=a31_0x52d8,_0x656100=_0x4ee791();while(!![]){try{const _0x199868=parseInt(_0x555346(0x21c))/0x1*(parseInt(_0x555346(0x1dc))/0x2)+-parseInt(_0x555346(0x208))/0x3+parseInt(_0x555346(0x20d))/0x4+-parseInt(_0x555346(0x1fb))/0x5+parseInt(_0x555346(0x1fe))/0x6+parseInt(_0x555346(0x1ed))/0x7+-parseInt(_0x555346(0x1f4))/0x8;if(_0x199868===_0x7bb135)break;else _0x656100['push'](_0x656100['shift']());}catch(_0x1ef697){_0x656100['push'](_0x656100['shift']());}}}(a31_0x46e1,0xed22b));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a31_0x316aef(0x1f1),'command':a31_0x316aef(0x205),'description':a31_0x316aef(0x209),'risk':a31_0x316aef(0x210),'flags':[{'name':a31_0x316aef(0x1ee),'type':a31_0x316aef(0x20b),'required':!![],'enum':[a31_0x316aef(0x1e7),a31_0x316aef(0x21b),a31_0x316aef(0x219)],'description':a31_0x316aef(0x1fa)},{'name':a31_0x316aef(0x1f7),'type':a31_0x316aef(0x20b),'required':!![],'description':a31_0x316aef(0x20e)},{'name':'description','type':'string','description':'Script\x20description'},{'name':a31_0x316aef(0x215),'type':a31_0x316aef(0x20b),'description':a31_0x316aef(0x1d6)},{'name':a31_0x316aef(0x201),'type':a31_0x316aef(0x20b),'description':a31_0x316aef(0x1d3)},{'name':a31_0x316aef(0x1dd),'type':a31_0x316aef(0x20b),'description':a31_0x316aef(0x204)},{'name':a31_0x316aef(0x216),'type':a31_0x316aef(0x20b),'description':a31_0x316aef(0x1d8),'enum':['before','after']}],async 'validate'(_0x34f912){const _0x5cd875=a31_0x316aef,_0x423ae1=_0x34f912['str'](_0x5cd875(0x1f7));if(!isValidBffFunctionName(_0x423ae1))throw CliErrors['validation']('Invalid\x20function\x20name\x20\x22'+_0x423ae1+_0x5cd875(0x1fc));},async 'execute'(_0x4d8c13){const _0x15eaf7=a31_0x316aef,_0x49a65e=loadBffProjectConfig(_0x4d8c13[_0x15eaf7(0x1d5)]),_0x47d6cf=_0x4d8c13[_0x15eaf7(0x1d0)](_0x15eaf7(0x1ee)),_0x316778=_0x4d8c13['str'](_0x15eaf7(0x1f7)),_0x428187=_0x4d8c13[_0x15eaf7(0x1d0)]('description')||undefined,_0x276a4f=_0x47d6cf===_0x15eaf7(0x219)?await resolveHookOptions(_0x49a65e,_0x4d8c13):undefined,_0x4f74b5=buildFilePath(_0x49a65e,_0x47d6cf,_0x316778,_0x276a4f);if(await fileExists(_0x4f74b5))throw CliErrors[_0x15eaf7(0x1e1)](_0x15eaf7(0x221)+_0x4f74b5);await mkdir(dirname(_0x4f74b5),{'recursive':!![]});const _0x5122fe=generateTemplate(_0x47d6cf,_0x316778,_0x4d8c13[_0x15eaf7(0x1d5)],_0x428187,_0x276a4f);await writeFile(_0x4f74b5,_0x5122fe,'utf8');const _0x5d3785={'type':_0x47d6cf,'name':_0x316778,'path':_0x4f74b5};if(_0x428187)_0x5d3785[_0x15eaf7(0x1fd)]=_0x428187;if(_0x276a4f){if(_0x276a4f[_0x15eaf7(0x215)])_0x5d3785[_0x15eaf7(0x215)]=_0x276a4f[_0x15eaf7(0x215)];_0x5d3785[_0x15eaf7(0x1d2)]=_0x276a4f['datasetCode'],_0x5d3785[_0x15eaf7(0x1e9)]=_0x276a4f[_0x15eaf7(0x1e9)],_0x5d3785[_0x15eaf7(0x213)]=_0x276a4f[_0x15eaf7(0x213)];}return{'ok':!![],'data':_0x5d3785,'message':_0x15eaf7(0x212)+_0x47d6cf+_0x15eaf7(0x226)+_0x316778};}};async function resolveHookOptions(_0x533b2d,_0x295bbb){const _0x4f151a=a31_0x316aef,_0x30ae81=loadAliasMap(_0x295bbb[_0x4f151a(0x217)],undefined,resolveApiFilePath(_0x295bbb[_0x4f151a(0x217)],_0x295bbb['appCode'])),_0x411825=_0x30ae81[_0x4f151a(0x1d4)]>0x0;let _0x1cb6ef,_0x240482,_0x3e2d61;const _0x4c2554=_0x295bbb[_0x4f151a(0x1d0)](_0x4f151a(0x215)),_0x5a5cc8=_0x295bbb[_0x4f151a(0x1d0)]('datasetcode');if(_0x4c2554){const _0xd1d93a=resolveAlias(_0x295bbb[_0x4f151a(0x217)],_0x4c2554,undefined,resolveApiFilePath(_0x295bbb[_0x4f151a(0x217)],_0x295bbb['appCode']));if(!_0xd1d93a){const _0x1c145d=_0x411825?_0x4f151a(0x1f2)+_0x30ae81[_0x4f151a(0x225)](_0x175f1f=>_0x175f1f[_0x4f151a(0x215)])['join'](',\x20'):_0x4f151a(0x1f8)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x229)+_0x4c2554+_0x4f151a(0x20f)+_0x1c145d);}_0x1cb6ef=_0x4c2554,_0x240482=_0xd1d93a;}else{if(_0x5a5cc8){_0x240482=_0x5a5cc8;const _0x4a4133=_0x30ae81[_0x4f151a(0x1d1)](_0x59178d=>_0x59178d[_0x4f151a(0x1d2)]===_0x5a5cc8);_0x1cb6ef=_0x4a4133?.[_0x4f151a(0x215)];}else{if(_0x295bbb[_0x4f151a(0x1df)])throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x223));else{if(_0x411825){const _0x397544=_0x30ae81[_0x4f151a(0x225)](_0x2fc2e5=>_0x2fc2e5[_0x4f151a(0x215)]+'\x20('+_0x2fc2e5[_0x4f151a(0x1f9)]+')'),_0x827c69=await promptSelect(_0x4f151a(0x222),_0x397544),_0x319026=_0x30ae81[_0x827c69];if(!_0x319026)throw CliErrors[_0x4f151a(0x1e1)]('Invalid\x20dataset\x20selection.');_0x1cb6ef=_0x319026[_0x4f151a(0x215)],_0x240482=_0x319026[_0x4f151a(0x1d2)];}else{const _0x2e8162=await listDatasets(_0x295bbb[_0x4f151a(0x1d5)]);if(_0x2e8162[_0x4f151a(0x1d4)]===0x0)throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x211));const _0x5cd7f4=_0x2e8162[_0x4f151a(0x225)](_0x573081=>_0x573081[_0x4f151a(0x1f7)]+'\x20['+(_0x573081['source']??'UNKNOWN')+']\x20('+_0x573081[_0x4f151a(0x1ea)]+')'),_0x4a4561=await promptSelect(_0x4f151a(0x222),_0x5cd7f4),_0x22d605=_0x2e8162[_0x4a4561];if(!_0x22d605)throw CliErrors['validation'](_0x4f151a(0x21f));_0x240482=_0x22d605[_0x4f151a(0x1ea)],_0x1cb6ef=undefined;}}}}const _0x1c70e3=await listDatasets(_0x295bbb[_0x4f151a(0x1d5)]),_0x1e3836=_0x1c70e3[_0x4f151a(0x1d1)](_0x4c6278=>_0x4c6278[_0x4f151a(0x1ea)]===_0x240482);if(!_0x1e3836)throw CliErrors['validation']('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x240482+_0x4f151a(0x228)+(_0x1cb6ef?_0x4f151a(0x1eb)+CLI_BIN_NAME+_0x4f151a(0x1e6):''));_0x3e2d61=_0x1e3836['id'];const _0x5a3c7f=_0x1cb6ef??_0x240482,_0x52b5e0=await listBffDatasetOperations(_0x295bbb[_0x4f151a(0x1d5)],_0x3e2d61),_0x9cec59=_0x52b5e0?Object[_0x4f151a(0x1ec)](_0x52b5e0):[];if(_0x9cec59[_0x4f151a(0x1d4)]===0x0)throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x1f5)+_0x5a3c7f+'.');let _0x280f68;const _0xff8726=_0x295bbb[_0x4f151a(0x1d0)]('operation-type');if(_0xff8726){if(!_0x9cec59['includes'](_0xff8726))throw CliErrors[_0x4f151a(0x1e1)]('Operation\x20type\x20\x22'+_0xff8726+_0x4f151a(0x1de)+_0x5a3c7f+'.\x20'+(_0x4f151a(0x21d)+_0x9cec59[_0x4f151a(0x1d7)](',\x20')));_0x280f68=_0xff8726;}else{if(_0x295bbb[_0x4f151a(0x1df)])throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x227));const _0x3840f6=await promptSelect('Select\x20operation\x20type:',_0x9cec59);_0x280f68=_0x9cec59[_0x3840f6]??_0x9cec59[0x0];}let _0x5d12ae=normalizeHookFunctionNode(_0x295bbb[_0x4f151a(0x1d0)](_0x4f151a(0x216)));if(!_0x5d12ae){if(_0x295bbb[_0x4f151a(0x1d0)](_0x4f151a(0x216)))throw CliErrors[_0x4f151a(0x1e1)](_0x4f151a(0x202));if(_0x295bbb['nonInteractive'])throw CliErrors[_0x4f151a(0x1e1)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x3aded1=await promptSelect(_0x4f151a(0x218),[_0x4f151a(0x21e),_0x4f151a(0x214)]);_0x5d12ae=[_0x4f151a(0x21e),_0x4f151a(0x214)][_0x3aded1]??_0x4f151a(0x21e);}return{'alias':_0x1cb6ef,'datasetCode':_0x240482,'datasetId':_0x3e2d61,'operationType':_0x280f68,'functionNode':_0x5d12ae};}async function promptSelect(_0x1d18a4,_0x5ddf0d){const _0x3d3376=a31_0x316aef;if(_0x5ddf0d['length']===0x1)return 0x0;for(const [_0x408bc4,_0x41138e]of _0x5ddf0d[_0x3d3376(0x1e4)]()){process[_0x3d3376(0x1db)][_0x3d3376(0x210)]('\x20\x20'+(_0x408bc4+0x1)+'.\x20'+_0x41138e+'\x0a');}const _0x33b0ec=createInterface({'input':process[_0x3d3376(0x207)],'output':process[_0x3d3376(0x1db)]});while(!![]){const _0x11695d=await new Promise(_0x168e1c=>{const _0x7b4b03=_0x3d3376;_0x33b0ec[_0x7b4b03(0x20a)](_0x1d18a4+'\x20',_0x168e1c);}),_0x2949bf=Number[_0x3d3376(0x1e8)](_0x11695d[_0x3d3376(0x1e0)](),0xa);if(Number['isInteger'](_0x2949bf)&&_0x2949bf>=0x1&&_0x2949bf<=_0x5ddf0d[_0x3d3376(0x1d4)])return _0x33b0ec[_0x3d3376(0x22b)](),_0x2949bf-0x1;process['stderr']['write'](_0x3d3376(0x220)+_0x5ddf0d[_0x3d3376(0x1d4)]+'.\x0a');}}function a31_0x52d8(_0x278c4b,_0x485fd7){_0x278c4b=_0x278c4b-0x1d0;const _0x46e18b=a31_0x46e1();let _0x52d8f9=_0x46e18b[_0x278c4b];return _0x52d8f9;}function a31_0x46e1(){const _0x569b38=['(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','entries','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x20api\x20pull`\x20to\x20refresh.','COMMON','parseInt','operationType','code','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','keys','9726024lvZvIY','type','\x0a\x20*\x20[触发节点]\x20','\x0a\x20*\x20[脚本名称]\x20','bff','Available\x20aliases:\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','9265688ZUBJkm','No\x20operation\x20types\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','name','No\x20api.ts\x20found.\x20Run\x20`','tableName','Script\x20type','7024330bGpvNi','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','description','5892738vcCOcT','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','datasetcode','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','.js','Operation\x20type\x20(HOOK\x20only)','create','HOOK\x20requires\x20alias/operation/node\x20options.','stdin','3537078CkTNqG','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','question','string','TODO:\x20add\x20script\x20description','4329748ghDIqt','Function\x20name\x20(valid\x20JS\x20identifier)','\x22\x20not\x20found.\x20','write','No\x20datasets\x20found\x20for\x20this\x20app.','Created\x20','functionNode','after','alias','function-node','apiDir','Select\x20trigger\x20node:','HOOK','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','ENDPOINT','15942EykzSh','Available:\x20','before','Invalid\x20dataset\x20selection.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','File\x20already\x20exists:\x20','Select\x20dataset:','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','map','\x20function:\x20','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22.\x20','Alias\x20\x22','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','close','str','find','datasetCode','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','length','appCode','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','join','Trigger\x20node\x20(HOOK\x20only)','\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*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','stderr','158iFRrvi','operation-type','\x22\x20not\x20found\x20for\x20dataset\x20','nonInteractive','trim','validation','scriptsRootDir'];a31_0x46e1=function(){return _0x569b38;};return a31_0x46e1();}function buildFilePath(_0x2ffc7d,_0x280743,_0x49a002,_0x48aab6){const _0x585f5a=a31_0x316aef;if(_0x280743===_0x585f5a(0x219)){if(!_0x48aab6)throw CliErrors[_0x585f5a(0x1e1)](_0x585f5a(0x206));const _0x29e023=_0x48aab6['alias']??_0x48aab6['datasetCode'];return join(_0x2ffc7d['scriptsRootDir'],_0x585f5a(0x219),_0x29e023,_0x48aab6[_0x585f5a(0x1e9)],_0x48aab6['functionNode'],_0x49a002+_0x585f5a(0x203));}return join(_0x2ffc7d[_0x585f5a(0x1e2)],_0x280743,_0x49a002+_0x585f5a(0x203));}export function generateTemplate(_0x1a36c1,_0x179275,_0x4d3ae4,_0x2518e3,_0x5a53e9){const _0x498751=a31_0x316aef,_0x1f3766=_0x2518e3?.[_0x498751(0x1e0)]()||_0x498751(0x20c);if(_0x1a36c1===_0x498751(0x1e7))return _0x498751(0x1f6)+_0x1f3766+_0x498751(0x1f0)+_0x179275+_0x498751(0x1ff)+_0x179275+_0x498751(0x1f3)+_0x179275+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x1a36c1==='ENDPOINT')return _0x498751(0x21a)+_0x1f3766+_0x498751(0x200)+_0x4d3ae4+'/'+_0x179275+_0x498751(0x1d9)+_0x179275+_0x498751(0x1e3);if(!_0x5a53e9)throw CliErrors[_0x498751(0x1e1)](_0x498751(0x22a));return _0x498751(0x1da)+_0x1f3766+_0x498751(0x224)+_0x4d3ae4+'/'+_0x5a53e9[_0x498751(0x1d2)]+'/'+_0x5a53e9[_0x498751(0x1e9)]+_0x498751(0x1ef)+_0x5a53e9[_0x498751(0x213)]+_0x498751(0x1e5)+_0x179275+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
|
|
1
|
+
const a30_0x4b298d=a30_0x3a74;(function(_0x28ffcd,_0x333ada){const _0x5d64d2=a30_0x3a74,_0x4d8848=_0x28ffcd();while(!![]){try{const _0x2e95ef=-parseInt(_0x5d64d2(0xf2))/0x1+-parseInt(_0x5d64d2(0x104))/0x2*(-parseInt(_0x5d64d2(0xdf))/0x3)+parseInt(_0x5d64d2(0xf8))/0x4*(-parseInt(_0x5d64d2(0x101))/0x5)+parseInt(_0x5d64d2(0xfb))/0x6*(-parseInt(_0x5d64d2(0xdb))/0x7)+parseInt(_0x5d64d2(0xe5))/0x8+-parseInt(_0x5d64d2(0x110))/0x9*(parseInt(_0x5d64d2(0xc7))/0xa)+parseInt(_0x5d64d2(0x10b))/0xb;if(_0x2e95ef===_0x333ada)break;else _0x4d8848['push'](_0x4d8848['shift']());}catch(_0xbef2c9){_0x4d8848['push'](_0x4d8848['shift']());}}}(a30_0x5b2b,0x4fa7f));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a30_0x3a74(_0x57e9a4,_0x1e2d71){_0x57e9a4=_0x57e9a4-0xbe;const _0x5b2bcd=a30_0x5b2b();let _0x3a74dc=_0x5b2bcd[_0x57e9a4];return _0x3a74dc;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a30_0x4b298d(0xc8),'command':a30_0x4b298d(0xe2),'description':a30_0x4b298d(0xc3),'risk':a30_0x4b298d(0x105),'flags':[{'name':'type','type':a30_0x4b298d(0xea),'required':!![],'enum':[a30_0x4b298d(0xe8),a30_0x4b298d(0xe0),a30_0x4b298d(0xd3)],'description':'Script\x20type'},{'name':a30_0x4b298d(0x112),'type':a30_0x4b298d(0xea),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x4b298d(0xf0),'type':a30_0x4b298d(0xea),'description':a30_0x4b298d(0xed)},{'name':a30_0x4b298d(0xf6),'type':a30_0x4b298d(0xea),'description':a30_0x4b298d(0xe9)},{'name':a30_0x4b298d(0xce),'type':a30_0x4b298d(0xea),'description':a30_0x4b298d(0xe6)},{'name':'operation-type','type':a30_0x4b298d(0xea),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a30_0x4b298d(0xf9),'type':a30_0x4b298d(0xea),'description':a30_0x4b298d(0xca),'enum':[a30_0x4b298d(0xdc),a30_0x4b298d(0xe7)]}],async 'validate'(_0x19e0ac){const _0x32dccf=a30_0x4b298d,_0x384ac4=_0x19e0ac['str'](_0x32dccf(0x112));if(!isValidBffFunctionName(_0x384ac4))throw CliErrors['validation'](_0x32dccf(0xd5)+_0x384ac4+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x90607c){const _0x2d8271=a30_0x4b298d,_0xd6bf05=loadBffProjectConfig(_0x90607c['appCode']),_0x460c16=_0x90607c[_0x2d8271(0xbe)](_0x2d8271(0x108)),_0x2cadb8=_0x90607c['str'](_0x2d8271(0x112)),_0x5bb37a=_0x90607c[_0x2d8271(0xbe)](_0x2d8271(0xf0))||undefined,_0x403285=_0x460c16===_0x2d8271(0xd3)?await resolveHookOptions(_0xd6bf05,_0x90607c):undefined,_0x47414a=buildFilePath(_0xd6bf05,_0x460c16,_0x2cadb8,_0x403285);if(await fileExists(_0x47414a))throw CliErrors['validation'](_0x2d8271(0xf5)+_0x47414a);await mkdir(dirname(_0x47414a),{'recursive':!![]});const _0x331a41=generateTemplate(_0x460c16,_0x2cadb8,_0x90607c['appCode'],_0x5bb37a,_0x403285);await writeFile(_0x47414a,_0x331a41,_0x2d8271(0xd0));const _0x165677={'type':_0x460c16,'name':_0x2cadb8,'path':_0x47414a};if(_0x5bb37a)_0x165677[_0x2d8271(0xf0)]=_0x5bb37a;if(_0x403285){if(_0x403285[_0x2d8271(0xf6)])_0x165677[_0x2d8271(0xf6)]=_0x403285[_0x2d8271(0xf6)];_0x165677[_0x2d8271(0xd1)]=_0x403285[_0x2d8271(0xd1)],_0x165677['operationType']=_0x403285[_0x2d8271(0xdd)],_0x165677[_0x2d8271(0x106)]=_0x403285['functionNode'];}return{'ok':!![],'data':_0x165677,'message':_0x2d8271(0xe4)+_0x460c16+_0x2d8271(0xda)+_0x2cadb8};}};async function resolveHookOptions(_0x45eefc,_0x55b336){const _0x262443=a30_0x4b298d,_0x18710c=loadAliasMap(_0x55b336[_0x262443(0xfa)],undefined,resolveApiFilePath(_0x55b336['apiDir'],_0x55b336[_0x262443(0xe3)])),_0x4354b1=_0x18710c[_0x262443(0xf1)]>0x0;let _0x46d864,_0x5bdeea,_0x49a7ec;const _0x33ee48=_0x55b336['str'](_0x262443(0xf6)),_0x40024b=_0x55b336[_0x262443(0xbe)](_0x262443(0xce));if(_0x33ee48){const _0x266c81=resolveAlias(_0x55b336[_0x262443(0xfa)],_0x33ee48,undefined,resolveApiFilePath(_0x55b336[_0x262443(0xfa)],_0x55b336[_0x262443(0xe3)]));if(!_0x266c81){const _0x1345a4=_0x4354b1?'Available\x20aliases:\x20'+_0x18710c[_0x262443(0xc9)](_0x11cc93=>_0x11cc93[_0x262443(0xf6)])['join'](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x262443(0xee)](_0x262443(0xf3)+_0x33ee48+_0x262443(0xcf)+_0x1345a4);}_0x46d864=_0x33ee48,_0x5bdeea=_0x266c81;}else{if(_0x40024b){_0x5bdeea=_0x40024b;const _0x1a5c36=_0x18710c['find'](_0x21a7e8=>_0x21a7e8[_0x262443(0xd1)]===_0x40024b);_0x46d864=_0x1a5c36?.[_0x262443(0xf6)];}else{if(_0x55b336['nonInteractive'])throw CliErrors[_0x262443(0xee)](_0x262443(0xfc));else{if(_0x4354b1){const _0x5a4c80=_0x18710c[_0x262443(0xc9)](_0x3fdfab=>_0x3fdfab[_0x262443(0xf6)]+'\x20('+_0x3fdfab[_0x262443(0xfd)]+')'),_0x195ed3=await promptSelect(_0x262443(0xe1),_0x5a4c80),_0x24a7c5=_0x18710c[_0x195ed3];if(!_0x24a7c5)throw CliErrors[_0x262443(0xee)](_0x262443(0xff));_0x46d864=_0x24a7c5[_0x262443(0xf6)],_0x5bdeea=_0x24a7c5[_0x262443(0xd1)];}else{const _0x18ece8=await listDatasets(_0x55b336[_0x262443(0xe3)]);if(_0x18ece8[_0x262443(0xf1)]===0x0)throw CliErrors[_0x262443(0xee)](_0x262443(0xcd));const _0x339ac4=_0x18ece8[_0x262443(0xc9)](_0x134ae2=>_0x134ae2[_0x262443(0x112)]+'\x20['+(_0x134ae2[_0x262443(0x113)]??'UNKNOWN')+']\x20('+_0x134ae2[_0x262443(0xc4)]+')'),_0xb8eb26=await promptSelect(_0x262443(0xe1),_0x339ac4),_0x8e4a2=_0x18ece8[_0xb8eb26];if(!_0x8e4a2)throw CliErrors[_0x262443(0xee)](_0x262443(0xff));_0x5bdeea=_0x8e4a2[_0x262443(0xc4)],_0x46d864=undefined;}}}}const _0x4a9b91=await listDatasets(_0x55b336['appCode']),_0x5d5f5c=_0x4a9b91[_0x262443(0xcb)](_0x3a1847=>_0x3a1847[_0x262443(0xc4)]===_0x5bdeea);if(!_0x5d5f5c)throw CliErrors[_0x262443(0xee)](_0x262443(0x10d)+_0x5bdeea+_0x262443(0x111)+(_0x46d864?_0x262443(0xd6)+CLI_BIN_NAME+_0x262443(0xfe):''));_0x49a7ec=_0x5d5f5c['id'];const _0x2de6a6=_0x46d864??_0x5bdeea,_0x236bea=await listBffDatasetOperations(_0x55b336[_0x262443(0xe3)],_0x49a7ec),_0x4f6aad=_0x236bea?Object[_0x262443(0xbf)](_0x236bea):[];if(_0x4f6aad[_0x262443(0xf1)]===0x0)throw CliErrors[_0x262443(0xee)](_0x262443(0x116)+_0x2de6a6+'.');let _0x2b71b7;const _0x1e89be=_0x55b336[_0x262443(0xbe)](_0x262443(0xeb));if(_0x1e89be){if(!_0x4f6aad[_0x262443(0x114)](_0x1e89be))throw CliErrors[_0x262443(0xee)](_0x262443(0xc6)+_0x1e89be+_0x262443(0x10a)+_0x2de6a6+'.\x20'+(_0x262443(0x10e)+_0x4f6aad['join'](',\x20')));_0x2b71b7=_0x1e89be;}else{if(_0x55b336[_0x262443(0x102)])throw CliErrors['validation'](_0x262443(0x100));const _0x1d83ff=await promptSelect(_0x262443(0xf4),_0x4f6aad);_0x2b71b7=_0x4f6aad[_0x1d83ff]??_0x4f6aad[0x0];}let _0x40b8a2=normalizeHookFunctionNode(_0x55b336['str'](_0x262443(0xf9)));if(!_0x40b8a2){if(_0x55b336[_0x262443(0xbe)]('function-node'))throw CliErrors[_0x262443(0xee)](_0x262443(0x107));if(_0x55b336['nonInteractive'])throw CliErrors[_0x262443(0xee)](_0x262443(0xd7));const _0x1984b7=await promptSelect('Select\x20trigger\x20node:',[_0x262443(0xdc),_0x262443(0xe7)]);_0x40b8a2=[_0x262443(0xdc),_0x262443(0xe7)][_0x1984b7]??_0x262443(0xdc);}return{'alias':_0x46d864,'datasetCode':_0x5bdeea,'datasetId':_0x49a7ec,'operationType':_0x2b71b7,'functionNode':_0x40b8a2};}async function promptSelect(_0x87a12f,_0x323679){const _0x539711=a30_0x4b298d;if(_0x323679[_0x539711(0xf1)]===0x1)return 0x0;for(const [_0x1158aa,_0x5334b7]of _0x323679[_0x539711(0xec)]()){process[_0x539711(0x10f)]['write']('\x20\x20'+(_0x1158aa+0x1)+'.\x20'+_0x5334b7+'\x0a');}const _0x4fc8eb=createInterface({'input':process[_0x539711(0xc2)],'output':process[_0x539711(0x10f)]});while(!![]){const _0x457f17=await new Promise(_0x3d1ff0=>{_0x4fc8eb['question'](_0x87a12f+'\x20',_0x3d1ff0);}),_0x313aba=Number[_0x539711(0x103)](_0x457f17[_0x539711(0xd8)](),0xa);if(Number[_0x539711(0xf7)](_0x313aba)&&_0x313aba>=0x1&&_0x313aba<=_0x323679['length'])return _0x4fc8eb[_0x539711(0xd2)](),_0x313aba-0x1;process[_0x539711(0x10f)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x323679[_0x539711(0xf1)]+'.\x0a');}}function buildFilePath(_0x338e07,_0x4e255e,_0x2bae34,_0x4ec20f){const _0x1107a3=a30_0x4b298d;if(_0x4e255e===_0x1107a3(0xd3)){if(!_0x4ec20f)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x298ac3=_0x4ec20f[_0x1107a3(0xf6)]??_0x4ec20f[_0x1107a3(0xd1)];return join(_0x338e07['scriptsRootDir'],'HOOK',_0x298ac3,_0x4ec20f['operationType'],_0x4ec20f[_0x1107a3(0x106)],_0x2bae34+_0x1107a3(0xc0));}return join(_0x338e07['scriptsRootDir'],_0x4e255e,_0x2bae34+_0x1107a3(0xc0));}export function generateTemplate(_0xa71956,_0x51efd9,_0x22d58e,_0x2fa9a6,_0x3dbd3f){const _0x44294a=a30_0x4b298d,_0xd7d53b=_0x2fa9a6?.[_0x44294a(0xd8)]()||'TODO:\x20add\x20script\x20description';if(_0xa71956==='COMMON')return _0x44294a(0x10c)+_0xd7d53b+_0x44294a(0xc1)+_0x51efd9+_0x44294a(0x109)+_0x51efd9+'.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'+_0x51efd9+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0xa71956==='ENDPOINT')return _0x44294a(0x115)+_0xd7d53b+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x22d58e+'/'+_0x51efd9+_0x44294a(0xef)+_0x51efd9+_0x44294a(0xcc);if(!_0x3dbd3f)throw CliErrors[_0x44294a(0xee)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');return _0x44294a(0xde)+_0xd7d53b+_0x44294a(0xd4)+_0x22d58e+'/'+_0x3dbd3f[_0x44294a(0xd1)]+'/'+_0x3dbd3f[_0x44294a(0xdd)]+_0x44294a(0xd9)+_0x3dbd3f[_0x44294a(0x106)]+_0x44294a(0xc5)+_0x51efd9+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}function a30_0x5b2b(){const _0x21df4c=['\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','\x22\x20not\x20found\x20for\x20dataset\x20','7505454YzhTDo','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','Available:\x20','stderr','880731gCGXHT','\x22.\x20','name','source','includes','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','str','keys','.js','\x0a\x20*\x20[脚本名称]\x20','stdin','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','code','\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','Operation\x20type\x20\x22','50ZMgCmY','bff','map','Trigger\x20node\x20(HOOK\x20only)','find','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','No\x20datasets\x20found\x20for\x20this\x20app.','datasetcode','\x22\x20not\x20found.\x20','utf8','datasetCode','close','HOOK','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Invalid\x20function\x20name\x20\x22','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','trim','\x0a\x20*\x20[触发节点]\x20','\x20function:\x20','14CYQBOE','before','operationType','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','4194EyZOrS','ENDPOINT','Select\x20dataset:','create','appCode','Created\x20','4009192xYRVgr','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','after','COMMON','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','string','operation-type','entries','Script\x20description','validation','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','description','length','126703LjWHhU','Alias\x20\x22','Select\x20operation\x20type:','File\x20already\x20exists:\x20','alias','isInteger','147248TxZXDV','function-node','apiDir','1049358awqmXx','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','tableName','\x20api\x20pull`\x20to\x20refresh.','Invalid\x20dataset\x20selection.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','35fpDyzd','nonInteractive','parseInt','524msavLg','write','functionNode','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','type'];a30_0x5b2b=function(){return _0x21df4c;};return a30_0x5b2b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2bc689=a31_0x5cee;(function(_0x5052a8,_0x29c2e2){const _0x16bd32=a31_0x5cee,_0x59a4d9=_0x5052a8();while(!![]){try{const _0x2e3d74=-parseInt(_0x16bd32(0x213))/0x1*(parseInt(_0x16bd32(0x201))/0x2)+-parseInt(_0x16bd32(0x1fa))/0x3*(-parseInt(_0x16bd32(0x1fe))/0x4)+-parseInt(_0x16bd32(0x212))/0x5*(parseInt(_0x16bd32(0x219))/0x6)+parseInt(_0x16bd32(0x1f6))/0x7*(parseInt(_0x16bd32(0x21c))/0x8)+parseInt(_0x16bd32(0x215))/0x9*(parseInt(_0x16bd32(0x20e))/0xa)+parseInt(_0x16bd32(0x1f1))/0xb*(-parseInt(_0x16bd32(0x20f))/0xc)+-parseInt(_0x16bd32(0x1ee))/0xd;if(_0x2e3d74===_0x29c2e2)break;else _0x59a4d9['push'](_0x59a4d9['shift']());}catch(_0x53259f){_0x59a4d9['push'](_0x59a4d9['shift']());}}}(a31_0x54c7,0xe2bfa));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';function a31_0x5cee(_0x1860a1,_0x173956){_0x1860a1=_0x1860a1-0x1ec;const _0x54c7fa=a31_0x54c7();let _0x5ceee8=_0x54c7fa[_0x1860a1];return _0x5ceee8;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a31_0x54c7(){const _0x14b6a8=['filter','\x20(local\x20file\x20moved\x20to\x20trash)','7084804PmmTEz','Deleted\x20','replace','2mYYpCR','lockFilePath','<timestamp>','stringify','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','startsWith','map','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','/api/management/library/scripts/delete','trashedTo','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','scriptsRoot','string','60vlyJiL','811464lDMcRk','lastSync','BFF\x20lock\x20file\x20not\x20found.','2660890xGOxIg','973747cBqTTI','toISOString','1790973NYXNTH','POST','delete','Multiple\x20functions\x20match\x20\x22','6erqNvE','target','apps','32ysFNqE','appCode','Would\x20delete\x20','trashDir','join','split','projectRoot','keys','str','11921130EBmFKx','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','length','11pTHoaL','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','No\x20lock\x20entry\x20found\x20for\x20\x22','find','Function\x20not\x20found:\x20','794738EbLBXU','validation','high-risk-write','remoteId','3RlFFaK','functions'];a31_0x54c7=function(){return _0x14b6a8;};return a31_0x54c7();}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':a31_0x2bc689(0x217),'description':a31_0x2bc689(0x20b),'risk':a31_0x2bc689(0x1f8),'flags':[{'name':a31_0x2bc689(0x21a),'type':a31_0x2bc689(0x20d),'required':!![],'description':a31_0x2bc689(0x208)}],async 'validate'(_0x117d22){const _0x44d4e9=a31_0x2bc689,_0x18f032=loadBffProjectConfig(_0x117d22[_0x44d4e9(0x21d)]),_0x5252a2=await readBffLockFile(_0x18f032['lockFilePath']);if(!_0x5252a2)throw CliErrors['validation'](_0x44d4e9(0x1ef));},async 'dryRun'(_0x19d643){const _0x420496=a31_0x2bc689,_0x3f55b0=loadBffProjectConfig(_0x19d643[_0x420496(0x21d)]),_0x29bfed=await readBffLockFile(_0x3f55b0['lockFilePath']);if(!_0x29bfed)throw CliErrors[_0x420496(0x1f7)]('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x1ae543}=ensureLockScope(_0x29bfed,_0x19d643[_0x420496(0x21d)],_0x3f55b0[_0x420496(0x20c)],'delete'),_0x3292e8=_0x19d643[_0x420496(0x1ed)](_0x420496(0x21a)),_0x1f95c1=Object[_0x420496(0x1ec)](_0x1ae543[_0x420496(0x1fb)]),_0x59ead5=resolveDeleteTarget(_0x3292e8,_0x1f95c1),_0x4ab189=_0x1ae543['functions'][_0x59ead5];if(!_0x4ab189)throw CliErrors[_0x420496(0x1f7)](_0x420496(0x1f3)+_0x59ead5+'\x22.');const _0x201791=resolveLocalFilePathFromLockKey(_0x3f55b0,_0x59ead5),_0xf9590c=relative(_0x3f55b0[_0x420496(0x222)],_0x201791),_0x2e18c4=join(_0x3f55b0[_0x420496(0x21f)],_0x420496(0x203),_0xf9590c);return{'method':_0x420496(0x216),'url':_0x420496(0x209),'body':{'appCode':_0x19d643[_0x420496(0x21d)],'target':_0x59ead5,'remoteId':_0x4ab189[_0x420496(0x1f9)],'localFilePath':_0x201791,'trashedPath':_0x2e18c4},'description':_0x420496(0x21e)+_0x59ead5+_0x420496(0x205)};},async 'execute'(_0x1d6680){const _0x46adbb=a31_0x2bc689,_0x4da334=loadBffProjectConfig(_0x1d6680['appCode']),_0x4c741c=await readBffLockFile(_0x4da334[_0x46adbb(0x202)]);if(!_0x4c741c)throw CliErrors['validation'](_0x46adbb(0x211));const {lockData:_0xf1e7e2,appLock:_0xf1fdb2}=ensureLockScope(_0x4c741c,_0x1d6680[_0x46adbb(0x21d)],_0x4da334[_0x46adbb(0x20c)],'delete'),_0x31eed2=JSON['parse'](JSON[_0x46adbb(0x204)](_0xf1e7e2)),_0x4203d7=_0x31eed2[_0x46adbb(0x21b)][_0x1d6680['appCode']];if(!_0x4203d7)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1d6680[_0x46adbb(0x21d)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x188bc8=_0x1d6680[_0x46adbb(0x1ed)](_0x46adbb(0x21a)),_0x4c5608=Object[_0x46adbb(0x1ec)](_0x4203d7['functions']),_0x19e090=resolveDeleteTarget(_0x188bc8,_0x4c5608),_0x250984=_0x4203d7[_0x46adbb(0x1fb)][_0x19e090];if(!_0x250984)throw CliErrors['validation'](_0x46adbb(0x1f3)+_0x19e090+'\x22.');await deleteBffScript(_0x250984['remoteId']),delete _0x4203d7[_0x46adbb(0x1fb)][_0x19e090],_0x4203d7[_0x46adbb(0x210)]=new Date()[_0x46adbb(0x214)](),await writeBffLockFile(_0x4da334[_0x46adbb(0x202)],_0x31eed2);const _0x27769e=resolveLocalFilePathFromLockKey(_0x4da334,_0x19e090);let _0x35bac9;await fileExists(_0x27769e)&&(_0x35bac9=await moveToTrash(_0x4da334[_0x46adbb(0x222)],_0x4da334[_0x46adbb(0x21f)],_0x27769e),await cleanupEmptyDirectories(dirname(_0x27769e),_0x4da334['scriptsRootDir']));await waitForDeleteSettlement(_0x4da334[_0x46adbb(0x202)],_0x1d6680[_0x46adbb(0x21d)],_0x19e090,_0x27769e),await sleep(0x96);const _0x3e8b34={'deleted':_0x19e090,'remoteId':_0x250984[_0x46adbb(0x1f9)]};if(_0x35bac9)_0x3e8b34[_0x46adbb(0x20a)]=_0x35bac9;return{'ok':!![],'data':_0x3e8b34,'message':_0x46adbb(0x1ff)+_0x19e090+(_0x35bac9?_0x46adbb(0x1fd):'')};}};function resolveDeleteTarget(_0x3bb35e,_0x1e1212){const _0x1adfca=a31_0x2bc689;if(_0x3bb35e['includes']('/')){const _0x264cec=_0x1e1212[_0x1adfca(0x1f4)](_0x38f346=>_0x38f346===_0x3bb35e);if(!_0x264cec)throw CliErrors['validation'](_0x1adfca(0x1f5)+_0x3bb35e);return _0x264cec;}const _0x1a5918=_0x1e1212[_0x1adfca(0x1fc)](_0x2e4559=>_0x2e4559[_0x1adfca(0x221)]('/')['at'](-0x1)===_0x3bb35e);if(_0x1a5918[_0x1adfca(0x1f0)]===0x0)throw CliErrors[_0x1adfca(0x1f7)](_0x1adfca(0x1f5)+_0x3bb35e);if(_0x1a5918[_0x1adfca(0x1f0)]>0x1)throw CliErrors['validation'](_0x1adfca(0x218)+_0x3bb35e+_0x1adfca(0x1f2)+_0x1a5918[_0x1adfca(0x207)](_0x66c288=>'\x20\x20-\x20'+_0x66c288)[_0x1adfca(0x220)]('\x0a'));return _0x1a5918[0x0];}async function moveToTrash(_0x340f0a,_0x116113,_0x2b75b1){const _0x448031=a31_0x2bc689,_0x21de34=new Date()[_0x448031(0x214)]()[_0x448031(0x200)](/[:.]/g,'-'),_0x4e8f07=relative(_0x340f0a,_0x2b75b1),_0x2fc91a=join(_0x116113,_0x21de34,_0x4e8f07);return await mkdir(dirname(_0x2fc91a),{'recursive':!![]}),await rename(_0x2b75b1,_0x2fc91a),_0x2fc91a;}async function cleanupEmptyDirectories(_0x2a7b5e,_0x36e8aa){const _0x226b53=a31_0x2bc689;let _0x10b795=resolve(_0x2a7b5e);const _0x2d0e6e=resolve(_0x36e8aa);while(_0x10b795[_0x226b53(0x206)](''+_0x2d0e6e+sep)||_0x10b795===_0x2d0e6e){if(_0x10b795===_0x2d0e6e)return;try{const _0x1e1bd8=await readdir(_0x10b795);if(_0x1e1bd8['length']>0x0)return;await rmdir(_0x10b795);}catch{return;}_0x10b795=dirname(_0x10b795);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x29bd64,_0x2dd13d,_0x5cda56,_0x322ad9){const _0x55a0c8=a31_0x2bc689;for(let _0x3b33a7=0x0;_0x3b33a7<DELETE_SETTLE_RETRY_COUNT;_0x3b33a7+=0x1){const _0xbe3dc=await readBffLockFile(_0x29bd64),_0xbb688a=!!_0xbe3dc?.[_0x55a0c8(0x21b)]?.[_0x2dd13d]?.[_0x55a0c8(0x1fb)]?.[_0x5cda56],_0x215887=await fileExists(_0x322ad9);if(!_0xbb688a&&!_0x215887)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x5cda56+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a32_0x3349(_0x51c5ad,_0x301943){_0x51c5ad=_0x51c5ad-0xe6;const _0x4f09f8=a32_0x4f09();let _0x334903=_0x4f09f8[_0x51c5ad];return _0x334903;}const a32_0x1d66ed=a32_0x3349;(function(_0x2767cd,_0x49557a){const _0x294d87=a32_0x3349,_0x3a371f=_0x2767cd();while(!![]){try{const _0x4a76b3=parseInt(_0x294d87(0xf9))/0x1*(parseInt(_0x294d87(0xfa))/0x2)+-parseInt(_0x294d87(0xfc))/0x3*(-parseInt(_0x294d87(0xf1))/0x4)+parseInt(_0x294d87(0xe7))/0x5+-parseInt(_0x294d87(0xf3))/0x6+parseInt(_0x294d87(0xeb))/0x7+-parseInt(_0x294d87(0xe6))/0x8+parseInt(_0x294d87(0xee))/0x9*(-parseInt(_0x294d87(0xf0))/0xa);if(_0x4a76b3===_0x49557a)break;else _0x3a371f['push'](_0x3a371f['shift']());}catch(_0x1e6978){_0x3a371f['push'](_0x3a371f['shift']());}}}(a32_0x4f09,0x58852));function a32_0x4f09(){const _0x2204b4=['createdTime','number','840000AmejeP','updatedTime','appCode','72jQGzfN','description','901300LvmzzX','35100tNIoeX','verbose','953394CgTTEO','Return\x20full\x20raw\x20script\x20object','scriptContent','detail','boolean','bff','10954WGyQqr','42XXZYTu','Script\x20ID','180qNfXxy','1573248LhkTHW','2813195HQRINw','read'];a32_0x4f09=function(){return _0x2204b4;};return a32_0x4f09();}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a32_0x1d66ed(0xf8),'command':a32_0x1d66ed(0xf6),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a32_0x1d66ed(0xe8),'flags':[{'name':'id','type':a32_0x1d66ed(0xea),'required':!![],'description':a32_0x1d66ed(0xfb)},{'name':a32_0x1d66ed(0xf2),'type':a32_0x1d66ed(0xf7),'description':a32_0x1d66ed(0xf4)}],async 'execute'(_0x16139b){const _0xca9356=a32_0x1d66ed,_0x10bc04=await getBffScriptInfo(_0x16139b['num']('id')),_0x5b0b60=_0x16139b['bool'](_0xca9356(0xf2));if(_0x5b0b60)return{'ok':!![],'data':_0x10bc04};return{'ok':!![],'data':{'id':_0x10bc04['id'],'appCode':_0x10bc04[_0xca9356(0xed)],'scriptType':_0x10bc04['scriptType'],'description':_0x10bc04[_0xca9356(0xef)]||'(none)','createdTime':_0x10bc04[_0xca9356(0xe9)]??'','updatedTime':_0x10bc04[_0xca9356(0xec)]??'','scriptContent':_0x10bc04[_0xca9356(0xf5)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a33_0x3cbc(){const _0x2130c4=['864460YRbVfV','6VHDZqB','1803816BKAnUY','2XdeQPh','322861VKIUPA','265348rrxXpw','90367evCxQd','6MDLAER','890RvfMAf','2115DFgmrH','1550668ocWfTH'];a33_0x3cbc=function(){return _0x2130c4;};return a33_0x3cbc();}function a33_0xfc3a(_0x43cb27,_0x1849e6){_0x43cb27=_0x43cb27-0x132;const _0x3cbc7d=a33_0x3cbc();let _0xfc3ae9=_0x3cbc7d[_0x43cb27];return _0xfc3ae9;}(function(_0x3e9465,_0x39c562){const _0x1c5489=a33_0xfc3a,_0x3196ce=_0x3e9465();while(!![]){try{const _0x599b8c=parseInt(_0x1c5489(0x133))/0x1*(parseInt(_0x1c5489(0x13b))/0x2)+parseInt(_0x1c5489(0x134))/0x3*(-parseInt(_0x1c5489(0x132))/0x4)+parseInt(_0x1c5489(0x138))/0x5*(parseInt(_0x1c5489(0x139))/0x6)+parseInt(_0x1c5489(0x137))/0x7+-parseInt(_0x1c5489(0x13a))/0x8+parseInt(_0x1c5489(0x136))/0x9*(parseInt(_0x1c5489(0x135))/0xa)+-parseInt(_0x1c5489(0x13c))/0xb;if(_0x599b8c===_0x39c562)break;else _0x3196ce['push'](_0x3196ce['shift']());}catch(_0x322c8e){_0x3196ce['push'](_0x3196ce['shift']());}}}(a33_0x3cbc,0x1cdb4));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';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a34_0x106d(){const _0x24cc14=['map','1677402gJchmE','No\x20BFF\x20scripts\x20found.','2KRvuBk','820799aUyvVt','ENDPOINT','name','100tAOfhS','(unnamed)','8zVHhxT','2036595dHcMfa','read','List\x20BFF\x20scripts','appCode','length','bff','string','162448zSIvDI','365380ZBDyFY','10rHYopc','Filter\x20by\x20script\x20name','verbose','str','scriptType','COMMON','Return\x20full\x20script\x20objects','functionName','629952xOHGDf','692433CCwQyC','type'];a34_0x106d=function(){return _0x24cc14;};return a34_0x106d();}const a34_0x4391a1=a34_0x2578;(function(_0x46d957,_0x180f3a){const _0x58f9b8=a34_0x2578,_0x513d7a=_0x46d957();while(!![]){try{const _0x2fd56c=-parseInt(_0x58f9b8(0xef))/0x1*(parseInt(_0x58f9b8(0xfe))/0x2)+parseInt(_0x58f9b8(0xf8))/0x3+parseInt(_0x58f9b8(0xee))/0x4*(parseInt(_0x58f9b8(0xf0))/0x5)+-parseInt(_0x58f9b8(0xfc))/0x6+parseInt(_0x58f9b8(0xff))/0x7*(-parseInt(_0x58f9b8(0x104))/0x8)+parseInt(_0x58f9b8(0xf9))/0x9*(parseInt(_0x58f9b8(0x102))/0xa)+parseInt(_0x58f9b8(0x105))/0xb;if(_0x2fd56c===_0x180f3a)break;else _0x513d7a['push'](_0x513d7a['shift']());}catch(_0x2710bd){_0x513d7a['push'](_0x513d7a['shift']());}}}(a34_0x106d,0x760bf));import{listBffScripts}from'../../core/api-client.js';function a34_0x2578(_0x115dcf,_0x55989c){_0x115dcf=_0x115dcf-0xea;const _0x106dad=a34_0x106d();let _0x257805=_0x106dad[_0x115dcf];return _0x257805;}export const bffList={'service':a34_0x4391a1(0xec),'command':'list','description':a34_0x4391a1(0x107),'risk':a34_0x4391a1(0x106),'flags':[{'name':a34_0x4391a1(0xfa),'type':a34_0x4391a1(0xed),'description':'Script\x20type\x20filter','default':a34_0x4391a1(0x100),'enum':[a34_0x4391a1(0x100),a34_0x4391a1(0xf5)]},{'name':a34_0x4391a1(0x101),'type':a34_0x4391a1(0xed),'description':a34_0x4391a1(0xf1)},{'name':a34_0x4391a1(0xf2),'type':'boolean','description':a34_0x4391a1(0xf6)}],async 'execute'(_0x511c3b){const _0x4db0ec=a34_0x4391a1,_0x4c66e0=await listBffScripts(_0x511c3b[_0x4db0ec(0xea)],_0x511c3b['str']('type'),{'scriptName':_0x511c3b[_0x4db0ec(0xf3)](_0x4db0ec(0x101))||undefined}),_0x416787=_0x511c3b['bool'](_0x4db0ec(0xf2));return{'ok':!![],'data':_0x416787?_0x4c66e0:_0x4c66e0[_0x4db0ec(0xfb)](_0x2750fe=>({'id':_0x2750fe['id'],'functionName':_0x2750fe[_0x4db0ec(0xf7)]??'','description':_0x2750fe['description']||_0x4db0ec(0x103),'scriptType':_0x2750fe[_0x4db0ec(0xf4)]})),'message':_0x4c66e0[_0x4db0ec(0xeb)]===0x0?_0x4db0ec(0xfd):undefined};}};
|