@lovrabet/lovrabet-cli 2.2.7-beta.1 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.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-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/personal-bff/index.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/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.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/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.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/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x2bc6e4=a43_0x48d5;(function(_0x39847c,_0x566cf3){const _0x129eb6=a43_0x48d5,_0x21f290=_0x39847c();while(!![]){try{const _0x2b0f28=-parseInt(_0x129eb6(0x9a))/0x1*(-parseInt(_0x129eb6(0x89))/0x2)+parseInt(_0x129eb6(0xb7))/0x3*(parseInt(_0x129eb6(0x8b))/0x4)+parseInt(_0x129eb6(0xae))/0x5*(parseInt(_0x129eb6(0x95))/0x6)+parseInt(_0x129eb6(0xa1))/0x7+parseInt(_0x129eb6(0xb4))/0x8+parseInt(_0x129eb6(0x8a))/0x9+-parseInt(_0x129eb6(0x9d))/0xa;if(_0x2b0f28===_0x566cf3)break;else _0x21f290['push'](_0x21f290['shift']());}catch(_0x2f185d){_0x21f290['push'](_0x21f290['shift']());}}}(a43_0x5075,0xa6fee));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a43_0x5075(){const _0x185fe0=['operation','validation','/client/permit/resource/batch-save-menu','changed','rolePermit','menus','授予或收回目标角色对指定运行菜单的访问权限;变更会影响该角色用户的菜单可见性。','\x20for\x20role\x20','67938XVlXcj','permitList','description','length','Invalid\x20runtime\x20menu\x20ID:\x20','19JVtGfZ','--menus','POST','40414260kTjOTT','before','isSafeInteger','menu-','7250873xgPbfV','body','map','Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','after','revoke','role-menus-set','str','Runtime\x20menu\x20','Comma-separated\x20runtime\x20menu\x20IDs','bool','grant','string','215HRsRPW','role','\x20selected\x20runtime\x20menus','push','Preview:\x20','find','10921800IxpHLm','menuIds','warnings','1398GfxgBZ','\x20already\x20reflects\x20','appCode','build','permit','9526hIqjXv','8903466upreRk','6504LcfnSN','roles'];a43_0x5075=function(){return _0x185fe0;};return a43_0x5075();}function a43_0x48d5(_0x5650f7,_0x455c0f){_0x5650f7=_0x5650f7-0x85;const _0x507543=a43_0x5075();let _0x48d5e3=_0x507543[_0x5650f7];return _0x48d5e3;}import{dryRun}from'../../framework/dryrun.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{applyRuntimeRolePermission,assertGrantOrRevoke,assertRuntimePermissionManager,assertRuntimePermitRoleConfigurable,flattenRuntimeMenuRolePermits,GRANT_FLAG,menuPermitDto,REVOKE_FLAG,ROLE_REF_FLAG,runtimePermitWriteResult,splitRefs}from'../../commands/permit/shared.js';const MENUS_FLAG={'name':a43_0x2bc6e4(0x92),'type':a43_0x2bc6e4(0xad),'required':!![],'description':a43_0x2bc6e4(0xaa)};async function prepare(_0x46db70){const _0x556b3c=a43_0x2bc6e4;await assertRuntimePermissionManager(_0x46db70['appCode']);const _0x1b642c=assertGrantOrRevoke(_0x46db70['bool'](_0x556b3c(0xac)),_0x46db70[_0x556b3c(0xab)](_0x556b3c(0xa6))),_0x2b836b=await resolveRuntimeRoleRef(_0x46db70[_0x556b3c(0x86)],_0x46db70[_0x556b3c(0xa8)](_0x556b3c(0xaf)));assertRuntimePermitRoleConfigurable(_0x2b836b);const _0x92c09f=[...new Set(splitRefs(_0x46db70['str'](_0x556b3c(0x92)),_0x556b3c(0x9b))[_0x556b3c(0xa3)](_0x388dcd=>{const _0x36b2d2=_0x556b3c,_0x363815=Number(_0x388dcd);if(!/^\d+$/['test'](_0x388dcd)||!Number[_0x36b2d2(0x9f)](_0x363815)||_0x363815<=0x0)throw CliErrors[_0x36b2d2(0x8e)](_0x36b2d2(0x99)+_0x388dcd+'.');return _0x363815;}))],_0x9f1f52=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x46db70[_0x556b3c(0x86)])),_0x41dd4c=await listRuntimePermitRoles(_0x46db70[_0x556b3c(0x86)]),_0x407d09=[],_0x1840a4=[],_0xbb3e3d=[],_0x33e97e=[];for(const _0x38860d of _0x92c09f){const _0x3ee231=_0x9f1f52[_0x556b3c(0xb3)](_0x589f4c=>_0x589f4c['id']===_0x38860d);if(!_0x3ee231)throw CliErrors[_0x556b3c(0x8e)](_0x556b3c(0xa9)+_0x38860d+'\x20was\x20not\x20found.');const _0x400f11=applyRuntimeRolePermission(_0x3ee231[_0x556b3c(0x91)],_0x2b836b,_0x41dd4c,_0x1b642c);_0x1840a4[_0x556b3c(0xb1)]({'menuId':_0x38860d,'rolePermit':_0x3ee231[_0x556b3c(0x91)]}),_0xbb3e3d[_0x556b3c(0xb1)]({'menuId':_0x38860d,'rolePermit':_0x400f11['roles']});if(_0x400f11[_0x556b3c(0x90)])_0x407d09[_0x556b3c(0xb1)](menuPermitDto(_0x46db70['appCode'],_0x3ee231,_0x400f11[_0x556b3c(0x8c)]));else _0x33e97e[_0x556b3c(0xb1)](_0x556b3c(0xa9)+_0x38860d+_0x556b3c(0x85)+_0x1b642c+_0x556b3c(0x94)+_0x2b836b['id']+'.');}return{'operation':_0x1b642c,'role':_0x2b836b,'menuIds':_0x92c09f,'permitList':_0x407d09,'before':_0x1840a4,'after':_0xbb3e3d,'warnings':_0x33e97e};}export const permitRoleMenusSet={'service':a43_0x2bc6e4(0x88),'command':a43_0x2bc6e4(0xa7),'description':a43_0x2bc6e4(0xa4),'risk':'high-risk-write','confirmationDescription':a43_0x2bc6e4(0x93),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0x403d7e){const _0x2828ae=a43_0x2bc6e4;assertGrantOrRevoke(_0x403d7e['bool'](_0x2828ae(0xac)),_0x403d7e[_0x2828ae(0xab)](_0x2828ae(0xa6)));},async 'dryRun'(_0xd1427e){const _0x1b3d60=a43_0x2bc6e4,_0x42d3db=await prepare(_0xd1427e);return dryRun(_0x1b3d60(0x9c),_0x1b3d60(0x8f))[_0x1b3d60(0xa2)]({'appCode':_0xd1427e[_0x1b3d60(0x86)],'permitList':_0x42d3db[_0x1b3d60(0x96)]})[_0x1b3d60(0x97)](_0x1b3d60(0xb2)+_0x42d3db[_0x1b3d60(0x8d)]+_0x1b3d60(0xb0))[_0x1b3d60(0x87)]();},async 'execute'(_0xc3209b){const _0x34750c=a43_0x2bc6e4,_0x6317ea=await prepare(_0xc3209b);return _0x6317ea[_0x34750c(0x96)][_0x34750c(0x98)]>0x0&&await saveRuntimeMenuRolePermits(_0xc3209b[_0x34750c(0x86)],_0x6317ea['permitList']),{'ok':!![],'data':runtimePermitWriteResult(_0x34750c(0xa0)+_0x6317ea[_0x34750c(0x8d)],{'roleId':_0x6317ea['role']['id'],'menuIds':_0x6317ea[_0x34750c(0xb5)]},_0x6317ea[_0x34750c(0x9e)],_0x6317ea[_0x34750c(0xa5)],{'method':'POST','path':_0x34750c(0x8f)},_0x6317ea[_0x34750c(0xb6)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a44_0xf79b0d=a44_0x3a6d;(function(_0x144818,_0x5743e1){const _0x20036d=a44_0x3a6d,_0x45cc59=_0x144818();while(!![]){try{const _0x1b931c=parseInt(_0x20036d(0x1c7))/0x1*(parseInt(_0x20036d(0x1d5))/0x2)+parseInt(_0x20036d(0x1cc))/0x3*(parseInt(_0x20036d(0x1d4))/0x4)+parseInt(_0x20036d(0x1d7))/0x5*(parseInt(_0x20036d(0x1c6))/0x6)+-parseInt(_0x20036d(0x1c8))/0x7+-parseInt(_0x20036d(0x1d0))/0x8+parseInt(_0x20036d(0x1cb))/0x9*(-parseInt(_0x20036d(0x1c5))/0xa)+parseInt(_0x20036d(0x1d2))/0xb;if(_0x1b931c===_0x5743e1)break;else _0x45cc59['push'](_0x45cc59['shift']());}catch(_0x431dec){_0x45cc59['push'](_0x45cc59['shift']());}}}(a44_0x56e2,0xc8e9e));import{getRuntimeRoleMenuResources}from'../../core/api-client.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';function a44_0x3a6d(_0x36251f,_0xbfa945){_0x36251f=_0x36251f-0x1c5;const _0x56e26a=a44_0x56e2();let _0x3a6d25=_0x56e26a[_0x36251f];return _0x3a6d25;}import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a44_0x56e2(){const _0x56b7e1=['1308069TSUXCf','read','runtime','1164591wWtsEQ','11862SsMgsD','appCode','roleName','permit','9693512whDLSc','role-menus','13024066RRujCE','role','440Tbpngm','4vVyXsm','roleType','55MVVPnS','30HypDFe','238386MPOPEU','276854OICrDr'];a44_0x56e2=function(){return _0x56b7e1;};return a44_0x56e2();}export const permitRoleMenus={'service':a44_0xf79b0d(0x1cf),'command':a44_0xf79b0d(0x1d1),'description':'Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','risk':a44_0xf79b0d(0x1c9),'flags':[ROLE_REF_FLAG],async 'execute'(_0x1b115a){const _0x27cdda=a44_0xf79b0d,_0x247333=await resolveRuntimeRoleRef(_0x1b115a['appCode'],_0x1b115a['str'](_0x27cdda(0x1d3))),_0x2c0441=await getRuntimeRoleMenuResources(_0x1b115a[_0x27cdda(0x1cd)],_0x247333['id']);return{'ok':!![],'data':{'scope':_0x27cdda(0x1ca),'role':{'id':_0x247333['id'],'roleName':_0x247333[_0x27cdda(0x1ce)],'roleType':_0x247333[_0x27cdda(0x1d6)]},'menus':_0x2c0441}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x2b2ab9=a45_0x3c99;(function(_0x3372e8,_0x224720){const _0x4fda76=a45_0x3c99,_0x593de4=_0x3372e8();while(!![]){try{const _0x3b3686=-parseInt(_0x4fda76(0x17f))/0x1*(parseInt(_0x4fda76(0x178))/0x2)+parseInt(_0x4fda76(0x152))/0x3+-parseInt(_0x4fda76(0x15c))/0x4+-parseInt(_0x4fda76(0x16f))/0x5+parseInt(_0x4fda76(0x184))/0x6*(-parseInt(_0x4fda76(0x168))/0x7)+-parseInt(_0x4fda76(0x147))/0x8*(parseInt(_0x4fda76(0x183))/0x9)+-parseInt(_0x4fda76(0x176))/0xa*(-parseInt(_0x4fda76(0x169))/0xb);if(_0x3b3686===_0x224720)break;else _0x593de4['push'](_0x593de4['shift']());}catch(_0x158abd){_0x593de4['push'](_0x593de4['shift']());}}}(a45_0x5e47,0xa1d38));import{getLoginUserInfo,listRuntimePermitRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a45_0x2b2ab9(0x153),'type':'number','required':!![],'description':a45_0x2b2ab9(0x15b)};export const ROLE_REF_FLAG={'name':'role','type':a45_0x2b2ab9(0x16e),'required':!![],'description':'Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name'};function a45_0x5e47(){const _0x4f322c=['length','isSafeInteger','resourceCode','values','roleName','Cannot\x20resolve\x20the\x20current\x20AK\x20userId\x20for\x20permission\x20management.','Cannot\x20change\x20resource\x20permissions\x20for\x20','Revoke\x20the\x20selected\x20resources\x20from\x20the\x20role','8KZfidt','Comma-separated\x20runtime\x20role\x20IDs\x20or\x20names','MENU','label','ADMIN\x20and\x20OWNER\x20have\x20full\x20runtime\x20access;\x20configure\x20USER\x20or\x20CUSTOM\x20instead.','create-roles','OWNER','map','menu-roles','resourceType','test','548661KgYgeC','menu-id','dataUpdate','children','\x20must\x20contain\x20at\x20least\x20one\x20value.','SELF','dataDetail','userId','rolePermit','Runtime\x20menu\x20ID','1887924IymDtZ','row-roles','pageId','some','Ask\x20an\x20application\x20manager\x20to\x20perform\x20this\x20operation.','boolean','push','\x20runtime\x20role\x20','grant','trim','runtime','Use\x20a\x20role\x20ID\x20from\x20`lovrabet\x20role\x20list`.','3776311LCmRuk','12034utrTXc','Grant\x20the\x20selected\x20resources\x20to\x20the\x20role','datasetCode','roleType','menuId','string','3370310zavdxQ','update-roles','appCode','revoke','Configure\x20USER,\x20CUSTOM,\x20or\x20an\x20applicable\x20special\x20role\x20instead.','ALL','Pass\x20exactly\x20one\x20of\x20--grant\x20or\x20--revoke.','41610KklaGq','key','1278swapIj','permitId','dataCreate','validation','Permission\x20role\x20\x22','The\x20current\x20service\x20contract\x20does\x20not\x20persist\x20an\x20empty\x20rolePermit;\x20grant\x20another\x20role\x20first.','filter','1801dZVTyQ','split','find','dataExport','11122434MTDxlb','6JLbjDS','\x22\x20is\x20ambiguous.','SELF\x20is\x20only\x20valid\x20for\x20--row-roles.','Cannot\x20revoke\x20the\x20last\x20role\x20from\x20a\x20runtime\x20resource.','menuPermit','dataPermit','detail-roles','dataDelete'];a45_0x5e47=function(){return _0x4f322c;};return a45_0x5e47();}export const GRANT_FLAG={'name':'grant','type':a45_0x2b2ab9(0x161),'description':a45_0x2b2ab9(0x16a)};export const REVOKE_FLAG={'name':a45_0x2b2ab9(0x172),'type':a45_0x2b2ab9(0x161),'description':a45_0x2b2ab9(0x146)};export const PAGE_SLOT_SPECS=[{'flag':a45_0x2b2ab9(0x14f),'key':a45_0x2b2ab9(0x188),'allowSelf':![]},{'flag':a45_0x2b2ab9(0x14c),'key':a45_0x2b2ab9(0x17a),'allowSelf':![]},{'flag':a45_0x2b2ab9(0x170),'key':a45_0x2b2ab9(0x154),'allowSelf':![]},{'flag':'delete-roles','key':a45_0x2b2ab9(0x18b),'allowSelf':![]},{'flag':a45_0x2b2ab9(0x18a),'key':a45_0x2b2ab9(0x158),'allowSelf':![]},{'flag':'export-roles','key':a45_0x2b2ab9(0x182),'allowSelf':![]},{'flag':a45_0x2b2ab9(0x15d),'key':a45_0x2b2ab9(0x189),'allowSelf':!![]}];export const PAGE_ROLE_FLAGS=PAGE_SLOT_SPECS[a45_0x2b2ab9(0x14e)](_0xd080ee=>({'name':_0xd080ee['flag'],'type':a45_0x2b2ab9(0x16e),'description':a45_0x2b2ab9(0x148)}));export function splitRefs(_0x5c4dd1,_0x338fb1){const _0x30cbfa=a45_0x2b2ab9,_0x191755=[...new Set(_0x5c4dd1[_0x30cbfa(0x180)](',')[_0x30cbfa(0x14e)](_0x28a8af=>_0x28a8af[_0x30cbfa(0x165)]())[_0x30cbfa(0x17e)](Boolean))];if(_0x191755[_0x30cbfa(0x18c)]===0x0)throw CliErrors['validation'](_0x338fb1+_0x30cbfa(0x156));return _0x191755;}export function assertGrantOrRevoke(_0x2d4660,_0x1f62d8){const _0x487965=a45_0x2b2ab9;if(_0x2d4660===_0x1f62d8)throw CliErrors[_0x487965(0x17b)](_0x487965(0x175));return _0x2d4660?_0x487965(0x164):'revoke';}function resolvePermitRole(_0x30d484,_0x26ef32){const _0x53815a=a45_0x2b2ab9,_0xbc37c9=_0x26ef32[_0x53815a(0x165)](),_0x1bfaf0=/^-?\d+$/[_0x53815a(0x151)](_0xbc37c9)?_0x30d484[_0x53815a(0x17e)](_0x2cb37c=>_0x2cb37c['id']===Number(_0xbc37c9)):_0x30d484[_0x53815a(0x17e)](_0x42901e=>_0x42901e['roleName']===_0xbc37c9||_0x42901e['roleType']===_0xbc37c9['toUpperCase']());if(_0x1bfaf0[_0x53815a(0x18c)]!==0x1)throw CliErrors[_0x53815a(0x17b)](_0x1bfaf0['length']===0x0?'Permission\x20role\x20\x22'+_0xbc37c9+'\x22\x20was\x20not\x20found.':_0x53815a(0x17c)+_0xbc37c9+_0x53815a(0x185),_0x53815a(0x167));return _0x1bfaf0[0x0];}export async function resolveRuntimePermitRoles(_0xa5e1e2,_0x33070d,_0x47aa9e){const _0x4fe9a9=a45_0x2b2ab9,_0x87dc5e=await listRuntimePermitRoles(_0xa5e1e2,{'needSelf':!![],'needPublic':!![]}),_0x59403c=[...new Map(_0x33070d['map'](_0x5701f5=>resolvePermitRole(_0x87dc5e,_0x5701f5))['map'](_0x34c3a0=>[_0x34c3a0['id'],_0x34c3a0]))[_0x4fe9a9(0x142)]()],_0x40448a=_0x59403c[_0x4fe9a9(0x181)](_0x35874b=>_0x35874b[_0x4fe9a9(0x16c)]==='ADMIN'||_0x35874b[_0x4fe9a9(0x16c)]===_0x4fe9a9(0x14d));if(_0x40448a)throw CliErrors[_0x4fe9a9(0x17b)](_0x40448a[_0x4fe9a9(0x16c)]+'\x20has\x20full\x20runtime\x20access\x20and\x20cannot\x20be\x20a\x20resource\x20permission\x20target.',_0x4fe9a9(0x173));if(!_0x47aa9e&&_0x59403c['some'](_0x22600d=>_0x22600d[_0x4fe9a9(0x16c)]===_0x4fe9a9(0x157)))throw CliErrors[_0x4fe9a9(0x17b)](_0x4fe9a9(0x186));return _0x59403c;}function a45_0x3c99(_0x56aaed,_0x29300c){_0x56aaed=_0x56aaed-0x141;const _0x5e47d3=a45_0x5e47();let _0x3c9981=_0x5e47d3[_0x56aaed];return _0x3c9981;}export async function assertRuntimePermissionManager(_0x2bb144){const _0x1bd192=a45_0x2b2ab9,_0xee578f=await getLoginUserInfo(),_0x57b2d3=_0xee578f['userId']??_0xee578f['id'],_0x9bcff9=Number(_0x57b2d3);if(!Number[_0x1bd192(0x18d)](_0x9bcff9)||_0x9bcff9<=0x0)throw CliErrors[_0x1bd192(0x17b)](_0x1bd192(0x144));const _0x223374=await listRuntimeRoleUsers(_0x2bb144),_0x58da3b=_0x223374[_0x1bd192(0x15f)](_0x4f98b9=>(_0x4f98b9[_0x1bd192(0x16c)]==='ADMIN'||_0x4f98b9['roleType']==='OWNER')&&_0x4f98b9['userList'][_0x1bd192(0x15f)](_0x460377=>_0x460377[_0x1bd192(0x159)]===_0x9bcff9));if(!_0x58da3b)throw CliErrors[_0x1bd192(0x17b)]('Runtime\x20resource\x20permission\x20changes\x20require\x20an\x20ADMIN\x20or\x20OWNER\x20role.',_0x1bd192(0x160));}export function assertRuntimePermitRoleConfigurable(_0x5a9631){const _0x2e2e3a=a45_0x2b2ab9;if(_0x5a9631['roleType']==='ADMIN'||_0x5a9631[_0x2e2e3a(0x16c)]===_0x2e2e3a(0x14d))throw CliErrors['validation'](_0x2e2e3a(0x145)+_0x5a9631[_0x2e2e3a(0x16c)]+_0x2e2e3a(0x163)+_0x5a9631['roleName']+'.',_0x2e2e3a(0x14b));}function asPermitRole(_0x46f190){const _0x1560b9=a45_0x2b2ab9;return{'id':_0x46f190['id'],'roleName':_0x46f190[_0x1560b9(0x143)],'roleType':_0x46f190[_0x1560b9(0x16c)],'allowed':!![]};}export function applyRuntimeRolePermission(_0x1cdea1,_0xe6ca5a,_0x2fd7ec,_0x1f22ae){const _0x121834=a45_0x2b2ab9,_0x181131=!_0x1cdea1||_0x1cdea1[_0x121834(0x18c)]===0x0,_0x33b6b0=_0x1cdea1?.[_0x121834(0x15f)](_0x586110=>_0x586110[_0x121834(0x16c)]===_0x121834(0x174))??![];if(_0x1f22ae==='grant'&&(_0x181131||_0x33b6b0))return{'roles':_0x1cdea1??null,'changed':![]};let _0x202430=_0x181131||_0x33b6b0?_0x2fd7ec['filter'](_0x2faefa=>_0x2faefa['id']>0x0):[..._0x1cdea1];const _0x5ced4a=_0x202430['some'](_0x452028=>_0x452028['id']===_0xe6ca5a['id']);if(_0x1f22ae===_0x121834(0x164)){if(_0x5ced4a)return{'roles':_0x202430,'changed':![]};return _0x202430[_0x121834(0x162)](asPermitRole(_0xe6ca5a)),{'roles':_0x202430,'changed':!![]};}if(!_0x5ced4a)return{'roles':_0x202430,'changed':_0x181131||_0x33b6b0};_0x202430=_0x202430[_0x121834(0x17e)](_0x5a21e9=>_0x5a21e9['id']!==_0xe6ca5a['id']);if(_0x202430[_0x121834(0x18c)]===0x0)throw CliErrors[_0x121834(0x17b)](_0x121834(0x187),_0x121834(0x17d));return{'roles':_0x202430,'changed':!![]};}export function projectRuntimePagePermit(_0x22f212){const _0x220c60=a45_0x2b2ab9,_0x3cd295={'menuId':_0x22f212[_0x220c60(0x16d)],'pageId':_0x22f212['pageId'],'appCode':_0x22f212[_0x220c60(0x171)],'datasetCode':_0x22f212[_0x220c60(0x16b)]};for(const _0x469dc6 of PAGE_SLOT_SPECS){const _0x130ad1=_0x22f212[_0x469dc6[_0x220c60(0x177)]];_0x130ad1&&(_0x3cd295[_0x469dc6[_0x220c60(0x177)]]={'resourceCode':_0x130ad1[_0x220c60(0x141)],'resourceType':_0x130ad1[_0x220c60(0x150)],'roles':(_0x130ad1[_0x220c60(0x15a)]??[])['map'](_0x2633b5=>({'id':_0x2633b5['id'],'roleName':_0x2633b5['roleName'],'roleType':_0x2633b5[_0x220c60(0x16c)]}))});}return _0x3cd295;}export function flattenRuntimeMenuRolePermits(_0xd75d3a){const _0x4675d6=[],_0x21a195=_0x1ed77f=>{const _0x5c8062=a45_0x3c99;_0x4675d6[_0x5c8062(0x162)](_0x1ed77f);for(const _0x320263 of _0x1ed77f[_0x5c8062(0x155)]??[])_0x21a195(_0x320263);};for(const _0x576340 of _0xd75d3a)_0x21a195(_0x576340);return _0x4675d6;}export function runtimePermitWriteResult(_0xe6b2c1,_0x5b860f,_0x5563d3,_0x16145d,_0xa98ecb,_0x300685=[]){const _0x3f3b2e=a45_0x2b2ab9;return{'operation':_0xe6b2c1,'scope':_0x3f3b2e(0x166),'selector':_0x5b860f,'before':_0x5563d3,'after':_0x16145d,'dryRun':![],'backend':_0xa98ecb,'warnings':_0x300685};}export function menuPermitDto(_0x3cb5ba,_0x5cfd3a,_0x43b100){const _0x544de0=a45_0x2b2ab9;return{..._0x5cfd3a[_0x544de0(0x179)]!=null?{'id':_0x5cfd3a['permitId']}:{},'appCode':_0x3cb5ba,'menuId':_0x5cfd3a['id'],'pageId':_0x5cfd3a[_0x544de0(0x15e)]??null,'resourceCode':String(_0x5cfd3a['id']),'resourceType':_0x544de0(0x149),'resourceName':_0x5cfd3a[_0x544de0(0x14a)],'rolePermit':_0x43b100};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x448f28=a46_0x40f8;(function(_0x3737ba,_0x569349){const _0x5bc5de=a46_0x40f8,_0x24e6f5=_0x3737ba();while(!![]){try{const _0x391b94=parseInt(_0x5bc5de(0x18c))/0x1+parseInt(_0x5bc5de(0x170))/0x2+parseInt(_0x5bc5de(0x19e))/0x3*(parseInt(_0x5bc5de(0x175))/0x4)+parseInt(_0x5bc5de(0x155))/0x5+parseInt(_0x5bc5de(0x157))/0x6*(-parseInt(_0x5bc5de(0x185))/0x7)+-parseInt(_0x5bc5de(0x164))/0x8*(parseInt(_0x5bc5de(0x198))/0x9)+parseInt(_0x5bc5de(0x187))/0xa;if(_0x391b94===_0x569349)break;else _0x24e6f5['push'](_0x24e6f5['shift']());}catch(_0x5f1301){_0x24e6f5['push'](_0x24e6f5['shift']());}}}(a46_0x1dcb,0xcf4ef));function a46_0x40f8(_0x434da7,_0x9a4045){_0x434da7=_0x434da7-0x155;const _0x1dcb66=a46_0x1dcb();let _0x40f8a7=_0x1dcb66[_0x434da7];return _0x40f8a7;}import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a46_0x448f28(0x197),'type':a46_0x448f28(0x17d),'description':a46_0x448f28(0x19a)},FUNCTION_NAME_FLAG={'name':a46_0x448f28(0x167),'type':a46_0x448f28(0x17d),'required':!![],'description':a46_0x448f28(0x178)},DESCRIPTION_FLAG={'name':'description','type':a46_0x448f28(0x17d),'description':a46_0x448f28(0x184)},SOURCE_SESSION_FLAG={'name':a46_0x448f28(0x195),'type':a46_0x448f28(0x17d),'description':a46_0x448f28(0x15e)};function normalizeFunctionName(_0x3aef89){const _0x330a76=a46_0x448f28,_0x34acd9=String(_0x3aef89||'')[_0x330a76(0x174)]();if(!_0x34acd9||!FUNCTION_NAME_PATTERN[_0x330a76(0x199)](_0x34acd9))throw CliErrors[_0x330a76(0x19f)](_0x330a76(0x192));return _0x34acd9;}function readScriptFile(_0x41fcb8){const _0x940301=a46_0x448f28;if(!_0x41fcb8)throw CliErrors[_0x940301(0x19f)](_0x940301(0x16c));if(!existsSync(_0x41fcb8))throw CliErrors[_0x940301(0x19f)](_0x940301(0x16e)+_0x41fcb8);if(!statSync(_0x41fcb8)[_0x940301(0x162)]())throw CliErrors[_0x940301(0x19f)](_0x940301(0x191)+_0x41fcb8);const _0x54c790=readFileSync(_0x41fcb8,_0x940301(0x165));if(!_0x54c790['trim']())throw CliErrors[_0x940301(0x19f)](_0x940301(0x186));return _0x54c790;}function optionalTrimmed(_0x4b7f8c){const _0x528d59=a46_0x448f28,_0x4ea299=String(_0x4b7f8c||'')[_0x528d59(0x174)]();return _0x4ea299||undefined;}function summarizeBff(_0x213ed2){const _0x52378a=a46_0x448f28;return{'id':_0x213ed2['id'],'appCode':_0x213ed2[_0x52378a(0x18e)],'functionName':_0x213ed2[_0x52378a(0x18a)],'description':_0x213ed2[_0x52378a(0x172)],'scriptType':_0x213ed2['scriptType'],'version':_0x213ed2[_0x52378a(0x163)],'gmtModified':_0x213ed2[_0x52378a(0x161)],'updateTime':_0x213ed2[_0x52378a(0x180)]};}function detailBff(_0x5672ab){const _0x3e06a8=a46_0x448f28;return{'id':_0x5672ab['id'],'appCode':_0x5672ab[_0x3e06a8(0x18e)],'functionName':_0x5672ab[_0x3e06a8(0x18a)],'description':_0x5672ab[_0x3e06a8(0x172)],'scriptType':_0x5672ab[_0x3e06a8(0x16a)],'scriptContent':_0x5672ab[_0x3e06a8(0x16b)]??'','config':_0x5672ab[_0x3e06a8(0x173)],'version':_0x5672ab[_0x3e06a8(0x163)],'createUserId':_0x5672ab[_0x3e06a8(0x196)],'gmtCreate':_0x5672ab[_0x3e06a8(0x17c)],'gmtModified':_0x5672ab[_0x3e06a8(0x161)],'createTime':_0x5672ab[_0x3e06a8(0x159)],'updateTime':_0x5672ab['updateTime']};}function buildCreateInput(_0x3bb932){const _0x3ac512=a46_0x448f28;return{'functionName':normalizeFunctionName(_0x3bb932[_0x3ac512(0x15f)]('name')),...optionalTrimmed(_0x3bb932['str']('description'))?{'description':optionalTrimmed(_0x3bb932[_0x3ac512(0x15f)](_0x3ac512(0x172)))}:{},'scriptContent':readScriptFile(_0x3bb932[_0x3ac512(0x15f)](_0x3ac512(0x197))),...optionalTrimmed(_0x3bb932['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x3bb932['str'](_0x3ac512(0x195)))}:{}};}function buildUpdateInput(_0x478180){const _0x475b38=a46_0x448f28,_0x7b0ca0={};optionalTrimmed(_0x478180[_0x475b38(0x15f)](_0x475b38(0x167)))&&(_0x7b0ca0[_0x475b38(0x18a)]=normalizeFunctionName(_0x478180['str'](_0x475b38(0x167))));_0x478180[_0x475b38(0x15c)](_0x475b38(0x172))!==undefined&&(_0x7b0ca0[_0x475b38(0x172)]=_0x478180[_0x475b38(0x15f)](_0x475b38(0x172)));optionalTrimmed(_0x478180['str'](_0x475b38(0x197)))&&(_0x7b0ca0['scriptContent']=readScriptFile(_0x478180[_0x475b38(0x15f)](_0x475b38(0x197))));_0x478180[_0x475b38(0x15c)](_0x475b38(0x195))!==undefined&&(_0x7b0ca0[_0x475b38(0x190)]=_0x478180[_0x475b38(0x15f)](_0x475b38(0x195)));if(Object[_0x475b38(0x168)](_0x7b0ca0)[_0x475b38(0x16d)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x7b0ca0;}function parseExecParams(_0x532064){const _0x1b0c8e=a46_0x448f28,_0x58ed7f=parseJsonParams(_0x532064)??{};if(Array['isArray'](_0x58ed7f))throw CliErrors[_0x1b0c8e(0x19f)](_0x1b0c8e(0x19b));return _0x58ed7f;}const personalBffList={'service':'personal-bff','command':a46_0x448f28(0x15b),'description':a46_0x448f28(0x15d),'risk':a46_0x448f28(0x18b),'flags':[VERBOSE_FLAG],async 'execute'(_0x5d6eb0){const _0x1b844b=a46_0x448f28,_0x3f3735=await listPersonalBffs(_0x5d6eb0[_0x1b844b(0x18e)]);return{'ok':!![],'data':{'total':_0x3f3735[_0x1b844b(0x16d)],'items':_0x5d6eb0[_0x1b844b(0x183)](_0x1b844b(0x177))?_0x3f3735:_0x3f3735['map'](summarizeBff)}};}},personalBffDetail={'service':a46_0x448f28(0x166),'command':a46_0x448f28(0x188),'description':a46_0x448f28(0x19d),'risk':a46_0x448f28(0x18b),'flags':[{...ID_FLAG,'description':'Personal\x20Backend\x20Function\x20script\x20ID'}],async 'execute'(_0x4861e1){const _0x2514b1=a46_0x448f28,_0x427f6=await getPersonalBff(_0x4861e1[_0x2514b1(0x181)]('id'),_0x4861e1['appCode']);return{'ok':!![],'data':detailBff(_0x427f6)};}},personalBffCreate={'service':a46_0x448f28(0x166),'command':a46_0x448f28(0x160),'description':a46_0x448f28(0x179),'risk':'write','confirmationDescription':a46_0x448f28(0x194),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xa4613){const _0x28df5e=a46_0x448f28,_0x4d1595=buildCreateInput(_0xa4613),_0x1af41c=await createPersonalBff(_0xa4613[_0x28df5e(0x18e)],_0x4d1595);return{'ok':!![],'data':detailBff(_0x1af41c),'message':_0x28df5e(0x17b)+_0x1af41c['id']+(_0x1af41c[_0x28df5e(0x18a)]?'\x20('+_0x1af41c[_0x28df5e(0x18a)]+')':'')};},async 'dryRun'(_0x5f29f3){const _0x377209=a46_0x448f28,_0x396793=buildCreateInput(_0x5f29f3);return dryRun(_0x377209(0x171),_0x377209(0x18f))['body']({'appCode':_0x5f29f3['appCode'],..._0x396793})[_0x377209(0x172)](_0x377209(0x158)+_0x396793[_0x377209(0x18a)])[_0x377209(0x189)]();}},personalBffUpdate={'service':a46_0x448f28(0x166),'command':a46_0x448f28(0x156),'description':a46_0x448f28(0x17e),'risk':a46_0x448f28(0x15a),'confirmationDescription':a46_0x448f28(0x16f),'flags':[{...ID_FLAG,'description':a46_0x448f28(0x169)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x15d547){const _0x4dde3a=a46_0x448f28,_0x4cc66d=_0x15d547[_0x4dde3a(0x181)]('id'),_0xe6537f=buildUpdateInput(_0x15d547),_0x226012=await updatePersonalBff(_0x4cc66d,_0x15d547[_0x4dde3a(0x18e)],_0xe6537f);return{'ok':!![],'data':detailBff(_0x226012),'message':_0x4dde3a(0x19c)+_0x226012['id']+(_0x226012['functionName']?'\x20('+_0x226012[_0x4dde3a(0x18a)]+')':'')};},async 'dryRun'(_0x58ba66){const _0x34b2d7=a46_0x448f28,_0x15d971=_0x58ba66[_0x34b2d7(0x181)]('id'),_0x3ceef2=buildUpdateInput(_0x58ba66);return dryRun(_0x34b2d7(0x171),_0x34b2d7(0x18d)+_0x15d971+'/update')['body']({'appCode':_0x58ba66[_0x34b2d7(0x18e)],..._0x3ceef2})[_0x34b2d7(0x172)]('Preview:\x20update\x20Personal\x20Backend\x20Function\x20'+_0x15d971)[_0x34b2d7(0x189)]();}},personalBffExec={'service':'personal-bff','command':a46_0x448f28(0x17a),'description':'根据\x20ID\x20执行Personal\x20Backend\x20Function,并可传入\x20JSON\x20参数','risk':a46_0x448f28(0x15a),'confirmationDescription':a46_0x448f28(0x193),'flags':[{...ID_FLAG,'description':a46_0x448f28(0x169)},{...PARAMS_FLAG,'description':a46_0x448f28(0x182)}],async 'validate'(_0x120529){const _0x51d1d4=a46_0x448f28;parseExecParams(_0x120529[_0x51d1d4(0x15f)]('params'));},async 'execute'(_0x41e6cc){const _0x12ef76=a46_0x448f28,_0x53d2eb=_0x41e6cc[_0x12ef76(0x181)]('id'),_0x2033c2=parseExecParams(_0x41e6cc[_0x12ef76(0x15f)](_0x12ef76(0x176))),_0x18f5d9=await executePersonalBff(_0x53d2eb,_0x41e6cc['appCode'],_0x2033c2);return{'ok':!![],'data':{'result':_0x18f5d9},'message':_0x12ef76(0x17f)+_0x53d2eb};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];function a46_0x1dcb(){const _0x51b0a1=['keys','Personal\x20Backend\x20Function\x20script\x20ID','scriptType','scriptContent','File\x20path\x20is\x20required.','length','File\x20not\x20found:\x20','更新Personal\x20Backend\x20Function\x20的脚本或元信息;之后的调用将使用新版本。','1334194fasWus','POST','description','config','trim','144DOgSgx','params','verbose','Personal\x20Backend\x20Function\x20name,\x20for\x20example\x20loadOrders','根据本地脚本文件创建Personal\x20Backend\x20Function','exec','Created\x20Personal\x20Backend\x20Function\x20','gmtCreate','string','根据\x20ID\x20更新Personal\x20Backend\x20Function','Executed\x20Personal\x20Backend\x20Function\x20','updateTime','num','JSON\x20object\x20passed\x20to\x20the\x20Personal\x20Backend\x20Function\x20execution','bool','Personal\x20Backend\x20Function\x20description','4249UXkgPw','Personal\x20Backend\x20Function\x20script\x20file\x20is\x20blank.','2093810RHRVPi','detail','build','functionName','read','1389489QJJgIe','/client/runtime-bff/personal/','appCode','/client/runtime-bff/personal/create','sourceSessionId','File\x20is\x20not\x20a\x20regular\x20file:\x20','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','执行Personal\x20Backend\x20Function\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','把本地脚本保存为Personal\x20Backend\x20Function;之后可在当前应用中调用该脚本。','source-session-id','createUserId','file','9PzttMI','test','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','--params\x20must\x20be\x20a\x20JSON\x20object.','Updated\x20Personal\x20Backend\x20Function\x20','Show\x20one\x20Personal\x20Backend\x20Function\x20by\x20id','14793cKzZYJ','validation','4473615jggFqj','update','11280VgehQF','Preview:\x20create\x20Personal\x20Backend\x20Function\x20','createTime','write','list','flag','List\x20current\x20user\x27s\x20Personal\x20Backend\x20Function\x20scripts\x20for\x20the\x20current\x20app','Optional\x20source\x20RuntimeAgent\x20session\x20id','str','create','gmtModified','isFile','version','10783288wCHbHf','utf8','personal-bff','name'];a46_0x1dcb=function(){return _0x51b0a1;};return a46_0x1dcb();}
|
|
1
|
+
const a46_0x9d3956=a46_0x2bd1;function a46_0x2bd1(_0x3e26ff,_0x4d7d05){_0x3e26ff=_0x3e26ff-0x9e;const _0x249073=a46_0x2490();let _0x2bd1e8=_0x249073[_0x3e26ff];return _0x2bd1e8;}(function(_0x4f90eb,_0xceefb2){const _0x590ed2=a46_0x2bd1,_0x496e95=_0x4f90eb();while(!![]){try{const _0x34c247=-parseInt(_0x590ed2(0xd9))/0x1*(-parseInt(_0x590ed2(0xb6))/0x2)+-parseInt(_0x590ed2(0xa2))/0x3+-parseInt(_0x590ed2(0xcf))/0x4*(-parseInt(_0x590ed2(0xa7))/0x5)+parseInt(_0x590ed2(0xdd))/0x6*(parseInt(_0x590ed2(0xa1))/0x7)+-parseInt(_0x590ed2(0xd2))/0x8*(parseInt(_0x590ed2(0xbe))/0x9)+-parseInt(_0x590ed2(0xb8))/0xa+parseInt(_0x590ed2(0xcb))/0xb;if(_0x34c247===_0xceefb2)break;else _0x496e95['push'](_0x496e95['shift']());}catch(_0x5a8a33){_0x496e95['push'](_0x496e95['shift']());}}}(a46_0x2490,0x727ef));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a46_0x9d3956(0xd7),'type':'string','description':a46_0x9d3956(0xc7)},FUNCTION_NAME_FLAG={'name':a46_0x9d3956(0xab),'type':a46_0x9d3956(0xdf),'required':!![],'description':a46_0x9d3956(0xa8)},DESCRIPTION_FLAG={'name':a46_0x9d3956(0xc2),'type':a46_0x9d3956(0xdf),'description':'Personal\x20Backend\x20Function\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a46_0x9d3956(0xdf),'description':a46_0x9d3956(0xa5)};function normalizeFunctionName(_0x595597){const _0x354e02=a46_0x9d3956,_0x550408=String(_0x595597||'')[_0x354e02(0xc5)]();if(!_0x550408||!FUNCTION_NAME_PATTERN[_0x354e02(0xdc)](_0x550408))throw CliErrors[_0x354e02(0xc3)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x550408;}function readScriptFile(_0x280fa0){const _0x4391f7=a46_0x9d3956;if(!_0x280fa0)throw CliErrors[_0x4391f7(0xc3)](_0x4391f7(0xaa));if(!existsSync(_0x280fa0))throw CliErrors['validation'](_0x4391f7(0x9e)+_0x280fa0);if(!statSync(_0x280fa0)[_0x4391f7(0xa9)]())throw CliErrors[_0x4391f7(0xc3)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x280fa0);const _0x3bf47a=readFileSync(_0x280fa0,_0x4391f7(0xad));if(!_0x3bf47a[_0x4391f7(0xc5)]())throw CliErrors[_0x4391f7(0xc3)]('Personal\x20Backend\x20Function\x20script\x20file\x20is\x20blank.');return _0x3bf47a;}function optionalTrimmed(_0x5e0fce){const _0x432471=a46_0x9d3956,_0x491198=String(_0x5e0fce||'')[_0x432471(0xc5)]();return _0x491198||undefined;}function summarizeBff(_0x576cfc){const _0x51b5ef=a46_0x9d3956;return{'id':_0x576cfc['id'],'appCode':_0x576cfc[_0x51b5ef(0xa6)],'functionName':_0x576cfc['functionName'],'description':_0x576cfc[_0x51b5ef(0xc2)],'scriptType':_0x576cfc[_0x51b5ef(0xd1)],'version':_0x576cfc[_0x51b5ef(0xb5)],'gmtModified':_0x576cfc[_0x51b5ef(0xb2)],'updateTime':_0x576cfc[_0x51b5ef(0xc0)]};}function detailBff(_0x4c3671){const _0x1951e0=a46_0x9d3956;return{'id':_0x4c3671['id'],'appCode':_0x4c3671[_0x1951e0(0xa6)],'functionName':_0x4c3671[_0x1951e0(0xd8)],'description':_0x4c3671[_0x1951e0(0xc2)],'scriptType':_0x4c3671[_0x1951e0(0xd1)],'scriptContent':_0x4c3671[_0x1951e0(0xa0)]??'','config':_0x4c3671[_0x1951e0(0xd6)],'version':_0x4c3671['version'],'createUserId':_0x4c3671[_0x1951e0(0xba)],'gmtCreate':_0x4c3671['gmtCreate'],'gmtModified':_0x4c3671['gmtModified'],'createTime':_0x4c3671[_0x1951e0(0xce)],'updateTime':_0x4c3671['updateTime']};}function buildCreateInput(_0x3c198f){const _0x2e7087=a46_0x9d3956;return{'functionName':normalizeFunctionName(_0x3c198f[_0x2e7087(0xae)](_0x2e7087(0xab))),...optionalTrimmed(_0x3c198f[_0x2e7087(0xae)]('description'))?{'description':optionalTrimmed(_0x3c198f[_0x2e7087(0xae)](_0x2e7087(0xc2)))}:{},'scriptContent':readScriptFile(_0x3c198f[_0x2e7087(0xae)](_0x2e7087(0xd7))),...optionalTrimmed(_0x3c198f[_0x2e7087(0xae)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x3c198f[_0x2e7087(0xae)](_0x2e7087(0xb7)))}:{}};}function buildUpdateInput(_0x5ac12a){const _0x2d852d=a46_0x9d3956,_0x38f58e={};optionalTrimmed(_0x5ac12a[_0x2d852d(0xae)](_0x2d852d(0xab)))&&(_0x38f58e[_0x2d852d(0xd8)]=normalizeFunctionName(_0x5ac12a[_0x2d852d(0xae)]('name')));_0x5ac12a[_0x2d852d(0xe2)](_0x2d852d(0xc2))!==undefined&&(_0x38f58e[_0x2d852d(0xc2)]=_0x5ac12a[_0x2d852d(0xae)](_0x2d852d(0xc2)));optionalTrimmed(_0x5ac12a[_0x2d852d(0xae)](_0x2d852d(0xd7)))&&(_0x38f58e[_0x2d852d(0xa0)]=readScriptFile(_0x5ac12a[_0x2d852d(0xae)](_0x2d852d(0xd7))));_0x5ac12a['flag'](_0x2d852d(0xb7))!==undefined&&(_0x38f58e['sourceSessionId']=_0x5ac12a['str']('source-session-id'));if(Object[_0x2d852d(0xbd)](_0x38f58e)[_0x2d852d(0xe4)]===0x0)throw CliErrors[_0x2d852d(0xc3)](_0x2d852d(0xbc));return _0x38f58e;}function parseExecParams(_0x36b626){const _0x164e8d=a46_0x9d3956,_0x219920=parseJsonParams(_0x36b626)??{};if(Array[_0x164e8d(0xc1)](_0x219920))throw CliErrors[_0x164e8d(0xc3)](_0x164e8d(0xa3));return _0x219920;}const personalBffList={'service':'personal-bff','command':a46_0x9d3956(0xd4),'description':a46_0x9d3956(0xd3),'risk':a46_0x9d3956(0xcc),'flags':[VERBOSE_FLAG],async 'execute'(_0xcf009d){const _0x494d36=a46_0x9d3956,_0x3a5b14=await listPersonalBffs(_0xcf009d[_0x494d36(0xa6)]);return{'ok':!![],'data':{'total':_0x3a5b14[_0x494d36(0xe4)],'items':_0xcf009d['bool'](_0x494d36(0xc8))?_0x3a5b14:_0x3a5b14[_0x494d36(0xb0)](summarizeBff)}};}},personalBffDetail={'service':a46_0x9d3956(0xb3),'command':'detail','description':a46_0x9d3956(0xcd),'risk':'read','flags':[{...ID_FLAG,'description':a46_0x9d3956(0xe3)}],async 'execute'(_0x32dfaa){const _0x5f583b=a46_0x9d3956,_0x17a66e=await getPersonalBff(_0x32dfaa[_0x5f583b(0xe1)]('id'),_0x32dfaa[_0x5f583b(0xa6)]);return{'ok':!![],'data':detailBff(_0x17a66e)};}},personalBffCreate={'service':a46_0x9d3956(0xb3),'command':'create','description':a46_0x9d3956(0xda),'risk':a46_0x9d3956(0xd5),'confirmationDescription':'把本地脚本保存为Personal\x20Backend\x20Function;之后可在当前应用中调用该脚本。','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x19cac4){const _0x7c4521=a46_0x9d3956,_0x135ab9=buildCreateInput(_0x19cac4),_0x166521=await createPersonalBff(_0x19cac4['appCode'],_0x135ab9);return{'ok':!![],'data':detailBff(_0x166521),'message':_0x7c4521(0xa4)+_0x166521['id']+(_0x166521['functionName']?'\x20('+_0x166521[_0x7c4521(0xd8)]+')':'')};},async 'dryRun'(_0xbed3b5){const _0x593cbe=a46_0x9d3956,_0x569373=buildCreateInput(_0xbed3b5);return dryRun(_0x593cbe(0xdb),_0x593cbe(0xbb))[_0x593cbe(0xb1)]({'appCode':_0xbed3b5[_0x593cbe(0xa6)],..._0x569373})['description'](_0x593cbe(0xde)+_0x569373['functionName'])['build']();}},personalBffUpdate={'service':'personal-bff','command':a46_0x9d3956(0xb9),'description':a46_0x9d3956(0xca),'risk':'write','confirmationDescription':a46_0x9d3956(0xac),'flags':[{...ID_FLAG,'description':a46_0x9d3956(0xe3)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x461b88){const _0x1e6a35=a46_0x9d3956,_0x58f85e=_0x461b88[_0x1e6a35(0xe1)]('id'),_0x14c759=buildUpdateInput(_0x461b88),_0x517683=await updatePersonalBff(_0x58f85e,_0x461b88['appCode'],_0x14c759);return{'ok':!![],'data':detailBff(_0x517683),'message':_0x1e6a35(0xe0)+_0x517683['id']+(_0x517683[_0x1e6a35(0xd8)]?'\x20('+_0x517683[_0x1e6a35(0xd8)]+')':'')};},async 'dryRun'(_0x5d9bf5){const _0x3371ee=a46_0x9d3956,_0x3ce294=_0x5d9bf5[_0x3371ee(0xe1)]('id'),_0xf144b5=buildUpdateInput(_0x5d9bf5);return dryRun('POST',_0x3371ee(0x9f)+_0x3ce294+_0x3371ee(0xaf))['body']({'appCode':_0x5d9bf5['appCode'],..._0xf144b5})[_0x3371ee(0xc2)]('Preview:\x20update\x20Personal\x20Backend\x20Function\x20'+_0x3ce294)['build']();}},personalBffExec={'service':a46_0x9d3956(0xb3),'command':a46_0x9d3956(0xc9),'description':a46_0x9d3956(0xc6),'risk':'write','confirmationDescription':a46_0x9d3956(0xc4),'flags':[{...ID_FLAG,'description':'Personal\x20Backend\x20Function\x20script\x20ID'},{...PARAMS_FLAG,'description':a46_0x9d3956(0xbf)}],async 'validate'(_0x26c639){const _0x55f9d1=a46_0x9d3956;parseExecParams(_0x26c639[_0x55f9d1(0xae)]('params'));},async 'execute'(_0x1a9c31){const _0x27b413=a46_0x9d3956,_0x574e1e=_0x1a9c31[_0x27b413(0xe1)]('id'),_0x5c94bb=parseExecParams(_0x1a9c31[_0x27b413(0xae)](_0x27b413(0xd0))),_0x19ed5e=await executePersonalBff(_0x574e1e,_0x1a9c31[_0x27b413(0xa6)],_0x5c94bb);return{'ok':!![],'data':{'result':_0x19ed5e},'message':_0x27b413(0xb4)+_0x574e1e};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];function a46_0x2490(){const _0x43c4fe=['File\x20not\x20found:\x20','/client/runtime-bff/personal/','scriptContent','1498742dKYJax','2462871hqXjzG','--params\x20must\x20be\x20a\x20JSON\x20object.','Created\x20Personal\x20Backend\x20Function\x20','Optional\x20source\x20RuntimeAgent\x20session\x20id','appCode','5XNwkol','Personal\x20Backend\x20Function\x20name,\x20for\x20example\x20loadOrders','isFile','File\x20path\x20is\x20required.','name','更新Personal\x20Backend\x20Function\x20的脚本或元信息;之后的调用将使用新版本。','utf8','str','/update','map','body','gmtModified','personal-bff','Executed\x20Personal\x20Backend\x20Function\x20','version','1094IesUUN','source-session-id','3982360OPJSCh','update','createUserId','/client/runtime-bff/personal/create','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','keys','6759288ZpMZjI','JSON\x20object\x20passed\x20to\x20the\x20Personal\x20Backend\x20Function\x20execution','updateTime','isArray','description','validation','执行Personal\x20Backend\x20Function\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','trim','根据\x20ID\x20执行Personal\x20Backend\x20Function,并可传入\x20JSON\x20参数','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','verbose','exec','根据\x20ID\x20更新Personal\x20Backend\x20Function','14894704HlDjTL','read','Show\x20one\x20Personal\x20Backend\x20Function\x20by\x20id','createTime','2724884yyDTfH','params','scriptType','8VGNUsM','List\x20current\x20user\x27s\x20Personal\x20Backend\x20Function\x20scripts\x20for\x20the\x20current\x20app','list','write','config','file','functionName','347TmMYkR','根据本地脚本文件创建Personal\x20Backend\x20Function','POST','test','6GzuNED','Preview:\x20create\x20Personal\x20Backend\x20Function\x20','string','Updated\x20Personal\x20Backend\x20Function\x20','num','flag','Personal\x20Backend\x20Function\x20script\x20ID','length'];a46_0x2490=function(){return _0x43c4fe;};return a46_0x2490();}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x42fdb7=a47_0x3e5d;function a47_0x3b67(){const _0x18c32d=['Agent\x20Schedules','set','Personal\x20Backend\x20Function','Schema','app\x20use','Skills','defaultCommand','map','4735566VwhSTS','run','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','init','874539APFLaN','Knowledge\x20Base','Self\x20Update','`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','app','33813307GFMflo','File','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','5754784fqhdgT','values','push','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','15055QLWEpH','has','10OYtQZH','2730MhNkaH','service','User\x20Accounts','Notification\x20Configs','logs\x20clear','isSingleCommand','write','get','12FdNYhL','app\x20init','command','logs','Artifacts','Configuration','Runtime\x20Roles','show','6503744tiSsrR','list','use','API\x20Documentation','config-list','install','Datasets','description','Workspace','Instant\x20API','Diagnostics','from','2gAyFmS','login','Runtime\x20Permissions','711249VjbslS','clear'];a47_0x3b67=function(){return _0x18c32d;};return a47_0x3b67();}(function(_0x577b8c,_0x12161c){const _0x2ee3a7=a47_0x3e5d,_0x2789d6=_0x577b8c();while(!![]){try{const _0x16714f=parseInt(_0x2ee3a7(0x158))/0x1*(-parseInt(_0x2ee3a7(0x147))/0x2)+-parseInt(_0x2ee3a7(0x14a))/0x3*(parseInt(_0x2ee3a7(0x16f))/0x4)+-parseInt(_0x2ee3a7(0x164))/0x5*(-parseInt(_0x2ee3a7(0x167))/0x6)+-parseInt(_0x2ee3a7(0x160))/0x7+-parseInt(_0x2ee3a7(0x177))/0x8+-parseInt(_0x2ee3a7(0x154))/0x9+-parseInt(_0x2ee3a7(0x166))/0xa*(-parseInt(_0x2ee3a7(0x15d))/0xb);if(_0x16714f===_0x12161c)break;else _0x2789d6['push'](_0x2789d6['shift']());}catch(_0x4f7be0){_0x2789d6['push'](_0x2789d6['shift']());}}}(a47_0x3b67,0xaa244));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';import{userAccountDefinitions}from'../commands/user-account/index.js';import{notificationDefinitions}from'../commands/notification/index.js';import{roleDefinitions}from'../commands/role/index.js';import{permitDefinitions}from'../commands/permit/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0xa94f68){const _0x169ff8=a47_0x3e5d;for(const _0x1a55cd of _0xa94f68){definitions[_0x169ff8(0x14d)](_0x1a55cd[_0x169ff8(0x168)]+':'+_0x1a55cd[_0x169ff8(0x171)],_0x1a55cd);let _0x2492e6=serviceGroups[_0x169ff8(0x16e)](_0x1a55cd[_0x169ff8(0x168)]);!_0x2492e6&&(_0x2492e6=[],serviceGroups['set'](_0x1a55cd[_0x169ff8(0x168)],_0x2492e6)),_0x2492e6[_0x169ff8(0x162)](_0x1a55cd);}}function registerService(_0x13264f,_0x18accd,_0xb12e2b){const _0x25610f=a47_0x3e5d;registerDefinitions(_0x18accd);const _0x42a968=_0x15ee1e=>_0x15ee1e==='read'?'':_0x15ee1e===_0x25610f(0x16d)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x11850b={'service':_0x18accd[0x0][_0x25610f(0x168)],'label':_0x13264f,'commands':_0x18accd[_0x25610f(0x153)](_0x326e87=>({'command':_0x326e87['command'],'description':_0x326e87[_0x25610f(0x17e)],'tag':_0x42a968(_0x326e87['risk'])})),'defaultCommand':_0xb12e2b?.[_0x25610f(0x152)]??(_0xb12e2b?.[_0x25610f(0x16c)]?_0x18accd[0x0]['command']:undefined),'isSingleCommand':_0xb12e2b?.[_0x25610f(0x16c)]};serviceRegistry[_0x25610f(0x162)](_0x11850b),serviceByName[_0x25610f(0x14d)](_0x11850b[_0x25610f(0x168)],_0x11850b);}registerService('Authentication',authDefinitions,{'defaultCommand':a47_0x42fdb7(0x148)}),registerService(a47_0x42fdb7(0x169),userAccountDefinitions),registerService('App\x20Management',appDefinitions,{'defaultCommand':a47_0x42fdb7(0x178)}),registerService(a47_0x42fdb7(0x17f),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a47_0x42fdb7(0x174),configDefinitions,{'defaultCommand':'list'}),registerService(a47_0x42fdb7(0x175),roleDefinitions,{'defaultCommand':a47_0x42fdb7(0x178)}),registerService(a47_0x42fdb7(0x149),permitDefinitions),registerService(a47_0x42fdb7(0x17a),apiDocDefinitions),registerService(a47_0x42fdb7(0x17d),datasetDefinitions),registerService(a47_0x42fdb7(0x144),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService('Backend\x20Function\x20Scripts',bffDefinitions),registerService(a47_0x42fdb7(0x14e),personalBffDefinitions),registerService(a47_0x42fdb7(0x173),artifactDefinitions),registerService(a47_0x42fdb7(0x15e),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a47_0x42fdb7(0x159),kbDefinitions),registerService(a47_0x42fdb7(0x16a),notificationDefinitions,{'defaultCommand':a47_0x42fdb7(0x17b)}),registerService(a47_0x42fdb7(0x14c),scheduleDefinitions,{'defaultCommand':'list'}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a47_0x42fdb7(0x178)}),registerService(a47_0x42fdb7(0x151),skillDefinitions,{'defaultCommand':a47_0x42fdb7(0x17c)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a47_0x42fdb7(0x17c)}),registerService(a47_0x42fdb7(0x15a),[updateDefinition],{'defaultCommand':a47_0x42fdb7(0x155),'isSingleCommand':!![]}),registerService(a47_0x42fdb7(0x145),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a47_0x42fdb7(0x14f),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a47_0x42fdb7(0x176)});export function findDefinition(_0x589ab7,_0x17da34){const _0x11d853=a47_0x42fdb7;return definitions[_0x11d853(0x16e)](_0x589ab7+':'+_0x17da34);}export function resolveRemovedCommand(_0x1e6002,_0x35d31a){const _0xf85d74=a47_0x42fdb7;if(_0x1e6002===_0xf85d74(0x15c)&&_0x35d31a===_0xf85d74(0x157))return{'command':_0xf85d74(0x170),'message':_0xf85d74(0x15b),'hint':_0xf85d74(0x15f)};if(_0x1e6002===_0xf85d74(0x15c)&&_0x35d31a===_0xf85d74(0x179))return{'command':_0xf85d74(0x150),'message':_0xf85d74(0x163),'hint':'Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.'};if(_0x1e6002===_0xf85d74(0x172)&&_0x35d31a===_0xf85d74(0x14b))return{'command':_0xf85d74(0x16b),'message':'`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','hint':_0xf85d74(0x156)};return undefined;}export function isKnownService(_0x2da882){const _0x18c9db=a47_0x42fdb7;return serviceByName[_0x18c9db(0x165)](_0x2da882);}export function getServiceEntry(_0x41be68){const _0x58cb8e=a47_0x42fdb7;return serviceByName[_0x58cb8e(0x16e)](_0x41be68);}function a47_0x3e5d(_0x220bf2,_0x143e3f){_0x220bf2=_0x220bf2-0x144;const _0x3b6710=a47_0x3b67();let _0x3e5d23=_0x3b6710[_0x220bf2];return _0x3e5d23;}export function getAllDefinitions(){const _0x4b0dc3=a47_0x42fdb7;return Array[_0x4b0dc3(0x146)](definitions[_0x4b0dc3(0x161)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x146977=a48_0x50b6;(function(_0x1ae014,_0x440a7e){const _0x3b839d=a48_0x50b6,_0x5cc0f7=_0x1ae014();while(!![]){try{const _0x10ae3e=parseInt(_0x3b839d(0x100))/0x1+-parseInt(_0x3b839d(0xf5))/0x2*(parseInt(_0x3b839d(0x109))/0x3)+-parseInt(_0x3b839d(0x10d))/0x4*(-parseInt(_0x3b839d(0xf8))/0x5)+-parseInt(_0x3b839d(0xfe))/0x6+-parseInt(_0x3b839d(0xf2))/0x7+-parseInt(_0x3b839d(0x107))/0x8+parseInt(_0x3b839d(0x103))/0x9;if(_0x10ae3e===_0x440a7e)break;else _0x5cc0f7['push'](_0x5cc0f7['shift']());}catch(_0x507edb){_0x5cc0f7['push'](_0x5cc0f7['shift']());}}}(a48_0x199a,0x98305));import{createRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a48_0x199a(){const _0x489bc2=['POST','role','2868568hlTDMm','Create\x20a\x20runtime\x20CUSTOM\x20role','2991JtIxiA','CUSTOM','trim','/client/permit/role/create','536aUeAxt','8509067feQfLF','str','build','234DvFpwC','string','Preview:\x20create\x20a\x20runtime\x20CUSTOM\x20role','17860aiwjlA','description','Role\x20name','create','appCode','validation','1969740NZXEDj','remark','853272MuhETY','body','--name\x20must\x20not\x20be\x20blank.','11794824WCMgIy','high-risk-write'];a48_0x199a=function(){return _0x489bc2;};return a48_0x199a();}import{projectRuntimeRole,runtimeRoleWriteResult}from'../../commands/role/shared.js';function input(_0x3cc330){const _0x5bb027=a48_0x50b6,_0x338bdf=_0x3cc330[_0x5bb027(0xf3)]('name')[_0x5bb027(0x10b)]();if(!_0x338bdf)throw CliErrors[_0x5bb027(0xfd)](_0x5bb027(0x102));const _0x1219f1=_0x3cc330[_0x5bb027(0xf3)](_0x5bb027(0xff))[_0x5bb027(0x10b)]();return{'appCode':_0x3cc330[_0x5bb027(0xfc)],'roleName':_0x338bdf,..._0x1219f1?{'remark':_0x1219f1}:{}};}function a48_0x50b6(_0x1c3fc3,_0xc59246){_0x1c3fc3=_0x1c3fc3-0xf2;const _0x199ab7=a48_0x199a();let _0x50b650=_0x199ab7[_0x1c3fc3];return _0x50b650;}export const roleCreate={'service':a48_0x146977(0x106),'command':a48_0x146977(0xfb),'description':a48_0x146977(0x108),'risk':a48_0x146977(0x104),'confirmationDescription':'在当前运行应用中创建一个自定义角色;创建后可用于成员与资源权限配置。','flags':[{'name':'name','type':a48_0x146977(0xf6),'required':!![],'description':a48_0x146977(0xfa)},{'name':'remark','type':a48_0x146977(0xf6),'description':'Optional\x20role\x20remark'}],async 'validate'(_0x131845){input(_0x131845);},async 'dryRun'(_0x10e9b0){const _0xf6aa1=a48_0x146977;return dryRun(_0xf6aa1(0x105),_0xf6aa1(0x10c))[_0xf6aa1(0x101)]({'roleType':_0xf6aa1(0x10a),...input(_0x10e9b0)})[_0xf6aa1(0xf9)](_0xf6aa1(0xf7))[_0xf6aa1(0xf4)]();},async 'execute'(_0x4a85d3){const _0x203313=a48_0x146977,_0x123c00=await createRuntimeAppRole(input(_0x4a85d3));return{'ok':!![],'data':runtimeRoleWriteResult(_0x203313(0xfb),{'roleId':_0x123c00['id']},null,projectRuntimeRole(_0x123c00),{'method':_0x203313(0x105),'path':'/client/permit/role/create'})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x56591a=a49_0x2d19;(function(_0x175f75,_0x5667c9){const _0x4e4a81=a49_0x2d19,_0xeba193=_0x175f75();while(!![]){try{const _0x5070ab=parseInt(_0x4e4a81(0x1ce))/0x1+parseInt(_0x4e4a81(0x1c8))/0x2+-parseInt(_0x4e4a81(0x1bc))/0x3+-parseInt(_0x4e4a81(0x1bf))/0x4*(-parseInt(_0x4e4a81(0x1c1))/0x5)+parseInt(_0x4e4a81(0x1bb))/0x6*(parseInt(_0x4e4a81(0x1c5))/0x7)+-parseInt(_0x4e4a81(0x1cc))/0x8*(-parseInt(_0x4e4a81(0x1c6))/0x9)+-parseInt(_0x4e4a81(0x1c4))/0xa;if(_0x5070ab===_0x5667c9)break;else _0xeba193['push'](_0xeba193['shift']());}catch(_0x1ef97b){_0xeba193['push'](_0xeba193['shift']());}}}(a49_0x7366,0xdbd1d));function a49_0x2d19(_0x1681b6,_0x5cecfa){_0x1681b6=_0x1681b6-0x1bb;const _0x736629=a49_0x7366();let _0x2d19a9=_0x736629[_0x1681b6];return _0x2d19a9;}import{deleteRuntimeAppRole}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function a49_0x7366(){const _0x350ce3=['402YDCRzq','1151763ZMbiaS','delete','body','652072ZGVRld','Preview:\x20delete\x20a\x20runtime\x20CUSTOM\x20role','10WhErwd','appCode','high-risk-write','27838180DcWbWm','130249JJeMcj','7688007lbbEzx','删除当前运行应用中的自定义角色;该角色的成员关系和权限配置可能随之失效。','1736286qmMgrR','num','description','role','8xbmvpy','/client/permit/role/delete','773049HPMOYa','POST'];a49_0x7366=function(){return _0x350ce3;};return a49_0x7366();}async function prepare(_0x26cf98){const _0x4b4f67=a49_0x2d19,_0x580c40=await getRuntimeRoleById(_0x26cf98[_0x4b4f67(0x1c2)],_0x26cf98[_0x4b4f67(0x1c9)]('id'));return assertCustomRuntimeRole(_0x580c40,_0x4b4f67(0x1bd)),_0x580c40;}export const roleDelete={'service':a49_0x56591a(0x1cb),'command':a49_0x56591a(0x1bd),'description':'Delete\x20a\x20runtime\x20CUSTOM\x20role','risk':a49_0x56591a(0x1c3),'confirmationDescription':a49_0x56591a(0x1c7),'flags':[ROLE_ID_FLAG],async 'dryRun'(_0x369708){const _0x297970=a49_0x56591a,_0x17b50b=await prepare(_0x369708);return dryRun('POST',_0x297970(0x1cd))[_0x297970(0x1be)]({'id':_0x17b50b['id']})[_0x297970(0x1ca)](_0x297970(0x1c0))['build']();},async 'execute'(_0x2f5463){const _0x50ba20=a49_0x56591a,_0x36062d=await prepare(_0x2f5463);return await deleteRuntimeAppRole(_0x36062d['id']),{'ok':!![],'data':runtimeRoleWriteResult(_0x50ba20(0x1bd),{'roleId':_0x36062d['id']},projectRuntimeRole(_0x36062d),null,{'method':_0x50ba20(0x1cf),'path':_0x50ba20(0x1cd)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0xcefe7f=a50_0x2442;function a50_0x1ead(){const _0x5a9480=['3308535DLaKYI','1510MPFdzn','read','85TZpFgD','62018tNWDuY','role','12093352ArAbjj','Show\x20one\x20runtime\x20role\x20by\x20ID','1455642qUTpXR','runtime','224KpmCEi','14JfWWCP','appCode','284XwgIFY','3404CzVzrC','num','11794752yokDTE'];a50_0x1ead=function(){return _0x5a9480;};return a50_0x1ead();}(function(_0x463f49,_0x1d31f5){const _0x4349cd=a50_0x2442,_0x3c5453=_0x463f49();while(!![]){try{const _0xc2ce7d=parseInt(_0x4349cd(0xfb))/0x1*(parseInt(_0x4349cd(0xff))/0x2)+parseInt(_0x4349cd(0x102))/0x3+parseInt(_0x4349cd(0xfe))/0x4*(-parseInt(_0x4349cd(0x105))/0x5)+-parseInt(_0x4349cd(0xf9))/0x6*(-parseInt(_0x4349cd(0xfc))/0x7)+-parseInt(_0x4349cd(0xf7))/0x8+parseInt(_0x4349cd(0x101))/0x9+parseInt(_0x4349cd(0x103))/0xa*(-parseInt(_0x4349cd(0xf5))/0xb);if(_0xc2ce7d===_0x1d31f5)break;else _0x3c5453['push'](_0x3c5453['shift']());}catch(_0x11da23){_0x3c5453['push'](_0x3c5453['shift']());}}}(a50_0x1ead,0xdf8a5));function a50_0x2442(_0x21b1df,_0x15d55f){_0x21b1df=_0x21b1df-0xf5;const _0x1ead5d=a50_0x1ead();let _0x24421a=_0x1ead5d[_0x21b1df];return _0x24421a;}import{getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':a50_0xcefe7f(0xf6),'command':'detail','description':a50_0xcefe7f(0xf8),'risk':a50_0xcefe7f(0x104),'flags':[ROLE_ID_FLAG],async 'execute'(_0x234c34){const _0x4e506a=a50_0xcefe7f,_0x4efed2=await getRuntimeRoleById(_0x234c34[_0x4e506a(0xfd)],_0x234c34[_0x4e506a(0x100)]('id'));return{'ok':!![],'data':{'scope':_0x4e506a(0xfa),'role':projectRuntimeRole(_0x4efed2)}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbdcdf1,_0x2106f4){const _0x5516b3=a51_0x2e9b,_0x3baf96=_0xbdcdf1();while(!![]){try{const _0x367b86=-parseInt(_0x5516b3(0xff))/0x1*(parseInt(_0x5516b3(0x101))/0x2)+parseInt(_0x5516b3(0x106))/0x3*(parseInt(_0x5516b3(0x107))/0x4)+-parseInt(_0x5516b3(0x103))/0x5+parseInt(_0x5516b3(0x105))/0x6*(-parseInt(_0x5516b3(0xfd))/0x7)+-parseInt(_0x5516b3(0x100))/0x8+-parseInt(_0x5516b3(0xfe))/0x9*(-parseInt(_0x5516b3(0x104))/0xa)+-parseInt(_0x5516b3(0x102))/0xb;if(_0x367b86===_0x2106f4)break;else _0x3baf96['push'](_0x3baf96['shift']());}catch(_0x119f8f){_0x3baf96['push'](_0x3baf96['shift']());}}}(a51_0x5ed0,0x45e81));import{roleList}from'../../commands/role/list.js';import{roleDetail}from'../../commands/role/detail.js';import{roleCreate}from'../../commands/role/create.js';function a51_0x2e9b(_0x29041e,_0x28b29b){_0x29041e=_0x29041e-0xfd;const _0x5ed0d2=a51_0x5ed0();let _0x2e9bc8=_0x5ed0d2[_0x29041e];return _0x2e9bc8;}import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';function a51_0x5ed0(){const _0xa4241d=['4lrEVeY','7861pDmMLu','1665Ciwylr','6287gfMrOj','3300272JTjjZo','6IBJNAp','359887CKknAd','433970XxImRk','18230QNrzeA','150yFJvhc','1584189oWESsg'];a51_0x5ed0=function(){return _0xa4241d;};return a51_0x5ed0();}import{roleUserAdd}from'../../commands/role/user-add.js';import{roleUserRemove}from'../../commands/role/user-remove.js';export const roleDefinitions=[roleList,roleDetail,roleCreate,roleUpdate,roleDelete,roleUserAdd,roleUserRemove];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x515c44=a52_0xba48;function a52_0xba48(_0x40bc20,_0x4a0503){_0x40bc20=_0x40bc20-0x196;const _0x2bfefc=a52_0x2bfe();let _0xba48df=_0x2bfefc[_0x40bc20];return _0xba48df;}(function(_0x5cb927,_0x486d4a){const _0xc1a603=a52_0xba48,_0x52f9c7=_0x5cb927();while(!![]){try{const _0x117044=-parseInt(_0xc1a603(0x196))/0x1*(parseInt(_0xc1a603(0x19c))/0x2)+-parseInt(_0xc1a603(0x1a8))/0x3+parseInt(_0xc1a603(0x1b0))/0x4*(-parseInt(_0xc1a603(0x1b6))/0x5)+-parseInt(_0xc1a603(0x1a1))/0x6+parseInt(_0xc1a603(0x1a2))/0x7*(parseInt(_0xc1a603(0x19e))/0x8)+parseInt(_0xc1a603(0x1ae))/0x9+parseInt(_0xc1a603(0x1af))/0xa;if(_0x117044===_0x486d4a)break;else _0x52f9c7['push'](_0x52f9c7['shift']());}catch(_0xa78410){_0x52f9c7['push'](_0x52f9c7['shift']());}}}(a52_0x2bfe,0x23ac3));import{listRuntimeAppRoles}from'../../core/api-client.js';function a52_0x2bfe(){const _0x2b6979=['roleType','20874IFWzmJ','includes','number','str','List\x20runtime\x20roles\x20for\x20the\x20current\x20app','Page\x20size\x20from\x201\x20to\x20100','344052xeGPbH','4059330qZDUKW','8FGTsUR','items','name','appCode','length','trim','235295hAFuIR','filter','map','role','2LIXSkl','string','Runtime\x20role\x20type','paging','type','page','91282pNTIvZ','validation','224WHaZeS','num','isSafeInteger','1513440WcmJbi','36638VRoZLj','runtime','pagesize','toUpperCase','Page\x20number'];a52_0x2bfe=function(){return _0x2b6979;};return a52_0x2bfe();}import{CliErrors}from'../../errors.js';import{listAllRuntimeRoles,projectRuntimeRole,RUNTIME_ROLE_TYPES}from'../../commands/role/shared.js';export const roleList={'service':a52_0x515c44(0x1b9),'command':'list','description':a52_0x515c44(0x1ac),'risk':'read','flags':[{'name':a52_0x515c44(0x19a),'type':'string','enum':RUNTIME_ROLE_TYPES,'description':a52_0x515c44(0x198)},{'name':a52_0x515c44(0x1b2),'type':a52_0x515c44(0x197),'description':'Fuzzy\x20role-name\x20filter'},{'name':a52_0x515c44(0x19b),'type':a52_0x515c44(0x1aa),'default':0x1,'description':a52_0x515c44(0x1a6)},{'name':'pagesize','type':'number','default':0x64,'description':a52_0x515c44(0x1ad)}],async 'validate'(_0x26b9c0){const _0x5d9ede=a52_0x515c44,_0x5cf11a=_0x26b9c0[_0x5d9ede(0x1ab)](_0x5d9ede(0x19a))['toUpperCase']();if(_0x5cf11a&&!RUNTIME_ROLE_TYPES[_0x5d9ede(0x1a9)](_0x5cf11a))throw CliErrors[_0x5d9ede(0x19d)]('Invalid\x20runtime\x20role\x20type:\x20'+_0x5cf11a+'.');const _0x48fdf0=_0x26b9c0[_0x5d9ede(0x19f)](_0x5d9ede(0x19b),0x1),_0x52ca6c=_0x26b9c0['num']('pagesize',0x64);if(!Number[_0x5d9ede(0x1a0)](_0x48fdf0)||_0x48fdf0<0x1)throw CliErrors[_0x5d9ede(0x19d)]('--page\x20must\x20be\x20a\x20positive\x20integer.');if(!Number[_0x5d9ede(0x1a0)](_0x52ca6c)||_0x52ca6c<0x1||_0x52ca6c>0x64)throw CliErrors['validation']('--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');},async 'execute'(_0x102363){const _0x3e8a82=a52_0x515c44,_0x803418=_0x102363['str'](_0x3e8a82(0x19a))[_0x3e8a82(0x1a5)](),_0x8ff7a2=_0x102363['str'](_0x3e8a82(0x1b2))[_0x3e8a82(0x1b5)](),_0x2265dc=_0x102363[_0x3e8a82(0x19f)](_0x3e8a82(0x19b),0x1),_0x4027d7=_0x102363[_0x3e8a82(0x19f)](_0x3e8a82(0x1a4),0x64);if(_0x803418){const _0x43d57f=(await listAllRuntimeRoles(_0x102363[_0x3e8a82(0x1b3)],{..._0x8ff7a2?{'roleName':_0x8ff7a2}:{}}))[_0x3e8a82(0x1b7)](_0x5e3d9b=>_0x5e3d9b[_0x3e8a82(0x1a7)]===_0x803418),_0x504786=(_0x2265dc-0x1)*_0x4027d7;return{'ok':!![],'data':{'scope':_0x3e8a82(0x1a3),'roles':_0x43d57f['slice'](_0x504786,_0x504786+_0x4027d7)[_0x3e8a82(0x1b8)](projectRuntimeRole),'paging':{'currentPage':_0x2265dc,'pageSize':_0x4027d7,'totalCount':_0x43d57f[_0x3e8a82(0x1b4)]}}};}const _0x36e576=await listRuntimeAppRoles(_0x102363['appCode'],{..._0x8ff7a2?{'roleName':_0x8ff7a2}:{},'currentPage':_0x2265dc,'pageSize':_0x4027d7});return{'ok':!![],'data':{'scope':'runtime','roles':_0x36e576[_0x3e8a82(0x1b1)][_0x3e8a82(0x1b8)](projectRuntimeRole),'paging':_0x36e576[_0x3e8a82(0x199)]}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a53_0x4f3d18=a53_0x4195;(function(_0x15b4df,_0x5c534f){const _0x81511e=a53_0x4195,_0x1922d5=_0x15b4df();while(!![]){try{const _0x1ad1ee=-parseInt(_0x81511e(0x19b))/0x1*(-parseInt(_0x81511e(0x18a))/0x2)+-parseInt(_0x81511e(0x1b1))/0x3*(parseInt(_0x81511e(0x183))/0x4)+-parseInt(_0x81511e(0x187))/0x5*(parseInt(_0x81511e(0x19f))/0x6)+-parseInt(_0x81511e(0x1a6))/0x7+-parseInt(_0x81511e(0x1a5))/0x8*(parseInt(_0x81511e(0x1af))/0x9)+-parseInt(_0x81511e(0x1a8))/0xa*(-parseInt(_0x81511e(0x1b0))/0xb)+-parseInt(_0x81511e(0x1ad))/0xc*(-parseInt(_0x81511e(0x1c6))/0xd);if(_0x1ad1ee===_0x5c534f)break;else _0x1922d5['push'](_0x1922d5['shift']());}catch(_0x15aba5){_0x1922d5['push'](_0x1922d5['shift']());}}}(a53_0x3dc5,0xad0e3));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a53_0x4f3d18(0x194),a53_0x4f3d18(0x1c4),a53_0x4f3d18(0x1ab),a53_0x4f3d18(0x181)];const BUILTIN_ROLE_TYPES=[a53_0x4f3d18(0x194),a53_0x4f3d18(0x1c4),a53_0x4f3d18(0x1ab)];export const ROLE_ID_FLAG={'name':'id','type':'number','required':!![],'description':a53_0x4f3d18(0x18e)};export const ROLE_REF_FLAG={'name':'role','type':a53_0x4f3d18(0x189),'required':!![],'description':a53_0x4f3d18(0x1b3)};export const USER_ID_FLAG={'name':a53_0x4f3d18(0x1c8),'type':a53_0x4f3d18(0x189),'required':!![],'description':a53_0x4f3d18(0x19c)};export const EXPECT_USER_COUNT_FLAG={'name':a53_0x4f3d18(0x1ac),'type':a53_0x4f3d18(0x18f),'description':'Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed'};function a53_0x3dc5(){const _0x44c6ce=['282VyylBK','Pass\x20one\x20role\x20ID:\x20','test','remark','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','\x20built-in\x20runtime\x20role\x20','8VmjnwO','8744295QBiXoK','push','120UVtnvD','str','userList','OWNER','expect-user-count','23171676XuoVde','Runtime\x20role\x20name\x20\x22','2337705DVAndm','806399jQrnoe','1456491lVCVzk','\x22\x20is\x20ambiguous.','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','userId','runtime','user-add','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','userName','roleType','paging','includes','length','roleName','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','isSafeInteger','User\x20','\x20is\x20already\x20in\x20runtime\x20role\x20','USER','items','13eBKkby','validation','user','role','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','CUSTOM','Runtime\x20role\x20id\x20','8YTyIOh','applyUserList','Missing\x20runtime\x20role\x20reference.','\x20was\x20not\x20found\x20in\x20app\x20','35185UGIbtv','map','string','2518CiwSmu','\x22\x20was\x20not\x20found\x20in\x20app\x20','Pass\x20--role\x20<id|name>.','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','number','Runtime\x20user\x20','Runtime\x20role\x20','trim',',\x20found\x20','ADMIN','userCount','filter','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','permitCount','563ZlEBVx','Runtime\x20numeric\x20userId','\x20is\x20not\x20in\x20runtime\x20role\x20','appCode'];a53_0x3dc5=function(){return _0x44c6ce;};return a53_0x3dc5();}export function isBuiltinRuntimeRole(_0x1359ea){return BUILTIN_ROLE_TYPES['includes'](_0x1359ea);}export function assertCustomRuntimeRole(_0x25a1a5,_0x33ef9f){const _0x5f4c9e=a53_0x4f3d18;if(_0x25a1a5['roleType']!==_0x5f4c9e(0x181))throw CliErrors['validation']('Cannot\x20'+_0x33ef9f+_0x5f4c9e(0x1a4)+_0x25a1a5[_0x5f4c9e(0x1bd)]+'\x20('+_0x25a1a5[_0x5f4c9e(0x1b9)]+').',_0x5f4c9e(0x199));}export function projectRuntimeRole(_0x472de7){const _0x5ecf7e=a53_0x4f3d18;return{'id':_0x472de7['id'],'roleName':_0x472de7[_0x5ecf7e(0x1bd)],'roleType':_0x472de7[_0x5ecf7e(0x1b9)],'remark':_0x472de7[_0x5ecf7e(0x1a2)],'userCount':_0x472de7[_0x5ecf7e(0x195)]??0x0,'permitCount':_0x472de7[_0x5ecf7e(0x19a)]??0x0,'builtin':isBuiltinRuntimeRole(_0x472de7[_0x5ecf7e(0x1b9)])};}export async function getRuntimeRoleById(_0x531448,_0x26404f){const _0x3f94b8=a53_0x4f3d18;if(!Number[_0x3f94b8(0x1c1)](_0x26404f)||_0x26404f<=0x0)throw CliErrors[_0x3f94b8(0x1c7)](_0x3f94b8(0x1b7));const _0x4f7458=(await listAllRuntimeRoles(_0x531448))['filter'](_0x5bc700=>_0x5bc700['id']===_0x26404f&&(!_0x5bc700[_0x3f94b8(0x19e)]||_0x5bc700[_0x3f94b8(0x19e)]===_0x531448));if(_0x4f7458['length']!==0x1)throw CliErrors[_0x3f94b8(0x1c7)](_0x3f94b8(0x182)+_0x26404f+_0x3f94b8(0x186)+_0x531448+'.',_0x3f94b8(0x1ca));return _0x4f7458[0x0];}export async function listAllRuntimeRoles(_0x53390e,_0x3df216={}){const _0x317a01=a53_0x4f3d18,_0x54aceb=0x64,_0x337a60=[];for(let _0x633da3=0x1;;_0x633da3+=0x1){const _0x555bd1=await listRuntimeAppRoles(_0x53390e,{..._0x3df216['roleName']?{'roleName':_0x3df216[_0x317a01(0x1bd)]}:{},'currentPage':_0x633da3,'pageSize':_0x54aceb});_0x337a60[_0x317a01(0x1a7)](..._0x555bd1['items']);if(_0x555bd1[_0x317a01(0x1c5)][_0x317a01(0x1bc)]<_0x54aceb||_0x555bd1[_0x317a01(0x1ba)]&&_0x337a60[_0x317a01(0x1bc)]>=_0x555bd1[_0x317a01(0x1ba)]['totalCount'])return _0x337a60;}}export async function resolveRuntimeRoleRef(_0x57ddff,_0x533fc4){const _0x4b6340=a53_0x4f3d18,_0x11a8c1=_0x533fc4[_0x4b6340(0x192)]();if(!_0x11a8c1)throw CliErrors[_0x4b6340(0x1c7)](_0x4b6340(0x185),_0x4b6340(0x18c));if(/^\d+$/[_0x4b6340(0x1a1)](_0x11a8c1))return getRuntimeRoleById(_0x57ddff,Number(_0x11a8c1));const _0x5a728e=(await listAllRuntimeRoles(_0x57ddff))[_0x4b6340(0x196)](_0x29c628=>_0x29c628[_0x4b6340(0x1bd)]===_0x11a8c1);if(_0x5a728e['length']===0x0)throw CliErrors[_0x4b6340(0x1c7)](_0x4b6340(0x1ae)+_0x11a8c1+_0x4b6340(0x18b)+_0x57ddff+'.',_0x4b6340(0x1bf));if(_0x5a728e[_0x4b6340(0x1bc)]>0x1)throw CliErrors[_0x4b6340(0x1c7)](_0x4b6340(0x1ae)+_0x11a8c1+_0x4b6340(0x1b2),_0x4b6340(0x1a0)+_0x5a728e[_0x4b6340(0x188)](_0x4ce321=>_0x4ce321['id'])['join'](',\x20')+'.');return _0x5a728e[0x0];}function a53_0x4195(_0x3a8a95,_0x34803a){_0x3a8a95=_0x3a8a95-0x181;const _0x3dc506=a53_0x3dc5();let _0x4195b2=_0x3dc506[_0x3a8a95];return _0x4195b2;}function parseRuntimeUserId(_0x1f9c68){const _0x32c843=a53_0x4f3d18,_0x35bc8b=_0x1f9c68[_0x32c843(0x192)]();if(!/^\d+$/['test'](_0x35bc8b))throw CliErrors[_0x32c843(0x1c7)](_0x32c843(0x198),_0x32c843(0x1be));const _0x260238=Number(_0x35bc8b);if(!Number[_0x32c843(0x1c1)](_0x260238)||_0x260238<=0x0)throw CliErrors[_0x32c843(0x1c7)]('Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.');return _0x260238;}export async function prepareRuntimeMemberMutation(_0x2568fe,_0xf19fb9){const _0x3a832c=a53_0x4f3d18,_0x527755=await resolveRuntimeRoleRef(_0x2568fe[_0x3a832c(0x19e)],_0x2568fe[_0x3a832c(0x1a9)](_0x3a832c(0x1c9)));if(_0x527755['roleType']===_0x3a832c(0x1ab))throw CliErrors[_0x3a832c(0x1c7)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.',_0x3a832c(0x1a3));const _0x52f881=parseRuntimeUserId(_0x2568fe[_0x3a832c(0x1a9)]('user')),_0x256920=(await listRuntimeRoleUsers(_0x2568fe['appCode']))[_0x3a832c(0x188)](_0x160b8d=>({..._0x160b8d,'userList':[..._0x160b8d[_0x3a832c(0x1aa)]??[]],'applyUserList':[..._0x160b8d[_0x3a832c(0x184)]??[]]})),_0x5f141c=_0x256920['find'](_0x1f37d8=>_0x1f37d8['id']===_0x527755['id']);if(!_0x5f141c)throw CliErrors[_0x3a832c(0x1c7)](_0x3a832c(0x191)+_0x527755['id']+_0x3a832c(0x18d),_0x3a832c(0x197));const _0x3c650d=_0x5f141c['userList']['map'](_0x106995=>_0x106995['userId']),_0x3be42c=_0x2568fe['flag']('expect-user-count');if(_0x3be42c!==undefined&&_0x3be42c!==null&&_0x3be42c!==''){const _0x4d3553=_0x2568fe['num'](_0x3a832c(0x1ac));if(!Number[_0x3a832c(0x1c1)](_0x4d3553)||_0x4d3553<0x0)throw CliErrors[_0x3a832c(0x1c7)]('--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x3c650d[_0x3a832c(0x1bc)]!==_0x4d3553)throw CliErrors[_0x3a832c(0x1c7)]('Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20'+_0x4d3553+_0x3a832c(0x193)+_0x3c650d[_0x3a832c(0x1bc)]+'.','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.');}const _0x4fe468=_0x3c650d[_0x3a832c(0x1bb)](_0x52f881),_0x1d310a=[];let _0x44e3ea=!![];if(_0xf19fb9===_0x3a832c(0x1b6)){const _0x5eb624=await listRuntimeAppUsers(_0x2568fe[_0x3a832c(0x19e)]),_0x59bdd8=_0x5eb624['filter'](_0x5a48f1=>Number(_0x5a48f1['code'])===_0x52f881);if(_0x59bdd8['length']!==0x1||!_0x59bdd8[0x0][_0x3a832c(0x1b8)]?.[_0x3a832c(0x192)]())throw CliErrors['validation'](_0x3a832c(0x190)+_0x52f881+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x2568fe[_0x3a832c(0x19e)]+'.',_0x3a832c(0x1c0));_0x4fe468?(_0x44e3ea=![],_0x1d310a['push']('User\x20'+_0x52f881+_0x3a832c(0x1c3)+_0x527755['id']+'.')):_0x5f141c[_0x3a832c(0x1aa)][_0x3a832c(0x1a7)]({'userId':_0x52f881,'username':_0x59bdd8[0x0][_0x3a832c(0x1b8)]});}else!_0x4fe468?(_0x44e3ea=![],_0x1d310a['push'](_0x3a832c(0x1c2)+_0x52f881+_0x3a832c(0x19d)+_0x527755['id']+'.')):_0x5f141c[_0x3a832c(0x1aa)]=_0x5f141c[_0x3a832c(0x1aa)][_0x3a832c(0x196)](_0x2f8af4=>_0x2f8af4[_0x3a832c(0x1b4)]!==_0x52f881);return{'role':_0x527755,'userId':_0x52f881,'roleList':_0x256920,'before':{'userIds':_0x3c650d},'after':{'userIds':_0x5f141c[_0x3a832c(0x1aa)]['map'](_0x257a78=>_0x257a78[_0x3a832c(0x1b4)])},'shouldWrite':_0x44e3ea,'warnings':_0x1d310a};}export function runtimeRoleWriteResult(_0x388426,_0x56bde8,_0x52b6f5,_0x4f5ff2,_0x522ea1,_0x37f86f=[]){const _0x4a19ef=a53_0x4f3d18;return{'operation':_0x388426,'scope':_0x4a19ef(0x1b5),'selector':_0x56bde8,'before':_0x52b6f5,'after':_0x4f5ff2,'dryRun':![],'backend':_0x522ea1,'warnings':_0x37f86f};}
|
|
1
|
+
const a53_0x1790ff=a53_0x3498;(function(_0x2c2643,_0x46b5d8){const _0x538973=a53_0x3498,_0xa38d77=_0x2c2643();while(!![]){try{const _0xd34ff7=-parseInt(_0x538973(0xbe))/0x1*(-parseInt(_0x538973(0xe2))/0x2)+parseInt(_0x538973(0xce))/0x3+-parseInt(_0x538973(0xf7))/0x4*(parseInt(_0x538973(0xb9))/0x5)+parseInt(_0x538973(0xcd))/0x6*(-parseInt(_0x538973(0xd4))/0x7)+parseInt(_0x538973(0xc5))/0x8*(parseInt(_0x538973(0xb5))/0x9)+parseInt(_0x538973(0xd9))/0xa+parseInt(_0x538973(0xe6))/0xb;if(_0xd34ff7===_0x46b5d8)break;else _0xa38d77['push'](_0xa38d77['shift']());}catch(_0x36b095){_0xa38d77['push'](_0xa38d77['shift']());}}}(a53_0x350c,0x9cce4));function a53_0x3498(_0x59bc3e,_0x17654c){_0x59bc3e=_0x59bc3e-0xb5;const _0x350cfd=a53_0x350c();let _0x349812=_0x350cfd[_0x59bc3e];return _0x349812;}import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a53_0x1790ff(0xdf),a53_0x1790ff(0xcc),a53_0x1790ff(0xf1),'CUSTOM'];const BUILTIN_ROLE_TYPES=[a53_0x1790ff(0xdf),a53_0x1790ff(0xcc),a53_0x1790ff(0xf1)];export const ROLE_ID_FLAG={'name':'id','type':a53_0x1790ff(0xc9),'required':!![],'description':a53_0x1790ff(0xe7)};export const ROLE_REF_FLAG={'name':a53_0x1790ff(0xbd),'type':a53_0x1790ff(0xf3),'required':!![],'description':a53_0x1790ff(0xb7)};export const USER_ID_FLAG={'name':a53_0x1790ff(0xba),'type':a53_0x1790ff(0xf3),'required':!![],'description':a53_0x1790ff(0xdb)};export const EXPECT_USER_COUNT_FLAG={'name':a53_0x1790ff(0xf4),'type':'number','description':a53_0x1790ff(0xf6)};export function isBuiltinRuntimeRole(_0x378aa3){const _0x9b523d=a53_0x1790ff;return BUILTIN_ROLE_TYPES[_0x9b523d(0xb6)](_0x378aa3);}export function assertCustomRuntimeRole(_0x4ea0f3,_0x2b0cb7){const _0x273c5a=a53_0x1790ff;if(_0x4ea0f3[_0x273c5a(0xfd)]!==_0x273c5a(0xf2))throw CliErrors[_0x273c5a(0xc4)](_0x273c5a(0xc8)+_0x2b0cb7+'\x20built-in\x20runtime\x20role\x20'+_0x4ea0f3[_0x273c5a(0xf0)]+'\x20('+_0x4ea0f3['roleType']+').',_0x273c5a(0xff));}export function projectRuntimeRole(_0x2e5474){const _0x3389e0=a53_0x1790ff;return{'id':_0x2e5474['id'],'roleName':_0x2e5474['roleName'],'roleType':_0x2e5474[_0x3389e0(0xfd)],'remark':_0x2e5474[_0x3389e0(0xd7)],'userCount':_0x2e5474[_0x3389e0(0xfa)]??0x0,'permitCount':_0x2e5474[_0x3389e0(0xbf)]??0x0,'builtin':isBuiltinRuntimeRole(_0x2e5474[_0x3389e0(0xfd)])};}export async function getRuntimeRoleById(_0x4356a0,_0x15864b){const _0x402212=a53_0x1790ff;if(!Number[_0x402212(0xcb)](_0x15864b)||_0x15864b<=0x0)throw CliErrors[_0x402212(0xc4)](_0x402212(0xd8));const _0x865784=(await listAllRuntimeRoles(_0x4356a0))[_0x402212(0xd0)](_0x24965c=>_0x24965c['id']===_0x15864b&&(!_0x24965c['appCode']||_0x24965c['appCode']===_0x4356a0));if(_0x865784[_0x402212(0xe0)]!==0x1)throw CliErrors[_0x402212(0xc4)](_0x402212(0xde)+_0x15864b+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x4356a0+'.',_0x402212(0x101));return _0x865784[0x0];}export async function listAllRuntimeRoles(_0x13c330,_0x1faa49={}){const _0x9a09d1=a53_0x1790ff,_0x592dee=0x64,_0x21925e=[];for(let _0x91dcef=0x1;;_0x91dcef+=0x1){const _0x463634=await listRuntimeAppRoles(_0x13c330,{..._0x1faa49['roleName']?{'roleName':_0x1faa49['roleName']}:{},'currentPage':_0x91dcef,'pageSize':_0x592dee});_0x21925e['push'](..._0x463634[_0x9a09d1(0xdd)]);if(_0x463634[_0x9a09d1(0xdd)][_0x9a09d1(0xe0)]<_0x592dee||_0x463634[_0x9a09d1(0xda)]&&_0x21925e['length']>=_0x463634[_0x9a09d1(0xda)][_0x9a09d1(0xe4)])return _0x21925e;}}export async function resolveRuntimeRoleRef(_0x4b799c,_0x5b1099){const _0x3aa611=a53_0x1790ff,_0x747973=_0x5b1099[_0x3aa611(0xf5)]();if(!_0x747973)throw CliErrors[_0x3aa611(0xc4)](_0x3aa611(0xd5),'Pass\x20--role\x20<id|name>.');if(/^\d+$/[_0x3aa611(0xfe)](_0x747973))return getRuntimeRoleById(_0x4b799c,Number(_0x747973));const _0x209b3e=(await listAllRuntimeRoles(_0x4b799c))[_0x3aa611(0xd0)](_0x1196b1=>_0x1196b1[_0x3aa611(0xf0)]===_0x747973);if(_0x209b3e[_0x3aa611(0xe0)]===0x0)throw CliErrors['validation']('Runtime\x20role\x20name\x20\x22'+_0x747973+_0x3aa611(0xd1)+_0x4b799c+'.',_0x3aa611(0xbc));if(_0x209b3e[_0x3aa611(0xe0)]>0x1)throw CliErrors[_0x3aa611(0xc4)](_0x3aa611(0xca)+_0x747973+_0x3aa611(0xbb),_0x3aa611(0xee)+_0x209b3e['map'](_0xfcd077=>_0xfcd077['id'])[_0x3aa611(0xc7)](',\x20')+'.');return _0x209b3e[0x0];}function a53_0x350c(){const _0x385672=['14496JxwgNn','userId','join','Cannot\x20','number','Runtime\x20role\x20name\x20\x22','isSafeInteger','USER','186LDLSVQ','3160980YITYyw','Runtime\x20user\x20','filter','\x22\x20was\x20not\x20found\x20in\x20app\x20','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.','\x20was\x20not\x20found\x20in\x20app\x20','249781lksyxJ','Missing\x20runtime\x20role\x20reference.','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','remark','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','1867490dupZMT','paging','Runtime\x20numeric\x20userId','runtime','items','Runtime\x20role\x20id\x20','ADMIN','length','User\x20','2Bqpkju','flag','totalCount','map','1273206AMoJeK','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','find',',\x20found\x20','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','user-add','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','Pass\x20one\x20role\x20ID:\x20','userList','roleName','OWNER','CUSTOM','string','expect-user-count','trim','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','875608CgFIji','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','code','userCount','\x20is\x20already\x20in\x20runtime\x20role\x20','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','roleType','test','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.','str','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','495fvcyyc','includes','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','\x20is\x20not\x20in\x20runtime\x20role\x20','10XkYvoV','user','\x22\x20is\x20ambiguous.','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.','role','730438FAOZHP','permitCount','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','appCode','userName','push','validation'];a53_0x350c=function(){return _0x385672;};return a53_0x350c();}function parseRuntimeUserId(_0x1935ea){const _0x539e6b=a53_0x1790ff,_0x4407a3=_0x1935ea[_0x539e6b(0xf5)]();if(!/^\d+$/[_0x539e6b(0xfe)](_0x4407a3))throw CliErrors[_0x539e6b(0xc4)](_0x539e6b(0xd6),'Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.');const _0x45ee8e=Number(_0x4407a3);if(!Number[_0x539e6b(0xcb)](_0x45ee8e)||_0x45ee8e<=0x0)throw CliErrors[_0x539e6b(0xc4)](_0x539e6b(0xf8));return _0x45ee8e;}export async function prepareRuntimeMemberMutation(_0x3c9b16,_0x3b7e92){const _0x214dbf=a53_0x1790ff,_0x3e7cef=await resolveRuntimeRoleRef(_0x3c9b16['appCode'],_0x3c9b16[_0x214dbf(0x100)]('role'));if(_0x3e7cef[_0x214dbf(0xfd)]==='OWNER')throw CliErrors[_0x214dbf(0xc4)]('OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.',_0x214dbf(0xfc));const _0x3b30ac=parseRuntimeUserId(_0x3c9b16[_0x214dbf(0x100)](_0x214dbf(0xba))),_0x48d5eb=(await listRuntimeRoleUsers(_0x3c9b16[_0x214dbf(0xc1)]))['map'](_0x596791=>({..._0x596791,'userList':[..._0x596791['userList']??[]],'applyUserList':[..._0x596791['applyUserList']??[]]})),_0x59cd22=_0x48d5eb[_0x214dbf(0xe8)](_0x16f09b=>_0x16f09b['id']===_0x3e7cef['id']);if(!_0x59cd22)throw CliErrors[_0x214dbf(0xc4)]('Runtime\x20role\x20'+_0x3e7cef['id']+_0x214dbf(0xeb),_0x214dbf(0xed));const _0x3529c1=_0x59cd22['userList'][_0x214dbf(0xe5)](_0x5b4d66=>_0x5b4d66[_0x214dbf(0xc6)]),_0x503e96=_0x3c9b16[_0x214dbf(0xe3)](_0x214dbf(0xf4));if(_0x503e96!==undefined&&_0x503e96!==null&&_0x503e96!==''){const _0x3c67db=_0x3c9b16['num'](_0x214dbf(0xf4));if(!Number[_0x214dbf(0xcb)](_0x3c67db)||_0x3c67db<0x0)throw CliErrors[_0x214dbf(0xc4)](_0x214dbf(0xc0));if(_0x3529c1[_0x214dbf(0xe0)]!==_0x3c67db)throw CliErrors[_0x214dbf(0xc4)](_0x214dbf(0xea)+_0x3c67db+_0x214dbf(0xe9)+_0x3529c1[_0x214dbf(0xe0)]+'.',_0x214dbf(0xd2));}const _0x5abf64=_0x3529c1['includes'](_0x3b30ac),_0x3c2f99=[];let _0x270f74=!![];if(_0x3b7e92===_0x214dbf(0xec)){const _0x53d251=await listRuntimeAppUsers(_0x3c9b16['appCode']),_0x162a8d=_0x53d251['filter'](_0x2ead08=>Number(_0x2ead08[_0x214dbf(0xf9)])===_0x3b30ac);if(_0x162a8d[_0x214dbf(0xe0)]!==0x1||!_0x162a8d[0x0][_0x214dbf(0xc2)]?.['trim']())throw CliErrors[_0x214dbf(0xc4)](_0x214dbf(0xcf)+_0x3b30ac+_0x214dbf(0xd3)+_0x3c9b16[_0x214dbf(0xc1)]+'.','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.');_0x5abf64?(_0x270f74=![],_0x3c2f99[_0x214dbf(0xc3)](_0x214dbf(0xe1)+_0x3b30ac+_0x214dbf(0xfb)+_0x3e7cef['id']+'.')):_0x59cd22['userList'][_0x214dbf(0xc3)]({'userId':_0x3b30ac,'username':_0x162a8d[0x0][_0x214dbf(0xc2)]});}else!_0x5abf64?(_0x270f74=![],_0x3c2f99[_0x214dbf(0xc3)](_0x214dbf(0xe1)+_0x3b30ac+_0x214dbf(0xb8)+_0x3e7cef['id']+'.')):_0x59cd22[_0x214dbf(0xef)]=_0x59cd22[_0x214dbf(0xef)][_0x214dbf(0xd0)](_0x4a7bb=>_0x4a7bb[_0x214dbf(0xc6)]!==_0x3b30ac);return{'role':_0x3e7cef,'userId':_0x3b30ac,'roleList':_0x48d5eb,'before':{'userIds':_0x3529c1},'after':{'userIds':_0x59cd22[_0x214dbf(0xef)][_0x214dbf(0xe5)](_0x42fe18=>_0x42fe18[_0x214dbf(0xc6)])},'shouldWrite':_0x270f74,'warnings':_0x3c2f99};}export function runtimeRoleWriteResult(_0x5f1fbf,_0x3ba453,_0x19019c,_0x4bac2d,_0x1489c0,_0x4b7e0b=[]){const _0x51810b=a53_0x1790ff;return{'operation':_0x5f1fbf,'scope':_0x51810b(0xdc),'selector':_0x3ba453,'before':_0x19019c,'after':_0x4bac2d,'dryRun':![],'backend':_0x1489c0,'warnings':_0x4b7e0b};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x409fba=a54_0x23d9;(function(_0x2a613e,_0x1f7ee0){const _0x47437d=a54_0x23d9,_0x3ac4b7=_0x2a613e();while(!![]){try{const _0x1bf336=-parseInt(_0x47437d(0xb7))/0x1+parseInt(_0x47437d(0xa9))/0x2*(-parseInt(_0x47437d(0xa1))/0x3)+-parseInt(_0x47437d(0xa2))/0x4+-parseInt(_0x47437d(0xbe))/0x5+parseInt(_0x47437d(0xac))/0x6*(-parseInt(_0x47437d(0xbc))/0x7)+parseInt(_0x47437d(0xa3))/0x8+parseInt(_0x47437d(0xbf))/0x9;if(_0x1bf336===_0x1f7ee0)break;else _0x3ac4b7['push'](_0x3ac4b7['shift']());}catch(_0x190dec){_0x3ac4b7['push'](_0x3ac4b7['shift']());}}}(a54_0x442e,0xe7fca));function a54_0x23d9(_0x30b3c9,_0x548b2f){_0x30b3c9=_0x30b3c9-0xa1;const _0x442e20=a54_0x442e();let _0x23d987=_0x442e20[_0x30b3c9];return _0x23d987;}import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x212183){const _0x3a864d=a54_0x23d9,_0x441f68=_0x212183[_0x3a864d(0xb6)](_0x3a864d(0xbd))!==undefined,_0xd53d73=_0x212183['flag'](_0x3a864d(0xae))!==undefined;if(!_0x441f68&&!_0xd53d73)throw CliErrors[_0x3a864d(0xa5)](_0x3a864d(0xba));const _0x153d81=_0x212183[_0x3a864d(0xb8)](_0x3a864d(0xbd))[_0x3a864d(0xaf)](),_0x2db897=_0x212183['str'](_0x3a864d(0xae))[_0x3a864d(0xaf)]();if(_0x441f68&&!_0x153d81)throw CliErrors['validation'](_0x3a864d(0xb9));if(_0xd53d73&&!_0x2db897)throw CliErrors[_0x3a864d(0xa5)]('--remark\x20must\x20not\x20be\x20blank.',_0x3a864d(0xb1));return{..._0x441f68?{'roleName':_0x153d81}:{},..._0xd53d73?{'remark':_0x2db897}:{}};}async function prepare(_0x49699d){const _0xeddff=a54_0x23d9,_0x436956=await getRuntimeRoleById(_0x49699d[_0xeddff(0xa4)],_0x49699d[_0xeddff(0xa8)]('id'));return assertCustomRuntimeRole(_0x436956,_0xeddff(0xb4)),{'role':_0x436956,'body':{'id':_0x436956['id'],'appCode':_0x49699d[_0xeddff(0xa4)],...updateFields(_0x49699d)}};}function a54_0x442e(){const _0x5b9425=['45912rnuVUc','role','remark','trim','修改当前运行应用中的自定义角色名称或备注;变更会立即影响角色展示。','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','body','New\x20non-empty\x20role\x20remark','update','/client/permit/role/update','flag','149453ZIiyEK','str','--name\x20must\x20not\x20be\x20blank.','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','New\x20role\x20name','203MkKjNf','name','1507515nOJbXs','20098881lKfKXf','741594vicDCW','4633048mZgdFM','10317832ntIupm','appCode','validation','description','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','num','6qRLTgI','string','POST'];a54_0x442e=function(){return _0x5b9425;};return a54_0x442e();}export const roleUpdate={'service':a54_0x409fba(0xad),'command':a54_0x409fba(0xb4),'description':'Update\x20a\x20runtime\x20CUSTOM\x20role','risk':'high-risk-write','confirmationDescription':a54_0x409fba(0xb0),'flags':[ROLE_ID_FLAG,{'name':a54_0x409fba(0xbd),'type':a54_0x409fba(0xaa),'description':a54_0x409fba(0xbb)},{'name':'remark','type':'string','description':a54_0x409fba(0xb3)}],async 'validate'(_0x2cedd9){updateFields(_0x2cedd9);},async 'dryRun'(_0x30296d){const _0x134291=a54_0x409fba,{body:_0x3fddbf}=await prepare(_0x30296d);return dryRun(_0x134291(0xab),_0x134291(0xb5))[_0x134291(0xb2)](_0x3fddbf)[_0x134291(0xa6)](_0x134291(0xa7))['build']();},async 'execute'(_0x7146c7){const _0x4b8792=a54_0x409fba,{role:_0xa15f14,body:_0x22f901}=await prepare(_0x7146c7),_0x14df46=await updateRuntimeAppRole(_0x22f901);return{'ok':!![],'data':runtimeRoleWriteResult(_0x4b8792(0xb4),{'roleId':_0xa15f14['id']},projectRuntimeRole(_0xa15f14),projectRuntimeRole(_0x14df46),{'method':'POST','path':'/client/permit/role/update'})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x229948=a55_0x41c0;function a55_0xc893(){const _0xf3de40=['Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','1464552xOaWOq','roleList','/client/permit/user-role/update-user-list','1326171HowRKi','after','high-risk-write','725607wBcvkT','2267IiVSax','appCode','6JdEENW','role','POST','186170LxqPth','description','480DmegHr','body','build','130pQlKKZ','把指定运行用户加入目标角色;该用户将获得该角色对应的运行权限。','shouldWrite','before','Preview:\x20add\x20runtime\x20role\x20member','7788ZulrdV','762768sRrOXR','user-add','warnings'];a55_0xc893=function(){return _0xf3de40;};return a55_0xc893();}(function(_0x275841,_0x2fb680){const _0x108e0e=a55_0x41c0,_0x54ecf6=_0x275841();while(!![]){try{const _0x978b8c=parseInt(_0x108e0e(0x139))/0x1*(parseInt(_0x108e0e(0x143))/0x2)+-parseInt(_0x108e0e(0x13b))/0x3*(parseInt(_0x108e0e(0x149))/0x4)+parseInt(_0x108e0e(0x140))/0x5*(parseInt(_0x108e0e(0x148))/0x6)+parseInt(_0x108e0e(0x135))/0x7+parseInt(_0x108e0e(0x14d))/0x8+-parseInt(_0x108e0e(0x138))/0x9+parseInt(_0x108e0e(0x13e))/0xa;if(_0x978b8c===_0x2fb680)break;else _0x54ecf6['push'](_0x54ecf6['shift']());}catch(_0x1eb688){_0x54ecf6['push'](_0x54ecf6['shift']());}}}(a55_0xc893,0x31187));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a55_0x41c0(_0x16587b,_0x2318d2){_0x16587b=_0x16587b-0x134;const _0xc893a3=a55_0xc893();let _0x41c03a=_0xc893a3[_0x16587b];return _0x41c03a;}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserAdd={'service':a55_0x229948(0x13c),'command':a55_0x229948(0x14a),'description':a55_0x229948(0x14c),'risk':a55_0x229948(0x137),'confirmationDescription':a55_0x229948(0x144),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x40cedd){const _0x497c16=a55_0x229948,_0x2997c9=await prepareRuntimeMemberMutation(_0x40cedd,_0x497c16(0x14a));return dryRun(_0x497c16(0x13d),'/client/permit/user-role/update-user-list')[_0x497c16(0x141)]({'appCode':_0x40cedd[_0x497c16(0x13a)],'roleList':_0x2997c9[_0x497c16(0x14e)]})[_0x497c16(0x13f)](_0x2997c9[_0x497c16(0x145)]?_0x497c16(0x147):_0x2997c9[_0x497c16(0x14b)][0x0])[_0x497c16(0x142)]();},async 'execute'(_0xe97deb){const _0x2822be=a55_0x229948,_0x10ba18=await prepareRuntimeMemberMutation(_0xe97deb,_0x2822be(0x14a));return _0x10ba18[_0x2822be(0x145)]&&await updateRuntimeRoleUsers(_0xe97deb[_0x2822be(0x13a)],_0x10ba18[_0x2822be(0x14e)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x2822be(0x14a),{'roleId':_0x10ba18[_0x2822be(0x13c)]['id'],'userId':_0x10ba18['userId']},_0x10ba18[_0x2822be(0x146)],_0x10ba18[_0x2822be(0x136)],{'method':_0x2822be(0x13d),'path':_0x2822be(0x134)},_0x10ba18[_0x2822be(0x14b)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x41d7(_0xa42729,_0x42422e){_0xa42729=_0xa42729-0x1b1;const _0x466c3c=a56_0x466c();let _0x41d74a=_0x466c3c[_0xa42729];return _0x41d74a;}const a56_0x4fc5a1=a56_0x41d7;(function(_0xa1415f,_0x114bed){const _0x83fbff=a56_0x41d7,_0x34794a=_0xa1415f();while(!![]){try{const _0x41def7=parseInt(_0x83fbff(0x1c4))/0x1+-parseInt(_0x83fbff(0x1b7))/0x2+-parseInt(_0x83fbff(0x1c6))/0x3+parseInt(_0x83fbff(0x1bb))/0x4*(-parseInt(_0x83fbff(0x1ba))/0x5)+parseInt(_0x83fbff(0x1c2))/0x6*(parseInt(_0x83fbff(0x1c1))/0x7)+parseInt(_0x83fbff(0x1b9))/0x8*(parseInt(_0x83fbff(0x1c3))/0x9)+-parseInt(_0x83fbff(0x1b2))/0xa*(-parseInt(_0x83fbff(0x1b4))/0xb);if(_0x41def7===_0x114bed)break;else _0x34794a['push'](_0x34794a['shift']());}catch(_0x5f445c){_0x34794a['push'](_0x34794a['shift']());}}}(a56_0x466c,0x62a44));import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':a56_0x4fc5a1(0x1b5),'command':a56_0x4fc5a1(0x1b1),'description':a56_0x4fc5a1(0x1bc),'risk':a56_0x4fc5a1(0x1b8),'confirmationDescription':'把指定运行用户移出目标角色;该用户将失去仅由该角色授予的运行权限。','flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x1c8bbe){const _0x164b6a=a56_0x4fc5a1,_0x3cc0eb=await prepareRuntimeMemberMutation(_0x1c8bbe,_0x164b6a(0x1b1));return dryRun(_0x164b6a(0x1be),_0x164b6a(0x1c5))[_0x164b6a(0x1b6)]({'appCode':_0x1c8bbe[_0x164b6a(0x1b3)],'roleList':_0x3cc0eb[_0x164b6a(0x1bd)]})['description'](_0x3cc0eb[_0x164b6a(0x1c0)]?'Preview:\x20remove\x20runtime\x20role\x20member':_0x3cc0eb[_0x164b6a(0x1bf)][0x0])['build']();},async 'execute'(_0x3e2167){const _0x3ac865=a56_0x4fc5a1,_0x5b5f93=await prepareRuntimeMemberMutation(_0x3e2167,'user-remove');return _0x5b5f93[_0x3ac865(0x1c0)]&&await updateRuntimeRoleUsers(_0x3e2167[_0x3ac865(0x1b3)],_0x5b5f93[_0x3ac865(0x1bd)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x3ac865(0x1b1),{'roleId':_0x5b5f93[_0x3ac865(0x1b5)]['id'],'userId':_0x5b5f93['userId']},_0x5b5f93['before'],_0x5b5f93['after'],{'method':'POST','path':_0x3ac865(0x1c5)},_0x5b5f93[_0x3ac865(0x1bf)])};}};function a56_0x466c(){const _0x412bf1=['1100786jHpymF','high-risk-write','1603024lsfMya','10FZEmDJ','816580fnnxpe','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','roleList','POST','warnings','shouldWrite','112168BhimsL','12bXTiVv','9PyiDvO','535745miCmOG','/client/permit/user-role/update-user-list','421074JGbawm','user-remove','20NWBRWZ','appCode','4041983kONvdf','role','body'];a56_0x466c=function(){return _0x412bf1;};return a56_0x466c();}
|