@lovrabet/lovrabet-cli 2.2.6 → 2.2.7-beta.1
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
|
-
|
|
1
|
+
const a43_0x112302=a43_0x34ce;(function(_0x3a963d,_0x564fbe){const _0x3f1992=a43_0x34ce,_0x53cd4b=_0x3a963d();while(!![]){try{const _0x558c63=-parseInt(_0x3f1992(0x127))/0x1*(-parseInt(_0x3f1992(0x115))/0x2)+parseInt(_0x3f1992(0x134))/0x3*(parseInt(_0x3f1992(0x13c))/0x4)+parseInt(_0x3f1992(0x13f))/0x5*(-parseInt(_0x3f1992(0x13e))/0x6)+-parseInt(_0x3f1992(0x131))/0x7*(-parseInt(_0x3f1992(0x11f))/0x8)+-parseInt(_0x3f1992(0x11d))/0x9*(parseInt(_0x3f1992(0x143))/0xa)+parseInt(_0x3f1992(0x13d))/0xb+parseInt(_0x3f1992(0x123))/0xc*(-parseInt(_0x3f1992(0x116))/0xd);if(_0x558c63===_0x564fbe)break;else _0x53cd4b['push'](_0x53cd4b['shift']());}catch(_0x199c8c){_0x53cd4b['push'](_0x53cd4b['shift']());}}}(a43_0x2865,0xbad8a));import{listRuntimeMenuRolePermits,listRuntimePermitRoles,saveRuntimeMenuRolePermits}from'../../core/api-client.js';function a43_0x34ce(_0x4968f3,_0xe058af){_0x4968f3=_0x4968f3-0x111;const _0x286544=a43_0x2865();let _0x34ce2f=_0x286544[_0x4968f3];return _0x34ce2f;}import{CliErrors}from'../../errors.js';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_0x112302(0x11c),'type':a43_0x112302(0x141),'required':!![],'description':a43_0x112302(0x139)};async function prepare(_0x2c444e){const _0x307dfe=a43_0x112302;await assertRuntimePermissionManager(_0x2c444e[_0x307dfe(0x133)]);const _0x58408a=assertGrantOrRevoke(_0x2c444e[_0x307dfe(0x13a)](_0x307dfe(0x114)),_0x2c444e[_0x307dfe(0x13a)]('revoke')),_0x4f6eb8=await resolveRuntimeRoleRef(_0x2c444e['appCode'],_0x2c444e[_0x307dfe(0x138)](_0x307dfe(0x12a)));assertRuntimePermitRoleConfigurable(_0x4f6eb8);const _0x1f9707=[...new Set(splitRefs(_0x2c444e[_0x307dfe(0x138)](_0x307dfe(0x11c)),_0x307dfe(0x121))[_0x307dfe(0x132)](_0x41686c=>{const _0x3f536f=_0x307dfe,_0x2931ea=Number(_0x41686c);if(!/^\d+$/[_0x3f536f(0x136)](_0x41686c)||!Number['isSafeInteger'](_0x2931ea)||_0x2931ea<=0x0)throw CliErrors[_0x3f536f(0x13b)]('Invalid\x20runtime\x20menu\x20ID:\x20'+_0x41686c+'.');return _0x2931ea;}))],_0x3a488e=flattenRuntimeMenuRolePermits(await listRuntimeMenuRolePermits(_0x2c444e[_0x307dfe(0x133)])),_0x35295e=await listRuntimePermitRoles(_0x2c444e[_0x307dfe(0x133)]),_0x27eec2=[],_0x509300=[],_0x20eb19=[],_0x410296=[];for(const _0x46fa68 of _0x1f9707){const _0x7705e4=_0x3a488e[_0x307dfe(0x12b)](_0x42caaa=>_0x42caaa['id']===_0x46fa68);if(!_0x7705e4)throw CliErrors[_0x307dfe(0x13b)](_0x307dfe(0x122)+_0x46fa68+'\x20was\x20not\x20found.');const _0x410c96=applyRuntimeRolePermission(_0x7705e4['rolePermit'],_0x4f6eb8,_0x35295e,_0x58408a);_0x509300[_0x307dfe(0x125)]({'menuId':_0x46fa68,'rolePermit':_0x7705e4[_0x307dfe(0x137)]}),_0x20eb19['push']({'menuId':_0x46fa68,'rolePermit':_0x410c96[_0x307dfe(0x128)]});if(_0x410c96[_0x307dfe(0x119)])_0x27eec2[_0x307dfe(0x125)](menuPermitDto(_0x2c444e[_0x307dfe(0x133)],_0x7705e4,_0x410c96['roles']));else _0x410296[_0x307dfe(0x125)](_0x307dfe(0x122)+_0x46fa68+_0x307dfe(0x124)+_0x58408a+_0x307dfe(0x126)+_0x4f6eb8['id']+'.');}return{'operation':_0x58408a,'role':_0x4f6eb8,'menuIds':_0x1f9707,'permitList':_0x27eec2,'before':_0x509300,'after':_0x20eb19,'warnings':_0x410296};}function a43_0x2865(){const _0x5c937b=['push','\x20for\x20role\x20','52966PmTgIl','roles','permit','role','find','body','\x20selected\x20runtime\x20menus','permitList','before','build','6097021SdtUDx','map','appCode','13290seKWwQ','operation','test','rolePermit','str','Comma-separated\x20runtime\x20menu\x20IDs','bool','validation','1292INyShB','12443310xnZXJv','102NDWSCr','94935qNFwet','after','string','授予或收回目标角色对指定运行菜单的访问权限;变更会影响该角色用户的菜单可见性。','3560VLaCXr','/client/permit/resource/batch-save-menu','role-menus-set','Grant\x20or\x20revoke\x20selected\x20runtime\x20menus\x20for\x20one\x20role','length','grant','30tiJRKr','883051dUiVhc','description','high-risk-write','changed','revoke','menuIds','menus','24417QIZuew','POST','8EuxoOU','Preview:\x20','--menus','Runtime\x20menu\x20','384JixMhn','\x20already\x20reflects\x20'];a43_0x2865=function(){return _0x5c937b;};return a43_0x2865();}export const permitRoleMenusSet={'service':a43_0x112302(0x129),'command':a43_0x112302(0x111),'description':a43_0x112302(0x112),'risk':a43_0x112302(0x118),'confirmationDescription':a43_0x112302(0x142),'flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG],async 'validate'(_0x563233){const _0x43d46d=a43_0x112302;assertGrantOrRevoke(_0x563233[_0x43d46d(0x13a)](_0x43d46d(0x114)),_0x563233[_0x43d46d(0x13a)](_0x43d46d(0x11a)));},async 'dryRun'(_0x8bb313){const _0x31c298=a43_0x112302,_0x825e7=await prepare(_0x8bb313);return dryRun(_0x31c298(0x11e),_0x31c298(0x144))[_0x31c298(0x12c)]({'appCode':_0x8bb313[_0x31c298(0x133)],'permitList':_0x825e7[_0x31c298(0x12e)]})[_0x31c298(0x117)](_0x31c298(0x120)+_0x825e7[_0x31c298(0x135)]+_0x31c298(0x12d))[_0x31c298(0x130)]();},async 'execute'(_0x459fa4){const _0x9589a1=a43_0x112302,_0x35a56a=await prepare(_0x459fa4);return _0x35a56a[_0x9589a1(0x12e)][_0x9589a1(0x113)]>0x0&&await saveRuntimeMenuRolePermits(_0x459fa4[_0x9589a1(0x133)],_0x35a56a[_0x9589a1(0x12e)]),{'ok':!![],'data':runtimePermitWriteResult('menu-'+_0x35a56a[_0x9589a1(0x135)],{'roleId':_0x35a56a[_0x9589a1(0x12a)]['id'],'menuIds':_0x35a56a[_0x9589a1(0x11b)]},_0x35a56a[_0x9589a1(0x12f)],_0x35a56a[_0x9589a1(0x140)],{'method':_0x9589a1(0x11e),'path':_0x9589a1(0x144)},_0x35a56a['warnings'])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a44_0x1ad7(){const _0x15a0d2=['3402285HToInH','role','roleType','2151246EpfejL','role-menus','367888ayPdOA','read','12805210mFPdJb','appCode','Show\x20evaluated\x20runtime\x20menu\x20access\x20for\x20one\x20role','351YYOSHI','2VNCeAH','48967160AimYCl','76KLgsMG','1160489hAVYrf','permit','roleName','21moMfWP','435355FNYIUF'];a44_0x1ad7=function(){return _0x15a0d2;};return a44_0x1ad7();}const a44_0xcd2177=a44_0x1499;function a44_0x1499(_0x334856,_0x125cb7){_0x334856=_0x334856-0xda;const _0x1ad767=a44_0x1ad7();let _0x1499d0=_0x1ad767[_0x334856];return _0x1499d0;}(function(_0x50d9cd,_0x3fffc6){const _0x26183b=a44_0x1499,_0x1ce996=_0x50d9cd();while(!![]){try{const _0x3d258f=parseInt(_0x26183b(0xe4))/0x1+parseInt(_0x26183b(0xe1))/0x2*(parseInt(_0x26183b(0xe9))/0x3)+parseInt(_0x26183b(0xe3))/0x4*(-parseInt(_0x26183b(0xe8))/0x5)+parseInt(_0x26183b(0xec))/0x6*(-parseInt(_0x26183b(0xe7))/0x7)+parseInt(_0x26183b(0xdb))/0x8*(-parseInt(_0x26183b(0xe0))/0x9)+-parseInt(_0x26183b(0xdd))/0xa+parseInt(_0x26183b(0xe2))/0xb;if(_0x3d258f===_0x3fffc6)break;else _0x1ce996['push'](_0x1ce996['shift']());}catch(_0x2579b5){_0x1ce996['push'](_0x1ce996['shift']());}}}(a44_0x1ad7,0xe6075));import{getRuntimeRoleMenuResources}from'../../core/api-client.js';import{resolveRuntimeRoleRef}from'../../commands/role/shared.js';import{ROLE_REF_FLAG}from'../../commands/permit/shared.js';export const permitRoleMenus={'service':a44_0xcd2177(0xe5),'command':a44_0xcd2177(0xda),'description':a44_0xcd2177(0xdf),'risk':a44_0xcd2177(0xdc),'flags':[ROLE_REF_FLAG],async 'execute'(_0x11e7d5){const _0x2eea65=a44_0xcd2177,_0x1db6ef=await resolveRuntimeRoleRef(_0x11e7d5[_0x2eea65(0xde)],_0x11e7d5['str'](_0x2eea65(0xea))),_0x35c9df=await getRuntimeRoleMenuResources(_0x11e7d5[_0x2eea65(0xde)],_0x1db6ef['id']);return{'ok':!![],'data':{'scope':'runtime','role':{'id':_0x1db6ef['id'],'roleName':_0x1db6ef[_0x2eea65(0xe6)],'roleType':_0x1db6ef[_0x2eea65(0xeb)]},'menus':_0x35c9df}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x545b67=a45_0x3010;(function(_0x4e411d,_0x482de1){const _0x28ef38=a45_0x3010,_0x322c0b=_0x4e411d();while(!![]){try{const _0x50d8e9=-parseInt(_0x28ef38(0xd6))/0x1*(-parseInt(_0x28ef38(0xd3))/0x2)+parseInt(_0x28ef38(0xc4))/0x3+-parseInt(_0x28ef38(0xa6))/0x4+-parseInt(_0x28ef38(0xa4))/0x5+parseInt(_0x28ef38(0x93))/0x6*(-parseInt(_0x28ef38(0xb9))/0x7)+parseInt(_0x28ef38(0xcc))/0x8*(parseInt(_0x28ef38(0xb0))/0x9)+parseInt(_0x28ef38(0x97))/0xa*(parseInt(_0x28ef38(0xa0))/0xb);if(_0x50d8e9===_0x482de1)break;else _0x322c0b['push'](_0x322c0b['shift']());}catch(_0x3f2eef){_0x322c0b['push'](_0x322c0b['shift']());}}}(a45_0x3a85,0xe6c23));import{getLoginUserInfo,listRuntimePermitRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':a45_0x545b67(0xb1),'required':!![],'description':a45_0x545b67(0xa8)};export const ROLE_REF_FLAG={'name':a45_0x545b67(0xd1),'type':'string','required':!![],'description':a45_0x545b67(0xac)};export const GRANT_FLAG={'name':'grant','type':a45_0x545b67(0x95),'description':a45_0x545b67(0xd7)};export const REVOKE_FLAG={'name':'revoke','type':a45_0x545b67(0x95),'description':a45_0x545b67(0x9c)};export const PAGE_SLOT_SPECS=[{'flag':a45_0x545b67(0xcb),'key':a45_0x545b67(0xc1),'allowSelf':![]},{'flag':a45_0x545b67(0x9b),'key':a45_0x545b67(0x9f),'allowSelf':![]},{'flag':a45_0x545b67(0xd8),'key':'dataUpdate','allowSelf':![]},{'flag':a45_0x545b67(0x9a),'key':a45_0x545b67(0x99),'allowSelf':![]},{'flag':a45_0x545b67(0x96),'key':a45_0x545b67(0xc0),'allowSelf':![]},{'flag':a45_0x545b67(0xd9),'key':'dataExport','allowSelf':![]},{'flag':'row-roles','key':'dataPermit','allowSelf':!![]}];export const PAGE_ROLE_FLAGS=PAGE_SLOT_SPECS[a45_0x545b67(0xaa)](_0x31d714=>({'name':_0x31d714[a45_0x545b67(0xd2)],'type':a45_0x545b67(0xc8),'description':'Comma-separated\x20runtime\x20role\x20IDs\x20or\x20names'}));export function splitRefs(_0x2a8126,_0x4914f9){const _0x5133aa=a45_0x545b67,_0x3ccf91=[...new Set(_0x2a8126[_0x5133aa(0xbe)](',')[_0x5133aa(0xaa)](_0x4b6830=>_0x4b6830[_0x5133aa(0xa7)]())[_0x5133aa(0xc5)](Boolean))];if(_0x3ccf91[_0x5133aa(0xb3)]===0x0)throw CliErrors[_0x5133aa(0xbd)](_0x4914f9+_0x5133aa(0xd4));return _0x3ccf91;}export function assertGrantOrRevoke(_0x52112e,_0x6b5ccb){const _0x2d4f97=a45_0x545b67;if(_0x52112e===_0x6b5ccb)throw CliErrors[_0x2d4f97(0xbd)](_0x2d4f97(0xdd));return _0x52112e?_0x2d4f97(0xcd):'revoke';}function resolvePermitRole(_0x2514dc,_0x382e44){const _0x2ec144=a45_0x545b67,_0x17fe89=_0x382e44[_0x2ec144(0xa7)](),_0x447e09=/^-?\d+$/['test'](_0x17fe89)?_0x2514dc[_0x2ec144(0xc5)](_0x2aabd7=>_0x2aabd7['id']===Number(_0x17fe89)):_0x2514dc[_0x2ec144(0xc5)](_0x51da49=>_0x51da49[_0x2ec144(0xaf)]===_0x17fe89||_0x51da49[_0x2ec144(0xbf)]===_0x17fe89[_0x2ec144(0xd0)]());if(_0x447e09[_0x2ec144(0xb3)]!==0x1)throw CliErrors['validation'](_0x447e09['length']===0x0?_0x2ec144(0xc2)+_0x17fe89+_0x2ec144(0xce):_0x2ec144(0xc2)+_0x17fe89+_0x2ec144(0xca),_0x2ec144(0x94));return _0x447e09[0x0];}export async function resolveRuntimePermitRoles(_0x52bf3d,_0x1629b1,_0x1615d0){const _0x1431ac=a45_0x545b67,_0x66613c=await listRuntimePermitRoles(_0x52bf3d,{'needSelf':!![],'needPublic':!![]}),_0x54d439=[...new Map(_0x1629b1[_0x1431ac(0xaa)](_0x308447=>resolvePermitRole(_0x66613c,_0x308447))[_0x1431ac(0xaa)](_0x4a1322=>[_0x4a1322['id'],_0x4a1322]))['values']()],_0x158a5b=_0x54d439[_0x1431ac(0xb2)](_0x3636c5=>_0x3636c5[_0x1431ac(0xbf)]===_0x1431ac(0xa9)||_0x3636c5[_0x1431ac(0xbf)]===_0x1431ac(0xc3));if(_0x158a5b)throw CliErrors[_0x1431ac(0xbd)](_0x158a5b['roleType']+_0x1431ac(0xad),'Configure\x20USER,\x20CUSTOM,\x20or\x20an\x20applicable\x20special\x20role\x20instead.');if(!_0x1615d0&&_0x54d439['some'](_0x18a7b1=>_0x18a7b1['roleType']===_0x1431ac(0xa3)))throw CliErrors[_0x1431ac(0xbd)](_0x1431ac(0xdc));return _0x54d439;}export async function assertRuntimePermissionManager(_0x276cde){const _0x5ec757=a45_0x545b67,_0x3dd3e4=await getLoginUserInfo(),_0x34c686=_0x3dd3e4[_0x5ec757(0xa1)]??_0x3dd3e4['id'],_0x47d104=Number(_0x34c686);if(!Number[_0x5ec757(0xb5)](_0x47d104)||_0x47d104<=0x0)throw CliErrors['validation'](_0x5ec757(0x98));const _0x32be8e=await listRuntimeRoleUsers(_0x276cde),_0x2c3000=_0x32be8e[_0x5ec757(0xda)](_0x5bc06e=>(_0x5bc06e[_0x5ec757(0xbf)]===_0x5ec757(0xa9)||_0x5bc06e['roleType']===_0x5ec757(0xc3))&&_0x5bc06e['userList'][_0x5ec757(0xda)](_0x122d56=>_0x122d56[_0x5ec757(0xa1)]===_0x47d104));if(!_0x2c3000)throw CliErrors[_0x5ec757(0xbd)]('Runtime\x20resource\x20permission\x20changes\x20require\x20an\x20ADMIN\x20or\x20OWNER\x20role.',_0x5ec757(0xa5));}export function assertRuntimePermitRoleConfigurable(_0x1bea3f){const _0x3a0f36=a45_0x545b67;if(_0x1bea3f[_0x3a0f36(0xbf)]==='ADMIN'||_0x1bea3f[_0x3a0f36(0xbf)]===_0x3a0f36(0xc3))throw CliErrors[_0x3a0f36(0xbd)](_0x3a0f36(0xbb)+_0x1bea3f[_0x3a0f36(0xbf)]+_0x3a0f36(0xbc)+_0x1bea3f[_0x3a0f36(0xaf)]+'.',_0x3a0f36(0x9d));}function asPermitRole(_0x128b52){const _0x15e2ea=a45_0x545b67;return{'id':_0x128b52['id'],'roleName':_0x128b52[_0x15e2ea(0xaf)],'roleType':_0x128b52['roleType'],'allowed':!![]};}export function applyRuntimeRolePermission(_0x3ac49a,_0x2cfc89,_0x16ce9a,_0x307eaf){const _0x401a78=a45_0x545b67,_0x564b98=!_0x3ac49a||_0x3ac49a[_0x401a78(0xb3)]===0x0,_0x42c468=_0x3ac49a?.[_0x401a78(0xda)](_0x1003c7=>_0x1003c7['roleType']===_0x401a78(0xb7))??![];if(_0x307eaf===_0x401a78(0xcd)&&(_0x564b98||_0x42c468))return{'roles':_0x3ac49a??null,'changed':![]};let _0x2b8ab7=_0x564b98||_0x42c468?_0x16ce9a[_0x401a78(0xc5)](_0x5827d4=>_0x5827d4['id']>0x0):[..._0x3ac49a];const _0x1543b9=_0x2b8ab7['some'](_0x5e3cc0=>_0x5e3cc0['id']===_0x2cfc89['id']);if(_0x307eaf===_0x401a78(0xcd)){if(_0x1543b9)return{'roles':_0x2b8ab7,'changed':![]};return _0x2b8ab7[_0x401a78(0xde)](asPermitRole(_0x2cfc89)),{'roles':_0x2b8ab7,'changed':!![]};}if(!_0x1543b9)return{'roles':_0x2b8ab7,'changed':_0x564b98||_0x42c468};_0x2b8ab7=_0x2b8ab7[_0x401a78(0xc5)](_0x4dbde0=>_0x4dbde0['id']!==_0x2cfc89['id']);if(_0x2b8ab7[_0x401a78(0xb3)]===0x0)throw CliErrors[_0x401a78(0xbd)](_0x401a78(0xd5),_0x401a78(0xae));return{'roles':_0x2b8ab7,'changed':!![]};}function a45_0x3a85(){const _0x4d515b=['roleType','dataDetail','menuPermit','Permission\x20role\x20\x22','OWNER','624705loBmto','filter','permitId','menuId','string','resourceType','\x22\x20is\x20ambiguous.','menu-roles','2955464OpkkZI','grant','\x22\x20was\x20not\x20found.','pageId','toUpperCase','role','flag','135742DoZVjs','\x20must\x20contain\x20at\x20least\x20one\x20value.','Cannot\x20revoke\x20the\x20last\x20role\x20from\x20a\x20runtime\x20resource.','1mmMCkc','Grant\x20the\x20selected\x20resources\x20to\x20the\x20role','update-roles','export-roles','some','key','SELF\x20is\x20only\x20valid\x20for\x20--row-roles.','Pass\x20exactly\x20one\x20of\x20--grant\x20or\x20--revoke.','push','5241408yGjUlC','Use\x20a\x20role\x20ID\x20from\x20`lovrabet\x20role\x20list`.','boolean','detail-roles','1501490iUgSCs','Cannot\x20resolve\x20the\x20current\x20AK\x20userId\x20for\x20permission\x20management.','dataDelete','delete-roles','create-roles','Revoke\x20the\x20selected\x20resources\x20from\x20the\x20role','ADMIN\x20and\x20OWNER\x20have\x20full\x20runtime\x20access;\x20configure\x20USER\x20or\x20CUSTOM\x20instead.','appCode','dataCreate','77lvXOXc','userId','runtime','SELF','358020fDvWyo','Ask\x20an\x20application\x20manager\x20to\x20perform\x20this\x20operation.','3658088YNwrCC','trim','Runtime\x20menu\x20ID','ADMIN','map','datasetCode','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','\x20has\x20full\x20runtime\x20access\x20and\x20cannot\x20be\x20a\x20resource\x20permission\x20target.','The\x20current\x20service\x20contract\x20does\x20not\x20persist\x20an\x20empty\x20rolePermit;\x20grant\x20another\x20role\x20first.','roleName','36CaIobm','number','find','length','label','isSafeInteger','resourceCode','ALL','MENU','7vCZnAy','rolePermit','Cannot\x20change\x20resource\x20permissions\x20for\x20','\x20runtime\x20role\x20','validation','split'];a45_0x3a85=function(){return _0x4d515b;};return a45_0x3a85();}function a45_0x3010(_0x2c5943,_0x3c96c6){_0x2c5943=_0x2c5943-0x93;const _0x3a8554=a45_0x3a85();let _0x3010db=_0x3a8554[_0x2c5943];return _0x3010db;}export function projectRuntimePagePermit(_0x1913e4){const _0x4ba969=a45_0x545b67,_0x551a58={'menuId':_0x1913e4[_0x4ba969(0xc7)],'pageId':_0x1913e4[_0x4ba969(0xcf)],'appCode':_0x1913e4[_0x4ba969(0x9e)],'datasetCode':_0x1913e4[_0x4ba969(0xab)]};for(const _0x492945 of PAGE_SLOT_SPECS){const _0x3be8aa=_0x1913e4[_0x492945[_0x4ba969(0xdb)]];_0x3be8aa&&(_0x551a58[_0x492945[_0x4ba969(0xdb)]]={'resourceCode':_0x3be8aa[_0x4ba969(0xb6)],'resourceType':_0x3be8aa[_0x4ba969(0xc9)],'roles':(_0x3be8aa[_0x4ba969(0xba)]??[])[_0x4ba969(0xaa)](_0x1eac39=>({'id':_0x1eac39['id'],'roleName':_0x1eac39[_0x4ba969(0xaf)],'roleType':_0x1eac39[_0x4ba969(0xbf)]}))});}return _0x551a58;}export function flattenRuntimeMenuRolePermits(_0xadaa14){const _0x50494f=[],_0x4a6f5a=_0x2bc781=>{const _0x34120f=a45_0x3010;_0x50494f[_0x34120f(0xde)](_0x2bc781);for(const _0x38d0a0 of _0x2bc781['children']??[])_0x4a6f5a(_0x38d0a0);};for(const _0x3a1f30 of _0xadaa14)_0x4a6f5a(_0x3a1f30);return _0x50494f;}export function runtimePermitWriteResult(_0x234d75,_0x62659f,_0x284bf4,_0x2e5b3b,_0x113551,_0x89b64e=[]){const _0x17a0aa=a45_0x545b67;return{'operation':_0x234d75,'scope':_0x17a0aa(0xa2),'selector':_0x62659f,'before':_0x284bf4,'after':_0x2e5b3b,'dryRun':![],'backend':_0x113551,'warnings':_0x89b64e};}export function menuPermitDto(_0x273d78,_0x5b8948,_0x31738c){const _0x30539c=a45_0x545b67;return{..._0x5b8948[_0x30539c(0xc6)]!=null?{'id':_0x5b8948[_0x30539c(0xc6)]}:{},'appCode':_0x273d78,'menuId':_0x5b8948['id'],'pageId':_0x5b8948['pageId']??null,'resourceCode':String(_0x5b8948['id']),'resourceType':_0x30539c(0xb8),'resourceName':_0x5b8948[_0x30539c(0xb4)],'rolePermit':_0x31738c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x5344f0=a46_0x1b7b;(function(_0x3bd737,_0x3958d1){const _0xec616=a46_0x1b7b,_0x38b8a=_0x3bd737();while(!![]){try{const _0x408031=parseInt(_0xec616(0x158))/0x1*(parseInt(_0xec616(0x161))/0x2)+-parseInt(_0xec616(0x155))/0x3*(-parseInt(_0xec616(0x14e))/0x4)+-parseInt(_0xec616(0x17b))/0x5*(-parseInt(_0xec616(0x16c))/0x6)+parseInt(_0xec616(0x176))/0x7*(-parseInt(_0xec616(0x14b))/0x8)+-parseInt(_0xec616(0x171))/0x9+-parseInt(_0xec616(0x140))/0xa+parseInt(_0xec616(0x14c))/0xb;if(_0x408031===_0x3958d1)break;else _0x38b8a['push'](_0x38b8a['shift']());}catch(_0x1107f6){_0x38b8a['push'](_0x38b8a['shift']());}}}(a46_0x22f4,0x61184));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_0x5344f0(0x17f),'type':a46_0x5344f0(0x14f),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':a46_0x5344f0(0x14f),'required':!![],'description':a46_0x5344f0(0x145)},DESCRIPTION_FLAG={'name':a46_0x5344f0(0x153),'type':a46_0x5344f0(0x14f),'description':'Personal\x20Backend\x20Function\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a46_0x5344f0(0x14f),'description':a46_0x5344f0(0x17c)};function normalizeFunctionName(_0x4cc67f){const _0x230860=a46_0x5344f0,_0x336848=String(_0x4cc67f||'')[_0x230860(0x14a)]();if(!_0x336848||!FUNCTION_NAME_PATTERN[_0x230860(0x17a)](_0x336848))throw CliErrors[_0x230860(0x154)](_0x230860(0x148));return _0x336848;}function readScriptFile(_0x399839){const _0x5c249e=a46_0x5344f0;if(!_0x399839)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x399839))throw CliErrors['validation'](_0x5c249e(0x16e)+_0x399839);if(!statSync(_0x399839)[_0x5c249e(0x17e)]())throw CliErrors[_0x5c249e(0x154)](_0x5c249e(0x164)+_0x399839);const _0x19cb11=readFileSync(_0x399839,'utf8');if(!_0x19cb11[_0x5c249e(0x14a)]())throw CliErrors[_0x5c249e(0x154)]('Personal\x20Backend\x20Function\x20script\x20file\x20is\x20blank.');return _0x19cb11;}function optionalTrimmed(_0x21f1d2){const _0x2a7ce0=a46_0x5344f0,_0x5cc788=String(_0x21f1d2||'')[_0x2a7ce0(0x14a)]();return _0x5cc788||undefined;}function summarizeBff(_0x27cbf7){const _0x41f46f=a46_0x5344f0;return{'id':_0x27cbf7['id'],'appCode':_0x27cbf7[_0x41f46f(0x175)],'functionName':_0x27cbf7['functionName'],'description':_0x27cbf7[_0x41f46f(0x153)],'scriptType':_0x27cbf7[_0x41f46f(0x157)],'version':_0x27cbf7[_0x41f46f(0x17d)],'gmtModified':_0x27cbf7['gmtModified'],'updateTime':_0x27cbf7[_0x41f46f(0x147)]};}function detailBff(_0x525b5e){const _0x103b7f=a46_0x5344f0;return{'id':_0x525b5e['id'],'appCode':_0x525b5e[_0x103b7f(0x175)],'functionName':_0x525b5e[_0x103b7f(0x15f)],'description':_0x525b5e[_0x103b7f(0x153)],'scriptType':_0x525b5e[_0x103b7f(0x157)],'scriptContent':_0x525b5e[_0x103b7f(0x14d)]??'','config':_0x525b5e['config'],'version':_0x525b5e[_0x103b7f(0x17d)],'createUserId':_0x525b5e[_0x103b7f(0x146)],'gmtCreate':_0x525b5e[_0x103b7f(0x16d)],'gmtModified':_0x525b5e[_0x103b7f(0x170)],'createTime':_0x525b5e['createTime'],'updateTime':_0x525b5e[_0x103b7f(0x147)]};}function buildCreateInput(_0x4f68f2){const _0x46f027=a46_0x5344f0;return{'functionName':normalizeFunctionName(_0x4f68f2[_0x46f027(0x15d)]('name')),...optionalTrimmed(_0x4f68f2[_0x46f027(0x15d)]('description'))?{'description':optionalTrimmed(_0x4f68f2['str'](_0x46f027(0x153)))}:{},'scriptContent':readScriptFile(_0x4f68f2[_0x46f027(0x15d)](_0x46f027(0x17f))),...optionalTrimmed(_0x4f68f2['str'](_0x46f027(0x144)))?{'sourceSessionId':optionalTrimmed(_0x4f68f2[_0x46f027(0x15d)](_0x46f027(0x144)))}:{}};}function buildUpdateInput(_0x2ddf02){const _0x2fcbac=a46_0x5344f0,_0xea5e99={};optionalTrimmed(_0x2ddf02[_0x2fcbac(0x15d)](_0x2fcbac(0x141)))&&(_0xea5e99[_0x2fcbac(0x15f)]=normalizeFunctionName(_0x2ddf02[_0x2fcbac(0x15d)](_0x2fcbac(0x141))));_0x2ddf02['flag']('description')!==undefined&&(_0xea5e99[_0x2fcbac(0x153)]=_0x2ddf02['str'](_0x2fcbac(0x153)));optionalTrimmed(_0x2ddf02[_0x2fcbac(0x15d)](_0x2fcbac(0x17f)))&&(_0xea5e99['scriptContent']=readScriptFile(_0x2ddf02['str'](_0x2fcbac(0x17f))));_0x2ddf02[_0x2fcbac(0x143)](_0x2fcbac(0x144))!==undefined&&(_0xea5e99[_0x2fcbac(0x16a)]=_0x2ddf02[_0x2fcbac(0x15d)](_0x2fcbac(0x144)));if(Object[_0x2fcbac(0x151)](_0xea5e99)[_0x2fcbac(0x172)]===0x0)throw CliErrors[_0x2fcbac(0x154)](_0x2fcbac(0x166));return _0xea5e99;}function a46_0x1b7b(_0x1ae062,_0x11176d){_0x1ae062=_0x1ae062-0x13f;const _0x22f47b=a46_0x22f4();let _0x1b7bc3=_0x22f47b[_0x1ae062];return _0x1b7bc3;}function parseExecParams(_0x4f8daa){const _0x489a83=a46_0x5344f0,_0x4f99ff=parseJsonParams(_0x4f8daa)??{};if(Array[_0x489a83(0x142)](_0x4f99ff))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x4f99ff;}const personalBffList={'service':a46_0x5344f0(0x159),'command':'list','description':a46_0x5344f0(0x150),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x514d0a){const _0x42ada6=a46_0x5344f0,_0x13fc1f=await listPersonalBffs(_0x514d0a[_0x42ada6(0x175)]);return{'ok':!![],'data':{'total':_0x13fc1f[_0x42ada6(0x172)],'items':_0x514d0a[_0x42ada6(0x15b)](_0x42ada6(0x174))?_0x13fc1f:_0x13fc1f['map'](summarizeBff)}};}},personalBffDetail={'service':a46_0x5344f0(0x159),'command':a46_0x5344f0(0x177),'description':a46_0x5344f0(0x152),'risk':a46_0x5344f0(0x178),'flags':[{...ID_FLAG,'description':a46_0x5344f0(0x179)}],async 'execute'(_0xb7dfc7){const _0x1ddc6d=a46_0x5344f0,_0x2d8035=await getPersonalBff(_0xb7dfc7[_0x1ddc6d(0x13f)]('id'),_0xb7dfc7['appCode']);return{'ok':!![],'data':detailBff(_0x2d8035)};}},personalBffCreate={'service':a46_0x5344f0(0x159),'command':'create','description':a46_0x5344f0(0x169),'risk':'write','confirmationDescription':a46_0x5344f0(0x160),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x485fc6){const _0x22dbd5=a46_0x5344f0,_0x53c294=buildCreateInput(_0x485fc6),_0x127cfc=await createPersonalBff(_0x485fc6[_0x22dbd5(0x175)],_0x53c294);return{'ok':!![],'data':detailBff(_0x127cfc),'message':_0x22dbd5(0x168)+_0x127cfc['id']+(_0x127cfc[_0x22dbd5(0x15f)]?'\x20('+_0x127cfc[_0x22dbd5(0x15f)]+')':'')};},async 'dryRun'(_0x35fafe){const _0x4ce073=a46_0x5344f0,_0x26ef24=buildCreateInput(_0x35fafe);return dryRun(_0x4ce073(0x15e),_0x4ce073(0x149))[_0x4ce073(0x173)]({'appCode':_0x35fafe['appCode'],..._0x26ef24})[_0x4ce073(0x153)]('Preview:\x20create\x20Personal\x20Backend\x20Function\x20'+_0x26ef24[_0x4ce073(0x15f)])[_0x4ce073(0x16b)]();}},personalBffUpdate={'service':'personal-bff','command':'update','description':'根据\x20ID\x20更新Personal\x20Backend\x20Function','risk':a46_0x5344f0(0x15a),'confirmationDescription':'更新Personal\x20Backend\x20Function\x20的脚本或元信息;之后的调用将使用新版本。','flags':[{...ID_FLAG,'description':a46_0x5344f0(0x179)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3ba9ec){const _0x40e4f5=a46_0x5344f0,_0x2cee0a=_0x3ba9ec[_0x40e4f5(0x13f)]('id'),_0x1342ed=buildUpdateInput(_0x3ba9ec),_0xa0bf24=await updatePersonalBff(_0x2cee0a,_0x3ba9ec['appCode'],_0x1342ed);return{'ok':!![],'data':detailBff(_0xa0bf24),'message':_0x40e4f5(0x15c)+_0xa0bf24['id']+(_0xa0bf24['functionName']?'\x20('+_0xa0bf24['functionName']+')':'')};},async 'dryRun'(_0xaafe5a){const _0x11cfe1=a46_0x5344f0,_0x43b856=_0xaafe5a[_0x11cfe1(0x13f)]('id'),_0x357e22=buildUpdateInput(_0xaafe5a);return dryRun(_0x11cfe1(0x15e),_0x11cfe1(0x162)+_0x43b856+'/update')[_0x11cfe1(0x173)]({'appCode':_0xaafe5a[_0x11cfe1(0x175)],..._0x357e22})['description']('Preview:\x20update\x20Personal\x20Backend\x20Function\x20'+_0x43b856)[_0x11cfe1(0x16b)]();}},personalBffExec={'service':a46_0x5344f0(0x159),'command':a46_0x5344f0(0x16f),'description':a46_0x5344f0(0x156),'risk':a46_0x5344f0(0x15a),'confirmationDescription':a46_0x5344f0(0x165),'flags':[{...ID_FLAG,'description':a46_0x5344f0(0x179)},{...PARAMS_FLAG,'description':a46_0x5344f0(0x163)}],async 'validate'(_0x568f6e){const _0x4ddce3=a46_0x5344f0;parseExecParams(_0x568f6e[_0x4ddce3(0x15d)](_0x4ddce3(0x167)));},async 'execute'(_0x2daa2c){const _0x3ef5f8=_0x2daa2c['num']('id'),_0x2dbcee=parseExecParams(_0x2daa2c['str']('params')),_0x36a7f8=await executePersonalBff(_0x3ef5f8,_0x2daa2c['appCode'],_0x2dbcee);return{'ok':!![],'data':{'result':_0x36a7f8},'message':'Executed\x20Personal\x20Backend\x20Function\x20'+_0x3ef5f8};}};function a46_0x22f4(){const _0x59a200=['build','581118lxKKFi','gmtCreate','File\x20not\x20found:\x20','exec','gmtModified','1397889KXvwES','length','body','verbose','appCode','5184746YYastV','detail','read','Personal\x20Backend\x20Function\x20script\x20ID','test','10VavAEd','Optional\x20source\x20RuntimeAgent\x20session\x20id','version','isFile','file','num','1202330acEnyY','name','isArray','flag','source-session-id','Personal\x20Backend\x20Function\x20name,\x20for\x20example\x20loadOrders','createUserId','updateTime','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','/client/runtime-bff/personal/create','trim','8kAqEBv','2370819jtuWbS','scriptContent','1416qTkCZe','string','List\x20current\x20user\x27s\x20Personal\x20Backend\x20Function\x20scripts\x20for\x20the\x20current\x20app','keys','Show\x20one\x20Personal\x20Backend\x20Function\x20by\x20id','description','validation','4827rJlruo','根据\x20ID\x20执行Personal\x20Backend\x20Function,并可传入\x20JSON\x20参数','scriptType','1OoILQj','personal-bff','write','bool','Updated\x20Personal\x20Backend\x20Function\x20','str','POST','functionName','把本地脚本保存为Personal\x20Backend\x20Function;之后可在当前应用中调用该脚本。','870222anFabv','/client/runtime-bff/personal/','JSON\x20object\x20passed\x20to\x20the\x20Personal\x20Backend\x20Function\x20execution','File\x20is\x20not\x20a\x20regular\x20file:\x20','执行Personal\x20Backend\x20Function\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','params','Created\x20Personal\x20Backend\x20Function\x20','根据本地脚本文件创建Personal\x20Backend\x20Function','sourceSessionId'];a46_0x22f4=function(){return _0x59a200;};return a46_0x22f4();}export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
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();}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x2261bf=a47_0x8534;(function(_0x1a4303,_0x5b2ff8){const _0x51df6e=a47_0x8534,_0x5823ba=_0x1a4303();while(!![]){try{const _0x3a633a=-parseInt(_0x51df6e(0x223))/0x1*(parseInt(_0x51df6e(0x22a))/0x2)+parseInt(_0x51df6e(0x1fa))/0x3*(-parseInt(_0x51df6e(0x1fd))/0x4)+parseInt(_0x51df6e(0x207))/0x5+parseInt(_0x51df6e(0x1f1))/0x6+parseInt(_0x51df6e(0x201))/0x7*(-parseInt(_0x51df6e(0x1ee))/0x8)+-parseInt(_0x51df6e(0x21f))/0x9*(parseInt(_0x51df6e(0x1f6))/0xa)+-parseInt(_0x51df6e(0x203))/0xb*(-parseInt(_0x51df6e(0x22c))/0xc);if(_0x3a633a===_0x5b2ff8)break;else _0x5823ba['push'](_0x5823ba['shift']());}catch(_0x26f40d){_0x5823ba['push'](_0x5823ba['shift']());}}}(a47_0x2c90,0xc088d));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';function a47_0x8534(_0x33a05a,_0x3f1d7b){_0x33a05a=_0x33a05a-0x1ee;const _0x2c9040=a47_0x2c90();let _0x85348d=_0x2c9040[_0x33a05a];return _0x85348d;}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();function a47_0x2c90(){const _0x3f3805=['read','12tZoSaF','logs\x20clear','8ZyxjGb','Runtime\x20Roles','values','4340652CqLeMN','write','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','User\x20Accounts','\x20\x20[write]','803630OgJMkx','push','app','defaultCommand','3462234leFtiC','API\x20Documentation','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','4AZVSko','Datasets','set','command','2612106siOdAc','install','4316257UqASAT','Notification\x20Configs','description','init','7303180xCZoqN','CLI\x20Built-in\x20Skill','Self\x20Update','service','Instant\x20API','`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','show','Backend\x20Function\x20Scripts','App\x20Management','\x20\x20[high-risk-write]','risk','File','login','Agent\x20Schedules','Runtime\x20Permissions','config-list','Workspace','isSingleCommand','Artifacts','get','Diagnostics','app\x20use','Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.','has','9kLpjSP','Logs','Runtime\x20App\x20Config','app\x20init','13865yFrrNw','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','from','list','Personal\x20Backend\x20Function','Knowledge\x20Base','use','26cDlKAg'];a47_0x2c90=function(){return _0x3f3805;};return a47_0x2c90();}export const serviceGroups=new Map();function registerDefinitions(_0x4da594){const _0x2def4a=a47_0x8534;for(const _0x12b87a of _0x4da594){definitions[_0x2def4a(0x1ff)](_0x12b87a['service']+':'+_0x12b87a['command'],_0x12b87a);let _0x1b1963=serviceGroups[_0x2def4a(0x21a)](_0x12b87a[_0x2def4a(0x20a)]);!_0x1b1963&&(_0x1b1963=[],serviceGroups['set'](_0x12b87a[_0x2def4a(0x20a)],_0x1b1963)),_0x1b1963[_0x2def4a(0x1f7)](_0x12b87a);}}function registerService(_0x56e36f,_0x60a597,_0x12de46){const _0x2888e6=a47_0x8534;registerDefinitions(_0x60a597);const _0x39c525=_0x19c847=>_0x19c847===_0x2888e6(0x22b)?'':_0x19c847===_0x2888e6(0x1f2)?_0x2888e6(0x1f5):_0x2888e6(0x210),_0x259de3={'service':_0x60a597[0x0]['service'],'label':_0x56e36f,'commands':_0x60a597['map'](_0x4fd7b2=>({'command':_0x4fd7b2[_0x2888e6(0x200)],'description':_0x4fd7b2[_0x2888e6(0x205)],'tag':_0x39c525(_0x4fd7b2[_0x2888e6(0x211)])})),'defaultCommand':_0x12de46?.[_0x2888e6(0x1f9)]??(_0x12de46?.['isSingleCommand']?_0x60a597[0x0][_0x2888e6(0x200)]:undefined),'isSingleCommand':_0x12de46?.[_0x2888e6(0x218)]};serviceRegistry[_0x2888e6(0x1f7)](_0x259de3),serviceByName[_0x2888e6(0x1ff)](_0x259de3[_0x2888e6(0x20a)],_0x259de3);}registerService('Authentication',authDefinitions,{'defaultCommand':a47_0x2261bf(0x213)}),registerService(a47_0x2261bf(0x1f4),userAccountDefinitions),registerService(a47_0x2261bf(0x20f),appDefinitions,{'defaultCommand':a47_0x2261bf(0x226)}),registerService(a47_0x2261bf(0x217),workspaceDefinitions),registerService(a47_0x2261bf(0x221),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a47_0x2261bf(0x226)}),registerService(a47_0x2261bf(0x1ef),roleDefinitions,{'defaultCommand':a47_0x2261bf(0x226)}),registerService(a47_0x2261bf(0x215),permitDefinitions),registerService(a47_0x2261bf(0x1fb),apiDocDefinitions),registerService(a47_0x2261bf(0x1fe),datasetDefinitions),registerService(a47_0x2261bf(0x20b),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a47_0x2261bf(0x20e),bffDefinitions),registerService(a47_0x2261bf(0x227),personalBffDefinitions),registerService(a47_0x2261bf(0x219),artifactDefinitions),registerService(a47_0x2261bf(0x212),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a47_0x2261bf(0x228),kbDefinitions),registerService(a47_0x2261bf(0x204),notificationDefinitions,{'defaultCommand':a47_0x2261bf(0x216)}),registerService(a47_0x2261bf(0x214),scheduleDefinitions,{'defaultCommand':'list'}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a47_0x2261bf(0x226)}),registerService('Skills',skillDefinitions,{'defaultCommand':a47_0x2261bf(0x202)}),registerService(a47_0x2261bf(0x208),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a47_0x2261bf(0x209),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a47_0x2261bf(0x21b),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a47_0x2261bf(0x220),logsDefinitions,{'defaultCommand':a47_0x2261bf(0x20d)});export function findDefinition(_0xd58ab1,_0xb0c2fb){const _0x4f01db=a47_0x2261bf;return definitions[_0x4f01db(0x21a)](_0xd58ab1+':'+_0xb0c2fb);}export function resolveRemovedCommand(_0x3544eb,_0x2ab679){const _0x57077f=a47_0x2261bf;if(_0x3544eb===_0x57077f(0x1f8)&&_0x2ab679===_0x57077f(0x206))return{'command':_0x57077f(0x222),'message':'`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','hint':_0x57077f(0x21d)};if(_0x3544eb===_0x57077f(0x1f8)&&_0x2ab679===_0x57077f(0x229))return{'command':_0x57077f(0x21c),'message':_0x57077f(0x1f3),'hint':_0x57077f(0x224)};if(_0x3544eb==='logs'&&_0x2ab679==='clear')return{'command':_0x57077f(0x22d),'message':_0x57077f(0x20c),'hint':_0x57077f(0x1fc)};return undefined;}export function isKnownService(_0x7b2e5e){const _0x1bf0a1=a47_0x2261bf;return serviceByName[_0x1bf0a1(0x21e)](_0x7b2e5e);}export function getServiceEntry(_0x46c558){const _0x29c97d=a47_0x2261bf;return serviceByName[_0x29c97d(0x21a)](_0x46c558);}export function getAllDefinitions(){const _0x5d727e=a47_0x2261bf;return Array[_0x5d727e(0x225)](definitions[_0x5d727e(0x1f0)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x3d642e=a48_0x471f;(function(_0x398dd7,_0x4f763e){const _0x1451e6=a48_0x471f,_0x514514=_0x398dd7();while(!![]){try{const _0xbb313e=parseInt(_0x1451e6(0x144))/0x1*(parseInt(_0x1451e6(0x13a))/0x2)+-parseInt(_0x1451e6(0x13b))/0x3+parseInt(_0x1451e6(0x13d))/0x4+parseInt(_0x1451e6(0x148))/0x5*(parseInt(_0x1451e6(0x154))/0x6)+parseInt(_0x1451e6(0x13e))/0x7*(-parseInt(_0x1451e6(0x155))/0x8)+parseInt(_0x1451e6(0x14b))/0x9*(-parseInt(_0x1451e6(0x142))/0xa)+parseInt(_0x1451e6(0x146))/0xb;if(_0xbb313e===_0x4f763e)break;else _0x514514['push'](_0x514514['shift']());}catch(_0x2b5383){_0x514514['push'](_0x514514['shift']());}}}(a48_0x3e0a,0x2b5f1));function a48_0x3e0a(){const _0x463ad3=['CUSTOM','Create\x20a\x20runtime\x20CUSTOM\x20role','5787IMdqHh','Role\x20name','POST','role','body','remark','string','--name\x20must\x20not\x20be\x20blank.','Preview:\x20create\x20a\x20runtime\x20CUSTOM\x20role','110178CYdHhv','9640pqAbOl','appCode','trim','build','874aPDOZp','765936EAhMnD','validation','772188InYTAo','1967TqDqSv','name','Optional\x20role\x20remark','create','1580ZbIIiw','high-risk-write','275EkIFuI','description','5149353AibzpX','/client/permit/role/create','25xiUwGd'];a48_0x3e0a=function(){return _0x463ad3;};return a48_0x3e0a();}function a48_0x471f(_0x49e9b4,_0x38d80c){_0x49e9b4=_0x49e9b4-0x13a;const _0x3e0a07=a48_0x3e0a();let _0x471ffa=_0x3e0a07[_0x49e9b4];return _0x471ffa;}import{createRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{projectRuntimeRole,runtimeRoleWriteResult}from'../../commands/role/shared.js';function input(_0x52a0c8){const _0x49fd25=a48_0x471f,_0x33e08e=_0x52a0c8['str']('name')[_0x49fd25(0x157)]();if(!_0x33e08e)throw CliErrors[_0x49fd25(0x13c)](_0x49fd25(0x152));const _0x5d561c=_0x52a0c8['str']('remark')[_0x49fd25(0x157)]();return{'appCode':_0x52a0c8[_0x49fd25(0x156)],'roleName':_0x33e08e,..._0x5d561c?{'remark':_0x5d561c}:{}};}export const roleCreate={'service':a48_0x3d642e(0x14e),'command':a48_0x3d642e(0x141),'description':a48_0x3d642e(0x14a),'risk':a48_0x3d642e(0x143),'confirmationDescription':'在当前运行应用中创建一个自定义角色;创建后可用于成员与资源权限配置。','flags':[{'name':a48_0x3d642e(0x13f),'type':a48_0x3d642e(0x151),'required':!![],'description':a48_0x3d642e(0x14c)},{'name':a48_0x3d642e(0x150),'type':'string','description':a48_0x3d642e(0x140)}],async 'validate'(_0x392f02){input(_0x392f02);},async 'dryRun'(_0x1c8ede){const _0x4e7ece=a48_0x3d642e;return dryRun(_0x4e7ece(0x14d),_0x4e7ece(0x147))[_0x4e7ece(0x14f)]({'roleType':_0x4e7ece(0x149),...input(_0x1c8ede)})[_0x4e7ece(0x145)](_0x4e7ece(0x153))[_0x4e7ece(0x158)]();},async 'execute'(_0x45b4b1){const _0x2ba4af=a48_0x3d642e,_0x1d15e6=await createRuntimeAppRole(input(_0x45b4b1));return{'ok':!![],'data':runtimeRoleWriteResult('create',{'roleId':_0x1d15e6['id']},null,projectRuntimeRole(_0x1d15e6),{'method':_0x2ba4af(0x14d),'path':_0x2ba4af(0x147)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x5539cf=a49_0x2b3e;(function(_0x3261e9,_0xc20174){const _0x12b401=a49_0x2b3e,_0x5ab33a=_0x3261e9();while(!![]){try{const _0x468640=parseInt(_0x12b401(0x1f1))/0x1*(parseInt(_0x12b401(0x1f3))/0x2)+-parseInt(_0x12b401(0x1f7))/0x3*(parseInt(_0x12b401(0x1f5))/0x4)+parseInt(_0x12b401(0x1e7))/0x5*(-parseInt(_0x12b401(0x1e3))/0x6)+parseInt(_0x12b401(0x1e6))/0x7+-parseInt(_0x12b401(0x1ed))/0x8+-parseInt(_0x12b401(0x1eb))/0x9+parseInt(_0x12b401(0x1e4))/0xa;if(_0x468640===_0xc20174)break;else _0x5ab33a['push'](_0x5ab33a['shift']());}catch(_0x320f73){_0x5ab33a['push'](_0x5ab33a['shift']());}}}(a49_0x4b87,0x72842));function a49_0x4b87(){const _0x438bd8=['/client/permit/role/delete','164414NXBoeV','Preview:\x20delete\x20a\x20runtime\x20CUSTOM\x20role','8GOMpoE','role','764406hCKWcU','78LDtcKZ','19458650NJWNJW','appCode','428750jtNqcX','57370HNIOWO','body','delete','description','6875910tuLVAJ','build','4868344mQDWwU','删除当前运行应用中的自定义角色;该角色的成员关系和权限配置可能随之失效。','Delete\x20a\x20runtime\x20CUSTOM\x20role','high-risk-write','6dUWaNa'];a49_0x4b87=function(){return _0x438bd8;};return a49_0x4b87();}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';async function prepare(_0x582a74){const _0x570d8f=a49_0x2b3e,_0x31c749=await getRuntimeRoleById(_0x582a74[_0x570d8f(0x1e5)],_0x582a74['num']('id'));return assertCustomRuntimeRole(_0x31c749,_0x570d8f(0x1e9)),_0x31c749;}function a49_0x2b3e(_0x2f6efb,_0xd76b49){_0x2f6efb=_0x2f6efb-0x1e3;const _0x4b87a4=a49_0x4b87();let _0x2b3e1e=_0x4b87a4[_0x2f6efb];return _0x2b3e1e;}export const roleDelete={'service':a49_0x5539cf(0x1f6),'command':a49_0x5539cf(0x1e9),'description':a49_0x5539cf(0x1ef),'risk':a49_0x5539cf(0x1f0),'confirmationDescription':a49_0x5539cf(0x1ee),'flags':[ROLE_ID_FLAG],async 'dryRun'(_0x29a585){const _0x2ae034=a49_0x5539cf,_0x4a730a=await prepare(_0x29a585);return dryRun('POST','/client/permit/role/delete')[_0x2ae034(0x1e8)]({'id':_0x4a730a['id']})[_0x2ae034(0x1ea)](_0x2ae034(0x1f4))[_0x2ae034(0x1ec)]();},async 'execute'(_0x2a4090){const _0x2dabd5=a49_0x5539cf,_0xcfa8b6=await prepare(_0x2a4090);return await deleteRuntimeAppRole(_0xcfa8b6['id']),{'ok':!![],'data':runtimeRoleWriteResult(_0x2dabd5(0x1e9),{'roleId':_0xcfa8b6['id']},projectRuntimeRole(_0xcfa8b6),null,{'method':'POST','path':_0x2dabd5(0x1f2)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a50_0x542e5b=a50_0x3337;function a50_0x3337(_0x3e5bb0,_0x331641){_0x3e5bb0=_0x3e5bb0-0x124;const _0x9991f2=a50_0x9991();let _0x3337bf=_0x9991f2[_0x3e5bb0];return _0x3337bf;}(function(_0x106a6e,_0x4eb4fd){const _0x4472ba=a50_0x3337,_0x5818fd=_0x106a6e();while(!![]){try{const _0x283dfd=parseInt(_0x4472ba(0x129))/0x1+parseInt(_0x4472ba(0x12b))/0x2+-parseInt(_0x4472ba(0x12d))/0x3*(parseInt(_0x4472ba(0x12e))/0x4)+parseInt(_0x4472ba(0x126))/0x5+-parseInt(_0x4472ba(0x12f))/0x6*(parseInt(_0x4472ba(0x12c))/0x7)+-parseInt(_0x4472ba(0x125))/0x8+parseInt(_0x4472ba(0x12a))/0x9;if(_0x283dfd===_0x4eb4fd)break;else _0x5818fd['push'](_0x5818fd['shift']());}catch(_0x46fb00){_0x5818fd['push'](_0x5818fd['shift']());}}}(a50_0x9991,0xbf932));import{getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG}from'../../commands/role/shared.js';export const roleDetail={'service':'role','command':a50_0x542e5b(0x128),'description':'Show\x20one\x20runtime\x20role\x20by\x20ID','risk':a50_0x542e5b(0x131),'flags':[ROLE_ID_FLAG],async 'execute'(_0x328ed0){const _0x5b9012=a50_0x542e5b,_0x51ccfc=await getRuntimeRoleById(_0x328ed0[_0x5b9012(0x130)],_0x328ed0[_0x5b9012(0x124)]('id'));return{'ok':!![],'data':{'scope':_0x5b9012(0x127),'role':projectRuntimeRole(_0x51ccfc)}};}};function a50_0x9991(){const _0x512030=['7497216YSvEGn','2540875PmXYsU','runtime','detail','1277564WAhrVX','12288762VrWdjX','207030njYlQj','3438694rkQEXr','96uYFbqu','7388ZBDhAA','18lzLMZP','appCode','read','num'];a50_0x9991=function(){return _0x512030;};return a50_0x9991();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50657e,_0x366c26){const _0x490d81=a51_0x3abc,_0x25e399=_0x50657e();while(!![]){try{const _0x1f4183=parseInt(_0x490d81(0x6f))/0x1+parseInt(_0x490d81(0x6e))/0x2+-parseInt(_0x490d81(0x71))/0x3+-parseInt(_0x490d81(0x73))/0x4+-parseInt(_0x490d81(0x6d))/0x5+parseInt(_0x490d81(0x6b))/0x6*(parseInt(_0x490d81(0x72))/0x7)+parseInt(_0x490d81(0x6c))/0x8*(parseInt(_0x490d81(0x70))/0x9);if(_0x1f4183===_0x366c26)break;else _0x25e399['push'](_0x25e399['shift']());}catch(_0x5707cd){_0x25e399['push'](_0x25e399['shift']());}}}(a51_0x3a41,0xa75af));import{roleList}from'../../commands/role/list.js';function a51_0x3a41(){const _0x2a6b57=['803803qvuFjP','3203164pyOepo','6bsyLso','760DaFeqZ','5218455MCoxWb','1105244AqTEcV','509611XwVGRq','244143PUzgPx','3672474VumipR'];a51_0x3a41=function(){return _0x2a6b57;};return a51_0x3a41();}import{roleDetail}from'../../commands/role/detail.js';function a51_0x3abc(_0x19b740,_0x18f59b){_0x19b740=_0x19b740-0x6b;const _0x3a41b3=a51_0x3a41();let _0x3abccb=_0x3a41b3[_0x19b740];return _0x3abccb;}import{roleCreate}from'../../commands/role/create.js';import{roleUpdate}from'../../commands/role/update.js';import{roleDelete}from'../../commands/role/delete.js';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_0x442876=a52_0x1e1d;function a52_0x1b3c(){const _0x1df24e=['--page\x20must\x20be\x20a\x20positive\x20integer.','number','11000yOGWAL','page','slice','Invalid\x20runtime\x20role\x20type:\x20','--pagesize\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','trim','215BxHqvw','13209130SqGxSy','runtime','string','pagesize','Page\x20number','read','Fuzzy\x20role-name\x20filter','4SvvNvz','61722lNNWAI','validation','num','appCode','name','List\x20runtime\x20roles\x20for\x20the\x20current\x20app','includes','750081PBDtAT','str','items','24stBniC','length','Page\x20size\x20from\x201\x20to\x20100','3375nVMMHr','isSafeInteger','3397232JzkyUl','paging','role','toUpperCase','map','Runtime\x20role\x20type','702683fhcosH','854959qOARtp','type'];a52_0x1b3c=function(){return _0x1df24e;};return a52_0x1b3c();}function a52_0x1e1d(_0x9b0a59,_0x4af2e0){_0x9b0a59=_0x9b0a59-0x138;const _0x1b3c3d=a52_0x1b3c();let _0x1e1db8=_0x1b3c3d[_0x9b0a59];return _0x1e1db8;}(function(_0x4cd0d1,_0x4ddabf){const _0x2ccaf5=a52_0x1e1d,_0x3a5615=_0x4cd0d1();while(!![]){try{const _0x2ea2b0=parseInt(_0x2ccaf5(0x138))/0x1+-parseInt(_0x2ccaf5(0x14b))/0x2*(-parseInt(_0x2ccaf5(0x153))/0x3)+parseInt(_0x2ccaf5(0x15b))/0x4+-parseInt(_0x2ccaf5(0x143))/0x5*(parseInt(_0x2ccaf5(0x14c))/0x6)+parseInt(_0x2ccaf5(0x139))/0x7*(-parseInt(_0x2ccaf5(0x156))/0x8)+parseInt(_0x2ccaf5(0x159))/0x9*(parseInt(_0x2ccaf5(0x13d))/0xa)+-parseInt(_0x2ccaf5(0x144))/0xb;if(_0x2ea2b0===_0x4ddabf)break;else _0x3a5615['push'](_0x3a5615['shift']());}catch(_0x3289a1){_0x3a5615['push'](_0x3a5615['shift']());}}}(a52_0x1b3c,0x6f133));import{listRuntimeAppRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{listAllRuntimeRoles,projectRuntimeRole,RUNTIME_ROLE_TYPES}from'../../commands/role/shared.js';export const roleList={'service':a52_0x442876(0x15d),'command':'list','description':a52_0x442876(0x151),'risk':a52_0x442876(0x149),'flags':[{'name':a52_0x442876(0x13a),'type':a52_0x442876(0x146),'enum':RUNTIME_ROLE_TYPES,'description':a52_0x442876(0x160)},{'name':a52_0x442876(0x150),'type':a52_0x442876(0x146),'description':a52_0x442876(0x14a)},{'name':'page','type':'number','default':0x1,'description':a52_0x442876(0x148)},{'name':'pagesize','type':a52_0x442876(0x13c),'default':0x64,'description':a52_0x442876(0x158)}],async 'validate'(_0x904689){const _0xe37785=a52_0x442876,_0x49b152=_0x904689['str'](_0xe37785(0x13a))[_0xe37785(0x15e)]();if(_0x49b152&&!RUNTIME_ROLE_TYPES[_0xe37785(0x152)](_0x49b152))throw CliErrors[_0xe37785(0x14d)](_0xe37785(0x140)+_0x49b152+'.');const _0x2b3578=_0x904689[_0xe37785(0x14e)](_0xe37785(0x13e),0x1),_0x18b5ad=_0x904689[_0xe37785(0x14e)]('pagesize',0x64);if(!Number['isSafeInteger'](_0x2b3578)||_0x2b3578<0x1)throw CliErrors[_0xe37785(0x14d)](_0xe37785(0x13b));if(!Number[_0xe37785(0x15a)](_0x18b5ad)||_0x18b5ad<0x1||_0x18b5ad>0x64)throw CliErrors[_0xe37785(0x14d)](_0xe37785(0x141));},async 'execute'(_0x3fe5be){const _0xd14371=a52_0x442876,_0x114236=_0x3fe5be[_0xd14371(0x154)](_0xd14371(0x13a))[_0xd14371(0x15e)](),_0x1473c7=_0x3fe5be[_0xd14371(0x154)](_0xd14371(0x150))[_0xd14371(0x142)](),_0x406124=_0x3fe5be[_0xd14371(0x14e)]('page',0x1),_0x191cfd=_0x3fe5be['num'](_0xd14371(0x147),0x64);if(_0x114236){const _0x5b724f=(await listAllRuntimeRoles(_0x3fe5be[_0xd14371(0x14f)],{..._0x1473c7?{'roleName':_0x1473c7}:{}}))['filter'](_0x4f3498=>_0x4f3498['roleType']===_0x114236),_0x5d4adc=(_0x406124-0x1)*_0x191cfd;return{'ok':!![],'data':{'scope':_0xd14371(0x145),'roles':_0x5b724f[_0xd14371(0x13f)](_0x5d4adc,_0x5d4adc+_0x191cfd)[_0xd14371(0x15f)](projectRuntimeRole),'paging':{'currentPage':_0x406124,'pageSize':_0x191cfd,'totalCount':_0x5b724f[_0xd14371(0x157)]}}};}const _0x355e39=await listRuntimeAppRoles(_0x3fe5be[_0xd14371(0x14f)],{..._0x1473c7?{'roleName':_0x1473c7}:{},'currentPage':_0x406124,'pageSize':_0x191cfd});return{'ok':!![],'data':{'scope':_0xd14371(0x145),'roles':_0x355e39[_0xd14371(0x155)][_0xd14371(0x15f)](projectRuntimeRole),'paging':_0x355e39[_0xd14371(0x15c)]}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a53_0x253511=a53_0x2432;(function(_0x5a3fe2,_0x14ce5b){const _0x4c85be=a53_0x2432,_0x5ce0f6=_0x5a3fe2();while(!![]){try{const _0x2ca9d5=-parseInt(_0x4c85be(0x1f3))/0x1+-parseInt(_0x4c85be(0x1d9))/0x2+parseInt(_0x4c85be(0x1d8))/0x3+parseInt(_0x4c85be(0x1ba))/0x4*(parseInt(_0x4c85be(0x1b9))/0x5)+-parseInt(_0x4c85be(0x1e1))/0x6+-parseInt(_0x4c85be(0x1c0))/0x7*(parseInt(_0x4c85be(0x1ae))/0x8)+parseInt(_0x4c85be(0x1c5))/0x9;if(_0x2ca9d5===_0x14ce5b)break;else _0x5ce0f6['push'](_0x5ce0f6['shift']());}catch(_0x48636b){_0x5ce0f6['push'](_0x5ce0f6['shift']());}}}(a53_0x4765,0x3d2eb));import{listRuntimeAppUsers,listRuntimeAppRoles,listRuntimeRoleUsers}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const RUNTIME_ROLE_TYPES=[a53_0x253511(0x1e9),a53_0x253511(0x1de),'OWNER',a53_0x253511(0x1b5)];const BUILTIN_ROLE_TYPES=[a53_0x253511(0x1e9),'USER',a53_0x253511(0x1ee)];export const ROLE_ID_FLAG={'name':'id','type':a53_0x253511(0x1da),'required':!![],'description':a53_0x253511(0x1c1)};export const ROLE_REF_FLAG={'name':a53_0x253511(0x1e3),'type':a53_0x253511(0x1e4),'required':!![],'description':a53_0x253511(0x1d7)};function a53_0x2432(_0x628e9b,_0x490ac3){_0x628e9b=_0x628e9b-0x1ad;const _0x47657a=a53_0x4765();let _0x243259=_0x47657a[_0x628e9b];return _0x243259;}export const USER_ID_FLAG={'name':a53_0x253511(0x1b7),'type':a53_0x253511(0x1e4),'required':!![],'description':a53_0x253511(0x1b8)};export const EXPECT_USER_COUNT_FLAG={'name':a53_0x253511(0x1e5),'type':'number','description':a53_0x253511(0x1c7)};export function isBuiltinRuntimeRole(_0x59cde9){return BUILTIN_ROLE_TYPES['includes'](_0x59cde9);}export function assertCustomRuntimeRole(_0x3042c0,_0xf0d8b6){const _0x165c30=a53_0x253511;if(_0x3042c0[_0x165c30(0x1b3)]!==_0x165c30(0x1b5))throw CliErrors['validation']('Cannot\x20'+_0xf0d8b6+'\x20built-in\x20runtime\x20role\x20'+_0x3042c0[_0x165c30(0x1f5)]+'\x20('+_0x3042c0['roleType']+').','Only\x20CUSTOM\x20runtime\x20roles\x20can\x20be\x20modified\x20or\x20deleted.');}export function projectRuntimeRole(_0x1342d0){const _0x3196ea=a53_0x253511;return{'id':_0x1342d0['id'],'roleName':_0x1342d0[_0x3196ea(0x1f5)],'roleType':_0x1342d0['roleType'],'remark':_0x1342d0[_0x3196ea(0x1d1)],'userCount':_0x1342d0['userCount']??0x0,'permitCount':_0x1342d0[_0x3196ea(0x1ca)]??0x0,'builtin':isBuiltinRuntimeRole(_0x1342d0['roleType'])};}function a53_0x4765(){const _0x3f7406=['join','applyUserList','user-add','test','265498gbBwFa','userName','roleName','isSafeInteger','272FpwgNt','\x22\x20is\x20ambiguous.','appCode','Reload\x20the\x20role\x20list\x20and\x20retry\x20after\x20the\x20server\x20state\x20is\x20consistent.','Pass\x20one\x20role\x20ID:\x20','roleType','flag','CUSTOM','Pass\x20--user\x20<userId>;\x20name\x20and\x20account\x20lookup\x20are\x20not\x20available\x20in\x20runtime\x20scope.','user','Runtime\x20numeric\x20userId','6955HGhwId','276sejjFA','items','Runtime\x20role\x20id\x20','Pass\x20--role\x20<id|name>.','Transfer\x20or\x20manage\x20application\x20ownership\x20through\x20the\x20dedicated\x20application\x20workflow.','--expect-user-count\x20must\x20be\x20a\x20non-negative\x20integer.','11347kSqsgR','Runtime\x20role\x20ID\x20returned\x20by\x20role\x20list','runtime','Runtime\x20role\x20membership\x20requires\x20a\x20numeric\x20userId.','num','6844581UDquyH','OWNER\x20runtime\x20role\x20membership\x20cannot\x20be\x20changed\x20with\x20this\x20command.','Reject\x20when\x20the\x20target\x20role\x20member\x20count\x20has\x20changed','includes','Use\x20a\x20numeric\x20userId\x20returned\x20by\x20the\x20current\x20application\x27s\x20personnel\x20list.','permitCount',',\x20found\x20','Runtime\x20role\x20member\x20count\x20changed:\x20expected\x20','filter','\x20was\x20not\x20found\x20in\x20app\x20','trim','length','remark','code','Runtime\x20role\x20','push','userId','Missing\x20runtime\x20role\x20reference.','Runtime\x20role\x20ID\x20or\x20exact\x20role\x20name','621735jgpwVw','22894wakxgH','number','userList','validation','\x20is\x20missing\x20from\x20the\x20grouped\x20member\x20snapshot.','USER','\x20is\x20already\x20in\x20runtime\x20role\x20','Run\x20`lovrabet\x20role\x20list`\x20and\x20use\x20a\x20role\x20from\x20the\x20current\x20app.','2886426JAWcmJ','\x20is\x20not\x20in\x20runtime\x20role\x20','role','string','expect-user-count','Role\x20ID\x20must\x20be\x20a\x20positive\x20integer.','Runtime\x20userId\x20must\x20be\x20a\x20positive\x20safe\x20integer.','Runtime\x20user\x20','ADMIN','paging','totalCount','map','User\x20','OWNER'];a53_0x4765=function(){return _0x3f7406;};return a53_0x4765();}export async function getRuntimeRoleById(_0x5d7e38,_0x553c48){const _0x168d53=a53_0x253511;if(!Number[_0x168d53(0x1ad)](_0x553c48)||_0x553c48<=0x0)throw CliErrors[_0x168d53(0x1dc)](_0x168d53(0x1e6));const _0x342584=(await listAllRuntimeRoles(_0x5d7e38))[_0x168d53(0x1cd)](_0x31deeb=>_0x31deeb['id']===_0x553c48&&(!_0x31deeb[_0x168d53(0x1b0)]||_0x31deeb[_0x168d53(0x1b0)]===_0x5d7e38));if(_0x342584[_0x168d53(0x1d0)]!==0x1)throw CliErrors['validation'](_0x168d53(0x1bc)+_0x553c48+_0x168d53(0x1ce)+_0x5d7e38+'.',_0x168d53(0x1e0));return _0x342584[0x0];}export async function listAllRuntimeRoles(_0x1fc941,_0x802f86={}){const _0x1b7b4a=a53_0x253511,_0x5797a0=0x64,_0x53e578=[];for(let _0xff4617=0x1;;_0xff4617+=0x1){const _0x51eabe=await listRuntimeAppRoles(_0x1fc941,{..._0x802f86['roleName']?{'roleName':_0x802f86[_0x1b7b4a(0x1f5)]}:{},'currentPage':_0xff4617,'pageSize':_0x5797a0});_0x53e578['push'](..._0x51eabe[_0x1b7b4a(0x1bb)]);if(_0x51eabe[_0x1b7b4a(0x1bb)][_0x1b7b4a(0x1d0)]<_0x5797a0||_0x51eabe[_0x1b7b4a(0x1ea)]&&_0x53e578[_0x1b7b4a(0x1d0)]>=_0x51eabe[_0x1b7b4a(0x1ea)][_0x1b7b4a(0x1eb)])return _0x53e578;}}export async function resolveRuntimeRoleRef(_0x57748a,_0x26fdd5){const _0x13d1ff=a53_0x253511,_0x389449=_0x26fdd5['trim']();if(!_0x389449)throw CliErrors[_0x13d1ff(0x1dc)](_0x13d1ff(0x1d6),_0x13d1ff(0x1bd));if(/^\d+$/[_0x13d1ff(0x1f2)](_0x389449))return getRuntimeRoleById(_0x57748a,Number(_0x389449));const _0x12a1dc=(await listAllRuntimeRoles(_0x57748a))[_0x13d1ff(0x1cd)](_0x142b28=>_0x142b28[_0x13d1ff(0x1f5)]===_0x389449);if(_0x12a1dc[_0x13d1ff(0x1d0)]===0x0)throw CliErrors[_0x13d1ff(0x1dc)]('Runtime\x20role\x20name\x20\x22'+_0x389449+'\x22\x20was\x20not\x20found\x20in\x20app\x20'+_0x57748a+'.','Run\x20`lovrabet\x20role\x20list`\x20or\x20pass\x20--role\x20<id>.');if(_0x12a1dc['length']>0x1)throw CliErrors['validation']('Runtime\x20role\x20name\x20\x22'+_0x389449+_0x13d1ff(0x1af),_0x13d1ff(0x1b2)+_0x12a1dc[_0x13d1ff(0x1ec)](_0x4eaab5=>_0x4eaab5['id'])[_0x13d1ff(0x1ef)](',\x20')+'.');return _0x12a1dc[0x0];}function parseRuntimeUserId(_0xe38535){const _0x332e1c=a53_0x253511,_0x1040d9=_0xe38535['trim']();if(!/^\d+$/[_0x332e1c(0x1f2)](_0x1040d9))throw CliErrors[_0x332e1c(0x1dc)](_0x332e1c(0x1c3),_0x332e1c(0x1b6));const _0x32197c=Number(_0x1040d9);if(!Number[_0x332e1c(0x1ad)](_0x32197c)||_0x32197c<=0x0)throw CliErrors[_0x332e1c(0x1dc)](_0x332e1c(0x1e7));return _0x32197c;}export async function prepareRuntimeMemberMutation(_0x22e587,_0x3eb3fd){const _0x19c87a=a53_0x253511,_0x5bdcd5=await resolveRuntimeRoleRef(_0x22e587[_0x19c87a(0x1b0)],_0x22e587['str']('role'));if(_0x5bdcd5[_0x19c87a(0x1b3)]===_0x19c87a(0x1ee))throw CliErrors['validation'](_0x19c87a(0x1c6),_0x19c87a(0x1be));const _0x2efd69=parseRuntimeUserId(_0x22e587['str']('user')),_0x38ed8b=(await listRuntimeRoleUsers(_0x22e587[_0x19c87a(0x1b0)]))[_0x19c87a(0x1ec)](_0x35dfad=>({..._0x35dfad,'userList':[..._0x35dfad[_0x19c87a(0x1db)]??[]],'applyUserList':[..._0x35dfad[_0x19c87a(0x1f0)]??[]]})),_0x4d55ef=_0x38ed8b['find'](_0x231313=>_0x231313['id']===_0x5bdcd5['id']);if(!_0x4d55ef)throw CliErrors[_0x19c87a(0x1dc)](_0x19c87a(0x1d3)+_0x5bdcd5['id']+_0x19c87a(0x1dd),_0x19c87a(0x1b1));const _0x32fd31=_0x4d55ef[_0x19c87a(0x1db)][_0x19c87a(0x1ec)](_0x13b5ad=>_0x13b5ad[_0x19c87a(0x1d5)]),_0x41524f=_0x22e587[_0x19c87a(0x1b4)](_0x19c87a(0x1e5));if(_0x41524f!==undefined&&_0x41524f!==null&&_0x41524f!==''){const _0x37fde5=_0x22e587[_0x19c87a(0x1c4)]('expect-user-count');if(!Number['isSafeInteger'](_0x37fde5)||_0x37fde5<0x0)throw CliErrors[_0x19c87a(0x1dc)](_0x19c87a(0x1bf));if(_0x32fd31[_0x19c87a(0x1d0)]!==_0x37fde5)throw CliErrors[_0x19c87a(0x1dc)](_0x19c87a(0x1cc)+_0x37fde5+_0x19c87a(0x1cb)+_0x32fd31[_0x19c87a(0x1d0)]+'.','Read\x20the\x20current\x20members\x20and\x20retry\x20with\x20the\x20new\x20expected\x20count.');}const _0x11cfb0=_0x32fd31[_0x19c87a(0x1c8)](_0x2efd69),_0x261abf=[];let _0x1862d2=!![];if(_0x3eb3fd===_0x19c87a(0x1f1)){const _0x356e09=await listRuntimeAppUsers(_0x22e587[_0x19c87a(0x1b0)]),_0x183442=_0x356e09[_0x19c87a(0x1cd)](_0x3b3cd1=>Number(_0x3b3cd1[_0x19c87a(0x1d2)])===_0x2efd69);if(_0x183442['length']!==0x1||!_0x183442[0x0][_0x19c87a(0x1f4)]?.[_0x19c87a(0x1cf)]())throw CliErrors[_0x19c87a(0x1dc)](_0x19c87a(0x1e8)+_0x2efd69+'\x20was\x20not\x20found\x20in\x20app\x20'+_0x22e587[_0x19c87a(0x1b0)]+'.',_0x19c87a(0x1c9));_0x11cfb0?(_0x1862d2=![],_0x261abf[_0x19c87a(0x1d4)](_0x19c87a(0x1ed)+_0x2efd69+_0x19c87a(0x1df)+_0x5bdcd5['id']+'.')):_0x4d55ef['userList'][_0x19c87a(0x1d4)]({'userId':_0x2efd69,'username':_0x183442[0x0][_0x19c87a(0x1f4)]});}else!_0x11cfb0?(_0x1862d2=![],_0x261abf[_0x19c87a(0x1d4)](_0x19c87a(0x1ed)+_0x2efd69+_0x19c87a(0x1e2)+_0x5bdcd5['id']+'.')):_0x4d55ef[_0x19c87a(0x1db)]=_0x4d55ef[_0x19c87a(0x1db)]['filter'](_0x5270ff=>_0x5270ff[_0x19c87a(0x1d5)]!==_0x2efd69);return{'role':_0x5bdcd5,'userId':_0x2efd69,'roleList':_0x38ed8b,'before':{'userIds':_0x32fd31},'after':{'userIds':_0x4d55ef['userList'][_0x19c87a(0x1ec)](_0xe5ca26=>_0xe5ca26[_0x19c87a(0x1d5)])},'shouldWrite':_0x1862d2,'warnings':_0x261abf};}export function runtimeRoleWriteResult(_0x3956b1,_0xe4b04b,_0x680d00,_0x1265a1,_0x24f313,_0x2ed574=[]){const _0x17f008=a53_0x253511;return{'operation':_0x3956b1,'scope':_0x17f008(0x1c2),'selector':_0xe4b04b,'before':_0x680d00,'after':_0x1265a1,'dryRun':![],'backend':_0x24f313,'warnings':_0x2ed574};}
|
|
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 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a54_0x114178=a54_0x16c9;function a54_0x43e3(){const _0x2ff7b2=['New\x20non-empty\x20role\x20remark','Update\x20a\x20runtime\x20CUSTOM\x20role','trim','470qmiEWJ','修改当前运行应用中的自定义角色名称或备注;变更会立即影响角色展示。','New\x20role\x20name','str','Pass\x20--name\x20or\x20--remark\x20to\x20update\x20the\x20runtime\x20role.','build','high-risk-write','name','remark','body','2325120VmcpYa','The\x20current\x20runtime\x20role\x20API\x20does\x20not\x20support\x20clearing\x20an\x20existing\x20remark.','23070evITcW','appCode','--name\x20must\x20not\x20be\x20blank.','415101kXyPMz','2ONSsay','description','482877Frsyen','835feoitp','validation','update','9904580qmGwYb','1151391uMYrYo','--remark\x20must\x20not\x20be\x20blank.','POST','string','role','Preview:\x20update\x20a\x20runtime\x20CUSTOM\x20role','/client/permit/role/update','flag','3231228xOuhGK'];a54_0x43e3=function(){return _0x2ff7b2;};return a54_0x43e3();}(function(_0x1d7e88,_0x3498b5){const _0x3b3b1f=a54_0x16c9,_0x5202e1=_0x1d7e88();while(!![]){try{const _0x3e8c2d=-parseInt(_0x3b3b1f(0x100))/0x1+-parseInt(_0x3b3b1f(0x101))/0x2*(-parseInt(_0x3b3b1f(0x108))/0x3)+parseInt(_0x3b3b1f(0x110))/0x4+-parseInt(_0x3b3b1f(0x104))/0x5*(parseInt(_0x3b3b1f(0xfd))/0x6)+-parseInt(_0x3b3b1f(0x107))/0x7+-parseInt(_0x3b3b1f(0xfb))/0x8+parseInt(_0x3b3b1f(0x103))/0x9*(parseInt(_0x3b3b1f(0x114))/0xa);if(_0x3e8c2d===_0x3498b5)break;else _0x5202e1['push'](_0x5202e1['shift']());}catch(_0x49208e){_0x5202e1['push'](_0x5202e1['shift']());}}}(a54_0x43e3,0xe80e3));import{updateRuntimeAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a54_0x16c9(_0xdfc690,_0x149b9c){_0xdfc690=_0xdfc690-0xf2;const _0x43e348=a54_0x43e3();let _0x16c96c=_0x43e348[_0xdfc690];return _0x16c96c;}import{assertCustomRuntimeRole,getRuntimeRoleById,projectRuntimeRole,ROLE_ID_FLAG,runtimeRoleWriteResult}from'../../commands/role/shared.js';function updateFields(_0x12f566){const _0x16167c=a54_0x16c9,_0x531a3a=_0x12f566[_0x16167c(0x10f)](_0x16167c(0xf8))!==undefined,_0x2dd5d3=_0x12f566[_0x16167c(0x10f)](_0x16167c(0xf9))!==undefined;if(!_0x531a3a&&!_0x2dd5d3)throw CliErrors['validation'](_0x16167c(0xf5));const _0x1c00f5=_0x12f566['str'](_0x16167c(0xf8))['trim'](),_0x205d96=_0x12f566[_0x16167c(0xf4)](_0x16167c(0xf9))[_0x16167c(0x113)]();if(_0x531a3a&&!_0x1c00f5)throw CliErrors[_0x16167c(0x105)](_0x16167c(0xff));if(_0x2dd5d3&&!_0x205d96)throw CliErrors['validation'](_0x16167c(0x109),_0x16167c(0xfc));return{..._0x531a3a?{'roleName':_0x1c00f5}:{},..._0x2dd5d3?{'remark':_0x205d96}:{}};}async function prepare(_0x4df768){const _0x3aebdf=a54_0x16c9,_0x351b05=await getRuntimeRoleById(_0x4df768[_0x3aebdf(0xfe)],_0x4df768['num']('id'));return assertCustomRuntimeRole(_0x351b05,'update'),{'role':_0x351b05,'body':{'id':_0x351b05['id'],'appCode':_0x4df768[_0x3aebdf(0xfe)],...updateFields(_0x4df768)}};}export const roleUpdate={'service':a54_0x114178(0x10c),'command':a54_0x114178(0x106),'description':a54_0x114178(0x112),'risk':a54_0x114178(0xf7),'confirmationDescription':a54_0x114178(0xf2),'flags':[ROLE_ID_FLAG,{'name':a54_0x114178(0xf8),'type':a54_0x114178(0x10b),'description':a54_0x114178(0xf3)},{'name':a54_0x114178(0xf9),'type':'string','description':a54_0x114178(0x111)}],async 'validate'(_0x35421b){updateFields(_0x35421b);},async 'dryRun'(_0x4ecad5){const _0x9e6e05=a54_0x114178,{body:_0x5fe7b8}=await prepare(_0x4ecad5);return dryRun(_0x9e6e05(0x10a),_0x9e6e05(0x10e))[_0x9e6e05(0xfa)](_0x5fe7b8)[_0x9e6e05(0x102)](_0x9e6e05(0x10d))[_0x9e6e05(0xf6)]();},async 'execute'(_0x107031){const _0x4e79f8=a54_0x114178,{role:_0x5b7e43,body:_0x5c4454}=await prepare(_0x107031),_0x3e8016=await updateRuntimeAppRole(_0x5c4454);return{'ok':!![],'data':runtimeRoleWriteResult('update',{'roleId':_0x5b7e43['id']},projectRuntimeRole(_0x5b7e43),projectRuntimeRole(_0x3e8016),{'method':'POST','path':_0x4e79f8(0x10e)})};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x254de4=a55_0x2458;(function(_0x3b6105,_0x5ae341){const _0x343005=a55_0x2458,_0x3e9bce=_0x3b6105();while(!![]){try{const _0x890b80=parseInt(_0x343005(0x188))/0x1*(parseInt(_0x343005(0x186))/0x2)+-parseInt(_0x343005(0x194))/0x3+parseInt(_0x343005(0x183))/0x4+-parseInt(_0x343005(0x182))/0x5+-parseInt(_0x343005(0x191))/0x6+-parseInt(_0x343005(0x18e))/0x7+parseInt(_0x343005(0x192))/0x8;if(_0x890b80===_0x5ae341)break;else _0x3e9bce['push'](_0x3e9bce['shift']());}catch(_0x184769){_0x3e9bce['push'](_0x3e9bce['shift']());}}}(a55_0x1737,0x9d5ab));function a55_0x2458(_0x242a62,_0x2d959b){_0x242a62=_0x242a62-0x181;const _0x173714=a55_0x1737();let _0x24585a=_0x173714[_0x242a62];return _0x24585a;}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';function a55_0x1737(){const _0x39265f=['after','warnings','2134BFLKNQ','roleList','1065InLmOw','description','POST','user-add','build','userId','3499741VOhkDL','Add\x20a\x20numeric\x20userId\x20to\x20one\x20runtime\x20role','role','5015988ORreCi','2523040tePtxM','把指定运行用户加入目标角色;该用户将获得该角色对应的运行权限。','1475019lzREYJ','shouldWrite','body','high-risk-write','/client/permit/user-role/update-user-list','Preview:\x20add\x20runtime\x20role\x20member','752545IPPSoV','4683724LuTaXG'];a55_0x1737=function(){return _0x39265f;};return a55_0x1737();}export const roleUserAdd={'service':a55_0x254de4(0x190),'command':'user-add','description':a55_0x254de4(0x18f),'risk':a55_0x254de4(0x197),'confirmationDescription':a55_0x254de4(0x193),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x62315){const _0x4378a1=a55_0x254de4,_0x4a510f=await prepareRuntimeMemberMutation(_0x62315,_0x4378a1(0x18b));return dryRun(_0x4378a1(0x18a),_0x4378a1(0x198))[_0x4378a1(0x196)]({'appCode':_0x62315['appCode'],'roleList':_0x4a510f[_0x4378a1(0x187)]})[_0x4378a1(0x189)](_0x4a510f[_0x4378a1(0x195)]?_0x4378a1(0x181):_0x4a510f[_0x4378a1(0x185)][0x0])[_0x4378a1(0x18c)]();},async 'execute'(_0x323b9d){const _0x31d47b=a55_0x254de4,_0x54391c=await prepareRuntimeMemberMutation(_0x323b9d,_0x31d47b(0x18b));return _0x54391c['shouldWrite']&&await updateRuntimeRoleUsers(_0x323b9d['appCode'],_0x54391c[_0x31d47b(0x187)]),{'ok':!![],'data':runtimeRoleWriteResult('user-add',{'roleId':_0x54391c['role']['id'],'userId':_0x54391c[_0x31d47b(0x18d)]},_0x54391c['before'],_0x54391c[_0x31d47b(0x184)],{'method':'POST','path':_0x31d47b(0x198)},_0x54391c[_0x31d47b(0x185)])};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x326184=a56_0x1b40;(function(_0x5979bb,_0x203d3e){const _0x1c87e4=a56_0x1b40,_0x47ae09=_0x5979bb();while(!![]){try{const _0x53b6b6=-parseInt(_0x1c87e4(0x1ea))/0x1*(-parseInt(_0x1c87e4(0x1f3))/0x2)+parseInt(_0x1c87e4(0x1f9))/0x3+-parseInt(_0x1c87e4(0x1fb))/0x4*(-parseInt(_0x1c87e4(0x1ff))/0x5)+parseInt(_0x1c87e4(0x1f2))/0x6*(-parseInt(_0x1c87e4(0x1fa))/0x7)+-parseInt(_0x1c87e4(0x1f7))/0x8+parseInt(_0x1c87e4(0x1fd))/0x9+-parseInt(_0x1c87e4(0x1f4))/0xa;if(_0x53b6b6===_0x203d3e)break;else _0x47ae09['push'](_0x47ae09['shift']());}catch(_0x3d6b68){_0x47ae09['push'](_0x47ae09['shift']());}}}(a56_0x37dc,0xa8036));function a56_0x37dc(){const _0x5823ef=['high-risk-write','roleList','102798fjmPOd','1475742ssGDNk','10400490tzvsOz','Preview:\x20remove\x20runtime\x20role\x20member','after','666152aNLtXB','user-remove','1323147IAFWgY','301uJrTiE','4RbMjox','Remove\x20a\x20numeric\x20userId\x20from\x20one\x20runtime\x20role','3771153heBWCa','shouldWrite','4751410rYtKXB','把指定运行用户移出目标角色;该用户将失去仅由该角色授予的运行权限。','warnings','1wLiLsu','POST','build','/client/permit/user-role/update-user-list','role','userId'];a56_0x37dc=function(){return _0x5823ef;};return a56_0x37dc();}import{updateRuntimeRoleUsers}from'../../core/api-client.js';import{dryRun}from'../../framework/dryrun.js';function a56_0x1b40(_0xb96dab,_0x222e1f){_0xb96dab=_0xb96dab-0x1ea;const _0x37dc7d=a56_0x37dc();let _0x1b4088=_0x37dc7d[_0xb96dab];return _0x1b4088;}import{EXPECT_USER_COUNT_FLAG,prepareRuntimeMemberMutation,ROLE_REF_FLAG,runtimeRoleWriteResult,USER_ID_FLAG}from'../../commands/role/shared.js';export const roleUserRemove={'service':'role','command':'user-remove','description':a56_0x326184(0x1fc),'risk':a56_0x326184(0x1f0),'confirmationDescription':a56_0x326184(0x200),'flags':[ROLE_REF_FLAG,USER_ID_FLAG,EXPECT_USER_COUNT_FLAG],async 'dryRun'(_0x45e047){const _0x3bd2b0=a56_0x326184,_0x14cd0f=await prepareRuntimeMemberMutation(_0x45e047,_0x3bd2b0(0x1f8));return dryRun(_0x3bd2b0(0x1eb),'/client/permit/user-role/update-user-list')['body']({'appCode':_0x45e047['appCode'],'roleList':_0x14cd0f[_0x3bd2b0(0x1f1)]})['description'](_0x14cd0f[_0x3bd2b0(0x1fe)]?_0x3bd2b0(0x1f5):_0x14cd0f[_0x3bd2b0(0x201)][0x0])[_0x3bd2b0(0x1ec)]();},async 'execute'(_0x8f7b37){const _0x35a44b=a56_0x326184,_0x859d7c=await prepareRuntimeMemberMutation(_0x8f7b37,_0x35a44b(0x1f8));return _0x859d7c['shouldWrite']&&await updateRuntimeRoleUsers(_0x8f7b37['appCode'],_0x859d7c[_0x35a44b(0x1f1)]),{'ok':!![],'data':runtimeRoleWriteResult(_0x35a44b(0x1f8),{'roleId':_0x859d7c[_0x35a44b(0x1ee)]['id'],'userId':_0x859d7c[_0x35a44b(0x1ef)]},_0x859d7c['before'],_0x859d7c[_0x35a44b(0x1f6)],{'method':'POST','path':_0x35a44b(0x1ed)},_0x859d7c[_0x35a44b(0x201)])};}};
|